[
  {
    "path": ".babelrc",
    "content": "{\n  \"presets\": [\"@babel/preset-env\"]\n}"
  },
  {
    "path": ".eslintrc.json",
    "content": "{\n    \"env\": {\n        \"es6\": true,\n        \"browser\": true\n    },\n    \"rules\": {\n        \"no-mixed-spaces-and-tabs\": \"error\",\n        \"indent\": [\"error\", 4, {\n            \"SwitchCase\": 1,\n            \"ArrayExpression\": \"first\",\n            \"CallExpression\": {\"arguments\": \"first\"},\n            \"flatTernaryExpressions\": true\n        }],\n        \"curly\": [\"error\", \"all\"],\n        \"semi\": [\"error\", \"always\"],\n        \"brace-style\": [\"error\", \"1tbs\", {\"allowSingleLine\": true}],\n        \"quotes\": [\"error\", \"double\", {\"avoidEscape\": true}]\n    },\n    \"parserOptions\": {\n        \"sourceType\": \"module\",\n        \"ecmaVersion\": 2019\n    }\n}\n"
  },
  {
    "path": ".github/copilot-instructions.md",
    "content": "# BlockPy Development Instructions\n\nBlockPy is a web-based Python environment combining visual blocks (Blockly) and text editing, with Skulpt for client-side Python execution. It's designed for data science education with guided feedback and state exploration tools.\n\n**Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.**\n\n## Critical Setup Requirements\n\n**NEVER CANCEL builds or long-running commands** - All build operations require completion for proper validation.\n\n### Essential Dependencies and Timing\n\n- **Node.js Compatibility**: Requires `NODE_OPTIONS=\"--openssl-legacy-provider\"` for Node.js 17+ due to webpack 4.x compatibility\n- **npm install**: Use `npm install --legacy-peer-deps` (takes ~32 seconds, NEVER CANCEL - set timeout to 60+ seconds)\n- **Build process**: `NODE_OPTIONS=\"--openssl-legacy-provider\" npm run build` (takes ~11 seconds, NEVER CANCEL - set timeout to 60+ seconds)  \n- **Linting**: `npx eslint src/blockpy.js` (takes ~1.3 seconds)\n\n### Working With This Repository\n\n**CRITICAL**: This repository is part of a larger ecosystem and cannot run fully standalone. The complete setup requires multiple sibling repositories:\n\n```\nblockpy-edu/\n  skulpt/          # Python-to-JS compiler\n  blockly/         # Visual blocks library  \n  BlockMirror/     # Block-text conversion\n  blockpy/         # This repository\npedal-edu/\n  pedal/           # Feedback system\n  curriculum-ctvt/\n  curriculum-sneks/\n```\n\n## Build and Development Commands\n\n### Initial Setup\n```bash\n# Install dependencies (NEVER CANCEL - takes ~32 seconds)\nnpm install --legacy-peer-deps\n```\n\n### Building the Project\n```bash\n# Development build with watch mode (runs continuously)\nNODE_OPTIONS=\"--openssl-legacy-provider\" npm run dev\n\n# Production build (NEVER CANCEL - takes ~11 seconds)  \nNODE_OPTIONS=\"--openssl-legacy-provider\" npm run build\n```\n\n### Code Quality\n```bash\n# Lint JavaScript code (~1.3 seconds)\nnpx eslint src/blockpy.js\n\n# Lint all JS files in src/\nnpx eslint src/\n```\n\n### Testing the Build Output\n```bash\n# Start local web server for testing\npython -m http.server 8000\n\n# Access test page at: http://localhost:8000/tests/index.html\n# NOTE: Full functionality requires complete ecosystem setup\n```\n\n## Validation Scenarios\n\n**Always run these validation steps after making changes:**\n\n1. **Build Validation**: Ensure webpack builds complete successfully and generates `dist/blockpy.js`, `dist/blockpy.css`, and `dist/blockpy.min.js`\n2. **Lint Validation**: Run ESLint to catch code style issues before committing\n3. **File Structure**: Verify dist files are created with expected sizes (~1.4MB blockpy.js, ~1MB blockpy.min.js, ~38KB blockpy.css)\n\n## Important Limitations and Known Issues\n\n### What Works in This Repository Alone:\n- Build process (webpack compilation)\n- Code linting (ESLint)\n- Static file generation\n- Basic web server hosting\n\n### What Requires Full Ecosystem:\n- **Complete application functionality** - needs skulpt, blockly, BlockMirror, pedal dependencies\n- **Python code execution** - requires skulpt compiler from sibling directory\n- **Visual block editing** - requires blockly from sibling directory  \n- **Block-text conversion** - requires BlockMirror from sibling directory\n- **Feedback system** - requires pedal modules from sibling directories\n\n### Broken/Outdated Components:\n- `build.py` - fails due to missing `src/interface.html` and `src/instructor/` directory\n- `merge.py` - outdated file list, expects different src structure\n- `npm test` - not configured, returns error\n- Python preprocessing scripts are not needed with current webpack setup\n\n## File Structure and Key Locations\n\n### Critical Source Files:\n- `src/blockpy.js` - Main entry point\n- `src/editor/` - Editor components (Python, blocks, etc.)\n- `src/engine/` - Execution engine and configurations\n- `webpack.config.js` - Build configuration\n- `tests/index.html` - Main test entry point (requires ecosystem)\n\n### Generated Files (in dist/):\n- `blockpy.js` - Development build (~1.4MB)\n- `blockpy.min.js` - Production build (~1MB)\n- `blockpy.css` - Stylesheets (~38KB)\n\n### Configuration:\n- `.eslintrc.json` - ESLint configuration\n- `package.json` - npm dependencies and scripts\n- `.babelrc` - Babel transpilation settings\n\n## Common Development Tasks\n\n### Making Code Changes:\n1. Edit files in `src/` directory\n2. Run `NODE_OPTIONS=\"--openssl-legacy-provider\" npm run build`\n3. Run `npx eslint src/` to check code quality\n4. Test with `python -m http.server 8000` and verify dist files\n\n### Before Committing:\n1. **Always build**: `NODE_OPTIONS=\"--openssl-legacy-provider\" npm run build`\n2. **Always lint**: `npx eslint src/`\n3. **Verify dist files**: Check that `dist/` contains updated builds\n4. **Never commit** `node_modules/` or temporary files\n\n### Debugging Build Issues:\n- Ensure `NODE_OPTIONS=\"--openssl-legacy-provider\"` is set for Node.js 17+\n- Use `--legacy-peer-deps` flag for npm install if dependency conflicts occur\n- Check webpack output for specific error messages\n- Verify all source files exist before building\n\n## Architecture Notes\n\nBlockPy uses a component-based architecture with KnockoutJS for UI binding. The main execution flow:\n1. User code → BlockPy Engine → Configuration classes → Skulpt execution  \n2. Results → Feedback system → UI updates\n3. Editor synchronization between blocks and text via BlockMirror\n\nKey components:\n- **Editors**: Python, blocks, markdown, JSON, etc. (`src/editor/`)\n- **Engine**: Code execution and configurations (`src/engine/`)\n- **Feedback**: Result processing and presentation (`src/feedback.js`)\n- **Interface**: UI components and layouts (`src/interface.js`)\n\n**Remember: This codebase is part of a larger educational platform. For full functionality, the complete ecosystem setup is required as described in the main README.md.**"
  },
  {
    "path": ".gitignore",
    "content": "# BlockPy stuff\n\nblockly/\nskulpt/\n\nThumbs.db\nignore/\nkennel_dist/\nblockly_backup/\ndata_analysis/\nclosure-compiler/\nresearch/\ntest_corgis/\nadvertising/*.mp4\n~*.pptx\n\n# Node Stuff\npids\n*.pid\n*.seed\n*.pid.lock\nnode_modules/\njspm_packages/\n.npm\n\n# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n\n# C extensions\n*.so\n\n# Distribution / packaging\n.Python\nenv/\nvenv/\nbin/\nbuild/\ndevelop-eggs/\ndist/\n!server/static/skulpt/dist\neggs/\nlib64/\nparts/\nsdist/\nvar/\n*.egg-info/\n.installed.cfg\n*.egg\n\n# Installer logs\npip-log.txt\npip-delete-this-directory.txt\n\n# Unit test / coverage reports\nhtmlcov/\n.tox/\n.coverage\n.cache\nnosetests.xml\ncoverage.xml\n\n# Translations\n*.mo\n\n# Mr Developer\n.mr.developer.cfg\n.project\n.pydevproject\n\n# Rope\n.ropeproject\n\n# Django stuff:\n*.log\n*.pot\n\n# Sphinx documentation\ndocs/_build/\n\n"
  },
  {
    "path": ".idea/.gitignore",
    "content": "# Default ignored files\n/workspace.xml"
  },
  {
    "path": ".idea/blockpy.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module type=\"WEB_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\">\n    <content url=\"file://$MODULE_DIR$\">\n      <excludeFolder url=\"file://$MODULE_DIR$/.tmp\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/temp\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/tmp\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/venv\" />\n    </content>\n    <orderEntry type=\"inheritedJdk\" />\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Knockout\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"jquery\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"BlockMirror\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Skulpt\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Skulpt\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"D3\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": ".idea/dictionaries/acbart.xml",
    "content": "<component name=\"ProjectDictionaryState\">\n  <dictionary name=\"acbart\">\n    <words>\n      <w>blockly</w>\n      <w>blockmirror</w>\n      <w>blockpy</w>\n      <w>datasets</w>\n      <w>filewrite</w>\n      <w>hiddeness</w>\n      <w>ipynb</w>\n      <w>linestyle</w>\n      <w>skulpt</w>\n      <w>suppressions</w>\n      <w>timeit</w>\n      <w>undeletable</w>\n      <w>unrenamable</w>\n      <w>xlabel</w>\n      <w>ylabel</w>\n    </words>\n  </dictionary>\n</component>"
  },
  {
    "path": ".idea/inspectionProfiles/Project_Default.xml",
    "content": "<component name=\"InspectionProjectProfileManager\">\n  <profile version=\"1.0\">\n    <option name=\"myName\" value=\"Project Default\" />\n    <inspection_tool class=\"Eslint\" enabled=\"true\" level=\"WARNING\" enabled_by_default=\"true\" />\n    <inspection_tool class=\"PyUnresolvedReferencesInspection\" enabled=\"true\" level=\"WARNING\" enabled_by_default=\"true\">\n      <option name=\"ignoredIdentifiers\">\n        <list>\n          <option value=\"utility\" />\n        </list>\n      </option>\n    </inspection_tool>\n  </profile>\n</component>"
  },
  {
    "path": ".idea/jsLibraryMappings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"JavaScriptLibraryMappings\">\n    <file url=\"PROJECT\" libraries=\"{D3, Skulpt}\" />\n  </component>\n</project>"
  },
  {
    "path": ".idea/libraries/D3.xml",
    "content": "<component name=\"libraryTable\">\n  <library name=\"D3\" type=\"javaScript\">\n    <CLASSES>\n      <root url=\"file://$PROJECT_DIR$/libs/d3/d3.6.3.1.min.js\" />\n    </CLASSES>\n    <JAVADOC />\n    <SOURCES />\n  </library>\n</component>"
  },
  {
    "path": ".idea/libraries/Skulpt.xml",
    "content": "<component name=\"libraryTable\">\n  <library name=\"Skulpt\" type=\"javaScript\">\n    <properties>\n      <sourceFilesUrls>\n        <item url=\"file://$PROJECT_DIR$/../skulpt/dist/skulpt.js\" />\n      </sourceFilesUrls>\n    </properties>\n    <CLASSES>\n      <root url=\"file://$PROJECT_DIR$/../skulpt/dist/skulpt.js\" />\n    </CLASSES>\n    <JAVADOC />\n    <SOURCES />\n  </library>\n</component>"
  },
  {
    "path": ".idea/markdown-navigator-enh.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"MarkdownEnhProjectSettings\">\n    <AnnotatorSettings targetHasSpaces=\"true\" linkCaseMismatch=\"true\" wikiCaseMismatch=\"true\" wikiLinkHasDashes=\"true\" notUnderWikiHome=\"true\" targetNotWikiPageExt=\"true\" notUnderSourceWikiHome=\"true\" targetNameHasAnchor=\"true\" targetPathHasAnchor=\"true\" wikiLinkHasSlash=\"true\" wikiLinkHasSubdir=\"true\" wikiLinkHasOnlyAnchor=\"true\" linkTargetsWikiHasExt=\"true\" linkTargetsWikiHasBadExt=\"true\" notUnderSameRepo=\"true\" targetNotUnderVcs=\"false\" linkNeedsExt=\"true\" linkHasBadExt=\"true\" linkTargetNeedsExt=\"true\" linkTargetHasBadExt=\"true\" wikiLinkNotInWiki=\"true\" imageTargetNotInRaw=\"true\" repoRelativeAcrossVcsRoots=\"true\" multipleWikiTargetsMatch=\"true\" unresolvedLinkReference=\"true\" linkIsIgnored=\"true\" anchorIsIgnored=\"true\" anchorIsUnresolved=\"true\" anchorLineReferenceIsUnresolved=\"true\" anchorLineReferenceFormat=\"true\" anchorHasDuplicates=\"true\" abbreviationDuplicates=\"true\" abbreviationNotUsed=\"true\" attributeIdDuplicateDefinition=\"true\" attributeIdNotUsed=\"true\" footnoteDuplicateDefinition=\"true\" footnoteUnresolved=\"true\" footnoteDuplicates=\"true\" footnoteNotUsed=\"true\" macroDuplicateDefinition=\"true\" macroUnresolved=\"true\" macroDuplicates=\"true\" macroNotUsed=\"true\" referenceDuplicateDefinition=\"true\" referenceUnresolved=\"true\" referenceDuplicates=\"true\" referenceNotUsed=\"true\" referenceUnresolvedNumericId=\"true\" enumRefDuplicateDefinition=\"true\" enumRefUnresolved=\"true\" enumRefDuplicates=\"true\" enumRefNotUsed=\"true\" enumRefLinkUnresolved=\"true\" enumRefLinkDuplicates=\"true\" simTocUpdateNeeded=\"true\" simTocTitleSpaceNeeded=\"true\" />\n    <HtmlExportSettings updateOnSave=\"false\" parentDir=\"\" targetDir=\"\" cssDir=\"css\" scriptDir=\"js\" plainHtml=\"false\" imageDir=\"\" copyLinkedImages=\"false\" imagePathType=\"0\" targetPathType=\"2\" targetExt=\"\" useTargetExt=\"false\" noCssNoScripts=\"false\" useElementStyleAttribute=\"false\" linkToExportedHtml=\"true\" exportOnSettingsChange=\"true\" regenerateOnProjectOpen=\"false\" linkFormatType=\"HTTP_ABSOLUTE\" />\n    <LinkMapSettings>\n      <textMaps />\n    </LinkMapSettings>\n  </component>\n  <component name=\"MarkdownNavigatorHistory\">\n    <PasteImageHistory checkeredTransparentBackground=\"false\" filename=\"image\" directory=\"\" onPasteImageTargetRef=\"3\" onPasteLinkText=\"0\" onPasteImageElement=\"1\" onPasteLinkElement=\"1\" onPasteReferenceElement=\"2\" cornerRadius=\"20\" borderColor=\"0\" transparentColor=\"16777215\" borderWidth=\"1\" trimTop=\"0\" trimBottom=\"0\" trimLeft=\"0\" trimRight=\"0\" transparent=\"false\" roundCorners=\"false\" showPreview=\"true\" bordered=\"false\" scaled=\"false\" cropped=\"false\" hideInapplicableOperations=\"false\" preserveLinkFormat=\"false\" scale=\"50\" scalingInterpolation=\"1\" transparentTolerance=\"0\" saveAsDefaultOnOK=\"false\" linkFormat=\"0\" addHighlights=\"false\" showHighlightCoordinates=\"true\" showHighlights=\"false\" mouseSelectionAddsHighlight=\"false\" outerFilled=\"false\" outerFillColor=\"0\" outerFillTransparent=\"true\" outerFillAlpha=\"30\">\n      <highlightList />\n      <directories />\n      <filenames />\n    </PasteImageHistory>\n    <CopyImageHistory checkeredTransparentBackground=\"false\" filename=\"image\" directory=\"\" onPasteImageTargetRef=\"3\" onPasteLinkText=\"0\" onPasteImageElement=\"1\" onPasteLinkElement=\"1\" onPasteReferenceElement=\"2\" cornerRadius=\"20\" borderColor=\"0\" transparentColor=\"16777215\" borderWidth=\"1\" trimTop=\"0\" trimBottom=\"0\" trimLeft=\"0\" trimRight=\"0\" transparent=\"false\" roundCorners=\"false\" showPreview=\"true\" bordered=\"false\" scaled=\"false\" cropped=\"false\" hideInapplicableOperations=\"false\" preserveLinkFormat=\"false\" scale=\"50\" scalingInterpolation=\"1\" transparentTolerance=\"0\" saveAsDefaultOnOK=\"false\" linkFormat=\"0\" addHighlights=\"false\" showHighlightCoordinates=\"true\" showHighlights=\"false\" mouseSelectionAddsHighlight=\"false\" outerFilled=\"false\" outerFillColor=\"0\" outerFillTransparent=\"true\" outerFillAlpha=\"30\">\n      <highlightList />\n      <directories />\n      <filenames />\n    </CopyImageHistory>\n    <PasteLinkHistory onPasteImageTargetRef=\"3\" onPasteTargetRef=\"1\" onPasteLinkText=\"0\" onPasteImageElement=\"1\" onPasteLinkElement=\"1\" onPasteWikiElement=\"2\" onPasteReferenceElement=\"2\" hideInapplicableOperations=\"false\" preserveLinkFormat=\"false\" useHeadingForLinkText=\"false\" linkFormat=\"0\" saveAsDefaultOnOK=\"false\" />\n    <TableToJsonHistory>\n      <entries />\n    </TableToJsonHistory>\n    <TableSortHistory>\n      <entries />\n    </TableSortHistory>\n  </component>\n</project>"
  },
  {
    "path": ".idea/markdown-navigator.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"FlexmarkProjectSettings\">\n    <FlexmarkHtmlSettings flexmarkSpecExampleRendering=\"0\" flexmarkSpecExampleRenderHtml=\"false\">\n      <flexmarkSectionLanguages>\n        <option name=\"1\" value=\"Markdown\" />\n        <option name=\"2\" value=\"HTML\" />\n        <option name=\"3\" value=\"flexmark-ast:1\" />\n      </flexmarkSectionLanguages>\n    </FlexmarkHtmlSettings>\n  </component>\n  <component name=\"MarkdownProjectSettings\">\n    <PreviewSettings splitEditorLayout=\"SPLIT\" splitEditorPreview=\"PREVIEW\" useGrayscaleRendering=\"false\" zoomFactor=\"1.0\" maxImageWidth=\"0\" synchronizePreviewPosition=\"true\" highlightPreviewType=\"LINE\" highlightFadeOut=\"5\" highlightOnTyping=\"true\" synchronizeSourcePosition=\"true\" verticallyAlignSourceAndPreviewSyncPosition=\"true\" showSearchHighlightsInPreview=\"true\" showSelectionInPreview=\"true\" lastLayoutSetsDefault=\"false\">\n      <PanelProvider>\n        <provider providerId=\"com.vladsch.idea.multimarkdown.editor.swing.html.panel\" providerName=\"Default - Swing\" />\n      </PanelProvider>\n    </PreviewSettings>\n    <ParserSettings gitHubSyntaxChange=\"false\" correctedInvalidSettings=\"false\" emojiShortcuts=\"1\" emojiImages=\"0\">\n      <PegdownExtensions>\n        <option name=\"ANCHORLINKS\" value=\"true\" />\n        <option name=\"ATXHEADERSPACE\" value=\"true\" />\n        <option name=\"FENCED_CODE_BLOCKS\" value=\"true\" />\n        <option name=\"INTELLIJ_DUMMY_IDENTIFIER\" value=\"true\" />\n        <option name=\"RELAXEDHRULES\" value=\"true\" />\n        <option name=\"STRIKETHROUGH\" value=\"true\" />\n        <option name=\"TABLES\" value=\"true\" />\n        <option name=\"TASKLISTITEMS\" value=\"true\" />\n      </PegdownExtensions>\n      <ParserOptions>\n        <option name=\"COMMONMARK_LISTS\" value=\"true\" />\n        <option name=\"EMOJI_SHORTCUTS\" value=\"true\" />\n        <option name=\"GFM_TABLE_RENDERING\" value=\"true\" />\n        <option name=\"PRODUCTION_SPEC_PARSER\" value=\"true\" />\n        <option name=\"SIM_TOC_BLANK_LINE_SPACER\" value=\"true\" />\n      </ParserOptions>\n    </ParserSettings>\n    <HtmlSettings headerTopEnabled=\"false\" headerBottomEnabled=\"false\" bodyTopEnabled=\"false\" bodyBottomEnabled=\"false\" addPageHeader=\"false\" imageUriSerials=\"false\" addDocTypeHtml=\"true\" noParaTags=\"false\" plantUmlConversion=\"0\">\n      <GeneratorProvider>\n        <provider providerId=\"com.vladsch.idea.multimarkdown.editor.text.html.generator\" providerName=\"Unmodified HTML Generator\" />\n      </GeneratorProvider>\n      <headerTop />\n      <headerBottom />\n      <bodyTop />\n      <bodyBottom />\n    </HtmlSettings>\n    <CssSettings previewScheme=\"UI_SCHEME\" cssUri=\"\" isCssUriEnabled=\"false\" isCssUriSerial=\"true\" isCssTextEnabled=\"false\" isDynamicPageWidth=\"true\">\n      <StylesheetProvider>\n        <provider providerId=\"com.vladsch.idea.multimarkdown.editor.text.html.css\" providerName=\"No Stylesheet\" />\n      </StylesheetProvider>\n      <ScriptProviders />\n      <cssText />\n      <cssUriHistory />\n    </CssSettings>\n  </component>\n</project>"
  },
  {
    "path": ".idea/markdown.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"MarkdownSettings\">\n    <enabledExtensions>\n      <entry key=\"MermaidLanguageExtension\" value=\"false\" />\n      <entry key=\"PlantUMLLanguageExtension\" value=\"false\" />\n    </enabledExtensions>\n  </component>\n</project>"
  },
  {
    "path": ".idea/misc.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"JavaScriptSettings\">\n    <option name=\"languageLevel\" value=\"ES6\" />\n  </component>\n  <component name=\"ProjectRootManager\" version=\"2\" project-jdk-name=\"Python 3.11 (blockpy)\" project-jdk-type=\"Python SDK\" />\n</project>"
  },
  {
    "path": ".idea/modules.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"ProjectModuleManager\">\n    <modules>\n      <module fileurl=\"file://$PROJECT_DIR$/.idea/blockpy.iml\" filepath=\"$PROJECT_DIR$/.idea/blockpy.iml\" />\n    </modules>\n  </component>\n</project>"
  },
  {
    "path": ".idea/vcs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"VcsDirectoryMappings\">\n    <mapping directory=\"\" vcs=\"Git\" />\n  </component>\n</project>"
  },
  {
    "path": "LICENSE",
    "content": "Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License."
  },
  {
    "path": "README.md",
    "content": "corgis-blockly\n==============\n\n![CORGIS BlockPy](images/blockly-corgi-logo.png?raw=true \"CORGIS BlockPy\")\n\nBlockPy is a web-based Python environment that lets you work with blocks, text, or both. Designed for Data Science and equipped with powerful tools like the State Explorer and Guided Feedback, the goal of BlockPy is to let you solve authentic, real-world problems.\n\nThe goal of BlockPy is to give you a gentle introduction to Python but eventually mature you into a more serious programming environment (such as Spyder or PyCharm). Long-term, we may support some game/animation design stuff that Scratch/Snap does, but that's not the real goal.\n\nThe BlockPy project is aimed at solving some hard technical problems: having a block-based environment for a dynamic language can be tricky - are a given pair of square brackets representing list indexing or dictionary indexing? Our goal is to use advanced program analysis techniques to provide excellent support to learners.\n\nOverview\n--------\n\nThe core architecture of BlockPy is a synthesis of:\n\n* Blockly: a visual library for manipulating a block canvas that can generate equivalent textual code in a variety of languages\n* Skulpt: an in-browser Python-to-JavaScript compiler/intepreter, that aims to emulate the full language with precision if not speed.\n\nBy combining these two technologies, we end up with a powerful system for writing Python code quickly. Everything is meant to run locally in the client, so there's no complexity of sandboxing students' code on the server.\n\nInstallation\n------------\n\nFirst, you're going to need all of our special dependencies. The final structure looks like this:\n\n```\nblockpy-edu/\n  skulpt/\n  blockly/\n  BlockMirror/\n  blockpy/\npedal-edu/\n  pedal/\n  curriculum-ctvt\n  curriculum-sneks\n```\n\n1. So you can start by making the two top-level directories:\n\n```shell\n$> mkdir blockpy-edu\n$> mkdir pedal-edu\n```\n\n2. Skulpt is probably the hardest dependency, since you will probably want to modify it.\n\nNote from 4/4/2026: You need to use the `esbuild-source` branch nowadays.\n\n```shell\n$> cd blockpy-edu\n$> git clone https://github.com/blockpy-edu/skulpt skulpt\n$> cd skulpt\n$> npm install\n$> npm run devbuild\n```\n\n3. For many of the remainders, you actually only need the final compiled files (per [this file](https://github.com/blockpy-edu/blockpy/blob/master/tests/index.html#L51-L68)).\nBut if you want to install each from source, here are the github links:\n\n```shell\n$> cd blockpy-edu\n$> git clone https://github.com/blockpy-edu/BlockMirror BlockMirror\n$> git clone https://github.com/google/blockly blockly\n$> cd ../pedal-edu\n$> git clone https://github.com/pedal-edu/pedal pedal\n$> git clone https://github.com/pedal-edu/curriculum-ctvt curriculum-ctvt\n$> git clone https://github.com/pedal-edu/curriculum-sneks curriculum-sneks\n```\n\n4. To actually install the BlockPy client, you can do the following:\n\n```\n$> cd ../blockpy-edu\n$> git clone https://github.com/blockpy-edu/blockpy blockpy\n$> cd blockpy\n$> npm install\n$> npm run dev\n```\n\nThat should rebuild the files into `dist`. You can then open `tests/index.html` and explore.\n"
  },
  {
    "path": "build.py",
    "content": "import os\nimport re\n\nwith open('src/interface.html', 'r') as inp:\n    with open('src/interface.js', 'w') as output:\n        contents = inp.read()\n        cleaned_contents = contents.replace('\"', '\\\\\"').replace('\\n', '')\n        js_contents = '''\n    /**\n     * An automatically generated file, based on interface.html.\n     * An interesting problem in web development is managing HTML\n     * code in JS files. Rather than embedding string literals and\n     * concatenating them, or some other hackish soluion,\n     * we simply convert an HTML file to a JS string. Therefore,\n     * relevant edits should be in interface.html instead.\n     *\n     * The BlockPyInterface global can be seen as a constant\n     * representation of the default interface.\n     */\n    BlockPyInterface = \"{interface_code}\";\n    '''.format(interface_code=cleaned_contents)\n        output.write(js_contents)\n    \nINSTRUCTOR_ROOT = 'src/instructor/'\nwith open('src/sk_mod_instructor_extended.js', 'w') as output:\n    output.write(\"\"\"\n/**\n * An automatically generated file, based on the files in `instructors/`.\n * We need to have the python code in these files made available in the \n * JS files, so we load them in via a preprocessing step.\n */\n\nvar $INSTRUCTOR_MODULES_EXTENDED = {};\n\n\"\"\")\n    for instructor_file_name in os.listdir(INSTRUCTOR_ROOT):\n        with open(INSTRUCTOR_ROOT+instructor_file_name, 'r') as input:\n            print(instructor_file_name)\n            contents = input.read()\n            contents = contents.replace('\\\\','\\\\\\\\').replace('\"', '\\\\\"').replace('\\n', '\\\\n')\n            output.write('$INSTRUCTOR_MODULES_EXTENDED[\"{module}\"] = \"{code}\"\\n'.format(\n                module = instructor_file_name,\n                code = contents\n            ))\n"
  },
  {
    "path": "docs/BlockPy.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Class: BlockPy</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Class: BlockPy</h1>\n\n    \n\n\n\n\n<section>\n\n<header>\n    \n        <h2>BlockPy</h2>\n        \n    \n</header>\n\n<article>\n    <div class=\"container-overview\">\n    \n        \n\n    \n\n    <h4 class=\"name\" id=\"BlockPy\"><span class=\"type-signature\"></span>new BlockPy<span class=\"signature\">(settings, assignment, submission, programs)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Creates an instance of BlockPy\n</div>\n\n\n\n\n\n\n\n    <h5>This:</h5>\n    <ul><li>{<a href=\"BlockPy.html\">BlockPy</a>}</li></ul>\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>settings</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Object</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">User level settings (e.g., what view mode, whether to mute semantic errors, etc.)</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>assignment</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Object</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">Assignment level settings (data about the loaded assignment, user, submission, etc.)</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>submission</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Object</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">Unused parameter.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>programs</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Object</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">Includes the source code of any programs to be loaded</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"main.js.html\">main_v4.js</a>, <a href=\"main.js.html#line49\">line 49</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    \n    </div>\n\n    \n\n    \n\n    \n\n     \n\n    \n\n    \n        <h3 class=\"subsection-title\">Members</h3>\n\n        \n            \n<h4 class=\"name\" id=\".DEFAULT_MODULES\"><span class=\"type-signature\">(static) </span>DEFAULT_MODULES<span class=\"type-signature\"> :Array.&lt;String></span></h4>\n\n\n\n\n<div class=\"description\">\n    The default modules to make available to the user.\n</div>\n\n\n\n    <h5>Type:</h5>\n    <ul>\n        <li>\n            \n<span class=\"param-type\">Array.&lt;String></span>\n\n\n        </li>\n    </ul>\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"main.js.html\">main_v4.js</a>, <a href=\"main.js.html#line242\">line 242</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n        \n    \n\n    \n        <h3 class=\"subsection-title\">Methods</h3>\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"initComponents\"><span class=\"type-signature\"></span>initComponents<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Initializes each of the relevant components of BlockPy. For more information,\nconsult each of the component's relevant JS file in turn.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"main.js.html\">main_v4.js</a>, <a href=\"main.js.html#line289\">line 289</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"initDevelopment\"><span class=\"type-signature\"></span>initDevelopment<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Initiailizes certain development data, useful for testing out new modules in\nSkulpt.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"main.js.html\">main_v4.js</a>, <a href=\"main.js.html#line331\">line 331</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"initInterface\"><span class=\"type-signature\"></span>initInterface<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Initializes the User Inteface for the instance, by loading in the\nHTML file (which has been manually encoded into a JS string using\nthe build.py script). We do this because its a giant hassle to keep\nHTML correct when it's stored in JS strings. We should look into\nmore sophisticated templating features, probably.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"main.js.html\">main_v4.js</a>, <a href=\"main.js.html#line271\">line 271</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"initMain\"><span class=\"type-signature\"></span>initMain<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Initializes the BlockPy object by initializing its interface,\nmodel, and components.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"main.js.html\">main_v4.js</a>, <a href=\"main.js.html#line253\">line 253</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"initModel\"><span class=\"type-signature\"></span>initModel<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Applys the KnockoutJS bindings to the model, instantiating the values into the\nHTML.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"main.js.html\">main_v4.js</a>, <a href=\"main.js.html#line281\">line 281</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"reportError\"><span class=\"type-signature\"></span>reportError<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Redundant method for reporting an error. If this is used anywhere, it should be\nconverted to direct calls to components.feedback.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"main.js.html\">main_v4.js</a>, <a href=\"main.js.html#line341\">line 341</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"setCode\"><span class=\"type-signature\"></span>setCode<span class=\"signature\">(code, name<span class=\"signature-attributes\">nullable</span>)</span><span class=\"type-signature\"> &rarr; {Boolean}</span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Helper function for setting the current code, optionally in the given filename.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n        <th>Attributes</th>\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>code</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n                <td class=\"attributes\">\n                \n\n                \n\n                \n                </td>\n            \n\n            \n\n            <td class=\"description last\">The new Python source code to set.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>name</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n                <td class=\"attributes\">\n                \n\n                \n                    &lt;nullable><br>\n                \n\n                \n                </td>\n            \n\n            \n\n            <td class=\"description last\">An optional filename (e.g,. '__main__') to update. Defaults to the currently selected filename.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"main.js.html\">main_v4.js</a>, <a href=\"main.js.html#line357\">line 357</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<h5>Returns:</h5>\n\n        \n<div class=\"param-desc\">\n    - whether the code was updated (i.e. there was a diff between new and old).\n</div>\n\n\n\n<dl>\n    <dt>\n        Type\n    </dt>\n    <dd>\n        \n<span class=\"param-type\">Boolean</span>\n\n\n    </dd>\n</dl>\n\n    \n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"turnOnHacks\"><span class=\"type-signature\"></span>turnOnHacks<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Function for running any code that fixes bugs and stuff upstream.\nNot pleasant that this exists, but better to have it isolated than\njust lying about randomly...\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"main.js.html\">main_v4.js</a>, <a href=\"main.js.html#line372\">line 372</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n    \n\n    \n\n    \n</article>\n\n</section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:04 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>"
  },
  {
    "path": "docs/BlockPyCorgis.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Class: BlockPyCorgis</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Class: BlockPyCorgis</h1>\n\n    \n\n\n\n\n<section>\n\n<header>\n    \n        <h2>BlockPyCorgis</h2>\n        \n    \n</header>\n\n<article>\n    <div class=\"container-overview\">\n    \n        \n\n    \n\n    <h4 class=\"name\" id=\"BlockPyCorgis\"><span class=\"type-signature\"></span>new BlockPyCorgis<span class=\"signature\">(main)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Module that connects to the CORGIS datasets and manages interactions\nwith them. This includes loading in datasets at launch and on-the-fly.\nNote that this has no presence on screen, so it does not have a tag.\n</div>\n\n\n\n\n\n\n\n    <h5>This:</h5>\n    <ul><li>{<a href=\"BlockPyCorgis.html\">BlockPyCorgis</a>}</li></ul>\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>main</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Object</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The main BlockPy instance</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"corgis.js.html\">corgis.js</a>, <a href=\"corgis.js.html#line12\">line 12</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    \n    </div>\n\n    \n\n    \n\n    \n\n     \n\n    \n\n    \n\n    \n        <h3 class=\"subsection-title\">Methods</h3>\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"importDataset\"><span class=\"type-signature\"></span>importDataset<span class=\"signature\">(slug, name)</span><span class=\"type-signature\"> &rarr; {Array.&lt;Deferred>}</span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Loads the definitions for a dataset into the environment, including\nthe dataset (as a JS file), the skulpt bindings, and the blockly\nbindings. This requires access to a CORGIS server, and occurs\nasynchronously. The requests are fired and their deferred objects\nare returned - callers can use this information to perform an action\non completion of the import.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>slug</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The URL safe version of the dataset name</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>name</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The user-friendly version of the dataset name.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"corgis.js.html\">corgis.js</a>, <a href=\"corgis.js.html#line52\">line 52</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<h5>Returns:</h5>\n\n        \n<div class=\"param-desc\">\n    - Returns the async requests as deferred objects.\n</div>\n\n\n\n<dl>\n    <dt>\n        Type\n    </dt>\n    <dd>\n        \n<span class=\"param-type\">Array.&lt;Deferred></span>\n\n\n    </dd>\n</dl>\n\n    \n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"openDialog\"><span class=\"type-signature\"></span>openDialog<span class=\"signature\">(name)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Opens a dialog box to present the user with the datasets available\nthrough the CORGIS server. This requires a call, so this method\ncompletes asynchronously. The dialog is composed of a table with\nbuttons to load the datasets (More than one dataset can be loaded\nfrom within the dialog at a time).\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>name</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The name of the dataset to open. This is basically the user friendly version of the name, though it will be mangled into a slug.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"corgis.js.html\">corgis.js</a>, <a href=\"corgis.js.html#line85\">line 85</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n    \n\n    \n\n    \n</article>\n\n</section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:04 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>"
  },
  {
    "path": "docs/BlockPyDialog.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Class: BlockPyDialog</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Class: BlockPyDialog</h1>\n\n    \n\n\n\n\n<section>\n\n<header>\n    \n        <h2>BlockPyDialog</h2>\n        \n    \n</header>\n\n<article>\n    <div class=\"container-overview\">\n    \n        \n\n    \n\n    <h4 class=\"name\" id=\"BlockPyDialog\"><span class=\"type-signature\"></span>new BlockPyDialog<span class=\"signature\">(main, tag)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    A utility object for quickly and conveniently generating dialog boxes.\nUnfortunately, this doesn't dynamically create new boxes; it reuses the same one\nover and over again. It turns out dynamically generating new dialog boxes\nis a pain! So we can't stack them.\n</div>\n\n\n\n\n\n\n\n    <h5>This:</h5>\n    <ul><li>{<a href=\"BlockPyDialog.html\">BlockPyDialog</a>}</li></ul>\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>main</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Object</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The main BlockPy instance</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>tag</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">HTMLElement</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The HTML object this is attached to.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"dialog.js.html\">dialog.js</a>, <a href=\"dialog.js.html#line12\">line 12</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    \n    </div>\n\n    \n\n    \n\n    \n\n     \n\n    \n\n    \n\n    \n        <h3 class=\"subsection-title\">Methods</h3>\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"show\"><span class=\"type-signature\"></span>show<span class=\"signature\">(title, body, onclose)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    A simple externally available function for popping up a dialog\nmessage. This menu will be draggable by its title.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>title</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The title of the message dialog. Can have HTML.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>body</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The body of the message dialog. Can have HTML.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>onclose</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">function</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">A function to be run when the user closes the dialog.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"dialog.js.html\">dialog.js</a>, <a href=\"dialog.js.html#line28\">line 28</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n    \n\n    \n\n    \n</article>\n\n</section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:04 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>"
  },
  {
    "path": "docs/BlockPyEditor.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Class: BlockPyEditor</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Class: BlockPyEditor</h1>\n\n    \n\n\n\n\n<section>\n\n<header>\n    \n        <h2>BlockPyEditor</h2>\n        \n    \n</header>\n\n<article>\n    <div class=\"container-overview\">\n    \n        \n\n    \n\n    <h4 class=\"name\" id=\"BlockPyEditor\"><span class=\"type-signature\"></span>new BlockPyEditor<span class=\"signature\">(main, tag)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    An object that manages the various editors, where users can edit their program. Also manages the\nmovement between editors.\nThere are currently four editors:\n - Blocks: A Blockly instance\n - Text: A CodeMirror instance\n - Instructor: Features for changing the assignment and environment settings\n - Upload: (Incomplete) A menu for uploading and running code from a desktop file.\n</div>\n\n\n\n\n\n\n\n    <h5>This:</h5>\n    <ul><li>{<a href=\"BlockPyEditor.html\">BlockPyEditor</a>}</li></ul>\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>main</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Object</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The main BlockPy instance</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>tag</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">HTMLElement</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The HTML object this is attached to.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line15\">line 15</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    \n    </div>\n\n    \n\n    \n\n    \n\n     \n\n    \n\n    \n        <h3 class=\"subsection-title\">Members</h3>\n\n        \n            \n<h4 class=\"name\" id=\".CATEGORY_MAP\"><span class=\"type-signature\">(static) </span>CATEGORY_MAP<span class=\"type-signature\"></span></h4>\n\n\n\n\n<div class=\"description\">\n    Maps short category names in the toolbox to the full XML used to\nrepresent that category as usual. This is kind of a clunky mechanism\nfor managing the different categories, and doesn't allow us to specify\nindividual blocks.\n</div>\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line819\">line 819</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n        \n            \n<h4 class=\"name\" id=\"previousLine\"><span class=\"type-signature\"></span>previousLine<span class=\"type-signature\"></span></h4>\n\n\n\n\n\n\n\n\n\n\n    <h5 class=\"subsection-title\">Properties:</h5>\n\n    \n\n<table class=\"props\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>previousLine</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Number</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">Keeps track of the previously highlighted line.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line643\">line 643</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n        \n    \n\n    \n        <h3 class=\"subsection-title\">Methods</h3>\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"addAvailableModule\"><span class=\"type-signature\"></span>addAvailableModule<span class=\"signature\">(name)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Makes the module available in the availableModules multi-select menu by adding\nit to the list.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>name</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The name of the module (human-friendly version, as opposed to the slug) to be added.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line214\">line 214</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"changeProgram\"><span class=\"type-signature\"></span>changeProgram<span class=\"signature\">(name)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Updates the current file being edited in the editors.\nThis appears to be deprecated.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>name</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The name of the file being edited (e.g, \"__main__\", \"starting_code\")</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line795\">line 795</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"copyImage\"><span class=\"type-signature\"></span>copyImage<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Shows a dialog window with the current block workspace encoded as a\ndownloadable PNG image.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line1090\">line 1090</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"getBlocksFromXml\"><span class=\"type-signature\"></span>getBlocksFromXml<span class=\"signature\">()</span><span class=\"type-signature\"> &rarr; {XMLDom}</span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Helper function for retrieving the current Blockly workspace as\nan XML DOM object.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line626\">line 626</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<h5>Returns:</h5>\n\n        \n<div class=\"param-desc\">\n    The blocks in the current workspace.\n</div>\n\n\n\n<dl>\n    <dt>\n        Type\n    </dt>\n    <dd>\n        \n<span class=\"param-type\">XMLDom</span>\n\n\n    </dd>\n</dl>\n\n    \n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"getHighlightMap\"><span class=\"type-signature\"></span>getHighlightMap<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    DEPRECATED, thankfully\nBuilds up an array indicating the relevant block ID for a given step.\nOperates on the current this.blockly instance\nIt works by injecting __HIGHLIGHT__(id); at the start of every line of code\n and then extracting that with regular expressions. This makes it vulnerable\n if someone decides to use __HIGHLIGHT__ in their code. I'm betting on that\n never being a problem, though. Still, this was a miserable way of accomplishing\n the desired behavior.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line767\">line 767</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"getPngFromBlocks\"><span class=\"type-signature\"></span>getPngFromBlocks<span class=\"signature\">(callback)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Generates a PNG version of the current workspace. This PNG is stored in a Base-64 encoded\nstring as part of a data URL (e.g., \"data:image/png;base64,...\").\nTODO: There seems to be some problems capturing blocks that don't start with\nstatement level blocks (e.g., expression blocks).\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>callback</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">function</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">A function to be called with the results. This function should take two parameters, the URL (as a string) of the generated base64-encoded PNG and the IMG tag.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line1027\">line 1027</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"hideBlockMenu\"><span class=\"type-signature\"></span>hideBlockMenu<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Hides the Block tab, which involves shrinking it and hiding the Blockly instance.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line280\">line 280</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"hideInstructorMenu\"><span class=\"type-signature\"></span>hideInstructorMenu<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Hides the Instructor tab, which shrinking it.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line319\">line 319</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"hideSplitMenu\"><span class=\"type-signature\"></span>hideSplitMenu<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Hides the Text tab, which involves shrinking it and hiding its CodeMirror too.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line224\">line 224</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"hideTextMenu\"><span class=\"type-signature\"></span>hideTextMenu<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Hides the Text tab, which involves shrinking it and hiding its CodeMirror too.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line248\">line 248</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"hideUploadMenu\"><span class=\"type-signature\"></span>hideUploadMenu<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Hides the Upload tab, which shrinking it.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line303\">line 303</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"highlightBlock\"><span class=\"type-signature\"></span>highlightBlock<span class=\"signature\">(block)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Highlights a block in Blockly. Unfortunately, this is the same as selecting it.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>block</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Number</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The ID of the block object to highlight.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line692\">line 692</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"highlightError\"><span class=\"type-signature\"></span>highlightError<span class=\"signature\">(line)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Highlights a line of code in the CodeMirror instance. This applies the \"error\" style\nwhich is meant to suggest that a line is wrong.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>line</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Number</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The line of code to highlight. I think this is zero indexed?</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line677\">line 677</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"highlightLine\"><span class=\"type-signature\"></span>highlightLine<span class=\"signature\">(line)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Highlights a line of code in the CodeMirror instance. This applies the \"active\" style\nwhich is meant to bring attention to a line, but not suggest it is wrong.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>line</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Number</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The line of code to highlight. I think this is zero indexed?</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line662\">line 662</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"initBlockly\"><span class=\"type-signature\"></span>initBlockly<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Initializes the Blockly instance (handles all the blocks). This includes\nattaching a number of ChangeListeners that can keep the internal code\nrepresentation updated and enforce type checking.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line79\">line 79</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"initInstructor\"><span class=\"type-signature\"></span>initInstructor<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Initializes the Instructor tab, which has a number of buttons and menus for\nmanipulating assignments and the environment. One important job is to register the\nSummerNote instance used for editing the Introduction of the assignment.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line185\">line 185</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"initText\"><span class=\"type-signature\"></span>initText<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Initializes the CodeMirror instance. This handles text editing (with syntax highlighting)\nand also attaches a listener for change events to update the internal code represntation.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line138\">line 138</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"refreshBlockHighlight\"><span class=\"type-signature\"></span>refreshBlockHighlight<span class=\"signature\">(line)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Used to restore a block's highlight when travelling from the code tab. This\nuses a mapping between the blocks and text that is generated from the parser.\nThe parser has stored the relevant line numbers for each block in the XML of the\nblock. Very sophisticated, and sadly fairly fragile.\nTODO: I believe there's some kind of off-by-one error here...\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>line</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Number</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The line of code to highlight. I think this is zero indexed?</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line705\">line 705</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"refreshHighlight\"><span class=\"type-signature\"></span>refreshHighlight<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Assuming that a line has been highlighted previously, this will set the\nline to be highlighted again. Used when we need to restore a highlight.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line649\">line 649</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"resetBlockSilence\"><span class=\"type-signature\"></span>resetBlockSilence<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Resets the silenceBlock after a short delay\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line576\">line 576</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"setBlocksFromXml\"><span class=\"type-signature\"></span>setBlocksFromXml<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Helper function for setting the current Blockly workspace to\nwhatever XML DOM is given. This clears out any existing blocks.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line634\">line 634</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"setLevel\"><span class=\"type-signature\"></span>setLevel<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Eventually will be used to update \"levels\" of sophistication of the code interface.\nCurrently unimplemented and unused.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line809\">line 809</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"setMode\"><span class=\"type-signature\"></span>setMode<span class=\"signature\">(mode)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Dispatch method to set the mode to the given argument.\nIf the mode is invalid, an editor error is reported. If the\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>mode</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The new mode to set to (\"Blocks\", \"Text\", \"Upload\", or \"Instructor\")</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line427\">line 427</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"setModeToBlocks\"><span class=\"type-signature\"></span>setModeToBlocks<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Sets the current editor mode to Blocks, hiding the other menus.\nAlso forces the block side to update.\nThere is a chance this could fail, if the text side is irredeemably\nawful. So then the editor bounces back to the text side.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line350\">line 350</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"setModeToInstructor\"><span class=\"type-signature\"></span>setModeToInstructor<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Sets the current editor mode to the Instructor mode, hiding the other menus.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line404\">line 404</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"setModeToSplit\"><span class=\"type-signature\"></span>setModeToSplit<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Sets the current editor mode to Split mode, hiding the other menus.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line390\">line 390</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"setModeToText\"><span class=\"type-signature\"></span>setModeToText<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Sets the current editor mode to Text, hiding the other menus.\nAlso forces the text side to update.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line336\">line 336</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"setModeToUpload\"><span class=\"type-signature\"></span>setModeToUpload<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Sets the current editor mode to Upload mode, hiding the other menus.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line379\">line 379</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"setText\"><span class=\"type-signature\"></span>setText<span class=\"signature\">(code)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Actually changes the value of the CodeMirror instance\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>code</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The new code for the CodeMirror</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line455\">line 455</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"showBlockMenu\"><span class=\"type-signature\"></span>showBlockMenu<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Shows the Block tab, which involves restoring its height and showing the Blockly instance.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line290\">line 290</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"showInstructorMenu\"><span class=\"type-signature\"></span>showInstructorMenu<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Shows the Instructor tab, which involves restoring its height.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line327\">line 327</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"showSplitMenu\"><span class=\"type-signature\"></span>showSplitMenu<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Shows the Text tab, which requires restoring its height, showing AND refreshing\nthe CodeMirror instance.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line233\">line 233</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"showTextMenu\"><span class=\"type-signature\"></span>showTextMenu<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Shows the Text tab, which requires restoring its height, showing AND refreshing\nthe CodeMirror instance.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line259\">line 259</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"showUploadMenu\"><span class=\"type-signature\"></span>showUploadMenu<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Shows the Upload tab, which involves restoring its height.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line311\">line 311</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"unhighlightBlock\"><span class=\"type-signature\"></span>unhighlightBlock<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Removes the outline around a block. Currently unused.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line741\">line 741</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"unhighlightLines\"><span class=\"type-signature\"></span>unhighlightLines<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Removes any highlight in the text code editor.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line749\">line 749</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"updateBlocks\"><span class=\"type-signature\"></span>updateBlocks<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Attempts to update the model for the current code file from the \nblock workspace. Might be prevented if an update event was already\npercolating.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line531\">line 531</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"updateBlocksFromModel\"><span class=\"type-signature\"></span>updateBlocksFromModel<span class=\"signature\">()</span><span class=\"type-signature\"> &rarr; {Boolean}</span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Updates the block editor from the current code file in the\nmodel. Might be prevented if an update event was already\npercolating. This can also report an error if one occurs.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line609\">line 609</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<h5>Returns:</h5>\n\n        \n<div class=\"param-desc\">\n    Returns true upon success.\n</div>\n\n\n\n<dl>\n    <dt>\n        Type\n    </dt>\n    <dd>\n        \n<span class=\"param-type\">Boolean</span>\n\n\n    </dd>\n</dl>\n\n    \n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"updateTextFromModel\"><span class=\"type-signature\"></span>updateTextFromModel<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Updates the text editor from the current code file in the\nmodel. Might be prevented if an update event was already\npercolating.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line592\">line 592</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"updateToolbox\"><span class=\"type-signature\"></span>updateToolbox<span class=\"signature\">(only_set)</span><span class=\"type-signature\"> &rarr; (nullable) {String}</span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Creates an updated representation of the Toolboxes XML as currently specified in the\nmodel, using whatever modules have been added or removed. This method can either set it\nor just retrieve it for future use.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>only_set</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Boolean</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">Whether to return the XML string or to actually set the XML. False means that it will not update the toolbox!</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line964\">line 964</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<h5>Returns:</h5>\n\n        \n<div class=\"param-desc\">\n    Possibly returns the XML of the toolbox as a string.\n</div>\n\n\n\n<dl>\n    <dt>\n        Type\n    </dt>\n    <dd>\n        \n<span class=\"param-type\">String</span>\n\n\n    </dd>\n</dl>\n\n    \n\n\n\n        \n    \n\n    \n\n    \n</article>\n\n</section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:04 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>"
  },
  {
    "path": "docs/BlockPyEngine.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Class: BlockPyEngine</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Class: BlockPyEngine</h1>\n\n    \n\n\n\n\n<section>\n\n<header>\n    \n        <h2>BlockPyEngine</h2>\n        \n    \n</header>\n\n<article>\n    <div class=\"container-overview\">\n    \n        \n\n    \n\n    <h4 class=\"name\" id=\"BlockPyEngine\"><span class=\"type-signature\"></span>new BlockPyEngine<span class=\"signature\">(main, tag)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    An object for executing Python code and passing the results along to interested components.\n</div>\n\n\n\n\n\n\n\n    <h5>This:</h5>\n    <ul><li>{<a href=\"BlockPyEditor.html\">BlockPyEditor</a>}</li></ul>\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>main</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Object</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The main BlockPy instance</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>tag</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">HTMLElement</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The HTML object this is attached to.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"engine.js.html\">engine.js</a>, <a href=\"engine.js.html#line9\">line 9</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    \n    </div>\n\n    \n\n    \n\n    \n\n     \n\n    \n\n    \n        <h3 class=\"subsection-title\">Members</h3>\n\n        \n            \n<h4 class=\"name\" id=\"onExecutionEnd\"><span class=\"type-signature\"></span>onExecutionEnd<span class=\"type-signature\"></span></h4>\n\n\n\n\n<div class=\"description\">\n    Definable function to be run when execution has fully ended,\nwhether it succeeds or fails.\n</div>\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"engine.js.html\">engine.js</a>, <a href=\"engine.js.html#line24\">line 24</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n        \n    \n\n    \n        <h3 class=\"subsection-title\">Methods</h3>\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"analyze\"><span class=\"type-signature\"></span>analyze<span class=\"signature\">()</span><span class=\"type-signature\"> &rarr; {Boolean}</span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Runs the AbstractInterpreter to get some static information about the code,\nincluding potential semantic errors. It then parses that information to give\nfeedback.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"engine.js.html\">engine.js</a>, <a href=\"engine.js.html#line177\">line 177</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<h5>Returns:</h5>\n\n        \n<div class=\"param-desc\">\n    Whether the code was successfully analyzed.\n</div>\n\n\n\n<dl>\n    <dt>\n        Type\n    </dt>\n    <dd>\n        \n<span class=\"param-type\">Boolean</span>\n\n\n    </dd>\n</dl>\n\n    \n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"analyzeVariables\"><span class=\"type-signature\"></span>analyzeVariables<span class=\"signature\">()</span><span class=\"type-signature\"> &rarr; {Object.&lt;String, AIType>}</span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Runs the AbstractInterpreter to get some static information about the code,\nin particular the variables' types. This is needed for type checking.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"engine.js.html\">engine.js</a>, <a href=\"engine.js.html#line158\">line 158</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<h5>Returns:</h5>\n\n        \n<div class=\"param-desc\">\n    Maps variable names (as Strings) to types as constructed by the AbstractIntepreter.\n</div>\n\n\n\n<dl>\n    <dt>\n        Type\n    </dt>\n    <dd>\n        \n<span class=\"param-type\">Object.&lt;String, AIType></span>\n\n\n    </dd>\n</dl>\n\n    \n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"executionEnd_\"><span class=\"type-signature\"></span>executionEnd_<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Helper function that will attempt to call the defined onExecutionEnd,\nbut will do nothing if there is no function defined.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"engine.js.html\">engine.js</a>, <a href=\"engine.js.html#line30\">line 30</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"lastStep\"><span class=\"type-signature\"></span>lastStep<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Called at the end of the Skulpt execution to terminate the executionBuffer\nand hand it off to the execution trace in the model.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"engine.js.html\">engine.js</a>, <a href=\"engine.js.html#line143\">line 143</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"loadEngine\"><span class=\"type-signature\"></span>loadEngine<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Initializes the Python Execution engine and the Printer (console).\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"engine.js.html\">engine.js</a>, <a href=\"engine.js.html#line39\">line 39</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"readFile\"><span class=\"type-signature\"></span>readFile<span class=\"signature\">(filename)</span><span class=\"type-signature\"> &rarr; {String}</span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Used to access Skulpt built-ins. This is pretty generic, taken\nalmost directly from the Skulpt docs.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>filename</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The python filename (e.g., \"os\" or \"pprint\") that will be loaded.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"engine.js.html\">engine.js</a>, <a href=\"engine.js.html#line80\">line 80</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n<h5>Throws:</h5>\n\n        \n\n    <div class=\"param-desc\">\n    \n        Will throw an error if the file isn't found.\n    \n    </div>\n\n\n    \n\n\n<h5>Returns:</h5>\n\n        \n<div class=\"param-desc\">\n    The JavaScript source code of the file (weird, right?)\n</div>\n\n\n\n<dl>\n    <dt>\n        Type\n    </dt>\n    <dd>\n        \n<span class=\"param-type\">String</span>\n\n\n    </dd>\n</dl>\n\n    \n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"reset\"><span class=\"type-signature\"></span>reset<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Resets the state of the execution engine, including reinitailizing\nthe execution buffer (trace, step, etc.), reseting the printer, and\nhiding the trace button.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"engine.js.html\">engine.js</a>, <a href=\"engine.js.html#line94\">line 94</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"run\"><span class=\"type-signature\"></span>run<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Runs the given python code, resetting the console and Trace Table.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"engine.js.html\">engine.js</a>, <a href=\"engine.js.html#line251\">line 251</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"step\"><span class=\"type-signature\"></span>step<span class=\"signature\">(variables, lineNumber, columnNumber, filename, astType, ast)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    \"Steps\" the execution of the code, meant to be used as a callback to the Skulpt\nenvironment.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>variables</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Object</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">Hash that maps the names of variables (Strings) to their Skulpt representation.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>lineNumber</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Number</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The corresponding line number in the source code that is being executed.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>columnNumber</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Number</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The corresponding column number in the source code that is being executed. Think of it as the \"X\" position to the lineNumber's \"Y\" position.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>filename</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The name of the python file being executed (e.g., \"__main__.py\").</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>astType</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">Unused? TODO: What is this?</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>ast</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">String-encoded JSON representation of the AST node associated with this element.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"engine.js.html\">engine.js</a>, <a href=\"engine.js.html#line120\">line 120</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n    \n\n    \n\n    \n</article>\n\n</section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:04 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>"
  },
  {
    "path": "docs/BlockPyEnglish.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Class: BlockPyEnglish</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Class: BlockPyEnglish</h1>\n\n    \n\n\n\n\n<section>\n\n<header>\n    \n        <h2>BlockPyEnglish</h2>\n        \n    \n</header>\n\n<article>\n    <div class=\"container-overview\">\n    \n        \n\n    \n\n    <h4 class=\"name\" id=\"BlockPyEnglish\"><span class=\"type-signature\"></span>new BlockPyEnglish<span class=\"signature\">(main)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    An object for handling the conversion of Python to an English transliteration.\nCurrently dummied out, but we will bring this feature back.\n</div>\n\n\n\n\n\n\n\n    <h5>This:</h5>\n    <ul><li>{<a href=\"BlockPyEnglish.html\">BlockPyEnglish</a>}</li></ul>\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>main</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Object</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The main BlockPy instance</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"english.js.html\">english.js</a>, <a href=\"english.js.html#line9\">line 9</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    \n    </div>\n\n    \n\n    \n\n    \n\n     \n\n    \n\n    \n\n    \n        <h3 class=\"subsection-title\">Methods</h3>\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"openDialog\"><span class=\"type-signature\"></span>openDialog<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    A method for opening a dialog with the english transliteration.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"english.js.html\">english.js</a>, <a href=\"english.js.html#line16\">line 16</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n    \n\n    \n\n    \n</article>\n\n</section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:04 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>"
  },
  {
    "path": "docs/BlockPyFeedback.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Class: BlockPyFeedback</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Class: BlockPyFeedback</h1>\n\n    \n\n\n\n\n<section>\n\n<header>\n    \n        <h2>BlockPyFeedback</h2>\n        \n    \n</header>\n\n<article>\n    <div class=\"container-overview\">\n    \n        \n\n    \n\n    <h4 class=\"name\" id=\"BlockPyFeedback\"><span class=\"type-signature\"></span>new BlockPyFeedback<span class=\"signature\">(main, tag)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    An object that manages the feedback area, where users are told the state of their\nprogram's execution and given guidance. Also manages the creation of the Trace Table.\n</div>\n\n\n\n\n\n\n\n    <h5>This:</h5>\n    <ul><li>{<a href=\"BlockPyFeedback.html\">BlockPyFeedback</a>}</li></ul>\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>main</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Object</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The main BlockPy instance</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>tag</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">HTMLElement</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The HTML object this is attached to.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"feedback.js.html\">feedback.js</a>, <a href=\"feedback.js.html#line10\">line 10</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    \n    </div>\n\n    \n\n    \n\n    \n\n     \n\n    \n\n    \n\n    \n        <h3 class=\"subsection-title\">Methods</h3>\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"buildTraceTable\"><span class=\"type-signature\"></span>buildTraceTable<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Reload the trace table, showing it if it was hidden and\nresetting its position to the last step.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"feedback.js.html\">feedback.js</a>, <a href=\"feedback.js.html#line30\">line 30</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"clear\"><span class=\"type-signature\"></span>clear<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Clears any output currently in the feedback area. Also resets the printer and\nany highlighted lines in the editor.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"feedback.js.html\">feedback.js</a>, <a href=\"feedback.js.html#line53\">line 53</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"clearEditorErrors\"><span class=\"type-signature\"></span>clearEditorErrors<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Clears any errors from the editor area.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"feedback.js.html\">feedback.js</a>, <a href=\"feedback.js.html#line65\">line 65</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"complete\"><span class=\"type-signature\"></span>complete<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Mark this problem as completed for the student. This will appear in the Feedback area,\nand will also unhighlight lines in the editor and log to the server.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"feedback.js.html\">feedback.js</a>, <a href=\"feedback.js.html#line95\">line 95</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"editorError\"><span class=\"type-signature\"></span>editorError<span class=\"signature\">(original, message, line)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Show an error message related to a problem with the editor. This will appear in\nthe Feedback area, the Printer, and also log to the server. The relevant line of\ncode or block will also be highlighted.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>original</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">HTML content that represents the original error message generated by the system.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>message</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">HTML content that is a hopefully friendlier message for the user explaining the error.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>line</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">number</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">What line the error occurred on.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"feedback.js.html\">feedback.js</a>, <a href=\"feedback.js.html#line80\">line 80</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"emptyProgram\"><span class=\"type-signature\"></span>emptyProgram<span class=\"signature\">(original, message, line)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Show \"Empty Program\" error, indicating the student hasn't written any code. This will appear in\nthe Feedback area, the Printer, and also log to the server. The relevant line of\ncode or block will also be highlighted.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>original</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">HTML content that represents the original error message generated by the system.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>message</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">HTML content that is a hopefully friendlier message for the user explaining the error.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>line</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">number</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">What line the error occurred on.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"feedback.js.html\">feedback.js</a>, <a href=\"feedback.js.html#line221\">line 221</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"error\"><span class=\"type-signature\"></span>error<span class=\"signature\">(html)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Raises a generic warning. This might not be used anymore.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>html</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">Some HTML content to render to the user.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"feedback.js.html\">feedback.js</a>, <a href=\"feedback.js.html#line42\">line 42</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"finished\"><span class=\"type-signature\"></span>finished<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Mark this problem as finished for the student. This will appear in the Feedback area,\nand will also unhighlight lines in the editor and log to the server.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"feedback.js.html\">feedback.js</a>, <a href=\"feedback.js.html#line108\">line 108</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"instructorFeedback\"><span class=\"type-signature\"></span>instructorFeedback<span class=\"signature\">(original, message, line)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Show an incorrect code message related to a problem as specified by the Checker. This will appear in\nthe Feedback area, the Printer, and also log to the server. The relevant line of\ncode or block will also be highlighted.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>original</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">HTML content that represents the original error message generated by the system.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>message</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">HTML content that is a hopefully friendlier message for the user explaining the error.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>line</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">number</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">What line the error occurred on.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"feedback.js.html\">feedback.js</a>, <a href=\"feedback.js.html#line201\">line 201</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"internalError\"><span class=\"type-signature\"></span>internalError<span class=\"signature\">(original, message, line)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Show an error message related to a serious internal BlockPy program. Under normal conditions,\nthis should never appear to a student. This will appear in\nthe Feedback area, the Printer, and also log to the server. The relevant line of\ncode or block will also be highlighted.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>original</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">HTML content that represents the original error message generated by the system.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>message</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">HTML content that is a hopefully friendlier message for the user explaining the error.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>line</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">number</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">What line the error occurred on.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"feedback.js.html\">feedback.js</a>, <a href=\"feedback.js.html#line182\">line 182</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"noErrors\"><span class=\"type-signature\"></span>noErrors<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    This notifies the student that their code ran without errors, but that there was no\nSuccess raised by the Checker. This will appear in the Feedback area,\nand will also unhighlight lines in the editor and log to the server.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"feedback.js.html\">feedback.js</a>, <a href=\"feedback.js.html#line122\">line 122</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"prettyPrintError\"><span class=\"type-signature\"></span>prettyPrintError<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Converts any kind of error (usually a Skulpt one) into a prettier version that's ready\nfor users to see. If it's already a string, it is passed along unchanged. But Skulpt\nerrors have to be processed more closely.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"feedback.js.html\">feedback.js</a>, <a href=\"feedback.js.html#line234\">line 234</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"printError\"><span class=\"type-signature\"></span>printError<span class=\"signature\">(error)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Print an error to the printers -- the on screen one and the browser one. This\nwill attempt to provide extra explanation and context for an error.\nNotice that this is largely for Run-time errors that will be thrown when the code\nis executed, as opposed to ones raised elsewhere in the environment.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>error</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The error message to be analyzed and printed.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"feedback.js.html\">feedback.js</a>, <a href=\"feedback.js.html#line255\">line 255</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"semanticError\"><span class=\"type-signature\"></span>semanticError<span class=\"signature\">(original, message, line)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Show an error message related to semantic error with the program (e.g., unused variable). \nThis will appear in the Feedback area, the Printer, and also log to the server. The\nrelevant line of code or block will also be highlighted.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>original</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">HTML content that represents the original error message generated by the system.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>message</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">HTML content that is a hopefully friendlier message for the user explaining the error.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>line</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">number</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">What line the error occurred on.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"feedback.js.html\">feedback.js</a>, <a href=\"feedback.js.html#line160\">line 160</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"syntaxError\"><span class=\"type-signature\"></span>syntaxError<span class=\"signature\">(original, message, line)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Show an error message related to syntax issue. This will appear in\nthe Feedback area, the Printer, and also log to the server. The relevant line of\ncode or block will also be highlighted.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>original</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">HTML content that represents the original error message generated by the system.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>message</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">HTML content that is a hopefully friendlier message for the user explaining the error.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>line</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">number</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">What line the error occurred on.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"feedback.js.html\">feedback.js</a>, <a href=\"feedback.js.html#line140\">line 140</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n    \n\n    \n\n    \n</article>\n\n</section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:04 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>"
  },
  {
    "path": "docs/BlockPyHistory.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Class: BlockPyHistory</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Class: BlockPyHistory</h1>\n\n    \n\n\n\n\n<section>\n\n<header>\n    \n        <h2>BlockPyHistory</h2>\n        \n    \n</header>\n\n<article>\n    <div class=\"container-overview\">\n    \n        \n\n    \n\n    <h4 class=\"name\" id=\"BlockPyHistory\"><span class=\"type-signature\"></span>new BlockPyHistory<span class=\"signature\">(main)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    An object for displaying the user's coding logs (their history).\nA lightweight component, its only job is to open a dialog.\n</div>\n\n\n\n\n\n\n\n    <h5>This:</h5>\n    <ul><li>{<a href=\"BlockPyHistory.html\">BlockPyHistory</a>}</li></ul>\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>main</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Object</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The main BlockPy instance</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"history.js.html\">history.js</a>, <a href=\"history.js.html#line9\">line 9</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    \n    </div>\n\n    \n\n    \n\n    \n\n     \n\n    \n\n    \n\n    \n        <h3 class=\"subsection-title\">Methods</h3>\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"openDialog\"><span class=\"type-signature\"></span>openDialog<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Opens the history dialog box. This requires a trip to the server and\noccurs asynchronously. The users' code is shown in preformatted text\ntags (no code highlighting currently) along with the timestamp.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"history.js.html\">history.js</a>, <a href=\"history.js.html#line52\">line 52</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n    \n\n    \n\n    \n</article>\n\n</section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:04 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>"
  },
  {
    "path": "docs/BlockPyPresentation.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Class: BlockPyPresentation</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Class: BlockPyPresentation</h1>\n\n    \n\n\n\n\n<section>\n\n<header>\n    \n        <h2>BlockPyPresentation</h2>\n        \n    \n</header>\n\n<article>\n    <div class=\"container-overview\">\n    \n        \n\n    \n\n    <h4 class=\"name\" id=\"BlockPyPresentation\"><span class=\"type-signature\"></span>new BlockPyPresentation<span class=\"signature\">(main, tag)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    An object for managing the blob of text at the top of a problem describing it.\nThis isn't a very busy component.\n\nTODO: Isn't most of this redundant now?\n</div>\n\n\n\n\n\n\n\n    <h5>This:</h5>\n    <ul><li>{<a href=\"BlockPyEditor.html\">BlockPyEditor</a>}</li></ul>\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>main</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Object</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The main BlockPy instance</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>tag</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">HTMLElement</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The HTML object this is attached to.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"presentation.js.html\">presentation.js</a>, <a href=\"presentation.js.html#line12\">line 12</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    \n    </div>\n\n    \n\n    \n\n    \n\n     \n\n    \n\n    \n\n    \n        <h3 class=\"subsection-title\">Methods</h3>\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"closeEditor\"><span class=\"type-signature\"></span>closeEditor<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Removes the editor when it's not in use.\nDEPRECATED\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"presentation.js.html\">presentation.js</a>, <a href=\"presentation.js.html#line24\">line 24</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"setBody\"><span class=\"type-signature\"></span>setBody<span class=\"signature\">(content)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Updates the contents of the presentation blob, possibly updating the\neditor's size too.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>content</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The new text of the presentation blob.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"presentation.js.html\">presentation.js</a>, <a href=\"presentation.js.html#line34\">line 34</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"setVisible\"><span class=\"type-signature\"></span>setVisible<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Makes the editor available or not.\nDEPRECATED.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"presentation.js.html\">presentation.js</a>, <a href=\"presentation.js.html#line43\">line 43</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"startEditor\"><span class=\"type-signature\"></span>startEditor<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Creates the Summer Note editor for the presentation blob.\nDEPRECATED.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"presentation.js.html\">presentation.js</a>, <a href=\"presentation.js.html#line55\">line 55</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n    \n\n    \n\n    \n</article>\n\n</section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:04 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>"
  },
  {
    "path": "docs/BlockPyPrinter.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Class: BlockPyPrinter</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Class: BlockPyPrinter</h1>\n\n    \n\n\n\n\n<section>\n\n<header>\n    \n        <h2>BlockPyPrinter</h2>\n        \n    \n</header>\n\n<article>\n    <div class=\"container-overview\">\n    \n        \n\n    \n\n    <h4 class=\"name\" id=\"BlockPyPrinter\"><span class=\"type-signature\"></span>new BlockPyPrinter<span class=\"signature\">(main, tag)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    An object for managing the console where printing and plotting is outputed.\n</div>\n\n\n\n\n\n\n\n    <h5>This:</h5>\n    <ul><li>{<a href=\"BlockPyEditor.html\">BlockPyEditor</a>}</li></ul>\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>main</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Object</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The main BlockPy instance</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>tag</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">HTMLElement</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The HTML object this is attached to.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"printer.js.html\">printer.js</a>, <a href=\"printer.js.html#line9\">line 9</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    \n    </div>\n\n    \n\n    \n\n    \n\n     \n\n    \n\n    \n\n    \n        <h3 class=\"subsection-title\">Methods</h3>\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"getConfiguration\"><span class=\"type-signature\"></span>getConfiguration<span class=\"signature\">()</span><span class=\"type-signature\"> &rarr; {Object}</span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Update and return the current configuration of the printer. This \ninvolves calculating its size, among other operations.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"printer.js.html\">printer.js</a>, <a href=\"printer.js.html#line39\">line 39</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<h5>Returns:</h5>\n\n        \n<div class=\"param-desc\">\n    Returns an object with information about the printer.\n</div>\n\n\n\n<dl>\n    <dt>\n        Type\n    </dt>\n    <dd>\n        \n<span class=\"param-type\">Object</span>\n\n\n    </dd>\n</dl>\n\n    \n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"print\"><span class=\"type-signature\"></span>print<span class=\"signature\">(lineText)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Print a successful line to the on-screen printer.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>lineText</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">A line of text to be printed out.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"printer.js.html\">printer.js</a>, <a href=\"printer.js.html#line71\">line 71</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"printHtml\"><span class=\"type-signature\"></span>printHtml<span class=\"signature\">(html, value)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Prints a successful HTML blob to the printer. This is typically charts,\nbut it can actually be any kind of HTML. This will probably be useful for\ndoing Turtle and Processing stuff down the road.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>html</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">HTML</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">A blob of HTML to render in the tag</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>value</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Anything</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">a value to push on the outputList for comparison. For instance, on charts this is typically the data of the chart.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"printer.js.html\">printer.js</a>, <a href=\"printer.js.html#line104\">line 104</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"resetPrinter\"><span class=\"type-signature\"></span>resetPrinter<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Reset the status of the printer, including removing any text in it and\nfixing its size.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"printer.js.html\">printer.js</a>, <a href=\"printer.js.html#line23\">line 23</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"stepPrinter\"><span class=\"type-signature\"></span>stepPrinter<span class=\"signature\">(step, page)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Updates each printed element in the printer and makes it hidden\nor visible, depending on what step we're on.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>step</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Number</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The current step of the executed program that we're on; each element in the printer must be marked with a \"data-step\" property to resolve this.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>page</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Number</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">Deprecated, not sure what this even does.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"printer.js.html\">printer.js</a>, <a href=\"printer.js.html#line57\">line 57</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n    \n\n    \n\n    \n</article>\n\n</section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:04 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>"
  },
  {
    "path": "docs/BlockPyServer.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Class: BlockPyServer</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Class: BlockPyServer</h1>\n\n    \n\n\n\n\n<section>\n\n<header>\n    \n        <h2>BlockPyServer</h2>\n        \n    \n</header>\n\n<article>\n    <div class=\"container-overview\">\n    \n        \n\n    \n\n    <h4 class=\"name\" id=\"BlockPyServer\"><span class=\"type-signature\"></span>new BlockPyServer<span class=\"signature\">(main)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Object for communicating with the external servers. This includes functionality for\nsaving and loading files, logging events, saving completions, and retrieving history.\n</div>\n\n\n\n\n\n\n\n    <h5>This:</h5>\n    <ul><li>{<a href=\"BlockPyServer.html\">BlockPyServer</a>}</li></ul>\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>main</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Object</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The main BlockPy instance</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"server.js.html\">server.js</a>, <a href=\"server.js.html#line9\">line 9</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    \n    </div>\n\n    \n\n    \n\n    \n\n     \n\n    \n\n    \n\n    \n        <h3 class=\"subsection-title\">Methods</h3>\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"finalizeSubscriptions\"><span class=\"type-signature\"></span>finalizeSubscriptions<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Some subscriptions have to happen after other things have been loaded.\nRight now this is just after CORGIS libraries have been loaded, but maybe\nwe'll add more later and this will need to be refactored.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"server.js.html\">server.js</a>, <a href=\"server.js.html#line46\">line 46</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n    \n\n    \n\n    \n</article>\n\n</section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:04 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>"
  },
  {
    "path": "docs/BlockPyToolbar.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Class: BlockPyToolbar</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Class: BlockPyToolbar</h1>\n\n    \n\n\n\n\n<section>\n\n<header>\n    \n        <h2>BlockPyToolbar</h2>\n        \n    \n</header>\n\n<article>\n    <div class=\"container-overview\">\n    \n        \n\n    \n\n    <h4 class=\"name\" id=\"BlockPyToolbar\"><span class=\"type-signature\"></span>new BlockPyToolbar<span class=\"signature\">(main, tag)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    An object that manages the main toolbar, including the different mode buttons.\nThis doesn't actually have many responsibilities after the initial load.\n</div>\n\n\n\n\n\n\n\n    <h5>This:</h5>\n    <ul><li>{<a href=\"BlockPyToolbar.html\">BlockPyToolbar</a>}</li></ul>\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>main</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Object</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The main BlockPy instance</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>tag</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">HTMLElement</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The HTML object this is attached to.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"toolbar.js.html\">toolbar.js</a>, <a href=\"toolbar.js.html#line10\">line 10</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    \n    </div>\n\n    \n\n    \n\n    \n\n     \n\n    \n\n    \n\n    \n        <h3 class=\"subsection-title\">Methods</h3>\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"activateToolbar\"><span class=\"type-signature\"></span>activateToolbar<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Register click events for more complex toolbar actions.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"toolbar.js.html\">toolbar.js</a>, <a href=\"toolbar.js.html#line74\">line 74</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"addProgram\"><span class=\"type-signature\"></span>addProgram<span class=\"signature\">(name)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Add a new button for the given filename in the Programs button group.\nThese programs will be things like \"__main__\".\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>name</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The name of the new program.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"toolbar.js.html\">toolbar.js</a>, <a href=\"toolbar.js.html#line49\">line 49</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"hidePrograms\"><span class=\"type-signature\"></span>hidePrograms<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Hide the programs button group.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"toolbar.js.html\">toolbar.js</a>, <a href=\"toolbar.js.html#line67\">line 67</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"showPrograms\"><span class=\"type-signature\"></span>showPrograms<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Show the programs button group.\n</div>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"toolbar.js.html\">toolbar.js</a>, <a href=\"toolbar.js.html#line60\">line 60</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n    \n\n    \n\n    \n</article>\n\n</section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:04 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>"
  },
  {
    "path": "docs/LocalStorageWrapper.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Class: LocalStorageWrapper</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Class: LocalStorageWrapper</h1>\n\n    \n\n\n\n\n<section>\n\n<header>\n    \n        <h2>LocalStorageWrapper</h2>\n        \n    \n</header>\n\n<article>\n    <div class=\"container-overview\">\n    \n        \n\n    \n\n    <h4 class=\"name\" id=\"LocalStorageWrapper\"><span class=\"type-signature\"></span>new LocalStorageWrapper<span class=\"signature\">(namespace)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Helper object for interfacing with the LocalStorage. The LocalStorage\nbrowser API allows for offline storage. That API is very unsophisticated,\nand is essentially a lame key-value store. This object sits on top\nand provides a number of useful utilities, including rudimentarycache\ncache expiration.\n</div>\n\n\n\n\n\n\n\n    <h5>This:</h5>\n    <ul><li>{<a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a>}</li></ul>\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>namespace</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">A namespace to use in grouping access to localstorage. This keeps access clean and organized, while also making it possible to have multiple LocalStorage connections.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"storage.js.html\">storage.js</a>, <a href=\"storage.js.html#line12\">line 12</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    \n    </div>\n\n    \n\n    \n\n    \n\n     \n\n    \n\n    \n\n    \n        <h3 class=\"subsection-title\">Methods</h3>\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"get\"><span class=\"type-signature\"></span>get<span class=\"signature\">(key)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    A method for retrieving the value associated with the given key.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>key</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The name of the key to retrieve the value for.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"storage.js.html\">storage.js</a>, <a href=\"storage.js.html#line42\">line 42</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"has\"><span class=\"type-signature\"></span>has<span class=\"signature\">(key)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    A test for whether the given key is in LocalStorage.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>key</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The key to test existence for.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"storage.js.html\">storage.js</a>, <a href=\"storage.js.html#line51\">line 51</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"is_new\"><span class=\"type-signature\"></span>is_new<span class=\"signature\">(key, server_time)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    A test for whether the server has the newer version. This function\nassumes that the server trip takes about 5 seconds. This method\nis largely deprecated.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>key</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The key to check.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>server_time</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Integer</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The server's time as an epoch (in milliseconds)</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"storage.js.html\">storage.js</a>, <a href=\"storage.js.html#line63\">line 63</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"remove\"><span class=\"type-signature\"></span>remove<span class=\"signature\">(key)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    A method for removing a key from LocalStorage.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>key</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The name of the key to remove.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"storage.js.html\">storage.js</a>, <a href=\"storage.js.html#line32\">line 32</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"set\"><span class=\"type-signature\"></span>set<span class=\"signature\">(key, value)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    A method for adding a key/value pair to LocalStorage.\nNote that both parameters must be strings (JSON.stringify is your friend).\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>key</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The name of the key.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>value</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The value.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"storage.js.html\">storage.js</a>, <a href=\"storage.js.html#line22\">line 22</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n    \n\n    \n\n    \n</article>\n\n</section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:04 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>"
  },
  {
    "path": "docs/PythonToBlocks.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Class: PythonToBlocks</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Class: PythonToBlocks</h1>\n\n    \n\n\n\n\n<section>\n\n<header>\n    \n        <h2>PythonToBlocks</h2>\n        \n    \n</header>\n\n<article>\n    <div class=\"container-overview\">\n    \n        \n\n    \n\n    <h4 class=\"name\" id=\"PythonToBlocks\"><span class=\"type-signature\"></span>new PythonToBlocks<span class=\"signature\">()</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    An object for converting Python source code to the\nBlockly XML representation.\n</div>\n\n\n\n\n\n\n\n    <h5>This:</h5>\n    <ul><li>{<a href=\"PythonToBlocks.html\">PythonToBlocks</a>}</li></ul>\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"python_to_blockly.js.html\">python_to_blockly.js</a>, <a href=\"python_to_blockly.js.html#line8\">line 8</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    \n    </div>\n\n    \n\n    \n\n    \n\n     \n\n    \n\n    \n\n    \n        <h3 class=\"subsection-title\">Methods</h3>\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"convertSource\"><span class=\"type-signature\"></span>convertSource<span class=\"signature\">(python_source)</span><span class=\"type-signature\"> &rarr; {Object}</span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    The main function for converting a string representation of Python\ncode to the Blockly XML representation.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>python_source</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">string</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The string representation of Python\n     code (e.g., \"a = 0\").</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"python_to_blockly.js.html\">python_to_blockly.js</a>, <a href=\"python_to_blockly.js.html#line30\">line 30</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<h5>Returns:</h5>\n\n        \n<div class=\"param-desc\">\n    An object which will either have the converted\n     source code or an error message and the code as a code-block.\n</div>\n\n\n\n<dl>\n    <dt>\n        Type\n    </dt>\n    <dd>\n        \n<span class=\"param-type\">Object</span>\n\n\n    </dd>\n</dl>\n\n    \n\n\n\n        \n    \n\n    \n\n    \n</article>\n\n</section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:04 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>"
  },
  {
    "path": "docs/ast_node_visitor.js.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Source: ast_node_visitor.js</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Source: ast_node_visitor.js</h1>\n\n    \n\n\n\n    \n    <section>\n        <article>\n            <pre class=\"prettyprint source linenums\"><code>/*\nvar filename = '__main__.py';\nvar python_source = 'a, b = 0\\nfor x in y:\\n    t = 0';\nparse = Sk.parse(filename, python_source);\nast = Sk.astFromParse(parse.cst, filename, parse.flags);\n*/\n\nvar iter_fields = function(node) {\n    /** Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields``\n    that is present on *node*. **/\n    var fieldList = [];\n    for (var i = 0; i &lt; node._fields.length; i += 2) {\n        var field = node._fields[i];\n        if (field in node) {\n            fieldList.push([field, node[field]]);\n        }\n    }\n    return fieldList;\n}\n\nvar iter_child_nodes = function(node) {\n    var fieldList = iter_fields(node);\n    var resultList = [];\n    for (var i = 0; i &lt; fieldList.length; i += 1) {\n        var field = fieldList[i][0], value = fieldList[i][1];\n        if (value === null) {\n            continue;\n        }\n        if (\"_astname\" in value) {\n            resultList.push(value);\n        } else if (value.constructor === Array) {\n            for (var j = 0; j &lt; value.length; j += 1) {\n                var subvalue = value[j];\n                if (\"_astname\" in subvalue) {\n                    resultList.push(subvalue);\n                }\n            }\n        }\n    }\n    return resultList;\n}\n\nfunction NodeVisitor() {};\n\nNodeVisitor.prototype.visit = function(node) {\n    /** Visit a node. **/\n    var method_name = 'visit_' + node._astname;\n    if (method_name in this) {\n        return this[method_name](node);\n    } else {\n        return this.generic_visit(node);\n    }\n}\n\nNodeVisitor.prototype.walk = function(node) {\n    var resultList = [node];\n    var childList = iter_child_nodes(node);\n    for (var i = 0; i &lt; childList.length; i += 1) {\n        var child = childList[i];\n        resultList.concat(this.walk(child));\n    }\n    return resultList;\n}\n\nNodeVisitor.prototype.visitList = function(nodes) {\n    for (var j = 0; j &lt; nodes.length; j += 1) {\n        var node = nodes[j];\n        if (\"_astname\" in node) {\n            this.visit(node);\n        }\n    }\n}\n\nNodeVisitor.prototype.generic_visit = function(node) {\n    /** Called if no explicit visitor function exists for a node. **/\n    var fieldList = iter_fields(node);\n    for (var i = 0; i &lt; fieldList.length; i += 1) {\n        var field = fieldList[i][0], value = fieldList[i][1];\n        if (value === null) {\n            continue;\n        }\n        if (Array === value.constructor) {\n            for (var j = 0; j &lt; value.length; j += 1) {\n                var subvalue = value[j];\n                if (subvalue instanceof Object &amp;&amp; \"_astname\" in subvalue) {\n                    this.visit(subvalue);\n                }\n            }\n        } else if (value instanceof Object &amp;&amp; \"_astname\" in value) {\n            this.visit(value);\n        }\n    }\n}\n\nNodeVisitor.prototype.recursive_walk = function(node) {\n    var todo = [node];\n    var result = [];\n    while (todo.length > 0) {\n        node = todo.shift();\n        todo = todo.concat(iter_child_nodes(node))\n        result.push(node);\n    }\n    return result;\n}\n\n/*\nfunction CodeAnalyzer() {\n    NodeVisitor.apply(this, Array.prototype.slice.call(arguments));\n    this.id = 0;\n};\n\nCodeAnalyzer.prototype = new NodeVisitor();\nCodeAnalyzer.prototype.visit = function(node) {\n    node._id = this.id;\n    this.id += 1;\n    NodeVisitor.prototype.visit.call(this, node);\n    //console.log(node);\n}\n*/\n\n/*\nCodeAnalyzer.prototype.visit_Num = function(node) {\n    node._id = this.id;\n    this.id += 1;\n    console.log(node.n.v);\n    // NodeVisitor.prototype.visit_Num.call(this, node);\n};*/\n\n//console.log((new NodeVisitor()).visit(ast));\n\n</code></pre>\n        </article>\n    </section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>\n"
  },
  {
    "path": "docs/conf.json",
    "content": "{\n    \"tags\": {\n        \"allowUnknownTags\": true,\n        \"dictionaries\": [\"jsdoc\",\"closure\"]\n    },\n    \"opts\": {\n        \"destination\": \"./docs/\"\n    },\n    \"source\": {\n        \"include\": [\"src\"],\n        \"includePattern\": \".+\\\\.js(doc|x)?$\",\n        \"excludePattern\": \"(^|\\\\/|\\\\\\\\)_\"\n    },\n    \"plugins\": [],\n    \"templates\": {\n        \"cleverLinks\": false,\n        \"monospaceLinks\": false\n    }\n}"
  },
  {
    "path": "docs/corgis.js.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Source: corgis.js</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Source: corgis.js</h1>\n\n    \n\n\n\n    \n    <section>\n        <article>\n            <pre class=\"prettyprint source linenums\"><code>_IMPORTED_DATASETS = {};\n\n/**\n * Module that connects to the CORGIS datasets and manages interactions\n * with them. This includes loading in datasets at launch and on-the-fly.\n * Note that this has no presence on screen, so it does not have a tag.\n *\n * @constructor\n * @this {BlockPyCorgis}\n * @param {Object} main - The main BlockPy instance\n */\nfunction BlockPyCorgis(main) {\n    this.main = main;\n    \n    this.loadedDatasets = [];\n    \n    // Load in each the datasets\n    var corgis = this;\n    var imports = [];\n    this.main.model.assignment.modules().forEach(function(name) {\n        var post_prefix = name.substring(7).replace(/\\s/g, '_').toLowerCase();\n        if (!(name in BlockPyEditor.CATEGORY_MAP)) {\n            imports.push.apply(imports, corgis.importDataset(post_prefix, name));\n        }\n    });\n    \n    // When datasets are loaded, update the toolbox.\n    $.when.apply($, imports).done(function() {\n        if (main.model.settings.editor() == \"Blocks\") {\n            main.components.editor.updateBlocksFromModel();\n        }\n        main.components.editor.updateToolbox(true);\n    }).fail(function(e) {\n        console.error(e);\n    }).always(function() {\n        main.components.server.finalizeSubscriptions();\n    });\n}\n\n/**\n * Loads the definitions for a dataset into the environment, including\n * the dataset (as a JS file), the skulpt bindings, and the blockly\n * bindings. This requires access to a CORGIS server, and occurs\n * asynchronously. The requests are fired and their deferred objects\n * are returned - callers can use this information to perform an action\n * on completion of the import.\n *\n * @param {String} slug - The URL safe version of the dataset name\n * @param {String} name - The user-friendly version of the dataset name.\n * @returns {Array.&lt;Deferred>} - Returns the async requests as deferred objects.\n */\nBlockPyCorgis.prototype.importDataset = function(slug, name) {\n    var url_retrievals = [];\n    if (this.main.model.server_is_connected('import_datasets')) {\n        var root = this.main.model.constants.urls.import_datasets+'blockpy/'+slug+'/'+slug;\n        this.main.model.status.dataset_loading.push(name);\n        // Actually get data\n        var get_dataset = $.getScript(root+'_dataset.js');\n        var get_skulpt = $.get(root+'_skulpt.js', function(data) {\n            Sk.builtinFiles['files']['src/lib/'+slug+'/__init__.js'] = data;\n        });\n        var get_blockly = $.getScript(root+'_blockly.js');\n        // On completion, update menus.\n        var corgis = this;\n        $.when(get_dataset, get_skulpt, get_blockly).done(function() {\n            corgis.loadedDatasets.push(slug);\n            corgis.main.model.assignment.modules.push(name);\n            corgis.main.components.editor.addAvailableModule(name);\n            corgis.main.model.status.dataset_loading.pop();\n        });\n        url_retrievals.push(get_dataset, get_skulpt, get_blockly);\n    }\n    return url_retrievals;\n}\n\n/**\n * Opens a dialog box to present the user with the datasets available\n * through the CORGIS server. This requires a call, so this method\n * completes asynchronously. The dialog is composed of a table with\n * buttons to load the datasets (More than one dataset can be loaded\n * from within the dialog at a time).\n * \n * @param {String} name - The name of the dataset to open. This is basically the user friendly version of the name, though it will be mangled into a slug.\n */\nBlockPyCorgis.prototype.openDialog = function(name) {\n    var corgis = this;\n    if (this.main.model.server_is_connected('import_datasets')) {\n        var root = this.main.model.constants.urls.import_datasets;\n        $.getJSON(root+'index.json', function(data) {\n            // Make up the Body\n            var datasets = data.blockpy.datasets;\n            var start = $(\"&lt;p>Documentation is available at url&lt;/p>\");\n            var body = $('&lt;table>&lt;/table>', {'class': 'table-bordered table-condensed table-striped'});\n            Object.keys(datasets).map(function(name) {\n                var title_name = name;\n                name = name.replace(/\\s/g, '_').toLowerCase();\n                var btn = $('&lt;button type=\"button\" class=\"btn btn-primary\" data-toggle=\"button\" aria-pressed=\"false\" autocomplete=\"off\">Load&lt;/button>');\n                if (corgis.loadedDatasets.indexOf(name) > -1) {\n                    set_button_loaded(btn);\n                } else {\n                    btn.click(function() {\n                        corgis.importDataset(name.toLowerCase(), 'Data - '+title_name);\n                        set_button_loaded(btn);\n                    });\n                }\n                $(\"&lt;tr>&lt;/tr>\")\n                    .append($(\"&lt;td class='col-md-4'>\"+title_name+\"&lt;/td>\"))\n                    .append($(\"&lt;td>\"+datasets[title_name]['short']+\"&lt;/td>\"))\n                    .append($(\"&lt;td class='col-md-2'>&lt;/td>\").append(btn))\n                    .appendTo(body);\n            });\n            // Show the actual dialog\n            var editor = corgis.main.components.editor;\n            corgis.main.components.dialog.show(\"Import Datasets\", body, function() {\n                if (editor.main.model.settings.editor() == \"Blocks\") {\n                    editor.updateBlocksFromModel();\n                }\n            });\n        });\n    }\n};\n\n/**\n * This is a very simplistic helper function that will transform\n * a given button into a \"Loaded\" state (disabled, pressed state, etc.).\n *\n * @param {HTMLElement} btn - An HTML element to change the text of.\n */\nvar set_button_loaded = function(btn) {\n    btn.addClass(\"active\")\n       .addClass('btn-success')\n       .removeClass('btn-primary')\n       .prop(\"disabled\", true)\n       .text(\"Loaded\")\n       .attr(\"aria-pressed\", \"true\");\n}</code></pre>\n        </article>\n    </section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>\n"
  },
  {
    "path": "docs/custom_blocks.js.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Source: custom_blocks.js</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Source: custom_blocks.js</h1>\n\n    \n\n\n\n    \n    <section>\n        <article>\n            <pre class=\"prettyprint source linenums\"><code>Blockly.Blocks['dicts_create_with_container'] = {\n  /**\n   * Dictionary block container\n   * @this Blockly.Block\n   */\n  init: function() {\n    this.setColour(Blockly.Blocks.dicts.HUE);\n    this.appendDummyInput()\n        .appendField(Blockly.Msg.DICTS_CREATE_WITH_CONTAINER_TITLE_ADD);\n    this.appendStatementInput('STACK');\n    this.setTooltip(Blockly.Msg.DICTS_CREATE_WITH_CONTAINER_TOOLTIP);\n    this.contextMenu = false;\n  }\n};\n\nBlockly.Blocks['dicts_create_with_item'] = {\n  // Add items.\n  init: function() {\n    this.setColour(Blockly.Blocks.dicts.HUE);\n    this.appendDummyInput()\n        .appendField(Blockly.Msg.DICTS_CREATE_WITH_ITEM_TITLE);\n    this.setPreviousStatement(true);\n    this.setNextStatement(true);\n    this.setTooltip(Blockly.Msg.DICTS_CREATE_WITH_ITEM_TOOLTIP);\n    this.contextMenu = false;\n  }\n};\nBlockly.Blocks['dicts_create_with'] = {\n    /**\n     * Block for creating a dict with any number of elements of any type.\n     * @this Blockly.Block\n     */\n    init: function() {\n        console.log(\"init\");\n        this.setInputsInline(false);\n        this.setColour(Blockly.Blocks.dicts.HUE);\n        this.itemCount_ = 1;\n        this.updateShape_();\n        this.setOutput(true, 'dict');\n        this.setMutator(new Blockly.Mutator(['dicts_create_with_item']));\n        this.setTooltip(Blockly.Msg.DICTS_CREATE_WITH_TOOLTIP);\n    },\n    /**\n     * Create XML to represent dict inputs.\n     * @return {Element} XML storage element.\n     * @this Blockly.Block\n     */\n    mutationToDom: function(workspace) {\n        console.log(\"mutationToDom\");\n        var container = document.createElement('mutation');\n        container.setAttribute('items', this.itemCount_);\n        return container;\n    },\n    /**\n     * Parse XML to restore the dict inputs.\n     * @param {!Element} xmlElement XML storage element.\n     * @this Blockly.Block\n     */\n    domToMutation: function(xmlElement) {\n        console.log(\"domToMutation\");\n        this.itemCount_ = parseInt(xmlElement.getAttribute('items'), 10);\n        this.updateShape_();\n    },\n    /**\n     * Modify this block to have the correct number of inputs.\n     * @private\n     * @this Blockly.Block\n     */\n    updateShape_: function() {\n        console.log(\"updateShape\");\n        // Delete everything.\n        if (this.getInput(\"EMPTY\")) {\n            this.removeInput('EMPTY');\n        }\n        var keyNames = [];\n        for (var i = 0; this.getInput('VALUE' + i); i++) {\n            //this.getInput('VALUE' + i).removeField(\"KEY\"+i);\n            keyNames.push(this.getFieldValue(\"KEY\"+i))\n            this.removeInput('VALUE' + i);\n        }\n        // Rebuild block.\n        if (this.itemCount_ == 0) {\n            this.appendDummyInput('EMPTY')\n                .appendField(Blockly.Msg.DICTS_CREATE_EMPTY_TITLE);\n        } else {\n            this.appendDummyInput('EMPTY')\n                .appendField(Blockly.Msg.DICTS_CREATE_WITH_INPUT_WITH);\n            for (var i = 0; i &lt; this.itemCount_; i++) {\n                this.appendValueInput('VALUE' + i)\n                    .setCheck(null)\n                    .setAlign(Blockly.ALIGN_RIGHT)\n                    .appendField(\n                          new Blockly.FieldTextInput(\n                              keyNames.length > i\n                              ? keyNames[i]\n                              : Blockly.Msg.DICTS_CREATE_WITH_ITEM_KEY),\n                         'KEY'+i)\n                   .appendField(Blockly.Msg.DICTS_CREATE_WITH_ITEM_MAPPING);\n            }\n        }\n    },\n    /**\n     * Populate the mutator's dialog with this block's components.\n     * @param {!Blockly.Workspace} workspace Mutator's workspace.\n     * @return {!Blockly.Block} Root block in mutator.\n     * @this Blockly.Block\n     */\n    decompose: function(workspace) {\n        console.log(\"Decompose\");\n        var containerBlock = workspace.newBlock('dicts_create_with_container');\n        containerBlock.initSvg();\n        var connection = containerBlock.getInput('STACK').connection;\n        for (var x = 0; x &lt; this.itemCount_; x++) {\n          var itemBlock = workspace.newBlock('dicts_create_with_item');\n          itemBlock.initSvg();\n          connection.connect(itemBlock.previousConnection);\n          connection = itemBlock.nextConnection;\n        }\n        return containerBlock;\n    },\n    /**\n     * Reconfigure this block based on the mutator dialog's components.\n     * @param {!Blockly.Block} containerBlock Root block in mutator.\n     * @this Blockly.Block\n     */\n    compose: function(containerBlock) {\n        console.log(\"Compose\");\n        var itemBlock = containerBlock.getInputTargetBlock('STACK');\n        // Count number of inputs.\n        var connections = [];\n        var i = 0;\n        while (itemBlock) {\n            connections[i] = itemBlock.valueConnection_;\n            itemBlock = itemBlock.nextConnection &amp;&amp;\n                        itemBlock.nextConnection.targetBlock();\n            i++;\n        }\n        this.itemCount_ = i;\n        this.updateShape_();\n        // Reconnect any child blocks.\n        for (var i = 0; i &lt; this.itemCount_; i++) {\n            if (connections[i]) {\n                this.getInput('VALUE' + i).connection.connect(connections[i]);\n            }\n        }\n    },\n    /**\n     * Store pointers to any connected child blocks.\n     * @param {!Blockly.Block} containerBlock Root block in mutator.\n     * @this Blockly.Block\n     */\n    saveConnections: function(containerBlock) {\n        console.log(\"SaveConnections\");\n        // Store a pointer to any connected child blocks.\n        var itemBlock = containerBlock.getInputTargetBlock('STACK');\n        var x = 0;\n        while (itemBlock) {\n            var value_input = this.getInput('VALUE' + x);\n            itemBlock.valueConnection_ = value_input &amp;&amp; value_input.connection.targetConnection;\n            x++;\n            itemBlock = itemBlock.nextConnection &amp;&amp;\n                        itemBlock.nextConnection.targetBlock();\n        }\n    }\n};\n</code></pre>\n        </article>\n    </section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>\n"
  },
  {
    "path": "docs/dialog.js.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Source: dialog.js</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Source: dialog.js</h1>\n\n    \n\n\n\n    \n    <section>\n        <article>\n            <pre class=\"prettyprint source linenums\"><code>/**\n * A utility object for quickly and conveniently generating dialog boxes.\n * Unfortunately, this doesn't dynamically create new boxes; it reuses the same one\n * over and over again. It turns out dynamically generating new dialog boxes\n * is a pain! So we can't stack them.\n *\n * @constructor\n * @this {BlockPyDialog}\n * @param {Object} main - The main BlockPy instance\n * @param {HTMLElement} tag - The HTML object this is attached to.\n */\nfunction BlockPyDialog(main, tag) {\n    this.main = main;\n    this.tag = tag;\n    \n    this.titleTag = tag.find('.modal-title');\n    this.bodyTag = tag.find('.modal-body');\n}\n\n/**\n * A simple externally available function for popping up a dialog\n * message. This menu will be draggable by its title.\n * \n * @param {String} title - The title of the message dialog. Can have HTML.\n * @param {String} body - The body of the message dialog. Can have HTML.\n * @param {function} onclose - A function to be run when the user closes the dialog.\n */\nBlockPyDialog.prototype.show = function(title, body, onclose) {\n    this.titleTag.html(title);\n    this.bodyTag.html(body);\n    this.tag.modal('show');\n    this.tag.draggable({\n        'handle': '.modal-title'\n    });\n    \n    this.tag.on('hidden.bs.modal', function (e) {\n        if (onclose !== undefined) {\n            onclose();\n        }\n    });\n}</code></pre>\n        </article>\n    </section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>\n"
  },
  {
    "path": "docs/editor.js.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Source: editor.js</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Source: editor.js</h1>\n\n    \n\n\n\n    \n    <section>\n        <article>\n            <pre class=\"prettyprint source linenums\"><code>/**\n * An object that manages the various editors, where users can edit their program. Also manages the\n * movement between editors.\n * There are currently four editors:\n *  - Blocks: A Blockly instance\n *  - Text: A CodeMirror instance\n *  - Instructor: Features for changing the assignment and environment settings\n *  - Upload: (Incomplete) A menu for uploading and running code from a desktop file.\n *\n * @constructor\n * @this {BlockPyEditor}\n * @param {Object} main - The main BlockPy instance\n * @param {HTMLElement} tag - The HTML object this is attached to.\n */\nfunction BlockPyEditor(main, tag) {\n    this.main = main;\n    this.tag = tag;\n    \n    // This tool is what actually converts text to blocks!\n    this.converter = new PythonToBlocks();\n    \n    // HTML DOM accessors\n    this.blockTag = tag.find('.blockpy-blocks');\n    this.blocklyDiv = this.blockTag.find('.blockly-div');\n    this.textTag = tag.find('.blockpy-text');\n    this.uploadTag = tag.find('.blockpy-upload');\n    this.instructorTag = tag.find('.blockpy-instructor');\n    this.textSidebarTag = this.textTag.find(\".blockpy-text-sidebar\");\n    \n    // Blockly and CodeMirror instances\n    this.blockly = null;\n    this.codeMirror = null;\n    // The updateStack keeps track of whether an update is percolating, to prevent duplicate update events.\n    this.silenceBlock = false;\n    this.silenceBlockTimer = null;\n    this.silenceText = false;\n    this.silenceModel = 0;\n    this.blocksFailed = false;\n    this.blocksFailedTimeout = null;\n    \n    // Hack to prevent chrome errors. Forces audio to load on demand. \n    // See: https://github.com/google/blockly/issues/299\n    Blockly.WorkspaceSvg.prototype.preloadAudio_ = function() {};\n    \n    // Keep track of the toolbox width\n    this.blocklyToolboxWidth = 0;\n    \n    // Initialize subcomponents\n    this.initText();\n    this.initBlockly();\n    this.initInstructor();\n    \n    var editor = this;\n    \n    // Handle mode switching\n    this.main.model.settings.editor.subscribe(function() {editor.setMode()});\n    \n    // Handle level switching\n    this.main.model.settings.level.subscribe(function() {editor.setLevel()});\n    \n    // Handle filename switching\n    this.main.model.settings.filename.subscribe(function (name) {\n        if (name == 'give_feedback') {\n            editor.setMode('Text');\n        }\n    });\n    \n    // Have to force a manual block update\n    //this.updateText();\n    this.updateBlocksFromModel();\n    this.updateTextFromModel();\n}\n\n/**\n * Initializes the Blockly instance (handles all the blocks). This includes\n * attaching a number of ChangeListeners that can keep the internal code\n * representation updated and enforce type checking.\n */\nBlockPyEditor.prototype.initBlockly = function() {\n    this.blockly = Blockly.inject(this.blocklyDiv[0],\n                                  { path: this.main.model.constants.blocklyPath, \n                                    scrollbars: this.main.model.constants.blocklyScrollbars, \n                                    readOnly: this.main.model.settings.read_only(),\n                                    zoom: {enabled: false},\n                                    toolbox: this.updateToolbox(false)});\n    // Register model changer\n    var editor = this;\n    this.blockly.addChangeListener(function(evt) { \n        //editor.main.components.feedback.clearEditorErrors();\n        editor.blockly.highlightBlock(null);\n        editor.updateBlocks();\n        //editor.updateBlocks();\n    });\n    this.main.model.program.subscribe(function() {editor.updateBlocksFromModel()});\n    this.main.model.settings.filename.subscribe(function() {\n        /*if (editor.main.model.settings.editor() == \"Blocks\") {\n            editor.updateBlocksFromModel()\n        }*/\n    });\n    this.main.model.assignment.modules.subscribe(function() {editor.updateToolbox(true)});\n    // Force the proper window size\n    this.blockly.resize();\n    // Keep the toolbox width set\n    this.blocklyToolboxWidth = this.blockly.toolbox_.width;\n    \n    Blockly.captureDialog_ = this.copyImage.bind(this);\n    \n    // Enable static type checking! \n    this.blockly.addChangeListener(function() {\n        if (!editor.main.model.settings.disable_variable_types()) {\n            var variables = editor.main.components.engine.analyzeVariables()\n            editor.blockly.getAllBlocks().filter(function(r) {return r.type == 'variables_get'}).forEach(function(block) { \n                var name = block.inputList[0].fieldRow[0].value_;\n                if (name in variables) {\n                    var type = variables[name];\n\n                    if (type.type == \"Num\") {\n                        block.setOutput(true, \"Number\");\n                    } else if (type.type == \"List\") {\n                        block.setOutput(true, \"Array\");\n                    } else if (type.type == \"Str\") {\n                        block.setOutput(true, \"String\");\n                    } else {\n                        block.setOutput(true, null);\n                    }\n                }\n            })\n        }\n    });\n\n\n};\n\n/**\n * Initializes the CodeMirror instance. This handles text editing (with syntax highlighting)\n * and also attaches a listener for change events to update the internal code represntation.\n */\nBlockPyEditor.prototype.initText = function() {\n    var codeMirrorDiv = this.textTag.find('.codemirror-div')[0];\n    this.codeMirror = CodeMirror.fromTextArea(codeMirrorDiv, {\n                                        mode: { name: \"python\", \n                                                version: 3, \n                                                singleLineStringErrors: false\n                                        },\n                                        readOnly: this.main.model.settings.read_only(),\n                                        lineNumbers: true,\n                                        firstLineNumber: 1,\n                                        indentUnit: 4,\n                                        tabSize: 4,\n                                        indentWithTabs: false,\n                                        matchBrackets: true,\n                                        extraKeys: {\"Tab\": \"indentMore\", \n                                                    \"Shift-Tab\": \"indentLess\"},\n                                      });\n    // Register model changer\n    var editor = this;\n    this.codeMirror.on(\"change\", function() {\n        //editor.main.components.feedback.clearEditorErrors();\n        editor.updateText()\n    });\n    this.main.model.program.subscribe(function() {editor.updateTextFromModel()});\n    // Ensure that it fills the editor area\n    this.codeMirror.setSize(null, \"100%\");\n    \n    // Was toying with buttons for injecting code. These are deprecated now.\n    this.tag.find('.blockpy-text-insert-if').click(function() {\n        var line_number = blockpy.components.editor.codeMirror.getCursor().line;\n        var line = blockpy.components.editor.codeMirror.getLine(line_number);\n        var whitespace = line.match(/^(\\s*)/)[1];\n        editor.codeMirror.replaceSelection(\"if ___:\\n    \"+whitespace+\"pass\");\n    });\n    this.tag.find('.blockpy-text-insert-if-else').click(function() {\n        var line_number = blockpy.components.editor.codeMirror.getCursor().line;\n        var line = blockpy.components.editor.codeMirror.getLine(line_number);\n        var whitespace = line.match(/^(\\s*)/)[1];\n        editor.codeMirror.replaceSelection(\"if ___:\\n    \"+whitespace+\"pass\\n\"+whitespace+\"else:\\n    \"+whitespace+\"pass\");\n    });\n};\n\n/**\n * Initializes the Instructor tab, which has a number of buttons and menus for\n * manipulating assignments and the environment. One important job is to register the\n * SummerNote instance used for editing the Introduction of the assignment.\n */\nBlockPyEditor.prototype.initInstructor = function() {\n    var introductionEditor = this.instructorTag.find('.blockpy-presentation-body-editor');\n    var model = this.main.model;\n    introductionEditor.summernote({\n        codemirror: { // codemirror options\n            theme: 'monokai'\n        },\n        onChange: model.assignment.introduction,\n        toolbar: [\n            ['style', ['bold', 'italic', 'underline', 'clear']],\n            ['font', ['fontname', 'fontsize']],\n            ['insert', ['link', 'table', 'ul', 'ol', 'image']],\n            ['misc', ['codeview', 'help']]\n        ]\n    });\n    introductionEditor.code(model.assignment.introduction());\n    \n    this.availableModules = this.instructorTag.find('.blockpy-available-modules');\n    this.availableModules.multiSelect({ selectableOptgroup: true });\n    \n    \n}\n\n/**\n * Makes the module available in the availableModules multi-select menu by adding\n * it to the list.\n * \n * @param {String} name - The name of the module (human-friendly version, as opposed to the slug) to be added.\n */\nBlockPyEditor.prototype.addAvailableModule = function(name) {\n    this.availableModules.multiSelect('addOption', { \n        'value': name, 'text': name\n    });\n    this.availableModules.multiSelect('select', name);\n};\n\n/**\n * Hides the Text tab, which involves shrinking it and hiding its CodeMirror too.\n */\nBlockPyEditor.prototype.hideSplitMenu = function() {\n    this.hideTextMenu();\n    this.hideBlockMenu();\n}\n\n/**\n * Shows the Text tab, which requires restoring its height, showing AND refreshing\n * the CodeMirror instance.\n */\nBlockPyEditor.prototype.showSplitMenu = function() {\n    this.showBlockMenu();\n    this.showTextMenu();\n    \n    this.textTag.css('width', '40%');\n    this.blockTag.css('width', '60%');\n    this.textSidebarTag.css('width', '0px');\n    this.textTag.addClass('col-md-6');\n    this.blockTag.addClass('col-md-6');\n    Blockly.svgResize(this.blockly);\n}\n\n/**\n * Hides the Text tab, which involves shrinking it and hiding its CodeMirror too.\n */\nBlockPyEditor.prototype.hideTextMenu = function() {\n    this.textTag.css('height', '0%');\n    $(this.codeMirror.getWrapperElement()).hide();\n    this.textSidebarTag.hide();\n    this.textTag.hide();\n}\n\n/**\n * Shows the Text tab, which requires restoring its height, showing AND refreshing\n * the CodeMirror instance.\n */\nBlockPyEditor.prototype.showTextMenu = function() {\n    this.textTag.show();\n    // Adjust height\n    this.textTag.css('height', '450px');\n    this.textTag.css('width', '100%');\n    // Show CodeMirror\n    $(this.codeMirror.getWrapperElement()).show();\n    // CodeMirror doesn't know its changed size\n    this.codeMirror.refresh();\n    \n    // Resize sidebar\n    var codemirrorGutterWidth = $('.CodeMirror-gutters').width();\n    var sideBarWidth = this.blocklyToolboxWidth-codemirrorGutterWidth-2;\n    this.textSidebarTag.css('width', sideBarWidth+'px');\n    this.textSidebarTag.show();\n    this.textTag.removeClass('col-md-6');\n}\n\n/**\n * Hides the Block tab, which involves shrinking it and hiding the Blockly instance.\n */\nBlockPyEditor.prototype.hideBlockMenu = function() {\n    this.blocklyToolboxWidth = this.blockly.toolbox_.width;\n    this.blockTag.css('height', '0%');\n    this.blocklyDiv.css(\"width\", \"0\");\n    this.blockly.setVisible(false);\n}\n\n/**\n * Shows the Block tab, which involves restoring its height and showing the Blockly instance.\n */\nBlockPyEditor.prototype.showBlockMenu = function() {\n    this.blockTag.css('height', '100%');\n    this.blockTag.css('width', '100%');\n    this.blocklyDiv.css(\"width\", \"100%\");\n    this.blockly.resize();\n    this.blockly.setVisible(true);\n    this.blockTag.removeClass('col-md-6');\n    Blockly.svgResize(this.blockly);\n}\n\n/**\n * Hides the Upload tab, which shrinking it.\n */\nBlockPyEditor.prototype.hideUploadMenu = function() {\n    this.uploadTag.hide();\n    this.uploadTag.css('height', '0%');\n}\n\n/**\n * Shows the Upload tab, which involves restoring its height.\n */\nBlockPyEditor.prototype.showUploadMenu = function() {\n    this.uploadTag.css('height', '100%');\n    this.uploadTag.show();\n}\n\n/**\n * Hides the Instructor tab, which shrinking it.\n */\nBlockPyEditor.prototype.hideInstructorMenu = function() {\n    this.instructorTag.hide();\n    this.instructorTag.css('height', '0%');\n}\n\n/**\n * Shows the Instructor tab, which involves restoring its height.\n */\nBlockPyEditor.prototype.showInstructorMenu = function() {\n    this.instructorTag.css('height', '100%');\n    this.instructorTag.show();\n}\n\n/**\n * Sets the current editor mode to Text, hiding the other menus.\n * Also forces the text side to update.\n */\nBlockPyEditor.prototype.setModeToText = function() {\n    this.hideBlockMenu();\n    this.hideUploadMenu();\n    this.hideInstructorMenu();\n    this.showTextMenu();\n    // Update the text model from the blocks\n}\n\n/**\n * Sets the current editor mode to Blocks, hiding the other menus.\n * Also forces the block side to update.\n * There is a chance this could fail, if the text side is irredeemably\n * awful. So then the editor bounces back to the text side.\n */\nBlockPyEditor.prototype.setModeToBlocks = function() {\n    this.hideTextMenu();\n    this.hideUploadMenu();\n    this.hideInstructorMenu();\n    this.showBlockMenu();\n    if (this.blocksFailed !== false) {\n        this.showConversionError();\n        var main = this.main;\n        main.model.settings.editor(\"Text\");\n        setTimeout(function() {\n            main.components.toolbar.tags.mode_set_text.click();\n        }, 0);\n    }\n    // Update the blocks model from the text\n    /*\n    success = this.updateBlocksFromModel();\n    if (!success) {\n        var main = this.main;\n        main.components.editor.updateTextFromModel();\n        main.model.settings.editor(\"Text\");\n        setTimeout(function() {\n            main.components.toolbar.tags.mode_set_text.click();\n        }, 0);\n    }*/\n}\n\n/**\n * Sets the current editor mode to Upload mode, hiding the other menus.\n */\nBlockPyEditor.prototype.setModeToUpload = function() {\n    this.hideTextMenu();\n    this.hideInstructorMenu();\n    this.hideBlockMenu();\n    this.showUploadMenu();\n    //TODO: finish upload mode\n}\n\n/**\n * Sets the current editor mode to Split mode, hiding the other menus.\n */\nBlockPyEditor.prototype.setModeToSplit = function() {\n    this.hideTextMenu();\n    this.hideInstructorMenu();\n    this.hideBlockMenu();\n    this.hideUploadMenu();\n    this.showSplitMenu();\n    if (this.blocksFailed !== false) {\n        this.showConversionError();\n    }\n}\n\n/**\n * Sets the current editor mode to the Instructor mode, hiding the other menus.\n */\nBlockPyEditor.prototype.setModeToInstructor = function() {\n    this.hideTextMenu();\n    this.hideBlockMenu();\n    this.hideUploadMenu();\n    this.showInstructorMenu();\n    //TODO: finish upload mode\n    //this.main.reportError(\"editor\", \"Instructor mode has not been implemented\");\n}\n\nBlockPyEditor.prototype.changeMode = function() {\n    if (main.model.settings.editor() == \"Blocks\") {\n        main.model.settings.editor(\"Text\");\n    } else {\n        main.model.settings.editor(\"Blocks\");\n    }\n}\n\n/**\n * Dispatch method to set the mode to the given argument.\n * If the mode is invalid, an editor error is reported. If the \n *\n * @param {String} mode - The new mode to set to (\"Blocks\", \"Text\", \"Upload\", or \"Instructor\")\n */\nBlockPyEditor.prototype.setMode = function(mode) {\n    // Either update the model, or go with the model's\n    if (mode === undefined) {\n        mode = this.main.model.settings.editor();\n    } else {\n        this.main.model.settings.editor(mode);\n    }\n    // Dispatch according to new mode\n    if (mode == 'Blocks') {\n        this.setModeToBlocks();\n    } else if (mode == 'Text') {\n        this.setModeToText();\n    } else if (mode == 'Upload') {\n        this.setModeToUpload();\n    } else if (mode == 'Split') {\n        this.setModeToSplit();\n    } else if (mode == 'Instructor') {\n        this.setModeToInstructor();\n    } else {\n        this.components.feedback.internalError(\"\"+mode, \"Invalid Mode\", \"The editor attempted to change to an invalid mode.\")\n    }\n}\n\n/**\n * Actually changes the value of the CodeMirror instance\n *\n * @param {String} code - The new code for the CodeMirror\n */\nBlockPyEditor.prototype.setText = function(code) {\n    if (code == undefined || code.trim() == \"\") {\n        this.codeMirror.setValue(\"\\n\");\n    } else {\n        this.codeMirror.setValue(code);\n    }\n    // Ensure that we maintain proper highlighting\n    this.refreshHighlight();\n}\n\nBlockPyEditor.prototype.showConversionError = function() {\n    var error = this.blocksFailed;\n    this.main.components.feedback.editorError(error, \"While attempting to convert the Python code into blocks, I found a syntax error. In other words, your Python code has a spelling or grammatical mistake. You should check to make sure that you have written all of your code correctly. To me, it looks like the problem is on line \"+ error.args.v[2]+', where it says:&lt;br>&lt;code>'+error.args.v[3][2]+'&lt;/code>', error.args.v[2]);\n}\n\nBlockPyEditor.prototype.setBlocks = function(python_code) {\n    var xml_code = \"\";\n    if (python_code !== '' &amp;&amp; python_code !== undefined &amp;&amp; python_code.trim().charAt(0) !== '&lt;') {\n        var result = this.converter.convertSource(python_code);\n        xml_code = result.xml;\n        window.clearTimeout(this.blocksFailedTimeout);\n        if (result.error !== null) {\n            this.blocksFailed = result.error;\n            var editor = this;\n            this.blocksFailedTimeout = window.setTimeout(function() {\n                if (editor.main.model.settings.editor() != 'Text') {\n                    editor.showConversionError();\n                }\n            }, 500)\n        } else {\n            this.blocksFailed = false;\n            this.main.components.feedback.clearEditorErrors();\n        }\n    }\n    var error_code = this.converter.convertSourceToCodeBlock(python_code);\n    var errorXml = Blockly.Xml.textToDom(error_code);\n    if (python_code == '' || python_code == undefined || python_code.trim() == '') {\n        this.blockly.clear();\n    } else if (xml_code !== '' &amp;&amp; xml_code !== undefined) {\n        var blocklyXml = Blockly.Xml.textToDom(xml_code);\n        try {\n            this.setBlocksFromXml(blocklyXml);\n        } catch (e) {\n            console.error(e);\n            this.setBlocksFromXml(errorXml);\n        }\n    } else {\n        this.setBlocksFromXml(errorXml);\n    }\n    Blockly.Events.disable();\n    // Parsons shuffling\n    if (this.main.model.assignment.parsons()) {\n        this.blockly.shuffle();\n    } else {\n        this.blockly.align();\n    }\n    Blockly.Events.enable();\n    if (this.previousLine !== null) {\n        this.refreshBlockHighlight(this.previousLine);\n    }\n}\n\nBlockPyEditor.prototype.clearDeadBlocks = function() {\n    var all_blocks = this.blockly.getAllBlocks();\n    all_blocks.forEach(function(elem) {\n        if (!Blockly.Python[elem.type]) {\n            elem.dispose(true);\n        }\n    });\n}\n\n/**\n * Attempts to update the model for the current code file from the \n * block workspace. Might be prevented if an update event was already\n * percolating.\n */\nBlockPyEditor.prototype.updateBlocks = function() {\n    if (! this.silenceBlock) {\n        try {\n            var newCode = Blockly.Python.workspaceToCode(this.blockly);\n        } catch (e) {\n            this.clearDeadBlocks();\n            this.main.components.feedback.editorError(\"Unknown Block\", \"It looks like you attempted to paste or load some blocks that were not known. Typically, this is because you failed to load in the dataset before trying to paste in a data block. If there are any black blocks on the canvas, delete them before continuing.\", \"Unknown Block\");\n        }\n        // Update Model\n        this.silenceModel = 2;\n        var changed = this.main.setCode(newCode);\n        if (!changed) {\n            this.silenceModel = 0;\n        } else {\n            // Update Text\n            this.silenceText = true;\n            this.setText(newCode);\n        }\n    }\n}\n\n/**\n * Attempts to update the model for the current code file from the \n * text editor. Might be prevented if an update event was already\n * percolating. Also unhighlights any lines.\n */\nvar timerGuard = null;\nBlockPyEditor.prototype.updateText = function() {\n    if (! this.silenceText) {\n        var newCode = this.codeMirror.getValue();\n        // Update Model\n        this.silenceModel = 2;\n        this.main.setCode(newCode);\n        // Update Blocks\n        this.silenceBlock = true;\n        this.setBlocks(newCode);\n        this.unhighlightLines();\n        this.resetBlockSilence();\n    }\n    this.silenceText = false;\n}\n\n/**\n * Resets the silenceBlock after a short delay\n */\nBlockPyEditor.prototype.resetBlockSilence = function() {\n    var editor = this;\n    if (editor.silenceBlockTimer != null) {\n        clearTimeout(editor.silenceBlockTimer);\n    }\n    this.silenceBlockTimer = window.setTimeout(function() {\n        editor.silenceBlock = false;\n        editor.silenceBlockTimer = null;\n    }, 40);\n};\n\n/**\n * Updates the text editor from the current code file in the\n * model. Might be prevented if an update event was already\n * percolating.\n */\nBlockPyEditor.prototype.updateTextFromModel = function() {\n    if (this.silenceModel == 0) {\n        var code = this.main.model.program();\n        this.silenceText = true;\n        this.setText(code);\n    } else {\n        this.silenceModel -= 1;\n    }\n}\n\n/**\n * Updates the block editor from the current code file in the\n * model. Might be prevented if an update event was already\n * percolating. This can also report an error if one occurs.\n *\n * @returns {Boolean} Returns true upon success.\n */\nBlockPyEditor.prototype.updateBlocksFromModel = function() {\n    if (this.silenceModel == 0) {\n        var code = this.main.model.program().trim();\n        this.silenceBlock = true;\n        this.setBlocks(code);\n        this.resetBlockSilence();\n    } else {\n        this.silenceModel -= 1;\n    }\n}\n\n/**\n * Helper function for retrieving the current Blockly workspace as\n * an XML DOM object.\n *\n * @returns {XMLDom} The blocks in the current workspace.\n */\nBlockPyEditor.prototype.getBlocksFromXml = function() {\n    return Blockly.Xml.workspaceToDom(this.blockly);\n}\n          \n/**\n * Helper function for setting the current Blockly workspace to\n * whatever XML DOM is given. This clears out any existing blocks.\n */\nBlockPyEditor.prototype.setBlocksFromXml = function(xml) {\n    //this.blockly.clear();\n    Blockly.Xml.domToWorkspaceDestructive(xml, this.blockly);\n    //console.log(this.blockly.getAllBlocks());\n}\n\n/** \n * @property {Number} previousLine - Keeps track of the previously highlighted line.\n */\nBlockPyEditor.prototype.previousLine = null;\n\n/**\n * Assuming that a line has been highlighted previously, this will set the\n * line to be highlighted again. Used when we need to restore a highlight.\n */\nBlockPyEditor.prototype.refreshHighlight = function() {\n    if (this.previousLine !== null) {\n        this.codeMirror.addLineClass(this.previousLine, 'text', 'editor-error-line');\n    }\n    // TODO: Shouldn't this refresh the highlight in the block side too?\n}\n\n/**\n * Highlights a line of code in the CodeMirror instance. This applies the \"active\" style\n * which is meant to bring attention to a line, but not suggest it is wrong.\n *\n * @param {Number} line - The line of code to highlight. I think this is zero indexed?\n */\nBlockPyEditor.prototype.highlightLine = function(line) {\n    if (this.previousLine !== null) {\n        this.codeMirror.removeLineClass(this.previousLine, 'text', 'editor-active-line');\n        this.codeMirror.removeLineClass(this.previousLine, 'text', 'editor-error-line');\n    }\n    this.codeMirror.addLineClass(line, 'text', 'editor-active-line');\n    this.previousLine = line;\n}\n\n/**\n * Highlights a line of code in the CodeMirror instance. This applies the \"error\" style\n * which is meant to suggest that a line is wrong.\n *\n * @param {Number} line - The line of code to highlight. I think this is zero indexed?\n */\nBlockPyEditor.prototype.highlightError = function(line) {\n    if (this.previousLine !== null) {\n        this.codeMirror.removeLineClass(this.previousLine, 'text', 'editor-active-line');\n        this.codeMirror.removeLineClass(this.previousLine, 'text', 'editor-error-line');\n    }\n    this.codeMirror.addLineClass(line, 'text', 'editor-error-line');\n    this.refreshBlockHighlight(line);\n    this.previousLine = line;\n}\n\n/**\n * Highlights a block in Blockly. Unfortunately, this is the same as selecting it.\n *\n * @param {Number} block - The ID of the block object to highlight.\n */\nBlockPyEditor.prototype.highlightBlock = function(block) {\n    //this.blockly.highlightBlock(block);\n}\n\n/**\n * Used to restore a block's highlight when travelling from the code tab. This\n * uses a mapping between the blocks and text that is generated from the parser.\n * The parser has stored the relevant line numbers for each block in the XML of the\n * block. Very sophisticated, and sadly fairly fragile.\n * TODO: I believe there's some kind of off-by-one error here...\n *\n * @param {Number} line - The line of code to highlight. I think this is zero indexed?\n */\nBlockPyEditor.prototype.refreshBlockHighlight = function(line) {\n    if (this.blocksFailed) {\n        this.blocksFailed = false;\n        return;\n    }\n    if (this.main.model.settings.editor() != \"Blocks\" &amp;&amp;\n        this.main.model.settings.editor() != \"Split\") {\n        return;\n    }\n    var all_blocks = this.blockly.getAllBlocks();\n    //console.log(all_blocks.map(function(e) { return e.lineNumber }));\n    var blockMap = {};\n    all_blocks.forEach(function(elem) {\n        var lineNumber = parseInt(elem.lineNumber, 10);\n        if (lineNumber in blockMap) {\n            blockMap[lineNumber].push(elem);\n        } else {\n            blockMap[lineNumber] = [elem];\n        }\n    });\n    if (1+line in blockMap) {\n        var hblocks = blockMap[1+line];\n        var blockly = this.blockly;\n        hblocks.forEach(function(elem) {\n            //elem.addSelect();\n            blockly.highlightBlock(elem.id, true);\n        });\n        /*if (hblocks.length > 0) {\n            this.blockly.highlightBlock(hblocks[0].id, true);\n        }*/\n    }\n}\n\n/**\n * Removes the outline around a block. Currently unused.\n */\nBlockPyEditor.prototype.unhighlightBlock = function() {\n    // TODO:\n}\n\n/**\n * Removes any highlight in the text code editor.\n *\n */\nBlockPyEditor.prototype.unhighlightLines = function() {\n    if (this.previousLine !== null) {\n        this.codeMirror.removeLineClass(this.previousLine, 'text', 'editor-active-line');\n        this.codeMirror.removeLineClass(this.previousLine, 'text', 'editor-error-line');\n    }\n    this.previousLine = null;\n}\n\n/**\n * DEPRECATED, thankfully\n * Builds up an array indicating the relevant block ID for a given step.\n * Operates on the current this.blockly instance\n * It works by injecting __HIGHLIGHT__(id); at the start of every line of code\n *  and then extracting that with regular expressions. This makes it vulnerable\n *  if someone decides to use __HIGHLIGHT__ in their code. I'm betting on that\n *  never being a problem, though. Still, this was a miserable way of accomplishing\n *  the desired behavior.\n */\nBlockPyEditor.prototype.getHighlightMap = function() {\n    // Protect the current STATEMENT_PREFIX\n    var backup = Blockly.Python.STATEMENT_PREFIX;\n    Blockly.Python.STATEMENT_PREFIX = '__HIGHLIGHT__(%1);';\n    Blockly.Python.addReservedWords('__HIGHLIGHT__');\n    // Get the source code, injected with __HIGHLIGHT__(id)\n    var highlightedCode = Blockly.Python.workspaceToCode(this.blockly);\n    Blockly.Python.STATEMENT_PREFIX = backup;\n    // Build up the array by processing the highlighted code line-by-line\n    var highlightMap = [];\n    var lines = highlightedCode.split(\"\\n\");\n    for (var i = 0; i &lt; lines.length; i++) {\n        // Get the block ID from the line\n        var id = lines[i].match(/\\W*__HIGHLIGHT__\\(\\'(.+?)\\'\\)/);\n        if (id !== null) {\n            // Convert it into a base-10 number, because JavaScript.\n            highlightMap[i] = parseInt(id[1], 10);\n        }\n    }\n    return highlightMap;\n}\n\n/**\n * Updates the current file being edited in the editors.\n * This appears to be deprecated.\n *\n * @param {String} name - The name of the file being edited (e.g, \"__main__\", \"starting_code\")\n */\nBlockPyEditor.prototype.changeProgram = function(name) {\n    this.silentChange_ = true;\n    if (name == 'give_feedback') {\n        this.setMode('Text');\n    }\n    this.model.settings.filename = name;\n    this.editor.setPython(this.model.programs[name]);\n    this.toolbar.elements.programs.find(\"[data-name=\"+name+\"]\").click();\n}\n\n/**\n * Eventually will be used to update \"levels\" of sophistication of the code interface.\n * Currently unimplemented and unused.\n */\nBlockPyEditor.prototype.setLevel = function() {\n    var level = this.main.model.settings.level();\n}\n\n/**\n * Maps short category names in the toolbox to the full XML used to\n * represent that category as usual. This is kind of a clunky mechanism\n * for managing the different categories, and doesn't allow us to specify\n * individual blocks.\n */\nBlockPyEditor.CATEGORY_MAP = {\n    'Properties': '&lt;category name=\"Properties\" custom=\"VARIABLE\" colour=\"240\">'+\n                  '&lt;/category>',\n    'Decisions': '&lt;category name=\"Decisions\" colour=\"330\">'+\n                    '&lt;block type=\"controls_if\">&lt;/block>'+\n                    '&lt;block type=\"controls_if\">&lt;mutation else=\"1\">&lt;/mutation>&lt;/block>'+\n                    '&lt;block type=\"logic_compare\">&lt;/block>'+\n                    '&lt;block type=\"logic_operation\">&lt;/block>'+\n                    '&lt;block type=\"logic_negate\">&lt;/block>'+\n                  '&lt;/category>',\n    'Iteration': '&lt;category name=\"Iteration\" colour=\"300\">'+\n                    '&lt;block type=\"controls_forEach\">&lt;/block>'+\n                '&lt;/category>',\n    'Functions': '&lt;category name=\"Functions\" custom=\"PROCEDURE\" colour=\"210\">'+\n                '&lt;/category>',\n    'Calculation': '&lt;category name=\"Calculation\" colour=\"270\">'+\n                    //'&lt;block type=\"raw_table\">&lt;/block>'+\n                    '&lt;block type=\"math_arithmetic\">&lt;/block>'+\n                    //'&lt;block type=\"type_check\">&lt;/block>'+\n                    //'&lt;block type=\"raw_empty\">&lt;/block>'+\n                    //'&lt;block type=\"math_single\">&lt;/block>'+\n                    //'&lt;block type=\"math_number_property\">&lt;/block>'+\n                    '&lt;block type=\"math_round\">&lt;/block>'+\n                    //'&lt;block type=\"text_join\">&lt;/block>'+\n                '&lt;/category>',\n    'Python':   '&lt;category name=\"Python\" colour=\"180\">'+\n                    '&lt;block type=\"raw_block\">&lt;/block>'+\n                    '&lt;block type=\"raw_expression\">&lt;/block>'+\n                    //'&lt;block type=\"function_call\">&lt;/block>'+\n                '&lt;/category>',\n    'Output':   '&lt;category name=\"Output\" colour=\"160\">'+\n                    '&lt;block type=\"text_print\">&lt;/block>'+\n                    //'&lt;block type=\"text_print_multiple\">&lt;/block>'+\n                    '&lt;block type=\"plot_line\">&lt;/block>'+\n                    '&lt;block type=\"plot_scatter\">&lt;/block>'+\n                    '&lt;block type=\"plot_hist\">&lt;/block>'+\n                    '&lt;block type=\"plot_show\">&lt;/block>'+\n                    '&lt;block type=\"plot_title\">&lt;/block>'+\n                    '&lt;block type=\"plot_xlabel\">&lt;/block>'+\n                    '&lt;block type=\"plot_ylabel\">&lt;/block>'+\n                '&lt;/category>',\n    'Turtles': '&lt;category name=\"Turtles\" colour=\"180\">'+\n                    '&lt;block type=\"turtle_create\">&lt;/block>'+\n                    '&lt;block type=\"turtle_forward\">&lt;/block>'+\n                    '&lt;block type=\"turtle_backward\">&lt;/block>'+\n                    '&lt;block type=\"turtle_left\">&lt;/block>'+\n                    '&lt;block type=\"turtle_right\">&lt;/block>'+\n                    '&lt;block type=\"turtle_color\">&lt;/block>'+\n                '&lt;/category>',\n    'Values':   '&lt;category name=\"Values\" colour=\"100\">'+\n                    '&lt;block type=\"text\">&lt;/block>'+\n                    '&lt;block type=\"math_number\">&lt;/block>'+\n                    '&lt;block type=\"logic_boolean\">&lt;/block>'+\n                '&lt;/category>',\n    'Lists':    '&lt;category name=\"Lists\" colour=\"30\">'+\n                    '&lt;block type=\"lists_create_with\">'+\n                        '&lt;value name=\"ADD0\">'+\n                          '&lt;block type=\"math_number\">&lt;field name=\"NUM\">0&lt;/field>&lt;/block>'+\n                        '&lt;/value>'+\n                        '&lt;value name=\"ADD1\">'+\n                          '&lt;block type=\"math_number\">&lt;field name=\"NUM\">0&lt;/field>&lt;/block>'+\n                        '&lt;/value>'+\n                        '&lt;value name=\"ADD2\">'+\n                          '&lt;block type=\"math_number\">&lt;field name=\"NUM\">0&lt;/field>&lt;/block>'+\n                        '&lt;/value>'+\n                    '&lt;/block>'+\n                    '&lt;block type=\"lists_create_with\">&lt;/block>'+\n                    '&lt;block type=\"lists_create_empty\">&lt;/block>'+\n                    '&lt;block type=\"lists_append\">&lt;/block>'+\n                    /*'&lt;block type=\"lists_length\">&lt;/block>'+*/\n                    /*'&lt;block type=\"lists_index\">'+\n                        '&lt;value name=\"ITEM\">'+\n                          '&lt;shadow type=\"math_number\">'+\n                            '&lt;field name=\"NUM\">0&lt;/field>'+\n                          '&lt;/shadow>'+\n                        '&lt;/value>'+\n                    '&lt;/block>'+*/\n                '&lt;/category>',\n    'Dictionaries': '&lt;category name=\"Dictionaries\" colour=\"0\">'+\n                    '&lt;block type=\"dicts_create_with\">&lt;/block>'+\n                    '&lt;block type=\"dict_get_literal\">&lt;/block>'+\n                    //'&lt;block type=\"dict_keys\">&lt;/block>'+\n                '&lt;/category>',\n    /*\n    'Data - Weather': '&lt;category name=\"Data - Weather\" colour=\"70\">'+\n                    '&lt;block type=\"weather_temperature\">&lt;/block>'+\n                    '&lt;block type=\"weather_report\">&lt;/block>'+\n                    '&lt;block type=\"weather_forecasts\">&lt;/block>'+\n                    '&lt;block type=\"weather_report_forecasts\">&lt;/block>'+\n                    '&lt;block type=\"weather_all_forecasts\">&lt;/block>'+\n                    '&lt;block type=\"weather_highs_lows\">&lt;/block>'+\n                '&lt;/category>',\n    'Data - Stocks': '&lt;category name=\"Data - Stock\" colour=\"65\">'+\n                    '&lt;block type=\"stocks_current\">&lt;/block>'+\n                    '&lt;block type=\"stocks_past\">&lt;/block>'+\n                '&lt;/category>',\n    'Data - Earthquakes': '&lt;category name=\"Data - Earthquakes\" colour=\"60\">'+\n                    '&lt;block type=\"earthquake_get\">&lt;/block>'+\n                    '&lt;block type=\"earthquake_both\">&lt;/block>'+\n                    '&lt;block type=\"earthquake_all\">&lt;/block>'+\n                '&lt;/category>',\n    'Data - Crime': '&lt;category name=\"Data - Crime\" colour=\"55\">'+\n                    '&lt;block type=\"crime_state\">&lt;/block>'+\n                    '&lt;block type=\"crime_year\">&lt;/block>'+\n                    '&lt;block type=\"crime_all\">&lt;/block>'+\n                '&lt;/category>',\n    'Data - Books': '&lt;category name=\"Data - Books\" colour=\"50\">'+\n                    '&lt;block type=\"books_get\">&lt;/block>'+\n                '&lt;/category>',*/\n    'Data - Parking': '&lt;category name=\"Data - Parking\" colour=\"45\">'+\n                    '&lt;block type=\"datetime_day\">&lt;/block>'+\n                    '&lt;block type=\"datetime_time\">&lt;/block>'+\n                    '&lt;block type=\"logic_compare\">'+\n                        '&lt;field name=\"OP\">EQ&lt;/field>'+\n                        '&lt;value name=\"A\">'+\n                          '&lt;block type=\"datetime_time\">'+\n                            '&lt;mutation isNow=\"1\">&lt;/mutation>'+\n                            '&lt;field name=\"HOUR\">1&lt;/field>'+\n                            '&lt;field name=\"MINUTE\">00&lt;/field>'+\n                            '&lt;field name=\"MERIDIAN\">PM&lt;/field>'+\n                          '&lt;/block>'+\n                        '&lt;/value>'+\n                    '&lt;/block>'+\n                    '&lt;block type=\"logic_compare\">'+\n                        '&lt;field name=\"OP\">EQ&lt;/field>'+\n                        '&lt;value name=\"A\">'+\n                          '&lt;block type=\"datetime_day\">'+\n                            '&lt;field name=\"DAY\">Monday&lt;/field>'+\n                          '&lt;/block>'+\n                        '&lt;/value>'+\n                    '&lt;/block>'+\n                    //'&lt;block type=\"datetime_check_day\">&lt;/block>'+\n                    //'&lt;block type=\"datetime_check_time\">&lt;/block>'+\n                '&lt;/category>',\n    'Separator': '&lt;sep>&lt;/sep>'\n};\n\n/**\n * Creates an updated representation of the Toolboxes XML as currently specified in the\n * model, using whatever modules have been added or removed. This method can either set it\n * or just retrieve it for future use.\n *\n * @param {Boolean} only_set - Whether to return the XML string or to actually set the XML. False means that it will not update the toolbox!\n * @returns {String?} Possibly returns the XML of the toolbox as a string.\n */\nBlockPyEditor.prototype.updateToolbox = function(only_set) {\n    var xml = '&lt;xml id=\"toolbox\" style=\"display: none\">';\n    var modules = this.main.model.assignment.modules();\n    var started_misc = false,\n        started_values = false,\n        started_data = false;\n    for (var i = 0, length = modules.length; i &lt; length; i = i+1) {\n        var module = modules[i];\n        if (!started_misc &amp;&amp; ['Calculation', 'Output', 'Python'].indexOf(module) != -1) {\n            started_misc = true;\n            xml += BlockPyEditor.CATEGORY_MAP['Separator'];\n        }\n        if (!started_values &amp;&amp; ['Values', 'Lists', 'Dictionaries'].indexOf(module) != -1) {\n            started_values = true;\n            xml += BlockPyEditor.CATEGORY_MAP['Separator'];\n        }\n        if (!started_data &amp;&amp; module.slice(0, 6) == 'Data -') {\n            started_data = true;\n            xml += BlockPyEditor.CATEGORY_MAP['Separator'];\n        }\n        if (typeof module == 'string') {\n            xml += BlockPyEditor.CATEGORY_MAP[module];\n        } else {\n            var category = '&lt;category name=\"'+module.name+'\" colour=\"'+module.color+'\">';\n            for (var j= 0; category_length = module.blocks.length; j = j+1) {\n                var block = module.blocks[j];\n                category += '&lt;block type=\"'+block+'\">&lt;/block>';\n            }\n            category += '&lt;/category>';\n        }\n        //'&lt;sep>&lt;/sep>'+\n    }\n    xml += '&lt;/xml>';\n    if (only_set) {\n        this.blockly.updateToolbox(xml);\n        this.blockly.resize();\n    } else {\n        return xml;\n    }\n};\n\nBlockPyEditor.prototype.DOCTYPE = '&lt;?xml version=\"1.0\" standalone=\"no\"?>' + '&lt;' + '!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">';\nBlockPyEditor.prototype.cssData = null;\nBlockPyEditor.prototype.loadCss = function() {\n    if (this.cssData == null) {\n        var txt = '.blocklyDraggable {}\\n';\n        txt += Blockly.Css.CONTENT.join('\\n');\n        if (Blockly.FieldDate) {\n            txt += Blockly.FieldDate.CSS.join('\\n');\n        }\n        // Strip off any trailing slash (either Unix or Windows).\n        this.cssData = txt.replace(/&lt;&lt;&lt;PATH>>>/g, Blockly.Css.mediaPath_);\n    }\n}\n\n/**\n * Generates a PNG version of the current workspace. This PNG is stored in a Base-64 encoded\n * string as part of a data URL (e.g., \"data:image/png;base64,...\").\n * TODO: There seems to be some problems capturing blocks that don't start with\n * statement level blocks (e.g., expression blocks).\n * \n * @param {Function} callback - A function to be called with the results. This function should take two parameters, the URL (as a string) of the generated base64-encoded PNG and the IMG tag.\n */\nBlockPyEditor.prototype.getPngFromBlocks = function(callback) {\n    this.loadCss();\n    try {\n        // Retreive the entire canvas, strip some unnecessary tags\n        var blocks = this.blockly.svgBlockCanvas_.cloneNode(true);\n        blocks.removeAttribute(\"width\");\n        blocks.removeAttribute(\"height\");\n        // Ensure that we have some content\n        if (blocks.childNodes[0] !== undefined) {\n            // Remove tags that offset\n            blocks.removeAttribute(\"transform\");\n            blocks.childNodes[0].removeAttribute(\"transform\");\n            blocks.childNodes[0].childNodes[0].removeAttribute(\"transform\");\n            // Add in styles\n            var linkElm = document.createElementNS(\"http://www.w3.org/1999/xhtml\", \"style\");\n            linkElm.textContent = this.cssData + '\\n\\n';\n            blocks.insertBefore(linkElm, blocks.firstChild);\n            // Get the bounding box\n            var bbox = document.getElementsByClassName(\"blocklyBlockCanvas\")[0].getBBox();\n            // Create the XML representation of the SVG\n            var xml = new XMLSerializer().serializeToString(blocks);\n            xml = '&lt;svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"'+bbox.width+'\" height=\"'+bbox.height+'\" viewBox=\"0 0 '+bbox.width+' '+bbox.height+'\">&lt;rect width=\"100%\" height=\"100%\" fill=\"white\">&lt;/rect>'+xml+'&lt;/svg>';\n            // create a file blob of our SVG.\n            // Unfortunately, this crashes modern chrome for unknown reasons.\n            //var blob = new Blob([ this.DOCTYPE + xml], { type: 'image/svg+xml' });\n            //var url = window.URL.createObjectURL(blob);\n            // Old method: this failed on IE\n            var url = \"data:image/svg+xml;base64,\" + btoa(unescape(encodeURIComponent(xml)));\n            // Create an IMG tag to hold the new element\n            var img  = document.createElement(\"img\");\n            img.style.display = 'block';\n            img.onload = function() {\n                var canvas = document.createElement('canvas');\n                canvas.width = bbox.width;\n                canvas.height = bbox.height;\n                var ctx = canvas.getContext('2d');\n                ctx.drawImage(img, 0, 0);\n                var canvasUrl;\n                try {\n                    canvasUrl = canvas.toDataURL(\"image/png\");\n                } catch (e) {\n                    canvasUrl = url;\n                }\n                img.onload = null;\n                callback(canvasUrl, img);\n            }\n            img.onerror = function() {\n                callback(\"\", img);\n            }\n            img.setAttribute('src', url);\n        } else {\n            callback(\"\", document.createElement(\"img\"))\n        }\n    } catch (e) {\n        callback(\"\", document.createElement(\"img\"));\n        console.error(\"PNG image creation not supported!\", e);\n    }\n}\n\n/**\n * Shows a dialog window with the current block workspace encoded as a\n * downloadable PNG image.\n */\nBlockPyEditor.prototype.copyImage = function() {\n    var dialog = this.main.components.dialog;\n    this.getPngFromBlocks(function(canvasUrl, img) {\n        img.onload = function() {\n            var span = document.createElement('span');\n            span.textContent = \"Right-click and copy the image below.\"\n            var newWindow = document.createElement('button');\n            var newWindowInner = document.createElement('span');\n            newWindow.className += \"btn btn-default btn-xs\";\n            newWindowInner.className += \"glyphicon glyphicon-new-window\";\n            newWindow.onclick = function() {\n                var output = img.src;\n                window.open(img.src);\n            }\n            newWindow.appendChild(newWindowInner);\n            var div = document.createElement('div');\n            div.appendChild(span);\n            div.appendChild(newWindow);\n            div.appendChild(img);\n            dialog.show(\"Blocks as Image\", div);\n        };\n        img.src = canvasUrl;\n    });\n}</code></pre>\n        </article>\n    </section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>\n"
  },
  {
    "path": "docs/engine.js.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Source: engine.js</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Source: engine.js</h1>\n\n    \n\n\n\n    \n    <section>\n        <article>\n            <pre class=\"prettyprint source linenums\"><code>/**\n * An object for executing Python code and passing the results along to interested components.\n *\n * @constructor\n * @this {BlockPyEditor}\n * @param {Object} main - The main BlockPy instance\n * @param {HTMLElement} tag - The HTML object this is attached to.\n */\nfunction BlockPyEngine(main) {\n    this.main = main;\n    \n    this.loadEngine();\n    \n    this.instructor_module = instructor_module('instructor');\n    \n    //this.main.model.program.subscribe(this.analyze.bind(this))\n}\n\n/**\n * Definable function to be run when execution has fully ended,\n * whether it succeeds or fails.\n *\n */\nBlockPyEngine.prototype.onExecutionEnd = null;\n\n/**\n * Helper function that will attempt to call the defined onExecutionEnd,\n * but will do nothing if there is no function defined.\n */\nBlockPyEngine.prototype.executionEnd_ = function() {\n    if (this.onExecutionEnd !== null) {\n        this.onExecutionEnd();\n    }\n};\n\n/**\n * Initializes the Python Execution engine and the Printer (console).\n */\nBlockPyEngine.prototype.loadEngine = function() {\n    var engine = this;\n    var printer = this.main.components.printer;\n    // Skulpt settings\n    // No connected services\n    Sk.connectedServices = {}\n    // Limit execution to 5 seconds\n    Sk.execLimit = this.main.model.settings.disable_timeout() ? null : 5000;\n    \n    this.main.model.settings.disable_timeout.subscribe(function(newValue) {\n        Sk.execLimit = newValue ? null : 5000;\n    });\n    \n    // Ensure version 3, so we get proper print handling\n    Sk.python3 = true;\n    // Major Skulpt configurations\n    Sk.configure({\n        // Function to handle the text outputted by Skulpt\n        output: printer.print.bind(printer),\n        // Function to handle loading in new files\n        read: this.readFile.bind(this)\n    });\n    // Identify the location to put new charts\n    Sk.console = printer.getConfiguration();\n    // Stepper! Executed after every statement.\n    Sk.afterSingleExecution = this.step.bind(this);\n    // Definitely use a prompt\n    Sk.inputfunTakesPrompt = true;\n    \n    // Keeps track of the tracing while the program is executing; destroyed afterwards.\n    this.executionBuffer = {};\n}\n\n/**\n * Used to access Skulpt built-ins. This is pretty generic, taken\n * almost directly from the Skulpt docs.\n *\n * @param {String} filename - The python filename (e.g., \"os\" or \"pprint\") that will be loaded.\n * @returns {String} The JavaScript source code of the file (weird, right?)\n * @throws Will throw an error if the file isn't found.\n */\nBlockPyEngine.prototype.readFile = function(filename) {\n    if (Sk.builtinFiles === undefined ||\n        Sk.builtinFiles[\"files\"][filename] === undefined) {\n        throw \"File not found: '\" + filename + \"'\";\n    }\n    return Sk.builtinFiles[\"files\"][filename];\n}\n\n/**\n * Resets the state of the execution engine, including reinitailizing\n * the execution buffer (trace, step, etc.), reseting the printer, and\n * hiding the trace button.\n *\n */\nBlockPyEngine.prototype.reset = function() {\n    this.executionBuffer = {\n        'trace': [],\n        'step': 0,\n        'last_step': 0,\n        'line_number': 0,\n    };\n    this.main.model.execution.trace.removeAll();\n    this.main.model.execution.step(0);\n    this.main.model.execution.last_step(0);\n    this.main.model.execution.line_number(0)\n    this.main.components.printer.resetPrinter();\n    this.main.model.execution.show_trace(false);\n}\n\n/**\n * \"Steps\" the execution of the code, meant to be used as a callback to the Skulpt\n * environment.\n * \n * @param {Object} variables - Hash that maps the names of variables (Strings) to their Skulpt representation.\n * @param {Number} lineNumber - The corresponding line number in the source code that is being executed.\n * @param {Number} columnNumber - The corresponding column number in the source code that is being executed. Think of it as the \"X\" position to the lineNumber's \"Y\" position.\n * @param {String} filename - The name of the python file being executed (e.g., \"__main__.py\").\n * @param {String} astType - Unused? TODO: What is this?\n * @param {String} ast - String-encoded JSON representation of the AST node associated with this element.\n */\nBlockPyEngine.prototype.step = function(variables, lineNumber, \n                                       columnNumber, filename, astType, ast) {\n    if (filename == '&lt;stdin>.py') {\n        var currentStep = this.executionBuffer.step;\n        var globals = this.parseGlobals(variables);\n        this.executionBuffer.trace.push(\n            {'step': currentStep,\n             'filename': filename,\n             //'block': highlightMap[lineNumber-1],\n             'line': lineNumber,\n             'column': columnNumber,\n             'properties': globals.properties,\n             'modules': globals.modules});\n        this.executionBuffer.step = currentStep+1;\n        this.executionBuffer.last_step = currentStep+1;\n        this.executionBuffer.line_number = lineNumber;\n    }\n}\n\n/**\n * Called at the end of the Skulpt execution to terminate the executionBuffer\n * and hand it off to the execution trace in the model.\n */\nBlockPyEngine.prototype.lastStep = function() {\n    var execution = this.main.model.execution;\n    execution.trace(this.executionBuffer.trace);\n    this.main.model.execution.step(this.executionBuffer.step)\n    this.main.model.execution.last_step(this.executionBuffer.last_step)\n    this.main.model.execution.line_number(this.executionBuffer.line_number)\n    //this.executionBuffer = undefined;\n}\n\n/**\n * Runs the AbstractInterpreter to get some static information about the code,\n * in particular the variables' types. This is needed for type checking.\n *\n * @returns {Object&lt;String, AIType>} Maps variable names (as Strings) to types as constructed by the AbstractIntepreter.\n */\nBlockPyEngine.prototype.analyzeVariables = function() {\n    // Get the code\n    var code = this.main.model.programs['__main__']();\n    if (code.trim() == \"\") {\n        return {};\n    }\n    \n    var analyzer = new AbstractInterpreter(code);\n    report = analyzer.report;\n    return analyzer.variableTypes;\n}\n\n/**\n * Runs the AbstractInterpreter to get some static information about the code,\n * including potential semantic errors. It then parses that information to give\n * feedback.\n *\n * @returns {Boolean} Whether the code was successfully analyzed.\n */\nBlockPyEngine.prototype.analyze = function() {\n    this.main.model.execution.status(\"analyzing\");\n    \n    var feedback = this.main.components.feedback;\n    \n    // Get the code\n    var code = this.main.model.programs['__main__']();\n    if (code.trim() == \"\") {\n        this.main.components.feedback.emptyProgram(\"You haven't written any code yet!\");\n        //this.main.model.feedback.status(\"semantic\");\n        return false;\n    }\n    \n    var analyzer = new AbstractInterpreter(code);\n    this.main.model.execution.ast = analyzer.ast;\n    \n    report = analyzer.report;\n    // Syntax error\n    if (report.error !== false) {\n        console.log(report.error.args.v)\n        var codeLine = '.';\n        if (report.error.args.v.length > 3) {\n            codeLine = ', where it says:&lt;br>&lt;code>'+report.error.args.v[3][2]+'&lt;/code>';\n        }\n        this.main.reportError('editor', report.error, \"While attempting to process your Python code, I found a syntax error. In other words, your Python code has a mistake in it (e.g., mispelled a keyword, bad indentation, unnecessary symbol). You should check to make sure that you have written all of your code correctly. To me, it looks like the problem is on line \"+ report.error.args.v[2]+codeLine, report.error.args.v[2]);\n        return false;\n    }\n        \n    if (report[\"Unconnected blocks\"].length >= 1) {\n        var variable = report['Unconnected blocks'][0];\n        feedback.semanticError(\"Unconnected blocks\", \"It looks like you have unconnected blocks on line \"+variable.position.line+\". Before you run your program, you must make sure that all of your blocks are connected and that there are no unfilled holes.\", variable.position.line)\n        return false;\n    } else if (report['Iteration variable is iteration list'].length >= 1) {\n        var variable = report['Iteration variable is iteration list'][0];\n        feedback.semanticError(\"Iteration Problem\", \"The property &lt;code>\"+variable.name+\"&lt;/code> was iterated on line \"+variable.position.line+\", but you used the same variable as the iteration variable. You should choose a different variable name for the iteration variable. Usually, the iteration variable is the singular form of the iteration list (e.g., &lt;code>for dog in dogs:&lt;/code>).\", variable.position.line)\n        return false;\n    } else if (report[\"Undefined variables\"].length >= 1) {\n        var variable = report[\"Undefined variables\"][0];\n        feedback.semanticError(\"Initialization Problem\", \"The property &lt;code>\"+variable.name+\"&lt;/code> was read on line \"+variable.position.line+\", but it was not given a value on a previous line. You cannot use a property until it has been initialized.\", variable.position.line)\n        return false;\n    } else if (report[\"Possibly undefined variables\"].length >= 1) {\n        var variable = report[\"Possibly undefined variables\"][0];\n        feedback.semanticError(\"Initialization Problem\", \"The property &lt;code>\"+variable.name+\"&lt;/code> was read on line \"+variable.position.line+\", but it was possibly not given a value on a previous line. You cannot use a property until it has been initialized. Check to make sure that this variable was declared in all of the branches of your decision.\", variable.position.line);\n        return false;\n    } else if (report[\"Unread variables\"].length >= 1) {\n        var variable = report[\"Unread variables\"][0];\n        feedback.semanticError(\"Unused Property\", \"The property &lt;code>\"+variable.name+\"&lt;/code> was set, but was never used after that.\", null)\n        return false;\n    } else if (report[\"Overwritten variables\"].length >= 1) {\n        var variable = report[\"Overwritten variables\"][0];\n        feedback.semanticError(\"Overwritten Property\", \"The property &lt;code>\"+variable.name+\"&lt;/code> was set, but before it could be read it was changed on line \"+variable.position.line+\". It is unnecessary to change an existing variable's value without reading it first.\", variable.position.line)\n        return false;\n    } else if (report[\"Empty iterations\"].length >= 1) {\n        var variable = report[\"Empty iterations\"][0];\n        feedback.semanticError(\"Iterating over empty list\", \"The property &lt;code>\"+variable.name+\"&lt;/code> was set as an empty list, and then you attempted to iterate over it on \"+variable.position.line+\". You should only iterate over non-empty lists.\", variable.position.line)\n        return false;\n    } else if (report[\"Non-list iterations\"].length >= 1) {\n        var variable = report[\"Non-list iterations\"][0];\n        feedback.semanticError(\"Iterating over non-list\", \"The property &lt;code>\"+variable.name+\"&lt;/code> is not a list, but you attempted to iterate over it on \"+variable.position.line+\". You should only iterate over non-empty lists.\", variable.position.line)\n        return false;\n    } else if (report[\"Incompatible types\"].length >= 1) {\n        var variable = report[\"Incompatible types\"][0];\n        feedback.semanticError(\"Incompatible types\", \"You attempted to \"+variable.operation+\" a \"+variable.left.type+\" and a \"+variable.right.type+\" on line \"+variable.position.line+\". But you can't do that with that operator. Make sure both sides of the operator are the right type.\", variable.position.line)\n        return false;\n    }\n    \n    return true;\n}\n\nvar GLOBAL_VALUE;\n\n/**\n * Runs the given python code, resetting the console and Trace Table.\n */\nBlockPyEngine.prototype.run = function() {\n    // Reset everything\n    this.reset();\n    \n    if (!this.main.model.settings.disable_semantic_errors() &amp;&amp;\n        !this.main.model.assignment.disable_algorithm_errors()) {\n        var success = this.analyze();\n        if (success === false) {\n            this.executionEnd_();\n            return;\n        }\n    }\n    \n    Sk.builtins.value = new Sk.builtin.func(function() {\n        return Sk.ffi.remapToPy(GLOBAL_VALUE === undefined ? 5 : GLOBAL_VALUE);\n    });\n    Sk.builtins.set_value = new Sk.builtin.func(function(v) {\n        GLOBAL_VALUE = v.v;\n    });\n    \n    this.main.model.execution.status(\"running\");\n    \n    var feedback = this.main.components.feedback;\n    \n    // Get the code\n    var code = this.main.model.programs['__main__']();\n    if (code.trim() == \"\") {\n        feedback.emptyProgram();\n        this.main.model.execution.status(\"error\");\n        this.executionEnd_();\n        return;\n    }\n    // Actually run the python code\n    var executionPromise = Sk.misceval.asyncToPromise(function() {\n        return Sk.importMainWithBody(\"&lt;stdin>\", false, code, true);\n    });\n    \n    var engine = this;\n    var server = this.server;\n    var execution = this.main.model.execution;\n    executionPromise.then(\n        function (module) {\n            // Run the afterSingleExecution one extra time for final state\n            Sk.afterSingleExecution(module.$d, -1, 0, \"&lt;stdin>.py\");\n            engine.lastStep();\n            // Handle checks\n            feedback.noErrors()\n            engine.check(code, execution.trace(), execution.output(), execution.ast, module.$d);\n            // Reenable \"Run\"\n            engine.main.model.execution.status(\"waiting\");\n            engine.executionEnd_();\n        },\n        function(error) {\n            feedback.printError(error);\n            engine.main.model.execution.status(\"error\");\n            engine.executionEnd_();\n            //server.logEvent('blockly_error', error);\n        }\n    );\n}\n\n/**\n * Indents the given string by 4 spaces. This correctly handles multi-line strings.\n *\n * @param {String} str - The string to be manipulated.\n * @returns {String} The string with four spaces added at the start of every new line.\n */\nfunction indent(str) {\n  return str.replace(/^(?=.)/gm, '    ');\n}\n\n/**\n * Skulpt Module for holding the Instructor API.\n *\n * This module is a little hackish. We need to sit down and reevaluate the best way to\n * organize it and whether this particular structure is ideal. I suspect it should be\n * it's own proper JS file.\n *\n * @param {String} name - The name of the module (should always be 'instructor')\n *\n */\nvar instructor_module = function(name) {\n    // Main module object that gets returned at the end.\n    var mod = {};\n    \n    /**\n     * Skulpt Exception that represents a Feedback object, to be rendered to the user\n     * when the feedback system finds a problem.\n     * \n     * @param {Array} args - A list of optional arguments to pass to the Exception.\n     *                       Usually this will include a message for the user.\n     */\n    Sk.builtin.Feedback = function (args) {\n        var o;\n        if (!(this instanceof Sk.builtin.Feedback)) {\n            o = Object.create(Sk.builtin.Feedback.prototype);\n            o.constructor.apply(o, arguments);\n            return o;\n        }\n        Sk.builtin.Exception.apply(this, arguments);\n    };\n    Sk.abstr.setUpInheritance(\"Feedback\", Sk.builtin.Feedback, Sk.builtin.Exception);\n    \n    /**\n     * Skulpt Exception that represents a Success object, to be thrown when the user\n     * completes their program successfully.\n     *\n     ** @param {Array} args - A list of optional arguments to pass to the Exception.\n     *                       Usually this will be empty.\n     */\n    Sk.builtin.Success = function (args) {\n        var o;\n        if (!(this instanceof Sk.builtin.Success)) {\n            o = Object.create(Sk.builtin.Success.prototype);\n            o.constructor.apply(o, arguments);\n            return o;\n        }\n        Sk.builtin.Exception.apply(this, arguments);\n    };\n    Sk.abstr.setUpInheritance(\"Success\", Sk.builtin.Success, Sk.builtin.Exception);\n    \n    /**\n     * Skulpt Exception that represents a Finished object, to be thrown when the user\n     * completes their program successfully, but isn't in a problem with a \"solution\".\n     * This is useful for open-ended canvases where we still want to capture the students'\n     * code in Canvas.\n     *\n     ** @param {Array} args - A list of optional arguments to pass to the Exception.\n     *                       Usually this will be empty.\n     */\n    Sk.builtin.Finished = function (args) {\n        var o;\n        if (!(this instanceof Sk.builtin.Finished)) {\n            o = Object.create(Sk.builtin.Finished.prototype);\n            o.constructor.apply(o, arguments);\n            return o;\n        }\n        Sk.builtin.Exception.apply(this, arguments);\n    };\n    Sk.abstr.setUpInheritance(\"Finished\", Sk.builtin.Finished, Sk.builtin.Exception);\n    \n    /**\n     * A Skulpt function that throws a Feedback exception, allowing us to give feedback\n     * to the user through the Feedback panel. This function call is done for aesthetic\n     * reasons, so that we are calling a function instead of raising an error. Still,\n     * exceptions allow us to break out of the control flow immediately, like a \n     * return, so they are a good mechanism to use under the hood.\n     * \n     * @param {String} message - The message to display to the user.\n     */\n    mod.set_feedback = new Sk.builtin.func(function(message) {\n        Sk.builtin.pyCheckArgs(\"set_feedback\", arguments, 1, 1);\n        Sk.builtin.pyCheckType(\"message\", \"string\", Sk.builtin.checkString(message));\n        throw new Sk.builtin.Feedback(message.v);\n    });\n    \n    /**\n     * A Skulpt function that throws a Success exception. This will terminate the\n     * feedback analysis, but reports that the students' code was successful.\n     * This function call is done for aesthetic reasons, so that we are calling a\n     * function instead of raising an error. Still, exceptions allow us to break\n     * out of the control flow immediately, like a return would, so they are a\n     * good mechanism to use under the hood.\n     */\n    mod.set_success = new Sk.builtin.func(function() {\n        Sk.builtin.pyCheckArgs(\"set_success\", arguments, 0, 0);\n        throw new Sk.builtin.Success();\n    });\n    \n    /**\n     * A Skulpt function that throws a Finished exception. This will terminate the\n     * feedback analysis, but reports that the students' code was successful.\n     * This function call is done for aesthetic reasons, so that we are calling a\n     * function instead of raising an error. Still, exceptions allow us to break\n     * out of the control flow immediately, like a return would, so they are a\n     * good mechanism to use under the hood.\n     */\n    mod.set_finished = new Sk.builtin.func(function() {\n        Sk.builtin.pyCheckArgs(\"set_finished\", arguments, 0, 0);\n        throw new Sk.builtin.Finished();\n    });\n    \n    // Memoization of previous parses - some mild redundancy to save time\n    // TODO: There's no evidence this is good, and could be a memory hog on big\n    // programs. Someone should investigate this. The assumption is that multiple\n    // helper functions might be using parses. But shouldn't we trim old parses?\n    // Perhaps a timed cache would work better.\n    var parses = {};\n    \n    /**\n     * Given source code as a string, return a flat list of all of the AST elements\n     * in the parsed source code.\n     *\n     * TODO: There's redundancy here, since the source code was previously parsed\n     * to run the file and to execute it. We should probably be able to do this just\n     * once and shave off time.\n     *\n     * @param {String} source - Python source code.\n     * @returns {Array.&lt;Object>}\n     */\n    function getParseList(source) {\n        if (!(source in parses)) {\n            var parse = Sk.parse(\"__main__\", source);\n            parses[source] = Sk.astFromParse(parse.cst, \"__main__\", parse.flags);\n        }\n        var ast = parses[source];\n        return (new NodeVisitor()).recursive_walk(ast);\n    }\n    \n    /**\n     * Given source code as a string, return a list of all of the AST elements\n     * that are Num (aka numeric literals) but that are not inside List elements.\n     *\n     * @param {String} source - Python source code.\n     * @returns {Array.number} The list of JavaScript numeric literals that were found.\n     */\n    function getNonListNums(source) {\n        if (!(source in parses)) {\n            var parse = Sk.parse(\"__main__\", source);\n            parses[source] = Sk.astFromParse(parse.cst, \"__main__\", parse.flags);\n        }\n        var ast = parses[source];\n        var visitor = new NodeVisitor();\n        var insideList = false;\n        var nums = [];\n        visitor.visit_List = function(node) {\n            insideList = true;\n            this.generic_visit(node);\n            insideList = false;\n        }\n        visitor.visit_Num = function(node) {\n            if (!insideList) {\n                nums.push(node.n);\n            }\n            this.generic_visit(node);\n        }\n        visitor.visit(ast);\n        return nums;\n    }\n    \n    /**\n     * Given source code as a string, return a list of all of the AST elements\n     * that are being printed (using the print function) but are not variables.\n     *\n     * @param {String} source - Python source code.\n     * @returns {Array.&lt;Object>} The list of AST elements that were found.\n     */\n    function getPrintedNonProperties(source) {\n        if (!(source in parses)) {\n            var parse = Sk.parse(\"__main__\", source);\n            parses[source] = Sk.astFromParse(parse.cst, \"__main__\", parse.flags);\n        }\n        var ast = parses[source];\n        var visitor = new NodeVisitor();\n        var nonVariables = [];\n        visitor.visit_Call = function(node) {\n            var func = node.func;\n            var args = node.args;\n            if (func._astname == 'Name' &amp;&amp; func.id.v == 'print') {\n                for (var i =0; i &lt; args.length; i+= 1) {\n                    if (args[i]._astname != \"Name\") {\n                        nonVariables.push(args[i]);\n                    }\n                }\n            }\n            this.generic_visit(node);\n        }\n        visitor.visit(ast);\n        return nonVariables;\n    }\n    \n    /**\n     * Skulpt function to iterate through the final state of\n     * all the variables in the program, and check to see if they have\n     * a given value.\n     */\n    mod.get_value_by_name = new Sk.builtin.func(function(name) {\n        Sk.builtin.pyCheckArgs(\"get_value_by_name\", arguments, 1, 1);\n        Sk.builtin.pyCheckType(\"name\", \"string\", Sk.builtin.checkString(name));\n        name = name.v;\n        var final_values = Sk.builtins._final_values;\n        if (name in final_values) {\n            return final_values[name];\n        } else {\n            return Sk.builtin.none.none$;\n        }\n    });\n    mod.get_value_by_type = new Sk.builtin.func(function(type) {\n        Sk.builtin.pyCheckArgs(\"get_value_by_type\", arguments, 1, 1);\n        \n        var final_values = Sk.builtins._final_values;\n        var result = [];\n        for (var property in final_values) {\n            if (final_values[property].tp$name == type.tp$name) {\n                result.push(final_values[property]);\n            }\n        }\n        return Sk.builtin.list(result);\n    });\n    \n    mod.parse_json = new Sk.builtin.func(function(blob) {\n        Sk.builtin.pyCheckArgs(\"parse_json\", arguments, 1, 1);\n        Sk.builtin.pyCheckType(\"blob\", \"string\", Sk.builtin.checkString(blob));\n        blob = blob.v;\n        return Sk.ffi.remapToPy(JSON.parse(blob));\n    });\n    mod.get_property = new Sk.builtin.func(function(name) {\n        Sk.builtin.pyCheckArgs(\"get_property\", arguments, 1, 1);\n        Sk.builtin.pyCheckType(\"name\", \"string\", Sk.builtin.checkString(name));\n        name = name.v;\n        var trace = Sk.builtins._trace;\n        if (trace.length &lt;= 0) {\n            return Sk.builtin.none.none$;\n        }\n        var properties = trace[trace.length-1][\"properties\"];\n        for (var i = 0, len = properties.length; i &lt; len; i += 1) {\n            if (properties[i]['name'] == name) {\n                return Sk.ffi.remapToPy(properties[i])\n            }\n        }\n        return Sk.builtin.none.none$;\n    });\n    \n    mod.calls_function = new Sk.builtin.func(function(source, name) {\n        Sk.builtin.pyCheckArgs(\"calls_function\", arguments, 2, 2);\n        Sk.builtin.pyCheckType(\"source\", \"string\", Sk.builtin.checkString(source));\n        Sk.builtin.pyCheckType(\"name\", \"string\", Sk.builtin.checkString(name));\n        \n        source = source.v;\n        name = name.v;\n        \n        var ast_list = getParseList(source);\n        \n        var count = 0;\n        for (var i = 0, len = ast_list.length; i &lt; len; i = i+1) {\n            if (ast_list[i]._astname == 'Call') {\n                if (ast_list[i].func._astname == 'Attribute') {\n                    count += Sk.ffi.remapToJs(ast_list[i].func.attr) == name | 0;\n                } else if (ast_list[i].func._astname == 'Name') {\n                    count += Sk.ffi.remapToJs(ast_list[i].func.id) == name | 0;\n                }   \n            }\n        }\n        \n        return Sk.ffi.remapToPy(count > 0);\n    });\n    \n    mod.count_components = new Sk.builtin.func(function(source, component) {\n        Sk.builtin.pyCheckArgs(\"count_components\", arguments, 2, 2);\n        Sk.builtin.pyCheckType(\"source\", \"string\", Sk.builtin.checkString(source));\n        Sk.builtin.pyCheckType(\"component\", \"string\", Sk.builtin.checkString(component));\n        \n        source = source.v;\n        component = component.v;\n        \n        var ast_list = getParseList(source);\n        \n        var count = 0;\n        for (var i = 0, len = ast_list.length; i &lt; len; i = i+1) {\n            if (ast_list[i]._astname == component) {\n                count = count+1;\n            }\n        }\n        \n        return Sk.ffi.remapToPy(count);\n    });\n    \n    mod.no_nonlist_nums = new Sk.builtin.func(function(source) {\n        Sk.builtin.pyCheckArgs(\"no_nonlist_nums\", arguments, 1, 1);\n        Sk.builtin.pyCheckType(\"source\", \"string\", Sk.builtin.checkString(source));\n        \n        source = source.v;\n        \n        var num_list = getNonListNums(source);\n        \n        var count = 0;\n        for (var i = 0, len = num_list.length; i &lt; len; i = i+1) {\n            if (num_list[i].v != 0 &amp;&amp; num_list[i].v != 1) {\n                return Sk.ffi.remapToPy(true);\n            }\n        }\n        return Sk.ffi.remapToPy(false);\n    });\n    mod.only_printing_properties = new Sk.builtin.func(function(source) {\n        Sk.builtin.pyCheckArgs(\"only_printing_properties\", arguments, 1, 1);\n        Sk.builtin.pyCheckType(\"source\", \"string\", Sk.builtin.checkString(source));\n        \n        source = source.v;\n        \n        var non_var_list = getPrintedNonProperties(source);\n        return Sk.ffi.remapToPy(non_var_list.length == 0);\n    });\n    \n    return mod;\n}\n\nBlockPyEngine.prototype.setupEnvironment = function(student_code, traceTable, output, ast, final_values) {\n    var model = this.main.model;\n    this._backup_execution = Sk.afterSingleExecution;\n    Sk.afterSingleExecution = undefined;\n    Sk.builtins.get_output = new Sk.builtin.func(function() { \n        Sk.builtin.pyCheckArgs(\"get_output\", arguments, 0, 0);\n        return Sk.ffi.remapToPy(model.execution.output());\n    });\n    Sk.builtins.reset_output = new Sk.builtin.func(function() { \n        Sk.builtin.pyCheckArgs(\"reset_output\", arguments, 0, 0);\n        model.execution.output.removeAll();\n    });\n    Sk.builtins.log = new Sk.builtin.func(function(data) { \n        Sk.builtin.pyCheckArgs(\"log\", arguments, 1, 1);\n        console.log(data)\n    });\n    //Sk.builtins.trace = Sk.ffi.remapToPy(traceTable);\n    Sk.builtins._trace = traceTable;\n    Sk.builtins._final_values = final_values;\n    Sk.builtins.code = Sk.ffi.remapToPy(student_code);\n    Sk.builtins.set_success = this.instructor_module.set_success;\n    Sk.builtins.set_feedback = this.instructor_module.set_feedback;\n    Sk.builtins.set_finished = this.instructor_module.set_finished;\n    Sk.builtins.count_components = this.instructor_module.count_components;\n    Sk.builtins.no_nonlist_nums = this.instructor_module.no_nonlist_nums;\n    Sk.builtins.only_printing_properties = this.instructor_module.only_printing_properties;\n    Sk.builtins.calls_function = this.instructor_module.calls_function;\n    Sk.builtins.get_property = this.instructor_module.get_property;\n    Sk.builtins.get_value_by_name = this.instructor_module.get_value_by_name;\n    Sk.builtins.get_value_by_type = this.instructor_module.get_value_by_type;\n    Sk.builtins.parse_json = this.instructor_module.parse_json;\n    Sk.skip_drawing = true;\n    model.settings.mute_printer(true);\n}\n\nBlockPyEngine.prototype.disposeEnvironment = function() {\n    Sk.afterSingleExecution = this._backup_execution;\n    Sk.builtins.get_output = undefined;\n    Sk.builtins.reset_output = undefined;\n    Sk.builtins.log = undefined;\n    Sk.builtins._trace = undefined;\n    Sk.builtins.trace = undefined;\n    Sk.builtins.code = undefined;\n    Sk.builtins.set_success = undefined;\n    Sk.builtins.set_feedback = undefined;\n    Sk.builtins.set_finished = undefined;\n    Sk.builtins.count_components = undefined;\n    Sk.builtins.calls_function = undefined;\n    Sk.builtins.get_property = undefined;\n    Sk.builtins.get_value_by_name = undefined;\n    Sk.builtins.get_value_by_type = undefined;\n    Sk.builtins.no_nonlist_nums = undefined;\n    Sk.builtins.only_printing_properties = undefined;\n    Sk.builtins.parse_json = undefined;\n    Sk.skip_drawing = false;\n    GLOBAL_VALUE = undefined;\n    this.main.model.settings.mute_printer(false);\n}\n\nBlockPyEngine.prototype.check = function(student_code, traceTable, output, ast, final_values) {\n    var engine = this;\n    var server = this.main.components.server;\n    var model = this.main.model;\n    var on_run = model.programs['give_feedback']();\n    if (on_run !== undefined &amp;&amp; on_run.trim() !== \"\") {\n        on_run = 'def run_code():\\n'+indent(student_code)+'\\n'+on_run;\n        this.setupEnvironment(student_code, traceTable, output, ast, final_values);\n        \n        var executionPromise = Sk.misceval.asyncToPromise(function() {\n            return Sk.importMainWithBody(\"&lt;stdin>\", false, on_run, true);\n        });\n        executionPromise.then(\n            function (module) {\n                engine.main.components.feedback.noErrors();\n                engine.disposeEnvironment();\n            }, function (error) {\n                engine.disposeEnvironment();\n                console.log(error.tp$name, error.tp$name == \"Success\");\n                if (error.tp$name == \"Success\") {\n                    server.markSuccess(1.0);\n                    engine.main.components.feedback.complete();\n                } else if (error.tp$name == \"Feedback\") {\n                    server.markSuccess(0.0);\n                    engine.main.components.feedback.instructorFeedback(\"Incorrect Answer\", error.args.v[0].v);\n                } else if (error.tp$name == \"Finished\") {\n                    server.markSuccess(1.0);\n                    engine.main.components.feedback.finished();\n                } else {\n                    console.error(error);\n                    engine.main.components.feedback.internalError(error, \"Feedback Error\", \"Error in instructor's feedback. Please show the above message to an instructor!\");\n                    server.logEvent('blockly_instructor_error', ''+error);\n                }\n            });\n    }\n}\n\nBlockPyEngine.prototype.parseGlobals = function(variables) {\n    var result = Array();\n    var modules = Array();\n    for (var property in variables) {\n        var value = variables[property];\n        if (property !== \"__name__\" &amp;&amp; property !== \"__doc__\") {\n            property = property.replace('_$rw$', '')\n                               .replace('_$rn$', '');\n            var parsed = this.parseValue(property, value);\n            if (parsed !== null) {\n                result.push(parsed);\n            } else if (value.constructor == Sk.builtin.module) {\n                modules.push(value.$d.__name__.v);\n            }\n        }\n    }\n    return {\"properties\": result, \"modules\": modules};\n}\n\nBlockPyEngine.prototype.parseValue = function(property, value) {\n    if (value == undefined) {\n        return {'name': property,\n                'type': 'Unknown',\n                \"value\": 'Undefined'\n                };\n    }\n    switch (value.constructor) {\n        case Sk.builtin.func:\n            return {'name': property,\n                    'type': \"Function\",\n                    \"value\":  \n                        (value.func_code.co_varnames !== undefined ?\n                         \" Arguments: \"+value.func_code.co_varnames.join(\", \") :\n                         ' No arguments')\n                    };\n        case Sk.builtin.module: return null;\n        case Sk.builtin.str:\n            return {'name': property,\n                'type': \"String\",\n                \"value\": value.$r().v\n            };\n        case Sk.builtin.none:\n            return {'name': property,\n                'type': \"None\",\n                \"value\": \"None\"\n            };\n        case Sk.builtin.bool:\n            return {'name': property,\n                'type': \"Boolean\",\n                \"value\": value.$r().v\n            };\n        case Sk.builtin.nmber:\n            return {'name': property,\n                'type': \"int\" == value.skType ? \"Integer\": \"Float\",\n                \"value\": value.$r().v\n            };\n        case Sk.builtin.int_:\n            return {'name': property,\n                'type': \"Integer\",\n                \"value\": value.$r().v\n            };\n        case Sk.builtin.float_:\n            return {'name': property,\n                'type': \"Float\",\n                \"value\": value.$r().v\n            };\n        case Sk.builtin.tuple:\n            return {'name': property,\n                'type': \"Tuple\",\n                \"value\": value.$r().v\n            };\n        case Sk.builtin.list:\n            if (value.v.length &lt;= 20) {\n                return {'name': property,\n                    'type': \"List\",\n                    \"value\": value.$r().v,\n                    'exact_value': value\n                };\n            } else {\n                return {'name': property,\n                    'type': \"List\",\n                    \"value\": \"[... \"+value.v.length+\" elements ...]\",\n                    \"exact_value\": value\n                };\n            }\n        case Sk.builtin.dict:\n            return {'name': property,\n                'type': \"Dictionary\",\n                \"value\": value.$r().v\n            };\n        case Number:\n            return {'name': property,\n                'type': value % 1 === 0 ? \"Integer\" : \"Float\",\n                \"value\": value\n            };\n        case String:\n            return {'name': property,\n                'type': \"String\",\n                \"value\": value\n            };\n        case Boolean:\n                return {'name': property,\n                    'type': \"Boolean\",\n                    \"value\": (value ? \"True\": \"False\")\n                };\n        default:\n            return {'name': property,\n                    'type': value.tp$name == undefined ? value : value.tp$name,\n                    \"value\": value.$r == undefined ? value : value.$r().v\n                    };\n    }\n}\n</code></pre>\n        </article>\n    </section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>\n"
  },
  {
    "path": "docs/english.js.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Source: english.js</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Source: english.js</h1>\n\n    \n\n\n\n    \n    <section>\n        <article>\n            <pre class=\"prettyprint source linenums\"><code>/**\n * An object for handling the conversion of Python to an English transliteration.\n * Currently dummied out, but we will bring this feature back.\n *\n * @constructor\n * @this {BlockPyEnglish}\n * @param {Object} main - The main BlockPy instance\n */\nfunction BlockPyEnglish(main) {\n    this.main = main; \n}\n\n/**\n * A method for opening a dialog with the english transliteration.\n */\nBlockPyEnglish.prototype.openDialog = function() {\n    try {\n        body = Blockly.Pseudo.workspaceToCode();\n    } catch (e) {\n        console.error(e);\n        body = \"I couldn't understand the code. Sorry!\"\n    }\n    this.main.components.dialog.show(\"English\", body, function() {});\n}</code></pre>\n        </article>\n    </section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>\n"
  },
  {
    "path": "docs/feedback.js.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Source: feedback.js</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Source: feedback.js</h1>\n\n    \n\n\n\n    \n    <section>\n        <article>\n            <pre class=\"prettyprint source linenums\"><code>/**\n * An object that manages the feedback area, where users are told the state of their\n * program's execution and given guidance. Also manages the creation of the Trace Table.\n *\n * @constructor\n * @this {BlockPyFeedback}\n * @param {Object} main - The main BlockPy instance\n * @param {HTMLElement} tag - The HTML object this is attached to.\n */\nfunction BlockPyFeedback(main, tag) {\n    this.main = main;\n    this.tag = tag;\n    \n    this.body = this.tag.find('.blockpy-feedback-body');\n    this.title = this.tag.find('.blockpy-feedback-title');\n    this.original = this.tag.find('.blockpy-feedback-original');\n    this.status = this.tag.find('.blockpy-feedback-status');\n    this.trace = this.tag.find('.blockpy-feedback-trace');\n    \n    // Reload the tracetable on click\n    this.trace.click(this.buildTraceTable.bind(this));\n    \n    this.original.hide();\n};\n\n/**\n * Reload the trace table, showing it if it was hidden and\n * resetting its position to the last step.\n */\nBlockPyFeedback.prototype.buildTraceTable = function() {\n    var execution = this.main.model.execution;\n    execution.show_trace(true);\n    execution.trace_step(execution.last_step());\n    this.main.components.server.logEvent('editor', 'trace')\n}\n\n/**\n * Raises a generic warning. This might not be used anymore.\n *\n * @param {String} html - Some HTML content to render to the user.\n */\nBlockPyFeedback.prototype.error = function(html) {\n    this.tag.html(html);\n    this.tag.removeClass(\"alert-success\");\n    this.tag.addClass(\"alert-warning\");\n    this.main.components.printer.print(\"Execution stopped - there was an error!\");\n}\n\n/**\n * Clears any output currently in the feedback area. Also resets the printer and\n * any highlighted lines in the editor.\n */\nBlockPyFeedback.prototype.clear = function() {\n    this.title.html(\"Ready\");\n    this.original.hide();\n    this.body.html(\"Run your program to get feedback.\");\n    this.main.model.status.error(\"none\");\n    this.main.components.editor.unhighlightLines();\n    this.main.components.printer.resetPrinter()\n};\n\n/**\n * Clears any errors from the editor area.\n */\nBlockPyFeedback.prototype.clearEditorErrors = function() {\n    if (this.main.model.status.error() == \"editor\") {\n        this.clear();\n    }\n}\n\n/**\n * Show an error message related to a problem with the editor. This will appear in\n * the Feedback area, the Printer, and also log to the server. The relevant line of\n * code or block will also be highlighted.\n *\n * @param {String} original - HTML content that represents the original error message generated by the system.\n * @param {String} message - HTML content that is a hopefully friendlier message for the user explaining the error.\n * @param {number} line - What line the error occurred on.\n */\nBlockPyFeedback.prototype.editorError = function(original, message, line) {\n    original = this.prettyPrintError(original);\n    this.title.html(\"Editor Error\");\n    this.original.show().html(original);\n    this.body.html(message);\n    this.main.model.status.error(\"editor\");\n    this.main.components.editor.highlightError(line-1);\n    //this.main.components.printer.print(\"Editor error - could not make blocks!\");\n    this.main.components.server.logEvent('feedback', \"Editor Error\", original+\"\\n|\\n\"+message);\n}\n\n/**\n * Mark this problem as completed for the student. This will appear in the Feedback area,\n * and will also unhighlight lines in the editor and log to the server.\n */\nBlockPyFeedback.prototype.complete = function() {\n    this.title.html(\"Complete!\");\n    this.original.hide();\n    this.body.html(\"Great work!\");\n    this.main.model.status.error(\"complete\");\n    this.main.components.editor.unhighlightLines();\n    this.main.components.server.logEvent('feedback', \"Success\");\n}\n\n/**\n * Mark this problem as finished for the student. This will appear in the Feedback area,\n * and will also unhighlight lines in the editor and log to the server.\n */\nBlockPyFeedback.prototype.finished = function() {\n    this.title.html(\"Ran\");\n    this.original.hide();\n    this.body.html(\"Your program ran successfully, without any errors. However, this problem does not have a correct solution. When you are satisfied with your program, you may stop working.\");\n    this.main.model.status.error(\"no errors\");\n    this.main.components.editor.unhighlightLines();\n    this.main.components.server.logEvent('feedback', \"Finished\");\n}\n\n/**\n * This notifies the student that their code ran without errors, but that there was no\n * Success raised by the Checker. This will appear in the Feedback area,\n * and will also unhighlight lines in the editor and log to the server.\n */\nBlockPyFeedback.prototype.noErrors = function() {\n    this.title.html(\"Ran\");\n    this.original.hide();\n    this.body.html(\"No errors reported. View your output on the left.\");\n    this.main.model.status.error(\"no errors\");\n    this.main.components.editor.unhighlightLines();\n    this.main.components.server.logEvent('feedback', \"No Errors\", '');\n}\n\n/**\n * Show an error message related to syntax issue. This will appear in\n * the Feedback area, the Printer, and also log to the server. The relevant line of\n * code or block will also be highlighted.\n *\n * @param {String} original - HTML content that represents the original error message generated by the system.\n * @param {String} message - HTML content that is a hopefully friendlier message for the user explaining the error.\n * @param {number} line - What line the error occurred on.\n */\nBlockPyFeedback.prototype.syntaxError = function(original, message, line) {\n    original = this.prettyPrintError(original);\n    this.title.html(\"Syntax Error\");\n    this.original.show().html(original);\n    this.body.html(message);\n    this.main.model.status.error(\"syntax\");\n    this.main.components.editor.highlightError(line-1);\n    this.main.components.printer.print(\"Execution stopped - there was an error!\");\n    this.main.components.server.logEvent('feedback', \"Syntax Error\", original+\"\\n|\\n\"+message);\n}\n\n/**\n * Show an error message related to semantic error with the program (e.g., unused variable). \n * This will appear in the Feedback area, the Printer, and also log to the server. The\n * relevant line of code or block will also be highlighted.\n *\n * @param {String} original - HTML content that represents the original error message generated by the system.\n * @param {String} message - HTML content that is a hopefully friendlier message for the user explaining the error.\n * @param {number} line - What line the error occurred on.\n */\nBlockPyFeedback.prototype.semanticError = function(name, message, line) {\n    this.title.html(name);\n    this.original.hide();\n    this.body.html(message);\n    this.main.model.status.error(\"semantic\");\n    if (line !== null) {\n        this.main.components.editor.highlightError(line-1);\n    }\n    this.main.components.printer.print(\"Execution stopped - there was an error!\");\n    this.main.components.server.logEvent('feedback', \"Semantic Error\", name+\"\\n|\\n\"+message);\n}\n\n/**\n * Show an error message related to a serious internal BlockPy program. Under normal conditions,\n * this should never appear to a student. This will appear in\n * the Feedback area, the Printer, and also log to the server. The relevant line of\n * code or block will also be highlighted.\n *\n * @param {String} original - HTML content that represents the original error message generated by the system.\n * @param {String} message - HTML content that is a hopefully friendlier message for the user explaining the error.\n * @param {number} line - What line the error occurred on.\n */\nBlockPyFeedback.prototype.internalError = function(original, name, message) {\n    original = this.prettyPrintError(original);\n    this.title.html(name);\n    this.original.show().html(original);\n    this.body.html(message);\n    this.main.model.status.error(\"internal\");\n    this.main.components.printer.print(\"Internal error! Please show this to an instructor!\");\n    this.main.components.server.logEvent('feedback', \"Internal Error\", name+\"\\n|\\n\"+original+\"\\n|\\n\"+message);\n}\n\n/**\n * Show an incorrect code message related to a problem as specified by the Checker. This will appear in\n * the Feedback area, the Printer, and also log to the server. The relevant line of\n * code or block will also be highlighted.\n *\n * @param {String} original - HTML content that represents the original error message generated by the system.\n * @param {String} message - HTML content that is a hopefully friendlier message for the user explaining the error.\n * @param {number} line - What line the error occurred on.\n */\nBlockPyFeedback.prototype.instructorFeedback = function(name, message, line) {\n    this.title.html(name);\n    this.original.hide();\n    this.body.html(message);\n    this.main.model.status.error(\"feedback\");\n    if (line !== undefined) {\n        this.main.components.editor.highlightError(line-1);\n    }\n    this.main.components.server.logEvent('feedback', \"Instructor Feedback\", name+\"\\n|\\n\"+\"\\n|\\n\"+message);\n}\n\n/**\n * Show \"Empty Program\" error, indicating the student hasn't written any code. This will appear in\n * the Feedback area, the Printer, and also log to the server. The relevant line of\n * code or block will also be highlighted.\n *\n * @param {String} original - HTML content that represents the original error message generated by the system.\n * @param {String} message - HTML content that is a hopefully friendlier message for the user explaining the error.\n * @param {number} line - What line the error occurred on.\n */\nBlockPyFeedback.prototype.emptyProgram = function() {\n    this.title.html(\"Blank Program\");\n    this.original.hide().html(\"\");\n    this.body.html(\"You have not written any code yet.\");\n    this.main.model.status.error(\"runtime\");\n    this.main.components.server.logEvent('feedback', \"Empty Program\");\n}\n\n/**\n * Converts any kind of error (usually a Skulpt one) into a prettier version that's ready\n * for users to see. If it's already a string, it is passed along unchanged. But Skulpt\n * errors have to be processed more closely.\n */\nBlockPyFeedback.prototype.prettyPrintError = function(error) {\n    if (typeof error === \"string\") {\n        return error;\n    } else {\n        // A weird skulpt thing?\n        if (error.tp$str !== undefined) {\n            return error.tp$str().v;\n        } else {\n            return \"\"+error.name + \": \" + error.message;\n        }\n    }\n}\n\n/**\n * Print an error to the printers -- the on screen one and the browser one. This\n * will attempt to provide extra explanation and context for an error.\n * Notice that this is largely for Run-time errors that will be thrown when the code\n * is executed, as opposed to ones raised elsewhere in the environment.\n * \n * @param {String} error - The error message to be analyzed and printed.\n */\nBlockPyFeedback.prototype.printError = function(error) {\n    //console.log(error);\n    original = this.prettyPrintError(error);\n    this.title.html(error.tp$name);\n    this.original.show().html(original);\n    if (error.tp$name == \"ParseError\") {\n        this.body.html(\"While attempting to convert the Python code into blocks, I found a syntax error. In other words, your Python code has a spelling or grammatical mistake. You should check to make sure that you have written all of your code correctly. To me, it looks like the problem is on line \"+ error.args.v[2]+', where it says:&lt;br>&lt;code>'+error.args.v[3][2]+'&lt;/code>', error.args.v[2]);\n    } else if (error.constructor == Sk.builtin.NameError\n                &amp;&amp; error.args.v.length > 0\n                &amp;&amp; error.args.v[0].v == \"name '___' is not defined\") {\n        this.body.html(\"You have incomplete blocks. Make sure that you do not have any dangling blocks or blocks that are connected incorrectly.&lt;br>&lt;br>If you look at the text view of your Python code, you'll see &lt;code>___&lt;/code> in the code. The converter will create these &lt;code>___&lt;/code> to show that you have a block that's missing a piece.\");\n    } else if (error.tp$name in EXTENDED_ERROR_EXPLANATION) {\n        this.body.html(EXTENDED_ERROR_EXPLANATION[error.tp$name]);\n    } else {\n        this.body.html(error.enhanced);\n    }\n    console.error(error);\n    if (error.stack) {\n        console.error(error.stack);\n    }\n    this.main.model.status.error(\"runtime\");\n    this.main.components.editor.highlightError(error.traceback[0].lineno-1);\n    this.main.components.server.logEvent('feedback', \"Runtime\", original);\n}\n</code></pre>\n        </article>\n    </section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>\n"
  },
  {
    "path": "docs/global.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Global</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Global</h1>\n\n    \n\n\n\n\n<section>\n\n<header>\n    \n        <h2></h2>\n        \n    \n</header>\n\n<article>\n    <div class=\"container-overview\">\n    \n        \n\n        \n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n        \n    \n    </div>\n\n    \n\n    \n\n    \n\n     \n\n    \n\n    \n        <h3 class=\"subsection-title\">Members</h3>\n\n        \n            \n<h4 class=\"name\" id=\"BlockPyInterface\"><span class=\"type-signature\"></span>BlockPyInterface<span class=\"type-signature\"></span></h4>\n\n\n\n\n<div class=\"description\">\n    An automatically generated file, based on interface.html.\nAn interesting problem in web development is managing HTML\ncode in JS files. Rather than embedding string literals and\nconcatenating them, or some other hackish soluion,\nwe simply convert an HTML file to a JS string. Therefore,\nrelevant edits should be in interface.html instead.\n\nThe BlockPyInterface global can be seen as a constant\nrepresentation of the default interface.\n</div>\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"interface.js.html\">interface.js</a>, <a href=\"interface.js.html#line13\">line 13</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n        \n            \n<h4 class=\"name\" id=\"EXTENDED_ERROR_EXPLANATION\"><span class=\"type-signature\"></span>EXTENDED_ERROR_EXPLANATION<span class=\"type-signature\"></span></h4>\n\n\n\n\n<div class=\"description\">\n    A dictionary of improved explanations for Python errors. These are shown to users\nalongside the regular errors to hopefully increase clarity.\n</div>\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"python_errors.js.html\">python_errors.js</a>, <a href=\"python_errors.js.html#line5\">line 5</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n        \n            \n<h4 class=\"name\" id=\"timerGuard\"><span class=\"type-signature\"></span>timerGuard<span class=\"type-signature\"></span></h4>\n\n\n\n\n<div class=\"description\">\n    Attempts to update the model for the current code file from the \ntext editor. Might be prevented if an update event was already\npercolating. Also unhighlights any lines.\n</div>\n\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"editor.js.html\">editor.js</a>, <a href=\"editor.js.html#line557\">line 557</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n        \n    \n\n    \n        <h3 class=\"subsection-title\">Methods</h3>\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"cloneNode\"><span class=\"type-signature\"></span>cloneNode<span class=\"signature\">(node)</span><span class=\"type-signature\"> &rarr; {Node}</span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Deeply clones a node\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>node</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Node</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">A node to clone</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"main.js.html\">main_v4.js</a>, <a href=\"main.js.html#line25\">line 25</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<h5>Returns:</h5>\n\n        \n<div class=\"param-desc\">\n    A clone of the given node and all its children\n</div>\n\n\n\n<dl>\n    <dt>\n        Type\n    </dt>\n    <dd>\n        \n<span class=\"param-type\">Node</span>\n\n\n    </dd>\n</dl>\n\n    \n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"encodeHTML\"><span class=\"type-signature\"></span>encodeHTML<span class=\"signature\">(str)</span><span class=\"type-signature\"> &rarr; {string}</span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Encodes some text so that it can be safely written into an HTML box.\nThis includes replacing special HTML characters (&, <, >, etc.).\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>str</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">string</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The text to be converted.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"util.js.html\">util.js</a>, <a href=\"util.js.html#line41\">line 41</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<h5>Returns:</h5>\n\n        \n<div class=\"param-desc\">\n    The HTML-safe text.\n</div>\n\n\n\n<dl>\n    <dt>\n        Type\n    </dt>\n    <dd>\n        \n<span class=\"param-type\">string</span>\n\n\n    </dd>\n</dl>\n\n    \n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"expandArray\"><span class=\"type-signature\"></span>expandArray<span class=\"signature\">(array, addArray, removeArray)</span><span class=\"type-signature\"> &rarr; {Array}</span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    A helper function for extending an array based\non an \"addArray\" and \"removeArray\". Any element\nfound in removeArray is removed from the first array\nand all the elements of addArray are added.\nCreates a new array, so is non-destructive.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>array</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Array</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">the array to manipulate</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>addArray</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Array</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">the elements to add to the array</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>removeArray</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">Array</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">the elements to remove from the array</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"main.js.html\">main_v4.js</a>, <a href=\"main.js.html#line13\">line 13</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<h5>Returns:</h5>\n\n        \n<div class=\"param-desc\">\n    The modified array\n</div>\n\n\n\n<dl>\n    <dt>\n        Type\n    </dt>\n    <dd>\n        \n<span class=\"param-type\">Array</span>\n\n\n    </dd>\n</dl>\n\n    \n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"indent\"><span class=\"type-signature\"></span>indent<span class=\"signature\">(str)</span><span class=\"type-signature\"> &rarr; {String}</span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Indents the given string by 4 spaces. This correctly handles multi-line strings.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>str</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The string to be manipulated.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"engine.js.html\">engine.js</a>, <a href=\"engine.js.html#line318\">line 318</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<h5>Returns:</h5>\n\n        \n<div class=\"param-desc\">\n    The string with four spaces added at the start of every new line.\n</div>\n\n\n\n<dl>\n    <dt>\n        Type\n    </dt>\n    <dd>\n        \n<span class=\"param-type\">String</span>\n\n\n    </dd>\n</dl>\n\n    \n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"indent\"><span class=\"type-signature\"></span>indent<span class=\"signature\">(str, numOfIndents, opt_spacesPerIndent<span class=\"signature-attributes\">opt</span>)</span><span class=\"type-signature\"> &rarr; {string}</span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Indents the given string\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n        <th>Attributes</th>\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>str</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">string</span>\n\n\n            \n            </td>\n\n            \n                <td class=\"attributes\">\n                \n\n                \n\n                \n                </td>\n            \n\n            \n\n            <td class=\"description last\">The string to be indented.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>numOfIndents</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">number</span>\n\n\n            \n            </td>\n\n            \n                <td class=\"attributes\">\n                \n\n                \n\n                \n                </td>\n            \n\n            \n\n            <td class=\"description last\">The amount of indentations to place at the\n    beginning of each line of the string.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>opt_spacesPerIndent</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">number</span>\n\n\n            \n            </td>\n\n            \n                <td class=\"attributes\">\n                \n                    &lt;optional><br>\n                \n\n                \n\n                \n                </td>\n            \n\n            \n\n            <td class=\"description last\">Optional.  If specified, this should be\n    the number of spaces to be used for each tab that would ordinarily be\n    used to indent the text.  These amount of spaces will also be used to\n    replace any tab characters that already exist within the string.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"util.js.html\">util.js</a>, <a href=\"util.js.html#line24\">line 24</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<h5>Returns:</h5>\n\n        \n<div class=\"param-desc\">\n    The new string with each line beginning with the desired\n    amount of indentation.\n</div>\n\n\n\n<dl>\n    <dt>\n        Type\n    </dt>\n    <dd>\n        \n<span class=\"param-type\">string</span>\n\n\n    </dd>\n</dl>\n\n    \n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"instructor_module\"><span class=\"type-signature\"></span>instructor_module<span class=\"signature\">(name)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Skulpt Module for holding the Instructor API.\n\nThis module is a little hackish. We need to sit down and reevaluate the best way to\norganize it and whether this particular structure is ideal. I suspect it should be\nit's own proper JS file.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>name</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The name of the module (should always be 'instructor')</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"engine.js.html\">engine.js</a>, <a href=\"engine.js.html#line332\">line 332</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"prettyPrintDateTime\"><span class=\"type-signature\"></span>prettyPrintDateTime<span class=\"signature\">(timeString)</span><span class=\"type-signature\"> &rarr; {String}</span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Helper function to parse a date/time string and rewrite it as something\nmore human readable.\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>timeString</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">String</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">the string representation of time (\"YYYYMMDD HHMMSS\")</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"history.js.html\">history.js</a>, <a href=\"history.js.html#line31\">line 31</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<h5>Returns:</h5>\n\n        \n<div class=\"param-desc\">\n    - A human-readable time string.\n</div>\n\n\n\n<dl>\n    <dt>\n        Type\n    </dt>\n    <dd>\n        \n<span class=\"param-type\">String</span>\n\n\n    </dd>\n</dl>\n\n    \n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"randomInteger\"><span class=\"type-signature\"></span>randomInteger<span class=\"signature\">(min, max)</span><span class=\"type-signature\"> &rarr; {number}</span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    Return a random integer between [`min`, `max`].\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>min</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">number</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The lowest possible integer.</td>\n        </tr>\n\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>max</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">number</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">The highest possible integer (inclusive).</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"util.js.html\">util.js</a>, <a href=\"util.js.html#line8\">line 8</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n<h5>Returns:</h5>\n\n        \n<div class=\"param-desc\">\n    A random integer.\n</div>\n\n\n\n<dl>\n    <dt>\n        Type\n    </dt>\n    <dd>\n        \n<span class=\"param-type\">number</span>\n\n\n    </dd>\n</dl>\n\n    \n\n\n\n        \n            \n\n    \n\n    <h4 class=\"name\" id=\"set_button_loaded\"><span class=\"type-signature\"></span>set_button_loaded<span class=\"signature\">(btn)</span><span class=\"type-signature\"></span></h4>\n\n    \n\n\n\n<div class=\"description\">\n    This is a very simplistic helper function that will transform\na given button into a \"Loaded\" state (disabled, pressed state, etc.).\n</div>\n\n\n\n\n\n\n\n\n\n    <h5>Parameters:</h5>\n    \n\n<table class=\"params\">\n    <thead>\n    <tr>\n        \n        <th>Name</th>\n        \n\n        <th>Type</th>\n\n        \n\n        \n\n        <th class=\"last\">Description</th>\n    </tr>\n    </thead>\n\n    <tbody>\n    \n\n        <tr>\n            \n                <td class=\"name\"><code>btn</code></td>\n            \n\n            <td class=\"type\">\n            \n                \n<span class=\"param-type\">HTMLElement</span>\n\n\n            \n            </td>\n\n            \n\n            \n\n            <td class=\"description last\">An HTML element to change the text of.</td>\n        </tr>\n\n    \n    </tbody>\n</table>\n\n\n\n\n\n\n<dl class=\"details\">\n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n\n    \n    <dt class=\"tag-source\">Source:</dt>\n    <dd class=\"tag-source\"><ul class=\"dummy\"><li>\n        <a href=\"corgis.js.html\">corgis.js</a>, <a href=\"corgis.js.html#line129\">line 129</a>\n    </li></ul></dd>\n    \n\n    \n\n    \n\n    \n</dl>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n        \n    \n\n    \n\n    \n</article>\n\n</section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>"
  },
  {
    "path": "docs/history.js.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Source: history.js</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Source: history.js</h1>\n\n    \n\n\n\n    \n    <section>\n        <article>\n            <pre class=\"prettyprint source linenums\"><code>/**\n * An object for displaying the user's coding logs (their history).\n * A lightweight component, its only job is to open a dialog.\n *\n * @constructor\n * @this {BlockPyHistory}\n * @param {Object} main - The main BlockPy instance\n */\nfunction BlockPyHistory(main) {\n    this.main = main;\n}\n\nvar monthNames = [\n  \"Jan\", \"Feb\", \"Mar\",\n  \"Apr\", \"May\", \"June\", \"July\",\n  \"Aug\", \"Sept\", \"Oct\",\n  \"Nov\", \"Dec\"\n];\nvar weekDays = [\n    \"Sun\", \"Mon\", \"Tue\",\n    \"Wed\", \"Thu\", \"Fri\",\n    \"Sat\"\n];\n\n/**\n * Helper function to parse a date/time string and rewrite it as something\n * more human readable.\n * @param {String} timeString - the string representation of time (\"YYYYMMDD HHMMSS\")\n * @returns {String} - A human-readable time string.\n */\nfunction prettyPrintDateTime(timeString) {\n    var year = timeString.slice(0, 4),\n        month = parseInt(timeString.slice(4, 6), 10)-1,\n        day = timeString.slice(6, 8),\n        hour = timeString.slice(9, 11),\n        minutes = timeString.slice(11, 13),\n        seconds = timeString.slice(13, 15);\n    var date = new Date(year, month, day, hour, minutes, seconds);\n    var dayStr = weekDays[date.getDay()];\n    var monthStr = monthNames[date.getMonth()];\n    var yearFull = date.getFullYear();\n    var complete = dayStr+\", \"+monthStr+\" \"+date.getDate()+\", \"+yearFull+\" at \"+date.toLocaleTimeString();\n    return complete;\n}\n\n\n/**\n * Opens the history dialog box. This requires a trip to the server and\n * occurs asynchronously. The users' code is shown in preformatted text\n * tags (no code highlighting currently) along with the timestamp.\n */\nBlockPyHistory.prototype.openDialog = function() {\n    var dialog = this.main.components.dialog;\n    var body = \"&lt;pre>a = 0&lt;/pre>\";\n    this.main.components.server.getHistory(function (data) {\n        body = data.reverse().reduce(function (complete, elem) { \n            var complete_str = prettyPrintDateTime(elem.time);\n            var new_line = \"&lt;b>\"+complete_str+\"&lt;/b>&lt;br>&lt;pre>\"+elem.code+\"&lt;/pre>\";\n            return complete+\"\\n\"+new_line;\n        }, \"\");\n        dialog.show(\"Work History\", body, function() {});\n    });\n};</code></pre>\n        </article>\n    </section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>\n"
  },
  {
    "path": "docs/imported.js.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Source: imported.js</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Source: imported.js</h1>\n\n    \n\n\n\n    \n    <section>\n        <article>\n            <pre class=\"prettyprint source linenums\"><code>/*\nBlockly.Blocks['classics_get_all'] = {\n  init: function() {\n    this.setHelpUrl('http://www.example.com/');\n    this.setColour(WEATHER_HUE);\n    this.appendDummyInput()\n        .appendField(\"classics.get all books\");\n    this.setInputsInline(false);\n    this.setOutput(true, \"Number\");\n    this.setTooltip('Returns all the books');\n  }\n};\nBlockly.Python['classics_get_all'] = function(block) {\n    Blockly.Python.definitions_['import_classics'] = 'import classics';\n    var code = 'classics.get_all()';\n    return [code, Blockly.Python.ORDER_ATOMIC];\n};\n\nPythonToBlocks.KNOWN_MODULES['classics'] = {\n    \"get_all\": [\"classics_get_all\"]\n};\n*/\n\n\nfunction newBlock(name) {\n    var block = blockpy.components.editor.blockly.newBlock(name);\n    block.initSvg();\n    block.render();\n}\n\nvar DAYS = [\n    [\"Monday\", \"MON\"],\n    [\"Tuesday\", \"TUE\"],\n    [\"Wednesday\", \"WED\"],\n    [\"Thursday\", \"THU\"],\n    [\"Friday\", \"FRI\"],\n    [\"Saturday\", \"SAT\"],\n    [\"Sunday\", \"SUN\"]\n  ]\n\nvar DAYS_MAP = {\n        'mon': 'parking.Day(\"MON\")',\n        'tue': 'parking.Day(\"TUE\")',\n        'wed': 'parking.Day(\"WED\")',\n        'thu': 'parking.Day(\"THU\")',\n        'fri': 'parking.Day(\"FRI\")',\n        'sat': 'parking.Day(\"SAT\")',\n        'sun': 'parking.Day(\"SUN\")',\n        'tod': 'parking.today()'\n    };\n\n\nBlockly.Blocks['datetime_day'] = {\n  /**\n   * Block for datetime day.\n   * @this Blockly.Block\n   */\n  init: function() {\n    this.jsonInit({\n      \"message0\": \"%1\",\n      \"args0\": [\n        {\n          \"type\": \"field_dropdown\",\n          \"name\": \"DAY\",\n          \"options\": [[\"Today\", \"TODAY\"]].concat(DAYS)\n        }\n      ],\n      \"output\": \"DatetimeDay\",\n      \"colour\": DATA_HUE,\n      \"tooltip\": \"Returns a day of the week\",\n      \"helpUrl\": \"\"\n    });\n  }\n};\nBlockly.Python['datetime_day'] = function(block) {\n    Blockly.Python.definitions_['import_parking'] = 'import parking';\n    var operator = DAYS_MAP[block.getFieldValue('DAY').slice(0, 3).toLowerCase()];\n    return [operator, Blockly.Python.ORDER_ATOMIC];\n};\n\nvar HOURS = [[\"1\", \"1\"], [\"2\", \"2\"], [\"3\", \"3\"],\n             [\"4\", \"4\"], [\"5\", \"5\"], [\"6\", \"6\"], [\"7\", \"7\"],\n             [\"8\", \"8\"], [\"9\", \"9\"], [\"10\", \"10\"], [\"11\", \"11\"],\n             [\"12\", \"12\"]];\nvar MINUTES = [[\"00\", \"00\"], [\"30\", \"30\"]];\nvar MERIDIANS = [[\"am\", \"AM\"], [\"pm\", \"PM\"]];\n\nBlockly.Blocks['datetime_time'] = {\n  /**\n   * Block for datetime day.\n   * @this Blockly.Block\n   */\n    init: function() {\n        this.setColour(DATA_HUE);\n        var dropdown = new Blockly.FieldDropdown([[\"Now\", \"NOW\"]].concat(HOURS), function(opt) {\n            var isNow = (opt == 'NOW');\n            this.sourceBlock_.updateShape_(isNow);\n        });\n        this.appendDummyInput()\n            .appendField(dropdown, 'HOUR');\n        this.setInputsInline(true);\n        this.setOutput(true, 'DatetimeTime');\n        this.setTooltip(\"Returns a time of day\");\n    },\n    mutationToDom: function() {\n        var container = document.createElement('mutation');\n        var isNow = (this.getFieldValue('HOUR').toUpperCase() == 'NOW');\n        container.setAttribute('isnow', isNow);\n        return container;\n    },\n    domToMutation: function(xmlElement) {\n        var isNow = (xmlElement.getAttribute('isnow') == 'true');\n        this.updateShape_(isNow);\n    },\n    updateShape_: function(isNow) {\n        // Add or remove a Value Input.\n        var inputExists = this.getInput('EXTENDED');\n        if (!isNow) {\n            if (!inputExists) {\n                var minuteMenu = new Blockly.FieldDropdown(MINUTES);\n                var meridianMenu = new Blockly.FieldDropdown(MERIDIANS);\n                this.appendDummyInput('EXTENDED')\n                    .appendField(':')\n                    .appendField(minuteMenu, 'MINUTE')\n                    .appendField(meridianMenu, 'MERIDIAN');\n            }\n        } else if (inputExists) {\n            this.removeInput('EXTENDED');\n        }\n    }\n};\n\nvar HOURS_MAP = {\n    '1': 'parking.one()',\n    '2': 'parking.two()',\n    '3': 'parking.three()',\n    '4': 'parking.four()',\n    '5': 'parking.five()',\n    '6': 'parking.six()',\n    '7': 'parking.seven()',\n    '8': 'parking.eight()',\n    '9': 'parking.nine()',\n    '10': 'parking.ten()',\n    '11': 'parking.eleven()',\n    '12': 'parking.twelve()',\n    'NOW': 'parking.now()'\n};\nvar MINUTES_MAP = {\n    '00': 'parking.exactly()',\n    '30': 'parking.half()'\n}\nvar MERIDIANS_MAP = {\n    'AM': 'parking.am()',\n    'PM': 'parking.pm()'\n}\n\nBlockly.Python['datetime_time'] = function(block) {\n    Blockly.Python.definitions_['import_parking'] = 'import parking';\n    var hour = block.getFieldValue('HOUR');\n    var code;\n    if (hour == \"NOW\") {\n        code = \"parking.now()\";\n    } else {\n        var minute = parseInt(block.getFieldValue('MINUTE'));\n        var meridian = Blockly.Python.quote_(block.getFieldValue('MERIDIAN'));\n        code = 'parking.Time('+hour+','+minute+','+meridian+')';\n    }\n    return [code, Blockly.Python.ORDER_ATOMIC];\n};\n\nvar convertDate = function(date) {\n    date = date.slice(0, 3).toLowerCase();\n    switch (date) {\n        case \"mon\": return \"Monday\";\n        case \"tue\": return \"Tuesday\";\n        case \"wed\": return \"Wednesday\";\n        case \"thu\": return \"Thursday\";\n        case \"fri\": return \"Friday\";\n        case \"sat\": return \"Saturday\";\n        case \"sun\": return \"Sunday\";\n        default: return date;\n    }\n}\nvar convertMinute = function(minute) {\n    if (minute &lt; 10) {\n        return \"0\"+minute;\n    } else {\n        return \"\"+minute;\n    }\n}\n\nPythonToBlocks.KNOWN_MODULES['parking'] = {\n    \"today\": [\"datetime_day\", [\"DAY\", \"TODAY\"]],\n    \"day_compare\": [\"datetime_check_day\", \"OP\", \n                            {\"type\": \"variable\", \"mode\": \"value\", \"name\": \"LEFT\"}, \n                            {\"type\": \"mapper\", \"name\": \"VALUE\", \"method\": convertDate}],\n    \"Day\": [\"datetime_day\", {\"type\": \"mapper\", \"name\": \"DAY\", \"method\": convertDate}],\n    \"now\": [\"datetime_time\", [\"HOUR\", \"NOW\"]],\n    \"Time\": [\"datetime_time\", {\"type\": \"integer\", \"name\": \"HOUR\", \"add_mutation\": {\"name\": \"@isnow\", \"value\": \"false\"}}, \n                             {\"type\": \"integer_mapper\", \"name\": \"MINUTE\", \"method\": convertMinute}, \n                             \"MERIDIAN\"],\n    \"time_compare\": [\"datetime_check_time\", \"OP\",\n                            {\"type\": \"variable\", \"mode\": \"value\", \"name\": \"LEFT\"}, \n                            {\"type\": \"integer\", \"name\": \"HOURS\"},\n                            {\"type\": \"integer_mapper\", \"name\": \"MINUTES\", \"method\": convertMinute},\n                            \"MERIDIANS\"]\n};\n\nvar equalityOperators = [\n    [\"==\", \"IS\"],\n    [\"&lt;\", \"BEFORE\"],\n    [\">\", \"AFTER\"],\n    [\"&lt;=\", \"BEFORE_EQUAL\"],\n    [\"=>\", \"AFTER_EQUAL\"],\n    [\"!=\", \"IS_NOT\"]\n];\nvar equalityOperatorsConversions = {\n    \"IS\": \"parking.equal\",\n    \"BEFORE\": \"parking.before\",\n    \"AFTER\": \"parking.after\",\n    \"BEFORE_EQUAL\": \"parking.before_equal\",\n    \"AFTER_EQUAL\": \"parking.after_equal\",\n    \"IS_NOT\": \"parking.not_equal\",\n}\n// FINISH _time and _day\n// Add in numbers and days to KNOWN_MODULES\n\nBlockly.Blocks['datetime_check_day'] = {\n  /**\n   * Block for testing if something contains something.\n   * @this Blockly.Block\n   */\n  init: function() {\n    this.setColour(Blockly.Blocks.logic.HUE);\n    this.setOutput(true, 'Boolean');\n    this.appendValueInput('LEFT')\n        .setCheck('DatetimeDay')\n        .appendField(new Blockly.FieldDropdown(DAYS), 'VALUE')\n        .appendField(new Blockly.FieldDropdown(equalityOperators), 'OP');\n    \n    this.setInputsInline(false);\n  }\n};\n\nBlockly.Python['datetime_check_day'] = function(block) {\n    Blockly.Python.definitions_['import_parking'] = 'import parking';\n    var value = Blockly.Python.quote_(block.getFieldValue('VALUE'));\n    var operator = Blockly.Python.quote_(block.getFieldValue('OP'));\n    var left = Blockly.Python.valueToCode(block, 'LEFT', Blockly.Python.ORDER_ATOMIC) || \"___\";\n    var code = \"parking.day_compare(\" + operator + \", \" + left + ', ' + value + \")\";\n    return [code, Blockly.Python.ORDER_ATOMIC];\n};\n\n\nBlockly.Blocks['datetime_check_time'] = {\n  /**\n   * Block for testing if something contains something.\n   * @this Blockly.Block\n   */\n  init: function() {\n    this.setColour(Blockly.Blocks.logic.HUE);\n    this.setOutput(true, 'Boolean');\n    this.appendValueInput('LEFT')\n        .setCheck('DatetimeTime')\n        .appendField(new Blockly.FieldDropdown(HOURS), 'HOURS')\n        .appendField(':')\n        .appendField(new Blockly.FieldDropdown(MINUTES), 'MINUTES')\n        .appendField(new Blockly.FieldDropdown(MERIDIANS), 'MERIDIANS')\n        .appendField(new Blockly.FieldDropdown(equalityOperators), 'OP');\n    //this.setInputsInline(true);\n  }\n};\n\nBlockly.Python['datetime_check_time'] = function(block) {\n    Blockly.Python.definitions_['import_parking'] = 'import parking';\n    var hour = parseInt(block.getFieldValue('HOURS'));\n    var minute = parseInt(block.getFieldValue('MINUTES'));\n    var meridian = Blockly.Python.quote_(block.getFieldValue('MERIDIANS'));\n    var operator = Blockly.Python.quote_(block.getFieldValue('OP'));\n    var left = Blockly.Python.valueToCode(block, 'LEFT', Blockly.Python.ORDER_ATOMIC)\n    var code = \"parking.time_compare(\" + operator+\", \"+left + ',' + hour + ',' + minute + ',' +meridian + \")\";\n    return [code, Blockly.Python.ORDER_ATOMIC];\n};\n\nBlockly.Blocks['controls_forEach'] = {\n  /**\n   * Block for 'for each' loop.\n   * @this Blockly.Block\n   */\n  init: function() {\n    this.jsonInit({\n      \"message0\": \"for each item %1 in list %2 : \", //Blockly.Msg.CONTROLS_FOREACH_TITLE,\n      \"args0\": [\n        {\n          \"type\": \"input_value\",\n          \"name\": \"VAR\",\n          \"check\": \"Tuple\"\n        },\n        {\n          \"type\": \"input_value\",\n          \"name\": \"LIST\",\n          \"check\": \"Array\"\n        }\n      ],\n      \"inputsInline\": true,\n      \"previousStatement\": null,\n      \"nextStatement\": null,\n      \"colour\": Blockly.Blocks.loops.HUE,\n      \"helpUrl\": Blockly.Msg.CONTROLS_FOREACH_HELPURL\n    });\n    this.appendStatementInput('DO')\n        .appendField(Blockly.Msg.CONTROLS_FOREACH_INPUT_DO);\n    this.setInputsInline(true);\n    // Assign 'this' to a variable for use in the tooltip closure below.\n    var thisBlock = this;\n    this.setTooltip(function() {\n      return Blockly.Msg.CONTROLS_FOREACH_TOOLTIP.replace('%1',\n          Blockly.Python.valueToCode(thisBlock, 'VAR', Blockly.Python.ORDER_RELATIONAL) || '___');\n    });\n  },\n  customContextMenu: Blockly.Blocks['controls_for'].customContextMenu\n};\n\nBlockly.Python['controls_forEach'] = function(block) {\n  // For each loop.\n  var variable0 = Blockly.Python.valueToCode(block, 'VAR',\n      Blockly.Python.ORDER_RELATIONAL) || '___';\n  var argument0 = Blockly.Python.valueToCode(block, 'LIST',\n      Blockly.Python.ORDER_RELATIONAL) || '___';\n  var branch = Blockly.Python.statementToCode(block, 'DO');\n  branch = Blockly.Python.addLoopTrap(branch, block.id) ||\n      Blockly.Python.PASS;\n  var code = 'for ' + variable0 + ' in ' + argument0 + ':\\n' + branch;\n  return code;\n};\n\nBlockly.Blocks['class_creation'] = {\n  init: function() {\n    this.appendDummyInput()\n        .appendField(\"Create class\")\n        .appendField(new Blockly.FieldVariable(\"new class\"), \"CLASS\");\n    /*\n    this.appendDummyInput()\n        .appendField(\"Inherits from\")\n        .appendField(new Blockly.FieldVariable(\"j\"), \"NAME\")\n        .appendField(\",\")\n        .appendField(new Blockly.FieldVariable(\"k\"), \"NAME\");\n    */\n    this.appendStatementInput(\"BODY\")\n        .setCheck(null);\n    this.setPreviousStatement(true, null);\n    this.setNextStatement(true, null);\n    this.setColour(230);\n    this.setTooltip('');\n    this.setHelpUrl('http://www.example.com/');\n  }\n};\nBlockly.Python['class_creation'] = function(block) {\n  var class_name = Blockly.Python.variableDB_.getName(block.getFieldValue('CLASS'), Blockly.Variables.NAME_TYPE) || '___';\n  var body = Blockly.Python.statementToCode(block, 'BODY') ||\n      Blockly.Python.PASS;\n  // TODO: Assemble Python into code variable.\n  var code = 'class ' + class_name + ':\\n' + body;\n  return code;\n};\n\nBlockly.Blocks['list_comprehension'] = {\n  init: function() {\n    this.appendValueInput(\"body\")\n        .setCheck(null)\n        .appendField(\"[\");\n    this.appendValueInput(\"var\")\n        .setCheck(null)\n        .appendField(\"for\");\n    this.appendValueInput(\"list\")\n        .setCheck(null)\n        .appendField(\"in\");\n    this.appendDummyInput()\n        .appendField(\"]\");\n    this.setInputsInline(true);\n    this.setOutput(true, null);\n    this.setTooltip('');\n    this.setHelpUrl('http://www.example.com/');\n  }\n};\nBlockly.Python['list_comprehension'] = function(block) {\n  var value_body = Blockly.Python.valueToCode(block, 'body', Blockly.Python.ORDER_ATOMIC) || '___';\n  var value_var = Blockly.Python.valueToCode(block, 'var', Blockly.Python.ORDER_ATOMIC) || '___';\n  var value_list = Blockly.Python.valueToCode(block, 'list', Blockly.Python.ORDER_ATOMIC) || '___';\n  // TODO: Assemble Python into code variable.\n  var code = '['+value_body+' for '+value_var+' in '+value_list+']';\n  // TODO: Change ORDER_NONE to the correct strength.\n  return [code, Blockly.Python.ORDER_NONE];\n};\n\n/**\n * Decode an XML DOM and create blocks on the workspace, clearing out old blocks.\n * @param {!Element} xml XML DOM.\n * @param {!Blockly.Workspace} workspace The workspace.\n */\nBlockly.Xml.domToWorkspaceDestructive = function(xml, workspace, errorXml) {\n  if (xml instanceof Blockly.Workspace) {\n    var swap = xml;\n    xml = workspace;\n    workspace = swap;\n    console.warn('Deprecated call to Blockly.Xml.domToWorkspace, ' +\n                 'swap the arguments.');\n  }\n  var width;  // Not used in LTR.\n  if (workspace.RTL) {\n    width = workspace.getWidth();\n  }\n  Blockly.Field.startCache();\n  // Safari 7.1.3 is known to provide node lists with extra references to\n  // children beyond the lists' length.  Trust the length, do not use the\n  // looping pattern of checking the index for an object.\n  var childCount = xml.childNodes.length;\n  var existingGroup = Blockly.Events.getGroup();\n  if (!existingGroup) {\n    Blockly.Events.setGroup(true);\n  }\n  Blockly.Events.disable();\n  while (workspace.topBlocks_.length) {\n    workspace.topBlocks_[0].dispose();\n  }\n  workspace.variableList.length = 0;\n  Blockly.Events.enable();\n\n  // Disable workspace resizes as an optimization.\n  if (workspace.setResizesEnabled) {\n    workspace.setResizesEnabled(false);\n  }\n  for (var i = 0; i &lt; childCount; i++) {\n    var xmlChild = xml.childNodes[i];\n    var name = xmlChild.nodeName.toLowerCase();\n    if (name == 'block' ||\n        (name == 'shadow' &amp;&amp; !Blockly.Events.recordUndo)) {\n      // Allow top-level shadow blocks if recordUndo is disabled since\n      // that means an undo is in progress.  Such a block is expected\n      // to be moved to a nested destination in the next operation.\n      var block = Blockly.Xml.domToBlock(xmlChild, workspace);\n      var blockX = parseInt(xmlChild.getAttribute('x'), 10);\n      var blockY = parseInt(xmlChild.getAttribute('y'), 10);\n      if (!isNaN(blockX) &amp;&amp; !isNaN(blockY)) {\n        block.moveBy(workspace.RTL ? width - blockX : blockX, blockY);\n      }\n    } else if (name == 'shadow') {\n      goog.asserts.fail('Shadow block cannot be a top-level block.');\n    }\n  }\n  if (!existingGroup) {\n    Blockly.Events.setGroup(false);\n  }\n  Blockly.Field.stopCache();\n\n  workspace.updateVariableList(false);\n  // Re-enable workspace resizing.\n  if (workspace.setResizesEnabled) {\n    workspace.setResizesEnabled(true);\n  }      \n}\n\nBlockly.Blocks['comment_single'] = {\n  init: function() {\n    this.appendDummyInput()\n        .appendField(\"Comment:\")\n        .appendField(new Blockly.FieldTextInput(\"will be ignored\"), \"BODY\");\n    this.setInputsInline(true);\n    this.setPreviousStatement(true, null);\n    this.setNextStatement(true, null);\n    this.setColour(60);\n    this.setTooltip('This is a comment, which will be ignored when you execute your code.');\n    this.setHelpUrl('');\n  }\n};\n\nBlockly.Python['comment_single'] = function(block) {\n  var text_body = block.getFieldValue('BODY');\n  // TODO: Assemble JavaScript into code variable.\n  var code = '# '+text_body+'\\n';\n  return code;\n};\n\nBlockly.Blocks['string_multiline'] = {\n  // Container.\n  init: function() {\n    this.appendDummyInput()\n        .appendField('Multiline String:');\n    this.appendDummyInput()\n        .appendField(this.newQuote_(true))\n        .appendField(new Blockly.FieldTextArea(''), 'TEXT')\n        .appendField(this.newQuote_(false));\n    this.setColour(Blockly.Blocks.texts.HUE);\n    this.setOutput(true, 'String');\n  },\n  newQuote_: function(open) {\n    if (open == this.RTL) {\n      var file = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==';\n    } else {\n      var file = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC';\n    }\n    return new Blockly.FieldImage(file, 12, 12, '\"');\n  }\n};\n\nBlockly.Python['string_multiline'] = function(block) {\n  var text_body = block.getFieldValue('TEXT');\n  // TODO: Assemble JavaScript into code variable.\n  var code = '\"\"\"'+text_body+'\"\"\"\\n';\n  return [code, Blockly.Python.ORDER_ATOMIC];\n};\n\nBlockly.Blocks['attribute_access'] = {\n  init: function() {\n    this.appendValueInput(\"MODULE\")\n        .setCheck(null);\n    this.appendValueInput(\"NAME\")\n        .setCheck(null)\n        .appendField(\".\");\n    this.setInputsInline(true);\n    this.setOutput(true, null);\n    this.setColour(230);\n    this.setTooltip('');\n    this.setHelpUrl('');\n  }\n};\n\nBlockly.Python['attribute_access'] = function(block) {\n  var value_module = Blockly.Python.valueToCode(block, 'MODULE', Blockly.Python.ORDER_ATOMIC);\n  var value_name = Blockly.Python.valueToCode(block, 'NAME', Blockly.Python.ORDER_ATOMIC);\n  // TODO: Assemble JavaScript into code variable.\n  var code = value_module+'.'+value_name;\n  // TODO: Change ORDER_NONE to the correct strength.\n  return [code, Blockly.Python.ORDER_NONE];\n};\n\n\n/**\n * Turtles!\n */\nBlockly.Blocks['turtle_create'] = {\n  init: function() {\n    this.appendDummyInput()\n        .appendField(\"create new turtle\");\n    this.setOutput(true, 'Turtle');\n    this.setColour(180);\n    this.setTooltip('Creates a new turtle');\n    this.setHelpUrl('');\n  }\n};\nBlockly.Python['turtle_create'] = function(block) {\n    Blockly.Python.definitions_['import_turtle'] = 'import turtle';\n  var code = 'turtle.Turtle()\\n';\n  // TODO: Change ORDER_NONE to the correct strength.\n  return [code, Blockly.Python.ORDER_NONE];\n};\nPythonToBlocks.KNOWN_MODULES['turtle'] = {\n    \"Turtle\": [\"turtle_create\"]\n}\n\nBlockly.Blocks['turtle_color'] = {\n  init: function() {\n    this.appendValueInput(\"TURTLE\")\n        .setCheck(\"Turtle\")\n        .appendField(\"make turtle\");\n    this.appendValueInput(\"COLOR\")\n        .setCheck(null)\n        .appendField(\"color\");\n    this.setPreviousStatement(true);\n    this.setNextStatement(true);\n    this.setOutput(false);\n    this.setInputsInline(true);\n    this.setColour(180);\n    this.setTooltip('');\n    this.setHelpUrl('');\n  }\n};\nBlockly.Python['turtle_color'] = function(block) {\n  var turtle = Blockly.Python.valueToCode(block, 'TURTLE', Blockly.Python.ORDER_ATOMIC);\n  var color = Blockly.Python.valueToCode(block, 'COLOR', Blockly.Python.ORDER_ATOMIC);\n  // TODO: Assemble Python into code variable.\n  var code = turtle+'.color('+color+')\\n';\n  return code;\n};\nPythonToBlocks.KNOWN_ATTR_FUNCTIONS['color'] = function(func, args, keywords, starargs, kwargs, node) {\n    if (args.length &lt; 1 || args.length > 2) {\n        throw new Error(\"Incorrect number of arguments to turtle.color!\");\n    }\n    return [block(\"turtle_color\", func.lineno, {}, { \n                    \"COLOR\": this.convert(args[0]),\n                    \"TURTLE\": this.convert(func.value)\n                }, {\"inline\": \"true\"})];\n}\n\nBlockly.Blocks['turtle_forward'] = {\n  init: function() {\n    this.appendValueInput(\"TURTLE\")\n        .setCheck(\"Turtle\")\n        .appendField(\"make turtle\");\n    this.appendValueInput(\"DISTANCE\")\n        .setCheck(null)\n        .appendField(\"move forward by\");\n    this.setPreviousStatement(true);\n    this.setNextStatement(true);\n    this.setInputsInline(true);\n    this.setOutput(false);\n    this.setColour(180);\n    this.setTooltip('');\n    this.setHelpUrl('');\n  }\n};\nBlockly.Python['turtle_forward'] = function(block) {\n  var turtle = Blockly.Python.valueToCode(block, 'TURTLE', Blockly.Python.ORDER_ATOMIC);\n  var distance = Blockly.Python.valueToCode(block, 'DISTANCE', Blockly.Python.ORDER_ATOMIC);\n  // TODO: Assemble Python into code variable.\n  var code = turtle+'.forward('+distance+')\\n';\n  return code;\n};\nPythonToBlocks.KNOWN_ATTR_FUNCTIONS['forward'] = function(func, args, keywords, starargs, kwargs, node) {\n    if (args.length != 1) {\n        throw new Error(\"Incorrect number of arguments to turtle.forward!\");\n    }\n    return [block(\"turtle_forward\", func.lineno, {}, { \n                    \"DISTANCE\": this.convert(args[0]),\n                    \"TURTLE\": this.convert(func.value)\n                }, {\"inline\": \"true\"})];\n}\n\nBlockly.Blocks['turtle_backward'] = {\n  init: function() {\n    this.appendValueInput(\"TURTLE\")\n        .setCheck(\"Turtle\")\n        .appendField(\"make turtle\");\n    this.appendValueInput(\"DISTANCE\")\n        .setCheck(null)\n        .appendField(\"move backward by\");\n    this.setPreviousStatement(true);\n    this.setInputsInline(true);\n    this.setNextStatement(true);\n    this.setOutput(false);\n    this.setColour(180);\n    this.setTooltip('');\n    this.setHelpUrl('');\n  }\n};\nBlockly.Python['turtle_backward'] = function(block) {\n  var turtle = Blockly.Python.valueToCode(block, 'TURTLE', Blockly.Python.ORDER_ATOMIC);\n  var distance = Blockly.Python.valueToCode(block, 'DISTANCE', Blockly.Python.ORDER_ATOMIC);\n  // TODO: Assemble Python into code variable.\n  var code = turtle+'.backward('+distance+')\\n';\n  return code;\n};\nPythonToBlocks.KNOWN_ATTR_FUNCTIONS['backward'] = function(func, args, keywords, starargs, kwargs, node) {\n    if (args.length != 1) {\n        throw new Error(\"Incorrect number of arguments to turtle.backward!\");\n    }\n    return [block(\"turtle_backward\", func.lineno, {}, { \n                    \"DISTANCE\": this.convert(args[0]),\n                    \"TURTLE\": this.convert(func.value)\n                }, {\"inline\": \"true\"})];\n}\n\nBlockly.Blocks['turtle_left'] = {\n  init: function() {\n    this.appendValueInput(\"TURTLE\")\n        .setCheck(\"Turtle\")\n        .appendField(\"make turtle\");\n    this.appendValueInput(\"ANGLE\")\n        .setCheck(null)\n        .appendField(\"turn left by\");\n    this.setPreviousStatement(true);\n    this.setNextStatement(true);\n    this.setInputsInline(true);\n    this.setOutput(false);\n    this.setColour(180);\n    this.setTooltip('');\n    this.setHelpUrl('');\n  }\n};\nBlockly.Python['turtle_left'] = function(block) {\n  var turtle = Blockly.Python.valueToCode(block, 'TURTLE', Blockly.Python.ORDER_ATOMIC);\n  var angle = Blockly.Python.valueToCode(block, 'ANGLE', Blockly.Python.ORDER_ATOMIC);\n  // TODO: Assemble Python into code variable.\n  var code = turtle+'.left('+angle+')\\n';\n  return code;\n};\nPythonToBlocks.KNOWN_ATTR_FUNCTIONS['left'] = function(func, args, keywords, starargs, kwargs, node) {\n    if (args.length != 1) {\n        throw new Error(\"Incorrect number of arguments to turtle.left!\");\n    }\n    return [block(\"turtle_left\", func.lineno, {}, { \n                    \"ANGLE\": this.convert(args[0]),\n                    \"TURTLE\": this.convert(func.value)\n                }, {\"inline\": \"true\"})];\n}\n\nBlockly.Blocks['turtle_right'] = {\n  init: function() {\n    this.appendValueInput(\"TURTLE\")\n        .setCheck(\"Turtle\")\n        .appendField(\"make turtle\");\n    this.appendValueInput(\"ANGLE\")\n        .setCheck(null)\n        .appendField(\"turn right by\");\n    this.setPreviousStatement(true);\n    this.setNextStatement(true);\n    this.setInputsInline(true);\n    this.setOutput(false);\n    this.setColour(180);\n    this.setTooltip('');\n    this.setHelpUrl('');\n  }\n};\nBlockly.Python['turtle_right'] = function(block) {\n  var turtle = Blockly.Python.valueToCode(block, 'TURTLE', Blockly.Python.ORDER_ATOMIC);\n  var angle = Blockly.Python.valueToCode(block, 'ANGLE', Blockly.Python.ORDER_ATOMIC);\n  // TODO: Assemble Python into code variable.\n  var code = turtle+'.right('+angle+')\\n';\n  return code;\n};\nPythonToBlocks.KNOWN_ATTR_FUNCTIONS['right'] = function(func, args, keywords, starargs, kwargs, node) {\n    if (args.length != 1) {\n        throw new Error(\"Incorrect number of arguments to turtle.right!\");\n    }\n    return [block(\"turtle_right\", func.lineno, {}, { \n                    \"ANGLE\": this.convert(args[0]),\n                    \"TURTLE\": this.convert(func.value)\n                }, {\"inline\": \"true\"})];\n}</code></pre>\n        </article>\n    </section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>\n"
  },
  {
    "path": "docs/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Home</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Home</h1>\n\n    \n\n\n\n    \n\n\n    <h3> </h3>\n\n\n\n\n\n\n\n\n\n\n    \n\n\n\n\n\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:04 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>"
  },
  {
    "path": "docs/interface.js.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Source: interface.js</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Source: interface.js</h1>\n\n    \n\n\n\n    \n    <section>\n        <article>\n            <pre class=\"prettyprint source linenums\"><code>\n/**\n * An automatically generated file, based on interface.html.\n * An interesting problem in web development is managing HTML\n * code in JS files. Rather than embedding string literals and\n * concatenating them, or some other hackish soluion,\n * we simply convert an HTML file to a JS string. Therefore,\n * relevant edits should be in interface.html instead.\n *\n * The BlockPyInterface global can be seen as a constant\n * representation of the default interface.\n */\nBlockPyInterface = \"&lt;div class='blockpy-content container-fluid' style='background-color :#fcf8e3; border: 1px solid #faebcc; '>    &lt;div class='blockpy-popup modal fade' style='display:none'>        &lt;div class='modal-dialog' style='width:750px'>            &lt;div class='modal-content' id='modal-message' >                &lt;div class='modal-header'>                    &lt;button type='button' class='close' data-dismiss='modal' aria-hidden='true'>&amp;times;&lt;/button>                    &lt;h4 class='modal-title'>Dynamic Content&lt;/h4>                &lt;/div>                &lt;div class='modal-body' style='width:100%; height:400px; white-space:pre-wrap'>                &lt;/div>                &lt;div class='modal-footer'>                    &lt;button type='button' class='btn btn-white' data-dismiss='modal'>Close&lt;/button>                &lt;/div>                &lt;/div>        &lt;/div>    &lt;/div>    &lt;canvas id='capture-canvas' style='display:none'>&lt;/canvas>    &lt;div class='row' style='padding-bottom: 10px; border-bottom: 1px solid #faebcc; '>        &lt;div class='blockpy-content-top col-md-9 col-sm-9'>            &lt;span class='blockpy-alert pull-right text-muted' data-bind=\\\"visible: false, text: status.text\\\">&lt;/span>            &lt;strong>BlockPy: &lt;/strong>             &lt;span class='blockpy-presentation-name'                  data-bind='text: assignment.name'>&lt;/span>            &lt;div class='blockpy-presentation' data-bind=\\\"html: assignment.introduction\\\">            &lt;/div>        &lt;/div>        &lt;div class='blockpy-content-topright col-md-3 col-sm-3'>            &lt;span class='text-muted' data-bind=\\\"visible: status.dataset_loading().length\\\">Loading Dataset!&lt;/span>            &lt;span class='pull-right label label-default blockpy-status-box'                  data-bind=\\\"css: status_server_class()[0],                             text: status_server_class()[1],                             attr: { 'data-original-title': status.server_error }\\\"                  data-toggle=\\\"tooltip\\\" data-placement=\\\"left\\\">Loading&lt;/span>            &lt;div class='pull-right'>                Disable Semantic Errors: &lt;input type='checkbox' data-bind=\\\"checked: settings.disable_semantic_errors\\\">&lt;br>                Disable Timeout: &lt;input type='checkbox' data-bind=\\\"checked: settings.disable_timeout\\\">&lt;br>                Disable Typed Blocks: &lt;input type='checkbox' data-bind=\\\"checked: settings.disable_variable_types\\\">&lt;br>                                &lt;label class='blockpy-toolbar-auto-upload' data-bind=\\\"visible: settings.instructor\\\">                Auto-save:                &lt;input type='checkbox' data-bind=\\\"checked:settings.auto_upload\\\">&lt;br>                &lt;/label>                                &lt;label class='blockpy-toolbar-instructor-mode' data-bind=\\\"visible: settings.instructor_initial\\\">                Instructor mode:                 &lt;input type='checkbox' data-bind=\\\"checked:settings.instructor\\\">&lt;br>                &lt;/label>                                &lt;label class='blockpy-toolbar-instructor-mode' data-bind=\\\"visible: settings.instructor_initial\\\">                Upload mode:                 &lt;input type='checkbox' data-bind=\\\"checked:assignment.upload\\\">&lt;br>                &lt;/label>             &lt;/div>            &lt;!--&lt;img src=\\\"images/corgi.png\\\" class='img-responsive' />-->        &lt;/div>    &lt;/div>    &lt;div class='row' style='margin-top: 5px border: 1px solid #bce8f1;'>        &lt;div class='blockpy-content-left col-md-6 col-sm-6'             style='padding:10px'>            &lt;strong>Printer&lt;/strong>            &lt;div class='blockpy-printer blockpy-printer-default'>            &lt;/div>        &lt;/div>        &lt;div class='blockpy-content-right col-md-6 col-sm-6 bubble'             style='padding:10px'>            &lt;div class='blockpy-feedback'>                &lt;button type='button' class='btn btn-sm btn-default blockpy-feedback-trace pull-right'                         data-bind=\\\"visible: !execution.show_trace() &amp;&amp; (status.error() == 'feedback' || status.error() == 'no errors'|| status.error() == 'complete')\\\">                    &lt;span class='glyphicon glyphicon-circle-arrow-down'>&lt;/span> Trace Variables                &lt;/button>                                &lt;strong>Feedback: &lt;/strong>                &lt;span class='label blockpy-feedback-status' data-bind=\\\"css: status_feedback_class()[0], text: status_feedback_class()[1]\\\">Runtime Error&lt;/span>                &lt;br>                &lt;pre class='blockpy-feedback-original'>&lt;/pre>                &lt;strong class='blockpy-feedback-title'>&lt;/strong>                &lt;div class='blockpy-feedback-body'>&lt;i>Run your code to get feedback.&lt;/i>&lt;/div>                &lt;div class='blockpy-code-trace'>&lt;/div>                                &lt;!-- ko if: execution.show_trace -->                &lt;div class=\\\"blockpy-feedback-traces\\\">                                &lt;div>                    &lt;button type='button' class='btn btn-default' data-bind=\\\"click: moveTraceFirst\\\">                        &lt;span class='glyphicon glyphicon-step-backward'>&lt;/span>                    &lt;/button>                    &lt;button type='button' class='btn btn-default' data-bind=\\\"click: moveTraceBackward\\\">                        &lt;span class='glyphicon glyphicon-backward'>&lt;/span>                    &lt;/button>                    Step &lt;span data-bind='text: execution.trace_step()'>&lt;/span>                    / &lt;span data-bind='text: execution.last_step()-1'>&lt;/span>                    (&lt;span data-bind='text: current_trace().line == -1 ? \\\"The end\\\" : \\\"Line \\\"+current_trace().line'>&lt;/span>)                    &lt;button type='button' class='btn btn-default' data-bind=\\\"click: moveTraceForward\\\">                        &lt;span class='glyphicon glyphicon-forward'>&lt;/span>                    &lt;/button>                    &lt;button type='button' class='btn btn-default' data-bind=\\\"click: moveTraceLast\\\">                        &lt;span class='glyphicon glyphicon-step-forward'>&lt;/span>                    &lt;/button>                &lt;/div>                                &lt;table class='table table-condensed table-striped table-bordered table-hover'>                    &lt;thead>                        &lt;tr>&lt;th>Name&lt;/th>&lt;th>Type&lt;/th>&lt;th>Value&lt;/th>&lt;/tr>                    &lt;/thead>                    &lt;tbody data-bind=\\\"foreach: current_trace().properties\\\">                        &lt;tr data-bind=\\\"visible: name != '__file__' &amp;&amp; name != '__path__'\\\">                            &lt;td data-bind=\\\"text: name\\\">&lt;/td>                            &lt;td data-bind=\\\"text: type\\\">&lt;/td>                            &lt;td>                                &lt;code data-bind=\\\"text: value\\\">&lt;/code>                                &lt;!-- ko if: type == \\\"List\\\" -->                                &lt;a href=\\\"\\\" data-bind=\\\"click: $root.viewExactValue(type, exact_value)\\\">                                &lt;span class='glyphicon glyphicon-new-window'>&lt;/span>                                &lt;/a>                                &lt;!-- /ko -->                            &lt;/td>                        &lt;/tr>                    &lt;/tbody>                &lt;/table>                                &lt;/div>                &lt;!-- /ko -->                            &lt;/div>        &lt;/div>    &lt;/div>    &lt;div class=\\\"row\\\"         style='background-color :#fcf8e3; padding-bottom: 10px; border: 1px solid #faebcc'>        &lt;div class='col-md-12 col-sm-12 blockpy-toolbar btn-toolbar' role='toolbar'>                        &lt;button type='button' class='btn blockpy-run' style='float:left',                data-bind='css: execution.status() == \\\"running\\\" ? \\\"btn-info\\\" :                                execution.status() == \\\"error\\\" ? \\\"btn-danger\\\" : \\\"btn-success\\\" ' >                &lt;span class='glyphicon glyphicon-play'>&lt;/span> Run            &lt;/button>                        &lt;div class=\\\"btn-group\\\" data-toggle=\\\"buttons\\\" data-bind=\\\"visible: !assignment.upload()\\\">                &lt;label class=\\\"btn btn-default blockpy-mode-set-blocks\\\"                        data-bind=\\\"css: {active: settings.editor() == 'Blocks'}\\\">                    &lt;span class='glyphicon glyphicon-th-large'>&lt;/span>                    &lt;input type=\\\"radio\\\" name=\\\"blockpy-mode-set\\\" autocomplete=\\\"off\\\" checked> Blocks                &lt;/label>                &lt;label class=\\\"btn btn-default blockpy-mode-set-instructor\\\"                       data-bind=\\\"visible: settings.instructor,                                  css: {active: settings.editor() == 'Upload'}\\\">                    &lt;span class='glyphicon glyphicon-list-alt'>&lt;/span>                    &lt;input type=\\\"radio\\\" name=\\\"blockpy-mode-set\\\" autocomplete=\\\"off\\\"> Instructor                &lt;/label>                &lt;label class=\\\"btn btn-default blockpy-mode-set-split\\\"                       data-bind=\\\"css: {active: settings.editor() == 'Split'}\\\">                    &lt;span class='glyphicon glyphicon-resize-horizontal'>&lt;/span>                    &lt;input type=\\\"radio\\\" name=\\\"blockpy-mode-set\\\" autocomplete=\\\"off\\\"> Split                &lt;/label>                &lt;label class=\\\"btn btn-default blockpy-mode-set-text\\\"                        data-bind=\\\"css: {active: settings.editor() == 'Text'}\\\">                    &lt;span class='glyphicon glyphicon-pencil'>&lt;/span>                    &lt;input type=\\\"radio\\\" name=\\\"blockpy-mode-set\\\" autocomplete=\\\"off\\\"> Text                &lt;/label>            &lt;/div>            &lt;button type='button' class='btn btn-default blockpy-toolbar-reset' data-bind=\\\"visible: !assignment.upload()\\\">                &lt;span class='glyphicon glyphicon-refresh'>&lt;/span> Reset            &lt;/button>            &lt;!--&lt;button type='button' class='btn btn-default blockpy-toolbar-capture'>                &lt;span class='glyphicon glyphicon-picture'>&lt;/span> Capture            &lt;/button>-->            &lt;button type='button' class='btn btn-default blockpy-toolbar-import' data-bind=\\\"visible: !assignment.upload() &amp;&amp; (assignment.importable() || settings.instructor())\\\">                &lt;span class='glyphicon glyphicon-cloud-download'>&lt;/span> Import Datasets            &lt;/button>            &lt;button type='button' class='btn btn-default blockpy-toolbar-history'>                &lt;span class='glyphicon glyphicon-hourglass'>&lt;/span> History            &lt;/button>            &lt;!--            &lt;button type='button' class='btn btn-default blockpy-toolbar-english'>                &lt;span class='glyphicon glyphicon-list-alt'>&lt;/span> English            &lt;/button>            -->                        &lt;select data-bind=\\\"visible: settings.instructor() &amp; !assignment.upload(), value: settings.filename\\\"                    class=\\\"blockpy-toolbar-filename-picker\\\">                &lt;option value='__main__' selected>Student Code&lt;/option>                &lt;option value='starting_code'>Starting Code&lt;/option>                &lt;option value='give_feedback'>Generate Feedback&lt;/option>            &lt;/select>                        &lt;/div>    &lt;/div>    &lt;div class='row blockpy-content-bottom'         style='padding-bottom: 10px; border: 1px solid #faebcc'>        &lt;div class='blockpy-editor col-md-12 col-sm-12'>            &lt;div class='blockpy-blocks blockpy-editor-menu'                  style='height:100%'>                &lt;div class='blockly-div' style='height:450px; width: 100%' '>&lt;/div>                &lt;!-- &lt;div class='blockly-area'>&lt;/div> -->            &lt;/div>            &lt;div class='blockpy-text blockpy-editor-menu' style='height: 450px'>                &lt;div class='blockpy-text-sidebar' style='width:150px; height: 100%; float:left; background-color: #ddd'>                &lt;!--                &lt;button type='button' class='btn btn-default blockpy-text-insert-if'>Decision (If)&lt;/button>                &lt;button type='button' class='btn btn-default blockpy-text-insert-if-else'>Decision (If/Else)&lt;/button>                -->                &lt;/div>                &lt;textarea class='codemirror-div language-python'                           style='height:100%'>&lt;/textarea>            &lt;/div>            &lt;div class='blockpy-upload blockpy-editor-menu'>                &lt;label class=\\\"btn btn-default btn-file\\\">                    Browse &lt;input type=\\\"file\\\" style=\\\"display: none;\\\">                &lt;/label>            &lt;/div>            &lt;div class='blockpy-instructor blockpy-editor-menu form-inline'>                &lt;!-- Name -->                &lt;br>                &lt;form class=\\\"form-inline\\\" style='display:inline-block'>                &lt;label>Name:&lt;/label>                &lt;input type='text' class='blockpy-presentation-name-editor form-control'                       data-bind='textInput: assignment.name'>                 &lt;/form>                &lt;br>                &lt;br>                                &lt;label>Introduction:&lt;/label>                &lt;div class='blockpy-presentation-body-editor'>                 &lt;/div>                                &lt;!-- Parsons -->                &lt;label class='blockpy-presentation-parsons-check'>                Parsons:                &lt;input type='checkbox' class='form-control' data-bind=\\\"checked:assignment.parsons\\\">                &lt;/label>                 &lt;br>                                &lt;!-- Importable Datasets -->                &lt;label class='blockpy-presentation-importable-check'>                Able to import datasets:                &lt;input type='checkbox' class='form-control' data-bind=\\\"checked:assignment.importable\\\">                &lt;/label>                 &lt;br>                                &lt;!-- Algorithm Errors -->                &lt;label class='blockpy-presentation-importable-check'>                Disable Algorithm Errors:                &lt;input type='checkbox' class='form-control' data-bind=\\\"checked:assignment.disable_algorithm_errors\\\">                &lt;/label>                 &lt;br>                                &lt;!-- Initial mode -->                &lt;label class='blockpy-presentation-text-first'>                Initial View:                &lt;select data-bind=\\\"value: assignment.initial_view\\\">                    &lt;option value=\\\"Blocks\\\" selected>Blocks&lt;/option>                    &lt;option value=\\\"Text\\\">Text&lt;/option>                    &lt;option value=\\\"Instructor\\\">Instructor&lt;/option>                    &lt;option value=\\\"Upload\\\">Upload&lt;/option>                &lt;/select>                &lt;/label>                &lt;br>                                &lt;label>Available Modules&lt;/lable>                &lt;select class='blockpy-available-modules' multiple='multiple'                        data-bind=\\\"selectedOptions: assignment.modules\\\">                    &lt;option>Properties&lt;/option>                    &lt;option>Decisions&lt;/option>                    &lt;option>Iteration&lt;/option>                    &lt;option>Functions&lt;/option>                    &lt;option>Calculation&lt;/option>                    &lt;option>Output&lt;/option>                    &lt;option>Turtles&lt;/option>                    &lt;option>Python&lt;/option>                    &lt;option>Values&lt;/option>                    &lt;option>Lists&lt;/option>                    &lt;option>Dictionaries&lt;/option>                    &lt;option>Data - Parking&lt;/option>                            &lt;/div>            &lt;div class='blockpy-upload blockpy-editor-menu'>            &lt;/div>        &lt;/div>    &lt;/div>    &lt;div>        &lt;div class='blockpy-content-right col-md-5 col-sm-5 alert alert-info'>            &lt;div class='panel panel-default'>                &lt;div class='panel-heading'>Data Explorer&lt;/div>                &lt;div class='panel-body'>                &lt;div class='blockpy-explorer'>                    &lt;table>&lt;tr>                    &lt;!-- Step: X of Y (Line: Z) -->                    &lt;td colspan='4'>                        &lt;div class='blockpy-explorer-run-hide'>                            &lt;i>Run your code to explore it.&lt;/i>                        &lt;/div>                        &lt;div class='blockpy-explorer-status'>                            &lt;strong>Step: &lt;/strong>                            &lt;span class='blockpy-explorer-step-span'>0&lt;/span> of                             &lt;span class='blockpy-explorer-length-span'>0&lt;/span>                             (&lt;strong>Line: &lt;/strong>                            &lt;span class='blockpy-explorer-line-span'>0&lt;/span>)                        &lt;/div>                    &lt;/td>                    &lt;/tr>&lt;tr>                    &lt;!-- First Previous Next Last -->                    &lt;td style='width:25%'>                        &lt;button type='button' class='btn btn-default blockpy-explorer-first'>                        &lt;span class='glyphicon glyphicon-fast-backward'>&lt;/span> First&lt;/button>                    &lt;/td>&lt;td style='width:25%'>                        &lt;button type='button' class='btn btn-default blockpy-explorer-back'>                        &lt;span class='glyphicon glyphicon-backward'>&lt;/span> Back&lt;/button>                    &lt;/td>&lt;td style='width:25%'>                        &lt;button type='button' class='btn btn-default blockpy-explorer-next'>                        Next &lt;span class='glyphicon glyphicon-forward'>&lt;/span>&lt;/button>                    &lt;/td>&lt;td style='width:25%'>                        &lt;button type='button' class='btn btn-default blockpy-explorer-last'>                        Last &lt;span class='glyphicon glyphicon-fast-forward'>&lt;/span> &lt;/button>                    &lt;/td>                    &lt;/tr>&lt;/table>                    &lt;!-- Printer -->                                        &lt;!-- Modules -->                    &lt;br>&lt;div>                        &lt;strong>Loaded Modules: &lt;/strong>                        &lt;i class='blockpy-explorer-modules'>None&lt;/i>                    &lt;/div>                    &lt;!-- Actual Trace data -->                    &lt;br>&lt;strong>Trace Table&lt;/strong>                    &lt;br>&lt;table style='width: 100%'                            class='table table-condensed table-striped                                    table-bordered table-hover blockpy-explorer-table'>                        &lt;!-- Property Type Value -->                        &lt;tr>                            &lt;th>Property&lt;/th>                            &lt;th>Type&lt;/th>                            &lt;th>Value&lt;/th>                        &lt;/tr>                    &lt;/table>                &lt;/div>                &lt;/div>            &lt;/div>        &lt;/div>    &lt;/div>&lt;/div>&lt;!--&lt;div class='blockpy-explorer-errors alert alert-danger alert-dismissible' role='alert'>                     &lt;button type='button' class='blockpy-explorer-errors-hide close' aria-label='Close'>&lt;span  aria-hidden='true'>&amp;times;&lt;/span>&lt;/button>                     &lt;div class='blockpy-explorer-errors-body'>                                     &lt;/div>-->\";\n</code></pre>\n        </article>\n    </section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>\n"
  },
  {
    "path": "docs/main.js.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Source: main_v4.js</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Source: main_v4.js</h1>\n\n    \n\n\n\n    \n    <section>\n        <article>\n            <pre class=\"prettyprint source linenums\"><code>/**\n * A helper function for extending an array based\n * on an \"addArray\" and \"removeArray\". Any element\n * found in removeArray is removed from the first array\n * and all the elements of addArray are added.\n * Creates a new array, so is non-destructive.\n *\n * @param {Array} array - the array to manipulate\n * @param {Array} addArray - the elements to add to the array\n * @param {Array} removeArray - the elements to remove from the array\n * @return {Array} The modified array\n */\nfunction expandArray(array, addArray, removeArray) {\n    var copyArray = array.filter(function(item) {\n        return removeArray.indexOf(item) === -1;\n    });\n    return copyArray.concat(addArray);\n}\n\n/**\n * Deeply clones a node\n * @param {Node} node A node to clone\n * @return {Node} A clone of the given node and all its children\n */\nfunction cloneNode(node) {\n    // If the node is a text node, then re-create it rather than clone it\n    var clone = node.nodeType == 3 ? document.createTextNode(node.nodeValue) : node.cloneNode(false);\n \n    // Recurse     \n    var child = node.firstChild;\n    while(child) {\n        clone.appendChild(cloneNode(child));\n        child = child.nextSibling;\n    }\n     \n    return clone;\n}\n\n/**\n * Creates an instance of BlockPy\n *\n * @constructor\n * @this {BlockPy}\n * @param {Object} settings - User level settings (e.g., what view mode, whether to mute semantic errors, etc.)\n * @param {Object} assignment - Assignment level settings (data about the loaded assignment, user, submission, etc.)\n * @param {Object} submission - Unused parameter.\n * @param {Object} programs - Includes the source code of any programs to be loaded\n */\nfunction BlockPy(settings, assignment, submission, programs) {\n    this.model = {\n        // User level settings\n        \"settings\": {\n            // Default mode when you open the screen is text\n            // 'text', 'blocks'\n            'editor': ko.observable(assignment.initial_view),\n            // Default mode when you open the screen is instructor\n            // boolean\n            'instructor': ko.observable(settings.instructor),\n            'instructor_initial': ko.observable(settings.instructor),\n            // String\n            'log_id': ko.observable(null),\n            // boolean\n            'enable_blocks': ko.observable(settings.blocks_enabled),\n            // boolean\n            'read_only': ko.observable(settings.read_only),\n            // string\n            'filename': ko.observable(\"__main__\"),\n            // string\n            'level': ko.observable(\"level\"),\n            // boolean\n            'disable_semantic_errors': ko.observable(settings.disable_semantic_errors ||\n                                                     assignment.disable_algorithm_errors || false),\n            // boolean\n            'disable_variable_types': ko.observable(settings.disable_variable_types || true),\n            // boolean\n            'disable_timeout': ko.observable(settings.disable_timeout || false),\n            // boolean\n            'auto_upload': ko.observable(true),\n            // boolean\n            'developer': ko.observable(settings.developer || false),\n            // boolean\n            'mute_printer': ko.observable(false)\n        },\n        'execution': {\n            // 'waiting', 'running'\n            'status': ko.observable('waiting'),\n            // integer\n            'step': ko.observable(0),\n            // integer\n            'last_step': ko.observable(0),\n            // list of string/list of int\n            'output': ko.observableArray([]),\n            // integer\n            'line_number': ko.observable(0),            \n            // array of simple objects\n            'trace': ko.observableArray([]),\n            // integer\n            'trace_step': ko.observable(0),\n            // object\n            'ast': {},\n            // boolean\n            'show_trace': ko.observable(false),\n        },\n        'status': {\n            // boolean\n            'loaded': ko.observable(false),\n            'text': ko.observable(\"Loading\"),\n            // 'none', 'runtime', 'syntax', 'semantic', 'feedback', 'complete', 'editor'\n            'error': ko.observable('none'),\n            // \"Loading\", \"Saving\", \"Ready\", \"Disconnected\", \"Error\"\n            'server': ko.observable(\"Loading\"),\n            // Some message from a server error can go here\n            'server_error': ko.observable(''),\n            // Dataset loading\n            'dataset_loading': ko.observableArray()\n        },\n        'constants': {\n            // string\n            'blocklyPath': settings.blocklyPath,\n            // boolean\n            'blocklyScrollbars': true,\n            // string\n            'attachmentPoint': settings.attachmentPoint,\n            // JQuery object\n            'container': null,\n            // Maps codes ('log_event', 'save_code') to URLs\n            'urls': settings.urls\n        },\n        // Assignment level settings\n        \"assignment\": {\n            'modules': ko.observableArray(expandArray(BlockPy.DEFAULT_MODULES, assignment.modules.added || [], assignment.modules.removed || [])),\n            'assignment_id': assignment.assignment_id,\n            'student_id': assignment.student_id,\n            'course_id': assignment.course_id,\n            'version': ko.observable(assignment.version),\n            //'lis_result_sourcedid': assignment.lis_result_sourcedid,\n            'name': ko.observable(assignment.name),\n            'introduction': ko.observable(assignment.introduction),\n            \"initial_view\": ko.observable(assignment.initial_view || 'Blocks'),\n            'parsons': ko.observable(assignment.parsons),\n            'upload': ko.observable(assignment.initial_view == 'Upload'),\n            'importable': ko.observable(assignment.importable || false),\n            'disable_algorithm_errors': ko.observable(assignment.disable_algorithm_errors || false)\n        },\n        \"programs\": {\n            \"__main__\": ko.observable(programs.__main__),\n            \"starting_code\": ko.observable(assignment.starting_code),\n            \"give_feedback\": ko.observable(assignment.give_feedback),\n            \"answer\": ko.observable(assignment.answer)\n        }\n    };\n    \n    // The code for the current active program file (e.g., \"__main__\")\n    this.model.program = ko.computed(function() {\n        return this.programs[this.settings.filename()]();\n    }, this.model) //.extend({ rateLimit: { method: \"notifyWhenChangesStop\", timeout: 400 } });\n    \n    // Whether this URL has been specified\n    this.model.server_is_connected = function(url) {\n        return this.constants.urls !== undefined &amp;&amp; this.constants.urls[url] !== undefined;\n    };\n    \n    // Helper function to map error statuses to UI elements\n    this.model.status_feedback_class = ko.computed(function() {\n        switch (this.status.error()) {\n            default: case 'none': return ['label-none', ''];\n            case 'runtime': return ['label-runtime-error', 'Runtime Error'];\n            case 'syntax': return ['label-syntax-error', 'Syntax Error'];\n            case 'editor': return ['label-syntax-error', 'Editor Error'];\n            case 'internal': return ['label-internal-error', 'Internal Error'];\n            case 'semantic': return ['label-semantic-error', 'Algorithm Error'];\n            case 'feedback': return ['label-feedback-error', 'Incorrect Answer'];\n            case 'complete': return ['label-problem-complete', 'Complete'];\n            case 'no errors': return ['label-no-errors', 'No errors'];\n        }\n    }, this.model);\n    \n    // Helper function to map Server error statuses to UI elements\n    this.model.status_server_class = ko.computed(function() {\n        switch (this.status.server()) {\n            default: case 'Loading': return ['label-default', 'Loading'];\n            case 'Offline': return ['label-default', 'Offline'];\n            case 'Out of date': return ['label-danger', 'Out of Date'];\n            case 'Loaded': return ['label-success', 'Loaded'];\n            case 'Logging': return ['label-primary', 'Logging'];\n            case 'Saving': return ['label-primary', 'Saving'];\n            case 'Saved': return ['label-success', 'Saved'];\n            case 'Disconnected': return ['label-danger', 'Disconnected'];\n            case 'Error': return ['label-danger', 'Error'];\n        }\n    }, this.model);\n    \n    // Program trace functions\n    var execution = this.model.execution;\n    this.model.moveTraceFirst = function(index) { \n        execution.trace_step(0); };\n    this.model.moveTraceBackward = function(index) { \n        var previous = Math.max(execution.trace_step()-1, 0);\n        execution.trace_step(previous); };\n    this.model.moveTraceForward = function(index) { \n        var next = Math.min(execution.trace_step()+1, execution.last_step());\n        execution.trace_step(next); };\n    this.model.moveTraceLast = function(index) { \n        execution.trace_step(execution.last_step()); };\n    this.model.current_trace = ko.pureComputed(function() {\n        return execution.trace()[Math.min(execution.trace().length-1, execution.trace_step())];\n    });\n    \n    /**\n     * Opens a new window to represent the exact value of a Skulpt object.\n     * Particularly useful for things like lists that can be really, really\n     * long.\n     * \n     * @param {String} type - The type of the value\n     * @param {Object} exact_value - A Skulpt value to be rendered.\n     */\n    this.model.viewExactValue = function(type, exact_value) {\n        return function() {\n            if (type == \"List\") {\n                var output = exact_value.$r().v;\n                var result = (window.btoa?'base64,'+btoa(JSON.stringify(output)):JSON.stringify(output));\n                window.open('data:application/json;' + result);\n            }\n        }\n    }\n    \n    // For performance reasons, batch notifications for execution handling.\n    // I'm not even sure these have any value any more.\n    execution.trace.extend({ rateLimit: { timeout: 20, method: \"notifyWhenChangesStop\" } });\n    execution.step.extend({ rateLimit: { timeout: 20, method: \"notifyWhenChangesStop\" } });\n    execution.last_step.extend({ rateLimit: { timeout: 20, method: \"notifyWhenChangesStop\" } });\n    execution.line_number.extend({ rateLimit: { timeout: 20, method: \"notifyWhenChangesStop\" } });\n    \n    this.initMain();\n}\n\n/**\n * The default modules to make available to the user.\n *\n * @type Array.&lt;String>\n */\nBlockPy.DEFAULT_MODULES = ['Properties', 'Decisions', \n                           'Iteration',\n                           'Calculation', 'Output', \n                           'Values', \n                           'Lists', 'Dictionaries']\n\n/**\n * Initializes the BlockPy object by initializing its interface,\n * model, and components.\n *\n */\nBlockPy.prototype.initMain = function() {\n    this.turnOnHacks();\n    this.initInterface();\n    this.initModel();\n    this.initComponents();\n    if (this.model.settings.developer()) {\n        this.initDevelopment();\n    }\n}\n\n/**\n * Initializes the User Inteface for the instance, by loading in the\n * HTML file (which has been manually encoded into a JS string using\n * the build.py script). We do this because its a giant hassle to keep\n * HTML correct when it's stored in JS strings. We should look into\n * more sophisticated templating features, probably.\n *\n */\nBlockPy.prototype.initInterface = function() {\n    var constants = this.model.constants;\n    // Refer to interface.js, interface.html, and build.py\n    constants.container = $(constants.attachmentPoint).html($(BlockPyInterface))\n}\n\n/**\n * Applys the KnockoutJS bindings to the model, instantiating the values into the\n * HTML.\n */\nBlockPy.prototype.initModel = function() {\n    ko.applyBindings(this.model);\n}\n\n/**\n * Initializes each of the relevant components of BlockPy. For more information,\n * consult each of the component's relevant JS file in turn.\n */\nBlockPy.prototype.initComponents = function() {\n    var container = this.model.constants.container;\n    this.components = {};\n    var main = this,\n        components = this.components;\n    // Each of these components will take the BlockPy instance, and possibly a\n    // reference to the relevant HTML location where it will be embedded.\n    components.dialog = new BlockPyDialog(main, container.find('.blockpy-popup'));\n    components.toolbar  = new BlockPyToolbar(main,  container.find('.blockpy-toolbar'));\n    components.feedback = new BlockPyFeedback(main, container.find('.blockpy-feedback'));\n    components.editor   = new BlockPyEditor(main,   container.find('.blockpy-editor'));\n    components.presentation = new BlockPyPresentation(main, container.find('.blockpy-presentation'));\n    components.printer = new BlockPyPrinter(main, container.find('.blockpy-printer'));\n    components.engine = new BlockPyEngine(main);\n    components.server = new BlockPyServer(main);\n    components.corgis = new BlockPyCorgis(main);\n    components.history = new BlockPyHistory(main);\n    components.english = new BlockPyEnglish(main);\n    components.editor.setMode();\n    main.model.status.server('Loaded')\n    \n    var statusBox = container.find(\".blockpy-status-box\");\n    main.model.status.server.subscribe(function(newValue) {\n        if (newValue == \"Error\" || \n            newValue == \"Offline\" ||\n            newValue == \"Disconnected\") {\n            if (!statusBox.is(':animated')) {\n                statusBox.effect(\"shake\");\n            }\n        } else if (newValue == \"Out of date\") {\n            if (!statusBox.is(':animated')) {\n                statusBox.effect(\"shake\").effect(\"shake\");\n            }\n        }\n    });\n    statusBox.tooltip();\n}\n\n/**\n * Initiailizes certain development data, useful for testing out new modules in\n * Skulpt.\n */\nBlockPy.prototype.initDevelopment = function () {\n    /*$.get('src/skulpt_ast.js', function(data) {\n        Sk.builtinFiles['files']['src/lib/ast/__init__.js'] = data;\n    });*/\n}\n\n/**\n * Redundant method for reporting an error. If this is used anywhere, it should be\n * converted to direct calls to components.feedback.\n */\nBlockPy.prototype.reportError = function(component, original, message, line) {\n    if (component == 'editor') {\n        this.components.feedback.editorError(original, message, line);\n    } else if (component == 'syntax') {\n        this.components.feedback.syntaxError(original, message, line);\n    }\n    console.error(component, message)\n}\n\n/**\n * Helper function for setting the current code, optionally in the given filename.\n *\n * @param {String} code - The new Python source code to set.\n * @param {String?} name - An optional filename (e.g,. '__main__') to update. Defaults to the currently selected filename.\n * @returns {Boolean} - whether the code was updated (i.e. there was a diff between new and old).\n */\nBlockPy.prototype.setCode = function(code, name) {\n    if (name === undefined) {\n        name = this.model.settings.filename();\n    }\n    var original = this.model.programs[name]();\n    this.model.programs[name](code);\n    return original != this.model.programs[name]();\n}\n\n/**\n * Function for running any code that fixes bugs and stuff upstream.\n * Not pleasant that this exists, but better to have it isolated than\n * just lying about randomly...\n *\n */\nBlockPy.prototype.turnOnHacks = function() {\n    /*\n     * jQuery UI shake - Padding disappears\n     * Courtesy: http://stackoverflow.com/questions/22301972/jquery-ui-shake-padding-disappears\n     */\n    if ($.ui) {\n        (function () {\n            var oldEffect = $.fn.effect;\n            $.fn.effect = function (effectName) {\n                if (effectName === \"shake\" || effectName.effect == \"shake\") {\n                    var old = $.effects.createWrapper;\n                    $.effects.createWrapper = function (element) {\n                        var result;\n                        var oldCSS = $.fn.css;\n\n                        $.fn.css = function (size) {\n                            var _element = this;\n                            var hasOwn = Object.prototype.hasOwnProperty;\n                            return _element === element &amp;&amp; hasOwn.call(size, \"width\") &amp;&amp; hasOwn.call(size, \"height\") &amp;&amp; _element || oldCSS.apply(this, arguments);\n                        };\n\n                        result = old.apply(this, arguments);\n\n                        $.fn.css = oldCSS;\n                        return result;\n                    };\n                }\n                return oldEffect.apply(this, arguments);\n            };\n        })();\n    }\n}</code></pre>\n        </article>\n    </section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>\n"
  },
  {
    "path": "docs/presentation.js.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Source: presentation.js</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Source: presentation.js</h1>\n\n    \n\n\n\n    \n    <section>\n        <article>\n            <pre class=\"prettyprint source linenums\"><code>/**\n * An object for managing the blob of text at the top of a problem describing it.\n * This isn't a very busy component.\n *\n * TODO: Isn't most of this redundant now?\n *\n * @constructor\n * @this {BlockPyEditor}\n * @param {Object} main - The main BlockPy instance\n * @param {HTMLElement} tag - The HTML object this is attached to.\n */\nfunction BlockPyPresentation(main, tag) {\n    this.main = main;\n    this.tag = tag;\n    \n    var presentationEditor = this;\n    //this.main.model.settings.instructor.subscribe(function() {presentationEditor.setVisible()});\n}\n\n/**\n * Removes the editor when it's not in use.\n * DEPRECATED\n */\nBlockPyPresentation.prototype.closeEditor = function() {\n    this.tag.destroy();\n};\n\n/**\n * Updates the contents of the presentation blob, possibly updating the\n * editor's size too.\n *\n * @param {String} content - The new text of the presentation blob.\n */\nBlockPyPresentation.prototype.setBody = function(content) {\n    this.main.model.assignment.introduction(content);\n    this.main.components.editor.blockly.resize();\n};\n\n/**\n * Makes the editor available or not.\n * DEPRECATED.\n */\nBlockPyPresentation.prototype.setVisible = function() {\n    if (this.main.model.settings.instructor()) {\n        this.startEditor();\n    } else {\n        this.closeEditor();\n    }\n}\n\n/**\n * Creates the Summer Note editor for the presentation blob.\n * DEPRECATED.\n */\nBlockPyPresentation.prototype.startEditor = function() {\n    var presentationEditor = this;\n    this.tag.summernote({\n        codemirror: { // codemirror options\n            theme: 'monokai'\n        },\n        onChange: function(content) {presentationEditor.setBody(content)},\n        toolbar: [\n            ['style', ['bold', 'italic', 'underline', 'clear']],\n            ['font', ['fontname', 'fontsize']],\n            ['insert', ['link', 'table', 'ul', 'ol']],\n            ['misc', ['codeview', 'help']]\n        ]\n    });\n    this.tag.code(this.main.model.assignment.introduction());\n    //this.name.tag();\n};</code></pre>\n        </article>\n    </section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>\n"
  },
  {
    "path": "docs/printer.js.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Source: printer.js</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Source: printer.js</h1>\n\n    \n\n\n\n    \n    <section>\n        <article>\n            <pre class=\"prettyprint source linenums\"><code>/**\n * An object for managing the console where printing and plotting is outputed.\n *\n * @constructor\n * @this {BlockPyEditor}\n * @param {Object} main - The main BlockPy instance\n * @param {HTMLElement} tag - The HTML object this is attached to.\n */\nfunction BlockPyPrinter(main, tag) {\n    this.main = main;\n    this.tag = tag;\n    \n    /** Keep printer settings available for interested parties */\n    this.printerSettings = {};\n    \n    this.resetPrinter();\n};\n\n/**\n * Reset the status of the printer, including removing any text in it and\n * fixing its size.\n */\nBlockPyPrinter.prototype.resetPrinter = function() {\n    this.tag.empty();\n    this.main.model.execution.output.removeAll();\n    this.printerSettings['width'] = Math.min(500, this.tag.width()-40);\n    this.printerSettings['height'] = Math.min(500, this.tag.height()+40);\n    Sk.TurtleGraphics = {'target': this.tag[0], \n                         'width': this.printerSettings['width'], \n                         'height': this.printerSettings['height']};\n}\n\n/**\n * Update and return the current configuration of the printer. This \n * involves calculating its size, among other operations.\n *\n * @returns {Object} Returns an object with information about the printer.\n */\nBlockPyPrinter.prototype.getConfiguration = function() {\n    var printer = this;\n    this.printerSettings['printHtml']= function(html, value) { printer.printHtml(html, value);};\n    this.printerSettings['width']= Math.min(500, this.tag.width()-40);\n    this.printerSettings['pngMode']= true;\n    this.printerSettings['skipDrawing']= false;\n    this.printerSettings['height']= Math.min(500, this.tag.height()+40);\n    this.printerSettings['container']= this.tag[0];\n    return this.printerSettings;\n}\n\n/**\n * Updates each printed element in the printer and makes it hidden\n * or visible, depending on what step we're on.\n *\n * @param {Number} step - The current step of the executed program that we're on; each element in the printer must be marked with a \"data-step\" property to resolve this.\n * @param {Number} page - Deprecated, not sure what this even does.\n */\nBlockPyPrinter.prototype.stepPrinter = function(step, page) {\n    $(this.printer).find('.blockpy-printer-output').each(function() {\n        if ($(this).attr(\"data-step\") &lt;= step) {\n            $(this).show();\n        } else {\n            $(this).hide();\n        }\n    });\n}\n\n/**\n * Print a successful line to the on-screen printer.\n * @param {String} lineText - A line of text to be printed out.\n */\nBlockPyPrinter.prototype.print = function(lineText) {\n    // Should probably be accessing the model instead of a component...\n    var stepNumber = this.main.components.engine.executionBuffer.step;\n    var lineNumber = this.main.components.engine.executionBuffer.line_number;\n    // Perform any necessary cleaning\n    if (lineText !== \"\\n\") {\n        var encodedText = encodeHTML(lineText);\n        this.main.model.execution.output.push(encodedText.trim());\n        if (!(this.main.model.settings.mute_printer())) {\n            var lineContainer = $(\"&lt;div class='blockpy-printer-output' >\");\n            var lineData = $(\"&lt;samp>&lt;/samp>\", {\n                'data-toggle': 'tooltip',\n                'data-placement': 'left',\n                'data-step': stepNumber,\n                \"html\": encodedText,\n                'title': \"Step \"+stepNumber + \", Line \"+lineNumber,\n            })\n            lineContainer.append(lineData);\n            // Append to the current text\n            this.tag.append(lineContainer);\n            lineData.tooltip();\n        }\n    }\n}\n\n/**\n * Prints a successful HTML blob to the printer. This is typically charts,\n * but it can actually be any kind of HTML. This will probably be useful for\n * doing Turtle and Processing stuff down the road.\n * \n * @param {HTML} html - A blob of HTML to render in the tag\n * @param {Anything} value - a value to push on the outputList for comparison. For instance, on charts this is typically the data of the chart.\n */\nBlockPyPrinter.prototype.printHtml = function(chart, value) {\n    var step = this.main.model.execution.step();\n    var line = this.main.model.execution.line_number();\n    this.main.model.execution.output.push(value);\n    if (!(this.main.model.settings.mute_printer())) {\n        var outerDiv = $(Sk.console.png_mode ? chart : chart[0]);//.parent();\n        outerDiv.parent().show();\n        outerDiv.attr({\n            \"data-toggle\": 'tooltip',\n            \"data-placement\": 'left',\n            //\"data-container\": '#'+chart.attr(\"id\"),\n            \"class\": \"blockpy-printer-output\",\n            \"data-step\": step,\n            \"title\": \"Step \"+step+\", Line \"+line\n        });\n        outerDiv.tooltip();\n    }\n}</code></pre>\n        </article>\n    </section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>\n"
  },
  {
    "path": "docs/python_errors.js.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Source: python_errors.js</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Source: python_errors.js</h1>\n\n    \n\n\n\n    \n    <section>\n        <article>\n            <pre class=\"prettyprint source linenums\"><code>/**\n * A dictionary of improved explanations for Python errors. These are shown to users\n * alongside the regular errors to hopefully increase clarity.\n */\nEXTENDED_ERROR_EXPLANATION = {\n\t'ParseError': \"A parse error means that Python does not understand the syntax on the line the error message points out.  Common examples are forgetting commas beteween arguments or forgetting a : (colon) on a for statement.      &lt;br>&lt;b>Suggestion: &lt;/b>To fix a parse error you just need to look carefully at the line with the error and possibly the line before it.  Make sure it conforms to all of Python's rules.\",\n\t'TypeError': \"Type errors most often occur when an expression tries to combine two objects with types that should not be combined.  Like using \\\"+\\\" to add a number to a list instead of \\\".append\\\", or dividing a string by a number.  &lt;br>&lt;b>Suggestion: &lt;/b>To fix a type error you will most likely need to trace through your code and make sure the variables have the types you expect them to have.\",\n\t'SyntaxError': \"This message indicates that Python can't figure out the syntax of a particular statement.  Some examples are assigning to a literal, or a function call.      &lt;br>&lt;b>Suggestion: &lt;/b>Check your assignment statements and make sure that the left hand side of the assignment is a variable, not a literal (e.g., 7 or \\\"hello\\\") or a function.\",\n\t'NameError': \"A name error almost always means that you have used a variable before it has a value.  Often this may be a simple typo, so check the spelling carefully.  &lt;br>&lt;b>Suggestion: &lt;/b>Check the right hand side of assignment statements and your function calls, this is the most likely place for a NameError to be found. It really helps to step through your code, one line at a time, mentally keeping track of your variables.\",\n\t'ValueError': \"A ValueError most often occurs when you pass a parameter to a built-in function, and the function is expecting one type and you pass something  different. For instance, if you try to convert a non-numeric string to an int, you will get a ValueError:&lt;br>&lt;pre>  int(\\\"Corgi\\\") # ValueError: invalid literal for int() with base 10&lt;/pre> &lt;br>&lt;b>Suggestion: &lt;/b>The error message gives you a pretty good hint about the name of the function as well as the value that is incorrect.  Look at the error message closely and then trace back to the variable containing the problematic value. }\",\n\t'AttributeError': \"This happens when you try to do &lt;code>SOMETHING.WHATEVER&lt;/code> and either SOMETHING wasn't declared or WHATEVER isn't an attribute of SOMETHING. This error message is telling you that the object on the left hand side of the dot, does not have the attribute or method on the right hand side.      &lt;br>&lt;b>Suggestion: &lt;/b>You were probably trying to either get access to some data (weather.get) or append (a_list.append). If it's the first one, you should make sure the module is imported and that you are called its function correctly. If it's the second one, you should make sure you spelled \\\"append\\\" right and that you are using a variable with a list for a value.\",\n\t'TokenError': \"Most of the time this error indicates that you have forgotten a right parenthesis or have forgotten to close a pair of quotes.  &lt;br>&lt;b>Suggestion: &lt;/b>Check each line of your program and make sure that your parenthesis are balanced.\",\n\t'IndexError': \"This message means that you are trying to index past the end of a string or a list.  For example, if your list has 3 things in it and you try to access the item at position 5.  &lt;br>&lt;b>Suggestion: &lt;/b>Remember that the first item in a list or string is at index position 0, quite often this message comes about because you are off by one.  Remember in a list of length 3 the last legal index is 2.&lt;br>&lt;pre>favorite_colors = [\\\"red\\\", \\\"blue\\\", \\\"green\\\"]\\nfavorite_colors[2] # prints green favorite_color[3] # raises an IndexError&lt;/pre>\",\n\t'ImportError': \"This error message indicates that you are trying to import a module that does not exist, or is not in the same directory as your python script.  &lt;br>&lt;b>Suggestion: &lt;/b>One problem may simply be that you have a typo - remember, you must not capitalize the module name. Another common problem is that you have placed the module in a different directory. Finally, if you're using a dataset module, then it might not be imported. Use the \\\"Import Datasets\\\" button below!\",\n\t'ReferenceError': \"This is a really hard error to get, so I'm not entirely sure what you did.  &lt;br>&lt;b>Suggestion: &lt;/b>Bring this code to the instructor. \",\n\t'ZeroDivisionError': \"This tells you that you are trying to divide by 0. Typically this is because the value of the variable in the denominator of a division expression has the value 0.  &lt;br>&lt;b>Suggestion: &lt;/b>Are you sure you are dividing by the right variable? Are you sure that that variable has the value you expect - is it possible that you counted the number of elements in an empty list, for instance?\",\n\t'IndentationError': \"This error occurs when you have not indented your code properly.  This is most likely to happen as part of an if, for, while or def statement.  &lt;br>&lt;b>Suggestion: &lt;/b>Check your if, def, for, and while statements to be sure the lines are properly indented beneath them (seriously, this happens ALL the time).  Another source of this error comes from copying and pasting code where you have accidentally left some bits of code lying around that don't belong there anymore. Finally, a very sinister but unlikely possibility is that you have some tab characters in your code, which look identical to four spaces. Never, ever use tabs, and carefully check code from the internet to make sure it doesn't have tabs.\",\n\t'EOFError': \"If you are using input() or raw_input() commands, then this error happens when they don't get the right ending.  &lt;br>&lt;b>Suggestion: &lt;/b>It's hard to protect against users. However, if you're using input(), you might be able to use raw_input() instead to avoid this problem. \",\n\t'IOError': \"This is a very easy error to get. The most common reason is that you were trying to open a file and it wasn't in the right place.   &lt;br>&lt;b>Suggestion: &lt;/b>Make sure that the file is in the right place - print out the file path, and then check that it's definitely on your computer at that location. If you need help doing file processing, you should probably check with an instructor.\",\n\t'KeyError': \"A dictionary has a bunch of keys that you can use to get data. This error is caused by you trying to refer to a key that does not exist.  &lt;br>&lt;b>Suggestion: &lt;/b>The most common reason you get this exception is that you have a typo in your dictionary access. Check your spelling. Also double check that the key definitely exists.\",\n\t'MemoryError': \"Somehow, you have run out of memory. &lt;br>&lt;b>Suggestion: &lt;/b>Make sure you are filtering your dataset! Alternatively, bring your code to an instructor.\",\n\t'OSError': \"It's hard to say what an OSError is without deep checking. Many things can cause it.  &lt;br>&lt;b>Suggestion: &lt;/b>Bring your code to an instructor.      \",\n    'TimeLimitError': \"A TimeLimit error means that BlockPy wasn't able to process your program fast enough. Typically, this means that you're iterating through too many elements.\"\n}</code></pre>\n        </article>\n    </section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>\n"
  },
  {
    "path": "docs/python_to_blockly.js.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Source: python_to_blockly.js</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Source: python_to_blockly.js</h1>\n\n    \n\n\n\n    \n    <section>\n        <article>\n            <pre class=\"prettyprint source linenums\"><code>/**\n * An object for converting Python source code to the\n * Blockly XML representation.\n * \n * @constructor\n * @this {PythonToBlocks}\n */\nfunction PythonToBlocks() {\n}\n\nfunction xmlToString(xml) {\n    return new XMLSerializer().serializeToString(xml);\n}\n\nPythonToBlocks.prototype.convertSourceToCodeBlock = function(python_source) {\n    var xml = document.createElement(\"xml\");\n    xml.appendChild(raw_block(python_source));\n    return xmlToString(xml);\n}\n\n/**\n * The main function for converting a string representation of Python\n * code to the Blockly XML representation.\n *\n * @param {string} python_source - The string representation of Python\n *      code (e.g., \"a = 0\").\n * @returns {Object} An object which will either have the converted\n *      source code or an error message and the code as a code-block.\n */\nPythonToBlocks.prototype.convertSource = function(python_source) {\n    var xml = document.createElement(\"xml\");\n    if (python_source.trim() === \"\") {\n        return {\"xml\": xmlToString(xml), \"error\": null};\n    }\n    this.source = python_source.split(\"\\n\");\n    var filename = 'user_code.py';\n    // Attempt parsing - might fail!\n    var parse, ast, symbol_table, error;\n    try {\n        parse = Sk.parse(filename, python_source);\n        ast = Sk.astFromParse(parse.cst, filename, parse.flags);\n        //symbol_table = Sk.symboltable(ast, filename, python_source, filename, parse.flags);\n    } catch (e) {\n        error = e;\n        xml.appendChild(raw_block(python_source))\n        return {\"xml\": xmlToString(xml), \"error\": error};\n    }\n    this.comments = {};\n    for (var commentLocation in parse.comments) {\n        var lineColumn = commentLocation.split(\",\");\n        var yLocation = parseInt(lineColumn[0], 10);\n        this.comments[yLocation] = parse.comments[commentLocation];\n    }\n    this.highestLineSeen = 0;\n    this.levelIndex = 0;\n    this.nextExpectedLine = 0;\n    this.measureNode(ast);\n    var converted = this.convert(ast);\n    if (converted !== null) {\n        for (var block = 0; block &lt; converted.length; block+= 1) {\n            xml.appendChild(converted[block]);\n        }\n    }\n    return {\"xml\": xmlToString(xml), \"error\": null, \"lineMap\": this.lineMap, 'comment': this.comments};\n}\n\nPythonToBlocks.prototype.identifier = function(node) {\n    return Sk.ffi.remapToJs(node);\n}\n\nPythonToBlocks.prototype.recursiveMeasure = function(node, nextBlockLine) {\n    if (node === undefined)  {\n        return;\n    }\n    var myNext = nextBlockLine;\n    if (\"orelse\" in node &amp;&amp; node.orelse.length > 0) {\n        if (node.orelse.length == 1 &amp;&amp; node.orelse[0]._astname == \"If\") {\n            myNext = node.orelse[0].lineno-1;\n        } else {\n            myNext = node.orelse[0].lineno-1-1;\n        }\n    }\n    this.heights.push(nextBlockLine);\n    if (\"body\" in node) {\n        for (var i = 0; i &lt; node.body.length; i++) {\n            var next;\n            if (i+1 == node.body.length) {\n                next = myNext;\n            } else {\n                next = node.body[i+1].lineno-1;\n            }\n            this.recursiveMeasure(node.body[i], next);\n        }\n    }\n    if (\"orelse\" in node) {\n        for (var i = 0; i &lt; node.orelse.length; i++) {\n            var next;\n            if (i == node.orelse.length) {\n                next = nextBlockLine;\n            } else {\n                next = 1+(node.orelse[i].lineno-1);\n            }\n            this.recursiveMeasure(node.orelse[i], next);\n        }\n    }\n}\n\nPythonToBlocks.prototype.measureNode = function(node) {\n    this.heights = [];\n    this.recursiveMeasure(node, this.source.length-1);\n    this.heights.shift();\n}\n\nPythonToBlocks.prototype.getSourceCode = function(frm, to) {\n    var lines = this.source.slice(frm-1, to);\n    // Strip out any starting indentation.\n    if (lines.length > 0) {\n        var indentation = lines[0].search(/\\S/);\n        for (var i = 0; i &lt; lines.length; i++) {\n            lines[i] = lines[i].substring(indentation);\n        }\n    }\n    return lines.join(\"\\n\");\n}\n\nPythonToBlocks.prototype.convertBody = function(node, is_top_level) {\n    this.levelIndex += 1;\n    // Empty body, return nothing\n    if (node.length == 0) {\n        return null;\n    }\n    \n    // Final result list\n    var children = [], // The complete set of peers\n        root = null, // The top of the current peer\n        current = null,\n        levelIndex = this.levelIndex; // The bottom of the current peer\n        \n    function addPeer(peer) {\n        if (root == null) {\n            children.push(peer);\n        } else {\n            children.push(root);\n        }\n        root = peer;\n        current = peer;\n    }\n    \n    function finalizePeers() {\n        if (root != null) {\n            children.push(root);\n        }\n    }\n    \n    function nestChild(child) {\n        if (root == null) {\n            root = child;\n            current = child;\n        } else if (current == null) {\n            root = current;\n        } else {\n            var nextElement = document.createElement(\"next\");\n            nextElement.appendChild(child);\n            current.appendChild(nextElement);\n            current = child;\n        }\n    }\n    \n    var lineNumberInBody = 0,\n        lineNumberInProgram,\n        previousLineInProgram=null,\n        distance,\n        skipped_line,\n        commentCount,\n        previousHeight = null,\n        visitedFirstLine = false;\n        \n    // Iterate through each node\n    for (var i = 0; i &lt; node.length; i++) {\n        lineNumberInBody += 1;\n        \n        lineNumberInProgram = node[i].lineno;\n        distance = 0, wasFirstLine = true;\n        if (previousLineInProgram != null) {\n            distance = lineNumberInProgram - previousLineInProgram-1;\n            wasFirstLine = false;\n        }\n        lineNumberInBody += distance;\n        \n        // Handle earlier comments\n        commentCount = 0;\n        for (var commentLineInProgram in this.comments) {\n            if (commentLineInProgram &lt; lineNumberInProgram) {\n                commentChild = this.Comment(this.comments[commentLineInProgram], commentLineInProgram);\n                if (previousLineInProgram == null) {\n                    nestChild(commentChild);\n                } else {\n                    skipped_previous_line = Math.abs(previousLineInProgram-commentLineInProgram) > 1;\n                    if (is_top_level &amp;&amp; skipped_previous_line) {\n                        addPeer(commentChild);\n                    } else {\n                        nestChild(commentChild);\n                    }\n                }\n                previousLineInProgram = commentLineInProgram;\n                this.highestLineSeen = Math.max(this.highestLineSeen, parseInt(commentLineInProgram, 10));\n                distance = lineNumberInProgram - previousLineInProgram;\n                delete this.comments[commentLineInProgram];\n                commentCount += 1;\n            }\n        }\n        \n        distance = lineNumberInProgram - this.highestLineSeen;\n        this.highestLineSeen = Math.max(lineNumberInProgram, this.highestLineSeen);\n        \n        // Now convert the actual node\n        var height = this.heights.shift();\n        var originalSourceCode = this.getSourceCode(lineNumberInProgram, height);\n        var newChild = this.convertStatement(node[i], originalSourceCode, is_top_level);\n        \n        // Skip null blocks (e.g., imports)\n        if (newChild == null) {\n            continue;\n        }\n        \n        skipped_line = distance > 1;\n        previousLineInProgram = lineNumberInProgram;\n        previousHeight = height;\n        \n        // Handle top-level expression blocks\n        if (is_top_level &amp;&amp; newChild.constructor == Array) {\n            addPeer(newChild[0]);\n        // Handle skipped line\n        } else if (is_top_level &amp;&amp; skipped_line &amp;&amp; visitedFirstLine) {\n            addPeer(newChild);\n        // Otherwise, always embed it in there.\n        } else {\n            nestChild(newChild);\n        }\n        \n        visitedFirstLine = true;\n    }\n    \n    \n    // Handle comments that are on the very last line\n    var lastLineNumber = lineNumberInProgram+1\n    if (lastLineNumber in this.comments) {\n        commentChild = this.Comment(this.comments[lastLineNumber], lastLineNumber);\n        nestChild(commentChild);\n        delete this.comments[lastLineNumber];\n    }\n    \n    // Handle any extra comments that stuck around\n    if (is_top_level) {\n        for (var commentLineInProgram in this.comments) {\n            commentChild = this.Comment(this.comments[commentLineInProgram], commentLineInProgram);\n            distance = commentLineInProgram - previousLineInProgram;\n            if (previousLineInProgram == null) {\n                addPeer(commentChild);\n            } else if (distance > 1) {\n                addPeer(commentChild);\n            } else {\n                nestChild(commentChild);\n            }\n            previousLineInProgram = commentLineInProgram;\n            delete this.comments[lastLineNumber];\n        }\n    }\n    \n    \n    finalizePeers();\n    \n    this.levelIndex -= 1;\n    \n    return children;\n}\n\n\n\n\n\nfunction block(type, lineNumber, fields, values, settings, mutations, statements) {\n    var newBlock = document.createElement(\"block\");\n    // Settings\n    newBlock.setAttribute(\"type\", type);\n    newBlock.setAttribute(\"line_number\", lineNumber);\n    for (var setting in settings) {\n        var settingValue = settings[setting];\n        newBlock.setAttribute(setting, settingValue);\n    }\n    // Mutations\n    if (mutations !== undefined &amp;&amp; Object.keys(mutations).length > 0) {\n        var newMutation = document.createElement(\"mutation\");\n        for (var mutation in mutations) {\n            var mutationValue = mutations[mutation];\n            if (mutation.charAt(0) == '@') {\n                newMutation.setAttribute(mutation.substr(1), mutationValue);\n            } else if (mutationValue.constructor === Array) {\n                for (var i = 0; i &lt; mutationValue.length; i++) {\n                    var mutationNode = document.createElement(mutation);\n                    mutationNode.setAttribute(\"name\", mutationValue[i]);\n                    newMutation.appendChild(mutationNode);\n                }\n            } else {\n                var mutationNode = document.createElement(\"arg\");\n                mutationNode.setAttribute(\"name\", mutation);\n                mutationNode.appendChild(mutationValue);\n                newMutation.appendChild(mutationNode);\n            }\n        }\n        newBlock.appendChild(newMutation);\n    }\n    // Fields\n    for (var field in fields) {\n        var fieldValue = fields[field];\n        var newField = document.createElement(\"field\");\n        newField.setAttribute(\"name\", field);\n        newField.appendChild(document.createTextNode(fieldValue));\n        newBlock.appendChild(newField);\n    }\n    // Values\n    for (var value in values) {\n        var valueValue = values[value];\n        var newValue = document.createElement(\"value\");\n        if (valueValue !== null) {\n            newValue.setAttribute(\"name\", value);\n            newValue.appendChild(valueValue);\n            newBlock.appendChild(newValue);\n        }\n    }\n    // Statements\n    if (statements !== undefined &amp;&amp; Object.keys(statements).length > 0) {\n        for (var statement in statements) {\n            var statementValue = statements[statement];\n            if (statementValue == null) {\n                continue;\n            } else {\n                for (var i = 0; i &lt; statementValue.length; i += 1) {\n                    // In most cases, you really shouldn't ever have more than\n                    //  one statement in this list. I'm not sure Blockly likes\n                    //  that.\n                    var newStatement = document.createElement(\"statement\");\n                    newStatement.setAttribute(\"name\", statement);\n                    newStatement.appendChild(statementValue[i]);\n                    newBlock.appendChild(newStatement);\n                }\n            }\n        }\n    }\n    return newBlock;\n}\n\nraw_block = function(txt) {\n    // TODO: lineno as second parameter!\n    return block(\"raw_block\", 0, { \"TEXT\": txt });\n}\n\nraw_expression = function(txt, lineno) {\n    return block(\"raw_expression\", lineno, {\"TEXT\": txt});\n}\n\nPythonToBlocks.prototype.convert = function(node, is_top_level) {\n    return this[node._astname](node, is_top_level);\n}\n\nfunction arrayMax(array) {\n  return array.reduce(function(a, b) {\n    return Math.max(a, b);\n  });\n}\n\nfunction arrayMin(array) {\n  return array.reduce(function(a, b) {\n    return Math.min(a, b);\n  });\n}\n\nPythonToBlocks.prototype.convertStatement = function(node, full_source, is_top_level) {\n    try {\n        return this.convert(node, is_top_level);\n    } catch (e) {\n        heights = this.getChunkHeights(node);\n        extractedSource = this.getSourceCode(arrayMin(heights), arrayMax(heights));\n        console.error(e);\n        return raw_block(extractedSource);\n    }\n}\n\nPythonToBlocks.prototype.getChunkHeights = function(node) {\n    var lineNumbers = [];\n    if (node.hasOwnProperty(\"lineno\")) {\n        lineNumbers.push(node.lineno);\n    }\n    if (node.hasOwnProperty(\"body\")) {\n        for (var i = 0; i &lt; node.body.length; i += 1) {\n            var subnode = node.body[i];\n            lineNumbers = lineNumbers.concat(this.getChunkHeights(subnode));\n        }\n    }\n    if (node.hasOwnProperty(\"orelse\")) {\n        for (var i = 0; i &lt; node.orelse.length; i += 1) {\n            var subnode = node.orelse[i];\n            lineNumbers = lineNumbers.concat(this.getChunkHeights(subnode));\n        }\n    }\n    return lineNumbers;\n}\n\n/* ----- Nodes ---- */\n/*\n * NO LINE OR COLUMN NUMBERS\n * Module\n * body: asdl_seq\n */\nPythonToBlocks.prototype.Module = function(node)\n{\n    return this.convertBody(node.body, true);\n}\n\nPythonToBlocks.prototype.Comment = function(txt, lineno) {\n    return block(\"comment_single\", lineno, {\n        \"BODY\": txt.slice(1)\n    }, {}, {}, {}, {})\n}\n\n/*\n * NO LINE OR COLUMN NUMBERS\n * Interactive\n * body: asdl_seq\n */\nPythonToBlocks.prototype.Interactive = function(body)\n{\n    return this.convertBody(node.body);\n}\n\n/*\n * NO LINE OR COLUMN NUMBERS\n * TODO\n * body: expr_ty\n */\nPythonToBlocks.prototype.Expression = function(body)\n{\n    this.body = body;\n}\n\n/*\n * NO LINE OR COLUMN NUMBERS\n *\n * body: asdl_seq\n */\nPythonToBlocks.prototype.Suite = function(body)\n{\n    this.asdl_seq(node.body);\n}\n\n/*\n *\n * name: identifier\n * args: arguments__ty\n * body: asdl_seq\n * decorator_list: asdl_seq\n */\nPythonToBlocks.prototype.FunctionDef = function(node)\n{\n    var name = node.name;\n    var args = node.args;\n    var body = node.body;\n    var decorator_list = node.decorator_list;\n    if (decorator_list.length > 0) {\n        throw new Error(\"Decorators are not implemented.\");\n    }\n    return block(\"procedures_defnoreturn\", node.lineno, {\n        \"NAME\": this.identifier(name)\n    }, {\n    }, {\n        \"inline\": \"false\"\n    }, {\n        \"arg\": this.arguments_(args)\n    }, {\n        \"STACK\": this.convertBody(body)\n    });\n}\n\n/*\n * name: identifier\n * args: arguments__ty\n * bases: asdl_seq\n * body: asdl_seq\n * decorator_list: asdl_seq\n */\nPythonToBlocks.prototype.ClassDef = function(node)\n{\n    var name = node.name;\n    var bases = node.bases;\n    var body = node.body;\n    var decorator_list = node.decorator_list;\n    if (decorator_list.length > 0) {\n        throw new Error(\"Decorators are not implemented.\");\n    }\n    return block(\"class_creation\", node.lineno, {\n        \"CLASS\": this.identifier(name)\n    }, {\n    }, {\n        \"inline\": \"false\"\n    }, {\n        //\"arg\": this.arguments_(args)\n    }, {\n        \"BODY\": this.convertBody(body)\n    });\n}\n\n/*\n * value: expr_ty\n *\n */\nPythonToBlocks.prototype.Return = function(node)\n{\n    var value = node.value;\n    // No field, one title, one setting\n    return block(\"procedures_return\", node.lineno, {}, {\n        \"VALUE\": this.convert(value)\n    }, {\n        \"inline\": \"false\"\n    });\n}\n\n/*\n * targets: asdl_seq\n *\n */\nPythonToBlocks.prototype.Delete = function(/* {asdl_seq *} */ targets)\n{\n    this.targets = targets;\n    // TODO\n    throw new Error(\"Delete is not implemented\");\n}\n\n/*\n * targets: asdl_seq\n * value: expr_ty\n */\nPythonToBlocks.prototype.Assign = function(node)\n{\n    var targets = node.targets;\n    var value = node.value;\n    if (targets.length == 0) {\n        throw new Error(\"Nothing to assign to!\");\n    } else if (targets.length == 1) {\n        return block(\"variables_set\", node.lineno, {\n            \"VAR\": this.Name_str(targets[0]) //targets\n        }, {\n            \"VALUE\": this.convert(value)\n        });\n    } else {\n        //TODO\n        throw new Error(\"Multiple Assigment Targets Not implemented\");\n    }\n}\n\n/*\n * target: expr_ty\n * op: operator_ty\n * value: expr_ty\n */\nPythonToBlocks.prototype.AugAssign = function(node)\n{\n    var target = node.target;\n    var op = node.op;\n    var value = node.value;\n    if (op.name != \"Add\") {\n        //TODO\n        throw new Error(\"Only addition is currently supported for augmented assignment!\");\n    } else {\n        return block(\"math_change\", node.lineno, {\n            \"VAR\": this.Name_str(target)\n        }, {\n            \"DELTA\": this.convert(value)\n        });\n    }\n}\n\n/*\n * dest: expr_ty\n * values: asdl_seq\n * nl: bool\n *\n */\nPythonToBlocks.prototype.Print = function(node)\n{\n    var dest = node.dest;\n    var values = node.values;\n    var nl = node.nl;\n    \n    if (values.length == 1) {\n        return block(\"text_print\", node.lineno, {}, {\n            \"TEXT\": this.convert(values[0])\n        });\n    } else {\n        return block(\"text_print_multiple\", node.lineno, {}, \n            this.convertElements(\"PRINT\", values), \n        {\n            \"inline\": \"true\"\n        }, {\n            \"@items\": values.length\n        });\n    }\n}\n\n/*\n * target: expr_ty\n * iter: expr_ty\n * body: asdl_seq\n * orelse: asdl_seq\n *\n */\nPythonToBlocks.prototype.For = function(node) {\n    var target = node.target;\n    var iter = node.iter;\n    var body = node.body;\n    var orelse = node.orelse;\n    \n    if (orelse.length > 0) {\n        // TODO\n        throw new Error(\"Or-else block of For is not implemented.\");\n    }\n    \n    return block(\"controls_forEach\", node.lineno, {\n    }, {\n        \"LIST\": this.convert(iter),\n        \"VAR\": this.convert(target)\n    }, {\n        \"inline\": \"true\"\n    }, {}, {\n        \"DO\": this.convertBody(body)\n    });\n}\n\n/*\n * test: expr_ty\n * body: asdl_seq\n * orelse: asdl_seq\n */\nPythonToBlocks.prototype.While = function(node) {\n    var test = node.test;\n    var body = node.body;\n    var orelse = node.orelse;\n    if (orelse.length > 0) {\n        // TODO\n        throw new Error(\"Or-else block of While is not implemented.\");\n    }\n    return block(\"controls_while\", node.lineno, {}, {\n        \"BOOL\": this.convert(test)\n    }, {}, {}, {\n        \"DO\": this.convertBody(body)\n    });\n}\n\n/*\n * test: expr_ty\n * body: asdl_seq\n * orelse: asdl_seq\n *\n */\nPythonToBlocks.prototype.If = function(node)\n{\n    var test = node.test;\n    var body = node.body;\n    var orelse = node.orelse;\n    \n    var IF_values = {\"IF0\": this.convert(test)};\n    var DO_values = {\"DO0\": this.convertBody(body)};\n    \n    var elseifCount = 0;\n    var elseCount = 0;\n    var potentialElseBody = null;\n    \n    // Handle weird orelse stuff\n    if (orelse !== undefined) {\n        if (orelse.length == 1 &amp;&amp; orelse[0]._astname == \"If\") {\n            // This is an 'ELIF'\n            while (orelse.length == 1  &amp;&amp; orelse[0]._astname == \"If\") {\n                this.heights.shift();\n                elseifCount += 1;\n                body = orelse[0].body;\n                test = orelse[0].test;\n                orelse = orelse[0].orelse;\n                DO_values[\"DO\"+elseifCount] = this.convertBody(body, false);\n                if (test !== undefined) {\n                    IF_values[\"IF\"+elseifCount] = this.convert(test);\n                }\n            }\n        }\n        if (orelse !== undefined &amp;&amp; orelse.length > 0) {\n            // Or just the body of an Else statement\n            elseCount += 1;\n            DO_values[\"ELSE\"] = this.convertBody(orelse);\n        }\n    }\n    \n    return block(\"controls_if\", node.lineno, {\n    }, IF_values, {\n        \"inline\": \"false\"\n    }, {\n        \"@elseif\": elseifCount,\n        \"@else\": elseCount\n    }, DO_values);\n}\n\n/*\n * context_expr: expr_ty\n * optional_vars: expr_ty\n * body: asdl_seq\n */\nPythonToBlocks.prototype.With = function(node)\n{\n    var context_expr = node.context_expr;\n    var optional_vars = node.optional_vars;\n    var body = node.body;\n    throw new Error(\"With_ not implemented\");\n}\n\n/*\n * type: expr_ty\n * inst: expr_ty\n * tback: expr_ty\n */\nPythonToBlocks.prototype.Raise = function(node)\n{\n    var type = node.type;\n    var inst = node.inst;\n    var tback = node.tback;\n    throw new Error(\"Raise not implemented\");\n}\n\n/*\n * body: asdl_seq\n * handlers: asdl_seq\n * orelse: asdl_seq\n *\n */\nPythonToBlocks.prototype.TryExcept = function(node)\n{\n    var body = node.body;\n    var handlers = node.handlers;\n    var orelse = node.orelse;\n    throw new Error(\"TryExcept not implemented\");\n}\n\n/*\n * body: asdl_seq\n * finalbody: asdl_seq\n *\n */\nPythonToBlocks.prototype.TryFinally = function(node)\n{\n    var body = node.body;\n    var finalbody = node.finalbody;\n    throw new Error(\"TryExcept not implemented\");\n}\n\n/*\n * test: expr_ty\n * msg: expr_ty\n */\nPythonToBlocks.prototype.Assert = function(node)\n{\n    var test = node.test;\n    var msg = node.msg;\n    throw new Error(\"Assert not implemented\");\n}\n\n/*\n * names: asdl_seq\n *\n */\nPythonToBlocks.prototype.Import = function(node)\n{\n    var names = node.names;\n    // The import statement isn't used in blockly because it happens implicitly\n    return null;\n}\n\n/*\n * module: identifier\n * names: asdl_seq\n * level: int\n *\n */\nPythonToBlocks.prototype.ImportFrom = function(node)\n{\n    var module = node.module;\n    var names = node.names;\n    var level = node.level;\n    // The import statement isn't used in blockly because it happens implicitly\n    return null;\n}\n\n/*\n * body: expr_ty\n * globals: expr_ty\n * locals: expr_ty\n *\n */\nPythonToBlocks.prototype.Exec = function(node) {\n    var body = node.body;\n    var globals = node.globals;\n    var locals = node.locals;\n    throw new Error(\"Exec not implemented\");\n}\n\n/*\n * names: asdl_seq\n *\n */\nPythonToBlocks.prototype.Global = function(node)\n{\n    var names = node.names;\n    throw new Error(\"Globals not implemented\");\n}\n\n/*\n * value: expr_ty\n *\n */\nPythonToBlocks.prototype.Expr = function(node, is_top_level) {\n    var value = node.value;\n    \n    var converted = this.convert(value);\n    if (converted.constructor == Array) {\n        return converted[0];\n    } else if (is_top_level === true) {\n        return [this.convert(value)];\n    } else {\n        return block(\"raw_empty\", node.lineno, {}, {\n            \"VALUE\": this.convert(value)\n        });\n    }\n}\n\n/*\n *\n *\n */\nPythonToBlocks.prototype.Pass = function() {\n    return null; //block(\"controls_pass\");\n}\n\n/*\n *\n *\n */\nPythonToBlocks.prototype.Break = function(node) {\n    return block(\"controls_flow_statements\", node.lineno, {\n        \"FLOW\": \"BREAK\"\n    });\n}\n\n/*\n *\n *\n */\nPythonToBlocks.prototype.Continue = function(node) {\n    return block(\"controls_flow_statements\", node.lineno, {\n        \"FLOW\": \"CONTINUE\"\n    });\n}\n\n/*\n * TODO: what does this do?\n *\n */\nPythonToBlocks.prototype.Debugger = function() {\n    return null;\n}\n\nPythonToBlocks.prototype.booleanOperator = function(op) {\n    switch (op.name) {\n        case \"And\": return \"AND\";\n        case \"Or\": return \"OR\";\n        default: throw new Error(\"Operator not supported:\"+op.name);\n    }\n}\n\n/*\n * op: boolop_ty\n * values: asdl_seq\n */\nPythonToBlocks.prototype.BoolOp = function(node) {\n    var op = node.op;\n    var values = node.values;\n    // TODO: is there ever a case where it's &lt; 1 values?\n    var result_block = this.convert(values[0]);\n    for (var i = 1; i &lt; values.length; i+= 1) {\n        result_block = block(\"logic_operation\", node.lineno, {\n            \"OP\": this.booleanOperator(op)\n        }, {\n            \"A\": result_block,\n            \"B\": this.convert(values[i])\n        }, {\n            \"inline\": \"true\"\n        });\n    }\n    return result_block;\n}\n\nPythonToBlocks.prototype.binaryOperator = function(op) {\n    switch (op.name) {\n        case \"Add\": return \"ADD\";\n        case \"Sub\": return \"MINUS\";\n        case \"Div\": case \"FloorDiv\": return \"DIVIDE\";\n        case \"Mult\": return \"MULTIPLY\";\n        case \"Pow\": return \"POWER\";\n        case \"Mod\": return \"MODULO\";\n        default: throw new Error(\"Operator not supported:\"+op.name);\n    }\n}\n\n/*\n * left: expr_ty\n * op: operator_ty\n * right: expr_ty\n */\nPythonToBlocks.prototype.BinOp = function(node)\n{\n    var left = node.left;\n    var op = node.op;\n    var right = node.right;\n    return block(\"math_arithmetic\", node.lineno, {\n        \"OP\": this.binaryOperator(op) // TODO\n    }, {\n        \"A\": this.convert(left),\n        \"B\": this.convert(right)\n    }, {\n        \"inline\": true\n    });\n}\n\n/*\n * op: unaryop_ty\n * operand: expr_ty\n */\nPythonToBlocks.prototype.UnaryOp = function(node)\n{\n    var op = node.op;\n    var operand = node.operand;\n    if (op.name == \"Not\") {\n        return block(\"logic_negate\", node.lineno, {}, {\n            \"BOOL\": this.convert(operand) \n        }, {\n            \"inline\": \"false\"\n        });\n    } else {\n        throw new Error(\"Other unary operators are not implemented yet.\");\n    }\n}\n\n/*\n * args: arguments__ty\n * body: expr_ty\n */\nPythonToBlocks.prototype.Lambda = function(node) {\n    var args = node.args;\n    var body = node.body;\n    throw new Error(\"Lambda functions are not implemented yet.\");\n}\n\n/*\n * test: expr_ty\n * body: expr_ty\n * orelse: expr_ty\n */\nPythonToBlocks.prototype.IfExp = function(node)\n{\n    var test = node.test;\n    var body = node.body;\n    var orelse = node.orelse;\n    throw new Error(\"Inline IF expressions are not implemented yet.\");\n}\n\n/*\n * keys: asdl_seq\n * values: asdl_seq\n */\nPythonToBlocks.prototype.Dict = function(node) {\n    var keys = node.keys;\n    var values = node.values;\n    \n    var keyList = [];\n    var valueList = [];\n    for (var i = 0; i &lt; keys.length; i+= 1) {\n        if (keys[i]._astname != \"Str\") {\n            throw new Error(\"Dictionary Keys should be Strings.\");\n        }\n        keyList[\"KEY\"+i] = this.Str_value(keys[i]);\n        valueList[\"VALUE\"+i] = this.convert(values[i]);\n    }\n    \n    return block(\"dicts_create_with\", node.lineno, keyList, valueList, {\n        \"inline\": \"false\"\n    }, {\n        \"@items\": keys.length\n    });\n}\n\n/*\n * elts: asdl_seq\n *\n */\nPythonToBlocks.prototype.Set = function(node)\n{\n    var elts = node.elts;\n    throw new Error(\"Sets are not implemented\");\n}\n\n/*\n * elt: expr_ty\n * generators: asdl_seq\n */\nPythonToBlocks.prototype.ListComp = function(node)\n{\n    var elt = node.elt;\n    var generators = node.generators;\n    \n    // TODO\n}\n\n/*\n * elt: expr_ty\n * generators: asdl_seq\n */\nPythonToBlocks.prototype.SetComp = function(node)\n{\n    var elt = node.elt;\n    var generators = node.generators;\n    throw new Error(\"Set Comprehensions are not implemented\"); \n}\n\n/*\n * key: expr_ty\n * value: expr_ty\n * generators: asdl_seq\n */\nPythonToBlocks.prototype.DictComp = function(node)\n{\n    var key = node.key;\n    var value = node.value;\n    var generators = node.generators;\n    throw new Error(\"Dictionary Comprehensions are not implemented\"); \n}\n\n/*\n * elt: expr_ty\n * generators: asdl_seq\n */\nPythonToBlocks.prototype.GeneratorExp = function(node) {\n    var elt = node.elt;\n    var generators = node.generators;\n    throw new Error(\"Generator Expresions are not implemented\"); \n}\n\n/*\n * value: expr_ty\n *\n */\nPythonToBlocks.prototype.Yield = function(node)\n{\n    var value = value;\n    throw new Error(\"Yield expression is not implemented\");\n}\n\n\nPythonToBlocks.prototype.compareOperator = function(op) {\n    switch (op.name) {\n        case \"Eq\": return \"EQ\";\n        case \"NotEq\": return \"NEQ\";\n        case \"Lt\": return \"LT\";\n        case \"Gt\": return \"GT\";\n        case \"LtE\": return \"LTE\";\n        case \"GtE\": return \"GTE\";\n        case \"In_\": return \"IN\";\n        case \"NotIn\": return \"NOTIN\";\n        // Is, IsNot, In, NotIn\n        default: throw new Error(\"Operator not supported:\"+op.name);\n    }\n}\n\n/*\n * left: expr_ty\n * ops: asdl_int_seq\n * asdl_seq: comparators\n */\nPythonToBlocks.prototype.Compare = function(node)\n{\n    var left = node.left;\n    var ops = node.ops;\n    var comparators = node.comparators;\n    \n    if (ops.length != 1) {\n        throw new Error(\"Only one comparison operator is supported\");\n    } else if (ops[0].name == \"In_\" || ops[0].name == \"NotIn\") {\n        return block(\"logic_isIn\", node.lineno, {\n            \"OP\": this.compareOperator(ops[0])\n        }, {\n            \"ITEM\": this.convert(left),\n            \"LIST\": this.convert(comparators[0])\n        }, {\n            \"inline\": \"true\"\n        });\n    } else {\n        return block(\"logic_compare\", node.lineno, {\n            \"OP\": this.compareOperator(ops[0])\n        }, {\n            \"A\": this.convert(left),\n            \"B\": this.convert(comparators[0])\n        }, {\n            \"inline\": \"true\"\n        });\n    }\n    \n}\n\nconvertStockSymbols = function(symbol) {\n    switch (symbol) {\n        case 'FB': case \"Facebook\":\n            return \"Facebook\";\n        case \"AAPL\": case \"Apple\":\n            return \"Apple\";\n        case \"MSFT\": case \"Microsoft\":\n            return \"Microsoft\";\n        case \"GOOG\": case \"Google\":\n            return \"Google\";\n        default:\n            throw new Error(\"Unknown Stock Symbol.\");\n    }\n}\n\ntoTitleCase = function(str) {\n    return str.replace(/\\w\\S*/g, function(txt){\n        return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n    });\n}\n            \nPythonToBlocks.KNOWN_MODULES = {\n    \"weather\": {\n        \"get_temperature\": [\"weather_temperature\", \"CITY\"],\n        \"get_report\": [\"weather_report\", \"CITY\"],\n        \"get_forecasts\": [\"weather_forecasts\", \"CITY\"],\n        \"get_highs_lows\": [\"weather_highs_lows\", \"CITY\"],\n        \"get_all_forecasted_temperatures\": [\"weather_all_forecasts\"],\n        \"get_forecasted_reports\": [\"weather_report_forecasts\", \"CITY\"]\n    }, \n    \"earthquakes\": {\n        \"get\": [\"earthquake_get\", \"PROPERTY\"],\n        \"get_both\": [\"earthquake_both\"],\n        \"get_all\": [\"earthquake_all\"]\n    },\n    \"stocks\": {\n        \"get_current\": [\"stocks_current\", [\"TICKER\", convertStockSymbols]],\n        \"get_past\": [\"stocks_past\", [\"TICKER\", convertStockSymbols]]\n    },\n    \"crime\": {\n        // STATE = toTitleCase\n        \"get_property_crimes\": [\"crime_state\", [\"STATE\", toTitleCase],\n                                              [\"TYPE\", \"property\"]],\n        \"get_violent_crimes\": [\"crime_state\",  [\"STATE\", toTitleCase],\n                                              [\"TYPE\", \"violent\"]],\n        \"get_by_year\": [\"crime_year\", \"YEAR\"],\n        \"get_all\": [\"crime_all\"]\n    },\n    \"books\": {\n        \"get_all\": [\"books_get\"]\n    },\n    \"plt\": {\n        \"title\": [\"*plot_title\", \"TEXT\"],\n        \"xlabel\": [\"*plot_xlabel\", \"TEXT\"],\n        \"ylabel\": [\"*plot_ylabel\", \"TEXT\"],\n        \"hist\": [\"*plot_hist\", {\"type\": \"variable\", \"mode\": \"value\", \"name\": \"values\"}],\n        \"scatter\": [\"*plot_scatter\", {\"type\": \"variable\", \"mode\": \"value\", \"name\": \"x_values\"},\n                                      {\"type\": \"variable\", \"mode\": \"value\", \"name\": \"y_values\"}],\n        \"show\": [\"*plot_show\"]\n    }\n};\nPythonToBlocks.prototype.KNOWN_FUNCTIONS = [\"append\", \"strip\", \"rstrip\", \"lstrip\"];\nPythonToBlocks.KNOWN_ATTR_FUNCTIONS = {};\nPythonToBlocks.prototype.CallAttribute = function(func, args, keywords, starargs, kwargs, node) {\n    var name = this.identifier(func.attr);\n    if (func.value._astname == \"Name\") {\n        var module = this.identifier(func.value.id);\n        if (module == \"plt\" &amp;&amp; name == \"plot\") {\n            if (args.length == 1) {\n                return [block(\"plot_line\", func.lineno, {}, {\n                    \"y_values\": this.convert(args[0])\n                }, {\"inline\": \"false\"})];\n            } else if (args.length == 2) {\n                return [block(\"plot_lineXY\", func.lineno, {}, {\n                    \"x_values\": this.convert(args[0]),\n                    \"y_values\": this.convert(args[1])\n                }, {\"inline\": \"false\"})];\n            } else {\n                throw new Error(\"Incorrect number of arguments to plt.plot\");\n            }\n        } else if (module in PythonToBlocks.KNOWN_MODULES &amp;&amp; name in PythonToBlocks.KNOWN_MODULES[module]) {\n            var definition = PythonToBlocks.KNOWN_MODULES[module][name];\n            var blockName = definition[0];\n            var isExpression = true;\n            if (blockName.charAt(0) == \"*\") {\n                blockName = blockName.slice(1);\n                isExpression = false;\n            }\n            var fields = {};\n            var mutations = {};\n            var values = {};\n            for (var i = 0; i &lt; args.length; i++) {\n                var argument = definition[1+i];\n                var destination = fields;\n                if (typeof argument ==  \"string\") {\n                    fields[argument] = this.Str_value(args[i]);\n                } else if (typeof argument == \"object\") {\n                    if (argument.mode == \"value\") {\n                        destination = values;\n                    }\n                    if (argument.add_mutation !== undefined) {\n                        mutations[argument.add_mutation.name] = argument.add_mutation.value;\n                    }\n                    if (argument.type == 'mutation') {\n                        if (argument.index == undefined) {\n                            mutations[argument.name] = this.Str_value(args[i]);\n                        } else {\n                            mutations[argument.name] = this.Str_value(args[argument.index+1]);\n                        }\n                    } else if (argument.type == \"integer\") {\n                        destination[argument.name] = this.Num_value(args[i]);\n                    } else if (argument.type == 'variable') {\n                        destination[argument.name] = this.convert(args[i]);\n                    } else if (argument.type == \"integer_mapper\") {\n                        // Okay we jumped the shark here\n                        var argumentName = argument.name;\n                        var argumentMapper = argument.method;\n                        destination[argumentName] = argumentMapper(this.Num_value(args[i]));\n                    } else if (argument.type == 'mapper') {\n                        var argumentName = argument.name;\n                        var argumentMapper = argument.method;\n                        destination[argumentName] = argumentMapper(this.Str_value(args[i]));\n                    }\n                } else {\n                    var argumentName = argument[0];\n                    var argumentMapper = argument[1];\n                    fields[argumentName] = argumentMapper(this.Str_value(args[i]));\n                }\n            }\n            for (var i = 1+args.length; i &lt; definition.length; i++) {\n                var first = definition[i][0];\n                var second = definition[i][1];\n                fields[first] = second;\n            }\n            if (isExpression) {\n                var k = block(blockName, func.lineno, fields, values, [], mutations);\n                return k;\n            } else {\n                return [block(blockName, func.lineno, fields, values, [], mutations)];\n            }\n        }\n    } \n    if (this.KNOWN_FUNCTIONS.indexOf(name) > -1) {\n        switch (name) {\n            case \"append\":\n                if (args.length !== 1) {\n                    throw new Error(\"Incorrect number of arguments to .append\");\n                }\n                // Return as statement\n                return [block(\"lists_append\", func.lineno, {}, {\n                    \"ITEM\": this.convert(args[0]),\n                    \"LIST\": this.convert(func.value)\n                }, {\n                    \"inline\": \"true\"\n                })];\n            case \"strip\":\n                return block(\"text_trim\", func.lineno, { \"MODE\": \"BOTH\" }, \n                    { \"TEXT\": this.convert(func.value) });\n            case \"lstrip\":\n                return block(\"text_trim\", func.lineno, { \"MODE\": \"LEFT\" }, \n                    { \"TEXT\": this.convert(func.value) });\n            case \"rstrip\":\n                return block(\"text_trim\", func.lineno, { \"MODE\": \"RIGHT\" }, \n                    { \"TEXT\": this.convert(func.value) });\n            default: throw new Error(\"Unknown function call!\");\n        }\n    } else if (name in PythonToBlocks.KNOWN_ATTR_FUNCTIONS) {\n        return PythonToBlocks.KNOWN_ATTR_FUNCTIONS[name].bind(this)(func, args, keywords, starargs, kwargs, node)\n    } else {\n        console.log(func, args, keywords, starargs, kwargs);\n        heights = this.getChunkHeights(node);\n        extractedSource = this.getSourceCode(arrayMin(heights), arrayMax(heights));\n        var col_endoffset = node.col_endoffset;\n        if (args.length > 0) {\n            for (var i = 0; i &lt; args.length; i+= 1) {\n                col_endoffset = args[i].col_endoffset;\n            }\n        } else {\n            col_endoffset += 2;\n            expressionCall += \"()\";\n        }\n        var expressionCall = extractedSource.slice(node.col_offset, 1+col_endoffset);\n        //console.log(node, extractedSource, node.col_offset, node.col_endoffset);\n        var lineno = node.lineno;\n        //console.error(e);\n        //return raw_expression(expressionCall, lineno);\n        \n        var argumentsNormal = {};\n        var argumentsMutation = {\"@name\": name};\n        for (var i = 0; i &lt; args.length; i+= 1) {\n            argumentsNormal[\"ARG\"+i] = this.convert(args[i]);\n            argumentsMutation[i] = this.convert(args[i]);\n        }\n        var methodCall = block(\"procedures_callreturn\", node.lineno, {\n        }, argumentsNormal, {\n            \"inline\": \"false\"\n        }, argumentsMutation);\n        \n        return block(\"attribute_access\", node.lineno, {}, {\n            \"MODULE\": this.convert(func.value),\n            \"NAME\": methodCall\n        }, { \"inline\": \"true\"}, {});\n    }\n}\n\n/*\n * func: expr_ty\n * args: asdl_seq\n * keywords: asdl_seq\n * starargs: expr_ty\n * kwargs: expr_ty\n *\n */\nPythonToBlocks.prototype.Call = function(node) {\n    var func = node.func;\n    var args = node.args;\n    var keywords = node.keywords;\n    var starargs = node.starargs;\n    var kwargs = node.kwargs;\n    \n    switch (func._astname) {\n        case \"Name\":\n            switch (this.identifier(func.id)) {\n                case \"print\":\n                    if (args.length == 1) {\n                        return [block(\"text_print\", node.lineno, {}, {\n                            \"TEXT\": this.convert(args[0])})];\n                    } else {\n                        return [block(\"text_print_multiple\", node.lineno, {}, \n                            this.convertElements(\"PRINT\", args), \n                            {\"inline\": \"true\"\n                            }, { \"@items\": args.length})];\n                    }\n                case \"abs\":\n                    return block(\"math_single\", node.lineno, {\"OP\": \"ABS\"}, {\"NUM\": this.convert(args[0])})\n                case \"round\":\n                    return block(\"math_round\", node.lineno, {\"OP\": \"ROUND\"}, {\"NUM\": this.convert(args[0])})\n                case \"sum\":\n                    return block(\"math_on_list\", node.lineno, {\"OP\": \"SUM\"}, {\"LIST\": this.convert(args[0])})\n                case \"min\":\n                    return block(\"math_on_list\", node.lineno, {\"OP\": \"MIN\"}, {\"LIST\": this.convert(args[0])})\n                case \"max\":\n                    return block(\"math_on_list\", node.lineno, {\"OP\": \"MAX\"}, {\"LIST\": this.convert(args[0])})\n                case \"len\":\n                    return block(\"lists_length\", node.lineno, {}, {\"VALUE\": this.convert(args[0])})\n                case \"xrange\":\n                    return block(\"procedures_callreturn\", node.lineno, {}, \n                        {\"ARG0\": this.convert(args[0])},\n                        {\"inline\": \"true\"}, \n                        {\"@name\": \"xrange\",\n                         \"\": this.convert(args[0])})\n                default:\n                    if (starargs !== null &amp;&amp; starargs.length > 0) {\n                        throw new Error(\"*args (variable arguments) are not implemented yet.\");\n                    } else if (kwargs !== null &amp;&amp; kwargs.length > 0) {\n                        throw new Error(\"**args (keyword arguments) are not implemented yet.\");\n                    }\n                    var argumentsNormal = {};\n                    var argumentsMutation = {\"@name\": this.identifier(func.id)};\n                    for (var i = 0; i &lt; args.length; i+= 1) {\n                        argumentsNormal[\"ARG\"+i] = this.convert(args[i]);\n                        argumentsMutation[i] = this.convert(args[i]);\n                    }\n                    return block(\"procedures_callreturn\", node.lineno, {}, argumentsNormal, {\n                        \"inline\": \"false\"\n                    }, argumentsMutation);\n            }\n        // Direct function call\n        case \"Attribute\":\n        // Module function call\n            return this.CallAttribute(func, args, keywords, starargs, kwargs, node);\n    }\n}\n\n/*\n * value: expr_ty\n *\n */\nPythonToBlocks.prototype.Repr = function(node)\n{\n    var value = node.value;\n    throw new Error(\"Repr is not yet implemented\");\n}\n\n/*\n * n: object\n *\n */\nPythonToBlocks.prototype.Num = function(node)\n{\n    var n = node.n;\n    return block(\"math_number\", node.lineno, {\"NUM\": Sk.ffi.remapToJs(n)});\n}\n\nPythonToBlocks.prototype.Num_value = function(node)\n{\n    var n = node.n;\n    return Sk.ffi.remapToJs(n);\n}\n\n/*\n * s: string\n *\n */\nPythonToBlocks.prototype.Str = function(node)\n{\n    var s = node.s;\n    var strValue = Sk.ffi.remapToJs(s);\n    if (strValue.split(\"\\n\").length > 1) {\n        return block(\"string_multiline\", node.lineno, {\"TEXT\": strValue});\n    } else {\n        return block(\"text\", node.lineno, {\"TEXT\": strValue});\n    }\n}\n\nPythonToBlocks.prototype.Str_value = function(node) {\n    var s = node.s;\n    return Sk.ffi.remapToJs(s);\n}\n\n/*\n * value: expr_ty\n * attr: identifier\n * ctx: expr_context_ty\n *\n */\nPythonToBlocks.prototype.Attribute = function(node)\n{\n    var value = node.value;\n    var attr = node.attr;\n    var ctx = node.ctx;\n    \n    console.log(node);\n    \n    return block(\"attribute_access\", node.lineno, {\n        \"MODULE\": this.convert(value),\n        \"NAME\": this.convert(attr)\n    });\n    \n    //throw new Error(\"Attribute access not implemented\");\n}\n\n/*\n * value: expr_ty\n * slice: slice_ty\n * ctx: expr_context_ty\n *\n */\nPythonToBlocks.prototype.Subscript = function(node)\n{\n    var value = node.value;\n    var slice = node.slice;\n    var ctx = node.ctx;\n    \n    if (slice.value._astname == \"Str\") {\n        return block(\"dict_get_literal\", node.lineno, {\n            \"ITEM\": this.Str_value(slice.value)\n        }, {\n            \"DICT\": this.convert(value)\n        });\n    } else if (slice.value._astname == \"Num\") {\n        return block(\"lists_index\", node.lineno, {}, {\n            \"ITEM\": this.convert(slice.value),\n            \"LIST\": this.convert(value),\n        });\n    }\n    \n    throw new Error(\"This kind of subscript is not supported.\");\n}\n\n/*\n * id: identifier\n * ctx: expr_context_ty\n */\nPythonToBlocks.prototype.Name = function(node)\n{\n    var id = node.id;\n    var ctx = node.ctx;\n    switch (this.Name_str(node)) {\n        case \"True\":\n            return block(\"logic_boolean\", node.lineno, {\"BOOL\": \"TRUE\"});\n        case \"False\":\n            return block(\"logic_boolean\", node.lineno, {\"BOOL\": \"FALSE\"});\n        case \"None\":\n            return block(\"logic_null\", node.lineno);\n        case \"___\":\n            return null;\n        default:\n            return block('variables_get', node.lineno, {\n                \"VAR\": this.identifier(id)\n            });\n    }\n}\n\n/*\n * id: identifier\n * ctx: expr_context_ty\n */\nPythonToBlocks.prototype.Name_str = function(node)\n{\n    var id = node.id;\n    var ctx = node.ctx;\n    return this.identifier(id);\n}\n\nPythonToBlocks.prototype.convertElements = function(key, values) {\n    var output = {};\n    for (var i = 0; i &lt; values.length; i++) {\n        output[key+i] = this.convert(values[i]);\n    }\n    return output;\n}\n\n/*\n * elts: asdl_seq\n * ctx: expr_context_ty\n *\n */\nPythonToBlocks.prototype.List = function(node) {\n    var elts = node.elts;\n    var ctx = node.ctx;\n    \n    return block(\"lists_create_with\", node.lineno, {}, \n        this.convertElements(\"ADD\", elts)\n    , {\n        \"inline\": elts.length > 3 ? \"false\" : \"true\", \n    }, {\n        \"@items\": elts.length\n    });\n}\n\n/*\n * elts: asdl_seq\n * ctx: expr_context_ty\n */\nPythonToBlocks.prototype.Tuple = function(node)\n{\n    var elts = node.elts;\n    var ctx = node.ctx;\n    \n    throw new Error(\"Tuples not implemented\");\n}\n\n/*\n *\n *\n */\nPythonToBlocks.prototype.Ellipsis = function() {\n    throw new Error(\"Ellipsis not implemented\");\n}\n\n/*\n * lower: expr_ty\n * upper: expr_ty\n * step: expr_ty\n *\n */\nPythonToBlocks.prototype.Slice = function(node)\n{\n    var lower = node.lower;\n    var upper = node.upper;\n    var step = node.step;\n    \n    throw new Error(\"Slices not implemented\");\n}\n\n/*\n * dims: asdl_seq\n *\n */\nPythonToBlocks.prototype.ExtSlice = function(node)\n{\n    var dims = node.dims;\n    \n    throw new Error(\"ExtSlice is not implemented.\");\n}\n\n/*\n * value: expr_ty\n *\n */\nPythonToBlocks.prototype.Index = function(value)\n{\n    var value = node.value;\n    \n    throw new Error(\"Index is not implemented\");\n}\n\n/*\n * target: expr_ty\n * iter: expr_ty\n * ifs: asdl_seq\n *\n */\nPythonToBlocks.prototype.comprehension = function(node)\n{\n    var target = node.target;\n    var iter = node.iter;\n    var ifs = node.ifs;\n    \n    throw new Error(\"Comprehensions not implemented.\");\n}\n\n/*\n * type: expr_ty\n * name: expr_ty\n * body: asdl_seq\n *\n */\nPythonToBlocks.prototype.ExceptHandler = function(node)\n{\n    var type = node.type;\n    var name = node.name;\n    var body = node.boy;\n    \n    throw new Error(\"Except handlers are not implemented\");\n}\n\nPythonToBlocks.prototype.argument_ = function(node) {\n    var id = node.id;\n    return this.identifier(id);\n}\n\n/*\n * args: asdl_seq\n * vararg: identifier\n * kwarg: identifier\n * defaults: asdl_seq\n *\n */\nPythonToBlocks.prototype.arguments_ = function(node)\n{\n    var args = node.args;\n    var vararg = node.vararg;\n    var kwarg = node.kwarg;\n    var defaults = node.defaults;\n    \n    var allArgs = [];\n    for (var i = 0; i &lt; args.length; i++) {\n        var arg = args[i];\n        allArgs.push(this.argument_(arg));\n    }\n    return allArgs;\n}\n\n/*\n * arg: identifier\n * value: expr_ty\n *\n */\nPythonToBlocks.prototype.keyword = function(node)\n{\n    var arg = node.arg;\n    var value = node.value;\n    \n    throw new Error(\"Keywords are not implemented\");\n}\n\n/*\n * name: identifier\n * asname: identifier\n *\n */\nPythonToBlocks.prototype.alias = function(node)\n{\n    var name = node.name;\n    var asname = node.asname;\n    \n    throw new Error(\"Aliases are not implemented\");\n}\n\n\n/* ----- expr_context ----- */\n/*\nLoad\nStore\nDel\nAugLoad\nAugStore\nParam\n*/\n\n\n/* ----- operator ----- */\n/*\nAdd\nSub\nMult\nDiv\nMod\nPow\nLShift\nRShift\nBitOr\nBitXor\nBitAnd\nFloorDiv\n*/\n\n/* ----- unaryop ----- */\n/*\nInvert\nNot\nUAdd\nUSub\n*/</code></pre>\n        </article>\n    </section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>\n"
  },
  {
    "path": "docs/scripts/linenumber.js",
    "content": "/*global document */\n(function() {\n    var source = document.getElementsByClassName('prettyprint source linenums');\n    var i = 0;\n    var lineNumber = 0;\n    var lineId;\n    var lines;\n    var totalLines;\n    var anchorHash;\n\n    if (source && source[0]) {\n        anchorHash = document.location.hash.substring(1);\n        lines = source[0].getElementsByTagName('li');\n        totalLines = lines.length;\n\n        for (; i < totalLines; i++) {\n            lineNumber++;\n            lineId = 'line' + lineNumber;\n            lines[i].id = lineId;\n            if (lineId === anchorHash) {\n                lines[i].className += ' selected';\n            }\n        }\n    }\n})();\n"
  },
  {
    "path": "docs/scripts/prettify/Apache-License-2.0.txt",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "docs/scripts/prettify/lang-css.js",
    "content": "PR.registerLangHandler(PR.createSimpleLexer([[\"pln\",/^[\\t\\n\\f\\r ]+/,null,\" \\t\\r\\n\f\"]],[[\"str\",/^\"(?:[^\\n\\f\\r\"\\\\]|\\\\(?:\\r\\n?|\\n|\\f)|\\\\[\\S\\s])*\"/,null],[\"str\",/^'(?:[^\\n\\f\\r'\\\\]|\\\\(?:\\r\\n?|\\n|\\f)|\\\\[\\S\\s])*'/,null],[\"lang-css-str\",/^url\\(([^\"')]*)\\)/i],[\"kwd\",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\\w-]|$)/i,null],[\"lang-css-kw\",/^(-?(?:[_a-z]|\\\\[\\da-f]+ ?)(?:[\\w-]|\\\\\\\\[\\da-f]+ ?)*)\\s*:/i],[\"com\",/^\\/\\*[^*]*\\*+(?:[^*/][^*]*\\*+)*\\//],[\"com\",\n/^(?:<\\!--|--\\>)/],[\"lit\",/^(?:\\d+|\\d*\\.\\d+)(?:%|[a-z]+)?/i],[\"lit\",/^#[\\da-f]{3,6}/i],[\"pln\",/^-?(?:[_a-z]|\\\\[\\da-f]+ ?)(?:[\\w-]|\\\\\\\\[\\da-f]+ ?)*/i],[\"pun\",/^[^\\s\\w\"']+/]]),[\"css\"]);PR.registerLangHandler(PR.createSimpleLexer([],[[\"kwd\",/^-?(?:[_a-z]|\\\\[\\da-f]+ ?)(?:[\\w-]|\\\\\\\\[\\da-f]+ ?)*/i]]),[\"css-kw\"]);PR.registerLangHandler(PR.createSimpleLexer([],[[\"str\",/^[^\"')]+/]]),[\"css-str\"]);\n"
  },
  {
    "path": "docs/scripts/prettify/prettify.js",
    "content": "var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;\n(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:\"0\"<=b&&b<=\"7\"?parseInt(a.substring(1),8):b===\"u\"||b===\"x\"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?\"\\\\x0\":\"\\\\x\")+a.toString(16);a=String.fromCharCode(a);if(a===\"\\\\\"||a===\"-\"||a===\"[\"||a===\"]\")a=\"\\\\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\\\u[\\dA-Fa-f]{4}|\\\\x[\\dA-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\S\\s]|[^\\\\]/g),a=\n[],b=[],o=f[0]===\"^\",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&\"-\"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=[\"[\"];o&&b.push(\"^\");b.push.apply(b,a);for(c=0;c<\nf.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push(\"-\"),b.push(e(i[1])));b.push(\"]\");return b.join(\"\")}function y(a){for(var f=a.source.match(/\\[(?:[^\\\\\\]]|\\\\[\\S\\s])*]|\\\\u[\\dA-Fa-f]{4}|\\\\x[\\dA-Fa-f]{2}|\\\\\\d+|\\\\[^\\dux]|\\(\\?[!:=]|[()^]|[^()[\\\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j===\"(\"?++i:\"\\\\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j===\"(\"?(++i,d[i]===void 0&&(f[c]=\"(?:\")):\"\\\\\"===j.charAt(0)&&\n(j=+j.substring(1))&&j<=i&&(f[c]=\"\\\\\"+d[i]);for(i=c=0;c<b;++c)\"^\"===f[c]&&\"^\"!==f[c+1]&&(f[c]=\"\");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a===\"[\"?f[c]=h(j):a!==\"\\\\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return\"[\"+String.fromCharCode(a&-33,a|32)+\"]\"}));return f.join(\"\")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\\\u[\\da-f]{4}|\\\\x[\\da-f]{2}|\\\\[^UXux]/gi,\"\"))){s=!0;l=!1;break}}for(var r=\n{b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(\"\"+g);n.push(\"(?:\"+y(g)+\")\")}return RegExp(n.join(\"|\"),l?\"gi\":\"g\")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if(\"BR\"===g||\"LI\"===g)h[s]=\"\\n\",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\\r\\n?/g,\"\\n\"):g.replace(/[\\t\\n\\r ]+/g,\" \"),h[s]=g,t[s<<1]=y,y+=g.length,\nt[s++<<1|1]=a)}}var e=/(?:^|\\s)nocode(?:\\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue(\"white-space\"));var p=l&&\"pre\"===l.substring(0,3);m(a);return{a:h.join(\"\").replace(/\\n$/,\"\"),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,\"pln\"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b===\n\"string\")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b=\"pln\")}if((c=b.length>=5&&\"lang-\"===b.substring(0,5))&&!(o&&typeof o[1]===\"string\"))c=!1,b=\"src\";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),\nl=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=\"\"+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\\S\\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push([\"str\",/^(?:'''(?:[^'\\\\]|\\\\[\\S\\s]|''?(?=[^']))*(?:'''|$)|\"\"\"(?:[^\"\\\\]|\\\\[\\S\\s]|\"\"?(?=[^\"]))*(?:\"\"\"|$)|'(?:[^'\\\\]|\\\\[\\S\\s])*(?:'|$)|\"(?:[^\"\\\\]|\\\\[\\S\\s])*(?:\"|$))/,q,\"'\\\"\"]):a.multiLineStrings?m.push([\"str\",/^(?:'(?:[^'\\\\]|\\\\[\\S\\s])*(?:'|$)|\"(?:[^\"\\\\]|\\\\[\\S\\s])*(?:\"|$)|`(?:[^\\\\`]|\\\\[\\S\\s])*(?:`|$))/,\nq,\"'\\\"`\"]):m.push([\"str\",/^(?:'(?:[^\\n\\r'\\\\]|\\\\.)*(?:'|$)|\"(?:[^\\n\\r\"\\\\]|\\\\.)*(?:\"|$))/,q,\"\\\"'\"]);a.verbatimStrings&&e.push([\"str\",/^@\"(?:[^\"]|\"\")*(?:\"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push([\"com\",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,\"#\"]):m.push([\"com\",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\\b|[^\\n\\r]*)/,q,\"#\"]),e.push([\"str\",/^<(?:(?:(?:\\.\\.\\/)*|\\/?)(?:[\\w-]+(?:\\/[\\w-]+)+)?[\\w-]+\\.h|[a-z]\\w*)>/,q])):m.push([\"com\",/^#[^\\n\\r]*/,\nq,\"#\"]));a.cStyleComments&&(e.push([\"com\",/^\\/\\/[^\\n\\r]*/,q]),e.push([\"com\",/^\\/\\*[\\S\\s]*?(?:\\*\\/|$)/,q]));a.regexLiterals&&e.push([\"lang-regex\",/^(?:^^\\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|,|-=|->|\\/|\\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\\^=|\\^\\^|\\^\\^=|{|\\||\\|=|\\|\\||\\|\\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*(\\/(?=[^*/])(?:[^/[\\\\]|\\\\[\\S\\s]|\\[(?:[^\\\\\\]]|\\\\[\\S\\s])*(?:]|$))+\\/)/]);(h=a.types)&&e.push([\"typ\",h]);a=(\"\"+a.keywords).replace(/^ | $/g,\n\"\");a.length&&e.push([\"kwd\",RegExp(\"^(?:\"+a.replace(/[\\s,]+/g,\"|\")+\")\\\\b\"),q]);m.push([\"pln\",/^\\s+/,q,\" \\r\\n\\t\\xa0\"]);e.push([\"lit\",/^@[$_a-z][\\w$@]*/i,q],[\"typ\",/^(?:[@_]?[A-Z]+[a-z][\\w$@]*|\\w+_t\\b)/,q],[\"pln\",/^[$_a-z][\\w$@]*/i,q],[\"lit\",/^(?:0x[\\da-f]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+-]?\\d+)?)[a-z]*/i,q,\"0123456789\"],[\"pln\",/^\\\\[\\S\\s]?/,q],[\"pun\",/^.[^\\s\\w\"-$'./@\\\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if(\"BR\"===a.nodeName)h(a),\na.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}\nfor(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\\s)nocode(?:\\s|$)/,t=/\\r\\n?|\\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue(\"white-space\"));var p=l&&\"pre\"===l.substring(0,3);for(l=s.createElement(\"LI\");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute(\"value\",\nm);var r=s.createElement(\"OL\");r.className=\"linenums\";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className=\"L\"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode(\"\\xa0\")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn(\"cannot override language handler %s\",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\\s*</.test(m)?\"default-markup\":\"default-code\";return A[a]}function E(a){var m=\na.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\\bMSIE\\b/.test(navigator.userAgent),m=/\\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,\"\\r\"));i.nodeValue=\nj;var u=i.ownerDocument,v=u.createElement(\"SPAN\");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){\"console\"in window&&console.log(w&&w.stack?w.stack:w)}}var v=[\"break,continue,do,else,for,if,return,while\"],w=[[v,\"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile\"],\n\"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof\"],F=[w,\"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where\"],G=[w,\"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient\"],\nH=[G,\"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var\"],w=[w,\"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN\"],I=[v,\"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None\"],\nJ=[v,\"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END\"],v=[v,\"case,done,elif,esac,eval,fi,function,in,local,set,then,until\"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\\d*)/,N=/\\S/,O=u({keywords:[F,H,w,\"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END\"+\nI,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,[\"default-code\"]);k(x([],[[\"pln\",/^[^<?]+/],[\"dec\",/^<!\\w[^>]*(?:>|$)/],[\"com\",/^<\\!--[\\S\\s]*?(?:--\\>|$)/],[\"lang-\",/^<\\?([\\S\\s]+?)(?:\\?>|$)/],[\"lang-\",/^<%([\\S\\s]+?)(?:%>|$)/],[\"pun\",/^(?:<[%?]|[%?]>)/],[\"lang-\",/^<xmp\\b[^>]*>([\\S\\s]+?)<\\/xmp\\b[^>]*>/i],[\"lang-js\",/^<script\\b[^>]*>([\\S\\s]*?)(<\\/script\\b[^>]*>)/i],[\"lang-css\",/^<style\\b[^>]*>([\\S\\s]*?)(<\\/style\\b[^>]*>)/i],[\"lang-in.tag\",/^(<\\/?[a-z][^<>]*>)/i]]),\n[\"default-markup\",\"htm\",\"html\",\"mxml\",\"xhtml\",\"xml\",\"xsl\"]);k(x([[\"pln\",/^\\s+/,q,\" \\t\\r\\n\"],[\"atv\",/^(?:\"[^\"]*\"?|'[^']*'?)/,q,\"\\\"'\"]],[[\"tag\",/^^<\\/?[a-z](?:[\\w-.:]*\\w)?|\\/?>$/i],[\"atn\",/^(?!style[\\s=]|on)[a-z](?:[\\w:-]*\\w)?/i],[\"lang-uq.val\",/^=\\s*([^\\s\"'>]*(?:[^\\s\"'/>]|\\/(?=\\s)))/],[\"pun\",/^[/<->]+/],[\"lang-js\",/^on\\w+\\s*=\\s*\"([^\"]+)\"/i],[\"lang-js\",/^on\\w+\\s*=\\s*'([^']+)'/i],[\"lang-js\",/^on\\w+\\s*=\\s*([^\\s\"'>]+)/i],[\"lang-css\",/^style\\s*=\\s*\"([^\"]+)\"/i],[\"lang-css\",/^style\\s*=\\s*'([^']+)'/i],[\"lang-css\",\n/^style\\s*=\\s*([^\\s\"'>]+)/i]]),[\"in.tag\"]);k(x([],[[\"atv\",/^[\\S\\s]+/]]),[\"uq.val\"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),[\"c\",\"cc\",\"cpp\",\"cxx\",\"cyc\",\"m\"]);k(u({keywords:\"null,true,false\"}),[\"json\"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),[\"cs\"]);k(u({keywords:G,cStyleComments:!0}),[\"java\"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),[\"bsh\",\"csh\",\"sh\"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),\n[\"cv\",\"py\"]);k(u({keywords:\"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END\",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),[\"perl\",\"pl\",\"pm\"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),[\"rb\"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),[\"js\"]);k(u({keywords:\"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes\",\nhashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),[\"coffee\"]);k(x([],[[\"str\",/^[\\S\\s]+/]]),[\"regex\"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement(\"PRE\");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf(\"prettyprint\")>=0){var k=k.match(g),f,b;if(b=\n!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&\"CODE\"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName===\"pre\"||o.tagName===\"code\"||o.tagName===\"xmp\")&&o.className&&o.className.indexOf(\"prettyprint\")>=0){b=!0;break}b||((b=(b=n.className.match(/\\blinenums\\b(?::(\\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,\n250):a&&a()}for(var e=[document.getElementsByTagName(\"pre\"),document.getElementsByTagName(\"code\"),document.getElementsByTagName(\"xmp\")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\\blang(?:uage)?-([\\w.]+)(?!\\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:\"atn\",PR_ATTRIB_VALUE:\"atv\",PR_COMMENT:\"com\",PR_DECLARATION:\"dec\",PR_KEYWORD:\"kwd\",PR_LITERAL:\"lit\",\nPR_NOCODE:\"nocode\",PR_PLAIN:\"pln\",PR_PUNCTUATION:\"pun\",PR_SOURCE:\"src\",PR_STRING:\"str\",PR_TAG:\"tag\",PR_TYPE:\"typ\"}})();\n"
  },
  {
    "path": "docs/server.js.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Source: server.js</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Source: server.js</h1>\n\n    \n\n\n\n    \n    <section>\n        <article>\n            <pre class=\"prettyprint source linenums\"><code>/**\n * Object for communicating with the external servers. This includes functionality for\n * saving and loading files, logging events, saving completions, and retrieving history.\n *\n * @constructor\n * @this {BlockPyServer}\n * @param {Object} main - The main BlockPy instance\n */\nfunction BlockPyServer(main) {\n    this.main = main;\n    \n    // Add the LocalStorage connection\n    // Presently deprecated, but we should investigate this\n    this.storage = new LocalStorageWrapper(\"BLOCKPY\");\n    \n    this.saveTimer = {};\n    this.presentationTimer = null;\n    \n    // For managing \"walks\" that let us rerun stored code\n    this.inProgressWalks = [];\n    \n    this.createSubscriptions();\n}\n\nBlockPyServer.prototype.createSubscriptions = function() {\n    var server = this, model = this.main.model;\n    model.program.subscribe(function() { server.saveCode(); });\n    model.assignment.name.subscribe(function(e) { server.saveAssignment();});\n    model.assignment.introduction.subscribe(function(e) { server.saveAssignment(); });\n    model.assignment.parsons.subscribe(function(e) { server.saveAssignment(); });\n    model.assignment.importable.subscribe(function(e) { server.saveAssignment(); });\n    model.assignment.disable_algorithm_errors.subscribe(function(e) { server.saveAssignment(); });\n    model.assignment.initial_view.subscribe(function(e) { server.saveAssignment(); });\n    model.settings.editor.subscribe(function(newValue) { server.logEvent('editor', newValue); });\n    model.execution.show_trace.subscribe(function(newValue) { server.logEvent('trace', newValue); });\n    model.execution.trace_step.subscribe(function(newValue) { server.logEvent('trace_step', newValue); });\n};\n\n/**\n *\n * Some subscriptions have to happen after other things have been loaded.\n * Right now this is just after CORGIS libraries have been loaded, but maybe\n * we'll add more later and this will need to be refactored.\n * \n */\nBlockPyServer.prototype.finalizeSubscriptions = function() {\n    var server = this, model = this.main.model;\n    model.assignment.modules.subscribe(function(e) { server.saveAssignment(); });\n};\n\nBlockPyServer.prototype.TIMER_DELAY = 1000;\n\nBlockPyServer.prototype.createServerData = function() {\n    var assignment = this.main.model.assignment;\n    var d = new Date();\n    var seconds = Math.round(d.getTime() / 1000);\n    data = {\n        'assignment_id': assignment.assignment_id,\n        'course_id': assignment.course_id,\n        'student_id': assignment.student_id,\n        'version': assignment.version(),\n        'timestamp': seconds\n    };\n    if (this.main.model.settings.log_id() != null) {\n        data['log_id'] = this.main.model.settings.log_id();\n    }\n    return data;\n}\n\nBlockPyServer.prototype.setStatus = function(status, server_error) {\n    this.main.model.status.server(status);\n    if (server_error !== undefined) {\n        this.main.model.status.server_error(server_error);\n    } else {\n        this.main.model.status.server_error('');\n    }\n}\nBlockPyServer.prototype.defaultResponseWithoutVersioning = function(response) {\n    if (response.success) {\n        this.setStatus('Saved');\n    } else {\n        console.error(response);\n        this.setStatus('Error', response.message);\n    }\n}\nBlockPyServer.prototype.defaultResponse = function(response) {\n    /*console.log(response);\n    if (!response.is_version_correct) {\n        this.setStatus('Out of date');\n    } else */if (response.success) {\n        this.setStatus('Saved');\n    } else {\n        console.error(response);\n        this.setStatus('Error', response.message);\n    }\n}\nBlockPyServer.prototype.defaultFailure = function(error, textStatus) {\n    this.setStatus('Disconnected', \"Could not access server!\\n\"+textStatus);\n}\n\nBlockPyServer.prototype.logEvent = function(event_name, action, body) {\n    var data = this.createServerData();\n    data['event'] = event_name;\n    data['action'] = action;\n    if (body === undefined) {\n        data['body'] = '';\n    } else {\n        data['body'] = body;\n    }\n    \n    this.setStatus('Logging');\n    if (this.main.model.server_is_connected('log_event')) {\n        $.post(this.main.model.constants.urls.log_event, data, \n               this.defaultResponse.bind(this))\n         .fail(this.defaultFailure.bind(this));\n    } else {\n        this.setStatus('Offline', \"Server is not connected!\");\n    }\n}\n\nBlockPyServer.prototype.markSuccess = function(success) {\n    var data = this.createServerData();\n    var server = this,\n        model = this.main.model;\n    data['code'] = model.programs.__main__;\n    data['status'] = success;\n    this.main.components.editor.getPngFromBlocks(function(pngData, img) {\n        data['image'] = pngData;\n        img.remove();\n        server.setStatus('Saving');\n        if (model.server_is_connected('save_success')) {\n            $.post(model.constants.urls.save_success, data, \n                   server.defaultResponse.bind(server))\n             .fail(server.defaultFailure.bind(server));\n        } else {\n            server.setStatus('Offline', \"Server is not connected!\");\n        }\n    });\n};\n\nBlockPyServer.prototype.saveAssignment = function() {\n    var data = this.createServerData();\n    var model = this.main.model;\n    data['introduction'] = model.assignment.introduction();\n    data['parsons'] = model.assignment.parsons();\n    data['initial'] = model.assignment.initial_view();\n    data['importable'] = model.assignment.importable();\n    data['disable_algorithm_errors'] = model.assignment.disable_algorithm_errors();\n    data['name'] = model.assignment.name();\n    //data['disabled'] = disabled;\n    data['modules'] = model.assignment.modules().join(','); // TODO: hackish, broken if ',' is in name\n    \n    var server = this;\n    this.setStatus('Saving');\n    if (this.main.model.server_is_connected('save_assignment') &amp;&amp; \n        this.main.model.settings.auto_upload()) {\n        clearTimeout(this.presentationTimer);\n        this.presentationTimer = setTimeout(function() {\n            $.post(server.main.model.constants.urls.save_assignment, data, \n                   server.defaultResponseWithoutVersioning.bind(server))\n             .fail(server.defaultFailure.bind(server));\n        }, this.TIMER_DELAY);\n    } else {\n        this.setStatus('Offline', \"Server is not connected!\");\n    }\n}\n\nBlockPyServer.prototype.saveCode = function() {\n    var filename = this.main.model.settings.filename();\n    var data = this.createServerData();\n    data['filename'] = filename;\n    data['code'] = this.main.model.programs[filename]();\n    \n    var server = this;\n    this.setStatus('Saving');\n    if (this.main.model.server_is_connected('save_code') &amp;&amp; \n        this.main.model.settings.auto_upload()) {\n        if (this.saveTimer[filename]) {\n            clearTimeout(this.saveTimer[filename]);\n        }\n        this.saveTimer[filename] = setTimeout(function() {\n            $.post(server.main.model.constants.urls.save_code, data, \n                   filename == '__main__'\n                    ? server.defaultResponse.bind(server)\n                    : server.defaultResponseWithoutVersioning.bind(server))\n             .fail(server.defaultFailure.bind(server));\n        }, this.TIMER_DELAY);\n    } else {\n        this.setStatus('Offline', \"Server is not connected!\");\n    }\n}\n\nBlockPyServer.prototype.getHistory = function(callback) {\n    var data = this.createServerData();\n    var model = this.main.model;\n    \n    var server = this;\n    this.setStatus('Loading History');\n    if (model.server_is_connected('get_history')) {\n        $.post(model.constants.urls.get_history, data, \n               function(response) {\n                if (response.success) {\n                    server.setStatus('Saved');\n                    callback(response.data);\n                } else {\n                    console.error(response);\n                    server.setStatus('Error', response.message);\n                }\n               })\n         .fail(server.defaultFailure.bind(server));\n    } else {\n        this.setStatus('Offline', \"Server is not connected!\");\n        callback([]);\n        /*callback([\n            {code: \"=\", time: \"20160801-105102\"},\n            {code: \"= 0\", time: \"20160801-105112\"},\n            {code: \"a = 0\", time: \"20160801-105502\"},\n            {code: \"a = 0\\nprint\", time: \"20160801-110003\"},\n            {code: \"a = 0\\nprint(a)\", time: \"20160801-111102\"}\n        ])*/\n    }\n}\n\nBlockPyServer.prototype.walkOldCode = function() {\n    var server = this,\n        main = this.main;\n    if (this.inProgressWalks.length > 0) {\n        var response = this.inProgressWalks.pop();\n        console.log('Processing walk', response.log_id);\n        main.setCode(response.code, '__main__');\n        main.setCode(response.feedback, 'give_feedback');\n        main.model.assignment.assignment_id = response.assignment_id;\n        main.model.assignment.user_id = response.user_id;\n        main.model.settings.log_id(response.log_id);\n        main.components.engine.onExecutionEnd = function(newState) {\n            console.log(response.log_id, newState);\n            main.components.engine.onExecutionEnd = null;\n            setTimeout(function() {\n                server.walkOldCode()\n            }, 0);\n        };\n        console.log(\"Running\");\n        main.components.engine.run();\n    } else {\n        var data = this.createServerData();\n        this.setStatus('Retrieving');\n        if (main.model.server_is_connected('walk_old_code')) {\n            $.post(server.main.model.constants.urls.walk_old_code, data, \n                   function (response) {\n                       if (response.success) {\n                           if (response.more_to_do) {\n                            server.inProgressWalks = response.walks;\n                            server.walkOldCode();\n                           }\n                       } else {\n                           this.setStatus('Failure', response.message);\n                       }\n                   })\n            .fail(\n            function(response) {\n                console.error(response);\n                setTimeout(function() {\n                    server.walkOldCode()\n                }, 3000);\n            }\n            );\n            //server.defaultFailure.bind(server));\n        } else {\n            this.setStatus('Offline', \"Server is not connected!\");\n        }\n    }\n}\n\n/*\nBlockPyServer.prototype.load = function() {\n    var data = {\n        'question_id': this.model.question.question_id,\n        'student_id': this.model.question.student_id,\n        'context_id': this.model.question.context_id\n    };\n    var alertBox = this.alertBox;\n    var server = this, blockpy = this.blockpy;\n    if (this.model.urls.server !== false &amp;&amp; this.model.urls.load_code !== false) {\n        $.post(this.model.urls.load_code, data, function(response) {\n            if (response.success) {\n                if (server.storage.has(data.question_id)) {\n                    if (server.storage.is_new(data.question_id, response.timestamp)) {\n                        var xml = server.storage.get(data.question_id);\n                        server.model.load(xml);\n                        server.save();\n                    } else {\n                        server.storage.remove(data.question_id);\n                        if (response.code !== null) {\n                            server.model.load(response.code);\n                        }\n                    }\n                } else {\n                    if (response.code !== null) {\n                        server.model.load(response.code);\n                    }\n                }\n                if (response.completed) {\n                    blockpy.feedback.success('');\n                }\n                alertBox(\"Loaded\").delay(200).fadeOut(\"slow\");\n            } else {\n                console.error(\"Server Load Error\", response.message);\n                alertBox(\"Loading failed\");\n            }\n        }).fail(function() {\n            alertBox(\"Loading failed\");\n        }).always(function() {\n            server.model.loaded = true;\n        });\n    } else {\n        server.model.loaded = true;\n        alertBox(\"Loaded\").delay(200).fadeOut(\"slow\");\n        if (this.model.urls.load_success === true) {\n            this.blockpy.feedback.success('');\n        }\n    }\n};\n*/</code></pre>\n        </article>\n    </section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>\n"
  },
  {
    "path": "docs/storage.js.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Source: storage.js</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Source: storage.js</h1>\n\n    \n\n\n\n    \n    <section>\n        <article>\n            <pre class=\"prettyprint source linenums\"><code>/**\n * Helper object for interfacing with the LocalStorage. The LocalStorage\n * browser API allows for offline storage. That API is very unsophisticated,\n * and is essentially a lame key-value store. This object sits on top\n * and provides a number of useful utilities, including rudimentarycache\n * cache expiration.\n *\n * @constructor\n * @this {LocalStorageWrapper}\n * @param {String} namespace - A namespace to use in grouping access to localstorage. This keeps access clean and organized, while also making it possible to have multiple LocalStorage connections.\n */\nfunction LocalStorageWrapper(namespace) {\n    this.namespace = namespace;\n}\n/**\n * A method for adding a key/value pair to LocalStorage.\n * Note that both parameters must be strings (JSON.stringify is your friend).\n *\n * @param {String} key - The name of the key.\n * @param {String} value - The value.\n */\nLocalStorageWrapper.prototype.set =  function(key, value) {\n    localStorage.setItem(namespace+\"_\"+key+\"_value\", value);\n    localStorage.setItem(namespace+\"_\"+key+\"_timestamp\", $.now());\n};\n\n/**\n * A method for removing a key from LocalStorage.\n *\n * @param {String} key - The name of the key to remove.\n */\nLocalStorageWrapper.prototype.remove = function(key) {\n    localStorage.removeItem(namespace+\"_\"+key+\"_value\");\n    localStorage.removeItem(namespace+\"_\"+key+\"_timestamp\");\n};\n\n/**\n * A method for retrieving the value associated with the given key.\n *\n * @param {String} key - The name of the key to retrieve the value for.\n */\nLocalStorageWrapper.prototype.get = function(key) {\n    return localStorage.getItem(namespace+\"_\"+key+\"_value\");\n};\n\n/**\n * A test for whether the given key is in LocalStorage.\n *\n * @param {String} key - The key to test existence for.\n */\nLocalStorageWrapper.prototype.has = function(key) {\n    return localStorage.getItem(namespace+\"_\"+key+\"_value\") !== null;\n};\n\n/**\n * A test for whether the server has the newer version. This function\n * assumes that the server trip takes about 5 seconds. This method\n * is largely deprecated.\n *\n * @param {String} key - The key to check.\n * @param {Integer} server_time - The server's time as an epoch (in milliseconds)\n */\nLocalStorageWrapper.prototype.is_new = function(key, server_time) {\n    var stored_time = localStorage.getItem(namespace+\"_\"+key+\"_timestamp\");\n    return (server_time >= stored_time+5000);\n};</code></pre>\n        </article>\n    </section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>\n"
  },
  {
    "path": "docs/styles/jsdoc-default.css",
    "content": "@font-face {\n    font-family: 'Open Sans';\n    font-weight: normal;\n    font-style: normal;\n    src: url('../fonts/OpenSans-Regular-webfont.eot');\n    src:\n        local('Open Sans'),\n        local('OpenSans'),\n        url('../fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),\n        url('../fonts/OpenSans-Regular-webfont.woff') format('woff'),\n        url('../fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg');\n}\n\n@font-face {\n    font-family: 'Open Sans Light';\n    font-weight: normal;\n    font-style: normal;\n    src: url('../fonts/OpenSans-Light-webfont.eot');\n    src:\n        local('Open Sans Light'),\n        local('OpenSans Light'),\n        url('../fonts/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'),\n        url('../fonts/OpenSans-Light-webfont.woff') format('woff'),\n        url('../fonts/OpenSans-Light-webfont.svg#open_sanslight') format('svg');\n}\n\nhtml\n{\n    overflow: auto;\n    background-color: #fff;\n    font-size: 14px;\n}\n\nbody\n{\n    font-family: 'Open Sans', sans-serif;\n    line-height: 1.5;\n    color: #4d4e53;\n    background-color: white;\n}\n\na, a:visited, a:active {\n    color: #0095dd;\n    text-decoration: none;\n}\n\na:hover {\n    text-decoration: underline;\n}\n\nheader\n{\n    display: block;\n    padding: 0px 4px;\n}\n\ntt, code, kbd, samp {\n    font-family: Consolas, Monaco, 'Andale Mono', monospace;\n}\n\n.class-description {\n    font-size: 130%;\n    line-height: 140%;\n    margin-bottom: 1em;\n    margin-top: 1em;\n}\n\n.class-description:empty {\n    margin: 0;\n}\n\n#main {\n    float: left;\n    width: 70%;\n}\n\narticle dl {\n    margin-bottom: 40px;\n}\n\nsection\n{\n    display: block;\n    background-color: #fff;\n    padding: 12px 24px;\n    border-bottom: 1px solid #ccc;\n    margin-right: 30px;\n}\n\n.variation {\n    display: none;\n}\n\n.signature-attributes {\n    font-size: 60%;\n    color: #aaa;\n    font-style: italic;\n    font-weight: lighter;\n}\n\nnav\n{\n    display: block;\n    float: right;\n    margin-top: 28px;\n    width: 30%;\n    box-sizing: border-box;\n    border-left: 1px solid #ccc;\n    padding-left: 16px;\n}\n\nnav ul {\n    font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif;\n    font-size: 100%;\n    line-height: 17px;\n    padding: 0;\n    margin: 0;\n    list-style-type: none;\n}\n\nnav ul a, nav ul a:visited, nav ul a:active {\n    font-family: Consolas, Monaco, 'Andale Mono', monospace;\n    line-height: 18px;\n    color: #4D4E53;\n}\n\nnav h3 {\n    margin-top: 12px;\n}\n\nnav li {\n    margin-top: 6px;\n}\n\nfooter {\n    display: block;\n    padding: 6px;\n    margin-top: 12px;\n    font-style: italic;\n    font-size: 90%;\n}\n\nh1, h2, h3, h4 {\n    font-weight: 200;\n    margin: 0;\n}\n\nh1\n{\n    font-family: 'Open Sans Light', sans-serif;\n    font-size: 48px;\n    letter-spacing: -2px;\n    margin: 12px 24px 20px;\n}\n\nh2, h3.subsection-title\n{\n    font-size: 30px;\n    font-weight: 700;\n    letter-spacing: -1px;\n    margin-bottom: 12px;\n}\n\nh3\n{\n    font-size: 24px;\n    letter-spacing: -0.5px;\n    margin-bottom: 12px;\n}\n\nh4\n{\n    font-size: 18px;\n    letter-spacing: -0.33px;\n    margin-bottom: 12px;\n    color: #4d4e53;\n}\n\nh5, .container-overview .subsection-title\n{\n    font-size: 120%;\n    font-weight: bold;\n    letter-spacing: -0.01em;\n    margin: 8px 0 3px 0;\n}\n\nh6\n{\n    font-size: 100%;\n    letter-spacing: -0.01em;\n    margin: 6px 0 3px 0;\n    font-style: italic;\n}\n\ntable\n{\n    border-spacing: 0;\n    border: 0;\n    border-collapse: collapse;\n}\n\ntd, th\n{\n    border: 1px solid #ddd;\n    margin: 0px;\n    text-align: left;\n    vertical-align: top;\n    padding: 4px 6px;\n    display: table-cell;\n}\n\nthead tr\n{\n    background-color: #ddd;\n    font-weight: bold;\n}\n\nth { border-right: 1px solid #aaa; }\ntr > th:last-child { border-right: 1px solid #ddd; }\n\n.ancestors { color: #999; }\n.ancestors a\n{\n    color: #999 !important;\n    text-decoration: none;\n}\n\n.clear\n{\n    clear: both;\n}\n\n.important\n{\n    font-weight: bold;\n    color: #950B02;\n}\n\n.yes-def {\n    text-indent: -1000px;\n}\n\n.type-signature {\n    color: #aaa;\n}\n\n.name, .signature {\n    font-family: Consolas, Monaco, 'Andale Mono', monospace;\n}\n\n.details { margin-top: 14px; border-left: 2px solid #DDD; }\n.details dt { width: 120px; float: left; padding-left: 10px;  padding-top: 6px; }\n.details dd { margin-left: 70px; }\n.details ul { margin: 0; }\n.details ul { list-style-type: none; }\n.details li { margin-left: 30px; padding-top: 6px; }\n.details pre.prettyprint { margin: 0 }\n.details .object-value { padding-top: 0; }\n\n.description {\n    margin-bottom: 1em;\n    margin-top: 1em;\n}\n\n.code-caption\n{\n    font-style: italic;\n    font-size: 107%;\n    margin: 0;\n}\n\n.prettyprint\n{\n    border: 1px solid #ddd;\n    width: 80%;\n    overflow: auto;\n}\n\n.prettyprint.source {\n    width: inherit;\n}\n\n.prettyprint code\n{\n    font-size: 100%;\n    line-height: 18px;\n    display: block;\n    padding: 4px 12px;\n    margin: 0;\n    background-color: #fff;\n    color: #4D4E53;\n}\n\n.prettyprint code span.line\n{\n  display: inline-block;\n}\n\n.prettyprint.linenums\n{\n  padding-left: 70px;\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n}\n\n.prettyprint.linenums ol\n{\n  padding-left: 0;\n}\n\n.prettyprint.linenums li\n{\n  border-left: 3px #ddd solid;\n}\n\n.prettyprint.linenums li.selected,\n.prettyprint.linenums li.selected *\n{\n  background-color: lightyellow;\n}\n\n.prettyprint.linenums li *\n{\n  -webkit-user-select: text;\n  -moz-user-select: text;\n  -ms-user-select: text;\n  user-select: text;\n}\n\n.params .name, .props .name, .name code {\n    color: #4D4E53;\n    font-family: Consolas, Monaco, 'Andale Mono', monospace;\n    font-size: 100%;\n}\n\n.params td.description > p:first-child,\n.props td.description > p:first-child\n{\n    margin-top: 0;\n    padding-top: 0;\n}\n\n.params td.description > p:last-child,\n.props td.description > p:last-child\n{\n    margin-bottom: 0;\n    padding-bottom: 0;\n}\n\n.disabled {\n    color: #454545;\n}\n"
  },
  {
    "path": "docs/styles/prettify-jsdoc.css",
    "content": "/* JSDoc prettify.js theme */\n\n/* plain text */\n.pln {\n  color: #000000;\n  font-weight: normal;\n  font-style: normal;\n}\n\n/* string content */\n.str {\n  color: #006400;\n  font-weight: normal;\n  font-style: normal;\n}\n\n/* a keyword */\n.kwd {\n  color: #000000;\n  font-weight: bold;\n  font-style: normal;\n}\n\n/* a comment */\n.com {\n  font-weight: normal;\n  font-style: italic;\n}\n\n/* a type name */\n.typ {\n  color: #000000;\n  font-weight: normal;\n  font-style: normal;\n}\n\n/* a literal value */\n.lit {\n  color: #006400;\n  font-weight: normal;\n  font-style: normal;\n}\n\n/* punctuation */\n.pun {\n  color: #000000;\n  font-weight: bold;\n  font-style: normal;\n}\n\n/* lisp open bracket */\n.opn {\n  color: #000000;\n  font-weight: bold;\n  font-style: normal;\n}\n\n/* lisp close bracket */\n.clo {\n  color: #000000;\n  font-weight: bold;\n  font-style: normal;\n}\n\n/* a markup tag name */\n.tag {\n  color: #006400;\n  font-weight: normal;\n  font-style: normal;\n}\n\n/* a markup attribute name */\n.atn {\n  color: #006400;\n  font-weight: normal;\n  font-style: normal;\n}\n\n/* a markup attribute value */\n.atv {\n  color: #006400;\n  font-weight: normal;\n  font-style: normal;\n}\n\n/* a declaration */\n.dec {\n  color: #000000;\n  font-weight: bold;\n  font-style: normal;\n}\n\n/* a variable name */\n.var {\n  color: #000000;\n  font-weight: normal;\n  font-style: normal;\n}\n\n/* a function name */\n.fun {\n  color: #000000;\n  font-weight: bold;\n  font-style: normal;\n}\n\n/* Specify class=linenums on a pre to get line numbering */\nol.linenums {\n  margin-top: 0;\n  margin-bottom: 0;\n}\n"
  },
  {
    "path": "docs/styles/prettify-tomorrow.css",
    "content": "/* Tomorrow Theme */\n/* Original theme - https://github.com/chriskempson/tomorrow-theme */\n/* Pretty printing styles. Used with prettify.js. */\n/* SPAN elements with the classes below are added by prettyprint. */\n/* plain text */\n.pln {\n  color: #4d4d4c; }\n\n@media screen {\n  /* string content */\n  .str {\n    color: #718c00; }\n\n  /* a keyword */\n  .kwd {\n    color: #8959a8; }\n\n  /* a comment */\n  .com {\n    color: #8e908c; }\n\n  /* a type name */\n  .typ {\n    color: #4271ae; }\n\n  /* a literal value */\n  .lit {\n    color: #f5871f; }\n\n  /* punctuation */\n  .pun {\n    color: #4d4d4c; }\n\n  /* lisp open bracket */\n  .opn {\n    color: #4d4d4c; }\n\n  /* lisp close bracket */\n  .clo {\n    color: #4d4d4c; }\n\n  /* a markup tag name */\n  .tag {\n    color: #c82829; }\n\n  /* a markup attribute name */\n  .atn {\n    color: #f5871f; }\n\n  /* a markup attribute value */\n  .atv {\n    color: #3e999f; }\n\n  /* a declaration */\n  .dec {\n    color: #f5871f; }\n\n  /* a variable name */\n  .var {\n    color: #c82829; }\n\n  /* a function name */\n  .fun {\n    color: #4271ae; } }\n/* Use higher contrast and text-weight for printable form. */\n@media print, projection {\n  .str {\n    color: #060; }\n\n  .kwd {\n    color: #006;\n    font-weight: bold; }\n\n  .com {\n    color: #600;\n    font-style: italic; }\n\n  .typ {\n    color: #404;\n    font-weight: bold; }\n\n  .lit {\n    color: #044; }\n\n  .pun, .opn, .clo {\n    color: #440; }\n\n  .tag {\n    color: #006;\n    font-weight: bold; }\n\n  .atn {\n    color: #404; }\n\n  .atv {\n    color: #060; } }\n/* Style */\n/*\npre.prettyprint {\n  background: white;\n  font-family: Consolas, Monaco, 'Andale Mono', monospace;\n  font-size: 12px;\n  line-height: 1.5;\n  border: 1px solid #ccc;\n  padding: 10px; }\n*/\n\n/* Specify class=linenums on a pre to get line numbering */\nol.linenums {\n  margin-top: 0;\n  margin-bottom: 0; }\n\n/* IE indents via margin-left */\nli.L0,\nli.L1,\nli.L2,\nli.L3,\nli.L4,\nli.L5,\nli.L6,\nli.L7,\nli.L8,\nli.L9 {\n  /* */ }\n\n/* Alternate shading for lines */\nli.L1,\nli.L3,\nli.L5,\nli.L7,\nli.L9 {\n  /* */ }\n"
  },
  {
    "path": "docs/toolbar.js.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Source: toolbar.js</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Source: toolbar.js</h1>\n\n    \n\n\n\n    \n    <section>\n        <article>\n            <pre class=\"prettyprint source linenums\"><code>/**\n * An object that manages the main toolbar, including the different mode buttons.\n * This doesn't actually have many responsibilities after the initial load.\n *\n * @constructor\n * @this {BlockPyToolbar}\n * @param {Object} main - The main BlockPy instance\n * @param {HTMLElement} tag - The HTML object this is attached to.\n */\nfunction BlockPyToolbar(main, tag) {\n    this.main = main;\n    this.tag = tag;\n    \n    // Holds the HTMLElement tags for each of the toolbar items\n    this.tags = {};\n    this.tags.mode_set_text = this.tag.find('.blockpy-mode-set-text');\n    this.tags.filename_picker = this.tag.find('.blockpy-toolbar-filename-picker');\n    \n    // Set up each of the relevant Button Groups\n    var groupHtml = '&lt;div class=\"btn-group\" role=\"group\">&lt;/div>';\n    var runGroup =      $(groupHtml).appendTo(tag);\n    var modeGroup =     $(groupHtml).appendTo(tag);\n    var doGroup =       $(groupHtml).appendTo(tag);\n    var blocksGroup =   $(groupHtml).appendTo(tag);\n    var codeGroup =     $(groupHtml).appendTo(tag);\n    var programsGroup = $(groupHtml).appendTo(tag);\n    \n    // this used to hold many items, but now we store them directly in the\n    // html of interface.js\n    this.elements = {\n        'programs': $(\"&lt;div>&lt;/div>\")\n                            .addClass('btn-group blockpy-programs')\n                            .attr(\"data-toggle\", \"buttons\")\n                            .appendTo(programsGroup)\n    };    \n    this.elements.programs.hide();\n    this.elements.editor_mode = this.tag.find('.blockpy-change-mode');\n    \n    // Actually set up the toolbar!\n    this.activateToolbar();\n}\n\n/**\n * Add a new button for the given filename in the Programs button group.\n * These programs will be things like \"__main__\".\n *\n * @param {String} name - The name of the new program.\n */\nBlockPyToolbar.prototype.addProgram = function(name) {\n    this.elements.programs.append(\"&lt;label class='btn btn-default'>\"+\n                                    \"&lt;input type='radio' id='\"+name+\"' \"+\n                                      \"data-name='\"+name+\"' autocomplete='off'>\"+\n                                        name+\n                                   \"&lt;/label>\");\n}\n\n/**\n * Show the programs button group.\n */\nBlockPyToolbar.prototype.showPrograms = function() {\n    this.elements.programs.show();\n}\n\n/**\n * Hide the programs button group.\n */\nBlockPyToolbar.prototype.hidePrograms = function() {\n    this.elements.programs.hide();\n}\n    \n/**\n * Register click events for more complex toolbar actions.\n */\nBlockPyToolbar.prototype.activateToolbar = function() {\n    var main = this.main;\n    this.tag.find('.blockpy-run').click(function() {\n        main.components.engine.run();\n        main.components.server.logEvent('editor', 'run')\n    });\n    this.tags.mode_set_text.click(function() {\n        main.model.settings.editor(\"Text\");\n        main.components.server.logEvent('editor', 'text')\n    });\n    this.tag.find('.blockpy-toolbar-reset').click(function() {\n        main.model.programs['__main__'](main.model.programs['starting_code']());\n        //main.components.editor.updateBlocks();\n        main.components.server.logEvent('editor', 'reset');\n        if (main.model.assignment.parsons()) {\n            main.components.editor.blockly.shuffle();\n        }\n    });\n    this.tag.find('.blockpy-mode-set-blocks').click(function() {\n        main.model.settings.editor(\"Blocks\");\n        main.components.server.logEvent('editor', 'blocks')\n    });\n    this.tag.find('.blockpy-mode-set-instructor').click(function() {\n        main.model.settings.editor(\"Instructor\");\n        main.components.server.logEvent('editor', 'instructor')\n    });\n    this.tag.find('.blockpy-mode-set-split').click(function() {\n        main.model.settings.editor(\"Split\");\n        main.components.server.logEvent('editor', 'split')\n    });\n    this.tag.find('.blockpy-toolbar-import').click(function() {\n        main.components.corgis.openDialog();\n        main.components.server.logEvent('editor', 'import')\n    });\n    this.tag.find('.blockpy-toolbar-history').click(function() {\n        main.components.history.openDialog();\n        main.components.server.logEvent('editor', 'history')\n    });\n    this.tag.find('.blockpy-toolbar-english').click(function() {\n        main.components.english.openDialog();\n        main.components.server.logEvent('editor', 'english')\n    });\n}</code></pre>\n        </article>\n    </section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>\n"
  },
  {
    "path": "docs/util.js.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>JSDoc: Source: util.js</title>\n\n    <script src=\"scripts/prettify/prettify.js\"> </script>\n    <script src=\"scripts/prettify/lang-css.js\"> </script>\n    <!--[if lt IE 9]>\n      <script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\n    <![endif]-->\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/prettify-tomorrow.css\">\n    <link type=\"text/css\" rel=\"stylesheet\" href=\"styles/jsdoc-default.css\">\n</head>\n\n<body>\n\n<div id=\"main\">\n\n    <h1 class=\"page-title\">Source: util.js</h1>\n\n    \n\n\n\n    \n    <section>\n        <article>\n            <pre class=\"prettyprint source linenums\"><code>/**\n * Return a random integer between [`min`, `max`].\n * \n * @param {number} min - The lowest possible integer.\n * @param {number} max - The highest possible integer (inclusive).\n * @returns {number} A random integer.\n */\nfunction randomInteger(min,max) {\n    return Math.floor(Math.random()*(max-min+1)+min);\n}\n\n/**\n * Indents the given string\n * @param {string} str  The string to be indented.\n * @param {number} numOfIndents  The amount of indentations to place at the\n *     beginning of each line of the string.\n * @param {number=} opt_spacesPerIndent  Optional.  If specified, this should be\n *     the number of spaces to be used for each tab that would ordinarily be\n *     used to indent the text.  These amount of spaces will also be used to\n *     replace any tab characters that already exist within the string.\n * @return {string}  The new string with each line beginning with the desired\n *     amount of indentation.\n */\nfunction indent(str, numOfIndents, opt_spacesPerIndent) {\n  str = str.replace(/^(?=.)/gm, new Array(numOfIndents + 1).join('\\t'));\n  numOfIndents = new Array(opt_spacesPerIndent + 1 || 0).join(' '); // re-use\n  return opt_spacesPerIndent\n    ? str.replace(/^\\t+/g, function(tabs) {\n        return tabs.replace(/./g, numOfIndents);\n    })\n    : str;\n}\n\n/**\n * Encodes some text so that it can be safely written into an HTML box.\n * This includes replacing special HTML characters (&amp;, &lt;, >, etc.).\n *\n * @param {string} str - The text to be converted.\n * @return {string} The HTML-safe text.\n */\nfunction encodeHTML(str) {\n    return str.replace(/&amp;/g, '&amp;amp;')\n              .replace(/&lt;/g, '&amp;lt;')\n              .replace(/>/g, '&amp;gt;')\n              .replace(/\"/g, '&amp;quot;')\n              .replace(/'/g, '&amp;apos;');\n}\n\n/**\n * Shuffle the blocks in the workspace\n */\nBlockly.WorkspaceSvg.prototype.shuffle = function() {\n    var metrics = this.getMetrics();\n    var width = metrics.viewWidth / 2,\n        height = metrics.viewHeight;\n    var blocks = this.getTopBlocks(false);\n    var y = 5, x = 0,\n        maximal_increase = height/blocks.length;\n    for (var i = 0; i &lt; blocks.length; i++){\n        // Get a block\n        var block = blocks[i];\n        var properties = block.getRelativeToSurfaceXY();\n        if (i == 0) {\n            x = 5;\n        } else {\n            x = -properties.x+randomInteger(10, width);\n        }\n        block.moveBy(x, \n                     -properties.y+y);\n        y = y + randomInteger(5, maximal_increase);\n    }\n}\n</code></pre>\n        </article>\n    </section>\n\n\n\n\n</div>\n\n<nav>\n    <h2><a href=\"index.html\">Home</a></h2><h3>Classes</h3><ul><li><a href=\"BlockPy.html\">BlockPy</a></li><li><a href=\"BlockPyCorgis.html\">BlockPyCorgis</a></li><li><a href=\"BlockPyDialog.html\">BlockPyDialog</a></li><li><a href=\"BlockPyEditor.html\">BlockPyEditor</a></li><li><a href=\"BlockPyEngine.html\">BlockPyEngine</a></li><li><a href=\"BlockPyEnglish.html\">BlockPyEnglish</a></li><li><a href=\"BlockPyFeedback.html\">BlockPyFeedback</a></li><li><a href=\"BlockPyHistory.html\">BlockPyHistory</a></li><li><a href=\"BlockPyPresentation.html\">BlockPyPresentation</a></li><li><a href=\"BlockPyPrinter.html\">BlockPyPrinter</a></li><li><a href=\"BlockPyServer.html\">BlockPyServer</a></li><li><a href=\"BlockPyToolbar.html\">BlockPyToolbar</a></li><li><a href=\"LocalStorageWrapper.html\">LocalStorageWrapper</a></li><li><a href=\"PythonToBlocks.html\">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href=\"global.html#BlockPyInterface\">BlockPyInterface</a></li><li><a href=\"global.html#cloneNode\">cloneNode</a></li><li><a href=\"global.html#encodeHTML\">encodeHTML</a></li><li><a href=\"global.html#expandArray\">expandArray</a></li><li><a href=\"global.html#EXTENDED_ERROR_EXPLANATION\">EXTENDED_ERROR_EXPLANATION</a></li><li><a href=\"global.html#indent\">indent</a></li><li><a href=\"global.html#instructor_module\">instructor_module</a></li><li><a href=\"global.html#prettyPrintDateTime\">prettyPrintDateTime</a></li><li><a href=\"global.html#randomInteger\">randomInteger</a></li><li><a href=\"global.html#set_button_loaded\">set_button_loaded</a></li><li><a href=\"global.html#timerGuard\">timerGuard</a></li></ul>\n</nav>\n\n<br class=\"clear\">\n\n<footer>\n    Documentation generated by <a href=\"https://github.com/jsdoc3/jsdoc\">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)\n</footer>\n\n<script> prettyPrint(); </script>\n<script src=\"scripts/linenumber.js\"> </script>\n</body>\n</html>\n"
  },
  {
    "path": "documentation.md",
    "content": "This is an attempt to summarize key parts of BlockPy's execution model. Expect most of it to be out of date by the time I'm done writing, but it's at least true here and now, May 2nd 2023!\n\n# Big Ideas\n\nBlockPy is composed of components. Most interesting stuff is in one of the components, accessible via the `blockpy` instance (usually `this.main` internally) in its `.components` field.\n\nThe UI is KnockoutJS, so you have a bunch of HTML templates littered around the codebase, with various `data-bind` attributes connecting to the actual UI logic (which unfortunately just gets stuffed in `blockpy.js`.\n\n# Execution Pipeline\n\nThe interface is done via KnockoutJS. That was a mistake but here we are. The UI is broken off into separate components, one of which is the list of possible `Editor` instances. The most critical one is the Python Editor (`editor/python.js`). You bind the `click` event handler to `ui.execute.run`:\n\nhttps://github.com/blockpy-edu/blockpy/blob/2549e022dffb5164d9e5566e43a07c899448fb80/src/editor/python.js#L35-L41\n\nThat function is stuffed into the big main `blockpy.js` file, because apparently Past Me chose to forget everything he knew about modular design:\n\nhttps://github.com/blockpy-edu/blockpy/blob/2549e022dffb5164d9e5566e43a07c899448fb80/src/blockpy.js#L1019-L1027\n\nThat is really just dispatching to `delayedRun` (there are performance reasons for this, believe it or not), which in turn is responsible for calling `run` (there are not performance reasons for that, it's just leftover structure from an older hack):\n\nhttps://github.com/blockpy-edu/blockpy/blob/2549e022dffb5164d9e5566e43a07c899448fb80/src/engine.js#L98-L124\n\nOkay the actual `run` function finally gets a little interesting. This is in `engine.js` and requires you to understand the `Configuration` hierarchy that we use.\n\n![image](https://user-images.githubusercontent.com/897227/235737132-08fa2911-1ccb-4ea4-87ba-f9af884cb5b4.png)\n\nWe need to be able to run the user's code in various ways. The different `Configuration` classes allow us to reuse functionality between those \"various ways\". In addition to the methods shown, they also have a bunch of methods like `print()`, `input()`, `openFile()`, etc. that work differently depending on how the code is meant to be executed (e.g., the `Student` variant's `print` puts text on the BlockPy console, the `Instructor` variant's `print` puts it in the developer console).\n\nAnyway, the critical thing is that if you are calling the `run` function in the `BlockPyEngine` component, then it going to set the current `configuration` for the engine, and then delegate out to the general `execute` function:\n\nhttps://github.com/blockpy-edu/blockpy/blob/2549e022dffb5164d9e5566e43a07c899448fb80/src/engine.js#L172-L179\n\nThat is where the actual `Skulpt` magic happens, calling `Sk.importMainWithBody` with the appropriate data and returning a promise for when it is finished. After all is done, we call the relevant `Configuration.success` and `Configuration.failure` callbacks and eventually the `Configuration.finally` handlers. Assuming we we have not disabled feedback, *then* we repeat this process for the `onRun`.\n\nhttps://github.com/blockpy-edu/blockpy/blob/2549e022dffb5164d9e5566e43a07c899448fb80/src/engine.js#L126-L134\n\nBasically the same process as before, just a little simpler. We are now running the instructor control script: the contents of the assignment's `on_run.py` file wrapped with our template that does all the boilerplate stuff for executing Pedal:\n\nhttps://github.com/blockpy-edu/blockpy/blob/2549e022dffb5164d9e5566e43a07c899448fb80/src/engine/on_run.js#L17-L98\n\nOnce that's all done, we post-process the results in various ways, including calling `this.main.components.feedback.presentFeedback(results)`, updating the submission's data locally and on the backend, and so on:\n\nhttps://github.com/blockpy-edu/blockpy/blob/2549e022dffb5164d9e5566e43a07c899448fb80/src/engine/on_run.js#L141-L176\n\nActually intepretting the feedback is a fairly tedious process, but the `Feedback` component is fairly self-contained. If you poke around the `src/feedback.js` file, you'll find its HTML template and the various logic for controlling it.\n\nhttps://github.com/blockpy-edu/blockpy/blob/2549e022dffb5164d9e5566e43a07c899448fb80/src/feedback.js#L240-L255\n\nThere's so much I know more now about interfacing more directly with the Skulpt data, but the code mostly works.\n\nGod, I wish I could just sit down and rewrite all of this from scratch, using TypeScript, a better UI library, and some sane decisions in terms of modular separation of concerns. I'm this guy:\n\n![image](https://user-images.githubusercontent.com/897227/235740346-d950276a-6a9c-4940-a4b6-720d17da0861.png)\n"
  },
  {
    "path": "image_server.py",
    "content": "#!/usr/bin/env python3\nfrom http.server import HTTPServer, SimpleHTTPRequestHandler, test\nimport sys\n\nclass CORSRequestHandler (SimpleHTTPRequestHandler):\n    def end_headers (self):\n        self.send_header('Access-Control-Allow-Origin', '*')\n        SimpleHTTPRequestHandler.end_headers(self)\n\nif __name__ == '__main__':\n    test(CORSRequestHandler, HTTPServer, port=int(sys.argv[1]) if len(sys.argv) > 1 else 8000)"
  },
  {
    "path": "instructor_api_documentation.py",
    "content": "'''\nThis file documents the Python Instructor API. \nThe format is Google Style Python Docstrings, based on\n`http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html`\n\n\n'''\n\n\n## Core functions\n\ndef compliment(message):\n    '''\n    Adds message to the list of complimentary feedback.\n    \n    Args:\n        message (str): The text string to display to the user in the Feedback \n                       panel as complimentary feedback. This will appear as \n                       a tooltip.\n        \n    '''\n\ndef set_success():\n    '''\n    Marks the problem as completely correct. This immediately ends execution \n    by throwing a GracefulExit exception.\n    '''\n\ndef explain(message, priority=\"medium\", line=None):\n    '''\n    Gives student the message as corrective feedback (and higlights line \n    number). If this function is called multiple times, the student is given the\n    first feedback of the highest priority found. By default, this overrides\n    the analyzer and runtime errors that are given - if you want to avoid overriding\n    those, then use `gently`.\n    \n    Args:\n        message (str): The HTML string to display to the user in the Feedback\n                       panel as corrective feedback. \n\t\tpriority (str): Either \"low\", \"medium\", or \"high\", indicating the\n                        ordering of the feedback if multiple occur. Also \"student\"\n                        is an option to put it after the analyzer and runtime\n                        errors, and \"verifier\" will put it before syntax errors.\n\t\tline (int): The specific line number to highlight for the user.\n    '''\n\ndef gently(message):\n    '''\n    Gives students the message as corrective feedback, at a priority level\n    below the analyzer and runtime errors - that way, it can be used to\n    more \"gently\" guide the student.\n    '''\n\ndef suppress(type, subtype):\n    '''\n    Suppresses feedback of the given \"type\".  When also given a subtype, it\n    instead suppresses the subtype (which is typically a specific error message\n    or type of exception). Multiple subtypes can be specified with multiple\n    calls, each call suppressing additional feedback.\n    \n    Args:\n        type (str): Either 'verifier', 'parser', 'analyzer', or 'student',\n                    corresponding to the phase of execution feedback that will\n                    be suppressed.\n        subtype (str): A specific type of exception (if 'student') or\n                       specific type of issue (if 'analyzer'). Available issues:\n                        - 'Unconnected blocks'\n                        - 'Iteration variable is iteration list'\n                        - \"Undefined variables\"\n                        - \"Possibly undefined variables\"\n                        - \"Unread variables\"\n                        - \"Overwritten variables\"\n                        - \"Empty iterations\"\n                        - \"Non-list iterations\"\n                        - \"Incompatible types\"\n    '''\n    \ndef run_student():\n    '''\n    Reruns the students' submitted code (\"__main__\") as a function call.\n    This allows the instructor to run the student code under new conditions.\n    After a call to run_student(), the instructor will most likely want\n    to use get_output() or some other function to access the new state.\n    If the students' code failed to parse, then the body is instead replaced\n    with \"pass\" to prevent compilation errors.\n    If the students' code raises an exception, that exception is caught and\n    returned by the function. This is necessary to avoid the Instructor feedback\n    hijacking the runtime exceptions that students would see.\n    \n    Returns:\n        Exception or None: If the students' code fails for some reason, the\n                           raised exception is returned. Otherwise, the None\n                           value is returned.\n    '''\n\ndef get_output():\n    '''\n    Returns a List containing the students' output from the last run. Note that\n    multiple invocations of run_student(), without calls to reset_output(), will\n    possibly result in duplicate output.\n    Different types of student output are represented differently:\n        - Print: Represented as strings WITHOUT the trailing newline.\n        - Plot: Represented as Lists of \"Plot Dictionaries\". Each call to \n                plot(), hist(), and scatter() adds another \"Plot Dictionary\" to\n                the list, and the list is only \"snipped off\" when show() is\n                called. Each \"Plot Dictionary\" contains two fields:\n                    \"type\": One of \"hist\", \"line\", or \"scatter\".\n                    \"data\": A 1- or 2- dimensional list of numeric data.\n    \n    Returns:\n        list: The output that the students code generated on its last execution.\n    '''\n    \ndef queue_input(input):\n    '''\n    Add a new string to be set as input when the \"input\" function is called.\n    You can repeatedly queue_input to satisfy loops, too.\n    If there are no queued inputs, a blank string will be returned.\n    \n    Args:\n        input (str): The string to queue for input.\n    '''\n    \ndef reset_output():\n    '''\n    Removes any output generated on a previous run of the student code. This is\n    typically used between executions of the `run_student` function.\n    '''\n    \ndef log(message):\n    '''\n    Print the given message to the JS console in the browser. This is useful\n    for debugging purposes.\n    \n    Args:\n        message: The logging message. Any kind of data is allowable, and will\n                 be printed as JavaScript (using remapToJs).)\n    '''\n    \ndef log_ast():\n    '''\n    Prints the AST to the JS console in the browser. This is useful for\n    debugging purposes.\n    '''\n    \ndef log_variables():\n    '''\n    Prints a mapping between the names of the programs' variables and their\n    estimated type (according to the abstract interpreter) to the JS console\n    in the browser. This is useful for debugging purposes.\n    '''\n    \ndef log_behavior():\n    '''\n    Prints a list of each variables' read/write behavior to the JS console\n    in the browser. This is useful for debugging purposes.\n    '''\n    \ndef log_trace():\n    '''\n    Prints a list of each step of the programs' execution to the JS console\n    in the browser. This is useful for debugging purposes.\n    '''\n    \ndef log_issues():\n    '''\n    Prints a list of all found Abstract Interperter issues to the JS console\n    in the browser. This is useful for debugging purposes.\n    '''\n\nclass StudentData():\n    '''\n    A class that wraps a dictionary of data created after the execution of\n    the students' code. \n    A common use case for this is to require students to declare a particular\n    function, and then to access that function via the singleton instance of\n    this class.\n    \n    Attributes:\n        data (dict): A dictionary containing all the students' data. In other\n                     words, if they declare a variable named \"alpha\", you can\n                     access that variable's final value via\n    \n                        student['alpha']\n\n                     Because this is a dictionary, you can also test membership,\n                     access element dynamically, and anything else you may want.\n    '''\n    \n    def get_values_by_type(type):\n        '''\n        Returns a list of values from the students' data where each value\n        will have the given type.\n        \n        Args:\n            type (type): A python type (e.g., int or str) that will be used\n                         in the comparison. Does not respect inheritance!\n        Returns:\n            list: A list of the values with that type.\n        '''\n    \n    def get_names_by_type(type):\n        '''\n        Returns a list of the variable names from the students' data where each\n        variable's final value will have the given type.\n        \n        Args:\n            type (type): A python type (e.g., int or str) that will be used\n                         in the comparison. Does not respect inheritance!\n        Returns:\n            list of str: A list of the variables with that type.\n        '''\n\nstudent = StudentData()\n'''\nA top-level variable that holds all of the students' created data. \nActs as a convenient singleton for the code.\n'''\n\ndef analyze_program():\n    '''\n    Triggers the analyzer to run so that type information can be available\n    on the AST nodes.\n    '''\n\n    \ndef parse_program():\n    '''\n    Returns the root node of the AST of the student code as an AstNode.\n    See the AstNode class for more information.\n    \n    Returns:\n        AstNode: The root node of the AST\n    '''\n    \ndef get_program():\n    '''\n    Returns the students' code as a string.\n    \n    Returns:\n        String: The string representation of the student code.\n    '''\n    \n\ndef def_use_error(node):\n    '''\n    Determines if the given AstNode (with the astname \"Name\"), and if so,\n    if the name associated with that node has not been initialized according\n    to the Analyzer.\n    \n    Args:\n        node (AstNode): The Name node to analyze.\n        \n    Returns:\n        bool: Returns whether the associated name has been initialized.\n    '''\n        \nclass AstNode():\n    '''\n    A representation of the students' Abstract Syntax Tree. Can be traversed\n    and analyzed in order to make assertions about the students' code.\n    The fields of the AstNode, in addition to the two listed below, are the\n    fields listed in the Green Tree Snakes documentation.\n    \n    https://greentreesnakes.readthedocs.io/en/latest/nodes.html\n    \n    Attributes:\n        ast_name (str): The type of AST Node of this node (e.g. \"Name\", \"For\", \n                        \"Assign\", etc.). For a complete list, see the Green Tree\n                        Snakes API, which closely mimics our own. \n                        Some notable exceptions are:\n                            - Assign: Currently, Assign.targets returns a single\n                                      AstNode instead of a list.\n                            - Op Nodes: For nodes with an \"ops\" field, this\n                                        only returns the FIRST operator, so no\n                                        comparison operator chaining.\n        data_type \n            if this node is a Name node, returns the first data type that this variable has taken on\n        next_tree\n            For the AST node to which this node belongs, returns the next node in that AST that is NOT\n            in this node's subtree.\n    '''\n    def __init__(self, id):\n        '''\n        This should NOT be used by an instructor, this is strictly used\n        internally to match up with the already parsed Skulpt AST.\n        \n        Args:\n            id (int): The index for the AST node when doing an in-order\n                      traversal of the tree.\n        '''\n        \n    def __eq__(self, other):\n        '''\n        If other is an AstNode, checks whether they are the same AstNode. If\n        both nodes originate from the same AST, then a return true will indicate\n        it is the same node, and false will indicate it's a different node. If\n        it's not an AstNode, this will crash the program\n        \n        Args:\n            other (AstNode): The other AstNode to compare to.\n        \n        Returns:\n            bool: A boolean indicating if they are equal.\n        '''\n        \n    def has(self, astNode):\n        '''\n        Returns whether the given astNode is a Name astNode (or a number) AND\n        if the name of the variable associated with astNode node is in the\n        subtree of this node.\n        \n        Args:\n            astNode (AstNode or int): The potential child node to find.\n            \n        Returns:\n            bool: Whether the node is a descendent.\n        '''\n        \n    def find_all(self, type):\n        '''\n        Returns all AstNodes in this node's subtrees that are an AstNode of the\n        given type.\n        \n        Args:\n            type (str): The ast name to search for (\"For\", \"Assign\", \"BinOp\", \n                        etc.). A complete list of options can be found in the\n                        Green Tree Snakes documentation.\n\n        Returns:\n            list of AstNode: The AstNodes descended from this one.\n        '''\n    def numeric_logic_check(self, mag, expr):\n        '''\n        Returns whether the numerical logical expression represented by the AST self likely\n        equivalent to the numerical logical expression represented by expr.  Likely is determined by\n        testing boundary conditions\n        Args:\n            mag (number): a tolerance value with which to check against. This is used for checking\n                            boundary conditions\n            expr (string): A string written in JAVASCRIPT syntax that is equivalent to the logic\n                            that you want self to be equivalent to. Eval is run on this string\n        Returns:\n            None: This means that either there was more than one variable in expr or self,\n                    that self wasn't a Compare or BoolOp node, or that\n            True: This means that self matched all detectable edge cases testing between expr and self within\n                    the specified tolerance mag.\n            False: This means that self and expr didn't return the same thing for one of the automatically\n                    generated test inputs.\n        '''\n## instructor_utility.py\n\ndef ensure_literal(*literals):\n    '''\n    Raises an Explanation if the literal values (strings, ints, floats) are not\n    in the source code.\n    \n    Args:\n        *literals (int, float or str): Any literal value.\n    Returns: False if the literals were all in the code, otherwise\n             returns the first missing literal value.\n    '''\ndef prevent_literal(*literals):\n    '''\n    Raises an Explanation if the literal values (strings, ints, floats) are\n    in the source code.\n    \n    Args:\n        *literals (int, float or str): Any literal value.\n    Returns: False if the literals were not in the code, otherwise\n             returns the first present literal value.\n    '''\n    \ndef ensure_operation(op_name, root=None):\n    '''\n    Gently rebukes if the given operator is not found in the source code.\n    \n    Args:\n        op_name (str): The name of the operator, as it is written in Python\n                       (e.g., \"==\" and not \"Eq\"). Works for BoolOps, BinOps,\n                       UnaryOps, and Compares.\n    Returns: False if the operator was not in the code, otherwise returns the\n             first AST node apperance of the operator.\n    '''\ndef prevent_operation(op_name, root=None):\n    '''\n    Gently rebukes if the given operator is found in the source code.\n    \n    Args:\n        op_name (str): The name of the operator, as it is written in Python\n                       (e.g., \"==\" and not \"Eq\"). Works for BoolOps, BinOps,\n                       UnaryOps, and Compares.\n    Returns: False if the operator was not in the code, otherwise returns the\n             first AST node apperance of the operator.\n    '''\n\ndef function_is_called(name):\n    '''\n    Returns whether the given function or method has been called from within\n    the students' code.\n    \n    Args:\n        name (str): The name of the function or method (e.g., \"sum\").\n    \n    Returns:\n        bool: Whether the function or method is called.\n    '''\n    \ndef only_printing_variables():\n    '''\n    Returns whether the students' code is only printing variables, as opposed\n    to the anything else (e.g., literal values).\n    \n    Returns:\n        bool: Whether any print function calls print non-variables.\n    '''\ndef find_prior_initializations(node):\n    '''\n    Given a name ast node at a specific location in code, returns a list of\n    all previous assignments that have written to that name\n\n    Returns:\n        None if node is not a Name node, otherwise returns a (possibly empty)\n        list\n    '''\n    \ndef prevent_builtin_usage(names):\n    '''\n    Checks that a given list of function names are not being called, and\n    explains a warning if they are. Also prevents against simply redeclaring\n    the function_names.\n    \n    Args:\n        names (list of str): A list of the function names to check for.\n    \n    Returns:\n        None: No usages occurred\n        str: The name of the first function that was used.\n    '''\n\ndef prevent_advanced_iteration():\n    '''\n    Checks that the program does not use While loops or any of the built-in\n    functions for processing lists (e.g., sum or len).\n    '''\n    \n##instructor_filter\ndef missing_if_in_for():\n    '''\n    '''\ndef append_not_in_if():\n    '''\n    '''\n##iteration_context\ndef list_length_3_or_more():\n    '''\n    '''\ndef missing_list_initialization_8_2():\n    '''\n    '''\ndef wrong_list_initialization_placement_8_3():\n    '''\n    '''\ndef wrong_accumulator_initialization_placement_8_3():\n    '''\n    '''\ndef wrong_iteration_body_8_3():\n    '''\n    '''\ndef wrong_print_8_3():\n    '''\n    '''\ndef missing_target_slot_empty_8_4():\n    '''\n    '''\ndef missing_addition_slot_empty_8_4():\n    '''\n    '''\ndef wrong_names_not_agree_8_4():\n    '''\n    '''\ndef wrong_should_be_counting():\n    '''\n    '''\ndef wrong_should_be_summing():\n    '''\n    '''\ndef wrong_cannot_sum_list():\n    '''\n    '''\ndef missing_no_print():\n    '''\n    '''\ndef missing_counting_list():\n    '''\n    '''\ndef missing_summing_list():\n    '''\n    '''\ndef missing_zero_initialization():\n    '''\n    '''\ndef missing_average():\n    '''\n    '''\ndef warning_average_in_iteration():\n    '''\n    '''\ndef wrong_average_demoninator():\n    '''\n    '''\ndef wrong_average_numerator():\n    '''\n    '''\ndef wrong_compare_list():\n    '''\n    '''\ndef wrong_for_inside_if():\n    '''\n    '''\ndef wrong_list_initialization_9_1():\n    '''\n    '''\ndef wrong_accumulator_initialization_9_1():\n    '''\n    '''\ndef wrong_accumulation_9_1():\n    '''\n    '''\ndef wrong_list_initialization_placement_9_1():\n    '''\n    '''\ndef wrong_accumulator_initialization_placement_9_1():\n    '''\n    '''\ndef wrong_iteration_body_9_1():\n    '''\n    '''\ndef wrong_print_9_1():\n    '''\n    '''\ndef wrong_list_initialization_9_2():\n    '''\n    '''\ndef wrong_accumulator_initialization_9_2():\n    '''\n    '''\ndef wrong_accumulation_9_2():\n    '''\n    '''\ndef wrong_list_initialization_placement_9_2():\n    '''\n    '''\ndef wrong_accumulator_initialization_placement_9_2():\n    '''\n    '''\ndef wrong_iteration_body_9_2():\n    '''\n    '''\ndef wrong_decision_body_9_2():\n    '''\n    '''\ndef wrong_print_9_2():\n    '''\n    '''\ndef wrong_comparison_9_6():\n    '''\n    '''\ndef wrong_conversion_10_2():\n    '''\n    '''\ndef wrong_filter_condition_10_3():\n    '''\n    '''\ndef wrong_and_filter_condition_10_4():\n    '''\n    '''\ndef wrong_nested_filter_condition_10_4():\n    '''\n    '''\ndef wrong_conversion_problem_10_5():\n    '''\n    '''\ndef wrong_filter_problem_atl1_10_5():\n    '''\n    '''\ndef wrong_filter_problem_atl2_10_5():\n    '''\n    '''\ndef wrong_append_problem_atl1_10_5():\n    '''\n    '''\ndef wrong_append_problem_atl2_10_5():\n    '''\n    '''\ndef wrong_debug_10_6():\n    '''\n    '''\ndef wrong_debug_10_7():\n    '''\n    '''\n##instructor_histogram\ndef histogram_missing():\n    '''\n    '''\ndef plot_show_missing():\n    '''\n    '''\ndef histogram_argument_not_list():\n    '''\n    '''\ndef histogram_wrong_list():\n    '''\n    '''\n##instructor_append\ndef find_append_in(node):\n    '''\n    '''\ndef missing_append_in_iteration():\n    '''\n    '''\ndef wrong_not_append_to_list():\n    '''\n    '''\ndef missing_append_list_initialization():\n    '''\n    '''\ndef wrong_append_list_initiatization():\n    '''\n    '''\ndef append_list_wrong_slot():\n    '''\n    '''\n##instructor_iteration\ndef all_for_loops():\n    '''\n    '''\ndef wrong_target_is_list():\n    '''\n    '''\ndef wrong_list_repeated_in_for():\n    '''\n    '''\ndef missing_iterator_initialization():\n    '''\n    '''\ndef wrong_iterator_not_list():\n    '''\n    '''\ndef missing_target_slot_empty():\n    '''\n    '''\ndef list_not_initialized_on_run():\n    '''\n    '''\ndef list_initialization_misplaced():\n    '''\n    '''\ndef missing_for_slot_empty():\n    '''\n    '''"
  },
  {
    "path": "libs/codemirror/codemirror.css",
    "content": "/* BASICS */\n\n.CodeMirror {\n  /* Set height, width, borders, and global font properties here */\n  font-family: monospace;\n  height: 300px;\n  color: black;\n  direction: ltr;\n}\n\n/* PADDING */\n\n.CodeMirror-lines {\n  padding: 4px 0; /* Vertical padding around content */\n}\n.CodeMirror pre {\n  padding: 0 4px; /* Horizontal padding of content */\n}\n\n.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n  background-color: white; /* The little square between H and V scrollbars */\n}\n\n/* GUTTER */\n\n.CodeMirror-gutters {\n  border-right: 1px solid #ddd;\n  background-color: #f7f7f7;\n  white-space: nowrap;\n}\n.CodeMirror-linenumbers {}\n.CodeMirror-linenumber {\n  padding: 0 3px 0 5px;\n  min-width: 20px;\n  text-align: right;\n  color: #999;\n  white-space: nowrap;\n}\n\n.CodeMirror-guttermarker { color: black; }\n.CodeMirror-guttermarker-subtle { color: #999; }\n\n/* CURSOR */\n\n.CodeMirror-cursor {\n  border-left: 1px solid black;\n  border-right: none;\n  width: 0;\n}\n/* Shown when moving in bi-directional text */\n.CodeMirror div.CodeMirror-secondarycursor {\n  border-left: 1px solid silver;\n}\n.cm-fat-cursor .CodeMirror-cursor {\n  width: auto;\n  border: 0 !important;\n  background: #7e7;\n}\n.cm-fat-cursor div.CodeMirror-cursors {\n  z-index: 1;\n}\n.cm-fat-cursor-mark {\n  background-color: rgba(20, 255, 20, 0.5);\n  -webkit-animation: blink 1.06s steps(1) infinite;\n  -moz-animation: blink 1.06s steps(1) infinite;\n  animation: blink 1.06s steps(1) infinite;\n}\n.cm-animate-fat-cursor {\n  width: auto;\n  border: 0;\n  -webkit-animation: blink 1.06s steps(1) infinite;\n  -moz-animation: blink 1.06s steps(1) infinite;\n  animation: blink 1.06s steps(1) infinite;\n  background-color: #7e7;\n}\n@-moz-keyframes blink {\n  0% {}\n  50% { background-color: transparent; }\n  100% {}\n}\n@-webkit-keyframes blink {\n  0% {}\n  50% { background-color: transparent; }\n  100% {}\n}\n@keyframes blink {\n  0% {}\n  50% { background-color: transparent; }\n  100% {}\n}\n\n/* Can style cursor different in overwrite (non-insert) mode */\n.CodeMirror-overwrite .CodeMirror-cursor {}\n\n.cm-tab { display: inline-block; text-decoration: inherit; }\n\n.CodeMirror-rulers {\n  position: absolute;\n  left: 0; right: 0; top: -50px; bottom: -20px;\n  overflow: hidden;\n}\n.CodeMirror-ruler {\n  border-left: 1px solid #ccc;\n  top: 0; bottom: 0;\n  position: absolute;\n}\n\n/* DEFAULT THEME */\n\n.cm-s-default .cm-header {color: blue;}\n.cm-s-default .cm-quote {color: #090;}\n.cm-negative {color: #d44;}\n.cm-positive {color: #292;}\n.cm-header, .cm-strong {font-weight: bold;}\n.cm-em {font-style: italic;}\n.cm-link {text-decoration: underline;}\n.cm-strikethrough {text-decoration: line-through;}\n\n.cm-s-default .cm-keyword {color: #708;}\n.cm-s-default .cm-atom {color: #219;}\n.cm-s-default .cm-number {color: #164;}\n.cm-s-default .cm-def {color: #00f;}\n.cm-s-default .cm-variable,\n.cm-s-default .cm-punctuation,\n.cm-s-default .cm-property,\n.cm-s-default .cm-operator {}\n.cm-s-default .cm-variable-2 {color: #05a;}\n.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}\n.cm-s-default .cm-comment {color: #a50;}\n.cm-s-default .cm-string {color: #a11;}\n.cm-s-default .cm-string-2 {color: #f50;}\n.cm-s-default .cm-meta {color: #555;}\n.cm-s-default .cm-qualifier {color: #555;}\n.cm-s-default .cm-builtin {color: #30a;}\n.cm-s-default .cm-bracket {color: #997;}\n.cm-s-default .cm-tag {color: #170;}\n.cm-s-default .cm-attribute {color: #00c;}\n.cm-s-default .cm-hr {color: #999;}\n.cm-s-default .cm-link {color: #00c;}\n\n.cm-s-default .cm-error {color: #f00;}\n.cm-invalidchar {color: #f00;}\n\n.CodeMirror-composing { border-bottom: 2px solid; }\n\n/* Default styles for common addons */\n\ndiv.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}\ndiv.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}\n.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }\n.CodeMirror-activeline-background {background: #e8f2ff;}\n\n/* STOP */\n\n/* The rest of this file contains styles related to the mechanics of\n   the editor. You probably shouldn't touch them. */\n\n.CodeMirror {\n  position: relative;\n  overflow: hidden;\n  background: white;\n}\n\n.CodeMirror-scroll {\n  overflow: scroll !important; /* Things will break if this is overridden */\n  /* 30px is the magic margin used to hide the element's real scrollbars */\n  /* See overflow: hidden in .CodeMirror */\n  margin-bottom: -30px; margin-right: -30px;\n  padding-bottom: 30px;\n  height: 100%;\n  outline: none; /* Prevent dragging from highlighting the element */\n  position: relative;\n}\n.CodeMirror-sizer {\n  position: relative;\n  border-right: 30px solid transparent;\n}\n\n/* The fake, visible scrollbars. Used to force redraw during scrolling\n   before actual scrolling happens, thus preventing shaking and\n   flickering artifacts. */\n.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n  position: absolute;\n  z-index: 6;\n  display: none;\n}\n.CodeMirror-vscrollbar {\n  right: 0; top: 0;\n  overflow-x: hidden;\n  overflow-y: scroll;\n}\n.CodeMirror-hscrollbar {\n  bottom: 0; left: 0;\n  overflow-y: hidden;\n  overflow-x: scroll;\n}\n.CodeMirror-scrollbar-filler {\n  right: 0; bottom: 0;\n}\n.CodeMirror-gutter-filler {\n  left: 0; bottom: 0;\n}\n\n.CodeMirror-gutters {\n  position: absolute; left: 0; top: 0;\n  min-height: 100%;\n  z-index: 3;\n}\n.CodeMirror-gutter {\n  white-space: normal;\n  height: 100%;\n  display: inline-block;\n  vertical-align: top;\n  margin-bottom: -30px;\n}\n.CodeMirror-gutter-wrapper {\n  position: absolute;\n  z-index: 4;\n  background: none !important;\n  border: none !important;\n}\n.CodeMirror-gutter-background {\n  position: absolute;\n  top: 0; bottom: 0;\n  z-index: 4;\n}\n.CodeMirror-gutter-elt {\n  position: absolute;\n  cursor: default;\n  z-index: 4;\n}\n.CodeMirror-gutter-wrapper ::selection { background-color: transparent }\n.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }\n\n.CodeMirror-lines {\n  cursor: text;\n  min-height: 1px; /* prevents collapsing before first draw */\n}\n.CodeMirror pre {\n  /* Reset some styles that the rest of the page might have set */\n  -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;\n  border-width: 0;\n  background: transparent;\n  font-family: inherit;\n  font-size: inherit;\n  margin: 0;\n  white-space: pre;\n  word-wrap: normal;\n  line-height: inherit;\n  color: inherit;\n  z-index: 2;\n  position: relative;\n  overflow: visible;\n  -webkit-tap-highlight-color: transparent;\n  -webkit-font-variant-ligatures: contextual;\n  font-variant-ligatures: contextual;\n}\n.CodeMirror-wrap pre {\n  word-wrap: break-word;\n  white-space: pre-wrap;\n  word-break: normal;\n}\n\n.CodeMirror-linebackground {\n  position: absolute;\n  left: 0; right: 0; top: 0; bottom: 0;\n  z-index: 0;\n}\n\n.CodeMirror-linewidget {\n  position: relative;\n  z-index: 2;\n  padding: 0.1px; /* Force widget margins to stay inside of the container */\n}\n\n.CodeMirror-widget {}\n\n.CodeMirror-rtl pre { direction: rtl; }\n\n.CodeMirror-code {\n  outline: none;\n}\n\n/* Force content-box sizing for the elements where we expect it */\n.CodeMirror-scroll,\n.CodeMirror-sizer,\n.CodeMirror-gutter,\n.CodeMirror-gutters,\n.CodeMirror-linenumber {\n  -moz-box-sizing: content-box;\n  box-sizing: content-box;\n}\n\n.CodeMirror-measure {\n  position: absolute;\n  width: 100%;\n  height: 0;\n  overflow: hidden;\n  visibility: hidden;\n}\n\n.CodeMirror-cursor {\n  position: absolute;\n  pointer-events: none;\n}\n.CodeMirror-measure pre { position: static; }\n\ndiv.CodeMirror-cursors {\n  visibility: hidden;\n  position: relative;\n  z-index: 3;\n}\ndiv.CodeMirror-dragcursors {\n  visibility: visible;\n}\n\n.CodeMirror-focused div.CodeMirror-cursors {\n  visibility: visible;\n}\n\n.CodeMirror-selected { background: #d9d9d9; }\n.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }\n.CodeMirror-crosshair { cursor: crosshair; }\n.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }\n.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }\n\n.cm-searching {\n  background-color: #ffa;\n  background-color: rgba(255, 255, 0, .4);\n}\n\n/* Used to force a border model for a node */\n.cm-force-border { padding-right: .1px; }\n\n@media print {\n  /* Hide the cursor when printing */\n  .CodeMirror div.CodeMirror-cursors {\n    visibility: hidden;\n  }\n}\n\n/* See issue #2901 */\n.cm-tab-wrap-hack:after { content: ''; }\n\n/* Help users use markselection to safely style text background */\nspan.CodeMirror-selectedtext { background: none; }\n"
  },
  {
    "path": "libs/codemirror/codemirror.js",
    "content": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n// This is CodeMirror (https://codemirror.net), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n  typeof define === 'function' && define.amd ? define(factory) :\n  (global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n  // Kludges for bugs and behavior differences that can't be feature\n  // detected are enabled based on userAgent etc sniffing.\n  var userAgent = navigator.userAgent;\n  var platform = navigator.platform;\n\n  var gecko = /gecko\\/\\d/i.test(userAgent);\n  var ie_upto10 = /MSIE \\d/.test(userAgent);\n  var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n  var edge = /Edge\\/(\\d+)/.exec(userAgent);\n  var ie = ie_upto10 || ie_11up || edge;\n  var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n  var webkit = !edge && /WebKit\\//.test(userAgent);\n  var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n  var chrome = !edge && /Chrome\\//.test(userAgent);\n  var presto = /Opera\\//.test(userAgent);\n  var safari = /Apple Computer/.test(navigator.vendor);\n  var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n  var phantom = /PhantomJS/.test(userAgent);\n\n  var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\\/\\w+/.test(userAgent);\n  var android = /Android/.test(userAgent);\n  // This is woefully incomplete. Suggestions for alternative methods welcome.\n  var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n  var mac = ios || /Mac/.test(platform);\n  var chromeOS = /\\bCrOS\\b/.test(userAgent);\n  var windows = /win/i.test(platform);\n\n  var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n  if (presto_version) { presto_version = Number(presto_version[1]); }\n  if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n  // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n  var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n  var captureRightClick = gecko || (ie && ie_version >= 9);\n\n  function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n  var rmClass = function(node, cls) {\n    var current = node.className;\n    var match = classTest(cls).exec(current);\n    if (match) {\n      var after = current.slice(match.index + match[0].length);\n      node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n    }\n  };\n\n  function removeChildren(e) {\n    for (var count = e.childNodes.length; count > 0; --count)\n      { e.removeChild(e.firstChild); }\n    return e\n  }\n\n  function removeChildrenAndAdd(parent, e) {\n    return removeChildren(parent).appendChild(e)\n  }\n\n  function elt(tag, content, className, style) {\n    var e = document.createElement(tag);\n    if (className) { e.className = className; }\n    if (style) { e.style.cssText = style; }\n    if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n    else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n    return e\n  }\n  // wrapper for elt, which removes the elt from the accessibility tree\n  function eltP(tag, content, className, style) {\n    var e = elt(tag, content, className, style);\n    e.setAttribute(\"role\", \"presentation\");\n    return e\n  }\n\n  var range;\n  if (document.createRange) { range = function(node, start, end, endNode) {\n    var r = document.createRange();\n    r.setEnd(endNode || node, end);\n    r.setStart(node, start);\n    return r\n  }; }\n  else { range = function(node, start, end) {\n    var r = document.body.createTextRange();\n    try { r.moveToElementText(node.parentNode); }\n    catch(e) { return r }\n    r.collapse(true);\n    r.moveEnd(\"character\", end);\n    r.moveStart(\"character\", start);\n    return r\n  }; }\n\n  function contains(parent, child) {\n    if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n      { child = child.parentNode; }\n    if (parent.contains)\n      { return parent.contains(child) }\n    do {\n      if (child.nodeType == 11) { child = child.host; }\n      if (child == parent) { return true }\n    } while (child = child.parentNode)\n  }\n\n  function activeElt() {\n    // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n    // IE < 10 will throw when accessed while the page is loading or in an iframe.\n    // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n    var activeElement;\n    try {\n      activeElement = document.activeElement;\n    } catch(e) {\n      activeElement = document.body || null;\n    }\n    while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n      { activeElement = activeElement.shadowRoot.activeElement; }\n    return activeElement\n  }\n\n  function addClass(node, cls) {\n    var current = node.className;\n    if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n  }\n  function joinClasses(a, b) {\n    var as = a.split(\" \");\n    for (var i = 0; i < as.length; i++)\n      { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n    return b\n  }\n\n  var selectInput = function(node) { node.select(); };\n  if (ios) // Mobile Safari apparently has a bug where select() is broken.\n    { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n  else if (ie) // Suppress mysterious IE10 errors\n    { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n  function bind(f) {\n    var args = Array.prototype.slice.call(arguments, 1);\n    return function(){return f.apply(null, args)}\n  }\n\n  function copyObj(obj, target, overwrite) {\n    if (!target) { target = {}; }\n    for (var prop in obj)\n      { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n        { target[prop] = obj[prop]; } }\n    return target\n  }\n\n  // Counts the column offset in a string, taking tabs into account.\n  // Used mostly to find indentation.\n  function countColumn(string, end, tabSize, startIndex, startValue) {\n    if (end == null) {\n      end = string.search(/[^\\s\\u00a0]/);\n      if (end == -1) { end = string.length; }\n    }\n    for (var i = startIndex || 0, n = startValue || 0;;) {\n      var nextTab = string.indexOf(\"\\t\", i);\n      if (nextTab < 0 || nextTab >= end)\n        { return n + (end - i) }\n      n += nextTab - i;\n      n += tabSize - (n % tabSize);\n      i = nextTab + 1;\n    }\n  }\n\n  var Delayed = function() {this.id = null;};\n  Delayed.prototype.set = function (ms, f) {\n    clearTimeout(this.id);\n    this.id = setTimeout(f, ms);\n  };\n\n  function indexOf(array, elt) {\n    for (var i = 0; i < array.length; ++i)\n      { if (array[i] == elt) { return i } }\n    return -1\n  }\n\n  // Number of pixels added to scroller and sizer to hide scrollbar\n  var scrollerGap = 30;\n\n  // Returned or thrown by various protocols to signal 'I'm not\n  // handling this'.\n  var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n  // Reused option objects for setSelection & friends\n  var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n  // The inverse of countColumn -- find the offset that corresponds to\n  // a particular column.\n  function findColumn(string, goal, tabSize) {\n    for (var pos = 0, col = 0;;) {\n      var nextTab = string.indexOf(\"\\t\", pos);\n      if (nextTab == -1) { nextTab = string.length; }\n      var skipped = nextTab - pos;\n      if (nextTab == string.length || col + skipped >= goal)\n        { return pos + Math.min(skipped, goal - col) }\n      col += nextTab - pos;\n      col += tabSize - (col % tabSize);\n      pos = nextTab + 1;\n      if (col >= goal) { return pos }\n    }\n  }\n\n  var spaceStrs = [\"\"];\n  function spaceStr(n) {\n    while (spaceStrs.length <= n)\n      { spaceStrs.push(lst(spaceStrs) + \" \"); }\n    return spaceStrs[n]\n  }\n\n  function lst(arr) { return arr[arr.length-1] }\n\n  function map(array, f) {\n    var out = [];\n    for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n    return out\n  }\n\n  function insertSorted(array, value, score) {\n    var pos = 0, priority = score(value);\n    while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n    array.splice(pos, 0, value);\n  }\n\n  function nothing() {}\n\n  function createObj(base, props) {\n    var inst;\n    if (Object.create) {\n      inst = Object.create(base);\n    } else {\n      nothing.prototype = base;\n      inst = new nothing();\n    }\n    if (props) { copyObj(props, inst); }\n    return inst\n  }\n\n  var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n  function isWordCharBasic(ch) {\n    return /\\w/.test(ch) || ch > \"\\x80\" &&\n      (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n  }\n  function isWordChar(ch, helper) {\n    if (!helper) { return isWordCharBasic(ch) }\n    if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n    return helper.test(ch)\n  }\n\n  function isEmpty(obj) {\n    for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n    return true\n  }\n\n  // Extending unicode characters. A series of a non-extending char +\n  // any number of extending chars is treated as a single unit as far\n  // as editing and measuring is concerned. This is not fully correct,\n  // since some scripts/fonts/browsers also treat other configurations\n  // of code points as a group.\n  var extendingChars = /[\\u0300-\\u036f\\u0483-\\u0489\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u065e\\u0670\\u06d6-\\u06dc\\u06de-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07eb-\\u07f3\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0900-\\u0902\\u093c\\u0941-\\u0948\\u094d\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09bc\\u09be\\u09c1-\\u09c4\\u09cd\\u09d7\\u09e2\\u09e3\\u0a01\\u0a02\\u0a3c\\u0a41\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a70\\u0a71\\u0a75\\u0a81\\u0a82\\u0abc\\u0ac1-\\u0ac5\\u0ac7\\u0ac8\\u0acd\\u0ae2\\u0ae3\\u0b01\\u0b3c\\u0b3e\\u0b3f\\u0b41-\\u0b44\\u0b4d\\u0b56\\u0b57\\u0b62\\u0b63\\u0b82\\u0bbe\\u0bc0\\u0bcd\\u0bd7\\u0c3e-\\u0c40\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0cbc\\u0cbf\\u0cc2\\u0cc6\\u0ccc\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0d3e\\u0d41-\\u0d44\\u0d4d\\u0d57\\u0d62\\u0d63\\u0dca\\u0dcf\\u0dd2-\\u0dd4\\u0dd6\\u0ddf\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0eb1\\u0eb4-\\u0eb9\\u0ebb\\u0ebc\\u0ec8-\\u0ecd\\u0f18\\u0f19\\u0f35\\u0f37\\u0f39\\u0f71-\\u0f7e\\u0f80-\\u0f84\\u0f86\\u0f87\\u0f90-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102d-\\u1030\\u1032-\\u1037\\u1039\\u103a\\u103d\\u103e\\u1058\\u1059\\u105e-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108d\\u109d\\u135f\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b7-\\u17bd\\u17c6\\u17c9-\\u17d3\\u17dd\\u180b-\\u180d\\u18a9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193b\\u1a17\\u1a18\\u1a56\\u1a58-\\u1a5e\\u1a60\\u1a62\\u1a65-\\u1a6c\\u1a73-\\u1a7c\\u1a7f\\u1b00-\\u1b03\\u1b34\\u1b36-\\u1b3a\\u1b3c\\u1b42\\u1b6b-\\u1b73\\u1b80\\u1b81\\u1ba2-\\u1ba5\\u1ba8\\u1ba9\\u1c2c-\\u1c33\\u1c36\\u1c37\\u1cd0-\\u1cd2\\u1cd4-\\u1ce0\\u1ce2-\\u1ce8\\u1ced\\u1dc0-\\u1de6\\u1dfd-\\u1dff\\u200c\\u200d\\u20d0-\\u20f0\\u2cef-\\u2cf1\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua66f-\\ua672\\ua67c\\ua67d\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua825\\ua826\\ua8c4\\ua8e0-\\ua8f1\\ua926-\\ua92d\\ua947-\\ua951\\ua980-\\ua982\\ua9b3\\ua9b6-\\ua9b9\\ua9bc\\uaa29-\\uaa2e\\uaa31\\uaa32\\uaa35\\uaa36\\uaa43\\uaa4c\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uabe5\\uabe8\\uabed\\udc00-\\udfff\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe26\\uff9e\\uff9f]/;\n  function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n  // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n  function skipExtendingChars(str, pos, dir) {\n    while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n    return pos\n  }\n\n  // Returns the value from the range [`from`; `to`] that satisfies\n  // `pred` and is closest to `from`. Assumes that at least `to`\n  // satisfies `pred`. Supports `from` being greater than `to`.\n  function findFirst(pred, from, to) {\n    // At any point we are certain `to` satisfies `pred`, don't know\n    // whether `from` does.\n    var dir = from > to ? -1 : 1;\n    for (;;) {\n      if (from == to) { return from }\n      var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n      if (mid == from) { return pred(mid) ? from : to }\n      if (pred(mid)) { to = mid; }\n      else { from = mid + dir; }\n    }\n  }\n\n  // BIDI HELPERS\n\n  function iterateBidiSections(order, from, to, f) {\n    if (!order) { return f(from, to, \"ltr\", 0) }\n    var found = false;\n    for (var i = 0; i < order.length; ++i) {\n      var part = order[i];\n      if (part.from < to && part.to > from || from == to && part.to == from) {\n        f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n        found = true;\n      }\n    }\n    if (!found) { f(from, to, \"ltr\"); }\n  }\n\n  var bidiOther = null;\n  function getBidiPartAt(order, ch, sticky) {\n    var found;\n    bidiOther = null;\n    for (var i = 0; i < order.length; ++i) {\n      var cur = order[i];\n      if (cur.from < ch && cur.to > ch) { return i }\n      if (cur.to == ch) {\n        if (cur.from != cur.to && sticky == \"before\") { found = i; }\n        else { bidiOther = i; }\n      }\n      if (cur.from == ch) {\n        if (cur.from != cur.to && sticky != \"before\") { found = i; }\n        else { bidiOther = i; }\n      }\n    }\n    return found != null ? found : bidiOther\n  }\n\n  // Bidirectional ordering algorithm\n  // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n  // that this (partially) implements.\n\n  // One-char codes used for character types:\n  // L (L):   Left-to-Right\n  // R (R):   Right-to-Left\n  // r (AL):  Right-to-Left Arabic\n  // 1 (EN):  European Number\n  // + (ES):  European Number Separator\n  // % (ET):  European Number Terminator\n  // n (AN):  Arabic Number\n  // , (CS):  Common Number Separator\n  // m (NSM): Non-Spacing Mark\n  // b (BN):  Boundary Neutral\n  // s (B):   Paragraph Separator\n  // t (S):   Segment Separator\n  // w (WS):  Whitespace\n  // N (ON):  Other Neutrals\n\n  // Returns null if characters are ordered as they appear\n  // (left-to-right), or an array of sections ({from, to, level}\n  // objects) in the order in which they occur visually.\n  var bidiOrdering = (function() {\n    // Character types for codepoints 0 to 0xff\n    var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n    // Character types for codepoints 0x600 to 0x6f9\n    var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n    function charType(code) {\n      if (code <= 0xf7) { return lowTypes.charAt(code) }\n      else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n      else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n      else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n      else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n      else if (code == 0x200c) { return \"b\" }\n      else { return \"L\" }\n    }\n\n    var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n    var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n    function BidiSpan(level, from, to) {\n      this.level = level;\n      this.from = from; this.to = to;\n    }\n\n    return function(str, direction) {\n      var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n      if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n      var len = str.length, types = [];\n      for (var i = 0; i < len; ++i)\n        { types.push(charType(str.charCodeAt(i))); }\n\n      // W1. Examine each non-spacing mark (NSM) in the level run, and\n      // change the type of the NSM to the type of the previous\n      // character. If the NSM is at the start of the level run, it will\n      // get the type of sor.\n      for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n        var type = types[i$1];\n        if (type == \"m\") { types[i$1] = prev; }\n        else { prev = type; }\n      }\n\n      // W2. Search backwards from each instance of a European number\n      // until the first strong type (R, L, AL, or sor) is found. If an\n      // AL is found, change the type of the European number to Arabic\n      // number.\n      // W3. Change all ALs to R.\n      for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n        var type$1 = types[i$2];\n        if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n        else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n      }\n\n      // W4. A single European separator between two European numbers\n      // changes to a European number. A single common separator between\n      // two numbers of the same type changes to that type.\n      for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n        var type$2 = types[i$3];\n        if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n        else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n                 (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n        prev$1 = type$2;\n      }\n\n      // W5. A sequence of European terminators adjacent to European\n      // numbers changes to all European numbers.\n      // W6. Otherwise, separators and terminators change to Other\n      // Neutral.\n      for (var i$4 = 0; i$4 < len; ++i$4) {\n        var type$3 = types[i$4];\n        if (type$3 == \",\") { types[i$4] = \"N\"; }\n        else if (type$3 == \"%\") {\n          var end = (void 0);\n          for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n          var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n          for (var j = i$4; j < end; ++j) { types[j] = replace; }\n          i$4 = end - 1;\n        }\n      }\n\n      // W7. Search backwards from each instance of a European number\n      // until the first strong type (R, L, or sor) is found. If an L is\n      // found, then change the type of the European number to L.\n      for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n        var type$4 = types[i$5];\n        if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n        else if (isStrong.test(type$4)) { cur$1 = type$4; }\n      }\n\n      // N1. A sequence of neutrals takes the direction of the\n      // surrounding strong text if the text on both sides has the same\n      // direction. European and Arabic numbers act as if they were R in\n      // terms of their influence on neutrals. Start-of-level-run (sor)\n      // and end-of-level-run (eor) are used at level run boundaries.\n      // N2. Any remaining neutrals take the embedding direction.\n      for (var i$6 = 0; i$6 < len; ++i$6) {\n        if (isNeutral.test(types[i$6])) {\n          var end$1 = (void 0);\n          for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n          var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n          var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n          var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n          for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n          i$6 = end$1 - 1;\n        }\n      }\n\n      // Here we depart from the documented algorithm, in order to avoid\n      // building up an actual levels array. Since there are only three\n      // levels (0, 1, 2) in an implementation that doesn't take\n      // explicit embedding into account, we can build up the order on\n      // the fly, without following the level-based algorithm.\n      var order = [], m;\n      for (var i$7 = 0; i$7 < len;) {\n        if (countsAsLeft.test(types[i$7])) {\n          var start = i$7;\n          for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n          order.push(new BidiSpan(0, start, i$7));\n        } else {\n          var pos = i$7, at = order.length;\n          for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n          for (var j$2 = pos; j$2 < i$7;) {\n            if (countsAsNum.test(types[j$2])) {\n              if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); }\n              var nstart = j$2;\n              for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n              order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n              pos = j$2;\n            } else { ++j$2; }\n          }\n          if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n        }\n      }\n      if (direction == \"ltr\") {\n        if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n          order[0].from = m[0].length;\n          order.unshift(new BidiSpan(0, 0, m[0].length));\n        }\n        if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n          lst(order).to -= m[0].length;\n          order.push(new BidiSpan(0, len - m[0].length, len));\n        }\n      }\n\n      return direction == \"rtl\" ? order.reverse() : order\n    }\n  })();\n\n  // Get the bidi ordering for the given line (and cache it). Returns\n  // false for lines that are fully left-to-right, and an array of\n  // BidiSpan objects otherwise.\n  function getOrder(line, direction) {\n    var order = line.order;\n    if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n    return order\n  }\n\n  // EVENT HANDLING\n\n  // Lightweight event framework. on/off also work on DOM nodes,\n  // registering native DOM handlers.\n\n  var noHandlers = [];\n\n  var on = function(emitter, type, f) {\n    if (emitter.addEventListener) {\n      emitter.addEventListener(type, f, false);\n    } else if (emitter.attachEvent) {\n      emitter.attachEvent(\"on\" + type, f);\n    } else {\n      var map$$1 = emitter._handlers || (emitter._handlers = {});\n      map$$1[type] = (map$$1[type] || noHandlers).concat(f);\n    }\n  };\n\n  function getHandlers(emitter, type) {\n    return emitter._handlers && emitter._handlers[type] || noHandlers\n  }\n\n  function off(emitter, type, f) {\n    if (emitter.removeEventListener) {\n      emitter.removeEventListener(type, f, false);\n    } else if (emitter.detachEvent) {\n      emitter.detachEvent(\"on\" + type, f);\n    } else {\n      var map$$1 = emitter._handlers, arr = map$$1 && map$$1[type];\n      if (arr) {\n        var index = indexOf(arr, f);\n        if (index > -1)\n          { map$$1[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n      }\n    }\n  }\n\n  function signal(emitter, type /*, values...*/) {\n    var handlers = getHandlers(emitter, type);\n    if (!handlers.length) { return }\n    var args = Array.prototype.slice.call(arguments, 2);\n    for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n  }\n\n  // The DOM events that CodeMirror handles can be overridden by\n  // registering a (non-DOM) handler on the editor for the event name,\n  // and preventDefault-ing the event in that handler.\n  function signalDOMEvent(cm, e, override) {\n    if (typeof e == \"string\")\n      { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n    signal(cm, override || e.type, cm, e);\n    return e_defaultPrevented(e) || e.codemirrorIgnore\n  }\n\n  function signalCursorActivity(cm) {\n    var arr = cm._handlers && cm._handlers.cursorActivity;\n    if (!arr) { return }\n    var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n    for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n      { set.push(arr[i]); } }\n  }\n\n  function hasHandler(emitter, type) {\n    return getHandlers(emitter, type).length > 0\n  }\n\n  // Add on and off methods to a constructor's prototype, to make\n  // registering events on such objects more convenient.\n  function eventMixin(ctor) {\n    ctor.prototype.on = function(type, f) {on(this, type, f);};\n    ctor.prototype.off = function(type, f) {off(this, type, f);};\n  }\n\n  // Due to the fact that we still support jurassic IE versions, some\n  // compatibility wrappers are needed.\n\n  function e_preventDefault(e) {\n    if (e.preventDefault) { e.preventDefault(); }\n    else { e.returnValue = false; }\n  }\n  function e_stopPropagation(e) {\n    if (e.stopPropagation) { e.stopPropagation(); }\n    else { e.cancelBubble = true; }\n  }\n  function e_defaultPrevented(e) {\n    return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n  }\n  function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n  function e_target(e) {return e.target || e.srcElement}\n  function e_button(e) {\n    var b = e.which;\n    if (b == null) {\n      if (e.button & 1) { b = 1; }\n      else if (e.button & 2) { b = 3; }\n      else if (e.button & 4) { b = 2; }\n    }\n    if (mac && e.ctrlKey && b == 1) { b = 3; }\n    return b\n  }\n\n  // Detect drag-and-drop\n  var dragAndDrop = function() {\n    // There is *some* kind of drag-and-drop support in IE6-8, but I\n    // couldn't get it to work yet.\n    if (ie && ie_version < 9) { return false }\n    var div = elt('div');\n    return \"draggable\" in div || \"dragDrop\" in div\n  }();\n\n  var zwspSupported;\n  function zeroWidthElement(measure) {\n    if (zwspSupported == null) {\n      var test = elt(\"span\", \"\\u200b\");\n      removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n      if (measure.firstChild.offsetHeight != 0)\n        { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n    }\n    var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n      elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n    node.setAttribute(\"cm-text\", \"\");\n    return node\n  }\n\n  // Feature-detect IE's crummy client rect reporting for bidi text\n  var badBidiRects;\n  function hasBadBidiRects(measure) {\n    if (badBidiRects != null) { return badBidiRects }\n    var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n    var r0 = range(txt, 0, 1).getBoundingClientRect();\n    var r1 = range(txt, 1, 2).getBoundingClientRect();\n    removeChildren(measure);\n    if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n    return badBidiRects = (r1.right - r0.right < 3)\n  }\n\n  // See if \"\".split is the broken IE version, if so, provide an\n  // alternative way to split lines.\n  var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n    var pos = 0, result = [], l = string.length;\n    while (pos <= l) {\n      var nl = string.indexOf(\"\\n\", pos);\n      if (nl == -1) { nl = string.length; }\n      var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n      var rt = line.indexOf(\"\\r\");\n      if (rt != -1) {\n        result.push(line.slice(0, rt));\n        pos += rt + 1;\n      } else {\n        result.push(line);\n        pos = nl + 1;\n      }\n    }\n    return result\n  } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n  var hasSelection = window.getSelection ? function (te) {\n    try { return te.selectionStart != te.selectionEnd }\n    catch(e) { return false }\n  } : function (te) {\n    var range$$1;\n    try {range$$1 = te.ownerDocument.selection.createRange();}\n    catch(e) {}\n    if (!range$$1 || range$$1.parentElement() != te) { return false }\n    return range$$1.compareEndPoints(\"StartToEnd\", range$$1) != 0\n  };\n\n  var hasCopyEvent = (function () {\n    var e = elt(\"div\");\n    if (\"oncopy\" in e) { return true }\n    e.setAttribute(\"oncopy\", \"return;\");\n    return typeof e.oncopy == \"function\"\n  })();\n\n  var badZoomedRects = null;\n  function hasBadZoomedRects(measure) {\n    if (badZoomedRects != null) { return badZoomedRects }\n    var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n    var normal = node.getBoundingClientRect();\n    var fromRange = range(node, 0, 1).getBoundingClientRect();\n    return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n  }\n\n  // Known modes, by name and by MIME\n  var modes = {}, mimeModes = {};\n\n  // Extra arguments are stored as the mode's dependencies, which is\n  // used by (legacy) mechanisms like loadmode.js to automatically\n  // load a mode. (Preferred mechanism is the require/define calls.)\n  function defineMode(name, mode) {\n    if (arguments.length > 2)\n      { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n    modes[name] = mode;\n  }\n\n  function defineMIME(mime, spec) {\n    mimeModes[mime] = spec;\n  }\n\n  // Given a MIME type, a {name, ...options} config object, or a name\n  // string, return a mode config object.\n  function resolveMode(spec) {\n    if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n      spec = mimeModes[spec];\n    } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n      var found = mimeModes[spec.name];\n      if (typeof found == \"string\") { found = {name: found}; }\n      spec = createObj(found, spec);\n      spec.name = found.name;\n    } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n      return resolveMode(\"application/xml\")\n    } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n      return resolveMode(\"application/json\")\n    }\n    if (typeof spec == \"string\") { return {name: spec} }\n    else { return spec || {name: \"null\"} }\n  }\n\n  // Given a mode spec (anything that resolveMode accepts), find and\n  // initialize an actual mode object.\n  function getMode(options, spec) {\n    spec = resolveMode(spec);\n    var mfactory = modes[spec.name];\n    if (!mfactory) { return getMode(options, \"text/plain\") }\n    var modeObj = mfactory(options, spec);\n    if (modeExtensions.hasOwnProperty(spec.name)) {\n      var exts = modeExtensions[spec.name];\n      for (var prop in exts) {\n        if (!exts.hasOwnProperty(prop)) { continue }\n        if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n        modeObj[prop] = exts[prop];\n      }\n    }\n    modeObj.name = spec.name;\n    if (spec.helperType) { modeObj.helperType = spec.helperType; }\n    if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n      { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n    return modeObj\n  }\n\n  // This can be used to attach properties to mode objects from\n  // outside the actual mode definition.\n  var modeExtensions = {};\n  function extendMode(mode, properties) {\n    var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n    copyObj(properties, exts);\n  }\n\n  function copyState(mode, state) {\n    if (state === true) { return state }\n    if (mode.copyState) { return mode.copyState(state) }\n    var nstate = {};\n    for (var n in state) {\n      var val = state[n];\n      if (val instanceof Array) { val = val.concat([]); }\n      nstate[n] = val;\n    }\n    return nstate\n  }\n\n  // Given a mode and a state (for that mode), find the inner mode and\n  // state at the position that the state refers to.\n  function innerMode(mode, state) {\n    var info;\n    while (mode.innerMode) {\n      info = mode.innerMode(state);\n      if (!info || info.mode == mode) { break }\n      state = info.state;\n      mode = info.mode;\n    }\n    return info || {mode: mode, state: state}\n  }\n\n  function startState(mode, a1, a2) {\n    return mode.startState ? mode.startState(a1, a2) : true\n  }\n\n  // STRING STREAM\n\n  // Fed to the mode parsers, provides helper functions to make\n  // parsers more succinct.\n\n  var StringStream = function(string, tabSize, lineOracle) {\n    this.pos = this.start = 0;\n    this.string = string;\n    this.tabSize = tabSize || 8;\n    this.lastColumnPos = this.lastColumnValue = 0;\n    this.lineStart = 0;\n    this.lineOracle = lineOracle;\n  };\n\n  StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n  StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n  StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n  StringStream.prototype.next = function () {\n    if (this.pos < this.string.length)\n      { return this.string.charAt(this.pos++) }\n  };\n  StringStream.prototype.eat = function (match) {\n    var ch = this.string.charAt(this.pos);\n    var ok;\n    if (typeof match == \"string\") { ok = ch == match; }\n    else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n    if (ok) {++this.pos; return ch}\n  };\n  StringStream.prototype.eatWhile = function (match) {\n    var start = this.pos;\n    while (this.eat(match)){}\n    return this.pos > start\n  };\n  StringStream.prototype.eatSpace = function () {\n      var this$1 = this;\n\n    var start = this.pos;\n    while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos; }\n    return this.pos > start\n  };\n  StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n  StringStream.prototype.skipTo = function (ch) {\n    var found = this.string.indexOf(ch, this.pos);\n    if (found > -1) {this.pos = found; return true}\n  };\n  StringStream.prototype.backUp = function (n) {this.pos -= n;};\n  StringStream.prototype.column = function () {\n    if (this.lastColumnPos < this.start) {\n      this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n      this.lastColumnPos = this.start;\n    }\n    return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n  };\n  StringStream.prototype.indentation = function () {\n    return countColumn(this.string, null, this.tabSize) -\n      (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n  };\n  StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n    if (typeof pattern == \"string\") {\n      var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n      var substr = this.string.substr(this.pos, pattern.length);\n      if (cased(substr) == cased(pattern)) {\n        if (consume !== false) { this.pos += pattern.length; }\n        return true\n      }\n    } else {\n      var match = this.string.slice(this.pos).match(pattern);\n      if (match && match.index > 0) { return null }\n      if (match && consume !== false) { this.pos += match[0].length; }\n      return match\n    }\n  };\n  StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n  StringStream.prototype.hideFirstChars = function (n, inner) {\n    this.lineStart += n;\n    try { return inner() }\n    finally { this.lineStart -= n; }\n  };\n  StringStream.prototype.lookAhead = function (n) {\n    var oracle = this.lineOracle;\n    return oracle && oracle.lookAhead(n)\n  };\n  StringStream.prototype.baseToken = function () {\n    var oracle = this.lineOracle;\n    return oracle && oracle.baseToken(this.pos)\n  };\n\n  // Find the line object corresponding to the given line number.\n  function getLine(doc, n) {\n    n -= doc.first;\n    if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n    var chunk = doc;\n    while (!chunk.lines) {\n      for (var i = 0;; ++i) {\n        var child = chunk.children[i], sz = child.chunkSize();\n        if (n < sz) { chunk = child; break }\n        n -= sz;\n      }\n    }\n    return chunk.lines[n]\n  }\n\n  // Get the part of a document between two positions, as an array of\n  // strings.\n  function getBetween(doc, start, end) {\n    var out = [], n = start.line;\n    doc.iter(start.line, end.line + 1, function (line) {\n      var text = line.text;\n      if (n == end.line) { text = text.slice(0, end.ch); }\n      if (n == start.line) { text = text.slice(start.ch); }\n      out.push(text);\n      ++n;\n    });\n    return out\n  }\n  // Get the lines between from and to, as array of strings.\n  function getLines(doc, from, to) {\n    var out = [];\n    doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n    return out\n  }\n\n  // Update the height of a line, propagating the height change\n  // upwards to parent nodes.\n  function updateLineHeight(line, height) {\n    var diff = height - line.height;\n    if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n  }\n\n  // Given a line object, find its line number by walking up through\n  // its parent links.\n  function lineNo(line) {\n    if (line.parent == null) { return null }\n    var cur = line.parent, no = indexOf(cur.lines, line);\n    for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n      for (var i = 0;; ++i) {\n        if (chunk.children[i] == cur) { break }\n        no += chunk.children[i].chunkSize();\n      }\n    }\n    return no + cur.first\n  }\n\n  // Find the line at the given vertical position, using the height\n  // information in the document tree.\n  function lineAtHeight(chunk, h) {\n    var n = chunk.first;\n    outer: do {\n      for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n        var child = chunk.children[i$1], ch = child.height;\n        if (h < ch) { chunk = child; continue outer }\n        h -= ch;\n        n += child.chunkSize();\n      }\n      return n\n    } while (!chunk.lines)\n    var i = 0;\n    for (; i < chunk.lines.length; ++i) {\n      var line = chunk.lines[i], lh = line.height;\n      if (h < lh) { break }\n      h -= lh;\n    }\n    return n + i\n  }\n\n  function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n  function lineNumberFor(options, i) {\n    return String(options.lineNumberFormatter(i + options.firstLineNumber))\n  }\n\n  // A Pos instance represents a position within the text.\n  function Pos(line, ch, sticky) {\n    if ( sticky === void 0 ) sticky = null;\n\n    if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n    this.line = line;\n    this.ch = ch;\n    this.sticky = sticky;\n  }\n\n  // Compare two positions, return 0 if they are the same, a negative\n  // number when a is less, and a positive number otherwise.\n  function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n  function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n  function copyPos(x) {return Pos(x.line, x.ch)}\n  function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n  function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n  // Most of the external API clips given positions to make sure they\n  // actually exist within the document.\n  function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n  function clipPos(doc, pos) {\n    if (pos.line < doc.first) { return Pos(doc.first, 0) }\n    var last = doc.first + doc.size - 1;\n    if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n    return clipToLen(pos, getLine(doc, pos.line).text.length)\n  }\n  function clipToLen(pos, linelen) {\n    var ch = pos.ch;\n    if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n    else if (ch < 0) { return Pos(pos.line, 0) }\n    else { return pos }\n  }\n  function clipPosArray(doc, array) {\n    var out = [];\n    for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n    return out\n  }\n\n  var SavedContext = function(state, lookAhead) {\n    this.state = state;\n    this.lookAhead = lookAhead;\n  };\n\n  var Context = function(doc, state, line, lookAhead) {\n    this.state = state;\n    this.doc = doc;\n    this.line = line;\n    this.maxLookAhead = lookAhead || 0;\n    this.baseTokens = null;\n    this.baseTokenPos = 1;\n  };\n\n  Context.prototype.lookAhead = function (n) {\n    var line = this.doc.getLine(this.line + n);\n    if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n    return line\n  };\n\n  Context.prototype.baseToken = function (n) {\n      var this$1 = this;\n\n    if (!this.baseTokens) { return null }\n    while (this.baseTokens[this.baseTokenPos] <= n)\n      { this$1.baseTokenPos += 2; }\n    var type = this.baseTokens[this.baseTokenPos + 1];\n    return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n            size: this.baseTokens[this.baseTokenPos] - n}\n  };\n\n  Context.prototype.nextLine = function () {\n    this.line++;\n    if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n  };\n\n  Context.fromSaved = function (doc, saved, line) {\n    if (saved instanceof SavedContext)\n      { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n    else\n      { return new Context(doc, copyState(doc.mode, saved), line) }\n  };\n\n  Context.prototype.save = function (copy) {\n    var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n    return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n  };\n\n\n  // Compute a style array (an array starting with a mode generation\n  // -- for invalidation -- followed by pairs of end positions and\n  // style strings), which is used to highlight the tokens on the\n  // line.\n  function highlightLine(cm, line, context, forceToEnd) {\n    // A styles array always starts with a number identifying the\n    // mode/overlays that it is based on (for easy invalidation).\n    var st = [cm.state.modeGen], lineClasses = {};\n    // Compute the base array of styles\n    runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n            lineClasses, forceToEnd);\n    var state = context.state;\n\n    // Run overlays, adjust style array.\n    var loop = function ( o ) {\n      context.baseTokens = st;\n      var overlay = cm.state.overlays[o], i = 1, at = 0;\n      context.state = true;\n      runMode(cm, line.text, overlay.mode, context, function (end, style) {\n        var start = i;\n        // Ensure there's a token end at the current position, and that i points at it\n        while (at < end) {\n          var i_end = st[i];\n          if (i_end > end)\n            { st.splice(i, 1, end, st[i+1], i_end); }\n          i += 2;\n          at = Math.min(end, i_end);\n        }\n        if (!style) { return }\n        if (overlay.opaque) {\n          st.splice(start, i - start, end, \"overlay \" + style);\n          i = start + 2;\n        } else {\n          for (; start < i; start += 2) {\n            var cur = st[start+1];\n            st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n          }\n        }\n      }, lineClasses);\n      context.state = state;\n      context.baseTokens = null;\n      context.baseTokenPos = 1;\n    };\n\n    for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n    return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n  }\n\n  function getLineStyles(cm, line, updateFrontier) {\n    if (!line.styles || line.styles[0] != cm.state.modeGen) {\n      var context = getContextBefore(cm, lineNo(line));\n      var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n      var result = highlightLine(cm, line, context);\n      if (resetState) { context.state = resetState; }\n      line.stateAfter = context.save(!resetState);\n      line.styles = result.styles;\n      if (result.classes) { line.styleClasses = result.classes; }\n      else if (line.styleClasses) { line.styleClasses = null; }\n      if (updateFrontier === cm.doc.highlightFrontier)\n        { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n    }\n    return line.styles\n  }\n\n  function getContextBefore(cm, n, precise) {\n    var doc = cm.doc, display = cm.display;\n    if (!doc.mode.startState) { return new Context(doc, true, n) }\n    var start = findStartLine(cm, n, precise);\n    var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n    var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n    doc.iter(start, n, function (line) {\n      processLine(cm, line.text, context);\n      var pos = context.line;\n      line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n      context.nextLine();\n    });\n    if (precise) { doc.modeFrontier = context.line; }\n    return context\n  }\n\n  // Lightweight form of highlight -- proceed over this line and\n  // update state, but don't save a style array. Used for lines that\n  // aren't currently visible.\n  function processLine(cm, text, context, startAt) {\n    var mode = cm.doc.mode;\n    var stream = new StringStream(text, cm.options.tabSize, context);\n    stream.start = stream.pos = startAt || 0;\n    if (text == \"\") { callBlankLine(mode, context.state); }\n    while (!stream.eol()) {\n      readToken(mode, stream, context.state);\n      stream.start = stream.pos;\n    }\n  }\n\n  function callBlankLine(mode, state) {\n    if (mode.blankLine) { return mode.blankLine(state) }\n    if (!mode.innerMode) { return }\n    var inner = innerMode(mode, state);\n    if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n  }\n\n  function readToken(mode, stream, state, inner) {\n    for (var i = 0; i < 10; i++) {\n      if (inner) { inner[0] = innerMode(mode, state).mode; }\n      var style = mode.token(stream, state);\n      if (stream.pos > stream.start) { return style }\n    }\n    throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n  }\n\n  var Token = function(stream, type, state) {\n    this.start = stream.start; this.end = stream.pos;\n    this.string = stream.current();\n    this.type = type || null;\n    this.state = state;\n  };\n\n  // Utility for getTokenAt and getLineTokens\n  function takeToken(cm, pos, precise, asArray) {\n    var doc = cm.doc, mode = doc.mode, style;\n    pos = clipPos(doc, pos);\n    var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n    var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n    if (asArray) { tokens = []; }\n    while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n      stream.start = stream.pos;\n      style = readToken(mode, stream, context.state);\n      if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n    }\n    return asArray ? tokens : new Token(stream, style, context.state)\n  }\n\n  function extractLineClasses(type, output) {\n    if (type) { for (;;) {\n      var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n      if (!lineClass) { break }\n      type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n      var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n      if (output[prop] == null)\n        { output[prop] = lineClass[2]; }\n      else if (!(new RegExp(\"(?:^|\\s)\" + lineClass[2] + \"(?:$|\\s)\")).test(output[prop]))\n        { output[prop] += \" \" + lineClass[2]; }\n    } }\n    return type\n  }\n\n  // Run the given mode's parser over a line, calling f for each token.\n  function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n    var flattenSpans = mode.flattenSpans;\n    if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n    var curStart = 0, curStyle = null;\n    var stream = new StringStream(text, cm.options.tabSize, context), style;\n    var inner = cm.options.addModeClass && [null];\n    if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n    while (!stream.eol()) {\n      if (stream.pos > cm.options.maxHighlightLength) {\n        flattenSpans = false;\n        if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n        stream.pos = text.length;\n        style = null;\n      } else {\n        style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n      }\n      if (inner) {\n        var mName = inner[0].name;\n        if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n      }\n      if (!flattenSpans || curStyle != style) {\n        while (curStart < stream.start) {\n          curStart = Math.min(stream.start, curStart + 5000);\n          f(curStart, curStyle);\n        }\n        curStyle = style;\n      }\n      stream.start = stream.pos;\n    }\n    while (curStart < stream.pos) {\n      // Webkit seems to refuse to render text nodes longer than 57444\n      // characters, and returns inaccurate measurements in nodes\n      // starting around 5000 chars.\n      var pos = Math.min(stream.pos, curStart + 5000);\n      f(pos, curStyle);\n      curStart = pos;\n    }\n  }\n\n  // Finds the line to start with when starting a parse. Tries to\n  // find a line with a stateAfter, so that it can start with a\n  // valid state. If that fails, it returns the line with the\n  // smallest indentation, which tends to need the least context to\n  // parse correctly.\n  function findStartLine(cm, n, precise) {\n    var minindent, minline, doc = cm.doc;\n    var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n    for (var search = n; search > lim; --search) {\n      if (search <= doc.first) { return doc.first }\n      var line = getLine(doc, search - 1), after = line.stateAfter;\n      if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n        { return search }\n      var indented = countColumn(line.text, null, cm.options.tabSize);\n      if (minline == null || minindent > indented) {\n        minline = search - 1;\n        minindent = indented;\n      }\n    }\n    return minline\n  }\n\n  function retreatFrontier(doc, n) {\n    doc.modeFrontier = Math.min(doc.modeFrontier, n);\n    if (doc.highlightFrontier < n - 10) { return }\n    var start = doc.first;\n    for (var line = n - 1; line > start; line--) {\n      var saved = getLine(doc, line).stateAfter;\n      // change is on 3\n      // state on line 1 looked ahead 2 -- so saw 3\n      // test 1 + 2 < 3 should cover this\n      if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n        start = line + 1;\n        break\n      }\n    }\n    doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n  }\n\n  // Optimize some code when these features are not used.\n  var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n  function seeReadOnlySpans() {\n    sawReadOnlySpans = true;\n  }\n\n  function seeCollapsedSpans() {\n    sawCollapsedSpans = true;\n  }\n\n  // TEXTMARKER SPANS\n\n  function MarkedSpan(marker, from, to) {\n    this.marker = marker;\n    this.from = from; this.to = to;\n  }\n\n  // Search an array of spans for a span matching the given marker.\n  function getMarkedSpanFor(spans, marker) {\n    if (spans) { for (var i = 0; i < spans.length; ++i) {\n      var span = spans[i];\n      if (span.marker == marker) { return span }\n    } }\n  }\n  // Remove a span from an array, returning undefined if no spans are\n  // left (we don't store arrays for lines without spans).\n  function removeMarkedSpan(spans, span) {\n    var r;\n    for (var i = 0; i < spans.length; ++i)\n      { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n    return r\n  }\n  // Add a span to a line.\n  function addMarkedSpan(line, span) {\n    line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n    span.marker.attachLine(line);\n  }\n\n  // Used for the algorithm that adjusts markers for a change in the\n  // document. These functions cut an array of spans at a given\n  // character position, returning an array of remaining chunks (or\n  // undefined if nothing remains).\n  function markedSpansBefore(old, startCh, isInsert) {\n    var nw;\n    if (old) { for (var i = 0; i < old.length; ++i) {\n      var span = old[i], marker = span.marker;\n      var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n      if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n        var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n        ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n      }\n    } }\n    return nw\n  }\n  function markedSpansAfter(old, endCh, isInsert) {\n    var nw;\n    if (old) { for (var i = 0; i < old.length; ++i) {\n      var span = old[i], marker = span.marker;\n      var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n      if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n        var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n        ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n                                              span.to == null ? null : span.to - endCh));\n      }\n    } }\n    return nw\n  }\n\n  // Given a change object, compute the new set of marker spans that\n  // cover the line in which the change took place. Removes spans\n  // entirely within the change, reconnects spans belonging to the\n  // same marker that appear on both sides of the change, and cuts off\n  // spans partially within the change. Returns an array of span\n  // arrays with one element for each line in (after) the change.\n  function stretchSpansOverChange(doc, change) {\n    if (change.full) { return null }\n    var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n    var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n    if (!oldFirst && !oldLast) { return null }\n\n    var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n    // Get the spans that 'stick out' on both sides\n    var first = markedSpansBefore(oldFirst, startCh, isInsert);\n    var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n    // Next, merge those two ends\n    var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n    if (first) {\n      // Fix up .to properties of first\n      for (var i = 0; i < first.length; ++i) {\n        var span = first[i];\n        if (span.to == null) {\n          var found = getMarkedSpanFor(last, span.marker);\n          if (!found) { span.to = startCh; }\n          else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n        }\n      }\n    }\n    if (last) {\n      // Fix up .from in last (or move them into first in case of sameLine)\n      for (var i$1 = 0; i$1 < last.length; ++i$1) {\n        var span$1 = last[i$1];\n        if (span$1.to != null) { span$1.to += offset; }\n        if (span$1.from == null) {\n          var found$1 = getMarkedSpanFor(first, span$1.marker);\n          if (!found$1) {\n            span$1.from = offset;\n            if (sameLine) { (first || (first = [])).push(span$1); }\n          }\n        } else {\n          span$1.from += offset;\n          if (sameLine) { (first || (first = [])).push(span$1); }\n        }\n      }\n    }\n    // Make sure we didn't create any zero-length spans\n    if (first) { first = clearEmptySpans(first); }\n    if (last && last != first) { last = clearEmptySpans(last); }\n\n    var newMarkers = [first];\n    if (!sameLine) {\n      // Fill gap with whole-line-spans\n      var gap = change.text.length - 2, gapMarkers;\n      if (gap > 0 && first)\n        { for (var i$2 = 0; i$2 < first.length; ++i$2)\n          { if (first[i$2].to == null)\n            { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n      for (var i$3 = 0; i$3 < gap; ++i$3)\n        { newMarkers.push(gapMarkers); }\n      newMarkers.push(last);\n    }\n    return newMarkers\n  }\n\n  // Remove spans that are empty and don't have a clearWhenEmpty\n  // option of false.\n  function clearEmptySpans(spans) {\n    for (var i = 0; i < spans.length; ++i) {\n      var span = spans[i];\n      if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n        { spans.splice(i--, 1); }\n    }\n    if (!spans.length) { return null }\n    return spans\n  }\n\n  // Used to 'clip' out readOnly ranges when making a change.\n  function removeReadOnlyRanges(doc, from, to) {\n    var markers = null;\n    doc.iter(from.line, to.line + 1, function (line) {\n      if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n        var mark = line.markedSpans[i].marker;\n        if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n          { (markers || (markers = [])).push(mark); }\n      } }\n    });\n    if (!markers) { return null }\n    var parts = [{from: from, to: to}];\n    for (var i = 0; i < markers.length; ++i) {\n      var mk = markers[i], m = mk.find(0);\n      for (var j = 0; j < parts.length; ++j) {\n        var p = parts[j];\n        if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n        var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n        if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n          { newParts.push({from: p.from, to: m.from}); }\n        if (dto > 0 || !mk.inclusiveRight && !dto)\n          { newParts.push({from: m.to, to: p.to}); }\n        parts.splice.apply(parts, newParts);\n        j += newParts.length - 3;\n      }\n    }\n    return parts\n  }\n\n  // Connect or disconnect spans from a line.\n  function detachMarkedSpans(line) {\n    var spans = line.markedSpans;\n    if (!spans) { return }\n    for (var i = 0; i < spans.length; ++i)\n      { spans[i].marker.detachLine(line); }\n    line.markedSpans = null;\n  }\n  function attachMarkedSpans(line, spans) {\n    if (!spans) { return }\n    for (var i = 0; i < spans.length; ++i)\n      { spans[i].marker.attachLine(line); }\n    line.markedSpans = spans;\n  }\n\n  // Helpers used when computing which overlapping collapsed span\n  // counts as the larger one.\n  function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n  function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n  // Returns a number indicating which of two overlapping collapsed\n  // spans is larger (and thus includes the other). Falls back to\n  // comparing ids when the spans cover exactly the same range.\n  function compareCollapsedMarkers(a, b) {\n    var lenDiff = a.lines.length - b.lines.length;\n    if (lenDiff != 0) { return lenDiff }\n    var aPos = a.find(), bPos = b.find();\n    var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n    if (fromCmp) { return -fromCmp }\n    var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n    if (toCmp) { return toCmp }\n    return b.id - a.id\n  }\n\n  // Find out whether a line ends or starts in a collapsed span. If\n  // so, return the marker for that span.\n  function collapsedSpanAtSide(line, start) {\n    var sps = sawCollapsedSpans && line.markedSpans, found;\n    if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n      sp = sps[i];\n      if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n          (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n        { found = sp.marker; }\n    } }\n    return found\n  }\n  function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n  function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n  function collapsedSpanAround(line, ch) {\n    var sps = sawCollapsedSpans && line.markedSpans, found;\n    if (sps) { for (var i = 0; i < sps.length; ++i) {\n      var sp = sps[i];\n      if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n          (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n    } }\n    return found\n  }\n\n  // Test whether there exists a collapsed span that partially\n  // overlaps (covers the start or end, but not both) of a new span.\n  // Such overlap is not allowed.\n  function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n    var line = getLine(doc, lineNo$$1);\n    var sps = sawCollapsedSpans && line.markedSpans;\n    if (sps) { for (var i = 0; i < sps.length; ++i) {\n      var sp = sps[i];\n      if (!sp.marker.collapsed) { continue }\n      var found = sp.marker.find(0);\n      var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n      var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n      if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n      if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n          fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n        { return true }\n    } }\n  }\n\n  // A visual line is a line as drawn on the screen. Folding, for\n  // example, can cause multiple logical lines to appear on the same\n  // visual line. This finds the start of the visual line that the\n  // given line is part of (usually that is the line itself).\n  function visualLine(line) {\n    var merged;\n    while (merged = collapsedSpanAtStart(line))\n      { line = merged.find(-1, true).line; }\n    return line\n  }\n\n  function visualLineEnd(line) {\n    var merged;\n    while (merged = collapsedSpanAtEnd(line))\n      { line = merged.find(1, true).line; }\n    return line\n  }\n\n  // Returns an array of logical lines that continue the visual line\n  // started by the argument, or undefined if there are no such lines.\n  function visualLineContinued(line) {\n    var merged, lines;\n    while (merged = collapsedSpanAtEnd(line)) {\n      line = merged.find(1, true).line\n      ;(lines || (lines = [])).push(line);\n    }\n    return lines\n  }\n\n  // Get the line number of the start of the visual line that the\n  // given line number is part of.\n  function visualLineNo(doc, lineN) {\n    var line = getLine(doc, lineN), vis = visualLine(line);\n    if (line == vis) { return lineN }\n    return lineNo(vis)\n  }\n\n  // Get the line number of the start of the next visual line after\n  // the given line.\n  function visualLineEndNo(doc, lineN) {\n    if (lineN > doc.lastLine()) { return lineN }\n    var line = getLine(doc, lineN), merged;\n    if (!lineIsHidden(doc, line)) { return lineN }\n    while (merged = collapsedSpanAtEnd(line))\n      { line = merged.find(1, true).line; }\n    return lineNo(line) + 1\n  }\n\n  // Compute whether a line is hidden. Lines count as hidden when they\n  // are part of a visual line that starts with another line, or when\n  // they are entirely covered by collapsed, non-widget span.\n  function lineIsHidden(doc, line) {\n    var sps = sawCollapsedSpans && line.markedSpans;\n    if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n      sp = sps[i];\n      if (!sp.marker.collapsed) { continue }\n      if (sp.from == null) { return true }\n      if (sp.marker.widgetNode) { continue }\n      if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n        { return true }\n    } }\n  }\n  function lineIsHiddenInner(doc, line, span) {\n    if (span.to == null) {\n      var end = span.marker.find(1, true);\n      return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n    }\n    if (span.marker.inclusiveRight && span.to == line.text.length)\n      { return true }\n    for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n      sp = line.markedSpans[i];\n      if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n          (sp.to == null || sp.to != span.from) &&\n          (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n          lineIsHiddenInner(doc, line, sp)) { return true }\n    }\n  }\n\n  // Find the height above the given line.\n  function heightAtLine(lineObj) {\n    lineObj = visualLine(lineObj);\n\n    var h = 0, chunk = lineObj.parent;\n    for (var i = 0; i < chunk.lines.length; ++i) {\n      var line = chunk.lines[i];\n      if (line == lineObj) { break }\n      else { h += line.height; }\n    }\n    for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n      for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n        var cur = p.children[i$1];\n        if (cur == chunk) { break }\n        else { h += cur.height; }\n      }\n    }\n    return h\n  }\n\n  // Compute the character length of a line, taking into account\n  // collapsed ranges (see markText) that might hide parts, and join\n  // other lines onto it.\n  function lineLength(line) {\n    if (line.height == 0) { return 0 }\n    var len = line.text.length, merged, cur = line;\n    while (merged = collapsedSpanAtStart(cur)) {\n      var found = merged.find(0, true);\n      cur = found.from.line;\n      len += found.from.ch - found.to.ch;\n    }\n    cur = line;\n    while (merged = collapsedSpanAtEnd(cur)) {\n      var found$1 = merged.find(0, true);\n      len -= cur.text.length - found$1.from.ch;\n      cur = found$1.to.line;\n      len += cur.text.length - found$1.to.ch;\n    }\n    return len\n  }\n\n  // Find the longest line in the document.\n  function findMaxLine(cm) {\n    var d = cm.display, doc = cm.doc;\n    d.maxLine = getLine(doc, doc.first);\n    d.maxLineLength = lineLength(d.maxLine);\n    d.maxLineChanged = true;\n    doc.iter(function (line) {\n      var len = lineLength(line);\n      if (len > d.maxLineLength) {\n        d.maxLineLength = len;\n        d.maxLine = line;\n      }\n    });\n  }\n\n  // LINE DATA STRUCTURE\n\n  // Line objects. These hold state related to a line, including\n  // highlighting info (the styles array).\n  var Line = function(text, markedSpans, estimateHeight) {\n    this.text = text;\n    attachMarkedSpans(this, markedSpans);\n    this.height = estimateHeight ? estimateHeight(this) : 1;\n  };\n\n  Line.prototype.lineNo = function () { return lineNo(this) };\n  eventMixin(Line);\n\n  // Change the content (text, markers) of a line. Automatically\n  // invalidates cached information and tries to re-estimate the\n  // line's height.\n  function updateLine(line, text, markedSpans, estimateHeight) {\n    line.text = text;\n    if (line.stateAfter) { line.stateAfter = null; }\n    if (line.styles) { line.styles = null; }\n    if (line.order != null) { line.order = null; }\n    detachMarkedSpans(line);\n    attachMarkedSpans(line, markedSpans);\n    var estHeight = estimateHeight ? estimateHeight(line) : 1;\n    if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n  }\n\n  // Detach a line from the document tree and its markers.\n  function cleanUpLine(line) {\n    line.parent = null;\n    detachMarkedSpans(line);\n  }\n\n  // Convert a style as returned by a mode (either null, or a string\n  // containing one or more styles) to a CSS style. This is cached,\n  // and also looks for line-wide styles.\n  var styleToClassCache = {}, styleToClassCacheWithMode = {};\n  function interpretTokenStyle(style, options) {\n    if (!style || /^\\s*$/.test(style)) { return null }\n    var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n    return cache[style] ||\n      (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n  }\n\n  // Render the DOM representation of the text of a line. Also builds\n  // up a 'line map', which points at the DOM nodes that represent\n  // specific stretches of text, and is used by the measuring code.\n  // The returned object contains the DOM node, this map, and\n  // information about line-wide styles that were set by the mode.\n  function buildLineContent(cm, lineView) {\n    // The padding-right forces the element to have a 'border', which\n    // is needed on Webkit to be able to get line-level bounding\n    // rectangles for it (in measureChar).\n    var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n    var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n                   col: 0, pos: 0, cm: cm,\n                   trailingSpace: false,\n                   splitSpaces: cm.getOption(\"lineWrapping\")};\n    lineView.measure = {};\n\n    // Iterate over the logical lines that make up this visual line.\n    for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n      var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n      builder.pos = 0;\n      builder.addToken = buildToken;\n      // Optionally wire in some hacks into the token-rendering\n      // algorithm, to deal with browser quirks.\n      if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n        { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n      builder.map = [];\n      var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n      insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n      if (line.styleClasses) {\n        if (line.styleClasses.bgClass)\n          { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n        if (line.styleClasses.textClass)\n          { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n      }\n\n      // Ensure at least a single node is present, for measuring.\n      if (builder.map.length == 0)\n        { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n      // Store the map and a cache object for the current logical line\n      if (i == 0) {\n        lineView.measure.map = builder.map;\n        lineView.measure.cache = {};\n      } else {\n  (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n        ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n      }\n    }\n\n    // See issue #2901\n    if (webkit) {\n      var last = builder.content.lastChild;\n      if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n        { builder.content.className = \"cm-tab-wrap-hack\"; }\n    }\n\n    signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n    if (builder.pre.className)\n      { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n    return builder\n  }\n\n  function defaultSpecialCharPlaceholder(ch) {\n    var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n    token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n    token.setAttribute(\"aria-label\", token.title);\n    return token\n  }\n\n  // Build up the DOM representation for a single token, and add it to\n  // the line map. Takes care to render special characters separately.\n  function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n    if (!text) { return }\n    var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n    var special = builder.cm.state.specialChars, mustWrap = false;\n    var content;\n    if (!special.test(text)) {\n      builder.col += text.length;\n      content = document.createTextNode(displayText);\n      builder.map.push(builder.pos, builder.pos + text.length, content);\n      if (ie && ie_version < 9) { mustWrap = true; }\n      builder.pos += text.length;\n    } else {\n      content = document.createDocumentFragment();\n      var pos = 0;\n      while (true) {\n        special.lastIndex = pos;\n        var m = special.exec(text);\n        var skipped = m ? m.index - pos : text.length - pos;\n        if (skipped) {\n          var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n          if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n          else { content.appendChild(txt); }\n          builder.map.push(builder.pos, builder.pos + skipped, txt);\n          builder.col += skipped;\n          builder.pos += skipped;\n        }\n        if (!m) { break }\n        pos += skipped + 1;\n        var txt$1 = (void 0);\n        if (m[0] == \"\\t\") {\n          var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n          txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n          txt$1.setAttribute(\"role\", \"presentation\");\n          txt$1.setAttribute(\"cm-text\", \"\\t\");\n          builder.col += tabWidth;\n        } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n          txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n          txt$1.setAttribute(\"cm-text\", m[0]);\n          builder.col += 1;\n        } else {\n          txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n          txt$1.setAttribute(\"cm-text\", m[0]);\n          if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n          else { content.appendChild(txt$1); }\n          builder.col += 1;\n        }\n        builder.map.push(builder.pos, builder.pos + 1, txt$1);\n        builder.pos++;\n      }\n    }\n    builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n    if (style || startStyle || endStyle || mustWrap || css) {\n      var fullStyle = style || \"\";\n      if (startStyle) { fullStyle += startStyle; }\n      if (endStyle) { fullStyle += endStyle; }\n      var token = elt(\"span\", [content], fullStyle, css);\n      if (attributes) {\n        for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n          { token.setAttribute(attr, attributes[attr]); } }\n      }\n      return builder.content.appendChild(token)\n    }\n    builder.content.appendChild(content);\n  }\n\n  // Change some spaces to NBSP to prevent the browser from collapsing\n  // trailing spaces at the end of a line when rendering text (issue #1362).\n  function splitSpaces(text, trailingBefore) {\n    if (text.length > 1 && !/  /.test(text)) { return text }\n    var spaceBefore = trailingBefore, result = \"\";\n    for (var i = 0; i < text.length; i++) {\n      var ch = text.charAt(i);\n      if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n        { ch = \"\\u00a0\"; }\n      result += ch;\n      spaceBefore = ch == \" \";\n    }\n    return result\n  }\n\n  // Work around nonsense dimensions being reported for stretches of\n  // right-to-left text.\n  function buildTokenBadBidi(inner, order) {\n    return function (builder, text, style, startStyle, endStyle, css, attributes) {\n      style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n      var start = builder.pos, end = start + text.length;\n      for (;;) {\n        // Find the part that overlaps with the start of this text\n        var part = (void 0);\n        for (var i = 0; i < order.length; i++) {\n          part = order[i];\n          if (part.to > start && part.from <= start) { break }\n        }\n        if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n        inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n        startStyle = null;\n        text = text.slice(part.to - start);\n        start = part.to;\n      }\n    }\n  }\n\n  function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n    var widget = !ignoreWidget && marker.widgetNode;\n    if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n    if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n      if (!widget)\n        { widget = builder.content.appendChild(document.createElement(\"span\")); }\n      widget.setAttribute(\"cm-marker\", marker.id);\n    }\n    if (widget) {\n      builder.cm.display.input.setUneditable(widget);\n      builder.content.appendChild(widget);\n    }\n    builder.pos += size;\n    builder.trailingSpace = false;\n  }\n\n  // Outputs a number of spans to make up a line, taking highlighting\n  // and marked text into account.\n  function insertLineContent(line, builder, styles) {\n    var spans = line.markedSpans, allText = line.text, at = 0;\n    if (!spans) {\n      for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n        { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n      return\n    }\n\n    var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n    var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n    for (;;) {\n      if (nextChange == pos) { // Update current marker set\n        spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n        attributes = null;\n        collapsed = null; nextChange = Infinity;\n        var foundBookmarks = [], endStyles = (void 0);\n        for (var j = 0; j < spans.length; ++j) {\n          var sp = spans[j], m = sp.marker;\n          if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n            foundBookmarks.push(m);\n          } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n            if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n              nextChange = sp.to;\n              spanEndStyle = \"\";\n            }\n            if (m.className) { spanStyle += \" \" + m.className; }\n            if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n            if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n            if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n            // support for the old title property\n            // https://github.com/codemirror/CodeMirror/pull/5673\n            if (m.title) { (attributes || (attributes = {})).title = m.title; }\n            if (m.attributes) {\n              for (var attr in m.attributes)\n                { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n            }\n            if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n              { collapsed = sp; }\n          } else if (sp.from > pos && nextChange > sp.from) {\n            nextChange = sp.from;\n          }\n        }\n        if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n          { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n        if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n          { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n        if (collapsed && (collapsed.from || 0) == pos) {\n          buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n                             collapsed.marker, collapsed.from == null);\n          if (collapsed.to == null) { return }\n          if (collapsed.to == pos) { collapsed = false; }\n        }\n      }\n      if (pos >= len) { break }\n\n      var upto = Math.min(len, nextChange);\n      while (true) {\n        if (text) {\n          var end = pos + text.length;\n          if (!collapsed) {\n            var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n            builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n                             spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n          }\n          if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n          pos = end;\n          spanStartStyle = \"\";\n        }\n        text = allText.slice(at, at = styles[i++]);\n        style = interpretTokenStyle(styles[i++], builder.cm.options);\n      }\n    }\n  }\n\n\n  // These objects are used to represent the visible (currently drawn)\n  // part of the document. A LineView may correspond to multiple\n  // logical lines, if those are connected by collapsed ranges.\n  function LineView(doc, line, lineN) {\n    // The starting line\n    this.line = line;\n    // Continuing lines, if any\n    this.rest = visualLineContinued(line);\n    // Number of logical lines in this visual line\n    this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n    this.node = this.text = null;\n    this.hidden = lineIsHidden(doc, line);\n  }\n\n  // Create a range of LineView objects for the given lines.\n  function buildViewArray(cm, from, to) {\n    var array = [], nextPos;\n    for (var pos = from; pos < to; pos = nextPos) {\n      var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n      nextPos = pos + view.size;\n      array.push(view);\n    }\n    return array\n  }\n\n  var operationGroup = null;\n\n  function pushOperation(op) {\n    if (operationGroup) {\n      operationGroup.ops.push(op);\n    } else {\n      op.ownsGroup = operationGroup = {\n        ops: [op],\n        delayedCallbacks: []\n      };\n    }\n  }\n\n  function fireCallbacksForOps(group) {\n    // Calls delayed callbacks and cursorActivity handlers until no\n    // new ones appear\n    var callbacks = group.delayedCallbacks, i = 0;\n    do {\n      for (; i < callbacks.length; i++)\n        { callbacks[i].call(null); }\n      for (var j = 0; j < group.ops.length; j++) {\n        var op = group.ops[j];\n        if (op.cursorActivityHandlers)\n          { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n            { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n      }\n    } while (i < callbacks.length)\n  }\n\n  function finishOperation(op, endCb) {\n    var group = op.ownsGroup;\n    if (!group) { return }\n\n    try { fireCallbacksForOps(group); }\n    finally {\n      operationGroup = null;\n      endCb(group);\n    }\n  }\n\n  var orphanDelayedCallbacks = null;\n\n  // Often, we want to signal events at a point where we are in the\n  // middle of some work, but don't want the handler to start calling\n  // other methods on the editor, which might be in an inconsistent\n  // state or simply not expect any other events to happen.\n  // signalLater looks whether there are any handlers, and schedules\n  // them to be executed when the last operation ends, or, if no\n  // operation is active, when a timeout fires.\n  function signalLater(emitter, type /*, values...*/) {\n    var arr = getHandlers(emitter, type);\n    if (!arr.length) { return }\n    var args = Array.prototype.slice.call(arguments, 2), list;\n    if (operationGroup) {\n      list = operationGroup.delayedCallbacks;\n    } else if (orphanDelayedCallbacks) {\n      list = orphanDelayedCallbacks;\n    } else {\n      list = orphanDelayedCallbacks = [];\n      setTimeout(fireOrphanDelayed, 0);\n    }\n    var loop = function ( i ) {\n      list.push(function () { return arr[i].apply(null, args); });\n    };\n\n    for (var i = 0; i < arr.length; ++i)\n      loop( i );\n  }\n\n  function fireOrphanDelayed() {\n    var delayed = orphanDelayedCallbacks;\n    orphanDelayedCallbacks = null;\n    for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n  }\n\n  // When an aspect of a line changes, a string is added to\n  // lineView.changes. This updates the relevant part of the line's\n  // DOM structure.\n  function updateLineForChanges(cm, lineView, lineN, dims) {\n    for (var j = 0; j < lineView.changes.length; j++) {\n      var type = lineView.changes[j];\n      if (type == \"text\") { updateLineText(cm, lineView); }\n      else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n      else if (type == \"class\") { updateLineClasses(cm, lineView); }\n      else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n    }\n    lineView.changes = null;\n  }\n\n  // Lines with gutter elements, widgets or a background class need to\n  // be wrapped, and have the extra elements added to the wrapper div\n  function ensureLineWrapped(lineView) {\n    if (lineView.node == lineView.text) {\n      lineView.node = elt(\"div\", null, null, \"position: relative\");\n      if (lineView.text.parentNode)\n        { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n      lineView.node.appendChild(lineView.text);\n      if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n    }\n    return lineView.node\n  }\n\n  function updateLineBackground(cm, lineView) {\n    var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n    if (cls) { cls += \" CodeMirror-linebackground\"; }\n    if (lineView.background) {\n      if (cls) { lineView.background.className = cls; }\n      else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n    } else if (cls) {\n      var wrap = ensureLineWrapped(lineView);\n      lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n      cm.display.input.setUneditable(lineView.background);\n    }\n  }\n\n  // Wrapper around buildLineContent which will reuse the structure\n  // in display.externalMeasured when possible.\n  function getLineContent(cm, lineView) {\n    var ext = cm.display.externalMeasured;\n    if (ext && ext.line == lineView.line) {\n      cm.display.externalMeasured = null;\n      lineView.measure = ext.measure;\n      return ext.built\n    }\n    return buildLineContent(cm, lineView)\n  }\n\n  // Redraw the line's text. Interacts with the background and text\n  // classes because the mode may output tokens that influence these\n  // classes.\n  function updateLineText(cm, lineView) {\n    var cls = lineView.text.className;\n    var built = getLineContent(cm, lineView);\n    if (lineView.text == lineView.node) { lineView.node = built.pre; }\n    lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n    lineView.text = built.pre;\n    if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n      lineView.bgClass = built.bgClass;\n      lineView.textClass = built.textClass;\n      updateLineClasses(cm, lineView);\n    } else if (cls) {\n      lineView.text.className = cls;\n    }\n  }\n\n  function updateLineClasses(cm, lineView) {\n    updateLineBackground(cm, lineView);\n    if (lineView.line.wrapClass)\n      { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n    else if (lineView.node != lineView.text)\n      { lineView.node.className = \"\"; }\n    var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n    lineView.text.className = textClass || \"\";\n  }\n\n  function updateLineGutter(cm, lineView, lineN, dims) {\n    if (lineView.gutter) {\n      lineView.node.removeChild(lineView.gutter);\n      lineView.gutter = null;\n    }\n    if (lineView.gutterBackground) {\n      lineView.node.removeChild(lineView.gutterBackground);\n      lineView.gutterBackground = null;\n    }\n    if (lineView.line.gutterClass) {\n      var wrap = ensureLineWrapped(lineView);\n      lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n                                      (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n      cm.display.input.setUneditable(lineView.gutterBackground);\n      wrap.insertBefore(lineView.gutterBackground, lineView.text);\n    }\n    var markers = lineView.line.gutterMarkers;\n    if (cm.options.lineNumbers || markers) {\n      var wrap$1 = ensureLineWrapped(lineView);\n      var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n      cm.display.input.setUneditable(gutterWrap);\n      wrap$1.insertBefore(gutterWrap, lineView.text);\n      if (lineView.line.gutterClass)\n        { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n      if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n        { lineView.lineNumber = gutterWrap.appendChild(\n          elt(\"div\", lineNumberFor(cm.options, lineN),\n              \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n              (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n      if (markers) { for (var k = 0; k < cm.display.gutterSpecs.length; ++k) {\n        var id = cm.display.gutterSpecs[k].className, found = markers.hasOwnProperty(id) && markers[id];\n        if (found)\n          { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n                                     (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n      } }\n    }\n  }\n\n  function updateLineWidgets(cm, lineView, dims) {\n    if (lineView.alignable) { lineView.alignable = null; }\n    for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n      next = node.nextSibling;\n      if (node.className == \"CodeMirror-linewidget\")\n        { lineView.node.removeChild(node); }\n    }\n    insertLineWidgets(cm, lineView, dims);\n  }\n\n  // Build a line's DOM representation from scratch\n  function buildLineElement(cm, lineView, lineN, dims) {\n    var built = getLineContent(cm, lineView);\n    lineView.text = lineView.node = built.pre;\n    if (built.bgClass) { lineView.bgClass = built.bgClass; }\n    if (built.textClass) { lineView.textClass = built.textClass; }\n\n    updateLineClasses(cm, lineView);\n    updateLineGutter(cm, lineView, lineN, dims);\n    insertLineWidgets(cm, lineView, dims);\n    return lineView.node\n  }\n\n  // A lineView may contain multiple logical lines (when merged by\n  // collapsed spans). The widgets for all of them need to be drawn.\n  function insertLineWidgets(cm, lineView, dims) {\n    insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n    if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n      { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n  }\n\n  function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n    if (!line.widgets) { return }\n    var wrap = ensureLineWrapped(lineView);\n    for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n      var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\");\n      if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n      positionLineWidget(widget, node, lineView, dims);\n      cm.display.input.setUneditable(node);\n      if (allowAbove && widget.above)\n        { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n      else\n        { wrap.appendChild(node); }\n      signalLater(widget, \"redraw\");\n    }\n  }\n\n  function positionLineWidget(widget, node, lineView, dims) {\n    if (widget.noHScroll) {\n  (lineView.alignable || (lineView.alignable = [])).push(node);\n      var width = dims.wrapperWidth;\n      node.style.left = dims.fixedPos + \"px\";\n      if (!widget.coverGutter) {\n        width -= dims.gutterTotalWidth;\n        node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n      }\n      node.style.width = width + \"px\";\n    }\n    if (widget.coverGutter) {\n      node.style.zIndex = 5;\n      node.style.position = \"relative\";\n      if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n    }\n  }\n\n  function widgetHeight(widget) {\n    if (widget.height != null) { return widget.height }\n    var cm = widget.doc.cm;\n    if (!cm) { return 0 }\n    if (!contains(document.body, widget.node)) {\n      var parentStyle = \"position: relative;\";\n      if (widget.coverGutter)\n        { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n      if (widget.noHScroll)\n        { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n      removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n    }\n    return widget.height = widget.node.parentNode.offsetHeight\n  }\n\n  // Return true when the given mouse event happened in a widget\n  function eventInWidget(display, e) {\n    for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n      if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n          (n.parentNode == display.sizer && n != display.mover))\n        { return true }\n    }\n  }\n\n  // POSITION MEASUREMENT\n\n  function paddingTop(display) {return display.lineSpace.offsetTop}\n  function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n  function paddingH(display) {\n    if (display.cachedPaddingH) { return display.cachedPaddingH }\n    var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\"));\n    var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n    var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n    if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n    return data\n  }\n\n  function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n  function displayWidth(cm) {\n    return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n  }\n  function displayHeight(cm) {\n    return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n  }\n\n  // Ensure the lineView.wrapping.heights array is populated. This is\n  // an array of bottom offsets for the lines that make up a drawn\n  // line. When lineWrapping is on, there might be more than one\n  // height.\n  function ensureLineHeights(cm, lineView, rect) {\n    var wrapping = cm.options.lineWrapping;\n    var curWidth = wrapping && displayWidth(cm);\n    if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n      var heights = lineView.measure.heights = [];\n      if (wrapping) {\n        lineView.measure.width = curWidth;\n        var rects = lineView.text.firstChild.getClientRects();\n        for (var i = 0; i < rects.length - 1; i++) {\n          var cur = rects[i], next = rects[i + 1];\n          if (Math.abs(cur.bottom - next.bottom) > 2)\n            { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n        }\n      }\n      heights.push(rect.bottom - rect.top);\n    }\n  }\n\n  // Find a line map (mapping character offsets to text nodes) and a\n  // measurement cache for the given line number. (A line editor might\n  // contain multiple lines when collapsed ranges are present.)\n  function mapFromLineView(lineView, line, lineN) {\n    if (lineView.line == line)\n      { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n    for (var i = 0; i < lineView.rest.length; i++)\n      { if (lineView.rest[i] == line)\n        { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n    for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n      { if (lineNo(lineView.rest[i$1]) > lineN)\n        { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n  }\n\n  // Render a line into the hidden node display.externalMeasured. Used\n  // when measurement is needed for a line that's not in the viewport.\n  function updateExternalMeasurement(cm, line) {\n    line = visualLine(line);\n    var lineN = lineNo(line);\n    var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n    view.lineN = lineN;\n    var built = view.built = buildLineContent(cm, view);\n    view.text = built.pre;\n    removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n    return view\n  }\n\n  // Get a {top, bottom, left, right} box (in line-local coordinates)\n  // for a given character.\n  function measureChar(cm, line, ch, bias) {\n    return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n  }\n\n  // Find a line editor that corresponds to the given line number.\n  function findViewForLine(cm, lineN) {\n    if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n      { return cm.display.view[findViewIndex(cm, lineN)] }\n    var ext = cm.display.externalMeasured;\n    if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n      { return ext }\n  }\n\n  // Measurement can be split in two steps, the set-up work that\n  // applies to the whole line, and the measurement of the actual\n  // character. Functions like coordsChar, that need to do a lot of\n  // measurements in a row, can thus ensure that the set-up work is\n  // only done once.\n  function prepareMeasureForLine(cm, line) {\n    var lineN = lineNo(line);\n    var view = findViewForLine(cm, lineN);\n    if (view && !view.text) {\n      view = null;\n    } else if (view && view.changes) {\n      updateLineForChanges(cm, view, lineN, getDimensions(cm));\n      cm.curOp.forceUpdate = true;\n    }\n    if (!view)\n      { view = updateExternalMeasurement(cm, line); }\n\n    var info = mapFromLineView(view, line, lineN);\n    return {\n      line: line, view: view, rect: null,\n      map: info.map, cache: info.cache, before: info.before,\n      hasHeights: false\n    }\n  }\n\n  // Given a prepared measurement object, measures the position of an\n  // actual character (or fetches it from the cache).\n  function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n    if (prepared.before) { ch = -1; }\n    var key = ch + (bias || \"\"), found;\n    if (prepared.cache.hasOwnProperty(key)) {\n      found = prepared.cache[key];\n    } else {\n      if (!prepared.rect)\n        { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n      if (!prepared.hasHeights) {\n        ensureLineHeights(cm, prepared.view, prepared.rect);\n        prepared.hasHeights = true;\n      }\n      found = measureCharInner(cm, prepared, ch, bias);\n      if (!found.bogus) { prepared.cache[key] = found; }\n    }\n    return {left: found.left, right: found.right,\n            top: varHeight ? found.rtop : found.top,\n            bottom: varHeight ? found.rbottom : found.bottom}\n  }\n\n  var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n  function nodeAndOffsetInLineMap(map$$1, ch, bias) {\n    var node, start, end, collapse, mStart, mEnd;\n    // First, search the line map for the text node corresponding to,\n    // or closest to, the target character.\n    for (var i = 0; i < map$$1.length; i += 3) {\n      mStart = map$$1[i];\n      mEnd = map$$1[i + 1];\n      if (ch < mStart) {\n        start = 0; end = 1;\n        collapse = \"left\";\n      } else if (ch < mEnd) {\n        start = ch - mStart;\n        end = start + 1;\n      } else if (i == map$$1.length - 3 || ch == mEnd && map$$1[i + 3] > ch) {\n        end = mEnd - mStart;\n        start = end - 1;\n        if (ch >= mEnd) { collapse = \"right\"; }\n      }\n      if (start != null) {\n        node = map$$1[i + 2];\n        if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n          { collapse = bias; }\n        if (bias == \"left\" && start == 0)\n          { while (i && map$$1[i - 2] == map$$1[i - 3] && map$$1[i - 1].insertLeft) {\n            node = map$$1[(i -= 3) + 2];\n            collapse = \"left\";\n          } }\n        if (bias == \"right\" && start == mEnd - mStart)\n          { while (i < map$$1.length - 3 && map$$1[i + 3] == map$$1[i + 4] && !map$$1[i + 5].insertLeft) {\n            node = map$$1[(i += 3) + 2];\n            collapse = \"right\";\n          } }\n        break\n      }\n    }\n    return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n  }\n\n  function getUsefulRect(rects, bias) {\n    var rect = nullRect;\n    if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n      if ((rect = rects[i]).left != rect.right) { break }\n    } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n      if ((rect = rects[i$1]).left != rect.right) { break }\n    } }\n    return rect\n  }\n\n  function measureCharInner(cm, prepared, ch, bias) {\n    var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n    var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n    var rect;\n    if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n      for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n        while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n        while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n        if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n          { rect = node.parentNode.getBoundingClientRect(); }\n        else\n          { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n        if (rect.left || rect.right || start == 0) { break }\n        end = start;\n        start = start - 1;\n        collapse = \"right\";\n      }\n      if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n    } else { // If it is a widget, simply get the box for the whole widget.\n      if (start > 0) { collapse = bias = \"right\"; }\n      var rects;\n      if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n        { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n      else\n        { rect = node.getBoundingClientRect(); }\n    }\n    if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n      var rSpan = node.parentNode.getClientRects()[0];\n      if (rSpan)\n        { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n      else\n        { rect = nullRect; }\n    }\n\n    var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n    var mid = (rtop + rbot) / 2;\n    var heights = prepared.view.measure.heights;\n    var i = 0;\n    for (; i < heights.length - 1; i++)\n      { if (mid < heights[i]) { break } }\n    var top = i ? heights[i - 1] : 0, bot = heights[i];\n    var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n                  right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n                  top: top, bottom: bot};\n    if (!rect.left && !rect.right) { result.bogus = true; }\n    if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n    return result\n  }\n\n  // Work around problem with bounding client rects on ranges being\n  // returned incorrectly when zoomed on IE10 and below.\n  function maybeUpdateRectForZooming(measure, rect) {\n    if (!window.screen || screen.logicalXDPI == null ||\n        screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n      { return rect }\n    var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n    var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n    return {left: rect.left * scaleX, right: rect.right * scaleX,\n            top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n  }\n\n  function clearLineMeasurementCacheFor(lineView) {\n    if (lineView.measure) {\n      lineView.measure.cache = {};\n      lineView.measure.heights = null;\n      if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n        { lineView.measure.caches[i] = {}; } }\n    }\n  }\n\n  function clearLineMeasurementCache(cm) {\n    cm.display.externalMeasure = null;\n    removeChildren(cm.display.lineMeasure);\n    for (var i = 0; i < cm.display.view.length; i++)\n      { clearLineMeasurementCacheFor(cm.display.view[i]); }\n  }\n\n  function clearCaches(cm) {\n    clearLineMeasurementCache(cm);\n    cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n    if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n    cm.display.lineNumChars = null;\n  }\n\n  function pageScrollX() {\n    // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n    // which causes page_Offset and bounding client rects to use\n    // different reference viewports and invalidate our calculations.\n    if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }\n    return window.pageXOffset || (document.documentElement || document.body).scrollLeft\n  }\n  function pageScrollY() {\n    if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }\n    return window.pageYOffset || (document.documentElement || document.body).scrollTop\n  }\n\n  function widgetTopHeight(lineObj) {\n    var height = 0;\n    if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above)\n      { height += widgetHeight(lineObj.widgets[i]); } } }\n    return height\n  }\n\n  // Converts a {top, bottom, left, right} box from line-local\n  // coordinates into another coordinate system. Context may be one of\n  // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n  // or \"page\".\n  function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n    if (!includeWidgets) {\n      var height = widgetTopHeight(lineObj);\n      rect.top += height; rect.bottom += height;\n    }\n    if (context == \"line\") { return rect }\n    if (!context) { context = \"local\"; }\n    var yOff = heightAtLine(lineObj);\n    if (context == \"local\") { yOff += paddingTop(cm.display); }\n    else { yOff -= cm.display.viewOffset; }\n    if (context == \"page\" || context == \"window\") {\n      var lOff = cm.display.lineSpace.getBoundingClientRect();\n      yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n      var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n      rect.left += xOff; rect.right += xOff;\n    }\n    rect.top += yOff; rect.bottom += yOff;\n    return rect\n  }\n\n  // Coverts a box from \"div\" coords to another coordinate system.\n  // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n  function fromCoordSystem(cm, coords, context) {\n    if (context == \"div\") { return coords }\n    var left = coords.left, top = coords.top;\n    // First move into \"page\" coordinate system\n    if (context == \"page\") {\n      left -= pageScrollX();\n      top -= pageScrollY();\n    } else if (context == \"local\" || !context) {\n      var localBox = cm.display.sizer.getBoundingClientRect();\n      left += localBox.left;\n      top += localBox.top;\n    }\n\n    var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n    return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n  }\n\n  function charCoords(cm, pos, context, lineObj, bias) {\n    if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n    return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n  }\n\n  // Returns a box for a given cursor position, which may have an\n  // 'other' property containing the position of the secondary cursor\n  // on a bidi boundary.\n  // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n  // and after `char - 1` in writing order of `char - 1`\n  // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n  // and before `char` in writing order of `char`\n  // Examples (upper-case letters are RTL, lower-case are LTR):\n  //     Pos(0, 1, ...)\n  //     before   after\n  // ab     a|b     a|b\n  // aB     a|B     aB|\n  // Ab     |Ab     A|b\n  // AB     B|A     B|A\n  // Every position after the last character on a line is considered to stick\n  // to the last character on the line.\n  function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n    lineObj = lineObj || getLine(cm.doc, pos.line);\n    if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n    function get(ch, right) {\n      var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n      if (right) { m.left = m.right; } else { m.right = m.left; }\n      return intoCoordSystem(cm, lineObj, m, context)\n    }\n    var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n    if (ch >= lineObj.text.length) {\n      ch = lineObj.text.length;\n      sticky = \"before\";\n    } else if (ch <= 0) {\n      ch = 0;\n      sticky = \"after\";\n    }\n    if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n    function getBidi(ch, partPos, invert) {\n      var part = order[partPos], right = part.level == 1;\n      return get(invert ? ch - 1 : ch, right != invert)\n    }\n    var partPos = getBidiPartAt(order, ch, sticky);\n    var other = bidiOther;\n    var val = getBidi(ch, partPos, sticky == \"before\");\n    if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n    return val\n  }\n\n  // Used to cheaply estimate the coordinates for a position. Used for\n  // intermediate scroll updates.\n  function estimateCoords(cm, pos) {\n    var left = 0;\n    pos = clipPos(cm.doc, pos);\n    if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n    var lineObj = getLine(cm.doc, pos.line);\n    var top = heightAtLine(lineObj) + paddingTop(cm.display);\n    return {left: left, right: left, top: top, bottom: top + lineObj.height}\n  }\n\n  // Positions returned by coordsChar contain some extra information.\n  // xRel is the relative x position of the input coordinates compared\n  // to the found position (so xRel > 0 means the coordinates are to\n  // the right of the character position, for example). When outside\n  // is true, that means the coordinates lie outside the line's\n  // vertical range.\n  function PosWithInfo(line, ch, sticky, outside, xRel) {\n    var pos = Pos(line, ch, sticky);\n    pos.xRel = xRel;\n    if (outside) { pos.outside = true; }\n    return pos\n  }\n\n  // Compute the character position closest to the given coordinates.\n  // Input must be lineSpace-local (\"div\" coordinate system).\n  function coordsChar(cm, x, y) {\n    var doc = cm.doc;\n    y += cm.display.viewOffset;\n    if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n    var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n    if (lineN > last)\n      { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n    if (x < 0) { x = 0; }\n\n    var lineObj = getLine(doc, lineN);\n    for (;;) {\n      var found = coordsCharInner(cm, lineObj, lineN, x, y);\n      var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n      if (!collapsed) { return found }\n      var rangeEnd = collapsed.find(1);\n      if (rangeEnd.line == lineN) { return rangeEnd }\n      lineObj = getLine(doc, lineN = rangeEnd.line);\n    }\n  }\n\n  function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n    y -= widgetTopHeight(lineObj);\n    var end = lineObj.text.length;\n    var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n    end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n    return {begin: begin, end: end}\n  }\n\n  function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n    if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n    var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n    return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n  }\n\n  // Returns true if the given side of a box is after the given\n  // coordinates, in top-to-bottom, left-to-right order.\n  function boxIsAfter(box, x, y, left) {\n    return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n  }\n\n  function coordsCharInner(cm, lineObj, lineNo$$1, x, y) {\n    // Move y into line-local coordinate space\n    y -= heightAtLine(lineObj);\n    var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n    // When directly calling `measureCharPrepared`, we have to adjust\n    // for the widgets at this line.\n    var widgetHeight$$1 = widgetTopHeight(lineObj);\n    var begin = 0, end = lineObj.text.length, ltr = true;\n\n    var order = getOrder(lineObj, cm.doc.direction);\n    // If the line isn't plain left-to-right text, first figure out\n    // which bidi section the coordinates fall into.\n    if (order) {\n      var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n                   (cm, lineObj, lineNo$$1, preparedMeasure, order, x, y);\n      ltr = part.level != 1;\n      // The awkward -1 offsets are needed because findFirst (called\n      // on these below) will treat its first bound as inclusive,\n      // second as exclusive, but we want to actually address the\n      // characters in the part's range\n      begin = ltr ? part.from : part.to - 1;\n      end = ltr ? part.to : part.from - 1;\n    }\n\n    // A binary search to find the first character whose bounding box\n    // starts after the coordinates. If we run across any whose box wrap\n    // the coordinates, store that.\n    var chAround = null, boxAround = null;\n    var ch = findFirst(function (ch) {\n      var box = measureCharPrepared(cm, preparedMeasure, ch);\n      box.top += widgetHeight$$1; box.bottom += widgetHeight$$1;\n      if (!boxIsAfter(box, x, y, false)) { return false }\n      if (box.top <= y && box.left <= x) {\n        chAround = ch;\n        boxAround = box;\n      }\n      return true\n    }, begin, end);\n\n    var baseX, sticky, outside = false;\n    // If a box around the coordinates was found, use that\n    if (boxAround) {\n      // Distinguish coordinates nearer to the left or right side of the box\n      var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n      ch = chAround + (atStart ? 0 : 1);\n      sticky = atStart ? \"after\" : \"before\";\n      baseX = atLeft ? boxAround.left : boxAround.right;\n    } else {\n      // (Adjust for extended bound, if necessary.)\n      if (!ltr && (ch == end || ch == begin)) { ch++; }\n      // To determine which side to associate with, get the box to the\n      // left of the character and compare it's vertical position to the\n      // coordinates\n      sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n        (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight$$1 <= y) == ltr ?\n        \"after\" : \"before\";\n      // Now get accurate coordinates for this place, in order to get a\n      // base X position\n      var coords = cursorCoords(cm, Pos(lineNo$$1, ch, sticky), \"line\", lineObj, preparedMeasure);\n      baseX = coords.left;\n      outside = y < coords.top || y >= coords.bottom;\n    }\n\n    ch = skipExtendingChars(lineObj.text, ch, 1);\n    return PosWithInfo(lineNo$$1, ch, sticky, outside, x - baseX)\n  }\n\n  function coordsBidiPart(cm, lineObj, lineNo$$1, preparedMeasure, order, x, y) {\n    // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n    // situation, we can take this ordering to correspond to the visual\n    // ordering. This finds the first part whose end is after the given\n    // coordinates.\n    var index = findFirst(function (i) {\n      var part = order[i], ltr = part.level != 1;\n      return boxIsAfter(cursorCoords(cm, Pos(lineNo$$1, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n                                     \"line\", lineObj, preparedMeasure), x, y, true)\n    }, 0, order.length - 1);\n    var part = order[index];\n    // If this isn't the first part, the part's start is also after\n    // the coordinates, and the coordinates aren't on the same line as\n    // that start, move one part back.\n    if (index > 0) {\n      var ltr = part.level != 1;\n      var start = cursorCoords(cm, Pos(lineNo$$1, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n                               \"line\", lineObj, preparedMeasure);\n      if (boxIsAfter(start, x, y, true) && start.top > y)\n        { part = order[index - 1]; }\n    }\n    return part\n  }\n\n  function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n    // In a wrapped line, rtl text on wrapping boundaries can do things\n    // that don't correspond to the ordering in our `order` array at\n    // all, so a binary search doesn't work, and we want to return a\n    // part that only spans one line so that the binary search in\n    // coordsCharInner is safe. As such, we first find the extent of the\n    // wrapped line, and then do a flat search in which we discard any\n    // spans that aren't on the line.\n    var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n    var begin = ref.begin;\n    var end = ref.end;\n    if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n    var part = null, closestDist = null;\n    for (var i = 0; i < order.length; i++) {\n      var p = order[i];\n      if (p.from >= end || p.to <= begin) { continue }\n      var ltr = p.level != 1;\n      var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n      // Weigh against spans ending before this, so that they are only\n      // picked if nothing ends after\n      var dist = endX < x ? x - endX + 1e9 : endX - x;\n      if (!part || closestDist > dist) {\n        part = p;\n        closestDist = dist;\n      }\n    }\n    if (!part) { part = order[order.length - 1]; }\n    // Clip the part to the wrapped line.\n    if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n    if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n    return part\n  }\n\n  var measureText;\n  // Compute the default text height.\n  function textHeight(display) {\n    if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n    if (measureText == null) {\n      measureText = elt(\"pre\");\n      // Measure a bunch of lines, for browsers that compute\n      // fractional heights.\n      for (var i = 0; i < 49; ++i) {\n        measureText.appendChild(document.createTextNode(\"x\"));\n        measureText.appendChild(elt(\"br\"));\n      }\n      measureText.appendChild(document.createTextNode(\"x\"));\n    }\n    removeChildrenAndAdd(display.measure, measureText);\n    var height = measureText.offsetHeight / 50;\n    if (height > 3) { display.cachedTextHeight = height; }\n    removeChildren(display.measure);\n    return height || 1\n  }\n\n  // Compute the default character width.\n  function charWidth(display) {\n    if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n    var anchor = elt(\"span\", \"xxxxxxxxxx\");\n    var pre = elt(\"pre\", [anchor]);\n    removeChildrenAndAdd(display.measure, pre);\n    var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n    if (width > 2) { display.cachedCharWidth = width; }\n    return width || 10\n  }\n\n  // Do a bulk-read of the DOM positions and sizes needed to draw the\n  // editor, so that we don't interleave reading and writing to the DOM.\n  function getDimensions(cm) {\n    var d = cm.display, left = {}, width = {};\n    var gutterLeft = d.gutters.clientLeft;\n    for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n      var id = cm.display.gutterSpecs[i].className;\n      left[id] = n.offsetLeft + n.clientLeft + gutterLeft;\n      width[id] = n.clientWidth;\n    }\n    return {fixedPos: compensateForHScroll(d),\n            gutterTotalWidth: d.gutters.offsetWidth,\n            gutterLeft: left,\n            gutterWidth: width,\n            wrapperWidth: d.wrapper.clientWidth}\n  }\n\n  // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n  // but using getBoundingClientRect to get a sub-pixel-accurate\n  // result.\n  function compensateForHScroll(display) {\n    return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n  }\n\n  // Returns a function that estimates the height of a line, to use as\n  // first approximation until the line becomes visible (and is thus\n  // properly measurable).\n  function estimateHeight(cm) {\n    var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n    var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n    return function (line) {\n      if (lineIsHidden(cm.doc, line)) { return 0 }\n\n      var widgetsHeight = 0;\n      if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n        if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n      } }\n\n      if (wrapping)\n        { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n      else\n        { return widgetsHeight + th }\n    }\n  }\n\n  function estimateLineHeights(cm) {\n    var doc = cm.doc, est = estimateHeight(cm);\n    doc.iter(function (line) {\n      var estHeight = est(line);\n      if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n    });\n  }\n\n  // Given a mouse event, find the corresponding position. If liberal\n  // is false, it checks whether a gutter or scrollbar was clicked,\n  // and returns null if it was. forRect is used by rectangular\n  // selections, and tries to estimate a character position even for\n  // coordinates beyond the right of the text.\n  function posFromMouse(cm, e, liberal, forRect) {\n    var display = cm.display;\n    if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n    var x, y, space = display.lineSpace.getBoundingClientRect();\n    // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n    try { x = e.clientX - space.left; y = e.clientY - space.top; }\n    catch (e) { return null }\n    var coords = coordsChar(cm, x, y), line;\n    if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n      var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n      coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n    }\n    return coords\n  }\n\n  // Find the editor element corresponding to a given line. Return null\n  // when the line isn't visible.\n  function findViewIndex(cm, n) {\n    if (n >= cm.display.viewTo) { return null }\n    n -= cm.display.viewFrom;\n    if (n < 0) { return null }\n    var view = cm.display.view;\n    for (var i = 0; i < view.length; i++) {\n      n -= view[i].size;\n      if (n < 0) { return i }\n    }\n  }\n\n  // Updates the display.editor data structure for a given change to the\n  // document. From and to are in pre-change coordinates. Lendiff is\n  // the amount of lines added or subtracted by the change. This is\n  // used for changes that span multiple lines, or change the way\n  // lines are divided into visual lines. regLineChange (below)\n  // registers single-line changes.\n  function regChange(cm, from, to, lendiff) {\n    if (from == null) { from = cm.doc.first; }\n    if (to == null) { to = cm.doc.first + cm.doc.size; }\n    if (!lendiff) { lendiff = 0; }\n\n    var display = cm.display;\n    if (lendiff && to < display.viewTo &&\n        (display.updateLineNumbers == null || display.updateLineNumbers > from))\n      { display.updateLineNumbers = from; }\n\n    cm.curOp.viewChanged = true;\n\n    if (from >= display.viewTo) { // Change after\n      if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n        { resetView(cm); }\n    } else if (to <= display.viewFrom) { // Change before\n      if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n        resetView(cm);\n      } else {\n        display.viewFrom += lendiff;\n        display.viewTo += lendiff;\n      }\n    } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n      resetView(cm);\n    } else if (from <= display.viewFrom) { // Top overlap\n      var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n      if (cut) {\n        display.view = display.view.slice(cut.index);\n        display.viewFrom = cut.lineN;\n        display.viewTo += lendiff;\n      } else {\n        resetView(cm);\n      }\n    } else if (to >= display.viewTo) { // Bottom overlap\n      var cut$1 = viewCuttingPoint(cm, from, from, -1);\n      if (cut$1) {\n        display.view = display.view.slice(0, cut$1.index);\n        display.viewTo = cut$1.lineN;\n      } else {\n        resetView(cm);\n      }\n    } else { // Gap in the middle\n      var cutTop = viewCuttingPoint(cm, from, from, -1);\n      var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n      if (cutTop && cutBot) {\n        display.view = display.view.slice(0, cutTop.index)\n          .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n          .concat(display.view.slice(cutBot.index));\n        display.viewTo += lendiff;\n      } else {\n        resetView(cm);\n      }\n    }\n\n    var ext = display.externalMeasured;\n    if (ext) {\n      if (to < ext.lineN)\n        { ext.lineN += lendiff; }\n      else if (from < ext.lineN + ext.size)\n        { display.externalMeasured = null; }\n    }\n  }\n\n  // Register a change to a single line. Type must be one of \"text\",\n  // \"gutter\", \"class\", \"widget\"\n  function regLineChange(cm, line, type) {\n    cm.curOp.viewChanged = true;\n    var display = cm.display, ext = cm.display.externalMeasured;\n    if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n      { display.externalMeasured = null; }\n\n    if (line < display.viewFrom || line >= display.viewTo) { return }\n    var lineView = display.view[findViewIndex(cm, line)];\n    if (lineView.node == null) { return }\n    var arr = lineView.changes || (lineView.changes = []);\n    if (indexOf(arr, type) == -1) { arr.push(type); }\n  }\n\n  // Clear the editor.\n  function resetView(cm) {\n    cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n    cm.display.view = [];\n    cm.display.viewOffset = 0;\n  }\n\n  function viewCuttingPoint(cm, oldN, newN, dir) {\n    var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n    if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n      { return {index: index, lineN: newN} }\n    var n = cm.display.viewFrom;\n    for (var i = 0; i < index; i++)\n      { n += view[i].size; }\n    if (n != oldN) {\n      if (dir > 0) {\n        if (index == view.length - 1) { return null }\n        diff = (n + view[index].size) - oldN;\n        index++;\n      } else {\n        diff = n - oldN;\n      }\n      oldN += diff; newN += diff;\n    }\n    while (visualLineNo(cm.doc, newN) != newN) {\n      if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n      newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n      index += dir;\n    }\n    return {index: index, lineN: newN}\n  }\n\n  // Force the editor to cover a given range, adding empty editor element\n  // or clipping off existing ones as needed.\n  function adjustView(cm, from, to) {\n    var display = cm.display, view = display.view;\n    if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n      display.view = buildViewArray(cm, from, to);\n      display.viewFrom = from;\n    } else {\n      if (display.viewFrom > from)\n        { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n      else if (display.viewFrom < from)\n        { display.view = display.view.slice(findViewIndex(cm, from)); }\n      display.viewFrom = from;\n      if (display.viewTo < to)\n        { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n      else if (display.viewTo > to)\n        { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n    }\n    display.viewTo = to;\n  }\n\n  // Count the number of lines in the editor whose DOM representation is\n  // out of date (or nonexistent).\n  function countDirtyView(cm) {\n    var view = cm.display.view, dirty = 0;\n    for (var i = 0; i < view.length; i++) {\n      var lineView = view[i];\n      if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n    }\n    return dirty\n  }\n\n  function updateSelection(cm) {\n    cm.display.input.showSelection(cm.display.input.prepareSelection());\n  }\n\n  function prepareSelection(cm, primary) {\n    if ( primary === void 0 ) primary = true;\n\n    var doc = cm.doc, result = {};\n    var curFragment = result.cursors = document.createDocumentFragment();\n    var selFragment = result.selection = document.createDocumentFragment();\n\n    for (var i = 0; i < doc.sel.ranges.length; i++) {\n      if (!primary && i == doc.sel.primIndex) { continue }\n      var range$$1 = doc.sel.ranges[i];\n      if (range$$1.from().line >= cm.display.viewTo || range$$1.to().line < cm.display.viewFrom) { continue }\n      var collapsed = range$$1.empty();\n      if (collapsed || cm.options.showCursorWhenSelecting)\n        { drawSelectionCursor(cm, range$$1.head, curFragment); }\n      if (!collapsed)\n        { drawSelectionRange(cm, range$$1, selFragment); }\n    }\n    return result\n  }\n\n  // Draws a cursor for the given range\n  function drawSelectionCursor(cm, head, output) {\n    var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n    var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n    cursor.style.left = pos.left + \"px\";\n    cursor.style.top = pos.top + \"px\";\n    cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n    if (pos.other) {\n      // Secondary cursor, shown when on a 'jump' in bi-directional text\n      var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n      otherCursor.style.display = \"\";\n      otherCursor.style.left = pos.other.left + \"px\";\n      otherCursor.style.top = pos.other.top + \"px\";\n      otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n    }\n  }\n\n  function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n  // Draws the given range as a highlighted selection\n  function drawSelectionRange(cm, range$$1, output) {\n    var display = cm.display, doc = cm.doc;\n    var fragment = document.createDocumentFragment();\n    var padding = paddingH(cm.display), leftSide = padding.left;\n    var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n    var docLTR = doc.direction == \"ltr\";\n\n    function add(left, top, width, bottom) {\n      if (top < 0) { top = 0; }\n      top = Math.round(top);\n      bottom = Math.round(bottom);\n      fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n                             top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n                             height: \" + (bottom - top) + \"px\")));\n    }\n\n    function drawForLine(line, fromArg, toArg) {\n      var lineObj = getLine(doc, line);\n      var lineLen = lineObj.text.length;\n      var start, end;\n      function coords(ch, bias) {\n        return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n      }\n\n      function wrapX(pos, dir, side) {\n        var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n        var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n        var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n        return coords(ch, prop)[prop]\n      }\n\n      var order = getOrder(lineObj, doc.direction);\n      iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n        var ltr = dir == \"ltr\";\n        var fromPos = coords(from, ltr ? \"left\" : \"right\");\n        var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n        var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n        var first = i == 0, last = !order || i == order.length - 1;\n        if (toPos.top - fromPos.top <= 3) { // Single line\n          var openLeft = (docLTR ? openStart : openEnd) && first;\n          var openRight = (docLTR ? openEnd : openStart) && last;\n          var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n          var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n          add(left, fromPos.top, right - left, fromPos.bottom);\n        } else { // Multiple lines\n          var topLeft, topRight, botLeft, botRight;\n          if (ltr) {\n            topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n            topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n            botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n            botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n          } else {\n            topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n            topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n            botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n            botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n          }\n          add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n          if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n          add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n        }\n\n        if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n        if (cmpCoords(toPos, start) < 0) { start = toPos; }\n        if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n        if (cmpCoords(toPos, end) < 0) { end = toPos; }\n      });\n      return {start: start, end: end}\n    }\n\n    var sFrom = range$$1.from(), sTo = range$$1.to();\n    if (sFrom.line == sTo.line) {\n      drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n    } else {\n      var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n      var singleVLine = visualLine(fromLine) == visualLine(toLine);\n      var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n      var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n      if (singleVLine) {\n        if (leftEnd.top < rightStart.top - 2) {\n          add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n          add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n        } else {\n          add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n        }\n      }\n      if (leftEnd.bottom < rightStart.top)\n        { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n    }\n\n    output.appendChild(fragment);\n  }\n\n  // Cursor-blinking\n  function restartBlink(cm) {\n    if (!cm.state.focused) { return }\n    var display = cm.display;\n    clearInterval(display.blinker);\n    var on = true;\n    display.cursorDiv.style.visibility = \"\";\n    if (cm.options.cursorBlinkRate > 0)\n      { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\"; },\n        cm.options.cursorBlinkRate); }\n    else if (cm.options.cursorBlinkRate < 0)\n      { display.cursorDiv.style.visibility = \"hidden\"; }\n  }\n\n  function ensureFocus(cm) {\n    if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }\n  }\n\n  function delayBlurEvent(cm) {\n    cm.state.delayingBlurEvent = true;\n    setTimeout(function () { if (cm.state.delayingBlurEvent) {\n      cm.state.delayingBlurEvent = false;\n      onBlur(cm);\n    } }, 100);\n  }\n\n  function onFocus(cm, e) {\n    if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false; }\n\n    if (cm.options.readOnly == \"nocursor\") { return }\n    if (!cm.state.focused) {\n      signal(cm, \"focus\", cm, e);\n      cm.state.focused = true;\n      addClass(cm.display.wrapper, \"CodeMirror-focused\");\n      // This test prevents this from firing when a context\n      // menu is closed (since the input reset would kill the\n      // select-all detection hack)\n      if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n        cm.display.input.reset();\n        if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n      }\n      cm.display.input.receivedFocus();\n    }\n    restartBlink(cm);\n  }\n  function onBlur(cm, e) {\n    if (cm.state.delayingBlurEvent) { return }\n\n    if (cm.state.focused) {\n      signal(cm, \"blur\", cm, e);\n      cm.state.focused = false;\n      rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n    }\n    clearInterval(cm.display.blinker);\n    setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n  }\n\n  // Read the actual heights of the rendered lines, and update their\n  // stored heights to match.\n  function updateHeightsInViewport(cm) {\n    var display = cm.display;\n    var prevBottom = display.lineDiv.offsetTop;\n    for (var i = 0; i < display.view.length; i++) {\n      var cur = display.view[i], wrapping = cm.options.lineWrapping;\n      var height = (void 0), width = 0;\n      if (cur.hidden) { continue }\n      if (ie && ie_version < 8) {\n        var bot = cur.node.offsetTop + cur.node.offsetHeight;\n        height = bot - prevBottom;\n        prevBottom = bot;\n      } else {\n        var box = cur.node.getBoundingClientRect();\n        height = box.bottom - box.top;\n        // Check that lines don't extend past the right of the current\n        // editor width\n        if (!wrapping && cur.text.firstChild)\n          { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n      }\n      var diff = cur.line.height - height;\n      if (diff > .005 || diff < -.005) {\n        updateLineHeight(cur.line, height);\n        updateWidgetHeight(cur.line);\n        if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n          { updateWidgetHeight(cur.rest[j]); } }\n      }\n      if (width > cm.display.sizerWidth) {\n        var chWidth = Math.ceil(width / charWidth(cm.display));\n        if (chWidth > cm.display.maxLineLength) {\n          cm.display.maxLineLength = chWidth;\n          cm.display.maxLine = cur.line;\n          cm.display.maxLineChanged = true;\n        }\n      }\n    }\n  }\n\n  // Read and store the height of line widgets associated with the\n  // given line.\n  function updateWidgetHeight(line) {\n    if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n      var w = line.widgets[i], parent = w.node.parentNode;\n      if (parent) { w.height = parent.offsetHeight; }\n    } }\n  }\n\n  // Compute the lines that are visible in a given viewport (defaults\n  // the the current scroll position). viewport may contain top,\n  // height, and ensure (see op.scrollToPos) properties.\n  function visibleLines(display, doc, viewport) {\n    var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n    top = Math.floor(top - paddingTop(display));\n    var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n    var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n    // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n    // forces those lines into the viewport (if possible).\n    if (viewport && viewport.ensure) {\n      var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n      if (ensureFrom < from) {\n        from = ensureFrom;\n        to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n      } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n        from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n        to = ensureTo;\n      }\n    }\n    return {from: from, to: Math.max(to, from + 1)}\n  }\n\n  // SCROLLING THINGS INTO VIEW\n\n  // If an editor sits on the top or bottom of the window, partially\n  // scrolled out of editor, this ensures that the cursor is visible.\n  function maybeScrollWindow(cm, rect) {\n    if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n    var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n    if (rect.top + box.top < 0) { doScroll = true; }\n    else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; }\n    if (doScroll != null && !phantom) {\n      var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n                         top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n                         height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n                         left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n      cm.display.lineSpace.appendChild(scrollNode);\n      scrollNode.scrollIntoView(doScroll);\n      cm.display.lineSpace.removeChild(scrollNode);\n    }\n  }\n\n  // Scroll a given position into editor (immediately), verifying that\n  // it actually became visible (as line heights are accurately\n  // measured, the position of something may 'drift' during drawing).\n  function scrollPosIntoView(cm, pos, end, margin) {\n    if (margin == null) { margin = 0; }\n    var rect;\n    if (!cm.options.lineWrapping && pos == end) {\n      // Set pos and end to the cursor positions around the character pos sticks to\n      // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n      // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n      pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n      end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n    }\n    for (var limit = 0; limit < 5; limit++) {\n      var changed = false;\n      var coords = cursorCoords(cm, pos);\n      var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n      rect = {left: Math.min(coords.left, endCoords.left),\n              top: Math.min(coords.top, endCoords.top) - margin,\n              right: Math.max(coords.left, endCoords.left),\n              bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n      var scrollPos = calculateScrollPos(cm, rect);\n      var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n      if (scrollPos.scrollTop != null) {\n        updateScrollTop(cm, scrollPos.scrollTop);\n        if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n      }\n      if (scrollPos.scrollLeft != null) {\n        setScrollLeft(cm, scrollPos.scrollLeft);\n        if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n      }\n      if (!changed) { break }\n    }\n    return rect\n  }\n\n  // Scroll a given set of coordinates into editor (immediately).\n  function scrollIntoView(cm, rect) {\n    var scrollPos = calculateScrollPos(cm, rect);\n    if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n    if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n  }\n\n  // Calculate a new scroll position needed to scroll the given\n  // rectangle into editor. Returns an object with scrollTop and\n  // scrollLeft properties. When these are undefined, the\n  // vertical/horizontal position does not need to be adjusted.\n  function calculateScrollPos(cm, rect) {\n    var display = cm.display, snapMargin = textHeight(cm.display);\n    if (rect.top < 0) { rect.top = 0; }\n    var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n    var screen = displayHeight(cm), result = {};\n    if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n    var docBottom = cm.doc.height + paddingVert(display);\n    var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n    if (rect.top < screentop) {\n      result.scrollTop = atTop ? 0 : rect.top;\n    } else if (rect.bottom > screentop + screen) {\n      var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n      if (newTop != screentop) { result.scrollTop = newTop; }\n    }\n\n    var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n    var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n    var tooWide = rect.right - rect.left > screenw;\n    if (tooWide) { rect.right = rect.left + screenw; }\n    if (rect.left < 10)\n      { result.scrollLeft = 0; }\n    else if (rect.left < screenleft)\n      { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n    else if (rect.right > screenw + screenleft - 3)\n      { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n    return result\n  }\n\n  // Store a relative adjustment to the scroll position in the current\n  // operation (to be applied when the operation finishes).\n  function addToScrollTop(cm, top) {\n    if (top == null) { return }\n    resolveScrollToPos(cm);\n    cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n  }\n\n  // Make sure that at the end of the operation the current cursor is\n  // shown.\n  function ensureCursorVisible(cm) {\n    resolveScrollToPos(cm);\n    var cur = cm.getCursor();\n    cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n  }\n\n  function scrollToCoords(cm, x, y) {\n    if (x != null || y != null) { resolveScrollToPos(cm); }\n    if (x != null) { cm.curOp.scrollLeft = x; }\n    if (y != null) { cm.curOp.scrollTop = y; }\n  }\n\n  function scrollToRange(cm, range$$1) {\n    resolveScrollToPos(cm);\n    cm.curOp.scrollToPos = range$$1;\n  }\n\n  // When an operation has its scrollToPos property set, and another\n  // scroll action is applied before the end of the operation, this\n  // 'simulates' scrolling that position into editor in a cheap way, so\n  // that the effect of intermediate scroll commands is not ignored.\n  function resolveScrollToPos(cm) {\n    var range$$1 = cm.curOp.scrollToPos;\n    if (range$$1) {\n      cm.curOp.scrollToPos = null;\n      var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n      scrollToCoordsRange(cm, from, to, range$$1.margin);\n    }\n  }\n\n  function scrollToCoordsRange(cm, from, to, margin) {\n    var sPos = calculateScrollPos(cm, {\n      left: Math.min(from.left, to.left),\n      top: Math.min(from.top, to.top) - margin,\n      right: Math.max(from.right, to.right),\n      bottom: Math.max(from.bottom, to.bottom) + margin\n    });\n    scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n  }\n\n  // Sync the scrollable area and scrollbars, ensure the viewport\n  // covers the visible area.\n  function updateScrollTop(cm, val) {\n    if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n    if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n    setScrollTop(cm, val, true);\n    if (gecko) { updateDisplaySimple(cm); }\n    startWorker(cm, 100);\n  }\n\n  function setScrollTop(cm, val, forceScroll) {\n    val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val);\n    if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n    cm.doc.scrollTop = val;\n    cm.display.scrollbars.setScrollTop(val);\n    if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n  }\n\n  // Sync scroller and scrollbar, ensure the gutter elements are\n  // aligned.\n  function setScrollLeft(cm, val, isScroller, forceScroll) {\n    val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);\n    if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n    cm.doc.scrollLeft = val;\n    alignHorizontally(cm);\n    if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n    cm.display.scrollbars.setScrollLeft(val);\n  }\n\n  // SCROLLBARS\n\n  // Prepare DOM reads needed to update the scrollbars. Done in one\n  // shot to minimize update/measure roundtrips.\n  function measureForScrollbars(cm) {\n    var d = cm.display, gutterW = d.gutters.offsetWidth;\n    var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n    return {\n      clientHeight: d.scroller.clientHeight,\n      viewHeight: d.wrapper.clientHeight,\n      scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n      viewWidth: d.wrapper.clientWidth,\n      barLeft: cm.options.fixedGutter ? gutterW : 0,\n      docHeight: docH,\n      scrollHeight: docH + scrollGap(cm) + d.barHeight,\n      nativeBarWidth: d.nativeBarWidth,\n      gutterWidth: gutterW\n    }\n  }\n\n  var NativeScrollbars = function(place, scroll, cm) {\n    this.cm = cm;\n    var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n    var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n    vert.tabIndex = horiz.tabIndex = -1;\n    place(vert); place(horiz);\n\n    on(vert, \"scroll\", function () {\n      if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n    });\n    on(horiz, \"scroll\", function () {\n      if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n    });\n\n    this.checkedZeroWidth = false;\n    // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n    if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n  };\n\n  NativeScrollbars.prototype.update = function (measure) {\n    var needsH = measure.scrollWidth > measure.clientWidth + 1;\n    var needsV = measure.scrollHeight > measure.clientHeight + 1;\n    var sWidth = measure.nativeBarWidth;\n\n    if (needsV) {\n      this.vert.style.display = \"block\";\n      this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n      var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n      // A bug in IE8 can cause this value to be negative, so guard it.\n      this.vert.firstChild.style.height =\n        Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n    } else {\n      this.vert.style.display = \"\";\n      this.vert.firstChild.style.height = \"0\";\n    }\n\n    if (needsH) {\n      this.horiz.style.display = \"block\";\n      this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n      this.horiz.style.left = measure.barLeft + \"px\";\n      var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n      this.horiz.firstChild.style.width =\n        Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n    } else {\n      this.horiz.style.display = \"\";\n      this.horiz.firstChild.style.width = \"0\";\n    }\n\n    if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n      if (sWidth == 0) { this.zeroWidthHack(); }\n      this.checkedZeroWidth = true;\n    }\n\n    return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n  };\n\n  NativeScrollbars.prototype.setScrollLeft = function (pos) {\n    if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n    if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n  };\n\n  NativeScrollbars.prototype.setScrollTop = function (pos) {\n    if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n    if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n  };\n\n  NativeScrollbars.prototype.zeroWidthHack = function () {\n    var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n    this.horiz.style.height = this.vert.style.width = w;\n    this.horiz.style.pointerEvents = this.vert.style.pointerEvents = \"none\";\n    this.disableHoriz = new Delayed;\n    this.disableVert = new Delayed;\n  };\n\n  NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n    bar.style.pointerEvents = \"auto\";\n    function maybeDisable() {\n      // To find out whether the scrollbar is still visible, we\n      // check whether the element under the pixel in the bottom\n      // right corner of the scrollbar box is the scrollbar box\n      // itself (when the bar is still visible) or its filler child\n      // (when the bar is hidden). If it is still visible, we keep\n      // it enabled, if it's hidden, we disable pointer events.\n      var box = bar.getBoundingClientRect();\n      var elt$$1 = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n          : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n      if (elt$$1 != bar) { bar.style.pointerEvents = \"none\"; }\n      else { delay.set(1000, maybeDisable); }\n    }\n    delay.set(1000, maybeDisable);\n  };\n\n  NativeScrollbars.prototype.clear = function () {\n    var parent = this.horiz.parentNode;\n    parent.removeChild(this.horiz);\n    parent.removeChild(this.vert);\n  };\n\n  var NullScrollbars = function () {};\n\n  NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n  NullScrollbars.prototype.setScrollLeft = function () {};\n  NullScrollbars.prototype.setScrollTop = function () {};\n  NullScrollbars.prototype.clear = function () {};\n\n  function updateScrollbars(cm, measure) {\n    if (!measure) { measure = measureForScrollbars(cm); }\n    var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n    updateScrollbarsInner(cm, measure);\n    for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n      if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n        { updateHeightsInViewport(cm); }\n      updateScrollbarsInner(cm, measureForScrollbars(cm));\n      startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n    }\n  }\n\n  // Re-synchronize the fake scrollbars with the actual size of the\n  // content.\n  function updateScrollbarsInner(cm, measure) {\n    var d = cm.display;\n    var sizes = d.scrollbars.update(measure);\n\n    d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n    d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n    d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n    if (sizes.right && sizes.bottom) {\n      d.scrollbarFiller.style.display = \"block\";\n      d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n      d.scrollbarFiller.style.width = sizes.right + \"px\";\n    } else { d.scrollbarFiller.style.display = \"\"; }\n    if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n      d.gutterFiller.style.display = \"block\";\n      d.gutterFiller.style.height = sizes.bottom + \"px\";\n      d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n    } else { d.gutterFiller.style.display = \"\"; }\n  }\n\n  var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n  function initScrollbars(cm) {\n    if (cm.display.scrollbars) {\n      cm.display.scrollbars.clear();\n      if (cm.display.scrollbars.addClass)\n        { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n    }\n\n    cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n      cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n      // Prevent clicks in the scrollbars from killing focus\n      on(node, \"mousedown\", function () {\n        if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n      });\n      node.setAttribute(\"cm-not-content\", \"true\");\n    }, function (pos, axis) {\n      if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n      else { updateScrollTop(cm, pos); }\n    }, cm);\n    if (cm.display.scrollbars.addClass)\n      { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n  }\n\n  // Operations are used to wrap a series of changes to the editor\n  // state in such a way that each change won't have to update the\n  // cursor and display (which would be awkward, slow, and\n  // error-prone). Instead, display updates are batched and then all\n  // combined and executed at once.\n\n  var nextOpId = 0;\n  // Start a new operation.\n  function startOperation(cm) {\n    cm.curOp = {\n      cm: cm,\n      viewChanged: false,      // Flag that indicates that lines might need to be redrawn\n      startHeight: cm.doc.height, // Used to detect need to update scrollbar\n      forceUpdate: false,      // Used to force a redraw\n      updateInput: 0,       // Whether to reset the input textarea\n      typing: false,           // Whether this reset should be careful to leave existing text (for compositing)\n      changeObjs: null,        // Accumulated changes, for firing change events\n      cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n      cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n      selectionChanged: false, // Whether the selection needs to be redrawn\n      updateMaxLine: false,    // Set when the widest line needs to be determined anew\n      scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n      scrollToPos: null,       // Used to scroll to a specific position\n      focus: false,\n      id: ++nextOpId           // Unique ID\n    };\n    pushOperation(cm.curOp);\n  }\n\n  // Finish an operation, updating the display and signalling delayed events\n  function endOperation(cm) {\n    var op = cm.curOp;\n    if (op) { finishOperation(op, function (group) {\n      for (var i = 0; i < group.ops.length; i++)\n        { group.ops[i].cm.curOp = null; }\n      endOperations(group);\n    }); }\n  }\n\n  // The DOM updates done when an operation finishes are batched so\n  // that the minimum number of relayouts are required.\n  function endOperations(group) {\n    var ops = group.ops;\n    for (var i = 0; i < ops.length; i++) // Read DOM\n      { endOperation_R1(ops[i]); }\n    for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n      { endOperation_W1(ops[i$1]); }\n    for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n      { endOperation_R2(ops[i$2]); }\n    for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n      { endOperation_W2(ops[i$3]); }\n    for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n      { endOperation_finish(ops[i$4]); }\n  }\n\n  function endOperation_R1(op) {\n    var cm = op.cm, display = cm.display;\n    maybeClipScrollbars(cm);\n    if (op.updateMaxLine) { findMaxLine(cm); }\n\n    op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n      op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n                         op.scrollToPos.to.line >= display.viewTo) ||\n      display.maxLineChanged && cm.options.lineWrapping;\n    op.update = op.mustUpdate &&\n      new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n  }\n\n  function endOperation_W1(op) {\n    op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n  }\n\n  function endOperation_R2(op) {\n    var cm = op.cm, display = cm.display;\n    if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n    op.barMeasure = measureForScrollbars(cm);\n\n    // If the max line changed since it was last measured, measure it,\n    // and ensure the document's width matches it.\n    // updateDisplay_W2 will use these properties to do the actual resizing\n    if (display.maxLineChanged && !cm.options.lineWrapping) {\n      op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n      cm.display.sizerWidth = op.adjustWidthTo;\n      op.barMeasure.scrollWidth =\n        Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n      op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n    }\n\n    if (op.updatedDisplay || op.selectionChanged)\n      { op.preparedSelection = display.input.prepareSelection(); }\n  }\n\n  function endOperation_W2(op) {\n    var cm = op.cm;\n\n    if (op.adjustWidthTo != null) {\n      cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n      if (op.maxScrollLeft < cm.doc.scrollLeft)\n        { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n      cm.display.maxLineChanged = false;\n    }\n\n    var takeFocus = op.focus && op.focus == activeElt();\n    if (op.preparedSelection)\n      { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n    if (op.updatedDisplay || op.startHeight != cm.doc.height)\n      { updateScrollbars(cm, op.barMeasure); }\n    if (op.updatedDisplay)\n      { setDocumentHeight(cm, op.barMeasure); }\n\n    if (op.selectionChanged) { restartBlink(cm); }\n\n    if (cm.state.focused && op.updateInput)\n      { cm.display.input.reset(op.typing); }\n    if (takeFocus) { ensureFocus(op.cm); }\n  }\n\n  function endOperation_finish(op) {\n    var cm = op.cm, display = cm.display, doc = cm.doc;\n\n    if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n    // Abort mouse wheel delta measurement, when scrolling explicitly\n    if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n      { display.wheelStartX = display.wheelStartY = null; }\n\n    // Propagate the scroll position to the actual DOM scroller\n    if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n    if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n    // If we need to scroll a specific position into editor, do so.\n    if (op.scrollToPos) {\n      var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n                                   clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n      maybeScrollWindow(cm, rect);\n    }\n\n    // Fire events for markers that are hidden/unidden by editing or\n    // undoing\n    var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n    if (hidden) { for (var i = 0; i < hidden.length; ++i)\n      { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n    if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n      { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n    if (display.wrapper.offsetHeight)\n      { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n    // Fire change events, and delayed event handlers\n    if (op.changeObjs)\n      { signal(cm, \"changes\", cm, op.changeObjs); }\n    if (op.update)\n      { op.update.finish(); }\n  }\n\n  // Run the given function in an operation\n  function runInOp(cm, f) {\n    if (cm.curOp) { return f() }\n    startOperation(cm);\n    try { return f() }\n    finally { endOperation(cm); }\n  }\n  // Wraps a function in an operation. Returns the wrapped function.\n  function operation(cm, f) {\n    return function() {\n      if (cm.curOp) { return f.apply(cm, arguments) }\n      startOperation(cm);\n      try { return f.apply(cm, arguments) }\n      finally { endOperation(cm); }\n    }\n  }\n  // Used to add methods to editor and doc instances, wrapping them in\n  // operations.\n  function methodOp(f) {\n    return function() {\n      if (this.curOp) { return f.apply(this, arguments) }\n      startOperation(this);\n      try { return f.apply(this, arguments) }\n      finally { endOperation(this); }\n    }\n  }\n  function docMethodOp(f) {\n    return function() {\n      var cm = this.cm;\n      if (!cm || cm.curOp) { return f.apply(this, arguments) }\n      startOperation(cm);\n      try { return f.apply(this, arguments) }\n      finally { endOperation(cm); }\n    }\n  }\n\n  // HIGHLIGHT WORKER\n\n  function startWorker(cm, time) {\n    if (cm.doc.highlightFrontier < cm.display.viewTo)\n      { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n  }\n\n  function highlightWorker(cm) {\n    var doc = cm.doc;\n    if (doc.highlightFrontier >= cm.display.viewTo) { return }\n    var end = +new Date + cm.options.workTime;\n    var context = getContextBefore(cm, doc.highlightFrontier);\n    var changedLines = [];\n\n    doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n      if (context.line >= cm.display.viewFrom) { // Visible\n        var oldStyles = line.styles;\n        var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n        var highlighted = highlightLine(cm, line, context, true);\n        if (resetState) { context.state = resetState; }\n        line.styles = highlighted.styles;\n        var oldCls = line.styleClasses, newCls = highlighted.classes;\n        if (newCls) { line.styleClasses = newCls; }\n        else if (oldCls) { line.styleClasses = null; }\n        var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n          oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n        for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n        if (ischange) { changedLines.push(context.line); }\n        line.stateAfter = context.save();\n        context.nextLine();\n      } else {\n        if (line.text.length <= cm.options.maxHighlightLength)\n          { processLine(cm, line.text, context); }\n        line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n        context.nextLine();\n      }\n      if (+new Date > end) {\n        startWorker(cm, cm.options.workDelay);\n        return true\n      }\n    });\n    doc.highlightFrontier = context.line;\n    doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n    if (changedLines.length) { runInOp(cm, function () {\n      for (var i = 0; i < changedLines.length; i++)\n        { regLineChange(cm, changedLines[i], \"text\"); }\n    }); }\n  }\n\n  // DISPLAY DRAWING\n\n  var DisplayUpdate = function(cm, viewport, force) {\n    var display = cm.display;\n\n    this.viewport = viewport;\n    // Store some values that we'll need later (but don't want to force a relayout for)\n    this.visible = visibleLines(display, cm.doc, viewport);\n    this.editorIsHidden = !display.wrapper.offsetWidth;\n    this.wrapperHeight = display.wrapper.clientHeight;\n    this.wrapperWidth = display.wrapper.clientWidth;\n    this.oldDisplayWidth = displayWidth(cm);\n    this.force = force;\n    this.dims = getDimensions(cm);\n    this.events = [];\n  };\n\n  DisplayUpdate.prototype.signal = function (emitter, type) {\n    if (hasHandler(emitter, type))\n      { this.events.push(arguments); }\n  };\n  DisplayUpdate.prototype.finish = function () {\n      var this$1 = this;\n\n    for (var i = 0; i < this.events.length; i++)\n      { signal.apply(null, this$1.events[i]); }\n  };\n\n  function maybeClipScrollbars(cm) {\n    var display = cm.display;\n    if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n      display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n      display.heightForcer.style.height = scrollGap(cm) + \"px\";\n      display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n      display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n      display.scrollbarsClipped = true;\n    }\n  }\n\n  function selectionSnapshot(cm) {\n    if (cm.hasFocus()) { return null }\n    var active = activeElt();\n    if (!active || !contains(cm.display.lineDiv, active)) { return null }\n    var result = {activeElt: active};\n    if (window.getSelection) {\n      var sel = window.getSelection();\n      if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n        result.anchorNode = sel.anchorNode;\n        result.anchorOffset = sel.anchorOffset;\n        result.focusNode = sel.focusNode;\n        result.focusOffset = sel.focusOffset;\n      }\n    }\n    return result\n  }\n\n  function restoreSelection(snapshot) {\n    if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }\n    snapshot.activeElt.focus();\n    if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n      var sel = window.getSelection(), range$$1 = document.createRange();\n      range$$1.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n      range$$1.collapse(false);\n      sel.removeAllRanges();\n      sel.addRange(range$$1);\n      sel.extend(snapshot.focusNode, snapshot.focusOffset);\n    }\n  }\n\n  // Does the actual updating of the line display. Bails out\n  // (returning false) when there is nothing to be done and forced is\n  // false.\n  function updateDisplayIfNeeded(cm, update) {\n    var display = cm.display, doc = cm.doc;\n\n    if (update.editorIsHidden) {\n      resetView(cm);\n      return false\n    }\n\n    // Bail out if the visible area is already rendered and nothing changed.\n    if (!update.force &&\n        update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n        (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n        display.renderedView == display.view && countDirtyView(cm) == 0)\n      { return false }\n\n    if (maybeUpdateLineNumberWidth(cm)) {\n      resetView(cm);\n      update.dims = getDimensions(cm);\n    }\n\n    // Compute a suitable new viewport (from & to)\n    var end = doc.first + doc.size;\n    var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n    var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n    if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n    if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n    if (sawCollapsedSpans) {\n      from = visualLineNo(cm.doc, from);\n      to = visualLineEndNo(cm.doc, to);\n    }\n\n    var different = from != display.viewFrom || to != display.viewTo ||\n      display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n    adjustView(cm, from, to);\n\n    display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n    // Position the mover div to align with the current scroll position\n    cm.display.mover.style.top = display.viewOffset + \"px\";\n\n    var toUpdate = countDirtyView(cm);\n    if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n        (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n      { return false }\n\n    // For big changes, we hide the enclosing element during the\n    // update, since that speeds up the operations on most browsers.\n    var selSnapshot = selectionSnapshot(cm);\n    if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n    patchDisplay(cm, display.updateLineNumbers, update.dims);\n    if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n    display.renderedView = display.view;\n    // There might have been a widget with a focused element that got\n    // hidden or updated, if so re-focus it.\n    restoreSelection(selSnapshot);\n\n    // Prevent selection and cursors from interfering with the scroll\n    // width and height.\n    removeChildren(display.cursorDiv);\n    removeChildren(display.selectionDiv);\n    display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n    if (different) {\n      display.lastWrapHeight = update.wrapperHeight;\n      display.lastWrapWidth = update.wrapperWidth;\n      startWorker(cm, 400);\n    }\n\n    display.updateLineNumbers = null;\n\n    return true\n  }\n\n  function postUpdateDisplay(cm, update) {\n    var viewport = update.viewport;\n\n    for (var first = true;; first = false) {\n      if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n        // Clip forced viewport to actual scrollable area.\n        if (viewport && viewport.top != null)\n          { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n        // Updated line heights might result in the drawn area not\n        // actually covering the viewport. Keep looping until it does.\n        update.visible = visibleLines(cm.display, cm.doc, viewport);\n        if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n          { break }\n      }\n      if (!updateDisplayIfNeeded(cm, update)) { break }\n      updateHeightsInViewport(cm);\n      var barMeasure = measureForScrollbars(cm);\n      updateSelection(cm);\n      updateScrollbars(cm, barMeasure);\n      setDocumentHeight(cm, barMeasure);\n      update.force = false;\n    }\n\n    update.signal(cm, \"update\", cm);\n    if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n      update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n      cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n    }\n  }\n\n  function updateDisplaySimple(cm, viewport) {\n    var update = new DisplayUpdate(cm, viewport);\n    if (updateDisplayIfNeeded(cm, update)) {\n      updateHeightsInViewport(cm);\n      postUpdateDisplay(cm, update);\n      var barMeasure = measureForScrollbars(cm);\n      updateSelection(cm);\n      updateScrollbars(cm, barMeasure);\n      setDocumentHeight(cm, barMeasure);\n      update.finish();\n    }\n  }\n\n  // Sync the actual display DOM structure with display.editor, removing\n  // nodes for lines that are no longer in editor, and creating the ones\n  // that are not there yet, and updating the ones that are out of\n  // date.\n  function patchDisplay(cm, updateNumbersFrom, dims) {\n    var display = cm.display, lineNumbers = cm.options.lineNumbers;\n    var container = display.lineDiv, cur = container.firstChild;\n\n    function rm(node) {\n      var next = node.nextSibling;\n      // Works around a throw-scroll bug in OS X Webkit\n      if (webkit && mac && cm.display.currentWheelTarget == node)\n        { node.style.display = \"none\"; }\n      else\n        { node.parentNode.removeChild(node); }\n      return next\n    }\n\n    var view = display.view, lineN = display.viewFrom;\n    // Loop over the elements in the editor, syncing cur (the DOM nodes\n    // in display.lineDiv) with the editor as we go.\n    for (var i = 0; i < view.length; i++) {\n      var lineView = view[i];\n      if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n        var node = buildLineElement(cm, lineView, lineN, dims);\n        container.insertBefore(node, cur);\n      } else { // Already drawn\n        while (cur != lineView.node) { cur = rm(cur); }\n        var updateNumber = lineNumbers && updateNumbersFrom != null &&\n          updateNumbersFrom <= lineN && lineView.lineNumber;\n        if (lineView.changes) {\n          if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n          updateLineForChanges(cm, lineView, lineN, dims);\n        }\n        if (updateNumber) {\n          removeChildren(lineView.lineNumber);\n          lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n        }\n        cur = lineView.node.nextSibling;\n      }\n      lineN += lineView.size;\n    }\n    while (cur) { cur = rm(cur); }\n  }\n\n  function updateGutterSpace(display) {\n    var width = display.gutters.offsetWidth;\n    display.sizer.style.marginLeft = width + \"px\";\n  }\n\n  function setDocumentHeight(cm, measure) {\n    cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n    cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n    cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n  }\n\n  // Re-align line numbers and gutter marks to compensate for\n  // horizontal scrolling.\n  function alignHorizontally(cm) {\n    var display = cm.display, view = display.view;\n    if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n    var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n    var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n    for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n      if (cm.options.fixedGutter) {\n        if (view[i].gutter)\n          { view[i].gutter.style.left = left; }\n        if (view[i].gutterBackground)\n          { view[i].gutterBackground.style.left = left; }\n      }\n      var align = view[i].alignable;\n      if (align) { for (var j = 0; j < align.length; j++)\n        { align[j].style.left = left; } }\n    } }\n    if (cm.options.fixedGutter)\n      { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n  }\n\n  // Used to ensure that the line number gutter is still the right\n  // size for the current document size. Returns true when an update\n  // is needed.\n  function maybeUpdateLineNumberWidth(cm) {\n    if (!cm.options.lineNumbers) { return false }\n    var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n    if (last.length != display.lineNumChars) {\n      var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n                                                 \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n      var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n      display.lineGutter.style.width = \"\";\n      display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n      display.lineNumWidth = display.lineNumInnerWidth + padding;\n      display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n      display.lineGutter.style.width = display.lineNumWidth + \"px\";\n      updateGutterSpace(cm.display);\n      return true\n    }\n    return false\n  }\n\n  function getGutters(gutters, lineNumbers) {\n    var result = [], sawLineNumbers = false;\n    for (var i = 0; i < gutters.length; i++) {\n      var name = gutters[i], style = null;\n      if (typeof name != \"string\") { style = name.style; name = name.className; }\n      if (name == \"CodeMirror-linenumbers\") {\n        if (!lineNumbers) { continue }\n        else { sawLineNumbers = true; }\n      }\n      result.push({className: name, style: style});\n    }\n    if (lineNumbers && !sawLineNumbers) { result.push({className: \"CodeMirror-linenumbers\", style: null}); }\n    return result\n  }\n\n  // Rebuild the gutter elements, ensure the margin to the left of the\n  // code matches their width.\n  function renderGutters(display) {\n    var gutters = display.gutters, specs = display.gutterSpecs;\n    removeChildren(gutters);\n    display.lineGutter = null;\n    for (var i = 0; i < specs.length; ++i) {\n      var ref = specs[i];\n      var className = ref.className;\n      var style = ref.style;\n      var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + className));\n      if (style) { gElt.style.cssText = style; }\n      if (className == \"CodeMirror-linenumbers\") {\n        display.lineGutter = gElt;\n        gElt.style.width = (display.lineNumWidth || 1) + \"px\";\n      }\n    }\n    gutters.style.display = specs.length ? \"\" : \"none\";\n    updateGutterSpace(display);\n  }\n\n  function updateGutters(cm) {\n    renderGutters(cm.display);\n    regChange(cm);\n    alignHorizontally(cm);\n  }\n\n  // The display handles the DOM integration, both for input reading\n  // and content drawing. It holds references to DOM nodes and\n  // display-related state.\n\n  function Display(place, doc, input, options) {\n    var d = this;\n    this.input = input;\n\n    // Covers bottom-right square when both scrollbars are present.\n    d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n    d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n    // Covers bottom of gutter when coverGutterNextToScrollbar is on\n    // and h scrollbar is present.\n    d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n    d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n    // Will contain the actual code, positioned to cover the viewport.\n    d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n    // Elements are added to these to represent selection and cursors.\n    d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n    d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n    // A visibility: hidden element used to find the size of things.\n    d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n    // When lines outside of the viewport are measured, they are drawn in this.\n    d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n    // Wraps everything that needs to exist inside the vertically-padded coordinate system\n    d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n                      null, \"position: relative; outline: none\");\n    var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n    // Moved around its parent to cover visible editor.\n    d.mover = elt(\"div\", [lines], null, \"position: relative\");\n    // Set to the height of the document, allowing scrolling.\n    d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n    d.sizerWidth = null;\n    // Behavior of elts with overflow: auto and padding is\n    // inconsistent across browsers. This is used to ensure the\n    // scrollable area is big enough.\n    d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n    // Will contain the gutters, if any.\n    d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n    d.lineGutter = null;\n    // Actual scrollable element.\n    d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n    d.scroller.setAttribute(\"tabIndex\", \"-1\");\n    // The element in which the editor lives.\n    d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n    // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n    if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n    if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n    if (place) {\n      if (place.appendChild) { place.appendChild(d.wrapper); }\n      else { place(d.wrapper); }\n    }\n\n    // Current rendered range (may be bigger than the editor window).\n    d.viewFrom = d.viewTo = doc.first;\n    d.reportedViewFrom = d.reportedViewTo = doc.first;\n    // Information about the rendered lines.\n    d.view = [];\n    d.renderedView = null;\n    // Holds info about a single rendered line when it was rendered\n    // for measurement, while not in editor.\n    d.externalMeasured = null;\n    // Empty space (in pixels) above the editor\n    d.viewOffset = 0;\n    d.lastWrapHeight = d.lastWrapWidth = 0;\n    d.updateLineNumbers = null;\n\n    d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n    d.scrollbarsClipped = false;\n\n    // Used to only resize the line number gutter when necessary (when\n    // the amount of lines crosses a boundary that makes its width change)\n    d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n    // Set to true when a non-horizontal-scrolling line widget is\n    // added. As an optimization, line widget aligning is skipped when\n    // this is false.\n    d.alignWidgets = false;\n\n    d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n    // Tracks the maximum line length so that the horizontal scrollbar\n    // can be kept static when scrolling.\n    d.maxLine = null;\n    d.maxLineLength = 0;\n    d.maxLineChanged = false;\n\n    // Used for measuring wheel scrolling granularity\n    d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n    // True when shift is held down.\n    d.shift = false;\n\n    // Used to track whether anything happened since the context menu\n    // was opened.\n    d.selForContextMenu = null;\n\n    d.activeTouch = null;\n\n    d.gutterSpecs = getGutters(options.gutters, options.lineNumbers);\n    renderGutters(d);\n\n    input.init(d);\n  }\n\n  // Since the delta values reported on mouse wheel events are\n  // unstandardized between browsers and even browser versions, and\n  // generally horribly unpredictable, this code starts by measuring\n  // the scroll effect that the first few mouse wheel events have,\n  // and, from that, detects the way it can convert deltas to pixel\n  // offsets afterwards.\n  //\n  // The reason we want to know the amount a wheel event will scroll\n  // is that it gives us a chance to update the display before the\n  // actual scrolling happens, reducing flickering.\n\n  var wheelSamples = 0, wheelPixelsPerUnit = null;\n  // Fill in a browser-detected starting value on browsers where we\n  // know one. These don't have to be accurate -- the result of them\n  // being wrong would just be a slight flicker on the first wheel\n  // scroll (if it is large enough).\n  if (ie) { wheelPixelsPerUnit = -.53; }\n  else if (gecko) { wheelPixelsPerUnit = 15; }\n  else if (chrome) { wheelPixelsPerUnit = -.7; }\n  else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n  function wheelEventDelta(e) {\n    var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n    if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n    if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n    else if (dy == null) { dy = e.wheelDelta; }\n    return {x: dx, y: dy}\n  }\n  function wheelEventPixels(e) {\n    var delta = wheelEventDelta(e);\n    delta.x *= wheelPixelsPerUnit;\n    delta.y *= wheelPixelsPerUnit;\n    return delta\n  }\n\n  function onScrollWheel(cm, e) {\n    var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n\n    var display = cm.display, scroll = display.scroller;\n    // Quit if there's nothing to scroll here\n    var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n    var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n    if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n    // Webkit browsers on OS X abort momentum scrolls when the target\n    // of the scroll event is removed from the scrollable element.\n    // This hack (see related code in patchDisplay) makes sure the\n    // element is kept around.\n    if (dy && mac && webkit) {\n      outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n        for (var i = 0; i < view.length; i++) {\n          if (view[i].node == cur) {\n            cm.display.currentWheelTarget = cur;\n            break outer\n          }\n        }\n      }\n    }\n\n    // On some browsers, horizontal scrolling will cause redraws to\n    // happen before the gutter has been realigned, causing it to\n    // wriggle around in a most unseemly way. When we have an\n    // estimated pixels/delta value, we just handle horizontal\n    // scrolling entirely here. It'll be slightly off from native, but\n    // better than glitching out.\n    if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {\n      if (dy && canScrollY)\n        { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); }\n      setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit));\n      // Only prevent default scrolling if vertical scrolling is\n      // actually possible. Otherwise, it causes vertical scroll\n      // jitter on OSX trackpads when deltaX is small and deltaY\n      // is large (issue #3579)\n      if (!dy || (dy && canScrollY))\n        { e_preventDefault(e); }\n      display.wheelStartX = null; // Abort measurement, if in progress\n      return\n    }\n\n    // 'Project' the visible viewport to cover the area that is being\n    // scrolled into editor (if we know enough to estimate it).\n    if (dy && wheelPixelsPerUnit != null) {\n      var pixels = dy * wheelPixelsPerUnit;\n      var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n      if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n      else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n      updateDisplaySimple(cm, {top: top, bottom: bot});\n    }\n\n    if (wheelSamples < 20) {\n      if (display.wheelStartX == null) {\n        display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n        display.wheelDX = dx; display.wheelDY = dy;\n        setTimeout(function () {\n          if (display.wheelStartX == null) { return }\n          var movedX = scroll.scrollLeft - display.wheelStartX;\n          var movedY = scroll.scrollTop - display.wheelStartY;\n          var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n            (movedX && display.wheelDX && movedX / display.wheelDX);\n          display.wheelStartX = display.wheelStartY = null;\n          if (!sample) { return }\n          wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n          ++wheelSamples;\n        }, 200);\n      } else {\n        display.wheelDX += dx; display.wheelDY += dy;\n      }\n    }\n  }\n\n  // Selection objects are immutable. A new one is created every time\n  // the selection changes. A selection is one or more non-overlapping\n  // (and non-touching) ranges, sorted, and an integer that indicates\n  // which one is the primary selection (the one that's scrolled into\n  // editor, that getCursor returns, etc).\n  var Selection = function(ranges, primIndex) {\n    this.ranges = ranges;\n    this.primIndex = primIndex;\n  };\n\n  Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n  Selection.prototype.equals = function (other) {\n      var this$1 = this;\n\n    if (other == this) { return true }\n    if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n    for (var i = 0; i < this.ranges.length; i++) {\n      var here = this$1.ranges[i], there = other.ranges[i];\n      if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n    }\n    return true\n  };\n\n  Selection.prototype.deepCopy = function () {\n      var this$1 = this;\n\n    var out = [];\n    for (var i = 0; i < this.ranges.length; i++)\n      { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)); }\n    return new Selection(out, this.primIndex)\n  };\n\n  Selection.prototype.somethingSelected = function () {\n      var this$1 = this;\n\n    for (var i = 0; i < this.ranges.length; i++)\n      { if (!this$1.ranges[i].empty()) { return true } }\n    return false\n  };\n\n  Selection.prototype.contains = function (pos, end) {\n      var this$1 = this;\n\n    if (!end) { end = pos; }\n    for (var i = 0; i < this.ranges.length; i++) {\n      var range = this$1.ranges[i];\n      if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n        { return i }\n    }\n    return -1\n  };\n\n  var Range = function(anchor, head) {\n    this.anchor = anchor; this.head = head;\n  };\n\n  Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n  Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n  Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n  // Take an unsorted, potentially overlapping set of ranges, and\n  // build a selection out of it. 'Consumes' ranges array (modifying\n  // it).\n  function normalizeSelection(cm, ranges, primIndex) {\n    var mayTouch = cm && cm.options.selectionsMayTouch;\n    var prim = ranges[primIndex];\n    ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n    primIndex = indexOf(ranges, prim);\n    for (var i = 1; i < ranges.length; i++) {\n      var cur = ranges[i], prev = ranges[i - 1];\n      var diff = cmp(prev.to(), cur.from());\n      if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n        var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n        var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n        if (i <= primIndex) { --primIndex; }\n        ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n      }\n    }\n    return new Selection(ranges, primIndex)\n  }\n\n  function simpleSelection(anchor, head) {\n    return new Selection([new Range(anchor, head || anchor)], 0)\n  }\n\n  // Compute the position of the end of a change (its 'to' property\n  // refers to the pre-change end).\n  function changeEnd(change) {\n    if (!change.text) { return change.to }\n    return Pos(change.from.line + change.text.length - 1,\n               lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n  }\n\n  // Adjust a position to refer to the post-change position of the\n  // same text, or the end of the change if the change covers it.\n  function adjustForChange(pos, change) {\n    if (cmp(pos, change.from) < 0) { return pos }\n    if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n    var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n    if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n    return Pos(line, ch)\n  }\n\n  function computeSelAfterChange(doc, change) {\n    var out = [];\n    for (var i = 0; i < doc.sel.ranges.length; i++) {\n      var range = doc.sel.ranges[i];\n      out.push(new Range(adjustForChange(range.anchor, change),\n                         adjustForChange(range.head, change)));\n    }\n    return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n  }\n\n  function offsetPos(pos, old, nw) {\n    if (pos.line == old.line)\n      { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n    else\n      { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n  }\n\n  // Used by replaceSelections to allow moving the selection to the\n  // start or around the replaced test. Hint may be \"start\" or \"around\".\n  function computeReplacedSel(doc, changes, hint) {\n    var out = [];\n    var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n    for (var i = 0; i < changes.length; i++) {\n      var change = changes[i];\n      var from = offsetPos(change.from, oldPrev, newPrev);\n      var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n      oldPrev = change.to;\n      newPrev = to;\n      if (hint == \"around\") {\n        var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n        out[i] = new Range(inv ? to : from, inv ? from : to);\n      } else {\n        out[i] = new Range(from, from);\n      }\n    }\n    return new Selection(out, doc.sel.primIndex)\n  }\n\n  // Used to get the editor into a consistent state again when options change.\n\n  function loadMode(cm) {\n    cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n    resetModeState(cm);\n  }\n\n  function resetModeState(cm) {\n    cm.doc.iter(function (line) {\n      if (line.stateAfter) { line.stateAfter = null; }\n      if (line.styles) { line.styles = null; }\n    });\n    cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n    startWorker(cm, 100);\n    cm.state.modeGen++;\n    if (cm.curOp) { regChange(cm); }\n  }\n\n  // DOCUMENT DATA STRUCTURE\n\n  // By default, updates that start and end at the beginning of a line\n  // are treated specially, in order to make the association of line\n  // widgets and marker elements with the text behave more intuitive.\n  function isWholeLineUpdate(doc, change) {\n    return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n      (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n  }\n\n  // Perform a change on the document data structure.\n  function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n    function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n    function update(line, text, spans) {\n      updateLine(line, text, spans, estimateHeight$$1);\n      signalLater(line, \"change\", line, change);\n    }\n    function linesFor(start, end) {\n      var result = [];\n      for (var i = start; i < end; ++i)\n        { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n      return result\n    }\n\n    var from = change.from, to = change.to, text = change.text;\n    var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n    var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n    // Adjust the line structure\n    if (change.full) {\n      doc.insert(0, linesFor(0, text.length));\n      doc.remove(text.length, doc.size - text.length);\n    } else if (isWholeLineUpdate(doc, change)) {\n      // This is a whole-line replace. Treated specially to make\n      // sure line objects move the way they are supposed to.\n      var added = linesFor(0, text.length - 1);\n      update(lastLine, lastLine.text, lastSpans);\n      if (nlines) { doc.remove(from.line, nlines); }\n      if (added.length) { doc.insert(from.line, added); }\n    } else if (firstLine == lastLine) {\n      if (text.length == 1) {\n        update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n      } else {\n        var added$1 = linesFor(1, text.length - 1);\n        added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n        update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n        doc.insert(from.line + 1, added$1);\n      }\n    } else if (text.length == 1) {\n      update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n      doc.remove(from.line + 1, nlines);\n    } else {\n      update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n      update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n      var added$2 = linesFor(1, text.length - 1);\n      if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n      doc.insert(from.line + 1, added$2);\n    }\n\n    signalLater(doc, \"change\", doc, change);\n  }\n\n  // Call f for all linked documents.\n  function linkedDocs(doc, f, sharedHistOnly) {\n    function propagate(doc, skip, sharedHist) {\n      if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n        var rel = doc.linked[i];\n        if (rel.doc == skip) { continue }\n        var shared = sharedHist && rel.sharedHist;\n        if (sharedHistOnly && !shared) { continue }\n        f(rel.doc, shared);\n        propagate(rel.doc, doc, shared);\n      } }\n    }\n    propagate(doc, null, true);\n  }\n\n  // Attach a document to an editor.\n  function attachDoc(cm, doc) {\n    if (doc.cm) { throw new Error(\"This document is already in use.\") }\n    cm.doc = doc;\n    doc.cm = cm;\n    estimateLineHeights(cm);\n    loadMode(cm);\n    setDirectionClass(cm);\n    if (!cm.options.lineWrapping) { findMaxLine(cm); }\n    cm.options.mode = doc.modeOption;\n    regChange(cm);\n  }\n\n  function setDirectionClass(cm) {\n  (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n  }\n\n  function directionChanged(cm) {\n    runInOp(cm, function () {\n      setDirectionClass(cm);\n      regChange(cm);\n    });\n  }\n\n  function History(startGen) {\n    // Arrays of change events and selections. Doing something adds an\n    // event to done and clears undo. Undoing moves events from done\n    // to undone, redoing moves them in the other direction.\n    this.done = []; this.undone = [];\n    this.undoDepth = Infinity;\n    // Used to track when changes can be merged into a single undo\n    // event\n    this.lastModTime = this.lastSelTime = 0;\n    this.lastOp = this.lastSelOp = null;\n    this.lastOrigin = this.lastSelOrigin = null;\n    // Used by the isClean() method\n    this.generation = this.maxGeneration = startGen || 1;\n  }\n\n  // Create a history change event from an updateDoc-style change\n  // object.\n  function historyChangeFromChange(doc, change) {\n    var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n    attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n    linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n    return histChange\n  }\n\n  // Pop all selection events off the end of a history array. Stop at\n  // a change event.\n  function clearSelectionEvents(array) {\n    while (array.length) {\n      var last = lst(array);\n      if (last.ranges) { array.pop(); }\n      else { break }\n    }\n  }\n\n  // Find the top change event in the history. Pop off selection\n  // events that are in the way.\n  function lastChangeEvent(hist, force) {\n    if (force) {\n      clearSelectionEvents(hist.done);\n      return lst(hist.done)\n    } else if (hist.done.length && !lst(hist.done).ranges) {\n      return lst(hist.done)\n    } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n      hist.done.pop();\n      return lst(hist.done)\n    }\n  }\n\n  // Register a change in the history. Merges changes that are within\n  // a single operation, or are close together with an origin that\n  // allows merging (starting with \"+\") into a single event.\n  function addChangeToHistory(doc, change, selAfter, opId) {\n    var hist = doc.history;\n    hist.undone.length = 0;\n    var time = +new Date, cur;\n    var last;\n\n    if ((hist.lastOp == opId ||\n         hist.lastOrigin == change.origin && change.origin &&\n         ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n          change.origin.charAt(0) == \"*\")) &&\n        (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n      // Merge this change into the last event\n      last = lst(cur.changes);\n      if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n        // Optimized case for simple insertion -- don't want to add\n        // new changesets for every character typed\n        last.to = changeEnd(change);\n      } else {\n        // Add new sub-event\n        cur.changes.push(historyChangeFromChange(doc, change));\n      }\n    } else {\n      // Can not be merged, start a new event.\n      var before = lst(hist.done);\n      if (!before || !before.ranges)\n        { pushSelectionToHistory(doc.sel, hist.done); }\n      cur = {changes: [historyChangeFromChange(doc, change)],\n             generation: hist.generation};\n      hist.done.push(cur);\n      while (hist.done.length > hist.undoDepth) {\n        hist.done.shift();\n        if (!hist.done[0].ranges) { hist.done.shift(); }\n      }\n    }\n    hist.done.push(selAfter);\n    hist.generation = ++hist.maxGeneration;\n    hist.lastModTime = hist.lastSelTime = time;\n    hist.lastOp = hist.lastSelOp = opId;\n    hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n    if (!last) { signal(doc, \"historyAdded\"); }\n  }\n\n  function selectionEventCanBeMerged(doc, origin, prev, sel) {\n    var ch = origin.charAt(0);\n    return ch == \"*\" ||\n      ch == \"+\" &&\n      prev.ranges.length == sel.ranges.length &&\n      prev.somethingSelected() == sel.somethingSelected() &&\n      new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n  }\n\n  // Called whenever the selection changes, sets the new selection as\n  // the pending selection in the history, and pushes the old pending\n  // selection into the 'done' array when it was significantly\n  // different (in number of selected ranges, emptiness, or time).\n  function addSelectionToHistory(doc, sel, opId, options) {\n    var hist = doc.history, origin = options && options.origin;\n\n    // A new event is started when the previous origin does not match\n    // the current, or the origins don't allow matching. Origins\n    // starting with * are always merged, those starting with + are\n    // merged when similar and close together in time.\n    if (opId == hist.lastSelOp ||\n        (origin && hist.lastSelOrigin == origin &&\n         (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n          selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n      { hist.done[hist.done.length - 1] = sel; }\n    else\n      { pushSelectionToHistory(sel, hist.done); }\n\n    hist.lastSelTime = +new Date;\n    hist.lastSelOrigin = origin;\n    hist.lastSelOp = opId;\n    if (options && options.clearRedo !== false)\n      { clearSelectionEvents(hist.undone); }\n  }\n\n  function pushSelectionToHistory(sel, dest) {\n    var top = lst(dest);\n    if (!(top && top.ranges && top.equals(sel)))\n      { dest.push(sel); }\n  }\n\n  // Used to store marked span information in the history.\n  function attachLocalSpans(doc, change, from, to) {\n    var existing = change[\"spans_\" + doc.id], n = 0;\n    doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n      if (line.markedSpans)\n        { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n      ++n;\n    });\n  }\n\n  // When un/re-doing restores text containing marked spans, those\n  // that have been explicitly cleared should not be restored.\n  function removeClearedSpans(spans) {\n    if (!spans) { return null }\n    var out;\n    for (var i = 0; i < spans.length; ++i) {\n      if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n      else if (out) { out.push(spans[i]); }\n    }\n    return !out ? spans : out.length ? out : null\n  }\n\n  // Retrieve and filter the old marked spans stored in a change event.\n  function getOldSpans(doc, change) {\n    var found = change[\"spans_\" + doc.id];\n    if (!found) { return null }\n    var nw = [];\n    for (var i = 0; i < change.text.length; ++i)\n      { nw.push(removeClearedSpans(found[i])); }\n    return nw\n  }\n\n  // Used for un/re-doing changes from the history. Combines the\n  // result of computing the existing spans with the set of spans that\n  // existed in the history (so that deleting around a span and then\n  // undoing brings back the span).\n  function mergeOldSpans(doc, change) {\n    var old = getOldSpans(doc, change);\n    var stretched = stretchSpansOverChange(doc, change);\n    if (!old) { return stretched }\n    if (!stretched) { return old }\n\n    for (var i = 0; i < old.length; ++i) {\n      var oldCur = old[i], stretchCur = stretched[i];\n      if (oldCur && stretchCur) {\n        spans: for (var j = 0; j < stretchCur.length; ++j) {\n          var span = stretchCur[j];\n          for (var k = 0; k < oldCur.length; ++k)\n            { if (oldCur[k].marker == span.marker) { continue spans } }\n          oldCur.push(span);\n        }\n      } else if (stretchCur) {\n        old[i] = stretchCur;\n      }\n    }\n    return old\n  }\n\n  // Used both to provide a JSON-safe object in .getHistory, and, when\n  // detaching a document, to split the history in two\n  function copyHistoryArray(events, newGroup, instantiateSel) {\n    var copy = [];\n    for (var i = 0; i < events.length; ++i) {\n      var event = events[i];\n      if (event.ranges) {\n        copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n        continue\n      }\n      var changes = event.changes, newChanges = [];\n      copy.push({changes: newChanges});\n      for (var j = 0; j < changes.length; ++j) {\n        var change = changes[j], m = (void 0);\n        newChanges.push({from: change.from, to: change.to, text: change.text});\n        if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n          if (indexOf(newGroup, Number(m[1])) > -1) {\n            lst(newChanges)[prop] = change[prop];\n            delete change[prop];\n          }\n        } } }\n      }\n    }\n    return copy\n  }\n\n  // The 'scroll' parameter given to many of these indicated whether\n  // the new cursor position should be scrolled into editor after\n  // modifying the selection.\n\n  // If shift is held or the extend flag is set, extends a range to\n  // include a given position (and optionally a second position).\n  // Otherwise, simply returns the range between the given positions.\n  // Used for cursor motion and such.\n  function extendRange(range, head, other, extend) {\n    if (extend) {\n      var anchor = range.anchor;\n      if (other) {\n        var posBefore = cmp(head, anchor) < 0;\n        if (posBefore != (cmp(other, anchor) < 0)) {\n          anchor = head;\n          head = other;\n        } else if (posBefore != (cmp(head, other) < 0)) {\n          head = other;\n        }\n      }\n      return new Range(anchor, head)\n    } else {\n      return new Range(other || head, head)\n    }\n  }\n\n  // Extend the primary selection range, discard the rest.\n  function extendSelection(doc, head, other, options, extend) {\n    if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n    setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n  }\n\n  // Extend all selections (pos is an array of selections with length\n  // equal the number of selections)\n  function extendSelections(doc, heads, options) {\n    var out = [];\n    var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n    for (var i = 0; i < doc.sel.ranges.length; i++)\n      { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n    var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n    setSelection(doc, newSel, options);\n  }\n\n  // Updates a single range in the selection.\n  function replaceOneSelection(doc, i, range, options) {\n    var ranges = doc.sel.ranges.slice(0);\n    ranges[i] = range;\n    setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n  }\n\n  // Reset the selection to a single range.\n  function setSimpleSelection(doc, anchor, head, options) {\n    setSelection(doc, simpleSelection(anchor, head), options);\n  }\n\n  // Give beforeSelectionChange handlers a change to influence a\n  // selection update.\n  function filterSelectionChange(doc, sel, options) {\n    var obj = {\n      ranges: sel.ranges,\n      update: function(ranges) {\n        var this$1 = this;\n\n        this.ranges = [];\n        for (var i = 0; i < ranges.length; i++)\n          { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n                                     clipPos(doc, ranges[i].head)); }\n      },\n      origin: options && options.origin\n    };\n    signal(doc, \"beforeSelectionChange\", doc, obj);\n    if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n    if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n    else { return sel }\n  }\n\n  function setSelectionReplaceHistory(doc, sel, options) {\n    var done = doc.history.done, last = lst(done);\n    if (last && last.ranges) {\n      done[done.length - 1] = sel;\n      setSelectionNoUndo(doc, sel, options);\n    } else {\n      setSelection(doc, sel, options);\n    }\n  }\n\n  // Set a new selection.\n  function setSelection(doc, sel, options) {\n    setSelectionNoUndo(doc, sel, options);\n    addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n  }\n\n  function setSelectionNoUndo(doc, sel, options) {\n    if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n      { sel = filterSelectionChange(doc, sel, options); }\n\n    var bias = options && options.bias ||\n      (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n    setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n    if (!(options && options.scroll === false) && doc.cm)\n      { ensureCursorVisible(doc.cm); }\n  }\n\n  function setSelectionInner(doc, sel) {\n    if (sel.equals(doc.sel)) { return }\n\n    doc.sel = sel;\n\n    if (doc.cm) {\n      doc.cm.curOp.updateInput = 1;\n      doc.cm.curOp.selectionChanged = true;\n      signalCursorActivity(doc.cm);\n    }\n    signalLater(doc, \"cursorActivity\", doc);\n  }\n\n  // Verify that the selection does not partially select any atomic\n  // marked ranges.\n  function reCheckSelection(doc) {\n    setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n  }\n\n  // Return a selection that does not partially select any atomic\n  // ranges.\n  function skipAtomicInSelection(doc, sel, bias, mayClear) {\n    var out;\n    for (var i = 0; i < sel.ranges.length; i++) {\n      var range = sel.ranges[i];\n      var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n      var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n      var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n      if (out || newAnchor != range.anchor || newHead != range.head) {\n        if (!out) { out = sel.ranges.slice(0, i); }\n        out[i] = new Range(newAnchor, newHead);\n      }\n    }\n    return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n  }\n\n  function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n    var line = getLine(doc, pos.line);\n    if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n      var sp = line.markedSpans[i], m = sp.marker;\n\n      // Determine if we should prevent the cursor being placed to the left/right of an atomic marker\n      // Historically this was determined using the inclusiveLeft/Right option, but the new way to control it\n      // is with selectLeft/Right\n      var preventCursorLeft = (\"selectLeft\" in m) ? !m.selectLeft : m.inclusiveLeft;\n      var preventCursorRight = (\"selectRight\" in m) ? !m.selectRight : m.inclusiveRight;\n\n      if ((sp.from == null || (preventCursorLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n          (sp.to == null || (preventCursorRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n        if (mayClear) {\n          signal(m, \"beforeCursorEnter\");\n          if (m.explicitlyCleared) {\n            if (!line.markedSpans) { break }\n            else {--i; continue}\n          }\n        }\n        if (!m.atomic) { continue }\n\n        if (oldPos) {\n          var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n          if (dir < 0 ? preventCursorRight : preventCursorLeft)\n            { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n          if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n            { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n        }\n\n        var far = m.find(dir < 0 ? -1 : 1);\n        if (dir < 0 ? preventCursorLeft : preventCursorRight)\n          { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n        return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n      }\n    } }\n    return pos\n  }\n\n  // Ensure a given position is not inside an atomic range.\n  function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n    var dir = bias || 1;\n    var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n        (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n        skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n        (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n    if (!found) {\n      doc.cantEdit = true;\n      return Pos(doc.first, 0)\n    }\n    return found\n  }\n\n  function movePos(doc, pos, dir, line) {\n    if (dir < 0 && pos.ch == 0) {\n      if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n      else { return null }\n    } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n      if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n      else { return null }\n    } else {\n      return new Pos(pos.line, pos.ch + dir)\n    }\n  }\n\n  function selectAll(cm) {\n    cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n  }\n\n  // UPDATING\n\n  // Allow \"beforeChange\" event handlers to influence a change\n  function filterChange(doc, change, update) {\n    var obj = {\n      canceled: false,\n      from: change.from,\n      to: change.to,\n      text: change.text,\n      origin: change.origin,\n      cancel: function () { return obj.canceled = true; }\n    };\n    if (update) { obj.update = function (from, to, text, origin) {\n      if (from) { obj.from = clipPos(doc, from); }\n      if (to) { obj.to = clipPos(doc, to); }\n      if (text) { obj.text = text; }\n      if (origin !== undefined) { obj.origin = origin; }\n    }; }\n    signal(doc, \"beforeChange\", doc, obj);\n    if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n    if (obj.canceled) {\n      if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n      return null\n    }\n    return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n  }\n\n  // Apply a change to a document, and add it to the document's\n  // history, and propagating it to all linked documents.\n  function makeChange(doc, change, ignoreReadOnly) {\n    if (doc.cm) {\n      if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n      if (doc.cm.state.suppressEdits) { return }\n    }\n\n    if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n      change = filterChange(doc, change, true);\n      if (!change) { return }\n    }\n\n    // Possibly split or suppress the update based on the presence\n    // of read-only spans in its range.\n    var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n    if (split) {\n      for (var i = split.length - 1; i >= 0; --i)\n        { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n    } else {\n      makeChangeInner(doc, change);\n    }\n  }\n\n  function makeChangeInner(doc, change) {\n    if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n    var selAfter = computeSelAfterChange(doc, change);\n    addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n    makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n    var rebased = [];\n\n    linkedDocs(doc, function (doc, sharedHist) {\n      if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n        rebaseHist(doc.history, change);\n        rebased.push(doc.history);\n      }\n      makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n    });\n  }\n\n  // Revert a change stored in a document's history.\n  function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n    var suppress = doc.cm && doc.cm.state.suppressEdits;\n    if (suppress && !allowSelectionOnly) { return }\n\n    var hist = doc.history, event, selAfter = doc.sel;\n    var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n    // Verify that there is a useable event (so that ctrl-z won't\n    // needlessly clear selection events)\n    var i = 0;\n    for (; i < source.length; i++) {\n      event = source[i];\n      if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n        { break }\n    }\n    if (i == source.length) { return }\n    hist.lastOrigin = hist.lastSelOrigin = null;\n\n    for (;;) {\n      event = source.pop();\n      if (event.ranges) {\n        pushSelectionToHistory(event, dest);\n        if (allowSelectionOnly && !event.equals(doc.sel)) {\n          setSelection(doc, event, {clearRedo: false});\n          return\n        }\n        selAfter = event;\n      } else if (suppress) {\n        source.push(event);\n        return\n      } else { break }\n    }\n\n    // Build up a reverse change object to add to the opposite history\n    // stack (redo when undoing, and vice versa).\n    var antiChanges = [];\n    pushSelectionToHistory(selAfter, dest);\n    dest.push({changes: antiChanges, generation: hist.generation});\n    hist.generation = event.generation || ++hist.maxGeneration;\n\n    var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n    var loop = function ( i ) {\n      var change = event.changes[i];\n      change.origin = type;\n      if (filter && !filterChange(doc, change, false)) {\n        source.length = 0;\n        return {}\n      }\n\n      antiChanges.push(historyChangeFromChange(doc, change));\n\n      var after = i ? computeSelAfterChange(doc, change) : lst(source);\n      makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n      if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n      var rebased = [];\n\n      // Propagate to the linked documents\n      linkedDocs(doc, function (doc, sharedHist) {\n        if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n          rebaseHist(doc.history, change);\n          rebased.push(doc.history);\n        }\n        makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n      });\n    };\n\n    for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n      var returned = loop( i$1 );\n\n      if ( returned ) return returned.v;\n    }\n  }\n\n  // Sub-views need their line numbers shifted when text is added\n  // above or below them in the parent document.\n  function shiftDoc(doc, distance) {\n    if (distance == 0) { return }\n    doc.first += distance;\n    doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n      Pos(range.anchor.line + distance, range.anchor.ch),\n      Pos(range.head.line + distance, range.head.ch)\n    ); }), doc.sel.primIndex);\n    if (doc.cm) {\n      regChange(doc.cm, doc.first, doc.first - distance, distance);\n      for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n        { regLineChange(doc.cm, l, \"gutter\"); }\n    }\n  }\n\n  // More lower-level change function, handling only a single document\n  // (not linked ones).\n  function makeChangeSingleDoc(doc, change, selAfter, spans) {\n    if (doc.cm && !doc.cm.curOp)\n      { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n    if (change.to.line < doc.first) {\n      shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n      return\n    }\n    if (change.from.line > doc.lastLine()) { return }\n\n    // Clip the change to the size of this doc\n    if (change.from.line < doc.first) {\n      var shift = change.text.length - 1 - (doc.first - change.from.line);\n      shiftDoc(doc, shift);\n      change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n                text: [lst(change.text)], origin: change.origin};\n    }\n    var last = doc.lastLine();\n    if (change.to.line > last) {\n      change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n                text: [change.text[0]], origin: change.origin};\n    }\n\n    change.removed = getBetween(doc, change.from, change.to);\n\n    if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n    if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n    else { updateDoc(doc, change, spans); }\n    setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n  }\n\n  // Handle the interaction of a change to a document with the editor\n  // that this document is part of.\n  function makeChangeSingleDocInEditor(cm, change, spans) {\n    var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n    var recomputeMaxLength = false, checkWidthStart = from.line;\n    if (!cm.options.lineWrapping) {\n      checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n      doc.iter(checkWidthStart, to.line + 1, function (line) {\n        if (line == display.maxLine) {\n          recomputeMaxLength = true;\n          return true\n        }\n      });\n    }\n\n    if (doc.sel.contains(change.from, change.to) > -1)\n      { signalCursorActivity(cm); }\n\n    updateDoc(doc, change, spans, estimateHeight(cm));\n\n    if (!cm.options.lineWrapping) {\n      doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n        var len = lineLength(line);\n        if (len > display.maxLineLength) {\n          display.maxLine = line;\n          display.maxLineLength = len;\n          display.maxLineChanged = true;\n          recomputeMaxLength = false;\n        }\n      });\n      if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n    }\n\n    retreatFrontier(doc, from.line);\n    startWorker(cm, 400);\n\n    var lendiff = change.text.length - (to.line - from.line) - 1;\n    // Remember that these lines changed, for updating the display\n    if (change.full)\n      { regChange(cm); }\n    else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n      { regLineChange(cm, from.line, \"text\"); }\n    else\n      { regChange(cm, from.line, to.line + 1, lendiff); }\n\n    var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n    if (changeHandler || changesHandler) {\n      var obj = {\n        from: from, to: to,\n        text: change.text,\n        removed: change.removed,\n        origin: change.origin\n      };\n      if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n      if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n    }\n    cm.display.selForContextMenu = null;\n  }\n\n  function replaceRange(doc, code, from, to, origin) {\n    var assign;\n\n    if (!to) { to = from; }\n    if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n    if (typeof code == \"string\") { code = doc.splitLines(code); }\n    makeChange(doc, {from: from, to: to, text: code, origin: origin});\n  }\n\n  // Rebasing/resetting history to deal with externally-sourced changes\n\n  function rebaseHistSelSingle(pos, from, to, diff) {\n    if (to < pos.line) {\n      pos.line += diff;\n    } else if (from < pos.line) {\n      pos.line = from;\n      pos.ch = 0;\n    }\n  }\n\n  // Tries to rebase an array of history events given a change in the\n  // document. If the change touches the same lines as the event, the\n  // event, and everything 'behind' it, is discarded. If the change is\n  // before the event, the event's positions are updated. Uses a\n  // copy-on-write scheme for the positions, to avoid having to\n  // reallocate them all on every rebase, but also avoid problems with\n  // shared position objects being unsafely updated.\n  function rebaseHistArray(array, from, to, diff) {\n    for (var i = 0; i < array.length; ++i) {\n      var sub = array[i], ok = true;\n      if (sub.ranges) {\n        if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n        for (var j = 0; j < sub.ranges.length; j++) {\n          rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n          rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n        }\n        continue\n      }\n      for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n        var cur = sub.changes[j$1];\n        if (to < cur.from.line) {\n          cur.from = Pos(cur.from.line + diff, cur.from.ch);\n          cur.to = Pos(cur.to.line + diff, cur.to.ch);\n        } else if (from <= cur.to.line) {\n          ok = false;\n          break\n        }\n      }\n      if (!ok) {\n        array.splice(0, i + 1);\n        i = 0;\n      }\n    }\n  }\n\n  function rebaseHist(hist, change) {\n    var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n    rebaseHistArray(hist.done, from, to, diff);\n    rebaseHistArray(hist.undone, from, to, diff);\n  }\n\n  // Utility for applying a change to a line by handle or number,\n  // returning the number and optionally registering the line as\n  // changed.\n  function changeLine(doc, handle, changeType, op) {\n    var no = handle, line = handle;\n    if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n    else { no = lineNo(handle); }\n    if (no == null) { return null }\n    if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n    return line\n  }\n\n  // The document is represented as a BTree consisting of leaves, with\n  // chunk of lines in them, and branches, with up to ten leaves or\n  // other branch nodes below them. The top node is always a branch\n  // node, and is the document object itself (meaning it has\n  // additional methods and properties).\n  //\n  // All nodes have parent links. The tree is used both to go from\n  // line numbers to line objects, and to go from objects to numbers.\n  // It also indexes by height, and is used to convert between height\n  // and line object, and to find the total height of the document.\n  //\n  // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n  function LeafChunk(lines) {\n    var this$1 = this;\n\n    this.lines = lines;\n    this.parent = null;\n    var height = 0;\n    for (var i = 0; i < lines.length; ++i) {\n      lines[i].parent = this$1;\n      height += lines[i].height;\n    }\n    this.height = height;\n  }\n\n  LeafChunk.prototype = {\n    chunkSize: function() { return this.lines.length },\n\n    // Remove the n lines at offset 'at'.\n    removeInner: function(at, n) {\n      var this$1 = this;\n\n      for (var i = at, e = at + n; i < e; ++i) {\n        var line = this$1.lines[i];\n        this$1.height -= line.height;\n        cleanUpLine(line);\n        signalLater(line, \"delete\");\n      }\n      this.lines.splice(at, n);\n    },\n\n    // Helper used to collapse a small branch into a single leaf.\n    collapse: function(lines) {\n      lines.push.apply(lines, this.lines);\n    },\n\n    // Insert the given array of lines at offset 'at', count them as\n    // having the given height.\n    insertInner: function(at, lines, height) {\n      var this$1 = this;\n\n      this.height += height;\n      this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n      for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1; }\n    },\n\n    // Used to iterate over a part of the tree.\n    iterN: function(at, n, op) {\n      var this$1 = this;\n\n      for (var e = at + n; at < e; ++at)\n        { if (op(this$1.lines[at])) { return true } }\n    }\n  };\n\n  function BranchChunk(children) {\n    var this$1 = this;\n\n    this.children = children;\n    var size = 0, height = 0;\n    for (var i = 0; i < children.length; ++i) {\n      var ch = children[i];\n      size += ch.chunkSize(); height += ch.height;\n      ch.parent = this$1;\n    }\n    this.size = size;\n    this.height = height;\n    this.parent = null;\n  }\n\n  BranchChunk.prototype = {\n    chunkSize: function() { return this.size },\n\n    removeInner: function(at, n) {\n      var this$1 = this;\n\n      this.size -= n;\n      for (var i = 0; i < this.children.length; ++i) {\n        var child = this$1.children[i], sz = child.chunkSize();\n        if (at < sz) {\n          var rm = Math.min(n, sz - at), oldHeight = child.height;\n          child.removeInner(at, rm);\n          this$1.height -= oldHeight - child.height;\n          if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null; }\n          if ((n -= rm) == 0) { break }\n          at = 0;\n        } else { at -= sz; }\n      }\n      // If the result is smaller than 25 lines, ensure that it is a\n      // single leaf node.\n      if (this.size - n < 25 &&\n          (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n        var lines = [];\n        this.collapse(lines);\n        this.children = [new LeafChunk(lines)];\n        this.children[0].parent = this;\n      }\n    },\n\n    collapse: function(lines) {\n      var this$1 = this;\n\n      for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines); }\n    },\n\n    insertInner: function(at, lines, height) {\n      var this$1 = this;\n\n      this.size += lines.length;\n      this.height += height;\n      for (var i = 0; i < this.children.length; ++i) {\n        var child = this$1.children[i], sz = child.chunkSize();\n        if (at <= sz) {\n          child.insertInner(at, lines, height);\n          if (child.lines && child.lines.length > 50) {\n            // To avoid memory thrashing when child.lines is huge (e.g. first editor of a large file), it's never spliced.\n            // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n            var remaining = child.lines.length % 25 + 25;\n            for (var pos = remaining; pos < child.lines.length;) {\n              var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n              child.height -= leaf.height;\n              this$1.children.splice(++i, 0, leaf);\n              leaf.parent = this$1;\n            }\n            child.lines = child.lines.slice(0, remaining);\n            this$1.maybeSpill();\n          }\n          break\n        }\n        at -= sz;\n      }\n    },\n\n    // When a node has grown, check whether it should be split.\n    maybeSpill: function() {\n      if (this.children.length <= 10) { return }\n      var me = this;\n      do {\n        var spilled = me.children.splice(me.children.length - 5, 5);\n        var sibling = new BranchChunk(spilled);\n        if (!me.parent) { // Become the parent node\n          var copy = new BranchChunk(me.children);\n          copy.parent = me;\n          me.children = [copy, sibling];\n          me = copy;\n       } else {\n          me.size -= sibling.size;\n          me.height -= sibling.height;\n          var myIndex = indexOf(me.parent.children, me);\n          me.parent.children.splice(myIndex + 1, 0, sibling);\n        }\n        sibling.parent = me.parent;\n      } while (me.children.length > 10)\n      me.parent.maybeSpill();\n    },\n\n    iterN: function(at, n, op) {\n      var this$1 = this;\n\n      for (var i = 0; i < this.children.length; ++i) {\n        var child = this$1.children[i], sz = child.chunkSize();\n        if (at < sz) {\n          var used = Math.min(n, sz - at);\n          if (child.iterN(at, used, op)) { return true }\n          if ((n -= used) == 0) { break }\n          at = 0;\n        } else { at -= sz; }\n      }\n    }\n  };\n\n  // Line widgets are block elements displayed above or below a line.\n\n  var LineWidget = function(doc, node, options) {\n    var this$1 = this;\n\n    if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n      { this$1[opt] = options[opt]; } } }\n    this.doc = doc;\n    this.node = node;\n  };\n\n  LineWidget.prototype.clear = function () {\n      var this$1 = this;\n\n    var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n    if (no == null || !ws) { return }\n    for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1); } }\n    if (!ws.length) { line.widgets = null; }\n    var height = widgetHeight(this);\n    updateLineHeight(line, Math.max(0, line.height - height));\n    if (cm) {\n      runInOp(cm, function () {\n        adjustScrollWhenAboveVisible(cm, line, -height);\n        regLineChange(cm, no, \"widget\");\n      });\n      signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n    }\n  };\n\n  LineWidget.prototype.changed = function () {\n      var this$1 = this;\n\n    var oldH = this.height, cm = this.doc.cm, line = this.line;\n    this.height = null;\n    var diff = widgetHeight(this) - oldH;\n    if (!diff) { return }\n    if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n    if (cm) {\n      runInOp(cm, function () {\n        cm.curOp.forceUpdate = true;\n        adjustScrollWhenAboveVisible(cm, line, diff);\n        signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n      });\n    }\n  };\n  eventMixin(LineWidget);\n\n  function adjustScrollWhenAboveVisible(cm, line, diff) {\n    if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n      { addToScrollTop(cm, diff); }\n  }\n\n  function addLineWidget(doc, handle, node, options) {\n    var widget = new LineWidget(doc, node, options);\n    var cm = doc.cm;\n    if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n    changeLine(doc, handle, \"widget\", function (line) {\n      var widgets = line.widgets || (line.widgets = []);\n      if (widget.insertAt == null) { widgets.push(widget); }\n      else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); }\n      widget.line = line;\n      if (cm && !lineIsHidden(doc, line)) {\n        var aboveVisible = heightAtLine(line) < doc.scrollTop;\n        updateLineHeight(line, line.height + widgetHeight(widget));\n        if (aboveVisible) { addToScrollTop(cm, widget.height); }\n        cm.curOp.forceUpdate = true;\n      }\n      return true\n    });\n    if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n    return widget\n  }\n\n  // TEXTMARKERS\n\n  // Created with markText and setBookmark methods. A TextMarker is a\n  // handle that can be used to clear or find a marked position in the\n  // document. Line objects hold arrays (markedSpans) containing\n  // {from, to, marker} object pointing to such marker objects, and\n  // indicating that such a marker is present on that line. Multiple\n  // lines may point to the same marker when it spans across lines.\n  // The spans will have null for their from/to properties when the\n  // marker continues beyond the start/end of the line. Markers have\n  // links back to the lines they currently touch.\n\n  // Collapsed markers have unique ids, in order to be able to order\n  // them, which is needed for uniquely determining an outer marker\n  // when they overlap (they may nest, but not partially overlap).\n  var nextMarkerId = 0;\n\n  var TextMarker = function(doc, type) {\n    this.lines = [];\n    this.type = type;\n    this.doc = doc;\n    this.id = ++nextMarkerId;\n  };\n\n  // Clear the marker.\n  TextMarker.prototype.clear = function () {\n      var this$1 = this;\n\n    if (this.explicitlyCleared) { return }\n    var cm = this.doc.cm, withOp = cm && !cm.curOp;\n    if (withOp) { startOperation(cm); }\n    if (hasHandler(this, \"clear\")) {\n      var found = this.find();\n      if (found) { signalLater(this, \"clear\", found.from, found.to); }\n    }\n    var min = null, max = null;\n    for (var i = 0; i < this.lines.length; ++i) {\n      var line = this$1.lines[i];\n      var span = getMarkedSpanFor(line.markedSpans, this$1);\n      if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n      else if (cm) {\n        if (span.to != null) { max = lineNo(line); }\n        if (span.from != null) { min = lineNo(line); }\n      }\n      line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n      if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm)\n        { updateLineHeight(line, textHeight(cm.display)); }\n    }\n    if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n      var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual);\n      if (len > cm.display.maxLineLength) {\n        cm.display.maxLine = visual;\n        cm.display.maxLineLength = len;\n        cm.display.maxLineChanged = true;\n      }\n    } }\n\n    if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n    this.lines.length = 0;\n    this.explicitlyCleared = true;\n    if (this.atomic && this.doc.cantEdit) {\n      this.doc.cantEdit = false;\n      if (cm) { reCheckSelection(cm.doc); }\n    }\n    if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n    if (withOp) { endOperation(cm); }\n    if (this.parent) { this.parent.clear(); }\n  };\n\n  // Find the position of the marker in the document. Returns a {from,\n  // to} object by default. Side can be passed to get a specific side\n  // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n  // Pos objects returned contain a line object, rather than a line\n  // number (used to prevent looking up the same line twice).\n  TextMarker.prototype.find = function (side, lineObj) {\n      var this$1 = this;\n\n    if (side == null && this.type == \"bookmark\") { side = 1; }\n    var from, to;\n    for (var i = 0; i < this.lines.length; ++i) {\n      var line = this$1.lines[i];\n      var span = getMarkedSpanFor(line.markedSpans, this$1);\n      if (span.from != null) {\n        from = Pos(lineObj ? line : lineNo(line), span.from);\n        if (side == -1) { return from }\n      }\n      if (span.to != null) {\n        to = Pos(lineObj ? line : lineNo(line), span.to);\n        if (side == 1) { return to }\n      }\n    }\n    return from && {from: from, to: to}\n  };\n\n  // Signals that the marker's widget changed, and surrounding layout\n  // should be recomputed.\n  TextMarker.prototype.changed = function () {\n      var this$1 = this;\n\n    var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n    if (!pos || !cm) { return }\n    runInOp(cm, function () {\n      var line = pos.line, lineN = lineNo(pos.line);\n      var view = findViewForLine(cm, lineN);\n      if (view) {\n        clearLineMeasurementCacheFor(view);\n        cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n      }\n      cm.curOp.updateMaxLine = true;\n      if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n        var oldHeight = widget.height;\n        widget.height = null;\n        var dHeight = widgetHeight(widget) - oldHeight;\n        if (dHeight)\n          { updateLineHeight(line, line.height + dHeight); }\n      }\n      signalLater(cm, \"markerChanged\", cm, this$1);\n    });\n  };\n\n  TextMarker.prototype.attachLine = function (line) {\n    if (!this.lines.length && this.doc.cm) {\n      var op = this.doc.cm.curOp;\n      if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n        { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n    }\n    this.lines.push(line);\n  };\n\n  TextMarker.prototype.detachLine = function (line) {\n    this.lines.splice(indexOf(this.lines, line), 1);\n    if (!this.lines.length && this.doc.cm) {\n      var op = this.doc.cm.curOp\n      ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n    }\n  };\n  eventMixin(TextMarker);\n\n  // Create a marker, wire it up to the right lines, and\n  function markText(doc, from, to, options, type) {\n    // Shared markers (across linked documents) are handled separately\n    // (markTextShared will call out to this again, once per\n    // document).\n    if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n    // Ensure we are in an operation.\n    if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n    var marker = new TextMarker(doc, type), diff = cmp(from, to);\n    if (options) { copyObj(options, marker, false); }\n    // Don't connect empty markers unless clearWhenEmpty is false\n    if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n      { return marker }\n    if (marker.replacedWith) {\n      // Showing up as a widget implies collapsed (widget replaces text)\n      marker.collapsed = true;\n      marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n      if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n      if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n    }\n    if (marker.collapsed) {\n      if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n          from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n        { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n      seeCollapsedSpans();\n    }\n\n    if (marker.addToHistory)\n      { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n    var curLine = from.line, cm = doc.cm, updateMaxLine;\n    doc.iter(curLine, to.line + 1, function (line) {\n      if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n        { updateMaxLine = true; }\n      if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n      addMarkedSpan(line, new MarkedSpan(marker,\n                                         curLine == from.line ? from.ch : null,\n                                         curLine == to.line ? to.ch : null));\n      ++curLine;\n    });\n    // lineIsHidden depends on the presence of the spans, so needs a second pass\n    if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n      if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n    }); }\n\n    if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n    if (marker.readOnly) {\n      seeReadOnlySpans();\n      if (doc.history.done.length || doc.history.undone.length)\n        { doc.clearHistory(); }\n    }\n    if (marker.collapsed) {\n      marker.id = ++nextMarkerId;\n      marker.atomic = true;\n    }\n    if (cm) {\n      // Sync editor state\n      if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n      if (marker.collapsed)\n        { regChange(cm, from.line, to.line + 1); }\n      else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n               marker.attributes || marker.title)\n        { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n      if (marker.atomic) { reCheckSelection(cm.doc); }\n      signalLater(cm, \"markerAdded\", cm, marker);\n    }\n    return marker\n  }\n\n  // SHARED TEXTMARKERS\n\n  // A shared marker spans multiple linked documents. It is\n  // implemented as a meta-marker-object controlling multiple normal\n  // markers.\n  var SharedTextMarker = function(markers, primary) {\n    var this$1 = this;\n\n    this.markers = markers;\n    this.primary = primary;\n    for (var i = 0; i < markers.length; ++i)\n      { markers[i].parent = this$1; }\n  };\n\n  SharedTextMarker.prototype.clear = function () {\n      var this$1 = this;\n\n    if (this.explicitlyCleared) { return }\n    this.explicitlyCleared = true;\n    for (var i = 0; i < this.markers.length; ++i)\n      { this$1.markers[i].clear(); }\n    signalLater(this, \"clear\");\n  };\n\n  SharedTextMarker.prototype.find = function (side, lineObj) {\n    return this.primary.find(side, lineObj)\n  };\n  eventMixin(SharedTextMarker);\n\n  function markTextShared(doc, from, to, options, type) {\n    options = copyObj(options);\n    options.shared = false;\n    var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n    var widget = options.widgetNode;\n    linkedDocs(doc, function (doc) {\n      if (widget) { options.widgetNode = widget.cloneNode(true); }\n      markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n      for (var i = 0; i < doc.linked.length; ++i)\n        { if (doc.linked[i].isParent) { return } }\n      primary = lst(markers);\n    });\n    return new SharedTextMarker(markers, primary)\n  }\n\n  function findSharedMarkers(doc) {\n    return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n  }\n\n  function copySharedMarkers(doc, markers) {\n    for (var i = 0; i < markers.length; i++) {\n      var marker = markers[i], pos = marker.find();\n      var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n      if (cmp(mFrom, mTo)) {\n        var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n        marker.markers.push(subMark);\n        subMark.parent = marker;\n      }\n    }\n  }\n\n  function detachSharedMarkers(markers) {\n    var loop = function ( i ) {\n      var marker = markers[i], linked = [marker.primary.doc];\n      linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n      for (var j = 0; j < marker.markers.length; j++) {\n        var subMarker = marker.markers[j];\n        if (indexOf(linked, subMarker.doc) == -1) {\n          subMarker.parent = null;\n          marker.markers.splice(j--, 1);\n        }\n      }\n    };\n\n    for (var i = 0; i < markers.length; i++) loop( i );\n  }\n\n  var nextDocId = 0;\n  var Doc = function(text, mode, firstLine, lineSep, direction) {\n    if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n    if (firstLine == null) { firstLine = 0; }\n\n    BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n    this.first = firstLine;\n    this.scrollTop = this.scrollLeft = 0;\n    this.cantEdit = false;\n    this.cleanGeneration = 1;\n    this.modeFrontier = this.highlightFrontier = firstLine;\n    var start = Pos(firstLine, 0);\n    this.sel = simpleSelection(start);\n    this.history = new History(null);\n    this.id = ++nextDocId;\n    this.modeOption = mode;\n    this.lineSep = lineSep;\n    this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n    this.extend = false;\n\n    if (typeof text == \"string\") { text = this.splitLines(text); }\n    updateDoc(this, {from: start, to: start, text: text});\n    setSelection(this, simpleSelection(start), sel_dontScroll);\n  };\n\n  Doc.prototype = createObj(BranchChunk.prototype, {\n    constructor: Doc,\n    // Iterate over the document. Supports two forms -- with only one\n    // argument, it calls that for each line in the document. With\n    // three, it iterates over the range given by the first two (with\n    // the second being non-inclusive).\n    iter: function(from, to, op) {\n      if (op) { this.iterN(from - this.first, to - from, op); }\n      else { this.iterN(this.first, this.first + this.size, from); }\n    },\n\n    // Non-public interface for adding and removing lines.\n    insert: function(at, lines) {\n      var height = 0;\n      for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n      this.insertInner(at - this.first, lines, height);\n    },\n    remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n    // From here, the methods are part of the public interface. Most\n    // are also available from CodeMirror (editor) instances.\n\n    getValue: function(lineSep) {\n      var lines = getLines(this, this.first, this.first + this.size);\n      if (lineSep === false) { return lines }\n      return lines.join(lineSep || this.lineSeparator())\n    },\n    setValue: docMethodOp(function(code) {\n      var top = Pos(this.first, 0), last = this.first + this.size - 1;\n      makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n                        text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n      if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n      setSelection(this, simpleSelection(top), sel_dontScroll);\n    }),\n    replaceRange: function(code, from, to, origin) {\n      from = clipPos(this, from);\n      to = to ? clipPos(this, to) : from;\n      replaceRange(this, code, from, to, origin);\n    },\n    getRange: function(from, to, lineSep) {\n      var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n      if (lineSep === false) { return lines }\n      return lines.join(lineSep || this.lineSeparator())\n    },\n\n    getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n    getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n    getLineNumber: function(line) {return lineNo(line)},\n\n    getLineHandleVisualStart: function(line) {\n      if (typeof line == \"number\") { line = getLine(this, line); }\n      return visualLine(line)\n    },\n\n    lineCount: function() {return this.size},\n    firstLine: function() {return this.first},\n    lastLine: function() {return this.first + this.size - 1},\n\n    clipPos: function(pos) {return clipPos(this, pos)},\n\n    getCursor: function(start) {\n      var range$$1 = this.sel.primary(), pos;\n      if (start == null || start == \"head\") { pos = range$$1.head; }\n      else if (start == \"anchor\") { pos = range$$1.anchor; }\n      else if (start == \"end\" || start == \"to\" || start === false) { pos = range$$1.to(); }\n      else { pos = range$$1.from(); }\n      return pos\n    },\n    listSelections: function() { return this.sel.ranges },\n    somethingSelected: function() {return this.sel.somethingSelected()},\n\n    setCursor: docMethodOp(function(line, ch, options) {\n      setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n    }),\n    setSelection: docMethodOp(function(anchor, head, options) {\n      setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n    }),\n    extendSelection: docMethodOp(function(head, other, options) {\n      extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n    }),\n    extendSelections: docMethodOp(function(heads, options) {\n      extendSelections(this, clipPosArray(this, heads), options);\n    }),\n    extendSelectionsBy: docMethodOp(function(f, options) {\n      var heads = map(this.sel.ranges, f);\n      extendSelections(this, clipPosArray(this, heads), options);\n    }),\n    setSelections: docMethodOp(function(ranges, primary, options) {\n      var this$1 = this;\n\n      if (!ranges.length) { return }\n      var out = [];\n      for (var i = 0; i < ranges.length; i++)\n        { out[i] = new Range(clipPos(this$1, ranges[i].anchor),\n                           clipPos(this$1, ranges[i].head)); }\n      if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n      setSelection(this, normalizeSelection(this.cm, out, primary), options);\n    }),\n    addSelection: docMethodOp(function(anchor, head, options) {\n      var ranges = this.sel.ranges.slice(0);\n      ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n      setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n    }),\n\n    getSelection: function(lineSep) {\n      var this$1 = this;\n\n      var ranges = this.sel.ranges, lines;\n      for (var i = 0; i < ranges.length; i++) {\n        var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n        lines = lines ? lines.concat(sel) : sel;\n      }\n      if (lineSep === false) { return lines }\n      else { return lines.join(lineSep || this.lineSeparator()) }\n    },\n    getSelections: function(lineSep) {\n      var this$1 = this;\n\n      var parts = [], ranges = this.sel.ranges;\n      for (var i = 0; i < ranges.length; i++) {\n        var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n        if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()); }\n        parts[i] = sel;\n      }\n      return parts\n    },\n    replaceSelection: function(code, collapse, origin) {\n      var dup = [];\n      for (var i = 0; i < this.sel.ranges.length; i++)\n        { dup[i] = code; }\n      this.replaceSelections(dup, collapse, origin || \"+input\");\n    },\n    replaceSelections: docMethodOp(function(code, collapse, origin) {\n      var this$1 = this;\n\n      var changes = [], sel = this.sel;\n      for (var i = 0; i < sel.ranges.length; i++) {\n        var range$$1 = sel.ranges[i];\n        changes[i] = {from: range$$1.from(), to: range$$1.to(), text: this$1.splitLines(code[i]), origin: origin};\n      }\n      var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n      for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n        { makeChange(this$1, changes[i$1]); }\n      if (newSel) { setSelectionReplaceHistory(this, newSel); }\n      else if (this.cm) { ensureCursorVisible(this.cm); }\n    }),\n    undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n    redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n    undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n    redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n    setExtending: function(val) {this.extend = val;},\n    getExtending: function() {return this.extend},\n\n    historySize: function() {\n      var hist = this.history, done = 0, undone = 0;\n      for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n      for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n      return {undo: done, redo: undone}\n    },\n    clearHistory: function() {this.history = new History(this.history.maxGeneration);},\n\n    markClean: function() {\n      this.cleanGeneration = this.changeGeneration(true);\n    },\n    changeGeneration: function(forceSplit) {\n      if (forceSplit)\n        { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n      return this.history.generation\n    },\n    isClean: function (gen) {\n      return this.history.generation == (gen || this.cleanGeneration)\n    },\n\n    getHistory: function() {\n      return {done: copyHistoryArray(this.history.done),\n              undone: copyHistoryArray(this.history.undone)}\n    },\n    setHistory: function(histData) {\n      var hist = this.history = new History(this.history.maxGeneration);\n      hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n      hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n    },\n\n    setGutterMarker: docMethodOp(function(line, gutterID, value) {\n      return changeLine(this, line, \"gutter\", function (line) {\n        var markers = line.gutterMarkers || (line.gutterMarkers = {});\n        markers[gutterID] = value;\n        if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n        return true\n      })\n    }),\n\n    clearGutter: docMethodOp(function(gutterID) {\n      var this$1 = this;\n\n      this.iter(function (line) {\n        if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n          changeLine(this$1, line, \"gutter\", function () {\n            line.gutterMarkers[gutterID] = null;\n            if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n            return true\n          });\n        }\n      });\n    }),\n\n    lineInfo: function(line) {\n      var n;\n      if (typeof line == \"number\") {\n        if (!isLine(this, line)) { return null }\n        n = line;\n        line = getLine(this, line);\n        if (!line) { return null }\n      } else {\n        n = lineNo(line);\n        if (n == null) { return null }\n      }\n      return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n              textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n              widgets: line.widgets}\n    },\n\n    addLineClass: docMethodOp(function(handle, where, cls) {\n      return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n        var prop = where == \"text\" ? \"textClass\"\n                 : where == \"background\" ? \"bgClass\"\n                 : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n        if (!line[prop]) { line[prop] = cls; }\n        else if (classTest(cls).test(line[prop])) { return false }\n        else { line[prop] += \" \" + cls; }\n        return true\n      })\n    }),\n    removeLineClass: docMethodOp(function(handle, where, cls) {\n      return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n        var prop = where == \"text\" ? \"textClass\"\n                 : where == \"background\" ? \"bgClass\"\n                 : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n        var cur = line[prop];\n        if (!cur) { return false }\n        else if (cls == null) { line[prop] = null; }\n        else {\n          var found = cur.match(classTest(cls));\n          if (!found) { return false }\n          var end = found.index + found[0].length;\n          line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n        }\n        return true\n      })\n    }),\n\n    addLineWidget: docMethodOp(function(handle, node, options) {\n      return addLineWidget(this, handle, node, options)\n    }),\n    removeLineWidget: function(widget) { widget.clear(); },\n\n    markText: function(from, to, options) {\n      return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n    },\n    setBookmark: function(pos, options) {\n      var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n                      insertLeft: options && options.insertLeft,\n                      clearWhenEmpty: false, shared: options && options.shared,\n                      handleMouseEvents: options && options.handleMouseEvents};\n      pos = clipPos(this, pos);\n      return markText(this, pos, pos, realOpts, \"bookmark\")\n    },\n    findMarksAt: function(pos) {\n      pos = clipPos(this, pos);\n      var markers = [], spans = getLine(this, pos.line).markedSpans;\n      if (spans) { for (var i = 0; i < spans.length; ++i) {\n        var span = spans[i];\n        if ((span.from == null || span.from <= pos.ch) &&\n            (span.to == null || span.to >= pos.ch))\n          { markers.push(span.marker.parent || span.marker); }\n      } }\n      return markers\n    },\n    findMarks: function(from, to, filter) {\n      from = clipPos(this, from); to = clipPos(this, to);\n      var found = [], lineNo$$1 = from.line;\n      this.iter(from.line, to.line + 1, function (line) {\n        var spans = line.markedSpans;\n        if (spans) { for (var i = 0; i < spans.length; i++) {\n          var span = spans[i];\n          if (!(span.to != null && lineNo$$1 == from.line && from.ch >= span.to ||\n                span.from == null && lineNo$$1 != from.line ||\n                span.from != null && lineNo$$1 == to.line && span.from >= to.ch) &&\n              (!filter || filter(span.marker)))\n            { found.push(span.marker.parent || span.marker); }\n        } }\n        ++lineNo$$1;\n      });\n      return found\n    },\n    getAllMarks: function() {\n      var markers = [];\n      this.iter(function (line) {\n        var sps = line.markedSpans;\n        if (sps) { for (var i = 0; i < sps.length; ++i)\n          { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n      });\n      return markers\n    },\n\n    posFromIndex: function(off) {\n      var ch, lineNo$$1 = this.first, sepSize = this.lineSeparator().length;\n      this.iter(function (line) {\n        var sz = line.text.length + sepSize;\n        if (sz > off) { ch = off; return true }\n        off -= sz;\n        ++lineNo$$1;\n      });\n      return clipPos(this, Pos(lineNo$$1, ch))\n    },\n    indexFromPos: function (coords) {\n      coords = clipPos(this, coords);\n      var index = coords.ch;\n      if (coords.line < this.first || coords.ch < 0) { return 0 }\n      var sepSize = this.lineSeparator().length;\n      this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n        index += line.text.length + sepSize;\n      });\n      return index\n    },\n\n    copy: function(copyHistory) {\n      var doc = new Doc(getLines(this, this.first, this.first + this.size),\n                        this.modeOption, this.first, this.lineSep, this.direction);\n      doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n      doc.sel = this.sel;\n      doc.extend = false;\n      if (copyHistory) {\n        doc.history.undoDepth = this.history.undoDepth;\n        doc.setHistory(this.getHistory());\n      }\n      return doc\n    },\n\n    linkedDoc: function(options) {\n      if (!options) { options = {}; }\n      var from = this.first, to = this.first + this.size;\n      if (options.from != null && options.from > from) { from = options.from; }\n      if (options.to != null && options.to < to) { to = options.to; }\n      var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n      if (options.sharedHist) { copy.history = this.history\n      ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n      copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n      copySharedMarkers(copy, findSharedMarkers(this));\n      return copy\n    },\n    unlinkDoc: function(other) {\n      var this$1 = this;\n\n      if (other instanceof CodeMirror) { other = other.doc; }\n      if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n        var link = this$1.linked[i];\n        if (link.doc != other) { continue }\n        this$1.linked.splice(i, 1);\n        other.unlinkDoc(this$1);\n        detachSharedMarkers(findSharedMarkers(this$1));\n        break\n      } }\n      // If the histories were shared, split them again\n      if (other.history == this.history) {\n        var splitIds = [other.id];\n        linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n        other.history = new History(null);\n        other.history.done = copyHistoryArray(this.history.done, splitIds);\n        other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n      }\n    },\n    iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n    getMode: function() {return this.mode},\n    getEditor: function() {return this.cm},\n\n    splitLines: function(str) {\n      if (this.lineSep) { return str.split(this.lineSep) }\n      return splitLinesAuto(str)\n    },\n    lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n    setDirection: docMethodOp(function (dir) {\n      if (dir != \"rtl\") { dir = \"ltr\"; }\n      if (dir == this.direction) { return }\n      this.direction = dir;\n      this.iter(function (line) { return line.order = null; });\n      if (this.cm) { directionChanged(this.cm); }\n    })\n  });\n\n  // Public alias.\n  Doc.prototype.eachLine = Doc.prototype.iter;\n\n  // Kludge to work around strange IE behavior where it'll sometimes\n  // re-fire a series of drag-related events right after the drop (#1551)\n  var lastDrop = 0;\n\n  function onDrop(e) {\n    var cm = this;\n    clearDragCursor(cm);\n    if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n      { return }\n    e_preventDefault(e);\n    if (ie) { lastDrop = +new Date; }\n    var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n    if (!pos || cm.isReadOnly()) { return }\n    // Might be a file drop, in which case we simply extract the text\n    // and insert it.\n    if (files && files.length && window.FileReader && window.File) {\n      var n = files.length, text = Array(n), read = 0;\n      var loadFile = function (file, i) {\n        if (cm.options.allowDropFileTypes &&\n            indexOf(cm.options.allowDropFileTypes, file.type) == -1)\n          { return }\n\n        var reader = new FileReader;\n        reader.onload = operation(cm, function () {\n          var content = reader.result;\n          if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) { content = \"\"; }\n          text[i] = content;\n          if (++read == n) {\n            pos = clipPos(cm.doc, pos);\n            var change = {from: pos, to: pos,\n                          text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),\n                          origin: \"paste\"};\n            makeChange(cm.doc, change);\n            setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)));\n          }\n        });\n        reader.readAsText(file);\n      };\n      for (var i = 0; i < n; ++i) { loadFile(files[i], i); }\n    } else { // Normal drop\n      // Don't do a replace if the drop happened inside of the selected text.\n      if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n        cm.state.draggingText(e);\n        // Ensure the editor is re-focused\n        setTimeout(function () { return cm.display.input.focus(); }, 20);\n        return\n      }\n      try {\n        var text$1 = e.dataTransfer.getData(\"Text\");\n        if (text$1) {\n          var selected;\n          if (cm.state.draggingText && !cm.state.draggingText.copy)\n            { selected = cm.listSelections(); }\n          setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n          if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n            { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n          cm.replaceSelection(text$1, \"around\", \"paste\");\n          cm.display.input.focus();\n        }\n      }\n      catch(e){}\n    }\n  }\n\n  function onDragStart(cm, e) {\n    if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n    if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n    e.dataTransfer.setData(\"Text\", cm.getSelection());\n    e.dataTransfer.effectAllowed = \"copyMove\";\n\n    // Use dummy image instead of default browsers image.\n    // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n    if (e.dataTransfer.setDragImage && !safari) {\n      var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n      img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n      if (presto) {\n        img.width = img.height = 1;\n        cm.display.wrapper.appendChild(img);\n        // Force a relayout, or Opera won't use our image for some obscure reason\n        img._top = img.offsetTop;\n      }\n      e.dataTransfer.setDragImage(img, 0, 0);\n      if (presto) { img.parentNode.removeChild(img); }\n    }\n  }\n\n  function onDragOver(cm, e) {\n    var pos = posFromMouse(cm, e);\n    if (!pos) { return }\n    var frag = document.createDocumentFragment();\n    drawSelectionCursor(cm, pos, frag);\n    if (!cm.display.dragCursor) {\n      cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n      cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n    }\n    removeChildrenAndAdd(cm.display.dragCursor, frag);\n  }\n\n  function clearDragCursor(cm) {\n    if (cm.display.dragCursor) {\n      cm.display.lineSpace.removeChild(cm.display.dragCursor);\n      cm.display.dragCursor = null;\n    }\n  }\n\n  // These must be handled carefully, because naively registering a\n  // handler for each editor will cause the editors to never be\n  // garbage collected.\n\n  function forEachCodeMirror(f) {\n    if (!document.getElementsByClassName) { return }\n    var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n    for (var i = 0; i < byClass.length; i++) {\n      var cm = byClass[i].CodeMirror;\n      if (cm) { editors.push(cm); }\n    }\n    if (editors.length) { editors[0].operation(function () {\n      for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n    }); }\n  }\n\n  var globalsRegistered = false;\n  function ensureGlobalHandlers() {\n    if (globalsRegistered) { return }\n    registerGlobalHandlers();\n    globalsRegistered = true;\n  }\n  function registerGlobalHandlers() {\n    // When the window resizes, we need to refresh active editors.\n    var resizeTimer;\n    on(window, \"resize\", function () {\n      if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n        resizeTimer = null;\n        forEachCodeMirror(onResize);\n      }, 100); }\n    });\n    // When the window loses focus, we want to show the editor as blurred\n    on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n  }\n  // Called when the window resizes\n  function onResize(cm) {\n    var d = cm.display;\n    // Might be a text scaling operation, clear size caches.\n    d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n    d.scrollbarsClipped = false;\n    cm.setSize();\n  }\n\n  var keyNames = {\n    3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n    19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n    36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n    46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n    106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 145: \"ScrollLock\",\n    173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n    221: \"]\", 222: \"'\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n    63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n  };\n\n  // Number keys\n  for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n  // Alphabetic keys\n  for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n  // Function keys\n  for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n  var keyMap = {};\n\n  keyMap.basic = {\n    \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n    \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n    \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n    \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n    \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n    \"Esc\": \"singleSelection\"\n  };\n  // Note that the save and find-related commands aren't defined by\n  // default. User code or addons can define them. Unknown commands\n  // are simply ignored.\n  keyMap.pcDefault = {\n    \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n    \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n    \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n    \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n    \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n    \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n    \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n    \"fallthrough\": \"basic\"\n  };\n  // Very basic readline/emacs-style bindings, which are standard on Mac.\n  keyMap.emacsy = {\n    \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n    \"Alt-F\": \"goWordRight\", \"Alt-B\": \"goWordLeft\", \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\",\n    \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\", \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\",\n    \"Alt-D\": \"delWordAfter\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\", \"Ctrl-T\": \"transposeChars\",\n    \"Ctrl-O\": \"openLine\"\n  };\n  keyMap.macDefault = {\n    \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n    \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n    \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n    \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n    \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n    \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n    \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n    \"fallthrough\": [\"basic\", \"emacsy\"]\n  };\n  keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n  // KEYMAP DISPATCH\n\n  function normalizeKeyName(name) {\n    var parts = name.split(/-(?!$)/);\n    name = parts[parts.length - 1];\n    var alt, ctrl, shift, cmd;\n    for (var i = 0; i < parts.length - 1; i++) {\n      var mod = parts[i];\n      if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n      else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n      else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n      else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n      else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n    }\n    if (alt) { name = \"Alt-\" + name; }\n    if (ctrl) { name = \"Ctrl-\" + name; }\n    if (cmd) { name = \"Cmd-\" + name; }\n    if (shift) { name = \"Shift-\" + name; }\n    return name\n  }\n\n  // This is a kludge to keep keymaps mostly working as raw objects\n  // (backwards compatibility) while at the same time support features\n  // like normalization and multi-stroke key bindings. It compiles a\n  // new normalized keymap, and then updates the old object to reflect\n  // this.\n  function normalizeKeyMap(keymap) {\n    var copy = {};\n    for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n      var value = keymap[keyname];\n      if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n      if (value == \"...\") { delete keymap[keyname]; continue }\n\n      var keys = map(keyname.split(\" \"), normalizeKeyName);\n      for (var i = 0; i < keys.length; i++) {\n        var val = (void 0), name = (void 0);\n        if (i == keys.length - 1) {\n          name = keys.join(\" \");\n          val = value;\n        } else {\n          name = keys.slice(0, i + 1).join(\" \");\n          val = \"...\";\n        }\n        var prev = copy[name];\n        if (!prev) { copy[name] = val; }\n        else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n      }\n      delete keymap[keyname];\n    } }\n    for (var prop in copy) { keymap[prop] = copy[prop]; }\n    return keymap\n  }\n\n  function lookupKey(key, map$$1, handle, context) {\n    map$$1 = getKeyMap(map$$1);\n    var found = map$$1.call ? map$$1.call(key, context) : map$$1[key];\n    if (found === false) { return \"nothing\" }\n    if (found === \"...\") { return \"multi\" }\n    if (found != null && handle(found)) { return \"handled\" }\n\n    if (map$$1.fallthrough) {\n      if (Object.prototype.toString.call(map$$1.fallthrough) != \"[object Array]\")\n        { return lookupKey(key, map$$1.fallthrough, handle, context) }\n      for (var i = 0; i < map$$1.fallthrough.length; i++) {\n        var result = lookupKey(key, map$$1.fallthrough[i], handle, context);\n        if (result) { return result }\n      }\n    }\n  }\n\n  // Modifier key presses don't count as 'real' key presses for the\n  // purpose of keymap fallthrough.\n  function isModifierKey(value) {\n    var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n    return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n  }\n\n  function addModifierNames(name, event, noShift) {\n    var base = name;\n    if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n    if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n    if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Cmd\") { name = \"Cmd-\" + name; }\n    if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n    return name\n  }\n\n  // Look up the name of a key as indicated by an event object.\n  function keyName(event, noShift) {\n    if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n    var name = keyNames[event.keyCode];\n    if (name == null || event.altGraphKey) { return false }\n    // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n    // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n    if (event.keyCode == 3 && event.code) { name = event.code; }\n    return addModifierNames(name, event, noShift)\n  }\n\n  function getKeyMap(val) {\n    return typeof val == \"string\" ? keyMap[val] : val\n  }\n\n  // Helper for deleting text near the selection(s), used to implement\n  // backspace, delete, and similar functionality.\n  function deleteNearSelection(cm, compute) {\n    var ranges = cm.doc.sel.ranges, kill = [];\n    // Build up a set of ranges to kill first, merging overlapping\n    // ranges.\n    for (var i = 0; i < ranges.length; i++) {\n      var toKill = compute(ranges[i]);\n      while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n        var replaced = kill.pop();\n        if (cmp(replaced.from, toKill.from) < 0) {\n          toKill.from = replaced.from;\n          break\n        }\n      }\n      kill.push(toKill);\n    }\n    // Next, remove those actual ranges.\n    runInOp(cm, function () {\n      for (var i = kill.length - 1; i >= 0; i--)\n        { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n      ensureCursorVisible(cm);\n    });\n  }\n\n  function moveCharLogically(line, ch, dir) {\n    var target = skipExtendingChars(line.text, ch + dir, dir);\n    return target < 0 || target > line.text.length ? null : target\n  }\n\n  function moveLogically(line, start, dir) {\n    var ch = moveCharLogically(line, start.ch, dir);\n    return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n  }\n\n  function endOfLine(visually, cm, lineObj, lineNo, dir) {\n    if (visually) {\n      var order = getOrder(lineObj, cm.doc.direction);\n      if (order) {\n        var part = dir < 0 ? lst(order) : order[0];\n        var moveInStorageOrder = (dir < 0) == (part.level == 1);\n        var sticky = moveInStorageOrder ? \"after\" : \"before\";\n        var ch;\n        // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n        // it could be that the last bidi part is not on the last visual line,\n        // since visual lines contain content order-consecutive chunks.\n        // Thus, in rtl, we are looking for the first (content-order) character\n        // in the rtl chunk that is on the last line (that is, the same line\n        // as the last (content-order) character).\n        if (part.level > 0 || cm.doc.direction == \"rtl\") {\n          var prep = prepareMeasureForLine(cm, lineObj);\n          ch = dir < 0 ? lineObj.text.length - 1 : 0;\n          var targetTop = measureCharPrepared(cm, prep, ch).top;\n          ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n          if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n        } else { ch = dir < 0 ? part.to : part.from; }\n        return new Pos(lineNo, ch, sticky)\n      }\n    }\n    return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n  }\n\n  function moveVisually(cm, line, start, dir) {\n    var bidi = getOrder(line, cm.doc.direction);\n    if (!bidi) { return moveLogically(line, start, dir) }\n    if (start.ch >= line.text.length) {\n      start.ch = line.text.length;\n      start.sticky = \"before\";\n    } else if (start.ch <= 0) {\n      start.ch = 0;\n      start.sticky = \"after\";\n    }\n    var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n    if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n      // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n      // nothing interesting happens.\n      return moveLogically(line, start, dir)\n    }\n\n    var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n    var prep;\n    var getWrappedLineExtent = function (ch) {\n      if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n      prep = prep || prepareMeasureForLine(cm, line);\n      return wrappedLineExtentChar(cm, line, prep, ch)\n    };\n    var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n    if (cm.doc.direction == \"rtl\" || part.level == 1) {\n      var moveInStorageOrder = (part.level == 1) == (dir < 0);\n      var ch = mv(start, moveInStorageOrder ? 1 : -1);\n      if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n        // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n        var sticky = moveInStorageOrder ? \"before\" : \"after\";\n        return new Pos(start.line, ch, sticky)\n      }\n    }\n\n    // Case 3: Could not move within this bidi part in this visual line, so leave\n    // the current bidi part\n\n    var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n      var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n        ? new Pos(start.line, mv(ch, 1), \"before\")\n        : new Pos(start.line, ch, \"after\"); };\n\n      for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n        var part = bidi[partPos];\n        var moveInStorageOrder = (dir > 0) == (part.level != 1);\n        var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n        if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n        ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n        if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n      }\n    };\n\n    // Case 3a: Look for other bidi parts on the same visual line\n    var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n    if (res) { return res }\n\n    // Case 3b: Look for other bidi parts on the next visual line\n    var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n    if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n      res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n      if (res) { return res }\n    }\n\n    // Case 4: Nowhere to move\n    return null\n  }\n\n  // Commands are parameter-less actions that can be performed on an\n  // editor, mostly used for keybindings.\n  var commands = {\n    selectAll: selectAll,\n    singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n    killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n      if (range.empty()) {\n        var len = getLine(cm.doc, range.head.line).text.length;\n        if (range.head.ch == len && range.head.line < cm.lastLine())\n          { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n        else\n          { return {from: range.head, to: Pos(range.head.line, len)} }\n      } else {\n        return {from: range.from(), to: range.to()}\n      }\n    }); },\n    deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n      from: Pos(range.from().line, 0),\n      to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n    }); }); },\n    delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n      from: Pos(range.from().line, 0), to: range.from()\n    }); }); },\n    delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n      var top = cm.charCoords(range.head, \"div\").top + 5;\n      var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n      return {from: leftPos, to: range.from()}\n    }); },\n    delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n      var top = cm.charCoords(range.head, \"div\").top + 5;\n      var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n      return {from: range.from(), to: rightPos }\n    }); },\n    undo: function (cm) { return cm.undo(); },\n    redo: function (cm) { return cm.redo(); },\n    undoSelection: function (cm) { return cm.undoSelection(); },\n    redoSelection: function (cm) { return cm.redoSelection(); },\n    goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n    goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n    goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n      {origin: \"+move\", bias: 1}\n    ); },\n    goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n      {origin: \"+move\", bias: 1}\n    ); },\n    goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n      {origin: \"+move\", bias: -1}\n    ); },\n    goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n      var top = cm.cursorCoords(range.head, \"div\").top + 5;\n      return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n    }, sel_move); },\n    goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n      var top = cm.cursorCoords(range.head, \"div\").top + 5;\n      return cm.coordsChar({left: 0, top: top}, \"div\")\n    }, sel_move); },\n    goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n      var top = cm.cursorCoords(range.head, \"div\").top + 5;\n      var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n      if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n      return pos\n    }, sel_move); },\n    goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n    goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n    goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n    goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n    goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n    goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n    goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n    goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n    goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n    goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n    goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n    goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n    delCharBefore: function (cm) { return cm.deleteH(-1, \"char\"); },\n    delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n    delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n    delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n    delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n    delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n    indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n    indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n    indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n    insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n    insertSoftTab: function (cm) {\n      var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n      for (var i = 0; i < ranges.length; i++) {\n        var pos = ranges[i].from();\n        var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n        spaces.push(spaceStr(tabSize - col % tabSize));\n      }\n      cm.replaceSelections(spaces);\n    },\n    defaultTab: function (cm) {\n      if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n      else { cm.execCommand(\"insertTab\"); }\n    },\n    // Swap the two chars left and right of each selection's head.\n    // Move cursor behind the two swapped characters afterwards.\n    //\n    // Doesn't consider line feeds a character.\n    // Doesn't scan more than one line above to find a character.\n    // Doesn't do anything on an empty line.\n    // Doesn't do anything with non-empty selections.\n    transposeChars: function (cm) { return runInOp(cm, function () {\n      var ranges = cm.listSelections(), newSel = [];\n      for (var i = 0; i < ranges.length; i++) {\n        if (!ranges[i].empty()) { continue }\n        var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n        if (line) {\n          if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n          if (cur.ch > 0) {\n            cur = new Pos(cur.line, cur.ch + 1);\n            cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n                            Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n          } else if (cur.line > cm.doc.first) {\n            var prev = getLine(cm.doc, cur.line - 1).text;\n            if (prev) {\n              cur = new Pos(cur.line, 1);\n              cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n                              prev.charAt(prev.length - 1),\n                              Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n            }\n          }\n        }\n        newSel.push(new Range(cur, cur));\n      }\n      cm.setSelections(newSel);\n    }); },\n    newlineAndIndent: function (cm) { return runInOp(cm, function () {\n      var sels = cm.listSelections();\n      for (var i = sels.length - 1; i >= 0; i--)\n        { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n      sels = cm.listSelections();\n      for (var i$1 = 0; i$1 < sels.length; i$1++)\n        { cm.indentLine(sels[i$1].from().line, null, true); }\n      ensureCursorVisible(cm);\n    }); },\n    openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n    toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n  };\n\n\n  function lineStart(cm, lineN) {\n    var line = getLine(cm.doc, lineN);\n    var visual = visualLine(line);\n    if (visual != line) { lineN = lineNo(visual); }\n    return endOfLine(true, cm, visual, lineN, 1)\n  }\n  function lineEnd(cm, lineN) {\n    var line = getLine(cm.doc, lineN);\n    var visual = visualLineEnd(line);\n    if (visual != line) { lineN = lineNo(visual); }\n    return endOfLine(true, cm, line, lineN, -1)\n  }\n  function lineStartSmart(cm, pos) {\n    var start = lineStart(cm, pos.line);\n    var line = getLine(cm.doc, start.line);\n    var order = getOrder(line, cm.doc.direction);\n    if (!order || order[0].level == 0) {\n      var firstNonWS = Math.max(0, line.text.search(/\\S/));\n      var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n      return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n    }\n    return start\n  }\n\n  // Run a handler that was bound to a key.\n  function doHandleBinding(cm, bound, dropShift) {\n    if (typeof bound == \"string\") {\n      bound = commands[bound];\n      if (!bound) { return false }\n    }\n    // Ensure previous input has been read, so that the handler sees a\n    // consistent editor of the document\n    cm.display.input.ensurePolled();\n    var prevShift = cm.display.shift, done = false;\n    try {\n      if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n      if (dropShift) { cm.display.shift = false; }\n      done = bound(cm) != Pass;\n    } finally {\n      cm.display.shift = prevShift;\n      cm.state.suppressEdits = false;\n    }\n    return done\n  }\n\n  function lookupKeyForEditor(cm, name, handle) {\n    for (var i = 0; i < cm.state.keyMaps.length; i++) {\n      var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n      if (result) { return result }\n    }\n    return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n      || lookupKey(name, cm.options.keyMap, handle, cm)\n  }\n\n  // Note that, despite the name, this function is also used to check\n  // for bound mouse clicks.\n\n  var stopSeq = new Delayed;\n\n  function dispatchKey(cm, name, e, handle) {\n    var seq = cm.state.keySeq;\n    if (seq) {\n      if (isModifierKey(name)) { return \"handled\" }\n      if (/\\'$/.test(name))\n        { cm.state.keySeq = null; }\n      else\n        { stopSeq.set(50, function () {\n          if (cm.state.keySeq == seq) {\n            cm.state.keySeq = null;\n            cm.display.input.reset();\n          }\n        }); }\n      if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n    }\n    return dispatchKeyInner(cm, name, e, handle)\n  }\n\n  function dispatchKeyInner(cm, name, e, handle) {\n    var result = lookupKeyForEditor(cm, name, handle);\n\n    if (result == \"multi\")\n      { cm.state.keySeq = name; }\n    if (result == \"handled\")\n      { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n    if (result == \"handled\" || result == \"multi\") {\n      e_preventDefault(e);\n      restartBlink(cm);\n    }\n\n    return !!result\n  }\n\n  // Handle a key from the keydown event.\n  function handleKeyBinding(cm, e) {\n    var name = keyName(e, true);\n    if (!name) { return false }\n\n    if (e.shiftKey && !cm.state.keySeq) {\n      // First try to resolve full name (including 'Shift-'). Failing\n      // that, see if there is a cursor-motion command (starting with\n      // 'go') bound to the keyname without 'Shift-'.\n      return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n          || dispatchKey(cm, name, e, function (b) {\n               if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n                 { return doHandleBinding(cm, b) }\n             })\n    } else {\n      return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n    }\n  }\n\n  // Handle a key from the keypress event\n  function handleCharBinding(cm, e, ch) {\n    return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n  }\n\n  var lastStoppedKey = null;\n  function onKeyDown(e) {\n    var cm = this;\n    cm.curOp.focus = activeElt();\n    if (signalDOMEvent(cm, e)) { return }\n    // IE does strange things with escape.\n    if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n    var code = e.keyCode;\n    cm.display.shift = code == 16 || e.shiftKey;\n    var handled = handleKeyBinding(cm, e);\n    if (presto) {\n      lastStoppedKey = handled ? code : null;\n      // Opera has no cut event... we try to at least catch the key combo\n      if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n        { cm.replaceSelection(\"\", null, \"cut\"); }\n    }\n\n    // Turn mouse into crosshair when Alt is held on Mac.\n    if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n      { showCrossHair(cm); }\n  }\n\n  function showCrossHair(cm) {\n    var lineDiv = cm.display.lineDiv;\n    addClass(lineDiv, \"CodeMirror-crosshair\");\n\n    function up(e) {\n      if (e.keyCode == 18 || !e.altKey) {\n        rmClass(lineDiv, \"CodeMirror-crosshair\");\n        off(document, \"keyup\", up);\n        off(document, \"mouseover\", up);\n      }\n    }\n    on(document, \"keyup\", up);\n    on(document, \"mouseover\", up);\n  }\n\n  function onKeyUp(e) {\n    if (e.keyCode == 16) { this.doc.sel.shift = false; }\n    signalDOMEvent(this, e);\n  }\n\n  function onKeyPress(e) {\n    var cm = this;\n    if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n    var keyCode = e.keyCode, charCode = e.charCode;\n    if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n    if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n    var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n    // Some browsers fire keypress events for backspace\n    if (ch == \"\\x08\") { return }\n    if (handleCharBinding(cm, e, ch)) { return }\n    cm.display.input.onKeyPress(e);\n  }\n\n  var DOUBLECLICK_DELAY = 400;\n\n  var PastClick = function(time, pos, button) {\n    this.time = time;\n    this.pos = pos;\n    this.button = button;\n  };\n\n  PastClick.prototype.compare = function (time, pos, button) {\n    return this.time + DOUBLECLICK_DELAY > time &&\n      cmp(pos, this.pos) == 0 && button == this.button\n  };\n\n  var lastClick, lastDoubleClick;\n  function clickRepeat(pos, button) {\n    var now = +new Date;\n    if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n      lastClick = lastDoubleClick = null;\n      return \"triple\"\n    } else if (lastClick && lastClick.compare(now, pos, button)) {\n      lastDoubleClick = new PastClick(now, pos, button);\n      lastClick = null;\n      return \"double\"\n    } else {\n      lastClick = new PastClick(now, pos, button);\n      lastDoubleClick = null;\n      return \"single\"\n    }\n  }\n\n  // A mouse down can be a single click, double click, triple click,\n  // start of selection drag, start of text drag, new cursor\n  // (ctrl-click), rectangle drag (alt-drag), or xwin\n  // middle-click-paste. Or it might be a click on something we should\n  // not interfere with, such as a scrollbar or widget.\n  function onMouseDown(e) {\n    var cm = this, display = cm.display;\n    if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n    display.input.ensurePolled();\n    display.shift = e.shiftKey;\n\n    if (eventInWidget(display, e)) {\n      if (!webkit) {\n        // Briefly turn off draggability, to allow widgets to do\n        // normal dragging things.\n        display.scroller.draggable = false;\n        setTimeout(function () { return display.scroller.draggable = true; }, 100);\n      }\n      return\n    }\n    if (clickInGutter(cm, e)) { return }\n    var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n    window.focus();\n\n    // #3261: make sure, that we're not starting a second selection\n    if (button == 1 && cm.state.selectingText)\n      { cm.state.selectingText(e); }\n\n    if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n    if (button == 1) {\n      if (pos) { leftButtonDown(cm, pos, repeat, e); }\n      else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n    } else if (button == 2) {\n      if (pos) { extendSelection(cm.doc, pos); }\n      setTimeout(function () { return display.input.focus(); }, 20);\n    } else if (button == 3) {\n      if (captureRightClick) { cm.display.input.onContextMenu(e); }\n      else { delayBlurEvent(cm); }\n    }\n  }\n\n  function handleMappedButton(cm, button, pos, repeat, event) {\n    var name = \"Click\";\n    if (repeat == \"double\") { name = \"Double\" + name; }\n    else if (repeat == \"triple\") { name = \"Triple\" + name; }\n    name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n    return dispatchKey(cm,  addModifierNames(name, event), event, function (bound) {\n      if (typeof bound == \"string\") { bound = commands[bound]; }\n      if (!bound) { return false }\n      var done = false;\n      try {\n        if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n        done = bound(cm, pos) != Pass;\n      } finally {\n        cm.state.suppressEdits = false;\n      }\n      return done\n    })\n  }\n\n  function configureMouse(cm, repeat, event) {\n    var option = cm.getOption(\"configureMouse\");\n    var value = option ? option(cm, repeat, event) : {};\n    if (value.unit == null) {\n      var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n      value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n    }\n    if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n    if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n    if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n    return value\n  }\n\n  function leftButtonDown(cm, pos, repeat, event) {\n    if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n    else { cm.curOp.focus = activeElt(); }\n\n    var behavior = configureMouse(cm, repeat, event);\n\n    var sel = cm.doc.sel, contained;\n    if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n        repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n        (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n        (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n      { leftButtonStartDrag(cm, event, pos, behavior); }\n    else\n      { leftButtonSelect(cm, event, pos, behavior); }\n  }\n\n  // Start a text drag. When it ends, see if any dragging actually\n  // happen, and treat as a click if it didn't.\n  function leftButtonStartDrag(cm, event, pos, behavior) {\n    var display = cm.display, moved = false;\n    var dragEnd = operation(cm, function (e) {\n      if (webkit) { display.scroller.draggable = false; }\n      cm.state.draggingText = false;\n      off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n      off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n      off(display.scroller, \"dragstart\", dragStart);\n      off(display.scroller, \"drop\", dragEnd);\n      if (!moved) {\n        e_preventDefault(e);\n        if (!behavior.addNew)\n          { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n        // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n        if (webkit || ie && ie_version == 9)\n          { setTimeout(function () {display.wrapper.ownerDocument.body.focus(); display.input.focus();}, 20); }\n        else\n          { display.input.focus(); }\n      }\n    });\n    var mouseMove = function(e2) {\n      moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n    };\n    var dragStart = function () { return moved = true; };\n    // Let the drag handler handle this.\n    if (webkit) { display.scroller.draggable = true; }\n    cm.state.draggingText = dragEnd;\n    dragEnd.copy = !behavior.moveOnDrag;\n    // IE's approach to draggable\n    if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n    on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n    on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n    on(display.scroller, \"dragstart\", dragStart);\n    on(display.scroller, \"drop\", dragEnd);\n\n    delayBlurEvent(cm);\n    setTimeout(function () { return display.input.focus(); }, 20);\n  }\n\n  function rangeForUnit(cm, pos, unit) {\n    if (unit == \"char\") { return new Range(pos, pos) }\n    if (unit == \"word\") { return cm.findWordAt(pos) }\n    if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n    var result = unit(cm, pos);\n    return new Range(result.from, result.to)\n  }\n\n  // Normal selection, as opposed to text dragging.\n  function leftButtonSelect(cm, event, start, behavior) {\n    var display = cm.display, doc = cm.doc;\n    e_preventDefault(event);\n\n    var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n    if (behavior.addNew && !behavior.extend) {\n      ourIndex = doc.sel.contains(start);\n      if (ourIndex > -1)\n        { ourRange = ranges[ourIndex]; }\n      else\n        { ourRange = new Range(start, start); }\n    } else {\n      ourRange = doc.sel.primary();\n      ourIndex = doc.sel.primIndex;\n    }\n\n    if (behavior.unit == \"rectangle\") {\n      if (!behavior.addNew) { ourRange = new Range(start, start); }\n      start = posFromMouse(cm, event, true, true);\n      ourIndex = -1;\n    } else {\n      var range$$1 = rangeForUnit(cm, start, behavior.unit);\n      if (behavior.extend)\n        { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n      else\n        { ourRange = range$$1; }\n    }\n\n    if (!behavior.addNew) {\n      ourIndex = 0;\n      setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n      startSel = doc.sel;\n    } else if (ourIndex == -1) {\n      ourIndex = ranges.length;\n      setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n                   {scroll: false, origin: \"*mouse\"});\n    } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n      setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n                   {scroll: false, origin: \"*mouse\"});\n      startSel = doc.sel;\n    } else {\n      replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n    }\n\n    var lastPos = start;\n    function extendTo(pos) {\n      if (cmp(lastPos, pos) == 0) { return }\n      lastPos = pos;\n\n      if (behavior.unit == \"rectangle\") {\n        var ranges = [], tabSize = cm.options.tabSize;\n        var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n        var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n        var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n        for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n             line <= end; line++) {\n          var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n          if (left == right)\n            { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n          else if (text.length > leftPos)\n            { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n        }\n        if (!ranges.length) { ranges.push(new Range(start, start)); }\n        setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n                     {origin: \"*mouse\", scroll: false});\n        cm.scrollIntoView(pos);\n      } else {\n        var oldRange = ourRange;\n        var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n        var anchor = oldRange.anchor, head;\n        if (cmp(range$$1.anchor, anchor) > 0) {\n          head = range$$1.head;\n          anchor = minPos(oldRange.from(), range$$1.anchor);\n        } else {\n          head = range$$1.anchor;\n          anchor = maxPos(oldRange.to(), range$$1.head);\n        }\n        var ranges$1 = startSel.ranges.slice(0);\n        ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n        setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n      }\n    }\n\n    var editorSize = display.wrapper.getBoundingClientRect();\n    // Used to ensure timeout re-tries don't fire when another extend\n    // happened in the meantime (clearTimeout isn't reliable -- at\n    // least on Chrome, the timeouts still happen even when cleared,\n    // if the clear happens after their scheduled firing time).\n    var counter = 0;\n\n    function extend(e) {\n      var curCount = ++counter;\n      var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n      if (!cur) { return }\n      if (cmp(cur, lastPos) != 0) {\n        cm.curOp.focus = activeElt();\n        extendTo(cur);\n        var visible = visibleLines(display, doc);\n        if (cur.line >= visible.to || cur.line < visible.from)\n          { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n      } else {\n        var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n        if (outside) { setTimeout(operation(cm, function () {\n          if (counter != curCount) { return }\n          display.scroller.scrollTop += outside;\n          extend(e);\n        }), 50); }\n      }\n    }\n\n    function done(e) {\n      cm.state.selectingText = false;\n      counter = Infinity;\n      // If e is null or undefined we interpret this as someone trying\n      // to explicitly cancel the selection rather than the user\n      // letting go of the mouse button.\n      if (e) {\n        e_preventDefault(e);\n        display.input.focus();\n      }\n      off(display.wrapper.ownerDocument, \"mousemove\", move);\n      off(display.wrapper.ownerDocument, \"mouseup\", up);\n      doc.history.lastSelOrigin = null;\n    }\n\n    var move = operation(cm, function (e) {\n      if (e.buttons === 0 || !e_button(e)) { done(e); }\n      else { extend(e); }\n    });\n    var up = operation(cm, done);\n    cm.state.selectingText = up;\n    on(display.wrapper.ownerDocument, \"mousemove\", move);\n    on(display.wrapper.ownerDocument, \"mouseup\", up);\n  }\n\n  // Used when mouse-selecting to adjust the anchor to the proper side\n  // of a bidi jump depending on the visual position of the head.\n  function bidiSimplify(cm, range$$1) {\n    var anchor = range$$1.anchor;\n    var head = range$$1.head;\n    var anchorLine = getLine(cm.doc, anchor.line);\n    if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n    var order = getOrder(anchorLine);\n    if (!order) { return range$$1 }\n    var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n    if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n    var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n    if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n    // Compute the relative visual position of the head compared to the\n    // anchor (<0 is to the left, >0 to the right)\n    var leftSide;\n    if (head.line != anchor.line) {\n      leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n    } else {\n      var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n      var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n      if (headIndex == boundary - 1 || headIndex == boundary)\n        { leftSide = dir < 0; }\n      else\n        { leftSide = dir > 0; }\n    }\n\n    var usePart = order[boundary + (leftSide ? -1 : 0)];\n    var from = leftSide == (usePart.level == 1);\n    var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n    return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n  }\n\n\n  // Determines whether an event happened in the gutter, and fires the\n  // handlers for the corresponding event.\n  function gutterEvent(cm, e, type, prevent) {\n    var mX, mY;\n    if (e.touches) {\n      mX = e.touches[0].clientX;\n      mY = e.touches[0].clientY;\n    } else {\n      try { mX = e.clientX; mY = e.clientY; }\n      catch(e) { return false }\n    }\n    if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n    if (prevent) { e_preventDefault(e); }\n\n    var display = cm.display;\n    var lineBox = display.lineDiv.getBoundingClientRect();\n\n    if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n    mY -= lineBox.top - display.viewOffset;\n\n    for (var i = 0; i < cm.display.gutterSpecs.length; ++i) {\n      var g = display.gutters.childNodes[i];\n      if (g && g.getBoundingClientRect().right >= mX) {\n        var line = lineAtHeight(cm.doc, mY);\n        var gutter = cm.display.gutterSpecs[i];\n        signal(cm, type, cm, line, gutter.className, e);\n        return e_defaultPrevented(e)\n      }\n    }\n  }\n\n  function clickInGutter(cm, e) {\n    return gutterEvent(cm, e, \"gutterClick\", true)\n  }\n\n  // CONTEXT MENU HANDLING\n\n  // To make the context menu work, we need to briefly unhide the\n  // textarea (making it as unobtrusive as possible) to let the\n  // right-click take effect on it.\n  function onContextMenu(cm, e) {\n    if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n    if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n    if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n  }\n\n  function contextMenuInGutter(cm, e) {\n    if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n    return gutterEvent(cm, e, \"gutterContextMenu\", false)\n  }\n\n  function themeChanged(cm) {\n    cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n      cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n    clearCaches(cm);\n  }\n\n  var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n  var defaults = {};\n  var optionHandlers = {};\n\n  function defineOptions(CodeMirror) {\n    var optionHandlers = CodeMirror.optionHandlers;\n\n    function option(name, deflt, handle, notOnInit) {\n      CodeMirror.defaults[name] = deflt;\n      if (handle) { optionHandlers[name] =\n        notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n    }\n\n    CodeMirror.defineOption = option;\n\n    // Passed to option handlers when there is no old value.\n    CodeMirror.Init = Init;\n\n    // These two are, on init, called from the constructor because they\n    // have to be initialized before the editor can start at all.\n    option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n    option(\"mode\", null, function (cm, val) {\n      cm.doc.modeOption = val;\n      loadMode(cm);\n    }, true);\n\n    option(\"indentUnit\", 2, loadMode, true);\n    option(\"indentWithTabs\", false);\n    option(\"smartIndent\", true);\n    option(\"tabSize\", 4, function (cm) {\n      resetModeState(cm);\n      clearCaches(cm);\n      regChange(cm);\n    }, true);\n\n    option(\"lineSeparator\", null, function (cm, val) {\n      cm.doc.lineSep = val;\n      if (!val) { return }\n      var newBreaks = [], lineNo = cm.doc.first;\n      cm.doc.iter(function (line) {\n        for (var pos = 0;;) {\n          var found = line.text.indexOf(val, pos);\n          if (found == -1) { break }\n          pos = found + val.length;\n          newBreaks.push(Pos(lineNo, found));\n        }\n        lineNo++;\n      });\n      for (var i = newBreaks.length - 1; i >= 0; i--)\n        { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n    });\n    option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b-\\u200f\\u2028\\u2029\\ufeff\\ufff9-\\ufffc]/g, function (cm, val, old) {\n      cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n      if (old != Init) { cm.refresh(); }\n    });\n    option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n    option(\"electricChars\", true);\n    option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n      throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n    }, true);\n    option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n    option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n    option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n    option(\"rtlMoveVisually\", !windows);\n    option(\"wholeLineUpdateBefore\", true);\n\n    option(\"theme\", \"default\", function (cm) {\n      themeChanged(cm);\n      updateGutters(cm);\n    }, true);\n    option(\"keyMap\", \"default\", function (cm, val, old) {\n      var next = getKeyMap(val);\n      var prev = old != Init && getKeyMap(old);\n      if (prev && prev.detach) { prev.detach(cm, next); }\n      if (next.attach) { next.attach(cm, prev || null); }\n    });\n    option(\"extraKeys\", null);\n    option(\"configureMouse\", null);\n\n    option(\"lineWrapping\", false, wrappingChanged, true);\n    option(\"gutters\", [], function (cm, val) {\n      cm.display.gutterSpecs = getGutters(val, cm.options.lineNumbers);\n      updateGutters(cm);\n    }, true);\n    option(\"fixedGutter\", true, function (cm, val) {\n      cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n      cm.refresh();\n    }, true);\n    option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n    option(\"scrollbarStyle\", \"native\", function (cm) {\n      initScrollbars(cm);\n      updateScrollbars(cm);\n      cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n      cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n    }, true);\n    option(\"lineNumbers\", false, function (cm, val) {\n      cm.display.gutterSpecs = getGutters(cm.options.gutters, val);\n      updateGutters(cm);\n    }, true);\n    option(\"firstLineNumber\", 1, updateGutters, true);\n    option(\"lineNumberFormatter\", function (integer) { return integer; }, updateGutters, true);\n    option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n    option(\"resetSelectionOnContextMenu\", true);\n    option(\"lineWiseCopyCut\", true);\n    option(\"pasteLinesPerSelection\", true);\n    option(\"selectionsMayTouch\", false);\n\n    option(\"readOnly\", false, function (cm, val) {\n      if (val == \"nocursor\") {\n        onBlur(cm);\n        cm.display.input.blur();\n      }\n      cm.display.input.readOnlyChanged(val);\n    });\n    option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n    option(\"dragDrop\", true, dragDropChanged);\n    option(\"allowDropFileTypes\", null);\n\n    option(\"cursorBlinkRate\", 530);\n    option(\"cursorScrollMargin\", 0);\n    option(\"cursorHeight\", 1, updateSelection, true);\n    option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n    option(\"workTime\", 100);\n    option(\"workDelay\", 100);\n    option(\"flattenSpans\", true, resetModeState, true);\n    option(\"addModeClass\", false, resetModeState, true);\n    option(\"pollInterval\", 100);\n    option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n    option(\"historyEventDelay\", 1250);\n    option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n    option(\"maxHighlightLength\", 10000, resetModeState, true);\n    option(\"moveInputWithCursor\", true, function (cm, val) {\n      if (!val) { cm.display.input.resetPosition(); }\n    });\n\n    option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n    option(\"autofocus\", null);\n    option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n    option(\"phrases\", null);\n  }\n\n  function dragDropChanged(cm, value, old) {\n    var wasOn = old && old != Init;\n    if (!value != !wasOn) {\n      var funcs = cm.display.dragFunctions;\n      var toggle = value ? on : off;\n      toggle(cm.display.scroller, \"dragstart\", funcs.start);\n      toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n      toggle(cm.display.scroller, \"dragover\", funcs.over);\n      toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n      toggle(cm.display.scroller, \"drop\", funcs.drop);\n    }\n  }\n\n  function wrappingChanged(cm) {\n    if (cm.options.lineWrapping) {\n      addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n      cm.display.sizer.style.minWidth = \"\";\n      cm.display.sizerWidth = null;\n    } else {\n      rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n      findMaxLine(cm);\n    }\n    estimateLineHeights(cm);\n    regChange(cm);\n    clearCaches(cm);\n    setTimeout(function () { return updateScrollbars(cm); }, 100);\n  }\n\n  // A CodeMirror instance represents an editor. This is the object\n  // that user code is usually dealing with.\n\n  function CodeMirror(place, options) {\n    var this$1 = this;\n\n    if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n    this.options = options = options ? copyObj(options) : {};\n    // Determine effective options based on given values and defaults.\n    copyObj(defaults, options, false);\n\n    var doc = options.value;\n    if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n    else if (options.mode) { doc.modeOption = options.mode; }\n    this.doc = doc;\n\n    var input = new CodeMirror.inputStyles[options.inputStyle](this);\n    var display = this.display = new Display(place, doc, input, options);\n    display.wrapper.CodeMirror = this;\n    themeChanged(this);\n    if (options.lineWrapping)\n      { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n    initScrollbars(this);\n\n    this.state = {\n      keyMaps: [],  // stores maps added by addKeyMap\n      overlays: [], // highlighting overlays, as added by addOverlay\n      modeGen: 0,   // bumped when mode/overlay changes, used to invalidate highlighting info\n      overwrite: false,\n      delayingBlurEvent: false,\n      focused: false,\n      suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n      pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n      selectingText: false,\n      draggingText: false,\n      highlight: new Delayed(), // stores highlight worker timeout\n      keySeq: null,  // Unfinished key sequence\n      specialChars: null\n    };\n\n    if (options.autofocus && !mobile) { display.input.focus(); }\n\n    // Override magic textarea content restore that IE sometimes does\n    // on our hidden textarea on reload\n    if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n    registerEventHandlers(this);\n    ensureGlobalHandlers();\n\n    startOperation(this);\n    this.curOp.forceUpdate = true;\n    attachDoc(this, doc);\n\n    if ((options.autofocus && !mobile) || this.hasFocus())\n      { setTimeout(bind(onFocus, this), 20); }\n    else\n      { onBlur(this); }\n\n    for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n      { optionHandlers[opt](this$1, options[opt], Init); } }\n    maybeUpdateLineNumberWidth(this);\n    if (options.finishInit) { options.finishInit(this); }\n    for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1); }\n    endOperation(this);\n    // Suppress optimizelegibility in Webkit, since it breaks text\n    // measuring on line wrapping boundaries.\n    if (webkit && options.lineWrapping &&\n        getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n      { display.lineDiv.style.textRendering = \"auto\"; }\n  }\n\n  // The default configuration options.\n  CodeMirror.defaults = defaults;\n  // Functions to run when options are changed.\n  CodeMirror.optionHandlers = optionHandlers;\n\n  // Attach the necessary event handlers when initializing the editor\n  function registerEventHandlers(cm) {\n    var d = cm.display;\n    on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n    // Older IE's will not fire a second mousedown for a double click\n    if (ie && ie_version < 11)\n      { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n        if (signalDOMEvent(cm, e)) { return }\n        var pos = posFromMouse(cm, e);\n        if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n        e_preventDefault(e);\n        var word = cm.findWordAt(pos);\n        extendSelection(cm.doc, word.anchor, word.head);\n      })); }\n    else\n      { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n    // Some browsers fire contextmenu *after* opening the menu, at\n    // which point we can't mess with it anymore. Context menu is\n    // handled in onMouseDown for these browsers.\n    on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n    // Used to suppress mouse event handling when a touch happens\n    var touchFinished, prevTouch = {end: 0};\n    function finishTouch() {\n      if (d.activeTouch) {\n        touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n        prevTouch = d.activeTouch;\n        prevTouch.end = +new Date;\n      }\n    }\n    function isMouseLikeTouchEvent(e) {\n      if (e.touches.length != 1) { return false }\n      var touch = e.touches[0];\n      return touch.radiusX <= 1 && touch.radiusY <= 1\n    }\n    function farAway(touch, other) {\n      if (other.left == null) { return true }\n      var dx = other.left - touch.left, dy = other.top - touch.top;\n      return dx * dx + dy * dy > 20 * 20\n    }\n    on(d.scroller, \"touchstart\", function (e) {\n      if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n        d.input.ensurePolled();\n        clearTimeout(touchFinished);\n        var now = +new Date;\n        d.activeTouch = {start: now, moved: false,\n                         prev: now - prevTouch.end <= 300 ? prevTouch : null};\n        if (e.touches.length == 1) {\n          d.activeTouch.left = e.touches[0].pageX;\n          d.activeTouch.top = e.touches[0].pageY;\n        }\n      }\n    });\n    on(d.scroller, \"touchmove\", function () {\n      if (d.activeTouch) { d.activeTouch.moved = true; }\n    });\n    on(d.scroller, \"touchend\", function (e) {\n      var touch = d.activeTouch;\n      if (touch && !eventInWidget(d, e) && touch.left != null &&\n          !touch.moved && new Date - touch.start < 300) {\n        var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n        if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n          { range = new Range(pos, pos); }\n        else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n          { range = cm.findWordAt(pos); }\n        else // Triple tap\n          { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n        cm.setSelection(range.anchor, range.head);\n        cm.focus();\n        e_preventDefault(e);\n      }\n      finishTouch();\n    });\n    on(d.scroller, \"touchcancel\", finishTouch);\n\n    // Sync scrolling between fake scrollbars and real scrollable\n    // area, ensure viewport is updated when scrolling.\n    on(d.scroller, \"scroll\", function () {\n      if (d.scroller.clientHeight) {\n        updateScrollTop(cm, d.scroller.scrollTop);\n        setScrollLeft(cm, d.scroller.scrollLeft, true);\n        signal(cm, \"scroll\", cm);\n      }\n    });\n\n    // Listen to wheel events in order to try and update the viewport on time.\n    on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n    on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n    // Prevent wrapper from ever scrolling\n    on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n    d.dragFunctions = {\n      enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n      over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n      start: function (e) { return onDragStart(cm, e); },\n      drop: operation(cm, onDrop),\n      leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n    };\n\n    var inp = d.input.getField();\n    on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n    on(inp, \"keydown\", operation(cm, onKeyDown));\n    on(inp, \"keypress\", operation(cm, onKeyPress));\n    on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n    on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n  }\n\n  var initHooks = [];\n  CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n  // Indent the given line. The how parameter can be \"smart\",\n  // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n  // (typically set to true for forced single-line indents), empty\n  // lines are not indented, and places where the mode returns Pass\n  // are left alone.\n  function indentLine(cm, n, how, aggressive) {\n    var doc = cm.doc, state;\n    if (how == null) { how = \"add\"; }\n    if (how == \"smart\") {\n      // Fall back to \"prev\" when the mode doesn't have an indentation\n      // method.\n      if (!doc.mode.indent) { how = \"prev\"; }\n      else { state = getContextBefore(cm, n).state; }\n    }\n\n    var tabSize = cm.options.tabSize;\n    var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n    if (line.stateAfter) { line.stateAfter = null; }\n    var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n    if (!aggressive && !/\\S/.test(line.text)) {\n      indentation = 0;\n      how = \"not\";\n    } else if (how == \"smart\") {\n      indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n      if (indentation == Pass || indentation > 150) {\n        if (!aggressive) { return }\n        how = \"prev\";\n      }\n    }\n    if (how == \"prev\") {\n      if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n      else { indentation = 0; }\n    } else if (how == \"add\") {\n      indentation = curSpace + cm.options.indentUnit;\n    } else if (how == \"subtract\") {\n      indentation = curSpace - cm.options.indentUnit;\n    } else if (typeof how == \"number\") {\n      indentation = curSpace + how;\n    }\n    indentation = Math.max(0, indentation);\n\n    var indentString = \"\", pos = 0;\n    if (cm.options.indentWithTabs)\n      { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n    if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n    if (indentString != curSpaceString) {\n      replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n      line.stateAfter = null;\n      return true\n    } else {\n      // Ensure that, if the cursor was in the whitespace at the start\n      // of the line, it is moved to the end of that space.\n      for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n        var range = doc.sel.ranges[i$1];\n        if (range.head.line == n && range.head.ch < curSpaceString.length) {\n          var pos$1 = Pos(n, curSpaceString.length);\n          replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n          break\n        }\n      }\n    }\n  }\n\n  // This will be set to a {lineWise: bool, text: [string]} object, so\n  // that, when pasting, we know what kind of selections the copied\n  // text was made out of.\n  var lastCopied = null;\n\n  function setLastCopied(newLastCopied) {\n    lastCopied = newLastCopied;\n  }\n\n  function applyTextInput(cm, inserted, deleted, sel, origin) {\n    var doc = cm.doc;\n    cm.display.shift = false;\n    if (!sel) { sel = doc.sel; }\n\n    var recent = +new Date - 200;\n    var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n    var textLines = splitLinesAuto(inserted), multiPaste = null;\n    // When pasting N lines into N selections, insert one line per selection\n    if (paste && sel.ranges.length > 1) {\n      if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n        if (sel.ranges.length % lastCopied.text.length == 0) {\n          multiPaste = [];\n          for (var i = 0; i < lastCopied.text.length; i++)\n            { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n        }\n      } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n        multiPaste = map(textLines, function (l) { return [l]; });\n      }\n    }\n\n    var updateInput = cm.curOp.updateInput;\n    // Normal behavior is to insert the new text into every selection\n    for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n      var range$$1 = sel.ranges[i$1];\n      var from = range$$1.from(), to = range$$1.to();\n      if (range$$1.empty()) {\n        if (deleted && deleted > 0) // Handle deletion\n          { from = Pos(from.line, from.ch - deleted); }\n        else if (cm.state.overwrite && !paste) // Handle overwrite\n          { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n        else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == inserted)\n          { from = to = Pos(from.line, 0); }\n      }\n      var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n                         origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n      makeChange(cm.doc, changeEvent);\n      signalLater(cm, \"inputRead\", cm, changeEvent);\n    }\n    if (inserted && !paste)\n      { triggerElectric(cm, inserted); }\n\n    ensureCursorVisible(cm);\n    if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n    cm.curOp.typing = true;\n    cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n  }\n\n  function handlePaste(e, cm) {\n    var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n    if (pasted) {\n      e.preventDefault();\n      if (!cm.isReadOnly() && !cm.options.disableInput)\n        { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n      return true\n    }\n  }\n\n  function triggerElectric(cm, inserted) {\n    // When an 'electric' character is inserted, immediately trigger a reindent\n    if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n    var sel = cm.doc.sel;\n\n    for (var i = sel.ranges.length - 1; i >= 0; i--) {\n      var range$$1 = sel.ranges[i];\n      if (range$$1.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range$$1.head.line)) { continue }\n      var mode = cm.getModeAt(range$$1.head);\n      var indented = false;\n      if (mode.electricChars) {\n        for (var j = 0; j < mode.electricChars.length; j++)\n          { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n            indented = indentLine(cm, range$$1.head.line, \"smart\");\n            break\n          } }\n      } else if (mode.electricInput) {\n        if (mode.electricInput.test(getLine(cm.doc, range$$1.head.line).text.slice(0, range$$1.head.ch)))\n          { indented = indentLine(cm, range$$1.head.line, \"smart\"); }\n      }\n      if (indented) { signalLater(cm, \"electricInput\", cm, range$$1.head.line); }\n    }\n  }\n\n  function copyableRanges(cm) {\n    var text = [], ranges = [];\n    for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n      var line = cm.doc.sel.ranges[i].head.line;\n      var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n      ranges.push(lineRange);\n      text.push(cm.getRange(lineRange.anchor, lineRange.head));\n    }\n    return {text: text, ranges: ranges}\n  }\n\n  function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n    field.setAttribute(\"autocorrect\", autocorrect ? \"\" : \"off\");\n    field.setAttribute(\"autocapitalize\", autocapitalize ? \"\" : \"off\");\n    field.setAttribute(\"spellcheck\", !!spellcheck);\n  }\n\n  function hiddenTextarea() {\n    var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none\");\n    var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n    // The textarea is kept positioned near the cursor to prevent the\n    // fact that it'll be scrolled into editor on input from scrolling\n    // our fake cursor out of editor. On webkit, when wrap=off, paste is\n    // very slow. So make the area wide instead.\n    if (webkit) { te.style.width = \"1000px\"; }\n    else { te.setAttribute(\"wrap\", \"off\"); }\n    // If border: 0; -- iOS fails to open keyboard (issue #1287)\n    if (ios) { te.style.border = \"1px solid black\"; }\n    disableBrowserMagic(te);\n    return div\n  }\n\n  // The publicly visible API. Note that methodOp(f) means\n  // 'wrap f in an operation, performed on its `this` parameter'.\n\n  // This is not the complete set of editor methods. Most of the\n  // methods defined on the Doc type are also injected into\n  // CodeMirror.prototype, for backwards compatibility and\n  // convenience.\n\n  function addEditorMethods(CodeMirror) {\n    var optionHandlers = CodeMirror.optionHandlers;\n\n    var helpers = CodeMirror.helpers = {};\n\n    CodeMirror.prototype = {\n      constructor: CodeMirror,\n      focus: function(){window.focus(); this.display.input.focus();},\n\n      setOption: function(option, value) {\n        var options = this.options, old = options[option];\n        if (options[option] == value && option != \"mode\") { return }\n        options[option] = value;\n        if (optionHandlers.hasOwnProperty(option))\n          { operation(this, optionHandlers[option])(this, value, old); }\n        signal(this, \"optionChange\", this, option);\n      },\n\n      getOption: function(option) {return this.options[option]},\n      getDoc: function() {return this.doc},\n\n      addKeyMap: function(map$$1, bottom) {\n        this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map$$1));\n      },\n      removeKeyMap: function(map$$1) {\n        var maps = this.state.keyMaps;\n        for (var i = 0; i < maps.length; ++i)\n          { if (maps[i] == map$$1 || maps[i].name == map$$1) {\n            maps.splice(i, 1);\n            return true\n          } }\n      },\n\n      addOverlay: methodOp(function(spec, options) {\n        var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n        if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n        insertSorted(this.state.overlays,\n                     {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n                      priority: (options && options.priority) || 0},\n                     function (overlay) { return overlay.priority; });\n        this.state.modeGen++;\n        regChange(this);\n      }),\n      removeOverlay: methodOp(function(spec) {\n        var this$1 = this;\n\n        var overlays = this.state.overlays;\n        for (var i = 0; i < overlays.length; ++i) {\n          var cur = overlays[i].modeSpec;\n          if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n            overlays.splice(i, 1);\n            this$1.state.modeGen++;\n            regChange(this$1);\n            return\n          }\n        }\n      }),\n\n      indentLine: methodOp(function(n, dir, aggressive) {\n        if (typeof dir != \"string\" && typeof dir != \"number\") {\n          if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n          else { dir = dir ? \"add\" : \"subtract\"; }\n        }\n        if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n      }),\n      indentSelection: methodOp(function(how) {\n        var this$1 = this;\n\n        var ranges = this.doc.sel.ranges, end = -1;\n        for (var i = 0; i < ranges.length; i++) {\n          var range$$1 = ranges[i];\n          if (!range$$1.empty()) {\n            var from = range$$1.from(), to = range$$1.to();\n            var start = Math.max(end, from.line);\n            end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n            for (var j = start; j < end; ++j)\n              { indentLine(this$1, j, how); }\n            var newRanges = this$1.doc.sel.ranges;\n            if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n              { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n          } else if (range$$1.head.line > end) {\n            indentLine(this$1, range$$1.head.line, how, true);\n            end = range$$1.head.line;\n            if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); }\n          }\n        }\n      }),\n\n      // Fetch the parser token for a given character. Useful for hacks\n      // that want to inspect the mode state (say, for completion).\n      getTokenAt: function(pos, precise) {\n        return takeToken(this, pos, precise)\n      },\n\n      getLineTokens: function(line, precise) {\n        return takeToken(this, Pos(line), precise, true)\n      },\n\n      getTokenTypeAt: function(pos) {\n        pos = clipPos(this.doc, pos);\n        var styles = getLineStyles(this, getLine(this.doc, pos.line));\n        var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n        var type;\n        if (ch == 0) { type = styles[2]; }\n        else { for (;;) {\n          var mid = (before + after) >> 1;\n          if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n          else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n          else { type = styles[mid * 2 + 2]; break }\n        } }\n        var cut = type ? type.indexOf(\"overlay \") : -1;\n        return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n      },\n\n      getModeAt: function(pos) {\n        var mode = this.doc.mode;\n        if (!mode.innerMode) { return mode }\n        return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n      },\n\n      getHelper: function(pos, type) {\n        return this.getHelpers(pos, type)[0]\n      },\n\n      getHelpers: function(pos, type) {\n        var this$1 = this;\n\n        var found = [];\n        if (!helpers.hasOwnProperty(type)) { return found }\n        var help = helpers[type], mode = this.getModeAt(pos);\n        if (typeof mode[type] == \"string\") {\n          if (help[mode[type]]) { found.push(help[mode[type]]); }\n        } else if (mode[type]) {\n          for (var i = 0; i < mode[type].length; i++) {\n            var val = help[mode[type][i]];\n            if (val) { found.push(val); }\n          }\n        } else if (mode.helperType && help[mode.helperType]) {\n          found.push(help[mode.helperType]);\n        } else if (help[mode.name]) {\n          found.push(help[mode.name]);\n        }\n        for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n          var cur = help._global[i$1];\n          if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n            { found.push(cur.val); }\n        }\n        return found\n      },\n\n      getStateAfter: function(line, precise) {\n        var doc = this.doc;\n        line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n        return getContextBefore(this, line + 1, precise).state\n      },\n\n      cursorCoords: function(start, mode) {\n        var pos, range$$1 = this.doc.sel.primary();\n        if (start == null) { pos = range$$1.head; }\n        else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n        else { pos = start ? range$$1.from() : range$$1.to(); }\n        return cursorCoords(this, pos, mode || \"page\")\n      },\n\n      charCoords: function(pos, mode) {\n        return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n      },\n\n      coordsChar: function(coords, mode) {\n        coords = fromCoordSystem(this, coords, mode || \"page\");\n        return coordsChar(this, coords.left, coords.top)\n      },\n\n      lineAtHeight: function(height, mode) {\n        height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n        return lineAtHeight(this.doc, height + this.display.viewOffset)\n      },\n      heightAtLine: function(line, mode, includeWidgets) {\n        var end = false, lineObj;\n        if (typeof line == \"number\") {\n          var last = this.doc.first + this.doc.size - 1;\n          if (line < this.doc.first) { line = this.doc.first; }\n          else if (line > last) { line = last; end = true; }\n          lineObj = getLine(this.doc, line);\n        } else {\n          lineObj = line;\n        }\n        return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n          (end ? this.doc.height - heightAtLine(lineObj) : 0)\n      },\n\n      defaultTextHeight: function() { return textHeight(this.display) },\n      defaultCharWidth: function() { return charWidth(this.display) },\n\n      getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n      addWidget: function(pos, node, scroll, vert, horiz) {\n        var display = this.display;\n        pos = cursorCoords(this, clipPos(this.doc, pos));\n        var top = pos.bottom, left = pos.left;\n        node.style.position = \"absolute\";\n        node.setAttribute(\"cm-ignore-events\", \"true\");\n        this.display.input.setUneditable(node);\n        display.sizer.appendChild(node);\n        if (vert == \"over\") {\n          top = pos.top;\n        } else if (vert == \"above\" || vert == \"near\") {\n          var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n          hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n          // Default to positioning above (if specified and possible); otherwise default to positioning below\n          if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n            { top = pos.top - node.offsetHeight; }\n          else if (pos.bottom + node.offsetHeight <= vspace)\n            { top = pos.bottom; }\n          if (left + node.offsetWidth > hspace)\n            { left = hspace - node.offsetWidth; }\n        }\n        node.style.top = top + \"px\";\n        node.style.left = node.style.right = \"\";\n        if (horiz == \"right\") {\n          left = display.sizer.clientWidth - node.offsetWidth;\n          node.style.right = \"0px\";\n        } else {\n          if (horiz == \"left\") { left = 0; }\n          else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n          node.style.left = left + \"px\";\n        }\n        if (scroll)\n          { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n      },\n\n      triggerOnKeyDown: methodOp(onKeyDown),\n      triggerOnKeyPress: methodOp(onKeyPress),\n      triggerOnKeyUp: onKeyUp,\n      triggerOnMouseDown: methodOp(onMouseDown),\n\n      execCommand: function(cmd) {\n        if (commands.hasOwnProperty(cmd))\n          { return commands[cmd].call(null, this) }\n      },\n\n      triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n      findPosH: function(from, amount, unit, visually) {\n        var this$1 = this;\n\n        var dir = 1;\n        if (amount < 0) { dir = -1; amount = -amount; }\n        var cur = clipPos(this.doc, from);\n        for (var i = 0; i < amount; ++i) {\n          cur = findPosH(this$1.doc, cur, dir, unit, visually);\n          if (cur.hitSide) { break }\n        }\n        return cur\n      },\n\n      moveH: methodOp(function(dir, unit) {\n        var this$1 = this;\n\n        this.extendSelectionsBy(function (range$$1) {\n          if (this$1.display.shift || this$1.doc.extend || range$$1.empty())\n            { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) }\n          else\n            { return dir < 0 ? range$$1.from() : range$$1.to() }\n        }, sel_move);\n      }),\n\n      deleteH: methodOp(function(dir, unit) {\n        var sel = this.doc.sel, doc = this.doc;\n        if (sel.somethingSelected())\n          { doc.replaceSelection(\"\", null, \"+delete\"); }\n        else\n          { deleteNearSelection(this, function (range$$1) {\n            var other = findPosH(doc, range$$1.head, dir, unit, false);\n            return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other}\n          }); }\n      }),\n\n      findPosV: function(from, amount, unit, goalColumn) {\n        var this$1 = this;\n\n        var dir = 1, x = goalColumn;\n        if (amount < 0) { dir = -1; amount = -amount; }\n        var cur = clipPos(this.doc, from);\n        for (var i = 0; i < amount; ++i) {\n          var coords = cursorCoords(this$1, cur, \"div\");\n          if (x == null) { x = coords.left; }\n          else { coords.left = x; }\n          cur = findPosV(this$1, coords, dir, unit);\n          if (cur.hitSide) { break }\n        }\n        return cur\n      },\n\n      moveV: methodOp(function(dir, unit) {\n        var this$1 = this;\n\n        var doc = this.doc, goals = [];\n        var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n        doc.extendSelectionsBy(function (range$$1) {\n          if (collapse)\n            { return dir < 0 ? range$$1.from() : range$$1.to() }\n          var headPos = cursorCoords(this$1, range$$1.head, \"div\");\n          if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; }\n          goals.push(headPos.left);\n          var pos = findPosV(this$1, headPos, dir, unit);\n          if (unit == \"page\" && range$$1 == doc.sel.primary())\n            { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n          return pos\n        }, sel_move);\n        if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n          { doc.sel.ranges[i].goalColumn = goals[i]; } }\n      }),\n\n      // Find the word at the given position (as returned by coordsChar).\n      findWordAt: function(pos) {\n        var doc = this.doc, line = getLine(doc, pos.line).text;\n        var start = pos.ch, end = pos.ch;\n        if (line) {\n          var helper = this.getHelper(pos, \"wordChars\");\n          if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n          var startChar = line.charAt(start);\n          var check = isWordChar(startChar, helper)\n            ? function (ch) { return isWordChar(ch, helper); }\n            : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n            : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n          while (start > 0 && check(line.charAt(start - 1))) { --start; }\n          while (end < line.length && check(line.charAt(end))) { ++end; }\n        }\n        return new Range(Pos(pos.line, start), Pos(pos.line, end))\n      },\n\n      toggleOverwrite: function(value) {\n        if (value != null && value == this.state.overwrite) { return }\n        if (this.state.overwrite = !this.state.overwrite)\n          { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n        else\n          { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n        signal(this, \"overwriteToggle\", this, this.state.overwrite);\n      },\n      hasFocus: function() { return this.display.input.getField() == activeElt() },\n      isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n      scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n      getScrollInfo: function() {\n        var scroller = this.display.scroller;\n        return {left: scroller.scrollLeft, top: scroller.scrollTop,\n                height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n                width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n                clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n      },\n\n      scrollIntoView: methodOp(function(range$$1, margin) {\n        if (range$$1 == null) {\n          range$$1 = {from: this.doc.sel.primary().head, to: null};\n          if (margin == null) { margin = this.options.cursorScrollMargin; }\n        } else if (typeof range$$1 == \"number\") {\n          range$$1 = {from: Pos(range$$1, 0), to: null};\n        } else if (range$$1.from == null) {\n          range$$1 = {from: range$$1, to: null};\n        }\n        if (!range$$1.to) { range$$1.to = range$$1.from; }\n        range$$1.margin = margin || 0;\n\n        if (range$$1.from.line != null) {\n          scrollToRange(this, range$$1);\n        } else {\n          scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);\n        }\n      }),\n\n      setSize: methodOp(function(width, height) {\n        var this$1 = this;\n\n        var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n        if (width != null) { this.display.wrapper.style.width = interpret(width); }\n        if (height != null) { this.display.wrapper.style.height = interpret(height); }\n        if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n        var lineNo$$1 = this.display.viewFrom;\n        this.doc.iter(lineNo$$1, this.display.viewTo, function (line) {\n          if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n            { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, \"widget\"); break } } }\n          ++lineNo$$1;\n        });\n        this.curOp.forceUpdate = true;\n        signal(this, \"refresh\", this);\n      }),\n\n      operation: function(f){return runInOp(this, f)},\n      startOperation: function(){return startOperation(this)},\n      endOperation: function(){return endOperation(this)},\n\n      refresh: methodOp(function() {\n        var oldHeight = this.display.cachedTextHeight;\n        regChange(this);\n        this.curOp.forceUpdate = true;\n        clearCaches(this);\n        scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n        updateGutterSpace(this.display);\n        if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n          { estimateLineHeights(this); }\n        signal(this, \"refresh\", this);\n      }),\n\n      swapDoc: methodOp(function(doc) {\n        var old = this.doc;\n        old.cm = null;\n        // Cancel the current text selection if any (#5821)\n        if (this.state.selectingText) { this.state.selectingText(); }\n        attachDoc(this, doc);\n        clearCaches(this);\n        this.display.input.reset();\n        scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n        this.curOp.forceScroll = true;\n        signalLater(this, \"swapDoc\", this, old);\n        return old\n      }),\n\n      phrase: function(phraseText) {\n        var phrases = this.options.phrases;\n        return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n      },\n\n      getInputField: function(){return this.display.input.getField()},\n      getWrapperElement: function(){return this.display.wrapper},\n      getScrollerElement: function(){return this.display.scroller},\n      getGutterElement: function(){return this.display.gutters}\n    };\n    eventMixin(CodeMirror);\n\n    CodeMirror.registerHelper = function(type, name, value) {\n      if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n      helpers[type][name] = value;\n    };\n    CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n      CodeMirror.registerHelper(type, name, value);\n      helpers[type]._global.push({pred: predicate, val: value});\n    };\n  }\n\n  // Used for horizontal relative motion. Dir is -1 or 1 (left or\n  // right), unit can be \"char\", \"column\" (like char, but doesn't\n  // cross line boundaries), \"word\" (across next word), or \"group\" (to\n  // the start of next group of word or non-word-non-whitespace\n  // chars). The visually param controls whether, in right-to-left\n  // text, direction 1 means to move towards the next index in the\n  // string, or towards the character to the right of the current\n  // position. The resulting position will have a hitSide=true\n  // property if it reached the end of the document.\n  function findPosH(doc, pos, dir, unit, visually) {\n    var oldPos = pos;\n    var origDir = dir;\n    var lineObj = getLine(doc, pos.line);\n    function findNextLine() {\n      var l = pos.line + dir;\n      if (l < doc.first || l >= doc.first + doc.size) { return false }\n      pos = new Pos(l, pos.ch, pos.sticky);\n      return lineObj = getLine(doc, l)\n    }\n    function moveOnce(boundToLine) {\n      var next;\n      if (visually) {\n        next = moveVisually(doc.cm, lineObj, pos, dir);\n      } else {\n        next = moveLogically(lineObj, pos, dir);\n      }\n      if (next == null) {\n        if (!boundToLine && findNextLine())\n          { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir); }\n        else\n          { return false }\n      } else {\n        pos = next;\n      }\n      return true\n    }\n\n    if (unit == \"char\") {\n      moveOnce();\n    } else if (unit == \"column\") {\n      moveOnce(true);\n    } else if (unit == \"word\" || unit == \"group\") {\n      var sawType = null, group = unit == \"group\";\n      var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n      for (var first = true;; first = false) {\n        if (dir < 0 && !moveOnce(!first)) { break }\n        var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n        var type = isWordChar(cur, helper) ? \"w\"\n          : group && cur == \"\\n\" ? \"n\"\n          : !group || /\\s/.test(cur) ? null\n          : \"p\";\n        if (group && !first && !type) { type = \"s\"; }\n        if (sawType && sawType != type) {\n          if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n          break\n        }\n\n        if (type) { sawType = type; }\n        if (dir > 0 && !moveOnce(!first)) { break }\n      }\n    }\n    var result = skipAtomic(doc, pos, oldPos, origDir, true);\n    if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n    return result\n  }\n\n  // For relative vertical movement. Dir may be -1 or 1. Unit can be\n  // \"page\" or \"line\". The resulting position will have a hitSide=true\n  // property if it reached the end of the document.\n  function findPosV(cm, pos, dir, unit) {\n    var doc = cm.doc, x = pos.left, y;\n    if (unit == \"page\") {\n      var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);\n      var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n      y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n    } else if (unit == \"line\") {\n      y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n    }\n    var target;\n    for (;;) {\n      target = coordsChar(cm, x, y);\n      if (!target.outside) { break }\n      if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n      y += dir * 5;\n    }\n    return target\n  }\n\n  // CONTENTEDITABLE INPUT STYLE\n\n  var ContentEditableInput = function(cm) {\n    this.cm = cm;\n    this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n    this.polling = new Delayed();\n    this.composing = null;\n    this.gracePeriod = false;\n    this.readDOMTimeout = null;\n  };\n\n  ContentEditableInput.prototype.init = function (display) {\n      var this$1 = this;\n\n    var input = this, cm = input.cm;\n    var div = input.div = display.lineDiv;\n    disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n    on(div, \"paste\", function (e) {\n      if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n      // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n      if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n    });\n\n    on(div, \"compositionstart\", function (e) {\n      this$1.composing = {data: e.data, done: false};\n    });\n    on(div, \"compositionupdate\", function (e) {\n      if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n    });\n    on(div, \"compositionend\", function (e) {\n      if (this$1.composing) {\n        if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n        this$1.composing.done = true;\n      }\n    });\n\n    on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n    on(div, \"input\", function () {\n      if (!this$1.composing) { this$1.readFromDOMSoon(); }\n    });\n\n    function onCopyCut(e) {\n      if (signalDOMEvent(cm, e)) { return }\n      if (cm.somethingSelected()) {\n        setLastCopied({lineWise: false, text: cm.getSelections()});\n        if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n      } else if (!cm.options.lineWiseCopyCut) {\n        return\n      } else {\n        var ranges = copyableRanges(cm);\n        setLastCopied({lineWise: true, text: ranges.text});\n        if (e.type == \"cut\") {\n          cm.operation(function () {\n            cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n            cm.replaceSelection(\"\", null, \"cut\");\n          });\n        }\n      }\n      if (e.clipboardData) {\n        e.clipboardData.clearData();\n        var content = lastCopied.text.join(\"\\n\");\n        // iOS exposes the clipboard API, but seems to discard content inserted into it\n        e.clipboardData.setData(\"Text\", content);\n        if (e.clipboardData.getData(\"Text\") == content) {\n          e.preventDefault();\n          return\n        }\n      }\n      // Old-fashioned briefly-focus-a-textarea hack\n      var kludge = hiddenTextarea(), te = kludge.firstChild;\n      cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n      te.value = lastCopied.text.join(\"\\n\");\n      var hadFocus = document.activeElement;\n      selectInput(te);\n      setTimeout(function () {\n        cm.display.lineSpace.removeChild(kludge);\n        hadFocus.focus();\n        if (hadFocus == div) { input.showPrimarySelection(); }\n      }, 50);\n    }\n    on(div, \"copy\", onCopyCut);\n    on(div, \"cut\", onCopyCut);\n  };\n\n  ContentEditableInput.prototype.prepareSelection = function () {\n    var result = prepareSelection(this.cm, false);\n    result.focus = this.cm.state.focused;\n    return result\n  };\n\n  ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n    if (!info || !this.cm.display.view.length) { return }\n    if (info.focus || takeFocus) { this.showPrimarySelection(); }\n    this.showMultipleSelections(info);\n  };\n\n  ContentEditableInput.prototype.getSelection = function () {\n    return this.cm.display.wrapper.ownerDocument.getSelection()\n  };\n\n  ContentEditableInput.prototype.showPrimarySelection = function () {\n    var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n    var from = prim.from(), to = prim.to();\n\n    if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n      sel.removeAllRanges();\n      return\n    }\n\n    var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n    var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n    if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n        cmp(minPos(curAnchor, curFocus), from) == 0 &&\n        cmp(maxPos(curAnchor, curFocus), to) == 0)\n      { return }\n\n    var view = cm.display.view;\n    var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n        {node: view[0].measure.map[2], offset: 0};\n    var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n    if (!end) {\n      var measure = view[view.length - 1].measure;\n      var map$$1 = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n      end = {node: map$$1[map$$1.length - 1], offset: map$$1[map$$1.length - 2] - map$$1[map$$1.length - 3]};\n    }\n\n    if (!start || !end) {\n      sel.removeAllRanges();\n      return\n    }\n\n    var old = sel.rangeCount && sel.getRangeAt(0), rng;\n    try { rng = range(start.node, start.offset, end.offset, end.node); }\n    catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n    if (rng) {\n      if (!gecko && cm.state.focused) {\n        sel.collapse(start.node, start.offset);\n        if (!rng.collapsed) {\n          sel.removeAllRanges();\n          sel.addRange(rng);\n        }\n      } else {\n        sel.removeAllRanges();\n        sel.addRange(rng);\n      }\n      if (old && sel.anchorNode == null) { sel.addRange(old); }\n      else if (gecko) { this.startGracePeriod(); }\n    }\n    this.rememberSelection();\n  };\n\n  ContentEditableInput.prototype.startGracePeriod = function () {\n      var this$1 = this;\n\n    clearTimeout(this.gracePeriod);\n    this.gracePeriod = setTimeout(function () {\n      this$1.gracePeriod = false;\n      if (this$1.selectionChanged())\n        { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n    }, 20);\n  };\n\n  ContentEditableInput.prototype.showMultipleSelections = function (info) {\n    removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n    removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n  };\n\n  ContentEditableInput.prototype.rememberSelection = function () {\n    var sel = this.getSelection();\n    this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n    this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n  };\n\n  ContentEditableInput.prototype.selectionInEditor = function () {\n    var sel = this.getSelection();\n    if (!sel.rangeCount) { return false }\n    var node = sel.getRangeAt(0).commonAncestorContainer;\n    return contains(this.div, node)\n  };\n\n  ContentEditableInput.prototype.focus = function () {\n    if (this.cm.options.readOnly != \"nocursor\") {\n      if (!this.selectionInEditor())\n        { this.showSelection(this.prepareSelection(), true); }\n      this.div.focus();\n    }\n  };\n  ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n  ContentEditableInput.prototype.getField = function () { return this.div };\n\n  ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n  ContentEditableInput.prototype.receivedFocus = function () {\n    var input = this;\n    if (this.selectionInEditor())\n      { this.pollSelection(); }\n    else\n      { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n    function poll() {\n      if (input.cm.state.focused) {\n        input.pollSelection();\n        input.polling.set(input.cm.options.pollInterval, poll);\n      }\n    }\n    this.polling.set(this.cm.options.pollInterval, poll);\n  };\n\n  ContentEditableInput.prototype.selectionChanged = function () {\n    var sel = this.getSelection();\n    return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n      sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n  };\n\n  ContentEditableInput.prototype.pollSelection = function () {\n    if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n    var sel = this.getSelection(), cm = this.cm;\n    // On Android Chrome (version 56, at least), backspacing into an\n    // uneditable block element will put the cursor in that element,\n    // and then, because it's not editable, hide the virtual keyboard.\n    // Because Android doesn't allow us to actually detect backspace\n    // presses in a sane way, this code checks for when that happens\n    // and simulates a backspace press in this case.\n    if (android && chrome && this.cm.display.gutterSpecs.length && isInGutter(sel.anchorNode)) {\n      this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n      this.blur();\n      this.focus();\n      return\n    }\n    if (this.composing) { return }\n    this.rememberSelection();\n    var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n    var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n    if (anchor && head) { runInOp(cm, function () {\n      setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n      if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n    }); }\n  };\n\n  ContentEditableInput.prototype.pollContent = function () {\n    if (this.readDOMTimeout != null) {\n      clearTimeout(this.readDOMTimeout);\n      this.readDOMTimeout = null;\n    }\n\n    var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n    var from = sel.from(), to = sel.to();\n    if (from.ch == 0 && from.line > cm.firstLine())\n      { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n    if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n      { to = Pos(to.line + 1, 0); }\n    if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n    var fromIndex, fromLine, fromNode;\n    if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n      fromLine = lineNo(display.view[0].line);\n      fromNode = display.view[0].node;\n    } else {\n      fromLine = lineNo(display.view[fromIndex].line);\n      fromNode = display.view[fromIndex - 1].node.nextSibling;\n    }\n    var toIndex = findViewIndex(cm, to.line);\n    var toLine, toNode;\n    if (toIndex == display.view.length - 1) {\n      toLine = display.viewTo - 1;\n      toNode = display.lineDiv.lastChild;\n    } else {\n      toLine = lineNo(display.view[toIndex + 1].line) - 1;\n      toNode = display.view[toIndex + 1].node.previousSibling;\n    }\n\n    if (!fromNode) { return false }\n    var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n    var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n    while (newText.length > 1 && oldText.length > 1) {\n      if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n      else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n      else { break }\n    }\n\n    var cutFront = 0, cutEnd = 0;\n    var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n    while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n      { ++cutFront; }\n    var newBot = lst(newText), oldBot = lst(oldText);\n    var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n                             oldBot.length - (oldText.length == 1 ? cutFront : 0));\n    while (cutEnd < maxCutEnd &&\n           newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n      { ++cutEnd; }\n    // Try to move start of change to start of selection if ambiguous\n    if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n      while (cutFront && cutFront > from.ch &&\n             newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n        cutFront--;\n        cutEnd++;\n      }\n    }\n\n    newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n    newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n    var chFrom = Pos(fromLine, cutFront);\n    var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n    if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n      replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n      return true\n    }\n  };\n\n  ContentEditableInput.prototype.ensurePolled = function () {\n    this.forceCompositionEnd();\n  };\n  ContentEditableInput.prototype.reset = function () {\n    this.forceCompositionEnd();\n  };\n  ContentEditableInput.prototype.forceCompositionEnd = function () {\n    if (!this.composing) { return }\n    clearTimeout(this.readDOMTimeout);\n    this.composing = null;\n    this.updateFromDOM();\n    this.div.blur();\n    this.div.focus();\n  };\n  ContentEditableInput.prototype.readFromDOMSoon = function () {\n      var this$1 = this;\n\n    if (this.readDOMTimeout != null) { return }\n    this.readDOMTimeout = setTimeout(function () {\n      this$1.readDOMTimeout = null;\n      if (this$1.composing) {\n        if (this$1.composing.done) { this$1.composing = null; }\n        else { return }\n      }\n      this$1.updateFromDOM();\n    }, 80);\n  };\n\n  ContentEditableInput.prototype.updateFromDOM = function () {\n      var this$1 = this;\n\n    if (this.cm.isReadOnly() || !this.pollContent())\n      { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n  };\n\n  ContentEditableInput.prototype.setUneditable = function (node) {\n    node.contentEditable = \"false\";\n  };\n\n  ContentEditableInput.prototype.onKeyPress = function (e) {\n    if (e.charCode == 0 || this.composing) { return }\n    e.preventDefault();\n    if (!this.cm.isReadOnly())\n      { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n  };\n\n  ContentEditableInput.prototype.readOnlyChanged = function (val) {\n    this.div.contentEditable = String(val != \"nocursor\");\n  };\n\n  ContentEditableInput.prototype.onContextMenu = function () {};\n  ContentEditableInput.prototype.resetPosition = function () {};\n\n  ContentEditableInput.prototype.needsContentAttribute = true;\n\n  function posToDOM(cm, pos) {\n    var view = findViewForLine(cm, pos.line);\n    if (!view || view.hidden) { return null }\n    var line = getLine(cm.doc, pos.line);\n    var info = mapFromLineView(view, line, pos.line);\n\n    var order = getOrder(line, cm.doc.direction), side = \"left\";\n    if (order) {\n      var partPos = getBidiPartAt(order, pos.ch);\n      side = partPos % 2 ? \"right\" : \"left\";\n    }\n    var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n    result.offset = result.collapse == \"right\" ? result.end : result.start;\n    return result\n  }\n\n  function isInGutter(node) {\n    for (var scan = node; scan; scan = scan.parentNode)\n      { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n    return false\n  }\n\n  function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n  function domTextBetween(cm, from, to, fromLine, toLine) {\n    var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n    function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n    function close() {\n      if (closing) {\n        text += lineSep;\n        if (extraLinebreak) { text += lineSep; }\n        closing = extraLinebreak = false;\n      }\n    }\n    function addText(str) {\n      if (str) {\n        close();\n        text += str;\n      }\n    }\n    function walk(node) {\n      if (node.nodeType == 1) {\n        var cmText = node.getAttribute(\"cm-text\");\n        if (cmText) {\n          addText(cmText);\n          return\n        }\n        var markerID = node.getAttribute(\"cm-marker\"), range$$1;\n        if (markerID) {\n          var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n          if (found.length && (range$$1 = found[0].find(0)))\n            { addText(getBetween(cm.doc, range$$1.from, range$$1.to).join(lineSep)); }\n          return\n        }\n        if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n        var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n        if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n        if (isBlock) { close(); }\n        for (var i = 0; i < node.childNodes.length; i++)\n          { walk(node.childNodes[i]); }\n\n        if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n        if (isBlock) { closing = true; }\n      } else if (node.nodeType == 3) {\n        addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n      }\n    }\n    for (;;) {\n      walk(from);\n      if (from == to) { break }\n      from = from.nextSibling;\n      extraLinebreak = false;\n    }\n    return text\n  }\n\n  function domToPos(cm, node, offset) {\n    var lineNode;\n    if (node == cm.display.lineDiv) {\n      lineNode = cm.display.lineDiv.childNodes[offset];\n      if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n      node = null; offset = 0;\n    } else {\n      for (lineNode = node;; lineNode = lineNode.parentNode) {\n        if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n        if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n      }\n    }\n    for (var i = 0; i < cm.display.view.length; i++) {\n      var lineView = cm.display.view[i];\n      if (lineView.node == lineNode)\n        { return locateNodeInLineView(lineView, node, offset) }\n    }\n  }\n\n  function locateNodeInLineView(lineView, node, offset) {\n    var wrapper = lineView.text.firstChild, bad = false;\n    if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n    if (node == wrapper) {\n      bad = true;\n      node = wrapper.childNodes[offset];\n      offset = 0;\n      if (!node) {\n        var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n        return badPos(Pos(lineNo(line), line.text.length), bad)\n      }\n    }\n\n    var textNode = node.nodeType == 3 ? node : null, topNode = node;\n    if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n      textNode = node.firstChild;\n      if (offset) { offset = textNode.nodeValue.length; }\n    }\n    while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n    var measure = lineView.measure, maps = measure.maps;\n\n    function find(textNode, topNode, offset) {\n      for (var i = -1; i < (maps ? maps.length : 0); i++) {\n        var map$$1 = i < 0 ? measure.map : maps[i];\n        for (var j = 0; j < map$$1.length; j += 3) {\n          var curNode = map$$1[j + 2];\n          if (curNode == textNode || curNode == topNode) {\n            var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n            var ch = map$$1[j] + offset;\n            if (offset < 0 || curNode != textNode) { ch = map$$1[j + (offset ? 1 : 0)]; }\n            return Pos(line, ch)\n          }\n        }\n      }\n    }\n    var found = find(textNode, topNode, offset);\n    if (found) { return badPos(found, bad) }\n\n    // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n    for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n      found = find(after, after.firstChild, 0);\n      if (found)\n        { return badPos(Pos(found.line, found.ch - dist), bad) }\n      else\n        { dist += after.textContent.length; }\n    }\n    for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n      found = find(before, before.firstChild, -1);\n      if (found)\n        { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n      else\n        { dist$1 += before.textContent.length; }\n    }\n  }\n\n  // TEXTAREA INPUT STYLE\n\n  var TextareaInput = function(cm) {\n    this.cm = cm;\n    // See input.poll and input.reset\n    this.prevInput = \"\";\n\n    // Flag that indicates whether we expect input to appear real soon\n    // now (after some event like 'keypress' or 'input') and are\n    // polling intensively.\n    this.pollingFast = false;\n    // Self-resetting timeout for the poller\n    this.polling = new Delayed();\n    // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n    this.hasSelection = false;\n    this.composing = null;\n  };\n\n  TextareaInput.prototype.init = function (display) {\n      var this$1 = this;\n\n    var input = this, cm = this.cm;\n    this.createField(display);\n    var te = this.textarea;\n\n    display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n    // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n    if (ios) { te.style.width = \"0px\"; }\n\n    on(te, \"input\", function () {\n      if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n      input.poll();\n    });\n\n    on(te, \"paste\", function (e) {\n      if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n      cm.state.pasteIncoming = +new Date;\n      input.fastPoll();\n    });\n\n    function prepareCopyCut(e) {\n      if (signalDOMEvent(cm, e)) { return }\n      if (cm.somethingSelected()) {\n        setLastCopied({lineWise: false, text: cm.getSelections()});\n      } else if (!cm.options.lineWiseCopyCut) {\n        return\n      } else {\n        var ranges = copyableRanges(cm);\n        setLastCopied({lineWise: true, text: ranges.text});\n        if (e.type == \"cut\") {\n          cm.setSelections(ranges.ranges, null, sel_dontScroll);\n        } else {\n          input.prevInput = \"\";\n          te.value = ranges.text.join(\"\\n\");\n          selectInput(te);\n        }\n      }\n      if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n    }\n    on(te, \"cut\", prepareCopyCut);\n    on(te, \"copy\", prepareCopyCut);\n\n    on(display.scroller, \"paste\", function (e) {\n      if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n      if (!te.dispatchEvent) {\n        cm.state.pasteIncoming = +new Date;\n        input.focus();\n        return\n      }\n\n      // Pass the `paste` event to the textarea so it's handled by its event listener.\n      var event = new Event(\"paste\");\n      event.clipboardData = e.clipboardData;\n      te.dispatchEvent(event);\n    });\n\n    // Prevent normal selection in the editor (we handle our own)\n    on(display.lineSpace, \"selectstart\", function (e) {\n      if (!eventInWidget(display, e)) { e_preventDefault(e); }\n    });\n\n    on(te, \"compositionstart\", function () {\n      var start = cm.getCursor(\"from\");\n      if (input.composing) { input.composing.range.clear(); }\n      input.composing = {\n        start: start,\n        range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n      };\n    });\n    on(te, \"compositionend\", function () {\n      if (input.composing) {\n        input.poll();\n        input.composing.range.clear();\n        input.composing = null;\n      }\n    });\n  };\n\n  TextareaInput.prototype.createField = function (_display) {\n    // Wraps and hides input textarea\n    this.wrapper = hiddenTextarea();\n    // The semihidden textarea that is focused when the editor is\n    // focused, and receives input.\n    this.textarea = this.wrapper.firstChild;\n  };\n\n  TextareaInput.prototype.prepareSelection = function () {\n    // Redraw the selection and/or cursor\n    var cm = this.cm, display = cm.display, doc = cm.doc;\n    var result = prepareSelection(cm);\n\n    // Move the hidden textarea near the cursor to prevent scrolling artifacts\n    if (cm.options.moveInputWithCursor) {\n      var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n      var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n      result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n                                          headPos.top + lineOff.top - wrapOff.top));\n      result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n                                           headPos.left + lineOff.left - wrapOff.left));\n    }\n\n    return result\n  };\n\n  TextareaInput.prototype.showSelection = function (drawn) {\n    var cm = this.cm, display = cm.display;\n    removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n    removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n    if (drawn.teTop != null) {\n      this.wrapper.style.top = drawn.teTop + \"px\";\n      this.wrapper.style.left = drawn.teLeft + \"px\";\n    }\n  };\n\n  // Reset the input to correspond to the selection (or to be empty,\n  // when not typing and nothing is selected)\n  TextareaInput.prototype.reset = function (typing) {\n    if (this.contextMenuPending || this.composing) { return }\n    var cm = this.cm;\n    if (cm.somethingSelected()) {\n      this.prevInput = \"\";\n      var content = cm.getSelection();\n      this.textarea.value = content;\n      if (cm.state.focused) { selectInput(this.textarea); }\n      if (ie && ie_version >= 9) { this.hasSelection = content; }\n    } else if (!typing) {\n      this.prevInput = this.textarea.value = \"\";\n      if (ie && ie_version >= 9) { this.hasSelection = null; }\n    }\n  };\n\n  TextareaInput.prototype.getField = function () { return this.textarea };\n\n  TextareaInput.prototype.supportsTouch = function () { return false };\n\n  TextareaInput.prototype.focus = function () {\n    if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt() != this.textarea)) {\n      try { this.textarea.focus(); }\n      catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n    }\n  };\n\n  TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n  TextareaInput.prototype.resetPosition = function () {\n    this.wrapper.style.top = this.wrapper.style.left = 0;\n  };\n\n  TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n  // Poll for input changes, using the normal rate of polling. This\n  // runs as long as the editor is focused.\n  TextareaInput.prototype.slowPoll = function () {\n      var this$1 = this;\n\n    if (this.pollingFast) { return }\n    this.polling.set(this.cm.options.pollInterval, function () {\n      this$1.poll();\n      if (this$1.cm.state.focused) { this$1.slowPoll(); }\n    });\n  };\n\n  // When an event has just come in that is likely to add or change\n  // something in the input textarea, we poll faster, to ensure that\n  // the change appears on the screen quickly.\n  TextareaInput.prototype.fastPoll = function () {\n    var missed = false, input = this;\n    input.pollingFast = true;\n    function p() {\n      var changed = input.poll();\n      if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n      else {input.pollingFast = false; input.slowPoll();}\n    }\n    input.polling.set(20, p);\n  };\n\n  // Read input from the textarea, and update the document to match.\n  // When something is selected, it is present in the textarea, and\n  // selected (unless it is huge, in which case a placeholder is\n  // used). When nothing is selected, the cursor sits after previously\n  // seen text (can be empty), which is stored in prevInput (we must\n  // not reset the textarea when typing, because that breaks IME).\n  TextareaInput.prototype.poll = function () {\n      var this$1 = this;\n\n    var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n    // Since this is called a *lot*, try to bail out as cheaply as\n    // possible when it is clear that nothing happened. hasSelection\n    // will be the case when there is a lot of text in the textarea,\n    // in which case reading its value would be expensive.\n    if (this.contextMenuPending || !cm.state.focused ||\n        (hasSelection(input) && !prevInput && !this.composing) ||\n        cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n      { return false }\n\n    var text = input.value;\n    // If nothing changed, bail.\n    if (text == prevInput && !cm.somethingSelected()) { return false }\n    // Work around nonsensical selection resetting in IE9/10, and\n    // inexplicable appearance of private area unicode characters on\n    // some key combos in Mac (#2689).\n    if (ie && ie_version >= 9 && this.hasSelection === text ||\n        mac && /[\\uf700-\\uf7ff]/.test(text)) {\n      cm.display.input.reset();\n      return false\n    }\n\n    if (cm.doc.sel == cm.display.selForContextMenu) {\n      var first = text.charCodeAt(0);\n      if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n      if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n    }\n    // Find the part of the input that is actually new\n    var same = 0, l = Math.min(prevInput.length, text.length);\n    while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n    runInOp(cm, function () {\n      applyTextInput(cm, text.slice(same), prevInput.length - same,\n                     null, this$1.composing ? \"*compose\" : null);\n\n      // Don't leave long text in the textarea, since it makes further polling slow\n      if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n      else { this$1.prevInput = text; }\n\n      if (this$1.composing) {\n        this$1.composing.range.clear();\n        this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n                                           {className: \"CodeMirror-composing\"});\n      }\n    });\n    return true\n  };\n\n  TextareaInput.prototype.ensurePolled = function () {\n    if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n  };\n\n  TextareaInput.prototype.onKeyPress = function () {\n    if (ie && ie_version >= 9) { this.hasSelection = null; }\n    this.fastPoll();\n  };\n\n  TextareaInput.prototype.onContextMenu = function (e) {\n    var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n    if (input.contextMenuPending) { input.contextMenuPending(); }\n    var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n    if (!pos || presto) { return } // Opera is difficult.\n\n    // Reset the current text selection only if the click is done outside of the selection\n    // and 'resetSelectionOnContextMenu' option is true.\n    var reset = cm.options.resetSelectionOnContextMenu;\n    if (reset && cm.doc.sel.contains(pos) == -1)\n      { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n    var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n    var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n    input.wrapper.style.cssText = \"position: static\";\n    te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n      top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n      z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n    var oldScrollY;\n    if (webkit) { oldScrollY = window.scrollY; } // Work around Chrome issue (#2712)\n    display.input.focus();\n    if (webkit) { window.scrollTo(null, oldScrollY); }\n    display.input.reset();\n    // Adds \"Select all\" to context menu in FF\n    if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n    input.contextMenuPending = rehide;\n    display.selForContextMenu = cm.doc.sel;\n    clearTimeout(display.detectingSelectAll);\n\n    // Select-all will be greyed out if there's nothing to select, so\n    // this adds a zero-width space so that we can later check whether\n    // it got selected.\n    function prepareSelectAllHack() {\n      if (te.selectionStart != null) {\n        var selected = cm.somethingSelected();\n        var extval = \"\\u200b\" + (selected ? te.value : \"\");\n        te.value = \"\\u21da\"; // Used to catch context-menu undo\n        te.value = extval;\n        input.prevInput = selected ? \"\" : \"\\u200b\";\n        te.selectionStart = 1; te.selectionEnd = extval.length;\n        // Re-set this, in case some other handler touched the\n        // selection in the meantime.\n        display.selForContextMenu = cm.doc.sel;\n      }\n    }\n    function rehide() {\n      if (input.contextMenuPending != rehide) { return }\n      input.contextMenuPending = false;\n      input.wrapper.style.cssText = oldWrapperCSS;\n      te.style.cssText = oldCSS;\n      if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n      // Try to detect the user choosing select-all\n      if (te.selectionStart != null) {\n        if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n        var i = 0, poll = function () {\n          if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n              te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n            operation(cm, selectAll)(cm);\n          } else if (i++ < 10) {\n            display.detectingSelectAll = setTimeout(poll, 500);\n          } else {\n            display.selForContextMenu = null;\n            display.input.reset();\n          }\n        };\n        display.detectingSelectAll = setTimeout(poll, 200);\n      }\n    }\n\n    if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n    if (captureRightClick) {\n      e_stop(e);\n      var mouseup = function () {\n        off(window, \"mouseup\", mouseup);\n        setTimeout(rehide, 20);\n      };\n      on(window, \"mouseup\", mouseup);\n    } else {\n      setTimeout(rehide, 50);\n    }\n  };\n\n  TextareaInput.prototype.readOnlyChanged = function (val) {\n    if (!val) { this.reset(); }\n    this.textarea.disabled = val == \"nocursor\";\n  };\n\n  TextareaInput.prototype.setUneditable = function () {};\n\n  TextareaInput.prototype.needsContentAttribute = false;\n\n  function fromTextArea(textarea, options) {\n    options = options ? copyObj(options) : {};\n    options.value = textarea.value;\n    if (!options.tabindex && textarea.tabIndex)\n      { options.tabindex = textarea.tabIndex; }\n    if (!options.placeholder && textarea.placeholder)\n      { options.placeholder = textarea.placeholder; }\n    // Set autofocus to true if this textarea is focused, or if it has\n    // autofocus and no other element is focused.\n    if (options.autofocus == null) {\n      var hasFocus = activeElt();\n      options.autofocus = hasFocus == textarea ||\n        textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n    }\n\n    function save() {textarea.value = cm.getValue();}\n\n    var realSubmit;\n    if (textarea.form) {\n      on(textarea.form, \"submit\", save);\n      // Deplorable hack to make the submit method do the right thing.\n      if (!options.leaveSubmitMethodAlone) {\n        var form = textarea.form;\n        realSubmit = form.submit;\n        try {\n          var wrappedSubmit = form.submit = function () {\n            save();\n            form.submit = realSubmit;\n            form.submit();\n            form.submit = wrappedSubmit;\n          };\n        } catch(e) {}\n      }\n    }\n\n    options.finishInit = function (cm) {\n      cm.save = save;\n      cm.getTextArea = function () { return textarea; };\n      cm.toTextArea = function () {\n        cm.toTextArea = isNaN; // Prevent this from being ran twice\n        save();\n        textarea.parentNode.removeChild(cm.getWrapperElement());\n        textarea.style.display = \"\";\n        if (textarea.form) {\n          off(textarea.form, \"submit\", save);\n          if (typeof textarea.form.submit == \"function\")\n            { textarea.form.submit = realSubmit; }\n        }\n      };\n    };\n\n    textarea.style.display = \"none\";\n    var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n      options);\n    return cm\n  }\n\n  function addLegacyProps(CodeMirror) {\n    CodeMirror.off = off;\n    CodeMirror.on = on;\n    CodeMirror.wheelEventPixels = wheelEventPixels;\n    CodeMirror.Doc = Doc;\n    CodeMirror.splitLines = splitLinesAuto;\n    CodeMirror.countColumn = countColumn;\n    CodeMirror.findColumn = findColumn;\n    CodeMirror.isWordChar = isWordCharBasic;\n    CodeMirror.Pass = Pass;\n    CodeMirror.signal = signal;\n    CodeMirror.Line = Line;\n    CodeMirror.changeEnd = changeEnd;\n    CodeMirror.scrollbarModel = scrollbarModel;\n    CodeMirror.Pos = Pos;\n    CodeMirror.cmpPos = cmp;\n    CodeMirror.modes = modes;\n    CodeMirror.mimeModes = mimeModes;\n    CodeMirror.resolveMode = resolveMode;\n    CodeMirror.getMode = getMode;\n    CodeMirror.modeExtensions = modeExtensions;\n    CodeMirror.extendMode = extendMode;\n    CodeMirror.copyState = copyState;\n    CodeMirror.startState = startState;\n    CodeMirror.innerMode = innerMode;\n    CodeMirror.commands = commands;\n    CodeMirror.keyMap = keyMap;\n    CodeMirror.keyName = keyName;\n    CodeMirror.isModifierKey = isModifierKey;\n    CodeMirror.lookupKey = lookupKey;\n    CodeMirror.normalizeKeyMap = normalizeKeyMap;\n    CodeMirror.StringStream = StringStream;\n    CodeMirror.SharedTextMarker = SharedTextMarker;\n    CodeMirror.TextMarker = TextMarker;\n    CodeMirror.LineWidget = LineWidget;\n    CodeMirror.e_preventDefault = e_preventDefault;\n    CodeMirror.e_stopPropagation = e_stopPropagation;\n    CodeMirror.e_stop = e_stop;\n    CodeMirror.addClass = addClass;\n    CodeMirror.contains = contains;\n    CodeMirror.rmClass = rmClass;\n    CodeMirror.keyNames = keyNames;\n  }\n\n  // EDITOR CONSTRUCTOR\n\n  defineOptions(CodeMirror);\n\n  addEditorMethods(CodeMirror);\n\n  // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n  var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n  for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n    { CodeMirror.prototype[prop] = (function(method) {\n      return function() {return method.apply(this.doc, arguments)}\n    })(Doc.prototype[prop]); } }\n\n  eventMixin(Doc);\n  CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n  // Extra arguments are stored as the mode's dependencies, which is\n  // used by (legacy) mechanisms like loadmode.js to automatically\n  // load a mode. (Preferred mechanism is the require/define calls.)\n  CodeMirror.defineMode = function(name/*, mode, …*/) {\n    if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n    defineMode.apply(this, arguments);\n  };\n\n  CodeMirror.defineMIME = defineMIME;\n\n  // Minimal default mode.\n  CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n  CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n  // EXTENSIONS\n\n  CodeMirror.defineExtension = function (name, func) {\n    CodeMirror.prototype[name] = func;\n  };\n  CodeMirror.defineDocExtension = function (name, func) {\n    Doc.prototype[name] = func;\n  };\n\n  CodeMirror.fromTextArea = fromTextArea;\n\n  addLegacyProps(CodeMirror);\n\n  CodeMirror.version = \"5.48.0\";\n\n  return CodeMirror;\n\n})));\n"
  },
  {
    "path": "libs/codemirror/diff.js",
    "content": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n  if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n    mod(require(\"../../lib/codemirror\"));\n  else if (typeof define == \"function\" && define.amd) // AMD\n    define([\"../../lib/codemirror\"], mod);\n  else // Plain browser env\n    mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"diff\", function() {\n\n  var TOKEN_NAMES = {\n    '+': 'positive',\n    '-': 'negative',\n    '@': 'meta'\n  };\n\n  return {\n    token: function(stream) {\n      var tw_pos = stream.string.search(/[\\t ]+?$/);\n\n      if (!stream.sol() || tw_pos === 0) {\n        stream.skipToEnd();\n        return (\"error \" + (\n          TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, '');\n      }\n\n      var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd();\n\n      if (tw_pos === -1) {\n        stream.skipToEnd();\n      } else {\n        stream.pos = tw_pos;\n      }\n\n      return token_name;\n    }\n  };\n});\n\nCodeMirror.defineMIME(\"text/x-diff\", \"diff\");\n\n});\n"
  },
  {
    "path": "libs/codemirror/django.js",
    "content": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n  if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n    mod(require(\"../../lib/codemirror\"), require(\"../htmlmixed/htmlmixed\"),\n        require(\"../../addon/mode/overlay\"));\n  else if (typeof define == \"function\" && define.amd) // AMD\n    define([\"../../lib/codemirror\", \"../htmlmixed/htmlmixed\",\n            \"../../addon/mode/overlay\"], mod);\n  else // Plain browser env\n    mod(CodeMirror);\n})(function(CodeMirror) {\n  \"use strict\";\n\n  CodeMirror.defineMode(\"django:inner\", function() {\n    var keywords = [\"block\", \"endblock\", \"for\", \"endfor\", \"true\", \"false\", \"filter\", \"endfilter\",\n                    \"loop\", \"none\", \"self\", \"super\", \"if\", \"elif\", \"endif\", \"as\", \"else\", \"import\",\n                    \"with\", \"endwith\", \"without\", \"context\", \"ifequal\", \"endifequal\", \"ifnotequal\",\n                    \"endifnotequal\", \"extends\", \"include\", \"load\", \"comment\", \"endcomment\",\n                    \"empty\", \"url\", \"static\", \"trans\", \"blocktrans\", \"endblocktrans\", \"now\",\n                    \"regroup\", \"lorem\", \"ifchanged\", \"endifchanged\", \"firstof\", \"debug\", \"cycle\",\n                    \"csrf_token\", \"autoescape\", \"endautoescape\", \"spaceless\", \"endspaceless\",\n                    \"ssi\", \"templatetag\", \"verbatim\", \"endverbatim\", \"widthratio\"],\n        filters = [\"add\", \"addslashes\", \"capfirst\", \"center\", \"cut\", \"date\",\n                   \"default\", \"default_if_none\", \"dictsort\",\n                   \"dictsortreversed\", \"divisibleby\", \"escape\", \"escapejs\",\n                   \"filesizeformat\", \"first\", \"floatformat\", \"force_escape\",\n                   \"get_digit\", \"iriencode\", \"join\", \"last\", \"length\",\n                   \"length_is\", \"linebreaks\", \"linebreaksbr\", \"linenumbers\",\n                   \"ljust\", \"lower\", \"make_list\", \"phone2numeric\", \"pluralize\",\n                   \"pprint\", \"random\", \"removetags\", \"rjust\", \"safe\",\n                   \"safeseq\", \"slice\", \"slugify\", \"stringformat\", \"striptags\",\n                   \"time\", \"timesince\", \"timeuntil\", \"title\", \"truncatechars\",\n                   \"truncatechars_html\", \"truncatewords\", \"truncatewords_html\",\n                   \"unordered_list\", \"upper\", \"urlencode\", \"urlize\",\n                   \"urlizetrunc\", \"wordcount\", \"wordwrap\", \"yesno\"],\n        operators = [\"==\", \"!=\", \"<\", \">\", \"<=\", \">=\"],\n        wordOperators = [\"in\", \"not\", \"or\", \"and\"];\n\n    keywords = new RegExp(\"^\\\\b(\" + keywords.join(\"|\") + \")\\\\b\");\n    filters = new RegExp(\"^\\\\b(\" + filters.join(\"|\") + \")\\\\b\");\n    operators = new RegExp(\"^\\\\b(\" + operators.join(\"|\") + \")\\\\b\");\n    wordOperators = new RegExp(\"^\\\\b(\" + wordOperators.join(\"|\") + \")\\\\b\");\n\n    // We have to return \"null\" instead of null, in order to avoid string\n    // styling as the default, when using Django templates inside HTML\n    // element attributes\n    function tokenBase (stream, state) {\n      // Attempt to identify a variable, template or comment tag respectively\n      if (stream.match(\"{{\")) {\n        state.tokenize = inVariable;\n        return \"tag\";\n      } else if (stream.match(\"{%\")) {\n        state.tokenize = inTag;\n        return \"tag\";\n      } else if (stream.match(\"{#\")) {\n        state.tokenize = inComment;\n        return \"comment\";\n      }\n\n      // Ignore completely any stream series that do not match the\n      // Django template opening tags.\n      while (stream.next() != null && !stream.match(/\\{[{%#]/, false)) {}\n      return null;\n    }\n\n    // A string can be included in either single or double quotes (this is\n    // the delimiter). Mark everything as a string until the start delimiter\n    // occurs again.\n    function inString (delimiter, previousTokenizer) {\n      return function (stream, state) {\n        if (!state.escapeNext && stream.eat(delimiter)) {\n          state.tokenize = previousTokenizer;\n        } else {\n          if (state.escapeNext) {\n            state.escapeNext = false;\n          }\n\n          var ch = stream.next();\n\n          // Take into account the backslash for escaping characters, such as\n          // the string delimiter.\n          if (ch == \"\\\\\") {\n            state.escapeNext = true;\n          }\n        }\n\n        return \"string\";\n      };\n    }\n\n    // Apply Django template variable syntax highlighting\n    function inVariable (stream, state) {\n      // Attempt to match a dot that precedes a property\n      if (state.waitDot) {\n        state.waitDot = false;\n\n        if (stream.peek() != \".\") {\n          return \"null\";\n        }\n\n        // Dot followed by a non-word character should be considered an error.\n        if (stream.match(/\\.\\W+/)) {\n          return \"error\";\n        } else if (stream.eat(\".\")) {\n          state.waitProperty = true;\n          return \"null\";\n        } else {\n          throw Error (\"Unexpected error while waiting for property.\");\n        }\n      }\n\n      // Attempt to match a pipe that precedes a filter\n      if (state.waitPipe) {\n        state.waitPipe = false;\n\n        if (stream.peek() != \"|\") {\n          return \"null\";\n        }\n\n        // Pipe followed by a non-word character should be considered an error.\n        if (stream.match(/\\.\\W+/)) {\n          return \"error\";\n        } else if (stream.eat(\"|\")) {\n          state.waitFilter = true;\n          return \"null\";\n        } else {\n          throw Error (\"Unexpected error while waiting for filter.\");\n        }\n      }\n\n      // Highlight properties\n      if (state.waitProperty) {\n        state.waitProperty = false;\n        if (stream.match(/\\b(\\w+)\\b/)) {\n          state.waitDot = true;  // A property can be followed by another property\n          state.waitPipe = true;  // A property can be followed by a filter\n          return \"property\";\n        }\n      }\n\n      // Highlight filters\n      if (state.waitFilter) {\n          state.waitFilter = false;\n        if (stream.match(filters)) {\n          return \"variable-2\";\n        }\n      }\n\n      // Ignore all white spaces\n      if (stream.eatSpace()) {\n        state.waitProperty = false;\n        return \"null\";\n      }\n\n      // Identify numbers\n      if (stream.match(/\\b\\d+(\\.\\d+)?\\b/)) {\n        return \"number\";\n      }\n\n      // Identify strings\n      if (stream.match(\"'\")) {\n        state.tokenize = inString(\"'\", state.tokenize);\n        return \"string\";\n      } else if (stream.match('\"')) {\n        state.tokenize = inString('\"', state.tokenize);\n        return \"string\";\n      }\n\n      // Attempt to find the variable\n      if (stream.match(/\\b(\\w+)\\b/) && !state.foundVariable) {\n        state.waitDot = true;\n        state.waitPipe = true;  // A property can be followed by a filter\n        return \"variable\";\n      }\n\n      // If found closing tag reset\n      if (stream.match(\"}}\")) {\n        state.waitProperty = null;\n        state.waitFilter = null;\n        state.waitDot = null;\n        state.waitPipe = null;\n        state.tokenize = tokenBase;\n        return \"tag\";\n      }\n\n      // If nothing was found, advance to the next character\n      stream.next();\n      return \"null\";\n    }\n\n    function inTag (stream, state) {\n      // Attempt to match a dot that precedes a property\n      if (state.waitDot) {\n        state.waitDot = false;\n\n        if (stream.peek() != \".\") {\n          return \"null\";\n        }\n\n        // Dot followed by a non-word character should be considered an error.\n        if (stream.match(/\\.\\W+/)) {\n          return \"error\";\n        } else if (stream.eat(\".\")) {\n          state.waitProperty = true;\n          return \"null\";\n        } else {\n          throw Error (\"Unexpected error while waiting for property.\");\n        }\n      }\n\n      // Attempt to match a pipe that precedes a filter\n      if (state.waitPipe) {\n        state.waitPipe = false;\n\n        if (stream.peek() != \"|\") {\n          return \"null\";\n        }\n\n        // Pipe followed by a non-word character should be considered an error.\n        if (stream.match(/\\.\\W+/)) {\n          return \"error\";\n        } else if (stream.eat(\"|\")) {\n          state.waitFilter = true;\n          return \"null\";\n        } else {\n          throw Error (\"Unexpected error while waiting for filter.\");\n        }\n      }\n\n      // Highlight properties\n      if (state.waitProperty) {\n        state.waitProperty = false;\n        if (stream.match(/\\b(\\w+)\\b/)) {\n          state.waitDot = true;  // A property can be followed by another property\n          state.waitPipe = true;  // A property can be followed by a filter\n          return \"property\";\n        }\n      }\n\n      // Highlight filters\n      if (state.waitFilter) {\n          state.waitFilter = false;\n        if (stream.match(filters)) {\n          return \"variable-2\";\n        }\n      }\n\n      // Ignore all white spaces\n      if (stream.eatSpace()) {\n        state.waitProperty = false;\n        return \"null\";\n      }\n\n      // Identify numbers\n      if (stream.match(/\\b\\d+(\\.\\d+)?\\b/)) {\n        return \"number\";\n      }\n\n      // Identify strings\n      if (stream.match(\"'\")) {\n        state.tokenize = inString(\"'\", state.tokenize);\n        return \"string\";\n      } else if (stream.match('\"')) {\n        state.tokenize = inString('\"', state.tokenize);\n        return \"string\";\n      }\n\n      // Attempt to match an operator\n      if (stream.match(operators)) {\n        return \"operator\";\n      }\n\n      // Attempt to match a word operator\n      if (stream.match(wordOperators)) {\n        return \"keyword\";\n      }\n\n      // Attempt to match a keyword\n      var keywordMatch = stream.match(keywords);\n      if (keywordMatch) {\n        if (keywordMatch[0] == \"comment\") {\n          state.blockCommentTag = true;\n        }\n        return \"keyword\";\n      }\n\n      // Attempt to match a variable\n      if (stream.match(/\\b(\\w+)\\b/)) {\n        state.waitDot = true;\n        state.waitPipe = true;  // A property can be followed by a filter\n        return \"variable\";\n      }\n\n      // If found closing tag reset\n      if (stream.match(\"%}\")) {\n        state.waitProperty = null;\n        state.waitFilter = null;\n        state.waitDot = null;\n        state.waitPipe = null;\n        // If the tag that closes is a block comment tag, we want to mark the\n        // following code as comment, until the tag closes.\n        if (state.blockCommentTag) {\n          state.blockCommentTag = false;  // Release the \"lock\"\n          state.tokenize = inBlockComment;\n        } else {\n          state.tokenize = tokenBase;\n        }\n        return \"tag\";\n      }\n\n      // If nothing was found, advance to the next character\n      stream.next();\n      return \"null\";\n    }\n\n    // Mark everything as comment inside the tag and the tag itself.\n    function inComment (stream, state) {\n      if (stream.match(/^.*?#\\}/)) state.tokenize = tokenBase\n      else stream.skipToEnd()\n      return \"comment\";\n    }\n\n    // Mark everything as a comment until the `blockcomment` tag closes.\n    function inBlockComment (stream, state) {\n      if (stream.match(/\\{%\\s*endcomment\\s*%\\}/, false)) {\n        state.tokenize = inTag;\n        stream.match(\"{%\");\n        return \"tag\";\n      } else {\n        stream.next();\n        return \"comment\";\n      }\n    }\n\n    return {\n      startState: function () {\n        return {tokenize: tokenBase};\n      },\n      token: function (stream, state) {\n        return state.tokenize(stream, state);\n      },\n      blockCommentStart: \"{% comment %}\",\n      blockCommentEnd: \"{% endcomment %}\"\n    };\n  });\n\n  CodeMirror.defineMode(\"django\", function(config) {\n    var htmlBase = CodeMirror.getMode(config, \"text/html\");\n    var djangoInner = CodeMirror.getMode(config, \"django:inner\");\n    return CodeMirror.overlayMode(htmlBase, djangoInner);\n  });\n\n  CodeMirror.defineMIME(\"text/x-django\", \"django\");\n});\n"
  },
  {
    "path": "libs/codemirror/foldcode.js",
    "content": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n  if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n    mod(require(\"../../lib/codemirror\"));\n  else if (typeof define == \"function\" && define.amd) // AMD\n    define([\"../../lib/codemirror\"], mod);\n  else // Plain browser env\n    mod(CodeMirror);\n})(function(CodeMirror) {\n  \"use strict\";\n\n  function doFold(cm, pos, options, force) {\n    if (options && options.call) {\n      var finder = options;\n      options = null;\n    } else {\n      var finder = getOption(cm, options, \"rangeFinder\");\n    }\n    if (typeof pos == \"number\") pos = CodeMirror.Pos(pos, 0);\n    var minSize = getOption(cm, options, \"minFoldSize\");\n\n    function getRange(allowFolded) {\n      var range = finder(cm, pos);\n      if (!range || range.to.line - range.from.line < minSize) return null;\n      var marks = cm.findMarksAt(range.from);\n      for (var i = 0; i < marks.length; ++i) {\n        if (marks[i].__isFold && force !== \"fold\") {\n          if (!allowFolded) return null;\n          range.cleared = true;\n          marks[i].clear();\n        }\n      }\n      return range;\n    }\n\n    var range = getRange(true);\n    if (getOption(cm, options, \"scanUp\")) while (!range && pos.line > cm.firstLine()) {\n      pos = CodeMirror.Pos(pos.line - 1, 0);\n      range = getRange(false);\n    }\n    if (!range || range.cleared || force === \"unfold\") return;\n\n    var myWidget = makeWidget(cm, options);\n    CodeMirror.on(myWidget, \"mousedown\", function(e) {\n      myRange.clear();\n      CodeMirror.e_preventDefault(e);\n    });\n    var myRange = cm.markText(range.from, range.to, {\n      replacedWith: myWidget,\n      clearOnEnter: getOption(cm, options, \"clearOnEnter\"),\n      __isFold: true\n    });\n    myRange.on(\"clear\", function(from, to) {\n      CodeMirror.signal(cm, \"unfold\", cm, from, to);\n    });\n    CodeMirror.signal(cm, \"fold\", cm, range.from, range.to);\n  }\n\n  function makeWidget(cm, options) {\n    var widget = getOption(cm, options, \"widget\");\n    if (typeof widget == \"string\") {\n      var text = document.createTextNode(widget);\n      widget = document.createElement(\"span\");\n      widget.appendChild(text);\n      widget.className = \"CodeMirror-foldmarker\";\n    } else if (widget) {\n      widget = widget.cloneNode(true)\n    }\n    return widget;\n  }\n\n  // Clumsy backwards-compatible interface\n  CodeMirror.newFoldFunction = function(rangeFinder, widget) {\n    return function(cm, pos) { doFold(cm, pos, {rangeFinder: rangeFinder, widget: widget}); };\n  };\n\n  // New-style interface\n  CodeMirror.defineExtension(\"foldCode\", function(pos, options, force) {\n    doFold(this, pos, options, force);\n  });\n\n  CodeMirror.defineExtension(\"isFolded\", function(pos) {\n    var marks = this.findMarksAt(pos);\n    for (var i = 0; i < marks.length; ++i)\n      if (marks[i].__isFold) return true;\n  });\n\n  CodeMirror.commands.toggleFold = function(cm) {\n    cm.foldCode(cm.getCursor());\n  };\n  CodeMirror.commands.fold = function(cm) {\n    cm.foldCode(cm.getCursor(), null, \"fold\");\n  };\n  CodeMirror.commands.unfold = function(cm) {\n    cm.foldCode(cm.getCursor(), null, \"unfold\");\n  };\n  CodeMirror.commands.foldAll = function(cm) {\n    cm.operation(function() {\n      for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++)\n        cm.foldCode(CodeMirror.Pos(i, 0), null, \"fold\");\n    });\n  };\n  CodeMirror.commands.unfoldAll = function(cm) {\n    cm.operation(function() {\n      for (var i = cm.firstLine(), e = cm.lastLine(); i <= e; i++)\n        cm.foldCode(CodeMirror.Pos(i, 0), null, \"unfold\");\n    });\n  };\n\n  CodeMirror.registerHelper(\"fold\", \"combine\", function() {\n    var funcs = Array.prototype.slice.call(arguments, 0);\n    return function(cm, start) {\n      for (var i = 0; i < funcs.length; ++i) {\n        var found = funcs[i](cm, start);\n        if (found) return found;\n      }\n    };\n  });\n\n  CodeMirror.registerHelper(\"fold\", \"auto\", function(cm, start) {\n    var helpers = cm.getHelpers(start, \"fold\");\n    for (var i = 0; i < helpers.length; i++) {\n      var cur = helpers[i](cm, start);\n      if (cur) return cur;\n    }\n  });\n\n  var defaultOptions = {\n    rangeFinder: CodeMirror.fold.auto,\n    widget: \"\\u2194\",\n    minFoldSize: 0,\n    scanUp: false,\n    clearOnEnter: true\n  };\n\n  CodeMirror.defineOption(\"foldOptions\", null);\n\n  function getOption(cm, options, name) {\n    if (options && options[name] !== undefined)\n      return options[name];\n    var editorOptions = cm.options.foldOptions;\n    if (editorOptions && editorOptions[name] !== undefined)\n      return editorOptions[name];\n    return defaultOptions[name];\n  }\n\n  CodeMirror.defineExtension(\"foldOption\", function(options, name) {\n    return getOption(this, options, name);\n  });\n});\n"
  },
  {
    "path": "libs/codemirror/foldgutter.js",
    "content": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n  if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n    mod(require(\"../../lib/codemirror\"), require(\"./foldcode\"));\n  else if (typeof define == \"function\" && define.amd) // AMD\n    define([\"../../lib/codemirror\", \"./foldcode\"], mod);\n  else // Plain browser env\n    mod(CodeMirror);\n})(function(CodeMirror) {\n  \"use strict\";\n\n  CodeMirror.defineOption(\"foldGutter\", false, function(cm, val, old) {\n    if (old && old != CodeMirror.Init) {\n      cm.clearGutter(cm.state.foldGutter.options.gutter);\n      cm.state.foldGutter = null;\n      cm.off(\"gutterClick\", onGutterClick);\n      cm.off(\"change\", onChange);\n      cm.off(\"viewportChange\", onViewportChange);\n      cm.off(\"fold\", onFold);\n      cm.off(\"unfold\", onFold);\n      cm.off(\"swapDoc\", onChange);\n    }\n    if (val) {\n      cm.state.foldGutter = new State(parseOptions(val));\n      updateInViewport(cm);\n      cm.on(\"gutterClick\", onGutterClick);\n      cm.on(\"change\", onChange);\n      cm.on(\"viewportChange\", onViewportChange);\n      cm.on(\"fold\", onFold);\n      cm.on(\"unfold\", onFold);\n      cm.on(\"swapDoc\", onChange);\n    }\n  });\n\n  var Pos = CodeMirror.Pos;\n\n  function State(options) {\n    this.options = options;\n    this.from = this.to = 0;\n  }\n\n  function parseOptions(opts) {\n    if (opts === true) opts = {};\n    if (opts.gutter == null) opts.gutter = \"CodeMirror-foldgutter\";\n    if (opts.indicatorOpen == null) opts.indicatorOpen = \"CodeMirror-foldgutter-open\";\n    if (opts.indicatorFolded == null) opts.indicatorFolded = \"CodeMirror-foldgutter-folded\";\n    return opts;\n  }\n\n  function isFolded(cm, line) {\n    var marks = cm.findMarks(Pos(line, 0), Pos(line + 1, 0));\n    for (var i = 0; i < marks.length; ++i)\n      if (marks[i].__isFold && marks[i].find().from.line == line) return marks[i];\n  }\n\n  function marker(spec) {\n    if (typeof spec == \"string\") {\n      var elt = document.createElement(\"div\");\n      elt.className = spec + \" CodeMirror-guttermarker-subtle\";\n      return elt;\n    } else {\n      return spec.cloneNode(true);\n    }\n  }\n\n  function updateFoldInfo(cm, from, to) {\n    var opts = cm.state.foldGutter.options, cur = from;\n    var minSize = cm.foldOption(opts, \"minFoldSize\");\n    var func = cm.foldOption(opts, \"rangeFinder\");\n    cm.eachLine(from, to, function(line) {\n      var mark = null;\n      if (isFolded(cm, cur)) {\n        mark = marker(opts.indicatorFolded);\n      } else {\n        var pos = Pos(cur, 0);\n        var range = func && func(cm, pos);\n        if (range && range.to.line - range.from.line >= minSize)\n          mark = marker(opts.indicatorOpen);\n      }\n      cm.setGutterMarker(line, opts.gutter, mark);\n      ++cur;\n    });\n  }\n\n  function updateInViewport(cm) {\n    var vp = cm.getViewport(), state = cm.state.foldGutter;\n    if (!state) return;\n    cm.operation(function() {\n      updateFoldInfo(cm, vp.from, vp.to);\n    });\n    state.from = vp.from; state.to = vp.to;\n  }\n\n  function onGutterClick(cm, line, gutter) {\n    var state = cm.state.foldGutter;\n    if (!state) return;\n    var opts = state.options;\n    if (gutter != opts.gutter) return;\n    var folded = isFolded(cm, line);\n    if (folded) folded.clear();\n    else cm.foldCode(Pos(line, 0), opts.rangeFinder);\n  }\n\n  function onChange(cm) {\n    var state = cm.state.foldGutter;\n    if (!state) return;\n    var opts = state.options;\n    state.from = state.to = 0;\n    clearTimeout(state.changeUpdate);\n    state.changeUpdate = setTimeout(function() { updateInViewport(cm); }, opts.foldOnChangeTimeSpan || 600);\n  }\n\n  function onViewportChange(cm) {\n    var state = cm.state.foldGutter;\n    if (!state) return;\n    var opts = state.options;\n    clearTimeout(state.changeUpdate);\n    state.changeUpdate = setTimeout(function() {\n      var vp = cm.getViewport();\n      if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) {\n        updateInViewport(cm);\n      } else {\n        cm.operation(function() {\n          if (vp.from < state.from) {\n            updateFoldInfo(cm, vp.from, state.from);\n            state.from = vp.from;\n          }\n          if (vp.to > state.to) {\n            updateFoldInfo(cm, state.to, vp.to);\n            state.to = vp.to;\n          }\n        });\n      }\n    }, opts.updateViewportTimeSpan || 400);\n  }\n\n  function onFold(cm, from) {\n    var state = cm.state.foldGutter;\n    if (!state) return;\n    var line = from.line;\n    if (line >= state.from && line < state.to)\n      updateFoldInfo(cm, line, line + 1);\n  }\n});\n"
  },
  {
    "path": "libs/codemirror/fullscreen.css",
    "content": ".CodeMirror-fullscreen {\n  position: fixed;\n  top: 0; left: 0; right: 0; bottom: 0;\n  height: auto;\n  z-index: 9;\n}\n"
  },
  {
    "path": "libs/codemirror/fullscreen.js",
    "content": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n  if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n    mod(require(\"../../lib/codemirror\"));\n  else if (typeof define == \"function\" && define.amd) // AMD\n    define([\"../../lib/codemirror\"], mod);\n  else // Plain browser env\n    mod(CodeMirror);\n})(function(CodeMirror) {\n  \"use strict\";\n\n  CodeMirror.defineOption(\"fullScreen\", false, function(cm, val, old) {\n    if (old == CodeMirror.Init) old = false;\n    if (!old == !val) return;\n    if (val) setFullscreen(cm);\n    else setNormal(cm);\n  });\n\n  function setFullscreen(cm) {\n    var wrap = cm.getWrapperElement();\n    cm.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset,\n                                  width: wrap.style.width, height: wrap.style.height};\n    wrap.style.width = \"\";\n    wrap.style.height = \"auto\";\n    wrap.className += \" CodeMirror-fullscreen\";\n    document.documentElement.style.overflow = \"hidden\";\n    cm.refresh();\n  }\n\n  function setNormal(cm) {\n    var wrap = cm.getWrapperElement();\n    wrap.className = wrap.className.replace(/\\s*CodeMirror-fullscreen\\b/, \"\");\n    document.documentElement.style.overflow = \"\";\n    var info = cm.state.fullScreenRestore;\n    wrap.style.width = info.width; wrap.style.height = info.height;\n    window.scrollTo(info.scrollLeft, info.scrollTop);\n    cm.refresh();\n  }\n});\n"
  },
  {
    "path": "libs/codemirror/markdown.js",
    "content": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n  if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n    mod(require(\"../../lib/codemirror\"), require(\"../xml/xml\"), require(\"../meta\"));\n  else if (typeof define == \"function\" && define.amd) // AMD\n    define([\"../../lib/codemirror\", \"../xml/xml\", \"../meta\"], mod);\n  else // Plain browser env\n    mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode(\"markdown\", function(cmCfg, modeCfg) {\n\n  var htmlMode = CodeMirror.getMode(cmCfg, \"text/html\");\n  var htmlModeMissing = htmlMode.name == \"null\"\n\n  function getMode(name) {\n    if (CodeMirror.findModeByName) {\n      var found = CodeMirror.findModeByName(name);\n      if (found) name = found.mime || found.mimes[0];\n    }\n    var mode = CodeMirror.getMode(cmCfg, name);\n    return mode.name == \"null\" ? null : mode;\n  }\n\n  // Should characters that affect highlighting be highlighted separate?\n  // Does not include characters that will be output (such as `1.` and `-` for lists)\n  if (modeCfg.highlightFormatting === undefined)\n    modeCfg.highlightFormatting = false;\n\n  // Maximum number of nested blockquotes. Set to 0 for infinite nesting.\n  // Excess `>` will emit `error` token.\n  if (modeCfg.maxBlockquoteDepth === undefined)\n    modeCfg.maxBlockquoteDepth = 0;\n\n  // Turn on task lists? (\"- [ ] \" and \"- [x] \")\n  if (modeCfg.taskLists === undefined) modeCfg.taskLists = false;\n\n  // Turn on strikethrough syntax\n  if (modeCfg.strikethrough === undefined)\n    modeCfg.strikethrough = false;\n\n  if (modeCfg.emoji === undefined)\n    modeCfg.emoji = false;\n\n  if (modeCfg.fencedCodeBlockHighlighting === undefined)\n    modeCfg.fencedCodeBlockHighlighting = true;\n\n  if (modeCfg.xml === undefined)\n    modeCfg.xml = true;\n\n  // Allow token types to be overridden by user-provided token types.\n  if (modeCfg.tokenTypeOverrides === undefined)\n    modeCfg.tokenTypeOverrides = {};\n\n  var tokenTypes = {\n    header: \"header\",\n    code: \"comment\",\n    quote: \"quote\",\n    list1: \"variable-2\",\n    list2: \"variable-3\",\n    list3: \"keyword\",\n    hr: \"hr\",\n    image: \"image\",\n    imageAltText: \"image-alt-text\",\n    imageMarker: \"image-marker\",\n    formatting: \"formatting\",\n    linkInline: \"link\",\n    linkEmail: \"link\",\n    linkText: \"link\",\n    linkHref: \"string\",\n    em: \"em\",\n    strong: \"strong\",\n    strikethrough: \"strikethrough\",\n    emoji: \"builtin\"\n  };\n\n  for (var tokenType in tokenTypes) {\n    if (tokenTypes.hasOwnProperty(tokenType) && modeCfg.tokenTypeOverrides[tokenType]) {\n      tokenTypes[tokenType] = modeCfg.tokenTypeOverrides[tokenType];\n    }\n  }\n\n  var hrRE = /^([*\\-_])(?:\\s*\\1){2,}\\s*$/\n  ,   listRE = /^(?:[*\\-+]|^[0-9]+([.)]))\\s+/\n  ,   taskListRE = /^\\[(x| )\\](?=\\s)/i // Must follow listRE\n  ,   atxHeaderRE = modeCfg.allowAtxHeaderWithoutSpace ? /^(#+)/ : /^(#+)(?: |$)/\n  ,   setextHeaderRE = /^ *(?:\\={1,}|-{1,})\\s*$/\n  ,   textRE = /^[^#!\\[\\]*_\\\\<>` \"'(~:]+/\n  ,   fencedCodeRE = /^(~~~+|```+)[ \\t]*([\\w+#-]*)[^\\n`]*$/\n  ,   linkDefRE = /^\\s*\\[[^\\]]+?\\]:.*$/ // naive link-definition\n  ,   punctuation = /[!\"#$%&'()*+,\\-.\\/:;<=>?@\\[\\\\\\]^_`{|}~\\xA1\\xA7\\xAB\\xB6\\xB7\\xBB\\xBF\\u037E\\u0387\\u055A-\\u055F\\u0589\\u058A\\u05BE\\u05C0\\u05C3\\u05C6\\u05F3\\u05F4\\u0609\\u060A\\u060C\\u060D\\u061B\\u061E\\u061F\\u066A-\\u066D\\u06D4\\u0700-\\u070D\\u07F7-\\u07F9\\u0830-\\u083E\\u085E\\u0964\\u0965\\u0970\\u0AF0\\u0DF4\\u0E4F\\u0E5A\\u0E5B\\u0F04-\\u0F12\\u0F14\\u0F3A-\\u0F3D\\u0F85\\u0FD0-\\u0FD4\\u0FD9\\u0FDA\\u104A-\\u104F\\u10FB\\u1360-\\u1368\\u1400\\u166D\\u166E\\u169B\\u169C\\u16EB-\\u16ED\\u1735\\u1736\\u17D4-\\u17D6\\u17D8-\\u17DA\\u1800-\\u180A\\u1944\\u1945\\u1A1E\\u1A1F\\u1AA0-\\u1AA6\\u1AA8-\\u1AAD\\u1B5A-\\u1B60\\u1BFC-\\u1BFF\\u1C3B-\\u1C3F\\u1C7E\\u1C7F\\u1CC0-\\u1CC7\\u1CD3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205E\\u207D\\u207E\\u208D\\u208E\\u2308-\\u230B\\u2329\\u232A\\u2768-\\u2775\\u27C5\\u27C6\\u27E6-\\u27EF\\u2983-\\u2998\\u29D8-\\u29DB\\u29FC\\u29FD\\u2CF9-\\u2CFC\\u2CFE\\u2CFF\\u2D70\\u2E00-\\u2E2E\\u2E30-\\u2E42\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301F\\u3030\\u303D\\u30A0\\u30FB\\uA4FE\\uA4FF\\uA60D-\\uA60F\\uA673\\uA67E\\uA6F2-\\uA6F7\\uA874-\\uA877\\uA8CE\\uA8CF\\uA8F8-\\uA8FA\\uA8FC\\uA92E\\uA92F\\uA95F\\uA9C1-\\uA9CD\\uA9DE\\uA9DF\\uAA5C-\\uAA5F\\uAADE\\uAADF\\uAAF0\\uAAF1\\uABEB\\uFD3E\\uFD3F\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE61\\uFE63\\uFE68\\uFE6A\\uFE6B\\uFF01-\\uFF03\\uFF05-\\uFF0A\\uFF0C-\\uFF0F\\uFF1A\\uFF1B\\uFF1F\\uFF20\\uFF3B-\\uFF3D\\uFF3F\\uFF5B\\uFF5D\\uFF5F-\\uFF65]|\\uD800[\\uDD00-\\uDD02\\uDF9F\\uDFD0]|\\uD801\\uDD6F|\\uD802[\\uDC57\\uDD1F\\uDD3F\\uDE50-\\uDE58\\uDE7F\\uDEF0-\\uDEF6\\uDF39-\\uDF3F\\uDF99-\\uDF9C]|\\uD804[\\uDC47-\\uDC4D\\uDCBB\\uDCBC\\uDCBE-\\uDCC1\\uDD40-\\uDD43\\uDD74\\uDD75\\uDDC5-\\uDDC9\\uDDCD\\uDDDB\\uDDDD-\\uDDDF\\uDE38-\\uDE3D\\uDEA9]|\\uD805[\\uDCC6\\uDDC1-\\uDDD7\\uDE41-\\uDE43\\uDF3C-\\uDF3E]|\\uD809[\\uDC70-\\uDC74]|\\uD81A[\\uDE6E\\uDE6F\\uDEF5\\uDF37-\\uDF3B\\uDF44]|\\uD82F\\uDC9F|\\uD836[\\uDE87-\\uDE8B]/\n  ,   expandedTab = \"    \" // CommonMark specifies tab as 4 spaces\n\n  function switchInline(stream, state, f) {\n    state.f = state.inline = f;\n    return f(stream, state);\n  }\n\n  function switchBlock(stream, state, f) {\n    state.f = state.block = f;\n    return f(stream, state);\n  }\n\n  function lineIsEmpty(line) {\n    return !line || !/\\S/.test(line.string)\n  }\n\n  // Blocks\n\n  function blankLine(state) {\n    // Reset linkTitle state\n    state.linkTitle = false;\n    state.linkHref = false;\n    state.linkText = false;\n    // Reset EM state\n    state.em = false;\n    // Reset STRONG state\n    state.strong = false;\n    // Reset strikethrough state\n    state.strikethrough = false;\n    // Reset state.quote\n    state.quote = 0;\n    // Reset state.indentedCode\n    state.indentedCode = false;\n    if (state.f == htmlBlock) {\n      var exit = htmlModeMissing\n      if (!exit) {\n        var inner = CodeMirror.innerMode(htmlMode, state.htmlState)\n        exit = inner.mode.name == \"xml\" && inner.state.tagStart === null &&\n          (!inner.state.context && inner.state.tokenize.isInText)\n      }\n      if (exit) {\n        state.f = inlineNormal;\n        state.block = blockNormal;\n        state.htmlState = null;\n      }\n    }\n    // Reset state.trailingSpace\n    state.trailingSpace = 0;\n    state.trailingSpaceNewLine = false;\n    // Mark this line as blank\n    state.prevLine = state.thisLine\n    state.thisLine = {stream: null}\n    return null;\n  }\n\n  function blockNormal(stream, state) {\n    var firstTokenOnLine = stream.column() === state.indentation;\n    var prevLineLineIsEmpty = lineIsEmpty(state.prevLine.stream);\n    var prevLineIsIndentedCode = state.indentedCode;\n    var prevLineIsHr = state.prevLine.hr;\n    var prevLineIsList = state.list !== false;\n    var maxNonCodeIndentation = (state.listStack[state.listStack.length - 1] || 0) + 3;\n\n    state.indentedCode = false;\n\n    var lineIndentation = state.indentation;\n    // compute once per line (on first token)\n    if (state.indentationDiff === null) {\n      state.indentationDiff = state.indentation;\n      if (prevLineIsList) {\n        // Reset inline styles which shouldn't propagate aross list items\n        state.em = false;\n        state.strong = false;\n        state.code = false;\n        state.strikethrough = false;\n\n        state.list = null;\n        // While this list item's marker's indentation is less than the deepest\n        //  list item's content's indentation,pop the deepest list item\n        //  indentation off the stack, and update block indentation state\n        while (lineIndentation < state.listStack[state.listStack.length - 1]) {\n          state.listStack.pop();\n          if (state.listStack.length) {\n            state.indentation = state.listStack[state.listStack.length - 1];\n          // less than the first list's indent -> the line is no longer a list\n          } else {\n            state.list = false;\n          }\n        }\n        if (state.list !== false) {\n          state.indentationDiff = lineIndentation - state.listStack[state.listStack.length - 1]\n        }\n      }\n    }\n\n    // not comprehensive (currently only for setext detection purposes)\n    var allowsInlineContinuation = (\n        !prevLineLineIsEmpty && !prevLineIsHr && !state.prevLine.header &&\n        (!prevLineIsList || !prevLineIsIndentedCode) &&\n        !state.prevLine.fencedCodeEnd\n    );\n\n    var isHr = (state.list === false || prevLineIsHr || prevLineLineIsEmpty) &&\n      state.indentation <= maxNonCodeIndentation && stream.match(hrRE);\n\n    var match = null;\n    if (state.indentationDiff >= 4 && (prevLineIsIndentedCode || state.prevLine.fencedCodeEnd ||\n         state.prevLine.header || prevLineLineIsEmpty)) {\n      stream.skipToEnd();\n      state.indentedCode = true;\n      return tokenTypes.code;\n    } else if (stream.eatSpace()) {\n      return null;\n    } else if (firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(atxHeaderRE)) && match[1].length <= 6) {\n      state.quote = 0;\n      state.header = match[1].length;\n      state.thisLine.header = true;\n      if (modeCfg.highlightFormatting) state.formatting = \"header\";\n      state.f = state.inline;\n      return getType(state);\n    } else if (state.indentation <= maxNonCodeIndentation && stream.eat('>')) {\n      state.quote = firstTokenOnLine ? 1 : state.quote + 1;\n      if (modeCfg.highlightFormatting) state.formatting = \"quote\";\n      stream.eatSpace();\n      return getType(state);\n    } else if (!isHr && !state.setext && firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(listRE))) {\n      var listType = match[1] ? \"ol\" : \"ul\";\n\n      state.indentation = lineIndentation + stream.current().length;\n      state.list = true;\n      state.quote = 0;\n\n      // Add this list item's content's indentation to the stack\n      state.listStack.push(state.indentation);\n\n      if (modeCfg.taskLists && stream.match(taskListRE, false)) {\n        state.taskList = true;\n      }\n      state.f = state.inline;\n      if (modeCfg.highlightFormatting) state.formatting = [\"list\", \"list-\" + listType];\n      return getType(state);\n    } else if (firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(fencedCodeRE, true))) {\n      state.quote = 0;\n      state.fencedEndRE = new RegExp(match[1] + \"+ *$\");\n      // try switching mode\n      state.localMode = modeCfg.fencedCodeBlockHighlighting && getMode(match[2]);\n      if (state.localMode) state.localState = CodeMirror.startState(state.localMode);\n      state.f = state.block = local;\n      if (modeCfg.highlightFormatting) state.formatting = \"code-block\";\n      state.code = -1\n      return getType(state);\n    // SETEXT has lowest block-scope precedence after HR, so check it after\n    //  the others (code, blockquote, list...)\n    } else if (\n      // if setext set, indicates line after ---/===\n      state.setext || (\n        // line before ---/===\n        (!allowsInlineContinuation || !prevLineIsList) && !state.quote && state.list === false &&\n        !state.code && !isHr && !linkDefRE.test(stream.string) &&\n        (match = stream.lookAhead(1)) && (match = match.match(setextHeaderRE))\n      )\n    ) {\n      if ( !state.setext ) {\n        state.header = match[0].charAt(0) == '=' ? 1 : 2;\n        state.setext = state.header;\n      } else {\n        state.header = state.setext;\n        // has no effect on type so we can reset it now\n        state.setext = 0;\n        stream.skipToEnd();\n        if (modeCfg.highlightFormatting) state.formatting = \"header\";\n      }\n      state.thisLine.header = true;\n      state.f = state.inline;\n      return getType(state);\n    } else if (isHr) {\n      stream.skipToEnd();\n      state.hr = true;\n      state.thisLine.hr = true;\n      return tokenTypes.hr;\n    } else if (stream.peek() === '[') {\n      return switchInline(stream, state, footnoteLink);\n    }\n\n    return switchInline(stream, state, state.inline);\n  }\n\n  function htmlBlock(stream, state) {\n    var style = htmlMode.token(stream, state.htmlState);\n    if (!htmlModeMissing) {\n      var inner = CodeMirror.innerMode(htmlMode, state.htmlState)\n      if ((inner.mode.name == \"xml\" && inner.state.tagStart === null &&\n           (!inner.state.context && inner.state.tokenize.isInText)) ||\n          (state.md_inside && stream.current().indexOf(\">\") > -1)) {\n        state.f = inlineNormal;\n        state.block = blockNormal;\n        state.htmlState = null;\n      }\n    }\n    return style;\n  }\n\n  function local(stream, state) {\n    var currListInd = state.listStack[state.listStack.length - 1] || 0;\n    var hasExitedList = state.indentation < currListInd;\n    var maxFencedEndInd = currListInd + 3;\n    if (state.fencedEndRE && state.indentation <= maxFencedEndInd && (hasExitedList || stream.match(state.fencedEndRE))) {\n      if (modeCfg.highlightFormatting) state.formatting = \"code-block\";\n      var returnType;\n      if (!hasExitedList) returnType = getType(state)\n      state.localMode = state.localState = null;\n      state.block = blockNormal;\n      state.f = inlineNormal;\n      state.fencedEndRE = null;\n      state.code = 0\n      state.thisLine.fencedCodeEnd = true;\n      if (hasExitedList) return switchBlock(stream, state, state.block);\n      return returnType;\n    } else if (state.localMode) {\n      return state.localMode.token(stream, state.localState);\n    } else {\n      stream.skipToEnd();\n      return tokenTypes.code;\n    }\n  }\n\n  // Inline\n  function getType(state) {\n    var styles = [];\n\n    if (state.formatting) {\n      styles.push(tokenTypes.formatting);\n\n      if (typeof state.formatting === \"string\") state.formatting = [state.formatting];\n\n      for (var i = 0; i < state.formatting.length; i++) {\n        styles.push(tokenTypes.formatting + \"-\" + state.formatting[i]);\n\n        if (state.formatting[i] === \"header\") {\n          styles.push(tokenTypes.formatting + \"-\" + state.formatting[i] + \"-\" + state.header);\n        }\n\n        // Add `formatting-quote` and `formatting-quote-#` for blockquotes\n        // Add `error` instead if the maximum blockquote nesting depth is passed\n        if (state.formatting[i] === \"quote\") {\n          if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) {\n            styles.push(tokenTypes.formatting + \"-\" + state.formatting[i] + \"-\" + state.quote);\n          } else {\n            styles.push(\"error\");\n          }\n        }\n      }\n    }\n\n    if (state.taskOpen) {\n      styles.push(\"meta\");\n      return styles.length ? styles.join(' ') : null;\n    }\n    if (state.taskClosed) {\n      styles.push(\"property\");\n      return styles.length ? styles.join(' ') : null;\n    }\n\n    if (state.linkHref) {\n      styles.push(tokenTypes.linkHref, \"url\");\n    } else { // Only apply inline styles to non-url text\n      if (state.strong) { styles.push(tokenTypes.strong); }\n      if (state.em) { styles.push(tokenTypes.em); }\n      if (state.strikethrough) { styles.push(tokenTypes.strikethrough); }\n      if (state.emoji) { styles.push(tokenTypes.emoji); }\n      if (state.linkText) { styles.push(tokenTypes.linkText); }\n      if (state.code) { styles.push(tokenTypes.code); }\n      if (state.image) { styles.push(tokenTypes.image); }\n      if (state.imageAltText) { styles.push(tokenTypes.imageAltText, \"link\"); }\n      if (state.imageMarker) { styles.push(tokenTypes.imageMarker); }\n    }\n\n    if (state.header) { styles.push(tokenTypes.header, tokenTypes.header + \"-\" + state.header); }\n\n    if (state.quote) {\n      styles.push(tokenTypes.quote);\n\n      // Add `quote-#` where the maximum for `#` is modeCfg.maxBlockquoteDepth\n      if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) {\n        styles.push(tokenTypes.quote + \"-\" + state.quote);\n      } else {\n        styles.push(tokenTypes.quote + \"-\" + modeCfg.maxBlockquoteDepth);\n      }\n    }\n\n    if (state.list !== false) {\n      var listMod = (state.listStack.length - 1) % 3;\n      if (!listMod) {\n        styles.push(tokenTypes.list1);\n      } else if (listMod === 1) {\n        styles.push(tokenTypes.list2);\n      } else {\n        styles.push(tokenTypes.list3);\n      }\n    }\n\n    if (state.trailingSpaceNewLine) {\n      styles.push(\"trailing-space-new-line\");\n    } else if (state.trailingSpace) {\n      styles.push(\"trailing-space-\" + (state.trailingSpace % 2 ? \"a\" : \"b\"));\n    }\n\n    return styles.length ? styles.join(' ') : null;\n  }\n\n  function handleText(stream, state) {\n    if (stream.match(textRE, true)) {\n      return getType(state);\n    }\n    return undefined;\n  }\n\n  function inlineNormal(stream, state) {\n    var style = state.text(stream, state);\n    if (typeof style !== 'undefined')\n      return style;\n\n    if (state.list) { // List marker (*, +, -, 1., etc)\n      state.list = null;\n      return getType(state);\n    }\n\n    if (state.taskList) {\n      var taskOpen = stream.match(taskListRE, true)[1] === \" \";\n      if (taskOpen) state.taskOpen = true;\n      else state.taskClosed = true;\n      if (modeCfg.highlightFormatting) state.formatting = \"task\";\n      state.taskList = false;\n      return getType(state);\n    }\n\n    state.taskOpen = false;\n    state.taskClosed = false;\n\n    if (state.header && stream.match(/^#+$/, true)) {\n      if (modeCfg.highlightFormatting) state.formatting = \"header\";\n      return getType(state);\n    }\n\n    var ch = stream.next();\n\n    // Matches link titles present on next line\n    if (state.linkTitle) {\n      state.linkTitle = false;\n      var matchCh = ch;\n      if (ch === '(') {\n        matchCh = ')';\n      }\n      matchCh = (matchCh+'').replace(/([.?*+^\\[\\]\\\\(){}|-])/g, \"\\\\$1\");\n      var regex = '^\\\\s*(?:[^' + matchCh + '\\\\\\\\]+|\\\\\\\\\\\\\\\\|\\\\\\\\.)' + matchCh;\n      if (stream.match(new RegExp(regex), true)) {\n        return tokenTypes.linkHref;\n      }\n    }\n\n    // If this block is changed, it may need to be updated in GFM mode\n    if (ch === '`') {\n      var previousFormatting = state.formatting;\n      if (modeCfg.highlightFormatting) state.formatting = \"code\";\n      stream.eatWhile('`');\n      var count = stream.current().length\n      if (state.code == 0 && (!state.quote || count == 1)) {\n        state.code = count\n        return getType(state)\n      } else if (count == state.code) { // Must be exact\n        var t = getType(state)\n        state.code = 0\n        return t\n      } else {\n        state.formatting = previousFormatting\n        return getType(state)\n      }\n    } else if (state.code) {\n      return getType(state);\n    }\n\n    if (ch === '\\\\') {\n      stream.next();\n      if (modeCfg.highlightFormatting) {\n        var type = getType(state);\n        var formattingEscape = tokenTypes.formatting + \"-escape\";\n        return type ? type + \" \" + formattingEscape : formattingEscape;\n      }\n    }\n\n    if (ch === '!' && stream.match(/\\[[^\\]]*\\] ?(?:\\(|\\[)/, false)) {\n      state.imageMarker = true;\n      state.image = true;\n      if (modeCfg.highlightFormatting) state.formatting = \"image\";\n      return getType(state);\n    }\n\n    if (ch === '[' && state.imageMarker && stream.match(/[^\\]]*\\](\\(.*?\\)| ?\\[.*?\\])/, false)) {\n      state.imageMarker = false;\n      state.imageAltText = true\n      if (modeCfg.highlightFormatting) state.formatting = \"image\";\n      return getType(state);\n    }\n\n    if (ch === ']' && state.imageAltText) {\n      if (modeCfg.highlightFormatting) state.formatting = \"image\";\n      var type = getType(state);\n      state.imageAltText = false;\n      state.image = false;\n      state.inline = state.f = linkHref;\n      return type;\n    }\n\n    if (ch === '[' && !state.image) {\n      if (state.linkText && stream.match(/^.*?\\]/)) return getType(state)\n      state.linkText = true;\n      if (modeCfg.highlightFormatting) state.formatting = \"link\";\n      return getType(state);\n    }\n\n    if (ch === ']' && state.linkText) {\n      if (modeCfg.highlightFormatting) state.formatting = \"link\";\n      var type = getType(state);\n      state.linkText = false;\n      state.inline = state.f = stream.match(/\\(.*?\\)| ?\\[.*?\\]/, false) ? linkHref : inlineNormal\n      return type;\n    }\n\n    if (ch === '<' && stream.match(/^(https?|ftps?):\\/\\/(?:[^\\\\>]|\\\\.)+>/, false)) {\n      state.f = state.inline = linkInline;\n      if (modeCfg.highlightFormatting) state.formatting = \"link\";\n      var type = getType(state);\n      if (type){\n        type += \" \";\n      } else {\n        type = \"\";\n      }\n      return type + tokenTypes.linkInline;\n    }\n\n    if (ch === '<' && stream.match(/^[^> \\\\]+@(?:[^\\\\>]|\\\\.)+>/, false)) {\n      state.f = state.inline = linkInline;\n      if (modeCfg.highlightFormatting) state.formatting = \"link\";\n      var type = getType(state);\n      if (type){\n        type += \" \";\n      } else {\n        type = \"\";\n      }\n      return type + tokenTypes.linkEmail;\n    }\n\n    if (modeCfg.xml && ch === '<' && stream.match(/^(!--|\\?|!\\[CDATA\\[|[a-z][a-z0-9-]*(?:\\s+[a-z_:.\\-]+(?:\\s*=\\s*[^>]+)?)*\\s*(?:>|$))/i, false)) {\n      var end = stream.string.indexOf(\">\", stream.pos);\n      if (end != -1) {\n        var atts = stream.string.substring(stream.start, end);\n        if (/markdown\\s*=\\s*('|\"){0,1}1('|\"){0,1}/.test(atts)) state.md_inside = true;\n      }\n      stream.backUp(1);\n      state.htmlState = CodeMirror.startState(htmlMode);\n      return switchBlock(stream, state, htmlBlock);\n    }\n\n    if (modeCfg.xml && ch === '<' && stream.match(/^\\/\\w*?>/)) {\n      state.md_inside = false;\n      return \"tag\";\n    } else if (ch === \"*\" || ch === \"_\") {\n      var len = 1, before = stream.pos == 1 ? \" \" : stream.string.charAt(stream.pos - 2)\n      while (len < 3 && stream.eat(ch)) len++\n      var after = stream.peek() || \" \"\n      // See http://spec.commonmark.org/0.27/#emphasis-and-strong-emphasis\n      var leftFlanking = !/\\s/.test(after) && (!punctuation.test(after) || /\\s/.test(before) || punctuation.test(before))\n      var rightFlanking = !/\\s/.test(before) && (!punctuation.test(before) || /\\s/.test(after) || punctuation.test(after))\n      var setEm = null, setStrong = null\n      if (len % 2) { // Em\n        if (!state.em && leftFlanking && (ch === \"*\" || !rightFlanking || punctuation.test(before)))\n          setEm = true\n        else if (state.em == ch && rightFlanking && (ch === \"*\" || !leftFlanking || punctuation.test(after)))\n          setEm = false\n      }\n      if (len > 1) { // Strong\n        if (!state.strong && leftFlanking && (ch === \"*\" || !rightFlanking || punctuation.test(before)))\n          setStrong = true\n        else if (state.strong == ch && rightFlanking && (ch === \"*\" || !leftFlanking || punctuation.test(after)))\n          setStrong = false\n      }\n      if (setStrong != null || setEm != null) {\n        if (modeCfg.highlightFormatting) state.formatting = setEm == null ? \"strong\" : setStrong == null ? \"em\" : \"strong em\"\n        if (setEm === true) state.em = ch\n        if (setStrong === true) state.strong = ch\n        var t = getType(state)\n        if (setEm === false) state.em = false\n        if (setStrong === false) state.strong = false\n        return t\n      }\n    } else if (ch === ' ') {\n      if (stream.eat('*') || stream.eat('_')) { // Probably surrounded by spaces\n        if (stream.peek() === ' ') { // Surrounded by spaces, ignore\n          return getType(state);\n        } else { // Not surrounded by spaces, back up pointer\n          stream.backUp(1);\n        }\n      }\n    }\n\n    if (modeCfg.strikethrough) {\n      if (ch === '~' && stream.eatWhile(ch)) {\n        if (state.strikethrough) {// Remove strikethrough\n          if (modeCfg.highlightFormatting) state.formatting = \"strikethrough\";\n          var t = getType(state);\n          state.strikethrough = false;\n          return t;\n        } else if (stream.match(/^[^\\s]/, false)) {// Add strikethrough\n          state.strikethrough = true;\n          if (modeCfg.highlightFormatting) state.formatting = \"strikethrough\";\n          return getType(state);\n        }\n      } else if (ch === ' ') {\n        if (stream.match(/^~~/, true)) { // Probably surrounded by space\n          if (stream.peek() === ' ') { // Surrounded by spaces, ignore\n            return getType(state);\n          } else { // Not surrounded by spaces, back up pointer\n            stream.backUp(2);\n          }\n        }\n      }\n    }\n\n    if (modeCfg.emoji && ch === \":\" && stream.match(/^(?:[a-z_\\d+][a-z_\\d+-]*|\\-[a-z_\\d+][a-z_\\d+-]*):/)) {\n      state.emoji = true;\n      if (modeCfg.highlightFormatting) state.formatting = \"emoji\";\n      var retType = getType(state);\n      state.emoji = false;\n      return retType;\n    }\n\n    if (ch === ' ') {\n      if (stream.match(/^ +$/, false)) {\n        state.trailingSpace++;\n      } else if (state.trailingSpace) {\n        state.trailingSpaceNewLine = true;\n      }\n    }\n\n    return getType(state);\n  }\n\n  function linkInline(stream, state) {\n    var ch = stream.next();\n\n    if (ch === \">\") {\n      state.f = state.inline = inlineNormal;\n      if (modeCfg.highlightFormatting) state.formatting = \"link\";\n      var type = getType(state);\n      if (type){\n        type += \" \";\n      } else {\n        type = \"\";\n      }\n      return type + tokenTypes.linkInline;\n    }\n\n    stream.match(/^[^>]+/, true);\n\n    return tokenTypes.linkInline;\n  }\n\n  function linkHref(stream, state) {\n    // Check if space, and return NULL if so (to avoid marking the space)\n    if(stream.eatSpace()){\n      return null;\n    }\n    var ch = stream.next();\n    if (ch === '(' || ch === '[') {\n      state.f = state.inline = getLinkHrefInside(ch === \"(\" ? \")\" : \"]\");\n      if (modeCfg.highlightFormatting) state.formatting = \"link-string\";\n      state.linkHref = true;\n      return getType(state);\n    }\n    return 'error';\n  }\n\n  var linkRE = {\n    \")\": /^(?:[^\\\\\\(\\)]|\\\\.|\\((?:[^\\\\\\(\\)]|\\\\.)*\\))*?(?=\\))/,\n    \"]\": /^(?:[^\\\\\\[\\]]|\\\\.|\\[(?:[^\\\\\\[\\]]|\\\\.)*\\])*?(?=\\])/\n  }\n\n  function getLinkHrefInside(endChar) {\n    return function(stream, state) {\n      var ch = stream.next();\n\n      if (ch === endChar) {\n        state.f = state.inline = inlineNormal;\n        if (modeCfg.highlightFormatting) state.formatting = \"link-string\";\n        var returnState = getType(state);\n        state.linkHref = false;\n        return returnState;\n      }\n\n      stream.match(linkRE[endChar])\n      state.linkHref = true;\n      return getType(state);\n    };\n  }\n\n  function footnoteLink(stream, state) {\n    if (stream.match(/^([^\\]\\\\]|\\\\.)*\\]:/, false)) {\n      state.f = footnoteLinkInside;\n      stream.next(); // Consume [\n      if (modeCfg.highlightFormatting) state.formatting = \"link\";\n      state.linkText = true;\n      return getType(state);\n    }\n    return switchInline(stream, state, inlineNormal);\n  }\n\n  function footnoteLinkInside(stream, state) {\n    if (stream.match(/^\\]:/, true)) {\n      state.f = state.inline = footnoteUrl;\n      if (modeCfg.highlightFormatting) state.formatting = \"link\";\n      var returnType = getType(state);\n      state.linkText = false;\n      return returnType;\n    }\n\n    stream.match(/^([^\\]\\\\]|\\\\.)+/, true);\n\n    return tokenTypes.linkText;\n  }\n\n  function footnoteUrl(stream, state) {\n    // Check if space, and return NULL if so (to avoid marking the space)\n    if(stream.eatSpace()){\n      return null;\n    }\n    // Match URL\n    stream.match(/^[^\\s]+/, true);\n    // Check for link title\n    if (stream.peek() === undefined) { // End of line, set flag to check next line\n      state.linkTitle = true;\n    } else { // More content on line, check if link title\n      stream.match(/^(?:\\s+(?:\"(?:[^\"\\\\]|\\\\\\\\|\\\\.)+\"|'(?:[^'\\\\]|\\\\\\\\|\\\\.)+'|\\((?:[^)\\\\]|\\\\\\\\|\\\\.)+\\)))?/, true);\n    }\n    state.f = state.inline = inlineNormal;\n    return tokenTypes.linkHref + \" url\";\n  }\n\n  var mode = {\n    startState: function() {\n      return {\n        f: blockNormal,\n\n        prevLine: {stream: null},\n        thisLine: {stream: null},\n\n        block: blockNormal,\n        htmlState: null,\n        indentation: 0,\n\n        inline: inlineNormal,\n        text: handleText,\n\n        formatting: false,\n        linkText: false,\n        linkHref: false,\n        linkTitle: false,\n        code: 0,\n        em: false,\n        strong: false,\n        header: 0,\n        setext: 0,\n        hr: false,\n        taskList: false,\n        list: false,\n        listStack: [],\n        quote: 0,\n        trailingSpace: 0,\n        trailingSpaceNewLine: false,\n        strikethrough: false,\n        emoji: false,\n        fencedEndRE: null\n      };\n    },\n\n    copyState: function(s) {\n      return {\n        f: s.f,\n\n        prevLine: s.prevLine,\n        thisLine: s.thisLine,\n\n        block: s.block,\n        htmlState: s.htmlState && CodeMirror.copyState(htmlMode, s.htmlState),\n        indentation: s.indentation,\n\n        localMode: s.localMode,\n        localState: s.localMode ? CodeMirror.copyState(s.localMode, s.localState) : null,\n\n        inline: s.inline,\n        text: s.text,\n        formatting: false,\n        linkText: s.linkText,\n        linkTitle: s.linkTitle,\n        linkHref: s.linkHref,\n        code: s.code,\n        em: s.em,\n        strong: s.strong,\n        strikethrough: s.strikethrough,\n        emoji: s.emoji,\n        header: s.header,\n        setext: s.setext,\n        hr: s.hr,\n        taskList: s.taskList,\n        list: s.list,\n        listStack: s.listStack.slice(0),\n        quote: s.quote,\n        indentedCode: s.indentedCode,\n        trailingSpace: s.trailingSpace,\n        trailingSpaceNewLine: s.trailingSpaceNewLine,\n        md_inside: s.md_inside,\n        fencedEndRE: s.fencedEndRE\n      };\n    },\n\n    token: function(stream, state) {\n\n      // Reset state.formatting\n      state.formatting = false;\n\n      if (stream != state.thisLine.stream) {\n        state.header = 0;\n        state.hr = false;\n\n        if (stream.match(/^\\s*$/, true)) {\n          blankLine(state);\n          return null;\n        }\n\n        state.prevLine = state.thisLine\n        state.thisLine = {stream: stream}\n\n        // Reset state.taskList\n        state.taskList = false;\n\n        // Reset state.trailingSpace\n        state.trailingSpace = 0;\n        state.trailingSpaceNewLine = false;\n\n        if (!state.localState) {\n          state.f = state.block;\n          if (state.f != htmlBlock) {\n            var indentation = stream.match(/^\\s*/, true)[0].replace(/\\t/g, expandedTab).length;\n            state.indentation = indentation;\n            state.indentationDiff = null;\n            if (indentation > 0) return null;\n          }\n        }\n      }\n      return state.f(stream, state);\n    },\n\n    innerMode: function(state) {\n      if (state.block == htmlBlock) return {state: state.htmlState, mode: htmlMode};\n      if (state.localState) return {state: state.localState, mode: state.localMode};\n      return {state: state, mode: mode};\n    },\n\n    indent: function(state, textAfter, line) {\n      if (state.block == htmlBlock && htmlMode.indent) return htmlMode.indent(state.htmlState, textAfter, line)\n      if (state.localState && state.localMode.indent) return state.localMode.indent(state.localState, textAfter, line)\n      return CodeMirror.Pass\n    },\n\n    blankLine: blankLine,\n\n    getType: getType,\n\n    blockCommentStart: \"<!--\",\n    blockCommentEnd: \"-->\",\n    closeBrackets: \"()[]{}''\\\"\\\"``\",\n    fold: \"markdown\"\n  };\n  return mode;\n}, \"xml\");\n\nCodeMirror.defineMIME(\"text/markdown\", \"markdown\");\n\nCodeMirror.defineMIME(\"text/x-markdown\", \"markdown\");\n\n});\n"
  },
  {
    "path": "libs/codemirror/python-hint.js",
    "content": "(function () {\n  function forEach(arr, f) {\n    for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);\n  }\n\n  function arrayContains(arr, item) {\n    if (!Array.prototype.indexOf) {\n      var i = arr.length;\n      while (i--) {\n        if (arr[i] === item) {\n          return true;\n        }\n      }\n      return false;\n    }\n    return arr.indexOf(item) != -1;\n  }\n\n  function scriptHint(editor, _keywords, getToken) {\n    // Find the token at the cursor\n    var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token;\n    // If it's not a 'word-style' token, ignore the token.\n\n    if (!/^[\\w$_]*$/.test(token.string)) {\n        token = tprop = {start: cur.ch, end: cur.ch, string: \"\", state: token.state,\n                         className: token.string == \":\" ? \"python-type\" : null};\n    }\n\n    if (!context) var context = [];\n    context.push(tprop);\n\n    var completionList = getCompletions(token, context);\n    completionList = completionList.sort();\n    //prevent autocomplete for last word, instead show dropdown with one word\n    if(completionList.length == 1) {\n      completionList.push(\" \");\n    }\n\n    return {list: completionList,\n            from: CodeMirror.Pos(cur.line, token.start),\n            to: CodeMirror.Pos(cur.line, token.end)};\n  }\n\n  CodeMirror.pythonHint = function(editor) {\n    return scriptHint(editor, pythonKeywordsU, function (e, cur) {return e.getTokenAt(cur);});\n  };\n\n  var pythonKeywords = \"and del from not while as elif global or with assert else if pass yield\"\n+ \"break except import print class exec in raise continue finally is return def for lambda try\";\n  var pythonKeywordsL = pythonKeywords.split(\" \");\n  var pythonKeywordsU = pythonKeywords.toUpperCase().split(\" \");\n\n  var pythonBuiltins = \"abs divmod input open staticmethod all enumerate int ord str \"\n+ \"any eval isinstance pow sum basestring execfile issubclass print super\"\n+ \"bin file iter property tuple bool filter len range type\"\n+ \"bytearray float list raw_input unichr callable format locals reduce unicode\"\n+ \"chr frozenset long reload vars classmethod getattr map repr xrange\"\n+ \"cmp globals max reversed zip compile hasattr memoryview round __import__\"\n+ \"complex hash min set apply delattr help next setattr buffer\"\n+ \"dict hex object slice coerce dir id oct sorted intern \";\n  var pythonBuiltinsL = pythonBuiltins.split(\" \").join(\"() \").split(\" \");\n  var pythonBuiltinsU = pythonBuiltins.toUpperCase().split(\" \").join(\"() \").split(\" \");\n\n  function getCompletions(token, context) {\n    var found = [], start = token.string;\n    function maybeAdd(str) {\n      if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str);\n    }\n\n    function gatherCompletions(_obj) {\n        forEach(pythonBuiltinsL, maybeAdd);\n        forEach(pythonBuiltinsU, maybeAdd);\n        forEach(pythonKeywordsL, maybeAdd);\n        forEach(pythonKeywordsU, maybeAdd);\n    }\n\n    if (context) {\n      // If this is a property, see if it belongs to some object we can\n      // find in the current environment.\n      var obj = context.pop(), base;\n\n      if (obj.type == \"variable\")\n          base = obj.string;\n      else if(obj.type == \"variable-3\")\n          base = \":\" + obj.string;\n\n      while (base != null && context.length)\n        base = base[context.pop().string];\n      if (base != null) gatherCompletions(base);\n    }\n    return found;\n  }\n})();\n"
  },
  {
    "path": "libs/codemirror/python.js",
    "content": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n    if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n    {mod(require(\"../../lib/codemirror\"));} else if (typeof define == \"function\" && define.amd) // AMD\n    {define([\"../../lib/codemirror\"], mod);} else // Plain browser env\n    {mod(CodeMirror);}\n})(function(CodeMirror) {\n    \"use strict\";\n\n    function wordRegexp(words) {\n        return new RegExp(\"^((\" + words.join(\")|(\") + \"))\\\\b\");\n    }\n\n    var wordOperators = wordRegexp([\"and\", \"or\", \"not\", \"is\"]);\n    var commonKeywords = [\"as\", \"assert\", \"break\", \"class\", \"continue\",\n                          \"def\", \"del\", \"elif\", \"else\", \"except\", \"finally\",\n                          \"for\", \"from\", \"global\", \"if\", \"import\",\n                          \"lambda\", \"pass\", \"raise\", \"return\",\n                          \"try\", \"while\", \"with\", \"yield\", \"in\"];\n    var commonBuiltins = [\"abs\", \"all\", \"any\", \"bin\", \"bool\", \"bytearray\", \"callable\", \"chr\",\n                          \"classmethod\", \"compile\", \"complex\", \"delattr\", \"dict\", \"dir\", \"divmod\",\n                          \"enumerate\", \"eval\", \"filter\", \"float\", \"format\", \"frozenset\",\n                          \"getattr\", \"globals\", \"hasattr\", \"hash\", \"help\", \"hex\", \"id\",\n                          \"input\", \"int\", \"isinstance\", \"issubclass\", \"iter\", \"len\",\n                          \"list\", \"locals\", \"map\", \"max\", \"memoryview\", \"min\", \"next\",\n                          \"object\", \"oct\", \"open\", \"ord\", \"pow\", \"property\", \"range\",\n                          \"repr\", \"reversed\", \"round\", \"set\", \"setattr\", \"slice\",\n                          \"sorted\", \"staticmethod\", \"str\", \"sum\", \"super\", \"tuple\",\n                          \"type\", \"vars\", \"zip\", \"__import__\", \"NotImplemented\",\n                          \"Ellipsis\", \"__debug__\"];\n    CodeMirror.registerHelper(\"hintWords\", \"python\", commonKeywords.concat(commonBuiltins));\n\n    function top(state) {\n        return state.scopes[state.scopes.length - 1];\n    }\n\n    CodeMirror.defineMode(\"python\", function(conf, parserConf) {\n        var ERRORCLASS = \"error\";\n\n        var delimiters = parserConf.delimiters || parserConf.singleDelimiters || /^[\\(\\)\\[\\]\\{\\}@,:`=;\\.\\\\]/;\n        //               (Backwards-compatibility with old, cumbersome config system)\n        var operators = [parserConf.singleOperators, parserConf.doubleOperators, parserConf.doubleDelimiters, parserConf.tripleDelimiters,\n                         parserConf.operators || /^([-+*/%\\/&|^]=?|[<>=]+|\\/\\/=?|\\*\\*=?|!=|[~!@]|\\.\\.\\.)/];\n        for (var i = 0; i < operators.length; i++) {if (!operators[i]) {operators.splice(i--, 1);}}\n\n        var hangingIndent = parserConf.hangingIndent || conf.indentUnit;\n\n        var myKeywords = commonKeywords, myBuiltins = commonBuiltins;\n        if (parserConf.extra_keywords != undefined) {myKeywords = myKeywords.concat(parserConf.extra_keywords);}\n\n        if (parserConf.extra_builtins != undefined) {myBuiltins = myBuiltins.concat(parserConf.extra_builtins);}\n\n        var py3 = !(parserConf.version && Number(parserConf.version) < 3);\n        if (py3) {\n            // since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator\n            var identifiers = parserConf.identifiers|| /^[_A-Za-z\\u00A1-\\uFFFF][_A-Za-z0-9\\u00A1-\\uFFFF]*/;\n            myKeywords = myKeywords.concat([\"nonlocal\", \"False\", \"True\", \"None\", \"async\", \"await\"]);\n            myBuiltins = myBuiltins.concat([\"ascii\", \"bytes\", \"exec\", \"print\"]);\n            var stringPrefixes = new RegExp(\"^(([rbuf]|(br)|(rb)|(fr)|(rf))?('{3}|\\\"{3}|['\\\"]))\", \"i\");\n        } else {\n            var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*/;\n            myKeywords = myKeywords.concat([\"exec\", \"print\"]);\n            myBuiltins = myBuiltins.concat([\"apply\", \"basestring\", \"buffer\", \"cmp\", \"coerce\", \"execfile\",\n                                            \"file\", \"intern\", \"long\", \"raw_input\", \"reduce\", \"reload\",\n                                            \"unichr\", \"unicode\", \"xrange\", \"False\", \"True\", \"None\"]);\n            var stringPrefixes = new RegExp(\"^(([rubf]|(ur)|(br))?('{3}|\\\"{3}|['\\\"]))\", \"i\");\n        }\n        var keywords = wordRegexp(myKeywords);\n        var builtins = wordRegexp(myBuiltins);\n\n        // tokenizers\n        function tokenBase(stream, state) {\n            var sol = stream.sol() && state.lastToken != \"\\\\\";\n            if (sol) {state.indent = stream.indentation();}\n            // Handle scope changes\n            if (sol && top(state).type == \"py\") {\n                var scopeOffset = top(state).offset;\n                if (stream.eatSpace()) {\n                    var lineOffset = stream.indentation();\n                    if (lineOffset > scopeOffset) {pushPyScope(state);} else if (lineOffset < scopeOffset && dedent(stream, state) && stream.peek() != \"#\") {state.errorToken = true;}\n                    return null;\n                } else {\n                    var style = tokenBaseInner(stream, state);\n                    if (scopeOffset > 0 && dedent(stream, state)) {style += \" \" + ERRORCLASS;}\n                    return style;\n                }\n            }\n            return tokenBaseInner(stream, state);\n        }\n\n        function tokenBaseInner(stream, state, inFormat) {\n            if (stream.eatSpace()) {return null;}\n\n            // Handle Comments\n            if (!inFormat && stream.match(/^#.*/)) {return \"comment\";}\n\n            // Handle Number Literals\n            if (stream.match(/^[0-9\\.]/, false)) {\n                var floatLiteral = false;\n                // Floats\n                if (stream.match(/^[\\d_]*\\.\\d+(e[\\+\\-]?\\d+)?/i)) { floatLiteral = true; }\n                if (stream.match(/^[\\d_]+\\.\\d*/)) { floatLiteral = true; }\n                if (stream.match(/^\\.\\d+/)) { floatLiteral = true; }\n                if (floatLiteral) {\n                    // Float literals may be \"imaginary\"\n                    stream.eat(/J/i);\n                    return \"number\";\n                }\n                // Integers\n                var intLiteral = false;\n                // Hex\n                if (stream.match(/^0x[0-9a-f_]+/i)) {intLiteral = true;}\n                // Binary\n                if (stream.match(/^0b[01_]+/i)) {intLiteral = true;}\n                // Octal\n                if (stream.match(/^0o[0-7_]+/i)) {intLiteral = true;}\n                // Decimal\n                if (stream.match(/^[1-9][\\d_]*(e[\\+\\-]?[\\d_]+)?/)) {\n                    // Decimal literals may be \"imaginary\"\n                    stream.eat(/J/i);\n                    // TODO - Can you have imaginary longs?\n                    intLiteral = true;\n                }\n                // Zero by itself with no other piece of number.\n                if (stream.match(/^0(?![\\dx])/i)) {intLiteral = true;}\n                if (intLiteral) {\n                    // Integer literals may be \"long\"\n                    stream.eat(/L/i);\n                    return \"number\";\n                }\n            }\n\n            // Handle Strings\n            if (stream.match(stringPrefixes)) {\n                var isFmtString = stream.current().toLowerCase().indexOf(\"f\") !== -1;\n                if (!isFmtString) {\n                    state.tokenize = tokenStringFactory(stream.current(), state.tokenize);\n                    return state.tokenize(stream, state);\n                } else {\n                    state.tokenize = formatStringFactory(stream.current(), state.tokenize);\n                    return state.tokenize(stream, state);\n                }\n            }\n\n            for (var i = 0; i < operators.length; i++) {if (stream.match(operators[i])) {return \"operator\";}}\n\n            if (stream.match(delimiters)) {return \"punctuation\";}\n\n            if (state.lastToken == \".\" && stream.match(identifiers)) {return \"property\";}\n\n            if (stream.match(keywords) || stream.match(wordOperators)) {return \"keyword\";}\n\n            if (stream.match(builtins)) {return \"builtin\";}\n\n            if (stream.match(/^(self|cls)\\b/)) {return \"variable-2\";}\n\n            if (stream.match(identifiers)) {\n                if (state.lastToken == \"def\" || state.lastToken == \"class\") {return \"def\";}\n                return \"variable\";\n            }\n\n            // Handle non-detected items\n            stream.next();\n            return inFormat ? null :ERRORCLASS;\n        }\n\n        function formatStringFactory(delimiter, tokenOuter) {\n            while (\"rubf\".indexOf(delimiter.charAt(0).toLowerCase()) >= 0) {delimiter = delimiter.substr(1);}\n\n            var singleline = delimiter.length == 1;\n            var OUTCLASS = \"string\";\n\n            function tokenNestedExpr(depth) {\n                return function(stream, state) {\n                    var inner = tokenBaseInner(stream, state, true);\n                    if (inner == \"punctuation\") {\n                        if (stream.current() == \"{\") {\n                            state.tokenize = tokenNestedExpr(depth + 1);\n                        } else if (stream.current() == \"}\") {\n                            if (depth > 1) {state.tokenize = tokenNestedExpr(depth - 1);} else {state.tokenize = tokenString;}\n                        }\n                    }\n                    return inner;\n                };\n            }\n\n            function tokenString(stream, state) {\n                while (!stream.eol()) {\n                    stream.eatWhile(/[^'\"\\{\\}\\\\]/);\n                    if (stream.eat(\"\\\\\")) {\n                        stream.next();\n                        if (singleline && stream.eol()) {return OUTCLASS;}\n                    } else if (stream.match(delimiter)) {\n                        state.tokenize = tokenOuter;\n                        return OUTCLASS;\n                    } else if (stream.match(\"{{\")) {\n                        // ignore {{ in f-str\n                        return OUTCLASS;\n                    } else if (stream.match(\"{\", false)) {\n                        // switch to nested mode\n                        state.tokenize = tokenNestedExpr(0);\n                        if (stream.current()) {return OUTCLASS;} else {return state.tokenize(stream, state);}\n                    } else if (stream.match(\"}}\")) {\n                        return OUTCLASS;\n                    } else if (stream.match(\"}\")) {\n                        // single } in f-string is an error\n                        return ERRORCLASS;\n                    } else {\n                        stream.eat(/['\"]/);\n                    }\n                }\n                if (singleline) {\n                    if (parserConf.singleLineStringErrors) {return ERRORCLASS;} else {state.tokenize = tokenOuter;}\n                }\n                return OUTCLASS;\n            }\n            tokenString.isString = true;\n            return tokenString;\n        }\n\n        function tokenStringFactory(delimiter, tokenOuter) {\n            while (\"rubf\".indexOf(delimiter.charAt(0).toLowerCase()) >= 0) {delimiter = delimiter.substr(1);}\n\n            var singleline = delimiter.length == 1;\n            var OUTCLASS = \"string\";\n\n            function tokenString(stream, state) {\n                while (!stream.eol()) {\n                    stream.eatWhile(/[^'\"\\\\]/);\n                    if (stream.eat(\"\\\\\")) {\n                        stream.next();\n                        if (singleline && stream.eol()) {return OUTCLASS;}\n                    } else if (stream.match(delimiter)) {\n                        state.tokenize = tokenOuter;\n                        return OUTCLASS;\n                    } else {\n                        stream.eat(/['\"]/);\n                    }\n                }\n                if (singleline) {\n                    if (parserConf.singleLineStringErrors) {return ERRORCLASS;} else {state.tokenize = tokenOuter;}\n                }\n                return OUTCLASS;\n            }\n            tokenString.isString = true;\n            return tokenString;\n        }\n\n        function pushPyScope(state) {\n            while (top(state).type != \"py\") {state.scopes.pop();}\n            state.scopes.push({offset: top(state).offset + conf.indentUnit,\n                type: \"py\",\n                align: null});\n        }\n\n        function pushBracketScope(stream, state, type) {\n            var align = stream.match(/^[\\s\\[\\{\\(]*(?:#|$)/, false) ? null : stream.column() + 1;\n            state.scopes.push({offset: state.indent + hangingIndent,\n                type: type,\n                align: align});\n        }\n\n        function dedent(stream, state) {\n            var indented = stream.indentation();\n            while (state.scopes.length > 1 && top(state).offset > indented) {\n                if (top(state).type != \"py\") {return true;}\n                state.scopes.pop();\n            }\n            return top(state).offset != indented;\n        }\n\n        function tokenLexer(stream, state) {\n            if (stream.sol()) {\n                state.beginningOfLine = true;\n                state.dedent = false;\n            }\n\n            var style = state.tokenize(stream, state);\n            var current = stream.current();\n\n            // Handle decorators\n            if (state.beginningOfLine && current == \"@\") {return stream.match(identifiers, false) ? \"meta\" : py3 ? \"operator\" : ERRORCLASS;}\n\n            if (/\\S/.test(current)) {state.beginningOfLine = false;}\n\n            if ((style == \"variable\" || style == \"builtin\")\n          && state.lastToken == \"meta\") {style = \"meta\";}\n\n            // Handle scope changes.\n            if (current == \"pass\" || current == \"return\") {state.dedent = true;}\n\n            if (current == \"lambda\") {state.lambda = true;}\n            if (current == \":\" && !state.lambda && top(state).type == \"py\" && stream.match(/^\\s*(?:#|$)/, false)) {pushPyScope(state);}\n\n            if (current.length == 1 && !/string|comment/.test(style)) {\n                var delimiter_index = \"[({\".indexOf(current);\n                if (delimiter_index != -1) {pushBracketScope(stream, state, \"])}\".slice(delimiter_index, delimiter_index+1));}\n\n                delimiter_index = \"])}\".indexOf(current);\n                if (delimiter_index != -1) {\n                    if (top(state).type == current) {state.indent = state.scopes.pop().offset - hangingIndent;} else {return ERRORCLASS;}\n                }\n            }\n            if (state.dedent && stream.eol() && top(state).type == \"py\" && state.scopes.length > 1) {state.scopes.pop();}\n\n            return style;\n        }\n\n        var external = {\n            startState: function(basecolumn) {\n                return {\n                    tokenize: tokenBase,\n                    scopes: [{offset: basecolumn || 0, type: \"py\", align: null}],\n                    indent: basecolumn || 0,\n                    lastToken: null,\n                    lambda: false,\n                    dedent: 0\n                };\n            },\n\n            token: function(stream, state) {\n                var addErr = state.errorToken;\n                if (addErr) {state.errorToken = false;}\n                var style = tokenLexer(stream, state);\n\n                if (style && style != \"comment\") {state.lastToken = (style == \"keyword\" || style == \"punctuation\") ? stream.current() : style;}\n                if (style == \"punctuation\") {style = null;}\n\n                if (stream.eol() && state.lambda) {state.lambda = false;}\n                return addErr ? style + \" \" + ERRORCLASS : style;\n            },\n\n            indent: function(state, textAfter) {\n                if (state.tokenize != tokenBase) {return state.tokenize.isString ? CodeMirror.Pass : 0;}\n\n                var scope = top(state);\n                var closing = scope.type == textAfter.charAt(0) ||\n            scope.type == \"py\" && !state.dedent && /^(else:|elif |except |finally:)/.test(textAfter);\n                if (scope.align != null) {return scope.align - (closing ? 1 : 0);} else {return scope.offset - (closing ? hangingIndent : 0);}\n            },\n\n            electricInput: /^\\s*([\\}\\]\\)]|else:|elif |except |finally:)$/,\n            closeBrackets: {triples: \"'\\\"\"},\n            lineComment: \"#\",\n            fold: \"indent\"\n        };\n        return external;\n    });\n\n    CodeMirror.defineMIME(\"text/x-python\", \"python\");\n\n    var words = function(str) { return str.split(\" \"); };\n\n    CodeMirror.defineMIME(\"text/x-cython\", {\n        name: \"python\",\n        extra_keywords: words(\"by cdef cimport cpdef ctypedef enum except \"+\n                          \"extern gil include nogil property public \"+\n                          \"readonly struct union DEF IF ELIF ELSE\")\n    });\n\n});"
  },
  {
    "path": "libs/codemirror/shell.js",
    "content": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n  if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n    mod(require(\"../../lib/codemirror\"));\n  else if (typeof define == \"function\" && define.amd) // AMD\n    define([\"../../lib/codemirror\"], mod);\n  else // Plain browser env\n    mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode('shell', function() {\n\n  var words = {};\n  function define(style, dict) {\n    for(var i = 0; i < dict.length; i++) {\n      words[dict[i]] = style;\n    }\n  };\n\n  var commonAtoms = [\"true\", \"false\"];\n  var commonKeywords = [\"if\", \"then\", \"do\", \"else\", \"elif\", \"while\", \"until\", \"for\", \"in\", \"esac\", \"fi\",\n    \"fin\", \"fil\", \"done\", \"exit\", \"set\", \"unset\", \"export\", \"function\"];\n  var commonCommands = [\"ab\", \"awk\", \"bash\", \"beep\", \"cat\", \"cc\", \"cd\", \"chown\", \"chmod\", \"chroot\", \"clear\",\n    \"cp\", \"curl\", \"cut\", \"diff\", \"echo\", \"find\", \"gawk\", \"gcc\", \"get\", \"git\", \"grep\", \"hg\", \"kill\", \"killall\",\n    \"ln\", \"ls\", \"make\", \"mkdir\", \"openssl\", \"mv\", \"nc\", \"nl\", \"node\", \"npm\", \"ping\", \"ps\", \"restart\", \"rm\",\n    \"rmdir\", \"sed\", \"service\", \"sh\", \"shopt\", \"shred\", \"source\", \"sort\", \"sleep\", \"ssh\", \"start\", \"stop\",\n    \"su\", \"sudo\", \"svn\", \"tee\", \"telnet\", \"top\", \"touch\", \"vi\", \"vim\", \"wall\", \"wc\", \"wget\", \"who\", \"write\",\n    \"yes\", \"zsh\"];\n\n  CodeMirror.registerHelper(\"hintWords\", \"shell\", commonAtoms.concat(commonKeywords, commonCommands));\n\n  define('atom', commonAtoms);\n  define('keyword', commonKeywords);\n  define('builtin', commonCommands);\n\n  function tokenBase(stream, state) {\n    if (stream.eatSpace()) return null;\n\n    var sol = stream.sol();\n    var ch = stream.next();\n\n    if (ch === '\\\\') {\n      stream.next();\n      return null;\n    }\n    if (ch === '\\'' || ch === '\"' || ch === '`') {\n      state.tokens.unshift(tokenString(ch, ch === \"`\" ? \"quote\" : \"string\"));\n      return tokenize(stream, state);\n    }\n    if (ch === '#') {\n      if (sol && stream.eat('!')) {\n        stream.skipToEnd();\n        return 'meta'; // 'comment'?\n      }\n      stream.skipToEnd();\n      return 'comment';\n    }\n    if (ch === '$') {\n      state.tokens.unshift(tokenDollar);\n      return tokenize(stream, state);\n    }\n    if (ch === '+' || ch === '=') {\n      return 'operator';\n    }\n    if (ch === '-') {\n      stream.eat('-');\n      stream.eatWhile(/\\w/);\n      return 'attribute';\n    }\n    if (/\\d/.test(ch)) {\n      stream.eatWhile(/\\d/);\n      if(stream.eol() || !/\\w/.test(stream.peek())) {\n        return 'number';\n      }\n    }\n    stream.eatWhile(/[\\w-]/);\n    var cur = stream.current();\n    if (stream.peek() === '=' && /\\w+/.test(cur)) return 'def';\n    return words.hasOwnProperty(cur) ? words[cur] : null;\n  }\n\n  function tokenString(quote, style) {\n    var close = quote == \"(\" ? \")\" : quote == \"{\" ? \"}\" : quote\n    return function(stream, state) {\n      var next, escaped = false;\n      while ((next = stream.next()) != null) {\n        if (next === close && !escaped) {\n          state.tokens.shift();\n          break;\n        } else if (next === '$' && !escaped && quote !== \"'\" && stream.peek() != close) {\n          escaped = true;\n          stream.backUp(1);\n          state.tokens.unshift(tokenDollar);\n          break;\n        } else if (!escaped && quote !== close && next === quote) {\n          state.tokens.unshift(tokenString(quote, style))\n          return tokenize(stream, state)\n        } else if (!escaped && /['\"]/.test(next) && !/['\"]/.test(quote)) {\n          state.tokens.unshift(tokenStringStart(next, \"string\"));\n          stream.backUp(1);\n          break;\n        }\n        escaped = !escaped && next === '\\\\';\n      }\n      return style;\n    };\n  };\n\n  function tokenStringStart(quote, style) {\n    return function(stream, state) {\n      state.tokens[0] = tokenString(quote, style)\n      stream.next()\n      return tokenize(stream, state)\n    }\n  }\n\n  var tokenDollar = function(stream, state) {\n    if (state.tokens.length > 1) stream.eat('$');\n    var ch = stream.next()\n    if (/['\"({]/.test(ch)) {\n      state.tokens[0] = tokenString(ch, ch == \"(\" ? \"quote\" : ch == \"{\" ? \"def\" : \"string\");\n      return tokenize(stream, state);\n    }\n    if (!/\\d/.test(ch)) stream.eatWhile(/\\w/);\n    state.tokens.shift();\n    return 'def';\n  };\n\n  function tokenize(stream, state) {\n    return (state.tokens[0] || tokenBase) (stream, state);\n  };\n\n  return {\n    startState: function() {return {tokens:[]};},\n    token: function(stream, state) {\n      return tokenize(stream, state);\n    },\n    closeBrackets: \"()[]{}''\\\"\\\"``\",\n    lineComment: '#',\n    fold: \"brace\"\n  };\n});\n\nCodeMirror.defineMIME('text/x-sh', 'shell');\n// Apache uses a slightly different Media Type for Shell scripts\n// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types\nCodeMirror.defineMIME('application/x-sh', 'shell');\n\n});\n"
  },
  {
    "path": "libs/codemirror/show-hint.css",
    "content": ".CodeMirror-hints {\n  position: absolute;\n  z-index: 10;\n  overflow: hidden;\n  list-style: none;\n\n  margin: 0;\n  padding: 2px;\n\n  -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n  -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n  box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n  border-radius: 3px;\n  border: 1px solid silver;\n\n  background: white;\n  font-size: 90%;\n  font-family: monospace;\n\n  max-height: 20em;\n  overflow-y: auto;\n}\n\n.CodeMirror-hint {\n  margin: 0;\n  padding: 0 4px;\n  border-radius: 2px;\n  white-space: pre;\n  color: black;\n  cursor: pointer;\n}\n\nli.CodeMirror-hint-active {\n  background: #08f;\n  color: white;\n}\n"
  },
  {
    "path": "libs/codemirror/show-hint.js",
    "content": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n  if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n    mod(require(\"../../lib/codemirror\"));\n  else if (typeof define == \"function\" && define.amd) // AMD\n    define([\"../../lib/codemirror\"], mod);\n  else // Plain browser env\n    mod(CodeMirror);\n})(function(CodeMirror) {\n  \"use strict\";\n\n  var HINT_ELEMENT_CLASS        = \"CodeMirror-hint\";\n  var ACTIVE_HINT_ELEMENT_CLASS = \"CodeMirror-hint-active\";\n\n  // This is the old interface, kept around for now to stay\n  // backwards-compatible.\n  CodeMirror.showHint = function(cm, getHints, options) {\n    if (!getHints) return cm.showHint(options);\n    if (options && options.async) getHints.async = true;\n    var newOpts = {hint: getHints};\n    if (options) for (var prop in options) newOpts[prop] = options[prop];\n    return cm.showHint(newOpts);\n  };\n\n  CodeMirror.defineExtension(\"showHint\", function(options) {\n    options = parseOptions(this, this.getCursor(\"start\"), options);\n    var selections = this.listSelections()\n    if (selections.length > 1) return;\n    // By default, don't allow completion when something is selected.\n    // A hint function can have a `supportsSelection` property to\n    // indicate that it can handle selections.\n    if (this.somethingSelected()) {\n      if (!options.hint.supportsSelection) return;\n      // Don't try with cross-line selections\n      for (var i = 0; i < selections.length; i++)\n        if (selections[i].head.line != selections[i].anchor.line) return;\n    }\n\n    if (this.state.completionActive) this.state.completionActive.close();\n    var completion = this.state.completionActive = new Completion(this, options);\n    if (!completion.options.hint) return;\n\n    CodeMirror.signal(this, \"startCompletion\", this);\n    completion.update(true);\n  });\n\n  CodeMirror.defineExtension(\"closeHint\", function() {\n    if (this.state.completionActive) this.state.completionActive.close()\n  })\n\n  function Completion(cm, options) {\n    this.cm = cm;\n    this.options = options;\n    this.widget = null;\n    this.debounce = 0;\n    this.tick = 0;\n    this.startPos = this.cm.getCursor(\"start\");\n    this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length;\n\n    var self = this;\n    cm.on(\"cursorActivity\", this.activityFunc = function() { self.cursorActivity(); });\n  }\n\n  var requestAnimationFrame = window.requestAnimationFrame || function(fn) {\n    return setTimeout(fn, 1000/60);\n  };\n  var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;\n\n  Completion.prototype = {\n    close: function() {\n      if (!this.active()) return;\n      this.cm.state.completionActive = null;\n      this.tick = null;\n      this.cm.off(\"cursorActivity\", this.activityFunc);\n\n      if (this.widget && this.data) CodeMirror.signal(this.data, \"close\");\n      if (this.widget) this.widget.close();\n      CodeMirror.signal(this.cm, \"endCompletion\", this.cm);\n    },\n\n    active: function() {\n      return this.cm.state.completionActive == this;\n    },\n\n    pick: function(data, i) {\n      var completion = data.list[i];\n      if (completion.hint) completion.hint(this.cm, data, completion);\n      else this.cm.replaceRange(getText(completion), completion.from || data.from,\n                                completion.to || data.to, \"complete\");\n      CodeMirror.signal(data, \"pick\", completion);\n      this.close();\n    },\n\n    cursorActivity: function() {\n      if (this.debounce) {\n        cancelAnimationFrame(this.debounce);\n        this.debounce = 0;\n      }\n\n      var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line);\n      if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch ||\n          pos.ch < this.startPos.ch || this.cm.somethingSelected() ||\n          (!pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) {\n        this.close();\n      } else {\n        var self = this;\n        this.debounce = requestAnimationFrame(function() {self.update();});\n        if (this.widget) this.widget.disable();\n      }\n    },\n\n    update: function(first) {\n      if (this.tick == null) return\n      var self = this, myTick = ++this.tick\n      fetchHints(this.options.hint, this.cm, this.options, function(data) {\n        if (self.tick == myTick) self.finishUpdate(data, first)\n      })\n    },\n\n    finishUpdate: function(data, first) {\n      if (this.data) CodeMirror.signal(this.data, \"update\");\n\n      var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle);\n      if (this.widget) this.widget.close();\n\n      this.data = data;\n\n      if (data && data.list.length) {\n        if (picked && data.list.length == 1) {\n          this.pick(data, 0);\n        } else {\n          this.widget = new Widget(this, data);\n          CodeMirror.signal(data, \"shown\");\n        }\n      }\n    }\n  };\n\n  function parseOptions(cm, pos, options) {\n    var editor = cm.options.hintOptions;\n    var out = {};\n    for (var prop in defaultOptions) out[prop] = defaultOptions[prop];\n    if (editor) for (var prop in editor)\n      if (editor[prop] !== undefined) out[prop] = editor[prop];\n    if (options) for (var prop in options)\n      if (options[prop] !== undefined) out[prop] = options[prop];\n    if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos)\n    return out;\n  }\n\n  function getText(completion) {\n    if (typeof completion == \"string\") return completion;\n    else return completion.text;\n  }\n\n  function buildKeyMap(completion, handle) {\n    var baseMap = {\n      Up: function() {handle.moveFocus(-1);},\n      Down: function() {handle.moveFocus(1);},\n      PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);},\n      PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);},\n      Home: function() {handle.setFocus(0);},\n      End: function() {handle.setFocus(handle.length - 1);},\n      Enter: handle.pick,\n      Tab: handle.pick,\n      Esc: handle.close\n    };\n\n    var mac = /Mac/.test(navigator.platform);\n\n    if (mac) {\n      baseMap[\"Ctrl-P\"] = function() {handle.moveFocus(-1);};\n      baseMap[\"Ctrl-N\"] = function() {handle.moveFocus(1);};\n    }\n\n    var custom = completion.options.customKeys;\n    var ourMap = custom ? {} : baseMap;\n    function addBinding(key, val) {\n      var bound;\n      if (typeof val != \"string\")\n        bound = function(cm) { return val(cm, handle); };\n      // This mechanism is deprecated\n      else if (baseMap.hasOwnProperty(val))\n        bound = baseMap[val];\n      else\n        bound = val;\n      ourMap[key] = bound;\n    }\n    if (custom)\n      for (var key in custom) if (custom.hasOwnProperty(key))\n        addBinding(key, custom[key]);\n    var extra = completion.options.extraKeys;\n    if (extra)\n      for (var key in extra) if (extra.hasOwnProperty(key))\n        addBinding(key, extra[key]);\n    return ourMap;\n  }\n\n  function getHintElement(hintsElement, el) {\n    while (el && el != hintsElement) {\n      if (el.nodeName.toUpperCase() === \"LI\" && el.parentNode == hintsElement) return el;\n      el = el.parentNode;\n    }\n  }\n\n  function Widget(completion, data) {\n    this.completion = completion;\n    this.data = data;\n    this.picked = false;\n    var widget = this, cm = completion.cm;\n    var ownerDocument = cm.getInputField().ownerDocument;\n    var parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow;\n\n    var hints = this.hints = ownerDocument.createElement(\"ul\");\n    var theme = completion.cm.options.theme;\n    hints.className = \"CodeMirror-hints \" + theme;\n    this.selectedHint = data.selectedHint || 0;\n\n    var completions = data.list;\n    for (var i = 0; i < completions.length; ++i) {\n      var elt = hints.appendChild(ownerDocument.createElement(\"li\")), cur = completions[i];\n      var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? \"\" : \" \" + ACTIVE_HINT_ELEMENT_CLASS);\n      if (cur.className != null) className = cur.className + \" \" + className;\n      elt.className = className;\n      if (cur.render) cur.render(elt, data, cur);\n      else elt.appendChild(ownerDocument.createTextNode(cur.displayText || getText(cur)));\n      elt.hintId = i;\n    }\n\n    var container = completion.options.container || ownerDocument.body;\n    var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null);\n    var left = pos.left, top = pos.bottom, below = true;\n    var offsetLeft = 0, offsetTop = 0;\n    if (container !== ownerDocument.body) {\n      // We offset the cursor position because left and top are relative to the offsetParent's top left corner.\n      var isContainerPositioned = ['absolute', 'relative', 'fixed'].indexOf(parentWindow.getComputedStyle(container).position) !== -1;\n      var offsetParent = isContainerPositioned ? container : container.offsetParent;\n      var offsetParentPosition = offsetParent.getBoundingClientRect();\n      var bodyPosition = ownerDocument.body.getBoundingClientRect();\n      offsetLeft = (offsetParentPosition.left - bodyPosition.left - offsetParent.scrollLeft);\n      offsetTop = (offsetParentPosition.top - bodyPosition.top - offsetParent.scrollTop);\n    }\n    hints.style.left = (left - offsetLeft) + \"px\";\n    hints.style.top = (top - offsetTop) + \"px\";\n\n    // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.\n    var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth);\n    var winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight);\n    container.appendChild(hints);\n    var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH;\n    var scrolls = hints.scrollHeight > hints.clientHeight + 1\n    var startScroll = cm.getScrollInfo();\n\n    if (overlapY > 0) {\n      var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);\n      if (curTop - height > 0) { // Fits above cursor\n        hints.style.top = (top = pos.top - height - offsetTop) + \"px\";\n        below = false;\n      } else if (height > winH) {\n        hints.style.height = (winH - 5) + \"px\";\n        hints.style.top = (top = pos.bottom - box.top - offsetTop) + \"px\";\n        var cursor = cm.getCursor();\n        if (data.from.ch != cursor.ch) {\n          pos = cm.cursorCoords(cursor);\n          hints.style.left = (left = pos.left - offsetLeft) + \"px\";\n          box = hints.getBoundingClientRect();\n        }\n      }\n    }\n    var overlapX = box.right - winW;\n    if (overlapX > 0) {\n      if (box.right - box.left > winW) {\n        hints.style.width = (winW - 5) + \"px\";\n        overlapX -= (box.right - box.left) - winW;\n      }\n      hints.style.left = (left = pos.left - overlapX - offsetLeft) + \"px\";\n    }\n    if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling)\n      node.style.paddingRight = cm.display.nativeBarWidth + \"px\"\n\n    cm.addKeyMap(this.keyMap = buildKeyMap(completion, {\n      moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },\n      setFocus: function(n) { widget.changeActive(n); },\n      menuSize: function() { return widget.screenAmount(); },\n      length: completions.length,\n      close: function() { completion.close(); },\n      pick: function() { widget.pick(); },\n      data: data\n    }));\n\n    if (completion.options.closeOnUnfocus) {\n      var closingOnBlur;\n      cm.on(\"blur\", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); });\n      cm.on(\"focus\", this.onFocus = function() { clearTimeout(closingOnBlur); });\n    }\n\n    cm.on(\"scroll\", this.onScroll = function() {\n      var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();\n      var newTop = top + startScroll.top - curScroll.top;\n      var point = newTop - (parentWindow.pageYOffset || (ownerDocument.documentElement || ownerDocument.body).scrollTop);\n      if (!below) point += hints.offsetHeight;\n      if (point <= editor.top || point >= editor.bottom) return completion.close();\n      hints.style.top = newTop + \"px\";\n      hints.style.left = (left + startScroll.left - curScroll.left) + \"px\";\n    });\n\n    CodeMirror.on(hints, \"dblclick\", function(e) {\n      var t = getHintElement(hints, e.target || e.srcElement);\n      if (t && t.hintId != null) {widget.changeActive(t.hintId); widget.pick();}\n    });\n\n    CodeMirror.on(hints, \"click\", function(e) {\n      var t = getHintElement(hints, e.target || e.srcElement);\n      if (t && t.hintId != null) {\n        widget.changeActive(t.hintId);\n        if (completion.options.completeOnSingleClick) widget.pick();\n      }\n    });\n\n    CodeMirror.on(hints, \"mousedown\", function() {\n      setTimeout(function(){cm.focus();}, 20);\n    });\n\n    CodeMirror.signal(data, \"select\", completions[this.selectedHint], hints.childNodes[this.selectedHint]);\n    return true;\n  }\n\n  Widget.prototype = {\n    close: function() {\n      if (this.completion.widget != this) return;\n      this.completion.widget = null;\n      this.hints.parentNode.removeChild(this.hints);\n      this.completion.cm.removeKeyMap(this.keyMap);\n\n      var cm = this.completion.cm;\n      if (this.completion.options.closeOnUnfocus) {\n        cm.off(\"blur\", this.onBlur);\n        cm.off(\"focus\", this.onFocus);\n      }\n      cm.off(\"scroll\", this.onScroll);\n    },\n\n    disable: function() {\n      this.completion.cm.removeKeyMap(this.keyMap);\n      var widget = this;\n      this.keyMap = {Enter: function() { widget.picked = true; }};\n      this.completion.cm.addKeyMap(this.keyMap);\n    },\n\n    pick: function() {\n      this.completion.pick(this.data, this.selectedHint);\n    },\n\n    changeActive: function(i, avoidWrap) {\n      if (i >= this.data.list.length)\n        i = avoidWrap ? this.data.list.length - 1 : 0;\n      else if (i < 0)\n        i = avoidWrap ? 0  : this.data.list.length - 1;\n      if (this.selectedHint == i) return;\n      var node = this.hints.childNodes[this.selectedHint];\n      if (node) node.className = node.className.replace(\" \" + ACTIVE_HINT_ELEMENT_CLASS, \"\");\n      node = this.hints.childNodes[this.selectedHint = i];\n      node.className += \" \" + ACTIVE_HINT_ELEMENT_CLASS;\n      if (node.offsetTop < this.hints.scrollTop)\n        this.hints.scrollTop = node.offsetTop - 3;\n      else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)\n        this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3;\n      CodeMirror.signal(this.data, \"select\", this.data.list[this.selectedHint], node);\n    },\n\n    screenAmount: function() {\n      return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;\n    }\n  };\n\n  function applicableHelpers(cm, helpers) {\n    if (!cm.somethingSelected()) return helpers\n    var result = []\n    for (var i = 0; i < helpers.length; i++)\n      if (helpers[i].supportsSelection) result.push(helpers[i])\n    return result\n  }\n\n  function fetchHints(hint, cm, options, callback) {\n    if (hint.async) {\n      hint(cm, callback, options)\n    } else {\n      var result = hint(cm, options)\n      if (result && result.then) result.then(callback)\n      else callback(result)\n    }\n  }\n\n  function resolveAutoHints(cm, pos) {\n    var helpers = cm.getHelpers(pos, \"hint\"), words\n    if (helpers.length) {\n      var resolved = function(cm, callback, options) {\n        var app = applicableHelpers(cm, helpers);\n        function run(i) {\n          if (i == app.length) return callback(null)\n          fetchHints(app[i], cm, options, function(result) {\n            if (result && result.list.length > 0) callback(result)\n            else run(i + 1)\n          })\n        }\n        run(0)\n      }\n      resolved.async = true\n      resolved.supportsSelection = true\n      return resolved\n    } else if (words = cm.getHelper(cm.getCursor(), \"hintWords\")) {\n      return function(cm) { return CodeMirror.hint.fromList(cm, {words: words}) }\n    } else if (CodeMirror.hint.anyword) {\n      return function(cm, options) { return CodeMirror.hint.anyword(cm, options) }\n    } else {\n      return function() {}\n    }\n  }\n\n  CodeMirror.registerHelper(\"hint\", \"auto\", {\n    resolve: resolveAutoHints\n  });\n\n  CodeMirror.registerHelper(\"hint\", \"fromList\", function(cm, options) {\n    var cur = cm.getCursor(), token = cm.getTokenAt(cur)\n    var term, from = CodeMirror.Pos(cur.line, token.start), to = cur\n    if (token.start < cur.ch && /\\w/.test(token.string.charAt(cur.ch - token.start - 1))) {\n      term = token.string.substr(0, cur.ch - token.start)\n    } else {\n      term = \"\"\n      from = cur\n    }\n    var found = [];\n    for (var i = 0; i < options.words.length; i++) {\n      var word = options.words[i];\n      if (word.slice(0, term.length) == term)\n        found.push(word);\n    }\n\n    if (found.length) return {list: found, from: from, to: to};\n  });\n\n  CodeMirror.commands.autocomplete = CodeMirror.showHint;\n\n  var defaultOptions = {\n    hint: CodeMirror.hint.auto,\n    completeSingle: true,\n    alignWithWord: true,\n    closeCharacters: /[\\s()\\[\\]{};:>,]/,\n    closeOnUnfocus: true,\n    completeOnSingleClick: true,\n    container: null,\n    customKeys: null,\n    extraKeys: null\n  };\n\n  CodeMirror.defineOption(\"hintOptions\", null);\n});\n"
  },
  {
    "path": "libs/codemirror/yaml-frontmatter.js",
    "content": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function (mod) {\n  if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n    mod(require(\"../../lib/codemirror\"), require(\"../yaml/yaml\"))\n  else if (typeof define == \"function\" && define.amd) // AMD\n    define([\"../../lib/codemirror\", \"../yaml/yaml\"], mod)\n  else // Plain browser env\n    mod(CodeMirror)\n})(function (CodeMirror) {\n\n  var START = 0, FRONTMATTER = 1, BODY = 2\n\n  // a mixed mode for Markdown text with an optional YAML front matter\n  CodeMirror.defineMode(\"yaml-frontmatter\", function (config, parserConfig) {\n    var yamlMode = CodeMirror.getMode(config, \"yaml\")\n    var innerMode = CodeMirror.getMode(config, parserConfig && parserConfig.base || \"gfm\")\n\n    function curMode(state) {\n      return state.state == BODY ? innerMode : yamlMode\n    }\n\n    return {\n      startState: function () {\n        return {\n          state: START,\n          inner: CodeMirror.startState(yamlMode)\n        }\n      },\n      copyState: function (state) {\n        return {\n          state: state.state,\n          inner: CodeMirror.copyState(curMode(state), state.inner)\n        }\n      },\n      token: function (stream, state) {\n        if (state.state == START) {\n          if (stream.match(/---/, false)) {\n            state.state = FRONTMATTER\n            return yamlMode.token(stream, state.inner)\n          } else {\n            state.state = BODY\n            state.inner = CodeMirror.startState(innerMode)\n            return innerMode.token(stream, state.inner)\n          }\n        } else if (state.state == FRONTMATTER) {\n          var end = stream.sol() && stream.match(/---/, false)\n          var style = yamlMode.token(stream, state.inner)\n          if (end) {\n            state.state = BODY\n            state.inner = CodeMirror.startState(innerMode)\n          }\n          return style\n        } else {\n          return innerMode.token(stream, state.inner)\n        }\n      },\n      innerMode: function (state) {\n        return {mode: curMode(state), state: state.inner}\n      },\n      blankLine: function (state) {\n        var mode = curMode(state)\n        if (mode.blankLine) return mode.blankLine(state.inner)\n      }\n    }\n  })\n});\n"
  },
  {
    "path": "libs/easymde/easymde.css",
    "content": ".CodeMirror {\n    box-sizing: border-box;\n    height: auto;\n    /*border: 1px solid #ddd;\n    border-bottom-left-radius: 4px;\n    border-bottom-right-radius: 4px;\n    padding: 10px;*/\n    font: inherit;\n    z-index: 1;\n    word-wrap: break-word;\n}\n\n.CodeMirror-scroll {\n    cursor: text;\n}\n\n.CodeMirror-fullscreen {\n    background: #fff;\n    position: fixed !important;\n    top: 50px;\n    left: 0;\n    right: 0;\n    bottom: 0;\n    height: auto;\n    z-index: 9;\n    border-right: none !important;\n    border-bottom-right-radius: 0 !important;\n}\n\n.CodeMirror-sided {\n    width: 50% !important;\n}\n\n.CodeMirror-placeholder {\n    opacity: .5;\n}\n\n.CodeMirror-focused .CodeMirror-selected {\n    background: #d9d9d9;\n}\n\n.editor-toolbar {\n    position: relative;\n    -webkit-user-select: none;\n    -moz-user-select: none;\n    -ms-user-select: none;\n    -o-user-select: none;\n    user-select: none;\n    /*\n    padding: 0 10px;\n    border-top: 1px solid #bbb;\n    border-left: 1px solid #bbb;\n    border-right: 1px solid #bbb;\n    border-top-left-radius: 4px;\n    border-top-right-radius: 4px;*/\n}\n\n.editor-toolbar:after,\n.editor-toolbar:before {\n    display: block;\n    content: ' ';\n    height: 1px;\n}\n\n.editor-toolbar:before {\n    margin-bottom: 8px\n}\n\n.editor-toolbar:after {\n    margin-top: 8px\n}\n\n.editor-toolbar.fullscreen {\n    width: 100%;\n    height: 50px;\n    overflow-x: auto;\n    overflow-y: hidden;\n    white-space: nowrap;\n    padding-top: 10px;\n    padding-bottom: 10px;\n    box-sizing: border-box;\n    background: #fff;\n    border: 0;\n    position: fixed;\n    top: 0;\n    left: 0;\n    opacity: 1;\n    z-index: 9;\n}\n\n.editor-toolbar.fullscreen::before {\n    width: 20px;\n    height: 50px;\n    background: -moz-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);\n    background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 1)), color-stop(100%, rgba(255, 255, 255, 0)));\n    background: -webkit-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);\n    background: -o-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);\n    background: -ms-linear-gradient(left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);\n    background: linear-gradient(to right, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);\n    position: fixed;\n    top: 0;\n    left: 0;\n    margin: 0;\n    padding: 0;\n}\n\n.editor-toolbar.fullscreen::after {\n    width: 20px;\n    height: 50px;\n    background: -moz-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);\n    background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 0)), color-stop(100%, rgba(255, 255, 255, 1)));\n    background: -webkit-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);\n    background: -o-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);\n    background: -ms-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);\n    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);\n    position: fixed;\n    top: 0;\n    right: 0;\n    margin: 0;\n    padding: 0;\n}\n\n.editor-toolbar button {\n    background: transparent;\n    display: inline-block;\n    text-align: center;\n    text-decoration: none !important;\n    width: 30px;\n    height: 30px;\n    margin: 0;\n    padding: 0;\n    border: 1px solid transparent;\n    border-radius: 3px;\n    cursor: pointer;\n}\n\n.editor-toolbar button.active,\n.editor-toolbar button:hover {\n    background: #fcfcfc;\n    border-color: #95a5a6;\n}\n\n.editor-toolbar i.separator {\n    display: inline-block;\n    width: 0;\n    border-left: 1px solid #d9d9d9;\n    border-right: 1px solid #fff;\n    color: transparent;\n    text-indent: -10px;\n    margin: 0 6px;\n}\n\n.editor-toolbar button:after {\n    font-family: Arial, \"Helvetica Neue\", Helvetica, sans-serif;\n    font-size: 65%;\n    vertical-align: text-bottom;\n    position: relative;\n    top: 2px;\n}\n\n.editor-toolbar button.heading-1:after {\n    content: \"1\";\n}\n\n.editor-toolbar button.heading-2:after {\n    content: \"2\";\n}\n\n.editor-toolbar button.heading-3:after {\n    content: \"3\";\n}\n\n.editor-toolbar button.heading-bigger:after {\n    content: \"▲\";\n}\n\n.editor-toolbar button.heading-smaller:after {\n    content: \"▼\";\n}\n\n.editor-toolbar.disabled-for-preview button:not(.no-disable) {\n    opacity: .6;\n    pointer-events: none;\n}\n\n@media only screen and (max-width: 700px) {\n    .editor-toolbar i.no-mobile {\n        display: none;\n    }\n}\n\n.editor-statusbar {\n    padding: 8px 10px;\n    font-size: 12px;\n    color: #959694;\n    text-align: right;\n}\n\n.editor-statusbar span {\n    display: inline-block;\n    min-width: 4em;\n    margin-left: 1em;\n}\n\n.editor-statusbar .lines:before {\n    content: 'lines: '\n}\n\n.editor-statusbar .words:before {\n    content: 'words: '\n}\n\n.editor-statusbar .characters:before {\n    content: 'characters: '\n}\n\n.editor-preview-full {\n    position: absolute;\n    width: 100%;\n    height: 100%;\n    top: 0;\n    left: 0;\n    z-index: 7;\n    overflow: auto;\n    display: none;\n    box-sizing: border-box;\n}\n\n.editor-preview-side {\n    position: fixed;\n    bottom: 0;\n    width: 50%;\n    top: 50px;\n    right: 0;\n    z-index: 9;\n    overflow: auto;\n    display: none;\n    box-sizing: border-box;\n    border: 1px solid #ddd;\n    word-wrap: break-word;\n}\n\n.editor-preview-active-side {\n    display: block\n}\n\n.editor-preview-active {\n    display: block\n}\n\n.editor-preview {\n    padding: 10px;\n    background: white;\n}\n\n.editor-preview > p {\n    margin-top: 0\n}\n\n.editor-preview pre {\n    background: #eee;\n    margin-bottom: 10px;\n}\n\n.editor-preview table td,\n.editor-preview table th {\n    border: 1px solid #ddd;\n    padding: 5px;\n}\n\n.cm-s-easymde .cm-tag {\n    color: #63a35c;\n}\n\n.cm-s-easymde .cm-attribute {\n    color: #795da3;\n}\n\n.cm-s-easymde .cm-string {\n    color: #183691;\n}\n\n.cm-s-easymde .cm-header-1 {\n    font-size: 200%;\n    line-height: 200%;\n}\n\n.cm-s-easymde .cm-header-2 {\n    font-size: 160%;\n    line-height: 160%;\n}\n\n.cm-s-easymde .cm-header-3 {\n    font-size: 125%;\n    line-height: 125%;\n}\n\n.cm-s-easymde .cm-header-4 {\n    font-size: 110%;\n    line-height: 110%;\n}\n\n.cm-s-easymde .cm-comment {\n    background: rgba(0, 0, 0, .05);\n    border-radius: 2px;\n}\n\n.cm-s-easymde .cm-link {\n    color: #7f8c8d;\n}\n\n.cm-s-easymde .cm-url {\n    color: #aab2b3;\n}\n\n.cm-s-easymde .cm-quote {\n    color: #7f8c8d;\n    font-style: italic;\n}"
  },
  {
    "path": "libs/filepond/filepond-plugin-file-poster.css",
    "content": "/*!\n * FilePondPluginFilePoster 2.5.1\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */\n\n/* eslint-disable */\n.filepond--file-poster-wrapper {\n  z-index: 2;\n}\n\n.filepond--image-preview-wrapper ~ .filepond--file-poster-wrapper {\n  display: none;\n}\n.filepond--file-poster-overlay {\n  display: block;\n  position: absolute;\n  left: 0;\n  top: 0;\n  width: 100%;\n  min-height: 5rem;\n  max-height: 7rem;\n  margin: 0;\n  opacity: 0;\n  z-index: 1;\n  mix-blend-mode: multiply;\n  pointer-events: none;\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n\n  /* fixes chrome bug */\n  aspect-ratio: auto;\n}\n\n/* success (is second canvas) */\n.filepond--file-poster-overlay:nth-of-type(2) {\n  mix-blend-mode: normal;\n}\n\n/* error (is third canvas) */\n.filepond--file-poster-overlay:nth-of-type(3) {\n  mix-blend-mode: normal;\n}\n\n/* disable for Safari as mix-blend-mode causes the overflow:hidden of the parent container to not work */\n@supports (-webkit-marquee-repetition: infinite) and\n  ((-o-object-fit: fill) or (object-fit: fill)) {\n  .filepond--file-poster-overlay {\n    mix-blend-mode: normal;\n  }\n}\n.filepond--file-poster-wrapper {\n  /* no interaction */\n  pointer-events: none;\n\n  /* have preview fill up all available space */\n  position: absolute;\n  left: 0;\n  top: 0;\n  right: 0;\n  height: 100%;\n  margin: 0;\n\n  /* radius is .05em less to prevent the panel background color from shining through */\n  border-radius: 0.45em;\n  overflow: hidden;\n\n  /* this seems to prevent Chrome from redrawing this layer constantly */\n  background: rgba(0, 0, 0, 0.01);\n}\n.filepond--file-poster {\n  position: relative;\n  z-index: 1;\n  display: block;\n  width: 100%;\n  height: 100%;\n  pointer-events: none;\n  -webkit-transform-origin: center center;\n  transform-origin: center center;\n  background: #222;\n\n  /* will be animated */\n  will-change: transform, opacity;\n}\n.filepond--file-poster img {\n  height: 100%;\n  width: auto;\n  position: relative;\n  overflow: hidden;\n  margin: 0 auto;\n  display: block;\n  will-change: transform;\n}\n.filepond--root[data-style-panel-layout~='integrated']\n  .filepond--file-poster-wrapper {\n  border-radius: 0;\n}\n.filepond--root[data-style-panel-layout~='integrated'] .filepond--file-poster {\n  height: 100%;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n}\n.filepond--root[data-style-panel-layout~='circle']\n  .filepond--file-poster-wrapper {\n  border-radius: 99999rem;\n}\n.filepond--root[data-style-panel-layout~='circle']\n  .filepond--file-poster-overlay {\n  top: auto;\n  bottom: 0;\n  -webkit-transform: scaleY(-1);\n  transform: scaleY(-1);\n}\n.filepond--root[data-style-panel-layout~='circle']\n  .filepond--file\n  .filepond--file-action-button[data-align*='bottom']:not([data-align*='center']) {\n  margin-bottom: 0.325em;\n}\n.filepond--root[data-style-panel-layout~='circle']\n  .filepond--file\n  [data-align*='left'] {\n  left: calc(50% - 3em);\n}\n.filepond--root[data-style-panel-layout~='circle']\n  .filepond--file\n  [data-align*='right'] {\n  right: calc(50% - 3em);\n}\n.filepond--root[data-style-panel-layout~='circle']\n  .filepond--progress-indicator[data-align*='bottom'][data-align*='left'],\n.filepond--root[data-style-panel-layout~='circle']\n  .filepond--progress-indicator[data-align*='bottom'][data-align*='right'] {\n  margin-bottom: calc(0.325em + 0.1875em);\n}\n.filepond--root[data-style-panel-layout~='circle']\n  .filepond--progress-indicator[data-align*='bottom'][data-align*='center'] {\n  margin-top: 0;\n  margin-bottom: 0.1875em;\n  margin-left: 0.1875em;\n}\n"
  },
  {
    "path": "libs/filepond/filepond-plugin-file-poster.js",
    "content": "/*!\n * FilePondPluginFilePoster 2.5.1\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */\n\n/* eslint-disable */\n\n(function(global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined'\n    ? (module.exports = factory())\n    : typeof define === 'function' && define.amd\n    ? define(factory)\n    : ((global = global || self),\n      (global.FilePondPluginFilePoster = factory()));\n})(this, function() {\n  'use strict';\n\n  var IMAGE_SCALE_SPRING_PROPS = {\n    type: 'spring',\n    stiffness: 0.5,\n    damping: 0.45,\n    mass: 10\n  };\n\n  var createPosterView = function createPosterView(_) {\n    return _.utils.createView({\n      name: 'file-poster',\n      tag: 'div',\n      ignoreRect: true,\n      create: function create(_ref) {\n        var root = _ref.root;\n        root.ref.image = document.createElement('img');\n        root.element.appendChild(root.ref.image);\n      },\n      write: _.utils.createRoute({\n        DID_FILE_POSTER_LOAD: function DID_FILE_POSTER_LOAD(_ref2) {\n          var root = _ref2.root,\n            props = _ref2.props;\n          var id = props.id;\n\n          // get item\n          var item = root.query('GET_ITEM', { id: props.id });\n          if (!item) return;\n\n          // get poster\n          var poster = item.getMetadata('poster');\n          root.ref.image.src = poster;\n\n          // let others know of our fabulous achievement (so the image can be faded in)\n          root.dispatch('DID_FILE_POSTER_DRAW', { id: id });\n        }\n      }),\n\n      mixins: {\n        styles: ['scaleX', 'scaleY', 'opacity'],\n        animations: {\n          scaleX: IMAGE_SCALE_SPRING_PROPS,\n          scaleY: IMAGE_SCALE_SPRING_PROPS,\n          opacity: { type: 'tween', duration: 750 }\n        }\n      }\n    });\n  };\n\n  var applyTemplate = function applyTemplate(source, target) {\n    // copy width and height\n    target.width = source.width;\n    target.height = source.height;\n\n    // draw the template\n    var ctx = target.getContext('2d');\n    ctx.drawImage(source, 0, 0);\n  };\n\n  var createPosterOverlayView = function createPosterOverlayView(fpAPI) {\n    return fpAPI.utils.createView({\n      name: 'file-poster-overlay',\n      tag: 'canvas',\n      ignoreRect: true,\n      create: function create(_ref) {\n        var root = _ref.root,\n          props = _ref.props;\n        applyTemplate(props.template, root.element);\n      },\n      mixins: {\n        styles: ['opacity'],\n        animations: {\n          opacity: { type: 'spring', mass: 25 }\n        }\n      }\n    });\n  };\n\n  var getImageSize = function getImageSize(url, cb) {\n    var image = new Image();\n    image.onload = function() {\n      var width = image.naturalWidth;\n      var height = image.naturalHeight;\n      image = null;\n      cb(width, height);\n    };\n    image.src = url;\n  };\n\n  var easeInOutSine = function easeInOutSine(t) {\n    return -0.5 * (Math.cos(Math.PI * t) - 1);\n  };\n\n  var addGradientSteps = function addGradientSteps(gradient, color) {\n    var alpha =\n      arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n    var easeFn =\n      arguments.length > 3 && arguments[3] !== undefined\n        ? arguments[3]\n        : easeInOutSine;\n    var steps =\n      arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 10;\n    var offset =\n      arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;\n    var range = 1 - offset;\n    var rgb = color.join(',');\n    for (var i = 0; i <= steps; i++) {\n      var p = i / steps;\n      var stop = offset + range * p;\n      gradient.addColorStop(\n        stop,\n        'rgba('.concat(rgb, ', ').concat(easeFn(p) * alpha, ')')\n      );\n    }\n  };\n\n  var MAX_WIDTH = 10;\n  var MAX_HEIGHT = 10;\n\n  var calculateAverageColor = function calculateAverageColor(image) {\n    var scalar = Math.min(MAX_WIDTH / image.width, MAX_HEIGHT / image.height);\n\n    var canvas = document.createElement('canvas');\n    var ctx = canvas.getContext('2d');\n    var width = (canvas.width = Math.ceil(image.width * scalar));\n    var height = (canvas.height = Math.ceil(image.height * scalar));\n    ctx.drawImage(image, 0, 0, width, height);\n    var data = null;\n    try {\n      data = ctx.getImageData(0, 0, width, height).data;\n    } catch (e) {\n      return null;\n    }\n    var l = data.length;\n\n    var r = 0;\n    var g = 0;\n    var b = 0;\n    var i = 0;\n\n    for (; i < l; i += 4) {\n      r += data[i] * data[i];\n      g += data[i + 1] * data[i + 1];\n      b += data[i + 2] * data[i + 2];\n    }\n\n    r = averageColor(r, l);\n    g = averageColor(g, l);\n    b = averageColor(b, l);\n\n    return { r: r, g: g, b: b };\n  };\n\n  var averageColor = function averageColor(c, l) {\n    return Math.floor(Math.sqrt(c / (l / 4)));\n  };\n\n  var drawTemplate = function drawTemplate(\n    canvas,\n    width,\n    height,\n    color,\n    alphaTarget\n  ) {\n    canvas.width = width;\n    canvas.height = height;\n    var ctx = canvas.getContext('2d');\n\n    var horizontalCenter = width * 0.5;\n\n    var grad = ctx.createRadialGradient(\n      horizontalCenter,\n      height + 110,\n      height - 100,\n      horizontalCenter,\n      height + 110,\n      height + 100\n    );\n\n    addGradientSteps(grad, color, alphaTarget, undefined, 8, 0.4);\n\n    ctx.save();\n    ctx.translate(-width * 0.5, 0);\n    ctx.scale(2, 1);\n    ctx.fillStyle = grad;\n    ctx.fillRect(0, 0, width, height);\n    ctx.restore();\n  };\n\n  var hasNavigator = typeof navigator !== 'undefined';\n\n  var width = 500;\n  var height = 200;\n\n  var overlayTemplateShadow = hasNavigator && document.createElement('canvas');\n  var overlayTemplateError = hasNavigator && document.createElement('canvas');\n  var overlayTemplateSuccess = hasNavigator && document.createElement('canvas');\n\n  var itemShadowColor = [40, 40, 40];\n  var itemErrorColor = [196, 78, 71];\n  var itemSuccessColor = [54, 151, 99];\n\n  if (hasNavigator) {\n    drawTemplate(overlayTemplateShadow, width, height, itemShadowColor, 0.85);\n    drawTemplate(overlayTemplateError, width, height, itemErrorColor, 1);\n    drawTemplate(overlayTemplateSuccess, width, height, itemSuccessColor, 1);\n  }\n\n  var loadImage = function loadImage(url, crossOriginValue) {\n    return new Promise(function(resolve, reject) {\n      var img = new Image();\n      if (typeof crossOrigin === 'string') {\n        img.crossOrigin = crossOriginValue;\n      }\n      img.onload = function() {\n        resolve(img);\n      };\n      img.onerror = function(e) {\n        reject(e);\n      };\n      img.src = url;\n    });\n  };\n\n  var createPosterWrapperView = function createPosterWrapperView(_) {\n    // create overlay view\n    var overlay = createPosterOverlayView(_);\n\n    /**\n     * Write handler for when preview container has been created\n     */\n    var didCreatePreviewContainer = function didCreatePreviewContainer(_ref) {\n      var root = _ref.root,\n        props = _ref.props;\n      var id = props.id;\n\n      // we need to get the file data to determine the eventual image size\n      var item = root.query('GET_ITEM', id);\n      if (!item) return;\n\n      // get url to file\n      var fileURL = item.getMetadata('poster');\n\n      // image is now ready\n      var previewImageLoaded = function previewImageLoaded(data) {\n        // calculate average image color, is in try catch to circumvent any cors errors\n        var averageColor = root.query(\n          'GET_FILE_POSTER_CALCULATE_AVERAGE_IMAGE_COLOR'\n        )\n          ? calculateAverageColor(data)\n          : null;\n        item.setMetadata('color', averageColor, true);\n\n        // the preview is now ready to be drawn\n        root.dispatch('DID_FILE_POSTER_LOAD', {\n          id: id,\n          data: data\n        });\n      };\n\n      // determine image size of this item\n      getImageSize(fileURL, function(width, height) {\n        // we can now scale the panel to the final size\n        root.dispatch('DID_FILE_POSTER_CALCULATE_SIZE', {\n          id: id,\n          width: width,\n          height: height\n        });\n\n        // create fallback preview\n        loadImage(\n          fileURL,\n          root.query('GET_FILE_POSTER_CROSS_ORIGIN_ATTRIBUTE_VALUE')\n        ).then(previewImageLoaded);\n      });\n    };\n\n    /**\n     * Write handler for when the preview has been loaded\n     */\n    var didLoadPreview = function didLoadPreview(_ref2) {\n      var root = _ref2.root;\n      root.ref.overlayShadow.opacity = 1;\n    };\n\n    /**\n     * Write handler for when the preview image is ready to be animated\n     */\n    var didDrawPreview = function didDrawPreview(_ref3) {\n      var root = _ref3.root;\n      var image = root.ref.image;\n\n      // reveal image\n      image.scaleX = 1.0;\n      image.scaleY = 1.0;\n      image.opacity = 1;\n    };\n\n    /**\n     * Write handler for when the preview has been loaded\n     */\n    var restoreOverlay = function restoreOverlay(_ref4) {\n      var root = _ref4.root;\n      root.ref.overlayShadow.opacity = 1;\n      root.ref.overlayError.opacity = 0;\n      root.ref.overlaySuccess.opacity = 0;\n    };\n\n    var didThrowError = function didThrowError(_ref5) {\n      var root = _ref5.root;\n      root.ref.overlayShadow.opacity = 0.25;\n      root.ref.overlayError.opacity = 1;\n    };\n\n    var didCompleteProcessing = function didCompleteProcessing(_ref6) {\n      var root = _ref6.root;\n      root.ref.overlayShadow.opacity = 0.25;\n      root.ref.overlaySuccess.opacity = 1;\n    };\n\n    /**\n     * Constructor\n     */\n    var create = function create(_ref7) {\n      var root = _ref7.root,\n        props = _ref7.props;\n      // test if colors aren't default item overlay colors\n      var itemShadowColorProp = root.query(\n        'GET_FILE_POSTER_ITEM_OVERLAY_SHADOW_COLOR'\n      );\n\n      var itemErrorColorProp = root.query(\n        'GET_FILE_POSTER_ITEM_OVERLAY_ERROR_COLOR'\n      );\n\n      var itemSuccessColorProp = root.query(\n        'GET_FILE_POSTER_ITEM_OVERLAY_SUCCESS_COLOR'\n      );\n\n      if (itemShadowColorProp && itemShadowColorProp !== itemShadowColor) {\n        itemShadowColor = itemShadowColorProp;\n        drawTemplate(\n          overlayTemplateShadow,\n          width,\n          height,\n          itemShadowColor,\n          0.85\n        );\n      }\n      if (itemErrorColorProp && itemErrorColorProp !== itemErrorColor) {\n        itemErrorColor = itemErrorColorProp;\n        drawTemplate(overlayTemplateError, width, height, itemErrorColor, 1);\n      }\n      if (itemSuccessColorProp && itemSuccessColorProp !== itemSuccessColor) {\n        itemSuccessColor = itemSuccessColorProp;\n        drawTemplate(\n          overlayTemplateSuccess,\n          width,\n          height,\n          itemSuccessColor,\n          1\n        );\n      }\n\n      // image view\n      var image = createPosterView(_);\n\n      // append image presenter\n      root.ref.image = root.appendChildView(\n        root.createChildView(image, {\n          id: props.id,\n          scaleX: 1.25,\n          scaleY: 1.25,\n          opacity: 0\n        })\n      );\n\n      // image overlays\n      root.ref.overlayShadow = root.appendChildView(\n        root.createChildView(overlay, {\n          template: overlayTemplateShadow,\n          opacity: 0\n        })\n      );\n\n      root.ref.overlaySuccess = root.appendChildView(\n        root.createChildView(overlay, {\n          template: overlayTemplateSuccess,\n          opacity: 0\n        })\n      );\n\n      root.ref.overlayError = root.appendChildView(\n        root.createChildView(overlay, {\n          template: overlayTemplateError,\n          opacity: 0\n        })\n      );\n    };\n\n    return _.utils.createView({\n      name: 'file-poster-wrapper',\n      create: create,\n      write: _.utils.createRoute({\n        // image preview stated\n        DID_FILE_POSTER_LOAD: didLoadPreview,\n        DID_FILE_POSTER_DRAW: didDrawPreview,\n        DID_FILE_POSTER_CONTAINER_CREATE: didCreatePreviewContainer,\n\n        // file states\n        DID_THROW_ITEM_LOAD_ERROR: didThrowError,\n        DID_THROW_ITEM_PROCESSING_ERROR: didThrowError,\n        DID_THROW_ITEM_INVALID: didThrowError,\n        DID_COMPLETE_ITEM_PROCESSING: didCompleteProcessing,\n        DID_START_ITEM_PROCESSING: restoreOverlay,\n        DID_REVERT_ITEM_PROCESSING: restoreOverlay\n      })\n    });\n  };\n\n  /**\n   * File Poster Plugin\n   */\n  var plugin = function plugin(fpAPI) {\n    var addFilter = fpAPI.addFilter,\n      utils = fpAPI.utils;\n    var Type = utils.Type,\n      createRoute = utils.createRoute;\n\n    // filePosterView\n    var filePosterView = createPosterWrapperView(fpAPI);\n\n    // called for each view that is created right after the 'create' method\n    addFilter('CREATE_VIEW', function(viewAPI) {\n      // get reference to created view\n      var is = viewAPI.is,\n        view = viewAPI.view,\n        query = viewAPI.query;\n\n      // only hook up to item view and only if is enabled for this cropper\n      if (!is('file') || !query('GET_ALLOW_FILE_POSTER')) return;\n\n      // create the file poster plugin, but only do so if the item is an image\n      var didLoadItem = function didLoadItem(_ref) {\n        var root = _ref.root,\n          props = _ref.props;\n        updateItemPoster(root, props);\n      };\n\n      var didUpdateItemMetadata = function didUpdateItemMetadata(_ref2) {\n        var root = _ref2.root,\n          props = _ref2.props,\n          action = _ref2.action;\n        if (!/poster/.test(action.change.key)) return;\n        updateItemPoster(root, props);\n      };\n\n      var updateItemPoster = function updateItemPoster(root, props) {\n        var id = props.id;\n        var item = query('GET_ITEM', id);\n\n        // item could theoretically have been removed in the mean time\n        if (!item || !item.getMetadata('poster') || item.archived) return;\n\n        // don't update if is the same poster\n        if (root.ref.previousPoster === item.getMetadata('poster')) return;\n        root.ref.previousPoster = item.getMetadata('poster');\n\n        // test if is filtered\n        if (!query('GET_FILE_POSTER_FILTER_ITEM')(item)) return;\n\n        if (root.ref.filePoster) {\n          view.removeChildView(root.ref.filePoster);\n        }\n\n        // set preview view\n        root.ref.filePoster = view.appendChildView(\n          view.createChildView(filePosterView, { id: id })\n        );\n\n        // now ready\n        root.dispatch('DID_FILE_POSTER_CONTAINER_CREATE', { id: id });\n      };\n\n      var didCalculatePreviewSize = function didCalculatePreviewSize(_ref3) {\n        var root = _ref3.root,\n          action = _ref3.action;\n        // no poster set\n        if (!root.ref.filePoster) return;\n\n        // remember dimensions\n        root.ref.imageWidth = action.width;\n        root.ref.imageHeight = action.height;\n\n        root.ref.shouldUpdatePanelHeight = true;\n\n        root.dispatch('KICK');\n      };\n\n      var getPosterHeight = function getPosterHeight(_ref4) {\n        var root = _ref4.root;\n        var fixedPosterHeight = root.query('GET_FILE_POSTER_HEIGHT');\n\n        // if fixed height: return fixed immediately\n        if (fixedPosterHeight) {\n          return fixedPosterHeight;\n        }\n\n        var minPosterHeight = root.query('GET_FILE_POSTER_MIN_HEIGHT');\n        var maxPosterHeight = root.query('GET_FILE_POSTER_MAX_HEIGHT');\n\n        // if natural height is smaller than minHeight: return min height\n        if (minPosterHeight && root.ref.imageHeight < minPosterHeight) {\n          return minPosterHeight;\n        }\n\n        var height =\n          root.rect.element.width *\n          (root.ref.imageHeight / root.ref.imageWidth);\n\n        if (minPosterHeight && height < minPosterHeight) {\n          return minPosterHeight;\n        }\n        if (maxPosterHeight && height > maxPosterHeight) {\n          return maxPosterHeight;\n        }\n\n        return height;\n      };\n\n      // start writing\n      view.registerWriter(\n        createRoute(\n          {\n            DID_LOAD_ITEM: didLoadItem,\n            DID_FILE_POSTER_CALCULATE_SIZE: didCalculatePreviewSize,\n            DID_UPDATE_ITEM_METADATA: didUpdateItemMetadata\n          },\n\n          function(_ref5) {\n            var root = _ref5.root,\n              props = _ref5.props;\n            // don't run without poster\n            if (!root.ref.filePoster) return;\n\n            // don't do anything while hidden\n            if (root.rect.element.hidden) return;\n\n            // should we redraw\n            if (root.ref.shouldUpdatePanelHeight) {\n              // time to resize the parent panel\n              root.dispatch('DID_UPDATE_PANEL_HEIGHT', {\n                id: props.id,\n                height: getPosterHeight({ root: root })\n              });\n\n              // done!\n              root.ref.shouldUpdatePanelHeight = false;\n            }\n          }\n        )\n      );\n    });\n\n    // expose plugin\n    return {\n      options: {\n        // Enable or disable file poster\n        allowFilePoster: [true, Type.BOOLEAN],\n\n        // Fixed preview height\n        filePosterHeight: [null, Type.INT],\n\n        // Min image height\n        filePosterMinHeight: [null, Type.INT],\n\n        // Max image height\n        filePosterMaxHeight: [null, Type.INT],\n\n        // filters file items to determine which are shown as poster\n        filePosterFilterItem: [\n          function() {\n            return true;\n          },\n          Type.FUNCTION\n        ],\n\n        // Enables or disables reading average image color\n        filePosterCalculateAverageImageColor: [false, Type.BOOLEAN],\n\n        // Allows setting the value of the CORS attribute (null is don't set attribute)\n        filePosterCrossOriginAttributeValue: ['Anonymous', Type.STRING],\n\n        // Colors used for item overlay gradient\n        filePosterItemOverlayShadowColor: [null, Type.ARRAY],\n        filePosterItemOverlayErrorColor: [null, Type.ARRAY],\n        filePosterItemOverlaySuccessColor: [null, Type.ARRAY]\n      }\n    };\n  };\n\n  // fire pluginloaded event if running in browser, this allows registering the plugin when using async script tags\n  var isBrowser =\n    typeof window !== 'undefined' && typeof window.document !== 'undefined';\n  if (isBrowser) {\n    document.dispatchEvent(\n      new CustomEvent('FilePond:pluginloaded', { detail: plugin })\n    );\n  }\n\n  return plugin;\n});\n"
  },
  {
    "path": "libs/filepond/filepond-plugin-image-preview.css",
    "content": "/*!\n * FilePondPluginImagePreview 4.6.12\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */\n\n/* eslint-disable */\n.filepond--image-preview-markup {\n  position: absolute;\n  left: 0;\n  top: 0;\n}\n.filepond--image-preview-wrapper {\n  z-index: 2;\n}\n.filepond--image-preview-overlay {\n  display: block;\n  position: absolute;\n  left: 0;\n  top: 0;\n  width: 100%;\n  min-height: 5rem;\n  max-height: 7rem;\n  margin: 0;\n  opacity: 0;\n  z-index: 2;\n  pointer-events: none;\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n}\n.filepond--image-preview-overlay svg {\n  width: 100%;\n  height: auto;\n  color: inherit;\n  max-height: inherit;\n}\n.filepond--image-preview-overlay-idle {\n  mix-blend-mode: multiply;\n  color: rgba(40, 40, 40, 0.85);\n}\n.filepond--image-preview-overlay-success {\n  mix-blend-mode: normal;\n  color: rgba(54, 151, 99, 1);\n}\n.filepond--image-preview-overlay-failure {\n  mix-blend-mode: normal;\n  color: rgba(196, 78, 71, 1);\n}\n/* disable for Safari as mix-blend-mode causes the overflow:hidden of the parent container to not work */\n@supports (-webkit-marquee-repetition: infinite) and\n  ((-o-object-fit: fill) or (object-fit: fill)) {\n  .filepond--image-preview-overlay-idle {\n    mix-blend-mode: normal;\n  }\n}\n.filepond--image-preview-wrapper {\n  /* no interaction */\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n\n  /* have preview fill up all available space */\n  position: absolute;\n  left: 0;\n  top: 0;\n  right: 0;\n  height: 100%;\n  margin: 0;\n\n  /* radius is .05em less to prevent the panel background color from shining through */\n  border-radius: 0.45em;\n  overflow: hidden;\n\n  /* this seems to prevent Chrome from redrawing this layer constantly */\n  background: rgba(0, 0, 0, 0.01);\n}\n.filepond--image-preview {\n  position: absolute;\n  left: 0;\n  top: 0;\n  z-index: 1;\n  display: flex; /* this aligns the graphic vertically if the panel is higher than the image */\n  align-items: center;\n  height: 100%;\n  width: 100%;\n  pointer-events: none;\n  background: #222;\n\n  /* will be animated */\n  will-change: transform, opacity;\n}\n.filepond--image-clip {\n  position: relative;\n  overflow: hidden;\n  margin: 0 auto;\n\n  /* transparency indicator (currently only supports grid or basic color) */\n}\n.filepond--image-clip[data-transparency-indicator='grid'] img,\n.filepond--image-clip[data-transparency-indicator='grid'] canvas {\n  background-color: #fff;\n  background-image: url(\"data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg' fill='%23eee'%3E%3Cpath d='M0 0 H50 V50 H0'/%3E%3Cpath d='M50 50 H100 V100 H50'/%3E%3C/svg%3E\");\n  background-size: 1.25em 1.25em;\n}\n.filepond--image-bitmap,\n.filepond--image-vector {\n  position: absolute;\n  left: 0;\n  top: 0;\n  will-change: transform;\n}\n.filepond--root[data-style-panel-layout~='integrated']\n  .filepond--image-preview-wrapper {\n  border-radius: 0;\n}\n.filepond--root[data-style-panel-layout~='integrated']\n  .filepond--image-preview {\n  height: 100%;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n}\n.filepond--root[data-style-panel-layout~='circle']\n  .filepond--image-preview-wrapper {\n  border-radius: 99999rem;\n}\n.filepond--root[data-style-panel-layout~='circle']\n  .filepond--image-preview-overlay {\n  top: auto;\n  bottom: 0;\n  -webkit-transform: scaleY(-1);\n  transform: scaleY(-1);\n}\n.filepond--root[data-style-panel-layout~='circle']\n  .filepond--file\n  .filepond--file-action-button[data-align*='bottom']:not([data-align*='center']) {\n  margin-bottom: 0.325em;\n}\n.filepond--root[data-style-panel-layout~='circle']\n  .filepond--file\n  [data-align*='left'] {\n  left: calc(50% - 3em);\n}\n.filepond--root[data-style-panel-layout~='circle']\n  .filepond--file\n  [data-align*='right'] {\n  right: calc(50% - 3em);\n}\n.filepond--root[data-style-panel-layout~='circle']\n  .filepond--progress-indicator[data-align*='bottom'][data-align*='left'],\n.filepond--root[data-style-panel-layout~='circle']\n  .filepond--progress-indicator[data-align*='bottom'][data-align*='right'] {\n  margin-bottom: calc(0.325em + 0.1875em);\n}\n.filepond--root[data-style-panel-layout~='circle']\n  .filepond--progress-indicator[data-align*='bottom'][data-align*='center'] {\n  margin-top: 0;\n  margin-bottom: 0.1875em;\n  margin-left: 0.1875em;\n}\n"
  },
  {
    "path": "libs/filepond/filepond-plugin-image-preview.js",
    "content": "/*!\n * FilePondPluginImagePreview 4.6.12\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */\n\n/* eslint-disable */\n\n(function(global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined'\n    ? (module.exports = factory())\n    : typeof define === 'function' && define.amd\n    ? define(factory)\n    : ((global = global || self),\n      (global.FilePondPluginImagePreview = factory()));\n})(this, function() {\n  'use strict';\n\n  // test if file is of type image and can be viewed in canvas\n  var isPreviewableImage = function isPreviewableImage(file) {\n    return /^image/.test(file.type);\n  };\n\n  function _typeof(obj) {\n    if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') {\n      _typeof = function(obj) {\n        return typeof obj;\n      };\n    } else {\n      _typeof = function(obj) {\n        return obj &&\n          typeof Symbol === 'function' &&\n          obj.constructor === Symbol &&\n          obj !== Symbol.prototype\n          ? 'symbol'\n          : typeof obj;\n      };\n    }\n\n    return _typeof(obj);\n  }\n\n  var REACT_ELEMENT_TYPE;\n\n  function _jsx(type, props, key, children) {\n    if (!REACT_ELEMENT_TYPE) {\n      REACT_ELEMENT_TYPE =\n        (typeof Symbol === 'function' &&\n          Symbol.for &&\n          Symbol.for('react.element')) ||\n        0xeac7;\n    }\n\n    var defaultProps = type && type.defaultProps;\n    var childrenLength = arguments.length - 3;\n\n    if (!props && childrenLength !== 0) {\n      props = {\n        children: void 0\n      };\n    }\n\n    if (props && defaultProps) {\n      for (var propName in defaultProps) {\n        if (props[propName] === void 0) {\n          props[propName] = defaultProps[propName];\n        }\n      }\n    } else if (!props) {\n      props = defaultProps || {};\n    }\n\n    if (childrenLength === 1) {\n      props.children = children;\n    } else if (childrenLength > 1) {\n      var childArray = new Array(childrenLength);\n\n      for (var i = 0; i < childrenLength; i++) {\n        childArray[i] = arguments[i + 3];\n      }\n\n      props.children = childArray;\n    }\n\n    return {\n      $$typeof: REACT_ELEMENT_TYPE,\n      type: type,\n      key: key === undefined ? null : '' + key,\n      ref: null,\n      props: props,\n      _owner: null\n    };\n  }\n\n  function _asyncIterator(iterable) {\n    var method;\n\n    if (typeof Symbol === 'function') {\n      if (Symbol.asyncIterator) {\n        method = iterable[Symbol.asyncIterator];\n        if (method != null) return method.call(iterable);\n      }\n\n      if (Symbol.iterator) {\n        method = iterable[Symbol.iterator];\n        if (method != null) return method.call(iterable);\n      }\n    }\n\n    throw new TypeError('Object is not async iterable');\n  }\n\n  function _AwaitValue(value) {\n    this.wrapped = value;\n  }\n\n  function _AsyncGenerator(gen) {\n    var front, back;\n\n    function send(key, arg) {\n      return new Promise(function(resolve, reject) {\n        var request = {\n          key: key,\n          arg: arg,\n          resolve: resolve,\n          reject: reject,\n          next: null\n        };\n\n        if (back) {\n          back = back.next = request;\n        } else {\n          front = back = request;\n          resume(key, arg);\n        }\n      });\n    }\n\n    function resume(key, arg) {\n      try {\n        var result = gen[key](arg);\n        var value = result.value;\n        var wrappedAwait = value instanceof _AwaitValue;\n        Promise.resolve(wrappedAwait ? value.wrapped : value).then(\n          function(arg) {\n            if (wrappedAwait) {\n              resume('next', arg);\n              return;\n            }\n\n            settle(result.done ? 'return' : 'normal', arg);\n          },\n          function(err) {\n            resume('throw', err);\n          }\n        );\n      } catch (err) {\n        settle('throw', err);\n      }\n    }\n\n    function settle(type, value) {\n      switch (type) {\n        case 'return':\n          front.resolve({\n            value: value,\n            done: true\n          });\n          break;\n\n        case 'throw':\n          front.reject(value);\n          break;\n\n        default:\n          front.resolve({\n            value: value,\n            done: false\n          });\n          break;\n      }\n\n      front = front.next;\n\n      if (front) {\n        resume(front.key, front.arg);\n      } else {\n        back = null;\n      }\n    }\n\n    this._invoke = send;\n\n    if (typeof gen.return !== 'function') {\n      this.return = undefined;\n    }\n  }\n\n  if (typeof Symbol === 'function' && Symbol.asyncIterator) {\n    _AsyncGenerator.prototype[Symbol.asyncIterator] = function() {\n      return this;\n    };\n  }\n\n  _AsyncGenerator.prototype.next = function(arg) {\n    return this._invoke('next', arg);\n  };\n\n  _AsyncGenerator.prototype.throw = function(arg) {\n    return this._invoke('throw', arg);\n  };\n\n  _AsyncGenerator.prototype.return = function(arg) {\n    return this._invoke('return', arg);\n  };\n\n  function _wrapAsyncGenerator(fn) {\n    return function() {\n      return new _AsyncGenerator(fn.apply(this, arguments));\n    };\n  }\n\n  function _awaitAsyncGenerator(value) {\n    return new _AwaitValue(value);\n  }\n\n  function _asyncGeneratorDelegate(inner, awaitWrap) {\n    var iter = {},\n      waiting = false;\n\n    function pump(key, value) {\n      waiting = true;\n      value = new Promise(function(resolve) {\n        resolve(inner[key](value));\n      });\n      return {\n        done: false,\n        value: awaitWrap(value)\n      };\n    }\n\n    if (typeof Symbol === 'function' && Symbol.iterator) {\n      iter[Symbol.iterator] = function() {\n        return this;\n      };\n    }\n\n    iter.next = function(value) {\n      if (waiting) {\n        waiting = false;\n        return value;\n      }\n\n      return pump('next', value);\n    };\n\n    if (typeof inner.throw === 'function') {\n      iter.throw = function(value) {\n        if (waiting) {\n          waiting = false;\n          throw value;\n        }\n\n        return pump('throw', value);\n      };\n    }\n\n    if (typeof inner.return === 'function') {\n      iter.return = function(value) {\n        return pump('return', value);\n      };\n    }\n\n    return iter;\n  }\n\n  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n    try {\n      var info = gen[key](arg);\n      var value = info.value;\n    } catch (error) {\n      reject(error);\n      return;\n    }\n\n    if (info.done) {\n      resolve(value);\n    } else {\n      Promise.resolve(value).then(_next, _throw);\n    }\n  }\n\n  function _asyncToGenerator(fn) {\n    return function() {\n      var self = this,\n        args = arguments;\n      return new Promise(function(resolve, reject) {\n        var gen = fn.apply(self, args);\n\n        function _next(value) {\n          asyncGeneratorStep(\n            gen,\n            resolve,\n            reject,\n            _next,\n            _throw,\n            'next',\n            value\n          );\n        }\n\n        function _throw(err) {\n          asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err);\n        }\n\n        _next(undefined);\n      });\n    };\n  }\n\n  function _classCallCheck(instance, Constructor) {\n    if (!(instance instanceof Constructor)) {\n      throw new TypeError('Cannot call a class as a function');\n    }\n  }\n\n  function _defineProperties(target, props) {\n    for (var i = 0; i < props.length; i++) {\n      var descriptor = props[i];\n      descriptor.enumerable = descriptor.enumerable || false;\n      descriptor.configurable = true;\n      if ('value' in descriptor) descriptor.writable = true;\n      Object.defineProperty(target, descriptor.key, descriptor);\n    }\n  }\n\n  function _createClass(Constructor, protoProps, staticProps) {\n    if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n    if (staticProps) _defineProperties(Constructor, staticProps);\n    return Constructor;\n  }\n\n  function _defineEnumerableProperties(obj, descs) {\n    for (var key in descs) {\n      var desc = descs[key];\n      desc.configurable = desc.enumerable = true;\n      if ('value' in desc) desc.writable = true;\n      Object.defineProperty(obj, key, desc);\n    }\n\n    if (Object.getOwnPropertySymbols) {\n      var objectSymbols = Object.getOwnPropertySymbols(descs);\n\n      for (var i = 0; i < objectSymbols.length; i++) {\n        var sym = objectSymbols[i];\n        var desc = descs[sym];\n        desc.configurable = desc.enumerable = true;\n        if ('value' in desc) desc.writable = true;\n        Object.defineProperty(obj, sym, desc);\n      }\n    }\n\n    return obj;\n  }\n\n  function _defaults(obj, defaults) {\n    var keys = Object.getOwnPropertyNames(defaults);\n\n    for (var i = 0; i < keys.length; i++) {\n      var key = keys[i];\n      var value = Object.getOwnPropertyDescriptor(defaults, key);\n\n      if (value && value.configurable && obj[key] === undefined) {\n        Object.defineProperty(obj, key, value);\n      }\n    }\n\n    return obj;\n  }\n\n  function _defineProperty(obj, key, value) {\n    if (key in obj) {\n      Object.defineProperty(obj, key, {\n        value: value,\n        enumerable: true,\n        configurable: true,\n        writable: true\n      });\n    } else {\n      obj[key] = value;\n    }\n\n    return obj;\n  }\n\n  function _extends() {\n    _extends =\n      Object.assign ||\n      function(target) {\n        for (var i = 1; i < arguments.length; i++) {\n          var source = arguments[i];\n\n          for (var key in source) {\n            if (Object.prototype.hasOwnProperty.call(source, key)) {\n              target[key] = source[key];\n            }\n          }\n        }\n\n        return target;\n      };\n\n    return _extends.apply(this, arguments);\n  }\n\n  function _objectSpread(target) {\n    for (var i = 1; i < arguments.length; i++) {\n      var source = arguments[i] != null ? arguments[i] : {};\n      var ownKeys = Object.keys(source);\n\n      if (typeof Object.getOwnPropertySymbols === 'function') {\n        ownKeys = ownKeys.concat(\n          Object.getOwnPropertySymbols(source).filter(function(sym) {\n            return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n          })\n        );\n      }\n\n      ownKeys.forEach(function(key) {\n        _defineProperty(target, key, source[key]);\n      });\n    }\n\n    return target;\n  }\n\n  function _inherits(subClass, superClass) {\n    if (typeof superClass !== 'function' && superClass !== null) {\n      throw new TypeError('Super expression must either be null or a function');\n    }\n\n    subClass.prototype = Object.create(superClass && superClass.prototype, {\n      constructor: {\n        value: subClass,\n        writable: true,\n        configurable: true\n      }\n    });\n    if (superClass) _setPrototypeOf(subClass, superClass);\n  }\n\n  function _inheritsLoose(subClass, superClass) {\n    subClass.prototype = Object.create(superClass.prototype);\n    subClass.prototype.constructor = subClass;\n    subClass.__proto__ = superClass;\n  }\n\n  function _getPrototypeOf(o) {\n    _getPrototypeOf = Object.setPrototypeOf\n      ? Object.getPrototypeOf\n      : function _getPrototypeOf(o) {\n          return o.__proto__ || Object.getPrototypeOf(o);\n        };\n    return _getPrototypeOf(o);\n  }\n\n  function _setPrototypeOf(o, p) {\n    _setPrototypeOf =\n      Object.setPrototypeOf ||\n      function _setPrototypeOf(o, p) {\n        o.__proto__ = p;\n        return o;\n      };\n\n    return _setPrototypeOf(o, p);\n  }\n\n  function isNativeReflectConstruct() {\n    if (typeof Reflect === 'undefined' || !Reflect.construct) return false;\n    if (Reflect.construct.sham) return false;\n    if (typeof Proxy === 'function') return true;\n\n    try {\n      Date.prototype.toString.call(Reflect.construct(Date, [], function() {}));\n      return true;\n    } catch (e) {\n      return false;\n    }\n  }\n\n  function _construct(Parent, args, Class) {\n    if (isNativeReflectConstruct()) {\n      _construct = Reflect.construct;\n    } else {\n      _construct = function _construct(Parent, args, Class) {\n        var a = [null];\n        a.push.apply(a, args);\n        var Constructor = Function.bind.apply(Parent, a);\n        var instance = new Constructor();\n        if (Class) _setPrototypeOf(instance, Class.prototype);\n        return instance;\n      };\n    }\n\n    return _construct.apply(null, arguments);\n  }\n\n  function _isNativeFunction(fn) {\n    return Function.toString.call(fn).indexOf('[native code]') !== -1;\n  }\n\n  function _wrapNativeSuper(Class) {\n    var _cache = typeof Map === 'function' ? new Map() : undefined;\n\n    _wrapNativeSuper = function _wrapNativeSuper(Class) {\n      if (Class === null || !_isNativeFunction(Class)) return Class;\n\n      if (typeof Class !== 'function') {\n        throw new TypeError(\n          'Super expression must either be null or a function'\n        );\n      }\n\n      if (typeof _cache !== 'undefined') {\n        if (_cache.has(Class)) return _cache.get(Class);\n\n        _cache.set(Class, Wrapper);\n      }\n\n      function Wrapper() {\n        return _construct(Class, arguments, _getPrototypeOf(this).constructor);\n      }\n\n      Wrapper.prototype = Object.create(Class.prototype, {\n        constructor: {\n          value: Wrapper,\n          enumerable: false,\n          writable: true,\n          configurable: true\n        }\n      });\n      return _setPrototypeOf(Wrapper, Class);\n    };\n\n    return _wrapNativeSuper(Class);\n  }\n\n  function _instanceof(left, right) {\n    if (\n      right != null &&\n      typeof Symbol !== 'undefined' &&\n      right[Symbol.hasInstance]\n    ) {\n      return right[Symbol.hasInstance](left);\n    } else {\n      return left instanceof right;\n    }\n  }\n\n  function _interopRequireDefault(obj) {\n    return obj && obj.__esModule\n      ? obj\n      : {\n          default: obj\n        };\n  }\n\n  function _interopRequireWildcard(obj) {\n    if (obj && obj.__esModule) {\n      return obj;\n    } else {\n      var newObj = {};\n\n      if (obj != null) {\n        for (var key in obj) {\n          if (Object.prototype.hasOwnProperty.call(obj, key)) {\n            var desc =\n              Object.defineProperty && Object.getOwnPropertyDescriptor\n                ? Object.getOwnPropertyDescriptor(obj, key)\n                : {};\n\n            if (desc.get || desc.set) {\n              Object.defineProperty(newObj, key, desc);\n            } else {\n              newObj[key] = obj[key];\n            }\n          }\n        }\n      }\n\n      newObj.default = obj;\n      return newObj;\n    }\n  }\n\n  function _newArrowCheck(innerThis, boundThis) {\n    if (innerThis !== boundThis) {\n      throw new TypeError('Cannot instantiate an arrow function');\n    }\n  }\n\n  function _objectDestructuringEmpty(obj) {\n    if (obj == null) throw new TypeError('Cannot destructure undefined');\n  }\n\n  function _objectWithoutPropertiesLoose(source, excluded) {\n    if (source == null) return {};\n    var target = {};\n    var sourceKeys = Object.keys(source);\n    var key, i;\n\n    for (i = 0; i < sourceKeys.length; i++) {\n      key = sourceKeys[i];\n      if (excluded.indexOf(key) >= 0) continue;\n      target[key] = source[key];\n    }\n\n    return target;\n  }\n\n  function _objectWithoutProperties(source, excluded) {\n    if (source == null) return {};\n\n    var target = _objectWithoutPropertiesLoose(source, excluded);\n\n    var key, i;\n\n    if (Object.getOwnPropertySymbols) {\n      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n      for (i = 0; i < sourceSymbolKeys.length; i++) {\n        key = sourceSymbolKeys[i];\n        if (excluded.indexOf(key) >= 0) continue;\n        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n        target[key] = source[key];\n      }\n    }\n\n    return target;\n  }\n\n  function _assertThisInitialized(self) {\n    if (self === void 0) {\n      throw new ReferenceError(\n        \"this hasn't been initialised - super() hasn't been called\"\n      );\n    }\n\n    return self;\n  }\n\n  function _possibleConstructorReturn(self, call) {\n    if (call && (typeof call === 'object' || typeof call === 'function')) {\n      return call;\n    }\n\n    return _assertThisInitialized(self);\n  }\n\n  function _superPropBase(object, property) {\n    while (!Object.prototype.hasOwnProperty.call(object, property)) {\n      object = _getPrototypeOf(object);\n      if (object === null) break;\n    }\n\n    return object;\n  }\n\n  function _get(target, property, receiver) {\n    if (typeof Reflect !== 'undefined' && Reflect.get) {\n      _get = Reflect.get;\n    } else {\n      _get = function _get(target, property, receiver) {\n        var base = _superPropBase(target, property);\n\n        if (!base) return;\n        var desc = Object.getOwnPropertyDescriptor(base, property);\n\n        if (desc.get) {\n          return desc.get.call(receiver);\n        }\n\n        return desc.value;\n      };\n    }\n\n    return _get(target, property, receiver || target);\n  }\n\n  function set(target, property, value, receiver) {\n    if (typeof Reflect !== 'undefined' && Reflect.set) {\n      set = Reflect.set;\n    } else {\n      set = function set(target, property, value, receiver) {\n        var base = _superPropBase(target, property);\n\n        var desc;\n\n        if (base) {\n          desc = Object.getOwnPropertyDescriptor(base, property);\n\n          if (desc.set) {\n            desc.set.call(receiver, value);\n            return true;\n          } else if (!desc.writable) {\n            return false;\n          }\n        }\n\n        desc = Object.getOwnPropertyDescriptor(receiver, property);\n\n        if (desc) {\n          if (!desc.writable) {\n            return false;\n          }\n\n          desc.value = value;\n          Object.defineProperty(receiver, property, desc);\n        } else {\n          _defineProperty(receiver, property, value);\n        }\n\n        return true;\n      };\n    }\n\n    return set(target, property, value, receiver);\n  }\n\n  function _set(target, property, value, receiver, isStrict) {\n    var s = set(target, property, value, receiver || target);\n\n    if (!s && isStrict) {\n      throw new Error('failed to set property');\n    }\n\n    return value;\n  }\n\n  function _taggedTemplateLiteral(strings, raw) {\n    if (!raw) {\n      raw = strings.slice(0);\n    }\n\n    return Object.freeze(\n      Object.defineProperties(strings, {\n        raw: {\n          value: Object.freeze(raw)\n        }\n      })\n    );\n  }\n\n  function _taggedTemplateLiteralLoose(strings, raw) {\n    if (!raw) {\n      raw = strings.slice(0);\n    }\n\n    strings.raw = raw;\n    return strings;\n  }\n\n  function _temporalRef(val, name) {\n    if (val === _temporalUndefined) {\n      throw new ReferenceError(name + ' is not defined - temporal dead zone');\n    } else {\n      return val;\n    }\n  }\n\n  function _readOnlyError(name) {\n    throw new Error('\"' + name + '\" is read-only');\n  }\n\n  function _classNameTDZError(name) {\n    throw new Error(\n      'Class \"' + name + '\" cannot be referenced in computed property keys.'\n    );\n  }\n\n  var _temporalUndefined = {};\n\n  function _slicedToArray(arr, i) {\n    return (\n      _arrayWithHoles(arr) ||\n      _iterableToArrayLimit(arr, i) ||\n      _nonIterableRest()\n    );\n  }\n\n  function _slicedToArrayLoose(arr, i) {\n    return (\n      _arrayWithHoles(arr) ||\n      _iterableToArrayLimitLoose(arr, i) ||\n      _nonIterableRest()\n    );\n  }\n\n  function _toArray(arr) {\n    return _arrayWithHoles(arr) || _iterableToArray(arr) || _nonIterableRest();\n  }\n\n  function _toConsumableArray(arr) {\n    return (\n      _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread()\n    );\n  }\n\n  function _arrayWithoutHoles(arr) {\n    if (Array.isArray(arr)) {\n      for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++)\n        arr2[i] = arr[i];\n\n      return arr2;\n    }\n  }\n\n  function _arrayWithHoles(arr) {\n    if (Array.isArray(arr)) return arr;\n  }\n\n  function _iterableToArray(iter) {\n    if (\n      Symbol.iterator in Object(iter) ||\n      Object.prototype.toString.call(iter) === '[object Arguments]'\n    )\n      return Array.from(iter);\n  }\n\n  function _iterableToArrayLimit(arr, i) {\n    var _arr = [];\n    var _n = true;\n    var _d = false;\n    var _e = undefined;\n\n    try {\n      for (\n        var _i = arr[Symbol.iterator](), _s;\n        !(_n = (_s = _i.next()).done);\n        _n = true\n      ) {\n        _arr.push(_s.value);\n\n        if (i && _arr.length === i) break;\n      }\n    } catch (err) {\n      _d = true;\n      _e = err;\n    } finally {\n      try {\n        if (!_n && _i['return'] != null) _i['return']();\n      } finally {\n        if (_d) throw _e;\n      }\n    }\n\n    return _arr;\n  }\n\n  function _iterableToArrayLimitLoose(arr, i) {\n    var _arr = [];\n\n    for (\n      var _iterator = arr[Symbol.iterator](), _step;\n      !(_step = _iterator.next()).done;\n\n    ) {\n      _arr.push(_step.value);\n\n      if (i && _arr.length === i) break;\n    }\n\n    return _arr;\n  }\n\n  function _nonIterableSpread() {\n    throw new TypeError('Invalid attempt to spread non-iterable instance');\n  }\n\n  function _nonIterableRest() {\n    throw new TypeError('Invalid attempt to destructure non-iterable instance');\n  }\n\n  function _skipFirstGeneratorNext(fn) {\n    return function() {\n      var it = fn.apply(this, arguments);\n      it.next();\n      return it;\n    };\n  }\n\n  function _toPrimitive(input, hint) {\n    if (typeof input !== 'object' || input === null) return input;\n    var prim = input[Symbol.toPrimitive];\n\n    if (prim !== undefined) {\n      var res = prim.call(input, hint || 'default');\n      if (typeof res !== 'object') return res;\n      throw new TypeError('@@toPrimitive must return a primitive value.');\n    }\n\n    return (hint === 'string' ? String : Number)(input);\n  }\n\n  function _toPropertyKey(arg) {\n    var key = _toPrimitive(arg, 'string');\n\n    return typeof key === 'symbol' ? key : String(key);\n  }\n\n  function _initializerWarningHelper(descriptor, context) {\n    throw new Error(\n      'Decorating class property failed. Please ensure that ' +\n        'proposal-class-properties is enabled and set to use loose mode. ' +\n        'To use proposal-class-properties in spec mode with decorators, wait for ' +\n        'the next major version of decorators in stage 2.'\n    );\n  }\n\n  function _initializerDefineProperty(target, property, descriptor, context) {\n    if (!descriptor) return;\n    Object.defineProperty(target, property, {\n      enumerable: descriptor.enumerable,\n      configurable: descriptor.configurable,\n      writable: descriptor.writable,\n      value: descriptor.initializer\n        ? descriptor.initializer.call(context)\n        : void 0\n    });\n  }\n\n  function _applyDecoratedDescriptor(\n    target,\n    property,\n    decorators,\n    descriptor,\n    context\n  ) {\n    var desc = {};\n    Object.keys(descriptor).forEach(function(key) {\n      desc[key] = descriptor[key];\n    });\n    desc.enumerable = !!desc.enumerable;\n    desc.configurable = !!desc.configurable;\n\n    if ('value' in desc || desc.initializer) {\n      desc.writable = true;\n    }\n\n    desc = decorators\n      .slice()\n      .reverse()\n      .reduce(function(desc, decorator) {\n        return decorator(target, property, desc) || desc;\n      }, desc);\n\n    if (context && desc.initializer !== void 0) {\n      desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n      desc.initializer = undefined;\n    }\n\n    if (desc.initializer === void 0) {\n      Object.defineProperty(target, property, desc);\n      desc = null;\n    }\n\n    return desc;\n  }\n\n  var id = 0;\n\n  function _classPrivateFieldLooseKey(name) {\n    return '__private_' + id++ + '_' + name;\n  }\n\n  function _classPrivateFieldLooseBase(receiver, privateKey) {\n    if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {\n      throw new TypeError('attempted to use private field on non-instance');\n    }\n\n    return receiver;\n  }\n\n  function _classPrivateFieldGet(receiver, privateMap) {\n    if (!privateMap.has(receiver)) {\n      throw new TypeError('attempted to get private field on non-instance');\n    }\n\n    var descriptor = privateMap.get(receiver);\n\n    if (descriptor.get) {\n      return descriptor.get.call(receiver);\n    }\n\n    return descriptor.value;\n  }\n\n  function _classPrivateFieldSet(receiver, privateMap, value) {\n    if (!privateMap.has(receiver)) {\n      throw new TypeError('attempted to set private field on non-instance');\n    }\n\n    var descriptor = privateMap.get(receiver);\n\n    if (descriptor.set) {\n      descriptor.set.call(receiver, value);\n    } else {\n      if (!descriptor.writable) {\n        throw new TypeError('attempted to set read only private field');\n      }\n\n      descriptor.value = value;\n    }\n\n    return value;\n  }\n\n  function _classStaticPrivateFieldSpecGet(\n    receiver,\n    classConstructor,\n    descriptor\n  ) {\n    if (receiver !== classConstructor) {\n      throw new TypeError('Private static access of wrong provenance');\n    }\n\n    return descriptor.value;\n  }\n\n  function _classStaticPrivateFieldSpecSet(\n    receiver,\n    classConstructor,\n    descriptor,\n    value\n  ) {\n    if (receiver !== classConstructor) {\n      throw new TypeError('Private static access of wrong provenance');\n    }\n\n    if (!descriptor.writable) {\n      throw new TypeError('attempted to set read only private field');\n    }\n\n    descriptor.value = value;\n    return value;\n  }\n\n  function _classStaticPrivateMethodGet(receiver, classConstructor, method) {\n    if (receiver !== classConstructor) {\n      throw new TypeError('Private static access of wrong provenance');\n    }\n\n    return method;\n  }\n\n  function _classStaticPrivateMethodSet() {\n    throw new TypeError('attempted to set read only static private field');\n  }\n\n  function _decorate(decorators, factory, superClass, mixins) {\n    var api = _getDecoratorsApi();\n\n    if (mixins) {\n      for (var i = 0; i < mixins.length; i++) {\n        api = mixins[i](api);\n      }\n    }\n\n    var r = factory(function initialize(O) {\n      api.initializeInstanceElements(O, decorated.elements);\n    }, superClass);\n    var decorated = api.decorateClass(\n      _coalesceClassElements(r.d.map(_createElementDescriptor)),\n      decorators\n    );\n    api.initializeClassElements(r.F, decorated.elements);\n    return api.runClassFinishers(r.F, decorated.finishers);\n  }\n\n  function _getDecoratorsApi() {\n    _getDecoratorsApi = function() {\n      return api;\n    };\n\n    var api = {\n      elementsDefinitionOrder: [['method'], ['field']],\n      initializeInstanceElements: function(O, elements) {\n        ['method', 'field'].forEach(function(kind) {\n          elements.forEach(function(element) {\n            if (element.kind === kind && element.placement === 'own') {\n              this.defineClassElement(O, element);\n            }\n          }, this);\n        }, this);\n      },\n      initializeClassElements: function(F, elements) {\n        var proto = F.prototype;\n        ['method', 'field'].forEach(function(kind) {\n          elements.forEach(function(element) {\n            var placement = element.placement;\n\n            if (\n              element.kind === kind &&\n              (placement === 'static' || placement === 'prototype')\n            ) {\n              var receiver = placement === 'static' ? F : proto;\n              this.defineClassElement(receiver, element);\n            }\n          }, this);\n        }, this);\n      },\n      defineClassElement: function(receiver, element) {\n        var descriptor = element.descriptor;\n\n        if (element.kind === 'field') {\n          var initializer = element.initializer;\n          descriptor = {\n            enumerable: descriptor.enumerable,\n            writable: descriptor.writable,\n            configurable: descriptor.configurable,\n            value: initializer === void 0 ? void 0 : initializer.call(receiver)\n          };\n        }\n\n        Object.defineProperty(receiver, element.key, descriptor);\n      },\n      decorateClass: function(elements, decorators) {\n        var newElements = [];\n        var finishers = [];\n        var placements = {\n          static: [],\n          prototype: [],\n          own: []\n        };\n        elements.forEach(function(element) {\n          this.addElementPlacement(element, placements);\n        }, this);\n        elements.forEach(function(element) {\n          if (!_hasDecorators(element)) return newElements.push(element);\n          var elementFinishersExtras = this.decorateElement(\n            element,\n            placements\n          );\n          newElements.push(elementFinishersExtras.element);\n          newElements.push.apply(newElements, elementFinishersExtras.extras);\n          finishers.push.apply(finishers, elementFinishersExtras.finishers);\n        }, this);\n\n        if (!decorators) {\n          return {\n            elements: newElements,\n            finishers: finishers\n          };\n        }\n\n        var result = this.decorateConstructor(newElements, decorators);\n        finishers.push.apply(finishers, result.finishers);\n        result.finishers = finishers;\n        return result;\n      },\n      addElementPlacement: function(element, placements, silent) {\n        var keys = placements[element.placement];\n\n        if (!silent && keys.indexOf(element.key) !== -1) {\n          throw new TypeError('Duplicated element (' + element.key + ')');\n        }\n\n        keys.push(element.key);\n      },\n      decorateElement: function(element, placements) {\n        var extras = [];\n        var finishers = [];\n\n        for (\n          var decorators = element.decorators, i = decorators.length - 1;\n          i >= 0;\n          i--\n        ) {\n          var keys = placements[element.placement];\n          keys.splice(keys.indexOf(element.key), 1);\n          var elementObject = this.fromElementDescriptor(element);\n          var elementFinisherExtras = this.toElementFinisherExtras(\n            (0, decorators[i])(elementObject) || elementObject\n          );\n          element = elementFinisherExtras.element;\n          this.addElementPlacement(element, placements);\n\n          if (elementFinisherExtras.finisher) {\n            finishers.push(elementFinisherExtras.finisher);\n          }\n\n          var newExtras = elementFinisherExtras.extras;\n\n          if (newExtras) {\n            for (var j = 0; j < newExtras.length; j++) {\n              this.addElementPlacement(newExtras[j], placements);\n            }\n\n            extras.push.apply(extras, newExtras);\n          }\n        }\n\n        return {\n          element: element,\n          finishers: finishers,\n          extras: extras\n        };\n      },\n      decorateConstructor: function(elements, decorators) {\n        var finishers = [];\n\n        for (var i = decorators.length - 1; i >= 0; i--) {\n          var obj = this.fromClassDescriptor(elements);\n          var elementsAndFinisher = this.toClassDescriptor(\n            (0, decorators[i])(obj) || obj\n          );\n\n          if (elementsAndFinisher.finisher !== undefined) {\n            finishers.push(elementsAndFinisher.finisher);\n          }\n\n          if (elementsAndFinisher.elements !== undefined) {\n            elements = elementsAndFinisher.elements;\n\n            for (var j = 0; j < elements.length - 1; j++) {\n              for (var k = j + 1; k < elements.length; k++) {\n                if (\n                  elements[j].key === elements[k].key &&\n                  elements[j].placement === elements[k].placement\n                ) {\n                  throw new TypeError(\n                    'Duplicated element (' + elements[j].key + ')'\n                  );\n                }\n              }\n            }\n          }\n        }\n\n        return {\n          elements: elements,\n          finishers: finishers\n        };\n      },\n      fromElementDescriptor: function(element) {\n        var obj = {\n          kind: element.kind,\n          key: element.key,\n          placement: element.placement,\n          descriptor: element.descriptor\n        };\n        var desc = {\n          value: 'Descriptor',\n          configurable: true\n        };\n        Object.defineProperty(obj, Symbol.toStringTag, desc);\n        if (element.kind === 'field') obj.initializer = element.initializer;\n        return obj;\n      },\n      toElementDescriptors: function(elementObjects) {\n        if (elementObjects === undefined) return;\n        return _toArray(elementObjects).map(function(elementObject) {\n          var element = this.toElementDescriptor(elementObject);\n          this.disallowProperty(\n            elementObject,\n            'finisher',\n            'An element descriptor'\n          );\n          this.disallowProperty(\n            elementObject,\n            'extras',\n            'An element descriptor'\n          );\n          return element;\n        }, this);\n      },\n      toElementDescriptor: function(elementObject) {\n        var kind = String(elementObject.kind);\n\n        if (kind !== 'method' && kind !== 'field') {\n          throw new TypeError(\n            'An element descriptor\\'s .kind property must be either \"method\" or' +\n              ' \"field\", but a decorator created an element descriptor with' +\n              ' .kind \"' +\n              kind +\n              '\"'\n          );\n        }\n\n        var key = _toPropertyKey(elementObject.key);\n\n        var placement = String(elementObject.placement);\n\n        if (\n          placement !== 'static' &&\n          placement !== 'prototype' &&\n          placement !== 'own'\n        ) {\n          throw new TypeError(\n            'An element descriptor\\'s .placement property must be one of \"static\",' +\n              ' \"prototype\" or \"own\", but a decorator created an element descriptor' +\n              ' with .placement \"' +\n              placement +\n              '\"'\n          );\n        }\n\n        var descriptor = elementObject.descriptor;\n        this.disallowProperty(\n          elementObject,\n          'elements',\n          'An element descriptor'\n        );\n        var element = {\n          kind: kind,\n          key: key,\n          placement: placement,\n          descriptor: Object.assign({}, descriptor)\n        };\n\n        if (kind !== 'field') {\n          this.disallowProperty(\n            elementObject,\n            'initializer',\n            'A method descriptor'\n          );\n        } else {\n          this.disallowProperty(\n            descriptor,\n            'get',\n            'The property descriptor of a field descriptor'\n          );\n          this.disallowProperty(\n            descriptor,\n            'set',\n            'The property descriptor of a field descriptor'\n          );\n          this.disallowProperty(\n            descriptor,\n            'value',\n            'The property descriptor of a field descriptor'\n          );\n          element.initializer = elementObject.initializer;\n        }\n\n        return element;\n      },\n      toElementFinisherExtras: function(elementObject) {\n        var element = this.toElementDescriptor(elementObject);\n\n        var finisher = _optionalCallableProperty(elementObject, 'finisher');\n\n        var extras = this.toElementDescriptors(elementObject.extras);\n        return {\n          element: element,\n          finisher: finisher,\n          extras: extras\n        };\n      },\n      fromClassDescriptor: function(elements) {\n        var obj = {\n          kind: 'class',\n          elements: elements.map(this.fromElementDescriptor, this)\n        };\n        var desc = {\n          value: 'Descriptor',\n          configurable: true\n        };\n        Object.defineProperty(obj, Symbol.toStringTag, desc);\n        return obj;\n      },\n      toClassDescriptor: function(obj) {\n        var kind = String(obj.kind);\n\n        if (kind !== 'class') {\n          throw new TypeError(\n            'A class descriptor\\'s .kind property must be \"class\", but a decorator' +\n              ' created a class descriptor with .kind \"' +\n              kind +\n              '\"'\n          );\n        }\n\n        this.disallowProperty(obj, 'key', 'A class descriptor');\n        this.disallowProperty(obj, 'placement', 'A class descriptor');\n        this.disallowProperty(obj, 'descriptor', 'A class descriptor');\n        this.disallowProperty(obj, 'initializer', 'A class descriptor');\n        this.disallowProperty(obj, 'extras', 'A class descriptor');\n\n        var finisher = _optionalCallableProperty(obj, 'finisher');\n\n        var elements = this.toElementDescriptors(obj.elements);\n        return {\n          elements: elements,\n          finisher: finisher\n        };\n      },\n      runClassFinishers: function(constructor, finishers) {\n        for (var i = 0; i < finishers.length; i++) {\n          var newConstructor = (0, finishers[i])(constructor);\n\n          if (newConstructor !== undefined) {\n            if (typeof newConstructor !== 'function') {\n              throw new TypeError('Finishers must return a constructor.');\n            }\n\n            constructor = newConstructor;\n          }\n        }\n\n        return constructor;\n      },\n      disallowProperty: function(obj, name, objectType) {\n        if (obj[name] !== undefined) {\n          throw new TypeError(\n            objectType + \" can't have a .\" + name + ' property.'\n          );\n        }\n      }\n    };\n    return api;\n  }\n\n  function _createElementDescriptor(def) {\n    var key = _toPropertyKey(def.key);\n\n    var descriptor;\n\n    if (def.kind === 'method') {\n      descriptor = {\n        value: def.value,\n        writable: true,\n        configurable: true,\n        enumerable: false\n      };\n    } else if (def.kind === 'get') {\n      descriptor = {\n        get: def.value,\n        configurable: true,\n        enumerable: false\n      };\n    } else if (def.kind === 'set') {\n      descriptor = {\n        set: def.value,\n        configurable: true,\n        enumerable: false\n      };\n    } else if (def.kind === 'field') {\n      descriptor = {\n        configurable: true,\n        writable: true,\n        enumerable: true\n      };\n    }\n\n    var element = {\n      kind: def.kind === 'field' ? 'field' : 'method',\n      key: key,\n      placement: def.static\n        ? 'static'\n        : def.kind === 'field'\n        ? 'own'\n        : 'prototype',\n      descriptor: descriptor\n    };\n    if (def.decorators) element.decorators = def.decorators;\n    if (def.kind === 'field') element.initializer = def.value;\n    return element;\n  }\n\n  function _coalesceGetterSetter(element, other) {\n    if (element.descriptor.get !== undefined) {\n      other.descriptor.get = element.descriptor.get;\n    } else {\n      other.descriptor.set = element.descriptor.set;\n    }\n  }\n\n  function _coalesceClassElements(elements) {\n    var newElements = [];\n\n    var isSameElement = function(other) {\n      return (\n        other.kind === 'method' &&\n        other.key === element.key &&\n        other.placement === element.placement\n      );\n    };\n\n    for (var i = 0; i < elements.length; i++) {\n      var element = elements[i];\n      var other;\n\n      if (\n        element.kind === 'method' &&\n        (other = newElements.find(isSameElement))\n      ) {\n        if (\n          _isDataDescriptor(element.descriptor) ||\n          _isDataDescriptor(other.descriptor)\n        ) {\n          if (_hasDecorators(element) || _hasDecorators(other)) {\n            throw new ReferenceError(\n              'Duplicated methods (' + element.key + \") can't be decorated.\"\n            );\n          }\n\n          other.descriptor = element.descriptor;\n        } else {\n          if (_hasDecorators(element)) {\n            if (_hasDecorators(other)) {\n              throw new ReferenceError(\n                \"Decorators can't be placed on different accessors with for \" +\n                  'the same property (' +\n                  element.key +\n                  ').'\n              );\n            }\n\n            other.decorators = element.decorators;\n          }\n\n          _coalesceGetterSetter(element, other);\n        }\n      } else {\n        newElements.push(element);\n      }\n    }\n\n    return newElements;\n  }\n\n  function _hasDecorators(element) {\n    return element.decorators && element.decorators.length;\n  }\n\n  function _isDataDescriptor(desc) {\n    return (\n      desc !== undefined &&\n      !(desc.value === undefined && desc.writable === undefined)\n    );\n  }\n\n  function _optionalCallableProperty(obj, name) {\n    var value = obj[name];\n\n    if (value !== undefined && typeof value !== 'function') {\n      throw new TypeError(\"Expected '\" + name + \"' to be a function\");\n    }\n\n    return value;\n  }\n\n  function _classPrivateMethodGet(receiver, privateSet, fn) {\n    if (!privateSet.has(receiver)) {\n      throw new TypeError('attempted to get private field on non-instance');\n    }\n\n    return fn;\n  }\n\n  function _classPrivateMethodSet() {\n    throw new TypeError('attempted to reassign private method');\n  }\n\n  function _wrapRegExp(re, groups) {\n    _wrapRegExp = function(re, groups) {\n      return new BabelRegExp(re, groups);\n    };\n\n    var _RegExp = _wrapNativeSuper(RegExp);\n\n    var _super = RegExp.prototype;\n\n    var _groups = new WeakMap();\n\n    function BabelRegExp(re, groups) {\n      var _this = _RegExp.call(this, re);\n\n      _groups.set(_this, groups);\n\n      return _this;\n    }\n\n    _inherits(BabelRegExp, _RegExp);\n\n    BabelRegExp.prototype.exec = function(str) {\n      var result = _super.exec.call(this, str);\n\n      if (result) result.groups = buildGroups(result, this);\n      return result;\n    };\n\n    BabelRegExp.prototype[Symbol.replace] = function(str, substitution) {\n      if (typeof substitution === 'string') {\n        var groups = _groups.get(this);\n\n        return _super[Symbol.replace].call(\n          this,\n          str,\n          substitution.replace(/\\$<([^>]+)>/g, function(_, name) {\n            return '$' + groups[name];\n          })\n        );\n      } else if (typeof substitution === 'function') {\n        var _this = this;\n\n        return _super[Symbol.replace].call(this, str, function() {\n          var args = [];\n          args.push.apply(args, arguments);\n\n          if (typeof args[args.length - 1] !== 'object') {\n            args.push(buildGroups(args, _this));\n          }\n\n          return substitution.apply(this, args);\n        });\n      } else {\n        return _super[Symbol.replace].call(this, str, substitution);\n      }\n    };\n\n    function buildGroups(result, re) {\n      var g = _groups.get(re);\n\n      return Object.keys(g).reduce(function(groups, name) {\n        groups[name] = result[g[name]];\n        return groups;\n      }, Object.create(null));\n    }\n\n    return _wrapRegExp.apply(this, arguments);\n  }\n\n  var vectorMultiply = function vectorMultiply(v, amount) {\n    return createVector(v.x * amount, v.y * amount);\n  };\n\n  var vectorAdd = function vectorAdd(a, b) {\n    return createVector(a.x + b.x, a.y + b.y);\n  };\n\n  var vectorNormalize = function vectorNormalize(v) {\n    var l = Math.sqrt(v.x * v.x + v.y * v.y);\n    if (l === 0) {\n      return {\n        x: 0,\n        y: 0\n      };\n    }\n    return createVector(v.x / l, v.y / l);\n  };\n\n  var vectorRotate = function vectorRotate(v, radians, origin) {\n    var cos = Math.cos(radians);\n    var sin = Math.sin(radians);\n    var t = createVector(v.x - origin.x, v.y - origin.y);\n    return createVector(\n      origin.x + cos * t.x - sin * t.y,\n      origin.y + sin * t.x + cos * t.y\n    );\n  };\n\n  var createVector = function createVector() {\n    var x =\n      arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n    var y =\n      arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n    return { x: x, y: y };\n  };\n\n  var getMarkupValue = function getMarkupValue(value, size) {\n    var scalar =\n      arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n    var axis = arguments.length > 3 ? arguments[3] : undefined;\n    if (typeof value === 'string') {\n      return parseFloat(value) * scalar;\n    }\n    if (typeof value === 'number') {\n      return value * (axis ? size[axis] : Math.min(size.width, size.height));\n    }\n    return;\n  };\n\n  var getMarkupStyles = function getMarkupStyles(markup, size, scale) {\n    var lineStyle = markup.borderStyle || markup.lineStyle || 'solid';\n    var fill = markup.backgroundColor || markup.fontColor || 'transparent';\n    var stroke = markup.borderColor || markup.lineColor || 'transparent';\n    var strokeWidth = getMarkupValue(\n      markup.borderWidth || markup.lineWidth,\n      size,\n      scale\n    );\n    var lineCap = markup.lineCap || 'round';\n    var lineJoin = markup.lineJoin || 'round';\n    var dashes =\n      typeof lineStyle === 'string'\n        ? ''\n        : lineStyle\n            .map(function(v) {\n              return getMarkupValue(v, size, scale);\n            })\n            .join(',');\n    var opacity = markup.opacity || 1;\n    return {\n      'stroke-linecap': lineCap,\n      'stroke-linejoin': lineJoin,\n      'stroke-width': strokeWidth || 0,\n      'stroke-dasharray': dashes,\n      stroke: stroke,\n      fill: fill,\n      opacity: opacity\n    };\n  };\n\n  var isDefined = function isDefined(value) {\n    return value != null;\n  };\n\n  var getMarkupRect = function getMarkupRect(rect, size) {\n    var scalar =\n      arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n\n    var left =\n      getMarkupValue(rect.x, size, scalar, 'width') ||\n      getMarkupValue(rect.left, size, scalar, 'width');\n    var top =\n      getMarkupValue(rect.y, size, scalar, 'height') ||\n      getMarkupValue(rect.top, size, scalar, 'height');\n    var width = getMarkupValue(rect.width, size, scalar, 'width');\n    var height = getMarkupValue(rect.height, size, scalar, 'height');\n    var right = getMarkupValue(rect.right, size, scalar, 'width');\n    var bottom = getMarkupValue(rect.bottom, size, scalar, 'height');\n\n    if (!isDefined(top)) {\n      if (isDefined(height) && isDefined(bottom)) {\n        top = size.height - height - bottom;\n      } else {\n        top = bottom;\n      }\n    }\n\n    if (!isDefined(left)) {\n      if (isDefined(width) && isDefined(right)) {\n        left = size.width - width - right;\n      } else {\n        left = right;\n      }\n    }\n\n    if (!isDefined(width)) {\n      if (isDefined(left) && isDefined(right)) {\n        width = size.width - left - right;\n      } else {\n        width = 0;\n      }\n    }\n\n    if (!isDefined(height)) {\n      if (isDefined(top) && isDefined(bottom)) {\n        height = size.height - top - bottom;\n      } else {\n        height = 0;\n      }\n    }\n\n    return {\n      x: left || 0,\n      y: top || 0,\n      width: width || 0,\n      height: height || 0\n    };\n  };\n\n  var pointsToPathShape = function pointsToPathShape(points) {\n    return points\n      .map(function(point, index) {\n        return ''\n          .concat(index === 0 ? 'M' : 'L', ' ')\n          .concat(point.x, ' ')\n          .concat(point.y);\n      })\n      .join(' ');\n  };\n\n  var setAttributes = function setAttributes(element, attr) {\n    return Object.keys(attr).forEach(function(key) {\n      return element.setAttribute(key, attr[key]);\n    });\n  };\n\n  var ns = 'http://www.w3.org/2000/svg';\n  var svg = function svg(tag, attr) {\n    var element = document.createElementNS(ns, tag);\n    if (attr) {\n      setAttributes(element, attr);\n    }\n    return element;\n  };\n\n  var updateRect = function updateRect(element) {\n    return setAttributes(\n      element,\n      Object.assign({}, element.rect, element.styles)\n    );\n  };\n\n  var updateEllipse = function updateEllipse(element) {\n    var cx = element.rect.x + element.rect.width * 0.5;\n    var cy = element.rect.y + element.rect.height * 0.5;\n    var rx = element.rect.width * 0.5;\n    var ry = element.rect.height * 0.5;\n    return setAttributes(\n      element,\n      Object.assign(\n        {\n          cx: cx,\n          cy: cy,\n          rx: rx,\n          ry: ry\n        },\n        element.styles\n      )\n    );\n  };\n\n  var IMAGE_FIT_STYLE = {\n    contain: 'xMidYMid meet',\n    cover: 'xMidYMid slice'\n  };\n\n  var updateImage = function updateImage(element, markup) {\n    setAttributes(\n      element,\n      Object.assign({}, element.rect, element.styles, {\n        preserveAspectRatio: IMAGE_FIT_STYLE[markup.fit] || 'none'\n      })\n    );\n  };\n\n  var TEXT_ANCHOR = {\n    left: 'start',\n    center: 'middle',\n    right: 'end'\n  };\n\n  var updateText = function updateText(element, markup, size, scale) {\n    var fontSize = getMarkupValue(markup.fontSize, size, scale);\n    var fontFamily = markup.fontFamily || 'sans-serif';\n    var fontWeight = markup.fontWeight || 'normal';\n    var textAlign = TEXT_ANCHOR[markup.textAlign] || 'start';\n\n    setAttributes(\n      element,\n      Object.assign({}, element.rect, element.styles, {\n        'stroke-width': 0,\n        'font-weight': fontWeight,\n        'font-size': fontSize,\n        'font-family': fontFamily,\n        'text-anchor': textAlign\n      })\n    );\n\n    // update text\n    if (element.text !== markup.text) {\n      element.text = markup.text;\n      element.textContent = markup.text.length ? markup.text : ' ';\n    }\n  };\n\n  var updateLine = function updateLine(element, markup, size, scale) {\n    setAttributes(\n      element,\n      Object.assign({}, element.rect, element.styles, {\n        fill: 'none'\n      })\n    );\n\n    var line = element.childNodes[0];\n    var begin = element.childNodes[1];\n    var end = element.childNodes[2];\n\n    var origin = element.rect;\n\n    var target = {\n      x: element.rect.x + element.rect.width,\n      y: element.rect.y + element.rect.height\n    };\n\n    setAttributes(line, {\n      x1: origin.x,\n      y1: origin.y,\n      x2: target.x,\n      y2: target.y\n    });\n\n    if (!markup.lineDecoration) return;\n\n    begin.style.display = 'none';\n    end.style.display = 'none';\n\n    var v = vectorNormalize({\n      x: target.x - origin.x,\n      y: target.y - origin.y\n    });\n\n    var l = getMarkupValue(0.05, size, scale);\n\n    if (markup.lineDecoration.indexOf('arrow-begin') !== -1) {\n      var arrowBeginRotationPoint = vectorMultiply(v, l);\n      var arrowBeginCenter = vectorAdd(origin, arrowBeginRotationPoint);\n      var arrowBeginA = vectorRotate(origin, 2, arrowBeginCenter);\n      var arrowBeginB = vectorRotate(origin, -2, arrowBeginCenter);\n\n      setAttributes(begin, {\n        style: 'display:block;',\n        d: 'M'\n          .concat(arrowBeginA.x, ',')\n          .concat(arrowBeginA.y, ' L')\n          .concat(origin.x, ',')\n          .concat(origin.y, ' L')\n          .concat(arrowBeginB.x, ',')\n          .concat(arrowBeginB.y)\n      });\n    }\n\n    if (markup.lineDecoration.indexOf('arrow-end') !== -1) {\n      var arrowEndRotationPoint = vectorMultiply(v, -l);\n      var arrowEndCenter = vectorAdd(target, arrowEndRotationPoint);\n      var arrowEndA = vectorRotate(target, 2, arrowEndCenter);\n      var arrowEndB = vectorRotate(target, -2, arrowEndCenter);\n\n      setAttributes(end, {\n        style: 'display:block;',\n        d: 'M'\n          .concat(arrowEndA.x, ',')\n          .concat(arrowEndA.y, ' L')\n          .concat(target.x, ',')\n          .concat(target.y, ' L')\n          .concat(arrowEndB.x, ',')\n          .concat(arrowEndB.y)\n      });\n    }\n  };\n\n  var updatePath = function updatePath(element, markup, size, scale) {\n    setAttributes(\n      element,\n      Object.assign({}, element.styles, {\n        fill: 'none',\n        d: pointsToPathShape(\n          markup.points.map(function(point) {\n            return {\n              x: getMarkupValue(point.x, size, scale, 'width'),\n              y: getMarkupValue(point.y, size, scale, 'height')\n            };\n          })\n        )\n      })\n    );\n  };\n\n  var createShape = function createShape(node) {\n    return function(markup) {\n      return svg(node, { id: markup.id });\n    };\n  };\n\n  var createImage = function createImage(markup) {\n    var shape = svg('image', {\n      id: markup.id,\n      'stroke-linecap': 'round',\n      'stroke-linejoin': 'round',\n      opacity: '0'\n    });\n\n    shape.onload = function() {\n      shape.setAttribute('opacity', markup.opacity || 1);\n    };\n    shape.setAttributeNS(\n      'http://www.w3.org/1999/xlink',\n      'xlink:href',\n      markup.src\n    );\n    return shape;\n  };\n\n  var createLine = function createLine(markup) {\n    var shape = svg('g', {\n      id: markup.id,\n      'stroke-linecap': 'round',\n      'stroke-linejoin': 'round'\n    });\n\n    var line = svg('line');\n    shape.appendChild(line);\n\n    var begin = svg('path');\n    shape.appendChild(begin);\n\n    var end = svg('path');\n    shape.appendChild(end);\n\n    return shape;\n  };\n\n  var CREATE_TYPE_ROUTES = {\n    image: createImage,\n    rect: createShape('rect'),\n    ellipse: createShape('ellipse'),\n    text: createShape('text'),\n    path: createShape('path'),\n    line: createLine\n  };\n\n  var UPDATE_TYPE_ROUTES = {\n    rect: updateRect,\n    ellipse: updateEllipse,\n    image: updateImage,\n    text: updateText,\n    path: updatePath,\n    line: updateLine\n  };\n\n  var createMarkupByType = function createMarkupByType(type, markup) {\n    return CREATE_TYPE_ROUTES[type](markup);\n  };\n\n  var updateMarkupByType = function updateMarkupByType(\n    element,\n    type,\n    markup,\n    size,\n    scale\n  ) {\n    if (type !== 'path') {\n      element.rect = getMarkupRect(markup, size, scale);\n    }\n    element.styles = getMarkupStyles(markup, size, scale);\n    UPDATE_TYPE_ROUTES[type](element, markup, size, scale);\n  };\n\n  var MARKUP_RECT = [\n    'x',\n    'y',\n    'left',\n    'top',\n    'right',\n    'bottom',\n    'width',\n    'height'\n  ];\n\n  var toOptionalFraction = function toOptionalFraction(value) {\n    return typeof value === 'string' && /%/.test(value)\n      ? parseFloat(value) / 100\n      : value;\n  };\n\n  // adds default markup properties, clones markup\n  var prepareMarkup = function prepareMarkup(markup) {\n    var _markup = _slicedToArray(markup, 2),\n      type = _markup[0],\n      props = _markup[1];\n\n    var rect = props.points\n      ? {}\n      : MARKUP_RECT.reduce(function(prev, curr) {\n          prev[curr] = toOptionalFraction(props[curr]);\n          return prev;\n        }, {});\n\n    return [\n      type,\n      Object.assign(\n        {\n          zIndex: 0\n        },\n        props,\n        rect\n      )\n    ];\n  };\n\n  var sortMarkupByZIndex = function sortMarkupByZIndex(a, b) {\n    if (a[1].zIndex > b[1].zIndex) {\n      return 1;\n    }\n    if (a[1].zIndex < b[1].zIndex) {\n      return -1;\n    }\n    return 0;\n  };\n\n  var createMarkupView = function createMarkupView(_) {\n    return _.utils.createView({\n      name: 'image-preview-markup',\n      tag: 'svg',\n      ignoreRect: true,\n      mixins: {\n        apis: ['width', 'height', 'crop', 'markup', 'resize', 'dirty']\n      },\n\n      write: function write(_ref) {\n        var root = _ref.root,\n          props = _ref.props;\n\n        if (!props.dirty) return;\n        var crop = props.crop,\n          resize = props.resize,\n          markup = props.markup;\n\n        var viewWidth = props.width;\n        var viewHeight = props.height;\n\n        var cropWidth = crop.width;\n        var cropHeight = crop.height;\n\n        if (resize) {\n          var _size = resize.size;\n\n          var outputWidth = _size && _size.width;\n          var outputHeight = _size && _size.height;\n          var outputFit = resize.mode;\n          var outputUpscale = resize.upscale;\n\n          if (outputWidth && !outputHeight) outputHeight = outputWidth;\n          if (outputHeight && !outputWidth) outputWidth = outputHeight;\n\n          var shouldUpscale =\n            cropWidth < outputWidth && cropHeight < outputHeight;\n\n          if (!shouldUpscale || (shouldUpscale && outputUpscale)) {\n            var scalarWidth = outputWidth / cropWidth;\n            var scalarHeight = outputHeight / cropHeight;\n\n            if (outputFit === 'force') {\n              cropWidth = outputWidth;\n              cropHeight = outputHeight;\n            } else {\n              var scalar;\n              if (outputFit === 'cover') {\n                scalar = Math.max(scalarWidth, scalarHeight);\n              } else if (outputFit === 'contain') {\n                scalar = Math.min(scalarWidth, scalarHeight);\n              }\n              cropWidth = cropWidth * scalar;\n              cropHeight = cropHeight * scalar;\n            }\n          }\n        }\n\n        var size = {\n          width: viewWidth,\n          height: viewHeight\n        };\n\n        root.element.setAttribute('width', size.width);\n        root.element.setAttribute('height', size.height);\n\n        var scale = Math.min(viewWidth / cropWidth, viewHeight / cropHeight);\n\n        // clear\n        root.element.innerHTML = '';\n\n        // get filter\n        var markupFilter = root.query('GET_IMAGE_PREVIEW_MARKUP_FILTER');\n\n        // draw new\n        markup\n          .filter(markupFilter)\n          .map(prepareMarkup)\n          .sort(sortMarkupByZIndex)\n          .forEach(function(markup) {\n            var _markup = _slicedToArray(markup, 2),\n              type = _markup[0],\n              settings = _markup[1];\n\n            // create\n            var element = createMarkupByType(type, settings);\n\n            // update\n            updateMarkupByType(element, type, settings, size, scale);\n\n            // add\n            root.element.appendChild(element);\n          });\n      }\n    });\n  };\n\n  var createVector$1 = function createVector(x, y) {\n    return { x: x, y: y };\n  };\n\n  var vectorDot = function vectorDot(a, b) {\n    return a.x * b.x + a.y * b.y;\n  };\n\n  var vectorSubtract = function vectorSubtract(a, b) {\n    return createVector$1(a.x - b.x, a.y - b.y);\n  };\n\n  var vectorDistanceSquared = function vectorDistanceSquared(a, b) {\n    return vectorDot(vectorSubtract(a, b), vectorSubtract(a, b));\n  };\n\n  var vectorDistance = function vectorDistance(a, b) {\n    return Math.sqrt(vectorDistanceSquared(a, b));\n  };\n\n  var getOffsetPointOnEdge = function getOffsetPointOnEdge(length, rotation) {\n    var a = length;\n\n    var A = 1.5707963267948966;\n    var B = rotation;\n    var C = 1.5707963267948966 - rotation;\n\n    var sinA = Math.sin(A);\n    var sinB = Math.sin(B);\n    var sinC = Math.sin(C);\n    var cosC = Math.cos(C);\n    var ratio = a / sinA;\n    var b = ratio * sinB;\n    var c = ratio * sinC;\n\n    return createVector$1(cosC * b, cosC * c);\n  };\n\n  var getRotatedRectSize = function getRotatedRectSize(rect, rotation) {\n    var w = rect.width;\n    var h = rect.height;\n\n    var hor = getOffsetPointOnEdge(w, rotation);\n    var ver = getOffsetPointOnEdge(h, rotation);\n\n    var tl = createVector$1(rect.x + Math.abs(hor.x), rect.y - Math.abs(hor.y));\n\n    var tr = createVector$1(\n      rect.x + rect.width + Math.abs(ver.y),\n      rect.y + Math.abs(ver.x)\n    );\n\n    var bl = createVector$1(\n      rect.x - Math.abs(ver.y),\n      rect.y + rect.height - Math.abs(ver.x)\n    );\n\n    return {\n      width: vectorDistance(tl, tr),\n      height: vectorDistance(tl, bl)\n    };\n  };\n\n  var calculateCanvasSize = function calculateCanvasSize(\n    image,\n    canvasAspectRatio\n  ) {\n    var zoom =\n      arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n\n    var imageAspectRatio = image.height / image.width;\n\n    // determine actual pixels on x and y axis\n    var canvasWidth = 1;\n    var canvasHeight = canvasAspectRatio;\n    var imgWidth = 1;\n    var imgHeight = imageAspectRatio;\n    if (imgHeight > canvasHeight) {\n      imgHeight = canvasHeight;\n      imgWidth = imgHeight / imageAspectRatio;\n    }\n\n    var scalar = Math.max(canvasWidth / imgWidth, canvasHeight / imgHeight);\n    var width = image.width / (zoom * scalar * imgWidth);\n    var height = width * canvasAspectRatio;\n\n    return {\n      width: width,\n      height: height\n    };\n  };\n\n  var getImageRectZoomFactor = function getImageRectZoomFactor(\n    imageRect,\n    cropRect,\n    rotation,\n    center\n  ) {\n    // calculate available space round image center position\n    var cx = center.x > 0.5 ? 1 - center.x : center.x;\n    var cy = center.y > 0.5 ? 1 - center.y : center.y;\n    var imageWidth = cx * 2 * imageRect.width;\n    var imageHeight = cy * 2 * imageRect.height;\n\n    // calculate rotated crop rectangle size\n    var rotatedCropSize = getRotatedRectSize(cropRect, rotation);\n\n    // calculate scalar required to fit image\n    return Math.max(\n      rotatedCropSize.width / imageWidth,\n      rotatedCropSize.height / imageHeight\n    );\n  };\n\n  var getCenteredCropRect = function getCenteredCropRect(\n    container,\n    aspectRatio\n  ) {\n    var width = container.width;\n    var height = width * aspectRatio;\n    if (height > container.height) {\n      height = container.height;\n      width = height / aspectRatio;\n    }\n    var x = (container.width - width) * 0.5;\n    var y = (container.height - height) * 0.5;\n\n    return {\n      x: x,\n      y: y,\n      width: width,\n      height: height\n    };\n  };\n\n  var getCurrentCropSize = function getCurrentCropSize(imageSize) {\n    var crop =\n      arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n    var zoom = crop.zoom,\n      rotation = crop.rotation,\n      center = crop.center,\n      aspectRatio = crop.aspectRatio;\n\n    if (!aspectRatio) aspectRatio = imageSize.height / imageSize.width;\n\n    var canvasSize = calculateCanvasSize(imageSize, aspectRatio, zoom);\n\n    var canvasCenter = {\n      x: canvasSize.width * 0.5,\n      y: canvasSize.height * 0.5\n    };\n\n    var stage = {\n      x: 0,\n      y: 0,\n      width: canvasSize.width,\n      height: canvasSize.height,\n      center: canvasCenter\n    };\n\n    var shouldLimit = typeof crop.scaleToFit === 'undefined' || crop.scaleToFit;\n\n    var stageZoomFactor = getImageRectZoomFactor(\n      imageSize,\n      getCenteredCropRect(stage, aspectRatio),\n      rotation,\n      shouldLimit ? center : { x: 0.5, y: 0.5 }\n    );\n\n    var scale = zoom * stageZoomFactor;\n\n    // start drawing\n    return {\n      widthFloat: canvasSize.width / scale,\n      heightFloat: canvasSize.height / scale,\n      width: Math.round(canvasSize.width / scale),\n      height: Math.round(canvasSize.height / scale)\n    };\n  };\n\n  var IMAGE_SCALE_SPRING_PROPS = {\n    type: 'spring',\n    stiffness: 0.5,\n    damping: 0.45,\n    mass: 10\n  };\n\n  // does horizontal and vertical flipping\n  var createBitmapView = function createBitmapView(_) {\n    return _.utils.createView({\n      name: 'image-bitmap',\n      ignoreRect: true,\n      mixins: { styles: ['scaleX', 'scaleY'] },\n      create: function create(_ref) {\n        var root = _ref.root,\n          props = _ref.props;\n        root.appendChild(props.image);\n      }\n    });\n  };\n\n  // shifts and rotates image\n  var createImageCanvasWrapper = function createImageCanvasWrapper(_) {\n    return _.utils.createView({\n      name: 'image-canvas-wrapper',\n      tag: 'div',\n      ignoreRect: true,\n      mixins: {\n        apis: ['crop', 'width', 'height'],\n\n        styles: [\n          'originX',\n          'originY',\n          'translateX',\n          'translateY',\n          'scaleX',\n          'scaleY',\n          'rotateZ'\n        ],\n\n        animations: {\n          originX: IMAGE_SCALE_SPRING_PROPS,\n          originY: IMAGE_SCALE_SPRING_PROPS,\n          scaleX: IMAGE_SCALE_SPRING_PROPS,\n          scaleY: IMAGE_SCALE_SPRING_PROPS,\n          translateX: IMAGE_SCALE_SPRING_PROPS,\n          translateY: IMAGE_SCALE_SPRING_PROPS,\n          rotateZ: IMAGE_SCALE_SPRING_PROPS\n        }\n      },\n\n      create: function create(_ref2) {\n        var root = _ref2.root,\n          props = _ref2.props;\n        props.width = props.image.width;\n        props.height = props.image.height;\n        root.ref.bitmap = root.appendChildView(\n          root.createChildView(createBitmapView(_), { image: props.image })\n        );\n      },\n      write: function write(_ref3) {\n        var root = _ref3.root,\n          props = _ref3.props;\n        var flip = props.crop.flip;\n        var bitmap = root.ref.bitmap;\n        bitmap.scaleX = flip.horizontal ? -1 : 1;\n        bitmap.scaleY = flip.vertical ? -1 : 1;\n      }\n    });\n  };\n\n  // clips canvas to correct aspect ratio\n  var createClipView = function createClipView(_) {\n    return _.utils.createView({\n      name: 'image-clip',\n      tag: 'div',\n      ignoreRect: true,\n      mixins: {\n        apis: [\n          'crop',\n          'markup',\n          'resize',\n          'width',\n          'height',\n          'dirty',\n          'background'\n        ],\n\n        styles: ['width', 'height', 'opacity'],\n        animations: {\n          opacity: { type: 'tween', duration: 250 }\n        }\n      },\n\n      didWriteView: function didWriteView(_ref4) {\n        var root = _ref4.root,\n          props = _ref4.props;\n        if (!props.background) return;\n        root.element.style.backgroundColor = props.background;\n      },\n      create: function create(_ref5) {\n        var root = _ref5.root,\n          props = _ref5.props;\n\n        root.ref.image = root.appendChildView(\n          root.createChildView(\n            createImageCanvasWrapper(_),\n            Object.assign({}, props)\n          )\n        );\n\n        root.ref.createMarkup = function() {\n          if (root.ref.markup) return;\n          root.ref.markup = root.appendChildView(\n            root.createChildView(createMarkupView(_), Object.assign({}, props))\n          );\n        };\n\n        root.ref.destroyMarkup = function() {\n          if (!root.ref.markup) return;\n          root.removeChildView(root.ref.markup);\n          root.ref.markup = null;\n        };\n\n        // set up transparency grid\n        var transparencyIndicator = root.query(\n          'GET_IMAGE_PREVIEW_TRANSPARENCY_INDICATOR'\n        );\n        if (transparencyIndicator === null) return;\n\n        // grid pattern\n        if (transparencyIndicator === 'grid') {\n          root.element.dataset.transparencyIndicator = transparencyIndicator;\n        }\n        // basic color\n        else {\n          root.element.dataset.transparencyIndicator = 'color';\n        }\n      },\n      write: function write(_ref6) {\n        var root = _ref6.root,\n          props = _ref6.props,\n          shouldOptimize = _ref6.shouldOptimize;\n        var crop = props.crop,\n          markup = props.markup,\n          resize = props.resize,\n          dirty = props.dirty,\n          width = props.width,\n          height = props.height;\n\n        root.ref.image.crop = crop;\n\n        var stage = {\n          x: 0,\n          y: 0,\n          width: width,\n          height: height,\n          center: {\n            x: width * 0.5,\n            y: height * 0.5\n          }\n        };\n\n        var image = {\n          width: root.ref.image.width,\n          height: root.ref.image.height\n        };\n\n        var origin = {\n          x: crop.center.x * image.width,\n          y: crop.center.y * image.height\n        };\n\n        var translation = {\n          x: stage.center.x - image.width * crop.center.x,\n          y: stage.center.y - image.height * crop.center.y\n        };\n\n        var rotation = Math.PI * 2 + (crop.rotation % (Math.PI * 2));\n\n        var cropAspectRatio = crop.aspectRatio || image.height / image.width;\n\n        var shouldLimit =\n          typeof crop.scaleToFit === 'undefined' || crop.scaleToFit;\n\n        var stageZoomFactor = getImageRectZoomFactor(\n          image,\n          getCenteredCropRect(stage, cropAspectRatio),\n\n          rotation,\n          shouldLimit ? crop.center : { x: 0.5, y: 0.5 }\n        );\n\n        var scale = crop.zoom * stageZoomFactor;\n\n        // update markup view\n        if (markup && markup.length) {\n          root.ref.createMarkup();\n          root.ref.markup.width = width;\n          root.ref.markup.height = height;\n          root.ref.markup.resize = resize;\n          root.ref.markup.dirty = dirty;\n          root.ref.markup.markup = markup;\n          root.ref.markup.crop = getCurrentCropSize(image, crop);\n        } else if (root.ref.markup) {\n          root.ref.destroyMarkup();\n        }\n\n        // update image view\n        var imageView = root.ref.image;\n\n        // don't update clip layout\n        if (shouldOptimize) {\n          imageView.originX = null;\n          imageView.originY = null;\n          imageView.translateX = null;\n          imageView.translateY = null;\n          imageView.rotateZ = null;\n          imageView.scaleX = null;\n          imageView.scaleY = null;\n          return;\n        }\n\n        imageView.originX = origin.x;\n        imageView.originY = origin.y;\n        imageView.translateX = translation.x;\n        imageView.translateY = translation.y;\n        imageView.rotateZ = rotation;\n        imageView.scaleX = scale;\n        imageView.scaleY = scale;\n      }\n    });\n  };\n\n  var createImageView = function createImageView(_) {\n    return _.utils.createView({\n      name: 'image-preview',\n      tag: 'div',\n      ignoreRect: true,\n      mixins: {\n        apis: ['image', 'crop', 'markup', 'resize', 'dirty', 'background'],\n\n        styles: ['translateY', 'scaleX', 'scaleY', 'opacity'],\n\n        animations: {\n          scaleX: IMAGE_SCALE_SPRING_PROPS,\n          scaleY: IMAGE_SCALE_SPRING_PROPS,\n          translateY: IMAGE_SCALE_SPRING_PROPS,\n          opacity: { type: 'tween', duration: 400 }\n        }\n      },\n\n      create: function create(_ref7) {\n        var root = _ref7.root,\n          props = _ref7.props;\n        root.ref.clip = root.appendChildView(\n          root.createChildView(createClipView(_), {\n            id: props.id,\n            image: props.image,\n            crop: props.crop,\n            markup: props.markup,\n            resize: props.resize,\n            dirty: props.dirty,\n            background: props.background\n          })\n        );\n      },\n      write: function write(_ref8) {\n        var root = _ref8.root,\n          props = _ref8.props,\n          shouldOptimize = _ref8.shouldOptimize;\n        var clip = root.ref.clip;\n        var image = props.image,\n          crop = props.crop,\n          markup = props.markup,\n          resize = props.resize,\n          dirty = props.dirty;\n\n        clip.crop = crop;\n        clip.markup = markup;\n        clip.resize = resize;\n        clip.dirty = dirty;\n\n        // don't update clip layout\n        clip.opacity = shouldOptimize ? 0 : 1;\n\n        // don't re-render if optimizing or hidden (width will be zero resulting in weird animations)\n        if (shouldOptimize || root.rect.element.hidden) return;\n\n        // calculate scaled preview image size\n        var imageAspectRatio = image.height / image.width;\n        var aspectRatio = crop.aspectRatio || imageAspectRatio;\n\n        // calculate container size\n        var containerWidth = root.rect.inner.width;\n        var containerHeight = root.rect.inner.height;\n\n        var fixedPreviewHeight = root.query('GET_IMAGE_PREVIEW_HEIGHT');\n        var minPreviewHeight = root.query('GET_IMAGE_PREVIEW_MIN_HEIGHT');\n        var maxPreviewHeight = root.query('GET_IMAGE_PREVIEW_MAX_HEIGHT');\n\n        var panelAspectRatio = root.query('GET_PANEL_ASPECT_RATIO');\n        var allowMultiple = root.query('GET_ALLOW_MULTIPLE');\n\n        if (panelAspectRatio && !allowMultiple) {\n          fixedPreviewHeight = containerWidth * panelAspectRatio;\n          aspectRatio = panelAspectRatio;\n        }\n\n        // determine clip width and height\n        var clipHeight =\n          fixedPreviewHeight !== null\n            ? fixedPreviewHeight\n            : Math.max(\n                minPreviewHeight,\n                Math.min(containerWidth * aspectRatio, maxPreviewHeight)\n              );\n\n        var clipWidth = clipHeight / aspectRatio;\n        if (clipWidth > containerWidth) {\n          clipWidth = containerWidth;\n          clipHeight = clipWidth * aspectRatio;\n        }\n\n        if (clipHeight > containerHeight) {\n          clipHeight = containerHeight;\n          clipWidth = containerHeight / aspectRatio;\n        }\n\n        clip.width = clipWidth;\n        clip.height = clipHeight;\n      }\n    });\n  };\n\n  var SVG_MASK =\n    '<svg width=\"500\" height=\"200\" viewBox=\"0 0 500 200\" preserveAspectRatio=\"none\">\\n    <defs>\\n        <radialGradient id=\"gradient-__UID__\" cx=\".5\" cy=\"1.25\" r=\"1.15\">\\n            <stop offset=\\'50%\\' stop-color=\\'#000000\\'/>\\n            <stop offset=\\'56%\\' stop-color=\\'#0a0a0a\\'/>\\n            <stop offset=\\'63%\\' stop-color=\\'#262626\\'/>\\n            <stop offset=\\'69%\\' stop-color=\\'#4f4f4f\\'/>\\n            <stop offset=\\'75%\\' stop-color=\\'#808080\\'/>\\n            <stop offset=\\'81%\\' stop-color=\\'#b1b1b1\\'/>\\n            <stop offset=\\'88%\\' stop-color=\\'#dadada\\'/>\\n            <stop offset=\\'94%\\' stop-color=\\'#f6f6f6\\'/>\\n            <stop offset=\\'100%\\' stop-color=\\'#ffffff\\'/>\\n        </radialGradient>\\n        <mask id=\"mask-__UID__\">\\n            <rect x=\"0\" y=\"0\" width=\"500\" height=\"200\" fill=\"url(#gradient-__UID__)\"></rect>\\n        </mask>\\n    </defs>\\n    <rect x=\"0\" width=\"500\" height=\"200\" fill=\"currentColor\" mask=\"url(#mask-__UID__)\"></rect>\\n</svg>';\n\n  var SVGMaskUniqueId = 0;\n\n  var createImageOverlayView = function createImageOverlayView(fpAPI) {\n    return fpAPI.utils.createView({\n      name: 'image-preview-overlay',\n      tag: 'div',\n      ignoreRect: true,\n      create: function create(_ref) {\n        var root = _ref.root,\n          props = _ref.props;\n        var mask = SVG_MASK;\n        if (document.querySelector('base')) {\n          var url = new URL(\n            window.location.href.replace(window.location.hash, '')\n          ).href;\n          mask = mask.replace(/url\\(\\#/g, 'url(' + url + '#');\n        }\n\n        SVGMaskUniqueId++;\n        root.element.classList.add(\n          'filepond--image-preview-overlay-'.concat(props.status)\n        );\n\n        root.element.innerHTML = mask.replace(/__UID__/g, SVGMaskUniqueId);\n      },\n      mixins: {\n        styles: ['opacity'],\n        animations: {\n          opacity: { type: 'spring', mass: 25 }\n        }\n      }\n    });\n  };\n\n  /**\n   * Bitmap Worker\n   */\n  var BitmapWorker = function BitmapWorker() {\n    self.onmessage = function(e) {\n      createImageBitmap(e.data.message.file).then(function(bitmap) {\n        self.postMessage({ id: e.data.id, message: bitmap }, [bitmap]);\n      });\n    };\n  };\n\n  /**\n   * ColorMatrix Worker\n   */\n  var ColorMatrixWorker = function ColorMatrixWorker() {\n    self.onmessage = function(e) {\n      var imageData = e.data.message.imageData;\n      var matrix = e.data.message.colorMatrix;\n\n      var data = imageData.data;\n      var l = data.length;\n\n      var m11 = matrix[0];\n      var m12 = matrix[1];\n      var m13 = matrix[2];\n      var m14 = matrix[3];\n      var m15 = matrix[4];\n\n      var m21 = matrix[5];\n      var m22 = matrix[6];\n      var m23 = matrix[7];\n      var m24 = matrix[8];\n      var m25 = matrix[9];\n\n      var m31 = matrix[10];\n      var m32 = matrix[11];\n      var m33 = matrix[12];\n      var m34 = matrix[13];\n      var m35 = matrix[14];\n\n      var m41 = matrix[15];\n      var m42 = matrix[16];\n      var m43 = matrix[17];\n      var m44 = matrix[18];\n      var m45 = matrix[19];\n\n      var index = 0,\n        r = 0.0,\n        g = 0.0,\n        b = 0.0,\n        a = 0.0;\n\n      for (; index < l; index += 4) {\n        r = data[index] / 255;\n        g = data[index + 1] / 255;\n        b = data[index + 2] / 255;\n        a = data[index + 3] / 255;\n        data[index] = Math.max(\n          0,\n          Math.min((r * m11 + g * m12 + b * m13 + a * m14 + m15) * 255, 255)\n        );\n        data[index + 1] = Math.max(\n          0,\n          Math.min((r * m21 + g * m22 + b * m23 + a * m24 + m25) * 255, 255)\n        );\n        data[index + 2] = Math.max(\n          0,\n          Math.min((r * m31 + g * m32 + b * m33 + a * m34 + m35) * 255, 255)\n        );\n        data[index + 3] = Math.max(\n          0,\n          Math.min((r * m41 + g * m42 + b * m43 + a * m44 + m45) * 255, 255)\n        );\n      }\n\n      self.postMessage({ id: e.data.id, message: imageData }, [\n        imageData.data.buffer\n      ]);\n    };\n  };\n\n  var getImageSize = function getImageSize(url, cb) {\n    var image = new Image();\n    image.onload = function() {\n      var width = image.naturalWidth;\n      var height = image.naturalHeight;\n      image = null;\n      cb(width, height);\n    };\n    image.src = url;\n  };\n\n  var transforms = {\n    1: function _() {\n      return [1, 0, 0, 1, 0, 0];\n    },\n    2: function _(width) {\n      return [-1, 0, 0, 1, width, 0];\n    },\n    3: function _(width, height) {\n      return [-1, 0, 0, -1, width, height];\n    },\n    4: function _(width, height) {\n      return [1, 0, 0, -1, 0, height];\n    },\n    5: function _() {\n      return [0, 1, 1, 0, 0, 0];\n    },\n    6: function _(width, height) {\n      return [0, 1, -1, 0, height, 0];\n    },\n    7: function _(width, height) {\n      return [0, -1, -1, 0, height, width];\n    },\n    8: function _(width) {\n      return [0, -1, 1, 0, 0, width];\n    }\n  };\n\n  var fixImageOrientation = function fixImageOrientation(\n    ctx,\n    width,\n    height,\n    orientation\n  ) {\n    // no orientation supplied\n    if (orientation === -1) {\n      return;\n    }\n\n    ctx.transform.apply(ctx, transforms[orientation](width, height));\n  };\n\n  // draws the preview image to canvas\n  var createPreviewImage = function createPreviewImage(\n    data,\n    width,\n    height,\n    orientation\n  ) {\n    // can't draw on half pixels\n    width = Math.round(width);\n    height = Math.round(height);\n\n    // draw image\n    var canvas = document.createElement('canvas');\n    canvas.width = width;\n    canvas.height = height;\n    var ctx = canvas.getContext('2d');\n\n    // if is rotated incorrectly swap width and height\n    if (orientation >= 5 && orientation <= 8) {\n      var _ref = [height, width];\n      width = _ref[0];\n      height = _ref[1];\n    }\n\n    // correct image orientation\n    fixImageOrientation(ctx, width, height, orientation);\n\n    // draw the image\n    ctx.drawImage(data, 0, 0, width, height);\n\n    return canvas;\n  };\n\n  var isBitmap = function isBitmap(file) {\n    return /^image/.test(file.type) && !/svg/.test(file.type);\n  };\n\n  var MAX_WIDTH = 10;\n  var MAX_HEIGHT = 10;\n\n  var calculateAverageColor = function calculateAverageColor(image) {\n    var scalar = Math.min(MAX_WIDTH / image.width, MAX_HEIGHT / image.height);\n\n    var canvas = document.createElement('canvas');\n    var ctx = canvas.getContext('2d');\n    var width = (canvas.width = Math.ceil(image.width * scalar));\n    var height = (canvas.height = Math.ceil(image.height * scalar));\n    ctx.drawImage(image, 0, 0, width, height);\n    var data = null;\n    try {\n      data = ctx.getImageData(0, 0, width, height).data;\n    } catch (e) {\n      return null;\n    }\n    var l = data.length;\n\n    var r = 0;\n    var g = 0;\n    var b = 0;\n    var i = 0;\n\n    for (; i < l; i += 4) {\n      r += data[i] * data[i];\n      g += data[i + 1] * data[i + 1];\n      b += data[i + 2] * data[i + 2];\n    }\n\n    r = averageColor(r, l);\n    g = averageColor(g, l);\n    b = averageColor(b, l);\n\n    return { r: r, g: g, b: b };\n  };\n\n  var averageColor = function averageColor(c, l) {\n    return Math.floor(Math.sqrt(c / (l / 4)));\n  };\n\n  var cloneCanvas = function cloneCanvas(origin, target) {\n    target = target || document.createElement('canvas');\n    target.width = origin.width;\n    target.height = origin.height;\n    var ctx = target.getContext('2d');\n    ctx.drawImage(origin, 0, 0);\n    return target;\n  };\n\n  var cloneImageData = function cloneImageData(imageData) {\n    var id;\n    try {\n      id = new ImageData(imageData.width, imageData.height);\n    } catch (e) {\n      var canvas = document.createElement('canvas');\n      var ctx = canvas.getContext('2d');\n      id = ctx.createImageData(imageData.width, imageData.height);\n    }\n    id.data.set(new Uint8ClampedArray(imageData.data));\n    return id;\n  };\n\n  var loadImage = function loadImage(url) {\n    return new Promise(function(resolve, reject) {\n      var img = new Image();\n      img.crossOrigin = 'Anonymous';\n      img.onload = function() {\n        resolve(img);\n      };\n      img.onerror = function(e) {\n        reject(e);\n      };\n      img.src = url;\n    });\n  };\n\n  var createImageWrapperView = function createImageWrapperView(_) {\n    // create overlay view\n    var OverlayView = createImageOverlayView(_);\n\n    var ImageView = createImageView(_);\n    var createWorker = _.utils.createWorker;\n\n    var applyFilter = function applyFilter(root, filter, target) {\n      return new Promise(function(resolve) {\n        // will store image data for future filter updates\n        if (!root.ref.imageData) {\n          root.ref.imageData = target\n            .getContext('2d')\n            .getImageData(0, 0, target.width, target.height);\n        }\n\n        // get image data reference\n        var imageData = cloneImageData(root.ref.imageData);\n\n        if (!filter || filter.length !== 20) {\n          target.getContext('2d').putImageData(imageData, 0, 0);\n          return resolve();\n        }\n\n        var worker = createWorker(ColorMatrixWorker);\n        worker.post(\n          {\n            imageData: imageData,\n            colorMatrix: filter\n          },\n\n          function(response) {\n            // apply filtered colors\n            target.getContext('2d').putImageData(response, 0, 0);\n\n            // stop worker\n            worker.terminate();\n\n            // done!\n            resolve();\n          },\n          [imageData.data.buffer]\n        );\n      });\n    };\n\n    var removeImageView = function removeImageView(root, imageView) {\n      root.removeChildView(imageView);\n      imageView.image.width = 1;\n      imageView.image.height = 1;\n      imageView._destroy();\n    };\n\n    // remove an image\n    var shiftImage = function shiftImage(_ref) {\n      var root = _ref.root;\n      var imageView = root.ref.images.shift();\n      imageView.opacity = 0;\n      imageView.translateY = -15;\n      root.ref.imageViewBin.push(imageView);\n      return imageView;\n    };\n\n    // add new image\n    var pushImage = function pushImage(_ref2) {\n      var root = _ref2.root,\n        props = _ref2.props,\n        image = _ref2.image;\n      var id = props.id;\n      var item = root.query('GET_ITEM', { id: id });\n      if (!item) return;\n\n      var crop = item.getMetadata('crop') || {\n        center: {\n          x: 0.5,\n          y: 0.5\n        },\n\n        flip: {\n          horizontal: false,\n          vertical: false\n        },\n\n        zoom: 1,\n        rotation: 0,\n        aspectRatio: null\n      };\n\n      var background = root.query(\n        'GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR'\n      );\n\n      var markup;\n      var resize;\n      var dirty = false;\n      if (root.query('GET_IMAGE_PREVIEW_MARKUP_SHOW')) {\n        markup = item.getMetadata('markup') || [];\n        resize = item.getMetadata('resize');\n        dirty = true;\n      }\n\n      // append image presenter\n      var imageView = root.appendChildView(\n        root.createChildView(ImageView, {\n          id: id,\n          image: image,\n          crop: crop,\n          resize: resize,\n          markup: markup,\n          dirty: dirty,\n          background: background,\n          opacity: 0,\n          scaleX: 1.15,\n          scaleY: 1.15,\n          translateY: 15\n        }),\n\n        root.childViews.length\n      );\n\n      root.ref.images.push(imageView);\n\n      // reveal the preview image\n      imageView.opacity = 1;\n      imageView.scaleX = 1;\n      imageView.scaleY = 1;\n      imageView.translateY = 0;\n\n      // the preview is now ready to be drawn\n      setTimeout(function() {\n        root.dispatch('DID_IMAGE_PREVIEW_SHOW', { id: id });\n      }, 250);\n    };\n\n    var updateImage = function updateImage(_ref3) {\n      var root = _ref3.root,\n        props = _ref3.props;\n      var item = root.query('GET_ITEM', { id: props.id });\n      if (!item) return;\n      var imageView = root.ref.images[root.ref.images.length - 1];\n      imageView.crop = item.getMetadata('crop');\n      imageView.background = root.query(\n        'GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR'\n      );\n\n      if (root.query('GET_IMAGE_PREVIEW_MARKUP_SHOW')) {\n        imageView.dirty = true;\n        imageView.resize = item.getMetadata('resize');\n        imageView.markup = item.getMetadata('markup');\n      }\n    };\n\n    // replace image preview\n    var didUpdateItemMetadata = function didUpdateItemMetadata(_ref4) {\n      var root = _ref4.root,\n        props = _ref4.props,\n        action = _ref4.action;\n      // only filter and crop trigger redraw\n      if (!/crop|filter|markup|resize/.test(action.change.key)) return;\n\n      // no images to update, exit\n      if (!root.ref.images.length) return;\n\n      // no item found, exit\n      var item = root.query('GET_ITEM', { id: props.id });\n      if (!item) return;\n\n      // for now, update existing image when filtering\n      if (/filter/.test(action.change.key)) {\n        var imageView = root.ref.images[root.ref.images.length - 1];\n        applyFilter(root, action.change.value, imageView.image);\n        return;\n      }\n\n      if (/crop|markup|resize/.test(action.change.key)) {\n        var crop = item.getMetadata('crop');\n        var image = root.ref.images[root.ref.images.length - 1];\n\n        // if aspect ratio has changed, we need to create a new image\n        if (\n          crop &&\n          crop.aspectRatio &&\n          image.crop &&\n          image.crop.aspectRatio &&\n          Math.abs(crop.aspectRatio - image.crop.aspectRatio) > 0.00001\n        ) {\n          var _imageView = shiftImage({ root: root });\n          pushImage({\n            root: root,\n            props: props,\n            image: cloneCanvas(_imageView.image)\n          });\n        }\n        // if not, we can update the current image\n        else {\n          updateImage({ root: root, props: props });\n        }\n      }\n    };\n\n    var canCreateImageBitmap = function canCreateImageBitmap(file) {\n      // Firefox versions before 58 will freeze when running createImageBitmap\n      // in a Web Worker so we detect those versions and return false for support\n      var userAgent = window.navigator.userAgent;\n      var isFirefox = userAgent.match(/Firefox\\/([0-9]+)\\./);\n      var firefoxVersion = isFirefox ? parseInt(isFirefox[1]) : null;\n      if (firefoxVersion !== null && firefoxVersion <= 58) return false;\n\n      return 'createImageBitmap' in window && isBitmap(file);\n    };\n\n    /**\n     * Write handler for when preview container has been created\n     */\n    var didCreatePreviewContainer = function didCreatePreviewContainer(_ref5) {\n      var root = _ref5.root,\n        props = _ref5.props;\n      var id = props.id;\n\n      // we need to get the file data to determine the eventual image size\n      var item = root.query('GET_ITEM', id);\n      if (!item) return;\n\n      // get url to file (we'll revoke it later on when done)\n      var fileURL = URL.createObjectURL(item.file);\n\n      // determine image size of this item\n      getImageSize(fileURL, function(width, height) {\n        // we can now scale the panel to the final size\n        root.dispatch('DID_IMAGE_PREVIEW_CALCULATE_SIZE', {\n          id: id,\n          width: width,\n          height: height\n        });\n      });\n    };\n\n    var drawPreview = function drawPreview(_ref6) {\n      var root = _ref6.root,\n        props = _ref6.props;\n      var id = props.id;\n\n      // we need to get the file data to determine the eventual image size\n      var item = root.query('GET_ITEM', id);\n      if (!item) return;\n\n      // get url to file (we'll revoke it later on when done)\n      var fileURL = URL.createObjectURL(item.file);\n\n      // fallback\n      var loadPreviewFallback = function loadPreviewFallback() {\n        // let's scale the image in the main thread :(\n        loadImage(fileURL).then(previewImageLoaded);\n      };\n\n      // image is now ready\n      var previewImageLoaded = function previewImageLoaded(imageData) {\n        // the file url is no longer needed\n        URL.revokeObjectURL(fileURL);\n\n        // draw the scaled down version here and use that as source so bitmapdata can be closed\n        // orientation info\n        var exif = item.getMetadata('exif') || {};\n        var orientation = exif.orientation || -1;\n\n        // get width and height from action, and swap if orientation is incorrect\n        var width = imageData.width,\n          height = imageData.height;\n\n        // if no width or height, just return early.\n        if (!width || !height) return;\n\n        if (orientation >= 5 && orientation <= 8) {\n          var _ref7 = [height, width];\n          width = _ref7[0];\n          height = _ref7[1];\n        }\n\n        // scale canvas based on pixel density\n        // we multiply by .75 as that creates smaller but still clear images on screens with high res displays\n        var pixelDensityFactor = Math.max(1, window.devicePixelRatio * 0.75);\n\n        // we want as much pixels to work with as possible,\n        // this multiplies the minimum image resolution,\n        // so when zooming in it doesn't get too blurry\n        var zoomFactor = root.query('GET_IMAGE_PREVIEW_ZOOM_FACTOR');\n\n        // imaeg scale factor\n        var scaleFactor = zoomFactor * pixelDensityFactor;\n\n        // calculate scaled preview image size\n        var previewImageRatio = height / width;\n\n        // calculate image preview height and width\n        var previewContainerWidth = root.rect.element.width;\n        var previewContainerHeight = root.rect.element.height;\n\n        var imageWidth = previewContainerWidth;\n        var imageHeight = imageWidth * previewImageRatio;\n\n        if (previewImageRatio > 1) {\n          imageWidth = Math.min(width, previewContainerWidth * scaleFactor);\n          imageHeight = imageWidth * previewImageRatio;\n        } else {\n          imageHeight = Math.min(height, previewContainerHeight * scaleFactor);\n          imageWidth = imageHeight / previewImageRatio;\n        }\n\n        // transfer to image tag so no canvas memory wasted on iOS\n        var previewImage = createPreviewImage(\n          imageData,\n          imageWidth,\n          imageHeight,\n          orientation\n        );\n\n        // done\n        var done = function done() {\n          // calculate average image color, disabled for now\n          var averageColor = root.query(\n            'GET_IMAGE_PREVIEW_CALCULATE_AVERAGE_IMAGE_COLOR'\n          )\n            ? calculateAverageColor(data)\n            : null;\n          item.setMetadata('color', averageColor, true);\n\n          // data has been transferred to canvas ( if was ImageBitmap )\n          if ('close' in imageData) {\n            imageData.close();\n          }\n\n          // show the overlay\n          root.ref.overlayShadow.opacity = 1;\n\n          // create the first image\n          pushImage({ root: root, props: props, image: previewImage });\n        };\n\n        // apply filter\n        var filter = item.getMetadata('filter');\n        if (filter) {\n          applyFilter(root, filter, previewImage).then(done);\n        } else {\n          done();\n        }\n      };\n\n      // if we support scaling using createImageBitmap we use a worker\n      if (canCreateImageBitmap(item.file)) {\n        // let's scale the image in a worker\n        var worker = createWorker(BitmapWorker);\n\n        worker.post(\n          {\n            file: item.file\n          },\n\n          function(imageBitmap) {\n            // destroy worker\n            worker.terminate();\n\n            // no bitmap returned, must be something wrong,\n            // try the oldschool way\n            if (!imageBitmap) {\n              loadPreviewFallback();\n              return;\n            }\n\n            // yay we got our bitmap, let's continue showing the preview\n            previewImageLoaded(imageBitmap);\n          }\n        );\n      } else {\n        // create fallback preview\n        loadPreviewFallback();\n      }\n    };\n\n    /**\n     * Write handler for when the preview image is ready to be animated\n     */\n    var didDrawPreview = function didDrawPreview(_ref8) {\n      var root = _ref8.root;\n      // get last added image\n      var image = root.ref.images[root.ref.images.length - 1];\n      image.translateY = 0;\n      image.scaleX = 1.0;\n      image.scaleY = 1.0;\n      image.opacity = 1;\n    };\n\n    /**\n     * Write handler for when the preview has been loaded\n     */\n    var restoreOverlay = function restoreOverlay(_ref9) {\n      var root = _ref9.root;\n      root.ref.overlayShadow.opacity = 1;\n      root.ref.overlayError.opacity = 0;\n      root.ref.overlaySuccess.opacity = 0;\n    };\n\n    var didThrowError = function didThrowError(_ref10) {\n      var root = _ref10.root;\n      root.ref.overlayShadow.opacity = 0.25;\n      root.ref.overlayError.opacity = 1;\n    };\n\n    var didCompleteProcessing = function didCompleteProcessing(_ref11) {\n      var root = _ref11.root;\n      root.ref.overlayShadow.opacity = 0.25;\n      root.ref.overlaySuccess.opacity = 1;\n    };\n\n    /**\n     * Constructor\n     */\n    var create = function create(_ref12) {\n      var root = _ref12.root;\n      // image view\n      root.ref.images = [];\n\n      // the preview image data (we need this to filter the image)\n      root.ref.imageData = null;\n\n      // image bin\n      root.ref.imageViewBin = [];\n\n      // image overlays\n      root.ref.overlayShadow = root.appendChildView(\n        root.createChildView(OverlayView, {\n          opacity: 0,\n          status: 'idle'\n        })\n      );\n\n      root.ref.overlaySuccess = root.appendChildView(\n        root.createChildView(OverlayView, {\n          opacity: 0,\n          status: 'success'\n        })\n      );\n\n      root.ref.overlayError = root.appendChildView(\n        root.createChildView(OverlayView, {\n          opacity: 0,\n          status: 'failure'\n        })\n      );\n    };\n\n    return _.utils.createView({\n      name: 'image-preview-wrapper',\n      create: create,\n      styles: ['height'],\n      apis: ['height'],\n      destroy: function destroy(_ref13) {\n        var root = _ref13.root;\n        // we resize the image so memory on iOS 12 is released more quickly (it seems)\n        root.ref.images.forEach(function(imageView) {\n          imageView.image.width = 1;\n          imageView.image.height = 1;\n        });\n      },\n      didWriteView: function didWriteView(_ref14) {\n        var root = _ref14.root;\n        root.ref.images.forEach(function(imageView) {\n          imageView.dirty = false;\n        });\n      },\n      write: _.utils.createRoute(\n        {\n          // image preview stated\n          DID_IMAGE_PREVIEW_DRAW: didDrawPreview,\n          DID_IMAGE_PREVIEW_CONTAINER_CREATE: didCreatePreviewContainer,\n          DID_FINISH_CALCULATE_PREVIEWSIZE: drawPreview,\n          DID_UPDATE_ITEM_METADATA: didUpdateItemMetadata,\n\n          // file states\n          DID_THROW_ITEM_LOAD_ERROR: didThrowError,\n          DID_THROW_ITEM_PROCESSING_ERROR: didThrowError,\n          DID_THROW_ITEM_INVALID: didThrowError,\n          DID_COMPLETE_ITEM_PROCESSING: didCompleteProcessing,\n          DID_START_ITEM_PROCESSING: restoreOverlay,\n          DID_REVERT_ITEM_PROCESSING: restoreOverlay\n        },\n\n        function(_ref15) {\n          var root = _ref15.root;\n          // views on death row\n          var viewsToRemove = root.ref.imageViewBin.filter(function(imageView) {\n            return imageView.opacity === 0;\n          });\n\n          // views to retain\n          root.ref.imageViewBin = root.ref.imageViewBin.filter(function(\n            imageView\n          ) {\n            return imageView.opacity > 0;\n          });\n\n          // remove these views\n          viewsToRemove.forEach(function(imageView) {\n            return removeImageView(root, imageView);\n          });\n          viewsToRemove.length = 0;\n        }\n      )\n    });\n  };\n\n  /**\n   * Image Preview Plugin\n   */\n  var plugin = function plugin(fpAPI) {\n    var addFilter = fpAPI.addFilter,\n      utils = fpAPI.utils;\n    var Type = utils.Type,\n      createRoute = utils.createRoute,\n      isFile = utils.isFile;\n\n    // imagePreviewView\n    var imagePreviewView = createImageWrapperView(fpAPI);\n\n    // called for each view that is created right after the 'create' method\n    addFilter('CREATE_VIEW', function(viewAPI) {\n      // get reference to created view\n      var is = viewAPI.is,\n        view = viewAPI.view,\n        query = viewAPI.query;\n\n      // only hook up to item view and only if is enabled for this cropper\n      if (!is('file') || !query('GET_ALLOW_IMAGE_PREVIEW')) return;\n\n      // create the image preview plugin, but only do so if the item is an image\n      var didLoadItem = function didLoadItem(_ref) {\n        var root = _ref.root,\n          props = _ref.props;\n        var id = props.id;\n        var item = query('GET_ITEM', id);\n\n        // item could theoretically have been removed in the mean time\n        if (!item || !isFile(item.file) || item.archived) return;\n\n        // get the file object\n        var file = item.file;\n\n        // exit if this is not an image\n        if (!isPreviewableImage(file)) return;\n\n        // test if is filtered\n        if (!query('GET_IMAGE_PREVIEW_FILTER_ITEM')(item)) return;\n\n        // exit if image size is too high and no createImageBitmap support\n        // this would simply bring the browser to its knees and that is not what we want\n        var supportsCreateImageBitmap = 'createImageBitmap' in (window || {});\n        var maxPreviewFileSize = query('GET_IMAGE_PREVIEW_MAX_FILE_SIZE');\n        if (\n          !supportsCreateImageBitmap &&\n          maxPreviewFileSize &&\n          file.size > maxPreviewFileSize\n        )\n          return;\n\n        // set preview view\n        root.ref.imagePreview = view.appendChildView(\n          view.createChildView(imagePreviewView, { id: id })\n        );\n\n        // update height if is fixed\n        var fixedPreviewHeight = root.query('GET_IMAGE_PREVIEW_HEIGHT');\n        if (fixedPreviewHeight) {\n          root.dispatch('DID_UPDATE_PANEL_HEIGHT', {\n            id: item.id,\n            height: fixedPreviewHeight\n          });\n        }\n\n        // now ready\n        var queue =\n          !supportsCreateImageBitmap &&\n          file.size > query('GET_IMAGE_PREVIEW_MAX_INSTANT_PREVIEW_FILE_SIZE');\n        root.dispatch('DID_IMAGE_PREVIEW_CONTAINER_CREATE', { id: id }, queue);\n      };\n\n      var rescaleItem = function rescaleItem(root, props) {\n        if (!root.ref.imagePreview) return;\n        var id = props.id;\n\n        // get item\n        var item = root.query('GET_ITEM', { id: id });\n        if (!item) return;\n\n        // if is fixed height or panel has aspect ratio, exit here, height has already been defined\n        var panelAspectRatio = root.query('GET_PANEL_ASPECT_RATIO');\n        var itemPanelAspectRatio = root.query('GET_ITEM_PANEL_ASPECT_RATIO');\n        var fixedHeight = root.query('GET_IMAGE_PREVIEW_HEIGHT');\n        if (panelAspectRatio || itemPanelAspectRatio || fixedHeight) return;\n\n        // no data!\n        var _root$ref = root.ref,\n          imageWidth = _root$ref.imageWidth,\n          imageHeight = _root$ref.imageHeight;\n        if (!imageWidth || !imageHeight) return;\n\n        // get height min and max\n        var minPreviewHeight = root.query('GET_IMAGE_PREVIEW_MIN_HEIGHT');\n        var maxPreviewHeight = root.query('GET_IMAGE_PREVIEW_MAX_HEIGHT');\n\n        // orientation info\n        var exif = item.getMetadata('exif') || {};\n        var orientation = exif.orientation || -1;\n\n        // get width and height from action, and swap of orientation is incorrect\n        if (orientation >= 5 && orientation <= 8) {\n          var _ref2 = [imageHeight, imageWidth];\n          imageWidth = _ref2[0];\n          imageHeight = _ref2[1];\n        }\n\n        // scale up width and height when we're dealing with an SVG\n        if (!isBitmap(item.file) || root.query('GET_IMAGE_PREVIEW_UPSCALE')) {\n          var scalar = 2048 / imageWidth;\n          imageWidth *= scalar;\n          imageHeight *= scalar;\n        }\n\n        // image aspect ratio\n        var imageAspectRatio = imageHeight / imageWidth;\n\n        // we need the item to get to the crop size\n        var previewAspectRatio =\n          (item.getMetadata('crop') || {}).aspectRatio || imageAspectRatio;\n\n        // preview height range\n        var previewHeightMax = Math.max(\n          minPreviewHeight,\n          Math.min(imageHeight, maxPreviewHeight)\n        );\n\n        var itemWidth = root.rect.element.width;\n        var previewHeight = Math.min(\n          itemWidth * previewAspectRatio,\n          previewHeightMax\n        );\n\n        // request update to panel height\n        root.dispatch('DID_UPDATE_PANEL_HEIGHT', {\n          id: item.id,\n          height: previewHeight\n        });\n      };\n\n      var didResizeView = function didResizeView(_ref3) {\n        var root = _ref3.root;\n        // actions in next write operation\n        root.ref.shouldRescale = true;\n      };\n\n      var didUpdateItemMetadata = function didUpdateItemMetadata(_ref4) {\n        var root = _ref4.root,\n          action = _ref4.action;\n        if (action.change.key !== 'crop') return;\n\n        // actions in next write operation\n        root.ref.shouldRescale = true;\n      };\n\n      var didCalculatePreviewSize = function didCalculatePreviewSize(_ref5) {\n        var root = _ref5.root,\n          action = _ref5.action;\n        // remember dimensions\n        root.ref.imageWidth = action.width;\n        root.ref.imageHeight = action.height;\n\n        // actions in next write operation\n        root.ref.shouldRescale = true;\n        root.ref.shouldDrawPreview = true;\n\n        // as image load could take a while and fire when draw loop is resting we need to give it a kick\n        root.dispatch('KICK');\n      };\n\n      // start writing\n      view.registerWriter(\n        createRoute(\n          {\n            DID_RESIZE_ROOT: didResizeView,\n            DID_STOP_RESIZE: didResizeView,\n            DID_LOAD_ITEM: didLoadItem,\n            DID_IMAGE_PREVIEW_CALCULATE_SIZE: didCalculatePreviewSize,\n            DID_UPDATE_ITEM_METADATA: didUpdateItemMetadata\n          },\n\n          function(_ref6) {\n            var root = _ref6.root,\n              props = _ref6.props;\n            // no preview view attached\n            if (!root.ref.imagePreview) return;\n\n            // don't do anything while hidden\n            if (root.rect.element.hidden) return;\n\n            // resize the item panel\n            if (root.ref.shouldRescale) {\n              rescaleItem(root, props);\n              root.ref.shouldRescale = false;\n            }\n\n            if (root.ref.shouldDrawPreview) {\n              // queue till next frame so we're sure the height has been applied this forces the draw image call inside the wrapper view to use the correct height\n              requestAnimationFrame(function() {\n                // this requestAnimationFrame nesting is horrible but it fixes an issue with 100hz displays on Chrome\n                // https://github.com/pqina/filepond-plugin-image-preview/issues/57\n                requestAnimationFrame(function() {\n                  root.dispatch('DID_FINISH_CALCULATE_PREVIEWSIZE', {\n                    id: props.id\n                  });\n                });\n              });\n\n              root.ref.shouldDrawPreview = false;\n            }\n          }\n        )\n      );\n    });\n\n    // expose plugin\n    return {\n      options: {\n        // Enable or disable image preview\n        allowImagePreview: [true, Type.BOOLEAN],\n\n        // filters file items to determine which are shown as preview\n        imagePreviewFilterItem: [\n          function() {\n            return true;\n          },\n          Type.FUNCTION\n        ],\n\n        // Fixed preview height\n        imagePreviewHeight: [null, Type.INT],\n\n        // Min image height\n        imagePreviewMinHeight: [44, Type.INT],\n\n        // Max image height\n        imagePreviewMaxHeight: [256, Type.INT],\n\n        // Max size of preview file for when createImageBitmap is not supported\n        imagePreviewMaxFileSize: [null, Type.INT],\n\n        // The amount of extra pixels added to the image preview to allow comfortable zooming\n        imagePreviewZoomFactor: [2, Type.INT],\n\n        // Should we upscale small images to fit the max bounding box of the preview area\n        imagePreviewUpscale: [false, Type.BOOLEAN],\n\n        // Max size of preview file that we allow to try to instant preview if createImageBitmap is not supported, else image is queued for loading\n        imagePreviewMaxInstantPreviewFileSize: [1000000, Type.INT],\n\n        // Style of the transparancy indicator used behind images\n        imagePreviewTransparencyIndicator: [null, Type.STRING],\n\n        // Enables or disables reading average image color\n        imagePreviewCalculateAverageImageColor: [false, Type.BOOLEAN],\n\n        // Enables or disables the previewing of markup\n        imagePreviewMarkupShow: [true, Type.BOOLEAN],\n\n        // Allows filtering of markup to only show certain shapes\n        imagePreviewMarkupFilter: [\n          function() {\n            return true;\n          },\n          Type.FUNCTION\n        ]\n      }\n    };\n  };\n\n  // fire pluginloaded event if running in browser, this allows registering the plugin when using async script tags\n  var isBrowser =\n    typeof window !== 'undefined' && typeof window.document !== 'undefined';\n  if (isBrowser) {\n    document.dispatchEvent(\n      new CustomEvent('FilePond:pluginloaded', { detail: plugin })\n    );\n  }\n\n  return plugin;\n});\n"
  },
  {
    "path": "libs/hinting/javascript-hint.js",
    "content": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n(function(mod) {\n  if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n    mod(require(\"../../lib/codemirror\"));\n  else if (typeof define == \"function\" && define.amd) // AMD\n    define([\"../../lib/codemirror\"], mod);\n  else // Plain browser env\n    mod(CodeMirror);\n})(function(CodeMirror) {\n  var Pos = CodeMirror.Pos;\n\n  function forEach(arr, f) {\n    for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);\n  }\n\n  function arrayContains(arr, item) {\n    if (!Array.prototype.indexOf) {\n      var i = arr.length;\n      while (i--) {\n        if (arr[i] === item) {\n          return true;\n        }\n      }\n      return false;\n    }\n    return arr.indexOf(item) != -1;\n  }\n\n  function scriptHint(editor, keywords, getToken, options) {\n    // Find the token at the cursor\n    var cur = editor.getCursor(), token = getToken(editor, cur);\n    if (/\\b(?:string|comment)\\b/.test(token.type)) return;\n    token.state = CodeMirror.innerMode(editor.getMode(), token.state).state;\n\n    // If it's not a 'word-style' token, ignore the token.\n    if (!/^[\\w$_]*$/.test(token.string)) {\n      token = {start: cur.ch, end: cur.ch, string: \"\", state: token.state,\n               type: token.string == \".\" ? \"property\" : null};\n    } else if (token.end > cur.ch) {\n      token.end = cur.ch;\n      token.string = token.string.slice(0, cur.ch - token.start);\n    }\n\n    var tprop = token;\n    // If it is a property, find out what it is a property of.\n    while (tprop.type == \"property\") {\n      tprop = getToken(editor, Pos(cur.line, tprop.start));\n      if (tprop.string != \".\") return;\n      tprop = getToken(editor, Pos(cur.line, tprop.start));\n      if (!context) var context = [];\n      context.push(tprop);\n    }\n    return {list: getCompletions(token, context, keywords, options),\n            from: Pos(cur.line, token.start),\n            to: Pos(cur.line, token.end)};\n  }\n\n  function javascriptHint(editor, options) {\n    return scriptHint(editor, javascriptKeywords,\n                      function (e, cur) {return e.getTokenAt(cur);},\n                      options);\n  };\n  CodeMirror.registerHelper(\"hint\", \"javascript\", javascriptHint);\n\n  function getCoffeeScriptToken(editor, cur) {\n  // This getToken, it is for coffeescript, imitates the behavior of\n  // getTokenAt method in javascript.js, that is, returning \"property\"\n  // type and treat \".\" as indepenent token.\n    var token = editor.getTokenAt(cur);\n    if (cur.ch == token.start + 1 && token.string.charAt(0) == '.') {\n      token.end = token.start;\n      token.string = '.';\n      token.type = \"property\";\n    }\n    else if (/^\\.[\\w$_]*$/.test(token.string)) {\n      token.type = \"property\";\n      token.start++;\n      token.string = token.string.replace(/\\./, '');\n    }\n    return token;\n  }\n\n  function coffeescriptHint(editor, options) {\n    return scriptHint(editor, coffeescriptKeywords, getCoffeeScriptToken, options);\n  }\n  CodeMirror.registerHelper(\"hint\", \"coffeescript\", coffeescriptHint);\n\n  var stringProps = (\"charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight \" +\n                     \"toUpperCase toLowerCase split concat match replace search\").split(\" \");\n  var arrayProps = (\"length concat join splice push pop shift unshift slice reverse sort indexOf \" +\n                    \"lastIndexOf every some filter forEach map reduce reduceRight \").split(\" \");\n  var funcProps = \"prototype apply call bind\".split(\" \");\n  var javascriptKeywords = (\"break case catch continue debugger default delete do else false finally for function \" +\n                  \"if in instanceof new null return switch throw true try typeof var void while with\").split(\" \");\n  var coffeescriptKeywords = (\"and break catch class continue delete do else extends false finally for \" +\n                  \"if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes\").split(\" \");\n\n  function forAllProps(obj, callback) {\n    if (!Object.getOwnPropertyNames || !Object.getPrototypeOf) {\n      for (var name in obj) callback(name)\n    } else {\n      for (var o = obj; o; o = Object.getPrototypeOf(o))\n        Object.getOwnPropertyNames(o).forEach(callback)\n    }\n  }\n\n  function getCompletions(token, context, keywords, options) {\n    var found = [], start = token.string, global = options && options.globalScope || window;\n    function maybeAdd(str) {\n      if (str.lastIndexOf(start, 0) == 0 && !arrayContains(found, str)) found.push(str);\n    }\n    function gatherCompletions(obj) {\n      if (typeof obj == \"string\") forEach(stringProps, maybeAdd);\n      else if (obj instanceof Array) forEach(arrayProps, maybeAdd);\n      else if (obj instanceof Function) forEach(funcProps, maybeAdd);\n      forAllProps(obj, maybeAdd)\n    }\n\n    if (context && context.length) {\n      // If this is a property, see if it belongs to some object we can\n      // find in the current environment.\n      var obj = context.pop(), base;\n      if (obj.type && obj.type.indexOf(\"variable\") === 0) {\n        if (options && options.additionalContext)\n          base = options.additionalContext[obj.string];\n        if (!options || options.useGlobalScope !== false)\n          base = base || global[obj.string];\n      } else if (obj.type == \"string\") {\n        base = \"\";\n      } else if (obj.type == \"atom\") {\n        base = 1;\n      } else if (obj.type == \"function\") {\n        if (global.jQuery != null && (obj.string == '$' || obj.string == 'jQuery') &&\n            (typeof global.jQuery == 'function'))\n          base = global.jQuery();\n        else if (global._ != null && (obj.string == '_') && (typeof global._ == 'function'))\n          base = global._();\n      }\n      while (base != null && context.length)\n        base = base[context.pop().string];\n      if (base != null) gatherCompletions(base);\n    } else {\n      // If not, just look in the global object and any local scope\n      // (reading into JS mode internals to get at the local and global variables)\n      for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name);\n      for (var v = token.state.globalVars; v; v = v.next) maybeAdd(v.name);\n      if (!options || options.useGlobalScope !== false)\n        gatherCompletions(global);\n      forEach(keywords, maybeAdd);\n    }\n    return found;\n  }\n});\n"
  },
  {
    "path": "libs/hinting/python-hint.js",
    "content": "(function () {\n  function forEach(arr, f) {\n    for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);\n  }\n\n  function arrayContains(arr, item) {\n    if (!Array.prototype.indexOf) {\n      var i = arr.length;\n      while (i--) {\n        if (arr[i] === item) {\n          return true;\n        }\n      }\n      return false;\n    }\n    return arr.indexOf(item) != -1;\n  }\n\n  function scriptHint(editor, _keywords, getToken) {\n    // Find the token at the cursor\n    var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token;\n    // If it's not a 'word-style' token, ignore the token.\n\n    if (!/^[\\w$_]*$/.test(token.string)) {\n        token = tprop = {start: cur.ch, end: cur.ch, string: \"\", state: token.state,\n                         className: token.string == \":\" ? \"python-type\" : null};\n    }\n\n    if (!context) var context = [];\n    context.push(tprop);\n\n    var completionList = getCompletions(token, context);\n    completionList = completionList.sort();\n    //prevent autocomplete for last word, instead show dropdown with one word\n    if(completionList.length == 1) {\n      completionList.push(\" \");\n    }\n\n    return {list: completionList,\n            from: CodeMirror.Pos(cur.line, token.start),\n            to: CodeMirror.Pos(cur.line, token.end)};\n  }\n\n  CodeMirror.pythonHint = function(editor) {\n    return scriptHint(editor, pythonKeywordsU, function (e, cur) {return e.getTokenAt(cur);});\n  };\n\n  var pythonKeywords = \"and del from not while as elif global or with assert else if pass yield\"\n+ \"break except import print class exec in raise continue finally is return def for lambda try\";\n  var pythonKeywordsL = pythonKeywords.split(\" \");\n  var pythonKeywordsU = pythonKeywords.toUpperCase().split(\" \");\n\n  var pythonBuiltins = \"abs divmod input open staticmethod all enumerate int ord str \"\n+ \"any eval isinstance pow sum basestring execfile issubclass print super\"\n+ \"bin file iter property tuple bool filter len range type\"\n+ \"bytearray float list raw_input unichr callable format locals reduce unicode\"\n+ \"chr frozenset long reload vars classmethod getattr map repr xrange\"\n+ \"cmp globals max reversed zip compile hasattr memoryview round __import__\"\n+ \"complex hash min set apply delattr help next setattr buffer\"\n+ \"dict hex object slice coerce dir id oct sorted intern \";\n  var pythonBuiltinsL = pythonBuiltins.split(\" \").join(\"() \").split(\" \");\n  var pythonBuiltinsU = pythonBuiltins.toUpperCase().split(\" \").join(\"() \").split(\" \");\n\n  function getCompletions(token, context) {\n    var found = [], start = token.string;\n    function maybeAdd(str) {\n      if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str);\n    }\n\n    function gatherCompletions(_obj) {\n        forEach(pythonBuiltinsL, maybeAdd);\n        forEach(pythonBuiltinsU, maybeAdd);\n        forEach(pythonKeywordsL, maybeAdd);\n        forEach(pythonKeywordsU, maybeAdd);\n    }\n\n    if (context) {\n      // If this is a property, see if it belongs to some object we can\n      // find in the current environment.\n      var obj = context.pop(), base;\n\n      if (obj.type == \"variable\")\n          base = obj.string;\n      else if(obj.type == \"variable-3\")\n          base = \":\" + obj.string;\n\n      while (base != null && context.length)\n        base = base[context.pop().string];\n      if (base != null) gatherCompletions(base);\n    }\n    return found;\n  }\n})();"
  },
  {
    "path": "libs/hinting/show-hint.css",
    "content": ".CodeMirror-hints {\n  position: absolute;\n  z-index: 10;\n  overflow: hidden;\n  list-style: none;\n\n  margin: 0;\n  padding: 2px;\n\n  -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n  -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n  box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n  border-radius: 3px;\n  border: 1px solid silver;\n\n  background: white;\n  font-size: 90%;\n  font-family: monospace;\n\n  max-height: 20em;\n  overflow-y: auto;\n}\n\n.CodeMirror-hint {\n  margin: 0;\n  padding: 0 4px;\n  border-radius: 2px;\n  white-space: pre;\n  color: black;\n  cursor: pointer;\n}\n\nli.CodeMirror-hint-active {\n  background: #08f;\n  color: white;\n}\n"
  },
  {
    "path": "libs/hinting/show-hint.js",
    "content": "// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: http://codemirror.net/LICENSE\n\n(function(mod) {\n  if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n    mod(require(\"../../lib/codemirror\"));\n  else if (typeof define == \"function\" && define.amd) // AMD\n    define([\"../../lib/codemirror\"], mod);\n  else // Plain browser env\n    mod(CodeMirror);\n})(function(CodeMirror) {\n  \"use strict\";\n\n  var HINT_ELEMENT_CLASS        = \"CodeMirror-hint\";\n  var ACTIVE_HINT_ELEMENT_CLASS = \"CodeMirror-hint-active\";\n\n  // This is the old interface, kept around for now to stay\n  // backwards-compatible.\n  CodeMirror.showHint = function(cm, getHints, options) {\n    if (!getHints) return cm.showHint(options);\n    if (options && options.async) getHints.async = true;\n    var newOpts = {hint: getHints};\n    if (options) for (var prop in options) newOpts[prop] = options[prop];\n    return cm.showHint(newOpts);\n  };\n\n  CodeMirror.defineExtension(\"showHint\", function(options) {\n    options = parseOptions(this, this.getCursor(\"start\"), options);\n    var selections = this.listSelections()\n    if (selections.length > 1) return;\n    // By default, don't allow completion when something is selected.\n    // A hint function can have a `supportsSelection` property to\n    // indicate that it can handle selections.\n    if (this.somethingSelected()) {\n      if (!options.hint.supportsSelection) return;\n      // Don't try with cross-line selections\n      for (var i = 0; i < selections.length; i++)\n        if (selections[i].head.line != selections[i].anchor.line) return;\n    }\n\n    if (this.state.completionActive) this.state.completionActive.close();\n    var completion = this.state.completionActive = new Completion(this, options);\n    if (!completion.options.hint) return;\n\n    CodeMirror.signal(this, \"startCompletion\", this);\n    completion.update(true);\n  });\n\n  function Completion(cm, options) {\n    this.cm = cm;\n    this.options = options;\n    this.widget = null;\n    this.debounce = 0;\n    this.tick = 0;\n    this.startPos = this.cm.getCursor(\"start\");\n    this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length;\n\n    var self = this;\n    cm.on(\"cursorActivity\", this.activityFunc = function() { self.cursorActivity(); });\n  }\n\n  var requestAnimationFrame = window.requestAnimationFrame || function(fn) {\n    return setTimeout(fn, 1000/60);\n  };\n  var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;\n\n  Completion.prototype = {\n    close: function() {\n      if (!this.active()) return;\n      this.cm.state.completionActive = null;\n      this.tick = null;\n      this.cm.off(\"cursorActivity\", this.activityFunc);\n\n      if (this.widget && this.data) CodeMirror.signal(this.data, \"close\");\n      if (this.widget) this.widget.close();\n      CodeMirror.signal(this.cm, \"endCompletion\", this.cm);\n    },\n\n    active: function() {\n      return this.cm.state.completionActive == this;\n    },\n\n    pick: function(data, i) {\n      var completion = data.list[i];\n      if (completion.hint) completion.hint(this.cm, data, completion);\n      else this.cm.replaceRange(getText(completion), completion.from || data.from,\n                                completion.to || data.to, \"complete\");\n      CodeMirror.signal(data, \"pick\", completion);\n      this.close();\n    },\n\n    cursorActivity: function() {\n      if (this.debounce) {\n        cancelAnimationFrame(this.debounce);\n        this.debounce = 0;\n      }\n\n      var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line);\n      if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch ||\n          pos.ch < this.startPos.ch || this.cm.somethingSelected() ||\n          (pos.ch && this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) {\n        this.close();\n      } else {\n        var self = this;\n        this.debounce = requestAnimationFrame(function() {self.update();});\n        if (this.widget) this.widget.disable();\n      }\n    },\n\n    update: function(first) {\n      if (this.tick == null) return\n      var self = this, myTick = ++this.tick\n      fetchHints(this.options.hint, this.cm, this.options, function(data) {\n        if (self.tick == myTick) self.finishUpdate(data, first)\n      })\n    },\n\n    finishUpdate: function(data, first) {\n      if (this.data) CodeMirror.signal(this.data, \"update\");\n\n      var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle);\n      if (this.widget) this.widget.close();\n\n      if (data && this.data && isNewCompletion(this.data, data)) return;\n      this.data = data;\n\n      if (data && data.list.length) {\n        if (picked && data.list.length == 1) {\n          this.pick(data, 0);\n        } else {\n          this.widget = new Widget(this, data);\n          CodeMirror.signal(data, \"shown\");\n        }\n      }\n    }\n  };\n\n  function isNewCompletion(old, nw) {\n    var moved = CodeMirror.cmpPos(nw.from, old.from)\n    return moved > 0 && old.to.ch - old.from.ch != nw.to.ch - nw.from.ch\n  }\n\n  function parseOptions(cm, pos, options) {\n    var editor = cm.options.hintOptions;\n    var out = {};\n    for (var prop in defaultOptions) out[prop] = defaultOptions[prop];\n    if (editor) for (var prop in editor)\n      if (editor[prop] !== undefined) out[prop] = editor[prop];\n    if (options) for (var prop in options)\n      if (options[prop] !== undefined) out[prop] = options[prop];\n    if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos)\n    return out;\n  }\n\n  function getText(completion) {\n    if (typeof completion == \"string\") return completion;\n    else return completion.text;\n  }\n\n  function buildKeyMap(completion, handle) {\n    var baseMap = {\n      Up: function() {handle.moveFocus(-1);},\n      Down: function() {handle.moveFocus(1);},\n      PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);},\n      PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);},\n      Home: function() {handle.setFocus(0);},\n      End: function() {handle.setFocus(handle.length - 1);},\n      Enter: handle.pick,\n      Tab: handle.pick,\n      Esc: handle.close\n    };\n    var custom = completion.options.customKeys;\n    var ourMap = custom ? {} : baseMap;\n    function addBinding(key, val) {\n      var bound;\n      if (typeof val != \"string\")\n        bound = function(cm) { return val(cm, handle); };\n      // This mechanism is deprecated\n      else if (baseMap.hasOwnProperty(val))\n        bound = baseMap[val];\n      else\n        bound = val;\n      ourMap[key] = bound;\n    }\n    if (custom)\n      for (var key in custom) if (custom.hasOwnProperty(key))\n        addBinding(key, custom[key]);\n    var extra = completion.options.extraKeys;\n    if (extra)\n      for (var key in extra) if (extra.hasOwnProperty(key))\n        addBinding(key, extra[key]);\n    return ourMap;\n  }\n\n  function getHintElement(hintsElement, el) {\n    while (el && el != hintsElement) {\n      if (el.nodeName.toUpperCase() === \"LI\" && el.parentNode == hintsElement) return el;\n      el = el.parentNode;\n    }\n  }\n\n  function Widget(completion, data) {\n    this.completion = completion;\n    this.data = data;\n    this.picked = false;\n    var widget = this, cm = completion.cm;\n\n    var hints = this.hints = document.createElement(\"ul\");\n    hints.className = \"CodeMirror-hints\";\n    this.selectedHint = data.selectedHint || 0;\n\n    var completions = data.list;\n    for (var i = 0; i < completions.length; ++i) {\n      var elt = hints.appendChild(document.createElement(\"li\")), cur = completions[i];\n      var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? \"\" : \" \" + ACTIVE_HINT_ELEMENT_CLASS);\n      if (cur.className != null) className = cur.className + \" \" + className;\n      elt.className = className;\n      if (cur.render) cur.render(elt, data, cur);\n      else elt.appendChild(document.createTextNode(cur.displayText || getText(cur)));\n      elt.hintId = i;\n    }\n\n    var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null);\n    var left = pos.left, top = pos.bottom, below = true;\n    hints.style.left = left + \"px\";\n    hints.style.top = top + \"px\";\n    // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.\n    var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);\n    var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight);\n    (completion.options.container || document.body).appendChild(hints);\n    var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH;\n    var scrolls = hints.scrollHeight > hints.clientHeight + 1\n    var startScroll = cm.getScrollInfo();\n\n    if (overlapY > 0) {\n      var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);\n      if (curTop - height > 0) { // Fits above cursor\n        hints.style.top = (top = pos.top - height) + \"px\";\n        below = false;\n      } else if (height > winH) {\n        hints.style.height = (winH - 5) + \"px\";\n        hints.style.top = (top = pos.bottom - box.top) + \"px\";\n        var cursor = cm.getCursor();\n        if (data.from.ch != cursor.ch) {\n          pos = cm.cursorCoords(cursor);\n          hints.style.left = (left = pos.left) + \"px\";\n          box = hints.getBoundingClientRect();\n        }\n      }\n    }\n    var overlapX = box.right - winW;\n    if (overlapX > 0) {\n      if (box.right - box.left > winW) {\n        hints.style.width = (winW - 5) + \"px\";\n        overlapX -= (box.right - box.left) - winW;\n      }\n      hints.style.left = (left = pos.left - overlapX) + \"px\";\n    }\n    if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling)\n      node.style.paddingRight = cm.display.nativeBarWidth + \"px\"\n\n    cm.addKeyMap(this.keyMap = buildKeyMap(completion, {\n      moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },\n      setFocus: function(n) { widget.changeActive(n); },\n      menuSize: function() { return widget.screenAmount(); },\n      length: completions.length,\n      close: function() { completion.close(); },\n      pick: function() { widget.pick(); },\n      data: data\n    }));\n\n    if (completion.options.closeOnUnfocus) {\n      var closingOnBlur;\n      cm.on(\"blur\", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); });\n      cm.on(\"focus\", this.onFocus = function() { clearTimeout(closingOnBlur); });\n    }\n\n    cm.on(\"scroll\", this.onScroll = function() {\n      var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();\n      var newTop = top + startScroll.top - curScroll.top;\n      var point = newTop - (window.pageYOffset || (document.documentElement || document.body).scrollTop);\n      if (!below) point += hints.offsetHeight;\n      if (point <= editor.top || point >= editor.bottom) return completion.close();\n      hints.style.top = newTop + \"px\";\n      hints.style.left = (left + startScroll.left - curScroll.left) + \"px\";\n    });\n\n    CodeMirror.on(hints, \"dblclick\", function(e) {\n      var t = getHintElement(hints, e.target || e.srcElement);\n      if (t && t.hintId != null) {widget.changeActive(t.hintId); widget.pick();}\n    });\n\n    CodeMirror.on(hints, \"click\", function(e) {\n      var t = getHintElement(hints, e.target || e.srcElement);\n      if (t && t.hintId != null) {\n        widget.changeActive(t.hintId);\n        if (completion.options.completeOnSingleClick) widget.pick();\n      }\n    });\n\n    CodeMirror.on(hints, \"mousedown\", function() {\n      setTimeout(function(){cm.focus();}, 20);\n    });\n\n    CodeMirror.signal(data, \"select\", completions[0], hints.firstChild);\n    return true;\n  }\n\n  Widget.prototype = {\n    close: function() {\n      if (this.completion.widget != this) return;\n      this.completion.widget = null;\n      this.hints.parentNode.removeChild(this.hints);\n      this.completion.cm.removeKeyMap(this.keyMap);\n\n      var cm = this.completion.cm;\n      if (this.completion.options.closeOnUnfocus) {\n        cm.off(\"blur\", this.onBlur);\n        cm.off(\"focus\", this.onFocus);\n      }\n      cm.off(\"scroll\", this.onScroll);\n    },\n\n    disable: function() {\n      this.completion.cm.removeKeyMap(this.keyMap);\n      var widget = this;\n      this.keyMap = {Enter: function() { widget.picked = true; }};\n      this.completion.cm.addKeyMap(this.keyMap);\n    },\n\n    pick: function() {\n      this.completion.pick(this.data, this.selectedHint);\n    },\n\n    changeActive: function(i, avoidWrap) {\n      if (i >= this.data.list.length)\n        i = avoidWrap ? this.data.list.length - 1 : 0;\n      else if (i < 0)\n        i = avoidWrap ? 0  : this.data.list.length - 1;\n      if (this.selectedHint == i) return;\n      var node = this.hints.childNodes[this.selectedHint];\n      node.className = node.className.replace(\" \" + ACTIVE_HINT_ELEMENT_CLASS, \"\");\n      node = this.hints.childNodes[this.selectedHint = i];\n      node.className += \" \" + ACTIVE_HINT_ELEMENT_CLASS;\n      if (node.offsetTop < this.hints.scrollTop)\n        this.hints.scrollTop = node.offsetTop - 3;\n      else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)\n        this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3;\n      CodeMirror.signal(this.data, \"select\", this.data.list[this.selectedHint], node);\n    },\n\n    screenAmount: function() {\n      return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;\n    }\n  };\n\n  function applicableHelpers(cm, helpers) {\n    if (!cm.somethingSelected()) return helpers\n    var result = []\n    for (var i = 0; i < helpers.length; i++)\n      if (helpers[i].supportsSelection) result.push(helpers[i])\n    return result\n  }\n\n  function fetchHints(hint, cm, options, callback) {\n    if (hint.async) {\n      hint(cm, callback, options)\n    } else {\n      var result = hint(cm, options)\n      if (result && result.then) result.then(callback)\n      else callback(result)\n    }\n  }\n\n  function resolveAutoHints(cm, pos) {\n    var helpers = cm.getHelpers(pos, \"hint\"), words\n    if (helpers.length) {\n      var resolved = function(cm, callback, options) {\n        var app = applicableHelpers(cm, helpers);\n        function run(i) {\n          if (i == app.length) return callback(null)\n          fetchHints(app[i], cm, options, function(result) {\n            if (result && result.list.length > 0) callback(result)\n            else run(i + 1)\n          })\n        }\n        run(0)\n      }\n      resolved.async = true\n      resolved.supportsSelection = true\n      return resolved\n    } else if (words = cm.getHelper(cm.getCursor(), \"hintWords\")) {\n      return function(cm) { return CodeMirror.hint.fromList(cm, {words: words}) }\n    } else if (CodeMirror.hint.anyword) {\n      return function(cm, options) { return CodeMirror.hint.anyword(cm, options) }\n    } else {\n      return function() {}\n    }\n  }\n\n  CodeMirror.registerHelper(\"hint\", \"auto\", {\n    resolve: resolveAutoHints\n  });\n\n  CodeMirror.registerHelper(\"hint\", \"fromList\", function(cm, options) {\n    var cur = cm.getCursor(), token = cm.getTokenAt(cur);\n    var to = CodeMirror.Pos(cur.line, token.end);\n    if (token.string && /\\w/.test(token.string[token.string.length - 1])) {\n      var term = token.string, from = CodeMirror.Pos(cur.line, token.start);\n    } else {\n      var term = \"\", from = to;\n    }\n    var found = [];\n    for (var i = 0; i < options.words.length; i++) {\n      var word = options.words[i];\n      if (word.slice(0, term.length) == term)\n        found.push(word);\n    }\n\n    if (found.length) return {list: found, from: from, to: to};\n  });\n\n  CodeMirror.commands.autocomplete = CodeMirror.showHint;\n\n  var defaultOptions = {\n    hint: CodeMirror.hint.auto,\n    completeSingle: true,\n    alignWithWord: true,\n    closeCharacters: /[\\s()\\[\\]{};:>,]/,\n    closeOnUnfocus: true,\n    completeOnSingleClick: true,\n    container: null,\n    customKeys: null,\n    extraKeys: null\n  };\n\n  CodeMirror.defineOption(\"hintOptions\", null);\n});\n"
  },
  {
    "path": "libs/jquery/jquery-ui.css",
    "content": "/*! jQuery UI - v1.12.1 - 2019-07-26\n* http://jqueryui.com\n* Includes: draggable.css, core.css, resizable.css, selectable.css, sortable.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, progressbar.css, selectmenu.css, slider.css, spinner.css, tabs.css, tooltip.css\n* Copyright jQuery Foundation and other contributors; Licensed MIT */\n\n.ui-draggable-handle {\n\t-ms-touch-action: none;\n\ttouch-action: none;\n}\n/* Layout helpers\n----------------------------------*/\n.ui-helper-hidden {\n\tdisplay: none;\n}\n.ui-helper-hidden-accessible {\n\tborder: 0;\n\tclip: rect(0 0 0 0);\n\theight: 1px;\n\tmargin: -1px;\n\toverflow: hidden;\n\tpadding: 0;\n\tposition: absolute;\n\twidth: 1px;\n}\n.ui-helper-reset {\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 0;\n\toutline: 0;\n\tline-height: 1.3;\n\ttext-decoration: none;\n\tfont-size: 100%;\n\tlist-style: none;\n}\n.ui-helper-clearfix:before,\n.ui-helper-clearfix:after {\n\tcontent: \"\";\n\tdisplay: table;\n\tborder-collapse: collapse;\n}\n.ui-helper-clearfix:after {\n\tclear: both;\n}\n.ui-helper-zfix {\n\twidth: 100%;\n\theight: 100%;\n\ttop: 0;\n\tleft: 0;\n\tposition: absolute;\n\topacity: 0;\n\tfilter:Alpha(Opacity=0); /* support: IE8 */\n}\n\n.ui-front {\n\tz-index: 100;\n}\n\n\n/* Interaction Cues\n----------------------------------*/\n.ui-state-disabled {\n\tcursor: default !important;\n\tpointer-events: none;\n}\n\n\n/* Icons\n----------------------------------*/\n.ui-icon {\n\tdisplay: inline-block;\n\tvertical-align: middle;\n\tmargin-top: -.25em;\n\tposition: relative;\n\ttext-indent: -99999px;\n\toverflow: hidden;\n\tbackground-repeat: no-repeat;\n}\n\n.ui-widget-icon-block {\n\tleft: 50%;\n\tmargin-left: -8px;\n\tdisplay: block;\n}\n\n/* Misc visuals\n----------------------------------*/\n\n/* Overlays */\n.ui-widget-overlay {\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n}\n.ui-resizable {\n\tposition: relative;\n}\n.ui-resizable-handle {\n\tposition: absolute;\n\tfont-size: 0.1px;\n\tdisplay: block;\n\t-ms-touch-action: none;\n\ttouch-action: none;\n}\n.ui-resizable-disabled .ui-resizable-handle,\n.ui-resizable-autohide .ui-resizable-handle {\n\tdisplay: none;\n}\n.ui-resizable-n {\n\tcursor: n-resize;\n\theight: 7px;\n\twidth: 100%;\n\ttop: -5px;\n\tleft: 0;\n}\n.ui-resizable-s {\n\tcursor: s-resize;\n\theight: 7px;\n\twidth: 100%;\n\tbottom: -5px;\n\tleft: 0;\n}\n.ui-resizable-e {\n\tcursor: e-resize;\n\twidth: 7px;\n\tright: -5px;\n\ttop: 0;\n\theight: 100%;\n}\n.ui-resizable-w {\n\tcursor: w-resize;\n\twidth: 7px;\n\tleft: -5px;\n\ttop: 0;\n\theight: 100%;\n}\n.ui-resizable-se {\n\tcursor: se-resize;\n\twidth: 12px;\n\theight: 12px;\n\tright: 1px;\n\tbottom: 1px;\n}\n.ui-resizable-sw {\n\tcursor: sw-resize;\n\twidth: 9px;\n\theight: 9px;\n\tleft: -5px;\n\tbottom: -5px;\n}\n.ui-resizable-nw {\n\tcursor: nw-resize;\n\twidth: 9px;\n\theight: 9px;\n\tleft: -5px;\n\ttop: -5px;\n}\n.ui-resizable-ne {\n\tcursor: ne-resize;\n\twidth: 9px;\n\theight: 9px;\n\tright: -5px;\n\ttop: -5px;\n}\n.ui-selectable {\n\t-ms-touch-action: none;\n\ttouch-action: none;\n}\n.ui-selectable-helper {\n\tposition: absolute;\n\tz-index: 100;\n\tborder: 1px dotted black;\n}\n.ui-sortable-handle {\n\t-ms-touch-action: none;\n\ttouch-action: none;\n}\n.ui-accordion .ui-accordion-header {\n\tdisplay: block;\n\tcursor: pointer;\n\tposition: relative;\n\tmargin: 2px 0 0 0;\n\tpadding: .5em .5em .5em .7em;\n\tfont-size: 100%;\n}\n.ui-accordion .ui-accordion-content {\n\tpadding: 1em 2.2em;\n\tborder-top: 0;\n\toverflow: auto;\n}\n.ui-autocomplete {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tcursor: default;\n}\n.ui-menu {\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\tdisplay: block;\n\toutline: 0;\n}\n.ui-menu .ui-menu {\n\tposition: absolute;\n}\n.ui-menu .ui-menu-item {\n\tmargin: 0;\n\tcursor: pointer;\n\t/* support: IE10, see #8844 */\n\tlist-style-image: url(\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\");\n}\n.ui-menu .ui-menu-item-wrapper {\n\tposition: relative;\n\tpadding: 3px 1em 3px .4em;\n}\n.ui-menu .ui-menu-divider {\n\tmargin: 5px 0;\n\theight: 0;\n\tfont-size: 0;\n\tline-height: 0;\n\tborder-width: 1px 0 0 0;\n}\n.ui-menu .ui-state-focus,\n.ui-menu .ui-state-active {\n\tmargin: -1px;\n}\n\n/* icon support */\n.ui-menu-icons {\n\tposition: relative;\n}\n.ui-menu-icons .ui-menu-item-wrapper {\n\tpadding-left: 2em;\n}\n\n/* left-aligned */\n.ui-menu .ui-icon {\n\tposition: absolute;\n\ttop: 0;\n\tbottom: 0;\n\tleft: .2em;\n\tmargin: auto 0;\n}\n\n/* right-aligned */\n.ui-menu .ui-menu-icon {\n\tleft: auto;\n\tright: 0;\n}\n.ui-button {\n\tpadding: .4em 1em;\n\tdisplay: inline-block;\n\tposition: relative;\n\tline-height: normal;\n\tmargin-right: .1em;\n\tcursor: pointer;\n\tvertical-align: middle;\n\ttext-align: center;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\n\t/* Support: IE <= 11 */\n\toverflow: visible;\n}\n\n.ui-button,\n.ui-button:link,\n.ui-button:visited,\n.ui-button:hover,\n.ui-button:active {\n\ttext-decoration: none;\n}\n\n/* to make room for the icon, a width needs to be set here */\n.ui-button-icon-only {\n\twidth: 2em;\n\tbox-sizing: border-box;\n\ttext-indent: -9999px;\n\twhite-space: nowrap;\n}\n\n/* no icon support for input elements */\ninput.ui-button.ui-button-icon-only {\n\ttext-indent: 0;\n}\n\n/* button icon element(s) */\n.ui-button-icon-only .ui-icon {\n\tposition: absolute;\n\ttop: 50%;\n\tleft: 50%;\n\tmargin-top: -8px;\n\tmargin-left: -8px;\n}\n\n.ui-button.ui-icon-notext .ui-icon {\n\tpadding: 0;\n\twidth: 2.1em;\n\theight: 2.1em;\n\ttext-indent: -9999px;\n\twhite-space: nowrap;\n\n}\n\ninput.ui-button.ui-icon-notext .ui-icon {\n\twidth: auto;\n\theight: auto;\n\ttext-indent: 0;\n\twhite-space: normal;\n\tpadding: .4em 1em;\n}\n\n/* workarounds */\n/* Support: Firefox 5 - 40 */\ninput.ui-button::-moz-focus-inner,\nbutton.ui-button::-moz-focus-inner {\n\tborder: 0;\n\tpadding: 0;\n}\n.ui-controlgroup {\n\tvertical-align: middle;\n\tdisplay: inline-block;\n}\n.ui-controlgroup > .ui-controlgroup-item {\n\tfloat: left;\n\tmargin-left: 0;\n\tmargin-right: 0;\n}\n.ui-controlgroup > .ui-controlgroup-item:focus,\n.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus {\n\tz-index: 9999;\n}\n.ui-controlgroup-vertical > .ui-controlgroup-item {\n\tdisplay: block;\n\tfloat: none;\n\twidth: 100%;\n\tmargin-top: 0;\n\tmargin-bottom: 0;\n\ttext-align: left;\n}\n.ui-controlgroup-vertical .ui-controlgroup-item {\n\tbox-sizing: border-box;\n}\n.ui-controlgroup .ui-controlgroup-label {\n\tpadding: .4em 1em;\n}\n.ui-controlgroup .ui-controlgroup-label span {\n\tfont-size: 80%;\n}\n.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item {\n\tborder-left: none;\n}\n.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item {\n\tborder-top: none;\n}\n.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content {\n\tborder-right: none;\n}\n.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content {\n\tborder-bottom: none;\n}\n\n/* Spinner specific style fixes */\n.ui-controlgroup-vertical .ui-spinner-input {\n\n\t/* Support: IE8 only, Android < 4.4 only */\n\twidth: 75%;\n\twidth: calc( 100% - 2.4em );\n}\n.ui-controlgroup-vertical .ui-spinner .ui-spinner-up {\n\tborder-top-style: solid;\n}\n\n.ui-checkboxradio-label .ui-icon-background {\n\tbox-shadow: inset 1px 1px 1px #ccc;\n\tborder-radius: .12em;\n\tborder: none;\n}\n.ui-checkboxradio-radio-label .ui-icon-background {\n\twidth: 16px;\n\theight: 16px;\n\tborder-radius: 1em;\n\toverflow: visible;\n\tborder: none;\n}\n.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,\n.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon {\n\tbackground-image: none;\n\twidth: 8px;\n\theight: 8px;\n\tborder-width: 4px;\n\tborder-style: solid;\n}\n.ui-checkboxradio-disabled {\n\tpointer-events: none;\n}\n.ui-datepicker {\n\twidth: 17em;\n\tpadding: .2em .2em 0;\n\tdisplay: none;\n}\n.ui-datepicker .ui-datepicker-header {\n\tposition: relative;\n\tpadding: .2em 0;\n}\n.ui-datepicker .ui-datepicker-prev,\n.ui-datepicker .ui-datepicker-next {\n\tposition: absolute;\n\ttop: 2px;\n\twidth: 1.8em;\n\theight: 1.8em;\n}\n.ui-datepicker .ui-datepicker-prev-hover,\n.ui-datepicker .ui-datepicker-next-hover {\n\ttop: 1px;\n}\n.ui-datepicker .ui-datepicker-prev {\n\tleft: 2px;\n}\n.ui-datepicker .ui-datepicker-next {\n\tright: 2px;\n}\n.ui-datepicker .ui-datepicker-prev-hover {\n\tleft: 1px;\n}\n.ui-datepicker .ui-datepicker-next-hover {\n\tright: 1px;\n}\n.ui-datepicker .ui-datepicker-prev span,\n.ui-datepicker .ui-datepicker-next span {\n\tdisplay: block;\n\tposition: absolute;\n\tleft: 50%;\n\tmargin-left: -8px;\n\ttop: 50%;\n\tmargin-top: -8px;\n}\n.ui-datepicker .ui-datepicker-title {\n\tmargin: 0 2.3em;\n\tline-height: 1.8em;\n\ttext-align: center;\n}\n.ui-datepicker .ui-datepicker-title select {\n\tfont-size: 1em;\n\tmargin: 1px 0;\n}\n.ui-datepicker select.ui-datepicker-month,\n.ui-datepicker select.ui-datepicker-year {\n\twidth: 45%;\n}\n.ui-datepicker table {\n\twidth: 100%;\n\tfont-size: .9em;\n\tborder-collapse: collapse;\n\tmargin: 0 0 .4em;\n}\n.ui-datepicker th {\n\tpadding: .7em .3em;\n\ttext-align: center;\n\tfont-weight: bold;\n\tborder: 0;\n}\n.ui-datepicker td {\n\tborder: 0;\n\tpadding: 1px;\n}\n.ui-datepicker td span,\n.ui-datepicker td a {\n\tdisplay: block;\n\tpadding: .2em;\n\ttext-align: right;\n\ttext-decoration: none;\n}\n.ui-datepicker .ui-datepicker-buttonpane {\n\tbackground-image: none;\n\tmargin: .7em 0 0 0;\n\tpadding: 0 .2em;\n\tborder-left: 0;\n\tborder-right: 0;\n\tborder-bottom: 0;\n}\n.ui-datepicker .ui-datepicker-buttonpane button {\n\tfloat: right;\n\tmargin: .5em .2em .4em;\n\tcursor: pointer;\n\tpadding: .2em .6em .3em .6em;\n\twidth: auto;\n\toverflow: visible;\n}\n.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {\n\tfloat: left;\n}\n\n/* with multiple calendars */\n.ui-datepicker.ui-datepicker-multi {\n\twidth: auto;\n}\n.ui-datepicker-multi .ui-datepicker-group {\n\tfloat: left;\n}\n.ui-datepicker-multi .ui-datepicker-group table {\n\twidth: 95%;\n\tmargin: 0 auto .4em;\n}\n.ui-datepicker-multi-2 .ui-datepicker-group {\n\twidth: 50%;\n}\n.ui-datepicker-multi-3 .ui-datepicker-group {\n\twidth: 33.3%;\n}\n.ui-datepicker-multi-4 .ui-datepicker-group {\n\twidth: 25%;\n}\n.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,\n.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {\n\tborder-left-width: 0;\n}\n.ui-datepicker-multi .ui-datepicker-buttonpane {\n\tclear: left;\n}\n.ui-datepicker-row-break {\n\tclear: both;\n\twidth: 100%;\n\tfont-size: 0;\n}\n\n/* RTL support */\n.ui-datepicker-rtl {\n\tdirection: rtl;\n}\n.ui-datepicker-rtl .ui-datepicker-prev {\n\tright: 2px;\n\tleft: auto;\n}\n.ui-datepicker-rtl .ui-datepicker-next {\n\tleft: 2px;\n\tright: auto;\n}\n.ui-datepicker-rtl .ui-datepicker-prev:hover {\n\tright: 1px;\n\tleft: auto;\n}\n.ui-datepicker-rtl .ui-datepicker-next:hover {\n\tleft: 1px;\n\tright: auto;\n}\n.ui-datepicker-rtl .ui-datepicker-buttonpane {\n\tclear: right;\n}\n.ui-datepicker-rtl .ui-datepicker-buttonpane button {\n\tfloat: left;\n}\n.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,\n.ui-datepicker-rtl .ui-datepicker-group {\n\tfloat: right;\n}\n.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,\n.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {\n\tborder-right-width: 0;\n\tborder-left-width: 1px;\n}\n\n/* Icons */\n.ui-datepicker .ui-icon {\n\tdisplay: block;\n\ttext-indent: -99999px;\n\toverflow: hidden;\n\tbackground-repeat: no-repeat;\n\tleft: .5em;\n\ttop: .3em;\n}\n.ui-dialog {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tpadding: .2em;\n\toutline: 0;\n}\n.ui-dialog .ui-dialog-titlebar {\n\tpadding: .4em 1em;\n\tposition: relative;\n}\n.ui-dialog .ui-dialog-title {\n\tfloat: left;\n\tmargin: .1em 0;\n\twhite-space: nowrap;\n\twidth: 90%;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n.ui-dialog .ui-dialog-titlebar-close {\n\tposition: absolute;\n\tright: .3em;\n\ttop: 50%;\n\twidth: 20px;\n\tmargin: -10px 0 0 0;\n\tpadding: 1px;\n\theight: 20px;\n}\n.ui-dialog .ui-dialog-content {\n\tposition: relative;\n\tborder: 0;\n\tpadding: .5em 1em;\n\tbackground: none;\n\toverflow: auto;\n}\n.ui-dialog .ui-dialog-buttonpane {\n\ttext-align: left;\n\tborder-width: 1px 0 0 0;\n\tbackground-image: none;\n\tmargin-top: .5em;\n\tpadding: .3em 1em .5em .4em;\n}\n.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {\n\tfloat: right;\n}\n.ui-dialog .ui-dialog-buttonpane button {\n\tmargin: .5em .4em .5em 0;\n\tcursor: pointer;\n}\n.ui-dialog .ui-resizable-n {\n\theight: 2px;\n\ttop: 0;\n}\n.ui-dialog .ui-resizable-e {\n\twidth: 2px;\n\tright: 0;\n}\n.ui-dialog .ui-resizable-s {\n\theight: 2px;\n\tbottom: 0;\n}\n.ui-dialog .ui-resizable-w {\n\twidth: 2px;\n\tleft: 0;\n}\n.ui-dialog .ui-resizable-se,\n.ui-dialog .ui-resizable-sw,\n.ui-dialog .ui-resizable-ne,\n.ui-dialog .ui-resizable-nw {\n\twidth: 7px;\n\theight: 7px;\n}\n.ui-dialog .ui-resizable-se {\n\tright: 0;\n\tbottom: 0;\n}\n.ui-dialog .ui-resizable-sw {\n\tleft: 0;\n\tbottom: 0;\n}\n.ui-dialog .ui-resizable-ne {\n\tright: 0;\n\ttop: 0;\n}\n.ui-dialog .ui-resizable-nw {\n\tleft: 0;\n\ttop: 0;\n}\n.ui-draggable .ui-dialog-titlebar {\n\tcursor: move;\n}\n.ui-progressbar {\n\theight: 2em;\n\ttext-align: left;\n\toverflow: hidden;\n}\n.ui-progressbar .ui-progressbar-value {\n\tmargin: -1px;\n\theight: 100%;\n}\n.ui-progressbar .ui-progressbar-overlay {\n\tbackground: url(\"data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQ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swUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==\");\n\theight: 100%;\n\tfilter: alpha(opacity=25); /* support: IE8 */\n\topacity: 0.25;\n}\n.ui-progressbar-indeterminate .ui-progressbar-value {\n\tbackground-image: none;\n}\n.ui-selectmenu-menu {\n\tpadding: 0;\n\tmargin: 0;\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\tdisplay: none;\n}\n.ui-selectmenu-menu .ui-menu {\n\toverflow: auto;\n\toverflow-x: hidden;\n\tpadding-bottom: 1px;\n}\n.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup {\n\tfont-size: 1em;\n\tfont-weight: bold;\n\tline-height: 1.5;\n\tpadding: 2px 0.4em;\n\tmargin: 0.5em 0 0 0;\n\theight: auto;\n\tborder: 0;\n}\n.ui-selectmenu-open {\n\tdisplay: block;\n}\n.ui-selectmenu-text {\n\tdisplay: block;\n\tmargin-right: 20px;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n.ui-selectmenu-button.ui-button {\n\ttext-align: left;\n\twhite-space: nowrap;\n\twidth: 14em;\n}\n.ui-selectmenu-icon.ui-icon {\n\tfloat: right;\n\tmargin-top: 0;\n}\n.ui-slider {\n\tposition: relative;\n\ttext-align: left;\n}\n.ui-slider .ui-slider-handle {\n\tposition: absolute;\n\tz-index: 2;\n\twidth: 1.2em;\n\theight: 1.2em;\n\tcursor: default;\n\t-ms-touch-action: none;\n\ttouch-action: none;\n}\n.ui-slider .ui-slider-range {\n\tposition: absolute;\n\tz-index: 1;\n\tfont-size: .7em;\n\tdisplay: block;\n\tborder: 0;\n\tbackground-position: 0 0;\n}\n\n/* support: IE8 - See #6727 */\n.ui-slider.ui-state-disabled .ui-slider-handle,\n.ui-slider.ui-state-disabled .ui-slider-range {\n\tfilter: inherit;\n}\n\n.ui-slider-horizontal {\n\theight: .8em;\n}\n.ui-slider-horizontal .ui-slider-handle {\n\ttop: -.3em;\n\tmargin-left: -.6em;\n}\n.ui-slider-horizontal .ui-slider-range {\n\ttop: 0;\n\theight: 100%;\n}\n.ui-slider-horizontal .ui-slider-range-min {\n\tleft: 0;\n}\n.ui-slider-horizontal .ui-slider-range-max {\n\tright: 0;\n}\n\n.ui-slider-vertical {\n\twidth: .8em;\n\theight: 100px;\n}\n.ui-slider-vertical .ui-slider-handle {\n\tleft: -.3em;\n\tmargin-left: 0;\n\tmargin-bottom: -.6em;\n}\n.ui-slider-vertical .ui-slider-range {\n\tleft: 0;\n\twidth: 100%;\n}\n.ui-slider-vertical .ui-slider-range-min {\n\tbottom: 0;\n}\n.ui-slider-vertical .ui-slider-range-max {\n\ttop: 0;\n}\n.ui-spinner {\n\tposition: relative;\n\tdisplay: inline-block;\n\toverflow: hidden;\n\tpadding: 0;\n\tvertical-align: middle;\n}\n.ui-spinner-input {\n\tborder: none;\n\tbackground: none;\n\tcolor: inherit;\n\tpadding: .222em 0;\n\tmargin: .2em 0;\n\tvertical-align: middle;\n\tmargin-left: .4em;\n\tmargin-right: 2em;\n}\n.ui-spinner-button {\n\twidth: 1.6em;\n\theight: 50%;\n\tfont-size: .5em;\n\tpadding: 0;\n\tmargin: 0;\n\ttext-align: center;\n\tposition: absolute;\n\tcursor: default;\n\tdisplay: block;\n\toverflow: hidden;\n\tright: 0;\n}\n/* more specificity required here to override default borders */\n.ui-spinner a.ui-spinner-button {\n\tborder-top-style: none;\n\tborder-bottom-style: none;\n\tborder-right-style: none;\n}\n.ui-spinner-up {\n\ttop: 0;\n}\n.ui-spinner-down {\n\tbottom: 0;\n}\n.ui-tabs {\n\tposition: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as \"fixed\") */\n\tpadding: .2em;\n}\n.ui-tabs .ui-tabs-nav {\n\tmargin: 0;\n\tpadding: .2em .2em 0;\n}\n.ui-tabs .ui-tabs-nav li {\n\tlist-style: none;\n\tfloat: left;\n\tposition: relative;\n\ttop: 0;\n\tmargin: 1px .2em 0 0;\n\tborder-bottom-width: 0;\n\tpadding: 0;\n\twhite-space: nowrap;\n}\n.ui-tabs .ui-tabs-nav .ui-tabs-anchor {\n\tfloat: left;\n\tpadding: .5em 1em;\n\ttext-decoration: none;\n}\n.ui-tabs .ui-tabs-nav li.ui-tabs-active {\n\tmargin-bottom: -1px;\n\tpadding-bottom: 1px;\n}\n.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,\n.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,\n.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {\n\tcursor: text;\n}\n.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {\n\tcursor: pointer;\n}\n.ui-tabs .ui-tabs-panel {\n\tdisplay: block;\n\tborder-width: 0;\n\tpadding: 1em 1.4em;\n\tbackground: none;\n}\n.ui-tooltip {\n\tpadding: 8px;\n\tposition: absolute;\n\tz-index: 9999;\n\tmax-width: 300px;\n}\nbody .ui-tooltip {\n\tborder-width: 2px;\n}\n"
  },
  {
    "path": "libs/jquery/jquery.hotkeys.js",
    "content": "/*\n * jQuery Hotkeys Plugin\n * Copyright 2010, John Resig\n * Dual licensed under the MIT or GPL Version 2 licenses.\n *\n * Based upon the plugin by Tzury Bar Yochay:\n * http://github.com/tzuryby/hotkeys\n *\n * Original idea by:\n * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/\n*/\n\n(function(jQuery){\n\t\n\tjQuery.hotkeys = {\n\t\tversion: \"0.8\",\n\n\t\tspecialKeys: {\n\t\t\t8: \"backspace\", 9: \"tab\", 13: \"return\", 16: \"shift\", 17: \"ctrl\", 18: \"alt\", 19: \"pause\",\n\t\t\t20: \"capslock\", 27: \"esc\", 32: \"space\", 33: \"pageup\", 34: \"pagedown\", 35: \"end\", 36: \"home\",\n\t\t\t37: \"left\", 38: \"up\", 39: \"right\", 40: \"down\", 45: \"insert\", 46: \"del\", \n\t\t\t96: \"0\", 97: \"1\", 98: \"2\", 99: \"3\", 100: \"4\", 101: \"5\", 102: \"6\", 103: \"7\",\n\t\t\t104: \"8\", 105: \"9\", 106: \"*\", 107: \"+\", 109: \"-\", 110: \".\", 111 : \"/\", \n\t\t\t112: \"f1\", 113: \"f2\", 114: \"f3\", 115: \"f4\", 116: \"f5\", 117: \"f6\", 118: \"f7\", 119: \"f8\", \n\t\t\t120: \"f9\", 121: \"f10\", 122: \"f11\", 123: \"f12\", 144: \"numlock\", 145: \"scroll\", 191: \"/\", 224: \"meta\"\n\t\t},\n\t\n\t\tshiftNums: {\n\t\t\t\"`\": \"~\", \"1\": \"!\", \"2\": \"@\", \"3\": \"#\", \"4\": \"$\", \"5\": \"%\", \"6\": \"^\", \"7\": \"&\", \n\t\t\t\"8\": \"*\", \"9\": \"(\", \"0\": \")\", \"-\": \"_\", \"=\": \"+\", \";\": \": \", \"'\": \"\\\"\", \",\": \"<\", \n\t\t\t\".\": \">\",  \"/\": \"?\",  \"\\\\\": \"|\"\n\t\t}\n\t};\n\n\tfunction keyHandler( handleObj ) {\n\t\t// Only care when a possible input has been specified\n\t\tif ( typeof handleObj.data !== \"string\" ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tvar origHandler = handleObj.handler,\n\t\t\tkeys = handleObj.data.toLowerCase().split(\" \"),\n\t\t\ttextAcceptingInputTypes = [\"text\", \"password\", \"number\", \"email\", \"url\", \"range\", \"date\", \"month\", \"week\", \"time\", \"datetime\", \"datetime-local\", \"search\", \"color\"];\n\t\n\t\thandleObj.handler = function( event ) {\n\t\t\t// Don't fire in text-accepting inputs that we didn't directly bind to\n\t\t\tif ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) ||\n\t\t\t\tjQuery.inArray(event.target.type, textAcceptingInputTypes) > -1 ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Keypress represents characters, not special keys\n\t\t\tvar special = event.type !== \"keypress\" && jQuery.hotkeys.specialKeys[ event.which ],\n\t\t\t\tcharacter = String.fromCharCode( event.which ).toLowerCase(),\n\t\t\t\tkey, modif = \"\", possible = {};\n\n\t\t\t// check combinations (alt|ctrl|shift+anything)\n\t\t\tif ( event.altKey && special !== \"alt\" ) {\n\t\t\t\tmodif += \"alt+\";\n\t\t\t}\n\n\t\t\tif ( event.ctrlKey && special !== \"ctrl\" ) {\n\t\t\t\tmodif += \"ctrl+\";\n\t\t\t}\n\t\t\t\n\t\t\t// TODO: Need to make sure this works consistently across platforms\n\t\t\tif ( event.metaKey && !event.ctrlKey && special !== \"meta\" ) {\n\t\t\t\tmodif += \"meta+\";\n\t\t\t}\n\n\t\t\tif ( event.shiftKey && special !== \"shift\" ) {\n\t\t\t\tmodif += \"shift+\";\n\t\t\t}\n\n\t\t\tif ( special ) {\n\t\t\t\tpossible[ modif + special ] = true;\n\n\t\t\t} else {\n\t\t\t\tpossible[ modif + character ] = true;\n\t\t\t\tpossible[ modif + jQuery.hotkeys.shiftNums[ character ] ] = true;\n\n\t\t\t\t// \"$\" can be triggered as \"Shift+4\" or \"Shift+$\" or just \"$\"\n\t\t\t\tif ( modif === \"shift+\" ) {\n\t\t\t\t\tpossible[ jQuery.hotkeys.shiftNums[ character ] ] = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor ( var i = 0, l = keys.length; i < l; i++ ) {\n\t\t\t\tif ( possible[ keys[i] ] ) {\n\t\t\t\t\treturn origHandler.apply( this, arguments );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\n\tjQuery.each([ \"keydown\", \"keyup\", \"keypress\" ], function() {\n\t\tjQuery.event.special[ this ] = { add: keyHandler };\n\t});\n\n})( jQuery );"
  },
  {
    "path": "libs/jquery/jquery.multi-select.js",
    "content": "/*\n* MultiSelect v0.9.12\n* Copyright (c) 2012 Louis Cuny\n*\n* This program is free software. It comes without any warranty, to\n* the extent permitted by applicable law. You can redistribute it\n* and/or modify it under the terms of the Do What The Fuck You Want\n* To Public License, Version 2, as published by Sam Hocevar. See\n* http://sam.zoy.org/wtfpl/COPYING for more details.\n*/\n\n!function ($) {\n\n  \"use strict\";\n\n\n /* MULTISELECT CLASS DEFINITION\n  * ====================== */\n\n  var MultiSelect = function (element, options) {\n    this.options = options;\n    this.$element = $(element);\n    this.$container = $('<div/>', { 'class': \"ms-container\" });\n    this.$selectableContainer = $('<div/>', { 'class': 'ms-selectable' });\n    this.$selectionContainer = $('<div/>', { 'class': 'ms-selection' });\n    this.$selectableUl = $('<ul/>', { 'class': \"ms-list\", 'tabindex' : '-1' });\n    this.$selectionUl = $('<ul/>', { 'class': \"ms-list\", 'tabindex' : '-1' });\n    this.scrollTo = 0;\n    this.elemsSelector = 'li:visible:not(.ms-optgroup-label,.ms-optgroup-container,.'+options.disabledClass+')';\n  };\n\n  MultiSelect.prototype = {\n    constructor: MultiSelect,\n\n    init: function(){\n      var that = this,\n          ms = this.$element;\n\n      if (ms.next('.ms-container').length === 0){\n        ms.css({ position: 'absolute', left: '-9999px' });\n        ms.attr('id', ms.attr('id') ? ms.attr('id') : Math.ceil(Math.random()*1000)+'multiselect');\n        this.$container.attr('id', 'ms-'+ms.attr('id'));\n        this.$container.addClass(that.options.cssClass);\n        ms.find('option').each(function(){\n          that.generateLisFromOption(this);\n        });\n\n        this.$selectionUl.find('.ms-optgroup-label').hide();\n\n        if (that.options.selectableHeader){\n          that.$selectableContainer.append(that.options.selectableHeader);\n        }\n        that.$selectableContainer.append(that.$selectableUl);\n        if (that.options.selectableFooter){\n          that.$selectableContainer.append(that.options.selectableFooter);\n        }\n\n        if (that.options.selectionHeader){\n          that.$selectionContainer.append(that.options.selectionHeader);\n        }\n        that.$selectionContainer.append(that.$selectionUl);\n        if (that.options.selectionFooter){\n          that.$selectionContainer.append(that.options.selectionFooter);\n        }\n\n        that.$container.append(that.$selectableContainer);\n        that.$container.append(that.$selectionContainer);\n        ms.after(that.$container);\n\n        that.activeMouse(that.$selectableUl);\n        that.activeKeyboard(that.$selectableUl);\n\n        var action = that.options.dblClick ? 'dblclick' : 'click';\n\n        that.$selectableUl.on(action, '.ms-elem-selectable', function(){\n          that.select($(this).data('ms-value'));\n        });\n        that.$selectionUl.on(action, '.ms-elem-selection', function(){\n          that.deselect($(this).data('ms-value'));\n        });\n\n        that.activeMouse(that.$selectionUl);\n        that.activeKeyboard(that.$selectionUl);\n\n        ms.on('focus', function(){\n          that.$selectableUl.focus();\n        });\n      }\n\n      var selectedValues = ms.find('option:selected').map(function(){ return $(this).val(); }).get();\n      that.select(selectedValues, 'init');\n\n      if (typeof that.options.afterInit === 'function') {\n        that.options.afterInit.call(this, this.$container);\n      }\n    },\n\n    'generateLisFromOption' : function(option, index, $container){\n      var that = this,\n          ms = that.$element,\n          attributes = \"\",\n          $option = $(option);\n\n      for (var cpt = 0; cpt < option.attributes.length; cpt++){\n        var attr = option.attributes[cpt];\n\n        if(attr.name !== 'value' && attr.name !== 'disabled'){\n          attributes += attr.name+'=\"'+attr.value+'\" ';\n        }\n      }\n      var selectableLi = $('<li '+attributes+'><span>'+that.escapeHTML($option.text())+'</span></li>'),\n          selectedLi = selectableLi.clone(),\n          value = $option.val(),\n          elementId = that.sanitize(value);\n\n      selectableLi\n        .data('ms-value', value)\n        .addClass('ms-elem-selectable')\n        .attr('id', elementId+'-selectable');\n\n      selectedLi\n        .data('ms-value', value)\n        .addClass('ms-elem-selection')\n        .attr('id', elementId+'-selection')\n        .hide();\n\n      if ($option.attr('disabled') || ms.attr('disabled')){\n        selectedLi.addClass(that.options.disabledClass);\n        selectableLi.addClass(that.options.disabledClass);\n      }\n\n      var $optgroup = $option.parent('optgroup');\n\n      if ($optgroup.length > 0){\n        var optgroupLabel = $optgroup.attr('label'),\n            optgroupId = that.sanitize(optgroupLabel),\n            $selectableOptgroup = that.$selectableUl.find('#optgroup-selectable-'+optgroupId),\n            $selectionOptgroup = that.$selectionUl.find('#optgroup-selection-'+optgroupId);\n\n        if ($selectableOptgroup.length === 0){\n          var optgroupContainerTpl = '<li class=\"ms-optgroup-container\"></li>',\n              optgroupTpl = '<ul class=\"ms-optgroup\"><li class=\"ms-optgroup-label\"><span>'+optgroupLabel+'</span></li></ul>';\n\n          $selectableOptgroup = $(optgroupContainerTpl);\n          $selectionOptgroup = $(optgroupContainerTpl);\n          $selectableOptgroup.attr('id', 'optgroup-selectable-'+optgroupId);\n          $selectionOptgroup.attr('id', 'optgroup-selection-'+optgroupId);\n          $selectableOptgroup.append($(optgroupTpl));\n          $selectionOptgroup.append($(optgroupTpl));\n          if (that.options.selectableOptgroup){\n            $selectableOptgroup.find('.ms-optgroup-label').on('click', function(){\n              var values = $optgroup.children(':not(:selected, :disabled)').map(function(){ return $(this).val();}).get();\n              that.select(values);\n            });\n            $selectionOptgroup.find('.ms-optgroup-label').on('click', function(){\n              var values = $optgroup.children(':selected:not(:disabled)').map(function(){ return $(this).val();}).get();\n              that.deselect(values);\n            });\n          }\n          that.$selectableUl.append($selectableOptgroup);\n          that.$selectionUl.append($selectionOptgroup);\n        }\n        index = index === undefined ? $selectableOptgroup.find('ul').children().length : index + 1;\n        selectableLi.insertAt(index, $selectableOptgroup.children());\n        selectedLi.insertAt(index, $selectionOptgroup.children());\n      } else {\n        index = index === undefined ? that.$selectableUl.children().length : index;\n\n        selectableLi.insertAt(index, that.$selectableUl);\n        selectedLi.insertAt(index, that.$selectionUl);\n      }\n    },\n\n    'addOption' : function(options){\n      var that = this;\n\n      if (options.value !== undefined && options.value !== null){\n        options = [options];\n      } \n      $.each(options, function(index, option){\n        if (option.value !== undefined && option.value !== null &&\n            that.$element.find(\"option[value='\"+option.value+\"']\").length === 0){\n          var $option = $('<option value=\"'+option.value+'\">'+option.text+'</option>'),\n              $container = option.nested === undefined ? that.$element : $(\"optgroup[label='\"+option.nested+\"']\"),\n              index = parseInt((typeof option.index === 'undefined' ? $container.children().length : option.index));\n\n          if (option.optionClass) {\n            $option.addClass(option.optionClass);\n          }\n\n          if (option.disabled) {\n            $option.prop('disabled', true);\n          }\n\n          $option.insertAt(index, $container);\n          that.generateLisFromOption($option.get(0), index, option.nested);\n        }\n      });\n    },\n\n    'escapeHTML' : function(text){\n      return $(\"<div>\").text(text).html();\n    },\n\n    'activeKeyboard' : function($list){\n      var that = this;\n\n      $list.on('focus', function(){\n        $(this).addClass('ms-focus');\n      })\n      .on('blur', function(){\n        $(this).removeClass('ms-focus');\n      })\n      .on('keydown', function(e){\n        switch (e.which) {\n          case 40:\n          case 38:\n            e.preventDefault();\n            e.stopPropagation();\n            that.moveHighlight($(this), (e.which === 38) ? -1 : 1);\n            return;\n          case 37:\n          case 39:\n            e.preventDefault();\n            e.stopPropagation();\n            that.switchList($list);\n            return;\n          case 9:\n            if(that.$element.is('[tabindex]')){\n              e.preventDefault();\n              var tabindex = parseInt(that.$element.attr('tabindex'), 10);\n              tabindex = (e.shiftKey) ? tabindex-1 : tabindex+1;\n              $('[tabindex=\"'+(tabindex)+'\"]').focus();\n              return;\n            }else{\n              if(e.shiftKey){\n                that.$element.trigger('focus');\n              }\n            }\n        }\n        if($.inArray(e.which, that.options.keySelect) > -1){\n          e.preventDefault();\n          e.stopPropagation();\n          that.selectHighlighted($list);\n          return;\n        }\n      });\n    },\n\n    'moveHighlight': function($list, direction){\n      var $elems = $list.find(this.elemsSelector),\n          $currElem = $elems.filter('.ms-hover'),\n          $nextElem = null,\n          elemHeight = $elems.first().outerHeight(),\n          containerHeight = $list.height(),\n          containerSelector = '#'+this.$container.prop('id');\n\n      $elems.removeClass('ms-hover');\n      if (direction === 1){ // DOWN\n\n        $nextElem = $currElem.nextAll(this.elemsSelector).first();\n        if ($nextElem.length === 0){\n          var $optgroupUl = $currElem.parent();\n\n          if ($optgroupUl.hasClass('ms-optgroup')){\n            var $optgroupLi = $optgroupUl.parent(),\n                $nextOptgroupLi = $optgroupLi.next(':visible');\n\n            if ($nextOptgroupLi.length > 0){\n              $nextElem = $nextOptgroupLi.find(this.elemsSelector).first();\n            } else {\n              $nextElem = $elems.first();\n            }\n          } else {\n            $nextElem = $elems.first();\n          }\n        }\n      } else if (direction === -1){ // UP\n\n        $nextElem = $currElem.prevAll(this.elemsSelector).first();\n        if ($nextElem.length === 0){\n          var $optgroupUl = $currElem.parent();\n\n          if ($optgroupUl.hasClass('ms-optgroup')){\n            var $optgroupLi = $optgroupUl.parent(),\n                $prevOptgroupLi = $optgroupLi.prev(':visible');\n\n            if ($prevOptgroupLi.length > 0){\n              $nextElem = $prevOptgroupLi.find(this.elemsSelector).last();\n            } else {\n              $nextElem = $elems.last();\n            }\n          } else {\n            $nextElem = $elems.last();\n          }\n        }\n      }\n      if ($nextElem.length > 0){\n        $nextElem.addClass('ms-hover');\n        var scrollTo = $list.scrollTop() + $nextElem.position().top - \n                       containerHeight / 2 + elemHeight / 2;\n\n        $list.scrollTop(scrollTo);\n      }\n    },\n\n    'selectHighlighted' : function($list){\n      var $elems = $list.find(this.elemsSelector),\n          $highlightedElem = $elems.filter('.ms-hover').first();\n\n      if ($highlightedElem.length > 0){\n        if ($list.parent().hasClass('ms-selectable')){\n          this.select($highlightedElem.data('ms-value'));\n        } else {\n          this.deselect($highlightedElem.data('ms-value'));\n        }\n        $elems.removeClass('ms-hover');\n      }\n    },\n\n    'switchList' : function($list){\n      $list.blur();\n      this.$container.find(this.elemsSelector).removeClass('ms-hover');\n      if ($list.parent().hasClass('ms-selectable')){\n        this.$selectionUl.focus();\n      } else {\n        this.$selectableUl.focus();\n      }\n    },\n\n    'activeMouse' : function($list){\n      var that = this;\n\n      this.$container.on('mouseenter', that.elemsSelector, function(){\n        $(this).parents('.ms-container').find(that.elemsSelector).removeClass('ms-hover');\n        $(this).addClass('ms-hover');\n      });\n\n      this.$container.on('mouseleave', that.elemsSelector, function () {\n        $(this).parents('.ms-container').find(that.elemsSelector).removeClass('ms-hover');\n      });\n    },\n\n    'refresh' : function() {\n      this.destroy();\n      this.$element.multiSelect(this.options);\n    },\n\n    'destroy' : function(){\n      $(\"#ms-\"+this.$element.attr(\"id\")).remove();\n      this.$element.off('focus');\n      this.$element.css('position', '').css('left', '');\n      this.$element.removeData('multiselect');\n    },\n\n    'select' : function(value, method){\n      if (typeof value === 'string'){ value = [value]; }\n\n      var that = this,\n          ms = this.$element,\n          msIds = $.map(value, function(val){ return(that.sanitize(val)); }),\n          selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable').filter(':not(.'+that.options.disabledClass+')'),\n          selections = this.$selectionUl.find('#' + msIds.join('-selection, #') + '-selection').filter(':not(.'+that.options.disabledClass+')'),\n          options = ms.find('option:not(:disabled)').filter(function(){ return($.inArray(this.value, value) > -1); });\n\n      if (method === 'init'){\n        selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable'),\n        selections = this.$selectionUl.find('#' + msIds.join('-selection, #') + '-selection');\n      }\n\n      if (selectables.length > 0){\n        selectables.addClass('ms-selected').hide();\n        selections.addClass('ms-selected').show();\n\n        options.attr('selected', 'selected');\n\n        that.$container.find(that.elemsSelector).removeClass('ms-hover');\n\n        var selectableOptgroups = that.$selectableUl.children('.ms-optgroup-container');\n        if (selectableOptgroups.length > 0){\n          selectableOptgroups.each(function(){\n            var selectablesLi = $(this).find('.ms-elem-selectable');\n            if (selectablesLi.length === selectablesLi.filter('.ms-selected').length){\n              $(this).find('.ms-optgroup-label').hide();\n            }\n          });\n\n          var selectionOptgroups = that.$selectionUl.children('.ms-optgroup-container');\n          selectionOptgroups.each(function(){\n            var selectionsLi = $(this).find('.ms-elem-selection');\n            if (selectionsLi.filter('.ms-selected').length > 0){\n              $(this).find('.ms-optgroup-label').show();\n            }\n          });\n        } else {\n          if (that.options.keepOrder && method !== 'init'){\n            var selectionLiLast = that.$selectionUl.find('.ms-selected');\n            if((selectionLiLast.length > 1) && (selectionLiLast.last().get(0) != selections.get(0))) {\n              selections.insertAfter(selectionLiLast.last());\n            }\n          }\n        }\n        if (method !== 'init'){\n          ms.trigger('change');\n          if (typeof that.options.afterSelect === 'function') {\n            that.options.afterSelect.call(this, value);\n          }\n        }\n      }\n    },\n\n    'deselect' : function(value){\n      if (typeof value === 'string'){ value = [value]; }\n\n      var that = this,\n          ms = this.$element,\n          msIds = $.map(value, function(val){ return(that.sanitize(val)); }),\n          selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable'),\n          selections = this.$selectionUl.find('#' + msIds.join('-selection, #')+'-selection').filter('.ms-selected').filter(':not(.'+that.options.disabledClass+')'),\n          options = ms.find('option').filter(function(){ return($.inArray(this.value, value) > -1); });\n\n      if (selections.length > 0){\n        selectables.removeClass('ms-selected').show();\n        selections.removeClass('ms-selected').hide();\n        options.removeAttr('selected');\n\n        that.$container.find(that.elemsSelector).removeClass('ms-hover');\n\n        var selectableOptgroups = that.$selectableUl.children('.ms-optgroup-container');\n        if (selectableOptgroups.length > 0){\n          selectableOptgroups.each(function(){\n            var selectablesLi = $(this).find('.ms-elem-selectable');\n            if (selectablesLi.filter(':not(.ms-selected)').length > 0){\n              $(this).find('.ms-optgroup-label').show();\n            }\n          });\n\n          var selectionOptgroups = that.$selectionUl.children('.ms-optgroup-container');\n          selectionOptgroups.each(function(){\n            var selectionsLi = $(this).find('.ms-elem-selection');\n            if (selectionsLi.filter('.ms-selected').length === 0){\n              $(this).find('.ms-optgroup-label').hide();\n            }\n          });\n        }\n        ms.trigger('change');\n        if (typeof that.options.afterDeselect === 'function') {\n          that.options.afterDeselect.call(this, value);\n        }\n      }\n    },\n\n    'select_all' : function(){\n      var ms = this.$element,\n          values = ms.val();\n\n      ms.find('option:not(\":disabled\")').attr('selected', 'selected');\n      this.$selectableUl.find('.ms-elem-selectable').filter(':not(.'+this.options.disabledClass+')').addClass('ms-selected').hide();\n      this.$selectionUl.find('.ms-optgroup-label').show();\n      this.$selectableUl.find('.ms-optgroup-label').hide();\n      this.$selectionUl.find('.ms-elem-selection').filter(':not(.'+this.options.disabledClass+')').addClass('ms-selected').show();\n      this.$selectionUl.focus();\n      ms.trigger('change');\n      if (typeof this.options.afterSelect === 'function') {\n        var selectedValues = $.grep(ms.val(), function(item){\n          return $.inArray(item, values) < 0;\n        });\n        this.options.afterSelect.call(this, selectedValues);\n      }\n    },\n\n    'deselect_all' : function(){\n      var ms = this.$element,\n          values = ms.val();\n\n      ms.find('option').removeAttr('selected');\n      this.$selectableUl.find('.ms-elem-selectable').removeClass('ms-selected').show();\n      this.$selectionUl.find('.ms-optgroup-label').hide();\n      this.$selectableUl.find('.ms-optgroup-label').show();\n      this.$selectionUl.find('.ms-elem-selection').removeClass('ms-selected').hide();\n      this.$selectableUl.focus();\n      ms.trigger('change');\n      if (typeof this.options.afterDeselect === 'function') {\n        this.options.afterDeselect.call(this, values);\n      }\n    },\n\n    sanitize: function(value){\n      var hash = 0, i, character;\n      if (value.length == 0) return hash;\n      var ls = 0;\n      for (i = 0, ls = value.length; i < ls; i++) {\n        character  = value.charCodeAt(i);\n        hash  = ((hash<<5)-hash)+character;\n        hash |= 0; // Convert to 32bit integer\n      }\n      return hash;\n    }\n  };\n\n  /* MULTISELECT PLUGIN DEFINITION\n   * ======================= */\n\n  $.fn.multiSelect = function () {\n    var option = arguments[0],\n        args = arguments;\n\n    return this.each(function () {\n      var $this = $(this),\n          data = $this.data('multiselect'),\n          options = $.extend({}, $.fn.multiSelect.defaults, $this.data(), typeof option === 'object' && option);\n\n      if (!data){ $this.data('multiselect', (data = new MultiSelect(this, options))); }\n\n      if (typeof option === 'string'){\n        data[option](args[1]);\n      } else {\n        data.init();\n      }\n    });\n  };\n\n  $.fn.multiSelect.defaults = {\n    keySelect: [32],\n    selectableOptgroup: false,\n    disabledClass : 'disabled',\n    dblClick : false,\n    keepOrder: false,\n    cssClass: ''\n  };\n\n  $.fn.multiSelect.Constructor = MultiSelect;\n\n  $.fn.insertAt = function(index, $parent) {\n    return this.each(function() {\n      if (index === 0) {\n        $parent.prepend(this);\n      } else {\n        $parent.children().eq(index - 1).after(this);\n      }\n    });\n};\n\n}(window.jQuery);\n"
  },
  {
    "path": "libs/jquery/multi-select.css",
    "content": ".ms-container{\n  background: transparent url('../img/switch.png') no-repeat 50% 50%;\n  width: 370px;\n}\n\n.ms-container:after{\n  content: \".\";\n  display: block;\n  height: 0;\n  line-height: 0;\n  font-size: 0;\n  clear: both;\n  min-height: 0;\n  visibility: hidden;\n}\n\n.ms-container .ms-selectable, .ms-container .ms-selection{\n  background: #fff;\n  color: #555555;\n  float: left;\n  width: 45%;\n}\n.ms-container .ms-selection{\n  float: right;\n}\n\n.ms-container .ms-list{\n  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n  -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);\n  -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;\n  -moz-transition: border linear 0.2s, box-shadow linear 0.2s;\n  -ms-transition: border linear 0.2s, box-shadow linear 0.2s;\n  -o-transition: border linear 0.2s, box-shadow linear 0.2s;\n  transition: border linear 0.2s, box-shadow linear 0.2s;\n  border: 1px solid #ccc;\n  -webkit-border-radius: 3px;\n  -moz-border-radius: 3px;\n  border-radius: 3px;\n  position: relative;\n  height: 200px;\n  padding: 0;\n  overflow-y: auto;\n}\n\n.ms-container .ms-list.ms-focus{\n  border-color: rgba(82, 168, 236, 0.8);\n  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);\n  -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);\n  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);\n  outline: 0;\n  outline: thin dotted \\9;\n}\n\n.ms-container ul{\n  margin: 0;\n  list-style-type: none;\n  padding: 0;\n}\n\n.ms-container .ms-optgroup-container{\n  width: 100%;\n}\n\n.ms-container .ms-optgroup-label{\n  margin: 0;\n  padding: 5px 0px 0px 5px;\n  cursor: pointer;\n  color: #999;\n}\n\n.ms-container .ms-selectable li.ms-elem-selectable,\n.ms-container .ms-selection li.ms-elem-selection{\n  border-bottom: 1px #eee solid;\n  padding: 2px 10px;\n  color: #555;\n  font-size: 14px;\n}\n\n.ms-container .ms-selectable li.ms-hover,\n.ms-container .ms-selection li.ms-hover{\n  cursor: pointer;\n  color: #fff;\n  text-decoration: none;\n  background-color: #08c;\n}\n\n.ms-container .ms-selectable li.disabled,\n.ms-container .ms-selection li.disabled{\n  background-color: #eee;\n  color: #aaa;\n  cursor: text;\n}"
  },
  {
    "path": "libs/knockout/knockout-3.5.0.debug.js",
    "content": "/*!\n * Knockout JavaScript library v3.5.0\n * (c) The Knockout.js team - http://knockoutjs.com/\n * License: MIT (http://www.opensource.org/licenses/mit-license.php)\n */\n\n(function(){\nvar DEBUG=true;\n(function(undefined){\n    // (0, eval)('this') is a robust way of getting a reference to the global object\n    // For details, see http://stackoverflow.com/questions/14119988/return-this-0-evalthis/14120023#14120023\n    var window = this || (0, eval)('this'),\n        document = window['document'],\n        navigator = window['navigator'],\n        jQueryInstance = window[\"jQuery\"],\n        JSON = window[\"JSON\"];\n\n    if (!jQueryInstance && typeof jQuery !== \"undefined\") {\n        jQueryInstance = jQuery;\n    }\n(function(factory) {\n    // Support three module loading scenarios\n    if (typeof define === 'function' && define['amd']) {\n        // [1] AMD anonymous module\n        define(['exports', 'require'], factory);\n    } else if (typeof exports === 'object' && typeof module === 'object') {\n        // [2] CommonJS/Node.js\n        factory(module['exports'] || exports);  // module.exports is for Node.js\n    } else {\n        // [3] No module loader (plain <script> tag) - put directly in global namespace\n        factory(window['ko'] = {});\n    }\n}(function(koExports, amdRequire){\n// Internally, all KO objects are attached to koExports (even the non-exported ones whose names will be minified by the closure compiler).\n// In the future, the following \"ko\" variable may be made distinct from \"koExports\" so that private objects are not externally reachable.\nvar ko = typeof koExports !== 'undefined' ? koExports : {};\n// Google Closure Compiler helpers (used only to make the minified file smaller)\nko.exportSymbol = function(koPath, object) {\n    var tokens = koPath.split(\".\");\n\n    // In the future, \"ko\" may become distinct from \"koExports\" (so that non-exported objects are not reachable)\n    // At that point, \"target\" would be set to: (typeof koExports !== \"undefined\" ? koExports : ko)\n    var target = ko;\n\n    for (var i = 0; i < tokens.length - 1; i++)\n        target = target[tokens[i]];\n    target[tokens[tokens.length - 1]] = object;\n};\nko.exportProperty = function(owner, publicName, object) {\n    owner[publicName] = object;\n};\nko.version = \"3.5.0\";\n\nko.exportSymbol('version', ko.version);\n// For any options that may affect various areas of Knockout and aren't directly associated with data binding.\nko.options = {\n    'deferUpdates': false,\n    'useOnlyNativeEvents': false,\n    'foreachHidesDestroyed': false\n};\n\n//ko.exportSymbol('options', ko.options);   // 'options' isn't minified\nko.utils = (function () {\n    var hasOwnProperty = Object.prototype.hasOwnProperty;\n\n    function objectForEach(obj, action) {\n        for (var prop in obj) {\n            if (hasOwnProperty.call(obj, prop)) {\n                action(prop, obj[prop]);\n            }\n        }\n    }\n\n    function extend(target, source) {\n        if (source) {\n            for(var prop in source) {\n                if(hasOwnProperty.call(source, prop)) {\n                    target[prop] = source[prop];\n                }\n            }\n        }\n        return target;\n    }\n\n    function setPrototypeOf(obj, proto) {\n        obj.__proto__ = proto;\n        return obj;\n    }\n\n    var canSetPrototype = ({ __proto__: [] } instanceof Array);\n    var canUseSymbols = !DEBUG && typeof Symbol === 'function';\n\n    // Represent the known event types in a compact way, then at runtime transform it into a hash with event name as key (for fast lookup)\n    var knownEvents = {}, knownEventTypesByEventName = {};\n    var keyEventTypeName = (navigator && /Firefox\\/2/i.test(navigator.userAgent)) ? 'KeyboardEvent' : 'UIEvents';\n    knownEvents[keyEventTypeName] = ['keyup', 'keydown', 'keypress'];\n    knownEvents['MouseEvents'] = ['click', 'dblclick', 'mousedown', 'mouseup', 'mousemove', 'mouseover', 'mouseout', 'mouseenter', 'mouseleave'];\n    objectForEach(knownEvents, function(eventType, knownEventsForType) {\n        if (knownEventsForType.length) {\n            for (var i = 0, j = knownEventsForType.length; i < j; i++)\n                knownEventTypesByEventName[knownEventsForType[i]] = eventType;\n        }\n    });\n    var eventsThatMustBeRegisteredUsingAttachEvent = { 'propertychange': true }; // Workaround for an IE9 issue - https://github.com/SteveSanderson/knockout/issues/406\n\n    // Detect IE versions for bug workarounds (uses IE conditionals, not UA string, for robustness)\n    // Note that, since IE 10 does not support conditional comments, the following logic only detects IE < 10.\n    // Currently this is by design, since IE 10+ behaves correctly when treated as a standard browser.\n    // If there is a future need to detect specific versions of IE10+, we will amend this.\n    var ieVersion = document && (function() {\n        var version = 3, div = document.createElement('div'), iElems = div.getElementsByTagName('i');\n\n        // Keep constructing conditional HTML blocks until we hit one that resolves to an empty fragment\n        while (\n            div.innerHTML = '<!--[if gt IE ' + (++version) + ']><i></i><![endif]-->',\n            iElems[0]\n        ) {}\n        return version > 4 ? version : undefined;\n    }());\n    var isIe6 = ieVersion === 6,\n        isIe7 = ieVersion === 7;\n\n    function isClickOnCheckableElement(element, eventType) {\n        if ((ko.utils.tagNameLower(element) !== \"input\") || !element.type) return false;\n        if (eventType.toLowerCase() != \"click\") return false;\n        var inputType = element.type;\n        return (inputType == \"checkbox\") || (inputType == \"radio\");\n    }\n\n    // For details on the pattern for changing node classes\n    // see: https://github.com/knockout/knockout/issues/1597\n    var cssClassNameRegex = /\\S+/g;\n\n    var jQueryEventAttachName;\n\n    function toggleDomNodeCssClass(node, classNames, shouldHaveClass) {\n        var addOrRemoveFn;\n        if (classNames) {\n            if (typeof node.classList === 'object') {\n                addOrRemoveFn = node.classList[shouldHaveClass ? 'add' : 'remove'];\n                ko.utils.arrayForEach(classNames.match(cssClassNameRegex), function(className) {\n                    addOrRemoveFn.call(node.classList, className);\n                });\n            } else if (typeof node.className['baseVal'] === 'string') {\n                // SVG tag .classNames is an SVGAnimatedString instance\n                toggleObjectClassPropertyString(node.className, 'baseVal', classNames, shouldHaveClass);\n            } else {\n                // node.className ought to be a string.\n                toggleObjectClassPropertyString(node, 'className', classNames, shouldHaveClass);\n            }\n        }\n    }\n\n    function toggleObjectClassPropertyString(obj, prop, classNames, shouldHaveClass) {\n        // obj/prop is either a node/'className' or a SVGAnimatedString/'baseVal'.\n        var currentClassNames = obj[prop].match(cssClassNameRegex) || [];\n        ko.utils.arrayForEach(classNames.match(cssClassNameRegex), function(className) {\n            ko.utils.addOrRemoveItem(currentClassNames, className, shouldHaveClass);\n        });\n        obj[prop] = currentClassNames.join(\" \");\n    }\n\n    return {\n        fieldsIncludedWithJsonPost: ['authenticity_token', /^__RequestVerificationToken(_.*)?$/],\n\n        arrayForEach: function (array, action, actionOwner) {\n            for (var i = 0, j = array.length; i < j; i++) {\n                action.call(actionOwner, array[i], i, array);\n            }\n        },\n\n        arrayIndexOf: typeof Array.prototype.indexOf == \"function\"\n            ? function (array, item) {\n                return Array.prototype.indexOf.call(array, item);\n            }\n            : function (array, item) {\n                for (var i = 0, j = array.length; i < j; i++) {\n                    if (array[i] === item)\n                        return i;\n                }\n                return -1;\n            },\n\n        arrayFirst: function (array, predicate, predicateOwner) {\n            for (var i = 0, j = array.length; i < j; i++) {\n                if (predicate.call(predicateOwner, array[i], i, array))\n                    return array[i];\n            }\n            return undefined;\n        },\n\n        arrayRemoveItem: function (array, itemToRemove) {\n            var index = ko.utils.arrayIndexOf(array, itemToRemove);\n            if (index > 0) {\n                array.splice(index, 1);\n            }\n            else if (index === 0) {\n                array.shift();\n            }\n        },\n\n        arrayGetDistinctValues: function (array) {\n            var result = [];\n            if (array) {\n                ko.utils.arrayForEach(array, function(item) {\n                    if (ko.utils.arrayIndexOf(result, item) < 0)\n                        result.push(item);\n                });\n            }\n            return result;\n        },\n\n        arrayMap: function (array, mapping, mappingOwner) {\n            var result = [];\n            if (array) {\n                for (var i = 0, j = array.length; i < j; i++)\n                    result.push(mapping.call(mappingOwner, array[i], i));\n            }\n            return result;\n        },\n\n        arrayFilter: function (array, predicate, predicateOwner) {\n            var result = [];\n            if (array) {\n                for (var i = 0, j = array.length; i < j; i++)\n                    if (predicate.call(predicateOwner, array[i], i))\n                        result.push(array[i]);\n            }\n            return result;\n        },\n\n        arrayPushAll: function (array, valuesToPush) {\n            if (valuesToPush instanceof Array)\n                array.push.apply(array, valuesToPush);\n            else\n                for (var i = 0, j = valuesToPush.length; i < j; i++)\n                    array.push(valuesToPush[i]);\n            return array;\n        },\n\n        addOrRemoveItem: function(array, value, included) {\n            var existingEntryIndex = ko.utils.arrayIndexOf(ko.utils.peekObservable(array), value);\n            if (existingEntryIndex < 0) {\n                if (included)\n                    array.push(value);\n            } else {\n                if (!included)\n                    array.splice(existingEntryIndex, 1);\n            }\n        },\n\n        canSetPrototype: canSetPrototype,\n\n        extend: extend,\n\n        setPrototypeOf: setPrototypeOf,\n\n        setPrototypeOfOrExtend: canSetPrototype ? setPrototypeOf : extend,\n\n        objectForEach: objectForEach,\n\n        objectMap: function(source, mapping, mappingOwner) {\n            if (!source)\n                return source;\n            var target = {};\n            for (var prop in source) {\n                if (hasOwnProperty.call(source, prop)) {\n                    target[prop] = mapping.call(mappingOwner, source[prop], prop, source);\n                }\n            }\n            return target;\n        },\n\n        emptyDomNode: function (domNode) {\n            while (domNode.firstChild) {\n                ko.removeNode(domNode.firstChild);\n            }\n        },\n\n        moveCleanedNodesToContainerElement: function(nodes) {\n            // Ensure it's a real array, as we're about to reparent the nodes and\n            // we don't want the underlying collection to change while we're doing that.\n            var nodesArray = ko.utils.makeArray(nodes);\n            var templateDocument = (nodesArray[0] && nodesArray[0].ownerDocument) || document;\n\n            var container = templateDocument.createElement('div');\n            for (var i = 0, j = nodesArray.length; i < j; i++) {\n                container.appendChild(ko.cleanNode(nodesArray[i]));\n            }\n            return container;\n        },\n\n        cloneNodes: function (nodesArray, shouldCleanNodes) {\n            for (var i = 0, j = nodesArray.length, newNodesArray = []; i < j; i++) {\n                var clonedNode = nodesArray[i].cloneNode(true);\n                newNodesArray.push(shouldCleanNodes ? ko.cleanNode(clonedNode) : clonedNode);\n            }\n            return newNodesArray;\n        },\n\n        setDomNodeChildren: function (domNode, childNodes) {\n            ko.utils.emptyDomNode(domNode);\n            if (childNodes) {\n                for (var i = 0, j = childNodes.length; i < j; i++)\n                    domNode.appendChild(childNodes[i]);\n            }\n        },\n\n        replaceDomNodes: function (nodeToReplaceOrNodeArray, newNodesArray) {\n            var nodesToReplaceArray = nodeToReplaceOrNodeArray.nodeType ? [nodeToReplaceOrNodeArray] : nodeToReplaceOrNodeArray;\n            if (nodesToReplaceArray.length > 0) {\n                var insertionPoint = nodesToReplaceArray[0];\n                var parent = insertionPoint.parentNode;\n                for (var i = 0, j = newNodesArray.length; i < j; i++)\n                    parent.insertBefore(newNodesArray[i], insertionPoint);\n                for (var i = 0, j = nodesToReplaceArray.length; i < j; i++) {\n                    ko.removeNode(nodesToReplaceArray[i]);\n                }\n            }\n        },\n\n        fixUpContinuousNodeArray: function(continuousNodeArray, parentNode) {\n            // Before acting on a set of nodes that were previously outputted by a template function, we have to reconcile\n            // them against what is in the DOM right now. It may be that some of the nodes have already been removed, or that\n            // new nodes might have been inserted in the middle, for example by a binding. Also, there may previously have been\n            // leading comment nodes (created by rewritten string-based templates) that have since been removed during binding.\n            // So, this function translates the old \"map\" output array into its best guess of the set of current DOM nodes.\n            //\n            // Rules:\n            //   [A] Any leading nodes that have been removed should be ignored\n            //       These most likely correspond to memoization nodes that were already removed during binding\n            //       See https://github.com/knockout/knockout/pull/440\n            //   [B] Any trailing nodes that have been remove should be ignored\n            //       This prevents the code here from adding unrelated nodes to the array while processing rule [C]\n            //       See https://github.com/knockout/knockout/pull/1903\n            //   [C] We want to output a continuous series of nodes. So, ignore any nodes that have already been removed,\n            //       and include any nodes that have been inserted among the previous collection\n\n            if (continuousNodeArray.length) {\n                // The parent node can be a virtual element; so get the real parent node\n                parentNode = (parentNode.nodeType === 8 && parentNode.parentNode) || parentNode;\n\n                // Rule [A]\n                while (continuousNodeArray.length && continuousNodeArray[0].parentNode !== parentNode)\n                    continuousNodeArray.splice(0, 1);\n\n                // Rule [B]\n                while (continuousNodeArray.length > 1 && continuousNodeArray[continuousNodeArray.length - 1].parentNode !== parentNode)\n                    continuousNodeArray.length--;\n\n                // Rule [C]\n                if (continuousNodeArray.length > 1) {\n                    var current = continuousNodeArray[0], last = continuousNodeArray[continuousNodeArray.length - 1];\n                    // Replace with the actual new continuous node set\n                    continuousNodeArray.length = 0;\n                    while (current !== last) {\n                        continuousNodeArray.push(current);\n                        current = current.nextSibling;\n                    }\n                    continuousNodeArray.push(last);\n                }\n            }\n            return continuousNodeArray;\n        },\n\n        setOptionNodeSelectionState: function (optionNode, isSelected) {\n            // IE6 sometimes throws \"unknown error\" if you try to write to .selected directly, whereas Firefox struggles with setAttribute. Pick one based on browser.\n            if (ieVersion < 7)\n                optionNode.setAttribute(\"selected\", isSelected);\n            else\n                optionNode.selected = isSelected;\n        },\n\n        stringTrim: function (string) {\n            return string === null || string === undefined ? '' :\n                string.trim ?\n                    string.trim() :\n                    string.toString().replace(/^[\\s\\xa0]+|[\\s\\xa0]+$/g, '');\n        },\n\n        stringStartsWith: function (string, startsWith) {\n            string = string || \"\";\n            if (startsWith.length > string.length)\n                return false;\n            return string.substring(0, startsWith.length) === startsWith;\n        },\n\n        domNodeIsContainedBy: function (node, containedByNode) {\n            if (node === containedByNode)\n                return true;\n            if (node.nodeType === 11)\n                return false; // Fixes issue #1162 - can't use node.contains for document fragments on IE8\n            if (containedByNode.contains)\n                return containedByNode.contains(node.nodeType !== 1 ? node.parentNode : node);\n            if (containedByNode.compareDocumentPosition)\n                return (containedByNode.compareDocumentPosition(node) & 16) == 16;\n            while (node && node != containedByNode) {\n                node = node.parentNode;\n            }\n            return !!node;\n        },\n\n        domNodeIsAttachedToDocument: function (node) {\n            return ko.utils.domNodeIsContainedBy(node, node.ownerDocument.documentElement);\n        },\n\n        anyDomNodeIsAttachedToDocument: function(nodes) {\n            return !!ko.utils.arrayFirst(nodes, ko.utils.domNodeIsAttachedToDocument);\n        },\n\n        tagNameLower: function(element) {\n            // For HTML elements, tagName will always be upper case; for XHTML elements, it'll be lower case.\n            // Possible future optimization: If we know it's an element from an XHTML document (not HTML),\n            // we don't need to do the .toLowerCase() as it will always be lower case anyway.\n            return element && element.tagName && element.tagName.toLowerCase();\n        },\n\n        catchFunctionErrors: function (delegate) {\n            return ko['onError'] ? function () {\n                try {\n                    return delegate.apply(this, arguments);\n                } catch (e) {\n                    ko['onError'] && ko['onError'](e);\n                    throw e;\n                }\n            } : delegate;\n        },\n\n        setTimeout: function (handler, timeout) {\n            return setTimeout(ko.utils.catchFunctionErrors(handler), timeout);\n        },\n\n        deferError: function (error) {\n            setTimeout(function () {\n                ko['onError'] && ko['onError'](error);\n                throw error;\n            }, 0);\n        },\n\n        registerEventHandler: function (element, eventType, handler) {\n            var wrappedHandler = ko.utils.catchFunctionErrors(handler);\n\n            var mustUseAttachEvent = eventsThatMustBeRegisteredUsingAttachEvent[eventType];\n            if (!ko.options['useOnlyNativeEvents'] && !mustUseAttachEvent && jQueryInstance) {\n                if (!jQueryEventAttachName) {\n                    jQueryEventAttachName = (typeof jQueryInstance(element)['on'] == 'function') ? 'on' : 'bind';\n                }\n                jQueryInstance(element)[jQueryEventAttachName](eventType, wrappedHandler);\n            } else if (!mustUseAttachEvent && typeof element.addEventListener == \"function\")\n                element.addEventListener(eventType, wrappedHandler, false);\n            else if (typeof element.attachEvent != \"undefined\") {\n                var attachEventHandler = function (event) { wrappedHandler.call(element, event); },\n                    attachEventName = \"on\" + eventType;\n                element.attachEvent(attachEventName, attachEventHandler);\n\n                // IE does not dispose attachEvent handlers automatically (unlike with addEventListener)\n                // so to avoid leaks, we have to remove them manually. See bug #856\n                ko.utils.domNodeDisposal.addDisposeCallback(element, function() {\n                    element.detachEvent(attachEventName, attachEventHandler);\n                });\n            } else\n                throw new Error(\"Browser doesn't support addEventListener or attachEvent\");\n        },\n\n        triggerEvent: function (element, eventType) {\n            if (!(element && element.nodeType))\n                throw new Error(\"element must be a DOM node when calling triggerEvent\");\n\n            // For click events on checkboxes and radio buttons, jQuery toggles the element checked state *after* the\n            // event handler runs instead of *before*. (This was fixed in 1.9 for checkboxes but not for radio buttons.)\n            // IE doesn't change the checked state when you trigger the click event using \"fireEvent\".\n            // In both cases, we'll use the click method instead.\n            var useClickWorkaround = isClickOnCheckableElement(element, eventType);\n\n            if (!ko.options['useOnlyNativeEvents'] && jQueryInstance && !useClickWorkaround) {\n                jQueryInstance(element)['trigger'](eventType);\n            } else if (typeof document.createEvent == \"function\") {\n                if (typeof element.dispatchEvent == \"function\") {\n                    var eventCategory = knownEventTypesByEventName[eventType] || \"HTMLEvents\";\n                    var event = document.createEvent(eventCategory);\n                    event.initEvent(eventType, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, element);\n                    element.dispatchEvent(event);\n                }\n                else\n                    throw new Error(\"The supplied element doesn't support dispatchEvent\");\n            } else if (useClickWorkaround && element.click) {\n                element.click();\n            } else if (typeof element.fireEvent != \"undefined\") {\n                element.fireEvent(\"on\" + eventType);\n            } else {\n                throw new Error(\"Browser doesn't support triggering events\");\n            }\n        },\n\n        unwrapObservable: function (value) {\n            return ko.isObservable(value) ? value() : value;\n        },\n\n        peekObservable: function (value) {\n            return ko.isObservable(value) ? value.peek() : value;\n        },\n\n        toggleDomNodeCssClass: toggleDomNodeCssClass,\n\n        setTextContent: function(element, textContent) {\n            var value = ko.utils.unwrapObservable(textContent);\n            if ((value === null) || (value === undefined))\n                value = \"\";\n\n            // We need there to be exactly one child: a text node.\n            // If there are no children, more than one, or if it's not a text node,\n            // we'll clear everything and create a single text node.\n            var innerTextNode = ko.virtualElements.firstChild(element);\n            if (!innerTextNode || innerTextNode.nodeType != 3 || ko.virtualElements.nextSibling(innerTextNode)) {\n                ko.virtualElements.setDomNodeChildren(element, [element.ownerDocument.createTextNode(value)]);\n            } else {\n                innerTextNode.data = value;\n            }\n\n            ko.utils.forceRefresh(element);\n        },\n\n        setElementName: function(element, name) {\n            element.name = name;\n\n            // Workaround IE 6/7 issue\n            // - https://github.com/SteveSanderson/knockout/issues/197\n            // - http://www.matts411.com/post/setting_the_name_attribute_in_ie_dom/\n            if (ieVersion <= 7) {\n                try {\n                    var escapedName = element.name.replace(/[&<>'\"]/g, function(r){ return \"&#\" + r.charCodeAt(0) + \";\"; });\n                    element.mergeAttributes(document.createElement(\"<input name='\" + escapedName + \"'/>\"), false);\n                }\n                catch(e) {} // For IE9 with doc mode \"IE9 Standards\" and browser mode \"IE9 Compatibility View\"\n            }\n        },\n\n        forceRefresh: function(node) {\n            // Workaround for an IE9 rendering bug - https://github.com/SteveSanderson/knockout/issues/209\n            if (ieVersion >= 9) {\n                // For text nodes and comment nodes (most likely virtual elements), we will have to refresh the container\n                var elem = node.nodeType == 1 ? node : node.parentNode;\n                if (elem.style)\n                    elem.style.zoom = elem.style.zoom;\n            }\n        },\n\n        ensureSelectElementIsRenderedCorrectly: function(selectElement) {\n            // Workaround for IE9 rendering bug - it doesn't reliably display all the text in dynamically-added select boxes unless you force it to re-render by updating the width.\n            // (See https://github.com/SteveSanderson/knockout/issues/312, http://stackoverflow.com/questions/5908494/select-only-shows-first-char-of-selected-option)\n            // Also fixes IE7 and IE8 bug that causes selects to be zero width if enclosed by 'if' or 'with'. (See issue #839)\n            if (ieVersion) {\n                var originalWidth = selectElement.style.width;\n                selectElement.style.width = 0;\n                selectElement.style.width = originalWidth;\n            }\n        },\n\n        range: function (min, max) {\n            min = ko.utils.unwrapObservable(min);\n            max = ko.utils.unwrapObservable(max);\n            var result = [];\n            for (var i = min; i <= max; i++)\n                result.push(i);\n            return result;\n        },\n\n        makeArray: function(arrayLikeObject) {\n            var result = [];\n            for (var i = 0, j = arrayLikeObject.length; i < j; i++) {\n                result.push(arrayLikeObject[i]);\n            };\n            return result;\n        },\n\n        createSymbolOrString: function(identifier) {\n            return canUseSymbols ? Symbol(identifier) : identifier;\n        },\n\n        isIe6 : isIe6,\n        isIe7 : isIe7,\n        ieVersion : ieVersion,\n\n        getFormFields: function(form, fieldName) {\n            var fields = ko.utils.makeArray(form.getElementsByTagName(\"input\")).concat(ko.utils.makeArray(form.getElementsByTagName(\"textarea\")));\n            var isMatchingField = (typeof fieldName == 'string')\n                ? function(field) { return field.name === fieldName }\n                : function(field) { return fieldName.test(field.name) }; // Treat fieldName as regex or object containing predicate\n            var matches = [];\n            for (var i = fields.length - 1; i >= 0; i--) {\n                if (isMatchingField(fields[i]))\n                    matches.push(fields[i]);\n            };\n            return matches;\n        },\n\n        parseJson: function (jsonString) {\n            if (typeof jsonString == \"string\") {\n                jsonString = ko.utils.stringTrim(jsonString);\n                if (jsonString) {\n                    if (JSON && JSON.parse) // Use native parsing where available\n                        return JSON.parse(jsonString);\n                    return (new Function(\"return \" + jsonString))(); // Fallback on less safe parsing for older browsers\n                }\n            }\n            return null;\n        },\n\n        stringifyJson: function (data, replacer, space) {   // replacer and space are optional\n            if (!JSON || !JSON.stringify)\n                throw new Error(\"Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js\");\n            return JSON.stringify(ko.utils.unwrapObservable(data), replacer, space);\n        },\n\n        postJson: function (urlOrForm, data, options) {\n            options = options || {};\n            var params = options['params'] || {};\n            var includeFields = options['includeFields'] || this.fieldsIncludedWithJsonPost;\n            var url = urlOrForm;\n\n            // If we were given a form, use its 'action' URL and pick out any requested field values\n            if((typeof urlOrForm == 'object') && (ko.utils.tagNameLower(urlOrForm) === \"form\")) {\n                var originalForm = urlOrForm;\n                url = originalForm.action;\n                for (var i = includeFields.length - 1; i >= 0; i--) {\n                    var fields = ko.utils.getFormFields(originalForm, includeFields[i]);\n                    for (var j = fields.length - 1; j >= 0; j--)\n                        params[fields[j].name] = fields[j].value;\n                }\n            }\n\n            data = ko.utils.unwrapObservable(data);\n            var form = document.createElement(\"form\");\n            form.style.display = \"none\";\n            form.action = url;\n            form.method = \"post\";\n            for (var key in data) {\n                // Since 'data' this is a model object, we include all properties including those inherited from its prototype\n                var input = document.createElement(\"input\");\n                input.type = \"hidden\";\n                input.name = key;\n                input.value = ko.utils.stringifyJson(ko.utils.unwrapObservable(data[key]));\n                form.appendChild(input);\n            }\n            objectForEach(params, function(key, value) {\n                var input = document.createElement(\"input\");\n                input.type = \"hidden\";\n                input.name = key;\n                input.value = value;\n                form.appendChild(input);\n            });\n            document.body.appendChild(form);\n            options['submitter'] ? options['submitter'](form) : form.submit();\n            setTimeout(function () { form.parentNode.removeChild(form); }, 0);\n        }\n    }\n}());\n\nko.exportSymbol('utils', ko.utils);\nko.exportSymbol('utils.arrayForEach', ko.utils.arrayForEach);\nko.exportSymbol('utils.arrayFirst', ko.utils.arrayFirst);\nko.exportSymbol('utils.arrayFilter', ko.utils.arrayFilter);\nko.exportSymbol('utils.arrayGetDistinctValues', ko.utils.arrayGetDistinctValues);\nko.exportSymbol('utils.arrayIndexOf', ko.utils.arrayIndexOf);\nko.exportSymbol('utils.arrayMap', ko.utils.arrayMap);\nko.exportSymbol('utils.arrayPushAll', ko.utils.arrayPushAll);\nko.exportSymbol('utils.arrayRemoveItem', ko.utils.arrayRemoveItem);\nko.exportSymbol('utils.cloneNodes', ko.utils.cloneNodes);\nko.exportSymbol('utils.createSymbolOrString', ko.utils.createSymbolOrString);\nko.exportSymbol('utils.extend', ko.utils.extend);\nko.exportSymbol('utils.fieldsIncludedWithJsonPost', ko.utils.fieldsIncludedWithJsonPost);\nko.exportSymbol('utils.getFormFields', ko.utils.getFormFields);\nko.exportSymbol('utils.objectMap', ko.utils.objectMap);\nko.exportSymbol('utils.peekObservable', ko.utils.peekObservable);\nko.exportSymbol('utils.postJson', ko.utils.postJson);\nko.exportSymbol('utils.parseJson', ko.utils.parseJson);\nko.exportSymbol('utils.registerEventHandler', ko.utils.registerEventHandler);\nko.exportSymbol('utils.stringifyJson', ko.utils.stringifyJson);\nko.exportSymbol('utils.range', ko.utils.range);\nko.exportSymbol('utils.toggleDomNodeCssClass', ko.utils.toggleDomNodeCssClass);\nko.exportSymbol('utils.triggerEvent', ko.utils.triggerEvent);\nko.exportSymbol('utils.unwrapObservable', ko.utils.unwrapObservable);\nko.exportSymbol('utils.objectForEach', ko.utils.objectForEach);\nko.exportSymbol('utils.addOrRemoveItem', ko.utils.addOrRemoveItem);\nko.exportSymbol('utils.setTextContent', ko.utils.setTextContent);\nko.exportSymbol('unwrap', ko.utils.unwrapObservable); // Convenient shorthand, because this is used so commonly\n\nif (!Function.prototype['bind']) {\n    // Function.prototype.bind is a standard part of ECMAScript 5th Edition (December 2009, http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf)\n    // In case the browser doesn't implement it natively, provide a JavaScript implementation. This implementation is based on the one in prototype.js\n    Function.prototype['bind'] = function (object) {\n        var originalFunction = this;\n        if (arguments.length === 1) {\n            return function () {\n                return originalFunction.apply(object, arguments);\n            };\n        } else {\n            var partialArgs = Array.prototype.slice.call(arguments, 1);\n            return function () {\n                var args = partialArgs.slice(0);\n                args.push.apply(args, arguments);\n                return originalFunction.apply(object, args);\n            };\n        }\n    };\n}\n\nko.utils.domData = new (function () {\n    var uniqueId = 0;\n    var dataStoreKeyExpandoPropertyName = \"__ko__\" + (new Date).getTime();\n    var dataStore = {};\n\n    var getDataForNode, clear;\n    if (!ko.utils.ieVersion) {\n        // We considered using WeakMap, but it has a problem in IE 11 and Edge that prevents using\n        // it cross-window, so instead we just store the data directly on the node.\n        // See https://github.com/knockout/knockout/issues/2141\n        getDataForNode = function (node, createIfNotFound) {\n            var dataForNode = node[dataStoreKeyExpandoPropertyName];\n            if (!dataForNode && createIfNotFound) {\n                dataForNode = node[dataStoreKeyExpandoPropertyName] = {};\n            }\n            return dataForNode;\n        };\n        clear = function (node) {\n            if (node[dataStoreKeyExpandoPropertyName]) {\n                delete node[dataStoreKeyExpandoPropertyName];\n                return true; // Exposing \"did clean\" flag purely so specs can infer whether things have been cleaned up as intended\n            }\n            return false;\n        };\n    } else {\n        // Old IE versions have memory issues if you store objects on the node, so we use a\n        // separate data storage and link to it from the node using a string key.\n        getDataForNode = function (node, createIfNotFound) {\n            var dataStoreKey = node[dataStoreKeyExpandoPropertyName];\n            var hasExistingDataStore = dataStoreKey && (dataStoreKey !== \"null\") && dataStore[dataStoreKey];\n            if (!hasExistingDataStore) {\n                if (!createIfNotFound)\n                    return undefined;\n                dataStoreKey = node[dataStoreKeyExpandoPropertyName] = \"ko\" + uniqueId++;\n                dataStore[dataStoreKey] = {};\n            }\n            return dataStore[dataStoreKey];\n        };\n        clear = function (node) {\n            var dataStoreKey = node[dataStoreKeyExpandoPropertyName];\n            if (dataStoreKey) {\n                delete dataStore[dataStoreKey];\n                node[dataStoreKeyExpandoPropertyName] = null;\n                return true; // Exposing \"did clean\" flag purely so specs can infer whether things have been cleaned up as intended\n            }\n            return false;\n        };\n    }\n\n    return {\n        get: function (node, key) {\n            var dataForNode = getDataForNode(node, false);\n            return dataForNode && dataForNode[key];\n        },\n        set: function (node, key, value) {\n            // Make sure we don't actually create a new domData key if we are actually deleting a value\n            var dataForNode = getDataForNode(node, value !== undefined /* createIfNotFound */);\n            dataForNode && (dataForNode[key] = value);\n        },\n        getOrSet: function (node, key, value) {\n            var dataForNode = getDataForNode(node, true /* createIfNotFound */);\n            return dataForNode[key] || (dataForNode[key] = value);\n        },\n        clear: clear,\n\n        nextKey: function () {\n            return (uniqueId++) + dataStoreKeyExpandoPropertyName;\n        }\n    };\n})();\n\nko.exportSymbol('utils.domData', ko.utils.domData);\nko.exportSymbol('utils.domData.clear', ko.utils.domData.clear); // Exporting only so specs can clear up after themselves fully\n\nko.utils.domNodeDisposal = new (function () {\n    var domDataKey = ko.utils.domData.nextKey();\n    var cleanableNodeTypes = { 1: true, 8: true, 9: true };       // Element, Comment, Document\n    var cleanableNodeTypesWithDescendants = { 1: true, 9: true }; // Element, Document\n\n    function getDisposeCallbacksCollection(node, createIfNotFound) {\n        var allDisposeCallbacks = ko.utils.domData.get(node, domDataKey);\n        if ((allDisposeCallbacks === undefined) && createIfNotFound) {\n            allDisposeCallbacks = [];\n            ko.utils.domData.set(node, domDataKey, allDisposeCallbacks);\n        }\n        return allDisposeCallbacks;\n    }\n    function destroyCallbacksCollection(node) {\n        ko.utils.domData.set(node, domDataKey, undefined);\n    }\n\n    function cleanSingleNode(node) {\n        // Run all the dispose callbacks\n        var callbacks = getDisposeCallbacksCollection(node, false);\n        if (callbacks) {\n            callbacks = callbacks.slice(0); // Clone, as the array may be modified during iteration (typically, callbacks will remove themselves)\n            for (var i = 0; i < callbacks.length; i++)\n                callbacks[i](node);\n        }\n\n        // Erase the DOM data\n        ko.utils.domData.clear(node);\n\n        // Perform cleanup needed by external libraries (currently only jQuery, but can be extended)\n        ko.utils.domNodeDisposal[\"cleanExternalData\"](node);\n\n        // Clear any immediate-child comment nodes, as these wouldn't have been found by\n        // node.getElementsByTagName(\"*\") in cleanNode() (comment nodes aren't elements)\n        if (cleanableNodeTypesWithDescendants[node.nodeType]) {\n            cleanNodesInList(node.childNodes, true/*onlyComments*/);\n        }\n    }\n\n    function cleanNodesInList(nodeList, onlyComments) {\n        var cleanedNodes = [], lastCleanedNode;\n        for (var i = 0; i < nodeList.length; i++) {\n            if (!onlyComments || nodeList[i].nodeType === 8) {\n                cleanSingleNode(cleanedNodes[cleanedNodes.length] = lastCleanedNode = nodeList[i]);\n                if (nodeList[i] !== lastCleanedNode) {\n                    while (i-- && ko.utils.arrayIndexOf(cleanedNodes, nodeList[i]) == -1) {}\n                }\n            }\n        }\n    }\n\n    return {\n        addDisposeCallback : function(node, callback) {\n            if (typeof callback != \"function\")\n                throw new Error(\"Callback must be a function\");\n            getDisposeCallbacksCollection(node, true).push(callback);\n        },\n\n        removeDisposeCallback : function(node, callback) {\n            var callbacksCollection = getDisposeCallbacksCollection(node, false);\n            if (callbacksCollection) {\n                ko.utils.arrayRemoveItem(callbacksCollection, callback);\n                if (callbacksCollection.length == 0)\n                    destroyCallbacksCollection(node);\n            }\n        },\n\n        cleanNode : function(node) {\n            // First clean this node, where applicable\n            if (cleanableNodeTypes[node.nodeType]) {\n                cleanSingleNode(node);\n\n                // ... then its descendants, where applicable\n                if (cleanableNodeTypesWithDescendants[node.nodeType]) {\n                    cleanNodesInList(node.getElementsByTagName(\"*\"));\n                }\n            }\n            return node;\n        },\n\n        removeNode : function(node) {\n            ko.cleanNode(node);\n            if (node.parentNode)\n                node.parentNode.removeChild(node);\n        },\n\n        \"cleanExternalData\" : function (node) {\n            // Special support for jQuery here because it's so commonly used.\n            // Many jQuery plugins (including jquery.tmpl) store data using jQuery's equivalent of domData\n            // so notify it to tear down any resources associated with the node & descendants here.\n            if (jQueryInstance && (typeof jQueryInstance['cleanData'] == \"function\"))\n                jQueryInstance['cleanData']([node]);\n        }\n    };\n})();\nko.cleanNode = ko.utils.domNodeDisposal.cleanNode; // Shorthand name for convenience\nko.removeNode = ko.utils.domNodeDisposal.removeNode; // Shorthand name for convenience\nko.exportSymbol('cleanNode', ko.cleanNode);\nko.exportSymbol('removeNode', ko.removeNode);\nko.exportSymbol('utils.domNodeDisposal', ko.utils.domNodeDisposal);\nko.exportSymbol('utils.domNodeDisposal.addDisposeCallback', ko.utils.domNodeDisposal.addDisposeCallback);\nko.exportSymbol('utils.domNodeDisposal.removeDisposeCallback', ko.utils.domNodeDisposal.removeDisposeCallback);\n(function () {\n    var none = [0, \"\", \"\"],\n        table = [1, \"<table>\", \"</table>\"],\n        tbody = [2, \"<table><tbody>\", \"</tbody></table>\"],\n        tr = [3, \"<table><tbody><tr>\", \"</tr></tbody></table>\"],\n        select = [1, \"<select multiple='multiple'>\", \"</select>\"],\n        lookup = {\n            'thead': table,\n            'tbody': table,\n            'tfoot': table,\n            'tr': tbody,\n            'td': tr,\n            'th': tr,\n            'option': select,\n            'optgroup': select\n        },\n\n        // This is needed for old IE if you're *not* using either jQuery or innerShiv. Doesn't affect other cases.\n        mayRequireCreateElementHack = ko.utils.ieVersion <= 8;\n\n    function getWrap(tags) {\n        var m = tags.match(/^(?:<!--.*?-->\\s*?)*?<([a-z]+)[\\s>]/);\n        return (m && lookup[m[1]]) || none;\n    }\n\n    function simpleHtmlParse(html, documentContext) {\n        documentContext || (documentContext = document);\n        var windowContext = documentContext['parentWindow'] || documentContext['defaultView'] || window;\n\n        // Based on jQuery's \"clean\" function, but only accounting for table-related elements.\n        // If you have referenced jQuery, this won't be used anyway - KO will use jQuery's \"clean\" function directly\n\n        // Note that there's still an issue in IE < 9 whereby it will discard comment nodes that are the first child of\n        // a descendant node. For example: \"<div><!-- mycomment -->abc</div>\" will get parsed as \"<div>abc</div>\"\n        // This won't affect anyone who has referenced jQuery, and there's always the workaround of inserting a dummy node\n        // (possibly a text node) in front of the comment. So, KO does not attempt to workaround this IE issue automatically at present.\n\n        // Trim whitespace, otherwise indexOf won't work as expected\n        var tags = ko.utils.stringTrim(html).toLowerCase(), div = documentContext.createElement(\"div\"),\n            wrap = getWrap(tags),\n            depth = wrap[0];\n\n        // Go to html and back, then peel off extra wrappers\n        // Note that we always prefix with some dummy text, because otherwise, IE<9 will strip out leading comment nodes in descendants. Total madness.\n        var markup = \"ignored<div>\" + wrap[1] + html + wrap[2] + \"</div>\";\n        if (typeof windowContext['innerShiv'] == \"function\") {\n            // Note that innerShiv is deprecated in favour of html5shiv. We should consider adding\n            // support for html5shiv (except if no explicit support is needed, e.g., if html5shiv\n            // somehow shims the native APIs so it just works anyway)\n            div.appendChild(windowContext['innerShiv'](markup));\n        } else {\n            if (mayRequireCreateElementHack) {\n                // The document.createElement('my-element') trick to enable custom elements in IE6-8\n                // only works if we assign innerHTML on an element associated with that document.\n                documentContext.body.appendChild(div);\n            }\n\n            div.innerHTML = markup;\n\n            if (mayRequireCreateElementHack) {\n                div.parentNode.removeChild(div);\n            }\n        }\n\n        // Move to the right depth\n        while (depth--)\n            div = div.lastChild;\n\n        return ko.utils.makeArray(div.lastChild.childNodes);\n    }\n\n    function jQueryHtmlParse(html, documentContext) {\n        // jQuery's \"parseHTML\" function was introduced in jQuery 1.8.0 and is a documented public API.\n        if (jQueryInstance['parseHTML']) {\n            return jQueryInstance['parseHTML'](html, documentContext) || []; // Ensure we always return an array and never null\n        } else {\n            // For jQuery < 1.8.0, we fall back on the undocumented internal \"clean\" function.\n            var elems = jQueryInstance['clean']([html], documentContext);\n\n            // As of jQuery 1.7.1, jQuery parses the HTML by appending it to some dummy parent nodes held in an in-memory document fragment.\n            // Unfortunately, it never clears the dummy parent nodes from the document fragment, so it leaks memory over time.\n            // Fix this by finding the top-most dummy parent element, and detaching it from its owner fragment.\n            if (elems && elems[0]) {\n                // Find the top-most parent element that's a direct child of a document fragment\n                var elem = elems[0];\n                while (elem.parentNode && elem.parentNode.nodeType !== 11 /* i.e., DocumentFragment */)\n                    elem = elem.parentNode;\n                // ... then detach it\n                if (elem.parentNode)\n                    elem.parentNode.removeChild(elem);\n            }\n\n            return elems;\n        }\n    }\n\n    ko.utils.parseHtmlFragment = function(html, documentContext) {\n        return jQueryInstance ?\n            jQueryHtmlParse(html, documentContext) :   // As below, benefit from jQuery's optimisations where possible\n            simpleHtmlParse(html, documentContext);  // ... otherwise, this simple logic will do in most common cases.\n    };\n\n    ko.utils.parseHtmlForTemplateNodes = function(html, documentContext) {\n        var nodes = ko.utils.parseHtmlFragment(html, documentContext);\n        return (nodes.length && nodes[0].parentElement) || ko.utils.moveCleanedNodesToContainerElement(nodes);\n    };\n\n    ko.utils.setHtml = function(node, html) {\n        ko.utils.emptyDomNode(node);\n\n        // There's no legitimate reason to display a stringified observable without unwrapping it, so we'll unwrap it\n        html = ko.utils.unwrapObservable(html);\n\n        if ((html !== null) && (html !== undefined)) {\n            if (typeof html != 'string')\n                html = html.toString();\n\n            // jQuery contains a lot of sophisticated code to parse arbitrary HTML fragments,\n            // for example <tr> elements which are not normally allowed to exist on their own.\n            // If you've referenced jQuery we'll use that rather than duplicating its code.\n            if (jQueryInstance) {\n                jQueryInstance(node)['html'](html);\n            } else {\n                // ... otherwise, use KO's own parsing logic.\n                var parsedNodes = ko.utils.parseHtmlFragment(html, node.ownerDocument);\n                for (var i = 0; i < parsedNodes.length; i++)\n                    node.appendChild(parsedNodes[i]);\n            }\n        }\n    };\n})();\n\nko.exportSymbol('utils.parseHtmlFragment', ko.utils.parseHtmlFragment);\nko.exportSymbol('utils.setHtml', ko.utils.setHtml);\n\nko.memoization = (function () {\n    var memos = {};\n\n    function randomMax8HexChars() {\n        return (((1 + Math.random()) * 0x100000000) | 0).toString(16).substring(1);\n    }\n    function generateRandomId() {\n        return randomMax8HexChars() + randomMax8HexChars();\n    }\n    function findMemoNodes(rootNode, appendToArray) {\n        if (!rootNode)\n            return;\n        if (rootNode.nodeType == 8) {\n            var memoId = ko.memoization.parseMemoText(rootNode.nodeValue);\n            if (memoId != null)\n                appendToArray.push({ domNode: rootNode, memoId: memoId });\n        } else if (rootNode.nodeType == 1) {\n            for (var i = 0, childNodes = rootNode.childNodes, j = childNodes.length; i < j; i++)\n                findMemoNodes(childNodes[i], appendToArray);\n        }\n    }\n\n    return {\n        memoize: function (callback) {\n            if (typeof callback != \"function\")\n                throw new Error(\"You can only pass a function to ko.memoization.memoize()\");\n            var memoId = generateRandomId();\n            memos[memoId] = callback;\n            return \"<!--[ko_memo:\" + memoId + \"]-->\";\n        },\n\n        unmemoize: function (memoId, callbackParams) {\n            var callback = memos[memoId];\n            if (callback === undefined)\n                throw new Error(\"Couldn't find any memo with ID \" + memoId + \". Perhaps it's already been unmemoized.\");\n            try {\n                callback.apply(null, callbackParams || []);\n                return true;\n            }\n            finally { delete memos[memoId]; }\n        },\n\n        unmemoizeDomNodeAndDescendants: function (domNode, extraCallbackParamsArray) {\n            var memos = [];\n            findMemoNodes(domNode, memos);\n            for (var i = 0, j = memos.length; i < j; i++) {\n                var node = memos[i].domNode;\n                var combinedParams = [node];\n                if (extraCallbackParamsArray)\n                    ko.utils.arrayPushAll(combinedParams, extraCallbackParamsArray);\n                ko.memoization.unmemoize(memos[i].memoId, combinedParams);\n                node.nodeValue = \"\"; // Neuter this node so we don't try to unmemoize it again\n                if (node.parentNode)\n                    node.parentNode.removeChild(node); // If possible, erase it totally (not always possible - someone else might just hold a reference to it then call unmemoizeDomNodeAndDescendants again)\n            }\n        },\n\n        parseMemoText: function (memoText) {\n            var match = memoText.match(/^\\[ko_memo\\:(.*?)\\]$/);\n            return match ? match[1] : null;\n        }\n    };\n})();\n\nko.exportSymbol('memoization', ko.memoization);\nko.exportSymbol('memoization.memoize', ko.memoization.memoize);\nko.exportSymbol('memoization.unmemoize', ko.memoization.unmemoize);\nko.exportSymbol('memoization.parseMemoText', ko.memoization.parseMemoText);\nko.exportSymbol('memoization.unmemoizeDomNodeAndDescendants', ko.memoization.unmemoizeDomNodeAndDescendants);\nko.tasks = (function () {\n    var scheduler,\n        taskQueue = [],\n        taskQueueLength = 0,\n        nextHandle = 1,\n        nextIndexToProcess = 0;\n\n    if (window['MutationObserver']) {\n        // Chrome 27+, Firefox 14+, IE 11+, Opera 15+, Safari 6.1+\n        // From https://github.com/petkaantonov/bluebird * Copyright (c) 2014 Petka Antonov * License: MIT\n        scheduler = (function (callback) {\n            var div = document.createElement(\"div\");\n            new MutationObserver(callback).observe(div, {attributes: true});\n            return function () { div.classList.toggle(\"foo\"); };\n        })(scheduledProcess);\n    } else if (document && \"onreadystatechange\" in document.createElement(\"script\")) {\n        // IE 6-10\n        // From https://github.com/YuzuJS/setImmediate * Copyright (c) 2012 Barnesandnoble.com, llc, Donavon West, and Domenic Denicola * License: MIT\n        scheduler = function (callback) {\n            var script = document.createElement(\"script\");\n            script.onreadystatechange = function () {\n                script.onreadystatechange = null;\n                document.documentElement.removeChild(script);\n                script = null;\n                callback();\n            };\n            document.documentElement.appendChild(script);\n        };\n    } else {\n        scheduler = function (callback) {\n            setTimeout(callback, 0);\n        };\n    }\n\n    function processTasks() {\n        if (taskQueueLength) {\n            // Each mark represents the end of a logical group of tasks and the number of these groups is\n            // limited to prevent unchecked recursion.\n            var mark = taskQueueLength, countMarks = 0;\n\n            // nextIndexToProcess keeps track of where we are in the queue; processTasks can be called recursively without issue\n            for (var task; nextIndexToProcess < taskQueueLength; ) {\n                if (task = taskQueue[nextIndexToProcess++]) {\n                    if (nextIndexToProcess > mark) {\n                        if (++countMarks >= 5000) {\n                            nextIndexToProcess = taskQueueLength;   // skip all tasks remaining in the queue since any of them could be causing the recursion\n                            ko.utils.deferError(Error(\"'Too much recursion' after processing \" + countMarks + \" task groups.\"));\n                            break;\n                        }\n                        mark = taskQueueLength;\n                    }\n                    try {\n                        task();\n                    } catch (ex) {\n                        ko.utils.deferError(ex);\n                    }\n                }\n            }\n        }\n    }\n\n    function scheduledProcess() {\n        processTasks();\n\n        // Reset the queue\n        nextIndexToProcess = taskQueueLength = taskQueue.length = 0;\n    }\n\n    function scheduleTaskProcessing() {\n        ko.tasks['scheduler'](scheduledProcess);\n    }\n\n    var tasks = {\n        'scheduler': scheduler,     // Allow overriding the scheduler\n\n        schedule: function (func) {\n            if (!taskQueueLength) {\n                scheduleTaskProcessing();\n            }\n\n            taskQueue[taskQueueLength++] = func;\n            return nextHandle++;\n        },\n\n        cancel: function (handle) {\n            var index = handle - (nextHandle - taskQueueLength);\n            if (index >= nextIndexToProcess && index < taskQueueLength) {\n                taskQueue[index] = null;\n            }\n        },\n\n        // For testing only: reset the queue and return the previous queue length\n        'resetForTesting': function () {\n            var length = taskQueueLength - nextIndexToProcess;\n            nextIndexToProcess = taskQueueLength = taskQueue.length = 0;\n            return length;\n        },\n\n        runEarly: processTasks\n    };\n\n    return tasks;\n})();\n\nko.exportSymbol('tasks', ko.tasks);\nko.exportSymbol('tasks.schedule', ko.tasks.schedule);\n//ko.exportSymbol('tasks.cancel', ko.tasks.cancel);  \"cancel\" isn't minified\nko.exportSymbol('tasks.runEarly', ko.tasks.runEarly);\nko.extenders = {\n    'throttle': function(target, timeout) {\n        // Throttling means two things:\n\n        // (1) For dependent observables, we throttle *evaluations* so that, no matter how fast its dependencies\n        //     notify updates, the target doesn't re-evaluate (and hence doesn't notify) faster than a certain rate\n        target['throttleEvaluation'] = timeout;\n\n        // (2) For writable targets (observables, or writable dependent observables), we throttle *writes*\n        //     so the target cannot change value synchronously or faster than a certain rate\n        var writeTimeoutInstance = null;\n        return ko.dependentObservable({\n            'read': target,\n            'write': function(value) {\n                clearTimeout(writeTimeoutInstance);\n                writeTimeoutInstance = ko.utils.setTimeout(function() {\n                    target(value);\n                }, timeout);\n            }\n        });\n    },\n\n    'rateLimit': function(target, options) {\n        var timeout, method, limitFunction;\n\n        if (typeof options == 'number') {\n            timeout = options;\n        } else {\n            timeout = options['timeout'];\n            method = options['method'];\n        }\n\n        // rateLimit supersedes deferred updates\n        target._deferUpdates = false;\n\n        limitFunction = typeof method == 'function' ? method : method == 'notifyWhenChangesStop' ?  debounce : throttle;\n        target.limit(function(callback) {\n            return limitFunction(callback, timeout, options);\n        });\n    },\n\n    'deferred': function(target, options) {\n        if (options !== true) {\n            throw new Error('The \\'deferred\\' extender only accepts the value \\'true\\', because it is not supported to turn deferral off once enabled.')\n        }\n\n        if (!target._deferUpdates) {\n            target._deferUpdates = true;\n            target.limit(function (callback) {\n                var handle,\n                    ignoreUpdates = false;\n                return function () {\n                    if (!ignoreUpdates) {\n                        ko.tasks.cancel(handle);\n                        handle = ko.tasks.schedule(callback);\n\n                        try {\n                            ignoreUpdates = true;\n                            target['notifySubscribers'](undefined, 'dirty');\n                        } finally {\n                            ignoreUpdates = false;\n                        }\n                    }\n                };\n            });\n        }\n    },\n\n    'notify': function(target, notifyWhen) {\n        target[\"equalityComparer\"] = notifyWhen == \"always\" ?\n            null :  // null equalityComparer means to always notify\n            valuesArePrimitiveAndEqual;\n    }\n};\n\nvar primitiveTypes = { 'undefined':1, 'boolean':1, 'number':1, 'string':1 };\nfunction valuesArePrimitiveAndEqual(a, b) {\n    var oldValueIsPrimitive = (a === null) || (typeof(a) in primitiveTypes);\n    return oldValueIsPrimitive ? (a === b) : false;\n}\n\nfunction throttle(callback, timeout) {\n    var timeoutInstance;\n    return function () {\n        if (!timeoutInstance) {\n            timeoutInstance = ko.utils.setTimeout(function () {\n                timeoutInstance = undefined;\n                callback();\n            }, timeout);\n        }\n    };\n}\n\nfunction debounce(callback, timeout) {\n    var timeoutInstance;\n    return function () {\n        clearTimeout(timeoutInstance);\n        timeoutInstance = ko.utils.setTimeout(callback, timeout);\n    };\n}\n\nfunction applyExtenders(requestedExtenders) {\n    var target = this;\n    if (requestedExtenders) {\n        ko.utils.objectForEach(requestedExtenders, function(key, value) {\n            var extenderHandler = ko.extenders[key];\n            if (typeof extenderHandler == 'function') {\n                target = extenderHandler(target, value) || target;\n            }\n        });\n    }\n    return target;\n}\n\nko.exportSymbol('extenders', ko.extenders);\n\nko.subscription = function (target, callback, disposeCallback) {\n    this._target = target;\n    this._callback = callback;\n    this._disposeCallback = disposeCallback;\n    this._isDisposed = false;\n    this._node = null;\n    this._domNodeDisposalCallback = null;\n    ko.exportProperty(this, 'dispose', this.dispose);\n    ko.exportProperty(this, 'disposeWhenNodeIsRemoved', this.disposeWhenNodeIsRemoved);\n};\nko.subscription.prototype.dispose = function () {\n    var self = this;\n    if (!self._isDisposed) {\n        if (self._domNodeDisposalCallback) {\n            ko.utils.domNodeDisposal.removeDisposeCallback(self._node, self._domNodeDisposalCallback);\n        }\n        self._isDisposed = true;\n        self._disposeCallback();\n\n        self._target = self._callback = self._disposeCallback = self._node = self._domNodeDisposalCallback = null;\n    }\n};\nko.subscription.prototype.disposeWhenNodeIsRemoved = function (node) {\n    this._node = node;\n    ko.utils.domNodeDisposal.addDisposeCallback(node, this._domNodeDisposalCallback = this.dispose.bind(this));\n};\n\nko.subscribable = function () {\n    ko.utils.setPrototypeOfOrExtend(this, ko_subscribable_fn);\n    ko_subscribable_fn.init(this);\n}\n\nvar defaultEvent = \"change\";\n\n// Moved out of \"limit\" to avoid the extra closure\nfunction limitNotifySubscribers(value, event) {\n    if (!event || event === defaultEvent) {\n        this._limitChange(value);\n    } else if (event === 'beforeChange') {\n        this._limitBeforeChange(value);\n    } else {\n        this._origNotifySubscribers(value, event);\n    }\n}\n\nvar ko_subscribable_fn = {\n    init: function(instance) {\n        instance._subscriptions = { \"change\": [] };\n        instance._versionNumber = 1;\n    },\n\n    subscribe: function (callback, callbackTarget, event) {\n        var self = this;\n\n        event = event || defaultEvent;\n        var boundCallback = callbackTarget ? callback.bind(callbackTarget) : callback;\n\n        var subscription = new ko.subscription(self, boundCallback, function () {\n            ko.utils.arrayRemoveItem(self._subscriptions[event], subscription);\n            if (self.afterSubscriptionRemove)\n                self.afterSubscriptionRemove(event);\n        });\n\n        if (self.beforeSubscriptionAdd)\n            self.beforeSubscriptionAdd(event);\n\n        if (!self._subscriptions[event])\n            self._subscriptions[event] = [];\n        self._subscriptions[event].push(subscription);\n\n        return subscription;\n    },\n\n    \"notifySubscribers\": function (valueToNotify, event) {\n        event = event || defaultEvent;\n        if (event === defaultEvent) {\n            this.updateVersion();\n        }\n        if (this.hasSubscriptionsForEvent(event)) {\n            var subs = event === defaultEvent && this._changeSubscriptions || this._subscriptions[event].slice(0);\n            try {\n                ko.dependencyDetection.begin(); // Begin suppressing dependency detection (by setting the top frame to undefined)\n                for (var i = 0, subscription; subscription = subs[i]; ++i) {\n                    // In case a subscription was disposed during the arrayForEach cycle, check\n                    // for isDisposed on each subscription before invoking its callback\n                    if (!subscription._isDisposed)\n                        subscription._callback(valueToNotify);\n                }\n            } finally {\n                ko.dependencyDetection.end(); // End suppressing dependency detection\n            }\n        }\n    },\n\n    getVersion: function () {\n        return this._versionNumber;\n    },\n\n    hasChanged: function (versionToCheck) {\n        return this.getVersion() !== versionToCheck;\n    },\n\n    updateVersion: function () {\n        ++this._versionNumber;\n    },\n\n    limit: function(limitFunction) {\n        var self = this, selfIsObservable = ko.isObservable(self),\n            ignoreBeforeChange, notifyNextChange, previousValue, pendingValue, didUpdate,\n            beforeChange = 'beforeChange';\n\n        if (!self._origNotifySubscribers) {\n            self._origNotifySubscribers = self[\"notifySubscribers\"];\n            self[\"notifySubscribers\"] = limitNotifySubscribers;\n        }\n\n        var finish = limitFunction(function() {\n            self._notificationIsPending = false;\n\n            // If an observable provided a reference to itself, access it to get the latest value.\n            // This allows computed observables to delay calculating their value until needed.\n            if (selfIsObservable && pendingValue === self) {\n                pendingValue = self._evalIfChanged ? self._evalIfChanged() : self();\n            }\n            var shouldNotify = notifyNextChange || (didUpdate && self.isDifferent(previousValue, pendingValue));\n\n            didUpdate = notifyNextChange = ignoreBeforeChange = false;\n\n            if (shouldNotify) {\n                self._origNotifySubscribers(previousValue = pendingValue);\n            }\n        });\n\n        self._limitChange = function(value, isDirty) {\n            if (!isDirty || !self._notificationIsPending) {\n                didUpdate = !isDirty;\n            }\n            self._changeSubscriptions = self._subscriptions[defaultEvent].slice(0);\n            self._notificationIsPending = ignoreBeforeChange = true;\n            pendingValue = value;\n            finish();\n        };\n        self._limitBeforeChange = function(value) {\n            if (!ignoreBeforeChange) {\n                previousValue = value;\n                self._origNotifySubscribers(value, beforeChange);\n            }\n        };\n        self._recordUpdate = function() {\n            didUpdate = true;\n        };\n        self._notifyNextChangeIfValueIsDifferent = function() {\n            if (self.isDifferent(previousValue, self.peek(true /*evaluate*/))) {\n                notifyNextChange = true;\n            }\n        };\n    },\n\n    hasSubscriptionsForEvent: function(event) {\n        return this._subscriptions[event] && this._subscriptions[event].length;\n    },\n\n    getSubscriptionsCount: function (event) {\n        if (event) {\n            return this._subscriptions[event] && this._subscriptions[event].length || 0;\n        } else {\n            var total = 0;\n            ko.utils.objectForEach(this._subscriptions, function(eventName, subscriptions) {\n                if (eventName !== 'dirty')\n                    total += subscriptions.length;\n            });\n            return total;\n        }\n    },\n\n    isDifferent: function(oldValue, newValue) {\n        return !this['equalityComparer'] || !this['equalityComparer'](oldValue, newValue);\n    },\n\n    toString: function() {\n      return '[object Object]'\n    },\n\n    extend: applyExtenders\n};\n\nko.exportProperty(ko_subscribable_fn, 'init', ko_subscribable_fn.init);\nko.exportProperty(ko_subscribable_fn, 'subscribe', ko_subscribable_fn.subscribe);\nko.exportProperty(ko_subscribable_fn, 'extend', ko_subscribable_fn.extend);\nko.exportProperty(ko_subscribable_fn, 'getSubscriptionsCount', ko_subscribable_fn.getSubscriptionsCount);\n\n// For browsers that support proto assignment, we overwrite the prototype of each\n// observable instance. Since observables are functions, we need Function.prototype\n// to still be in the prototype chain.\nif (ko.utils.canSetPrototype) {\n    ko.utils.setPrototypeOf(ko_subscribable_fn, Function.prototype);\n}\n\nko.subscribable['fn'] = ko_subscribable_fn;\n\n\nko.isSubscribable = function (instance) {\n    return instance != null && typeof instance.subscribe == \"function\" && typeof instance[\"notifySubscribers\"] == \"function\";\n};\n\nko.exportSymbol('subscribable', ko.subscribable);\nko.exportSymbol('isSubscribable', ko.isSubscribable);\n\nko.computedContext = ko.dependencyDetection = (function () {\n    var outerFrames = [],\n        currentFrame,\n        lastId = 0;\n\n    // Return a unique ID that can be assigned to an observable for dependency tracking.\n    // Theoretically, you could eventually overflow the number storage size, resulting\n    // in duplicate IDs. But in JavaScript, the largest exact integral value is 2^53\n    // or 9,007,199,254,740,992. If you created 1,000,000 IDs per second, it would\n    // take over 285 years to reach that number.\n    // Reference http://blog.vjeux.com/2010/javascript/javascript-max_int-number-limits.html\n    function getId() {\n        return ++lastId;\n    }\n\n    function begin(options) {\n        outerFrames.push(currentFrame);\n        currentFrame = options;\n    }\n\n    function end() {\n        currentFrame = outerFrames.pop();\n    }\n\n    return {\n        begin: begin,\n\n        end: end,\n\n        registerDependency: function (subscribable) {\n            if (currentFrame) {\n                if (!ko.isSubscribable(subscribable))\n                    throw new Error(\"Only subscribable things can act as dependencies\");\n                currentFrame.callback.call(currentFrame.callbackTarget, subscribable, subscribable._id || (subscribable._id = getId()));\n            }\n        },\n\n        ignore: function (callback, callbackTarget, callbackArgs) {\n            try {\n                begin();\n                return callback.apply(callbackTarget, callbackArgs || []);\n            } finally {\n                end();\n            }\n        },\n\n        getDependenciesCount: function () {\n            if (currentFrame)\n                return currentFrame.computed.getDependenciesCount();\n        },\n\n        getDependencies: function () {\n            if (currentFrame)\n                return currentFrame.computed.getDependencies();\n        },\n\n        isInitial: function() {\n            if (currentFrame)\n                return currentFrame.isInitial;\n        },\n\n        computed: function() {\n            if (currentFrame)\n                return currentFrame.computed;\n        }\n    };\n})();\n\nko.exportSymbol('computedContext', ko.computedContext);\nko.exportSymbol('computedContext.getDependenciesCount', ko.computedContext.getDependenciesCount);\nko.exportSymbol('computedContext.getDependencies', ko.computedContext.getDependencies);\nko.exportSymbol('computedContext.isInitial', ko.computedContext.isInitial);\nko.exportSymbol('computedContext.registerDependency', ko.computedContext.registerDependency);\n\nko.exportSymbol('ignoreDependencies', ko.ignoreDependencies = ko.dependencyDetection.ignore);\nvar observableLatestValue = ko.utils.createSymbolOrString('_latestValue');\n\nko.observable = function (initialValue) {\n    function observable() {\n        if (arguments.length > 0) {\n            // Write\n\n            // Ignore writes if the value hasn't changed\n            if (observable.isDifferent(observable[observableLatestValue], arguments[0])) {\n                observable.valueWillMutate();\n                observable[observableLatestValue] = arguments[0];\n                observable.valueHasMutated();\n            }\n            return this; // Permits chained assignments\n        }\n        else {\n            // Read\n            ko.dependencyDetection.registerDependency(observable); // The caller only needs to be notified of changes if they did a \"read\" operation\n            return observable[observableLatestValue];\n        }\n    }\n\n    observable[observableLatestValue] = initialValue;\n\n    // Inherit from 'subscribable'\n    if (!ko.utils.canSetPrototype) {\n        // 'subscribable' won't be on the prototype chain unless we put it there directly\n        ko.utils.extend(observable, ko.subscribable['fn']);\n    }\n    ko.subscribable['fn'].init(observable);\n\n    // Inherit from 'observable'\n    ko.utils.setPrototypeOfOrExtend(observable, observableFn);\n\n    if (ko.options['deferUpdates']) {\n        ko.extenders['deferred'](observable, true);\n    }\n\n    return observable;\n}\n\n// Define prototype for observables\nvar observableFn = {\n    'equalityComparer': valuesArePrimitiveAndEqual,\n    peek: function() { return this[observableLatestValue]; },\n    valueHasMutated: function () {\n        this['notifySubscribers'](this[observableLatestValue], 'spectate');\n        this['notifySubscribers'](this[observableLatestValue]);\n    },\n    valueWillMutate: function () { this['notifySubscribers'](this[observableLatestValue], 'beforeChange'); }\n};\n\n// Note that for browsers that don't support proto assignment, the\n// inheritance chain is created manually in the ko.observable constructor\nif (ko.utils.canSetPrototype) {\n    ko.utils.setPrototypeOf(observableFn, ko.subscribable['fn']);\n}\n\nvar protoProperty = ko.observable.protoProperty = '__ko_proto__';\nobservableFn[protoProperty] = ko.observable;\n\nko.isObservable = function (instance) {\n    var proto = typeof instance == 'function' && instance[protoProperty];\n    if (proto && proto !== observableFn[protoProperty] && proto !== ko.computed['fn'][protoProperty]) {\n        throw Error(\"Invalid object that looks like an observable; possibly from another Knockout instance\");\n    }\n    return !!proto;\n};\n\nko.isWriteableObservable = function (instance) {\n    return (typeof instance == 'function' && (\n        (instance[protoProperty] === observableFn[protoProperty]) ||  // Observable\n        (instance[protoProperty] === ko.computed['fn'][protoProperty] && instance.hasWriteFunction)));   // Writable computed observable\n};\n\nko.exportSymbol('observable', ko.observable);\nko.exportSymbol('isObservable', ko.isObservable);\nko.exportSymbol('isWriteableObservable', ko.isWriteableObservable);\nko.exportSymbol('isWritableObservable', ko.isWriteableObservable);\nko.exportSymbol('observable.fn', observableFn);\nko.exportProperty(observableFn, 'peek', observableFn.peek);\nko.exportProperty(observableFn, 'valueHasMutated', observableFn.valueHasMutated);\nko.exportProperty(observableFn, 'valueWillMutate', observableFn.valueWillMutate);\nko.observableArray = function (initialValues) {\n    initialValues = initialValues || [];\n\n    if (typeof initialValues != 'object' || !('length' in initialValues))\n        throw new Error(\"The argument passed when initializing an observable array must be an array, or null, or undefined.\");\n\n    var result = ko.observable(initialValues);\n    ko.utils.setPrototypeOfOrExtend(result, ko.observableArray['fn']);\n    return result.extend({'trackArrayChanges':true});\n};\n\nko.observableArray['fn'] = {\n    'remove': function (valueOrPredicate) {\n        var underlyingArray = this.peek();\n        var removedValues = [];\n        var predicate = typeof valueOrPredicate == \"function\" && !ko.isObservable(valueOrPredicate) ? valueOrPredicate : function (value) { return value === valueOrPredicate; };\n        for (var i = 0; i < underlyingArray.length; i++) {\n            var value = underlyingArray[i];\n            if (predicate(value)) {\n                if (removedValues.length === 0) {\n                    this.valueWillMutate();\n                }\n                if (underlyingArray[i] !== value) {\n                    throw Error(\"Array modified during remove; cannot remove item\");\n                }\n                removedValues.push(value);\n                underlyingArray.splice(i, 1);\n                i--;\n            }\n        }\n        if (removedValues.length) {\n            this.valueHasMutated();\n        }\n        return removedValues;\n    },\n\n    'removeAll': function (arrayOfValues) {\n        // If you passed zero args, we remove everything\n        if (arrayOfValues === undefined) {\n            var underlyingArray = this.peek();\n            var allValues = underlyingArray.slice(0);\n            this.valueWillMutate();\n            underlyingArray.splice(0, underlyingArray.length);\n            this.valueHasMutated();\n            return allValues;\n        }\n        // If you passed an arg, we interpret it as an array of entries to remove\n        if (!arrayOfValues)\n            return [];\n        return this['remove'](function (value) {\n            return ko.utils.arrayIndexOf(arrayOfValues, value) >= 0;\n        });\n    },\n\n    'destroy': function (valueOrPredicate) {\n        var underlyingArray = this.peek();\n        var predicate = typeof valueOrPredicate == \"function\" && !ko.isObservable(valueOrPredicate) ? valueOrPredicate : function (value) { return value === valueOrPredicate; };\n        this.valueWillMutate();\n        for (var i = underlyingArray.length - 1; i >= 0; i--) {\n            var value = underlyingArray[i];\n            if (predicate(value))\n                value[\"_destroy\"] = true;\n        }\n        this.valueHasMutated();\n    },\n\n    'destroyAll': function (arrayOfValues) {\n        // If you passed zero args, we destroy everything\n        if (arrayOfValues === undefined)\n            return this['destroy'](function() { return true });\n\n        // If you passed an arg, we interpret it as an array of entries to destroy\n        if (!arrayOfValues)\n            return [];\n        return this['destroy'](function (value) {\n            return ko.utils.arrayIndexOf(arrayOfValues, value) >= 0;\n        });\n    },\n\n    'indexOf': function (item) {\n        var underlyingArray = this();\n        return ko.utils.arrayIndexOf(underlyingArray, item);\n    },\n\n    'replace': function(oldItem, newItem) {\n        var index = this['indexOf'](oldItem);\n        if (index >= 0) {\n            this.valueWillMutate();\n            this.peek()[index] = newItem;\n            this.valueHasMutated();\n        }\n    },\n\n    'sorted': function (compareFunction) {\n        var arrayCopy = this().slice(0);\n        return compareFunction ? arrayCopy.sort(compareFunction) : arrayCopy.sort();\n    },\n\n    'reversed': function () {\n        return this().slice(0).reverse();\n    }\n};\n\n// Note that for browsers that don't support proto assignment, the\n// inheritance chain is created manually in the ko.observableArray constructor\nif (ko.utils.canSetPrototype) {\n    ko.utils.setPrototypeOf(ko.observableArray['fn'], ko.observable['fn']);\n}\n\n// Populate ko.observableArray.fn with read/write functions from native arrays\n// Important: Do not add any additional functions here that may reasonably be used to *read* data from the array\n// because we'll eval them without causing subscriptions, so ko.computed output could end up getting stale\nko.utils.arrayForEach([\"pop\", \"push\", \"reverse\", \"shift\", \"sort\", \"splice\", \"unshift\"], function (methodName) {\n    ko.observableArray['fn'][methodName] = function () {\n        // Use \"peek\" to avoid creating a subscription in any computed that we're executing in the context of\n        // (for consistency with mutating regular observables)\n        var underlyingArray = this.peek();\n        this.valueWillMutate();\n        this.cacheDiffForKnownOperation(underlyingArray, methodName, arguments);\n        var methodCallResult = underlyingArray[methodName].apply(underlyingArray, arguments);\n        this.valueHasMutated();\n        // The native sort and reverse methods return a reference to the array, but it makes more sense to return the observable array instead.\n        return methodCallResult === underlyingArray ? this : methodCallResult;\n    };\n});\n\n// Populate ko.observableArray.fn with read-only functions from native arrays\nko.utils.arrayForEach([\"slice\"], function (methodName) {\n    ko.observableArray['fn'][methodName] = function () {\n        var underlyingArray = this();\n        return underlyingArray[methodName].apply(underlyingArray, arguments);\n    };\n});\n\nko.isObservableArray = function (instance) {\n    return ko.isObservable(instance)\n        && typeof instance[\"remove\"] == \"function\"\n        && typeof instance[\"push\"] == \"function\";\n};\n\nko.exportSymbol('observableArray', ko.observableArray);\nko.exportSymbol('isObservableArray', ko.isObservableArray);\nvar arrayChangeEventName = 'arrayChange';\nko.extenders['trackArrayChanges'] = function(target, options) {\n    // Use the provided options--each call to trackArrayChanges overwrites the previously set options\n    target.compareArrayOptions = {};\n    if (options && typeof options == \"object\") {\n        ko.utils.extend(target.compareArrayOptions, options);\n    }\n    target.compareArrayOptions['sparse'] = true;\n\n    // Only modify the target observable once\n    if (target.cacheDiffForKnownOperation) {\n        return;\n    }\n    var trackingChanges = false,\n        cachedDiff = null,\n        arrayChangeSubscription,\n        pendingNotifications = 0,\n        previousContents,\n        underlyingNotifySubscribersFunction,\n        underlyingBeforeSubscriptionAddFunction = target.beforeSubscriptionAdd,\n        underlyingAfterSubscriptionRemoveFunction = target.afterSubscriptionRemove;\n\n    // Watch \"subscribe\" calls, and for array change events, ensure change tracking is enabled\n    target.beforeSubscriptionAdd = function (event) {\n        if (underlyingBeforeSubscriptionAddFunction)\n            underlyingBeforeSubscriptionAddFunction.call(target, event);\n        if (event === arrayChangeEventName) {\n            trackChanges();\n        }\n    };\n    // Watch \"dispose\" calls, and for array change events, ensure change tracking is disabled when all are disposed\n    target.afterSubscriptionRemove = function (event) {\n        if (underlyingAfterSubscriptionRemoveFunction)\n            underlyingAfterSubscriptionRemoveFunction.call(target, event);\n        if (event === arrayChangeEventName && !target.hasSubscriptionsForEvent(arrayChangeEventName)) {\n            if (underlyingNotifySubscribersFunction) {\n                target['notifySubscribers'] = underlyingNotifySubscribersFunction;\n                underlyingNotifySubscribersFunction = undefined;\n            }\n            if (arrayChangeSubscription) {\n                arrayChangeSubscription.dispose();\n            }\n            arrayChangeSubscription = null;\n            trackingChanges = false;\n            previousContents = undefined;\n        }\n    };\n\n    function trackChanges() {\n        if (trackingChanges) {\n            // Whenever there's a new subscription and there are pending notifications, make sure all previous\n            // subscriptions are notified of the change so that all subscriptions are in sync.\n            notifyChanges();\n            return;\n        }\n\n        trackingChanges = true;\n\n        // Intercept \"notifySubscribers\" to track how many times it was called.\n        underlyingNotifySubscribersFunction = target['notifySubscribers'];\n        target['notifySubscribers'] = function(valueToNotify, event) {\n            if (!event || event === defaultEvent) {\n                ++pendingNotifications;\n            }\n            return underlyingNotifySubscribersFunction.apply(this, arguments);\n        };\n\n        // Each time the array changes value, capture a clone so that on the next\n        // change it's possible to produce a diff\n        previousContents = [].concat(target.peek() || []);\n        cachedDiff = null;\n        arrayChangeSubscription = target.subscribe(notifyChanges);\n\n        function notifyChanges() {\n            if (pendingNotifications) {\n                // Make a copy of the current contents and ensure it's an array\n                var currentContents = [].concat(target.peek() || []);\n\n                // Compute the diff and issue notifications, but only if someone is listening\n                if (target.hasSubscriptionsForEvent(arrayChangeEventName)) {\n                    var changes = getChanges(previousContents, currentContents);\n                }\n\n                // Eliminate references to the old, removed items, so they can be GCed\n                previousContents = currentContents;\n                cachedDiff = null;\n                pendingNotifications = 0;\n\n                if (changes && changes.length) {\n                    target['notifySubscribers'](changes, arrayChangeEventName);\n                }\n            }\n        }\n    }\n\n    function getChanges(previousContents, currentContents) {\n        // We try to re-use cached diffs.\n        // The scenarios where pendingNotifications > 1 are when using rate-limiting or the Deferred Updates\n        // plugin, which without this check would not be compatible with arrayChange notifications. Normally,\n        // notifications are issued immediately so we wouldn't be queueing up more than one.\n        if (!cachedDiff || pendingNotifications > 1) {\n            cachedDiff = ko.utils.compareArrays(previousContents, currentContents, target.compareArrayOptions);\n        }\n\n        return cachedDiff;\n    }\n\n    target.cacheDiffForKnownOperation = function(rawArray, operationName, args) {\n        // Only run if we're currently tracking changes for this observable array\n        // and there aren't any pending deferred notifications.\n        if (!trackingChanges || pendingNotifications) {\n            return;\n        }\n        var diff = [],\n            arrayLength = rawArray.length,\n            argsLength = args.length,\n            offset = 0;\n\n        function pushDiff(status, value, index) {\n            return diff[diff.length] = { 'status': status, 'value': value, 'index': index };\n        }\n        switch (operationName) {\n            case 'push':\n                offset = arrayLength;\n            case 'unshift':\n                for (var index = 0; index < argsLength; index++) {\n                    pushDiff('added', args[index], offset + index);\n                }\n                break;\n\n            case 'pop':\n                offset = arrayLength - 1;\n            case 'shift':\n                if (arrayLength) {\n                    pushDiff('deleted', rawArray[offset], offset);\n                }\n                break;\n\n            case 'splice':\n                // Negative start index means 'from end of array'. After that we clamp to [0...arrayLength].\n                // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice\n                var startIndex = Math.min(Math.max(0, args[0] < 0 ? arrayLength + args[0] : args[0]), arrayLength),\n                    endDeleteIndex = argsLength === 1 ? arrayLength : Math.min(startIndex + (args[1] || 0), arrayLength),\n                    endAddIndex = startIndex + argsLength - 2,\n                    endIndex = Math.max(endDeleteIndex, endAddIndex),\n                    additions = [], deletions = [];\n                for (var index = startIndex, argsIndex = 2; index < endIndex; ++index, ++argsIndex) {\n                    if (index < endDeleteIndex)\n                        deletions.push(pushDiff('deleted', rawArray[index], index));\n                    if (index < endAddIndex)\n                        additions.push(pushDiff('added', args[argsIndex], index));\n                }\n                ko.utils.findMovesInArrayComparison(deletions, additions);\n                break;\n\n            default:\n                return;\n        }\n        cachedDiff = diff;\n    };\n};\nvar computedState = ko.utils.createSymbolOrString('_state');\n\nko.computed = ko.dependentObservable = function (evaluatorFunctionOrOptions, evaluatorFunctionTarget, options) {\n    if (typeof evaluatorFunctionOrOptions === \"object\") {\n        // Single-parameter syntax - everything is on this \"options\" param\n        options = evaluatorFunctionOrOptions;\n    } else {\n        // Multi-parameter syntax - construct the options according to the params passed\n        options = options || {};\n        if (evaluatorFunctionOrOptions) {\n            options[\"read\"] = evaluatorFunctionOrOptions;\n        }\n    }\n    if (typeof options[\"read\"] != \"function\")\n        throw Error(\"Pass a function that returns the value of the ko.computed\");\n\n    var writeFunction = options[\"write\"];\n    var state = {\n        latestValue: undefined,\n        isStale: true,\n        isDirty: true,\n        isBeingEvaluated: false,\n        suppressDisposalUntilDisposeWhenReturnsFalse: false,\n        isDisposed: false,\n        pure: false,\n        isSleeping: false,\n        readFunction: options[\"read\"],\n        evaluatorFunctionTarget: evaluatorFunctionTarget || options[\"owner\"],\n        disposeWhenNodeIsRemoved: options[\"disposeWhenNodeIsRemoved\"] || options.disposeWhenNodeIsRemoved || null,\n        disposeWhen: options[\"disposeWhen\"] || options.disposeWhen,\n        domNodeDisposalCallback: null,\n        dependencyTracking: {},\n        dependenciesCount: 0,\n        evaluationTimeoutInstance: null\n    };\n\n    function computedObservable() {\n        if (arguments.length > 0) {\n            if (typeof writeFunction === \"function\") {\n                // Writing a value\n                writeFunction.apply(state.evaluatorFunctionTarget, arguments);\n            } else {\n                throw new Error(\"Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.\");\n            }\n            return this; // Permits chained assignments\n        } else {\n            // Reading the value\n            if (!state.isDisposed) {\n                ko.dependencyDetection.registerDependency(computedObservable);\n            }\n            if (state.isDirty || (state.isSleeping && computedObservable.haveDependenciesChanged())) {\n                computedObservable.evaluateImmediate();\n            }\n            return state.latestValue;\n        }\n    }\n\n    computedObservable[computedState] = state;\n    computedObservable.hasWriteFunction = typeof writeFunction === \"function\";\n\n    // Inherit from 'subscribable'\n    if (!ko.utils.canSetPrototype) {\n        // 'subscribable' won't be on the prototype chain unless we put it there directly\n        ko.utils.extend(computedObservable, ko.subscribable['fn']);\n    }\n    ko.subscribable['fn'].init(computedObservable);\n\n    // Inherit from 'computed'\n    ko.utils.setPrototypeOfOrExtend(computedObservable, computedFn);\n\n    if (options['pure']) {\n        state.pure = true;\n        state.isSleeping = true;     // Starts off sleeping; will awake on the first subscription\n        ko.utils.extend(computedObservable, pureComputedOverrides);\n    } else if (options['deferEvaluation']) {\n        ko.utils.extend(computedObservable, deferEvaluationOverrides);\n    }\n\n    if (ko.options['deferUpdates']) {\n        ko.extenders['deferred'](computedObservable, true);\n    }\n\n    if (DEBUG) {\n        // #1731 - Aid debugging by exposing the computed's options\n        computedObservable[\"_options\"] = options;\n    }\n\n    if (state.disposeWhenNodeIsRemoved) {\n        // Since this computed is associated with a DOM node, and we don't want to dispose the computed\n        // until the DOM node is *removed* from the document (as opposed to never having been in the document),\n        // we'll prevent disposal until \"disposeWhen\" first returns false.\n        state.suppressDisposalUntilDisposeWhenReturnsFalse = true;\n\n        // disposeWhenNodeIsRemoved: true can be used to opt into the \"only dispose after first false result\"\n        // behaviour even if there's no specific node to watch. In that case, clear the option so we don't try\n        // to watch for a non-node's disposal. This technique is intended for KO's internal use only and shouldn't\n        // be documented or used by application code, as it's likely to change in a future version of KO.\n        if (!state.disposeWhenNodeIsRemoved.nodeType) {\n            state.disposeWhenNodeIsRemoved = null;\n        }\n    }\n\n    // Evaluate, unless sleeping or deferEvaluation is true\n    if (!state.isSleeping && !options['deferEvaluation']) {\n        computedObservable.evaluateImmediate();\n    }\n\n    // Attach a DOM node disposal callback so that the computed will be proactively disposed as soon as the node is\n    // removed using ko.removeNode. But skip if isActive is false (there will never be any dependencies to dispose).\n    if (state.disposeWhenNodeIsRemoved && computedObservable.isActive()) {\n        ko.utils.domNodeDisposal.addDisposeCallback(state.disposeWhenNodeIsRemoved, state.domNodeDisposalCallback = function () {\n            computedObservable.dispose();\n        });\n    }\n\n    return computedObservable;\n};\n\n// Utility function that disposes a given dependencyTracking entry\nfunction computedDisposeDependencyCallback(id, entryToDispose) {\n    if (entryToDispose !== null && entryToDispose.dispose) {\n        entryToDispose.dispose();\n    }\n}\n\n// This function gets called each time a dependency is detected while evaluating a computed.\n// It's factored out as a shared function to avoid creating unnecessary function instances during evaluation.\nfunction computedBeginDependencyDetectionCallback(subscribable, id) {\n    var computedObservable = this.computedObservable,\n        state = computedObservable[computedState];\n    if (!state.isDisposed) {\n        if (this.disposalCount && this.disposalCandidates[id]) {\n            // Don't want to dispose this subscription, as it's still being used\n            computedObservable.addDependencyTracking(id, subscribable, this.disposalCandidates[id]);\n            this.disposalCandidates[id] = null; // No need to actually delete the property - disposalCandidates is a transient object anyway\n            --this.disposalCount;\n        } else if (!state.dependencyTracking[id]) {\n            // Brand new subscription - add it\n            computedObservable.addDependencyTracking(id, subscribable, state.isSleeping ? { _target: subscribable } : computedObservable.subscribeToDependency(subscribable));\n        }\n        // If the observable we've accessed has a pending notification, ensure we get notified of the actual final value (bypass equality checks)\n        if (subscribable._notificationIsPending) {\n            subscribable._notifyNextChangeIfValueIsDifferent();\n        }\n    }\n}\n\nvar computedFn = {\n    \"equalityComparer\": valuesArePrimitiveAndEqual,\n    getDependenciesCount: function () {\n        return this[computedState].dependenciesCount;\n    },\n    getDependencies: function () {\n        var dependencyTracking = this[computedState].dependencyTracking, dependentObservables = [];\n\n        ko.utils.objectForEach(dependencyTracking, function (id, dependency) {\n            dependentObservables[dependency._order] = dependency._target;\n        });\n\n        return dependentObservables;\n    },\n    hasAncestorDependency: function (obs) {\n        if (!this[computedState].dependenciesCount) {\n            return false;\n        }\n        var dependencies = this.getDependencies();\n        if (ko.utils.arrayIndexOf(dependencies, obs) !== -1) {\n            return true;\n        }\n        return !!ko.utils.arrayFirst(dependencies, function (dep) {\n            return dep.hasAncestorDependency && dep.hasAncestorDependency(obs);\n        });\n    },\n    addDependencyTracking: function (id, target, trackingObj) {\n        if (this[computedState].pure && target === this) {\n            throw Error(\"A 'pure' computed must not be called recursively\");\n        }\n\n        this[computedState].dependencyTracking[id] = trackingObj;\n        trackingObj._order = this[computedState].dependenciesCount++;\n        trackingObj._version = target.getVersion();\n    },\n    haveDependenciesChanged: function () {\n        var id, dependency, dependencyTracking = this[computedState].dependencyTracking;\n        for (id in dependencyTracking) {\n            if (Object.prototype.hasOwnProperty.call(dependencyTracking, id)) {\n                dependency = dependencyTracking[id];\n                if ((this._evalDelayed && dependency._target._notificationIsPending) || dependency._target.hasChanged(dependency._version)) {\n                    return true;\n                }\n            }\n        }\n    },\n    markDirty: function () {\n        // Process \"dirty\" events if we can handle delayed notifications\n        if (this._evalDelayed && !this[computedState].isBeingEvaluated) {\n            this._evalDelayed(false /*isChange*/);\n        }\n    },\n    isActive: function () {\n        var state = this[computedState];\n        return state.isDirty || state.dependenciesCount > 0;\n    },\n    respondToChange: function () {\n        // Ignore \"change\" events if we've already scheduled a delayed notification\n        if (!this._notificationIsPending) {\n            this.evaluatePossiblyAsync();\n        } else if (this[computedState].isDirty) {\n            this[computedState].isStale = true;\n        }\n    },\n    subscribeToDependency: function (target) {\n        if (target._deferUpdates) {\n            var dirtySub = target.subscribe(this.markDirty, this, 'dirty'),\n                changeSub = target.subscribe(this.respondToChange, this);\n            return {\n                _target: target,\n                dispose: function () {\n                    dirtySub.dispose();\n                    changeSub.dispose();\n                }\n            };\n        } else {\n            return target.subscribe(this.evaluatePossiblyAsync, this);\n        }\n    },\n    evaluatePossiblyAsync: function () {\n        var computedObservable = this,\n            throttleEvaluationTimeout = computedObservable['throttleEvaluation'];\n        if (throttleEvaluationTimeout && throttleEvaluationTimeout >= 0) {\n            clearTimeout(this[computedState].evaluationTimeoutInstance);\n            this[computedState].evaluationTimeoutInstance = ko.utils.setTimeout(function () {\n                computedObservable.evaluateImmediate(true /*notifyChange*/);\n            }, throttleEvaluationTimeout);\n        } else if (computedObservable._evalDelayed) {\n            computedObservable._evalDelayed(true /*isChange*/);\n        } else {\n            computedObservable.evaluateImmediate(true /*notifyChange*/);\n        }\n    },\n    evaluateImmediate: function (notifyChange) {\n        var computedObservable = this,\n            state = computedObservable[computedState],\n            disposeWhen = state.disposeWhen,\n            changed = false;\n\n        if (state.isBeingEvaluated) {\n            // If the evaluation of a ko.computed causes side effects, it's possible that it will trigger its own re-evaluation.\n            // This is not desirable (it's hard for a developer to realise a chain of dependencies might cause this, and they almost\n            // certainly didn't intend infinite re-evaluations). So, for predictability, we simply prevent ko.computeds from causing\n            // their own re-evaluation. Further discussion at https://github.com/SteveSanderson/knockout/pull/387\n            return;\n        }\n\n        // Do not evaluate (and possibly capture new dependencies) if disposed\n        if (state.isDisposed) {\n            return;\n        }\n\n        if (state.disposeWhenNodeIsRemoved && !ko.utils.domNodeIsAttachedToDocument(state.disposeWhenNodeIsRemoved) || disposeWhen && disposeWhen()) {\n            // See comment above about suppressDisposalUntilDisposeWhenReturnsFalse\n            if (!state.suppressDisposalUntilDisposeWhenReturnsFalse) {\n                computedObservable.dispose();\n                return;\n            }\n        } else {\n            // It just did return false, so we can stop suppressing now\n            state.suppressDisposalUntilDisposeWhenReturnsFalse = false;\n        }\n\n        state.isBeingEvaluated = true;\n        try {\n            changed = this.evaluateImmediate_CallReadWithDependencyDetection(notifyChange);\n        } finally {\n            state.isBeingEvaluated = false;\n        }\n\n        return changed;\n    },\n    evaluateImmediate_CallReadWithDependencyDetection: function (notifyChange) {\n        // This function is really just part of the evaluateImmediate logic. You would never call it from anywhere else.\n        // Factoring it out into a separate function means it can be independent of the try/catch block in evaluateImmediate,\n        // which contributes to saving about 40% off the CPU overhead of computed evaluation (on V8 at least).\n\n        var computedObservable = this,\n            state = computedObservable[computedState],\n            changed = false;\n\n        // Initially, we assume that none of the subscriptions are still being used (i.e., all are candidates for disposal).\n        // Then, during evaluation, we cross off any that are in fact still being used.\n        var isInitial = state.pure ? undefined : !state.dependenciesCount,   // If we're evaluating when there are no previous dependencies, it must be the first time\n            dependencyDetectionContext = {\n                computedObservable: computedObservable,\n                disposalCandidates: state.dependencyTracking,\n                disposalCount: state.dependenciesCount\n            };\n\n        ko.dependencyDetection.begin({\n            callbackTarget: dependencyDetectionContext,\n            callback: computedBeginDependencyDetectionCallback,\n            computed: computedObservable,\n            isInitial: isInitial\n        });\n\n        state.dependencyTracking = {};\n        state.dependenciesCount = 0;\n\n        var newValue = this.evaluateImmediate_CallReadThenEndDependencyDetection(state, dependencyDetectionContext);\n\n        if (!state.dependenciesCount) {\n            computedObservable.dispose();\n            changed = true; // When evaluation causes a disposal, make sure all dependent computeds get notified so they'll see the new state\n        } else {\n            changed = computedObservable.isDifferent(state.latestValue, newValue);\n        }\n\n        if (changed) {\n            if (!state.isSleeping) {\n                computedObservable[\"notifySubscribers\"](state.latestValue, \"beforeChange\");\n            } else {\n                computedObservable.updateVersion();\n            }\n\n            state.latestValue = newValue;\n            if (DEBUG) computedObservable._latestValue = newValue;\n\n            computedObservable[\"notifySubscribers\"](state.latestValue, \"spectate\");\n\n            if (!state.isSleeping && notifyChange) {\n                computedObservable[\"notifySubscribers\"](state.latestValue);\n            }\n            if (computedObservable._recordUpdate) {\n                computedObservable._recordUpdate();\n            }\n        }\n\n        if (isInitial) {\n            computedObservable[\"notifySubscribers\"](state.latestValue, \"awake\");\n        }\n\n        return changed;\n    },\n    evaluateImmediate_CallReadThenEndDependencyDetection: function (state, dependencyDetectionContext) {\n        // This function is really part of the evaluateImmediate_CallReadWithDependencyDetection logic.\n        // You'd never call it from anywhere else. Factoring it out means that evaluateImmediate_CallReadWithDependencyDetection\n        // can be independent of try/finally blocks, which contributes to saving about 40% off the CPU\n        // overhead of computed evaluation (on V8 at least).\n\n        try {\n            var readFunction = state.readFunction;\n            return state.evaluatorFunctionTarget ? readFunction.call(state.evaluatorFunctionTarget) : readFunction();\n        } finally {\n            ko.dependencyDetection.end();\n\n            // For each subscription no longer being used, remove it from the active subscriptions list and dispose it\n            if (dependencyDetectionContext.disposalCount && !state.isSleeping) {\n                ko.utils.objectForEach(dependencyDetectionContext.disposalCandidates, computedDisposeDependencyCallback);\n            }\n\n            state.isStale = state.isDirty = false;\n        }\n    },\n    peek: function (evaluate) {\n        // By default, peek won't re-evaluate, except while the computed is sleeping or to get the initial value when \"deferEvaluation\" is set.\n        // Pass in true to evaluate if needed.\n        var state = this[computedState];\n        if ((state.isDirty && (evaluate || !state.dependenciesCount)) || (state.isSleeping && this.haveDependenciesChanged())) {\n            this.evaluateImmediate();\n        }\n        return state.latestValue;\n    },\n    limit: function (limitFunction) {\n        // Override the limit function with one that delays evaluation as well\n        ko.subscribable['fn'].limit.call(this, limitFunction);\n        this._evalIfChanged = function () {\n            if (!this[computedState].isSleeping) {\n                if (this[computedState].isStale) {\n                    this.evaluateImmediate();\n                } else {\n                    this[computedState].isDirty = false;\n                }\n            }\n            return this[computedState].latestValue;\n        };\n        this._evalDelayed = function (isChange) {\n            this._limitBeforeChange(this[computedState].latestValue);\n\n            // Mark as dirty\n            this[computedState].isDirty = true;\n            if (isChange) {\n                this[computedState].isStale = true;\n            }\n\n            // Pass the observable to the \"limit\" code, which will evaluate it when\n            // it's time to do the notification.\n            this._limitChange(this, !isChange /* isDirty */);\n        };\n    },\n    dispose: function () {\n        var state = this[computedState];\n        if (!state.isSleeping && state.dependencyTracking) {\n            ko.utils.objectForEach(state.dependencyTracking, function (id, dependency) {\n                if (dependency.dispose)\n                    dependency.dispose();\n            });\n        }\n        if (state.disposeWhenNodeIsRemoved && state.domNodeDisposalCallback) {\n            ko.utils.domNodeDisposal.removeDisposeCallback(state.disposeWhenNodeIsRemoved, state.domNodeDisposalCallback);\n        }\n        state.dependencyTracking = undefined;\n        state.dependenciesCount = 0;\n        state.isDisposed = true;\n        state.isStale = false;\n        state.isDirty = false;\n        state.isSleeping = false;\n        state.disposeWhenNodeIsRemoved = undefined;\n        state.disposeWhen = undefined;\n        state.readFunction = undefined;\n        if (!this.hasWriteFunction) {\n            state.evaluatorFunctionTarget = undefined;\n        }\n    }\n};\n\nvar pureComputedOverrides = {\n    beforeSubscriptionAdd: function (event) {\n        // If asleep, wake up the computed by subscribing to any dependencies.\n        var computedObservable = this,\n            state = computedObservable[computedState];\n        if (!state.isDisposed && state.isSleeping && event == 'change') {\n            state.isSleeping = false;\n            if (state.isStale || computedObservable.haveDependenciesChanged()) {\n                state.dependencyTracking = null;\n                state.dependenciesCount = 0;\n                if (computedObservable.evaluateImmediate()) {\n                    computedObservable.updateVersion();\n                }\n            } else {\n                // First put the dependencies in order\n                var dependenciesOrder = [];\n                ko.utils.objectForEach(state.dependencyTracking, function (id, dependency) {\n                    dependenciesOrder[dependency._order] = id;\n                });\n                // Next, subscribe to each one\n                ko.utils.arrayForEach(dependenciesOrder, function (id, order) {\n                    var dependency = state.dependencyTracking[id],\n                        subscription = computedObservable.subscribeToDependency(dependency._target);\n                    subscription._order = order;\n                    subscription._version = dependency._version;\n                    state.dependencyTracking[id] = subscription;\n                });\n                // Waking dependencies may have triggered effects\n                if (computedObservable.haveDependenciesChanged()) {\n                    if (computedObservable.evaluateImmediate()) {\n                        computedObservable.updateVersion();\n                    }\n                }\n            }\n\n            if (!state.isDisposed) {     // test since evaluating could trigger disposal\n                computedObservable[\"notifySubscribers\"](state.latestValue, \"awake\");\n            }\n        }\n    },\n    afterSubscriptionRemove: function (event) {\n        var state = this[computedState];\n        if (!state.isDisposed && event == 'change' && !this.hasSubscriptionsForEvent('change')) {\n            ko.utils.objectForEach(state.dependencyTracking, function (id, dependency) {\n                if (dependency.dispose) {\n                    state.dependencyTracking[id] = {\n                        _target: dependency._target,\n                        _order: dependency._order,\n                        _version: dependency._version\n                    };\n                    dependency.dispose();\n                }\n            });\n            state.isSleeping = true;\n            this[\"notifySubscribers\"](undefined, \"asleep\");\n        }\n    },\n    getVersion: function () {\n        // Because a pure computed is not automatically updated while it is sleeping, we can't\n        // simply return the version number. Instead, we check if any of the dependencies have\n        // changed and conditionally re-evaluate the computed observable.\n        var state = this[computedState];\n        if (state.isSleeping && (state.isStale || this.haveDependenciesChanged())) {\n            this.evaluateImmediate();\n        }\n        return ko.subscribable['fn'].getVersion.call(this);\n    }\n};\n\nvar deferEvaluationOverrides = {\n    beforeSubscriptionAdd: function (event) {\n        // This will force a computed with deferEvaluation to evaluate when the first subscription is registered.\n        if (event == 'change' || event == 'beforeChange') {\n            this.peek();\n        }\n    }\n};\n\n// Note that for browsers that don't support proto assignment, the\n// inheritance chain is created manually in the ko.computed constructor\nif (ko.utils.canSetPrototype) {\n    ko.utils.setPrototypeOf(computedFn, ko.subscribable['fn']);\n}\n\n// Set the proto values for ko.computed\nvar protoProp = ko.observable.protoProperty; // == \"__ko_proto__\"\ncomputedFn[protoProp] = ko.computed;\n\nko.isComputed = function (instance) {\n    return (typeof instance == 'function' && instance[protoProp] === computedFn[protoProp]);\n};\n\nko.isPureComputed = function (instance) {\n    return ko.isComputed(instance) && instance[computedState] && instance[computedState].pure;\n};\n\nko.exportSymbol('computed', ko.computed);\nko.exportSymbol('dependentObservable', ko.computed);    // export ko.dependentObservable for backwards compatibility (1.x)\nko.exportSymbol('isComputed', ko.isComputed);\nko.exportSymbol('isPureComputed', ko.isPureComputed);\nko.exportSymbol('computed.fn', computedFn);\nko.exportProperty(computedFn, 'peek', computedFn.peek);\nko.exportProperty(computedFn, 'dispose', computedFn.dispose);\nko.exportProperty(computedFn, 'isActive', computedFn.isActive);\nko.exportProperty(computedFn, 'getDependenciesCount', computedFn.getDependenciesCount);\nko.exportProperty(computedFn, 'getDependencies', computedFn.getDependencies);\n\nko.pureComputed = function (evaluatorFunctionOrOptions, evaluatorFunctionTarget) {\n    if (typeof evaluatorFunctionOrOptions === 'function') {\n        return ko.computed(evaluatorFunctionOrOptions, evaluatorFunctionTarget, {'pure':true});\n    } else {\n        evaluatorFunctionOrOptions = ko.utils.extend({}, evaluatorFunctionOrOptions);   // make a copy of the parameter object\n        evaluatorFunctionOrOptions['pure'] = true;\n        return ko.computed(evaluatorFunctionOrOptions, evaluatorFunctionTarget);\n    }\n}\nko.exportSymbol('pureComputed', ko.pureComputed);\n\n(function() {\n    var maxNestedObservableDepth = 10; // Escape the (unlikely) pathological case where an observable's current value is itself (or similar reference cycle)\n\n    ko.toJS = function(rootObject) {\n        if (arguments.length == 0)\n            throw new Error(\"When calling ko.toJS, pass the object you want to convert.\");\n\n        // We just unwrap everything at every level in the object graph\n        return mapJsObjectGraph(rootObject, function(valueToMap) {\n            // Loop because an observable's value might in turn be another observable wrapper\n            for (var i = 0; ko.isObservable(valueToMap) && (i < maxNestedObservableDepth); i++)\n                valueToMap = valueToMap();\n            return valueToMap;\n        });\n    };\n\n    ko.toJSON = function(rootObject, replacer, space) {     // replacer and space are optional\n        var plainJavaScriptObject = ko.toJS(rootObject);\n        return ko.utils.stringifyJson(plainJavaScriptObject, replacer, space);\n    };\n\n    function mapJsObjectGraph(rootObject, mapInputCallback, visitedObjects) {\n        visitedObjects = visitedObjects || new objectLookup();\n\n        rootObject = mapInputCallback(rootObject);\n        var canHaveProperties = (typeof rootObject == \"object\") && (rootObject !== null) && (rootObject !== undefined) && (!(rootObject instanceof RegExp)) && (!(rootObject instanceof Date)) && (!(rootObject instanceof String)) && (!(rootObject instanceof Number)) && (!(rootObject instanceof Boolean));\n        if (!canHaveProperties)\n            return rootObject;\n\n        var outputProperties = rootObject instanceof Array ? [] : {};\n        visitedObjects.save(rootObject, outputProperties);\n\n        visitPropertiesOrArrayEntries(rootObject, function(indexer) {\n            var propertyValue = mapInputCallback(rootObject[indexer]);\n\n            switch (typeof propertyValue) {\n                case \"boolean\":\n                case \"number\":\n                case \"string\":\n                case \"function\":\n                    outputProperties[indexer] = propertyValue;\n                    break;\n                case \"object\":\n                case \"undefined\":\n                    var previouslyMappedValue = visitedObjects.get(propertyValue);\n                    outputProperties[indexer] = (previouslyMappedValue !== undefined)\n                        ? previouslyMappedValue\n                        : mapJsObjectGraph(propertyValue, mapInputCallback, visitedObjects);\n                    break;\n            }\n        });\n\n        return outputProperties;\n    }\n\n    function visitPropertiesOrArrayEntries(rootObject, visitorCallback) {\n        if (rootObject instanceof Array) {\n            for (var i = 0; i < rootObject.length; i++)\n                visitorCallback(i);\n\n            // For arrays, also respect toJSON property for custom mappings (fixes #278)\n            if (typeof rootObject['toJSON'] == 'function')\n                visitorCallback('toJSON');\n        } else {\n            for (var propertyName in rootObject) {\n                visitorCallback(propertyName);\n            }\n        }\n    };\n\n    function objectLookup() {\n        this.keys = [];\n        this.values = [];\n    };\n\n    objectLookup.prototype = {\n        constructor: objectLookup,\n        save: function(key, value) {\n            var existingIndex = ko.utils.arrayIndexOf(this.keys, key);\n            if (existingIndex >= 0)\n                this.values[existingIndex] = value;\n            else {\n                this.keys.push(key);\n                this.values.push(value);\n            }\n        },\n        get: function(key) {\n            var existingIndex = ko.utils.arrayIndexOf(this.keys, key);\n            return (existingIndex >= 0) ? this.values[existingIndex] : undefined;\n        }\n    };\n})();\n\nko.exportSymbol('toJS', ko.toJS);\nko.exportSymbol('toJSON', ko.toJSON);\nko.when = function(predicate, callback, context) {\n    function kowhen (resolve) {\n        var observable = ko.pureComputed(predicate, context).extend({notify:'always'});\n        var subscription = observable.subscribe(function(value) {\n            if (value) {\n                subscription.dispose();\n                resolve(value);\n            }\n        });\n        // In case the initial value is true, process it right away\n        observable['notifySubscribers'](observable.peek());\n\n        return subscription;\n    }\n    if (typeof Promise === \"function\" && !callback) {\n        return new Promise(kowhen);\n    } else {\n        return kowhen(callback.bind(context));\n    }\n};\n\nko.exportSymbol('when', ko.when);\n(function () {\n    var hasDomDataExpandoProperty = '__ko__hasDomDataOptionValue__';\n\n    // Normally, SELECT elements and their OPTIONs can only take value of type 'string' (because the values\n    // are stored on DOM attributes). ko.selectExtensions provides a way for SELECTs/OPTIONs to have values\n    // that are arbitrary objects. This is very convenient when implementing things like cascading dropdowns.\n    ko.selectExtensions = {\n        readValue : function(element) {\n            switch (ko.utils.tagNameLower(element)) {\n                case 'option':\n                    if (element[hasDomDataExpandoProperty] === true)\n                        return ko.utils.domData.get(element, ko.bindingHandlers.options.optionValueDomDataKey);\n                    return ko.utils.ieVersion <= 7\n                        ? (element.getAttributeNode('value') && element.getAttributeNode('value').specified ? element.value : element.text)\n                        : element.value;\n                case 'select':\n                    return element.selectedIndex >= 0 ? ko.selectExtensions.readValue(element.options[element.selectedIndex]) : undefined;\n                default:\n                    return element.value;\n            }\n        },\n\n        writeValue: function(element, value, allowUnset) {\n            switch (ko.utils.tagNameLower(element)) {\n                case 'option':\n                    if (typeof value === \"string\") {\n                        ko.utils.domData.set(element, ko.bindingHandlers.options.optionValueDomDataKey, undefined);\n                        if (hasDomDataExpandoProperty in element) { // IE <= 8 throws errors if you delete non-existent properties from a DOM node\n                            delete element[hasDomDataExpandoProperty];\n                        }\n                        element.value = value;\n                    }\n                    else {\n                        // Store arbitrary object using DomData\n                        ko.utils.domData.set(element, ko.bindingHandlers.options.optionValueDomDataKey, value);\n                        element[hasDomDataExpandoProperty] = true;\n\n                        // Special treatment of numbers is just for backward compatibility. KO 1.2.1 wrote numerical values to element.value.\n                        element.value = typeof value === \"number\" ? value : \"\";\n                    }\n                    break;\n                case 'select':\n                    if (value === \"\" || value === null)       // A blank string or null value will select the caption\n                        value = undefined;\n                    var selection = -1;\n                    for (var i = 0, n = element.options.length, optionValue; i < n; ++i) {\n                        optionValue = ko.selectExtensions.readValue(element.options[i]);\n                        // Include special check to handle selecting a caption with a blank string value\n                        if (optionValue == value || (optionValue === \"\" && value === undefined)) {\n                            selection = i;\n                            break;\n                        }\n                    }\n                    if (allowUnset || selection >= 0 || (value === undefined && element.size > 1)) {\n                        element.selectedIndex = selection;\n                        if (ko.utils.ieVersion === 6) {\n                            // Workaround for IE6 bug: It won't reliably apply values to SELECT nodes during the same execution thread\n                            // right after you've changed the set of OPTION nodes on it. So for that node type, we'll schedule a second thread\n                            // to apply the value as well.\n                            ko.utils.setTimeout(function () {\n                                element.selectedIndex = selection;\n                            }, 0);\n                        }\n                    }\n                    break;\n                default:\n                    if ((value === null) || (value === undefined))\n                        value = \"\";\n                    element.value = value;\n                    break;\n            }\n        }\n    };\n})();\n\nko.exportSymbol('selectExtensions', ko.selectExtensions);\nko.exportSymbol('selectExtensions.readValue', ko.selectExtensions.readValue);\nko.exportSymbol('selectExtensions.writeValue', ko.selectExtensions.writeValue);\nko.expressionRewriting = (function () {\n    var javaScriptReservedWords = [\"true\", \"false\", \"null\", \"undefined\"];\n\n    // Matches something that can be assigned to--either an isolated identifier or something ending with a property accessor\n    // This is designed to be simple and avoid false negatives, but could produce false positives (e.g., a+b.c).\n    // This also will not properly handle nested brackets (e.g., obj1[obj2['prop']]; see #911).\n    var javaScriptAssignmentTarget = /^(?:[$_a-z][$\\w]*|(.+)(\\.\\s*[$_a-z][$\\w]*|\\[.+\\]))$/i;\n\n    function getWriteableValue(expression) {\n        if (ko.utils.arrayIndexOf(javaScriptReservedWords, expression) >= 0)\n            return false;\n        var match = expression.match(javaScriptAssignmentTarget);\n        return match === null ? false : match[1] ? ('Object(' + match[1] + ')' + match[2]) : expression;\n    }\n\n    // The following regular expressions will be used to split an object-literal string into tokens\n\n    var specials = ',\"\\'`{}()/:[\\\\]',    // These characters have special meaning to the parser and must not appear in the middle of a token, except as part of a string.\n        // Create the actual regular expression by or-ing the following regex strings. The order is important.\n        bindingToken = RegExp([\n            // These match strings, either with double quotes, single quotes, or backticks\n            '\"(?:\\\\\\\\.|[^\"])*\"',\n            \"'(?:\\\\\\\\.|[^'])*'\",\n            \"`(?:\\\\\\\\.|[^`])*`\",\n            // Match C style comments\n            \"/\\\\*(?:[^*]|\\\\*+[^*/])*\\\\*+/\",\n            // Match C++ style comments\n            \"//.*\\n\",\n            // Match a regular expression (text enclosed by slashes), but will also match sets of divisions\n            // as a regular expression (this is handled by the parsing loop below).\n            '/(?:\\\\\\\\.|[^/])+/\\w*',\n            // Match text (at least two characters) that does not contain any of the above special characters,\n            // although some of the special characters are allowed to start it (all but the colon and comma).\n            // The text can contain spaces, but leading or trailing spaces are skipped.\n            '[^\\\\s:,/][^' + specials + ']*[^\\\\s' + specials + ']',\n            // Match any non-space character not matched already. This will match colons and commas, since they're\n            // not matched by \"everyThingElse\", but will also match any other single character that wasn't already\n            // matched (for example: in \"a: 1, b: 2\", each of the non-space characters will be matched by oneNotSpace).\n            '[^\\\\s]'\n        ].join('|'), 'g'),\n\n        // Match end of previous token to determine whether a slash is a division or regex.\n        divisionLookBehind = /[\\])\"'A-Za-z0-9_$]+$/,\n        keywordRegexLookBehind = {'in':1,'return':1,'typeof':1};\n\n    function parseObjectLiteral(objectLiteralString) {\n        // Trim leading and trailing spaces from the string\n        var str = ko.utils.stringTrim(objectLiteralString);\n\n        // Trim braces '{' surrounding the whole object literal\n        if (str.charCodeAt(0) === 123) str = str.slice(1, -1);\n\n        // Add a newline to correctly match a C++ style comment at the end of the string and\n        // add a comma so that we don't need a separate code block to deal with the last item\n        str += \"\\n,\";\n\n        // Split into tokens\n        var result = [], toks = str.match(bindingToken), key, values = [], depth = 0;\n\n        if (toks.length > 1) {\n            for (var i = 0, tok; tok = toks[i]; ++i) {\n                var c = tok.charCodeAt(0);\n                // A comma signals the end of a key/value pair if depth is zero\n                if (c === 44) { // \",\"\n                    if (depth <= 0) {\n                        result.push((key && values.length) ? {key: key, value: values.join('')} : {'unknown': key || values.join('')});\n                        key = depth = 0;\n                        values = [];\n                        continue;\n                    }\n                // Simply skip the colon that separates the name and value\n                } else if (c === 58) { // \":\"\n                    if (!depth && !key && values.length === 1) {\n                        key = values.pop();\n                        continue;\n                    }\n                // Comments: skip them\n                } else if (c === 47 && tok.length > 1 && (tok.charCodeAt(1) === 47 || tok.charCodeAt(1) === 42)) {  // \"//\" or \"/*\"\n                    continue;\n                // A set of slashes is initially matched as a regular expression, but could be division\n                } else if (c === 47 && i && tok.length > 1) {  // \"/\"\n                    // Look at the end of the previous token to determine if the slash is actually division\n                    var match = toks[i-1].match(divisionLookBehind);\n                    if (match && !keywordRegexLookBehind[match[0]]) {\n                        // The slash is actually a division punctuator; re-parse the remainder of the string (not including the slash)\n                        str = str.substr(str.indexOf(tok) + 1);\n                        toks = str.match(bindingToken);\n                        i = -1;\n                        // Continue with just the slash\n                        tok = '/';\n                    }\n                // Increment depth for parentheses, braces, and brackets so that interior commas are ignored\n                } else if (c === 40 || c === 123 || c === 91) { // '(', '{', '['\n                    ++depth;\n                } else if (c === 41 || c === 125 || c === 93) { // ')', '}', ']'\n                    --depth;\n                // The key will be the first token; if it's a string, trim the quotes\n                } else if (!key && !values.length && (c === 34 || c === 39)) { // '\"', \"'\"\n                    tok = tok.slice(1, -1);\n                }\n                values.push(tok);\n            }\n            if (depth > 0) {\n                throw Error(\"Unbalanced parentheses, braces, or brackets\");\n            }\n        }\n        return result;\n    }\n\n    // Two-way bindings include a write function that allow the handler to update the value even if it's not an observable.\n    var twoWayBindings = {};\n\n    function preProcessBindings(bindingsStringOrKeyValueArray, bindingOptions) {\n        bindingOptions = bindingOptions || {};\n\n        function processKeyValue(key, val) {\n            var writableVal;\n            function callPreprocessHook(obj) {\n                return (obj && obj['preprocess']) ? (val = obj['preprocess'](val, key, processKeyValue)) : true;\n            }\n            if (!bindingParams) {\n                if (!callPreprocessHook(ko['getBindingHandler'](key)))\n                    return;\n\n                if (twoWayBindings[key] && (writableVal = getWriteableValue(val))) {\n                    // For two-way bindings, provide a write method in case the value\n                    // isn't a writable observable.\n                    var writeKey = typeof twoWayBindings[key] == 'string' ? twoWayBindings[key] : key;\n                    propertyAccessorResultStrings.push(\"'\" + writeKey + \"':function(_z){\" + writableVal + \"=_z}\");\n                }\n            }\n            // Values are wrapped in a function so that each value can be accessed independently\n            if (makeValueAccessors) {\n                val = 'function(){return ' + val + ' }';\n            }\n            resultStrings.push(\"'\" + key + \"':\" + val);\n        }\n\n        var resultStrings = [],\n            propertyAccessorResultStrings = [],\n            makeValueAccessors = bindingOptions['valueAccessors'],\n            bindingParams = bindingOptions['bindingParams'],\n            keyValueArray = typeof bindingsStringOrKeyValueArray === \"string\" ?\n                parseObjectLiteral(bindingsStringOrKeyValueArray) : bindingsStringOrKeyValueArray;\n\n        ko.utils.arrayForEach(keyValueArray, function(keyValue) {\n            processKeyValue(keyValue.key || keyValue['unknown'], keyValue.value);\n        });\n\n        if (propertyAccessorResultStrings.length)\n            processKeyValue('_ko_property_writers', \"{\" + propertyAccessorResultStrings.join(\",\") + \" }\");\n\n        return resultStrings.join(\",\");\n    }\n\n    return {\n        bindingRewriteValidators: [],\n\n        twoWayBindings: twoWayBindings,\n\n        parseObjectLiteral: parseObjectLiteral,\n\n        preProcessBindings: preProcessBindings,\n\n        keyValueArrayContainsKey: function(keyValueArray, key) {\n            for (var i = 0; i < keyValueArray.length; i++)\n                if (keyValueArray[i]['key'] == key)\n                    return true;\n            return false;\n        },\n\n        // Internal, private KO utility for updating model properties from within bindings\n        // property:            If the property being updated is (or might be) an observable, pass it here\n        //                      If it turns out to be a writable observable, it will be written to directly\n        // allBindings:         An object with a get method to retrieve bindings in the current execution context.\n        //                      This will be searched for a '_ko_property_writers' property in case you're writing to a non-observable\n        // key:                 The key identifying the property to be written. Example: for { hasFocus: myValue }, write to 'myValue' by specifying the key 'hasFocus'\n        // value:               The value to be written\n        // checkIfDifferent:    If true, and if the property being written is a writable observable, the value will only be written if\n        //                      it is !== existing value on that writable observable\n        writeValueToProperty: function(property, allBindings, key, value, checkIfDifferent) {\n            if (!property || !ko.isObservable(property)) {\n                var propWriters = allBindings.get('_ko_property_writers');\n                if (propWriters && propWriters[key])\n                    propWriters[key](value);\n            } else if (ko.isWriteableObservable(property) && (!checkIfDifferent || property.peek() !== value)) {\n                property(value);\n            }\n        }\n    };\n})();\n\nko.exportSymbol('expressionRewriting', ko.expressionRewriting);\nko.exportSymbol('expressionRewriting.bindingRewriteValidators', ko.expressionRewriting.bindingRewriteValidators);\nko.exportSymbol('expressionRewriting.parseObjectLiteral', ko.expressionRewriting.parseObjectLiteral);\nko.exportSymbol('expressionRewriting.preProcessBindings', ko.expressionRewriting.preProcessBindings);\n\n// Making bindings explicitly declare themselves as \"two way\" isn't ideal in the long term (it would be better if\n// all bindings could use an official 'property writer' API without needing to declare that they might). However,\n// since this is not, and has never been, a public API (_ko_property_writers was never documented), it's acceptable\n// as an internal implementation detail in the short term.\n// For those developers who rely on _ko_property_writers in their custom bindings, we expose _twoWayBindings as an\n// undocumented feature that makes it relatively easy to upgrade to KO 3.0. However, this is still not an official\n// public API, and we reserve the right to remove it at any time if we create a real public property writers API.\nko.exportSymbol('expressionRewriting._twoWayBindings', ko.expressionRewriting.twoWayBindings);\n\n// For backward compatibility, define the following aliases. (Previously, these function names were misleading because\n// they referred to JSON specifically, even though they actually work with arbitrary JavaScript object literal expressions.)\nko.exportSymbol('jsonExpressionRewriting', ko.expressionRewriting);\nko.exportSymbol('jsonExpressionRewriting.insertPropertyAccessorsIntoJson', ko.expressionRewriting.preProcessBindings);\n(function() {\n    // \"Virtual elements\" is an abstraction on top of the usual DOM API which understands the notion that comment nodes\n    // may be used to represent hierarchy (in addition to the DOM's natural hierarchy).\n    // If you call the DOM-manipulating functions on ko.virtualElements, you will be able to read and write the state\n    // of that virtual hierarchy\n    //\n    // The point of all this is to support containerless templates (e.g., <!-- ko foreach:someCollection -->blah<!-- /ko -->)\n    // without having to scatter special cases all over the binding and templating code.\n\n    // IE 9 cannot reliably read the \"nodeValue\" property of a comment node (see https://github.com/SteveSanderson/knockout/issues/186)\n    // but it does give them a nonstandard alternative property called \"text\" that it can read reliably. Other browsers don't have that property.\n    // So, use node.text where available, and node.nodeValue elsewhere\n    var commentNodesHaveTextProperty = document && document.createComment(\"test\").text === \"<!--test-->\";\n\n    var startCommentRegex = commentNodesHaveTextProperty ? /^<!--\\s*ko(?:\\s+([\\s\\S]+))?\\s*-->$/ : /^\\s*ko(?:\\s+([\\s\\S]+))?\\s*$/;\n    var endCommentRegex =   commentNodesHaveTextProperty ? /^<!--\\s*\\/ko\\s*-->$/ : /^\\s*\\/ko\\s*$/;\n    var htmlTagsWithOptionallyClosingChildren = { 'ul': true, 'ol': true };\n\n    function isStartComment(node) {\n        return (node.nodeType == 8) && startCommentRegex.test(commentNodesHaveTextProperty ? node.text : node.nodeValue);\n    }\n\n    function isEndComment(node) {\n        return (node.nodeType == 8) && endCommentRegex.test(commentNodesHaveTextProperty ? node.text : node.nodeValue);\n    }\n\n    function isUnmatchedEndComment(node) {\n        return isEndComment(node) && !(ko.utils.domData.get(node, matchedEndCommentDataKey));\n    }\n\n    var matchedEndCommentDataKey = \"__ko_matchedEndComment__\"\n\n    function getVirtualChildren(startComment, allowUnbalanced) {\n        var currentNode = startComment;\n        var depth = 1;\n        var children = [];\n        while (currentNode = currentNode.nextSibling) {\n            if (isEndComment(currentNode)) {\n                ko.utils.domData.set(currentNode, matchedEndCommentDataKey, true);\n                depth--;\n                if (depth === 0)\n                    return children;\n            }\n\n            children.push(currentNode);\n\n            if (isStartComment(currentNode))\n                depth++;\n        }\n        if (!allowUnbalanced)\n            throw new Error(\"Cannot find closing comment tag to match: \" + startComment.nodeValue);\n        return null;\n    }\n\n    function getMatchingEndComment(startComment, allowUnbalanced) {\n        var allVirtualChildren = getVirtualChildren(startComment, allowUnbalanced);\n        if (allVirtualChildren) {\n            if (allVirtualChildren.length > 0)\n                return allVirtualChildren[allVirtualChildren.length - 1].nextSibling;\n            return startComment.nextSibling;\n        } else\n            return null; // Must have no matching end comment, and allowUnbalanced is true\n    }\n\n    function getUnbalancedChildTags(node) {\n        // e.g., from <div>OK</div><!-- ko blah --><span>Another</span>, returns: <!-- ko blah --><span>Another</span>\n        //       from <div>OK</div><!-- /ko --><!-- /ko -->,             returns: <!-- /ko --><!-- /ko -->\n        var childNode = node.firstChild, captureRemaining = null;\n        if (childNode) {\n            do {\n                if (captureRemaining)                   // We already hit an unbalanced node and are now just scooping up all subsequent nodes\n                    captureRemaining.push(childNode);\n                else if (isStartComment(childNode)) {\n                    var matchingEndComment = getMatchingEndComment(childNode, /* allowUnbalanced: */ true);\n                    if (matchingEndComment)             // It's a balanced tag, so skip immediately to the end of this virtual set\n                        childNode = matchingEndComment;\n                    else\n                        captureRemaining = [childNode]; // It's unbalanced, so start capturing from this point\n                } else if (isEndComment(childNode)) {\n                    captureRemaining = [childNode];     // It's unbalanced (if it wasn't, we'd have skipped over it already), so start capturing\n                }\n            } while (childNode = childNode.nextSibling);\n        }\n        return captureRemaining;\n    }\n\n    ko.virtualElements = {\n        allowedBindings: {},\n\n        childNodes: function(node) {\n            return isStartComment(node) ? getVirtualChildren(node) : node.childNodes;\n        },\n\n        emptyNode: function(node) {\n            if (!isStartComment(node))\n                ko.utils.emptyDomNode(node);\n            else {\n                var virtualChildren = ko.virtualElements.childNodes(node);\n                for (var i = 0, j = virtualChildren.length; i < j; i++)\n                    ko.removeNode(virtualChildren[i]);\n            }\n        },\n\n        setDomNodeChildren: function(node, childNodes) {\n            if (!isStartComment(node))\n                ko.utils.setDomNodeChildren(node, childNodes);\n            else {\n                ko.virtualElements.emptyNode(node);\n                var endCommentNode = node.nextSibling; // Must be the next sibling, as we just emptied the children\n                for (var i = 0, j = childNodes.length; i < j; i++)\n                    endCommentNode.parentNode.insertBefore(childNodes[i], endCommentNode);\n            }\n        },\n\n        prepend: function(containerNode, nodeToPrepend) {\n            if (!isStartComment(containerNode)) {\n                if (containerNode.firstChild)\n                    containerNode.insertBefore(nodeToPrepend, containerNode.firstChild);\n                else\n                    containerNode.appendChild(nodeToPrepend);\n            } else {\n                // Start comments must always have a parent and at least one following sibling (the end comment)\n                containerNode.parentNode.insertBefore(nodeToPrepend, containerNode.nextSibling);\n            }\n        },\n\n        insertAfter: function(containerNode, nodeToInsert, insertAfterNode) {\n            if (!insertAfterNode) {\n                ko.virtualElements.prepend(containerNode, nodeToInsert);\n            } else if (!isStartComment(containerNode)) {\n                // Insert after insertion point\n                if (insertAfterNode.nextSibling)\n                    containerNode.insertBefore(nodeToInsert, insertAfterNode.nextSibling);\n                else\n                    containerNode.appendChild(nodeToInsert);\n            } else {\n                // Children of start comments must always have a parent and at least one following sibling (the end comment)\n                containerNode.parentNode.insertBefore(nodeToInsert, insertAfterNode.nextSibling);\n            }\n        },\n\n        firstChild: function(node) {\n            if (!isStartComment(node)) {\n                if (node.firstChild && isEndComment(node.firstChild)) {\n                    throw new Error(\"Found invalid end comment, as the first child of \" + node);\n                }\n                return node.firstChild;\n            } else if (!node.nextSibling || isEndComment(node.nextSibling)) {\n                return null;\n            } else {\n                return node.nextSibling;\n            }\n        },\n\n        nextSibling: function(node) {\n            if (isStartComment(node)) {\n                node = getMatchingEndComment(node);\n            }\n\n            if (node.nextSibling && isEndComment(node.nextSibling)) {\n                if (isUnmatchedEndComment(node.nextSibling)) {\n                    throw Error(\"Found end comment without a matching opening comment, as child of \" + node);\n                } else {\n                    return null;\n                }\n            } else {\n                return node.nextSibling;\n            }\n        },\n\n        hasBindingValue: isStartComment,\n\n        virtualNodeBindingValue: function(node) {\n            var regexMatch = (commentNodesHaveTextProperty ? node.text : node.nodeValue).match(startCommentRegex);\n            return regexMatch ? regexMatch[1] : null;\n        },\n\n        normaliseVirtualElementDomStructure: function(elementVerified) {\n            // Workaround for https://github.com/SteveSanderson/knockout/issues/155\n            // (IE <= 8 or IE 9 quirks mode parses your HTML weirdly, treating closing </li> tags as if they don't exist, thereby moving comment nodes\n            // that are direct descendants of <ul> into the preceding <li>)\n            if (!htmlTagsWithOptionallyClosingChildren[ko.utils.tagNameLower(elementVerified)])\n                return;\n\n            // Scan immediate children to see if they contain unbalanced comment tags. If they do, those comment tags\n            // must be intended to appear *after* that child, so move them there.\n            var childNode = elementVerified.firstChild;\n            if (childNode) {\n                do {\n                    if (childNode.nodeType === 1) {\n                        var unbalancedTags = getUnbalancedChildTags(childNode);\n                        if (unbalancedTags) {\n                            // Fix up the DOM by moving the unbalanced tags to where they most likely were intended to be placed - *after* the child\n                            var nodeToInsertBefore = childNode.nextSibling;\n                            for (var i = 0; i < unbalancedTags.length; i++) {\n                                if (nodeToInsertBefore)\n                                    elementVerified.insertBefore(unbalancedTags[i], nodeToInsertBefore);\n                                else\n                                    elementVerified.appendChild(unbalancedTags[i]);\n                            }\n                        }\n                    }\n                } while (childNode = childNode.nextSibling);\n            }\n        }\n    };\n})();\nko.exportSymbol('virtualElements', ko.virtualElements);\nko.exportSymbol('virtualElements.allowedBindings', ko.virtualElements.allowedBindings);\nko.exportSymbol('virtualElements.emptyNode', ko.virtualElements.emptyNode);\n//ko.exportSymbol('virtualElements.firstChild', ko.virtualElements.firstChild);     // firstChild is not minified\nko.exportSymbol('virtualElements.insertAfter', ko.virtualElements.insertAfter);\n//ko.exportSymbol('virtualElements.nextSibling', ko.virtualElements.nextSibling);   // nextSibling is not minified\nko.exportSymbol('virtualElements.prepend', ko.virtualElements.prepend);\nko.exportSymbol('virtualElements.setDomNodeChildren', ko.virtualElements.setDomNodeChildren);\n(function() {\n    var defaultBindingAttributeName = \"data-bind\";\n\n    ko.bindingProvider = function() {\n        this.bindingCache = {};\n    };\n\n    ko.utils.extend(ko.bindingProvider.prototype, {\n        'nodeHasBindings': function(node) {\n            switch (node.nodeType) {\n                case 1: // Element\n                    return node.getAttribute(defaultBindingAttributeName) != null\n                        || ko.components['getComponentNameForNode'](node);\n                case 8: // Comment node\n                    return ko.virtualElements.hasBindingValue(node);\n                default: return false;\n            }\n        },\n\n        'getBindings': function(node, bindingContext) {\n            var bindingsString = this['getBindingsString'](node, bindingContext),\n                parsedBindings = bindingsString ? this['parseBindingsString'](bindingsString, bindingContext, node) : null;\n            return ko.components.addBindingsForCustomElement(parsedBindings, node, bindingContext, /* valueAccessors */ false);\n        },\n\n        'getBindingAccessors': function(node, bindingContext) {\n            var bindingsString = this['getBindingsString'](node, bindingContext),\n                parsedBindings = bindingsString ? this['parseBindingsString'](bindingsString, bindingContext, node, { 'valueAccessors': true }) : null;\n            return ko.components.addBindingsForCustomElement(parsedBindings, node, bindingContext, /* valueAccessors */ true);\n        },\n\n        // The following function is only used internally by this default provider.\n        // It's not part of the interface definition for a general binding provider.\n        'getBindingsString': function(node, bindingContext) {\n            switch (node.nodeType) {\n                case 1: return node.getAttribute(defaultBindingAttributeName);   // Element\n                case 8: return ko.virtualElements.virtualNodeBindingValue(node); // Comment node\n                default: return null;\n            }\n        },\n\n        // The following function is only used internally by this default provider.\n        // It's not part of the interface definition for a general binding provider.\n        'parseBindingsString': function(bindingsString, bindingContext, node, options) {\n            try {\n                var bindingFunction = createBindingsStringEvaluatorViaCache(bindingsString, this.bindingCache, options);\n                return bindingFunction(bindingContext, node);\n            } catch (ex) {\n                ex.message = \"Unable to parse bindings.\\nBindings value: \" + bindingsString + \"\\nMessage: \" + ex.message;\n                throw ex;\n            }\n        }\n    });\n\n    ko.bindingProvider['instance'] = new ko.bindingProvider();\n\n    function createBindingsStringEvaluatorViaCache(bindingsString, cache, options) {\n        var cacheKey = bindingsString + (options && options['valueAccessors'] || '');\n        return cache[cacheKey]\n            || (cache[cacheKey] = createBindingsStringEvaluator(bindingsString, options));\n    }\n\n    function createBindingsStringEvaluator(bindingsString, options) {\n        // Build the source for a function that evaluates \"expression\"\n        // For each scope variable, add an extra level of \"with\" nesting\n        // Example result: with(sc1) { with(sc0) { return (expression) } }\n        var rewrittenBindings = ko.expressionRewriting.preProcessBindings(bindingsString, options),\n            functionBody = \"with($context){with($data||{}){return{\" + rewrittenBindings + \"}}}\";\n        return new Function(\"$context\", \"$element\", functionBody);\n    }\n})();\n\nko.exportSymbol('bindingProvider', ko.bindingProvider);\n(function () {\n    // Hide or don't minify context properties, see https://github.com/knockout/knockout/issues/2294\n    var contextSubscribable = ko.utils.createSymbolOrString('_subscribable');\n    var contextAncestorBindingInfo = ko.utils.createSymbolOrString('_ancestorBindingInfo');\n    var contextDataDependency = ko.utils.createSymbolOrString('_dataDependency');\n\n    ko.bindingHandlers = {};\n\n    // The following element types will not be recursed into during binding.\n    var bindingDoesNotRecurseIntoElementTypes = {\n        // Don't want bindings that operate on text nodes to mutate <script> and <textarea> contents,\n        // because it's unexpected and a potential XSS issue.\n        // Also bindings should not operate on <template> elements since this breaks in Internet Explorer\n        // and because such elements' contents are always intended to be bound in a different context\n        // from where they appear in the document.\n        'script': true,\n        'textarea': true,\n        'template': true\n    };\n\n    // Use an overridable method for retrieving binding handlers so that plugins may support dynamically created handlers\n    ko['getBindingHandler'] = function(bindingKey) {\n        return ko.bindingHandlers[bindingKey];\n    };\n\n    var inheritParentVm = {};\n\n    // The ko.bindingContext constructor is only called directly to create the root context. For child\n    // contexts, use bindingContext.createChildContext or bindingContext.extend.\n    ko.bindingContext = function(dataItemOrAccessor, parentContext, dataItemAlias, extendCallback, options) {\n\n        // The binding context object includes static properties for the current, parent, and root view models.\n        // If a view model is actually stored in an observable, the corresponding binding context object, and\n        // any child contexts, must be updated when the view model is changed.\n        function updateContext() {\n            // Most of the time, the context will directly get a view model object, but if a function is given,\n            // we call the function to retrieve the view model. If the function accesses any observables or returns\n            // an observable, the dependency is tracked, and those observables can later cause the binding\n            // context to be updated.\n            var dataItemOrObservable = isFunc ? realDataItemOrAccessor() : realDataItemOrAccessor,\n                dataItem = ko.utils.unwrapObservable(dataItemOrObservable);\n\n            if (parentContext) {\n                // Copy $root and any custom properties from the parent context\n                ko.utils.extend(self, parentContext);\n\n                // Copy Symbol properties\n                if (contextAncestorBindingInfo in parentContext) {\n                    self[contextAncestorBindingInfo] = parentContext[contextAncestorBindingInfo];\n                }\n            } else {\n                self['$parents'] = [];\n                self['$root'] = dataItem;\n\n                // Export 'ko' in the binding context so it will be available in bindings and templates\n                // even if 'ko' isn't exported as a global, such as when using an AMD loader.\n                // See https://github.com/SteveSanderson/knockout/issues/490\n                self['ko'] = ko;\n            }\n\n            self[contextSubscribable] = subscribable;\n\n            if (shouldInheritData) {\n                dataItem = self['$data'];\n            } else {\n                self['$rawData'] = dataItemOrObservable;\n                self['$data'] = dataItem;\n            }\n\n            if (dataItemAlias)\n                self[dataItemAlias] = dataItem;\n\n            // The extendCallback function is provided when creating a child context or extending a context.\n            // It handles the specific actions needed to finish setting up the binding context. Actions in this\n            // function could also add dependencies to this binding context.\n            if (extendCallback)\n                extendCallback(self, parentContext, dataItem);\n\n            // When a \"parent\" context is given and we don't already have a dependency on its context, register a dependency on it.\n            // Thus whenever the parent context is updated, this context will also be updated.\n            if (parentContext && parentContext[contextSubscribable] && !ko.computedContext.computed().hasAncestorDependency(parentContext[contextSubscribable])) {\n                parentContext[contextSubscribable]();\n            }\n\n            if (dataDependency) {\n                self[contextDataDependency] = dataDependency;\n            }\n\n            return self['$data'];\n        }\n\n        var self = this,\n            shouldInheritData = dataItemOrAccessor === inheritParentVm,\n            realDataItemOrAccessor = shouldInheritData ? undefined : dataItemOrAccessor,\n            isFunc = typeof(realDataItemOrAccessor) == \"function\" && !ko.isObservable(realDataItemOrAccessor),\n            nodes,\n            subscribable,\n            dataDependency = options && options['dataDependency'];\n\n        if (options && options['exportDependencies']) {\n            // The \"exportDependencies\" option means that the calling code will track any dependencies and re-create\n            // the binding context when they change.\n            updateContext();\n        } else {\n            subscribable = ko.pureComputed(updateContext);\n            subscribable.peek();\n\n            // At this point, the binding context has been initialized, and the \"subscribable\" computed observable is\n            // subscribed to any observables that were accessed in the process. If there is nothing to track, the\n            // computed will be inactive, and we can safely throw it away. If it's active, the computed is stored in\n            // the context object.\n            if (subscribable.isActive()) {\n                // Always notify because even if the model ($data) hasn't changed, other context properties might have changed\n                subscribable['equalityComparer'] = null;\n            } else {\n                self[contextSubscribable] = undefined;\n            }\n        }\n    }\n\n    // Extend the binding context hierarchy with a new view model object. If the parent context is watching\n    // any observables, the new child context will automatically get a dependency on the parent context.\n    // But this does not mean that the $data value of the child context will also get updated. If the child\n    // view model also depends on the parent view model, you must provide a function that returns the correct\n    // view model on each update.\n    ko.bindingContext.prototype['createChildContext'] = function (dataItemOrAccessor, dataItemAlias, extendCallback, options) {\n        if (!options && dataItemAlias && typeof dataItemAlias == \"object\") {\n            options = dataItemAlias;\n            dataItemAlias = options['as'];\n            extendCallback = options['extend'];\n        }\n\n        if (dataItemAlias && options && options['noChildContext']) {\n            var isFunc = typeof(dataItemOrAccessor) == \"function\" && !ko.isObservable(dataItemOrAccessor);\n            return new ko.bindingContext(inheritParentVm, this, null, function (self) {\n                if (extendCallback)\n                    extendCallback(self);\n                self[dataItemAlias] = isFunc ? dataItemOrAccessor() : dataItemOrAccessor;\n            }, options);\n        }\n\n        return new ko.bindingContext(dataItemOrAccessor, this, dataItemAlias, function (self, parentContext) {\n            // Extend the context hierarchy by setting the appropriate pointers\n            self['$parentContext'] = parentContext;\n            self['$parent'] = parentContext['$data'];\n            self['$parents'] = (parentContext['$parents'] || []).slice(0);\n            self['$parents'].unshift(self['$parent']);\n            if (extendCallback)\n                extendCallback(self);\n        }, options);\n    };\n\n    // Extend the binding context with new custom properties. This doesn't change the context hierarchy.\n    // Similarly to \"child\" contexts, provide a function here to make sure that the correct values are set\n    // when an observable view model is updated.\n    ko.bindingContext.prototype['extend'] = function(properties, options) {\n        return new ko.bindingContext(inheritParentVm, this, null, function(self, parentContext) {\n            ko.utils.extend(self, typeof(properties) == \"function\" ? properties(self) : properties);\n        }, options);\n    };\n\n    var boundElementDomDataKey = ko.utils.domData.nextKey();\n\n    function asyncContextDispose(node) {\n        var bindingInfo = ko.utils.domData.get(node, boundElementDomDataKey),\n            asyncContext = bindingInfo && bindingInfo.asyncContext;\n        if (asyncContext) {\n            bindingInfo.asyncContext = null;\n            asyncContext.notifyAncestor();\n        }\n    }\n    function AsyncCompleteContext(node, bindingInfo, ancestorBindingInfo) {\n        this.node = node;\n        this.bindingInfo = bindingInfo;\n        this.asyncDescendants = [];\n        this.childrenComplete = false;\n\n        if (!bindingInfo.asyncContext) {\n            ko.utils.domNodeDisposal.addDisposeCallback(node, asyncContextDispose);\n        }\n\n        if (ancestorBindingInfo && ancestorBindingInfo.asyncContext) {\n            ancestorBindingInfo.asyncContext.asyncDescendants.push(node);\n            this.ancestorBindingInfo = ancestorBindingInfo;\n        }\n    }\n    AsyncCompleteContext.prototype.notifyAncestor = function () {\n        if (this.ancestorBindingInfo && this.ancestorBindingInfo.asyncContext) {\n            this.ancestorBindingInfo.asyncContext.descendantComplete(this.node);\n        }\n    };\n    AsyncCompleteContext.prototype.descendantComplete = function (node) {\n        ko.utils.arrayRemoveItem(this.asyncDescendants, node);\n        if (!this.asyncDescendants.length && this.childrenComplete) {\n            this.completeChildren();\n        }\n    };\n    AsyncCompleteContext.prototype.completeChildren = function () {\n        this.childrenComplete = true;\n        if (this.bindingInfo.asyncContext && !this.asyncDescendants.length) {\n            this.bindingInfo.asyncContext = null;\n            ko.utils.domNodeDisposal.removeDisposeCallback(this.node, asyncContextDispose);\n            ko.bindingEvent.notify(this.node, ko.bindingEvent.descendantsComplete);\n            this.notifyAncestor();\n        }\n    };\n\n    ko.bindingEvent = {\n        childrenComplete: \"childrenComplete\",\n        descendantsComplete : \"descendantsComplete\",\n\n        subscribe: function (node, event, callback, context) {\n            var bindingInfo = ko.utils.domData.getOrSet(node, boundElementDomDataKey, {});\n            if (!bindingInfo.eventSubscribable) {\n                bindingInfo.eventSubscribable = new ko.subscribable;\n            }\n            return bindingInfo.eventSubscribable.subscribe(callback, context, event);\n        },\n\n        notify: function (node, event) {\n            var bindingInfo = ko.utils.domData.get(node, boundElementDomDataKey);\n            if (bindingInfo) {\n                if (bindingInfo.eventSubscribable) {\n                    bindingInfo.eventSubscribable['notifySubscribers'](node, event);\n                }\n                if (event == ko.bindingEvent.childrenComplete) {\n                    if (bindingInfo.asyncContext) {\n                        bindingInfo.asyncContext.completeChildren();\n                    } else if (bindingInfo.asyncContext === undefined && bindingInfo.eventSubscribable && bindingInfo.eventSubscribable.hasSubscriptionsForEvent(ko.bindingEvent.descendantsComplete)) {\n                        // It's currently an error to register a descendantsComplete handler for a node that was never registered as completing asynchronously.\n                        // That's because without the asyncContext, we don't have a way to know that all descendants have completed.\n                        throw new Error(\"descendantsComplete event not supported for bindings on this node\");\n                    }\n                }\n            }\n        },\n\n        startPossiblyAsyncContentBinding: function (node, bindingContext) {\n            var bindingInfo = ko.utils.domData.getOrSet(node, boundElementDomDataKey, {});\n\n            if (!bindingInfo.asyncContext) {\n                bindingInfo.asyncContext = new AsyncCompleteContext(node, bindingInfo, bindingContext[contextAncestorBindingInfo]);\n            }\n\n            // If the provided context was already extended with this node's binding info, just return the extended context\n            if (bindingContext[contextAncestorBindingInfo] == bindingInfo) {\n                return bindingContext;\n            }\n\n            return bindingContext['extend'](function (ctx) {\n                ctx[contextAncestorBindingInfo] = bindingInfo;\n            });\n        }\n    };\n\n    // Returns the valueAccessor function for a binding value\n    function makeValueAccessor(value) {\n        return function() {\n            return value;\n        };\n    }\n\n    // Returns the value of a valueAccessor function\n    function evaluateValueAccessor(valueAccessor) {\n        return valueAccessor();\n    }\n\n    // Given a function that returns bindings, create and return a new object that contains\n    // binding value-accessors functions. Each accessor function calls the original function\n    // so that it always gets the latest value and all dependencies are captured. This is used\n    // by ko.applyBindingsToNode and getBindingsAndMakeAccessors.\n    function makeAccessorsFromFunction(callback) {\n        return ko.utils.objectMap(ko.dependencyDetection.ignore(callback), function(value, key) {\n            return function() {\n                return callback()[key];\n            };\n        });\n    }\n\n    // Given a bindings function or object, create and return a new object that contains\n    // binding value-accessors functions. This is used by ko.applyBindingsToNode.\n    function makeBindingAccessors(bindings, context, node) {\n        if (typeof bindings === 'function') {\n            return makeAccessorsFromFunction(bindings.bind(null, context, node));\n        } else {\n            return ko.utils.objectMap(bindings, makeValueAccessor);\n        }\n    }\n\n    // This function is used if the binding provider doesn't include a getBindingAccessors function.\n    // It must be called with 'this' set to the provider instance.\n    function getBindingsAndMakeAccessors(node, context) {\n        return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n    }\n\n    function validateThatBindingIsAllowedForVirtualElements(bindingName) {\n        var validator = ko.virtualElements.allowedBindings[bindingName];\n        if (!validator)\n            throw new Error(\"The binding '\" + bindingName + \"' cannot be used with virtual elements\")\n    }\n\n    function applyBindingsToDescendantsInternal(bindingContext, elementOrVirtualElement) {\n        var nextInQueue = ko.virtualElements.firstChild(elementOrVirtualElement);\n\n        if (nextInQueue) {\n            var currentChild,\n                provider = ko.bindingProvider['instance'],\n                preprocessNode = provider['preprocessNode'];\n\n            // Preprocessing allows a binding provider to mutate a node before bindings are applied to it. For example it's\n            // possible to insert new siblings after it, and/or replace the node with a different one. This can be used to\n            // implement custom binding syntaxes, such as {{ value }} for string interpolation, or custom element types that\n            // trigger insertion of <template> contents at that point in the document.\n            if (preprocessNode) {\n                while (currentChild = nextInQueue) {\n                    nextInQueue = ko.virtualElements.nextSibling(currentChild);\n                    preprocessNode.call(provider, currentChild);\n                }\n                // Reset nextInQueue for the next loop\n                nextInQueue = ko.virtualElements.firstChild(elementOrVirtualElement);\n            }\n\n            while (currentChild = nextInQueue) {\n                // Keep a record of the next child *before* applying bindings, in case the binding removes the current child from its position\n                nextInQueue = ko.virtualElements.nextSibling(currentChild);\n                applyBindingsToNodeAndDescendantsInternal(bindingContext, currentChild);\n            }\n        }\n        ko.bindingEvent.notify(elementOrVirtualElement, ko.bindingEvent.childrenComplete);\n    }\n\n    function applyBindingsToNodeAndDescendantsInternal(bindingContext, nodeVerified) {\n        var bindingContextForDescendants = bindingContext;\n\n        var isElement = (nodeVerified.nodeType === 1);\n        if (isElement) // Workaround IE <= 8 HTML parsing weirdness\n            ko.virtualElements.normaliseVirtualElementDomStructure(nodeVerified);\n\n        // Perf optimisation: Apply bindings only if...\n        // (1) We need to store the binding info for the node (all element nodes)\n        // (2) It might have bindings (e.g., it has a data-bind attribute, or it's a marker for a containerless template)\n        var shouldApplyBindings = isElement || ko.bindingProvider['instance']['nodeHasBindings'](nodeVerified);\n        if (shouldApplyBindings)\n            bindingContextForDescendants = applyBindingsToNodeInternal(nodeVerified, null, bindingContext)['bindingContextForDescendants'];\n\n        if (bindingContextForDescendants && !bindingDoesNotRecurseIntoElementTypes[ko.utils.tagNameLower(nodeVerified)]) {\n            applyBindingsToDescendantsInternal(bindingContextForDescendants, nodeVerified);\n        }\n    }\n\n    function topologicalSortBindings(bindings) {\n        // Depth-first sort\n        var result = [],                // The list of key/handler pairs that we will return\n            bindingsConsidered = {},    // A temporary record of which bindings are already in 'result'\n            cyclicDependencyStack = []; // Keeps track of a depth-search so that, if there's a cycle, we know which bindings caused it\n        ko.utils.objectForEach(bindings, function pushBinding(bindingKey) {\n            if (!bindingsConsidered[bindingKey]) {\n                var binding = ko['getBindingHandler'](bindingKey);\n                if (binding) {\n                    // First add dependencies (if any) of the current binding\n                    if (binding['after']) {\n                        cyclicDependencyStack.push(bindingKey);\n                        ko.utils.arrayForEach(binding['after'], function(bindingDependencyKey) {\n                            if (bindings[bindingDependencyKey]) {\n                                if (ko.utils.arrayIndexOf(cyclicDependencyStack, bindingDependencyKey) !== -1) {\n                                    throw Error(\"Cannot combine the following bindings, because they have a cyclic dependency: \" + cyclicDependencyStack.join(\", \"));\n                                } else {\n                                    pushBinding(bindingDependencyKey);\n                                }\n                            }\n                        });\n                        cyclicDependencyStack.length--;\n                    }\n                    // Next add the current binding\n                    result.push({ key: bindingKey, handler: binding });\n                }\n                bindingsConsidered[bindingKey] = true;\n            }\n        });\n\n        return result;\n    }\n\n    function applyBindingsToNodeInternal(node, sourceBindings, bindingContext) {\n        var bindingInfo = ko.utils.domData.getOrSet(node, boundElementDomDataKey, {});\n\n        // Prevent multiple applyBindings calls for the same node, except when a binding value is specified\n        var alreadyBound = bindingInfo.alreadyBound;\n        if (!sourceBindings) {\n            if (alreadyBound) {\n                throw Error(\"You cannot apply bindings multiple times to the same element.\");\n            }\n            bindingInfo.alreadyBound = true;\n        }\n        if (!alreadyBound) {\n            bindingInfo.context = bindingContext;\n        }\n\n        // Use bindings if given, otherwise fall back on asking the bindings provider to give us some bindings\n        var bindings;\n        if (sourceBindings && typeof sourceBindings !== 'function') {\n            bindings = sourceBindings;\n        } else {\n            var provider = ko.bindingProvider['instance'],\n                getBindings = provider['getBindingAccessors'] || getBindingsAndMakeAccessors;\n\n            // Get the binding from the provider within a computed observable so that we can update the bindings whenever\n            // the binding context is updated or if the binding provider accesses observables.\n            var bindingsUpdater = ko.dependentObservable(\n                function() {\n                    bindings = sourceBindings ? sourceBindings(bindingContext, node) : getBindings.call(provider, node, bindingContext);\n                    // Register a dependency on the binding context to support observable view models.\n                    if (bindings) {\n                        if (bindingContext[contextSubscribable]) {\n                            bindingContext[contextSubscribable]();\n                        }\n                        if (bindingContext[contextDataDependency]) {\n                            bindingContext[contextDataDependency]();\n                        }\n                    }\n                    return bindings;\n                },\n                null, { disposeWhenNodeIsRemoved: node }\n            );\n\n            if (!bindings || !bindingsUpdater.isActive())\n                bindingsUpdater = null;\n        }\n\n        var contextToExtend = bindingContext;\n        var bindingHandlerThatControlsDescendantBindings;\n        if (bindings) {\n            // Return the value accessor for a given binding. When bindings are static (won't be updated because of a binding\n            // context update), just return the value accessor from the binding. Otherwise, return a function that always gets\n            // the latest binding value and registers a dependency on the binding updater.\n            var getValueAccessor = bindingsUpdater\n                ? function(bindingKey) {\n                    return function() {\n                        return evaluateValueAccessor(bindingsUpdater()[bindingKey]);\n                    };\n                } : function(bindingKey) {\n                    return bindings[bindingKey];\n                };\n\n            // Use of allBindings as a function is maintained for backwards compatibility, but its use is deprecated\n            function allBindings() {\n                return ko.utils.objectMap(bindingsUpdater ? bindingsUpdater() : bindings, evaluateValueAccessor);\n            }\n            // The following is the 3.x allBindings API\n            allBindings['get'] = function(key) {\n                return bindings[key] && evaluateValueAccessor(getValueAccessor(key));\n            };\n            allBindings['has'] = function(key) {\n                return key in bindings;\n            };\n\n            if (ko.bindingEvent.childrenComplete in bindings) {\n                ko.bindingEvent.subscribe(node, ko.bindingEvent.childrenComplete, function () {\n                    var callback = evaluateValueAccessor(bindings[ko.bindingEvent.childrenComplete]);\n                    if (callback) {\n                        var nodes = ko.virtualElements.childNodes(node);\n                        if (nodes.length) {\n                            callback(nodes, ko.dataFor(nodes[0]));\n                        }\n                    }\n                });\n            }\n\n            if (ko.bindingEvent.descendantsComplete in bindings) {\n                contextToExtend = ko.bindingEvent.startPossiblyAsyncContentBinding(node, bindingContext);\n                ko.bindingEvent.subscribe(node, ko.bindingEvent.descendantsComplete, function () {\n                    var callback = evaluateValueAccessor(bindings[ko.bindingEvent.descendantsComplete]);\n                    if (callback && ko.virtualElements.firstChild(node)) {\n                        callback(node);\n                    }\n                });\n            }\n\n            // First put the bindings into the right order\n            var orderedBindings = topologicalSortBindings(bindings);\n\n            // Go through the sorted bindings, calling init and update for each\n            ko.utils.arrayForEach(orderedBindings, function(bindingKeyAndHandler) {\n                // Note that topologicalSortBindings has already filtered out any nonexistent binding handlers,\n                // so bindingKeyAndHandler.handler will always be nonnull.\n                var handlerInitFn = bindingKeyAndHandler.handler[\"init\"],\n                    handlerUpdateFn = bindingKeyAndHandler.handler[\"update\"],\n                    bindingKey = bindingKeyAndHandler.key;\n\n                if (node.nodeType === 8) {\n                    validateThatBindingIsAllowedForVirtualElements(bindingKey);\n                }\n\n                try {\n                    // Run init, ignoring any dependencies\n                    if (typeof handlerInitFn == \"function\") {\n                        ko.dependencyDetection.ignore(function() {\n                            var initResult = handlerInitFn(node, getValueAccessor(bindingKey), allBindings, contextToExtend['$data'], contextToExtend);\n\n                            // If this binding handler claims to control descendant bindings, make a note of this\n                            if (initResult && initResult['controlsDescendantBindings']) {\n                                if (bindingHandlerThatControlsDescendantBindings !== undefined)\n                                    throw new Error(\"Multiple bindings (\" + bindingHandlerThatControlsDescendantBindings + \" and \" + bindingKey + \") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.\");\n                                bindingHandlerThatControlsDescendantBindings = bindingKey;\n                            }\n                        });\n                    }\n\n                    // Run update in its own computed wrapper\n                    if (typeof handlerUpdateFn == \"function\") {\n                        ko.dependentObservable(\n                            function() {\n                                handlerUpdateFn(node, getValueAccessor(bindingKey), allBindings, contextToExtend['$data'], contextToExtend);\n                            },\n                            null,\n                            { disposeWhenNodeIsRemoved: node }\n                        );\n                    }\n                } catch (ex) {\n                    ex.message = \"Unable to process binding \\\"\" + bindingKey + \": \" + bindings[bindingKey] + \"\\\"\\nMessage: \" + ex.message;\n                    throw ex;\n                }\n            });\n        }\n\n        var shouldBindDescendants = bindingHandlerThatControlsDescendantBindings === undefined;\n        return {\n            'shouldBindDescendants': shouldBindDescendants,\n            'bindingContextForDescendants': shouldBindDescendants && contextToExtend\n        };\n    };\n\n    ko.storedBindingContextForNode = function (node) {\n        var bindingInfo = ko.utils.domData.get(node, boundElementDomDataKey);\n        return bindingInfo && bindingInfo.context;\n    }\n\n    function getBindingContext(viewModelOrBindingContext, extendContextCallback) {\n        return viewModelOrBindingContext && (viewModelOrBindingContext instanceof ko.bindingContext)\n            ? viewModelOrBindingContext\n            : new ko.bindingContext(viewModelOrBindingContext, undefined, undefined, extendContextCallback);\n    }\n\n    ko.applyBindingAccessorsToNode = function (node, bindings, viewModelOrBindingContext) {\n        if (node.nodeType === 1) // If it's an element, workaround IE <= 8 HTML parsing weirdness\n            ko.virtualElements.normaliseVirtualElementDomStructure(node);\n        return applyBindingsToNodeInternal(node, bindings, getBindingContext(viewModelOrBindingContext));\n    };\n\n    ko.applyBindingsToNode = function (node, bindings, viewModelOrBindingContext) {\n        var context = getBindingContext(viewModelOrBindingContext);\n        return ko.applyBindingAccessorsToNode(node, makeBindingAccessors(bindings, context, node), context);\n    };\n\n    ko.applyBindingsToDescendants = function(viewModelOrBindingContext, rootNode) {\n        if (rootNode.nodeType === 1 || rootNode.nodeType === 8)\n            applyBindingsToDescendantsInternal(getBindingContext(viewModelOrBindingContext), rootNode);\n    };\n\n    ko.applyBindings = function (viewModelOrBindingContext, rootNode, extendContextCallback) {\n        // If jQuery is loaded after Knockout, we won't initially have access to it. So save it here.\n        if (!jQueryInstance && window['jQuery']) {\n            jQueryInstance = window['jQuery'];\n        }\n\n        if (arguments.length < 2) {\n            rootNode = document.body;\n            if (!rootNode) {\n                throw Error(\"ko.applyBindings: could not find document.body; has the document been loaded?\");\n            }\n        } else if (!rootNode || (rootNode.nodeType !== 1 && rootNode.nodeType !== 8)) {\n            throw Error(\"ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node\");\n        }\n\n        applyBindingsToNodeAndDescendantsInternal(getBindingContext(viewModelOrBindingContext, extendContextCallback), rootNode);\n    };\n\n    // Retrieving binding context from arbitrary nodes\n    ko.contextFor = function(node) {\n        // We can only do something meaningful for elements and comment nodes (in particular, not text nodes, as IE can't store domdata for them)\n        if (node && (node.nodeType === 1 || node.nodeType === 8)) {\n            return ko.storedBindingContextForNode(node);\n        }\n        return undefined;\n    };\n    ko.dataFor = function(node) {\n        var context = ko.contextFor(node);\n        return context ? context['$data'] : undefined;\n    };\n\n    ko.exportSymbol('bindingHandlers', ko.bindingHandlers);\n    ko.exportSymbol('bindingEvent', ko.bindingEvent);\n    ko.exportSymbol('bindingEvent.subscribe', ko.bindingEvent.subscribe);\n    ko.exportSymbol('bindingEvent.startPossiblyAsyncContentBinding', ko.bindingEvent.startPossiblyAsyncContentBinding);\n    ko.exportSymbol('applyBindings', ko.applyBindings);\n    ko.exportSymbol('applyBindingsToDescendants', ko.applyBindingsToDescendants);\n    ko.exportSymbol('applyBindingAccessorsToNode', ko.applyBindingAccessorsToNode);\n    ko.exportSymbol('applyBindingsToNode', ko.applyBindingsToNode);\n    ko.exportSymbol('contextFor', ko.contextFor);\n    ko.exportSymbol('dataFor', ko.dataFor);\n})();\n(function(undefined) {\n    var loadingSubscribablesCache = {}, // Tracks component loads that are currently in flight\n        loadedDefinitionsCache = {};    // Tracks component loads that have already completed\n\n    ko.components = {\n        get: function(componentName, callback) {\n            var cachedDefinition = getObjectOwnProperty(loadedDefinitionsCache, componentName);\n            if (cachedDefinition) {\n                // It's already loaded and cached. Reuse the same definition object.\n                // Note that for API consistency, even cache hits complete asynchronously by default.\n                // You can bypass this by putting synchronous:true on your component config.\n                if (cachedDefinition.isSynchronousComponent) {\n                    ko.dependencyDetection.ignore(function() { // See comment in loaderRegistryBehaviors.js for reasoning\n                        callback(cachedDefinition.definition);\n                    });\n                } else {\n                    ko.tasks.schedule(function() { callback(cachedDefinition.definition); });\n                }\n            } else {\n                // Join the loading process that is already underway, or start a new one.\n                loadComponentAndNotify(componentName, callback);\n            }\n        },\n\n        clearCachedDefinition: function(componentName) {\n            delete loadedDefinitionsCache[componentName];\n        },\n\n        _getFirstResultFromLoaders: getFirstResultFromLoaders\n    };\n\n    function getObjectOwnProperty(obj, propName) {\n        return Object.prototype.hasOwnProperty.call(obj, propName) ? obj[propName] : undefined;\n    }\n\n    function loadComponentAndNotify(componentName, callback) {\n        var subscribable = getObjectOwnProperty(loadingSubscribablesCache, componentName),\n            completedAsync;\n        if (!subscribable) {\n            // It's not started loading yet. Start loading, and when it's done, move it to loadedDefinitionsCache.\n            subscribable = loadingSubscribablesCache[componentName] = new ko.subscribable();\n            subscribable.subscribe(callback);\n\n            beginLoadingComponent(componentName, function(definition, config) {\n                var isSynchronousComponent = !!(config && config['synchronous']);\n                loadedDefinitionsCache[componentName] = { definition: definition, isSynchronousComponent: isSynchronousComponent };\n                delete loadingSubscribablesCache[componentName];\n\n                // For API consistency, all loads complete asynchronously. However we want to avoid\n                // adding an extra task schedule if it's unnecessary (i.e., the completion is already\n                // async).\n                //\n                // You can bypass the 'always asynchronous' feature by putting the synchronous:true\n                // flag on your component configuration when you register it.\n                if (completedAsync || isSynchronousComponent) {\n                    // Note that notifySubscribers ignores any dependencies read within the callback.\n                    // See comment in loaderRegistryBehaviors.js for reasoning\n                    subscribable['notifySubscribers'](definition);\n                } else {\n                    ko.tasks.schedule(function() {\n                        subscribable['notifySubscribers'](definition);\n                    });\n                }\n            });\n            completedAsync = true;\n        } else {\n            subscribable.subscribe(callback);\n        }\n    }\n\n    function beginLoadingComponent(componentName, callback) {\n        getFirstResultFromLoaders('getConfig', [componentName], function(config) {\n            if (config) {\n                // We have a config, so now load its definition\n                getFirstResultFromLoaders('loadComponent', [componentName, config], function(definition) {\n                    callback(definition, config);\n                });\n            } else {\n                // The component has no config - it's unknown to all the loaders.\n                // Note that this is not an error (e.g., a module loading error) - that would abort the\n                // process and this callback would not run. For this callback to run, all loaders must\n                // have confirmed they don't know about this component.\n                callback(null, null);\n            }\n        });\n    }\n\n    function getFirstResultFromLoaders(methodName, argsExceptCallback, callback, candidateLoaders) {\n        // On the first call in the stack, start with the full set of loaders\n        if (!candidateLoaders) {\n            candidateLoaders = ko.components['loaders'].slice(0); // Use a copy, because we'll be mutating this array\n        }\n\n        // Try the next candidate\n        var currentCandidateLoader = candidateLoaders.shift();\n        if (currentCandidateLoader) {\n            var methodInstance = currentCandidateLoader[methodName];\n            if (methodInstance) {\n                var wasAborted = false,\n                    synchronousReturnValue = methodInstance.apply(currentCandidateLoader, argsExceptCallback.concat(function(result) {\n                        if (wasAborted) {\n                            callback(null);\n                        } else if (result !== null) {\n                            // This candidate returned a value. Use it.\n                            callback(result);\n                        } else {\n                            // Try the next candidate\n                            getFirstResultFromLoaders(methodName, argsExceptCallback, callback, candidateLoaders);\n                        }\n                    }));\n\n                // Currently, loaders may not return anything synchronously. This leaves open the possibility\n                // that we'll extend the API to support synchronous return values in the future. It won't be\n                // a breaking change, because currently no loader is allowed to return anything except undefined.\n                if (synchronousReturnValue !== undefined) {\n                    wasAborted = true;\n\n                    // Method to suppress exceptions will remain undocumented. This is only to keep\n                    // KO's specs running tidily, since we can observe the loading got aborted without\n                    // having exceptions cluttering up the console too.\n                    if (!currentCandidateLoader['suppressLoaderExceptions']) {\n                        throw new Error('Component loaders must supply values by invoking the callback, not by returning values synchronously.');\n                    }\n                }\n            } else {\n                // This candidate doesn't have the relevant handler. Synchronously move on to the next one.\n                getFirstResultFromLoaders(methodName, argsExceptCallback, callback, candidateLoaders);\n            }\n        } else {\n            // No candidates returned a value\n            callback(null);\n        }\n    }\n\n    // Reference the loaders via string name so it's possible for developers\n    // to replace the whole array by assigning to ko.components.loaders\n    ko.components['loaders'] = [];\n\n    ko.exportSymbol('components', ko.components);\n    ko.exportSymbol('components.get', ko.components.get);\n    ko.exportSymbol('components.clearCachedDefinition', ko.components.clearCachedDefinition);\n})();\n(function(undefined) {\n\n    // The default loader is responsible for two things:\n    // 1. Maintaining the default in-memory registry of component configuration objects\n    //    (i.e., the thing you're writing to when you call ko.components.register(someName, ...))\n    // 2. Answering requests for components by fetching configuration objects\n    //    from that default in-memory registry and resolving them into standard\n    //    component definition objects (of the form { createViewModel: ..., template: ... })\n    // Custom loaders may override either of these facilities, i.e.,\n    // 1. To supply configuration objects from some other source (e.g., conventions)\n    // 2. Or, to resolve configuration objects by loading viewmodels/templates via arbitrary logic.\n\n    var defaultConfigRegistry = {};\n\n    ko.components.register = function(componentName, config) {\n        if (!config) {\n            throw new Error('Invalid configuration for ' + componentName);\n        }\n\n        if (ko.components.isRegistered(componentName)) {\n            throw new Error('Component ' + componentName + ' is already registered');\n        }\n\n        defaultConfigRegistry[componentName] = config;\n    };\n\n    ko.components.isRegistered = function(componentName) {\n        return Object.prototype.hasOwnProperty.call(defaultConfigRegistry, componentName);\n    };\n\n    ko.components.unregister = function(componentName) {\n        delete defaultConfigRegistry[componentName];\n        ko.components.clearCachedDefinition(componentName);\n    };\n\n    ko.components.defaultLoader = {\n        'getConfig': function(componentName, callback) {\n            var result = ko.components.isRegistered(componentName)\n                ? defaultConfigRegistry[componentName]\n                : null;\n            callback(result);\n        },\n\n        'loadComponent': function(componentName, config, callback) {\n            var errorCallback = makeErrorCallback(componentName);\n            possiblyGetConfigFromAmd(errorCallback, config, function(loadedConfig) {\n                resolveConfig(componentName, errorCallback, loadedConfig, callback);\n            });\n        },\n\n        'loadTemplate': function(componentName, templateConfig, callback) {\n            resolveTemplate(makeErrorCallback(componentName), templateConfig, callback);\n        },\n\n        'loadViewModel': function(componentName, viewModelConfig, callback) {\n            resolveViewModel(makeErrorCallback(componentName), viewModelConfig, callback);\n        }\n    };\n\n    var createViewModelKey = 'createViewModel';\n\n    // Takes a config object of the form { template: ..., viewModel: ... }, and asynchronously convert it\n    // into the standard component definition format:\n    //    { template: <ArrayOfDomNodes>, createViewModel: function(params, componentInfo) { ... } }.\n    // Since both template and viewModel may need to be resolved asynchronously, both tasks are performed\n    // in parallel, and the results joined when both are ready. We don't depend on any promises infrastructure,\n    // so this is implemented manually below.\n    function resolveConfig(componentName, errorCallback, config, callback) {\n        var result = {},\n            makeCallBackWhenZero = 2,\n            tryIssueCallback = function() {\n                if (--makeCallBackWhenZero === 0) {\n                    callback(result);\n                }\n            },\n            templateConfig = config['template'],\n            viewModelConfig = config['viewModel'];\n\n        if (templateConfig) {\n            possiblyGetConfigFromAmd(errorCallback, templateConfig, function(loadedConfig) {\n                ko.components._getFirstResultFromLoaders('loadTemplate', [componentName, loadedConfig], function(resolvedTemplate) {\n                    result['template'] = resolvedTemplate;\n                    tryIssueCallback();\n                });\n            });\n        } else {\n            tryIssueCallback();\n        }\n\n        if (viewModelConfig) {\n            possiblyGetConfigFromAmd(errorCallback, viewModelConfig, function(loadedConfig) {\n                ko.components._getFirstResultFromLoaders('loadViewModel', [componentName, loadedConfig], function(resolvedViewModel) {\n                    result[createViewModelKey] = resolvedViewModel;\n                    tryIssueCallback();\n                });\n            });\n        } else {\n            tryIssueCallback();\n        }\n    }\n\n    function resolveTemplate(errorCallback, templateConfig, callback) {\n        if (typeof templateConfig === 'string') {\n            // Markup - parse it\n            callback(ko.utils.parseHtmlFragment(templateConfig));\n        } else if (templateConfig instanceof Array) {\n            // Assume already an array of DOM nodes - pass through unchanged\n            callback(templateConfig);\n        } else if (isDocumentFragment(templateConfig)) {\n            // Document fragment - use its child nodes\n            callback(ko.utils.makeArray(templateConfig.childNodes));\n        } else if (templateConfig['element']) {\n            var element = templateConfig['element'];\n            if (isDomElement(element)) {\n                // Element instance - copy its child nodes\n                callback(cloneNodesFromTemplateSourceElement(element));\n            } else if (typeof element === 'string') {\n                // Element ID - find it, then copy its child nodes\n                var elemInstance = document.getElementById(element);\n                if (elemInstance) {\n                    callback(cloneNodesFromTemplateSourceElement(elemInstance));\n                } else {\n                    errorCallback('Cannot find element with ID ' + element);\n                }\n            } else {\n                errorCallback('Unknown element type: ' + element);\n            }\n        } else {\n            errorCallback('Unknown template value: ' + templateConfig);\n        }\n    }\n\n    function resolveViewModel(errorCallback, viewModelConfig, callback) {\n        if (typeof viewModelConfig === 'function') {\n            // Constructor - convert to standard factory function format\n            // By design, this does *not* supply componentInfo to the constructor, as the intent is that\n            // componentInfo contains non-viewmodel data (e.g., the component's element) that should only\n            // be used in factory functions, not viewmodel constructors.\n            callback(function (params /*, componentInfo */) {\n                return new viewModelConfig(params);\n            });\n        } else if (typeof viewModelConfig[createViewModelKey] === 'function') {\n            // Already a factory function - use it as-is\n            callback(viewModelConfig[createViewModelKey]);\n        } else if ('instance' in viewModelConfig) {\n            // Fixed object instance - promote to createViewModel format for API consistency\n            var fixedInstance = viewModelConfig['instance'];\n            callback(function (params, componentInfo) {\n                return fixedInstance;\n            });\n        } else if ('viewModel' in viewModelConfig) {\n            // Resolved AMD module whose value is of the form { viewModel: ... }\n            resolveViewModel(errorCallback, viewModelConfig['viewModel'], callback);\n        } else {\n            errorCallback('Unknown viewModel value: ' + viewModelConfig);\n        }\n    }\n\n    function cloneNodesFromTemplateSourceElement(elemInstance) {\n        switch (ko.utils.tagNameLower(elemInstance)) {\n            case 'script':\n                return ko.utils.parseHtmlFragment(elemInstance.text);\n            case 'textarea':\n                return ko.utils.parseHtmlFragment(elemInstance.value);\n            case 'template':\n                // For browsers with proper <template> element support (i.e., where the .content property\n                // gives a document fragment), use that document fragment.\n                if (isDocumentFragment(elemInstance.content)) {\n                    return ko.utils.cloneNodes(elemInstance.content.childNodes);\n                }\n        }\n\n        // Regular elements such as <div>, and <template> elements on old browsers that don't really\n        // understand <template> and just treat it as a regular container\n        return ko.utils.cloneNodes(elemInstance.childNodes);\n    }\n\n    function isDomElement(obj) {\n        if (window['HTMLElement']) {\n            return obj instanceof HTMLElement;\n        } else {\n            return obj && obj.tagName && obj.nodeType === 1;\n        }\n    }\n\n    function isDocumentFragment(obj) {\n        if (window['DocumentFragment']) {\n            return obj instanceof DocumentFragment;\n        } else {\n            return obj && obj.nodeType === 11;\n        }\n    }\n\n    function possiblyGetConfigFromAmd(errorCallback, config, callback) {\n        if (typeof config['require'] === 'string') {\n            // The config is the value of an AMD module\n            if (amdRequire || window['require']) {\n                (amdRequire || window['require'])([config['require']], callback);\n            } else {\n                errorCallback('Uses require, but no AMD loader is present');\n            }\n        } else {\n            callback(config);\n        }\n    }\n\n    function makeErrorCallback(componentName) {\n        return function (message) {\n            throw new Error('Component \\'' + componentName + '\\': ' + message);\n        };\n    }\n\n    ko.exportSymbol('components.register', ko.components.register);\n    ko.exportSymbol('components.isRegistered', ko.components.isRegistered);\n    ko.exportSymbol('components.unregister', ko.components.unregister);\n\n    // Expose the default loader so that developers can directly ask it for configuration\n    // or to resolve configuration\n    ko.exportSymbol('components.defaultLoader', ko.components.defaultLoader);\n\n    // By default, the default loader is the only registered component loader\n    ko.components['loaders'].push(ko.components.defaultLoader);\n\n    // Privately expose the underlying config registry for use in old-IE shim\n    ko.components._allRegisteredComponents = defaultConfigRegistry;\n})();\n(function (undefined) {\n    // Overridable API for determining which component name applies to a given node. By overriding this,\n    // you can for example map specific tagNames to components that are not preregistered.\n    ko.components['getComponentNameForNode'] = function(node) {\n        var tagNameLower = ko.utils.tagNameLower(node);\n        if (ko.components.isRegistered(tagNameLower)) {\n            // Try to determine that this node can be considered a *custom* element; see https://github.com/knockout/knockout/issues/1603\n            if (tagNameLower.indexOf('-') != -1 || ('' + node) == \"[object HTMLUnknownElement]\" || (ko.utils.ieVersion <= 8 && node.tagName === tagNameLower)) {\n                return tagNameLower;\n            }\n        }\n    };\n\n    ko.components.addBindingsForCustomElement = function(allBindings, node, bindingContext, valueAccessors) {\n        // Determine if it's really a custom element matching a component\n        if (node.nodeType === 1) {\n            var componentName = ko.components['getComponentNameForNode'](node);\n            if (componentName) {\n                // It does represent a component, so add a component binding for it\n                allBindings = allBindings || {};\n\n                if (allBindings['component']) {\n                    // Avoid silently overwriting some other 'component' binding that may already be on the element\n                    throw new Error('Cannot use the \"component\" binding on a custom element matching a component');\n                }\n\n                var componentBindingValue = { 'name': componentName, 'params': getComponentParamsFromCustomElement(node, bindingContext) };\n\n                allBindings['component'] = valueAccessors\n                    ? function() { return componentBindingValue; }\n                    : componentBindingValue;\n            }\n        }\n\n        return allBindings;\n    }\n\n    var nativeBindingProviderInstance = new ko.bindingProvider();\n\n    function getComponentParamsFromCustomElement(elem, bindingContext) {\n        var paramsAttribute = elem.getAttribute('params');\n\n        if (paramsAttribute) {\n            var params = nativeBindingProviderInstance['parseBindingsString'](paramsAttribute, bindingContext, elem, { 'valueAccessors': true, 'bindingParams': true }),\n                rawParamComputedValues = ko.utils.objectMap(params, function(paramValue, paramName) {\n                    return ko.computed(paramValue, null, { disposeWhenNodeIsRemoved: elem });\n                }),\n                result = ko.utils.objectMap(rawParamComputedValues, function(paramValueComputed, paramName) {\n                    var paramValue = paramValueComputed.peek();\n                    // Does the evaluation of the parameter value unwrap any observables?\n                    if (!paramValueComputed.isActive()) {\n                        // No it doesn't, so there's no need for any computed wrapper. Just pass through the supplied value directly.\n                        // Example: \"someVal: firstName, age: 123\" (whether or not firstName is an observable/computed)\n                        return paramValue;\n                    } else {\n                        // Yes it does. Supply a computed property that unwraps both the outer (binding expression)\n                        // level of observability, and any inner (resulting model value) level of observability.\n                        // This means the component doesn't have to worry about multiple unwrapping. If the value is a\n                        // writable observable, the computed will also be writable and pass the value on to the observable.\n                        return ko.computed({\n                            'read': function() {\n                                return ko.utils.unwrapObservable(paramValueComputed());\n                            },\n                            'write': ko.isWriteableObservable(paramValue) && function(value) {\n                                paramValueComputed()(value);\n                            },\n                            disposeWhenNodeIsRemoved: elem\n                        });\n                    }\n                });\n\n            // Give access to the raw computeds, as long as that wouldn't overwrite any custom param also called '$raw'\n            // This is in case the developer wants to react to outer (binding) observability separately from inner\n            // (model value) observability, or in case the model value observable has subobservables.\n            if (!Object.prototype.hasOwnProperty.call(result, '$raw')) {\n                result['$raw'] = rawParamComputedValues;\n            }\n\n            return result;\n        } else {\n            // For consistency, absence of a \"params\" attribute is treated the same as the presence of\n            // any empty one. Otherwise component viewmodels need special code to check whether or not\n            // 'params' or 'params.$raw' is null/undefined before reading subproperties, which is annoying.\n            return { '$raw': {} };\n        }\n    }\n\n    // --------------------------------------------------------------------------------\n    // Compatibility code for older (pre-HTML5) IE browsers\n\n    if (ko.utils.ieVersion < 9) {\n        // Whenever you preregister a component, enable it as a custom element in the current document\n        ko.components['register'] = (function(originalFunction) {\n            return function(componentName) {\n                document.createElement(componentName); // Allows IE<9 to parse markup containing the custom element\n                return originalFunction.apply(this, arguments);\n            }\n        })(ko.components['register']);\n\n        // Whenever you create a document fragment, enable all preregistered component names as custom elements\n        // This is needed to make innerShiv/jQuery HTML parsing correctly handle the custom elements\n        document.createDocumentFragment = (function(originalFunction) {\n            return function() {\n                var newDocFrag = originalFunction(),\n                    allComponents = ko.components._allRegisteredComponents;\n                for (var componentName in allComponents) {\n                    if (Object.prototype.hasOwnProperty.call(allComponents, componentName)) {\n                        newDocFrag.createElement(componentName);\n                    }\n                }\n                return newDocFrag;\n            };\n        })(document.createDocumentFragment);\n    }\n})();(function(undefined) {\n    var componentLoadingOperationUniqueId = 0;\n\n    ko.bindingHandlers['component'] = {\n        'init': function(element, valueAccessor, ignored1, ignored2, bindingContext) {\n            var currentViewModel,\n                currentLoadingOperationId,\n                afterRenderSub,\n                disposeAssociatedComponentViewModel = function () {\n                    var currentViewModelDispose = currentViewModel && currentViewModel['dispose'];\n                    if (typeof currentViewModelDispose === 'function') {\n                        currentViewModelDispose.call(currentViewModel);\n                    }\n                    if (afterRenderSub) {\n                        afterRenderSub.dispose();\n                    }\n                    afterRenderSub = null;\n                    currentViewModel = null;\n                    // Any in-flight loading operation is no longer relevant, so make sure we ignore its completion\n                    currentLoadingOperationId = null;\n                },\n                originalChildNodes = ko.utils.makeArray(ko.virtualElements.childNodes(element));\n\n            ko.virtualElements.emptyNode(element);\n            ko.utils.domNodeDisposal.addDisposeCallback(element, disposeAssociatedComponentViewModel);\n\n            ko.computed(function () {\n                var value = ko.utils.unwrapObservable(valueAccessor()),\n                    componentName, componentParams;\n\n                if (typeof value === 'string') {\n                    componentName = value;\n                } else {\n                    componentName = ko.utils.unwrapObservable(value['name']);\n                    componentParams = ko.utils.unwrapObservable(value['params']);\n                }\n\n                if (!componentName) {\n                    throw new Error('No component name specified');\n                }\n\n                var asyncContext = ko.bindingEvent.startPossiblyAsyncContentBinding(element, bindingContext);\n\n                var loadingOperationId = currentLoadingOperationId = ++componentLoadingOperationUniqueId;\n                ko.components.get(componentName, function(componentDefinition) {\n                    // If this is not the current load operation for this element, ignore it.\n                    if (currentLoadingOperationId !== loadingOperationId) {\n                        return;\n                    }\n\n                    // Clean up previous state\n                    disposeAssociatedComponentViewModel();\n\n                    // Instantiate and bind new component. Implicitly this cleans any old DOM nodes.\n                    if (!componentDefinition) {\n                        throw new Error('Unknown component \\'' + componentName + '\\'');\n                    }\n                    cloneTemplateIntoElement(componentName, componentDefinition, element);\n\n                    var componentInfo = {\n                        'element': element,\n                        'templateNodes': originalChildNodes\n                    };\n\n                    var componentViewModel = createViewModel(componentDefinition, componentParams, componentInfo),\n                        childBindingContext = asyncContext['createChildContext'](componentViewModel, {\n                            'extend': function(ctx) {\n                                ctx['$component'] = componentViewModel;\n                                ctx['$componentTemplateNodes'] = originalChildNodes;\n                            }\n                        });\n\n                    if (componentViewModel && componentViewModel['koDescendantsComplete']) {\n                        afterRenderSub = ko.bindingEvent.subscribe(element, ko.bindingEvent.descendantsComplete, componentViewModel['koDescendantsComplete'], componentViewModel);\n                    }\n\n                    currentViewModel = componentViewModel;\n                    ko.applyBindingsToDescendants(childBindingContext, element);\n                });\n            }, null, { disposeWhenNodeIsRemoved: element });\n\n            return { 'controlsDescendantBindings': true };\n        }\n    };\n\n    ko.virtualElements.allowedBindings['component'] = true;\n\n    function cloneTemplateIntoElement(componentName, componentDefinition, element) {\n        var template = componentDefinition['template'];\n        if (!template) {\n            throw new Error('Component \\'' + componentName + '\\' has no template');\n        }\n\n        var clonedNodesArray = ko.utils.cloneNodes(template);\n        ko.virtualElements.setDomNodeChildren(element, clonedNodesArray);\n    }\n\n    function createViewModel(componentDefinition, componentParams, componentInfo) {\n        var componentViewModelFactory = componentDefinition['createViewModel'];\n        return componentViewModelFactory\n            ? componentViewModelFactory.call(componentDefinition, componentParams, componentInfo)\n            : componentParams; // Template-only component\n    }\n\n})();\nvar attrHtmlToJavaScriptMap = { 'class': 'className', 'for': 'htmlFor' };\nko.bindingHandlers['attr'] = {\n    'update': function(element, valueAccessor, allBindings) {\n        var value = ko.utils.unwrapObservable(valueAccessor()) || {};\n        ko.utils.objectForEach(value, function(attrName, attrValue) {\n            attrValue = ko.utils.unwrapObservable(attrValue);\n\n            // Find the namespace of this attribute, if any.\n            var prefixLen = attrName.indexOf(':');\n            var namespace = \"lookupNamespaceURI\" in element && prefixLen > 0 && element.lookupNamespaceURI(attrName.substr(0, prefixLen));\n\n            // To cover cases like \"attr: { checked:someProp }\", we want to remove the attribute entirely\n            // when someProp is a \"no value\"-like value (strictly null, false, or undefined)\n            // (because the absence of the \"checked\" attr is how to mark an element as not checked, etc.)\n            var toRemove = (attrValue === false) || (attrValue === null) || (attrValue === undefined);\n            if (toRemove) {\n                namespace ? element.removeAttributeNS(namespace, attrName) : element.removeAttribute(attrName);\n            } else {\n                attrValue = attrValue.toString();\n            }\n\n            // In IE <= 7 and IE8 Quirks Mode, you have to use the JavaScript property name instead of the\n            // HTML attribute name for certain attributes. IE8 Standards Mode supports the correct behavior,\n            // but instead of figuring out the mode, we'll just set the attribute through the JavaScript\n            // property for IE <= 8.\n            if (ko.utils.ieVersion <= 8 && attrName in attrHtmlToJavaScriptMap) {\n                attrName = attrHtmlToJavaScriptMap[attrName];\n                if (toRemove)\n                    element.removeAttribute(attrName);\n                else\n                    element[attrName] = attrValue;\n            } else if (!toRemove) {\n                namespace ? element.setAttributeNS(namespace, attrName, attrValue) : element.setAttribute(attrName, attrValue);\n            }\n\n            // Treat \"name\" specially - although you can think of it as an attribute, it also needs\n            // special handling on older versions of IE (https://github.com/SteveSanderson/knockout/pull/333)\n            // Deliberately being case-sensitive here because XHTML would regard \"Name\" as a different thing\n            // entirely, and there's no strong reason to allow for such casing in HTML.\n            if (attrName === \"name\") {\n                ko.utils.setElementName(element, toRemove ? \"\" : attrValue);\n            }\n        });\n    }\n};\n(function() {\n\nko.bindingHandlers['checked'] = {\n    'after': ['value', 'attr'],\n    'init': function (element, valueAccessor, allBindings) {\n        var checkedValue = ko.pureComputed(function() {\n            // Treat \"value\" like \"checkedValue\" when it is included with \"checked\" binding\n            if (allBindings['has']('checkedValue')) {\n                return ko.utils.unwrapObservable(allBindings.get('checkedValue'));\n            } else if (useElementValue) {\n                if (allBindings['has']('value')) {\n                    return ko.utils.unwrapObservable(allBindings.get('value'));\n                } else {\n                    return element.value;\n                }\n            }\n        });\n\n        function updateModel() {\n            // This updates the model value from the view value.\n            // It runs in response to DOM events (click) and changes in checkedValue.\n            var isChecked = element.checked,\n                elemValue = checkedValue();\n\n            // When we're first setting up this computed, don't change any model state.\n            if (ko.computedContext.isInitial()) {\n                return;\n            }\n\n            // We can ignore unchecked radio buttons, because some other radio\n            // button will be checked, and that one can take care of updating state.\n            // Also ignore value changes to an already unchecked checkbox.\n            if (!isChecked && (isRadio || ko.computedContext.getDependenciesCount())) {\n                return;\n            }\n\n            var modelValue = ko.dependencyDetection.ignore(valueAccessor);\n            if (valueIsArray) {\n                var writableValue = rawValueIsNonArrayObservable ? modelValue.peek() : modelValue,\n                    saveOldValue = oldElemValue;\n                oldElemValue = elemValue;\n\n                if (saveOldValue !== elemValue) {\n                    // When we're responding to the checkedValue changing, and the element is\n                    // currently checked, replace the old elem value with the new elem value\n                    // in the model array.\n                    if (isChecked) {\n                        ko.utils.addOrRemoveItem(writableValue, elemValue, true);\n                        ko.utils.addOrRemoveItem(writableValue, saveOldValue, false);\n                    }\n                } else {\n                    // When we're responding to the user having checked/unchecked a checkbox,\n                    // add/remove the element value to the model array.\n                    ko.utils.addOrRemoveItem(writableValue, elemValue, isChecked);\n                }\n\n                if (rawValueIsNonArrayObservable && ko.isWriteableObservable(modelValue)) {\n                    modelValue(writableValue);\n                }\n            } else {\n                if (isCheckbox) {\n                    if (elemValue === undefined) {\n                        elemValue = isChecked;\n                    } else if (!isChecked) {\n                        elemValue = undefined;\n                    }\n                }\n                ko.expressionRewriting.writeValueToProperty(modelValue, allBindings, 'checked', elemValue, true);\n            }\n        };\n\n        function updateView() {\n            // This updates the view value from the model value.\n            // It runs in response to changes in the bound (checked) value.\n            var modelValue = ko.utils.unwrapObservable(valueAccessor()),\n                elemValue = checkedValue();\n\n            if (valueIsArray) {\n                // When a checkbox is bound to an array, being checked represents its value being present in that array\n                element.checked = ko.utils.arrayIndexOf(modelValue, elemValue) >= 0;\n                oldElemValue = elemValue;\n            } else if (isCheckbox && elemValue === undefined) {\n                // When a checkbox is bound to any other value (not an array) and \"checkedValue\" is not defined,\n                // being checked represents the value being trueish\n                element.checked = !!modelValue;\n            } else {\n                // Otherwise, being checked means that the checkbox or radio button's value corresponds to the model value\n                element.checked = (checkedValue() === modelValue);\n            }\n        };\n\n        var isCheckbox = element.type == \"checkbox\",\n            isRadio = element.type == \"radio\";\n\n        // Only bind to check boxes and radio buttons\n        if (!isCheckbox && !isRadio) {\n            return;\n        }\n\n        var rawValue = valueAccessor(),\n            valueIsArray = isCheckbox && (ko.utils.unwrapObservable(rawValue) instanceof Array),\n            rawValueIsNonArrayObservable = !(valueIsArray && rawValue.push && rawValue.splice),\n            useElementValue = isRadio || valueIsArray,\n            oldElemValue = valueIsArray ? checkedValue() : undefined;\n\n        // IE 6 won't allow radio buttons to be selected unless they have a name\n        if (isRadio && !element.name)\n            ko.bindingHandlers['uniqueName']['init'](element, function() { return true });\n\n        // Set up two computeds to update the binding:\n\n        // The first responds to changes in the checkedValue value and to element clicks\n        ko.computed(updateModel, null, { disposeWhenNodeIsRemoved: element });\n        ko.utils.registerEventHandler(element, \"click\", updateModel);\n\n        // The second responds to changes in the model value (the one associated with the checked binding)\n        ko.computed(updateView, null, { disposeWhenNodeIsRemoved: element });\n\n        rawValue = undefined;\n    }\n};\nko.expressionRewriting.twoWayBindings['checked'] = true;\n\nko.bindingHandlers['checkedValue'] = {\n    'update': function (element, valueAccessor) {\n        element.value = ko.utils.unwrapObservable(valueAccessor());\n    }\n};\n\n})();var classesWrittenByBindingKey = '__ko__cssValue';\nko.bindingHandlers['class'] = {\n    'update': function (element, valueAccessor) {\n        var value = ko.utils.stringTrim(ko.utils.unwrapObservable(valueAccessor()));\n        ko.utils.toggleDomNodeCssClass(element, element[classesWrittenByBindingKey], false);\n        element[classesWrittenByBindingKey] = value;\n        ko.utils.toggleDomNodeCssClass(element, value, true);\n    }\n};\n\nko.bindingHandlers['css'] = {\n    'update': function (element, valueAccessor) {\n        var value = ko.utils.unwrapObservable(valueAccessor());\n        if (value !== null && typeof value == \"object\") {\n            ko.utils.objectForEach(value, function(className, shouldHaveClass) {\n                shouldHaveClass = ko.utils.unwrapObservable(shouldHaveClass);\n                ko.utils.toggleDomNodeCssClass(element, className, shouldHaveClass);\n            });\n        } else {\n            ko.bindingHandlers['class']['update'](element, valueAccessor);\n        }\n    }\n};\nko.bindingHandlers['enable'] = {\n    'update': function (element, valueAccessor) {\n        var value = ko.utils.unwrapObservable(valueAccessor());\n        if (value && element.disabled)\n            element.removeAttribute(\"disabled\");\n        else if ((!value) && (!element.disabled))\n            element.disabled = true;\n    }\n};\n\nko.bindingHandlers['disable'] = {\n    'update': function (element, valueAccessor) {\n        ko.bindingHandlers['enable']['update'](element, function() { return !ko.utils.unwrapObservable(valueAccessor()) });\n    }\n};\n// For certain common events (currently just 'click'), allow a simplified data-binding syntax\n// e.g. click:handler instead of the usual full-length event:{click:handler}\nfunction makeEventHandlerShortcut(eventName) {\n    ko.bindingHandlers[eventName] = {\n        'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n            var newValueAccessor = function () {\n                var result = {};\n                result[eventName] = valueAccessor();\n                return result;\n            };\n            return ko.bindingHandlers['event']['init'].call(this, element, newValueAccessor, allBindings, viewModel, bindingContext);\n        }\n    }\n}\n\nko.bindingHandlers['event'] = {\n    'init' : function (element, valueAccessor, allBindings, viewModel, bindingContext) {\n        var eventsToHandle = valueAccessor() || {};\n        ko.utils.objectForEach(eventsToHandle, function(eventName) {\n            if (typeof eventName == \"string\") {\n                ko.utils.registerEventHandler(element, eventName, function (event) {\n                    var handlerReturnValue;\n                    var handlerFunction = valueAccessor()[eventName];\n                    if (!handlerFunction)\n                        return;\n\n                    try {\n                        // Take all the event args, and prefix with the viewmodel\n                        var argsForHandler = ko.utils.makeArray(arguments);\n                        viewModel = bindingContext['$data'];\n                        argsForHandler.unshift(viewModel);\n                        handlerReturnValue = handlerFunction.apply(viewModel, argsForHandler);\n                    } finally {\n                        if (handlerReturnValue !== true) { // Normally we want to prevent default action. Developer can override this be explicitly returning true.\n                            if (event.preventDefault)\n                                event.preventDefault();\n                            else\n                                event.returnValue = false;\n                        }\n                    }\n\n                    var bubble = allBindings.get(eventName + 'Bubble') !== false;\n                    if (!bubble) {\n                        event.cancelBubble = true;\n                        if (event.stopPropagation)\n                            event.stopPropagation();\n                    }\n                });\n            }\n        });\n    }\n};\n// \"foreach: someExpression\" is equivalent to \"template: { foreach: someExpression }\"\n// \"foreach: { data: someExpression, afterAdd: myfn }\" is equivalent to \"template: { foreach: someExpression, afterAdd: myfn }\"\nko.bindingHandlers['foreach'] = {\n    makeTemplateValueAccessor: function(valueAccessor) {\n        return function() {\n            var modelValue = valueAccessor(),\n                unwrappedValue = ko.utils.peekObservable(modelValue);    // Unwrap without setting a dependency here\n\n            // If unwrappedValue is the array, pass in the wrapped value on its own\n            // The value will be unwrapped and tracked within the template binding\n            // (See https://github.com/SteveSanderson/knockout/issues/523)\n            if ((!unwrappedValue) || typeof unwrappedValue.length == \"number\")\n                return { 'foreach': modelValue, 'templateEngine': ko.nativeTemplateEngine.instance };\n\n            // If unwrappedValue.data is the array, preserve all relevant options and unwrap again value so we get updates\n            ko.utils.unwrapObservable(modelValue);\n            return {\n                'foreach': unwrappedValue['data'],\n                'as': unwrappedValue['as'],\n                'noChildContext': unwrappedValue['noChildContext'],\n                'includeDestroyed': unwrappedValue['includeDestroyed'],\n                'afterAdd': unwrappedValue['afterAdd'],\n                'beforeRemove': unwrappedValue['beforeRemove'],\n                'afterRender': unwrappedValue['afterRender'],\n                'beforeMove': unwrappedValue['beforeMove'],\n                'afterMove': unwrappedValue['afterMove'],\n                'templateEngine': ko.nativeTemplateEngine.instance\n            };\n        };\n    },\n    'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n        return ko.bindingHandlers['template']['init'](element, ko.bindingHandlers['foreach'].makeTemplateValueAccessor(valueAccessor));\n    },\n    'update': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n        return ko.bindingHandlers['template']['update'](element, ko.bindingHandlers['foreach'].makeTemplateValueAccessor(valueAccessor), allBindings, viewModel, bindingContext);\n    }\n};\nko.expressionRewriting.bindingRewriteValidators['foreach'] = false; // Can't rewrite control flow bindings\nko.virtualElements.allowedBindings['foreach'] = true;\nvar hasfocusUpdatingProperty = '__ko_hasfocusUpdating';\nvar hasfocusLastValue = '__ko_hasfocusLastValue';\nko.bindingHandlers['hasfocus'] = {\n    'init': function(element, valueAccessor, allBindings) {\n        var handleElementFocusChange = function(isFocused) {\n            // Where possible, ignore which event was raised and determine focus state using activeElement,\n            // as this avoids phantom focus/blur events raised when changing tabs in modern browsers.\n            // However, not all KO-targeted browsers (Firefox 2) support activeElement. For those browsers,\n            // prevent a loss of focus when changing tabs/windows by setting a flag that prevents hasfocus\n            // from calling 'blur()' on the element when it loses focus.\n            // Discussion at https://github.com/SteveSanderson/knockout/pull/352\n            element[hasfocusUpdatingProperty] = true;\n            var ownerDoc = element.ownerDocument;\n            if (\"activeElement\" in ownerDoc) {\n                var active;\n                try {\n                    active = ownerDoc.activeElement;\n                } catch(e) {\n                    // IE9 throws if you access activeElement during page load (see issue #703)\n                    active = ownerDoc.body;\n                }\n                isFocused = (active === element);\n            }\n            var modelValue = valueAccessor();\n            ko.expressionRewriting.writeValueToProperty(modelValue, allBindings, 'hasfocus', isFocused, true);\n\n            //cache the latest value, so we can avoid unnecessarily calling focus/blur in the update function\n            element[hasfocusLastValue] = isFocused;\n            element[hasfocusUpdatingProperty] = false;\n        };\n        var handleElementFocusIn = handleElementFocusChange.bind(null, true);\n        var handleElementFocusOut = handleElementFocusChange.bind(null, false);\n\n        ko.utils.registerEventHandler(element, \"focus\", handleElementFocusIn);\n        ko.utils.registerEventHandler(element, \"focusin\", handleElementFocusIn); // For IE\n        ko.utils.registerEventHandler(element, \"blur\",  handleElementFocusOut);\n        ko.utils.registerEventHandler(element, \"focusout\",  handleElementFocusOut); // For IE\n\n        // Assume element is not focused (prevents \"blur\" being called initially)\n        element[hasfocusLastValue] = false;\n    },\n    'update': function(element, valueAccessor) {\n        var value = !!ko.utils.unwrapObservable(valueAccessor());\n\n        if (!element[hasfocusUpdatingProperty] && element[hasfocusLastValue] !== value) {\n            value ? element.focus() : element.blur();\n\n            // In IE, the blur method doesn't always cause the element to lose focus (for example, if the window is not in focus).\n            // Setting focus to the body element does seem to be reliable in IE, but should only be used if we know that the current\n            // element was focused already.\n            if (!value && element[hasfocusLastValue]) {\n                element.ownerDocument.body.focus();\n            }\n\n            // For IE, which doesn't reliably fire \"focus\" or \"blur\" events synchronously\n            ko.dependencyDetection.ignore(ko.utils.triggerEvent, null, [element, value ? \"focusin\" : \"focusout\"]);\n        }\n    }\n};\nko.expressionRewriting.twoWayBindings['hasfocus'] = true;\n\nko.bindingHandlers['hasFocus'] = ko.bindingHandlers['hasfocus']; // Make \"hasFocus\" an alias\nko.expressionRewriting.twoWayBindings['hasFocus'] = 'hasfocus';\nko.bindingHandlers['html'] = {\n    'init': function() {\n        // Prevent binding on the dynamically-injected HTML (as developers are unlikely to expect that, and it has security implications)\n        return { 'controlsDescendantBindings': true };\n    },\n    'update': function (element, valueAccessor) {\n        // setHtml will unwrap the value if needed\n        ko.utils.setHtml(element, valueAccessor());\n    }\n};\n(function () {\n\n// Makes a binding like with or if\nfunction makeWithIfBinding(bindingKey, isWith, isNot) {\n    ko.bindingHandlers[bindingKey] = {\n        'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n            var didDisplayOnLastUpdate, savedNodes, contextOptions = {}, completeOnRender, needAsyncContext, renderOnEveryChange;\n\n            if (isWith) {\n                var as = allBindings.get('as'), noChildContext = allBindings.get('noChildContext');\n                renderOnEveryChange = !(as && noChildContext);\n                contextOptions = { 'as': as, 'noChildContext': noChildContext, 'exportDependencies': renderOnEveryChange };\n            }\n\n            completeOnRender = allBindings.get(\"completeOn\") == \"render\";\n            needAsyncContext = completeOnRender || allBindings['has'](ko.bindingEvent.descendantsComplete);\n\n            ko.computed(function() {\n                var value = ko.utils.unwrapObservable(valueAccessor()),\n                    shouldDisplay = !isNot !== !value, // equivalent to isNot ? !value : !!value,\n                    isInitial = !savedNodes,\n                    childContext;\n\n                if (!renderOnEveryChange && shouldDisplay === didDisplayOnLastUpdate) {\n                    return;\n                }\n\n                if (needAsyncContext) {\n                    bindingContext = ko.bindingEvent.startPossiblyAsyncContentBinding(element, bindingContext);\n                }\n\n                if (shouldDisplay) {\n                    if (!isWith || renderOnEveryChange) {\n                        contextOptions['dataDependency'] = ko.computedContext.computed();\n                    }\n\n                    if (isWith) {\n                        childContext = bindingContext['createChildContext'](typeof value == \"function\" ? value : valueAccessor, contextOptions);\n                    } else if (ko.computedContext.getDependenciesCount()) {\n                        childContext = bindingContext['extend'](null, contextOptions);\n                    } else {\n                        childContext = bindingContext;\n                    }\n                }\n\n                // Save a copy of the inner nodes on the initial update, but only if we have dependencies.\n                if (isInitial && ko.computedContext.getDependenciesCount()) {\n                    savedNodes = ko.utils.cloneNodes(ko.virtualElements.childNodes(element), true /* shouldCleanNodes */);\n                }\n\n                if (shouldDisplay) {\n                    if (!isInitial) {\n                        ko.virtualElements.setDomNodeChildren(element, ko.utils.cloneNodes(savedNodes));\n                    }\n\n                    ko.applyBindingsToDescendants(childContext, element);\n                } else {\n                    ko.virtualElements.emptyNode(element);\n\n                    if (!completeOnRender) {\n                        ko.bindingEvent.notify(element, ko.bindingEvent.childrenComplete);\n                    }\n                }\n\n                didDisplayOnLastUpdate = shouldDisplay;\n\n            }, null, { disposeWhenNodeIsRemoved: element });\n\n            return { 'controlsDescendantBindings': true };\n        }\n    };\n    ko.expressionRewriting.bindingRewriteValidators[bindingKey] = false; // Can't rewrite control flow bindings\n    ko.virtualElements.allowedBindings[bindingKey] = true;\n}\n\n// Construct the actual binding handlers\nmakeWithIfBinding('if');\nmakeWithIfBinding('ifnot', false /* isWith */, true /* isNot */);\nmakeWithIfBinding('with', true /* isWith */);\n\n})();ko.bindingHandlers['let'] = {\n    'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n        // Make a modified binding context, with extra properties, and apply it to descendant elements\n        var innerContext = bindingContext['extend'](valueAccessor);\n        ko.applyBindingsToDescendants(innerContext, element);\n\n        return { 'controlsDescendantBindings': true };\n    }\n};\nko.virtualElements.allowedBindings['let'] = true;\nvar captionPlaceholder = {};\nko.bindingHandlers['options'] = {\n    'init': function(element) {\n        if (ko.utils.tagNameLower(element) !== \"select\")\n            throw new Error(\"options binding applies only to SELECT elements\");\n\n        // Remove all existing <option>s.\n        while (element.length > 0) {\n            element.remove(0);\n        }\n\n        // Ensures that the binding processor doesn't try to bind the options\n        return { 'controlsDescendantBindings': true };\n    },\n    'update': function (element, valueAccessor, allBindings) {\n        function selectedOptions() {\n            return ko.utils.arrayFilter(element.options, function (node) { return node.selected; });\n        }\n\n        var selectWasPreviouslyEmpty = element.length == 0,\n            multiple = element.multiple,\n            previousScrollTop = (!selectWasPreviouslyEmpty && multiple) ? element.scrollTop : null,\n            unwrappedArray = ko.utils.unwrapObservable(valueAccessor()),\n            valueAllowUnset = allBindings.get('valueAllowUnset') && allBindings['has']('value'),\n            includeDestroyed = allBindings.get('optionsIncludeDestroyed'),\n            arrayToDomNodeChildrenOptions = {},\n            captionValue,\n            filteredArray,\n            previousSelectedValues = [];\n\n        if (!valueAllowUnset) {\n            if (multiple) {\n                previousSelectedValues = ko.utils.arrayMap(selectedOptions(), ko.selectExtensions.readValue);\n            } else if (element.selectedIndex >= 0) {\n                previousSelectedValues.push(ko.selectExtensions.readValue(element.options[element.selectedIndex]));\n            }\n        }\n\n        if (unwrappedArray) {\n            if (typeof unwrappedArray.length == \"undefined\") // Coerce single value into array\n                unwrappedArray = [unwrappedArray];\n\n            // Filter out any entries marked as destroyed\n            filteredArray = ko.utils.arrayFilter(unwrappedArray, function(item) {\n                return includeDestroyed || item === undefined || item === null || !ko.utils.unwrapObservable(item['_destroy']);\n            });\n\n            // If caption is included, add it to the array\n            if (allBindings['has']('optionsCaption')) {\n                captionValue = ko.utils.unwrapObservable(allBindings.get('optionsCaption'));\n                // If caption value is null or undefined, don't show a caption\n                if (captionValue !== null && captionValue !== undefined) {\n                    filteredArray.unshift(captionPlaceholder);\n                }\n            }\n        } else {\n            // If a falsy value is provided (e.g. null), we'll simply empty the select element\n        }\n\n        function applyToObject(object, predicate, defaultValue) {\n            var predicateType = typeof predicate;\n            if (predicateType == \"function\")    // Given a function; run it against the data value\n                return predicate(object);\n            else if (predicateType == \"string\") // Given a string; treat it as a property name on the data value\n                return object[predicate];\n            else                                // Given no optionsText arg; use the data value itself\n                return defaultValue;\n        }\n\n        // The following functions can run at two different times:\n        // The first is when the whole array is being updated directly from this binding handler.\n        // The second is when an observable value for a specific array entry is updated.\n        // oldOptions will be empty in the first case, but will be filled with the previously generated option in the second.\n        var itemUpdate = false;\n        function optionForArrayItem(arrayEntry, index, oldOptions) {\n            if (oldOptions.length) {\n                previousSelectedValues = !valueAllowUnset && oldOptions[0].selected ? [ ko.selectExtensions.readValue(oldOptions[0]) ] : [];\n                itemUpdate = true;\n            }\n            var option = element.ownerDocument.createElement(\"option\");\n            if (arrayEntry === captionPlaceholder) {\n                ko.utils.setTextContent(option, allBindings.get('optionsCaption'));\n                ko.selectExtensions.writeValue(option, undefined);\n            } else {\n                // Apply a value to the option element\n                var optionValue = applyToObject(arrayEntry, allBindings.get('optionsValue'), arrayEntry);\n                ko.selectExtensions.writeValue(option, ko.utils.unwrapObservable(optionValue));\n\n                // Apply some text to the option element\n                var optionText = applyToObject(arrayEntry, allBindings.get('optionsText'), optionValue);\n                ko.utils.setTextContent(option, optionText);\n            }\n            return [option];\n        }\n\n        // By using a beforeRemove callback, we delay the removal until after new items are added. This fixes a selection\n        // problem in IE<=8 and Firefox. See https://github.com/knockout/knockout/issues/1208\n        arrayToDomNodeChildrenOptions['beforeRemove'] =\n            function (option) {\n                element.removeChild(option);\n            };\n\n        function setSelectionCallback(arrayEntry, newOptions) {\n            if (itemUpdate && valueAllowUnset) {\n                // The model value is authoritative, so make sure its value is the one selected\n                // There is no need to use dependencyDetection.ignore since setDomNodeChildrenFromArrayMapping does so already.\n                ko.selectExtensions.writeValue(element, ko.utils.unwrapObservable(allBindings.get('value')), true /* allowUnset */);\n            } else if (previousSelectedValues.length) {\n                // IE6 doesn't like us to assign selection to OPTION nodes before they're added to the document.\n                // That's why we first added them without selection. Now it's time to set the selection.\n                var isSelected = ko.utils.arrayIndexOf(previousSelectedValues, ko.selectExtensions.readValue(newOptions[0])) >= 0;\n                ko.utils.setOptionNodeSelectionState(newOptions[0], isSelected);\n\n                // If this option was changed from being selected during a single-item update, notify the change\n                if (itemUpdate && !isSelected) {\n                    ko.dependencyDetection.ignore(ko.utils.triggerEvent, null, [element, \"change\"]);\n                }\n            }\n        }\n\n        var callback = setSelectionCallback;\n        if (allBindings['has']('optionsAfterRender') && typeof allBindings.get('optionsAfterRender') == \"function\") {\n            callback = function(arrayEntry, newOptions) {\n                setSelectionCallback(arrayEntry, newOptions);\n                ko.dependencyDetection.ignore(allBindings.get('optionsAfterRender'), null, [newOptions[0], arrayEntry !== captionPlaceholder ? arrayEntry : undefined]);\n            }\n        }\n\n        ko.utils.setDomNodeChildrenFromArrayMapping(element, filteredArray, optionForArrayItem, arrayToDomNodeChildrenOptions, callback);\n\n        ko.dependencyDetection.ignore(function () {\n            if (valueAllowUnset) {\n                // The model value is authoritative, so make sure its value is the one selected\n                ko.selectExtensions.writeValue(element, ko.utils.unwrapObservable(allBindings.get('value')), true /* allowUnset */);\n            } else {\n                // Determine if the selection has changed as a result of updating the options list\n                var selectionChanged;\n                if (multiple) {\n                    // For a multiple-select box, compare the new selection count to the previous one\n                    // But if nothing was selected before, the selection can't have changed\n                    selectionChanged = previousSelectedValues.length && selectedOptions().length < previousSelectedValues.length;\n                } else {\n                    // For a single-select box, compare the current value to the previous value\n                    // But if nothing was selected before or nothing is selected now, just look for a change in selection\n                    selectionChanged = (previousSelectedValues.length && element.selectedIndex >= 0)\n                        ? (ko.selectExtensions.readValue(element.options[element.selectedIndex]) !== previousSelectedValues[0])\n                        : (previousSelectedValues.length || element.selectedIndex >= 0);\n                }\n\n                // Ensure consistency between model value and selected option.\n                // If the dropdown was changed so that selection is no longer the same,\n                // notify the value or selectedOptions binding.\n                if (selectionChanged) {\n                    ko.utils.triggerEvent(element, \"change\");\n                }\n            }\n        });\n\n        // Workaround for IE bug\n        ko.utils.ensureSelectElementIsRenderedCorrectly(element);\n\n        if (previousScrollTop && Math.abs(previousScrollTop - element.scrollTop) > 20)\n            element.scrollTop = previousScrollTop;\n    }\n};\nko.bindingHandlers['options'].optionValueDomDataKey = ko.utils.domData.nextKey();\nko.bindingHandlers['selectedOptions'] = {\n    'after': ['options', 'foreach'],\n    'init': function (element, valueAccessor, allBindings) {\n        ko.utils.registerEventHandler(element, \"change\", function () {\n            var value = valueAccessor(), valueToWrite = [];\n            ko.utils.arrayForEach(element.getElementsByTagName(\"option\"), function(node) {\n                if (node.selected)\n                    valueToWrite.push(ko.selectExtensions.readValue(node));\n            });\n            ko.expressionRewriting.writeValueToProperty(value, allBindings, 'selectedOptions', valueToWrite);\n        });\n    },\n    'update': function (element, valueAccessor) {\n        if (ko.utils.tagNameLower(element) != \"select\")\n            throw new Error(\"values binding applies only to SELECT elements\");\n\n        var newValue = ko.utils.unwrapObservable(valueAccessor()),\n            previousScrollTop = element.scrollTop;\n\n        if (newValue && typeof newValue.length == \"number\") {\n            ko.utils.arrayForEach(element.getElementsByTagName(\"option\"), function(node) {\n                var isSelected = ko.utils.arrayIndexOf(newValue, ko.selectExtensions.readValue(node)) >= 0;\n                if (node.selected != isSelected) {      // This check prevents flashing of the select element in IE\n                    ko.utils.setOptionNodeSelectionState(node, isSelected);\n                }\n            });\n        }\n\n        element.scrollTop = previousScrollTop;\n    }\n};\nko.expressionRewriting.twoWayBindings['selectedOptions'] = true;\nko.bindingHandlers['style'] = {\n    'update': function (element, valueAccessor) {\n        var value = ko.utils.unwrapObservable(valueAccessor() || {});\n        ko.utils.objectForEach(value, function(styleName, styleValue) {\n            styleValue = ko.utils.unwrapObservable(styleValue);\n\n            if (styleValue === null || styleValue === undefined || styleValue === false) {\n                // Empty string removes the value, whereas null/undefined have no effect\n                styleValue = \"\";\n            }\n\n            if (jQueryInstance) {\n                jQueryInstance(element)['css'](styleName, styleValue);\n            } else if (/^--/.test(styleName)) {\n                // Is styleName a custom CSS property?\n                element.style.setProperty(styleName, styleValue);\n            } else {\n                styleName = styleName.replace(/-(\\w)/g, function (all, letter) {\n                    return letter.toUpperCase();\n                });\n\n                var previousStyle = element.style[styleName];\n                element.style[styleName] = styleValue;\n\n                if (styleValue !== previousStyle && element.style[styleName] == previousStyle && !isNaN(styleValue)) {\n                    element.style[styleName] = styleValue + \"px\";\n                }\n            }\n        });\n    }\n};\nko.bindingHandlers['submit'] = {\n    'init': function (element, valueAccessor, allBindings, viewModel, bindingContext) {\n        if (typeof valueAccessor() != \"function\")\n            throw new Error(\"The value for a submit binding must be a function\");\n        ko.utils.registerEventHandler(element, \"submit\", function (event) {\n            var handlerReturnValue;\n            var value = valueAccessor();\n            try { handlerReturnValue = value.call(bindingContext['$data'], element); }\n            finally {\n                if (handlerReturnValue !== true) { // Normally we want to prevent default action. Developer can override this be explicitly returning true.\n                    if (event.preventDefault)\n                        event.preventDefault();\n                    else\n                        event.returnValue = false;\n                }\n            }\n        });\n    }\n};\nko.bindingHandlers['text'] = {\n    'init': function() {\n        // Prevent binding on the dynamically-injected text node (as developers are unlikely to expect that, and it has security implications).\n        // It should also make things faster, as we no longer have to consider whether the text node might be bindable.\n        return { 'controlsDescendantBindings': true };\n    },\n    'update': function (element, valueAccessor) {\n        ko.utils.setTextContent(element, valueAccessor());\n    }\n};\nko.virtualElements.allowedBindings['text'] = true;\n(function () {\n\nif (window && window.navigator) {\n    var parseVersion = function (matches) {\n        if (matches) {\n            return parseFloat(matches[1]);\n        }\n    };\n\n    // Detect various browser versions because some old versions don't fully support the 'input' event\n    var userAgent = window.navigator.userAgent,\n        operaVersion, chromeVersion, safariVersion, firefoxVersion, ieVersion, edgeVersion;\n\n    (operaVersion = window.opera && window.opera.version && parseInt(window.opera.version()))\n        || (edgeVersion = parseVersion(userAgent.match(/Edge\\/([^ ]+)$/)))\n        || (chromeVersion = parseVersion(userAgent.match(/Chrome\\/([^ ]+)/)))\n        || (safariVersion = parseVersion(userAgent.match(/Version\\/([^ ]+) Safari/)))\n        || (firefoxVersion = parseVersion(userAgent.match(/Firefox\\/([^ ]+)/)))\n        || (ieVersion = ko.utils.ieVersion || parseVersion(userAgent.match(/MSIE ([^ ]+)/)))      // Detects up to IE 10\n        || (ieVersion = parseVersion(userAgent.match(/rv:([^ )]+)/)));      // Detects IE 11\n}\n\n// IE 8 and 9 have bugs that prevent the normal events from firing when the value changes.\n// But it does fire the 'selectionchange' event on many of those, presumably because the\n// cursor is moving and that counts as the selection changing. The 'selectionchange' event is\n// fired at the document level only and doesn't directly indicate which element changed. We\n// set up just one event handler for the document and use 'activeElement' to determine which\n// element was changed.\nif (ieVersion >= 8 && ieVersion < 10) {\n    var selectionChangeRegisteredName = ko.utils.domData.nextKey(),\n        selectionChangeHandlerName = ko.utils.domData.nextKey();\n    var selectionChangeHandler = function(event) {\n        var target = this.activeElement,\n            handler = target && ko.utils.domData.get(target, selectionChangeHandlerName);\n        if (handler) {\n            handler(event);\n        }\n    };\n    var registerForSelectionChangeEvent = function (element, handler) {\n        var ownerDoc = element.ownerDocument;\n        if (!ko.utils.domData.get(ownerDoc, selectionChangeRegisteredName)) {\n            ko.utils.domData.set(ownerDoc, selectionChangeRegisteredName, true);\n            ko.utils.registerEventHandler(ownerDoc, 'selectionchange', selectionChangeHandler);\n        }\n        ko.utils.domData.set(element, selectionChangeHandlerName, handler);\n    };\n}\n\nko.bindingHandlers['textInput'] = {\n    'init': function (element, valueAccessor, allBindings) {\n\n        var previousElementValue = element.value,\n            timeoutHandle,\n            elementValueBeforeEvent;\n\n        var updateModel = function (event) {\n            clearTimeout(timeoutHandle);\n            elementValueBeforeEvent = timeoutHandle = undefined;\n\n            var elementValue = element.value;\n            if (previousElementValue !== elementValue) {\n                // Provide a way for tests to know exactly which event was processed\n                if (DEBUG && event) element['_ko_textInputProcessedEvent'] = event.type;\n                previousElementValue = elementValue;\n                ko.expressionRewriting.writeValueToProperty(valueAccessor(), allBindings, 'textInput', elementValue);\n            }\n        };\n\n        var deferUpdateModel = function (event) {\n            if (!timeoutHandle) {\n                // The elementValueBeforeEvent variable is set *only* during the brief gap between an\n                // event firing and the updateModel function running. This allows us to ignore model\n                // updates that are from the previous state of the element, usually due to techniques\n                // such as rateLimit. Such updates, if not ignored, can cause keystrokes to be lost.\n                elementValueBeforeEvent = element.value;\n                var handler = DEBUG ? updateModel.bind(element, {type: event.type}) : updateModel;\n                timeoutHandle = ko.utils.setTimeout(handler, 4);\n            }\n        };\n\n        // IE9 will mess up the DOM if you handle events synchronously which results in DOM changes (such as other bindings);\n        // so we'll make sure all updates are asynchronous\n        var ieUpdateModel = ko.utils.ieVersion == 9 ? deferUpdateModel : updateModel,\n            ourUpdate = false;\n\n        var updateView = function () {\n            var modelValue = ko.utils.unwrapObservable(valueAccessor());\n\n            if (modelValue === null || modelValue === undefined) {\n                modelValue = '';\n            }\n\n            if (elementValueBeforeEvent !== undefined && modelValue === elementValueBeforeEvent) {\n                ko.utils.setTimeout(updateView, 4);\n                return;\n            }\n\n            // Update the element only if the element and model are different. On some browsers, updating the value\n            // will move the cursor to the end of the input, which would be bad while the user is typing.\n            if (element.value !== modelValue) {\n                ourUpdate = true;  // Make sure we ignore events (propertychange) that result from updating the value\n                element.value = modelValue;\n                ourUpdate = false;\n                previousElementValue = element.value; // In case the browser changes the value (see #2281)\n            }\n        };\n\n        var onEvent = function (event, handler) {\n            ko.utils.registerEventHandler(element, event, handler);\n        };\n\n        if (DEBUG && ko.bindingHandlers['textInput']['_forceUpdateOn']) {\n            // Provide a way for tests to specify exactly which events are bound\n            ko.utils.arrayForEach(ko.bindingHandlers['textInput']['_forceUpdateOn'], function(eventName) {\n                if (eventName.slice(0,5) == 'after') {\n                    onEvent(eventName.slice(5), deferUpdateModel);\n                } else {\n                    onEvent(eventName, updateModel);\n                }\n            });\n        } else {\n            if (ieVersion) {\n                // All versions (including 11) of Internet Explorer have a bug that they don't generate an input or propertychange event when ESC is pressed\n                onEvent('keypress', updateModel);\n            }\n            if (ieVersion < 11) {\n                // Internet Explorer <= 8 doesn't support the 'input' event, but does include 'propertychange' that fires whenever\n                // any property of an element changes. Unlike 'input', it also fires if a property is changed from JavaScript code,\n                // but that's an acceptable compromise for this binding. IE 9 and 10 support 'input', but since they don't always\n                // fire it when using autocomplete, we'll use 'propertychange' for them also.\n                onEvent('propertychange', function(event) {\n                    if (!ourUpdate && event.propertyName === 'value') {\n                        ieUpdateModel(event);\n                    }\n                });\n            }\n            if (ieVersion == 8) {\n                // IE 8 has a bug where it fails to fire 'propertychange' on the first update following a value change from\n                // JavaScript code. It also doesn't fire if you clear the entire value. To fix this, we bind to the following\n                // events too.\n                onEvent('keyup', updateModel);      // A single keystoke\n                onEvent('keydown', updateModel);    // The first character when a key is held down\n            }\n            if (registerForSelectionChangeEvent) {\n                // Internet Explorer 9 doesn't fire the 'input' event when deleting text, including using\n                // the backspace, delete, or ctrl-x keys, clicking the 'x' to clear the input, dragging text\n                // out of the field, and cutting or deleting text using the context menu. 'selectionchange'\n                // can detect all of those except dragging text out of the field, for which we use 'dragend'.\n                // These are also needed in IE8 because of the bug described above.\n                registerForSelectionChangeEvent(element, ieUpdateModel);  // 'selectionchange' covers cut, paste, drop, delete, etc.\n                onEvent('dragend', deferUpdateModel);\n            }\n\n            if (!ieVersion || ieVersion >= 9) {\n                // All other supported browsers support the 'input' event, which fires whenever the content of the element is changed\n                // through the user interface.\n                onEvent('input', ieUpdateModel);\n            }\n\n            if (safariVersion < 5 && ko.utils.tagNameLower(element) === \"textarea\") {\n                // Safari <5 doesn't fire the 'input' event for <textarea> elements (it does fire 'textInput'\n                // but only when typing). So we'll just catch as much as we can with keydown, cut, and paste.\n                onEvent('keydown', deferUpdateModel);\n                onEvent('paste', deferUpdateModel);\n                onEvent('cut', deferUpdateModel);\n            } else if (operaVersion < 11) {\n                // Opera 10 doesn't always fire the 'input' event for cut, paste, undo & drop operations.\n                // We can try to catch some of those using 'keydown'.\n                onEvent('keydown', deferUpdateModel);\n            } else if (firefoxVersion < 4.0) {\n                // Firefox <= 3.6 doesn't fire the 'input' event when text is filled in through autocomplete\n                onEvent('DOMAutoComplete', updateModel);\n\n                // Firefox <=3.5 doesn't fire the 'input' event when text is dropped into the input.\n                onEvent('dragdrop', updateModel);       // <3.5\n                onEvent('drop', updateModel);           // 3.5\n            } else if (edgeVersion && element.type === \"number\") {\n                // Microsoft Edge doesn't fire 'input' or 'change' events for number inputs when\n                // the value is changed via the up / down arrow keys\n                onEvent('keydown', deferUpdateModel);\n            }\n        }\n\n        // Bind to the change event so that we can catch programmatic updates of the value that fire this event.\n        onEvent('change', updateModel);\n\n        // To deal with browsers that don't notify any kind of event for some changes (IE, Safari, etc.)\n        onEvent('blur', updateModel);\n\n        ko.computed(updateView, null, { disposeWhenNodeIsRemoved: element });\n    }\n};\nko.expressionRewriting.twoWayBindings['textInput'] = true;\n\n// textinput is an alias for textInput\nko.bindingHandlers['textinput'] = {\n    // preprocess is the only way to set up a full alias\n    'preprocess': function (value, name, addBinding) {\n        addBinding('textInput', value);\n    }\n};\n\n})();ko.bindingHandlers['uniqueName'] = {\n    'init': function (element, valueAccessor) {\n        if (valueAccessor()) {\n            var name = \"ko_unique_\" + (++ko.bindingHandlers['uniqueName'].currentIndex);\n            ko.utils.setElementName(element, name);\n        }\n    }\n};\nko.bindingHandlers['uniqueName'].currentIndex = 0;\nko.bindingHandlers['using'] = {\n    'init': function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n        var options;\n\n        if (allBindings['has']('as')) {\n            options = { 'as': allBindings.get('as'), 'noChildContext': allBindings.get('noChildContext') };\n        }\n\n        var innerContext = bindingContext['createChildContext'](valueAccessor, options);\n        ko.applyBindingsToDescendants(innerContext, element);\n\n        return { 'controlsDescendantBindings': true };\n    }\n};\nko.virtualElements.allowedBindings['using'] = true;\nko.bindingHandlers['value'] = {\n    'after': ['options', 'foreach'],\n    'init': function (element, valueAccessor, allBindings) {\n        var tagName = ko.utils.tagNameLower(element),\n            isInputElement = tagName == \"input\";\n\n        // If the value binding is placed on a radio/checkbox, then just pass through to checkedValue and quit\n        if (isInputElement && (element.type == \"checkbox\" || element.type == \"radio\")) {\n            ko.applyBindingAccessorsToNode(element, { 'checkedValue': valueAccessor });\n            return;\n        }\n\n        // Always catch \"change\" event; possibly other events too if asked\n        var eventsToCatch = [\"change\"];\n        var requestedEventsToCatch = allBindings.get(\"valueUpdate\");\n        var propertyChangedFired = false;\n        var elementValueBeforeEvent = null;\n\n        if (requestedEventsToCatch) {\n            if (typeof requestedEventsToCatch == \"string\") // Allow both individual event names, and arrays of event names\n                requestedEventsToCatch = [requestedEventsToCatch];\n            ko.utils.arrayPushAll(eventsToCatch, requestedEventsToCatch);\n            eventsToCatch = ko.utils.arrayGetDistinctValues(eventsToCatch);\n        }\n\n        var valueUpdateHandler = function() {\n            elementValueBeforeEvent = null;\n            propertyChangedFired = false;\n            var modelValue = valueAccessor();\n            var elementValue = ko.selectExtensions.readValue(element);\n            ko.expressionRewriting.writeValueToProperty(modelValue, allBindings, 'value', elementValue);\n        }\n\n        // Workaround for https://github.com/SteveSanderson/knockout/issues/122\n        // IE doesn't fire \"change\" events on textboxes if the user selects a value from its autocomplete list\n        var ieAutoCompleteHackNeeded = ko.utils.ieVersion && isInputElement && element.type == \"text\"\n                                       && element.autocomplete != \"off\" && (!element.form || element.form.autocomplete != \"off\");\n        if (ieAutoCompleteHackNeeded && ko.utils.arrayIndexOf(eventsToCatch, \"propertychange\") == -1) {\n            ko.utils.registerEventHandler(element, \"propertychange\", function () { propertyChangedFired = true });\n            ko.utils.registerEventHandler(element, \"focus\", function () { propertyChangedFired = false });\n            ko.utils.registerEventHandler(element, \"blur\", function() {\n                if (propertyChangedFired) {\n                    valueUpdateHandler();\n                }\n            });\n        }\n\n        ko.utils.arrayForEach(eventsToCatch, function(eventName) {\n            // The syntax \"after<eventname>\" means \"run the handler asynchronously after the event\"\n            // This is useful, for example, to catch \"keydown\" events after the browser has updated the control\n            // (otherwise, ko.selectExtensions.readValue(this) will receive the control's value *before* the key event)\n            var handler = valueUpdateHandler;\n            if (ko.utils.stringStartsWith(eventName, \"after\")) {\n                handler = function() {\n                    // The elementValueBeforeEvent variable is non-null *only* during the brief gap between\n                    // a keyX event firing and the valueUpdateHandler running, which is scheduled to happen\n                    // at the earliest asynchronous opportunity. We store this temporary information so that\n                    // if, between keyX and valueUpdateHandler, the underlying model value changes separately,\n                    // we can overwrite that model value change with the value the user just typed. Otherwise,\n                    // techniques like rateLimit can trigger model changes at critical moments that will\n                    // override the user's inputs, causing keystrokes to be lost.\n                    elementValueBeforeEvent = ko.selectExtensions.readValue(element);\n                    ko.utils.setTimeout(valueUpdateHandler, 0);\n                };\n                eventName = eventName.substring(\"after\".length);\n            }\n            ko.utils.registerEventHandler(element, eventName, handler);\n        });\n\n        var updateFromModel;\n\n        if (isInputElement && element.type == \"file\") {\n            // For file input elements, can only write the empty string\n            updateFromModel = function () {\n                var newValue = ko.utils.unwrapObservable(valueAccessor());\n                if (newValue === null || newValue === undefined || newValue === \"\") {\n                    element.value = \"\";\n                } else {\n                    ko.dependencyDetection.ignore(valueUpdateHandler);  // reset the model to match the element\n                }\n            }\n        } else {\n            updateFromModel = function () {\n                var newValue = ko.utils.unwrapObservable(valueAccessor());\n                var elementValue = ko.selectExtensions.readValue(element);\n\n                if (elementValueBeforeEvent !== null && newValue === elementValueBeforeEvent) {\n                    ko.utils.setTimeout(updateFromModel, 0);\n                    return;\n                }\n\n                var valueHasChanged = newValue !== elementValue;\n\n                if (valueHasChanged || elementValue === undefined) {\n                    if (tagName === \"select\") {\n                        var allowUnset = allBindings.get('valueAllowUnset');\n                        ko.selectExtensions.writeValue(element, newValue, allowUnset);\n                        if (!allowUnset && newValue !== ko.selectExtensions.readValue(element)) {\n                            // If you try to set a model value that can't be represented in an already-populated dropdown, reject that change,\n                            // because you're not allowed to have a model value that disagrees with a visible UI selection.\n                            ko.dependencyDetection.ignore(valueUpdateHandler);\n                        }\n                    } else {\n                        ko.selectExtensions.writeValue(element, newValue);\n                    }\n                }\n            };\n        }\n\n        ko.computed(updateFromModel, null, { disposeWhenNodeIsRemoved: element });\n    },\n    'update': function() {} // Keep for backwards compatibility with code that may have wrapped value binding\n};\nko.expressionRewriting.twoWayBindings['value'] = true;\nko.bindingHandlers['visible'] = {\n    'update': function (element, valueAccessor) {\n        var value = ko.utils.unwrapObservable(valueAccessor());\n        var isCurrentlyVisible = !(element.style.display == \"none\");\n        if (value && !isCurrentlyVisible)\n            element.style.display = \"\";\n        else if ((!value) && isCurrentlyVisible)\n            element.style.display = \"none\";\n    }\n};\n\nko.bindingHandlers['hidden'] = {\n    'update': function (element, valueAccessor) {\n        ko.bindingHandlers['visible']['update'](element, function() { return !ko.utils.unwrapObservable(valueAccessor()) });\n    }\n};\n// 'click' is just a shorthand for the usual full-length event:{click:handler}\nmakeEventHandlerShortcut('click');\n// If you want to make a custom template engine,\n//\n// [1] Inherit from this class (like ko.nativeTemplateEngine does)\n// [2] Override 'renderTemplateSource', supplying a function with this signature:\n//\n//        function (templateSource, bindingContext, options) {\n//            // - templateSource.text() is the text of the template you should render\n//            // - bindingContext.$data is the data you should pass into the template\n//            //   - you might also want to make bindingContext.$parent, bindingContext.$parents,\n//            //     and bindingContext.$root available in the template too\n//            // - options gives you access to any other properties set on \"data-bind: { template: options }\"\n//            // - templateDocument is the document object of the template\n//            //\n//            // Return value: an array of DOM nodes\n//        }\n//\n// [3] Override 'createJavaScriptEvaluatorBlock', supplying a function with this signature:\n//\n//        function (script) {\n//            // Return value: Whatever syntax means \"Evaluate the JavaScript statement 'script' and output the result\"\n//            //               For example, the jquery.tmpl template engine converts 'someScript' to '${ someScript }'\n//        }\n//\n//     This is only necessary if you want to allow data-bind attributes to reference arbitrary template variables.\n//     If you don't want to allow that, you can set the property 'allowTemplateRewriting' to false (like ko.nativeTemplateEngine does)\n//     and then you don't need to override 'createJavaScriptEvaluatorBlock'.\n\nko.templateEngine = function () { };\n\nko.templateEngine.prototype['renderTemplateSource'] = function (templateSource, bindingContext, options, templateDocument) {\n    throw new Error(\"Override renderTemplateSource\");\n};\n\nko.templateEngine.prototype['createJavaScriptEvaluatorBlock'] = function (script) {\n    throw new Error(\"Override createJavaScriptEvaluatorBlock\");\n};\n\nko.templateEngine.prototype['makeTemplateSource'] = function(template, templateDocument) {\n    // Named template\n    if (typeof template == \"string\") {\n        templateDocument = templateDocument || document;\n        var elem = templateDocument.getElementById(template);\n        if (!elem)\n            throw new Error(\"Cannot find template with ID \" + template);\n        return new ko.templateSources.domElement(elem);\n    } else if ((template.nodeType == 1) || (template.nodeType == 8)) {\n        // Anonymous template\n        return new ko.templateSources.anonymousTemplate(template);\n    } else\n        throw new Error(\"Unknown template type: \" + template);\n};\n\nko.templateEngine.prototype['renderTemplate'] = function (template, bindingContext, options, templateDocument) {\n    var templateSource = this['makeTemplateSource'](template, templateDocument);\n    return this['renderTemplateSource'](templateSource, bindingContext, options, templateDocument);\n};\n\nko.templateEngine.prototype['isTemplateRewritten'] = function (template, templateDocument) {\n    // Skip rewriting if requested\n    if (this['allowTemplateRewriting'] === false)\n        return true;\n    return this['makeTemplateSource'](template, templateDocument)['data'](\"isRewritten\");\n};\n\nko.templateEngine.prototype['rewriteTemplate'] = function (template, rewriterCallback, templateDocument) {\n    var templateSource = this['makeTemplateSource'](template, templateDocument);\n    var rewritten = rewriterCallback(templateSource['text']());\n    templateSource['text'](rewritten);\n    templateSource['data'](\"isRewritten\", true);\n};\n\nko.exportSymbol('templateEngine', ko.templateEngine);\n\nko.templateRewriting = (function () {\n    var memoizeDataBindingAttributeSyntaxRegex = /(<([a-z]+\\d*)(?:\\s+(?!data-bind\\s*=\\s*)[a-z0-9\\-]+(?:=(?:\\\"[^\\\"]*\\\"|\\'[^\\']*\\'|[^>]*))?)*\\s+)data-bind\\s*=\\s*([\"'])([\\s\\S]*?)\\3/gi;\n    var memoizeVirtualContainerBindingSyntaxRegex = /<!--\\s*ko\\b\\s*([\\s\\S]*?)\\s*-->/g;\n\n    function validateDataBindValuesForRewriting(keyValueArray) {\n        var allValidators = ko.expressionRewriting.bindingRewriteValidators;\n        for (var i = 0; i < keyValueArray.length; i++) {\n            var key = keyValueArray[i]['key'];\n            if (Object.prototype.hasOwnProperty.call(allValidators, key)) {\n                var validator = allValidators[key];\n\n                if (typeof validator === \"function\") {\n                    var possibleErrorMessage = validator(keyValueArray[i]['value']);\n                    if (possibleErrorMessage)\n                        throw new Error(possibleErrorMessage);\n                } else if (!validator) {\n                    throw new Error(\"This template engine does not support the '\" + key + \"' binding within its templates\");\n                }\n            }\n        }\n    }\n\n    function constructMemoizedTagReplacement(dataBindAttributeValue, tagToRetain, nodeName, templateEngine) {\n        var dataBindKeyValueArray = ko.expressionRewriting.parseObjectLiteral(dataBindAttributeValue);\n        validateDataBindValuesForRewriting(dataBindKeyValueArray);\n        var rewrittenDataBindAttributeValue = ko.expressionRewriting.preProcessBindings(dataBindKeyValueArray, {'valueAccessors':true});\n\n        // For no obvious reason, Opera fails to evaluate rewrittenDataBindAttributeValue unless it's wrapped in an additional\n        // anonymous function, even though Opera's built-in debugger can evaluate it anyway. No other browser requires this\n        // extra indirection.\n        var applyBindingsToNextSiblingScript =\n            \"ko.__tr_ambtns(function($context,$element){return(function(){return{ \" + rewrittenDataBindAttributeValue + \" } })()},'\" + nodeName.toLowerCase() + \"')\";\n        return templateEngine['createJavaScriptEvaluatorBlock'](applyBindingsToNextSiblingScript) + tagToRetain;\n    }\n\n    return {\n        ensureTemplateIsRewritten: function (template, templateEngine, templateDocument) {\n            if (!templateEngine['isTemplateRewritten'](template, templateDocument))\n                templateEngine['rewriteTemplate'](template, function (htmlString) {\n                    return ko.templateRewriting.memoizeBindingAttributeSyntax(htmlString, templateEngine);\n                }, templateDocument);\n        },\n\n        memoizeBindingAttributeSyntax: function (htmlString, templateEngine) {\n            return htmlString.replace(memoizeDataBindingAttributeSyntaxRegex, function () {\n                return constructMemoizedTagReplacement(/* dataBindAttributeValue: */ arguments[4], /* tagToRetain: */ arguments[1], /* nodeName: */ arguments[2], templateEngine);\n            }).replace(memoizeVirtualContainerBindingSyntaxRegex, function() {\n                return constructMemoizedTagReplacement(/* dataBindAttributeValue: */ arguments[1], /* tagToRetain: */ \"<!-- ko -->\", /* nodeName: */ \"#comment\", templateEngine);\n            });\n        },\n\n        applyMemoizedBindingsToNextSibling: function (bindings, nodeName) {\n            return ko.memoization.memoize(function (domNode, bindingContext) {\n                var nodeToBind = domNode.nextSibling;\n                if (nodeToBind && nodeToBind.nodeName.toLowerCase() === nodeName) {\n                    ko.applyBindingAccessorsToNode(nodeToBind, bindings, bindingContext);\n                }\n            });\n        }\n    }\n})();\n\n\n// Exported only because it has to be referenced by string lookup from within rewritten template\nko.exportSymbol('__tr_ambtns', ko.templateRewriting.applyMemoizedBindingsToNextSibling);\n(function() {\n    // A template source represents a read/write way of accessing a template. This is to eliminate the need for template loading/saving\n    // logic to be duplicated in every template engine (and means they can all work with anonymous templates, etc.)\n    //\n    // Two are provided by default:\n    //  1. ko.templateSources.domElement       - reads/writes the text content of an arbitrary DOM element\n    //  2. ko.templateSources.anonymousElement - uses ko.utils.domData to read/write text *associated* with the DOM element, but\n    //                                           without reading/writing the actual element text content, since it will be overwritten\n    //                                           with the rendered template output.\n    // You can implement your own template source if you want to fetch/store templates somewhere other than in DOM elements.\n    // Template sources need to have the following functions:\n    //   text() \t\t\t- returns the template text from your storage location\n    //   text(value)\t\t- writes the supplied template text to your storage location\n    //   data(key)\t\t\t- reads values stored using data(key, value) - see below\n    //   data(key, value)\t- associates \"value\" with this template and the key \"key\". Is used to store information like \"isRewritten\".\n    //\n    // Optionally, template sources can also have the following functions:\n    //   nodes()            - returns a DOM element containing the nodes of this template, where available\n    //   nodes(value)       - writes the given DOM element to your storage location\n    // If a DOM element is available for a given template source, template engines are encouraged to use it in preference over text()\n    // for improved speed. However, all templateSources must supply text() even if they don't supply nodes().\n    //\n    // Once you've implemented a templateSource, make your template engine use it by subclassing whatever template engine you were\n    // using and overriding \"makeTemplateSource\" to return an instance of your custom template source.\n\n    ko.templateSources = {};\n\n    // ---- ko.templateSources.domElement -----\n\n    // template types\n    var templateScript = 1,\n        templateTextArea = 2,\n        templateTemplate = 3,\n        templateElement = 4;\n\n    ko.templateSources.domElement = function(element) {\n        this.domElement = element;\n\n        if (element) {\n            var tagNameLower = ko.utils.tagNameLower(element);\n            this.templateType =\n                tagNameLower === \"script\" ? templateScript :\n                tagNameLower === \"textarea\" ? templateTextArea :\n                    // For browsers with proper <template> element support, where the .content property gives a document fragment\n                tagNameLower == \"template\" && element.content && element.content.nodeType === 11 ? templateTemplate :\n                templateElement;\n        }\n    }\n\n    ko.templateSources.domElement.prototype['text'] = function(/* valueToWrite */) {\n        var elemContentsProperty = this.templateType === templateScript ? \"text\"\n                                 : this.templateType === templateTextArea ? \"value\"\n                                 : \"innerHTML\";\n\n        if (arguments.length == 0) {\n            return this.domElement[elemContentsProperty];\n        } else {\n            var valueToWrite = arguments[0];\n            if (elemContentsProperty === \"innerHTML\")\n                ko.utils.setHtml(this.domElement, valueToWrite);\n            else\n                this.domElement[elemContentsProperty] = valueToWrite;\n        }\n    };\n\n    var dataDomDataPrefix = ko.utils.domData.nextKey() + \"_\";\n    ko.templateSources.domElement.prototype['data'] = function(key /*, valueToWrite */) {\n        if (arguments.length === 1) {\n            return ko.utils.domData.get(this.domElement, dataDomDataPrefix + key);\n        } else {\n            ko.utils.domData.set(this.domElement, dataDomDataPrefix + key, arguments[1]);\n        }\n    };\n\n    var templatesDomDataKey = ko.utils.domData.nextKey();\n    function getTemplateDomData(element) {\n        return ko.utils.domData.get(element, templatesDomDataKey) || {};\n    }\n    function setTemplateDomData(element, data) {\n        ko.utils.domData.set(element, templatesDomDataKey, data);\n    }\n\n    ko.templateSources.domElement.prototype['nodes'] = function(/* valueToWrite */) {\n        var element = this.domElement;\n        if (arguments.length == 0) {\n            var templateData = getTemplateDomData(element),\n                nodes = templateData.containerData || (\n                    this.templateType === templateTemplate ? element.content :\n                    this.templateType === templateElement ? element :\n                    undefined);\n            if (!nodes || templateData.alwaysCheckText) {\n                // If the template is associated with an element that stores the template as text,\n                // parse and cache the nodes whenever there's new text content available. This allows\n                // the user to update the template content by updating the text of template node.\n                var text = this['text']();\n                if (text) {\n                    nodes = ko.utils.parseHtmlForTemplateNodes(text, element.ownerDocument);\n                    this['text'](\"\");   // clear the text from the node\n                    setTemplateDomData(element, {containerData: nodes, alwaysCheckText: true});\n                }\n            }\n            return nodes;\n        } else {\n            var valueToWrite = arguments[0];\n            setTemplateDomData(element, {containerData: valueToWrite});\n        }\n    };\n\n    // ---- ko.templateSources.anonymousTemplate -----\n    // Anonymous templates are normally saved/retrieved as DOM nodes through \"nodes\".\n    // For compatibility, you can also read \"text\"; it will be serialized from the nodes on demand.\n    // Writing to \"text\" is still supported, but then the template data will not be available as DOM nodes.\n\n    ko.templateSources.anonymousTemplate = function(element) {\n        this.domElement = element;\n    }\n    ko.templateSources.anonymousTemplate.prototype = new ko.templateSources.domElement();\n    ko.templateSources.anonymousTemplate.prototype.constructor = ko.templateSources.anonymousTemplate;\n    ko.templateSources.anonymousTemplate.prototype['text'] = function(/* valueToWrite */) {\n        if (arguments.length == 0) {\n            var templateData = getTemplateDomData(this.domElement);\n            if (templateData.textData === undefined && templateData.containerData)\n                templateData.textData = templateData.containerData.innerHTML;\n            return templateData.textData;\n        } else {\n            var valueToWrite = arguments[0];\n            setTemplateDomData(this.domElement, {textData: valueToWrite});\n        }\n    };\n\n    ko.exportSymbol('templateSources', ko.templateSources);\n    ko.exportSymbol('templateSources.domElement', ko.templateSources.domElement);\n    ko.exportSymbol('templateSources.anonymousTemplate', ko.templateSources.anonymousTemplate);\n})();\n(function () {\n    var _templateEngine;\n    ko.setTemplateEngine = function (templateEngine) {\n        if ((templateEngine != undefined) && !(templateEngine instanceof ko.templateEngine))\n            throw new Error(\"templateEngine must inherit from ko.templateEngine\");\n        _templateEngine = templateEngine;\n    }\n\n    function invokeForEachNodeInContinuousRange(firstNode, lastNode, action) {\n        var node, nextInQueue = firstNode, firstOutOfRangeNode = ko.virtualElements.nextSibling(lastNode);\n        while (nextInQueue && ((node = nextInQueue) !== firstOutOfRangeNode)) {\n            nextInQueue = ko.virtualElements.nextSibling(node);\n            action(node, nextInQueue);\n        }\n    }\n\n    function activateBindingsOnContinuousNodeArray(continuousNodeArray, bindingContext) {\n        // To be used on any nodes that have been rendered by a template and have been inserted into some parent element\n        // Walks through continuousNodeArray (which *must* be continuous, i.e., an uninterrupted sequence of sibling nodes, because\n        // the algorithm for walking them relies on this), and for each top-level item in the virtual-element sense,\n        // (1) Does a regular \"applyBindings\" to associate bindingContext with this node and to activate any non-memoized bindings\n        // (2) Unmemoizes any memos in the DOM subtree (e.g., to activate bindings that had been memoized during template rewriting)\n\n        if (continuousNodeArray.length) {\n            var firstNode = continuousNodeArray[0],\n                lastNode = continuousNodeArray[continuousNodeArray.length - 1],\n                parentNode = firstNode.parentNode,\n                provider = ko.bindingProvider['instance'],\n                preprocessNode = provider['preprocessNode'];\n\n            if (preprocessNode) {\n                invokeForEachNodeInContinuousRange(firstNode, lastNode, function(node, nextNodeInRange) {\n                    var nodePreviousSibling = node.previousSibling;\n                    var newNodes = preprocessNode.call(provider, node);\n                    if (newNodes) {\n                        if (node === firstNode)\n                            firstNode = newNodes[0] || nextNodeInRange;\n                        if (node === lastNode)\n                            lastNode = newNodes[newNodes.length - 1] || nodePreviousSibling;\n                    }\n                });\n\n                // Because preprocessNode can change the nodes, including the first and last nodes, update continuousNodeArray to match.\n                // We need the full set, including inner nodes, because the unmemoize step might remove the first node (and so the real\n                // first node needs to be in the array).\n                continuousNodeArray.length = 0;\n                if (!firstNode) { // preprocessNode might have removed all the nodes, in which case there's nothing left to do\n                    return;\n                }\n                if (firstNode === lastNode) {\n                    continuousNodeArray.push(firstNode);\n                } else {\n                    continuousNodeArray.push(firstNode, lastNode);\n                    ko.utils.fixUpContinuousNodeArray(continuousNodeArray, parentNode);\n                }\n            }\n\n            // Need to applyBindings *before* unmemoziation, because unmemoization might introduce extra nodes (that we don't want to re-bind)\n            // whereas a regular applyBindings won't introduce new memoized nodes\n            invokeForEachNodeInContinuousRange(firstNode, lastNode, function(node) {\n                if (node.nodeType === 1 || node.nodeType === 8)\n                    ko.applyBindings(bindingContext, node);\n            });\n            invokeForEachNodeInContinuousRange(firstNode, lastNode, function(node) {\n                if (node.nodeType === 1 || node.nodeType === 8)\n                    ko.memoization.unmemoizeDomNodeAndDescendants(node, [bindingContext]);\n            });\n\n            // Make sure any changes done by applyBindings or unmemoize are reflected in the array\n            ko.utils.fixUpContinuousNodeArray(continuousNodeArray, parentNode);\n        }\n    }\n\n    function getFirstNodeFromPossibleArray(nodeOrNodeArray) {\n        return nodeOrNodeArray.nodeType ? nodeOrNodeArray\n                                        : nodeOrNodeArray.length > 0 ? nodeOrNodeArray[0]\n                                        : null;\n    }\n\n    function executeTemplate(targetNodeOrNodeArray, renderMode, template, bindingContext, options) {\n        options = options || {};\n        var firstTargetNode = targetNodeOrNodeArray && getFirstNodeFromPossibleArray(targetNodeOrNodeArray);\n        var templateDocument = (firstTargetNode || template || {}).ownerDocument;\n        var templateEngineToUse = (options['templateEngine'] || _templateEngine);\n        ko.templateRewriting.ensureTemplateIsRewritten(template, templateEngineToUse, templateDocument);\n        var renderedNodesArray = templateEngineToUse['renderTemplate'](template, bindingContext, options, templateDocument);\n\n        // Loosely check result is an array of DOM nodes\n        if ((typeof renderedNodesArray.length != \"number\") || (renderedNodesArray.length > 0 && typeof renderedNodesArray[0].nodeType != \"number\"))\n            throw new Error(\"Template engine must return an array of DOM nodes\");\n\n        var haveAddedNodesToParent = false;\n        switch (renderMode) {\n            case \"replaceChildren\":\n                ko.virtualElements.setDomNodeChildren(targetNodeOrNodeArray, renderedNodesArray);\n                haveAddedNodesToParent = true;\n                break;\n            case \"replaceNode\":\n                ko.utils.replaceDomNodes(targetNodeOrNodeArray, renderedNodesArray);\n                haveAddedNodesToParent = true;\n                break;\n            case \"ignoreTargetNode\": break;\n            default:\n                throw new Error(\"Unknown renderMode: \" + renderMode);\n        }\n\n        if (haveAddedNodesToParent) {\n            activateBindingsOnContinuousNodeArray(renderedNodesArray, bindingContext);\n            if (options['afterRender']) {\n                ko.dependencyDetection.ignore(options['afterRender'], null, [renderedNodesArray, bindingContext[options['as'] || '$data']]);\n            }\n            if (renderMode == \"replaceChildren\") {\n                ko.bindingEvent.notify(targetNodeOrNodeArray, ko.bindingEvent.childrenComplete);\n            }\n        }\n\n        return renderedNodesArray;\n    }\n\n    function resolveTemplateName(template, data, context) {\n        // The template can be specified as:\n        if (ko.isObservable(template)) {\n            // 1. An observable, with string value\n            return template();\n        } else if (typeof template === 'function') {\n            // 2. A function of (data, context) returning a string\n            return template(data, context);\n        } else {\n            // 3. A string\n            return template;\n        }\n    }\n\n    ko.renderTemplate = function (template, dataOrBindingContext, options, targetNodeOrNodeArray, renderMode) {\n        options = options || {};\n        if ((options['templateEngine'] || _templateEngine) == undefined)\n            throw new Error(\"Set a template engine before calling renderTemplate\");\n        renderMode = renderMode || \"replaceChildren\";\n\n        if (targetNodeOrNodeArray) {\n            var firstTargetNode = getFirstNodeFromPossibleArray(targetNodeOrNodeArray);\n\n            var whenToDispose = function () { return (!firstTargetNode) || !ko.utils.domNodeIsAttachedToDocument(firstTargetNode); }; // Passive disposal (on next evaluation)\n            var activelyDisposeWhenNodeIsRemoved = (firstTargetNode && renderMode == \"replaceNode\") ? firstTargetNode.parentNode : firstTargetNode;\n\n            return ko.dependentObservable( // So the DOM is automatically updated when any dependency changes\n                function () {\n                    // Ensure we've got a proper binding context to work with\n                    var bindingContext = (dataOrBindingContext && (dataOrBindingContext instanceof ko.bindingContext))\n                        ? dataOrBindingContext\n                        : new ko.bindingContext(dataOrBindingContext, null, null, null, { \"exportDependencies\": true });\n\n                    var templateName = resolveTemplateName(template, bindingContext['$data'], bindingContext),\n                        renderedNodesArray = executeTemplate(targetNodeOrNodeArray, renderMode, templateName, bindingContext, options);\n\n                    if (renderMode == \"replaceNode\") {\n                        targetNodeOrNodeArray = renderedNodesArray;\n                        firstTargetNode = getFirstNodeFromPossibleArray(targetNodeOrNodeArray);\n                    }\n                },\n                null,\n                { disposeWhen: whenToDispose, disposeWhenNodeIsRemoved: activelyDisposeWhenNodeIsRemoved }\n            );\n        } else {\n            // We don't yet have a DOM node to evaluate, so use a memo and render the template later when there is a DOM node\n            return ko.memoization.memoize(function (domNode) {\n                ko.renderTemplate(template, dataOrBindingContext, options, domNode, \"replaceNode\");\n            });\n        }\n    };\n\n    ko.renderTemplateForEach = function (template, arrayOrObservableArray, options, targetNode, parentBindingContext) {\n        // Since setDomNodeChildrenFromArrayMapping always calls executeTemplateForArrayItem and then\n        // activateBindingsCallback for added items, we can store the binding context in the former to use in the latter.\n        var arrayItemContext, asName = options['as'];\n\n        // This will be called by setDomNodeChildrenFromArrayMapping to get the nodes to add to targetNode\n        var executeTemplateForArrayItem = function (arrayValue, index) {\n            // Support selecting template as a function of the data being rendered\n            arrayItemContext = parentBindingContext['createChildContext'](arrayValue, {\n                'as': asName,\n                'noChildContext': options['noChildContext'],\n                'extend': function(context) {\n                    context['$index'] = index;\n                    if (asName) {\n                        context[asName + \"Index\"] = index;\n                    }\n                }\n            });\n\n            var templateName = resolveTemplateName(template, arrayValue, arrayItemContext);\n            return executeTemplate(targetNode, \"ignoreTargetNode\", templateName, arrayItemContext, options);\n        };\n\n        // This will be called whenever setDomNodeChildrenFromArrayMapping has added nodes to targetNode\n        var activateBindingsCallback = function(arrayValue, addedNodesArray, index) {\n            activateBindingsOnContinuousNodeArray(addedNodesArray, arrayItemContext);\n            if (options['afterRender'])\n                options['afterRender'](addedNodesArray, arrayValue);\n\n            // release the \"cache\" variable, so that it can be collected by\n            // the GC when its value isn't used from within the bindings anymore.\n            arrayItemContext = null;\n        };\n\n        var setDomNodeChildrenFromArrayMapping = function (newArray, changeList) {\n            // Call setDomNodeChildrenFromArrayMapping, ignoring any observables unwrapped within (most likely from a callback function).\n            // If the array items are observables, though, they will be unwrapped in executeTemplateForArrayItem and managed within setDomNodeChildrenFromArrayMapping.\n            ko.dependencyDetection.ignore(ko.utils.setDomNodeChildrenFromArrayMapping, null, [targetNode, newArray, executeTemplateForArrayItem, options, activateBindingsCallback, changeList]);\n            ko.bindingEvent.notify(targetNode, ko.bindingEvent.childrenComplete);\n        };\n\n        var shouldHideDestroyed = (options['includeDestroyed'] === false) || (ko.options['foreachHidesDestroyed'] && !options['includeDestroyed']);\n\n        if (!shouldHideDestroyed && !options['beforeRemove'] && ko.isObservableArray(arrayOrObservableArray)) {\n            setDomNodeChildrenFromArrayMapping(arrayOrObservableArray.peek());\n\n            var subscription = arrayOrObservableArray.subscribe(function (changeList) {\n                setDomNodeChildrenFromArrayMapping(arrayOrObservableArray(), changeList);\n            }, null, \"arrayChange\");\n            subscription.disposeWhenNodeIsRemoved(targetNode);\n\n            return subscription;\n        } else {\n            return ko.dependentObservable(function () {\n                var unwrappedArray = ko.utils.unwrapObservable(arrayOrObservableArray) || [];\n                if (typeof unwrappedArray.length == \"undefined\") // Coerce single value into array\n                    unwrappedArray = [unwrappedArray];\n\n                if (shouldHideDestroyed) {\n                    // Filter out any entries marked as destroyed\n                    unwrappedArray = ko.utils.arrayFilter(unwrappedArray, function(item) {\n                        return item === undefined || item === null || !ko.utils.unwrapObservable(item['_destroy']);\n                    });\n                }\n                setDomNodeChildrenFromArrayMapping(unwrappedArray);\n\n            }, null, { disposeWhenNodeIsRemoved: targetNode });\n        }\n    };\n\n    var templateComputedDomDataKey = ko.utils.domData.nextKey();\n    function disposeOldComputedAndStoreNewOne(element, newComputed) {\n        var oldComputed = ko.utils.domData.get(element, templateComputedDomDataKey);\n        if (oldComputed && (typeof(oldComputed.dispose) == 'function'))\n            oldComputed.dispose();\n        ko.utils.domData.set(element, templateComputedDomDataKey, (newComputed && (!newComputed.isActive || newComputed.isActive())) ? newComputed : undefined);\n    }\n\n    var cleanContainerDomDataKey = ko.utils.domData.nextKey();\n    ko.bindingHandlers['template'] = {\n        'init': function(element, valueAccessor) {\n            // Support anonymous templates\n            var bindingValue = ko.utils.unwrapObservable(valueAccessor());\n            if (typeof bindingValue == \"string\" || bindingValue['name']) {\n                // It's a named template - clear the element\n                ko.virtualElements.emptyNode(element);\n            } else if ('nodes' in bindingValue) {\n                // We've been given an array of DOM nodes. Save them as the template source.\n                // There is no known use case for the node array being an observable array (if the output\n                // varies, put that behavior *into* your template - that's what templates are for), and\n                // the implementation would be a mess, so assert that it's not observable.\n                var nodes = bindingValue['nodes'] || [];\n                if (ko.isObservable(nodes)) {\n                    throw new Error('The \"nodes\" option must be a plain, non-observable array.');\n                }\n\n                // If the nodes are already attached to a KO-generated container, we reuse that container without moving the\n                // elements to a new one (we check only the first node, as the nodes are always moved together)\n                var container = nodes[0] && nodes[0].parentNode;\n                if (!container || !ko.utils.domData.get(container, cleanContainerDomDataKey)) {\n                    container = ko.utils.moveCleanedNodesToContainerElement(nodes);\n                    ko.utils.domData.set(container, cleanContainerDomDataKey, true);\n                }\n\n                new ko.templateSources.anonymousTemplate(element)['nodes'](container);\n            } else {\n                // It's an anonymous template - store the element contents, then clear the element\n                var templateNodes = ko.virtualElements.childNodes(element);\n                if (templateNodes.length > 0) {\n                    var container = ko.utils.moveCleanedNodesToContainerElement(templateNodes); // This also removes the nodes from their current parent\n                    new ko.templateSources.anonymousTemplate(element)['nodes'](container);\n                } else {\n                    throw new Error(\"Anonymous template defined, but no template content was provided\");\n                }\n            }\n            return { 'controlsDescendantBindings': true };\n        },\n        'update': function (element, valueAccessor, allBindings, viewModel, bindingContext) {\n            var value = valueAccessor(),\n                options = ko.utils.unwrapObservable(value),\n                shouldDisplay = true,\n                templateComputed = null,\n                templateName;\n\n            if (typeof options == \"string\") {\n                templateName = value;\n                options = {};\n            } else {\n                templateName = options['name'];\n\n                // Support \"if\"/\"ifnot\" conditions\n                if ('if' in options)\n                    shouldDisplay = ko.utils.unwrapObservable(options['if']);\n                if (shouldDisplay && 'ifnot' in options)\n                    shouldDisplay = !ko.utils.unwrapObservable(options['ifnot']);\n            }\n\n            if ('foreach' in options) {\n                // Render once for each data point (treating data set as empty if shouldDisplay==false)\n                var dataArray = (shouldDisplay && options['foreach']) || [];\n                templateComputed = ko.renderTemplateForEach(templateName || element, dataArray, options, element, bindingContext);\n            } else if (!shouldDisplay) {\n                ko.virtualElements.emptyNode(element);\n            } else {\n                // Render once for this single data point (or use the viewModel if no data was provided)\n                var innerBindingContext = bindingContext;\n                if ('data' in options) {\n                    innerBindingContext = bindingContext['createChildContext'](options['data'], {\n                        'as': options['as'],\n                        'noChildContext': options['noChildContext'],\n                        'exportDependencies': true\n                    });\n                }\n                templateComputed = ko.renderTemplate(templateName || element, innerBindingContext, options, element);\n            }\n\n            // It only makes sense to have a single template computed per element (otherwise which one should have its output displayed?)\n            disposeOldComputedAndStoreNewOne(element, templateComputed);\n        }\n    };\n\n    // Anonymous templates can't be rewritten. Give a nice error message if you try to do it.\n    ko.expressionRewriting.bindingRewriteValidators['template'] = function(bindingValue) {\n        var parsedBindingValue = ko.expressionRewriting.parseObjectLiteral(bindingValue);\n\n        if ((parsedBindingValue.length == 1) && parsedBindingValue[0]['unknown'])\n            return null; // It looks like a string literal, not an object literal, so treat it as a named template (which is allowed for rewriting)\n\n        if (ko.expressionRewriting.keyValueArrayContainsKey(parsedBindingValue, \"name\"))\n            return null; // Named templates can be rewritten, so return \"no error\"\n        return \"This template engine does not support anonymous templates nested within its templates\";\n    };\n\n    ko.virtualElements.allowedBindings['template'] = true;\n})();\n\nko.exportSymbol('setTemplateEngine', ko.setTemplateEngine);\nko.exportSymbol('renderTemplate', ko.renderTemplate);\n// Go through the items that have been added and deleted and try to find matches between them.\nko.utils.findMovesInArrayComparison = function (left, right, limitFailedCompares) {\n    if (left.length && right.length) {\n        var failedCompares, l, r, leftItem, rightItem;\n        for (failedCompares = l = 0; (!limitFailedCompares || failedCompares < limitFailedCompares) && (leftItem = left[l]); ++l) {\n            for (r = 0; rightItem = right[r]; ++r) {\n                if (leftItem['value'] === rightItem['value']) {\n                    leftItem['moved'] = rightItem['index'];\n                    rightItem['moved'] = leftItem['index'];\n                    right.splice(r, 1);         // This item is marked as moved; so remove it from right list\n                    failedCompares = r = 0;     // Reset failed compares count because we're checking for consecutive failures\n                    break;\n                }\n            }\n            failedCompares += r;\n        }\n    }\n};\n\nko.utils.compareArrays = (function () {\n    var statusNotInOld = 'added', statusNotInNew = 'deleted';\n\n    // Simple calculation based on Levenshtein distance.\n    function compareArrays(oldArray, newArray, options) {\n        // For backward compatibility, if the third arg is actually a bool, interpret\n        // it as the old parameter 'dontLimitMoves'. Newer code should use { dontLimitMoves: true }.\n        options = (typeof options === 'boolean') ? { 'dontLimitMoves': options } : (options || {});\n        oldArray = oldArray || [];\n        newArray = newArray || [];\n\n        if (oldArray.length < newArray.length)\n            return compareSmallArrayToBigArray(oldArray, newArray, statusNotInOld, statusNotInNew, options);\n        else\n            return compareSmallArrayToBigArray(newArray, oldArray, statusNotInNew, statusNotInOld, options);\n    }\n\n    function compareSmallArrayToBigArray(smlArray, bigArray, statusNotInSml, statusNotInBig, options) {\n        var myMin = Math.min,\n            myMax = Math.max,\n            editDistanceMatrix = [],\n            smlIndex, smlIndexMax = smlArray.length,\n            bigIndex, bigIndexMax = bigArray.length,\n            compareRange = (bigIndexMax - smlIndexMax) || 1,\n            maxDistance = smlIndexMax + bigIndexMax + 1,\n            thisRow, lastRow,\n            bigIndexMaxForRow, bigIndexMinForRow;\n\n        for (smlIndex = 0; smlIndex <= smlIndexMax; smlIndex++) {\n            lastRow = thisRow;\n            editDistanceMatrix.push(thisRow = []);\n            bigIndexMaxForRow = myMin(bigIndexMax, smlIndex + compareRange);\n            bigIndexMinForRow = myMax(0, smlIndex - 1);\n            for (bigIndex = bigIndexMinForRow; bigIndex <= bigIndexMaxForRow; bigIndex++) {\n                if (!bigIndex)\n                    thisRow[bigIndex] = smlIndex + 1;\n                else if (!smlIndex)  // Top row - transform empty array into new array via additions\n                    thisRow[bigIndex] = bigIndex + 1;\n                else if (smlArray[smlIndex - 1] === bigArray[bigIndex - 1])\n                    thisRow[bigIndex] = lastRow[bigIndex - 1];                  // copy value (no edit)\n                else {\n                    var northDistance = lastRow[bigIndex] || maxDistance;       // not in big (deletion)\n                    var westDistance = thisRow[bigIndex - 1] || maxDistance;    // not in small (addition)\n                    thisRow[bigIndex] = myMin(northDistance, westDistance) + 1;\n                }\n            }\n        }\n\n        var editScript = [], meMinusOne, notInSml = [], notInBig = [];\n        for (smlIndex = smlIndexMax, bigIndex = bigIndexMax; smlIndex || bigIndex;) {\n            meMinusOne = editDistanceMatrix[smlIndex][bigIndex] - 1;\n            if (bigIndex && meMinusOne === editDistanceMatrix[smlIndex][bigIndex-1]) {\n                notInSml.push(editScript[editScript.length] = {     // added\n                    'status': statusNotInSml,\n                    'value': bigArray[--bigIndex],\n                    'index': bigIndex });\n            } else if (smlIndex && meMinusOne === editDistanceMatrix[smlIndex - 1][bigIndex]) {\n                notInBig.push(editScript[editScript.length] = {     // deleted\n                    'status': statusNotInBig,\n                    'value': smlArray[--smlIndex],\n                    'index': smlIndex });\n            } else {\n                --bigIndex;\n                --smlIndex;\n                if (!options['sparse']) {\n                    editScript.push({\n                        'status': \"retained\",\n                        'value': bigArray[bigIndex] });\n                }\n            }\n        }\n\n        // Set a limit on the number of consecutive non-matching comparisons; having it a multiple of\n        // smlIndexMax keeps the time complexity of this algorithm linear.\n        ko.utils.findMovesInArrayComparison(notInBig, notInSml, !options['dontLimitMoves'] && smlIndexMax * 10);\n\n        return editScript.reverse();\n    }\n\n    return compareArrays;\n})();\n\nko.exportSymbol('utils.compareArrays', ko.utils.compareArrays);\n(function () {\n    // Objective:\n    // * Given an input array, a container DOM node, and a function from array elements to arrays of DOM nodes,\n    //   map the array elements to arrays of DOM nodes, concatenate together all these arrays, and use them to populate the container DOM node\n    // * Next time we're given the same combination of things (with the array possibly having mutated), update the container DOM node\n    //   so that its children is again the concatenation of the mappings of the array elements, but don't re-map any array elements that we\n    //   previously mapped - retain those nodes, and just insert/delete other ones\n\n    // \"callbackAfterAddingNodes\" will be invoked after any \"mapping\"-generated nodes are inserted into the container node\n    // You can use this, for example, to activate bindings on those nodes.\n\n    function mapNodeAndRefreshWhenChanged(containerNode, mapping, valueToMap, callbackAfterAddingNodes, index) {\n        // Map this array value inside a dependentObservable so we re-map when any dependency changes\n        var mappedNodes = [];\n        var dependentObservable = ko.dependentObservable(function() {\n            var newMappedNodes = mapping(valueToMap, index, ko.utils.fixUpContinuousNodeArray(mappedNodes, containerNode)) || [];\n\n            // On subsequent evaluations, just replace the previously-inserted DOM nodes\n            if (mappedNodes.length > 0) {\n                ko.utils.replaceDomNodes(mappedNodes, newMappedNodes);\n                if (callbackAfterAddingNodes)\n                    ko.dependencyDetection.ignore(callbackAfterAddingNodes, null, [valueToMap, newMappedNodes, index]);\n            }\n\n            // Replace the contents of the mappedNodes array, thereby updating the record\n            // of which nodes would be deleted if valueToMap was itself later removed\n            mappedNodes.length = 0;\n            ko.utils.arrayPushAll(mappedNodes, newMappedNodes);\n        }, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });\n        return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };\n    }\n\n    var lastMappingResultDomDataKey = ko.utils.domData.nextKey(),\n        deletedItemDummyValue = ko.utils.domData.nextKey();\n\n    ko.utils.setDomNodeChildrenFromArrayMapping = function (domNode, array, mapping, options, callbackAfterAddingNodes, editScript) {\n        array = array || [];\n        if (typeof array.length == \"undefined\") // Coerce single value into array\n            array = [array];\n\n        options = options || {};\n        var lastMappingResult = ko.utils.domData.get(domNode, lastMappingResultDomDataKey);\n        var isFirstExecution = !lastMappingResult;\n\n        // Build the new mapping result\n        var newMappingResult = [];\n        var lastMappingResultIndex = 0;\n        var currentArrayIndex = 0;\n\n        var nodesToDelete = [];\n        var itemsToMoveFirstIndexes = [];\n        var itemsForBeforeRemoveCallbacks = [];\n        var itemsForMoveCallbacks = [];\n        var itemsForAfterAddCallbacks = [];\n        var mapData;\n        var countWaitingForRemove = 0;\n\n        function itemAdded(value) {\n            mapData = { arrayEntry: value, indexObservable: ko.observable(currentArrayIndex++) };\n            newMappingResult.push(mapData);\n            if (!isFirstExecution) {\n                itemsForAfterAddCallbacks.push(mapData);\n            }\n        }\n\n        function itemMovedOrRetained(oldPosition) {\n            mapData = lastMappingResult[oldPosition];\n            if (currentArrayIndex !== mapData.indexObservable.peek())\n                itemsForMoveCallbacks.push(mapData);\n            // Since updating the index might change the nodes, do so before calling fixUpContinuousNodeArray\n            mapData.indexObservable(currentArrayIndex++);\n            ko.utils.fixUpContinuousNodeArray(mapData.mappedNodes, domNode);\n            newMappingResult.push(mapData);\n        }\n\n        function callCallback(callback, items) {\n            if (callback) {\n                for (var i = 0, n = items.length; i < n; i++) {\n                    ko.utils.arrayForEach(items[i].mappedNodes, function(node) {\n                        callback(node, i, items[i].arrayEntry);\n                    });\n                }\n            }\n        }\n\n        if (isFirstExecution) {\n            ko.utils.arrayForEach(array, itemAdded);\n        } else {\n            if (!editScript || (lastMappingResult && lastMappingResult['_countWaitingForRemove'])) {\n                // Compare the provided array against the previous one\n                var lastArray = ko.utils.arrayMap(lastMappingResult, function (x) { return x.arrayEntry; }),\n                    compareOptions = {\n                        'dontLimitMoves': options['dontLimitMoves'],\n                        'sparse': true\n                    };\n                editScript = ko.utils.compareArrays(lastArray, array, compareOptions);\n            }\n\n            for (var i = 0, editScriptItem, movedIndex, itemIndex; editScriptItem = editScript[i]; i++) {\n                movedIndex = editScriptItem['moved'];\n                itemIndex = editScriptItem['index'];\n                switch (editScriptItem['status']) {\n                    case \"deleted\":\n                        while (lastMappingResultIndex < itemIndex) {\n                            itemMovedOrRetained(lastMappingResultIndex++);\n                        }\n                        if (movedIndex === undefined) {\n                            mapData = lastMappingResult[lastMappingResultIndex];\n\n                            // Stop tracking changes to the mapping for these nodes\n                            if (mapData.dependentObservable) {\n                                mapData.dependentObservable.dispose();\n                                mapData.dependentObservable = undefined;\n                            }\n\n                            // Queue these nodes for later removal\n                            if (ko.utils.fixUpContinuousNodeArray(mapData.mappedNodes, domNode).length) {\n                                if (options['beforeRemove']) {\n                                    newMappingResult.push(mapData);\n                                    countWaitingForRemove++;\n                                    if (mapData.arrayEntry === deletedItemDummyValue) {\n                                        mapData = null;\n                                    } else {\n                                        itemsForBeforeRemoveCallbacks.push(mapData);\n                                    }\n                                }\n                                if (mapData) {\n                                    nodesToDelete.push.apply(nodesToDelete, mapData.mappedNodes);\n                                }\n                            }\n                        }\n                        lastMappingResultIndex++;\n                        break;\n\n                    case \"added\":\n                        while (currentArrayIndex < itemIndex) {\n                            itemMovedOrRetained(lastMappingResultIndex++);\n                        }\n                        if (movedIndex !== undefined) {\n                            itemsToMoveFirstIndexes.push(newMappingResult.length);\n                            itemMovedOrRetained(movedIndex);\n                        } else {\n                            itemAdded(editScriptItem['value']);\n                        }\n                        break;\n                }\n            }\n\n            while (currentArrayIndex < array.length) {\n                itemMovedOrRetained(lastMappingResultIndex++);\n            }\n\n            // Record that the current view may still contain deleted items\n            // because it means we won't be able to use a provided editScript.\n            newMappingResult['_countWaitingForRemove'] = countWaitingForRemove;\n        }\n\n        // Store a copy of the array items we just considered so we can difference it next time\n        ko.utils.domData.set(domNode, lastMappingResultDomDataKey, newMappingResult);\n\n        // Call beforeMove first before any changes have been made to the DOM\n        callCallback(options['beforeMove'], itemsForMoveCallbacks);\n\n        // Next remove nodes for deleted items (or just clean if there's a beforeRemove callback)\n        ko.utils.arrayForEach(nodesToDelete, options['beforeRemove'] ? ko.cleanNode : ko.removeNode);\n\n        var i, j, nextNodeInDom, lastNode, nodeToInsert, mappedNodes, activeElement;\n\n        // Since most browsers remove the focus from an element when it's moved to another location,\n        // save the focused element and try to restore it later.\n        try {\n            activeElement = domNode.ownerDocument.activeElement;\n        } catch(e) {\n            // IE9 throws if you access activeElement during page load (see issue #703)\n        }\n\n        // Try to reduce overall moved nodes by first moving the ones that were marked as moved by the edit script\n        if (itemsToMoveFirstIndexes.length) {\n            while ((i = itemsToMoveFirstIndexes.shift()) != undefined) {\n                mapData = newMappingResult[i];\n                for (lastNode = undefined; i; ) {\n                    if ((mappedNodes = newMappingResult[--i].mappedNodes) && mappedNodes.length) {\n                        lastNode = mappedNodes[mappedNodes.length-1];\n                        break;\n                    }\n                }\n                for (j = 0; nodeToInsert = mapData.mappedNodes[j]; lastNode = nodeToInsert, j++) {\n                    ko.virtualElements.insertAfter(domNode, nodeToInsert, lastNode);\n                }\n            }\n        }\n\n        // Next add/reorder the remaining items (will include deleted items if there's a beforeRemove callback)\n        for (i = 0, nextNodeInDom = ko.virtualElements.firstChild(domNode); mapData = newMappingResult[i]; i++) {\n            // Get nodes for newly added items\n            if (!mapData.mappedNodes)\n                ko.utils.extend(mapData, mapNodeAndRefreshWhenChanged(domNode, mapping, mapData.arrayEntry, callbackAfterAddingNodes, mapData.indexObservable));\n\n            // Put nodes in the right place if they aren't there already\n            for (j = 0; nodeToInsert = mapData.mappedNodes[j]; nextNodeInDom = nodeToInsert.nextSibling, lastNode = nodeToInsert, j++) {\n                if (nodeToInsert !== nextNodeInDom)\n                    ko.virtualElements.insertAfter(domNode, nodeToInsert, lastNode);\n            }\n\n            // Run the callbacks for newly added nodes (for example, to apply bindings, etc.)\n            if (!mapData.initialized && callbackAfterAddingNodes) {\n                callbackAfterAddingNodes(mapData.arrayEntry, mapData.mappedNodes, mapData.indexObservable);\n                mapData.initialized = true;\n                lastNode = mapData.mappedNodes[mapData.mappedNodes.length - 1];     // get the last node again since it may have been changed by a preprocessor\n            }\n        }\n\n        // Restore the focused element if it had lost focus\n        if (activeElement && domNode.ownerDocument.activeElement != activeElement) {\n            activeElement.focus();\n        }\n\n        // If there's a beforeRemove callback, call it after reordering.\n        // Note that we assume that the beforeRemove callback will usually be used to remove the nodes using\n        // some sort of animation, which is why we first reorder the nodes that will be removed. If the\n        // callback instead removes the nodes right away, it would be more efficient to skip reordering them.\n        // Perhaps we'll make that change in the future if this scenario becomes more common.\n        callCallback(options['beforeRemove'], itemsForBeforeRemoveCallbacks);\n\n        // Replace the stored values of deleted items with a dummy value. This provides two benefits: it marks this item\n        // as already \"removed\" so we won't call beforeRemove for it again, and it ensures that the item won't match up\n        // with an actual item in the array and appear as \"retained\" or \"moved\".\n        for (i = 0; i < itemsForBeforeRemoveCallbacks.length; ++i) {\n            itemsForBeforeRemoveCallbacks[i].arrayEntry = deletedItemDummyValue;\n        }\n\n        // Finally call afterMove and afterAdd callbacks\n        callCallback(options['afterMove'], itemsForMoveCallbacks);\n        callCallback(options['afterAdd'], itemsForAfterAddCallbacks);\n    }\n})();\n\nko.exportSymbol('utils.setDomNodeChildrenFromArrayMapping', ko.utils.setDomNodeChildrenFromArrayMapping);\nko.nativeTemplateEngine = function () {\n    this['allowTemplateRewriting'] = false;\n}\n\nko.nativeTemplateEngine.prototype = new ko.templateEngine();\nko.nativeTemplateEngine.prototype.constructor = ko.nativeTemplateEngine;\nko.nativeTemplateEngine.prototype['renderTemplateSource'] = function (templateSource, bindingContext, options, templateDocument) {\n    var useNodesIfAvailable = !(ko.utils.ieVersion < 9), // IE<9 cloneNode doesn't work properly\n        templateNodesFunc = useNodesIfAvailable ? templateSource['nodes'] : null,\n        templateNodes = templateNodesFunc ? templateSource['nodes']() : null;\n\n    if (templateNodes) {\n        return ko.utils.makeArray(templateNodes.cloneNode(true).childNodes);\n    } else {\n        var templateText = templateSource['text']();\n        return ko.utils.parseHtmlFragment(templateText, templateDocument);\n    }\n};\n\nko.nativeTemplateEngine.instance = new ko.nativeTemplateEngine();\nko.setTemplateEngine(ko.nativeTemplateEngine.instance);\n\nko.exportSymbol('nativeTemplateEngine', ko.nativeTemplateEngine);\n(function() {\n    ko.jqueryTmplTemplateEngine = function () {\n        // Detect which version of jquery-tmpl you're using. Unfortunately jquery-tmpl\n        // doesn't expose a version number, so we have to infer it.\n        // Note that as of Knockout 1.3, we only support jQuery.tmpl 1.0.0pre and later,\n        // which KO internally refers to as version \"2\", so older versions are no longer detected.\n        var jQueryTmplVersion = this.jQueryTmplVersion = (function() {\n            if (!jQueryInstance || !(jQueryInstance['tmpl']))\n                return 0;\n            // Since it exposes no official version number, we use our own numbering system. To be updated as jquery-tmpl evolves.\n            try {\n                if (jQueryInstance['tmpl']['tag']['tmpl']['open'].toString().indexOf('__') >= 0) {\n                    // Since 1.0.0pre, custom tags should append markup to an array called \"__\"\n                    return 2; // Final version of jquery.tmpl\n                }\n            } catch(ex) { /* Apparently not the version we were looking for */ }\n\n            return 1; // Any older version that we don't support\n        })();\n\n        function ensureHasReferencedJQueryTemplates() {\n            if (jQueryTmplVersion < 2)\n                throw new Error(\"Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.\");\n        }\n\n        function executeTemplate(compiledTemplate, data, jQueryTemplateOptions) {\n            return jQueryInstance['tmpl'](compiledTemplate, data, jQueryTemplateOptions);\n        }\n\n        this['renderTemplateSource'] = function(templateSource, bindingContext, options, templateDocument) {\n            templateDocument = templateDocument || document;\n            options = options || {};\n            ensureHasReferencedJQueryTemplates();\n\n            // Ensure we have stored a precompiled version of this template (don't want to reparse on every render)\n            var precompiled = templateSource['data']('precompiled');\n            if (!precompiled) {\n                var templateText = templateSource['text']() || \"\";\n                // Wrap in \"with($whatever.koBindingContext) { ... }\"\n                templateText = \"{{ko_with $item.koBindingContext}}\" + templateText + \"{{/ko_with}}\";\n\n                precompiled = jQueryInstance['template'](null, templateText);\n                templateSource['data']('precompiled', precompiled);\n            }\n\n            var data = [bindingContext['$data']]; // Prewrap the data in an array to stop jquery.tmpl from trying to unwrap any arrays\n            var jQueryTemplateOptions = jQueryInstance['extend']({ 'koBindingContext': bindingContext }, options['templateOptions']);\n\n            var resultNodes = executeTemplate(precompiled, data, jQueryTemplateOptions);\n            resultNodes['appendTo'](templateDocument.createElement(\"div\")); // Using \"appendTo\" forces jQuery/jQuery.tmpl to perform necessary cleanup work\n\n            jQueryInstance['fragments'] = {}; // Clear jQuery's fragment cache to avoid a memory leak after a large number of template renders\n            return resultNodes;\n        };\n\n        this['createJavaScriptEvaluatorBlock'] = function(script) {\n            return \"{{ko_code ((function() { return \" + script + \" })()) }}\";\n        };\n\n        this['addTemplate'] = function(templateName, templateMarkup) {\n            document.write(\"<script type='text/html' id='\" + templateName + \"'>\" + templateMarkup + \"<\" + \"/script>\");\n        };\n\n        if (jQueryTmplVersion > 0) {\n            jQueryInstance['tmpl']['tag']['ko_code'] = {\n                open: \"__.push($1 || '');\"\n            };\n            jQueryInstance['tmpl']['tag']['ko_with'] = {\n                open: \"with($1) {\",\n                close: \"} \"\n            };\n        }\n    };\n\n    ko.jqueryTmplTemplateEngine.prototype = new ko.templateEngine();\n    ko.jqueryTmplTemplateEngine.prototype.constructor = ko.jqueryTmplTemplateEngine;\n\n    // Use this one by default *only if jquery.tmpl is referenced*\n    var jqueryTmplTemplateEngineInstance = new ko.jqueryTmplTemplateEngine();\n    if (jqueryTmplTemplateEngineInstance.jQueryTmplVersion > 0)\n        ko.setTemplateEngine(jqueryTmplTemplateEngineInstance);\n\n    ko.exportSymbol('jqueryTmplTemplateEngine', ko.jqueryTmplTemplateEngine);\n})();\n}));\n}());\n})();\n"
  },
  {
    "path": "libs/knockout/knockout-3.5.0.js",
    "content": "/*!\n * Knockout JavaScript library v3.5.0\n * (c) The Knockout.js team - http://knockoutjs.com/\n * License: MIT (http://www.opensource.org/licenses/mit-license.php)\n */\n\n(function() {(function(p){var z=this||(0,eval)(\"this\"),w=z.document,R=z.navigator,v=z.jQuery,H=z.JSON;v||\"undefined\"===typeof jQuery||(v=jQuery);(function(p){\"function\"===typeof define&&define.amd?define([\"exports\",\"require\"],p):\"object\"===typeof exports&&\"object\"===typeof module?p(module.exports||exports):p(z.ko={})})(function(S,T){function K(a,c){return null===a||typeof a in W?a===c:!1}function X(b,c){var d;return function(){d||(d=a.a.setTimeout(function(){d=p;b()},c))}}function Y(b,c){var d;return function(){clearTimeout(d);\nd=a.a.setTimeout(b,c)}}function Z(a,c){c&&\"change\"!==c?\"beforeChange\"===c?this.oc(a):this.bb(a,c):this.pc(a)}function aa(a,c){null!==c&&c.s&&c.s()}function ba(a,c){var d=this.pd,e=d[t];e.qa||(this.Pb&&this.kb[c]?(d.tc(c,a,this.kb[c]),this.kb[c]=null,--this.Pb):e.F[c]||d.tc(c,a,e.G?{da:a}:d.Zc(a)),a.Ka&&a.fd())}var a=\"undefined\"!==typeof S?S:{};a.b=function(b,c){for(var d=b.split(\".\"),e=a,f=0;f<d.length-1;f++)e=e[d[f]];e[d[d.length-1]]=c};a.J=function(a,c,d){a[c]=d};a.version=\"3.5.0\";a.b(\"version\",\na.version);a.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1};a.a=function(){function b(a,b){for(var c in a)f.call(a,c)&&b(c,a[c])}function c(a,b){if(b)for(var c in b)f.call(b,c)&&(a[c]=b[c]);return a}function d(a,b){a.__proto__=b;return a}function e(b,c,d,e){var k=b[c].match(n)||[];a.a.C(d.match(n),function(b){a.a.Oa(k,b,e)});b[c]=k.join(\" \")}var f=Object.prototype.hasOwnProperty,g={__proto__:[]}instanceof Array,h=\"function\"===typeof Symbol,m={},l={};m[R&&/Firefox\\/2/i.test(R.userAgent)?\n\"KeyboardEvent\":\"UIEvents\"]=[\"keyup\",\"keydown\",\"keypress\"];m.MouseEvents=\"click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave\".split(\" \");b(m,function(a,b){if(b.length)for(var c=0,d=b.length;c<d;c++)l[b[c]]=a});var k={propertychange:!0},q=w&&function(){for(var a=3,b=w.createElement(\"div\"),c=b.getElementsByTagName(\"i\");b.innerHTML=\"\\x3c!--[if gt IE \"+ ++a+\"]><i></i><![endif]--\\x3e\",c[0];);return 4<a?a:p}(),n=/\\S+/g,r;return{Ic:[\"authenticity_token\",/^__RequestVerificationToken(_.*)?$/],\nC:function(a,b,c){for(var d=0,e=a.length;d<e;d++)b.call(c,a[d],d,a)},A:\"function\"==typeof Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b)}:function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},Lb:function(a,b,c){for(var d=0,e=a.length;d<e;d++)if(b.call(c,a[d],d,a))return a[d];return p},hb:function(b,c){var d=a.a.A(b,c);0<d?b.splice(d,1):0===d&&b.shift()},vc:function(b){var c=[];b&&a.a.C(b,function(b){0>a.a.A(c,b)&&c.push(b)});return c},Mb:function(a,\nb,c){var d=[];if(a)for(var e=0,k=a.length;e<k;e++)d.push(b.call(c,a[e],e));return d},fb:function(a,b,c){var d=[];if(a)for(var e=0,k=a.length;e<k;e++)b.call(c,a[e],e)&&d.push(a[e]);return d},gb:function(a,b){if(b instanceof Array)a.push.apply(a,b);else for(var c=0,d=b.length;c<d;c++)a.push(b[c]);return a},Oa:function(b,c,d){var e=a.a.A(a.a.$b(b),c);0>e?d&&b.push(c):d||b.splice(e,1)},Ba:g,extend:c,setPrototypeOf:d,zb:g?d:c,O:b,Ha:function(a,b,c){if(!a)return a;var d={},e;for(e in a)f.call(a,e)&&(d[e]=\nb.call(c,a[e],e,a));return d},Sb:function(b){for(;b.firstChild;)a.removeNode(b.firstChild)},Xb:function(b){b=a.a.la(b);for(var c=(b[0]&&b[0].ownerDocument||w).createElement(\"div\"),d=0,e=b.length;d<e;d++)c.appendChild(a.na(b[d]));return c},Ca:function(b,c){for(var d=0,e=b.length,k=[];d<e;d++){var f=b[d].cloneNode(!0);k.push(c?a.na(f):f)}return k},ua:function(b,c){a.a.Sb(b);if(c)for(var d=0,e=c.length;d<e;d++)b.appendChild(c[d])},Wc:function(b,c){var d=b.nodeType?[b]:b;if(0<d.length){for(var e=d[0],\nk=e.parentNode,f=0,l=c.length;f<l;f++)k.insertBefore(c[f],e);f=0;for(l=d.length;f<l;f++)a.removeNode(d[f])}},Ua:function(a,b){if(a.length){for(b=8===b.nodeType&&b.parentNode||b;a.length&&a[0].parentNode!==b;)a.splice(0,1);for(;1<a.length&&a[a.length-1].parentNode!==b;)a.length--;if(1<a.length){var c=a[0],d=a[a.length-1];for(a.length=0;c!==d;)a.push(c),c=c.nextSibling;a.push(d)}}return a},Yc:function(a,b){7>q?a.setAttribute(\"selected\",b):a.selected=b},Cb:function(a){return null===a||a===p?\"\":a.trim?\na.trim():a.toString().replace(/^[\\s\\xa0]+|[\\s\\xa0]+$/g,\"\")},Td:function(a,b){a=a||\"\";return b.length>a.length?!1:a.substring(0,b.length)===b},ud:function(a,b){if(a===b)return!0;if(11===a.nodeType)return!1;if(b.contains)return b.contains(1!==a.nodeType?a.parentNode:a);if(b.compareDocumentPosition)return 16==(b.compareDocumentPosition(a)&16);for(;a&&a!=b;)a=a.parentNode;return!!a},Rb:function(b){return a.a.ud(b,b.ownerDocument.documentElement)},jd:function(b){return!!a.a.Lb(b,a.a.Rb)},P:function(a){return a&&\na.tagName&&a.tagName.toLowerCase()},zc:function(b){return a.onError?function(){try{return b.apply(this,arguments)}catch(c){throw a.onError&&a.onError(c),c;}}:b},setTimeout:function(b,c){return setTimeout(a.a.zc(b),c)},Fc:function(b){setTimeout(function(){a.onError&&a.onError(b);throw b;},0)},H:function(b,c,d){var e=a.a.zc(d);d=k[c];if(a.options.useOnlyNativeEvents||d||!v)if(d||\"function\"!=typeof b.addEventListener)if(\"undefined\"!=typeof b.attachEvent){var f=function(a){e.call(b,a)},l=\"on\"+c;b.attachEvent(l,\nf);a.a.I.za(b,function(){b.detachEvent(l,f)})}else throw Error(\"Browser doesn't support addEventListener or attachEvent\");else b.addEventListener(c,e,!1);else r||(r=\"function\"==typeof v(b).on?\"on\":\"bind\"),v(b)[r](c,e)},Fb:function(b,c){if(!b||!b.nodeType)throw Error(\"element must be a DOM node when calling triggerEvent\");var d;\"input\"===a.a.P(b)&&b.type&&\"click\"==c.toLowerCase()?(d=b.type,d=\"checkbox\"==d||\"radio\"==d):d=!1;if(a.options.useOnlyNativeEvents||!v||d)if(\"function\"==typeof w.createEvent)if(\"function\"==\ntypeof b.dispatchEvent)d=w.createEvent(l[c]||\"HTMLEvents\"),d.initEvent(c,!0,!0,z,0,0,0,0,0,!1,!1,!1,!1,0,b),b.dispatchEvent(d);else throw Error(\"The supplied element doesn't support dispatchEvent\");else if(d&&b.click)b.click();else if(\"undefined\"!=typeof b.fireEvent)b.fireEvent(\"on\"+c);else throw Error(\"Browser doesn't support triggering events\");else v(b).trigger(c)},c:function(b){return a.N(b)?b():b},$b:function(b){return a.N(b)?b.w():b},Eb:function(b,c,d){var k;c&&(\"object\"===typeof b.classList?\n(k=b.classList[d?\"add\":\"remove\"],a.a.C(c.match(n),function(a){k.call(b.classList,a)})):\"string\"===typeof b.className.baseVal?e(b.className,\"baseVal\",c,d):e(b,\"className\",c,d))},Ab:function(b,c){var d=a.a.c(c);if(null===d||d===p)d=\"\";var e=a.h.firstChild(b);!e||3!=e.nodeType||a.h.nextSibling(e)?a.h.ua(b,[b.ownerDocument.createTextNode(d)]):e.data=d;a.a.zd(b)},Xc:function(a,b){a.name=b;if(7>=q)try{var c=a.name.replace(/[&<>'\"]/g,function(a){return\"&#\"+a.charCodeAt(0)+\";\"});a.mergeAttributes(w.createElement(\"<input name='\"+\nc+\"'/>\"),!1)}catch(d){}},zd:function(a){9<=q&&(a=1==a.nodeType?a:a.parentNode,a.style&&(a.style.zoom=a.style.zoom))},vd:function(a){if(q){var b=a.style.width;a.style.width=0;a.style.width=b}},Od:function(b,c){b=a.a.c(b);c=a.a.c(c);for(var d=[],e=b;e<=c;e++)d.push(e);return d},la:function(a){for(var b=[],c=0,d=a.length;c<d;c++)b.push(a[c]);return b},Da:function(a){return h?Symbol(a):a},Xd:6===q,Yd:7===q,W:q,Kc:function(b,c){for(var d=a.a.la(b.getElementsByTagName(\"input\")).concat(a.a.la(b.getElementsByTagName(\"textarea\"))),\ne=\"string\"==typeof c?function(a){return a.name===c}:function(a){return c.test(a.name)},k=[],f=d.length-1;0<=f;f--)e(d[f])&&k.push(d[f]);return k},Md:function(b){return\"string\"==typeof b&&(b=a.a.Cb(b))?H&&H.parse?H.parse(b):(new Function(\"return \"+b))():null},fc:function(b,c,d){if(!H||!H.stringify)throw Error(\"Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js\");\nreturn H.stringify(a.a.c(b),c,d)},Nd:function(c,d,e){e=e||{};var k=e.params||{},f=e.includeFields||this.Ic,l=c;if(\"object\"==typeof c&&\"form\"===a.a.P(c))for(var l=c.action,h=f.length-1;0<=h;h--)for(var g=a.a.Kc(c,f[h]),m=g.length-1;0<=m;m--)k[g[m].name]=g[m].value;d=a.a.c(d);var n=w.createElement(\"form\");n.style.display=\"none\";n.action=l;n.method=\"post\";for(var q in d)c=w.createElement(\"input\"),c.type=\"hidden\",c.name=q,c.value=a.a.fc(a.a.c(d[q])),n.appendChild(c);b(k,function(a,b){var c=w.createElement(\"input\");\nc.type=\"hidden\";c.name=a;c.value=b;n.appendChild(c)});w.body.appendChild(n);e.submitter?e.submitter(n):n.submit();setTimeout(function(){n.parentNode.removeChild(n)},0)}}}();a.b(\"utils\",a.a);a.b(\"utils.arrayForEach\",a.a.C);a.b(\"utils.arrayFirst\",a.a.Lb);a.b(\"utils.arrayFilter\",a.a.fb);a.b(\"utils.arrayGetDistinctValues\",a.a.vc);a.b(\"utils.arrayIndexOf\",a.a.A);a.b(\"utils.arrayMap\",a.a.Mb);a.b(\"utils.arrayPushAll\",a.a.gb);a.b(\"utils.arrayRemoveItem\",a.a.hb);a.b(\"utils.cloneNodes\",a.a.Ca);a.b(\"utils.createSymbolOrString\",\na.a.Da);a.b(\"utils.extend\",a.a.extend);a.b(\"utils.fieldsIncludedWithJsonPost\",a.a.Ic);a.b(\"utils.getFormFields\",a.a.Kc);a.b(\"utils.objectMap\",a.a.Ha);a.b(\"utils.peekObservable\",a.a.$b);a.b(\"utils.postJson\",a.a.Nd);a.b(\"utils.parseJson\",a.a.Md);a.b(\"utils.registerEventHandler\",a.a.H);a.b(\"utils.stringifyJson\",a.a.fc);a.b(\"utils.range\",a.a.Od);a.b(\"utils.toggleDomNodeCssClass\",a.a.Eb);a.b(\"utils.triggerEvent\",a.a.Fb);a.b(\"utils.unwrapObservable\",a.a.c);a.b(\"utils.objectForEach\",a.a.O);a.b(\"utils.addOrRemoveItem\",\na.a.Oa);a.b(\"utils.setTextContent\",a.a.Ab);a.b(\"unwrap\",a.a.c);Function.prototype.bind||(Function.prototype.bind=function(a){var c=this;if(1===arguments.length)return function(){return c.apply(a,arguments)};var d=Array.prototype.slice.call(arguments,1);return function(){var e=d.slice(0);e.push.apply(e,arguments);return c.apply(a,e)}});a.a.g=new function(){var b=0,c=\"__ko__\"+(new Date).getTime(),d={},e,f;a.a.W?(e=function(a,e){var f=a[c];if(!f||\"null\"===f||!d[f]){if(!e)return p;f=a[c]=\"ko\"+b++;d[f]=\n{}}return d[f]},f=function(a){var b=a[c];return b?(delete d[b],a[c]=null,!0):!1}):(e=function(a,b){var d=a[c];!d&&b&&(d=a[c]={});return d},f=function(a){return a[c]?(delete a[c],!0):!1});return{get:function(a,b){var c=e(a,!1);return c&&c[b]},set:function(a,b,c){(a=e(a,c!==p))&&(a[b]=c)},Tb:function(a,b,c){a=e(a,!0);return a[b]||(a[b]=c)},clear:f,Z:function(){return b++ +c}}};a.b(\"utils.domData\",a.a.g);a.b(\"utils.domData.clear\",a.a.g.clear);a.a.I=new function(){function b(b,c){var d=a.a.g.get(b,e);\nd===p&&c&&(d=[],a.a.g.set(b,e,d));return d}function c(c){var e=b(c,!1);if(e)for(var e=e.slice(0),f=0;f<e.length;f++)e[f](c);a.a.g.clear(c);a.a.I.cleanExternalData(c);g[c.nodeType]&&d(c.childNodes,!0)}function d(b,d){for(var e=[],k,f=0;f<b.length;f++)if(!d||8===b[f].nodeType)if(c(e[e.length]=k=b[f]),b[f]!==k)for(;f--&&-1==a.a.A(e,b[f]););}var e=a.a.g.Z(),f={1:!0,8:!0,9:!0},g={1:!0,9:!0};return{za:function(a,c){if(\"function\"!=typeof c)throw Error(\"Callback must be a function\");b(a,!0).push(c)},xb:function(c,\nd){var f=b(c,!1);f&&(a.a.hb(f,d),0==f.length&&a.a.g.set(c,e,p))},na:function(a){f[a.nodeType]&&(c(a),g[a.nodeType]&&d(a.getElementsByTagName(\"*\")));return a},removeNode:function(b){a.na(b);b.parentNode&&b.parentNode.removeChild(b)},cleanExternalData:function(a){v&&\"function\"==typeof v.cleanData&&v.cleanData([a])}}};a.na=a.a.I.na;a.removeNode=a.a.I.removeNode;a.b(\"cleanNode\",a.na);a.b(\"removeNode\",a.removeNode);a.b(\"utils.domNodeDisposal\",a.a.I);a.b(\"utils.domNodeDisposal.addDisposeCallback\",a.a.I.za);\na.b(\"utils.domNodeDisposal.removeDisposeCallback\",a.a.I.xb);(function(){var b=[0,\"\",\"\"],c=[1,\"<table>\",\"</table>\"],d=[3,\"<table><tbody><tr>\",\"</tr></tbody></table>\"],e=[1,\"<select multiple='multiple'>\",\"</select>\"],f={thead:c,tbody:c,tfoot:c,tr:[2,\"<table><tbody>\",\"</tbody></table>\"],td:d,th:d,option:e,optgroup:e},g=8>=a.a.W;a.a.ta=function(c,d){var e;if(v)if(v.parseHTML)e=v.parseHTML(c,d)||[];else{if((e=v.clean([c],d))&&e[0]){for(var k=e[0];k.parentNode&&11!==k.parentNode.nodeType;)k=k.parentNode;\nk.parentNode&&k.parentNode.removeChild(k)}}else{(e=d)||(e=w);var k=e.parentWindow||e.defaultView||z,q=a.a.Cb(c).toLowerCase(),n=e.createElement(\"div\"),r;r=(q=q.match(/^(?:\\x3c!--.*?--\\x3e\\s*?)*?<([a-z]+)[\\s>]/))&&f[q[1]]||b;q=r[0];r=\"ignored<div>\"+r[1]+c+r[2]+\"</div>\";\"function\"==typeof k.innerShiv?n.appendChild(k.innerShiv(r)):(g&&e.body.appendChild(n),n.innerHTML=r,g&&n.parentNode.removeChild(n));for(;q--;)n=n.lastChild;e=a.a.la(n.lastChild.childNodes)}return e};a.a.Ld=function(b,c){var d=a.a.ta(b,\nc);return d.length&&d[0].parentElement||a.a.Xb(d)};a.a.dc=function(b,c){a.a.Sb(b);c=a.a.c(c);if(null!==c&&c!==p)if(\"string\"!=typeof c&&(c=c.toString()),v)v(b).html(c);else for(var d=a.a.ta(c,b.ownerDocument),e=0;e<d.length;e++)b.appendChild(d[e])}})();a.b(\"utils.parseHtmlFragment\",a.a.ta);a.b(\"utils.setHtml\",a.a.dc);a.aa=function(){function b(c,e){if(c)if(8==c.nodeType){var f=a.aa.Tc(c.nodeValue);null!=f&&e.push({sd:c,Jd:f})}else if(1==c.nodeType)for(var f=0,g=c.childNodes,h=g.length;f<h;f++)b(g[f],\ne)}var c={};return{Wb:function(a){if(\"function\"!=typeof a)throw Error(\"You can only pass a function to ko.memoization.memoize()\");var b=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);c[b]=a;return\"\\x3c!--[ko_memo:\"+b+\"]--\\x3e\"},ad:function(a,b){var f=c[a];if(f===p)throw Error(\"Couldn't find any memo with ID \"+a+\". Perhaps it's already been unmemoized.\");try{return f.apply(null,b||[]),!0}finally{delete c[a]}},bd:function(c,e){var f=\n[];b(c,f);for(var g=0,h=f.length;g<h;g++){var m=f[g].sd,l=[m];e&&a.a.gb(l,e);a.aa.ad(f[g].Jd,l);m.nodeValue=\"\";m.parentNode&&m.parentNode.removeChild(m)}},Tc:function(a){return(a=a.match(/^\\[ko_memo\\:(.*?)\\]$/))?a[1]:null}}}();a.b(\"memoization\",a.aa);a.b(\"memoization.memoize\",a.aa.Wb);a.b(\"memoization.unmemoize\",a.aa.ad);a.b(\"memoization.parseMemoText\",a.aa.Tc);a.b(\"memoization.unmemoizeDomNodeAndDescendants\",a.aa.bd);a.ma=function(){function b(){if(f)for(var b=f,c=0,d;h<f;)if(d=e[h++]){if(h>b){if(5E3<=\n++c){h=f;a.a.Fc(Error(\"'Too much recursion' after processing \"+c+\" task groups.\"));break}b=f}try{d()}catch(g){a.a.Fc(g)}}}function c(){b();h=f=e.length=0}var d,e=[],f=0,g=1,h=0;z.MutationObserver?d=function(a){var b=w.createElement(\"div\");(new MutationObserver(a)).observe(b,{attributes:!0});return function(){b.classList.toggle(\"foo\")}}(c):d=w&&\"onreadystatechange\"in w.createElement(\"script\")?function(a){var b=w.createElement(\"script\");b.onreadystatechange=function(){b.onreadystatechange=null;w.documentElement.removeChild(b);\nb=null;a()};w.documentElement.appendChild(b)}:function(a){setTimeout(a,0)};return{scheduler:d,yb:function(b){f||a.ma.scheduler(c);e[f++]=b;return g++},cancel:function(a){a=a-(g-f);a>=h&&a<f&&(e[a]=null)},resetForTesting:function(){var a=f-h;h=f=e.length=0;return a},Rd:b}}();a.b(\"tasks\",a.ma);a.b(\"tasks.schedule\",a.ma.yb);a.b(\"tasks.runEarly\",a.ma.Rd);a.Ta={throttle:function(b,c){b.throttleEvaluation=c;var d=null;return a.$({read:b,write:function(e){clearTimeout(d);d=a.a.setTimeout(function(){b(e)},\nc)}})},rateLimit:function(a,c){var d,e,f;\"number\"==typeof c?d=c:(d=c.timeout,e=c.method);a.Hb=!1;f=\"function\"==typeof e?e:\"notifyWhenChangesStop\"==e?Y:X;a.tb(function(a){return f(a,d,c)})},deferred:function(b,c){if(!0!==c)throw Error(\"The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.\");b.Hb||(b.Hb=!0,b.tb(function(c){var e,f=!1;return function(){if(!f){a.ma.cancel(e);e=a.ma.yb(c);try{f=!0,b.notifySubscribers(p,\"dirty\")}finally{f=\n!1}}}}))},notify:function(a,c){a.equalityComparer=\"always\"==c?null:K}};var W={undefined:1,\"boolean\":1,number:1,string:1};a.b(\"extenders\",a.Ta);a.gc=function(b,c,d){this.da=b;this.kc=c;this.lc=d;this.Ib=!1;this.ab=this.Jb=null;a.J(this,\"dispose\",this.s);a.J(this,\"disposeWhenNodeIsRemoved\",this.l)};a.gc.prototype.s=function(){this.Ib||(this.ab&&a.a.I.xb(this.Jb,this.ab),this.Ib=!0,this.lc(),this.da=this.kc=this.lc=this.Jb=this.ab=null)};a.gc.prototype.l=function(b){this.Jb=b;a.a.I.za(b,this.ab=this.s.bind(this))};\na.R=function(){a.a.zb(this,D);D.ob(this)};var D={ob:function(a){a.S={change:[]};a.rc=1},subscribe:function(b,c,d){var e=this;d=d||\"change\";var f=new a.gc(e,c?b.bind(c):b,function(){a.a.hb(e.S[d],f);e.cb&&e.cb(d)});e.Qa&&e.Qa(d);e.S[d]||(e.S[d]=[]);e.S[d].push(f);return f},notifySubscribers:function(b,c){c=c||\"change\";\"change\"===c&&this.Gb();if(this.Wa(c)){var d=\"change\"===c&&this.dd||this.S[c].slice(0);try{a.v.wc();for(var e=0,f;f=d[e];++e)f.Ib||f.kc(b)}finally{a.v.end()}}},mb:function(){return this.rc},\nCd:function(a){return this.mb()!==a},Gb:function(){++this.rc},tb:function(b){var c=this,d=a.N(c),e,f,g,h,m;c.bb||(c.bb=c.notifySubscribers,c.notifySubscribers=Z);var l=b(function(){c.Ka=!1;d&&h===c&&(h=c.mc?c.mc():c());var a=f||m&&c.qb(g,h);m=f=e=!1;a&&c.bb(g=h)});c.pc=function(a,b){b&&c.Ka||(m=!b);c.dd=c.S.change.slice(0);c.Ka=e=!0;h=a;l()};c.oc=function(a){e||(g=a,c.bb(a,\"beforeChange\"))};c.qc=function(){m=!0};c.fd=function(){c.qb(g,c.w(!0))&&(f=!0)}},Wa:function(a){return this.S[a]&&this.S[a].length},\nAd:function(b){if(b)return this.S[b]&&this.S[b].length||0;var c=0;a.a.O(this.S,function(a,b){\"dirty\"!==a&&(c+=b.length)});return c},qb:function(a,c){return!this.equalityComparer||!this.equalityComparer(a,c)},toString:function(){return\"[object Object]\"},extend:function(b){var c=this;b&&a.a.O(b,function(b,e){var f=a.Ta[b];\"function\"==typeof f&&(c=f(c,e)||c)});return c}};a.J(D,\"init\",D.ob);a.J(D,\"subscribe\",D.subscribe);a.J(D,\"extend\",D.extend);a.J(D,\"getSubscriptionsCount\",D.Ad);a.a.Ba&&a.a.setPrototypeOf(D,\nFunction.prototype);a.R.fn=D;a.Pc=function(a){return null!=a&&\"function\"==typeof a.subscribe&&\"function\"==typeof a.notifySubscribers};a.b(\"subscribable\",a.R);a.b(\"isSubscribable\",a.Pc);a.U=a.v=function(){function b(a){d.push(e);e=a}function c(){e=d.pop()}var d=[],e,f=0;return{wc:b,end:c,ac:function(b){if(e){if(!a.Pc(b))throw Error(\"Only subscribable things can act as dependencies\");e.nd.call(e.od,b,b.ed||(b.ed=++f))}},K:function(a,d,e){try{return b(),a.apply(d,e||[])}finally{c()}},pa:function(){if(e)return e.o.pa()},\nVa:function(){if(e)return e.o.Va()},rb:function(){if(e)return e.rb},o:function(){if(e)return e.o}}}();a.b(\"computedContext\",a.U);a.b(\"computedContext.getDependenciesCount\",a.U.pa);a.b(\"computedContext.getDependencies\",a.U.Va);a.b(\"computedContext.isInitial\",a.U.rb);a.b(\"computedContext.registerDependency\",a.U.ac);a.b(\"ignoreDependencies\",a.Wd=a.v.K);var I=a.a.Da(\"_latestValue\");a.sa=function(b){function c(){if(0<arguments.length)return c.qb(c[I],arguments[0])&&(c.xa(),c[I]=arguments[0],c.wa()),this;\na.v.ac(c);return c[I]}c[I]=b;a.a.Ba||a.a.extend(c,a.R.fn);a.R.fn.ob(c);a.a.zb(c,F);a.options.deferUpdates&&a.Ta.deferred(c,!0);return c};var F={equalityComparer:K,w:function(){return this[I]},wa:function(){this.notifySubscribers(this[I],\"spectate\");this.notifySubscribers(this[I])},xa:function(){this.notifySubscribers(this[I],\"beforeChange\")}};a.a.Ba&&a.a.setPrototypeOf(F,a.R.fn);var G=a.sa.Na=\"__ko_proto__\";F[G]=a.sa;a.N=function(b){if((b=\"function\"==typeof b&&b[G])&&b!==F[G]&&b!==a.o.fn[G])throw Error(\"Invalid object that looks like an observable; possibly from another Knockout instance\");\nreturn!!b};a.Ya=function(b){return\"function\"==typeof b&&(b[G]===F[G]||b[G]===a.o.fn[G]&&b.Mc)};a.b(\"observable\",a.sa);a.b(\"isObservable\",a.N);a.b(\"isWriteableObservable\",a.Ya);a.b(\"isWritableObservable\",a.Ya);a.b(\"observable.fn\",F);a.J(F,\"peek\",F.w);a.J(F,\"valueHasMutated\",F.wa);a.J(F,\"valueWillMutate\",F.xa);a.Ia=function(b){b=b||[];if(\"object\"!=typeof b||!(\"length\"in b))throw Error(\"The argument passed when initializing an observable array must be an array, or null, or undefined.\");b=a.sa(b);a.a.zb(b,\na.Ia.fn);return b.extend({trackArrayChanges:!0})};a.Ia.fn={remove:function(b){for(var c=this.w(),d=[],e=\"function\"!=typeof b||a.N(b)?function(a){return a===b}:b,f=0;f<c.length;f++){var g=c[f];if(e(g)){0===d.length&&this.xa();if(c[f]!==g)throw Error(\"Array modified during remove; cannot remove item\");d.push(g);c.splice(f,1);f--}}d.length&&this.wa();return d},removeAll:function(b){if(b===p){var c=this.w(),d=c.slice(0);this.xa();c.splice(0,c.length);this.wa();return d}return b?this.remove(function(c){return 0<=\na.a.A(b,c)}):[]},destroy:function(b){var c=this.w(),d=\"function\"!=typeof b||a.N(b)?function(a){return a===b}:b;this.xa();for(var e=c.length-1;0<=e;e--){var f=c[e];d(f)&&(f._destroy=!0)}this.wa()},destroyAll:function(b){return b===p?this.destroy(function(){return!0}):b?this.destroy(function(c){return 0<=a.a.A(b,c)}):[]},indexOf:function(b){var c=this();return a.a.A(c,b)},replace:function(a,c){var d=this.indexOf(a);0<=d&&(this.xa(),this.w()[d]=c,this.wa())},sorted:function(a){var c=this().slice(0);\nreturn a?c.sort(a):c.sort()},reversed:function(){return this().slice(0).reverse()}};a.a.Ba&&a.a.setPrototypeOf(a.Ia.fn,a.sa.fn);a.a.C(\"pop push reverse shift sort splice unshift\".split(\" \"),function(b){a.Ia.fn[b]=function(){var a=this.w();this.xa();this.yc(a,b,arguments);var d=a[b].apply(a,arguments);this.wa();return d===a?this:d}});a.a.C([\"slice\"],function(b){a.Ia.fn[b]=function(){var a=this();return a[b].apply(a,arguments)}});a.Oc=function(b){return a.N(b)&&\"function\"==typeof b.remove&&\"function\"==\ntypeof b.push};a.b(\"observableArray\",a.Ia);a.b(\"isObservableArray\",a.Oc);a.Ta.trackArrayChanges=function(b,c){function d(){function c(){if(h){var d=[].concat(b.w()||[]);if(b.Wa(\"arrayChange\")){var e;if(!f||1<h)f=a.a.Ob(m,d,b.Nb);e=f}m=d;f=null;h=0;e&&e.length&&b.notifySubscribers(e,\"arrayChange\")}}e?c():(e=!0,l=b.notifySubscribers,b.notifySubscribers=function(a,b){b&&\"change\"!==b||++h;return l.apply(this,arguments)},m=[].concat(b.w()||[]),f=null,g=b.subscribe(c))}b.Nb={};c&&\"object\"==typeof c&&a.a.extend(b.Nb,\nc);b.Nb.sparse=!0;if(!b.yc){var e=!1,f=null,g,h=0,m,l,k=b.Qa,q=b.cb;b.Qa=function(a){k&&k.call(b,a);\"arrayChange\"===a&&d()};b.cb=function(a){q&&q.call(b,a);\"arrayChange\"!==a||b.Wa(\"arrayChange\")||(l&&(b.notifySubscribers=l,l=p),g&&g.s(),g=null,e=!1,m=p)};b.yc=function(b,c,d){function k(a,b,c){return l[l.length]={status:a,value:b,index:c}}if(e&&!h){var l=[],g=b.length,q=d.length,m=0;switch(c){case \"push\":m=g;case \"unshift\":for(c=0;c<q;c++)k(\"added\",d[c],m+c);break;case \"pop\":m=g-1;case \"shift\":g&&\nk(\"deleted\",b[m],m);break;case \"splice\":c=Math.min(Math.max(0,0>d[0]?g+d[0]:d[0]),g);for(var g=1===q?g:Math.min(c+(d[1]||0),g),q=c+q-2,m=Math.max(g,q),U=[],L=[],p=2;c<m;++c,++p)c<g&&L.push(k(\"deleted\",b[c],c)),c<q&&U.push(k(\"added\",d[p],c));a.a.Jc(L,U);break;default:return}f=l}}}};var t=a.a.Da(\"_state\");a.o=a.$=function(b,c,d){function e(){if(0<arguments.length){if(\"function\"===typeof f)f.apply(g.lb,arguments);else throw Error(\"Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.\");\nreturn this}g.qa||a.v.ac(e);(g.ka||g.G&&e.Xa())&&e.ha();return g.X}\"object\"===typeof b?d=b:(d=d||{},b&&(d.read=b));if(\"function\"!=typeof d.read)throw Error(\"Pass a function that returns the value of the ko.computed\");var f=d.write,g={X:p,ra:!0,ka:!0,pb:!1,hc:!1,qa:!1,vb:!1,G:!1,Vc:d.read,lb:c||d.owner,l:d.disposeWhenNodeIsRemoved||d.l||null,Sa:d.disposeWhen||d.Sa,Qb:null,F:{},V:0,Hc:null};e[t]=g;e.Mc=\"function\"===typeof f;a.a.Ba||a.a.extend(e,a.R.fn);a.R.fn.ob(e);a.a.zb(e,C);d.pure?(g.vb=!0,g.G=!0,\na.a.extend(e,da)):d.deferEvaluation&&a.a.extend(e,ea);a.options.deferUpdates&&a.Ta.deferred(e,!0);g.l&&(g.hc=!0,g.l.nodeType||(g.l=null));g.G||d.deferEvaluation||e.ha();g.l&&e.ja()&&a.a.I.za(g.l,g.Qb=function(){e.s()});return e};var C={equalityComparer:K,pa:function(){return this[t].V},Va:function(){var b=[];a.a.O(this[t].F,function(a,d){b[d.La]=d.da});return b},Ub:function(b){if(!this[t].V)return!1;var c=this.Va();return-1!==a.a.A(c,b)?!0:!!a.a.Lb(c,function(a){return a.Ub&&a.Ub(b)})},tc:function(a,\nc,d){if(this[t].vb&&c===this)throw Error(\"A 'pure' computed must not be called recursively\");this[t].F[a]=d;d.La=this[t].V++;d.Ma=c.mb()},Xa:function(){var a,c,d=this[t].F;for(a in d)if(Object.prototype.hasOwnProperty.call(d,a)&&(c=d[a],this.Ja&&c.da.Ka||c.da.Cd(c.Ma)))return!0},Id:function(){this.Ja&&!this[t].pb&&this.Ja(!1)},ja:function(){var a=this[t];return a.ka||0<a.V},Qd:function(){this.Ka?this[t].ka&&(this[t].ra=!0):this.Gc()},Zc:function(a){if(a.Hb){var c=a.subscribe(this.Id,this,\"dirty\"),\nd=a.subscribe(this.Qd,this);return{da:a,s:function(){c.s();d.s()}}}return a.subscribe(this.Gc,this)},Gc:function(){var b=this,c=b.throttleEvaluation;c&&0<=c?(clearTimeout(this[t].Hc),this[t].Hc=a.a.setTimeout(function(){b.ha(!0)},c)):b.Ja?b.Ja(!0):b.ha(!0)},ha:function(b){var c=this[t],d=c.Sa,e=!1;if(!c.pb&&!c.qa){if(c.l&&!a.a.Rb(c.l)||d&&d()){if(!c.hc){this.s();return}}else c.hc=!1;c.pb=!0;try{e=this.yd(b)}finally{c.pb=!1}return e}},yd:function(b){var c=this[t],d=!1,e=c.vb?p:!c.V,d={pd:this,kb:c.F,\nPb:c.V};a.v.wc({od:d,nd:ba,o:this,rb:e});c.F={};c.V=0;var f=this.xd(c,d);c.V?d=this.qb(c.X,f):(this.s(),d=!0);d&&(c.G?this.Gb():this.notifySubscribers(c.X,\"beforeChange\"),c.X=f,this.notifySubscribers(c.X,\"spectate\"),!c.G&&b&&this.notifySubscribers(c.X),this.qc&&this.qc());e&&this.notifySubscribers(c.X,\"awake\");return d},xd:function(b,c){try{var d=b.Vc;return b.lb?d.call(b.lb):d()}finally{a.v.end(),c.Pb&&!b.G&&a.a.O(c.kb,aa),b.ra=b.ka=!1}},w:function(a){var c=this[t];(c.ka&&(a||!c.V)||c.G&&this.Xa())&&\nthis.ha();return c.X},tb:function(b){a.R.fn.tb.call(this,b);this.mc=function(){this[t].G||(this[t].ra?this.ha():this[t].ka=!1);return this[t].X};this.Ja=function(a){this.oc(this[t].X);this[t].ka=!0;a&&(this[t].ra=!0);this.pc(this,!a)}},s:function(){var b=this[t];!b.G&&b.F&&a.a.O(b.F,function(a,b){b.s&&b.s()});b.l&&b.Qb&&a.a.I.xb(b.l,b.Qb);b.F=p;b.V=0;b.qa=!0;b.ra=!1;b.ka=!1;b.G=!1;b.l=p;b.Sa=p;b.Vc=p;this.Mc||(b.lb=p)}},da={Qa:function(b){var c=this,d=c[t];if(!d.qa&&d.G&&\"change\"==b){d.G=!1;if(d.ra||\nc.Xa())d.F=null,d.V=0,c.ha()&&c.Gb();else{var e=[];a.a.O(d.F,function(a,b){e[b.La]=a});a.a.C(e,function(a,b){var e=d.F[a],m=c.Zc(e.da);m.La=b;m.Ma=e.Ma;d.F[a]=m});c.Xa()&&c.ha()&&c.Gb()}d.qa||c.notifySubscribers(d.X,\"awake\")}},cb:function(b){var c=this[t];c.qa||\"change\"!=b||this.Wa(\"change\")||(a.a.O(c.F,function(a,b){b.s&&(c.F[a]={da:b.da,La:b.La,Ma:b.Ma},b.s())}),c.G=!0,this.notifySubscribers(p,\"asleep\"))},mb:function(){var b=this[t];b.G&&(b.ra||this.Xa())&&this.ha();return a.R.fn.mb.call(this)}},\nea={Qa:function(a){\"change\"!=a&&\"beforeChange\"!=a||this.w()}};a.a.Ba&&a.a.setPrototypeOf(C,a.R.fn);var N=a.sa.Na;C[N]=a.o;a.Nc=function(a){return\"function\"==typeof a&&a[N]===C[N]};a.Ed=function(b){return a.Nc(b)&&b[t]&&b[t].vb};a.b(\"computed\",a.o);a.b(\"dependentObservable\",a.o);a.b(\"isComputed\",a.Nc);a.b(\"isPureComputed\",a.Ed);a.b(\"computed.fn\",C);a.J(C,\"peek\",C.w);a.J(C,\"dispose\",C.s);a.J(C,\"isActive\",C.ja);a.J(C,\"getDependenciesCount\",C.pa);a.J(C,\"getDependencies\",C.Va);a.wb=function(b,c){if(\"function\"===\ntypeof b)return a.o(b,c,{pure:!0});b=a.a.extend({},b);b.pure=!0;return a.o(b,c)};a.b(\"pureComputed\",a.wb);(function(){function b(a,f,g){g=g||new d;a=f(a);if(\"object\"!=typeof a||null===a||a===p||a instanceof RegExp||a instanceof Date||a instanceof String||a instanceof Number||a instanceof Boolean)return a;var h=a instanceof Array?[]:{};g.save(a,h);c(a,function(c){var d=f(a[c]);switch(typeof d){case \"boolean\":case \"number\":case \"string\":case \"function\":h[c]=d;break;case \"object\":case \"undefined\":var k=\ng.get(d);h[c]=k!==p?k:b(d,f,g)}});return h}function c(a,b){if(a instanceof Array){for(var c=0;c<a.length;c++)b(c);\"function\"==typeof a.toJSON&&b(\"toJSON\")}else for(c in a)b(c)}function d(){this.keys=[];this.values=[]}a.$c=function(c){if(0==arguments.length)throw Error(\"When calling ko.toJS, pass the object you want to convert.\");return b(c,function(b){for(var c=0;a.N(b)&&10>c;c++)b=b();return b})};a.toJSON=function(b,c,d){b=a.$c(b);return a.a.fc(b,c,d)};d.prototype={constructor:d,save:function(b,\nc){var d=a.a.A(this.keys,b);0<=d?this.values[d]=c:(this.keys.push(b),this.values.push(c))},get:function(b){b=a.a.A(this.keys,b);return 0<=b?this.values[b]:p}}})();a.b(\"toJS\",a.$c);a.b(\"toJSON\",a.toJSON);a.Vd=function(b,c,d){function e(c){var e=a.wb(b,d).extend({Ga:\"always\"}),h=e.subscribe(function(a){a&&(h.s(),c(a))});e.notifySubscribers(e.w());return h}return\"function\"!==typeof Promise||c?e(c.bind(d)):new Promise(e)};a.b(\"when\",a.Vd);(function(){a.u={L:function(b){switch(a.a.P(b)){case \"option\":return!0===\nb.__ko__hasDomDataOptionValue__?a.a.g.get(b,a.f.options.Yb):7>=a.a.W?b.getAttributeNode(\"value\")&&b.getAttributeNode(\"value\").specified?b.value:b.text:b.value;case \"select\":return 0<=b.selectedIndex?a.u.L(b.options[b.selectedIndex]):p;default:return b.value}},ya:function(b,c,d){switch(a.a.P(b)){case \"option\":\"string\"===typeof c?(a.a.g.set(b,a.f.options.Yb,p),\"__ko__hasDomDataOptionValue__\"in b&&delete b.__ko__hasDomDataOptionValue__,b.value=c):(a.a.g.set(b,a.f.options.Yb,c),b.__ko__hasDomDataOptionValue__=\n!0,b.value=\"number\"===typeof c?c:\"\");break;case \"select\":if(\"\"===c||null===c)c=p;for(var e=-1,f=0,g=b.options.length,h;f<g;++f)if(h=a.u.L(b.options[f]),h==c||\"\"===h&&c===p){e=f;break}if(d||0<=e||c===p&&1<b.size)b.selectedIndex=e,6===a.a.W&&a.a.setTimeout(function(){b.selectedIndex=e},0);break;default:if(null===c||c===p)c=\"\";b.value=c}}}})();a.b(\"selectExtensions\",a.u);a.b(\"selectExtensions.readValue\",a.u.L);a.b(\"selectExtensions.writeValue\",a.u.ya);a.m=function(){function b(b){b=a.a.Cb(b);123===b.charCodeAt(0)&&\n(b=b.slice(1,-1));b+=\"\\n,\";var c=[],d=b.match(e),q,n=[],h=0;if(1<d.length){for(var y=0,A;A=d[y];++y){var u=A.charCodeAt(0);if(44===u){if(0>=h){c.push(q&&n.length?{key:q,value:n.join(\"\")}:{unknown:q||n.join(\"\")});q=h=0;n=[];continue}}else if(58===u){if(!h&&!q&&1===n.length){q=n.pop();continue}}else if(47===u&&1<A.length&&(47===A.charCodeAt(1)||42===A.charCodeAt(1)))continue;else 47===u&&y&&1<A.length?(u=d[y-1].match(f))&&!g[u[0]]&&(b=b.substr(b.indexOf(A)+1),d=b.match(e),y=-1,A=\"/\"):40===u||123===\nu||91===u?++h:41===u||125===u||93===u?--h:q||n.length||34!==u&&39!==u||(A=A.slice(1,-1));n.push(A)}if(0<h)throw Error(\"Unbalanced parentheses, braces, or brackets\");}return c}var c=[\"true\",\"false\",\"null\",\"undefined\"],d=/^(?:[$_a-z][$\\w]*|(.+)(\\.\\s*[$_a-z][$\\w]*|\\[.+\\]))$/i,e=RegExp(\"\\\"(?:\\\\\\\\.|[^\\\"])*\\\"|'(?:\\\\\\\\.|[^'])*'|`(?:\\\\\\\\.|[^`])*`|/\\\\*(?:[^*]|\\\\*+[^*/])*\\\\*+/|//.*\\n|/(?:\\\\\\\\.|[^/])+/w*|[^\\\\s:,/][^,\\\"'`{}()/:[\\\\]]*[^\\\\s,\\\"'`{}()/:[\\\\]]|[^\\\\s]\",\"g\"),f=/[\\])\"'A-Za-z0-9_$]+$/,g={\"in\":1,\"return\":1,\n\"typeof\":1},h={};return{Ra:[],va:h,Zb:b,ub:function(e,f){function k(b,e){var f;if(!y){var l=a.getBindingHandler(b);if(l&&l.preprocess&&!(e=l.preprocess(e,b,k)))return;if(l=h[b])f=e,0<=a.a.A(c,f)?f=!1:(l=f.match(d),f=null===l?!1:l[1]?\"Object(\"+l[1]+\")\"+l[2]:f),l=f;l&&n.push(\"'\"+(\"string\"==typeof h[b]?h[b]:b)+\"':function(_z){\"+f+\"=_z}\")}g&&(e=\"function(){return \"+e+\" }\");q.push(\"'\"+b+\"':\"+e)}f=f||{};var q=[],n=[],g=f.valueAccessors,y=f.bindingParams,A=\"string\"===typeof e?b(e):e;a.a.C(A,function(a){k(a.key||\na.unknown,a.value)});n.length&&k(\"_ko_property_writers\",\"{\"+n.join(\",\")+\" }\");return q.join(\",\")},Hd:function(a,b){for(var c=0;c<a.length;c++)if(a[c].key==b)return!0;return!1},$a:function(b,c,d,e,f){if(b&&a.N(b))!a.Ya(b)||f&&b.w()===e||b(e);else if((b=c.get(\"_ko_property_writers\"))&&b[d])b[d](e)}}}();a.b(\"expressionRewriting\",a.m);a.b(\"expressionRewriting.bindingRewriteValidators\",a.m.Ra);a.b(\"expressionRewriting.parseObjectLiteral\",a.m.Zb);a.b(\"expressionRewriting.preProcessBindings\",a.m.ub);a.b(\"expressionRewriting._twoWayBindings\",\na.m.va);a.b(\"jsonExpressionRewriting\",a.m);a.b(\"jsonExpressionRewriting.insertPropertyAccessorsIntoJson\",a.m.ub);(function(){function b(a){return 8==a.nodeType&&g.test(f?a.text:a.nodeValue)}function c(a){return 8==a.nodeType&&h.test(f?a.text:a.nodeValue)}function d(d,e){for(var f=d,g=1,h=[];f=f.nextSibling;){if(c(f)&&(a.a.g.set(f,l,!0),g--,0===g))return h;h.push(f);b(f)&&g++}if(!e)throw Error(\"Cannot find closing comment tag to match: \"+d.nodeValue);return null}function e(a,b){var c=d(a,b);return c?\n0<c.length?c[c.length-1].nextSibling:a.nextSibling:null}var f=w&&\"\\x3c!--test--\\x3e\"===w.createComment(\"test\").text,g=f?/^\\x3c!--\\s*ko(?:\\s+([\\s\\S]+))?\\s*--\\x3e$/:/^\\s*ko(?:\\s+([\\s\\S]+))?\\s*$/,h=f?/^\\x3c!--\\s*\\/ko\\s*--\\x3e$/:/^\\s*\\/ko\\s*$/,m={ul:!0,ol:!0},l=\"__ko_matchedEndComment__\";a.h={ea:{},childNodes:function(a){return b(a)?d(a):a.childNodes},Ea:function(c){if(b(c)){c=a.h.childNodes(c);for(var d=0,e=c.length;d<e;d++)a.removeNode(c[d])}else a.a.Sb(c)},ua:function(c,d){if(b(c)){a.h.Ea(c);for(var e=\nc.nextSibling,f=0,l=d.length;f<l;f++)e.parentNode.insertBefore(d[f],e)}else a.a.ua(c,d)},Uc:function(a,c){b(a)?a.parentNode.insertBefore(c,a.nextSibling):a.firstChild?a.insertBefore(c,a.firstChild):a.appendChild(c)},Vb:function(c,d,e){e?b(c)?c.parentNode.insertBefore(d,e.nextSibling):e.nextSibling?c.insertBefore(d,e.nextSibling):c.appendChild(d):a.h.Uc(c,d)},firstChild:function(a){if(b(a))return!a.nextSibling||c(a.nextSibling)?null:a.nextSibling;if(a.firstChild&&c(a.firstChild))throw Error(\"Found invalid end comment, as the first child of \"+\na);return a.firstChild},nextSibling:function(d){b(d)&&(d=e(d));if(d.nextSibling&&c(d.nextSibling)){var f=d.nextSibling;if(c(f)&&!a.a.g.get(f,l))throw Error(\"Found end comment without a matching opening comment, as child of \"+d);return null}return d.nextSibling},Bd:b,Ud:function(a){return(a=(f?a.text:a.nodeValue).match(g))?a[1]:null},Rc:function(d){if(m[a.a.P(d)]){var f=d.firstChild;if(f){do if(1===f.nodeType){var l;l=f.firstChild;var g=null;if(l){do if(g)g.push(l);else if(b(l)){var h=e(l,!0);h?l=\nh:g=[l]}else c(l)&&(g=[l]);while(l=l.nextSibling)}if(l=g)for(g=f.nextSibling,h=0;h<l.length;h++)g?d.insertBefore(l[h],g):d.appendChild(l[h])}while(f=f.nextSibling)}}}}})();a.b(\"virtualElements\",a.h);a.b(\"virtualElements.allowedBindings\",a.h.ea);a.b(\"virtualElements.emptyNode\",a.h.Ea);a.b(\"virtualElements.insertAfter\",a.h.Vb);a.b(\"virtualElements.prepend\",a.h.Uc);a.b(\"virtualElements.setDomNodeChildren\",a.h.ua);(function(){a.ga=function(){this.md={}};a.a.extend(a.ga.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return null!=\nb.getAttribute(\"data-bind\")||a.i.getComponentNameForNode(b);case 8:return a.h.Bd(b);default:return!1}},getBindings:function(b,c){var d=this.getBindingsString(b,c),d=d?this.parseBindingsString(d,c,b):null;return a.i.sc(d,b,c,!1)},getBindingAccessors:function(b,c){var d=this.getBindingsString(b,c),d=d?this.parseBindingsString(d,c,b,{valueAccessors:!0}):null;return a.i.sc(d,b,c,!0)},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute(\"data-bind\");case 8:return a.h.Ud(b);default:return null}},\nparseBindingsString:function(b,c,d,e){try{var f=this.md,g=b+(e&&e.valueAccessors||\"\"),h;if(!(h=f[g])){var m,l=\"with($context){with($data||{}){return{\"+a.m.ub(b,e)+\"}}}\";m=new Function(\"$context\",\"$element\",l);h=f[g]=m}return h(c,d)}catch(k){throw k.message=\"Unable to parse bindings.\\nBindings value: \"+b+\"\\nMessage: \"+k.message,k;}}});a.ga.instance=new a.ga})();a.b(\"bindingProvider\",a.ga);(function(){function b(b){var c=(b=a.a.g.get(b,B))&&b.M;c&&(b.M=null,c.Sc())}function c(c,d,e){this.node=c;this.xc=\nd;this.ib=[];this.T=!1;d.M||a.a.I.za(c,b);e&&e.M&&(e.M.ib.push(c),this.Kb=e)}function d(a){return function(){return a}}function e(a){return a()}function f(b){return a.a.Ha(a.v.K(b),function(a,c){return function(){return b()[c]}})}function g(b,c,e){return\"function\"===typeof b?f(b.bind(null,c,e)):a.a.Ha(b,d)}function h(a,b){return f(this.getBindings.bind(this,a,b))}function m(b,c){var d=a.h.firstChild(c);if(d){var e,f=a.ga.instance,k=f.preprocessNode;if(k){for(;e=d;)d=a.h.nextSibling(e),k.call(f,e);\nd=a.h.firstChild(c)}for(;e=d;)d=a.h.nextSibling(e),l(b,e)}a.j.Ga(c,a.j.T)}function l(b,c){var d=b,e=1===c.nodeType;e&&a.h.Rc(c);if(e||a.ga.instance.nodeHasBindings(c))d=q(c,null,b).bindingContextForDescendants;d&&!u[a.a.P(c)]&&m(d,c)}function k(b){var c=[],d={},e=[];a.a.O(b,function ca(f){if(!d[f]){var l=a.getBindingHandler(f);l&&(l.after&&(e.push(f),a.a.C(l.after,function(c){if(b[c]){if(-1!==a.a.A(e,c))throw Error(\"Cannot combine the following bindings, because they have a cyclic dependency: \"+e.join(\", \"));\nca(c)}}),e.length--),c.push({key:f,Lc:l}));d[f]=!0}});return c}function q(b,c,d){var f=a.a.g.Tb(b,B,{}),l=f.gd;if(!c){if(l)throw Error(\"You cannot apply bindings multiple times to the same element.\");f.gd=!0}l||(f.context=d);var g;if(c&&\"function\"!==typeof c)g=c;else{var q=a.ga.instance,n=q.getBindingAccessors||h,m=a.$(function(){if(g=c?c(d,b):n.call(q,b,d)){if(d[r])d[r]();if(d[A])d[A]()}return g},null,{l:b});g&&m.ja()||(m=null)}var y=d,u;if(g){var J=function(){return a.a.Ha(m?m():g,e)},t=m?function(a){return function(){return e(m()[a])}}:\nfunction(a){return g[a]};J.get=function(a){return g[a]&&e(t(a))};J.has=function(a){return a in g};a.j.T in g&&a.j.subscribe(b,a.j.T,function(){var c=(0,g[a.j.T])();if(c){var d=a.h.childNodes(b);d.length&&c(d,a.Dc(d[0]))}});a.j.oa in g&&(y=a.j.Bb(b,d),a.j.subscribe(b,a.j.oa,function(){var c=(0,g[a.j.oa])();c&&a.h.firstChild(b)&&c(b)}));f=k(g);a.a.C(f,function(c){var d=c.Lc.init,e=c.Lc.update,f=c.key;if(8===b.nodeType&&!a.h.ea[f])throw Error(\"The binding '\"+f+\"' cannot be used with virtual elements\");\ntry{\"function\"==typeof d&&a.v.K(function(){var a=d(b,t(f),J,y.$data,y);if(a&&a.controlsDescendantBindings){if(u!==p)throw Error(\"Multiple bindings (\"+u+\" and \"+f+\") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.\");u=f}}),\"function\"==typeof e&&a.$(function(){e(b,t(f),J,y.$data,y)},null,{l:b})}catch(l){throw l.message='Unable to process binding \"'+f+\": \"+g[f]+'\"\\nMessage: '+l.message,l;}})}f=u===p;return{shouldBindDescendants:f,\nbindingContextForDescendants:f&&y}}function n(b,c){return b&&b instanceof a.fa?b:new a.fa(b,p,p,c)}var r=a.a.Da(\"_subscribable\"),y=a.a.Da(\"_ancestorBindingInfo\"),A=a.a.Da(\"_dataDependency\");a.f={};var u={script:!0,textarea:!0,template:!0};a.getBindingHandler=function(b){return a.f[b]};var J={};a.fa=function(b,c,d,e,f){function l(){var b=q?h():h,f=a.a.c(b);c?(a.a.extend(k,c),y in c&&(k[y]=c[y])):(k.$parents=[],k.$root=f,k.ko=a);k[r]=n;g?f=k.$data:(k.$rawData=b,k.$data=f);d&&(k[d]=f);e&&e(k,c,f);if(c&&\nc[r]&&!a.U.o().Ub(c[r]))c[r]();m&&(k[A]=m);return k.$data}var k=this,g=b===J,h=g?p:b,q=\"function\"==typeof h&&!a.N(h),n,m=f&&f.dataDependency;f&&f.exportDependencies?l():(n=a.wb(l),n.w(),n.ja()?n.equalityComparer=null:k[r]=p)};a.fa.prototype.createChildContext=function(b,c,d,e){!e&&c&&\"object\"==typeof c&&(e=c,c=e.as,d=e.extend);if(c&&e&&e.noChildContext){var f=\"function\"==typeof b&&!a.N(b);return new a.fa(J,this,null,function(a){d&&d(a);a[c]=f?b():b},e)}return new a.fa(b,this,c,function(a,b){a.$parentContext=\nb;a.$parent=b.$data;a.$parents=(b.$parents||[]).slice(0);a.$parents.unshift(a.$parent);d&&d(a)},e)};a.fa.prototype.extend=function(b,c){return new a.fa(J,this,null,function(c){a.a.extend(c,\"function\"==typeof b?b(c):b)},c)};var B=a.a.g.Z();c.prototype.Sc=function(){this.Kb&&this.Kb.M&&this.Kb.M.rd(this.node)};c.prototype.rd=function(b){a.a.hb(this.ib,b);!this.ib.length&&this.T&&this.Bc()};c.prototype.Bc=function(){this.T=!0;this.xc.M&&!this.ib.length&&(this.xc.M=null,a.a.I.xb(this.node,b),a.j.Ga(this.node,\na.j.oa),this.Sc())};a.j={T:\"childrenComplete\",oa:\"descendantsComplete\",subscribe:function(b,c,d,e){b=a.a.g.Tb(b,B,{});b.Fa||(b.Fa=new a.R);return b.Fa.subscribe(d,e,c)},Ga:function(b,c){var d=a.a.g.get(b,B);if(d&&(d.Fa&&d.Fa.notifySubscribers(b,c),c==a.j.T))if(d.M)d.M.Bc();else if(d.M===p&&d.Fa&&d.Fa.Wa(a.j.oa))throw Error(\"descendantsComplete event not supported for bindings on this node\");},Bb:function(b,d){var e=a.a.g.Tb(b,B,{});e.M||(e.M=new c(b,e,d[y]));return d[y]==e?d:d.extend(function(a){a[y]=\ne})}};a.Sd=function(b){return(b=a.a.g.get(b,B))&&b.context};a.eb=function(b,c,d){1===b.nodeType&&a.h.Rc(b);return q(b,c,n(d))};a.kd=function(b,c,d){d=n(d);return a.eb(b,g(c,d,b),d)};a.Pa=function(a,b){1!==b.nodeType&&8!==b.nodeType||m(n(a),b)};a.uc=function(a,b,c){!v&&z.jQuery&&(v=z.jQuery);if(2>arguments.length){if(b=w.body,!b)throw Error(\"ko.applyBindings: could not find document.body; has the document been loaded?\");}else if(!b||1!==b.nodeType&&8!==b.nodeType)throw Error(\"ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node\");\nl(n(a,c),b)};a.Cc=function(b){return!b||1!==b.nodeType&&8!==b.nodeType?p:a.Sd(b)};a.Dc=function(b){return(b=a.Cc(b))?b.$data:p};a.b(\"bindingHandlers\",a.f);a.b(\"bindingEvent\",a.j);a.b(\"bindingEvent.subscribe\",a.j.subscribe);a.b(\"bindingEvent.startPossiblyAsyncContentBinding\",a.j.Bb);a.b(\"applyBindings\",a.uc);a.b(\"applyBindingsToDescendants\",a.Pa);a.b(\"applyBindingAccessorsToNode\",a.eb);a.b(\"applyBindingsToNode\",a.kd);a.b(\"contextFor\",a.Cc);a.b(\"dataFor\",a.Dc)})();(function(b){function c(c,e){var l=\nObject.prototype.hasOwnProperty.call(f,c)?f[c]:b,k;l?l.subscribe(e):(l=f[c]=new a.R,l.subscribe(e),d(c,function(b,d){var e=!(!d||!d.synchronous);g[c]={definition:b,Fd:e};delete f[c];k||e?l.notifySubscribers(b):a.ma.yb(function(){l.notifySubscribers(b)})}),k=!0)}function d(a,b){e(\"getConfig\",[a],function(c){c?e(\"loadComponent\",[a,c],function(a){b(a,c)}):b(null,null)})}function e(c,d,f,k){k||(k=a.i.loaders.slice(0));var g=k.shift();if(g){var n=g[c];if(n){var r=!1;if(n.apply(g,d.concat(function(a){r?\nf(null):null!==a?f(a):e(c,d,f,k)}))!==b&&(r=!0,!g.suppressLoaderExceptions))throw Error(\"Component loaders must supply values by invoking the callback, not by returning values synchronously.\");}else e(c,d,f,k)}else f(null)}var f={},g={};a.i={get:function(d,e){var f=Object.prototype.hasOwnProperty.call(g,d)?g[d]:b;f?f.Fd?a.v.K(function(){e(f.definition)}):a.ma.yb(function(){e(f.definition)}):c(d,e)},Ac:function(a){delete g[a]},nc:e};a.i.loaders=[];a.b(\"components\",a.i);a.b(\"components.get\",a.i.get);\na.b(\"components.clearCachedDefinition\",a.i.Ac)})();(function(){function b(b,c,d,e){function g(){0===--A&&e(h)}var h={},A=2,u=d.template;d=d.viewModel;u?f(c,u,function(c){a.i.nc(\"loadTemplate\",[b,c],function(a){h.template=a;g()})}):g();d?f(c,d,function(c){a.i.nc(\"loadViewModel\",[b,c],function(a){h[m]=a;g()})}):g()}function c(a,b,d){if(\"function\"===typeof b)d(function(a){return new b(a)});else if(\"function\"===typeof b[m])d(b[m]);else if(\"instance\"in b){var e=b.instance;d(function(){return e})}else\"viewModel\"in\nb?c(a,b.viewModel,d):a(\"Unknown viewModel value: \"+b)}function d(b){switch(a.a.P(b)){case \"script\":return a.a.ta(b.text);case \"textarea\":return a.a.ta(b.value);case \"template\":if(e(b.content))return a.a.Ca(b.content.childNodes)}return a.a.Ca(b.childNodes)}function e(a){return z.DocumentFragment?a instanceof DocumentFragment:a&&11===a.nodeType}function f(a,b,c){\"string\"===typeof b.require?T||z.require?(T||z.require)([b.require],c):a(\"Uses require, but no AMD loader is present\"):c(b)}function g(a){return function(b){throw Error(\"Component '\"+\na+\"': \"+b);}}var h={};a.i.register=function(b,c){if(!c)throw Error(\"Invalid configuration for \"+b);if(a.i.sb(b))throw Error(\"Component \"+b+\" is already registered\");h[b]=c};a.i.sb=function(a){return Object.prototype.hasOwnProperty.call(h,a)};a.i.unregister=function(b){delete h[b];a.i.Ac(b)};a.i.Ec={getConfig:function(b,c){c(a.i.sb(b)?h[b]:null)},loadComponent:function(a,c,d){var e=g(a);f(e,c,function(c){b(a,e,c,d)})},loadTemplate:function(b,c,f){b=g(b);if(\"string\"===typeof c)f(a.a.ta(c));else if(c instanceof\nArray)f(c);else if(e(c))f(a.a.la(c.childNodes));else if(c.element)if(c=c.element,z.HTMLElement?c instanceof HTMLElement:c&&c.tagName&&1===c.nodeType)f(d(c));else if(\"string\"===typeof c){var h=w.getElementById(c);h?f(d(h)):b(\"Cannot find element with ID \"+c)}else b(\"Unknown element type: \"+c);else b(\"Unknown template value: \"+c)},loadViewModel:function(a,b,d){c(g(a),b,d)}};var m=\"createViewModel\";a.b(\"components.register\",a.i.register);a.b(\"components.isRegistered\",a.i.sb);a.b(\"components.unregister\",\na.i.unregister);a.b(\"components.defaultLoader\",a.i.Ec);a.i.loaders.push(a.i.Ec);a.i.cd=h})();(function(){function b(b,e){var f=b.getAttribute(\"params\");if(f){var f=c.parseBindingsString(f,e,b,{valueAccessors:!0,bindingParams:!0}),f=a.a.Ha(f,function(c){return a.o(c,null,{l:b})}),g=a.a.Ha(f,function(c){var e=c.w();return c.ja()?a.o({read:function(){return a.a.c(c())},write:a.Ya(e)&&function(a){c()(a)},l:b}):e});Object.prototype.hasOwnProperty.call(g,\"$raw\")||(g.$raw=f);return g}return{$raw:{}}}a.i.getComponentNameForNode=\nfunction(b){var c=a.a.P(b);if(a.i.sb(c)&&(-1!=c.indexOf(\"-\")||\"[object HTMLUnknownElement]\"==\"\"+b||8>=a.a.W&&b.tagName===c))return c};a.i.sc=function(c,e,f,g){if(1===e.nodeType){var h=a.i.getComponentNameForNode(e);if(h){c=c||{};if(c.component)throw Error('Cannot use the \"component\" binding on a custom element matching a component');var m={name:h,params:b(e,f)};c.component=g?function(){return m}:m}}return c};var c=new a.ga;9>a.a.W&&(a.i.register=function(a){return function(b){return a.apply(this,\narguments)}}(a.i.register),w.createDocumentFragment=function(b){return function(){var c=b(),f=a.i.cd,g;for(g in f);return c}}(w.createDocumentFragment))})();(function(){function b(b,c,d){c=c.template;if(!c)throw Error(\"Component '\"+b+\"' has no template\");b=a.a.Ca(c);a.h.ua(d,b)}function c(a,b,c){var d=a.createViewModel;return d?d.call(a,b,c):b}var d=0;a.f.component={init:function(e,f,g,h,m){function l(){var a=k&&k.dispose;\"function\"===typeof a&&a.call(k);n&&n.s();q=k=n=null}var k,q,n,r=a.a.la(a.h.childNodes(e));\na.h.Ea(e);a.a.I.za(e,l);a.o(function(){var g=a.a.c(f()),h,u;\"string\"===typeof g?h=g:(h=a.a.c(g.name),u=a.a.c(g.params));if(!h)throw Error(\"No component name specified\");var p=a.j.Bb(e,m),B=q=++d;a.i.get(h,function(d){if(q===B){l();if(!d)throw Error(\"Unknown component '\"+h+\"'\");b(h,d,e);var f=c(d,u,{element:e,templateNodes:r});d=p.createChildContext(f,{extend:function(a){a.$component=f;a.$componentTemplateNodes=r}});f&&f.koDescendantsComplete&&(n=a.j.subscribe(e,a.j.oa,f.koDescendantsComplete,f));\nk=f;a.Pa(d,e)}})},null,{l:e});return{controlsDescendantBindings:!0}}};a.h.ea.component=!0})();var V={\"class\":\"className\",\"for\":\"htmlFor\"};a.f.attr={update:function(b,c){var d=a.a.c(c())||{};a.a.O(d,function(c,d){d=a.a.c(d);var g=c.indexOf(\":\"),g=\"lookupNamespaceURI\"in b&&0<g&&b.lookupNamespaceURI(c.substr(0,g)),h=!1===d||null===d||d===p;h?g?b.removeAttributeNS(g,c):b.removeAttribute(c):d=d.toString();8>=a.a.W&&c in V?(c=V[c],h?b.removeAttribute(c):b[c]=d):h||(g?b.setAttributeNS(g,c,d):b.setAttribute(c,\nd));\"name\"===c&&a.a.Xc(b,h?\"\":d)})}};(function(){a.f.checked={after:[\"value\",\"attr\"],init:function(b,c,d){function e(){var e=b.checked,f=g();if(!a.U.rb()&&(e||!m&&!a.U.pa())){var l=a.v.K(c);if(k){var n=q?l.w():l,B=r;r=f;B!==f?e&&(a.a.Oa(n,f,!0),a.a.Oa(n,B,!1)):a.a.Oa(n,f,e);q&&a.Ya(l)&&l(n)}else h&&(f===p?f=e:e||(f=p)),a.m.$a(l,d,\"checked\",f,!0)}}function f(){var d=a.a.c(c()),e=g();k?(b.checked=0<=a.a.A(d,e),r=e):b.checked=h&&e===p?!!d:g()===d}var g=a.wb(function(){if(d.has(\"checkedValue\"))return a.a.c(d.get(\"checkedValue\"));\nif(n)return d.has(\"value\")?a.a.c(d.get(\"value\")):b.value}),h=\"checkbox\"==b.type,m=\"radio\"==b.type;if(h||m){var l=c(),k=h&&a.a.c(l)instanceof Array,q=!(k&&l.push&&l.splice),n=m||k,r=k?g():p;m&&!b.name&&a.f.uniqueName.init(b,function(){return!0});a.o(e,null,{l:b});a.a.H(b,\"click\",e);a.o(f,null,{l:b});l=p}}};a.m.va.checked=!0;a.f.checkedValue={update:function(b,c){b.value=a.a.c(c())}}})();a.f[\"class\"]={update:function(b,c){var d=a.a.Cb(a.a.c(c()));a.a.Eb(b,b.__ko__cssValue,!1);b.__ko__cssValue=d;a.a.Eb(b,\nd,!0)}};a.f.css={update:function(b,c){var d=a.a.c(c());null!==d&&\"object\"==typeof d?a.a.O(d,function(c,d){d=a.a.c(d);a.a.Eb(b,c,d)}):a.f[\"class\"].update(b,c)}};a.f.enable={update:function(b,c){var d=a.a.c(c());d&&b.disabled?b.removeAttribute(\"disabled\"):d||b.disabled||(b.disabled=!0)}};a.f.disable={update:function(b,c){a.f.enable.update(b,function(){return!a.a.c(c())})}};a.f.event={init:function(b,c,d,e,f){var g=c()||{};a.a.O(g,function(g){\"string\"==typeof g&&a.a.H(b,g,function(b){var l,k=c()[g];\nif(k){try{var q=a.a.la(arguments);e=f.$data;q.unshift(e);l=k.apply(e,q)}finally{!0!==l&&(b.preventDefault?b.preventDefault():b.returnValue=!1)}!1===d.get(g+\"Bubble\")&&(b.cancelBubble=!0,b.stopPropagation&&b.stopPropagation())}})})}};a.f.foreach={Qc:function(b){return function(){var c=b(),d=a.a.$b(c);if(!d||\"number\"==typeof d.length)return{foreach:c,templateEngine:a.ba.Na};a.a.c(c);return{foreach:d.data,as:d.as,noChildContext:d.noChildContext,includeDestroyed:d.includeDestroyed,afterAdd:d.afterAdd,\nbeforeRemove:d.beforeRemove,afterRender:d.afterRender,beforeMove:d.beforeMove,afterMove:d.afterMove,templateEngine:a.ba.Na}}},init:function(b,c){return a.f.template.init(b,a.f.foreach.Qc(c))},update:function(b,c,d,e,f){return a.f.template.update(b,a.f.foreach.Qc(c),d,e,f)}};a.m.Ra.foreach=!1;a.h.ea.foreach=!0;a.f.hasfocus={init:function(b,c,d){function e(e){b.__ko_hasfocusUpdating=!0;var f=b.ownerDocument;if(\"activeElement\"in f){var g;try{g=f.activeElement}catch(k){g=f.body}e=g===b}f=c();a.m.$a(f,\nd,\"hasfocus\",e,!0);b.__ko_hasfocusLastValue=e;b.__ko_hasfocusUpdating=!1}var f=e.bind(null,!0),g=e.bind(null,!1);a.a.H(b,\"focus\",f);a.a.H(b,\"focusin\",f);a.a.H(b,\"blur\",g);a.a.H(b,\"focusout\",g);b.__ko_hasfocusLastValue=!1},update:function(b,c){var d=!!a.a.c(c());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===d||(d?b.focus():b.blur(),!d&&b.__ko_hasfocusLastValue&&b.ownerDocument.body.focus(),a.v.K(a.a.Fb,null,[b,d?\"focusin\":\"focusout\"]))}};a.m.va.hasfocus=!0;a.f.hasFocus=a.f.hasfocus;a.m.va.hasFocus=\n\"hasfocus\";a.f.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.dc(b,c())}};(function(){function b(b,d,e){a.f[b]={init:function(b,c,h,m,l){var k,q,n={},r,p,A;if(d){m=h.get(\"as\");var u=h.get(\"noChildContext\");A=!(m&&u);n={as:m,noChildContext:u,exportDependencies:A}}p=(r=\"render\"==h.get(\"completeOn\"))||h.has(a.j.oa);a.o(function(){var h=a.a.c(c()),m=!e!==!h,u=!q,t;if(A||m!==k){p&&(l=a.j.Bb(b,l));if(m){if(!d||A)n.dataDependency=a.U.o();t=d?l.createChildContext(\"function\"==\ntypeof h?h:c,n):a.U.pa()?l.extend(null,n):l}u&&a.U.pa()&&(q=a.a.Ca(a.h.childNodes(b),!0));m?(u||a.h.ua(b,a.a.Ca(q)),a.Pa(t,b)):(a.h.Ea(b),r||a.j.Ga(b,a.j.T));k=m}},null,{l:b});return{controlsDescendantBindings:!0}}};a.m.Ra[b]=!1;a.h.ea[b]=!0}b(\"if\");b(\"ifnot\",!1,!0);b(\"with\",!0)})();a.f.let={init:function(b,c,d,e,f){c=f.extend(c);a.Pa(c,b);return{controlsDescendantBindings:!0}}};a.h.ea.let=!0;var Q={};a.f.options={init:function(b){if(\"select\"!==a.a.P(b))throw Error(\"options binding applies only to SELECT elements\");\nfor(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:function(b,c,d){function e(){return a.a.fb(b.options,function(a){return a.selected})}function f(a,b,c){var d=typeof b;return\"function\"==d?b(a):\"string\"==d?a[b]:c}function g(c,e){if(y&&k)a.u.ya(b,a.a.c(d.get(\"value\")),!0);else if(r.length){var f=0<=a.a.A(r,a.u.L(e[0]));a.a.Yc(e[0],f);y&&!f&&a.v.K(a.a.Fb,null,[b,\"change\"])}}var h=b.multiple,m=0!=b.length&&h?b.scrollTop:null,l=a.a.c(c()),k=d.get(\"valueAllowUnset\")&&d.has(\"value\"),\nq=d.get(\"optionsIncludeDestroyed\");c={};var n,r=[];k||(h?r=a.a.Mb(e(),a.u.L):0<=b.selectedIndex&&r.push(a.u.L(b.options[b.selectedIndex])));l&&(\"undefined\"==typeof l.length&&(l=[l]),n=a.a.fb(l,function(b){return q||b===p||null===b||!a.a.c(b._destroy)}),d.has(\"optionsCaption\")&&(l=a.a.c(d.get(\"optionsCaption\")),null!==l&&l!==p&&n.unshift(Q)));var y=!1;c.beforeRemove=function(a){b.removeChild(a)};l=g;d.has(\"optionsAfterRender\")&&\"function\"==typeof d.get(\"optionsAfterRender\")&&(l=function(b,c){g(0,c);\na.v.K(d.get(\"optionsAfterRender\"),null,[c[0],b!==Q?b:p])});a.a.cc(b,n,function(c,e,g){g.length&&(r=!k&&g[0].selected?[a.u.L(g[0])]:[],y=!0);e=b.ownerDocument.createElement(\"option\");c===Q?(a.a.Ab(e,d.get(\"optionsCaption\")),a.u.ya(e,p)):(g=f(c,d.get(\"optionsValue\"),c),a.u.ya(e,a.a.c(g)),c=f(c,d.get(\"optionsText\"),g),a.a.Ab(e,c));return[e]},c,l);a.v.K(function(){if(k)a.u.ya(b,a.a.c(d.get(\"value\")),!0);else{var c;h?c=r.length&&e().length<r.length:c=r.length&&0<=b.selectedIndex?a.u.L(b.options[b.selectedIndex])!==\nr[0]:r.length||0<=b.selectedIndex;c&&a.a.Fb(b,\"change\")}});a.a.vd(b);m&&20<Math.abs(m-b.scrollTop)&&(b.scrollTop=m)}};a.f.options.Yb=a.a.g.Z();a.f.selectedOptions={after:[\"options\",\"foreach\"],init:function(b,c,d){a.a.H(b,\"change\",function(){var e=c(),f=[];a.a.C(b.getElementsByTagName(\"option\"),function(b){b.selected&&f.push(a.u.L(b))});a.m.$a(e,d,\"selectedOptions\",f)})},update:function(b,c){if(\"select\"!=a.a.P(b))throw Error(\"values binding applies only to SELECT elements\");var d=a.a.c(c()),e=b.scrollTop;\nd&&\"number\"==typeof d.length&&a.a.C(b.getElementsByTagName(\"option\"),function(b){var c=0<=a.a.A(d,a.u.L(b));b.selected!=c&&a.a.Yc(b,c)});b.scrollTop=e}};a.m.va.selectedOptions=!0;a.f.style={update:function(b,c){var d=a.a.c(c()||{});a.a.O(d,function(c,d){d=a.a.c(d);if(null===d||d===p||!1===d)d=\"\";if(v)v(b).css(c,d);else if(/^--/.test(c))b.style.setProperty(c,d);else{c=c.replace(/-(\\w)/g,function(a,b){return b.toUpperCase()});var g=b.style[c];b.style[c]=d;d===g||b.style[c]!=g||isNaN(d)||(b.style[c]=\nd+\"px\")}})}};a.f.submit={init:function(b,c,d,e,f){if(\"function\"!=typeof c())throw Error(\"The value for a submit binding must be a function\");a.a.H(b,\"submit\",function(a){var d,e=c();try{d=e.call(f.$data,b)}finally{!0!==d&&(a.preventDefault?a.preventDefault():a.returnValue=!1)}})}};a.f.text={init:function(){return{controlsDescendantBindings:!0}},update:function(b,c){a.a.Ab(b,c())}};a.h.ea.text=!0;(function(){if(z&&z.navigator){var b=function(a){if(a)return parseFloat(a[1])},c=z.navigator.userAgent,\nd,e,f,g,h;(d=z.opera&&z.opera.version&&parseInt(z.opera.version()))||(h=b(c.match(/Edge\\/([^ ]+)$/)))||b(c.match(/Chrome\\/([^ ]+)/))||(e=b(c.match(/Version\\/([^ ]+) Safari/)))||(f=b(c.match(/Firefox\\/([^ ]+)/)))||(g=a.a.W||b(c.match(/MSIE ([^ ]+)/)))||(g=b(c.match(/rv:([^ )]+)/)))}if(8<=g&&10>g)var m=a.a.g.Z(),l=a.a.g.Z(),k=function(b){var c=this.activeElement;(c=c&&a.a.g.get(c,l))&&c(b)},q=function(b,c){var d=b.ownerDocument;a.a.g.get(d,m)||(a.a.g.set(d,m,!0),a.a.H(d,\"selectionchange\",k));a.a.g.set(b,\nl,c)};a.f.textInput={init:function(b,c,l){function k(c,d){a.a.H(b,c,d)}function m(){var d=a.a.c(c());if(null===d||d===p)d=\"\";L!==p&&d===L?a.a.setTimeout(m,4):b.value!==d&&(x=!0,b.value=d,x=!1,v=b.value)}function t(){w||(L=b.value,w=a.a.setTimeout(B,4))}function B(){clearTimeout(w);L=w=p;var d=b.value;v!==d&&(v=d,a.m.$a(c(),l,\"textInput\",d))}var v=b.value,w,L,z=9==a.a.W?t:B,x=!1;g&&k(\"keypress\",B);11>g&&k(\"propertychange\",function(a){x||\"value\"!==a.propertyName||z(a)});8==g&&(k(\"keyup\",B),k(\"keydown\",\nB));q&&(q(b,z),k(\"dragend\",t));(!g||9<=g)&&k(\"input\",z);5>e&&\"textarea\"===a.a.P(b)?(k(\"keydown\",t),k(\"paste\",t),k(\"cut\",t)):11>d?k(\"keydown\",t):4>f?(k(\"DOMAutoComplete\",B),k(\"dragdrop\",B),k(\"drop\",B)):h&&\"number\"===b.type&&k(\"keydown\",t);k(\"change\",B);k(\"blur\",B);a.o(m,null,{l:b})}};a.m.va.textInput=!0;a.f.textinput={preprocess:function(a,b,c){c(\"textInput\",a)}}})();a.f.uniqueName={init:function(b,c){if(c()){var d=\"ko_unique_\"+ ++a.f.uniqueName.qd;a.a.Xc(b,d)}}};a.f.uniqueName.qd=0;a.f.using={init:function(b,\nc,d,e,f){var g;d.has(\"as\")&&(g={as:d.get(\"as\"),noChildContext:d.get(\"noChildContext\")});c=f.createChildContext(c,g);a.Pa(c,b);return{controlsDescendantBindings:!0}}};a.h.ea.using=!0;a.f.value={after:[\"options\",\"foreach\"],init:function(b,c,d){var e=a.a.P(b),f=\"input\"==e;if(!f||\"checkbox\"!=b.type&&\"radio\"!=b.type){var g=[\"change\"],h=d.get(\"valueUpdate\"),m=!1,l=null;h&&(\"string\"==typeof h&&(h=[h]),a.a.gb(g,h),g=a.a.vc(g));var k=function(){l=null;m=!1;var e=c(),f=a.u.L(b);a.m.$a(e,d,\"value\",f)};!a.a.W||\n!f||\"text\"!=b.type||\"off\"==b.autocomplete||b.form&&\"off\"==b.form.autocomplete||-1!=a.a.A(g,\"propertychange\")||(a.a.H(b,\"propertychange\",function(){m=!0}),a.a.H(b,\"focus\",function(){m=!1}),a.a.H(b,\"blur\",function(){m&&k()}));a.a.C(g,function(c){var d=k;a.a.Td(c,\"after\")&&(d=function(){l=a.u.L(b);a.a.setTimeout(k,0)},c=c.substring(5));a.a.H(b,c,d)});var q;q=f&&\"file\"==b.type?function(){var d=a.a.c(c());null===d||d===p||\"\"===d?b.value=\"\":a.v.K(k)}:function(){var f=a.a.c(c()),g=a.u.L(b);if(null!==l&&\nf===l)a.a.setTimeout(q,0);else if(f!==g||g===p)\"select\"===e?(g=d.get(\"valueAllowUnset\"),a.u.ya(b,f,g),g||f===a.u.L(b)||a.v.K(k)):a.u.ya(b,f)};a.o(q,null,{l:b})}else a.eb(b,{checkedValue:c})},update:function(){}};a.m.va.value=!0;a.f.visible={update:function(b,c){var d=a.a.c(c()),e=\"none\"!=b.style.display;d&&!e?b.style.display=\"\":!d&&e&&(b.style.display=\"none\")}};a.f.hidden={update:function(b,c){a.f.visible.update(b,function(){return!a.a.c(c())})}};(function(b){a.f[b]={init:function(c,d,e,f,g){return a.f.event.init.call(this,\nc,function(){var a={};a[b]=d();return a},e,f,g)}}})(\"click\");a.ca=function(){};a.ca.prototype.renderTemplateSource=function(){throw Error(\"Override renderTemplateSource\");};a.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error(\"Override createJavaScriptEvaluatorBlock\");};a.ca.prototype.makeTemplateSource=function(b,c){if(\"string\"==typeof b){c=c||w;var d=c.getElementById(b);if(!d)throw Error(\"Cannot find template with ID \"+b);return new a.B.D(d)}if(1==b.nodeType||8==b.nodeType)return new a.B.ia(b);\nthrow Error(\"Unknown template type: \"+b);};a.ca.prototype.renderTemplate=function(a,c,d,e){a=this.makeTemplateSource(a,e);return this.renderTemplateSource(a,c,d,e)};a.ca.prototype.isTemplateRewritten=function(a,c){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(a,c).data(\"isRewritten\")};a.ca.prototype.rewriteTemplate=function(a,c,d){a=this.makeTemplateSource(a,d);c=c(a.text());a.text(c);a.data(\"isRewritten\",!0)};a.b(\"templateEngine\",a.ca);a.ic=function(){function b(b,c,d,h){b=a.m.Zb(b);\nfor(var m=a.m.Ra,l=0;l<b.length;l++){var k=b[l].key;if(Object.prototype.hasOwnProperty.call(m,k)){var q=m[k];if(\"function\"===typeof q){if(k=q(b[l].value))throw Error(k);}else if(!q)throw Error(\"This template engine does not support the '\"+k+\"' binding within its templates\");}}d=\"ko.__tr_ambtns(function($context,$element){return(function(){return{ \"+a.m.ub(b,{valueAccessors:!0})+\" } })()},'\"+d.toLowerCase()+\"')\";return h.createJavaScriptEvaluatorBlock(d)+c}var c=/(<([a-z]+\\d*)(?:\\s+(?!data-bind\\s*=\\s*)[a-z0-9\\-]+(?:=(?:\\\"[^\\\"]*\\\"|\\'[^\\']*\\'|[^>]*))?)*\\s+)data-bind\\s*=\\s*([\"'])([\\s\\S]*?)\\3/gi,\nd=/\\x3c!--\\s*ko\\b\\s*([\\s\\S]*?)\\s*--\\x3e/g;return{wd:function(b,c,d){c.isTemplateRewritten(b,d)||c.rewriteTemplate(b,function(b){return a.ic.Kd(b,c)},d)},Kd:function(a,f){return a.replace(c,function(a,c,d,e,k){return b(k,c,d,f)}).replace(d,function(a,c){return b(c,\"\\x3c!-- ko --\\x3e\",\"#comment\",f)})},ld:function(b,c){return a.aa.Wb(function(d,h){var m=d.nextSibling;m&&m.nodeName.toLowerCase()===c&&a.eb(m,b,h)})}}}();a.b(\"__tr_ambtns\",a.ic.ld);(function(){a.B={};a.B.D=function(b){if(this.D=b){var c=\na.a.P(b);this.Db=\"script\"===c?1:\"textarea\"===c?2:\"template\"==c&&b.content&&11===b.content.nodeType?3:4}};a.B.D.prototype.text=function(){var b=1===this.Db?\"text\":2===this.Db?\"value\":\"innerHTML\";if(0==arguments.length)return this.D[b];var c=arguments[0];\"innerHTML\"===b?a.a.dc(this.D,c):this.D[b]=c};var b=a.a.g.Z()+\"_\";a.B.D.prototype.data=function(c){if(1===arguments.length)return a.a.g.get(this.D,b+c);a.a.g.set(this.D,b+c,arguments[1])};var c=a.a.g.Z();a.B.D.prototype.nodes=function(){var b=this.D;\nif(0==arguments.length){var e=a.a.g.get(b,c)||{},f=e.jb||(3===this.Db?b.content:4===this.Db?b:p);if(!f||e.hd)if(e=this.text())f=a.a.Ld(e,b.ownerDocument),this.text(\"\"),a.a.g.set(b,c,{jb:f,hd:!0});return f}a.a.g.set(b,c,{jb:arguments[0]})};a.B.ia=function(a){this.D=a};a.B.ia.prototype=new a.B.D;a.B.ia.prototype.constructor=a.B.ia;a.B.ia.prototype.text=function(){if(0==arguments.length){var b=a.a.g.get(this.D,c)||{};b.jc===p&&b.jb&&(b.jc=b.jb.innerHTML);return b.jc}a.a.g.set(this.D,c,{jc:arguments[0]})};\na.b(\"templateSources\",a.B);a.b(\"templateSources.domElement\",a.B.D);a.b(\"templateSources.anonymousTemplate\",a.B.ia)})();(function(){function b(b,c,d){var e;for(c=a.h.nextSibling(c);b&&(e=b)!==c;)b=a.h.nextSibling(e),d(e,b)}function c(c,d){if(c.length){var e=c[0],f=c[c.length-1],g=e.parentNode,h=a.ga.instance,m=h.preprocessNode;if(m){b(e,f,function(a,b){var c=a.previousSibling,d=m.call(h,a);d&&(a===e&&(e=d[0]||b),a===f&&(f=d[d.length-1]||c))});c.length=0;if(!e)return;e===f?c.push(e):(c.push(e,f),a.a.Ua(c,\ng))}b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.uc(d,b)});b(e,f,function(b){1!==b.nodeType&&8!==b.nodeType||a.aa.bd(b,[d])});a.a.Ua(c,g)}}function d(a){return a.nodeType?a:0<a.length?a[0]:null}function e(b,e,f,h,m){m=m||{};var p=(b&&d(b)||f||{}).ownerDocument,A=m.templateEngine||g;a.ic.wd(f,A,p);f=A.renderTemplate(f,h,m,p);if(\"number\"!=typeof f.length||0<f.length&&\"number\"!=typeof f[0].nodeType)throw Error(\"Template engine must return an array of DOM nodes\");p=!1;switch(e){case \"replaceChildren\":a.h.ua(b,\nf);p=!0;break;case \"replaceNode\":a.a.Wc(b,f);p=!0;break;case \"ignoreTargetNode\":break;default:throw Error(\"Unknown renderMode: \"+e);}p&&(c(f,h),m.afterRender&&a.v.K(m.afterRender,null,[f,h[m.as||\"$data\"]]),\"replaceChildren\"==e&&a.j.Ga(b,a.j.T));return f}function f(b,c,d){return a.N(b)?b():\"function\"===typeof b?b(c,d):b}var g;a.ec=function(b){if(b!=p&&!(b instanceof a.ca))throw Error(\"templateEngine must inherit from ko.templateEngine\");g=b};a.bc=function(b,c,h,m,r){h=h||{};if((h.templateEngine||g)==\np)throw Error(\"Set a template engine before calling renderTemplate\");r=r||\"replaceChildren\";if(m){var y=d(m);return a.$(function(){var g=c&&c instanceof a.fa?c:new a.fa(c,null,null,null,{exportDependencies:!0}),p=f(b,g.$data,g),g=e(m,r,p,g,h);\"replaceNode\"==r&&(m=g,y=d(m))},null,{Sa:function(){return!y||!a.a.Rb(y)},l:y&&\"replaceNode\"==r?y.parentNode:y})}return a.aa.Wb(function(d){a.bc(b,c,h,d,\"replaceNode\")})};a.Pd=function(b,d,g,h,m){function y(b,c){a.v.K(a.a.cc,null,[h,b,u,g,t,c]);a.j.Ga(h,a.j.T)}\nfunction t(a,b){c(b,v);g.afterRender&&g.afterRender(b,a);v=null}function u(a,c){v=m.createChildContext(a,{as:B,noChildContext:g.noChildContext,extend:function(a){a.$index=c;B&&(a[B+\"Index\"]=c)}});var d=f(b,a,v);return e(h,\"ignoreTargetNode\",d,v,g)}var v,B=g.as,w=!1===g.includeDestroyed||a.options.foreachHidesDestroyed&&!g.includeDestroyed;if(w||g.beforeRemove||!a.Oc(d))return a.$(function(){var b=a.a.c(d)||[];\"undefined\"==typeof b.length&&(b=[b]);w&&(b=a.a.fb(b,function(b){return b===p||null===b||\n!a.a.c(b._destroy)}));y(b)},null,{l:h});y(d.w());var z=d.subscribe(function(a){y(d(),a)},null,\"arrayChange\");z.l(h);return z};var h=a.a.g.Z(),m=a.a.g.Z();a.f.template={init:function(b,c){var d=a.a.c(c());if(\"string\"==typeof d||d.name)a.h.Ea(b);else if(\"nodes\"in d){d=d.nodes||[];if(a.N(d))throw Error('The \"nodes\" option must be a plain, non-observable array.');var e=d[0]&&d[0].parentNode;e&&a.a.g.get(e,m)||(e=a.a.Xb(d),a.a.g.set(e,m,!0));(new a.B.ia(b)).nodes(e)}else if(d=a.h.childNodes(b),0<d.length)e=\na.a.Xb(d),(new a.B.ia(b)).nodes(e);else throw Error(\"Anonymous template defined, but no template content was provided\");return{controlsDescendantBindings:!0}},update:function(b,c,d,e,f){var g=c();c=a.a.c(g);d=!0;e=null;\"string\"==typeof c?c={}:(g=c.name,\"if\"in c&&(d=a.a.c(c[\"if\"])),d&&\"ifnot\"in c&&(d=!a.a.c(c.ifnot)));\"foreach\"in c?e=a.Pd(g||b,d&&c.foreach||[],c,b,f):d?(d=f,\"data\"in c&&(d=f.createChildContext(c.data,{as:c.as,noChildContext:c.noChildContext,exportDependencies:!0})),e=a.bc(g||b,d,c,\nb)):a.h.Ea(b);f=e;(c=a.a.g.get(b,h))&&\"function\"==typeof c.s&&c.s();a.a.g.set(b,h,!f||f.ja&&!f.ja()?p:f)}};a.m.Ra.template=function(b){b=a.m.Zb(b);return 1==b.length&&b[0].unknown||a.m.Hd(b,\"name\")?null:\"This template engine does not support anonymous templates nested within its templates\"};a.h.ea.template=!0})();a.b(\"setTemplateEngine\",a.ec);a.b(\"renderTemplate\",a.bc);a.a.Jc=function(a,c,d){if(a.length&&c.length){var e,f,g,h,m;for(e=f=0;(!d||e<d)&&(h=a[f]);++f){for(g=0;m=c[g];++g)if(h.value===m.value){h.moved=\nm.index;m.moved=h.index;c.splice(g,1);e=g=0;break}e+=g}}};a.a.Ob=function(){function b(b,d,e,f,g){var h=Math.min,m=Math.max,l=[],k,p=b.length,n,r=d.length,t=r-p||1,A=p+r+1,u,v,w;for(k=0;k<=p;k++)for(v=u,l.push(u=[]),w=h(r,k+t),n=m(0,k-1);n<=w;n++)u[n]=n?k?b[k-1]===d[n-1]?v[n-1]:h(v[n]||A,u[n-1]||A)+1:n+1:k+1;h=[];m=[];t=[];k=p;for(n=r;k||n;)r=l[k][n]-1,n&&r===l[k][n-1]?m.push(h[h.length]={status:e,value:d[--n],index:n}):k&&r===l[k-1][n]?t.push(h[h.length]={status:f,value:b[--k],index:k}):(--n,--k,\ng.sparse||h.push({status:\"retained\",value:d[n]}));a.a.Jc(t,m,!g.dontLimitMoves&&10*p);return h.reverse()}return function(a,d,e){e=\"boolean\"===typeof e?{dontLimitMoves:e}:e||{};a=a||[];d=d||[];return a.length<d.length?b(a,d,\"added\",\"deleted\",e):b(d,a,\"deleted\",\"added\",e)}}();a.b(\"utils.compareArrays\",a.a.Ob);(function(){function b(b,c,d,h,m){var l=[],k=a.$(function(){var k=c(d,m,a.a.Ua(l,b))||[];0<l.length&&(a.a.Wc(l,k),h&&a.v.K(h,null,[d,k,m]));l.length=0;a.a.gb(l,k)},null,{l:b,Sa:function(){return!a.a.jd(l)}});\nreturn{Y:l,$:k.ja()?k:p}}var c=a.a.g.Z(),d=a.a.g.Z();a.a.cc=function(e,f,g,h,m,l){function k(b){x={Aa:b,nb:a.sa(w++)};v.push(x);t||F.push(x)}function q(b){x=r[b];w!==x.nb.w()&&D.push(x);x.nb(w++);a.a.Ua(x.Y,e);v.push(x)}function n(b,c){if(b)for(var d=0,e=c.length;d<e;d++)a.a.C(c[d].Y,function(a){b(a,d,c[d].Aa)})}f=f||[];\"undefined\"==typeof f.length&&(f=[f]);h=h||{};var r=a.a.g.get(e,c),t=!r,v=[],u=0,w=0,B=[],z=[],C=[],D=[],F=[],x,I=0;if(t)a.a.C(f,k);else{if(!l||r&&r._countWaitingForRemove){var E=\na.a.Mb(r,function(a){return a.Aa});l=a.a.Ob(E,f,{dontLimitMoves:h.dontLimitMoves,sparse:!0})}for(var E=0,G,H,K;G=l[E];E++)switch(H=G.moved,K=G.index,G.status){case \"deleted\":for(;u<K;)q(u++);H===p&&(x=r[u],x.$&&(x.$.s(),x.$=p),a.a.Ua(x.Y,e).length&&(h.beforeRemove&&(v.push(x),I++,x.Aa===d?x=null:C.push(x)),x&&B.push.apply(B,x.Y)));u++;break;case \"added\":for(;w<K;)q(u++);H!==p?(z.push(v.length),q(H)):k(G.value)}for(;w<f.length;)q(u++);v._countWaitingForRemove=I}a.a.g.set(e,c,v);n(h.beforeMove,D);a.a.C(B,\nh.beforeRemove?a.na:a.removeNode);var M,O,P;try{P=e.ownerDocument.activeElement}catch(N){}if(z.length)for(;(E=z.shift())!=p;){x=v[E];for(M=p;E;)if((O=v[--E].Y)&&O.length){M=O[O.length-1];break}for(f=0;u=x.Y[f];M=u,f++)a.h.Vb(e,u,M)}E=0;for(z=a.h.firstChild(e);x=v[E];E++){x.Y||a.a.extend(x,b(e,g,x.Aa,m,x.nb));for(f=0;u=x.Y[f];z=u.nextSibling,M=u,f++)u!==z&&a.h.Vb(e,u,M);!x.Dd&&m&&(m(x.Aa,x.Y,x.nb),x.Dd=!0,M=x.Y[x.Y.length-1])}P&&e.ownerDocument.activeElement!=P&&P.focus();n(h.beforeRemove,C);for(E=\n0;E<C.length;++E)C[E].Aa=d;n(h.afterMove,D);n(h.afterAdd,F)}})();a.b(\"utils.setDomNodeChildrenFromArrayMapping\",a.a.cc);a.ba=function(){this.allowTemplateRewriting=!1};a.ba.prototype=new a.ca;a.ba.prototype.constructor=a.ba;a.ba.prototype.renderTemplateSource=function(b,c,d,e){if(c=(9>a.a.W?0:b.nodes)?b.nodes():null)return a.a.la(c.cloneNode(!0).childNodes);b=b.text();return a.a.ta(b,e)};a.ba.Na=new a.ba;a.ec(a.ba.Na);a.b(\"nativeTemplateEngine\",a.ba);(function(){a.Za=function(){var a=this.Gd=function(){if(!v||\n!v.tmpl)return 0;try{if(0<=v.tmpl.tag.tmpl.open.toString().indexOf(\"__\"))return 2}catch(a){}return 1}();this.renderTemplateSource=function(b,e,f,g){g=g||w;f=f||{};if(2>a)throw Error(\"Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.\");var h=b.data(\"precompiled\");h||(h=b.text()||\"\",h=v.template(null,\"{{ko_with $item.koBindingContext}}\"+h+\"{{/ko_with}}\"),b.data(\"precompiled\",h));b=[e.$data];e=v.extend({koBindingContext:e},f.templateOptions);e=v.tmpl(h,b,e);e.appendTo(g.createElement(\"div\"));\nv.fragments={};return e};this.createJavaScriptEvaluatorBlock=function(a){return\"{{ko_code ((function() { return \"+a+\" })()) }}\"};this.addTemplate=function(a,b){w.write(\"<script type='text/html' id='\"+a+\"'>\"+b+\"\\x3c/script>\")};0<a&&(v.tmpl.tag.ko_code={open:\"__.push($1 || '');\"},v.tmpl.tag.ko_with={open:\"with($1) {\",close:\"} \"})};a.Za.prototype=new a.ca;a.Za.prototype.constructor=a.Za;var b=new a.Za;0<b.Gd&&a.ec(b);a.b(\"jqueryTmplTemplateEngine\",a.Za)})()})})();})();\n"
  },
  {
    "path": "libs/sql/sql.js",
    "content": "// This prevents pollution of the global namespace\nvar SQL = (function () {\nfunction e(a){throw a;}var g=void 0,k=!0,l=null,m=!1;function n(){return function(){}}var q,r;r||(r=eval(\"(function() { try { return Module || {} } catch(e) { return {} } })()\"));var aa={},ba;for(ba in r)r.hasOwnProperty(ba)&&(aa[ba]=r[ba]);var s=\"object\"===typeof process&&\"function\"===typeof require,da=\"object\"===typeof window,ea=\"function\"===typeof importScripts,ga=!da&&!s&&!ea;\nif(s){r.print||(r.print=function(a){process.stdout.write(a+\"\\n\")});r.printErr||(r.printErr=function(a){process.stderr.write(a+\"\\n\")});var ha=require(\"fs\"),ia=require(\"path\");r.read=function(a,b){var a=ia.normalize(a),c=ha.readFileSync(a);!c&&a!=ia.resolve(a)&&(a=path.join(__dirname,\"..\",\"src\",a),c=ha.readFileSync(a));c&&!b&&(c=c.toString());return c};r.readBinary=function(a){return r.read(a,k)};r.load=function(a){ja(read(a))};r.thisProgram=1<process.argv.length?process.argv[1].replace(/\\\\/g,\"/\"):\n\"unknown-program\";r.arguments=process.argv.slice(2);\"undefined\"!==typeof module&&(module.exports=r);process.on(\"uncaughtException\",function(a){a instanceof ka||e(a)})}else ga?(r.print||(r.print=print),\"undefined\"!=typeof printErr&&(r.printErr=printErr),r.read=\"undefined\"!=typeof read?read:function(){e(\"no read() available (jsc?)\")},r.readBinary=function(a){if(\"function\"===typeof readbuffer)return new Uint8Array(readbuffer(a));a=read(a,\"binary\");u(\"object\"===typeof a);return a},\"undefined\"!=typeof scriptArgs?\nr.arguments=scriptArgs:\"undefined\"!=typeof arguments&&(r.arguments=arguments),this.Module=r,eval(\"if (typeof gc === 'function' && gc.toString().indexOf('[native code]') > 0) var gc = undefined\")):da||ea?(r.read=function(a){var b=new XMLHttpRequest;b.open(\"GET\",a,m);b.send(l);return b.responseText},\"undefined\"!=typeof arguments&&(r.arguments=arguments),\"undefined\"!==typeof console?(r.print||(r.print=function(a){console.log(a)}),r.printErr||(r.printErr=function(a){console.log(a)})):r.print||(r.print=\nn()),da?window.Module=r:r.load=importScripts):e(\"Unknown runtime environment. Where are we?\");function ja(a){eval.call(l,a)}!r.load&&r.read&&(r.load=function(a){ja(r.read(a))});r.print||(r.print=n());r.printErr||(r.printErr=r.print);r.arguments||(r.arguments=[]);r.thisProgram||(r.thisProgram=\"./this.program\");r.print=r.print;r.Ca=r.printErr;r.preRun=[];r.postRun=[];for(ba in aa)aa.hasOwnProperty(ba)&&(r[ba]=aa[ba]);\nvar w={Lf:function(a){la=a},Ye:function(){return la},Xb:function(){return v},Wb:function(a){v=a},qd:function(a){switch(a){case \"i1\":case \"i8\":return 1;case \"i16\":return 2;case \"i32\":return 4;case \"i64\":return 8;case \"float\":return 4;case \"double\":return 8;default:return\"*\"===a[a.length-1]?w.wa:\"i\"===a[0]?(a=parseInt(a.substr(1)),u(0===a%8),a/8):0}},Ve:function(a){return Math.max(w.qd(a),w.wa)},ei:16,zi:function(a,b,c){return!c&&(\"i64\"==a||\"double\"==a)?8:!a?Math.min(b,8):Math.min(b||(a?w.Ve(a):0),\nw.wa)},ib:function(a,b,c){return c&&c.length?(c.splice||(c=Array.prototype.slice.call(c)),c.splice(0,0,b),r[\"dynCall_\"+a].apply(l,c)):r[\"dynCall_\"+a].call(l,b)},Mb:[],ge:function(a){for(var b=0;b<w.Mb.length;b++)if(!w.Mb[b])return w.Mb[b]=a,2*(1+b);e(\"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS.\")},Gf:function(a){w.Mb[(a-2)/2]=l},Ai:function(a,b){w.jc||(w.jc={});var c=w.jc[a];if(c)return c;for(var c=[],d=0;d<b;d++)c.push(String.fromCharCode(36)+d);\nd=y(a);'\"'===d[0]&&(d.indexOf('\"',1)===d.length-1?d=d.substr(1,d.length-2):ma(\"invalid EM_ASM input |\"+d+\"|. Please use EM_ASM(..code..) (no quotes) or EM_ASM({ ..code($0).. }, input) (to input values)\"));try{var f=eval(\"(function(Module, FS) { return function(\"+c.join(\",\")+\"){ \"+d+\" } })\")(r,\"undefined\"!==typeof z?z:l)}catch(h){r.Ca(\"error in executing inline EM_ASM code: \"+h+\" on: \\n\\n\"+d+\"\\n\\nwith args |\"+c+\"| (make sure to use the right one out of EM_ASM, EM_ASM_ARGS, etc.)\"),e(h)}return w.jc[a]=\nf},Za:function(a){w.Za.Gc||(w.Za.Gc={});w.Za.Gc[a]||(w.Za.Gc[a]=1,r.Ca(a))},qc:{},Di:function(a,b){u(b);w.qc[b]||(w.qc[b]={});var c=w.qc[b];c[a]||(c[a]=function(){return w.ib(b,a,arguments)});return c[a]},eb:function(){var a=[],b=0;this.Vb=function(c){c&=255;if(0==a.length){if(0==(c&128))return String.fromCharCode(c);a.push(c);b=192==(c&224)?1:224==(c&240)?2:3;return\"\"}if(b&&(a.push(c),b--,0<b))return\"\";var c=a[0],d=a[1],f=a[2],h=a[3];2==a.length?c=String.fromCharCode((c&31)<<6|d&63):3==a.length?\nc=String.fromCharCode((c&15)<<12|(d&63)<<6|f&63):(c=(c&7)<<18|(d&63)<<12|(f&63)<<6|h&63,c=String.fromCharCode(((c-65536)/1024|0)+55296,(c-65536)%1024+56320));a.length=0;return c};this.Gd=function(a){for(var a=unescape(encodeURIComponent(a)),b=[],f=0;f<a.length;f++)b.push(a.charCodeAt(f));return b}},Bi:function(){e(\"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work\")},Ma:function(a){var b=v;v=v+a|0;v=v+15&-16;return b},Jd:function(a){var b=\nna;na=na+a|0;na=na+15&-16;return b},Kb:function(a){var b=C;C=C+a|0;C=C+15&-16;C>=oa&&ma(\"Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value \"+oa+\", (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs.\");return b},ec:function(a,b){return Math.ceil(a/(b?b:16))*(b?b:16)},Qi:function(a,b,c){return c?+(a>>>0)+4294967296*+(b>>>0):+(a>>>0)+4294967296*\n+(b|0)},Ab:8,wa:4,ki:0};r.Runtime=w;w.addFunction=w.ge;w.removeFunction=w.Gf;var pa=m,qa,ra,la;function u(a,b){a||ma(\"Assertion failed: \"+b)}function sa(a){var b=r[\"_\"+a];if(!b)try{b=eval(\"_\"+a)}catch(c){}u(b,\"Cannot call unknown function \"+a+\" (perhaps LLVM optimizations or closure removed it?)\");return b}var ta,va;\n(function(){function a(a){a=a.toString().match(d).slice(1);return{arguments:a[0],body:a[1],returnValue:a[2]}}var b={stackSave:function(){w.Xb()},stackRestore:function(){w.Wb()},arrayToC:function(a){var b=w.Ma(a.length);wa(a,b);return b},stringToC:function(a){var b=0;a!==l&&(a!==g&&0!==a)&&(b=w.Ma((a.length<<2)+1),xa(a,b));return b}},c={string:b.stringToC,array:b.arrayToC};va=function(a,b,d,f){var h=sa(a),t=[],a=0;if(f)for(var B=0;B<f.length;B++){var I=c[d[B]];I?(0===a&&(a=w.Xb()),t[B]=I(f[B])):t[B]=\nf[B]}d=h.apply(l,t);\"string\"===b&&(d=y(d));0!==a&&w.Wb(a);return d};var d=/^function\\s*\\(([^)]*)\\)\\s*{\\s*([^*]*?)[\\s;]*(?:return\\s*(.*?)[;\\s]*)?}$/,f={},h;for(h in b)b.hasOwnProperty(h)&&(f[h]=a(b[h]));ta=function(b,c,d){var d=d||[],h=sa(b),b=d.every(function(a){return\"number\"===a}),A=\"string\"!==c;if(A&&b)return h;var t=d.map(function(a,b){return\"$\"+b}),c=\"(function(\"+t.join(\",\")+\") {\",B=d.length;if(!b)for(var c=c+(\"var stack = \"+f.stackSave.body+\";\"),I=0;I<B;I++){var ca=t[I],ua=d[I];\"number\"!==ua&&\n(ua=f[ua+\"ToC\"],c+=\"var \"+ua.arguments+\" = \"+ca+\";\",c+=ua.body+\";\",c+=ca+\"=\"+ua.returnValue+\";\")}d=a(function(){return h}).returnValue;c+=\"var ret = \"+d+\"(\"+t.join(\",\")+\");\";A||(d=a(function(){return y}).returnValue,c+=\"ret = \"+d+\"(ret);\");b||(c+=f.stackRestore.body.replace(\"()\",\"(stack)\")+\";\");return eval(c+\"return ret})\")}})();r.cwrap=ta;r.ccall=va;\nfunction ya(a,b,c){c=c||\"i8\";\"*\"===c.charAt(c.length-1)&&(c=\"i32\");switch(c){case \"i1\":D[a>>0]=b;break;case \"i8\":D[a>>0]=b;break;case \"i16\":za[a>>1]=b;break;case \"i32\":E[a>>2]=b;break;case \"i64\":ra=[b>>>0,(qa=b,1<=+Aa(qa)?0<qa?(Ba(+Ca(qa/4294967296),4294967295)|0)>>>0:~~+Da((qa-+(~~qa>>>0))/4294967296)>>>0:0)];E[a>>2]=ra[0];E[a+4>>2]=ra[1];break;case \"float\":Ea[a>>2]=b;break;case \"double\":Fa[a>>3]=b;break;default:ma(\"invalid type for setValue: \"+c)}}r.setValue=ya;\nfunction Ga(a,b){b=b||\"i8\";\"*\"===b.charAt(b.length-1)&&(b=\"i32\");switch(b){case \"i1\":return D[a>>0];case \"i8\":return D[a>>0];case \"i16\":return za[a>>1];case \"i32\":return E[a>>2];case \"i64\":return E[a>>2];case \"float\":return Ea[a>>2];case \"double\":return Fa[a>>3];default:ma(\"invalid type for setValue: \"+b)}return l}r.getValue=Ga;var F=0,G=2,Ha=4;r.ALLOC_NORMAL=F;r.ALLOC_STACK=1;r.ALLOC_STATIC=G;r.ALLOC_DYNAMIC=3;r.ALLOC_NONE=Ha;\nfunction H(a,b,c,d){var f,h;\"number\"===typeof a?(f=k,h=a):(f=m,h=a.length);var i=\"string\"===typeof b?b:l,c=c==Ha?d:[Ia,w.Ma,w.Jd,w.Kb][c===g?G:c](Math.max(h,i?1:b.length));if(f){d=c;u(0==(c&3));for(a=c+(h&-4);d<a;d+=4)E[d>>2]=0;for(a=c+h;d<a;)D[d++>>0]=0;return c}if(\"i8\"===i)return a.subarray||a.slice?K.set(a,c):K.set(new Uint8Array(a),c),c;for(var d=0,j,x;d<h;){var p=a[d];\"function\"===typeof p&&(p=w.Ei(p));f=i||b[d];0===f?d++:(\"i64\"==f&&(f=\"i32\"),ya(c+d,p,f),x!==f&&(j=w.qd(f),x=f),d+=j)}return c}\nr.allocate=H;function y(a,b){if(0===b||!a)return\"\";for(var c=m,d,f=0;;){d=K[a+f>>0];if(128<=d)c=k;else if(0==d&&!b)break;f++;if(b&&f==b)break}b||(b=f);var h=\"\";if(!c){for(;0<b;)d=String.fromCharCode.apply(String,K.subarray(a,a+Math.min(b,1024))),h=h?h+d:d,a+=1024,b-=1024;return h}c=new w.eb;for(f=0;f<b;f++)d=K[a+f>>0],h+=c.Vb(d);return h}r.Pointer_stringify=y;r.UTF16ToString=function(a){for(var b=0,c=\"\";;){var d=za[a+2*b>>1];if(0==d)return c;++b;c+=String.fromCharCode(d)}};\nr.stringToUTF16=function(a,b){for(var c=0;c<a.length;++c)za[b+2*c>>1]=a.charCodeAt(c);za[b+2*a.length>>1]=0};r.UTF32ToString=function(a){for(var b=0,c=\"\";;){var d=E[a+4*b>>2];if(0==d)return c;++b;65536<=d?(d-=65536,c+=String.fromCharCode(55296|d>>10,56320|d&1023)):c+=String.fromCharCode(d)}};r.stringToUTF32=function(a,b){for(var c=0,d=0;d<a.length;++d){var f=a.charCodeAt(d);if(55296<=f&&57343>=f)var h=a.charCodeAt(++d),f=65536+((f&1023)<<10)|h&1023;E[b+4*c>>2]=f;++c}E[b+4*c>>2]=0};\nfunction Ja(a){function b(c,d,f){var d=d||Infinity,h=\"\",i=[],t;if(\"N\"===a[j]){j++;\"K\"===a[j]&&j++;for(t=[];\"E\"!==a[j];)if(\"S\"===a[j]){j++;var J=a.indexOf(\"_\",j);t.push(p[a.substring(j,J)||0]||\"?\");j=J+1}else if(\"C\"===a[j])t.push(t[t.length-1]),j+=2;else{var J=parseInt(a.substr(j)),fa=J.toString().length;if(!J||!fa){j--;break}var Tb=a.substr(j+fa,J);t.push(Tb);p.push(Tb);j+=fa+J}j++;t=t.join(\"::\");d--;if(0===d)return c?[t]:t}else if((\"K\"===a[j]||A&&\"L\"===a[j])&&j++,J=parseInt(a.substr(j)))fa=J.toString().length,\nt=a.substr(j+fa,J),j+=fa+J;A=m;\"I\"===a[j]?(j++,J=b(k),fa=b(k,1,k),h+=fa[0]+\" \"+t+\"<\"+J.join(\", \")+\">\"):h=t;a:for(;j<a.length&&0<d--;)if(t=a[j++],t in x)i.push(x[t]);else switch(t){case \"P\":i.push(b(k,1,k)[0]+\"*\");break;case \"R\":i.push(b(k,1,k)[0]+\"&\");break;case \"L\":j++;J=a.indexOf(\"E\",j)-j;i.push(a.substr(j,J));j+=J+2;break;case \"A\":J=parseInt(a.substr(j));j+=J.toString().length;\"_\"!==a[j]&&e(\"?\");j++;i.push(b(k,1,k)[0]+\" [\"+J+\"]\");break;case \"E\":break a;default:h+=\"?\"+t;break a}!f&&(1===i.length&&\n\"void\"===i[0])&&(i=[]);return c?(h&&i.push(h+\"?\"),i):h+(\"(\"+i.join(\", \")+\")\")}var c=!!r.___cxa_demangle;if(c)try{var d=Ia(a.length);xa(a.substr(1),d);var f=Ia(4),h=r.___cxa_demangle(d,0,0,f);if(0===Ga(f,\"i32\")&&h)return y(h)}catch(i){}finally{d&&Ka(d),f&&Ka(f),h&&Ka(h)}var j=3,x={v:\"void\",b:\"bool\",c:\"char\",s:\"short\",i:\"int\",l:\"long\",f:\"float\",d:\"double\",w:\"wchar_t\",a:\"signed char\",h:\"unsigned char\",t:\"unsigned short\",j:\"unsigned int\",m:\"unsigned long\",x:\"long long\",y:\"unsigned long long\",z:\"...\"},\np=[],A=k,d=a;try{if(\"Object._main\"==a||\"_main\"==a)return\"main()\";\"number\"===typeof a&&(a=y(a));if(\"_\"!==a[0]||\"_\"!==a[1]||\"Z\"!==a[2])return a;switch(a[3]){case \"n\":return\"operator new()\";case \"d\":return\"operator delete()\"}d=b()}catch(t){d+=\"?\"}0<=d.indexOf(\"?\")&&!c&&w.Za(\"warning: a problem occurred in builtin C++ name demangling; build with  -s DEMANGLE_SUPPORT=1  to link in libcxxabi demangling\");return d}\nfunction La(){var a;a:{a=Error();if(!a.stack){try{e(Error(0))}catch(b){a=b}if(!a.stack){a=\"(no stack trace available)\";break a}}a=a.stack.toString()}return a.replace(/__Z[\\w\\d_]+/g,function(a){var b=Ja(a);return a===b?a:a+\" [\"+b+\"]\"})}r.stackTrace=function(){return La()};for(var D,K,za,Ma,E,Na,Ea,Fa,Oa=0,na=0,Pa=0,v=0,Qa=0,Ra=0,C=0,Sa=r.TOTAL_STACK||5242880,oa=r.TOTAL_MEMORY||16777216,L=65536;L<oa||L<2*Sa;)L=16777216>L?2*L:L+16777216;\nL!==oa&&(r.Ca(\"increasing TOTAL_MEMORY to \"+L+\" to be compliant with the asm.js spec\"),oa=L);u(\"undefined\"!==typeof Int32Array&&\"undefined\"!==typeof Float64Array&&!!(new Int32Array(1)).subarray&&!!(new Int32Array(1)).set,\"JS engine does not provide full typed array support\");var M=new ArrayBuffer(oa);D=new Int8Array(M);za=new Int16Array(M);E=new Int32Array(M);K=new Uint8Array(M);Ma=new Uint16Array(M);Na=new Uint32Array(M);Ea=new Float32Array(M);Fa=new Float64Array(M);E[0]=255;\nu(255===K[0]&&0===K[3],\"Typed arrays 2 must be run on a little-endian system\");r.HEAP=g;r.buffer=M;r.HEAP8=D;r.HEAP16=za;r.HEAP32=E;r.HEAPU8=K;r.HEAPU16=Ma;r.HEAPU32=Na;r.HEAPF32=Ea;r.HEAPF64=Fa;function Ta(a){for(;0<a.length;){var b=a.shift();if(\"function\"==typeof b)b();else{var c=b.Ha;\"number\"===typeof c?b.Cb===g?w.ib(\"v\",c):w.ib(\"vi\",c,[b.Cb]):c(b.Cb===g?l:b.Cb)}}}var Ua=[],Va=[],Wa=[],Xa=[],Ya=[],Za=m;function $a(a){Ua.unshift(a)}r.addOnPreRun=r.qi=$a;r.addOnInit=r.ni=function(a){Va.unshift(a)};\nr.addOnPreMain=r.pi=function(a){Wa.unshift(a)};r.addOnExit=r.mi=function(a){Xa.unshift(a)};function ab(a){Ya.unshift(a)}r.addOnPostRun=r.oi=ab;function N(a,b,c){a=(new w.eb).Gd(a);c&&(a.length=c);b||a.push(0);return a}r.intArrayFromString=N;r.intArrayToString=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c];255<d&&(d&=255);b.push(String.fromCharCode(d))}return b.join(\"\")};function xa(a,b,c){a=N(a,c);for(c=0;c<a.length;)D[b+c>>0]=a[c],c+=1}r.writeStringToMemory=xa;\nfunction wa(a,b){for(var c=0;c<a.length;c++)D[b+c>>0]=a[c]}r.writeArrayToMemory=wa;function bb(a,b,c){for(var d=0;d<a.length;d++)D[b+d>>0]=a.charCodeAt(d);c||(D[b+a.length>>0]=0)}r.writeAsciiToMemory=bb;if(!Math.imul||-5!==Math.imul(4294967295,5))Math.imul=function(a,b){var c=a&65535,d=b&65535;return c*d+((a>>>16)*d+c*(b>>>16)<<16)|0};Math.Hi=Math.imul;var Aa=Math.abs,Da=Math.ceil,Ca=Math.floor,Ba=Math.min,cb=0,db=l,eb=l;function fb(){cb++;r.monitorRunDependencies&&r.monitorRunDependencies(cb)}\nr.addRunDependency=fb;function gb(){cb--;r.monitorRunDependencies&&r.monitorRunDependencies(cb);if(0==cb&&(db!==l&&(clearInterval(db),db=l),eb)){var a=eb;eb=l;a()}}r.removeRunDependency=gb;r.preloadedImages={};r.preloadedAudios={};var hb=l,Oa=8,na=Oa+39504;Va.push();\nH([51,46,56,46,55,46,52,0,83,81,76,73,84,69,95,0,0,152,0,0,16,152,0,0,32,152,0,0,56,152,0,0,72,152,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,\n39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,\n174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,3,0,0,0,44,0,0,0,0,2,0,0,0,0,0,0,24,4,0,0,32,4,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0,4,0,0,0,4,0,0,0,5,\n0,0,0,3,0,0,0,44,0,0,0,0,2,0,0,0,0,0,0,40,4,0,0,56,4,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0,4,0,0,0,4,0,0,0,5,0,0,0,3,0,0,0,44,0,0,0,0,2,0,0,0,0,0,0,64,4,0,0,80,4,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0,4,0,0,0,4,0,0,0,5,0,0,0,3,0,0,0,44,0,0,0,0,2,0,0,0,0,0,0,88,4,0,0,32,4,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,2,0,0,\n0,3,0,0,0,3,0,0,0,4,0,0,0,4,0,0,0,5,0,0,0,117,110,105,120,0,0,0,0,6,0,0,0,0,0,0,0,117,110,105,120,45,110,111,110,101,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,117,110,105,120,45,100,111,116,102,105,108,101,0,0,0,0,8,0,0,0,0,0,0,0,117,110,105,120,45,101,120,99,108,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,1,0,0,0,0,0,0,0,4,5,3,5,1,5,1,5,2,5,2,5,1,5,1,5,4,5,3,5,1,5,1,5,2,5,2,5,1,5,1,5,115,116,114,105,110,103,32,111,114,32,98,108,111,98,32,116,111,111,32,98,105,103,0,0,37,115,0,0,0,0,0,0,42,63,91,0,0,0,0,0,0,0,0,0,0,0,0,0,\n0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,12,12,12,12,12,12,12,12,12,12,0,0,0,0,0,0,0,10,10,10,10,10,10,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,64,0,42,42,42,42,42,42,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,0,0,0,0,0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,\n64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,0,0,0,0,0,0,0,0,116,114,105,103,103,101,114,0,116,101,109,112,0,0,0,0,50,48,49,52,45,49,50,45,48,57,32,48,49,58,51,52,58,51,54,32,102,54,54,102,55,97,49,55,98,55,56,98,97,54,49,55,97,99,100,101,57,48,102,99,56,49,48,49,48,55,102,51,52,102,49,97,49,102,50,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,117,110,107,110,111,119,110,32,100,97,116,97,98,97,115,101,58,32,37,115,0,0,0,0,0,202,154,59,0,202,154,59,208,7,0,0,232,3,0,0,244,1,0,0,168,97,0,0,127,0,0,0,10,0,0,0,80,195,0,0,231,3,0,0,232,3,0,0,0,0,0,0,57,50,50,51,51,55,50,48,51,54,56,53,52,55,55,53,56,48,0,0,0,0,0,0,111,110,111,102,102,97,108,115,101,121,101,115,116,114,117,101,102,117,108,\n108,0,0,0,0,0,1,2,4,9,12,16,0,2,2,3,5,3,4,4,0,1,0,0,0,1,1,2,0,82,69,73,78,68,69,88,69,68,69,83,67,65,80,69,65,67,72,69,67,75,69,89,66,69,70,79,82,69,73,71,78,79,82,69,71,69,88,80,76,65,73,78,83,84,69,65,68,68,65,84,65,66,65,83,69,76,69,67,84,65,66,76,69,70,84,72,69,78,68,69,70,69,82,82,65,66,76,69,76,83,69,88,67,69,80,84,82,65,78,83,65,67,84,73,79,78,65,84,85,82,65,76,84,69,82,65,73,83,69,88,67,76,85,83,73,86,69,88,73,83,84,83,65,86,69,80,79,73,78,84,69,82,83,69,67,84,82,73,71,71,69,82,69,70,69,82,\n69,78,67,69,83,67,79,78,83,84,82,65,73,78,84,79,70,70,83,69,84,69,77,80,79,82,65,82,89,85,78,73,81,85,69,82,89,87,73,84,72,79,85,84,69,82,69,76,69,65,83,69,65,84,84,65,67,72,65,86,73,78,71,82,79,85,80,68,65,84,69,66,69,71,73,78,78,69,82,69,67,85,82,83,73,86,69,66,69,84,87,69,69,78,79,84,78,85,76,76,73,75,69,67,65,83,67,65,68,69,76,69,84,69,67,65,83,69,67,79,76,76,65,84,69,67,82,69,65,84,69,67,85,82,82,69,78,84,95,68,65,84,69,68,69,84,65,67,72,73,77,77,69,68,73,65,84,69,74,79,73,78,83,69,82,84,77,\n65,84,67,72,80,76,65,78,65,76,89,90,69,80,82,65,71,77,65,66,79,82,84,86,65,76,85,69,83,86,73,82,84,85,65,76,73,77,73,84,87,72,69,78,87,72,69,82,69,78,65,77,69,65,70,84,69,82,69,80,76,65,67,69,65,78,68,69,70,65,85,76,84,65,85,84,79,73,78,67,82,69,77,69,78,84,67,65,83,84,67,79,76,85,77,78,67,79,77,77,73,84,67,79,78,70,76,73,67,84,67,82,79,83,83,67,85,82,82,69,78,84,95,84,73,77,69,83,84,65,77,80,82,73,77,65,82,89,68,69,70,69,82,82,69,68,73,83,84,73,78,67,84,68,82,79,80,70,65,73,76,70,82,79,77,70,85,\n76,76,71,76,79,66,89,73,70,73,83,78,85,76,76,79,82,68,69,82,69,83,84,82,73,67,84,82,73,71,72,84,82,79,76,76,66,65,67,75,82,79,87,85,78,73,79,78,85,83,73,78,71,86,65,67,85,85,77,86,73,69,87,73,78,73,84,73,65,76,76,89,0,0,0,0,0,0,0,76,105,117,74,0,45,0,0,82,0,77,0,0,42,12,78,15,0,116,85,54,112,0,19,0,0,121,0,119,115,0,22,93,0,9,0,0,70,71,0,69,6,0,48,90,102,0,118,101,0,0,44,0,103,24,0,17,0,122,53,23,0,5,110,25,96,0,0,124,106,60,123,57,28,55,0,91,0,100,26,0,99,0,0,0,95,92,97,88,109,14,39,108,0,81,0,18,\n89,111,32,0,120,80,113,62,46,84,0,0,94,40,59,114,0,36,0,0,29,0,86,63,64,0,20,61,0,56,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,13,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,0,21,0,0,0,0,0,50,0,43,3,47,0,0,0,0,30,0,58,0,38,0,0,0,1,66,0,0,67,0,41,0,0,0,0,0,0,49,65,0,0,0,0,31,52,16,34,10,0,0,0,0,0,0,0,11,72,79,0,8,0,104,98,0,107,0,87,0,75,51,0,27,37,73,83,0,35,68,0,0,0,0,0,0,7,7,5,4,6,4,5,3,6,7,3,6,6,7,7,3,8,2,6,5,4,4,3,10,4,6,11,6,2,7,5,5,9,6,9,9,7,10,10,4,6,2,3,9,4,2,6,5,7,4,5,7,6,6,5,6,5,5,9,\n7,7,3,2,4,4,7,3,6,4,7,6,12,6,9,4,6,5,4,7,6,5,6,7,5,4,5,6,5,7,3,7,13,2,2,4,6,6,8,5,17,12,7,8,8,2,4,4,4,4,4,2,2,6,5,8,5,8,3,5,5,6,4,9,3,0,0,0,0,0,0,2,0,2,0,8,0,9,0,14,0,16,0,20,0,23,0,25,0,25,0,29,0,33,0,36,0,41,0,46,0,48,0,53,0,54,0,59,0,62,0,65,0,67,0,69,0,78,0,81,0,86,0,91,0,95,0,96,0,101,0,105,0,109,0,117,0,122,0,128,0,136,0,142,0,152,0,159,0,162,0,162,0,165,0,167,0,167,0,171,0,176,0,179,0,184,0,184,0,188,0,192,0,199,0,204,0,209,0,212,0,218,0,221,0,225,0,234,0,240,0,240,0,240,0,243,0,246,0,250,\n0,251,0,255,0,5,1,9,1,16,1,22,1,34,1,40,1,49,1,51,1,57,1,62,1,64,1,71,1,76,1,81,1,87,1,93,1,98,1,102,1,105,1,111,1,115,1,122,1,124,1,131,1,133,1,135,1,144,1,148,1,154,1,160,1,168,1,173,1,173,1,189,1,196,1,203,1,204,1,211,1,215,1,219,1,223,1,227,1,230,1,232,1,234,1,240,1,244,1,252,1,1,2,9,2,12,2,17,2,22,2,28,2,32,2,37,2,67,28,140,42,84,44,104,53,35,113,46,47,50,2,49,142,41,24,119,16,98,138,11,112,139,117,6,30,107,98,141,57,9,20,13,118,62,105,99,131,55,54,111,21,21,71,103,3,25,66,98,14,34,128,127,110,\n5,98,58,74,77,19,52,101,50,37,33,109,136,95,17,69,43,8,124,108,51,4,32,56,29,120,65,129,137,130,68,31,59,72,100,106,15,75,38,39,10,40,98,69,69,102,7,121,73,114,45,123,98,50,36,18,76,126,60,98,12,61,115,125,63,64,48,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,109,105,115,117,115,101,32,97,116,32,108,105,110,101,32,37,100,32,111,102,32,91,37,46,49,48,115,93,0,0,0,0,117,110,\n97,98,108,101,32,116,111,32,100,101,108,101,116,101,47,109,111,100,105,102,121,32,99,111,108,108,97,116,105,111,110,32,115,101,113,117,101,110,99,101,32,100,117,101,32,116,111,32,97,99,116,105,118,101,32,115,116,97,116,101,109,101,110,116,115,0,0,0,0,0,66,73,78,65,82,89,0,0,82,84,82,73,77,0,0,0,78,79,67,65,83,69,0,0,109,97,105,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,5,0,0,0,9,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,114,101,99,111,118,101,114,101,100,32,37,100,32,112,97,103,101,115,32,102,114,111,\n109,32,37,115,0,0,0,0,0,0,217,213,5,249,32,161,99,215,100,97,116,97,98,97,115,101,32,99,111,114,114,117,112,116,105,111,110,32,97,116,32,108,105,110,101,32,37,100,32,111,102,32,91,37,46,49,48,115,93,0,0,0,0,0,0,0,99,97,110,110,111,116,32,108,105,109,105,116,32,87,65,76,32,115,105,122,101,58,32,37,115,0,0,0,0,0,0,0,99,97,110,110,111,116,32,111,112,101,110,32,102,105,108,101,32,97,116,32,108,105,110,101,32,37,100,32,111,102,32,91,37,46,49,48,115,93,0,0,114,101,99,111,118,101,114,101,100,32,37,100,32,\n102,114,97,109,101,115,32,102,114,111,109,32,87,65,76,32,102,105,108,101,32,37,115,0,0,0,0,45,106,111,117,114,110,97,108,0,0,0,0,0,0,0,0,45,119,97,108,0,0,0,0,110,111,108,111,99,107,0,0,105,109,109,117,116,97,98,108,101,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,105,108,101,58,0,0,0,108,111,99,97,108,104,111,115,116,0,0,0,0,0,0,0,105,110,118,97,108,105,100,32,117,114,105,32,97,117,116,104,111,114,105,116,121,58,32,37,46,42,115,0,0,0,0,0,118,102,115,0,0,0,0,0,99,97,99,104,101,0,0,0,96,18,0,0,0,0,2,0,104,18,\n0,0,0,0,4,0,0,0,0,0,0,0,0,0,115,104,97,114,101,100,0,0,112,114,105,118,97,116,101,0,109,111,100,101,0,0,0,0,160,18,0,0,1,0,0,0,168,18,0,0,2,0,0,0,176,18,0,0,6,0,0,0,184,18,0,0,128,0,0,0,0,0,0,0,0,0,0,0,114,111,0,0,0,0,0,0,114,119,0,0,0,0,0,0,114,119,99,0,0,0,0,0,109,101,109,111,114,121,0,0,97,99,99,101,115,115,0,0,110,111,32,115,117,99,104,32,37,115,32,109,111,100,101,58,32,37,115,0,0,0,0,0,37,115,32,109,111,100,101,32,110,111,116,32,97,108,108,111,119,101,100,58,32,37,115,0,110,111,32,115,117,99,\n104,32,118,102,115,58,32,37,115,0,105,110,118,97,108,105,100,0,65,80,73,32,99,97,108,108,32,119,105,116,104,32,37,115,32,100,97,116,97,98,97,115,101,32,99,111,110,110,101,99,116,105,111,110,32,112,111,105,110,116,101,114,0,0,0,0,117,110,97,98,108,101,32,116,111,32,117,115,101,32,102,117,110,99,116,105,111,110,32,37,115,32,105,110,32,116,104,101,32,114,101,113,117,101,115,116,101,100,32,99,111,110,116,101,120,116,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,\n28,29,30,31,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7,0,1,2,3,0,1,0,0,117,110,97,98,108,101,32,116,111,32,100,101,108,101,116,101,47,109,111,100,105,102,121,32,117,115,101,114,45,102,117,110,99,116,105,111,110,32,100,117,101,32,116,111,32,97,99,116,105,118,101,32,115,116,97,116,101,109,101,110,116,115,0,0,104,20,0,0,120,20,0,0,0,0,0,0,160,20,0,0,192,20,0,0,224,20,0,0,248,20,0,0,24,21,0,0,40,21,0,0,80,21,0,0,96,21,0,0,112,21,0,0,152,21,0,0,176,21,0,0,208,21,0,0,240,21,0,0,8,22,0,0,32,22,\n0,0,152,4,0,0,64,22,0,0,88,22,0,0,112,22,0,0,152,22,0,0,184,22,0,0,208,22,0,0,240,22,0,0,24,23,0,0,0,0,0,0,110,111,116,32,97,110,32,101,114,114,111,114,0,0,0,0,83,81,76,32,108,111,103,105,99,32,101,114,114,111,114,32,111,114,32,109,105,115,115,105,110,103,32,100,97,116,97,98,97,115,101,0,0,0,0,0,97,99,99,101,115,115,32,112,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,0,0,0,0,0,0,0,99,97,108,108,98,97,99,107,32,114,101,113,117,101,115,116,101,100,32,113,117,101,114,121,32,97,98,\n111,114,116,0,0,100,97,116,97,98,97,115,101,32,105,115,32,108,111,99,107,101,100,0,0,0,0,0,0,100,97,116,97,98,97,115,101,32,116,97,98,108,101,32,105,115,32,108,111,99,107,101,100,0,0,0,0,0,0,0,0,111,117,116,32,111,102,32,109,101,109,111,114,121,0,0,0,97,116,116,101,109,112,116,32,116,111,32,119,114,105,116,101,32,97,32,114,101,97,100,111,110,108,121,32,100,97,116,97,98,97,115,101,0,0,0,0,105,110,116,101,114,114,117,112,116,101,100,0,0,0,0,0,100,105,115,107,32,73,47,79,32,101,114,114,111,114,0,0,100,\n97,116,97,98,97,115,101,32,100,105,115,107,32,105,109,97,103,101,32,105,115,32,109,97,108,102,111,114,109,101,100,0,0,0,0,0,0,0,0,117,110,107,110,111,119,110,32,111,112,101,114,97,116,105,111,110,0,0,0,0,0,0,0,100,97,116,97,98,97,115,101,32,111,114,32,100,105,115,107,32,105,115,32,102,117,108,108,0,0,0,0,0,0,0,0,117,110,97,98,108,101,32,116,111,32,111,112,101,110,32,100,97,116,97,98,97,115,101,32,102,105,108,101,0,0,0,0,108,111,99,107,105,110,103,32,112,114,111,116,111,99,111,108,0,0,0,0,0,0,0,0,\n116,97,98,108,101,32,99,111,110,116,97,105,110,115,32,110,111,32,100,97,116,97,0,0,100,97,116,97,98,97,115,101,32,115,99,104,101,109,97,32,104,97,115,32,99,104,97,110,103,101,100,0,0,0,0,0,99,111,110,115,116,114,97,105,110,116,32,102,97,105,108,101,100,0,0,0,0,0,0,0,100,97,116,97,116,121,112,101,32,109,105,115,109,97,116,99,104,0,0,0,0,0,0,0,108,105,98,114,97,114,121,32,114,111,117,116,105,110,101,32,99,97,108,108,101,100,32,111,117,116,32,111,102,32,115,101,113,117,101,110,99,101,0,0,108,97,114,\n103,101,32,102,105,108,101,32,115,117,112,112,111,114,116,32,105,115,32,100,105,115,97,98,108,101,100,0,0,97,117,116,104,111,114,105,122,97,116,105,111,110,32,100,101,110,105,101,100,0,0,0,0,97,117,120,105,108,105,97,114,121,32,100,97,116,97,98,97,115,101,32,102,111,114,109,97,116,32,101,114,114,111,114,0,98,105,110,100,32,111,114,32,99,111,108,117,109,110,32,105,110,100,101,120,32,111,117,116,32,111,102,32,114,97,110,103,101,0,0,0,0,0,0,0,102,105,108,101,32,105,115,32,101,110,99,114,121,112,116,\n101,100,32,111,114,32,105,115,32,110,111,116,32,97,32,100,97,116,97,98,97,115,101,0,0,117,110,107,110,111,119,110,32,101,114,114,111,114,0,0,0,97,98,111,114,116,32,100,117,101,32,116,111,32,82,79,76,76,66,65,67,75,0,0,0,117,110,97,98,108,101,32,116,111,32,99,108,111,115,101,32,100,117,101,32,116,111,32,117,110,102,105,110,97,108,105,122,101,100,32,115,116,97,116,101,109,101,110,116,115,32,111,114,32,117,110,102,105,110,105,115,104,101,100,32,98,97,99,107,117,112,115,0,0,0,0,0,1,0,0,0,0,0,0,0,2,0,\n0,0,1,0,0,0,6,0,0,0,1,0,0,0,3,0,0,0,7,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,3,0,0,0,0,0,0,0,4,0,0,0,4,0,0,0,11,0,0,0,5,0,0,0,6,0,0,0,7,0,0,0,5,0,0,0,0,0,0,0,102,97,105,108,101,100,32,109,101,109,111,114,121,32,114,101,115,105,122,101,32,37,117,32,116,111,32,37,117,32,98,121,116,101,115,0,0,0,0,0,102,97,105,108,101,100,32,116,111,32,97,108,108,111,99,97,116,101,32,37,117,32,98,121,116,101,115,32,111,102,32,109,101,109,111,114,121,0,0,0,1,0,1,8,1,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,96,32,0,0,0,0,\n0,0,0,0,0,0,2,0,1,8,1,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,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116,121,112,101,111,102,0,0,108,101,110,103,116,104,0,0,105,110,115,116,114,0,0,0,115,117,98,115,116,114,0,0,112,\n114,105,110,116,102,0,0,117,110,105,99,111,100,101,0,99,104,97,114,0,0,0,0,97,98,115,0,0,0,0,0,114,111,117,110,100,0,0,0,117,112,112,101,114,0,0,0,108,111,119,101,114,0,0,0,99,111,97,108,101,115,99,101,0,0,0,0,0,0,0,0,104,101,120,0,0,0,0,0,105,102,110,117,108,108,0,0,117,110,108,105,107,101,108,121,0,0,0,0,0,0,0,0,108,105,107,101,108,105,104,111,111,100,0,0,0,0,0,0,108,105,107,101,108,121,0,0,114,97,110,100,111,109,0,0,114,97,110,100,111,109,98,108,111,98,0,0,0,0,0,0,110,117,108,108,105,102,0,0,115,\n113,108,105,116,101,95,118,101,114,115,105,111,110,0,0,115,113,108,105,116,101,95,115,111,117,114,99,101,95,105,100,0,0,0,0,0,0,0,0,115,113,108,105,116,101,95,108,111,103,0,0,0,0,0,0,115,113,108,105,116,101,95,99,111,109,112,105,108,101,111,112,116,105,111,110,95,117,115,101,100,0,0,0,0,0,0,0,115,113,108,105,116,101,95,99,111,109,112,105,108,101,111,112,116,105,111,110,95,103,101,116,0,0,0,0,0,0,0,0,113,117,111,116,101,0,0,0,108,97,115,116,95,105,110,115,101,114,116,95,114,111,119,105,100,0,0,0,0,\n0,0,0,99,104,97,110,103,101,115,0,116,111,116,97,108,95,99,104,97,110,103,101,115,0,0,0,114,101,112,108,97,99,101,0,122,101,114,111,98,108,111,98,0,0,0,0,0,0,0,0,115,117,109,0,0,0,0,0,116,111,116,97,108,0,0,0,97,118,103,0,0,0,0,0,99,111,117,110,116,0,0,0,103,114,111,117,112,95,99,111,110,99,97,116,0,0,0,0,103,108,111,98,0,0,0,0,37,95,0,1,0,0,0,0,108,105,107,101,0,0,0,0,2,0,1,8,0,0,0,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,200,34,0,0,0,0,0,0,0,0,0,0,2,0,1,8,0,0,0,0,0,0,0,0,36,0,0,0,0,0,0,0,0,0,0,0,224,\n34,0,0,0,0,0,0,0,0,0,0,3,0,1,8,0,0,0,0,0,0,0,0,37,0,0,0,0,0,0,0,0,0,0,0,248,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,115,113,108,105,116,101,95,114,101,110,97,109,101,95,116,97,98,108,101,0,0,0,0,0,115,113,108,105,116,101,95,114,101,110,97,109,101,95,116,114,105,103,103,101,114,0,0,0,115,113,108,105,116,101,95,114,101,110,97,109,101,95,112,97,114,101,110,116,0,0,0,0,37,115,37,46,42,115,34,37,119,34,0,0,0,0,0,0,37,115,37,115,0,0,0,0,37,46,42,115,34,37,119,34,37,115,0,0,0,0,0,0,255,255,1,8,0,0,0,0,0,0,0,0,38,\n0,0,0,0,0,0,0,0,0,0,0,88,36,0,0,0,0,0,0,0,0,0,0,255,255,1,8,0,0,0,0,0,0,0,0,39,0,0,0,0,0,0,0,0,0,0,0,104,36,0,0,0,0,0,0,0,0,0,0,255,255,1,8,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,0,0,0,0,112,36,0,0,0,0,0,0,0,0,0,0,255,255,1,8,0,0,0,0,0,0,0,0,41,0,0,0,0,0,0,0,0,0,0,0,120,36,0,0,0,0,0,0,0,0,0,0,255,255,1,8,0,0,0,0,0,0,0,0,42,0,0,0,0,0,0,0,0,0,0,0,136,36,0,0,0,0,0,0,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,0,43,0,0,0,0,0,0,0,0,0,0,0,152,36,0,0,0,0,0,0,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,0,44,0,0,0,0,0,0,0,0,0,0,0,168,36,0,\n0,0,0,0,0,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,0,45,0,0,0,0,0,0,0,0,0,0,0,192,36,0,0,0,0,0,0,0,0,0,0,106,117,108,105,97,110,100,97,121,0,0,0,0,0,0,0,100,97,116,101,0,0,0,0,116,105,109,101,0,0,0,0,100,97,116,101,116,105,109,101,0,0,0,0,0,0,0,0,115,116,114,102,116,105,109,101,0,0,0,0,0,0,0,0,99,117,114,114,101,110,116,95,116,105,109,101,0,0,0,0,99,117,114,114,101,110,116,95,116,105,109,101,115,116,97,109,112,0,0,0,0,0,0,0,99,117,114,114,101,110,116,95,100,97,116,101,0,0,0,0,37,48,50,100,0,0,0,0,37,48,54,46,\n51,102,0,0,37,48,51,100,0,0,0,0,37,46,49,54,103,0,0,0,37,108,108,100,0,0,0,0,37,48,52,100,0,0,0,0,108,111,99,97,108,116,105,109,101,0,0,0,0,0,0,0,117,110,105,120,101,112,111,99,104,0,0,0,0,0,0,0,117,116,99,0,0,0,0,0,119,101,101,107,100,97,121,32,0,0,0,0,0,0,0,0,115,116,97,114,116,32,111,102,32,0,0,0,0,0,0,0,109,111,110,116,104,0,0,0,121,101,97,114,0,0,0,0,100,97,121,0,0,0,0,0,104,111,117,114,0,0,0,0,109,105,110,117,116,101,0,0,115,101,99,111,110,100,0,0,108,111,99,97,108,32,116,105,109,101,32,117,\n110,97,118,97,105,108,97,98,108,101,0,0,110,111,119,0,0,0,0,0,37,48,52,100,45,37,48,50,100,45,37,48,50,100,32,37,48,50,100,58,37,48,50,100,58,37,48,50,100,0,0,0,37,48,50,100,58,37,48,50,100,58,37,48,50,100,0,0,37,48,52,100,45,37,48,50,100,45,37,48,50,100,0,0,76,73,75,69,32,111,114,32,71,76,79,66,32,112,97,116,116,101,114,110,32,116,111,111,32,99,111,109,112,108,101,120,0,0,0,0,0,0,0,0,69,83,67,65,80,69,32,101,120,112,114,101,115,115,105,111,110,32,109,117,115,116,32,98,101,32,97,32,115,105,110,103,\n108,101,32,99,104,97,114,97,99,116,101,114,0,0,0,0,44,0,0,0,0,0,0,0,105,110,116,101,103,101,114,32,111,118,101,114,102,108,111,119,0,0,0,0,0,0,0,0,37,33,46,49,53,103,0,0,37,33,46,50,48,101,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,78,85,76,76,0,0,0,0,37,46,42,102,0,0,0,0,105,110,116,101,103,101,114,0,116,101,120,116,0,0,0,0,114,101,97,108,0,0,0,0,98,108,111,98,0,0,0,0,110,117,108,108,0,0,0,0,1,0,0,0,0,0,0,0,184,38,0,0,0,0,0,0,32,0,0,0,0,0,0,0,105,110,116,101,114,114,117,112,116,0,0,0,0,\n0,0,0,117,110,114,101,99,111,103,110,105,122,101,100,32,116,111,107,101,110,58,32,34,37,84,34,0,0,0,0,0,0,0,0,110,101,97,114,32,34,37,84,34,58,32,115,121,110,116,97,120,32,101,114,114,111,114,0,114,111,119,105,100,0,0,0,117,110,107,110,111,119,110,32,116,97,98,108,101,32,111,112,116,105,111,110,58,32,37,46,42,115,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,116,111,111,32,109,97,110,121,32,116,101,114,109,115,32,105,110,32,99,111,109,112,111,117,110,100,32,83,69,76,69,67,84,0,0,0,0,\n0,0,0,115,101,116,32,108,105,115,116,0,0,0,0,0,0,0,0,116,111,111,32,109,97,110,121,32,97,114,103,117,109,101,110,116,115,32,111,110,32,102,117,110,99,116,105,111,110,32,37,84,0,0,0,0,0,0,0,56,91,0,0,1,0,0,0,48,73,0,0,1,0,0,0,105,110,100,101,120,0,0,0,113,117,97,108,105,102,105,101,100,32,116,97,98,108,101,32,110,97,109,101,115,32,97,114,101,32,110,111,116,32,97,108,108,111,119,101,100,32,111,110,32,73,78,83,69,82,84,44,32,85,80,68,65,84,69,44,32,97,110,100,32,68,69,76,69,84,69,32,115,116,97,116],\n\"i8\",Ha,w.Ab);\nH([101,109,101,110,116,115,32,119,105,116,104,105,110,32,116,114,105,103,103,101,114,115,0,0,116,104,101,32,73,78,68,69,88,69,68,32,66,89,32,99,108,97,117,115,101,32,105,115,32,110,111,116,32,97,108,108,111,119,101,100,32,111,110,32,85,80,68,65,84,69,32,111,114,32,68,69,76,69,84,69,32,115,116,97,116,101,109,101,110,116,115,32,119,105,116,104,105,110,32,116,114,105,103,103,101,114,115,0,0,0,0,0,116,104,101,32,78,79,84,32,73,78,68,69,88,69,68,32,99,108,97,117,115,101,32,105,115,32,110,111,116,32,97,\n108,108,111,119,101,100,32,111,110,32,85,80,68,65,84,69,32,111,114,32,68,69,76,69,84,69,32,115,116,97,116,101,109,101,110,116,115,32,119,105,116,104,105,110,32,116,114,105,103,103,101,114,115,0,0,0,0,144,1,145,2,145,1,146,1,146,3,147,0,147,1,147,3,148,1,149,3,151,0,151,1,151,2,150,0,150,1,150,1,150,1,149,2,149,2,149,2,153,1,153,0,149,2,149,3,149,5,149,2,154,6,156,1,158,0,158,3,157,1,157,0,155,5,155,2,162,0,162,2,160,3,160,1,164,3,165,1,152,1,152,1,152,1,166,0,166,1,168,1,168,4,168,6,169,1,169,2,170,\n1,170,1,167,2,167,0,173,2,173,2,173,4,173,3,173,3,173,2,173,2,173,3,173,5,173,2,173,4,173,4,173,1,173,2,178,0,178,1,180,0,180,2,182,2,182,3,182,3,182,3,183,2,183,2,183,1,183,1,183,2,181,3,181,2,184,0,184,2,184,2,161,0,161,2,185,3,185,1,186,1,186,0,187,2,187,7,187,5,187,5,187,10,189,0,189,1,176,0,176,3,190,0,190,2,191,1,191,1,191,1,149,4,193,2,193,0,149,8,149,4,149,1,163,2,195,1,195,3,198,1,198,2,198,1,196,9,196,1,207,4,207,5,199,1,199,1,199,0,210,2,210,0,200,3,200,2,200,4,211,2,211,1,211,0,201,0,\n201,2,213,2,213,0,212,7,212,7,212,7,159,0,159,2,194,2,214,1,214,2,214,3,214,4,216,2,216,0,215,0,215,3,215,2,217,4,217,0,205,0,205,3,220,4,220,2,177,1,177,1,177,0,203,0,203,3,204,0,204,2,206,0,206,2,206,4,206,4,149,6,202,0,202,2,149,8,221,5,221,3,149,6,149,7,222,2,222,1,223,0,223,3,219,3,219,1,175,1,175,3,174,1,175,1,175,1,175,3,175,5,174,1,174,1,175,1,175,3,175,6,175,5,175,4,174,1,175,3,175,3,175,3,175,3,175,3,175,3,175,3,175,3,224,1,224,2,175,3,175,5,175,2,175,3,175,3,175,4,175,2,175,2,175,2,175,\n2,225,1,225,2,175,5,226,1,226,2,175,5,175,3,175,5,175,4,175,4,175,5,228,5,228,4,229,2,229,0,227,1,227,0,209,1,209,0,208,3,208,1,149,12,230,1,230,0,179,0,179,3,188,5,188,3,231,0,231,2,149,4,149,1,149,2,149,3,149,5,149,6,149,5,149,6,232,1,232,1,232,1,232,1,232,1,171,2,171,1,172,2,149,5,233,11,235,1,235,1,235,2,235,0,236,1,236,1,236,3,237,0,237,3,238,0,238,2,234,3,234,2,240,1,240,3,241,0,241,3,241,2,239,7,239,5,239,5,239,1,175,4,175,6,192,1,192,1,192,1,149,4,149,6,149,3,243,0,243,2,242,1,242,0,149,1,\n149,3,149,1,149,3,149,6,149,6,244,1,245,0,245,1,149,1,149,4,246,8,247,1,247,3,248,0,248,2,249,1,249,3,250,1,251,0,251,4,251,2,197,0,197,2,197,3,252,6,252,8,0,0,238,0,186,3,213,0,33,1,54,1,234,0,144,0,61,1,147,255,126,1,121,1,47,1,205,1,133,1,122,1,112,1,46,1,38,1,253,0,139,1,37,1,68,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,254,3,244,3,237,3,230,3,195,3,193,3,191,3,\n189,3,182,3,179,3,162,3,144,3,105,3,93,3,55,3,42,3,3,3,247,2,208,2,196,2,158,2,145,2,107,2,102,2,100,2,98,2,96,2,94,2,92,2,86,2,83,2,81,2,68,2,30,2,28,2,25,2,23,2,21,2,19,2,17,2,15,2,247,1,130,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,147,1,95,0,191,1,82,0,78,1,248,1,211,1,147,1,221,1,208,1,147,1,147,1,147,1,147,1,92,3,235,2,232,2,17,3,126,2,126,2,158,3,123,3,132,3,131,3,119,3,76,3,72,3,67,3,80,3,62,3,75,3,61,3,24,3,71,3,58,3,225,2,70,3,27,3,21,3,47,0,222,2,18,2,184,2,9,3,199,2,165,2,221,\n2,218,2,217,2,216,2,215,2,115,2,192,1,64,0,187,0,25,5,22,5,228,4,10,5,249,4,43,5,42,5,41,5,39,5,38,5,36,5,35,5,34,5,33,5,32,5,31,5,30,5,28,5,27,5,24,5,23,5,21,5,18,5,14,5,12,5,9,5,242,4,240,4,235,4,8,5,7,5,214,4,5,5,1,5,0,5,255,4,254,4,227,4,253,4,252,4,251,4,249,4,244,4,243,4,241,4,239,4,237,4,233,4,224,4,213,4,223,4,222,4,219,4,214,4,216,4,211,4,225,4,210,4,209,4,206,4,196,4,190,4,186,4,201,4,195,4,208,4,207,4,173,4,171,4,203,4,200,4,177,4,184,4,218,4,113,4,212,4,205,4,169,4,157,4,197,4,153,4,172,\n4,155,4,167,4,166,4,162,4,158,4,194,4,192,4,152,4,138,4,159,4,156,4,136,4,175,4,179,4,109,4,71,4,174,4,170,4,164,4,168,4,147,4,145,4,144,4,149,4,150,4,142,4,135,4,117,4,146,4,134,4,143,4,133,4,108,4,121,4,119,4,100,4,104,4,79,4,78,4,76,4,72,4,126,4,125,4,61,4,101,4,56,4,40,4,96,4,73,4,58,4,54,4,49,4,43,4,85,4,83,4,95,4,93,4,92,4,89,4,87,4,84,4,239,3,232,3,234,3,52,4,51,4,57,4,0,0,0,0,50,1,212,0,176,1,187,3,127,2,191,0,187,3,39,1,47,2,88,0,88,0,88,0,88,0,81,0,86,0,86,0,86,0,86,0,85,0,85,0,84,0,84,\n0,84,0,83,0,74,1,185,0,184,0,183,0,123,2,123,2,36,1,94,2,94,2,88,0,88,0,88,0,88,0,171,2,86,0,86,0,86,0,86,0,85,0,85,0,84,0,84,0,84,0,83,0,74,1,16,0,180,1,85,2,89,0,90,0,80,0,88,2,87,2,89,2,89,2,87,0,87,0,88,0,88,0,88,0,88,0,172,2,86,0,86,0,86,0,86,0,85,0,85,0,84,0,84,0,84,0,83,0,74,1,50,1,47,2,84,0,84,0,84,0,83,0,74,1,65,0,86,0,86,0,86,0,86,0,85,0,85,0,84,0,84,0,84,0,83,0,74,1,123,2,123,2,122,2,121,2,182,0,170,2,38,2,123,1,120,1,119,1,17,0,66,1,94,2,94,2,115,1,198,0,223,1,91,0,118,1,82,0,79,0,165,\n0,85,0,85,0,84,0,84,0,84,0,83,0,74,1,86,2,123,2,123,2,107,0,89,0,90,0,80,0,88,2,87,2,89,2,89,2,87,0,87,0,88,0,88,0,88,0,88,0,186,0,86,0,86,0,86,0,86,0,85,0,85,0,84,0,84,0,84,0,83,0,74,1,50,1,82,2,82,2,142,0,72,1,71,1,228,1,249,0,88,1,238,0,123,2,123,2,122,2,121,2,73,2,192,1,14,2,13,2,229,0,132,1,1,0,138,1,194,1,72,2,193,1,123,2,123,2,123,2,123,2,63,1,139,1,94,2,94,2,199,0,157,0,17,1,126,1,12,1,125,1,187,0,123,2,123,2,122,2,121,2,55,1,43,2,10,1,81,2,81,2,10,1,91,1,76,2,89,0,90,0,80,0,88,2,87,2,89,\n2,89,2,87,0,87,0,88,0,88,0,88,0,88,0,222,1,86,0,86,0,86,0,86,0,85,0,85,0,84,0,84,0,84,0,83,0,74,1,50,1,16,1,24,2,122,2,121,2,146,0,98,2,197,0,54,1,63,2,182,0,226,1,15,1,123,1,120,1,119,1,250,1,21,0,122,2,121,2,122,2,121,2,123,2,123,2,118,1,99,2,62,2,36,2,184,1,111,0,51,2,94,2,94,2,122,2,121,2,68,1,223,1,96,2,96,2,96,2,44,1,179,1,61,2,119,0,151,1,210,0,162,0,50,2,115,3,80,2,80,2,50,1,89,0,90,0,80,0,88,2,87,2,89,2,89,2,87,0,87,0,88,0,88,0,88,0,88,0,250,1,86,0,86,0,86,0,86,0,85,0,85,0,84,0,84,0,84,0,\n83,0,74,1,108,2,111,0,123,2,123,2,105,1,94,2,94,2,102,1,249,0,93,1,248,0,177,1,243,0,223,1,74,2,122,2,121,2,195,0,99,2,93,0,119,0,221,0,63,2,241,1,22,2,22,2,89,0,90,0,80,0,88,2,87,2,89,2,89,2,87,0,87,0,88,0,88,0,88,0,88,0,62,2,86,0,86,0,86,0,86,0,85,0,85,0,84,0,84,0,84,0,83,0,74,1,50,1,77,0,173,1,126,2,61,2,77,2,18,2,240,0,230,0,242,0,105,0,249,0,93,1,248,0,3,2,76,2,208,0,204,1,17,2,52,2,173,0,122,2,121,2,202,3,144,0,174,1,2,0,168,1,228,0,124,1,45,2,94,2,94,2,190,0,153,0,159,0,158,0,2,2,51,0,120,\n2,119,2,118,2,71,0,24,2,176,1,186,3,196,0,98,2,186,3,102,2,45,0,18,0,89,0,90,0,80,0,88,2,87,2,89,2,89,2,87,0,87,0,88,0,88,0,88,0,88,0,5,1,86,0,86,0,86,0,86,0,85,0,85,0,84,0,84,0,84,0,83,0,74,1,50,1,96,2,96,2,96,2,30,2,168,1,146,1,129,1,241,0,250,1,195,1,64,1,211,0,31,2,164,0,180,1,130,1,37,1,195,1,75,2,108,0,240,1,111,0,78,1,135,1,79,2,168,1,102,2,27,0,196,1,197,1,94,2,94,2,72,0,1,1,70,0,3,1,196,1,83,1,86,1,52,2,70,2,68,0,159,1,213,1,72,1,71,1,62,0,102,2,45,0,110,0,137,1,89,0,90,0,80,0,88,2,87,2,\n89,2,89,2,87,0,87,0,88,0,88,0,88,0,88,0,152,0,86,0,86,0,86,0,86,0,85,0,85,0,84,0,84,0,84,0,83,0,74,1,50,1,110,0,243,1,8,2,26,2,146,1,133,1,168,1,110,0,54,2,244,1,81,2,81,2,198,1,82,0,79,0,165,0,168,1,79,2,128,1,52,2,84,1,103,2,188,0,162,0,168,1,94,1,104,2,168,1,102,2,44,0,94,2,94,2,189,1,70,2,44,1,178,1,151,0,19,0,102,2,9,0,56,2,68,2,92,1,103,2,213,1,55,2,102,2,26,0,104,2,102,2,45,0,89,0,90,0,80,0,88,2,87,2,89,2,89,2,87,0,87,0,88,0,88,0,88,0,88,0,155,1,86,0,86,0,86,0,86,0,85,0,85,0,84,0,84,0,84,0,\n83,0,74,1,50,1,67,2,110,0,66,2,9,2,26,1,177,1,142,1,144,1,255,0,230,1,82,0,79,0,165,0,231,1,164,0,82,0,79,0,165,0,232,1,232,1,108,1,131,1,168,1,32,2,32,2,253,1,94,1,106,1,155,0,191,0,94,2,94,2,47,2,130,2,128,2,77,1,82,0,79,0,165,0,49,1,52,2,251,1,56,1,101,1,102,2,45,0,73,1,84,2,83,2,194,0,81,1,89,0,90,0,80,0,88,2,87,2,89,2,89,2,87,0,87,0,88,0,88,0,88,0,88,0,168,1,86,0,86,0,86,0,86,0,85,0,85,0,84,0,84,0,84,0,83,0,74,1,50,1,20,0,67,1,150,0,7,1,211,0,31,2,165,1,84,2,83,2,102,2,22,0,168,1,193,0,168,1,\n28,1,168,1,135,1,168,1,253,1,168,1,65,2,168,1,186,0,79,1,168,1,47,2,168,1,57,1,120,0,34,2,94,2,94,2,67,0,102,2,47,0,102,2,50,0,102,2,48,0,102,2,100,0,102,2,99,0,102,2,101,0,64,2,102,2,102,0,102,2,109,0,70,1,89,0,90,0,80,0,88,2,87,2,89,2,89,2,87,0,87,0,88,0,88,0,88,0,88,0,168,1,86,0,86,0,86,0,86,0,85,0,85,0,84,0,84,0,84,0,83,0,74,1,50,1,168,1,55,1,168,1,73,2,54,0,168,1,4,2,5,2,78,2,102,2,112,0,168,1,72,2,168,1,60,2,168,1,195,0,168,1,59,2,168,1,67,0,168,1,102,2,94,0,102,2,98,0,168,1,102,2,97,0,8,1,\n94,2,94,2,195,0,102,2,46,0,102,2,96,0,102,2,30,0,102,2,49,0,102,2,115,0,102,2,114,0,162,1,229,0,132,1,102,2,113,0,50,1,89,0,90,0,80,0,88,2,87,2,89,2,89,2,87,0,87,0,88,0,88,0,88,0,88,0,168,1,86,0,86,0,86,0,86,0,85,0,85,0,84,0,84,0,84,0,83,0,74,1,119,0,168,1,78,2,110,0,116,1,94,2,94,2,195,0,53,0,250,0,102,2,29,0,195,0,216,1,182,1,217,2,190,0,46,1,242,1,14,0,11,2,129,2,2,0,102,2,43,0,50,1,89,0,90,0,80,0,88,2,87,2,89,2,89,2,87,0,87,0,88,0,88,0,88,0,88,0,168,1,86,0,86,0,86,0,86,0,85,0,85,0,84,0,84,0,84,\n0,83,0,74,1,168,1,101,2,196,3,196,3,98,1,94,2,94,2,164,1,56,1,64,0,102,2,42,0,135,1,99,1,27,1,181,1,45,1,255,0,158,1,154,1,239,1,236,1,102,2,28,0,215,1,50,1,89,0,90,0,80,0,88,2,87,2,89,2,89,2,87,0,87,0,88,0,88,0,88,0,88,0,168,1,86,0,86,0,86,0,86,0,85,0,85,0,84,0,84,0,84,0,83,0,74,1,168,1,110,0,110,0,110,0,110,0,94,2,94,2,110,0,254,0,13,0,102,2,41,0,20,2,19,2,27,1,225,1,19,2,201,1,28,1,119,0,49,2,100,1,102,2,40,0,28,1,50,1,89,0,78,0,80,0,88,2,87,2,89,2,89,2,87,0,87,0,88,0,88,0,88,0,88,0,168,1,86,0,\n86,0,86,0,86,0,85,0,85,0,84,0,84,0,84,0,83,0,74,1,110,0,168,1,85,1,220,0,43,2,94,2,94,2,95,1,43,2,62,1,102,2,95,0,157,1,255,0,83,0,74,1,28,1,28,1,255,0,128,2,77,1,100,1,255,0,102,2,39,0,50,1,100,1,90,0,80,0,88,2,87,2,89,2,89,2,87,0,87,0,88,0,88,0,88,0,88,0,168,1,86,0,86,0,86,0,86,0,85,0,85,0,84,0,84,0,84,0,83,0,74,1,168,1,61,1,60,1,141,0,209,1,94,2,94,2,219,0,107,2,207,1,102,2,10,0,161,1,206,1,255,0,189,0,254,1,41,2,95,1,207,0,107,1,161,0,102,2,38,0,59,1,218,0,255,0,255,0,80,0,88,2,87,2,89,2,89,2,\n87,0,87,0,88,0,88,0,88,0,88,0,168,1,86,0,86,0,86,0,86,0,85,0,85,0,84,0,84,0,84,0,83,0,74,1,76,0,163,1,255,0,3,0,110,3,205,1,168,1,247,0,75,1,75,1,102,2,37,0,217,0,76,0,163,1,134,1,3,0,216,0,215,0,166,1,4,0,75,1,75,1,168,1,35,2,12,0,168,1,33,2,102,2,36,0,168,1,29,2,166,1,168,1,28,2,168,1,214,0,168,1,152,1,168,1,27,2,147,1,93,2,93,2,237,0,102,2,25,0,119,0,102,2,24,0,76,2,152,1,102,2,45,0,118,0,102,2,35,0,102,2,34,0,102,2,33,0,102,2,23,0,76,2,60,0,223,0,91,2,90,2,1,2,122,1,73,0,74,0,140,0,139,0,168,\n1,110,0,9,1,75,0,170,1,169,1,59,0,168,1,98,2,73,0,74,0,37,2,146,1,148,1,168,1,117,1,75,0,170,1,169,1,92,2,138,0,98,2,102,2,11,0,136,1,76,0,163,1,181,0,3,0,102,2,32,0,15,1,113,1,75,1,75,1,237,1,102,2,31,0,149,0,96,2,96,2,96,2,95,2,15,0,166,1,109,1,102,2,8,0,137,0,233,1,136,0,190,0,96,2,96,2,96,2,95,2,15,0,229,1,176,0,135,0,7,0,252,0,221,1,152,1,174,0,133,0,175,0,218,1,57,0,56,0,132,0,130,0,119,0,76,0,163,1,76,2,3,0,212,1,245,0,208,1,171,0,75,1,75,1,125,0,123,0,200,1,191,1,122,0,190,1,104,0,80,1,231,\n0,166,1,166,0,154,0,73,0,74,0,76,1,116,0,175,1,121,0,53,1,75,0,170,1,169,1,222,0,106,0,98,2,52,1,125,2,204,0,152,1,117,2,115,2,116,2,6,0,200,0,172,1,171,1,34,1,203,0,110,2,201,0,76,2,62,0,63,0,33,1,66,0,163,1,143,1,3,0,145,1,32,1,92,0,143,0,75,1,75,1,31,1,96,2,96,2,96,2,95,2,15,0,73,0,74,0,227,0,166,1,69,1,69,0,160,1,75,0,170,1,169,1,100,2,156,1,98,2,192,0,61,0,57,2,209,0,140,1,226,0,22,1,225,0,127,1,152,1,15,2,46,2,20,1,21,2,40,2,16,2,65,1,11,2,114,1,252,1,180,0,76,2,238,1,179,0,110,1,117,0,253,\n0,13,1,10,2,247,1,96,2,96,2,96,2,95,2,15,0,39,2,246,1,58,0,18,1,12,2,178,0,73,0,74,0,48,1,245,1,112,1,47,1,206,0,75,0,170,1,169,1,235,1,104,1,98,2,213,0,177,0,227,1,131,0,89,1,42,1,41,1,40,1,202,0,38,1,224,1,234,1,210,1,134,0,172,0,129,0,188,1,90,1,214,1,128,0,58,1,203,1,103,0,127,0,126,0,148,0,124,0,167,0,187,1,235,0,96,2,96,2,96,2,95,2,15,0,186,1,183,1,111,2,234,0,43,1,145,0,71,2,35,1,121,1,69,2,160,0,119,0,156,0,14,1,124,2,203,3,169,0,23,1,114,2,8,2,113,2,217,1,112,2,170,0,109,2,106,2,119,0,168,\n0,55,0,153,1,167,1,25,2,97,2,30,1,29,1,149,1,58,2,48,2,44,2,5,0,52,0,202,1,42,2,147,0,11,1,7,2,248,1,6,2,150,1,6,1,239,0,4,1,0,2,87,1,255,1,2,1,97,1,53,2,0,1,224,0,251,0,103,1,21,1,19,1,220,1,219,1,246,0,96,1,244,0,211,1,199,1,236,0,233,0,232,0,51,1,185,1,25,1,205,0,163,0,141,1,24,1,23,2,249,1,74,1,105,2,203,3,203,3,203,3,203,3,111,1,203,3,203,3,203,3,203,3,203,3,203,3,203,3,203,3,203,3,203,3,203,3,82,1,0,0,0,0,0,0,100,117,112,108,105,99,97,116,101,32,87,73,84,72,32,116,97,98,108,101,32,110,97,109,\n101,58,32,37,115,0,0,0,110,111,116,32,97,117,116,104,111,114,105,122,101,100,0,0,97,117,116,104,111,114,105,122,101,114,32,109,97,108,102,117,110,99,116,105,111,110,0,0,67,82,69,65,84,69,32,86,73,82,84,85,65,76,32,84,65,66,76,69,32,37,84,0,85,80,68,65,84,69,32,37,81,46,37,115,32,83,69,84,32,116,121,112,101,61,39,116,97,98,108,101,39,44,32,110,97,109,101,61,37,81,44,32,116,98,108,95,110,97,109,101,61,37,81,44,32,114,111,111,116,112,97,103,101,61,48,44,32,115,113,108,61,37,81,32,87,72,69,82,69,32,114,\n111,119,105,100,61,35,37,100,0,115,113,108,105,116,101,95,116,101,109,112,95,109,97,115,116,101,114,0,0,0,0,0,0,115,113,108,105,116,101,95,109,97,115,116,101,114,0,0,0,110,97,109,101,61,39,37,113,39,32,65,78,68,32,116,121,112,101,61,39,116,97,98,108,101,39,0,0,0,0,0,0,118,105,114,116,117,97,108,32,116,97,98,108,101,115,32,109,97,121,32,110,111,116,32,98,101,32,97,108,116,101,114,101,100,0,0,0,0,0,0,0,67,97,110,110,111,116,32,97,100,100,32,97,32,99,111,108,117,109,110,32,116,111,32,97,32,118,105,101,\n119,0,0,0,115,113,108,105,116,101,95,97,108,116,101,114,116,97,98,95,37,115,0,0,0,0,0,0,117,110,97,98,108,101,32,116,111,32,111,112,101,110,32,97,32,116,101,109,112,111,114,97,114,121,32,100,97,116,97,98,97,115,101,32,102,105,108,101,32,102,111,114,32,115,116,111,114,105,110,103,32,116,101,109,112,111,114,97,114,121,32,116,97,98,108,101,115,0,0,0,115,113,108,105,116,101,95,0,116,97,98,108,101,32,37,115,32,109,97,121,32,110,111,116,32,98,101,32,97,108,116,101,114,101,100,0,0,0,0,0,67,97,110,110,111,\n116,32,97,100,100,32,97,32,80,82,73,77,65,82,89,32,75,69,89,32,99,111,108,117,109,110,0,67,97,110,110,111,116,32,97,100,100,32,97,32,85,78,73,81,85,69,32,99,111,108,117,109,110,0,0,0,0,0,0,67,97,110,110,111,116,32,97,100,100,32,97,32,82,69,70,69,82,69,78,67,69,83,32,99,111,108,117,109,110,32,119,105,116,104,32,110,111,110,45,78,85,76,76,32,100,101,102,97,117,108,116,32,118,97,108,117,101,0,0,0,0,0,0,67,97,110,110,111,116,32,97,100,100,32,97,32,78,79,84,32,78,85,76,76,32,99,111,108,117,109,110,32,\n119,105,116,104,32,100,101,102,97,117,108,116,32,118,97,108,117,101,32,78,85,76,76,0,0,0,0,67,97,110,110,111,116,32,97,100,100,32,97,32,99,111,108,117,109,110,32,119,105,116,104,32,110,111,110,45,99,111,110,115,116,97,110,116,32,100,101,102,97,117,108,116,0,0,0,85,80,68,65,84,69,32,34,37,119,34,46,37,115,32,83,69,84,32,115,113,108,32,61,32,115,117,98,115,116,114,40,115,113,108,44,49,44,37,100,41,32,124,124,32,39,44,32,39,32,124,124,32,37,81,32,124,124,32,115,117,98,115,116,114,40,115,113,108,44,37,\n100,41,32,87,72,69,82,69,32,116,121,112,101,32,61,32,39,116,97,98,108,101,39,32,65,78,68,32,110,97,109,101,32,61,32,37,81,0,0,0,0,116,98,108,95,110,97,109,101,61,37,81,0,0,0,0,0,116,121,112,101,61,39,116,114,105,103,103,101,114,39,32,65,78,68,32,40,37,115,41,0,110,97,109,101,61,37,81,0,37,115,32,79,82,32,110,97,109,101,61,37,81,0,0,0,45,0,0,0,0,0,0,0,116,104,101,114,101,32,105,115,32,97,108,114,101,97,100,121,32,97,110,111,116,104,101,114,32,116,97,98,108,101,32,111,114,32,105,110,100,101,120,32,\n119,105,116,104,32,116,104,105,115,32,110,97,109,101,58,32,37,115,0,0,0,0,0,0,118,105,101,119,32,37,115,32,109,97,121,32,110,111,116,32,98,101,32,97,108,116,101,114,101,100,0,0,0,0,0,0,85,80,68,65,84,69,32,34,37,119,34,46,37,115,32,83,69,84,32,115,113,108,32,61,32,115,113,108,105,116,101,95,114,101,110,97,109,101,95,112,97,114,101,110,116,40,115,113,108,44,32,37,81,44,32,37,81,41,32,87,72,69,82,69,32,37,115,59,0,0,0,0,85,80,68,65,84,69,32,37,81,46,37,115,32,83,69,84,32,115,113,108,32,61,32,67,65,\n83,69,32,87,72,69,78,32,116,121,112,101,32,61,32,39,116,114,105,103,103,101,114,39,32,84,72,69,78,32,115,113,108,105,116,101,95,114,101,110,97,109,101,95,116,114,105,103,103,101,114,40,115,113,108,44,32,37,81,41,69,76,83,69,32,115,113,108,105,116,101,95,114,101,110,97,109,101,95,116,97,98,108,101,40,115,113,108,44,32,37,81,41,32,69,78,68,44,32,116,98,108,95,110,97,109,101,32,61,32,37,81,44,32,110,97,109,101,32,61,32,67,65,83,69,32,87,72,69,78,32,116,121,112,101,61,39,116,97,98,108,101,39,32,84,72,\n69,78,32,37,81,32,87,72,69,78,32,110,97,109,101,32,76,73,75,69,32,39,115,113,108,105,116,101,95,97,117,116,111,105,110,100,101,120,37,37,39,32,65,78,68,32,116,121,112,101,61,39,105,110,100,101,120,39,32,84,72,69,78,32,39,115,113,108,105,116,101,95,97,117,116,111,105,110,100,101,120,95,39,32,124,124,32,37,81,32,124,124,32,115,117,98,115,116,114,40,110,97,109,101,44,37,100,43,49,56,41,32,69,76,83,69,32,110,97,109,101,32,69,78,68,32,87,72,69,82,69,32,116,98,108,95,110,97,109,101,61,37,81,32,67,79,76,\n76,65,84,69,32,110,111,99,97,115,101,32,65,78,68,32,40,116,121,112,101,61,39,116,97,98,108,101,39,32,79,82,32,116,121,112,101,61,39,105,110,100,101,120,39,32,79,82,32,116,121,112,101,61,39,116,114,105,103,103,101,114,39,41,59,0,115,113,108,105,116,101,95,115,101,113,117,101,110,99,101,0,85,80,68,65,84,69,32,34,37,119,34,46,115,113,108,105,116,101,95,115,101,113,117,101,110,99,101,32,115,101,116,32,110,97,109,101,32,61,32,37,81,32,87,72,69,82,69,32,110,97,109,101,32,61,32,37,81,0,0,0,0,0,0,0,85,80,\n68,65,84,69,32,115,113,108,105,116,101,95,116,101,109,112,95,109,97,115,116,101,114,32,83,69,84,32,115,113,108,32,61,32,115,113,108,105,116,101,95,114,101,110,97,109,101,95,116,114,105,103,103,101,114,40,115,113,108,44,32,37,81,41,44,32,116,98,108,95,110,97,109,101,32,61,32,37,81,32,87,72,69,82,69,32,37,115,59,0,0,0,0,0,118,105,101,119,32,37,115,32,105,115,32,99,105,114,99,117,108,97,114,108,121,32,100,101,102,105,110,101,100,0,0,0,0,0,2,0,3,0,5,0,6,0,7,0,8,0,9,0,110,111,32,115,117,99,104,32,99,111,\n108,108,97,116,105,111,110,32,115,101,113,117,101,110,99,101,58,32,37,115,0,0,3,2,1,0,0,0,0,0,73,78,84,69,71,69,82,0,37,115,58,37,100,0,0,0,97,32,71,82,79,85,80,32,66,89,32,99,108,97,117,115,101,32,105,115,32,114,101,113,117,105,114,101,100,32,98,101,102,111,114,101,32,72,65,86,73,78,71,0,0,0,0,0,79,82,68,69,82,0,0,0,71,82,79,85,80,0,0,0,97,103,103,114,101,103,97,116,101,32,102,117,110,99,116,105,111,110,115,32,97,114,101,32,110,111,116,32,97,108,108,111,119,101,100,32,105,110,32,116,104,101,32,71,\n82,79,85,80,32,66,89,32,99,108,97,117,115,101,0,0,0,0,0,0,116,111,111,32,109,97,110,121,32,116,101,114,109,115,32,105,110,32,79,82,68,69,82,32,66,89,32,99,108,97,117,115,101,0,0,0,0,0,0,0,37,114,32,79,82,68,69,82,32,66,89,32,116,101,114,109,32,100,111,101,115,32,110,111,116,32,109,97,116,99,104,32,97,110,121,32,99,111,108,117,109,110,32,105,110,32,116,104,101,32,114,101,115,117,108,116,32,115,101,116,0,0,0,0,37,114,32,37,115,32,66,89,32,116,101,114,109,32,111,117,116,32,111,102,32,114,97,110,103,\n101,32,45,32,115,104,111,117,108,100,32,98,101,32,98,101,116,119,101,101,110,32,49,32,97,110,100,32,37,100,0,116,111,111,32,109,97,110,121,32,116,101,114,109,115,32,105,110,32,37,115,32,66,89,32,99,108,97,117,115,101,0,0,69,120,112,114,101,115,115,105,111,110,32,116,114,101,101,32,105,115,32,116,111,111,32,108,97,114,103,101,32,40,109,97,120,105,109,117,109,32,100,101,112,116,104,32,37,100,41,0,102,117,110,99,116,105,111,110,115,0,0,0,0,0,0,0,115,101,99,111,110,100,32,97,114,103,117,109,101,110,116,\n32,116,111,32,108,105,107,101,108,105,104,111,111,100,40,41,32,109,117,115,116,32,98,101,32,97,32,99,111,110,115,116,97,110,116,32,98,101,116,119,101,101,110,32,48,46,48,32,97,110,100,32,49,46,48,0,0,110,111,116,32,97,117,116,104,111,114,105,122,101,100,32,116,111,32,117,115,101,32,102,117,110,99,116,105,111,110,58,32,37,115,0,0,0,0,0,0,109,105,115,117,115,101,32,111,102,32,97,103,103,114,101,103,97,116,101,32,102,117,110,99,116,105,111,110,32,37,46,42,115,40,41,0,0,0,0,0,110,111,32,115,117,99,104,\n32,102,117,110,99,116,105,111,110,58,32,37,46,42,115,0,0,119,114,111,110,103,32,110,117,109,98,101,114,32,111,102,32,97,114,103,117,109,101,110,116,115,32,116,111,32,102,117,110,99,116,105,111,110,32,37,46,42,115,40,41,0,0,0,0,115,117,98,113,117,101,114,105,101,115,0,0,0,0,0,0,112,97,114,97,109,101,116,101,114,115,0,0,0,0,0,0,37,115,32,112,114,111,104,105,98,105,116,101,100,32,105,110,32,67,72,69,67,75,32,99,111,110,115,116,114,97,105,110,116,115,0,0,0,0,0,0,37,115,32,112,114,111,104,105,98,105,116,\n101,100,32,105,110,32,112,97,114,116,105,97,108,32,105,110,100,101,120,32,87,72,69,82,69,32,99,108,97,117,115,101,115,0,0,0,0,110,101,119,0,0,0,0,0,111,108,100,0,0,0,0,0,109,105,115,117,115,101,32,111,102,32,97,108,105,97,115,101,100,32,97,103,103,114,101,103,97,116,101,32,37,115,0,0,110,111,32,115,117,99,104,32,99,111,108,117,109,110,0,0,97,109,98,105,103,117,111,117,115,32,99,111,108,117,109,110,32,110,97,109,101,0,0,0,37,115,58,32,37,115,46,37,115,46,37,115,0,0,0,0,37,115,58,32,37,115,46,37,115,\n0,0,0,0,0,0,0,37,115,58,32,37,115,0,0,82,79,87,73,68,0,0,0,97,99,99,101,115,115,32,116,111,32,37,115,46,37,115,46,37,115,32,105,115,32,112,114,111,104,105,98,105,116,101,100,0,0,0,0,0,0,0,0,97,99,99,101,115,115,32,116,111,32,37,115,46,37,115,32,105,115,32,112,114,111,104,105,98,105,116,101,100,0,0,0,95,82,79,87,73,68,95,0,79,73,68,0,0,0,0,0,115,113,108,105,116,101,95,115,113,95,37,112,0,0,0,0,116,111,111,32,109,97,110,121,32,114,101,102,101,114,101,110,99,101,115,32,116,111,32,34,37,115,34,58,32,\n109,97,120,32,54,53,53,51,53,0,0,42,0,0,0,0,0,0,0,37,115,46,37,115,0,0,0,37,115,46,37,115,46,37,115,0,0,0,0,0,0,0,0,110,111,32,115,117,99,104,32,116,97,98,108,101,58,32,37,115,0,0,0,0,0,0,0,110,111,32,116,97,98,108,101,115,32,115,112,101,99,105,102,105,101,100,0,0,0,0,0,116,111,111,32,109,97,110,121,32,99,111,108,117,109,110,115,32,105,110,32,114,101,115,117,108,116,32,115,101,116,0,0,97,32,78,65,84,85,82,65,76,32,106,111,105,110,32,109,97,121,32,110,111,116,32,104,97,118,101,32,97,110,32,79,78,32,\n111,114,32,85,83,73,78,71,32,99,108,97,117,115,101,0,0,0,0,0,0,0,99,97,110,110,111,116,32,104,97,118,101,32,98,111,116,104,32,79,78,32,97,110,100,32,85,83,73,78,71,32,99,108,97,117,115,101,115,32,105,110,32,116,104,101,32,115,97,109,101,32,106,111,105,110,0,0,99,97,110,110,111,116,32,106,111,105,110,32,117,115,105,110,103,32,99,111,108,117,109,110,32,37,115,32,45,32,99,111,108,117,109,110,32,110,111,116,32,112,114,101,115,101,110,116,32,105,110,32,98,111,116,104,32,116,97,98,108,101,115,0,110,111,\n32,115,117,99,104,32,105,110,100,101,120,58,32,37,115,0,0,0,0,0,0,0,109,117,108,116,105,112,108,101,32,114,101,102,101,114,101,110,99,101,115,32,116,111,32,114,101,99,117,114,115,105,118,101,32,116,97,98,108,101,58,32,37,115,0,0,0,0,0,0,99,105,114,99,117,108,97,114,32,114,101,102,101,114,101,110,99,101,58,32,37,115,0,0,116,97,98,108,101,32,37,115,32,104,97,115,32,37,100,32,118,97,108,117,101,115,32,102,111,114,32,37,100,32,99,111,108,117,109,110,115,0,0,0,109,117,108,116,105,112,108,101,32,114,101,\n99,117,114,115,105,118,101,32,114,101,102,101,114,101,110,99,101,115,58,32,37,115,0,0,0,0,0,0,0,114,101,99,117,114,115,105,118,101,32,114,101,102,101,114,101,110,99,101,32,105,110,32,97,32,115,117,98,113,117,101,114,121,58,32,37,115,0,0,0,110,111,32,115,117,99,104,32,109,111,100,117,108,101,58,32,37,115,0,0,0,0,0,0,118,116,97,98,108,101,32,99,111,110,115,116,114,117,99,116,111,114,32,102,97,105,108,101,100,58,32,37,115,0,0,0,118,116,97,98,108,101,32,99,111,110,115,116,114,117,99,116,111,114,32,100,\n105,100,32,110,111,116,32,100,101,99,108,97,114,101,32,115,99,104,101,109,97,58,32,37,115,0,0,0,104,105,100,100,101,110,0,0,32,104,105,100,100,101,110,0,111,98,106,101,99,116,32,110,97,109,101,32,114,101,115,101,114,118,101,100,32,102,111,114,32,105,110,116,101,114,110,97,108,32,117,115,101,58,32,37,115,0,0,0,0,0,0,0,99,111,114,114,117,112,116,32,100,97,116,97,98,97,115,101,0,0,0,0,0,0,0,0,117,110,107,110,111,119,110,32,100,97,116,97,98,97,115,101,32,37,84,0,0,0,0,0,105,100,120,0,0,0,0,0,116,98,108,\n0,0,0,0,0,2,0,1,0,0,0,0,0,0,0,0,0,46,0,0,0,0,0,0,0,0,0,0,0,176,71,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,1,0,0,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,160,71,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,66,66,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,0,0,0,0,128,71,0,0,0,0,0,0,0,0,0,0,0,0,0,0,115,116,97,116,95,103,101,116,0,0,0,0,0,0,0,0,37,108,108,117,0,0,0,0,32,37,108,108,117,0,0,0,115,116,97,116,95,112,117,115,104,0,0,0,0,0,0,0,115,116,97,116,95,105,110,105,116,0,0,0,0,0,0,0,216,71,0,0,232,71,0,0,248,71,0,\n0,0,0,0,0,8,72,0,0,0,0,0,0,115,113,108,105,116,101,95,115,116,97,116,49,0,0,0,0,116,98,108,44,105,100,120,44,115,116,97,116,0,0,0,0,115,113,108,105,116,101,95,115,116,97,116,51,0,0,0,0,115,113,108,105,116,101,95,115,116,97,116,52,0,0,0,0,67,82,69,65,84,69,32,84,65,66,76,69,32,37,81,46,37,115,40,37,115,41,0,0,68,69,76,69,84,69,32,70,82,79,77,32,37,81,46,37,115,32,87,72,69,82,69,32,37,115,61,37,81,0,0,0,67,82,69,65,84,69,32,84,65,66,76,69,32,115,113,108,105,116,101,95,109,97,115,116,101,114,40,10,32,\n32,116,121,112,101,32,116,101,120,116,44,10,32,32,110,97,109,101,32,116,101,120,116,44,10,32,32,116,98,108,95,110,97,109,101,32,116,101,120,116,44,10,32,32,114,111,111,116,112,97,103,101,32,105,110,116,101,103,101,114,44,10,32,32,115,113,108,32,116,101,120,116,10,41,0,67,82,69,65,84,69,32,84,69,77,80,32,84,65,66,76,69,32,115,113,108,105,116,101,95,116,101,109,112,95,109,97,115,116,101,114,40,10,32,32,116,121,112,101,32,116,101,120,116,44,10,32,32,110,97,109,101,32,116,101,120,116,44,10,32,32,116,\n98,108,95,110,97,109,101,32,116,101,120,116,44,10,32,32,114,111,111,116,112,97,103,101,32,105,110,116,101,103,101,114,44,10,32,32,115,113,108,32,116,101,120,116,10,41,0,0,0,0,0,0,0,49,0,0,0,0,0,0,0,97,116,116,97,99,104,101,100,32,100,97,116,97,98,97,115,101,115,32,109,117,115,116,32,117,115,101,32,116,104,101,32,115,97,109,101,32,116,101,120,116,32,101,110,99,111,100,105,110,103,32,97,115,32,109,97,105,110,32,100,97,116,97,98,97,115,101,0,0,0,0,0,117,110,115,117,112,112,111,114,116,101,100,32,102,\n105,108,101,32,102,111,114,109,97,116,0,83,69,76,69,67,84,32,110,97,109,101,44,32,114,111,111,116,112,97,103,101,44,32,115,113,108,32,70,82,79,77,32,39,37,113,39,46,37,115,32,79,82,68,69,82,32,66,89,32,114,111,119,105,100,0,0,83,69,76,69,67,84,32,116,98,108,44,105,100,120,44,115,116,97,116,32,70,82,79,77,32,37,81,46,115,113,108,105,116,101,95,115,116,97,116,49,0,0,0,0,0,0,0,0,117,110,111,114,100,101,114,101,100,42,0,0,0,0,0,0,115,122,61,91,48,45,57,93,42,0,0,0,0,0,0,0,33,0,32,0,30,0,28,0,26,0,0,0,\n0,0,0,0,105,110,118,97,108,105,100,32,114,111,111,116,112,97,103,101,0,0,0,0,0,0,0,0,63,0,0,0,0,0,0,0,109,97,108,102,111,114,109,101,100,32,100,97,116,97,98,97,115,101,32,115,99,104,101,109,97,32,40,37,115,41,0,0,37,115,32,45,32,37,115,0,117,110,97,98,108,101,32,116,111,32,105,100,101,110,116,105,102,121,32,116,104,101,32,111,98,106,101,99,116,32,116,111,32,98,101,32,114,101,105,110,100,101,120,101,100,0,0,0,44,32,0,0,0,0,0,0,46,0,0,0,0,0,0,0,109,105,115,117,115,101,32,111,102,32,97,103,103,114,101,\n103,97,116,101,58,32,37,115,40,41,0,0,0,0,0,0,0,117,110,107,110,111,119,110,32,102,117,110,99,116,105,111,110,58,32,37,46,42,115,40,41,0,0,0,0,0,0,0,0,82,65,73,83,69,40,41,32,109,97,121,32,111,110,108,121,32,98,101,32,117,115,101,100,32,119,105,116,104,105,110,32,97,32,116,114,105,103,103,101,114,45,112,114,111,103,114,97,109,0,0,0,0,0,0,0,69,88,69,67,85,84,69,32,37,115,37,115,32,83,85,66,81,85,69,82,89,32,37,100,0,0,0,0,0,0,0,0,67,79,82,82,69,76,65,84,69,68,32,0,0,0,0,0,76,73,83,84,0,0,0,0,83,67,\n65,76,65,82,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,120,0,0,0,0,0,0,104,101,120,32,108,105,116,101,114,97,108,32,116,111,111,32,98,105,103,58,32,37,115,0,1,0,1,0,0,0,0,0,0,0,0,0,49,0,0,0,0,0,0,0,0,0,0,0,208,75,0,0,0,0,0,0,0,0,0,0,0,0,0,0,115,113,108,105,116,101,95,100,101,116,97,99,104,0,0,0,110,111,32,115,117,99,104,32,100,97,116,97,98,97,115,101,58,32,37,115,0,0,0,0,99,97,110,110,111,116,32,100,101,116,97,99,104,32,100,97,116,97,98,97,115,101,32,37,115,0,0,0,0,0,0,0,99,97,110,110,\n111,116,32,68,69,84,65,67,72,32,100,97,116,97,98,97,115,101,32,119,105,116,104,105,110,32,116,114,97,110,115,97,99,116,105,111,110,0,0,0,0,0,0,0,100,97,116,97,98,97,115,101,32,37,115,32,105,115,32,108,111,99,107,101,100,0,0,0,3,0,1,0,0,0,0,0,0,0,0,0,50,0,0,0,0,0,0,0,0,0,0,0,136,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,115,113,108,105,116,101,95,97,116,116,97,99,104,0,0,0,116,111,111,32,109,97,110,121,32,97,116,116,97,99,104,101,100,32,100,97,116,97,98,97,115,101,115,32,45,32,109,97,120,32,37,100,0,0,0,0,99,\n97,110,110,111,116,32,65,84,84,65,67,72,32,100,97,116,97,98,97,115,101,32,119,105,116,104,105,110,32,116,114,97,110,115,97,99,116,105,111,110,0,0,0,0,0,0,0,100,97,116,97,98,97,115,101,32,37,115,32,105,115,32,97,108,114,101,97,100,121,32,105,110,32,117,115,101,0,0,0,100,97,116,97,98,97,115,101,32,105,115,32,97,108,114,101,97,100,121,32,97,116,116,97,99,104,101,100,0,0,0,0,117,110,97,98,108,101,32,116,111,32,111,112,101,110,32,100,97,116,97,98,97,115,101,58,32,37,115,0,0,0,0,0,110,111,32,115,117,99,\n104,32,116,114,105,103,103,101,114,58,32,37,83,0,0,0,0,0,108,0,246,0,97,0,1,0,47,0,1,2,78,2,247,1,97,0,1,0,47,0,0,2,78,2,247,1,95,0,0,0,9,0,254,0,0,0,0,0,116,101,109,112,111,114,97,114,121,32,116,114,105,103,103,101,114,32,109,97,121,32,110,111,116,32,104,97,118,101,32,113,117,97,108,105,102,105,101,100,32,110,97,109,101,0,0,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,116,114,105,103,103,101,114,115,32,111,110,32,118,105,114,116,117,97,108,32,116,97,98,108,101,115,0,0,0,0,0,0,0,0,116,114,\n105,103,103,101,114,32,37,84,32,97,108,114,101,97,100,121,32,101,120,105,115,116,115,0,0,0,0,0,0,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,116,114,105,103,103,101,114,32,111,110,32,115,121,115,116,101,109,32,116,97,98,108,101,0,0,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,37,115,32,116,114,105,103,103,101,114,32,111,110,32,118,105,101,119,58,32,37,83,0,0,0,0,66,69,70,79,82,69,0,0,65,70,84,69,82,0,0,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,73,78,83,84,69,65,68,32,79,70,\n32,116,114,105,103,103,101,114,32,111,110,32,116,97,98,108,101,58,32,37,83,0,0,0,37,115,32,37,84,32,99,97,110,110,111,116,32,114,101,102,101,114,101,110,99,101,32,111,98,106,101,99,116,115,32,105,110,32,100,97,116,97,98,97,115,101,32,37,115,0,0,0,37,115,32,99,97,110,110,111,116,32,117,115,101,32,118,97,114,105,97,98,108,101,115,0,73,78,83,69,82,84,32,73,78,84,79,32,37,81,46,37,115,32,86,65,76,85,69,83,40,39,116,114,105,103,103,101,114,39,44,37,81,44,37,81,44,48,44,39,67,82,69,65,84,69,32,84,82,73,\n71,71,69,82,32,37,113,39,41,0,116,121,112,101,61,39,116,114,105,103,103,101,114,39,32,65,78,68,32,110,97,109,101,61,39,37,113,39,0,0,0,0,45,37,84,0,0,0,0,0,114,101,115,117,108,116,0,0,96,87,0,0,0,0,0,0,0,0,0,0,152,82,0,0,1,1,0,0,0,0,0,0,112,87,0,0,2,0,0,0,0,0,16,0,128,87,0,0,3,0,0,0,0,0,0,0,24,82,0,0,4,1,0,0,0,0,0,0,144,87,0,0,2,0,0,0,16,0,0,0,160,87,0,0,5,0,0,0,0,0,0,0,184,87,0,0,2,0,0,0,8,0,0,0,208,87,0,0,6,0,0,0,0,0,0,0,224,87,0,0,7,0,0,0,0,0,0,0,240,87,0,0,2,0,0,0,128,0,0,0,0,88,0,0,9,1,0,0,0,\n0,0,0,16,88,0,0,10,1,0,0,0,0,0,0,40,88,0,0,2,0,0,0,0,0,0,1,64,88,0,0,2],\"i8\",Ha,w.Ab+10240);\nH([1,0,0,120,85,0,0,11,0,0,0,0,0,0,0,88,88,0,0,12,1,0,0,0,0,0,0,112,88,0,0,13,1,0,0,0,0,0,0,136,88,0,0,2,0,0,0,0,0,8,0,152,88,0,0,0,0,0,0,0,0,0,0,168,88,0,0,2,0,0,0,32,0,0,0,192,88,0,0,2,0,0,0,4,0,0,0,208,88,0,0,2,0,0,0,0,32,0,0,240,88,0,0,14,1,0,0,0,0,0,0,8,89,0,0,15,1,0,0,0,0,0,0,24,89,0,0,16,1,0,0,0,0,0,0,56,84,0,0,17,1,0,0,0,0,0,0,112,82,0,0,18,1,0,0,0,0,0,0,128,82,0,0,19,0,0,0,0,0,0,0,40,89,0,0,2,0,0,0,0,128,0,0,96,82,0,0,21,0,0,0,0,0,0,0,64,89,0,0,22,1,0,0,0,0,0,0,192,82,0,0,23,0,0,0,0,0,0,\n0,80,89,0,0,22,1,0,0,0,0,0,0,40,82,0,0,24,0,0,0,0,0,0,0,96,89,0,0,2,0,0,0,0,0,0,2,112,89,0,0,17,1,0,0,0,0,0,0,128,89,0,0,2,0,0,0,0,64,0,0,152,89,0,0,2,0,0,0,0,0,4,0,176,89,0,0,2,0,0,0,0,0,2,0,208,89,0,0,0,0,0,0,0,0,0,0,56,82,0,0,25,0,0,0,0,0,0,0,224,89,0,0,2,0,0,0,64,0,0,0,248,89,0,0,26,0,0,0,0,0,0,0,40,86,0,0,27,0,0,0,0,0,0,0,8,90,0,0,28,1,0,0,0,0,0,0,24,83,0,0,29,1,0,0,0,0,0,0,16,90,0,0,30,1,0,0,0,0,0,0,208,82,0,0,31,0,0,0,0,0,0,0,224,82,0,0,32,0,0,0,0,0,0,0,56,86,0,0,33,0,0,0,0,0,0,0,32,90,0,0,\n0,0,0,0,0,0,0,0,8,86,0,0,34,0,0,0,0,0,0,0,48,90,0,0,35,1,0,0,0,0,0,0,64,90,0,0,2,0,0,0,0,8,1,0,0,0,0,0,4,0,0,0,51,0,1,3,137,1,8,0,25,0,2,0,90,1,2,1,137,1,8,0,25,0,1,0,154,0,0,0,35,1,1,0,0,0,0,0,99,97,99,104,101,95,115,105,122,101,0,0,0,0,0,0,112,97,103,101,95,115,105,122,101,0,0,0,0,0,0,0,115,101,99,117,114,101,95,100,101,108,101,116,101,0,0,0,110,111,114,109,97,108,0,0,101,120,99,108,117,115,105,118,101,0,0,0,0,0,0,0,108,111,99,107,105,110,103,95,109,111,100,101,0,0,0,0,106,111,117,114,110,97,108,\n95,109,111,100,101,0,0,0,0,106,111,117,114,110,97,108,95,115,105,122,101,95,108,105,109,105,116,0,0,0,0,0,0,97,117,116,111,95,118,97,99,117,117,109,0,0,0,0,0,4,0,1,0,51,0,1,4,45,1,0,0,24,0,2,0,25,0,1,0,52,0,7,1,109,109,97,112,95,115,105,122,101,0,0,0,0,0,0,0,116,101,109,112,95,115,116,111,114,101,0,0,0,0,0,0,116,101,109,112,95,115,116,111,114,101,95,100,105,114,101,99,116,111,114,121,0,0,0,0,110,111,116,32,97,32,119,114,105,116,97,98,108,101,32,100,105,114,101,99,116,111,114,121,0,0,0,0,0,0,0,0,115,\n121,110,99,104,114,111,110,111,117,115,0,0,0,0,0,83,97,102,101,116,121,32,108,101,118,101,108,32,109,97,121,32,110,111,116,32,98,101,32,99,104,97,110,103,101,100,32,105,110,115,105,100,101,32,97,32,116,114,97,110,115,97,99,116,105,111,110,0,0,0,0,99,105,100,0,0,0,0,0,110,97,109,101,0,0,0,0,116,121,112,101,0,0,0,0,110,111,116,110,117,108,108,0,100,102,108,116,95,118,97,108,117,101,0,0,0,0,0,0,112,107,0,0,0,0,0,0,116,97,98,108,101,0,0,0,119,105,100,116,104,0,0,0,104,101,105,103,104,116,0,0,115,101,\n113,110,111,0,0,0,115,101,113,0,0,0,0,0,117,110,105,113,117,101,0,0,102,105,108,101,0,0,0,0,105,100,0,0,0,0,0,0,102,114,111,109,0,0,0,0,116,111,0,0,0,0,0,0,111,110,95,117,112,100,97,116,101,0,0,0,0,0,0,0,111,110,95,100,101,108,101,116,101,0,0,0,0,0,0,0,109,97,116,99,104,0,0,0,78,79,78,69,0,0,0,0,112,97,114,101,110,116,0,0,102,107,105,100,0,0,0,0,138,1,0,0,97,0,3,0,35,3,1,0,0,0,0,0,105,110,116,101,103,114,105,116,121,95,99,104,101,99,107,0,42,42,42,32,105,110,32,100,97,116,97,98,97,115,101,32,37,115,\n32,42,42,42,10,0,78,85,76,76,32,118,97,108,117,101,32,105,110,32,37,115,46,37,115,0,0,0,0,0,114,111,119,32,0,0,0,0,32,109,105,115,115,105,110,103,32,102,114,111,109,32,105,110,100,101,120,32,0,0,0,0,110,111,110,45,117,110,105,113,117,101,32,101,110,116,114,121,32,105,110,32,105,110,100,101,120,32,0,0,0,0,0,0,119,114,111,110,103,32,35,32,111,102,32,101,110,116,114,105,101,115,32,105,110,32,105,110,100,101,120,32,0,0,0,0,111,107,0,0,0,0,0,0,40,85,0,0,1,0,0,0,48,85,0,0,1,0,0,0,56,85,0,0,2,0,0,0,72,85,\n0,0,3,0,0,0,88,85,0,0,2,0,0,0,96,85,0,0,3,0,0,0,104,85,0,0,0,0,0,0,112,85,0,0,0,0,0,0,0,0,0,0,0,0,0,0,85,84,70,56,0,0,0,0,85,84,70,45,56,0,0,0,85,84,70,45,49,54,108,101,0,0,0,0,0,0,0,0,85,84,70,45,49,54,98,101,0,0,0,0,0,0,0,0,85,84,70,49,54,108,101,0,85,84,70,49,54,98,101,0,85,84,70,45,49,54,0,0,85,84,70,49,54,0,0,0,101,110,99,111,100,105,110,103,0,0,0,0,0,0,0,0,117,110,115,117,112,112,111,114,116,101,100,32,101,110,99,111,100,105,110,103,58,32,37,115,0,0,0,0,0,0,0,0,4,0,1,0,25,0,1,0,52,0,0,1,0,0,\n0,0,4,0,0,0,51,0,1,0,35,1,1,0,0,0,0,0,99,111,109,112,105,108,101,95,111,112,116,105,111,110,0,0,102,117,108,108,0,0,0,0,114,101,115,116,97,114,116,0,98,117,115,121,0,0,0,0,108,111,103,0,0,0,0,0,99,104,101,99,107,112,111,105,110,116,101,100,0,0,0,0,119,97,108,95,97,117,116,111,99,104,101,99,107,112,111,105,110,116,0,0,0,0,0,0,116,105,109,101,111,117,116,0,115,111,102,116,95,104,101,97,112,95,108,105,109,105,116,0,116,104,114,101,97,100,115,0,37,95,0,0,0,0,0,0,102,111,114,101,105,103,110,32,107,101,\n121,32,109,105,115,109,97,116,99,104,32,45,32,34,37,119,34,32,114,101,102,101,114,101,110,99,105,110,103,32,34,37,119,34,0,0,0,0,83,69,84,32,78,85,76,76,0,0,0,0,0,0,0,0,83,69,84,32,68,69,70,65,85,76,84,0,0,0,0,0,67,65,83,67,65,68,69,0,82,69,83,84,82,73,67,84,0,0,0,0,0,0,0,0,78,79,32,65,67,84,73,79,78,0,0,0,0,0,0,0,116,101,109,112,111,114,97,114,121,32,115,116,111,114,97,103,101,32,99,97,110,110,111,116,32,98,101,32,99,104,97,110,103,101,100,32,102,114,111,109,32,119,105,116,104,105,110,32,97,32,116,\n114,97,110,115,97,99,116,105,111,110,0,0,0,110,111,110,101,0,0,0,0,105,110,99,114,101,109,101,110,116,97,108,0,0,0,0,0,48,87,0,0,56,87,0,0,64,87,0,0,72,87,0,0,184,18,0,0,88,87,0,0,100,101,108,101,116,101,0,0,112,101,114,115,105,115,116,0,111,102,102,0,0,0,0,0,116,114,117,110,99,97,116,101,0,0,0,0,0,0,0,0,119,97,108,0,0,0,0,0,97,112,112,108,105,99,97,116,105,111,110,95,105,100,0,0,97,117,116,111,109,97,116,105,99,95,105,110,100,101,120,0,98,117,115,121,95,116,105,109,101,111,117,116,0,0,0,0,99,97,\n99,104,101,95,115,112,105,108,108,0,0,0,0,0,99,97,115,101,95,115,101,110,115,105,116,105,118,101,95,108,105,107,101,0,0,0,0,0,99,104,101,99,107,112,111,105,110,116,95,102,117,108,108,102,115,121,110,99,0,0,0,0,99,111,108,108,97,116,105,111,110,95,108,105,115,116,0,0,99,111,109,112,105,108,101,95,111,112,116,105,111,110,115,0,99,111,117,110,116,95,99,104,97,110,103,101,115,0,0,0,100,97,116,97,98,97,115,101,95,108,105,115,116,0,0,0,100,101,102,97,117,108,116,95,99,97,99,104,101,95,115,105,122,101,0,\n0,0,0,0,0,100,101,102,101,114,95,102,111,114,101,105,103,110,95,107,101,121,115,0,0,0,0,0,0,101,109,112,116,121,95,114,101,115,117,108,116,95,99,97,108,108,98,97,99,107,115,0,0,102,111,114,101,105,103,110,95,107,101,121,95,99,104,101,99,107,0,0,0,0,0,0,0,102,111,114,101,105,103,110,95,107,101,121,95,108,105,115,116,0,0,0,0,0,0,0,0,102,111,114,101,105,103,110,95,107,101,121,115,0,0,0,0,102,114,101,101,108,105,115,116,95,99,111,117,110,116,0,0,102,117,108,108,95,99,111,108,117,109,110,95,110,97,109,\n101,115,0,0,0,0,0,0,0,102,117,108,108,102,115,121,110,99,0,0,0,0,0,0,0,105,103,110,111,114,101,95,99,104,101,99,107,95,99,111,110,115,116,114,97,105,110,116,115,0,0,0,0,0,0,0,0,105,110,99,114,101,109,101,110,116,97,108,95,118,97,99,117,117,109,0,0,0,0,0,0,105,110,100,101,120,95,105,110,102,111,0,0,0,0,0,0,105,110,100,101,120,95,108,105,115,116,0,0,0,0,0,0,108,101,103,97,99,121,95,102,105,108,101,95,102,111,114,109,97,116,0,0,0,0,0,0,109,97,120,95,112,97,103,101,95,99,111,117,110,116,0,0,112,97,103,\n101,95,99,111,117,110,116,0,0,0,0,0,0,113,117,101,114,121,95,111,110,108,121,0,0,0,0,0,0,113,117,105,99,107,95,99,104,101,99,107,0,0,0,0,0,114,101,97,100,95,117,110,99,111,109,109,105,116,116,101,100,0,0,0,0,0,0,0,0,114,101,99,117,114,115,105,118,101,95,116,114,105,103,103,101,114,115,0,0,0,0,0,0,114,101,118,101,114,115,101,95,117,110,111,114,100,101,114,101,100,95,115,101,108,101,99,116,115,0,0,0,0,0,0,0,115,99,104,101,109,97,95,118,101,114,115,105,111,110,0,0,115,104,111,114,116,95,99,111,108,117,\n109,110,95,110,97,109,101,115,0,0,0,0,0,0,115,104,114,105,110,107,95,109,101,109,111,114,121,0,0,0,115,116,97,116,115,0,0,0,116,97,98,108,101,95,105,110,102,111,0,0,0,0,0,0,117,115,101,114,95,118,101,114,115,105,111,110,0,0,0,0,119,97,108,95,99,104,101,99,107,112,111,105,110,116,0,0,119,114,105,116,97,98,108,101,95,115,99,104,101,109,97,0,110,111,32,115,117,99,104,32,105,110,100,101,120,58,32,37,83,0,0,0,0,0,0,0,105,110,100,101,120,32,97,115,115,111,99,105,97,116,101,100,32,119,105,116,104,32,85,\n78,73,81,85,69,32,111,114,32,80,82,73,77,65,82,89,32,75,69,89,32,99,111,110,115,116,114,97,105,110,116,32,99,97,110,110,111,116,32,98,101,32,100,114,111,112,112,101,100,0,0,0,0,0,0,0,0,68,69,76,69,84,69,32,70,82,79,77,32,37,81,46,37,115,32,87,72,69,82,69,32,110,97,109,101,61,37,81,32,65,78,68,32,116,121,112,101,61,39,105,110,100,101,120,39,0,0,0,0,0,0,0,0,85,80,68,65,84,69,32,37,81,46,37,115,32,83,69,84,32,114,111,111,116,112,97,103,101,61,37,100,32,87,72,69,82,69,32,35,37,100,32,65,78,68,32,114,\n111,111,116,112,97,103,101,61,35,37,100,0,115,113,108,105,116,101,95,115,116,97,116,37,100,0,0,0,48,0,0,0,0,0,0,0,118,97,114,105,97,98,108,101,32,110,117,109,98,101,114,32,109,117,115,116,32,98,101,32,98,101,116,119,101,101,110,32,63,49,32,97,110,100,32,63,37,100,0,0,0,0,0,0,116,111,111,32,109,97,110,121,32,83,81,76,32,118,97,114,105,97,98,108,101,115,0,0,116,97,98,108,101,32,37,83,32,104,97,115,32,110,111,32,99,111,108,117,109,110,32,110,97,109,101,100,32,37,115,0,116,97,98,108,101,32,37,83,32,104,\n97,115,32,37,100,32,99,111,108,117,109,110,115,32,98,117,116,32,37,100,32,118,97,108,117,101,115,32,119,101,114,101,32,115,117,112,112,108,105,101,100,0,0,0,0,0,37,100,32,118,97,108,117,101,115,32,102,111,114,32,37,100,32,99,111,108,117,109,110,115,0,0,0,0,0,0,0,0,114,111,119,115,32,105,110,115,101,114,116,101,100,0,0,0,97,116,32,109,111,115,116,32,37,100,32,116,97,98,108,101,115,32,105,110,32,97,32,106,111,105,110,0,0,0,0,0,65,63,62,64,0,0,0,0,0,0,108,105,65,62,64,63,116,114,113,115,0,0,0,0,9,8,\n0,0,0,0,0,0,108,105,0,0,0,0,0,0,83,69,65,82,67,72,0,0,83,67,65,78,0,0,0,0,32,83,85,66,81,85,69,82,89,32,37,100,0,0,0,0,32,84,65,66,76,69,32,37,115,0,0,0,0,0,0,0,32,65,83,32,37,115,0,0,80,82,73,77,65,82,89,32,75,69,89,0,0,0,0,0,65,85,84,79,77,65,84,73,67,32,67,79,86,69,82,73,78,71,32,73,78,68,69,88,0,0,0,0,0,0,0,0,67,79,86,69,82,73,78,71,32,73,78,68,69,88,32,37,115,0,0,0,0,0,0,0,73,78,68,69,88,32,37,115,0,0,0,0,0,0,0,0,32,85,83,73,78,71,32,0,40,114,111,119,105,100,61,63,41,0,0,0,0,0,0,0,40,114,111,\n119,105,100,62,63,32,65,78,68,32,114,111,119,105,100,60,63,41,0,0,0,40,114,111,119,105,100,62,63,41,0,0,0,0,0,0,0,40,114,111,119,105,100,60,63,41,0,0,0,0,0,0,0,32,85,83,73,78,71,32,73,78,84,69,71,69,82,32,80,82,73,77,65,82,89,32,75,69,89,32,0,0,0,0,0,32,86,73,82,84,85,65,76,32,84,65,66,76,69,32,73,78,68,69,88,32,37,100,58,37,115,0,0,0,0,0,0,32,40,0,0,0,0,0,0,61,0,0,0,0,0,0,0,32,65,78,68,32,0,0,0,65,78,89,40,37,115,41,0,62,0,0,0,0,0,0,0,60,0,0,0,0,0,0,0,41,0,0,0,0,0,0,0,97,117,116,111,109,97,116,105,\n99,32,105,110,100,101,120,32,111,110,32,37,115,40,37,115,41,0,0,0,0,0,0,0,97,117,116,111,45,105,110,100,101,120,0,0,0,0,0,0,110,111,32,113,117,101,114,121,32,115,111,108,117,116,105,111,110,0,0,0,0,0,0,0,10,10,9,9,8,8,7,7,7,6,6,6,5,5,5,4,4,4,4,3,3,3,3,3,3,2,2,2,2,2,2,2,37,115,46,120,66,101,115,116,73,110,100,101,120,40,41,32,109,97,108,102,117,110,99,116,105,111,110,0,0,0,0,0,116,97,98,108,101,32,37,115,58,32,120,66,101,115,116,73,110,100,101,120,32,114,101,116,117,114,110,101,100,32,97,110,32,105,\n110,118,97,108,105,100,32,112,108,97,110,0,0,0,83,81,0,0,0,0,0,0,45,45,32,84,82,73,71,71,69,82,32,37,115,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,2,0,1,0,1,1,4,36,1,4,5,16,0,2,2,2,2,0,2,2,0,0,32,0,0,4,5,4,4,0,0,1,1,5,5,0,0,0,2,2,16,0,0,0,0,0,0,0,0,0,17,17,17,17,8,17,17,17,17,76,76,2,2,0,5,5,21,21,21,21,21,21,0,76,76,76,76,76,76,76,76,76,76,0,36,2,0,0,0,0,0,2,0,1,1,1,1,8,8,0,2,1,1,1,1,2,0,0,2,2,0,0,0,0,0,0,12,69,21,1,2,2,0,1,8,5,5,5,0,1,0,0,0,0,0,0,0,1,0,2,2,1,0,0,0,0,0,0,16,16,2,16,0,0,0,0,0,1,2,3,4,6,8,8,0,\n0,0,0,0,0,0,0,16,67,0,0,3,0,0,0,8,67,0,0,3,0,0,0,111,105,100,0,0,0,0,0,70,79,82,69,73,71,78,32,75,69,89,32,99,111,110,115,116,114,97,105,110,116,32,102,97,105,108,101,100,0,0,0,37,115,46,114,111,119,105,100,0,0,0,0,0,0,0,0,116,97,98,108,101,32,37,115,32,109,97,121,32,110,111,116,32,98,101,32,109,111,100,105,102,105,101,100,0,0,0,0,99,97,110,110,111,116,32,109,111,100,105,102,121,32,37,115,32,98,101,99,97,117,115,101,32,105,116,32,105,115,32,97,32,118,105,101,119,0,0,0,110,111,32,115,117,99,104,32,\n99,111,108,117,109,110,58,32,37,115,0,0,0,0,0,0,114,111,119,115,32,117,112,100,97,116,101,100,0,0,0,0,95,114,111,119,105,100,95,0,116,111,111,32,109,97,110,121,32,99,111,108,117,109,110,115,32,105,110,32,37,115,0,0,114,111,119,115,32,100,101,108,101,116,101,100,0,0,0,0,110,97,116,117,114,97,108,101,102,116,111,117,116,101,114,105,103,104,116,102,117,108,108,105,110,110,101,114,99,114,111,115,115,0,0,0,0,0,0,0,0,7,4,6,4,40,10,5,32,14,5,48,19,4,56,23,5,1,28,5,3,0,0,0,117,110,107,110,111,119,110,32,\n111,114,32,117,110,115,117,112,112,111,114,116,101,100,32,106,111,105,110,32,116,121,112,101,58,32,37,84,32,37,84,37,115,37,84,0,0,0,0,0,82,73,71,72,84,32,97,110,100,32,70,85,76,76,32,79,85,84,69,82,32,74,79,73,78,115,32,97,114,101,32,110,111,116,32,99,117,114,114,101,110,116,108,121,32,115,117,112,112,111,114,116,101,100,0,0,97,32,74,79,73,78,32,99,108,97,117,115,101,32,105,115,32,114,101,113,117,105,114,101,100,32,98,101,102,111,114,101,32,37,115,0,0,0,0,0,79,78,0,0,0,0,0,0,85,83,73,78,71,0,0,0,\n68,73,83,84,73,78,67,84,0,0,0,0,0,0,0,0,71,82,79,85,80,32,66,89,0,0,0,0,0,0,0,0,82,73,71,72,84,32,80,65,82,84,32,79,70,32,79,82,68,69,82,32,66,89,0,0,79,82,68,69,82,32,66,89,0,0,0,0,0,0,0,0,99,111,108,117,109,110,37,100,0,0,0,0,0,0,0,0,83,67,65,78,32,84,65,66,76,69,32,37,115,37,115,37,115,0,0,0,0,0,0,0,32,85,83,73,78,71,32,67,79,86,69,82,73,78,71,32,73,78,68,69,88,32,0,0,68,73,83,84,73,78,67,84,32,97,103,103,114,101,103,97,116,101,115,32,109,117,115,116,32,104,97,118,101,32,101,120,97,99,116,108,\n121,32,111,110,101,32,97,114,103,117,109,101,110,116,0,0,0,0,0,0,85,83,69,32,84,69,77,80,32,66,45,84,82,69,69,32,70,79,82,32,37,115,0,0,79,82,68,69,82,32,66,89,32,99,108,97,117,115,101,32,115,104,111,117,108,100,32,99,111,109,101,32,97,102,116,101,114,32,37,115,32,110,111,116,32,98,101,102,111,114,101,0,76,73,77,73,84,32,99,108,97,117,115,101,32,115,104,111,117,108,100,32,99,111,109,101,32,97,102,116,101,114,32,37,115,32,110,111,116,32,98,101,102,111,114,101,0,0,0,0,97,108,108,32,86,65,76,85,69,83,\n32,109,117,115,116,32,104,97,118,101,32,116,104,101,32,115,97,109,101,32,110,117,109,98,101,114,32,111,102,32,116,101,114,109,115,0,0,0,83,69,76,69,67,84,115,32,116,111,32,116,104,101,32,108,101,102,116,32,97,110,100,32,114,105,103,104,116,32,111,102,32,37,115,32,100,111,32,110,111,116,32,104,97,118,101,32,116,104,101,32,115,97,109,101,32,110,117,109,98,101,114,32,111,102,32,114,101,115,117,108,116,32,99,111,108,117,109,110,115,0,0,0,0,0,0,0,67,79,77,80,79,85,78,68,32,83,85,66,81,85,69,82,73,69,83,\n32,37,100,32,65,78,68,32,37,100,32,37,115,40,37,115,41,0,0,0,0,85,83,73,78,71,32,84,69,77,80,32,66,45,84,82,69,69,32,0,0,0,0,0,0,85,78,73,79,78,32,65,76,76,0,0,0,0,0,0,0,73,78,84,69,82,83,69,67,84,0,0,0,0,0,0,0,69,88,67,69,80,84,0,0,85,78,73,79,78,0,0,0,111,110,108,121,32,97,32,115,105,110,103,108,101,32,114,101,115,117,108,116,32,97,108,108,111,119,101,100,32,102,111,114,32,97,32,83,69,76,69,67,84,32,116,104,97,116,32,105,115,32,112,97,114,116,32,111,102,32,97,110,32,101,120,112,114,101,115,115,\n105,111,110,0,112,97,114,97,109,101,116,101,114,115,32,97,114,101,32,110,111,116,32,97,108,108,111,119,101,100,32,105,110,32,118,105,101,119,115,0,0,0,0,0,118,105,101,119,0,0,0,0,115,113,108,105,116,101,95,115,116,97,116,0,0,0,0,0,116,97,98,108,101,32,37,115,32,109,97,121,32,110,111,116,32,98,101,32,100,114,111,112,112,101,100,0,0,0,0,0,117,115,101,32,68,82,79,80,32,84,65,66,76,69,32,116,111,32,100,101,108,101,116,101,32,116,97,98,108,101,32,37,115,0,0,0,0,0,0,0,117,115,101,32,68,82,79,80,32,86,73,\n69,87,32,116,111,32,100,101,108,101,116,101,32,118,105,101,119,32,37,115,0,68,69,76,69,84,69,32,70,82,79,77,32,37,81,46,115,113,108,105,116,101,95,115,101,113,117,101,110,99,101,32,87,72,69,82,69,32,110,97,109,101,61,37,81,0,0,0,0,68,69,76,69,84,69,32,70,82,79,77,32,37,81,46,37,115,32,87,72,69,82,69,32,116,98,108,95,110,97,109,101,61,37,81,32,97,110,100,32,116,121,112,101,33,61,39,116,114,105,103,103,101,114,39,0,102,111,114,101,105,103,110,32,107,101,121,32,111,110,32,37,115,32,115,104,111,117,108,\n100,32,114,101,102,101,114,101,110,99,101,32,111,110,108,121,32,111,110,101,32,99,111,108,117,109,110,32,111,102,32,116,97,98,108,101,32,37,84,0,0,110,117,109,98,101,114,32,111,102,32,99,111,108,117,109,110,115,32,105,110,32,102,111,114,101,105,103,110,32,107,101,121,32,100,111,101,115,32,110,111,116,32,109,97,116,99,104,32,116,104,101,32,110,117,109,98,101,114,32,111,102,32,99,111,108,117,109,110,115,32,105,110,32,116,104,101,32,114,101,102,101,114,101,110,99,101,100,32,116,97,98,108,101,0,0,0,117,\n110,107,110,111,119,110,32,99,111,108,117,109,110,32,34,37,115,34,32,105,110,32,102,111,114,101,105,103,110,32,107,101,121,32,100,101,102,105,110,105,116,105,111,110,0,0,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,97,32,84,69,77,80,32,105,110,100,101,120,32,111,110,32,110,111,110,45,84,69,77,80,32,116,97,98,108,101,32,34,37,115,34,0,0,0,0,0,0,0,97,108,116,101,114,116,97,98,95,0,0,0,0,0,0,0,116,97,98,108,101,32,37,115,32,109,97,121,32,110,111,116,32,98,101,32,105,110,100,101,120,101,100,0,\n0,0,0,0,118,105,101,119,115,32,109,97,121,32,110,111,116,32,98,101,32,105,110,100,101,120,101,100,0,0,0,0,0,0,0,0,118,105,114,116,117,97,108,32,116,97,98,108,101,115,32,109,97,121,32,110,111,116,32,98,101,32,105,110,100,101,120,101,100,0,0,0,0,0,0,0,116,104,101,114,101,32,105,115,32,97,108,114,101,97,100,121,32,97,32,116,97,98,108,101,32,110,97,109,101,100,32,37,115,0,0,0,0,0,0,0,105,110,100,101,120,32,37,115,32,97,108,114,101,97,100,121,32,101,120,105,115,116,115,0,115,113,108,105,116,101,95,97,\n117,116,111,105,110,100,101,120,95,37,115,95,37,100,0,0,116,97,98,108,101,32,37,115,32,104,97,115,32,110,111,32,99,111,108,117,109,110,32,110,97,109,101,100,32,37,115,0,99,111,110,102,108,105,99,116,105,110,103,32,79,78,32,67,79,78,70,76,73,67,84,32,99,108,97,117,115,101,115,32,115,112,101,99,105,102,105,101,100,0,0,0,0,0,0,0,67,82,69,65,84,69,37,115,32,73,78,68,69,88,32,37,46,42,115,0,0,0,0,0,32,85,78,73,81,85,69,0,73,78,83,69,82,84,32,73,78,84,79,32,37,81,46,37,115,32,86,65,76,85,69,83,40,39,105,\n110,100,101,120,39,44,37,81,44,37,81,44,35,37,100,44,37,81,41,59,0,110,97,109,101,61,39,37,113,39,32,65,78,68,32,116,121,112,101,61,39,105,110,100,101,120,39,0,0,0,0,0,0,116,97,98,108,101,32,34,37,115,34,32,104,97,115,32,109,111,114,101,32,116,104,97,110,32,111,110,101,32,112,114,105,109,97,114,121,32,107,101,121,0,0,0,0,0,0,0,0,65,85,84,79,73,78,67,82,69,77,69,78,84,32,105,115,32,111,110,108,121,32,97,108,108,111,119,101,100,32,111,110,32,97,110,32,73,78,84,69,71,69,82,32,80,82,73,77,65,82,89,32,\n75,69,89,0,100,101,102,97,117,108,116,32,118,97,108,117,101,32,111,102,32,99,111,108,117,109,110,32,91,37,115,93,32,105,115,32,110,111,116,32,99,111,110,115,116,97,110,116,0,0,0,0,116,111,111,32,109,97,110,121,32,99,111,108,117,109,110,115,32,111,110,32,37,115,0,0,100,117,112,108,105,99,97,116,101,32,99,111,108,117,109,110,32,110,97,109,101,58,32,37,115,0,0,0,0,0,0,0,65,85,84,79,73,78,67,82,69,77,69,78,84,32,110,111,116,32,97,108,108,111,119,101,100,32,111,110,32,87,73,84,72,79,85,84,32,82,79,87,\n73,68,32,116,97,98,108,101,115,0,0,0,0,0,0,0,80,82,73,77,65,82,89,32,75,69,89,32,109,105,115,115,105,110,103,32,111,110,32,116,97,98,108,101,32,37,115,0,84,65,66,76,69,0,0,0,86,73,69,87,0,0,0,0,67,82,69,65,84,69,32,37,115,32,37,46,42,115,0,0,85,80,68,65,84,69,32,37,81,46,37,115,32,83,69,84,32,116,121,112,101,61,39,37,115,39,44,32,110,97,109,101,61,37,81,44,32,116,98,108,95,110,97,109,101,61,37,81,44,32,114,111,111,116,112,97,103,101,61,35,37,100,44,32,115,113,108,61,37,81,32,87,72,69,82,69,32,114,\n111,119,105,100,61,35,37,100,0,0,67,82,69,65,84,69,32,84,65,66,76,69,32,37,81,46,115,113,108,105,116,101,95,115,101,113,117,101,110,99,101,40,110,97,109,101,44,115,101,113,41,0,0,0,0,0,0,0,116,98,108,95,110,97,109,101,61,39,37,113,39,32,65,78,68,32,116,121,112,101,33,61,39,116,114,105,103,103,101,114,39,0,0,0,0,0,0,0,10,32,32,0,0,0,0,0,44,10,32,32,0,0,0,0,10,41,0,0,0,0,0,0,67,82,69,65,84,69,32,84,65,66,76,69,32,0,0,0,192,4,0,0,88,105,0,0,96,105,0,0,104,105,0,0,112,105,0,0,0,0,0,0,32,84,69,88,84,0,\n0,0,32,78,85,77,0,0,0,0,32,73,78,84,0,0,0,0,32,82,69,65,76,0,0,0,116,101,109,112,111,114,97,114,121,32,116,97,98,108,101,32,110,97,109,101,32,109,117,115,116,32,98,101,32,117,110,113,117,97,108,105,102,105,101,100,0,0,0,0,0,0,0,0,116,97,98,108,101,32,37,84,32,97,108,114,101,97,100,121,32,101,120,105,115,116,115,0,116,104,101,114,101,32,105,115,32,97,108,114,101,97,100,121,32,97,110,32,105,110,100,101,120,32,110,97,109,101,100,32,37,115,0,0,0,0,0,0,248,105,0,0,0,106,0,0,8,106,0,0,0,0,0,0,66,69,71,\n73,78,0,0,0,82,69,76,69,65,83,69,0,82,79,76,76,66,65,67,75,0,0,0,0,0,0,0,0,67,79,77,77,73,84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,112,97,114,115,101,114,32,115,116,97,99,107,32,111,118,101,114,102,108,111,119,0,0,0,224,3,33,4,75,5,132,4,180,4,180,4,1,0,6,1,237,255,135,0,135,0,8,3,180,4,180,4,180,4,180,4,69,0,69,0,53,0,208,0,27,1,243,2,58,0,213,2,136,2,59,2,238,1,161,1,84,1,7,1,212,0,59,3,59,3,59,3,59,3,59,3,59,3,59,3,59,3,59,3,59,3,59,3,59,3,59,3,59,3,59,3,110,3,59,3,161,3,212,3,212,3,46,4,180,4,180,\n4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,234,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,180,4,185,255,209,255,209,255,209,255,209,255,209,255,0,0,29,0,244,255,27,1,27,1,139,0,91,0,136,1,136,1,126,3,160,2,214,2,103,5,170,255,170,255,170,255,88,0,62,1,62,1,99,0,125,1,236,255,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,\n27,1,27,1,27,1,27,1,27,1,27,1,112,2,108,3,214,2,160,2,60,5,60,5,60,5,60,5,60,5,60,5,170,255,170,255,170,255,49,1,136,0,136,0,142,0,167,0,226,0,154,0,137,0,152,0,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,80,1,80,1,80,1,27,1,27,1,96,1,27,1,27,1,27,1,27,1,27,1,228,0,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,27,1,245,1,57,2,84,2,84,2,84,2,251,1,241,1,185,1,135,1,97,1,156,0,156,0,89,3,97,1,89,3,223,2,45,3,127,2,203,2,156,0,76,1,203,2,203,2,240,1,163,1,134,\n2,77,5,160,4,160,4,55,5,55,5,160,4,61,5,236,4,120,4,66,5,66,5,66,5,66,5,160,4,26,5,120,4,61,5,236,4,236,4,120,4,160,4,26,5,182,4,4,5,160,4,160,4,26,5,160,4,26,5,160,4,26,5,238,4,183,4,183,4,183,4,250,4,238,4,183,4,193,4,183,4,250,4,183,4,183,4,161,4,176,4,161,4,176,4,161,4,176,4,160,4,160,4,137,4,238,4,178,4,178,4,238,4,130,4,131,4,123,4,128,4,120,4,217,4,215,4,226,4,226,4,230,4,230,4,230,4,230,4,170,255,170,255,170,255,170,255,170,255,170,255,44,4,48,1,14,2,249,0,152,1,173,255,178,1,44,3,27,0,43,\n3,39,3,34,3,239,2,77,2,139,2,163,0,131,0,162,2,110,1,194,1,43,1,148,0,23,0,102,0,229,0,235,255,221,4,220,4,198,4,75,4,204,4,148,4,199,4,191,4,189,4,91,4,82,4,99,4,86,4,185,4,81,4,188,4,202,4,74,4,65,4,116,4,115,4,80,4,165,4,154,4,70,4,187,4,181,4,163,4,77,4,47,4,129,4,151,4,122,4,114,4,127,4,67,4,140,4,141,4,139,4,45,4,48,4,124,4,88,4,110,4,103,4,105,4,102,4,68,4,90,4,94,4,64,4,66,4,69,4,63,4,60,4,219,3,55,4,53,4,50,4,41,4,156,3,253,3,246,3,236,3,238,3,51,3,227,2,128,3,87,3,36,3,227,2,228,2,224,2,\n178,2,142,2,153,2,106,2,70,2,56,2,16,2,42,2,123,1,20,2,223,1,199,1,123,1,176,1,115,1,85,1,28,0,82,1,116,0,245,255,199,255,171,255,7,0,248,255,3,0,0,0,0,0,135,2,196,3,196,3,196,3,110,3,110,3,201,3,196,3,6,3,34,3,34,3,170,3,201,3,201,3,201,3,108,3,201,3,201,3,201,3,196,3,201,3,10,3,40,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,169,3,171,3,48,3,47,3,150,3,21,3,45,3,38,3,42,3,111,3,104,3,105,3,103,3,107,3,112,3,201,3,41,3,73,3,88,3,72,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,\n3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,82,3,87,3,94,3,86,3,83,3,75,3,74,3,76,3,77,3,201,3,201,3,161,2,227,2,201,3,201,3,78,3,201,3,173,2,79,3,91,3,90,3,89,3,168,2,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,135,2,196,3,201,\n3,201,3,196,3,196,3,196,3,196,3,196,3,196,3,188,3,10,3,0,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,176,3,174,3,201,3,123,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,141,2,201,3,143,3,6,3,6,3,6,3,8,3,242,2,254,2,143,2,44,3,23,3,23,3,155,3,44,3,155,3,198,2,221,2,195,2,34,3,23,3,106,3,34,3,34,3,7,3,254,2,201,3,181,3,14,3,14,3,\n173,3,173,3,14,3,53,3,231,2,44,3,238,2,238,2,238,2,238,2,14,3,158,2,44,3,53,3,231,2,231,2,44,3,14,3,158,2,149,3,147,3,14,3,14,3,158,2,14,3,158,2,14,3,158,2,116,3,229,2,229,2,229,2,213,2,116,3,229,2,198,2,229,2,213,2,229,2,229,2,27,3,22,3,27,3,22,3,27,3,22,3,14,3,14,3,201,3,116,3,120,3,120,3,116,3,39,3,28,3,37,3,35,3,44,3,164,2,216,2,151,2,151,2,140,2,140,2,140,2,140,2,193,3,193,3,188,3,200,2,200,2,183,2,201,3,201,3,201,3,201,3,201,3,201,3,175,2,201,3,125,3,201,3,201,3,201,3,201,3,201,3,201,3,201,\n3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,60,3,201,3,136,2,183,3,201,3,201,3,180,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,153,3,201,3,201,3,201,3,201,3,201,3,201,3,146,3,145,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,245,2,201,3,201,3,201,3,249,2,201,3,201,3,201,3,201,3,201,3,201,3,36,3,201,3,29,3,201,3,109,3,201,3,201,3,201,\n3,201,3,201,3,201,3,201,3,201,3,201,3,201,3,198,3,201,3,201,3,201,3,197,3,201,3,201,3,201,3,201,3,201,3,62,3,201,3,61,3,65,3,201,3,149,2,201,3,132,2,137,2,192,3,195,3,194,3,191,3,190,3,189,3,184,3,182,3,179,3,178,3,177,3,175,3,172,3,168,3,129,3,127,3,134,3,133,3,132,3,131,3,130,3,128,3,126,3,124,3,50,3,49,3,46,3,43,3,241,2,167,3,122,3,240,2,237,2,236,2,157,2,185,3,152,3,161,3,160,3,159,3,54,3,158,3,157,3,156,3,154,3,151,3,138,3,52,3,51,3,232,2,114,3,113,3,160,2,142,3,141,3,140,3,144,3,148,3,139,3,\n16,3,239,2,159,2,156,2,163,2,167,2,219,2,220,2,228,2,226,2,225,2,224,2,223,2,222,2,218,2,169,2,174,2,212,2,197,2,196,2,205,2,204,2,210,2,209,2,208,2,207,2,206,2,203,2,202,2,201,2,194,2,193,2,199,2,192,2,215,2,214,2,211,2,191,2,235,2,234,2,233,2,230,2,190,2,189,2,188,2,65,3,187,2,186,2,70,3,69,3,98,3,58,3,243,2,247,2,246,2,250,2,251,2,3,3,2,3,1,3,12,3,13,3,25,3,24,3,56,3,55,3,26,3,11,3,5,3,4,3,20,3,19,3,18,3,17,3,9,3,255,2,31,3,30,3,100,3,15,3,99,3,97,3,166,3,165,3,164,3,163,3,162,3,102,3,199,3,200,\n3,119,3,121,3,118,3,33,3,32,3,117,3,101,3,71,3,68,3,178,2,179,2,137,3,136,3,135,3,181,2,180,2,177,2,176,2,95,3,92,3,84,3,96,3,93,3,85,3,81,3,80,3,66,3,64,3,63,3,59,3,67,3,248,2,244,2,57,3,253,2,252,2,185,2,184,2,182,2,166,2,165,2,162,2,155,2,153,2,152,2,154,2,150,2,148,2,147,2,146,2,145,2,144,2,172,2,171,2,170,2,142,2,139,2,138,2,134,2,133,2,131,2,0,0,0,0,19,22,22,23,1,24,26,15,27,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,108,109,110,27,28,23,50,51,80,81,82,83,122,85,86,87,88,89,90,91,92,93,\n94,95,22,70,23,71,72,73,74,75,76,77,78,79,80,81,82,83,122,85,86,87,88,89,90,91,92,93,94,95,19,97,91,92,93,94,95,26,85,86,87,88,89,90,91,92,93,94,95,27,28,97,98,99,122,211,102,103,104,79,19,50,51,19,122,59,55,113,224,225,226,89,90,91,92,93,94,95,23,27,28,26,71,72,73,74,75,76,77,78,79,80,81,82,83,51,85,86,87,88,89,90,91,92,93,94,95,19,132,133,58,89,90,21,108,109,110,27,28,97,98,33,100,7,8,119,120,22,19,107,42,109,27,28,27,28,95,28,50,51,99,100,101,102,103,104,105,27,28,97,98,107,152,112,132,133,112,\n65,69,71,72,73,74,75,76,77,78,79,80,81,82,83,11,85,86,87,88,89,90,91,92,93,94,95,19,101,97,97,98,24,101,122,157,12,99,103,112,102,103,104,152,22,97,98,97,98,27,28,113,27,29,91,164,165,124,50,51,97,98,219,59,132,133,134,22,23,45,66,47,212,213,124,140,132,133,19,71,72,73,74,75,76,77,78,79,80,81,82,83,152,85,86,87,88,89,90,91,92,93,94,95,164,165,27,28,230,50,51,233,108,109,110,70,16,59,23,97,98,26,97,22,66,185,12,187,27,28,71,72,73,74,75,76,77,78,79,80,81,82,83,29,85,86,87,88,89,90,91,92,93,94,95,19,\n22,148,149,45,23,47,62,154,64,156,108,109,110,37,69,23,163,59,26,26,97,98,144,145,146,147,152,200,52,23,50,51,26,22,89,90,60,210,7,8,9,138,97,22,23,26,101,26,174,175,197,71,72,73,74,75,76,77,78,79,80,81,82,83,16,85,86,87,88,89,90,91,92,93,94,95,19,132,133,134,23,152,208,209,140,152,152,111,195,196,98,70,163,160,152,23,22,164,165,246,207,27,152,174,175,171,172,50,51,137,62,139,64,171,172,222,124,27,138,24,163,89,90,130,174,175,197,163,71,72,73,74,75,76,77,78,79,80,81,82,83,22,85,86,87,88,89,90,91,\n92,93,94,95,19,197,181,182,23,208,209,152,197,26,189,132,133,232,224,225,226,152,97,91,26,232,116,212,213,152,222,121,152,174,175,50,51,243,97,22,23,22,234,174,175,177,23,239,116,163,177,174,175,121,174,175,71,72,73,74,75,76,77,78,79,80,81,82,83,24,85,86,87,88,89,90,91,92,93,94,95,19,23,197,11,23,227,70,208,220,152,31,224,225,226,35,98,224,225,226,108,109,110,115,152,117,118,27,222,49,123,24,50,51,27,0,1,2,224,225,226,166,124,168,169,239,174,175,170,171,172,22,194,71,72,73,74,75,76,77,78,79,80,81,\n82,83,152,85,86,87,88,89,90,91,92,93,94,95,19,22,208,24,23,195,196,170,171,172,174,175,152,26,152,152,152,207,152,97,152,23,152,51,244,152,97,152,247,248,23,50,51,26,174,175,174,175,174,175,174,175,174,175,174,175,23,174,175,174,175,188,71,72,73,74,75,76,77,78,79,80,81,82,83,152,85,86,87,88,89,90,91,92,93,94,95,19,152,107,152,33,24,152,100,101,27,174,175,152,42,152,23,152,26,152,23,152,26,152,174,175,174,175,152,174,175,23,50,51,26,174,175,174,175,174,175,174,175,174,175,174,175,163,119,120,174,175,\n19,71,72,73,74,75,76,77,78,79,80,81,82,83,152,85,86,87,88,89,90,91,92,93,94,95,66,152,97,197,23,50,51,26,53,23,174,175,26,23,23,23,26,26,26,36,106,146,147,174,175,19,71,72,73,74,75,76,77,78,79,80,81,82,83,152,85,86,87,88,89,90,91,92,93,94,95,152,196,119,120,19,50,51,168,169,26,174,175,207,28,152,249,250,152,163,163,163,163,174,175,163,19,71,72,73,74,75,76,77,78,79,80,81,82,83,152,85,86,87,88,89,90,91,92,93,94,95,152,197,197,197,197,50,51,197,194,36,174,175,191,192,152,191,192,163,152,66,124,152,174,\n175,152,19,71,72,73,74,75,76,77,78,79,80,81,82,83,152,85,86,87,88,89,90,91,92,93,94,95,197,152,100,188,152,50,51,152,152,188,174,175,252,152,94,95,152,152,152,1,2,152,152,174,175,19,152,72,73,74,75,76,77,78,79,80,81,82,83,152,85,86,87,88,89,90,91,92,93,94,95,152,188,188,22,194,50,51,240,173,194,174,175,252,194,152,36,181,28,152,23,219,122,174,175,219,221,152,152,73,74,75,76,77,78,79,80,81,82,83,152,85,86,87,88,89,90,91,92,93,94,95,19,20,152,22,23,194,152,240,27,28,174,175,240,19,20,26,22,194,194,\n38,22,27,28,152,23,22,152,116,174,175,152,23,38,152,23,152,221,152,57,152,23,163,50,51,194,174,175,66,174,175,69,57,174,175,40,174,175,174,175,174,175,174,175,69,22,53,74,75,30,53,89,90,22,22,152,197,23,96,97,98,22,152,101,89,90,91,208,209,152,53,96,97,98,101,22,101,174,175,152,19,20,105,22,174,175,112,19,27,28,20,174,175,24,132,133,134,135,136,38,44,174,175,107,61,54,26,132,133,134,135,136,54,107,22,5,140,1,57,36,111,122,28,79,79,131,123,66,19,20,69,22,1,16,20,125,27,28,123,111,120,23,131,23,16,\n68,142,38,15,22,89,90,3,167,4,248,251,96,97,98,180,180,101,251,151,6,57,151,13,151,26,25,151,161,202,153,162,153,69,130,128,203,19,20,127,22,126,204,129,22,27,28,205,132,133,134,135,136,89,90,231,38,95,137,179,96,97,98,206,179,101,122,107,159,159,125,231,216,228,107,57,184,217,216,176,217,176,48,106,18,184,158,69,159,158,46,71,237,176,176,176,132,133,134,135,136,217,176,137,216,178,158,89,90,179,176,159,179,159,96,97,98,159,159,101,5,158,202,22,18,10,11,12,13],\"i8\",Ha,w.Ab+20481);\nH([14,190,238,17,190,158,193,41,159,202,193,159,202,245,193,193,223,190,32,159,34,132,133,134,135,136,159,39,155,43,150,223,177,201,178,177,186,66,199,177,152,253,56,215,152,182,152,202,152,63,152,152,66,67,242,229,152,174,152,152,152,152,152,152,152,199,242,202,152,198,152,152,152,183,192,152,215,152,183,215,183,152,241,214,152,211,152,152,211,211,152,152,241,152,152,152,152,152,152,152,114,152,152,235,152,152,152,174,187,95,174,253,253,253,253,236,253,253,253,253,253,253,253,253,253,253,253,141,\n0,0,0,0,0,0,0,0,0,27,27,27,27,0,27,27,27,0,27,27,27,27,0,0,0,27,0,0,27,0,0,0,27,0,0,0,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,0,0,100,97,116,97,98,97,115,101,32,115,99,104,101,109,97,32,105,115,32,108,111,99,107,101,100,58,32,37,115,0,0,0,115,116,97,116,101,109,101,110,116,32,116,111,111,32,108,111,110,103,0,0,0,0,0,0,64,121,0,0,72,121,0,0,80,121,0,0,88,121,0,0,96,121,0,0,104,121,0,0,112,121,0,0,120,121,0,0,128,121,\n0,0,144,121,0,0,216,83,0,0,152,121,0,0,97,100,100,114,0,0,0,0,111,112,99,111,100,101,0,0,112,49,0,0,0,0,0,0,112,50,0,0,0,0,0,0,112,51,0,0,0,0,0,0,112,52,0,0,0,0,0,0,112,53,0,0,0,0,0,0,99,111,109,109,101,110,116,0,115,101,108,101,99,116,105,100,0,0,0,0,0,0,0,0,111,114,100,101,114,0,0,0,100,101,116,97,105,108,0,0,117,110,111,112,101,110,101,100,0,0,0,0,0,0,0,0,110,111,32,115,117,99,104,32,118,105,101,119,0,0,0,0,110,111,32,115,117,99,104,32,116,97,98,108,101,0,0,0,98,105,110,100,32,111,110,32,97,32,\n98,117,115,121,32,112,114,101,112,97,114,101,100,32,115,116,97,116,101,109,101,110,116,58,32,91,37,115,93,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,122,0,0,64,122,0,0,72,122,0,0,80,122,0,0,78,79,84,32,78,85,76,76,0,0,0,0,0,0,0,0,85,78,73,81,85,69,0,0,67,72,69,67,75,0,0,0,70,79,82,69,73,71,78,32,75,69,89,0,0,0,0,0,97,98,111,114,116,32,97,116,32,37,100,32,105,110,32,91,37,115,93,58,32,37,115,0,37,115,32,99,111,110,115,116,114,97,105,110,116,32,102,97,105,108,\n101,100,58,32,37,115,0,0,0,0,0,0,0,0,37,115,32,99,111,110,115,116,114,97,105,110,116,32,102,97,105,108,101,100,0,0,0,0,0,0,0,0,1,2,0,2,2,0,0,0,0,0,0,0,0,1,2,1,1,1,2,1,2,0,0,0,0,0,0,0,99,97,110,110,111,116,32,111,112,101,110,32,115,97,118,101,112,111,105,110,116,32,45,32,83,81,76,32,115,116,97,116,101,109,101,110,116,115,32,105,110,32,112,114,111,103,114,101,115,115,0,0,0,0,0,0,110,111,32,115,117,99,104,32,115,97,118,101,112,111,105,110,116,58,32,37,115,0,0,0,99,97,110,110,111,116,32,114,101,108,101,\n97,115,101,32,115,97,118,101,112,111,105,110,116,32,45,32,83,81,76,32,115,116,97,116,101,109,101,110,116,115,32,105,110,32,112,114,111,103,114,101,115,115,0,0,0,99,97,110,110,111,116,32,99,111,109,109,105,116,32,116,114,97,110,115,97,99,116,105,111,110,32,45,32,83,81,76,32,115,116,97,116,101,109,101,110,116,115,32,105,110,32,112,114,111,103,114,101,115,115,0,0,99,97,110,110,111,116,32,115,116,97,114,116,32,97,32,116,114,97,110,115,97,99,116,105,111,110,32,119,105,116,104,105,110,32,97,32,116,114,\n97,110,115,97,99,116,105,111,110,0,99,97,110,110,111,116,32,114,111,108,108,98,97,99,107,32,45,32,110,111,32,116,114,97,110,115,97,99,116,105,111,110,32,105,115,32,97,99,116,105,118,101,0,0,0,0,0,0,99,97,110,110,111,116,32,99,111,109,109,105,116,32,45,32,110,111,32,116,114,97,110,115,97,99,116,105,111,110,32,105,115,32,97,99,116,105,118,101,0,0,0,0,0,0,0,0,83,69,76,69,67,84,32,110,97,109,101,44,32,114,111,111,116,112,97,103,101,44,32,115,113,108,32,70,82,79,77,32,39,37,113,39,46,37,115,32,87,72,69,\n82,69,32,37,115,32,79,82,68,69,82,32,66,89,32,114,111,119,105,100,0,116,111,111,32,109,97,110,121,32,108,101,118,101,108,115,32,111,102,32,116,114,105,103,103,101,114,32,114,101,99,117,114,115,105,111,110,0,0,0,0,99,97,110,110,111,116,32,99,104,97,110,103,101,32,37,115,32,119,97,108,32,109,111,100,101,32,102,114,111,109,32,119,105,116,104,105,110,32,97,32,116,114,97,110,115,97,99,116,105,111,110,0,0,0,0,0,105,110,116,111,0,0,0,0,111,117,116,32,111,102,0,0,100,97,116,97,98,97,115,101,32,116,97,98,\n108,101,32,105,115,32,108,111,99,107,101,100,58,32,37,115,0,0,0,0,115,116,97,116,101,109,101,110,116,32,97,98,111,114,116,115,32,97,116,32,37,100,58,32,91,37,115,93,32,37,115,0,45,45,32,0,0,0,0,0,39,37,46,42,113,39,0,0,122,101,114,111,98,108,111,98,40,37,100,41,0,0,0,0,120,39,0,0,0,0,0,0,37,48,50,120,0,0,0,0,39,0,0,0,0,0,0,0,99,97,110,110,111,116,32,86,65,67,85,85,77,32,102,114,111,109,32,119,105,116,104,105,110,32,97,32,116,114,97,110,115,97,99,116,105,111,110,0,99,97,110,110,111,116,32,86,65,67,\n85,85,77,32,45,32,83,81,76,32,115,116,97,116,101,109,101,110,116,115,32,105,110,32,112,114,111,103,114,101,115,115,0,0,0,0,0,0,65,84,84,65,67,72,32,39,58,109,101,109,111,114,121,58,39,32,65,83,32,118,97,99,117,117,109,95,100,98,59,0,65,84,84,65,67,72,32,39,39,32,65,83,32,118,97,99,117,117,109,95,100,98,59,0,80,82,65,71,77,65,32,118,97,99,117,117,109,95,100,98,46,115,121,110,99,104,114,111,110,111,117,115,61,79,70,70,0,0,0,0,0,0,0,0,66,69,71,73,78,59,0,0,83,69,76,69,67,84,32,39,67,82,69,65,84,69,32,\n84,65,66,76,69,32,118,97,99,117,117,109,95,100,98,46,39,32,124,124,32,115,117,98,115,116,114,40,115,113,108,44,49,52,41,32,32,32,70,82,79,77,32,115,113,108,105,116,101,95,109,97,115,116,101,114,32,87,72,69,82,69,32,116,121,112,101,61,39,116,97,98,108,101,39,32,65,78,68,32,110,97,109,101,33,61,39,115,113,108,105,116,101,95,115,101,113,117,101,110,99,101,39,32,32,32,65,78,68,32,99,111,97,108,101,115,99,101,40,114,111,111,116,112,97,103,101,44,49,41,62,48,0,0,0,0,0,83,69,76,69,67,84,32,39,67,82,69,65,\n84,69,32,73,78,68,69,88,32,118,97,99,117,117,109,95,100,98,46,39,32,124,124,32,115,117,98,115,116,114,40,115,113,108,44,49,52,41,32,32,70,82,79,77,32,115,113,108,105,116,101,95,109,97,115,116,101,114,32,87,72,69,82,69,32,115,113,108,32,76,73,75,69,32,39,67,82,69,65,84,69,32,73,78,68,69,88,32,37,39,32,0,83,69,76,69,67,84,32,39,67,82,69,65,84,69,32,85,78,73,81,85,69,32,73,78,68,69,88,32,118,97,99,117,117,109,95,100,98,46,39,32,124,124,32,115,117,98,115,116,114,40,115,113,108,44,50,49,41,32,32,32,70,\n82,79,77,32,115,113,108,105,116,101,95,109,97,115,116,101,114,32,87,72,69,82,69,32,115,113,108,32,76,73,75,69,32,39,67,82,69,65,84,69,32,85,78,73,81,85,69,32,73,78,68,69,88,32,37,39,0,0,0,83,69,76,69,67,84,32,39,73,78,83,69,82,84,32,73,78,84,79,32,118,97,99,117,117,109,95,100,98,46,39,32,124,124,32,113,117,111,116,101,40,110,97,109,101,41,32,124,124,32,39,32,83,69,76,69,67,84,32,42,32,70,82,79,77,32,109,97,105,110,46,39,32,124,124,32,113,117,111,116,101,40,110,97,109,101,41,32,124,124,32,39,59,39,\n70,82,79,77,32,109,97,105,110,46,115,113,108,105,116,101,95,109,97,115,116,101,114,32,87,72,69,82,69,32,116,121,112,101,32,61,32,39,116,97,98,108,101,39,32,65,78,68,32,110,97,109,101,33,61,39,115,113,108,105,116,101,95,115,101,113,117,101,110,99,101,39,32,32,32,65,78,68,32,99,111,97,108,101,115,99,101,40,114,111,111,116,112,97,103,101,44,49,41,62,48,0,0,0,0,0,83,69,76,69,67,84,32,39,68,69,76,69,84,69,32,70,82,79,77,32,118,97,99,117,117,109,95,100,98,46,39,32,124,124,32,113,117,111,116,101,40,110,\n97,109,101,41,32,124,124,32,39,59,39,32,70,82,79,77,32,118,97,99,117,117,109,95,100,98,46,115,113,108,105,116,101,95,109,97,115,116,101,114,32,87,72,69,82,69,32,110,97,109,101,61,39,115,113,108,105,116,101,95,115,101,113,117,101,110,99,101,39,32,0,0,0,0,0,0,0,0,83,69,76,69,67,84,32,39,73,78,83,69,82,84,32,73,78,84,79,32,118,97,99,117,117,109,95,100,98,46,39,32,124,124,32,113,117,111,116,101,40,110,97,109,101,41,32,124,124,32,39,32,83,69,76,69,67,84,32,42,32,70,82,79,77,32,109,97,105,110,46,39,32,\n124,124,32,113,117,111,116,101,40,110,97,109,101,41,32,124,124,32,39,59,39,32,70,82,79,77,32,118,97,99,117,117,109,95,100,98,46,115,113,108,105,116,101,95,109,97,115,116,101,114,32,87,72,69,82,69,32,110,97,109,101,61,61,39,115,113,108,105,116,101,95,115,101,113,117,101,110,99,101,39,59,0,0,0,0,0,0,73,78,83,69,82,84,32,73,78,84,79,32,118,97,99,117,117,109,95,100,98,46,115,113,108,105,116,101,95,109,97,115,116,101,114,32,32,32,83,69,76,69,67,84,32,116,121,112,101,44,32,110,97,109,101,44,32,116,98,108,\n95,110,97,109,101,44,32,114,111,111,116,112,97,103,101,44,32,115,113,108,32,32,32,32,70,82,79,77,32,109,97,105,110,46,115,113,108,105,116,101,95,109,97,115,116,101,114,32,32,32,87,72,69,82,69,32,116,121,112,101,61,39,118,105,101,119,39,32,79,82,32,116,121,112,101,61,39,116,114,105,103,103,101,114,39,32,32,32,32,32,32,79,82,32,40,116,121,112,101,61,39,116,97,98,108,101,39,32,65,78,68,32,114,111,111,116,112,97,103,101,61,48,41,0,1,1,3,0,5,0,6,0,8,0,0,0,0,0,0,0,77,97,105,110,32,102,114,101,101,108,105,\n115,116,58,32,0,76,105,115,116,32,111,102,32,116,114,101,101,32,114,111,111,116,115,58,32,0,0,0,0,80,97,103,101,32,37,100,32,105,115,32,110,101,118,101,114,32,117,115,101,100,0,0,0,80,111,105,110,116,101,114,32,109,97,112,32,112,97,103,101,32,37,100,32,105,115,32,114,101,102,101,114,101,110,99,101,100,0,0,0,0,0,0,0,79,117,116,115,116,97,110,100,105,110,103,32,112,97,103,101,32,99,111,117,110,116,32,103,111,101,115,32,102,114,111,109,32,37,100,32,116,111,32,37,100,32,100,117,114,105,110,103,32,116,\n104,105,115,32,97,110,97,108,121,115,105,115,0,0,10,0,0,0,0,0,0,0,80,97,103,101,32,37,100,58,32,0,0,0,0,0,0,0,117,110,97,98,108,101,32,116,111,32,103,101,116,32,116,104,101,32,112,97,103,101,46,32,101,114,114,111,114,32,99,111,100,101,61,37,100,0,0,0,98,116,114,101,101,73,110,105,116,80,97,103,101,40,41,32,114,101,116,117,114,110,115,32,101,114,114,111,114,32,99,111,100,101,32,37,100,0,0,0,79,110,32,116,114,101,101,32,112,97,103,101,32,37,100,32,99,101,108,108,32,37,100,58,32,0,0,0,0,0,0,0,82,111,\n119,105,100,32,37,108,108,100,32,111,117,116,32,111,102,32,111,114,100,101,114,32,40,112,114,101,118,105,111,117,115,32,119,97,115,32,37,108,108,100,41,0,0,0,0,0,67,104,105,108,100,32,112,97,103,101,32,100,101,112,116,104,32,100,105,102,102,101,114,115,0,0,0,0,0,0,0,0,79,110,32,112,97,103,101,32,37,100,32,97,116,32,114,105,103,104,116,32,99,104,105,108,100,58,32,0,0,0,0,0,82,111,119,105,100,32,37,108,108,100,32,111,117,116,32,111,102,32,111,114,100,101,114,32,40,109,97,120,32,108,97,114,103,101,114,\n32,116,104,97,110,32,112,97,114,101,110,116,32,109,105,110,32,111,102,32,37,108,108,100,41,0,0,0,0,82,111,119,105,100,32,37,108,108,100,32,111,117,116,32,111,102,32,111,114,100,101,114,32,40,109,105,110,32,108,101,115,115,32,116,104,97,110,32,112,97,114,101,110,116,32,109,105,110,32,111,102,32,37,108,108,100,41,0,0,0,0,0,0,82,111,119,105,100,32,37,108,108,100,32,111,117,116,32,111,102,32,111,114,100,101,114,32,40,109,97,120,32,108,97,114,103,101,114,32,116,104,97,110,32,112,97,114,101,110,116,32,\n109,97,120,32,111,102,32,37,108,108,100,41,0,0,0,0,82,111,119,105,100,32,37,108,108,100,32,111,117,116,32,111,102,32,111,114,100,101,114,32,40,109,105,110,32,108,101,115,115,32,116,104,97,110,32,112,97,114,101,110,116,32,109,97,120,32,111,102,32,37,108,108,100,41,0,0,0,0,0,0,67,111,114,114,117,112,116,105,111,110,32,100,101,116,101,99,116,101,100,32,105,110,32,99,101,108,108,32,37,100,32,111,110,32,112,97,103,101,32,37,100,0,0,0,0,0,0,0,77,117,108,116,105,112,108,101,32,117,115,101,115,32,102,111,\n114,32,98,121,116,101,32,37,100,32,111,102,32,112,97,103,101,32,37,100,0,0,0,0,70,114,97,103,109,101,110,116,97,116,105,111,110,32,111,102,32,37,100,32,98,121,116,101,115,32,114,101,112,111,114,116,101,100,32,97,115,32,37,100,32,111,110,32,112,97,103,101,32,37,100,0,0,0,0,0,105,110,118,97,108,105,100,32,112,97,103,101,32,110,117,109,98,101,114,32,37,100,0,0,50,110,100,32,114,101,102,101,114,101,110,99,101,32,116,111,32,112,97,103,101,32,37,100,0,0,0,0,0,0,0,0,70,97,105,108,101,100,32,116,111,32,114,\n101,97,100,32,112,116,114,109,97,112,32,107,101,121,61,37,100,0,0,0,0,66,97,100,32,112,116,114,32,109,97,112,32,101,110,116,114,121,32,107,101,121,61,37,100,32,101,120,112,101,99,116,101,100,61,40,37,100,44,37,100,41,32,103,111,116,61,40,37,100,44,37,100,41,0,0,0,37,100,32,111,102,32,37,100,32,112,97,103,101,115,32,109,105,115,115,105,110,103,32,102,114,111,109,32,111,118,101,114,102,108,111,119,32,108,105,115,116,32,115,116,97,114,116,105,110,103,32,97,116,32,37,100,0,0,0,0,0,0,0,0,102,97,105,108,\n101,100,32,116,111,32,103,101,116,32,112,97,103,101,32,37,100,0,0,0,102,114,101,101,108,105,115,116,32,108,101,97,102,32,99,111,117,110,116,32,116,111,111,32,98,105,103,32,111,110,32,112,97,103,101,32,37,100,0,0,83,81,76,105,116,101,32,102,111,114,109,97,116,32,51,0,37,115,45,109,106,88,88,88,88,88,88,57,88,88,122,0,77,74,32,100,101,108,101,116,101,58,32,37,115,0,0,0,77,74,32,99,111,108,108,105,100,101,58,32,37,115,0,0,45,109,106,37,48,54,88,57,37,48,50,88,0,0,0,0,37,46,50,120,0,0,0,0,107,40,37,100,\n0,0,0,0,110,105,108,0,0,0,0,0,66,0,0,0,0,0,0,0,44,46,46,46,0,0,0,0,40,37,46,50,48,115,41,0,37,115,40,37,100,41,0,0,37,100,0,0,0,0,0,0,40,98,108,111,98,41,0,0,118,116,97,98,58,37,112,58,37,112,0,0,0,0,0,0,105,110,116,97,114,114,97,121,0,0,0,0,0,0,0,0,112,114,111,103,114,97,109,0,72,74,0,0,152,137,0,0,168,137,0,0,184,137,0,0,200,137,0,0,216,137,0,0,232,137,0,0,248,137,0,0,8,138,0,0,16,138,0,0,24,138,0,0,32,138,0,0,48,138,0,0,64,138,0,0,72,138,0,0,80,138,0,0,88,138,0,0,96,138,0,0,104,138,0,0,112,138,\n0,0,120,138,0,0,136,138,0,0,152,138,0,0,160,138,0,0,176,138,0,0,184,138,0,0,192,138,0,0,200,138,0,0,208,138,0,0,216,138,0,0,232,138,0,0,240,138,0,0,0,139,0,0,8,139,0,0,16,139,0,0,24,139,0,0,40,139,0,0,48,139,0,0,56,139,0,0,72,139,0,0,88,139,0,0,96,139,0,0,112,139,0,0,120,139,0,0,128,139,0,0,136,139,0,0,144,139,0,0,152,139,0,0,160,139,0,0,176,139,0,0,192,139,0,0,200,139,0,0,216,139,0,0,232,139,0,0,248,139,0,0,8,140,0,0,24,140,0,0,40,140,0,0,56,140,0,0,72,140,0,0,88,140,0,0,104,140,0,0,112,140,0,0,\n120,140,0,0,128,140,0,0,136,140,0,0,144,140,0,0,152,140,0,0,168,140,0,0,184,140,0,0,192,140,0,0,208,140,0,0,216,140,0,0,224,140,0,0,240,140,0,0,0,141,0,0,8,141,0,0,16,141,0,0,24,141,0,0,32,141,0,0,40,141,0,0,48,141,0,0,56,141,0,0,64,141,0,0,72,141,0,0,88,141,0,0,96,141,0,0,104,141,0,0,120,141,0,0,136,141,0,0,144,141,0,0,160,141,0,0,176,141,0,0,184,141,0,0,200,141,0,0,208,141,0,0,216,141,0,0,224,141,0,0,232,141,0,0,248,141,0,0,8,142,0,0,24,142,0,0,32,142,0,0,40,142,0,0,48,142,0,0,56,142,0,0,64,142,\n0,0,80,142,0,0,88,142,0,0,96,142,0,0,112,142,0,0,128,142,0,0,144,142,0,0,160,142,0,0,168,142,0,0,176,142,0,0,184,142,0,0,192,142,0,0,200,142,0,0,208,142,0,0,224,142,0,0,240,142,0,0,0,143,0,0,16,143,0,0,32,143,0,0,48,143,0,0,64,143,0,0,80,143,0,0,96,143,0,0,112,143,0,0,128,143,0,0,144,143,0,0,152,143,0,0,160,143,0,0,168,143,0,0,184,143,0,0,200,143,0,0,208,143,0,0,216,143,0,0,224,143,0,0,232,143,0,0,248,143,0,0,8,144,0,0,16,144,0,0,32,144,0,0,40,144,0,0,48,144,0,0,64,144,0,0,72,144,0,0,80,144,0,0,88,\n144,0,0,96,144,0,0,112,144,0,0,128,144,0,0,136,144,0,0,144,144,0,0,70,117,110,99,116,105,111,110,0,0,0,0,0,0,0,0,83,97,118,101,112,111,105,110,116,0,0,0,0,0,0,0,65,117,116,111,67,111,109,109,105,116,0,0,0,0,0,0,84,114,97,110,115,97,99,116,105,111,110,0,0,0,0,0,83,111,114,116,101,114,78,101,120,116,0,0,0,0,0,0,80,114,101,118,73,102,79,112,101,110,0,0,0,0,0,0,78,101,120,116,73,102,79,112,101,110,0,0,0,0,0,0,80,114,101,118,0,0,0,0,78,101,120,116,0,0,0,0,65,103,103,83,116,101,112,0,67,104,101,99,107,\n112,111,105,110,116,0,0,0,0,0,0,74,111,117,114,110,97,108,77,111,100,101,0,0,0,0,0,86,97,99,117,117,109,0,0,86,70,105,108,116,101,114,0,86,85,112,100,97,116,101,0,71,111,116,111,0,0,0,0,71,111,115,117,98,0,0,0,82,101,116,117,114,110,0,0,78,111,116,0,0,0,0,0,73,110,105,116,67,111,114,111,117,116,105,110,101,0,0,0,69,110,100,67,111,114,111,117,116,105,110,101,0,0,0,0,89,105,101,108,100,0,0,0,72,97,108,116,73,102,78,117,108,108,0,0,0,0,0,0,72,97,108,116,0,0,0,0,73,110,116,101,103,101,114,0,73,110,116,\n54,52,0,0,0,83,116,114,105,110,103,0,0,78,117,108,108,0,0,0,0,83,111,102,116,78,117,108,108,0,0,0,0,0,0,0,0,66,108,111,98,0,0,0,0,86,97,114,105,97,98,108,101,0,0,0,0,0,0,0,0,77,111,118,101,0,0,0,0,67,111,112,121,0,0,0,0,83,67,111,112,121,0,0,0,82,101,115,117,108,116,82,111,119,0,0,0,0,0,0,0,67,111,108,108,83,101,113,0,65,100,100,73,109,109,0,0,77,117,115,116,66,101,73,110,116,0,0,0,0,0,0,0,82,101,97,108,65,102,102,105,110,105,116,121,0,0,0,0,67,97,115,116,0,0,0,0,80,101,114,109,117,116,97,116,105,\n111,110,0,0,0,0,0,67,111,109,112,97,114,101,0,74,117,109,112,0,0,0,0,79,110,99,101,0,0,0,0,73,102,0,0,0,0,0,0,73,102,78,111,116,0,0,0,67,111,108,117,109,110,0,0,65,102,102,105,110,105,116,121,0,0,0,0,0,0,0,0,77,97,107,101,82,101,99,111,114,100,0,0,0,0,0,0,67,111,117,110,116,0,0,0,82,101,97,100,67,111,111,107,105,101,0,0,0,0,0,0,83,101,116,67,111,111,107,105,101,0,0,0,0,0,0,0,82,101,111,112,101,110,73,100,120,0,0,0,0,0,0,0,79,112,101,110,82,101,97,100,0,0,0,0,0,0,0,0,79,112,101,110,87,114,105,116,\n101,0,0,0,0,0,0,0,79,112,101,110,65,117,116,111,105,110,100,101,120,0,0,0,79,112,101,110,69,112,104,101,109,101,114,97,108,0,0,0,83,111,114,116,101,114,79,112,101,110,0,0,0,0,0,0,83,101,113,117,101,110,99,101,84,101,115,116,0,0,0,0,79,112,101,110,80,115,101,117,100,111,0,0,0,0,0,0,67,108,111,115,101,0,0,0,83,101,101,107,76,84,0,0,83,101,101,107,76,69,0,0,83,101,101,107,71,69,0,0,83,101,101,107,71,84,0,0,83,101,101,107,0,0,0,0,78,111,67,111,110,102,108,105,99,116,0,0,0,0,0,0,78,111,116,70,111,117,\n110,100,0,0,0,0,0,0,0,0,70,111,117,110,100,0,0,0,78,111,116,69,120,105,115,116,115,0,0,0,0,0,0,0,79,114,0,0,0,0,0,0,65,110,100,0,0,0,0,0,83,101,113,117,101,110,99,101,0,0,0,0,0,0,0,0,78,101,119,82,111,119,105,100,0,0,0,0,0,0,0,0,73,110,115,101,114,116,0,0,73,115,78,117,108,108,0,0,78,111,116,78,117,108,108,0,78,101,0,0,0,0,0,0,69,113,0,0,0,0,0,0,71,116,0,0,0,0,0,0,76,101,0,0,0,0,0,0,76,116,0,0,0,0,0,0,71,101,0,0,0,0,0,0,73,110,115,101,114,116,73,110,116,0,0,0,0,0,0,0,66,105,116,65,110,100,0,0,66,\n105,116,79,114,0,0,0,83,104,105,102,116,76,101,102,116,0,0,0,0,0,0,0,83,104,105,102,116,82,105,103,104,116,0,0,0,0,0,0,65,100,100,0,0,0,0,0,83,117,98,116,114,97,99,116,0,0,0,0,0,0,0,0,77,117,108,116,105,112,108,121,0,0,0,0,0,0,0,0,68,105,118,105,100,101,0,0,82,101,109,97,105,110,100,101,114,0,0,0,0,0,0,0,67,111,110,99,97,116,0,0,68,101,108,101,116,101,0,0,66,105,116,78,111,116,0,0,83,116,114,105,110,103,56,0,82,101,115,101,116,67,111,117,110,116,0,0,0,0,0,0,83,111,114,116,101,114,67,111,109,112,97,\n114,101,0,0,0,83,111,114,116,101,114,68,97,116,97,0,0,0,0,0,0,82,111,119,75,101,121,0,0,82,111,119,68,97,116,97,0,82,111,119,105,100,0,0,0,78,117,108,108,82,111,119,0,76,97,115,116,0,0,0,0,83,111,114,116,101,114,83,111,114,116,0,0,0,0,0,0,83,111,114,116,0,0,0,0,82,101,119,105,110,100,0,0,83,111,114,116,101,114,73,110,115,101,114,116,0,0,0,0,73,100,120,73,110,115,101,114,116,0,0,0,0,0,0,0,73,100,120,68,101,108,101,116,101,0,0,0,0,0,0,0,73,100,120,82,111,119,105,100,0,0,0,0,0,0,0,0,73,100,120,76,69,\n0,0,0,73,100,120,71,84,0,0,0,73,100,120,76,84,0,0,0,73,100,120,71,69,0,0,0,68,101,115,116,114,111,121,0,67,108,101,97,114,0,0,0,82,101,115,101,116,83,111,114,116,101,114,0,0,0,0,0,67,114,101,97,116,101,73,110,100,101,120,0,0,0,0,0,67,114,101,97,116,101,84,97,98,108,101,0,0,0,0,0,80,97,114,115,101,83,99,104,101,109,97,0,0,0,0,0,76,111,97,100,65,110,97,108,121,115,105,115,0,0,0,0,68,114,111,112,84,97,98,108,101,0,0,0,0,0,0,0,68,114,111,112,73,110,100,101,120,0,0,0,0,0,0,0,68,114,111,112,84,114,105,\n103,103,101,114,0,0,0,0,0,73,110,116,101,103,114,105,116,121,67,107,0,0,0,0,0,82,111,119,83,101,116,65,100,100,0,0,0,0,0,0,0,82,111,119,83,101,116,82,101,97,100,0,0,0,0,0,0,82,111,119,83,101,116,84,101,115,116,0,0,0,0,0,0,80,114,111,103,114,97,109,0,80,97,114,97,109,0,0,0,82,101,97,108,0,0,0,0,70,107,67,111,117,110,116,101,114,0,0,0,0,0,0,0,70,107,73,102,90,101,114,111,0,0,0,0,0,0,0,0,77,101,109,77,97,120,0,0,73,102,80,111,115,0,0,0,73,102,78,101,103,0,0,0,73,102,90,101,114,111,0,0,65,103,103,70,\n105,110,97,108,0,0,0,0,0,0,0,0,73,110,99,114,86,97,99,117,117,109,0,0,0,0,0,0,69,120,112,105,114,101,0,0,84,97,98,108,101,76,111,99,107,0,0,0,0,0,0,0,86,66,101,103,105,110,0,0,86,67,114,101,97,116,101,0,86,68,101,115,116,114,111,121,0,0,0,0,0,0,0,0,86,79,112,101,110,0,0,0,86,67,111,108,117,109,110,0,86,78,101,120,116,0,0,0,86,82,101,110,97,109,101,0,80,97,103,101,99,111,117,110,116,0,0,0,0,0,0,0,77,97,120,80,103,99,110,116,0,0,0,0,0,0,0,0,73,110,105,116,0,0,0,0,78,111,111,112,0,0,0,0,69,120,112,108,\n97,105,110,0,65,80,73,32,99,97,108,108,101,100,32,119,105,116,104,32,78,85,76,76,32,112,114,101,112,97,114,101,100,32,115,116,97,116,101,109,101,110,116,0,65,80,73,32,99,97,108,108,101,100,32,119,105,116,104,32,102,105,110,97,108,105,122,101,100,32,112,114,101,112,97,114,101,100,32,115,116,97,116,101,109,101,110,116,0,0,0,0,64,32,32,0,0,0,0,0,1,0,0,0,8,0,0,0,4,0,0,0,5,0,0,0,8,0,0,0,12,0,0,0,13,0,0,0,14,0,0,0,15,0,0,0,16,0,0,0,9,0,0,0,9,0,0,0,10,0,0,0,0,0,0,0,3,0,0,0,12,0,0,0,17,0,0,0,6,0,0,0,4,0,\n0,0,0,0,0,0,160,146,0,0,10,0,0,0,0,0,0,0,120,146,0,0,11,0,0,0,0,0,0,0,192,18,0,0,18,0,0,0,0,0,0,0,168,146,0,0,19,0,0,0,0,0,0,0,176,146,0,0,20,0,0,0,0,0,0,0,184,146,0,0,21,0,0,0,0,0,0,0,192,146,0,0,22,0,0,0,0,0,0,0,208,146,0,0,11,0,0,0,0,0,0,0,216,146,0,0,12,0,0,0,0,0,0,0,224,146,0,0,0,0,0,0,0,0,0,0,232,146,0,0,0,0,0,0,0,0,0,0,240,146,0,0,13,0,0,0,0,0,0,0,248,146,0,0,0,0,0,0,0,0,0,0,0,147,0,0,0,0,0,0,0,0,0,0,16,147,0,0,23,0,0,0,0,0,0,0,24,147,0,0,0,0,0,0,0,0,0,0,40,147,0,0,12,0,0,0,0,0,0,0,48,147,\n0,0,24,0,0,0,0,0,0,0,64,147,0,0,25,0,0,0,0,0,0,0,72,147,0,0,13,0,0,0,0,0,0,0,80,147,0,0,14,0,0,0,0,0,0,0,88,147,0,0,1,0,0,0,0,0,0,0,96,147,0,0,26,0,0,0,0,0,0,0,104,147,0,0,0,0,0,0,0,0,0,0,112,147,0,0,1,0,0,0,0,0,0,0,0,0,0,0,99,108,111,115,101,0,0,0,111,115,95,117,110,105,120,46,99,58,37,100,58,32,40,37,100,41,32,37,115,40,37,115,41,32,45,32,37,115,0,0,111,112,101,110,0,0,0,0,103,101,116,99,119,100,0,0,115,116,97,116,0,0,0,0,102,115,116,97,116,0,0,0,102,116,114,117,110,99,97,116,101,0,0,0,0,0,0,0,\n102,99,110,116,108,0,0,0,114,101,97,100,0,0,0,0,112,114,101,97,100,0,0,0,112,114,101,97,100,54,52,0,119,114,105,116,101,0,0,0,112,119,114,105,116,101,0,0,112,119,114,105,116,101,54,52,0,0,0,0,0,0,0,0,102,99,104,109,111,100,0,0,102,97,108,108,111,99,97,116,101,0,0,0,0,0,0,0,117,110,108,105,110,107,0,0,111,112,101,110,68,105,114,101,99,116,111,114,121,0,0,0,109,107,100,105,114,0,0,0,114,109,100,105,114,0,0,0,102,99,104,111,119,110,0,0,109,109,97,112,0,0,0,0,109,117,110,109,97,112,0,0,109,114,101,109,\n97,112,0,0,103,101,116,112,97,103,101,115,105,122,101,0,0,0,0,0,97,116,116,101,109,112,116,32,116,111,32,111,112,101,110,32,34,37,115,34,32,97,115,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,37,100,0,0,0,0,0,0,47,100,101,118,47,110,117,108,108,0,0,0,0,0,0,0,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,48,49,50,51,52,53,54,55,56,57,0,0,37,115,47,\n101,116,105,108,113,115,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,148,0,0,64,148,0,0,80,148,0,0,0,0,0,0,0,0,0,0,47,118,97,114,47,116,109,112,0,0,0,0,0,0,0,0,47,117,115,114,47,116,109,112,0,0,0,0,0,0,0,0,47,116,109,112,0,0,0,0,83,81,76,73,84,69,95,84,77,80,68,73,82,0,0,0,84,77,80,68,73,82,0,0,102,117,108,108,95,102,115,121,110,99,0,0,0,0,0,0,3,0,0,0,14,0,0,0,4,0,0,0,5,0,0,0,8,0,0,0,12,0,0,0,13,0,0,0,27,0,0,0,28,0,0,0,29,0,0,0,9,0,0,0,9,0,0,0,10,0,0,0,0,0,0,0,3,0,0,0,12,0,0,0,17,0,0,0,6,0,0,0,4,0,0,\n0,0,0,0,0,0,0,0,0,0,0,0,0,47,100,101,118,47,117,114,97,110,100,111,109,0,0,0,0,47,37,115,0,0,0,0,0,102,115,121,110,99,0,0,0,112,115,111,119,0,0,0,0,3,0,0,0,15,0,0,0,4,0,0,0,5,0,0,0,8,0,0,0,12,0,0,0,13,0,0,0,30,0,0,0,31,0,0,0,32,0,0,0,9,0,0,0,9,0,0,0,10,0,0,0,7,0,0,0,3,0,0,0,12,0,0,0,17,0,0,0,6,0,0,0,4,0,0,0,0,0,0,0,37,115,46,108,111,99,107,0,99,97,110,110,111,116,32,102,115,116,97,116,32,100,98,32,102,105,108,101,32,37,115,0,102,105,108,101,32,117,110,108,105,110,107,101,100,32,119,104,105,108,101,\n32,111,112,101,110,58,32,37,115,0,0,0,0,109,117,108,116,105,112,108,101,32,108,105,110,107,115,32,116,111,32,102,105,108,101,58,32,37,115,0,0,0,0,0,0,102,105,108,101,32,114,101,110,97,109,101,100,32,119,104,105,108,101,32,111,112,101,110,58,32,37,115,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,45,115,104,109,0,0,114,101,97,100,111,110,108,121,95,115,104,109,0,0,0,0,37,0,0,0,0,0,0,0,100,10,1,1,0,0,115,0,4,6,0,0,103,0,1,4,30,0,122,0,4,7,0,0,113,0,4,10,0,0,81,0,4,11,0,0,119,0,4,15,0,0,99,0,0,9,0,0,111,8,0,1,0,\n2,117,10,0,1,0,0,120,16,0,1,16,1,88,16,0,1,0,4,102,0,1,2,0,0,101,0,1,3,30,0,69,0,1,3,14,0,71,0,1,4,14,0,105,10,1,1,0,0,110,0,0,5,0,0,37,0,0,8,0,0,112,16,0,14,0,1,84,0,2,12,0,0,83,0,2,13,0,0,114,10,3,16,0,0,0,0,0,0,0,0,116,104,115,116,110,100,114,100,0,0,0,0,0,0,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,48,49,50,51,52,53,54,55,56,57,97,98,99,100,101,102,0,0,0,0,0,0,0,0,45,120,48,0,88,48,0,0,78,97,78,0,0,0,0,0,45,73,110,102,0,0,0,0,43,73,110,102,0,0,0,0,73,110,102,0,0,0,0,0,40,78,85,76,76,\n41,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,254,255,255,127,0,0,0,0,128,0,0,0,244,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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":\"Success\",1:\"Not super-user\",2:\"No such file or directory\",3:\"No such process\",4:\"Interrupted system call\",5:\"I/O error\",6:\"No such device or address\",7:\"Arg list too long\",8:\"Exec format error\",9:\"Bad file number\",10:\"No children\",11:\"No more processes\",\n12:\"Not enough core\",13:\"Permission denied\",14:\"Bad address\",15:\"Block device required\",16:\"Mount device busy\",17:\"File exists\",18:\"Cross-device link\",19:\"No such device\",20:\"Not a directory\",21:\"Is a directory\",22:\"Invalid argument\",23:\"Too many open files in system\",24:\"Too many open files\",25:\"Not a typewriter\",26:\"Text file busy\",27:\"File too large\",28:\"No space left on device\",29:\"Illegal seek\",30:\"Read only file system\",31:\"Too many links\",32:\"Broken pipe\",33:\"Math arg out of domain of func\",\n34:\"Math result not representable\",35:\"File locking deadlock error\",36:\"File or path name too long\",37:\"No record locks available\",38:\"Function not implemented\",39:\"Directory not empty\",40:\"Too many symbolic links\",42:\"No message of desired type\",43:\"Identifier removed\",44:\"Channel number out of range\",45:\"Level 2 not synchronized\",46:\"Level 3 halted\",47:\"Level 3 reset\",48:\"Link number out of range\",49:\"Protocol driver not attached\",50:\"No CSI structure available\",51:\"Level 2 halted\",52:\"Invalid exchange\",\n53:\"Invalid request descriptor\",54:\"Exchange full\",55:\"No anode\",56:\"Invalid request code\",57:\"Invalid slot\",59:\"Bad font file fmt\",60:\"Device not a stream\",61:\"No data (for no delay io)\",62:\"Timer expired\",63:\"Out of streams resources\",64:\"Machine is not on the network\",65:\"Package not installed\",66:\"The object is remote\",67:\"The link has been severed\",68:\"Advertise error\",69:\"Srmount error\",70:\"Communication error on send\",71:\"Protocol error\",72:\"Multihop attempted\",73:\"Cross mount point (not really error)\",\n74:\"Trying to read unreadable message\",75:\"Value too large for defined data type\",76:\"Given log. name not unique\",77:\"f.d. invalid for this operation\",78:\"Remote address changed\",79:\"Can   access a needed shared lib\",80:\"Accessing a corrupted shared lib\",81:\".lib section in a.out corrupted\",82:\"Attempting to link in too many libs\",83:\"Attempting to exec a shared library\",84:\"Illegal byte sequence\",86:\"Streams pipe error\",87:\"Too many users\",88:\"Socket operation on non-socket\",89:\"Destination address required\",\n90:\"Message too long\",91:\"Protocol wrong type for socket\",92:\"Protocol not available\",93:\"Unknown protocol\",94:\"Socket type not supported\",95:\"Not supported\",96:\"Protocol family not supported\",97:\"Address family not supported by protocol family\",98:\"Address already in use\",99:\"Address not available\",100:\"Network interface is not configured\",101:\"Network is unreachable\",102:\"Connection reset by network\",103:\"Connection aborted\",104:\"Connection reset by peer\",105:\"No buffer space available\",106:\"Socket is already connected\",\n107:\"Socket is not connected\",108:\"Can't send after socket shutdown\",109:\"Too many references\",110:\"Connection timed out\",111:\"Connection refused\",112:\"Host is down\",113:\"Host is unreachable\",114:\"Socket already connected\",115:\"Connection already in progress\",116:\"Stale file handle\",122:\"Quota exceeded\",123:\"No medium (in tape drive)\",125:\"Operation canceled\",130:\"Previous owner died\",131:\"State not recoverable\"},kb=0;function P(a){return E[kb>>2]=a}\nfunction lb(a,b){for(var c=0,d=a.length-1;0<=d;d--){var f=a[d];\".\"===f?a.splice(d,1):\"..\"===f?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift(\"..\");return a}function mb(a){var b=\"/\"===a.charAt(0),c=\"/\"===a.substr(-1),a=lb(a.split(\"/\").filter(function(a){return!!a}),!b).join(\"/\");!a&&!b&&(a=\".\");a&&c&&(a+=\"/\");return(b?\"/\":\"\")+a}\nfunction nb(a){var b=/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/.exec(a).slice(1),a=b[0],b=b[1];if(!a&&!b)return\".\";b&&(b=b.substr(0,b.length-1));return a+b}function ob(a){if(\"/\"===a)return\"/\";var b=a.lastIndexOf(\"/\");return-1===b?a:a.substr(b+1)}function pb(){var a=Array.prototype.slice.call(arguments,0);return mb(a.join(\"/\"))}function qb(a,b){return mb(a+\"/\"+b)}\nfunction rb(){for(var a=\"\",b=m,c=arguments.length-1;-1<=c&&!b;c--){b=0<=c?arguments[c]:z.Ib();\"string\"!==typeof b&&e(new TypeError(\"Arguments to path.resolve must be strings\"));if(!b)return\"\";a=b+\"/\"+a;b=\"/\"===b.charAt(0)}a=lb(a.split(\"/\").filter(function(a){return!!a}),!b).join(\"/\");return(b?\"/\":\"\")+a||\".\"}\nfunction sb(a,b){function c(a){for(var b=0;b<a.length&&\"\"===a[b];b++);for(var c=a.length-1;0<=c&&\"\"===a[c];c--);return b>c?[]:a.slice(b,c-b+1)}for(var a=rb(a).substr(1),b=rb(b).substr(1),d=c(a.split(\"/\")),f=c(b.split(\"/\")),h=Math.min(d.length,f.length),i=h,j=0;j<h;j++)if(d[j]!==f[j]){i=j;break}h=[];for(j=i;j<d.length;j++)h.push(\"..\");h=h.concat(f.slice(i));return h.join(\"/\")}var tb=[];function ub(a,b){tb[a]={input:[],V:[],Sa:b};z.Cc(a,vb)}\nvar vb={open:function(a){var b=tb[a.k.pb];b||e(new z.e(O.ub));a.Z=b;a.seekable=m},close:function(a){a.Z.Sa.flush(a.Z)},flush:function(a){a.Z.Sa.flush(a.Z)},W:function(a,b,c,d){(!a.Z||!a.Z.Sa.td)&&e(new z.e(O.Pc));for(var f=0,h=0;h<d;h++){var i;try{i=a.Z.Sa.td(a.Z)}catch(j){e(new z.e(O.Fa))}i===g&&0===f&&e(new z.e(O.bb));if(i===l||i===g)break;f++;b[c+h]=i}f&&(a.k.timestamp=Date.now());return f},write:function(a,b,c,d){(!a.Z||!a.Z.Sa.zc)&&e(new z.e(O.Pc));for(var f=0;f<d;f++)try{a.Z.Sa.zc(a.Z,b[c+f])}catch(h){e(new z.e(O.Fa))}d&&\n(a.k.timestamp=Date.now());return f}},xb={td:function(a){if(!a.input.length){var b=l;if(s){if(b=process.stdin.read(),!b){if(process.stdin._readableState&&process.stdin._readableState.ended)return l;return}}else\"undefined\"!=typeof window&&\"function\"==typeof window.prompt?(b=window.prompt(\"Input: \"),b!==l&&(b+=\"\\n\")):\"function\"==typeof readline&&(b=readline(),b!==l&&(b+=\"\\n\"));if(!b)return l;a.input=N(b,k)}return a.input.shift()},flush:function(a){a.V&&0<a.V.length&&(r.print(a.V.join(\"\")),a.V=[])},\nzc:function(a,b){b===l||10===b?(r.print(a.V.join(\"\")),a.V=[]):a.V.push(wb.Vb(b))}},yb={zc:function(a,b){b===l||10===b?(r.printErr(a.V.join(\"\")),a.V=[]):a.V.push(wb.Vb(b))},flush:function(a){a.V&&0<a.V.length&&(r.printErr(a.V.join(\"\")),a.V=[])}},Q={ja:l,O:function(){return Q.createNode(l,\"/\",16895,0)},createNode:function(a,b,c,d){(z.ef(c)||z.ff(c))&&e(new z.e(O.$));Q.ja||(Q.ja={dir:{k:{fa:Q.o.fa,R:Q.o.R,Pa:Q.o.Pa,ha:Q.o.ha,rename:Q.o.rename,Da:Q.o.Da,Va:Q.o.Va,qb:Q.o.qb,va:Q.o.va},J:{ga:Q.q.ga}},file:{k:{fa:Q.o.fa,\nR:Q.o.R},J:{ga:Q.q.ga,W:Q.q.W,write:Q.q.write,fb:Q.q.fb,Ra:Q.q.Ra}},link:{k:{fa:Q.o.fa,R:Q.o.R,Ta:Q.o.Ta},J:{}},ad:{k:{fa:Q.o.fa,R:Q.o.R},J:z.ue}});c=z.createNode(a,b,c,d);z.U(c.mode)?(c.o=Q.ja.dir.k,c.q=Q.ja.dir.J,c.n={}):z.isFile(c.mode)?(c.o=Q.ja.file.k,c.q=Q.ja.file.J,c.C=0,c.n=l):z.lb(c.mode)?(c.o=Q.ja.link.k,c.q=Q.ja.link.J):z.Qb(c.mode)&&(c.o=Q.ja.ad.k,c.q=Q.ja.ad.J);c.timestamp=Date.now();a&&(a.n[b]=c);return c},Te:function(a){if(a.n&&a.n.subarray){for(var b=[],c=0;c<a.C;++c)b.push(a.n[c]);\nreturn b}return a.n},Ci:function(a){return!a.n?new Uint8Array:a.n.subarray?a.n.subarray(0,a.C):new Uint8Array(a.n)},md:function(a,b){a.n&&(a.n.subarray&&b>a.n.length)&&(a.n=Q.Te(a),a.C=a.n.length);if(!a.n||a.n.subarray){var c=a.n?a.n.buffer.byteLength:0;c>=b||(b=Math.max(b,c*(1048576>c?2:1.125)|0),0!=c&&(b=Math.max(b,256)),c=a.n,a.n=new Uint8Array(b),0<a.C&&a.n.set(c.subarray(0,a.C),0))}else{!a.n&&0<b&&(a.n=[]);for(;a.n.length<b;)a.n.push(0)}},If:function(a,b){if(a.C!=b)if(0==b)a.n=l,a.C=0;else{if(!a.n||\na.n.subarray){var c=a.n;a.n=new Uint8Array(new ArrayBuffer(b));c&&a.n.set(c.subarray(0,Math.min(b,a.C)))}else if(a.n||(a.n=[]),a.n.length>b)a.n.length=b;else for(;a.n.length<b;)a.n.push(0);a.C=b}},o:{fa:function(a){var b={};b.He=z.Qb(a.mode)?a.id:1;b.xd=a.id;b.mode=a.mode;b.tf=1;b.uid=0;b.$e=0;b.pb=a.pb;b.size=z.U(a.mode)?4096:z.isFile(a.mode)?a.C:z.lb(a.mode)?a.link.length:0;b.ke=new Date(a.timestamp);b.pf=new Date(a.timestamp);b.Ge=new Date(a.timestamp);b.re=4096;b.se=Math.ceil(b.size/b.re);return b},\nR:function(a,b){b.mode!==g&&(a.mode=b.mode);b.timestamp!==g&&(a.timestamp=b.timestamp);b.size!==g&&Q.If(a,b.size)},Pa:function(){e(z.rc[O.ea])},ha:function(a,b,c,d){return Q.createNode(a,b,c,d)},rename:function(a,b,c){if(z.U(a.mode)){var d;try{d=z.sa(b,c)}catch(f){}if(d)for(var h in d.n)e(new z.e(O.ac))}delete a.parent.n[a.name];a.name=c;b.n[c]=a;a.parent=b},Da:function(a,b){delete a.n[b]},Va:function(a,b){var c=z.sa(a,b),d;for(d in c.n)e(new z.e(O.ac));delete a.n[b]},qb:function(a){var b=[\".\",\"..\"],\nc;for(c in a.n)a.n.hasOwnProperty(c)&&b.push(c);return b},va:function(a,b,c){a=Q.createNode(a,b,41471,0);a.link=c;return a},Ta:function(a){z.lb(a.mode)||e(new z.e(O.B));return a.link}},q:{W:function(a,b,c,d,f){var h=a.k.n;if(f>=a.k.C)return 0;a=Math.min(a.k.C-f,d);u(0<=a);if(8<a&&h.subarray)b.set(h.subarray(f,f+a),c);else for(d=0;d<a;d++)b[c+d]=h[f+d];return a},write:function(a,b,c,d,f,h){if(!d)return 0;a=a.k;a.timestamp=Date.now();if(b.subarray&&(!a.n||a.n.subarray)){if(h)return a.n=b.subarray(c,\nc+d),a.C=d;if(0===a.C&&0===f)return a.n=new Uint8Array(b.subarray(c,c+d)),a.C=d;if(f+d<=a.C)return a.n.set(b.subarray(c,c+d),f),d}Q.md(a,f+d);if(a.n.subarray&&b.subarray)a.n.set(b.subarray(c,c+d),f);else for(h=0;h<d;h++)a.n[f+h]=b[c+h];a.C=Math.max(a.C,f+d);return d},ga:function(a,b,c){1===c?b+=a.position:2===c&&z.isFile(a.k.mode)&&(b+=a.k.C);0>b&&e(new z.e(O.B));return b},fb:function(a,b,c){Q.md(a.k,b+c);a.k.C=Math.max(a.k.C,b+c)},Ra:function(a,b,c,d,f,h,i){z.isFile(a.k.mode)||e(new z.e(O.ub));c=\na.k.n;if(!(i&2)&&(c.buffer===b||c.buffer===b.buffer))a=m,d=c.byteOffset;else{if(0<f||f+d<a.k.C)c=c.subarray?c.subarray(f,f+d):Array.prototype.slice.call(c,f,f+d);a=k;(d=Ia(d))||e(new z.e(O.Td));b.set(c,d)}return{Af:d,fc:a}}}},zb=H(1,\"i32*\",G),Ab=H(1,\"i32*\",G),Bb=H(1,\"i32*\",G),z={root:l,nb:[],gd:[l],Na:[],rf:1,ia:l,dd:\"/\",Pb:m,wd:k,Q:{},Ld:{Ed:{Zd:1,de:2}},e:l,rc:{},F:function(a){a instanceof z.e||e(a+\" : \"+La());return P(a.Lb)},G:function(a,b){a=rb(z.Ib(),a);b=b||{};if(!a)return{path:\"\",k:l};var c=\n{pc:k,Bc:0},d;for(d in c)b[d]===g&&(b[d]=c[d]);8<b.Bc&&e(new z.e(O.$b));var c=lb(a.split(\"/\").filter(function(a){return!!a}),m),f=z.root;d=\"/\";for(var h=0;h<c.length;h++){var i=h===c.length-1;if(i&&b.parent)break;f=z.sa(f,c[h]);d=qb(d,c[h]);if(z.Ia(f)&&(!i||i&&b.pc))f=f.mb.root;if(!i||b.ca)for(i=0;z.lb(f.mode);)f=z.Ta(d),d=rb(nb(d),f),f=z.G(d,{Bc:b.Bc}).k,40<i++&&e(new z.e(O.$b))}return{path:d,k:f}},ra:function(a){for(var b;;){if(z.Rb(a))return a=a.O.of,!b?a:\"/\"!==a[a.length-1]?a+\"/\"+b:a+b;b=b?a.name+\n\"/\"+b:a.name;a=a.parent}},tc:function(a,b){for(var c=0,d=0;d<b.length;d++)c=(c<<5)-c+b.charCodeAt(d)|0;return(a+c>>>0)%z.ia.length},ud:function(a){var b=z.tc(a.parent.id,a.name);a.La=z.ia[b];z.ia[b]=a},vd:function(a){var b=z.tc(a.parent.id,a.name);if(z.ia[b]===a)z.ia[b]=a.La;else for(b=z.ia[b];b;){if(b.La===a){b.La=a.La;break}b=b.La}},sa:function(a,b){var c=z.mf(a);c&&e(new z.e(c,a));for(c=z.ia[z.tc(a.id,b)];c;c=c.La){var d=c.name;if(c.parent.id===a.id&&d===b)return c}return z.Pa(a,b)},createNode:function(a,\nb,c,d){z.yb||(z.yb=function(a,b,c,d){a||(a=this);this.parent=a;this.O=a.O;this.mb=l;this.id=z.rf++;this.name=b;this.mode=c;this.o={};this.q={};this.pb=d},z.yb.prototype={},Object.defineProperties(z.yb.prototype,{W:{get:function(){return 365===(this.mode&365)},set:function(a){a?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146===(this.mode&146)},set:function(a){a?this.mode|=146:this.mode&=-147}},gf:{get:function(){return z.U(this.mode)}},uc:{get:function(){return z.Qb(this.mode)}}}));\na=new z.yb(a,b,c,d);z.ud(a);return a},mc:function(a){z.vd(a)},Rb:function(a){return a===a.parent},Ia:function(a){return!!a.mb},isFile:function(a){return 32768===(a&61440)},U:function(a){return 16384===(a&61440)},lb:function(a){return 40960===(a&61440)},Qb:function(a){return 8192===(a&61440)},ef:function(a){return 24576===(a&61440)},ff:function(a){return 4096===(a&61440)},hf:function(a){return 49152===(a&49152)},Oe:{r:0,rs:1052672,\"r+\":2,w:577,wx:705,xw:705,\"w+\":578,\"wx+\":706,\"xw+\":706,a:1089,ax:1217,\nxa:1217,\"a+\":1090,\"ax+\":1218,\"xa+\":1218},Cd:function(a){var b=z.Oe[a];\"undefined\"===typeof b&&e(Error(\"Unknown file open mode: \"+a));return b},Pe:function(a){var b=[\"r\",\"w\",\"rw\"][a&2097155];a&512&&(b+=\"w\");return b},Ba:function(a,b){return z.wd?0:-1!==b.indexOf(\"r\")&&!(a.mode&292)||-1!==b.indexOf(\"w\")&&!(a.mode&146)||-1!==b.indexOf(\"x\")&&!(a.mode&73)?O.tb:0},mf:function(a){var b=z.Ba(a,\"x\");return b?b:!a.o.Pa?O.tb:0},xc:function(a,b){try{return z.sa(a,b),O.Nc}catch(c){}return z.Ba(a,\"wx\")},Sb:function(a,\nb,c){var d;try{d=z.sa(a,b)}catch(f){return f.Lb}if(a=z.Ba(a,\"wx\"))return a;if(c){if(!z.U(d.mode))return O.cb;if(z.Rb(d)||z.ra(d)===z.Ib())return O.Ea}else if(z.U(d.mode))return O.Oa;return 0},nf:function(a,b){return!a?O.ea:z.lb(a.mode)?O.$b:z.U(a.mode)&&(0!==(b&2097155)||b&512)?O.Oa:z.Ba(a,z.Pe(b))},Yd:4096,sf:function(a,b){for(var b=b||z.Yd,c=a||0;c<=b;c++)if(!z.Na[c])return c;e(new z.e(O.Sd))},T:function(a){return z.Na[a]},bd:function(a,b,c){z.zb||(z.zb=n(),z.zb.prototype={},Object.defineProperties(z.zb.prototype,\n{object:{get:function(){return this.k},set:function(a){this.k=a}},Ji:{get:function(){return 1!==(this.D&2097155)}},Ki:{get:function(){return 0!==(this.D&2097155)}},Ii:{get:function(){return this.D&1024}}}));var d=new z.zb,f;for(f in a)d[f]=a[f];a=d;b=z.sf(b,c);a.I=b;return z.Na[b]=a},ve:function(a){z.Na[a]=l},Fi:function(a){return z.Na[a-1]},sc:function(a){return a?a.I+1:0},ue:{open:function(a){a.q=z.Se(a.k.pb).q;a.q.open&&a.q.open(a)},ga:function(){e(new z.e(O.xb))}},wc:function(a){return a>>8},\nRi:function(a){return a&255},Ka:function(a,b){return a<<8|b},Cc:function(a,b){z.gd[a]={q:b}},Se:function(a){return z.gd[a]},pd:function(a){for(var b=[],a=[a];a.length;){var c=a.pop();b.push(c);a.push.apply(a,c.nb)}return b},Kd:function(a,b){function c(a){if(a){if(!c.Ke)return c.Ke=k,b(a)}else++f>=d.length&&b(l)}\"function\"===typeof a&&(b=a,a=m);var d=z.pd(z.root.O),f=0;d.forEach(function(b){if(!b.type.Kd)return c(l);b.type.Kd(b,a,c)})},O:function(a,b,c){var d=\"/\"===c,f=!c,h;d&&z.root&&e(new z.e(O.Ea));\n!d&&!f&&(h=z.G(c,{pc:m}),c=h.path,h=h.k,z.Ia(h)&&e(new z.e(O.Ea)),z.U(h.mode)||e(new z.e(O.cb)));b={type:a,Ti:b,of:c,nb:[]};a=a.O(b);a.O=b;b.root=a;d?z.root=a:h&&(h.mb=b,h.O&&h.O.nb.push(b));return a},Zi:function(a){a=z.G(a,{pc:m});z.Ia(a.k)||e(new z.e(O.B));var a=a.k,b=a.mb,c=z.pd(b);Object.keys(z.ia).forEach(function(a){for(a=z.ia[a];a;){var b=a.La;-1!==c.indexOf(a.O)&&z.mc(a);a=b}});a.mb=l;b=a.O.nb.indexOf(b);u(-1!==b);a.O.nb.splice(b,1)},Pa:function(a,b){return a.o.Pa(a,b)},ha:function(a,b,c){var d=\nz.G(a,{parent:k}).k,a=ob(a);(!a||\".\"===a||\"..\"===a)&&e(new z.e(O.B));var f=z.xc(d,a);f&&e(new z.e(f));d.o.ha||e(new z.e(O.$));return d.o.ha(d,a,b,c)},create:function(a,b){b=(b!==g?b:438)&4095;b|=32768;return z.ha(a,b,0)},ta:function(a,b){b=(b!==g?b:511)&1023;b|=16384;return z.ha(a,b,0)},Tb:function(a,b,c){\"undefined\"===typeof c&&(c=b,b=438);return z.ha(a,b|8192,c)},va:function(a,b){rb(a)||e(new z.e(O.ea));var c=z.G(b,{parent:k}).k;c||e(new z.e(O.ea));var d=ob(b),f=z.xc(c,d);f&&e(new z.e(f));c.o.va||\ne(new z.e(O.$));return c.o.va(c,d,a)},rename:function(a,b){var c=nb(a),d=nb(b),f=ob(a),h=ob(b),i,j,x;try{i=z.G(a,{parent:k}),j=i.k,i=z.G(b,{parent:k}),x=i.k}catch(p){e(new z.e(O.Ea))}(!j||!x)&&e(new z.e(O.ea));j.O!==x.O&&e(new z.e(O.Vd));i=z.sa(j,f);d=sb(a,d);\".\"!==d.charAt(0)&&e(new z.e(O.B));d=sb(b,c);\".\"!==d.charAt(0)&&e(new z.e(O.ac));var A;try{A=z.sa(x,h)}catch(t){}if(i!==A){c=z.U(i.mode);(f=z.Sb(j,f,c))&&e(new z.e(f));(f=A?z.Sb(x,h,c):z.xc(x,h))&&e(new z.e(f));j.o.rename||e(new z.e(O.$));(z.Ia(i)||\nA&&z.Ia(A))&&e(new z.e(O.Ea));x!==j&&(f=z.Ba(j,\"w\"))&&e(new z.e(f));try{z.Q.willMovePath&&z.Q.willMovePath(a,b)}catch(B){console.log(\"FS.trackingDelegate['willMovePath']('\"+a+\"', '\"+b+\"') threw an exception: \"+B.message)}z.vd(i);try{j.o.rename(i,x,h)}catch(I){e(I)}finally{z.ud(i)}try{if(z.Q.onMovePath)z.Q.onMovePath(a,b)}catch(ca){console.log(\"FS.trackingDelegate['onMovePath']('\"+a+\"', '\"+b+\"') threw an exception: \"+ca.message)}}},Va:function(a){var b=z.G(a,{parent:k}).k,c=ob(a),d=z.sa(b,c),f=z.Sb(b,\nc,k);f&&e(new z.e(f));b.o.Va||e(new z.e(O.$));z.Ia(d)&&e(new z.e(O.Ea));try{z.Q.willDeletePath&&z.Q.willDeletePath(a)}catch(h){console.log(\"FS.trackingDelegate['willDeletePath']('\"+a+\"') threw an exception: \"+h.message)}b.o.Va(b,c);z.mc(d);try{if(z.Q.onDeletePath)z.Q.onDeletePath(a)}catch(i){console.log(\"FS.trackingDelegate['onDeletePath']('\"+a+\"') threw an exception: \"+i.message)}},qb:function(a){a=z.G(a,{ca:k}).k;a.o.qb||e(new z.e(O.cb));return a.o.qb(a)},Da:function(a){var b=z.G(a,{parent:k}).k,\nc=ob(a),d=z.sa(b,c),f=z.Sb(b,c,m);f&&(f===O.Oa&&(f=O.$),e(new z.e(f)));b.o.Da||e(new z.e(O.$));z.Ia(d)&&e(new z.e(O.Ea));try{z.Q.willDeletePath&&z.Q.willDeletePath(a)}catch(h){console.log(\"FS.trackingDelegate['willDeletePath']('\"+a+\"') threw an exception: \"+h.message)}b.o.Da(b,c);z.mc(d);try{if(z.Q.onDeletePath)z.Q.onDeletePath(a)}catch(i){console.log(\"FS.trackingDelegate['onDeletePath']('\"+a+\"') threw an exception: \"+i.message)}},Ta:function(a){(a=z.G(a).k)||e(new z.e(O.ea));a.o.Ta||e(new z.e(O.B));\nreturn a.o.Ta(a)},Ic:function(a,b){var c=z.G(a,{ca:!b}).k;c||e(new z.e(O.ea));c.o.fa||e(new z.e(O.$));return c.o.fa(c)},kf:function(a){return z.Ic(a,k)},hb:function(a,b,c){a=\"string\"===typeof a?z.G(a,{ca:!c}).k:a;a.o.R||e(new z.e(O.$));a.o.R(a,{mode:b&4095|a.mode&-4096,timestamp:Date.now()})},Mi:function(a,b){z.hb(a,b,k)},Me:function(a,b){var c=z.T(a);c||e(new z.e(O.N));z.hb(c.k,b)},kc:function(a,b,c,d){a=\"string\"===typeof a?z.G(a,{ca:!d}).k:a;a.o.R||e(new z.e(O.$));a.o.R(a,{timestamp:Date.now()})},\nNi:function(a,b,c){z.kc(a,b,c,k)},Ne:function(a,b,c){(a=z.T(a))||e(new z.e(O.N));z.kc(a.k,b,c)},truncate:function(a,b){0>b&&e(new z.e(O.B));var c;c=\"string\"===typeof a?z.G(a,{ca:k}).k:a;c.o.R||e(new z.e(O.$));z.U(c.mode)&&e(new z.e(O.Oa));z.isFile(c.mode)||e(new z.e(O.B));var d=z.Ba(c,\"w\");d&&e(new z.e(d));c.o.R(c,{size:b,timestamp:Date.now()})},Re:function(a,b){var c=z.T(a);c||e(new z.e(O.N));0===(c.D&2097155)&&e(new z.e(O.B));z.truncate(c.k,b)},Qf:function(a,b,c){a=z.G(a,{ca:k}).k;a.o.R(a,{timestamp:Math.max(b,\nc)})},open:function(a,b,c,d,f){\"\"===a&&e(new z.e(O.ea));var b=\"string\"===typeof b?z.Cd(b):b,c=b&64?(\"undefined\"===typeof c?438:c)&4095|32768:0,h;if(\"object\"===typeof a)h=a;else{a=mb(a);try{h=z.G(a,{ca:!(b&131072)}).k}catch(i){}}var j=m;b&64&&(h?b&128&&e(new z.e(O.Nc)):(h=z.ha(a,c,0),j=k));h||e(new z.e(O.ea));z.Qb(h.mode)&&(b&=-513);j||(c=z.nf(h,b))&&e(new z.e(c));b&512&&z.truncate(h,0);b&=-641;d=z.bd({k:h,path:z.ra(h),D:b,seekable:k,position:0,q:h.q,Pf:[],error:m},d,f);d.q.open&&d.q.open(d);r.logReadFiles&&\n!(b&1)&&(z.Ac||(z.Ac={}),a in z.Ac||(z.Ac[a]=1,r.printErr(\"read file: \"+a)));try{z.Q.onOpenFile&&(f=0,1!==(b&2097155)&&(f|=z.Ld.Ed.Zd),0!==(b&2097155)&&(f|=z.Ld.Ed.de),z.Q.onOpenFile(a,f))}catch(x){console.log(\"FS.trackingDelegate['onOpenFile']('\"+a+\"', flags) threw an exception: \"+x.message)}return d},close:function(a){try{a.q.close&&a.q.close(a)}catch(b){e(b)}finally{z.ve(a.I)}},ga:function(a,b,c){(!a.seekable||!a.q.ga)&&e(new z.e(O.xb));a.position=a.q.ga(a,b,c);a.Pf=[];return a.position},W:function(a,\nb,c,d,f){(0>d||0>f)&&e(new z.e(O.B));1===(a.D&2097155)&&e(new z.e(O.N));z.U(a.k.mode)&&e(new z.e(O.Oa));a.q.W||e(new z.e(O.B));var h=k;\"undefined\"===typeof f?(f=a.position,h=m):a.seekable||e(new z.e(O.xb));b=a.q.W(a,b,c,d,f);h||(a.position+=b);return b},write:function(a,b,c,d,f,h){(0>d||0>f)&&e(new z.e(O.B));0===(a.D&2097155)&&e(new z.e(O.N));z.U(a.k.mode)&&e(new z.e(O.Oa));a.q.write||e(new z.e(O.B));a.D&1024&&z.ga(a,0,2);var i=k;\"undefined\"===typeof f?(f=a.position,i=m):a.seekable||e(new z.e(O.xb));\nb=a.q.write(a,b,c,d,f,h);i||(a.position+=b);try{if(a.path&&z.Q.onWriteToFile)z.Q.onWriteToFile(a.path)}catch(j){console.log(\"FS.trackingDelegate['onWriteToFile']('\"+path+\"') threw an exception: \"+j.message)}return b},fb:function(a,b,c){(0>b||0>=c)&&e(new z.e(O.B));0===(a.D&2097155)&&e(new z.e(O.N));!z.isFile(a.k.mode)&&!z.U(node.mode)&&e(new z.e(O.ub));a.q.fb||e(new z.e(O.wb));a.q.fb(a,b,c)},Ra:function(a,b,c,d,f,h,i){1===(a.D&2097155)&&e(new z.e(O.tb));a.q.Ra||e(new z.e(O.ub));return a.q.Ra(a,b,\nc,d,f,h,i)},kb:function(a,b,c){a.q.kb||e(new z.e(O.Ud));return a.q.kb(a,b,c)},Ef:function(a,b){b=b||{};b.D=b.D||\"r\";b.encoding=b.encoding||\"binary\";\"utf8\"!==b.encoding&&\"binary\"!==b.encoding&&e(Error('Invalid encoding type \"'+b.encoding+'\"'));var c,d=z.open(a,b.D),f=z.Ic(a).size,h=new Uint8Array(f);z.W(d,h,0,f,0);if(\"utf8\"===b.encoding){c=\"\";for(var i=new w.eb,j=0;j<f;j++)c+=i.Vb(h[j])}else\"binary\"===b.encoding&&(c=h);z.close(d);return c},$i:function(a,b,c){c=c||{};c.D=c.D||\"w\";c.encoding=c.encoding||\n\"utf8\";\"utf8\"!==c.encoding&&\"binary\"!==c.encoding&&e(Error('Invalid encoding type \"'+c.encoding+'\"'));a=z.open(a,c.D,c.mode);\"utf8\"===c.encoding?(b=new Uint8Array((new w.eb).Gd(b)),z.write(a,b,0,b.length,0,c.te)):\"binary\"===c.encoding&&z.write(a,b,0,b.length,0,c.te);z.close(a)},Ib:function(){return z.dd},si:function(a){a=z.G(a,{ca:k});z.U(a.k.mode)||e(new z.e(O.cb));var b=z.Ba(a.k,\"x\");b&&e(new z.e(b));z.dd=a.path},xe:function(){z.ta(\"/tmp\");z.ta(\"/home\");z.ta(\"/home/web_user\")},we:function(){z.ta(\"/dev\");\nz.Cc(z.Ka(1,3),{W:function(){return 0},write:function(){return 0}});z.Tb(\"/dev/null\",z.Ka(1,3));ub(z.Ka(5,0),xb);ub(z.Ka(6,0),yb);z.Tb(\"/dev/tty\",z.Ka(5,0));z.Tb(\"/dev/tty1\",z.Ka(6,0));var a;if(\"undefined\"!==typeof crypto){var b=new Uint8Array(1);a=function(){crypto.getRandomValues(b);return b[0]}}else a=s?function(){return require(\"crypto\").randomBytes(1)[0]}:function(){return 256*Math.random()|0};z.na(\"/dev\",\"random\",a);z.na(\"/dev\",\"urandom\",a);z.ta(\"/dev/shm\");z.ta(\"/dev/shm/tmp\")},Fe:function(){r.stdin?\nz.na(\"/dev\",\"stdin\",r.stdin):z.va(\"/dev/tty\",\"/dev/stdin\");r.stdout?z.na(\"/dev\",\"stdout\",l,r.stdout):z.va(\"/dev/tty\",\"/dev/stdout\");r.stderr?z.na(\"/dev\",\"stderr\",l,r.stderr):z.va(\"/dev/tty1\",\"/dev/stderr\");var a=z.open(\"/dev/stdin\",\"r\");E[zb>>2]=z.sc(a);u(0===a.I,\"invalid handle for stdin (\"+a.I+\")\");a=z.open(\"/dev/stdout\",\"w\");E[Ab>>2]=z.sc(a);u(1===a.I,\"invalid handle for stdout (\"+a.I+\")\");a=z.open(\"/dev/stderr\",\"w\");E[Bb>>2]=z.sc(a);u(2===a.I,\"invalid handle for stderr (\"+a.I+\")\")},jd:function(){z.e||\n(z.e=function(a,b){this.k=b;this.Id=function(a){this.Lb=a;for(var b in O)if(O[b]===a){this.code=b;break}};this.Id(a);this.message=jb[a]},z.e.prototype=Error(),[O.ea].forEach(function(a){z.rc[a]=new z.e(a);z.rc[a].stack=\"<generic error, no stack>\"}))},Nf:function(){z.jd();z.ia=Array(4096);z.O(Q,{},\"/\");z.xe();z.we()},jb:function(a,b,c){u(!z.jb.Pb,\"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)\");\nz.jb.Pb=k;z.jd();r.stdin=a||r.stdin;r.stdout=b||r.stdout;r.stderr=c||r.stderr;z.Fe()},Cf:function(){z.jb.Pb=m;for(var a=0;a<z.Na.length;a++){var b=z.Na[a];b&&z.close(b)}},Nb:function(a,b){var c=0;a&&(c|=365);b&&(c|=146);return c},Li:function(a,b){var c=pb.apply(l,a);b&&\"/\"==c[0]&&(c=c.substr(1));return c},li:function(a,b){return rb(b,a)},Wi:function(a){return mb(a)},yi:function(a,b){var c=z.ic(a,b);if(c.oc)return c.object;P(c.error);return l},ic:function(a,b){try{var c=z.G(a,{ca:!b}),a=c.path}catch(d){}var f=\n{Rb:m,oc:m,error:0,name:l,path:l,object:l,xf:m,zf:l,yf:l};try{c=z.G(a,{parent:k}),f.xf=k,f.zf=c.path,f.yf=c.k,f.name=ob(a),c=z.G(a,{ca:!b}),f.oc=k,f.path=c.path,f.object=c.k,f.name=c.k.name,f.Rb=\"/\"===c.path}catch(h){f.error=h.Lb}return f},ze:function(a,b,c,d){a=qb(\"string\"===typeof a?a:z.ra(a),b);return z.ta(a,z.Nb(c,d))},Ce:function(a,b){for(var a=\"string\"===typeof a?a:z.ra(a),c=b.split(\"/\").reverse();c.length;){var d=c.pop();if(d){var f=qb(a,d);try{z.ta(f)}catch(h){}a=f}}return f},ye:function(a,\nb,c,d,f){a=qb(\"string\"===typeof a?a:z.ra(a),b);return z.create(a,z.Nb(d,f))},Gb:function(a,b,c,d,f,h){a=b?qb(\"string\"===typeof a?a:z.ra(a),b):a;d=z.Nb(d,f);f=z.create(a,d);if(c){if(\"string\"===typeof c){for(var a=Array(c.length),b=0,i=c.length;b<i;++b)a[b]=c.charCodeAt(b);c=a}z.hb(f,d|146);a=z.open(f,\"w\");z.write(a,c,0,c.length,0,h);z.close(a);z.hb(f,d)}return f},na:function(a,b,c,d){a=qb(\"string\"===typeof a?a:z.ra(a),b);b=z.Nb(!!c,!!d);z.na.wc||(z.na.wc=64);var f=z.Ka(z.na.wc++,0);z.Cc(f,{open:function(a){a.seekable=\nm},close:function(){d&&(d.buffer&&d.buffer.length)&&d(10)},W:function(a,b,d,f){for(var p=0,A=0;A<f;A++){var t;try{t=c()}catch(B){e(new z.e(O.Fa))}t===g&&0===p&&e(new z.e(O.bb));if(t===l||t===g)break;p++;b[d+A]=t}p&&(a.k.timestamp=Date.now());return p},write:function(a,b,c,f){for(var p=0;p<f;p++)try{d(b[c+p])}catch(A){e(new z.e(O.Fa))}f&&(a.k.timestamp=Date.now());return p}});return z.Tb(a,b,f)},Be:function(a,b,c){a=qb(\"string\"===typeof a?a:z.ra(a),b);return z.va(c,a)},nd:function(a){if(a.uc||a.gf||\na.link||a.n)return k;var b=k;\"undefined\"!==typeof XMLHttpRequest&&e(Error(\"Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.\"));if(r.read)try{a.n=N(r.read(a.url),k),a.C=a.n.length}catch(c){b=m}else e(Error(\"Cannot load without read() or XMLHttpRequest.\"));b||P(O.Fa);return b},Ae:function(a,b,c,d,f){function h(){this.vc=m;this.Eb=[]}h.prototype.get=function(a){if(!(a>\nthis.length-1||0>a)){var b=a%this.Db;return this.Ze(a/this.Db|0)[b]}};h.prototype.Kf=function(a){this.Ze=a};h.prototype.Zc=function(){var a=new XMLHttpRequest;a.open(\"HEAD\",c,m);a.send(l);200<=a.status&&300>a.status||304===a.status||e(Error(\"Couldn't load \"+c+\". Status: \"+a.status));var b=Number(a.getResponseHeader(\"Content-length\")),d,f=1048576;if(!((d=a.getResponseHeader(\"Accept-Ranges\"))&&\"bytes\"===d))f=b;var h=this;h.Kf(function(a){var d=a*f,i=(a+1)*f-1,i=Math.min(i,b-1);if(\"undefined\"===typeof h.Eb[a]){var j=\nh.Eb;d>i&&e(Error(\"invalid range (\"+d+\", \"+i+\") or no bytes requested!\"));i>b-1&&e(Error(\"only \"+b+\" bytes available! programmer error!\"));var p=new XMLHttpRequest;p.open(\"GET\",c,m);b!==f&&p.setRequestHeader(\"Range\",\"bytes=\"+d+\"-\"+i);\"undefined\"!=typeof Uint8Array&&(p.responseType=\"arraybuffer\");p.overrideMimeType&&p.overrideMimeType(\"text/plain; charset=x-user-defined\");p.send(l);200<=p.status&&300>p.status||304===p.status||e(Error(\"Couldn't load \"+c+\". Status: \"+p.status));d=p.response!==g?new Uint8Array(p.response||\n[]):N(p.responseText||\"\",k);j[a]=d}\"undefined\"===typeof h.Eb[a]&&e(Error(\"doXHR failed!\"));return h.Eb[a]});this.fe=b;this.ee=f;this.vc=k};if(\"undefined\"!==typeof XMLHttpRequest){ea||e(\"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc\");var i=new h;Object.defineProperty(i,\"length\",{get:function(){this.vc||this.Zc();return this.fe}});Object.defineProperty(i,\"chunkSize\",{get:function(){this.vc||this.Zc();return this.ee}});i={uc:m,n:i}}else i=\n{uc:m,url:c};var j=z.ye(a,b,i,d,f);i.n?j.n=i.n:i.url&&(j.n=l,j.url=i.url);Object.defineProperty(j,\"usedBytes\",{get:function(){return this.n.length}});var x={};Object.keys(j.q).forEach(function(a){var b=j.q[a];x[a]=function(){z.nd(j)||e(new z.e(O.Fa));return b.apply(l,arguments)}});x.W=function(a,b,c,d,f){z.nd(j)||e(new z.e(O.Fa));a=a.k.n;if(f>=a.length)return 0;d=Math.min(a.length-f,d);u(0<=d);if(a.slice)for(var h=0;h<d;h++)b[c+h]=a[f+h];else for(h=0;h<d;h++)b[c+h]=a.get(f+h);return d};j.q=x;return j},\nDe:function(a,b,c,d,f,h,i,j,x){function p(){Cb=document.pointerLockElement===B||document.mozPointerLockElement===B||document.webkitPointerLockElement===B||document.msPointerLockElement===B}function A(c){function p(c){j||z.Gb(a,b,c,d,f,x);h&&h();gb()}var t=m;r.preloadPlugins.forEach(function(a){!t&&a.canHandle(I)&&(a.handle(c,I,p,function(){i&&i();gb()}),t=k)});t||p(c)}r.preloadPlugins||(r.preloadPlugins=[]);if(!Db){Db=k;try{new Blob,Eb=k}catch(t){Eb=m,console.log(\"warning: no blob constructor, cannot create blobs with mimetypes\")}Fb=\n\"undefined\"!=typeof MozBlobBuilder?MozBlobBuilder:\"undefined\"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:!Eb?console.log(\"warning: no BlobBuilder\"):l;Gb=\"undefined\"!=typeof window?window.URL?window.URL:window.webkitURL:g;!r.Dd&&\"undefined\"===typeof Gb&&(console.log(\"warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available.\"),r.Dd=k);r.preloadPlugins.push({canHandle:function(a){return!r.Dd&&/\\.(jpg|jpeg|png|bmp)$/i.test(a)},handle:function(a,b,\nc,d){var f=l;if(Eb)try{f=new Blob([a],{type:Hb(b)}),f.size!==a.length&&(f=new Blob([(new Uint8Array(a)).buffer],{type:Hb(b)}))}catch(h){w.Za(\"Blob constructor present but fails: \"+h+\"; falling back to blob builder\")}f||(f=new Fb,f.append((new Uint8Array(a)).buffer),f=f.getBlob());var i=Gb.createObjectURL(f),j=new Image;j.onload=function(){u(j.complete,\"Image \"+b+\" could not be decoded\");var d=document.createElement(\"canvas\");d.width=j.width;d.height=j.height;d.getContext(\"2d\").drawImage(j,0,0);r.preloadedImages[b]=\nd;Gb.revokeObjectURL(i);c&&c(a)};j.onerror=function(){console.log(\"Image \"+i+\" could not be decoded\");d&&d()};j.src=i}});r.preloadPlugins.push({canHandle:function(a){return!r.Si&&a.substr(-4)in{\".ogg\":1,\".wav\":1,\".mp3\":1}},handle:function(a,b,c,d){function f(d){i||(i=k,r.preloadedAudios[b]=d,c&&c(a))}function h(){i||(i=k,r.preloadedAudios[b]=new Audio,d&&d())}var i=m;if(Eb){try{var j=new Blob([a],{type:Hb(b)})}catch(p){return h()}var j=Gb.createObjectURL(j),t=new Audio;t.addEventListener(\"canplaythrough\",\nfunction(){f(t)},m);t.onerror=function(){if(!i){console.log(\"warning: browser could not fully decode audio \"+b+\", trying slower base64 approach\");for(var c=\"\",d=0,h=0,j=0;j<a.length;j++){d=d<<8|a[j];for(h+=8;6<=h;)var p=d>>h-6&63,h=h-6,c=c+\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"[p]}2==h?(c+=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"[(d&3)<<4],c+=\"==\"):4==h&&(c+=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"[(d&15)<<2],c+=\"=\");\nt.src=\"data:audio/x-\"+b.substr(-3)+\";base64,\"+c;f(t)}};t.src=j;r.noExitRuntime=k;setTimeout(function(){pa||f(t)},1E4)}else return h()}});var B=r.canvas;B&&(B.Dc=B.requestPointerLock||B.mozRequestPointerLock||B.webkitRequestPointerLock||B.msRequestPointerLock||n(),B.ld=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||n(),B.ld=B.ld.bind(document),document.addEventListener(\"pointerlockchange\",p,m),document.addEventListener(\"mozpointerlockchange\",\np,m),document.addEventListener(\"webkitpointerlockchange\",p,m),document.addEventListener(\"mspointerlockchange\",p,m),r.elementPointerLock&&B.addEventListener(\"click\",function(a){!Cb&&B.Dc&&(B.Dc(),a.preventDefault())},m))}var I=b?rb(qb(a,b)):a;fb();\"string\"==typeof c?Ib(c,function(a){A(a)},i):A(c)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},Kc:function(){return\"EM_FS_\"+window.location.pathname},Lc:20,$a:\"FILE_DATA\",Vi:function(a,b,\nc){var b=b||n(),c=c||n(),d=z.indexedDB();try{var f=d.open(z.Kc(),z.Lc)}catch(h){return c(h)}f.wf=function(){console.log(\"creating db\");f.result.createObjectStore(z.$a)};f.onsuccess=function(){var d=f.result.transaction([z.$a],\"readwrite\"),h=d.objectStore(z.$a),x=0,p=0,A=a.length;a.forEach(function(a){a=h.put(z.ic(a).object.n,a);a.onsuccess=function(){x++;x+p==A&&(0==p?b():c())};a.onerror=function(){p++;x+p==A&&(0==p?b():c())}});d.onerror=c};f.onerror=c},Pi:function(a,b,c){var b=b||n(),c=c||n(),d=\nz.indexedDB();try{var f=d.open(z.Kc(),z.Lc)}catch(h){return c(h)}f.wf=c;f.onsuccess=function(){var d=f.result;try{var h=d.transaction([z.$a],\"readonly\")}catch(x){c(x);return}var p=h.objectStore(z.$a),A=0,t=0,B=a.length;a.forEach(function(a){var d=p.get(a);d.onsuccess=function(){z.ic(a).oc&&z.Da(a);z.Gb(nb(a),ob(a),d.result,k,k,k);A++;A+t==B&&(0==t?b():c())};d.onerror=function(){t++;A+t==B&&(0==t?b():c())}});h.onerror=c};f.onerror=c}};r._i64Subtract=Jb;r._memset=Kb;\nfunction Lb(a,b,c){a=\"string\"!==typeof a?y(a):a;try{var d=c?z.kf(a):z.Ic(a);E[b>>2]=d.He;E[b+4>>2]=0;E[b+8>>2]=d.xd;E[b+12>>2]=d.mode;E[b+16>>2]=d.tf;E[b+20>>2]=d.uid;E[b+24>>2]=d.$e;E[b+28>>2]=d.pb;E[b+32>>2]=0;E[b+36>>2]=d.size;E[b+40>>2]=4096;E[b+44>>2]=d.se;E[b+48>>2]=d.ke.getTime()/1E3|0;E[b+52>>2]=0;E[b+56>>2]=d.pf.getTime()/1E3|0;E[b+60>>2]=0;E[b+64>>2]=d.Ge.getTime()/1E3|0;E[b+68>>2]=0;E[b+72>>2]=d.xd;return 0}catch(f){return f.k&&mb(a)!==mb(z.ra(f.k))&&f.Id(O.cb),z.F(f),-1}}\nr._bitshift64Shl=Mb;function Nb(a){a/=1E3;if((da||ea)&&self.performance&&self.performance.now)for(var b=self.performance.now();self.performance.now()-b<a;);else for(b=Date.now();Date.now()-b<a;);return 0}r._strlen=Ob;r._i64Add=Pb;function Qb(){return 0}function Rb(){e(\"TODO\")}\nvar R={O:function(){r.websocket=r.websocket&&\"object\"===typeof r.websocket?r.websocket:{};r.websocket.cc={};r.websocket.on=function(a,b){\"function\"===typeof b&&(this.cc[a]=b);return this};r.websocket.aa=function(a,b){\"function\"===typeof this.cc[a]&&this.cc[a].call(this,b)};return z.createNode(l,\"/\",16895,0)},Ee:function(a,b,c){c&&u(1==b==(6==c));a={Le:a,type:b,protocol:c,P:l,error:l,ob:{},yc:[],Ua:[],Xa:R.X};b=R.Ub();c=z.createNode(R.root,b,49152,0);c.Wa=a;b=z.bd({path:b,k:c,D:z.Cd(\"r+\"),seekable:m,\nq:R.q});a.J=b;return a},rd:function(a){a=z.T(a);return!a||!z.hf(a.k.mode)?l:a.k.Wa},q:{Fd:function(a){a=a.k.Wa;return a.Xa.Fd(a)},kb:function(a,b,c){a=a.k.Wa;return a.Xa.kb(a,b,c)},W:function(a,b,c,d){a=a.k.Wa;d=a.Xa.Ff(a,d);if(!d)return 0;b.set(d.buffer,c);return d.buffer.length},write:function(a,b,c,d){a=a.k.Wa;return a.Xa.Jf(a,b,c,d)},close:function(a){a=a.k.Wa;a.Xa.close(a)}},Ub:function(){R.Ub.cd||(R.Ub.cd=0);return\"socket[\"+R.Ub.cd++ +\"]\"},X:{Hb:function(a,b,c){var d;\"object\"===typeof b&&(d=\nb,c=b=l);if(d)d._socket?(b=d._socket.remoteAddress,c=d._socket.remotePort):((c=/ws[s]?:\\/\\/([^:]+):(\\d+)/.exec(d.url))||e(Error(\"WebSocket URL must be in the format ws(s)://address:port\")),b=c[1],c=parseInt(c[2],10));else try{var f=r.websocket&&\"object\"===typeof r.websocket,h=\"ws:#\".replace(\"#\",\"//\");f&&\"string\"===typeof r.websocket.url&&(h=r.websocket.url);if(\"ws://\"===h||\"wss://\"===h)var i=b.split(\"/\"),h=h+i[0]+\":\"+c+\"/\"+i.slice(1).join(\"/\");i=\"binary\";f&&\"string\"===typeof r.websocket.subprotocol&&\n(i=r.websocket.subprotocol);var i=i.replace(/^ +| +$/g,\"\").split(/ *, */),j=s?{protocol:i.toString()}:i;d=new (s?require(\"ws\"):window.WebSocket)(h,j);d.binaryType=\"arraybuffer\"}catch(x){e(new z.e(O.Oc))}b={ma:b,port:c,p:d,Jb:[]};R.X.Wc(a,b);R.X.cf(a,b);2===a.type&&\"undefined\"!==typeof a.Ya&&b.Jb.push(new Uint8Array([255,255,255,255,112,111,114,116,(a.Ya&65280)>>8,a.Ya&255]));return b},Ob:function(a,b,c){return a.ob[b+\":\"+c]},Wc:function(a,b){a.ob[b.ma+\":\"+b.port]=b},Hd:function(a,b){delete a.ob[b.ma+\n\":\"+b.port]},cf:function(a,b){function c(){r.websocket.aa(\"open\",a.J.I);try{for(var c=b.Jb.shift();c;)b.p.send(c),c=b.Jb.shift()}catch(d){b.p.close()}}function d(c){u(\"string\"!==typeof c&&c.byteLength!==g);var c=new Uint8Array(c),d=f;f=m;d&&10===c.length&&255===c[0]&&255===c[1]&&255===c[2]&&255===c[3]&&112===c[4]&&111===c[5]&&114===c[6]&&116===c[7]?(c=c[8]<<8|c[9],R.X.Hd(a,b),b.port=c,R.X.Wc(a,b)):(a.Ua.push({ma:b.ma,port:b.port,data:c}),r.websocket.aa(\"message\",a.J.I))}var f=k;s?(b.p.on(\"open\",c),\nb.p.on(\"message\",function(a,b){b.binary&&d((new Uint8Array(a)).buffer)}),b.p.on(\"close\",function(){r.websocket.aa(\"close\",a.J.I)}),b.p.on(\"error\",function(){a.error=O.Mc;r.websocket.aa(\"error\",[a.J.I,a.error,\"ECONNREFUSED: Connection refused\"])})):(b.p.onopen=c,b.p.onclose=function(){r.websocket.aa(\"close\",a.J.I)},b.p.onmessage=function(a){d(a.data)},b.p.onerror=function(){a.error=O.Mc;r.websocket.aa(\"error\",[a.J.I,a.error,\"ECONNREFUSED: Connection refused\"])})},Fd:function(a){if(1===a.type&&a.P)return a.yc.length?\n65:0;var b=0,c=1===a.type?R.X.Ob(a,a.oa,a.pa):l;if(a.Ua.length||!c||c&&c.p.readyState===c.p.sb||c&&c.p.readyState===c.p.CLOSED)b|=65;if(!c||c&&c.p.readyState===c.p.OPEN)b|=4;if(c&&c.p.readyState===c.p.sb||c&&c.p.readyState===c.p.CLOSED)b|=16;return b},kb:function(a,b,c){switch(b){case 21531:return b=0,a.Ua.length&&(b=a.Ua[0].data.length),E[c>>2]=b,0;default:return O.B}},close:function(a){if(a.P){try{a.P.close()}catch(b){}a.P=l}for(var c=Object.keys(a.ob),d=0;d<c.length;d++){var f=a.ob[c[d]];try{f.p.close()}catch(h){}R.X.Hd(a,\nf)}return 0},bind:function(a,b,c){(\"undefined\"!==typeof a.Fc||\"undefined\"!==typeof a.Ya)&&e(new z.e(O.B));a.Fc=b;a.Ya=c||Rb();if(2===a.type){a.P&&(a.P.close(),a.P=l);try{a.Xa.jf(a,0)}catch(d){d instanceof z.e||e(d),d.Lb!==O.wb&&e(d)}}},ti:function(a,b,c){a.P&&e(new z.e(O.wb));if(\"undefined\"!==typeof a.oa&&\"undefined\"!==typeof a.pa){var d=R.X.Ob(a,a.oa,a.pa);d&&(d.p.readyState===d.p.CONNECTING&&e(new z.e(O.Od)),e(new z.e(O.Rd)))}b=R.X.Hb(a,b,c);a.oa=b.ma;a.pa=b.port;e(new z.e(O.Qd))},jf:function(a){s||\ne(new z.e(O.wb));a.P&&e(new z.e(O.B));var b=require(\"ws\").Server;a.P=new b({host:a.Fc,port:a.Ya});r.websocket.aa(\"listen\",a.J.I);a.P.on(\"connection\",function(b){if(1===a.type){var d=R.Ee(a.Le,a.type,a.protocol),b=R.X.Hb(d,b);d.oa=b.ma;d.pa=b.port;a.yc.push(d);r.websocket.aa(\"connection\",d.J.I)}else R.X.Hb(a,b),r.websocket.aa(\"connection\",a.J.I)});a.P.on(\"closed\",function(){r.websocket.aa(\"close\",a.J.I);a.P=l});a.P.on(\"error\",function(){a.error=O.Oc;r.websocket.aa(\"error\",[a.J.I,a.error,\"EHOSTUNREACH: Host is unreachable\"])})},\naccept:function(a){a.P||e(new z.e(O.B));var b=a.yc.shift();b.J.D=a.J.D;return b},Gi:function(a,b){var c,d;b?((a.oa===g||a.pa===g)&&e(new z.e(O.vb)),c=a.oa,d=a.pa):(c=a.Fc||0,d=a.Ya||0);return{ma:c,port:d}},Jf:function(a,b,c,d,f,h){if(2===a.type){if(f===g||h===g)f=a.oa,h=a.pa;(f===g||h===g)&&e(new z.e(O.Pd))}else f=a.oa,h=a.pa;var i=R.X.Ob(a,f,h);1===a.type&&((!i||i.p.readyState===i.p.sb||i.p.readyState===i.p.CLOSED)&&e(new z.e(O.vb)),i.p.readyState===i.p.CONNECTING&&e(new z.e(O.bb)));b=b instanceof\nArray||b instanceof ArrayBuffer?b.slice(c,c+d):b.buffer.slice(b.byteOffset+c,b.byteOffset+c+d);if(2===a.type&&(!i||i.p.readyState!==i.p.OPEN)){if(!i||i.p.readyState===i.p.sb||i.p.readyState===i.p.CLOSED)i=R.X.Hb(a,f,h);i.Jb.push(b);return d}try{return i.p.send(b),d}catch(j){e(new z.e(O.B))}},Ff:function(a,b){1===a.type&&a.P&&e(new z.e(O.vb));var c=a.Ua.shift();if(!c){if(1===a.type){var d=R.X.Ob(a,a.oa,a.pa);if(d){if(d.p.readyState===d.p.sb||d.p.readyState===d.p.CLOSED)return l;e(new z.e(O.bb))}e(new z.e(O.vb))}e(new z.e(O.bb))}var d=\nc.data.byteLength||c.data.length,f=c.data.byteOffset||0,h=c.data.buffer||c.data,i=Math.min(b,d),j={buffer:new Uint8Array(h,f,i),ma:c.ma,port:c.port};1===a.type&&i<d&&(c.data=new Uint8Array(h,f+i,d-i),a.Ua.unshift(c));return j}}};function Sb(a,b,c){a=z.T(a);if(!a)return P(O.N),-1;try{return z.write(a,D,b,c)}catch(d){return z.F(d),-1}}function Ub(a,b){Vb=a;Wb=b;if(!Xb)return 1;0==a?(Yb=function(){setTimeout(Zb,b)},$b=\"timeout\"):1==a&&(Yb=function(){ac(Zb)},$b=\"rAF\");return 0}\nfunction bc(a,b,c,d){r.noExitRuntime=k;u(!Xb,\"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters.\");Xb=a;cc=d;var f=dc;Zb=function(){if(!pa)if(0<ec.length){var b=Date.now(),c=ec.shift();c.Ha(c.Cb);if(fc){var j=fc,x=0==j%1?j-1:Math.floor(j);fc=c.ui?x:(8*j+(x+0.5))/9}console.log('main loop blocker \"'+c.name+'\" took '+(Date.now()-b)+\" ms\");r.setStatus&&(b=r.statusMessage||\n\"Please wait...\",c=fc,j=gc.xi,c?c<j?r.setStatus(b + \" (\" + (j - c) + \"/\" + j + \")\"):r.setStatus(b):r.setStatus(\"\"));setTimeout(Zb,0)}else if(!(f<dc))if(hc=hc+1|0,1==Vb&&1<Wb&&0!=hc%Wb)Yb();else{\"timeout\"===$b&&r.vi&&(r.Ca(\"Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!\"),$b=\"\");a:if(!pa&&!(r.preMainLoop&&r.preMainLoop()===m)){try{\"undefined\"!==\ntypeof d?w.ib(\"vi\",a,[d]):w.ib(\"v\",a)}catch(p){if(p instanceof ka)break a;p&&(\"object\"===typeof p&&p.stack)&&r.Ca(\"exception thrown: \"+[p,p.stack]);e(p)}r.postMainLoop&&r.postMainLoop()}f<dc||(\"object\"===typeof SDL&&(SDL.Xc&&SDL.Xc.Bf)&&SDL.Xc.Bf(),Yb())}};b&&0<b?Ub(0,1E3/b):Ub(1,1);Yb();c&&e(\"SimulateInfiniteLoop\")}var Yb=l,$b=\"\",dc=0,Xb=l,cc=0,Vb=0,Wb=0,hc=0,ec=[],gc={},Zb,fc,ic=m,Cb=m,jc=m,kc=g,lc=g,mc=0;\nfunction nc(a){var b=Date.now();if(0===mc)mc=b+1E3/60;else for(;b+2>=mc;)mc+=1E3/60;b=Math.max(mc-b,0);setTimeout(a,b)}function ac(a){\"undefined\"===typeof window?nc(a):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||nc),window.requestAnimationFrame(a))}\nfunction Hb(a){return{jpg:\"image/jpeg\",jpeg:\"image/jpeg\",png:\"image/png\",bmp:\"image/bmp\",ogg:\"audio/ogg\",wav:\"audio/wav\",mp3:\"audio/mpeg\"}[a.substr(a.lastIndexOf(\".\")+1)]}\nfunction Ib(a,b,c){function d(){c?c():e('Loading data file \"'+a+'\" failed.')}var f=new XMLHttpRequest;f.open(\"GET\",a,k);f.responseType=\"arraybuffer\";f.onload=function(){if(200==f.status||0==f.status&&f.response){var c=f.response;u(c,'Loading data file \"'+a+'\" failed (no arrayBuffer).');b(new Uint8Array(c));gb()}else d()};f.onerror=d;f.send(l);fb()}var oc=[];function pc(){var a=r.canvas;oc.forEach(function(b){b(a.width,a.height)})}\nfunction qc(a,b,c){b&&c?(a.Rf=b,a.df=c):(b=a.Rf,c=a.df);var d=b,f=c;r.forcedAspectRatio&&0<r.forcedAspectRatio&&(d/f<r.forcedAspectRatio?d=Math.round(f*r.forcedAspectRatio):f=Math.round(d/r.forcedAspectRatio));if((document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===\na.parentNode&&\"undefined\"!=typeof screen)var h=Math.min(screen.width/d,screen.height/f),d=Math.round(d*h),f=Math.round(f*h);lc?(a.width!=d&&(a.width=d),a.height!=f&&(a.height=f),\"undefined\"!=typeof a.style&&(a.style.removeProperty(\"width\"),a.style.removeProperty(\"height\"))):(a.width!=b&&(a.width=b),a.height!=c&&(a.height=c),\"undefined\"!=typeof a.style&&(d!=b||f!=c?(a.style.setProperty(\"width\",d+\"px\",\"important\"),a.style.setProperty(\"height\",f+\"px\",\"important\")):(a.style.removeProperty(\"width\"),a.style.removeProperty(\"height\"))))}\nvar Db,Eb,Fb,Gb,rc=H(44,\"i8\",G);H(N(\"GMT\"),\"i8\",G);var sc=H(8,\"i32*\",G),tc=H(1,\"i32*\",G),uc=H(1,\"i32*\",G);\nfunction vc(){function a(a){return(a=a.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?a[1]:\"GMT\"}if(!vc.gb){vc.gb=k;E[uc>>2]=60*-(new Date).getTimezoneOffset();var b=new Date(2E3,0,1),c=new Date(2E3,6,1);E[tc>>2]=Number(b.getTimezoneOffset()!=c.getTimezoneOffset());var d=a(b),f=a(c),d=H(N(d),\"i8\",F),f=H(N(f),\"i8\",F);c.getTimezoneOffset()<b.getTimezoneOffset()?(E[sc>>2]=d,E[sc+4>>2]=f):(E[sc>>2]=f,E[sc+4>>2]=d)}}\nfunction wc(a,b){vc();var c=new Date(1E3*E[a>>2]);E[b>>2]=c.getSeconds();E[b+4>>2]=c.getMinutes();E[b+8>>2]=c.getHours();E[b+12>>2]=c.getDate();E[b+16>>2]=c.getMonth();E[b+20>>2]=c.getFullYear()-1900;E[b+24>>2]=c.getDay();var d=new Date(c.getFullYear(),0,1);E[b+28>>2]=(c.getTime()-d.getTime())/864E5|0;E[b+36>>2]=-(60*c.getTimezoneOffset());c=c.getTimezoneOffset()==Math.min(d.getTimezoneOffset(),(new Date(2E3,6,1)).getTimezoneOffset())|0;E[b+32>>2]=c;E[b+40>>2]=E[sc+(c?w.wa:0)>>2];return b}\nr._bitshift64Lshr=xc;function yc(a,b,c){a=z.T(a);if(!a)return P(O.N),-1;try{return z.W(a,D,b,c)}catch(d){return z.F(d),-1}}var zc=H(1,\"i32*\",G);\nfunction Ac(a){var b,c;Ac.gb?(c=E[zc>>2],b=E[c>>2]):(Ac.gb=k,S.USER=\"web_user\",S.PATH=\"/\",S.PWD=\"/\",S.HOME=\"/home/web_user\",S.LANG=\"C\",S._=r.thisProgram,b=H(1024,\"i8\",G),c=H(256,\"i8*\",G),E[c>>2]=b,E[zc>>2]=c);var d=[],f=0,h;for(h in a)if(\"string\"===typeof a[h]){var i=h+\"=\"+a[h];d.push(i);f+=i.length}1024<f&&e(Error(\"Environment size exceeded TOTAL_ENV_SIZE!\"));for(a=0;a<d.length;a++)i=d[a],bb(i,b),E[c+4*a>>2]=b,b+=i.length+1;E[c+4*d.length>>2]=0}var S={};\nfunction Bc(a){if(0===a)return 0;a=y(a);if(!S.hasOwnProperty(a))return 0;Bc.Ec&&Ka(Bc.Ec);Bc.Ec=H(N(S[a]),\"i8\",F);return Bc.Ec}r._memcpy=Cc;function Dc(a){Dc.gb||(C=C+4095&-4096,Dc.gb=k,u(w.Kb),Dc.he=w.Kb,w.Kb=function(){ma(\"cannot dynamically allocate, sbrk now has control\")});var b=C;0!=a&&Dc.he(a);return b}r._memmove=Ec;function Fc(a,b,c){if(a in jb){if(jb[a].length>c-1)return P(O.Qc);bb(jb[a],b);return 0}return P(O.B)}\nfunction Gc(a){Gc.buffer||(Gc.buffer=Ia(256));Fc(a,Gc.buffer,256);return Gc.buffer}function Hc(a,b,c,d,f,h){var i,j=m;Hc.Qa||(Hc.Qa={});if(-1==f){i=Ia(b);if(!i)return-1;Kb(i,0,b);j=k}else{f=z.T(f);if(!f)return-1;try{var x=z.Ra(f,K,a,b,h,c,d);i=x.Af;j=x.fc}catch(p){return z.F(p),-1}}Hc.Qa[i]={lf:i,vf:b,fc:j};return i}z.Nf();Va.unshift({Ha:function(){!r.noFSInit&&!z.jb.Pb&&z.jb()}});Wa.push({Ha:function(){z.wd=m}});Xa.push({Ha:function(){z.Cf()}});r.FS_createFolder=z.ze;r.FS_createPath=z.Ce;\nr.FS_createDataFile=z.Gb;r.FS_createPreloadedFile=z.De;r.FS_createLazyFile=z.Ae;r.FS_createLink=z.Be;r.FS_createDevice=z.na;kb=w.Jd(4);E[kb>>2]=0;Va.unshift({Ha:n()});Xa.push({Ha:n()});var wb=new w.eb;s&&(require(\"fs\"),process.platform.match(/^win/));Va.push({Ha:function(){R.root=z.O(R,{},l)}});\nr.requestFullScreen=function(a,b){function c(){ic=m;var a=d.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===a?(d.$c=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||\nn(),d.$c=d.$c.bind(document),kc&&d.Dc(),ic=k,lc&&(\"undefined\"!=typeof SDL&&(a=Na[SDL.screen+0*w.wa>>2],E[SDL.screen+0*w.wa>>2]=a|8388608),pc())):(a.parentNode.insertBefore(d,a),a.parentNode.removeChild(a),lc&&(\"undefined\"!=typeof SDL&&(a=Na[SDL.screen+0*w.wa>>2],E[SDL.screen+0*w.wa>>2]=a&-8388609),pc()));if(r.onFullScreen)r.onFullScreen(ic);qc(d)}kc=a;lc=b;\"undefined\"===typeof kc&&(kc=k);\"undefined\"===typeof lc&&(lc=m);var d=r.canvas;jc||(jc=k,document.addEventListener(\"fullscreenchange\",c,m),document.addEventListener(\"mozfullscreenchange\",\nc,m),document.addEventListener(\"webkitfullscreenchange\",c,m),document.addEventListener(\"MSFullscreenChange\",c,m));var f=document.createElement(\"div\");d.parentNode.insertBefore(f,d);f.appendChild(d);f.Hf=f.requestFullScreen||f.mozRequestFullScreen||f.msRequestFullscreen||(f.webkitRequestFullScreen?function(){f.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:l);f.Hf()};r.requestAnimationFrame=function(a){ac(a)};r.setCanvasSize=function(a,b,c){qc(r.canvas,a,b);c||pc()};\nr.pauseMainLoop=function(){Yb=l;dc++};r.resumeMainLoop=function(){dc++;var a=Vb,b=Wb,c=Xb;Xb=l;bc(c,0,m,cc);Ub(a,b)};r.getUserMedia=function(){window.sd||(window.sd=navigator.getUserMedia||navigator.mozGetUserMedia);window.sd(g)};Ac(S);Pa=v=w.ec(na);Qa=Pa+Sa;Ra=C=w.ec(Qa);u(Ra<oa,\"TOTAL_MEMORY not big enough for stack\");\nvar Ic=H([8,7,6,6,5,5,5,5,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\n0,0,0,0,0,0,0,0,0,0],\"i8\",3),Jc=H([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,\n0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],\"i8\",3);r.ie={Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};\nr.je={abort:ma,assert:u,min:Ba,invoke_iiii:function(a,b,c,d){try{return r.dynCall_iiii(a,b,c,d)}catch(f){\"number\"!==typeof f&&\"longjmp\"!==f&&e(f),T.setThrew(1,0)}},invoke_i:function(a){try{return r.dynCall_i(a)}catch(b){\"number\"!==typeof b&&\"longjmp\"!==b&&e(b),T.setThrew(1,0)}},invoke_vi:function(a,b){try{r.dynCall_vi(a,b)}catch(c){\"number\"!==typeof c&&\"longjmp\"!==c&&e(c),T.setThrew(1,0)}},invoke_vii:function(a,b,c){try{r.dynCall_vii(a,b,c)}catch(d){\"number\"!==typeof d&&\"longjmp\"!==d&&e(d),T.setThrew(1,\n0)}},invoke_iiiiiii:function(a,b,c,d,f,h,i){try{return r.dynCall_iiiiiii(a,b,c,d,f,h,i)}catch(j){\"number\"!==typeof j&&\"longjmp\"!==j&&e(j),T.setThrew(1,0)}},invoke_ii:function(a,b){try{return r.dynCall_ii(a,b)}catch(c){\"number\"!==typeof c&&\"longjmp\"!==c&&e(c),T.setThrew(1,0)}},invoke_viii:function(a,b,c,d){try{r.dynCall_viii(a,b,c,d)}catch(f){\"number\"!==typeof f&&\"longjmp\"!==f&&e(f),T.setThrew(1,0)}},invoke_v:function(a){try{r.dynCall_v(a)}catch(b){\"number\"!==typeof b&&\"longjmp\"!==b&&e(b),T.setThrew(1,\n0)}},invoke_iiiii:function(a,b,c,d,f){try{return r.dynCall_iiiii(a,b,c,d,f)}catch(h){\"number\"!==typeof h&&\"longjmp\"!==h&&e(h),T.setThrew(1,0)}},invoke_viiiiii:function(a,b,c,d,f,h,i){try{r.dynCall_viiiiii(a,b,c,d,f,h,i)}catch(j){\"number\"!==typeof j&&\"longjmp\"!==j&&e(j),T.setThrew(1,0)}},invoke_iii:function(a,b,c){try{return r.dynCall_iii(a,b,c)}catch(d){\"number\"!==typeof d&&\"longjmp\"!==d&&e(d),T.setThrew(1,0)}},invoke_iiiiii:function(a,b,c,d,f,h){try{return r.dynCall_iiiiii(a,b,c,d,f,h)}catch(i){\"number\"!==\ntypeof i&&\"longjmp\"!==i&&e(i),T.setThrew(1,0)}},invoke_viiii:function(a,b,c,d,f){try{r.dynCall_viiii(a,b,c,d,f)}catch(h){\"number\"!==typeof h&&\"longjmp\"!==h&&e(h),T.setThrew(1,0)}},_utimes:function(a,b){var c;b?(c=1E3*E[b+8>>2],c+=E[b+12>>2]/1E3):c=Date.now();a=y(a);try{return z.Qf(a,c,c),0}catch(d){return z.F(d),-1}},_getuid:Qb,_send:function(a,b,c){return!R.rd(a)?(P(O.N),-1):Sb(a,b,c)},_getcwd:function(a,b){if(0==b)return P(O.B),0;var c=z.Ib();if(b<c.length+1)return P(O.Qc),0;bb(c,a);return a},_mknod:function(a,\nb,c){a=y(a);switch(b&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return P(O.B),-1}try{return z.ha(a,b,c),0}catch(d){return z.F(d),-1}},_lseek:function(a,b,c){a=z.T(a);if(!a)return P(O.N),-1;try{return z.ga(a,b,c)}catch(d){return z.F(d),-1}},_emscripten_set_main_loop_timing:Ub,_access:function(a,b){a=y(a);if(b&-8)return P(O.B),-1;var c;try{c=z.G(a,{ca:k}).k}catch(d){return z.F(d),-1}var f=\"\";b&4&&(f+=\"r\");b&2&&(f+=\"w\");b&1&&(f+=\"x\");return f&&z.Ba(c,f)?(P(O.tb),-1):0},\n_fstat:function(a,b){var c=z.T(a);return!c?(P(O.N),-1):Lb(c.path,b)},_chmod:function(a,b){a=\"string\"!==typeof a?y(a):a;try{return z.hb(a,b),0}catch(c){return z.F(c),-1}},_rmdir:function(a){a=y(a);try{return z.Va(a),0}catch(b){return z.F(b),-1}},_chown:function(a,b,c){\"string\"!==typeof a&&(a=y(a));try{return z.kc(a,b,c),0}catch(d){return z.F(d),-1}},_fcntl:function(a,b,c){a=z.T(a);if(!a)return P(O.N),-1;switch(b){case 0:b=E[c>>2];if(0>b)return P(O.B),-1;var d;try{d=z.open(a.path,a.D,0,b)}catch(f){return z.F(f),\n-1}return d.I;case 1:case 2:return 0;case 3:return a.D;case 4:return b=E[c>>2],a.D|=b,0;case 12:case 12:return b=E[c>>2],za[b+0>>1]=2,0;case 13:case 14:case 13:case 14:return 0;case 8:case 9:return P(O.B),-1;default:return P(O.B),-1}},___buildEnvironment:Ac,_fflush:n(),_pwrite:function(a,b,c,d){a=z.T(a);if(!a)return P(O.N),-1;try{return z.write(a,D,b,c,d)}catch(f){return z.F(f),-1}},_strerror_r:Fc,_localtime_r:wc,_tzset:vc,_open:function(a,b,c){c=E[c>>2];a=y(a);try{return z.open(a,b,c).I}catch(d){return z.F(d),\n-1}},_getpid:function(){return 42},_sbrk:Dc,_usleep:Nb,_emscripten_memcpy_big:function(a,b,c){K.set(K.subarray(b,b+c),a);return a},_unlink:function(a){a=y(a);try{return z.Da(a),0}catch(b){return z.F(b),-1}},_sysconf:function(a){switch(a){case 30:return 4096;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 79:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;\ncase 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;\ncase 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1E3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return\"object\"===typeof navigator?navigator.hardwareConcurrency||1:1}P(O.B);return-1},\n_fchmod:function(a,b){try{return z.Me(a,b),0}catch(c){return z.F(c),-1}},___setErrNo:P,_ftruncate:function(a,b){try{return z.Re(a,b),0}catch(c){return z.F(c),-1}},_mkdir:function(a,b){a=y(a);a=mb(a);\"/\"===a[a.length-1]&&(a=a.substr(0,a.length-1));try{return z.ta(a,b,0),0}catch(c){return z.F(c),-1}},_pread:function(a,b,c,d){a=z.T(a);if(!a)return P(O.N),-1;try{return z.W(a,D,b,c,d)}catch(f){return z.F(f),-1}},_mkport:Rb,_write:Sb,_fsync:function(a){if(z.T(a))return 0;P(O.N);return-1},___errno_location:function(){return kb},\n_stat:Lb,_recv:function(a,b,c){return!R.rd(a)?(P(O.N),-1):yc(a,b,c)},_geteuid:function(){return Qb.apply(l,arguments)},_getenv:Bc,_sleep:function(a){return Nb(1E6*a)},_emscripten_set_main_loop:bc,_abort:function(){r.abort()},_time:function(a){var b=Date.now()/1E3|0;a&&(E[a>>2]=b);return b},_fchown:function(a,b,c){try{return z.Ne(a,b,c),0}catch(d){return z.F(d),-1}},_strerror:Gc,_gettimeofday:function(a){var b=Date.now();E[a>>2]=b/1E3|0;E[a+4>>2]=1E3*(b%1E3)|0;return 0},_munmap:function(a,b){Hc.Qa||\n(Hc.Qa={});var c=Hc.Qa[a];if(!c)return 0;b==c.vf&&(Hc.Qa[a]=l,c.fc&&Ka(c.lf));return 0},_mmap:Hc,_localtime:function(a){return wc(a,rc)},_close:function(a){a=z.T(a);if(!a)return P(O.N),-1;try{return z.close(a),0}catch(b){return z.F(b),-1}},_read:yc,_truncate:function(a,b){\"string\"!==typeof a&&(a=y(a));try{return z.truncate(a,b),0}catch(c){return z.F(c),-1}},STACKTOP:v,STACK_MAX:Qa,tempDoublePtr:ib,ABORT:pa,cttz_i8:Jc,ctlz_i8:Ic,NaN:NaN,Infinity:Infinity};// EMSCRIPTEN_START_ASM\n\nvar T=(function(global,env,buffer) {\n\"use asm\";var a=new global.Int8Array(buffer);var b=new global.Int16Array(buffer);var c=new global.Int32Array(buffer);var d=new global.Uint8Array(buffer);var e=new global.Uint16Array(buffer);var f=new global.Uint32Array(buffer);var g=new global.Float32Array(buffer);var h=new global.Float64Array(buffer);var i=env.STACKTOP|0;var j=env.STACK_MAX|0;var k=env.tempDoublePtr|0;var l=env.ABORT|0;var m=env.cttz_i8|0;var n=env.ctlz_i8|0;var o=0;var p=0;var q=0;var r=0;var s=+env.NaN,t=+env.Infinity;var u=0,v=0,w=0,x=0,y=0.0,z=0,A=0,B=0,C=0.0;var D=0;var E=0;var F=0;var G=0;var H=0;var I=0;var J=0;var K=0;var L=0;var M=0;var N=global.Math.floor;var O=global.Math.abs;var P=global.Math.sqrt;var Q=global.Math.pow;var R=global.Math.cos;var S=global.Math.sin;var T=global.Math.tan;var U=global.Math.acos;var V=global.Math.asin;var W=global.Math.atan;var X=global.Math.atan2;var Y=global.Math.exp;var Z=global.Math.log;var _=global.Math.ceil;var $=global.Math.imul;var aa=env.abort;var ba=env.assert;var ca=env.min;var da=env.invoke_iiii;var ea=env.invoke_i;var fa=env.invoke_vi;var ga=env.invoke_vii;var ha=env.invoke_iiiiiii;var ia=env.invoke_ii;var ja=env.invoke_viii;var ka=env.invoke_v;var la=env.invoke_iiiii;var ma=env.invoke_viiiiii;var na=env.invoke_iii;var oa=env.invoke_iiiiii;var pa=env.invoke_viiii;var qa=env._utimes;var ra=env._getuid;var sa=env._send;var ta=env._getcwd;var ua=env._mknod;var va=env._lseek;var wa=env._emscripten_set_main_loop_timing;var xa=env._access;var ya=env._fstat;var za=env._chmod;var Aa=env._rmdir;var Ba=env._chown;var Ca=env._fcntl;var Da=env.___buildEnvironment;var Ea=env._fflush;var Fa=env._pwrite;var Ga=env._strerror_r;var Ha=env._localtime_r;var Ia=env._tzset;var Ja=env._open;var Ka=env._getpid;var La=env._sbrk;var Ma=env._usleep;var Na=env._emscripten_memcpy_big;var Oa=env._unlink;var Pa=env._sysconf;var Qa=env._fchmod;var Ra=env.___setErrNo;var Sa=env._ftruncate;var Ta=env._mkdir;var Ua=env._pread;var Va=env._mkport;var Wa=env._write;var Xa=env._fsync;var Ya=env.___errno_location;var Za=env._stat;var _a=env._recv;var $a=env._geteuid;var ab=env._getenv;var bb=env._sleep;var cb=env._emscripten_set_main_loop;var db=env._abort;var eb=env._time;var fb=env._fchown;var gb=env._strerror;var hb=env._gettimeofday;var ib=env._munmap;var jb=env._mmap;var kb=env._localtime;var lb=env._close;var mb=env._read;var nb=env._truncate;var ob=0.0;\n// EMSCRIPTEN_START_FUNCS\nfunction Cb(a){a=a|0;var b=0;b=i;i=i+a|0;i=i+15&-16;return b|0}function Db(){return i|0}function Eb(a){a=a|0;i=a}function Fb(a,b){a=a|0;b=b|0;if(!o){o=a;p=b}}function Gb(b){b=b|0;a[k>>0]=a[b>>0];a[k+1>>0]=a[b+1>>0];a[k+2>>0]=a[b+2>>0];a[k+3>>0]=a[b+3>>0]}function Hb(b){b=b|0;a[k>>0]=a[b>>0];a[k+1>>0]=a[b+1>>0];a[k+2>>0]=a[b+2>>0];a[k+3>>0]=a[b+3>>0];a[k+4>>0]=a[b+4>>0];a[k+5>>0]=a[b+5>>0];a[k+6>>0]=a[b+6>>0];a[k+7>>0]=a[b+7>>0]}function Ib(a){a=a|0;D=a}function Jb(){return D|0}function Kb(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;e=i;i=i+16|0;d=e+12|0;f=e+8|0;g=e+4|0;h=e;c[f>>2]=b;if(!(Lb(c[f>>2]|0,16,7)|0))c[f>>2]=(c[f>>2]|0)+7;c[h>>2]=Mb(c[f>>2]|0)|0;c[g>>2]=0;while(1){if((c[g>>2]|0)>=5){b=9;break}if((Lb(c[f>>2]|0,c[24+(c[g>>2]<<2)>>2]|0,c[h>>2]|0)|0)==0?(Nb(a[(c[24+(c[g>>2]<<2)>>2]|0)+(c[h>>2]|0)>>0]|0)|0)==0:0){b=7;break}c[g>>2]=(c[g>>2]|0)+1}if((b|0)==7){c[d>>2]=1;h=c[d>>2]|0;i=e;return h|0}else if((b|0)==9){c[d>>2]=0;h=c[d>>2]|0;i=e;return h|0}return 0}function Lb(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+32|0;l=f+16|0;k=f+12|0;j=f+8|0;g=f+4|0;h=f;c[l>>2]=a;c[k>>2]=b;c[j>>2]=e;c[g>>2]=c[l>>2];c[h>>2]=c[k>>2];while(1){l=c[j>>2]|0;c[j>>2]=l+ -1;if((l|0)<=0)break;if(!(d[c[g>>2]>>0]|0))break;if((d[440+(d[c[g>>2]>>0]|0)>>0]|0|0)!=(d[440+(d[c[h>>2]>>0]|0)>>0]|0|0))break;c[g>>2]=(c[g>>2]|0)+1;c[h>>2]=(c[h>>2]|0)+1}if((c[j>>2]|0)<0){l=0;i=f;return l|0}l=(d[440+(d[c[g>>2]>>0]|0)>>0]|0)-(d[440+(d[c[h>>2]>>0]|0)>>0]|0)|0;i=f;return l|0}function Mb(b){b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;e=d+8|0;f=d+4|0;g=d;c[f>>2]=b;c[g>>2]=c[f>>2];if(!(c[f>>2]|0)){c[e>>2]=0;b=c[e>>2]|0;i=d;return b|0}while(1){b=c[g>>2]|0;if(!(a[c[g>>2]>>0]|0))break;c[g>>2]=b+1}c[e>>2]=1073741823&b-(c[f>>2]|0);b=c[e>>2]|0;i=d;return b|0}function Nb(b){b=b|0;var c=0,e=0;e=i;i=i+16|0;c=e;a[c>>0]=b;i=e;return((d[1224+(d[c>>0]|0)>>0]|0)&70|0)!=0|0}function Ob(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b+4|0;e=b;c[e>>2]=a;if((c[e>>2]|0)>=0&(c[e>>2]|0)<5){c[d>>2]=c[24+(c[e>>2]<<2)>>2];e=c[d>>2]|0;i=b;return e|0}else{c[d>>2]=0;e=c[d>>2]|0;i=b;return e|0}return 0}function Pb(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+32|0;g=f+16|0;h=f+12|0;j=f+8|0;k=f+4|0;l=f;c[h>>2]=a;c[j>>2]=b;c[k>>2]=d;c[l>>2]=e;if((c[h>>2]|0)<0|(c[h>>2]|0)>=10){c[g>>2]=Qb(14581)|0;a=c[g>>2]|0;i=f;return a|0}c[c[j>>2]>>2]=c[48+(c[h>>2]<<2)>>2];c[c[k>>2]>>2]=c[88+(c[h>>2]<<2)>>2];if(c[l>>2]|0)c[88+(c[h>>2]<<2)>>2]=c[48+(c[h>>2]<<2)>>2];c[g>>2]=0;a=c[g>>2]|0;i=f;return a|0}function Qb(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b;e=b+8|0;c[e>>2]=a;e=c[e>>2]|0;a=(vf()|0)+20|0;c[d>>2]=e;c[d+4>>2]=a;tc(21,3216,d);i=b;return 21}function Rb(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;c[e>>2]=0;while(1){if((c[e>>2]|0)>=(c[(c[d>>2]|0)+20>>2]|0))break;c[f>>2]=c[(c[(c[d>>2]|0)+16>>2]|0)+(c[e>>2]<<4)+4>>2];if(c[f>>2]|0)c[(c[(c[f>>2]|0)+4>>2]|0)+4>>2]=c[c[f>>2]>>2];c[e>>2]=(c[e>>2]|0)+1}i=b;return}function Sb(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return c[c[(c[b>>2]|0)+4>>2]>>2]|0}function Tb(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=ub[c[38640+48>>2]&31](c[d>>2]|0)|0;i=b;return a|0}function Ub(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){i=d;return}Bn(c[e>>2]|0,c[(c[f>>2]|0)+28>>2]|0);Xb(c[e>>2]|0,c[c[f>>2]>>2]|0);Xb(c[e>>2]|0,c[(c[f>>2]|0)+4>>2]|0);wn(c[e>>2]|0,c[(c[f>>2]|0)+12>>2]|0);xn(c[e>>2]|0,c[(c[f>>2]|0)+16>>2]|0);Xb(c[e>>2]|0,c[f>>2]|0);i=d;return}function Vb(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+32|0;g=f+16|0;h=f+12|0;j=f+8|0;l=f+4|0;k=f;c[g>>2]=a;c[h>>2]=d;if(!(c[h>>2]|0)){i=f;return}if(!((c[g>>2]|0)!=0?(c[(c[g>>2]|0)+520>>2]|0)!=0:0))e=4;if((e|0)==4?(d=(c[h>>2]|0)+40|0,a=(b[d>>1]|0)+ -1<<16>>16,b[d>>1]=a,(a&65535|0)>0):0){i=f;return}c[j>>2]=c[(c[h>>2]|0)+8>>2];while(1){if(!(c[j>>2]|0))break;c[l>>2]=c[(c[j>>2]|0)+20>>2];if(!((c[g>>2]|0)!=0?(c[(c[g>>2]|0)+520>>2]|0)!=0:0)){c[k>>2]=c[c[j>>2]>>2];gh((c[(c[j>>2]|0)+24>>2]|0)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;g=d+8|0;e=d+4|0;f=d;c[g>>2]=a;c[e>>2]=b;if(!(c[e>>2]|0)){i=d;return}if(c[g>>2]|0){a=c[g>>2]|0;b=c[e>>2]|0;if(c[(c[g>>2]|0)+520>>2]|0){OE(a,b);i=d;return}if(Ck(a,b)|0){c[f>>2]=c[e>>2];c[c[f>>2]>>2]=c[(c[g>>2]|0)+272>>2];c[(c[g>>2]|0)+272>>2]=c[f>>2];a=(c[g>>2]|0)+252|0;c[a>>2]=(c[a>>2]|0)+ -1;i=d;return}}hc(c[e>>2]|0);i=d;return}function Yb(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+16|0;d=b+12|0;f=b+8|0;e=b+4|0;g=b;c[f>>2]=a;c[e>>2]=0;c[g>>2]=Zb()|0;if(c[g>>2]|0){c[d>>2]=0;g=c[d>>2]|0;i=b;return g|0}c[e>>2]=c[32];while(1){if((c[e>>2]|0)==0|(c[f>>2]|0)==0)break;if(!(UE(c[f>>2]|0,c[(c[e>>2]|0)+16>>2]|0)|0))break;c[e>>2]=c[(c[e>>2]|0)+12>>2]}c[d>>2]=c[e>>2];g=c[d>>2]|0;i=b;return g|0}function Zb(){var a=0,b=0,d=0,e=0,f=0;a=i;i=i+16|0;b=a+8|0;d=a+4|0;e=a;if(c[9716]|0){c[b>>2]=0;f=c[b>>2]|0;i=a;return f|0}c[d>>2]=0;if(c[d>>2]|0){c[b>>2]=c[d>>2];f=c[b>>2]|0;i=a;return f|0}c[9718]=1;if(!(c[9719]|0))c[d>>2]=wf()|0;if((((c[d>>2]|0)==0?(c[9719]=1,(c[9722]|0)==0):0)?(c[9722]=8,(c[9661]|0)!=0):0)?(c[9722]|0)==0:0)c[d>>2]=7;if(!(c[d>>2]|0))c[9721]=(c[9721]|0)+1;if(c[d>>2]|0){c[b>>2]=c[d>>2];f=c[b>>2]|0;i=a;return f|0}if((c[9716]|0)==0?(c[9717]|0)==0:0){c[e>>2]=1576;c[9717]=1;f=(c[e>>2]|0)+0|0;e=f+92|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(e|0));xf();if(!(c[9720]|0))c[d>>2]=yf()|0;if(!(c[d>>2]|0)){c[9720]=1;c[d>>2]=zf()|0}if(!(c[d>>2]|0)){Af(c[9711]|0,c[9712]|0,c[9713]|0);c[9716]=1}c[9717]=0}c[9721]=(c[9721]|0)+ -1;if((c[9721]|0)<=0)c[9722]=0;c[b>>2]=c[d>>2];f=c[b>>2]|0;i=a;return f|0}function _b(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=Zb()|0;if(c[h>>2]|0){c[e>>2]=c[h>>2];a=c[e>>2]|0;i=d;return a|0}$b(c[f>>2]|0);b=c[32]|0;if((c[g>>2]|0)!=0|(c[32]|0)==0){c[(c[f>>2]|0)+12>>2]=b;c[32]=c[f>>2]}else{c[(c[f>>2]|0)+12>>2]=c[b+12>>2];c[(c[32]|0)+12>>2]=c[f>>2]}c[e>>2]=0;a=c[e>>2]|0;i=d;return a|0}function $b(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;d=b+4|0;e=b;c[d>>2]=a;if(!(c[d>>2]|0)){i=b;return}if((c[32]|0)==(c[d>>2]|0)){c[32]=c[(c[d>>2]|0)+12>>2];i=b;return}if(!(c[32]|0)){i=b;return}c[e>>2]=c[32];while(1){if(c[(c[e>>2]|0)+12>>2]|0)f=(c[(c[e>>2]|0)+12>>2]|0)!=(c[d>>2]|0);else f=0;a=c[(c[e>>2]|0)+12>>2]|0;if(!f)break;c[e>>2]=a}if((a|0)!=(c[d>>2]|0)){i=b;return}c[(c[e>>2]|0)+12>>2]=c[(c[d>>2]|0)+12>>2];i=b;return}function ac(a){a=a|0;var b=0;b=i;i=i+16|0;c[b>>2]=a;i=b;return 0}function bc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0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>2]&2147483647)|0;a=f;k=c[a+4>>2]|0;j=e;c[j>>2]=c[a>>2];c[j+4>>2]=k;j=e;k=j;k=c[k>>2]|0;j=j+4|0;j=c[j>>2]|0;D=j;i=d;return k|0}function dc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;f=i;i=i+16|0;g=f+8|0;c[f+12>>2]=a;a=f;c[a>>2]=b;c[a+4>>2]=d;c[g>>2]=e;ac(c[g>>2]|0)|0;i=f;return}function ec(){var a=0,b=0,d=0,e=0;b=i;i=i+16|0;e=b+12|0;a=b;Pb(0,e,b+8|0,0)|0;e=c[e>>2]|0;d=a;c[d>>2]=e;c[d+4>>2]=((e|0)<0)<<31>>31;D=c[a+4>>2]|0;i=b;return c[a>>2]|0}function fc(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b+4|0;e=b;c[e>>2]=a;if(Zb()|0){c[d>>2]=0;e=c[d>>2]|0;i=b;return e|0}if((c[e>>2]|0)<=0)a=0;else{a=c[e>>2]|0;a=gc(a,((a|0)<0)<<31>>31)|0}c[d>>2]=a;e=c[d>>2]|0;i=b;return e|0}function gc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;f=d;e=d+8|0;g=f;c[g>>2]=a;c[g+4>>2]=b;g=f;a=f;b=c[a+4>>2]|0;if((c[g>>2]|0)==0&(c[g+4>>2]|0)==0|(b>>>0>0|(b|0)==0&(c[a>>2]|0)>>>0>=2147483392)){c[e>>2]=0;g=c[e>>2]|0;i=d;return g|0}if(c[9660]|0){PE(c[f>>2]|0,e)|0;g=c[e>>2]|0;i=d;return g|0}else{c[e>>2]=ub[c[38640+36>>2]&31](c[f>>2]|0)|0;g=c[e>>2]|0;i=d;return g|0}return 0}function hc(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;if(!(c[d>>2]|0)){i=b;return}if(c[9660]|0){ic(0,0-(Tb(c[d>>2]|0)|0)|0);ic(9,-1);rb[c[38640+40>>2]&31](c[d>>2]|0);i=b;return}else{rb[c[38640+40>>2]&31](c[d>>2]|0);i=b;return}}function ic(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;a=48+(c[e>>2]<<2)|0;c[a>>2]=(c[a>>2]|0)+(c[f>>2]|0);if((c[48+(c[e>>2]<<2)>>2]|0)<=(c[88+(c[e>>2]<<2)>>2]|0)){i=d;return}c[88+(c[e>>2]<<2)>>2]=c[48+(c[e>>2]<<2)>>2];i=d;return}function jc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;e=d+8|0;g=d+4|0;f=d;c[g>>2]=a;c[f>>2]=b;if(Zb()|0){c[e>>2]=0;a=c[e>>2]|0;i=d;return a|0}if((c[f>>2]|0)<0)c[f>>2]=0;a=c[f>>2]|0;c[e>>2]=kc(c[g>>2]|0,a,((a|0)<0)<<31>>31)|0;a=c[e>>2]|0;i=d;return a|0}function kc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;k=i;i=i+32|0;f=k+28|0;g=k+24|0;e=k;l=k+20|0;j=k+16|0;m=k+12|0;h=k+8|0;c[g>>2]=a;a=e;c[a>>2]=b;c[a+4>>2]=d;d=e;b=c[d>>2]|0;d=c[d+4>>2]|0;if(!(c[g>>2]|0)){c[f>>2]=gc(b,d)|0;a=c[f>>2]|0;i=k;return a|0}if((b|0)==0&(d|0)==0){hc(c[g>>2]|0);c[f>>2]=0;a=c[f>>2]|0;i=k;return a|0}a=e;b=c[a+4>>2]|0;if(b>>>0>0|(b|0)==0&(c[a>>2]|0)>>>0>=2147483392){c[f>>2]=0;a=c[f>>2]|0;i=k;return a|0}c[l>>2]=Tb(c[g>>2]|0)|0;c[j>>2]=ub[c[38640+52>>2]&31](c[e>>2]|0)|0;do if((c[l>>2]|0)!=(c[j>>2]|0)){if(!(c[9660]|0)){c[h>>2]=zb[c[38640+44>>2]&63](c[g>>2]|0,c[j>>2]|0)|0;break}Bg(5,c[e>>2]|0);c[m>>2]=(c[j>>2]|0)-(c[l>>2]|0);b=ME(0)|0;n=((b|0)<0)<<31>>31;d=144|0;a=c[m>>2]|0;a=ZE(c[d>>2]|0,c[d+4>>2]|0,a|0,((a|0)<0)<<31>>31|0)|0;d=D;if((n|0)>(d|0)|(n|0)==(d|0)&b>>>0>=a>>>0)NE(c[m>>2]|0);c[h>>2]=zb[c[38640+44>>2]&63](c[g>>2]|0,c[j>>2]|0)|0;if((c[h>>2]|0)==0&(c[38]|0)!=0){NE(c[e>>2]|0);c[h>>2]=zb[c[38640+44>>2]&63](c[g>>2]|0,c[j>>2]|0)|0}if(c[h>>2]|0){c[j>>2]=Tb(c[h>>2]|0)|0;ic(0,(c[j>>2]|0)-(c[l>>2]|0)|0)}}else c[h>>2]=c[g>>2];while(0);c[f>>2]=c[h>>2];n=c[f>>2]|0;i=k;return n|0}function lc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;f=e+12|0;g=e+8|0;h=e;c[g>>2]=a;a=h;c[a>>2]=b;c[a+4>>2]=d;if(Zb()|0){c[f>>2]=0;a=c[f>>2]|0;i=e;return a|0}else{a=h;c[f>>2]=kc(c[g>>2]|0,c[a>>2]|0,c[a+4>>2]|0)|0;a=c[f>>2]|0;i=e;return a|0}return 0}function mc(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+128|0;f=e+40|0;k=e+36|0;j=e+32|0;g=e+28|0;h=e;c[k>>2]=b;c[j>>2]=d;if(Zb()|0){c[f>>2]=0;b=c[f>>2]|0;i=e;return b|0}else{nc(h,e+44|0,70,1e9);a[h+24>>0]=2;oc(h,0,c[k>>2]|0,c[j>>2]|0);c[g>>2]=pc(h)|0;c[f>>2]=c[g>>2];b=c[f>>2]|0;i=e;return b|0}return 0}function nc(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0;g=i;i=i+16|0;h=g+12|0;l=g+8|0;k=g+4|0;j=g;c[h>>2]=b;c[l>>2]=d;c[k>>2]=e;c[j>>2]=f;b=c[l>>2]|0;c[(c[h>>2]|0)+4>>2]=b;c[(c[h>>2]|0)+8>>2]=b;c[c[h>>2]>>2]=0;c[(c[h>>2]|0)+12>>2]=0;c[(c[h>>2]|0)+16>>2]=c[k>>2];c[(c[h>>2]|0)+20>>2]=c[j>>2];a[(c[h>>2]|0)+24>>0]=1;a[(c[h>>2]|0)+25>>0]=0;i=g;return}function oc(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var j=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0.0;m=i;i=i+272|0;Y=m+172|0;ra=m+168|0;q=m+164|0;z=m+160|0;p=m+156|0;I=m+152|0;A=m+148|0;J=m+144|0;G=m+140|0;o=m+136|0;r=m+264|0;s=m+263|0;t=m+262|0;w=m+261|0;u=m+260|0;v=m+259|0;B=m+258|0;C=m+257|0;n=m+256|0;F=m+255|0;x=m+254|0;ia=m+253|0;Q=m+252|0;ma=m+32|0;P=m+24|0;E=m+132|0;X=m+128|0;ja=m+124|0;W=m+120|0;S=m+116|0;V=m+112|0;j=m+108|0;R=m+16|0;Z=m+251|0;U=m+250|0;y=m+104|0;H=m+180|0;qa=m+8|0;pa=m+100|0;oa=m+96|0;na=m+179|0;ka=m+92|0;la=m+178|0;T=m;$=m+88|0;_=m+84|0;ea=m+80|0;ha=m+76|0;ca=m+72|0;da=m+68|0;ba=m+64|0;ga=m+60|0;fa=m+177|0;K=m+176|0;aa=m+56|0;L=m+52|0;M=m+48|0;N=m+44|0;O=m+40|0;c[Y>>2]=b;c[ra>>2]=e;c[q>>2]=f;c[z>>2]=g;a[F>>0]=0;c[W>>2]=0;c[y>>2]=0;c[I>>2]=0;if(c[ra>>2]|0){g=c[ra>>2]&2;a[x>>0]=g;if(g&255){b=c[z>>2]|0;e=c[b>>2]|0;g=c[e>>2]|0;c[b>>2]=e+4;c[y>>2]=g}a[ia>>0]=c[ra>>2]&1}else{a[ia>>0]=0;a[x>>0]=0}a:while(1){g=a[c[q>>2]>>0]|0;c[p>>2]=g;if(!g){l=274;break}if((c[p>>2]|0)!=37){c[I>>2]=c[q>>2];do{c[q>>2]=(c[q>>2]|0)+1;if(!(a[c[q>>2]>>0]|0))break}while((a[c[q>>2]>>0]|0)!=37);Vm(c[Y>>2]|0,c[I>>2]|0,(c[q>>2]|0)-(c[I>>2]|0)|0);if(!(a[c[q>>2]>>0]|0)){l=274;break}}g=(c[q>>2]|0)+1|0;c[q>>2]=g;g=a[g>>0]|0;c[p>>2]=g;if(!g){l=13;break}a[v>>0]=0;a[u>>0]=0;a[w>>0]=0;a[t>>0]=0;a[s>>0]=0;a[r>>0]=0;a[n>>0]=0;do{switch(c[p>>2]|0){case 45:{a[r>>0]=1;break};case 43:{a[s>>0]=1;break};case 32:{a[t>>0]=1;break};case 33:{a[u>>0]=1;break};case 48:{a[v>>0]=1;break};case 35:{a[w>>0]=1;break};default:a[n>>0]=1}if(a[n>>0]|0)break;g=(c[q>>2]|0)+1|0;c[q>>2]=g;g=a[g>>0]|0;c[p>>2]=g}while((g|0)!=0);c[o>>2]=0;b:do if((c[p>>2]|0)==42){if(a[x>>0]|0){g=HE(c[y>>2]|0)|0;c[o>>2]=g}else{b=c[z>>2]|0;e=c[b>>2]|0;g=c[e>>2]|0;c[b>>2]=e+4;c[o>>2]=g}if((c[o>>2]|0)<0){a[r>>0]=1;c[o>>2]=0-(c[o>>2]|0)}g=(c[q>>2]|0)+1|0;c[q>>2]=g;c[p>>2]=a[g>>0]}else while(1){if(!((c[p>>2]|0)>=48&(c[p>>2]|0)<=57))break b;c[o>>2]=((c[o>>2]|0)*10|0)+(c[p>>2]|0)-48;g=(c[q>>2]|0)+1|0;c[q>>2]=g;c[p>>2]=a[g>>0]}while(0);c:do if((c[p>>2]|0)==46){c[A>>2]=0;g=(c[q>>2]|0)+1|0;c[q>>2]=g;c[p>>2]=a[g>>0];if((c[p>>2]|0)!=42)while(1){if(!((c[p>>2]|0)>=48&(c[p>>2]|0)<=57))break c;c[A>>2]=((c[A>>2]|0)*10|0)+(c[p>>2]|0)-48;g=(c[q>>2]|0)+1|0;c[q>>2]=g;c[p>>2]=a[g>>0]}if(a[x>>0]|0){g=HE(c[y>>2]|0)|0;c[A>>2]=g}else{b=c[z>>2]|0;e=c[b>>2]|0;g=c[e>>2]|0;c[b>>2]=e+4;c[A>>2]=g}if((c[A>>2]|0)<0)c[A>>2]=0-(c[A>>2]|0);g=(c[q>>2]|0)+1|0;c[q>>2]=g;c[p>>2]=a[g>>0]}else c[A>>2]=-1;while(0);do if((c[p>>2]|0)==108){a[B>>0]=1;g=(c[q>>2]|0)+1|0;c[q>>2]=g;c[p>>2]=a[g>>0];if((c[p>>2]|0)==108){a[C>>0]=1;g=(c[q>>2]|0)+1|0;c[q>>2]=g;c[p>>2]=a[g>>0];break}else{a[C>>0]=0;break}}else{a[C>>0]=0;a[B>>0]=0}while(0);c[E>>2]=38392;a[F>>0]=0;c[G>>2]=0;while(1){if((c[G>>2]|0)>=23)break;ra=c[G>>2]|0;if((c[p>>2]|0)==(a[38392+((c[G>>2]|0)*6|0)>>0]|0)){l=53;break}c[G>>2]=ra+1}if((l|0)==53){l=0;c[E>>2]=38392+(ra*6|0);if((d[ia>>0]|0)==0?(d[(c[E>>2]|0)+2>>0]&2|0)!=0:0){l=274;break}a[F>>0]=a[(c[E>>2]|0)+3>>0]|0}d:do switch(d[F>>0]|0){case 14:{a[C>>0]=0;a[B>>0]=1;l=59;break};case 1:case 16:{l=59;break};case 4:case 3:case 2:{if(a[x>>0]|0)h[P>>3]=+IE(c[y>>2]|0);else{g=c[z>>2]|0;b=c[g>>2]|0;c[k>>2]=c[b>>2];c[k+4>>2]=c[b+4>>2];sa=+h[k>>3];c[g>>2]=b+8;h[P>>3]=sa}if((c[A>>2]|0)<0)c[A>>2]=6;do if(!(+h[P>>3]<0.0)){if(a[s>>0]|0){a[Q>>0]=43;break}if(a[t>>0]|0){a[Q>>0]=32;break}else{a[Q>>0]=0;break}}else{h[P>>3]=-+h[P>>3];a[Q>>0]=45}while(0);if((d[F>>0]|0)==4&(c[A>>2]|0)>0)c[A>>2]=(c[A>>2]|0)+ -1;c[G>>2]=c[A>>2];h[R>>3]=.5;while(1){if((c[G>>2]|0)<=0)break;c[G>>2]=(c[G>>2]|0)+ -1;h[R>>3]=+h[R>>3]*.1}if((d[F>>0]|0)==2)h[P>>3]=+h[P>>3]+ +h[R>>3];c[S>>2]=0;if($w(+h[P>>3])|0){c[I>>2]=38600;c[J>>2]=3;break d}if(+h[P>>3]>0.0){h[T>>3]=1.0;while(1){if(!((c[S>>2]|0)<=350?+h[P>>3]>=+h[T>>3]*1.0e+100:0))break;h[T>>3]=+h[T>>3]*1.0e+100;c[S>>2]=(c[S>>2]|0)+100}while(1){if(!((c[S>>2]|0)<=350?+h[P>>3]>=+h[T>>3]*1.0e+64:0))break;h[T>>3]=+h[T>>3]*1.0e+64;c[S>>2]=(c[S>>2]|0)+64}while(1){if(!((c[S>>2]|0)<=350?+h[P>>3]>=+h[T>>3]*1.0e8:0))break;h[T>>3]=+h[T>>3]*1.0e8;c[S>>2]=(c[S>>2]|0)+8}while(1){if(+h[P>>3]>=+h[T>>3]*10.0)ra=(c[S>>2]|0)<=350;else ra=0;sa=+h[T>>3];if(!ra)break;h[T>>3]=sa*10.0;c[S>>2]=(c[S>>2]|0)+1}h[P>>3]=+h[P>>3]/sa;while(1){if(!(+h[P>>3]<1.0e-8))break;h[P>>3]=+h[P>>3]*1.0e8;c[S>>2]=(c[S>>2]|0)-8}while(1){if(!(+h[P>>3]<1.0))break;h[P>>3]=+h[P>>3]*10.0;c[S>>2]=(c[S>>2]|0)+ -1}if((c[S>>2]|0)>350){do if((a[Q>>0]|0)!=45)if((a[Q>>0]|0)==43){c[I>>2]=38616;break}else{c[I>>2]=38624;break}else c[I>>2]=38608;while(0);c[J>>2]=Mb(c[I>>2]|0)|0;break d}}c[I>>2]=H;if((d[F>>0]|0)!=2?(h[P>>3]=+h[P>>3]+ +h[R>>3],+h[P>>3]>=10.0):0){h[P>>3]=+h[P>>3]*.1;c[S>>2]=(c[S>>2]|0)+1}e:do if((d[F>>0]|0)==4){a[U>>0]=((a[w>>0]|0)!=0^1)&1;do if((c[S>>2]|0)>=-4){if((c[S>>2]|0)>(c[A>>2]|0))break;c[A>>2]=(c[A>>2]|0)-(c[S>>2]|0);a[F>>0]=2;break e}while(0);a[F>>0]=3}else a[U>>0]=a[u>>0]|0;while(0);if((d[F>>0]|0)==3)c[V>>2]=0;else c[V>>2]=c[S>>2];if((((c[V>>2]|0)>0?c[V>>2]|0:0)+(c[A>>2]|0)+(c[o>>2]|0)|0)>55?(g=((c[V>>2]|0)>0?c[V>>2]|0:0)+(c[A>>2]|0)+(c[o>>2]|0)+15|0,g=gc(g,((g|0)<0)<<31>>31)|0,c[W>>2]=g,c[I>>2]=g,(c[I>>2]|0)==0):0){l=167;break a}c[X>>2]=c[I>>2];c[j>>2]=16+((d[u>>0]|0)*10|0);a[Z>>0]=((c[A>>2]|0)>0?1:0)|d[w>>0]|d[u>>0];if(a[Q>>0]|0){b=a[Q>>0]|0;g=c[I>>2]|0;c[I>>2]=g+1;a[g>>0]=b}f:do if((c[V>>2]|0)<0){g=c[I>>2]|0;c[I>>2]=g+1;a[g>>0]=48}else while(1){if((c[V>>2]|0)<0)break f;b=JE(P,j)|0;g=c[I>>2]|0;c[I>>2]=g+1;a[g>>0]=b;c[V>>2]=(c[V>>2]|0)+ -1}while(0);if(a[Z>>0]|0){g=c[I>>2]|0;c[I>>2]=g+1;a[g>>0]=46}c[V>>2]=(c[V>>2]|0)+1;while(1){if((c[V>>2]|0)>=0)break;g=c[I>>2]|0;c[I>>2]=g+1;a[g>>0]=48;c[A>>2]=(c[A>>2]|0)+ -1;c[V>>2]=(c[V>>2]|0)+1}while(1){g=c[A>>2]|0;c[A>>2]=g+ -1;if((g|0)<=0)break;b=JE(P,j)|0;g=c[I>>2]|0;c[I>>2]=g+1;a[g>>0]=b}do if(d[U>>0]|0){if(!(d[Z>>0]|0))break;while(1){ra=(c[I>>2]|0)+ -1|0;if((a[(c[I>>2]|0)+ -1>>0]|0)!=48)break;c[I>>2]=ra;a[ra>>0]=0}if((a[ra>>0]|0)!=46)break;ra=c[I>>2]|0;if(a[u>>0]|0){c[I>>2]=ra+1;a[ra>>0]=48;break}else{g=ra+ -1|0;c[I>>2]=g;a[g>>0]=0;break}}while(0);if((d[F>>0]|0)==3){ra=a[38552+(d[(c[E>>2]|0)+4>>0]|0)>>0]|0;g=c[I>>2]|0;c[I>>2]=g+1;a[g>>0]=ra;g=(c[S>>2]|0)<0;ra=c[I>>2]|0;c[I>>2]=ra+1;if(g){a[ra>>0]=45;c[S>>2]=0-(c[S>>2]|0)}else a[ra>>0]=43;if((c[S>>2]|0)>=100){b=((c[S>>2]|0)/100|0)+48&255;g=c[I>>2]|0;c[I>>2]=g+1;a[g>>0]=b;c[S>>2]=(c[S>>2]|0)%100|0}g=((c[S>>2]|0)/10|0)+48&255;b=c[I>>2]|0;c[I>>2]=b+1;a[b>>0]=g;b=((c[S>>2]|0)%10|0)+48&255;g=c[I>>2]|0;c[I>>2]=g+1;a[g>>0]=b}a[c[I>>2]>>0]=0;c[J>>2]=(c[I>>2]|0)-(c[X>>2]|0);c[I>>2]=c[X>>2];if((d[v>>0]|0)==0|(a[r>>0]|0)!=0)break d;if((c[J>>2]|0)>=(c[o>>2]|0))break d;c[_>>2]=(c[o>>2]|0)-(c[J>>2]|0);c[$>>2]=c[o>>2];while(1){if((c[$>>2]|0)<(c[_>>2]|0))break;a[(c[I>>2]|0)+(c[$>>2]|0)>>0]=a[(c[I>>2]|0)+((c[$>>2]|0)-(c[_>>2]|0))>>0]|0;c[$>>2]=(c[$>>2]|0)+ -1}c[$>>2]=(a[Q>>0]|0)!=0&1;while(1){g=c[_>>2]|0;c[_>>2]=g+ -1;if(!g)break;g=c[$>>2]|0;c[$>>2]=g+1;a[(c[I>>2]|0)+g>>0]=48}c[J>>2]=c[o>>2];break};case 5:{if(!(a[x>>0]|0)){b=c[(c[Y>>2]|0)+12>>2]|0;e=c[z>>2]|0;f=c[e>>2]|0;g=c[f>>2]|0;c[e>>2]=f+4;c[g>>2]=b}c[o>>2]=0;c[J>>2]=0;break};case 8:{a[H>>0]=37;c[I>>2]=H;c[J>>2]=1;break};case 9:{if(a[x>>0]|0){c[I>>2]=KE(c[y>>2]|0)|0;if(c[I>>2]|0)ra=a[c[I>>2]>>0]|0;else ra=0;c[p>>2]=ra}else{b=c[z>>2]|0;e=c[b>>2]|0;g=c[e>>2]|0;c[b>>2]=e+4;c[p>>2]=g}if((c[A>>2]|0)>1){c[o>>2]=(c[o>>2]|0)-((c[A>>2]|0)-1);if(!((c[o>>2]|0)<=1|(a[r>>0]|0)!=0)){LE(c[Y>>2]|0,(c[o>>2]|0)-1|0,32);c[o>>2]=0}LE(c[Y>>2]|0,(c[A>>2]|0)-1|0,c[p>>2]&255)}c[J>>2]=1;a[H>>0]=c[p>>2];c[I>>2]=H;break};case 7:case 6:{if(a[x>>0]|0)c[I>>2]=KE(c[y>>2]|0)|0;else{b=c[z>>2]|0;e=c[b>>2]|0;g=c[e>>2]|0;c[b>>2]=e+4;c[I>>2]=g}if(c[I>>2]|0){if(!((d[F>>0]|0)!=7|(a[x>>0]|0)!=0))c[W>>2]=c[I>>2]}else c[I>>2]=1216;if((c[A>>2]|0)<0){c[J>>2]=Mb(c[I>>2]|0)|0;break d}c[J>>2]=0;while(1){if((c[J>>2]|0)>=(c[A>>2]|0))break d;if(!(a[(c[I>>2]|0)+(c[J>>2]|0)>>0]|0))break d;c[J>>2]=(c[J>>2]|0)+1}};case 15:case 11:case 10:{a[K>>0]=(d[F>>0]|0)==15?34:39;if(a[x>>0]|0)c[aa>>2]=KE(c[y>>2]|0)|0;else{b=c[z>>2]|0;e=c[b>>2]|0;g=c[e>>2]|0;c[b>>2]=e+4;c[aa>>2]=g}c[ba>>2]=(c[aa>>2]|0)==0&1;if(c[ba>>2]|0)c[aa>>2]=(d[F>>0]|0)==11?9840:38632;c[ca>>2]=c[A>>2];c[da>>2]=0;c[ea>>2]=0;while(1){if(!(c[ca>>2]|0))break;g=a[(c[aa>>2]|0)+(c[ea>>2]|0)>>0]|0;a[fa>>0]=g;if(!(g<<24>>24))break;if((a[fa>>0]|0)==(a[K>>0]|0))c[da>>2]=(c[da>>2]|0)+1;c[ea>>2]=(c[ea>>2]|0)+1;c[ca>>2]=(c[ca>>2]|0)+ -1}if(c[ba>>2]|0)ra=0;else ra=(d[F>>0]|0)==11;c[ga>>2]=ra&1;c[da>>2]=(c[da>>2]|0)+((c[ea>>2]|0)+1+(c[ga>>2]<<1));if((c[da>>2]|0)>70){g=c[da>>2]|0;g=gc(g,((g|0)<0)<<31>>31)|0;c[W>>2]=g;c[I>>2]=g;if(!(c[I>>2]|0)){l=247;break a}}else c[I>>2]=H;c[ha>>2]=0;if(c[ga>>2]|0){b=a[K>>0]|0;g=c[ha>>2]|0;c[ha>>2]=g+1;a[(c[I>>2]|0)+g>>0]=b}c[ca>>2]=c[ea>>2];c[ea>>2]=0;while(1){if((c[ea>>2]|0)>=(c[ca>>2]|0))break;b=a[(c[aa>>2]|0)+(c[ea>>2]|0)>>0]|0;a[fa>>0]=b;g=c[ha>>2]|0;c[ha>>2]=g+1;a[(c[I>>2]|0)+g>>0]=b;if((a[fa>>0]|0)==(a[K>>0]|0)){b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>2]|0;ra=c[ra+4>>2]|0;if((c[qa+4>>2]|0)<0){if((f|0)==0&(ra|0)==-2147483648){g=ma;c[g>>2]=0;c[g+4>>2]=-2147483648}else{b=qa;b=ZE(0,0,c[b>>2]|0,c[b+4>>2]|0)|0;g=ma;c[g>>2]=b;c[g+4>>2]=D}a[Q>>0]=45;break}g=ma;c[g>>2]=f;c[g+4>>2]=ra;if(a[s>>0]|0){a[Q>>0]=43;break}if(a[t>>0]|0){a[Q>>0]=32;break}else{a[Q>>0]=0;break}}else{do if(!ra){ra=c[z>>2]|0;if(a[C>>0]|0){g=c[ra>>2]|0;b=g;e=c[b>>2]|0;b=c[b+4>>2]|0;c[ra>>2]=g+8;g=ma;c[g>>2]=e;c[g+4>>2]=b;break}else{g=c[ra>>2]|0;b=c[g>>2]|0;c[ra>>2]=g+4;g=ma;c[g>>2]=b;c[g+4>>2]=0;break}}else{b=HE(c[y>>2]|0)|0;g=ma;c[g>>2]=b;c[g+4>>2]=D}while(0);a[Q>>0]=0}while(0);g=ma;if((c[g>>2]|0)==0&(c[g+4>>2]|0)==0)a[w>>0]=0;if((d[v>>0]|0)!=0?(c[A>>2]|0)<((c[o>>2]|0)-((a[Q>>0]|0)!=0&1)|0):0)c[A>>2]=(c[o>>2]|0)-((a[Q>>0]|0)!=0&1);if((c[A>>2]|0)>=60){c[ja>>2]=(c[A>>2]|0)+10;g=c[ja>>2]|0;g=gc(g,((g|0)<0)<<31>>31)|0;c[W>>2]=g;c[X>>2]=g;if(!(c[X>>2]|0)){l=89;break}}else{c[ja>>2]=70;c[X>>2]=H}c[I>>2]=(c[X>>2]|0)+((c[ja>>2]|0)-1);if((d[F>>0]|0)==16){g=ma;g=nF(c[g>>2]|0,c[g+4>>2]|0,10,0)|0;c[pa>>2]=g;if(!((c[pa>>2]|0)<4?(g=ma,g=mF(c[g>>2]|0,c[g+4>>2]|0,10,0)|0,g=nF(g|0,D|0,10,0)|0,!((g|0)==1&(D|0)==0)):0))c[pa>>2]=0;g=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c[Y>>2]|0,c[I>>2]|0,c[J>>2]|0);if((c[o>>2]|0)>0?(d[r>>0]|0)!=0:0)LE(c[Y>>2]|0,c[o>>2]|0,32);if(c[W>>2]|0){hc(c[W>>2]|0);c[W>>2]=0}c[q>>2]=(c[q>>2]|0)+1}if((l|0)==13){Vm(c[Y>>2]|0,38384,1);i=m;return}else if((l|0)==89){Ym(c[Y>>2]|0,1);i=m;return}else if((l|0)==167){Ym(c[Y>>2]|0,1);i=m;return}else if((l|0)==247){Ym(c[Y>>2]|0,1);i=m;return}else if((l|0)==274){i=m;return}}function pc(b){b=b|0;var e=0,f=0,g=0;f=i;i=i+16|0;e=f;c[e>>2]=b;do if(((c[(c[e>>2]|0)+8>>2]|0)!=0?(a[(c[(c[e>>2]|0)+8>>2]|0)+(c[(c[e>>2]|0)+12>>2]|0)>>0]=0,(d[(c[e>>2]|0)+24>>0]|0|0)!=0):0)?(c[(c[e>>2]|0)+8>>2]|0)==(c[(c[e>>2]|0)+4>>2]|0):0){b=c[e>>2]|0;if((d[(c[e>>2]|0)+24>>0]|0|0)==1){g=(c[(c[e>>2]|0)+12>>2]|0)+1|0;b=Qe(c[b>>2]|0,g,((g|0)<0)<<31>>31)|0;c[(c[e>>2]|0)+8>>2]=b}else{g=fc((c[b+12>>2]|0)+1|0)|0;c[(c[e>>2]|0)+8>>2]=g}b=c[e>>2]|0;if(c[(c[e>>2]|0)+8>>2]|0){dF(c[b+8>>2]|0,c[(c[e>>2]|0)+4>>2]|0,(c[(c[e>>2]|0)+12>>2]|0)+1|0)|0;break}else{Ym(b,1);break}}while(0);i=f;return c[(c[e>>2]|0)+8>>2]|0}function qc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+32|0;e=d+28|0;h=d+24|0;g=d+8|0;f=d;c[h>>2]=a;if(Zb()|0){c[e>>2]=0;a=c[e>>2]|0;i=d;return a|0}else{c[g>>2]=b;c[f>>2]=mc(c[h>>2]|0,g)|0;c[e>>2]=c[f>>2];a=c[e>>2]|0;i=d;return a|0}return 0}function rc(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;l=i;i=i+48|0;h=l+44|0;m=l+40|0;n=l+36|0;g=l+32|0;k=l+28|0;j=l;c[m>>2]=b;c[n>>2]=d;c[g>>2]=e;c[k>>2]=f;f=c[n>>2]|0;if((c[m>>2]|0)<=0){c[h>>2]=f;n=c[h>>2]|0;i=l;return n|0}else{nc(j,f,c[m>>2]|0,0);a[j+24>>0]=0;oc(j,0,c[g>>2]|0,c[k>>2]|0);c[h>>2]=pc(j)|0;n=c[h>>2]|0;i=l;return n|0}return 0}function sc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;g=i;i=i+32|0;l=g+28|0;k=g+24|0;j=g+20|0;f=g+16|0;h=g;c[l>>2]=a;c[k>>2]=b;c[j>>2]=d;c[h>>2]=e;c[f>>2]=rc(c[l>>2]|0,c[k>>2]|0,c[j>>2]|0,h)|0;i=g;return c[f>>2]|0}function tc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+32|0;g=e+20|0;h=e+16|0;f=e;c[g>>2]=a;c[h>>2]=b;if(!(c[9723]|0)){i=e;return}c[f>>2]=d;uc(c[g>>2]|0,c[h>>2]|0,f);i=e;return}function uc(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+256|0;j=f+36|0;k=f+32|0;g=f+28|0;h=f;c[j>>2]=b;c[k>>2]=d;c[g>>2]=e;nc(h,f+40|0,210,0);a[h+24>>0]=0;oc(h,0,c[k>>2]|0,c[g>>2]|0);g=c[9723]|0;e=c[9724]|0;d=c[j>>2]|0;b=pc(h)|0;vb[g&63](e,d,b);i=f;return}function vc(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+288|0;j=f+12|0;m=f+8|0;g=f+272|0;h=f+4|0;k=f;l=f+16|0;c[j>>2]=b;c[m>>2]=e;c[h>>2]=c[m>>2];if((c[j>>2]|0)<=0){a[176]=0;i=f;return}if(!(a[176]|0)){a[178]=0;a[177]=0;wc(Yb(0)|0,256,l)|0;c[k>>2]=0;while(1){if((c[k>>2]|0)>=256)break;a[(c[k>>2]|0)+179>>0]=c[k>>2];c[k>>2]=(c[k>>2]|0)+1}c[k>>2]=0;while(1){if((c[k>>2]|0)>=256)break;a[178]=(d[178]|0)+((d[(c[k>>2]|0)+179>>0]|0)+(a[l+(c[k>>2]|0)>>0]|0));a[g>>0]=a[(d[178]|0)+179>>0]|0;a[(d[178]|0)+179>>0]=a[(c[k>>2]|0)+179>>0]|0;a[(c[k>>2]|0)+179>>0]=a[g>>0]|0;c[k>>2]=(c[k>>2]|0)+1}a[176]=1}do{a[177]=(a[177]|0)+1<<24>>24;a[g>>0]=a[(d[177]|0)+179>>0]|0;a[178]=(d[178]|0)+(d[g>>0]|0);a[(d[177]|0)+179>>0]=a[(d[178]|0)+179>>0]|0;a[(d[178]|0)+179>>0]=a[g>>0]|0;a[g>>0]=(d[g>>0]|0)+(d[(d[177]|0)+179>>0]|0);b=a[(d[g>>0]|0)+179>>0]|0;m=c[h>>2]|0;c[h>>2]=m+1;a[m>>0]=b;m=(c[j>>2]|0)+ -1|0;c[j>>2]=m}while((m|0)!=0);i=f;return}function wc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;h=e+8|0;g=e+4|0;f=e;c[h>>2]=a;c[g>>2]=b;c[f>>2]=d;a=pb[c[(c[h>>2]|0)+56>>2]&31](c[h>>2]|0,c[g>>2]|0,c[f>>2]|0)|0;i=e;return a|0}function xc(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;j=e+12|0;h=e+8|0;g=e+4|0;f=e;c[j>>2]=a;c[h>>2]=b;c[g>>2]=c[j>>2];c[f>>2]=c[h>>2];while(1){if(d[c[g>>2]>>0]|0)a=(d[440+(d[c[g>>2]>>0]|0)>>0]|0|0)==(d[440+(d[c[f>>2]>>0]|0)>>0]|0|0);else a=0;b=c[g>>2]|0;if(!a)break;c[g>>2]=b+1;c[f>>2]=(c[f>>2]|0)+1}i=e;return(d[440+(d[b>>0]|0)>>0]|0)-(d[440+(d[c[f>>2]>>0]|0)>>0]|0)|0}function yc(){var a=0,b=0;a=i;i=i+16|0;b=a;c[b>>2]=0;while(1){if((c[b>>2]|0)>>>0>=4)break;_b(696+((c[b>>2]|0)*88|0)|0,(c[b>>2]|0)==0&1)|0;c[b>>2]=(c[b>>2]|0)+1}i=a;return 0}function zc(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;q=i;i=i+624|0;p=q+92|0;A=q+88|0;C=q+84|0;B=q+80|0;k=q+76|0;H=q+72|0;s=q+68|0;r=q+64|0;t=q+60|0;j=q+56|0;F=q+52|0;n=q+48|0;D=q+44|0;w=q+40|0;G=q+36|0;v=q+32|0;o=q+28|0;u=q+24|0;E=q+20|0;m=q+96|0;z=q+16|0;l=q+12|0;x=q+8|0;y=q+4|0;g=q;c[A>>2]=a;c[C>>2]=b;c[B>>2]=d;c[k>>2]=e;c[H>>2]=f;c[s>>2]=c[B>>2];c[r>>2]=-1;c[t>>2]=0;c[j>>2]=c[k>>2]&-256;c[n>>2]=0;c[D>>2]=0;c[w>>2]=c[k>>2]&16;c[G>>2]=c[k>>2]&8;c[v>>2]=c[k>>2]&4;c[o>>2]=c[k>>2]&1;c[u>>2]=c[k>>2]&2;if(c[v>>2]|0)if((c[j>>2]|0)==16384|(c[j>>2]|0)==2048)f=1;else f=(c[j>>2]|0)==524288;else f=0;c[E>>2]=f&1;c[z>>2]=c[C>>2];a=c[9524]|0;if((a|0)!=(Ka()|0)){c[9524]=Ka()|0;vc(0,0)}e=(c[s>>2]|0)+0|0;f=e+44|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(f|0));f=c[z>>2]|0;do if((c[j>>2]|0)!=256){if(!f){c[n>>2]=bE(514,m)|0;if(!(c[n>>2]|0)){c[z>>2]=m;break}c[p>>2]=c[n>>2];a=c[p>>2]|0;i=q;return a|0}}else{c[l>>2]=qE(f,c[k>>2]|0)|0;if(!(c[l>>2]|0)){c[l>>2]=fc(12)|0;if(!(c[l>>2]|0)){c[p>>2]=7;a=c[p>>2]|0;i=q;return a|0}}else c[r>>2]=c[c[l>>2]>>2];c[(c[s>>2]|0)+28>>2]=c[l>>2]}while(0);if(c[o>>2]|0)c[t>>2]=c[t>>2];if(c[u>>2]|0)c[t>>2]=c[t>>2]|2;if(c[v>>2]|0)c[t>>2]=c[t>>2]|64;if(c[w>>2]|0)c[t>>2]=c[t>>2]|131200;c[t>>2]=c[t>>2];do if((c[r>>2]|0)<0){c[n>>2]=rE(c[z>>2]|0,c[k>>2]|0,x,y,g)|0;if(c[n>>2]|0){c[p>>2]=c[n>>2];a=c[p>>2]|0;i=q;return a|0}c[r>>2]=ZD(c[z>>2]|0,c[t>>2]|0,c[x>>2]|0)|0;if((c[r>>2]|0)<0?(a=(c[(Ya()|0)>>2]|0)!=21,!(a&(c[u>>2]|0)!=0^1|(c[w>>2]|0)!=0)):0){c[k>>2]=c[k>>2]&-7;c[t>>2]=c[t>>2]&-67;c[k>>2]=c[k>>2]|1;c[t>>2]=c[t>>2];c[o>>2]=1;c[r>>2]=ZD(c[z>>2]|0,c[t>>2]|0,c[x>>2]|0)|0}if((c[r>>2]|0)<0){a=Ij(30591)|0;c[n>>2]=UD(a,37536,c[z>>2]|0,30591)|0;break}if(c[k>>2]&526336){pb[c[37192+244>>2]&31](c[r>>2]|0,c[y>>2]|0,c[g>>2]|0)|0;h=34}else h=34}else h=34;while(0);if((h|0)==34){if(c[H>>2]|0)c[c[H>>2]>>2]=c[k>>2];if(c[(c[s>>2]|0)+28>>2]|0){c[c[(c[s>>2]|0)+28>>2]>>2]=c[r>>2];c[(c[(c[s>>2]|0)+28>>2]|0)+4>>2]=c[k>>2]}if(c[G>>2]|0)ub[c[37192+196>>2]&31](c[z>>2]|0)|0;c[F>>2]=(c[j>>2]|0)!=256&1;if(c[G>>2]|0)c[D>>2]=c[D>>2]|32;if(c[o>>2]|0)c[D>>2]=c[D>>2]|2;if(c[F>>2]|0)c[D>>2]=c[D>>2]|128;if(c[E>>2]|0)c[D>>2]=c[D>>2]|8;if(c[k>>2]&64)c[D>>2]=c[D>>2]|64;c[n>>2]=sE(c[A>>2]|0,c[r>>2]|0,c[B>>2]|0,c[C>>2]|0,c[D>>2]|0)|0}if(c[n>>2]|0)hc(c[(c[s>>2]|0)+28>>2]|0);c[p>>2]=c[n>>2];a=c[p>>2]|0;i=q;return a|0}function Ac(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;g=i;i=i+32|0;f=g+20|0;h=g+12|0;k=g+8|0;e=g+4|0;j=g;c[g+16>>2]=a;c[h>>2]=b;c[k>>2]=d;c[e>>2]=0;if((ub[c[37192+196>>2]&31](c[h>>2]|0)|0)==-1){if((c[(Ya()|0)>>2]|0)==2)c[e>>2]=5898;else c[e>>2]=UD(2570,37672,c[h>>2]|0,30729)|0;c[f>>2]=c[e>>2];a=c[f>>2]|0;i=g;return a|0}do if(c[k>>2]&1){c[e>>2]=zb[c[37192+208>>2]&63](c[h>>2]|0,j)|0;if(c[e>>2]|0){if((c[e>>2]|0)!=14)break;c[e>>2]=0;break}if(Xa(c[j>>2]|0)|0)c[e>>2]=UD(1290,38128,c[h>>2]|0,30744)|0;TD(0,c[j>>2]|0,30746)}while(0);c[f>>2]=c[e>>2];a=c[f>>2]|0;i=g;return a|0}function Bc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;k=i;i=i+96|0;g=k+88|0;l=k+84|0;j=k+80|0;f=k+76|0;h=k;c[k+92>>2]=a;c[g>>2]=b;c[l>>2]=d;c[j>>2]=e;c[f>>2]=0;e=c[l>>2]|0;if((e|0)==2)c[f>>2]=4;else if(!e)c[f>>2]=0;else if((e|0)==1)c[f>>2]=6;a=(zb[c[37192+28>>2]&63](c[g>>2]|0,c[f>>2]|0)|0)==0&1;c[c[j>>2]>>2]=a;if(c[l>>2]|0){i=k;return 0}if(!(c[c[j>>2]>>2]|0)){i=k;return 0}if(zb[c[37192+52>>2]&63](c[g>>2]|0,h)|0){i=k;return 0}if(c[h+36>>2]|0){i=k;return 0}c[c[j>>2]>>2]=0;i=k;return 0}function Cc(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;h=i;i=i+32|0;j=h;l=h+24|0;k=h+16|0;m=h+12|0;g=h+8|0;n=h+4|0;c[h+20>>2]=b;c[k>>2]=d;c[m>>2]=e;c[g>>2]=f;a[(c[g>>2]|0)+((c[m>>2]|0)-1)>>0]=0;do if((a[c[k>>2]>>0]|0)==47){d=c[m>>2]|0;b=c[g>>2]|0;c[j>>2]=c[k>>2];sc(d,b,1200,j)|0}else{if(zb[c[37192+40>>2]&63](c[g>>2]|0,(c[m>>2]|0)-1|0)|0){c[n>>2]=aF(c[g>>2]|0)|0;d=(c[m>>2]|0)-(c[n>>2]|0)|0;b=(c[g>>2]|0)+(c[n>>2]|0)|0;c[j>>2]=c[k>>2];sc(d,b,38120,j)|0;break}b=Ij(30831)|0;c[l>>2]=UD(b,37544,c[k>>2]|0,30831)|0;b=c[l>>2]|0;i=h;return b|0}while(0);c[l>>2]=0;b=c[l>>2]|0;i=h;return b|0}function Dc(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+32|0;g=f+16|0;h=f+12|0;k=f+8|0;l=f+4|0;j=f;c[f+20>>2]=b;c[g>>2]=d;c[h>>2]=e;_E(c[h>>2]|0,0,c[g>>2]|0)|0;c[9524]=Ka()|0;c[k>>2]=ZD(38104,0,0)|0;if((c[k>>2]|0)<0){eb(j|0)|0;b=c[h>>2]|0;a[b+0>>0]=a[j+0>>0]|0;a[b+1>>0]=a[j+1>>0]|0;a[b+2>>0]=a[j+2>>0]|0;a[b+3>>0]=a[j+3>>0]|0;b=(c[h>>2]|0)+4|0;a[b+0>>0]=a[38096]|0;a[b+1>>0]=a[38097]|0;a[b+2>>0]=a[38098]|0;a[b+3>>0]=a[38099]|0;c[g>>2]=8;b=c[g>>2]|0;i=f;return b|0}do{c[l>>2]=pb[c[37192+100>>2]&31](c[k>>2]|0,c[h>>2]|0,c[g>>2]|0)|0;if((c[l>>2]|0)>=0)break}while((c[(Ya()|0)>>2]|0)==4);TD(0,c[k>>2]|0,30936);b=c[g>>2]|0;i=f;return b|0}function Ec(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;e=i;i=i+16|0;f=e+4|0;d=e;c[e+8>>2]=a;c[f>>2]=b;c[d>>2]=((c[f>>2]|0)+999999|0)/1e6|0;bb(c[d>>2]|0)|0;i=e;return(c[d>>2]|0)*1e6|0}function Fc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=i;i=i+32|0;f=e+12|0;g=e;d=e+8|0;c[e+16>>2]=a;c[f>>2]=b;a=g;c[a>>2]=0;c[a+4>>2]=0;c[d>>2]=Hc(0,g)|0;a=g;h[c[f>>2]>>3]=(+((c[a>>2]|0)>>>0)+4294967296.0*+(c[a+4>>2]|0))/864.0e5;i=e;return c[d>>2]|0}function Gc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0;e=i;i=i+16|0;c[e+8>>2]=a;c[e+4>>2]=b;c[e>>2]=d;i=e;return 0}function Hc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+32|0;f=d+12|0;e=d+8|0;g=d;c[d+16>>2]=a;c[f>>2]=b;c[e>>2]=0;if(!(hb(g|0,0)|0)){a=c[g>>2]|0;a=lF(1e3,0,a|0,((a|0)<0)<<31>>31|0)|0;a=bF(1045635584,49096,a|0,D|0)|0;g=(c[g+4>>2]|0)/1e3|0;g=bF(a|0,D|0,g|0,((g|0)<0)<<31>>31|0)|0;a=c[f>>2]|0;c[a>>2]=g;c[a+4>>2]=D;a=c[e>>2]|0;i=d;return a|0}else{c[e>>2]=1;a=c[e>>2]|0;i=d;return a|0}return 0}function Ic(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;g=i;i=i+32|0;k=g+12|0;j=g+8|0;h=g+4|0;f=g;c[g+16>>2]=a;c[k>>2]=b;c[j>>2]=d;c[f>>2]=12;if(!(c[k>>2]|0)){c[f>>2]=0;c[h>>2]=0;while(1){if((c[h>>2]|0)>>>0>=25)break;if(c[37200+((c[h>>2]|0)*12|0)>>2]|0)c[37196+((c[h>>2]|0)*12|0)>>2]=c[37200+((c[h>>2]|0)*12|0)>>2];c[h>>2]=(c[h>>2]|0)+1}a=c[f>>2]|0;i=g;return a|0}c[h>>2]=0;while(1){if((c[h>>2]|0)>>>0>=25){e=16;break}a=(UE(c[k>>2]|0,c[37192+((c[h>>2]|0)*12|0)>>2]|0)|0)==0;d=c[h>>2]|0;if(a)break;c[h>>2]=d+1}if((e|0)==16){a=c[f>>2]|0;i=g;return a|0}if(!(c[37200+(d*12|0)>>2]|0))c[37200+((c[h>>2]|0)*12|0)>>2]=c[37196+((c[h>>2]|0)*12|0)>>2];c[f>>2]=0;if(!(c[j>>2]|0))c[j>>2]=c[37200+((c[h>>2]|0)*12|0)>>2];c[37196+((c[h>>2]|0)*12|0)>>2]=c[j>>2];a=c[f>>2]|0;i=g;return a|0}function Jc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=i;i=i+16|0;d=e+12|0;f=e+4|0;g=e;c[e+8>>2]=a;c[f>>2]=b;c[g>>2]=0;while(1){if((c[g>>2]|0)>>>0>=25){f=6;break}a=(UE(c[f>>2]|0,c[37192+((c[g>>2]|0)*12|0)>>2]|0)|0)==0;b=c[g>>2]|0;if(a){f=4;break}c[g>>2]=b+1}if((f|0)==4){c[d>>2]=c[37196+(b*12|0)>>2];a=c[d>>2]|0;i=e;return a|0}else if((f|0)==6){c[d>>2]=0;a=c[d>>2]|0;i=e;return a|0}return 0}function Kc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=i;i=i+16|0;d=e+12|0;g=e+4|0;f=e;c[e+8>>2]=a;c[g>>2]=b;c[f>>2]=-1;a:do if(c[g>>2]|0){c[f>>2]=0;while(1){if((c[f>>2]|0)>=24)break a;if(!(UE(c[g>>2]|0,c[37192+((c[f>>2]|0)*12|0)>>2]|0)|0))break a;c[f>>2]=(c[f>>2]|0)+1}}while(0);c[f>>2]=(c[f>>2]|0)+1;while(1){if((c[f>>2]|0)>=25){f=11;break}b=c[f>>2]|0;if(c[37196+((c[f>>2]|0)*12|0)>>2]|0){f=9;break}c[f>>2]=b+1}if((f|0)==9){c[d>>2]=c[37192+(b*12|0)>>2];a=c[d>>2]|0;i=e;return a|0}else if((f|0)==11){c[d>>2]=0;a=c[d>>2]|0;i=e;return a|0}return 0}function Lc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;k=i;i=i+32|0;f=k+28|0;g=k+24|0;l=k+20|0;h=k+16|0;j=k;c[f>>2]=a;c[g>>2]=b;c[l>>2]=d;c[(c[f>>2]|0)+52>>2]=c[g>>2];d=c[f>>2]|0;if(!(c[l>>2]|0)){Nc(d,c[g>>2]|0);i=k;return}if((c[d+232>>2]|0)==0?(a=rf(c[f>>2]|0)|0,c[(c[f>>2]|0)+232>>2]=a,(a|0)==0):0){i=k;return}c[j>>2]=e;c[h>>2]=yn(c[f>>2]|0,c[l>>2]|0,j)|0;sf(c[(c[f>>2]|0)+232>>2]|0,-1,c[h>>2]|0,1,16);i=k;return}function Mc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;f=d;e=d+8|0;g=f;c[g>>2]=a;c[g+4>>2]=b;a=f;c[e>>2]=gc(c[a>>2]|0,c[a+4>>2]|0)|0;if(!(c[e>>2]|0)){g=c[e>>2]|0;i=d;return g|0}_E(c[e>>2]|0,0,c[f>>2]|0)|0;g=c[e>>2]|0;i=d;return g|0}function Nc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;c[(c[e>>2]|0)+52>>2]=c[f>>2];if(!(c[(c[e>>2]|0)+232>>2]|0)){i=d;return}wD(c[(c[e>>2]|0)+232>>2]|0);i=d;return}function Oc(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0;o=i;i=i+112|0;e=o+108|0;E=o+104|0;m=o+100|0;z=o+96|0;h=o+92|0;A=o+88|0;r=o+84|0;l=o+80|0;F=o+76|0;y=o+72|0;s=o+68|0;B=o+64|0;C=o+60|0;t=o+56|0;v=o+52|0;k=o+16|0;n=o+48|0;u=o+44|0;x=o+40|0;j=o+8|0;g=o;w=o+36|0;p=o+32|0;q=o+28|0;f=o+24|0;c[e>>2]=a;c[E>>2]=b;c[h>>2]=0;c[A>>2]=0;Pc(c[(c[e>>2]|0)+24>>2]|0);c[m>>2]=c[(c[e>>2]|0)+28>>2];if(Qc(c[m>>2]|0)|0){a=c[m>>2]|0;i=o;return a|0}c[r>>2]=Sb(c[(c[e>>2]|0)+24>>2]|0)|0;c[l>>2]=Sb(c[(c[e>>2]|0)+4>>2]|0)|0;c[y>>2]=-1;c[s>>2]=0;if((c[c[e>>2]>>2]|0)!=0?(d[(c[(c[(c[e>>2]|0)+24>>2]|0)+4>>2]|0)+20>>0]|0|0)==2:0)c[m>>2]=5;else c[m>>2]=0;if((0==(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0}if(!(c[m>>2]|0)){a=md(c[(c[e>>2]|0)+4>>2]|0,0)|0;c[m>>2]=a;c[m>>2]=0==(a|0)?101:a}}}if(c[s>>2]|0){nd(c[(c[e>>2]|0)+24>>2]|0,0)|0;md(c[(c[e>>2]|0)+24>>2]|0,0)|0}if((c[m>>2]|0)==3082)c[m>>2]=7;c[(c[e>>2]|0)+28>>2]=c[m>>2];a=c[m>>2]|0;i=o;return a|0}function Pc(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;c[(c[(c[d>>2]|0)+4>>2]|0)+4>>2]=c[c[d>>2]>>2];i=b;return}function Qc(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;if(!((c[d>>2]|0)!=0&(c[d>>2]|0)!=5)){d=0;d=d&1;i=b;return d|0}d=(c[d>>2]|0)!=6;d=d&1;i=b;return d|0}function Rc(f,g){f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;j=i;i=i+32|0;l=j+24|0;m=j+20|0;o=j+16|0;k=j+12|0;n=j+8|0;p=j+4|0;h=j;c[l>>2]=f;c[m>>2]=g;c[o>>2]=0;c[k>>2]=c[(c[l>>2]|0)+4>>2];c[n>>2]=0;Pc(c[l>>2]|0);do if((d[(c[l>>2]|0)+8>>0]|0)!=2?(c[m>>2]|0)!=0?1:(d[(c[l>>2]|0)+8>>0]|0)!=1:0){if((c[m>>2]|0)!=0?(e[(c[k>>2]|0)+22>>1]&1|0)!=0:0){c[n>>2]=8;break}if((c[m>>2]|0)!=0?(d[(c[k>>2]|0)+20>>0]|0)==2:0)g=8;else g=7;a:do if((g|0)==7)if(!(e[(c[k>>2]|0)+22>>1]&64)){if((c[m>>2]|0)>1){c[p>>2]=c[(c[k>>2]|0)+72>>2];while(1){if(!(c[p>>2]|0))break a;f=c[p>>2]|0;if((c[c[p>>2]>>2]|0)!=(c[l>>2]|0))break;c[p>>2]=c[f+12>>2]}c[o>>2]=c[c[f>>2]>>2]}}else g=8;while(0);if((g|0)==8)c[o>>2]=c[c[(c[k>>2]|0)+76>>2]>>2];if(c[o>>2]|0){c[n>>2]=262;break}c[n>>2]=By(c[l>>2]|0,1,1)|0;if(!(c[n>>2]|0)){f=(c[k>>2]|0)+22|0;b[f>>1]=e[f>>1]&-9;if(!(c[(c[k>>2]|0)+44>>2]|0)){f=(c[k>>2]|0)+22|0;b[f>>1]=e[f>>1]|8}while(1){if((c[(c[k>>2]|0)+12>>2]|0)==0?(f=tD(c[k>>2]|0)|0,c[n>>2]=f,0==(f|0)):0)continue;do if((c[n>>2]|0)==0&(c[m>>2]|0)!=0){if(e[(c[k>>2]|0)+22>>1]&1){c[n>>2]=8;break}g=c[c[k>>2]>>2]|0;f=(c[m>>2]|0)>1&1;c[n>>2]=uD(g,f,xh(c[c[l>>2]>>2]|0)|0)|0;if(!(c[n>>2]|0))c[n>>2]=IC(c[k>>2]|0)|0}while(0);if(c[n>>2]|0)Sk(c[k>>2]|0);if((c[n>>2]&255|0)!=5)break;if(d[(c[k>>2]|0)+20>>0]|0)break;if(!(Fh(c[k>>2]|0)|0))break}if(!(c[n>>2]|0)){if((d[(c[l>>2]|0)+8>>0]|0)==0?(f=(c[k>>2]|0)+40|0,c[f>>2]=(c[f>>2]|0)+1,(a[(c[l>>2]|0)+9>>0]|0)!=0):0){a[(c[l>>2]|0)+36>>0]=1;c[(c[l>>2]|0)+40>>2]=c[(c[k>>2]|0)+72>>2];c[(c[k>>2]|0)+72>>2]=(c[l>>2]|0)+28}a[(c[l>>2]|0)+8>>0]=(c[m>>2]|0)!=0?2:1;if((d[(c[l>>2]|0)+8>>0]|0)>(d[(c[k>>2]|0)+20>>0]|0))a[(c[k>>2]|0)+20>>0]=a[(c[l>>2]|0)+8>>0]|0;if(c[m>>2]|0){c[h>>2]=c[(c[k>>2]|0)+12>>2];c[(c[k>>2]|0)+76>>2]=c[l>>2];f=(c[k>>2]|0)+22|0;b[f>>1]=e[f>>1]&-33;if((c[m>>2]|0)>1){f=(c[k>>2]|0)+22|0;b[f>>1]=e[f>>1]|32}f=c[(c[k>>2]|0)+44>>2]|0;if((f|0)!=(Hh((c[(c[h>>2]|0)+56>>2]|0)+28|0)|0)?(c[n>>2]=gd(c[(c[h>>2]|0)+68>>2]|0)|0,(c[n>>2]|0)==0):0)ck((c[(c[h>>2]|0)+56>>2]|0)+28|0,c[(c[k>>2]|0)+44>>2]|0)}}}}while(0);if(!((c[n>>2]|0)==0&(c[m>>2]|0)!=0)){f=c[n>>2]|0;i=j;return f|0}c[n>>2]=GC(c[c[k>>2]>>2]|0,c[(c[c[l>>2]>>2]|0)+496>>2]|0)|0;f=c[n>>2]|0;i=j;return f|0}function Sc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;j=e+12|0;g=e+8|0;f=e+4|0;h=e;c[j>>2]=a;c[g>>2]=b;c[f>>2]=d;c[h>>2]=c[(c[j>>2]|0)+4>>2];Pc(c[j>>2]|0);a=Hh((c[(c[(c[h>>2]|0)+12>>2]|0)+56>>2]|0)+(36+(c[g>>2]<<2))|0)|0;c[c[f>>2]>>2]=a;i=e;return}function Tc(a){a=a|0;var b=0,e=0;e=i;i=i+16|0;b=e;c[b>>2]=a;i=e;return(d[(c[b>>2]|0)+8>>0]|0|0)!=0|0}function Uc(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return c[(c[(c[b>>2]|0)+4>>2]|0)+32>>2]|0}function Vc(a){a=a|0;var b=0,e=0;e=i;i=i+16|0;b=e;c[b>>2]=a;i=e;return d[(c[b>>2]|0)+5>>0]|0|0}function Wc(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=Aw(c[(c[d>>2]|0)+4>>2]|0)|0;i=b;return a|0}function Xc(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,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>2]|0,g)|0,(c[o>>2]|0)!=0):0)break;u=Mi(c[(c[p>>2]|0)+204>>2]|0,c[m>>2]|0,c[g>>2]|0)|0;c[c[l>>2]>>2]=u;c[k>>2]=u;if(!(c[k>>2]|0)){c[o>>2]=7;h=22}else h=22}else{c[o>>2]=c[(c[p>>2]|0)+40>>2];h=22}while(0);do if((h|0)==22){if(c[o>>2]|0){c[k>>2]=0;break}if(!((c[t>>2]|0)!=0?1:(c[(c[c[l>>2]>>2]|0)+16>>2]|0)==0)){u=(c[p>>2]|0)+184|0;c[u>>2]=(c[u>>2]|0)+1;c[j>>2]=0;u=c[j>>2]|0;i=q;return u|0}c[k>>2]=c[c[l>>2]>>2];c[(c[k>>2]|0)+16>>2]=c[p>>2];if((c[m>>2]|0)>>>0<=2147483647?(c[m>>2]|0)!=(((c[282]|0)/(c[(c[p>>2]|0)+152>>2]|0)|0)+1|0):0){if(((d[(c[p>>2]|0)+15>>0]|0|0)==0?!((c[t>>2]|0)!=0?1:(c[(c[p>>2]|0)+24>>2]|0)>>>0<(c[m>>2]|0)>>>0):0)?(c[c[(c[p>>2]|0)+60>>2]>>2]|0)!=0:0){u=(ai(c[p>>2]|0)|0)!=0;if(u&(c[r>>2]|0)==0?(c[o>>2]=cj(c[(c[p>>2]|0)+208>>2]|0,c[m>>2]|0,s)|0,(c[o>>2]|0)!=0):0)break;u=(c[p>>2]|0)+188|0;c[u>>2]=(c[u>>2]|0)+1;c[o>>2]=dj(c[k>>2]|0,c[s>>2]|0)|0;if(c[o>>2]|0)break}else{if((c[m>>2]|0)>>>0>(c[(c[p>>2]|0)+156>>2]|0)>>>0){c[o>>2]=13;break}if(c[t>>2]|0){kh();if((c[m>>2]|0)>>>0<=(c[(c[p>>2]|0)+28>>2]|0)>>>0)Wg(c[(c[p>>2]|0)+56>>2]|0,c[m>>2]|0)|0;qk(c[p>>2]|0,c[m>>2]|0)|0;lh()}_E(c[(c[k>>2]|0)+4>>2]|0,0,c[(c[p>>2]|0)+152>>2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<0)<<31>>31|0)|0;c[u>>2]=x+1;if((c[u>>2]|0)!=((((c[282]|0)>>>0)/((c[(c[(c[(c[v>>2]|0)+4>>2]|0)+4>>2]|0)+32>>2]|0)>>>0)|0)+1|0)){x=Xc(c[t>>2]|0,c[u>>2]|0,o,0)|0;c[g>>2]=x;if((0==(x|0)?(x=gd(c[o>>2]|0)|0,c[g>>2]=x,0==(x|0)):0)?(x=k,b=c[l>>2]|0,b=kF(c[x>>2]|0,c[x+4>>2]|0,b|0,((b|0)<0)<<31>>31|0)|0,c[n>>2]=(c[m>>2]|0)+b,c[p>>2]=Zc(c[o>>2]|0)|0,b=k,x=c[q>>2]|0,x=kF(c[b>>2]|0,c[b+4>>2]|0,x|0,((x|0)<0)<<31>>31|0)|0,c[j>>2]=(c[p>>2]|0)+x,dF(c[j>>2]|0,c[n>>2]|0,c[r>>2]|0)|0,a[(Qj(c[o>>2]|0)|0)>>0]=0,x=k,(c[x>>2]|0)==0&(c[x+4>>2]|0)==0&(c[s>>2]|0)==0):0){x=(c[j>>2]|0)+28|0;ck(x,Wc(c[(c[v>>2]|0)+24>>2]|0)|0)}_c(c[o>>2]|0)}b=c[q>>2]|0;x=k;b=bF(c[x>>2]|0,c[x+4>>2]|0,b|0,((b|0)<0)<<31>>31|0)|0;x=k;c[x>>2]=b;c[x+4>>2]=D}if((j|0)==14){i=h;return c[g>>2]|0}return 0}function Zc(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return c[(c[b>>2]|0)+4>>2]|0}function _c(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;if(!(c[d>>2]|0)){i=b;return}ej(c[d>>2]|0);i=b;return}function $c(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=pd(Sb(c[(c[d>>2]|0)+24>>2]|0)|0)|0;c[(c[d>>2]|0)+44>>2]=c[c[e>>2]>>2];c[c[e>>2]>>2]=c[d>>2];c[(c[d>>2]|0)+40>>2]=1;i=b;return}function ad(a){a=a|0;var b=0,d=0,e=0;d=i;i=i+16|0;e=d+4|0;b=d;c[e>>2]=a;Pc(c[e>>2]|0);c[(c[(c[e>>2]|0)+4>>2]|0)+44>>2]=0;c[b>>2]=IC(c[(c[e>>2]|0)+4>>2]|0)|0;i=d;return c[b>>2]|0}function bd(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+32|0;m=f+20|0;l=f+16|0;h=f+12|0;j=f+8|0;k=f+4|0;g=f;c[m>>2]=b;c[l>>2]=d;c[h>>2]=e;c[j>>2]=c[(c[m>>2]|0)+4>>2];Pc(c[m>>2]|0);c[k>>2]=c[(c[(c[j>>2]|0)+12>>2]|0)+56>>2];c[g>>2]=gd(c[(c[(c[j>>2]|0)+12>>2]|0)+68>>2]|0)|0;if(c[g>>2]|0){m=c[g>>2]|0;i=f;return m|0}ck((c[k>>2]|0)+(36+(c[l>>2]<<2))|0,c[h>>2]|0);if((c[l>>2]|0)!=7){m=c[g>>2]|0;i=f;return m|0}a[(c[j>>2]|0)+18>>0]=c[h>>2];m=c[g>>2]|0;i=f;return m|0}function cd(a){a=a|0;var b=0,d=0,e=0,f=0;d=i;i=i+16|0;b=d+8|0;e=d+4|0;f=d;c[b>>2]=a;Rb(c[b>>2]|0);c[e>>2]=0;while(1){if((c[e>>2]|0)>=(c[(c[b>>2]|0)+20>>2]|0))break;c[f>>2]=(c[(c[b>>2]|0)+16>>2]|0)+(c[e>>2]<<4);if(c[(c[f>>2]|0)+12>>2]|0)wh(c[(c[f>>2]|0)+12>>2]|0);c[e>>2]=(c[e>>2]|0)+1}f=(c[b>>2]|0)+24|0;c[f>>2]=c[f>>2]&-3;Lk(c[b>>2]|0);Mk(c[b>>2]|0);i=d;return}function dd(f,g){f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0;j=i;i=i+32|0;l=j+16|0;n=j+12|0;h=j+8|0;k=j+4|0;m=j;c[l>>2]=f;c[n>>2]=g;c[h>>2]=c[(c[l>>2]|0)+4>>2];f=(c[h>>2]|0)+22|0;b[f>>1]=(e[f>>1]|0)&-17;if((c[n>>2]|0)==1){f=(c[h>>2]|0)+22|0;b[f>>1]=e[f>>1]|0|16}c[k>>2]=Rc(c[l>>2]|0,0)|0;do if(!(c[k>>2]|0)){c[m>>2]=c[(c[(c[h>>2]|0)+12>>2]|0)+56>>2];if((d[(c[m>>2]|0)+18>>0]|0|0)==(c[n>>2]&255|0)?(d[(c[m>>2]|0)+19>>0]|0|0)==(c[n>>2]&255|0):0)break;c[k>>2]=Rc(c[l>>2]|0,2)|0;if((c[k>>2]|0)==0?(c[k>>2]=gd(c[(c[(c[h>>2]|0)+12>>2]|0)+68>>2]|0)|0,(c[k>>2]|0)==0):0){a[(c[m>>2]|0)+18>>0]=c[n>>2];a[(c[m>>2]|0)+19>>0]=c[n>>2]}}while(0);f=(c[h>>2]|0)+22|0;b[f>>1]=(e[f>>1]|0)&-17;i=j;return c[k>>2]|0}function ed(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return c[(c[b>>2]|0)+60>>2]|0}function fd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;c[c[e>>2]>>2]=c[(c[f>>2]|0)+24>>2];i=d;return}function gd(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b+4|0;e=b;c[e>>2]=a;a=c[e>>2]|0;if((c[(c[(c[e>>2]|0)+16>>2]|0)+148>>2]|0)>>>0>(c[(c[(c[e>>2]|0)+16>>2]|0)+152>>2]|0)>>>0){c[d>>2]=mD(a)|0;e=c[d>>2]|0;i=b;return e|0}else{c[d>>2]=nD(a)|0;e=c[d>>2]|0;i=b;return e|0}return 0}function hd(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,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]|0)break;c[k>>2]=kd(c[l>>2]|0,c[p>>2]|0)|0}}else Og(c[f+88>>2]|0);while(0);if((c[k>>2]|0)==0?(ai(c[l>>2]|0)|0)==0:0)a[(c[l>>2]|0)+16>>0]=5;c[h>>2]=c[k>>2];b=c[h>>2]|0;i=n;return b|0}function id(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0;g=i;i=i+32|0;k=g+16|0;j=g+12|0;h=g+8|0;l=g;c[k>>2]=a;c[j>>2]=b;c[h>>2]=d;a=l;c[a>>2]=e;c[a+4>>2]=f;a=l;a=Ab[c[(c[c[k>>2]>>2]|0)+12>>2]&15](c[k>>2]|0,c[j>>2]|0,c[h>>2]|0,c[a>>2]|0,c[a+4>>2]|0)|0;i=g;return a|0}function jd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+32|0;h=e+20|0;g=e+8|0;j=e;f=e+16|0;c[h>>2]=a;a=g;c[a>>2]=b;c[a+4>>2]=d;c[f>>2]=Gg(c[h>>2]|0,j)|0;if(c[f>>2]|0){a=c[f>>2]|0;i=e;return a|0}b=j;d=c[b+4>>2]|0;a=g;j=c[a+4>>2]|0;if(!((d|0)>(j|0)|((d|0)==(j|0)?(c[b>>2]|0)>>>0>(c[a>>2]|0)>>>0:0))){a=c[f>>2]|0;i=e;return a|0}a=g;c[f>>2]=Xh(c[h>>2]|0,c[a>>2]|0,c[a+4>>2]|0)|0;a=c[f>>2]|0;i=e;return a|0}function kd(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;g=i;i=i+16|0;h=g+12|0;k=g+8|0;f=g+4|0;j=g;c[h>>2]=b;c[k>>2]=e;c[f>>2]=0;if(c[c[(c[h>>2]|0)+60>>2]>>2]|0){c[j>>2]=c[k>>2];b=ig(c[(c[h>>2]|0)+60>>2]|0,21,c[j>>2]|0)|0;c[f>>2]=b;c[f>>2]=(c[f>>2]|0)==12?0:b}if(c[f>>2]|0){b=c[f>>2]|0;i=g;return b|0}if(a[(c[h>>2]|0)+7>>0]|0){b=c[f>>2]|0;i=g;return b|0}c[f>>2]=Yh(c[(c[h>>2]|0)+60>>2]|0,d[(c[h>>2]|0)+11>>0]|0)|0;b=c[f>>2]|0;i=g;return b|0}function ld(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;c[(c[e>>2]|0)+24>>2]=c[f>>2];i=d;return}function md(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+32|0;g=f+16|0;h=f+12|0;l=f+8|0;k=f+4|0;j=f;c[h>>2]=b;c[l>>2]=e;if(!(d[(c[h>>2]|0)+8>>0]|0)){c[g>>2]=0;b=c[g>>2]|0;i=f;return b|0}Pc(c[h>>2]|0);do if((d[(c[h>>2]|0)+8>>0]|0|0)==2){c[j>>2]=c[(c[h>>2]|0)+4>>2];c[k>>2]=jD(c[c[j>>2]>>2]|0)|0;if(!((c[k>>2]|0)!=0&(c[l>>2]|0)==0)){a[(c[j>>2]|0)+20>>0]=1;eD(c[j>>2]|0);break}c[g>>2]=c[k>>2];b=c[g>>2]|0;i=f;return b|0}while(0);fD(c[h>>2]|0);c[g>>2]=0;b=c[g>>2]|0;i=f;return b|0}function nd(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;h=i;i=i+32|0;g=h+16|0;l=h+12|0;k=h+8|0;f=h+4|0;j=h;c[l>>2]=b;c[k>>2]=e;c[f>>2]=0;if((d[(c[l>>2]|0)+8>>0]|0)==2){c[j>>2]=c[(c[l>>2]|0)+4>>2];Pc(c[l>>2]|0);if((a[(c[j>>2]|0)+17>>0]|0)!=0?(c[f>>2]=iD(c[j>>2]|0)|0,(c[f>>2]|0)!=0):0){c[g>>2]=c[f>>2];b=c[g>>2]|0;i=h;return b|0}if(a[(c[j>>2]|0)+19>>0]|0)ld(c[c[j>>2]>>2]|0,c[(c[j>>2]|0)+44>>2]|0);c[f>>2]=hd(c[c[j>>2]>>2]|0,c[k>>2]|0,0)|0}c[g>>2]=c[f>>2];b=c[g>>2]|0;i=h;return b|0}function od(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;i=i+32|0;d=b+16|0;f=b+12|0;h=b+8|0;g=b+4|0;e=b;c[f>>2]=a;if(!(c[f>>2]|0)){c[d>>2]=0;h=c[d>>2]|0;i=b;return h|0}c[g>>2]=c[(c[f>>2]|0)+20>>2];Pc(c[(c[f>>2]|0)+24>>2]|0);if(c[c[f>>2]>>2]|0){a=(c[(c[f>>2]|0)+24>>2]|0)+16|0;c[a>>2]=(c[a>>2]|0)+ -1}if(c[(c[f>>2]|0)+40>>2]|0){c[h>>2]=pd(Sb(c[(c[f>>2]|0)+24>>2]|0)|0)|0;while(1){if((c[c[h>>2]>>2]|0)==(c[f>>2]|0))break;c[h>>2]=(c[c[h>>2]>>2]|0)+44}c[c[h>>2]>>2]=c[(c[f>>2]|0)+44>>2]}qd(c[(c[f>>2]|0)+4>>2]|0,0,0)|0;if((c[(c[f>>2]|0)+28>>2]|0)==101)a=0;else a=c[(c[f>>2]|0)+28>>2]|0;c[e>>2]=a;if(c[c[f>>2]>>2]|0){Nc(c[c[f>>2]>>2]|0,c[e>>2]|0);rd(c[c[f>>2]>>2]|0)}if(c[c[f>>2]>>2]|0)hc(c[f>>2]|0);rd(c[g>>2]|0);c[d>>2]=c[e>>2];h=c[d>>2]|0;i=b;return h|0}function pd(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return(c[b>>2]|0)+88|0}function qd(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;j=i;i=i+48|0;m=j+32|0;p=j+28|0;q=j+24|0;h=j+20|0;g=j+16|0;k=j+12|0;o=j+8|0;n=j+4|0;l=j;c[m>>2]=b;c[p>>2]=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|0)+12>>2]|0)+32>>2];while(1){if(!(c[f>>2]|0))break a;c[o>>2]=c[(c[f>>2]|0)+8>>2];eh(c[(c[o>>2]|0)+40>>2]|0);c[(c[o>>2]|0)+40>>2]=0;c[f>>2]=c[c[f>>2]>>2]}}while(0);Kk(c[(c[n>>2]|0)+4>>2]|0)|0;c[(c[n>>2]|0)+4>>2]=0;if((c[d>>2]|0)!=1)c[(c[n>>2]|0)+12>>2]=0}c[d>>2]=(c[d>>2]|0)+1}if(c[(c[(c[e>>2]|0)+16>>2]|0)+28>>2]|0)wh(c[(c[(c[e>>2]|0)+16>>2]|0)+28>>2]|0);Lk(c[e>>2]|0);Mk(c[e>>2]|0);c[d>>2]=0;while(1){if((c[d>>2]|0)>=23)break;c[k>>2]=c[(c[e>>2]|0)+336+(c[d>>2]<<2)>>2];while(1){if(!(c[k>>2]|0))break;c[l>>2]=c[(c[k>>2]|0)+28>>2];while(1){if(!(c[k>>2]|0))break;Gk(c[e>>2]|0,c[k>>2]|0);c[m>>2]=c[(c[k>>2]|0)+8>>2];Xb(c[e>>2]|0,c[k>>2]|0);c[k>>2]=c[m>>2]}c[k>>2]=c[l>>2]}c[d>>2]=(c[d>>2]|0)+1}c[f>>2]=c[(c[e>>2]|0)+436>>2];while(1){if(!(c[f>>2]|0))break;c[h>>2]=c[(c[f>>2]|0)+8>>2];c[d>>2]=0;while(1){if((c[d>>2]|0)>=3)break;if(c[(c[h>>2]|0)+((c[d>>2]|0)*20|0)+16>>2]|0)rb[c[(c[h>>2]|0)+((c[d>>2]|0)*20|0)+16>>2]&31](c[(c[h>>2]|0)+((c[d>>2]|0)*20|0)+8>>2]|0);c[d>>2]=(c[d>>2]|0)+1}Xb(c[e>>2]|0,c[h>>2]|0);c[f>>2]=c[c[f>>2]>>2]}mh((c[e>>2]|0)+428|0);c[f>>2]=c[(c[e>>2]|0)+316>>2];while(1){if(!(c[f>>2]|0))break;c[g>>2]=c[(c[f>>2]|0)+8>>2];if(c[(c[g>>2]|0)+12>>2]|0)rb[c[(c[g>>2]|0)+12>>2]&31](c[(c[g>>2]|0)+8>>2]|0);Xb(c[e>>2]|0,c[g>>2]|0);c[f>>2]=c[c[f>>2]>>2]}mh((c[e>>2]|0)+308|0);Nc(c[e>>2]|0,0);tf(c[(c[e>>2]|0)+232>>2]|0);c[(c[e>>2]|0)+76>>2]=-1254786768;Xb(c[e>>2]|0,c[(c[(c[e>>2]|0)+16>>2]|0)+28>>2]|0);c[(c[e>>2]|0)+76>>2]=-1623446221;if(a[(c[e>>2]|0)+251>>0]|0)hc(c[(c[e>>2]|0)+276>>2]|0);hc(c[e>>2]|0);i=j;return}function sd(a){a=a|0;var b=0,d=0,f=0;b=i;i=i+16|0;f=b+4|0;d=b;c[f>>2]=a;c[d>>2]=c[f>>2];if(!(c[d>>2]|0)){f=0;i=b;return f|0}if(!((e[(c[d>>2]|0)+88>>1]|0)>>>10&1)){f=0;i=b;return f|0}f=c[(c[d>>2]|0)+168>>2]|0;i=b;return f|0}function td(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;e=i;i=i+32|0;d=e+16|0;h=e+12|0;b=e+8|0;g=e+4|0;f=e;c[h>>2]=a;do if(!(c[h>>2]|0))c[b>>2]=0;else{c[g>>2]=c[h>>2];c[f>>2]=c[c[g>>2]>>2];if(!(ud(c[g>>2]|0)|0)){c[b>>2]=vd(c[g>>2]|0)|0;c[b>>2]=wd(c[f>>2]|0,c[b>>2]|0)|0;rd(c[f>>2]|0);break}c[d>>2]=Qb(67386)|0;h=c[d>>2]|0;i=e;return h|0}while(0);c[d>>2]=c[b>>2];h=c[d>>2]|0;i=e;return h|0}function ud(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b+8|0;e=b+4|0;c[e>>2]=a;if(!(c[c[e>>2]>>2]|0)){tc(21,37056,b);c[d>>2]=1;e=c[d>>2]|0;i=b;return e|0}else{c[d>>2]=0;e=c[d>>2]|0;i=b;return e|0}return 0}function vd(a){a=a|0;var b=0,d=0,e=0;d=i;i=i+16|0;e=d+4|0;b=d;c[e>>2]=a;c[b>>2]=0;if(!((c[(c[e>>2]|0)+40>>2]|0)!=-1108210269?(c[(c[e>>2]|0)+40>>2]|0)!=1369188723:0))c[b>>2]=yd(c[e>>2]|0)|0;qn(c[e>>2]|0);i=d;return c[b>>2]|0}function wd(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;f=e+8|0;h=e+4|0;g=e;c[h>>2]=a;c[g>>2]=b;if(!(c[h>>2]|0)){c[f>>2]=c[g>>2]&255;a=c[f>>2]|0;i=e;return a|0}if((c[g>>2]|0)==3082?1:(d[(c[h>>2]|0)+64>>0]|0|0)!=0){c[f>>2]=cD(c[h>>2]|0)|0;a=c[f>>2]|0;i=e;return a|0}else{c[f>>2]=c[g>>2]&c[(c[h>>2]|0)+56>>2];a=c[f>>2]|0;i=e;return a|0}return 0}function xd(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;f=b+8|0;d=b+4|0;e=b;c[f>>2]=a;if(!(c[f>>2]|0)){c[d>>2]=0;f=c[d>>2]|0;i=b;return f|0}else{c[e>>2]=c[f>>2];c[d>>2]=yd(c[e>>2]|0)|0;zd(c[e>>2]|0);c[d>>2]=wd(c[c[e>>2]>>2]|0,c[d>>2]|0)|0;f=c[d>>2]|0;i=b;return f|0}return 0}function yd(a){a=a|0;var d=0,f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;h=f;d=f+8|0;g=f+4|0;c[d>>2]=a;c[g>>2]=c[c[d>>2]>>2];$y(c[d>>2]|0)|0;a=c[d>>2]|0;if((c[(c[d>>2]|0)+76>>2]|0)>=0){Wy(a)|0;Xb(c[g>>2]|0,c[(c[d>>2]|0)+44>>2]|0);c[(c[d>>2]|0)+44>>2]=0;if((e[(c[d>>2]|0)+88>>1]|0)>>>6&1){a=(c[d>>2]|0)+88|0;b[a>>1]=b[a>>1]&-33|32}}else if((c[a+80>>2]|0)!=0?((e[(c[d>>2]|0)+88>>1]|0)>>>5&1|0)!=0:0){k=c[g>>2]|0;j=c[(c[d>>2]|0)+80>>2]|0;a=(c[(c[d>>2]|0)+44>>2]|0)!=0?1200:0;c[h>>2]=c[(c[d>>2]|0)+44>>2];Lc(k,j,a,h);Xb(c[g>>2]|0,c[(c[d>>2]|0)+44>>2]|0);c[(c[d>>2]|0)+44>>2]=0}bD(c[d>>2]|0);k=(c[d>>2]|0)+136|0;c[k>>2]=0;c[k+4>>2]=0;c[(c[d>>2]|0)+40>>2]=649915045;i=f;return c[(c[d>>2]|0)+80>>2]&c[(c[g>>2]|0)+56>>2]|0}function zd(b){b=b|0;var d=0,e=0;d=i;i=i+16|0;e=d;c[e>>2]=b;c[(c[e>>2]|0)+40>>2]=-1108210269;c[(c[e>>2]|0)+76>>2]=-1;c[(c[e>>2]|0)+80>>2]=0;a[(c[e>>2]|0)+86>>0]=2;c[(c[e>>2]|0)+40>>2]=-1108210269;c[(c[e>>2]|0)+92>>2]=0;c[(c[e>>2]|0)+72>>2]=1;a[(c[e>>2]|0)+87>>0]=-1;c[(c[e>>2]|0)+104>>2]=0;b=(c[e>>2]|0)+144|0;c[b>>2]=0;c[b+4>>2]=0;i=d;return}function Ad(a){a=a|0;var d=0,f=0,g=0,h=0,j=0;f=i;i=i+16|0;j=f+12|0;h=f+8|0;d=f+4|0;g=f;c[j>>2]=a;c[d>>2]=0;c[g>>2]=c[j>>2];c[h>>2]=0;while(1){if((c[h>>2]|0)>=(b[(c[g>>2]|0)+68>>1]|0))break;Bd((c[(c[g>>2]|0)+60>>2]|0)+((c[h>>2]|0)*40|0)|0);b[(c[(c[g>>2]|0)+60>>2]|0)+((c[h>>2]|0)*40|0)+8>>1]=1;c[h>>2]=(c[h>>2]|0)+1}if(!((e[(c[g>>2]|0)+88>>1]|0)>>>10&1)){j=c[d>>2]|0;i=f;return j|0}if(!(c[(c[g>>2]|0)+188>>2]|0)){j=c[d>>2]|0;i=f;return j|0}j=(c[g>>2]|0)+88|0;b[j>>1]=b[j>>1]&-33|32;j=c[d>>2]|0;i=f;return j|0}function Bd(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;if(((e[(c[d>>2]|0)+8>>1]|0)&9312|0)==0?(c[(c[d>>2]|0)+24>>2]|0)==0:0){i=b;return}aD(c[d>>2]|0);i=b;return}function Cd(a){a=a|0;var d=0,f=0,g=0,h=0;d=i;i=i+16|0;f=d+8|0;g=d+4|0;h=d;c[g>>2]=a;c[h>>2]=c[g>>2];if(!((e[(c[h>>2]|0)+8>>1]|0)&18)){c[f>>2]=Ed(c[g>>2]|0)|0;h=c[f>>2]|0;i=d;return h|0}Dd(c[h>>2]|0)|0;g=(c[h>>2]|0)+8|0;b[g>>1]=e[g>>1]|0|16;if(c[(c[h>>2]|0)+12>>2]|0)a=c[(c[h>>2]|0)+16>>2]|0;else a=0;c[f>>2]=a;h=c[f>>2]|0;i=d;return h|0}function Dd(a){a=a|0;var d=0,f=0,g=0,h=0;d=i;i=i+16|0;f=d+8|0;g=d+4|0;h=d;c[g>>2]=a;do if((e[(c[g>>2]|0)+8>>1]|0)&16384){a=(c[(c[g>>2]|0)+12>>2]|0)+(c[c[g>>2]>>2]|0)|0;c[h>>2]=a;c[h>>2]=(c[h>>2]|0)<=0?1:a;if(!(Dk(c[g>>2]|0,c[h>>2]|0,1)|0)){_E((c[(c[g>>2]|0)+16>>2]|0)+(c[(c[g>>2]|0)+12>>2]|0)|0,0,c[c[g>>2]>>2]|0)|0;h=(c[g>>2]|0)+12|0;c[h>>2]=(c[h>>2]|0)+(c[c[g>>2]>>2]|0);h=(c[g>>2]|0)+8|0;b[h>>1]=(e[h>>1]|0)&-16897;break}c[f>>2]=7;h=c[f>>2]|0;i=d;return h|0}while(0);c[f>>2]=0;h=c[f>>2]|0;i=d;return h|0}function Ed(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=Md(c[d>>2]|0,1)|0;i=b;return a|0}function Fd(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=Gd(c[d>>2]|0,1)|0;i=b;return a|0}function Gd(b,d){b=b|0;d=d|0;var f=0,g=0,h=0,j=0,k=0;g=i;i=i+16|0;f=g+8|0;k=g+4|0;j=g+12|0;h=g;c[k>>2]=b;a[j>>0]=d;c[h>>2]=c[k>>2];if(((e[(c[h>>2]|0)+8>>1]|0)&16|0)==0?(Md(c[k>>2]|0,a[j>>0]|0)|0)==0:0){c[f>>2]=0;b=c[f>>2]|0;i=g;return b|0}d=c[(c[h>>2]|0)+12>>2]|0;if((e[(c[h>>2]|0)+8>>1]|0)&16384){c[f>>2]=d+(c[c[h>>2]>>2]|0);b=c[f>>2]|0;i=g;return b|0}else{c[f>>2]=d;b=c[f>>2]|0;i=g;return b|0}return 0}function Hd(a){a=a|0;var b=0.0,d=0,e=0;d=i;i=i+16|0;e=d;c[e>>2]=a;b=+Id(c[e>>2]|0);i=d;return+b}function Id(b){b=b|0;var d=0,f=0,g=0,j=0,k=0,l=0.0;d=i;i=i+32|0;f=d+8|0;j=d+16|0;g=d;c[j>>2]=b;b=c[j>>2]|0;if((e[(c[j>>2]|0)+8>>1]|0)&8){h[f>>3]=+h[b>>3];l=+h[f>>3];i=d;return+l}k=c[j>>2]|0;if((e[b+8>>1]|0)&4){h[f>>3]=+((c[k>>2]|0)>>>0)+4294967296.0*+(c[k+4>>2]|0);l=+h[f>>3];i=d;return+l}if((e[k+8>>1]|0)&18){h[g>>3]=0.0;Lm(c[(c[j>>2]|0)+16>>2]|0,g,c[(c[j>>2]|0)+12>>2]|0,a[(c[j>>2]|0)+10>>0]|0)|0;h[f>>3]=+h[g>>3];l=+h[f>>3];i=d;return+l}else{h[f>>3]=0.0;l=+h[f>>3];i=d;return+l}return 0.0}function Jd(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=Kd(c[d>>2]|0)|0;i=b;return a|0}function Kd(b){b=b|0;var d=0,f=0,g=0,j=0,k=0;d=i;i=i+32|0;f=d+8|0;g=d+20|0;k=d+16|0;j=d;c[g>>2]=b;c[k>>2]=e[(c[g>>2]|0)+8>>1];do if(!(c[k>>2]&4)){if(c[k>>2]&8){j=Ip(+h[c[g>>2]>>3])|0;k=f;c[k>>2]=j;c[k+4>>2]=D;break}if(c[k>>2]&18){k=j;c[k>>2]=0;c[k+4>>2]=0;wg(c[(c[g>>2]|0)+16>>2]|0,j,c[(c[g>>2]|0)+12>>2]|0,a[(c[g>>2]|0)+10>>0]|0)|0;g=j;j=c[g+4>>2]|0;k=f;c[k>>2]=c[g>>2];c[k+4>>2]=j;break}else{k=f;c[k>>2]=0;c[k+4>>2]=0;break}}else{g=c[g>>2]|0;j=c[g+4>>2]|0;k=f;c[k>>2]=c[g>>2];c[k+4>>2]=j}while(0);k=f;D=c[k+4>>2]|0;i=d;return c[k>>2]|0}function Ld(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=Kd(c[d>>2]|0)|0;i=b;return a|0}function Md(b,f){b=b|0;f=f|0;var g=0,h=0,j=0,k=0;h=i;i=i+16|0;g=h+4|0;j=h;k=h+8|0;c[j>>2]=b;a[k>>0]=f;do if(c[j>>2]|0){if(((e[(c[j>>2]|0)+8>>1]|0)&514|0)==514?(d[(c[j>>2]|0)+10>>0]|0|0)==(d[k>>0]|0|0):0){c[g>>2]=c[(c[j>>2]|0)+16>>2];break}if((e[(c[j>>2]|0)+8>>1]|0)&1){c[g>>2]=0;break}else{c[g>>2]=$C(c[j>>2]|0,a[k>>0]|0)|0;break}}else c[g>>2]=0;while(0);i=h;return c[g>>2]|0}function Nd(a){a=a|0;var b=0,f=0;f=i;i=i+16|0;b=f;c[b>>2]=a;i=f;return d[1144+((e[(c[b>>2]|0)+8>>1]|0)&31)>>0]|0|0}function Od(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;k=f+12|0;j=f+8|0;h=f+4|0;g=f;c[k>>2]=a;c[j>>2]=b;c[h>>2]=d;c[g>>2]=e;Pd(c[k>>2]|0,c[j>>2]|0,c[h>>2]|0,0,c[g>>2]|0);i=f;return}function Pd(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0;h=i;i=i+32|0;j=h+12|0;n=h+8|0;m=h+4|0;l=h+16|0;k=h;c[j>>2]=b;c[n>>2]=d;c[m>>2]=e;a[l>>0]=f;c[k>>2]=g;if((Vd(c[c[j>>2]>>2]|0,c[n>>2]|0,c[m>>2]|0,a[l>>0]|0,c[k>>2]|0)|0)!=18){i=h;return}he(c[j>>2]|0);i=h;return}function Qd(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0;g=i;i=i+32|0;h=g+16|0;k=g+12|0;l=g;j=g+8|0;c[h>>2]=a;c[k>>2]=b;a=l;c[a>>2]=d;c[a+4>>2]=e;c[j>>2]=f;a=l;b=c[a+4>>2]|0;if(b>>>0>0|(b|0)==0&(c[a>>2]|0)>>>0>2147483647){Rd(c[k>>2]|0,c[j>>2]|0,c[h>>2]|0)|0;i=g;return}else{Pd(c[h>>2]|0,c[k>>2]|0,c[l>>2]|0,0,c[j>>2]|0);i=g;return}}function Rd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;g=e+8|0;h=e+4|0;f=e;c[g>>2]=a;c[h>>2]=b;c[f>>2]=d;if(!((c[h>>2]|0)==0|(c[h>>2]|0)==(-1|0)))rb[c[h>>2]&31](c[g>>2]|0);if(!(c[f>>2]|0)){i=e;return 18}he(c[f>>2]|0);i=e;return 18}function Sd(a,b){a=a|0;b=+b;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+8|0;e=d;c[f>>2]=a;h[e>>3]=b;Td(c[c[f>>2]>>2]|0,+h[e>>3]);i=d;return}function Td(a,d){a=a|0;d=+d;var e=0,f=0,g=0;e=i;i=i+16|0;g=e+8|0;f=e;c[g>>2]=a;h[f>>3]=d;_d(c[g>>2]|0);if($w(+h[f>>3])|0){i=e;return}h[c[g>>2]>>3]=+h[f>>3];b[(c[g>>2]|0)+8>>1]=8;i=e;return}function Ud(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0;f=i;i=i+16|0;j=f+8|0;h=f+4|0;g=f;c[j>>2]=b;c[h>>2]=d;c[g>>2]=e;c[(c[j>>2]|0)+20>>2]=1;a[(c[j>>2]|0)+25>>0]=1;Vd(c[c[j>>2]>>2]|0,c[h>>2]|0,c[g>>2]|0,1,-1)|0;i=f;return}function Vd(f,g,h,j,k){f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;o=i;i=i+48|0;l=o+28|0;n=o+24|0;u=o+20|0;v=o+16|0;r=o+34|0;s=o+12|0;m=o+8|0;p=o+4|0;q=o+32|0;t=o;c[n>>2]=f;c[u>>2]=g;c[v>>2]=h;a[r>>0]=j;c[s>>2]=k;c[m>>2]=c[v>>2];b[q>>1]=0;k=c[n>>2]|0;if(!(c[u>>2]|0)){_d(k);c[l>>2]=0;v=c[l>>2]|0;i=o;return v|0}if(c[k+32>>2]|0)c[p>>2]=c[(c[(c[n>>2]|0)+32>>2]|0)+88>>2];else c[p>>2]=1e9;b[q>>1]=(d[r>>0]|0)==0?16:2;if((c[m>>2]|0)<0){a:do if((d[r>>0]|0)==1){c[m>>2]=Mb(c[u>>2]|0)|0;if((c[m>>2]|0)>(c[p>>2]|0))c[m>>2]=(c[p>>2]|0)+1}else{c[m>>2]=0;while(1){if((c[m>>2]|0)>(c[p>>2]|0))break a;if(!(a[(c[u>>2]|0)+(c[m>>2]|0)>>0]|a[(c[u>>2]|0)+((c[m>>2]|0)+1)>>0]))break a;c[m>>2]=(c[m>>2]|0)+2}}while(0);b[q>>1]=e[q>>1]|512}do if((c[s>>2]|0)!=(-1|0)){v=(c[s>>2]|0)==16;Bd(c[n>>2]|0);t=c[u>>2]|0;c[(c[n>>2]|0)+16>>2]=t;if(v){c[(c[n>>2]|0)+20>>2]=t;v=Bk(c[(c[n>>2]|0)+32>>2]|0,c[(c[n>>2]|0)+20>>2]|0)|0;c[(c[n>>2]|0)+24>>2]=v;break}else{c[(c[n>>2]|0)+36>>2]=c[s>>2];b[q>>1]=e[q>>1]|((c[s>>2]|0)==0?2048:1024);break}}else{c[t>>2]=c[m>>2];if(e[q>>1]&512)c[t>>2]=(c[t>>2]|0)+((d[r>>0]|0)==1?1:2);if((c[m>>2]|0)>(c[p>>2]|0)){c[l>>2]=18;v=c[l>>2]|0;i=o;return v|0}if(!(Lp(c[n>>2]|0,(c[t>>2]|0)>32?c[t>>2]|0:32)|0)){dF(c[(c[n>>2]|0)+16>>2]|0,c[u>>2]|0,c[t>>2]|0)|0;break}c[l>>2]=7;v=c[l>>2]|0;i=o;return v|0}while(0);c[(c[n>>2]|0)+12>>2]=c[m>>2];b[(c[n>>2]|0)+8>>1]=b[q>>1]|0;if(!(d[r>>0]|0))q=1;else q=d[r>>0]|0;a[(c[n>>2]|0)+10>>0]=q;if((d[(c[n>>2]|0)+10>>0]|0)!=1?(_C(c[n>>2]|0)|0)!=0:0){c[l>>2]=7;v=c[l>>2]|0;i=o;return v|0}if((c[m>>2]|0)>(c[p>>2]|0)){c[l>>2]=18;v=c[l>>2]|0;i=o;return v|0}else{c[l>>2]=0;v=c[l>>2]|0;i=o;return v|0}return 0}function Wd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;a=c[f>>2]|0;Xd(c[c[e>>2]>>2]|0,a,((a|0)<0)<<31>>31);i=d;return}function Xd(a,d,f){a=a|0;d=d|0;f=f|0;var g=0,h=0,j=0;g=i;i=i+16|0;h=g+8|0;j=g;c[h>>2]=a;a=j;c[a>>2]=d;c[a+4>>2]=f;if((e[(c[h>>2]|0)+8>>1]|0)&9312){a=j;ZC(c[h>>2]|0,c[a>>2]|0,c[a+4>>2]|0);i=g;return}else{d=c[j+4>>2]|0;a=c[h>>2]|0;c[a>>2]=c[j>>2];c[a+4>>2]=d;b[(c[h>>2]|0)+8>>1]=4;i=g;return}}function Yd(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+16|0;f=e+8|0;g=e;c[f>>2]=a;a=g;c[a>>2]=b;c[a+4>>2]=d;a=g;Xd(c[c[f>>2]>>2]|0,c[a>>2]|0,c[a+4>>2]|0);i=e;return}function Zd(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;_d(c[c[d>>2]>>2]|0);i=b;return}function _d(a){a=a|0;var d=0,f=0;d=i;i=i+16|0;f=d;c[f>>2]=a;a=c[f>>2]|0;if((e[(c[f>>2]|0)+8>>1]|0)&9312){gn(a);i=d;return}else{b[a+8>>1]=1;i=d;return}}function $d(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;k=f+12|0;j=f+8|0;h=f+4|0;g=f;c[k>>2]=a;c[j>>2]=b;c[h>>2]=d;c[g>>2]=e;Pd(c[k>>2]|0,c[j>>2]|0,c[h>>2]|0,1,c[g>>2]|0);i=f;return}function ae(b,e,f,g,h,j){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0;n=i;i=i+32|0;m=n+16|0;p=n+12|0;o=n;l=n+8|0;k=n+20|0;c[m>>2]=b;c[p>>2]=e;b=o;c[b>>2]=f;c[b+4>>2]=g;c[l>>2]=h;a[k>>0]=j;if((d[k>>0]|0)==4)a[k>>0]=(a[1136]|0)==0?3:2;b=o;e=c[b+4>>2]|0;if(e>>>0>0|(e|0)==0&(c[b>>2]|0)>>>0>2147483647){Rd(c[p>>2]|0,c[l>>2]|0,c[m>>2]|0)|0;i=n;return}else{Pd(c[m>>2]|0,c[p>>2]|0,c[o>>2]|0,a[k>>0]|0,c[l>>2]|0);i=n;return}}function be(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;ce(c[c[f>>2]>>2]|0,c[e>>2]|0)|0;i=d;return}function ce(a,d){a=a|0;d=d|0;var f=0,g=0,h=0,j=0;g=i;i=i+16|0;h=g+8|0;j=g+4|0;f=g;c[h>>2]=a;c[j>>2]=d;c[f>>2]=0;if((e[(c[h>>2]|0)+8>>1]|0)&9312)gn(c[h>>2]|0);a=c[h>>2]|0;d=c[j>>2]|0;c[a+0>>2]=c[d+0>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];c[a+16>>2]=c[d+16>>2];a=(c[h>>2]|0)+8|0;b[a>>1]=(e[a>>1]|0)&-1025;if(!((e[(c[h>>2]|0)+8>>1]|0)&18)){a=c[f>>2]|0;i=g;return a|0}if((e[(c[j>>2]|0)+8>>1]|0)&2048){a=c[f>>2]|0;i=g;return a|0}a=(c[h>>2]|0)+8|0;b[a>>1]=e[a>>1]|0|4096;c[f>>2]=Ak(c[h>>2]|0)|0;a=c[f>>2]|0;i=g;return a|0}function de(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;ee(c[c[f>>2]>>2]|0,c[e>>2]|0);i=d;return}function ee(d,e){d=d|0;e=e|0;var f=0,g=0,h=0;f=i;i=i+16|0;g=f+4|0;h=f;c[g>>2]=d;c[h>>2]=e;Bd(c[g>>2]|0);b[(c[g>>2]|0)+8>>1]=16400;c[(c[g>>2]|0)+12>>2]=0;if((c[h>>2]|0)<0)c[h>>2]=0;c[c[g>>2]>>2]=c[h>>2];a[(c[g>>2]|0)+10>>0]=1;c[(c[g>>2]|0)+16>>2]=0;i=f;return}function fe(b,d){b=b|0;d=d|0;var f=0,g=0,h=0;f=i;i=i+16|0;g=f+4|0;h=f;c[g>>2]=b;c[h>>2]=d;c[(c[g>>2]|0)+20>>2]=c[h>>2];a[(c[g>>2]|0)+25>>0]=1;if(!((e[(c[c[g>>2]>>2]|0)+8>>1]|0)&1)){i=f;return}b=c[c[g>>2]>>2]|0;Vd(b,ge(c[h>>2]|0)|0,-1,1,0)|0;i=f;return}function ge(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;c[d>>2]=5952;if((c[e>>2]|0)!=516){c[e>>2]=c[e>>2]&255;if((c[e>>2]|0)>=0&(c[e>>2]|0)<27?(c[5112+(c[e>>2]<<2)>>2]|0)!=0:0)c[d>>2]=c[5112+(c[e>>2]<<2)>>2]}else c[d>>2]=5968;i=b;return c[d>>2]|0}function he(b){b=b|0;var d=0,e=0;d=i;i=i+16|0;e=d;c[e>>2]=b;c[(c[e>>2]|0)+20>>2]=18;a[(c[e>>2]|0)+25>>0]=1;Vd(c[c[e>>2]>>2]|0,1176,-1,1,0)|0;i=d;return}function ie(b){b=b|0;var d=0,e=0;d=i;i=i+16|0;e=d;c[e>>2]=b;_d(c[c[e>>2]>>2]|0);c[(c[e>>2]|0)+20>>2]=7;a[(c[e>>2]|0)+25>>0]=1;a[(c[(c[c[e>>2]>>2]|0)+32>>2]|0)+64>>0]=1;i=d;return}function je(d){d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;j=i;i=i+48|0;f=j+32|0;m=j+28|0;k=j+24|0;l=j+20|0;e=j+16|0;o=j+12|0;g=j+8|0;n=j+4|0;h=j;c[m>>2]=d;c[k>>2]=0;c[l>>2]=0;c[e>>2]=c[m>>2];c[o>>2]=0;if(ke(c[e>>2]|0)|0){c[f>>2]=Qb(67871)|0;o=c[f>>2]|0;i=j;return o|0}c[g>>2]=c[c[e>>2]>>2];d=(c[e>>2]|0)+88|0;b[d>>1]=b[d>>1]&-2049;while(1){d=le(c[e>>2]|0)|0;c[k>>2]=d;if((d|0)!=17)break;d=c[o>>2]|0;c[o>>2]=d+1;if((d|0)>=50)break;c[n>>2]=c[(c[e>>2]|0)+76>>2];d=me(c[e>>2]|0)|0;c[k>>2]=d;c[l>>2]=d;if(c[k>>2]|0)break;xd(c[m>>2]|0)|0;if((c[n>>2]|0)<0)continue;d=(c[e>>2]|0)+88|0;b[d>>1]=b[d>>1]&-2049|2048}do if(c[l>>2]|0){c[h>>2]=Ed(c[(c[g>>2]|0)+232>>2]|0)|0;Xb(c[g>>2]|0,c[(c[e>>2]|0)+44>>2]|0);if(a[(c[g>>2]|0)+64>>0]|0){c[(c[e>>2]|0)+44>>2]=0;c[k>>2]=7;c[(c[e>>2]|0)+80>>2]=7;break}else{o=ne(c[g>>2]|0,c[h>>2]|0)|0;c[(c[e>>2]|0)+44>>2]=o;c[(c[e>>2]|0)+80>>2]=c[l>>2];break}}while(0);c[k>>2]=wd(c[g>>2]|0,c[k>>2]|0)|0;c[f>>2]=c[k>>2];o=c[f>>2]|0;i=j;return o|0}function ke(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b+8|0;e=b+4|0;c[e>>2]=a;if(!(c[e>>2]|0)){tc(21,37016,b);c[d>>2]=1;e=c[d>>2]|0;i=b;return e|0}else{c[d>>2]=ud(c[e>>2]|0)|0;e=c[d>>2]|0;i=b;return e|0}return 0}function le(d){d=d|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;g=i;i=i+32|0;f=g+20|0;j=g+16|0;k=g+12|0;h=g+8|0;l=g;c[j>>2]=d;if((c[(c[j>>2]|0)+40>>2]|0)!=-1108210269)xd(c[j>>2]|0)|0;c[k>>2]=c[c[j>>2]>>2];d=c[j>>2]|0;if(a[(c[k>>2]|0)+64>>0]|0){c[d+80>>2]=7;c[f>>2]=7;d=c[f>>2]|0;i=g;return d|0}if((c[d+76>>2]|0)<=0?((e[(c[j>>2]|0)+88>>1]|0)>>>5&1|0)!=0:0){c[(c[j>>2]|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>2]|0)+80>>2]|0)|0))c[(c[j>>2]|0)+80>>2]=7}if(((c[h>>2]|0)!=100?((e[(c[j>>2]|0)+88>>1]|0)>>>10&1|0)!=0:0)&(c[h>>2]|0)!=101)c[h>>2]=Wy(c[j>>2]|0)|0;c[f>>2]=c[h>>2]&c[(c[k>>2]|0)+56>>2];o=c[f>>2]|0;i=g;return o|0}function me(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0;d=i;i=i+32|0;e=d+20|0;g=d+16|0;h=d+12|0;f=d+8|0;k=d+4|0;j=d;c[g>>2]=b;c[k>>2]=sd(c[g>>2]|0)|0;c[j>>2]=Fs(c[g>>2]|0)|0;c[h>>2]=pf(c[j>>2]|0,c[k>>2]|0,-1,0,c[g>>2]|0,f,0)|0;if(!(c[h>>2]|0)){Cy(c[f>>2]|0,c[g>>2]|0);Ne(c[f>>2]|0,c[g>>2]|0)|0;Dy(c[f>>2]|0);vd(c[f>>2]|0)|0;c[e>>2]=0;k=c[e>>2]|0;i=d;return k|0}if((c[h>>2]|0)==7)a[(c[j>>2]|0)+64>>0]=1;c[e>>2]=c[h>>2];k=c[e>>2]|0;i=d;return k|0}function ne(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;i=i+32|0;e=d+16|0;j=d+12|0;g=d+8|0;f=d+4|0;h=d;c[j>>2]=a;c[g>>2]=b;if(!(c[g>>2]|0)){c[e>>2]=0;a=c[e>>2]|0;i=d;return a|0}c[h>>2]=(Mb(c[g>>2]|0)|0)+1;a=c[h>>2]|0;c[f>>2]=Qe(c[j>>2]|0,a,((a|0)<0)<<31>>31)|0;if(c[f>>2]|0)dF(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;c[e>>2]=c[f>>2];a=c[e>>2]|0;i=d;return a|0}function oe(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return c[(c[(c[b>>2]|0)+4>>2]|0)+4>>2]|0}function pe(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return c[(c[c[b>>2]>>2]|0)+32>>2]|0}function qe(a,b){a=a|0;b=b|0;var d=0,f=0,g=0,h=0;d=i;i=i+16|0;f=d+8|0;h=d+4|0;g=d;c[h>>2]=a;c[g>>2]=b;b=c[h>>2]|0;if(!((e[(c[(c[h>>2]|0)+8>>2]|0)+8>>1]|0)&8192)){c[f>>2]=re(b,c[g>>2]|0)|0;h=c[f>>2]|0;i=d;return h|0}else{c[f>>2]=c[(c[b+8>>2]|0)+16>>2];h=c[f>>2]|0;i=d;return h|0}return 0}function re(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;h=e+8|0;g=e+4|0;f=e;c[h>>2]=a;c[g>>2]=d;c[f>>2]=c[(c[h>>2]|0)+8>>2];d=c[f>>2]|0;if((c[g>>2]|0)>0){Lp(d,c[g>>2]|0)|0;b[(c[f>>2]|0)+8>>1]=8192;c[c[f>>2]>>2]=c[(c[h>>2]|0)+4>>2];if(c[(c[f>>2]|0)+16>>2]|0)_E(c[(c[f>>2]|0)+16>>2]|0,0,c[g>>2]|0)|0}else{_d(d);c[(c[f>>2]|0)+16>>2]=0}i=e;return c[(c[f>>2]|0)+16>>2]|0}function se(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;h=e+12|0;g=e;f=e+8|0;c[h>>2]=a;a=g;c[a>>2]=b;c[a+4>>2]=d;a=g;c[f>>2]=Qe(c[h>>2]|0,c[a>>2]|0,c[a+4>>2]|0)|0;if(!(c[f>>2]|0)){h=c[f>>2]|0;i=e;return h|0}_E(c[f>>2]|0,0,c[g>>2]|0)|0;h=c[f>>2]|0;i=e;return h|0}function te(a){a=a|0;var b=0,d=0,f=0;b=i;i=i+16|0;f=b+4|0;d=b;c[f>>2]=a;c[d>>2]=c[f>>2];if(!(c[d>>2]|0)){f=0;i=b;return f|0}f=e[(c[d>>2]|0)+84>>1]|0;i=b;return f|0}function ue(a){a=a|0;var b=0,d=0,f=0,g=0;b=i;i=i+16|0;d=b+8|0;g=b+4|0;f=b;c[g>>2]=a;c[f>>2]=c[g>>2];if((c[f>>2]|0)!=0?(c[(c[f>>2]|0)+20>>2]|0)!=0:0){c[d>>2]=e[(c[f>>2]|0)+84>>1];g=c[d>>2]|0;i=b;return g|0}c[d>>2]=0;g=c[d>>2]|0;i=b;return g|0}function ve(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=i;i=i+16|0;f=e+8|0;g=e+4|0;d=e;c[f>>2]=a;c[g>>2]=b;c[d>>2]=Cd(we(c[f>>2]|0,c[g>>2]|0)|0)|0;xe(c[f>>2]|0);i=e;return c[d>>2]|0}function we(a,b){a=a|0;b=b|0;var d=0,f=0,g=0,h=0,j=0;d=i;i=i+16|0;j=d+12|0;g=d+8|0;h=d+4|0;f=d;c[j>>2]=a;c[g>>2]=b;c[h>>2]=c[j>>2];if(((c[h>>2]|0)!=0?(c[(c[h>>2]|0)+20>>2]|0)!=0:0)?(c[g>>2]|0)>=0?(c[g>>2]|0)<(e[(c[h>>2]|0)+84>>1]|0|0):0:0){c[f>>2]=(c[(c[h>>2]|0)+20>>2]|0)+((c[g>>2]|0)*40|0);j=c[f>>2]|0;i=d;return j|0}if((c[h>>2]|0)!=0?(c[c[h>>2]>>2]|0)!=0:0)Nc(c[c[h>>2]>>2]|0,25);c[f>>2]=Sy()|0;j=c[f>>2]|0;i=d;return j|0}function xe(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;c[d>>2]=c[e>>2];if(!(c[d>>2]|0)){i=b;return}e=wd(c[c[d>>2]>>2]|0,c[(c[d>>2]|0)+80>>2]|0)|0;c[(c[d>>2]|0)+80>>2]=e;i=b;return}function ye(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=i;i=i+16|0;f=e+8|0;g=e+4|0;d=e;c[f>>2]=a;c[g>>2]=b;c[d>>2]=Fd(we(c[f>>2]|0,c[g>>2]|0)|0)|0;xe(c[f>>2]|0);i=e;return c[d>>2]|0}function ze(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=i;i=i+16|0;f=e+12|0;g=e+8|0;d=e;c[f>>2]=a;c[g>>2]=b;h[d>>3]=+Hd(we(c[f>>2]|0,c[g>>2]|0)|0);xe(c[f>>2]|0);i=e;return+(+h[d>>3])}function Ae(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=i;i=i+16|0;f=e+8|0;g=e+4|0;d=e;c[f>>2]=a;c[g>>2]=b;c[d>>2]=Ed(we(c[f>>2]|0,c[g>>2]|0)|0)|0;xe(c[f>>2]|0);i=e;return c[d>>2]|0}function Be(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=i;i=i+16|0;f=e+8|0;g=e+4|0;d=e;c[f>>2]=a;c[g>>2]=b;c[d>>2]=Nd(we(c[f>>2]|0,c[g>>2]|0)|0)|0;xe(c[f>>2]|0);i=e;return c[d>>2]|0}function Ce(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;a=De(c[f>>2]|0,c[e>>2]|0,17,0)|0;i=d;return a|0}function De(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;m=i;i=i+32|0;p=m+28|0;g=m+24|0;n=m+20|0;k=m+16|0;h=m+12|0;o=m+8|0;l=m+4|0;j=m;c[p>>2]=b;c[g>>2]=d;c[n>>2]=e;c[k>>2]=f;c[h>>2]=0;c[o>>2]=c[p>>2];c[j>>2]=c[c[o>>2]>>2];c[l>>2]=te(c[p>>2]|0)|0;if(!((c[g>>2]|0)>=0?(c[g>>2]|0)<(c[l>>2]|0):0)){p=c[h>>2]|0;i=m;return p|0}p=$(c[k>>2]|0,c[l>>2]|0)|0;c[g>>2]=(c[g>>2]|0)+p;c[h>>2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]>>2]|0)+16>>2]|0)+12>>2]|0)+77>>0]|0)|0;Nc(c[c[o>>2]>>2]|0,c[l>>2]|0);c[l>>2]=wd(c[c[o>>2]>>2]|0,c[l>>2]|0)|0;t=c[l>>2]|0;i=q;return t|0}function Ge(a,b,d){a=a|0;b=b|0;d=+d;var e=0,f=0,g=0,j=0,k=0,l=0;e=i;i=i+32|0;l=e+20|0;j=e+16|0;k=e;f=e+12|0;g=e+8|0;c[l>>2]=a;c[j>>2]=b;h[k>>3]=d;c[g>>2]=c[l>>2];c[f>>2]=He(c[g>>2]|0,c[j>>2]|0)|0;if(c[f>>2]|0){l=c[f>>2]|0;i=e;return l|0}Td((c[(c[g>>2]|0)+60>>2]|0)+(((c[j>>2]|0)-1|0)*40|0)|0,+h[k>>3]);l=c[f>>2]|0;i=e;return l|0}function He(a,d){a=a|0;d=d|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+32|0;m=g;h=g+16|0;j=g+12|0;k=g+8|0;l=g+4|0;c[j>>2]=a;c[k>>2]=d;if(ke(c[j>>2]|0)|0){c[h>>2]=Qb(68415)|0;a=c[h>>2]|0;i=g;return a|0}if((c[(c[j>>2]|0)+40>>2]|0)==-1108210269?(c[(c[j>>2]|0)+76>>2]|0)<0:0){if((c[k>>2]|0)>=1?(c[k>>2]|0)<=(b[(c[j>>2]|0)+68>>1]|0):0){c[k>>2]=(c[k>>2]|0)+ -1;c[l>>2]=(c[(c[j>>2]|0)+60>>2]|0)+((c[k>>2]|0)*40|0);Bd(c[l>>2]|0);b[(c[l>>2]|0)+8>>1]=1;Nc(c[c[j>>2]>>2]|0,0);do if((e[(c[j>>2]|0)+88>>1]|0)>>>10&1){if(!((c[k>>2]|0)<32?(c[(c[j>>2]|0)+188>>2]&1<<c[k>>2]|0)!=0:0))f=12;if((f|0)==12?(c[(c[j>>2]|0)+188>>2]|0)!=-1:0)break;a=(c[j>>2]|0)+88|0;b[a>>1]=b[a>>1]&-33|32}while(0);c[h>>2]=0;a=c[h>>2]|0;i=g;return a|0}Nc(c[c[j>>2]>>2]|0,25);c[h>>2]=25;a=c[h>>2]|0;i=g;return a|0}Nc(c[c[j>>2]>>2]|0,21);c[m>>2]=c[(c[j>>2]|0)+168>>2];tc(21,31184,m);c[h>>2]=Qb(68423)|0;a=c[h>>2]|0;i=g;return a|0}function Ie(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;g=e+8|0;f=e+4|0;h=e;c[g>>2]=a;c[f>>2]=b;c[h>>2]=d;a=c[h>>2]|0;a=Je(c[g>>2]|0,c[f>>2]|0,a,((a|0)<0)<<31>>31)|0;i=e;return a|0}function Je(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+32|0;l=f+20|0;k=f+16|0;h=f;g=f+12|0;j=f+8|0;c[l>>2]=a;c[k>>2]=b;a=h;c[a>>2]=d;c[a+4>>2]=e;c[j>>2]=c[l>>2];c[g>>2]=He(c[j>>2]|0,c[k>>2]|0)|0;if(c[g>>2]|0){l=c[g>>2]|0;i=f;return l|0}l=h;Xd((c[(c[j>>2]|0)+60>>2]|0)+(((c[k>>2]|0)-1|0)*40|0)|0,c[l>>2]|0,c[l+4>>2]|0);l=c[g>>2]|0;i=f;return l|0}function Ke(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+32|0;m=g+16|0;l=g+12|0;k=g+8|0;j=g+4|0;h=g;c[m>>2]=a;c[l>>2]=b;c[k>>2]=d;c[j>>2]=e;c[h>>2]=f;a=Fe(c[m>>2]|0,c[l>>2]|0,c[k>>2]|0,c[j>>2]|0,c[h>>2]|0,1)|0;i=g;return a|0}function Le(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;b=c[f>>2]|0;a=c[e>>2]|0;a=Me(b,a,Mb(c[e>>2]|0)|0)|0;i=d;return a|0}function Me(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;g=i;i=i+32|0;h=g+20|0;m=g+16|0;k=g+12|0;l=g+8|0;n=g+4|0;j=g;c[m>>2]=d;c[k>>2]=e;c[l>>2]=f;if(!(c[m>>2]|0)){c[h>>2]=0;d=c[h>>2]|0;i=g;return d|0}a:do if(c[k>>2]|0){c[n>>2]=0;while(1){if((c[n>>2]|0)>=(b[(c[m>>2]|0)+70>>1]|0))break a;c[j>>2]=c[(c[(c[m>>2]|0)+64>>2]|0)+(c[n>>2]<<2)>>2];if(((c[j>>2]|0)!=0?(VE(c[j>>2]|0,c[k>>2]|0,c[l>>2]|0)|0)==0:0)?(a[(c[j>>2]|0)+(c[l>>2]|0)>>0]|0)==0:0)break;c[n>>2]=(c[n>>2]|0)+1}c[h>>2]=(c[n>>2]|0)+1;d=c[h>>2]|0;i=g;return d|0}while(0);c[h>>2]=0;d=c[h>>2]|0;i=g;return d|0}function Ne(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+32|0;k=e+16|0;j=e+12|0;g=e+8|0;h=e+4|0;f=e;c[k>>2]=a;c[j>>2]=d;c[g>>2]=c[k>>2];c[h>>2]=c[j>>2];c[f>>2]=0;while(1){if((c[f>>2]|0)>=(b[(c[g>>2]|0)+68>>1]|0))break;Ry((c[(c[h>>2]|0)+60>>2]|0)+((c[f>>2]|0)*40|0)|0,(c[(c[g>>2]|0)+60>>2]|0)+((c[f>>2]|0)*40|0)|0);c[f>>2]=(c[f>>2]|0)+1}i=e;return 0}function Oe(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;e=b+8|0;d=b+4|0;f=b;c[e>>2]=a;c[d>>2]=Nd(c[e>>2]|0)|0;if((c[d>>2]|0)!=3){f=c[d>>2]|0;i=b;return f|0}c[f>>2]=c[e>>2];Pe(c[f>>2]|0,0);c[d>>2]=Nd(c[e>>2]|0)|0;f=c[d>>2]|0;i=b;return f|0}function Pe(d,f){d=d|0;f=f|0;var g=0,j=0,k=0,l=0,m=0,n=0;g=i;i=i+32|0;k=g+20|0;m=g+16|0;l=g+8|0;j=g;n=g+24|0;c[k>>2]=d;c[m>>2]=f;a[n>>0]=a[(c[k>>2]|0)+10>>0]|0;if(!(Lm(c[(c[k>>2]|0)+16>>2]|0,l,c[(c[k>>2]|0)+12>>2]|0,a[n>>0]|0)|0)){i=g;return}if(!(wg(c[(c[k>>2]|0)+16>>2]|0,j,c[(c[k>>2]|0)+12>>2]|0,a[n>>0]|0)|0)){m=j;n=c[m+4>>2]|0;d=c[k>>2]|0;c[d>>2]=c[m>>2];c[d+4>>2]=n;d=(c[k>>2]|0)+8|0;b[d>>1]=e[d>>1]|0|4;i=g;return}h[c[k>>2]>>3]=+h[l>>3];d=(c[k>>2]|0)+8|0;b[d>>1]=e[d>>1]|0|8;if(!(c[m>>2]|0)){i=g;return}Hp(c[k>>2]|0);i=g;return}function Qe(b,d,f){b=b|0;d=d|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+32|0;h=g+20|0;l=g+16|0;j=g;k=g+12|0;m=g+8|0;c[l>>2]=b;b=j;c[b>>2]=d;c[b+4>>2]=f;do if(c[l>>2]|0){if(a[(c[l>>2]|0)+64>>0]|0){c[h>>2]=0;b=c[h>>2]|0;i=g;return b|0}if(a[(c[l>>2]|0)+250>>0]|0){b=j;d=c[b+4>>2]|0;f=(c[l>>2]|0)+248|0;if(d>>>0>0|((d|0)==0?(c[b>>2]|0)>>>0>(e[(c[l>>2]|0)+248>>1]|0)>>>0:0)){b=f+16|0;c[b>>2]=(c[b>>2]|0)+1;break}b=c[f+24>>2]|0;c[m>>2]=b;if(!b){b=(c[l>>2]|0)+268|0;c[b>>2]=(c[b>>2]|0)+1;break}c[(c[l>>2]|0)+272>>2]=c[c[m>>2]>>2];b=(c[l>>2]|0)+252|0;c[b>>2]=(c[b>>2]|0)+1;b=(c[l>>2]|0)+260|0;c[b>>2]=(c[b>>2]|0)+1;if((c[(c[l>>2]|0)+252>>2]|0)>(c[(c[l>>2]|0)+256>>2]|0))c[(c[l>>2]|0)+256>>2]=c[(c[l>>2]|0)+252>>2];c[h>>2]=c[m>>2];b=c[h>>2]|0;i=g;return b|0}}while(0);b=j;c[k>>2]=gc(c[b>>2]|0,c[b+4>>2]|0)|0;if((c[k>>2]|0)==0&(c[l>>2]|0)!=0)a[(c[l>>2]|0)+64>>0]=1;c[h>>2]=c[k>>2];b=c[h>>2]|0;i=g;return b|0}function Re(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;l=i;i=i+48|0;k=l;g=l+36|0;m=l+32|0;p=l+28|0;j=l+24|0;h=l+20|0;n=l+16|0;o=l+12|0;c[m>>2]=b;c[p>>2]=d;c[j>>2]=e;c[h>>2]=f;if(Ar(c[m>>2]|0)|0){c[g>>2]=0;b=c[g>>2]|0;i=l;return b|0}c[n>>2]=sp(c[c[m>>2]>>2]|0,c[j>>2]|0,c[h>>2]|0)|0;if(!(c[n>>2]|0)){c[o>>2]=(c[p>>2]|0)!=0?31152:31168;p=c[m>>2]|0;o=c[o>>2]|0;if(c[h>>2]|0){d=c[h>>2]|0;b=c[j>>2]|0;c[k>>2]=o;c[k+4>>2]=d;c[k+8>>2]=b;Se(p,17264,k)}else{b=c[j>>2]|0;c[k>>2]=o;c[k+4>>2]=b;Se(p,17280,k)}a[(c[m>>2]|0)+17>>0]=1}c[g>>2]=c[n>>2];b=c[g>>2]|0;i=l;return b|0}function Se(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+48|0;j=f+32|0;l=f+28|0;g=f+24|0;k=f+8|0;h=f;c[j>>2]=b;c[l>>2]=d;c[h>>2]=c[c[j>>2]>>2];c[k>>2]=e;c[g>>2]=yn(c[h>>2]|0,c[l>>2]|0,k)|0;if(a[(c[h>>2]|0)+67>>0]|0){Xb(c[h>>2]|0,c[g>>2]|0);i=f;return}else{l=(c[j>>2]|0)+64|0;c[l>>2]=(c[l>>2]|0)+1;Xb(c[h>>2]|0,c[(c[j>>2]|0)+4>>2]|0);c[(c[j>>2]|0)+4>>2]=c[g>>2];c[(c[j>>2]|0)+12>>2]=1;i=f;return}}function Te(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;f=i;i=i+32|0;j=f+28|0;h=f+24|0;g=f+8|0;e=f;c[j>>2]=a;c[h>>2]=b;c[g>>2]=d;c[e>>2]=yn(c[j>>2]|0,c[h>>2]|0,g)|0;i=f;return c[e>>2]|0}function Ue(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+16|0;d=b+12|0;g=b+8|0;e=b+4|0;f=b;c[g>>2]=a;c[e>>2]=c[c[g>>2]>>2];c[f>>2]=se(c[e>>2]|0,208,0)|0;if(!(c[f>>2]|0)){c[d>>2]=0;g=c[d>>2]|0;i=b;return g|0}c[c[f>>2]>>2]=c[e>>2];if(c[(c[e>>2]|0)+4>>2]|0)c[(c[(c[e>>2]|0)+4>>2]|0)+48>>2]=c[f>>2];c[(c[f>>2]|0)+52>>2]=c[(c[e>>2]|0)+4>>2];c[(c[f>>2]|0)+48>>2]=0;c[(c[e>>2]|0)+4>>2]=c[f>>2];c[(c[f>>2]|0)+40>>2]=649915045;c[(c[f>>2]|0)+24>>2]=c[g>>2];c[d>>2]=c[f>>2];g=c[d>>2]|0;i=b;return g|0}function Ve(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;f=d+8|0;g=d+4|0;e=d;c[f>>2]=a;c[g>>2]=b;c[e>>2]=-1e6;if(!(c[g>>2]|0)){a=c[e>>2]|0;i=d;return a|0}c[e>>2]=0;while(1){if((c[e>>2]|0)>=(c[(c[f>>2]|0)+20>>2]|0)){b=6;break}if((c[(c[(c[f>>2]|0)+16>>2]|0)+(c[e>>2]<<4)+12>>2]|0)==(c[g>>2]|0)){b=6;break}c[e>>2]=(c[e>>2]|0)+1}if((b|0)==6){a=c[e>>2]|0;i=d;return a|0}return 0}function We(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;j=i;i=i+32|0;l=j+24|0;p=j+20|0;o=j+16|0;n=j+12|0;m=j+8|0;k=j+4|0;h=j;c[l>>2]=a;c[p>>2]=b;c[o>>2]=d;c[n>>2]=e;c[m>>2]=f;c[k>>2]=g;c[h>>2]=ip(c[l>>2]|0,c[p>>2]|0,c[o>>2]|0,c[n>>2]|0,c[m>>2]|0)|0;bf(c[l>>2]|0,c[h>>2]|0,c[k>>2]|0,-14);i=j;return c[h>>2]|0}function Xe(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+16|0;g=e;f=e+4|0;c[g>>2]=b;a[f>>0]=d;if(!(c[(c[g>>2]|0)+4>>2]|0)){i=e;return}a[(c[(c[g>>2]|0)+4>>2]|0)+(((c[(c[g>>2]|0)+32>>2]|0)-1|0)*20|0)+3>>0]=a[f>>0]|0;i=e;return}function Ye(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;h=i;i=i+48|0;n=h+36|0;k=h+32|0;l=h+28|0;q=h+24|0;j=h+16|0;o=h+12|0;m=h+8|0;g=h+4|0;p=h;c[k>>2]=b;c[l>>2]=d;c[q>>2]=e;c[h+20>>2]=f;if(((c[(c[k>>2]|0)+32>>2]|0)+(c[l>>2]|0)|0)>(c[(c[(c[k>>2]|0)+24>>2]|0)+84>>2]|0)?(jp(c[k>>2]|0,c[l>>2]|0)|0)!=0:0){c[n>>2]=0;b=c[n>>2]|0;i=h;return b|0}c[j>>2]=c[(c[k>>2]|0)+32>>2];if((c[l>>2]|0)>0){c[m>>2]=c[q>>2];c[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0){i=e;return}c[(c[(c[g>>2]|0)+4>>2]|0)+((c[h>>2]|0)*20|0)+8>>2]=c[f>>2];i=e;return}function af(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;g=e+8|0;h=e+4|0;f=e;c[g>>2]=a;c[h>>2]=b;c[f>>2]=d;if((c[(c[g>>2]|0)+32>>2]|0)>>>0<=(c[h>>2]|0)>>>0){i=e;return}c[(c[(c[g>>2]|0)+4>>2]|0)+((c[h>>2]|0)*20|0)+12>>2]=c[f>>2];i=e;return}function bf(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0;j=i;i=i+32|0;k=j+20|0;o=j+16|0;h=j+12|0;m=j+8|0;l=j+4|0;n=j;c[k>>2]=b;c[o>>2]=e;c[h>>2]=f;c[m>>2]=g;c[n>>2]=c[c[k>>2]>>2];if((c[(c[k>>2]|0)+4>>2]|0)!=0?(d[(c[n>>2]|0)+64>>0]|0)==0:0){if((c[o>>2]|0)<0)c[o>>2]=(c[(c[k>>2]|0)+32>>2]|0)-1;c[l>>2]=(c[(c[k>>2]|0)+4>>2]|0)+((c[o>>2]|0)*20|0);Oy(c[n>>2]|0,a[(c[l>>2]|0)+1>>0]|0,c[(c[l>>2]|0)+16>>2]|0);c[(c[l>>2]|0)+16>>2]=0;n=c[h>>2]|0;if((c[m>>2]|0)==-14){c[(c[l>>2]|0)+16>>2]=n;a[(c[l>>2]|0)+1>>0]=-14;i=j;return}if(!n){c[(c[l>>2]|0)+16>>2]=0;a[(c[l>>2]|0)+1>>0]=0;i=j;return}if((c[m>>2]|0)==-6){c[(c[l>>2]|0)+16>>2]=c[h>>2];a[(c[l>>2]|0)+1>>0]=-6;i=j;return}if((c[m>>2]|0)==-10){c[(c[l>>2]|0)+16>>2]=c[h>>2];a[(c[l>>2]|0)+1>>0]=-10;Qy(c[h>>2]|0);i=j;return}if((c[m>>2]|0)<0){c[(c[l>>2]|0)+16>>2]=c[h>>2];a[(c[l>>2]|0)+1>>0]=c[m>>2];i=j;return}if(!(c[m>>2]|0))c[m>>2]=Mb(c[h>>2]|0)|0;b=c[m>>2]|0;b=rm(c[c[k>>2]>>2]|0,c[h>>2]|0,b,((b|0)<0)<<31>>31)|0;c[(c[l>>2]|0)+16>>2]=b;a[(c[l>>2]|0)+1>>0]=-1;i=j;return}if((c[m>>2]|0)==-10){i=j;return}Oy(c[n>>2]|0,c[m>>2]|0,c[h>>2]|0);i=j;return}function cf(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;f=e+12|0;g=e+8|0;h=e+4|0;j=e;c[f>>2]=b;c[g>>2]=d;if((c[g>>2]|0)>=(c[(c[f>>2]|0)+32>>2]|0)){i=e;return}c[h>>2]=(c[(c[f>>2]|0)+4>>2]|0)+((c[g>>2]|0)*20|0);c[j>>2]=c[c[f>>2]>>2];Oy(c[j>>2]|0,a[(c[h>>2]|0)+1>>0]|0,c[(c[h>>2]|0)+16>>2]|0);b=c[h>>2]|0;c[b+0>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;a[c[h>>2]>>0]=-102;if((c[g>>2]|0)!=((c[(c[f>>2]|0)+32>>2]|0)-1|0)){i=e;return}b=(c[f>>2]|0)+32|0;c[b>>2]=(c[b>>2]|0)+ -1;i=e;return}function df(e,f){e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;m=i;i=i+48|0;n=m+44|0;o=m+40|0;l=m+36|0;k=m+32|0;s=m+28|0;g=m+24|0;t=m+20|0;h=m+16|0;j=m+12|0;p=m+8|0;r=m+4|0;q=m;c[n>>2]=e;c[o>>2]=f;c[l>>2]=c[c[n>>2]>>2];c[k>>2]=c[(c[o>>2]|0)+440>>2];c[s>>2]=c[(c[o>>2]|0)+72>>2];c[g>>2]=c[(c[o>>2]|0)+68>>2];c[t>>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|0){e=c[q>>2]|0;e=se(c[l>>2]|0,e,((e|0)<0)<<31>>31)|0;c[(c[n>>2]|0)+172>>2]=e}c[p>>2]=c[(c[n>>2]|0)+172>>2];c[r>>2]=(c[p>>2]|0)+(c[q>>2]|0);if(!(c[q>>2]|0))break}while((a[(c[l>>2]|0)+64>>0]|0)!=0^1);c[(c[n>>2]|0)+36>>2]=c[g>>2];c[(c[n>>2]|0)+196>>2]=c[h>>2];a:do if(c[(c[n>>2]|0)+60>>2]|0){b[(c[n>>2]|0)+68>>1]=c[k>>2];c[j>>2]=0;while(1){if((c[j>>2]|0)>=(c[k>>2]|0))break a;b[(c[(c[n>>2]|0)+60>>2]|0)+((c[j>>2]|0)*40|0)+8>>1]=1;c[(c[(c[n>>2]|0)+60>>2]|0)+((c[j>>2]|0)*40|0)+32>>2]=c[l>>2];c[j>>2]=(c[j>>2]|0)+1}}while(0);if(c[(c[n>>2]|0)+64>>2]|0){b[(c[n>>2]|0)+70>>1]=c[(c[o>>2]|0)+444>>2];dF(c[(c[n>>2]|0)+64>>2]|0,c[(c[o>>2]|0)+472>>2]|0,b[(c[n>>2]|0)+70>>1]<<2|0)|0;_E(c[(c[o>>2]|0)+472>>2]|0,0,c[(c[o>>2]|0)+444>>2]<<2|0)|0}if(!(c[(c[n>>2]|0)+8>>2]|0)){f=c[o>>2]|0;f=f+450|0;f=a[f>>0]|0;f=f&255;e=c[n>>2]|0;e=e+88|0;f=f&65535;t=b[e>>1]|0;f=f&3;t=t&-4;f=t|f;b[e>>1]=f;e=c[n>>2]|0;zd(e);i=m;return}e=(c[n>>2]|0)+8|0;c[e>>2]=(c[e>>2]|0)+ -40;c[(c[n>>2]|0)+28>>2]=c[s>>2];c[j>>2]=1;while(1){if((c[j>>2]|0)>(c[s>>2]|0))break;b[(c[(c[n>>2]|0)+8>>2]|0)+((c[j>>2]|0)*40|0)+8>>1]=128;c[(c[(c[n>>2]|0)+8>>2]|0)+((c[j>>2]|0)*40|0)+32>>2]=c[l>>2];c[j>>2]=(c[j>>2]|0)+1}f=c[o>>2]|0;f=f+450|0;f=a[f>>0]|0;f=f&255;e=c[n>>2]|0;e=e+88|0;f=f&65535;t=b[e>>1]|0;f=f&3;t=t&-4;f=t|f;b[e>>1]=f;e=c[n>>2]|0;zd(e);i=m;return}function ef(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b+4|0;e=b;c[d>>2]=a;if(!(c[d>>2]|0)){i=b;return}c[e>>2]=c[c[d>>2]>>2];Xb(c[e>>2]|0,c[(c[d>>2]|0)+112>>2]|0);sn(c[e>>2]|0,c[(c[d>>2]|0)+316>>2]|0);i=b;return}function ff(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;m=i;i=i+32|0;h=m+20|0;k=m+16|0;l=m+12|0;g=m+8|0;n=m+4|0;j=m;c[k>>2]=a;c[l>>2]=b;c[g>>2]=e;c[n>>2]=f;if(!(d[(c[k>>2]|0)+73>>0]|0)){c[h>>2]=4;a=c[h>>2]|0;i=m;return a|0}if((d[(c[k>>2]|0)+73>>0]|0|0)>=3)f=vw(c[k>>2]|0)|0;else f=0;c[j>>2]=f;if(!(c[j>>2]|0))c[j>>2]=Lw(c[k>>2]|0,c[l>>2]|0,c[g>>2]|0,c[n>>2]|0,0)|0;c[h>>2]=c[j>>2];a=c[h>>2]|0;i=m;return a|0}function gf(a){a=a|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=c[(c[f>>2]|0)+4>>2];while(1){if(!(c[e>>2]|0))break;f=(c[e>>2]|0)+88|0;b[f>>1]=b[f>>1]&-33|32;c[e>>2]=c[(c[e>>2]|0)+52>>2]}i=d;return}function hf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;a=(jf(c[f>>2]|0,c[e>>2]|0,1208,0)|0)==0&1;i=d;return a|0}function jf(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;k=i;i=i+64|0;n=k+56|0;m=k+52|0;l=k+48|0;h=k+44|0;j=k+40|0;p=k+36|0;r=k+32|0;t=k+28|0;u=k+24|0;s=k+20|0;o=k+60|0;v=k+16|0;q=k+12|0;w=k+8|0;x=k+4|0;y=k;c[m>>2]=b;c[l>>2]=e;c[h>>2]=f;c[j>>2]=g;c[t>>2]=d[(c[h>>2]|0)+1>>0];c[u>>2]=d[c[h>>2]>>0];a[o>>0]=a[(c[h>>2]|0)+3>>0]|0;c[v>>2]=0;if(c[j>>2]|0)g=c[j>>2]|0;else g=d[(c[h>>2]|0)+2>>0]|0;c[s>>2]=g;a:while(1){b=Um(m)|0;c[p>>2]=b;if(!b){v=76;break}if((c[p>>2]|0)==(c[u>>2]|0)){v=7;break}do if((c[p>>2]|0)==(c[s>>2]|0)){if(c[j>>2]|0){c[p>>2]=Um(m)|0;if(!(c[p>>2]|0)){v=43;break a}c[v>>2]=c[m>>2];break}c[w>>2]=0;c[x>>2]=0;c[y>>2]=0;c[p>>2]=Um(l)|0;if(!(c[p>>2]|0)){v=46;break a}c[r>>2]=Um(m)|0;if((c[r>>2]|0)==94){c[y>>2]=1;c[r>>2]=Um(m)|0}if((c[r>>2]|0)==93){if((c[p>>2]|0)==93)c[x>>2]=1;c[r>>2]=Um(m)|0}while(1){if(c[r>>2]|0)f=(c[r>>2]|0)!=93;else f=0;g=c[r>>2]|0;if(!f)break;if(((g|0)==45?(d[c[m>>2]>>0]|0)!=93:0)?(c[w>>2]|0)>>>0>0?(d[c[m>>2]>>0]|0)!=0:0:0){c[r>>2]=Um(m)|0;if((c[p>>2]|0)>>>0>=(c[w>>2]|0)>>>0?(c[p>>2]|0)>>>0<=(c[r>>2]|0)>>>0:0)c[x>>2]=1;c[w>>2]=0}else{if((c[p>>2]|0)==(c[r>>2]|0))c[x>>2]=1;c[w>>2]=c[r>>2]}c[r>>2]=Um(m)|0}if(!g){v=69;break a}if(!(c[x>>2]^c[y>>2])){v=69;break a}else continue a}while(0);c[r>>2]=Um(l)|0;if((c[p>>2]|0)==(c[r>>2]|0))continue;if((d[o>>0]|0)!=0&(c[p>>2]|0)>>>0<128&(c[r>>2]|0)>>>0<128?(d[440+(c[p>>2]&255)>>0]|0)==(d[440+(c[r>>2]&255)>>0]|0):0)continue;if((c[p>>2]|0)!=(c[t>>2]|0)){v=75;break}if(!((c[r>>2]|0)!=0?(c[m>>2]|0)!=(c[v>>2]|0):0)){v=75;break}}if((v|0)==7){while(1){v=0;b=Um(m)|0;c[p>>2]=b;if((b|0)==(c[u>>2]|0))x=1;else x=(c[p>>2]|0)==(c[t>>2]|0);w=c[p>>2]|0;if(!x)break;if((w|0)!=(c[t>>2]|0)){v=7;continue}if(!(Um(l)|0)){v=12;break}else v=7}if((v|0)==12){c[n>>2]=0;b=c[n>>2]|0;i=k;return b|0}if(!w){c[n>>2]=1;b=c[n>>2]|0;i=k;return b|0}do if((c[p>>2]|0)==(c[s>>2]|0)){if(c[j>>2]|0){c[p>>2]=Um(m)|0;if(c[p>>2]|0)break;c[n>>2]=0;b=c[n>>2]|0;i=k;return b|0}b:while(1){if(d[c[l>>2]>>0]|0)p=(jf((c[m>>2]|0)+ -1|0,c[l>>2]|0,c[h>>2]|0,c[j>>2]|0)|0)==0;else p=0;o=c[l>>2]|0;if(!p)break;c[l>>2]=o+1;if((d[o>>0]|0)<192)continue;while(1){if((d[c[l>>2]>>0]&192|0)!=128)continue b;c[l>>2]=(c[l>>2]|0)+1}}c[n>>2]=(d[o>>0]|0)!=0&1;b=c[n>>2]|0;i=k;return b|0}while(0);c:do if((c[p>>2]|0)>>>0<=128){s=c[p>>2]|0;if(a[o>>0]|0){c[q>>2]=s&~(d[1224+(c[p>>2]&255)>>0]&32);c[p>>2]=d[440+(c[p>>2]&255)>>0]}else c[q>>2]=s;while(1){b=c[l>>2]|0;c[l>>2]=b+1;b=d[b>>0]|0;c[r>>2]=b;if(!b)break c;if((c[r>>2]|0)!=(c[p>>2]|0)?(c[r>>2]|0)!=(c[q>>2]|0):0)continue;if(jf(c[m>>2]|0,c[l>>2]|0,c[h>>2]|0,c[j>>2]|0)|0)break}c[n>>2]=1;b=c[n>>2]|0;i=k;return b|0}else{while(1){b=Um(l)|0;c[r>>2]=b;if(!b)break c;if((c[r>>2]|0)!=(c[p>>2]|0))continue;if(jf(c[m>>2]|0,c[l>>2]|0,c[h>>2]|0,c[j>>2]|0)|0)break}c[n>>2]=1;b=c[n>>2]|0;i=k;return b|0}while(0);c[n>>2]=0;b=c[n>>2]|0;i=k;return b|0}else if((v|0)==43){c[n>>2]=0;b=c[n>>2]|0;i=k;return b|0}else if((v|0)==46){c[n>>2]=0;b=c[n>>2]|0;i=k;return b|0}else if((v|0)==69){c[n>>2]=0;b=c[n>>2]|0;i=k;return b|0}else if((v|0)==75){c[n>>2]=0;b=c[n>>2]|0;i=k;return b|0}else if((v|0)==76){c[n>>2]=(d[c[l>>2]>>0]|0)==0&1;b=c[n>>2]|0;i=k;return b|0}return 0}function kf(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;u=i;i=i+64|0;l=u+56|0;o=u+52|0;t=u+48|0;x=u+44|0;z=u+40|0;n=u+36|0;m=u+32|0;j=u+28|0;r=u+24|0;q=u+20|0;v=u+16|0;w=u+12|0;s=u+8|0;y=u+4|0;p=u;c[o>>2]=b;c[t>>2]=e;c[x>>2]=f;c[z>>2]=g;c[n>>2]=h;c[m>>2]=0;c[r>>2]=0;c[q>>2]=0;if(!(lf(c[o>>2]|0)|0)){c[l>>2]=Qb(99392)|0;b=c[l>>2]|0;i=u;return b|0}if(!(c[t>>2]|0))c[t>>2]=1216;Nc(c[o>>2]|0,0);a:while(1){if(c[m>>2]|0)break;if(!(a[c[t>>2]>>0]|0))break;c[s>>2]=0;c[r>>2]=0;c[m>>2]=mf(c[o>>2]|0,c[t>>2]|0,-1,r,j)|0;if(c[m>>2]|0)continue;if(!(c[r>>2]|0)){c[t>>2]=c[j>>2];continue}c[v>>2]=0;c[w>>2]=te(c[r>>2]|0)|0;do{c[m>>2]=je(c[r>>2]|0)|0;do if(c[x>>2]|0){if(100!=(c[m>>2]|0)){if(101!=(c[m>>2]|0)|(c[v>>2]|0)!=0)break;if(!(c[(c[o>>2]|0)+24>>2]&256))break}if(!(c[v>>2]|0)){c[q>>2]=se(c[o>>2]|0,(c[w>>2]<<1<<2)+1|0,0)|0;if(!(c[q>>2]|0))break a;c[y>>2]=0;while(1){if((c[y>>2]|0)>=(c[w>>2]|0))break;b=Ce(c[r>>2]|0,c[y>>2]|0)|0;c[(c[q>>2]|0)+(c[y>>2]<<2)>>2]=b;c[y>>2]=(c[y>>2]|0)+1}c[v>>2]=1}b:do if((c[m>>2]|0)==100){c[s>>2]=(c[q>>2]|0)+(c[w>>2]<<2);c[y>>2]=0;while(1){if((c[y>>2]|0)>=(c[w>>2]|0))break b;b=Ae(c[r>>2]|0,c[y>>2]|0)|0;c[(c[s>>2]|0)+(c[y>>2]<<2)>>2]=b;if((c[(c[s>>2]|0)+(c[y>>2]<<2)>>2]|0)==0?(Be(c[r>>2]|0,c[y>>2]|0)|0)!=5:0){k=27;break a}c[y>>2]=(c[y>>2]|0)+1}}while(0);if(xb[c[x>>2]&7](c[z>>2]|0,c[w>>2]|0,c[s>>2]|0,c[q>>2]|0)|0){k=30;break a}}while(0)}while((c[m>>2]|0)==100);c[m>>2]=vd(c[r>>2]|0)|0;c[r>>2]=0;c[t>>2]=c[j>>2];while(1){if(!(d[1224+(d[c[t>>2]>>0]|0)>>0]&1))break;c[t>>2]=(c[t>>2]|0)+1}Xb(c[o>>2]|0,c[q>>2]|0);c[q>>2]=0}if((k|0)==27)a[(c[o>>2]|0)+64>>0]=1;else if((k|0)==30){c[m>>2]=4;vd(c[r>>2]|0)|0;c[r>>2]=0;Nc(c[o>>2]|0,4)}if(c[r>>2]|0)vd(c[r>>2]|0)|0;Xb(c[o>>2]|0,c[q>>2]|0);c[m>>2]=wd(c[o>>2]|0,c[m>>2]|0)|0;do if((c[m>>2]|0)!=0&(c[n>>2]|0)!=0){c[p>>2]=1+(Mb(nf(c[o>>2]|0)|0)|0);b=c[p>>2]|0;b=gc(b,((b|0)<0)<<31>>31)|0;c[c[n>>2]>>2]=b;if(c[c[n>>2]>>2]|0){e=c[c[n>>2]>>2]|0;b=nf(c[o>>2]|0)|0;dF(e|0,b|0,c[p>>2]|0)|0;break}else{c[m>>2]=7;Nc(c[o>>2]|0,7);break}}else if(c[n>>2]|0)c[c[n>>2]>>2]=0;while(0);c[l>>2]=c[m>>2];b=c[l>>2]|0;i=u;return b|0}function lf(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;d=b+8|0;e=b+4|0;f=b;c[e>>2]=a;do if(!(c[e>>2]|0)){sk(9840);c[d>>2]=0}else{c[f>>2]=c[(c[e>>2]|0)+76>>2];if((c[f>>2]|0)==-1607883113){c[d>>2]=1;break}if($f(c[e>>2]|0)|0)sk(31136);c[d>>2]=0}while(0);i=b;return c[d>>2]|0}function mf(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;h=i;i=i+32|0;n=h+20|0;m=h+16|0;l=h+12|0;k=h+8|0;j=h+4|0;g=h;c[n>>2]=a;c[m>>2]=b;c[l>>2]=d;c[k>>2]=e;c[j>>2]=f;c[g>>2]=pf(c[n>>2]|0,c[m>>2]|0,c[l>>2]|0,1,0,c[k>>2]|0,c[j>>2]|0)|0;i=h;return c[g>>2]|0}function nf(b){b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;e=d+8|0;f=d+4|0;g=d;c[f>>2]=b;if(!(c[f>>2]|0)){c[e>>2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0,c[j>>2]|0,c[r>>2]|0,c[m>>2]|0,c[s>>2]|0)|0}c[k>>2]=c[l>>2];a=c[k>>2]|0;i=q;return a|0}function qf(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;g=i;i=i+64|0;v=g;n=g+56|0;h=g+52|0;t=g+48|0;s=g+44|0;m=g+40|0;l=g+36|0;r=g+32|0;w=g+28|0;u=g+24|0;p=g+60|0;k=g+20|0;x=g+16|0;j=g+12|0;o=g+8|0;c[h>>2]=b;c[t>>2]=e;c[s>>2]=f;c[m>>2]=0;c[u>>2]=-1;c[k>>2]=c[c[h>>2]>>2];c[x>>2]=c[(c[k>>2]|0)+92>>2];if(!(c[(c[k>>2]|0)+148>>2]|0))c[(c[k>>2]|0)+240>>2]=0;c[(c[h>>2]|0)+12>>2]=0;c[(c[h>>2]|0)+480>>2]=c[t>>2];c[l>>2]=0;c[r>>2]=mn(33)|0;f=c[k>>2]|0;if(!(c[r>>2]|0)){a[f+64>>0]=1;c[n>>2]=7;b=c[n>>2]|0;i=g;return b|0}a[p>>0]=a[f+250>>0]|0;if(c[(c[k>>2]|0)+276>>2]|0)a[(c[k>>2]|0)+250>>0]=1;while(1){if(a[(c[k>>2]|0)+64>>0]|0)break;if(!(a[(c[t>>2]|0)+(c[l>>2]|0)>>0]|0))break;c[(c[h>>2]|0)+504>>2]=(c[t>>2]|0)+(c[l>>2]|0);b=qm((c[t>>2]|0)+(c[l>>2]|0)|0,w)|0;c[(c[h>>2]|0)+508>>2]=b;c[l>>2]=(c[l>>2]|0)+(c[(c[h>>2]|0)+508>>2]|0);if((c[l>>2]|0)>(c[x>>2]|0)){q=10;break}f=c[w>>2]|0;if((f|0)==150){q=14;break}else if((f|0)==151)if(c[(c[k>>2]|0)+240>>2]|0){q=13;break}else continue;else if((f|0)==1)c[(c[h>>2]|0)+480>>2]=(c[t>>2]|0)+(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;c[v>>2]=c[c[s>>2]>>2];tc(y,1200,v);c[(c[h>>2]|0)+4>>2]=0;c[m>>2]=(c[m>>2]|0)+1}if(((c[(c[h>>2]|0)+8>>2]|0)!=0?(c[(c[h>>2]|0)+64>>2]|0)>0:0)?(d[(c[h>>2]|0)+18>>0]|0)==0:0){qn(c[(c[h>>2]|0)+8>>2]|0);c[(c[h>>2]|0)+8>>2]=0}if(!(d[(c[h>>2]|0)+18>>0]|0)){Xb(c[k>>2]|0,c[(c[h>>2]|0)+400>>2]|0);c[(c[h>>2]|0)+400>>2]=0;c[(c[h>>2]|0)+396>>2]=0}hc(c[(c[h>>2]|0)+520>>2]|0);if(!(a[(c[h>>2]|0)+451>>0]|0))Vb(c[k>>2]|0,c[(c[h>>2]|0)+484>>2]|0);if(a[(c[h>>2]|0)+449>>0]|0)rn(c[k>>2]|0,c[(c[h>>2]|0)+532>>2]|0);Ub(c[k>>2]|0,c[(c[h>>2]|0)+488>>2]|0);c[l>>2]=(c[(c[h>>2]|0)+444>>2]|0)-1;while(1){p=c[k>>2]|0;if((c[l>>2]|0)<0)break;Xb(p,c[(c[(c[h>>2]|0)+472>>2]|0)+(c[l>>2]<<2)>>2]|0);c[l>>2]=(c[l>>2]|0)+ -1}Xb(p,c[(c[h>>2]|0)+472>>2]|0);while(1){if(!(c[(c[h>>2]|0)+404>>2]|0))break;c[j>>2]=c[(c[h>>2]|0)+404>>2];c[(c[h>>2]|0)+404>>2]=c[c[j>>2]>>2];Xb(c[k>>2]|0,c[j>>2]|0)}while(1){if(!(c[(c[h>>2]|0)+524>>2]|0))break;c[o>>2]=c[(c[h>>2]|0)+524>>2];c[(c[h>>2]|0)+524>>2]=c[(c[o>>2]|0)+72>>2];Vb(c[k>>2]|0,c[o>>2]|0)}if((c[m>>2]|0)>0?(c[(c[h>>2]|0)+12>>2]|0)==0:0)c[(c[h>>2]|0)+12>>2]=1;c[n>>2]=c[m>>2];y=c[n>>2]|0;i=g;return y|0}function rf(a){a=a|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=se(c[f>>2]|0,40,0)|0;if(!(c[e>>2]|0)){f=c[e>>2]|0;i=d;return f|0}b[(c[e>>2]|0)+8>>1]=1;c[(c[e>>2]|0)+32>>2]=c[f>>2];f=c[e>>2]|0;i=d;return f|0}function sf(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0;m=i;i=i+32|0;j=m+12|0;l=m+8|0;k=m+4|0;h=m+16|0;n=m;c[j>>2]=b;c[l>>2]=d;c[k>>2]=e;a[h>>0]=f;c[n>>2]=g;if(!(c[j>>2]|0)){i=m;return}Vd(c[j>>2]|0,c[k>>2]|0,c[l>>2]|0,a[h>>0]|0,c[n>>2]|0)|0;i=m;return}function tf(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;if(!(c[d>>2]|0)){i=b;return}Bd(c[d>>2]|0);Xb(c[(c[d>>2]|0)+32>>2]|0,c[d>>2]|0);i=b;return}function uf(){return 8}function vf(){return 1504}function wf(){var a=0,b=0,d=0,e=0,f=0,g=0,h=0;f=i;i=i+16|0;e=f+12|0;d=f+8|0;a=f+4|0;b=f;if(!(c[9669]|0))Cf();h=136|0;g=h+40|0;do{c[h>>2]=0;h=h+4|0}while((h|0)<(g|0));if(c[9661]|0)c[34]=8;if(((c[9708]|0)!=0?(c[9709]|0)>=100:0)?(c[9710]|0)>0:0){c[a>>2]=c[9709]&-8;c[9709]=c[a>>2];c[b>>2]=c[9708];c[d>>2]=c[9710];c[41]=c[b>>2];c[42]=c[d>>2];c[e>>2]=0;while(1){if((c[e>>2]|0)>=((c[d>>2]|0)-1|0))break;c[c[b>>2]>>2]=(c[b>>2]|0)+(c[a>>2]|0);c[b>>2]=c[c[b>>2]>>2];c[e>>2]=(c[e>>2]|0)+1}c[c[b>>2]>>2]=0;c[40]=(c[b>>2]|0)+4}else{c[40]=0;c[9708]=0;c[9709]=0;c[9710]=0}if(((c[9711]|0)!=0?(c[9712]|0)>=512:0)?(c[9713]|0)>=1:0){g=c[9674]|0;h=c[9676]|0;h=ub[g&31](h)|0;i=f;return h|0}c[9711]=0;c[9712]=0;c[9713]=0;g=c[9674]|0;h=c[9676]|0;h=ub[g&31](h)|0;i=f;return h|0}function xf(){var a=0,b=0,d=0,e=0;a=i;i=i+16|0;b=a+8|0;d=a+4|0;e=a;c[d>>2]=1576;c[e>>2]=6232;c[b>>2]=0;while(1){if((c[b>>2]|0)>=57)break;xk(c[d>>2]|0,(c[e>>2]|0)+((c[b>>2]|0)*36|0)|0);c[b>>2]=(c[b>>2]|0)+1}lm();mm();i=a;return}function yf(){var a=0,b=0;a=i;if(!(c[9688]|0))Df();b=ub[c[38640+112>>2]&31](c[9687]|0)|0;i=a;return b|0}function zf(){var a=0,b=0,d=0;a=i;i=i+16|0;b=a+4|0;d=a;c[d>>2]=fc(10)|0;if(!(c[d>>2]|0)){c[b>>2]=7;d=c[b>>2]|0;i=a;return d|0}else{hc(c[d>>2]|0);c[b>>2]=yc()|0;d=c[b>>2]|0;i=a;return d|0}return 0}function Af(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;g=e+12|0;j=e+8|0;f=e+4|0;h=e;c[g>>2]=a;c[j>>2]=b;c[f>>2]=d;if(!(c[791]|0)){i=e;return}c[j>>2]=c[j>>2]&-8;c[792]=c[j>>2];a=c[f>>2]|0;c[799]=a;c[793]=a;if((c[f>>2]|0)>90)d=10;else d=((c[f>>2]|0)/10|0)+1|0;c[794]=d;c[795]=c[g>>2];c[798]=0;c[800]=0;while(1){a=c[f>>2]|0;c[f>>2]=a+ -1;d=c[g>>2]|0;if(!a)break;c[h>>2]=d;c[c[h>>2]>>2]=c[798];c[798]=c[h>>2];c[g>>2]=(c[g>>2]|0)+(c[j>>2]|0)}c[796]=d;i=e;return}function Bf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+48|0;d=f+44|0;k=f+40|0;h=f+24|0;e=f+16|0;j=f+8|0;g=f;c[k>>2]=a;c[e>>2]=0;if(c[9716]|0){c[d>>2]=Qb(125290)|0;a=c[d>>2]|0;i=f;return a|0}c[h>>2]=b;do switch(c[k>>2]|0){case 9:{k=c[h>>2]|0;a=c[k>>2]|0;c[h>>2]=k+4;c[9660]=a;break};case 5:{if(!(c[9669]|0))Cf();k=c[h>>2]|0;a=c[k>>2]|0;c[h>>2]=k+4;c[a+0>>2]=c[9669];c[a+4>>2]=c[9670];c[a+8>>2]=c[9671];c[a+12>>2]=c[9672];c[a+16>>2]=c[9673];c[a+20>>2]=c[9674];c[a+24>>2]=c[9675];c[a+28>>2]=c[9676];break};case 19:{if(!(c[9688]|0))Df();g=c[h>>2]|0;j=c[g>>2]|0;c[h>>2]=g+4;j=j+0|0;h=38744|0;g=j+52|0;do{c[j>>2]=c[h>>2];j=j+4|0;h=h+4|0}while((j|0)<(g|0));break};case 16:{a=c[h>>2]|0;k=c[a>>2]|0;c[h>>2]=a+4;c[9723]=k;k=c[h>>2]|0;a=c[k>>2]|0;c[h>>2]=k+4;c[9724]=a;break};case 17:{k=c[h>>2]|0;a=c[k>>2]|0;c[h>>2]=k+4;c[9663]=a;break};case 22:{a=c[h>>2]|0;k=a;l=c[k>>2]|0;k=c[k+4>>2]|0;c[h>>2]=a+8;a=j;c[a>>2]=l;c[a+4>>2]=k;a=c[h>>2]|0;k=a;l=c[k>>2]|0;k=c[k+4>>2]|0;c[h>>2]=a+8;a=g;c[a>>2]=l;c[a+4>>2]=k;a=g;b=c[a+4>>2]|0;a=(c[g+4>>2]|0)<0|((b|0)>0|(b|0)==0&(c[a>>2]|0)>>>0>0);b=g;c[b>>2]=a?0:l;c[b+4>>2]=a?0:k;b=g;k=c[b+4>>2]|0;a=38824|0;c[a>>2]=c[b>>2];c[a+4>>2]=k;if((c[j+4>>2]|0)<0){l=j;c[l>>2]=0;c[l+4>>2]=0}a=j;b=c[a+4>>2]|0;l=g;k=c[l+4>>2]|0;if((b|0)>(k|0)|((b|0)==(k|0)?(c[a>>2]|0)>>>0>(c[l>>2]|0)>>>0:0)){k=g;a=c[k+4>>2]|0;l=j;c[l>>2]=c[k>>2];c[l+4>>2]=a}k=j;a=c[k+4>>2]|0;l=38816|0;c[l>>2]=c[k>>2];c[l+4>>2]=a;break};case 13:{l=c[h>>2]|0;a=c[l>>2]|0;c[h>>2]=l+4;c[9667]=a;a=c[h>>2]|0;l=c[a>>2]|0;c[h>>2]=a+4;c[9668]=l;break};case 7:{a=c[h>>2]|0;l=c[a>>2]|0;c[h>>2]=a+4;c[9711]=l;l=c[h>>2]|0;a=c[l>>2]|0;c[h>>2]=l+4;c[9712]=a;a=c[h>>2]|0;l=c[a>>2]|0;c[h>>2]=a+4;c[9713]=l;break};case 20:{a=c[h>>2]|0;l=c[a>>2]|0;c[h>>2]=a+4;c[9664]=l;break};case 15:{c[e>>2]=1;break};case 4:{a=c[h>>2]|0;l=c[a>>2]|0;c[h>>2]=a+4;c[9669]=c[l+0>>2];c[9670]=c[l+4>>2];c[9671]=c[l+8>>2];c[9672]=c[l+12>>2];c[9673]=c[l+16>>2];c[9674]=c[l+20>>2];c[9675]=c[l+24>>2];c[9676]=c[l+28>>2];break};case 6:{a=c[h>>2]|0;l=c[a>>2]|0;c[h>>2]=a+4;c[9708]=l;l=c[h>>2]|0;a=c[l>>2]|0;c[h>>2]=l+4;c[9709]=a;a=c[h>>2]|0;l=c[a>>2]|0;c[h>>2]=a+4;c[9710]=l;break};case 18:{j=c[h>>2]|0;g=c[j>>2]|0;c[h>>2]=j+4;j=38744|0;h=g+0|0;g=j+52|0;do{c[j>>2]=c[h>>2];j=j+4|0;h=h+4|0}while((j|0)<(g|0));break};case 14:break;default:c[e>>2]=1}while(0);c[d>>2]=c[e>>2];l=c[d>>2]|0;i=f;return l|0}function Cf(){var a=0,b=0;a=i;i=i+16|0;b=a;c[b>>2]=6120;Bf(4,b)|0;i=a;return}function Df(){var a=0,b=0;a=i;i=i+16|0;b=a;c[b>>2]=6064;Bf(18,b)|0;i=a;return}function Ef(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+16|0;f=b+12|0;g=b+8|0;d=b+4|0;e=b;c[f>>2]=a;Rb(c[f>>2]|0);c[g>>2]=0;while(1){if((c[g>>2]|0)>=(c[(c[f>>2]|0)+20>>2]|0))break;c[d>>2]=c[(c[(c[f>>2]|0)+16>>2]|0)+(c[g>>2]<<4)+4>>2];if(c[d>>2]|0){c[e>>2]=Sb(c[d>>2]|0)|0;Ff(c[e>>2]|0)}c[g>>2]=(c[g>>2]|0)+1}i=b;return 0}function Ff(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;Zk(c[(c[d>>2]|0)+204>>2]|0);i=b;return}function Gf(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;n=i;i=i+32|0;j=n+28|0;o=n+24|0;q=n+20|0;p=n+16|0;m=n+12|0;k=n+8|0;h=n+4|0;l=n;c[o>>2]=d;c[q>>2]=e;c[p>>2]=f;c[m>>2]=g;if(c[(c[o>>2]|0)+252>>2]|0){c[j>>2]=5;d=c[j>>2]|0;i=n;return d|0}if(a[(c[o>>2]|0)+251>>0]|0)hc(c[(c[o>>2]|0)+276>>2]|0);d=c[p>>2]&-8;c[p>>2]=d;c[p>>2]=(c[p>>2]|0)<=4?0:d;if((c[m>>2]|0)<0)c[m>>2]=0;do if(!((c[p>>2]|0)==0|(c[m>>2]|0)==0)){if(c[q>>2]|0){c[k>>2]=c[q>>2];break}kh();d=$(c[p>>2]|0,c[m>>2]|0)|0;c[k>>2]=gc(d,((d|0)<0)<<31>>31)|0;lh();if(c[k>>2]|0){d=Tb(c[k>>2]|0)|0;c[m>>2]=(d|0)/(c[p>>2]|0)|0}}else{c[p>>2]=0;c[k>>2]=0}while(0);c[(c[o>>2]|0)+276>>2]=c[k>>2];c[(c[o>>2]|0)+272>>2]=0;b[(c[o>>2]|0)+248>>1]=c[p>>2];if(c[k>>2]|0){c[l>>2]=c[k>>2];c[h>>2]=(c[m>>2]|0)-1;while(1){if((c[h>>2]|0)<0)break;c[c[l>>2]>>2]=c[(c[o>>2]|0)+272>>2];c[(c[o>>2]|0)+272>>2]=c[l>>2];c[l>>2]=(c[l>>2]|0)+(c[p>>2]|0);c[h>>2]=(c[h>>2]|0)+ -1}c[(c[o>>2]|0)+280>>2]=c[l>>2];a[(c[o>>2]|0)+250>>0]=1;a[(c[o>>2]|0)+251>>0]=(c[q>>2]|0)==0?1:0}else{c[(c[o>>2]|0)+276>>2]=c[o>>2];c[(c[o>>2]|0)+280>>2]=c[o>>2];a[(c[o>>2]|0)+250>>0]=0;a[(c[o>>2]|0)+251>>0]=0}c[j>>2]=0;d=c[j>>2]|0;i=n;return d|0}function Hf(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=(c[d>>2]|0)+32|0;D=c[a+4>>2]|0;i=b;return c[a>>2]|0}function If(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return c[(c[b>>2]|0)+80>>2]|0}function Jf(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return c[(c[b>>2]|0)+84>>2]|0}function Kf(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=Lf(c[d>>2]|0,0)|0;i=b;return a|0}function Lf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;g=d;e=d+12|0;f=d+8|0;h=d+4|0;c[f>>2]=a;c[h>>2]=b;if(!(c[f>>2]|0)){c[e>>2]=0;a=c[e>>2]|0;i=d;return a|0}if(!($f(c[f>>2]|0)|0)){c[e>>2]=Qb(125804)|0;a=c[e>>2]|0;i=d;return a|0}Xk(c[f>>2]|0);Uk(c[f>>2]|0)|0;if((c[h>>2]|0)==0?(Hk(c[f>>2]|0)|0)!=0:0){Lc(c[f>>2]|0,5,5992,g);c[e>>2]=5;a=c[e>>2]|0;i=d;return a|0}c[(c[f>>2]|0)+76>>2]=1691352191;rd(c[f>>2]|0);c[e>>2]=0;a=c[e>>2]|0;i=d;return a|0}function Mf(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=Lf(c[d>>2]|0,1)|0;i=b;return a|0}function Nf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;f=e+8|0;h=e+4|0;g=e;c[f>>2]=a;c[h>>2]=b;c[g>>2]=d;c[(c[f>>2]|0)+444>>2]=c[h>>2];c[(c[f>>2]|0)+448>>2]=c[g>>2];c[(c[f>>2]|0)+452>>2]=0;c[(c[f>>2]|0)+492>>2]=0;i=e;return 0}function Of(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=c[e>>2]|0;if((c[f>>2]|0)>0){Nf(b,34,c[e>>2]|0)|0;c[(c[e>>2]|0)+492>>2]=c[f>>2];i=d;return 0}else{Nf(b,0,0)|0;i=d;return 0}return 0}function Pf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;i=i+32|0;e=d+16|0;j=d+12|0;h=d+8|0;f=d+4|0;g=d;c[j>>2]=a;c[h>>2]=b;c[f>>2]=c[j>>2];c[g>>2]=c[(c[j>>2]|0)+492>>2];if((((c[h>>2]|0)+1|0)*1e3|0)>(c[g>>2]|0)){c[e>>2]=0;j=c[e>>2]|0;i=d;return j|0}else{fg(c[c[f>>2]>>2]|0,1e6)|0;c[e>>2]=1;j=c[e>>2]|0;i=d;return j|0}return 0}function Qf(d,f,g,h,j,k,l,m,n){d=d|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;var o=0,p=0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0;xk((c[q>>2]|0)+336|0,c[u>>2]|0)}do if(c[u>>2]|0){if(((c[(c[u>>2]|0)+16>>2]|0)==0?(c[(c[u>>2]|0)+12>>2]|0)==0:0)?(d[r>>0]|0)==0:0)break;c[x>>2]=c[u>>2];e=c[x>>2]|0;i=y;return e|0}while(0);c[x>>2]=0;e=c[x>>2]|0;i=y;return e|0}function Tf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+32|0;h=e;g=e+20|0;j=e+8|0;f=e+4|0;c[g>>2]=a;c[e+16>>2]=b;c[e+12>>2]=d;c[j>>2]=c[(c[(c[g>>2]|0)+4>>2]|0)+24>>2];c[h>>2]=c[j>>2];c[f>>2]=qc(4928,h)|0;Ud(c[g>>2]|0,c[f>>2]|0,-1);hc(c[f>>2]|0);i=e;return}function Uf(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;b=c[f>>2]|0;if((c[e>>2]|0)>0){Vf(b,5,c[e>>2]|0)|0;i=d;return 0}else{Vf(b,0,0)|0;i=d;return 0}return 0}function Vf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;f=i;i=i+16|0;g=f+12|0;j=f+8|0;h=f+4|0;e=f;c[g>>2]=a;c[j>>2]=b;c[h>>2]=d;c[e>>2]=c[(c[g>>2]|0)+216>>2];c[(c[g>>2]|0)+212>>2]=c[j>>2];c[(c[g>>2]|0)+216>>2]=c[h>>2];i=f;return c[e>>2]|0}function Wf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;j=f+12|0;g=f+8|0;h=f+4|0;k=f;c[j>>2]=a;c[g>>2]=b;c[h>>2]=d;c[k>>2]=e;if((c[k>>2]|0)<(c[j>>2]|0)){i=f;return 0}kh();_f(c[g>>2]|0,c[h>>2]|0)|0;lh();i=f;return 0}function X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2]=(c[e>>2]|0)+ -1;c[f>>2]=(c[f>>2]|0)+ -16}if((b|0)==7){a=c[e>>2]|0;i=d;return a|0}return 0}function Zf(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;n=i;i=i+32|0;k=n+28|0;p=n+24|0;m=n+20|0;g=n+16|0;o=n+12|0;h=n+8|0;l=n+4|0;j=n;c[k>>2]=a;c[p>>2]=b;c[m>>2]=d;c[g>>2]=e;c[o>>2]=f;c[h>>2]=0;c[j>>2]=0;c[l>>2]=0;while(1){if(!((c[h>>2]|0)==0?(c[l>>2]|0)<(c[(c[k>>2]|0)+20>>2]|0):0))break;if(((c[p>>2]|0)==10?1:(c[l>>2]|0)==(c[p>>2]|0))?(c[h>>2]=tk(c[(c[(c[k>>2]|0)+16>>2]|0)+(c[l>>2]<<4)+4>>2]|0,c[m>>2]|0,c[g>>2]|0,c[o>>2]|0)|0,c[g>>2]=0,c[o>>2]=0,(c[h>>2]|0)==5):0){c[j>>2]=1;c[h>>2]=0}c[l>>2]=(c[l>>2]|0)+1}i=n;return((c[h>>2]|0)==0&(c[j>>2]|0)!=0?5:c[h>>2]|0)|0}function _f(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;a=Xf(c[f>>2]|0,c[e>>2]|0,0,0,0)|0;i=d;return a|0}function $f(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;d=b+8|0;f=b+4|0;e=b;c[f>>2]=a;c[e>>2]=c[(c[f>>2]|0)+76>>2];if((c[e>>2]|0)!=1266094736&(c[e>>2]|0)!=-1607883113&(c[e>>2]|0)!=-264537850){sk(4872);c[d>>2]=0;f=c[d>>2]|0;i=b;return f|0}else{c[d>>2]=1;f=c[d>>2]|0;i=b;return f|0}return 0}function ag(a){a=a|0;var b=0,e=0,f=0;e=i;i=i+16|0;b=e+4|0;f=e;c[f>>2]=a;if((c[f>>2]|0)!=0?($f(c[f>>2]|0)|0)==0:0){c[b>>2]=Qb(126921)|0;f=c[b>>2]|0;i=e;return f|0}if((c[f>>2]|0)!=0?(d[(c[f>>2]|0)+64>>0]|0|0)==0:0){c[b>>2]=c[(c[f>>2]|0)+52>>2]&c[(c[f>>2]|0)+56>>2];f=c[b>>2]|0;i=e;return f|0}c[b>>2]=7;f=c[b>>2]|0;i=e;return f|0}function bg(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+32|0;f=e+16|0;j=e+12|0;k=e+8|0;h=e+4|0;g=e;c[j>>2]=a;c[k>>2]=b;c[h>>2]=d;if((c[k>>2]|0)<0|(c[k>>2]|0)>=12){c[f>>2]=-1;a=c[f>>2]|0;i=e;return a|0}c[g>>2]=c[(c[j>>2]|0)+88+(c[k>>2]<<2)>>2];if((c[h>>2]|0)>=0){if((c[h>>2]|0)>(c[1696+(c[k>>2]<<2)>>2]|0))c[h>>2]=c[1696+(c[k>>2]<<2)>>2];c[(c[j>>2]|0)+88+(c[k>>2]<<2)>>2]=c[h>>2]}c[f>>2]=c[g>>2];a=c[f>>2]|0;i=e;return a|0}function cg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;a=dg(c[f>>2]|0,c[e>>2]|0,6,0)|0;i=d;return a|0}function dg(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;p=i;i=i+48|0;q=p;m=p+40|0;o=p+36|0;r=p+32|0;g=p+28|0;n=p+24|0;l=p+20|0;j=p+16|0;s=p+12|0;k=p+8|0;h=p+4|0;c[o>>2]=b;c[r>>2]=d;c[g>>2]=e;c[n>>2]=f;c[k>>2]=0;c[h>>2]=0;c[c[r>>2]>>2]=0;c[j>>2]=Zb()|0;if(c[j>>2]|0){c[m>>2]=c[j>>2];b=c[m>>2]|0;i=p;return b|0}if(!(1<<(c[g>>2]&7)&70)){c[m>>2]=Qb(127429)|0;b=c[m>>2]|0;i=p;return b|0}do if(c[9661]|0){if(c[g>>2]&32768){c[s>>2]=0;break}if(c[g>>2]&65536){c[s>>2]=1;break}else{c[s>>2]=c[9662];break}}else c[s>>2]=0;while(0);if(!(c[g>>2]&262144)){if(c[9715]|0)c[g>>2]=c[g>>2]|131072}else c[g>>2]=c[g>>2]&-131073;c[g>>2]=c[g>>2]&-655129;c[l>>2]=Mc(528,0)|0;do if(c[l>>2]|0){if((c[s>>2]|0)!=0?(c[(c[l>>2]|0)+12>>2]=8,(c[(c[l>>2]|0)+12>>2]|0)==0):0){hc(c[l>>2]|0);c[l>>2]=0;break}c[(c[l>>2]|0)+56>>2]=255;c[(c[l>>2]|0)+20>>2]=2;c[(c[l>>2]|0)+76>>2]=-264537850;c[(c[l>>2]|0)+16>>2]=(c[l>>2]|0)+456;e=(c[l>>2]|0)+88|0;s=1696;f=e+48|0;do{c[e>>2]=c[s>>2];e=e+4|0;s=s+4|0}while((e|0)<(f|0));c[(c[l>>2]|0)+132>>2]=0;a[(c[l>>2]|0)+62>>0]=1;a[(c[l>>2]|0)+66>>0]=-1;e=38816;d=c[e+4>>2]|0;b=(c[l>>2]|0)+40|0;c[b>>2]=c[e>>2];c[b+4>>2]=d;c[(c[l>>2]|0)+72>>2]=0;c[(c[l>>2]|0)+136>>2]=2147483647;b=(c[l>>2]|0)+24|0;c[b>>2]=c[b>>2]|9437264;nh((c[l>>2]|0)+428|0);nh((c[l>>2]|0)+308|0);eg(c[l>>2]|0,3320,1,0,8,0)|0;eg(c[l>>2]|0,3320,3,0,8,0)|0;eg(c[l>>2]|0,3320,2,0,8,0)|0;eg(c[l>>2]|0,3328,1,1,8,0)|0;if(!(a[(c[l>>2]|0)+64>>0]|0)){b=$g(c[l>>2]|0,1,3320,0)|0;c[(c[l>>2]|0)+8>>2]=b;eg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|0)!=7){if(c[j>>2]|0)c[(c[l>>2]|0)+76>>2]=1266094736}else{Kf(c[l>>2]|0)|0;c[l>>2]=0}c[c[r>>2]>>2]=c[l>>2];c[m>>2]=wd(0,c[j>>2]|0)|0;b=c[m>>2]|0;i=p;return b|0}function eg(b,e,f,g,h,j){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;r=i;i=i+64|0;m=r;t=r+44|0;n=r+40|0;p=r+36|0;x=r+48|0;v=r+32|0;u=r+28|0;w=r+24|0;q=r+20|0;o=r+16|0;k=r+12|0;s=r+8|0;l=r+4|0;c[n>>2]=b;c[p>>2]=e;a[x>>0]=f;c[v>>2]=g;c[u>>2]=h;c[w>>2]=j;c[o>>2]=d[x>>0];if((c[o>>2]|0)==4|(c[o>>2]|0)==8)c[o>>2]=(a[1136]|0)==0?3:2;if((c[o>>2]|0)<1|(c[o>>2]|0)>3){c[t>>2]=Qb(127001)|0;b=c[t>>2]|0;i=r;return b|0}c[q>>2]=$g(c[n>>2]|0,c[o>>2]&255,c[p>>2]|0,0)|0;a:do if((c[q>>2]|0)!=0?(c[(c[q>>2]|0)+12>>2]|0)!=0:0){j=c[n>>2]|0;if(c[(c[n>>2]|0)+148>>2]|0){Lc(j,5,3248,m);c[t>>2]=5;b=c[t>>2]|0;i=r;return b|0}gf(j);ah(c[n>>2]|0);if((d[(c[q>>2]|0)+4>>0]&-9|0)==(c[o>>2]|0)){c[k>>2]=bh((c[n>>2]|0)+428|0,c[p>>2]|0)|0;c[s>>2]=0;while(1){if((c[s>>2]|0)>=3)break a;c[l>>2]=(c[k>>2]|0)+((c[s>>2]|0)*20|0);if((d[(c[l>>2]|0)+4>>0]|0)==(d[(c[q>>2]|0)+4>>0]|0)){if(c[(c[l>>2]|0)+16>>2]|0)rb[c[(c[l>>2]|0)+16>>2]&31](c[(c[l>>2]|0)+8>>2]|0);c[(c[l>>2]|0)+12>>2]=0}c[s>>2]=(c[s>>2]|0)+1}}}while(0);c[q>>2]=$g(c[n>>2]|0,c[o>>2]&255,c[p>>2]|0,1)|0;if(!(c[q>>2]|0)){c[t>>2]=7;b=c[t>>2]|0;i=r;return b|0}else{c[(c[q>>2]|0)+12>>2]=c[u>>2];c[(c[q>>2]|0)+8>>2]=c[v>>2];c[(c[q>>2]|0)+16>>2]=c[w>>2];a[(c[q>>2]|0)+4>>0]=c[o>>2]|d[x>>0]&8;Nc(c[n>>2]|0,0);c[t>>2]=0;b=c[t>>2]|0;i=r;return b|0}return 0}function fg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;a=zb[c[(c[f>>2]|0)+60>>2]&63](c[f>>2]|0,c[e>>2]|0)|0;i=d;return a|0}function gg(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;k=i;i=i+32|0;o=k+28|0;n=k+24|0;j=k+20|0;g=k+16|0;f=k+12|0;l=k+8|0;m=k+4|0;h=k;c[o>>2]=a;c[n>>2]=b;c[j>>2]=d;c[g>>2]=e;c[f>>2]=1;c[l>>2]=hg(c[o>>2]|0,c[n>>2]|0)|0;if(!(c[l>>2]|0)){o=c[f>>2]|0;i=k;return o|0}Pc(c[l>>2]|0);c[m>>2]=Sb(c[l>>2]|0)|0;c[h>>2]=ed(c[m>>2]|0)|0;l=c[h>>2]|0;if((c[j>>2]|0)==7){c[c[g>>2]>>2]=l;c[f>>2]=0;o=c[f>>2]|0;i=k;return o|0}if(c[l>>2]|0){c[f>>2]=ig(c[h>>2]|0,c[j>>2]|0,c[g>>2]|0)|0;o=c[f>>2]|0;i=k;return o|0}else{c[f>>2]=12;o=c[f>>2]|0;i=k;return o|0}return 0}function hg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=i;i=i+16|0;d=e+12|0;f=e+8|0;h=e+4|0;g=e;c[f>>2]=a;c[h>>2]=b;c[g>>2]=0;while(1){if((c[g>>2]|0)>=(c[(c[f>>2]|0)+20>>2]|0)){b=8;break}if(c[(c[(c[f>>2]|0)+16>>2]|0)+(c[g>>2]<<4)+4>>2]|0){if(!(c[h>>2]|0)){b=6;break}if(!(xc(c[h>>2]|0,c[(c[(c[f>>2]|0)+16>>2]|0)+(c[g>>2]<<4)>>2]|0)|0)){b=6;break}}c[g>>2]=(c[g>>2]|0)+1}if((b|0)==6){c[d>>2]=c[(c[(c[f>>2]|0)+16>>2]|0)+(c[g>>2]<<4)+4>>2];a=c[d>>2]|0;i=e;return a|0}else if((b|0)==8){c[d>>2]=0;a=c[d>>2]|0;i=e;return a|0}return 0}function ig(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;h=e+8|0;g=e+4|0;f=e;c[h>>2]=a;c[g>>2]=b;c[f>>2]=d;a=pb[c[(c[c[h>>2]>>2]|0)+40>>2]&31](c[h>>2]|0,c[g>>2]|0,c[f>>2]|0)|0;i=e;return a|0}function jg(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;c[d>>2]=c[9725];if(!(c[d>>2]|0)){e=0;i=b;return e|0}e=ub[c[d>>2]&31](c[e>>2]|0)|0;i=b;return e|0}function kg(a,d,f,g){a=a|0;d=d|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;m=i;i=i+32|0;j=m+24|0;p=m+20|0;o=m+16|0;h=m+12|0;n=m+8|0;k=m+4|0;l=m;c[p>>2]=a;c[o>>2]=d;c[h>>2]=f;c[n>>2]=g;c[k>>2]=0;c[l>>2]=c[(c[p>>2]|0)+4>>2];Pc(c[p>>2]|0);if((e[(c[l>>2]|0)+22>>1]|0)&2){c[j>>2]=8;p=c[j>>2]|0;i=m;return p|0}if((c[h>>2]|0)<0)c[h>>2]=(c[(c[l>>2]|0)+32>>2]|0)-(c[(c[l>>2]|0)+36>>2]|0);if((c[o>>2]|0)>=512&(c[o>>2]|0)<=65536?((c[o>>2]|0)-1&c[o>>2]|0)==0:0){c[(c[l>>2]|0)+32>>2]=c[o>>2];Dg(c[l>>2]|0)}c[k>>2]=Eg(c[c[l>>2]>>2]|0,(c[l>>2]|0)+32|0,c[h>>2]|0)|0;c[(c[l>>2]|0)+36>>2]=(c[(c[l>>2]|0)+32>>2]|0)-(c[h>>2]&65535);if(c[n>>2]|0){p=(c[l>>2]|0)+22|0;b[p>>1]=e[p>>1]|0|2}c[j>>2]=c[k>>2];p=c[j>>2]|0;i=m;return p|0}function lg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;a=Cg(c[f>>2]|0,c[e>>2]|0)|0;i=d;return a|0}function mg(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;Bg(8,c[e>>2]|0);if((c[42]|0)!=0?(c[9709]|0)>=(c[e>>2]|0):0){c[d>>2]=c[41];c[41]=c[c[41]>>2];c[42]=(c[42]|0)+ -1;ic(3,1);e=c[d>>2]|0;i=b;return e|0}e=c[e>>2]|0;c[d>>2]=gc(e,((e|0)<0)<<31>>31)|0;if(!((c[9660]|0)!=0&(c[d>>2]|0)!=0)){e=c[d>>2]|0;i=b;return e|0}ic(4,Tb(c[d>>2]|0)|0);e=c[d>>2]|0;i=b;return e|0}function ng(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;if(!(c[d>>2]|0)){i=b;return}if((c[d>>2]|0)>>>0>=(c[9708]|0)>>>0?(c[d>>2]|0)>>>0<(c[40]|0)>>>0:0){c[e>>2]=c[d>>2];c[c[e>>2]>>2]=c[41];c[41]=c[e>>2];c[42]=(c[42]|0)+1;ic(3,-1);i=b;return}if(c[9660]|0){c[f>>2]=Tb(c[d>>2]|0)|0;ic(4,0-(c[f>>2]|0)|0);ic(0,0-(c[f>>2]|0)|0);ic(9,-1);rb[c[38640+40>>2]&31](c[d>>2]|0);i=b;return}else{rb[c[38640+40>>2]&31](c[d>>2]|0);i=b;return}}function og(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;f=e+12|0;g=e+8|0;h=e+4|0;j=e;c[g>>2]=b;c[h>>2]=d;if(!(c[g>>2]|0)){c[f>>2]=0;b=c[f>>2]|0;i=e;return b|0}b=(Mb(c[g>>2]|0)|0)+1|0;c[g>>2]=(c[g>>2]|0)+b;while(1){if(!(a[c[g>>2]>>0]|0)){g=8;break}c[j>>2]=UE(c[g>>2]|0,c[h>>2]|0)|0;d=(Mb(c[g>>2]|0)|0)+1|0;c[g>>2]=(c[g>>2]|0)+d;d=c[g>>2]|0;if(!(c[j>>2]|0)){g=6;break}b=(Mb(d)|0)+1|0;c[g>>2]=(c[g>>2]|0)+b}if((g|0)==6){c[f>>2]=d;b=c[f>>2]|0;i=e;return b|0}else if((g|0)==8){c[f>>2]=0;b=c[f>>2]|0;i=e;return b|0}return 0}function pg(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;j=e+12|0;h=e+8|0;f=e+4|0;g=e;c[j>>2]=a;c[h>>2]=b;c[f>>2]=d;c[g>>2]=og(c[j>>2]|0,c[h>>2]|0)|0;c[f>>2]=(c[f>>2]|0)!=0&1;if(c[g>>2]|0){j=(qg(c[g>>2]|0,c[f>>2]&255)|0)&255;i=e;return j|0}else{j=c[f>>2]|0;i=e;return j|0}return 0}function qg(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+16|0;g=e;f=e+4|0;c[g>>2]=b;a[f>>0]=d;b=((yg(c[g>>2]|0,1,a[f>>0]|0)|0)&255|0)!=0&255;i=e;return b|0}function rg(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+32|0;f=g+24|0;k=g+20|0;j=g+16|0;m=g;l=g+12|0;h=g+8|0;c[k>>2]=b;c[j>>2]=e;do if((a[c[k>>2]>>0]|0)==48){if((a[(c[k>>2]|0)+1>>0]|0)!=120?(a[(c[k>>2]|0)+1>>0]|0)!=88:0)break;if(d[1224+(d[(c[k>>2]|0)+2>>0]|0)>>0]&8){b=m;c[b>>2]=0;c[b+4>>2]=0;c[l>>2]=2;while(1){e=c[l>>2]|0;if((a[(c[k>>2]|0)+(c[l>>2]|0)>>0]|0)!=48)break;c[l>>2]=e+1}c[h>>2]=e;while(1){if(!(d[1224+(d[(c[k>>2]|0)+(c[h>>2]|0)>>0]|0)>>0]&8))break;b=m;b=lF(c[b>>2]|0,c[b+4>>2]|0,16,0)|0;e=D;e=bF(b|0,e|0,(vg(a[(c[k>>2]|0)+(c[h>>2]|0)>>0]|0)|0)&255|0,0)|0;b=m;c[b>>2]=e;c[b+4>>2]=D;c[h>>2]=(c[h>>2]|0)+1}b=c[j>>2]|0;c[b+0>>2]=c[m+0>>2];c[b+4>>2]=c[m+4>>2];if(!(a[(c[k>>2]|0)+(c[h>>2]|0)>>0]|0))h=((c[h>>2]|0)-(c[l>>2]|0)|0)<=16;else h=0;c[f>>2]=h?0:1;b=c[f>>2]|0;i=g;return b|0}}while(0);e=c[k>>2]|0;b=c[j>>2]|0;c[f>>2]=wg(e,b,Mb(c[k>>2]|0)|0,1)|0;b=c[f>>2]|0;i=g;return b|0}function sg(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=ug(c[c[(c[d>>2]|0)+4>>2]>>2]|0,1)|0;i=b;return a|0}function tg(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return((e[(c[(c[b>>2]|0)+4>>2]|0)+22>>1]|0)&1|0)!=0|0}function ug(a,b){a=a|0;b=b|0;var e=0,f=0,g=0;e=i;i=i+16|0;f=e+4|0;g=e;c[f>>2]=a;c[g>>2]=b;if((c[g>>2]|0)!=0?(d[(c[f>>2]|0)+15>>0]|0|0)!=0:0){g=1216;i=e;return g|0}g=c[(c[f>>2]|0)+168>>2]|0;i=e;return g|0}function vg(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;c[b>>2]=(c[b>>2]|0)+((1&c[b>>2]>>6)*9|0);i=d;return c[b>>2]&15|0}function wg(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;q=i;i=i+64|0;p=q+48|0;k=q+44|0;n=q+40|0;v=q+36|0;w=q+52|0;s=q+32|0;u=q;r=q+28|0;l=q+24|0;t=q+20|0;o=q+16|0;h=q+12|0;m=q+8|0;c[k>>2]=b;c[n>>2]=e;c[v>>2]=f;a[w>>0]=g;b=u;c[b>>2]=0;c[b+4>>2]=0;c[r>>2]=0;c[t>>2]=0;c[o>>2]=0;c[m>>2]=(c[k>>2]|0)+(c[v>>2]|0);if((d[w>>0]|0)==1)c[s>>2]=1;else{c[s>>2]=2;c[l>>2]=3-(d[w>>0]|0);while(1){if((c[l>>2]|0)>=(c[v>>2]|0))break;if(a[(c[k>>2]|0)+(c[l>>2]|0)>>0]|0)break;c[l>>2]=(c[l>>2]|0)+2}c[o>>2]=(c[l>>2]|0)<(c[v>>2]|0)&1;c[m>>2]=(c[k>>2]|0)+(c[l>>2]|0)+(d[w>>0]|0)+ -3;c[k>>2]=(c[k>>2]|0)+(d[w>>0]&1)}while(1){if((c[k>>2]|0)>>>0>=(c[m>>2]|0)>>>0)break;if(!(d[1224+(d[c[k>>2]>>0]|0)>>0]&1))break;c[k>>2]=(c[k>>2]|0)+(c[s>>2]|0)}do if((c[k>>2]|0)>>>0<(c[m>>2]|0)>>>0){if((a[c[k>>2]>>0]|0)==45){c[r>>2]=1;c[k>>2]=(c[k>>2]|0)+(c[s>>2]|0);break}if((a[c[k>>2]>>0]|0)==43)c[k>>2]=(c[k>>2]|0)+(c[s>>2]|0)}while(0);c[h>>2]=c[k>>2];while(1){if((c[k>>2]|0)>>>0>=(c[m>>2]|0)>>>0)break;if((a[c[k>>2]>>0]|0)!=48)break;c[k>>2]=(c[k>>2]|0)+(c[s>>2]|0)}c[l>>2]=0;while(1){if(((c[k>>2]|0)+(c[l>>2]|0)|0)>>>0>=(c[m>>2]|0)>>>0)break;b=a[(c[k>>2]|0)+(c[l>>2]|0)>>0]|0;c[t>>2]=b;if(!((b|0)>=48&(c[t>>2]|0)<=57))break;b=u;b=lF(c[b>>2]|0,c[b+4>>2]|0,10,0)|0;e=c[t>>2]|0;e=bF(b|0,D|0,e|0,((e|0)<0)<<31>>31|0)|0;e=ZE(e|0,D|0,48,0)|0;b=u;c[b>>2]=e;c[b+4>>2]=D;c[l>>2]=(c[l>>2]|0)+(c[s>>2]|0)}b=u;e=c[b+4>>2]|0;v=(c[r>>2]|0)!=0;do if(!(e>>>0>2147483647|(e|0)==2147483647&(c[b>>2]|0)>>>0>4294967295)){w=c[u>>2]|0;u=c[u+4>>2]|0;if(v){e=ZE(0,0,w|0,u|0)|0;b=c[n>>2]|0;c[b>>2]=e;c[b+4>>2]=D;break}else{b=c[n>>2]|0;c[b>>2]=w;c[b+4>>2]=u;break}}else{b=c[n>>2]|0;c[b>>2]=v?0:-1;c[b+4>>2]=v?-2147483648:2147483647}while(0);if(!((c[t>>2]|0)!=0?((c[k>>2]|0)+(c[l>>2]|0)|0)>>>0<(c[m>>2]|0)>>>0:0))j=31;do if((j|0)==31){if((c[l>>2]|0)==0?(c[h>>2]|0)==(c[k>>2]|0):0)break;if(!((c[o>>2]|0)!=0?1:(c[l>>2]|0)>((c[s>>2]|0)*19|0))){if((c[l>>2]|0)<((c[s>>2]|0)*19|0)){c[p>>2]=0;b=c[p>>2]|0;i=q;return b|0}c[t>>2]=xg(c[k>>2]|0,c[s>>2]|0)|0;if((c[t>>2]|0)<0){c[p>>2]=0;b=c[p>>2]|0;i=q;return b|0}if((c[t>>2]|0)>0){c[p>>2]=1;b=c[p>>2]|0;i=q;return b|0}else{c[p>>2]=(c[r>>2]|0)!=0?0:2;b=c[p>>2]|0;i=q;return b|0}}}while(0);c[p>>2]=1;b=c[p>>2]|0;i=q;return b|0}function xg(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;f=i;i=i+32|0;g=f+16|0;h=f+12|0;e=f+8|0;j=f+4|0;k=f;c[g>>2]=b;c[h>>2]=d;c[e>>2]=0;c[k>>2]=1744;c[j>>2]=0;while(1){if(!((c[e>>2]|0)==0&(c[j>>2]|0)<18))break;b=$(c[j>>2]|0,c[h>>2]|0)|0;c[e>>2]=((a[(c[g>>2]|0)+b>>0]|0)-(a[(c[k>>2]|0)+(c[j>>2]|0)>>0]|0)|0)*10;c[j>>2]=(c[j>>2]|0)+1}if(c[e>>2]|0){b=c[e>>2]|0;i=f;return b|0}c[e>>2]=(a[(c[g>>2]|0)+((c[h>>2]|0)*18|0)>>0]|0)-56;b=c[e>>2]|0;i=f;return b|0}function yg(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;k=i;i=i+32|0;g=k+17|0;m=k+12|0;n=k+8|0;h=k+16|0;j=k+4|0;l=k;c[m>>2]=b;c[n>>2]=e;a[h>>0]=f;f=c[m>>2]|0;if((d[1224+(d[c[m>>2]>>0]|0)>>0]|0)&4){a[g>>0]=zg(f)|0;b=a[g>>0]|0;i=k;return b|0}c[l>>2]=Mb(f)|0;c[j>>2]=0;while(1){if((c[j>>2]|0)>=(7-(c[n>>2]|0)|0)){l=9;break}if((d[1800+(c[j>>2]|0)>>0]|0|0)==(c[l>>2]|0)?(Lb(1768+(d[1792+(c[j>>2]|0)>>0]|0)|0,c[m>>2]|0,c[l>>2]|0)|0)==0:0){l=7;break}c[j>>2]=(c[j>>2]|0)+1}if((l|0)==7){a[g>>0]=a[1808+(c[j>>2]|0)>>0]|0;b=a[g>>0]|0;i=k;return b|0}else if((l|0)==9){a[g>>0]=a[h>>0]|0;b=a[g>>0]|0;i=k;return b|0}return 0}function zg(a){a=a|0;var b=0,d=0,e=0;d=i;i=i+16|0;e=d+4|0;b=d;c[e>>2]=a;c[b>>2]=0;if(c[e>>2]|0)Ag(c[e>>2]|0,b)|0;i=d;return c[b>>2]|0}function Ag(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;g=i;i=i+48|0;j=g+32|0;k=g+28|0;h=g+24|0;m=g;f=g+20|0;o=g+16|0;n=g+12|0;l=g+8|0;c[k>>2]=b;c[h>>2]=e;b=m;c[b>>2]=0;c[b+4>>2]=0;c[n>>2]=0;do if((a[c[k>>2]>>0]|0)!=45){e=c[k>>2]|0;if((a[c[k>>2]>>0]|0)==43){c[k>>2]=e+1;break}if((a[e>>0]|0)==48){if((a[(c[k>>2]|0)+1>>0]|0)!=120?(a[(c[k>>2]|0)+1>>0]|0)!=88:0)break;if(d[1224+(d[(c[k>>2]|0)+2>>0]|0)>>0]&8){c[l>>2]=0;c[k>>2]=(c[k>>2]|0)+2;while(1){if((a[c[k>>2]>>0]|0)!=48)break;c[k>>2]=(c[k>>2]|0)+1}c[f>>2]=0;while(1){m=c[l>>2]|0;if(!((c[f>>2]|0)<8?(d[1224+(d[(c[k>>2]|0)+(c[f>>2]|0)>>0]|0)>>0]&8|0)!=0:0))break;c[l>>2]=(m<<4)+((vg(a[(c[k>>2]|0)+(c[f>>2]|0)>>0]|0)|0)&255);c[f>>2]=(c[f>>2]|0)+1}if((m&-2147483648|0)==0?(d[1224+(d[(c[k>>2]|0)+(c[f>>2]|0)>>0]|0)>>0]&8|0)==0:0){b=c[h>>2]|0;c[b+0>>2]=c[l+0>>2];c[j>>2]=1;b=c[j>>2]|0;i=g;return b|0}c[j>>2]=0;b=c[j>>2]|0;i=g;return b|0}}}else{c[n>>2]=1;c[k>>2]=(c[k>>2]|0)+1}while(0);c[f>>2]=0;while(1){if((c[f>>2]|0)>=11)break;b=(a[(c[k>>2]|0)+(c[f>>2]|0)>>0]|0)-48|0;c[o>>2]=b;if(!((b|0)>=0&(c[o>>2]|0)<=9))break;b=m;b=lF(c[b>>2]|0,c[b+4>>2]|0,10,0)|0;e=c[o>>2]|0;e=bF(b|0,D|0,e|0,((e|0)<0)<<31>>31|0)|0;b=m;c[b>>2]=e;c[b+4>>2]=D;c[f>>2]=(c[f>>2]|0)+1}if((c[f>>2]|0)>10){c[j>>2]=0;b=c[j>>2]|0;i=g;return b|0}e=m;b=c[n>>2]|0;b=ZE(c[e>>2]|0,c[e+4>>2]|0,b|0,((b|0)<0)<<31>>31|0)|0;e=D;if((e|0)>0|(e|0)==0&b>>>0>2147483647){c[j>>2]=0;b=c[j>>2]|0;i=g;return b|0}if(c[n>>2]|0){e=m;e=ZE(0,0,c[e>>2]|0,c[e+4>>2]|0)|0;b=m;c[b>>2]=e;c[b+4>>2]=D}c[c[h>>2]>>2]=c[m>>2];c[j>>2]=1;b=c[j>>2]|0;i=g;return b|0}function Bg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;c[48+(c[e>>2]<<2)>>2]=c[f>>2];if((c[48+(c[e>>2]<<2)>>2]|0)<=(c[88+(c[e>>2]<<2)>>2]|0)){i=d;return}c[88+(c[e>>2]<<2)>>2]=c[48+(c[e>>2]<<2)>>2];i=d;return}function Cg(a,b){a=a|0;b=b|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+32|0;g=f+16|0;j=f+12|0;k=f+8|0;l=f+4|0;h=f;c[j>>2]=a;c[k>>2]=b;if((c[k>>2]|0)<2){c[g>>2]=27;a=c[g>>2]|0;i=f;return a|0}c[l>>2]=((d[440+(d[c[j>>2]>>0]|0)>>0]|0)<<2^(d[440+(d[(c[j>>2]|0)+((c[k>>2]|0)-1)>>0]|0)>>0]|0)*3^c[k>>2]|0)%127|0;c[h>>2]=(d[2376+(c[l>>2]|0)>>0]|0)-1;while(1){if((c[h>>2]|0)<0){b=9;break}if((d[2632+(c[h>>2]|0)>>0]|0|0)==(c[k>>2]|0)?(Lb(1816+(e[2760+(c[h>>2]<<1)>>1]|0)|0,c[j>>2]|0,c[k>>2]|0)|0)==0:0){b=7;break}c[h>>2]=(d[2504+(c[h>>2]|0)>>0]|0)-1}if((b|0)==7){c[g>>2]=d[3008+(c[h>>2]|0)>>0];a=c[g>>2]|0;i=f;return a|0}else if((b|0)==9){c[g>>2]=27;a=c[g>>2]|0;i=f;return a|0}return 0}function Dg(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;if(!(c[(c[d>>2]|0)+80>>2]|0)){i=b;return}a=(c[d>>2]|0)+80|0;c[a>>2]=(c[a>>2]|0)+ -4;Kg(c[(c[d>>2]|0)+80>>2]|0);c[(c[d>>2]|0)+80>>2]=0;i=b;return}function Eg(a,e,f){a=a|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;j=i;i=i+32|0;k=j+28|0;l=j+24|0;p=j+20|0;n=j+16|0;o=j+12|0;m=j+8|0;g=j;c[k>>2]=a;c[l>>2]=e;c[p>>2]=f;c[n>>2]=0;c[o>>2]=c[c[l>>2]>>2];if(!((d[(c[k>>2]|0)+15>>0]|0)!=0?(c[(c[k>>2]|0)+24>>2]|0)!=0:0))h=3;do if(((h|0)==3?(a=(Fg(c[(c[k>>2]|0)+204>>2]|0)|0)==0,a&(c[o>>2]|0)!=0):0)?(c[o>>2]|0)!=(c[(c[k>>2]|0)+152>>2]|0):0){c[m>>2]=0;a=g;c[a>>2]=0;c[a+4>>2]=0;if((d[(c[k>>2]|0)+16>>0]|0)>0?(c[c[(c[k>>2]|0)+60>>2]>>2]|0)!=0:0)c[n>>2]=Gg(c[(c[k>>2]|0)+60>>2]|0,g)|0;if((c[n>>2]|0)==0?(c[m>>2]=Hg(c[o>>2]|0)|0,(c[m>>2]|0)==0):0)c[n>>2]=7;if(!(c[n>>2]|0)){Ig(c[k>>2]|0);c[n>>2]=Jg(c[(c[k>>2]|0)+204>>2]|0,c[o>>2]|0)|0}if(!(c[n>>2]|0)){Kg(c[(c[k>>2]|0)+200>>2]|0);c[(c[k>>2]|0)+200>>2]=c[m>>2];a=g;a=bF(c[a>>2]|0,c[a+4>>2]|0,c[o>>2]|0,0)|0;a=ZE(a|0,D|0,1,0)|0;a=jF(a|0,D|0,c[o>>2]|0,0)|0;c[(c[k>>2]|0)+24>>2]=a;c[(c[k>>2]|0)+152>>2]=c[o>>2];break}else{Kg(c[m>>2]|0);break}}while(0);c[c[l>>2]>>2]=c[(c[k>>2]|0)+152>>2];if(c[n>>2]|0){a=c[n>>2]|0;i=j;return a|0}if((c[p>>2]|0)<0)c[p>>2]=b[(c[k>>2]|0)+142>>1];b[(c[k>>2]|0)+142>>1]=c[p>>2];Lg(c[k>>2]|0);a=c[n>>2]|0;i=j;return a|0}function Fg(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return c[(c[b>>2]|0)+12>>2]|0}function Gg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;a=zb[c[(c[c[f>>2]>>2]|0)+24>>2]&63](c[f>>2]|0,c[e>>2]|0)|0;i=d;return a|0}function Hg(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=Ug(c[d>>2]|0)|0;i=b;return a|0}function Ig(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;Og(c[(c[d>>2]|0)+88>>2]|0);Pg(c[(c[d>>2]|0)+204>>2]|0);i=b;return}function Jg(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+16|0;f=e+12|0;h=e+8|0;j=e+4|0;g=e;c[h>>2]=a;c[j>>2]=b;if(c[(c[h>>2]|0)+20>>2]|0){c[g>>2]=pb[c[38640+120>>2]&31](c[j>>2]|0,(c[(c[h>>2]|0)+24>>2]|0)+40|0,d[(c[h>>2]|0)+28>>0]|0)|0;if(!(c[g>>2]|0)){c[f>>2]=7;a=c[f>>2]|0;i=e;return a|0}k=c[9691]|0;b=c[g>>2]|0;a=Ng(c[h>>2]|0)|0;sb[k&7](b,a);if(c[(c[h>>2]|0)+40>>2]|0)rb[c[38640+148>>2]&31](c[(c[h>>2]|0)+40>>2]|0);c[(c[h>>2]|0)+40>>2]=c[g>>2];c[(c[h>>2]|0)+44>>2]=0;c[(c[h>>2]|0)+20>>2]=c[j>>2]}c[f>>2]=0;k=c[f>>2]|0;i=e;return k|0}function Kg(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;Mg(c[d>>2]|0)|0;i=b;return}function Lg(a){a=a|0;var b=0;b=i;i=i+16|0;c[b>>2]=a;i=b;return}function Mg(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+16|0;d=b+12|0;f=b+8|0;e=b+4|0;g=b;c[f>>2]=a;c[e>>2]=0;if(!(c[f>>2]|0)){c[d>>2]=0;g=c[d>>2]|0;i=b;return g|0}if((c[f>>2]|0)>>>0>=(c[795]|0)>>>0?(c[f>>2]|0)>>>0<(c[796]|0)>>>0:0){ic(1,-1);c[g>>2]=c[f>>2];c[c[g>>2]>>2]=c[798];c[798]=c[g>>2];c[799]=(c[799]|0)+1;c[800]=(c[799]|0)<(c[794]|0)&1}else{c[e>>2]=Tb(c[f>>2]|0)|0;ic(2,0-(c[e>>2]|0)|0);hc(c[f>>2]|0)}c[d>>2]=c[e>>2];g=c[d>>2]|0;i=b;return g|0}function Ng(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;d=b+4|0;e=b;c[e>>2]=a;a=c[(c[e>>2]|0)+16>>2]|0;if((c[(c[e>>2]|0)+16>>2]|0)>=0){c[d>>2]=a;a=c[d>>2]|0;i=b;return a|0}else{f=lF(-1024,-1,a|0,((a|0)<0)<<31>>31|0)|0;a=(c[(c[e>>2]|0)+20>>2]|0)+(c[(c[e>>2]|0)+24>>2]|0)|0;a=jF(f|0,D|0,a|0,((a|0)<0)<<31>>31|0)|0;c[d>>2]=a;a=c[d>>2]|0;i=b;return a|0}return 0}function Og(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;c[d>>2]=c[e>>2];while(1){if(!(c[d>>2]|0))break;c[(c[d>>2]|0)+16>>2]=1;c[d>>2]=c[(c[d>>2]|0)+44>>2]}i=b;return}function Pg(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;Qg(c[d>>2]|0,0);i=b;return}function Qg(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[e>>2]=a;c[f>>2]=b;if(!(c[(c[e>>2]|0)+40>>2]|0)){i=d;return}c[g>>2]=c[c[e>>2]>>2];while(1){if(!(c[g>>2]|0))break;c[h>>2]=c[(c[g>>2]|0)+32>>2];if((c[(c[g>>2]|0)+20>>2]|0)>>>0>(c[f>>2]|0)>>>0)Rg(c[g>>2]|0);c[g>>2]=c[h>>2]}if((c[f>>2]|0)==0?(c[(c[e>>2]|0)+44>>2]|0)!=0:0){_E(c[(c[(c[e>>2]|0)+44>>2]|0)+4>>2]|0,0,c[(c[e>>2]|0)+20>>2]|0)|0;c[f>>2]=1}sb[c[38640+144>>2]&7](c[(c[e>>2]|0)+40>>2]|0,(c[f>>2]|0)+1|0);i=d;return}function Rg(a){a=a|0;var d=0,f=0;d=i;i=i+16|0;f=d;c[f>>2]=a;if(!(e[(c[f>>2]|0)+24>>1]&2)){i=d;return}Sg(c[f>>2]|0,1);a=(c[f>>2]|0)+24|0;b[a>>1]=e[a>>1]&-7;if(b[(c[f>>2]|0)+26>>1]|0){i=d;return}Tg(c[f>>2]|0);i=d;return}function Sg(b,f){b=b|0;f=f|0;var g=0,h=0,j=0,k=0,l=0;j=i;i=i+16|0;g=j+8|0;k=j+12|0;h=j+4|0;l=j;c[g>>2]=b;a[k>>0]=f;c[h>>2]=c[(c[g>>2]|0)+28>>2];if(d[k>>0]&1){if((c[(c[h>>2]|0)+8>>2]|0)==(c[g>>2]|0)){c[l>>2]=c[(c[g>>2]|0)+36>>2];while(1){if(c[l>>2]|0)b=(e[(c[l>>2]|0)+24>>1]&4|0)!=0;else b=0;f=c[l>>2]|0;if(!b)break;c[l>>2]=c[f+36>>2]}c[(c[h>>2]|0)+8>>2]=f}l=c[(c[g>>2]|0)+36>>2]|0;if(c[(c[g>>2]|0)+32>>2]|0)c[(c[(c[g>>2]|0)+32>>2]|0)+36>>2]=l;else c[(c[h>>2]|0)+4>>2]=l;l=c[(c[g>>2]|0)+32>>2]|0;if(!(c[(c[g>>2]|0)+36>>2]|0)){c[c[h>>2]>>2]=l;if((c[c[h>>2]>>2]|0)==0?(d[(c[h>>2]|0)+28>>0]|0)!=0:0)a[(c[h>>2]|0)+29>>0]=2}else c[(c[(c[g>>2]|0)+36>>2]|0)+32>>2]=l;c[(c[g>>2]|0)+32>>2]=0;c[(c[g>>2]|0)+36>>2]=0}if(!(d[k>>0]&2)){i=j;return}c[(c[g>>2]|0)+32>>2]=c[c[h>>2]>>2];k=c[g>>2]|0;if(!(c[(c[g>>2]|0)+32>>2]|0)){c[(c[h>>2]|0)+4>>2]=k;if(a[(c[h>>2]|0)+28>>0]|0)a[(c[h>>2]|0)+29>>0]=1}else c[(c[(c[g>>2]|0)+32>>2]|0)+36>>2]=k;c[c[h>>2]>>2]=c[g>>2];if(c[(c[h>>2]|0)+8>>2]|0){i=j;return}if(e[(c[g>>2]|0)+24>>1]&4){i=j;return}c[(c[h>>2]|0)+8>>2]=c[g>>2];i=j;return}function Tg(b){b=b|0;var d=0,e=0;d=i;i=i+16|0;e=d;c[e>>2]=b;if(!(a[(c[(c[e>>2]|0)+28>>2]|0)+28>>0]|0)){i=d;return}if((c[(c[e>>2]|0)+20>>2]|0)==1)c[(c[(c[e>>2]|0)+28>>2]|0)+44>>2]=0;vb[c[38640+136>>2]&63](c[(c[(c[e>>2]|0)+28>>2]|0)+40>>2]|0,c[c[e>>2]>>2]|0,0);i=d;return}function Ug(a){a=a|0;var b=0,d=0,e=0,f=0;d=i;i=i+16|0;f=d+8|0;b=d+4|0;e=d;c[f>>2]=a;c[b>>2]=0;Bg(7,c[f>>2]|0);if((c[f>>2]|0)<=(c[792]|0)?(c[b>>2]=c[798],(c[b>>2]|0)!=0):0){c[798]=c[c[798]>>2];c[799]=(c[799]|0)+ -1;c[800]=(c[799]|0)<(c[794]|0)&1;ic(1,1)}if(c[b>>2]|0){f=c[b>>2]|0;i=d;return f|0}f=c[f>>2]|0;c[b>>2]=gc(f,((f|0)<0)<<31>>31)|0;if(!(c[b>>2]|0)){f=c[b>>2]|0;i=d;return f|0}c[e>>2]=Tb(c[b>>2]|0)|0;ic(2,c[e>>2]|0);f=c[b>>2]|0;i=d;return f|0}function Vg(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;c[d>>2]=Mc(512,0)|0;if(!(c[d>>2]|0)){e=c[d>>2]|0;i=b;return e|0}c[c[d>>2]>>2]=c[e>>2];e=c[d>>2]|0;i=b;return e|0}function Wg(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;m=i;i=i+32|0;h=m+28|0;j=m+24|0;k=m+20|0;o=m+16|0;p=m+12|0;n=m+8|0;f=m+4|0;l=m;c[j>>2]=b;c[k>>2]=e;if(!(c[j>>2]|0)){c[h>>2]=0;b=c[h>>2]|0;i=m;return b|0}c[k>>2]=(c[k>>2]|0)+ -1;while(1){if((c[c[j>>2]>>2]|0)>>>0<=4e3)break;if(!(c[(c[j>>2]|0)+8>>2]|0))break;c[p>>2]=((c[k>>2]|0)>>>0)/((c[(c[j>>2]|0)+8>>2]|0)>>>0)|0;c[k>>2]=((c[k>>2]|0)>>>0)%((c[(c[j>>2]|0)+8>>2]|0)>>>0)|0;if((c[(c[j>>2]|0)+12+(c[p>>2]<<2)>>2]|0)==0?(b=Vg(c[(c[j>>2]|0)+8>>2]|0)|0,c[(c[j>>2]|0)+12+(c[p>>2]<<2)>>2]=b,(c[(c[j>>2]|0)+12+(c[p>>2]<<2)>>2]|0)==0):0){g=8;break}c[j>>2]=c[(c[j>>2]|0)+12+(c[p>>2]<<2)>>2]}if((g|0)==8){c[h>>2]=7;b=c[h>>2]|0;i=m;return b|0}p=c[k>>2]|0;if((c[c[j>>2]>>2]|0)>>>0<=4e3){b=(c[j>>2]|0)+12+(((c[k>>2]|0)>>>0)/8|0)|0;a[b>>0]=d[b>>0]|0|1<<(p&7);c[h>>2]=0;b=c[h>>2]|0;i=m;return b|0}c[k>>2]=p+1;c[o>>2]=(p>>>0)%125|0;a:do if(!(c[(c[j>>2]|0)+12+(c[o>>2]<<2)>>2]|0)){if((c[(c[j>>2]|0)+4>>2]|0)>>>0>=124)g=17}else{while(1){if((c[(c[j>>2]|0)+12+(c[o>>2]<<2)>>2]|0)==(c[k>>2]|0))break;b=(c[o>>2]|0)+1|0;c[o>>2]=b;c[o>>2]=(c[o>>2]|0)>>>0>=125?0:b;if(!(c[(c[j>>2]|0)+12+(c[o>>2]<<2)>>2]|0)){g=17;break a}}c[h>>2]=0;b=c[h>>2]|0;i=m;return b|0}while(0);if((g|0)==17?(c[(c[j>>2]|0)+4>>2]|0)>>>0>=62:0){c[l>>2]=Qe(0,500,0)|0;if(!(c[l>>2]|0)){c[h>>2]=7;b=c[h>>2]|0;i=m;return b|0}dF(c[l>>2]|0,(c[j>>2]|0)+12|0,500)|0;_E((c[j>>2]|0)+12|0,0,500)|0;c[(c[j>>2]|0)+8>>2]=(((c[c[j>>2]>>2]|0)+125-1|0)>>>0)/125|0;c[f>>2]=Wg(c[j>>2]|0,c[k>>2]|0)|0;c[n>>2]=0;while(1){if((c[n>>2]|0)>>>0>=125)break;if(c[(c[l>>2]|0)+(c[n>>2]<<2)>>2]|0){b=Wg(c[j>>2]|0,c[(c[l>>2]|0)+(c[n>>2]<<2)>>2]|0)|0;c[f>>2]=c[f>>2]|b}c[n>>2]=(c[n>>2]|0)+1}Xb(0,c[l>>2]|0);c[h>>2]=c[f>>2];b=c[h>>2]|0;i=m;return b|0}b=(c[j>>2]|0)+4|0;c[b>>2]=(c[b>>2]|0)+1;c[(c[j>>2]|0)+12+(c[o>>2]<<2)>>2]=c[k>>2];c[h>>2]=0;b=c[h>>2]|0;i=m;return b|0}function Xg(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;n=i;i=i+32|0;j=n+24|0;k=n+20|0;o=n+16|0;p=n+12|0;m=n+8|0;l=n+4|0;g=n;c[j>>2]=b;c[k>>2]=e;c[o>>2]=f;if(!(c[j>>2]|0)){i=n;return}c[k>>2]=(c[k>>2]|0)+ -1;while(1){if(!(c[(c[j>>2]|0)+8>>2]|0))break;c[p>>2]=((c[k>>2]|0)>>>0)/((c[(c[j>>2]|0)+8>>2]|0)>>>0)|0;c[k>>2]=((c[k>>2]|0)>>>0)%((c[(c[j>>2]|0)+8>>2]|0)>>>0)|0;c[j>>2]=c[(c[j>>2]|0)+12+(c[p>>2]<<2)>>2];if(!(c[j>>2]|0)){h=16;break}}if((h|0)==16){i=n;return}if((c[c[j>>2]>>2]|0)>>>0<=4e3){b=(c[j>>2]|0)+12+(((c[k>>2]|0)>>>0)/8|0)|0;a[b>>0]=(d[b>>0]|0)&~(1<<(c[k>>2]&7));i=n;return}c[l>>2]=c[o>>2];dF(c[l>>2]|0,(c[j>>2]|0)+12|0,500)|0;_E((c[j>>2]|0)+12|0,0,500)|0;c[(c[j>>2]|0)+4>>2]=0;c[m>>2]=0;while(1){if((c[m>>2]|0)>>>0>=125)break;if((c[(c[l>>2]|0)+(c[m>>2]<<2)>>2]|0)!=0?(c[(c[l>>2]|0)+(c[m>>2]<<2)>>2]|0)!=((c[k>>2]|0)+1|0):0){c[g>>2]=(((c[(c[l>>2]|0)+(c[m>>2]<<2)>>2]|0)-1|0)>>>0)%125|0;b=(c[j>>2]|0)+4|0;c[b>>2]=(c[b>>2]|0)+1;while(1){if(!(c[(c[j>>2]|0)+12+(c[g>>2]<<2)>>2]|0))break;b=(c[g>>2]|0)+1|0;c[g>>2]=b;c[g>>2]=(c[g>>2]|0)>>>0>=125?0:b}c[(c[j>>2]|0)+12+(c[g>>2]<<2)>>2]=c[(c[l>>2]|0)+(c[m>>2]<<2)>>2]}c[m>>2]=(c[m>>2]|0)+1}i=n;return}function Yg(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;e=i;i=i+32|0;f=e+16|0;g=e+12|0;h=e+8|0;l=e+4|0;j=e;c[g>>2]=a;c[h>>2]=b;if(!(c[g>>2]|0)){c[f>>2]=0;a=c[f>>2]|0;i=e;return a|0}if((c[h>>2]|0)==0?1:(c[h>>2]|0)>>>0>(c[c[g>>2]>>2]|0)>>>0){c[f>>2]=0;a=c[f>>2]|0;i=e;return a|0}c[h>>2]=(c[h>>2]|0)+ -1;while(1){if(!(c[(c[g>>2]|0)+8>>2]|0))break;c[l>>2]=((c[h>>2]|0)>>>0)/((c[(c[g>>2]|0)+8>>2]|0)>>>0)|0;c[h>>2]=((c[h>>2]|0)>>>0)%((c[(c[g>>2]|0)+8>>2]|0)>>>0)|0;c[g>>2]=c[(c[g>>2]|0)+12+(c[l>>2]<<2)>>2];if(!(c[g>>2]|0)){k=8;break}}if((k|0)==8){c[f>>2]=0;a=c[f>>2]|0;i=e;return a|0}k=c[h>>2]|0;if((c[c[g>>2]>>2]|0)>>>0<=4e3){c[f>>2]=((d[(c[g>>2]|0)+12+((k>>>0)/8|0)>>0]|0)&1<<(c[h>>2]&7)|0)!=0&1;a=c[f>>2]|0;i=e;return a|0}c[h>>2]=k+1;c[j>>2]=(k>>>0)%125|0;while(1){if(!(c[(c[g>>2]|0)+12+(c[j>>2]<<2)>>2]|0)){k=16;break}if((c[(c[g>>2]|0)+12+(c[j>>2]<<2)>>2]|0)==(c[h>>2]|0)){k=14;break}c[j>>2]=(((c[j>>2]|0)+1|0)>>>0)%125|0}if((k|0)==14){c[f>>2]=1;a=c[f>>2]|0;i=e;return a|0}else if((k|0)==16){c[f>>2]=0;a=c[f>>2]|0;i=e;return a|0}return 0}function Zg(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return c[c[b>>2]>>2]|0}function _g(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;if(!(c[e>>2]|0)){i=b;return}a:do if(c[(c[e>>2]|0)+8>>2]|0){c[d>>2]=0;while(1){if((c[d>>2]|0)>>>0>=125)break a;_g(c[(c[e>>2]|0)+12+(c[d>>2]<<2)>>2]|0);c[d>>2]=(c[d>>2]|0)+1}}while(0);hc(c[e>>2]|0);i=b;return}function $g(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0;j=i;i=i+32|0;n=j+12|0;k=j+16|0;m=j+8|0;l=j+4|0;h=j;c[n>>2]=b;a[k>>0]=e;c[m>>2]=f;c[l>>2]=g;g=c[n>>2]|0;if(c[m>>2]|0)c[h>>2]=fh(g,c[m>>2]|0,c[l>>2]|0)|0;else c[h>>2]=c[g+8>>2];if(!(c[h>>2]|0)){n=c[h>>2]|0;i=j;return n|0}c[h>>2]=(c[h>>2]|0)+(((d[k>>0]|0)-1|0)*20|0);n=c[h>>2]|0;i=j;return n|0}function ah(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0;b=i;i=i+32|0;g=b+20|0;d=b+16|0;f=b+12|0;e=b+8|0;h=b+4|0;j=b;c[g>>2]=a;c[f>>2]=0;c[d>>2]=c[(c[g>>2]|0)+16>>2];while(1){if((c[f>>2]|0)>=(c[(c[g>>2]|0)+20>>2]|0))break;a:do if(c[(c[d>>2]|0)+4>>2]|0){Pc(c[(c[d>>2]|0)+4>>2]|0);c[e>>2]=c[(c[(c[d>>2]|0)+12>>2]|0)+16>>2];while(1){if(!(c[e>>2]|0))break a;c[h>>2]=c[(c[e>>2]|0)+8>>2];c[j>>2]=c[(c[h>>2]|0)+8>>2];while(1){if(!(c[j>>2]|0))break;if((c[(c[j>>2]|0)+40>>2]|0)!=0?(c[(c[(c[j>>2]|0)+40>>2]|0)+12>>2]|0)==(c[g>>2]|0):0){eh(c[(c[j>>2]|0)+40>>2]|0);c[(c[j>>2]|0)+40>>2]=0}c[j>>2]=c[(c[j>>2]|0)+20>>2]}c[e>>2]=c[c[e>>2]>>2]}}while(0);c[f>>2]=(c[f>>2]|0)+1;c[d>>2]=(c[d>>2]|0)+16}i=b;return}function bh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;g=d+12|0;f=d+8|0;e=d+4|0;c[g>>2]=a;c[f>>2]=b;c[e>>2]=ch(c[g>>2]|0,c[f>>2]|0,d)|0;if(!(c[e>>2]|0)){g=0;i=d;return g|0}g=c[(c[e>>2]|0)+8>>2]|0;i=d;return g|0}function ch(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;e=i;i=i+32|0;f=e+28|0;n=e+24|0;h=e+20|0;k=e+16|0;g=e+12|0;j=e+8|0;l=e+4|0;m=e;c[n>>2]=a;c[h>>2]=b;c[k>>2]=d;if(c[(c[n>>2]|0)+12>>2]|0){a=dh(c[h>>2]|0)|0;c[l>>2]=(a>>>0)%((c[c[n>>2]>>2]|0)>>>0)|0;c[m>>2]=(c[(c[n>>2]|0)+12>>2]|0)+(c[l>>2]<<3);c[g>>2]=c[(c[m>>2]|0)+4>>2];c[j>>2]=c[c[m>>2]>>2]}else{c[l>>2]=0;c[g>>2]=c[(c[n>>2]|0)+8>>2];c[j>>2]=c[(c[n>>2]|0)+4>>2]}c[c[k>>2]>>2]=c[l>>2];while(1){a=c[j>>2]|0;c[j>>2]=a+ -1;if(!a){g=9;break}a=(xc(c[(c[g>>2]|0)+12>>2]|0,c[h>>2]|0)|0)==0;k=c[g>>2]|0;if(a){g=7;break}c[g>>2]=c[k>>2]}if((g|0)==7){c[f>>2]=k;a=c[f>>2]|0;i=e;return a|0}else if((g|0)==9){c[f>>2]=0;a=c[f>>2]|0;i=e;return a|0}return 0}function dh(b){b=b|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;f=e+4|0;h=e;g=e+8|0;c[f>>2]=b;c[h>>2]=0;while(1){j=c[f>>2]|0;c[f>>2]=j+1;j=a[j>>0]|0;a[g>>0]=j;b=c[h>>2]|0;if(!(j&255))break;c[h>>2]=b<<3^c[h>>2]^(d[440+(d[g>>0]|0)>>0]|0)}i=e;return b|0}function eh(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;if(!(c[d>>2]|0)){i=b;return}a=c[d>>2]|0;c[a>>2]=(c[a>>2]|0)+ -1;if(c[c[d>>2]>>2]|0){i=b;return}Xb(0,c[d>>2]|0);i=b;return}function fh(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+32|0;l=f+20|0;j=f+16|0;m=f+12|0;g=f+8|0;k=f+4|0;h=f;c[l>>2]=b;c[j>>2]=d;c[m>>2]=e;c[g>>2]=bh((c[l>>2]|0)+428|0,c[j>>2]|0)|0;if(!(0==(c[g>>2]|0)&(c[m>>2]|0)!=0)){m=c[g>>2]|0;i=f;return m|0}c[k>>2]=Mb(c[j>>2]|0)|0;c[g>>2]=se(c[l>>2]|0,61+(c[k>>2]|0)|0,0)|0;if(!(c[g>>2]|0)){m=c[g>>2]|0;i=f;return m|0}c[h>>2]=0;c[c[g>>2]>>2]=(c[g>>2]|0)+60;a[(c[g>>2]|0)+4>>0]=1;c[(c[g>>2]|0)+20>>2]=(c[g>>2]|0)+60;a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>>2]=c[e>>2];i=g;return}function kh(){var a=0;a=i;if(!(c[802]|0)){i=a;return}wb[c[3208>>2]&0]();i=a;return}function lh(){var a=0;a=i;if(!(c[803]|0)){i=a;return}wb[c[3208+4>>2]&0]();i=a;return}function mh(a){a=a|0;var b=0,d=0,e=0,f=0;d=i;i=i+16|0;b=d+8|0;e=d+4|0;f=d;c[b>>2]=a;c[e>>2]=c[(c[b>>2]|0)+8>>2];c[(c[b>>2]|0)+8>>2]=0;hc(c[(c[b>>2]|0)+12>>2]|0);c[(c[b>>2]|0)+12>>2]=0;c[c[b>>2]>>2]=0;while(1){if(!(c[e>>2]|0))break;c[f>>2]=c[c[e>>2]>>2];hc(c[e>>2]|0);c[e>>2]=c[f>>2]}c[(c[b>>2]|0)+4>>2]=0;i=d;return}function nh(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;c[(c[d>>2]|0)+8>>2]=0;c[(c[d>>2]|0)+4>>2]=0;c[c[d>>2]>>2]=0;c[(c[d>>2]|0)+12>>2]=0;i=b;return}function oh(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;m=i;i=i+32|0;o=m+24|0;n=m+20|0;g=m+16|0;l=m+12|0;j=m+8|0;h=m+4|0;k=m;c[o>>2]=a;c[n>>2]=b;c[g>>2]=d;c[l>>2]=e;c[j>>2]=f;c[k>>2]=(c[n>>2]|0)<(c[l>>2]|0)?c[n>>2]|0:c[l>>2]|0;c[h>>2]=TE(c[g>>2]|0,c[j>>2]|0,c[k>>2]|0)|0;if(c[h>>2]|0){a=c[h>>2]|0;i=m;return a|0}if(((c[o>>2]|0)!=0?(rk((c[g>>2]|0)+(c[k>>2]|0)|0,(c[n>>2]|0)-(c[k>>2]|0)|0)|0)!=0:0)?(rk((c[j>>2]|0)+(c[k>>2]|0)|0,(c[l>>2]|0)-(c[k>>2]|0)|0)|0)!=0:0){a=c[h>>2]|0;i=m;return a|0}c[h>>2]=(c[n>>2]|0)-(c[l>>2]|0);a=c[h>>2]|0;i=m;return a|0}function ph(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+32|0;j=g+16|0;m=g+12|0;k=g+8|0;l=g+4|0;h=g;c[g+20>>2]=a;c[j>>2]=b;c[m>>2]=d;c[k>>2]=e;c[l>>2]=f;c[h>>2]=Lb(c[m>>2]|0,c[l>>2]|0,(c[j>>2]|0)<(c[k>>2]|0)?c[j>>2]|0:c[k>>2]|0)|0;if(c[h>>2]|0){m=c[h>>2]|0;i=g;return m|0}c[h>>2]=(c[j>>2]|0)-(c[k>>2]|0);m=c[h>>2]|0;i=g;return m|0}function qh(b,e,f,g,h,j){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0;z=i;i=i+128|0;G=z;C=z+116|0;O=z+112|0;F=z+108|0;K=z+104|0;J=z+100|0;L=z+96|0;H=z+92|0;I=z+88|0;v=z+84|0;n=z+80|0;A=z+76|0;D=z+120|0;N=z+72|0;t=z+68|0;B=z+64|0;E=z+60|0;k=z+56|0;M=z+52|0;l=z+48|0;s=z+44|0;m=z+40|0;u=z+36|0;o=z+32|0;p=z+28|0;q=z+24|0;r=z+20|0;x=z+16|0;w=z+12|0;y=z+8|0;c[O>>2]=b;c[F>>2]=e;c[K>>2]=f;c[J>>2]=g;c[L>>2]=h;c[H>>2]=j;c[I>>2]=0;c[v>>2]=c[c[K>>2]>>2];c[n>>2]=c[O>>2];c[N>>2]=Mb(c[F>>2]|0)|0;if(c[v>>2]&64)if((c[N>>2]|0)>=5)j=4;else j=83;else if((c[9663]|0)!=0&(c[N>>2]|0)>=5)j=4;else j=83;a:do if((j|0)==4)if(!(TE(c[F>>2]|0,4608,5)|0)){c[k>>2]=0;c[M>>2]=(c[N>>2]|0)+2;c[v>>2]=c[v>>2]|64;c[E>>2]=0;while(1){if((c[E>>2]|0)>=(c[N>>2]|0))break;c[M>>2]=(c[M>>2]|0)+((a[(c[F>>2]|0)+(c[E>>2]|0)>>0]|0)==38&1);c[E>>2]=(c[E>>2]|0)+1}c[A>>2]=fc(c[M>>2]|0)|0;if(!(c[A>>2]|0)){c[C>>2]=7;O=c[C>>2]|0;i=z;return O|0}c[E>>2]=5;do if((a[(c[F>>2]|0)+5>>0]|0)==47?(a[(c[F>>2]|0)+6>>0]|0)==47:0){c[E>>2]=7;while(1){if(a[(c[F>>2]|0)+(c[E>>2]|0)>>0]|0)N=(a[(c[F>>2]|0)+(c[E>>2]|0)>>0]|0)!=47;else N=0;M=c[E>>2]|0;if(!N)break;c[E>>2]=M+1}if((M|0)!=7){if((c[E>>2]|0)==16?(TE(4616,(c[F>>2]|0)+7|0,9)|0)==0:0)break;O=(c[F>>2]|0)+7|0;c[G>>2]=(c[E>>2]|0)-7;c[G+4>>2]=O;O=qc(4632,G)|0;c[c[H>>2]>>2]=O;c[I>>2]=1;break a}}while(0);c[B>>2]=0;b:while(1){O=a[(c[F>>2]|0)+(c[E>>2]|0)>>0]|0;a[D>>0]=O;if(!(O<<24>>24))break;if((a[D>>0]|0)==35)break;c[E>>2]=(c[E>>2]|0)+1;do if(((a[D>>0]|0)==37?(d[1224+(d[(c[F>>2]|0)+(c[E>>2]|0)>>0]|0)>>0]&8|0)!=0:0)?(d[1224+(d[(c[F>>2]|0)+((c[E>>2]|0)+1)>>0]|0)>>0]&8|0)!=0:0){O=c[E>>2]|0;c[E>>2]=O+1;c[l>>2]=((vg(a[(c[F>>2]|0)+O>>0]|0)|0)&255)<<4;O=c[E>>2]|0;c[E>>2]=O+1;O=(vg(a[(c[F>>2]|0)+O>>0]|0)|0)&255;c[l>>2]=(c[l>>2]|0)+O;if(c[l>>2]|0){a[D>>0]=c[l>>2];break}while(1){O=a[(c[F>>2]|0)+(c[E>>2]|0)>>0]|0;a[D>>0]=O;if(!(O<<24>>24))continue b;if((a[D>>0]|0)==35)continue b;if((c[B>>2]|0)==0?(a[D>>0]|0)==63:0)continue b;if((c[B>>2]|0)==1){if((a[D>>0]|0)==61)continue b;if((a[D>>0]|0)==38)continue b}if((c[B>>2]|0)==2?(a[D>>0]|0)==38:0)continue b;c[E>>2]=(c[E>>2]|0)+1}}else j=39;while(0);c:do if((j|0)==39){j=0;do if((c[B>>2]|0)==1){if((a[D>>0]|0)!=38?(a[D>>0]|0)!=61:0)break;if(!(a[(c[A>>2]|0)+((c[k>>2]|0)-1)>>0]|0))while(1){if(!(a[(c[F>>2]|0)+(c[E>>2]|0)>>0]|0))continue b;if((a[(c[F>>2]|0)+(c[E>>2]|0)>>0]|0)==35)continue b;if((a[(c[F>>2]|0)+((c[E>>2]|0)-1)>>0]|0)==38)continue b;c[E>>2]=(c[E>>2]|0)+1}else{if((a[D>>0]|0)==38){O=c[k>>2]|0;c[k>>2]=O+1;a[(c[A>>2]|0)+O>>0]=0}else c[B>>2]=2;a[D>>0]=0;break c}}while(0);if(!((c[B>>2]|0)==0?(a[D>>0]|0)==63:0)){if((c[B>>2]|0)!=2)break;if((a[D>>0]|0)!=38)break}a[D>>0]=0;c[B>>2]=1}while(0);b=a[D>>0]|0;O=c[k>>2]|0;c[k>>2]=O+1;a[(c[A>>2]|0)+O>>0]=b}if((c[B>>2]|0)==1){O=c[k>>2]|0;c[k>>2]=O+1;a[(c[A>>2]|0)+O>>0]=0}O=c[k>>2]|0;c[k>>2]=O+1;a[(c[A>>2]|0)+O>>0]=0;O=c[k>>2]|0;c[k>>2]=O+1;a[(c[A>>2]|0)+O>>0]=0;O=(Mb(c[A>>2]|0)|0)+1|0;c[t>>2]=(c[A>>2]|0)+O;while(1){if(!(a[c[t>>2]>>0]|0)){j=86;break a}c[s>>2]=Mb(c[t>>2]|0)|0;c[m>>2]=(c[t>>2]|0)+((c[s>>2]|0)+1);c[u>>2]=Mb(c[m>>2]|0)|0;if((c[s>>2]|0)==3?(TE(4664,c[t>>2]|0,3)|0)==0:0)c[n>>2]=c[m>>2];else{c[o>>2]=0;c[p>>2]=0;c[q>>2]=0;c[r>>2]=0;if((c[s>>2]|0)==5?(TE(4672,c[t>>2]|0,5)|0)==0:0){c[q>>2]=393216;c[o>>2]=4680;c[r>>2]=c[q>>2];c[p>>2]=4672}if((c[s>>2]|0)==4?(TE(4720,c[t>>2]|0,4)|0)==0:0){c[q>>2]=135;c[o>>2]=4728;c[r>>2]=c[q>>2]&c[v>>2];c[p>>2]=4800}if(c[o>>2]|0){c[w>>2]=0;c[x>>2]=0;while(1){if(!(c[(c[o>>2]|0)+(c[x>>2]<<3)>>2]|0))break;c[y>>2]=c[(c[o>>2]|0)+(c[x>>2]<<3)>>2];O=c[u>>2]|0;if((O|0)==(Mb(c[y>>2]|0)|0)?0==(TE(c[m>>2]|0,c[y>>2]|0,c[u>>2]|0)|0):0){j=75;break}c[x>>2]=(c[x>>2]|0)+1}if((j|0)==75){j=0;c[w>>2]=c[(c[o>>2]|0)+(c[x>>2]<<3)+4>>2]}if(!(c[w>>2]|0)){j=78;break}if((c[w>>2]&-129|0)>(c[r>>2]|0)){j=80;break}c[v>>2]=c[v>>2]&~c[q>>2]|c[w>>2]}}c[t>>2]=(c[m>>2]|0)+((c[u>>2]|0)+1)}if((j|0)==78){O=c[m>>2]|0;c[G>>2]=c[p>>2];c[G+4>>2]=O;O=qc(4808,G)|0;c[c[H>>2]>>2]=O;c[I>>2]=1;break}else if((j|0)==80){O=c[m>>2]|0;c[G>>2]=c[p>>2];c[G+4>>2]=O;O=qc(4832,G)|0;c[c[H>>2]>>2]=O;c[I>>2]=3;break}}else j=83;while(0);do if((j|0)==83){c[A>>2]=fc((c[N>>2]|0)+2|0)|0;if(c[A>>2]|0){dF(c[A>>2]|0,c[F>>2]|0,c[N>>2]|0)|0;a[(c[A>>2]|0)+(c[N>>2]|0)>>0]=0;a[(c[A>>2]|0)+((c[N>>2]|0)+1)>>0]=0;c[v>>2]=c[v>>2]&-65;j=86;break}c[C>>2]=7;O=c[C>>2]|0;i=z;return O|0}while(0);if((j|0)==86?(O=Yb(c[n>>2]|0)|0,c[c[J>>2]>>2]=O,(c[c[J>>2]>>2]|0)==0):0){c[G>>2]=c[n>>2];O=qc(4856,G)|0;c[c[H>>2]>>2]=O;c[I>>2]=1}if(c[I>>2]|0){hc(c[A>>2]|0);c[A>>2]=0}c[c[K>>2]>>2]=c[v>>2];c[c[L>>2]>>2]=c[A>>2];c[C>>2]=c[I>>2];O=c[C>>2]|0;i=z;return O|0}function rh(f,g,h,j,k,l){f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;m=i;i=i+192|0;r=m+72|0;z=m+68|0;v=m+64|0;y=m+60|0;q=m+56|0;x=m+52|0;A=m+48|0;p=m+44|0;o=m+40|0;n=m+32|0;F=m+176|0;u=m+76|0;H=m+28|0;w=m+24|0;t=m+20|0;B=m+16|0;D=m+12|0;E=m+8|0;G=m+4|0;s=m;c[z>>2]=f;c[v>>2]=g;c[y>>2]=h;c[q>>2]=j;c[x>>2]=k;c[A>>2]=l;c[p>>2]=0;c[m+36>>2]=0;c[n>>2]=0;if(!(c[v>>2]|0))l=1;else l=(a[c[v>>2]>>0]|0)==0;c[H>>2]=l&1;if((c[v>>2]|0)!=0?(UE(c[v>>2]|0,4216)|0)==0:0)l=1;else C=5;do if((C|0)==5){if((c[H>>2]|0)!=0?(xh(c[y>>2]|0)|0)!=0:0){l=1;break}l=(c[A>>2]&128|0)!=0}while(0);c[w>>2]=l&1;if(c[w>>2]|0)c[x>>2]=c[x>>2]|2;if((c[A>>2]&256|0)!=0?(c[w>>2]|0)!=0|(c[H>>2]|0)!=0:0)c[A>>2]=c[A>>2]&-257|512;c[o>>2]=Mc(44,0)|0;if(!(c[o>>2]|0)){c[r>>2]=7;f=c[r>>2]|0;i=m;return f|0}a[(c[o>>2]|0)+8>>0]=0;c[c[o>>2]>>2]=c[y>>2];c[(c[o>>2]|0)+28>>2]=c[o>>2];c[(c[o>>2]|0)+32>>2]=1;do if(!(c[H>>2]|0)){if((c[w>>2]|0)!=0?(c[A>>2]&64|0)==0:0)break;if(c[A>>2]&131072){c[t>>2]=(c[(c[z>>2]|0)+8>>2]|0)+1;f=c[t>>2]|0;c[B>>2]=gc(f,((f|0)<0)<<31>>31)|0;a[(c[o>>2]|0)+9>>0]=1;if(!(c[B>>2]|0)){hc(c[o>>2]|0);c[r>>2]=7;f=c[r>>2]|0;i=m;return f|0}if(!(c[w>>2]|0)){c[n>>2]=yh(c[z>>2]|0,c[v>>2]|0,c[t>>2]|0,c[B>>2]|0)|0;if(c[n>>2]|0){hc(c[B>>2]|0);hc(c[o>>2]|0);c[r>>2]=c[n>>2];f=c[r>>2]|0;i=m;return f|0}}else{g=c[B>>2]|0;f=c[v>>2]|0;dF(g|0,f|0,(Mb(c[v>>2]|0)|0)+1|0)|0}c[p>>2]=c[1058];while(1){if(!(c[p>>2]|0))break;f=c[B>>2]|0;if(0==(UE(f,ug(c[c[p>>2]>>2]|0,0)|0)|0)?(f=zh(c[c[p>>2]>>2]|0)|0,(f|0)==(c[z>>2]|0)):0){C=29;break}c[p>>2]=c[(c[p>>2]|0)+68>>2]}do if((C|0)==29){c[D>>2]=(c[(c[y>>2]|0)+20>>2]|0)-1;while(1){if((c[D>>2]|0)<0){C=35;break}c[E>>2]=c[(c[(c[y>>2]|0)+16>>2]|0)+(c[D>>2]<<4)+4>>2];if((c[E>>2]|0)!=0?(c[(c[E>>2]|0)+4>>2]|0)==(c[p>>2]|0):0)break;c[D>>2]=(c[D>>2]|0)+ -1}if((C|0)==35){c[(c[o>>2]|0)+4>>2]=c[p>>2];f=(c[p>>2]|0)+64|0;c[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[p>>2]>>2]|0,(c[p>>2]|0)+32|0,d[F>>0]|0)|0;if(!(c[n>>2]|0)){c[(c[p>>2]|0)+36>>2]=(c[(c[p>>2]|0)+32>>2]|0)-(d[F>>0]|0);if(a[(c[o>>2]|0)+9>>0]|0){c[(c[p>>2]|0)+64>>2]=1;c[(c[p>>2]|0)+68>>2]=c[1058];c[1058]=c[p>>2];C=56}else C=56}}}else C=56;while(0);if((C|0)==56){a:do if(a[(c[o>>2]|0)+9>>0]|0){c[G>>2]=0;while(1){if((c[G>>2]|0)>=(c[(c[y>>2]|0)+20>>2]|0))break a;f=c[(c[(c[y>>2]|0)+16>>2]|0)+(c[G>>2]<<4)+4>>2]|0;c[s>>2]=f;if((f|0)!=0?(d[(c[s>>2]|0)+9>>0]|0)!=0:0)break;c[G>>2]=(c[G>>2]|0)+1}while(1){if(!(c[(c[s>>2]|0)+24>>2]|0))break;c[s>>2]=c[(c[s>>2]|0)+24>>2]}if((c[(c[o>>2]|0)+4>>2]|0)>>>0<(c[(c[s>>2]|0)+4>>2]|0)>>>0){c[(c[o>>2]|0)+20>>2]=c[s>>2];c[(c[o>>2]|0)+24>>2]=0;c[(c[s>>2]|0)+24>>2]=c[o>>2];break}while(1){if(c[(c[s>>2]|0)+20>>2]|0)u=(c[(c[(c[s>>2]|0)+20>>2]|0)+4>>2]|0)>>>0<(c[(c[o>>2]|0)+4>>2]|0)>>>0;else u=0;t=c[(c[s>>2]|0)+20>>2]|0;if(!u)break;c[s>>2]=t}c[(c[o>>2]|0)+20>>2]=t;c[(c[o>>2]|0)+24>>2]=c[s>>2];if(c[(c[o>>2]|0)+20>>2]|0)c[(c[(c[o>>2]|0)+20>>2]|0)+24>>2]=c[o>>2];c[(c[s>>2]|0)+20>>2]=c[o>>2]}while(0);c[c[q>>2]>>2]=c[o>>2]}if(!(c[n>>2]|0)){if(!(vh(c[o>>2]|0,0,0)|0))Jh(c[c[(c[o>>2]|0)+4>>2]>>2]|0,2e3)}else{if((c[p>>2]|0)!=0?(c[c[p>>2]>>2]|0)!=0:0)Ih(c[c[p>>2]>>2]|0)|0;hc(c[p>>2]|0);hc(c[o>>2]|0);c[c[q>>2]>>2]=0}c[r>>2]=c[n>>2];f=c[r>>2]|0;i=m;return f|0}function sh(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0;h=i;i=i+16|0;f=h+8|0;j=h+4|0;g=h;c[f>>2]=b;c[j>>2]=e;if(c[j>>2]|0)c[g>>2]=vh(c[j>>2]|0,84,15)|0;else c[g>>2]=se(0,84,0)|0;if(!(c[g>>2]|0)){a[(c[f>>2]|0)+64>>0]=1;b=c[g>>2]|0;i=h;return b|0}if(d[(c[g>>2]|0)+76>>0]|0){b=c[g>>2]|0;i=h;return b|0}nh((c[g>>2]|0)+8|0);nh((c[g>>2]|0)+24|0);nh((c[g>>2]|0)+40|0);nh((c[g>>2]|0)+56|0);a[(c[g>>2]|0)+77>>0]=1;b=c[g>>2]|0;i=h;return b|0}function th(b){b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[e>>2]=b;c[f>>2]=Rf(c[e>>2]|0,4208,2)|0;if((c[f>>2]|0)!=7){i=d;return}a[(c[e>>2]|0)+64>>0]=1;i=d;return}function uh(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;b=i;i=i+32|0;g=b;d=b+24|0;k=b+20|0;h=b+16|0;e=b+12|0;j=b+8|0;f=b+4|0;c[d>>2]=a;c[h>>2]=1;if(!(c[370]|0)){i=b;return}c[k>>2]=0;while(1){if(!(c[h>>2]|0))break;if((c[k>>2]|0)>=(c[370]|0)){c[j>>2]=0;c[h>>2]=0}else c[j>>2]=c[(c[371]|0)+(c[k>>2]<<2)>>2];c[f>>2]=0;if((c[j>>2]|0)!=0?(a=pb[c[j>>2]&31](c[d>>2]|0,f,3352)|0,c[e>>2]=a,(a|0)!=0):0){l=c[d>>2]|0;a=c[e>>2]|0;c[g>>2]=c[f>>2];Lc(l,a,4168,g);c[h>>2]=0}hc(c[f>>2]|0);c[k>>2]=(c[k>>2]|0)+1}i=b;return}function vh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;j=e+12|0;g=e+8|0;h=e+4|0;f=e;c[j>>2]=a;c[g>>2]=b;c[h>>2]=d;c[f>>2]=c[(c[j>>2]|0)+4>>2];Pc(c[j>>2]|0);if(!((c[g>>2]|0)!=0?(c[(c[f>>2]|0)+48>>2]|0)==0:0)){j=c[f>>2]|0;j=j+48|0;j=c[j>>2]|0;i=e;return j|0}j=c[g>>2]|0;j=se(0,j,((j|0)<0)<<31>>31)|0;c[(c[f>>2]|0)+48>>2]=j;c[(c[f>>2]|0)+52>>2]=c[h>>2];j=c[f>>2]|0;j=j+48|0;j=c[j>>2]|0;i=e;return j|0}function wh(a){a=a|0;var d=0,f=0,g=0,h=0,j=0,k=0,l=0;d=i;i=i+64|0;l=d+48|0;f=d+32|0;k=d+16|0;h=d+8|0;g=d+4|0;j=d;c[l>>2]=a;c[g>>2]=c[l>>2];a=(c[g>>2]|0)+8|0;c[f+0>>2]=c[a+0>>2];c[f+4>>2]=c[a+4>>2];c[f+8>>2]=c[a+8>>2];c[f+12>>2]=c[a+12>>2];a=(c[g>>2]|0)+40|0;c[k+0>>2]=c[a+0>>2];c[k+4>>2]=c[a+4>>2];c[k+8>>2]=c[a+8>>2];c[k+12>>2]=c[a+12>>2];nh((c[g>>2]|0)+40|0);mh((c[g>>2]|0)+24|0);c[h>>2]=c[k+8>>2];while(1){if(!(c[h>>2]|0))break;Ub(0,c[(c[h>>2]|0)+8>>2]|0);c[h>>2]=c[c[h>>2]>>2]}mh(k);nh((c[g>>2]|0)+8|0);c[h>>2]=c[f+8>>2];while(1){if(!(c[h>>2]|0))break;c[j>>2]=c[(c[h>>2]|0)+8>>2];Vb(0,c[j>>2]|0);c[h>>2]=c[c[h>>2]>>2]}mh(f);mh((c[g>>2]|0)+56|0);c[(c[g>>2]|0)+72>>2]=0;if(!((e[(c[g>>2]|0)+78>>1]|0)&1)){i=d;return}l=(c[g>>2]|0)+4|0;c[l>>2]=(c[l>>2]|0)+1;l=(c[g>>2]|0)+78|0;b[l>>1]=(e[l>>1]|0)&-2;i=d;return}function xh(a){a=a|0;var b=0,e=0;e=i;i=i+16|0;b=e;c[b>>2]=a;i=e;return(d[(c[b>>2]|0)+63>>0]|0|0)==2|0}function yh(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0;g=i;i=i+16|0;l=g+12|0;k=g+8|0;j=g+4|0;h=g;c[l>>2]=b;c[k>>2]=d;c[j>>2]=e;c[h>>2]=f;a[c[h>>2]>>0]=0;b=xb[c[(c[l>>2]|0)+36>>2]&7](c[l>>2]|0,c[k>>2]|0,c[j>>2]|0,c[h>>2]|0)|0;i=g;return b|0}function zh(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return c[c[b>>2]>>2]|0}function Ah(d,e,f,g,h,j,k){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;v=i;i=i+112|0;A=v+96|0;p=v+92|0;E=v+88|0;s=v+84|0;y=v+80|0;L=v+76|0;r=v+72|0;D=v+68|0;H=v+64|0;q=v+60|0;o=v+56|0;C=v+52|0;z=v+48|0;l=v+44|0;F=v+40|0;n=v+36|0;t=v+32|0;B=v+28|0;I=v+24|0;x=v+20|0;J=v+16|0;K=v+12|0;G=v+8|0;u=v+4|0;w=v;c[p>>2]=d;c[E>>2]=e;c[s>>2]=f;c[y>>2]=g;c[L>>2]=h;c[r>>2]=j;c[D>>2]=k;c[q>>2]=0;c[o>>2]=0;c[C>>2]=0;c[z>>2]=0;c[l>>2]=0;c[n>>2]=0;c[t>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a[4569]|0;a[d+2>>0]=a[4570]|0;a[d+3>>0]=a[4571]|0;a[d+4>>0]=a[4572]|0;Xb(0,c[n>>2]|0)}c[c[q>>2]>>2]=c[p>>2];c[(c[q>>2]|0)+144>>2]=c[r>>2];do if((c[s>>2]|0)!=0?(a[c[s>>2]>>0]|0)!=0:0){c[u>>2]=0;c[o>>2]=Di(c[p>>2]|0,c[(c[q>>2]|0)+168>>2]|0,c[(c[q>>2]|0)+60>>2]|0,c[r>>2]|0,u)|0;c[l>>2]=c[u>>2]&1;if(!(c[o>>2]|0)){c[w>>2]=Ai(c[(c[q>>2]|0)+60>>2]|0)|0;do if((c[l>>2]|0)==0?(zi(c[q>>2]|0),(c[x>>2]|0)>>>0<(c[(c[q>>2]|0)+148>>2]|0)>>>0):0)if((c[(c[q>>2]|0)+148>>2]|0)>>>0>8192){c[x>>2]=8192;break}else{c[x>>2]=c[(c[q>>2]|0)+148>>2];break}while(0);d=(pg(c[s>>2]|0,4576,0)|0)&255;a[(c[q>>2]|0)+13>>0]=d;if((c[w>>2]&8192|0)==0?(pg(c[s>>2]|0,4584,0)|0)==0:0)break;c[r>>2]=c[r>>2]|1;m=39}}else m=39;while(0);if((m|0)==39){c[C>>2]=1;a[(c[q>>2]|0)+16>>0]=1;a[(c[q>>2]|0)+17>>0]=4;a[(c[q>>2]|0)+13>>0]=1;c[l>>2]=c[r>>2]&1}if(!(c[o>>2]|0))c[o>>2]=Eg(c[q>>2]|0,x,-1)|0;if(!(c[o>>2]|0)){c[y>>2]=(c[y>>2]|0)+7&-8;c[o>>2]=Vj(c[x>>2]|0,c[y>>2]|0,((c[z>>2]|0)!=0^1)&1,(c[z>>2]|0)!=0^1?35:0,c[q>>2]|0,c[(c[q>>2]|0)+204>>2]|0)|0}if(c[o>>2]|0){Rh(c[(c[q>>2]|0)+60>>2]|0)|0;Kg(c[(c[q>>2]|0)+200>>2]|0);hc(c[q>>2]|0);c[A>>2]=c[o>>2];d=c[A>>2]|0;i=v;return d|0}a[(c[q>>2]|0)+6>>0]=c[B>>2];c[(c[q>>2]|0)+156>>2]=1073741823;a[(c[q>>2]|0)+12>>0]=c[C>>2];a[(c[q>>2]|0)+4>>0]=c[C>>2];a[(c[q>>2]|0)+18>>0]=a[(c[q>>2]|0)+12>>0]|0;a[(c[q>>2]|0)+15>>0]=c[z>>2];a[(c[q>>2]|0)+14>>0]=c[l>>2];a[(c[q>>2]|0)+7>>0]=a[(c[q>>2]|0)+12>>0]|0;if(!(a[(c[q>>2]|0)+7>>0]|0)){a[(c[q>>2]|0)+8>>0]=1;a[(c[q>>2]|0)+11>>0]=2;a[(c[q>>2]|0)+10>>0]=34;a[(c[q>>2]|0)+9>>0]=2}b[(c[q>>2]|0)+140>>1]=c[y>>2];d=(c[q>>2]|0)+160|0;c[d>>2]=-1;c[d+4>>2]=-1;zi(c[q>>2]|0);if(c[B>>2]|0){if(c[z>>2]|0)a[(c[q>>2]|0)+5>>0]=4}else a[(c[q>>2]|0)+5>>0]=2;c[(c[q>>2]|0)+196>>2]=c[D>>2];c[c[E>>2]>>2]=c[q>>2];c[A>>2]=0;d=c[A>>2]|0;i=v;return d|0}function Bh(b){b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=b;c[e>>2]=Qj(c[f>>2]|0)|0;if(!(a[c[e>>2]>>0]|0)){i=d;return}a[c[e>>2]>>0]=0;if((Rj(c[f>>2]|0)|0)<=1){i=d;return}Sj(c[e>>2]|0)|0;i=d;return}function Ch(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+16|0;f=e+8|0;g=e;c[f>>2]=a;a=g;c[a>>2]=b;c[a+4>>2]=d;d=g;b=c[d+4>>2]|0;a=(c[f>>2]|0)+128|0;c[a>>2]=c[d>>2];c[a+4>>2]=b;Lg(c[f>>2]|0);i=e;return}function Dh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;g=e+12|0;j=e+8|0;h=e+4|0;f=e;c[g>>2]=a;c[j>>2]=b;c[h>>2]=d;c[f>>2]=0;_E(c[h>>2]|0,0,c[j>>2]|0)|0;if(!(c[c[(c[g>>2]|0)+60>>2]>>2]|0)){a=c[f>>2]|0;i=e;return a|0}a=Ei(c[(c[g>>2]|0)+60>>2]|0,c[h>>2]|0,c[j>>2]|0,0,0)|0;c[f>>2]=a;c[f>>2]=(c[f>>2]|0)==522?0:a;a=c[f>>2]|0;i=e;return a|0}function Eh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;f=e+12|0;j=e+8|0;h=e+4|0;g=e;c[f>>2]=a;c[j>>2]=b;c[h>>2]=d;c[(c[f>>2]|0)+176>>2]=c[j>>2];c[(c[f>>2]|0)+180>>2]=c[h>>2];if(!(c[c[(c[f>>2]|0)+60>>2]>>2]|0)){i=e;return}c[g>>2]=(c[f>>2]|0)+176;rj(c[(c[f>>2]|0)+60>>2]|0,15,c[g>>2]|0);i=e;return}function Fh(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;c[d>>2]=c[e>>2];a=Pj((c[(c[d>>2]|0)+4>>2]|0)+444|0)|0;i=b;return a|0}function Gh(b){b=b|0;var d=0,e=0;e=i;i=i+16|0;d=e;c[d>>2]=b;i=e;return a[(c[d>>2]|0)+14>>0]|0}function Hh(a){a=a|0;var b=0,e=0;e=i;i=i+16|0;b=e;c[b>>2]=a;i=e;return(d[c[b>>2]>>0]|0)<<24|(d[(c[b>>2]|0)+1>>0]|0)<<16|(d[(c[b>>2]|0)+2>>0]|0)<<8|(d[(c[b>>2]|0)+3>>0]|0)|0}function Ih(b){b=b|0;var e=0,f=0,g=0;e=i;i=i+16|0;f=e+4|0;g=e;c[f>>2]=b;c[g>>2]=c[(c[f>>2]|0)+200>>2];kh();Lh(c[f>>2]|0);a[(c[f>>2]|0)+4>>0]=0;Mh(c[(c[f>>2]|0)+208>>2]|0,d[(c[f>>2]|0)+9>>0]|0,c[(c[f>>2]|0)+152>>2]|0,c[g>>2]|0)|0;c[(c[f>>2]|0)+208>>2]=0;Ig(c[f>>2]|0);b=c[f>>2]|0;if(a[(c[f>>2]|0)+15>>0]|0)Nh(b);else{if(c[c[b+64>>2]>>2]|0){b=c[f>>2]|0;Oh(b,Ph(c[f>>2]|0)|0)|0}Qh(c[f>>2]|0)}lh();Rh(c[(c[f>>2]|0)+64>>2]|0)|0;Rh(c[(c[f>>2]|0)+60>>2]|0)|0;Kg(c[g>>2]|0);Sh(c[(c[f>>2]|0)+204>>2]|0);hc(c[f>>2]|0);i=e;return 0}function Jh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;Kh(c[(c[f>>2]|0)+204>>2]|0,c[e>>2]|0);i=d;return}function Kh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;c[(c[f>>2]|0)+16>>2]=c[e>>2];e=c[9691]|0;b=c[(c[f>>2]|0)+40>>2]|0;a=Ng(c[f>>2]|0)|0;sb[e&7](b,a);i=d;return}function Lh(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;f=b+8|0;d=b+4|0;e=b;c[f>>2]=a;c[d>>2]=c[(c[f>>2]|0)+136>>2];while(1){if(!(c[d>>2]|0))break;c[e>>2]=c[(c[d>>2]|0)+12>>2];hc(c[d>>2]|0);c[d>>2]=c[e>>2]}i=b;return}function Mh(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;n=i;i=i+32|0;l=n+24|0;h=n+20|0;o=n+16|0;p=n+12|0;j=n+8|0;m=n+4|0;k=n;c[l>>2]=b;c[h>>2]=e;c[o>>2]=f;c[p>>2]=g;c[j>>2]=0;if(!(c[l>>2]|0)){b=c[j>>2]|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else{oj(c[b+208>>2]|0);a[(c[e>>2]|0)+16>>0]=0}if(!(c[(c[e>>2]|0)+40>>2]|0)){j=c[e>>2]|0;j=j+72|0;b=j;c[b>>2]=0;j=j+4|0;c[j>>2]=0;j=c[e>>2]|0;j=j+80|0;b=j;c[b>>2]=0;j=j+4|0;c[j>>2]=0;j=c[e>>2]|0;j=j+19|0;a[j>>0]=0;i=f;return}Ig(c[e>>2]|0);a[(c[e>>2]|0)+18>>0]=a[(c[e>>2]|0)+12>>0]|0;a[(c[e>>2]|0)+16>>0]=0;c[(c[e>>2]|0)+40>>2]=0;j=c[e>>2]|0;j=j+72|0;b=j;c[b>>2]=0;j=j+4|0;c[j>>2]=0;j=c[e>>2]|0;j=j+80|0;b=j;c[b>>2]=0;j=j+4|0;c[j>>2]=0;j=c[e>>2]|0;j=j+19|0;a[j>>0]=0;i=f;return}function Oh(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;g=e+8|0;f=e+4|0;h=e;c[g>>2]=b;c[f>>2]=d;c[h>>2]=c[f>>2]&255;if(!((c[h>>2]|0)==13|(c[h>>2]|0)==10)){h=c[f>>2]|0;i=e;return h|0}c[(c[g>>2]|0)+40>>2]=c[f>>2];a[(c[g>>2]|0)+16>>0]=6;h=c[f>>2]|0;i=e;return h|0}function Ph(b){b=b|0;var d=0,e=0,f=0;e=i;i=i+16|0;f=e+4|0;d=e;c[f>>2]=b;c[d>>2]=0;if(!(a[(c[f>>2]|0)+7>>0]|0))c[d>>2]=Yh(c[(c[f>>2]|0)+64>>2]|0,2)|0;if(c[d>>2]|0){f=c[d>>2]|0;i=e;return f|0}c[d>>2]=Gg(c[(c[f>>2]|0)+64>>2]|0,(c[f>>2]|0)+80|0)|0;f=c[d>>2]|0;i=e;return f|0}function Qh(b){b=b|0;var e=0,f=0;e=i;i=i+16|0;f=e;c[f>>2]=b;do if((d[(c[f>>2]|0)+16>>0]|0)!=6?(d[(c[f>>2]|0)+16>>0]|0)!=0:0){if((d[(c[f>>2]|0)+16>>0]|0)>=2){kh();Th(c[f>>2]|0)|0;lh();break}if(!(a[(c[f>>2]|0)+4>>0]|0))Uh(c[f>>2]|0,0,0)|0}while(0);Nh(c[f>>2]|0);i=e;return}function Rh(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;c[d>>2]=0;if(!(c[c[e>>2]>>2]|0)){e=c[d>>2]|0;i=b;return e|0}c[d>>2]=ub[c[(c[c[e>>2]>>2]|0)+4>>2]&31](c[e>>2]|0)|0;c[c[e>>2]>>2]=0;e=c[d>>2]|0;i=b;return e|0}function Sh(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;rb[c[38640+148>>2]&31](c[(c[d>>2]|0)+40>>2]|0);i=b;return}function Th(b){b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;e=i;i=i+32|0;f=e+16|0;g=e+12|0;h=e+8|0;j=e+4|0;k=e;c[g>>2]=b;c[h>>2]=0;b=c[g>>2]|0;if((d[(c[g>>2]|0)+16>>0]|0)==6){c[f>>2]=c[b+40>>2];b=c[f>>2]|0;i=e;return b|0}if((d[b+16>>0]|0)<=1){c[f>>2]=0;b=c[f>>2]|0;i=e;return b|0}l=(ai(c[g>>2]|0)|0)!=0;b=c[g>>2]|0;do if(l){c[h>>2]=si(b,2,-1)|0;c[j>>2]=Uh(c[g>>2]|0,d[(c[g>>2]|0)+19>>0]|0,0)|0;if(!(c[h>>2]|0))c[h>>2]=c[j>>2]}else{if((c[c[b+64>>2]>>2]|0)!=0?(d[(c[g>>2]|0)+16>>0]|0)!=2:0){c[h>>2]=ti(c[g>>2]|0,0)|0;break}c[k>>2]=d[(c[g>>2]|0)+16>>0];c[h>>2]=Uh(c[g>>2]|0,0,0)|0;if((c[k>>2]|0)>2?(a[(c[g>>2]|0)+15>>0]|0)==0:0){c[(c[g>>2]|0)+40>>2]=4;a[(c[g>>2]|0)+16>>0]=6;c[f>>2]=c[h>>2];l=c[f>>2]|0;i=e;return l|0}}while(0);c[f>>2]=Oh(c[g>>2]|0,c[h>>2]|0)|0;l=c[f>>2]|0;i=e;return l|0}function Uh(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;m=i;i=i+32|0;h=m+24|0;l=m+20|0;n=m+16|0;k=m+12|0;j=m+8|0;g=m+4|0;o=m;c[l>>2]=b;c[n>>2]=e;c[k>>2]=f;c[j>>2]=0;c[g>>2]=0;if((d[(c[l>>2]|0)+16>>0]|0)<2?(d[(c[l>>2]|0)+17>>0]|0)<2:0){c[h>>2]=0;b=c[h>>2]|0;i=m;return b|0}Vh(c[l>>2]|0);a:do if(c[c[(c[l>>2]|0)+64>>2]>>2]|0){b=(Wh(c[(c[l>>2]|0)+64>>2]|0)|0)!=0;f=c[l>>2]|0;if(b){Rh(c[f+64>>2]|0)|0;break}e=c[l>>2]|0;if((d[f+5>>0]|0)==3){b=e+72|0;if(!((c[b>>2]|0)==0&(c[b+4>>2]|0)==0)){c[j>>2]=Xh(c[(c[l>>2]|0)+64>>2]|0,0,0)|0;if((c[j>>2]|0)==0?(d[(c[l>>2]|0)+8>>0]|0)!=0:0)c[j>>2]=Yh(c[(c[l>>2]|0)+64>>2]|0,d[(c[l>>2]|0)+11>>0]|0)|0}else c[j>>2]=0;b=(c[l>>2]|0)+72|0;c[b>>2]=0;c[b+4>>2]=0;break}else{do if((d[e+5>>0]|0)!=1){if((d[(c[l>>2]|0)+4>>0]|0)!=0?(d[(c[l>>2]|0)+5>>0]|0)!=5:0)break;c[o>>2]=((a[(c[l>>2]|0)+12>>0]|0)!=0?0:1)&1;Rh(c[(c[l>>2]|0)+64>>2]|0)|0;if(!(c[o>>2]|0))break a;c[j>>2]=_h(c[c[l>>2]>>2]|0,c[(c[l>>2]|0)+172>>2]|0,0)|0;break a}while(0);c[j>>2]=Zh(c[l>>2]|0,c[n>>2]|0)|0;b=(c[l>>2]|0)+72|0;c[b>>2]=0;c[b+4>>2]=0;break}}while(0);_g(c[(c[l>>2]|0)+56>>2]|0);c[(c[l>>2]|0)+56>>2]=0;c[(c[l>>2]|0)+44>>2]=0;$h(c[(c[l>>2]|0)+204>>2]|0);Qg(c[(c[l>>2]|0)+204>>2]|0,c[(c[l>>2]|0)+24>>2]|0);if(!(ai(c[l>>2]|0)|0)){if((c[j>>2]|0)==0&(c[k>>2]|0)!=0?(c[(c[l>>2]|0)+32>>2]|0)>>>0>(c[(c[l>>2]|0)+24>>2]|0)>>>0:0)c[j>>2]=ci(c[l>>2]|0,c[(c[l>>2]|0)+24>>2]|0)|0}else c[g>>2]=bi(c[(c[l>>2]|0)+208>>2]|0)|0;if((c[j>>2]|0)==0&(c[k>>2]|0)!=0?(c[c[(c[l>>2]|0)+60>>2]>>2]|0)!=0:0){b=ig(c[(c[l>>2]|0)+60>>2]|0,22,0)|0;c[j>>2]=b;c[j>>2]=(c[j>>2]|0)==12?0:b}do if(!(a[(c[l>>2]|0)+4>>0]|0)){if((ai(c[l>>2]|0)|0)!=0?(di(c[(c[l>>2]|0)+208>>2]|0,0)|0)==0:0)break;c[g>>2]=ei(c[l>>2]|0,1)|0;a[(c[l>>2]|0)+18>>0]=0}while(0);a[(c[l>>2]|0)+16>>0]=1;a[(c[l>>2]|0)+19>>0]=0;c[h>>2]=(c[j>>2]|0)==0?c[g>>2]|0:c[j>>2]|0;b=c[h>>2]|0;i=m;return b|0}function Vh(b){b=b|0;var d=0,e=0,f=0;e=i;i=i+16|0;d=e+4|0;f=e;c[d>>2]=b;c[f>>2]=0;while(1){if((c[f>>2]|0)>=(c[(c[d>>2]|0)+96>>2]|0))break;_g(c[(c[(c[d>>2]|0)+92>>2]|0)+((c[f>>2]|0)*48|0)+16>>2]|0);c[f>>2]=(c[f>>2]|0)+1}if(!((a[(c[d>>2]|0)+4>>0]|0)!=0?(Wh(c[(c[d>>2]|0)+68>>2]|0)|0)==0:0))Rh(c[(c[d>>2]|0)+68>>2]|0)|0;hc(c[(c[d>>2]|0)+92>>2]|0);c[(c[d>>2]|0)+92>>2]=0;c[(c[d>>2]|0)+96>>2]=0;c[(c[d>>2]|0)+52>>2]=0;i=e;return}function Wh(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return(c[c[b>>2]>>2]|0)==4272|0}function Xh(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+16|0;f=e+8|0;g=e;c[f>>2]=a;a=g;c[a>>2]=b;c[a+4>>2]=d;a=g;a=pb[c[(c[c[f>>2]>>2]|0)+16>>2]&31](c[f>>2]|0,c[a>>2]|0,c[a+4>>2]|0)|0;i=e;return a|0}function Yh(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;a=zb[c[(c[c[f>>2]>>2]|0)+20>>2]&63](c[f>>2]|0,c[e>>2]|0)|0;i=d;return a|0}function Zh(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+32|0;h=f+24|0;l=f+20|0;g=f+16|0;k=f+8|0;j=f;c[h>>2]=b;c[l>>2]=e;c[g>>2]=0;b=(c[h>>2]|0)+72|0;if(!((c[b>>2]|0)!=0|(c[b+4>>2]|0)!=0)){b=c[g>>2]|0;i=f;return b|0}m=(c[h>>2]|0)+160|0;e=c[m+4>>2]|0;b=k;c[b>>2]=c[m>>2];c[b+4>>2]=e;b=k;e=c[(c[h>>2]|0)+64>>2]|0;if((c[l>>2]|0)!=0|(c[b>>2]|0)==0&(c[b+4>>2]|0)==0)c[g>>2]=Xh(e,0,0)|0;else c[g>>2]=id(e,4240,28,0,0)|0;if((c[g>>2]|0)==0?(a[(c[h>>2]|0)+7>>0]|0)==0:0)c[g>>2]=Yh(c[(c[h>>2]|0)+64>>2]|0,16|d[(c[h>>2]|0)+11>>0])|0;m=k;b=c[m+4>>2]|0;if(!((c[g>>2]|0)==0&((b|0)>0|(b|0)==0&(c[m>>2]|0)>>>0>0))){m=c[g>>2]|0;i=f;return m|0}c[g>>2]=Gg(c[(c[h>>2]|0)+64>>2]|0,j)|0;if(c[g>>2]|0){m=c[g>>2]|0;i=f;return m|0}b=j;l=c[b+4>>2]|0;m=k;e=c[m+4>>2]|0;if(!((l|0)>(e|0)|((l|0)==(e|0)?(c[b>>2]|0)>>>0>(c[m>>2]|0)>>>0:0))){m=c[g>>2]|0;i=f;return m|0}m=k;c[g>>2]=Xh(c[(c[h>>2]|0)+64>>2]|0,c[m>>2]|0,c[m+4>>2]|0)|0;m=c[g>>2]|0;i=f;return m|0}function _h(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;h=e+8|0;g=e+4|0;f=e;c[h>>2]=a;c[g>>2]=b;c[f>>2]=d;a=pb[c[(c[h>>2]|0)+28>>2]&31](c[h>>2]|0,c[g>>2]|0,c[f>>2]|0)|0;i=e;return a|0}function $h(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b+4|0;e=b;c[d>>2]=a;while(1){a=c[c[d>>2]>>2]|0;c[e>>2]=a;if(!a)break;Rg(c[e>>2]|0)}i=b;return}function ai(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return(c[(c[b>>2]|0)+208>>2]|0)!=0|0}function bi(b){b=b|0;var d=0,e=0;d=i;i=i+16|0;e=d;c[e>>2]=b;if(!(a[(c[e>>2]|0)+44>>0]|0)){i=d;return 0}ji(c[e>>2]|0,0,1);a[(c[e>>2]|0)+44>>0]=0;a[(c[e>>2]|0)+47>>0]=0;i=d;return 0}function ci(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;e=i;i=i+48|0;g=e+32|0;m=e+28|0;f=e+24|0;l=e+8|0;k=e;j=e+20|0;h=e+16|0;c[g>>2]=a;c[m>>2]=b;c[f>>2]=0;if(!(c[c[(c[g>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=g;c[j>>2]=e;c[k>>2]=f;if(c[k>>2]|0){f=c[j>>2]|0;if((c[k>>2]|0)>0){hi(f,3+(b[(c[j>>2]|0)+40>>1]|0)|0);a[(c[j>>2]|0)+43>>0]=1;c[h>>2]=1;e=c[h>>2]|0;i=g;return e|0}else{c[h>>2]=(d[f+43>>0]|0)==0&1;e=c[h>>2]|0;i=g;return e|0}}if(!(a[(c[j>>2]|0)+43>>0]|0)){c[h>>2]=0;e=c[h>>2]|0;i=g;return e|0}a[(c[j>>2]|0)+43>>0]=0;if(gi(c[j>>2]|0,3+(b[(c[j>>2]|0)+40>>1]|0)|0)|0)a[(c[j>>2]|0)+43>>0]=1;c[h>>2]=(d[(c[j>>2]|0)+43>>0]|0)==0&1;e=c[h>>2]|0;i=g;return e|0}function ei(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0;f=i;i=i+16|0;h=f+8|0;j=f+4|0;g=f;c[h>>2]=b;c[j>>2]=e;c[g>>2]=0;if(!(c[c[(c[h>>2]|0)+60>>2]>>2]|0)){b=c[g>>2]|0;i=f;return b|0}if(d[(c[h>>2]|0)+13>>0]|0)e=0;else e=fi(c[(c[h>>2]|0)+60>>2]|0,c[j>>2]|0)|0;c[g>>2]=e;if((d[(c[h>>2]|0)+17>>0]|0|0)==5){b=c[g>>2]|0;i=f;return b|0}a[(c[h>>2]|0)+17>>0]=c[j>>2];b=c[g>>2]|0;i=f;return b|0}function fi(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;a=zb[c[(c[c[f>>2]>>2]|0)+32>>2]&63](c[f>>2]|0,c[e>>2]|0)|0;i=d;return a|0}function gi(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;f=e+12|0;j=e+8|0;h=e+4|0;g=e;c[j>>2]=b;c[h>>2]=d;if(a[(c[j>>2]|0)+43>>0]|0){c[f>>2]=0;b=c[f>>2]|0;i=e;return b|0}else{c[g>>2]=ii(c[(c[j>>2]|0)+4>>2]|0,c[h>>2]|0,1,6)|0;c[f>>2]=c[g>>2];b=c[f>>2]|0;i=e;return b|0}return 0}function hi(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+16|0;f=e+4|0;g=e;c[f>>2]=b;c[g>>2]=d;if(a[(c[f>>2]|0)+43>>0]|0){i=e;return}ii(c[(c[f>>2]|0)+4>>2]|0,c[g>>2]|0,1,5)|0;i=e;return}function ii(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;k=f+12|0;j=f+8|0;h=f+4|0;g=f;c[k>>2]=a;c[j>>2]=b;c[h>>2]=d;c[g>>2]=e;a=xb[c[(c[c[k>>2]>>2]|0)+56>>2]&7](c[k>>2]|0,c[j>>2]|0,c[h>>2]|0,c[g>>2]|0)|0;i=f;return a|0}function ji(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0;f=i;i=i+16|0;g=f+8|0;h=f+4|0;j=f;c[g>>2]=b;c[h>>2]=d;c[j>>2]=e;if(a[(c[g>>2]|0)+43>>0]|0){i=f;return}ii(c[(c[g>>2]|0)+4>>2]|0,c[h>>2]|0,c[j>>2]|0,9)|0;i=f;return}function ki(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;ni(c[d>>2]|0,0,0)|0;i=b;return 0}function li(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;k=i;i=i+64|0;t=k+52|0;s=k+48|0;g=k+44|0;l=k+8|0;h=k+40|0;o=k+36|0;m=k+32|0;p=k+28|0;j=k+24|0;r=k;q=k+20|0;n=k+16|0;c[t>>2]=a;c[s>>2]=b;c[g>>2]=d;d=l;c[d>>2]=e;c[d+4>>2]=f;c[h>>2]=c[t>>2];c[o>>2]=c[s>>2];c[m>>2]=c[g>>2];d=(c[h>>2]|0)+24|0;b=l;a=l;a:do if(((c[d>>2]|0)!=(c[b>>2]|0)?1:(c[d+4>>2]|0)!=(c[b+4>>2]|0))|(c[a>>2]|0)==0&(c[a+4>>2]|0)==0){t=r;c[t>>2]=0;c[t+4>>2]=0;c[j>>2]=c[(c[h>>2]|0)+4>>2];while(1){if(!(c[j>>2]|0))break a;s=r;s=bF(c[s>>2]|0,c[s+4>>2]|0,1020,0)|0;b=D;t=l;a=c[t+4>>2]|0;if(!((b|0)<(a|0)|((b|0)==(a|0)?s>>>0<=(c[t>>2]|0)>>>0:0)))break a;s=r;s=bF(c[s>>2]|0,c[s+4>>2]|0,1020,0)|0;t=r;c[t>>2]=s;c[t+4>>2]=D;c[j>>2]=c[c[j>>2]>>2]}}else c[j>>2]=c[(c[h>>2]|0)+32>>2];while(0);t=l;t=kF(c[t>>2]|0,c[t+4>>2]|0,1020,0)|0;c[p>>2]=t;while(1){c[q>>2]=1020-(c[p>>2]|0);if((c[m>>2]|0)<(1020-(c[p>>2]|0)|0))f=c[m>>2]|0;else f=1020-(c[p>>2]|0)|0;c[n>>2]=f;dF(c[o>>2]|0,(c[j>>2]|0)+4+(c[p>>2]|0)|0,c[n>>2]|0)|0;c[o>>2]=(c[o>>2]|0)+(c[n>>2]|0);c[m>>2]=(c[m>>2]|0)-(c[q>>2]|0);c[p>>2]=0;if((c[m>>2]|0)<0){m=13;break}t=c[c[j>>2]>>2]|0;c[j>>2]=t;if(!((t|0)!=0&(c[m>>2]|0)>0)){m=13;break}}if((m|0)==13){t=l;s=c[g>>2]|0;s=bF(c[t>>2]|0,c[t+4>>2]|0,s|0,((s|0)<0)<<31>>31|0)|0;t=(c[h>>2]|0)+24|0;c[t>>2]=s;c[t+4>>2]=D;c[(c[h>>2]|0)+32>>2]=c[j>>2];i=k;return 0}return 0}function mi(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;g=i;i=i+64|0;h=g+48|0;s=g+44|0;q=g+40|0;r=g+36|0;o=g+32|0;n=g+28|0;p=g+24|0;j=g+20|0;m=g+16|0;l=g+12|0;k=g+8|0;c[s>>2]=a;c[q>>2]=b;c[r>>2]=d;a=g;c[a>>2]=e;c[a+4>>2]=f;c[o>>2]=c[s>>2];c[n>>2]=c[r>>2];c[p>>2]=c[q>>2];while(1){if((c[n>>2]|0)<=0){j=14;break}c[j>>2]=c[(c[o>>2]|0)+16>>2];s=(c[o>>2]|0)+8|0;s=kF(c[s>>2]|0,c[s+4>>2]|0,1020,0)|0;c[m>>2]=s;if((c[n>>2]|0)<(1020-(c[m>>2]|0)|0))f=c[n>>2]|0;else f=1020-(c[m>>2]|0)|0;c[l>>2]=f;if(!(c[m>>2]|0)){c[k>>2]=fc(1024)|0;if(!(c[k>>2]|0)){j=8;break}c[c[k>>2]>>2]=0;f=c[k>>2]|0;if(c[j>>2]|0)c[c[j>>2]>>2]=f;else c[(c[o>>2]|0)+4>>2]=f;c[(c[o>>2]|0)+16>>2]=c[k>>2]}dF((c[(c[o>>2]|0)+16>>2]|0)+4+(c[m>>2]|0)|0,c[p>>2]|0,c[l>>2]|0)|0;c[p>>2]=(c[p>>2]|0)+(c[l>>2]|0);c[n>>2]=(c[n>>2]|0)-(c[l>>2]|0);r=c[l>>2]|0;s=(c[o>>2]|0)+8|0;q=s;r=bF(c[q>>2]|0,c[q+4>>2]|0,r|0,((r|0)<0)<<31>>31|0)|0;c[s>>2]=r;c[s+4>>2]=D}if((j|0)==8){c[h>>2]=3082;s=c[h>>2]|0;i=g;return s|0}else if((j|0)==14){c[h>>2]=0;s=c[h>>2]|0;i=g;return s|0}return 0}function ni(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;f=i;i=i+32|0;e=f+20|0;j=f+16|0;g=f+12|0;h=f+8|0;c[e>>2]=a;a=f;c[a>>2]=b;c[a+4>>2]=d;c[j>>2]=c[e>>2];c[g>>2]=c[(c[j>>2]|0)+4>>2];while(1){if(!(c[g>>2]|0))break;c[h>>2]=c[g>>2];c[g>>2]=c[c[g>>2]>>2];hc(c[h>>2]|0)}qi(c[e>>2]|0);i=f;return 0}function oi(a,b){a=a|0;b=b|0;var d=0;d=i;i=i+16|0;c[d+4>>2]=a;c[d>>2]=b;i=d;return 0}function pi(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;g=d+8|0;f=d+4|0;e=d;c[g>>2]=a;c[f>>2]=b;c[e>>2]=c[g>>2];e=(c[e>>2]|0)+8|0;b=c[e+4>>2]|0;a=c[f>>2]|0;c[a>>2]=c[e>>2];c[a+4>>2]=b;i=d;return 0}function qi(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;c[d>>2]=c[e>>2];a=c[d>>2]|0;_E(a|0,0,ri()|0)|0;c[c[d>>2]>>2]=4272;i=b;return}function ri(){return 40}function si(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;h=i;i=i+32|0;g=h+24|0;j=h+20|0;m=h+16|0;e=h+12|0;l=h+8|0;k=h+4|0;f=h;c[g>>2]=a;c[j>>2]=b;c[m>>2]=d;c[e>>2]=c[(c[g>>2]|0)+40>>2];if(c[e>>2]|0){a=c[e>>2]|0;i=h;return a|0}if((c[m>>2]|0)>=(c[(c[g>>2]|0)+96>>2]|0)){a=c[e>>2]|0;i=h;return a|0}c[k>>2]=(c[m>>2]|0)+((c[j>>2]|0)==1?0:1);c[l>>2]=c[k>>2];while(1){if((c[l>>2]|0)>=(c[(c[g>>2]|0)+96>>2]|0))break;_g(c[(c[(c[g>>2]|0)+92>>2]|0)+((c[l>>2]|0)*48|0)+16>>2]|0);c[l>>2]=(c[l>>2]|0)+1}c[(c[g>>2]|0)+96>>2]=c[k>>2];if((c[j>>2]|0)!=1){if((ai(c[g>>2]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=wi(c[g>>2]|0,c[m>>2]|0,c[b>>2]|0,c[b+4>>2]|0,r,o)|0;if(c[j>>2]|0){o=8;break}if((c[r>>2]|0)==-1){t=q;t=ZE(c[t>>2]|0,c[t+4>>2]|0,c[(c[g>>2]|0)+148>>2]|0,0)|0;b=(c[(c[g>>2]|0)+152>>2]|0)+8|0;b=jF(t|0,D|0,b|0,((b|0)<0)<<31>>31|0)|0;c[r>>2]=b}if(!((c[r>>2]|0)!=0|(c[m>>2]|0)!=0)?(t=(c[g>>2]|0)+80|0,t=bF(c[t>>2]|0,c[t+4>>2]|0,c[(c[g>>2]|0)+148>>2]|0,0)|0,b=(c[g>>2]|0)+72|0,(t|0)==(c[b>>2]|0)?(D|0)==(c[b+4>>2]|0):0):0){b=q;t=(c[g>>2]|0)+72|0;t=ZE(c[b>>2]|0,c[b+4>>2]|0,c[t>>2]|0,c[t+4>>2]|0)|0;b=(c[(c[g>>2]|0)+152>>2]|0)+8|0;b=jF(t|0,D|0,b|0,((b|0)<0)<<31>>31|0)|0;c[r>>2]=b}b=(c[g>>2]|0)+72|0;if((c[b+4>>2]|0)==0?(c[b>>2]|0)==(c[(c[g>>2]|0)+148>>2]|0):0){c[j>>2]=ci(c[g>>2]|0,c[o>>2]|0)|0;if(c[j>>2]|0)break a;c[(c[g>>2]|0)+24>>2]=c[o>>2]}c[p>>2]=0;while(1){if((c[p>>2]|0)>>>0>=(c[r>>2]|0)>>>0)continue b;if(c[s>>2]|0){Ig(c[g>>2]|0);c[s>>2]=0}c[j>>2]=xi(c[g>>2]|0,(c[g>>2]|0)+72|0,0,1,0)|0;if(c[j>>2]|0)break;c[f>>2]=(c[f>>2]|0)+1;c[p>>2]=(c[p>>2]|0)+1}if((c[j>>2]|0)!=101){o=26;break}e=q;t=c[e+4>>2]|0;b=(c[g>>2]|0)+72|0;c[b>>2]=c[e>>2];c[b+4>>2]=t}if((o|0)==8){if((c[j>>2]|0)!=101)break;c[j>>2]=0;break}else if((o|0)==26){if((c[j>>2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]|0)==0){a=c[(c[k>>2]|0)+64>>2]|0;t=l;t=bF(c[t>>2]|0,c[t+4>>2]|0,20,0)|0;t=Fi(a,t,D,o)|0;c[n>>2]=t;if(0==(t|0)?(a=c[(c[k>>2]|0)+64>>2]|0,t=l,t=bF(c[t>>2]|0,c[t+4>>2]|0,24,0)|0,t=Fi(a,t,D,m)|0,c[n>>2]=t,0==(t|0)):0){if(!(c[m>>2]|0))c[m>>2]=c[(c[k>>2]|0)+152>>2];if((!((c[m>>2]|0)>>>0<512|(c[o>>2]|0)>>>0<32|(c[m>>2]|0)>>>0>65536|(c[o>>2]|0)>>>0>65536)?((c[m>>2]|0)-1&c[m>>2]|0)==0:0)?((c[o>>2]|0)-1&c[o>>2]|0)==0:0){c[n>>2]=Eg(c[k>>2]|0,m,-1)|0;c[(c[k>>2]|0)+148>>2]=c[o>>2];break}c[j>>2]=101;t=c[j>>2]|0;i=p;return t|0}c[j>>2]=c[n>>2];t=c[j>>2]|0;i=p;return t|0}while(0);t=(c[k>>2]|0)+72|0;a=t;a=bF(c[a>>2]|0,c[a+4>>2]|0,c[(c[k>>2]|0)+148>>2]|0,0)|0;c[t>>2]=a;c[t+4>>2]=D;c[j>>2]=c[n>>2];t=c[j>>2]|0;i=p;return t|0}c[j>>2]=c[n>>2];t=c[j>>2]|0;i=p;return t|0}function xi(f,g,h,j,k){f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0;m=i;i=i+64|0;l=m+60|0;r=m+56|0;w=m+52|0;A=m+48|0;x=m+44|0;q=m+40|0;o=m+36|0;n=m+32|0;s=m+28|0;z=m+24|0;u=m+20|0;B=m+16|0;v=m+12|0;t=m;p=m+8|0;c[r>>2]=f;c[w>>2]=g;c[A>>2]=h;c[x>>2]=j;c[q>>2]=k;c[u>>2]=c[(c[r>>2]|0)+200>>2];f=c[r>>2]|0;if(c[x>>2]|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ji(c[n>>2]|0);break}c[l>>2]=c[o>>2];g=c[l>>2]|0;i=m;return g|0}while(0);if(c[n>>2]|0){c[p>>2]=c[(c[n>>2]|0)+4>>2];dF(c[p>>2]|0,c[u>>2]|0,c[(c[r>>2]|0)+152>>2]|0)|0;rb[c[(c[r>>2]|0)+196>>2]&31](c[n>>2]|0);do if(c[x>>2]|0){if((c[q>>2]|0)!=0?(h=c[w>>2]|0,k=c[h+4>>2]|0,g=(c[r>>2]|0)+80|0,j=c[g+4>>2]|0,!((k|0)<(j|0)|((k|0)==(j|0)?(c[h>>2]|0)>>>0<=(c[g>>2]|0)>>>0:0))):0)break;Rg(c[n>>2]|0)}while(0);if((c[s>>2]|0)==1){q=(c[r>>2]|0)+100|0;r=(c[p>>2]|0)+24|0;p=q+16|0;do{a[q>>0]=a[r>>0]|0;q=q+1|0;r=r+1|0}while((q|0)<(p|0))}Ki(c[n>>2]|0)}c[l>>2]=c[o>>2];g=c[l>>2]|0;i=m;return g|0}c[l>>2]=0;g=c[l>>2]|0;i=m;return g|0}c[l>>2]=101;g=c[l>>2]|0;i=m;return g|0}function yi(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;s=i;i=i+64|0;t=s+60|0;j=s+56|0;h=s+52|0;g=s+48|0;m=s+44|0;f=s+40|0;e=s+36|0;r=s;p=s+32|0;l=s+28|0;n=s+24|0;q=s+16|0;k=s+12|0;o=s+8|0;c[t>>2]=b;c[j>>2]=d;c[h>>2]=c[c[t>>2]>>2];c[e>>2]=0;b=c[(c[h>>2]|0)+4>>2]<<1;c[m>>2]=Mc(b,((b|0)<0)<<31>>31)|0;c[f>>2]=(c[m>>2]|0)+(c[(c[h>>2]|0)+4>>2]|0);if(c[m>>2]|0){c[s+20>>2]=16385;c[g>>2]=Di(c[h>>2]|0,c[j>>2]|0,c[m>>2]|0,16385,0)|0}else c[g>>2]=7;a:do if((c[g>>2]|0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a|0;var b=0,e=0;e=i;i=i+16|0;b=e;c[b>>2]=a;if((d[(c[b>>2]|0)+12>>0]|0|0)==0?((Ai(c[(c[b>>2]|0)+60>>2]|0)|0)&4096|0)==0:0){a=Bi(c[(c[b>>2]|0)+60>>2]|0)|0;c[(c[b>>2]|0)+148>>2]=a;i=e;return}c[(c[b>>2]|0)+148>>2]=512;i=e;return}function Ai(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=ub[c[(c[c[d>>2]>>2]|0)+48>>2]&31](c[d>>2]|0)|0;i=b;return a|0}function Bi(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;c[d>>2]=Ci(c[e>>2]|0)|0;if((c[d>>2]|0)>=32){if((c[d>>2]|0)>65536)c[d>>2]=65536}else c[d>>2]=512;i=b;return c[d>>2]|0}function Ci(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;c[d>>2]=c[(c[c[e>>2]>>2]|0)+44>>2];if(!(c[d>>2]|0)){e=4096;i=b;return e|0}e=ub[c[d>>2]&31](c[e>>2]|0)|0;i=b;return e|0}function Di(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;h=i;i=i+32|0;n=h+20|0;m=h+16|0;l=h+12|0;k=h+8|0;j=h+4|0;g=h;c[n>>2]=a;c[m>>2]=b;c[l>>2]=d;c[k>>2]=e;c[j>>2]=f;c[g>>2]=Ab[c[(c[n>>2]|0)+24>>2]&15](c[n>>2]|0,c[m>>2]|0,c[l>>2]|0,c[k>>2]&556927,c[j>>2]|0)|0;i=h;return c[g>>2]|0}function Ei(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0;g=i;i=i+32|0;k=g+16|0;j=g+12|0;h=g+8|0;l=g;c[k>>2]=a;c[j>>2]=b;c[h>>2]=d;a=l;c[a>>2]=e;c[a+4>>2]=f;a=l;a=Ab[c[(c[c[k>>2]>>2]|0)+8>>2]&15](c[k>>2]|0,c[j>>2]|0,c[h>>2]|0,c[a>>2]|0,c[a+4>>2]|0)|0;i=g;return a|0}function Fi(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+32|0;k=f+16|0;l=f;j=f+12|0;h=f+20|0;g=f+8|0;c[k>>2]=a;a=l;c[a>>2]=b;c[a+4>>2]=d;c[j>>2]=e;a=l;c[g>>2]=Ei(c[k>>2]|0,h,4,c[a>>2]|0,c[a+4>>2]|0)|0;if(c[g>>2]|0){l=c[g>>2]|0;i=f;return l|0}l=Hh(h)|0;c[c[j>>2]>>2]=l;l=c[g>>2]|0;i=f;return l|0}function Gi(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;j=e+12|0;h=e+8|0;f=e+4|0;g=e;c[j>>2]=a;c[h>>2]=b;c[f>>2]=c[(c[j>>2]|0)+48>>2];c[g>>2]=(c[(c[j>>2]|0)+152>>2]|0)-200;while(1){if((c[g>>2]|0)<=0)break;c[f>>2]=(c[f>>2]|0)+(d[(c[h>>2]|0)+(c[g>>2]|0)>>0]|0);c[g>>2]=(c[g>>2]|0)-200}i=e;return c[f>>2]|0}function Hi(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;g=d+8|0;f=d+4|0;e=d;c[g>>2]=a;c[f>>2]=b;c[e>>2]=Li(c[(c[g>>2]|0)+204>>2]|0,c[f>>2]|0,0)|0;a=Mi(c[(c[g>>2]|0)+204>>2]|0,c[f>>2]|0,c[e>>2]|0)|0;i=d;return a|0}function Ii(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+32|0;k=e+16|0;g=e+12|0;h=e+8|0;f=e+4|0;j=e;c[k>>2]=a;c[g>>2]=b;c[h>>2]=d;c[f>>2]=c[k>>2];while(1){if(!(c[f>>2]|0))break;if(((Qc(c[(c[f>>2]|0)+28>>2]|0)|0)==0?(c[g>>2]|0)>>>0<(c[(c[f>>2]|0)+16>>2]|0)>>>0:0)?(c[j>>2]=Yc(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0,1)|0,(c[j>>2]|0)!=0):0)c[(c[f>>2]|0)+28>>2]=c[j>>2];c[f>>2]=c[(c[f>>2]|0)+44>>2]}i=e;return}function Ji(a){a=a|0;var d=0,f=0;d=i;i=i+16|0;f=d;c[f>>2]=a;a=(c[f>>2]|0)+24|0;b[a>>1]=(e[a>>1]|0)&-33;if((e[(c[f>>2]|0)+24>>1]|0)&2){i=d;return}a=(c[f>>2]|0)+24|0;b[a>>1]=e[a>>1]|0|2;Sg(c[f>>2]|0,2);i=d;return}function Ki(a){a=a|0;var d=0,f=0;d=i;i=i+16|0;f=d;c[f>>2]=a;a=(c[f>>2]|0)+26|0;b[a>>1]=(b[a>>1]|0)+ -1<<16>>16;if(b[(c[f>>2]|0)+26>>1]|0){i=d;return}a=(c[(c[f>>2]|0)+28>>2]|0)+12|0;c[a>>2]=(c[a>>2]|0)+ -1;a=c[f>>2]|0;if(!(e[(c[f>>2]|0)+24>>1]&2)){Tg(a);i=d;return}if(!(c[a+36>>2]|0)){i=d;return}Sg(c[f>>2]|0,3);i=d;return}function Li(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;j=f+12|0;h=f+8|0;k=f+4|0;g=f;c[j>>2]=a;c[h>>2]=b;c[k>>2]=e;c[g>>2]=c[k>>2]&(d[(c[j>>2]|0)+29>>0]|0);a=pb[c[38640+132>>2]&31](c[(c[j>>2]|0)+40>>2]|0,c[h>>2]|0,c[g>>2]|0)|0;i=f;return a|0}function Mi(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+32|0;g=f+16|0;h=f+12|0;j=f+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;d=c[d+4>>2]|0}else{d=p;b=c[d>>2]|0;d=c[d+4>>2]|0}t=s;c[t>>2]=b;c[t+4>>2]=d;d=c[j>>2]|0;b=c[d+4>>2]|0;t=(c[h>>2]|0)+72|0;c[t>>2]=c[d>>2];c[t+4>>2]=b;while(1){if(c[l>>2]|0)break a;b=(c[h>>2]|0)+72|0;u=c[b+4>>2]|0;t=s;d=c[t+4>>2]|0;if(!((u|0)<(d|0)|((u|0)==(d|0)?(c[b>>2]|0)>>>0<(c[t>>2]|0)>>>0:0)))break a;c[l>>2]=xi(c[h>>2]|0,(c[h>>2]|0)+72|0,c[n>>2]|0,1,1)|0}}else f=19;while(0);if((f|0)==19){u=(c[h>>2]|0)+72|0;c[u>>2]=0;c[u+4>>2]=0}b:while(1){if(c[l>>2]|0)break;t=(c[h>>2]|0)+72|0;d=c[t+4>>2]|0;u=p;b=c[u+4>>2]|0;if(!((d|0)<(b|0)|((d|0)==(b|0)?(c[t>>2]|0)>>>0<(c[u>>2]|0)>>>0:0)))break;c[q>>2]=0;u=p;c[l>>2]=wi(c[h>>2]|0,0,c[u>>2]|0,c[u+4>>2]|0,q,r)|0;if((c[q>>2]|0)==0?(t=(c[h>>2]|0)+80|0,t=bF(c[t>>2]|0,c[t+4>>2]|0,c[(c[h>>2]|0)+148>>2]|0,0)|0,u=(c[h>>2]|0)+72|0,(t|0)==(c[u>>2]|0)?(D|0)==(c[u+4>>2]|0):0):0){u=p;t=(c[h>>2]|0)+72|0;t=ZE(c[u>>2]|0,c[u+4>>2]|0,c[t>>2]|0,c[t+4>>2]|0)|0;u=(c[(c[h>>2]|0)+152>>2]|0)+8|0;u=jF(t|0,D|0,u|0,((u|0)<0)<<31>>31|0)|0;c[q>>2]=u}c[e>>2]=0;while(1){if(c[l>>2]|0)continue b;if((c[e>>2]|0)>>>0>=(c[q>>2]|0)>>>0)continue b;t=(c[h>>2]|0)+72|0;d=c[t+4>>2]|0;u=p;b=c[u+4>>2]|0;if(!((d|0)<(b|0)|((d|0)==(b|0)?(c[t>>2]|0)>>>0<(c[u>>2]|0)>>>0:0)))continue b;c[l>>2]=xi(c[h>>2]|0,(c[h>>2]|0)+72|0,c[n>>2]|0,1,1)|0;c[e>>2]=(c[e>>2]|0)+1}}c:do if(c[j>>2]|0){t=4+(c[(c[h>>2]|0)+152>>2]|0)|0;t=lF(c[(c[j>>2]|0)+24>>2]|0,0,t|0,((t|0)<0)<<31>>31|0)|0;u=m;c[u>>2]=t;c[u+4>>2]=D;if(ai(c[h>>2]|0)|0)c[l>>2]=Ri(c[(c[h>>2]|0)+208>>2]|0,(c[j>>2]|0)+28|0)|0;c[k>>2]=c[(c[j>>2]|0)+24>>2];while(1){if(c[l>>2]|0)break c;if((c[k>>2]|0)>>>0>=(c[(c[h>>2]|0)+52>>2]|0)>>>0)break c;c[l>>2]=xi(c[h>>2]|0,m,c[n>>2]|0,0,1)|0;c[k>>2]=(c[k>>2]|0)+1}}while(0);_g(c[n>>2]|0);if(!(c[l>>2]|0)){b=p;t=c[b+4>>2]|0;u=(c[h>>2]|0)+72|0;c[u>>2]=c[b>>2];c[u+4>>2]=t}c[o>>2]=c[l>>2];u=c[o>>2]|0;i=g;return u|0}function Qi(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+16|0;g=b+12|0;d=b+8|0;e=b+4|0;f=b;c[g>>2]=a;c[(c[g>>2]|0)+24>>2]=c[(c[g>>2]|0)+28>>2];c[d>>2]=Xi(c[(c[g>>2]|0)+208>>2]|0,36,c[g>>2]|0)|0;c[e>>2]=Zi(c[(c[g>>2]|0)+204>>2]|0)|0;while(1){if(!((c[e>>2]|0)!=0&(c[d>>2]|0)==0))break;c[f>>2]=c[(c[e>>2]|0)+12>>2];c[d>>2]=Yi(c[g>>2]|0,c[(c[e>>2]|0)+20>>2]|0)|0;c[e>>2]=c[f>>2]}i=b;return c[d>>2]|0}function Ri(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=i;i=i+16|0;g=e+8|0;f=e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;o=n+16|0;h=n+12|0;j=n+8|0;g=n+4|0;l=n;c[q>>2]=a;c[p>>2]=b;c[m>>2]=d;c[k>>2]=e;c[o>>2]=f;c[h>>2]=Vi(c[q>>2]|0,c[p>>2]|0,j)|0;if(c[h>>2]|0){q=c[h>>2]|0;i=n;return q|0}c[l>>2]=(c[j>>2]|0)+16384;if(!(c[p>>2]|0)){c[j>>2]=(c[j>>2]|0)+136;c[g>>2]=0}else c[g>>2]=4062+((c[p>>2]|0)-1<<12);c[c[k>>2]>>2]=(c[j>>2]|0)+ -4;c[c[m>>2]>>2]=c[l>>2];c[c[o>>2]>>2]=c[g>>2];q=c[h>>2]|0;i=n;return q|0}function Ui(a){a=a|0;var b=0,d=0,e=0;d=i;i=i+16|0;e=d+4|0;b=d;c[e>>2]=a;c[b>>2]=(((c[e>>2]|0)+4096-4062-1|0)>>>0)/4096|0;i=d;return c[b>>2]|0}function Vi(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;m=i;i=i+32|0;g=m+24|0;l=m+20|0;h=m+16|0;j=m+12|0;k=m+8|0;o=m+4|0;n=m;c[l>>2]=b;c[h>>2]=e;c[j>>2]=f;c[k>>2]=0;do if((c[(c[l>>2]|0)+24>>2]|0)<=(c[h>>2]|0)){c[o>>2]=(c[h>>2]|0)+1<<2;c[n>>2]=jc(c[(c[l>>2]|0)+32>>2]|0,c[o>>2]|0)|0;if(c[n>>2]|0){_E((c[n>>2]|0)+(c[(c[l>>2]|0)+24>>2]<<2)|0,0,(c[h>>2]|0)+1-(c[(c[l>>2]|0)+24>>2]|0)<<2|0)|0;c[(c[l>>2]|0)+32>>2]=c[n>>2];c[(c[l>>2]|0)+24>>2]=(c[h>>2]|0)+1;break}c[c[j>>2]>>2]=0;c[g>>2]=7;b=c[g>>2]|0;i=m;return b|0}while(0);do if(!(c[(c[(c[l>>2]|0)+32>>2]|0)+(c[h>>2]<<2)>>2]|0))if((d[(c[l>>2]|0)+43>>0]|0|0)==2){b=Mc(32768,0)|0;c[(c[(c[l>>2]|0)+32>>2]|0)+(c[h>>2]<<2)>>2]=b;if(c[(c[(c[l>>2]|0)+32>>2]|0)+(c[h>>2]<<2)>>2]|0)break;c[k>>2]=7;break}else{c[k>>2]=Wi(c[(c[l>>2]|0)+4>>2]|0,c[h>>2]|0,32768,d[(c[l>>2]|0)+44>>0]|0,(c[(c[l>>2]|0)+32>>2]|0)+(c[h>>2]<<2)|0)|0;if((c[k>>2]|0)!=8)break;b=(c[l>>2]|0)+46|0;a[b>>0]=d[b>>0]|0|2;c[k>>2]=0;break}while(0);c[c[j>>2]>>2]=c[(c[(c[l>>2]|0)+32>>2]|0)+(c[h>>2]<<2)>>2];c[g>>2]=c[k>>2];b=c[g>>2]|0;i=m;return b|0}function Wi(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+32|0;m=g+16|0;l=g+12|0;k=g+8|0;j=g+4|0;h=g;c[m>>2]=a;c[l>>2]=b;c[k>>2]=d;c[j>>2]=e;c[h>>2]=f;a=Ab[c[(c[c[m>>2]>>2]|0)+52>>2]&15](c[m>>2]|0,c[l>>2]|0,c[k>>2]|0,c[j>>2]|0,c[h>>2]|0)|0;i=g;return a|0}function Xi(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;l=i;i=i+32|0;h=l+20|0;f=l+16|0;m=l+12|0;g=l+8|0;k=l+4|0;j=l;c[h>>2]=b;c[f>>2]=d;c[m>>2]=e;c[g>>2]=0;if(!(a[(c[h>>2]|0)+44>>0]|0)){b=c[g>>2]|0;i=l;return b|0}c[k>>2]=c[(c[h>>2]|0)+68>>2];b=(c[h>>2]|0)+52|0;b=b+0|0;d=(mj(c[h>>2]|0)|0)+0|0;e=b+48|0;do{a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0}while((b|0)<(e|0));c[j>>2]=(c[(c[h>>2]|0)+68>>2]|0)+1;while(1){if(c[g>>2]|0)break;if((c[j>>2]|0)>>>0>(c[k>>2]|0)>>>0)break;e=c[f>>2]|0;d=c[m>>2]|0;b=nj(c[h>>2]|0,c[j>>2]|0)|0;c[g>>2]=zb[e&63](d,b)|0;c[j>>2]=(c[j>>2]|0)+1}if((c[k>>2]|0)==(c[(c[h>>2]|0)+68>>2]|0)){b=c[g>>2]|0;i=l;return b|0}Si(c[h>>2]|0);b=c[g>>2]|0;i=l;return b|0}function Yi(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+32|0;k=e+20|0;j=e+16|0;d=e+12|0;f=e+8|0;g=e+4|0;h=e;c[k>>2]=a;c[j>>2]=b;c[d>>2]=0;c[f>>2]=c[k>>2];c[g>>2]=Hi(c[f>>2]|0,c[j>>2]|0)|0;do if(c[g>>2]|0){if((aj(c[g>>2]|0)|0)==1){bj(c[g>>2]|0);break}c[h>>2]=0;c[d>>2]=cj(c[(c[f>>2]|0)+208>>2]|0,c[(c[g>>2]|0)+20>>2]|0,h)|0;if(!(c[d>>2]|0))c[d>>2]=dj(c[g>>2]|0,c[h>>2]|0)|0;if(!(c[d>>2]|0))rb[c[(c[f>>2]|0)+196>>2]&31](c[g>>2]|0);ej(c[g>>2]|0)}while(0);Og(c[(c[f>>2]|0)+88>>2]|0);i=e;return c[d>>2]|0}function Zi(a){a=a|0;var b=0,d=0,e=0;d=i;i=i+16|0;b=d+4|0;e=d;c[b>>2]=a;c[e>>2]=c[c[b>>2]>>2];while(1){if(!(c[e>>2]|0))break;c[(c[e>>2]|0)+12>>2]=c[(c[e>>2]|0)+32>>2];c[e>>2]=c[(c[e>>2]|0)+32>>2]}e=_i(c[c[b>>2]>>2]|0)|0;i=d;return e|0}function _i(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0;f=i;i=i+144|0;h=f+136|0;b=f+8|0;d=f+4|0;e=f;c[h>>2]=a;j=b+0|0;a=j+128|0;do{c[j>>2]=0;j=j+4|0}while((j|0)<(a|0));while(1){if(!(c[h>>2]|0))break;c[d>>2]=c[h>>2];c[h>>2]=c[(c[d>>2]|0)+12>>2];c[(c[d>>2]|0)+12>>2]=0;c[e>>2]=0;while(1){if((c[e>>2]|0)>=31)break;if(!(c[b+(c[e>>2]<<2)>>2]|0)){g=6;break}c[d>>2]=$i(c[b+(c[e>>2]<<2)>>2]|0,c[d>>2]|0)|0;c[b+(c[e>>2]<<2)>>2]=0;c[e>>2]=(c[e>>2]|0)+1}if((g|0)==6){g=0;c[b+(c[e>>2]<<2)>>2]=c[d>>2]}if((c[e>>2]|0)!=31)continue;j=$i(c[b+(c[e>>2]<<2)>>2]|0,c[d>>2]|0)|0;c[b+(c[e>>2]<<2)>>2]=j}c[d>>2]=c[b>>2];c[e>>2]=1;while(1){g=c[d>>2]|0;if((c[e>>2]|0)>=32)break;c[d>>2]=$i(g,c[b+(c[e>>2]<<2)>>2]|0)|0;c[e>>2]=(c[e>>2]|0)+1}i=f;return g|0}function $i(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;g=i;i=i+64|0;d=g+52|0;h=g+48|0;f=g+8|0;e=g;c[d>>2]=a;c[h>>2]=b;c[e>>2]=f;while(1){if(c[d>>2]|0)a=(c[h>>2]|0)!=0;else a=0;b=c[d>>2]|0;if(!a)break;if((c[b+20>>2]|0)>>>0<(c[(c[h>>2]|0)+20>>2]|0)>>>0){c[(c[e>>2]|0)+12>>2]=c[d>>2];c[e>>2]=c[d>>2];c[d>>2]=c[(c[d>>2]|0)+12>>2];continue}else{c[(c[e>>2]|0)+12>>2]=c[h>>2];c[e>>2]=c[h>>2];c[h>>2]=c[(c[h>>2]|0)+12>>2];continue}}if(b){c[(c[e>>2]|0)+12>>2]=c[d>>2];a=f+12|0;a=c[a>>2]|0;i=g;return a|0}if(c[h>>2]|0){c[(c[e>>2]|0)+12>>2]=c[h>>2];a=f+12|0;a=c[a>>2]|0;i=g;return a|0}else{c[(c[e>>2]|0)+12>>2]=0;a=f+12|0;a=c[a>>2]|0;i=g;return a|0}return 0}function aj(a){a=a|0;var d=0,e=0;e=i;i=i+16|0;d=e;c[d>>2]=a;i=e;return b[(c[d>>2]|0)+26>>1]|0}function bj(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;if((e[(c[b>>2]|0)+24>>1]|0)&2)Sg(c[b>>2]|0,1);a=(c[(c[b>>2]|0)+28>>2]|0)+12|0;c[a>>2]=(c[a>>2]|0)+ -1;if((c[(c[b>>2]|0)+20>>2]|0)==1)c[(c[(c[b>>2]|0)+28>>2]|0)+44>>2]=0;vb[c[38640+136>>2]&63](c[(c[(c[b>>2]|0)+28>>2]|0)+40>>2]|0,c[c[b>>2]>>2]|0,1);i=d;return}function cj(a,d,f){a=a|0;d=d|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;j=i;i=i+64|0;h=j+52|0;m=j+48|0;o=j+44|0;g=j+40|0;l=j+36|0;v=j+32|0;q=j+28|0;r=j+24|0;s=j+20|0;t=j+16|0;p=j+12|0;n=j+8|0;k=j+4|0;u=j;c[m>>2]=a;c[o>>2]=d;c[g>>2]=f;c[l>>2]=0;c[v>>2]=c[(c[m>>2]|0)+68>>2];if((c[v>>2]|0)!=0?(b[(c[m>>2]|0)+40>>1]|0)!=0:0){c[q>>2]=Ui(c[v>>2]|0)|0;a:while(1){if(!((c[q>>2]|0)>=0&(c[l>>2]|0)==0)){m=17;break}c[k>>2]=Ti(c[m>>2]|0,c[q>>2]|0,r,s,t)|0;if(c[k>>2]|0){m=7;break}c[n>>2]=8192;c[p>>2]=jj(c[o>>2]|0)|0;while(1){if(!(b[(c[r>>2]|0)+(c[p>>2]<<1)>>1]|0))break;c[u>>2]=(e[(c[r>>2]|0)+(c[p>>2]<<1)>>1]|0)+(c[t>>2]|0);if((c[u>>2]|0)>>>0<=(c[v>>2]|0)>>>0?(c[(c[s>>2]|0)+(e[(c[r>>2]|0)+(c[p>>2]<<1)>>1]<<2)>>2]|0)==(c[o>>2]|0):0)c[l>>2]=c[u>>2];a=c[n>>2]|0;c[n>>2]=a+ -1;if(!a){m=14;break a}c[p>>2]=lj(c[p>>2]|0)|0}c[q>>2]=(c[q>>2]|0)+ -1}if((m|0)==7){c[h>>2]=c[k>>2];a=c[h>>2]|0;i=j;return a|0}else if((m|0)==14){c[h>>2]=kj(50484)|0;a=c[h>>2]|0;i=j;return a|0}else if((m|0)==17){c[c[g>>2]>>2]=c[l>>2];c[h>>2]=0;a=c[h>>2]|0;i=j;return a|0}}c[c[g>>2]>>2]=0;c[h>>2]=0;a=c[h>>2]|0;i=j;return a|0}function dj(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;e=i;i=i+48|0;j=e+32|0;m=e+28|0;l=e+24|0;k=e+20|0;f=e+16|0;h=e+12|0;n=e;g=e+8|0;c[j>>2]=b;c[m>>2]=d;c[l>>2]=c[(c[j>>2]|0)+16>>2];c[k>>2]=c[(c[j>>2]|0)+20>>2];c[f>>2]=0;c[h>>2]=c[(c[l>>2]|0)+152>>2];if(c[m>>2]|0)c[f>>2]=ij(c[(c[l>>2]|0)+208>>2]|0,c[m>>2]|0,c[h>>2]|0,c[(c[j>>2]|0)+4>>2]|0)|0;else{m=c[(c[l>>2]|0)+152>>2]|0;m=lF((c[k>>2]|0)-1|0,0,m|0,((m|0)<0)<<31>>31|0)|0;b=n;c[b>>2]=m;c[b+4>>2]=D;b=n;b=Ei(c[(c[l>>2]|0)+60>>2]|0,c[(c[j>>2]|0)+4>>2]|0,c[h>>2]|0,c[b>>2]|0,c[b+4>>2]|0)|0;c[f>>2]=b;c[f>>2]=(c[f>>2]|0)==522?0:b}if((c[k>>2]|0)!=1){b=c[f>>2]|0;i=e;return b|0}if(c[f>>2]|0){h=(c[l>>2]|0)+100|0;g=h+16|0;do{a[h>>0]=255;h=h+1|0}while((h|0)<(g|0));b=c[f>>2]|0;i=e;return b|0}else{c[g>>2]=(c[(c[j>>2]|0)+4>>2]|0)+24;h=(c[l>>2]|0)+100|0;j=(c[g>>2]|0)+0|0;g=h+16|0;do{a[h>>0]=a[j>>0]|0;h=h+1|0;j=j+1|0}while((h|0)<(g|0));b=c[f>>2]|0;i=e;return b|0}return 0}function ej(a){a=a|0;var b=0,d=0,f=0;b=i;i=i+16|0;f=b+4|0;d=b;c[f>>2]=a;c[d>>2]=c[(c[f>>2]|0)+16>>2];a=c[f>>2]|0;if((e[(c[f>>2]|0)+24>>1]|0)&64){fj(a);f=c[d>>2]|0;gj(f);i=b;return}else{Ki(a);f=c[d>>2]|0;gj(f);i=b;return}}function fj(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;d=b+4|0;f=b;c[d>>2]=a;c[f>>2]=c[(c[d>>2]|0)+16>>2];e=(c[f>>2]|0)+120|0;c[e>>2]=(c[e>>2]|0)+ -1;c[(c[d>>2]|0)+12>>2]=c[(c[f>>2]|0)+136>>2];c[(c[f>>2]|0)+136>>2]=c[d>>2];e=c[(c[f>>2]|0)+60>>2]|0;a=c[(c[f>>2]|0)+152>>2]|0;a=lF((c[(c[d>>2]|0)+20>>2]|0)-1|0,0,a|0,((a|0)<0)<<31>>31|0)|0;hj(e,a,D,c[(c[d>>2]|0)+4>>2]|0)|0;i=b;return}function gj(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;if(c[(c[d>>2]|0)+120>>2]|0){i=b;return}if(Fg(c[(c[d>>2]|0)+204>>2]|0)|0){i=b;return}Qh(c[d>>2]|0);i=b;return}function hj(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=i;i=i+16|0;c[f+12>>2]=a;a=f;c[a>>2]=b;c[a+4>>2]=d;c[f+8>>2]=e;i=f;return 0}function ij(a,b,d,f){a=a|0;b=b|0;d=d|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;g=i;i=i+32|0;l=g+24|0;n=g+20|0;h=g+16|0;k=g+12|0;j=g+8|0;m=g;c[l>>2]=a;c[n>>2]=b;c[h>>2]=d;c[k>>2]=f;c[j>>2]=e[(c[l>>2]|0)+66>>1];c[j>>2]=(c[j>>2]&65024)+((c[j>>2]&1)<<16);b=(c[j>>2]|0)+24|0;b=lF((c[n>>2]|0)-1|0,0,b|0,((b|0)<0)<<31>>31|0)|0;b=bF(32,0,b|0,D|0)|0;b=bF(b|0,D|0,24,0)|0;a=m;c[a>>2]=b;c[a+4>>2]=D;a=m;a=Ei(c[(c[l>>2]|0)+8>>2]|0,c[k>>2]|0,(c[h>>2]|0)>(c[j>>2]|0)?c[j>>2]|0:c[h>>2]|0,c[a>>2]|0,c[a+4>>2]|0)|0;i=g;return a|0}function jj(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return(c[b>>2]|0)*383&8191|0}function kj(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b;e=b+8|0;c[e>>2]=a;e=c[e>>2]|0;a=(vf()|0)+20|0;c[d>>2]=e;c[d+4>>2]=a;tc(11,4392,d);i=b;return 11}function lj(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return(c[b>>2]|0)+1&8191|0}function mj(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return c[c[(c[b>>2]|0)+32>>2]>>2]|0}function nj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;e=d+12|0;f=d+8|0;h=d+4|0;g=d;c[f>>2]=a;c[h>>2]=b;c[g>>2]=Ui(c[h>>2]|0)|0;b=c[h>>2]|0;if(!(c[g>>2]|0)){c[e>>2]=c[(c[c[(c[f>>2]|0)+32>>2]>>2]|0)+(34+b-1<<2)>>2];h=c[e>>2]|0;i=d;return h|0}else{c[e>>2]=c[(c[(c[(c[f>>2]|0)+32>>2]|0)+(c[g>>2]<<2)>>2]|0)+((((b-1-4062|0)>>>0)%4096|0)<<2)>>2];h=c[e>>2]|0;i=d;return h|0}return 0}function oj(a){a=a|0;var d=0,e=0;d=i;i=i+16|0;e=d;c[e>>2]=a;bi(c[e>>2]|0)|0;if((b[(c[e>>2]|0)+40>>1]|0)<0){i=d;return}hi(c[e>>2]|0,3+(b[(c[e>>2]|0)+40>>1]|0)|0);b[(c[e>>2]|0)+40>>1]=-1;i=d;return}function pj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;a=zb[c[(c[c[f>>2]>>2]|0)+28>>2]&63](c[f>>2]|0,c[e>>2]|0)|0;i=d;return a|0}function qj(b,d,e,f,g,h,j,k,l){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;n=i;i=i+64|0;m=n+48|0;p=n+44|0;r=n+40|0;t=n+36|0;u=n+32|0;v=n+28|0;x=n+24|0;w=n+20|0;z=n+16|0;s=n+12|0;o=n+8|0;y=n+4|0;q=n;c[p>>2]=b;c[r>>2]=d;c[t>>2]=e;c[u>>2]=f;c[v>>2]=g;c[x>>2]=h;c[w>>2]=j;c[z>>2]=k;c[s>>2]=l;c[y>>2]=0;c[q>>2]=c[r>>2];if(a[(c[p>>2]|0)+46>>0]|0){c[m>>2]=8;b=c[m>>2]|0;i=n;return b|0}c[o>>2]=vj(c[p>>2]|0,1,1)|0;if(c[o>>2]|0){c[m>>2]=c[o>>2];b=c[m>>2]|0;i=n;return b|0}a[(c[p>>2]|0)+45>>0]=1;do if(c[r>>2]|0){c[o>>2]=wj(c[p>>2]|0,c[t>>2]|0,c[u>>2]|0,0,1)|0;if(!(c[o>>2]|0)){a[(c[p>>2]|0)+44>>0]=1;break}if((c[o>>2]|0)==5){c[q>>2]=0;c[o>>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;if((c[f>>2]|0)==0?(b=k,d=c[b+4>>2]|0,a=j,k=c[a+4>>2]|0,(d|0)>(k|0)|((d|0)==(k|0)?(c[b>>2]|0)>>>0>(c[a>>2]|0)>>>0:0)):0){a=j;c[f>>2]=Xh(c[(c[g>>2]|0)+8>>2]|0,c[a>>2]|0,c[a+4>>2]|0)|0}lh();if(!(c[f>>2]|0)){i=e;return}a=c[f>>2]|0;c[h>>2]=c[(c[g>>2]|0)+100>>2];tc(a,4440,h);i=e;return}function tj(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;g=e+8|0;f=e+4|0;h=e;c[g>>2]=a;c[f>>2]=b;if((d[(c[g>>2]|0)+43>>0]|0|0)!=2){uj(c[(c[g>>2]|0)+4>>2]|0,c[f>>2]|0)|0;i=e;return}c[h>>2]=0;while(1){if((c[h>>2]|0)>=(c[(c[g>>2]|0)+24>>2]|0))break;hc(c[(c[(c[g>>2]|0)+32>>2]|0)+(c[h>>2]<<2)>>2]|0);c[(c[(c[g>>2]|0)+32>>2]|0)+(c[h>>2]<<2)>>2]=0;c[h>>2]=(c[h>>2]|0)+1}i=e;return}function uj(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;a=zb[c[(c[c[f>>2]>>2]|0)+64>>2]&63](c[f>>2]|0,c[e>>2]|0)|0;i=d;return a|0}function vj(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+32|0;g=f+16|0;l=f+12|0;k=f+8|0;j=f+4|0;h=f;c[l>>2]=b;c[k>>2]=d;c[j>>2]=e;if(a[(c[l>>2]|0)+43>>0]|0){c[g>>2]=0;b=c[g>>2]|0;i=f;return b|0}else{c[h>>2]=ii(c[(c[l>>2]|0)+4>>2]|0,c[k>>2]|0,c[j>>2]|0,10)|0;c[g>>2]=c[h>>2];b=c[g>>2]|0;i=f;return b|0}return 0}function wj(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;h=i;i=i+32|0;m=h+20|0;k=h+16|0;l=h+12|0;j=h+8|0;n=h+4|0;g=h;c[m>>2]=a;c[k>>2]=b;c[l>>2]=d;c[j>>2]=e;c[n>>2]=f;while(1){c[g>>2]=vj(c[m>>2]|0,c[j>>2]|0,c[n>>2]|0)|0;if(!((c[k>>2]|0)!=0&(c[g>>2]|0)==5)){j=4;break}if(!(ub[c[k>>2]&31](c[l>>2]|0)|0)){j=4;break}}if((j|0)==4){i=h;return c[g>>2]|0}return 0}function xj(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;k=i;i=i+32|0;g=k+20|0;f=k+16|0;l=k+12|0;h=k+8|0;j=k+4|0;m=k;c[f>>2]=b;c[l>>2]=e;c[h>>2]=Vi(c[f>>2]|0,0,m)|0;if(c[h>>2]|0){c[g>>2]=c[h>>2];b=c[g>>2]|0;i=k;return b|0}if(c[m>>2]|0)e=Gj(c[f>>2]|0,c[l>>2]|0)|0;else e=1;c[j>>2]=e;do if(c[j>>2]|0){e=c[f>>2]|0;if((d[(c[f>>2]|0)+46>>0]|0)&2){b=gi(e,0)|0;c[h>>2]=b;if(b)break;hi(c[f>>2]|0,0);c[h>>2]=264;break}b=vj(e,0,1)|0;c[h>>2]=b;if(!b){a[(c[f>>2]|0)+44>>0]=1;b=Vi(c[f>>2]|0,0,m)|0;c[h>>2]=b;if(0==(b|0)?(c[j>>2]=Gj(c[f>>2]|0,c[l>>2]|0)|0,(c[j>>2]|0)!=0):0){c[h>>2]=Hj(c[f>>2]|0)|0;c[c[l>>2]>>2]=1}a[(c[f>>2]|0)+44>>0]=0;ji(c[f>>2]|0,0,1)}}while(0);if((c[j>>2]|0)==0?(c[(c[f>>2]|0)+52>>2]|0)!=3007e3:0)c[h>>2]=Ij(50131)|0;c[g>>2]=c[h>>2];b=c[g>>2]|0;i=k;return b|0}function yj(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return((e[(c[b>>2]|0)+66>>1]|0)&65024)+(((e[(c[b>>2]|0)+66>>1]|0)&1)<<16)|0}function zj(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0;x=i;i=i+112|0;k=x+104|0;n=x+100|0;m=x+96|0;H=x+92|0;E=x+88|0;q=x+84|0;z=x+80|0;l=x+76|0;r=x+72|0;t=x+68|0;w=x+64|0;u=x+60|0;o=x+56|0;h=x+52|0;F=x+48|0;p=x+44|0;C=x+40|0;G=x+36|0;B=x+24|0;v=x+32|0;A=x+16|0;y=x+8|0;s=x;c[n>>2]=a;c[m>>2]=b;c[H>>2]=d;c[E>>2]=e;c[q>>2]=f;c[z>>2]=g;c[t>>2]=0;c[w>>2]=0;c[u>>2]=0;c[C>>2]=0;c[r>>2]=yj(c[n>>2]|0)|0;c[p>>2]=Aj(c[n>>2]|0)|0;if((c[c[p>>2]>>2]|0)>>>0>=(c[(c[n>>2]|0)+68>>2]|0)>>>0){c[k>>2]=0;a=c[k>>2]|0;i=x;return a|0}c[l>>2]=Bj(c[n>>2]|0,t)|0;if(c[l>>2]|0){c[k>>2]=c[l>>2];a=c[k>>2]|0;i=x;return a|0}if(c[m>>2]|0)c[C>>2]=c[H>>2];c[o>>2]=c[(c[n>>2]|0)+68>>2];c[h>>2]=c[(c[n>>2]|0)+72>>2];c[F>>2]=1;a:while(1){if((c[F>>2]|0)>=5){j=15;break}c[G>>2]=c[(c[p>>2]|0)+4+(c[F>>2]<<2)>>2];do if((c[o>>2]|0)>>>0>(c[G>>2]|0)>>>0){c[l>>2]=wj(c[n>>2]|0,c[C>>2]|0,c[E>>2]|0,3+(c[F>>2]|0)|0,1)|0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s>>2]|0)*20|0)+4>>2]=c[m>>2];c[(c[g>>2]|0)+8+((c[s>>2]|0)*20|0)+8>>2]=c[r>>2]}c[s>>2]=(c[s>>2]|0)+1}ng(c[k>>2]|0);if(c[j>>2]|0)Dj(c[g>>2]|0);c[c[h>>2]>>2]=c[g>>2];c[f>>2]=c[j>>2];a=c[f>>2]|0;i=n;return a|0}function Cj(a,b,d){a=a|0;b=b|0;d=d|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;k=i;i=i+32|0;h=k+28|0;j=k+24|0;n=k+20|0;o=k+16|0;m=k+12|0;p=k+8|0;f=k+4|0;l=k;c[h>>2]=a;c[j>>2]=b;c[n>>2]=d;c[m>>2]=-1;c[o>>2]=c[c[h>>2]>>2];c[p>>2]=(c[(c[h>>2]|0)+4>>2]|0)-1;while(1){if((c[p>>2]|0)<0)break;c[f>>2]=(c[h>>2]|0)+8+((c[p>>2]|0)*20|0);while(1){if((c[c[f>>2]>>2]|0)>=(c[(c[f>>2]|0)+12>>2]|0))break;c[l>>2]=c[(c[(c[f>>2]|0)+8>>2]|0)+((e[(c[(c[f>>2]|0)+4>>2]|0)+(c[c[f>>2]>>2]<<1)>>1]|0)<<2)>>2];if((c[l>>2]|0)>>>0>(c[o>>2]|0)>>>0){g=6;break}a=c[f>>2]|0;c[a>>2]=(c[a>>2]|0)+1}if((g|0)==6?(g=0,(c[l>>2]|0)>>>0<(c[m>>2]|0)>>>0):0){c[m>>2]=c[l>>2];c[c[n>>2]>>2]=(c[(c[f>>2]|0)+16>>2]|0)+(e[(c[(c[f>>2]|0)+4>>2]|0)+(c[c[f>>2]>>2]<<1)>>1]|0)}c[p>>2]=(c[p>>2]|0)+ -1}a=c[m>>2]|0;c[c[h>>2]>>2]=a;c[c[j>>2]>>2]=a;i=k;return(c[m>>2]|0)==-1|0}function Dj(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;ng(c[d>>2]|0);i=b;return}function Ej(a,b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j>>2]=mj(c[m>>2]|0)|0;b=k+0|0;f=(c[j>>2]|0)+0|0;p=b+48|0;do{a[b>>0]=a[f>>0]|0;b=b+1|0;f=f+1|0}while((b|0)<(p|0));Nj(c[m>>2]|0);b=h+0|0;f=(c[j>>2]|0)+48|0;p=b+48|0;do{a[b>>0]=a[f>>0]|0;b=b+1|0;f=f+1|0}while((b|0)<(p|0));if(TE(k,h,48)|0){c[l>>2]=1;p=c[l>>2]|0;i=g;return p|0}if(!(d[k+12>>0]|0)){c[l>>2]=1;p=c[l>>2]|0;i=g;return p|0}Jj(1,k,40,0,n);if((c[n>>2]|0)==(c[k+40>>2]|0)?(c[n+4>>2]|0)==(c[k+44>>2]|0):0){if(TE((c[m>>2]|0)+52|0,k,48)|0){c[c[o>>2]>>2]=1;b=(c[m>>2]|0)+52|0;f=k+0|0;p=b+48|0;do{c[b>>2]=c[f>>2];b=b+4|0;f=f+4|0}while((b|0)<(p|0));c[(c[m>>2]|0)+36>>2]=((e[(c[m>>2]|0)+66>>1]|0)&65024)+(((e[(c[m>>2]|0)+66>>1]|0)&1)<<16)}c[l>>2]=0;p=c[l>>2]|0;i=g;return p|0}c[l>>2]=1;p=c[l>>2]|0;i=g;return p|0}function Hj(e){e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0;s=i;i=i+144|0;C=s+16|0;r=s+96|0;j=s+92|0;h=s+88|0;k=s+8|0;z=s+80|0;l=s+76|0;m=s+72|0;o=s+104|0;n=s+68|0;g=s+64|0;t=s+60|0;u=s+56|0;v=s;q=s+52|0;p=s+48|0;f=s+44|0;y=s+40|0;w=s+36|0;x=s+32|0;A=s+28|0;B=s+24|0;c[j>>2]=e;c[z+0>>2]=0;c[z+4>>2]=0;c[l>>2]=1+(d[(c[j>>2]|0)+45>>0]|0);c[m>>2]=8-(c[l>>2]|0);c[h>>2]=vj(c[j>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|0)+68>>2];if(c[(c[j>>2]|0)+72>>2]|0){E=c[(c[j>>2]|0)+100>>2]|0;c[C>>2]=c[(c[j>>2]|0)+68>>2];c[C+4>>2]=E;tc(283,4512,C)}}}while(0);ji(c[j>>2]|0,c[l>>2]|0,c[m>>2]|0);c[r>>2]=c[h>>2];E=c[r>>2]|0;i=s;return E|0}function Ij(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b;e=b+8|0;c[e>>2]=a;e=c[e>>2]|0;a=(vf()|0)+20|0;c[d>>2]=e;c[d+4>>2]=a;tc(14,4472,d);i=b;return 14}function Jj(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;k=i;i=i+48|0;n=k+32|0;q=k+28|0;p=k+24|0;o=k+20|0;h=k+16|0;m=k+12|0;j=k+8|0;l=k+4|0;g=k;c[n>>2]=a;c[q>>2]=b;c[p>>2]=d;c[o>>2]=e;c[h>>2]=f;c[l>>2]=c[q>>2];c[g>>2]=(c[q>>2]|0)+(c[p>>2]|0);if(c[o>>2]|0){c[m>>2]=c[c[o>>2]>>2];c[j>>2]=c[(c[o>>2]|0)+4>>2]}else{c[j>>2]=0;c[m>>2]=0}if(c[n>>2]|0){do{q=c[l>>2]|0;c[l>>2]=q+4;c[m>>2]=(c[m>>2]|0)+((c[q>>2]|0)+(c[j>>2]|0));q=c[l>>2]|0;c[l>>2]=q+4;c[j>>2]=(c[j>>2]|0)+((c[q>>2]|0)+(c[m>>2]|0))}while((c[l>>2]|0)>>>0<(c[g>>2]|0)>>>0);q=c[m>>2]|0;p=c[h>>2]|0;c[p>>2]=q;p=c[j>>2]|0;q=c[h>>2]|0;q=q+4|0;c[q>>2]=p;i=k;return}else{do{c[m>>2]=(c[m>>2]|0)+(((c[c[l>>2]>>2]&255)<<24)+((c[c[l>>2]>>2]&65280)<<8)+((c[c[l>>2]>>2]&16711680)>>>8)+((c[c[l>>2]>>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c[k>>2]=1;b=c[k>>2]|0;i=p;return b|0}c[k>>2]=0;b=c[k>>2]|0;i=p;return b|0}function Lj(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;j=i;i=i+48|0;h=j+44|0;q=j+40|0;t=j+36|0;k=j+32|0;o=j+28|0;s=j+24|0;l=j+20|0;n=j+16|0;f=j+12|0;m=j+8|0;p=j+4|0;r=j;c[q>>2]=a;c[t>>2]=d;c[k>>2]=e;c[s>>2]=0;c[l>>2]=0;c[n>>2]=0;a=c[q>>2]|0;c[o>>2]=Ti(a,Ui(c[t>>2]|0)|0,n,l,s)|0;do if(!(c[o>>2]|0)){c[m>>2]=(c[t>>2]|0)-(c[s>>2]|0);if((c[m>>2]|0)==1){c[r>>2]=(c[n>>2]|0)+16384-((c[l>>2]|0)+4);_E((c[l>>2]|0)+4|0,0,c[r>>2]|0)|0}if(c[(c[l>>2]|0)+(c[m>>2]<<2)>>2]|0)Si(c[q>>2]|0);c[p>>2]=c[m>>2];c[f>>2]=jj(c[k>>2]|0)|0;while(1){if(!(b[(c[n>>2]|0)+(c[f>>2]<<1)>>1]|0)){g=11;break}a=c[p>>2]|0;c[p>>2]=a+ -1;if(!a)break;c[f>>2]=lj(c[f>>2]|0)|0}if((g|0)==11){c[(c[l>>2]|0)+(c[m>>2]<<2)>>2]=c[k>>2];b[(c[n>>2]|0)+(c[f>>2]<<1)>>1]=c[m>>2];break}c[h>>2]=kj(49129)|0;a=c[h>>2]|0;i=j;return a|0}while(0);c[h>>2]=c[o>>2];a=c[h>>2]|0;i=j;return a|0}function Mj(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;f=i;i=i+16|0;d=f+8|0;e=f+4|0;c[d>>2]=b;c[e>>2]=mj(c[d>>2]|0)|0;c[f>>2]=40;a[(c[d>>2]|0)+64>>0]=1;c[(c[d>>2]|0)+52>>2]=3007e3;Jj(1,(c[d>>2]|0)+52|0,40,0,(c[d>>2]|0)+92|0);h=(c[e>>2]|0)+48|0;g=(c[d>>2]|0)+52|0;b=h+48|0;do{a[h>>0]=a[g>>0]|0;h=h+1|0;g=g+1|0}while((h|0)<(b|0));Nj(c[d>>2]|0);h=(c[e>>2]|0)+0|0;g=(c[d>>2]|0)+52|0;b=h+48|0;do{a[h>>0]=a[g>>0]|0;h=h+1|0;g=g+1|0}while((h|0)<(b|0));i=f;return}function Nj(a){a=a|0;var b=0,e=0;b=i;i=i+16|0;e=b;c[e>>2]=a;if((d[(c[e>>2]|0)+43>>0]|0|0)==2){i=b;return}Oj(c[(c[e>>2]|0)+4>>2]|0);i=b;return}function Oj(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;rb[c[(c[c[d>>2]>>2]|0)+60>>2]&31](c[d>>2]|0);i=b;return}function Pj(a){a=a|0;var b=0,d=0,e=0,f=0;e=i;i=i+16|0;d=e+8|0;f=e+4|0;b=e;c[f>>2]=a;if(((c[f>>2]|0)!=0?(c[c[f>>2]>>2]|0)!=0:0)?(c[(c[f>>2]|0)+8>>2]|0)>=0:0){c[b>>2]=zb[c[c[f>>2]>>2]&63](c[(c[f>>2]|0)+4>>2]|0,c[(c[f>>2]|0)+8>>2]|0)|0;a=(c[f>>2]|0)+8|0;if(!(c[b>>2]|0))c[a>>2]=-1;else c[a>>2]=(c[a>>2]|0)+1;c[d>>2]=c[b>>2];f=c[d>>2]|0;i=e;return f|0}c[d>>2]=0;f=c[d>>2]|0;i=e;return f|0}function Qj(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return c[(c[b>>2]|0)+8>>2]|0}function Rj(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=aj(c[d>>2]|0)|0;i=b;return a|0}function Sj(f){f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;j=i;i=i+48|0;h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+((d[s>>0]|0)+7)>>0]|0)+(c[t>>2]|0);while(1){if((e[r>>1]|0)<=0){n=16;break}if((e[r>>1]|0)<(c[g>>2]|0)){n=10;break}if((e[r>>1]|0)>(c[o>>2]|0)){n=10;break}b[u>>1]=d[(c[q>>2]|0)+(e[r>>1]|0)>>0]<<8|d[(c[q>>2]|0)+(e[r>>1]|0)+1>>0];b[n>>1]=d[(c[q>>2]|0)+((e[r>>1]|0)+2)>>0]<<8|d[(c[q>>2]|0)+((e[r>>1]|0)+2)+1>>0];if((e[u>>1]|0)>0?(e[u>>1]|0)<=((e[r>>1]|0)+(e[n>>1]|0)+3|0):0){n=14;break}if(((e[r>>1]|0)+(e[n>>1]|0)|0)>(c[l>>2]|0)){n=14;break}c[m>>2]=(c[m>>2]|0)+(e[n>>1]|0);b[r>>1]=b[u>>1]|0}if((n|0)==10){c[h>>2]=kj(53749)|0;v=c[h>>2]|0;i=j;return v|0}else if((n|0)==14){c[h>>2]=kj(53756)|0;v=c[h>>2]|0;i=j;return v|0}else if((n|0)==16){if((c[m>>2]|0)<=(c[l>>2]|0)){b[(c[k>>2]|0)+16>>1]=(c[m>>2]|0)-(c[g>>2]|0);a[c[k>>2]>>0]=1;break}c[h>>2]=kj(53770)|0;v=c[h>>2]|0;i=j;return v|0}}while(0);c[h>>2]=0;v=c[h>>2]|0;i=j;return v|0}function Tj(e,f){e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0;k=i;i=i+16|0;j=k+12|0;h=k+8|0;l=k+4|0;g=k;c[h>>2]=e;c[l>>2]=f;a[(c[h>>2]|0)+5>>0]=c[l>>2]>>3;c[l>>2]=c[l>>2]&-9;a[(c[h>>2]|0)+7>>0]=4-(d[(c[h>>2]|0)+5>>0]<<2);c[g>>2]=c[(c[h>>2]|0)+52>>2];do if((c[l>>2]|0)==5){a[(c[h>>2]|0)+2>>0]=1;a[(c[h>>2]|0)+3>>0]=a[(c[h>>2]|0)+5>>0]|0;a[(c[h>>2]|0)+4>>0]=((a[(c[h>>2]|0)+5>>0]|0)!=0^1)&1;b[(c[h>>2]|0)+10>>1]=b[(c[g>>2]|0)+28>>1]|0;b[(c[h>>2]|0)+12>>1]=b[(c[g>>2]|0)+30>>1]|0}else{if((c[l>>2]|0)==2){a[(c[h>>2]|0)+2>>0]=0;a[(c[h>>2]|0)+3>>0]=0;a[(c[h>>2]|0)+4>>0]=0;b[(c[h>>2]|0)+10>>1]=b[(c[g>>2]|0)+24>>1]|0;b[(c[h>>2]|0)+12>>1]=b[(c[g>>2]|0)+26>>1]|0;break}c[j>>2]=kj(53655)|0;e=c[j>>2]|0;i=k;return e|0}while(0);a[(c[h>>2]|0)+8>>0]=a[(c[g>>2]|0)+21>>0]|0;c[j>>2]=0;e=c[j>>2]|0;i=k;return e|0}function Uj(){return 48}function Vj(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0;j=i;i=i+32|0;o=j+20|0;k=j+16|0;l=j+12|0;m=j+8|0;n=j+4|0;p=j;c[o>>2]=b;c[k>>2]=d;c[l>>2]=e;c[m>>2]=f;c[n>>2]=g;c[p>>2]=h;g=(c[p>>2]|0)+0|0;h=g+48|0;do{c[g>>2]=0;g=g+4|0}while((g|0)<(h|0));c[(c[p>>2]|0)+20>>2]=1;c[(c[p>>2]|0)+24>>2]=c[k>>2];a[(c[p>>2]|0)+28>>0]=c[l>>2];a[(c[p>>2]|0)+29>>0]=2;c[(c[p>>2]|0)+32>>2]=c[m>>2];c[(c[p>>2]|0)+36>>2]=c[n>>2];c[(c[p>>2]|0)+16>>2]=100;b=Jg(c[p>>2]|0,c[o>>2]|0)|0;i=j;return b|0}function Wj(a,b){a=a|0;b=b|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+32|0;g=f+16|0;l=f+12|0;h=f+8|0;j=f+4|0;k=f;c[l>>2]=a;c[h>>2]=b;c[j>>2]=c[l>>2];c[k>>2]=0;if(c[(c[j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=5;break}c[f>>2]=(c[f>>2]|0)+1}if((a|0)==5){c[b>>2]=1;j=c[b>>2]|0;i=d;return j|0}else if((a|0)==7){c[b>>2]=0;j=c[b>>2]|0;i=d;return j|0}return 0}function Yj(a){a=a|0;var b=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;e=i;i=i+32|0;j=e+24|0;b=e+20|0;f=e+16|0;k=e+12|0;h=e;g=e+8|0;c[j>>2]=a;c[b>>2]=0;c[f>>2]=c[(c[j>>2]|0)+16>>2];if(((d[(c[f>>2]|0)+5>>0]|0|0)!=2?(c[b>>2]=ok(c[f>>2]|0)|0,(c[b>>2]|0)==0):0)?(c[k>>2]=c[(c[j>>2]|0)+4>>2],l=4+(c[(c[f>>2]|0)+152>>2]|0)|0,l=lF(c[(c[f>>2]|0)+52>>2]|0,0,l|0,((l|0)<0)<<31>>31|0)|0,a=h,c[a>>2]=l,c[a+4>>2]=D,c[g>>2]=c[k>>2],k=h,c[b>>2]=pk(c[(c[f>>2]|0)+68>>2]|0,c[k>>2]|0,c[k+4>>2]|0,c[(c[j>>2]|0)+20>>2]|0)|0,(c[b>>2]|0)==0):0){a=c[(c[f>>2]|0)+68>>2]|0;g=c[g>>2]|0;k=c[(c[f>>2]|0)+152>>2]|0;l=h;l=bF(c[l>>2]|0,c[l+4>>2]|0,4,0)|0;c[b>>2]=id(a,g,k,l,D)|0}if(c[b>>2]|0){l=c[b>>2]|0;i=e;return l|0}l=(c[f>>2]|0)+52|0;c[l>>2]=(c[l>>2]|0)+1;c[b>>2]=qk(c[f>>2]|0,c[(c[j>>2]|0)+20>>2]|0)|0;l=c[b>>2]|0;i=e;return l|0}function Zj(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;h=i;i=i+48|0;l=h+32|0;j=h+28|0;m=h+24|0;g=h+20|0;n=h+16|0;o=h+12|0;p=h+8|0;q=h+4|0;k=h;c[l>>2]=a;c[j>>2]=b;c[m>>2]=e;c[g>>2]=f;a:do if(c[g>>2]|0){c[q>>2]=j;c[o>>2]=0;c[p>>2]=c[j>>2];while(1){a=c[p>>2]|0;c[c[q>>2]>>2]=a;if(!a)break a;if((c[(c[p>>2]|0)+20>>2]|0)>>>0<=(c[m>>2]|0)>>>0){c[q>>2]=(c[p>>2]|0)+12;c[o>>2]=(c[o>>2]|0)+1}c[p>>2]=c[(c[p>>2]|0)+12>>2]}}else c[o>>2]=1;while(0);a=(c[l>>2]|0)+192|0;c[a>>2]=(c[a>>2]|0)+(c[o>>2]|0);if((c[(c[j>>2]|0)+20>>2]|0)==1)bk(c[j>>2]|0);c[n>>2]=ik(c[(c[l>>2]|0)+208>>2]|0,c[(c[l>>2]|0)+152>>2]|0,c[j>>2]|0,c[m>>2]|0,c[g>>2]|0,d[(c[l>>2]|0)+10>>0]|0)|0;if(c[n>>2]|0){a=c[n>>2]|0;i=h;return a|0}if(!(c[(c[l>>2]|0)+88>>2]|0)){a=c[n>>2]|0;i=h;return a|0}c[k>>2]=c[j>>2];while(1){if(!(c[k>>2]|0))break;Ii(c[(c[l>>2]|0)+88>>2]|0,c[(c[k>>2]|0)+20>>2]|0,c[(c[k>>2]|0)+4>>2]|0);c[k>>2]=c[(c[k>>2]|0)+12>>2]}a=c[n>>2]|0;i=h;return a|0}function _j(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;k=i;i=i+48|0;g=k+24|0;j=k+20|0;o=k+16|0;h=k+12|0;l=k+8|0;m=k;n=k+40|0;f=k+28|0;c[j>>2]=b;c[o>>2]=e;c[h>>2]=dk(c[j>>2]|0)|0;if(c[h>>2]|0){c[g>>2]=c[h>>2];b=c[g>>2]|0;i=k;return b|0}do if(!(a[(c[j>>2]|0)+7>>0]|0)){if((c[c[(c[j>>2]|0)+64>>2]>>2]|0)!=0?(d[(c[j>>2]|0)+5>>0]|0)!=4:0){c[l>>2]=Ai(c[(c[j>>2]|0)+60>>2]|0)|0;if(!(c[l>>2]&512)){a[f+0>>0]=a[4384]|0;a[f+1>>0]=a[4385]|0;a[f+2>>0]=a[4386]|0;a[f+3>>0]=a[4387]|0;a[f+4>>0]=a[4388]|0;a[f+5>>0]=a[4389]|0;a[f+6>>0]=a[4390]|0;a[f+7>>0]=a[4391]|0;ck(f+8|0,c[(c[j>>2]|0)+44>>2]|0);e=Oi(c[j>>2]|0)|0;b=m;c[b>>2]=e;c[b+4>>2]=D;b=m;c[h>>2]=Ei(c[(c[j>>2]|0)+64>>2]|0,n,8,c[b>>2]|0,c[b+4>>2]|0)|0;if((c[h>>2]|0)==0?0==(TE(n,4384,8)|0):0){b=m;c[h>>2]=id(c[(c[j>>2]|0)+64>>2]|0,4600,1,c[b>>2]|0,c[b+4>>2]|0)|0}if((c[h>>2]|0)!=0&(c[h>>2]|0)!=522){c[g>>2]=c[h>>2];b=c[g>>2]|0;i=k;return b|0}if(((d[(c[j>>2]|0)+8>>0]|0)!=0?0==(c[l>>2]&1024|0):0)?(c[h>>2]=Yh(c[(c[j>>2]|0)+64>>2]|0,d[(c[j>>2]|0)+11>>0]|0)|0,(c[h>>2]|0)!=0):0){c[g>>2]=c[h>>2];b=c[g>>2]|0;i=k;return b|0}b=(c[j>>2]|0)+80|0;c[h>>2]=id(c[(c[j>>2]|0)+64>>2]|0,f,12,c[b>>2]|0,c[b+4>>2]|0)|0;if(c[h>>2]|0){c[g>>2]=c[h>>2];b=c[g>>2]|0;i=k;return b|0}}if(0==(c[l>>2]&1024|0)?(c[h>>2]=Yh(c[(c[j>>2]|0)+64>>2]|0,d[(c[j>>2]|0)+11>>0]|((d[(c[j>>2]|0)+11>>0]|0)==3?16:0))|0,(c[h>>2]|0)!=0):0){c[g>>2]=c[h>>2];b=c[g>>2]|0;i=k;return b|0}m=(c[j>>2]|0)+72|0;n=c[m+4>>2]|0;b=(c[j>>2]|0)+80|0;c[b>>2]=c[m>>2];c[b+4>>2]=n;if(!(c[o>>2]|0))break;if(c[l>>2]&512)break;c[(c[j>>2]|0)+44>>2]=0;c[h>>2]=ek(c[j>>2]|0)|0;if(!(c[h>>2]|0))break;c[g>>2]=c[h>>2];b=c[g>>2]|0;i=k;return b|0}n=(c[j>>2]|0)+72|0;o=c[n+4>>2]|0;b=(c[j>>2]|0)+80|0;c[b>>2]=c[n>>2];c[b+4>>2]=o}while(0);fk(c[(c[j>>2]|0)+204>>2]|0);a[(c[j>>2]|0)+16>>0]=4;c[g>>2]=0;b=c[g>>2]|0;i=k;return b|0}function $j(b,d){b=b|0;d=d|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;l=i;i=i+48|0;h=l+32|0;f=l+28|0;g=l+24|0;n=l+8|0;j=l+20|0;k=l;m=l+16|0;c[h>>2]=b;c[f>>2]=d;c[g>>2]=0;if(!(c[c[(c[h>>2]|0)+60>>2]>>2]|0))c[g>>2]=ak(c[h>>2]|0,c[(c[h>>2]|0)+60>>2]|0,c[(c[h>>2]|0)+144>>2]|0)|0;do if((c[g>>2]|0)==0?(c[(c[h>>2]|0)+36>>2]|0)>>>0<(c[(c[h>>2]|0)+24>>2]|0)>>>0:0){if((c[(c[f>>2]|0)+12>>2]|0)==0?(c[(c[f>>2]|0)+20>>2]|0)>>>0<=(c[(c[h>>2]|0)+36>>2]|0)>>>0:0)break;d=c[(c[h>>2]|0)+152>>2]|0;d=lF(d|0,((d|0)<0)<<31>>31|0,c[(c[h>>2]|0)+24>>2]|0,0)|0;b=n;c[b>>2]=d;c[b+4>>2]=D;rj(c[(c[h>>2]|0)+60>>2]|0,5,n);c[(c[h>>2]|0)+36>>2]=c[(c[h>>2]|0)+24>>2]}while(0);while(1){if(!((c[g>>2]|0)==0&(c[f>>2]|0)!=0))break;c[j>>2]=c[(c[f>>2]|0)+20>>2];if((c[j>>2]|0)>>>0<=(c[(c[h>>2]|0)+24>>2]|0)>>>0?0==((e[(c[f>>2]|0)+24>>1]|0)&32|0):0){d=c[(c[h>>2]|0)+152>>2]|0;d=lF((c[j>>2]|0)-1|0,0,d|0,((d|0)<0)<<31>>31|0)|0;b=k;c[b>>2]=d;c[b+4>>2]=D;if((c[(c[f>>2]|0)+20>>2]|0)==1)bk(c[f>>2]|0);c[m>>2]=c[(c[f>>2]|0)+4>>2];b=k;c[g>>2]=id(c[(c[h>>2]|0)+60>>2]|0,c[m>>2]|0,c[(c[h>>2]|0)+152>>2]|0,c[b>>2]|0,c[b+4>>2]|0)|0;if((c[j>>2]|0)==1){b=(c[h>>2]|0)+100|0;d=(c[m>>2]|0)+24|0;n=b+16|0;do{a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0}while((b|0)<(n|0))}if((c[j>>2]|0)>>>0>(c[(c[h>>2]|0)+32>>2]|0)>>>0)c[(c[h>>2]|0)+32>>2]=c[j>>2];b=(c[h>>2]|0)+192|0;c[b>>2]=(c[b>>2]|0)+1;Ii(c[(c[h>>2]|0)+88>>2]|0,c[j>>2]|0,c[(c[f>>2]|0)+4>>2]|0)}c[f>>2]=c[(c[f>>2]|0)+12>>2]}i=l;return c[g>>2]|0}function ak(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;f=i;i=i+16|0;j=f+12|0;h=f+8|0;g=f+4|0;e=f;c[j>>2]=a;c[h>>2]=b;c[g>>2]=d;c[g>>2]=c[g>>2]|30;c[e>>2]=Di(c[c[j>>2]>>2]|0,0,c[h>>2]|0,c[g>>2]|0,0)|0;i=f;return c[e>>2]|0}function bk(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=(Hh((c[(c[d>>2]|0)+16>>2]|0)+100|0)|0)+1;ck((c[(c[d>>2]|0)+4>>2]|0)+24|0,c[e>>2]|0);ck((c[(c[d>>2]|0)+4>>2]|0)+92|0,c[e>>2]|0);ck((c[(c[d>>2]|0)+4>>2]|0)+96|0,3008007);i=b;return}function ck(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+16|0;f=e+4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0,c[q>>2]|0,c[r>>2]|0,c[h>>2]|0);c[o>>2]=0;while(1){if((c[o>>2]|0)>=(c[p>>2]|0)){n=10;break}if((e[(c[(c[h>>2]|0)+8>>2]|0)+((c[o>>2]|0)*40|0)+8>>1]|0)&1){n=8;break}c[o>>2]=(c[o>>2]|0)+1}if((n|0)==8){c[c[j>>2]>>2]=-1;c[k>>2]=0;t=c[k>>2]|0;i=l;return t|0}else if((n|0)==10){t=Uw(c[(c[m>>2]|0)+12>>2]|0,c[(c[m>>2]|0)+16>>2]|0,c[h>>2]|0)|0;c[c[j>>2]>>2]=t;c[k>>2]=0;t=c[k>>2]|0;i=l;return t|0}return 0}function Gz(a,d){a=a|0;d=d|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+32|0;g=f+20|0;m=f+16|0;k=f+12|0;l=f+8|0;j=f+4|0;h=f;c[m>>2]=a;c[k>>2]=d;c[l>>2]=c[(c[m>>2]|0)+56>>2];c[j>>2]=lC(c[l>>2]|0,h)|0;if(Lp(c[k>>2]|0,c[h>>2]|0)|0){c[g>>2]=7;m=c[g>>2]|0;i=f;return m|0}else{c[(c[k>>2]|0)+12>>2]=c[h>>2];b[(c[k>>2]|0)+8>>1]=(e[(c[k>>2]|0)+8>>1]|0)&-16896|16;dF(c[(c[k>>2]|0)+16>>2]|0,c[j>>2]|0,c[h>>2]|0)|0;c[g>>2]=0;m=c[g>>2]|0;i=f;return m|0}return 0}function Hz(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;f=d+8|0;e=d+4|0;g=d;c[f>>2]=a;c[e>>2]=b;c[g>>2]=c[c[f>>2]>>2];Xb(c[g>>2]|0,c[(c[f>>2]|0)+44>>2]|0);a=ne(c[g>>2]|0,c[(c[e>>2]|0)+8>>2]|0)|0;c[(c[f>>2]|0)+44>>2]=a;hc(c[(c[e>>2]|0)+8>>2]|0);c[(c[e>>2]|0)+8>>2]=0;i=d;return}function Iz(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b+4|0;e=b;c[e>>2]=a;if(iC(c[c[e>>2]>>2]|0)|0){c[d>>2]=jC(c[e>>2]|0)|0;e=c[d>>2]|0;i=b;return e|0}else{c[d>>2]=0;e=c[d>>2]|0;i=b;return e|0}return 0}function Jz(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0;g=i;i=i+32|0;f=g+16|0;k=g+12|0;j=g+8|0;h=g+4|0;e=g;c[k>>2]=a;c[j>>2]=b;c[h>>2]=c[(c[k>>2]|0)+56>>2];c[e>>2]=0;b=c[h>>2]|0;if(d[(c[h>>2]|0)+56>>0]|0){c[e>>2]=EB(b)|0;c[e>>2]=c[e>>2];if(!(c[e>>2]|0)){c[e>>2]=ZB(c[h>>2]|0)|0;c[c[j>>2]>>2]=0}c[f>>2]=c[e>>2];k=c[f>>2]|0;i=g;return k|0}j=c[j>>2]|0;if(c[b+36>>2]|0){c[j>>2]=0;c[e>>2]=HB((c[h>>2]|0)+64|0,(c[h>>2]|0)+36|0)|0}else c[j>>2]=1;c[f>>2]=c[e>>2];k=c[f>>2]|0;i=g;return k|0}function Kz(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0;f=i;i=i+16|0;g=f+8|0;h=f+4|0;e=f;c[g>>2]=a;c[h>>2]=b;c[e>>2]=Iw(c[g>>2]|0)|0;do if(!(c[e>>2]|0)){b=c[h>>2]|0;if(!(d[(c[g>>2]|0)+73>>0]|0)){c[b>>2]=1;break}else{c[b>>2]=0;c[e>>2]=bx(c[g>>2]|0)|0;break}}while(0);i=f;return c[e>>2]|0}function Lz(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+32|0;k=f+20|0;m=f+16|0;h=f+12|0;j=f+8|0;g=f+4|0;l=f;c[k>>2]=b;c[m>>2]=d;c[h>>2]=e;c[j>>2]=c[(c[m>>2]|0)+56>>2];e=c[j>>2]|0;if(a[(c[j>>2]|0)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);if((c[o>>2]|0)>(c[(c[k>>2]|0)+8>>2]|0))c[(c[k>>2]|0)+8>>2]=c[o>>2];do if(c[(c[k>>2]|0)+40>>2]|0){c[g>>2]=(c[(c[k>>2]|0)+48>>2]|0)+(c[n>>2]|0);do if((c[g>>2]|0)>(c[(c[k>>2]|0)+52>>2]|0)){c[m>>2]=c[(c[k>>2]|0)+52>>2]<<1;while(1){o=c[m>>2]|0;if((c[m>>2]|0)>=(c[g>>2]|0))break;c[m>>2]=o<<1}if((o|0)>(c[(c[k>>2]|0)+4>>2]|0))c[m>>2]=c[(c[k>>2]|0)+4>>2];if((c[m>>2]|0)<(c[g>>2]|0))c[m>>2]=c[g>>2];q=c[m>>2]|0;c[f>>2]=kc(c[(c[k>>2]|0)+40>>2]|0,q,((q|0)<0)<<31>>31)|0;if(c[f>>2]|0){c[(c[k>>2]|0)+36>>2]=(c[f>>2]|0)+((c[(c[k>>2]|0)+36>>2]|0)-(c[(c[k>>2]|0)+40>>2]|0));c[(c[k>>2]|0)+40>>2]=c[f>>2];c[(c[k>>2]|0)+52>>2]=c[m>>2];break}c[l>>2]=7;q=c[l>>2]|0;i=e;return q|0}while(0);c[h>>2]=(c[(c[k>>2]|0)+40>>2]|0)+(c[(c[k>>2]|0)+48>>2]|0);q=(c[k>>2]|0)+48|0;c[q>>2]=(c[q>>2]|0)+((c[n>>2]|0)+7&-8);c[(c[h>>2]|0)+4>>2]=(c[(c[k>>2]|0)+36>>2]|0)-(c[(c[k>>2]|0)+40>>2]|0)}else{q=c[n>>2]|0;c[h>>2]=gc(q,((q|0)<0)<<31>>31)|0;if(c[h>>2]|0){c[(c[h>>2]|0)+4>>2]=c[(c[k>>2]|0)+36>>2];break}c[l>>2]=7;q=c[l>>2]|0;i=e;return q|0}while(0);dF((c[h>>2]|0)+8|0,c[(c[j>>2]|0)+16>>2]|0,c[(c[j>>2]|0)+12>>2]|0)|0;c[c[h>>2]>>2]=c[(c[j>>2]|0)+12>>2];c[(c[k>>2]|0)+36>>2]=c[h>>2];c[l>>2]=c[d>>2];q=c[l>>2]|0;i=e;return q|0}function Nz(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;l=i;i=i+128|0;g=l+116|0;r=l+112|0;q=l+108|0;m=l+104|0;p=l+80|0;o=l+100|0;n=l+96|0;k=l+92|0;j=l+88|0;h=l+40|0;f=l;c[r>>2]=a;c[q>>2]=b;c[m>>2]=e;a=p;c[a>>2]=0;c[a+4>>2]=0;Ly(c[q>>2]|0,p)|0;en(h,c[r>>2]|0,0);c[o>>2]=mz(c[q>>2]|0,0,c[p>>2]|0,1,h)|0;if(c[o>>2]|0){c[g>>2]=c[o>>2];r=c[g>>2]|0;i=l;return r|0}e=c[h+16>>2]|0;if((d[c[h+16>>2]>>0]|0|0)<128)c[n>>2]=d[e>>0];else Rw(e,n)|0;if((c[n>>2]|0)>>>0>=3?(c[n>>2]|0)<=(c[h+12>>2]|0):0){e=(c[h+16>>2]|0)+((c[n>>2]|0)-1)|0;if((d[(c[h+16>>2]|0)+((c[n>>2]|0)-1)>>0]|0|0)<128)c[k>>2]=d[e>>0];else Rw(e,k)|0;if(!((c[k>>2]|0)>>>0<1|(c[k>>2]|0)>>>0>9|(c[k>>2]|0)==7)?(c[j>>2]=Ww(c[k>>2]|0)|0,(c[h+12>>2]|0)>>>0>=((c[n>>2]|0)+(c[j>>2]|0)|0)>>>0):0){Xw((c[h+16>>2]|0)+((c[h+12>>2]|0)-(c[j>>2]|0))|0,c[k>>2]|0,f)|0;p=f;q=c[p+4>>2]|0;r=c[m>>2]|0;c[r>>2]=c[p>>2];c[r+4>>2]=q;Bd(h);c[g>>2]=0;r=c[g>>2]|0;i=l;return r|0}}Bd(h);c[g>>2]=kj(67174)|0;r=c[g>>2]|0;i=l;return r|0}function Oz(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,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12>>2]|0)+8;c[j>>2]=c[(c[m>>2]|0)+8>>2];while(1){if(!(c[j>>2]|0))break;c[n>>2]=c[(c[j>>2]|0)+8>>2];if((c[(c[n>>2]|0)+32>>2]|0)==(c[k>>2]|0))c[(c[n>>2]|0)+32>>2]=c[g>>2];c[j>>2]=c[c[j>>2]>>2]}c[m>>2]=(c[(c[f>>2]|0)+12>>2]|0)+24;c[j>>2]=c[(c[m>>2]|0)+8>>2];while(1){if(!(c[j>>2]|0))break;c[h>>2]=c[(c[j>>2]|0)+8>>2];if((c[(c[h>>2]|0)+44>>2]|0)==(c[k>>2]|0))c[(c[h>>2]|0)+44>>2]=c[g>>2];c[j>>2]=c[c[j>>2]>>2]}i=l;return}function Rz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+32|0;g=e+16|0;j=e+12|0;k=e+8|0;f=e+4|0;h=e;c[g>>2]=a;c[j>>2]=b;c[k>>2]=d;c[h>>2]=c[(c[g>>2]|0)+4>>2];Pc(c[g>>2]|0);c[f>>2]=Hy(c[h>>2]|0,c[j>>2]|0,0)|0;if(c[f>>2]|0){a=c[f>>2]|0;i=e;return a|0}sB(c[g>>2]|0,0,0,1);c[f>>2]=tB(c[h>>2]|0,c[j>>2]|0,0,c[k>>2]|0)|0;a=c[f>>2]|0;i=e;return a|0}function Sz(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;h=i;i=i+16|0;g=h+12|0;f=h+8|0;j=h+4|0;k=h;c[g>>2]=b;c[f>>2]=e;mB(c[(c[f>>2]|0)+20>>2]|0);c[(c[f>>2]|0)+20>>2]=0;c[j>>2]=0;while(1){if((c[j>>2]|0)>=(d[(c[f>>2]|0)+59>>0]|0|0))break;c[k>>2]=(c[f>>2]|0)+64+(c[j>>2]<<6);nB(c[g>>2]|0,c[k>>2]|0);c[j>>2]=(c[j>>2]|0)+1}if(!(c[(c[f>>2]|0)+40>>2]|0))oB(0,c[(c[f>>2]|0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)!=(c[h>>2]|0);else b=0;d=c[g>>2]|0;if(!b)break;c[g>>2]=c[d+20>>2]}if((d|0)!=0?(c[(c[g>>2]|0)+20>>2]|0)==(c[h>>2]|0):0)c[(c[g>>2]|0)+20>>2]=c[(c[h>>2]|0)+20>>2]}else c[(c[(c[h>>2]|0)+12>>2]|0)+8>>2]=c[d+20>>2];ly(c[f>>2]|0,c[h>>2]|0);l=c[f>>2]|0;l=l+24|0;k=c[l>>2]|0;k=k|2;c[l>>2]=k;i=e;return}function Wz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;e=i;i=i+32|0;h=e+24|0;m=e+20|0;k=e+16|0;f=e+12|0;l=e+8|0;j=e+4|0;g=e;c[h>>2]=a;c[m>>2]=b;c[k>>2]=d;c[l>>2]=(c[(c[(c[h>>2]|0)+16>>2]|0)+(c[m>>2]<<4)+12>>2]|0)+40;c[f>>2]=gh(c[l>>2]|0,c[k>>2]|0,0)|0;if(!(c[f>>2]|0)){i=e;return}if((c[(c[f>>2]|0)+20>>2]|0)==(c[(c[f>>2]|0)+24>>2]|0)){c[j>>2]=Ct(c[f>>2]|0)|0;c[g>>2]=(c[j>>2]|0)+64;while(1){d=(c[c[g>>2]>>2]|0)+32|0;if((c[c[g>>2]>>2]|0)==(c[f>>2]|0))break;c[g>>2]=d}c[c[g>>2]>>2]=c[d>>2]}Ub(c[h>>2]|0,c[f>>2]|0);m=(c[h>>2]|0)+24|0;c[m>>2]=c[m>>2]|2;i=e;return}function Xz(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;p=i;i=i+224|0;q=p;k=p+108|0;u=p+104|0;r=p+100|0;s=p+96|0;t=p+92|0;l=p+88|0;j=p+84|0;m=p+80|0;o=p+12|0;n=p+8|0;c[u>>2]=b;c[r>>2]=e;c[s>>2]=f;c[t>>2]=g;c[l>>2]=h;c[n>>2]=c[(c[u>>2]|0)+4>>2];Pc(c[u>>2]|0);c[m>>2]=dB(c[c[n>>2]>>2]|0)|0;c[o>>2]=c[n>>2];c[o+4>>2]=c[c[n>>2]>>2];c[o+12>>2]=Aw(c[o>>2]|0)|0;c[o+16>>2]=c[t>>2];c[o+20>>2]=0;c[o+24>>2]=0;c[o+28>>2]=0;c[o+32>>2]=0;c[o+36>>2]=0;c[c[l>>2]>>2]=0;if(!(c[o+12>>2]|0)){c[k>>2]=0;u=c[k>>2]|0;i=p;return u|0}c[o+8>>2]=Mc((((c[o+12>>2]|0)>>>0)/8|0)+1|0,0)|0;if(!(c[o+8>>2]|0)){c[c[l>>2]>>2]=1;c[k>>2]=0;u=c[k>>2]|0;i=p;return u|0}c[j>>2]=(((c[282]|0)>>>0)/((c[(c[n>>2]|0)+32>>2]|0)>>>0)|0)+1;if((c[j>>2]|0)>>>0<=(c[o+12>>2]|0)>>>0)eB(o,c[j>>2]|0);nc(o+40|0,p+112|0,100,1e9);a[o+64>>0]=2;c[o+28>>2]=33320;u=Hh((c[(c[(c[n>>2]|0)+12>>2]|0)+56>>2]|0)+32|0)|0;fB(o,1,u,Hh((c[(c[(c[n>>2]|0)+12>>2]|0)+56>>2]|0)+36|0)|0);c[o+28>>2]=0;c[j>>2]=0;while(1){if((c[j>>2]|0)>=(c[s>>2]|0))break;if(!(c[o+16>>2]|0))break;if(c[(c[r>>2]|0)+(c[j>>2]<<2)>>2]|0){if((d[(c[n>>2]|0)+17>>0]|0)!=0?(c[(c[r>>2]|0)+(c[j>>2]<<2)>>2]|0)>1:0)gB(o,c[(c[r>>2]|0)+(c[j>>2]<<2)>>2]|0,1,0);c[o+28>>2]=33336;hB(o,c[(c[r>>2]|0)+(c[j>>2]<<2)>>2]|0,0,0)|0;c[o+28>>2]=0}c[j>>2]=(c[j>>2]|0)+1}c[j>>2]=1;while(1){if((c[j>>2]|0)>>>0>(c[o+12>>2]|0)>>>0)break;if(!(c[o+16>>2]|0))break;do if(!(iB(o,c[j>>2]|0)|0)){u=Pw(c[n>>2]|0,c[j>>2]|0)|0;if((u|0)==(c[j>>2]|0)?(a[(c[n>>2]|0)+17>>0]|0)!=0:0)break;c[q>>2]=c[j>>2];jB(o,33360,q)}while(0);if(((iB(o,c[j>>2]|0)|0)!=0?(u=Pw(c[n>>2]|0,c[j>>2]|0)|0,(u|0)==(c[j>>2]|0)):0)?(d[(c[n>>2]|0)+17>>0]|0)!=0:0){c[q>>2]=c[j>>2];jB(o,33384,q)}c[j>>2]=(c[j>>2]|0)+1}u=c[m>>2]|0;if((u|0)!=(dB(c[c[n>>2]>>2]|0)|0)){t=c[m>>2]|0;u=dB(c[c[n>>2]>>2]|0)|0;c[q>>2]=t;c[q+4>>2]=u;jB(o,33424,q)}hc(c[o+8>>2]|0);if(c[o+24>>2]|0){Zm(o+40|0);c[c[l>>2]>>2]=(c[o+20>>2]|0)+1;c[k>>2]=0;u=c[k>>2]|0;i=p;return u|0}c[c[l>>2]>>2]=c[o+20>>2];if(!(c[o+20>>2]|0))Zm(o+40|0);c[k>>2]=pc(o+40|0)|0;u=c[k>>2]|0;i=p;return u|0}function Yz(d){d=d|0;var e=0,f=0,g=0;e=i;i=i+16|0;f=e+4|0;g=e;c[f>>2]=d;c[g>>2]=c[(c[f>>2]|0)+32>>2];Bd(c[f>>2]|0);d=Qe(c[g>>2]|0,64,0)|0;c[(c[f>>2]|0)+20>>2]=d;if(a[(c[g>>2]|0)+64>>0]|0){b[(c[f>>2]|0)+8>>1]=1;c[(c[f>>2]|0)+24>>2]=0;i=e;return}else{d=Bk(c[g>>2]|0,c[(c[f>>2]|0)+20>>2]|0)|0;c[(c[f>>2]|0)+24>>2]=d;g=cB(c[g>>2]|0,c[(c[f>>2]|0)+20>>2]|0,c[(c[f>>2]|0)+24>>2]|0)|0;c[c[f>>2]>>2]=g;b[(c[f>>2]|0)+8>>1]=32;i=e;return}}function Zz(a,d,f){a=a|0;d=d|0;f=f|0;var g=0,h=0,j=0,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2];continue}d=n;g=c[d+4>>2]|0;a=j;f=c[a+4>>2]|0;if(!((g|0)>(f|0)|((g|0)==(f|0)?(c[d>>2]|0)>>>0>(c[a>>2]|0)>>>0:0))){q=23;break a}c[h>>2]=c[(c[h>>2]|0)+12>>2]}c[m>>2]=c[(c[m>>2]|0)+8>>2]}if((q|0)==23){c[k>>2]=1;a=c[k>>2]|0;i=l;return a|0}else if((q|0)==25){c[k>>2]=0;a=c[k>>2]|0;i=l;return a|0}return 0}function aA(a){a=a|0;var b=0,e=0,f=0;b=i;i=i+16|0;e=b+4|0;f=b;c[f>>2]=a;if((d[(c[f>>2]|0)+16>>0]|0|0)>=3){c[e>>2]=0;f=c[e>>2]|0;i=b;return f|0}if((c[c[(c[f>>2]|0)+64>>2]>>2]|0)!=0?(f=(c[f>>2]|0)+72|0,a=c[f+4>>2]|0,(a|0)>0|(a|0)==0&(c[f>>2]|0)>>>0>0):0){c[e>>2]=0;f=c[e>>2]|0;i=b;return f|0}c[e>>2]=1;f=c[e>>2]|0;i=b;return f|0}function bA(a){a=a|0;var b=0,e=0,f=0;b=i;i=i+16|0;f=b+4|0;e=b;c[f>>2]=a;c[e>>2]=c[c[(c[f>>2]|0)+60>>2]>>2];if(d[(c[f>>2]|0)+4>>0]|0){f=1;f=f&1;i=b;return f|0}if((c[c[e>>2]>>2]|0)<2){f=0;f=f&1;i=b;return f|0}f=(c[(c[e>>2]|0)+52>>2]|0)!=0;f=f&1;i=b;return f|0}function cA(a){a=a|0;var b=0,e=0,f=0,g=0;e=i;i=i+16|0;f=e+8|0;b=e+4|0;g=e;c[f>>2]=a;c[b>>2]=0;if(!(c[(c[f>>2]|0)+208>>2]|0)){c[g>>2]=0;c[b>>2]=hk(c[f>>2]|0,1)|0;if(!(c[b>>2]|0))c[b>>2]=vi(c[c[f>>2]>>2]|0,c[(c[f>>2]|0)+212>>2]|0,0,g)|0;if((c[b>>2]|0)==0&(c[g>>2]|0)!=0)c[b>>2]=SA(c[f>>2]|0)|0}if(c[b>>2]|0){g=c[b>>2]|0;i=e;return g|0}if(!(c[(c[f>>2]|0)+208>>2]|0)){g=c[b>>2]|0;i=e;return g|0}c[b>>2]=TA(c[f>>2]|0)|0;if(c[b>>2]|0){g=c[b>>2]|0;i=e;return g|0}c[b>>2]=Mh(c[(c[f>>2]|0)+208>>2]|0,d[(c[f>>2]|0)+9>>0]|0,c[(c[f>>2]|0)+152>>2]|0,c[(c[f>>2]|0)+200>>2]|0)|0;c[(c[f>>2]|0)+208>>2]=0;Lg(c[f>>2]|0);g=c[b>>2]|0;i=e;return g|0}function dA(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+32|0;g=f+12|0;k=f+8|0;l=f+16|0;h=f+4|0;j=f;c[g>>2]=b;c[k>>2]=e;a[l>>0]=a[(c[g>>2]|0)+5>>0]|0;if((a[(c[g>>2]|0)+15>>0]|0)!=0?(c[k>>2]|0)!=4&(c[k>>2]|0)!=2:0)c[k>>2]=d[l>>0];do if((((c[k>>2]|0)!=(d[l>>0]|0)?(a[(c[g>>2]|0)+5>>0]=c[k>>2],(a[(c[g>>2]|0)+4>>0]|0)==0):0)?(d[l>>0]&5|0)==1:0)?(c[k>>2]&1|0)==0:0){Rh(c[(c[g>>2]|0)+64>>2]|0)|0;if((d[(c[g>>2]|0)+17>>0]|0)>=2){_h(c[c[g>>2]>>2]|0,c[(c[g>>2]|0)+172>>2]|0,0)|0;break}c[h>>2]=0;c[j>>2]=d[(c[g>>2]|0)+16>>0];if(!(c[j>>2]|0))c[h>>2]=KA(c[g>>2]|0)|0;if((d[(c[g>>2]|0)+16>>0]|0)==1)c[h>>2]=hk(c[g>>2]|0,2)|0;if(!(c[h>>2]|0))_h(c[c[g>>2]>>2]|0,c[(c[g>>2]|0)+172>>2]|0,0)|0;if((c[h>>2]|0)==0&(c[j>>2]|0)==1){ei(c[g>>2]|0,1)|0;break}if(!(c[j>>2]|0))Nh(c[g>>2]|0)}while(0);i=f;return d[(c[g>>2]|0)+5>>0]|0}function eA(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;q=i;i=i+80|0;v=q;n=q+68|0;u=q+64|0;h=q+60|0;g=q+56|0;o=q+52|0;r=q+48|0;x=q+44|0;k=q+40|0;l=q+36|0;m=q+32|0;f=q+28|0;p=q+24|0;w=q+20|0;t=q+16|0;y=q+12|0;j=q+8|0;s=q+4|0;c[u>>2]=b;c[h>>2]=e;c[g>>2]=0;c[x>>2]=0;c[p>>2]=0;if(!(a[(c[h>>2]|0)+62>>0]|0)){pn(c[u>>2]|0,c[h>>2]|0,32072,v);c[n>>2]=1;b=c[n>>2]|0;i=q;return b|0}if((c[(c[h>>2]|0)+148>>2]|0)>1){pn(c[u>>2]|0,c[h>>2]|0,32112,v);c[n>>2]=1;b=c[n>>2]|0;i=q;return b|0}c[k>>2]=c[(c[h>>2]|0)+24>>2];c[l>>2]=c[(c[h>>2]|0)+80>>2];c[m>>2]=c[(c[h>>2]|0)+84>>2];c[f>>2]=c[(c[h>>2]|0)+172>>2];b=(c[h>>2]|0)+24|0;c[b>>2]=c[b>>2]|2107392;b=(c[h>>2]|0)+24|0;c[b>>2]=c[b>>2]&-655361;c[(c[h>>2]|0)+172>>2]=0;c[o>>2]=c[(c[(c[h>>2]|0)+16>>2]|0)+4>>2];c[w>>2]=DA(Sb(c[o>>2]|0)|0)|0;c[y>>2]=c[(c[h>>2]|0)+20>>2];if(xh(c[h>>2]|0)|0)c[x>>2]=32160;else c[x>>2]=32192;c[g>>2]=EA(c[h>>2]|0,c[u>>2]|0,c[x>>2]|0)|0;if((c[(c[h>>2]|0)+20>>2]|0)>(c[y>>2]|0))c[p>>2]=(c[(c[h>>2]|0)+16>>2]|0)+((c[(c[h>>2]|0)+20>>2]|0)-1<<4);a:do if((((c[g>>2]|0)==0?(c[r>>2]=c[(c[(c[h>>2]|0)+16>>2]|0)+((c[(c[h>>2]|0)+20>>2]|0)-1<<4)+4>>2],gs(c[r>>2]|0)|0,c[t>>2]=FA(c[o>>2]|0)|0,c[g>>2]=EA(c[h>>2]|0,c[u>>2]|0,32216)|0,(c[g>>2]|0)==0):0)?(c[g>>2]=EA(c[h>>2]|0,c[u>>2]|0,32256)|0,(c[g>>2]|0)==0):0)?(c[g>>2]=Rc(c[o>>2]|0,2)|0,(c[g>>2]|0)==0):0){if((Vc(Sb(c[o>>2]|0)|0)|0)==5)c[(c[h>>2]|0)+72>>2]=0;y=c[r>>2]|0;b=Uc(c[o>>2]|0)|0;do if(!(kg(y,b,c[t>>2]|0,0)|0)){if((c[w>>2]|0)==0?(kg(c[r>>2]|0,c[(c[h>>2]|0)+72>>2]|0,c[t>>2]|0,0)|0)!=0:0)break;if(!(d[(c[h>>2]|0)+64>>0]|0)){v=c[r>>2]|0;if((a[(c[h>>2]|0)+66>>0]|0)>=0)e=a[(c[h>>2]|0)+66>>0]|0;else e=Tt(c[o>>2]|0)|0;Vt(v,e)|0;c[g>>2]=GA(c[h>>2]|0,c[u>>2]|0,32264)|0;if(c[g>>2]|0)break a;c[g>>2]=GA(c[h>>2]|0,c[u>>2]|0,32416)|0;if(c[g>>2]|0)break a;c[g>>2]=GA(c[h>>2]|0,c[u>>2]|0,32520)|0;if(c[g>>2]|0)break a;c[g>>2]=GA(c[h>>2]|0,c[u>>2]|0,32640)|0;if(c[g>>2]|0)break a;c[g>>2]=GA(c[h>>2]|0,c[u>>2]|0,32840)|0;if(c[g>>2]|0)break a;c[g>>2]=GA(c[h>>2]|0,c[u>>2]|0,32960)|0;if(c[g>>2]|0)break a;c[g>>2]=EA(c[h>>2]|0,c[u>>2]|0,33120)|0;if(c[g>>2]|0)break a;c[s>>2]=0;while(1){u=c[o>>2]|0;if((c[s>>2]|0)>=10)break;Sc(u,d[33304+(c[s>>2]|0)>>0]|0,j);c[g>>2]=bd(c[r>>2]|0,d[33304+(c[s>>2]|0)>>0]|0,(c[j>>2]|0)+(d[(c[s>>2]|0)+33305>>0]|0)|0)|0;if(c[g>>2]|0)break a;c[s>>2]=(c[s>>2]|0)+2}c[g>>2]=HA(u,c[r>>2]|0)|0;if(c[g>>2]|0)break a;c[g>>2]=gs(c[r>>2]|0)|0;if(c[g>>2]|0)break a;y=c[o>>2]|0;Vt(y,Tt(c[r>>2]|0)|0)|0;y=c[o>>2]|0;b=Uc(c[r>>2]|0)|0;c[g>>2]=kg(y,b,c[t>>2]|0,1)|0;break a}}while(0);c[g>>2]=7}while(0);c[(c[h>>2]|0)+24>>2]=c[k>>2];c[(c[h>>2]|0)+80>>2]=c[l>>2];c[(c[h>>2]|0)+84>>2]=c[m>>2];c[(c[h>>2]|0)+172>>2]=c[f>>2];kg(c[o>>2]|0,-1,-1,1)|0;a[(c[h>>2]|0)+62>>0]=1;if(c[p>>2]|0){Kk(c[(c[p>>2]|0)+4>>2]|0)|0;c[(c[p>>2]|0)+4>>2]=0;c[(c[p>>2]|0)+12>>2]=0}cd(c[h>>2]|0);c[n>>2]=c[g>>2];b=c[n>>2]|0;i=q;return b|0}function fA(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0;d=i;i=i+32|0;k=d+20|0;e=d+16|0;f=d+12|0;h=d+8|0;j=d+4|0;g=d;c[k>>2]=b;c[f>>2]=c[(c[k>>2]|0)+4>>2];Pc(c[k>>2]|0);if(!(a[(c[f>>2]|0)+17>>0]|0)){c[e>>2]=101;k=c[e>>2]|0;i=d;return k|0}c[h>>2]=Aw(c[f>>2]|0)|0;c[j>>2]=Hh((c[(c[(c[f>>2]|0)+12>>2]|0)+56>>2]|0)+36|0)|0;c[g>>2]=rA(c[f>>2]|0,c[h>>2]|0,c[j>>2]|0)|0;if((c[h>>2]|0)>>>0<(c[g>>2]|0)>>>0){c[e>>2]=kj(55422)|0;k=c[e>>2]|0;i=d;return k|0}if((c[j>>2]|0)>>>0<=0){c[e>>2]=101;k=c[e>>2]|0;i=d;return k|0}c[e>>2]=Hy(c[f>>2]|0,0,0)|0;if(!(c[e>>2]|0)){sA(c[f>>2]|0);c[e>>2]=tA(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0,0)|0}if(c[e>>2]|0){k=c[e>>2]|0;i=d;return k|0}c[e>>2]=gd(c[(c[(c[f>>2]|0)+12>>2]|0)+68>>2]|0)|0;ck((c[(c[(c[f>>2]|0)+12>>2]|0)+56>>2]|0)+28|0,c[(c[f>>2]|0)+44>>2]|0);k=c[e>>2]|0;i=d;return k|0}function gA(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+16|0;j=g+8|0;k=g+4|0;m=g+13|0;h=g;l=g+12|0;c[j>>2]=b;c[k>>2]=e;a[m>>0]=f;c[h>>2]=0;if(!(a[(c[j>>2]|0)+9>>0]|0)){b=c[h>>2]|0;i=g;return b|0}a[l>>0]=1+(d[m>>0]|0);Pc(c[j>>2]|0);c[h>>2]=By(c[j>>2]|0,c[k>>2]|0,a[l>>0]|0)|0;if(c[h>>2]|0){b=c[h>>2]|0;i=g;return b|0}c[h>>2]=qA(c[j>>2]|0,c[k>>2]|0,a[l>>0]|0)|0;b=c[h>>2]|0;i=g;return b|0}function hA(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;e=i;i=i+32|0;f=e+20|0;h=e+16|0;k=e+12|0;j=e+8|0;l=e+4|0;g=e;c[h>>2]=a;c[k>>2]=b;c[j>>2]=0;if((c[(c[h>>2]|0)+304>>2]|0)>0?(c[(c[h>>2]|0)+328>>2]|0)==0:0){c[f>>2]=6;a=c[f>>2]|0;i=e;return a|0}if(!(c[k>>2]|0)){c[f>>2]=0;a=c[f>>2]|0;i=e;return a|0}c[l>>2]=c[c[(c[k>>2]|0)+8>>2]>>2];if(c[(c[l>>2]|0)+56>>2]|0){c[g>>2]=0;while(1){if((c[g>>2]|0)>=(c[(c[h>>2]|0)+304>>2]|0))break;if((c[(c[(c[h>>2]|0)+328>>2]|0)+(c[g>>2]<<2)>>2]|0)==(c[k>>2]|0)){d=10;break}c[g>>2]=(c[g>>2]|0)+1}if((d|0)==10){c[f>>2]=0;a=c[f>>2]|0;i=e;return a|0}c[j>>2]=oA(c[h>>2]|0)|0;if((c[j>>2]|0)==0?(c[j>>2]=ub[c[(c[l>>2]|0)+56>>2]&31](c[(c[k>>2]|0)+8>>2]|0)|0,(c[j>>2]|0)==0):0)pA(c[h>>2]|0,c[k>>2]|0)}c[f>>2]=c[j>>2];a=c[f>>2]|0;i=e;return a|0}function iA(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;g=i;i=i+48|0;m=g;h=g+32|0;o=g+28|0;p=g+24|0;k=g+20|0;l=g+16|0;j=g+12|0;f=g+8|0;n=g+4|0;c[h>>2]=a;c[o>>2]=b;c[p>>2]=d;c[k>>2]=e;c[l>>2]=0;c[j>>2]=sp(c[h>>2]|0,c[p>>2]|0,c[(c[(c[h>>2]|0)+16>>2]|0)+(c[o>>2]<<4)>>2]|0)|0;c[n>>2]=c[c[(c[j>>2]|0)+56>>2]>>2];c[f>>2]=bh((c[h>>2]|0)+308|0,c[n>>2]|0)|0;e=c[h>>2]|0;if(c[f>>2]|0)c[l>>2]=zr(e,c[j>>2]|0,c[f>>2]|0,c[(c[c[f>>2]>>2]|0)+4>>2]|0,c[k>>2]|0)|0;else{c[m>>2]=c[n>>2];p=Te(e,17944,m)|0;c[c[k>>2]>>2]=p;c[l>>2]=1}if(c[l>>2]|0){p=c[l>>2]|0;i=g;return p|0}if(!(Rp(c[h>>2]|0,c[j>>2]|0)|0)){p=c[l>>2]|0;i=g;return p|0}c[l>>2]=oA(c[h>>2]|0)|0;if(c[l>>2]|0){p=c[l>>2]|0;i=g;return p|0}p=c[h>>2]|0;pA(p,Rp(c[h>>2]|0,c[j>>2]|0)|0);p=c[l>>2]|0;i=g;return p|0}function jA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;e=i;i=i+32|0;g=e+20|0;k=e+16|0;l=e+12|0;f=e+8|0;h=e+4|0;j=e;c[g>>2]=a;c[k>>2]=b;c[l>>2]=d;c[f>>2]=0;c[h>>2]=sp(c[g>>2]|0,c[l>>2]|0,c[(c[(c[g>>2]|0)+16>>2]|0)+(c[k>>2]<<4)>>2]|0)|0;if(!(c[h>>2]|0)){l=c[f>>2]|0;i=e;return l|0}if(!(c[(c[h>>2]|0)+60>>2]|0)){l=c[f>>2]|0;i=e;return l|0}c[j>>2]=Gy(c[g>>2]|0,c[h>>2]|0)|0;c[f>>2]=ub[c[(c[c[(c[j>>2]|0)+4>>2]>>2]|0)+20>>2]&31](c[(c[j>>2]|0)+8>>2]|0)|0;if(c[f>>2]|0){l=c[f>>2]|0;i=e;return l|0}c[(c[j>>2]|0)+8>>2]=0;c[(c[h>>2]|0)+60>>2]=0;Nk(c[j>>2]|0);l=c[f>>2]|0;i=e;return l|0}function kA(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=i;i=i+16|0;g=e+8|0;f=e+4|0;d=e;c[g>>2]=a;c[f>>2]=b;Pc(c[g>>2]|0);c[d>>2]=nA(c[c[(c[g>>2]|0)+4>>2]>>2]|0,c[f>>2]|0)|0;i=e;return c[d>>2]|0}function lA(b,f){b=b|0;f=f|0;var g=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;g=i;i=i+240|0;s=g+40|0;p=g+120|0;t=g+116|0;r=g+112|0;n=g+108|0;o=g+104|0;l=g+100|0;m=g+96|0;y=g+92|0;q=g+88|0;j=g+60|0;z=g+56|0;w=g+52|0;u=g+124|0;v=g;x=g+48|0;c[p>>2]=b;c[t>>2]=f;c[n>>2]=0;c[o>>2]=1;c[r>>2]=c[c[p>>2]>>2];nc(j,g+128|0,100,c[(c[r>>2]|0)+88>>2]|0);c[j>>2]=c[r>>2];if((c[(c[r>>2]|0)+160>>2]|0)>1){while(1){if(!(a[c[t>>2]>>0]|0))break;c[z>>2]=c[t>>2];do{b=c[t>>2]|0;c[t>>2]=b+1;if((a[b>>0]|0)==10)break}while((a[c[t>>2]>>0]|0)!=0);Vm(j,32016,3);Vm(j,c[z>>2]|0,(c[t>>2]|0)-(c[z>>2]|0)|0)}b=pc(j)|0;i=g;return b|0}while(1){if(!(a[c[t>>2]>>0]|0)){l=31;break}c[l>>2]=mA(c[t>>2]|0,m)|0;Vm(j,c[t>>2]|0,c[l>>2]|0);c[t>>2]=(c[t>>2]|0)+(c[l>>2]|0);if(!(c[m>>2]|0)){l=31;break}do if((a[c[t>>2]>>0]|0)==63)if((c[m>>2]|0)>1){Ag((c[t>>2]|0)+1|0,n)|0;break}else{c[n>>2]=c[o>>2];break}else c[n>>2]=Me(c[p>>2]|0,c[t>>2]|0,c[m>>2]|0)|0;while(0);c[t>>2]=(c[t>>2]|0)+(c[m>>2]|0);c[o>>2]=(c[n>>2]|0)+1;c[q>>2]=(c[(c[p>>2]|0)+60>>2]|0)+(((c[n>>2]|0)-1|0)*40|0);if(e[(c[q>>2]|0)+8>>1]&1){Vm(j,9840,4);continue}z=c[q>>2]|0;if(e[(c[q>>2]|0)+8>>1]&4){f=c[z+4>>2]|0;b=s;c[b>>2]=c[z>>2];c[b+4>>2]=f;kn(j,0,9456,s);continue}f=c[q>>2]|0;if(e[z+8>>1]&8){h[k>>3]=+h[f>>3];c[s>>2]=c[k>>2];c[s+4>>2]=c[k+4>>2];kn(j,0,9808,s);continue}if(e[f+8>>1]&2){a[u>>0]=a[(c[(c[(c[r>>2]|0)+16>>2]|0)+12>>2]|0)+77>>0]|0;if((d[u>>0]|0)!=1){f=v+0|0;z=f+40|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(z|0));c[v+32>>2]=c[r>>2];Vd(v,c[(c[q>>2]|0)+16>>2]|0,c[(c[q>>2]|0)+12>>2]|0,a[u>>0]|0,0)|0;yk(v,1)|0;c[q>>2]=v}c[w>>2]=c[(c[q>>2]|0)+12>>2];b=c[(c[q>>2]|0)+16>>2]|0;c[s>>2]=c[w>>2];c[s+4>>2]=b;kn(j,0,32024,s);if((d[u>>0]|0)==1)continue;Bd(v);continue}if(e[(c[q>>2]|0)+8>>1]&16384){c[s>>2]=c[c[q>>2]>>2];kn(j,0,32032,s);continue}Vm(j,32048,2);c[x>>2]=c[(c[q>>2]|0)+12>>2];c[y>>2]=0;while(1){if((c[y>>2]|0)>=(c[x>>2]|0))break;c[s>>2]=a[(c[(c[q>>2]|0)+16>>2]|0)+(c[y>>2]|0)>>0]&255;kn(j,0,32056,s);c[y>>2]=(c[y>>2]|0)+1}Vm(j,32064,1)}if((l|0)==31){b=pc(j)|0;i=g;return b|0}return 0}function mA(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;g=i;i=i+32|0;j=g+16|0;h=g+12|0;k=g+8|0;f=g+4|0;l=g;c[j>>2]=b;c[h>>2]=d;c[f>>2]=0;c[c[h>>2]>>2]=0;while(1){if(!(a[c[j>>2]>>0]|0)){e=6;break}c[l>>2]=qm(c[j>>2]|0,k)|0;d=c[l>>2]|0;if((c[k>>2]|0)==135)break;c[f>>2]=(c[f>>2]|0)+d;c[j>>2]=(c[j>>2]|0)+(c[l>>2]|0)}if((e|0)==6){b=c[f>>2]|0;i=g;return b|0}c[c[h>>2]>>2]=d;b=c[f>>2]|0;i=g;return b|0}function nA(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;e=i;i=i+16|0;d=e+4|0;f=e;c[d>>2]=a;c[f>>2]=b;if((c[f>>2]|0)>0)c[(c[d>>2]|0)+156>>2]=c[f>>2];i=e;return c[(c[d>>2]|0)+156>>2]|0}function oA(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+32|0;d=b+16|0;e=b+12|0;f=b+4|0;g=b;c[e>>2]=a;c[b+8>>2]=5;do if(!((c[(c[e>>2]|0)+304>>2]|0)%5|0)){c[g>>2]=(c[(c[e>>2]|0)+304>>2]|0)+5<<2;g=c[g>>2]|0;c[f>>2]=Fk(c[e>>2]|0,c[(c[e>>2]|0)+328>>2]|0,g,((g|0)<0)<<31>>31)|0;if(c[f>>2]|0){g=(c[f>>2]|0)+(c[(c[e>>2]|0)+304>>2]<<2)|0;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;c[g+12>>2]=0;c[g+16>>2]=0;c[(c[e>>2]|0)+328>>2]=c[f>>2];break}c[d>>2]=7;g=c[d>>2]|0;i=b;return g|0}while(0);c[d>>2]=0;g=c[d>>2]|0;i=b;return g|0}function pA(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;b=c[e>>2]|0;g=(c[f>>2]|0)+304|0;a=c[g>>2]|0;c[g>>2]=a+1;c[(c[(c[f>>2]|0)+328>>2]|0)+(a<<2)>>2]=b;Qy(c[e>>2]|0);i=d;return}function qA(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;o=i;i=i+32|0;g=o+20|0;l=o+16|0;k=o+12|0;n=o+24|0;m=o+8|0;j=o+4|0;p=o;c[l>>2]=b;c[k>>2]=e;a[n>>0]=f;c[m>>2]=c[(c[l>>2]|0)+4>>2];c[j>>2]=0;c[p>>2]=c[(c[m>>2]|0)+72>>2];while(1){if(!(c[p>>2]|0))break;if((c[(c[p>>2]|0)+4>>2]|0)==(c[k>>2]|0)?(c[c[p>>2]>>2]|0)==(c[l>>2]|0):0){h=5;break}c[p>>2]=c[(c[p>>2]|0)+12>>2]}if((h|0)==5)c[j>>2]=c[p>>2];do if(!(c[j>>2]|0)){c[j>>2]=Mc(16,0)|0;if(c[j>>2]|0){c[(c[j>>2]|0)+4>>2]=c[k>>2];c[c[j>>2]>>2]=c[l>>2];c[(c[j>>2]|0)+12>>2]=c[(c[m>>2]|0)+72>>2];c[(c[m>>2]|0)+72>>2]=c[j>>2];break}c[g>>2]=7;b=c[g>>2]|0;i=o;return b|0}while(0);if((d[n>>0]|0|0)>(d[(c[j>>2]|0)+8>>0]|0|0))a[(c[j>>2]|0)+8>>0]=a[n>>0]|0;c[g>>2]=0;b=c[g>>2]|0;i=o;return b|0}function rA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;e=i;i=i+32|0;g=e+20|0;h=e+16|0;k=e+12|0;l=e+8|0;j=e+4|0;f=e;c[g>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=((c[(c[g>>2]|0)+36>>2]|0)>>>0)/5|0;a=(c[k>>2]|0)-(c[h>>2]|0)|0;a=a+(Pw(c[g>>2]|0,c[h>>2]|0)|0)|0;c[j>>2]=((a+(c[l>>2]|0)|0)>>>0)/((c[l>>2]|0)>>>0)|0;c[f>>2]=(c[h>>2]|0)-(c[k>>2]|0)-(c[j>>2]|0);if((c[h>>2]|0)>>>0>((((c[282]|0)>>>0)/((c[(c[g>>2]|0)+32>>2]|0)>>>0)|0)+1|0)>>>0?(c[f>>2]|0)>>>0<((((c[282]|0)>>>0)/((c[(c[g>>2]|0)+32>>2]|0)>>>0)|0)+1|0)>>>0:0)c[f>>2]=(c[f>>2]|0)+ -1;while(1){l=Pw(c[g>>2]|0,c[f>>2]|0)|0;if((l|0)==(c[f>>2]|0))b=1;else b=(c[f>>2]|0)==((((c[282]|0)>>>0)/((c[(c[g>>2]|0)+32>>2]|0)>>>0)|0)+1|0);d=c[f>>2]|0;if(!b)break;c[f>>2]=d+ -1}i=e;return d|0}function sA(b){b=b|0;var e=0,f=0,g=0;e=i;i=i+16|0;g=e+4|0;f=e;c[g>>2]=b;c[f>>2]=c[(c[g>>2]|0)+8>>2];while(1){if(!(c[f>>2]|0))break;g=(c[f>>2]|0)+72|0;a[g>>0]=(d[g>>0]|0)&-5;c[f>>2]=c[(c[f>>2]|0)+8>>2]}i=e;return}function tA(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;t=i;i=i+64|0;k=t+52|0;o=t+48|0;v=t+44|0;q=t+40|0;m=t+36|0;z=t+32|0;l=t+28|0;s=t+57|0;h=t+24|0;p=t+20|0;n=t+16|0;u=t+12|0;r=t+8|0;y=t+56|0;x=t+4|0;w=t;c[o>>2]=b;c[v>>2]=e;c[q>>2]=f;c[m>>2]=g;b=Pw(c[o>>2]|0,c[q>>2]|0)|0;do if((b|0)!=(c[q>>2]|0)?(c[q>>2]|0)!=((((c[282]|0)>>>0)/((c[(c[o>>2]|0)+32>>2]|0)>>>0)|0)+1|0):0){c[z>>2]=Hh((c[(c[(c[o>>2]|0)+12>>2]|0)+56>>2]|0)+36|0)|0;if(!(c[z>>2]|0)){c[k>>2]=101;b=c[k>>2]|0;i=t;return b|0}c[l>>2]=Qw(c[o>>2]|0,c[q>>2]|0,s,h)|0;if(c[l>>2]|0){c[k>>2]=c[l>>2];b=c[k>>2]|0;i=t;return b|0}if((d[s>>0]|0|0)==1){c[k>>2]=kj(55307)|0;b=c[k>>2]|0;i=t;return b|0}if((d[s>>0]|0|0)==2){if(c[m>>2]|0)break;c[l>>2]=uA(c[o>>2]|0,n,p,c[q>>2]|0,1)|0;if(!(c[l>>2]|0)){Rk(c[n>>2]|0);break}c[k>>2]=c[l>>2];b=c[k>>2]|0;i=t;return b|0}a[y>>0]=0;c[x>>2]=0;c[l>>2]=Bw(c[o>>2]|0,c[q>>2]|0,r,0)|0;if(c[l>>2]|0){c[k>>2]=c[l>>2];b=c[k>>2]|0;i=t;return b|0}if(!(c[m>>2]|0)){a[y>>0]=2;c[x>>2]=c[v>>2]}do{c[l>>2]=uA(c[o>>2]|0,w,u,c[x>>2]|0,a[y>>0]|0)|0;if(c[l>>2]|0){j=19;break}Rk(c[w>>2]|0);if(!(c[m>>2]|0))break}while((c[u>>2]|0)>>>0>(c[v>>2]|0)>>>0);if((j|0)==19){Rk(c[r>>2]|0);c[k>>2]=c[l>>2];b=c[k>>2]|0;i=t;return b|0}c[l>>2]=vA(c[o>>2]|0,c[r>>2]|0,a[s>>0]|0,c[h>>2]|0,c[u>>2]|0,c[m>>2]|0)|0;Rk(c[r>>2]|0);if(c[l>>2]|0){c[k>>2]=c[l>>2];b=c[k>>2]|0;i=t;return b|0}}while(0);if(!(c[m>>2]|0)){while(1){c[q>>2]=(c[q>>2]|0)+ -1;if((c[q>>2]|0)==((((c[282]|0)>>>0)/((c[(c[o>>2]|0)+32>>2]|0)>>>0)|0)+1|0))continue;b=Pw(c[o>>2]|0,c[q>>2]|0)|0;if((b|0)!=(c[q>>2]|0))break}a[(c[o>>2]|0)+19>>0]=1;c[(c[o>>2]|0)+44>>2]=c[q>>2]}c[k>>2]=0;b=c[k>>2]|0;i=t;return b|0}function uA(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0;m=i;i=i+112|0;k=m+92|0;A=m+88|0;l=m+84|0;E=m+80|0;B=m+76|0;q=m+98|0;z=m+72|0;j=m+68|0;H=m+64|0;x=m+60|0;o=m+56|0;n=m+52|0;t=m+48|0;D=m+44|0;w=m+97|0;I=m+96|0;C=m+40|0;u=m+36|0;r=m+32|0;s=m+28|0;y=m+24|0;v=m+20|0;p=m+16|0;F=m+12|0;G=m+8|0;K=m+4|0;J=m;c[A>>2]=b;c[l>>2]=e;c[E>>2]=f;c[B>>2]=g;a[q>>0]=h;c[o>>2]=0;c[n>>2]=0;c[z>>2]=c[(c[A>>2]|0)+12>>2];c[t>>2]=Aw(c[A>>2]|0)|0;c[H>>2]=Hh((c[(c[z>>2]|0)+56>>2]|0)+36|0)|0;if((c[H>>2]|0)>>>0>=(c[t>>2]|0)>>>0){c[k>>2]=kj(57337)|0;b=c[k>>2]|0;i=m;return b|0}a:do if((c[H>>2]|0)>>>0>0){a[w>>0]=0;do if((d[q>>0]|0)==1){if((c[B>>2]|0)>>>0<=(c[t>>2]|0)>>>0){c[j>>2]=Qw(c[A>>2]|0,c[B>>2]|0,I,0)|0;if(c[j>>2]|0){c[k>>2]=c[j>>2];b=c[k>>2]|0;i=m;return b|0}else{if((d[I>>0]|0)!=2)break;a[w>>0]=1;break}}}else if((d[q>>0]|0)==2)a[w>>0]=1;while(0);c[j>>2]=gd(c[(c[z>>2]|0)+68>>2]|0)|0;if(c[j>>2]|0){c[k>>2]=c[j>>2];b=c[k>>2]|0;i=m;return b|0}ck((c[(c[z>>2]|0)+56>>2]|0)+36|0,(c[H>>2]|0)-1|0);b:while(1){c[n>>2]=c[o>>2];if(c[n>>2]|0)c[D>>2]=Hh(c[(c[n>>2]|0)+56>>2]|0)|0;else c[D>>2]=Hh((c[(c[z>>2]|0)+56>>2]|0)+32|0)|0;if((c[D>>2]|0)>>>0>(c[t>>2]|0)>>>0)c[j>>2]=kj(57386)|0;else c[j>>2]=Bw(c[A>>2]|0,c[D>>2]|0,o,0)|0;if(c[j>>2]|0){p=22;break}c[x>>2]=Hh((c[(c[o>>2]|0)+56>>2]|0)+4|0)|0;c:do if((c[x>>2]|0)!=0|(a[w>>0]|0)!=0){if((c[x>>2]|0)>>>0>((((c[(c[A>>2]|0)+36>>2]|0)>>>0)/4|0)-2|0)>>>0){p=27;break b}do if(d[w>>0]|0){if((c[B>>2]|0)!=(c[D>>2]|0)){if((c[D>>2]|0)>>>0>=(c[B>>2]|0)>>>0)break;if((d[q>>0]|0)!=2)break}c[c[E>>2]>>2]=c[D>>2];c[c[l>>2]>>2]=c[o>>2];a[w>>0]=0;c[j>>2]=gd(c[(c[o>>2]|0)+68>>2]|0)|0;if(c[j>>2]|0)break a;do if(!(c[x>>2]|0)){if(!(c[n>>2]|0)){b=(c[(c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]|0,c[l>>2]|0,c[G>>2]|0)|0;do if(!(c[j>>2]|0)){c[j>>2]=gd(c[(c[c[l>>2]>>2]|0)+68>>2]|0)|0;if(!(c[j>>2]|0))break;Rk(c[c[l>>2]>>2]|0)}while(0);a[w>>0]=0}}else{c[j>>2]=gd(c[(c[o>>2]|0)+68>>2]|0)|0;if(c[j>>2]|0)break a;c[c[E>>2]>>2]=c[D>>2];b=(c[(c[z>>2]|0)+56>>2]|0)+32|0;e=c[(c[o>>2]|0)+56>>2]|0;a[b+0>>0]=a[e+0>>0]|0;a[b+1>>0]=a[e+1>>0]|0;a[b+2>>0]=a[e+2>>0]|0;a[b+3>>0]=a[e+3>>0]|0;c[c[l>>2]>>2]=c[o>>2];c[o>>2]=0}while(0);Rk(c[n>>2]|0);c[n>>2]=0;if(!(a[w>>0]|0))break a}if((p|0)==22){c[o>>2]=0;break}else if((p|0)==27){c[j>>2]=kj(57414)|0;break}else if((p|0)==39){c[j>>2]=kj(57448)|0;break}else if((p|0)==42){Rk(H);break}else if((p|0)==62){c[j>>2]=kj(57513)|0;break}}else{c[K>>2]=0==(d[(c[A>>2]|0)+19>>0]|0)?1:0;c[j>>2]=gd(c[(c[(c[A>>2]|0)+12>>2]|0)+68>>2]|0)|0;if(c[j>>2]|0){c[k>>2]=c[j>>2];b=c[k>>2]|0;i=m;return b|0}b=(c[A>>2]|0)+44|0;c[b>>2]=(c[b>>2]|0)+1;if((c[(c[A>>2]|0)+44>>2]|0)==((((c[282]|0)>>>0)/((c[(c[A>>2]|0)+32>>2]|0)>>>0)|0)+1|0)){b=(c[A>>2]|0)+44|0;c[b>>2]=(c[b>>2]|0)+1}do if((d[(c[A>>2]|0)+17>>0]|0)!=0?(b=Pw(c[A>>2]|0,c[(c[A>>2]|0)+44>>2]|0)|0,(b|0)==(c[(c[A>>2]|0)+44>>2]|0)):0){c[J>>2]=0;c[j>>2]=Bw(c[A>>2]|0,c[(c[A>>2]|0)+44>>2]|0,J,c[K>>2]|0)|0;if(!(c[j>>2]|0)){c[j>>2]=gd(c[(c[J>>2]|0)+68>>2]|0)|0;Rk(c[J>>2]|0)}if(c[j>>2]|0){c[k>>2]=c[j>>2];b=c[k>>2]|0;i=m;return b|0}else{b=(c[A>>2]|0)+44|0;c[b>>2]=(c[b>>2]|0)+1;if((c[(c[A>>2]|0)+44>>2]|0)!=((((c[282]|0)>>>0)/((c[(c[A>>2]|0)+32>>2]|0)>>>0)|0)+1|0))break;b=(c[A>>2]|0)+44|0;c[b>>2]=(c[b>>2]|0)+1;break}}while(0);ck((c[(c[(c[A>>2]|0)+12>>2]|0)+56>>2]|0)+28|0,c[(c[A>>2]|0)+44>>2]|0);c[c[E>>2]>>2]=c[(c[A>>2]|0)+44>>2];c[j>>2]=Bw(c[A>>2]|0,c[c[E>>2]>>2]|0,c[l>>2]|0,c[K>>2]|0)|0;if(c[j>>2]|0){c[k>>2]=c[j>>2];b=c[k>>2]|0;i=m;return b|0}else{c[j>>2]=gd(c[(c[c[l>>2]>>2]|0)+68>>2]|0)|0;if(!(c[j>>2]|0))break;Rk(c[c[l>>2]>>2]|0);break}}while(0);Rk(c[o>>2]|0);Rk(c[n>>2]|0);n=c[l>>2]|0;do if(!(c[j>>2]|0)){b=(Rj(c[(c[n>>2]|0)+68>>2]|0)|0)>1;n=c[c[l>>2]>>2]|0;if(!b){a[n>>0]=0;break}Rk(n);c[c[l>>2]>>2]=0;c[k>>2]=kj(57612)|0;b=c[k>>2]|0;i=m;return b|0}else c[n>>2]=0;while(0);c[k>>2]=c[j>>2];b=c[k>>2]|0;i=m;return b|0}function vA(b,e,f,g,h,j){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;q=i;i=i+48|0;k=q+40|0;m=q+36|0;u=q+32|0;p=q+44|0;n=q+28|0;r=q+24|0;w=q+20|0;o=q+16|0;s=q+12|0;x=q+8|0;l=q+4|0;t=q;c[m>>2]=b;c[u>>2]=e;a[p>>0]=f;c[n>>2]=g;c[r>>2]=h;c[w>>2]=j;c[s>>2]=c[(c[u>>2]|0)+72>>2];c[x>>2]=c[c[m>>2]>>2];c[l>>2]=wA(c[x>>2]|0,c[(c[u>>2]|0)+68>>2]|0,c[r>>2]|0,c[w>>2]|0)|0;if(c[l>>2]|0){c[k>>2]=c[l>>2];x=c[k>>2]|0;i=q;return x|0}c[(c[u>>2]|0)+72>>2]=c[r>>2];if((d[p>>0]|0|0)!=5?(d[p>>0]|0|0)!=1:0){c[t>>2]=Hh(c[(c[u>>2]|0)+56>>2]|0)|0;if((c[t>>2]|0)!=0?(yA(c[m>>2]|0,c[t>>2]|0,4,c[r>>2]|0,l),(c[l>>2]|0)!=0):0){c[k>>2]=c[l>>2];x=c[k>>2]|0;i=q;return x|0}}else v=5;if((v|0)==5?(c[l>>2]=xA(c[u>>2]|0)|0,(c[l>>2]|0)!=0):0){c[k>>2]=c[l>>2];x=c[k>>2]|0;i=q;return x|0}do if((d[p>>0]|0|0)!=1){c[l>>2]=Bw(c[m>>2]|0,c[n>>2]|0,o,0)|0;if(c[l>>2]|0){c[k>>2]=c[l>>2];x=c[k>>2]|0;i=q;return x|0}c[l>>2]=gd(c[(c[o>>2]|0)+68>>2]|0)|0;t=c[o>>2]|0;if(c[l>>2]|0){Rk(t);c[k>>2]=c[l>>2];x=c[k>>2]|0;i=q;return x|0}else{c[l>>2]=zA(t,c[s>>2]|0,c[r>>2]|0,a[p>>0]|0)|0;Rk(c[o>>2]|0);if(c[l>>2]|0)break;yA(c[m>>2]|0,c[r>>2]|0,a[p>>0]|0,c[n>>2]|0,l);break}}while(0);c[k>>2]=c[l>>2];x=c[k>>2]|0;i=q;return x|0}function wA(d,f,g,h){d=d|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;l=i;i=i+48|0;k=l+36|0;r=l+32|0;p=l+28|0;j=l+24|0;t=l+20|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2]|0,c[m>>2]|0);break}c[l>>2]=kj(55139)|0;b=c[l>>2]|0;i=r;return b|0}else{a[q>>0]=a[h>>0]|0;Sj(c[n>>2]|0)|0;c[t>>2]=e[(c[n>>2]|0)+18>>1];c[s>>2]=0;while(1){if((c[s>>2]|0)>=(c[t>>2]|0))break;c[u>>2]=(c[(c[n>>2]|0)+56>>2]|0)+((e[(c[n>>2]|0)+20>>1]|0)&((d[(c[(c[n>>2]|0)+64>>2]|0)+(c[s>>2]<<1)>>0]|0)<<8|(d[(c[(c[n>>2]|0)+64>>2]|0)+(c[s>>2]<<1)+1>>0]|0)));if((d[j>>0]|0|0)==3){Kw(c[n>>2]|0,c[u>>2]|0,p);if(((e[p+18>>1]|0|0)!=0?((c[u>>2]|0)+(e[p+18>>1]|0)+3|0)>>>0<=((c[(c[n>>2]|0)+56>>2]|0)+(e[(c[n>>2]|0)+20>>1]|0)|0)>>>0:0)?(b=c[o>>2]|0,(b|0)==(Hh((c[u>>2]|0)+(e[p+18>>1]|0)|0)|0)):0){k=11;break}}else{b=Hh(c[u>>2]|0)|0;if((b|0)==(c[o>>2]|0)){k=13;break}}c[s>>2]=(c[s>>2]|0)+1}if((k|0)==11)ck((c[u>>2]|0)+(e[p+18>>1]|0)|0,c[m>>2]|0);else if((k|0)==13)ck(c[u>>2]|0,c[m>>2]|0);do if((c[s>>2]|0)==(c[t>>2]|0)){if((d[j>>0]|0|0)==5?(b=Hh((c[(c[n>>2]|0)+56>>2]|0)+((d[(c[n>>2]|0)+6>>0]|0)+8)|0)|0,(b|0)==(c[o>>2]|0)):0){ck((c[(c[n>>2]|0)+56>>2]|0)+((d[(c[n>>2]|0)+6>>0]|0)+8)|0,c[m>>2]|0);break}c[l>>2]=kj(55173)|0;b=c[l>>2]|0;i=r;return b|0}while(0);a[c[n>>2]>>0]=a[q>>0]|0}while(0);c[l>>2]=0;b=c[l>>2]|0;i=r;return b|0}function AA(a,d,f){a=a|0;d=d|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+48|0;l=g+36|0;h=g+32|0;m=g+28|0;j=g;k=g+24|0;c[l>>2]=a;c[h>>2]=d;c[m>>2]=f;if(c[c[m>>2]>>2]|0){i=g;return}Kw(c[l>>2]|0,c[h>>2]|0,j);if(!(b[j+18>>1]|0)){i=g;return}c[k>>2]=Hh((c[h>>2]|0)+(e[j+18>>1]|0)|0)|0;yA(c[(c[l>>2]|0)+52>>2]|0,c[k>>2]|0,3,c[(c[l>>2]|0)+72>>2]|0,c[m>>2]|0);i=g;return}function BA(a,b){a=a|0;b=b|0;var d=0,f=0,g=0,h=0;d=i;i=i+16|0;f=d+8|0;g=d+4|0;h=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=c[(c[f>>2]|0)+28>>2];Bb[c[38640+140>>2]&3](c[(c[h>>2]|0)+40>>2]|0,c[c[f>>2]>>2]|0,c[(c[f>>2]|0)+20>>2]|0,c[g>>2]|0);c[(c[f>>2]|0)+20>>2]=c[g>>2];if(!((e[(c[f>>2]|0)+24>>1]|0)&2)){i=d;return}if(!((e[(c[f>>2]|0)+24>>1]|0)&4)){i=d;return}Sg(c[f>>2]|0,3);i=d;return}function CA(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;g=d+8|0;f=d+4|0;e=d;c[g>>2]=a;c[f>>2]=b;c[e>>2]=c[(c[g>>2]|0)+60>>2];if(!(c[e>>2]|0)){g=0;g=g&1;i=d;return g|0}g=c[f>>2]|0;if(g>>>0>(Zg(c[e>>2]|0)|0)>>>0){g=1;g=g&1;i=d;return g|0}g=(Yg(c[e>>2]|0,c[f>>2]|0)|0)!=0;g=g&1;i=d;return g|0}function DA(a){a=a|0;var b=0,e=0;e=i;i=i+16|0;b=e;c[b>>2]=a;i=e;return d[(c[b>>2]|0)+15>>0]|0|0}function EA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+32|0;f=e+20|0;h=e+16|0;g=e+12|0;k=e+8|0;j=e+4|0;c[h>>2]=a;c[g>>2]=b;c[k>>2]=d;if(!(c[k>>2]|0)){c[f>>2]=7;a=c[f>>2]|0;i=e;return a|0}if(of(c[h>>2]|0,c[k>>2]|0,-1,j,0)|0){b=c[g>>2]|0;a=c[h>>2]|0;pn(b,a,nf(c[h>>2]|0)|0,e);c[f>>2]=ag(c[h>>2]|0)|0;a=c[f>>2]|0;i=e;return a|0}else{je(c[j>>2]|0)|0;c[f>>2]=JA(c[h>>2]|0,c[j>>2]|0,c[g>>2]|0)|0;a=c[f>>2]|0;i=e;return a|0}return 0}function FA(a){a=a|0;var b=0,d=0,e=0;d=i;i=i+16|0;e=d+4|0;b=d;c[e>>2]=a;Pc(c[e>>2]|0);c[b>>2]=(c[(c[(c[e>>2]|0)+4>>2]|0)+32>>2]|0)-(c[(c[(c[e>>2]|0)+4>>2]|0)+36>>2]|0);i=d;return c[b>>2]|0}function GA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;j=i;i=i+32|0;f=j+20|0;h=j+16|0;k=j+12|0;l=j+8|0;e=j+4|0;g=j;c[h>>2]=a;c[k>>2]=b;c[l>>2]=d;c[g>>2]=of(c[h>>2]|0,c[l>>2]|0,-1,e,0)|0;if(c[g>>2]|0){c[f>>2]=c[g>>2];l=c[f>>2]|0;i=j;return l|0}while(1){l=100==(je(c[e>>2]|0)|0);d=c[h>>2]|0;if(!l){b=6;break}l=c[k>>2]|0;c[g>>2]=EA(d,l,Ae(c[e>>2]|0,0)|0)|0;if(c[g>>2]|0){b=5;break}}if((b|0)==5){JA(c[h>>2]|0,c[e>>2]|0,c[k>>2]|0)|0;c[f>>2]=c[g>>2];l=c[f>>2]|0;i=j;return l|0}else if((b|0)==6){c[f>>2]=JA(d,c[e>>2]|0,c[k>>2]|0)|0;l=c[f>>2]|0;i=j;return l|0}return 0}function HA(a,d){a=a|0;d=d|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+80|0;f=g+68|0;h=g+64|0;k=g+60|0;m=g+56|0;j=g+8|0;l=g;c[f>>2]=a;c[h>>2]=d;Pc(c[f>>2]|0);Pc(c[h>>2]|0);c[m>>2]=ed(Sb(c[f>>2]|0)|0)|0;if((c[c[m>>2]>>2]|0)!=0?(d=Uc(c[h>>2]|0)|0,d=lF(d|0,((d|0)<0)<<31>>31|0,Wc(c[h>>2]|0)|0,0)|0,a=l,c[a>>2]=d,c[a+4>>2]=D,a=ig(c[m>>2]|0,11,l)|0,c[k>>2]=a,c[k>>2]=(c[k>>2]|0)==12?0:a,(c[k>>2]|0)!=0):0){a=c[k>>2]|0;i=g;return a|0}l=j+0|0;d=l+48|0;do{c[l>>2]=0;l=l+4|0}while((l|0)<(d|0));c[j+20>>2]=c[c[h>>2]>>2];c[j+24>>2]=c[h>>2];c[j+4>>2]=c[f>>2];c[j+16>>2]=1;Oc(j,2147483647)|0;c[k>>2]=od(j)|0;if(!(c[k>>2]|0)){a=(c[(c[f>>2]|0)+4>>2]|0)+22|0;b[a>>1]=(e[a>>1]|0)&-3;a=c[k>>2]|0;i=g;return a|0}else{IA(Sb(c[j+4>>2]|0)|0);a=c[k>>2]|0;i=g;return a|0}return 0}function IA(b){b=b|0;var e=0,f=0;e=i;i=i+16|0;f=e;c[f>>2]=b;if(a[(c[f>>2]|0)+15>>0]|0){i=e;return}if(d[(c[f>>2]|0)+12>>0]|0){i=e;return}Ig(c[f>>2]|0);i=e;return}function JA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+32|0;h=e+16|0;j=e+12|0;g=e+8|0;f=e+4|0;c[h>>2]=a;c[j>>2]=b;c[g>>2]=d;c[f>>2]=vd(c[j>>2]|0)|0;if(!(c[f>>2]|0)){j=c[f>>2]|0;i=e;return j|0}a=c[g>>2]|0;j=c[h>>2]|0;pn(a,j,nf(c[h>>2]|0)|0,e);j=c[f>>2]|0;i=e;return j|0}function KA(b){b=b|0;var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]|0,c[f>>2]|0)|0;break}}do if(!(a[(c[h>>2]|0)+12>>0]|0)){if((c[(c[h>>2]|0)+88>>2]|0)==0?(MA(c[(c[h>>2]|0)+204>>2]|0)|0)<=0:0)break;c[l>>2]=0;c[f>>2]=NA(c[h>>2]|0,l)|0;if(c[f>>2]|0)break a;if((c[l>>2]|0)>>>0>0){c[f>>2]=Ei(c[(c[h>>2]|0)+60>>2]|0,j,16,24,0)|0;if((c[f>>2]|0)!=0&(c[f>>2]|0)!=522)break a}else{l=j+0|0;k=l+16|0;do{a[l>>0]=0;l=l+1|0}while((l|0)<(k|0))}if(TE((c[h>>2]|0)+100|0,j,16)|0)Ig(c[h>>2]|0)}while(0);c[f>>2]=OA(c[h>>2]|0)|0;k=36}}}else k=36;while(0);if((k|0)==36){if(ai(c[h>>2]|0)|0)c[f>>2]=PA(c[h>>2]|0)|0;if((c[f>>2]|0)==0?(d[(c[h>>2]|0)+16>>0]|0)==0:0)c[f>>2]=NA(c[h>>2]|0,(c[h>>2]|0)+24|0)|0}h=c[h>>2]|0;if(c[f>>2]|0)Nh(h);else a[h+16>>0]=1;c[e>>2]=c[f>>2];b=c[e>>2]|0;i=g;return b|0}function LA(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;g=i;i=i+48|0;h=g+32|0;f=g+28|0;j=g+24|0;l=g+20|0;q=g+16|0;m=g+12|0;p=g+8|0;o=g+4|0;n=g;k=g+36|0;c[h>>2]=b;c[f>>2]=e;c[j>>2]=c[c[h>>2]>>2];c[l>>2]=0;c[q>>2]=1;c[m>>2]=((c[c[(c[h>>2]|0)+64>>2]>>2]|0)!=0^1^1)&1;c[c[f>>2]>>2]=0;if(!(c[m>>2]|0))c[l>>2]=vi(c[j>>2]|0,c[(c[h>>2]|0)+172>>2]|0,0,q)|0;if(!((c[l>>2]|0)==0&(c[q>>2]|0)!=0)){b=c[l>>2]|0;i=g;return b|0}c[p>>2]=0;c[l>>2]=WA(c[(c[h>>2]|0)+60>>2]|0,p)|0;if((c[l>>2]|0)!=0|(c[p>>2]|0)!=0){b=c[l>>2]|0;i=g;return b|0}c[l>>2]=NA(c[h>>2]|0,o)|0;if(c[l>>2]|0){b=c[l>>2]|0;i=g;return b|0}if(!((c[o>>2]|0)!=0|(c[m>>2]|0)!=0)){kh();if((hk(c[h>>2]|0,2)|0)==0?(_h(c[j>>2]|0,c[(c[h>>2]|0)+172>>2]|0,0)|0,(a[(c[h>>2]|0)+4>>0]|0)==0):0)ei(c[h>>2]|0,1)|0;lh();b=c[l>>2]|0;i=g;return b|0}if(!(c[m>>2]|0)){c[n>>2]=2049;c[l>>2]=Di(c[j>>2]|0,c[(c[h>>2]|0)+172>>2]|0,c[(c[h>>2]|0)+64>>2]|0,c[n>>2]|0,n)|0}if(!(c[l>>2]|0)){a[k>>0]=0;b=Ei(c[(c[h>>2]|0)+64>>2]|0,k,1,0,0)|0;c[l>>2]=b;c[l>>2]=(c[l>>2]|0)==522?0:b;if(!(c[m>>2]|0))Rh(c[(c[h>>2]|0)+64>>2]|0)|0;c[c[f>>2]>>2]=(d[k>>0]|0)!=0&1;b=c[l>>2]|0;i=g;return b|0}else{if((c[l>>2]|0)!=14){b=c[l>>2]|0;i=g;return b|0}c[c[f>>2]>>2]=1;c[l>>2]=0;b=c[l>>2]|0;i=g;return b|0}return 0}function MA(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=ub[c[38640+128>>2]&31](c[(c[d>>2]|0)+40>>2]|0)|0;i=b;return a|0}function NA(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0;f=i;i=i+32|0;e=f+24|0;j=f+20|0;h=f+16|0;g=f+12|0;k=f;d=f+8|0;c[j>>2]=a;c[h>>2]=b;c[g>>2]=VA(c[(c[j>>2]|0)+208>>2]|0)|0;if(!(c[g>>2]|0)){a=k;c[a>>2]=0;c[a+4>>2]=0;if((c[c[(c[j>>2]|0)+60>>2]>>2]|0)!=0?(c[d>>2]=Gg(c[(c[j>>2]|0)+60>>2]|0,k)|0,(c[d>>2]|0)!=0):0){c[e>>2]=c[d>>2];a=c[e>>2]|0;i=f;return a|0}a=k;k=c[(c[j>>2]|0)+152>>2]|0;k=bF(c[a>>2]|0,c[a+4>>2]|0,k|0,((k|0)<0)<<31>>31|0)|0;k=ZE(k|0,D|0,1,0)|0;a=c[(c[j>>2]|0)+152>>2]|0;a=jF(k|0,D|0,a|0,((a|0)<0)<<31>>31|0)|0;c[g>>2]=a}if((c[g>>2]|0)>>>0>(c[(c[j>>2]|0)+156>>2]|0)>>>0)c[(c[j>>2]|0)+156>>2]=c[g>>2];c[c[h>>2]>>2]=c[g>>2];c[e>>2]=0;a=c[e>>2]|0;i=f;return a|0}function OA(b){b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;e=i;i=i+32|0;f=e+16|0;h=e+12|0;g=e+8|0;j=e+4|0;k=e;c[h>>2]=b;c[g>>2]=0;do if(!(a[(c[h>>2]|0)+12>>0]|0)){c[g>>2]=NA(c[h>>2]|0,k)|0;if(c[g>>2]|0){c[f>>2]=c[g>>2];l=c[f>>2]|0;i=e;return l|0}l=c[c[h>>2]>>2]|0;b=c[(c[h>>2]|0)+212>>2]|0;if(!(c[k>>2]|0)){l=_h(l,b,0)|0;c[g>>2]=l;c[g>>2]=(c[g>>2]|0)==5898?0:l;c[j>>2]=0}else c[g>>2]=vi(l,b,0,j)|0;if(!(c[g>>2]|0)){k=c[h>>2]|0;if(c[j>>2]|0){c[g>>2]=RA(k,0)|0;break}if((d[k+5>>0]|0)==5)a[(c[h>>2]|0)+5>>0]=0}}while(0);c[f>>2]=c[g>>2];l=c[f>>2]|0;i=e;return l|0}function PA(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;e=b+8|0;d=b+4|0;f=b;c[e>>2]=a;c[f>>2]=0;oj(c[(c[e>>2]|0)+208>>2]|0);c[d>>2]=QA(c[(c[e>>2]|0)+208>>2]|0,f)|0;if(!((c[d>>2]|0)!=0|(c[f>>2]|0)!=0)){f=c[d>>2]|0;i=b;return f|0}Ig(c[e>>2]|0);f=c[d>>2]|0;i=b;return f|0}function QA(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;i=i+16|0;f=d+12|0;g=d+8|0;e=d+4|0;h=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=0;do{j=c[f>>2]|0;b=c[g>>2]|0;a=(c[h>>2]|0)+1|0;c[h>>2]=a;c[e>>2]=nk(j,b,0,a)|0}while((c[e>>2]|0)==-1);i=d;return c[e>>2]|0}function RA(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;h=i;i=i+16|0;g=h+12|0;j=h+8|0;k=h+4|0;f=h;c[j>>2]=b;c[k>>2]=d;c[f>>2]=0;do if((a[(c[j>>2]|0)+12>>0]|0)==0?(c[(c[j>>2]|0)+208>>2]|0)==0:0)if(bA(c[j>>2]|0)|0){Rh(c[(c[j>>2]|0)+64>>2]|0)|0;c[f>>2]=SA(c[j>>2]|0)|0;if(c[f>>2]|0)break;a[(c[j>>2]|0)+5>>0]=5;a[(c[j>>2]|0)+16>>0]=0;break}else{c[g>>2]=14;b=c[g>>2]|0;i=h;return b|0}else e=7;while(0);if((e|0)==7)c[c[k>>2]>>2]=1;c[g>>2]=c[f>>2];b=c[g>>2]|0;i=h;return b|0}function SA(b){b=b|0;var e=0,f=0,g=0;g=i;i=i+16|0;e=g+4|0;f=g;c[e>>2]=b;c[f>>2]=0;if(a[(c[e>>2]|0)+4>>0]|0)c[f>>2]=TA(c[e>>2]|0)|0;if(c[f>>2]|0){e=c[e>>2]|0;Lg(e);f=c[f>>2]|0;i=g;return f|0}b=(c[e>>2]|0)+160|0;c[f>>2]=UA(c[c[e>>2]>>2]|0,c[(c[e>>2]|0)+60>>2]|0,c[(c[e>>2]|0)+212>>2]|0,d[(c[e>>2]|0)+4>>0]|0,c[b>>2]|0,c[b+4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1;if(c[n>>2]|0){tj(c[o>>2]|0,0);Rh(c[(c[o>>2]|0)+8>>2]|0)|0;hc(c[o>>2]|0)}else{c[q>>2]=Ai(c[r>>2]|0)|0;if(c[q>>2]&1024)a[(c[o>>2]|0)+48>>0]=0;if(c[q>>2]&4096)a[(c[o>>2]|0)+49>>0]=0;c[c[p>>2]>>2]=c[o>>2]}c[m>>2]=c[n>>2];d=c[m>>2]|0;i=t;return d|0}function VA(a){a=a|0;var d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[f>>2]=a;if((c[f>>2]|0)!=0?(b[(c[f>>2]|0)+40>>1]|0)>=0:0){c[e>>2]=c[(c[f>>2]|0)+72>>2];f=c[e>>2]|0;i=d;return f|0}c[e>>2]=0;f=c[e>>2]|0;i=d;return f|0}function WA(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;a=zb[c[(c[c[f>>2]>>2]|0)+36>>2]&63](c[f>>2]|0,c[e>>2]|0)|0;i=d;return a|0}function XA(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+176|0;d=b+168|0;e=b+164|0;g=b+160|0;f=b;c[d>>2]=a;_E(f|0,0,160)|0;while(1){if(!(c[d>>2]|0))break;c[g>>2]=c[(c[d>>2]|0)+8>>2];c[(c[d>>2]|0)+8>>2]=0;c[e>>2]=0;while(1){if(!(c[f+(c[e>>2]<<2)>>2]|0))break;c[d>>2]=_A(c[f+(c[e>>2]<<2)>>2]|0,c[d>>2]|0)|0;c[f+(c[e>>2]<<2)>>2]=0;c[e>>2]=(c[e>>2]|0)+1}c[f+(c[e>>2]<<2)>>2]=c[d>>2];c[d>>2]=c[g>>2]}c[d>>2]=0;c[e>>2]=0;while(1){a=c[d>>2]|0;if((c[e>>2]|0)>>>0>=40)break;c[d>>2]=_A(a,c[f+(c[e>>2]<<2)>>2]|0)|0;c[e>>2]=(c[e>>2]|0)+1}i=b;return a|0}function YA(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+16|0;e=b+12|0;g=b+8|0;d=b+4|0;f=b;c[e>>2]=a;c[d>>2]=c[e>>2];c[e>>2]=c[(c[d>>2]|0)+8>>2];c[(c[d>>2]|0)+8>>2]=0;c[(c[d>>2]|0)+12>>2]=0;c[g>>2]=1;while(1){a=c[d>>2]|0;if(!(c[e>>2]|0))break;c[f>>2]=a;c[d>>2]=c[e>>2];c[e>>2]=c[(c[d>>2]|0)+8>>2];c[(c[d>>2]|0)+12>>2]=c[f>>2];a=aB(e,c[g>>2]|0)|0;c[(c[d>>2]|0)+8>>2]=a;c[g>>2]=(c[g>>2]|0)+1}i=b;return a|0}function ZA(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;g=i;i=i+16|0;e=g+12|0;j=g+8|0;f=g+4|0;h=g;c[e>>2]=a;c[j>>2]=b;c[f>>2]=d;d=c[e>>2]|0;if(c[(c[e>>2]|0)+12>>2]|0){ZA(c[d+12>>2]|0,c[j>>2]|0,h);c[(c[h>>2]|0)+8>>2]=c[e>>2]}else c[c[j>>2]>>2]=d;h=c[e>>2]|0;if(c[(c[e>>2]|0)+8>>2]|0){ZA(c[h+8>>2]|0,(c[e>>2]|0)+8|0,c[f>>2]|0);i=g;return}else{c[c[f>>2]>>2]=h;i=g;return}}function _A(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0;g=i;i=i+32|0;d=g+24|0;h=g+20|0;f=g;e=g+16|0;c[d>>2]=a;c[h>>2]=b;c[e>>2]=f;while(1){if(c[d>>2]|0)a=(c[h>>2]|0)!=0;else a=0;b=c[d>>2]|0;if(!a)break;k=c[b+4>>2]|0;a=c[h>>2]|0;j=c[a+4>>2]|0;if((k|0)<(j|0)|((k|0)==(j|0)?(c[b>>2]|0)>>>0<(c[a>>2]|0)>>>0:0)){c[(c[e>>2]|0)+8>>2]=c[d>>2];c[d>>2]=c[(c[d>>2]|0)+8>>2];c[e>>2]=c[(c[e>>2]|0)+8>>2];continue}j=c[h>>2]|0;b=c[j+4>>2]|0;k=c[d>>2]|0;a=c[k+4>>2]|0;if((b|0)<(a|0)|((b|0)==(a|0)?(c[j>>2]|0)>>>0<(c[k>>2]|0)>>>0:0)){c[(c[e>>2]|0)+8>>2]=c[h>>2];c[h>>2]=c[(c[h>>2]|0)+8>>2];c[e>>2]=c[(c[e>>2]|0)+8>>2];continue}else{c[d>>2]=c[(c[d>>2]|0)+8>>2];continue}}if(b){c[(c[e>>2]|0)+8>>2]=c[d>>2];k=f+8|0;k=c[k>>2]|0;i=g;return k|0}else{c[(c[e>>2]|0)+8>>2]=c[h>>2];k=f+8|0;k=c[k>>2]|0;i=g;return k|0}return 0}function $A(a){a=a|0;var d=0,f=0,g=0,h=0;d=i;i=i+16|0;f=d+8|0;g=d+4|0;h=d;c[g>>2]=a;do if(!(e[(c[g>>2]|0)+24>>1]|0)){c[h>>2]=Qe(c[(c[g>>2]|0)+4>>2]|0,1016,0)|0;if(c[h>>2]|0){c[c[h>>2]>>2]=c[c[g>>2]>>2];c[c[g>>2]>>2]=c[h>>2];c[(c[g>>2]|0)+16>>2]=(c[h>>2]|0)+8;b[(c[g>>2]|0)+24>>1]=63;break}c[f>>2]=0;h=c[f>>2]|0;i=d;return h|0}while(0);h=(c[g>>2]|0)+24|0;b[h>>1]=(b[h>>1]|0)+ -1<<16>>16;g=(c[g>>2]|0)+16|0;h=c[g>>2]|0;c[g>>2]=h+16;c[f>>2]=h;h=c[f>>2]|0;i=d;return h|0}function aB(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;i=i+32|0;e=d+16|0;g=d+12|0;h=d+8|0;f=d+4|0;j=d;c[g>>2]=a;c[h>>2]=b;if(!(c[c[g>>2]>>2]|0)){c[e>>2]=0;a=c[e>>2]|0;i=d;return a|0}b=c[g>>2]|0;if((c[h>>2]|0)==1){c[f>>2]=c[b>>2];c[c[g>>2]>>2]=c[(c[f>>2]|0)+8>>2];c[(c[f>>2]|0)+8>>2]=0;c[(c[f>>2]|0)+12>>2]=0;c[e>>2]=c[f>>2];a=c[e>>2]|0;i=d;return a|0}c[j>>2]=aB(b,(c[h>>2]|0)-1|0)|0;c[f>>2]=c[c[g>>2]>>2];j=c[j>>2]|0;if(!(c[f>>2]|0)){c[e>>2]=j;a=c[e>>2]|0;i=d;return a|0}else{c[(c[f>>2]|0)+12>>2]=j;c[c[g>>2]>>2]=c[(c[f>>2]|0)+8>>2];a=aB(c[g>>2]|0,(c[h>>2]|0)-1|0)|0;c[(c[f>>2]|0)+8>>2]=a;c[e>>2]=c[f>>2];a=c[e>>2]|0;i=d;return a|0}return 0}function bB(a){a=a|0;var d=0,f=0;d=i;i=i+16|0;f=d;c[f>>2]=a;if(!((e[(c[f>>2]|0)+26>>1]|0)&1)){a=XA(c[(c[f>>2]|0)+8>>2]|0)|0;c[(c[f>>2]|0)+8>>2]=a}f=(c[f>>2]|0)+26|0;b[f>>1]=e[f>>1]|0|2;i=d;return}function cB(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;g=i;i=i+16|0;j=g+12|0;k=g+8|0;h=g+4|0;f=g;c[j>>2]=a;c[k>>2]=d;c[h>>2]=e;c[f>>2]=c[k>>2];c[c[f>>2]>>2]=0;c[(c[f>>2]|0)+4>>2]=c[j>>2];c[(c[f>>2]|0)+8>>2]=0;c[(c[f>>2]|0)+12>>2]=0;c[(c[f>>2]|0)+20>>2]=0;c[(c[f>>2]|0)+16>>2]=(c[f>>2]|0)+32;b[(c[f>>2]|0)+24>>1]=(((c[h>>2]|0)-32|0)>>>0)/16|0;b[(c[f>>2]|0)+26>>1]=1;c[(c[f>>2]|0)+28>>2]=0;i=g;return c[f>>2]|0}function dB(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=Fg(c[(c[d>>2]|0)+204>>2]|0)|0;i=b;return a|0}function eB(b,e){b=b|0;e=e|0;var f=0,g=0,h=0;f=i;i=i+16|0;h=f+4|0;g=f;c[h>>2]=b;c[g>>2]=e;b=(c[(c[h>>2]|0)+8>>2]|0)+(((c[g>>2]|0)>>>0)/8|0)|0;a[b>>0]=d[b>>0]|0|1<<(c[g>>2]&7);i=f;return}function fB(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;o=i;i=i+64|0;l=o;n=o+52|0;t=o+48|0;h=o+44|0;k=o+40|0;u=o+36|0;m=o+32|0;j=o+28|0;s=o+24|0;p=o+20|0;r=o+16|0;q=o+12|0;c[n>>2]=b;c[t>>2]=e;c[h>>2]=f;c[k>>2]=g;c[m>>2]=c[k>>2];c[j>>2]=c[h>>2];while(1){b=c[k>>2]|0;c[k>>2]=b+ -1;if((b|0)<=0){p=23;break}if(!(c[(c[n>>2]|0)+16>>2]|0)){p=23;break}g=c[n>>2]|0;if((c[h>>2]|0)<1){p=5;break}if(kB(g,c[h>>2]|0)|0){p=23;break}if(Xc(c[(c[n>>2]|0)+4>>2]|0,c[h>>2]|0,s,0)|0){p=8;break}c[p>>2]=Zc(c[s>>2]|0)|0;do if(!(c[t>>2]|0)){if((c[k>>2]|0)>0?(d[(c[c[n>>2]>>2]|0)+17>>0]|0)!=0:0){c[u>>2]=Hh(c[p>>2]|0)|0;gB(c[n>>2]|0,c[u>>2]|0,4,c[h>>2]|0)}}else{c[r>>2]=Hh((c[p>>2]|0)+4|0)|0;if(a[(c[c[n>>2]>>2]|0)+17>>0]|0)gB(c[n>>2]|0,c[h>>2]|0,2,0);if((c[r>>2]|0)>(((c[(c[c[n>>2]>>2]|0)+36>>2]|0)/4|0)-2|0)){b=c[n>>2]|0;c[l>>2]=c[h>>2];jB(b,34368,l);c[k>>2]=(c[k>>2]|0)+ -1;break}c[u>>2]=0;while(1){if((c[u>>2]|0)>=(c[r>>2]|0))break;c[q>>2]=Hh((c[p>>2]|0)+(8+(c[u>>2]<<2))|0)|0;if(a[(c[c[n>>2]>>2]|0)+17>>0]|0)gB(c[n>>2]|0,c[q>>2]|0,2,0);kB(c[n>>2]|0,c[q>>2]|0)|0;c[u>>2]=(c[u>>2]|0)+1}c[k>>2]=(c[k>>2]|0)-(c[r>>2]|0)}while(0);c[h>>2]=Hh(c[p>>2]|0)|0;_c(c[s>>2]|0)}if((p|0)==5){e=c[m>>2]|0;b=c[j>>2]|0;c[l>>2]=(c[k>>2]|0)+1;c[l+4>>2]=e;c[l+8>>2]=b;jB(g,34280,l);i=o;return}else if((p|0)==8){b=c[n>>2]|0;c[l>>2]=c[h>>2];jB(b,34344,l);i=o;return}else if((p|0)==23){i=o;return}}function gB(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;l=i;i=i+48|0;k=l;n=l+36|0;j=l+32|0;h=l+41|0;o=l+28|0;m=l+24|0;p=l+40|0;q=l+20|0;c[n>>2]=b;c[j>>2]=e;a[h>>0]=f;c[o>>2]=g;c[m>>2]=Qw(c[c[n>>2]>>2]|0,c[j>>2]|0,p,q)|0;if(c[m>>2]|0){if((c[m>>2]|0)==7|(c[m>>2]|0)==3082)c[(c[n>>2]|0)+24>>2]=1;b=c[n>>2]|0;c[k>>2]=c[j>>2];jB(b,34192,k);i=l;return}if((d[p>>0]|0|0)==(d[h>>0]|0|0)?(c[q>>2]|0)==(c[o>>2]|0):0){i=l;return}b=c[n>>2]|0;n=d[h>>0]|0;o=c[o>>2]|0;f=d[p>>0]|0;e=c[q>>2]|0;c[k>>2]=c[j>>2];c[k+4>>2]=n;c[k+8>>2]=o;c[k+12>>2]=f;c[k+16>>2]=e;jB(b,34224,k);i=l;return}function hB(f,g,h,j){f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0;G=i;i=i+192|0;t=G+40|0;m=G+180|0;o=G+176|0;z=G+172|0;M=G+168|0;K=G+164|0;u=G+160|0;w=G+156|0;V=G+152|0;r=G+148|0;O=G+144|0;U=G+140|0;v=G+136|0;y=G+132|0;E=G+128|0;F=G+124|0;x=G+120|0;I=G+116|0;D=G+112|0;k=G+108|0;J=G+32|0;L=G+24|0;n=G+104|0;p=G+100|0;q=G+96|0;P=G+92|0;S=G+88|0;T=G;R=G+84|0;Q=G+80|0;H=G+76|0;A=G+72|0;B=G+68|0;C=G+64|0;N=G+60|0;s=G+56|0;c[o>>2]=f;c[z>>2]=g;c[M>>2]=h;c[K>>2]=j;c[k>>2]=0;f=J;c[f>>2]=0;c[f+4>>2]=0;f=L;c[f>>2]=0;c[f+4>>2]=0;c[n>>2]=c[(c[o>>2]|0)+28>>2];c[p>>2]=c[(c[o>>2]|0)+32>>2];c[q>>2]=c[(c[o>>2]|0)+36>>2];c[I>>2]=c[c[o>>2]>>2];c[D>>2]=c[(c[I>>2]|0)+36>>2];if(!(c[z>>2]|0)){c[m>>2]=0;f=c[m>>2]|0;i=G;return f|0}if(kB(c[o>>2]|0,c[z>>2]|0)|0){c[m>>2]=0;f=c[m>>2]|0;i=G;return f|0}c[(c[o>>2]|0)+28>>2]=33496;c[(c[o>>2]|0)+32>>2]=c[z>>2];f=Bw(c[I>>2]|0,c[z>>2]|0,u,0)|0;c[V>>2]=f;do if(f){f=c[o>>2]|0;c[t>>2]=c[V>>2];jB(f,33512,t);c[r>>2]=-1}else{a[c[u>>2]>>0]=0;f=Sj(c[u>>2]|0)|0;c[V>>2]=f;if(f){f=c[o>>2]|0;c[t>>2]=c[V>>2];jB(f,33552,t);Rk(c[u>>2]|0);c[r>>2]=-1;break}c[r>>2]=0;c[w>>2]=0;while(1){if((c[w>>2]|0)>=(e[(c[u>>2]|0)+18>>1]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>>0];c[w>>2]=c[s>>2]}c[v>>2]=0;c[w>>2]=0;while(1){if((c[w>>2]|0)>=(c[D>>2]|0))break;if(a[(c[k>>2]|0)+(c[w>>2]|0)>>0]|0){if((a[(c[k>>2]|0)+(c[w>>2]|0)>>0]|0)>1){l=72;break}}else c[v>>2]=(c[v>>2]|0)+1;c[w>>2]=(c[w>>2]|0)+1}if((l|0)==72){W=c[o>>2]|0;f=c[z>>2]|0;c[t>>2]=c[w>>2];c[t+4>>2]=f;jB(W,34040,t)}if((c[v>>2]|0)!=(d[(c[x>>2]|0)+((c[y>>2]|0)+7)>>0]|0)){W=c[o>>2]|0;g=d[(c[x>>2]|0)+((c[y>>2]|0)+7)>>0]|0;f=c[z>>2]|0;c[t>>2]=c[v>>2];c[t+4>>2]=g;c[t+8>>2]=f;jB(W,34080,t)}}else c[(c[o>>2]|0)+24>>2]=1;Kg(c[k>>2]|0);Rk(c[u>>2]|0)}while(0);c[(c[o>>2]|0)+28>>2]=c[n>>2];c[(c[o>>2]|0)+32>>2]=c[p>>2];c[(c[o>>2]|0)+36>>2]=c[q>>2];c[m>>2]=(c[r>>2]|0)+1;W=c[m>>2]|0;i=G;return W|0}function iB(a,b){a=a|0;b=b|0;var e=0,f=0,g=0;g=i;i=i+16|0;f=g+4|0;e=g;c[f>>2]=a;c[e>>2]=b;i=g;return(d[(c[(c[f>>2]|0)+8>>2]|0)+(((c[e>>2]|0)>>>0)/8|0)>>0]|0)&1<<(c[e>>2]&7)|0}function jB(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+240|0;k=f;g=f+28|0;h=f+24|0;j=f+8|0;l=f+32|0;c[g>>2]=a;c[h>>2]=b;if(!(c[(c[g>>2]|0)+16>>2]|0)){i=f;return}a=(c[g>>2]|0)+16|0;c[a>>2]=(c[a>>2]|0)+ -1;a=(c[g>>2]|0)+20|0;c[a>>2]=(c[a>>2]|0)+1;c[j>>2]=e;if(c[(c[g>>2]|0)+52>>2]|0)Vm((c[g>>2]|0)+40|0,33488,1);if(c[(c[g>>2]|0)+28>>2]|0){a=c[(c[g>>2]|0)+28>>2]|0;b=c[(c[g>>2]|0)+36>>2]|0;c[k>>2]=c[(c[g>>2]|0)+32>>2];c[k+4>>2]=b;sc(200,l,a,k)|0;ss((c[g>>2]|0)+40|0,l)}oc((c[g>>2]|0)+40|0,1,c[h>>2]|0,j);if((d[(c[g>>2]|0)+65>>0]|0|0)!=1){i=f;return}c[(c[g>>2]|0)+24>>2]=1;i=f;return}function kB(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;e=d;f=d+12|0;h=d+8|0;g=d+4|0;c[h>>2]=a;c[g>>2]=b;do if(c[g>>2]|0){b=c[h>>2]|0;a=c[g>>2]|0;if((c[g>>2]|0)>>>0>(c[(c[h>>2]|0)+12>>2]|0)>>>0){c[e>>2]=a;jB(b,34136,e);c[f>>2]=1;break}a=(iB(b,a)|0)!=0;h=c[h>>2]|0;g=c[g>>2]|0;if(a){c[e>>2]=g;jB(h,34160,e);c[f>>2]=1;break}else{eB(h,g);c[f>>2]=0;break}}else c[f>>2]=1;while(0);i=d;return c[f>>2]|0}function lB(f,g){f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;l=i;i=i+32|0;k=l+24|0;o=l+20|0;j=l+16|0;m=l+12|0;h=l+8|0;n=l+4|0;p=l;c[o>>2]=f;c[j>>2]=g;c[m>>2]=(c[j>>2]|0)+(d[(c[o>>2]|0)+7>>0]|0);g=c[m>>2]|0;if(a[(c[o>>2]|0)+4>>0]|0){c[h>>2]=g+9;do{f=c[m>>2]|0;c[m>>2]=f+1;if(!(d[f>>0]&128))break}while((c[m>>2]|0)>>>0<(c[h>>2]|0)>>>0);b[k>>1]=(c[m>>2]|0)-(c[j>>2]|0);f=b[k>>1]|0;i=l;return f|0}c[n>>2]=d[g>>0];a:do if((c[n>>2]|0)>>>0>=128){c[h>>2]=(c[m>>2]|0)+9;c[n>>2]=c[n>>2]&127;do{g=c[n>>2]<<7;f=(c[m>>2]|0)+1|0;c[m>>2]=f;c[n>>2]=g|d[f>>0]&127;if((d[c[m>>2]>>0]|0)<128)break a}while((c[m>>2]|0)>>>0<(c[h>>2]|0)>>>0)}while(0);c[m>>2]=(c[m>>2]|0)+1;b:do if(a[(c[o>>2]|0)+2>>0]|0){c[h>>2]=(c[m>>2]|0)+9;do{f=c[m>>2]|0;c[m>>2]=f+1;if(!(d[f>>0]&128))break b}while((c[m>>2]|0)>>>0<(c[h>>2]|0)>>>0)}while(0);if((c[n>>2]|0)>>>0<=(e[(c[o>>2]|0)+10>>1]|0)>>>0){f=(c[n>>2]|0)+((c[m>>2]|0)-(c[j>>2]|0))|0;c[n>>2]=f;c[n>>2]=(c[n>>2]|0)>>>0<4?4:f}else{c[p>>2]=e[(c[o>>2]|0)+12>>1];c[n>>2]=(c[p>>2]|0)+((((c[n>>2]|0)-(c[p>>2]|0)|0)>>>0)%(((c[(c[(c[o>>2]|0)+52>>2]|0)+36>>2]|0)-4|0)>>>0)|0);if((c[n>>2]|0)>>>0>(e[(c[o>>2]|0)+10>>1]|0)>>>0)c[n>>2]=c[p>>2];c[n>>2]=(c[n>>2]|0)+(4+((c[m>>2]|0)-(c[j>>2]|0)&65535))}b[k>>1]=c[n>>2];f=b[k>>1]|0;i=l;return f|0}function mB(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b+4|0;e=b;c[d>>2]=a;if(!(c[d>>2]|0)){e=c[d>>2]|0;hc(e);i=b;return}c[e>>2]=0;while(1){if((c[e>>2]|0)>=(c[c[d>>2]>>2]|0))break;qB((c[(c[d>>2]|0)+12>>2]|0)+((c[e>>2]|0)*56|0)|0);c[e>>2]=(c[e>>2]|0)+1}e=c[d>>2]|0;hc(e);i=b;return}function nB(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;Xb(c[f>>2]|0,c[(c[e>>2]|0)+12>>2]|0);c[(c[e>>2]|0)+12>>2]=0;oB(0,c[(c[e>>2]|0)+16>>2]|0);c[(c[e>>2]|0)+16>>2]=0;if(c[(c[e>>2]|0)+32>>2]|0){pB(c[(c[e>>2]|0)+32>>2]|0)|0;c[(c[e>>2]|0)+32>>2]=0;f=(c[e>>2]|0)+40|0;c[f>>2]=0;c[f+4>>2]=0}if(!(c[(c[e>>2]|0)+48>>2]|0)){i=d;return}pB(c[(c[e>>2]|0)+48>>2]|0)|0;c[(c[e>>2]|0)+48>>2]=0;f=(c[e>>2]|0)+56|0;c[f>>2]=0;c[f+4>>2]=0;i=d;return}function oB(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;g=d+12|0;h=d+8|0;e=d+4|0;f=d;c[g>>2]=a;c[h>>2]=b;c[e>>2]=c[h>>2];while(1){if(!(c[e>>2]|0))break;c[f>>2]=c[(c[e>>2]|0)+4>>2];Xb(c[g>>2]|0,c[e>>2]|0);c[e>>2]=c[f>>2]}i=d;return}function pB(a){a=a|0;var b=0,d=0,e=0;d=i;i=i+16|0;e=d+4|0;b=d;c[e>>2]=a;c[b>>2]=0;c[b>>2]=Rh(c[e>>2]|0)|0;hc(c[e>>2]|0);i=d;return c[b>>2]|0}function qB(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;hc(c[(c[d>>2]|0)+28>>2]|0);hc(c[(c[d>>2]|0)+36>>2]|0);if(c[(c[d>>2]|0)+44>>2]|0)hj(c[(c[d>>2]|0)+24>>2]|0,0,0,c[(c[d>>2]|0)+44>>2]|0)|0;rB(c[(c[d>>2]|0)+48>>2]|0);d=(c[d>>2]|0)+0|0;a=d+56|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(a|0));i=b;return}function rB(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;if(!(c[d>>2]|0)){i=b;return}mB(c[(c[d>>2]|0)+4>>2]|0);hc(c[d>>2]|0);i=b;return}function sB(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0;h=i;i=i+32|0;n=h+20|0;k=h;l=h+16|0;j=h+12|0;m=h+8|0;c[n>>2]=b;b=k;c[b>>2]=e;c[b+4>>2]=f;c[l>>2]=g;c[m>>2]=c[(c[n>>2]|0)+4>>2];c[j>>2]=c[(c[m>>2]|0)+8>>2];while(1){if(!(c[j>>2]|0))break;do if((d[(c[j>>2]|0)+72>>0]|0)&16){if((c[l>>2]|0)==0?(m=(c[j>>2]|0)+24|0,n=k,!((c[m>>2]|0)==(c[n>>2]|0)?(c[m+4>>2]|0)==(c[n+4>>2]|0):0)):0)break;a[(c[j>>2]|0)+73>>0]=0}while(0);c[j>>2]=c[(c[j>>2]|0)+8>>2]}i=h;return}function tB(b,f,g,h){b=b|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;o=i;i=i+48|0;j=o+36|0;r=o+32|0;v=o+28|0;n=o+24|0;q=o+20|0;l=o+16|0;k=o+12|0;p=o+8|0;u=o+4|0;m=o;t=o+40|0;c[r>>2]=b;c[v>>2]=f;c[n>>2]=g;c[q>>2]=h;b=c[v>>2]|0;if(b>>>0>(Aw(c[r>>2]|0)|0)>>>0){c[j>>2]=kj(59756)|0;b=c[j>>2]|0;i=o;return b|0}c[k>>2]=zw(c[r>>2]|0,c[v>>2]|0,l,0)|0;if(c[k>>2]|0){c[j>>2]=c[k>>2];b=c[j>>2]|0;i=o;return b|0}c[m>>2]=d[(c[l>>2]|0)+6>>0];c[u>>2]=0;while(1){v=c[l>>2]|0;if((c[u>>2]|0)>=(e[(c[l>>2]|0)+18>>1]|0)){s=11;break}c[p>>2]=(c[v+56>>2]|0)+(e[(c[l>>2]|0)+20>>1]&(d[(c[(c[l>>2]|0)+64>>2]|0)+(c[u>>2]<<1)>>0]<<8|d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)+20>>1]|0)|0)>>>0){c[j>>2]=kj(57786)|0;u=c[j>>2]|0;i=p;return u|0}c[n>>2]=Hh((c[q>>2]|0)+(e[r+18>>1]|0)|0)|0;c[s>>2]=(c[(c[m>>2]|0)+36>>2]|0)-4;c[g>>2]=(((c[r+12>>2]|0)-(e[r+16>>1]|0)+(c[s>>2]|0)-1|0)>>>0)/((c[s>>2]|0)>>>0)|0;while(1){u=c[g>>2]|0;c[g>>2]=u+ -1;if(!u){h=23;break}c[o>>2]=0;c[l>>2]=0;if((c[n>>2]|0)>>>0<2){h=9;break}u=c[n>>2]|0;if(u>>>0>(Aw(c[m>>2]|0)|0)>>>0){h=9;break}if((c[g>>2]|0)!=0?(c[k>>2]=Ow(c[m>>2]|0,c[n>>2]|0,l,o)|0,(c[k>>2]|0)!=0):0){h=12;break}if((c[l>>2]|0)==0?(u=zB(c[m>>2]|0,c[n>>2]|0)|0,c[l>>2]=u,(u|0)==0):0)h=17;else if((Rj(c[(c[l>>2]|0)+68>>2]|0)|0)!=1)c[k>>2]=kj(57820)|0;else h=17;if((h|0)==17){h=0;c[k>>2]=xB(c[m>>2]|0,c[l>>2]|0,c[n>>2]|0)|0}if(c[l>>2]|0)_c(c[(c[l>>2]|0)+68>>2]|0);if(c[k>>2]|0){h=21;break}c[n>>2]=c[o>>2]}if((h|0)==9){c[j>>2]=kj(57800)|0;u=c[j>>2]|0;i=p;return u|0}else if((h|0)==12){c[j>>2]=c[k>>2];u=c[j>>2]|0;i=p;return u|0}else if((h|0)==21){c[j>>2]=c[k>>2];u=c[j>>2]|0;i=p;return u|0}else if((h|0)==23){c[j>>2]=0;u=c[j>>2]|0;i=p;return u|0}return 0}function vB(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(c[c[f>>2]>>2]|0){i=d;return}a=xB(c[(c[e>>2]|0)+52>>2]|0,c[e>>2]|0,c[(c[e>>2]|0)+72>>2]|0)|0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ck((c[(c[h>>2]|0)+56>>2]|0)+4|0,(c[j>>2]|0)+1|0);ck((c[(c[h>>2]|0)+56>>2]|0)+(8+(c[j>>2]<<2))|0,c[p>>2]|0);if((c[n>>2]|0)!=0?(e[(c[k>>2]|0)+22>>1]&4|0)==0:0)AB(c[(c[n>>2]|0)+68>>2]|0);c[g>>2]=BB(c[k>>2]|0,c[p>>2]|0)|0;break}}if((c[n>>2]|0)==0?(b=Bw(c[k>>2]|0,c[p>>2]|0,n,0)|0,c[g>>2]=b,0!=(b|0)):0)break;c[g>>2]=gd(c[(c[n>>2]|0)+68>>2]|0)|0;if(!(c[g>>2]|0)){ck(c[(c[n>>2]|0)+56>>2]|0,c[m>>2]|0);ck((c[(c[n>>2]|0)+56>>2]|0)+4|0,0);ck((c[(c[l>>2]|0)+56>>2]|0)+32|0,c[p>>2]|0)}}while(0);if(!(c[n>>2]|0)){b=c[n>>2]|0;Rk(b);b=c[h>>2]|0;Rk(b);b=c[g>>2]|0;i=q;return b|0}a[c[n>>2]>>0]=0;b=c[n>>2]|0;Rk(b);b=c[h>>2]|0;Rk(b);b=c[g>>2]|0;i=q;return b|0}function yB(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;CB(c[d>>2]|0);i=b;return}function zB(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[f>>2]=a;c[g>>2]=b;c[h>>2]=Hi(c[c[f>>2]>>2]|0,c[g>>2]|0)|0;if(c[h>>2]|0){c[e>>2]=Cw(c[h>>2]|0,c[g>>2]|0,c[f>>2]|0)|0;a=c[e>>2]|0;i=d;return a|0}else{c[e>>2]=0;a=c[e>>2]|0;i=d;return a|0}return 0}function AB(a){a=a|0;var d=0,f=0,g=0;d=i;i=i+16|0;f=d+4|0;g=d;c[f>>2]=a;c[g>>2]=c[(c[f>>2]|0)+16>>2];if(!((e[(c[f>>2]|0)+24>>1]|0)&2)){i=d;return}if(c[(c[g>>2]|0)+96>>2]|0){i=d;return}g=(c[f>>2]|0)+24|0;b[g>>1]=e[g>>1]|0|32;i=d;return}function BB(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=i;i=i+16|0;g=e+8|0;f=e+4|0;d=e;c[g>>2]=a;c[f>>2]=b;c[d>>2]=0;if((c[(c[g>>2]|0)+60>>2]|0)==0?(a=Vg(c[(c[g>>2]|0)+44>>2]|0)|0,c[(c[g>>2]|0)+60>>2]=a,(c[(c[g>>2]|0)+60>>2]|0)==0):0)c[d>>2]=7;if(c[d>>2]|0){a=c[d>>2]|0;i=e;return a|0}a=c[f>>2]|0;if(a>>>0>(Zg(c[(c[g>>2]|0)+60>>2]|0)|0)>>>0){a=c[d>>2]|0;i=e;return a|0}c[d>>2]=Wg(c[(c[g>>2]|0)+60>>2]|0,c[f>>2]|0)|0;a=c[d>>2]|0;i=e;return a|0}function CB(a){a=a|0;var d=0,e=0;d=i;i=i+16|0;e=d;c[e>>2]=a;a=(c[e>>2]|0)+26|0;b[a>>1]=(b[a>>1]|0)+1<<16>>16;i=d;return}function DB(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;m=i;i=i+48|0;g=m+32|0;n=m+28|0;o=m+24|0;p=m+20|0;h=m+16|0;j=m+12|0;k=m+8|0;l=m+4|0;f=m;c[n>>2]=b;c[o>>2]=d;c[p>>2]=e;c[j>>2]=0;c[k>>2]=c[(c[n>>2]|0)+4>>2];if(c[(c[k>>2]|0)+8>>2]|0){c[g>>2]=262;b=c[g>>2]|0;i=m;return b|0}c[h>>2]=Bw(c[k>>2]|0,c[o>>2]|0,j,0)|0;if(c[h>>2]|0){c[g>>2]=c[h>>2];b=c[g>>2]|0;i=m;return b|0}c[h>>2]=Rz(c[n>>2]|0,c[o>>2]|0,0)|0;if(c[h>>2]|0){Rk(c[j>>2]|0);c[g>>2]=c[h>>2];b=c[g>>2]|0;i=m;return b|0}c[c[p>>2]>>2]=0;do if((c[o>>2]|0)>>>0>1){if(!(a[(c[k>>2]|0)+17>>0]|0)){vB(c[j>>2]|0,h);Rk(c[j>>2]|0);break}Sc(c[n>>2]|0,4,l);e=c[j>>2]|0;do if((c[o>>2]|0)==(c[l>>2]|0)){vB(e,h);Rk(c[j>>2]|0);if(c[h>>2]|0){c[g>>2]=c[h>>2];b=c[g>>2]|0;i=m;return b|0}}else{Rk(e);c[h>>2]=Bw(c[k>>2]|0,c[l>>2]|0,f,0)|0;if(c[h>>2]|0){c[g>>2]=c[h>>2];b=c[g>>2]|0;i=m;return b|0}c[h>>2]=vA(c[k>>2]|0,c[f>>2]|0,1,0,c[o>>2]|0,0)|0;Rk(c[f>>2]|0);if(c[h>>2]|0){c[g>>2]=c[h>>2];b=c[g>>2]|0;i=m;return b|0}c[f>>2]=0;c[h>>2]=Bw(c[k>>2]|0,c[l>>2]|0,f,0)|0;vB(c[f>>2]|0,h);Rk(c[f>>2]|0);if(!(c[h>>2]|0)){c[c[p>>2]>>2]=c[l>>2];break}c[g>>2]=c[h>>2];b=c[g>>2]|0;i=m;return b|0}while(0);c[l>>2]=(c[l>>2]|0)+ -1;while(1){if((c[l>>2]|0)!=((((c[282]|0)>>>0)/((c[(c[k>>2]|0)+32>>2]|0)>>>0)|0)+1|0)?(b=Pw(c[k>>2]|0,c[l>>2]|0)|0,(b|0)!=(c[l>>2]|0)):0)break;c[l>>2]=(c[l>>2]|0)+ -1}c[h>>2]=bd(c[n>>2]|0,4,c[l>>2]|0)|0}else{wB(c[j>>2]|0,9);Rk(c[j>>2]|0)}while(0);c[g>>2]=c[h>>2];b=c[g>>2]|0;i=m;return b|0}function EB(b){b=b|0;var d=0,e=0;d=i;i=i+16|0;e=d;c[e>>2]=b;a[(c[e>>2]|0)+56>>0]=1;b=FB((c[e>>2]|0)+64|0,(c[e>>2]|0)+36|0)|0;i=d;return b|0}function FB(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=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k=c[g>>2]|0;i=f;return k|0}k=h;c[k>>2]=0;c[k+4>>2]=0;rj(c[c[j>>2]>>2]|0,18,h);k=c[g>>2]|0;i=f;return k|0}function HB(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;j=i;i=i+32|0;f=j+28|0;m=j+24|0;k=j+20|0;h=j+16|0;l=j+12|0;g=j+8|0;n=j+4|0;e=j;c[m>>2]=a;c[k>>2]=b;c[n>>2]=MB(c[m>>2]|0)|0;if(c[n>>2]|0){c[f>>2]=c[n>>2];a=c[f>>2]|0;i=j;return a|0}c[l>>2]=Mc(256,0)|0;if(!(c[l>>2]|0)){c[f>>2]=7;a=c[f>>2]|0;i=j;return a|0}c[g>>2]=c[c[k>>2]>>2];while(1){if(!(c[g>>2]|0))break;b=c[g>>2]|0;do if(c[(c[k>>2]|0)+4>>2]|0)if((b|0)==(c[(c[k>>2]|0)+4>>2]|0)){c[e>>2]=0;break}else{c[e>>2]=(c[(c[k>>2]|0)+4>>2]|0)+(c[(c[g>>2]|0)+4>>2]|0);break}else c[e>>2]=c[b+4>>2];while(0);c[(c[g>>2]|0)+4>>2]=0;c[h>>2]=0;while(1){if(!(c[(c[l>>2]|0)+(c[h>>2]<<2)>>2]|0))break;NB(c[m>>2]|0,c[g>>2]|0,c[(c[l>>2]|0)+(c[h>>2]<<2)>>2]|0,g);c[(c[l>>2]|0)+(c[h>>2]<<2)>>2]=0;c[h>>2]=(c[h>>2]|0)+1}c[(c[l>>2]|0)+(c[h>>2]<<2)>>2]=c[g>>2];c[g>>2]=c[e>>2]}c[g>>2]=0;c[h>>2]=0;while(1){if((c[h>>2]|0)>=64)break;NB(c[m>>2]|0,c[g>>2]|0,c[(c[l>>2]|0)+(c[h>>2]<<2)>>2]|0,g);c[h>>2]=(c[h>>2]|0)+1}c[c[k>>2]>>2]=c[g>>2];hc(c[l>>2]|0);c[f>>2]=d[(c[(c[m>>2]|0)+12>>2]|0)+7>>0];a=c[f>>2]|0;i=j;return a|0}function IB(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0;k=i;i=i+32|0;j=k+16|0;g=k+12|0;l=k+8|0;h=k;c[j>>2]=a;c[g>>2]=b;c[l>>2]=d;a=h;c[a>>2]=e;c[a+4>>2]=f;f=(c[g>>2]|0)+0|0;e=f+40|0;do{c[f>>2]=0;f=f+4|0}while((f|0)<(e|0));a=c[l>>2]|0;a=gc(a,((a|0)<0)<<31>>31)|0;c[(c[g>>2]|0)+4>>2]=a;if(c[(c[g>>2]|0)+4>>2]|0){b=h;a=c[l>>2]|0;a=kF(c[b>>2]|0,c[b+4>>2]|0,a|0,((a|0)<0)<<31>>31|0)|0;c[(c[g>>2]|0)+12>>2]=a;c[(c[g>>2]|0)+16>>2]=a;a=h;b=c[(c[g>>2]|0)+12>>2]|0;b=ZE(c[a>>2]|0,c[a+4>>2]|0,b|0,((b|0)<0)<<31>>31|0)|0;a=(c[g>>2]|0)+24|0;c[a>>2]=b;c[a+4>>2]=D;c[(c[g>>2]|0)+8>>2]=c[l>>2];c[(c[g>>2]|0)+32>>2]=c[j>>2];i=k;return}else{c[c[g>>2]>>2]=7;i=k;return}}function JB(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+32|0;h=e+12|0;j=e;f=e+8|0;g=e+16|0;c[h>>2]=a;a=j;c[a>>2]=b;c[a+4>>2]=d;a=j;c[f>>2]=oz(g,c[a>>2]|0,c[a+4>>2]|0)|0;KB(c[h>>2]|0,g,c[f>>2]|0);i=e;return}function KB(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;e=i;i=i+32|0;f=e+16|0;g=e+12|0;h=e+8|0;j=e+4|0;k=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;c[j>>2]=c[h>>2];while(1){if((c[j>>2]|0)<=0){d=9;break}if(c[c[f>>2]>>2]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[g>>2]=7;a=c[(c[l>>2]|0)+4>>2]|0;c[n>>2]=Mc(a,((a|0)<0)<<31>>31)|0;if(!(c[n>>2]|0)){a=c[g>>2]|0;i=j;return a|0}c[g>>2]=Di(c[l>>2]|0,c[m>>2]|0,c[n>>2]|0,c[k>>2]|0,c[o>>2]|0)|0;k=c[n>>2]|0;if(c[g>>2]|0){hc(k);a=c[g>>2]|0;i=j;return a|0}else{c[c[h>>2]>>2]=k;a=c[g>>2]|0;i=j;return a|0}return 0}function QB(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;g=i;i=i+48|0;j=g+36|0;k=g+32|0;h=g+28|0;q=g+24|0;m=g+20|0;e=g+16|0;n=g+12|0;l=g+8|0;o=g+4|0;p=g;c[j>>2]=a;c[k>>2]=b;c[q>>2]=c[(c[(c[j>>2]|0)+8>>2]|0)+4>>2];c[m>>2]=c[(c[j>>2]|0)+4>>2];c[h>>2]=RB((c[(c[j>>2]|0)+12>>2]|0)+((c[q>>2]|0)*56|0)|0)|0;if(!(c[h>>2]|0)){c[n>>2]=(c[(c[j>>2]|0)+12>>2]|0)+((c[q>>2]&65534)*56|0);c[l>>2]=(c[(c[j>>2]|0)+12>>2]|0)+((c[q>>2]|1)*56|0);c[o>>2]=c[(c[l>>2]|0)+32>>2];c[e>>2]=((c[c[j>>2]>>2]|0)+(c[q>>2]|0)|0)/2|0;while(1){if((c[e>>2]|0)<=0)break;do if(c[(c[n>>2]|0)+24>>2]|0)if(!(c[(c[l>>2]|0)+24>>2]|0)){c[p>>2]=-1;break}else{c[p>>2]=OB(c[m>>2]|0,c[(c[n>>2]|0)+32>>2]|0,c[(c[n>>2]|0)+20>>2]|0,c[o>>2]|0,c[(c[l>>2]|0)+20>>2]|0)|0;break}else c[p>>2]=1;while(0);do if((c[p>>2]|0)<0)f=12;else{if((c[p>>2]|0)==0?(c[n>>2]|0)>>>0<(c[l>>2]|0)>>>0:0){f=12;break}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0:0){m=(c[j>>2]|0)+8|0;c[d>>2]=TB(c[c[j>>2]>>2]|0,c[b>>2]|0,(c[j>>2]|0)+32|0,c[m>>2]|0,c[m+4>>2]|0)|0;c[h>>2]=0}if(c[h>>2]|0){qB(c[b>>2]|0);c[e>>2]=c[d>>2];m=c[e>>2]|0;i=f;return m|0}}if(!(c[d>>2]|0))c[d>>2]=UB(c[b>>2]|0,g)|0;if(!(c[d>>2]|0)){c[(c[b>>2]|0)+20>>2]=c[g>>2];c[d>>2]=VB(c[b>>2]|0,c[g>>2]|0,(c[b>>2]|0)+32|0)|0}c[e>>2]=c[d>>2];m=c[e>>2]|0;i=f;return m|0}function SB(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;c[d>>2]=0;c[d>>2]=YB(c[e>>2]|0)|0;f=(c[e>>2]|0)+32|0;a=(c[e>>2]|0)+48|0;c[f+0>>2]=c[a+0>>2];c[f+4>>2]=c[a+4>>2];c[f+8>>2]=c[a+8>>2];c[f+12>>2]=c[a+12>>2];f=(c[e>>2]|0)+40|0;a=(c[e>>2]|0)+8|0;if(!((c[f>>2]|0)==(c[a>>2]|0)?(c[f+4>>2]|0)==(c[a+4>>2]|0):0)){f=c[d>>2]|0;i=b;return f|0}c[(c[e>>2]|0)+20>>2]=1;f=c[d>>2]|0;i=b;return f|0}function TB(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;n=i;i=i+48|0;h=n+36|0;o=n+32|0;m=n+28|0;q=n+24|0;p=n;j=n+20|0;l=n+16|0;k=n+12|0;g=n+8|0;c[o>>2]=a;c[m>>2]=b;c[q>>2]=d;a=p;c[a>>2]=e;c[a+4>>2]=f;c[j>>2]=0;if(jg(201)|0){c[h>>2]=266;a=c[h>>2]|0;i=n;return a|0}if(c[(c[m>>2]|0)+44>>2]|0){hj(c[(c[m>>2]|0)+24>>2]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[h>>2]=c[j>>2];a=c[h>>2]|0;i=n;return a|0}function UB(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;h=i;i=i+48|0;n=h+24|0;j=h+20|0;k=h+16|0;m=h+12|0;o=h+32|0;p=h+8|0;l=h+4|0;f=h;c[j>>2]=b;c[k>>2]=e;b=c[j>>2]|0;e=c[b>>2]|0;b=c[b+4>>2]|0;do if(c[(c[j>>2]|0)+44>>2]|0){e=(Jw((c[(c[j>>2]|0)+44>>2]|0)+e|0,c[k>>2]|0)|0)&255;b=c[j>>2]|0;p=b;e=bF(c[p>>2]|0,c[p+4>>2]|0,e|0,0)|0;c[b>>2]=e;c[b+4>>2]=D}else{q=c[(c[j>>2]|0)+40>>2]|0;b=kF(e|0,b|0,q|0,((q|0)<0)<<31>>31|0)|0;c[m>>2]=b;if((c[m>>2]|0)!=0?((c[(c[j>>2]|0)+40>>2]|0)-(c[m>>2]|0)|0)>=9:0){b=(Jw((c[(c[j>>2]|0)+36>>2]|0)+(c[m>>2]|0)|0,c[k>>2]|0)|0)&255;q=c[j>>2]|0;e=q;b=bF(c[e>>2]|0,c[e+4>>2]|0,b|0,0)|0;c[q>>2]=b;c[q+4>>2]=D;break}c[l>>2]=0;while(1){c[f>>2]=VB(c[j>>2]|0,1,p)|0;if(c[f>>2]|0)break;b=a[c[p>>2]>>0]|0;q=c[l>>2]|0;c[l>>2]=q+1;a[o+(q&15)>>0]=b;if(!((d[c[p>>2]>>0]|0)&128)){g=10;break}}if((g|0)==10){Jw(o,c[k>>2]|0)|0;break}c[n>>2]=c[f>>2];q=c[n>>2]|0;i=h;return q|0}while(0);c[n>>2]=0;q=c[n>>2]|0;i=h;return q|0}function VB(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;q=i;i=i+64|0;g=q+52|0;h=q+48|0;j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c[a>>2]|0,c[a+4>>2]|0,v|0,((v|0)<0)<<31>>31|0)|0;c[w>>2]=v;c[w+4>>2]=D}else{do if((c[(c[h>>2]|0)+16>>2]|0)<(c[j>>2]|0)){if(128>(c[(c[h>>2]|0)+16>>2]<<1|0))t=128;else t=c[(c[h>>2]|0)+16>>2]<<1;c[r>>2]=t;while(1){if((c[j>>2]|0)<=(c[r>>2]|0))break;c[r>>2]=c[r>>2]<<1}w=c[r>>2]|0;c[s>>2]=kc(c[(c[h>>2]|0)+28>>2]|0,w,((w|0)<0)<<31>>31)|0;if(c[s>>2]|0){c[(c[h>>2]|0)+16>>2]=c[r>>2];c[(c[h>>2]|0)+28>>2]=c[s>>2];break}c[g>>2]=7;w=c[g>>2]|0;i=q;return w|0}while(0);dF(c[(c[h>>2]|0)+28>>2]|0,(c[(c[h>>2]|0)+36>>2]|0)+(c[n>>2]|0)|0,c[e>>2]|0)|0;v=c[e>>2]|0;w=c[h>>2]|0;a=w;v=bF(c[a>>2]|0,c[a+4>>2]|0,v|0,((v|0)<0)<<31>>31|0)|0;c[w>>2]=v;c[w+4>>2]=D;c[o>>2]=(c[j>>2]|0)-(c[e>>2]|0);while(1){if((c[o>>2]|0)<=0){f=27;break}c[p>>2]=c[o>>2];if((c[o>>2]|0)>(c[(c[h>>2]|0)+40>>2]|0))c[p>>2]=c[(c[h>>2]|0)+40>>2];c[l>>2]=VB(c[h>>2]|0,c[p>>2]|0,m)|0;if(c[l>>2]|0)break;dF((c[(c[h>>2]|0)+28>>2]|0)+((c[j>>2]|0)-(c[o>>2]|0))|0,c[m>>2]|0,c[p>>2]|0)|0;c[o>>2]=(c[o>>2]|0)-(c[p>>2]|0)}if((f|0)==27){c[c[k>>2]>>2]=c[(c[h>>2]|0)+28>>2];break}c[g>>2]=c[l>>2];w=c[g>>2]|0;i=q;return w|0}while(0);c[g>>2]=0;w=c[g>>2]|0;i=q;return w|0}function WB(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0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>2]|0)+12>>2]|0)+((c[(c[(c[m>>2]|0)+8>>2]|0)+4>>2]|0)*56|0);c[j>>2]=c[(c[n>>2]|0)+20>>2];r=e+24|0;q=c[e+16>>2]|0;q=bF(c[r>>2]|0,c[r+4>>2]|0,q|0,((q|0)<0)<<31>>31|0)|0;r=b;c[r>>2]=q;c[r+4>>2]=D;if(!(c[(c[n>>2]|0)+24>>2]|0))break;a=b;p=c[j>>2]|0;p=bF(c[a>>2]|0,c[a+4>>2]|0,p|0,((p|0)<0)<<31>>31|0)|0;a=D;q=c[j>>2]|0;q=Zw(q,((q|0)<0)<<31>>31)|0;q=bF(p|0,a|0,q|0,((q|0)<0)<<31>>31|0)|0;a=D;p=k;r=c[(c[l>>2]|0)+16>>2]|0;r=bF(c[p>>2]|0,c[p+4>>2]|0,r|0,((r|0)<0)<<31>>31|0)|0;p=D;if((a|0)>(p|0)|(a|0)==(p|0)&q>>>0>r>>>0)break;r=c[j>>2]|0;JB(e,r,((r|0)<0)<<31>>31);KB(e,c[(c[n>>2]|0)+32>>2]|0,c[j>>2]|0);c[h>>2]=QB(c[(c[l>>2]|0)+4>>2]|0,o)|0}c[g>>2]=LB(e,(c[f>>2]|0)+8|0)|0;if(c[h>>2]|0){r=c[h>>2]|0;i=d;return r|0}c[h>>2]=c[g>>2];r=c[h>>2]|0;i=d;return r|0}function ZB(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;d=i;i=i+16|0;f=d+12|0;b=d+8|0;g=d+4|0;e=d;c[f>>2]=a;c[g>>2]=(c[f>>2]|0)+64;c[e>>2]=0;c[b>>2]=_B(c[f>>2]|0,e)|0;if(!(c[b>>2]|0)){c[b>>2]=$B(c[g>>2]|0,c[e>>2]|0,0)|0;c[(c[f>>2]|0)+20>>2]=c[e>>2];c[e>>2]=0}if(!(c[b>>2]|0)){g=c[b>>2]|0;i=d;return g|0}mB(c[e>>2]|0);g=c[b>>2]|0;i=d;return g|0}function _B(a,b){a=a|0;b=b|0;var e=0,f=0,g=0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;t=c[m>>2]|0;c[t>>2]=a;t=c[g>>2]|0;i=h;return t|0}function $B(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;j=i;i=i+32|0;h=j+24|0;l=j+20|0;f=j+16|0;m=j+8|0;k=j+4|0;n=j;c[l>>2]=a;c[f>>2]=b;c[j+12>>2]=e;c[m>>2]=0;c[n>>2]=c[c[f>>2]>>2];c[(c[f>>2]|0)+4>>2]=c[l>>2];c[k>>2]=0;while(1){if((c[k>>2]|0)>=(c[n>>2]|0))break;c[m>>2]=aC((c[(c[f>>2]|0)+12>>2]|0)+((c[k>>2]|0)*56|0)|0,0)|0;if(c[m>>2]|0){g=4;break}c[k>>2]=(c[k>>2]|0)+1}if((g|0)==4){c[h>>2]=c[m>>2];a=c[h>>2]|0;i=j;return a|0}c[k>>2]=(c[c[f>>2]>>2]|0)-1;while(1){if((c[k>>2]|0)<=0)break;bC(c[f>>2]|0,c[k>>2]|0);c[k>>2]=(c[k>>2]|0)+ -1}c[h>>2]=d[(c[(c[l>>2]|0)+12>>2]|0)+7>>0];a=c[h>>2]|0;i=j;return a|0}function aC(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;d=i;i=i+32|0;k=d+24|0;l=d+20|0;e=d+16|0;g=d+12|0;f=d+8|0;j=d+4|0;h=d;c[k>>2]=a;c[l>>2]=b;c[e>>2]=0;c[g>>2]=c[(c[k>>2]|0)+48>>2];if(!(c[g>>2]|0)){a=c[e>>2]|0;i=d;return a|0}c[f>>2]=c[c[g>>2]>>2];c[j>>2]=c[(c[(c[f>>2]|0)+8>>2]|0)+24>>2];c[e>>2]=$B(c[f>>2]|0,c[(c[g>>2]|0)+4>>2]|0,c[l>>2]|0)|0;if(!(c[e>>2]|0)){c[h>>2]=c[(c[g>>2]|0)+16>>2];if(!(c[(c[f>>2]|0)+48>>2]|0)){a=(c[f>>2]|0)+56|0;c[e>>2]=GB(c[j>>2]|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]|0,c[(c[k>>2]|0)+20>>2]|0)|0;if((c[l>>2]|0)<=0){c[j>>2]=c[h>>2];break}else{c[j>>2]=c[m>>2];break}}else c[j>>2]=c[m>>2];while(0);c[(c[(c[e>>2]|0)+8>>2]|0)+(c[f>>2]<<2)>>2]=c[j>>2];i=g;return}function cC(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0;b=i;i=i+16|0;f=b+12|0;d=b+8|0;e=b;c[f>>2]=a;c[d>>2]=0;a=e;c[a>>2]=16;c[a+4>>2]=0;while(1){g=e;j=c[g+4>>2]|0;a=c[f>>2]|0;h=((a|0)<0)<<31>>31;if(!((j|0)<(h|0)|((j|0)==(h|0)?(c[g>>2]|0)>>>0<a>>>0:0)))break;h=e;h=lF(c[h>>2]|0,c[h+4>>2]|0,16,0)|0;j=e;c[j>>2]=h;c[j+4>>2]=D;c[d>>2]=(c[d>>2]|0)+1}i=b;return c[d>>2]|0}function dC(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;j=i;i=i+48|0;p=j+44|0;n=j+40|0;g=j+36|0;l=j+32|0;k=j+28|0;m=j+8|0;f=j+24|0;h=j+20|0;q=j;o=j+16|0;c[p>>2]=a;c[n>>2]=b;c[g>>2]=d;c[l>>2]=e;d=c[g>>2]|0;b=c[d+4>>2]|0;a=m;c[a>>2]=c[d>>2];c[a+4>>2]=b;c[h>>2]=0;a=eC(c[n>>2]|0)|0;c[k>>2]=a;c[c[l>>2]>>2]=a;if(!(c[k>>2]|0))c[h>>2]=7;c[f>>2]=0;while(1){if(!((c[h>>2]|0)==0?(c[f>>2]|0)<(c[n>>2]|0):0))break;c[o>>2]=(c[(c[k>>2]|0)+12>>2]|0)+((c[f>>2]|0)*56|0);d=m;c[h>>2]=hC(c[p>>2]|0,(c[p>>2]|0)+32|0,c[d>>2]|0,c[d+4>>2]|0,c[o>>2]|0,q)|0;d=(c[o>>2]|0)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h>>2]=0;c[o>>2]=1;c[k>>2]=c[u>>2];c[h>>2]=gC(c[p>>2]|0,c[t>>2]|0,m)|0;c[r>>2]=1;while(1){if((c[r>>2]|0)>=(c[s>>2]|0))break;c[o>>2]=c[o>>2]<<4;c[r>>2]=(c[r>>2]|0)+1}c[r>>2]=1;while(1){if(!((c[h>>2]|0)==0?(c[r>>2]|0)<(c[s>>2]|0):0))break;c[q>>2]=((c[g>>2]|0)/(c[o>>2]|0)|0|0)%16|0;c[n>>2]=(c[(c[k>>2]|0)+12>>2]|0)+((c[q>>2]|0)*56|0);do if(!(c[(c[n>>2]|0)+48>>2]|0)){c[l>>2]=eC(16)|0;if(!(c[l>>2]|0)){c[h>>2]=7;break}else{c[h>>2]=gC(c[p>>2]|0,c[l>>2]|0,(c[n>>2]|0)+48|0)|0;break}}while(0);if(!(c[h>>2]|0)){c[k>>2]=c[(c[(c[n>>2]|0)+48>>2]|0)+4>>2];c[o>>2]=(c[o>>2]|0)/16|0}c[r>>2]=(c[r>>2]|0)+1}l=c[m>>2]|0;if(!(c[h>>2]|0)){c[(c[(c[k>>2]|0)+12>>2]|0)+(((c[g>>2]|0)%16|0)*56|0)+48>>2]=l;u=c[h>>2]|0;i=j;return u|0}else{rB(l);u=c[h>>2]|0;i=j;return u|0}return 0}function gC(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+32|0;g=e+16|0;j=e+12|0;k=e+8|0;h=e+4|0;f=e;c[g>>2]=a;c[j>>2]=b;c[k>>2]=d;c[h>>2]=0;if(jg(100)|0)d=0;else d=Mc(64,0)|0;c[c[k>>2]>>2]=d;c[f>>2]=d;j=c[j>>2]|0;if(!(c[f>>2]|0)){mB(j);c[h>>2]=7;a=c[h>>2]|0;i=e;return a|0}c[(c[f>>2]|0)+4>>2]=j;c[c[f>>2]>>2]=c[g>>2];j=c[(c[g>>2]|0)+8>>2]|0;if(((c[(c[(c[g>>2]|0)+8>>2]|0)+8>>2]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(c[c[f>>2]>>2]|0,g)|0;c[(c[f>>2]|0)+60>>2]=0;if(!(c[g>>2]|0)){g=c[e>>2]|0;i=d;return g|0}a[(c[f>>2]|0)+25>>0]=1;g=c[e>>2]|0;i=d;return g|0}function kC(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0;h=i;i=i+16|0;g=h+12|0;j=h+8|0;e=h+4|0;f=h;c[j>>2]=a;c[e>>2]=b;if((d[(c[j>>2]|0)+73>>0]|0|0)>=3)b=vw(c[j>>2]|0)|0;else b=0;c[f>>2]=b;if(c[f>>2]|0){c[c[e>>2]>>2]=1;c[g>>2]=c[f>>2];a=c[g>>2]|0;i=h;return a|0}if((d[(c[j>>2]|0)+73>>0]|0|0)==1?(c[(c[j>>2]|0)+68>>2]|0)==0:0)c[c[e>>2]>>2]=0;else c[c[e>>2]>>2]=1;c[g>>2]=0;a=c[g>>2]|0;i=h;return a|0}function lC(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;j=e+12|0;h=e+8|0;f=e+4|0;g=e;c[j>>2]=b;c[h>>2]=d;d=c[j>>2]|0;if(a[(c[j>>2]|0)+56>>0]|0){c[g>>2]=(c[(c[(c[j>>2]|0)+20>>2]|0)+12>>2]|0)+((c[(c[(c[d+20>>2]|0)+8>>2]|0)+4>>2]|0)*56|0);c[c[h>>2]>>2]=c[(c[g>>2]|0)+20>>2];c[f>>2]=c[(c[g>>2]|0)+32>>2];b=c[f>>2]|0;i=e;return b|0}else{c[c[h>>2]>>2]=c[c[d+36>>2]>>2];c[f>>2]=(c[(c[j>>2]|0)+36>>2]|0)+8;b=c[f>>2]|0;i=e;return b|0}return 0}function mC(f,g,h,j){f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;q=i;i=i+48|0;n=q+32|0;p=q+28|0;t=q+24|0;m=q+20|0;s=q+16|0;k=q+12|0;o=q+8|0;l=q+4|0;r=q;c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]|0)-1<<1)+1>>0]));c[n>>2]=(c[m>>2]|0)+9;do{f=c[m>>2]|0;c[m>>2]=f+1;if(!(d[f>>0]&128))break}while((c[m>>2]|0)>>>0<(c[n>>2]|0)>>>0);c[n>>2]=(c[m>>2]|0)+9;do{f=c[m>>2]|0;c[m>>2]=f+1;f=a[f>>0]|0;g=c[v>>2]|0;c[v>>2]=g+1;a[g>>0]=f;if(!(f&128))break}while((c[m>>2]|0)>>>0<(c[n>>2]|0)>>>0);nC(c[s>>2]|0,e[(c[s>>2]|0)+18>>1]|0,c[u>>2]|0,(c[v>>2]|0)-(c[u>>2]|0)|0,0,c[(c[l>>2]|0)+72>>2]|0,p);ck((c[(c[s>>2]|0)+56>>2]|0)+((d[(c[s>>2]|0)+6>>0]|0)+8)|0,c[r>>2]|0);Rk(c[o>>2]|0)}c[k>>2]=c[p>>2];f=c[k>>2]|0;i=q;return f|0}function rC(f,g,h,j,k){f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0;m=i;i=i+352|0;I=m+328|0;R=m+324|0;wa=m+320|0;V=m+316|0;X=m+312|0;ba=m+308|0;u=m+304|0;H=m+300|0;ta=m+296|0;o=m+292|0;q=m+288|0;n=m+284|0;E=m+280|0;w=m+276|0;P=m+272|0;y=m+268|0;v=m+338|0;l=m+264|0;ia=m+260|0;M=m+256|0;ha=m+252|0;qa=m+248|0;N=m+244|0;ua=m+240|0;r=m+228|0;F=m+216|0;p=m+196|0;W=m+192|0;sa=m+184|0;z=m+160|0;ga=m+140|0;s=m+136|0;J=m+132|0;pa=m+128|0;aa=m+124|0;va=m+120|0;ka=m+116|0;ja=m+112|0;la=m+108|0;ma=m+336|0;na=m+334|0;oa=m+332|0;ra=m+104|0;ca=m+100|0;ea=m+96|0;fa=m+92|0;da=m+88|0;_=m+84|0;Z=m+80|0;Y=m+76|0;U=m+72|0;S=m+68|0;Q=m+64|0;K=m+60|0;O=m+56|0;T=m;L=m+52|0;x=m+48|0;D=m+44|0;C=m+40|0;G=m+36|0;A=m+32|0;B=m+28|0;t=m+24|0;c[R>>2]=f;c[wa>>2]=g;c[V>>2]=h;c[X>>2]=j;c[ba>>2]=k;c[H>>2]=0;c[ta>>2]=0;c[o>>2]=0;c[y>>2]=0;c[qa>>2]=0;c[N>>2]=0;c[s>>2]=0;c[u>>2]=c[(c[R>>2]|0)+52>>2];if(!(c[V>>2]|0)){c[I>>2]=7;f=c[I>>2]|0;i=m;return f|0}c[n>>2]=(d[(c[R>>2]|0)+1>>0]|0)+(e[(c[R>>2]|0)+18>>1]|0);if((c[n>>2]|0)<2)c[P>>2]=0;else{do if(c[wa>>2]|0)if((c[wa>>2]|0)==(c[n>>2]|0)){c[P>>2]=(c[n>>2]|0)-2+(c[ba>>2]|0);break}else{c[P>>2]=(c[wa>>2]|0)-1;break}else c[P>>2]=0;while(0);c[n>>2]=2-(c[ba>>2]|0)}c[q>>2]=(c[n>>2]|0)+1;k=c[R>>2]|0;if(((c[n>>2]|0)+(c[P>>2]|0)-(d[(c[R>>2]|0)+1>>0]|0)|0)==(e[(c[R>>2]|0)+18>>1]|0))c[W>>2]=(c[(c[R>>2]|0)+56>>2]|0)+((d[k+6>>0]|0)+8);else c[W>>2]=(c[k+56>>2]|0)+(e[(c[R>>2]|0)+20>>1]&(d[(c[(c[R>>2]|0)+64>>2]|0)+((c[n>>2]|0)+(c[P>>2]|0)-(d[(c[R>>2]|0)+1>>0]|0)<<1)>>0]<<8|d[(c[(c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n>>2]<<2)>>2]|0)|0;yA(g,f,5,c[(c[x>>2]|0)+72>>2]|0,y)}if((e[(c[J>>2]|0)+(c[n>>2]<<1)>>1]|0)>(e[(c[x>>2]|0)+12>>1]|0))AA(c[x>>2]|0,c[(c[s>>2]|0)+(c[n>>2]<<2)>>2]|0,y)}while(0);c[n>>2]=(c[n>>2]|0)+1}if(!(b[v>>1]|0)){c[n>>2]=0;while(1){if((c[n>>2]|0)>=(c[o>>2]|0))break a;c[t>>2]=Hh((c[(c[p+(c[n>>2]<<2)>>2]|0)+56>>2]|0)+8|0)|0;yA(c[u>>2]|0,c[t>>2]|0,5,c[(c[p+(c[n>>2]<<2)>>2]|0)+72>>2]|0,y);c[n>>2]=(c[n>>2]|0)+1}}}}while(0);ng(c[s>>2]|0);c[n>>2]=0;while(1){if((c[n>>2]|0)>=(c[q>>2]|0))break;Rk(c[r+(c[n>>2]<<2)>>2]|0);c[n>>2]=(c[n>>2]|0)+1}c[n>>2]=0;while(1){if((c[n>>2]|0)>=(c[o>>2]|0))break;Rk(c[p+(c[n>>2]<<2)>>2]|0);c[n>>2]=(c[n>>2]|0)+1}c[I>>2]=c[y>>2];f=c[I>>2]|0;i=m;return f|0}function sC(a,b){a=a|0;b=b|0;var f=0,g=0,h=0,j=0,k=0,l=0;j=i;i=i+32|0;h=j+16|0;f=j+12|0;g=j+8|0;k=j+4|0;l=j;c[f>>2]=a;c[g>>2]=b;c[k>>2]=(d[(c[f>>2]|0)+1>>0]|0)-1;while(1){if((c[k>>2]|0)<0){b=8;break}c[l>>2]=e[(c[f>>2]|0)+22+(c[k>>2]<<1)>>1];if((c[l>>2]|0)<=(c[g>>2]|0)){if((c[l>>2]|0)==(c[g>>2]|0)){b=5;break}c[g>>2]=(c[g>>2]|0)+ -1}c[k>>2]=(c[k>>2]|0)+ -1}if((b|0)==5){c[h>>2]=c[(c[f>>2]|0)+32+(c[k>>2]<<2)>>2];a=c[h>>2]|0;i=j;return a|0}else if((b|0)==8){c[h>>2]=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=p+36|0;l=p+32|0;r=p+28|0;q=p+24|0;w=p+20|0;v=p+16|0;h=p+12|0;t=p+8|0;u=p+4|0;s=p;c[x>>2]=b;c[k>>2]=f;c[n>>2]=g;c[m>>2]=d[(c[x>>2]|0)+6>>0];c[l>>2]=c[(c[x>>2]|0)+56>>2];c[v>>2]=c[(c[(c[x>>2]|0)+52>>2]|0)+36>>2];c[q>>2]=(e[(c[x>>2]|0)+14>>1]|0)+((e[(c[x>>2]|0)+18>>1]|0)<<1);c[r>>2]=(d[(c[l>>2]|0)+((c[m>>2]|0)+5)>>0]|0)<<8|(d[(c[l>>2]|0)+((c[m>>2]|0)+5)+1>>0]|0);do if((c[q>>2]|0)>(c[r>>2]|0)){if(!(c[r>>2]|0)){c[r>>2]=65536;break}c[o>>2]=kj(53453)|0;b=c[o>>2]|0;i=p;return b|0}while(0);a:do if(((c[q>>2]|0)+2|0)<=(c[r>>2]|0)){if((d[(c[l>>2]|0)+((c[m>>2]|0)+1)>>0]|0|0)==0?(d[(c[l>>2]|0)+((c[m>>2]|0)+2)>>0]|0|0)==0:0){j=22;break}c[t>>2]=(c[m>>2]|0)+1;while(1){b=(d[(c[l>>2]|0)+(c[t>>2]|0)>>0]|0)<<8|(d[(c[l>>2]|0)+(c[t>>2]|0)+1>>0]|0);c[h>>2]=b;if((b|0)<=0){j=22;break a}if((c[h>>2]|0)>((c[v>>2]|0)-4|0)){j=12;break}if((c[h>>2]|0)<((c[t>>2]|0)+4|0)){j=12;break}c[u>>2]=(d[(c[l>>2]|0)+((c[h>>2]|0)+2)>>0]|0)<<8|(d[(c[l>>2]|0)+((c[h>>2]|0)+2)+1>>0]|0);if((c[u>>2]|0)>=(c[k>>2]|0))break;c[t>>2]=c[h>>2]}if((j|0)==12){c[o>>2]=kj(53469)|0;b=c[o>>2]|0;i=p;return b|0}c[s>>2]=(c[u>>2]|0)-(c[k>>2]|0);do if((c[s>>2]|0)<4){if((d[(c[l>>2]|0)+((c[m>>2]|0)+7)>>0]|0|0)>=60){j=23;break a}b=(c[l>>2]|0)+(c[t>>2]|0)|0;f=(c[l>>2]|0)+(c[h>>2]|0)|0;a[b+0>>0]=a[f+0>>0]|0;a[b+1>>0]=a[f+1>>0]|0;b=(c[l>>2]|0)+((c[m>>2]|0)+7)|0;a[b>>0]=(d[b>>0]|0)+(c[s>>2]&255)}else{if(((c[u>>2]|0)+(c[h>>2]|0)|0)<=(c[v>>2]|0)){a[(c[l>>2]|0)+((c[h>>2]|0)+2)>>0]=c[s>>2]>>8;a[(c[l>>2]|0)+((c[h>>2]|0)+2)+1>>0]=c[s>>2];break}c[o>>2]=kj(53483)|0;b=c[o>>2]|0;i=p;return b|0}while(0);c[c[n>>2]>>2]=(c[h>>2]|0)+(c[s>>2]|0);c[o>>2]=0;b=c[o>>2]|0;i=p;return b|0}else j=22;while(0);if((j|0)==22?((c[q>>2]|0)+2+(c[k>>2]|0)|0)>(c[r>>2]|0):0)j=23;do if((j|0)==23){c[w>>2]=wC(c[x>>2]|0)|0;if(!(c[w>>2]|0)){c[r>>2]=(((d[(c[l>>2]|0)+((c[m>>2]|0)+5)>>0]|0)<<8|(d[(c[l>>2]|0)+((c[m>>2]|0)+5)+1>>0]|0))-1&65535)+1;break}c[o>>2]=c[w>>2];b=c[o>>2]|0;i=p;return b|0}while(0);c[r>>2]=(c[r>>2]|0)-(c[k>>2]|0);a[(c[l>>2]|0)+((c[m>>2]|0)+5)>>0]=c[r>>2]>>8;a[(c[l>>2]|0)+((c[m>>2]|0)+5)+1>>0]=c[r>>2];c[c[n>>2]>>2]=c[r>>2];c[o>>2]=0;b=c[o>>2]|0;i=p;return b|0}function wC(b){b=b|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;f=i;i=i+64|0;m=f+56|0;l=f+52|0;t=f+48|0;o=f+44|0;j=f+40|0;n=f+36|0;p=f+32|0;s=f+28|0;g=f+24|0;v=f+20|0;h=f+16|0;q=f+12|0;k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m>>2]=kj(53393)|0;v=c[m>>2]|0;i=f;return v|0}else if((n|0)==10){a[(c[h>>2]|0)+((c[j>>2]|0)+5)>>0]=c[g>>2]>>8;a[(c[h>>2]|0)+((c[j>>2]|0)+5)+1>>0]=c[g>>2];a[(c[h>>2]|0)+((c[j>>2]|0)+1)>>0]=0;a[(c[h>>2]|0)+((c[j>>2]|0)+2)>>0]=0;a[(c[h>>2]|0)+((c[j>>2]|0)+7)>>0]=0;_E((c[h>>2]|0)+(c[k>>2]|0)|0,0,(c[g>>2]|0)-(c[k>>2]|0)|0)|0;if(((c[g>>2]|0)-(c[k>>2]|0)|0)!=(e[(c[l>>2]|0)+16>>1]|0|0)){c[m>>2]=kj(53410)|0;v=c[m>>2]|0;i=f;return v|0}else{c[m>>2]=0;v=c[m>>2]|0;i=f;return v|0}}return 0}function xC(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return c[(c[b>>2]|0)+200>>2]|0}function yC(f,g,h){f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;n=i;i=i+48|0;m=n+20|0;t=n+16|0;j=n+32|0;u=n+30|0;s=n+28|0;o=n+26|0;q=n+35|0;v=n+34|0;l=n+24|0;x=n+12|0;r=n+8|0;p=n+4|0;w=n;c[t>>2]=f;b[j>>1]=g;b[u>>1]=h;a[v>>0]=0;b[l>>1]=b[u>>1]|0;c[x>>2]=(c[(c[(c[t>>2]|0)+52>>2]|0)+36>>2]|0)-4;c[r>>2]=(e[j>>1]|0)+(e[u>>1]|0);c[p>>2]=c[(c[t>>2]|0)+56>>2];if((e[(c[(c[t>>2]|0)+52>>2]|0)+22>>1]|0)&4)_E((c[p>>2]|0)+(e[j>>1]|0)|0,0,e[u>>1]|0|0)|0;a[q>>0]=a[(c[t>>2]|0)+6>>0]|0;b[s>>1]=(d[q>>0]|0)+1;if((d[(c[p>>2]|0)+((e[s>>1]|0)+1)>>0]|0|0)==0?(d[(c[p>>2]|0)+(e[s>>1]|0)>>0]|0|0)==0:0)b[o>>1]=0;else k=6;do if((k|0)==6){while(1){k=0;f=((d[(c[p>>2]|0)+(e[s>>1]|0)>>0]|0)<<8|(d[(c[p>>2]|0)+(e[s>>1]|0)+1>>0]|0))&65535;b[o>>1]=f;if((f&65535|0)>0)g=(e[o>>1]|0|0)<(e[j>>1]|0|0);else g=0;h=e[o>>1]|0;if(!g)break;if((h|0)<((e[s>>1]|0)+4|0)){k=10;break}b[s>>1]=b[o>>1]|0;k=6}if((k|0)==10){c[m>>2]=kj(53568)|0;f=c[m>>2]|0;i=n;return f|0}if(h>>>0>(c[x>>2]|0)>>>0){c[m>>2]=kj(53571)|0;f=c[m>>2]|0;i=n;return f|0}do if((e[o>>1]|0|0)!=0?((c[r>>2]|0)+3|0)>>>0>=(e[o>>1]|0)>>>0:0){a[v>>0]=(e[o>>1]|0)-(c[r>>2]|0);if((c[r>>2]|0)>>>0<=(e[o>>1]|0)>>>0){c[r>>2]=(e[o>>1]|0)+((d[(c[p>>2]|0)+((e[o>>1]|0)+2)>>0]|0)<<8|(d[(c[p>>2]|0)+((e[o>>1]|0)+2)+1>>0]|0));b[u>>1]=(c[r>>2]|0)-(e[j>>1]|0);b[o>>1]=(d[(c[p>>2]|0)+(e[o>>1]|0)>>0]|0)<<8|(d[(c[p>>2]|0)+(e[o>>1]|0)+1>>0]|0);break}c[m>>2]=kj(53582)|0;f=c[m>>2]|0;i=n;return f|0}while(0);do if((e[s>>1]|0|0)>((d[q>>0]|0)+1|0)?(c[w>>2]=(e[s>>1]|0)+((d[(c[p>>2]|0)+((e[s>>1]|0)+2)>>0]|0)<<8|(d[(c[p>>2]|0)+((e[s>>1]|0)+2)+1>>0]|0)),((c[w>>2]|0)+3|0)>=(e[j>>1]|0|0)):0){if((c[w>>2]|0)<=(e[j>>1]|0|0)){a[v>>0]=(d[v>>0]|0)+((e[j>>1]|0)-(c[w>>2]|0));b[u>>1]=(c[r>>2]|0)-(e[s>>1]|0);b[j>>1]=b[s>>1]|0;break}c[m>>2]=kj(53595)|0;f=c[m>>2]|0;i=n;return f|0}while(0);if((d[v>>0]|0|0)<=(d[(c[p>>2]|0)+((d[q>>0]|0)+7)>>0]|0|0)){f=(c[p>>2]|0)+((d[q>>0]|0)+7)|0;a[f>>0]=(d[f>>0]|0)-(d[v>>0]|0);break}c[m>>2]=kj(53601)|0;f=c[m>>2]|0;i=n;return f|0}while(0);do if((e[j>>1]|0|0)==((d[(c[p>>2]|0)+((d[q>>0]|0)+5)>>0]|0)<<8|(d[(c[p>>2]|0)+((d[q>>0]|0)+5)+1>>0]|0)|0)){if((e[s>>1]|0|0)==((d[q>>0]|0)+1|0)){a[(c[p>>2]|0)+((d[q>>0]|0)+1)>>0]=(e[o>>1]|0)>>8;a[(c[p>>2]|0)+((d[q>>0]|0)+1)+1>>0]=b[o>>1];a[(c[p>>2]|0)+((d[q>>0]|0)+5)>>0]=(c[r>>2]|0)>>>8;a[(c[p>>2]|0)+((d[q>>0]|0)+5)+1>>0]=c[r>>2];break}c[m>>2]=kj(53608)|0;f=c[m>>2]|0;i=n;return f|0}else{a[(c[p>>2]|0)+(e[s>>1]|0)>>0]=(e[j>>1]|0)>>8;a[(c[p>>2]|0)+(e[s>>1]|0)+1>>0]=b[j>>1];a[(c[p>>2]|0)+(e[j>>1]|0)>>0]=(e[o>>1]|0)>>8;a[(c[p>>2]|0)+(e[j>>1]|0)+1>>0]=b[o>>1];a[(c[p>>2]|0)+((e[j>>1]|0)+2)>>0]=(e[u>>1]|0)>>8;a[(c[p>>2]|0)+((e[j>>1]|0)+2)+1>>0]=b[u>>1]}while(0);f=(c[t>>2]|0)+16|0;b[f>>1]=(e[f>>1]|0)+(e[l>>1]|0);c[m>>2]=0;f=c[m>>2]|0;i=n;return f|0}function zC(b,f,g,h,j,k,l,m,n){b=b|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;var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>2]|0)+36>>2]|0)-4}c[v>>2]=c[u>>2];if((c[v>>2]|0)>(c[w>>2]|0))c[v>>2]=c[w>>2];if((c[I>>2]|0)>0){if((c[v>>2]|0)>(c[I>>2]|0))c[v>>2]=c[I>>2];dF(c[z>>2]|0,c[G>>2]|0,c[v>>2]|0)|0}else _E(c[z>>2]|0,0,c[v>>2]|0)|0;c[u>>2]=(c[u>>2]|0)-(c[v>>2]|0);c[z>>2]=(c[z>>2]|0)+(c[v>>2]|0);c[G>>2]=(c[G>>2]|0)+(c[v>>2]|0);c[I>>2]=(c[I>>2]|0)-(c[v>>2]|0);c[w>>2]=(c[w>>2]|0)-(c[v>>2]|0);if(c[I>>2]|0)continue;c[I>>2]=c[H>>2];c[G>>2]=c[L>>2]}if((s|0)==26){Rk(c[q>>2]|0);c[r>>2]=c[p>>2];N=c[r>>2]|0;i=o;return N|0}else if((s|0)==37){Rk(c[q>>2]|0);c[r>>2]=0;N=c[r>>2]|0;i=o;return N|0}return 0}function AC(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;e=d+8|0;g=d+4|0;f=d;c[e>>2]=a;c[g>>2]=b;c[f>>2]=c[(c[g>>2]|0)+56>>2];if(!(c[f>>2]|0)){i=d;return}Sz(c[e>>2]|0,c[f>>2]|0);hc(c[(c[f>>2]|0)+40>>2]|0);Xb(c[e>>2]|0,c[f>>2]|0);c[(c[g>>2]|0)+56>>2]=0;i=d;return}function BC(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;j=i;i=i+64|0;o=j+44|0;n=j+40|0;u=j+36|0;m=j+32|0;h=j+28|0;k=j+24|0;g=j+20|0;p=j+16|0;l=j+12|0;s=j+8|0;t=j+4|0;q=j+48|0;r=j;c[n>>2]=b;c[u>>2]=e;c[m>>2]=f;c[h>>2]=c[(c[n>>2]|0)+4>>2];f=c[h>>2]|0;if(a[(c[h>>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p);if(c[p>>2]|0){Rk(c[k>>2]|0);c[o>>2]=c[p>>2];b=c[o>>2]|0;i=j;return b|0}c[p>>2]=bd(c[n>>2]|0,4,c[g>>2]|0)|0;if(c[p>>2]|0){Rk(c[k>>2]|0);c[o>>2]=c[p>>2];b=c[o>>2]|0;i=j;return b|0}}else{c[p>>2]=uA(f,k,g,1,0)|0;if(c[p>>2]|0){c[o>>2]=c[p>>2];b=c[o>>2]|0;i=j;return b|0}}if(c[m>>2]&1)c[l>>2]=13;else c[l>>2]=10;wB(c[k>>2]|0,c[l>>2]|0);_c(c[(c[k>>2]|0)+68>>2]|0);c[c[u>>2]>>2]=c[g>>2];c[o>>2]=0;b=c[o>>2]|0;i=j;return b|0}function CC(d,f,g,h,j){d=d|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;p=i;i=i+32|0;l=p+24|0;k=p+20|0;m=p+16|0;r=p+12|0;o=p+8|0;n=p+4|0;q=p;c[k>>2]=d;c[m>>2]=f;c[r>>2]=g;c[o>>2]=h;c[n>>2]=j;c[q>>2]=c[(c[k>>2]|0)+4>>2];if((c[r>>2]|0)!=0?((e[(c[q>>2]|0)+22>>1]|0)&1|0)!=0:0){c[l>>2]=8;d=c[l>>2]|0;i=p;return d|0}if((c[r>>2]|0)!=0?(DC(c[q>>2]|0),(c[(c[q>>2]|0)+80>>2]|0)==0):0){c[l>>2]=7;d=c[l>>2]|0;i=p;return d|0}if((c[m>>2]|0)==1?(Aw(c[q>>2]|0)|0)==0:0)c[m>>2]=0;c[(c[n>>2]|0)+60>>2]=c[m>>2];b[(c[n>>2]|0)+76>>1]=-1;c[(c[n>>2]|0)+16>>2]=c[o>>2];c[c[n>>2]>>2]=c[k>>2];c[(c[n>>2]|0)+4>>2]=c[q>>2];a[(c[n>>2]|0)+72>>0]=c[r>>2];c[(c[n>>2]|0)+8>>2]=c[(c[q>>2]|0)+8>>2];if(c[(c[n>>2]|0)+8>>2]|0)c[(c[(c[n>>2]|0)+8>>2]|0)+12>>2]=c[n>>2];c[(c[q>>2]|0)+8>>2]=c[n>>2];a[(c[n>>2]|0)+73>>0]=0;c[l>>2]=0;d=c[l>>2]|0;i=p;return d|0}function DC(b){b=b|0;var d=0,e=0;d=i;i=i+16|0;e=d;c[e>>2]=b;if(c[(c[e>>2]|0)+80>>2]|0){i=d;return}b=Hg(c[(c[e>>2]|0)+32>>2]|0)|0;c[(c[e>>2]|0)+80>>2]=b;if(!(c[(c[e>>2]|0)+80>>2]|0)){i=d;return}b=c[(c[e>>2]|0)+80>>2]|0;a[b+0>>0]=0;a[b+1>>0]=0;a[b+2>>0]=0;a[b+3>>0]=0;a[b+4>>0]=0;a[b+5>>0]=0;a[b+6>>0]=0;a[b+7>>0]=0;e=(c[e>>2]|0)+80|0;c[e>>2]=(c[e>>2]|0)+4;i=d;return}function EC(){return 200}function FC(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;d=(c[d>>2]|0)+0|0;a=d+76|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(a|0));i=b;return}function GC(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;e=i;i=i+32|0;f=e+24|0;h=e+20|0;l=e+16|0;g=e+12|0;m=e+8|0;k=e+4|0;j=e;c[h>>2]=a;c[l>>2]=b;c[g>>2]=0;c[m>>2]=c[(c[h>>2]|0)+96>>2];a:do if((c[l>>2]|0)>(c[m>>2]|0)?(d[(c[h>>2]|0)+6>>0]|0|0)!=0:0){c[j>>2]=kc(c[(c[h>>2]|0)+92>>2]|0,(c[l>>2]|0)*48|0,0)|0;if(!(c[j>>2]|0)){c[f>>2]=7;a=c[f>>2]|0;i=e;return a|0}_E((c[j>>2]|0)+((c[m>>2]|0)*48|0)|0,0,((c[l>>2]|0)-(c[m>>2]|0)|0)*48|0)|0;c[(c[h>>2]|0)+92>>2]=c[j>>2];c[k>>2]=c[m>>2];while(1){if((c[k>>2]|0)>=(c[l>>2]|0))break a;c[(c[j>>2]|0)+((c[k>>2]|0)*48|0)+20>>2]=c[(c[h>>2]|0)+24>>2];if((c[c[(c[h>>2]|0)+64>>2]>>2]|0)!=0?(a=(c[h>>2]|0)+72|0,m=c[a+4>>2]|0,(m|0)>0|(m|0)==0&(c[a>>2]|0)>>>0>0):0){b=(c[h>>2]|0)+72|0;m=c[b+4>>2]|0;a=(c[j>>2]|0)+((c[k>>2]|0)*48|0)|0;c[a>>2]=c[b>>2];c[a+4>>2]=m}else{a=(c[j>>2]|0)+((c[k>>2]|0)*48|0)|0;c[a>>2]=c[(c[h>>2]|0)+148>>2];c[a+4>>2]=0}c[(c[j>>2]|0)+((c[k>>2]|0)*48|0)+24>>2]=c[(c[h>>2]|0)+52>>2];a=Vg(c[(c[h>>2]|0)+24>>2]|0)|0;c[(c[j>>2]|0)+((c[k>>2]|0)*48|0)+16>>2]=a;if(!(c[(c[j>>2]|0)+((c[k>>2]|0)*48|0)+16>>2]|0))break;if(ai(c[h>>2]|0)|0)HC(c[(c[h>>2]|0)+208>>2]|0,(c[j>>2]|0)+((c[k>>2]|0)*48|0)+28|0);c[(c[h>>2]|0)+96>>2]=(c[k>>2]|0)+1;c[k>>2]=(c[k>>2]|0)+1}c[f>>2]=7;a=c[f>>2]|0;i=e;return a|0}while(0);c[f>>2]=c[g>>2];a=c[f>>2]|0;i=e;return a|0}function HC(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;c[c[e>>2]>>2]=c[(c[f>>2]|0)+68>>2];c[(c[e>>2]|0)+4>>2]=c[(c[f>>2]|0)+76>>2];c[(c[e>>2]|0)+8>>2]=c[(c[f>>2]|0)+80>>2];c[(c[e>>2]|0)+12>>2]=c[(c[f>>2]|0)+104>>2];i=d;return}function IC(f){f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;g=i;i=i+32|0;h=g+16|0;j=g+12|0;l=g+8|0;k=g+4|0;m=g;c[j>>2]=f;if((c[(c[j>>2]|0)+44>>2]|0)>>>0>0){c[h>>2]=0;n=c[h>>2]|0;i=g;return n|0}c[l>>2]=c[(c[j>>2]|0)+12>>2];c[k>>2]=c[(c[l>>2]|0)+56>>2];c[m>>2]=gd(c[(c[l>>2]|0)+68>>2]|0)|0;if(c[m>>2]|0){c[h>>2]=c[m>>2];n=c[h>>2]|0;i=g;return n|0}else{n=(c[k>>2]|0)+0|0;m=34408|0;f=n+16|0;do{a[n>>0]=a[m>>0]|0;n=n+1|0;m=m+1|0}while((n|0)<(f|0));a[(c[k>>2]|0)+16>>0]=(c[(c[j>>2]|0)+32>>2]|0)>>>8;a[(c[k>>2]|0)+17>>0]=(c[(c[j>>2]|0)+32>>2]|0)>>>16;a[(c[k>>2]|0)+18>>0]=1;a[(c[k>>2]|0)+19>>0]=1;a[(c[k>>2]|0)+20>>0]=(c[(c[j>>2]|0)+32>>2]|0)-(c[(c[j>>2]|0)+36>>2]|0);a[(c[k>>2]|0)+21>>0]=64;a[(c[k>>2]|0)+22>>0]=32;a[(c[k>>2]|0)+23>>0]=32;n=(c[k>>2]|0)+24|0;f=n+76|0;do{a[n>>0]=0;n=n+1|0}while((n|0)<(f|0));wB(c[l>>2]|0,13);n=(c[j>>2]|0)+22|0;b[n>>1]=e[n>>1]|0|2;ck((c[k>>2]|0)+52|0,d[(c[j>>2]|0)+17>>0]|0);ck((c[k>>2]|0)+64|0,d[(c[j>>2]|0)+18>>0]|0);c[(c[j>>2]|0)+44>>2]=1;a[(c[k>>2]|0)+31>>0]=1;c[h>>2]=0;n=c[h>>2]|0;i=g;return n|0}return 0}function JC(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;h=i;i=i+48|0;l=h+24|0;g=h+20|0;k=h;j=h+16|0;n=h+12|0;m=h+8|0;o=h+28|0;c[g>>2]=b;b=k;c[b>>2]=e;c[b+4>>2]=f;if(0!=0?1:(c[k+4>>2]&-16777216|0)!=0){a[(c[g>>2]|0)+8>>0]=c[k>>2];e=k;e=cF(c[e>>2]|0,c[e+4>>2]|0,8)|0;b=k;c[b>>2]=e;c[b+4>>2]=D;c[j>>2]=7;while(1){if((c[j>>2]|0)<0)break;a[(c[g>>2]|0)+(c[j>>2]|0)>>0]=c[k>>2]&127|128;e=k;e=cF(c[e>>2]|0,c[e+4>>2]|0,7)|0;b=k;c[b>>2]=e;c[b+4>>2]=D;c[j>>2]=(c[j>>2]|0)+ -1}c[l>>2]=9;b=c[l>>2]|0;i=h;return b|0}c[m>>2]=0;do{b=(c[k>>2]&127|128)&255;e=c[m>>2]|0;c[m>>2]=e+1;a[o+e>>0]=b;e=k;e=cF(c[e>>2]|0,c[e+4>>2]|0,7)|0;b=k;c[b>>2]=e;c[b+4>>2]=D;b=k}while((c[b>>2]|0)!=0|(c[b+4>>2]|0)!=0);a[o>>0]=(d[o>>0]|0)&127;c[j>>2]=0;c[n>>2]=(c[m>>2]|0)-1;while(1){if((c[n>>2]|0)<0)break;a[(c[g>>2]|0)+(c[j>>2]|0)>>0]=a[o+(c[n>>2]|0)>>0]|0;c[n>>2]=(c[n>>2]|0)+ -1;c[j>>2]=(c[j>>2]|0)+1}c[l>>2]=c[m>>2];b=c[l>>2]|0;i=h;return b|0}function KC(a,b){a=a|0;b=b|0;var d=0,f=0,g=0;f=i;i=i+16|0;d=f+4|0;g=f;c[d>>2]=a;c[g>>2]=b;c[c[g>>2]>>2]=e[(c[d>>2]|0)+40>>1];i=f;return c[(c[d>>2]|0)+32>>2]|0}function LC(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;e=d+12|0;g=d+8|0;h=d+4|0;f=d;c[g>>2]=b;b=(c[g>>2]|0)+48|0;c[f>>2]=Gw(c[c[g>>2]>>2]|0,0,c[b>>2]|0,c[b+4>>2]|0,0,h)|0;if(c[f>>2]|0){c[e>>2]=c[f>>2];h=c[e>>2]|0;i=d;return h|0}if(c[h>>2]|0){c[e>>2]=kj(65954)|0;h=c[e>>2]|0;i=d;return h|0}else{a[(c[g>>2]|0)+26>>0]=0;c[(c[g>>2]|0)+60>>2]=0;c[e>>2]=0;h=c[e>>2]|0;i=d;return h|0}return 0}function MC(d){d=d|0;var e=0,f=0,g=0;e=i;i=i+16|0;f=e+4|0;g=e;c[g>>2]=d;if(!(Lm(c[(c[g>>2]|0)+16>>2]|0,c[g>>2]|0,c[(c[g>>2]|0)+12>>2]|0,a[(c[g>>2]|0)+10>>0]|0)|0)){b[f>>1]=0;g=b[f>>1]|0;i=e;return g|0}if(!(wg(c[(c[g>>2]|0)+16>>2]|0,c[g>>2]|0,c[(c[g>>2]|0)+12>>2]|0,a[(c[g>>2]|0)+10>>0]|0)|0)){b[f>>1]=4;g=b[f>>1]|0;i=e;return g|0}else{b[f>>1]=8;g=b[f>>1]|0;i=e;return g|0}return 0}function NC(d){d=d|0;var f=0,g=0,h=0;f=i;i=i+16|0;g=f+4|0;h=f;c[h>>2]=d;if(Dk(c[h>>2]|0,(c[(c[h>>2]|0)+12>>2]|0)+2|0,1)|0){c[g>>2]=7;h=c[g>>2]|0;i=f;return h|0}else{a[(c[(c[h>>2]|0)+16>>2]|0)+(c[(c[h>>2]|0)+12>>2]|0)>>0]=0;a[(c[(c[h>>2]|0)+16>>2]|0)+((c[(c[h>>2]|0)+12>>2]|0)+1)>>0]=0;h=(c[h>>2]|0)+8|0;b[h>>1]=e[h>>1]|0|512;c[g>>2]=0;h=c[g>>2]|0;i=f;return h|0}return 0}function OC(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;e=i;i=i+32|0;b=e+16|0;h=e+12|0;g=e+8|0;f=e+4|0;d=e;c[b>>2]=a;if(c[(c[b>>2]|0)+176>>2]|0){c[h>>2]=c[(c[b>>2]|0)+176>>2];while(1){a=c[h>>2]|0;if(!(c[(c[h>>2]|0)+4>>2]|0))break;c[h>>2]=c[a+4>>2]}_y(a)|0;c[(c[b>>2]|0)+176>>2]=0;c[(c[b>>2]|0)+184>>2]=0}a:do if(c[(c[b>>2]|0)+56>>2]|0){c[g>>2]=0;while(1){if((c[g>>2]|0)>=(c[(c[b>>2]|0)+36>>2]|0))break a;c[f>>2]=c[(c[(c[b>>2]|0)+56>>2]|0)+(c[g>>2]<<2)>>2];if(c[f>>2]|0){Az(c[b>>2]|0,c[f>>2]|0);c[(c[(c[b>>2]|0)+56>>2]|0)+(c[g>>2]<<2)>>2]=0}c[g>>2]=(c[g>>2]|0)+1}}while(0);if(c[(c[b>>2]|0)+8>>2]|0)hu((c[(c[b>>2]|0)+8>>2]|0)+40|0,c[(c[b>>2]|0)+28>>2]|0);while(1){f=c[b>>2]|0;if(!(c[(c[b>>2]|0)+180>>2]|0))break;c[d>>2]=c[f+180>>2];c[(c[b>>2]|0)+180>>2]=c[(c[d>>2]|0)+4>>2];WC(c[d>>2]|0)}if(!(c[f+204>>2]|0)){i=e;return}hz(c[b>>2]|0,-1,0);i=e;return}function PC(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0;g=i;i=i+112|0;x=g+8|0;f=g+104|0;h=g+100|0;F=g+96|0;j=g+92|0;B=g+88|0;s=g+84|0;C=g+80|0;E=g+76|0;l=g+72|0;k=g+68|0;o=g+64|0;q=g+60|0;m=g+56|0;A=g+52|0;n=g+48|0;d=g;y=g+44|0;u=g+40|0;w=g+36|0;v=g+32|0;t=g+28|0;r=g+24|0;p=g+20|0;z=g+16|0;c[h>>2]=a;c[F>>2]=b;c[B>>2]=0;c[s>>2]=0;c[C>>2]=0;c[s>>2]=QC(c[h>>2]|0,c[F>>2]|0)|0;c[j>>2]=0;while(1){if(c[s>>2]|0)break;if((c[j>>2]|0)>=(c[(c[h>>2]|0)+20>>2]|0))break;c[E>>2]=c[(c[(c[h>>2]|0)+16>>2]|0)+(c[j>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>>2]|0)){c[f>>2]=7;F=c[f>>2]|0;i=g;return F|0}do{if(c[u>>2]|0){if((c[u>>2]|0)>100){e=34;break}if((c[u>>2]|0)==1){c[x>>2]=c[m>>2];tc(13,34456,x)}}c[u>>2]=(c[u>>2]|0)+1;vc(4,v);F=(c[m>>2]|0)+(c[w>>2]|0)|0;a=c[v>>2]&255;c[x>>2]=(c[v>>2]|0)>>>8&16777215;c[x+4>>2]=a;sc(13,F,34472,x)|0;c[s>>2]=vi(c[o>>2]|0,c[m>>2]|0,0,y)|0}while((c[s>>2]|0)==0&(c[y>>2]|0)!=0);if((e|0)==34){c[x>>2]=c[m>>2];tc(13,34440,x);_h(c[o>>2]|0,c[m>>2]|0,0)|0}if(!(c[s>>2]|0))c[s>>2]=PB(c[o>>2]|0,c[m>>2]|0,n,16406,0)|0;if(c[s>>2]|0){Xb(c[h>>2]|0,c[m>>2]|0);c[f>>2]=c[s>>2];F=c[f>>2]|0;i=g;return F|0}c[j>>2]=0;while(1){if((c[j>>2]|0)>=(c[(c[h>>2]|0)+20>>2]|0))break;c[t>>2]=c[(c[(c[h>>2]|0)+16>>2]|0)+(c[j>>2]<<4)+4>>2];if((Tk(c[t>>2]|0)|0)!=0?(c[r>>2]=SC(c[t>>2]|0)|0,(c[r>>2]|0)!=0):0){if((c[q>>2]|0)==0?(TC(c[t>>2]|0)|0)==0:0)c[q>>2]=1;E=c[n>>2]|0;b=c[r>>2]|0;F=(Mb(c[r>>2]|0)|0)+1|0;a=d;c[s>>2]=id(E,b,F,c[a>>2]|0,c[a+4>>2]|0)|0;a=(Mb(c[r>>2]|0)|0)+1|0;F=d;a=bF(c[F>>2]|0,c[F+4>>2]|0,a|0,((a|0)<0)<<31>>31|0)|0;F=d;c[F>>2]=a;c[F+4>>2]=D;if(c[s>>2]|0){e=50;break}}c[j>>2]=(c[j>>2]|0)+1}if((e|0)==50){pB(c[n>>2]|0)|0;_h(c[o>>2]|0,c[m>>2]|0,0)|0;Xb(c[h>>2]|0,c[m>>2]|0);c[f>>2]=c[s>>2];F=c[f>>2]|0;i=g;return F|0}if(((c[q>>2]|0)!=0?0==((Ai(c[n>>2]|0)|0)&1024|0):0)?(F=Yh(c[n>>2]|0,2)|0,c[s>>2]=F,0!=(F|0)):0){pB(c[n>>2]|0)|0;_h(c[o>>2]|0,c[m>>2]|0,0)|0;Xb(c[h>>2]|0,c[m>>2]|0);c[f>>2]=c[s>>2];F=c[f>>2]|0;i=g;return F|0}c[j>>2]=0;while(1){if(c[s>>2]|0)break;if((c[j>>2]|0)>=(c[(c[h>>2]|0)+20>>2]|0))break;c[p>>2]=c[(c[(c[h>>2]|0)+16>>2]|0)+(c[j>>2]<<4)+4>>2];if(c[p>>2]|0)c[s>>2]=nd(c[p>>2]|0,c[m>>2]|0)|0;c[j>>2]=(c[j>>2]|0)+1}pB(c[n>>2]|0)|0;if(c[s>>2]|0){Xb(c[h>>2]|0,c[m>>2]|0);c[f>>2]=c[s>>2];F=c[f>>2]|0;i=g;return F|0}c[s>>2]=_h(c[o>>2]|0,c[m>>2]|0,1)|0;Xb(c[h>>2]|0,c[m>>2]|0);c[m>>2]=0;if(c[s>>2]|0){c[f>>2]=c[s>>2];F=c[f>>2]|0;i=g;return F|0}kh();c[j>>2]=0;while(1){if((c[j>>2]|0)>=(c[(c[h>>2]|0)+20>>2]|0))break;c[z>>2]=c[(c[(c[h>>2]|0)+16>>2]|0)+(c[j>>2]<<4)+4>>2];if(c[z>>2]|0)md(c[z>>2]|0,1)|0;c[j>>2]=(c[j>>2]|0)+1}lh();RC(c[h>>2]|0)|0}c[f>>2]=c[s>>2];F=c[f>>2]|0;i=g;return F|0}function QC(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;e=i;i=i+32|0;d=e+24|0;k=e+20|0;l=e+16|0;f=e+12|0;g=e+8|0;h=e+4|0;j=e;c[d>>2]=a;c[k>>2]=b;c[f>>2]=0;c[g>>2]=c[(c[d>>2]|0)+328>>2];c[(c[d>>2]|0)+328>>2]=0;c[l>>2]=0;while(1){if(c[f>>2]|0){h=8;break}if((c[l>>2]|0)>=(c[(c[d>>2]|0)+304>>2]|0)){h=8;break}c[j>>2]=c[(c[(c[g>>2]|0)+(c[l>>2]<<2)>>2]|0)+8>>2];if((c[j>>2]|0)!=0?(a=c[(c[c[j>>2]>>2]|0)+60>>2]|0,c[h>>2]=a,(a|0)!=0):0){c[f>>2]=ub[c[h>>2]&31](c[j>>2]|0)|0;Hz(c[k>>2]|0,c[j>>2]|0)}c[l>>2]=(c[l>>2]|0)+1}if((h|0)==8){c[(c[d>>2]|0)+328>>2]=c[g>>2];i=e;return c[f>>2]|0}return 0}function RC(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;Vk(c[d>>2]|0,64);i=b;return 0}function SC(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=VC(c[c[(c[d>>2]|0)+4>>2]>>2]|0)|0;i=b;return a|0}function TC(a){a=a|0;var b=0,d=0,e=0,f=0;d=i;i=i+16|0;f=d+8|0;e=d+4|0;b=d;c[f>>2]=a;c[e>>2]=c[(c[f>>2]|0)+4>>2];Pc(c[f>>2]|0);c[b>>2]=UC(c[c[e>>2]>>2]|0)|0;i=d;return c[b>>2]|0}function UC(a){a=a|0;var b=0,e=0;e=i;i=i+16|0;b=e;c[b>>2]=a;i=e;return d[(c[b>>2]|0)+7>>0]|0|0}function VC(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return c[(c[b>>2]|0)+172>>2]|0}function WC(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;e=i;i=i+16|0;d=e+12|0;f=e+8|0;b=e+4|0;g=e;c[d>>2]=a;c[b>>2]=(c[d>>2]|0)+72;c[g>>2]=(c[b>>2]|0)+((c[(c[d>>2]|0)+60>>2]|0)*40|0);c[f>>2]=0;while(1){if((c[f>>2]|0)>=(c[(c[d>>2]|0)+64>>2]|0))break;Az(c[c[d>>2]>>2]|0,c[(c[g>>2]|0)+(c[f>>2]<<2)>>2]|0);c[f>>2]=(c[f>>2]|0)+1}hu(c[b>>2]|0,c[(c[d>>2]|0)+60>>2]|0);Xb(c[c[c[d>>2]>>2]>>2]|0,c[d>>2]|0);i=e;return}function XC(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return c[34600+(c[b>>2]<<2)>>2]|0}function YC(d,f,g){d=d|0;f=f|0;g=g|0;var j=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;n=i;i=i+64|0;v=n;z=n+60|0;l=n+56|0;m=n+52|0;j=n+48|0;u=n+44|0;s=n+40|0;o=n+36|0;q=n+32|0;t=n+28|0;r=n+24|0;y=n+20|0;A=n+16|0;w=n+12|0;x=n+8|0;c[z>>2]=d;c[l>>2]=f;c[m>>2]=g;c[j>>2]=c[l>>2];do switch(a[(c[z>>2]|0)+1>>0]|0){case-10:{c[x>>2]=c[(c[(c[z>>2]|0)+16>>2]|0)+8>>2];f=c[m>>2]|0;d=c[l>>2]|0;A=c[c[x>>2]>>2]|0;c[v>>2]=c[x>>2];c[v+4>>2]=A;sc(f,d,34560,v)|0;d=c[j>>2]|0;i=n;return d|0};case-5:{c[A>>2]=c[(c[z>>2]|0)+16>>2];f=c[m>>2]|0;d=c[l>>2]|0;z=b[c[A>>2]>>1]|0;c[v>>2]=c[(c[A>>2]|0)+24>>2];c[v+4>>2]=z;sc(f,d,34536,v)|0;d=c[j>>2]|0;i=n;return d|0};case-19:{a[c[l>>2]>>0]=0;d=c[j>>2]|0;i=n;return d|0};case-4:{c[y>>2]=c[(c[z>>2]|0)+16>>2];f=c[m>>2]|0;d=c[l>>2]|0;c[v>>2]=c[c[y>>2]>>2];sc(f,d,34528,v)|0;d=c[j>>2]|0;i=n;return d|0};case-13:{f=c[m>>2]|0;d=c[l>>2]|0;y=c[(c[z>>2]|0)+16>>2]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2]|0;i=n;return d|0}if(e[o+8>>1]&4){f=c[m>>2]|0;d=c[l>>2]|0;y=c[w>>2]|0;z=c[y+4>>2]|0;A=v;c[A>>2]=c[y>>2];c[A+4>>2]=z;sc(f,d,9456,v)|0;d=c[j>>2]|0;i=n;return d|0}if(e[(c[w>>2]|0)+8>>1]&8){f=c[m>>2]|0;d=c[l>>2]|0;h[k>>3]=+h[c[w>>2]>>3];c[v>>2]=c[k>>2];c[v+4>>2]=c[k+4>>2];sc(f,d,9448,v)|0;d=c[j>>2]|0;i=n;return d|0}if(e[(c[w>>2]|0)+8>>1]&1){sc(c[m>>2]|0,c[l>>2]|0,9840,v)|0;d=c[j>>2]|0;i=n;return d|0}else{c[j>>2]=34552;d=c[j>>2]|0;i=n;return d|0}};case-14:{f=c[m>>2]|0;d=c[l>>2]|0;c[v>>2]=c[(c[z>>2]|0)+16>>2];sc(f,d,34544,v)|0;d=c[j>>2]|0;i=n;return d|0};case-18:{sc(c[m>>2]|0,c[l>>2]|0,34592,v)|0;d=c[j>>2]|0;i=n;return d|0};case-12:{f=c[m>>2]|0;d=c[l>>2]|0;h[k>>3]=+h[c[(c[z>>2]|0)+16>>2]>>3];c[v>>2]=c[k>>2];c[v+4>>2]=c[k+4>>2];sc(f,d,9448,v)|0;d=c[j>>2]|0;i=n;return d|0};case-15:{sc(c[m>>2]|0,c[l>>2]|0,34576,v)|0;d=c[j>>2]|0;i=n;return d|0};default:{c[j>>2]=c[(c[z>>2]|0)+16>>2];if(c[j>>2]|0){d=c[j>>2]|0;i=n;return d|0}c[j>>2]=c[l>>2];a[c[l>>2]>>0]=0;d=c[j>>2]|0;i=n;return d|0}}while(0);return 0}function ZC(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0;f=i;i=i+16|0;g=f+8|0;h=f;c[g>>2]=a;a=h;c[a>>2]=d;c[a+4>>2]=e;_d(c[g>>2]|0);e=h;d=c[e+4>>2]|0;a=c[g>>2]|0;c[a>>2]=c[e>>2];c[a+4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)|0;if((((d[l>>0]|0)&8|0)!=0?1==(1&c[(c[k>>2]|0)+16>>2]|0):0)?(Ak(c[k>>2]|0)|0)!=0:0){c[h>>2]=0;f=c[h>>2]|0;i=j;return f|0}dz(c[k>>2]|0)|0}else Kp(g,a[l>>0]|0,0)|0;if((d[(c[k>>2]|0)+10>>0]|0|0)==((d[l>>0]|0)&-9|0)){c[h>>2]=c[(c[k>>2]|0)+16>>2];f=c[h>>2]|0;i=j;return f|0}else{c[h>>2]=0;f=c[h>>2]|0;i=j;return f|0}return 0}function aD(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;if((e[(c[b>>2]|0)+8>>1]|0)&9312)gn(c[b>>2]|0);if(!(c[(c[b>>2]|0)+24>>2]|0)){b=c[b>>2]|0;b=b+16|0;c[b>>2]=0;i=d;return}Xb(c[(c[b>>2]|0)+32>>2]|0,c[(c[b>>2]|0)+20>>2]|0);c[(c[b>>2]|0)+24>>2]=0;b=c[b>>2]|0;b=b+16|0;c[b>>2]=0;i=d;return}function bD(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=c[c[d>>2]>>2];Xb(c[e>>2]|0,c[(c[d>>2]|0)+44>>2]|0);c[(c[d>>2]|0)+44>>2]=0;c[(c[d>>2]|0)+20>>2]=0;i=b;return}function cD(b){b=b|0;var d=0,e=0;d=i;i=i+16|0;e=d;c[e>>2]=b;a[(c[e>>2]|0)+64>>0]=0;Nc(c[e>>2]|0,7);i=d;return 7}function dD(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;h=f+12|0;g=f+8|0;k=f+4|0;j=f;c[h>>2]=b;c[g>>2]=d;c[k>>2]=e;if(!(c[g>>2]|0)){d=c[h>>2]|0;b=c[g>>2]|0;Xb(d,b);i=f;return}c[j>>2]=c[g>>2];while(1){if((c[j>>2]|0)>>>0>=((c[g>>2]|0)+((c[k>>2]|0)*20|0)|0)>>>0)break;Oy(c[h>>2]|0,a[(c[j>>2]|0)+1>>0]|0,c[(c[j>>2]|0)+16>>2]|0);c[j>>2]=(c[j>>2]|0)+20}d=c[h>>2]|0;b=c[g>>2]|0;Xb(d,b);i=f;return}function eD(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;_g(c[(c[d>>2]|0)+60>>2]|0);c[(c[d>>2]|0)+60>>2]=0;i=b;return}function fD(b){b=b|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;f=e+8|0;g=e+4|0;h=e;c[f>>2]=b;c[g>>2]=c[(c[f>>2]|0)+4>>2];c[h>>2]=c[c[f>>2]>>2];a[(c[g>>2]|0)+19>>0]=0;if((d[(c[f>>2]|0)+8>>0]|0|0)>0?(c[(c[h>>2]|0)+152>>2]|0)>1:0){gD(c[f>>2]|0);a[(c[f>>2]|0)+8>>0]=1;i=e;return}if((d[(c[f>>2]|0)+8>>0]|0|0)!=0?(hD(c[f>>2]|0),h=(c[g>>2]|0)+40|0,c[h>>2]=(c[h>>2]|0)+ -1,0==(c[(c[g>>2]|0)+40>>2]|0)):0)a[(c[g>>2]|0)+20>>0]=0;a[(c[f>>2]|0)+8>>0]=0;Sk(c[g>>2]|0);i=e;return}function gD(d){d=d|0;var f=0,g=0,h=0,j=0;f=i;i=i+16|0;j=f+8|0;h=f+4|0;g=f;c[j>>2]=d;c[h>>2]=c[(c[j>>2]|0)+4>>2];if((c[(c[h>>2]|0)+76>>2]|0)!=(c[j>>2]|0)){i=f;return}c[(c[h>>2]|0)+76>>2]=0;j=(c[h>>2]|0)+22|0;b[j>>1]=(e[j>>1]|0)&-97;c[g>>2]=c[(c[h>>2]|0)+72>>2];while(1){if(!(c[g>>2]|0))break;a[(c[g>>2]|0)+8>>0]=1;c[g>>2]=c[(c[g>>2]|0)+12>>2]}i=f;return}function hD(a){a=a|0;var d=0,f=0,g=0,h=0,j=0;f=i;i=i+16|0;g=f+12|0;d=f+8|0;h=f+4|0;j=f;c[g>>2]=a;c[d>>2]=c[(c[g>>2]|0)+4>>2];c[h>>2]=(c[d>>2]|0)+72;while(1){if(!(c[c[h>>2]>>2]|0))break;c[j>>2]=c[c[h>>2]>>2];a=(c[j>>2]|0)+12|0;if((c[c[j>>2]>>2]|0)!=(c[g>>2]|0)){c[h>>2]=a;continue}c[c[h>>2]>>2]=c[a>>2];if((c[(c[j>>2]|0)+4>>2]|0)==1)continue;hc(c[j>>2]|0)}h=c[d>>2]|0;if((c[(c[d>>2]|0)+76>>2]|0)==(c[g>>2]|0)){c[h+76>>2]=0;a=(c[d>>2]|0)+22|0;b[a>>1]=(e[a>>1]|0)&-97;i=f;return}if((c[h+40>>2]|0)!=2){i=f;return}a=(c[d>>2]|0)+22|0;b[a>>1]=(e[a>>1]|0)&-65;i=f;return}function iD(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;e=i;i=i+32|0;d=e+28|0;h=e+24|0;f=e+20|0;g=e+16|0;j=e+12|0;k=e+8|0;l=e+4|0;m=e;c[h>>2]=b;c[f>>2]=0;c[g>>2]=c[c[h>>2]>>2];sA(c[h>>2]|0);do if(!(a[(c[h>>2]|0)+18>>0]|0)){c[m>>2]=Aw(c[h>>2]|0)|0;b=Pw(c[h>>2]|0,c[m>>2]|0)|0;if((b|0)!=(c[m>>2]|0)?(c[m>>2]|0)!=((((c[282]|0)>>>0)/((c[(c[h>>2]|0)+32>>2]|0)>>>0)|0)+1|0):0){c[k>>2]=Hh((c[(c[(c[h>>2]|0)+12>>2]|0)+56>>2]|0)+36|0)|0;c[j>>2]=rA(c[h>>2]|0,c[m>>2]|0,c[k>>2]|0)|0;if((c[j>>2]|0)>>>0>(c[m>>2]|0)>>>0){c[d>>2]=kj(55475)|0;m=c[d>>2]|0;i=e;return m|0}if((c[j>>2]|0)>>>0<(c[m>>2]|0)>>>0)c[f>>2]=Hy(c[h>>2]|0,0,0)|0;c[l>>2]=c[m>>2];while(1){if(!((c[f>>2]|0)==0?(c[l>>2]|0)>>>0>(c[j>>2]|0)>>>0:0))break;c[f>>2]=tA(c[h>>2]|0,c[j>>2]|0,c[l>>2]|0,1)|0;c[l>>2]=(c[l>>2]|0)+ -1}if(((c[f>>2]|0)==101|(c[f>>2]|0)==0)&(c[k>>2]|0)>>>0>0){c[f>>2]=gd(c[(c[(c[h>>2]|0)+12>>2]|0)+68>>2]|0)|0;ck((c[(c[(c[h>>2]|0)+12>>2]|0)+56>>2]|0)+32|0,0);ck((c[(c[(c[h>>2]|0)+12>>2]|0)+56>>2]|0)+36|0,0);ck((c[(c[(c[h>>2]|0)+12>>2]|0)+56>>2]|0)+28|0,c[j>>2]|0);a[(c[h>>2]|0)+19>>0]=1;c[(c[h>>2]|0)+44>>2]=c[j>>2]}if(!(c[f>>2]|0))break;Th(c[g>>2]|0)|0;break}c[d>>2]=kj(55470)|0;m=c[d>>2]|0;i=e;return m|0}while(0);c[d>>2]=c[f>>2];m=c[d>>2]|0;i=e;return m|0}function jD(b){b=b|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;f=e+8|0;g=e+4|0;h=e;c[g>>2]=b;c[h>>2]=0;b=c[g>>2]|0;if(c[(c[g>>2]|0)+40>>2]|0){c[f>>2]=c[b+40>>2];b=c[f>>2]|0;i=e;return b|0}if(((d[b+16>>0]|0|0)==2?(d[(c[g>>2]|0)+4>>0]|0|0)!=0:0)?(d[(c[g>>2]|0)+5>>0]|0|0)==1:0){a[(c[g>>2]|0)+16>>0]=1;c[f>>2]=0;b=c[f>>2]|0;i=e;return b|0}c[h>>2]=Uh(c[g>>2]|0,d[(c[g>>2]|0)+19>>0]|0,1)|0;c[f>>2]=Oh(c[g>>2]|0,c[h>>2]|0)|0;b=c[f>>2]|0;i=e;return b|0}function kD(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;g=e+12|0;f=e+4|0;h=e;c[g>>2]=b;c[e+8>>2]=d;c[f>>2]=0;if(a[(c[g>>2]|0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;c[f>>2]=c[g>>2];b=c[f>>2]|0;i=e;return b|0}function pD(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;a=Yg(c[(c[f>>2]|0)+56>>2]|0,c[(c[e>>2]|0)+20>>2]|0)|0;i=d;return a|0}function qD(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[f>>2]=b;c[g>>2]=0;if(a[(c[f>>2]|0)+12>>0]|0){c[e>>2]=0;h=c[e>>2]|0;i=d;return h|0}if(!(c[(c[f>>2]|0)+24>>2]|0)){c[e>>2]=0;h=c[e>>2]|0;i=d;return h|0}c[h>>2]=ig(c[(c[f>>2]|0)+60>>2]|0,20,g)|0;if((c[h>>2]|0)!=12){if((c[h>>2]|0)==0&(c[g>>2]|0)!=0)c[h>>2]=1032}else c[h>>2]=0;c[e>>2]=c[h>>2];h=c[e>>2]|0;i=d;return h|0}function rD(a,d,f,g){a=a|0;d=d|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0;h=i;i=i+32|0;m=h+20|0;l=h+16|0;n=h+12|0;k=h+8|0;o=h+4|0;j=h;c[l>>2]=a;c[n>>2]=d;c[k>>2]=f;c[o>>2]=g;g=c[l>>2]|0;do if(c[(c[l>>2]|0)+136>>2]|0){a=c[g+136>>2]|0;c[j>>2]=a;c[c[o>>2]>>2]=a;c[(c[l>>2]|0)+136>>2]=c[(c[j>>2]|0)+12>>2];c[(c[j>>2]|0)+12>>2]=0;_E(c[(c[j>>2]|0)+8>>2]|0,0,e[(c[l>>2]|0)+140>>1]|0|0)|0}else{a=Mc(40+(e[g+140>>1]|0)|0,0)|0;c[j>>2]=a;c[c[o>>2]>>2]=a;if(c[j>>2]|0){c[(c[j>>2]|0)+8>>2]=(c[j>>2]|0)+40;b[(c[j>>2]|0)+24>>1]=64;b[(c[j>>2]|0)+26>>1]=1;c[(c[j>>2]|0)+16>>2]=c[l>>2];break}d=c[(c[l>>2]|0)+60>>2]|0;a=c[(c[l>>2]|0)+152>>2]|0;a=lF((c[n>>2]|0)-1|0,0,a|0,((a|0)<0)<<31>>31|0)|0;hj(d,a,D,c[k>>2]|0)|0;c[m>>2]=7;a=c[m>>2]|0;i=h;return a|0}while(0);c[(c[j>>2]|0)+20>>2]=c[n>>2];c[(c[j>>2]|0)+4>>2]=c[k>>2];a=(c[l>>2]|0)+120|0;c[a>>2]=(c[a>>2]|0)+1;c[m>>2]=0;a=c[m>>2]|0;i=h;return a|0}function sD(a,f,g){a=a|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0;h=i;i=i+32|0;j=h+20|0;l=h+16|0;n=h+12|0;o=h+8|0;m=h+4|0;k=h;c[l>>2]=a;c[n>>2]=f;c[o>>2]=g;if((d[(c[l>>2]|0)+29>>0]|0)==2){c[j>>2]=0;a=c[j>>2]|0;i=h;return a|0}c[m>>2]=c[(c[l>>2]|0)+8>>2];while(1){if(!(c[m>>2]|0))break;if((b[(c[m>>2]|0)+26>>1]|0)==0?(e[(c[m>>2]|0)+24>>1]&4|0)==0:0)break;c[m>>2]=c[(c[m>>2]|0)+36>>2]}c[(c[l>>2]|0)+8>>2]=c[m>>2];a:do if(!(c[m>>2]|0)){c[m>>2]=c[(c[l>>2]|0)+4>>2];while(1){if(!(c[m>>2]|0))break a;if(!(b[(c[m>>2]|0)+26>>1]|0))break a;c[m>>2]=c[(c[m>>2]|0)+36>>2]}}while(0);if((c[m>>2]|0)!=0?(c[k>>2]=zb[c[(c[l>>2]|0)+32>>2]&63](c[(c[l>>2]|0)+36>>2]|0,c[m>>2]|0)|0,(c[k>>2]|0)!=0&(c[k>>2]|0)!=5):0){c[j>>2]=c[k>>2];a=c[j>>2]|0;i=h;return a|0}a=pb[c[38640+132>>2]&31](c[(c[l>>2]|0)+40>>2]|0,c[n>>2]|0,2)|0;c[c[o>>2]>>2]=a;c[j>>2]=(c[c[o>>2]>>2]|0)==0?7:0;a=c[j>>2]|0;i=h;return a|0}function tD(f){f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;k=i;i=i+48|0;g=k+40|0;j=k+36|0;q=k+32|0;h=k+28|0;l=k+24|0;r=k+20|0;n=k+12|0;p=k+8|0;m=k+4|0;o=k;c[j>>2]=f;c[r>>2]=0;c[q>>2]=KA(c[c[j>>2]>>2]|0)|0;if(c[q>>2]|0){c[g>>2]=c[q>>2];r=c[g>>2]|0;i=k;return r|0}c[q>>2]=Bw(c[j>>2]|0,1,h,0)|0;if(c[q>>2]|0){c[g>>2]=c[q>>2];r=c[g>>2]|0;i=k;return r|0}f=Hh((c[(c[h>>2]|0)+56>>2]|0)+28|0)|0;c[k+16>>2]=f;c[l>>2]=f;fd(c[c[j>>2]>>2]|0,r);if(!((c[l>>2]|0)!=0?(TE((c[(c[h>>2]|0)+56>>2]|0)+24|0,(c[(c[h>>2]|0)+56>>2]|0)+92|0,4)|0)==0:0))c[l>>2]=c[r>>2];a:do if((c[l>>2]|0)>0){c[m>>2]=c[(c[h>>2]|0)+56>>2];c[q>>2]=26;b:do if(!(TE(c[m>>2]|0,34408,16)|0)){if((d[(c[m>>2]|0)+18>>0]|0|0)>2){f=(c[j>>2]|0)+22|0;b[f>>1]=e[f>>1]|0|1}if((d[(c[m>>2]|0)+19>>0]|0|0)<=2){do if((d[(c[m>>2]|0)+19>>0]|0|0)==2?((e[(c[j>>2]|0)+22>>1]|0)&16|0)==0:0){c[o>>2]=0;c[q>>2]=RA(c[c[j>>2]>>2]|0,o)|0;if(c[q>>2]|0)break b;if(c[o>>2]|0){c[q>>2]=26;break}Rk(c[h>>2]|0);c[g>>2]=0;r=c[g>>2]|0;i=k;return r|0}while(0);if((TE((c[m>>2]|0)+21|0,37104,3)|0)==0?(c[n>>2]=(d[(c[m>>2]|0)+16>>0]|0)<<8|(d[(c[m>>2]|0)+17>>0]|0)<<16,!(((c[n>>2]|0)>>>0>65536?1:((c[n>>2]|0)-1&c[n>>2]|0)!=0)|(c[n>>2]|0)>>>0<=256)):0){c[p>>2]=(c[n>>2]|0)-(d[(c[m>>2]|0)+20>>0]|0);if((c[n>>2]|0)!=(c[(c[j>>2]|0)+32>>2]|0)){Rk(c[h>>2]|0);c[(c[j>>2]|0)+36>>2]=c[p>>2];c[(c[j>>2]|0)+32>>2]=c[n>>2];Dg(c[j>>2]|0);c[q>>2]=Eg(c[c[j>>2]>>2]|0,(c[j>>2]|0)+32|0,(c[n>>2]|0)-(c[p>>2]|0)|0)|0;c[g>>2]=c[q>>2];r=c[g>>2]|0;i=k;return r|0}if((c[(c[(c[j>>2]|0)+4>>2]|0)+24>>2]&65536|0)==0?(c[l>>2]|0)>(c[r>>2]|0):0){c[q>>2]=kj(54754)|0;break}if((c[p>>2]|0)>>>0>=480){c[(c[j>>2]|0)+32>>2]=c[n>>2];c[(c[j>>2]|0)+36>>2]=c[p>>2];r=(Hh((c[m>>2]|0)+52|0)|0)!=0;a[(c[j>>2]|0)+17>>0]=r?1:0;r=(Hh((c[m>>2]|0)+64|0)|0)!=0;a[(c[j>>2]|0)+18>>0]=r?1:0;break a}}}}while(0);Rk(c[h>>2]|0);c[(c[j>>2]|0)+12>>2]=0;c[g>>2]=c[q>>2];r=c[g>>2]|0;i=k;return r|0}while(0);b[(c[j>>2]|0)+24>>1]=(((c[(c[j>>2]|0)+36>>2]|0)-12<<6>>>0)/255|0)-23;b[(c[j>>2]|0)+26>>1]=(((c[(c[j>>2]|0)+36>>2]|0)-12<<5>>>0)/255|0)-23;b[(c[j>>2]|0)+28>>1]=(c[(c[j>>2]|0)+36>>2]|0)-35;b[(c[j>>2]|0)+30>>1]=(((c[(c[j>>2]|0)+36>>2]|0)-12<<5>>>0)/255|0)-23;m=c[j>>2]|0;if((e[(c[j>>2]|0)+24>>1]|0|0)>127)a[m+21>>0]=127;else a[(c[j>>2]|0)+21>>0]=b[m+24>>1];c[(c[j>>2]|0)+12>>2]=c[h>>2];c[(c[j>>2]|0)+44>>2]=c[l>>2];c[g>>2]=0;r=c[g>>2]|0;i=k;return r|0}function uD(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+32|0;h=g+16|0;j=g+12|0;l=g+8|0;m=g+4|0;k=g;c[j>>2]=b;c[l>>2]=e;c[m>>2]=f;c[k>>2]=0;if(c[(c[j>>2]|0)+40>>2]|0){c[h>>2]=c[(c[j>>2]|0)+40>>2];b=c[h>>2]|0;i=g;return b|0}a[(c[j>>2]|0)+21>>0]=c[m>>2];if((d[(c[j>>2]|0)+16>>0]|0|0)==1){b=(ai(c[j>>2]|0)|0)!=0;f=c[j>>2]|0;if(!b){c[k>>2]=hk(f,2)|0;if((c[k>>2]|0)==0&(c[l>>2]|0)!=0)c[k>>2]=gk(c[j>>2]|0,4)|0}else{do if((d[f+4>>0]|0|0)!=0?(di(c[(c[j>>2]|0)+208>>2]|0,-1)|0)!=0:0){c[k>>2]=hk(c[j>>2]|0,4)|0;if(!(c[k>>2]|0)){di(c[(c[j>>2]|0)+208>>2]|0,1)|0;break}c[h>>2]=c[k>>2];b=c[h>>2]|0;i=g;return b|0}while(0);c[k>>2]=vD(c[(c[j>>2]|0)+208>>2]|0)|0}if(!(c[k>>2]|0)){a[(c[j>>2]|0)+16>>0]=2;c[(c[j>>2]|0)+36>>2]=c[(c[j>>2]|0)+24>>2];c[(c[j>>2]|0)+32>>2]=c[(c[j>>2]|0)+24>>2];c[(c[j>>2]|0)+28>>2]=c[(c[j>>2]|0)+24>>2];b=(c[j>>2]|0)+72|0;c[b>>2]=0;c[b+4>>2]=0}}c[h>>2]=c[k>>2];b=c[h>>2]|0;i=g;return b|0}function vD(b){b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;e=d+8|0;g=d+4|0;f=d;c[g>>2]=b;if(a[(c[g>>2]|0)+46>>0]|0){c[e>>2]=8;g=c[e>>2]|0;i=d;return g|0}c[f>>2]=vj(c[g>>2]|0,0,1)|0;if(c[f>>2]|0){c[e>>2]=c[f>>2];g=c[e>>2]|0;i=d;return g|0}a[(c[g>>2]|0)+44>>0]=1;b=(c[g>>2]|0)+52|0;if(TE(b,mj(c[g>>2]|0)|0,48)|0){ji(c[g>>2]|0,0,1);a[(c[g>>2]|0)+44>>0]=0;c[f>>2]=517}c[e>>2]=c[f>>2];g=c[e>>2]|0;i=d;return g|0}function wD(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;_d(c[d>>2]|0);i=b;return}function xD(a,b){a=a|0;b=b|0;var d=0;d=i;i=i+16|0;c[d+4>>2]=a;c[d>>2]=b;i=d;return 37112}function yD(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;e=b+8|0;d=b+4|0;f=b;c[e>>2]=a;c[d>>2]=0;if(!(c[e>>2]|0)){f=c[d>>2]|0;i=b;return f|0}c[f>>2]=c[e>>2];FD(c[e>>2]|0,0)|0;hc(c[(c[f>>2]|0)+24>>2]|0);c[d>>2]=kE(c[e>>2]|0)|0;f=c[d>>2]|0;i=b;return f|0}function zD(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;l=i;i=i+32|0;h=l+28|0;o=l+24|0;k=l+20|0;m=l+16|0;n=l;j=l+12|0;g=l+8|0;c[o>>2]=a;c[k>>2]=b;c[m>>2]=d;a=n;c[a>>2]=e;c[a+4>>2]=f;c[j>>2]=c[o>>2];a=n;c[g>>2]=jE(c[j>>2]|0,c[a>>2]|0,c[a+4>>2]|0,c[k>>2]|0,c[m>>2]|0)|0;if((c[g>>2]|0)==(c[m>>2]|0)){c[h>>2]=0;o=c[h>>2]|0;i=l;return o|0}if((c[g>>2]|0)<0){c[h>>2]=266;o=c[h>>2]|0;i=l;return o|0}else{c[(c[j>>2]|0)+20>>2]=0;_E((c[k>>2]|0)+(c[g>>2]|0)|0,0,(c[m>>2]|0)-(c[g>>2]|0)|0)|0;c[h>>2]=522;o=c[h>>2]|0;i=l;return o|0}return 0}function AD(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;h=i;i=i+32|0;m=h+28|0;o=h+24|0;n=h+20|0;l=h+16|0;g=h;k=h+12|0;j=h+8|0;c[o>>2]=a;c[n>>2]=b;c[l>>2]=d;a=g;c[a>>2]=e;c[a+4>>2]=f;c[k>>2]=c[o>>2];c[j>>2]=0;while(1){if((c[l>>2]|0)<=0)break;o=g;o=fE(c[k>>2]|0,c[o>>2]|0,c[o+4>>2]|0,c[n>>2]|0,c[l>>2]|0)|0;c[j>>2]=o;if((o|0)<=0)break;c[l>>2]=(c[l>>2]|0)-(c[j>>2]|0);a=c[j>>2]|0;o=g;a=bF(c[o>>2]|0,c[o+4>>2]|0,a|0,((a|0)<0)<<31>>31|0)|0;o=g;c[o>>2]=a;c[o+4>>2]=D;c[n>>2]=(c[n>>2]|0)+(c[j>>2]|0)}if((c[l>>2]|0)<=0){c[m>>2]=0;o=c[m>>2]|0;i=h;return o|0}if((c[j>>2]|0)<0?(c[(c[k>>2]|0)+20>>2]|0)!=28:0){c[m>>2]=778;o=c[m>>2]|0;i=h;return o|0}c[(c[k>>2]|0)+20>>2]=0;c[m>>2]=13;o=c[m>>2]|0;i=h;return o|0}function BD(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;g=i;i=i+32|0;f=g+20|0;k=g+16|0;h=g;e=g+12|0;j=g+8|0;c[k>>2]=a;a=h;c[a>>2]=b;c[a+4>>2]=d;c[e>>2]=c[k>>2];if((c[(c[e>>2]|0)+40>>2]|0)>0){k=h;a=c[(c[e>>2]|0)+40>>2]|0;a=bF(c[k>>2]|0,c[k+4>>2]|0,a|0,((a|0)<0)<<31>>31|0)|0;a=ZE(a|0,D|0,1,0)|0;k=c[(c[e>>2]|0)+40>>2]|0;k=jF(a|0,D|0,k|0,((k|0)<0)<<31>>31|0)|0;a=c[(c[e>>2]|0)+40>>2]|0;a=lF(k|0,D|0,a|0,((a|0)<0)<<31>>31|0)|0;k=h;c[k>>2]=a;c[k+4>>2]=D}k=h;c[j>>2]=eE(c[(c[e>>2]|0)+12>>2]|0,c[k>>2]|0,c[k+4>>2]|0)|0;if(c[j>>2]|0){k=c[(Ya()|0)>>2]|0;c[(c[e>>2]|0)+20>>2]=k;c[f>>2]=UD(1546,37568,c[(c[e>>2]|0)+32>>2]|0,28429)|0;k=c[f>>2]|0;i=g;return k|0}else{c[f>>2]=0;k=c[f>>2]|0;i=g;return k|0}return 0}function CD(a,d){a=a|0;d=d|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;f=i;i=i+32|0;g=f+28|0;o=f+24|0;n=f+20|0;k=f+16|0;h=f+12|0;l=f+8|0;m=f+4|0;j=f;c[o>>2]=a;c[n>>2]=d;c[h>>2]=c[o>>2];c[l>>2]=c[n>>2]&16;c[m>>2]=(c[n>>2]&15|0)==3&1;c[k>>2]=iE(c[(c[h>>2]|0)+12>>2]|0,c[m>>2]|0,c[l>>2]|0)|0;if(c[k>>2]|0){o=c[(Ya()|0)>>2]|0;c[(c[h>>2]|0)+20>>2]=o;c[g>>2]=UD(1034,38e3,c[(c[h>>2]|0)+32>>2]|0,28385)|0;o=c[g>>2]|0;i=f;return o|0}if((e[(c[h>>2]|0)+18>>1]|0)&8){c[k>>2]=zb[c[37192+208>>2]&63](c[(c[h>>2]|0)+32>>2]|0,j)|0;if(!((c[k>>2]|0)==0&(c[j>>2]|0)>=0)){if((c[k>>2]|0)==14)c[k>>2]=0}else{iE(c[j>>2]|0,0,0)|0;TD(c[h>>2]|0,c[j>>2]|0,28399)}o=(c[h>>2]|0)+18|0;b[o>>1]=(e[o>>1]|0)&-9}c[g>>2]=c[k>>2];o=c[g>>2]|0;i=f;return o|0}function DD(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;i=i+96|0;e=d+88|0;f=d+84|0;g=d+80|0;j=d+76|0;h=d;c[f>>2]=a;c[g>>2]=b;c[j>>2]=zb[c[37192+64>>2]&63](c[(c[f>>2]|0)+12>>2]|0,h)|0;if(c[j>>2]|0){j=c[(Ya()|0)>>2]|0;c[(c[f>>2]|0)+20>>2]=j;c[e>>2]=1802;j=c[e>>2]|0;i=d;return j|0}a=c[h+36>>2]|0;j=c[g>>2]|0;c[j>>2]=a;c[j+4>>2]=((a|0)<0)<<31>>31;j=c[g>>2]|0;if((c[j>>2]|0)==1&(c[j+4>>2]|0)==0){j=c[g>>2]|0;c[j>>2]=0;c[j+4>>2]=0}c[e>>2]=0;j=c[e>>2]|0;i=d;return j|0}function ED(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;f=i;i=i+32|0;g=f+24|0;n=f+20|0;k=f+16|0;j=f+12|0;h=f+8|0;l=f+4|0;m=f;c[n>>2]=b;c[k>>2]=e;c[j>>2]=c[n>>2];c[h>>2]=c[(c[j>>2]|0)+24>>2];c[l>>2]=0;if((d[(c[j>>2]|0)+16>>0]|0|0)>0){a[(c[j>>2]|0)+16>>0]=c[k>>2];qa(c[h>>2]|0,0)|0;c[g>>2]=0;n=c[g>>2]|0;i=f;return n|0}c[l>>2]=zb[c[37192+220>>2]&63](c[h>>2]|0,511)|0;if((c[l>>2]|0)>=0){a[(c[j>>2]|0)+16>>0]=c[k>>2];c[g>>2]=c[l>>2];n=c[g>>2]|0;i=f;return n|0}c[m>>2]=c[(Ya()|0)>>2];if(17!=(c[m>>2]|0)){c[l>>2]=hE(c[m>>2]|0,3850)|0;if((c[l>>2]|0)!=0&(c[l>>2]|0)!=5)c[(c[j>>2]|0)+20>>2]=c[m>>2]}else c[l>>2]=5;c[g>>2]=c[l>>2];n=c[g>>2]|0;i=f;return n|0}function FD(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;f=i;i=i+32|0;g=f+24|0;n=f+20|0;m=f+16|0;h=f+12|0;l=f+8|0;k=f+4|0;j=f;c[n>>2]=b;c[m>>2]=e;c[h>>2]=c[n>>2];c[l>>2]=c[(c[h>>2]|0)+24>>2];if((d[(c[h>>2]|0)+16>>0]|0|0)==(c[m>>2]|0)){c[g>>2]=0;n=c[g>>2]|0;i=f;return n|0}if((c[m>>2]|0)==1){a[(c[h>>2]|0)+16>>0]=1;c[g>>2]=0;n=c[g>>2]|0;i=f;return n|0}c[k>>2]=ub[c[37192+232>>2]&31](c[l>>2]|0)|0;if((c[k>>2]|0)<0?(c[(Ya()|0)>>2]|0)==20:0)c[k>>2]=ub[c[37192+196>>2]&31](c[l>>2]|0)|0;if((c[k>>2]|0)>=0){a[(c[h>>2]|0)+16>>0]=0;c[g>>2]=0;n=c[g>>2]|0;i=f;return n|0}c[j>>2]=c[(Ya()|0)>>2];c[k>>2]=0;c[k>>2]=2!=(c[j>>2]|0)?2058:0;if((c[k>>2]|0)!=0&(c[k>>2]|0)!=5)c[(c[h>>2]|0)+20>>2]=c[j>>2];c[g>>2]=c[k>>2];n=c[g>>2]|0;i=f;return n|0}function GD(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;e=i;i=i+32|0;l=e+20|0;g=e+16|0;f=e+12|0;h=e+8|0;k=e+4|0;j=e;c[l>>2]=a;c[g>>2]=b;c[f>>2]=0;c[h>>2]=0;c[k>>2]=c[l>>2];if((d[(c[k>>2]|0)+16>>0]|0|0)>1){c[h>>2]=1;a=c[h>>2]|0;l=c[g>>2]|0;c[l>>2]=a;l=c[f>>2]|0;i=e;return l|0}else{c[j>>2]=c[(c[k>>2]|0)+24>>2];c[h>>2]=(zb[c[37192+28>>2]&63](c[j>>2]|0,0)|0)==0&1;a=c[h>>2]|0;l=c[g>>2]|0;c[l>>2]=a;l=c[f>>2]|0;i=e;return l|0}return 0}function HD(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;f=i;i=i+32|0;k=f;g=f+28|0;o=f+24|0;n=f+20|0;j=f+16|0;h=f+12|0;m=f+8|0;l=f+4|0;c[o>>2]=a;c[n>>2]=b;c[j>>2]=e;c[h>>2]=c[o>>2];do switch(c[n>>2]|0){case 6:{c[(c[h>>2]|0)+40>>2]=c[c[j>>2]>>2];c[g>>2]=0;break};case 10:{aE(c[h>>2]|0,4,c[j>>2]|0);c[g>>2]=0;break};case 12:{c[k>>2]=c[(c[(c[h>>2]|0)+4>>2]|0)+16>>2];o=qc(1200,k)|0;c[c[j>>2]>>2]=o;c[g>>2]=0;break};case 20:{o=cE(c[h>>2]|0)|0;c[c[j>>2]>>2]=o;c[g>>2]=0;break};case 1:{c[c[j>>2]>>2]=d[(c[h>>2]|0)+16>>0];c[g>>2]=0;break};case 13:{aE(c[h>>2]|0,16,c[j>>2]|0);c[g>>2]=0;break};case 16:{c[l>>2]=fc(c[(c[(c[h>>2]|0)+4>>2]|0)+8>>2]|0)|0;if(c[l>>2]|0){bE(c[(c[(c[h>>2]|0)+4>>2]|0)+8>>2]|0,c[l>>2]|0)|0;c[c[j>>2]>>2]=c[l>>2]}c[g>>2]=0;break};case 5:{o=c[j>>2]|0;c[m>>2]=$D(c[h>>2]|0,c[o>>2]|0,c[o+4>>2]|0)|0;c[g>>2]=c[m>>2];break};case 4:{c[c[j>>2]>>2]=c[(c[h>>2]|0)+20>>2];c[g>>2]=0;break};default:c[g>>2]=12}while(0);i=f;return c[g>>2]|0}function ID(a){a=a|0;var b=0;b=i;i=i+16|0;c[b>>2]=a;i=b;return 4096}function JD(a){a=a|0;var b=0,d=0,f=0,g=0;b=i;i=i+16|0;g=b+8|0;f=b+4|0;d=b;c[g>>2]=a;c[f>>2]=c[g>>2];c[d>>2]=0;if(!((e[(c[f>>2]|0)+18>>1]|0)&16)){g=c[d>>2]|0;i=b;return g|0}c[d>>2]=c[d>>2]|4096;g=c[d>>2]|0;i=b;return g|0}function KD(a,d,f,g){a=a|0;d=d|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;k=i;i=i+48|0;v=k+32|0;m=k+28|0;n=k+24|0;t=k+20|0;u=k+16|0;r=k+12|0;h=k+8|0;l=k+4|0;q=k;o=k+40|0;p=k+38|0;s=k+36|0;c[v>>2]=a;c[m>>2]=d;c[n>>2]=f;c[t>>2]=g;c[u>>2]=c[v>>2];c[r>>2]=c[(c[u>>2]|0)+36>>2];c[l>>2]=c[c[r>>2]>>2];c[q>>2]=0;b[o>>1]=(1<<(c[m>>2]|0)+(c[n>>2]|0))-(1<<c[m>>2]);if(c[t>>2]&1){b[p>>1]=0;c[h>>2]=c[(c[l>>2]|0)+32>>2];while(1){if(!(c[h>>2]|0))break;if((c[h>>2]|0)!=(c[r>>2]|0))b[p>>1]=e[p>>1]|0|(e[(c[h>>2]|0)+10>>1]|0);c[h>>2]=c[(c[h>>2]|0)+4>>2]}if(!((e[o>>1]|0)&(e[p>>1]|0)))c[q>>2]=_D(c[l>>2]|0,2,(c[m>>2]|0)+120|0,c[n>>2]|0)|0;else c[q>>2]=0;if(c[q>>2]|0){v=c[q>>2]|0;i=k;return v|0}v=(c[r>>2]|0)+12|0;b[v>>1]=(e[v>>1]|0)&~(e[o>>1]|0);v=(c[r>>2]|0)+10|0;b[v>>1]=(e[v>>1]|0)&~(e[o>>1]|0);v=c[q>>2]|0;i=k;return v|0}if(!(c[t>>2]&4)){c[h>>2]=c[(c[l>>2]|0)+32>>2];while(1){if(!(c[h>>2]|0))break;if((e[(c[h>>2]|0)+12>>1]|0)&(e[o>>1]|0)){j=28;break}if((e[(c[h>>2]|0)+10>>1]|0)&(e[o>>1]|0)){j=28;break}c[h>>2]=c[(c[h>>2]|0)+4>>2]}if((j|0)==28)c[q>>2]=5;if(c[q>>2]|0){v=c[q>>2]|0;i=k;return v|0}c[q>>2]=_D(c[l>>2]|0,1,(c[m>>2]|0)+120|0,c[n>>2]|0)|0;if(c[q>>2]|0){v=c[q>>2]|0;i=k;return v|0}v=(c[r>>2]|0)+12|0;b[v>>1]=e[v>>1]|0|(e[o>>1]|0);v=c[q>>2]|0;i=k;return v|0}b[s>>1]=0;c[h>>2]=c[(c[l>>2]|0)+32>>2];while(1){if(!(c[h>>2]|0))break;if((e[(c[h>>2]|0)+12>>1]|0)&(e[o>>1]|0)){j=16;break}b[s>>1]=e[s>>1]|0|(e[(c[h>>2]|0)+10>>1]|0);c[h>>2]=c[(c[h>>2]|0)+4>>2]}if((j|0)==16)c[q>>2]=5;do if(!(c[q>>2]|0))if(!((e[s>>1]|0)&(e[o>>1]|0))){c[q>>2]=_D(c[l>>2]|0,0,(c[m>>2]|0)+120|0,c[n>>2]|0)|0;break}else{c[q>>2]=0;break}while(0);if(c[q>>2]|0){v=c[q>>2]|0;i=k;return v|0}v=(c[r>>2]|0)+10|0;b[v>>1]=e[v>>1]|0|(e[o>>1]|0);v=c[q>>2]|0;i=k;return v|0}function LD(a){a=a|0;var b=0;b=i;i=i+16|0;c[b>>2]=a;PD();RD();i=b;return}function MD(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;d=i;i=i+32|0;e=d+24|0;l=d+20|0;f=d+16|0;h=d+12|0;g=d+8|0;j=d+4|0;k=d;c[l>>2]=a;c[f>>2]=b;c[k>>2]=c[l>>2];c[h>>2]=c[(c[k>>2]|0)+36>>2];if(!(c[h>>2]|0)){c[e>>2]=0;l=c[e>>2]|0;i=d;return l|0}c[g>>2]=c[c[h>>2]>>2];c[j>>2]=(c[g>>2]|0)+32;while(1){if((c[c[j>>2]>>2]|0)==(c[h>>2]|0))break;c[j>>2]=(c[c[j>>2]>>2]|0)+4}c[c[j>>2]>>2]=c[(c[h>>2]|0)+4>>2];hc(c[h>>2]|0);c[(c[k>>2]|0)+36>>2]=0;PD();l=(c[g>>2]|0)+28|0;c[l>>2]=(c[l>>2]|0)+ -1;if(!(c[(c[g>>2]|0)+28>>2]|0)){if((c[f>>2]|0)!=0?(c[(c[g>>2]|0)+12>>2]|0)>=0:0)ub[c[37192+196>>2]&31](c[(c[g>>2]|0)+8>>2]|0)|0;QD(c[k>>2]|0)}RD();c[e>>2]=0;l=c[e>>2]|0;i=d;return l|0}function ND(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0;g=i;i=i+32|0;h=g+8|0;c[g+16>>2]=a;a=g;c[a>>2]=b;c[a+4>>2]=d;c[g+12>>2]=e;c[h>>2]=f;c[c[h>>2]>>2]=0;i=g;return 0}function OD(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;f=i;i=i+16|0;c[f+12>>2]=a;a=f;c[a>>2]=b;c[a+4>>2]=d;c[f+8>>2]=e;i=f;return 0}function PD(){return}function QD(a){a=a|0;var b=0,d=0,f=0,g=0,h=0;b=i;i=i+16|0;d=b+12|0;f=b+8|0;h=b+4|0;g=b;c[d>>2]=a;c[f>>2]=c[(c[(c[d>>2]|0)+8>>2]|0)+20>>2];if(!(c[f>>2]|0)){i=b;return}if(c[(c[f>>2]|0)+28>>2]|0){i=b;return}c[h>>2]=SD()|0;c[g>>2]=0;while(1){a=c[f>>2]|0;if((c[g>>2]|0)>=(e[(c[f>>2]|0)+20>>1]|0|0))break;if((c[a+12>>2]|0)>=0)zb[c[37192+268>>2]&63](c[(c[(c[f>>2]|0)+24>>2]|0)+(c[g>>2]<<2)>>2]|0,c[(c[f>>2]|0)+16>>2]|0)|0;else hc(c[(c[(c[f>>2]|0)+24>>2]|0)+(c[g>>2]<<2)>>2]|0);c[g>>2]=(c[g>>2]|0)+(c[h>>2]|0)}hc(c[a+24>>2]|0);if((c[(c[f>>2]|0)+12>>2]|0)>=0){TD(c[d>>2]|0,c[(c[f>>2]|0)+12>>2]|0,28999);c[(c[f>>2]|0)+12>>2]=-1}c[(c[c[f>>2]>>2]|0)+20>>2]=0;hc(c[f>>2]|0);i=b;return}function RD(){return}function SD(){var a=0,b=0,d=0,e=0;a=i;i=i+16|0;b=a+8|0;d=a+4|0;e=a;c[d>>2]=32768;c[e>>2]=qb[c[37192+292>>2]&1]()|0;if((c[e>>2]|0)<(c[d>>2]|0)){c[b>>2]=1;e=c[b>>2]|0;i=a;return e|0}else{c[b>>2]=(c[e>>2]|0)/(c[d>>2]|0)|0;e=c[b>>2]|0;i=a;return e|0}return 0}function TD(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;g=e+8|0;h=e+4|0;f=e;c[g>>2]=a;c[h>>2]=b;c[f>>2]=d;if(!(ub[c[37192+16>>2]&31](c[h>>2]|0)|0)){i=e;return}if(c[g>>2]|0)d=c[(c[g>>2]|0)+32>>2]|0;else d=0;UD(4106,37496,d,c[f>>2]|0)|0;i=e;return}function UD(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;g=i;i=i+48|0;h=g;l=g+40|0;m=g+36|0;f=g+32|0;j=g+28|0;k=g+24|0;n=g+20|0;c[l>>2]=a;c[m>>2]=b;c[f>>2]=d;c[j>>2]=e;c[n>>2]=c[(Ya()|0)>>2];c[k>>2]=gb(c[n>>2]|0)|0;if(!(c[f>>2]|0))c[f>>2]=1216;a=c[l>>2]|0;e=c[n>>2]|0;n=c[m>>2]|0;d=c[f>>2]|0;b=c[k>>2]|0;c[h>>2]=c[j>>2];c[h+4>>2]=e;c[h+8>>2]=n;c[h+12>>2]=d;c[h+16>>2]=b;tc(a,37504,h);i=g;return c[l>>2]|0}function VD(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;f=e;j=e+12|0;h=e+8|0;g=e+4|0;c[j>>2]=a;c[h>>2]=b;c[g>>2]=d;b=c[j>>2]|0;a=c[h>>2]|0;c[f>>2]=c[g>>2];a=Ja(b|0,a|0,f|0)|0;i=e;return a|0}function WD(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;e=i;i=i+544|0;k=e;l=e+16|0;g=e+12|0;j=e+8|0;f=e+4|0;h=e+20|0;c[l>>2]=b;c[g>>2]=d;c[f>>2]=-1;c[k>>2]=c[l>>2];sc(512,h,1200,k)|0;c[j>>2]=aF(h|0)|0;while(1){if((c[j>>2]|0)<=1)break;if((a[h+(c[j>>2]|0)>>0]|0)==47)break;c[j>>2]=(c[j>>2]|0)+ -1}if((c[j>>2]|0)>0){a[h+(c[j>>2]|0)>>0]=0;c[f>>2]=ZD(h,0,0)|0}c[c[g>>2]>>2]=c[f>>2];if((c[f>>2]|0)>=0){l=0;i=e;return l|0}l=UD(Ij(28344)|0,37536,h,28344)|0;i=e;return l|0}function XD(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if($a()|0){a=0;i=e;return a|0}a=fb(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;i=e;return a|0}function YD(){var a=0,b=0;b=i;a=Pa(30)|0;i=b;return a|0}function ZD(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;l=i;i=i+112|0;k=l;f=l+100|0;g=l+96|0;e=l+92|0;j=l+88|0;h=l+84|0;m=l+8|0;c[f>>2]=a;c[g>>2]=b;c[e>>2]=d;c[h>>2]=(c[e>>2]|0)!=0?c[e>>2]|0:420;while(1){c[j>>2]=pb[c[37192+4>>2]&31](c[f>>2]|0,c[g>>2]|524288,c[h>>2]|0)|0;if((c[j>>2]|0)<0)if((c[(Ya()|0)>>2]|0)==4)continue;else break;if((c[j>>2]|0)>=3)break;ub[c[37192+16>>2]&31](c[j>>2]|0)|0;a=c[j>>2]|0;c[k>>2]=c[f>>2];c[k+4>>2]=a;tc(28,37760,k);c[j>>2]=-1;if((pb[c[37192+4>>2]&31](37808,c[g>>2]|0,c[e>>2]|0)|0)<0)break}if(!((c[j>>2]|0)>=0&(c[e>>2]|0)!=0)){a=c[j>>2]|0;i=l;return a|0}if(zb[c[37192+64>>2]&63](c[j>>2]|0,m)|0){a=c[j>>2]|0;i=l;return a|0}if(c[m+36>>2]|0){a=c[j>>2]|0;i=l;return a|0}if((c[m+12>>2]&511|0)==(c[e>>2]|0)){a=c[j>>2]|0;i=l;return a|0}zb[c[37192+172>>2]&63](c[j>>2]|0,c[e>>2]|0)|0;a=c[j>>2]|0;i=l;return a|0}function _D(a,d,e,f){a=a|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;m=i;i=i+48|0;o=m;n=m+36|0;k=m+32|0;l=m+28|0;g=m+24|0;j=m+8|0;h=m+4|0;c[n>>2]=a;c[k>>2]=d;c[l>>2]=e;c[g>>2]=f;c[h>>2]=0;if((c[(c[n>>2]|0)+12>>2]|0)<0){a=c[h>>2]|0;i=m;return a|0}c[j+0>>2]=0;c[j+4>>2]=0;c[j+8>>2]=0;c[j+12>>2]=0;b[j>>1]=c[k>>2];b[j+2>>1]=0;c[j+4>>2]=c[l>>2];c[j+8>>2]=c[g>>2];d=c[9320]|0;a=c[(c[n>>2]|0)+12>>2]|0;c[o>>2]=j;c[h>>2]=pb[d&31](a,13,o)|0;c[h>>2]=(c[h>>2]|0)!=-1?0:5;a=c[h>>2]|0;i=m;return a|0}function $D(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;k=i;i=i+128|0;f=k+112|0;g=k+108|0;n=k+16|0;e=k+8|0;l=k+32|0;m=k+28|0;h=k;j=k+24|0;c[g>>2]=a;a=n;c[a>>2]=b;c[a+4>>2]=d;a:do if((c[(c[g>>2]|0)+40>>2]|0)>0){if(zb[c[37192+64>>2]&63](c[(c[g>>2]|0)+12>>2]|0,l)|0){c[f>>2]=1802;a=c[f>>2]|0;i=k;return a|0}b=n;d=c[(c[g>>2]|0)+40>>2]|0;d=bF(c[b>>2]|0,c[b+4>>2]|0,d|0,((d|0)<0)<<31>>31|0)|0;d=ZE(d|0,D|0,1,0)|0;b=c[(c[g>>2]|0)+40>>2]|0;b=jF(d|0,D|0,b|0,((b|0)<0)<<31>>31|0)|0;d=c[(c[g>>2]|0)+40>>2]|0;d=lF(b|0,D|0,d|0,((d|0)<0)<<31>>31|0)|0;b=e;c[b>>2]=d;c[b+4>>2]=D;b=e;d=c[b+4>>2]|0;a=c[l+36>>2]|0;n=((a|0)<0)<<31>>31;if((d|0)>(n|0)|((d|0)==(n|0)?(c[b>>2]|0)>>>0>a>>>0:0)){c[m>>2]=c[l+40>>2];a=e;if(eE(c[(c[g>>2]|0)+12>>2]|0,c[a>>2]|0,c[a+4>>2]|0)|0){a=c[(Ya()|0)>>2]|0;c[(c[g>>2]|0)+20>>2]=a;c[f>>2]=UD(1546,37568,c[(c[g>>2]|0)+32>>2]|0,28530)|0;a=c[f>>2]|0;i=k;return a|0}b=($(((c[l+36>>2]|0)+(c[m>>2]<<1)-1|0)/(c[m>>2]|0)|0,c[m>>2]|0)|0)-1|0;a=h;c[a>>2]=b;c[a+4>>2]=((b|0)<0)<<31>>31;while(1){b=h;l=c[b+4>>2]|0;a=e;n=c[a+4>>2]|0;if(!((l|0)<(n|0)|((l|0)==(n|0)?(c[b>>2]|0)>>>0<(c[a>>2]|0)>>>0:0)))break a;a=h;c[j>>2]=fE(c[g>>2]|0,c[a>>2]|0,c[a+4>>2]|0,1216,1)|0;if((c[j>>2]|0)!=1)break;b=c[m>>2]|0;a=h;b=bF(c[a>>2]|0,c[a+4>>2]|0,b|0,((b|0)<0)<<31>>31|0)|0;a=h;c[a>>2]=b;c[a+4>>2]=D}c[f>>2]=778;a=c[f>>2]|0;i=k;return a|0}}while(0);c[f>>2]=0;a=c[f>>2]|0;i=k;return a|0}function aE(f,g,h){f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;j=i;i=i+16|0;l=j+4|0;m=j+8|0;k=j;c[l>>2]=f;a[m>>0]=g;c[k>>2]=h;if((c[c[k>>2]>>2]|0)<0){c[c[k>>2]>>2]=((e[(c[l>>2]|0)+18>>1]|0)&(d[m>>0]|0)|0)!=0&1;i=j;return}h=d[m>>0]|0;if(!(c[c[k>>2]>>2]|0)){f=(c[l>>2]|0)+18|0;b[f>>1]=(e[f>>1]|0)&~h;i=j;return}else{f=(c[l>>2]|0)+18|0;b[f>>1]=e[f>>1]|0|h;i=j;return}}function bE(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;k=i;i=i+32|0;n=k;g=k+24|0;l=k+20|0;h=k+16|0;f=k+12|0;j=k+8|0;m=k+4|0;c[l>>2]=b;c[h>>2]=e;b=dE()|0;c[m>>2]=b;c[m>>2]=(c[m>>2]|0)==0?19120:b;b=(aF(c[m>>2]|0)|0)+25|0;if(b>>>0>=(c[l>>2]|0)>>>0){c[g>>2]=1;b=c[g>>2]|0;i=k;return b|0}do{e=(c[l>>2]|0)-18|0;b=c[h>>2]|0;c[n>>2]=c[m>>2];sc(e,b,37888,n)|0;c[j>>2]=aF(c[h>>2]|0)|0;vc(15,(c[h>>2]|0)+(c[j>>2]|0)|0);c[f>>2]=0;while(1){e=(c[h>>2]|0)+(c[j>>2]|0)|0;if((c[f>>2]|0)>>>0>=15)break;a[(c[h>>2]|0)+(c[j>>2]|0)>>0]=a[37824+(((d[e>>0]|0)>>>0)%62|0)>>0]|0;c[f>>2]=(c[f>>2]|0)+1;c[j>>2]=(c[j>>2]|0)+1}a[e>>0]=0;a[(c[h>>2]|0)+((c[j>>2]|0)+1)>>0]=0}while((zb[c[37192+28>>2]&63](c[h>>2]|0,0)|0)==0);c[g>>2]=0;b=c[g>>2]|0;i=k;return b|0}function cE(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+80|0;e=b+76|0;d=b;c[e>>2]=a;if(!(c[(c[e>>2]|0)+8>>2]|0)){e=0;e=e&1;i=b;return e|0}if(zb[c[37192+52>>2]&63](c[(c[e>>2]|0)+32>>2]|0,d)|0){e=1;e=e&1;i=b;return e|0}e=(c[d+72>>2]|0)!=(c[(c[(c[e>>2]|0)+8>>2]|0)+4>>2]|0);e=e&1;i=b;return e|0}function dE(){var a=0,b=0,d=0,e=0,f=0;a=i;i=i+96|0;e=a+80|0;d=a+4|0;b=a;c[b>>2]=0;c[9476]=c[392];if(!(c[9477]|0))c[9477]=ab(37976)|0;if(!(c[9478]|0))c[9478]=ab(37992)|0;c[e>>2]=0;while(1){if((c[e>>2]|0)>>>0>=7){d=12;break}if((((c[b>>2]|0)!=0?(zb[c[37192+52>>2]&63](c[b>>2]|0,d)|0)==0:0)?(c[d+12>>2]&61440|0)==16384:0)?(zb[c[37192+28>>2]&63](c[b>>2]|0,7)|0)==0:0){d=12;break}f=c[e>>2]|0;c[e>>2]=f+1;c[b>>2]=c[37904+(f<<2)>>2]}if((d|0)==12){i=a;return c[b>>2]|0}return 0}function eE(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;g=e+12|0;h=e;f=e+8|0;c[g>>2]=a;a=h;c[a>>2]=b;c[a+4>>2]=d;while(1){c[f>>2]=zb[c[37192+76>>2]&63](c[g>>2]|0,c[h>>2]|0)|0;if((c[f>>2]|0)>=0){d=4;break}if((c[(Ya()|0)>>2]|0)!=4){d=4;break}}if((d|0)==4){i=e;return c[f>>2]|0}return 0}function fE(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0;g=i;i=i+32|0;h=g+16|0;l=g;k=g+12|0;j=g+8|0;c[h>>2]=a;a=l;c[a>>2]=b;c[a+4>>2]=d;c[k>>2]=e;c[j>>2]=f;a=l;a=gE(c[(c[h>>2]|0)+12>>2]|0,c[a>>2]|0,c[a+4>>2]|0,c[k>>2]|0,c[j>>2]|0,(c[h>>2]|0)+20|0)|0;i=g;return a|0}function gE(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;j=i;i=i+48|0;h=j+36|0;n=j+32|0;r=j+8|0;o=j+28|0;p=j+24|0;k=j+20|0;l=j+16|0;q=j;c[n>>2]=a;a=r;c[a>>2]=b;c[a+4>>2]=d;c[o>>2]=e;c[p>>2]=f;c[k>>2]=g;c[l>>2]=0;c[p>>2]=c[p>>2]&131071;while(1){a=va(c[n>>2]|0,c[r>>2]|0,0)|0;b=q;c[b>>2]=a;c[b+4>>2]=((a|0)<0)<<31>>31;b=q;a=r;if((c[b>>2]|0)!=(c[a>>2]|0)?1:(c[b+4>>2]|0)!=(c[a+4>>2]|0))break;c[l>>2]=pb[c[37192+136>>2]&31](c[n>>2]|0,c[o>>2]|0,c[p>>2]|0)|0;if((c[l>>2]|0)>=0){m=10;break}if((c[(Ya()|0)>>2]|0)!=4){m=10;break}}if((m|0)==10){if((c[l>>2]|0)<0&(c[k>>2]|0)!=0){a=c[(Ya()|0)>>2]|0;c[c[k>>2]>>2]=a}c[h>>2]=c[l>>2];a=c[h>>2]|0;i=j;return a|0}if(c[k>>2]|0){a=q;if((c[a>>2]|0)==-1?(c[a+4>>2]|0)==-1:0)l=c[(Ya()|0)>>2]|0;else l=0;c[c[k>>2]>>2]=l}c[h>>2]=-1;a=c[h>>2]|0;i=j;return a|0}function hE(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=i;i=i+16|0;f=e+8|0;h=e+4|0;g=e;c[h>>2]=a;c[g>>2]=b;switch(c[h>>2]|0){case 37:case 4:case 16:case 110:case 11:{c[f>>2]=5;break};case 1:{d=5;break};case 13:{if((c[g>>2]|0)==3850|(c[g>>2]|0)==2058|(c[g>>2]|0)==2314|(c[g>>2]|0)==3594)c[f>>2]=5;else d=5;break};default:c[f>>2]=c[g>>2]}if((d|0)==5)c[f>>2]=3;i=e;return c[f>>2]|0}function iE(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;f=i;i=i+16|0;g=f+12|0;e=f;c[g>>2]=a;c[f+8>>2]=b;c[f+4>>2]=d;c[e>>2]=Xa(c[g>>2]|0)|0;i=f;return c[e>>2]|0}function jE(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;j=i;i=i+48|0;o=j+36|0;k=j+32|0;p=j+8|0;q=j+28|0;g=j+24|0;m=j+20|0;n=j+16|0;l=j;c[k>>2]=a;a=p;c[a>>2]=b;c[a+4>>2]=d;c[q>>2]=e;c[g>>2]=f;c[n>>2]=0;c[g>>2]=c[g>>2]&131071;do{a=va(c[(c[k>>2]|0)+12>>2]|0,c[p>>2]|0,0)|0;b=l;c[b>>2]=a;c[b+4>>2]=((a|0)<0)<<31>>31;b=l;a=p;if((c[b>>2]|0)!=(c[a>>2]|0)?1:(c[b+4>>2]|0)!=(c[a+4>>2]|0)){h=3;break}c[m>>2]=pb[c[37192+100>>2]&31](c[(c[k>>2]|0)+12>>2]|0,c[q>>2]|0,c[g>>2]|0)|0;if((c[m>>2]|0)==(c[g>>2]|0))break;if((c[m>>2]|0)>=0){if((c[m>>2]|0)>0){c[g>>2]=(c[g>>2]|0)-(c[m>>2]|0);b=c[m>>2]|0;a=p;b=bF(c[a>>2]|0,c[a+4>>2]|0,b|0,((b|0)<0)<<31>>31|0)|0;a=p;c[a>>2]=b;c[a+4>>2]=D;c[n>>2]=(c[n>>2]|0)+(c[m>>2]|0);c[q>>2]=(c[q>>2]|0)+(c[m>>2]|0)}}else{if((c[(Ya()|0)>>2]|0)!=4){h=11;break}c[m>>2]=1}}while((c[m>>2]|0)>0);if((h|0)==3){a=l;if((c[a>>2]|0)==-1?(c[a+4>>2]|0)==-1:0){a=c[(Ya()|0)>>2]|0;c[(c[k>>2]|0)+20>>2]=a}else c[(c[k>>2]|0)+20>>2]=0;c[o>>2]=-1;a=c[o>>2]|0;i=j;return a|0}else if((h|0)==11){c[n>>2]=0;a=c[(Ya()|0)>>2]|0;c[(c[k>>2]|0)+20>>2]=a}c[o>>2]=(c[m>>2]|0)+(c[n>>2]|0);a=c[o>>2]|0;i=j;return a|0}function kE(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;c[d>>2]=c[e>>2];if((c[(c[d>>2]|0)+12>>2]|0)>=0){TD(c[d>>2]|0,c[(c[d>>2]|0)+12>>2]|0,26735);c[(c[d>>2]|0)+12>>2]=-1}hc(c[(c[d>>2]|0)+28>>2]|0);d=(c[d>>2]|0)+0|0;a=d+44|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(a|0));i=b;return 0}function lE(a,b){a=a|0;b=b|0;var d=0;d=i;i=i+16|0;c[d+4>>2]=a;c[d>>2]=b;i=d;return 38016}function mE(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=kE(c[d>>2]|0)|0;i=b;return a|0}function nE(a,b){a=a|0;b=b|0;var d=0;d=i;i=i+16|0;c[d+4>>2]=a;c[d>>2]=b;i=d;return 0}function oE(a,b){a=a|0;b=b|0;var d=0;d=i;i=i+16|0;c[d+4>>2]=a;c[d>>2]=b;i=d;return 0}function pE(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;i=i+16|0;e=d;c[d+4>>2]=a;c[e>>2]=b;c[c[e>>2]>>2]=0;i=d;return 0}function qE(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0;d=i;i=i+96|0;k=d+92|0;j=d+88|0;e=d+84|0;h=d+8|0;f=d+4|0;g=d;c[k>>2]=a;c[j>>2]=b;c[e>>2]=0;if(zb[c[37192+52>>2]&63](c[k>>2]|0,h)|0){k=c[e>>2]|0;i=d;return k|0}PD();c[f>>2]=c[9588];while(1){if(c[f>>2]|0)if((c[c[f>>2]>>2]|0)!=(c[h>>2]|0))a=1;else a=(c[(c[f>>2]|0)+4>>2]|0)!=(c[h+72>>2]|0);else a=0;b=c[f>>2]|0;if(!a)break;c[f>>2]=c[b+32>>2]}if(b){c[g>>2]=(c[f>>2]|0)+28;while(1){if(!(c[c[g>>2]>>2]|0))break;if((c[(c[c[g>>2]>>2]|0)+4>>2]|0)==(c[j>>2]|0))break;c[g>>2]=(c[c[g>>2]>>2]|0)+8}c[e>>2]=c[c[g>>2]>>2];if(c[e>>2]|0)c[c[g>>2]>>2]=c[(c[e>>2]|0)+8>>2]}RD();k=c[e>>2]|0;i=d;return k|0}function rE(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;o=i;i=i+624|0;q=o+100|0;l=o+96|0;k=o+92|0;n=o+88|0;h=o+84|0;j=o+80|0;p=o+104|0;r=o+76|0;m=o;c[q>>2]=b;c[l>>2]=d;c[k>>2]=e;c[n>>2]=f;c[h>>2]=g;c[j>>2]=0;c[c[k>>2]>>2]=0;c[c[n>>2]>>2]=0;c[c[h>>2]>>2]=0;if(!(c[l>>2]&526336)){if(!(c[l>>2]&8)){b=c[j>>2]|0;i=o;return b|0}c[c[k>>2]>>2]=384;b=c[j>>2]|0;i=o;return b|0}c[r>>2]=(Mb(c[q>>2]|0)|0)-1;while(1){if((a[(c[q>>2]|0)+(c[r>>2]|0)>>0]|0)==45)break;c[r>>2]=(c[r>>2]|0)+ -1}dF(p|0,c[q>>2]|0,c[r>>2]|0)|0;a[p+(c[r>>2]|0)>>0]=0;if(!(zb[c[37192+52>>2]&63](p,m)|0)){c[c[k>>2]>>2]=c[m+12>>2]&511;c[c[n>>2]>>2]=c[m+20>>2];c[c[h>>2]>>2]=c[m+24>>2];b=c[j>>2]|0;i=o;return b|0}else{c[j>>2]=1802;b=c[j>>2]|0;i=o;return b|0}return 0}function sE(a,d,f,g,h){a=a|0;d=d|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;j=i;i=i+48|0;o=j;s=j+40|0;r=j+36|0;u=j+32|0;n=j+28|0;t=j+24|0;p=j+20|0;q=j+16|0;k=j+12|0;l=j+8|0;m=j+4|0;c[s>>2]=a;c[r>>2]=d;c[u>>2]=f;c[n>>2]=g;c[t>>2]=h;c[q>>2]=c[u>>2];c[k>>2]=0;c[(c[q>>2]|0)+12>>2]=c[r>>2];c[(c[q>>2]|0)+4>>2]=c[s>>2];c[(c[q>>2]|0)+32>>2]=c[n>>2];b[(c[q>>2]|0)+18>>1]=c[t>>2]&255;if(pg((c[t>>2]&64|0)!=0?c[n>>2]|0:0,38136,1)|0){u=(c[q>>2]|0)+18|0;b[u>>1]=e[u>>1]|0|16}if(!(UE(c[(c[s>>2]|0)+16>>2]|0,1112)|0)){u=(c[q>>2]|0)+18|0;b[u>>1]=e[u>>1]|0|1}if(c[t>>2]&128)c[p>>2]=38016;else c[p>>2]=zb[c[c[(c[s>>2]|0)+20>>2]>>2]&63](c[n>>2]|0,c[q>>2]|0)|0;if((c[p>>2]|0)!=38144){if((c[p>>2]|0)==37112){c[m>>2]=(aF(c[n>>2]|0)|0)+6;c[l>>2]=fc(c[m>>2]|0)|0;if(!(c[l>>2]|0))c[k>>2]=7;else{a=c[m>>2]|0;u=c[l>>2]|0;c[o>>2]=c[n>>2];sc(a,u,38224,o)|0}c[(c[q>>2]|0)+24>>2]=c[l>>2]}}else{PD();c[k>>2]=tE(c[q>>2]|0,(c[q>>2]|0)+8|0)|0;if(c[k>>2]|0){TD(c[q>>2]|0,c[r>>2]|0,30114);c[r>>2]=-1}RD()}c[(c[q>>2]|0)+20>>2]=0;if(!(c[k>>2]|0)){c[c[q>>2]>>2]=c[p>>2];uE(c[q>>2]|0);u=c[k>>2]|0;i=j;return u|0}if((c[r>>2]|0)<0){u=c[k>>2]|0;i=j;return u|0}TD(c[q>>2]|0,c[r>>2]|0,30199);u=c[k>>2]|0;i=j;return u|0}function tE(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;h=i;i=i+112|0;e=h+104|0;j=h+100|0;g=h+96|0;l=h+92|0;m=h+88|0;d=h+80|0;k=h+4|0;f=h;c[j>>2]=a;c[g>>2]=b;c[f>>2]=0;c[m>>2]=c[(c[j>>2]|0)+12>>2];c[l>>2]=zb[c[37192+64>>2]&63](c[m>>2]|0,k)|0;if(c[l>>2]|0){m=c[(Ya()|0)>>2]|0;c[(c[j>>2]|0)+20>>2]=m;if((c[(c[j>>2]|0)+20>>2]|0)==75){c[e>>2]=22;m=c[e>>2]|0;i=h;return m|0}else{c[e>>2]=10;m=c[e>>2]|0;i=h;return m|0}}c[d+0>>2]=0;c[d+4>>2]=0;c[d>>2]=c[k>>2];c[d+4>>2]=c[k+72>>2];c[f>>2]=c[9588];while(1){if(c[f>>2]|0)b=(TE(d,c[f>>2]|0,8)|0)!=0;else b=0;j=c[f>>2]|0;if(!b)break;c[f>>2]=c[j+32>>2]}if(!j){c[f>>2]=fc(40)|0;if(!(c[f>>2]|0)){c[e>>2]=7;m=c[e>>2]|0;i=h;return m|0}b=(c[f>>2]|0)+0|0;j=b+40|0;do{c[b>>2]=0;b=b+4|0}while((b|0)<(j|0));m=c[f>>2]|0;c[m+0>>2]=c[d+0>>2];c[m+4>>2]=c[d+4>>2];c[(c[f>>2]|0)+16>>2]=1;c[(c[f>>2]|0)+32>>2]=c[9588];c[(c[f>>2]|0)+36>>2]=0;if(c[9588]|0)c[(c[9588]|0)+36>>2]=c[f>>2];c[9588]=c[f>>2]}else{m=(c[f>>2]|0)+16|0;c[m>>2]=(c[m>>2]|0)+1}c[c[g>>2]>>2]=c[f>>2];c[e>>2]=0;m=c[e>>2]|0;i=h;return m|0}function uE(a){a=a|0;var d=0,f=0,g=0,h=0,j=0;d=i;i=i+96|0;g=d;f=d+84|0;h=d+8|0;j=d+4|0;c[f>>2]=a;if((e[(c[f>>2]|0)+18>>1]|0)&256){i=d;return}c[j>>2]=zb[c[37192+64>>2]&63](c[(c[f>>2]|0)+12>>2]|0,h)|0;if(c[j>>2]|0){c[g>>2]=c[(c[f>>2]|0)+32>>2];tc(28,38232,g);j=(c[f>>2]|0)+18|0;b[j>>1]=e[j>>1]|0|256;i=d;return}if((c[h+16>>2]|0)==0?((e[(c[f>>2]|0)+18>>1]|0)&32|0)==0:0){c[g>>2]=c[(c[f>>2]|0)+32>>2];tc(28,38256,g);j=(c[f>>2]|0)+18|0;b[j>>1]=e[j>>1]|0|256;i=d;return}a=c[f>>2]|0;if((c[h+16>>2]|0)>>>0>1){c[g>>2]=c[a+32>>2];tc(28,38288,g);j=(c[f>>2]|0)+18|0;b[j>>1]=e[j>>1]|0|256;i=d;return}if(!(cE(a)|0)){i=d;return}c[g>>2]=c[(c[f>>2]|0)+32>>2];tc(28,38320,g);j=(c[f>>2]|0)+18|0;b[j>>1]=e[j>>1]|0|256;i=d;return}function vE(a){a=a|0;var b=0,d=0,e=0,f=0;d=i;i=i+16|0;e=d+8|0;b=d+4|0;f=d;c[e>>2]=a;c[b>>2]=0;c[f>>2]=c[e>>2];uE(c[f>>2]|0);xE(c[e>>2]|0,0)|0;PD();if((c[(c[f>>2]|0)+8>>2]|0)!=0?(c[(c[(c[f>>2]|0)+8>>2]|0)+24>>2]|0)!=0:0)EE(c[f>>2]|0);FE(c[f>>2]|0);c[b>>2]=kE(c[e>>2]|0)|0;RD();i=d;return c[b>>2]|0}function wE(e,f){e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;k=i;i=i+48|0;g=k+44|0;q=k+40|0;j=k+36|0;h=k+32|0;l=k+28|0;m=k+24|0;n=k+8|0;o=k;c[q>>2]=e;c[j>>2]=f;c[h>>2]=0;c[l>>2]=c[q>>2];c[o>>2]=0;if((d[(c[l>>2]|0)+16>>0]|0|0)>=(c[j>>2]|0)){c[g>>2]=0;q=c[g>>2]|0;i=k;return q|0}PD();c[m>>2]=c[(c[l>>2]|0)+8>>2];if((d[(c[l>>2]|0)+16>>0]|0|0)!=(d[(c[m>>2]|0)+12>>0]|0|0)?(c[j>>2]|0)>1?1:(d[(c[m>>2]|0)+12>>0]|0|0)>=3:0)c[h>>2]=5;else p=6;a:do if((p|0)==6){do if((c[j>>2]|0)==1){if((d[(c[m>>2]|0)+12>>0]|0|0)!=1?(d[(c[m>>2]|0)+12>>0]|0|0)!=2:0)break;a[(c[l>>2]|0)+16>>0]=1;q=(c[m>>2]|0)+8|0;c[q>>2]=(c[q>>2]|0)+1;q=(c[m>>2]|0)+24|0;c[q>>2]=(c[q>>2]|0)+1;break a}while(0);c[n+8>>2]=1;b[n+2>>1]=0;if((c[j>>2]|0)!=1){if((c[j>>2]|0)==4?(d[(c[l>>2]|0)+16>>0]|0|0)<3:0)p=13}else p=13;if((p|0)==13?(b[n>>1]=(c[j>>2]|0)==1?0:1,c[n+4>>2]=c[282],(CE(c[l>>2]|0,n)|0)!=0):0){c[o>>2]=c[(Ya()|0)>>2];c[h>>2]=hE(c[o>>2]|0,3850)|0;if((c[h>>2]|0)==5)break;c[(c[l>>2]|0)+20>>2]=c[o>>2];break}do if((c[j>>2]|0)!=1){if((c[j>>2]|0)==4?(c[(c[m>>2]|0)+8>>2]|0)>1:0){c[h>>2]=5;break}b[n>>1]=1;p=c[282]|0;if((c[j>>2]|0)==2){c[n+4>>2]=p+1;c[n+8>>2]=1}else{c[n+4>>2]=p+2;c[n+8>>2]=510}if((CE(c[l>>2]|0,n)|0)!=0?(c[o>>2]=c[(Ya()|0)>>2],c[h>>2]=hE(c[o>>2]|0,3850)|0,(c[h>>2]|0)!=5):0)c[(c[l>>2]|0)+20>>2]=c[o>>2]}else{c[n+4>>2]=(c[282]|0)+2;c[n+8>>2]=510;if(CE(c[l>>2]|0,n)|0){c[o>>2]=c[(Ya()|0)>>2];c[h>>2]=hE(c[o>>2]|0,3850)|0}c[n+4>>2]=c[282];c[n+8>>2]=1;b[n>>1]=2;q=(CE(c[l>>2]|0,n)|0)!=0;if(q&(c[h>>2]|0)==0){c[o>>2]=c[(Ya()|0)>>2];c[h>>2]=2058}if(!(c[h>>2]|0)){a[(c[l>>2]|0)+16>>0]=1;q=(c[m>>2]|0)+24|0;c[q>>2]=(c[q>>2]|0)+1;c[(c[m>>2]|0)+8>>2]=1;break}if((c[h>>2]|0)==5)break a;c[(c[l>>2]|0)+20>>2]=c[o>>2];break a}while(0);n=c[j>>2]|0;if(!(c[h>>2]|0)){a[(c[l>>2]|0)+16>>0]=n;a[(c[m>>2]|0)+12>>0]=c[j>>2];break}if((n|0)==4){a[(c[l>>2]|0)+16>>0]=3;a[(c[m>>2]|0)+12>>0]=3}}while(0);RD();c[g>>2]=c[h>>2];q=c[g>>2]|0;i=k;return q|0}function xE(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;a=BE(c[f>>2]|0,c[e>>2]|0,0)|0;i=d;return a|0}function yE(e,f){e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;m=i;i=i+48|0;j=m;o=m+40|0;l=m+36|0;n=m+32|0;k=m+28|0;h=m+24|0;g=m+8|0;c[o>>2]=e;c[l>>2]=f;c[n>>2]=0;c[k>>2]=0;c[h>>2]=c[o>>2];PD();if((d[(c[(c[h>>2]|0)+8>>2]|0)+12>>0]|0)>1)c[k>>2]=1;do if((c[k>>2]|0)==0?(a[(c[(c[h>>2]|0)+8>>2]|0)+13>>0]|0)==0:0){b[g+2>>1]=0;c[g+4>>2]=(c[282]|0)+1;c[g+8>>2]=1;b[g>>1]=1;e=c[9320]|0;o=c[(c[h>>2]|0)+12>>2]|0;c[j>>2]=g;if(pb[e&31](o,12,j)|0){c[n>>2]=3594;o=c[(Ya()|0)>>2]|0;c[(c[h>>2]|0)+20>>2]=o;break}if((b[g>>1]|0)!=2)c[k>>2]=1}while(0);RD();c[c[l>>2]>>2]=c[k>>2];i=m;return c[n>>2]|0}function zE(a,f,g,h,j){a=a|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;l=i;i=i+160|0;k=l+148|0;E=l+144|0;n=l+140|0;r=l+136|0;z=l+132|0;p=l+128|0;C=l+124|0;D=l+120|0;m=l+116|0;o=l+112|0;t=l+108|0;u=l+104|0;v=l+100|0;x=l+96|0;y=l+20|0;q=l+16|0;w=l+12|0;B=l+8|0;A=l+4|0;s=l;c[E>>2]=a;c[n>>2]=f;c[r>>2]=g;c[z>>2]=h;c[p>>2]=j;c[C>>2]=c[E>>2];c[o>>2]=0;c[t>>2]=SD()|0;if((c[(c[C>>2]|0)+36>>2]|0)==0?(c[o>>2]=AE(c[C>>2]|0)|0,(c[o>>2]|0)!=0):0){c[k>>2]=c[o>>2];E=c[k>>2]|0;i=l;return E|0}c[D>>2]=c[(c[C>>2]|0)+36>>2];c[m>>2]=c[c[D>>2]>>2];c[u>>2]=$(((c[n>>2]|0)+(c[t>>2]|0)|0)/(c[t>>2]|0)|0,c[t>>2]|0)|0;a:do if((e[(c[m>>2]|0)+20>>1]|0|0)<(c[u>>2]|0)){c[x>>2]=$(c[u>>2]|0,c[r>>2]|0)|0;c[(c[m>>2]|0)+16>>2]=c[r>>2];b:do if((c[(c[m>>2]|0)+12>>2]|0)>=0){if(zb[c[37192+64>>2]&63](c[(c[m>>2]|0)+12>>2]|0,y)|0){c[o>>2]=4874;break a}if((c[y+36>>2]|0)<(c[x>>2]|0)){if(!(c[z>>2]|0))break a;c[q>>2]=(c[y+36>>2]|0)/4096|0;while(1){if((c[q>>2]|0)>=((c[x>>2]|0)/4096|0|0))break b;E=(c[q>>2]<<12)+4096-1|0;if((gE(c[(c[m>>2]|0)+12>>2]|0,E,((E|0)<0)<<31>>31,1216,1,0)|0)!=1)break;c[q>>2]=(c[q>>2]|0)+1}c[w>>2]=c[(c[m>>2]|0)+8>>2];c[o>>2]=UD(4874,37616,c[w>>2]|0,29258)|0;break a}}while(0);c[v>>2]=jc(c[(c[m>>2]|0)+24>>2]|0,c[u>>2]<<2)|0;if(!(c[v>>2]|0)){c[o>>2]=3082;break}c[(c[m>>2]|0)+24>>2]=c[v>>2];while(1){if((e[(c[m>>2]|0)+20>>1]|0|0)>=(c[u>>2]|0))break a;c[B>>2]=$(c[r>>2]|0,c[t>>2]|0)|0;if((c[(c[m>>2]|0)+12>>2]|0)>=0){h=c[9362]|0;g=c[B>>2]|0;f=(d[(c[m>>2]|0)+22>>0]|0|0)!=0?1:3;a=c[(c[m>>2]|0)+12>>2]|0;E=c[r>>2]|0;E=lF(E|0,((E|0)<0)<<31>>31|0,e[(c[m>>2]|0)+20>>1]|0|0,0)|0;c[s>>2]=tb[h&1](0,g,f,1,a,E)|0;if((c[s>>2]|0)==(-1|0)){q=21;break}}else{c[s>>2]=fc(c[r>>2]|0)|0;if(!(c[s>>2]|0)){q=23;break}_E(c[s>>2]|0,0,c[r>>2]|0)|0}c[A>>2]=0;while(1){if((c[A>>2]|0)>=(c[t>>2]|0))break;E=$(c[r>>2]|0,c[A>>2]|0)|0;c[(c[(c[m>>2]|0)+24>>2]|0)+((e[(c[m>>2]|0)+20>>1]|0)+(c[A>>2]|0)<<2)>>2]=(c[s>>2]|0)+E;c[A>>2]=(c[A>>2]|0)+1}E=(c[m>>2]|0)+20|0;b[E>>1]=(e[E>>1]|0)+(c[t>>2]|0)}if((q|0)==21){c[o>>2]=UD(5386,37720,c[(c[m>>2]|0)+8>>2]|0,29285)|0;break}else if((q|0)==23){c[o>>2]=7;break}}while(0);if((e[(c[m>>2]|0)+20>>1]|0|0)>(c[n>>2]|0))c[c[p>>2]>>2]=c[(c[(c[m>>2]|0)+24>>2]|0)+(c[n>>2]<<2)>>2];else c[c[p>>2]>>2]=0;if((c[o>>2]|0)==0?(d[(c[m>>2]|0)+22>>0]|0|0)!=0:0)c[o>>2]=8;c[k>>2]=c[o>>2];E=c[k>>2]|0;i=l;return E|0}function AE(b){b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;m=i;i=i+128|0;r=m;g=m+112|0;h=m+108|0;j=m+104|0;l=m+100|0;k=m+96|0;p=m+92|0;e=m+88|0;q=m+84|0;o=m+8|0;n=m+4|0;c[h>>2]=b;c[j>>2]=0;c[j>>2]=fc(16)|0;if(!(c[j>>2]|0)){c[g>>2]=7;b=c[g>>2]|0;i=m;return b|0}b=c[j>>2]|0;c[b+0>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;PD();c[p>>2]=c[(c[h>>2]|0)+8>>2];c[l>>2]=c[(c[p>>2]|0)+20>>2];a:do if(!(c[l>>2]|0)){if((zb[c[37192+64>>2]&63](c[(c[h>>2]|0)+12>>2]|0,o)|0)!=0?(d[(c[p>>2]|0)+13>>0]|0|0)==0:0)c[k>>2]=1802;else f=7;do if((f|0)==7){c[q>>2]=6+(aF(c[(c[h>>2]|0)+32>>2]|0)|0);c[l>>2]=fc(36+(c[q>>2]|0)|0)|0;if(!(c[l>>2]|0)){c[k>>2]=7;break}_E(c[l>>2]|0,0,36+(c[q>>2]|0)|0)|0;b=(c[l>>2]|0)+36|0;c[(c[l>>2]|0)+8>>2]=b;c[e>>2]=b;q=c[q>>2]|0;b=c[e>>2]|0;c[r>>2]=c[(c[h>>2]|0)+32>>2];sc(q,b,38360,r)|0;c[(c[l>>2]|0)+12>>2]=-1;c[(c[(c[h>>2]|0)+8>>2]|0)+20>>2]=c[l>>2];c[c[l>>2]>>2]=c[(c[h>>2]|0)+8>>2];c[(c[l>>2]|0)+4>>2]=8;if(!(c[(c[l>>2]|0)+4>>2]|0)){c[k>>2]=7;break}if(d[(c[p>>2]|0)+13>>0]|0)break a;c[n>>2]=66;if(pg(c[(c[h>>2]|0)+32>>2]|0,38368,0)|0){c[n>>2]=0;a[(c[l>>2]|0)+22>>0]=1}b=ZD(c[e>>2]|0,c[n>>2]|0,c[o+12>>2]&511)|0;c[(c[l>>2]|0)+12>>2]=b;if((c[(c[l>>2]|0)+12>>2]|0)<0){b=Ij(29111)|0;c[k>>2]=UD(b,37536,c[e>>2]|0,29111)|0;break}pb[c[37192+244>>2]&31](c[(c[l>>2]|0)+12>>2]|0,c[o+20>>2]|0,c[o+24>>2]|0)|0;c[k>>2]=0;if((_D(c[l>>2]|0,1,128,1)|0)==0?(eE(c[(c[l>>2]|0)+12>>2]|0,0,0)|0)!=0:0)c[k>>2]=UD(4618,37568,c[e>>2]|0,29127)|0;if(!(c[k>>2]|0))c[k>>2]=_D(c[l>>2]|0,0,128,1)|0;if(!(c[k>>2]|0))break a}while(0);QD(c[h>>2]|0);hc(c[j>>2]|0);RD();c[g>>2]=c[k>>2];b=c[g>>2]|0;i=m;return b|0}while(0);c[c[j>>2]>>2]=c[l>>2];b=(c[l>>2]|0)+28|0;c[b>>2]=(c[b>>2]|0)+1;c[(c[h>>2]|0)+36>>2]=c[j>>2];RD();c[(c[j>>2]|0)+4>>2]=c[(c[l>>2]|0)+32>>2];c[(c[l>>2]|0)+32>>2]=c[j>>2];c[g>>2]=0;b=c[g>>2]|0;i=m;return b|0}function BE(e,f,g){e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;n=i;i=i+48|0;k=n+44|0;q=n+40|0;l=n+36|0;h=n+28|0;o=n+24|0;p=n+8|0;m=n;c[q>>2]=e;c[l>>2]=f;c[n+32>>2]=g;c[h>>2]=c[q>>2];c[m>>2]=0;if((d[(c[h>>2]|0)+16>>0]|0|0)<=(c[l>>2]|0)){c[k>>2]=0;q=c[k>>2]|0;i=n;return q|0}PD();c[o>>2]=c[(c[h>>2]|0)+8>>2];do if((d[(c[h>>2]|0)+16>>0]|0|0)>1){if((c[l>>2]|0)==1?(b[p>>1]=0,b[p+2>>1]=0,c[p+4>>2]=(c[282]|0)+2,c[p+8>>2]=510,(CE(c[h>>2]|0,p)|0)!=0):0){c[m>>2]=2314;q=c[(Ya()|0)>>2]|0;c[(c[h>>2]|0)+20>>2]=q;break}b[p>>1]=2;b[p+2>>1]=0;c[p+4>>2]=c[282];c[p+8>>2]=2;if(!(CE(c[h>>2]|0,p)|0)){a[(c[o>>2]|0)+12>>0]=1;j=10;break}else{c[m>>2]=2058;q=c[(Ya()|0)>>2]|0;c[(c[h>>2]|0)+20>>2]=q;break}}else j=10;while(0);if((j|0)==10?(c[l>>2]|0)==0:0){q=(c[o>>2]|0)+8|0;c[q>>2]=(c[q>>2]|0)+ -1;do if(!(c[(c[o>>2]|0)+8>>2]|0)){b[p>>1]=2;b[p+2>>1]=0;c[p+8>>2]=0;c[p+4>>2]=0;if(!(CE(c[h>>2]|0,p)|0)){a[(c[o>>2]|0)+12>>0]=0;break}else{c[m>>2]=2058;q=c[(Ya()|0)>>2]|0;c[(c[h>>2]|0)+20>>2]=q;a[(c[o>>2]|0)+12>>0]=0;a[(c[h>>2]|0)+16>>0]=0;break}}while(0);q=(c[o>>2]|0)+24|0;c[q>>2]=(c[q>>2]|0)+ -1;if(!(c[(c[o>>2]|0)+24>>2]|0))DE(c[h>>2]|0)}RD();if(!(c[m>>2]|0))a[(c[h>>2]|0)+16>>0]=c[l>>2];c[k>>2]=c[m>>2];q=c[k>>2]|0;i=n;return q|0}function CE(f,g){f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;k=i;i=i+48|0;n=k;j=k+40|0;l=k+36|0;h=k+32|0;m=k+28|0;o=k+24|0;p=k+8|0;c[l>>2]=f;c[h>>2]=g;c[o>>2]=c[(c[l>>2]|0)+8>>2];if(((e[(c[l>>2]|0)+18>>1]|0)&1|0)==0?(d[(c[o>>2]|0)+13>>0]|0|0)==0:0)g=9;else g=3;do if((g|0)==3)if(!((e[(c[l>>2]|0)+18>>1]|0)&2)){if(d[(c[o>>2]|0)+13>>0]|0){c[m>>2]=0;break}b[p+2>>1]=0;c[p+4>>2]=(c[282]|0)+2;c[p+8>>2]=510;b[p>>1]=1;h=c[9320]|0;f=c[(c[l>>2]|0)+12>>2]|0;c[n>>2]=p;c[m>>2]=pb[h&31](f,13,n)|0;if((c[m>>2]|0)>=0){a[(c[o>>2]|0)+13>>0]=1;f=(c[o>>2]|0)+24|0;c[f>>2]=(c[f>>2]|0)+1;break}c[j>>2]=c[m>>2];f=c[j>>2]|0;i=k;return f|0}else g=9;while(0);if((g|0)==9){g=c[9320]|0;f=c[(c[l>>2]|0)+12>>2]|0;c[n>>2]=c[h>>2];c[m>>2]=pb[g&31](f,13,n)|0}c[j>>2]=c[m>>2];f=c[j>>2]|0;i=k;return f|0}function DE(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;d=i;i=i+16|0;g=d+12|0;b=d+8|0;e=d+4|0;f=d;c[g>>2]=a;c[b>>2]=c[(c[g>>2]|0)+8>>2];c[e>>2]=c[(c[b>>2]|0)+28>>2];while(1){if(!(c[e>>2]|0))break;c[f>>2]=c[(c[e>>2]|0)+8>>2];TD(c[g>>2]|0,c[c[e>>2]>>2]|0,25997);hc(c[e>>2]|0);c[e>>2]=c[f>>2]}c[(c[b>>2]|0)+28>>2]=0;i=d;return}function EE(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;d=b+8|0;e=b+4|0;f=b;c[d>>2]=a;c[e>>2]=c[(c[d>>2]|0)+8>>2];c[f>>2]=c[(c[d>>2]|0)+28>>2];c[(c[f>>2]|0)+8>>2]=c[(c[e>>2]|0)+28>>2];c[(c[e>>2]|0)+28>>2]=c[f>>2];c[(c[d>>2]|0)+12>>2]=-1;c[(c[d>>2]|0)+28>>2]=0;i=b;return}function FE(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;c[d>>2]=c[(c[e>>2]|0)+8>>2];if(!(c[d>>2]|0)){i=b;return}a=(c[d>>2]|0)+16|0;c[a>>2]=(c[a>>2]|0)+ -1;if(c[(c[d>>2]|0)+16>>2]|0){i=b;return}DE(c[e>>2]|0);a=c[(c[d>>2]|0)+32>>2]|0;if(c[(c[d>>2]|0)+36>>2]|0)c[(c[(c[d>>2]|0)+36>>2]|0)+32>>2]=a;else c[9588]=a;if(c[(c[d>>2]|0)+32>>2]|0)c[(c[(c[d>>2]|0)+32>>2]|0)+36>>2]=c[(c[d>>2]|0)+36>>2];hc(c[d>>2]|0);i=b;return}function GE(a,b){a=a|0;b=b|0;var d=0;d=i;i=i+16|0;c[d+4>>2]=a;c[d>>2]=b;i=d;return 38144}function HE(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;d=b;e=b+8|0;c[e>>2]=a;if((c[c[e>>2]>>2]|0)<=(c[(c[e>>2]|0)+4>>2]|0)){e=d;c[e>>2]=0;c[e+4>>2]=0;e=d;e=c[e>>2]|0;d=d+4|0;d=c[d>>2]|0;D=d;i=b;return e|0}else{f=(c[e>>2]|0)+4|0;a=c[f>>2]|0;c[f>>2]=a+1;a=Ld(c[(c[(c[e>>2]|0)+8>>2]|0)+(a<<2)>>2]|0)|0;e=d;c[e>>2]=a;c[e+4>>2]=D;e=d;e=c[e>>2]|0;d=d+4|0;d=c[d>>2]|0;D=d;i=b;return e|0}return 0}function IE(a){a=a|0;var b=0,d=0,e=0,f=0.0,g=0;b=i;i=i+16|0;d=b;e=b+8|0;c[e>>2]=a;if((c[c[e>>2]>>2]|0)<=(c[(c[e>>2]|0)+4>>2]|0)){h[d>>3]=0.0;f=+h[d>>3];i=b;return+f}else{g=(c[e>>2]|0)+4|0;a=c[g>>2]|0;c[g>>2]=a+1;h[d>>3]=+Hd(c[(c[(c[e>>2]|0)+8>>2]|0)+(a<<2)>>2]|0);f=+h[d>>3];i=b;return+f}return 0.0}function JE(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,j=0,k=0,l=0;e=i;i=i+32|0;f=e+20|0;j=e+16|0;l=e+12|0;g=e+8|0;k=e;c[j>>2]=b;c[l>>2]=d;if((c[c[l>>2]>>2]|0)<=0){a[f>>0]=48;b=a[f>>0]|0;i=e;return b|0}else{b=c[l>>2]|0;c[b>>2]=(c[b>>2]|0)+ -1;c[g>>2]=~~+h[c[j>>2]>>3];h[k>>3]=+(c[g>>2]|0);c[g>>2]=(c[g>>2]|0)+48;h[c[j>>2]>>3]=(+h[c[j>>2]>>3]- +h[k>>3])*10.0;a[f>>0]=c[g>>2];b=a[f>>0]|0;i=e;return b|0}return 0}function KE(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;d=b+4|0;e=b;c[e>>2]=a;if((c[c[e>>2]>>2]|0)<=(c[(c[e>>2]|0)+4>>2]|0)){c[d>>2]=0;e=c[d>>2]|0;i=b;return e|0}else{f=(c[e>>2]|0)+4|0;a=c[f>>2]|0;c[f>>2]=a+1;c[d>>2]=Ed(c[(c[(c[e>>2]|0)+8>>2]|0)+(a<<2)>>2]|0)|0;e=c[d>>2]|0;i=b;return e|0}return 0}function LE(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0;f=i;i=i+16|0;j=f+4|0;g=f;h=f+8|0;c[j>>2]=b;c[g>>2]=d;a[h>>0]=e;if(((c[(c[j>>2]|0)+12>>2]|0)+(c[g>>2]|0)|0)>=(c[(c[j>>2]|0)+16>>2]|0)?(b=Xm(c[j>>2]|0,c[g>>2]|0)|0,c[g>>2]=b,(b|0)<=0):0){i=f;return}while(1){b=c[g>>2]|0;c[g>>2]=b+ -1;if((b|0)<=0)break;d=a[h>>0]|0;e=(c[j>>2]|0)+12|0;b=c[e>>2]|0;c[e>>2]=b+1;a[(c[(c[j>>2]|0)+8>>2]|0)+b>>0]=d}i=f;return}function ME(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return c[48+(c[b>>2]<<2)>>2]|0}function NE(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;i=i+32|0;g=b+16|0;d=b+12|0;e=b;f=b+8|0;c[g>>2]=a;if(!(c[38]|0)){i=b;return}c[d>>2]=c[38];h=ME(0)|0;a=e;c[a>>2]=h;c[a+4>>2]=((h|0)<0)<<31>>31;c[f>>2]=c[39];c[38]=0;Bb[c[d>>2]&3](c[f>>2]|0,c[e>>2]|0,c[e+4>>2]|0,c[g>>2]|0);c[38]=c[d>>2];c[39]=c[f>>2];i=b;return}function OE(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=Bk(c[e>>2]|0,c[f>>2]|0)|0;a=c[(c[e>>2]|0)+520>>2]|0;c[a>>2]=(c[a>>2]|0)+b;i=d;return}function PE(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;g=i;i=i+32|0;j=g+16|0;e=g+12|0;f=g+8|0;d=g+4|0;h=g;c[j>>2]=a;c[e>>2]=b;c[f>>2]=ub[c[38640+52>>2]&31](c[j>>2]|0)|0;Bg(5,c[j>>2]|0);do if(c[38]|0){c[h>>2]=ME(0)|0;a=c[h>>2]|0;b=((a|0)<0)<<31>>31;h=144|0;j=c[f>>2]|0;j=ZE(c[h>>2]|0,c[h+4>>2]|0,j|0,((j|0)<0)<<31>>31|0)|0;h=D;if((b|0)>(h|0)|(b|0)==(h|0)&a>>>0>=j>>>0){c[43]=1;NE(c[f>>2]|0);break}else{c[43]=0;break}}while(0);c[d>>2]=ub[c[38640+36>>2]&31](c[f>>2]|0)|0;if(!(c[d>>2]|0)){a=c[d>>2]|0;j=c[e>>2]|0;c[j>>2]=a;j=c[f>>2]|0;i=g;return j|0}c[f>>2]=Tb(c[d>>2]|0)|0;ic(0,c[f>>2]|0);ic(9,1);a=c[d>>2]|0;j=c[e>>2]|0;c[j>>2]=a;j=c[f>>2]|0;i=g;return j|0}function QE(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;b=i;do if(a>>>0<245){if(a>>>0<11)a=16;else a=a+11&-8;x=a>>>3;p=c[9750]|0;w=p>>>x;if(w&3){g=(w&1^1)+x|0;f=g<<1;d=39040+(f<<2)|0;f=39040+(f+2<<2)|0;h=c[f>>2]|0;j=h+8|0;e=c[j>>2]|0;do if((d|0)!=(e|0)){if(e>>>0<(c[9754]|0)>>>0)db();k=e+12|0;if((c[k>>2]|0)==(h|0)){c[k>>2]=d;c[f>>2]=e;break}else db()}else c[9750]=p&~(1<<g);while(0);H=g<<3;c[h+4>>2]=H|3;H=h+(H|4)|0;c[H>>2]=c[H>>2]|1;H=j;i=b;return H|0}v=c[9752]|0;if(a>>>0>v>>>0){if(w){h=2<<x;h=w<<x&(h|0-h);h=(h&0-h)+ -1|0;d=h>>>12&16;h=h>>>d;j=h>>>5&8;h=h>>>j;f=h>>>2&4;h=h>>>f;g=h>>>1&2;h=h>>>g;e=h>>>1&1;e=(j|d|f|g|e)+(h>>>e)|0;h=e<<1;g=39040+(h<<2)|0;h=39040+(h+2<<2)|0;f=c[h>>2]|0;d=f+8|0;j=c[d>>2]|0;do if((g|0)!=(j|0)){if(j>>>0<(c[9754]|0)>>>0)db();k=j+12|0;if((c[k>>2]|0)==(f|0)){c[k>>2]=g;c[h>>2]=j;E=c[9752]|0;break}else db()}else{c[9750]=p&~(1<<e);E=v}while(0);H=e<<3;e=H-a|0;c[f+4>>2]=a|3;g=f+a|0;c[f+(a|4)>>2]=e|1;c[f+H>>2]=e;if(E){f=c[9755]|0;l=E>>>3;j=l<<1;h=39040+(j<<2)|0;k=c[9750]|0;l=1<<l;if(k&l){j=39040+(j+2<<2)|0;k=c[j>>2]|0;if(k>>>0<(c[9754]|0)>>>0)db();else{D=j;C=k}}else{c[9750]=k|l;D=39040+(j+2<<2)|0;C=h}c[D>>2]=f;c[C+12>>2]=f;c[f+8>>2]=C;c[f+12>>2]=h}c[9752]=e;c[9755]=g;H=d;i=b;return H|0}p=c[9751]|0;if(p){d=(p&0-p)+ -1|0;G=d>>>12&16;d=d>>>G;F=d>>>5&8;d=d>>>F;H=d>>>2&4;d=d>>>H;f=d>>>1&2;d=d>>>f;e=d>>>1&1;e=c[39304+((F|G|H|f|e)+(d>>>e)<<2)>>2]|0;d=(c[e+4>>2]&-8)-a|0;f=e;while(1){g=c[f+16>>2]|0;if(!g){g=c[f+20>>2]|0;if(!g)break}f=(c[g+4>>2]&-8)-a|0;H=f>>>0<d>>>0;d=H?f:d;f=g;e=H?g:e}h=c[9754]|0;if(e>>>0<h>>>0)db();f=e+a|0;if(e>>>0>=f>>>0)db();g=c[e+24>>2]|0;k=c[e+12>>2]|0;do if((k|0)==(e|0)){k=e+20|0;j=c[k>>2]|0;if(!j){k=e+16|0;j=c[k>>2]|0;if(!j){B=0;break}}while(1){l=j+20|0;m=c[l>>2]|0;if(m){j=m;k=l;continue}l=j+16|0;m=c[l>>2]|0;if(!m)break;else{j=m;k=l}}if(k>>>0<h>>>0)db();else{c[k>>2]=0;B=j;break}}else{j=c[e+8>>2]|0;if(j>>>0<h>>>0)db();h=j+12|0;if((c[h>>2]|0)!=(e|0))db();l=k+8|0;if((c[l>>2]|0)==(e|0)){c[h>>2]=k;c[l>>2]=j;B=k;break}else db()}while(0);do if(g){j=c[e+28>>2]|0;h=39304+(j<<2)|0;if((e|0)==(c[h>>2]|0)){c[h>>2]=B;if(!B){c[9751]=c[9751]&~(1<<j);break}}else{if(g>>>0<(c[9754]|0)>>>0)db();h=g+16|0;if((c[h>>2]|0)==(e|0))c[h>>2]=B;else c[g+20>>2]=B;if(!B)break}h=c[9754]|0;if(B>>>0<h>>>0)db();c[B+24>>2]=g;g=c[e+16>>2]|0;do if(g)if(g>>>0<h>>>0)db();else{c[B+16>>2]=g;c[g+24>>2]=B;break}while(0);g=c[e+20>>2]|0;if(g)if(g>>>0<(c[9754]|0)>>>0)db();else{c[B+20>>2]=g;c[g+24>>2]=B;break}}while(0);if(d>>>0<16){H=d+a|0;c[e+4>>2]=H|3;H=e+(H+4)|0;c[H>>2]=c[H>>2]|1}else{c[e+4>>2]=a|3;c[e+(a|4)>>2]=d|1;c[e+(d+a)>>2]=d;h=c[9752]|0;if(h){g=c[9755]|0;k=h>>>3;l=k<<1;h=39040+(l<<2)|0;j=c[9750]|0;k=1<<k;if(j&k){j=39040+(l+2<<2)|0;k=c[j>>2]|0;if(k>>>0<(c[9754]|0)>>>0)db();else{A=j;z=k}}else{c[9750]=j|k;A=39040+(l+2<<2)|0;z=h}c[A>>2]=g;c[z+12>>2]=g;c[g+8>>2]=z;c[g+12>>2]=h}c[9752]=d;c[9755]=f}H=e+8|0;i=b;return H|0}}}else if(a>>>0<=4294967231){z=a+11|0;a=z&-8;B=c[9751]|0;if(B){A=0-a|0;z=z>>>8;if(z)if(a>>>0>16777215)C=31;else{G=(z+1048320|0)>>>16&8;H=z<<G;F=(H+520192|0)>>>16&4;H=H<<F;C=(H+245760|0)>>>16&2;C=14-(F|G|C)+(H<<C>>>15)|0;C=a>>>(C+7|0)&1|C<<1}else C=0;D=c[39304+(C<<2)>>2]|0;a:do if(!D){F=0;z=0}else{if((C|0)==31)z=0;else z=25-(C>>>1)|0;F=0;E=a<<z;z=0;while(1){G=c[D+4>>2]&-8;H=G-a|0;if(H>>>0<A>>>0)if((G|0)==(a|0)){A=H;F=D;z=D;break a}else{A=H;z=D}H=c[D+20>>2]|0;D=c[D+(E>>>31<<2)+16>>2]|0;F=(H|0)==0|(H|0)==(D|0)?F:H;if(!D)break;else E=E<<1}}while(0);if((F|0)==0&(z|0)==0){H=2<<C;B=B&(H|0-H);if(!B)break;H=(B&0-B)+ -1|0;D=H>>>12&16;H=H>>>D;C=H>>>5&8;H=H>>>C;E=H>>>2&4;H=H>>>E;G=H>>>1&2;H=H>>>G;F=H>>>1&1;F=c[39304+((C|D|E|G|F)+(H>>>F)<<2)>>2]|0}if(F)while(1){H=(c[F+4>>2]&-8)-a|0;B=H>>>0<A>>>0;A=B?H:A;z=B?F:z;B=c[F+16>>2]|0;if(B){F=B;continue}F=c[F+20>>2]|0;if(!F)break}if((z|0)!=0?A>>>0<((c[9752]|0)-a|0)>>>0:0){f=c[9754]|0;if(z>>>0<f>>>0)db();d=z+a|0;if(z>>>0>=d>>>0)db();e=c[z+24>>2]|0;g=c[z+12>>2]|0;do if((g|0)==(z|0)){h=z+20|0;g=c[h>>2]|0;if(!g){h=z+16|0;g=c[h>>2]|0;if(!g){x=0;break}}while(1){j=g+20|0;k=c[j>>2]|0;if(k){g=k;h=j;continue}j=g+16|0;k=c[j>>2]|0;if(!k)break;else{g=k;h=j}}if(h>>>0<f>>>0)db();else{c[h>>2]=0;x=g;break}}else{h=c[z+8>>2]|0;if(h>>>0<f>>>0)db();j=h+12|0;if((c[j>>2]|0)!=(z|0))db();f=g+8|0;if((c[f>>2]|0)==(z|0)){c[j>>2]=g;c[f>>2]=h;x=g;break}else db()}while(0);do if(e){f=c[z+28>>2]|0;g=39304+(f<<2)|0;if((z|0)==(c[g>>2]|0)){c[g>>2]=x;if(!x){c[9751]=c[9751]&~(1<<f);break}}else{if(e>>>0<(c[9754]|0)>>>0)db();f=e+16|0;if((c[f>>2]|0)==(z|0))c[f>>2]=x;else c[e+20>>2]=x;if(!x)break}f=c[9754]|0;if(x>>>0<f>>>0)db();c[x+24>>2]=e;e=c[z+16>>2]|0;do if(e)if(e>>>0<f>>>0)db();else{c[x+16>>2]=e;c[e+24>>2]=x;break}while(0);e=c[z+20>>2]|0;if(e)if(e>>>0<(c[9754]|0)>>>0)db();else{c[x+20>>2]=e;c[e+24>>2]=x;break}}while(0);b:do if(A>>>0>=16){c[z+4>>2]=a|3;c[z+(a|4)>>2]=A|1;c[z+(A+a)>>2]=A;f=A>>>3;if(A>>>0<256){h=f<<1;e=39040+(h<<2)|0;g=c[9750]|0;f=1<<f;do if(!(g&f)){c[9750]=g|f;w=39040+(h+2<<2)|0;v=e}else{f=39040+(h+2<<2)|0;g=c[f>>2]|0;if(g>>>0>=(c[9754]|0)>>>0){w=f;v=g;break}db()}while(0);c[w>>2]=d;c[v+12>>2]=d;c[z+(a+8)>>2]=v;c[z+(a+12)>>2]=e;break}e=A>>>8;if(e)if(A>>>0>16777215)e=31;else{G=(e+1048320|0)>>>16&8;H=e<<G;F=(H+520192|0)>>>16&4;H=H<<F;e=(H+245760|0)>>>16&2;e=14-(F|G|e)+(H<<e>>>15)|0;e=A>>>(e+7|0)&1|e<<1}else e=0;f=39304+(e<<2)|0;c[z+(a+28)>>2]=e;c[z+(a+20)>>2]=0;c[z+(a+16)>>2]=0;g=c[9751]|0;h=1<<e;if(!(g&h)){c[9751]=g|h;c[f>>2]=d;c[z+(a+24)>>2]=f;c[z+(a+12)>>2]=d;c[z+(a+8)>>2]=d;break}h=c[f>>2]|0;if((e|0)==31)e=0;else e=25-(e>>>1)|0;c:do if((c[h+4>>2]&-8|0)!=(A|0)){e=A<<e;while(1){g=h+(e>>>31<<2)+16|0;f=c[g>>2]|0;if(!f)break;if((c[f+4>>2]&-8|0)==(A|0)){p=f;break c}else{e=e<<1;h=f}}if(g>>>0<(c[9754]|0)>>>0)db();else{c[g>>2]=d;c[z+(a+24)>>2]=h;c[z+(a+12)>>2]=d;c[z+(a+8)>>2]=d;break b}}else p=h;while(0);f=p+8|0;e=c[f>>2]|0;H=c[9754]|0;if(p>>>0>=H>>>0&e>>>0>=H>>>0){c[e+12>>2]=d;c[f>>2]=d;c[z+(a+8)>>2]=e;c[z+(a+12)>>2]=p;c[z+(a+24)>>2]=0;break}else db()}else{H=A+a|0;c[z+4>>2]=H|3;H=z+(H+4)|0;c[H>>2]=c[H>>2]|1}while(0);H=z+8|0;i=b;return H|0}}}else a=-1;while(0);p=c[9752]|0;if(p>>>0>=a>>>0){e=p-a|0;d=c[9755]|0;if(e>>>0>15){c[9755]=d+a;c[9752]=e;c[d+(a+4)>>2]=e|1;c[d+p>>2]=e;c[d+4>>2]=a|3}else{c[9752]=0;c[9755]=0;c[d+4>>2]=p|3;H=d+(p+4)|0;c[H>>2]=c[H>>2]|1}H=d+8|0;i=b;return H|0}p=c[9753]|0;if(p>>>0>a>>>0){G=p-a|0;c[9753]=G;H=c[9756]|0;c[9756]=H+a;c[H+(a+4)>>2]=G|1;c[H+4>>2]=a|3;H=H+8|0;i=b;return H|0}do if(!(c[9868]|0)){p=Pa(30)|0;if(!(p+ -1&p)){c[9870]=p;c[9869]=p;c[9871]=-1;c[9872]=-1;c[9873]=0;c[9861]=0;c[9868]=(eb(0)|0)&-16^1431655768;break}else db()}while(0);x=a+48|0;p=c[9870]|0;w=a+47|0;A=p+w|0;p=0-p|0;v=A&p;if(v>>>0<=a>>>0){H=0;i=b;return H|0}z=c[9860]|0;if((z|0)!=0?(G=c[9858]|0,H=G+v|0,H>>>0<=G>>>0|H>>>0>z>>>0):0){H=0;i=b;return H|0}d:do if(!(c[9861]&4)){B=c[9756]|0;e:do if(B){z=39448|0;while(1){C=c[z>>2]|0;if(C>>>0<=B>>>0?(y=z+4|0,(C+(c[y>>2]|0)|0)>>>0>B>>>0):0)break;z=c[z+8>>2]|0;if(!z){o=181;break e}}if(z){A=A-(c[9753]|0)&p;if(A>>>0<2147483647){p=La(A|0)|0;if((p|0)==((c[z>>2]|0)+(c[y>>2]|0)|0)){z=A;o=190}else{z=A;o=191}}else z=0}else o=181}else o=181;while(0);do if((o|0)==181){y=La(0)|0;if((y|0)!=(-1|0)){A=y;z=c[9869]|0;p=z+ -1|0;if(!(p&A))z=v;else z=v-A+(p+A&0-z)|0;p=c[9858]|0;A=p+z|0;if(z>>>0>a>>>0&z>>>0<2147483647){H=c[9860]|0;if((H|0)!=0?A>>>0<=p>>>0|A>>>0>H>>>0:0){z=0;break}p=La(z|0)|0;if((p|0)==(y|0)){p=y;o=190}else o=191}else z=0}else z=0}while(0);f:do if((o|0)==190){if((p|0)!=(-1|0)){q=z;o=201;break d}}else if((o|0)==191){o=0-z|0;do if((p|0)!=(-1|0)&z>>>0<2147483647&x>>>0>z>>>0?(u=c[9870]|0,u=w-z+u&0-u,u>>>0<2147483647):0)if((La(u|0)|0)==(-1|0)){La(o|0)|0;z=0;break f}else{z=u+z|0;break}while(0);if((p|0)==(-1|0))z=0;else{q=z;o=201;break d}}while(0);c[9861]=c[9861]|4;o=198}else{z=0;o=198}while(0);if((((o|0)==198?v>>>0<2147483647:0)?(t=La(v|0)|0,s=La(0)|0,(t|0)!=(-1|0)&(s|0)!=(-1|0)&t>>>0<s>>>0):0)?(r=s-t|0,q=r>>>0>(a+40|0)>>>0,q):0){p=t;q=q?r:z;o=201}if((o|0)==201){r=(c[9858]|0)+q|0;c[9858]=r;if(r>>>0>(c[9859]|0)>>>0)c[9859]=r;r=c[9756]|0;g:do if(r){t=39448|0;while(1){s=c[t>>2]|0;v=t+4|0;w=c[v>>2]|0;if((p|0)==(s+w|0)){o=213;break}u=c[t+8>>2]|0;if(!u)break;else t=u}if(((o|0)==213?(c[t+12>>2]&8|0)==0:0)?r>>>0>=s>>>0&r>>>0<p>>>0:0){c[v>>2]=w+q;d=(c[9753]|0)+q|0;e=r+8|0;if(!(e&7))e=0;else e=0-e&7;H=d-e|0;c[9756]=r+e;c[9753]=H;c[r+(e+4)>>2]=H|1;c[r+(d+4)>>2]=40;c[9757]=c[9872];break}s=c[9754]|0;if(p>>>0<s>>>0){c[9754]=p;s=p}v=p+q|0;t=39448|0;while(1){if((c[t>>2]|0)==(v|0)){o=223;break}u=c[t+8>>2]|0;if(!u)break;else t=u}if((o|0)==223?(c[t+12>>2]&8|0)==0:0){c[t>>2]=p;h=t+4|0;c[h>>2]=(c[h>>2]|0)+q;h=p+8|0;if(!(h&7))h=0;else h=0-h&7;j=p+(q+8)|0;if(!(j&7))n=0;else n=0-j&7;o=p+(n+q)|0;k=h+a|0;j=p+k|0;m=o-(p+h)-a|0;c[p+(h+4)>>2]=a|3;h:do if((o|0)!=(r|0)){if((o|0)==(c[9755]|0)){H=(c[9752]|0)+m|0;c[9752]=H;c[9755]=j;c[p+(k+4)>>2]=H|1;c[p+(H+k)>>2]=H;break}r=q+4|0;u=c[p+(r+n)>>2]|0;if((u&3|0)==1){a=u&-8;t=u>>>3;i:do if(u>>>0>=256){l=c[p+((n|24)+q)>>2]|0;t=c[p+(q+12+n)>>2]|0;do if((t|0)==(o|0)){v=n|16;u=p+(r+v)|0;t=c[u>>2]|0;if(!t){u=p+(v+q)|0;t=c[u>>2]|0;if(!t){g=0;break}}while(1){w=t+20|0;v=c[w>>2]|0;if(v){t=v;u=w;continue}w=t+16|0;v=c[w>>2]|0;if(!v)break;else{t=v;u=w}}if(u>>>0<s>>>0)db();else{c[u>>2]=0;g=t;break}}else{u=c[p+((n|8)+q)>>2]|0;if(u>>>0<s>>>0)db();v=u+12|0;if((c[v>>2]|0)!=(o|0))db();s=t+8|0;if((c[s>>2]|0)==(o|0)){c[v>>2]=t;c[s>>2]=u;g=t;break}else db()}while(0);if(!l)break;s=c[p+(q+28+n)>>2]|0;t=39304+(s<<2)|0;do if((o|0)!=(c[t>>2]|0)){if(l>>>0<(c[9754]|0)>>>0)db();s=l+16|0;if((c[s>>2]|0)==(o|0))c[s>>2]=g;else c[l+20>>2]=g;if(!g)break i}else{c[t>>2]=g;if(g)break;c[9751]=c[9751]&~(1<<s);break i}while(0);o=c[9754]|0;if(g>>>0<o>>>0)db();c[g+24>>2]=l;s=n|16;l=c[p+(s+q)>>2]|0;do if(l)if(l>>>0<o>>>0)db();else{c[g+16>>2]=l;c[l+24>>2]=g;break}while(0);l=c[p+(r+s)>>2]|0;if(!l)break;if(l>>>0<(c[9754]|0)>>>0)db();else{c[g+20>>2]=l;c[l+24>>2]=g;break}}else{g=c[p+((n|8)+q)>>2]|0;r=c[p+(q+12+n)>>2]|0;u=39040+(t<<1<<2)|0;do if((g|0)!=(u|0)){if(g>>>0<s>>>0)db();if((c[g+12>>2]|0)==(o|0))break;db()}while(0);if((r|0)==(g|0)){c[9750]=c[9750]&~(1<<t);break}do if((r|0)==(u|0))l=r+8|0;else{if(r>>>0<s>>>0)db();s=r+8|0;if((c[s>>2]|0)==(o|0)){l=s;break}db()}while(0);c[g+12>>2]=r;c[l>>2]=g}while(0);o=p+((a|n)+q)|0;m=a+m|0}g=o+4|0;c[g>>2]=c[g>>2]&-2;c[p+(k+4)>>2]=m|1;c[p+(m+k)>>2]=m;g=m>>>3;if(m>>>0<256){l=g<<1;d=39040+(l<<2)|0;m=c[9750]|0;g=1<<g;do if(!(m&g)){c[9750]=m|g;f=39040+(l+2<<2)|0;e=d}else{l=39040+(l+2<<2)|0;g=c[l>>2]|0;if(g>>>0>=(c[9754]|0)>>>0){f=l;e=g;break}db()}while(0);c[f>>2]=j;c[e+12>>2]=j;c[p+(k+8)>>2]=e;c[p+(k+12)>>2]=d;break}e=m>>>8;do if(!e)e=0;else{if(m>>>0>16777215){e=31;break}G=(e+1048320|0)>>>16&8;H=e<<G;F=(H+520192|0)>>>16&4;H=H<<F;e=(H+245760|0)>>>16&2;e=14-(F|G|e)+(H<<e>>>15)|0;e=m>>>(e+7|0)&1|e<<1}while(0);l=39304+(e<<2)|0;c[p+(k+28)>>2]=e;c[p+(k+20)>>2]=0;c[p+(k+16)>>2]=0;g=c[9751]|0;f=1<<e;if(!(g&f)){c[9751]=g|f;c[l>>2]=j;c[p+(k+24)>>2]=l;c[p+(k+12)>>2]=j;c[p+(k+8)>>2]=j;break}f=c[l>>2]|0;if((e|0)==31)e=0;else e=25-(e>>>1)|0;j:do if((c[f+4>>2]&-8|0)!=(m|0)){e=m<<e;while(1){g=f+(e>>>31<<2)+16|0;l=c[g>>2]|0;if(!l)break;if((c[l+4>>2]&-8|0)==(m|0)){d=l;break j}else{e=e<<1;f=l}}if(g>>>0<(c[9754]|0)>>>0)db();else{c[g>>2]=j;c[p+(k+24)>>2]=f;c[p+(k+12)>>2]=j;c[p+(k+8)>>2]=j;break h}}else d=f;while(0);e=d+8|0;f=c[e>>2]|0;H=c[9754]|0;if(d>>>0>=H>>>0&f>>>0>=H>>>0){c[f+12>>2]=j;c[e>>2]=j;c[p+(k+8)>>2]=f;c[p+(k+12)>>2]=d;c[p+(k+24)>>2]=0;break}else db()}else{H=(c[9753]|0)+m|0;c[9753]=H;c[9756]=j;c[p+(k+4)>>2]=H|1}while(0);H=p+(h|8)|0;i=b;return H|0}e=39448|0;while(1){d=c[e>>2]|0;if(d>>>0<=r>>>0?(n=c[e+4>>2]|0,m=d+n|0,m>>>0>r>>>0):0)break;e=c[e+8>>2]|0}e=d+(n+ -39)|0;if(!(e&7))e=0;else e=0-e&7;d=d+(n+ -47+e)|0;d=d>>>0<(r+16|0)>>>0?r:d;e=d+8|0;f=p+8|0;if(!(f&7))f=0;else f=0-f&7;H=q+ -40-f|0;c[9756]=p+f;c[9753]=H;c[p+(f+4)>>2]=H|1;c[p+(q+ -36)>>2]=40;c[9757]=c[9872];c[d+4>>2]=27;c[e+0>>2]=c[9862];c[e+4>>2]=c[9863];c[e+8>>2]=c[9864];c[e+12>>2]=c[9865];c[9862]=p;c[9863]=q;c[9865]=0;c[9864]=e;e=d+28|0;c[e>>2]=7;if((d+32|0)>>>0<m>>>0)do{H=e;e=e+4|0;c[e>>2]=7}while((H+8|0)>>>0<m>>>0);if((d|0)!=(r|0)){d=d-r|0;e=r+(d+4)|0;c[e>>2]=c[e>>2]&-2;c[r+4>>2]=d|1;c[r+d>>2]=d;e=d>>>3;if(d>>>0<256){f=e<<1;d=39040+(f<<2)|0;g=c[9750]|0;e=1<<e;do if(!(g&e)){c[9750]=g|e;k=39040+(f+2<<2)|0;j=d}else{f=39040+(f+2<<2)|0;e=c[f>>2]|0;if(e>>>0>=(c[9754]|0)>>>0){k=f;j=e;break}db()}while(0);c[k>>2]=r;c[j+12>>2]=r;c[r+8>>2]=j;c[r+12>>2]=d;break}e=d>>>8;if(e)if(d>>>0>16777215)e=31;else{G=(e+1048320|0)>>>16&8;H=e<<G;F=(H+520192|0)>>>16&4;H=H<<F;e=(H+245760|0)>>>16&2;e=14-(F|G|e)+(H<<e>>>15)|0;e=d>>>(e+7|0)&1|e<<1}else e=0;j=39304+(e<<2)|0;c[r+28>>2]=e;c[r+20>>2]=0;c[r+16>>2]=0;f=c[9751]|0;g=1<<e;if(!(f&g)){c[9751]=f|g;c[j>>2]=r;c[r+24>>2]=j;c[r+12>>2]=r;c[r+8>>2]=r;break}f=c[j>>2]|0;if((e|0)==31)e=0;else e=25-(e>>>1)|0;k:do if((c[f+4>>2]&-8|0)!=(d|0)){e=d<<e;j=f;while(1){f=j+(e>>>31<<2)+16|0;g=c[f>>2]|0;if(!g)break;if((c[g+4>>2]&-8|0)==(d|0)){h=g;break k}else{e=e<<1;j=g}}if(f>>>0<(c[9754]|0)>>>0)db();else{c[f>>2]=r;c[r+24>>2]=j;c[r+12>>2]=r;c[r+8>>2]=r;break g}}else h=f;while(0);e=h+8|0;d=c[e>>2]|0;H=c[9754]|0;if(h>>>0>=H>>>0&d>>>0>=H>>>0){c[d+12>>2]=r;c[e>>2]=r;c[r+8>>2]=d;c[r+12>>2]=h;c[r+24>>2]=0;break}else db()}}else{H=c[9754]|0;if((H|0)==0|p>>>0<H>>>0)c[9754]=p;c[9862]=p;c[9863]=q;c[9865]=0;c[9759]=c[9868];c[9758]=-1;d=0;do{H=d<<1;G=39040+(H<<2)|0;c[39040+(H+3<<2)>>2]=G;c[39040+(H+2<<2)>>2]=G;d=d+1|0}while((d|0)!=32);d=p+8|0;if(!(d&7))d=0;else d=0-d&7;H=q+ -40-d|0;c[9756]=p+d;c[9753]=H;c[p+(d+4)>>2]=H|1;c[p+(q+ -36)>>2]=40;c[9757]=c[9872]}while(0);d=c[9753]|0;if(d>>>0>a>>>0){G=d-a|0;c[9753]=G;H=c[9756]|0;c[9756]=H+a;c[H+(a+4)>>2]=G|1;c[H+4>>2]=a|3;H=H+8|0;i=b;return H|0}}c[(Ya()|0)>>2]=12;H=0;i=b;return H|0}function RE(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;b=i;if(!a){i=b;return}q=a+ -8|0;r=c[9754]|0;if(q>>>0<r>>>0)db();n=c[a+ -4>>2]|0;m=n&3;if((m|0)==1)db();j=n&-8;h=a+(j+ -8)|0;do if(!(n&1)){u=c[q>>2]|0;if(!m){i=b;return}q=-8-u|0;n=a+q|0;m=u+j|0;if(n>>>0<r>>>0)db();if((n|0)==(c[9755]|0)){e=a+(j+ -4)|0;o=c[e>>2]|0;if((o&3|0)!=3){e=n;o=m;break}c[9752]=m;c[e>>2]=o&-2;c[a+(q+4)>>2]=m|1;c[h>>2]=m;i=b;return}t=u>>>3;if(u>>>0<256){e=c[a+(q+8)>>2]|0;o=c[a+(q+12)>>2]|0;p=39040+(t<<1<<2)|0;if((e|0)!=(p|0)){if(e>>>0<r>>>0)db();if((c[e+12>>2]|0)!=(n|0))db()}if((o|0)==(e|0)){c[9750]=c[9750]&~(1<<t);e=n;o=m;break}if((o|0)!=(p|0)){if(o>>>0<r>>>0)db();p=o+8|0;if((c[p>>2]|0)==(n|0))s=p;else db()}else s=o+8|0;c[e+12>>2]=o;c[s>>2]=e;e=n;o=m;break}s=c[a+(q+24)>>2]|0;t=c[a+(q+12)>>2]|0;do if((t|0)==(n|0)){u=a+(q+20)|0;t=c[u>>2]|0;if(!t){u=a+(q+16)|0;t=c[u>>2]|0;if(!t){p=0;break}}while(1){v=t+20|0;w=c[v>>2]|0;if(w){t=w;u=v;continue}v=t+16|0;w=c[v>>2]|0;if(!w)break;else{t=w;u=v}}if(u>>>0<r>>>0)db();else{c[u>>2]=0;p=t;break}}else{u=c[a+(q+8)>>2]|0;if(u>>>0<r>>>0)db();r=u+12|0;if((c[r>>2]|0)!=(n|0))db();v=t+8|0;if((c[v>>2]|0)==(n|0)){c[r>>2]=t;c[v>>2]=u;p=t;break}else db()}while(0);if(s){r=c[a+(q+28)>>2]|0;t=39304+(r<<2)|0;if((n|0)==(c[t>>2]|0)){c[t>>2]=p;if(!p){c[9751]=c[9751]&~(1<<r);e=n;o=m;break}}else{if(s>>>0<(c[9754]|0)>>>0)db();r=s+16|0;if((c[r>>2]|0)==(n|0))c[r>>2]=p;else c[s+20>>2]=p;if(!p){e=n;o=m;break}}r=c[9754]|0;if(p>>>0<r>>>0)db();c[p+24>>2]=s;s=c[a+(q+16)>>2]|0;do if(s)if(s>>>0<r>>>0)db();else{c[p+16>>2]=s;c[s+24>>2]=p;break}while(0);q=c[a+(q+20)>>2]|0;if(q)if(q>>>0<(c[9754]|0)>>>0)db();else{c[p+20>>2]=q;c[q+24>>2]=p;e=n;o=m;break}else{e=n;o=m}}else{e=n;o=m}}else{e=q;o=j}while(0);if(e>>>0>=h>>>0)db();m=a+(j+ -4)|0;n=c[m>>2]|0;if(!(n&1))db();if(!(n&2)){if((h|0)==(c[9756]|0)){w=(c[9753]|0)+o|0;c[9753]=w;c[9756]=e;c[e+4>>2]=w|1;if((e|0)!=(c[9755]|0)){i=b;return}c[9755]=0;c[9752]=0;i=b;return}if((h|0)==(c[9755]|0)){w=(c[9752]|0)+o|0;c[9752]=w;c[9755]=e;c[e+4>>2]=w|1;c[e+w>>2]=w;i=b;return}o=(n&-8)+o|0;m=n>>>3;do if(n>>>0>=256){l=c[a+(j+16)>>2]|0;m=c[a+(j|4)>>2]|0;do if((m|0)==(h|0)){n=a+(j+12)|0;m=c[n>>2]|0;if(!m){n=a+(j+8)|0;m=c[n>>2]|0;if(!m){k=0;break}}while(1){q=m+20|0;p=c[q>>2]|0;if(p){m=p;n=q;continue}p=m+16|0;q=c[p>>2]|0;if(!q)break;else{m=q;n=p}}if(n>>>0<(c[9754]|0)>>>0)db();else{c[n>>2]=0;k=m;break}}else{n=c[a+j>>2]|0;if(n>>>0<(c[9754]|0)>>>0)db();p=n+12|0;if((c[p>>2]|0)!=(h|0))db();q=m+8|0;if((c[q>>2]|0)==(h|0)){c[p>>2]=m;c[q>>2]=n;k=m;break}else db()}while(0);if(l){m=c[a+(j+20)>>2]|0;n=39304+(m<<2)|0;if((h|0)==(c[n>>2]|0)){c[n>>2]=k;if(!k){c[9751]=c[9751]&~(1<<m);break}}else{if(l>>>0<(c[9754]|0)>>>0)db();m=l+16|0;if((c[m>>2]|0)==(h|0))c[m>>2]=k;else c[l+20>>2]=k;if(!k)break}h=c[9754]|0;if(k>>>0<h>>>0)db();c[k+24>>2]=l;l=c[a+(j+8)>>2]|0;do if(l)if(l>>>0<h>>>0)db();else{c[k+16>>2]=l;c[l+24>>2]=k;break}while(0);h=c[a+(j+12)>>2]|0;if(h)if(h>>>0<(c[9754]|0)>>>0)db();else{c[k+20>>2]=h;c[h+24>>2]=k;break}}}else{k=c[a+j>>2]|0;j=c[a+(j|4)>>2]|0;a=39040+(m<<1<<2)|0;if((k|0)!=(a|0)){if(k>>>0<(c[9754]|0)>>>0)db();if((c[k+12>>2]|0)!=(h|0))db()}if((j|0)==(k|0)){c[9750]=c[9750]&~(1<<m);break}if((j|0)!=(a|0)){if(j>>>0<(c[9754]|0)>>>0)db();a=j+8|0;if((c[a>>2]|0)==(h|0))l=a;else db()}else l=j+8|0;c[k+12>>2]=j;c[l>>2]=k}while(0);c[e+4>>2]=o|1;c[e+o>>2]=o;if((e|0)==(c[9755]|0)){c[9752]=o;i=b;return}}else{c[m>>2]=n&-2;c[e+4>>2]=o|1;c[e+o>>2]=o}h=o>>>3;if(o>>>0<256){j=h<<1;d=39040+(j<<2)|0;k=c[9750]|0;h=1<<h;if(k&h){j=39040+(j+2<<2)|0;h=c[j>>2]|0;if(h>>>0<(c[9754]|0)>>>0)db();else{f=j;g=h}}else{c[9750]=k|h;f=39040+(j+2<<2)|0;g=d}c[f>>2]=e;c[g+12>>2]=e;c[e+8>>2]=g;c[e+12>>2]=d;i=b;return}f=o>>>8;if(f)if(o>>>0>16777215)f=31;else{v=(f+1048320|0)>>>16&8;w=f<<v;u=(w+520192|0)>>>16&4;w=w<<u;f=(w+245760|0)>>>16&2;f=14-(u|v|f)+(w<<f>>>15)|0;f=o>>>(f+7|0)&1|f<<1}else f=0;g=39304+(f<<2)|0;c[e+28>>2]=f;c[e+20>>2]=0;c[e+16>>2]=0;j=c[9751]|0;h=1<<f;a:do if(j&h){g=c[g>>2]|0;if((f|0)==31)f=0;else f=25-(f>>>1)|0;b:do if((c[g+4>>2]&-8|0)!=(o|0)){f=o<<f;while(1){j=g+(f>>>31<<2)+16|0;h=c[j>>2]|0;if(!h)break;if((c[h+4>>2]&-8|0)==(o|0)){d=h;break b}else{f=f<<1;g=h}}if(j>>>0<(c[9754]|0)>>>0)db();else{c[j>>2]=e;c[e+24>>2]=g;c[e+12>>2]=e;c[e+8>>2]=e;break a}}else d=g;while(0);g=d+8|0;f=c[g>>2]|0;w=c[9754]|0;if(d>>>0>=w>>>0&f>>>0>=w>>>0){c[f+12>>2]=e;c[g>>2]=e;c[e+8>>2]=f;c[e+12>>2]=d;c[e+24>>2]=0;break}else db()}else{c[9751]=j|h;c[g>>2]=e;c[e+24>>2]=g;c[e+12>>2]=e;c[e+8>>2]=e}while(0);w=(c[9758]|0)+ -1|0;c[9758]=w;if(!w)d=39456|0;else{i=b;return}while(1){d=c[d>>2]|0;if(!d)break;else d=d+8|0}c[9758]=-1;i=b;return}function SE(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;do if(a){if(b>>>0>4294967231){c[(Ya()|0)>>2]=12;e=0;break}if(b>>>0<11)e=16;else e=b+11&-8;e=WE(a+ -8|0,e)|0;if(e){e=e+8|0;break}e=QE(b)|0;if(!e)e=0;else{f=c[a+ -4>>2]|0;f=(f&-8)-((f&3|0)==0?8:4)|0;dF(e|0,a|0,(f>>>0<b>>>0?f:b)|0)|0;RE(a)}}else e=QE(b)|0;while(0);i=d;return e|0}function TE(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0;e=i;a:do if(!d)d=0;else{while(1){f=a[b>>0]|0;g=a[c>>0]|0;if(f<<24>>24!=g<<24>>24)break;d=d+ -1|0;if(!d){d=0;break a}else{b=b+1|0;c=c+1|0}}d=(f&255)-(g&255)|0}while(0);i=e;return d|0}function UE(b,c){b=b|0;c=c|0;var d=0,e=0,f=0;d=i;f=a[b>>0]|0;e=a[c>>0]|0;if(f<<24>>24==0?1:f<<24>>24!=e<<24>>24)c=f;else{do{b=b+1|0;c=c+1|0;f=a[b>>0]|0;e=a[c>>0]|0}while(!(f<<24>>24==0?1:f<<24>>24!=e<<24>>24));c=f}i=d;return(c&255)-(e&255)|0}function VE(b,c,e){b=b|0;c=c|0;e=e|0;var f=0,g=0,h=0;f=i;if(!e){b=0;i=f;return b|0}g=a[b>>0]|0;a:do if(!(g<<24>>24))g=0;else while(1){e=e+ -1|0;h=a[c>>0]|0;if(!(h<<24>>24!=0&(e|0)!=0&g<<24>>24==h<<24>>24))break a;b=b+1|0;c=c+1|0;g=a[b>>0]|0;if(!(g<<24>>24)){g=0;break}}while(0);h=(g&255)-(d[c>>0]|0)|0;i=f;return h|0}function WE(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;d=i;f=a+4|0;e=c[f>>2]|0;l=e&-8;j=a+l|0;m=c[9754]|0;h=e&3;if(!((h|0)!=1&a>>>0>=m>>>0&a>>>0<j>>>0))db();g=a+(l|4)|0;p=c[g>>2]|0;if(!(p&1))db();if(!h){if(b>>>0<256){r=0;i=d;return r|0}if(l>>>0>=(b+4|0)>>>0?(l-b|0)>>>0<=c[9870]<<1>>>0:0){r=a;i=d;return r|0}r=0;i=d;return r|0}if(l>>>0>=b>>>0){h=l-b|0;if(h>>>0<=15){r=a;i=d;return r|0}c[f>>2]=e&1|b|2;c[a+(b+4)>>2]=h|3;c[g>>2]=c[g>>2]|1;XE(a+b|0,h);r=a;i=d;return r|0}if((j|0)==(c[9756]|0)){g=(c[9753]|0)+l|0;if(g>>>0<=b>>>0){r=0;i=d;return r|0}r=g-b|0;c[f>>2]=e&1|b|2;c[a+(b+4)>>2]=r|1;c[9756]=a+b;c[9753]=r;r=a;i=d;return r|0}if((j|0)==(c[9755]|0)){h=(c[9752]|0)+l|0;if(h>>>0<b>>>0){r=0;i=d;return r|0}g=h-b|0;if(g>>>0>15){c[f>>2]=e&1|b|2;c[a+(b+4)>>2]=g|1;c[a+h>>2]=g;e=a+(h+4)|0;c[e>>2]=c[e>>2]&-2;e=a+b|0}else{c[f>>2]=e&1|h|2;e=a+(h+4)|0;c[e>>2]=c[e>>2]|1;e=0;g=0}c[9752]=g;c[9755]=e;r=a;i=d;return r|0}if(p&2){r=0;i=d;return r|0}g=(p&-8)+l|0;if(g>>>0<b>>>0){r=0;i=d;return r|0}h=g-b|0;o=p>>>3;do if(p>>>0>=256){n=c[a+(l+24)>>2]|0;o=c[a+(l+12)>>2]|0;do if((o|0)==(j|0)){p=a+(l+20)|0;o=c[p>>2]|0;if(!o){p=a+(l+16)|0;o=c[p>>2]|0;if(!o){k=0;break}}while(1){r=o+20|0;q=c[r>>2]|0;if(q){o=q;p=r;continue}q=o+16|0;r=c[q>>2]|0;if(!r)break;else{o=r;p=q}}if(p>>>0<m>>>0)db();else{c[p>>2]=0;k=o;break}}else{p=c[a+(l+8)>>2]|0;if(p>>>0<m>>>0)db();m=p+12|0;if((c[m>>2]|0)!=(j|0))db();q=o+8|0;if((c[q>>2]|0)==(j|0)){c[m>>2]=o;c[q>>2]=p;k=o;break}else db()}while(0);if(n){m=c[a+(l+28)>>2]|0;o=39304+(m<<2)|0;if((j|0)==(c[o>>2]|0)){c[o>>2]=k;if(!k){c[9751]=c[9751]&~(1<<m);break}}else{if(n>>>0<(c[9754]|0)>>>0)db();m=n+16|0;if((c[m>>2]|0)==(j|0))c[m>>2]=k;else c[n+20>>2]=k;if(!k)break}j=c[9754]|0;if(k>>>0<j>>>0)db();c[k+24>>2]=n;m=c[a+(l+16)>>2]|0;do if(m)if(m>>>0<j>>>0)db();else{c[k+16>>2]=m;c[m+24>>2]=k;break}while(0);j=c[a+(l+20)>>2]|0;if(j)if(j>>>0<(c[9754]|0)>>>0)db();else{c[k+20>>2]=j;c[j+24>>2]=k;break}}}else{k=c[a+(l+8)>>2]|0;l=c[a+(l+12)>>2]|0;p=39040+(o<<1<<2)|0;if((k|0)!=(p|0)){if(k>>>0<m>>>0)db();if((c[k+12>>2]|0)!=(j|0))db()}if((l|0)==(k|0)){c[9750]=c[9750]&~(1<<o);break}if((l|0)!=(p|0)){if(l>>>0<m>>>0)db();m=l+8|0;if((c[m>>2]|0)==(j|0))n=m;else db()}else n=l+8|0;c[k+12>>2]=l;c[n>>2]=k}while(0);if(h>>>0<16){c[f>>2]=g|e&1|2;r=a+(g|4)|0;c[r>>2]=c[r>>2]|1;r=a;i=d;return r|0}else{c[f>>2]=e&1|b|2;c[a+(b+4)>>2]=h|3;r=a+(g|4)|0;c[r>>2]=c[r>>2]|1;XE(a+b|0,h);r=a;i=d;return r|0}return 0}\n\n\n\nfunction qo(f,g,h,j,k){f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0;r=i;i=i+272|0;Y=r;u=r+264|0;E=r+260|0;o=r+256|0;p=r+252|0;H=r+248|0;O=r+244|0;C=r+240|0;pa=r+236|0;oa=r+232|0;K=r+228|0;J=r+224|0;V=r+220|0;s=r+216|0;U=r+212|0;R=r+208|0;L=r+204|0;A=r+200|0;P=r+196|0;x=r+192|0;I=r+188|0;w=r+184|0;M=r+180|0;N=r+176|0;X=r+156|0;ia=r+152|0;na=r+148|0;D=r+271|0;v=r+270|0;Z=r+269|0;ma=r+268|0;n=r+144|0;z=r+140|0;B=r+136|0;t=r+132|0;l=r+128|0;y=r+124|0;T=r+120|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>2]=0;c[Y+8>>2]=h;c[Y+12>>2]=g;Se(f,23464,Y);break a}while(0);do if(c[p>>2]|0){if((c[R>>2]|0)==(c[(c[p>>2]|0)+4>>2]|0))break;f=c[u>>2]|0;g=c[(c[p>>2]|0)+4>>2]|0;c[Y>>2]=c[R>>2];c[Y+4>>2]=g;Se(f,23520,Y);break a}while(0);if(c[(c[O>>2]|0)+24>>2]&128){g=(c[u>>2]|0)+72|0;f=(c[g>>2]|0)+1|0;c[g>>2]=f;c[t>>2]=f;fp(c[s>>2]|0,25,0,c[t>>2]|0)|0}f:do if(!(c[F>>2]|0)){c[aa>>2]=du(c[u>>2]|0,c[C>>2]|0,55,-1,0,A,P)|0;c[q>>2]=Qe(c[O>>2]|0,(c[aa>>2]|0)+1<<2,0)|0;if(!(c[q>>2]|0))break a;c[K>>2]=0;while(1){if((c[K>>2]|0)>=(c[aa>>2]|0))break f;g=(c[u>>2]|0)+72|0;f=(c[g>>2]|0)+1|0;c[g>>2]=f;c[(c[q>>2]|0)+(c[K>>2]<<2)>>2]=f;c[K>>2]=(c[K>>2]|0)+1}}while(0);do if(a[D>>0]|0){c[M>>2]=Ir(c[s>>2]|0,108,c[w>>2]|0)|0;c[N>>2]=Mr(c[s>>2]|0)|0}else{if(!(c[o>>2]|0))break;f=Ir(c[s>>2]|0,22,c[X+4>>2]|0)|0;c[N>>2]=f;c[M>>2]=f}while(0);c[I>>2]=Nr(c[s>>2]|0)|0;if(c[da>>2]&1){c[ea>>2]=ys(c[u>>2]|0,(b[(c[C>>2]|0)+38>>1]|0)+1|0)|0;if((c[x>>2]|0)<0)fp(c[s>>2]|0,25,-1,c[ea>>2]|0)|0;else{if(a[D>>0]|0)ip(c[s>>2]|0,47,c[w>>2]|0,c[x>>2]|0,c[ea>>2]|0)|0;else Os(c[u>>2]|0,c[(c[(c[n>>2]|0)+4>>2]|0)+((c[x>>2]|0)*20|0)>>2]|0,c[ea>>2]|0);c[$>>2]=Ir(c[s>>2]|0,77,c[ea>>2]|0)|0;fp(c[s>>2]|0,25,-1,c[ea>>2]|0)|0;zp(c[s>>2]|0,c[$>>2]|0);Ir(c[s>>2]|0,38,c[ea>>2]|0)|0}c[K>>2]=0;while(1){if((c[K>>2]|0)>=(b[(c[C>>2]|0)+38>>1]|0))break;g:do if(!(c[p>>2]|0))c[J>>2]=c[K>>2];else{c[J>>2]=0;while(1){if((c[J>>2]|0)>=(c[(c[p>>2]|0)+4>>2]|0))break g;if((c[(c[c[p>>2]>>2]|0)+(c[J>>2]<<3)+4>>2]|0)==(c[K>>2]|0))break g;c[J>>2]=(c[J>>2]|0)+1}}while(0);do if((a[D>>0]|0)!=0|(c[n>>2]|0)!=0){if((c[p>>2]|0)!=0?(c[J>>2]|0)>=(c[(c[p>>2]|0)+4>>2]|0):0){ba=95;break}if(a[D>>0]|0){ip(c[s>>2]|0,47,c[w>>2]|0,c[J>>2]|0,(c[ea>>2]|0)+(c[K>>2]|0)+1|0)|0;break}else{ru(c[u>>2]|0,c[(c[(c[n>>2]|0)+4>>2]|0)+((c[J>>2]|0)*20|0)>>2]|0,(c[ea>>2]|0)+(c[K>>2]|0)+1|0);break}}else ba=95;while(0);if((ba|0)==95){ba=0;Os(c[u>>2]|0,c[(c[(c[C>>2]|0)+4>>2]|0)+((c[K>>2]|0)*24|0)+4>>2]|0,(c[ea>>2]|0)+(c[K>>2]|0)+1|0)}c[K>>2]=(c[K>>2]|0)+1}if(!(c[F>>2]|0))su(c[s>>2]|0,c[C>>2]|0,(c[ea>>2]|0)+1|0);tu(c[u>>2]|0,c[G>>2]|0,108,0,1,c[C>>2]|0,(c[ea>>2]|0)-(b[(c[C>>2]|0)+38>>1]|0)-1|0,c[H>>2]|0,c[I>>2]|0);Bs(c[u>>2]|0,c[ea>>2]|0,(b[(c[C>>2]|0)+38>>1]|0)+1|0)}do if(!(c[F>>2]|0)){if(d[(c[C>>2]|0)+44>>0]&16)fp(c[s>>2]|0,28,0,c[l>>2]|0)|0;h:do if((c[x>>2]|0)>=0){do if(a[D>>0]|0)ip(c[s>>2]|0,47,c[w>>2]|0,c[x>>2]|0,c[y>>2]|0)|0;else{if(c[o>>2]|0){fp(c[s>>2]|0,33,(c[z>>2]|0)+(c[x>>2]|0)|0,c[y>>2]|0)|0;break}Os(c[u>>2]|0,c[(c[(c[n>>2]|0)+4>>2]|0)+((c[x>>2]|0)*20|0)>>2]|0,c[y>>2]|0);c[_>>2]=dt(c[s>>2]|0,-1)|0;if(!(c[_>>2]|0))break;if((d[c[_>>2]>>0]|0)!=28)break;if(d[(c[C>>2]|0)+44>>0]&16)break;a[v>>0]=1;a[c[_>>2]>>0]=74;c[(c[_>>2]|0)+4>>2]=c[A>>2];c[(c[_>>2]|0)+8>>2]=c[y>>2];c[(c[_>>2]|0)+12>>2]=c[B>>2]}while(0);if(a[v>>0]|0)break;X=c[s>>2]|0;if(d[(c[C>>2]|0)+44>>0]&16){c[Q>>2]=Mr(X)|0;fp(c[s>>2]|0,76,c[y>>2]|0,(c[Q>>2]|0)+2|0)|0}else{c[Q>>2]=Ir(X,77,c[y>>2]|0)|0;ip(c[s>>2]|0,74,c[A>>2]|0,c[y>>2]|0,c[B>>2]|0)|0;zp(c[s>>2]|0,c[Q>>2]|0)}Ir(c[s>>2]|0,38,c[y>>2]|0)|0}else{do if(!(d[(c[C>>2]|0)+44>>0]&16)){if(d[Z>>0]|0)break;ip(c[s>>2]|0,74,c[A>>2]|0,c[y>>2]|0,c[B>>2]|0)|0;a[v>>0]=1;break h}while(0);fp(c[s>>2]|0,28,0,c[y>>2]|0)|0}while(0);uu(c[u>>2]|0,c[B>>2]|0,c[y>>2]|0);c[L>>2]=0;c[K>>2]=0;while(1){if((c[K>>2]|0)>=(b[(c[C>>2]|0)+38>>1]|0))break;c[S>>2]=(c[y>>2]|0)+1+(c[K>>2]|0);i:do if((c[K>>2]|0)==(b[(c[C>>2]|0)+36>>1]|0))Ir(c[s>>2]|0,29,c[S>>2]|0)|0;else{j:do if(!(c[p>>2]|0))if(d[(c[(c[C>>2]|0)+4>>2]|0)+((c[K>>2]|0)*24|0)+23>>0]&2){c[J>>2]=-1;c[L>>2]=(c[L>>2]|0)+1;break}else{c[J>>2]=(c[K>>2]|0)-(c[L>>2]|0);break}else{c[J>>2]=0;while(1){if((c[J>>2]|0)>=(c[(c[p>>2]|0)+4>>2]|0))break j;if((c[(c[c[p>>2]>>2]|0)+(c[J>>2]<<3)+4>>2]|0)==(c[K>>2]|0))break j;c[J>>2]=(c[J>>2]|0)+1}}while(0);do if(!((c[J>>2]|0)<0|(c[R>>2]|0)==0)){if((c[p>>2]|0)!=0?(c[J>>2]|0)>=(c[(c[p>>2]|0)+4>>2]|0):0)break;if(a[D>>0]|0){ip(c[s>>2]|0,47,c[w>>2]|0,c[J>>2]|0,c[S>>2]|0)|0;break i}if(!(c[o>>2]|0)){Os(c[u>>2]|0,c[(c[(c[n>>2]|0)+4>>2]|0)+((c[J>>2]|0)*20|0)>>2]|0,c[S>>2]|0);break i}if((c[z>>2]|0)==(c[T>>2]|0))break i;fp(c[s>>2]|0,34,(c[z>>2]|0)+(c[J>>2]|0)|0,c[S>>2]|0)|0;break i}while(0);vu(c[u>>2]|0,c[(c[(c[C>>2]|0)+4>>2]|0)+((c[K>>2]|0)*24|0)+4>>2]|0,c[S>>2]|0)}while(0);c[K>>2]=(c[K>>2]|0)+1}if(d[(c[C>>2]|0)+44>>0]&16){c[m>>2]=Rp(c[O>>2]|0,c[C>>2]|0)|0;wu(c[u>>2]|0,c[C>>2]|0);hp(c[s>>2]|0,15,1,(b[(c[C>>2]|0)+38>>1]|0)+2|0,c[l>>2]|0,c[m>>2]|0,-10)|0;Xe(c[s>>2]|0,((c[H>>2]|0)==10?2:c[H>>2]|0)&255);Sp(c[u>>2]|0);break}else{xu(c[u>>2]|0,c[C>>2]|0,c[q>>2]|0,c[A>>2]|0,c[P>>2]|0,c[l>>2]|0,0,(c[x>>2]|0)>=0&255,c[H>>2]&255,c[I>>2]|0,W);yu(c[u>>2]|0,c[C>>2]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tn(c[O>>2]|0,c[o>>2]|0);xn(c[O>>2]|0,c[p>>2]|0);Xb(c[O>>2]|0,c[q>>2]|0);i=r;return}function ro(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;f=i;i=i+32|0;e=f+16|0;k=f+12|0;g=f+8|0;h=f+4|0;j=f;c[k>>2]=a;c[g>>2]=b;c[h>>2]=d;if((c[g>>2]|0)==0?(c[g>>2]=se(c[k>>2]|0,8,0)|0,(c[g>>2]|0)==0):0){c[e>>2]=0;a=c[e>>2]|0;i=f;return a|0}d=ku(c[k>>2]|0,c[c[g>>2]>>2]|0,8,(c[g>>2]|0)+4|0,j)|0;c[c[g>>2]>>2]=d;d=c[k>>2]|0;if((c[j>>2]|0)<0){xn(d,c[g>>2]|0);c[e>>2]=0;a=c[e>>2]|0;i=f;return a|0}else{a=Zo(d,c[h>>2]|0)|0;c[(c[c[g>>2]>>2]|0)+(c[j>>2]<<3)>>2]=a;c[e>>2]=c[g>>2];a=c[e>>2]|0;i=f;return a|0}return 0}function so(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;f=e+8|0;h=e+4|0;g=e;c[f>>2]=a;c[h>>2]=b;c[g>>2]=d;c[(c[f>>2]|0)+4>>2]=c[c[h>>2]>>2];c[(c[f>>2]|0)+8>>2]=(c[c[g>>2]>>2]|0)+(c[(c[g>>2]|0)+4>>2]|0);i=e;return}function to(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;n=i;i=i+48|0;o=n+8|0;j=n+36|0;r=n+32|0;h=n+28|0;m=n+24|0;k=n+42|0;p=n+20|0;f=n;q=n+16|0;s=n+40|0;l=n+12|0;c[j>>2]=d;c[r>>2]=e;c[h>>2]=c[c[j>>2]>>2];if(!(c[r>>2]|0)){i=n;return}c[m>>2]=c[(c[r>>2]|0)+8>>2];do if(a[(c[m>>2]|0)+1>>0]|0){b[k>>1]=0;c[p>>2]=Mb(c[m>>2]|0)|0;if((a[c[m>>2]>>0]|0)==63){c[q>>2]=0==(wg((c[m>>2]|0)+1|0,f,(c[p>>2]|0)-1|0,1)|0)&1;d=c[f>>2]&65535;b[k>>1]=d;b[(c[r>>2]|0)+32>>1]=d;d=f;e=c[d+4>>2]|0;if(!(!((c[q>>2]|0)==0|((e|0)<0|(e|0)==0&(c[d>>2]|0)>>>0<1))?(e=f,r=c[e+4>>2]|0,d=c[(c[h>>2]|0)+124>>2]|0,s=((d|0)<0)<<31>>31,!((r|0)>(s|0)|((r|0)==(s|0)?(c[e>>2]|0)>>>0>d>>>0:0))):0)){d=c[j>>2]|0;c[o>>2]=c[(c[h>>2]|0)+124>>2];Se(d,23360,o);b[k>>1]=0}e=f;r=c[e+4>>2]|0;d=c[(c[j>>2]|0)+440>>2]|0;s=((d|0)<0)<<31>>31;if((r|0)>(s|0)|((r|0)==(s|0)?(c[e>>2]|0)>>>0>d>>>0:0))c[(c[j>>2]|0)+440>>2]=c[f>>2]}else{b[s>>1]=0;while(1){if((b[s>>1]|0)>=(c[(c[j>>2]|0)+444>>2]|0))break;if((c[(c[(c[j>>2]|0)+472>>2]|0)+(b[s>>1]<<2)>>2]|0)!=0?(UE(c[(c[(c[j>>2]|0)+472>>2]|0)+(b[s>>1]<<2)>>2]|0,c[m>>2]|0)|0)==0:0){g=14;break}b[s>>1]=(b[s>>1]|0)+1<<16>>16}if((g|0)==14){d=(b[s>>1]|0)+1&65535;b[k>>1]=d;b[(c[r>>2]|0)+32>>1]=d}if(!(b[k>>1]|0)){e=(c[j>>2]|0)+440|0;d=(c[e>>2]|0)+1|0;c[e>>2]=d;d=d&65535;b[(c[r>>2]|0)+32>>1]=d;b[k>>1]=d}}if((b[k>>1]|0)>0){do if((b[k>>1]|0)>(c[(c[j>>2]|0)+444>>2]|0)){c[l>>2]=Fk(c[h>>2]|0,c[(c[j>>2]|0)+472>>2]|0,b[k>>1]<<2,0)|0;if(!(c[l>>2]|0)){i=n;return}else{c[(c[j>>2]|0)+472>>2]=c[l>>2];_E((c[l>>2]|0)+(c[(c[j>>2]|0)+444>>2]<<2)|0,0,(b[k>>1]|0)-(c[(c[j>>2]|0)+444>>2]|0)<<2|0)|0;c[(c[j>>2]|0)+444>>2]=b[k>>1];break}}while(0);if((a[c[m>>2]>>0]|0)==63?(c[(c[(c[j>>2]|0)+472>>2]|0)+((b[k>>1]|0)-1<<2)>>2]|0)!=0:0)break;Xb(c[h>>2]|0,c[(c[(c[j>>2]|0)+472>>2]|0)+((b[k>>1]|0)-1<<2)>>2]|0);d=rm(c[h>>2]|0,c[m>>2]|0,c[p>>2]|0,0)|0;c[(c[(c[j>>2]|0)+472>>2]|0)+((b[k>>1]|0)-1<<2)>>2]=d}}else{e=(c[j>>2]|0)+440|0;d=(c[e>>2]|0)+1|0;c[e>>2]=d;b[(c[r>>2]|0)+32>>1]=d}while(0);if(c[(c[j>>2]|0)+64>>2]|0){i=n;return}if((c[(c[j>>2]|0)+440>>2]|0)<=(c[(c[h>>2]|0)+124>>2]|0)){i=n;return}Se(c[j>>2]|0,23408,o);i=n;return}function uo(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;h=e+12|0;f=e+8|0;j=e+4|0;g=e;c[h>>2]=a;c[f>>2]=b;c[j>>2]=d;if((c[(c[j>>2]|0)+4>>2]|0)>>>0<=0){a=c[f>>2]|0;i=e;return a|0}c[g>>2]=or(c[c[h>>2]>>2]|0,95,c[j>>2]|0,1)|0;if(!(c[g>>2]|0)){a=c[f>>2]|0;i=e;return a|0}c[(c[g>>2]|0)+12>>2]=c[f>>2];a=(c[g>>2]|0)+4|0;c[a>>2]=c[a>>2]|4352;c[f>>2]=c[g>>2];a=c[f>>2]|0;i=e;return a|0}function vo(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;e=i;i=i+32|0;f=e+20|0;k=e+16|0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16|0;m=h+12|0;k=h+8|0;j=h+4|0;l=h;c[n>>2]=b;c[m>>2]=e;c[k>>2]=f;c[j>>2]=g;c[l>>2]=c[c[n>>2]>>2];if(!((c[m>>2]|0)!=0&(c[k>>2]|0)!=0)){i=h;return}if((d[c[m>>2]>>0]|0|0)!=101){i=h;return}a[c[k>>2]>>0]=c[j>>2];wn(c[l>>2]|0,c[(c[k>>2]|0)+16>>2]|0);c[(c[k>>2]|0)+16>>2]=0;i=h;return}function zo(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+32|0;h=g+16|0;m=g+12|0;l=g+8|0;j=g+4|0;k=g;c[h>>2]=a;c[m>>2]=b;c[l>>2]=d;c[j>>2]=e;c[k>>2]=f;a=Rn(c[m>>2]|0,c[l>>2]|0,c[c[j>>2]>>2]|0,0,0)|0;c[c[h>>2]>>2]=a;c[(c[h>>2]|0)+4>>2]=c[c[k>>2]>>2];c[(c[h>>2]|0)+8>>2]=c[(c[j>>2]|0)+8>>2];i=g;return}function Ao(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;qr(c[e>>2]|0);Qq(c[f>>2]|0,c[(c[e>>2]|0)+24>>2]|0)|0;i=d;return}function Bo(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;l=i;i=i+64|0;j=l;h=l+52|0;f=l+48|0;k=l+44|0;m=l+40|0;n=l+36|0;g=l+32|0;r=l+28|0;o=l+24|0;p=l+20|0;q=l+16|0;s=l+12|0;c[h>>2]=b;c[f>>2]=d;c[k>>2]=e;c[g>>2]=c[c[h>>2]>>2];if(a[(c[g>>2]|0)+64>>0]|0){d=c[g>>2]|0;b=c[f>>2]|0;vn(d,b);i=l;return}if(Ar(c[h>>2]|0)|0){d=c[g>>2]|0;b=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=o+524|0;n=o+520|0;na=o+516|0;Hb=o+512|0;Eb=o+496|0;r=o+488|0;ib=o+484|0;hb=o+480|0;tb=o+476|0;gb=o+472|0;l=o+468|0;bb=o+464|0;p=o+460|0;Db=o+456|0;Na=o+452|0;Oa=o+448|0;ab=o+444|0;va=o+440|0;eb=o+436|0;Aa=o+432|0;fb=o+428|0;la=o+424|0;Da=o+420|0;Ea=o+416|0;Fa=o+412|0;Ga=o+408|0;Ya=o+404|0;Za=o+400|0;Xa=o+396|0;Wa=o+392|0;Ca=o+388|0;Ba=o+24|0;Qa=o+384|0;Sa=o+380|0;Ra=o+376|0;Ma=o+372|0;La=o+368|0;Ka=o+364|0;_a=o+16|0;vb=o+360|0;wa=o+356|0;qa=o+352|0;sa=o+348|0;pa=o+344|0;ta=o+340|0;ra=o+336|0;oa=o+332|0;ub=o+328|0;lb=o+324|0;mb=o+320|0;xb=o+316|0;zb=o+312|0;wb=o+308|0;yb=o+548|0;Bb=o+304|0;Ab=o+300|0;Cb=o+296|0;Ja=o+292|0;kb=o+288|0;$a=o+284|0;jb=o+280|0;Ha=o+276|0;Va=o+272|0;Pa=o+268|0;Ia=o+264|0;db=o+260|0;Ta=o+256|0;Ua=o+252|0;da=o+248|0;ja=o+244|0;ea=o+240|0;fa=o+236|0;ca=o+232|0;_=o+228|0;$=o+224|0;ga=o+220|0;ba=o+216|0;ma=o+212|0;aa=o+208|0;ha=o+204|0;Z=o+200|0;ia=o+196|0;ka=o+192|0;V=o+188|0;S=o+184|0;Y=o+180|0;X=o+176|0;w=o+172|0;x=o+168|0;u=o+164|0;W=o+160|0;U=o+156|0;v=o+152|0;R=o+148|0;Q=o+144|0;E=o+140|0;M=o+136|0;T=o+132|0;G=o+128|0;K=o+124|0;L=o+120|0;z=o+116|0;A=o+112|0;y=o+108|0;I=o+104|0;N=o+100|0;F=o+96|0;H=o+92|0;J=o+88|0;P=o+84|0;C=o+80|0;O=o+76|0;B=o+72|0;ua=o+68|0;xa=o+64|0;ya=o+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]|0,1)|0;hc(c[Eb>>2]|0);break}if((c[gb>>2]|0)!=12){if(c[Eb>>2]|0){h=c[q>>2]|0;c[t>>2]=c[Eb>>2];Se(h,1200,t);hc(c[Eb>>2]|0)}h=(c[q>>2]|0)+64|0;c[h>>2]=(c[h>>2]|0)+1;c[(c[q>>2]|0)+12>>2]=c[gb>>2];break}c[ib>>2]=0;c[hb>>2]=54;while(1){if((c[ib>>2]|0)>(c[hb>>2]|0))break;c[tb>>2]=((c[ib>>2]|0)+(c[hb>>2]|0)|0)/2|0;c[gb>>2]=xc(c[m>>2]|0,c[20312+((c[tb>>2]|0)*12|0)>>2]|0)|0;if(!(c[gb>>2]|0))break;Db=c[tb>>2]|0;if((c[gb>>2]|0)<0){c[hb>>2]=Db-1;continue}else{c[ib>>2]=Db+1;continue}}if((c[ib>>2]|0)<=(c[hb>>2]|0)){if((d[20317+((c[tb>>2]|0)*12|0)>>0]&1|0)!=0?(Ar(c[q>>2]|0)|0)!=0:0)break;do switch(d[20316+((c[tb>>2]|0)*12|0)>>0]|0){case 25:{c[eb>>2]=c[(c[bb>>2]|0)+4>>2];c[Aa>>2]=-1;if(c[n>>2]|0)c[Aa>>2]=(qg(c[n>>2]|0,0)|0)&255;b:do if((c[Aa>>2]|0)>=0?(c[(c[cb>>2]|0)+4>>2]|0)==0:0){c[fb>>2]=0;while(1){if((c[fb>>2]|0)>=(c[(c[l>>2]|0)+20>>2]|0))break b;wt(c[(c[(c[l>>2]|0)+16>>2]|0)+(c[fb>>2]<<4)+4>>2]|0,c[Aa>>2]|0)|0;c[fb>>2]=(c[fb>>2]|0)+1}}while(0);c[Aa>>2]=wt(c[eb>>2]|0,c[Aa>>2]|0)|0;h=c[Aa>>2]|0;Pt(c[q>>2]|0,21048,h,((h|0)<0)<<31>>31);break a};case 24:{c[ab>>2]=c[(c[bb>>2]|0)+4>>2];if(c[n>>2]|0){h=zg(c[n>>2]|0)|0;c[(c[l>>2]|0)+72>>2]=h;if(7!=(kg(c[ab>>2]|0,c[(c[l>>2]|0)+72>>2]|0,-1,0)|0))break a;a[(c[l>>2]|0)+64>>0]=1;break a}if(c[ab>>2]|0)p=Uc(c[ab>>2]|0)|0;else p=0;c[va>>2]=p;h=c[va>>2]|0;Pt(c[q>>2]|0,21032,h,((h|0)<0)<<31>>31);break a};case 23:{h=_a;c[h>>2]=0;c[h+4>>2]=0;c[gb>>2]=0;if(!(c[gb>>2]|0)){h=_a;Pt(c[q>>2]|0,21184,c[h>>2]|0,c[h+4>>2]|0);break a}if((c[gb>>2]|0)==12)break a;h=(c[q>>2]|0)+64|0;c[h>>2]=(c[h>>2]|0)+1;c[(c[q>>2]|0)+12>>2]=c[gb>>2];break a};case 18:{Nt(c[p>>2]|0,1);Ot(c[p>>2]|0,0,0,21104,0)|0;if(c[n>>2]|0){c[Wa>>2]=Mb(c[n>>2]|0)|0;c[Ya>>2]=0;while(1){h=Rt(c[Ya>>2]|0)|0;c[Xa>>2]=h;if(!h)break;if(!(Lb(c[n>>2]|0,c[Xa>>2]|0,c[Wa>>2]|0)|0))break;c[Ya>>2]=(c[Ya>>2]|0)+1}if(!(c[Xa>>2]|0))c[Ya>>2]=-1}else c[Ya>>2]=-1;if((c[Ya>>2]|0)==-1?(c[(c[cb>>2]|0)+4>>2]|0)==0:0){c[r>>2]=0;c[(c[cb>>2]|0)+4>>2]=1}c[Za>>2]=(c[(c[l>>2]|0)+20>>2]|0)-1;while(1){if((c[Za>>2]|0)<0)break;do if(c[(c[(c[l>>2]|0)+16>>2]|0)+(c[Za>>2]<<4)+4>>2]|0){if((c[Za>>2]|0)!=(c[r>>2]|0)?(c[(c[cb>>2]|0)+4>>2]|0)!=0:0)break;Ze(c[p>>2]|0,c[Za>>2]|0);ip(c[p>>2]|0,12,c[Za>>2]|0,1,c[Ya>>2]|0)|0}while(0);c[Za>>2]=(c[Za>>2]|0)+ -1}fp(c[p>>2]|0,35,1,1)|0;break a};case 30:{if(!(c[n>>2]|0))break a;c[qa>>2]=sp(c[l>>2]|0,c[n>>2]|0,c[na>>2]|0)|0;if(!(c[qa>>2]|0))break a;c[ta>>2]=0;c[oa>>2]=Zr(c[qa>>2]|0)|0;Nt(c[p>>2]|0,6);c[(c[q>>2]|0)+72>>2]=6;qp(c[q>>2]|0,c[r>>2]|0);Ot(c[p>>2]|0,0,0,21344,0)|0;Ot(c[p>>2]|0,1,0,21352,0)|0;Ot(c[p>>2]|0,2,0,21360,0)|0;Ot(c[p>>2]|0,3,0,21368,0)|0;Ot(c[p>>2]|0,4,0,21376,0)|0;Ot(c[p>>2]|0,5,0,21392,0)|0;Qp(c[q>>2]|0,c[qa>>2]|0)|0;c[sa>>2]=0;c[ra>>2]=c[(c[qa>>2]|0)+4>>2];while(1){if((c[sa>>2]|0)>=(b[(c[qa>>2]|0)+38>>1]|0))break a;if(d[(c[ra>>2]|0)+23>>0]&2)c[ta>>2]=(c[ta>>2]|0)+1;else{fp(c[p>>2]|0,25,(c[sa>>2]|0)-(c[ta>>2]|0)|0,1)|0;hp(c[p>>2]|0,97,0,2,0,c[c[ra>>2]>>2]|0,0)|0;if(c[(c[ra>>2]|0)+12>>2]|0)q=c[(c[ra>>2]|0)+12>>2]|0;else q=1216;hp(c[p>>2]|0,97,0,3,0,q,0)|0;fp(c[p>>2]|0,25,(d[(c[ra>>2]|0)+20>>0]|0)!=0?1:0,4)|0;q=c[p>>2]|0;if(c[(c[ra>>2]|0)+8>>2]|0)hp(q,97,0,5,0,c[(c[ra>>2]|0)+8>>2]|0,0)|0;else fp(q,28,0,5)|0;c:do if(!(d[(c[ra>>2]|0)+23>>0]&1))c[pa>>2]=0;else{h=(c[oa>>2]|0)==0;c[pa>>2]=1;if(h)break;while(1){if((c[pa>>2]|0)>(b[(c[qa>>2]|0)+38>>1]|0))break c;if((b[(c[(c[oa>>2]|0)+4>>2]|0)+((c[pa>>2]|0)-1<<1)>>1]|0)==(c[sa>>2]|0))break c;c[pa>>2]=(c[pa>>2]|0)+1}}while(0);fp(c[p>>2]|0,25,c[pa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2]|0)+16>>2];while(1){if(!(c[$>>2]|0))break a;if(c[n>>2]|0){c[ja>>2]=Re(c[q>>2]|0,0,c[n>>2]|0,c[na>>2]|0)|0;c[$>>2]=0}else{c[ja>>2]=c[(c[$>>2]|0)+8>>2];c[$>>2]=c[c[$>>2]>>2]}if(!(c[ja>>2]|0))continue;if(!(c[(c[ja>>2]|0)+16>>2]|0))continue;Jr(c[q>>2]|0,c[r>>2]|0,c[(c[ja>>2]|0)+32>>2]|0,0,c[c[ja>>2]>>2]|0);if(((b[(c[ja>>2]|0)+38>>1]|0)+(c[aa>>2]|0)|0)>(c[(c[q>>2]|0)+72>>2]|0))c[(c[q>>2]|0)+72>>2]=(b[(c[ja>>2]|0)+38>>1]|0)+(c[aa>>2]|0);Kr(c[q>>2]|0,0,c[r>>2]|0,c[ja>>2]|0,54);hp(c[p>>2]|0,97,0,c[ba>>2]|0,0,c[c[ja>>2]>>2]|0,0)|0;c[ca>>2]=1;c[da>>2]=c[(c[ja>>2]|0)+16>>2];d:while(1){if(!(c[da>>2]|0))break;c[ea>>2]=sp(c[l>>2]|0,c[(c[da>>2]|0)+8>>2]|0,c[na>>2]|0)|0;do if(c[ea>>2]|0){c[fa>>2]=0;Jr(c[q>>2]|0,c[r>>2]|0,c[(c[ea>>2]|0)+32>>2]|0,0,c[c[ea>>2]>>2]|0);c[ga>>2]=$t(c[q>>2]|0,c[ea>>2]|0,c[da>>2]|0,fa,0)|0;if(c[ga>>2]|0){s=195;break d}if(!(c[fa>>2]|0)){Kr(c[q>>2]|0,c[ca>>2]|0,c[r>>2]|0,c[ea>>2]|0,54);break}else{ip(c[p>>2]|0,54,c[ca>>2]|0,c[(c[fa>>2]|0)+44>>2]|0,c[r>>2]|0)|0;Lr(c[q>>2]|0,c[fa>>2]|0);break}}while(0);c[ca>>2]=(c[ca>>2]|0)+1;c[da>>2]=c[(c[da>>2]|0)+4>>2]}if((s|0)==195){s=0;c[$>>2]=0}if(c[da>>2]|0)break a;if((c[(c[q>>2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0))break a;h=c[l>>2]|0;bu(h,(qg(c[n>>2]|0,0)|0)&255);break a};case 11:{if(!(c[n>>2]|0)){if(Ar(c[q>>2]|0)|0)break a;Nt(c[p>>2]|0,1);Ot(c[p>>2]|0,0,0,21880,0)|0;fp(c[p>>2]|0,97,0,1)|0;bf(c[p>>2]|0,-1,c[21728+(d[(c[(c[(c[c[q>>2]>>2]|0)+16>>2]|0)+12>>2]|0)+77>>0]<<3)>>2]|0,-2);fp(c[p>>2]|0,35,1,1)|0;break a}if((e[(c[(c[(c[l>>2]|0)+16>>2]|0)+12>>2]|0)+78>>1]&1|0)==1?(e[(c[(c[(c[l>>2]|0)+16>>2]|0)+12>>2]|0)+78>>1]&4|0)!=4:0)break a;c[ua>>2]=21728;while(1){if(!(c[c[ua>>2]>>2]|0))break;h=0==(xc(c[n>>2]|0,c[c[ua>>2]>>2]|0)|0);p=c[ua>>2]|0;if(h){s=286;break}c[ua>>2]=p+8}if((s|0)==286){if(d[p+4>>0]|0)p=d[(c[ua>>2]|0)+4>>0]|0;else p=(a[1136]|0)==0?3:2;a[(c[(c[(c[c[q>>2]>>2]|0)+16>>2]|0)+12>>2]|0)+77>>0]=p}if(c[c[ua>>2]>>2]|0)break a;h=c[q>>2]|0;c[t>>2]=c[n>>2];Se(h,21896,t);break a};case 0:{Ze(c[p>>2]|0,c[r>>2]|0);switch(a[c[m>>2]>>0]|0){case 65:case 97:{c[xa>>2]=8;break};case 70:case 102:{c[xa>>2]=0;break};case 83:case 115:{c[xa>>2]=1;break};default:c[xa>>2]=6}q=c[p>>2]|0;if((c[n>>2]|0)!=0&(c[xa>>2]|0)!=0){c[ya>>2]=Ye(q,3,21928,0)|0;_e(c[p>>2]|0,c[ya>>2]|0,c[r>>2]|0);k=c[p>>2]|0;h=(c[ya>>2]|0)+1|0;_e(k,h,zg(c[n>>2]|0)|0);_e(c[p>>2]|0,(c[ya>>2]|0)+2|0,c[r>>2]|0);$e(c[p>>2]|0,(c[ya>>2]|0)+2|0,c[xa>>2]|0);break a}else{c[za>>2]=Ye(q,3,21944,0)|0;_e(c[p>>2]|0,c[za>>2]|0,c[r>>2]|0);_e(c[p>>2]|0,(c[za>>2]|0)+1|0,c[r>>2]|0);af(c[p>>2]|0,(c[za>>2]|0)+1|0,c[xa>>2]|0);Nt(c[p>>2]|0,1);Ot(c[p>>2]|0,0,0,c[m>>2]|0,-1)|0;break a}};case 35:{c[nb>>2]=(c[c[cb>>2]>>2]|0)!=0?c[r>>2]|0:10;c[ob>>2]=0;do if(c[n>>2]|0){if(!(xc(c[n>>2]|0,21976)|0)){c[ob>>2]=1;break}if(!(xc(c[n>>2]|0,21984)|0))c[ob>>2]=2}while(0);Nt(c[p>>2]|0,3);c[(c[q>>2]|0)+72>>2]=3;Ot(c[p>>2]|0,0,0,21992,0)|0;Ot(c[p>>2]|0,1,0,22e3,0)|0;Ot(c[p>>2]|0,2,0,22008,0)|0;ip(c[p>>2]|0,11,c[nb>>2]|0,c[ob>>2]|0,1)|0;fp(c[p>>2]|0,35,1,3)|0;break a};case 7:{c[pb>>2]=0;Nt(c[p>>2]|0,1);c[(c[q>>2]|0)+72>>2]=1;Ot(c[p>>2]|0,0,0,21960,0)|0;while(1){h=c[pb>>2]|0;c[pb>>2]=h+1;h=Ob(h)|0;c[qb>>2]=h;if(!h)break a;hp(c[p>>2]|0,97,0,1,0,c[qb>>2]|0,0)|0;fp(c[p>>2]|0,35,1,1)|0}};case 26:{Ef(c[l>>2]|0)|0;break a};case 34:{if(c[n>>2]|0){h=c[l>>2]|0;Uf(h,zg(c[n>>2]|0)|0)|0}if((c[(c[l>>2]|0)+212>>2]|0)==5)p=c[(c[l>>2]|0)+216>>2]|0;else p=0;Pt(c[q>>2]|0,22024,p,((p|0)<0)<<31>>31);break a};case 27:{if((c[n>>2]|0)!=0?(rg(c[n>>2]|0,rb)|0)==0:0){h=rb;cc(c[h>>2]|0,c[h+4>>2]|0)|0}k=c[q>>2]|0;h=cc(-1,-1)|0;Pt(k,22056,h,D);break a};case 33:{if((c[n>>2]|0)!=0?(f=(rg(c[n>>2]|0,sb)|0)==0,h=sb,k=c[h+4>>2]|0,f&((k|0)>0|(k|0)==0&(c[h>>2]|0)>>>0>=0)):0)bg(c[l>>2]|0,11,c[sb>>2]&2147483647)|0;k=c[q>>2]|0;h=bg(c[l>>2]|0,11,-1)|0;Pt(k,22072,h,((h|0)<0)<<31>>31);break a};case 31:{p=c[q>>2]|0;if(c[n>>2]|0){Wt(p,c[n>>2]|0)|0;break a}else{Pt(p,21200,d[(c[l>>2]|0)+63>>0]|0,0);break a}};case 2:{if(!(c[n>>2]|0)){h=(c[(c[l>>2]|0)+24>>2]&c[20320+((c[tb>>2]|0)*12|0)>>2]|0)!=0&1;Pt(c[q>>2]|0,c[20312+((c[tb>>2]|0)*12|0)>>2]|0,h,((h|0)<0)<<31>>31);break a}c[wa>>2]=c[20320+((c[tb>>2]|0)*12|0)>>2];if(!(d[(c[l>>2]|0)+62>>0]|0))c[wa>>2]=c[wa>>2]&-524289;h=(qg(c[n>>2]|0,0)|0)<<24>>24!=0;q=c[wa>>2]|0;if(!h){h=(c[l>>2]|0)+24|0;c[h>>2]=c[h>>2]&~q;if((c[wa>>2]|0)==16777216){h=(c[l>>2]|0)+512|0;c[h>>2]=0;c[h+4>>2]=0}}else{h=(c[l>>2]|0)+24|0;c[h>>2]=c[h>>2]|q}fp(c[p>>2]|0,142,0,0)|0;Yt(c[l>>2]|0);break a};case 32:{if(!(c[n>>2]|0)){if(!(c[392]|0))break a;Nt(c[p>>2]|0,1);Ot(c[p>>2]|0,0,0,21216,0)|0;hp(c[p>>2]|0,97,0,1,0,c[392]|0,0)|0;fp(c[p>>2]|0,35,1,1)|0;break a}if((a[c[n>>2]>>0]|0)!=0?(c[gb>>2]=vi(c[c[l>>2]>>2]|0,c[n>>2]|0,1,vb)|0,(c[gb>>2]|0)!=0|(c[vb>>2]|0)==0):0){Se(c[q>>2]|0,21240,t);break a}if((d[(c[l>>2]|0)+63>>0]|0)<=1)Xt(c[q>>2]|0)|0;hc(c[392]|0);if(a[c[n>>2]>>0]|0){c[t>>2]=c[n>>2];c[392]=qc(1200,t)|0;break a}else{c[392]=0;break a}};case 15:{if(!(c[n>>2]|0))break a;c[xb>>2]=Op(c[l>>2]|0,c[n>>2]|0,c[na>>2]|0)|0;if(!(c[xb>>2]|0))break a;c[zb>>2]=c[(c[xb>>2]|0)+12>>2];Nt(c[p>>2]|0,3);c[(c[q>>2]|0)+72>>2]=3;qp(c[q>>2]|0,c[r>>2]|0);Ot(c[p>>2]|0,0,0,21424,0)|0;Ot(c[p>>2]|0,1,0,21344,0)|0;Ot(c[p>>2]|0,2,0,21352,0)|0;c[wb>>2]=0;while(1){if((c[wb>>2]|0)>=(e[(c[xb>>2]|0)+50>>1]|0))break a;b[yb>>1]=b[(c[(c[xb>>2]|0)+4>>2]|0)+(c[wb>>2]<<1)>>1]|0;fp(c[p>>2]|0,25,c[wb>>2]|0,1)|0;fp(c[p>>2]|0,25,b[yb>>1]|0,2)|0;hp(c[p>>2]|0,97,0,3,0,c[(c[(c[zb>>2]|0)+4>>2]|0)+((b[yb>>1]|0)*24|0)>>2]|0,0)|0;fp(c[p>>2]|0,35,1,3)|0;c[wb>>2]=(c[wb>>2]|0)+1}};case 16:{if(!(c[n>>2]|0))break a;c[Ab>>2]=sp(c[l>>2]|0,c[n>>2]|0,c[na>>2]|0)|0;if(!(c[Ab>>2]|0))break a;c[p>>2]=dp(c[q>>2]|0)|0;Nt(c[p>>2]|0,3);c[(c[q>>2]|0)+72>>2]=3;qp(c[q>>2]|0,c[r>>2]|0);Ot(c[p>>2]|0,0,0,21432,0)|0;Ot(c[p>>2]|0,1,0,21352,0)|0;Ot(c[p>>2]|0,2,0,21440,0)|0;c[Bb>>2]=c[(c[Ab>>2]|0)+8>>2];c[Cb>>2]=0;while(1){if(!(c[Bb>>2]|0))break a;fp(c[p>>2]|0,25,c[Cb>>2]|0,1)|0;hp(c[p>>2]|0,97,0,2,0,c[c[Bb>>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=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;o=i;i=i+128|0;y=o;s=o+116|0;L=o+112|0;J=o+108|0;H=o+104|0;B=o+100|0;q=o+96|0;p=o+92|0;r=o+88|0;G=o+84|0;x=o+80|0;v=o+76|0;A=o+72|0;u=o+68|0;w=o+64|0;t=o+60|0;F=o+56|0;I=o+32|0;C=o+24|0;E=o+20|0;D=o+16|0;z=o+12|0;c[s>>2]=b;c[L>>2]=e;c[J>>2]=f;c[H>>2]=g;c[B>>2]=h;c[q>>2]=j;c[p>>2]=k;c[r>>2]=l;c[G>>2]=m;c[x>>2]=n;c[v>>2]=0;c[u>>2]=0;c[w>>2]=c[c[s>>2]>>2];do if(c[G>>2]|0)if((c[(c[J>>2]|0)+4>>2]|0)>>>0<=0){c[t>>2]=1;c[F>>2]=c[L>>2];if(c[p>>2]|0){K=6;break}else break}else{Se(c[s>>2]|0,19856,y);break}else{c[t>>2]=Er(c[s>>2]|0,c[L>>2]|0,c[J>>2]|0,F)|0;if((c[t>>2]|0)>=0&(c[p>>2]|0)!=0)K=6}while(0);do if((K|0)==6?(d[(c[w>>2]|0)+64>>0]|0)==0:0){if((c[t>>2]|0)!=1?(d[(c[w>>2]|0)+145>>0]|0)!=0:0){Xb(c[w>>2]|0,c[(c[p>>2]|0)+12>>2]|0);c[(c[p>>2]|0)+12>>2]=0}c[A>>2]=Ft(c[s>>2]|0,c[p>>2]|0)|0;if(((d[(c[w>>2]|0)+145>>0]|0)==0?(c[A>>2]|0)!=0?(c[(c[J>>2]|0)+4>>2]|0)==0:0:0)?(c[(c[A>>2]|0)+68>>2]|0)==(c[(c[(c[w>>2]|0)+16>>2]|0)+28>>2]|0):0)c[t>>2]=1;if((a[(c[w>>2]|0)+64>>0]|0)==0?(Gt(I,c[s>>2]|0,c[t>>2]|0,1488,c[F>>2]|0),(Ht(I,c[p>>2]|0)|0)==0):0){c[A>>2]=Ft(c[s>>2]|0,c[p>>2]|0)|0;if(!(c[A>>2]|0)){if((d[(c[w>>2]|0)+144>>0]|0)!=1)break;a[(c[w>>2]|0)+146>>0]=1;break}if(d[(c[A>>2]|0)+44>>0]&16){Se(c[s>>2]|0,19904,y);break}c[u>>2]=Zo(c[w>>2]|0,c[F>>2]|0)|0;if((c[u>>2]|0)!=0?0==(Pp(c[s>>2]|0,c[u>>2]|0)|0):0){if(bh((c[(c[(c[w>>2]|0)+16>>2]|0)+(c[t>>2]<<4)+12>>2]|0)+40|0,c[u>>2]|0)|0){z=c[s>>2]|0;if(c[x>>2]|0){qp(z,c[t>>2]|0);break}else{c[y>>2]=c[F>>2];Se(z,19952,y);break}}if(!(Lb(c[c[A>>2]>>2]|0,15144,7)|0)){Se(c[s>>2]|0,19984,y);b=(c[s>>2]|0)+64|0;c[b>>2]=(c[b>>2]|0)+1;break}if((c[H>>2]|0)!=49?(c[(c[A>>2]|0)+12>>2]|0)!=0:0){b=c[s>>2]|0;e=c[p>>2]|0;c[y>>2]=(c[H>>2]|0)==35?20064:20072;c[y+4>>2]=e;c[y+8>>2]=0;Se(b,20024,y);break}if((c[H>>2]|0)==49?(c[(c[A>>2]|0)+12>>2]|0)==0:0){b=c[s>>2]|0;c[y>>2]=c[p>>2];c[y+4>>2]=0;Se(b,20080,y);break}c[C>>2]=Ve(c[w>>2]|0,c[(c[A>>2]|0)+68>>2]|0)|0;c[E>>2]=7;c[D>>2]=c[(c[(c[w>>2]|0)+16>>2]|0)+(c[C>>2]<<4)>>2];if(c[G>>2]|0)x=c[(c[(c[w>>2]|0)+16>>2]|0)+16>>2]|0;else x=c[D>>2]|0;c[z>>2]=x;if((c[C>>2]|0)==1|(c[G>>2]|0)!=0)c[E>>2]=5;if((ap(c[s>>2]|0,c[E>>2]|0,c[u>>2]|0,c[c[A>>2]>>2]|0,c[z>>2]|0)|0)==0?(ap(c[s>>2]|0,18,(c[C>>2]|0)==1?14904:14928,0,c[D>>2]|0)|0)==0:0){if((c[H>>2]|0)==49)c[H>>2]=35;c[v>>2]=se(c[w>>2]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0}return 0}function Ko(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;m=i;i=i+48|0;l=m;j=m+40|0;g=m+36|0;f=m+32|0;n=m+28|0;r=m+24|0;k=m+20|0;q=m+16|0;h=m+12|0;p=m+8|0;c[j>>2]=b;c[g>>2]=d;c[f>>2]=e;c[n>>2]=0;c[h>>2]=c[c[j>>2]>>2];if(a[(c[h>>2]|0)+64>>0]|0){d=c[h>>2]|0;b=c[g>>2]|0;vn(d,b);i=m;return}if(Ar(c[j>>2]|0)|0){d=c[h>>2]|0;b=c[g>>2]|0;vn(d,b);i=m;return}c[k>>2]=c[(c[g>>2]|0)+12>>2];c[q>>2]=c[(c[g>>2]|0)+16>>2];c[r>>2]=0;while(1){if((c[r>>2]|0)>=(c[(c[h>>2]|0)+20>>2]|0))break;b=c[r>>2]|0;c[p>>2]=(c[r>>2]|0)<2?b^1:b;if(!((c[k>>2]|0)!=0?(xc(c[(c[(c[h>>2]|0)+16>>2]|0)+(c[p>>2]<<4)>>2]|0,c[k>>2]|0)|0)!=0:0))o=7;if((o|0)==7?(o=0,c[n>>2]=bh((c[(c[(c[h>>2]|0)+16>>2]|0)+(c[p>>2]<<4)+12>>2]|0)+40|0,c[q>>2]|0)|0,(c[n>>2]|0)!=0):0)break;c[r>>2]=(c[r>>2]|0)+1}if(c[n>>2]|0){Bt(c[j>>2]|0,c[n>>2]|0);d=c[h>>2]|0;b=c[g>>2]|0;vn(d,b);i=m;return}n=c[j>>2]|0;if(c[f>>2]|0)At(n,c[k>>2]|0);else{c[l>>2]=c[g>>2];c[l+4>>2]=0;Se(n,19792,l)}a[(c[j>>2]|0)+17>>0]=1;d=c[h>>2]|0;b=c[g>>2]|0;vn(d,b);i=m;return}function Lo(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;k=f+12|0;j=f+8|0;h=f+4|0;g=f;c[k>>2]=a;c[j>>2]=b;c[h>>2]=d;c[g>>2]=e;st(c[k>>2]|0,24,19552,c[j>>2]|0,c[j>>2]|0,c[h>>2]|0,c[g>>2]|0);i=f;return}function Mo(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;st(c[f>>2]|0,25,19368,c[e>>2]|0,0,0,c[e>>2]|0);i=d;return}function No(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;k=i;i=i+64|0;j=k;f=k+48|0;r=k+44|0;s=k+40|0;u=k+36|0;p=k+32|0;l=k+28|0;n=k+24|0;h=k+20|0;g=k+16|0;o=k+12|0;q=k+8|0;t=k+4|0;c[f>>2]=b;c[r>>2]=d;c[s>>2]=e;c[o>>2]=c[c[f>>2]>>2];if(Ar(c[f>>2]|0)|0){i=k;return}if(!(c[r>>2]|0)){ms(c[f>>2]|0,0);i=k;return}if(!((c[s>>2]|0)!=0?(c[c[s>>2]>>2]|0)!=0:0))m=6;do if((m|0)==6){c[t>>2]=Zo(c[c[f>>2]>>2]|0,c[r>>2]|0)|0;if(!(c[t>>2]|0)){i=k;return}c[u>>2]=$g(c[o>>2]|0,a[(c[(c[(c[o>>2]|0)+16>>2]|0)+12>>2]|0)+77>>0]|0,c[t>>2]|0,0)|0;if(!(c[u>>2]|0)){Xb(c[o>>2]|0,c[t>>2]|0);break}ms(c[f>>2]|0,c[t>>2]|0);Xb(c[o>>2]|0,c[t>>2]|0);i=k;return}while(0);c[g>>2]=Er(c[f>>2]|0,c[r>>2]|0,c[s>>2]|0,q)|0;if((c[g>>2]|0)<0){i=k;return}c[p>>2]=Zo(c[o>>2]|0,c[q>>2]|0)|0;if(!(c[p>>2]|0)){i=k;return}c[l>>2]=c[(c[(c[o>>2]|0)+16>>2]|0)+(c[g>>2]<<4)>>2];c[n>>2]=sp(c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>2]|0;A=(c[t>>2]|0)==1?14904:14928;t=c[j>>2]|0;w=c[j>>2]|0;x=c[j>>2]|0;y=c[j>>2]|0;f=c[j>>2]|0;z=c[u>>2]|0;e=c[v>>2]|0;c[n>>2]=c[s>>2];c[n+4>>2]=A;c[n+8>>2]=t;c[n+12>>2]=w;c[n+16>>2]=x;c[n+20>>2]=y;c[n+24>>2]=f;c[n+28>>2]=z;c[n+32>>2]=e;cp(b,15768,n);if(sp(c[r>>2]|0,16152,c[s>>2]|0)|0){A=c[o>>2]|0;e=c[j>>2]|0;b=c[c[m>>2]>>2]|0;c[n>>2]=c[s>>2];c[n+4>>2]=e;c[n+8>>2]=b;cp(A,16168,n)}A=xp(c[o>>2]|0,c[m>>2]|0)|0;c[h>>2]=A;if(A){A=c[o>>2]|0;e=c[j>>2]|0;b=c[h>>2]|0;c[n>>2]=c[j>>2];c[n+4>>2]=e;c[n+8>>2]=b;cp(A,16232,n);Xb(c[r>>2]|0,c[h>>2]|0)}a:do if(c[(c[r>>2]|0)+24>>2]&524288){c[p>>2]=Up(c[m>>2]|0)|0;while(1){if(!(c[p>>2]|0))break a;c[g>>2]=c[c[p>>2]>>2];if((c[g>>2]|0)!=(c[m>>2]|0))vp(c[o>>2]|0,c[c[p>>2]>>2]|0,c[c[g>>2]>>2]|0);c[p>>2]=c[(c[p>>2]|0)+12>>2]}}while(0);vp(c[o>>2]|0,c[m>>2]|0,c[j>>2]|0);break}A=c[o>>2]|0;c[n>>2]=c[j>>2];Se(A,15600,n)}while(0);vn(c[r>>2]|0,c[q>>2]|0);Xb(c[r>>2]|0,c[j>>2]|0);c[(c[r>>2]|0)+24>>2]=c[k>>2];i=l;return}function Qo(e,f){e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;p=i;i=i+80|0;j=p;h=p+76|0;l=p+72|0;s=p+68|0;w=p+64|0;t=p+60|0;u=p+56|0;v=p+52|0;m=p+48|0;r=p+44|0;o=p+40|0;k=p+36|0;n=p+32|0;g=p+28|0;q=p+24|0;c[h>>2]=e;c[l>>2]=f;c[k>>2]=c[c[h>>2]>>2];if(c[(c[h>>2]|0)+64>>2]|0){i=p;return}if(d[(c[k>>2]|0)+64>>0]|0){i=p;return}c[s>>2]=c[(c[h>>2]|0)+484>>2];c[t>>2]=Ve(c[k>>2]|0,c[(c[s>>2]|0)+68>>2]|0)|0;c[u>>2]=c[(c[(c[k>>2]|0)+16>>2]|0)+(c[t>>2]<<4)>>2];c[v>>2]=(c[c[s>>2]>>2]|0)+16;c[r>>2]=(c[(c[s>>2]|0)+4>>2]|0)+(((b[(c[s>>2]|0)+38>>1]|0)-1|0)*24|0);c[o>>2]=c[(c[r>>2]|0)+4>>2];c[w>>2]=sp(c[k>>2]|0,c[v>>2]|0,c[u>>2]|0)|0;if(ap(c[h>>2]|0,26,c[u>>2]|0,c[c[w>>2]>>2]|0,0)|0){i=p;return}if((c[o>>2]|0)!=0?(d[c[o>>2]>>0]|0)==101:0)c[o>>2]=0;if(d[(c[r>>2]|0)+23>>0]&1){Se(c[h>>2]|0,15184,j);i=p;return}if(c[(c[s>>2]|0)+8>>2]|0){Se(c[h>>2]|0,15216,j);i=p;return}if((c[(c[k>>2]|0)+24>>2]&524288|0)!=0?(c[o>>2]|0)!=0?(c[(c[s>>2]|0)+16>>2]|0)!=0:0:0){Se(c[h>>2]|0,15248,j);i=p;return}if(!((c[o>>2]|0)!=0?1:(d[(c[r>>2]|0)+20>>0]|0)==0)){Se(c[h>>2]|0,15312,j);i=p;return}do if(c[o>>2]|0){c[n>>2]=0;if(tp(c[k>>2]|0,c[o>>2]|0,1,65,n)|0){a[(c[k>>2]|0)+64>>0]=1;i=p;return}if(c[n>>2]|0){tf(c[n>>2]|0);break}Se(c[h>>2]|0,15368,j);i=p;return}while(0);c[m>>2]=rm(c[k>>2]|0,c[c[l>>2]>>2]|0,c[(c[l>>2]|0)+4>>2]|0,0)|0;if(c[m>>2]|0){c[g>>2]=(c[m>>2]|0)+((c[(c[l>>2]|0)+4>>2]|0)-1);c[q>>2]=c[(c[k>>2]|0)+24>>2];while(1){if((c[g>>2]|0)>>>0<=(c[m>>2]|0)>>>0)break;if((a[c[g>>2]>>0]|0)!=59?(d[1224+(d[c[g>>2]>>0]|0)>>0]&1|0)==0:0)break;e=c[g>>2]|0;c[g>>2]=e+ -1;a[e>>0]=0}e=(c[k>>2]|0)+24|0;c[e>>2]=c[e>>2]|2097152;e=c[h>>2]|0;l=(c[t>>2]|0)==1?14904:14928;n=c[(c[s>>2]|0)+48>>2]|0;r=c[m>>2]|0;s=(c[(c[s>>2]|0)+48>>2]|0)+1|0;v=c[v>>2]|0;c[j>>2]=c[u>>2];c[j+4>>2]=l;c[j+8>>2]=n;c[j+12>>2]=r;c[j+16>>2]=s;c[j+20>>2]=v;cp(e,15416,j);Xb(c[k>>2]|0,c[m>>2]|0);c[(c[k>>2]|0)+24>>2]=c[q>>2]}up(c[h>>2]|0,c[t>>2]|0,(c[o>>2]|0)!=0?3:2);vp(c[h>>2]|0,c[w>>2]|0,c[c[w>>2]>>2]|0);i=p;return}function Ro(e,f){e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;g=i;i=i+48|0;l=g;k=g+40|0;n=g+36|0;h=g+32|0;o=g+28|0;p=g+24|0;m=g+20|0;q=g+16|0;s=g+12|0;j=g+8|0;r=g+4|0;c[k>>2]=e;c[n>>2]=f;c[j>>2]=c[c[k>>2]>>2];if(a[(c[j>>2]|0)+64>>0]|0){f=c[j>>2]|0;e=c[n>>2]|0;vn(f,e);i=g;return}c[o>>2]=np(c[k>>2]|0,0,(c[n>>2]|0)+8|0)|0;if(!(c[o>>2]|0)){f=c[j>>2]|0;e=c[n>>2]|0;vn(f,e);i=g;return}if(d[(c[o>>2]|0)+44>>0]&16){Se(c[k>>2]|0,14976,l);f=c[j>>2]|0;e=c[n>>2]|0;vn(f,e);i=g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c[(c[k>>2]|0)+500>>2]=(c[c[j>>2]>>2]|0)+(c[(c[j>>2]|0)+4>>2]|0)-(c[c[p>>2]>>2]|0);if(!(c[(c[l>>2]|0)+56>>2]|0)){i=o;return}ap(c[k>>2]|0,29,c[c[l>>2]>>2]|0,c[c[(c[l>>2]|0)+56>>2]>>2]|0,c[(c[(c[c[k>>2]>>2]|0)+16>>2]|0)+(c[m>>2]<<4)>>2]|0)|0;i=o;return}function Uo(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;_o(c[d>>2]|0);c[(c[d>>2]|0)+512>>2]=0;c[(c[d>>2]|0)+516>>2]=0;i=b;return}function Vo(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;g=d+8|0;f=d+4|0;e=d;c[g>>2]=a;c[f>>2]=b;c[e>>2]=(c[g>>2]|0)+512;b=c[f>>2]|0;if(!(c[c[e>>2]>>2]|0)){c[c[e>>2]>>2]=c[b>>2];c[(c[e>>2]|0)+4>>2]=c[(c[f>>2]|0)+4>>2];i=d;return}else{c[(c[e>>2]|0)+4>>2]=(c[c[f>>2]>>2]|0)+(c[b+4>>2]|0)-(c[c[e>>2]>>2]|0);i=d;return}}function Wo(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;n=i;i=i+48|0;q=n;p=n+40|0;l=n+36|0;s=n+32|0;h=n+28|0;j=n+24|0;o=n+20|0;m=n+16|0;k=n+12|0;r=n+8|0;g=n+4|0;c[p>>2]=a;c[l>>2]=b;c[s>>2]=d;c[h>>2]=e;c[j>>2]=f;c[o>>2]=c[c[p>>2]>>2];c[k>>2]=Zo(c[c[p>>2]>>2]|0,c[s>>2]|0)|0;a:do if((c[k>>2]|0)!=0&(c[l>>2]|0)!=0){c[r>>2]=0;while(1){if((c[r>>2]|0)>=(c[c[l>>2]>>2]|0))break a;if(!(xc(c[k>>2]|0,c[(c[l>>2]|0)+8+(c[r>>2]<<4)>>2]|0)|0)){s=c[p>>2]|0;c[q>>2]=c[k>>2];Se(s,14720,q)}c[r>>2]=(c[r>>2]|0)+1}}while(0);if(c[l>>2]|0){c[g>>2]=24+(c[c[l>>2]>>2]<<4);s=c[g>>2]|0;c[m>>2]=Fk(c[o>>2]|0,c[l>>2]|0,s,((s|0)<0)<<31>>31)|0}else c[m>>2]=se(c[o>>2]|0,24,0)|0;if(!(c[m>>2]|0)){sn(c[o>>2]|0,c[h>>2]|0);tn(c[o>>2]|0,c[j>>2]|0);Xb(c[o>>2]|0,c[k>>2]|0);c[m>>2]=c[l>>2];s=c[m>>2]|0;i=n;return s|0}else{c[(c[m>>2]|0)+8+(c[c[m>>2]>>2]<<4)+8>>2]=c[j>>2];c[(c[m>>2]|0)+8+(c[c[m>>2]>>2]<<4)+4>>2]=c[h>>2];c[(c[m>>2]|0)+8+(c[c[m>>2]>>2]<<4)>>2]=c[k>>2];c[(c[m>>2]|0)+8+(c[c[m>>2]>>2]<<4)+12>>2]=0;s=c[m>>2]|0;c[s>>2]=(c[s>>2]|0)+1;s=c[m>>2]|0;i=n;return s|0}return 0}function Xo(f,g){f=f|0;g=g|0;var h=0,j=0,k=0,l=0;j=i;i=i+16|0;l=j+4|0;k=j+8|0;h=j;c[l>>2]=f;a[k>>0]=g;c[h>>2]=b[11104+(c[l>>2]<<1)>>1];c[h>>2]=(c[h>>2]|0)+(d[k>>0]|0);i=j;return e[11720+(c[h>>2]<<1)>>1]|0}function Yo(a){a=a|0;var b=0,d=0,e=0;e=i;i=i+16|0;d=e+4|0;b=e;c[d>>2]=a;c[b>>2]=c[(c[d>>2]|0)+8>>2];while(1){if((c[c[d>>2]>>2]|0)<0)break;zn(c[d>>2]|0)|0}c[(c[d>>2]|0)+8>>2]=c[b>>2];i=e;return}function Zo(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;g=d+8|0;f=d+4|0;e=d;c[g>>2]=a;c[f>>2]=b;if(c[f>>2]|0){c[e>>2]=rm(c[g>>2]|0,c[c[f>>2]>>2]|0,c[(c[f>>2]|0)+4>>2]|0,0)|0;sm(c[e>>2]|0)|0;a=c[e>>2]|0;i=d;return a|0}else{c[e>>2]=0;a=c[e>>2]|0;i=d;return a|0}return 0}function _o(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+16|0;d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[d>>2]=a;if(!(c[(c[d>>2]|0)+512>>2]|0)){i=b;return}if(!(c[(c[d>>2]|0)+484>>2]|0)){i=b;return}c[e>>2]=c[(c[d>>2]|0)+512>>2];c[f>>2]=c[(c[d>>2]|0)+516>>2];c[g>>2]=c[c[d>>2]>>2];a=c[g>>2]|0;d=c[(c[d>>2]|0)+484>>2]|0;f=c[f>>2]|0;$o(a,d,rm(c[g>>2]|0,c[e>>2]|0,f,((f|0)<0)<<31>>31)|0);i=b;return}function $o(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;j=i;i=i+32|0;k=j+24|0;f=j+20|0;e=j+16|0;h=j+12|0;m=j+8|0;g=j+4|0;l=j;c[k>>2]=a;c[f>>2]=b;c[e>>2]=d;b=(c[f>>2]|0)+52|0;a=c[b>>2]|0;c[b>>2]=a+1;c[h>>2]=a;c[m>>2]=1+(c[(c[f>>2]|0)+52>>2]|0)<<2;a=c[m>>2]|0;c[g>>2]=Fk(c[k>>2]|0,c[(c[f>>2]|0)+56>>2]|0,a,((a|0)<0)<<31>>31)|0;if(c[g>>2]|0){c[(c[g>>2]|0)+(c[h>>2]<<2)>>2]=c[e>>2];c[(c[g>>2]|0)+((c[h>>2]|0)+1<<2)>>2]=0;a=c[g>>2]|0;m=c[f>>2]|0;m=m+56|0;c[m>>2]=a;i=j;return}c[l>>2]=0;while(1){d=c[k>>2]|0;if((c[l>>2]|0)>=(c[h>>2]|0))break;Xb(d,c[(c[(c[f>>2]|0)+56>>2]|0)+(c[l>>2]<<2)>>2]|0);c[l>>2]=(c[l>>2]|0)+1}Xb(d,c[e>>2]|0);Xb(c[k>>2]|0,c[(c[f>>2]|0)+56>>2]|0);c[(c[f>>2]|0)+52>>2]=0;a=c[g>>2]|0;m=c[f>>2]|0;m=m+56|0;c[m>>2]=a;i=j;return}function ap(a,b,e,f,g){a=a|0;b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;o=i;i=i+48|0;m=o;j=o+32|0;l=o+28|0;h=o+24|0;p=o+20|0;q=o+16|0;r=o+12|0;n=o+8|0;k=o+4|0;c[l>>2]=a;c[h>>2]=b;c[p>>2]=e;c[q>>2]=f;c[r>>2]=g;c[n>>2]=c[c[l>>2]>>2];if((d[(c[n>>2]|0)+145>>0]|0|0)==0?(d[(c[l>>2]|0)+451>>0]|0|0)==0:0){if(!(c[(c[n>>2]|0)+284>>2]|0)){c[j>>2]=0;a=c[j>>2]|0;i=o;return a|0}c[k>>2]=tb[c[(c[n>>2]|0)+284>>2]&1](c[(c[n>>2]|0)+288>>2]|0,c[h>>2]|0,c[p>>2]|0,c[q>>2]|0,c[r>>2]|0,c[(c[l>>2]|0)+492>>2]|0)|0;if((c[k>>2]|0)!=1){if((c[k>>2]|0)!=0&(c[k>>2]|0)!=2){c[k>>2]=1;bp(c[l>>2]|0)}}else{Se(c[l>>2]|0,14752,m);c[(c[l>>2]|0)+12>>2]=23}c[j>>2]=c[k>>2];a=c[j>>2]|0;i=o;return a|0}c[j>>2]=0;a=c[j>>2]|0;i=o;return a|0}function bp(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b+4|0;c[d>>2]=a;Se(c[d>>2]|0,14768,b);c[(c[d>>2]|0)+12>>2]=1;i=b;return}function cp(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;l=i;i=i+144|0;f=l+36|0;n=l+32|0;m=l+16|0;g=l+8|0;h=l+4|0;j=l;k=l+40|0;c[f>>2]=b;c[n>>2]=d;c[h>>2]=0;c[j>>2]=c[c[f>>2]>>2];if(c[(c[f>>2]|0)+64>>2]|0){i=l;return}c[m>>2]=e;c[g>>2]=yn(c[j>>2]|0,c[n>>2]|0,m)|0;if(!(c[g>>2]|0)){i=l;return}n=(c[f>>2]|0)+18|0;a[n>>0]=(a[n>>0]|0)+1<<24>>24;n=k+0|0;e=(c[f>>2]|0)+440|0;m=n+96|0;do{a[n>>0]=a[e>>0]|0;n=n+1|0;e=e+1|0}while((n|0)<(m|0));n=(c[f>>2]|0)+440|0;m=n+96|0;do{c[n>>2]=0;n=n+4|0}while((n|0)<(m|0));qf(c[f>>2]|0,c[g>>2]|0,h)|0;Xb(c[j>>2]|0,c[h>>2]|0);Xb(c[j>>2]|0,c[g>>2]|0);n=(c[f>>2]|0)+440|0;e=k+0|0;m=n+96|0;do{a[n>>0]=a[e>>0]|0;n=n+1|0;e=e+1|0}while((n|0)<(m|0));b=(c[f>>2]|0)+18|0;a[b>>0]=(a[b>>0]|0)+ -1<<24>>24;i=l;return}function dp(b){b=b|0;var d=0,f=0,g=0;d=i;i=i+16|0;g=d+4|0;f=d;c[g>>2]=b;c[f>>2]=c[(c[g>>2]|0)+8>>2];if(!(c[f>>2]|0)){b=Ue(c[g>>2]|0)|0;c[(c[g>>2]|0)+8>>2]=b;c[f>>2]=b;if(c[f>>2]|0)mp(c[f>>2]|0,153)|0;if((c[(c[g>>2]|0)+408>>2]|0)==0?((e[(c[c[g>>2]>>2]|0)+60>>1]|0)&8|0)==0:0)a[(c[g>>2]|0)+23>>0]=1}i=d;return c[f>>2]|0}function ep(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;i=i+32|0;f=d+16|0;g=d+12|0;e=d+8|0;j=d+4|0;h=d;c[f>>2]=a;c[g>>2]=b;c[e>>2]=kp(c[f>>2]|0)|0;c[j>>2]=c[c[f>>2]>>2];c[h>>2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(c[f>>2]|0)+84>>2]=a;c[(c[g>>2]|0)+4>>2]=c[d>>2];a=c[d>>2]|0;a=(a|0)!=0;a=a?0:7;i=e;return a|0}function kp(b){b=b|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;f=e+4|0;g=e;c[g>>2]=b;b=c[g>>2]|0;if(!(d[(c[g>>2]|0)+19>>0]|0)){g=b+72|0;b=(c[g>>2]|0)+1|0;c[g>>2]=b;c[f>>2]=b;b=c[f>>2]|0;i=e;return b|0}else{h=b+19|0;b=(a[h>>0]|0)+ -1<<24>>24;a[h>>0]=b;c[f>>2]=c[(c[g>>2]|0)+24+((b&255)<<2)>>2];b=c[f>>2]|0;i=e;return b|0}return 0}function lp(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;j=f+12|0;h=f+8|0;k=f+4|0;g=f;c[j>>2]=b;c[h>>2]=e;if(!(c[h>>2]|0)){i=f;return}if((d[(c[j>>2]|0)+19>>0]|0|0)>=8){i=f;return}c[k>>2]=0;c[g>>2]=(c[j>>2]|0)+116;while(1){if((c[k>>2]|0)>=10){e=8;break}if((c[(c[g>>2]|0)+12>>2]|0)==(c[h>>2]|0)){e=6;break}c[k>>2]=(c[k>>2]|0)+1;c[g>>2]=(c[g>>2]|0)+20}if((e|0)==6){a[(c[g>>2]|0)+6>>0]=1;i=f;return}else if((e|0)==8){k=c[h>>2]|0;e=(c[j>>2]|0)+19|0;b=a[e>>0]|0;a[e>>0]=b+1<<24>>24;c[(c[j>>2]|0)+24+((b&255)<<2)>>2]=k;i=f;return}}function mp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;a=ip(c[f>>2]|0,c[e>>2]|0,0,0,0)|0;i=d;return a|0}function np(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+32|0;j=e+16|0;h=e+12|0;g=e+8|0;f=e+4|0;k=e;c[j>>2]=a;c[h>>2]=b;c[g>>2]=d;if(c[c[g>>2]>>2]|0){c[k>>2]=Ve(c[c[j>>2]>>2]|0,c[c[g>>2]>>2]|0)|0;c[f>>2]=c[(c[(c[c[j>>2]>>2]|0)+16>>2]|0)+(c[k>>2]<<4)>>2]}else c[f>>2]=c[(c[g>>2]|0)+4>>2];a=Re(c[j>>2]|0,c[h>>2]|0,c[(c[g>>2]|0)+8>>2]|0,c[f>>2]|0)|0;i=e;return a|0}function op(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;h=i;i=i+16|0;f=h;g=h+12|0;d=h+8|0;e=h+4|0;c[d>>2]=a;c[e>>2]=b;if((Mb(c[e>>2]|0)|0)>6?0==(Lb(c[e>>2]|0,15144,7)|0):0){a=c[d>>2]|0;c[f>>2]=c[e>>2];Se(a,15152,f);c[g>>2]=1;a=c[g>>2]|0;i=h;return a|0}c[g>>2]=0;a=c[g>>2]|0;i=h;return a|0}function pp(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0;g=i;i=i+16|0;l=g+12|0;h=g+8|0;k=g+4|0;j=g;c[l>>2]=b;c[h>>2]=e;c[k>>2]=f;f=c[l>>2]|0;if(c[(c[l>>2]|0)+408>>2]|0)f=c[f+408>>2]|0;c[j>>2]=f;qp(c[l>>2]|0,c[k>>2]|0);b=(c[j>>2]|0)+328|0;c[b>>2]=c[b>>2]|1<<c[k>>2];b=(c[j>>2]|0)+20|0;a[b>>0]=d[b>>0]|0|c[h>>2];i=g;return}function qp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;h=d+12|0;f=d+8|0;e=d+4|0;g=d;c[h>>2]=a;c[f>>2]=b;b=c[h>>2]|0;if(c[(c[h>>2]|0)+408>>2]|0)b=c[b+408>>2]|0;c[e>>2]=b;c[g>>2]=c[c[e>>2]>>2];if((c[(c[e>>2]|0)+332>>2]&1<<c[f>>2]|0)!=0|0){i=d;return}h=(c[e>>2]|0)+332|0;c[h>>2]=c[h>>2]|1<<c[f>>2];c[(c[e>>2]|0)+336+(c[f>>2]<<2)>>2]=c[c[(c[(c[g>>2]|0)+16>>2]|0)+(c[f>>2]<<4)+12>>2]>>2];if((c[f>>2]|0)!=1){i=d;return}rp(c[e>>2]|0)|0;i=d;return}function rp(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0;d=i;i=i+32|0;h=d;e=d+20|0;f=d+16|0;j=d+12|0;g=d+8|0;k=d+4|0;c[f>>2]=b;c[j>>2]=c[c[f>>2]>>2];if((c[(c[(c[j>>2]|0)+16>>2]|0)+20>>2]|0)==0?(a[(c[f>>2]|0)+450>>0]|0)==0:0){c[g>>2]=rh(c[c[j>>2]>>2]|0,0,c[j>>2]|0,k,0,542)|0;if(c[g>>2]|0){Se(c[f>>2]|0,15072,h);c[(c[f>>2]|0)+12>>2]=c[g>>2];c[e>>2]=1;k=c[e>>2]|0;i=d;return k|0}c[(c[(c[j>>2]|0)+16>>2]|0)+20>>2]=c[k>>2];if(7==(kg(c[k>>2]|0,c[(c[j>>2]|0)+72>>2]|0,-1,0)|0)){a[(c[j>>2]|0)+64>>0]=1;c[e>>2]=1;k=c[e>>2]|0;i=d;return k|0}}c[e>>2]=0;k=c[e>>2]|0;i=d;return k|0}function sp(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;k=i;i=i+32|0;h=k+20|0;e=k+16|0;l=k+12|0;g=k+8|0;m=k+4|0;j=k;c[h>>2]=a;c[e>>2]=b;c[l>>2]=d;c[g>>2]=0;c[m>>2]=0;while(1){if((c[m>>2]|0)>=(c[(c[h>>2]|0)+20>>2]|0)){f=7;break}a=c[m>>2]|0;c[j>>2]=(c[m>>2]|0)<2?a^1:a;if(!((c[l>>2]|0)!=0?(xc(c[l>>2]|0,c[(c[(c[h>>2]|0)+16>>2]|0)+(c[j>>2]<<4)>>2]|0)|0)!=0:0))f=5;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k+28|0;e=k+24|0;f=k+20|0;m=k+16|0;g=k+12|0;n=k+8|0;o=k+4|0;c[j>>2]=a;c[h>>2]=b;c[e>>2]=d;c[f>>2]=dp(c[j>>2]|0)|0;if(!(c[f>>2]|0)){i=k;return}c[g>>2]=Ve(c[c[j>>2]>>2]|0,c[(c[h>>2]|0)+68>>2]|0)|0;c[n>>2]=wp(c[j>>2]|0,c[h>>2]|0)|0;while(1){if(!(c[n>>2]|0))break;c[o>>2]=Ve(c[c[j>>2]>>2]|0,c[(c[n>>2]|0)+20>>2]|0)|0;hp(c[f>>2]|0,126,c[o>>2]|0,0,0,c[c[n>>2]>>2]|0,0)|0;c[n>>2]=c[(c[n>>2]|0)+32>>2]}hp(c[f>>2]|0,124,c[g>>2]|0,0,0,c[c[h>>2]>>2]|0,0)|0;a=c[c[j>>2]>>2]|0;c[l>>2]=c[e>>2];c[m>>2]=Te(a,15528,l)|0;if(!(c[m>>2]|0)){i=k;return}gp(c[f>>2]|0,c[g>>2]|0,c[m>>2]|0);a=xp(c[j>>2]|0,c[h>>2]|0)|0;c[m>>2]=a;if(!a){i=k;return}gp(c[f>>2]|0,1,c[m>>2]|0);i=k;return}function wp(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+32|0;e=f+24|0;m=f+20|0;k=f+16|0;l=f+12|0;h=f+8|0;j=f+4|0;g=f;c[m>>2]=b;c[k>>2]=d;c[l>>2]=c[(c[(c[c[m>>2]>>2]|0)+16>>2]|0)+28>>2];c[h>>2]=0;if(a[(c[m>>2]|0)+438>>0]|0){c[e>>2]=0;m=c[e>>2]|0;i=f;return m|0}a:do if((c[l>>2]|0)!=(c[(c[k>>2]|0)+68>>2]|0)){c[j>>2]=c[(c[l>>2]|0)+48>>2];while(1){if(!(c[j>>2]|0))break a;c[g>>2]=c[(c[j>>2]|0)+8>>2];if((c[(c[g>>2]|0)+24>>2]|0)==(c[(c[k>>2]|0)+68>>2]|0)?0==(xc(c[(c[g>>2]|0)+4>>2]|0,c[c[k>>2]>>2]|0)|0):0){if(c[h>>2]|0)d=c[h>>2]|0;else d=c[(c[k>>2]|0)+64>>2]|0;c[(c[g>>2]|0)+32>>2]=d;c[h>>2]=c[g>>2]}c[j>>2]=c[c[j>>2]>>2]}}while(0);if(c[h>>2]|0)g=c[h>>2]|0;else g=c[(c[k>>2]|0)+64>>2]|0;c[e>>2]=g;m=c[e>>2]|0;i=f;return m|0}function xp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;e=i;i=i+32|0;g=e;f=e+28|0;m=e+24|0;k=e+20|0;h=e+16|0;l=e+12|0;j=e+8|0;d=e+4|0;c[f>>2]=a;c[m>>2]=b;c[h>>2]=0;c[l>>2]=c[(c[(c[c[f>>2]>>2]|0)+16>>2]|0)+28>>2];a:do if((c[(c[m>>2]|0)+68>>2]|0)!=(c[l>>2]|0)){c[j>>2]=c[c[f>>2]>>2];c[k>>2]=wp(c[f>>2]|0,c[m>>2]|0)|0;while(1){if(!(c[k>>2]|0))break a;if((c[(c[k>>2]|0)+20>>2]|0)==(c[l>>2]|0))c[h>>2]=yp(c[j>>2]|0,c[h>>2]|0,c[c[k>>2]>>2]|0)|0;c[k>>2]=c[(c[k>>2]|0)+32>>2]}}while(0);if(!(c[h>>2]|0)){a=c[h>>2]|0;i=e;return a|0}a=c[c[f>>2]>>2]|0;c[g>>2]=c[h>>2];c[d>>2]=Te(a,15544,g)|0;Xb(c[c[f>>2]>>2]|0,c[h>>2]|0);c[h>>2]=c[d>>2];a=c[h>>2]|0;i=e;return a|0}function yp(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+32|0;j=e;h=e+20|0;g=e+16|0;k=e+12|0;f=e+8|0;c[h>>2]=a;c[g>>2]=b;c[k>>2]=d;d=c[h>>2]|0;if(c[g>>2]|0){a=c[k>>2]|0;c[j>>2]=c[g>>2];c[j+4>>2]=a;c[f>>2]=Te(d,15576,j)|0;Xb(c[h>>2]|0,c[g>>2]|0);a=c[f>>2]|0;i=e;return a|0}else{c[j>>2]=c[k>>2];c[f>>2]=Te(d,15568,j)|0;a=c[f>>2]|0;i=e;return a|0}return 0}function zp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;$e(c[e>>2]|0,c[f>>2]|0,c[(c[e>>2]|0)+32>>2]|0);c[(c[(c[e>>2]|0)+24>>2]|0)+88>>2]=(c[(c[e>>2]|0)+32>>2]|0)-1;i=d;return}function Ap(f,g,j,k,l,m){f=f|0;g=g|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0;r=i;i=i+64|0;C=r;n=r+52|0;u=r+48|0;y=r+44|0;t=r+58|0;s=r+57|0;o=r+40|0;x=r+36|0;z=r+32|0;v=r+28|0;q=r+24|0;w=r+20|0;B=r+16|0;p=r+12|0;A=r+56|0;E=r+8|0;c[u>>2]=f;c[y>>2]=g;a[t>>0]=j;a[s>>0]=k;c[o>>2]=l;c[x>>2]=m;c[v>>2]=0;c[q>>2]=0;c[w>>2]=1;c[B>>2]=1216;c[p>>2]=0;if(!(c[y>>2]|0)){c[c[o>>2]>>2]=0;c[n>>2]=0;f=c[n>>2]|0;i=r;return f|0}while(1){f=d[c[y>>2]>>0]|0;c[z>>2]=f;if((f|0)!=158)break;c[y>>2]=c[(c[y>>2]|0)+12>>2]}if((c[z>>2]|0)==159)c[z>>2]=d[(c[y>>2]|0)+38>>0];if((c[z>>2]|0)==38){a[A>>0]=Bp(c[(c[y>>2]|0)+8>>2]|0,0)|0;c[p>>2]=Ap(c[u>>2]|0,c[(c[y>>2]|0)+12>>2]|0,a[t>>0]|0,a[A>>0]|0,c[o>>2]|0,c[x>>2]|0)|0;if(c[c[o>>2]>>2]|0){Cp(c[c[o>>2]>>2]|0,a[A>>0]|0,1);Dp(c[c[o>>2]>>2]|0,a[s>>0]|0,1)}c[n>>2]=c[p>>2];f=c[n>>2]|0;i=r;return f|0}do if((c[z>>2]|0)==157){if((d[c[(c[y>>2]|0)+12>>2]>>0]|0|0)!=132?(d[c[(c[y>>2]|0)+12>>2]>>0]|0|0)!=133:0)break;c[y>>2]=c[(c[y>>2]|0)+12>>2];c[z>>2]=d[c[y>>2]>>0];c[w>>2]=-1;c[B>>2]=15592}while(0);do if((c[z>>2]|0)==97|(c[z>>2]|0)==133|(c[z>>2]|0)==132){c[q>>2]=Ep(c[u>>2]|0,c[x>>2]|0)|0;if(c[q>>2]|0){if(c[(c[y>>2]|0)+4>>2]&1024){g=c[q>>2]|0;j=c[(c[y>>2]|0)+8>>2]|0;f=c[w>>2]|0;f=lF(j|0,((j|0)<0)<<31>>31|0,f|0,((f|0)<0)<<31>>31|0)|0;Xd(g,f,D)}else{f=c[u>>2]|0;g=c[(c[y>>2]|0)+8>>2]|0;c[C>>2]=c[B>>2];c[C+4>>2]=g;c[v>>2]=Te(f,8992,C)|0;if(!(c[v>>2]|0)){s=43;break}sf(c[q>>2]|0,-1,c[v>>2]|0,1,16)}if((c[z>>2]|0)==132|(c[z>>2]|0)==133?(d[s>>0]|0|0)==65:0)Dp(c[q>>2]|0,67,1);else Dp(c[q>>2]|0,a[s>>0]|0,1);if((e[(c[q>>2]|0)+8>>1]|0)&12){f=(c[q>>2]|0)+8|0;b[f>>1]=(e[f>>1]|0)&-3}if((d[t>>0]|0|0)!=1){c[p>>2]=yk(c[q>>2]|0,d[t>>0]|0)|0;s=42}else s=42}else s=43}else{if((c[z>>2]|0)!=157){if((c[z>>2]|0)==101){c[q>>2]=Ep(c[u>>2]|0,c[x>>2]|0)|0;if(!(c[q>>2]|0)){s=43;break}else{s=42;break}}if((c[z>>2]|0)!=134){s=42;break}c[q>>2]=Ep(c[u>>2]|0,c[x>>2]|0)|0;if(!(c[q>>2]|0)){s=43;break}c[v>>2]=(c[(c[y>>2]|0)+8>>2]|0)+2;c[E>>2]=(Mb(c[v>>2]|0)|0)-1;f=c[q>>2]|0;s=Gp(c[u>>2]|0,c[v>>2]|0,c[E>>2]|0)|0;Vd(f,s,(c[E>>2]|0)/2|0,0,16)|0;s=42;break}f=0==(tp(c[u>>2]|0,c[(c[y>>2]|0)+12>>2]|0,a[t>>0]|0,a[s>>0]|0,q)|0);if(f&(c[q>>2]|0)!=0){Fp(c[q>>2]|0)|0;u=c[q>>2]|0;do if(!((e[(c[q>>2]|0)+8>>1]|0)&8)){f=u;u=c[q>>2]|0;if((c[f>>2]|0)==0?(c[f+4>>2]|0)==-2147483648:0){h[u>>3]=9223372036854776000.0;b[(c[q>>2]|0)+8>>1]=(e[(c[q>>2]|0)+8>>1]|0)&-16896|8;break}else{g=u;g=ZE(0,0,c[g>>2]|0,c[g+4>>2]|0)|0;f=c[q>>2]|0;c[f>>2]=g;c[f+4>>2]=D;break}}else h[c[q>>2]>>3]=-+h[u>>3];while(0);Dp(c[q>>2]|0,a[s>>0]|0,a[t>>0]|0);s=42}else s=42}while(0);if((s|0)==42){c[c[o>>2]>>2]=c[q>>2];c[n>>2]=c[p>>2];f=c[n>>2]|0;i=r;return f|0}else if((s|0)==43){a[(c[u>>2]|0)+64>>0]=1;Xb(c[u>>2]|0,c[v>>2]|0);tf(c[q>>2]|0);c[n>>2]=7;f=c[n>>2]|0;i=r;return f|0}return 0}function Bp(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;l=i;i=i+32|0;h=l+21|0;o=l+16|0;k=l+12|0;n=l+8|0;j=l+20|0;m=l+4|0;f=l;c[o>>2]=b;c[k>>2]=e;c[n>>2]=0;a[j>>0]=67;c[m>>2]=0;if(!(c[o>>2]|0)){a[h>>0]=a[j>>0]|0;b=a[h>>0]|0;i=l;return b|0}a:while(1){if(!(a[c[o>>2]>>0]|0))break;c[n>>2]=(c[n>>2]<<8)+(d[440+(a[c[o>>2]>>0]&255)>>0]|0);c[o>>2]=(c[o>>2]|0)+1;if((c[n>>2]|0)==1667785074){a[j>>0]=66;c[m>>2]=c[o>>2];continue}if((c[n>>2]|0)==1668050786){a[j>>0]=66;continue}if((c[n>>2]|0)==1952807028){a[j>>0]=66;continue}do if((c[n>>2]|0)==1651273570){if((a[j>>0]|0)!=67?(a[j>>0]|0)!=69:0)break;a[j>>0]=65;if((a[c[o>>2]>>0]|0)!=40)continue a;c[m>>2]=c[o>>2];continue a}while(0);if((c[n>>2]|0)==1919246700?(a[j>>0]|0)==67:0){a[j>>0]=69;continue}if((c[n>>2]|0)==1718382433?(a[j>>0]|0)==67:0){a[j>>0]=69;continue}if((c[n>>2]|0)==1685026146?(a[j>>0]|0)==67:0){a[j>>0]=69;continue}if((c[n>>2]&16777215|0)==6909556){g=25;break}}if((g|0)==25)a[j>>0]=68;b:do if((c[k>>2]|0)!=0?(a[c[k>>2]>>0]=1,(a[j>>0]|0)<67):0){if(!(c[m>>2]|0)){a[c[k>>2]>>0]=5;break}while(1){if(!(a[c[m>>2]>>0]|0))break b;if(d[1224+(d[c[m>>2]>>0]|0)>>0]&4)break;c[m>>2]=(c[m>>2]|0)+1}c[f>>2]=0;Ag(c[m>>2]|0,f)|0;b=((c[f>>2]|0)/4|0)+1|0;c[f>>2]=b;c[f>>2]=(c[f>>2]|0)>255?255:b;a[c[k>>2]>>0]=c[f>>2]}while(0);a[h>>0]=a[j>>0]|0;b=a[h>>0]|0;i=l;return b|0}function Cp(f,g,h){f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0;j=i;i=i+16|0;l=j;m=j+5|0;k=j+4|0;c[l>>2]=f;a[m>>0]=g;a[k>>0]=h;if((e[(c[l>>2]|0)+8>>1]|0)&1){i=j;return}h=d[m>>0]|0;if((h|0)==65){h=c[l>>2]|0;if(!((e[(c[l>>2]|0)+8>>1]|0)&16)){Dp(h,66,a[k>>0]|0);b[(c[l>>2]|0)+8>>1]=(e[(c[l>>2]|0)+8>>1]|0)&-16896|16;i=j;return}else{f=h+8|0;b[f>>1]=(e[f>>1]|0)&-496;i=j;return}}else if((h|0)==67){Fp(c[l>>2]|0)|0;i=j;return}else if((h|0)==68){Mp(c[l>>2]|0)|0;i=j;return}else if((h|0)==69){Np(c[l>>2]|0)|0;i=j;return}else{f=(c[l>>2]|0)+8|0;b[f>>1]=e[f>>1]|0|((e[(c[l>>2]|0)+8>>1]|0)&16)>>3;Dp(c[l>>2]|0,66,a[k>>0]|0);f=(c[l>>2]|0)+8|0;b[f>>1]=(e[f>>1]|0)&-16413;i=j;return}}function Dp(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0;f=i;i=i+16|0;j=f;h=f+5|0;g=f+4|0;c[j>>2]=b;a[h>>0]=d;a[g>>0]=e;Jp(c[j>>2]|0,a[h>>0]|0,a[g>>0]|0);i=f;return}function Ep(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;i=i+16|0;e=d+4|0;c[e>>2]=a;c[d>>2]=b;a=rf(c[e>>2]|0)|0;i=d;return a|0}function Fp(d){d=d|0;var f=0,g=0,j=0,k=0.0;f=i;i=i+16|0;g=f;c[g>>2]=d;do if(!((e[(c[g>>2]|0)+8>>1]|0)&13)){j=0==(wg(c[(c[g>>2]|0)+16>>2]|0,c[g>>2]|0,c[(c[g>>2]|0)+12>>2]|0,a[(c[g>>2]|0)+10>>0]|0)|0);d=c[g>>2]|0;if(j){b[(c[g>>2]|0)+8>>1]=(e[d+8>>1]|0)&-16896|4;break}else{k=+Id(d);h[c[g>>2]>>3]=k;b[(c[g>>2]|0)+8>>1]=(e[(c[g>>2]|0)+8>>1]|0)&-16896|8;Hp(c[g>>2]|0);break}}while(0);j=(c[g>>2]|0)+8|0;b[j>>1]=(e[j>>1]|0)&-19;i=f;return 0}function Gp(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+32|0;l=f+16|0;k=f+12|0;j=f+8|0;g=f+4|0;h=f;c[l>>2]=b;c[k>>2]=d;c[j>>2]=e;b=((c[j>>2]|0)/2|0)+1|0;c[g>>2]=Qe(c[l>>2]|0,b,((b|0)<0)<<31>>31)|0;c[j>>2]=(c[j>>2]|0)+ -1;if(!(c[g>>2]|0)){l=c[g>>2]|0;i=f;return l|0}c[h>>2]=0;while(1){e=c[h>>2]|0;if((c[h>>2]|0)>=(c[j>>2]|0))break;l=((vg(a[(c[k>>2]|0)+e>>0]|0)|0)&255)<<4;l=(l|(vg(a[(c[k>>2]|0)+((c[h>>2]|0)+1)>>0]|0)|0)&255)&255;a[(c[g>>2]|0)+((c[h>>2]|0)/2|0)>>0]=l;c[h>>2]=(c[h>>2]|0)+2}a[(c[g>>2]|0)+((e|0)/2|0)>>0]=0;l=c[g>>2]|0;i=f;return l|0}function Hp(a){a=a|0;var d=0,f=0,g=0,j=0,k=0,l=0,m=0;d=i;i=i+16|0;g=d+8|0;f=d;c[g>>2]=a;k=Ip(+h[c[g>>2]>>3])|0;m=f;c[m>>2]=k;c[m+4>>2]=D;m=f;k=f;l=c[k+4>>2]|0;a=f;j=c[a+4>>2]|0;if(!(+h[c[g>>2]>>3]==+((c[m>>2]|0)>>>0)+4294967296.0*+(c[m+4>>2]|0)&((l|0)>-2147483648|(l|0)==-2147483648&(c[k>>2]|0)>>>0>0)&((j|0)<2147483647|(j|0)==2147483647&(c[a>>2]|0)>>>0<4294967295))){i=d;return}k=f;l=c[k+4>>2]|0;m=c[g>>2]|0;c[m>>2]=c[k>>2];c[m+4>>2]=l;b[(c[g>>2]|0)+8>>1]=(e[(c[g>>2]|0)+8>>1]|0)&-16896|4;i=d;return}function Ip(a){a=+a;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;d=b+8|0;e=b;h[e>>3]=a;do if(!(+h[e>>3]<=-9223372036854776000.0))if(+h[e>>3]>=9223372036854776000.0){e=d;c[e>>2]=-1;c[e+4>>2]=2147483647;break}else{a=+h[e>>3];f=+O(a)>=1.0?a>0.0?(ca(+N(a/4294967296.0),4294967295.0)|0)>>>0:~~+_((a- +(~~a>>>0))/4294967296.0)>>>0:0;e=d;c[e>>2]=~~a>>>0;c[e+4>>2]=f;break}else{f=d;c[f>>2]=0;c[f+4>>2]=-2147483648}while(0);f=d;D=c[f+4>>2]|0;i=b;return c[f>>2]|0}function Jp(b,d,f){b=b|0;d=d|0;f=f|0;var g=0,h=0,j=0,k=0;g=i;i=i+16|0;h=g;k=g+5|0;j=g+4|0;c[h>>2]=b;a[k>>0]=d;a[j>>0]=f;if((a[k>>0]|0)<67){if((a[k>>0]|0)!=66){i=g;return}if(e[(c[h>>2]|0)+8>>1]&2){i=g;return}if(!(e[(c[h>>2]|0)+8>>1]&12)){i=g;return}Kp(c[h>>2]|0,a[j>>0]|0,1)|0;i=g;return}if(e[(c[h>>2]|0)+8>>1]&4){i=g;return}f=c[h>>2]|0;if(e[(c[h>>2]|0)+8>>1]&8){Hp(f);i=g;return}if(!(e[f+8>>1]&2)){i=g;return}Pe(c[h>>2]|0,1);i=g;return}function Kp(f,g,j){f=f|0;g=g|0;j=j|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0;q=i;i=i+32|0;l=q;m=q+20|0;n=q+16|0;o=q+25|0;p=q+24|0;r=q+12|0;c[n>>2]=f;a[o>>0]=g;a[p>>0]=j;c[r>>2]=e[(c[n>>2]|0)+8>>1];c[q+8>>2]=32;if(Lp(c[n>>2]|0,32)|0){c[m>>2]=7;f=c[m>>2]|0;i=q;return f|0}j=c[(c[n>>2]|0)+16>>2]|0;g=c[n>>2]|0;if(c[r>>2]&4){r=g;g=c[r+4>>2]|0;f=l;c[f>>2]=c[r>>2];c[f+4>>2]=g;sc(32,j,9456,l)|0}else{h[k>>3]=+h[g>>3];c[l>>2]=c[k>>2];c[l+4>>2]=c[k+4>>2];sc(32,j,9808,l)|0}f=Mb(c[(c[n>>2]|0)+16>>2]|0)|0;c[(c[n>>2]|0)+12>>2]=f;a[(c[n>>2]|0)+10>>0]=1;f=(c[n>>2]|0)+8|0;b[f>>1]=e[f>>1]|514;if(a[p>>0]|0){f=(c[n>>2]|0)+8|0;b[f>>1]=e[f>>1]&-13}yk(c[n>>2]|0,d[o>>0]|0)|0;c[m>>2]=0;f=c[m>>2]|0;i=q;return f|0}function Lp(a,d){a=a|0;d=d|0;var f=0,g=0,h=0,j=0;f=i;i=i+16|0;g=f+8|0;j=f+4|0;h=f;c[j>>2]=a;c[h>>2]=d;d=c[j>>2]|0;if((c[(c[j>>2]|0)+24>>2]|0)<(c[h>>2]|0)){c[g>>2]=Dk(d,c[h>>2]|0,0)|0;a=c[g>>2]|0;i=f;return a|0}else{c[(c[j>>2]|0)+16>>2]=c[d+20>>2];a=(c[j>>2]|0)+8|0;b[a>>1]=(e[a>>1]|0)&13;c[g>>2]=0;a=c[g>>2]|0;i=f;return a|0}return 0}function Mp(a){a=a|0;var d=0,f=0,g=0;d=i;i=i+16|0;f=d;c[f>>2]=a;g=Kd(c[f>>2]|0)|0;a=c[f>>2]|0;c[a>>2]=g;c[a+4>>2]=D;b[(c[f>>2]|0)+8>>1]=(e[(c[f>>2]|0)+8>>1]|0)&-16896|4;i=d;return 0}function Np(a){a=a|0;var d=0,f=0,g=0.0;d=i;i=i+16|0;f=d;c[f>>2]=a;g=+Id(c[f>>2]|0);h[c[f>>2]>>3]=g;b[(c[f>>2]|0)+8>>1]=(e[(c[f>>2]|0)+8>>1]|0)&-16896|8;i=d;return 0}function Op(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;l=i;i=i+32|0;e=l+24|0;j=l+20|0;k=l+16|0;g=l+12|0;n=l+8|0;m=l+4|0;h=l;c[e>>2]=a;c[j>>2]=b;c[k>>2]=d;c[g>>2]=0;c[n>>2]=0;while(1){if((c[n>>2]|0)>=(c[(c[e>>2]|0)+20>>2]|0)){f=7;break}a=c[n>>2]|0;c[m>>2]=(c[n>>2]|0)<2?a^1:a;c[h>>2]=c[(c[(c[e>>2]|0)+16>>2]|0)+(c[m>>2]<<4)+12>>2];if(!((c[k>>2]|0)!=0?(xc(c[k>>2]|0,c[(c[(c[e>>2]|0)+16>>2]|0)+(c[m>>2]<<4)>>2]|0)|0)!=0:0))f=5;if((f|0)==5?(f=0,c[g>>2]=bh((c[h>>2]|0)+24|0,c[j>>2]|0)|0,(c[g>>2]|0)!=0):0){f=7;break}c[n>>2]=(c[n>>2]|0)+1}if((f|0)==7){i=l;return c[g>>2]|0}return 0}function Pp(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;k=i;i=i+16|0;h=k;j=k+12|0;f=k+8|0;g=k+4|0;c[f>>2]=b;c[g>>2]=e;if((((a[(c[c[f>>2]>>2]|0)+145>>0]|0)==0?(d[(c[f>>2]|0)+18>>0]|0)==0:0)?(c[(c[c[f>>2]>>2]|0)+24>>2]&2048|0)==0:0)?0==(Lb(c[g>>2]|0,15144,7)|0):0){b=c[f>>2]|0;c[h>>2]=c[g>>2];Se(b,18064,h);c[j>>2]=1;b=c[j>>2]|0;i=k;return b|0}c[j>>2]=0;b=c[j>>2]|0;i=k;return b|0}function Qp(f,g){f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;o=i;i=i+48|0;m=o;j=o+36|0;k=o+32|0;l=o+28|0;s=o+24|0;q=o+20|0;t=o+16|0;p=o+12|0;n=o+8|0;r=o+4|0;h=o+40|0;c[k>>2]=f;c[l>>2]=g;c[t>>2]=0;c[n>>2]=c[c[k>>2]>>2];if(Vp(c[k>>2]|0,c[l>>2]|0)|0){c[j>>2]=1;f=c[j>>2]|0;i=o;return f|0}if(d[(c[l>>2]|0)+44>>0]&16){c[j>>2]=0;f=c[j>>2]|0;i=o;return f|0}if((b[(c[l>>2]|0)+38>>1]|0)>0){c[j>>2]=0;f=c[j>>2]|0;i=o;return f|0}if((b[(c[l>>2]|0)+38>>1]|0)<0){f=c[k>>2]|0;c[m>>2]=c[c[l>>2]>>2];Se(f,16328,m);c[j>>2]=1;f=c[j>>2]|0;i=o;return f|0}c[q>>2]=Wp(c[n>>2]|0,c[(c[l>>2]|0)+12>>2]|0,0)|0;if(c[q>>2]|0){a[h>>0]=a[(c[n>>2]|0)+250>>0]|0;c[p>>2]=c[(c[k>>2]|0)+68>>2];Xp(c[k>>2]|0,c[(c[q>>2]|0)+32>>2]|0);b[(c[l>>2]|0)+38>>1]=-1;a[(c[n>>2]|0)+250>>0]=0;c[r>>2]=c[(c[n>>2]|0)+284>>2];c[(c[n>>2]|0)+284>>2]=0;c[s>>2]=Yp(c[k>>2]|0,c[q>>2]|0)|0;c[(c[n>>2]|0)+284>>2]=c[r>>2];a[(c[n>>2]|0)+250>>0]=a[h>>0]|0;c[(c[k>>2]|0)+68>>2]=c[p>>2];if(c[s>>2]|0){b[(c[l>>2]|0)+38>>1]=b[(c[s>>2]|0)+38>>1]|0;c[(c[l>>2]|0)+4>>2]=c[(c[s>>2]|0)+4>>2];b[(c[s>>2]|0)+38>>1]=0;c[(c[s>>2]|0)+4>>2]=0;Vb(c[n>>2]|0,c[s>>2]|0);f=(c[(c[l>>2]|0)+68>>2]|0)+78|0;b[f>>1]=e[f>>1]|2}else{b[(c[l>>2]|0)+38>>1]=0;c[t>>2]=(c[t>>2]|0)+1}tn(c[n>>2]|0,c[q>>2]|0)}else c[t>>2]=(c[t>>2]|0)+1;c[j>>2]=c[t>>2];f=c[j>>2]|0;i=o;return f|0}function Rp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;f=d+8|0;g=d+4|0;e=d;c[f>>2]=a;c[g>>2]=b;c[e>>2]=c[(c[g>>2]|0)+60>>2];while(1){if(!(c[e>>2]|0)){b=5;break}if((c[c[e>>2]>>2]|0)==(c[f>>2]|0)){b=5;break}c[e>>2]=c[(c[e>>2]|0)+24>>2]}if((b|0)==5){i=d;return c[e>>2]|0}return 0}function Sp(b){b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=b;b=c[f>>2]|0;if(c[(c[f>>2]|0)+408>>2]|0)b=c[b+408>>2]|0;c[e>>2]=b;a[(c[e>>2]|0)+21>>0]=1;i=d;return}function Tp(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;g=d+12|0;h=d+8|0;f=d+4|0;e=d;c[g>>2]=a;c[h>>2]=b;c[e>>2]=0;c[f>>2]=Up(c[h>>2]|0)|0;while(1){if(!(c[f>>2]|0))break;c[e>>2]=yp(c[c[g>>2]>>2]|0,c[e>>2]|0,c[c[c[f>>2]>>2]>>2]|0)|0;c[f>>2]=c[(c[f>>2]|0)+12>>2]}i=d;return c[e>>2]|0}function Up(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=bh((c[(c[d>>2]|0)+68>>2]|0)+56|0,c[c[d>>2]>>2]|0)|0;i=b;return a|0}function Vp(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;p=i;i=i+48|0;m=p;o=p+36|0;l=p+32|0;g=p+28|0;f=p+24|0;n=p+20|0;h=p+16|0;j=p+12|0;e=p+8|0;k=p+4|0;c[l>>2]=a;c[g>>2]=b;c[f>>2]=c[c[l>>2]>>2];if(((d[(c[g>>2]|0)+44>>0]|0)&16|0)!=0?(Rp(c[f>>2]|0,c[g>>2]|0)|0)==0:0){c[n>>2]=c[c[(c[g>>2]|0)+56>>2]>>2];c[h>>2]=bh((c[f>>2]|0)+308|0,c[n>>2]|0)|0;if(c[h>>2]|0){c[k>>2]=0;c[j>>2]=zr(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0,c[(c[c[h>>2]>>2]|0)+8>>2]|0,k)|0;if(c[j>>2]|0){a=c[l>>2]|0;c[m>>2]=c[k>>2];Se(a,1200,m)}Xb(c[f>>2]|0,c[k>>2]|0)}else{c[e>>2]=c[c[(c[g>>2]|0)+56>>2]>>2];a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d=(c[l>>2]|0)+24|0;c[d>>2]=c[d>>2]&-33;d=(c[l>>2]|0)+24|0;c[d>>2]=c[d>>2]|64;Zp(c[j>>2]|0,c[k>>2]|0,0);if(c[(c[j>>2]|0)+64>>2]|0){c[g>>2]=0;d=c[g>>2]|0;i=f;return d|0}while(1){if(!(c[(c[k>>2]|0)+52>>2]|0))break;c[k>>2]=c[(c[k>>2]|0)+52>>2]}c[(c[l>>2]|0)+24>>2]=c[m>>2];c[h>>2]=se(c[l>>2]|0,76,0)|0;if(!(c[h>>2]|0)){c[g>>2]=0;d=c[g>>2]|0;i=f;return d|0}b[(c[h>>2]|0)+40>>1]=1;c[c[h>>2]>>2]=0;b[(c[h>>2]|0)+28>>1]=200;_p(c[j>>2]|0,c[c[k>>2]>>2]|0,(c[h>>2]|0)+38|0,(c[h>>2]|0)+4|0)|0;$p(c[j>>2]|0,c[h>>2]|0,c[k>>2]|0);b[(c[h>>2]|0)+36>>1]=-1;if(a[(c[l>>2]|0)+64>>0]|0){Vb(c[l>>2]|0,c[h>>2]|0);c[g>>2]=0;d=c[g>>2]|0;i=f;return d|0}else{c[g>>2]=c[h>>2];d=c[g>>2]|0;i=f;return d|0}return 0}function Zp(b,f,g){b=b|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0;h=i;i=i+16|0;j=h+12|0;k=h+8|0;l=h+4|0;m=h;c[j>>2]=b;c[k>>2]=f;c[l>>2]=g;if(!(c[k>>2]|0)){i=h;return}c[m>>2]=c[c[j>>2]>>2];if(a[(c[m>>2]|0)+64>>0]|0){i=h;return}if(e[(c[k>>2]|0)+6>>1]&32){i=h;return}jq(c[j>>2]|0,c[k>>2]|0);if(c[(c[j>>2]|0)+64>>2]|0){i=h;return}if(d[(c[m>>2]|0)+64>>0]|0){i=h;return}kq(c[j>>2]|0,c[k>>2]|0,c[l>>2]|0);if(c[(c[j>>2]|0)+64>>2]|0){i=h;return}if(d[(c[m>>2]|0)+64>>0]|0){i=h;return}lq(c[j>>2]|0,c[k>>2]|0);i=h;return}function _p(e,f,g,h){e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;j=i;i=i+96|0;v=j;q=j+84|0;F=j+80|0;z=j+76|0;m=j+72|0;l=j+68|0;n=j+64|0;p=j+60|0;o=j+56|0;u=j+52|0;k=j+48|0;C=j+44|0;B=j+40|0;A=j+36|0;s=j+32|0;t=j+28|0;r=j+24|0;w=j+20|0;x=j+16|0;E=j+12|0;D=j+8|0;c[F>>2]=e;c[z>>2]=f;c[m>>2]=g;c[l>>2]=h;c[n>>2]=c[c[F>>2]>>2];if(c[z>>2]|0){c[B>>2]=c[c[z>>2]>>2];c[k>>2]=se(c[n>>2]|0,(c[B>>2]|0)*24|0,0)|0}else{c[B>>2]=0;c[k>>2]=0}b[c[m>>2]>>1]=c[B>>2];c[c[l>>2]>>2]=c[k>>2];c[p>>2]=0;c[C>>2]=c[k>>2];while(1){if((c[p>>2]|0)>=(c[B>>2]|0))break;c[A>>2]=iq(c[(c[(c[z>>2]|0)+4>>2]|0)+((c[p>>2]|0)*20|0)>>2]|0)|0;F=c[(c[(c[z>>2]|0)+4>>2]|0)+((c[p>>2]|0)*20|0)+4>>2]|0;c[s>>2]=F;do if(!F){c[r>>2]=c[A>>2];while(1){h=c[r>>2]|0;if((d[c[r>>2]>>0]|0)!=122)break;c[r>>2]=c[h+16>>2]}if((d[h>>0]|0)==154?(c[(c[r>>2]|0)+44>>2]|0)!=0:0){c[x>>2]=b[(c[r>>2]|0)+32>>1];c[w>>2]=c[(c[r>>2]|0)+44>>2];if((c[x>>2]|0)<0)c[x>>2]=b[(c[w>>2]|0)+36>>1];h=c[n>>2]|0;if((c[x>>2]|0)>=0)g=c[(c[(c[w>>2]|0)+4>>2]|0)+((c[x>>2]|0)*24|0)>>2]|0;else g=9992;c[v>>2]=g;c[s>>2]=Te(h,1200,v)|0;break}h=c[n>>2]|0;if((d[c[r>>2]>>0]|0)==27){c[v>>2]=c[(c[r>>2]|0)+8>>2];c[s>>2]=Te(h,1200,v)|0;break}else{c[v>>2]=c[(c[(c[z>>2]|0)+4>>2]|0)+((c[p>>2]|0)*20|0)+8>>2];c[s>>2]=Te(h,1200,v)|0;break}}else c[s>>2]=ne(c[n>>2]|0,c[s>>2]|0)|0;while(0);if(a[(c[n>>2]|0)+64>>0]|0){y=22;break}c[t>>2]=Mb(c[s>>2]|0)|0;c[u>>2]=0;c[o>>2]=0;while(1){if((c[o>>2]|0)>=(c[p>>2]|0))break;if(!(xc(c[(c[k>>2]|0)+((c[o>>2]|0)*24|0)>>2]|0,c[s>>2]|0)|0)){c[D>>2]=(c[t>>2]|0)-1;while(1){if((c[D>>2]|0)<=1)break;if(!(d[1224+(d[(c[s>>2]|0)+(c[D>>2]|0)>>0]|0)>>0]&4))break;c[D>>2]=(c[D>>2]|0)+ -1}if((c[D>>2]|0)>=0?(a[(c[s>>2]|0)+(c[D>>2]|0)>>0]|0)==58:0)c[t>>2]=c[D>>2];a[(c[s>>2]|0)+(c[t>>2]|0)>>0]=0;F=c[n>>2]|0;f=c[s>>2]|0;e=(c[u>>2]|0)+1|0;c[u>>2]=e;c[v>>2]=f;c[v+4>>2]=e;c[E>>2]=Te(F,16424,v)|0;Xb(c[n>>2]|0,c[s>>2]|0);c[s>>2]=c[E>>2];c[o>>2]=-1;if(!(c[s>>2]|0))break}c[o>>2]=(c[o>>2]|0)+1}c[c[C>>2]>>2]=c[s>>2];c[p>>2]=(c[p>>2]|0)+1;c[C>>2]=(c[C>>2]|0)+24}if((y|0)==22)Xb(c[n>>2]|0,c[s>>2]|0);if(!(a[(c[n>>2]|0)+64>>0]|0)){c[q>>2]=0;F=c[q>>2]|0;i=j;return F|0}c[o>>2]=0;while(1){r=c[n>>2]|0;if((c[o>>2]|0)>=(c[p>>2]|0))break;Xb(r,c[(c[k>>2]|0)+((c[o>>2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2]=e}c[q>>2]=(c[q>>2]|0)+1;c[h>>2]=(c[h>>2]|0)+24}e=j;e=lF(c[e>>2]|0,c[e+4>>2]|0,4,0)|0;e=dq(e,D)|0;b[(c[k>>2]|0)+42>>1]=e;i=o;return}function aq(e,f,g){e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;s=i;i=i+128|0;j=s+116|0;n=s+112|0;v=s+108|0;r=s+104|0;p=s+100|0;t=s+96|0;o=s+120|0;h=s+92|0;q=s+88|0;k=s+84|0;u=s+80|0;m=s+48|0;l=s+40|0;y=s+8|0;w=s+4|0;x=s;c[n>>2]=e;c[v>>2]=f;c[r>>2]=g;c[p>>2]=0;a[o>>0]=1;if((c[v>>2]|0)!=0?(c[(c[n>>2]|0)+4>>2]|0)!=0:0){g=d[c[v>>2]>>0]|0;do if((g|0)==154|(g|0)==156){c[h>>2]=0;c[q>>2]=0;c[k>>2]=b[(c[v>>2]|0)+32>>1];while(1){if(!(c[n>>2]|0))break;if(!((c[h>>2]|0)!=0^1))break;c[u>>2]=c[(c[n>>2]|0)+4>>2];c[t>>2]=0;while(1){if((c[t>>2]|0)>=(c[c[u>>2]>>2]|0))break;if((c[(c[u>>2]|0)+8+((c[t>>2]|0)*72|0)+40>>2]|0)==(c[(c[v>>2]|0)+28>>2]|0))break;c[t>>2]=(c[t>>2]|0)+1}if((c[t>>2]|0)<(c[c[u>>2]>>2]|0)){c[h>>2]=c[(c[u>>2]|0)+8+((c[t>>2]|0)*72|0)+16>>2];c[q>>2]=c[(c[u>>2]|0)+8+((c[t>>2]|0)*72|0)+20>>2];continue}else{c[n>>2]=c[(c[n>>2]|0)+16>>2];continue}}if(c[h>>2]|0){if(c[q>>2]|0){if((c[k>>2]|0)<0)break;if((c[k>>2]|0)>=(c[c[c[q>>2]>>2]>>2]|0))break;c[l>>2]=c[(c[(c[c[q>>2]>>2]|0)+4>>2]|0)+((c[k>>2]|0)*20|0)>>2];c[m+4>>2]=c[(c[q>>2]|0)+32>>2];c[m+16>>2]=c[n>>2];c[m>>2]=c[c[n>>2]>>2];c[p>>2]=aq(m,c[l>>2]|0,o)|0;break}if(c[(c[h>>2]|0)+68>>2]|0){if((c[k>>2]|0)<0)c[k>>2]=b[(c[h>>2]|0)+36>>1];if((c[k>>2]|0)<0){c[p>>2]=16416;break}else{c[p>>2]=c[(c[(c[h>>2]|0)+4>>2]|0)+((c[k>>2]|0)*24|0)+12>>2];a[o>>0]=a[(c[(c[h>>2]|0)+4>>2]|0)+((c[k>>2]|0)*24|0)+22>>0]|0;break}}}}else if((g|0)==119){c[w>>2]=c[(c[v>>2]|0)+20>>2];c[x>>2]=c[c[(c[c[w>>2]>>2]|0)+4>>2]>>2];c[y+4>>2]=c[(c[w>>2]|0)+32>>2];c[y+16>>2]=c[n>>2];c[y>>2]=c[c[n>>2]>>2];c[p>>2]=aq(y,c[x>>2]|0,o)|0}while(0);if(c[r>>2]|0)a[c[r>>2]>>0]=a[o>>0]|0;c[j>>2]=c[p>>2];e=c[j>>2]|0;i=s;return e|0}c[j>>2]=0;e=c[j>>2]|0;i=s;return e|0}function bq(e){e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;g=f+12|0;h=f+8|0;k=f+4|0;j=f;c[h>>2]=e;c[h>>2]=iq(c[h>>2]|0)|0;if(c[(c[h>>2]|0)+4>>2]&512){a[g>>0]=0;k=a[g>>0]|0;i=f;return k|0}c[k>>2]=d[c[h>>2]>>0];if((c[k>>2]|0)==119){a[g>>0]=bq(c[c[(c[c[(c[h>>2]|0)+20>>2]>>2]|0)+4>>2]>>2]|0)|0;k=a[g>>0]|0;i=f;return k|0}if((c[k>>2]|0)==38){a[g>>0]=Bp(c[(c[h>>2]|0)+8>>2]|0,0)|0;k=a[g>>0]|0;i=f;return k|0}if((c[k>>2]|0)==156|(c[k>>2]|0)==154|(c[k>>2]|0)==159?(c[(c[h>>2]|0)+44>>2]|0)!=0:0){c[j>>2]=b[(c[h>>2]|0)+32>>1];if((c[j>>2]|0)<0){a[g>>0]=68;k=a[g>>0]|0;i=f;return k|0}else{a[g>>0]=a[(c[(c[(c[h>>2]|0)+44>>2]|0)+4>>2]|0)+((c[j>>2]|0)*24|0)+21>>0]|0;k=a[g>>0]|0;i=f;return k|0}}a[g>>0]=a[(c[h>>2]|0)+1>>0]|0;k=a[g>>0]|0;i=f;return k|0}function cq(e,f){e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;j=i;i=i+32|0;k=j+28|0;q=j+24|0;o=j+20|0;m=j+16|0;l=j+12|0;p=j+8|0;g=j+4|0;n=j;c[k>>2]=e;c[q>>2]=f;c[o>>2]=c[c[k>>2]>>2];c[m>>2]=0;c[l>>2]=c[q>>2];while(1){if(!(c[l>>2]|0))break;c[p>>2]=d[c[l>>2]>>0];if(c[(c[l>>2]|0)+4>>2]&512)break;if((c[p>>2]|0)==38|(c[p>>2]|0)==158){c[l>>2]=c[(c[l>>2]|0)+12>>2];continue}if((c[p>>2]|0)==95){h=9;break}if((c[p>>2]|0)==159?(d[(c[l>>2]|0)+38>>0]|0)==95:0){h=9;break}if((c[(c[l>>2]|0)+44>>2]|0)!=0?(c[p>>2]|0)==156|(c[p>>2]|0)==154|(c[p>>2]|0)==159|(c[p>>2]|0)==62:0){h=12;break}if(!(c[(c[l>>2]|0)+4>>2]&256))break;if((c[(c[l>>2]|0)+12>>2]|0)!=0?(c[(c[(c[l>>2]|0)+12>>2]|0)+4>>2]&256|0)!=0:0){c[l>>2]=c[(c[l>>2]|0)+12>>2];continue}c[l>>2]=c[(c[l>>2]|0)+16>>2]}if((h|0)==9)c[m>>2]=eq(c[k>>2]|0,a[(c[(c[(c[o>>2]|0)+16>>2]|0)+12>>2]|0)+77>>0]|0,0,c[(c[l>>2]|0)+8>>2]|0)|0;else if((h|0)==12?(c[g>>2]=b[(c[l>>2]|0)+32>>1],(c[g>>2]|0)>=0):0){c[n>>2]=c[(c[(c[(c[l>>2]|0)+44>>2]|0)+4>>2]|0)+((c[g>>2]|0)*24|0)+16>>2];c[m>>2]=$g(c[o>>2]|0,a[(c[(c[(c[o>>2]|0)+16>>2]|0)+12>>2]|0)+77>>0]|0,c[n>>2]|0,0)|0}if(!(fq(c[k>>2]|0,c[m>>2]|0)|0)){q=c[m>>2]|0;i=j;return q|0}c[m>>2]=0;q=c[m>>2]|0;i=j;return q|0}function dq(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;f=e+10|0;g=e;h=e+8|0;j=g;c[j>>2]=a;c[j+4>>2]=d;b[h>>1]=40;a=g;d=c[a+4>>2]|0;a:do if(d>>>0<0|(d|0)==0&(c[a>>2]|0)>>>0<8){j=g;a=c[j+4>>2]|0;if(a>>>0<0|(a|0)==0&(c[j>>2]|0)>>>0<2){b[f>>1]=0;j=b[f>>1]|0;i=e;return j|0}else while(1){j=g;a=c[j+4>>2]|0;if(!(a>>>0<0|(a|0)==0&(c[j>>2]|0)>>>0<8))break a;b[h>>1]=(b[h>>1]|0)-10;a=g;a=$E(c[a>>2]|0,c[a+4>>2]|0,1)|0;j=g;c[j>>2]=a;c[j+4>>2]=D}}else{while(1){j=g;a=c[j+4>>2]|0;if(!(a>>>0>0|(a|0)==0&(c[j>>2]|0)>>>0>255))break;b[h>>1]=(b[h>>1]|0)+40;a=g;a=cF(c[a>>2]|0,c[a+4>>2]|0,4)|0;j=g;c[j>>2]=a;c[j+4>>2]=D}while(1){j=g;a=c[j+4>>2]|0;if(!(a>>>0>0|(a|0)==0&(c[j>>2]|0)>>>0>15))break a;b[h>>1]=(b[h>>1]|0)+10;a=g;a=cF(c[a>>2]|0,c[a+4>>2]|0,1)|0;j=g;c[j>>2]=a;c[j+4>>2]=D}}while(0);b[f>>1]=(b[16360+((c[g>>2]&7)<<1)>>1]|0)+(b[h>>1]|0)-10;j=b[f>>1]|0;i=e;return j|0}function eq(b,e,f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4|0;j=g;c[h>>2]=b;c[n>>2]=e;c[k>>2]=f;do if(c[(c[h>>2]|0)+220>>2]|0){c[m>>2]=ne(c[h>>2]|0,c[k>>2]|0)|0;if(c[m>>2]|0){Bb[c[(c[h>>2]|0)+220>>2]&3](c[(c[h>>2]|0)+228>>2]|0,c[h>>2]|0,c[n>>2]|0,c[m>>2]|0);Xb(c[h>>2]|0,c[m>>2]|0);break}else{i=g;return}}while(0);if(!(c[(c[h>>2]|0)+224>>2]|0)){i=g;return}c[j>>2]=rf(c[h>>2]|0)|0;sf(c[j>>2]|0,-1,c[k>>2]|0,1,0);c[l>>2]=Md(c[j>>2]|0,((a[1136]|0)==0?3:2)&255)|0;if(c[l>>2]|0)Bb[c[(c[h>>2]|0)+224>>2]&3](c[(c[h>>2]|0)+228>>2]|0,c[h>>2]|0,d[(c[(c[(c[h>>2]|0)+16>>2]|0)+12>>2]|0)+77>>0]|0,c[l>>2]|0);tf(c[j>>2]|0);i=g;return}function hq(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+32|0;e=f+20|0;j=f+16|0;g=f+12|0;h=f+8|0;l=f+4|0;k=f;c[j>>2]=b;c[g>>2]=d;c[l>>2]=c[c[g>>2]>>2];c[k>>2]=0;while(1){if((c[k>>2]|0)>=3){d=6;break}c[h>>2]=$g(c[j>>2]|0,a[16408+(c[k>>2]|0)>>0]|0,c[l>>2]|0,0)|0;if(c[(c[h>>2]|0)+12>>2]|0){d=4;break}c[k>>2]=(c[k>>2]|0)+1}if((d|0)==4){b=c[g>>2]|0;l=c[h>>2]|0;c[b+0>>2]=c[l+0>>2];c[b+4>>2]=c[l+4>>2];c[b+8>>2]=c[l+8>>2];c[b+12>>2]=c[l+12>>2];c[b+16>>2]=c[l+16>>2];c[(c[g>>2]|0)+16>>2]=0;c[e>>2]=0;b=c[e>>2]|0;i=f;return b|0}else if((d|0)==6){c[e>>2]=1;b=c[e>>2]|0;i=f;return b|0}return 0}function iq(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b;c[d>>2]=a;while(1){if(c[d>>2]|0)e=(c[(c[d>>2]|0)+4>>2]&4096|0)!=0;else e=0;a=c[d>>2]|0;if(!e)break;e=c[d>>2]|0;if(c[a+4>>2]&262144){c[d>>2]=c[c[(c[e+20>>2]|0)+4>>2]>>2];continue}else{c[d>>2]=c[e+12>>2];continue}}i=b;return a|0}function jq(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+32|0;h=e+28|0;f=e+24|0;g=e;c[h>>2]=b;c[f>>2]=d;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;c[g+12>>2]=0;c[g+16>>2]=0;c[g+20>>2]=0;c[g>>2]=37;c[g+12>>2]=c[h>>2];if(a[(c[h>>2]|0)+22>>0]|0){c[g+4>>2]=38;oq(g,c[f>>2]|0)|0}c[g+4>>2]=39;c[g+8>>2]=3;oq(g,c[f>>2]|0)|0;i=e;return}function kq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+48|0;j=e+32|0;f=e+28|0;h=e+24|0;g=e;c[j>>2]=a;c[f>>2]=b;c[h>>2]=d;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;c[g+12>>2]=0;c[g+16>>2]=0;c[g+20>>2]=0;c[g>>2]=40;c[g+4>>2]=41;c[g+12>>2]=c[j>>2];c[g+20>>2]=c[h>>2];oq(g,c[f>>2]|0)|0;i=e;return}function lq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+32|0;g=d+28|0;e=d+24|0;f=d;c[g>>2]=a;c[e>>2]=b;c[f+0>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[f+16>>2]=0;c[f+20>>2]=0;c[f+8>>2]=4;c[f>>2]=37;c[f+12>>2]=c[g>>2];oq(f,c[e>>2]|0)|0;i=d;return}function mq(a,f){a=a|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;l=i;i=i+32|0;p=l+28|0;o=l+24|0;n=l+20|0;g=l+16|0;m=l+12|0;h=l+8|0;k=l+4|0;j=l;c[p>>2]=a;c[o>>2]=f;if((e[(c[o>>2]|0)+6>>1]|0)&32){i=l;return}a=(c[o>>2]|0)+6|0;b[a>>1]=e[a>>1]|0|32;c[n>>2]=c[(c[p>>2]|0)+12>>2];c[m>>2]=c[(c[o>>2]|0)+32>>2];c[g>>2]=0;c[h>>2]=(c[m>>2]|0)+8;while(1){if((c[g>>2]|0)>=(c[c[m>>2]>>2]|0))break;c[k>>2]=c[(c[h>>2]|0)+16>>2];if(((c[k>>2]|0)!=0?((d[(c[k>>2]|0)+44>>0]|0)&2|0)!=0:0)?(c[j>>2]=c[(c[h>>2]|0)+20>>2],(c[j>>2]|0)!=0):0){while(1){if(!(c[(c[j>>2]|0)+52>>2]|0))break;c[j>>2]=c[(c[j>>2]|0)+52>>2]}$p(c[n>>2]|0,c[k>>2]|0,c[j>>2]|0)}c[g>>2]=(c[g>>2]|0)+1;c[h>>2]=(c[h>>2]|0)+72}i=l;return}function nq(a,b){a=a|0;b=b|0;var d=0;d=i;i=i+16|0;c[d+4>>2]=a;c[d>>2]=b;i=d;return 0}function oq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=i;i=i+16|0;d=e+12|0;f=e+8|0;h=e+4|0;g=e;c[f>>2]=a;c[h>>2]=b;do if(c[h>>2]|0){if((c[(c[f>>2]|0)+4>>2]|0)==0?(c[(c[f>>2]|0)+8>>2]|0)==0:0)break;c[g>>2]=0;a=(c[f>>2]|0)+16|0;c[a>>2]=(c[a>>2]|0)+1;while(1){if(!(c[h>>2]|0)){b=15;break}if((c[(c[f>>2]|0)+4>>2]|0)!=0?(c[g>>2]=zb[c[(c[f>>2]|0)+4>>2]&63](c[f>>2]|0,c[h>>2]|0)|0,(c[g>>2]|0)!=0):0){b=15;break}if(pq(c[f>>2]|0,c[h>>2]|0)|0){b=11;break}if(qq(c[f>>2]|0,c[h>>2]|0)|0){b=11;break}if(c[(c[f>>2]|0)+8>>2]|0)sb[c[(c[f>>2]|0)+8>>2]&7](c[f>>2]|0,c[h>>2]|0);c[h>>2]=c[(c[h>>2]|0)+52>>2]}if((b|0)==11){a=(c[f>>2]|0)+16|0;c[a>>2]=(c[a>>2]|0)+ -1;c[d>>2]=2;a=c[d>>2]|0;i=e;return a|0}else if((b|0)==15){a=(c[f>>2]|0)+16|0;c[a>>2]=(c[a>>2]|0)+ -1;c[d>>2]=c[g>>2]&2;a=c[d>>2]|0;i=e;return a|0}}while(0);c[d>>2]=0;a=c[d>>2]|0;i=e;return a|0}function pq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=i;i=i+16|0;d=e+8|0;f=e+4|0;g=e;c[f>>2]=a;c[g>>2]=b;do if(!(rq(c[f>>2]|0,c[c[g>>2]>>2]|0)|0)){if(sq(c[f>>2]|0,c[(c[g>>2]|0)+36>>2]|0)|0){c[d>>2]=2;break}if(rq(c[f>>2]|0,c[(c[g>>2]|0)+40>>2]|0)|0){c[d>>2]=2;break}if(sq(c[f>>2]|0,c[(c[g>>2]|0)+44>>2]|0)|0){c[d>>2]=2;break}if(rq(c[f>>2]|0,c[(c[g>>2]|0)+48>>2]|0)|0){c[d>>2]=2;break}if(sq(c[f>>2]|0,c[(c[g>>2]|0)+60>>2]|0)|0){c[d>>2]=2;break}if(sq(c[f>>2]|0,c[(c[g>>2]|0)+64>>2]|0)|0){c[d>>2]=2;break}else{c[d>>2]=0;break}}else c[d>>2]=2;while(0);i=e;return c[d>>2]|0}function qq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+32|0;d=e+20|0;f=e+16|0;k=e+12|0;j=e+8|0;h=e+4|0;g=e;c[f>>2]=a;c[k>>2]=b;c[j>>2]=c[(c[k>>2]|0)+32>>2];a:do if(c[j>>2]|0){c[h>>2]=c[c[j>>2]>>2];c[g>>2]=(c[j>>2]|0)+8;while(1){if((c[h>>2]|0)<=0)break a;if(oq(c[f>>2]|0,c[(c[g>>2]|0)+20>>2]|0)|0)break;c[h>>2]=(c[h>>2]|0)+ -1;c[g>>2]=(c[g>>2]|0)+72}c[d>>2]=2;k=c[d>>2]|0;i=e;return k|0}while(0);c[d>>2]=0;k=c[d>>2]|0;i=e;return k|0}function rq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;e=i;i=i+32|0;d=e+16|0;f=e+12|0;j=e+8|0;h=e+4|0;g=e;c[f>>2]=a;c[j>>2]=b;a:do if(c[j>>2]|0){c[h>>2]=c[c[j>>2]>>2];c[g>>2]=c[(c[j>>2]|0)+4>>2];while(1){if((c[h>>2]|0)<=0)break a;if(sq(c[f>>2]|0,c[c[g>>2]>>2]|0)|0)break;c[h>>2]=(c[h>>2]|0)+ -1;c[g>>2]=(c[g>>2]|0)+20}c[d>>2]=2;a=c[d>>2]|0;i=e;return a|0}while(0);c[d>>2]=0;a=c[d>>2]|0;i=e;return a|0}function sq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;e=d+12|0;h=d+8|0;g=d+4|0;f=d;c[h>>2]=a;c[g>>2]=b;a:do if(!(c[g>>2]|0))c[e>>2]=0;else{c[f>>2]=zb[c[c[h>>2]>>2]&63](c[h>>2]|0,c[g>>2]|0)|0;do if((c[f>>2]|0)==0?(c[(c[g>>2]|0)+4>>2]&16384|0)==0:0){if(sq(c[h>>2]|0,c[(c[g>>2]|0)+12>>2]|0)|0){c[e>>2]=2;break a}if(sq(c[h>>2]|0,c[(c[g>>2]|0)+16>>2]|0)|0){c[e>>2]=2;break a}h=c[h>>2]|0;b=(c[g>>2]|0)+20|0;if(c[(c[g>>2]|0)+4>>2]&2048){if(!(oq(h,c[b>>2]|0)|0))break;c[e>>2]=2;break a}else{if(!(rq(h,c[b>>2]|0)|0))break;c[e>>2]=2;break a}}while(0);c[e>>2]=c[f>>2]&2}while(0);i=d;return c[e>>2]|0}function tq(f,g){f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;j=i;i=i+96|0;s=j;h=j+84|0;l=j+80|0;x=j+76|0;o=j+72|0;p=j+68|0;F=j+64|0;D=j+60|0;C=j+56|0;E=j+52|0;m=j+48|0;z=j+44|0;t=j+40|0;u=j+36|0;n=j+32|0;y=j+28|0;r=j+24|0;q=j+20|0;k=j+16|0;v=j+88|0;A=j+12|0;B=j+8|0;c[l>>2]=f;c[x>>2]=g;c[o>>2]=c[(c[l>>2]|0)+20>>2];c[p>>2]=c[c[o>>2]>>2];if(c[(c[x>>2]|0)+4>>2]&4){c[h>>2]=1;f=c[h>>2]|0;i=j;return f|0}f=(c[x>>2]|0)+4|0;c[f>>2]=c[f>>2]|4;switch(d[c[x>>2]>>0]|0){case 153:{c[m>>2]=c[(c[x>>2]|0)+20>>2];if(c[m>>2]|0)B=c[c[m>>2]>>2]|0;else B=0;c[z>>2]=B;c[t>>2]=0;c[u>>2]=0;c[n>>2]=0;a[v>>0]=a[(c[(c[(c[c[p>>2]>>2]|0)+16>>2]|0)+12>>2]|0)+77>>0]|0;Sq(c[p>>2]|0,c[o>>2]|0,16800);c[q>>2]=c[(c[x>>2]|0)+8>>2];c[r>>2]=Mb(c[q>>2]|0)|0;c[k>>2]=Sf(c[c[p>>2]>>2]|0,c[q>>2]|0,c[r>>2]|0,c[z>>2]|0,a[v>>0]|0,0)|0;do if(!(c[k>>2]|0)){c[k>>2]=Sf(c[c[p>>2]>>2]|0,c[q>>2]|0,c[r>>2]|0,-2,a[v>>0]|0,0)|0;if(!(c[k>>2]|0)){c[t>>2]=1;break}else{c[u>>2]=1;break}}else{c[n>>2]=(c[(c[k>>2]|0)+12>>2]|0)==0&1;do if(e[(c[k>>2]|0)+2>>1]&1024){f=(c[x>>2]|0)+4|0;c[f>>2]=c[f>>2]|266240;if((c[z>>2]|0)!=2){c[(c[x>>2]|0)+28>>2]=(a[c[(c[k>>2]|0)+24>>2]>>0]|0)==117?62:938;break}f=Tq(c[(c[(c[m>>2]|0)+4>>2]|0)+20>>2]|0)|0;c[(c[x>>2]|0)+28>>2]=f;if((c[(c[x>>2]|0)+28>>2]|0)<0){Se(c[p>>2]|0,16816,s);f=(c[o>>2]|0)+24|0;c[f>>2]=(c[f>>2]|0)+1}}while(0);c[y>>2]=ap(c[p>>2]|0,31,0,c[(c[k>>2]|0)+24>>2]|0,0)|0;if(!(c[y>>2]|0)){if(!(e[(c[k>>2]|0)+2>>1]&2048))break;f=(c[x>>2]|0)+4|0;c[f>>2]=c[f>>2]|524288;break}if((c[y>>2]|0)==1){f=c[p>>2]|0;c[s>>2]=c[(c[k>>2]|0)+24>>2];Se(f,16888,s);f=(c[o>>2]|0)+24|0;c[f>>2]=(c[f>>2]|0)+1}a[c[x>>2]>>0]=101;c[h>>2]=1;f=c[h>>2]|0;i=j;return f|0}while(0);if((c[n>>2]|0)!=0?(e[(c[o>>2]|0)+28>>1]&1|0)==0:0){f=c[p>>2]|0;g=c[q>>2]|0;c[s>>2]=c[r>>2];c[s+4>>2]=g;Se(f,16928,s);f=(c[o>>2]|0)+24|0;c[f>>2]=(c[f>>2]|0)+1;c[n>>2]=0}else w=29;do if((w|0)==29){if((c[t>>2]|0)!=0?(d[(c[c[p>>2]>>2]|0)+145>>0]|0)==0:0){f=c[p>>2]|0;g=c[q>>2]|0;c[s>>2]=c[r>>2];c[s+4>>2]=g;Se(f,16968,s);f=(c[o>>2]|0)+24|0;c[f>>2]=(c[f>>2]|0)+1;break}if(c[u>>2]|0){f=c[p>>2]|0;g=c[q>>2]|0;c[s>>2]=c[r>>2];c[s+4>>2]=g;Se(f,16992,s);f=(c[o>>2]|0)+24|0;c[f>>2]=(c[f>>2]|0)+1}}while(0);if(c[n>>2]|0){f=(c[o>>2]|0)+28|0;b[f>>1]=e[f>>1]&-2}rq(c[l>>2]|0,c[m>>2]|0)|0;if(c[n>>2]|0){c[A>>2]=c[o>>2];a[c[x>>2]>>0]=-101;a[(c[x>>2]|0)+38>>0]=0;while(1){if(!(c[A>>2]|0))break;if(!((Uq(c[x>>2]|0,c[(c[A>>2]|0)+4>>2]|0)|0)!=0^1))break;f=(c[x>>2]|0)+38|0;a[f>>0]=(a[f>>0]|0)+1<<24>>24;c[A>>2]=c[(c[A>>2]|0)+16>>2]}if(c[A>>2]|0){f=(c[A>>2]|0)+28|0;b[f>>1]=e[f>>1]|(2|e[(c[k>>2]|0)+2>>1]&4096)}f=(c[o>>2]|0)+28|0;b[f>>1]=e[f>>1]|1}c[h>>2]=1;f=c[h>>2]|0;i=j;return f|0};case 135:{Vq(c[p>>2]|0,c[o>>2]|0,17056);Sq(c[p>>2]|0,c[o>>2]|0,17056);break};case 75:case 20:case 119:{if((c[(c[x>>2]|0)+4>>2]&2048|0)!=0?(c[B>>2]=c[(c[o>>2]|0)+20>>2],Vq(c[p>>2]|0,c[o>>2]|0,17040),Sq(c[p>>2]|0,c[o>>2]|0,17040),oq(c[l>>2]|0,c[(c[x>>2]|0)+20>>2]|0)|0,(c[B>>2]|0)!=(c[(c[o>>2]|0)+20>>2]|0)):0){f=(c[x>>2]|0)+4|0;c[f>>2]=c[f>>2]|32}break};case 122:{c[E>>2]=c[(c[x>>2]|0)+16>>2];if((d[c[E>>2]>>0]|0)==27){c[C>>2]=0;c[D>>2]=c[(c[(c[x>>2]|0)+12>>2]|0)+8>>2];c[F>>2]=c[(c[E>>2]|0)+8>>2]}else{c[C>>2]=c[(c[(c[x>>2]|0)+12>>2]|0)+8>>2];c[D>>2]=c[(c[(c[E>>2]|0)+12>>2]|0)+8>>2];c[F>>2]=c[(c[(c[E>>2]|0)+16>>2]|0)+8>>2]}c[h>>2]=Rq(c[p>>2]|0,c[C>>2]|0,c[D>>2]|0,c[F>>2]|0,c[o>>2]|0,c[x>>2]|0)|0;f=c[h>>2]|0;i=j;return f|0};case 27:{c[h>>2]=Rq(c[p>>2]|0,0,0,c[(c[x>>2]|0)+8>>2]|0,c[o>>2]|0,c[x>>2]|0)|0;f=c[h>>2]|0;i=j;return f|0};default:{}}if(c[(c[p>>2]|0)+64>>2]|0)k=1;else k=(d[(c[c[p>>2]>>2]|0)+64>>0]|0)!=0;c[h>>2]=k?2:0;f=c[h>>2]|0;i=j;return f|0}function uq(f,g){f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;j=i;i=i+112|0;m=j;h=j+108|0;C=j+104|0;B=j+100|0;o=j+96|0;t=j+64|0;k=j+56|0;A=j+52|0;l=j+48|0;u=j+44|0;q=j+40|0;r=j+36|0;n=j+32|0;p=j+28|0;w=j+24|0;y=j+20|0;z=j+16|0;x=j+12|0;v=j+8|0;s=j+4|0;c[C>>2]=f;c[B>>2]=g;if(e[(c[B>>2]|0)+6>>1]&2){c[h>>2]=1;f=c[h>>2]|0;i=j;return f|0}c[o>>2]=c[(c[C>>2]|0)+20>>2];c[l>>2]=c[(c[C>>2]|0)+12>>2];c[p>>2]=c[c[l>>2]>>2];if(!(e[(c[B>>2]|0)+6>>1]&16)){Zp(c[l>>2]|0,c[B>>2]|0,c[o>>2]|0);if(c[(c[l>>2]|0)+64>>2]|0)k=1;else k=(d[(c[p>>2]|0)+64>>0]|0)!=0;c[h>>2]=k?2:1;f=c[h>>2]|0;i=j;return f|0}c[k>>2]=(c[(c[B>>2]|0)+52>>2]|0)!=0&1;c[A>>2]=0;c[n>>2]=c[B>>2];a:while(1){if(!(c[B>>2]|0)){o=58;break}f=(c[B>>2]|0)+6|0;b[f>>1]=e[f>>1]|2;c[t+0>>2]=0;c[t+4>>2]=0;c[t+8>>2]=0;c[t+12>>2]=0;c[t+16>>2]=0;c[t+20>>2]=0;c[t+24>>2]=0;c[t+28>>2]=0;c[t>>2]=c[l>>2];if(vq(t,c[(c[B>>2]|0)+60>>2]|0)|0){o=11;break}if(vq(t,c[(c[B>>2]|0)+64>>2]|0)|0){o=11;break}c[q>>2]=0;while(1){if((c[q>>2]|0)>=(c[c[(c[B>>2]|0)+32>>2]>>2]|0))break;c[w>>2]=(c[(c[B>>2]|0)+32>>2]|0)+8+((c[q>>2]|0)*72|0);if(c[(c[w>>2]|0)+20>>2]|0){c[z>>2]=0;c[x>>2]=c[(c[l>>2]|0)+492>>2];c[y>>2]=c[o>>2];while(1){if(!(c[y>>2]|0))break;c[z>>2]=(c[z>>2]|0)+(c[(c[y>>2]|0)+20>>2]|0);c[y>>2]=c[(c[y>>2]|0)+16>>2]}if(c[(c[w>>2]|0)+8>>2]|0)c[(c[l>>2]|0)+492>>2]=c[(c[w>>2]|0)+8>>2];kq(c[l>>2]|0,c[(c[w>>2]|0)+20>>2]|0,c[o>>2]|0);c[(c[l>>2]|0)+492>>2]=c[x>>2];if(c[(c[l>>2]|0)+64>>2]|0){o=22;break a}if(d[(c[p>>2]|0)+64>>0]|0){o=22;break a}c[y>>2]=c[o>>2];while(1){if(!(c[y>>2]|0))break;c[z>>2]=(c[z>>2]|0)-(c[(c[y>>2]|0)+20>>2]|0);c[y>>2]=c[(c[y>>2]|0)+16>>2]}f=(c[w>>2]|0)+37|0;a[f>>0]=a[f>>0]&-3|((c[z>>2]|0)!=0&1)<<1&255}c[q>>2]=(c[q>>2]|0)+1}b[t+28>>1]=1;c[t+4>>2]=c[(c[B>>2]|0)+32>>2];c[t+16>>2]=c[o>>2];c[u>>2]=c[c[B>>2]>>2];c[q>>2]=0;while(1){if((c[q>>2]|0)>=(c[c[u>>2]>>2]|0))break;c[v>>2]=c[(c[(c[u>>2]|0)+4>>2]|0)+((c[q>>2]|0)*20|0)>>2];if(vq(t,c[v>>2]|0)|0){o=31;break a}c[q>>2]=(c[q>>2]|0)+1}c[r>>2]=c[(c[B>>2]|0)+40>>2];if((c[r>>2]|0)==0?(e[t+28>>1]&2|0)==0:0){f=t+28|0;b[f>>1]=e[f>>1]&-2}else{f=(c[B>>2]|0)+6|0;b[f>>1]=e[f>>1]|(4|e[t+28>>1]&4096)}if(!((c[r>>2]|0)!=0?1:(c[(c[B>>2]|0)+44>>2]|0)==0)){o=38;break}c[t+8>>2]=c[c[B>>2]>>2];if(vq(t,c[(c[B>>2]|0)+44>>2]|0)|0){o=40;break}if(vq(t,c[(c[B>>2]|0)+36>>2]|0)|0){o=42;break}c[t+16>>2]=0;f=t+28|0;b[f>>1]=e[f>>1]|1;if((c[k>>2]|0)==0?(wq(t,c[B>>2]|0,c[(c[B>>2]|0)+48>>2]|0,16480)|0)!=0:0){o=45;break}if(a[(c[p>>2]|0)+64>>0]|0){o=47;break}b:do if(c[r>>2]|0){if(wq(t,c[B>>2]|0,c[r>>2]|0,16488)|0){o=51;break a}if(d[(c[p>>2]|0)+64>>0]|0){o=51;break a}c[q>>2]=0;c[s>>2]=c[(c[r>>2]|0)+4>>2];while(1){if((c[q>>2]|0)>=(c[c[r>>2]>>2]|0))break b;if(c[(c[c[s>>2]>>2]|0)+4>>2]&2){o=55;break a}c[q>>2]=(c[q>>2]|0)+1;c[s>>2]=(c[s>>2]|0)+20}}while(0);c[B>>2]=c[(c[B>>2]|0)+52>>2];c[A>>2]=(c[A>>2]|0)+1}switch(o|0){case 11:{c[h>>2]=2;f=c[h>>2]|0;i=j;return f|0};case 22:{c[h>>2]=2;f=c[h>>2]|0;i=j;return f|0};case 31:{c[h>>2]=2;f=c[h>>2]|0;i=j;return f|0};case 38:{Se(c[l>>2]|0,16432,m);c[h>>2]=2;f=c[h>>2]|0;i=j;return f|0};case 40:{c[h>>2]=2;f=c[h>>2]|0;i=j;return f|0};case 42:{c[h>>2]=2;f=c[h>>2]|0;i=j;return f|0};case 45:{c[h>>2]=2;f=c[h>>2]|0;i=j;return f|0};case 47:{c[h>>2]=2;f=c[h>>2]|0;i=j;return f|0};case 51:{c[h>>2]=2;f=c[h>>2]|0;i=j;return f|0};case 55:{Se(c[l>>2]|0,16496,m);c[h>>2]=2;f=c[h>>2]|0;i=j;return f|0};case 58:{if((c[k>>2]|0)!=0?(xq(c[l>>2]|0,c[n>>2]|0)|0)!=0:0){c[h>>2]=2;f=c[h>>2]|0;i=j;return f|0}c[h>>2]=1;f=c[h>>2]|0;i=j;return f|0}}return 0}function vq(a,d){a=a|0;d=d|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+48|0;g=f+40|0;k=f+36|0;j=f+32|0;l=f+44|0;m=f+8|0;h=f;c[k>>2]=a;c[j>>2]=d;if(!(c[j>>2]|0)){c[g>>2]=0;a=c[g>>2]|0;i=f;return a|0}c[h>>2]=c[c[k>>2]>>2];if(Qq(c[h>>2]|0,(c[(c[j>>2]|0)+24>>2]|0)+(c[(c[c[k>>2]>>2]|0)+460>>2]|0)|0)|0){c[g>>2]=1;a=c[g>>2]|0;i=f;return a|0}a=(c[h>>2]|0)+460|0;c[a>>2]=(c[a>>2]|0)+(c[(c[j>>2]|0)+24>>2]|0);b[l>>1]=(e[(c[k>>2]|0)+28>>1]|0)&4098;a=(c[k>>2]|0)+28|0;b[a>>1]=(e[a>>1]|0)&-4099;c[m+0>>2]=0;c[m+4>>2]=0;c[m+8>>2]=0;c[m+12>>2]=0;c[m+16>>2]=0;c[m+20>>2]=0;c[m>>2]=40;c[m+4>>2]=41;c[m+12>>2]=c[c[k>>2]>>2];c[m+20>>2]=c[k>>2];sq(m,c[j>>2]|0)|0;a=(c[c[k>>2]>>2]|0)+460|0;c[a>>2]=(c[a>>2]|0)-(c[(c[j>>2]|0)+24>>2]|0);if(!((c[(c[k>>2]|0)+24>>2]|0)<=0?(c[(c[m+12>>2]|0)+64>>2]|0)<=0:0)){a=(c[j>>2]|0)+4|0;c[a>>2]=c[a>>2]|8}if((e[(c[k>>2]|0)+28>>1]|0)&2){a=(c[j>>2]|0)+4|0;c[a>>2]=c[a>>2]|2}a=(c[k>>2]|0)+28|0;b[a>>1]=e[a>>1]|0|(e[l>>1]|0);c[g>>2]=(c[(c[j>>2]|0)+4>>2]&8|0)!=0&1;a=c[g>>2]|0;i=f;return a|0}function wq(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;r=i;i=i+64|0;k=r+48|0;v=r+44|0;o=r+40|0;t=r+36|0;h=r+32|0;s=r+28|0;u=r+24|0;l=r+20|0;m=r+16|0;n=r+12|0;w=r+8|0;q=r+4|0;p=r;c[v>>2]=d;c[o>>2]=e;c[t>>2]=f;c[h>>2]=g;if(!(c[t>>2]|0)){c[k>>2]=0;d=c[k>>2]|0;i=r;return d|0}c[w>>2]=c[c[c[o>>2]>>2]>>2];c[n>>2]=c[c[v>>2]>>2];c[s>>2]=0;c[m>>2]=c[(c[t>>2]|0)+4>>2];a:while(1){if((c[s>>2]|0)>=(c[c[t>>2]>>2]|0)){j=20;break}c[q>>2]=c[c[m>>2]>>2];c[p>>2]=iq(c[q>>2]|0)|0;if((a[c[h>>2]>>0]|0)!=71?(c[l>>2]=Aq(c[n>>2]|0,c[c[o>>2]>>2]|0,c[p>>2]|0)|0,(c[l>>2]|0)>0):0)b[(c[m>>2]|0)+16>>1]=c[l>>2];else j=8;b:do if((j|0)==8){j=0;if(yq(c[p>>2]|0,l)|0){if((c[l>>2]|0)<1|(c[l>>2]|0)>65535){j=10;break a}b[(c[m>>2]|0)+16>>1]=c[l>>2];break}b[(c[m>>2]|0)+16>>1]=0;if(vq(c[v>>2]|0,c[q>>2]|0)|0){j=13;break a}c[u>>2]=0;while(1){if((c[u>>2]|0)>=(c[c[c[o>>2]>>2]>>2]|0))break b;if(!(Dq(c[q>>2]|0,c[(c[(c[c[o>>2]>>2]|0)+4>>2]|0)+((c[u>>2]|0)*20|0)>>2]|0,-1)|0))b[(c[m>>2]|0)+16>>1]=(c[u>>2]|0)+1;c[u>>2]=(c[u>>2]|0)+1}}while(0);c[s>>2]=(c[s>>2]|0)+1;c[m>>2]=(c[m>>2]|0)+20}if((j|0)==10){zq(c[n>>2]|0,c[h>>2]|0,(c[s>>2]|0)+1|0,c[w>>2]|0);c[k>>2]=1;d=c[k>>2]|0;i=r;return d|0}else if((j|0)==13){c[k>>2]=1;d=c[k>>2]|0;i=r;return d|0}else if((j|0)==20){c[k>>2]=Lq(c[n>>2]|0,c[o>>2]|0,c[t>>2]|0,c[h>>2]|0)|0;d=c[k>>2]|0;i=r;return d|0}return 0}function xq(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;m=i;i=i+64|0;h=m;k=m+52|0;g=m+48|0;o=m+44|0;f=m+40|0;l=m+36|0;j=m+32|0;s=m+28|0;n=m+24|0;p=m+20|0;q=m+16|0;r=m+12|0;t=m+8|0;u=m+4|0;c[g>>2]=d;c[o>>2]=e;c[n>>2]=1;c[l>>2]=c[(c[o>>2]|0)+48>>2];if(!(c[l>>2]|0)){c[k>>2]=0;d=c[k>>2]|0;i=m;return d|0}c[s>>2]=c[c[g>>2]>>2];if((c[c[l>>2]>>2]|0)>(c[(c[s>>2]|0)+96>>2]|0)){Se(c[g>>2]|0,16560,h);c[k>>2]=1;d=c[k>>2]|0;i=m;return d|0}c[f>>2]=0;while(1){if((c[f>>2]|0)>=(c[c[l>>2]>>2]|0))break;d=(c[(c[l>>2]|0)+4>>2]|0)+((c[f>>2]|0)*20|0)+13|0;a[d>>0]=a[d>>0]&-2;c[f>>2]=(c[f>>2]|0)+1}c[(c[o>>2]|0)+56>>2]=0;while(1){if(!(c[(c[o>>2]|0)+52>>2]|0))break;c[(c[(c[o>>2]|0)+52>>2]|0)+56>>2]=c[o>>2];c[o>>2]=c[(c[o>>2]|0)+52>>2]}a:while(1){if(!((c[o>>2]|0)!=0&(c[n>>2]|0)!=0)){n=33;break}c[n>>2]=0;c[j>>2]=c[c[o>>2]>>2];c[f>>2]=0;c[p>>2]=c[(c[l>>2]|0)+4>>2];while(1){if((c[f>>2]|0)>=(c[c[l>>2]>>2]|0))break;c[q>>2]=-1;do if(!(a[(c[p>>2]|0)+13>>0]&1)){c[r>>2]=iq(c[c[p>>2]>>2]|0)|0;if(yq(c[r>>2]|0,q)|0){if((c[q>>2]|0)<=0){n=18;break a}if((c[q>>2]|0)>(c[c[j>>2]>>2]|0)){n=18;break a}}else{c[q>>2]=Aq(c[g>>2]|0,c[j>>2]|0,c[r>>2]|0)|0;if(!(c[q>>2]|0)){c[t>>2]=Bq(c[s>>2]|0,c[r>>2]|0,0)|0;if(!(a[(c[s>>2]|0)+64>>0]|0))c[q>>2]=Cq(c[g>>2]|0,c[o>>2]|0,c[t>>2]|0)|0;wn(c[s>>2]|0,c[t>>2]|0)}}if((c[q>>2]|0)<=0){c[n>>2]=1;break}c[u>>2]=ho(c[s>>2]|0,132,0)|0;if(!(c[u>>2]|0)){n=25;break a}d=(c[u>>2]|0)+4|0;c[d>>2]=c[d>>2]|1024;c[(c[u>>2]|0)+8>>2]=c[q>>2];d=c[u>>2]|0;e=c[p>>2]|0;if((c[c[p>>2]>>2]|0)==(c[r>>2]|0))c[e>>2]=d;else c[(c[e>>2]|0)+12>>2]=d;wn(c[s>>2]|0,c[r>>2]|0);b[(c[p>>2]|0)+16>>1]=c[q>>2];d=(c[p>>2]|0)+13|0;a[d>>0]=a[d>>0]&-2|1}while(0);c[f>>2]=(c[f>>2]|0)+1;c[p>>2]=(c[p>>2]|0)+20}c[o>>2]=c[(c[o>>2]|0)+56>>2]}if((n|0)==18){zq(c[g>>2]|0,16480,(c[f>>2]|0)+1|0,c[c[j>>2]>>2]|0);c[k>>2]=1;d=c[k>>2]|0;i=m;return d|0}else if((n|0)==25){c[k>>2]=1;d=c[k>>2]|0;i=m;return d|0}else if((n|0)==33){c[f>>2]=0;while(1){if((c[f>>2]|0)>=(c[c[l>>2]>>2]|0)){n=38;break}if(!(a[(c[(c[l>>2]|0)+4>>2]|0)+((c[f>>2]|0)*20|0)+13>>0]&1)){n=36;break}c[f>>2]=(c[f>>2]|0)+1}if((n|0)==36){d=c[g>>2]|0;c[h>>2]=(c[f>>2]|0)+1;Se(d,16600,h);c[k>>2]=1;d=c[k>>2]|0;i=m;return d|0}else if((n|0)==38){c[k>>2]=0;d=c[k>>2]|0;i=m;return d|0}}return 0}function yq(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+32|0;f=e+16|0;k=e+12|0;g=e+8|0;h=e+4|0;j=e;c[k>>2]=a;c[g>>2]=b;c[h>>2]=0;b=c[k>>2]|0;if(c[(c[k>>2]|0)+4>>2]&1024){c[c[g>>2]>>2]=c[b+8>>2];c[f>>2]=1;a=c[f>>2]|0;i=e;return a|0}b=d[b>>0]|0;if((b|0)==157){if(yq(c[(c[k>>2]|0)+12>>2]|0,j)|0){c[c[g>>2]>>2]=0-(c[j>>2]|0);c[h>>2]=1}}else if((b|0)==158)c[h>>2]=yq(c[(c[k>>2]|0)+12>>2]|0,c[g>>2]|0)|0;c[f>>2]=c[h>>2];a=c[f>>2]|0;i=e;return a|0}function zq(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+32|0;g=f;l=f+24|0;k=f+20|0;h=f+16|0;j=f+12|0;c[l>>2]=a;c[k>>2]=b;c[h>>2]=d;c[j>>2]=e;a=c[l>>2]|0;d=c[k>>2]|0;b=c[j>>2]|0;c[g>>2]=c[h>>2];c[g+4>>2]=d;c[g+8>>2]=b;Se(a,16664,g);i=f;return}function Aq(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+32|0;f=g+24|0;k=g+16|0;m=g+12|0;l=g+8|0;j=g+4|0;h=g;c[g+20>>2]=a;c[k>>2]=b;c[m>>2]=e;a:do if((d[c[m>>2]>>0]|0|0)==27){c[j>>2]=c[(c[m>>2]|0)+8>>2];c[l>>2]=0;while(1){if((c[l>>2]|0)>=(c[c[k>>2]>>2]|0))break a;c[h>>2]=c[(c[(c[k>>2]|0)+4>>2]|0)+((c[l>>2]|0)*20|0)+4>>2];if((c[h>>2]|0)!=0?(xc(c[h>>2]|0,c[j>>2]|0)|0)==0:0)break;c[l>>2]=(c[l>>2]|0)+1}c[f>>2]=(c[l>>2]|0)+1;a=c[f>>2]|0;i=g;return a|0}while(0);c[f>>2]=0;a=c[f>>2]|0;i=g;return a|0}function Bq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;h=e+8|0;g=e+4|0;f=e;c[h>>2]=a;c[g>>2]=b;c[f>>2]=d;a=Fq(c[h>>2]|0,c[g>>2]|0,c[f>>2]|0,0)|0;i=e;return a|0}function Cq(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;g=i;i=i+80|0;h=g+60|0;q=g+56|0;r=g+52|0;l=g+48|0;k=g+44|0;j=g+40|0;p=g+8|0;n=g+4|0;m=g;o=g+64|0;c[q>>2]=d;c[r>>2]=e;c[l>>2]=f;c[j>>2]=c[c[r>>2]>>2];c[p+0>>2]=0;c[p+4>>2]=0;c[p+8>>2]=0;c[p+12>>2]=0;c[p+16>>2]=0;c[p+20>>2]=0;c[p+24>>2]=0;c[p+28>>2]=0;c[p>>2]=c[q>>2];c[p+4>>2]=c[(c[r>>2]|0)+32>>2];c[p+8>>2]=c[j>>2];b[p+28>>1]=1;c[p+24>>2]=0;c[n>>2]=c[c[q>>2]>>2];a[o>>0]=a[(c[n>>2]|0)+67>>0]|0;a[(c[n>>2]|0)+67>>0]=1;c[m>>2]=vq(p,c[l>>2]|0)|0;a[(c[n>>2]|0)+67>>0]=a[o>>0]|0;if(c[m>>2]|0){c[h>>2]=0;r=c[h>>2]|0;i=g;return r|0}c[k>>2]=0;while(1){if((c[k>>2]|0)>=(c[c[j>>2]>>2]|0)){j=8;break}r=(Dq(c[(c[(c[j>>2]|0)+4>>2]|0)+((c[k>>2]|0)*20|0)>>2]|0,c[l>>2]|0,-1)|0)<2;f=(c[k>>2]|0)+1|0;if(r){j=6;break}c[k>>2]=f}if((j|0)==6){c[h>>2]=f;r=c[h>>2]|0;i=g;return r|0}else if((j|0)==8){c[h>>2]=0;r=c[h>>2]|0;i=g;return r|0}return 0}function Dq(a,e,f){a=a|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;l=i;i=i+32|0;h=l+16|0;j=l+12|0;k=l+8|0;g=l+4|0;m=l;c[j>>2]=a;c[k>>2]=e;c[g>>2]=f;if((c[j>>2]|0)==0|(c[k>>2]|0)==0){c[h>>2]=(c[k>>2]|0)==(c[j>>2]|0)?0:2;a=c[h>>2]|0;i=l;return a|0}c[m>>2]=c[(c[j>>2]|0)+4>>2]|c[(c[k>>2]|0)+4>>2];f=c[j>>2]|0;if(c[m>>2]&1024){if((c[f+4>>2]&c[(c[k>>2]|0)+4>>2]&1024|0)!=0?(c[(c[j>>2]|0)+8>>2]|0)==(c[(c[k>>2]|0)+8>>2]|0):0){c[h>>2]=0;a=c[h>>2]|0;i=l;return a|0}c[h>>2]=2;a=c[h>>2]|0;i=l;return a|0}e=d[c[j>>2]>>0]|0;if((d[f>>0]|0)!=(d[c[k>>2]>>0]|0)){if((e|0)==95?(Dq(c[(c[j>>2]|0)+12>>2]|0,c[k>>2]|0,c[g>>2]|0)|0)<2:0){c[h>>2]=1;a=c[h>>2]|0;i=l;return a|0}if((d[c[k>>2]>>0]|0)==95?(Dq(c[j>>2]|0,c[(c[k>>2]|0)+12>>2]|0,c[g>>2]|0)|0)<2:0){c[h>>2]=1;a=c[h>>2]|0;i=l;return a|0}c[h>>2]=2;a=c[h>>2]|0;i=l;return a|0}if((((e|0)!=154?(d[c[j>>2]>>0]|0)!=156:0)?(c[(c[j>>2]|0)+8>>2]|0)!=0:0)?(UE(c[(c[j>>2]|0)+8>>2]|0,c[(c[k>>2]|0)+8>>2]|0)|0)!=0:0){c[h>>2]=(d[c[j>>2]>>0]|0)==95?1:2;a=c[h>>2]|0;i=l;return a|0}if((c[(c[j>>2]|0)+4>>2]&16|0)!=(c[(c[k>>2]|0)+4>>2]&16|0)){c[h>>2]=2;a=c[h>>2]|0;i=l;return a|0}do if(!(c[m>>2]&16384)){if(c[m>>2]&2048){c[h>>2]=2;a=c[h>>2]|0;i=l;return a|0}if(Dq(c[(c[j>>2]|0)+12>>2]|0,c[(c[k>>2]|0)+12>>2]|0,c[g>>2]|0)|0){c[h>>2]=2;a=c[h>>2]|0;i=l;return a|0}if(Dq(c[(c[j>>2]|0)+16>>2]|0,c[(c[k>>2]|0)+16>>2]|0,c[g>>2]|0)|0){c[h>>2]=2;a=c[h>>2]|0;i=l;return a|0}if(Eq(c[(c[j>>2]|0)+20>>2]|0,c[(c[k>>2]|0)+20>>2]|0,c[g>>2]|0)|0){c[h>>2]=2;a=c[h>>2]|0;i=l;return a|0}if(!(c[m>>2]&8192)){if((b[(c[j>>2]|0)+32>>1]|0)!=(b[(c[k>>2]|0)+32>>1]|0)){c[h>>2]=2;a=c[h>>2]|0;i=l;return a|0}if((c[(c[j>>2]|0)+28>>2]|0)!=(c[(c[k>>2]|0)+28>>2]|0)){if((c[(c[j>>2]|0)+28>>2]|0)==(c[g>>2]|0)?(c[(c[k>>2]|0)+28>>2]|0)<0:0)break;c[h>>2]=2;a=c[h>>2]|0;i=l;return a|0}}}while(0);c[h>>2]=0;a=c[h>>2]|0;i=l;return a|0}function Eq(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;g=i;i=i+32|0;f=g+24|0;h=g+20|0;n=g+16|0;l=g+12|0;m=g+8|0;j=g+4|0;k=g;c[h>>2]=a;c[n>>2]=b;c[l>>2]=e;if((c[h>>2]|0)==0&(c[n>>2]|0)==0){c[f>>2]=0;a=c[f>>2]|0;i=g;return a|0}if((c[h>>2]|0)==0|(c[n>>2]|0)==0){c[f>>2]=1;a=c[f>>2]|0;i=g;return a|0}if((c[c[h>>2]>>2]|0)!=(c[c[n>>2]>>2]|0)){c[f>>2]=1;a=c[f>>2]|0;i=g;return a|0}c[m>>2]=0;while(1){if((c[m>>2]|0)>=(c[c[h>>2]>>2]|0)){h=14;break}c[j>>2]=c[(c[(c[h>>2]|0)+4>>2]|0)+((c[m>>2]|0)*20|0)>>2];c[k>>2]=c[(c[(c[n>>2]|0)+4>>2]|0)+((c[m>>2]|0)*20|0)>>2];if((d[(c[(c[h>>2]|0)+4>>2]|0)+((c[m>>2]|0)*20|0)+12>>0]|0|0)!=(d[(c[(c[n>>2]|0)+4>>2]|0)+((c[m>>2]|0)*20|0)+12>>0]|0|0)){h=10;break}if(Dq(c[j>>2]|0,c[k>>2]|0,c[l>>2]|0)|0){h=12;break}c[m>>2]=(c[m>>2]|0)+1}if((h|0)==10){c[f>>2]=1;a=c[f>>2]|0;i=g;return a|0}else if((h|0)==12){c[f>>2]=1;a=c[f>>2]|0;i=g;return a|0}else if((h|0)==14){c[f>>2]=0;a=c[f>>2]|0;i=g;return a|0}return 0}function Fq(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;j=i;i=i+64|0;m=j+48|0;h=j+44|0;k=j+40|0;l=j+36|0;f=j+32|0;n=j+28|0;g=j+24|0;p=j+20|0;t=j+16|0;q=j+12|0;s=j+8|0;o=j+4|0;r=j;c[m>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;c[f>>2]=0;if(!(c[h>>2]|0)){a=c[f>>2]|0;i=j;return a|0}c[n>>2]=c[k>>2]&1;c[p>>2]=0;if(c[l>>2]|0){c[g>>2]=c[c[l>>2]>>2];c[p>>2]=32768}else{b=c[m>>2]|0;a=Gq(c[h>>2]|0,c[k>>2]|0)|0;c[g>>2]=Qe(b,a,((a|0)<0)<<31>>31)|0}c[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[(c[f>>2]|0)+16>>2]=a;a=c[f>>2]|0;i=j;return a|0}a=Kq(n,c[k>>2]|0)|0;c[g>>2]=(c[g>>2]|0)+a;if(c[(c[f>>2]|0)+4>>2]&8192){a=Fq(c[m>>2]|0,c[(c[h>>2]|0)+12>>2]|0,1,g)|0;c[(c[f>>2]|0)+12>>2]=a;a=Fq(c[m>>2]|0,c[(c[h>>2]|0)+16>>2]|0,1,g)|0;c[(c[f>>2]|0)+16>>2]=a}if(!(c[l>>2]|0)){a=c[f>>2]|0;i=j;return a|0}c[c[l>>2]>>2]=c[g>>2];a=c[f>>2]|0;i=j;return a|0}function Gq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;f=d+8|0;g=d+4|0;e=d;c[f>>2]=a;c[g>>2]=b;c[e>>2]=0;if(!(c[f>>2]|0)){a=c[e>>2]|0;i=d;return a|0}c[e>>2]=Kq(c[f>>2]|0,c[g>>2]|0)|0;if(!(c[g>>2]&1)){a=c[e>>2]|0;i=d;return a|0}a=Gq(c[(c[f>>2]|0)+12>>2]|0,c[g>>2]|0)|0;a=a+(Gq(c[(c[f>>2]|0)+16>>2]|0,c[g>>2]|0)|0)|0;c[e>>2]=(c[e>>2]|0)+a;a=c[e>>2]|0;i=d;return a|0}function Hq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;f=d+8|0;g=d+4|0;e=d;c[f>>2]=a;c[g>>2]=b;do if(!(c[g>>2]&1))c[e>>2]=48;else{if((c[(c[f>>2]|0)+12>>2]|0)==0?(c[(c[f>>2]|0)+20>>2]|0)==0:0){c[e>>2]=16396;break}c[e>>2]=8220}while(0);i=d;return c[e>>2]|0}function Iq(a){a=a|0;var b=0,d=0,e=0;d=i;i=i+16|0;b=d+4|0;e=d;c[e>>2]=a;do if(!(c[(c[e>>2]|0)+4>>2]&16384))if(c[(c[e>>2]|0)+4>>2]&8192){c[b>>2]=28;break}else{c[b>>2]=48;break}else c[b>>2]=12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&1)<<1&255;b=(c[o>>2]|0)+16|0;e=(c[g>>2]|0)+16|0;c[b+0>>2]=c[e+0>>2];c[n>>2]=(c[n>>2]|0)+1;c[o>>2]=(c[o>>2]|0)+20;c[g>>2]=(c[g>>2]|0)+20}c[h>>2]=c[k>>2];b=c[h>>2]|0;i=m;return b|0}function Kq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=i;i=i+16|0;f=e+8|0;g=e+4|0;d=e;c[f>>2]=a;c[g>>2]=b;c[d>>2]=(Hq(c[f>>2]|0,c[g>>2]|0)|0)&4095;if((c[(c[f>>2]|0)+4>>2]&1024|0)==0?(c[(c[f>>2]|0)+8>>2]|0)!=0:0){g=(Mb(c[(c[f>>2]|0)+8>>2]|0)|0)+1|0;c[d>>2]=(c[d>>2]|0)+g}i=e;return(c[d>>2]|0)+7&-8|0}function Lq(a,f,g,h){a=a|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;n=i;i=i+48|0;r=n;j=n+36|0;p=n+32|0;s=n+28|0;q=n+24|0;k=n+20|0;l=n+16|0;t=n+12|0;m=n+8|0;o=n+4|0;c[p>>2]=a;c[s>>2]=f;c[q>>2]=g;c[k>>2]=h;c[t>>2]=c[c[p>>2]>>2];if((c[q>>2]|0)!=0?(d[(c[c[p>>2]>>2]|0)+64>>0]|0)==0:0){if((c[c[q>>2]>>2]|0)>(c[(c[t>>2]|0)+96>>2]|0)){a=c[p>>2]|0;c[r>>2]=c[k>>2];Se(a,16720,r);c[j>>2]=1;a=c[j>>2]|0;i=n;return a|0}c[m>>2]=c[c[s>>2]>>2];c[l>>2]=0;c[o>>2]=c[(c[q>>2]|0)+4>>2];while(1){if((c[l>>2]|0)>=(c[c[q>>2]>>2]|0)){o=13;break}if(b[(c[o>>2]|0)+16>>1]|0){h=c[p>>2]|0;if((e[(c[o>>2]|0)+16>>1]|0)>(c[c[m>>2]>>2]|0)){o=10;break}Mq(h,c[m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}if((d[c[m>>2]>>0]|0)==95)c[n>>2]=Oq(c[r>>2]|0,c[n>>2]|0,c[(c[m>>2]|0)+8>>2]|0)|0;r=(c[m>>2]|0)+4|0;c[r>>2]=c[r>>2]|32768;wn(c[o>>2]|0,c[m>>2]|0);r=(c[m>>2]|0)+0|0;l=(c[n>>2]|0)+0|0;q=r+48|0;do{c[r>>2]=c[l>>2];r=r+4|0;l=l+4|0}while((r|0)<(q|0));if((c[(c[m>>2]|0)+4>>2]&1024|0)==0?(c[(c[m>>2]|0)+8>>2]|0)!=0:0){f=ne(c[o>>2]|0,c[(c[m>>2]|0)+8>>2]|0)|0;c[(c[m>>2]|0)+8>>2]=f;f=(c[m>>2]|0)+4|0;c[f>>2]=c[f>>2]|65536}Xb(c[o>>2]|0,c[n>>2]|0);i=p;return}function Nq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+32|0;g=d+28|0;f=d+24|0;e=d;c[g>>2]=a;c[f>>2]=b;if((c[f>>2]|0)<=0){i=d;return}c[e+0>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0;c[e+16>>2]=0;c[e+20>>2]=0;c[e>>2]=42;c[e+20>>2]=c[f>>2];sq(e,c[g>>2]|0)|0;i=d;return}function Oq(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+32|0;h=e+16|0;g=e+12|0;j=e+8|0;f=e;c[h>>2]=a;c[g>>2]=b;c[j>>2]=d;c[f>>2]=c[j>>2];c[f+4>>2]=Mb(c[f>>2]|0)|0;a=uo(c[h>>2]|0,c[g>>2]|0,f)|0;i=e;return a|0}function Pq(b,e){b=b|0;e=e|0;var f=0,g=0,h=0;f=i;i=i+16|0;h=f+4|0;g=f;c[h>>2]=b;c[g>>2]=e;if((d[c[g>>2]>>0]|0|0)!=155){i=f;return 0}b=(c[g>>2]|0)+38|0;a[b>>0]=(d[b>>0]|0)+(c[(c[h>>2]|0)+20>>2]|0);i=f;return 0}function Qq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;i=i+32|0;h=d;f=d+16|0;j=d+12|0;e=d+8|0;g=d+4|0;c[f>>2]=a;c[j>>2]=b;c[e>>2]=0;c[g>>2]=c[(c[c[f>>2]>>2]|0)+100>>2];if((c[j>>2]|0)<=(c[g>>2]|0)){j=c[e>>2]|0;i=d;return j|0}j=c[f>>2]|0;c[h>>2]=c[g>>2];Se(j,16752,h);c[e>>2]=1;j=c[e>>2]|0;i=d;return j|0}function Rq(f,g,h,j,k,l){f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0;o=i;i=i+144|0;y=o;u=o+132|0;m=o+128|0;E=o+124|0;w=o+120|0;x=o+116|0;z=o+112|0;n=o+108|0;P=o+104|0;J=o+100|0;p=o+96|0;F=o+92|0;R=o+88|0;q=o+84|0;O=o+80|0;t=o+76|0;v=o+72|0;A=o+68|0;r=o+64|0;H=o+60|0;K=o+56|0;I=o+52|0;Q=o+48|0;N=o+44|0;S=o+40|0;M=o+36|0;G=o+32|0;C=o+28|0;T=o+24|0;B=o+20|0;s=o+16|0;c[m>>2]=f;c[E>>2]=g;c[w>>2]=h;c[x>>2]=j;c[z>>2]=k;c[n>>2]=l;c[p>>2]=0;c[F>>2]=0;c[R>>2]=0;c[q>>2]=c[c[m>>2]>>2];c[t>>2]=0;c[v>>2]=c[z>>2];c[A>>2]=0;c[r>>2]=0;c[H>>2]=0;c[(c[n>>2]|0)+28>>2]=-1;c[(c[n>>2]|0)+44>>2]=0;a:do if(c[E>>2]|0){if(e[(c[z>>2]|0)+28>>1]&20){c[E>>2]=0;break}c[P>>2]=0;while(1){if((c[P>>2]|0)>=(c[(c[q>>2]|0)+20>>2]|0))break a;k=(xc(c[(c[(c[q>>2]|0)+16>>2]|0)+(c[P>>2]<<4)>>2]|0,c[E>>2]|0)|0)==0;l=c[P>>2]|0;if(k)break;c[P>>2]=l+1}c[A>>2]=c[(c[(c[q>>2]|0)+16>>2]|0)+(l<<4)+12>>2]}while(0);b:while(1){if(!((c[z>>2]|0)!=0&(c[p>>2]|0)==0)){U=92;break}c[Q>>2]=c[(c[z>>2]|0)+4>>2];if(c[Q>>2]|0){c[P>>2]=0;c[O>>2]=(c[Q>>2]|0)+8;while(1){if((c[P>>2]|0)>=(c[c[Q>>2]>>2]|0))break;c[H>>2]=c[(c[O>>2]|0)+16>>2];if((c[(c[O>>2]|0)+20>>2]|0)!=0?(e[(c[(c[O>>2]|0)+20>>2]|0)+6>>1]&512|0)!=0:0){c[N>>2]=0;c[I>>2]=c[c[(c[O>>2]|0)+20>>2]>>2];c[J>>2]=0;while(1){if((c[J>>2]|0)>=(c[c[I>>2]>>2]|0))break;if(Xq(c[(c[(c[I>>2]|0)+4>>2]|0)+((c[J>>2]|0)*20|0)+8>>2]|0,c[x>>2]|0,c[w>>2]|0,c[E>>2]|0)|0){c[p>>2]=(c[p>>2]|0)+1;c[F>>2]=2;c[t>>2]=c[O>>2];b[(c[n>>2]|0)+32>>1]=c[J>>2];c[N>>2]=1}c[J>>2]=(c[J>>2]|0)+1}if(!((c[N>>2]|0)!=0|(c[w>>2]|0)==0))U=21}else U=21;c:do if((U|0)==21){U=0;if((c[E>>2]|0)!=0?(c[(c[H>>2]|0)+68>>2]|0)!=(c[A>>2]|0):0)break;if(c[w>>2]|0){if(c[(c[O>>2]|0)+12>>2]|0)l=c[(c[O>>2]|0)+12>>2]|0;else l=c[c[H>>2]>>2]|0;c[S>>2]=l;if(xc(c[S>>2]|0,c[w>>2]|0)|0)break}k=c[F>>2]|0;c[F>>2]=k+1;if(!k)c[t>>2]=c[O>>2];c[J>>2]=0;c[K>>2]=c[(c[H>>2]|0)+4>>2];while(1){if((c[J>>2]|0)>=(b[(c[H>>2]|0)+38>>1]|0))break c;if(!(xc(c[c[K>>2]>>2]|0,c[x>>2]|0)|0)){if((c[p>>2]|0)!=1)break;if((d[(c[O>>2]|0)+36>>0]&4|0)==0?(Yq(c[(c[O>>2]|0)+48>>2]|0,c[x>>2]|0)|0)==0:0)break}c[J>>2]=(c[J>>2]|0)+1;c[K>>2]=(c[K>>2]|0)+24}c[p>>2]=(c[p>>2]|0)+1;c[t>>2]=c[O>>2];if((c[J>>2]|0)==(b[(c[H>>2]|0)+36>>1]|0))l=-1;else l=(c[J>>2]&65535)<<16>>16;b[(c[n>>2]|0)+32>>1]=l}while(0);c[P>>2]=(c[P>>2]|0)+1;c[O>>2]=(c[O>>2]|0)+72}if(c[t>>2]|0){c[(c[n>>2]|0)+28>>2]=c[(c[t>>2]|0)+40>>2];c[(c[n>>2]|0)+44>>2]=c[(c[t>>2]|0)+16>>2];if(d[(c[t>>2]|0)+36>>0]&8){k=(c[n>>2]|0)+4|0;c[k>>2]=c[k>>2]|1048576}c[A>>2]=c[(c[(c[n>>2]|0)+44>>2]|0)+68>>2]}}if((c[E>>2]|0)==0&(c[w>>2]|0)!=0&(c[F>>2]|0)==0?(c[(c[m>>2]|0)+412>>2]|0)!=0:0){c[M>>2]=d[(c[m>>2]|0)+436>>0];if((c[M>>2]|0)!=109?(xc(17160,c[w>>2]|0)|0)==0:0){c[(c[n>>2]|0)+28>>2]=1;c[H>>2]=c[(c[m>>2]|0)+412>>2]}else U=50;do if((U|0)==50){U=0;if((c[M>>2]|0)!=108?(xc(17168,c[w>>2]|0)|0)==0:0){c[(c[n>>2]|0)+28>>2]=0;c[H>>2]=c[(c[m>>2]|0)+412>>2];break}c[H>>2]=0}while(0);if(c[H>>2]|0){c[A>>2]=c[(c[H>>2]|0)+68>>2];c[F>>2]=(c[F>>2]|0)+1;c[G>>2]=0;c[K>>2]=c[(c[H>>2]|0)+4>>2];while(1){if((c[G>>2]|0)>=(b[(c[H>>2]|0)+38>>1]|0))break;k=(xc(c[c[K>>2]>>2]|0,c[x>>2]|0)|0)==0;L=c[G>>2]|0;if(k){U=58;break}c[G>>2]=L+1;c[K>>2]=(c[K>>2]|0)+24}if((U|0)==58?(U=0,(L|0)==(b[(c[H>>2]|0)+36>>1]|0)):0)c[G>>2]=-1;if(((c[G>>2]|0)>=(b[(c[H>>2]|0)+38>>1]|0)?(Zq(c[x>>2]|0)|0)!=0:0)?(d[(c[H>>2]|0)+44>>0]&32|0)==0:0)c[G>>2]=-1;if((c[G>>2]|0)<(b[(c[H>>2]|0)+38>>1]|0)){c[p>>2]=(c[p>>2]|0)+1;l=c[n>>2]|0;do if((c[G>>2]|0)>=0){j=(c[G>>2]|0)>=32;if(!(c[l+28>>2]|0)){if(j)l=-1;else l=1<<c[G>>2];k=(c[m>>2]|0)+428|0;c[k>>2]=c[k>>2]|l;break}else{if(j)l=-1;else l=1<<c[G>>2];k=(c[m>>2]|0)+432|0;c[k>>2]=c[k>>2]|l;break}}else a[l+1>>0]=68;while(0);b[(c[n>>2]|0)+32>>1]=c[G>>2];c[(c[n>>2]|0)+44>>2]=c[H>>2];c[r>>2]=1}}}if(((c[p>>2]|0)==0&(c[F>>2]|0)==1&(c[t>>2]|0)!=0?(Zq(c[x>>2]|0)|0)!=0:0)?(d[(c[(c[t>>2]|0)+16>>2]|0)+44>>0]&32|0)==0:0){c[p>>2]=1;b[(c[n>>2]|0)+32>>1]=-1;a[(c[n>>2]|0)+1>>0]=68}k=c[(c[z>>2]|0)+8>>2]|0;c[I>>2]=k;d:do if((k|0)!=0&(c[w>>2]|0)==0&(c[p>>2]|0)==0){c[J>>2]=0;while(1){if((c[J>>2]|0)>=(c[c[I>>2]>>2]|0))break d;c[C>>2]=c[(c[(c[I>>2]|0)+4>>2]|0)+((c[J>>2]|0)*20|0)+4>>2];if((c[C>>2]|0)!=0?(xc(c[C>>2]|0,c[x>>2]|0)|0)==0:0){U=85;break b}c[J>>2]=(c[J>>2]|0)+1}}while(0);if(c[p>>2]|0)continue;c[z>>2]=c[(c[z>>2]|0)+16>>2];c[R>>2]=(c[R>>2]|0)+1}if((U|0)==85){c[T>>2]=c[(c[(c[I>>2]|0)+4>>2]|0)+((c[J>>2]|0)*20|0)>>2];if((e[(c[z>>2]|0)+28>>1]&1|0)==0?(c[(c[T>>2]|0)+4>>2]&2|0)!=0:0){k=c[m>>2]|0;c[y>>2]=c[C>>2];Se(k,17176,y);c[u>>2]=2;k=c[u>>2]|0;i=o;return k|0}Mq(c[m>>2]|0,c[I>>2]|0,c[J>>2]|0,c[n>>2]|0,1216,c[R>>2]|0);c[p>>2]=1;c[t>>2]=0}else if((U|0)==92){if((c[p>>2]|0)==0&(c[w>>2]|0)==0?(c[(c[n>>2]|0)+4>>2]&64|0)!=0:0){a[c[n>>2]>>0]=97;c[(c[n>>2]|0)+44>>2]=0;c[u>>2]=1;k=c[u>>2]|0;i=o;return k|0}if((c[p>>2]|0)!=1){c[B>>2]=(c[p>>2]|0)==0?17208:17224;do if(!(c[E>>2]|0)){C=c[m>>2]|0;B=c[B>>2]|0;if(c[w>>2]|0){f=c[w>>2]|0;k=c[x>>2]|0;c[y>>2]=B;c[y+4>>2]=f;c[y+8>>2]=k;Se(C,17264,y);break}else{k=c[x>>2]|0;c[y>>2]=B;c[y+4>>2]=k;Se(C,17280,y);break}}else{k=c[m>>2]|0;h=c[E>>2]|0;g=c[w>>2]|0;f=c[x>>2]|0;c[y>>2]=c[B>>2];c[y+4>>2]=h;c[y+8>>2]=g;c[y+12>>2]=f;Se(k,17248,y)}while(0);a[(c[m>>2]|0)+17>>0]=1;k=(c[v>>2]|0)+24|0;c[k>>2]=(c[k>>2]|0)+1}if((c[t>>2]|0)!=0?(b[(c[n>>2]|0)+32>>1]|0)>=0:0){g=b[(c[n>>2]|0)+32>>1]|0;c[s>>2]=g;c[s>>2]=(c[s>>2]|0)>=64?63:g;g=$E(1,0,c[s>>2]|0)|0;k=(c[t>>2]|0)+56|0;h=k;f=c[h+4>>2]|D;c[k>>2]=c[h>>2]|g;c[k+4>>2]=f}wn(c[q>>2]|0,c[(c[n>>2]|0)+12>>2]|0);c[(c[n>>2]|0)+12>>2]=0;wn(c[q>>2]|0,c[(c[n>>2]|0)+16>>2]|0);c[(c[n>>2]|0)+16>>2]=0;a[c[n>>2]>>0]=(c[r>>2]|0)!=0?62:154}if((c[p>>2]|0)!=1){c[u>>2]=2;k=c[u>>2]|0;i=o;return k|0}if((d[c[n>>2]>>0]|0)!=24)_q(c[m>>2]|0,c[n>>2]|0,c[A>>2]|0,c[(c[z>>2]|0)+4>>2]|0);while(1){k=(c[v>>2]|0)+20|0;c[k>>2]=(c[k>>2]|0)+1;if((c[v>>2]|0)==(c[z>>2]|0))break;c[v>>2]=c[(c[v>>2]|0)+16>>2]}c[u>>2]=1;k=c[u>>2]|0;i=o;return k|0}function Sq(a,b,d){a=a|0;b=b|0;d=d|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;j=f;g=f+12|0;k=f+8|0;h=f+4|0;c[g>>2]=a;c[k>>2]=b;c[h>>2]=d;if(!((e[(c[k>>2]|0)+28>>1]|0)&16)){i=f;return}k=c[g>>2]|0;c[j>>2]=c[h>>2];Se(k,17112,j);i=f;return}function Tq(a){a=a|0;var b=0,e=0,f=0,g=0;b=i;i=i+16|0;e=b+12|0;g=b+8|0;f=b;c[g>>2]=a;h[f>>3]=-1.0;if((d[c[g>>2]>>0]|0|0)!=133){c[e>>2]=-1;g=c[e>>2]|0;i=b;return g|0}a=c[(c[g>>2]|0)+8>>2]|0;Lm(a,f,Mb(c[(c[g>>2]|0)+8>>2]|0)|0,1)|0;if(+h[f>>3]>1.0){c[e>>2]=-1;g=c[e>>2]|0;i=b;return g|0}else{c[e>>2]=~~(+h[f>>3]*1.0e3);g=c[e>>2]|0;i=b;return g|0}return 0}function Uq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+48|0;f=d+44|0;h=d+40|0;g=d+16|0;e=d;c[f>>2]=a;c[h>>2]=b;c[g+0>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;c[g+12>>2]=0;c[g+16>>2]=0;c[g+20>>2]=0;c[g>>2]=43;c[g+20>>2]=e;c[e>>2]=c[h>>2];c[e+4>>2]=0;c[e+8>>2]=0;rq(g,c[(c[f>>2]|0)+20>>2]|0)|0;if((c[e+4>>2]|0)>0){h=1;h=h&1;i=d;return h|0}h=(c[e+8>>2]|0)==0;h=h&1;i=d;return h|0}function Vq(a,b,d){a=a|0;b=b|0;d=d|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;j=f;g=f+12|0;k=f+8|0;h=f+4|0;c[g>>2]=a;c[k>>2]=b;c[h>>2]=d;if(!((e[(c[k>>2]|0)+28>>1]|0)&4)){i=f;return}k=c[g>>2]|0;c[j>>2]=c[h>>2];Se(k,17072,j);i=f;return}function Wq(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+32|0;k=e+16|0;j=e+12|0;f=e+8|0;h=e+4|0;g=e;c[k>>2]=a;c[j>>2]=b;if((d[c[j>>2]>>0]|0|0)!=154?(d[c[j>>2]>>0]|0|0)!=156:0){i=e;return 0}c[h>>2]=c[(c[k>>2]|0)+20>>2];c[g>>2]=c[c[h>>2]>>2];c[f>>2]=0;while(1){if((c[f>>2]|0)>=(c[c[g>>2]>>2]|0))break;if((c[(c[j>>2]|0)+28>>2]|0)==(c[(c[g>>2]|0)+8+((c[f>>2]|0)*72|0)+40>>2]|0))break;c[f>>2]=(c[f>>2]|0)+1}b=c[h>>2]|0;if((c[f>>2]|0)<(c[c[g>>2]>>2]|0)){a=b+4|0;c[a>>2]=(c[a>>2]|0)+1;i=e;return 0}else{a=b+8|0;c[a>>2]=(c[a>>2]|0)+1;i=e;return 0}return 0}function Xq(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;g=i;i=i+32|0;k=g+20|0;h=g+16|0;n=g+12|0;l=g+8|0;m=g+4|0;j=g;c[h>>2]=b;c[n>>2]=d;c[l>>2]=e;c[m>>2]=f;c[j>>2]=0;while(1){if(!(a[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0))break;if((a[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0)==46)break;c[j>>2]=(c[j>>2]|0)+1}do if(c[m>>2]|0){if((Lb(c[h>>2]|0,c[m>>2]|0,c[j>>2]|0)|0)==0?(a[(c[m>>2]|0)+(c[j>>2]|0)>>0]|0)==0:0)break;c[k>>2]=0;b=c[k>>2]|0;i=g;return b|0}while(0);c[h>>2]=(c[h>>2]|0)+((c[j>>2]|0)+1);c[j>>2]=0;while(1){if(!(a[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0))break;if((a[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0)==46)break;c[j>>2]=(c[j>>2]|0)+1}do if(c[l>>2]|0){if((Lb(c[h>>2]|0,c[l>>2]|0,c[j>>2]|0)|0)==0?(a[(c[l>>2]|0)+(c[j>>2]|0)>>0]|0)==0:0)break;c[k>>2]=0;b=c[k>>2]|0;i=g;return b|0}while(0);c[h>>2]=(c[h>>2]|0)+((c[j>>2]|0)+1);if((c[n>>2]|0)!=0?(xc(c[h>>2]|0,c[n>>2]|0)|0)!=0:0){c[k>>2]=0;b=c[k>>2]|0;i=g;return b|0}c[k>>2]=1;b=c[k>>2]|0;i=g;return b|0}function Yq(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;e=i;i=i+16|0;d=e+12|0;f=e+8|0;h=e+4|0;g=e;c[f>>2]=a;c[h>>2]=b;a:do if(c[f>>2]|0){c[g>>2]=0;while(1){if((c[g>>2]|0)>=(c[(c[f>>2]|0)+4>>2]|0))break a;if(!(xc(c[(c[c[f>>2]>>2]|0)+(c[g>>2]<<3)>>2]|0,c[h>>2]|0)|0))break;c[g>>2]=(c[g>>2]|0)+1}c[d>>2]=1;a=c[d>>2]|0;i=e;return a|0}while(0);c[d>>2]=0;a=c[d>>2]|0;i=e;return a|0}function Zq(a){a=a|0;var b=0,d=0,e=0;d=i;i=i+16|0;b=d+4|0;e=d;c[e>>2]=a;do if(xc(c[e>>2]|0,17368)|0){if(!(xc(c[e>>2]|0,17288)|0)){c[b>>2]=1;break}if(!(xc(c[e>>2]|0,17376)|0)){c[b>>2]=1;break}else{c[b>>2]=0;break}}else c[b>>2]=1;while(0);i=d;return c[b>>2]|0}function _q(e,f,g,h){e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;p=i;i=i+48|0;l=p+36|0;j=p+32|0;s=p+28|0;q=p+24|0;t=p+20|0;k=p+16|0;m=p+12|0;r=p+8|0;n=p+4|0;o=p;c[l>>2]=e;c[j>>2]=f;c[s>>2]=g;c[q>>2]=h;c[t>>2]=c[c[l>>2]>>2];c[k>>2]=0;if(!(c[(c[t>>2]|0)+284>>2]|0)){i=p;return}c[n>>2]=Ve(c[c[l>>2]>>2]|0,c[s>>2]|0)|0;if((c[n>>2]|0)<0){i=p;return}a:do if((d[c[j>>2]>>0]|0)==62)c[k>>2]=c[(c[l>>2]|0)+412>>2];else{c[r>>2]=0;while(1){if((c[r>>2]|0)>=(c[c[q>>2]>>2]|0))break a;h=c[r>>2]|0;if((c[(c[j>>2]|0)+28>>2]|0)==(c[(c[q>>2]|0)+8+((c[r>>2]|0)*72|0)+40>>2]|0))break;c[r>>2]=h+1}c[k>>2]=c[(c[q>>2]|0)+8+(h*72|0)+16>>2]}while(0);c[o>>2]=b[(c[j>>2]|0)+32>>1];if(!(c[k>>2]|0)){i=p;return}do if((c[o>>2]|0)<0)if((b[(c[k>>2]|0)+36>>1]|0)>=0){c[m>>2]=c[(c[(c[k>>2]|0)+4>>2]|0)+((b[(c[k>>2]|0)+36>>1]|0)*24|0)>>2];break}else{c[m>>2]=17288;break}else c[m>>2]=c[(c[(c[k>>2]|0)+4>>2]|0)+((c[o>>2]|0)*24|0)>>2];while(0);if(2!=($q(c[l>>2]|0,c[c[k>>2]>>2]|0,c[m>>2]|0,c[n>>2]|0)|0)){i=p;return}a[c[j>>2]>>0]=101;i=p;return}function $q(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;m=i;i=i+48|0;f=m;h=m+36|0;j=m+32|0;k=m+28|0;n=m+24|0;o=m+20|0;l=m+16|0;g=m+12|0;c[h>>2]=a;c[j>>2]=b;c[k>>2]=d;c[n>>2]=e;c[o>>2]=c[c[h>>2]>>2];c[l>>2]=c[(c[(c[o>>2]|0)+16>>2]|0)+(c[n>>2]<<4)>>2];c[g>>2]=tb[c[(c[o>>2]|0)+284>>2]&1](c[(c[o>>2]|0)+288>>2]|0,20,c[j>>2]|0,c[k>>2]|0,c[l>>2]|0,c[(c[h>>2]|0)+492>>2]|0)|0;if((c[g>>2]|0)!=1){if(!((c[g>>2]|0)!=2&(c[g>>2]|0)!=0)){a=c[g>>2]|0;i=m;return a|0}bp(c[h>>2]|0);a=c[g>>2]|0;i=m;return a|0}e=c[h>>2]|0;if((c[n>>2]|0)!=0?1:(c[(c[o>>2]|0)+20>>2]|0)>2){b=c[j>>2]|0;a=c[k>>2]|0;c[f>>2]=c[l>>2];c[f+4>>2]=b;c[f+8>>2]=a;Se(e,17296,f)}else{a=c[k>>2]|0;c[f>>2]=c[j>>2];c[f+4>>2]=a;Se(e,17336,f)}c[(c[h>>2]|0)+12>>2]=23;a=c[g>>2]|0;i=m;return a|0}function ar(f,g){f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;n=i;i=i+48|0;j=n+44|0;p=n+40|0;o=n+36|0;r=n+32|0;l=n+28|0;t=n+24|0;h=n+20|0;s=n+16|0;m=n+12|0;k=n+8|0;q=n;c[p>>2]=f;c[o>>2]=g;if(!(c[(c[o>>2]|0)+52>>2]|0)){c[j>>2]=0;f=c[j>>2]|0;i=n;return f|0}if(!(c[(c[o>>2]|0)+48>>2]|0)){c[j>>2]=0;f=c[j>>2]|0;i=n;return f|0}c[t>>2]=c[o>>2];while(1){if(!(c[t>>2]|0))break;if((d[(c[t>>2]|0)+4>>0]|0|0)!=116?(d[(c[t>>2]|0)+4>>0]|0|0)!=119:0)break;c[t>>2]=c[(c[t>>2]|0)+52>>2]}if(!(c[t>>2]|0)){c[j>>2]=0;f=c[j>>2]|0;i=n;return f|0}c[s>>2]=c[(c[(c[o>>2]|0)+48>>2]|0)+4>>2];c[r>>2]=(c[c[(c[o>>2]|0)+48>>2]>>2]|0)-1;while(1){if((c[r>>2]|0)<0)break;if(c[(c[(c[s>>2]|0)+((c[r>>2]|0)*20|0)>>2]|0)+4>>2]&256)break;c[r>>2]=(c[r>>2]|0)+ -1}if((c[r>>2]|0)<0){c[j>>2]=0;f=c[j>>2]|0;i=n;return f|0}c[k>>2]=c[(c[p>>2]|0)+12>>2];c[h>>2]=c[c[k>>2]>>2];c[l>>2]=se(c[h>>2]|0,72,0)|0;if(!(c[l>>2]|0)){c[j>>2]=2;f=c[j>>2]|0;i=n;return f|0}c[q+0>>2]=0;c[q+4>>2]=0;c[m>>2]=bo(c[k>>2]|0,0,0,0,q,c[l>>2]|0,0,0)|0;if(!(c[m>>2]|0)){c[j>>2]=2;f=c[j>>2]|0;i=n;return f|0}else{r=(c[l>>2]|0)+0|0;q=(c[o>>2]|0)+0|0;p=r+72|0;do{c[r>>2]=c[q>>2];r=r+4|0;q=q+4|0}while((r|0)<(p|0));c[(c[o>>2]|0)+32>>2]=c[m>>2];f=c[k>>2]|0;f=eo(f,0,ho(c[h>>2]|0,116,0)|0)|0;c[c[o>>2]>>2]=f;a[(c[o>>2]|0)+4>>0]=119;c[(c[o>>2]|0)+36>>2]=0;c[(c[l>>2]|0)+40>>2]=0;c[(c[l>>2]|0)+44>>2]=0;c[(c[l>>2]|0)+48>>2]=0;c[(c[o>>2]|0)+52>>2]=0;c[(c[o>>2]|0)+56>>2]=0;f=(c[o>>2]|0)+6|0;b[f>>1]=(e[f>>1]|0)&-65;c[(c[(c[l>>2]|0)+52>>2]|0)+56>>2]=c[l>>2];c[(c[l>>2]|0)+60>>2]=0;c[(c[l>>2]|0)+64>>2]=0;c[j>>2]=0;f=c[j>>2]|0;i=n;return f|0}return 0}function br(f,g){f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0;D=i;i=i+160|0;l=D;z=D+148|0;Q=D+144|0;m=D+140|0;k=D+136|0;B=D+132|0;E=D+128|0;r=D+124|0;C=D+120|0;o=D+116|0;h=D+112|0;n=D+108|0;s=D+104|0;t=D+100|0;J=D+96|0;R=D+152|0;O=D+92|0;P=D+88|0;q=D+84|0;p=D+80|0;N=D+76|0;L=D+72|0;v=D+68|0;u=D+64|0;x=D+60|0;w=D+56|0;y=D+52|0;A=D+48|0;j=D+44|0;F=D+40|0;I=D+36|0;G=D+32|0;K=D+24|0;M=D+16|0;H=D+12|0;c[Q>>2]=f;c[m>>2]=g;c[k>>2]=c[(c[Q>>2]|0)+12>>2];c[n>>2]=c[c[k>>2]>>2];b[R>>1]=b[(c[m>>2]|0)+6>>1]|0;f=(c[m>>2]|0)+6|0;b[f>>1]=e[f>>1]|16;if(a[(c[n>>2]|0)+64>>0]|0){c[z>>2]=2;f=c[z>>2]|0;i=D;return f|0}if((c[(c[m>>2]|0)+32>>2]|0)!=0?(e[R>>1]&16|0)==0:0){c[C>>2]=c[(c[m>>2]|0)+32>>2];c[o>>2]=c[c[m>>2]>>2];f=c[k>>2]|0;mo(f,c[(dr(c[m>>2]|0)|0)+68>>2]|0,0);Xp(c[k>>2]|0,c[C>>2]|0);c[B>>2]=0;c[h>>2]=(c[C>>2]|0)+8;a:while(1){if((c[B>>2]|0)>=(c[c[C>>2]>>2]|0)){P=33;break}if(!((d[(c[h>>2]|0)+37>>0]|0)>>>3&1)){g=c[Q>>2]|0;if(c[(c[h>>2]|0)+16>>2]|0){P=10;break}if(er(g,c[h>>2]|0)|0){P=12;break}do if(!(c[(c[h>>2]|0)+16>>2]|0)){if(!(c[(c[h>>2]|0)+8>>2]|0)){c[P>>2]=c[(c[h>>2]|0)+20>>2];oq(c[Q>>2]|0,c[P>>2]|0)|0;f=se(c[n>>2]|0,76,0)|0;c[O>>2]=f;c[(c[h>>2]|0)+16>>2]=f;if(!(c[O>>2]|0)){P=16;break a}b[(c[O>>2]|0)+40>>1]=1;f=c[n>>2]|0;c[l>>2]=c[O>>2];f=Te(f,17384,l)|0;c[c[O>>2]>>2]=f;while(1){if(!(c[(c[P>>2]|0)+52>>2]|0))break;c[P>>2]=c[(c[P>>2]|0)+52>>2]}_p(c[k>>2]|0,c[c[P>>2]>>2]|0,(c[O>>2]|0)+38|0,(c[O>>2]|0)+4|0)|0;b[(c[O>>2]|0)+36>>1]=-1;b[(c[O>>2]|0)+28>>1]=200;f=(c[O>>2]|0)+44|0;a[f>>0]=d[f>>0]|2;break}f=np(c[k>>2]|0,0,c[h>>2]|0)|0;c[O>>2]=f;c[(c[h>>2]|0)+16>>2]=f;if(!(c[O>>2]|0)){P=22;break a}if((e[(c[O>>2]|0)+40>>1]|0)==65535){P=24;break a}f=(c[O>>2]|0)+40|0;b[f>>1]=(b[f>>1]|0)+1<<16>>16;if((c[(c[O>>2]|0)+12>>2]|0)==0?(d[(c[O>>2]|0)+44>>0]&16|0)==0:0)break;if(Qp(c[k>>2]|0,c[O>>2]|0)|0){P=28;break a}f=Wp(c[n>>2]|0,c[(c[O>>2]|0)+12>>2]|0,0)|0;c[(c[h>>2]|0)+20>>2]=f;oq(c[Q>>2]|0,c[(c[h>>2]|0)+20>>2]|0)|0}while(0);if(fr(c[k>>2]|0,c[h>>2]|0)|0){P=31;break}}c[B>>2]=(c[B>>2]|0)+1;c[h>>2]=(c[h>>2]|0)+72}if((P|0)==10){cr(g,c[m>>2]|0);c[z>>2]=1;f=c[z>>2]|0;i=D;return f|0}else if((P|0)==12){c[z>>2]=2;f=c[z>>2]|0;i=D;return f|0}else if((P|0)==16){c[z>>2]=2;f=c[z>>2]|0;i=D;return f|0}else if((P|0)==22){c[z>>2]=2;f=c[z>>2]|0;i=D;return f|0}else if((P|0)==24){f=c[k>>2]|0;c[l>>2]=c[c[O>>2]>>2];Se(f,17400,l);c[(c[h>>2]|0)+16>>2]=0;c[z>>2]=2;f=c[z>>2]|0;i=D;return f|0}else if((P|0)==28){c[z>>2]=2;f=c[z>>2]|0;i=D;return f|0}else if((P|0)==31){c[z>>2]=2;f=c[z>>2]|0;i=D;return f|0}else if((P|0)==33){if((d[(c[n>>2]|0)+64>>0]|0)==0?(gr(c[k>>2]|0,c[m>>2]|0)|0)==0:0){c[r>>2]=0;while(1){if((c[r>>2]|0)>=(c[c[o>>2]>>2]|0))break;c[s>>2]=c[(c[(c[o>>2]|0)+4>>2]|0)+((c[r>>2]|0)*20|0)>>2];if((d[c[s>>2]>>0]|0)==116)break;if((d[c[s>>2]>>0]|0)==122?(d[c[(c[s>>2]|0)+16>>2]>>0]|0)==116:0)break;c[r>>2]=(c[r>>2]|0)+1}if((c[r>>2]|0)<(c[c[o>>2]>>2]|0)){c[q>>2]=c[(c[o>>2]|0)+4>>2];c[p>>2]=0;c[N>>2]=c[(c[c[k>>2]>>2]|0)+24>>2];if(c[N>>2]&32)N=(c[N>>2]&64|0)==0;else N=0;c[L>>2]=N&1;c[r>>2]=0;while(1){if((c[r>>2]|0)>=(c[c[o>>2]>>2]|0))break;c[s>>2]=c[(c[q>>2]|0)+((c[r>>2]|0)*20|0)>>2];c[t>>2]=c[(c[s>>2]|0)+16>>2];do if((d[c[s>>2]>>0]|0)!=116){if((d[c[s>>2]>>0]|0)==122?(d[c[t>>2]>>0]|0)==116:0){P=53;break}c[p>>2]=eo(c[k>>2]|0,c[p>>2]|0,c[(c[q>>2]|0)+((c[r>>2]|0)*20|0)>>2]|0)|0;if(c[p>>2]|0){c[(c[(c[p>>2]|0)+4>>2]|0)+(((c[c[p>>2]>>2]|0)-1|0)*20|0)+4>>2]=c[(c[q>>2]|0)+((c[r>>2]|0)*20|0)+4>>2];c[(c[(c[p>>2]|0)+4>>2]|0)+(((c[c[p>>2]>>2]|0)-1|0)*20|0)+8>>2]=c[(c[q>>2]|0)+((c[r>>2]|0)*20|0)+8>>2];c[(c[q>>2]|0)+((c[r>>2]|0)*20|0)+4>>2]=0;c[(c[q>>2]|0)+((c[r>>2]|0)*20|0)+8>>2]=0}c[(c[q>>2]|0)+((c[r>>2]|0)*20|0)>>2]=0}else P=53;while(0);do if((P|0)==53){P=0;c[v>>2]=0;c[u>>2]=0;if((d[c[s>>2]>>0]|0)==122)c[u>>2]=c[(c[(c[s>>2]|0)+12>>2]|0)+8>>2];c[B>>2]=0;c[h>>2]=(c[C>>2]|0)+8;while(1){if((c[B>>2]|0)>=(c[c[C>>2]>>2]|0))break;c[x>>2]=c[(c[h>>2]|0)+16>>2];c[w>>2]=c[(c[h>>2]|0)+20>>2];c[y>>2]=c[(c[h>>2]|0)+12>>2];c[A>>2]=0;if(!(c[y>>2]|0))c[y>>2]=c[c[x>>2]>>2];if(a[(c[n>>2]|0)+64>>0]|0)break;if((c[w>>2]|0)!=0?(e[(c[w>>2]|0)+6>>1]&512|0)!=0:0)P=67;else P=62;do if((P|0)==62){P=0;c[w>>2]=0;if((c[u>>2]|0)!=0?(xc(c[u>>2]|0,c[y>>2]|0)|0)!=0:0)break;c[j>>2]=Ve(c[n>>2]|0,c[(c[x>>2]|0)+68>>2]|0)|0;if((c[j>>2]|0)>=0)N=c[(c[(c[n>>2]|0)+16>>2]|0)+(c[j>>2]<<4)>>2]|0;else N=17440;c[A>>2]=N;P=67}while(0);b:do if((P|0)==67){P=0;c[E>>2]=0;while(1){if((c[E>>2]|0)>=(b[(c[x>>2]|0)+38>>1]|0))break b;c[F>>2]=c[(c[(c[x>>2]|0)+4>>2]|0)+((c[E>>2]|0)*24|0)>>2];if(!((c[u>>2]|0)!=0&(c[w>>2]|0)!=0?(Xq(c[(c[(c[c[w>>2]>>2]|0)+4>>2]|0)+((c[E>>2]|0)*20|0)+8>>2]|0,0,c[u>>2]|0,0)|0)==0:0))P=71;do if((P|0)==71){P=0;if(d[(c[(c[x>>2]|0)+4>>2]|0)+((c[E>>2]|0)*24|0)+23>>0]&2)break;c[v>>2]=1;if((c[B>>2]|0)>0&(c[u>>2]|0)==0){if((d[(c[h>>2]|0)+36>>0]&4|0)!=0?(hr(c[C>>2]|0,c[B>>2]|0,c[F>>2]|0,0,0)|0)!=0:0)break;if((ir(c[(c[h>>2]|0)+48>>2]|0,c[F>>2]|0)|0)>=0)break}c[t>>2]=ho(c[n>>2]|0,27,c[F>>2]|0)|0;c[I>>2]=c[F>>2];c[G>>2]=0;do if(c[L>>2]|0)P=78;else{if((c[c[C>>2]>>2]|0)>1){P=78;break}c[J>>2]=c[t>>2]}while(0);do if((P|0)==78){P=0;c[M>>2]=ho(c[n>>2]|0,27,c[y>>2]|0)|0;c[J>>2]=Rn(c[k>>2]|0,122,c[M>>2]|0,c[t>>2]|0,0)|0;if(c[A>>2]|0){c[M>>2]=ho(c[n>>2]|0,27,c[A>>2]|0)|0;c[J>>2]=Rn(c[k>>2]|0,122,c[M>>2]|0,c[J>>2]|0,0)|0}if(!(c[L>>2]|0))break;f=c[n>>2]|0;R=c[F>>2]|0;c[l>>2]=c[y>>2];c[l+4>>2]=R;c[I>>2]=Te(f,17448,l)|0;c[G>>2]=c[I>>2]}while(0);c[p>>2]=eo(c[k>>2]|0,c[p>>2]|0,c[J>>2]|0)|0;c[K>>2]=c[I>>2];c[K+4>>2]=Mb(c[I>>2]|0)|0;fo(c[k>>2]|0,c[p>>2]|0,K,0);do if(c[p>>2]|0){if(!(e[(c[m>>2]|0)+6>>1]&512))break;c[H>>2]=(c[(c[p>>2]|0)+4>>2]|0)+(((c[c[p>>2]>>2]|0)-1|0)*20|0);N=c[n>>2]|0;if(c[w>>2]|0){f=ne(N,c[(c[(c[c[w>>2]>>2]|0)+4>>2]|0)+((c[E>>2]|0)*20|0)+8>>2]|0)|0;c[(c[H>>2]|0)+8>>2]=f}else{R=c[y>>2]|0;f=c[I>>2]|0;c[l>>2]=c[A>>2];c[l+4>>2]=R;c[l+8>>2]=f;f=Te(N,17456,l)|0;c[(c[H>>2]|0)+8>>2]=f}f=(c[H>>2]|0)+13|0;a[f>>0]=a[f>>0]&-3|2}while(0);Xb(c[n>>2]|0,c[G>>2]|0)}while(0);c[E>>2]=(c[E>>2]|0)+1}}while(0);c[B>>2]=(c[B>>2]|0)+1;c[h>>2]=(c[h>>2]|0)+72}if(!(c[v>>2]|0)){N=c[k>>2]|0;if(c[u>>2]|0){c[l>>2]=c[u>>2];Se(N,17472,l);break}else{Se(N,17496,l);break}}}while(0);c[r>>2]=(c[r>>2]|0)+1}sn(c[n>>2]|0,c[o>>2]|0);c[c[m>>2]>>2]=c[p>>2]}if((c[c[m>>2]>>2]|0)!=0?(c[c[c[m>>2]>>2]>>2]|0)>(c[(c[n>>2]|0)+96>>2]|0):0)Se(c[k>>2]|0,17520,l);c[z>>2]=0;f=c[z>>2]|0;i=D;return f|0}c[z>>2]=2;f=c[z>>2]|0;i=D;return f|0}}c[z>>2]=1;f=c[z>>2]|0;i=D;return f|0}function cr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;h=d+12|0;g=d+8|0;f=d+4|0;e=d;c[h>>2]=a;c[g>>2]=b;c[f>>2]=c[(c[h>>2]|0)+12>>2];c[e>>2]=c[(dr(c[g>>2]|0)|0)+68>>2];if(!(c[e>>2]|0)){i=d;return}c[(c[f>>2]|0)+532>>2]=c[(c[e>>2]|0)+4>>2];i=d;return}function dr(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;while(1){a=c[d>>2]|0;if(!(c[(c[d>>2]|0)+56>>2]|0))break;c[d>>2]=c[a+56>>2]}i=b;return a|0}function er(f,g){f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;o=i;i=i+80|0;r=o;n=o+72|0;l=o+68|0;y=o+64|0;k=o+60|0;z=o+56|0;j=o+52|0;u=o+48|0;q=o+44|0;t=o+40|0;m=o+36|0;p=o+32|0;s=o+28|0;h=o+24|0;x=o+20|0;w=o+16|0;v=o+12|0;c[l>>2]=f;c[y>>2]=g;c[k>>2]=c[(c[l>>2]|0)+12>>2];c[z>>2]=c[c[k>>2]>>2];c[j>>2]=vr(c[(c[k>>2]|0)+532>>2]|0,c[y>>2]|0,u)|0;if(c[j>>2]|0){if(c[(c[j>>2]|0)+12>>2]|0){z=c[k>>2]|0;f=c[(c[j>>2]|0)+12>>2]|0;c[r>>2]=c[c[j>>2]>>2];Se(z,f,r);c[n>>2]=1;f=c[n>>2]|0;i=o;return f|0}f=se(c[z>>2]|0,76,0)|0;c[q>>2]=f;c[(c[y>>2]|0)+16>>2]=f;if(!(c[q>>2]|0)){c[n>>2]=2;f=c[n>>2]|0;i=o;return f|0}b[(c[q>>2]|0)+40>>1]=1;f=ne(c[z>>2]|0,c[c[j>>2]>>2]|0)|0;c[c[q>>2]>>2]=f;b[(c[q>>2]|0)+36>>1]=-1;b[(c[q>>2]|0)+28>>1]=200;f=(c[q>>2]|0)+44|0;a[f>>0]=d[f>>0]|2;f=Wp(c[z>>2]|0,c[(c[j>>2]|0)+8>>2]|0,0)|0;c[(c[y>>2]|0)+20>>2]=f;if(a[(c[z>>2]|0)+64>>0]|0){c[n>>2]=7;f=c[n>>2]|0;i=o;return f|0}c[m>>2]=c[(c[y>>2]|0)+20>>2];if((d[(c[m>>2]|0)+4>>0]|0)==116)g=1;else g=(d[(c[m>>2]|0)+4>>0]|0)==115;c[s>>2]=g&1;a:do if(c[s>>2]|0){c[w>>2]=c[(c[(c[y>>2]|0)+20>>2]|0)+32>>2];c[x>>2]=0;while(1){if((c[x>>2]|0)>=(c[c[w>>2]>>2]|0))break a;c[v>>2]=(c[w>>2]|0)+8+((c[x>>2]|0)*72|0);if(((c[(c[v>>2]|0)+4>>2]|0)==0?(c[(c[v>>2]|0)+8>>2]|0)!=0:0)?0==(xc(c[(c[v>>2]|0)+8>>2]|0,c[c[j>>2]>>2]|0)|0):0){c[(c[v>>2]|0)+16>>2]=c[q>>2];f=(c[v>>2]|0)+37|0;a[f>>0]=a[f>>0]&-9|8;f=(c[q>>2]|0)+40|0;b[f>>1]=(b[f>>1]|0)+1<<16>>16;f=(c[m>>2]|0)+6|0;b[f>>1]=e[f>>1]|2048}c[x>>2]=(c[x>>2]|0)+1}}while(0);if((e[(c[q>>2]|0)+40>>1]|0)>2){f=c[k>>2]|0;c[r>>2]=c[c[j>>2]>>2];Se(f,17752,r);c[n>>2]=1;f=c[n>>2]|0;i=o;return f|0}c[(c[j>>2]|0)+12>>2]=17800;c[h>>2]=c[(c[k>>2]|0)+532>>2];c[(c[k>>2]|0)+532>>2]=c[u>>2];u=c[m>>2]|0;if(c[s>>2]|0)u=c[u+52>>2]|0;oq(c[l>>2]|0,u)|0;c[p>>2]=c[m>>2];while(1){u=c[p>>2]|0;if(!(c[(c[p>>2]|0)+52>>2]|0))break;c[p>>2]=c[u+52>>2]}c[t>>2]=c[u>>2];do if(c[(c[j>>2]|0)+4>>2]|0){if((c[c[t>>2]>>2]|0)==(c[c[(c[j>>2]|0)+4>>2]>>2]|0)){c[t>>2]=c[(c[j>>2]|0)+4>>2];break}f=c[k>>2]|0;g=c[c[t>>2]>>2]|0;z=c[c[(c[j>>2]|0)+4>>2]>>2]|0;c[r>>2]=c[c[j>>2]>>2];c[r+4>>2]=g;c[r+8>>2]=z;Se(f,17824,r);c[(c[k>>2]|0)+532>>2]=c[h>>2];c[n>>2]=1;f=c[n>>2]|0;i=o;return f|0}while(0);_p(c[k>>2]|0,c[t>>2]|0,(c[q>>2]|0)+38|0,(c[q>>2]|0)+4|0)|0;if(c[s>>2]|0){p=(c[j>>2]|0)+12|0;if(e[(c[m>>2]|0)+6>>1]&2048)c[p>>2]=17864;else c[p>>2]=17904;oq(c[l>>2]|0,c[m>>2]|0)|0}c[(c[j>>2]|0)+12>>2]=0;c[(c[k>>2]|0)+532>>2]=c[h>>2]}c[n>>2]=0;f=c[n>>2]|0;i=o;return f|0}function fr(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+32|0;l=f;e=f+28|0;j=f+24|0;h=f+20|0;m=f+16|0;k=f+12|0;g=f+8|0;c[j>>2]=b;c[h>>2]=d;do if((c[(c[h>>2]|0)+16>>2]|0)!=0?(c[(c[h>>2]|0)+64>>2]|0)!=0:0){c[m>>2]=c[(c[h>>2]|0)+16>>2];c[k>>2]=c[(c[h>>2]|0)+64>>2];c[g>>2]=c[(c[m>>2]|0)+8>>2];while(1){if(!(c[g>>2]|0))break;if(!(xc(c[c[g>>2]>>2]|0,c[k>>2]|0)|0))break;c[g>>2]=c[(c[g>>2]|0)+20>>2]}if(c[g>>2]|0){c[(c[h>>2]|0)+68>>2]=c[g>>2];break}b=c[j>>2]|0;c[l>>2]=c[k>>2];c[l+4>>2]=0;Se(b,17728,l);a[(c[j>>2]|0)+17>>0]=1;c[e>>2]=1;b=c[e>>2]|0;i=f;return b|0}while(0);c[e>>2]=0;b=c[e>>2]|0;i=f;return b|0}function gr(a,e){a=a|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;f=i;i=i+80|0;h=f;j=f+76|0;g=f+72|0;l=f+68|0;m=f+64|0;p=f+60|0;q=f+56|0;v=f+52|0;x=f+48|0;w=f+44|0;s=f+40|0;r=f+36|0;t=f+32|0;n=f+28|0;o=f+24|0;u=f+20|0;k=f+16|0;z=f+12|0;A=f+8|0;y=f+4|0;c[g>>2]=a;c[l>>2]=e;c[m>>2]=c[(c[l>>2]|0)+32>>2];c[v>>2]=(c[m>>2]|0)+8;c[x>>2]=(c[v>>2]|0)+72;c[p>>2]=0;a:while(1){if((c[p>>2]|0)>=((c[c[m>>2]>>2]|0)-1|0)){l=28;break}c[w>>2]=c[(c[v>>2]|0)+16>>2];c[s>>2]=c[(c[x>>2]|0)+16>>2];b:do if(!((c[w>>2]|0)==0|(c[s>>2]|0)==0)){c[r>>2]=(d[(c[x>>2]|0)+36>>0]&32|0)!=0&1;c:do if(d[(c[x>>2]|0)+36>>0]&4){if(c[(c[x>>2]|0)+44>>2]|0){l=7;break a}if(c[(c[x>>2]|0)+48>>2]|0){l=7;break a}c[q>>2]=0;while(1){if((c[q>>2]|0)>=(b[(c[s>>2]|0)+38>>1]|0))break c;c[t>>2]=c[(c[(c[s>>2]|0)+4>>2]|0)+((c[q>>2]|0)*24|0)>>2];if(hr(c[m>>2]|0,(c[p>>2]|0)+1|0,c[t>>2]|0,n,o)|0)kr(c[g>>2]|0,c[m>>2]|0,c[n>>2]|0,c[o>>2]|0,(c[p>>2]|0)+1|0,c[q>>2]|0,c[r>>2]|0,(c[l>>2]|0)+36|0);c[q>>2]=(c[q>>2]|0)+1}}while(0);if((c[(c[x>>2]|0)+44>>2]|0)!=0?(c[(c[x>>2]|0)+48>>2]|0)!=0:0){l=15;break a}if(c[(c[x>>2]|0)+44>>2]|0){if(c[r>>2]|0)lr(c[(c[x>>2]|0)+44>>2]|0,c[(c[x>>2]|0)+40>>2]|0);a=mr(c[c[g>>2]>>2]|0,c[(c[l>>2]|0)+36>>2]|0,c[(c[x>>2]|0)+44>>2]|0)|0;c[(c[l>>2]|0)+36>>2]=a;c[(c[x>>2]|0)+44>>2]=0}if(c[(c[x>>2]|0)+48>>2]|0){c[u>>2]=c[(c[x>>2]|0)+48>>2];c[q>>2]=0;while(1){if((c[q>>2]|0)>=(c[(c[u>>2]|0)+4>>2]|0))break b;c[k>>2]=c[(c[c[u>>2]>>2]|0)+(c[q>>2]<<3)>>2];c[y>>2]=jr(c[s>>2]|0,c[k>>2]|0)|0;if((c[y>>2]|0)<0){l=25;break a}if(!(hr(c[m>>2]|0,(c[p>>2]|0)+1|0,c[k>>2]|0,z,A)|0)){l=25;break a}kr(c[g>>2]|0,c[m>>2]|0,c[z>>2]|0,c[A>>2]|0,(c[p>>2]|0)+1|0,c[y>>2]|0,c[r>>2]|0,(c[l>>2]|0)+36|0);c[q>>2]=(c[q>>2]|0)+1}}}while(0);c[p>>2]=(c[p>>2]|0)+1;c[x>>2]=(c[x>>2]|0)+72;c[v>>2]=(c[v>>2]|0)+72}if((l|0)==7){a=c[g>>2]|0;c[h>>2]=0;Se(a,17552,h);c[j>>2]=1;a=c[j>>2]|0;i=f;return a|0}else if((l|0)==15){Se(c[g>>2]|0,17608,h);c[j>>2]=1;a=c[j>>2]|0;i=f;return a|0}else if((l|0)==25){a=c[g>>2]|0;c[h>>2]=c[k>>2];Se(a,17664,h);c[j>>2]=1;a=c[j>>2]|0;i=f;return a|0}else if((l|0)==28){c[j>>2]=0;a=c[j>>2]|0;i=f;return a|0}return 0}function hr(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;j=i;i=i+32|0;o=j+28|0;g=j+24|0;q=j+20|0;p=j+16|0;l=j+12|0;n=j+8|0;k=j+4|0;m=j;c[g>>2]=a;c[q>>2]=b;c[p>>2]=d;c[l>>2]=e;c[n>>2]=f;c[k>>2]=0;while(1){if((c[k>>2]|0)>=(c[q>>2]|0)){h=8;break}c[m>>2]=jr(c[(c[g>>2]|0)+8+((c[k>>2]|0)*72|0)+16>>2]|0,c[p>>2]|0)|0;if((c[m>>2]|0)>=0)break;c[k>>2]=(c[k>>2]|0)+1}if((h|0)==8){c[o>>2]=0;a=c[o>>2]|0;i=j;return a|0}if(c[l>>2]|0){c[c[l>>2]>>2]=c[k>>2];c[c[n>>2]>>2]=c[m>>2]}c[o>>2]=1;a=c[o>>2]|0;i=j;return a|0}function ir(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;e=d+12|0;f=d+8|0;h=d+4|0;g=d;c[f>>2]=a;c[h>>2]=b;if(!(c[f>>2]|0)){c[e>>2]=-1;a=c[e>>2]|0;i=d;return a|0}c[g>>2]=0;while(1){if((c[g>>2]|0)>=(c[(c[f>>2]|0)+4>>2]|0)){f=8;break}a=(xc(c[(c[c[f>>2]>>2]|0)+(c[g>>2]<<3)>>2]|0,c[h>>2]|0)|0)==0;b=c[g>>2]|0;if(a){f=6;break}c[g>>2]=b+1}if((f|0)==6){c[e>>2]=b;a=c[e>>2]|0;i=d;return a|0}else if((f|0)==8){c[e>>2]=-1;a=c[e>>2]|0;i=d;return a|0}return 0}function jr(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;f=i;i=i+16|0;e=f+12|0;g=f+8|0;j=f+4|0;h=f;c[g>>2]=a;c[j>>2]=d;c[h>>2]=0;while(1){if((c[h>>2]|0)>=(b[(c[g>>2]|0)+38>>1]|0)){g=6;break}a=(xc(c[(c[(c[g>>2]|0)+4>>2]|0)+((c[h>>2]|0)*24|0)>>2]|0,c[j>>2]|0)|0)==0;d=c[h>>2]|0;if(a){g=4;break}c[h>>2]=d+1}if((g|0)==4){c[e>>2]=d;a=c[e>>2]|0;i=f;return a|0}else if((g|0)==6){c[e>>2]=-1;a=c[e>>2]|0;i=f;return a|0}return 0}function kr(a,d,e,f,g,h,j,k){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;p=i;i=i+48|0;s=p+44|0;v=p+40|0;x=p+36|0;w=p+32|0;u=p+28|0;t=p+24|0;q=p+20|0;l=p+16|0;n=p+12|0;r=p+8|0;o=p+4|0;m=p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==0?(nr(c[k>>2]|0)|0)==0:0){c[h>>2]=or(c[g>>2]|0,72,0,0)|0;pr(c[g>>2]|0,c[h>>2]|0,c[e>>2]|0,c[k>>2]|0);c[f>>2]=c[h>>2];a=c[f>>2]|0;i=j;return a|0}wn(c[g>>2]|0,c[e>>2]|0);wn(c[g>>2]|0,c[k>>2]|0);c[f>>2]=or(c[g>>2]|0,132,10152,0)|0;a=c[f>>2]|0;i=j;return a|0}function nr(a){a=a|0;var b=0,d=0,e=0,f=0;d=i;i=i+16|0;b=d+8|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=0;do if(!(c[(c[f>>2]|0)+4>>2]&1))if(yq(c[f>>2]|0,e)|0){c[b>>2]=(c[e>>2]|0)==0&1;break}else{c[b>>2]=0;break}else c[b>>2]=0;while(0);i=d;return c[b>>2]|0}function or(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;j=i;i=i+32|0;q=j+28|0;p=j+24|0;l=j+20|0;n=j+16|0;o=j+12|0;h=j+8|0;k=j+4|0;m=j;c[q>>2]=d;c[p>>2]=e;c[l>>2]=f;c[n>>2]=g;c[h>>2]=0;c[k>>2]=0;do if(c[l>>2]|0){if(((c[p>>2]|0)==132?(c[c[l>>2]>>2]|0)!=0:0)?(Ag(c[c[l>>2]>>2]|0,k)|0)!=0:0)break;c[h>>2]=(c[(c[l>>2]|0)+4>>2]|0)+1}while(0);c[o>>2]=se(c[q>>2]|0,48+(c[h>>2]|0)|0,0)|0;if(!(c[o>>2]|0)){d=c[o>>2]|0;i=j;return d|0}a[c[o>>2]>>0]=c[p>>2];b[(c[o>>2]|0)+34>>1]=-1;do if(c[l>>2]|0){g=c[o>>2]|0;if(!(c[h>>2]|0)){d=g+4|0;c[d>>2]=c[d>>2]|1024;c[(c[o>>2]|0)+8>>2]=c[k>>2];break}c[(c[o>>2]|0)+8>>2]=g+48;if(c[(c[l>>2]|0)+4>>2]|0)dF(c[(c[o>>2]|0)+8>>2]|0,c[c[l>>2]>>2]|0,c[(c[l>>2]|0)+4>>2]|0)|0;a[(c[(c[o>>2]|0)+8>>2]|0)+(c[(c[l>>2]|0)+4>>2]|0)>>0]=0;if(((c[n>>2]|0)!=0&(c[h>>2]|0)>=3?(d=a[c[c[l>>2]>>2]>>0]|0,c[m>>2]=d,(d|0)==39|(c[m>>2]|0)==34|(c[m>>2]|0)==91|(c[m>>2]|0)==96):0)?(sm(c[(c[o>>2]|0)+8>>2]|0)|0,(c[m>>2]|0)==34):0){d=(c[o>>2]|0)+4|0;c[d>>2]=c[d>>2]|64}}while(0);c[(c[o>>2]|0)+24>>2]=1;d=c[o>>2]|0;i=j;return d|0}function pr(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;h=f+12|0;k=f+8|0;j=f+4|0;g=f;c[h>>2]=a;c[k>>2]=b;c[j>>2]=d;c[g>>2]=e;if(!(c[k>>2]|0)){wn(c[h>>2]|0,c[j>>2]|0);wn(c[h>>2]|0,c[g>>2]|0);i=f;return}if(c[g>>2]|0){c[(c[k>>2]|0)+16>>2]=c[g>>2];a=(c[k>>2]|0)+4|0;c[a>>2]=c[a>>2]|256&c[(c[g>>2]|0)+4>>2]}if(c[j>>2]|0){c[(c[k>>2]|0)+12>>2]=c[j>>2];a=(c[k>>2]|0)+4|0;c[a>>2]=c[a>>2]|256&c[(c[j>>2]|0)+4>>2]}qr(c[k>>2]|0);i=f;return}function qr(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b+4|0;e=b;c[d>>2]=a;c[e>>2]=0;rr(c[(c[d>>2]|0)+12>>2]|0,e);rr(c[(c[d>>2]|0)+16>>2]|0,e);a=(c[d>>2]|0)+20|0;if(c[(c[d>>2]|0)+4>>2]&2048)sr(c[a>>2]|0,e);else tr(c[a>>2]|0,e);c[(c[d>>2]|0)+24>>2]=(c[e>>2]|0)+1;i=b;return}function rr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[e>>2]|0)){i=d;return}if((c[(c[e>>2]|0)+24>>2]|0)<=(c[c[f>>2]>>2]|0)){i=d;return}c[c[f>>2]>>2]=c[(c[e>>2]|0)+24>>2];i=d;return}function sr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[e>>2]|0)){i=d;return}rr(c[(c[e>>2]|0)+36>>2]|0,c[f>>2]|0);rr(c[(c[e>>2]|0)+44>>2]|0,c[f>>2]|0);rr(c[(c[e>>2]|0)+60>>2]|0,c[f>>2]|0);rr(c[(c[e>>2]|0)+64>>2]|0,c[f>>2]|0);tr(c[c[e>>2]>>2]|0,c[f>>2]|0);tr(c[(c[e>>2]|0)+40>>2]|0,c[f>>2]|0);tr(c[(c[e>>2]|0)+48>>2]|0,c[f>>2]|0);sr(c[(c[e>>2]|0)+52>>2]|0,c[f>>2]|0);i=d;return}function tr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;f=d+8|0;g=d+4|0;e=d;c[f>>2]=a;c[g>>2]=b;if(!(c[f>>2]|0)){i=d;return}c[e>>2]=0;while(1){if((c[e>>2]|0)>=(c[c[f>>2]>>2]|0))break;rr(c[(c[(c[f>>2]|0)+4>>2]|0)+((c[e>>2]|0)*20|0)>>2]|0,c[g>>2]|0);c[e>>2]=(c[e>>2]|0)+1}i=d;return}function ur(a,d,e,f){a=a|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;g=i;i=i+32|0;n=g+20|0;l=g+16|0;m=g+12|0;j=g+8|0;h=g+4|0;k=g;c[n>>2]=a;c[l>>2]=d;c[m>>2]=e;c[j>>2]=f;c[h>>2]=or(c[n>>2]|0,154,0,0)|0;if(!(c[h>>2]|0)){n=c[h>>2]|0;i=g;return n|0}c[k>>2]=(c[l>>2]|0)+8+((c[m>>2]|0)*72|0);c[(c[h>>2]|0)+44>>2]=c[(c[k>>2]|0)+16>>2];c[(c[h>>2]|0)+28>>2]=c[(c[k>>2]|0)+40>>2];if((b[(c[(c[h>>2]|0)+44>>2]|0)+36>>1]|0)==(c[j>>2]|0))b[(c[h>>2]|0)+32>>1]=-1;else{b[(c[h>>2]|0)+32>>1]=c[j>>2];d=$E(1,0,((c[j>>2]|0)>=64?63:c[j>>2]|0)|0)|0;n=(c[k>>2]|0)+56|0;e=n;a=c[e+4>>2]|D;c[n>>2]=c[e>>2]|d;c[n+4>>2]=a}n=(c[h>>2]|0)+4|0;c[n>>2]=c[n>>2]|4;n=c[h>>2]|0;i=g;return n|0}function vr(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+32|0;j=f+24|0;l=f+20|0;m=f+16|0;k=f+12|0;e=f+8|0;h=f+4|0;g=f;c[l>>2]=a;c[m>>2]=b;c[k>>2]=d;a:do if((c[(c[m>>2]|0)+4>>2]|0)==0?(a=c[(c[m>>2]|0)+8>>2]|0,c[e>>2]=a,(a|0)!=0):0){c[h>>2]=c[l>>2];b:while(1){if(!(c[h>>2]|0))break a;c[g>>2]=0;while(1){if((c[g>>2]|0)>=(c[c[h>>2]>>2]|0))break;if(!(xc(c[e>>2]|0,c[(c[h>>2]|0)+8+(c[g>>2]<<4)>>2]|0)|0))break b;c[g>>2]=(c[g>>2]|0)+1}c[h>>2]=c[(c[h>>2]|0)+4>>2]}c[c[k>>2]>>2]=c[h>>2];c[j>>2]=(c[h>>2]|0)+8+(c[g>>2]<<4);a=c[j>>2]|0;i=f;return a|0}while(0);c[j>>2]=0;a=c[j>>2]|0;i=f;return a|0}function wr(e,f,g){e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;o=i;i=i+48|0;n=o+36|0;p=o+32|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c[n>>2]|0)==7)a[(c[m>>2]|0)+64>>0]=1;a:do if(!(c[n>>2]|0)){if(c[(c[q>>2]|0)+8>>2]|0){e=c[(c[q>>2]|0)+8>>2]|0;c[e+0>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;c[c[(c[q>>2]|0)+8>>2]>>2]=c[c[B>>2]>>2];c[(c[q>>2]|0)+12>>2]=1;if(c[C+4>>2]|0){c[D>>2]=18e3;f=c[m>>2]|0;e=c[D>>2]|0;c[o>>2]=c[c[u>>2]>>2];e=Te(f,e,o)|0;c[c[p>>2]>>2]=e;Nk(c[q>>2]|0);c[n>>2]=1;break}c[(c[q>>2]|0)+24>>2]=c[(c[u>>2]|0)+60>>2];c[(c[u>>2]|0)+60>>2]=c[q>>2];c[t>>2]=0;while(1){if((c[t>>2]|0)>=(b[(c[u>>2]|0)+38>>1]|0))break a;c[v>>2]=c[(c[(c[u>>2]|0)+4>>2]|0)+((c[t>>2]|0)*24|0)+12>>2];c[w>>2]=0;if(c[v>>2]|0){c[z>>2]=Mb(c[v>>2]|0)|0;if(!(Lb(18048,c[v>>2]|0,6)|0)){if((a[(c[v>>2]|0)+6>>0]|0)!=0?(a[(c[v>>2]|0)+6>>0]|0)!=32:0)A=21}else A=21;b:do if((A|0)==21){A=0;c[w>>2]=0;while(1){if((c[w>>2]|0)>=(c[z>>2]|0))break b;if(!(Lb(18056,(c[v>>2]|0)+(c[w>>2]|0)|0,7)|0)){if(!(a[(c[v>>2]|0)+((c[w>>2]|0)+7)>>0]|0))break;if((a[(c[v>>2]|0)+((c[w>>2]|0)+7)>>0]|0)==32)break}c[w>>2]=(c[w>>2]|0)+1}c[w>>2]=(c[w>>2]|0)+1}while(0);if((c[w>>2]|0)<(c[z>>2]|0)){c[x>>2]=6+((a[(c[v>>2]|0)+((c[w>>2]|0)+6)>>0]|0)!=0?1:0);c[y>>2]=c[w>>2];while(1){if(((c[y>>2]|0)+(c[x>>2]|0)|0)>(c[z>>2]|0))break;a[(c[v>>2]|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>>2]|0)){i=r;return}c[h>>2]=(c[(c[v>>2]|0)+16>>2]|0)+(c[n>>2]<<4);c[j>>2]=0;while(1){if((c[j>>2]|0)>=3)break;c[q>>2]=c[18368+(c[j>>2]<<3)>>2];b=sp(c[v>>2]|0,c[q>>2]|0,c[c[h>>2]>>2]|0)|0;c[t>>2]=b;do if(!b){if(c[18372+(c[j>>2]<<3)>>2]|0){b=c[p>>2]|0;e=c[q>>2]|0;d=c[18372+(c[j>>2]<<3)>>2]|0;c[s>>2]=c[c[h>>2]>>2];c[s+4>>2]=e;c[s+8>>2]=d;cp(b,18456,s);c[m+(c[j>>2]<<2)>>2]=c[(c[p>>2]|0)+388>>2];a[o+(c[j>>2]|0)>>0]=2}}else{c[m+(c[j>>2]<<2)>>2]=c[(c[t>>2]|0)+32>>2];a[o+(c[j>>2]|0)>>0]=0;Jr(c[p>>2]|0,c[n>>2]|0,c[m+(c[j>>2]<<2)>>2]|0,1,c[q>>2]|0);if(c[u>>2]|0){b=c[p>>2]|0;f=c[q>>2]|0;e=c[w>>2]|0;d=c[u>>2]|0;c[s>>2]=c[c[h>>2]>>2];c[s+4>>2]=f;c[s+8>>2]=e;c[s+12>>2]=d;cp(b,18480,s);break}else{fp(c[k>>2]|0,118,c[m+(c[j>>2]<<2)>>2]|0,c[n>>2]|0)|0;break}}while(0);c[j>>2]=(c[j>>2]|0)+1}c[j>>2]=0;while(1){if(!(c[18372+(c[j>>2]<<3)>>2]|0))break;We(c[k>>2]|0,55,(c[l>>2]|0)+(c[j>>2]|0)|0,c[m+(c[j>>2]<<2)>>2]|0,c[n>>2]|0,3)|0;Xe(c[k>>2]|0,a[o+(c[j>>2]|0)>>0]|0);c[j>>2]=(c[j>>2]|0)+1}i=r;return}function Gr(b,f,g,h,j,k){b=b|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E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c[o>>2];i=k;return}else{c[q>>2]=0;a[(c[c[p>>2]>>2]|0)+64>>0]=1;i=k;return}}function Kr(a,e,f,g,h){a=a|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;o=i;i=i+32|0;q=o+24|0;m=o+20|0;l=o+16|0;k=o+12|0;n=o+8|0;j=o+4|0;p=o;c[q>>2]=a;c[m>>2]=e;c[l>>2]=f;c[k>>2]=g;c[n>>2]=h;c[j>>2]=dp(c[q>>2]|0)|0;Jr(c[q>>2]|0,c[l>>2]|0,c[(c[k>>2]|0)+32>>2]|0,((c[n>>2]|0)==55?1:0)&255,c[c[k>>2]>>2]|0);if(!(d[(c[k>>2]|0)+44>>0]&32)){We(c[j>>2]|0,c[n>>2]|0,c[m>>2]|0,c[(c[k>>2]|0)+32>>2]|0,c[l>>2]|0,b[(c[k>>2]|0)+38>>1]|0)|0;i=o;return}else{c[p>>2]=Zr(c[k>>2]|0)|0;ip(c[j>>2]|0,c[n>>2]|0,c[m>>2]|0,c[(c[p>>2]|0)+44>>2]|0,c[l>>2]|0)|0;Lr(c[q>>2]|0,c[p>>2]|0);i=o;return}}function Lr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;f=d+8|0;e=d+4|0;g=d;c[f>>2]=a;c[e>>2]=b;c[g>>2]=c[(c[f>>2]|0)+8>>2];a=c[g>>2]|0;bf(a,-1,Wr(c[f>>2]|0,c[e>>2]|0)|0,-6);i=d;return}function Mr(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return c[(c[b>>2]|0)+32>>2]|0}function Nr(a){a=a|0;var b=0,d=0,e=0,f=0;d=i;i=i+16|0;f=d+8|0;e=d+4|0;b=d;c[f>>2]=a;c[e>>2]=c[(c[f>>2]|0)+24>>2];f=(c[e>>2]|0)+108|0;a=c[f>>2]|0;c[f>>2]=a+1;c[b>>2]=a;if(!(c[b>>2]&(c[b>>2]|0)-1)){f=Ek(c[c[e>>2]>>2]|0,c[(c[e>>2]|0)+112>>2]|0,(c[b>>2]<<1)+1<<2,0)|0;c[(c[e>>2]|0)+112>>2]=f}if(!(c[(c[e>>2]|0)+112>>2]|0)){f=c[b>>2]|0;f=-1-f|0;i=d;return f|0}c[(c[(c[e>>2]|0)+112>>2]|0)+(c[b>>2]<<2)>>2]=-1;f=c[b>>2]|0;f=-1-f|0;i=d;return f|0}function Or(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+32|0;h=f+12|0;k=f+8|0;m=f+4|0;j=f+17|0;l=f+16|0;g=f;c[h>>2]=b;c[k>>2]=e;c[m>>2]=c[c[h>>2]>>2];a[j>>0]=a[(c[(c[(c[m>>2]|0)+16>>2]|0)+12>>2]|0)+77>>0]|0;a[l>>0]=a[(c[m>>2]|0)+145>>0]|0;c[g>>2]=$g(c[m>>2]|0,a[j>>0]|0,c[k>>2]|0,d[l>>0]|0)|0;if(a[l>>0]|0){m=c[g>>2]|0;i=f;return m|0}if((c[g>>2]|0)!=0?(c[(c[g>>2]|0)+12>>2]|0)!=0:0){m=c[g>>2]|0;i=f;return m|0}c[g>>2]=eq(c[h>>2]|0,a[j>>0]|0,c[g>>2]|0,c[k>>2]|0)|0;m=c[g>>2]|0;i=f;return m|0}function Pr(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;f=d+12|0;h=d+8|0;e=d+4|0;g=d;c[f>>2]=a;c[h>>2]=b;c[e>>2]=c[(c[f>>2]|0)+24>>2];c[g>>2]=-1-(c[h>>2]|0);if((c[g>>2]|0)>=0?(c[(c[e>>2]|0)+112>>2]|0)!=0:0)c[(c[(c[e>>2]|0)+112>>2]|0)+(c[g>>2]<<2)>>2]=c[(c[f>>2]|0)+32>>2];c[(c[e>>2]|0)+88>>2]=(c[(c[f>>2]|0)+32>>2]|0)-1;i=d;return}function Qr(a,b,d,e){a=a|0;b=b|0;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c[g>>2]|0,-1,13);i=k;return}function Sr(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;f=i;i=i+32|0;j=f+12|0;g=f+8|0;e=f+4|0;h=f;c[f+20>>2]=a;c[f+16>>2]=b;c[j>>2]=d;c[e>>2]=Cd(c[c[j>>2]>>2]|0)|0;c[h>>2]=Jd(c[(c[j>>2]|0)+4>>2]|0)|0;if(!(c[c[e>>2]>>2]|0)){c[g>>2]=0;while(1){if((c[g>>2]|0)>=(c[(c[e>>2]|0)+8>>2]|0))break;c[(c[(c[e>>2]|0)+20>>2]|0)+(c[g>>2]<<2)>>2]=1;c[g>>2]=(c[g>>2]|0)+1}j=c[e>>2]|0;a=c[j>>2]|0;a=a+1|0;c[j>>2]=a;i=f;return}Tr(c[e>>2]|0,c[h>>2]|0);c[g>>2]=0;while(1){if((c[g>>2]|0)>=(c[h>>2]|0))break;j=(c[(c[e>>2]|0)+20>>2]|0)+(c[g>>2]<<2)|0;c[j>>2]=(c[j>>2]|0)+1;c[g>>2]=(c[g>>2]|0)+1}c[g>>2]=c[h>>2];while(1){if((c[g>>2]|0)>=(c[(c[e>>2]|0)+8>>2]|0))break;j=(c[(c[e>>2]|0)+24>>2]|0)+(c[g>>2]<<2)|0;c[j>>2]=(c[j>>2]|0)+1;c[(c[(c[e>>2]|0)+20>>2]|0)+(c[g>>2]<<2)>>2]=1;c[g>>2]=(c[g>>2]|0)+1}j=c[e>>2]|0;a=c[j>>2]|0;a=a+1|0;c[j>>2]=a;i=f;return}function Tr(a,b){a=a|0;b=b|0;var d=0;d=i;i=i+16|0;c[d+4>>2]=a;c[d>>2]=b;i=d;return}function Ur(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;e=i;i=i+48|0;f=e+32|0;n=e+24|0;g=e+20|0;k=e+16|0;j=e+12|0;h=e+8|0;m=e+4|0;l=e;c[f>>2]=a;c[e+28>>2]=b;c[n>>2]=d;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2]|0)+55>>0]|0)>>>3&1)c[m>>2]=Xr(f,c[p>>2]|0,(c[o>>2]|0)-(c[p>>2]|0)|0)|0;else c[m>>2]=Xr(f,c[o>>2]|0,0)|0;if(c[m>>2]|0){c[n>>2]=0;while(1){if((c[n>>2]|0)>=(c[o>>2]|0))break;c[l>>2]=c[(c[(c[j>>2]|0)+32>>2]|0)+(c[n>>2]<<2)>>2];if(!(UE(c[l>>2]|0,3320)|0))p=0;else p=Or(c[h>>2]|0,c[l>>2]|0)|0;c[(c[m>>2]|0)+20+(c[n>>2]<<2)>>2]=p;a[(c[(c[m>>2]|0)+16>>2]|0)+(c[n>>2]|0)>>0]=a[(c[(c[j>>2]|0)+28>>2]|0)+(c[n>>2]|0)>>0]|0;c[n>>2]=(c[n>>2]|0)+1}l=c[m>>2]|0;if(c[(c[h>>2]|0)+64>>2]|0){eh(l);break}else{c[(c[j>>2]|0)+40>>2]=l;break}}}while(0);c[g>>2]=Yr(c[(c[j>>2]|0)+40>>2]|0)|0;b=c[g>>2]|0;i=k;return b|0}function Xr(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0;g=i;i=i+16|0;j=g+12|0;l=g+8|0;k=g+4|0;h=g;c[j>>2]=d;c[l>>2]=e;c[k>>2]=f;c[h>>2]=se(0,24+(((c[l>>2]|0)+(c[k>>2]|0)|0)*5|0)|0,0)|0;if(c[h>>2]|0){c[(c[h>>2]|0)+16>>2]=(c[h>>2]|0)+20+((c[l>>2]|0)+(c[k>>2]|0)<<2);b[(c[h>>2]|0)+6>>1]=c[l>>2];b[(c[h>>2]|0)+8>>1]=c[k>>2];a[(c[h>>2]|0)+4>>0]=a[(c[(c[(c[j>>2]|0)+16>>2]|0)+12>>2]|0)+77>>0]|0;c[(c[h>>2]|0)+12>>2]=c[j>>2];c[c[h>>2]>>2]=1;d=c[h>>2]|0;i=g;return d|0}else{a[(c[j>>2]|0)+64>>0]=1;d=c[h>>2]|0;i=g;return d|0}return 0}function Yr(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;if(c[b>>2]|0){a=c[b>>2]|0;c[a>>2]=(c[a>>2]|0)+1}i=d;return c[b>>2]|0}function Zr(b){b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=b;c[e>>2]=c[(c[f>>2]|0)+8>>2];while(1){if(!(c[e>>2]|0)){b=5;break}if((a[(c[e>>2]|0)+55>>0]&3|0)==2){b=5;break}c[e>>2]=c[(c[e>>2]|0)+20>>2]}if((b|0)==5){i=d;return c[e>>2]|0}return 0}function _r(b,d){b=b|0;d=d|0;var f=0,g=0,h=0,j=0,k=0,l=0;g=i;i=i+32|0;h=g+16|0;k=g+12|0;l=g+8|0;f=g+4|0;j=g;c[h>>2]=b;c[k>>2]=d;c[j>>2]=((c[(c[h>>2]|0)+24>>2]&2|0)!=0^1)&1;c[f>>2]=0;a[(c[h>>2]|0)+145>>0]=1;c[l>>2]=0;while(1){if(c[f>>2]|0)break;if((c[l>>2]|0)>=(c[(c[h>>2]|0)+20>>2]|0))break;if(!((c[l>>2]|0)==1?1:((e[(c[(c[(c[h>>2]|0)+16>>2]|0)+(c[l>>2]<<4)+12>>2]|0)+78>>1]|0)&1|0)==1)?(c[f>>2]=$r(c[h>>2]|0,c[l>>2]|0,c[k>>2]|0)|0,(c[f>>2]|0)!=0):0)as(c[h>>2]|0,c[l>>2]|0);c[l>>2]=(c[l>>2]|0)+1}if(((c[f>>2]|0)==0?((e[(c[(c[(c[h>>2]|0)+16>>2]|0)+28>>2]|0)+78>>1]|0)&1|0)!=1:0)?(c[f>>2]=$r(c[h>>2]|0,1,c[k>>2]|0)|0,(c[f>>2]|0)!=0):0)as(c[h>>2]|0,1);a[(c[h>>2]|0)+145>>0]=0;if(!((c[f>>2]|0)==0&(c[j>>2]|0)!=0)){b=c[f>>2]|0;i=g;return b|0}bs(c[h>>2]|0);b=c[f>>2]|0;i=g;return b|0}function $r(f,g,h){f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;r=i;i=i+128|0;j=r;v=r+120|0;l=r+116|0;m=r+112|0;q=r+108|0;n=r+104|0;A=r+100|0;x=r+96|0;B=r+92|0;o=r+88|0;C=r+72|0;w=r+48|0;k=r+32|0;D=r+24|0;s=r+20|0;p=r+16|0;y=r+124|0;t=r+12|0;u=r+8|0;c[l>>2]=f;c[m>>2]=g;c[q>>2]=h;c[p>>2]=0;if((c[m>>2]|0)==1)c[D>>2]=18616;else c[D>>2]=18512;c[s>>2]=(c[m>>2]|0)==1?14904:14928;c[C>>2]=c[s>>2];c[C+4>>2]=18736;c[C+8>>2]=c[D>>2];c[C+12>>2]=0;c[k>>2]=c[l>>2];c[k+8>>2]=c[m>>2];c[k+12>>2]=0;c[k+4>>2]=c[q>>2];cs(k,3,C,0)|0;if(!(c[k+12>>2]|0)){c[B>>2]=sp(c[l>>2]|0,c[s>>2]|0,c[(c[(c[l>>2]|0)+16>>2]|0)+(c[m>>2]<<4)>>2]|0)|0;if(c[B>>2]|0){f=(c[B>>2]|0)+44|0;a[f>>0]=d[f>>0]|1}c[o>>2]=(c[(c[l>>2]|0)+16>>2]|0)+(c[m>>2]<<4);if(!(c[(c[o>>2]|0)+4>>2]|0)){if((c[m>>2]|0)==1){f=(c[(c[(c[l>>2]|0)+16>>2]|0)+28>>2]|0)+78|0;b[f>>1]=e[f>>1]|1}c[v>>2]=0;f=c[v>>2]|0;i=r;return f|0}Pc(c[(c[o>>2]|0)+4>>2]|0);do if(!(Tc(c[(c[o>>2]|0)+4>>2]|0)|0)){c[n>>2]=Rc(c[(c[o>>2]|0)+4>>2]|0,0)|0;if(c[n>>2]|0){g=c[q>>2]|0;f=c[l>>2]|0;c[j>>2]=ge(c[n>>2]|0)|0;pn(g,f,1200,j);break}else{c[p>>2]=1;z=16;break}}else z=16;while(0);a:do if((z|0)==16){c[A>>2]=0;while(1){if((c[A>>2]|0)>=5)break;Sc(c[(c[o>>2]|0)+4>>2]|0,(c[A>>2]|0)+1|0,w+(c[A>>2]<<2)|0);c[A>>2]=(c[A>>2]|0)+1}c[c[(c[o>>2]|0)+12>>2]>>2]=c[w>>2];z=c[m>>2]|0;do if(c[w+16>>2]|0){A=c[w+16>>2]|0;if(!z){f=A&3;a[y>>0]=f;a[y>>0]=(d[y>>0]|0)==0?1:f;a[(c[(c[(c[l>>2]|0)+16>>2]|0)+12>>2]|0)+77>>0]=a[y>>0]|0;break}if((A|0)!=(d[(c[(c[(c[l>>2]|0)+16>>2]|0)+12>>2]|0)+77>>0]|0)){pn(c[q>>2]|0,c[l>>2]|0,18744,j);c[n>>2]=1;break a}}else{f=(c[(c[(c[l>>2]|0)+16>>2]|0)+(z<<4)+12>>2]|0)+78|0;b[f>>1]=e[f>>1]|4}while(0);a[(c[(c[o>>2]|0)+12>>2]|0)+77>>0]=a[(c[(c[(c[l>>2]|0)+16>>2]|0)+12>>2]|0)+77>>0]|0;if(!(c[(c[(c[o>>2]|0)+12>>2]|0)+80>>2]|0)){f=ds(c[w+8>>2]|0)|0;c[x>>2]=f;c[x>>2]=(c[x>>2]|0)==0?2e3:f;c[(c[(c[o>>2]|0)+12>>2]|0)+80>>2]=c[x>>2];es(c[(c[o>>2]|0)+4>>2]|0,c[(c[(c[o>>2]|0)+12>>2]|0)+80>>2]|0)|0}a[(c[(c[o>>2]|0)+12>>2]|0)+76>>0]=c[w+4>>2];if(!(d[(c[(c[o>>2]|0)+12>>2]|0)+76>>0]|0))a[(c[(c[o>>2]|0)+12>>2]|0)+76>>0]=1;if((d[(c[(c[o>>2]|0)+12>>2]|0)+76>>0]|0)>4){pn(c[q>>2]|0,c[l>>2]|0,18816,j);c[n>>2]=1;break}if((c[m>>2]|0)==0?(c[w+4>>2]|0)>=4:0){f=(c[l>>2]|0)+24|0;c[f>>2]=c[f>>2]&-32769}f=c[l>>2]|0;g=c[s>>2]|0;c[j>>2]=c[(c[(c[l>>2]|0)+16>>2]|0)+(c[m>>2]<<4)>>2];c[j+4>>2]=g;c[t>>2]=Te(f,18840,j)|0;c[u>>2]=c[(c[l>>2]|0)+284>>2];c[(c[l>>2]|0)+284>>2]=0;c[n>>2]=kf(c[l>>2]|0,c[t>>2]|0,6,k,0)|0;c[(c[l>>2]|0)+284>>2]=c[u>>2];if(!(c[n>>2]|0))c[n>>2]=c[k+12>>2];Xb(c[l>>2]|0,c[t>>2]|0);if(!(c[n>>2]|0))fs(c[l>>2]|0,c[m>>2]|0)|0;if(a[(c[l>>2]|0)+64>>0]|0){c[n>>2]=7;cd(c[l>>2]|0)}if((c[n>>2]|0)!=0?(c[(c[l>>2]|0)+24>>2]&65536|0)==0:0)break;f=(c[(c[(c[l>>2]|0)+16>>2]|0)+(c[m>>2]<<4)+12>>2]|0)+78|0;b[f>>1]=e[f>>1]|1;c[n>>2]=0}while(0);if(c[p>>2]|0)gs(c[(c[o>>2]|0)+4>>2]|0)|0}else c[n>>2]=c[k+12>>2];if((c[n>>2]|0)==7|(c[n>>2]|0)==3082)a[(c[l>>2]|0)+64>>0]=1;c[v>>2]=c[n>>2];f=c[v>>2]|0;i=r;return f|0}function as(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;e=d+8|0;g=d+4|0;f=d;c[e>>2]=a;c[g>>2]=b;c[f>>2]=(c[(c[e>>2]|0)+16>>2]|0)+(c[g>>2]<<4);wh(c[(c[f>>2]|0)+12>>2]|0);if((c[g>>2]|0)==1){i=d;return}c[f>>2]=(c[(c[e>>2]|0)+16>>2]|0)+16;wh(c[(c[f>>2]|0)+12>>2]|0);i=d;return}function bs(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=(c[d>>2]|0)+24|0;c[a>>2]=c[a>>2]&-3;i=b;return}function cs(d,f,g,h){d=d|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,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]<<4)>>2]|0)|0;if((c[r>>2]|0)!=0?(Ag(c[(c[l>>2]|0)+4>>2]|0,(c[r>>2]|0)+44|0)|0)==0:0)ks(c[m>>2]|0,c[c[l>>2]>>2]|0,18992)}else ks(c[m>>2]|0,c[c[l>>2]>>2]|0,0);while(0);c[k>>2]=0;s=c[k>>2]|0;i=o;return s|0}function ds(a){a=a|0;var b=0,d=0,e=0;d=i;i=i+16|0;b=d+4|0;e=d;c[e>>2]=a;a=c[e>>2]|0;do if((c[e>>2]|0)<0)if((a|0)==-2147483648){c[b>>2]=2147483647;break}else{c[b>>2]=0-(c[e>>2]|0);break}else c[b>>2]=a;while(0);i=d;return c[b>>2]|0}function es(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;g=d+8|0;e=d+4|0;f=d;c[g>>2]=a;c[e>>2]=b;c[f>>2]=c[(c[g>>2]|0)+4>>2];Pc(c[g>>2]|0);Jh(c[c[f>>2]>>2]|0,c[e>>2]|0);i=d;return 0}function fs(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;f=i;i=i+48|0;l=f;k=f+40|0;h=f+36|0;m=f+32|0;e=f+24|0;n=f+16|0;j=f+12|0;g=f+8|0;o=f+4|0;c[h>>2]=b;c[m>>2]=d;c[n>>2]=c[(c[(c[(c[h>>2]|0)+16>>2]|0)+(c[m>>2]<<4)+12>>2]|0)+32>>2];while(1){if(!(c[n>>2]|0))break;c[o>>2]=c[(c[n>>2]|0)+8>>2];hs(c[o>>2]|0);c[n>>2]=c[c[n>>2]>>2]}c[e>>2]=c[h>>2];c[e+4>>2]=c[(c[(c[h>>2]|0)+16>>2]|0)+(c[m>>2]<<4)>>2];if(!(sp(c[h>>2]|0,18392,c[e+4>>2]|0)|0)){c[k>>2]=1;b=c[k>>2]|0;i=f;return b|0}b=c[h>>2]|0;c[l>>2]=c[e+4>>2];c[j>>2]=Te(b,18896,l)|0;if(!(c[j>>2]|0))c[g>>2]=7;else{c[g>>2]=kf(c[h>>2]|0,c[j>>2]|0,7,e,0)|0;Xb(c[h>>2]|0,c[j>>2]|0)}if((c[g>>2]|0)==7)a[(c[h>>2]|0)+64>>0]=1;c[k>>2]=c[g>>2];b=c[k>>2]|0;i=f;return b|0}function gs(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;Pc(c[e>>2]|0);c[d>>2]=nd(c[e>>2]|0,0)|0;if(c[d>>2]|0){e=c[d>>2]|0;i=b;return e|0}c[d>>2]=md(c[e>>2]|0,0)|0;e=c[d>>2]|0;i=b;return e|0}function hs(a){a=a|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+32|0;g=f+12|0;k=f+16|0;j=f+8|0;l=f+4|0;h=f;c[g>>2]=a;b[k+0>>1]=b[9488]|0;b[k+2>>1]=b[9489]|0;b[k+4>>1]=b[9490]|0;b[k+6>>1]=b[9491]|0;b[k+8>>1]=b[9492]|0;c[j>>2]=c[(c[g>>2]|0)+8>>2];if(5<(e[(c[g>>2]|0)+50>>1]|0))a=5;else a=e[(c[g>>2]|0)+50>>1]|0;c[l>>2]=a;b[c[j>>2]>>1]=b[(c[(c[g>>2]|0)+12>>2]|0)+28>>1]|0;if((b[c[j>>2]>>1]|0)<33)b[c[j>>2]>>1]=33;dF((c[j>>2]|0)+2|0,k|0,c[l>>2]<<1|0)|0;c[h>>2]=(c[l>>2]|0)+1;while(1){if((c[h>>2]|0)>(e[(c[g>>2]|0)+50>>1]|0))break;b[(c[j>>2]|0)+(c[h>>2]<<1)>>1]=23;c[h>>2]=(c[h>>2]|0)+1}if(!(d[(c[g>>2]|0)+54>>0]|0)){i=f;return}b[(c[j>>2]|0)+(e[(c[g>>2]|0)+50>>1]<<1)>>1]=0;i=f;return}function is(d,f,g,h){d=d|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;p=i;i=i+112|0;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;r=o+32|0;q=o+28|0;n=o+20|0;l=o+16|0;k=o+12|0;p=o+8|0;j=o+4|0;m=o;c[r>>2]=d;c[q>>2]=e;c[o+24>>2]=f;c[n>>2]=g;c[l>>2]=h;c[k>>2]=c[r>>2];c[j>>2]=0;while(1){if(!(a[c[k>>2]>>0]|0))break;if((c[j>>2]|0)>=(c[q>>2]|0))break;c[m>>2]=0;while(1){r=a[c[k>>2]>>0]|0;c[p>>2]=r;if(!((r|0)>=48&(c[p>>2]|0)<=57))break;c[m>>2]=((c[m>>2]|0)*10|0)+(c[p>>2]|0)-48;c[k>>2]=(c[k>>2]|0)+1}r=dq(c[m>>2]|0,0)|0;b[(c[n>>2]|0)+(c[j>>2]<<1)>>1]=r;if((a[c[k>>2]>>0]|0)==32)c[k>>2]=(c[k>>2]|0)+1;c[j>>2]=(c[j>>2]|0)+1}a:while(1){if(!(a[c[k>>2]>>0]|0))break;if(hf(18944,c[k>>2]|0)|0){if(!(hf(18960,c[k>>2]|0)|0)){r=zg((c[k>>2]|0)+3|0)|0;r=dq(r,((r|0)<0)<<31>>31)|0;b[(c[l>>2]|0)+48>>1]=r}}else{r=(c[l>>2]|0)+55|0;a[r>>0]=a[r>>0]&-5|4}while(1){if(!(a[c[k>>2]>>0]|0))break;if((a[c[k>>2]>>0]|0)==32)break;c[k>>2]=(c[k>>2]|0)+1}while(1){if((a[c[k>>2]>>0]|0)!=32)continue a;c[k>>2]=(c[k>>2]|0)+1}}i=o;return}function ks(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;h=i;i=i+32|0;l=h;g=h+20|0;m=h+16|0;k=h+12|0;j=h+8|0;c[g>>2]=b;c[m>>2]=e;c[k>>2]=f;c[j>>2]=c[c[g>>2]>>2];if((a[(c[j>>2]|0)+64>>0]|0)==0?(c[(c[j>>2]|0)+24>>2]&65536|0)==0:0){if(!(c[m>>2]|0))c[m>>2]=19016;e=c[(c[g>>2]|0)+4>>2]|0;b=c[j>>2]|0;c[l>>2]=c[m>>2];pn(e,b,19024,l);if(c[k>>2]|0){e=c[j>>2]|0;b=c[c[(c[g>>2]|0)+4>>2]>>2]|0;m=c[k>>2]|0;c[l>>2]=c[c[(c[g>>2]|0)+4>>2]>>2];c[l+4>>2]=m;b=ls(e,b,19056,l)|0;c[c[(c[g>>2]|0)+4>>2]>>2]=b}}if(d[(c[j>>2]|0)+64>>0]|0){e=7;b=c[g>>2]|0;b=b+12|0;c[b>>2]=e;i=h;return}e=kj(103217)|0;b=c[g>>2]|0;b=b+12|0;c[b>>2]=e;i=h;return}function ls(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;g=i;i=i+48|0;j=g+32|0;h=g+28|0;l=g+24|0;k=g+8|0;f=g;c[j>>2]=a;c[h>>2]=b;c[l>>2]=d;c[k>>2]=e;c[f>>2]=yn(c[j>>2]|0,c[l>>2]|0,k)|0;Xb(c[j>>2]|0,c[h>>2]|0);i=g;return c[f>>2]|0}function ms(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;d=i;i=i+32|0;k=d+24|0;l=d+20|0;e=d+16|0;g=d+12|0;h=d+8|0;f=d+4|0;j=d;c[k>>2]=a;c[l>>2]=b;c[h>>2]=c[c[k>>2]>>2];c[g>>2]=0;c[e>>2]=c[(c[h>>2]|0)+16>>2];while(1){if((c[g>>2]|0)>=(c[(c[h>>2]|0)+20>>2]|0))break;c[f>>2]=c[(c[(c[e>>2]|0)+12>>2]|0)+16>>2];while(1){if(!(c[f>>2]|0))break;c[j>>2]=c[(c[f>>2]|0)+8>>2];ns(c[k>>2]|0,c[j>>2]|0,c[l>>2]|0);c[f>>2]=c[c[f>>2]>>2]}c[g>>2]=(c[g>>2]|0)+1;c[e>>2]=(c[e>>2]|0)+16}i=d;return}function ns(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+32|0;f=e+16|0;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p(c[j>>2]|0,5,c[l>>2]|0,c[k>>2]|0)|0;zp(c[j>>2]|0,c[r>>2]|0);Ir(c[j>>2]|0,61,c[h>>2]|0)|0;Ir(c[j>>2]|0,61,c[p>>2]|0)|0;Ir(c[j>>2]|0,61,c[l>>2]|0)|0;i=q;return}function ps(a,e,f,g,h,j,k,l){a=a|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;x=i;i=i+64|0;n=x+48|0;q=x+44|0;p=x+40|0;w=x+36|0;y=x+32|0;z=x+28|0;t=x+24|0;v=x+20|0;s=x+16|0;r=x+12|0;o=x+8|0;m=x+4|0;u=x;c[n>>2]=a;c[q>>2]=e;c[p>>2]=f;c[w>>2]=g;c[y>>2]=h;c[z>>2]=j;c[t>>2]=k;c[v>>2]=l;c[s>>2]=c[(c[n>>2]|0)+8>>2];c[o>>2]=c[(c[q>>2]|0)+12>>2];do if(c[z>>2]|0)if(c[(c[q>>2]|0)+36>>2]|0){a=Nr(c[s>>2]|0)|0;c[c[z>>2]>>2]=a;c[(c[n>>2]|0)+96>>2]=c[p>>2];ws(c[n>>2]|0);xs(c[n>>2]|0,c[(c[q>>2]|0)+36>>2]|0,c[c[z>>2]>>2]|0,16);break}else{c[c[z>>2]>>2]=0;break}while(0);if((c[y>>2]|0)!=0?((d[(c[q>>2]|0)+55>>0]|0)>>>3&1|0)!=0:0)l=b[(c[q>>2]|0)+50>>1]|0;else l=b[(c[q>>2]|0)+52>>1]|0;c[u>>2]=l&65535;c[m>>2]=ys(c[n>>2]|0,c[u>>2]|0)|0;do if(c[t>>2]|0){if((c[m>>2]|0)==(c[v>>2]|0)?(c[(c[t>>2]|0)+36>>2]|0)==0:0)break;c[t>>2]=0}while(0);c[r>>2]=0;while(1){if((c[r>>2]|0)>=(c[u>>2]|0))break;if(!((c[t>>2]|0)!=0?(b[(c[(c[t>>2]|0)+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|0)+1}c[j>>2]=pc(n)|0;ts(c[k>>2]|0,(a[(c[l>>2]|0)+55>>0]&3|0)==2?1555:2067,c[m>>2]|0,c[j>>2]|0,-1,2);i=h;return}function ss(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;b=c[f>>2]|0;a=c[e>>2]|0;Vm(b,a,Mb(c[e>>2]|0)|0);i=d;return}function ts(b,d,e,f,g,h){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;p=i;i=i+32|0;q=p+16|0;m=p+12|0;n=p+8|0;o=p+4|0;j=p+21|0;l=p+20|0;k=p;c[q>>2]=b;c[m>>2]=d;c[n>>2]=e;c[o>>2]=f;a[j>>0]=g;a[l>>0]=h;c[k>>2]=dp(c[q>>2]|0)|0;if((c[n>>2]|0)==2)Sp(c[q>>2]|0);hp(c[k>>2]|0,24,c[m>>2]|0,c[n>>2]|0,0,c[o>>2]|0,a[j>>0]|0)|0;if(!(a[l>>0]|0)){i=p;return}Xe(c[k>>2]|0,a[l>>0]|0);i=p;return}function us(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;e=b+8|0;f=b+4|0;d=b;c[e>>2]=a;a=(c[e>>2]|0)+100|0;c[a>>2]=(c[a>>2]|0)+ -1;c[f>>2]=0;c[d>>2]=(c[e>>2]|0)+116;while(1){if((c[f>>2]|0)>=10)break;if((c[(c[d>>2]|0)+12>>2]|0)!=0?(c[(c[d>>2]|0)+8>>2]|0)>(c[(c[e>>2]|0)+100>>2]|0):0){vs(c[e>>2]|0,c[d>>2]|0);c[(c[d>>2]|0)+12>>2]=0}c[f>>2]=(c[f>>2]|0)+1;c[d>>2]=(c[d>>2]|0)+20}i=b;return}function vs(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0;f=i;i=i+16|0;h=f+4|0;g=f;c[h>>2]=b;c[g>>2]=e;if(!(a[(c[g>>2]|0)+6>>0]|0)){i=f;return}if((d[(c[h>>2]|0)+19>>0]|0)<8){e=c[(c[g>>2]|0)+12>>2]|0;j=(c[h>>2]|0)+19|0;b=a[j>>0]|0;a[j>>0]=b+1<<24>>24;c[(c[h>>2]|0)+24+((b&255)<<2)>>2]=e}a[(c[g>>2]|0)+6>>0]=0;i=f;return}function ws(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=(c[d>>2]|0)+100|0;c[a>>2]=(c[a>>2]|0)+1;i=b;return}function xs(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;o=i;i=i+48|0;h=o+44|0;l=o+40|0;m=o+36|0;n=o+32|0;g=o+28|0;s=o+24|0;j=o+20|0;k=o+16|0;q=o+12|0;r=o+8|0;p=o+4|0;t=o;c[h>>2]=a;c[l>>2]=b;c[m>>2]=e;c[n>>2]=f;c[g>>2]=c[(c[h>>2]|0)+8>>2];c[s>>2]=0;c[j>>2]=0;c[k>>2]=0;if((c[g>>2]|0)==0|(c[l>>2]|0)==0){i=o;return}c[s>>2]=((d[c[l>>2]>>0]|0)+0^1)-0;a:do switch(d[c[l>>2]>>0]|0|0){case 19:{Gs(c[h>>2]|0,c[(c[l>>2]|0)+12>>2]|0,c[m>>2]|0,c[n>>2]|0);break};case 71:{c[p>>2]=Nr(c[g>>2]|0)|0;Gs(c[h>>2]|0,c[(c[l>>2]|0)+12>>2]|0,c[p>>2]|0,c[n>>2]^16);ws(c[h>>2]|0);xs(c[h>>2]|0,c[(c[l>>2]|0)+16>>2]|0,c[m>>2]|0,c[n>>2]|0);Pr(c[g>>2]|0,c[p>>2]|0);us(c[h>>2]|0);break};case 79:case 78:case 83:case 80:case 81:case 82:{c[q>>2]=Hs(c[h>>2]|0,c[(c[l>>2]|0)+12>>2]|0,j)|0;c[r>>2]=Hs(c[h>>2]|0,c[(c[l>>2]|0)+16>>2]|0,k)|0;Is(c[h>>2]|0,c[(c[l>>2]|0)+12>>2]|0,c[(c[l>>2]|0)+16>>2]|0,c[s>>2]|0,c[q>>2]|0,c[r>>2]|0,c[m>>2]|0,c[n>>2]|0)|0;break};case 74:{Js(c[h>>2]|0,c[l>>2]|0,c[m>>2]|0,0,c[n>>2]|0);break};case 72:{xs(c[h>>2]|0,c[(c[l>>2]|0)+12>>2]|0,c[m>>2]|0,c[n>>2]|0);ws(c[h>>2]|0);xs(c[h>>2]|0,c[(c[l>>2]|0)+16>>2]|0,c[m>>2]|0,c[n>>2]|0);us(c[h>>2]|0);break};case 77:case 76:{c[q>>2]=Hs(c[h>>2]|0,c[(c[l>>2]|0)+12>>2]|0,j)|0;fp(c[g>>2]|0,c[s>>2]|0,c[q>>2]|0,c[m>>2]|0)|0;break};case 75:if(c[n>>2]|0){Ks(c[h>>2]|0,c[l>>2]|0,c[m>>2]|0,c[m>>2]|0);break a}else{c[t>>2]=Nr(c[g>>2]|0)|0;Ks(c[h>>2]|0,c[l>>2]|0,c[m>>2]|0,c[t>>2]|0);Pr(c[g>>2]|0,c[t>>2]|0);break a};case 148:case 73:{c[q>>2]=Hs(c[h>>2]|0,c[(c[l>>2]|0)+12>>2]|0,j)|0;c[r>>2]=Hs(c[h>>2]|0,c[(c[l>>2]|0)+16>>2]|0,k)|0;c[s>>2]=(d[c[l>>2]>>0]|0|0)==73?78:79;Is(c[h>>2]|0,c[(c[l>>2]|0)+12>>2]|0,c[(c[l>>2]|0)+16>>2]|0,c[s>>2]|0,c[q>>2]|0,c[r>>2]|0,c[m>>2]|0,128)|0;break};default:{if(nr(c[l>>2]|0)|0){fp(c[g>>2]|0,16,0,c[m>>2]|0)|0;break a}if(!(Ls(c[l>>2]|0)|0)){c[q>>2]=Hs(c[h>>2]|0,c[l>>2]|0,j)|0;ip(c[g>>2]|0,46,c[q>>2]|0,c[m>>2]|0,(c[n>>2]|0)!=0&1)|0}}}while(0);lp(c[h>>2]|0,c[j>>2]|0);lp(c[h>>2]|0,c[k>>2]|0);i=o;return}function ys(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;g=d+12|0;f=d+8|0;e=d+4|0;h=d;c[g>>2]=a;c[f>>2]=b;c[e>>2]=c[(c[g>>2]|0)+60>>2];c[h>>2]=c[(c[g>>2]|0)+56>>2];if((c[f>>2]|0)<=(c[h>>2]|0)){h=(c[g>>2]|0)+60|0;c[h>>2]=(c[h>>2]|0)+(c[f>>2]|0);h=(c[g>>2]|0)+56|0;c[h>>2]=(c[h>>2]|0)-(c[f>>2]|0);h=c[e>>2]|0;i=d;return h|0}else{c[e>>2]=(c[(c[g>>2]|0)+72>>2]|0)+1;h=(c[g>>2]|0)+72|0;c[h>>2]=(c[h>>2]|0)+(c[f>>2]|0);h=c[e>>2]|0;i=d;return h|0}return 0}function zs(a,e,f,g,h){a=a|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;o=i;i=i+32|0;k=o+24|0;l=o+20|0;p=o+16|0;m=o+12|0;n=o+8|0;j=o+4|0;q=o;c[k>>2]=a;c[l>>2]=e;c[p>>2]=f;c[m>>2]=g;c[n>>2]=h;if((c[m>>2]|0)>=0?(c[m>>2]|0)!=(b[(c[l>>2]|0)+36>>1]|0):0){c[j>>2]=(d[(c[l>>2]|0)+44>>0]&16|0)!=0?148:47;c[q>>2]=c[m>>2];if(d[(c[l>>2]|0)+44>>0]&32){a=Zr(c[l>>2]|0)|0;c[q>>2]=(Ds(a,c[m>>2]&65535)|0)<<16>>16}ip(c[k>>2]|0,c[j>>2]|0,c[p>>2]|0,c[q>>2]|0,c[n>>2]|0)|0}else fp(c[k>>2]|0,103,c[p>>2]|0,c[n>>2]|0)|0;if((c[m>>2]|0)<0){i=o;return}Es(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,c[n>>2]|0);i=o;return}function As(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0;f=i;i=i+16|0;g=f+4|0;h=f;j=f+8|0;c[h>>2]=b;a[j>>0]=e;if(((c[(c[h>>2]|0)+32>>2]|0)-1|0)>(c[(c[(c[h>>2]|0)+24>>2]|0)+88>>2]|0)?(d[(c[(c[h>>2]|0)+4>>2]|0)+(((c[(c[h>>2]|0)+32>>2]|0)-1|0)*20|0)>>0]|0|0)==(d[j>>0]|0|0):0){cf(c[h>>2]|0,(c[(c[h>>2]|0)+32>>2]|0)-1|0);c[g>>2]=1;j=c[g>>2]|0;i=f;return j|0}c[g>>2]=0;j=c[g>>2]|0;i=f;return j|0}function Bs(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;g=e+8|0;h=e+4|0;f=e;c[g>>2]=a;c[h>>2]=b;c[f>>2]=d;Cs(c[g>>2]|0,c[h>>2]|0,c[f>>2]|0);if((c[f>>2]|0)<=(c[(c[g>>2]|0)+56>>2]|0)){i=e;return}c[(c[g>>2]|0)+56>>2]=c[f>>2];c[(c[g>>2]|0)+60>>2]=c[h>>2];i=e;return}function Cs(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;e=i;i=i+32|0;f=e+24|0;j=e+20|0;m=e+16|0;l=e+12|0;k=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[j>>2]=b;c[m>>2]=d;c[k>>2]=(c[j>>2]|0)+(c[m>>2]|0)-1;c[l>>2]=0;c[g>>2]=(c[f>>2]|0)+116;while(1){if((c[l>>2]|0)>=10)break;c[h>>2]=c[(c[g>>2]|0)+12>>2];if((c[h>>2]|0)>=(c[j>>2]|0)?(c[h>>2]|0)<=(c[k>>2]|0):0){vs(c[f>>2]|0,c[g>>2]|0);c[(c[g>>2]|0)+12>>2]=0}c[l>>2]=(c[l>>2]|0)+1;c[g>>2]=(c[g>>2]|0)+20}i=e;return}function Ds(a,d){a=a|0;d=d|0;var f=0,g=0,h=0,j=0,k=0;g=i;i=i+16|0;f=g+10|0;k=g+4|0;j=g+8|0;h=g;c[k>>2]=a;b[j>>1]=d;c[h>>2]=0;while(1){if((c[h>>2]|0)>=(e[(c[k>>2]|0)+52>>1]|0)){h=6;break}d=c[h>>2]|0;if((b[j>>1]|0)==(b[(c[(c[k>>2]|0)+4>>2]|0)+(c[h>>2]<<1)>>1]|0)){h=4;break}c[h>>2]=d+1}if((h|0)==4){b[f>>1]=d;a=b[f>>1]|0;i=g;return a|0}else if((h|0)==6){b[f>>1]=-1;a=b[f>>1]|0;i=g;return a|0}return 0}function Es(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;m=i;i=i+32|0;h=m+20|0;k=m+16|0;l=m+12|0;j=m+8|0;g=m+4|0;n=m+24|0;o=m;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;c[j>>2]=f;if(c[(c[k>>2]|0)+12>>2]|0){i=m;return}c[g>>2]=0;a[n>>0]=a[(c[(c[(Fs(c[h>>2]|0)|0)+16>>2]|0)+12>>2]|0)+77>>0]|0;c[o>>2]=(c[(c[k>>2]|0)+4>>2]|0)+((c[l>>2]|0)*24|0);b=Fs(c[h>>2]|0)|0;tp(b,c[(c[o>>2]|0)+4>>2]|0,a[n>>0]|0,a[(c[o>>2]|0)+21>>0]|0,g)|0;if(c[g>>2]|0)bf(c[h>>2]|0,-1,c[g>>2]|0,-8);if((a[(c[(c[k>>2]|0)+4>>2]|0)+((c[l>>2]|0)*24|0)+21>>0]|0)!=69){i=m;return}Ir(c[h>>2]|0,39,c[j>>2]|0)|0;i=m;return}function Fs(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return c[c[b>>2]>>2]|0}function Gs(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;p=i;i=i+64|0;h=p+48|0;l=p+44|0;m=p+40|0;n=p+36|0;o=p+32|0;t=p+28|0;j=p+24|0;k=p+20|0;r=p+16|0;s=p+12|0;u=p+8|0;g=p+4|0;q=p;c[h>>2]=a;c[l>>2]=b;c[m>>2]=e;c[n>>2]=f;c[o>>2]=c[(c[h>>2]|0)+8>>2];c[t>>2]=0;c[j>>2]=0;c[k>>2]=0;if((c[o>>2]|0)==0|(c[l>>2]|0)==0){i=p;return}c[t>>2]=d[c[l>>2]>>0];a:do switch(c[t>>2]|0){case 19:{xs(c[h>>2]|0,c[(c[l>>2]|0)+12>>2]|0,c[m>>2]|0,c[n>>2]|0);break};case 75:{c[g>>2]=Nr(c[o>>2]|0)|0;c[q>>2]=(c[n>>2]|0)!=0?c[m>>2]|0:c[g>>2]|0;Ks(c[h>>2]|0,c[l>>2]|0,c[g>>2]|0,c[q>>2]|0);fp(c[o>>2]|0,16,0,c[m>>2]|0)|0;Pr(c[o>>2]|0,c[g>>2]|0);break};case 148:case 73:{c[r>>2]=Hs(c[h>>2]|0,c[(c[l>>2]|0)+12>>2]|0,j)|0;c[s>>2]=Hs(c[h>>2]|0,c[(c[l>>2]|0)+16>>2]|0,k)|0;c[t>>2]=(c[t>>2]|0)==73?79:78;Is(c[h>>2]|0,c[(c[l>>2]|0)+12>>2]|0,c[(c[l>>2]|0)+16>>2]|0,c[t>>2]|0,c[r>>2]|0,c[s>>2]|0,c[m>>2]|0,128)|0;break};case 79:case 78:case 83:case 80:case 81:case 82:{c[r>>2]=Hs(c[h>>2]|0,c[(c[l>>2]|0)+12>>2]|0,j)|0;c[s>>2]=Hs(c[h>>2]|0,c[(c[l>>2]|0)+16>>2]|0,k)|0;Is(c[h>>2]|0,c[(c[l>>2]|0)+12>>2]|0,c[(c[l>>2]|0)+16>>2]|0,c[t>>2]|0,c[r>>2]|0,c[s>>2]|0,c[m>>2]|0,c[n>>2]|0)|0;break};case 72:{c[u>>2]=Nr(c[o>>2]|0)|0;xs(c[h>>2]|0,c[(c[l>>2]|0)+12>>2]|0,c[u>>2]|0,c[n>>2]^16);ws(c[h>>2]|0);Gs(c[h>>2]|0,c[(c[l>>2]|0)+16>>2]|0,c[m>>2]|0,c[n>>2]|0);Pr(c[o>>2]|0,c[u>>2]|0);us(c[h>>2]|0);break};case 71:{Gs(c[h>>2]|0,c[(c[l>>2]|0)+12>>2]|0,c[m>>2]|0,c[n>>2]|0);ws(c[h>>2]|0);Gs(c[h>>2]|0,c[(c[l>>2]|0)+16>>2]|0,c[m>>2]|0,c[n>>2]|0);us(c[h>>2]|0);break};case 74:{Js(c[h>>2]|0,c[l>>2]|0,c[m>>2]|0,1,c[n>>2]|0);break};case 77:case 76:{c[r>>2]=Hs(c[h>>2]|0,c[(c[l>>2]|0)+12>>2]|0,j)|0;fp(c[o>>2]|0,c[t>>2]|0,c[r>>2]|0,c[m>>2]|0)|0;break};default:{if(Ls(c[l>>2]|0)|0){fp(c[o>>2]|0,16,0,c[m>>2]|0)|0;break a}if(!(nr(c[l>>2]|0)|0)){c[r>>2]=Hs(c[h>>2]|0,c[l>>2]|0,j)|0;ip(c[o>>2]|0,45,c[r>>2]|0,c[m>>2]|0,(c[n>>2]|0)!=0&1)|0}}}while(0);lp(c[h>>2]|0,c[j>>2]|0);lp(c[h>>2]|0,c[k>>2]|0);i=p;return}function Hs(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;m=i;i=i+48|0;l=m+32|0;n=m+28|0;j=m+24|0;p=m+20|0;h=m+16|0;o=m+12|0;f=m+8|0;k=m+4|0;q=m;c[n>>2]=a;c[j>>2]=b;c[p>>2]=e;c[j>>2]=iq(c[j>>2]|0)|0;if(((d[(c[n>>2]|0)+23>>0]|0|0)!=0?(d[c[j>>2]>>0]|0|0)!=159:0)?(pt(c[j>>2]|0)|0)!=0:0){c[o>>2]=c[(c[n>>2]|0)+316>>2];c[c[p>>2]>>2]=0;a:do if(c[o>>2]|0){c[k>>2]=c[(c[o>>2]|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>2]|0)+8>>2]|0,c[m>>2]&255);i=l;return c[k>>2]|0}function Js(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;j=i;i=i+224|0;h=j+216|0;p=j+212|0;o=j+208|0;k=j+204|0;n=j+200|0;m=j+152|0;q=j+104|0;s=j+56|0;r=j+8|0;l=j;c[h>>2]=b;c[p>>2]=d;c[o>>2]=e;c[k>>2]=f;c[n>>2]=g;c[l>>2]=0;e=r+0|0;f=(c[(c[p>>2]|0)+12>>2]|0)+0|0;g=e+48|0;do{c[e>>2]=c[f>>2];e=e+4|0;f=f+4|0}while((e|0)<(g|0));a[m>>0]=72;c[m+12>>2]=q;c[m+16>>2]=s;a[q>>0]=83;c[q+12>>2]=r;c[q+16>>2]=c[c[(c[(c[p>>2]|0)+20>>2]|0)+4>>2]>>2];a[s>>0]=81;c[s+12>>2]=r;c[s+16>>2]=c[(c[(c[(c[p>>2]|0)+20>>2]|0)+4>>2]|0)+20>>2];Zs(r,Hs(c[h>>2]|0,r,l)|0);p=c[h>>2]|0;o=c[o>>2]|0;n=c[n>>2]|0;if(c[k>>2]|0){Gs(p,m,o,n);d=c[h>>2]|0;b=c[l>>2]|0;lp(d,b);i=j;return}else{xs(p,m,o,n);d=c[h>>2]|0;b=c[l>>2]|0;lp(d,b);i=j;return}}function Ks(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;l=i;i=i+80|0;k=l+64|0;p=l+60|0;h=l+56|0;o=l+52|0;g=l+48|0;r=l+68|0;q=l+44|0;j=l+40|0;n=l+36|0;y=l+32|0;w=l+28|0;t=l+24|0;v=l+20|0;z=l+16|0;u=l+12|0;x=l+8|0;s=l+4|0;m=l;c[k>>2]=b;c[p>>2]=d;c[h>>2]=e;c[o>>2]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0)+12>>2]|0,c[C>>2]|0)|0;c[B>>2]=mt(c[v>>2]|0,a[(c[(c[s>>2]|0)+4>>2]|0)+((b[l>>1]|0)*24|0)+21>>0]|0)|0;c[u>>2]=c[(c[s>>2]|0)+8>>2];while(1){if(!((c[u>>2]|0)!=0&(c[x>>2]|0)==0&(c[B>>2]|0)!=0))break a;do if((b[c[(c[u>>2]|0)+4>>2]>>1]|0)==(b[l>>1]|0)?(f=$g(c[z>>2]|0,a[(c[(c[(c[z>>2]|0)+16>>2]|0)+12>>2]|0)+77>>0]|0,c[c[(c[u>>2]|0)+32>>2]>>2]|0,0)|0,(f|0)==(c[A>>2]|0)):0){if(c[y>>2]|0){if((e[(c[u>>2]|0)+50>>1]|0)!=1)break;if(!(d[(c[u>>2]|0)+54>>0]|0))break}c[k>>2]=_s(c[q>>2]|0)|0;ip(c[t>>2]|0,54,c[m>>2]|0,c[(c[u>>2]|0)+44>>2]|0,b[r>>1]|0)|0;Lr(c[q>>2]|0,c[u>>2]|0);c[x>>2]=3+(d[c[(c[u>>2]|0)+28>>2]>>0]|0);if((c[w>>2]|0)!=0?(a[(c[(c[s>>2]|0)+4>>2]|0)+((b[l>>1]|0)*24|0)+20>>0]|0)==0:0){g=(c[q>>2]|0)+72|0;f=(c[g>>2]|0)+1|0;c[g>>2]=f;c[c[w>>2]>>2]=f;bt(c[t>>2]|0,c[m>>2]|0,c[c[w>>2]>>2]|0)}zp(c[t>>2]|0,c[k>>2]|0)}while(0);c[u>>2]=c[(c[u>>2]|0)+20>>2]}}while(0);do if(((c[x>>2]|0)==0?(c[o>>2]&1|0)!=0:0)?(c[(c[v>>2]|0)+4>>2]&2048|0)==0:0){if((nt(c[v>>2]|0)|0)!=0?(c[c[(c[v>>2]|0)+20>>2]>>2]|0)>2:0)break;c[x>>2]=5}while(0);if(c[x>>2]|0){c[(c[v>>2]|0)+28>>2]=c[m>>2];f=c[x>>2]|0;i=n;return f|0}c[D>>2]=c[(c[q>>2]|0)+424>>2];c[E>>2]=0;c[x>>2]=2;if(c[o>>2]&4){c[(c[q>>2]|0)+424>>2]=0;if((b[(c[(c[v>>2]|0)+12>>2]|0)+32>>1]|0)<0?(c[(c[v>>2]|0)+4>>2]&2048|0)==0:0)c[x>>2]=1}else if(c[w>>2]|0){g=(c[q>>2]|0)+72|0;f=(c[g>>2]|0)+1|0;c[g>>2]=f;c[E>>2]=f;c[c[w>>2]>>2]=f}Ys(c[q>>2]|0,c[v>>2]|0,c[E>>2]|0,(c[x>>2]|0)==1&1)|0;c[(c[q>>2]|0)+424>>2]=c[D>>2];f=c[x>>2]|0;i=n;return f|0}function Ns(b){b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d;e=d+4|0;c[f>>2]=b;a[e>>0]=bq(c[(c[f>>2]|0)+12>>2]|0)|0;b=c[f>>2]|0;if(c[(c[f>>2]|0)+16>>2]|0){a[e>>0]=kt(c[b+16>>2]|0,a[e>>0]|0)|0;b=a[e>>0]|0;i=d;return b|0}if(c[b+4>>2]&2048){a[e>>0]=kt(c[c[(c[c[(c[f>>2]|0)+20>>2]>>2]|0)+4>>2]>>2]|0,a[e>>0]|0)|0;b=a[e>>0]|0;i=d;return b|0}if(a[e>>0]|0){b=a[e>>0]|0;i=d;return b|0}a[e>>0]=65;b=a[e>>0]|0;i=d;return b|0}function Os(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;j=f+12|0;h=f+8|0;g=f+4|0;k=f;c[j>>2]=a;c[h>>2]=b;c[g>>2]=e;if((c[h>>2]|0)!=0?(d[c[h>>2]>>0]|0|0)==159:0){fp(c[(c[j>>2]|0)+8>>2]|0,33,c[(c[h>>2]|0)+28>>2]|0,c[g>>2]|0)|0;i=f;return}c[k>>2]=Qs(c[j>>2]|0,c[h>>2]|0,c[g>>2]|0)|0;if((c[k>>2]|0)==(c[g>>2]|0)){i=f;return}if(!(c[(c[j>>2]|0)+8>>2]|0)){i=f;return}fp(c[(c[j>>2]|0)+8>>2]|0,34,c[k>>2]|0,c[g>>2]|0)|0;i=f;return}function Ps(e){e=e|0;var f=0,g=0,h=0,j=0,k=0;g=i;i=i+16|0;f=g+4|0;h=g;j=g+8|0;c[h>>2]=e;while(1){if((d[c[h>>2]>>0]|0)==158)k=1;else k=(d[c[h>>2]>>0]|0)==157;e=c[h>>2]|0;if(!k)break;c[h>>2]=c[e+12>>2]}a[j>>0]=a[e>>0]|0;if((d[j>>0]|0)==159)a[j>>0]=a[(c[h>>2]|0)+38>>0]|0;switch(d[j>>0]|0){case 154:{if(!(c[(c[h>>2]|0)+4>>2]&1048576))if((b[(c[h>>2]|0)+32>>1]|0)>=0)h=(d[(c[(c[(c[h>>2]|0)+44>>2]|0)+4>>2]|0)+((b[(c[h>>2]|0)+32>>1]|0)*24|0)+20>>0]|0)==0;else h=0;else h=1;c[f>>2]=h&1;k=c[f>>2]|0;i=g;return k|0};case 134:case 133:case 97:case 132:{c[f>>2]=0;k=c[f>>2]|0;i=g;return k|0};default:{c[f>>2]=1;k=c[f>>2]|0;i=g;return k|0}}return 0}function Qs(f,g,h){f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0;r=i;i=i+304|0;P=r;q=r+292|0;k=r+288|0;H=r+284|0;p=r+280|0;o=r+276|0;ja=r+272|0;n=r+268|0;l=r+264|0;m=r+260|0;K=r+256|0;fa=r+252|0;ba=r+248|0;T=r+244|0;M=r+240|0;B=r+192|0;ga=r+184|0;ha=r+180|0;Z=r+176|0;X=r+172|0;W=r+168|0;Y=r+164|0;U=r+160|0;ia=r+156|0;V=r+152|0;D=r+148|0;C=r+144|0;G=r+140|0;O=r+136|0;N=r+132|0;L=r+128|0;J=r+124|0;Q=r+297|0;E=r+120|0;I=r+116|0;F=r+296|0;_=r+112|0;aa=r+108|0;ea=r+104|0;R=r+100|0;ca=r+96|0;S=r+92|0;da=r+88|0;s=r+84|0;t=r+80|0;v=r+76|0;z=r+72|0;A=r+68|0;u=r+64|0;x=r+16|0;y=r+12|0;w=r+8|0;c[k>>2]=f;c[H>>2]=g;c[p>>2]=h;c[o>>2]=c[(c[k>>2]|0)+8>>2];c[n>>2]=c[p>>2];c[l>>2]=0;c[m>>2]=0;c[M>>2]=c[c[k>>2]>>2];if(!(c[o>>2]|0)){c[q>>2]=0;f=c[q>>2]|0;i=r;return f|0}if(!(c[H>>2]|0))c[ja>>2]=101;else c[ja>>2]=d[c[H>>2]>>0];a:do switch(c[ja>>2]|0){case 77:case 76:{fp(c[o>>2]|0,25,1,c[p>>2]|0)|0;c[K>>2]=Hs(c[k>>2]|0,c[(c[H>>2]|0)+12>>2]|0,l)|0;c[ia>>2]=Ir(c[o>>2]|0,c[ja>>2]|0,c[K>>2]|0)|0;fp(c[o>>2]|0,25,0,c[p>>2]|0)|0;zp(c[o>>2]|0,c[ia>>2]|0);break};case 156:{c[ga>>2]=c[(c[H>>2]|0)+40>>2];c[ha>>2]=(c[(c[ga>>2]|0)+28>>2]|0)+((b[(c[H>>2]|0)+34>>1]|0)*24|0);if(!(a[c[ga>>2]>>0]|0)){c[n>>2]=c[(c[ha>>2]|0)+16>>2];break a}if(a[(c[ga>>2]|0)+1>>0]|0)ip(c[o>>2]|0,47,c[(c[ga>>2]|0)+8>>2]|0,c[(c[ha>>2]|0)+12>>2]|0,c[p>>2]|0)|0;else j=11;break};case 148:case 73:{c[K>>2]=Hs(c[k>>2]|0,c[(c[H>>2]|0)+12>>2]|0,l)|0;c[fa>>2]=Hs(c[k>>2]|0,c[(c[H>>2]|0)+16>>2]|0,m)|0;c[ja>>2]=(c[ja>>2]|0)==73?79:78;Is(c[k>>2]|0,c[(c[H>>2]|0)+12>>2]|0,c[(c[H>>2]|0)+16>>2]|0,c[ja>>2]|0,c[K>>2]|0,c[fa>>2]|0,c[n>>2]|0,160)|0;break};case 97:{hp(c[o>>2]|0,97,0,c[p>>2]|0,0,c[(c[H>>2]|0)+8>>2]|0,0)|0;break};case 94:case 88:case 87:case 92:case 86:case 85:case 93:case 90:case 91:case 89:case 71:case 72:{c[K>>2]=Hs(c[k>>2]|0,c[(c[H>>2]|0)+12>>2]|0,l)|0;c[fa>>2]=Hs(c[k>>2]|0,c[(c[H>>2]|0)+16>>2]|0,m)|0;ip(c[o>>2]|0,c[ja>>2]|0,c[fa>>2]|0,c[K>>2]|0,c[p>>2]|0)|0;break};case 135:{fp(c[o>>2]|0,31,b[(c[H>>2]|0)+32>>1]|0,c[p>>2]|0)|0;if(a[(c[(c[H>>2]|0)+8>>2]|0)+1>>0]|0)bf(c[o>>2]|0,-1,c[(c[(c[k>>2]|0)+472>>2]|0)+((b[(c[H>>2]|0)+32>>1]|0)-1<<2)>>2]|0,-2);break};case 79:case 78:case 83:case 80:case 81:case 82:{c[K>>2]=Hs(c[k>>2]|0,c[(c[H>>2]|0)+12>>2]|0,l)|0;c[fa>>2]=Hs(c[k>>2]|0,c[(c[H>>2]|0)+16>>2]|0,m)|0;Is(c[k>>2]|0,c[(c[H>>2]|0)+12>>2]|0,c[(c[H>>2]|0)+16>>2]|0,c[ja>>2]|0,c[K>>2]|0,c[fa>>2]|0,c[n>>2]|0,32)|0;break};case 159:{c[n>>2]=c[(c[H>>2]|0)+28>>2];break};case 119:case 20:{c[n>>2]=Ys(c[k>>2]|0,c[H>>2]|0,0,0)|0;break};case 158:case 95:{c[n>>2]=Qs(c[k>>2]|0,c[(c[H>>2]|0)+12>>2]|0,c[p>>2]|0)|0;break};case 74:{c[ea>>2]=c[(c[H>>2]|0)+12>>2];c[R>>2]=c[(c[(c[H>>2]|0)+20>>2]|0)+4>>2];c[ca>>2]=c[c[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=c[N>>2]|0;c[P>>2]=c[O>>2];c[P+4>>2]=g;Se(f,19160,P);break};case 155:{c[V>>2]=c[(c[H>>2]|0)+40>>2];if(!(c[V>>2]|0)){f=c[k>>2]|0;c[P>>2]=c[(c[H>>2]|0)+8>>2];Se(f,19128,P);break a}else{c[n>>2]=c[(c[(c[V>>2]|0)+40>>2]|0)+(b[(c[H>>2]|0)+34>>1]<<4)+8>>2];break a}};case 134:{c[W>>2]=(c[(c[H>>2]|0)+8>>2]|0)+2;c[X>>2]=(Mb(c[W>>2]|0)|0)-1;c[Y>>2]=Gp(Fs(c[o>>2]|0)|0,c[W>>2]|0,c[X>>2]|0)|0;hp(c[o>>2]|0,30,(c[X>>2]|0)/2|0,c[p>>2]|0,0,c[Y>>2]|0,-1)|0;break};case 132:{Ss(c[k>>2]|0,c[H>>2]|0,0,c[p>>2]|0);break};case 154:{j=11;break};case 101:{fp(c[o>>2]|0,28,0,c[p>>2]|0)|0;break};case 38:{c[n>>2]=Qs(c[k>>2]|0,c[(c[H>>2]|0)+12>>2]|0,c[p>>2]|0)|0;if((c[n>>2]|0)!=(c[p>>2]|0)){fp(c[o>>2]|0,34,c[n>>2]|0,c[p>>2]|0)|0;c[n>>2]=c[p>>2]}fp(c[o>>2]|0,40,c[p>>2]|0,(Bp(c[(c[H>>2]|0)+8>>2]|0,0)|0)<<24>>24)|0;Us(c[k>>2]|0,c[n>>2]|0,1);break};case 24:{c[n>>2]=Qs(c[k>>2]|0,c[(c[H>>2]|0)+12>>2]|0,c[p>>2]|0)|0;break};case 57:{if(!(c[(c[k>>2]|0)+412>>2]|0)){Se(c[k>>2]|0,19192,P);c[q>>2]=0;f=c[q>>2]|0;i=r;return f|0}if((a[(c[H>>2]|0)+1>>0]|0)==2)Sp(c[k>>2]|0);if((a[(c[H>>2]|0)+1>>0]|0)==4){hp(c[o>>2]|0,24,0,4,0,c[(c[H>>2]|0)+8>>2]|0,0)|0;break a}else{ts(c[k>>2]|0,1811,a[(c[H>>2]|0)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fp(c[o>>2]|0,16,0,c[s>>2]|0)|0;us(c[k>>2]|0);Pr(c[o>>2]|0,c[t>>2]|0);c[z>>2]=(c[z>>2]|0)+2}if(c[v>>2]&1){ws(c[k>>2]|0);Os(c[k>>2]|0,c[(c[(c[A>>2]|0)+4>>2]|0)+(((c[v>>2]|0)-1|0)*20|0)>>2]|0,c[p>>2]|0);us(c[k>>2]|0)}else fp(c[o>>2]|0,28,0,c[p>>2]|0)|0;Pr(c[o>>2]|0,c[s>>2]|0)}}while(0);b:do if((j|0)==11){c[Z>>2]=c[(c[H>>2]|0)+28>>2];do if((c[Z>>2]|0)<0)if((c[(c[k>>2]|0)+92>>2]|0)>0){c[n>>2]=(b[(c[H>>2]|0)+32>>1]|0)+(c[(c[k>>2]|0)+92>>2]|0);break b}else{c[Z>>2]=c[(c[k>>2]|0)+96>>2];break}while(0);c[n>>2]=Rs(c[k>>2]|0,c[(c[H>>2]|0)+44>>2]|0,b[(c[H>>2]|0)+32>>1]|0,c[Z>>2]|0,c[p>>2]|0,a[(c[H>>2]|0)+38>>0]|0)|0}while(0);lp(c[k>>2]|0,c[l>>2]|0);lp(c[k>>2]|0,c[m>>2]|0);c[q>>2]=c[n>>2];f=c[q>>2]|0;i=r;return f|0}function Rs(d,e,f,g,h,j){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;n=i;i=i+48|0;m=n+32|0;q=n+28|0;k=n+24|0;s=n+20|0;r=n+16|0;t=n+12|0;p=n+36|0;o=n+8|0;v=n+4|0;u=n;c[q>>2]=d;c[k>>2]=e;c[s>>2]=f;c[r>>2]=g;c[t>>2]=h;a[p>>0]=j;c[o>>2]=c[(c[q>>2]|0)+8>>2];c[v>>2]=0;c[u>>2]=(c[q>>2]|0)+116;while(1){if((c[v>>2]|0)>=10)break;if(((c[(c[u>>2]|0)+12>>2]|0)>0?(c[c[u>>2]>>2]|0)==(c[r>>2]|0):0)?(b[(c[u>>2]|0)+4>>1]|0)==(c[s>>2]|0):0){l=6;break}c[v>>2]=(c[v>>2]|0)+1;c[u>>2]=(c[u>>2]|0)+20}if((l|0)==6){e=(c[q>>2]|0)+104|0;d=c[e>>2]|0;c[e>>2]=d+1;c[(c[u>>2]|0)+16>>2]=d;it(c[q>>2]|0,c[(c[u>>2]|0)+12>>2]|0);c[m>>2]=c[(c[u>>2]|0)+12>>2];d=c[m>>2]|0;i=n;return d|0}zs(c[o>>2]|0,c[k>>2]|0,c[r>>2]|0,c[s>>2]|0,c[t>>2]|0);if(a[p>>0]|0)Xe(c[o>>2]|0,a[p>>0]|0);else jt(c[q>>2]|0,c[r>>2]|0,c[s>>2]|0,c[t>>2]|0);c[m>>2]=c[t>>2];d=c[m>>2]|0;i=n;return d|0}function Ss(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;h=i;i=i+48|0;n=h+8|0;q=h+44|0;r=h+40|0;p=h+36|0;g=h+32|0;j=h+28|0;l=h+24|0;o=h+20|0;k=h;m=h+16|0;f=h+12|0;c[q>>2]=a;c[r>>2]=b;c[p>>2]=d;c[g>>2]=e;c[j>>2]=c[(c[q>>2]|0)+8>>2];e=(c[r>>2]|0)+8|0;if(c[(c[r>>2]|0)+4>>2]&1024){c[l>>2]=c[e>>2];if(c[p>>2]|0)c[l>>2]=0-(c[l>>2]|0);fp(c[j>>2]|0,25,c[l>>2]|0,c[g>>2]|0)|0;i=h;return}c[m>>2]=c[e>>2];c[o>>2]=rg(c[m>>2]|0,k)|0;if((c[o>>2]|0)!=0?!((c[o>>2]|0)==2&(c[p>>2]|0)!=0):0)if(!(Lb(c[m>>2]|0,19336,2)|0)){r=c[q>>2]|0;c[n>>2]=c[m>>2];Se(r,19344,n);i=h;return}else{Ts(c[j>>2]|0,c[m>>2]|0,c[p>>2]|0,c[g>>2]|0);i=h;return}if(c[p>>2]|0){if((c[o>>2]|0)==2){m=0;l=-2147483648}else{m=k;m=ZE(0,0,c[m>>2]|0,c[m+4>>2]|0)|0;l=D}r=k;c[r>>2]=m;c[r+4>>2]=l}c[f>>2]=ht(c[j>>2]|0,k)|0;hp(c[j>>2]|0,26,0,c[g>>2]|0,0,c[f>>2]|0,-13)|0;i=h;return}function Ts(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,j=0,k=0,l=0,m=0,n=0;l=i;i=i+32|0;g=l+24|0;m=l+20|0;n=l+16|0;f=l+12|0;j=l;k=l+8|0;c[g>>2]=a;c[m>>2]=b;c[n>>2]=d;c[f>>2]=e;if(!(c[m>>2]|0)){i=l;return}a=c[m>>2]|0;Lm(a,j,Mb(c[m>>2]|0)|0,1)|0;if(c[n>>2]|0)h[j>>3]=-+h[j>>3];c[k>>2]=ht(c[g>>2]|0,j)|0;hp(c[g>>2]|0,133,0,c[f>>2]|0,0,c[k>>2]|0,-12)|0;i=l;return}function Us(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;h=e+8|0;g=e+4|0;f=e;c[h>>2]=a;c[g>>2]=b;c[f>>2]=d;Cs(c[h>>2]|0,c[g>>2]|0,c[f>>2]|0);i=e;return}function Vs(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=et(c[d>>2]|0,1)|0;i=b;return a|0}function Ws(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;r=i;i=i+48|0;n=r+36|0;v=r+32|0;q=r+28|0;u=r+41|0;t=r+24|0;h=r+20|0;k=r+16|0;o=r+40|0;p=r+12|0;s=r+8|0;m=r+4|0;l=r;c[n>>2]=b;c[v>>2]=e;c[q>>2]=f;a[u>>0]=g;a[o>>0]=(d[u>>0]&1|0)!=0?33:34;c[k>>2]=c[c[v>>2]>>2];if(!(a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n>>2]=0;c[k>>2]=0;c[u>>2]=0;if(!(c[z>>2]|0)){c[l>>2]=c[m>>2];f=c[l>>2]|0;i=o;return f|0}if((d[c[z>>2]>>0]|0)!=154){c[l>>2]=c[m>>2];f=c[l>>2]|0;i=o;return f|0}c[y>>2]=c[(c[z>>2]|0)+44>>2];if(!(c[y>>2]|0)){c[l>>2]=c[m>>2];f=c[l>>2]|0;i=o;return f|0}if(!(d[(c[y>>2]|0)+44>>0]&16)){c[l>>2]=c[m>>2];f=c[l>>2]|0;i=o;return f|0}c[q>>2]=c[(Rp(c[v>>2]|0,c[y>>2]|0)|0)+8>>2];c[x>>2]=c[c[q>>2]>>2];if(!(c[(c[x>>2]|0)+72>>2]|0)){c[l>>2]=c[m>>2];f=c[l>>2]|0;i=o;return f|0}c[s>>2]=ne(c[v>>2]|0,c[(c[m>>2]|0)+24>>2]|0)|0;if(c[s>>2]|0){c[w>>2]=c[s>>2];while(1){if(!(a[c[w>>2]>>0]|0))break;a[c[w>>2]>>0]=a[440+(d[c[w>>2]>>0]|0)>>0]|0;c[w>>2]=(c[w>>2]|0)+1}z=c[(c[x>>2]|0)+72>>2]|0;h=c[q>>2]|0;g=c[r>>2]|0;f=c[s>>2]|0;c[t>>2]=n;c[u>>2]=Ab[z&15](h,g,f,c[t>>2]|0,k)|0;Xb(c[v>>2]|0,c[s>>2]|0)}if(!(c[u>>2]|0)){c[l>>2]=c[m>>2];f=c[l>>2]|0;i=o;return f|0}f=c[v>>2]|0;c[p>>2]=se(f,37+(Mb(c[(c[m>>2]|0)+24>>2]|0)|0)|0,0)|0;if(!(c[p>>2]|0)){c[l>>2]=c[m>>2];f=c[l>>2]|0;i=o;return f|0}else{s=(c[p>>2]|0)+0|0;r=(c[m>>2]|0)+0|0;q=s+36|0;do{c[s>>2]=c[r>>2];s=s+4|0;r=r+4|0}while((s|0)<(q|0));c[(c[p>>2]|0)+24>>2]=(c[p>>2]|0)+36;g=c[(c[p>>2]|0)+24>>2]|0;f=c[(c[m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385]|0;a[n+2>>0]=a[4386]|0;a[n+3>>0]=a[4387]|0;a[n+4>>0]=a[4388]|0;a[n+5>>0]=a[4389]|0;a[n+6>>0]=a[4390]|0;a[n+7>>0]=a[4391]|0;ck((c[g>>2]|0)+8|0,-1)}vc(4,(c[k>>2]|0)+48|0);ck((c[g>>2]|0)+12|0,c[(c[k>>2]|0)+48>>2]|0);ck((c[g>>2]|0)+16|0,c[(c[k>>2]|0)+28>>2]|0);ck((c[g>>2]|0)+20|0,c[(c[k>>2]|0)+148>>2]|0);ck((c[g>>2]|0)+24|0,c[(c[k>>2]|0)+152>>2]|0);_E((c[g>>2]|0)+28|0,0,(c[h>>2]|0)-28|0)|0;c[j>>2]=0;while(1){if(c[e>>2]|0){g=17;break}if((c[j>>2]|0)>>>0>=(c[(c[k>>2]|0)+148>>2]|0)>>>0){g=17;break}n=(c[k>>2]|0)+72|0;c[e>>2]=id(c[(c[k>>2]|0)+64>>2]|0,c[g>>2]|0,c[h>>2]|0,c[n>>2]|0,c[n+4>>2]|0)|0;n=(c[k>>2]|0)+72|0;m=n;m=bF(c[m>>2]|0,c[m+4>>2]|0,c[h>>2]|0,0)|0;c[n>>2]=m;c[n+4>>2]=D;c[j>>2]=(c[j>>2]|0)+(c[h>>2]|0)}if((g|0)==17){i=f;return c[e>>2]|0}return 0}function fk(a){a=a|0;var d=0,f=0,g=0;f=i;i=i+16|0;d=f+4|0;g=f;c[d>>2]=a;c[g>>2]=c[c[d>>2]>>2];while(1){if(!(c[g>>2]|0))break;a=(c[g>>2]|0)+24|0;b[a>>1]=(e[a>>1]|0)&-5;c[g>>2]=c[(c[g>>2]|0)+32>>2]}c[(c[d>>2]|0)+8>>2]=c[(c[d>>2]|0)+4>>2];i=f;return}function gk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;f=d+8|0;g=d+4|0;e=d;c[f>>2]=a;c[g>>2]=b;while(1){c[e>>2]=hk(c[f>>2]|0,c[g>>2]|0)|0;if((c[e>>2]|0)!=5){b=4;break}if(!(ub[c[(c[f>>2]|0)+176>>2]&31](c[(c[f>>2]|0)+180>>2]|0)|0)){b=4;break}}if((b|0)==4){i=d;return c[e>>2]|0}return 0}function hk(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0;f=i;i=i+16|0;h=f+8|0;j=f+4|0;g=f;c[h>>2]=b;c[j>>2]=e;c[g>>2]=0;if((d[(c[h>>2]|0)+17>>0]|0|0)>=(c[j>>2]|0)?(d[(c[h>>2]|0)+17>>0]|0|0)!=5:0){b=c[g>>2]|0;i=f;return b|0}if(d[(c[h>>2]|0)+13>>0]|0)e=0;else e=pj(c[(c[h>>2]|0)+60>>2]|0,c[j>>2]|0)|0;c[g>>2]=e;if(c[g>>2]|0){b=c[g>>2]|0;i=f;return b|0}if(!((c[j>>2]|0)==4?1:(d[(c[h>>2]|0)+17>>0]|0|0)!=5)){b=c[g>>2]|0;i=f;return b|0}a[(c[h>>2]|0)+17>>0]=c[j>>2];b=c[g>>2]|0;i=f;return b|0}function ik(e,f,g,h,j,k){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0;z=i;i=i+144|0;n=z+104|0;q=z+100|0;C=z+96|0;E=z+92|0;v=z+88|0;p=z+84|0;s=z+80|0;o=z+76|0;B=z+72|0;A=z+68|0;u=z+64|0;x=z+60|0;w=z+56|0;t=z+32|0;r=z+8|0;H=z+112|0;G=z+48|0;l=z+44|0;y=z+40|0;F=z;c[q>>2]=e;c[C>>2]=f;c[E>>2]=g;c[v>>2]=h;c[p>>2]=j;c[s>>2]=k;c[u>>2]=0;c[x>>2]=0;e=jk(c[q>>2]|0)|0;c[o>>2]=e;if(e){c[n>>2]=c[o>>2];e=c[n>>2]|0;i=z;return e|0}c[B>>2]=c[(c[q>>2]|0)+68>>2];if(!(c[B>>2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>>2]|0)+60|0;c[e>>2]=(c[e>>2]|0)+1;c[(c[q>>2]|0)+72>>2]=c[v>>2]}if(c[p>>2]|0){Mj(c[q>>2]|0);c[(c[q>>2]|0)+12>>2]=c[B>>2]}}c[n>>2]=c[o>>2];e=c[n>>2]|0;i=z;return e|0}function jk(a){a=a|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;j=i;i=i+48|0;d=j+32|0;h=j+28|0;g=j+24|0;e=j+20|0;l=j+16|0;n=j+12|0;k=j+8|0;m=j+4|0;f=j;c[h>>2]=a;c[g>>2]=0;if(!(b[(c[h>>2]|0)+40>>1]|0)){c[l>>2]=Aj(c[h>>2]|0)|0;do if((c[c[l>>2]>>2]|0)>>>0>0){vc(4,n);c[g>>2]=vj(c[h>>2]|0,4,4)|0;if(c[g>>2]|0){if((c[g>>2]|0)==5)break;c[d>>2]=c[g>>2];n=c[d>>2]|0;i=j;return n|0}c[m>>2]=(c[h>>2]|0)+84;a=(c[h>>2]|0)+104|0;c[a>>2]=(c[a>>2]|0)+1;c[(c[h>>2]|0)+68>>2]=0;a=c[m>>2]|0;ck(a,1+(Hh(c[m>>2]|0)|0)|0);c[(c[m>>2]|0)+4>>2]=c[n>>2];Mj(c[h>>2]|0);c[c[l>>2]>>2]=0;c[(c[l>>2]|0)+8>>2]=0;c[k>>2]=2;while(1){if((c[k>>2]|0)>=5)break;c[(c[l>>2]|0)+4+(c[k>>2]<<2)>>2]=-1;c[k>>2]=(c[k>>2]|0)+1}ji(c[h>>2]|0,4,4)}while(0);hi(c[h>>2]|0,3);b[(c[h>>2]|0)+40>>1]=-1;c[e>>2]=0;do{m=c[h>>2]|0;n=(c[e>>2]|0)+1|0;c[e>>2]=n;c[g>>2]=nk(m,f,1,n)|0}while((c[g>>2]|0)==-1)}c[d>>2]=c[g>>2];n=c[d>>2]|0;i=j;return n|0}function kk(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0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]=Yh(c[(c[m>>2]|0)+4>>2]|0,c[(c[m>>2]|0)+16>>2]&19)|0;if((c[g>>2]|0)==0|(c[l>>2]|0)!=0){c[n>>2]=c[l>>2];a=c[n>>2]|0;i=o;return a|0}}a=h;c[l>>2]=id(c[(c[m>>2]|0)+4>>2]|0,c[k>>2]|0,c[g>>2]|0,c[a>>2]|0,c[a+4>>2]|0)|0;c[n>>2]=c[l>>2];a=c[n>>2]|0;i=o;return a|0}function nk(a,e,f,g){a=a|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;j=i;i=i+48|0;h=j+44|0;m=j+40|0;t=j+36|0;s=j+32|0;v=j+28|0;q=j+24|0;o=j+20|0;n=j+16|0;p=j+12|0;l=j+8|0;u=j+4|0;k=j;c[m>>2]=a;c[t>>2]=e;c[s>>2]=f;c[v>>2]=g;c[l>>2]=0;if((c[v>>2]|0)>5){c[u>>2]=1;if((c[v>>2]|0)>100){c[h>>2]=15;a=c[h>>2]|0;i=j;return a|0}if((c[v>>2]|0)>=10)c[u>>2]=($((c[v>>2]|0)-9|0,(c[v>>2]|0)-9|0)|0)*39;fg(c[c[m>>2]>>2]|0,c[u>>2]|0)|0}if(!(c[s>>2]|0)){c[l>>2]=xj(c[m>>2]|0,c[t>>2]|0)|0;do if((c[l>>2]|0)==5){if(!(c[c[(c[m>>2]|0)+32>>2]>>2]|0)){c[l>>2]=-1;break}a=gi(c[m>>2]|0,2)|0;c[l>>2]=a;if(!a){hi(c[m>>2]|0,2);c[l>>2]=-1;break}if((c[l>>2]|0)==5)c[l>>2]=261}while(0);if(c[l>>2]|0){c[h>>2]=c[l>>2];a=c[h>>2]|0;i=j;return a|0}}c[q>>2]=Aj(c[m>>2]|0)|0;do if((c[s>>2]|0)==0?(c[c[q>>2]>>2]|0)==(c[(c[m>>2]|0)+68>>2]|0):0){c[l>>2]=gi(c[m>>2]|0,3)|0;Nj(c[m>>2]|0);if(c[l>>2]|0){if((c[l>>2]|0)==5)break;c[h>>2]=c[l>>2];a=c[h>>2]|0;i=j;return a|0}a=mj(c[m>>2]|0)|0;a=(TE(a,(c[m>>2]|0)+52|0,48)|0)!=0;k=c[m>>2]|0;if(a){hi(k,3);c[h>>2]=-1;a=c[h>>2]|0;i=j;return a|0}else{b[k+40>>1]=0;c[h>>2]=0;a=c[h>>2]|0;i=j;return a|0}}while(0);c[o>>2]=0;c[n>>2]=0;c[p>>2]=1;while(1){if((c[p>>2]|0)>=5)break;c[k>>2]=c[(c[q>>2]|0)+4+(c[p>>2]<<2)>>2];if((c[o>>2]|0)>>>0<=(c[k>>2]|0)>>>0?(c[k>>2]|0)>>>0<=(c[(c[m>>2]|0)+68>>2]|0)>>>0:0){c[o>>2]=c[k>>2];c[n>>2]=c[p>>2]}c[p>>2]=(c[p>>2]|0)+1}a:do if(((d[(c[m>>2]|0)+46>>0]|0)&2|0)==0?(c[n>>2]|0)==0?1:(c[o>>2]|0)>>>0<(c[(c[m>>2]|0)+68>>2]|0)>>>0:0){c[p>>2]=1;while(1){if((c[p>>2]|0)>=5)break a;c[l>>2]=vj(c[m>>2]|0,3+(c[p>>2]|0)|0,1)|0;if(!(c[l>>2]|0)){r=36;break}if((c[l>>2]|0)!=5)break;c[p>>2]=(c[p>>2]|0)+1}if((r|0)==36){a=c[(c[m>>2]|0)+68>>2]|0;c[(c[q>>2]|0)+4+(c[p>>2]<<2)>>2]=a;c[o>>2]=a;c[n>>2]=c[p>>2];ji(c[m>>2]|0,3+(c[p>>2]|0)|0,1);break}c[h>>2]=c[l>>2];a=c[h>>2]|0;i=j;return a|0}while(0);if(!(c[n>>2]|0)){c[h>>2]=(c[l>>2]|0)==5?-1:520;a=c[h>>2]|0;i=j;return a|0}c[l>>2]=gi(c[m>>2]|0,3+(c[n>>2]|0)|0)|0;if(c[l>>2]|0){c[h>>2]=(c[l>>2]|0)==5?-1:c[l>>2]|0;a=c[h>>2]|0;i=j;return a|0}Nj(c[m>>2]|0);if((c[(c[q>>2]|0)+4+(c[n>>2]<<2)>>2]|0)==(c[o>>2]|0)?(a=mj(c[m>>2]|0)|0,(TE(a,(c[m>>2]|0)+52|0,48)|0)==0):0){b[(c[m>>2]|0)+40>>1]=c[n>>2];c[h>>2]=c[l>>2];a=c[h>>2]|0;i=j;return a|0}hi(c[m>>2]|0,3+(c[n>>2]|0)|0);c[h>>2]=-1;a=c[h>>2]|0;i=j;return a|0}function ok(a){a=a|0;var b=0,e=0,f=0;b=i;i=i+16|0;f=b+4|0;e=b;c[f>>2]=a;c[e>>2]=0;if(c[c[(c[f>>2]|0)+68>>2]>>2]|0){f=c[e>>2]|0;i=b;return f|0}if((d[(c[f>>2]|0)+5>>0]|0|0)!=4?(d[(c[f>>2]|0)+21>>0]|0|0)==0:0){c[e>>2]=ak(c[f>>2]|0,c[(c[f>>2]|0)+68>>2]|0,8192)|0;f=c[e>>2]|0;i=b;return f|0}qi(c[(c[f>>2]|0)+68>>2]|0);f=c[e>>2]|0;i=b;return f|0}function pk(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+32|0;h=f+12|0;j=f;k=f+8|0;g=f+16|0;c[h>>2]=a;a=j;c[a>>2]=b;c[a+4>>2]=d;c[k>>2]=e;ck(g,c[k>>2]|0);a=j;a=id(c[h>>2]|0,g,4,c[a>>2]|0,c[a+4>>2]|0)|0;i=f;return a|0}function qk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;i=i+32|0;f=d+16|0;j=d+12|0;g=d+8|0;e=d+4|0;h=d;c[f>>2]=a;c[j>>2]=b;c[e>>2]=0;c[g>>2]=0;while(1){if((c[g>>2]|0)>=(c[(c[f>>2]|0)+96>>2]|0))break;c[h>>2]=(c[(c[f>>2]|0)+92>>2]|0)+((c[g>>2]|0)*48|0);if((c[j>>2]|0)>>>0<=(c[(c[h>>2]|0)+20>>2]|0)>>>0){a=Wg(c[(c[h>>2]|0)+16>>2]|0,c[j>>2]|0)|0;c[e>>2]=c[e>>2]|a}c[g>>2]=(c[g>>2]|0)+1}i=d;return c[e>>2]|0}function rk(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+16|0;g=e+4|0;f=e;c[g>>2]=b;c[f>>2]=d;while(1){if((c[f>>2]|0)>0)b=(a[(c[g>>2]|0)+((c[f>>2]|0)-1)>>0]|0)==32;else b=0;d=c[f>>2]|0;if(!b)break;c[f>>2]=d+ -1}i=e;return(d|0)==0|0}function sk(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b;e=b+4|0;c[e>>2]=a;c[d>>2]=c[e>>2];tc(21,4880,d);i=b;return}function tk(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;l=i;i=i+32|0;n=l+20|0;k=l+16|0;g=l+12|0;m=l+8|0;h=l+4|0;j=l;c[n>>2]=a;c[k>>2]=b;c[g>>2]=e;c[m>>2]=f;c[h>>2]=0;if(!(c[n>>2]|0)){a=c[h>>2]|0;i=l;return a|0}c[j>>2]=c[(c[n>>2]|0)+4>>2];Pc(c[n>>2]|0);if(d[(c[j>>2]|0)+20>>0]|0){c[h>>2]=6;a=c[h>>2]|0;i=l;return a|0}else{c[h>>2]=uk(c[c[j>>2]>>2]|0,c[k>>2]|0,c[g>>2]|0,c[m>>2]|0)|0;a=c[h>>2]|0;i=l;return a|0}return 0}function uk(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+32|0;j=g+16|0;k=g+12|0;l=g+8|0;m=g+4|0;h=g;c[j>>2]=a;c[k>>2]=b;c[l>>2]=e;c[m>>2]=f;c[h>>2]=0;if(!(c[(c[j>>2]|0)+208>>2]|0)){a=c[h>>2]|0;i=g;return a|0}c[h>>2]=qj(c[(c[j>>2]|0)+208>>2]|0,c[k>>2]|0,c[(c[j>>2]|0)+176>>2]|0,c[(c[j>>2]|0)+180>>2]|0,d[(c[j>>2]|0)+9>>0]|0,c[(c[j>>2]|0)+152>>2]|0,c[(c[j>>2]|0)+200>>2]|0,c[l>>2]|0,c[m>>2]|0)|0;a=c[h>>2]|0;i=g;return a|0}function vk(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;h=i;i=i+32|0;g=h+20|0;n=h+16|0;m=h+12|0;k=h+8|0;l=h+4|0;j=h;c[n>>2]=b;c[m>>2]=d;c[k>>2]=e;c[l>>2]=f;c[j>>2]=c[(c[n>>2]|0)+(c[m>>2]<<2)>>2];while(1){if(!(c[j>>2]|0)){f=7;break}if((Lb(c[(c[j>>2]|0)+24>>2]|0,c[k>>2]|0,c[l>>2]|0)|0)==0?(a[(c[(c[j>>2]|0)+24>>2]|0)+(c[l>>2]|0)>>0]|0)==0:0){f=5;break}c[j>>2]=c[(c[j>>2]|0)+28>>2]}if((f|0)==5){c[g>>2]=c[j>>2];n=c[g>>2]|0;i=h;return n|0}else if((f|0)==7){c[g>>2]=0;n=c[g>>2]|0;i=h;return n|0}return 0}function wk(f,g,h){f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0;j=i;i=i+32|0;k=j+12|0;m=j+8|0;o=j+4|0;n=j+16|0;l=j;c[m>>2]=f;c[o>>2]=g;a[n>>0]=h;h=c[m>>2]|0;if((c[o>>2]|0)==-2){if(!(c[h+12>>2]|0))l=(c[(c[m>>2]|0)+16>>2]|0)==0;else l=0;c[k>>2]=l?0:6;f=c[k>>2]|0;i=j;return f|0}if((b[h>>1]|0)!=(c[o>>2]|0)?(b[c[m>>2]>>1]|0)>=0:0){c[k>>2]=0;f=c[k>>2]|0;i=j;return f|0}if((b[c[m>>2]>>1]|0)==(c[o>>2]|0))c[l>>2]=4;else c[l>>2]=1;if((d[n>>0]|0)!=(e[(c[m>>2]|0)+2>>1]&3|0)){if(d[n>>0]&e[(c[m>>2]|0)+2>>1]&2)c[l>>2]=(c[l>>2]|0)+1}else c[l>>2]=(c[l>>2]|0)+2;c[k>>2]=c[l>>2];f=c[k>>2]|0;i=j;return f|0}function xk(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+32|0;k=f+16|0;h=f+12|0;g=f+8|0;l=f+4|0;m=f+20|0;j=f;c[k>>2]=b;c[h>>2]=e;c[l>>2]=Mb(c[(c[h>>2]|0)+24>>2]|0)|0;a[m>>0]=a[c[(c[h>>2]|0)+24>>2]>>0]|0;c[j>>2]=((d[440+(d[m>>0]|0)>>0]|0)+(c[l>>2]|0)|0)%23|0;c[g>>2]=vk(c[k>>2]|0,c[j>>2]|0,c[(c[h>>2]|0)+24>>2]|0,c[l>>2]|0)|0;if(c[g>>2]|0){c[(c[h>>2]|0)+8>>2]=c[(c[g>>2]|0)+8>>2];c[(c[g>>2]|0)+8>>2]=c[h>>2];i=f;return}else{c[(c[h>>2]|0)+8>>2]=0;c[(c[h>>2]|0)+28>>2]=c[(c[k>>2]|0)+(c[j>>2]<<2)>>2];c[(c[k>>2]|0)+(c[j>>2]<<2)>>2]=c[h>>2];i=f;return}}function yk(a,b){a=a|0;b=b|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;g=f+12|0;k=f+8|0;j=f+4|0;h=f;c[k>>2]=a;c[j>>2]=b;if(((e[(c[k>>2]|0)+8>>1]|0)&2|0)!=0?(d[(c[k>>2]|0)+10>>0]|0|0)!=(c[j>>2]|0):0){c[h>>2]=zk(c[k>>2]|0,c[j>>2]&255)|0;c[g>>2]=c[h>>2];a=c[g>>2]|0;i=f;return a|0}c[g>>2]=0;a=c[g>>2]|0;i=f;return a|0}function zk(f,g){f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;j=i;i=i+48|0;o=j+40|0;l=j+36|0;k=j+45|0;t=j+32|0;q=j+28|0;m=j+24|0;n=j+20|0;h=j+16|0;p=j+12|0;u=j+44|0;v=j+8|0;r=j+4|0;s=j;c[l>>2]=f;a[k>>0]=g;if((d[(c[l>>2]|0)+10>>0]|0|0)!=1?(d[k>>0]|0|0)!=1:0){c[v>>2]=Ak(c[l>>2]|0)|0;if(c[v>>2]|0){c[o>>2]=7;g=c[o>>2]|0;i=j;return g|0}c[m>>2]=c[(c[l>>2]|0)+16>>2];c[n>>2]=(c[m>>2]|0)+(c[(c[l>>2]|0)+12>>2]&-2);while(1){if((c[m>>2]|0)>>>0>=(c[n>>2]|0)>>>0)break;a[u>>0]=a[c[m>>2]>>0]|0;a[c[m>>2]>>0]=a[(c[m>>2]|0)+1>>0]|0;c[m>>2]=(c[m>>2]|0)+1;v=a[u>>0]|0;g=c[m>>2]|0;c[m>>2]=g+1;a[g>>0]=v}a[(c[l>>2]|0)+10>>0]=a[k>>0]|0}else{f=(c[l>>2]|0)+12|0;u=c[f>>2]|0;if((d[k>>0]|0|0)==1){c[f>>2]=u&-2;c[t>>2]=(c[(c[l>>2]|0)+12>>2]<<1)+1}else c[t>>2]=(u<<1)+2;c[m>>2]=c[(c[l>>2]|0)+16>>2];c[n>>2]=(c[m>>2]|0)+(c[(c[l>>2]|0)+12>>2]|0);g=c[t>>2]|0;c[q>>2]=Qe(c[(c[l>>2]|0)+32>>2]|0,g,((g|0)<0)<<31>>31)|0;if(!(c[q>>2]|0)){c[o>>2]=7;g=c[o>>2]|0;i=j;return g|0}c[h>>2]=c[q>>2];if((d[(c[l>>2]|0)+10>>0]|0|0)==1){a:do if((d[k>>0]|0|0)==2)while(1){if((c[m>>2]|0)>>>0>=(c[n>>2]|0)>>>0)break a;g=c[m>>2]|0;c[m>>2]=g+1;c[p>>2]=d[g>>0];do if((c[p>>2]|0)>>>0>=192){c[p>>2]=d[4984+((c[p>>2]|0)-192)>>0];while(1){if((c[m>>2]|0)!=(c[n>>2]|0))r=((d[c[m>>2]>>0]|0)&192|0)==128;else r=0;s=c[p>>2]|0;if(!r)break;g=c[m>>2]|0;c[m>>2]=g+1;c[p>>2]=(s<<6)+(63&(d[g>>0]|0))}if((s>>>0>=128?(c[p>>2]&-2048|0)!=55296:0)?(c[p>>2]&-2|0)!=65534:0)break;c[p>>2]=65533}while(0);r=c[p>>2]|0;if((c[p>>2]|0)>>>0<=65535){v=c[h>>2]|0;c[h>>2]=v+1;a[v>>0]=r;v=(c[p>>2]|0)>>>8&255;g=c[h>>2]|0;c[h>>2]=g+1;a[g>>0]=v;continue}else{g=(r>>>10&63)+(((c[p>>2]|0)-65536|0)>>>10&192)&255;v=c[h>>2]|0;c[h>>2]=v+1;a[v>>0]=g;v=216+(((c[p>>2]|0)-65536|0)>>>18&3)&255;g=c[h>>2]|0;c[h>>2]=g+1;a[g>>0]=v;g=c[p>>2]&255;v=c[h>>2]|0;c[h>>2]=v+1;a[v>>0]=g;v=220+((c[p>>2]|0)>>>8&3)&255;g=c[h>>2]|0;c[h>>2]=g+1;a[g>>0]=v;continue}}else while(1){if((c[m>>2]|0)>>>0>=(c[n>>2]|0)>>>0)break a;g=c[m>>2]|0;c[m>>2]=g+1;c[p>>2]=d[g>>0];do if((c[p>>2]|0)>>>0>=192){c[p>>2]=d[4984+((c[p>>2]|0)-192)>>0];while(1){if((c[m>>2]|0)!=(c[n>>2]|0))s=((d[c[m>>2]>>0]|0)&192|0)==128;else s=0;r=c[p>>2]|0;if(!s)break;g=c[m>>2]|0;c[m>>2]=g+1;c[p>>2]=(r<<6)+(63&(d[g>>0]|0))}if((r>>>0>=128?(c[p>>2]&-2048|0)!=55296:0)?(c[p>>2]&-2|0)!=65534:0)break;c[p>>2]=65533}while(0);r=c[p>>2]|0;if((c[p>>2]|0)>>>0<=65535){v=c[h>>2]|0;c[h>>2]=v+1;a[v>>0]=r>>>8;v=c[p>>2]&255;g=c[h>>2]|0;c[h>>2]=g+1;a[g>>0]=v;continue}else{v=c[h>>2]|0;c[h>>2]=v+1;a[v>>0]=216+((r-65536|0)>>>18&3);v=((c[p>>2]|0)>>>10&63)+(((c[p>>2]|0)-65536|0)>>>10&192)&255;g=c[h>>2]|0;c[h>>2]=g+1;a[g>>0]=v;g=220+((c[p>>2]|0)>>>8&3)&255;v=c[h>>2]|0;c[h>>2]=v+1;a[v>>0]=g;v=c[p>>2]&255;g=c[h>>2]|0;c[h>>2]=g+1;a[g>>0]=v;continue}}while(0);c[(c[l>>2]|0)+12>>2]=(c[h>>2]|0)-(c[q>>2]|0);g=c[h>>2]|0;c[h>>2]=g+1;a[g>>0]=0}else{b:do if((d[(c[l>>2]|0)+10>>0]|0|0)==2)while(1){if((c[m>>2]|0)>>>0>=(c[n>>2]|0)>>>0)break b;g=c[m>>2]|0;c[m>>2]=g+1;c[p>>2]=d[g>>0];g=c[m>>2]|0;c[m>>2]=g+1;c[p>>2]=(c[p>>2]|0)+((d[g>>0]|0)<<8);if((c[p>>2]|0)>>>0>=55296&(c[p>>2]|0)>>>0<57344?(c[m>>2]|0)>>>0<(c[n>>2]|0)>>>0:0){g=c[m>>2]|0;c[m>>2]=g+1;c[r>>2]=d[g>>0];g=c[m>>2]|0;c[m>>2]=g+1;c[r>>2]=(c[r>>2]|0)+((d[g>>0]|0)<<8);c[p>>2]=(c[r>>2]&1023)+((c[p>>2]&63)<<10)+((c[p>>2]&960)+64<<10)}t=c[p>>2]|0;if((c[p>>2]|0)>>>0<128){g=c[h>>2]|0;c[h>>2]=g+1;a[g>>0]=t;continue}s=c[p>>2]|0;if(t>>>0<2048){v=c[h>>2]|0;c[h>>2]=v+1;a[v>>0]=192+(s>>>6&31);v=128+(c[p>>2]&63)&255;g=c[h>>2]|0;c[h>>2]=g+1;a[g>>0]=v;continue}t=c[p>>2]|0;if(s>>>0<65536){g=c[h>>2]|0;c[h>>2]=g+1;a[g>>0]=224+(t>>>12&15);g=128+((c[p>>2]|0)>>>6&63)&255;v=c[h>>2]|0;c[h>>2]=v+1;a[v>>0]=g;v=128+(c[p>>2]&63)&255;g=c[h>>2]|0;c[h>>2]=g+1;a[g>>0]=v;continue}else{v=c[h>>2]|0;c[h>>2]=v+1;a[v>>0]=240+(t>>>18&7);v=128+((c[p>>2]|0)>>>12&63)&255;g=c[h>>2]|0;c[h>>2]=g+1;a[g>>0]=v;g=128+((c[p>>2]|0)>>>6&63)&255;v=c[h>>2]|0;c[h>>2]=v+1;a[v>>0]=g;v=128+(c[p>>2]&63)&255;g=c[h>>2]|0;c[h>>2]=g+1;a[g>>0]=v;continue}}else while(1){if((c[m>>2]|0)>>>0>=(c[n>>2]|0)>>>0)break b;g=c[m>>2]|0;c[m>>2]=g+1;c[p>>2]=(d[g>>0]|0)<<8;g=c[m>>2]|0;c[m>>2]=g+1;c[p>>2]=(c[p>>2]|0)+(d[g>>0]|0);if((c[p>>2]|0)>>>0>=55296&(c[p>>2]|0)>>>0<57344?(c[m>>2]|0)>>>0<(c[n>>2]|0)>>>0:0){g=c[m>>2]|0;c[m>>2]=g+1;c[s>>2]=(d[g>>0]|0)<<8;g=c[m>>2]|0;c[m>>2]=g+1;c[s>>2]=(c[s>>2]|0)+(d[g>>0]|0);c[p>>2]=(c[s>>2]&1023)+((c[p>>2]&63)<<10)+((c[p>>2]&960)+64<<10)}t=c[p>>2]|0;if((c[p>>2]|0)>>>0<128){g=c[h>>2]|0;c[h>>2]=g+1;a[g>>0]=t;continue}r=c[p>>2]|0;if(t>>>0<2048){v=c[h>>2]|0;c[h>>2]=v+1;a[v>>0]=192+(r>>>6&31);v=128+(c[p>>2]&63)&255;g=c[h>>2]|0;c[h>>2]=g+1;a[g>>0]=v;continue}t=c[p>>2]|0;if(r>>>0<65536){g=c[h>>2]|0;c[h>>2]=g+1;a[g>>0]=224+(t>>>12&15);g=128+((c[p>>2]|0)>>>6&63)&255;v=c[h>>2]|0;c[h>>2]=v+1;a[v>>0]=g;v=128+(c[p>>2]&63)&255;g=c[h>>2]|0;c[h>>2]=g+1;a[g>>0]=v;continue}else{v=c[h>>2]|0;c[h>>2]=v+1;a[v>>0]=240+(t>>>18&7);v=128+((c[p>>2]|0)>>>12&63)&255;g=c[h>>2]|0;c[h>>2]=g+1;a[g>>0]=v;g=128+((c[p>>2]|0)>>>6&63)&255;v=c[h>>2]|0;c[h>>2]=v+1;a[v>>0]=g;v=128+(c[p>>2]&63)&255;g=c[h>>2]|0;c[h>>2]=g+1;a[g>>0]=v;continue}}while(0);c[(c[l>>2]|0)+12>>2]=(c[h>>2]|0)-(c[q>>2]|0)}a[c[h>>2]>>0]=0;c[p>>2]=e[(c[l>>2]|0)+8>>1];Bd(c[l>>2]|0);b[(c[l>>2]|0)+8>>1]=514|c[p>>2]&31;a[(c[l>>2]|0)+10>>0]=a[k>>0]|0;c[(c[l>>2]|0)+16>>2]=c[q>>2];c[(c[l>>2]|0)+20>>2]=c[(c[l>>2]|0)+16>>2];g=Bk(c[(c[l>>2]|0)+32>>2]|0,c[(c[l>>2]|0)+16>>2]|0)|0;c[(c[l>>2]|0)+24>>2]=g}c[o>>2]=0;g=c[o>>2]|0;i=j;return g|0}function Ak(d){d=d|0;var f=0,g=0,h=0,j=0;h=i;i=i+16|0;g=h+8|0;f=h+4|0;j=h;c[f>>2]=d;if((e[(c[f>>2]|0)+8>>1]|0)&16384)Dd(c[f>>2]|0)|0;c[j>>2]=e[(c[f>>2]|0)+8>>1];do if(c[j>>2]&18){if((c[(c[f>>2]|0)+24>>2]|0)!=0?(c[(c[f>>2]|0)+16>>2]|0)==(c[(c[f>>2]|0)+20>>2]|0):0)break;if(!(Dk(c[f>>2]|0,(c[(c[f>>2]|0)+12>>2]|0)+2|0,1)|0)){a[(c[(c[f>>2]|0)+16>>2]|0)+(c[(c[f>>2]|0)+12>>2]|0)>>0]=0;a[(c[(c[f>>2]|0)+16>>2]|0)+((c[(c[f>>2]|0)+12>>2]|0)+1)>>0]=0;j=(c[f>>2]|0)+8|0;b[j>>1]=e[j>>1]|0|512;break}c[g>>2]=7;j=c[g>>2]|0;i=h;return j|0}while(0);c[g>>2]=0;j=c[g>>2]|0;i=h;return j|0}function Bk(a,b){a=a|0;b=b|0;var d=0,f=0,g=0,h=0;d=i;i=i+16|0;f=d+8|0;h=d+4|0;g=d;c[h>>2]=a;c[g>>2]=b;if(!(c[h>>2]|0)){c[f>>2]=Tb(c[g>>2]|0)|0;a=c[f>>2]|0;i=d;return a|0}if(Ck(c[h>>2]|0,c[g>>2]|0)|0){c[f>>2]=e[(c[h>>2]|0)+248>>1];a=c[f>>2]|0;i=d;return a|0}else{c[f>>2]=ub[c[38640+48>>2]&31](c[g>>2]|0)|0;a=c[f>>2]|0;i=d;return a|0}return 0}function Ck(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;if((c[e>>2]|0)>>>0<(c[(c[f>>2]|0)+276>>2]|0)>>>0){a=0;a=a&1;i=d;return a|0}a=(c[e>>2]|0)>>>0<(c[(c[f>>2]|0)+280>>2]|0)>>>0;a=a&1;i=d;return a|0}function Dk(a,d,f){a=a|0;d=d|0;f=f|0;var g=0,h=0,j=0,k=0,l=0;k=i;i=i+16|0;j=k+12|0;h=k+8|0;l=k+4|0;g=k;c[h>>2]=a;c[l>>2]=d;c[g>>2]=f;do if((c[(c[h>>2]|0)+24>>2]|0)<(c[l>>2]|0)){if((c[l>>2]|0)<32)c[l>>2]=32;if(((c[g>>2]|0)!=0?(c[(c[h>>2]|0)+24>>2]|0)>0:0)?(c[(c[h>>2]|0)+16>>2]|0)==(c[(c[h>>2]|0)+20>>2]|0):0){a=c[l>>2]|0;a=Ek(c[(c[h>>2]|0)+32>>2]|0,c[(c[h>>2]|0)+16>>2]|0,a,((a|0)<0)<<31>>31)|0;c[(c[h>>2]|0)+20>>2]=a;c[(c[h>>2]|0)+16>>2]=a;c[g>>2]=0}else{if((c[(c[h>>2]|0)+24>>2]|0)>0)Xb(c[(c[h>>2]|0)+32>>2]|0,c[(c[h>>2]|0)+20>>2]|0);a=c[l>>2]|0;a=Qe(c[(c[h>>2]|0)+32>>2]|0,a,((a|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2]=0;do if(!(d[(c[o>>2]|0)+64>>0]|0)){h=c[o>>2]|0;if(!(c[j>>2]|0)){b=l;c[k>>2]=Qe(h,c[b>>2]|0,c[b+4>>2]|0)|0;b=c[k>>2]|0;i=n;return b|0}if(!(Ck(h,c[j>>2]|0)|0)){b=l;c[m>>2]=lc(c[j>>2]|0,c[b>>2]|0,c[b+4>>2]|0)|0;if(c[m>>2]|0)break;a[(c[o>>2]|0)+64>>0]=1;break}b=l;f=c[b+4>>2]|0;if(f>>>0<0|((f|0)==0?(c[b>>2]|0)>>>0<=(e[(c[o>>2]|0)+248>>1]|0)>>>0:0)){c[k>>2]=c[j>>2];b=c[k>>2]|0;i=n;return b|0}else{b=l;c[m>>2]=Qe(c[o>>2]|0,c[b>>2]|0,c[b+4>>2]|0)|0;if(!(c[m>>2]|0))break;dF(c[m>>2]|0,c[j>>2]|0,e[(c[o>>2]|0)+248>>1]|0|0)|0;Xb(c[o>>2]|0,c[j>>2]|0);break}}while(0);c[k>>2]=c[m>>2];b=c[k>>2]|0;i=n;return b|0}function Gk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;f=d+8|0;g=d+4|0;e=d;c[f>>2]=a;c[g>>2]=b;c[e>>2]=c[(c[g>>2]|0)+32>>2];if(!(c[e>>2]|0)){i=d;return}g=c[e>>2]|0;c[g>>2]=(c[g>>2]|0)+ -1;if(c[c[e>>2]>>2]|0){i=d;return}rb[c[(c[e>>2]|0)+4>>2]&31](c[(c[e>>2]|0)+8>>2]|0);Xb(c[f>>2]|0,c[e>>2]|0);i=d;return}function Hk(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+16|0;d=b+12|0;e=b+8|0;f=b+4|0;g=b;c[e>>2]=a;if(c[(c[e>>2]|0)+4>>2]|0){c[d>>2]=1;g=c[d>>2]|0;i=b;return g|0}c[f>>2]=0;while(1){if((c[f>>2]|0)>=(c[(c[e>>2]|0)+20>>2]|0)){a=9;break}c[g>>2]=c[(c[(c[e>>2]|0)+16>>2]|0)+(c[f>>2]<<4)+4>>2];if((c[g>>2]|0)!=0?(Wk(c[g>>2]|0)|0)!=0:0){a=7;break}c[f>>2]=(c[f>>2]|0)+1}if((a|0)==7){c[d>>2]=1;g=c[d>>2]|0;i=b;return g|0}else if((a|0)==9){c[d>>2]=0;g=c[d>>2]|0;i=b;return g|0}return 0}function Ik(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+32|0;g=f+20|0;l=f+16|0;k=f+12|0;h=f+8|0;m=f+4|0;j=f;c[g>>2]=b;c[l>>2]=e;c[h>>2]=0;kh();Rb(c[g>>2]|0);if(c[(c[g>>2]|0)+24>>2]&2)e=(d[(c[g>>2]|0)+145>>0]|0)==0;else e=0;c[m>>2]=e&1;c[k>>2]=0;while(1){if((c[k>>2]|0)>=(c[(c[g>>2]|0)+20>>2]|0))break;c[j>>2]=c[(c[(c[g>>2]|0)+16>>2]|0)+(c[k>>2]<<4)+4>>2];if(c[j>>2]|0){if(Tk(c[j>>2]|0)|0)c[h>>2]=1;qd(c[j>>2]|0,c[l>>2]|0,((c[m>>2]|0)!=0^1)&1)|0}c[k>>2]=(c[k>>2]|0)+1}Uk(c[g>>2]|0)|0;lh();if((c[(c[g>>2]|0)+24>>2]&2|0)!=0?(d[(c[g>>2]|0)+145>>0]|0)==0:0){gf(c[g>>2]|0);cd(c[g>>2]|0)}b=(c[g>>2]|0)+504|0;c[b>>2]=0;c[b+4>>2]=0;b=(c[g>>2]|0)+512|0;c[b>>2]=0;c[b+4>>2]=0;b=(c[g>>2]|0)+24|0;c[b>>2]=c[b>>2]&-16777217;if(!(c[(c[g>>2]|0)+200>>2]|0)){i=f;return}if((c[h>>2]|0)==0?(a[(c[g>>2]|0)+62>>0]|0)!=0:0){i=f;return}rb[c[(c[g>>2]|0)+200>>2]&31](c[(c[g>>2]|0)+196>>2]|0);i=f;return}function Jk(b){b=b|0;var d=0,e=0,f=0;e=i;i=i+16|0;d=e+4|0;f=e;c[d>>2]=b;while(1){b=c[d>>2]|0;if(!(c[(c[d>>2]|0)+488>>2]|0))break;c[f>>2]=c[b+488>>2];c[(c[d>>2]|0)+488>>2]=c[(c[f>>2]|0)+24>>2];Xb(c[d>>2]|0,c[f>>2]|0)}c[b+496>>2]=0;c[(c[d>>2]|0)+500>>2]=0;a[(c[d>>2]|0)+69>>0]=0;i=e;return}function Kk(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;e=i;i=i+16|0;d=e+12|0;f=e+8|0;g=e+4|0;h=e;c[d>>2]=b;c[f>>2]=c[(c[d>>2]|0)+4>>2];Pc(c[d>>2]|0);c[g>>2]=c[(c[f>>2]|0)+8>>2];while(1){if(!(c[g>>2]|0))break;c[h>>2]=c[g>>2];c[g>>2]=c[(c[g>>2]|0)+8>>2];if((c[c[h>>2]>>2]|0)!=(c[d>>2]|0))continue;Ok(c[h>>2]|0)|0}qd(c[d>>2]|0,0,0)|0;if(!((a[(c[d>>2]|0)+9>>0]|0)!=0?(Pk(c[f>>2]|0)|0)==0:0)){Ih(c[c[f>>2]>>2]|0)|0;if((c[(c[f>>2]|0)+52>>2]|0)!=0?(c[(c[f>>2]|0)+48>>2]|0)!=0:0)rb[c[(c[f>>2]|0)+52>>2]&31](c[(c[f>>2]|0)+48>>2]|0);Xb(0,c[(c[f>>2]|0)+48>>2]|0);Dg(c[f>>2]|0);hc(c[f>>2]|0)}if(c[(c[d>>2]|0)+24>>2]|0)c[(c[(c[d>>2]|0)+24>>2]|0)+20>>2]=c[(c[d>>2]|0)+20>>2];if(!(c[(c[d>>2]|0)+20>>2]|0)){h=c[d>>2]|0;hc(h);i=e;return 0}c[(c[(c[d>>2]|0)+20>>2]|0)+24>>2]=c[(c[d>>2]|0)+24>>2];h=c[d>>2]|0;hc(h);i=e;return 0}function Lk(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;f=b+8|0;d=b+4|0;e=b;c[f>>2]=a;c[d>>2]=c[(c[f>>2]|0)+332>>2];c[(c[f>>2]|0)+332>>2]=0;if(!(c[d>>2]|0)){i=b;return}gf(c[f>>2]|0);do{c[e>>2]=c[(c[d>>2]|0)+24>>2];Nk(c[d>>2]|0);c[d>>2]=c[e>>2]}while((c[d>>2]|0)!=0);i=b;return}function Mk(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=i;i=i+16|0;d=b+12|0;g=b+8|0;e=b+4|0;f=b;c[d>>2]=a;c[e>>2]=2;c[g>>2]=2;while(1){if((c[g>>2]|0)>=(c[(c[d>>2]|0)+20>>2]|0))break;c[f>>2]=(c[(c[d>>2]|0)+16>>2]|0)+(c[g>>2]<<4);if(!(c[(c[f>>2]|0)+4>>2]|0)){Xb(c[d>>2]|0,c[c[f>>2]>>2]|0);c[c[f>>2]>>2]=0}else{if((c[e>>2]|0)<(c[g>>2]|0)){a=(c[(c[d>>2]|0)+16>>2]|0)+(c[e>>2]<<4)|0;h=(c[(c[d>>2]|0)+16>>2]|0)+(c[g>>2]<<4)|0;c[a+0>>2]=c[h+0>>2];c[a+4>>2]=c[h+4>>2];c[a+8>>2]=c[h+8>>2];c[a+12>>2]=c[h+12>>2]}c[e>>2]=(c[e>>2]|0)+1}c[g>>2]=(c[g>>2]|0)+1}_E((c[(c[d>>2]|0)+16>>2]|0)+(c[e>>2]<<4)|0,0,(c[(c[d>>2]|0)+20>>2]|0)-(c[e>>2]|0)<<4|0)|0;c[(c[d>>2]|0)+20>>2]=c[e>>2];if((c[(c[d>>2]|0)+20>>2]|0)>2){i=b;return}if((c[(c[d>>2]|0)+16>>2]|0)==((c[d>>2]|0)+456|0)){i=b;return}h=(c[d>>2]|0)+456|0;g=c[(c[d>>2]|0)+16>>2]|0;c[h+0>>2]=c[g+0>>2];c[h+4>>2]=c[g+4>>2];c[h+8>>2]=c[g+8>>2];c[h+12>>2]=c[g+12>>2];c[h+16>>2]=c[g+16>>2];c[h+20>>2]=c[g+20>>2];c[h+24>>2]=c[g+24>>2];c[h+28>>2]=c[g+28>>2];Xb(c[d>>2]|0,c[(c[d>>2]|0)+16>>2]|0);c[(c[d>>2]|0)+16>>2]=(c[d>>2]|0)+456;i=b;return}function Nk(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;e=b+8|0;d=b+4|0;f=b;c[e>>2]=a;c[d>>2]=c[c[e>>2]>>2];a=(c[e>>2]|0)+12|0;c[a>>2]=(c[a>>2]|0)+ -1;if(c[(c[e>>2]|0)+12>>2]|0){i=b;return}c[f>>2]=c[(c[e>>2]|0)+8>>2];if(c[f>>2]|0)ub[c[(c[c[f>>2]>>2]|0)+16>>2]&31](c[f>>2]|0)|0;Xb(c[d>>2]|0,c[e>>2]|0);i=b;return}function Ok(a){a=a|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;g=d+12|0;f=d+8|0;h=d+4|0;e=d;c[g>>2]=a;c[f>>2]=c[c[g>>2]>>2];if(!(c[f>>2]|0)){i=d;return 0}c[e>>2]=c[(c[g>>2]|0)+4>>2];Pc(c[f>>2]|0);Qk(c[g>>2]|0);a=c[(c[g>>2]|0)+8>>2]|0;if(c[(c[g>>2]|0)+12>>2]|0)c[(c[(c[g>>2]|0)+12>>2]|0)+8>>2]=a;else c[(c[e>>2]|0)+8>>2]=a;if(c[(c[g>>2]|0)+8>>2]|0)c[(c[(c[g>>2]|0)+8>>2]|0)+12>>2]=c[(c[g>>2]|0)+12>>2];c[h>>2]=0;while(1){if((c[h>>2]|0)>(b[(c[g>>2]|0)+76>>1]|0))break;Rk(c[(c[g>>2]|0)+120+(c[h>>2]<<2)>>2]|0);c[h>>2]=(c[h>>2]|0)+1}Sk(c[e>>2]|0);Xb(c[c[f>>2]>>2]|0,c[(c[g>>2]|0)+20>>2]|0);i=d;return 0}function Pk(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+16|0;f=b+8|0;e=b+4|0;d=b;c[f>>2]=a;c[d>>2]=0;g=(c[f>>2]|0)+64|0;c[g>>2]=(c[g>>2]|0)+ -1;if((c[(c[f>>2]|0)+64>>2]|0)>0){g=c[d>>2]|0;i=b;return g|0}if((c[1058]|0)!=(c[f>>2]|0)){c[e>>2]=c[1058];while(1){if(c[e>>2]|0)g=(c[(c[e>>2]|0)+68>>2]|0)!=(c[f>>2]|0);else g=0;a=c[e>>2]|0;if(!g)break;c[e>>2]=c[a+68>>2]}if(a)c[(c[e>>2]|0)+68>>2]=c[(c[f>>2]|0)+68>>2]}else c[1058]=c[(c[f>>2]|0)+68>>2];c[d>>2]=1;g=c[d>>2]|0;i=b;return g|0}function Qk(b){b=b|0;var d=0,e=0;d=i;i=i+16|0;e=d;c[e>>2]=b;hc(c[(c[e>>2]|0)+56>>2]|0);c[(c[e>>2]|0)+56>>2]=0;a[(c[e>>2]|0)+73>>0]=0;i=d;return}function Rk(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;if(!(c[d>>2]|0)){i=b;return}ej(c[(c[d>>2]|0)+68>>2]|0);i=b;return}function Sk(a){a=a|0;var b=0,e=0,f=0;b=i;i=i+16|0;e=b+4|0;f=b;c[e>>2]=a;if(d[(c[e>>2]|0)+20>>0]|0){i=b;return}if(!(c[(c[e>>2]|0)+12>>2]|0)){i=b;return}c[f>>2]=c[(c[e>>2]|0)+12>>2];c[(c[e>>2]|0)+12>>2]=0;Rk(c[f>>2]|0);i=b;return}function Tk(a){a=a|0;var b=0,e=0;b=i;i=i+16|0;e=b;c[e>>2]=a;if(!(c[e>>2]|0)){e=0;e=e&1;i=b;return e|0}e=(d[(c[e>>2]|0)+8>>0]|0|0)==2;e=e&1;i=b;return e|0}function Uk(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;Vk(c[d>>2]|0,68);i=b;return 0}function Vk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0;d=i;i=i+32|0;e=d+20|0;g=d+16|0;j=d+12|0;k=d+8|0;f=d+4|0;h=d;c[e>>2]=a;c[g>>2]=b;if(!(c[(c[e>>2]|0)+328>>2]|0)){i=d;return}c[j>>2]=0;while(1){if((c[j>>2]|0)>=(c[(c[e>>2]|0)+304>>2]|0))break;c[k>>2]=c[(c[(c[e>>2]|0)+328>>2]|0)+(c[j>>2]<<2)>>2];c[f>>2]=c[(c[k>>2]|0)+8>>2];if((c[f>>2]|0)!=0?(c[h>>2]=c[(c[c[f>>2]>>2]|0)+(c[g>>2]|0)>>2],(c[h>>2]|0)!=0):0)ub[c[h>>2]&31](c[f>>2]|0)|0;c[(c[k>>2]|0)+20>>2]=0;Nk(c[k>>2]|0);c[j>>2]=(c[j>>2]|0)+1}Xb(c[e>>2]|0,c[(c[e>>2]|0)+328>>2]|0);c[(c[e>>2]|0)+304>>2]=0;c[(c[e>>2]|0)+328>>2]=0;i=d;return}function Wk(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return(c[(c[b>>2]|0)+16>>2]|0)!=0|0}function Xk(a){a=a|0;var b=0,e=0,f=0,g=0,h=0,j=0;e=i;i=i+32|0;b=e+16|0;h=e+12|0;f=e+8|0;g=e+4|0;j=e;c[b>>2]=a;Rb(c[b>>2]|0);c[h>>2]=0;while(1){if((c[h>>2]|0)>=(c[(c[b>>2]|0)+20>>2]|0))break;c[f>>2]=c[(c[(c[b>>2]|0)+16>>2]|0)+(c[h>>2]<<4)+12>>2];a:do if(c[(c[(c[b>>2]|0)+16>>2]|0)+(c[h>>2]<<4)+12>>2]|0){c[g>>2]=c[(c[f>>2]|0)+16>>2];while(1){if(!(c[g>>2]|0))break a;c[j>>2]=c[(c[g>>2]|0)+8>>2];if((d[(c[j>>2]|0)+44>>0]|0)&16)Yk(c[b>>2]|0,c[j>>2]|0);c[g>>2]=c[c[g>>2]>>2]}}while(0);c[h>>2]=(c[h>>2]|0)+1}Lk(c[b>>2]|0);i=e;return}function Yk(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;h=e+12|0;j=e+8|0;g=e+4|0;f=e;c[h>>2]=a;c[j>>2]=b;c[g>>2]=(c[j>>2]|0)+60;while(1){if(!(c[c[g>>2]>>2]|0)){d=6;break}b=c[c[g>>2]>>2]|0;if((c[c[c[g>>2]>>2]>>2]|0)==(c[h>>2]|0))break;c[g>>2]=b+24}if((d|0)==6){i=e;return}c[f>>2]=b;c[c[g>>2]>>2]=c[(c[f>>2]|0)+24>>2];Nk(c[f>>2]|0);i=e;return}function Zk(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;rb[c[38640+152>>2]&31](c[(c[d>>2]|0)+40>>2]|0);i=b;return}function _k(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;c[b>>2]=a;d=3136|0;a=d+68|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(a|0));if(c[9661]|0){c[784]=8;c[797]=8}c[787]=10;c[791]=1;i=b;return 0}function $k(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;c[b>>2]=a;d=3136|0;a=d+68|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(a|0));i=b;return}function al(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;e=i;i=i+32|0;h=e+24|0;j=e+20|0;k=e+16|0;f=e+12|0;g=e+8|0;l=e+4|0;c[h>>2]=a;c[j>>2]=b;c[k>>2]=d;c[e>>2]=0;c[l>>2]=48;a=c[l>>2]|0;c[f>>2]=Mc(a,((a|0)<0)<<31>>31)|0;if(!(c[f>>2]|0)){l=c[f>>2]|0;i=e;return l|0}c[g>>2]=3136;c[c[f>>2]>>2]=c[g>>2];c[(c[f>>2]|0)+4>>2]=c[h>>2];c[(c[f>>2]|0)+8>>2]=c[j>>2];c[(c[f>>2]|0)+12>>2]=(c[k>>2]|0)!=0?1:0;ql(c[f>>2]|0);if(c[k>>2]|0){c[(c[f>>2]|0)+16>>2]=10;l=(c[g>>2]|0)+8|0;c[l>>2]=(c[l>>2]|0)+(c[(c[f>>2]|0)+16>>2]|0);c[(c[g>>2]|0)+12>>2]=(c[(c[g>>2]|0)+4>>2]|0)+10-(c[(c[g>>2]|0)+8>>2]|0)}if(c[(c[f>>2]|0)+40>>2]|0){l=c[f>>2]|0;i=e;return l|0}hl(c[f>>2]|0);c[f>>2]=0;l=c[f>>2]|0;i=e;return l|0}function bl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;h=d+12|0;g=d+8|0;e=d+4|0;f=d;c[h>>2]=a;c[g>>2]=b;c[e>>2]=c[h>>2];if(!(c[(c[e>>2]|0)+12>>2]|0)){i=d;return}c[f>>2]=c[c[e>>2]>>2];h=(c[f>>2]|0)+4|0;c[h>>2]=(c[h>>2]|0)+((c[g>>2]|0)-(c[(c[e>>2]|0)+20>>2]|0));c[(c[f>>2]|0)+12>>2]=(c[(c[f>>2]|0)+4>>2]|0)+10-(c[(c[f>>2]|0)+8>>2]|0);c[(c[e>>2]|0)+20>>2]=c[g>>2];c[(c[e>>2]|0)+24>>2]=(((c[(c[e>>2]|0)+20>>2]|0)*9|0)>>>0)/10|0;jl(c[f>>2]|0);i=d;return}function cl(a){a=a|0;var b=0,d=0,e=0,f=0;d=i;i=i+16|0;f=d+8|0;b=d+4|0;e=d;c[f>>2]=a;c[e>>2]=c[f>>2];c[b>>2]=c[(c[e>>2]|0)+36>>2];i=d;return c[b>>2]|0}function dl(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;g=i;i=i+32|0;l=g+16|0;j=g+12|0;k=g+8|0;h=g+4|0;f=g;c[l>>2]=b;c[j>>2]=d;c[k>>2]=e;c[h>>2]=c[l>>2];c[f>>2]=0;c[f>>2]=c[(c[(c[h>>2]|0)+44>>2]|0)+((((c[j>>2]|0)>>>0)%((c[(c[h>>2]|0)+40>>2]|0)>>>0)|0)<<2)>>2];while(1){if(c[f>>2]|0)d=(c[(c[f>>2]|0)+8>>2]|0)!=(c[j>>2]|0);else d=0;e=c[f>>2]|0;if(!d)break;c[f>>2]=c[e+16>>2]}if(e){if(a[(c[f>>2]|0)+12>>0]|0){l=c[f>>2]|0;i=g;return l|0}kl(c[f>>2]|0);l=c[f>>2]|0;i=g;return l|0}else{if(!(c[k>>2]|0)){l=c[f>>2]|0;i=g;return l|0}c[f>>2]=ol(c[h>>2]|0,c[j>>2]|0,c[k>>2]|0)|0;l=c[f>>2]|0;i=g;return l|0}return 0}function el(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;h=i;i=i+32|0;m=h+20|0;l=h+16|0;k=h+12|0;f=h+8|0;g=h+4|0;j=h;c[m>>2]=b;c[l>>2]=d;c[k>>2]=e;c[f>>2]=c[m>>2];c[g>>2]=c[l>>2];c[j>>2]=c[c[f>>2]>>2];if((c[k>>2]|0)==0?(c[(c[j>>2]|0)+16>>2]|0)>>>0<=(c[(c[j>>2]|0)+4>>2]|0)>>>0:0){d=c[g>>2]|0;e=c[j>>2]|0;if(c[(c[j>>2]|0)+20>>2]|0){c[(c[e+20>>2]|0)+28>>2]=d;c[(c[g>>2]|0)+24>>2]=c[(c[j>>2]|0)+20>>2];c[(c[j>>2]|0)+20>>2]=c[g>>2]}else{c[e+24>>2]=d;c[(c[j>>2]|0)+20>>2]=c[g>>2]}m=(c[f>>2]|0)+32|0;c[m>>2]=(c[m>>2]|0)+1;a[(c[g>>2]|0)+12>>0]=0;i=h;return}ll(c[g>>2]|0);ml(c[g>>2]|0);i=h;return}function fl(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;f=i;i=i+32|0;o=f+28|0;n=f+24|0;m=f+20|0;j=f+16|0;k=f+12|0;g=f+8|0;h=f+4|0;l=f;c[o>>2]=a;c[n>>2]=b;c[m>>2]=d;c[j>>2]=e;c[k>>2]=c[o>>2];c[g>>2]=c[n>>2];c[l>>2]=((c[m>>2]|0)>>>0)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(c[d>>2]|0);i=b;return}function il(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+16|0;g=b+12|0;d=b+8|0;e=b+4|0;f=b;c[g>>2]=a;c[d>>2]=c[g>>2];if(!(c[(c[d>>2]|0)+12>>2]|0)){i=b;return}c[e>>2]=c[c[d>>2]>>2];c[f>>2]=c[(c[e>>2]|0)+4>>2];c[(c[e>>2]|0)+4>>2]=0;jl(c[e>>2]|0);c[(c[e>>2]|0)+4>>2]=c[f>>2];i=b;return}function jl(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b+4|0;e=b;c[d>>2]=a;while(1){if((c[(c[d>>2]|0)+16>>2]|0)>>>0<=(c[(c[d>>2]|0)+4>>2]|0)>>>0){a=5;break}if(!(c[(c[d>>2]|0)+24>>2]|0)){a=5;break}c[e>>2]=c[(c[d>>2]|0)+24>>2];kl(c[e>>2]|0);ll(c[e>>2]|0);ml(c[e>>2]|0)}if((a|0)==5){i=b;return}}function kl(b){b=b|0;var d=0,e=0,f=0,g=0;f=i;i=i+16|0;d=f+8|0;e=f+4|0;g=f;c[d>>2]=b;c[e>>2]=c[(c[d>>2]|0)+20>>2];c[g>>2]=c[c[e>>2]>>2];b=c[(c[d>>2]|0)+24>>2]|0;if(c[(c[d>>2]|0)+28>>2]|0)c[(c[(c[d>>2]|0)+28>>2]|0)+24>>2]=b;else c[(c[g>>2]|0)+20>>2]=b;b=c[(c[d>>2]|0)+28>>2]|0;if(c[(c[d>>2]|0)+24>>2]|0)c[(c[(c[d>>2]|0)+24>>2]|0)+28>>2]=b;else c[(c[g>>2]|0)+24>>2]=b;c[(c[d>>2]|0)+24>>2]=0;c[(c[d>>2]|0)+28>>2]=0;a[(c[d>>2]|0)+12>>0]=1;b=(c[e>>2]|0)+32|0;c[b>>2]=(c[b>>2]|0)+ -1;i=f;return}function ll(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;e=i;i=i+16|0;f=e+12|0;g=e+8|0;d=e+4|0;b=e;c[f>>2]=a;c[d>>2]=c[(c[f>>2]|0)+20>>2];c[g>>2]=((c[(c[f>>2]|0)+8>>2]|0)>>>0)%((c[(c[d>>2]|0)+40>>2]|0)>>>0)|0;c[b>>2]=(c[(c[d>>2]|0)+44>>2]|0)+(c[g>>2]<<2);while(1){a=(c[c[b>>2]>>2]|0)+16|0;if((c[c[b>>2]>>2]|0)==(c[f>>2]|0))break;c[b>>2]=a}c[c[b>>2]>>2]=c[a>>2];g=(c[d>>2]|0)+36|0;c[g>>2]=(c[g>>2]|0)+ -1;i=e;return}function ml(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;if(!(c[e>>2]|0)){i=b;return}c[d>>2]=c[(c[e>>2]|0)+20>>2];Mg(c[c[e>>2]>>2]|0)|0;if(!(c[(c[d>>2]|0)+12>>2]|0)){i=b;return}e=(c[c[d>>2]>>2]|0)+16|0;c[e>>2]=(c[e>>2]|0)+ -1;i=b;return}function nl(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+32|0;h=e+16|0;k=e+12|0;j=e+8|0;f=e+4|0;g=e;c[h>>2]=b;c[k>>2]=d;c[j>>2]=0;while(1){if((c[j>>2]|0)>>>0>=(c[(c[h>>2]|0)+40>>2]|0)>>>0)break;c[f>>2]=(c[(c[h>>2]|0)+44>>2]|0)+(c[j>>2]<<2);while(1){b=c[c[f>>2]>>2]|0;c[g>>2]=b;if(!b)break;if((c[(c[g>>2]|0)+8>>2]|0)>>>0<(c[k>>2]|0)>>>0){c[f>>2]=(c[g>>2]|0)+16;continue}b=(c[h>>2]|0)+36|0;c[b>>2]=(c[b>>2]|0)+ -1;c[c[f>>2]>>2]=c[(c[g>>2]|0)+16>>2];if(!(a[(c[g>>2]|0)+12>>0]|0))kl(c[g>>2]|0);ml(c[g>>2]|0)}c[j>>2]=(c[j>>2]|0)+1}i=e;return}function ol(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;o=i;i=i+48|0;n=o+32|0;k=o+28|0;f=o+24|0;l=o+20|0;p=o+16|0;h=o+12|0;g=o+8|0;j=o+4|0;m=o;c[k>>2]=b;c[f>>2]=d;c[l>>2]=e;c[h>>2]=c[c[k>>2]>>2];c[g>>2]=0;c[p>>2]=(c[(c[k>>2]|0)+36>>2]|0)-(c[(c[k>>2]|0)+32>>2]|0);do if((c[l>>2]|0)==1){if((c[p>>2]|0)>>>0<(c[(c[h>>2]|0)+12>>2]|0)>>>0?(c[p>>2]|0)>>>0<(c[(c[k>>2]|0)+24>>2]|0)>>>0:0){if(!(pl(c[k>>2]|0)|0))break;if((c[(c[k>>2]|0)+32>>2]|0)>>>0>=(c[p>>2]|0)>>>0)break}c[n>>2]=0;b=c[n>>2]|0;i=o;return b|0}while(0);if((c[(c[k>>2]|0)+36>>2]|0)>>>0>=(c[(c[k>>2]|0)+40>>2]|0)>>>0)ql(c[k>>2]|0);do if((c[(c[k>>2]|0)+12>>2]|0)!=0?(c[(c[h>>2]|0)+24>>2]|0)!=0:0){if((((c[(c[k>>2]|0)+36>>2]|0)+1|0)>>>0<(c[(c[k>>2]|0)+20>>2]|0)>>>0?(c[(c[h>>2]|0)+16>>2]|0)>>>0<(c[(c[h>>2]|0)+4>>2]|0)>>>0:0)?(pl(c[k>>2]|0)|0)==0:0)break;c[g>>2]=c[(c[h>>2]|0)+24>>2];ll(c[g>>2]|0);kl(c[g>>2]|0);c[j>>2]=c[(c[g>>2]|0)+20>>2];if(((c[(c[j>>2]|0)+4>>2]|0)+(c[(c[j>>2]|0)+8>>2]|0)|0)!=((c[(c[k>>2]|0)+4>>2]|0)+(c[(c[k>>2]|0)+8>>2]|0)|0)){ml(c[g>>2]|0);c[g>>2]=0;break}else{b=(c[h>>2]|0)+16|0;c[b>>2]=(c[b>>2]|0)-((c[(c[j>>2]|0)+12>>2]|0)-(c[(c[k>>2]|0)+12>>2]|0));break}}while(0);if(!(c[g>>2]|0)){if((c[l>>2]|0)==1)kh();c[g>>2]=rl(c[k>>2]|0)|0;if((c[l>>2]|0)==1)lh()}if((c[g>>2]|0)!=0?(c[m>>2]=((c[f>>2]|0)>>>0)%((c[(c[k>>2]|0)+40>>2]|0)>>>0)|0,b=(c[k>>2]|0)+36|0,c[b>>2]=(c[b>>2]|0)+1,c[(c[g>>2]|0)+8>>2]=c[f>>2],c[(c[g>>2]|0)+16>>2]=c[(c[(c[k>>2]|0)+44>>2]|0)+(c[m>>2]<<2)>>2],c[(c[g>>2]|0)+20>>2]=c[k>>2],c[(c[g>>2]|0)+28>>2]=0,c[(c[g>>2]|0)+24>>2]=0,a[(c[g>>2]|0)+12>>0]=1,c[c[(c[g>>2]|0)+4>>2]>>2]=0,c[(c[(c[k>>2]|0)+44>>2]|0)+(c[m>>2]<<2)>>2]=c[g>>2],(c[f>>2]|0)>>>0>(c[(c[k>>2]|0)+28>>2]|0)>>>0):0)c[(c[k>>2]|0)+28>>2]=c[f>>2];c[n>>2]=c[g>>2];b=c[n>>2]|0;i=o;return b|0}function pl(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b+4|0;e=b;c[e>>2]=a;if((c[793]|0)!=0?((c[(c[e>>2]|0)+4>>2]|0)+(c[(c[e>>2]|0)+8>>2]|0)|0)<=(c[792]|0):0){c[d>>2]=c[800];e=c[d>>2]|0;i=b;return e|0}c[d>>2]=sl()|0;e=c[d>>2]|0;i=b;return e|0}function ql(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,j=0,k=0;b=i;i=i+32|0;d=b+24|0;e=b+20|0;f=b+16|0;j=b+12|0;h=b+8|0;g=b+4|0;k=b;c[d>>2]=a;a=c[(c[d>>2]|0)+40>>2]<<1;c[f>>2]=a;c[f>>2]=(c[f>>2]|0)>>>0<256?256:a;if(c[(c[d>>2]|0)+40>>2]|0)kh();c[e>>2]=Mc(c[f>>2]<<2,0)|0;if(c[(c[d>>2]|0)+40>>2]|0)lh();if(!(c[e>>2]|0)){i=b;return}c[j>>2]=0;while(1){if((c[j>>2]|0)>>>0>=(c[(c[d>>2]|0)+40>>2]|0)>>>0)break;c[g>>2]=c[(c[(c[d>>2]|0)+44>>2]|0)+(c[j>>2]<<2)>>2];while(1){a=c[g>>2]|0;c[h>>2]=a;if(!a)break;c[k>>2]=((c[(c[h>>2]|0)+8>>2]|0)>>>0)%((c[f>>2]|0)>>>0)|0;c[g>>2]=c[(c[h>>2]|0)+16>>2];c[(c[h>>2]|0)+16>>2]=c[(c[e>>2]|0)+(c[k>>2]<<2)>>2];c[(c[e>>2]|0)+(c[k>>2]<<2)>>2]=c[h>>2]}c[j>>2]=(c[j>>2]|0)+1}hc(c[(c[d>>2]|0)+44>>2]|0);c[(c[d>>2]|0)+44>>2]=c[e>>2];c[(c[d>>2]|0)+40>>2]=c[f>>2];i=b;return}function rl(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=i;i=i+16|0;d=b+12|0;f=b+8|0;e=b+4|0;g=b;c[f>>2]=a;c[e>>2]=0;c[g>>2]=Ug(32+(c[(c[f>>2]|0)+4>>2]|0)+(c[(c[f>>2]|0)+8>>2]|0)|0)|0;c[e>>2]=(c[g>>2]|0)+(c[(c[f>>2]|0)+4>>2]|0);if(!(c[g>>2]|0)){c[d>>2]=0;g=c[d>>2]|0;i=b;return g|0}c[c[e>>2]>>2]=c[g>>2];c[(c[e>>2]|0)+4>>2]=(c[e>>2]|0)+32;if(c[(c[f>>2]|0)+12>>2]|0){g=(c[c[f>>2]>>2]|0)+16|0;c[g>>2]=(c[g>>2]|0)+1}c[d>>2]=c[e>>2];g=c[d>>2]|0;i=b;return g|0}function sl(){return c[43]|0}function tl(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;e=b;f=b+8|0;d=b+4|0;c[f>>2]=a;c[f>>2]=(c[f>>2]|0)+7&-8;c[d>>2]=QE((c[f>>2]|0)+8|0)|0;a=c[f>>2]|0;if(c[d>>2]|0){f=c[d>>2]|0;c[f>>2]=a;c[f+4>>2]=((a|0)<0)<<31>>31;c[d>>2]=(c[d>>2]|0)+8;f=c[d>>2]|0;i=b;return f|0}else{c[e>>2]=a;tc(7,6192,e);f=c[d>>2]|0;i=b;return f|0}return 0}function ul(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;c[d>>2]=c[e>>2];c[d>>2]=(c[d>>2]|0)+ -8;RE(c[d>>2]|0);i=b;return}function vl(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+32|0;g=d;h=d+16|0;f=d+12|0;e=d+8|0;c[h>>2]=a;c[f>>2]=b;c[e>>2]=c[h>>2];c[e>>2]=(c[e>>2]|0)+ -8;c[e>>2]=SE(c[e>>2]|0,(c[f>>2]|0)+8|0)|0;if(c[e>>2]|0){h=c[f>>2]|0;a=c[e>>2]|0;c[a>>2]=h;c[a+4>>2]=((h|0)<0)<<31>>31;c[e>>2]=(c[e>>2]|0)+8;a=c[e>>2]|0;i=d;return a|0}else{h=wl(c[h>>2]|0)|0;a=c[f>>2]|0;c[g>>2]=h;c[g+4>>2]=a;tc(7,6152,g);a=c[e>>2]|0;i=d;return a|0}return 0}function wl(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;d=b+8|0;f=b+4|0;e=b;c[f>>2]=a;if(!(c[f>>2]|0)){c[d>>2]=0;f=c[d>>2]|0;i=b;return f|0}else{c[e>>2]=c[f>>2];c[e>>2]=(c[e>>2]|0)+ -8;c[d>>2]=c[c[e>>2]>>2];f=c[d>>2]|0;i=b;return f|0}return 0}function xl(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return(c[b>>2]|0)+7&-8|0}function yl(a){a=a|0;var b=0;b=i;i=i+16|0;c[b>>2]=a;i=b;return 0}function zl(a){a=a|0;var b=0;b=i;i=i+16|0;c[b>>2]=a;i=b;return}function Al(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;p=i;i=i+64|0;h=p+52|0;v=p+48|0;t=p+44|0;l=p+40|0;q=p+36|0;k=p+32|0;j=p+28|0;s=p+24|0;g=p+20|0;o=p+16|0;m=p+12|0;n=p+8|0;r=p+4|0;u=p;c[h>>2]=b;c[v>>2]=e;c[t>>2]=f;c[g>>2]=0;c[o>>2]=0;if((Nd(c[c[t>>2]>>2]|0)|0)==5){i=p;return}c[l>>2]=Ed(c[c[t>>2]>>2]|0)|0;if(!(c[l>>2]|0)){i=p;return}c[k>>2]=Fd(c[c[t>>2]>>2]|0)|0;a:do if((c[v>>2]|0)!=1){b=Ed(c[(c[t>>2]|0)+4>>2]|0)|0;c[q>>2]=b;if(!b){i=p;return}c[n>>2]=c[q>>2];c[m>>2]=0;while(1){if(!(a[c[n>>2]>>0]|0))break;b=c[n>>2]|0;c[n>>2]=b+1;b:do if((d[b>>0]|0)>=192)while(1){if((d[c[n>>2]>>0]&192|0)!=128)break b;c[n>>2]=(c[n>>2]|0)+1}while(0);c[m>>2]=(c[m>>2]|0)+1}if((c[m>>2]|0)>0){e=c[h>>2]|0;b=c[m>>2]|0;b=lF(b|0,((b|0)<0)<<31>>31|0,5,0)|0;c[o>>2]=$m(e,b,D)|0;if(!(c[o>>2]|0)){i=p;return}c[g>>2]=(c[o>>2]|0)+(c[m>>2]<<2);c[n>>2]=c[q>>2];c[m>>2]=0;while(1){if(!(a[c[n>>2]>>0]|0))break a;c[(c[o>>2]|0)+(c[m>>2]<<2)>>2]=c[n>>2];b=c[n>>2]|0;c[n>>2]=b+1;c:do if((d[b>>0]|0)>=192)while(1){if((d[c[n>>2]>>0]&192|0)!=128)break c;c[n>>2]=(c[n>>2]|0)+1}while(0);a[(c[g>>2]|0)+(c[m>>2]|0)>>0]=(c[n>>2]|0)-(c[(c[o>>2]|0)+(c[m>>2]<<2)>>2]|0);c[m>>2]=(c[m>>2]|0)+1}}}else{c[m>>2]=1;c[g>>2]=9896;c[o>>2]=9904;c[q>>2]=0}while(0);if((c[m>>2]|0)>0){c[j>>2]=oe(c[h>>2]|0)|0;d:do if((c[j>>2]&1|0)!=0&(c[k>>2]|0)>0)do{c[r>>2]=0;c[s>>2]=0;while(1){if((c[s>>2]|0)>=(c[m>>2]|0))break;c[r>>2]=d[(c[g>>2]|0)+(c[s>>2]|0)>>0];if((c[r>>2]|0)<=(c[k>>2]|0)?(TE(c[l>>2]|0,c[(c[o>>2]|0)+(c[s>>2]<<2)>>2]|0,c[r>>2]|0)|0)==0:0)break;c[s>>2]=(c[s>>2]|0)+1}if((c[s>>2]|0)>=(c[m>>2]|0))break d;c[l>>2]=(c[l>>2]|0)+(c[r>>2]|0);c[k>>2]=(c[k>>2]|0)-(c[r>>2]|0)}while((c[k>>2]|0)>0);while(0);e:do if((c[j>>2]&2|0)!=0&(c[k>>2]|0)>0)do{c[u>>2]=0;c[s>>2]=0;while(1){if((c[s>>2]|0)>=(c[m>>2]|0))break;c[u>>2]=d[(c[g>>2]|0)+(c[s>>2]|0)>>0];if((c[u>>2]|0)<=(c[k>>2]|0)?(TE((c[l>>2]|0)+((c[k>>2]|0)-(c[u>>2]|0))|0,c[(c[o>>2]|0)+(c[s>>2]<<2)>>2]|0,c[u>>2]|0)|0)==0:0)break;c[s>>2]=(c[s>>2]|0)+1}if((c[s>>2]|0)>=(c[m>>2]|0))break e;c[k>>2]=(c[k>>2]|0)-(c[u>>2]|0)}while((c[k>>2]|0)>0);while(0);if(c[q>>2]|0)hc(c[o>>2]|0)}$d(c[h>>2]|0,c[l>>2]|0,c[k>>2]|0,-1);i=p;return}function Bl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;l=i;i=i+32|0;g=l+24|0;n=l+20|0;h=l+16|0;k=l+12|0;m=l+8|0;j=l+4|0;e=l;c[g>>2]=a;c[n>>2]=b;c[h>>2]=d;a=(oe(c[g>>2]|0)|0)==0;c[m>>2]=a?0:-1;c[e>>2]=an(c[g>>2]|0)|0;c[j>>2]=0;if((Nd(c[c[h>>2]>>2]|0)|0)==5){i=l;return}c[k>>2]=1;while(1){if((c[k>>2]|0)>=(c[n>>2]|0))break;if((Nd(c[(c[h>>2]|0)+(c[k>>2]<<2)>>2]|0)|0)==5){f=9;break}a=bn(c[(c[h>>2]|0)+(c[j>>2]<<2)>>2]|0,c[(c[h>>2]|0)+(c[k>>2]<<2)>>2]|0,c[e>>2]|0)|0;if((a^c[m>>2]|0)>=0)c[j>>2]=c[k>>2];c[k>>2]=(c[k>>2]|0)+1}if((f|0)==9){i=l;return}be(c[g>>2]|0,c[(c[h>>2]|0)+(c[j>>2]<<2)>>2]|0);i=l;return}function Cl(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;l=i;i=i+32|0;g=l+28|0;n=l+20|0;j=l+16|0;h=l+12|0;f=l+8|0;m=l+4|0;k=l;c[g>>2]=a;c[l+24>>2]=d;c[n>>2]=e;c[j>>2]=c[c[n>>2]>>2];c[h>>2]=qe(c[g>>2]|0,40)|0;if(!(c[h>>2]|0)){i=l;return}a=(Nd(c[c[n>>2]>>2]|0)|0)==5;e=(b[(c[h>>2]|0)+8>>1]|0)!=0;if(a){if(!e){i=l;return}ln(c[g>>2]|0);i=l;return}n=c[g>>2]|0;if(!e){a=pe(n)|0;c[(c[h>>2]|0)+32>>2]=a;ce(c[h>>2]|0,c[j>>2]|0)|0;i=l;return}c[k>>2]=an(n)|0;c[f>>2]=(oe(c[g>>2]|0)|0)!=0&1;c[m>>2]=bn(c[h>>2]|0,c[j>>2]|0,c[k>>2]|0)|0;if(!((c[f>>2]|0)!=0&(c[m>>2]|0)<0)?!((c[f>>2]|0)==0&(c[m>>2]|0)>0):0){ln(c[g>>2]|0);i=l;return}ce(c[h>>2]|0,c[j>>2]|0)|0;i=l;return}function Dl(a){a=a|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=qe(c[f>>2]|0,0)|0;if(!(c[e>>2]|0)){i=d;return}if(b[(c[e>>2]|0)+8>>1]|0)be(c[f>>2]|0,c[e>>2]|0);Bd(c[e>>2]|0);i=d;return}function El(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;g=e+12|0;h=e+4|0;f=e;c[g>>2]=a;c[e+8>>2]=b;c[h>>2]=d;c[f>>2]=0;d=Nd(c[c[h>>2]>>2]|0)|0;if((d|0)==3)c[f>>2]=9864;else if((d|0)==2)c[f>>2]=9872;else if((d|0)==4)c[f>>2]=9880;else if((d|0)==1)c[f>>2]=9856;else c[f>>2]=9888;$d(c[g>>2]|0,c[f>>2]|0,-1,0);i=e;return}function Fl(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0;g=i;i=i+32|0;h=g+16|0;l=g+8|0;j=g+4|0;k=g;c[h>>2]=b;c[g+12>>2]=e;c[l>>2]=f;f=Nd(c[c[l>>2]>>2]|0)|0;if((f|0)==3){c[k>>2]=Ed(c[c[l>>2]>>2]|0)|0;if(!(c[k>>2]|0)){i=g;return}c[j>>2]=0;a:while(1){if(!(a[c[k>>2]>>0]|0))break;c[j>>2]=(c[j>>2]|0)+1;b=c[k>>2]|0;c[k>>2]=b+1;if((d[b>>0]|0)<192)continue;while(1){if((d[c[k>>2]>>0]&192|0)!=128)continue a;c[k>>2]=(c[k>>2]|0)+1}}Wd(c[h>>2]|0,c[j>>2]|0);i=g;return}else if((f|0)==2|(f|0)==1|(f|0)==4){b=c[h>>2]|0;Wd(b,Fd(c[c[l>>2]>>2]|0)|0);i=g;return}else{Zd(c[h>>2]|0);i=g;return}}function Gl(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;m=i;i=i+48|0;l=m+40|0;o=m+32|0;f=m+28|0;n=m+24|0;k=m+20|0;j=m+16|0;p=m+12|0;q=m+8|0;h=m+4|0;g=m;c[l>>2]=a;c[m+36>>2]=b;c[o>>2]=e;c[h>>2]=1;c[p>>2]=Nd(c[c[o>>2]>>2]|0)|0;c[q>>2]=Nd(c[(c[o>>2]|0)+4>>2]|0)|0;if((c[p>>2]|0)==5|(c[q>>2]|0)==5){i=m;return}c[k>>2]=Fd(c[c[o>>2]>>2]|0)|0;c[j>>2]=Fd(c[(c[o>>2]|0)+4>>2]|0)|0;e=c[c[o>>2]>>2]|0;if((c[p>>2]|0)==4&(c[q>>2]|0)==4){c[f>>2]=Cd(e)|0;c[n>>2]=Cd(c[(c[o>>2]|0)+4>>2]|0)|0;c[g>>2]=0}else{c[f>>2]=Ed(e)|0;c[n>>2]=Ed(c[(c[o>>2]|0)+4>>2]|0)|0;c[g>>2]=1}a:while(1){if((c[j>>2]|0)>(c[k>>2]|0))break;if(!(TE(c[f>>2]|0,c[n>>2]|0,c[j>>2]|0)|0))break;c[h>>2]=(c[h>>2]|0)+1;while(1){c[k>>2]=(c[k>>2]|0)+ -1;c[f>>2]=(c[f>>2]|0)+1;if(!(c[g>>2]|0))continue a;if(((d[c[f>>2]>>0]|0)&192|0)!=128)continue a}}if((c[j>>2]|0)>(c[k>>2]|0))c[h>>2]=0;Wd(c[l>>2]|0,c[h>>2]|0);i=m;return}function Hl(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;l=i;i=i+48|0;k=l+44|0;r=l+40|0;p=l+36|0;g=l+32|0;m=l+28|0;n=l+24|0;o=l+20|0;j=l+8|0;h=l;q=l+16|0;c[k>>2]=b;c[r>>2]=e;c[p>>2]=f;c[q>>2]=0;if((Nd(c[(c[p>>2]|0)+4>>2]|0)|0)==5){i=l;return}if((c[r>>2]|0)==3?(Nd(c[(c[p>>2]|0)+8>>2]|0)|0)==5:0){i=l;return}c[o>>2]=Nd(c[c[p>>2]>>2]|0)|0;b=Jd(c[(c[p>>2]|0)+4>>2]|0)|0;f=j;c[f>>2]=b;c[f+4>>2]=((b|0)<0)<<31>>31;f=c[c[p>>2]>>2]|0;a:do if((c[o>>2]|0)==4){c[n>>2]=Fd(f)|0;c[g>>2]=Cd(c[c[p>>2]>>2]|0)|0;if(!(c[g>>2]|0)){i=l;return}}else{c[g>>2]=Ed(f)|0;if(!(c[g>>2]|0)){i=l;return}c[n>>2]=0;if((c[j+4>>2]|0)<0){c[m>>2]=c[g>>2];while(1){if(!(a[c[m>>2]>>0]|0))break a;b=c[m>>2]|0;c[m>>2]=b+1;b:do if((d[b>>0]|0)>=192)while(1){if((d[c[m>>2]>>0]&192|0)!=128)break b;c[m>>2]=(c[m>>2]|0)+1}while(0);c[n>>2]=(c[n>>2]|0)+1}}}while(0);if((c[r>>2]|0)==3){e=Jd(c[(c[p>>2]|0)+8>>2]|0)|0;b=h;c[b>>2]=e;c[b+4>>2]=((e|0)<0)<<31>>31;if((c[h+4>>2]|0)<0){e=h;e=ZE(0,0,c[e>>2]|0,c[e+4>>2]|0)|0;b=h;c[b>>2]=e;c[b+4>>2]=D;c[q>>2]=1}}else{e=c[(pe(c[k>>2]|0)|0)+88>>2]|0;b=h;c[b>>2]=e;c[b+4>>2]=((e|0)<0)<<31>>31}do if((c[j+4>>2]|0)<0){e=c[n>>2]|0;b=j;e=bF(c[b>>2]|0,c[b+4>>2]|0,e|0,((e|0)<0)<<31>>31|0)|0;b=j;c[b>>2]=e;c[b+4>>2]=D;if((c[j+4>>2]|0)<0){r=j;e=h;r=bF(c[e>>2]|0,c[e+4>>2]|0,c[r>>2]|0,c[r+4>>2]|0)|0;e=D;f=h;c[f>>2]=r;c[f+4>>2]=e;f=(c[h+4>>2]|0)<0;b=h;c[b>>2]=f?0:r;c[b+4>>2]=f?0:e;b=j;c[b>>2]=0;c[b+4>>2]=0}}else{b=j;e=c[b+4>>2]|0;if((e|0)>0|(e|0)==0&(c[b>>2]|0)>>>0>0){e=j;e=bF(c[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[m>>2]=n;while(1){b=h;if(!((d[c[m>>2]>>0]|0)!=0&((c[b>>2]|0)!=0|(c[b+4>>2]|0)!=0)))break;b=c[m>>2]|0;c[m>>2]=b+1;d:do if((d[b>>0]|0)>=192)while(1){if((d[c[m>>2]>>0]&192|0)!=128)break d;c[m>>2]=(c[m>>2]|0)+1}while(0);e=h;e=bF(c[e>>2]|0,c[e+4>>2]|0,-1,-1)|0;b=h;c[b>>2]=e;c[b+4>>2]=D}b=(c[m>>2]|0)-(c[g>>2]|0)|0;ae(c[k>>2]|0,c[g>>2]|0,b,((b|0)<0)<<31>>31,-1,1);i=l;return}function Il(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;k=i;i=i+64|0;m=k;e=k+60|0;f=k+56|0;h=k+52|0;g=k+40|0;j=k+12|0;l=k+8|0;n=k+4|0;c[e>>2]=a;c[f>>2]=b;c[h>>2]=d;if((c[f>>2]|0)<1){i=k;return}a=Ed(c[c[h>>2]>>2]|0)|0;c[l>>2]=a;if(!a){i=k;return}c[g>>2]=(c[f>>2]|0)-1;c[g+4>>2]=0;c[g+8>>2]=(c[h>>2]|0)+4;nc(j,0,0,1e9);c[j>>2]=pe(c[e>>2]|0)|0;b=c[l>>2]|0;c[m>>2]=g;kn(j,2,b,m);c[n>>2]=c[j+12>>2];b=c[e>>2]|0;a=pc(j)|0;$d(b,a,c[n>>2]|0,16);i=k;return}function Jl(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,j=0;f=i;i=i+16|0;g=f+12|0;j=f+4|0;h=f;c[g>>2]=a;c[f+8>>2]=b;c[j>>2]=e;c[h>>2]=Ed(c[c[j>>2]>>2]|0)|0;if(!(c[h>>2]|0)){i=f;return}if(!(d[c[h>>2]>>0]|0)){i=f;return}j=c[g>>2]|0;Wd(j,Um(h)|0);i=f;return}function Kl(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;m=i;i=i+48|0;g=m+32|0;o=m+28|0;k=m+24|0;j=m+20|0;h=m+16|0;l=m+12|0;f=m;n=m+8|0;c[g>>2]=b;c[o>>2]=d;c[k>>2]=e;b=fc((c[o>>2]<<2)+1|0)|0;c[j>>2]=b;c[h>>2]=b;if(!(c[j>>2]|0)){ie(c[g>>2]|0);i=m;return}c[l>>2]=0;while(1){if((c[l>>2]|0)>=(c[o>>2]|0))break;p=Ld(c[(c[k>>2]|0)+(c[l>>2]<<2)>>2]|0)|0;b=D;e=f;c[e>>2]=p;c[e+4>>2]=b;e=f;d=c[e+4>>2]|0;e=(c[f+4>>2]|0)<0|((d|0)>0|(d|0)==0&(c[e>>2]|0)>>>0>1114111);d=f;c[d>>2]=e?65533:p;c[d+4>>2]=e?0:b;c[n>>2]=c[f>>2]&2097151;d=c[n>>2]|0;do if((c[n>>2]|0)>>>0>=128){e=c[n>>2]|0;if(d>>>0<2048){b=c[h>>2]|0;c[h>>2]=b+1;a[b>>0]=192+(e>>>6&31);b=128+(c[n>>2]&63)&255;p=c[h>>2]|0;c[h>>2]=p+1;a[p>>0]=b;break}d=c[n>>2]|0;if(e>>>0<65536){p=c[h>>2]|0;c[h>>2]=p+1;a[p>>0]=224+(d>>>12&15);p=128+((c[n>>2]|0)>>>6&63)&255;b=c[h>>2]|0;c[h>>2]=b+1;a[b>>0]=p;b=128+(c[n>>2]&63)&255;p=c[h>>2]|0;c[h>>2]=p+1;a[p>>0]=b;break}else{b=c[h>>2]|0;c[h>>2]=b+1;a[b>>0]=240+(d>>>18&7);b=128+((c[n>>2]|0)>>>12&63)&255;p=c[h>>2]|0;c[h>>2]=p+1;a[p>>0]=b;p=128+((c[n>>2]|0)>>>6&63)&255;b=c[h>>2]|0;c[h>>2]=b+1;a[b>>0]=p;b=128+(c[n>>2]&63)&255;p=c[h>>2]|0;c[h>>2]=p+1;a[p>>0]=b;break}}else{p=c[h>>2]|0;c[h>>2]=p+1;a[p>>0]=d}while(0);c[l>>2]=(c[l>>2]|0)+1}p=(c[h>>2]|0)-(c[j>>2]|0)|0;ae(c[g>>2]|0,c[j>>2]|0,p,((p|0)<0)<<31>>31,13,1);i=m;return}function Ll(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,j=0,k=0;e=i;i=i+32|0;f=e+24|0;j=e+16|0;g=e+8|0;k=e;c[f>>2]=a;c[e+20>>2]=b;c[j>>2]=d;d=Nd(c[c[j>>2]>>2]|0)|0;if((d|0)==1){b=Ld(c[c[j>>2]>>2]|0)|0;a=g;c[a>>2]=b;c[a+4>>2]=D;do if((c[g+4>>2]|0)<0){a=g;if(!((c[a>>2]|0)==0?(c[a+4>>2]|0)==-2147483648:0)){b=g;b=ZE(0,0,c[b>>2]|0,c[b+4>>2]|0)|0;a=g;c[a>>2]=b;c[a+4>>2]=D;break}Ud(c[f>>2]|0,9784,-1);i=e;return}while(0);a=g;Yd(c[f>>2]|0,c[a>>2]|0,c[a+4>>2]|0);i=e;return}else if((d|0)==5){Zd(c[f>>2]|0);i=e;return}else{h[k>>3]=+Hd(c[c[j>>2]>>2]|0);if(+h[k>>3]<0.0)h[k>>3]=-+h[k>>3];Sd(c[f>>2]|0,+h[k>>3]);i=e;return}}function Ml(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,j=0,l=0,m=0,n=0,o=0,p=0.0;e=i;i=i+48|0;l=e+8|0;f=e+36|0;o=e+32|0;n=e+28|0;j=e+24|0;g=e;m=e+20|0;c[f>>2]=a;c[o>>2]=b;c[n>>2]=d;c[j>>2]=0;do if((c[o>>2]|0)==2)if(5==(Nd(c[(c[n>>2]|0)+4>>2]|0)|0)){i=e;return}else{o=Jd(c[(c[n>>2]|0)+4>>2]|0)|0;c[j>>2]=o;o=(c[j>>2]|0)>30?30:o;c[j>>2]=o;c[j>>2]=(c[j>>2]|0)<0?0:o;break}while(0);if((Nd(c[c[n>>2]>>2]|0)|0)==5){i=e;return}h[g>>3]=+Hd(c[c[n>>2]>>2]|0);do if((c[j>>2]|0)==0&+h[g>>3]>=0.0&+h[g>>3]<9223372036854776000.0){p=+h[g>>3]+.5;h[g>>3]=+(~~p>>>0>>>0)+4294967296.0*+((+O(p)>=1.0?p>0.0?(ca(+N(p/4294967296.0),4294967295.0)|0)>>>0:~~+_((p- +(~~p>>>0))/4294967296.0)>>>0:0)|0)}else{if((c[j>>2]|0)==0&+h[g>>3]<0.0?-+h[g>>3]<9223372036854776000.0:0){p=-+h[g>>3]+.5;h[g>>3]=-(+(~~p>>>0>>>0)+4294967296.0*+((+O(p)>=1.0?p>0.0?(ca(+N(p/4294967296.0),4294967295.0)|0)>>>0:~~+_((p- +(~~p>>>0))/4294967296.0)>>>0:0)|0));break}p=+h[g>>3];c[l>>2]=c[j>>2];o=l+4|0;h[k>>3]=p;c[o>>2]=c[k>>2];c[o+4>>2]=c[k+4>>2];c[m>>2]=qc(9848,l)|0;if(c[m>>2]|0){o=c[m>>2]|0;Lm(o,g,Mb(c[m>>2]|0)|0,1)|0;hc(c[m>>2]|0);break}ie(c[f>>2]|0);i=e;return}while(0);Sd(c[f>>2]|0,+h[g>>3]);i=e;return}function Nl(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;g=i;i=i+32|0;h=g+24|0;n=g+16|0;j=g+12|0;m=g+8|0;l=g+4|0;k=g;c[h>>2]=b;c[g+20>>2]=e;c[n>>2]=f;c[m>>2]=Ed(c[c[n>>2]>>2]|0)|0;c[k>>2]=Fd(c[c[n>>2]>>2]|0)|0;if(!(c[m>>2]|0)){i=g;return}b=c[h>>2]|0;n=c[k>>2]|0;n=bF(n|0,((n|0)<0)<<31>>31|0,1,0)|0;c[j>>2]=$m(b,n,D)|0;if(!(c[j>>2]|0)){i=g;return}c[l>>2]=0;while(1){if((c[l>>2]|0)>=(c[k>>2]|0))break;a[(c[j>>2]|0)+(c[l>>2]|0)>>0]=a[(c[m>>2]|0)+(c[l>>2]|0)>>0]&~(d[1224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bF(b|0,D|0,1,0)|0;b=$m(e,b,D)|0;c[k>>2]=b;c[h>>2]=b;if(!(c[k>>2]|0)){i=l;return}c[m>>2]=0;while(1){if((c[m>>2]|0)>=(c[g>>2]|0))break;a[o>>0]=a[c[n>>2]>>0]|0;p=a[9824+((d[o>>0]|0)>>4&15)>>0]|0;b=c[h>>2]|0;c[h>>2]=b+1;a[b>>0]=p;b=a[9824+((d[o>>0]|0)&15)>>0]|0;p=c[h>>2]|0;c[h>>2]=p+1;a[p>>0]=b;c[m>>2]=(c[m>>2]|0)+1;c[n>>2]=(c[n>>2]|0)+1}a[c[h>>2]>>0]=0;$d(c[j>>2]|0,c[k>>2]|0,c[g>>2]<<1,13);i=l;return}function Rl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+32|0;f=e+16|0;g=e;c[f>>2]=a;c[e+12>>2]=b;c[e+8>>2]=d;vc(8,g);if((c[g+4>>2]|0)<0){b=g;b=ZE(0,0,c[b>>2]|0,c[b+4>>2]&2147483647|0)|0;a=g;c[a>>2]=b;c[a+4>>2]=D}a=g;Yd(c[f>>2]|0,c[a>>2]|0,c[a+4>>2]|0);i=e;return}function Sl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+32|0;h=e+16|0;j=e+8|0;f=e+4|0;g=e;c[h>>2]=a;c[e+12>>2]=b;c[j>>2]=d;a=Jd(c[c[j>>2]>>2]|0)|0;c[f>>2]=a;c[f>>2]=(c[f>>2]|0)<1?1:a;a=c[f>>2]|0;c[g>>2]=$m(c[h>>2]|0,a,((a|0)<0)<<31>>31)|0;if(!(c[g>>2]|0)){i=e;return}vc(c[f>>2]|0,c[g>>2]|0);Od(c[h>>2]|0,c[g>>2]|0,c[f>>2]|0,13);i=e;return}function Tl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;f=e+12|0;g=e+4|0;h=e;c[f>>2]=a;c[e+8>>2]=b;c[g>>2]=d;c[h>>2]=an(c[f>>2]|0)|0;if(!(bn(c[c[g>>2]>>2]|0,c[(c[g>>2]|0)+4>>2]|0,c[h>>2]|0)|0)){i=e;return}be(c[f>>2]|0,c[c[g>>2]>>2]|0);i=e;return}function Ul(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;i=i+16|0;f=e+8|0;c[f>>2]=a;c[e+4>>2]=b;c[e>>2]=d;a=c[f>>2]|0;$d(a,vf()|0,-1,0);i=e;return}function Vl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+16|0;f=e;g=e+4|0;c[e+12>>2]=a;c[e+8>>2]=b;c[g>>2]=d;a=Jd(c[c[g>>2]>>2]|0)|0;c[f>>2]=Ed(c[(c[g>>2]|0)+4>>2]|0)|0;tc(a,1200,f);i=e;return}function Wl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;f=e+12|0;h=e+4|0;g=e;c[f>>2]=a;c[e+8>>2]=b;c[h>>2]=d;a=Ed(c[c[h>>2]>>2]|0)|0;c[g>>2]=a;if(!a){i=e;return}h=c[f>>2]|0;Wd(h,Kb(c[g>>2]|0)|0);i=e;return}function Xl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;g=e+12|0;h=e+4|0;f=e;c[g>>2]=a;c[e+8>>2]=b;c[h>>2]=d;c[f>>2]=Jd(c[c[h>>2]>>2]|0)|0;a=c[g>>2]|0;$d(a,Ob(c[f>>2]|0)|0,-1,0);i=e;return}function Yl(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;s=i;i=i+128|0;m=s+24|0;l=s+72|0;p=s+64|0;n=s+16|0;o=s+8|0;r=s+76|0;q=s+60|0;t=s+56|0;g=s+52|0;j=s+48|0;v=s+44|0;w=s+40|0;x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|0))break;if((d[(c[y>>2]|0)+(c[v>>2]|0)>>0]|0)==39){e=x;e=bF(c[e>>2]|0,c[e+4>>2]|0,1,0)|0;b=x;c[b>>2]=e;c[b+4>>2]=D}c[v>>2]=(c[v>>2]|0)+1}e=c[l>>2]|0;f=c[v>>2]|0;b=x;b=bF(f|0,((f|0)<0)<<31>>31|0,c[b>>2]|0,c[b+4>>2]|0)|0;b=bF(b|0,D|0,3,0)|0;c[u>>2]=$m(e,b,D)|0;if(!(c[u>>2]|0)){i=s;return}a[c[u>>2]>>0]=39;c[v>>2]=0;c[w>>2]=1;while(1){if(!(a[(c[y>>2]|0)+(c[v>>2]|0)>>0]|0))break;e=a[(c[y>>2]|0)+(c[v>>2]|0)>>0]|0;b=c[w>>2]|0;c[w>>2]=b+1;a[(c[u>>2]|0)+b>>0]=e;if((d[(c[y>>2]|0)+(c[v>>2]|0)>>0]|0)==39){b=c[w>>2]|0;c[w>>2]=b+1;a[(c[u>>2]|0)+b>>0]=39}c[v>>2]=(c[v>>2]|0)+1}b=c[w>>2]|0;c[w>>2]=b+1;a[(c[u>>2]|0)+b>>0]=39;a[(c[u>>2]|0)+(c[w>>2]|0)>>0]=0;$d(c[l>>2]|0,c[u>>2]|0,c[w>>2]|0,13);i=s;return}else if((f|0)==1){be(c[l>>2]|0,c[c[p>>2]>>2]|0);i=s;return}else{$d(c[l>>2]|0,9840,4,0);i=s;return}}function Zl(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+16|0;g=e+12|0;f=e;c[g>>2]=a;c[e+8>>2]=b;c[e+4>>2]=d;c[f>>2]=pe(c[g>>2]|0)|0;b=c[g>>2]|0;a=Hf(c[f>>2]|0)|0;Yd(b,a,D);i=e;return}function _l(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+16|0;g=e+12|0;f=e;c[g>>2]=a;c[e+8>>2]=b;c[e+4>>2]=d;c[f>>2]=pe(c[g>>2]|0)|0;a=c[g>>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e+16>>2]=b;c[h>>2]=d;c[g>>2]=pe(c[j>>2]|0)|0;h=Ld(c[c[h>>2]>>2]|0)|0;b=f;c[b>>2]=h;c[b+4>>2]=D;b=f;h=c[b+4>>2]|0;a=c[(c[g>>2]|0)+88>>2]|0;g=((a|0)<0)<<31>>31;d=c[j>>2]|0;if((h|0)>(g|0)|((h|0)==(g|0)?(c[b>>2]|0)>>>0>a>>>0:0)){he(d);i=e;return}else{de(d,c[f>>2]|0);i=e;return}}function cm(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,j=0,k=0,l=0,m=0,n=0,o=0.0;g=i;i=i+32|0;n=g+24|0;m=g+16|0;j=g+12|0;l=g+8|0;k=g;c[n>>2]=b;c[g+20>>2]=e;c[m>>2]=f;c[j>>2]=qe(c[n>>2]|0,32)|0;c[l>>2]=Oe(c[c[m>>2]>>2]|0)|0;if(!((c[j>>2]|0)!=0&(c[l>>2]|0)!=5)){i=g;return}f=(c[j>>2]|0)+16|0;n=f;n=bF(c[n>>2]|0,c[n+4>>2]|0,1,0)|0;c[f>>2]=n;c[f+4>>2]=D;f=c[c[m>>2]>>2]|0;if((c[l>>2]|0)!=1){o=+Hd(f);n=c[j>>2]|0;h[n>>3]=+h[n>>3]+o;a[(c[j>>2]|0)+25>>0]=1;i=g;return}n=Ld(f)|0;b=k;c[b>>2]=n;c[b+4>>2]=D;b=k;n=c[j>>2]|0;h[n>>3]=+h[n>>3]+(+((c[b>>2]|0)>>>0)+4294967296.0*+(c[b+4>>2]|0));if(d[(c[j>>2]|0)+25>>0]|0|(d[(c[j>>2]|0)+24>>0]|0)){i=g;return}n=k;if(!(_m((c[j>>2]|0)+8|0,c[n>>2]|0,c[n+4>>2]|0)|0)){i=g;return}a[(c[j>>2]|0)+24>>0]=1;i=g;return}function dm(b){b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=b;c[e>>2]=qe(c[f>>2]|0,0)|0;if(!(c[e>>2]|0)){i=d;return}b=(c[e>>2]|0)+16|0;g=c[b+4>>2]|0;if(!((g|0)>0|(g|0)==0&(c[b>>2]|0)>>>0>0)){i=d;return}if(a[(c[e>>2]|0)+24>>0]|0){Ud(c[f>>2]|0,9784,-1);i=d;return}f=c[f>>2]|0;b=c[e>>2]|0;if(a[(c[e>>2]|0)+25>>0]|0){Sd(f,+h[b>>3]);i=d;return}else{g=b+8|0;Yd(f,c[g>>2]|0,c[g+4>>2]|0);i=d;return}}function em(a){a=a|0;var b=0,d=0,e=0,f=0.0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;c[d>>2]=qe(c[e>>2]|0,0)|0;a=c[e>>2]|0;if(!(c[d>>2]|0)){f=0.0;Sd(a,f);i=b;return}f=+h[c[d>>2]>>3];Sd(a,f);i=b;return}function fm(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;c[d>>2]=qe(c[e>>2]|0,0)|0;if(!(c[d>>2]|0)){i=b;return}a=(c[d>>2]|0)+16|0;f=c[a+4>>2]|0;if(!((f|0)>0|(f|0)==0&(c[a>>2]|0)>>>0>0)){i=b;return}f=(c[d>>2]|0)+16|0;Sd(c[e>>2]|0,+h[c[d>>2]>>3]/(+((c[f>>2]|0)>>>0)+4294967296.0*+(c[f+4>>2]|0)));i=b;return}function gm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;j=e+12|0;h=e+8|0;g=e+4|0;f=e;c[j>>2]=a;c[h>>2]=b;c[g>>2]=d;c[f>>2]=qe(c[j>>2]|0,8)|0;if(!(c[h>>2]|0)){if(!(c[f>>2]|0)){i=e;return}}else{j=5!=(Nd(c[c[g>>2]>>2]|0)|0);if(!(j&(c[f>>2]|0)!=0)){i=e;return}}j=c[f>>2]|0;h=j;h=bF(c[h>>2]|0,c[h+4>>2]|0,1,0)|0;c[j>>2]=h;c[j+4>>2]=D;i=e;return}function hm(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;c[d>>2]=qe(c[e>>2]|0,0)|0;a=c[e>>2]|0;if(!(c[d>>2]|0)){d=0;e=0;Yd(a,d,e);i=b;return}e=c[d>>2]|0;d=c[e>>2]|0;e=c[e+4>>2]|0;Yd(a,d,e);i=b;return}function im(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;n=i;i=i+48|0;o=n+36|0;l=n+32|0;h=n+28|0;m=n+24|0;q=n+20|0;j=n+16|0;g=n+12|0;k=n+8|0;p=n+4|0;r=n;c[o>>2]=b;c[l>>2]=e;c[h>>2]=f;if((Nd(c[c[h>>2]>>2]|0)|0)==5){i=n;return}c[q>>2]=qe(c[o>>2]|0,28)|0;if(!(c[q>>2]|0)){i=n;return}c[p>>2]=pe(c[o>>2]|0)|0;c[r>>2]=(d[(c[q>>2]|0)+24>>0]|0|0)==0&1;a[(c[q>>2]|0)+24>>0]=2;c[(c[q>>2]|0)+20>>2]=c[(c[p>>2]|0)+88>>2];if(!(c[r>>2]|0)){if((c[l>>2]|0)==2){c[j>>2]=Ed(c[(c[h>>2]|0)+4>>2]|0)|0;c[k>>2]=Fd(c[(c[h>>2]|0)+4>>2]|0)|0}else{c[j>>2]=9776;c[k>>2]=1}if(c[k>>2]|0)Vm(c[q>>2]|0,c[j>>2]|0,c[k>>2]|0)}c[m>>2]=Ed(c[c[h>>2]>>2]|0)|0;c[g>>2]=Fd(c[c[h>>2]>>2]|0)|0;if(!(c[m>>2]|0)){i=n;return}Vm(c[q>>2]|0,c[m>>2]|0,c[g>>2]|0);i=n;return}function jm(a){a=a|0;var b=0,e=0,f=0;b=i;i=i+16|0;f=b+4|0;e=b;c[f>>2]=a;c[e>>2]=qe(c[f>>2]|0,0)|0;if(!(c[e>>2]|0)){i=b;return}if((d[(c[e>>2]|0)+25>>0]|0|0)==2){he(c[f>>2]|0);i=b;return}a=c[f>>2]|0;if((d[(c[e>>2]|0)+25>>0]|0|0)==1){ie(a);i=b;return}else{$d(a,pc(c[e>>2]|0)|0,-1,13);i=b;return}}function km(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;k=i;i=i+48|0;f=k+36|0;n=k+32|0;l=k+28|0;g=k+24|0;h=k+20|0;e=k+16|0;p=k+12|0;o=k+8|0;j=k+4|0;m=k;c[f>>2]=a;c[n>>2]=b;c[l>>2]=d;c[e>>2]=0;c[o>>2]=pe(c[f>>2]|0)|0;c[h>>2]=Ed(c[c[l>>2]>>2]|0)|0;c[g>>2]=Ed(c[(c[l>>2]|0)+4>>2]|0)|0;c[p>>2]=Fd(c[c[l>>2]>>2]|0)|0;if((c[p>>2]|0)>(c[(c[o>>2]|0)+120>>2]|0)){Ud(c[f>>2]|0,9688,-1);i=k;return}do if((c[n>>2]|0)==3){c[j>>2]=Ed(c[(c[l>>2]|0)+8>>2]|0)|0;if(!(c[j>>2]|0)){i=k;return}if((Tm(c[j>>2]|0,-1)|0)==1){c[e>>2]=Um(j)|0;break}Ud(c[f>>2]|0,9728,-1);i=k;return}while(0);if(!((c[g>>2]|0)!=0&(c[h>>2]|0)!=0)){i=k;return}c[m>>2]=oe(c[f>>2]|0)|0;p=c[f>>2]|0;Wd(p,jf(c[h>>2]|0,c[g>>2]|0,c[m>>2]|0,c[e>>2]|0)|0);i=k;return}function lm(){var a=0,b=0,d=0,e=0;a=i;i=i+16|0;b=a+8|0;d=a+4|0;e=a;c[d>>2]=1576;c[e>>2]=9016;c[b>>2]=0;while(1){if((c[b>>2]|0)>=8)break;xk(c[d>>2]|0,(c[e>>2]|0)+((c[b>>2]|0)*36|0)|0);c[b>>2]=(c[b>>2]|0)+1}i=a;return}function mm(){var a=0,b=0,d=0,e=0;a=i;i=i+16|0;b=a+8|0;d=a+4|0;e=a;c[d>>2]=1576;c[e>>2]=8792;c[b>>2]=0;while(1){if((c[b>>2]|0)>=3)break;xk(c[d>>2]|0,(c[e>>2]|0)+((c[b>>2]|0)*36|0)|0);c[b>>2]=(c[b>>2]|0)+1}i=a;return}function nm(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;n=i;i=i+64|0;m=n;o=n+60|0;s=n+52|0;j=n+48|0;k=n+44|0;p=n+40|0;l=n+32|0;q=n+28|0;r=n+24|0;f=n+20|0;h=n+16|0;c[o>>2]=b;c[n+56>>2]=d;c[s>>2]=e;c[j>>2]=Ed(c[c[s>>2]>>2]|0)|0;c[k>>2]=Ed(c[(c[s>>2]|0)+4>>2]|0)|0;c[q>>2]=c[j>>2];c[r>>2]=0;c[h>>2]=pe(c[o>>2]|0)|0;if(!(c[j>>2]|0)){i=n;return}do{if(!(a[c[q>>2]>>0]|0)){g=7;break}c[l>>2]=c[q>>2];c[l+4>>2]=c[r>>2];do{c[q>>2]=(c[q>>2]|0)+(c[r>>2]|0);c[r>>2]=qm(c[q>>2]|0,p)|0}while((c[p>>2]|0)==151)}while((c[p>>2]|0)!=22&(c[p>>2]|0)!=125);if((g|0)==7){i=n;return}s=c[h>>2]|0;e=c[j>>2]|0;d=c[k>>2]|0;b=(c[l>>2]|0)+(c[l+4>>2]|0)|0;c[m>>2]=(c[l>>2]|0)-(c[j>>2]|0);c[m+4>>2]=e;c[m+8>>2]=d;c[m+12>>2]=b;c[f>>2]=Te(s,9e3,m)|0;$d(c[o>>2]|0,c[f>>2]|0,-1,16);i=n;return}function om(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;o=i;i=i+80|0;q=o;s=o+68|0;t=o+60|0;f=o+56|0;p=o+52|0;j=o+48|0;m=o+40|0;h=o+32|0;k=o+28|0;l=o+24|0;r=o+20|0;n=o+16|0;c[s>>2]=b;c[o+64>>2]=d;c[t>>2]=e;c[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>2]|0)==0){i=n;return}c[f>>2]=c[h>>2];while(1){if(!(a[c[f>>2]>>0]|0))break;c[q>>2]=qm(c[f>>2]|0,t)|0;if((c[t>>2]|0)==105){do{c[f>>2]=(c[f>>2]|0)+(c[q>>2]|0);c[q>>2]=qm(c[f>>2]|0,t)|0}while((c[t>>2]|0)==151);u=c[q>>2]|0;c[r>>2]=rm(c[g>>2]|0,c[f>>2]|0,u,((u|0)<0)<<31>>31)|0;if(!(c[r>>2]|0))break;sm(c[r>>2]|0)|0;if(!(xc(c[s>>2]|0,c[r>>2]|0)|0)){u=c[g>>2]|0;e=(c[f>>2]|0)-(c[h>>2]|0)|0;d=c[h>>2]|0;b=c[o>>2]|0;c[k>>2]=(c[j>>2]|0)!=0?c[j>>2]|0:1216;c[k+4>>2]=e;c[k+8>>2]=d;c[k+12>>2]=b;c[p>>2]=Te(u,8976,k)|0;Xb(c[g>>2]|0,c[j>>2]|0);c[j>>2]=c[p>>2];c[h>>2]=(c[f>>2]|0)+(c[q>>2]|0)}Xb(c[g>>2]|0,c[r>>2]|0)}c[f>>2]=(c[f>>2]|0)+(c[q>>2]|0)}u=c[g>>2]|0;b=c[h>>2]|0;c[k>>2]=(c[j>>2]|0)!=0?c[j>>2]|0:1216;c[k+4>>2]=b;c[l>>2]=Te(u,8992,k)|0;$d(c[m>>2]|0,c[l>>2]|0,-1,16);Xb(c[g>>2]|0,c[j>>2]|0);i=n;return}function qm(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;g=i;i=i+32|0;f=g+24|0;h=g+20|0;m=g+16|0;j=g+12|0;k=g+8|0;o=g+4|0;n=g;c[h>>2]=b;c[m>>2]=e;do switch(d[c[h>>2]>>0]|0){case 45:{if((d[(c[h>>2]|0)+1>>0]|0)!=45){c[c[m>>2]>>2]=90;c[f>>2]=1;b=c[f>>2]|0;i=g;return b|0}c[j>>2]=2;while(1){b=d[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0;c[k>>2]=b;if(!((b|0)!=0&(c[k>>2]|0)!=10))break;c[j>>2]=(c[j>>2]|0)+1}c[c[m>>2]>>2]=151;c[f>>2]=c[j>>2];b=c[f>>2]|0;i=g;return b|0};case 59:{c[c[m>>2]>>2]=1;c[f>>2]=1;b=c[f>>2]|0;i=g;return b|0};case 38:{c[c[m>>2]>>2]=85;c[f>>2]=1;b=c[f>>2]|0;i=g;return b|0};case 40:{c[c[m>>2]>>2]=22;c[f>>2]=1;b=c[f>>2]|0;i=g;return b|0};case 62:{b=d[(c[h>>2]|0)+1>>0]|0;c[k>>2]=b;if((b|0)==61){c[c[m>>2]>>2]=83;c[f>>2]=2;b=c[f>>2]|0;i=g;return b|0}h=c[m>>2]|0;if((c[k>>2]|0)==62){c[h>>2]=88;c[f>>2]=2;b=c[f>>2]|0;i=g;return b|0}else{c[h>>2]=80;c[f>>2]=1;b=c[f>>2]|0;i=g;return b|0}};case 124:{j=c[m>>2]|0;if((d[(c[h>>2]|0)+1>>0]|0)!=124){c[j>>2]=86;c[f>>2]=1;b=c[f>>2]|0;i=g;return b|0}else{c[j>>2]=94;c[f>>2]=2;b=c[f>>2]|0;i=g;return b|0}};case 126:{c[c[m>>2]>>2]=96;c[f>>2]=1;b=c[f>>2]|0;i=g;return b|0};case 57:case 56:case 55:case 54:case 53:case 52:case 51:case 50:case 49:case 48:break;case 61:{c[c[m>>2]>>2]=79;c[f>>2]=1+((d[(c[h>>2]|0)+1>>0]|0)==61&1);b=c[f>>2]|0;i=g;return b|0};case 44:{c[c[m>>2]>>2]=26;c[f>>2]=1;b=c[f>>2]|0;i=g;return b|0};case 60:{b=d[(c[h>>2]|0)+1>>0]|0;c[k>>2]=b;if((b|0)==61){c[c[m>>2]>>2]=81;c[f>>2]=2;b=c[f>>2]|0;i=g;return b|0}if((c[k>>2]|0)==62){c[c[m>>2]>>2]=78;c[f>>2]=2;b=c[f>>2]|0;i=g;return b|0}h=c[m>>2]|0;if((c[k>>2]|0)==60){c[h>>2]=87;c[f>>2]=2;b=c[f>>2]|0;i=g;return b|0}else{c[h>>2]=82;c[f>>2]=1;b=c[f>>2]|0;i=g;return b|0}};case 46:{if(!(d[1224+(d[(c[h>>2]|0)+1>>0]|0)>>0]&4)){c[c[m>>2]>>2]=122;c[f>>2]=1;b=c[f>>2]|0;i=g;return b|0}break};case 13:case 12:case 10:case 9:case 32:{c[j>>2]=1;while(1){if(!(d[1224+(d[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0)>>0]&1))break;c[j>>2]=(c[j>>2]|0)+1}c[c[m>>2]>>2]=151;c[f>>2]=c[j>>2];b=c[f>>2]|0;i=g;return b|0};case 37:{c[c[m>>2]>>2]=93;c[f>>2]=1;b=c[f>>2]|0;i=g;return b|0};case 88:case 120:{if((d[(c[h>>2]|0)+1>>0]|0)==39){c[c[m>>2]>>2]=134;c[j>>2]=2;while(1){k=c[j>>2]|0;if(!(d[1224+(d[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0)>>0]&8))break;c[j>>2]=k+1}if(!((d[(c[h>>2]|0)+k>>0]|0)==39?((c[j>>2]|0)%2|0|0)==0:0))l=125;a:do if((l|0)==125){c[c[m>>2]>>2]=150;while(1){if(!(d[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0))break a;if((d[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0)==39)break a;c[j>>2]=(c[j>>2]|0)+1}}while(0);if(a[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0)c[j>>2]=(c[j>>2]|0)+1;c[f>>2]=c[j>>2];b=c[f>>2]|0;i=g;return b|0}else l=132;break};case 91:{c[j>>2]=1;c[k>>2]=d[c[h>>2]>>0];while(1){if((c[k>>2]|0)==93)break;b=d[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0;c[k>>2]=b;if(!b)break;c[j>>2]=(c[j>>2]|0)+1}c[c[m>>2]>>2]=(c[k>>2]|0)==93?27:150;c[f>>2]=c[j>>2];b=c[f>>2]|0;i=g;return b|0};case 42:{c[c[m>>2]>>2]=91;c[f>>2]=1;b=c[f>>2]|0;i=g;return b|0};case 58:case 35:case 64:case 36:{c[n>>2]=0;c[c[m>>2]>>2]=135;c[j>>2]=1;while(1){b=d[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0;c[k>>2]=b;if(!b)break;if(d[1224+(c[k>>2]&255)>>0]&70)c[n>>2]=(c[n>>2]|0)+1;else{if((c[k>>2]|0)==40&(c[n>>2]|0)>0){l=107;break}if((c[k>>2]|0)!=58)break;if((d[(c[h>>2]|0)+((c[j>>2]|0)+1)>>0]|0)!=58)break;c[j>>2]=(c[j>>2]|0)+1}c[j>>2]=(c[j>>2]|0)+1}do if((l|0)==107){while(1){c[j>>2]=(c[j>>2]|0)+1;b=d[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0;c[k>>2]=b;if(!b)break;if((c[k>>2]|0)!=41?(d[1224+(c[k>>2]&255)>>0]&1|0)==0:0)l=107;else break}if((c[k>>2]|0)==41){c[j>>2]=(c[j>>2]|0)+1;break}else{c[c[m>>2]>>2]=150;break}}while(0);if(!(c[n>>2]|0))c[c[m>>2]>>2]=150;c[f>>2]=c[j>>2];b=c[f>>2]|0;i=g;return b|0};case 34:case 39:case 96:{c[o>>2]=d[c[h>>2]>>0];c[j>>2]=1;while(1){b=d[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0;c[k>>2]=b;if(!b)break;if((c[k>>2]|0)==(c[o>>2]|0)){if((d[(c[h>>2]|0)+((c[j>>2]|0)+1)>>0]|0)!=(c[o>>2]|0))break;c[j>>2]=(c[j>>2]|0)+1}c[j>>2]=(c[j>>2]|0)+1}if((c[k>>2]|0)==39){c[c[m>>2]>>2]=97;c[f>>2]=(c[j>>2]|0)+1;b=c[f>>2]|0;i=g;return b|0}h=c[m>>2]|0;if(c[k>>2]|0){c[h>>2]=27;c[f>>2]=(c[j>>2]|0)+1;b=c[f>>2]|0;i=g;return b|0}else{c[h>>2]=150;c[f>>2]=c[j>>2];b=c[f>>2]|0;i=g;return b|0}};case 41:{c[c[m>>2]>>2]=23;c[f>>2]=1;b=c[f>>2]|0;i=g;return b|0};case 33:{j=c[m>>2]|0;if((d[(c[h>>2]|0)+1>>0]|0)!=61){c[j>>2]=150;c[f>>2]=2;b=c[f>>2]|0;i=g;return b|0}else{c[j>>2]=78;c[f>>2]=2;b=c[f>>2]|0;i=g;return b|0}};case 47:{if((d[(c[h>>2]|0)+1>>0]|0)==42?(d[(c[h>>2]|0)+2>>0]|0)!=0:0){c[j>>2]=3;c[k>>2]=d[(c[h>>2]|0)+2>>0];while(1){if((c[k>>2]|0)==42?(d[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0)==47:0)break;b=d[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0;c[k>>2]=b;if(!b)break;c[j>>2]=(c[j>>2]|0)+1}if(c[k>>2]|0)c[j>>2]=(c[j>>2]|0)+1;c[c[m>>2]>>2]=151;c[f>>2]=c[j>>2];b=c[f>>2]|0;i=g;return b|0}c[c[m>>2]>>2]=92;c[f>>2]=1;b=c[f>>2]|0;i=g;return b|0};case 43:{c[c[m>>2]>>2]=89;c[f>>2]=1;b=c[f>>2]|0;i=g;return b|0};case 63:{c[c[m>>2]>>2]=135;c[j>>2]=1;while(1){k=c[j>>2]|0;if(!(d[1224+(d[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0)>>0]&4))break;c[j>>2]=k+1}c[f>>2]=k;b=c[f>>2]|0;i=g;return b|0};default:l=132}while(0);if((l|0)==132){if(!(d[1224+(d[c[h>>2]>>0]|0)>>0]&70)){c[c[m>>2]>>2]=150;c[f>>2]=1;b=c[f>>2]|0;i=g;return b|0}c[j>>2]=1;while(1){if(!(d[1224+(d[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0)>>0]&70))break;c[j>>2]=(c[j>>2]|0)+1}b=Cg(c[h>>2]|0,c[j>>2]|0)|0;c[c[m>>2]>>2]=b;c[f>>2]=c[j>>2];b=c[f>>2]|0;i=g;return b|0}c[c[m>>2]>>2]=132;do if((d[c[h>>2]>>0]|0)==48){if((d[(c[h>>2]|0)+1>>0]|0)!=120?(d[(c[h>>2]|0)+1>>0]|0)!=88:0)break;if(d[1224+(d[(c[h>>2]|0)+2>>0]|0)>>0]&8){c[j>>2]=3;while(1){k=c[j>>2]|0;if(!(d[1224+(d[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0)>>0]&8))break;c[j>>2]=k+1}c[f>>2]=k;b=c[f>>2]|0;i=g;return b|0}}while(0);c[j>>2]=0;while(1){k=c[j>>2]|0;if(!(d[1224+(d[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0)>>0]&4))break;c[j>>2]=k+1}if((d[(c[h>>2]|0)+k>>0]|0)==46){c[j>>2]=(c[j>>2]|0)+1;while(1){if(!(d[1224+(d[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0)>>0]&4))break;c[j>>2]=(c[j>>2]|0)+1}c[c[m>>2]>>2]=133}if(!((d[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0)!=101?(d[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0)!=69:0))l=82;do if((l|0)==82){if(!(d[1224+(d[(c[h>>2]|0)+((c[j>>2]|0)+1)>>0]|0)>>0]&4)){if((d[(c[h>>2]|0)+((c[j>>2]|0)+1)>>0]|0)!=43?(d[(c[h>>2]|0)+((c[j>>2]|0)+1)>>0]|0)!=45:0)break;if(!(d[1224+(d[(c[h>>2]|0)+((c[j>>2]|0)+2)>>0]|0)>>0]&4))break}c[j>>2]=(c[j>>2]|0)+2;while(1){if(!(d[1224+(d[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0)>>0]&4))break;c[j>>2]=(c[j>>2]|0)+1}c[c[m>>2]>>2]=133}while(0);while(1){if(!(d[1224+(d[(c[h>>2]|0)+(c[j>>2]|0)>>0]|0)>>0]&70))break;c[c[m>>2]>>2]=150;c[j>>2]=(c[j>>2]|0)+1}c[f>>2]=c[j>>2];b=c[f>>2]|0;i=g;return b|0}function rm(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+32|0;h=g+20|0;m=g+16|0;k=g+12|0;l=g;j=g+8|0;c[m>>2]=b;c[k>>2]=d;b=l;c[b>>2]=e;c[b+4>>2]=f;if(!(c[k>>2]|0)){c[h>>2]=0;b=c[h>>2]|0;i=g;return b|0}d=c[m>>2]|0;b=l;b=bF(c[b>>2]|0,c[b+4>>2]|0,1,0)|0;c[j>>2]=Qe(d,b,D)|0;if(c[j>>2]|0){dF(c[j>>2]|0,c[k>>2]|0,c[l>>2]|0)|0;a[(c[j>>2]|0)+(c[l>>2]|0)>>0]=0}c[h>>2]=c[j>>2];b=c[h>>2]|0;i=g;return b|0}function sm(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0;d=i;i=i+32|0;e=d+12|0;g=d+8|0;h=d+16|0;f=d+4|0;j=d;c[g>>2]=b;if(!(c[g>>2]|0)){c[e>>2]=-1;b=c[e>>2]|0;i=d;return b|0}a[h>>0]=a[c[g>>2]>>0]|0;b=a[h>>0]|0;if((b|0)==91)a[h>>0]=93;else if(!((b|0)==96|(b|0)==34|(b|0)==39)){c[e>>2]=-1;b=c[e>>2]|0;i=d;return b|0}c[f>>2]=1;c[j>>2]=0;while(1){b=c[f>>2]|0;if((a[(c[g>>2]|0)+(c[f>>2]|0)>>0]|0)==(a[h>>0]|0)){if((a[(c[g>>2]|0)+(b+1)>>0]|0)!=(a[h>>0]|0))break;k=a[h>>0]|0;b=c[j>>2]|0;c[j>>2]=b+1;a[(c[g>>2]|0)+b>>0]=k;c[f>>2]=(c[f>>2]|0)+1}else{b=a[(c[g>>2]|0)+b>>0]|0;k=c[j>>2]|0;c[j>>2]=k+1;a[(c[g>>2]|0)+k>>0]=b}c[f>>2]=(c[f>>2]|0)+1}a[(c[g>>2]|0)+(c[j>>2]|0)>>0]=0;c[e>>2]=c[j>>2];k=c[e>>2]|0;i=d;return k|0}function tm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+64|0;g=e+56|0;j=e+52|0;h=e+48|0;f=e;c[g>>2]=a;c[j>>2]=b;c[h>>2]=d;if(Bm(c[g>>2]|0,c[j>>2]|0,c[h>>2]|0,f)|0){i=e;return}Cm(f);j=f;Sd(c[g>>2]|0,(+((c[j>>2]|0)>>>0)+4294967296.0*+(c[j+4>>2]|0))/864.0e5);i=e;return}function um(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;e=i;i=i+176|0;g=e+48|0;j=e+68|0;l=e+64|0;k=e+60|0;f=e;h=e+72|0;c[j>>2]=a;c[l>>2]=b;c[k>>2]=d;if(Bm(c[j>>2]|0,c[l>>2]|0,c[k>>2]|0,f)|0){i=e;return}Em(f);k=c[f+12>>2]|0;l=c[f+16>>2]|0;c[g>>2]=c[f+8>>2];c[g+4>>2]=k;c[g+8>>2]=l;sc(100,h,9672,g)|0;$d(c[j>>2]|0,h,-1,-1);i=e;return}function vm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,j=0,k=0,l=0,m=0;e=i;i=i+176|0;g=e+48|0;k=e+68|0;m=e+64|0;l=e+60|0;f=e;j=e+72|0;c[k>>2]=a;c[m>>2]=b;c[l>>2]=d;if(Bm(c[k>>2]|0,c[m>>2]|0,c[l>>2]|0,f)|0){i=e;return}Fm(f);l=c[f+24>>2]|0;m=~~+h[f+32>>3];c[g>>2]=c[f+20>>2];c[g+4>>2]=l;c[g+8>>2]=m;sc(100,j,9656,g)|0;$d(c[k>>2]|0,j,-1,-1);i=e;return}function wm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,j=0,k=0,l=0,m=0;e=i;i=i+192|0;g=e+48|0;k=e+80|0;m=e+76|0;l=e+72|0;f=e;j=e+84|0;c[k>>2]=a;c[m>>2]=b;c[l>>2]=d;if(Bm(c[k>>2]|0,c[m>>2]|0,c[l>>2]|0,f)|0){i=e;return}Dm(f);d=c[f+12>>2]|0;b=c[f+16>>2]|0;a=c[f+20>>2]|0;l=c[f+24>>2]|0;m=~~+h[f+32>>3];c[g>>2]=c[f+8>>2];c[g+4>>2]=d;c[g+8>>2]=b;c[g+12>>2]=a;c[g+16>>2]=l;c[g+20>>2]=m;sc(100,j,9624,g)|0;$d(c[k>>2]|0,j,-1,-1);i=e;return}function xm(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,j=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;t=i;i=i+272|0;r=t+112|0;o=t+156|0;y=t+152|0;z=t+148|0;q=t+64|0;v=t+56|0;n=t+144|0;l=t+140|0;j=t+136|0;w=t+132|0;f=t+128|0;m=t+160|0;s=t+48|0;g=t+124|0;p=t;u=t+120|0;c[o>>2]=b;c[y>>2]=d;c[z>>2]=e;c[f>>2]=Ed(c[c[z>>2]>>2]|0)|0;if(!(c[f>>2]|0)){i=t;return}if(Bm(c[o>>2]|0,(c[y>>2]|0)-1|0,(c[z>>2]|0)+4|0,q)|0){i=t;return}c[w>>2]=pe(c[o>>2]|0)|0;c[n>>2]=0;b=v;c[b>>2]=1;c[b+4>>2]=0;a:while(1){if(!(a[(c[f>>2]|0)+(c[n>>2]|0)>>0]|0))break;if((a[(c[f>>2]|0)+(c[n>>2]|0)>>0]|0)==37){switch(a[(c[f>>2]|0)+((c[n>>2]|0)+1)>>0]|0){case 102:{d=v;b=v;c[b>>2]=bF(c[d>>2]|0,c[d+4>>2]|0,8,0)|0;c[b+4>>2]=D;break};case 87:case 83:case 77:case 109:case 72:case 100:{d=v;b=v;c[b>>2]=bF(c[d>>2]|0,c[d+4>>2]|0,1,0)|0;c[b+4>>2]=D;break};case 74:case 115:{d=v;b=v;c[b>>2]=bF(c[d>>2]|0,c[d+4>>2]|0,50,0)|0;c[b+4>>2]=D;break};case 89:{d=v;b=v;c[b>>2]=bF(c[d>>2]|0,c[d+4>>2]|0,8,0)|0;c[b+4>>2]=D;break};case 37:case 119:break;case 106:{d=v;b=v;c[b>>2]=bF(c[d>>2]|0,c[d+4>>2]|0,3,0)|0;c[b+4>>2]=D;break};default:{x=43;break a}}c[n>>2]=(c[n>>2]|0)+1}c[n>>2]=(c[n>>2]|0)+1;d=v;d=bF(c[d>>2]|0,c[d+4>>2]|0,1,0)|0;b=v;c[b>>2]=d;c[b+4>>2]=D}if((x|0)==43){i=t;return}b=v;d=c[b+4>>2]|0;if(!(d>>>0<0|(d|0)==0&(c[b>>2]|0)>>>0<100)){d=v;z=c[d+4>>2]|0;b=c[(c[w>>2]|0)+88>>2]|0;e=((b|0)<0)<<31>>31;if(z>>>0>e>>>0|((z|0)==(e|0)?(c[d>>2]|0)>>>0>b>>>0:0)){he(c[o>>2]|0);i=t;return}b=c[v>>2]|0;c[j>>2]=Qe(c[w>>2]|0,b,((b|0)<0)<<31>>31)|0;if(!(c[j>>2]|0)){ie(c[o>>2]|0);i=t;return}}else c[j>>2]=m;Cm(q);Dm(q);c[l>>2]=0;c[n>>2]=0;while(1){if(!(a[(c[f>>2]|0)+(c[n>>2]|0)>>0]|0))break;v=c[n>>2]|0;b:do if((a[(c[f>>2]|0)+(c[n>>2]|0)>>0]|0)!=37){d=a[(c[f>>2]|0)+v>>0]|0;b=c[l>>2]|0;c[l>>2]=b+1;a[(c[j>>2]|0)+b>>0]=d}else{c[n>>2]=v+1;do switch(a[(c[f>>2]|0)+(c[n>>2]|0)>>0]|0){case 106:case 87:{x=p+0|0;w=q+0|0;v=x+48|0;do{c[x>>2]=c[w>>2];x=x+4|0;w=w+4|0}while((x|0)<(v|0));a[p+42>>0]=0;c[p+12>>2]=1;c[p+16>>2]=1;Cm(p);d=q;b=p;c[g>>2]=jF(bF(ZE(c[d>>2]|0,c[d+4>>2]|0,c[b>>2]|0,c[b+4>>2]|0)|0,D|0,432e5,0)|0,D|0,864e5,0)|0;if((a[(c[f>>2]|0)+(c[n>>2]|0)>>0]|0)==87){b=q;b=bF(c[b>>2]|0,c[b+4>>2]|0,432e5,0)|0;b=jF(b|0,D|0,864e5,0)|0;b=kF(b|0,D|0,7,0)|0;c[u>>2]=b;b=(c[j>>2]|0)+(c[l>>2]|0)|0;c[r>>2]=((c[g>>2]|0)+7-(c[u>>2]|0)|0)/7|0;sc(3,b,9424,r)|0;c[l>>2]=(c[l>>2]|0)+2;break b}else{b=(c[j>>2]|0)+(c[l>>2]|0)|0;c[r>>2]=(c[g>>2]|0)+1;sc(4,b,9440,r)|0;c[l>>2]=(c[l>>2]|0)+3;break b}};case 77:{b=(c[j>>2]|0)+(c[l>>2]|0)|0;c[r>>2]=c[q+24>>2];sc(3,b,9424,r)|0;c[l>>2]=(c[l>>2]|0)+2;break b};case 115:{b=(c[j>>2]|0)+(c[l>>2]|0)|0;e=q;d=r;c[d>>2]=ZE(jF(c[e>>2]|0,c[e+4>>2]|0,1e3,0)|0,D|0,413362496,49)|0;c[d+4>>2]=D;sc(30,b,9456,r)|0;c[l>>2]=(Mb((c[j>>2]|0)+(c[l>>2]|0)|0)|0)+(c[l>>2]|0);break b};case 72:{b=(c[j>>2]|0)+(c[l>>2]|0)|0;c[r>>2]=c[q+20>>2];sc(3,b,9424,r)|0;c[l>>2]=(c[l>>2]|0)+2;break b};case 109:{b=(c[j>>2]|0)+(c[l>>2]|0)|0;c[r>>2]=c[q+12>>2];sc(3,b,9424,r)|0;c[l>>2]=(c[l>>2]|0)+2;break b};case 89:{b=(c[j>>2]|0)+(c[l>>2]|0)|0;c[r>>2]=c[q+8>>2];sc(5,b,9464,r)|0;c[l>>2]=(Mb((c[j>>2]|0)+(c[l>>2]|0)|0)|0)+(c[l>>2]|0);break b};case 74:{b=(c[j>>2]|0)+(c[l>>2]|0)|0;d=q;h[k>>3]=(+((c[d>>2]|0)>>>0)+4294967296.0*+(c[d+4>>2]|0))/864.0e5;c[r>>2]=c[k>>2];c[r+4>>2]=c[k+4>>2];sc(20,b,9448,r)|0;c[l>>2]=(Mb((c[j>>2]|0)+(c[l>>2]|0)|0)|0)+(c[l>>2]|0);break b};case 100:{b=(c[j>>2]|0)+(c[l>>2]|0)|0;c[r>>2]=c[q+16>>2];sc(3,b,9424,r)|0;c[l>>2]=(c[l>>2]|0)+2;break b};case 119:{d=q;d=kF(jF(bF(c[d>>2]|0,c[d+4>>2]|0,1296e5,0)|0,D|0,864e5,0)|0,D|0,7,0)|0;b=c[l>>2]|0;c[l>>2]=b+1;a[(c[j>>2]|0)+b>>0]=((d&255)<<24>>24)+48;break b};case 83:{b=(c[j>>2]|0)+(c[l>>2]|0)|0;c[r>>2]=~~+h[q+32>>3];sc(3,b,9424,r)|0;c[l>>2]=(c[l>>2]|0)+2;break b};case 102:{h[s>>3]=+h[q+32>>3];if(+h[s>>3]>59.999)h[s>>3]=59.999;b=(c[j>>2]|0)+(c[l>>2]|0)|0;h[k>>3]=+h[s>>3];c[r>>2]=c[k>>2];c[r+4>>2]=c[k+4>>2];sc(7,b,9432,r)|0;c[l>>2]=(Mb((c[j>>2]|0)+(c[l>>2]|0)|0)|0)+(c[l>>2]|0);break b};default:{b=c[l>>2]|0;c[l>>2]=b+1;a[(c[j>>2]|0)+b>>0]=37;break b}}while(0)}while(0);c[n>>2]=(c[n>>2]|0)+1}a[(c[j>>2]|0)+(c[l>>2]|0)>>0]=0;$d(c[o>>2]|0,c[j>>2]|0,-1,(c[j>>2]|0)==(m|0)?-1:16);i=t;return}function ym(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;i=i+16|0;f=e+8|0;c[f>>2]=a;c[e+4>>2]=b;c[e>>2]=d;vm(c[f>>2]|0,0,0);i=e;return}function zm(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;i=i+16|0;f=e+8|0;c[f>>2]=a;c[e+4>>2]=b;c[e>>2]=d;wm(c[f>>2]|0,0,0);i=e;return}function Am(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=i;i=i+16|0;f=e+8|0;c[f>>2]=a;c[e+4>>2]=b;c[e>>2]=d;um(c[f>>2]|0,0,0);i=e;return}function Bm(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0.0;h=i;i=i+32|0;g=h+28|0;k=h+24|0;o=h+20|0;m=h+16|0;l=h+12|0;p=h+8|0;j=h+4|0;n=h;c[k>>2]=b;c[o>>2]=d;c[m>>2]=e;c[l>>2]=f;e=(c[l>>2]|0)+0|0;f=e+48|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(f|0));if(!(c[o>>2]|0)){c[g>>2]=Gm(c[k>>2]|0,c[l>>2]|0)|0;b=c[g>>2]|0;i=h;return b|0}b=Nd(c[c[m>>2]>>2]|0)|0;c[n>>2]=b;f=c[c[m>>2]>>2]|0;do if((b|0)==2|(c[n>>2]|0)==1){q=+Hd(f)*864.0e5+.5;d=+O(q)>=1.0?q>0.0?(ca(+N(q/4294967296.0),4294967295.0)|0)>>>0:~~+_((q- +(~~q>>>0))/4294967296.0)>>>0:0;b=c[l>>2]|0;c[b>>2]=~~q>>>0;c[b+4>>2]=d;a[(c[l>>2]|0)+42>>0]=1}else{c[j>>2]=Ed(f)|0;if((c[j>>2]|0)!=0?(Hm(c[k>>2]|0,c[j>>2]|0,c[l>>2]|0)|0)==0:0)break;c[g>>2]=1;b=c[g>>2]|0;i=h;return b|0}while(0);c[p>>2]=1;while(1){if((c[p>>2]|0)>=(c[o>>2]|0)){j=14;break}c[j>>2]=Ed(c[(c[m>>2]|0)+(c[p>>2]<<2)>>2]|0)|0;if(!(c[j>>2]|0)){j=12;break}if(Im(c[k>>2]|0,c[j>>2]|0,c[l>>2]|0)|0){j=12;break}c[p>>2]=(c[p>>2]|0)+1}if((j|0)==12){c[g>>2]=1;b=c[g>>2]|0;i=h;return b|0}else if((j|0)==14){c[g>>2]=0;b=c[g>>2]|0;i=h;return b|0}return 0}function Cm(b){b=b|0;var d=0,e=0,f=0,g=0,j=0,k=0,l=0,m=0,n=0,o=0.0;d=i;i=i+32|0;n=d+28|0;e=d+24|0;k=d+20|0;m=d+16|0;f=d+12|0;g=d+8|0;j=d+4|0;l=d;c[n>>2]=b;if(a[(c[n>>2]|0)+42>>0]|0){i=d;return}if(a[(c[n>>2]|0)+40>>0]|0){c[e>>2]=c[(c[n>>2]|0)+8>>2];c[k>>2]=c[(c[n>>2]|0)+12>>2];c[m>>2]=c[(c[n>>2]|0)+16>>2]}else{c[e>>2]=2e3;c[k>>2]=1;c[m>>2]=1}if((c[k>>2]|0)<=2){c[e>>2]=(c[e>>2]|0)+ -1;c[k>>2]=(c[k>>2]|0)+12}c[f>>2]=(c[e>>2]|0)/100|0;c[g>>2]=2-(c[f>>2]|0)+((c[f>>2]|0)/4|0);c[j>>2]=(((c[e>>2]|0)+4716|0)*36525|0)/100|0;c[l>>2]=(((c[k>>2]|0)+1|0)*306001|0)/1e4|0;o=(+((c[j>>2]|0)+(c[l>>2]|0)+(c[m>>2]|0)+(c[g>>2]|0)|0)-1524.5)*864.0e5;l=+O(o)>=1.0?o>0.0?(ca(+N(o/4294967296.0),4294967295.0)|0)>>>0:~~+_((o- +(~~o>>>0))/4294967296.0)>>>0:0;m=c[n>>2]|0;c[m>>2]=~~o>>>0;c[m+4>>2]=l;a[(c[n>>2]|0)+42>>0]=1;if(!(a[(c[n>>2]|0)+41>>0]|0)){i=d;return}l=$(c[(c[n>>2]|0)+20>>2]|0,36e5)|0;l=l+((c[(c[n>>2]|0)+24>>2]|0)*6e4|0)|0;o=+h[(c[n>>2]|0)+32>>3]*1.0e3;l=bF(l|0,((l|0)<0)<<31>>31|0,~~o>>>0|0,(+O(o)>=1.0?o>0.0?(ca(+N(o/4294967296.0),4294967295.0)|0)>>>0:~~+_((o- +(~~o>>>0))/4294967296.0)>>>0:0)|0)|0;m=c[n>>2]|0;k=m;l=bF(c[k>>2]|0,c[k+4>>2]|0,l|0,D|0)|0;c[m>>2]=l;c[m+4>>2]=D;if(!(a[(c[n>>2]|0)+43>>0]|0)){i=d;return}l=(c[(c[n>>2]|0)+28>>2]|0)*6e4|0;m=c[n>>2]|0;k=m;l=ZE(c[k>>2]|0,c[k+4>>2]|0,l|0,((l|0)<0)<<31>>31|0)|0;c[m>>2]=l;c[m+4>>2]=D;a[(c[n>>2]|0)+40>>0]=0;a[(c[n>>2]|0)+41>>0]=0;a[(c[n>>2]|0)+43>>0]=0;i=d;return}function Dm(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;Em(c[d>>2]|0);Fm(c[d>>2]|0);i=b;return}function Em(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;h=i;i=i+32|0;e=h+28|0;f=h+24|0;g=h+20|0;d=h+16|0;j=h+12|0;k=h+8|0;l=h+4|0;m=h;c[e>>2]=b;if(a[(c[e>>2]|0)+40>>0]|0){i=h;return}b=c[e>>2]|0;if(a[(c[e>>2]|0)+42>>0]|0){b=bF(c[b>>2]|0,c[b+4>>2]|0,432e5,0)|0;b=jF(b|0,D|0,864e5,0)|0;c[f>>2]=b;c[g>>2]=~~((+(c[f>>2]|0)-1867216.25)/36524.25);c[g>>2]=(c[f>>2]|0)+1+(c[g>>2]|0)-((c[g>>2]|0)/4|0);c[d>>2]=(c[g>>2]|0)+1524;c[j>>2]=~~((+(c[d>>2]|0)-122.1)/365.25);c[k>>2]=((c[j>>2]|0)*36525|0)/100|0;c[l>>2]=~~(+((c[d>>2]|0)-(c[k>>2]|0)|0)/30.6001);c[m>>2]=~~(+(c[l>>2]|0)*30.6001);c[(c[e>>2]|0)+16>>2]=(c[d>>2]|0)-(c[k>>2]|0)-(c[m>>2]|0);b=c[l>>2]|0;c[(c[e>>2]|0)+12>>2]=(c[l>>2]|0)<14?b-1|0:b-13|0;b=c[j>>2]|0;c[(c[e>>2]|0)+8>>2]=(c[(c[e>>2]|0)+12>>2]|0)>2?b-4716|0:b-4715|0}else{c[b+8>>2]=2e3;c[(c[e>>2]|0)+12>>2]=1;c[(c[e>>2]|0)+16>>2]=1}a[(c[e>>2]|0)+40>>0]=1;i=h;return}function Fm(b){b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[e>>2]=b;if(a[(c[e>>2]|0)+41>>0]|0){i=d;return}Cm(c[e>>2]|0);b=c[e>>2]|0;b=bF(c[b>>2]|0,c[b+4>>2]|0,432e5,0)|0;b=kF(b|0,D|0,864e5,0)|0;c[f>>2]=b;h[(c[e>>2]|0)+32>>3]=+(c[f>>2]|0)/1.0e3;c[f>>2]=~~+h[(c[e>>2]|0)+32>>3];b=(c[e>>2]|0)+32|0;h[b>>3]=+h[b>>3]- +(c[f>>2]|0);c[(c[e>>2]|0)+20>>2]=(c[f>>2]|0)/3600|0;c[f>>2]=(c[f>>2]|0)-((c[(c[e>>2]|0)+20>>2]|0)*3600|0);c[(c[e>>2]|0)+24>>2]=(c[f>>2]|0)/60|0;b=(c[e>>2]|0)+32|0;h[b>>3]=+h[b>>3]+ +((c[f>>2]|0)-((c[(c[e>>2]|0)+24>>2]|0)*60|0)|0);a[(c[e>>2]|0)+41>>0]=1;i=d;return}function Gm(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;f=e+8|0;h=e+4|0;g=e;c[h>>2]=b;c[g>>2]=d;d=Rm(c[h>>2]|0)|0;b=c[g>>2]|0;c[b>>2]=d;c[b+4>>2]=D;b=c[g>>2]|0;d=c[b+4>>2]|0;if((d|0)>0|(d|0)==0&(c[b>>2]|0)>>>0>0){a[(c[g>>2]|0)+42>>0]=1;c[f>>2]=0;h=c[f>>2]|0;i=e;return h|0}else{c[f>>2]=1;h=c[f>>2]|0;i=e;return h|0}return 0}function Hm(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,j=0,k=0,l=0,m=0,n=0.0;f=i;i=i+32|0;g=f+20|0;j=f+16|0;l=f+12|0;k=f+8|0;m=f;c[j>>2]=b;c[l>>2]=d;c[k>>2]=e;if(!(Qm(c[l>>2]|0,c[k>>2]|0)|0)){c[g>>2]=0;b=c[g>>2]|0;i=f;return b|0}if(!(Mm(c[l>>2]|0,c[k>>2]|0)|0)){c[g>>2]=0;b=c[g>>2]|0;i=f;return b|0}if(!(xc(c[l>>2]|0,9616)|0)){c[g>>2]=Gm(c[j>>2]|0,c[k>>2]|0)|0;b=c[g>>2]|0;i=f;return b|0}b=c[l>>2]|0;if(Lm(b,m,Mb(c[l>>2]|0)|0,1)|0){n=+h[m>>3]*864.0e5+.5;d=+O(n)>=1.0?n>0.0?(ca(+N(n/4294967296.0),4294967295.0)|0)>>>0:~~+_((n- +(~~n>>>0))/4294967296.0)>>>0:0;b=c[k>>2]|0;c[b>>2]=~~n>>>0;c[b+4>>2]=d;a[(c[k>>2]|0)+42>>0]=1;c[g>>2]=0;b=c[g>>2]|0;i=f;return b|0}else{c[g>>2]=1;b=c[g>>2]|0;i=f;return b|0}return 0}function Im(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0.0;g=i;i=i+160|0;x=g+124|0;z=g+120|0;k=g+116|0;l=g+112|0;v=g+108|0;q=g+80|0;j=g+104|0;y=g+72|0;w=g+64|0;r=g+56|0;m=g+100|0;n=g+8|0;o=g;t=g+96|0;s=g+92|0;p=g+88|0;c[x>>2]=b;c[z>>2]=e;c[k>>2]=f;c[l>>2]=1;c[j>>2]=g+128;c[v>>2]=0;while(1){if((c[v>>2]|0)>=29)break;if(!(a[(c[z>>2]|0)+(c[v>>2]|0)>>0]|0))break;a[(c[j>>2]|0)+(c[v>>2]|0)>>0]=a[440+(d[(c[z>>2]|0)+(c[v>>2]|0)>>0]|0)>>0]|0;c[v>>2]=(c[v>>2]|0)+1}a[(c[j>>2]|0)+(c[v>>2]|0)>>0]=0;switch(a[c[j>>2]>>0]|0){case 57:case 56:case 55:case 54:case 53:case 52:case 51:case 50:case 49:case 48:case 45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m)|0;if((c[v>>2]|0)>10|(c[v>>2]|0)<3){b=c[l>>2]|0;i=g;return b|0}if((a[(c[j>>2]|0)+((c[v>>2]|0)-1)>>0]|0)==115){a[(c[j>>2]|0)+((c[v>>2]|0)-1)>>0]=0;c[v>>2]=(c[v>>2]|0)+ -1}Cm(c[k>>2]|0);c[l>>2]=0;h[r>>3]=+h[q>>3]<0.0?-.5:.5;if((c[v>>2]|0)==3?(UE(c[j>>2]|0,9560)|0)==0:0){A=+h[q>>3]*864.0e5+ +h[r>>3];e=+O(A)>=1.0?A>0.0?(ca(+N(A/4294967296.0),4294967295.0)|0)>>>0:~~+_((A- +(~~A>>>0))/4294967296.0)>>>0:0;b=c[k>>2]|0;f=b;e=bF(c[f>>2]|0,c[f+4>>2]|0,~~A>>>0|0,e|0)|0;c[b>>2]=e;c[b+4>>2]=D}else u=50;do if((u|0)==50){if((c[v>>2]|0)==4?(UE(c[j>>2]|0,9568)|0)==0:0){A=+h[q>>3]*36.0e5+ +h[r>>3];e=+O(A)>=1.0?A>0.0?(ca(+N(A/4294967296.0),4294967295.0)|0)>>>0:~~+_((A- +(~~A>>>0))/4294967296.0)>>>0:0;b=c[k>>2]|0;f=b;e=bF(c[f>>2]|0,c[f+4>>2]|0,~~A>>>0|0,e|0)|0;c[b>>2]=e;c[b+4>>2]=D;break}if((c[v>>2]|0)==6?(UE(c[j>>2]|0,9576)|0)==0:0){A=+h[q>>3]*6.0e4+ +h[r>>3];e=+O(A)>=1.0?A>0.0?(ca(+N(A/4294967296.0),4294967295.0)|0)>>>0:~~+_((A- +(~~A>>>0))/4294967296.0)>>>0:0;b=c[k>>2]|0;f=b;e=bF(c[f>>2]|0,c[f+4>>2]|0,~~A>>>0|0,e|0)|0;c[b>>2]=e;c[b+4>>2]=D;break}if((c[v>>2]|0)==6?(UE(c[j>>2]|0,9584)|0)==0:0){A=+h[q>>3]*1.0e3+ +h[r>>3];e=+O(A)>=1.0?A>0.0?(ca(+N(A/4294967296.0),4294967295.0)|0)>>>0:~~+_((A- +(~~A>>>0))/4294967296.0)>>>0:0;b=c[k>>2]|0;f=b;e=bF(c[f>>2]|0,c[f+4>>2]|0,~~A>>>0|0,e|0)|0;c[b>>2]=e;c[b+4>>2]=D;break}if((c[v>>2]|0)==5?(UE(c[j>>2]|0,9544)|0)==0:0){Dm(c[k>>2]|0);b=(c[k>>2]|0)+12|0;c[b>>2]=(c[b>>2]|0)+~~+h[q>>3];b=c[(c[k>>2]|0)+12>>2]|0;c[t>>2]=(((c[(c[k>>2]|0)+12>>2]|0)>0?b-1|0:b-12|0)|0)/12|0;b=(c[k>>2]|0)+8|0;c[b>>2]=(c[b>>2]|0)+(c[t>>2]|0);b=(c[k>>2]|0)+12|0;c[b>>2]=(c[b>>2]|0)-((c[t>>2]|0)*12|0);a[(c[k>>2]|0)+42>>0]=0;Cm(c[k>>2]|0);c[s>>2]=~~+h[q>>3];if(!(+(c[s>>2]|0)!=+h[q>>3]))break;A=(+h[q>>3]- +(c[s>>2]|0))*30.0*864.0e5+ +h[r>>3];e=+O(A)>=1.0?A>0.0?(ca(+N(A/4294967296.0),4294967295.0)|0)>>>0:~~+_((A- +(~~A>>>0))/4294967296.0)>>>0:0;b=c[k>>2]|0;f=b;e=bF(c[f>>2]|0,c[f+4>>2]|0,~~A>>>0|0,e|0)|0;c[b>>2]=e;c[b+4>>2]=D;break}if((c[v>>2]|0)==4?(UE(c[j>>2]|0,9552)|0)==0:0){c[p>>2]=~~+h[q>>3];Dm(c[k>>2]|0);b=(c[k>>2]|0)+8|0;c[b>>2]=(c[b>>2]|0)+(c[p>>2]|0);a[(c[k>>2]|0)+42>>0]=0;Cm(c[k>>2]|0);if(!(+(c[p>>2]|0)!=+h[q>>3]))break;A=(+h[q>>3]- +(c[p>>2]|0))*365.0*864.0e5+ +h[r>>3];e=+O(A)>=1.0?A>0.0?(ca(+N(A/4294967296.0),4294967295.0)|0)>>>0:~~+_((A- +(~~A>>>0))/4294967296.0)>>>0:0;b=c[k>>2]|0;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|0,c[f+4>>2]|0,e|0,D|0)|0;c[b>>2]=e;c[b+4>>2]=D;Km(c[k>>2]|0);b=c[l>>2]|0;i=g;return b|0};case 115:{if(VE(c[j>>2]|0,9528,9)|0){b=c[l>>2]|0;i=g;return b|0}c[j>>2]=(c[j>>2]|0)+9;Em(c[k>>2]|0);a[(c[k>>2]|0)+41>>0]=1;c[(c[k>>2]|0)+24>>2]=0;c[(c[k>>2]|0)+20>>2]=0;h[(c[k>>2]|0)+32>>3]=0.0;a[(c[k>>2]|0)+43>>0]=0;a[(c[k>>2]|0)+42>>0]=0;if(!(UE(c[j>>2]|0,9544)|0)){c[(c[k>>2]|0)+16>>2]=1;c[l>>2]=0;b=c[l>>2]|0;i=g;return b|0}if(!(UE(c[j>>2]|0,9552)|0)){Em(c[k>>2]|0);c[(c[k>>2]|0)+12>>2]=1;c[(c[k>>2]|0)+16>>2]=1;c[l>>2]=0;b=c[l>>2]|0;i=g;return b|0}if(UE(c[j>>2]|0,9560)|0){b=c[l>>2]|0;i=g;return b|0}c[l>>2]=0;b=c[l>>2]|0;i=g;return b|0};case 117:{if((UE(c[j>>2]|0,9488)|0)==0?(a[(c[k>>2]|0)+42>>0]|0)!=0:0){e=c[k>>2]|0;e=bF(c[e>>2]|0,c[e+4>>2]|0,43200,0)|0;e=jF(e|0,D|0,86400,0)|0;e=bF(e|0,D|0,1045635584,49096)|0;b=c[k>>2]|0;c[b>>2]=e;c[b+4>>2]=D;Km(c[k>>2]|0);c[l>>2]=0;b=c[l>>2]|0;i=g;return b|0}if(UE(c[j>>2]|0,9504)|0){b=c[l>>2]|0;i=g;return b|0}Cm(c[k>>2]|0);e=Jm(c[k>>2]|0,c[x>>2]|0,l)|0;b=y;c[b>>2]=e;c[b+4>>2]=D;if(c[l>>2]|0){b=c[l>>2]|0;i=g;return b|0}f=y;b=c[k>>2]|0;e=b;f=ZE(c[e>>2]|0,c[e+4>>2]|0,c[f>>2]|0,c[f+4>>2]|0)|0;c[b>>2]=f;c[b+4>>2]=D;Km(c[k>>2]|0);b=y;f=c[b>>2]|0;b=c[b+4>>2]|0;e=Jm(c[k>>2]|0,c[x>>2]|0,l)|0;e=ZE(f|0,b|0,e|0,D|0)|0;b=c[k>>2]|0;f=b;e=bF(c[f>>2]|0,c[f+4>>2]|0,e|0,D|0)|0;c[b>>2]=e;c[b+4>>2]=D;b=c[l>>2]|0;i=g;return b|0};default:{b=c[l>>2]|0;i=g;return b|0}}return 0}function Jm(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;o=i;i=i+176|0;f=o+96|0;q=o+164|0;l=o+160|0;m=o+156|0;n=o+48|0;p=o;j=o+152|0;k=o+108|0;g=o+104|0;c[q>>2]=b;c[l>>2]=d;c[m>>2]=e;d=k+0|0;e=d+44|0;do{c[d>>2]=0;d=d+4|0}while((d|0)<(e|0));d=n+0|0;q=(c[q>>2]|0)+0|0;e=d+48|0;do{c[d>>2]=c[q>>2];d=d+4|0;q=q+4|0}while((d|0)<(e|0));Dm(n);if((c[n+8>>2]|0)>=1971?(c[n+8>>2]|0)<2038:0){c[g>>2]=~~(+h[n+32>>3]+.5);h[n+32>>3]=+(c[g>>2]|0)}else{c[n+8>>2]=2e3;c[n+12>>2]=1;c[n+16>>2]=1;c[n+20>>2]=0;c[n+24>>2]=0;h[n+32>>3]=0.0}c[n+28>>2]=0;a[n+42>>0]=0;Cm(n);b=n;b=jF(c[b>>2]|0,c[b+4>>2]|0,1e3,0)|0;b=ZE(b|0,D|0,413362496,49)|0;c[j>>2]=b;if(Pm(j,k)|0){Ud(c[l>>2]|0,9592,-1);c[c[m>>2]>>2]=1;d=f;c[d>>2]=0;c[d+4>>2]=0;d=f;b=d;b=c[b>>2]|0;d=d+4|0;d=c[d>>2]|0;D=d;i=o;return b|0}else{c[p+8>>2]=(c[k+20>>2]|0)+1900;c[p+12>>2]=(c[k+16>>2]|0)+1;c[p+16>>2]=c[k+12>>2];c[p+20>>2]=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]|0)&1;c[q>>2]=(c[p>>2]|0)+(c[B>>2]|0)+(d[E>>0]|0)+ -3;c[p>>2]=(c[p>>2]|0)+(d[E>>0]&1)}while(1){if((c[p>>2]|0)>>>0>=(c[q>>2]|0)>>>0)break;if(!(d[1224+(d[c[p>>2]>>0]|0)>>0]&1))break;c[p>>2]=(c[p>>2]|0)+(c[z>>2]|0)}if((c[p>>2]|0)>>>0>=(c[q>>2]|0)>>>0){c[j>>2]=0;b=c[j>>2]|0;i=k;return b|0}if((a[c[p>>2]>>0]|0)!=45){if((a[c[p>>2]>>0]|0)==43)c[p>>2]=(c[p>>2]|0)+(c[z>>2]|0)}else{c[v>>2]=-1;c[p>>2]=(c[p>>2]|0)+(c[z>>2]|0)}while(1){if((c[p>>2]|0)>>>0>=(c[q>>2]|0)>>>0)break;if((a[c[p>>2]>>0]|0)!=48)break;c[p>>2]=(c[p>>2]|0)+(c[z>>2]|0);c[o>>2]=(c[o>>2]|0)+1}while(1){if((c[p>>2]|0)>>>0>=(c[q>>2]|0)>>>0)break;b=y;e=c[b+4>>2]|0;if(!((d[1224+(d[c[p>>2]>>0]|0)>>0]&4|0)!=0&((e|0)<214748364|(e|0)==214748364&(c[b>>2]|0)>>>0<3435973835)))break;b=y;b=lF(c[b>>2]|0,c[b+4>>2]|0,10,0)|0;e=(a[c[p>>2]>>0]|0)-48|0;e=bF(b|0,D|0,e|0,((e|0)<0)<<31>>31|0)|0;b=y;c[b>>2]=e;c[b+4>>2]=D;c[p>>2]=(c[p>>2]|0)+(c[z>>2]|0);c[o>>2]=(c[o>>2]|0)+1}while(1){if((c[p>>2]|0)>>>0>=(c[q>>2]|0)>>>0)break;if(!(d[1224+(d[c[p>>2]>>0]|0)>>0]&4))break;c[p>>2]=(c[p>>2]|0)+(c[z>>2]|0);c[o>>2]=(c[o>>2]|0)+1;c[w>>2]=(c[w>>2]|0)+1}a:do if((c[p>>2]|0)>>>0<(c[q>>2]|0)>>>0){b:do if((a[c[p>>2]>>0]|0)==46){c[p>>2]=(c[p>>2]|0)+(c[z>>2]|0);while(1){if((c[p>>2]|0)>>>0>=(c[q>>2]|0)>>>0)break;b=y;e=c[b+4>>2]|0;if(!((d[1224+(d[c[p>>2]>>0]|0)>>0]&4|0)!=0&((e|0)<214748364|(e|0)==214748364&(c[b>>2]|0)>>>0<3435973835)))break;b=y;b=lF(c[b>>2]|0,c[b+4>>2]|0,10,0)|0;e=(a[c[p>>2]>>0]|0)-48|0;e=bF(b|0,D|0,e|0,((e|0)<0)<<31>>31|0)|0;b=y;c[b>>2]=e;c[b+4>>2]=D;c[p>>2]=(c[p>>2]|0)+(c[z>>2]|0);c[o>>2]=(c[o>>2]|0)+1;c[w>>2]=(c[w>>2]|0)+ -1}while(1){if((c[p>>2]|0)>>>0>=(c[q>>2]|0)>>>0)break b;if(!(d[1224+(d[c[p>>2]>>0]|0)>>0]&4))break b;c[p>>2]=(c[p>>2]|0)+(c[z>>2]|0);c[o>>2]=(c[o>>2]|0)+1}}while(0);if((c[p>>2]|0)>>>0<(c[q>>2]|0)>>>0){if(!((a[c[p>>2]>>0]|0)!=101?(a[c[p>>2]>>0]|0)!=69:0))A=38;c:do if((A|0)==38){c[p>>2]=(c[p>>2]|0)+(c[z>>2]|0);c[n>>2]=0;if((c[p>>2]|0)>>>0>=(c[q>>2]|0)>>>0)break a;if((a[c[p>>2]>>0]|0)!=45){if((a[c[p>>2]>>0]|0)==43)c[p>>2]=(c[p>>2]|0)+(c[z>>2]|0)}else{c[s>>2]=-1;c[p>>2]=(c[p>>2]|0)+(c[z>>2]|0)}while(1){if((c[p>>2]|0)>>>0>=(c[q>>2]|0)>>>0)break c;if(!(d[1224+(d[c[p>>2]>>0]|0)>>0]&4))break c;if((c[x>>2]|0)<1e4)A=((c[x>>2]|0)*10|0)+((a[c[p>>2]>>0]|0)-48)|0;else A=1e4;c[x>>2]=A;c[p>>2]=(c[p>>2]|0)+(c[z>>2]|0);c[n>>2]=1}}while(0);if((c[o>>2]|0)!=0&(c[n>>2]|0)!=0)while(1){if((c[p>>2]|0)>>>0>=(c[q>>2]|0)>>>0)break a;if(!(d[1224+(d[c[p>>2]>>0]|0)>>0]&1))break a;c[p>>2]=(c[p>>2]|0)+(c[z>>2]|0)}}}while(0);b=$(c[x>>2]|0,c[s>>2]|0)|0;c[x>>2]=b+(c[w>>2]|0);if((c[x>>2]|0)<0){c[s>>2]=-1;c[x>>2]=$(c[x>>2]|0,-1)|0}else c[s>>2]=1;b=y;do if((c[b>>2]|0)!=0|(c[b+4>>2]|0)!=0){d:do if((c[s>>2]|0)>0)while(1){b=y;e=c[b+4>>2]|0;if(!(((e|0)<214748364|(e|0)==214748364&(c[b>>2]|0)>>>0<3435973836)&(c[x>>2]|0)>0))break d;c[x>>2]=(c[x>>2]|0)+ -1;e=y;e=lF(c[e>>2]|0,c[e+4>>2]|0,10,0)|0;b=y;c[b>>2]=e;c[b+4>>2]=D}else while(1){b=y;b=kF(c[b>>2]|0,c[b+4>>2]|0,10,0)|0;if(!((b|0)==0&(D|0)==0&(c[x>>2]|0)>0))break d;c[x>>2]=(c[x>>2]|0)+ -1;e=y;e=jF(c[e>>2]|0,c[e+4>>2]|0,10,0)|0;b=y;c[b>>2]=e;c[b+4>>2]=D}while(0);f=(c[v>>2]|0)<0;e=y;g=c[e>>2]|0;e=c[e+4>>2]|0;E=ZE(0,0,g|0,e|0)|0;b=y;c[b>>2]=f?E:g;c[b+4>>2]=f?D:e;if(!(c[x>>2]|0)){b=y;h[m>>3]=+((c[b>>2]|0)>>>0)+4294967296.0*+(c[b+4>>2]|0);break}h[u>>3]=1.0;if((c[x>>2]|0)>307&(c[x>>2]|0)<342){while(1){if(!((c[x>>2]|0)%308|0))break;h[u>>3]=+h[u>>3]*10.0;c[x>>2]=(c[x>>2]|0)-1}b=y;F=+((c[b>>2]|0)>>>0)+4294967296.0*+(c[b+4>>2]|0);G=+h[u>>3];if((c[s>>2]|0)<0){h[m>>3]=F/G;h[m>>3]=+h[m>>3]/1.0e+308;break}else{h[m>>3]=F*G;h[m>>3]=+h[m>>3]*1.0e+308;break}}if((c[x>>2]|0)>=342){b=y;F=+((c[b>>2]|0)>>>0)+4294967296.0*+(c[b+4>>2]|0);if((c[s>>2]|0)<0){h[m>>3]=0.0*F;break}else{h[m>>3]=t*F;break}}while(1){if(!((c[x>>2]|0)%22|0))break;h[u>>3]=+h[u>>3]*10.0;c[x>>2]=(c[x>>2]|0)-1}while(1){if((c[x>>2]|0)<=0)break;h[u>>3]=+h[u>>3]*1.0e+22;c[x>>2]=(c[x>>2]|0)-22}b=y;F=+((c[b>>2]|0)>>>0)+4294967296.0*+(c[b+4>>2]|0);G=+h[u>>3];if((c[s>>2]|0)<0){h[m>>3]=F/G;break}else{h[m>>3]=F*G;break}}else{if((c[v>>2]|0)<0)s=(c[o>>2]|0)!=0;else s=0;h[m>>3]=s?-0.0:0.0}while(0);h[c[l>>2]>>3]=+h[m>>3];if(((c[o>>2]|0)>0?(c[p>>2]|0)>>>0>=(c[q>>2]|0)>>>0:0)&(c[n>>2]|0)!=0)l=(c[r>>2]|0)==0;else l=0;c[j>>2]=l&1;b=c[j>>2]|0;i=k;return b|0}function Mm(b,e){b=b|0;e=e|0;var f=0,g=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;m=i;i=i+80|0;l=m+16|0;g=m+76|0;k=m+72|0;n=m+68|0;o=m+64|0;p=m+60|0;f=m+56|0;q=m+8|0;j=m;c[k>>2]=b;c[n>>2]=e;h[q>>3]=0.0;b=c[k>>2]|0;c[l>>2]=2;c[l+4>>2]=0;c[l+8>>2]=24;c[l+12>>2]=58;c[l+16>>2]=o;c[l+20>>2]=2;c[l+24>>2]=0;c[l+28>>2]=59;c[l+32>>2]=0;c[l+36>>2]=p;if((Nm(b,l)|0)!=2){c[g>>2]=1;b=c[g>>2]|0;i=m;return b|0}c[k>>2]=(c[k>>2]|0)+5;if((a[c[k>>2]>>0]|0)==58){c[k>>2]=(c[k>>2]|0)+1;b=c[k>>2]|0;c[l>>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4;c[h>>2]=e;e=c[p>>2]|0;b=c[e>>2]|0;c[p>>2]=e+4;c[k>>2]=b;c[j>>2]=0;while(1){b=c[o>>2]|0;c[o>>2]=b+ -1;if(!b)break;if(!(d[1224+(d[c[l>>2]>>0]|0)>>0]&4)){h=11;break a}c[j>>2]=((c[j>>2]|0)*10|0)+(a[c[l>>2]>>0]|0)-48;c[l>>2]=(c[l>>2]|0)+1}if((c[j>>2]|0)<(c[n>>2]|0)){h=11;break}if((c[j>>2]|0)>(c[m>>2]|0)){h=11;break}if((c[h>>2]|0)!=0?(c[h>>2]|0)!=(a[c[l>>2]>>0]|0):0){h=11;break}c[c[k>>2]>>2]=c[j>>2];c[l>>2]=(c[l>>2]|0)+1;c[f>>2]=(c[f>>2]|0)+1;if(!(c[h>>2]|0)){h=11;break}}if((h|0)==11){i=g;return c[f>>2]|0}return 0}function Om(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;f=i;i=i+80|0;o=f;h=f+64|0;g=f+60|0;n=f+56|0;k=f+52|0;j=f+48|0;l=f+44|0;p=f+40|0;c[g>>2]=b;c[n>>2]=e;c[k>>2]=0;while(1){if(!(d[1224+(d[c[g>>2]>>0]|0)>>0]&1))break;c[g>>2]=(c[g>>2]|0)+1}c[(c[n>>2]|0)+28>>2]=0;c[p>>2]=a[c[g>>2]>>0];do if((c[p>>2]|0)==45){c[k>>2]=-1;m=11}else{if((c[p>>2]|0)==43){c[k>>2]=1;m=11;break}if((c[p>>2]|0)==90|(c[p>>2]|0)==122){c[g>>2]=(c[g>>2]|0)+1;break}c[h>>2]=(c[p>>2]|0)!=0&1;b=c[h>>2]|0;i=f;return b|0}while(0);do if((m|0)==11){c[g>>2]=(c[g>>2]|0)+1;b=c[g>>2]|0;c[o>>2]=2;c[o+4>>2]=0;c[o+8>>2]=14;c[o+12>>2]=58;c[o+16>>2]=j;c[o+20>>2]=2;c[o+24>>2]=0;c[o+28>>2]=59;c[o+32>>2]=0;c[o+36>>2]=l;if((Nm(b,o)|0)==2){c[g>>2]=(c[g>>2]|0)+5;b=$(c[k>>2]|0,(c[l>>2]|0)+((c[j>>2]|0)*60|0)|0)|0;c[(c[n>>2]|0)+28>>2]=b;break}c[h>>2]=1;b=c[h>>2]|0;i=f;return b|0}while(0);while(1){j=c[g>>2]|0;if(!(d[1224+(d[c[g>>2]>>0]|0)>>0]&1))break;c[g>>2]=j+1}c[h>>2]=(a[j>>0]|0)!=0&1;b=c[h>>2]|0;i=f;return b|0}function Pm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;f=i;i=i+16|0;h=f+12|0;g=f+8|0;e=f+4|0;d=f;c[h>>2]=a;c[g>>2]=b;a=kb(c[h>>2]|0)|0;c[d>>2]=a;c[d>>2]=(c[9726]|0)!=0?0:a;if(c[d>>2]|0){a=(c[g>>2]|0)+0|0;g=(c[d>>2]|0)+0|0;b=a+44|0;do{c[a>>2]=c[g>>2];a=a+4|0;g=g+4|0}while((a|0)<(b|0))}c[e>>2]=(c[d>>2]|0)==0&1;i=f;return c[e>>2]|0}function Qm(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;g=i;i=i+96|0;o=g;l=g+84|0;h=g+80|0;j=g+76|0;k=g+72|0;m=g+68|0;n=g+64|0;f=g+60|0;c[h>>2]=b;c[j>>2]=e;if((a[c[h>>2]>>0]|0)==45){c[h>>2]=(c[h>>2]|0)+1;c[f>>2]=1}else c[f>>2]=0;b=c[h>>2]|0;c[o>>2]=4;c[o+4>>2]=0;c[o+8>>2]=9999;c[o+12>>2]=45;c[o+16>>2]=k;c[o+20>>2]=2;c[o+24>>2]=1;c[o+28>>2]=12;c[o+32>>2]=45;c[o+36>>2]=m;c[o+40>>2]=2;c[o+44>>2]=1;c[o+48>>2]=31;c[o+52>>2]=0;c[o+56>>2]=n;if((Nm(b,o)|0)!=3){c[l>>2]=1;b=c[l>>2]|0;i=g;return b|0}c[h>>2]=(c[h>>2]|0)+10;while(1){if(d[1224+(d[c[h>>2]>>0]|0)>>0]&1)o=1;else o=84==(d[c[h>>2]>>0]|0);e=c[h>>2]|0;if(!o)break;c[h>>2]=e+1}do if(Mm(e,c[j>>2]|0)|0){if(!(a[c[h>>2]>>0]|0)){a[(c[j>>2]|0)+41>>0]=0;break}c[l>>2]=1;b=c[l>>2]|0;i=g;return b|0}while(0);a[(c[j>>2]|0)+42>>0]=0;a[(c[j>>2]|0)+40>>0]=1;b=c[k>>2]|0;c[(c[j>>2]|0)+8>>2]=(c[f>>2]|0)!=0?0-b|0:b;c[(c[j>>2]|0)+12>>2]=c[m>>2];c[(c[j>>2]|0)+16>>2]=c[n>>2];if(a[(c[j>>2]|0)+43>>0]|0)Cm(c[j>>2]|0);c[l>>2]=0;b=c[l>>2]|0;i=g;return b|0}function Rm(a){a=a|0;var b=0,d=0,e=0,f=0;d=i;i=i+16|0;f=d+8|0;b=d+4|0;e=d;c[f>>2]=a;c[b>>2]=c[(c[f>>2]|0)+12>>2];a=(c[b>>2]|0)+136|0;if((c[a>>2]|0)==0&(c[a+4>>2]|0)==0?(c[e>>2]=Sm(c[c[(c[c[f>>2]>>2]|0)+32>>2]>>2]|0,(c[b>>2]|0)+136|0)|0,(c[e>>2]|0)!=0):0){f=(c[b>>2]|0)+136|0;c[f>>2]=0;c[f+4>>2]=0}f=(c[b>>2]|0)+136|0;D=c[f+4>>2]|0;i=d;return c[f>>2]|0}function Sm(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,j=0,k=0.0;d=i;i=i+32|0;g=d+16|0;f=d+12|0;e=d+8|0;j=d;c[g>>2]=a;c[f>>2]=b;if((c[c[g>>2]>>2]|0)>=2?(c[(c[g>>2]|0)+72>>2]|0)!=0:0){c[e>>2]=zb[c[(c[g>>2]|0)+72>>2]&63](c[g>>2]|0,c[f>>2]|0)|0;a=c[e>>2]|0;i=d;return a|0}c[e>>2]=zb[c[(c[g>>2]|0)+64>>2]&63](c[g>>2]|0,j)|0;k=+h[j>>3]*864.0e5;j=+O(k)>=1.0?k>0.0?(ca(+N(k/4294967296.0),4294967295.0)|0)>>>0:~~+_((k- +(~~k>>>0))/4294967296.0)>>>0:0;a=c[f>>2]|0;c[a>>2]=~~k>>>0;c[a+4>>2]=j;a=c[e>>2]|0;i=d;return a|0}function Tm(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+32|0;k=e+16|0;j=e+12|0;f=e+8|0;g=e+4|0;h=e;c[k>>2]=a;c[j>>2]=b;c[f>>2]=0;c[g>>2]=c[k>>2];if((c[j>>2]|0)>=0)c[h>>2]=(c[g>>2]|0)+(c[j>>2]|0);else c[h>>2]=-1;while(1){if(!(d[c[g>>2]>>0]|0)){b=10;break}if((c[g>>2]|0)>>>0>=(c[h>>2]|0)>>>0){b=10;break}k=c[g>>2]|0;c[g>>2]=k+1;a:do if((d[k>>0]|0|0)>=192)while(1){if(((d[c[g>>2]>>0]|0)&192|0)!=128)break a;c[g>>2]=(c[g>>2]|0)+1}while(0);c[f>>2]=(c[f>>2]|0)+1}if((b|0)==10){i=e;return c[f>>2]|0}return 0}function Um(a){a=a|0;var b=0,e=0,f=0,g=0,h=0;b=i;i=i+16|0;f=b+4|0;e=b;c[f>>2]=a;g=c[f>>2]|0;a=c[g>>2]|0;c[g>>2]=a+1;c[e>>2]=d[a>>0];if((c[e>>2]|0)>>>0<192){g=c[e>>2]|0;i=b;return g|0}c[e>>2]=d[4984+((c[e>>2]|0)-192)>>0];while(1){a=c[e>>2]|0;if(((d[c[c[f>>2]>>2]>>0]|0)&192|0)!=128)break;h=c[f>>2]|0;g=c[h>>2]|0;c[h>>2]=g+1;c[e>>2]=(a<<6)+(63&(d[g>>0]|0))}if((a>>>0>=128?(c[e>>2]&-2048|0)!=55296:0)?(c[e>>2]&-2|0)!=65534:0){h=c[e>>2]|0;i=b;return h|0}c[e>>2]=65533;h=c[e>>2]|0;i=b;return h|0}function Vm(a,b,d){a=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0;if((d[(c[e>>2]|0)+24>>0]|0|0)==1){Xb(c[a>>2]|0,c[(c[e>>2]|0)+8>>2]|0);break}else{hc(c[a+8>>2]|0);break}}while(0);c[(c[e>>2]|0)+8>>2]=0;i=b;return}function _m(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;f=i;i=i+32|0;e=f+20|0;h=f+16|0;g=f+8|0;j=f;c[h>>2]=a;k=g;c[k>>2]=b;c[k+4>>2]=d;d=c[h>>2]|0;k=c[d+4>>2]|0;a=j;c[a>>2]=c[d>>2];c[a+4>>2]=k;a=g;k=c[a+4>>2]|0;d=j;b=c[d+4>>2]|0;if((k|0)>0|(k|0)==0&(c[a>>2]|0)>>>0>=0){if((b|0)>0|(b|0)==0&(c[d>>2]|0)>>>0>0?(a=j,a=ZE(-1,2147483647,c[a>>2]|0,c[a+4>>2]|0)|0,d=D,k=g,b=c[k+4>>2]|0,(d|0)<(b|0)|((d|0)==(b|0)?a>>>0<(c[k>>2]|0)>>>0:0)):0){c[e>>2]=1;k=c[e>>2]|0;i=f;return k|0}}else if((b|0)<0?(a=j,a=bF(c[a>>2]|0,c[a+4>>2]|0,-1,2147483647)|0,a=ZE(0,0,a|0,D|0)|0,d=D,k=g,k=bF(c[k>>2]|0,c[k+4>>2]|0,1,0)|0,b=D,(d|0)>(b|0)|(d|0)==(b|0)&a>>>0>k>>>0):0){c[e>>2]=1;k=c[e>>2]|0;i=f;return k|0}a=g;k=c[h>>2]|0;b=k;a=bF(c[b>>2]|0,c[b+4>>2]|0,c[a>>2]|0,c[a+4>>2]|0)|0;c[k>>2]=a;c[k+4>>2]=D;c[e>>2]=0;k=c[e>>2]|0;i=f;return k|0}function $m(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+32|0;g=e+16|0;h=e;f=e+12|0;k=e+8|0;c[g>>2]=a;j=h;c[j>>2]=b;c[j+4>>2]=d;c[k>>2]=pe(c[g>>2]|0)|0;b=h;j=c[b+4>>2]|0;a=c[(c[k>>2]|0)+88>>2]|0;d=((a|0)<0)<<31>>31;if((j|0)>(d|0)|((j|0)==(d|0)?(c[b>>2]|0)>>>0>a>>>0:0)){he(c[g>>2]|0);c[f>>2]=0;k=c[f>>2]|0;i=e;return k|0}k=h;c[f>>2]=gc(c[k>>2]|0,c[k+4>>2]|0)|0;if(c[f>>2]|0){k=c[f>>2]|0;i=e;return k|0}ie(c[g>>2]|0);k=c[f>>2]|0;i=e;return k|0}function an(a){a=a|0;var b=0,d=0,e=0;d=i;i=i+16|0;e=d+4|0;b=d;c[e>>2]=a;c[b>>2]=(c[(c[(c[e>>2]|0)+12>>2]|0)+4>>2]|0)+(((c[(c[e>>2]|0)+16>>2]|0)-1|0)*20|0);i=d;return c[(c[b>>2]|0)+16>>2]|0}function bn(a,b,d){a=a|0;b=b|0;d=d|0;var f=0,g=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;m=i;i=i+48|0;g=m+40|0;j=m+36|0;k=m+32|0;l=m+28|0;n=m+24|0;f=m+20|0;o=m+16|0;p=m+8|0;q=m;c[j>>2]=a;c[k>>2]=b;c[l>>2]=d;c[n>>2]=e[(c[j>>2]|0)+8>>1];c[f>>2]=e[(c[k>>2]|0)+8>>1];c[o>>2]=c[n>>2]|c[f>>2];a:do if(!(c[o>>2]&1)){if(!(c[o>>2]&12)){if(c[o>>2]&2){if(!(c[n>>2]&2)){c[g>>2]=1;break}if(!(c[f>>2]&2)){c[g>>2]=-1;break}if(c[l>>2]|0){c[g>>2]=cn(c[j>>2]|0,c[k>>2]|0,c[l>>2]|0,0)|0;break}}c[g>>2]=dn(c[j>>2]|0,c[k>>2]|0)|0;break}if(c[n>>2]&c[f>>2]&4){b=c[j>>2]|0;p=c[b+4>>2]|0;a=c[k>>2]|0;q=c[a+4>>2]|0;if((p|0)<(q|0)|((p|0)==(q|0)?(c[b>>2]|0)>>>0<(c[a>>2]|0)>>>0:0)){c[g>>2]=-1;break}b=c[j>>2]|0;p=c[b+4>>2]|0;a=c[k>>2]|0;q=c[a+4>>2]|0;if((p|0)>(q|0)|((p|0)==(q|0)?(c[b>>2]|0)>>>0>(c[a>>2]|0)>>>0:0)){c[g>>2]=1;break}else{c[g>>2]=0;break}}do if(!(c[n>>2]&8))if(c[n>>2]&4){a=c[j>>2]|0;h[p>>3]=+((c[a>>2]|0)>>>0)+4294967296.0*+(c[a+4>>2]|0);break}else{c[g>>2]=1;break a}else h[p>>3]=+h[c[j>>2]>>3];while(0);do if(!(c[f>>2]&8))if(c[f>>2]&4){a=c[k>>2]|0;h[q>>3]=+((c[a>>2]|0)>>>0)+4294967296.0*+(c[a+4>>2]|0);break}else{c[g>>2]=-1;break a}else h[q>>3]=+h[c[k>>2]>>3];while(0);if(+h[p>>3]<+h[q>>3]){c[g>>2]=-1;break}if(+h[p>>3]>+h[q>>3]){c[g>>2]=1;break}else{c[g>>2]=0;break}}else c[g>>2]=(c[f>>2]&1)-(c[n>>2]&1);while(0);i=m;return c[g>>2]|0}function cn(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;o=i;i=i+128|0;n=o+116|0;u=o+112|0;t=o+108|0;k=o+104|0;m=o+100|0;l=o+96|0;p=o+92|0;q=o+88|0;j=o+84|0;h=o+80|0;r=o+40|0;s=o;c[u>>2]=b;c[t>>2]=e;c[k>>2]=f;c[m>>2]=g;if((d[(c[u>>2]|0)+10>>0]|0|0)==(d[(c[k>>2]|0)+4>>0]|0|0)){c[n>>2]=Ab[c[(c[k>>2]|0)+12>>2]&15](c[(c[k>>2]|0)+8>>2]|0,c[(c[u>>2]|0)+12>>2]|0,c[(c[u>>2]|0)+16>>2]|0,c[(c[t>>2]|0)+12>>2]|0,c[(c[t>>2]|0)+16>>2]|0)|0;b=c[n>>2]|0;i=o;return b|0}en(r,c[(c[u>>2]|0)+32>>2]|0,1);en(s,c[(c[u>>2]|0)+32>>2]|0,1);fn(r,c[u>>2]|0,4096);fn(s,c[t>>2]|0,4096);c[p>>2]=Md(r,a[(c[k>>2]|0)+4>>0]|0)|0;if(!(c[p>>2]|0))g=0;else g=c[r+12>>2]|0;c[j>>2]=g;c[q>>2]=Md(s,a[(c[k>>2]|0)+4>>0]|0)|0;if(!(c[q>>2]|0))g=0;else g=c[s+12>>2]|0;c[h>>2]=g;c[l>>2]=Ab[c[(c[k>>2]|0)+12>>2]&15](c[(c[k>>2]|0)+8>>2]|0,c[j>>2]|0,c[p>>2]|0,c[h>>2]|0,c[q>>2]|0)|0;Bd(r);Bd(s);if(((c[p>>2]|0)==0|(c[q>>2]|0)==0)&(c[m>>2]|0)!=0)a[c[m>>2]>>0]=7;c[n>>2]=c[l>>2];b=c[n>>2]|0;i=o;return b|0}function dn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;f=i;i=i+16|0;e=f+12|0;g=f+8|0;h=f+4|0;d=f;c[g>>2]=a;c[h>>2]=b;if((c[(c[g>>2]|0)+12>>2]|0)>(c[(c[h>>2]|0)+12>>2]|0))b=c[(c[h>>2]|0)+12>>2]|0;else b=c[(c[g>>2]|0)+12>>2]|0;c[d>>2]=TE(c[(c[g>>2]|0)+16>>2]|0,c[(c[h>>2]|0)+16>>2]|0,b)|0;if(c[d>>2]|0){c[e>>2]=c[d>>2];a=c[e>>2]|0;i=f;return a|0}else{c[e>>2]=(c[(c[g>>2]|0)+12>>2]|0)-(c[(c[h>>2]|0)+12>>2]|0);a=c[e>>2]|0;i=f;return a|0}return 0}function en(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0;f=i;i=i+16|0;g=f+4|0;h=f;j=f+8|0;c[g>>2]=a;c[h>>2]=d;b[j>>1]=e;b[(c[g>>2]|0)+8>>1]=b[j>>1]|0;c[(c[g>>2]|0)+32>>2]=c[h>>2];c[(c[g>>2]|0)+24>>2]=0;i=f;return}function fn(a,d,f){a=a|0;d=d|0;f=f|0;var g=0,h=0,j=0,k=0;g=i;i=i+16|0;h=g+8|0;k=g+4|0;j=g;c[h>>2]=a;c[k>>2]=d;c[j>>2]=f;if((e[(c[h>>2]|0)+8>>1]|0)&9312)gn(c[h>>2]|0);a=c[h>>2]|0;d=c[k>>2]|0;c[a+0>>2]=c[d+0>>2];c[a+4>>2]=c[d+4>>2];c[a+8>>2]=c[d+8>>2];c[a+12>>2]=c[d+12>>2];c[a+16>>2]=c[d+16>>2];if((e[(c[k>>2]|0)+8>>1]|0)&2048){i=g;return}a=(c[h>>2]|0)+8|0;b[a>>1]=(e[a>>1]|0)&-7169;a=(c[h>>2]|0)+8|0;b[a>>1]=e[a>>1]|0|c[j>>2];i=g;return}function gn(a){a=a|0;var d=0,f=0,g=0,h=0;f=i;i=i+16|0;d=f+4|0;g=f;c[d>>2]=a;if((e[(c[d>>2]|0)+8>>1]|0)&8192)hn(c[d>>2]|0,c[c[d>>2]>>2]|0)|0;a=c[d>>2]|0;do if(!((e[(c[d>>2]|0)+8>>1]|0)&1024)){h=c[d>>2]|0;if((e[a+8>>1]|0)&32){jn(c[h>>2]|0);break}if((e[h+8>>1]|0)&64){c[g>>2]=c[c[d>>2]>>2];c[(c[g>>2]|0)+4>>2]=c[(c[c[g>>2]>>2]|0)+180>>2];c[(c[c[g>>2]>>2]|0)+180>>2]=c[g>>2]}}else rb[c[a+36>>2]&31](c[(c[d>>2]|0)+16>>2]|0);while(0);b[(c[d>>2]|0)+8>>1]=1;i=f;return}function hn(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;g=i;i=i+80|0;j=g+76|0;k=g+72|0;f=g+68|0;e=g+40|0;h=g;c[j>>2]=a;c[k>>2]=d;c[f>>2]=0;if(!(c[k>>2]|0)){a=c[f>>2]|0;i=g;return a|0}if(!(c[(c[k>>2]|0)+20>>2]|0)){a=c[f>>2]|0;i=g;return a|0}c[e+0>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0;c[e+16>>2]=0;c[e+20>>2]=0;c[e+24>>2]=0;a=h+0|0;d=a+40|0;do{c[a>>2]=0;a=a+4|0}while((a|0)<(d|0));b[h+8>>1]=1;c[h+32>>2]=c[(c[j>>2]|0)+32>>2];c[e>>2]=h;c[e+8>>2]=c[j>>2];c[e+4>>2]=c[k>>2];rb[c[(c[k>>2]|0)+20>>2]&31](e);if((c[(c[j>>2]|0)+24>>2]|0)>0)Xb(c[(c[j>>2]|0)+32>>2]|0,c[(c[j>>2]|0)+20>>2]|0);a=(c[j>>2]|0)+0|0;h=h+0|0;d=a+40|0;do{c[a>>2]=c[h>>2];a=a+4|0;h=h+4|0}while((a|0)<(d|0));c[f>>2]=c[e+20>>2];a=c[f>>2]|0;i=g;return a|0}function jn(a){a=a|0;var d=0,e=0,f=0,g=0;e=i;i=i+16|0;d=e+8|0;f=e+4|0;g=e;c[d>>2]=a;c[f>>2]=c[c[d>>2]>>2];while(1){if(!(c[f>>2]|0))break;c[g>>2]=c[c[f>>2]>>2];Xb(c[(c[d>>2]|0)+4>>2]|0,c[f>>2]|0);c[f>>2]=c[g>>2]}c[c[d>>2]>>2]=0;b[(c[d>>2]|0)+24>>1]=0;c[(c[d>>2]|0)+8>>2]=0;c[(c[d>>2]|0)+12>>2]=0;c[(c[d>>2]|0)+20>>2]=0;b[(c[d>>2]|0)+26>>1]=1;i=e;return}function kn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+32|0;k=f+24|0;j=f+20|0;h=f+16|0;g=f;c[k>>2]=a;c[j>>2]=b;c[h>>2]=d;c[g>>2]=e;oc(c[k>>2]|0,c[j>>2]|0,c[h>>2]|0,g);i=f;return}function ln(b){b=b|0;var d=0,e=0;d=i;i=i+16|0;e=d;c[e>>2]=b;a[(c[e>>2]|0)+24>>0]=1;i=d;return}function mn(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;c[d>>2]=zb[c[e>>2]&63](1612,0)|0;if(!(c[d>>2]|0)){e=c[d>>2]|0;i=b;return e|0}c[c[d>>2]>>2]=-1;e=c[d>>2]|0;i=b;return e|0}function nn(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;h=i;i=i+48|0;l=h+32|0;p=h+28|0;n=h+24|0;o=h+20|0;k=h+8|0;j=h+4|0;m=h;c[p>>2]=d;c[n>>2]=e;c[o>>2]=g;c[m>>2]=c[p>>2];if((c[c[m>>2]>>2]|0)<0){c[c[m>>2]>>2]=0;c[(c[m>>2]|0)+4>>2]=-1;b[(c[m>>2]|0)+12>>1]=0;a[(c[m>>2]|0)+14>>0]=0}c[k+0>>2]=c[f+0>>2];c[k+4>>2]=c[f+4>>2];c[(c[m>>2]|0)+8>>2]=c[o>>2];while(1){c[j>>2]=Cn(c[m>>2]|0,c[n>>2]&255)|0;do if((c[j>>2]|0)>=642){f=c[m>>2]|0;if((c[j>>2]|0)<969){En(f,(c[j>>2]|0)-642|0);break}else{p=c[n>>2]|0;c[l+0>>2]=c[k+0>>2];c[l+4>>2]=c[k+4>>2];c[l+8>>2]=c[k+8>>2];Fn(f,p,l);An(c[m>>2]|0,c[n>>2]&255,k);c[n>>2]=254;break}}else{Dn(c[m>>2]|0,c[j>>2]|0,c[n>>2]|0,k);p=(c[m>>2]|0)+4|0;c[p>>2]=(c[p>>2]|0)+ -1;c[n>>2]=254}while(0);if((c[n>>2]|0)==254){j=11;break}if((c[c[m>>2]>>2]|0)<0){j=11;break}}if((j|0)==11){i=h;return}}function on(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;g=d+8|0;e=d+4|0;f=d;c[g>>2]=a;c[e>>2]=b;c[f>>2]=c[g>>2];if(!(c[f>>2]|0)){i=d;return}while(1){if((c[c[f>>2]>>2]|0)<0)break;zn(c[f>>2]|0)|0}rb[c[e>>2]&31](c[f>>2]|0);i=d;return}function pn(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+48|0;g=f+32|0;j=f+28|0;l=f+24|0;k=f+8|0;h=f;c[g>>2]=a;c[j>>2]=b;c[l>>2]=d;c[k>>2]=e;c[h>>2]=yn(c[j>>2]|0,c[l>>2]|0,k)|0;Xb(c[j>>2]|0,c[c[g>>2]>>2]|0);c[c[g>>2]>>2]=c[h>>2];i=f;return}function qn(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;d=b+4|0;e=b;c[d>>2]=a;if(!(c[d>>2]|0)){i=b;return}c[e>>2]=c[c[d>>2]>>2];Wb(c[e>>2]|0,c[d>>2]|0);a=c[(c[d>>2]|0)+52>>2]|0;if(c[(c[d>>2]|0)+48>>2]|0)c[(c[(c[d>>2]|0)+48>>2]|0)+52>>2]=a;else c[(c[e>>2]|0)+4>>2]=a;if(c[(c[d>>2]|0)+52>>2]|0)c[(c[(c[d>>2]|0)+52>>2]|0)+48>>2]=c[(c[d>>2]|0)+48>>2];c[(c[d>>2]|0)+40>>2]=-1241070648;c[c[d>>2]>>2]=0;Xb(c[e>>2]|0,c[d>>2]|0);i=b;return}function rn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){i=d;return}c[g>>2]=0;while(1){if((c[g>>2]|0)>=(c[c[f>>2]>>2]|0))break;c[h>>2]=(c[f>>2]|0)+8+(c[g>>2]<<4);sn(c[e>>2]|0,c[(c[h>>2]|0)+4>>2]|0);tn(c[e>>2]|0,c[(c[h>>2]|0)+8>>2]|0);Xb(c[e>>2]|0,c[c[h>>2]>>2]|0);c[g>>2]=(c[g>>2]|0)+1}Xb(c[e>>2]|0,c[f>>2]|0);i=d;return}function sn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;f=d+12|0;e=d+8|0;g=d+4|0;h=d;c[f>>2]=a;c[e>>2]=b;if(!(c[e>>2]|0)){i=d;return}c[h>>2]=c[(c[e>>2]|0)+4>>2];c[g>>2]=0;while(1){b=c[f>>2]|0;if((c[g>>2]|0)>=(c[c[e>>2]>>2]|0))break;wn(b,c[c[h>>2]>>2]|0);Xb(c[f>>2]|0,c[(c[h>>2]|0)+4>>2]|0);Xb(c[f>>2]|0,c[(c[h>>2]|0)+8>>2]|0);c[g>>2]=(c[g>>2]|0)+1;c[h>>2]=(c[h>>2]|0)+20}Xb(b,c[(c[e>>2]|0)+4>>2]|0);Xb(c[f>>2]|0,c[e>>2]|0);i=d;return}function tn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){i=d;return}un(c[e>>2]|0,c[f>>2]|0);Xb(c[e>>2]|0,c[f>>2]|0);i=d;return}function un(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;sn(c[f>>2]|0,c[c[e>>2]>>2]|0);vn(c[f>>2]|0,c[(c[e>>2]|0)+32>>2]|0);wn(c[f>>2]|0,c[(c[e>>2]|0)+36>>2]|0);sn(c[f>>2]|0,c[(c[e>>2]|0)+40>>2]|0);wn(c[f>>2]|0,c[(c[e>>2]|0)+44>>2]|0);sn(c[f>>2]|0,c[(c[e>>2]|0)+48>>2]|0);tn(c[f>>2]|0,c[(c[e>>2]|0)+52>>2]|0);wn(c[f>>2]|0,c[(c[e>>2]|0)+60>>2]|0);wn(c[f>>2]|0,c[(c[e>>2]|0)+64>>2]|0);rn(c[f>>2]|0,c[(c[e>>2]|0)+68>>2]|0);i=d;return}function vn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;f=d+12|0;e=d+8|0;g=d+4|0;h=d;c[f>>2]=a;c[e>>2]=b;if(!(c[e>>2]|0)){i=d;return}c[h>>2]=(c[e>>2]|0)+8;c[g>>2]=0;while(1){b=c[f>>2]|0;if((c[g>>2]|0)>=(c[c[e>>2]>>2]|0))break;Xb(b,c[(c[h>>2]|0)+4>>2]|0);Xb(c[f>>2]|0,c[(c[h>>2]|0)+8>>2]|0);Xb(c[f>>2]|0,c[(c[h>>2]|0)+12>>2]|0);Xb(c[f>>2]|0,c[(c[h>>2]|0)+64>>2]|0);Vb(c[f>>2]|0,c[(c[h>>2]|0)+16>>2]|0);tn(c[f>>2]|0,c[(c[h>>2]|0)+20>>2]|0);wn(c[f>>2]|0,c[(c[h>>2]|0)+44>>2]|0);xn(c[f>>2]|0,c[(c[h>>2]|0)+48>>2]|0);c[g>>2]=(c[g>>2]|0)+1;c[h>>2]=(c[h>>2]|0)+72}Xb(b,c[e>>2]|0);i=d;return}function wn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){i=d;return}do if(!(c[(c[f>>2]|0)+4>>2]&16384)){wn(c[e>>2]|0,c[(c[f>>2]|0)+12>>2]|0);wn(c[e>>2]|0,c[(c[f>>2]|0)+16>>2]|0);if(c[(c[f>>2]|0)+4>>2]&65536)Xb(c[e>>2]|0,c[(c[f>>2]|0)+8>>2]|0);a=c[e>>2]|0;b=(c[f>>2]|0)+20|0;if(c[(c[f>>2]|0)+4>>2]&2048){tn(a,c[b>>2]|0);break}else{sn(a,c[b>>2]|0);break}}while(0);if(c[(c[f>>2]|0)+4>>2]&32768){i=d;return}Xb(c[e>>2]|0,c[f>>2]|0);i=d;return}function xn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;f=d+8|0;e=d+4|0;g=d;c[f>>2]=a;c[e>>2]=b;if(!(c[e>>2]|0)){i=d;return}c[g>>2]=0;while(1){b=c[f>>2]|0;if((c[g>>2]|0)>=(c[(c[e>>2]|0)+4>>2]|0))break;Xb(b,c[(c[c[e>>2]>>2]|0)+(c[g>>2]<<3)>>2]|0);c[g>>2]=(c[g>>2]|0)+1}Xb(b,c[c[e>>2]>>2]|0);Xb(c[f>>2]|0,c[e>>2]|0);i=d;return}function yn(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+128|0;j=g+40|0;m=g+36|0;l=g+32|0;h=g+28|0;k=g;c[j>>2]=b;c[m>>2]=e;c[l>>2]=f;nc(k,g+44|0,70,c[(c[j>>2]|0)+88>>2]|0);c[k>>2]=c[j>>2];oc(k,1,c[m>>2]|0,c[l>>2]|0);c[h>>2]=pc(k)|0;if((d[k+25>>0]|0|0)!=1){m=c[h>>2]|0;i=g;return m|0}a[(c[j>>2]|0)+64>>0]=1;m=c[h>>2]|0;i=g;return m|0}function zn(b){b=b|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;f=e+8|0;h=e+4|0;g=e+12|0;j=e;c[h>>2]=b;c[j>>2]=(c[h>>2]|0)+12+(c[c[h>>2]>>2]<<4);if((c[c[h>>2]>>2]|0)<0){c[f>>2]=0;j=c[f>>2]|0;i=e;return j|0}else{a[g>>0]=a[(c[j>>2]|0)+2>>0]|0;An(c[h>>2]|0,a[g>>0]|0,(c[j>>2]|0)+4|0);j=c[h>>2]|0;c[j>>2]=(c[j>>2]|0)+ -1;c[f>>2]=d[g>>0];j=c[f>>2]|0;i=e;return j|0}return 0}function An(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0;g=i;i=i+16|0;l=g+8|0;k=g+12|0;h=g+4|0;j=g;c[l>>2]=b;a[k>>0]=e;c[h>>2]=f;c[j>>2]=c[(c[l>>2]|0)+8>>2];do switch(d[k>>0]|0|0){case 228:case 221:case 220:case 210:case 209:case 208:case 205:case 203:case 200:case 188:case 179:{sn(c[c[j>>2]>>2]|0,c[c[h>>2]>>2]|0);i=g;return};case 213:case 212:case 201:case 194:{vn(c[c[j>>2]>>2]|0,c[c[h>>2]>>2]|0);i=g;return};case 175:case 174:{wn(c[c[j>>2]>>2]|0,c[c[h>>2]>>2]|0);i=g;return};case 239:case 234:{Bn(c[c[j>>2]>>2]|0,c[c[h>>2]>>2]|0);i=g;return};case 243:case 238:case 229:case 227:case 216:case 204:case 202:{wn(c[c[j>>2]>>2]|0,c[c[h>>2]>>2]|0);i=g;return};case 223:case 219:case 217:{xn(c[c[j>>2]>>2]|0,c[c[h>>2]>>2]|0);i=g;return};case 207:case 196:case 195:case 163:{tn(c[c[j>>2]>>2]|0,c[c[h>>2]>>2]|0);i=g;return};case 252:case 197:{rn(c[c[j>>2]>>2]|0,c[c[h>>2]>>2]|0);i=g;return};case 236:{xn(c[c[j>>2]>>2]|0,c[(c[h>>2]|0)+4>>2]|0);i=g;return};default:{i=g;return}}while(0)}function Bn(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;g=d+8|0;e=d+4|0;f=d;c[g>>2]=a;c[e>>2]=b;while(1){if(!(c[e>>2]|0))break;c[f>>2]=c[e>>2];c[e>>2]=c[(c[e>>2]|0)+32>>2];wn(c[g>>2]|0,c[(c[f>>2]|0)+20>>2]|0);sn(c[g>>2]|0,c[(c[f>>2]|0)+24>>2]|0);tn(c[g>>2]|0,c[(c[f>>2]|0)+8>>2]|0);xn(c[g>>2]|0,c[(c[f>>2]|0)+28>>2]|0);Xb(c[g>>2]|0,c[f>>2]|0)}i=d;return}function Cn(f,g){f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;k=i;i=i+32|0;j=k+16|0;l=k+12|0;n=k+21|0;h=k+8|0;p=k+4|0;m=k+20|0;o=k;c[l>>2]=f;a[n>>0]=g;c[p>>2]=e[(c[l>>2]|0)+12+(c[c[l>>2]>>2]<<4)>>1];if((c[p>>2]|0)<=429?(f=b[27208+(c[p>>2]<<1)>>1]|0,c[h>>2]=f,(f|0)!=-86):0){c[h>>2]=(c[h>>2]|0)+(d[n>>0]|0);if(!((c[h>>2]|0)<0|(c[h>>2]|0)>=1497)?(d[29360+(c[h>>2]|0)>>0]|0)==(d[n>>0]|0):0){c[j>>2]=e[11720+(c[h>>2]<<1)>>1];f=c[j>>2]|0;i=k;return f|0}if((d[n>>0]|0)>0){if((d[n>>0]|0)>>>0<70?(f=a[30864+(d[n>>0]|0)>>0]|0,a[m>>0]=f,(f&255|0)!=0):0){c[j>>2]=Cn(c[l>>2]|0,a[m>>0]|0)|0;f=c[j>>2]|0;i=k;return f|0}c[o>>2]=(c[h>>2]|0)-(d[n>>0]|0)+70;if((c[o>>2]|0)>=0?(d[29360+(c[o>>2]|0)>>0]|0)==70:0){c[j>>2]=e[11720+(c[o>>2]<<1)>>1];f=c[j>>2]|0;i=k;return f|0}}c[j>>2]=e[28072+(c[p>>2]<<1)>>1];f=c[j>>2]|0;i=k;return f|0}c[j>>2]=e[28072+(c[p>>2]<<1)>>1];f=c[j>>2]|0;i=k;return f|0}function Dn(d,e,f,g){d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0;m=i;i=i+32|0;n=m+16|0;h=m+12|0;l=m+8|0;j=m+4|0;k=m;c[n>>2]=d;c[h>>2]=e;c[l>>2]=f;c[j>>2]=g;g=c[n>>2]|0;c[g>>2]=(c[g>>2]|0)+1;g=c[n>>2]|0;if((c[c[n>>2]>>2]|0)>=100){wy(g,c[j>>2]|0);i=m;return}else{c[k>>2]=(c[n>>2]|0)+12+(c[g>>2]<<4);b[c[k>>2]>>1]=c[h>>2];a[(c[k>>2]|0)+2>>0]=c[l>>2];d=(c[k>>2]|0)+4|0;e=c[j>>2]|0;c[d+0>>2]=c[e+0>>2];c[d+4>>2]=c[e+4>>2];c[d+8>>2]=c[e+8>>2];i=m;return}}function En(f,g){f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0;n=i;i=i+224|0;r=n;p=n+220|0;o=n+216|0;m=n+212|0;l=n+208|0;h=n+196|0;j=n+192|0;k=n+188|0;q=n+184|0;W=n+172|0;J=n+160|0;u=n+140|0;v=n+136|0;A=n+132|0;z=n+128|0;y=n+124|0;x=n+120|0;w=n+116|0;K=n+112|0;L=n+104|0;B=n+100|0;C=n+96|0;E=n+92|0;F=n+88|0;D=n+84|0;H=n+80|0;I=n+76|0;G=n+72|0;N=n+68|0;M=n+64|0;P=n+60|0;R=n+56|0;Q=n+52|0;O=n+48|0;S=n+44|0;T=n+40|0;V=n+36|0;U=n+32|0;t=n+28|0;X=n+24|0;Y=n+20|0;Z=n+16|0;_=n+8|0;c[p>>2]=f;c[o>>2]=g;c[q>>2]=c[(c[p>>2]|0)+8>>2];c[j>>2]=(c[p>>2]|0)+12+(c[c[p>>2]>>2]<<4);c[h+0>>2]=c[6792];c[h+4>>2]=c[6793];c[h+8>>2]=c[6794];a:do switch(c[o>>2]|0){case 65:{Xn(c[q>>2]|0,0,(c[j>>2]|0)+ -32+4|0,c[(c[j>>2]|0)+ -16+4>>2]|0,c[(c[j>>2]|0)+4>>2]|0);break};case 117:case 115:case 16:case 15:case 14:{c[h>>2]=d[(c[j>>2]|0)+2>>0];break};case 222:case 219:case 107:case 84:case 69:case 30:case 29:{c[h>>2]=1;break};case 33:{Nn(c[q>>2]|0,0,0,0,c[(c[j>>2]|0)+4>>2]|0);tn(c[c[q>>2]>>2]|0,c[(c[j>>2]|0)+4>>2]|0);break};case 9:{In(c[q>>2]|0,c[(c[j>>2]|0)+ -16+4>>2]|0);break};case 221:case 218:case 108:case 97:case 85:case 83:case 81:case 68:case 31:case 28:{c[h>>2]=0;break};case 26:{Mn(c[q>>2]|0,(c[j>>2]|0)+ -16+4|0,(c[j>>2]|0)+4|0,c[(c[j>>2]|0)+ -64+4>>2]|0,0,0,c[(c[j>>2]|0)+ -32+4>>2]|0);break};case 23:{Ln(c[q>>2]|0,1,(c[j>>2]|0)+4|0);break};case 49:{c[h>>2]=c[(c[j>>2]|0)+ -16+4>>2];c[h+4>>2]=(c[(c[j>>2]|0)+8>>2]|0)+((c[(c[j>>2]|0)+4>>2]|0)-(c[(c[j>>2]|0)+ -16+4>>2]|0));break};case 94:{Vn(c[q>>2]|0,0,0,0,c[(c[j>>2]|0)+ -32+4>>2]|0,c[(c[j>>2]|0)+4>>2]|0,0,0,0,0)|0;break};case 95:{Wn(c[q>>2]|0,c[(c[j>>2]|0)+ -32+4>>2]|0);break};case 61:{Tn(c[q>>2]|0,c[(c[j>>2]|0)+4>>2]|0);break};case 66:{Yn(c[q>>2]|0,c[(c[j>>2]|0)+4>>2]|0);break};case 67:{Zn(c[q>>2]|0,(c[j>>2]|0)+4|0);break};case 70:{c[h>>2]=0;break};case 62:{Un(c[q>>2]|0,0,c[(c[j>>2]|0)+ -16+4>>2]|0,c[(c[j>>2]|0)+4>>2]|0,c[(c[j>>2]|0)+ -32+4>>2]|0);break};case 106:{_n(c[q>>2]|0,c[(c[j>>2]|0)+4>>2]|0,0,c[(c[j>>2]|0)+ -16+4>>2]|0);break};case 59:{Sn(J,c[q>>2]|0,97,(c[j>>2]|0)+4|0);Qn(c[q>>2]|0,J);break};case 87:{f=(c[j>>2]|0)+ -16+4|0;c[h+0>>2]=c[f+0>>2];c[h+4>>2]=c[f+4>>2];break};case 90:{c[(c[q>>2]|0)+324>>2]=0;break};case 76:{c[h>>2]=7;break};case 75:{c[h>>2]=c[(c[j>>2]|0)+4>>2]<<8;c[h+4>>2]=65280;break};case 77:{c[h>>2]=8;break};case 78:{c[h>>2]=9;break};case 79:{c[h>>2]=6;break};case 80:{c[h>>2]=0;break};case 73:case 72:{c[h>>2]=0;c[h+4>>2]=0;break};case 74:{c[h>>2]=c[(c[j>>2]|0)+4>>2];c[h+4>>2]=255;break};case 19:{Kn(c[q>>2]|0);break};case 8:{Hn(c[q>>2]|0);break};case 58:{c[W>>2]=Rn(c[q>>2]|0,157,c[(c[j>>2]|0)+4>>2]|0,0,0)|0;c[W+4>>2]=c[(c[j>>2]|0)+ -16+4>>2];c[W+8>>2]=c[(c[j>>2]|0)+12>>2];Qn(c[q>>2]|0,W);break};case 7:{Gn(c[q>>2]|0,2);break};case 13:{c[h>>2]=7;break};case 93:{Un(c[q>>2]|0,c[(c[j>>2]|0)+ -48+4>>2]|0,c[(c[j>>2]|0)+4>>2]|0,c[(c[j>>2]|0)+ -32+4>>2]|0,0);break};case 32:{Nn(c[q>>2]|0,(c[j>>2]|0)+ -32+4|0,(c[j>>2]|0)+ -16+4|0,a[(c[j>>2]|0)+4>>0]|0,0);break};case 110:{_n(c[q>>2]|0,c[(c[j>>2]|0)+4>>2]|0,1,c[(c[j>>2]|0)+ -16+4>>2]|0);break};case 111:{c[u+0>>2]=c[2508];c[u+4>>2]=c[2509];c[u+8>>2]=c[2510];c[u+12>>2]=c[2511];c[u+16>>2]=c[2512];ao(c[q>>2]|0,c[(c[j>>2]|0)+4>>2]|0,u)|0;tn(c[c[q>>2]>>2]|0,c[(c[j>>2]|0)+4>>2]|0);break};case 112:{c[v>>2]=c[(c[j>>2]|0)+4>>2];if(c[v>>2]|0){c[y>>2]=0;c[(c[v>>2]|0)+68>>2]=c[(c[j>>2]|0)+ -16+4>>2];if(c[(c[v>>2]|0)+52>>2]|0){c[A>>2]=0;c[z>>2]=c[v>>2];while(1){if(!(c[z>>2]|0))break;c[(c[z>>2]|0)+56>>2]=c[A>>2];f=(c[z>>2]|0)+6|0;b[f>>1]=e[f>>1]|64;c[A>>2]=c[z>>2];c[z>>2]=c[(c[z>>2]|0)+52>>2];c[y>>2]=(c[y>>2]|0)+1}c[x>>2]=c[(c[c[q>>2]>>2]|0)+104>>2];if((c[x>>2]|0)!=0?(c[y>>2]|0)>(c[x>>2]|0):0)Se(c[q>>2]|0,10056,r)}}else rn(c[c[q>>2]>>2]|0,c[(c[j>>2]|0)+ -16+4>>2]|0);c[h>>2]=c[v>>2];break};case 116:{c[h>>2]=116;break};case 27:{a[(c[c[q>>2]>>2]|0)+250>>0]=0;f=(c[j>>2]|0)+4|0;c[h+0>>2]=c[f+0>>2];c[h+4>>2]=c[f+4>>2];break};case 103:case 100:case 98:case 82:{c[h>>2]=c[(c[j>>2]|0)+4>>2];break};case 86:{c[h+4>>2]=0;c[h>>2]=0;break};case 46:{c[h>>2]=c[(c[j>>2]|0)+ -48+4>>2];c[h+4>>2]=(c[(c[j>>2]|0)+4>>2]|0)+(c[(c[j>>2]|0)+8>>2]|0)-(c[(c[j>>2]|0)+ -48+4>>2]|0);break};case 102:{a[h>>0]=c[(c[j>>2]|0)+4>>2];break};case 104:{c[h>>2]=4;break};case 105:{c[h>>2]=5;break};case 109:{$n(c[q>>2]|0,(c[j>>2]|0)+ -112+4|0,(c[j>>2]|0)+ -48+4|0,(c[j>>2]|0)+ -32+4|0,c[(c[j>>2]|0)+4>>2]|0,c[(c[j>>2]|0)+ -96+4>>2]|0,c[(c[j>>2]|0)+ -64+4>>2]|0);break};case 24:{Ln(c[q>>2]|0,2,(c[j>>2]|0)+4|0);break};case 118:{c[h>>2]=co(c[q>>2]|0,c[(c[j>>2]|0)+ -96+4>>2]|0,c[(c[j>>2]|0)+ -80+4>>2]|0,c[(c[j>>2]|0)+ -64+4>>2]|0,c[(c[j>>2]|0)+ -48+4>>2]|0,c[(c[j>>2]|0)+ -32+4>>2]|0,c[(c[j>>2]|0)+ -16+4>>2]|0,b[(c[j>>2]|0)+ -112+4>>1]|0,c[(c[j>>2]|0)+4>>2]|0,c[(c[j>>2]|0)+8>>2]|0)|0;break};case 120:{c[h>>2]=co(c[q>>2]|0,c[(c[j>>2]|0)+ -16+4>>2]|0,0,0,0,0,0,128,0,0)|0;break};case 133:{c[h>>2]=se(c[c[q>>2]>>2]|0,80,0)|0;break};case 134:{c[h>>2]=c[(c[j>>2]|0)+4>>2];io(c[h>>2]|0);break};case 135:{c[h>>2]=c[(c[j>>2]|0)+ -16+4>>2];if((c[h>>2]|0)!=0?(c[c[h>>2]>>2]|0)>0:0)a[(c[h>>2]|0)+8+(((c[c[h>>2]>>2]|0)-1|0)*72|0)+36>>0]=c[(c[j>>2]|0)+4>>2];break};case 121:{c[B>>2]=co(c[q>>2]|0,c[(c[j>>2]|0)+ -16+4>>2]|0,0,0,0,0,0,128,0,0)|0;if(c[B>>2]|0){a[(c[B>>2]|0)+4>>0]=116;c[(c[B>>2]|0)+52>>2]=c[(c[j>>2]|0)+ -64+4>>2];c[h>>2]=c[B>>2];break a}else{c[h>>2]=c[(c[j>>2]|0)+ -64+4>>2];break a}};case 63:{Vn(c[q>>2]|0,0,0,0,0,c[(c[j>>2]|0)+4>>2]|0,0,0,0,0)|0;break};case 39:{On(c[q>>2]|0,(c[j>>2]|0)+4|0);f=(c[j>>2]|0)+4|0;c[h+0>>2]=c[f+0>>2];c[h+4>>2]=c[f+4>>2];c[(c[q>>2]|0)+324>>2]=0;break};case 71:{c[h>>2]=c[(c[j>>2]|0)+ -16+4>>2]&~c[(c[j>>2]|0)+8>>2]|c[(c[j>>2]|0)+4>>2];break};case 92:case 54:{f=(c[q>>2]|0)+320|0;g=(c[j>>2]|0)+4|0;c[f+0>>2]=c[g+0>>2];c[f+4>>2]=c[g+4>>2];break};case 56:{Qn(c[q>>2]|0,(c[j>>2]|0)+ -16+4|0);break};case 57:case 55:{Qn(c[q>>2]|0,(c[j>>2]|0)+4|0);break};case 38:{c[h>>2]=c[(c[j>>2]|0)+ -32+4>>2];c[h+4>>2]=(c[(c[q>>2]|0)+504>>2]|0)-(c[(c[j>>2]|0)+ -32+4>>2]|0)+(c[(c[q>>2]|0)+508>>2]|0);break};case 99:{c[h>>2]=10;break};case 101:{a[h>>0]=10;break};case 96:{Xn(c[q>>2]|0,c[(c[j>>2]|0)+ -96+4>>2]|0,(c[j>>2]|0)+ -48+4|0,c[(c[j>>2]|0)+ -32+4>>2]|0,c[(c[j>>2]|0)+ -16+4>>2]|0);Yn(c[q>>2]|0,c[(c[j>>2]|0)+4>>2]|0);break};case 44:{Pn(c[q>>2]|0,(c[j>>2]|0)+4|0);break};case 122:{b[h>>1]=1;break};case 124:case 123:{b[h>>1]=0;break};case 243:case 125:{c[h>>2]=c[(c[j>>2]|0)+ -16+4>>2];break};case 242:case 236:case 161:case 154:case 126:{c[h>>2]=0;break};case 64:{Wn(c[q>>2]|0,c[(c[j>>2]|0)+ -16+4>>2]|0);break};case 127:{c[h>>2]=eo(c[q>>2]|0,c[(c[j>>2]|0)+ -32+4>>2]|0,c[(c[j>>2]|0)+ -16+4>>2]|0)|0;if((c[(c[j>>2]|0)+8>>2]|0)>>>0>0)fo(c[q>>2]|0,c[h>>2]|0,(c[j>>2]|0)+4|0,1);go(c[q>>2]|0,c[h>>2]|0,(c[j>>2]|0)+ -16+4|0);break};case 128:{c[C>>2]=ho(c[c[q>>2]>>2]|0,116,0)|0;c[h>>2]=eo(c[q>>2]|0,c[(c[j>>2]|0)+ -16+4>>2]|0,c[C>>2]|0)|0;break};case 132:{c[h+4>>2]=0;break};case 129:{c[E>>2]=Rn(c[q>>2]|0,116,0,0,(c[j>>2]|0)+4|0)|0;c[F>>2]=Rn(c[q>>2]|0,27,0,0,(c[j>>2]|0)+ -32+4|0)|0;c[D>>2]=Rn(c[q>>2]|0,122,c[F>>2]|0,c[E>>2]|0,0)|0;c[h>>2]=eo(c[q>>2]|0,c[(c[j>>2]|0)+ -48+4>>2]|0,c[D>>2]|0)|0;break};case 137:{c[h>>2]=bo(c[q>>2]|0,c[(c[j>>2]|0)+ -96+4>>2]|0,(c[j>>2]|0)+ -80+4|0,(c[j>>2]|0)+ -64+4|0,(c[j>>2]|0)+ -48+4|0,0,c[(c[j>>2]|0)+ -16+4>>2]|0,c[(c[j>>2]|0)+4>>2]|0)|0;jo(c[q>>2]|0,c[h>>2]|0,(c[j>>2]|0)+ -32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q>>2]>>2]|0,c[(c[j>>2]|0)+ -64+4>>2]|0);break};case 149:case 140:{c[h>>2]=0;c[h+4>>2]=0;break};case 144:{c[h>>2]=lo(c[q>>2]|0,(c[j>>2]|0)+ -16+4|0,0,0)|0;break};case 145:{c[h>>2]=lo(c[q>>2]|0,(c[j>>2]|0)+ -32+4|0,(c[j>>2]|0)+ -16+4|0,0)|0;break};case 146:{c[h>>2]=lo(c[q>>2]|0,(c[j>>2]|0)+ -48+4|0,(c[j>>2]|0)+ -32+4|0,(c[j>>2]|0)+ -16+4|0)|0;break};case 143:{c[h>>2]=1;break};case 142:{c[h>>2]=ko(c[c[q>>2]>>2]|0,0,(c[j>>2]|0)+ -16+4|0,(c[j>>2]|0)+4|0)|0;break};case 180:case 152:{c[h>>2]=c[(c[j>>2]|0)+ -16+4>>2];break};case 179:case 153:{c[h>>2]=0;break};case 235:case 162:case 155:{c[h>>2]=c[(c[j>>2]|0)+4>>2];break};case 156:{c[h>>2]=eo(c[q>>2]|0,c[(c[j>>2]|0)+ -48+4>>2]|0,c[(c[j>>2]|0)+ -16+4>>2]|0)|0;if(c[h>>2]|0)a[(c[(c[h>>2]|0)+4>>2]|0)+(((c[c[h>>2]>>2]|0)-1|0)*20|0)+12>>0]=c[(c[j>>2]|0)+4>>2];break};case 233:case 231:case 171:case 164:case 147:{c[h>>2]=c[(c[j>>2]|0)+4>>2];break};case 234:case 232:case 170:case 163:case 148:{c[h>>2]=0;break};case 151:{c[h>>2]=0;c[h+4>>2]=1;break};case 160:case 158:{c[h>>2]=0;break};case 159:{c[h>>2]=1;break};case 165:{c[h>>2]=0;c[h+4>>2]=0;break};case 166:{c[h>>2]=c[(c[j>>2]|0)+4>>2];c[h+4>>2]=0;break};case 167:{c[h>>2]=c[(c[j>>2]|0)+ -32+4>>2];c[h+4>>2]=c[(c[j>>2]|0)+4>>2];break};case 157:{c[h>>2]=eo(c[q>>2]|0,0,c[(c[j>>2]|0)+ -16+4>>2]|0)|0;if((c[h>>2]|0)!=0?(c[(c[h>>2]|0)+4>>2]|0)!=0:0)a[(c[(c[h>>2]|0)+4>>2]|0)+12>>0]=c[(c[j>>2]|0)+4>>2];break};case 181:{c[h>>2]=ro(c[c[q>>2]>>2]|0,c[(c[j>>2]|0)+ -32+4>>2]|0,(c[j>>2]|0)+4|0)|0;break};case 182:{c[h>>2]=ro(c[c[q>>2]>>2]|0,0,(c[j>>2]|0)+4|0)|0;break};case 183:{f=(c[j>>2]|0)+4|0;c[h+0>>2]=c[f+0>>2];c[h+4>>2]=c[f+4>>2];c[h+8>>2]=c[f+8>>2];break};case 168:{c[h+4>>2]=c[(c[j>>2]|0)+ -32+4>>2];c[h>>2]=c[(c[j>>2]|0)+4>>2];break};case 169:{mo(c[q>>2]|0,c[(c[j>>2]|0)+ -80+4>>2]|0,1);jo(c[q>>2]|0,c[(c[j>>2]|0)+ -32+4>>2]|0,(c[j>>2]|0)+ -16+4|0);no(c[q>>2]|0,c[(c[j>>2]|0)+ -32+4>>2]|0,c[(c[j>>2]|0)+4>>2]|0);break};case 279:case 263:case 262:case 261:case 260:case 259:case 258:case 257:case 256:case 247:case 150:case 141:case 131:case 130:case 48:case 45:case 42:case 41:case 40:{f=(c[j>>2]|0)+4|0;c[h+0>>2]=c[f+0>>2];c[h+4>>2]=c[f+4>>2];break};case 119:case 113:{c[h>>2]=c[(c[j>>2]|0)+4>>2];break};case 114:{c[w>>2]=c[(c[j>>2]|0)+4>>2];if((c[w>>2]|0)!=0?(c[(c[w>>2]|0)+52>>2]|0)!=0:0){c[L+4>>2]=0;c[K>>2]=bo(c[q>>2]|0,0,0,0,L,c[w>>2]|0,0,0)|0;c[w>>2]=co(c[q>>2]|0,0,c[K>>2]|0,0,0,0,0,0,0,0)|0}if(c[w>>2]|0){a[(c[w>>2]|0)+4>>0]=c[(c[j>>2]|0)+ -16+4>>2];c[(c[w>>2]|0)+52>>2]=c[(c[j>>2]|0)+ -32+4>>2];if((c[(c[j>>2]|0)+ -16+4>>2]|0)!=116)a[(c[q>>2]|0)+22>>0]=1}else tn(c[c[q>>2]>>2]|0,c[(c[j>>2]|0)+ -32+4>>2]|0);c[h>>2]=c[w>>2];break};case 47:{c[h>>2]=c[(c[j>>2]|0)+ -80+4>>2];c[h+4>>2]=(c[(c[j>>2]|0)+4>>2]|0)+(c[(c[j>>2]|0)+8>>2]|0)-(c[(c[j>>2]|0)+ -80+4>>2]|0);break};case 22:{Ln(c[q>>2]|0,0,(c[j>>2]|0)+4|0);break};case 34:{a[h>>0]=0;break};case 5:{Gn(c[q>>2]|0,0);break};case 18:case 17:{Jn(c[q>>2]|0);break};case 35:{if((c[(c[j>>2]|0)+8>>2]|0)==5?(Lb(c[(c[j>>2]|0)+4>>2]|0,9992,5)|0)==0:0){a[h>>0]=32;break a}a[h>>0]=0;f=c[q>>2]|0;g=c[(c[j>>2]|0)+4>>2]|0;c[r>>2]=c[(c[j>>2]|0)+8>>2];c[r+4>>2]=g;Se(f,1e4,r);break};case 6:{Gn(c[q>>2]|0,1);break};case 172:{mo(c[q>>2]|0,c[(c[j>>2]|0)+ -112+4>>2]|0,1);jo(c[q>>2]|0,c[(c[j>>2]|0)+ -64+4>>2]|0,(c[j>>2]|0)+ -48+4|0);oo(c[q>>2]|0,c[(c[j>>2]|0)+ -16+4>>2]|0,10096);po(c[q>>2]|0,c[(c[j>>2]|0)+ -64+4>>2]|0,c[(c[j>>2]|0)+ -16+4>>2]|0,c[(c[j>>2]|0)+4>>2]|0,d[(c[j>>2]|0)+ -80+4>>0]|0);break};case 173:{c[h>>2]=eo(c[q>>2]|0,c[(c[j>>2]|0)+ -64+4>>2]|0,c[(c[j>>2]|0)+4>>2]|0)|0;fo(c[q>>2]|0,c[h>>2]|0,(c[j>>2]|0)+ -32+4|0,1);break};case 174:{c[h>>2]=eo(c[q>>2]|0,0,c[(c[j>>2]|0)+4>>2]|0)|0;fo(c[q>>2]|0,c[h>>2]|0,(c[j>>2]|0)+ -32+4|0,1);break};case 175:{mo(c[q>>2]|0,c[(c[j>>2]|0)+ -80+4>>2]|0,1);qo(c[q>>2]|0,c[(c[j>>2]|0)+ -32+4>>2]|0,c[(c[j>>2]|0)+4>>2]|0,c[(c[j>>2]|0)+ -16+4>>2]|0,d[(c[j>>2]|0)+ -64+4>>0]|0);break};case 176:{mo(c[q>>2]|0,c[(c[j>>2]|0)+ -96+4>>2]|0,1);qo(c[q>>2]|0,c[(c[j>>2]|0)+ -48+4>>2]|0,0,c[(c[j>>2]|0)+ -32+4>>2]|0,d[(c[j>>2]|0)+ -80+4>>0]|0);break};case 177:{a[h>>0]=a[(c[j>>2]|0)+4>>0]|0;break};case 178:{a[h>>0]=5;break};case 184:{c[h>>2]=c[(c[j>>2]|0)+ -16+4>>2];so(h,(c[j>>2]|0)+ -32+4|0,(c[j>>2]|0)+4|0);break};case 191:case 190:case 185:{Sn(h,c[q>>2]|0,d[(c[j>>2]|0)+2>>0]|0,(c[j>>2]|0)+4|0);break};case 187:case 186:{Sn(h,c[q>>2]|0,27,(c[j>>2]|0)+4|0);break};case 188:{c[N>>2]=Rn(c[q>>2]|0,27,0,0,(c[j>>2]|0)+ -32+4|0)|0;c[M>>2]=Rn(c[q>>2]|0,27,0,0,(c[j>>2]|0)+4|0)|0;c[h>>2]=Rn(c[q>>2]|0,122,c[N>>2]|0,c[M>>2]|0,0)|0;so(h,(c[j>>2]|0)+ -32+4|0,(c[j>>2]|0)+4|0);break};case 189:{c[P>>2]=Rn(c[q>>2]|0,27,0,0,(c[j>>2]|0)+ -64+4|0)|0;c[R>>2]=Rn(c[q>>2]|0,27,0,0,(c[j>>2]|0)+ -32+4|0)|0;c[Q>>2]=Rn(c[q>>2]|0,27,0,0,(c[j>>2]|0)+4|0)|0;c[O>>2]=Rn(c[q>>2]|0,122,c[R>>2]|0,c[Q>>2]|0,0)|0;c[h>>2]=Rn(c[q>>2]|0,122,c[P>>2]|0,c[O>>2]|0,0)|0;so(h,(c[j>>2]|0)+ -64+4|0,(c[j>>2]|0)+4|0);break};case 192:{do if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;c[f>>2]=c[f>>2]|16}break};case 196:{c[h>>2]=vo(c[q>>2]|0,0,(c[j>>2]|0)+ -48+4|0)|0;so(h,(c[j>>2]|0)+ -48+4|0,(c[j>>2]|0)+4|0);break};case 197:{c[h>>2]=vo(c[q>>2]|0,0,(c[j>>2]|0)+4|0)|0;so(h,(c[j>>2]|0)+4|0,(c[j>>2]|0)+4|0);break};case 205:case 204:case 203:case 202:case 201:case 200:case 199:case 198:{wo(h,c[q>>2]|0,d[(c[j>>2]|0)+ -16+2>>0]|0,(c[j>>2]|0)+ -32+4|0,(c[j>>2]|0)+4|0);break};case 206:{f=(c[j>>2]|0)+4|0;c[h+0>>2]=c[f+0>>2];c[h+4>>2]=c[f+4>>2];c[h+8>>2]=0;break};case 207:{f=(c[j>>2]|0)+4|0;c[h+0>>2]=c[f+0>>2];c[h+4>>2]=c[f+4>>2];c[h+8>>2]=1;break};case 208:{c[S>>2]=eo(c[q>>2]|0,0,c[(c[j>>2]|0)+4>>2]|0)|0;c[S>>2]=eo(c[q>>2]|0,c[S>>2]|0,c[(c[j>>2]|0)+ -32+4>>2]|0)|0;c[h>>2]=vo(c[q>>2]|0,c[S>>2]|0,(c[j>>2]|0)+ -16+4|0)|0;if(c[(c[j>>2]|0)+ -16+12>>2]|0)c[h>>2]=Rn(c[q>>2]|0,19,c[h>>2]|0,0,0)|0;c[h+4>>2]=c[(c[j>>2]|0)+ -32+8>>2];c[h+8>>2]=c[(c[j>>2]|0)+12>>2];if(c[h>>2]|0){f=(c[h>>2]|0)+4|0;c[f>>2]=c[f>>2]|128}break};case 209:{c[T>>2]=eo(c[q>>2]|0,0,c[(c[j>>2]|0)+ -32+4>>2]|0)|0;c[T>>2]=eo(c[q>>2]|0,c[T>>2]|0,c[(c[j>>2]|0)+ -64+4>>2]|0)|0;c[T>>2]=eo(c[q>>2]|0,c[T>>2]|0,c[(c[j>>2]|0)+4>>2]|0)|0;c[h>>2]=vo(c[q>>2]|0,c[T>>2]|0,(c[j>>2]|0)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c[(c[j>>2]|0)+8>>2]|0);break};case 210:{xo(h,c[q>>2]|0,d[(c[j>>2]|0)+2>>0]|0,(c[j>>2]|0)+ -16+4|0,(c[j>>2]|0)+4|0);break};case 211:{xo(h,c[q>>2]|0,77,(c[j>>2]|0)+ -32+4|0,(c[j>>2]|0)+4|0);break};case 212:{wo(h,c[q>>2]|0,73,(c[j>>2]|0)+ -32+4|0,(c[j>>2]|0)+4|0);yo(c[q>>2]|0,c[(c[j>>2]|0)+4>>2]|0,c[h>>2]|0,76);break};case 213:{wo(h,c[q>>2]|0,148,(c[j>>2]|0)+ -48+4|0,(c[j>>2]|0)+4|0);yo(c[q>>2]|0,c[(c[j>>2]|0)+4>>2]|0,c[h>>2]|0,77);break};case 215:case 214:{zo(h,c[q>>2]|0,d[(c[j>>2]|0)+ -16+2>>0]|0,(c[j>>2]|0)+4|0,(c[j>>2]|0)+ -16+4|0);break};case 216:{zo(h,c[q>>2]|0,157,(c[j>>2]|0)+4|0,(c[j>>2]|0)+ -16+4|0);break};case 217:{zo(h,c[q>>2]|0,158,(c[j>>2]|0)+4|0,(c[j>>2]|0)+ -16+4|0);break};case 220:{c[V>>2]=eo(c[q>>2]|0,0,c[(c[j>>2]|0)+ -32+4>>2]|0)|0;c[V>>2]=eo(c[q>>2]|0,c[V>>2]|0,c[(c[j>>2]|0)+4>>2]|0)|0;c[h>>2]=Rn(c[q>>2]|0,74,c[(c[j>>2]|0)+ -64+4>>2]|0,0,0)|0;if(c[h>>2]|0)c[(c[h>>2]|0)+20>>2]=c[V>>2];else sn(c[c[q>>2]>>2]|0,c[V>>2]|0);if(c[(c[j>>2]|0)+ -48+4>>2]|0)c[h>>2]=Rn(c[q>>2]|0,19,c[h>>2]|0,0,0)|0;c[h+4>>2]=c[(c[j>>2]|0)+ -64+8>>2];c[h+8>>2]=c[(c[j>>2]|0)+12>>2];break};case 224:{c[h>>2]=Rn(c[q>>2]|0,119,0,0,0)|0;if(c[h>>2]|0){c[(c[h>>2]|0)+20>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]|0,c[h>>2]|0,c[(c[j>>2]|0)+4>>2]|0)|0;break};case 230:{c[h>>2]=eo(c[q>>2]|0,0,c[(c[j>>2]|0)+ -32+4>>2]|0)|0;c[h>>2]=eo(c[q>>2]|0,c[h>>2]|0,c[(c[j>>2]|0)+4>>2]|0)|0;break};case 237:{c[h>>2]=eo(c[q>>2]|0,c[(c[j>>2]|0)+ -32+4>>2]|0,c[(c[j>>2]|0)+4>>2]|0)|0;break};case 248:{Bo(c[q>>2]|0,c[(c[j>>2]|0)+4>>2]|0,c[(c[j>>2]|0)+ -16+4>>2]|0);break};case 250:case 249:{Co(c[q>>2]|0);break};case 251:{Do(c[q>>2]|0,(c[j>>2]|0)+ -16+4|0,(c[j>>2]|0)+4|0,0,0);break};case 252:{Do(c[q>>2]|0,(c[j>>2]|0)+ -48+4|0,(c[j>>2]|0)+ -32+4|0,(c[j>>2]|0)+4|0,0);break};case 291:case 240:{c[h>>2]=2;break};case 241:{c[h>>2]=0;break};case 239:{Vn(c[q>>2]|0,(c[j>>2]|0)+ -112+4|0,(c[j>>2]|0)+ -96+4|0,ko(c[c[q>>2]>>2]|0,0,(c[j>>2]|0)+ -64+4|0,0)|0,c[(c[j>>2]|0)+ -32+4>>2]|0,c[(c[j>>2]|0)+ -160+4>>2]|0,(c[j>>2]|0)+ -176+4|0,c[(c[j>>2]|0)+4>>2]|0,0,c[(c[j>>2]|0)+ -128+4>>2]|0)|0;break};case 244:{c[Y>>2]=uo(c[q>>2]|0,0,(c[j>>2]|0)+ -16+4|0)|0;c[h>>2]=eo(c[q>>2]|0,c[(c[j>>2]|0)+ -64+4>>2]|0,c[Y>>2]|0)|0;fo(c[q>>2]|0,c[h>>2]|0,(c[j>>2]|0)+ -32+4|0,1);oo(c[q>>2]|0,c[h>>2]|0,10168);if(c[h>>2]|0)a[(c[(c[h>>2]|0)+4>>2]|0)+(((c[c[h>>2]>>2]|0)-1|0)*20|0)+12>>0]=c[(c[j>>2]|0)+4>>2];break};case 245:{c[Z>>2]=uo(c[q>>2]|0,0,(c[j>>2]|0)+ -16+4|0)|0;c[h>>2]=eo(c[q>>2]|0,0,c[Z>>2]|0)|0;fo(c[q>>2]|0,c[h>>2]|0,(c[j>>2]|0)+ -32+4|0,1);oo(c[q>>2]|0,c[h>>2]|0,10168);if(c[h>>2]|0)a[(c[(c[h>>2]|0)+4>>2]|0)+(((c[c[h>>2]>>2]|0)-1|0)*20|0)+12>>0]=c[(c[j>>2]|0)+4>>2];break};case 246:{c[h>>2]=0;c[h+4>>2]=0;break};case 271:case 270:{c[h>>2]=d[(c[j>>2]|0)+2>>0];c[h+4>>2]=0;break};case 296:case 275:{c[h>>2]=0;break};case 272:{c[h>>2]=110;c[h+4>>2]=c[(c[j>>2]|0)+4>>2];break};case 297:case 276:{c[h>>2]=c[(c[j>>2]|0)+4>>2];break};case 253:{Do(c[q>>2]|0,(c[j>>2]|0)+ -64+4|0,(c[j>>2]|0)+ -48+4|0,(c[j>>2]|0)+ -16+4|0,0);break};case 254:{Do(c[q>>2]|0,(c[j>>2]|0)+ -48+4|0,(c[j>>2]|0)+ -32+4|0,(c[j>>2]|0)+4|0,1);break};case 255:{Do(c[q>>2]|0,(c[j>>2]|0)+ -64+4|0,(c[j>>2]|0)+ -48+4|0,(c[j>>2]|0)+ -16+4|0,1);break};case 264:{c[_>>2]=c[(c[j>>2]|0)+ -48+4>>2];c[_+4>>2]=(c[(c[j>>2]|0)+4>>2]|0)-(c[(c[j>>2]|0)+ -48+4>>2]|0)+(c[(c[j>>2]|0)+8>>2]|0);Eo(c[q>>2]|0,c[(c[j>>2]|0)+ -16+4>>2]|0,_);break};case 265:{Fo(c[q>>2]|0,(c[j>>2]|0)+ -112+4|0,(c[j>>2]|0)+ -96+4|0,c[(c[j>>2]|0)+ -80+4>>2]|0,c[(c[j>>2]|0)+ -64+4>>2]|0,c[(c[j>>2]|0)+ -64+8>>2]|0,c[(c[j>>2]|0)+ -32+4>>2]|0,c[(c[j>>2]|0)+4>>2]|0,c[(c[j>>2]|0)+ -160+4>>2]|0,c[(c[j>>2]|0)+ -128+4>>2]|0);q=c[j>>2]|0;if(!(c[(c[j>>2]|0)+ -96+8>>2]|0)){f=q+ -112+4|0;c[h+0>>2]=c[f+0>>2];c[h+4>>2]=c[f+4>>2];break a}else{f=q+ -96+4|0;c[h+0>>2]=c[f+0>>2];c[h+4>>2]=c[f+4>>2];break a}};case 269:case 266:{c[h>>2]=35;break};case 267:{c[h>>2]=31;break};case 268:{c[h>>2]=49;break};case 283:{Se(c[q>>2]|0,10360,r);break};case 284:{c[h>>2]=Go(c[c[q>>2]>>2]|0,(c[j>>2]|0)+ -64+4|0,c[(c[j>>2]|0)+ -16+4>>2]|0,c[(c[j>>2]|0)+4>>2]|0,a[(c[j>>2]|0)+ -80+4>>0]|0)|0;break};case 277:{c[(c[(c[(c[j>>2]|0)+ -32+4>>2]|0)+36>>2]|0)+32>>2]=c[(c[j>>2]|0)+ -16+4>>2];c[(c[(c[j>>2]|0)+ -32+4>>2]|0)+36>>2]=c[(c[j>>2]|0)+ -16+4>>2];c[h>>2]=c[(c[j>>2]|0)+ -32+4>>2];break};case 278:{c[(c[(c[j>>2]|0)+ -16+4>>2]|0)+36>>2]=c[(c[j>>2]|0)+ -16+4>>2];c[h>>2]=c[(c[j>>2]|0)+ -16+4>>2];break};case 282:{Se(c[q>>2]|0,10272,r);break};case 280:{f=(c[j>>2]|0)+4|0;c[h+0>>2]=c[f+0>>2];c[h+4>>2]=c[f+4>>2];Se(c[q>>2]|0,10176,r);break};case 287:{c[h>>2]=Jo(c[c[q>>2]>>2]|0,c[(c[j>>2]|0)+4>>2]|0)|0;break};case 288:{c[h>>2]=Rn(c[q>>2]|0,57,0,0,0)|0;if(c[h>>2]|0)a[(c[h>>2]|0)+1>>0]=4;c[h+4>>2]=c[(c[j>>2]|0)+ -48+4>>2];c[h+8>>2]=(c[(c[j>>2]|0)+4>>2]|0)+(c[(c[j>>2]|0)+8>>2]|0);break};case 285:{c[h>>2]=Ho(c[c[q>>2]>>2]|0,(c[j>>2]|0)+ -32+4|0,c[(c[j>>2]|0)+ -16+4>>2]|0,c[(c[j>>2]|0)+4>>2]|0,a[(c[j>>2]|0)+ -64+4>>0]|0)|0;break};case 286:{c[h>>2]=Io(c[c[q>>2]>>2]|0,(c[j>>2]|0)+ -32+4|0,c[(c[j>>2]|0)+4>>2]|0)|0;break};case 293:{Ko(c[q>>2]|0,c[(c[j>>2]|0)+4>>2]|0,c[(c[j>>2]|0)+ -16+4>>2]|0);break};case 294:{Lo(c[q>>2]|0,c[(c[j>>2]|0)+ -48+4>>2]|0,c[(c[j>>2]|0)+ -16+4>>2]|0,c[(c[j>>2]|0)+4>>2]|0);break};case 295:{Mo(c[q>>2]|0,c[(c[j>>2]|0)+4>>2]|0);break};case 300:{No(c[q>>2]|0,0,0);break};case 289:{c[h>>2]=Rn(c[q>>2]|0,57,0,0,(c[j>>2]|0)+ -16+4|0)|0;if(c[h>>2]|0)a[(c[h>>2]|0)+1>>0]=c[(c[j>>2]|0)+ -48+4>>2];c[h+4>>2]=c[(c[j>>2]|0)+ -80+4>>2];c[h+8>>2]=(c[(c[j>>2]|0)+4>>2]|0)+(c[(c[j>>2]|0)+8>>2]|0);break};case 290:{c[h>>2]=1;break};case 292:{c[h>>2]=3;break};case 303:{Oo(c[q>>2]|0,(c[j>>2]|0)+ -16+4|0,(c[j>>2]|0)+4|0);break};case 304:{Po(c[q>>2]|0,c[(c[j>>2]|0)+ -48+4>>2]|0,(c[j>>2]|0)+4|0);break};case 305:{Qo(c[q>>2]|0,(c[j>>2]|0)+4|0);break};case 306:{a[(c[c[q>>2]>>2]|0)+250>>0]=0;Ro(c[q>>2]|0,c[(c[j>>2]|0)+4>>2]|0);break};case 301:{No(c[q>>2]|0,(c[j>>2]|0)+ -16+4|0,(c[j>>2]|0)+4|0);break};case 302:{Oo(c[q>>2]|0,0,0);break};case 310:{So(c[q>>2]|0,(c[j>>2]|0)+4|0);break};case 311:{To(c[q>>2]|0,(c[j>>2]|0)+ -48+4|0,(c[j>>2]|0)+ -32+4|0,(c[j>>2]|0)+4|0,c[(c[j>>2]|0)+ -64+4>>2]|0);break};case 314:{Uo(c[q>>2]|0);break};case 318:case 317:case 316:{Vo(c[q>>2]|0,(c[j>>2]|0)+4|0);break};case 322:{c[h>>2]=0;break};case 309:{So(c[q>>2]|0,0);break};case 324:case 323:{c[h>>2]=c[(c[j>>2]|0)+4>>2];break};case 325:{c[h>>2]=Wo(c[q>>2]|0,0,(c[j>>2]|0)+ -80+4|0,c[(c[j>>2]|0)+ -64+4>>2]|0,c[(c[j>>2]|0)+ -16+4>>2]|0)|0;break};case 326:{c[h>>2]=Wo(c[q>>2]|0,c[(c[j>>2]|0)+ -112+4>>2]|0,(c[j>>2]|0)+ -80+4|0,c[(c[j>>2]|0)+ -64+4>>2]|0,c[(c[j>>2]|0)+ -16+4>>2]|0)|0;break};default:{}}while(0);c[m>>2]=d[10448+(c[o>>2]<<1)>>0];c[k>>2]=d[10449+(c[o>>2]<<1)>>0];f=c[p>>2]|0;c[f>>2]=(c[f>>2]|0)-(c[k>>2]|0);c[l>>2]=Xo(e[(c[j>>2]|0)+(0-(c[k>>2]|0)<<4)>>1]|0,c[m>>2]&255)|0;if((c[l>>2]|0)>=642){Yo(c[p>>2]|0);i=n;return}o=c[p>>2]|0;if(c[k>>2]|0){c[o>>2]=(c[o>>2]|0)+1;c[j>>2]=(c[j>>2]|0)+(0-((c[k>>2]|0)-1)<<4);b[c[j>>2]>>1]=c[l>>2];a[(c[j>>2]|0)+2>>0]=c[m>>2];f=(c[j>>2]|0)+4|0;c[f+0>>2]=c[h+0>>2];c[f+4>>2]=c[h+4>>2];c[f+8>>2]=c[h+8>>2];i=n;return}else{Dn(o,c[l>>2]|0,c[m>>2]|0,h);i=n;return}}function Fn(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;h=e;f=e+12|0;g=e+4|0;c[f>>2]=a;c[e+8>>2]=b;c[g>>2]=c[(c[f>>2]|0)+8>>2];a=c[g>>2]|0;c[h>>2]=d;Se(a,9968,h);c[(c[f>>2]|0)+8>>2]=c[g>>2];i=e;return}function Gn(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+16|0;f=e+4|0;g=e;c[f>>2]=b;c[g>>2]=d;a[(c[f>>2]|0)+450>>0]=c[g>>2];c[(c[f>>2]|0)+440>>2]=0;i=e;return}function Hn(b){b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;e=i;i=i+32|0;g=e+24|0;h=e+20|0;f=e+16|0;m=e+12|0;k=e+8|0;l=e+4|0;j=e;c[g>>2]=b;c[h>>2]=c[c[g>>2]>>2];if(a[(c[h>>2]|0)+64>>0]|0){i=e;return}if(a[(c[g>>2]|0)+18>>0]|0){i=e;return}if(c[(c[g>>2]|0)+64>>2]|0){i=e;return}c[f>>2]=dp(c[g>>2]|0)|0;do if(c[f>>2]|0){do{}while((As(c[f>>2]|0,61)|0)!=0);mp(c[f>>2]|0,24)|0;if(!(d[(c[h>>2]|0)+64>>0]|0)){if((c[(c[g>>2]|0)+332>>2]|0)==0?(c[(c[g>>2]|0)+316>>2]|0)==0:0)break;zp(c[f>>2]|0,0);c[m>>2]=0;while(1){if((c[m>>2]|0)>=(c[(c[h>>2]|0)+20>>2]|0))break;if(((c[(c[g>>2]|0)+332>>2]&1<<c[m>>2]|0)!=0|0)!=0?(Ze(c[f>>2]|0,c[m>>2]|0),We(c[f>>2]|0,4,c[m>>2]|0,(c[(c[g>>2]|0)+328>>2]&1<<c[m>>2]|0)!=0&1,c[(c[g>>2]|0)+336+(c[m>>2]<<2)>>2]|0,c[(c[(c[(c[h>>2]|0)+16>>2]|0)+(c[m>>2]<<4)+12>>2]|0)+4>>2]|0)|0,(d[(c[h>>2]|0)+145>>0]|0)==0):0)Xe(c[f>>2]|0,1);c[m>>2]=(c[m>>2]|0)+1}c[k>>2]=0;while(1){if((c[k>>2]|0)>=(c[(c[g>>2]|0)+452>>2]|0))break;c[l>>2]=Rp(c[h>>2]|0,c[(c[(c[g>>2]|0)+520>>2]|0)+(c[k>>2]<<2)>>2]|0)|0;hp(c[f>>2]|0,144,0,0,0,c[l>>2]|0,-10)|0;c[k>>2]=(c[k>>2]|0)+1}c[(c[g>>2]|0)+452>>2]=0;uy(c[g>>2]|0);vy(c[g>>2]|0);a:do if(c[(c[g>>2]|0)+316>>2]|0){c[j>>2]=c[(c[g>>2]|0)+316>>2];a[(c[g>>2]|0)+23>>0]=0;c[k>>2]=0;while(1){if((c[k>>2]|0)>=(c[c[j>>2]>>2]|0))break a;Os(c[g>>2]|0,c[(c[(c[j>>2]|0)+4>>2]|0)+((c[k>>2]|0)*20|0)>>2]|0,c[(c[(c[j>>2]|0)+4>>2]|0)+((c[k>>2]|0)*20|0)+16>>2]|0);c[k>>2]=(c[k>>2]|0)+1}}while(0);fp(c[f>>2]|0,16,0,1)|0}}while(0);if(((c[f>>2]|0)!=0?(c[(c[g>>2]|0)+64>>2]|0)==0:0)?(a[(c[h>>2]|0)+64>>0]|0)==0:0){if((c[(c[g>>2]|0)+404>>2]|0)!=0?(c[(c[g>>2]|0)+68>>2]|0)==0:0)c[(c[g>>2]|0)+68>>2]=1;df(c[f>>2]|0,c[g>>2]|0);c[(c[g>>2]|0)+12>>2]=101;a[(c[g>>2]|0)+16>>0]=0}else c[(c[g>>2]|0)+12>>2]=1;c[(c[g>>2]|0)+68>>2]=0;c[(c[g>>2]|0)+72>>2]=0;c[(c[g>>2]|0)+76>>2]=0;c[(c[g>>2]|0)+440>>2]=0;c[(c[g>>2]|0)+332>>2]=0;i=e;return}function In(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;i=i+32|0;j=d+16|0;h=d+12|0;f=d+8|0;g=d+4|0;e=d;c[j>>2]=a;c[h>>2]=b;c[f>>2]=c[c[j>>2]>>2];if(ap(c[j>>2]|0,22,27128,0,0)|0){i=d;return}c[g>>2]=dp(c[j>>2]|0)|0;if(!(c[g>>2]|0)){i=d;return}a:do if((c[h>>2]|0)!=7){c[e>>2]=0;while(1){if((c[e>>2]|0)>=(c[(c[f>>2]|0)+20>>2]|0))break a;fp(c[g>>2]|0,4,c[e>>2]|0,((c[h>>2]|0)==9&1)+1|0)|0;Ze(c[g>>2]|0,c[e>>2]|0);c[e>>2]=(c[e>>2]|0)+1}}while(0);fp(c[g>>2]|0,3,0,0)|0;i=d;return}function Jn(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;if(ap(c[e>>2]|0,22,27160,0,0)|0){i=b;return}c[d>>2]=dp(c[e>>2]|0)|0;if(!(c[d>>2]|0)){i=b;return}fp(c[d>>2]|0,3,1,0)|0;i=b;return}function Kn(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;if(ap(c[e>>2]|0,22,27144,0,0)|0){i=b;return}c[d>>2]=dp(c[e>>2]|0)|0;if(!(c[d>>2]|0)){i=b;return}fp(c[d>>2]|0,3,1,1)|0;i=b;return}function Ln(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+32|0;j=e+16|0;g=e+12|0;k=e+8|0;h=e+4|0;f=e;c[j>>2]=a;c[g>>2]=b;c[k>>2]=d;c[h>>2]=Zo(c[c[j>>2]>>2]|0,c[k>>2]|0)|0;if(!(c[h>>2]|0)){i=e;return}c[f>>2]=dp(c[j>>2]|0)|0;if((c[f>>2]|0)!=0?(ap(c[j>>2]|0,32,c[27112+(c[g>>2]<<2)>>2]|0,c[h>>2]|0,0)|0)==0:0){hp(c[f>>2]|0,2,c[g>>2]|0,0,0,c[h>>2]|0,-1)|0;i=e;return}Xb(c[c[j>>2]>>2]|0,c[h>>2]|0);i=e;return}function Mn(e,f,g,h,j,k,l){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;m=i;i=i+96|0;t=m;w=m+84|0;I=m+80|0;H=m+76|0;G=m+72|0;z=m+68|0;y=m+64|0;v=m+60|0;D=m+56|0;q=m+52|0;p=m+48|0;o=m+44|0;n=m+40|0;u=m+36|0;B=m+32|0;A=m+28|0;C=m+24|0;E=m+20|0;F=m+16|0;x=m+12|0;s=m+8|0;r=m+4|0;c[w>>2]=e;c[I>>2]=f;c[H>>2]=g;c[G>>2]=h;c[z>>2]=j;c[y>>2]=k;c[v>>2]=l;c[q>>2]=0;c[p>>2]=c[c[w>>2]>>2];c[n>>2]=Er(c[w>>2]|0,c[I>>2]|0,c[H>>2]|0,u)|0;if((c[n>>2]|0)<0){i=m;return}if((c[G>>2]|0)!=0?(c[n>>2]|0)!=1?(c[(c[H>>2]|0)+4>>2]|0)>>>0>0:0:0){Se(c[w>>2]|0,27e3,t);i=m;return}if(c[G>>2]|0)c[n>>2]=1;I=(c[w>>2]|0)+496|0;e=c[u>>2]|0;c[I+0>>2]=c[e+0>>2];c[I+4>>2]=c[e+4>>2];c[q>>2]=Zo(c[p>>2]|0,c[u>>2]|0)|0;if(!(c[q>>2]|0)){i=m;return}a:do if(!(Pp(c[w>>2]|0,c[q>>2]|0)|0)){if((d[(c[p>>2]|0)+144>>0]|0)==1)c[G>>2]=1;c[A>>2]=c[(c[(c[p>>2]|0)+16>>2]|0)+(c[n>>2]<<4)>>2];if(!(ap(c[w>>2]|0,18,(c[G>>2]|0)==1?14904:14928,0,c[A>>2]|0)|0)){l=(c[G>>2]|0)!=0;do if(c[z>>2]|0)if(l){c[B>>2]=6;break}else{c[B>>2]=8;break}else if(l){c[B>>2]=4;break}else{c[B>>2]=2;break}while(0);if((c[y>>2]|0)==0?(ap(c[w>>2]|0,c[B>>2]|0,c[q>>2]|0,0,c[A>>2]|0)|0)!=0:0)break;do if(!(a[(c[w>>2]|0)+451>>0]|0)){c[C>>2]=c[(c[(c[p>>2]|0)+16>>2]|0)+(c[n>>2]<<4)>>2];if(Ar(c[w>>2]|0)|0)break a;c[D>>2]=sp(c[p>>2]|0,c[q>>2]|0,c[C>>2]|0)|0;if(!(c[D>>2]|0)){if(!(Op(c[p>>2]|0,c[q>>2]|0,c[C>>2]|0)|0))break;I=c[w>>2]|0;c[t>>2]=c[q>>2];Se(I,27072,t);break a}o=c[w>>2]|0;if(c[v>>2]|0){qp(o,c[n>>2]|0);break a}else{c[t>>2]=c[u>>2];Se(o,27048,t);break a}}while(0);c[D>>2]=se(c[p>>2]|0,76,0)|0;if(!(c[D>>2]|0)){a[(c[p>>2]|0)+64>>0]=1;c[(c[w>>2]|0)+12>>2]=7;I=(c[w>>2]|0)+64|0;c[I>>2]=(c[I>>2]|0)+1;break}c[c[D>>2]>>2]=c[q>>2];b[(c[D>>2]|0)+36>>1]=-1;c[(c[D>>2]|0)+68>>2]=c[(c[(c[p>>2]|0)+16>>2]|0)+(c[n>>2]<<4)+12>>2];b[(c[D>>2]|0)+40>>1]=1;b[(c[D>>2]|0)+28>>1]=200;c[(c[w>>2]|0)+484>>2]=c[D>>2];if((a[(c[w>>2]|0)+18>>0]|0)==0?(UE(c[q>>2]|0,16152)|0)==0:0)c[(c[(c[D>>2]|0)+68>>2]|0)+72>>2]=c[D>>2];if(a[(c[p>>2]|0)+145>>0]|0){i=m;return}I=dp(c[w>>2]|0)|0;c[o>>2]=I;if(!I){i=m;return}pp(c[w>>2]|0,0,c[n>>2]|0);if(c[y>>2]|0)mp(c[o>>2]|0,144)|0;e=(c[w>>2]|0)+72|0;I=(c[e>>2]|0)+1|0;c[e>>2]=I;c[(c[w>>2]|0)+384>>2]=I;c[x>>2]=I;I=(c[w>>2]|0)+72|0;e=(c[I>>2]|0)+1|0;c[I>>2]=e;c[(c[w>>2]|0)+388>>2]=e;c[s>>2]=e;e=(c[w>>2]|0)+72|0;I=(c[e>>2]|0)+1|0;c[e>>2]=I;c[r>>2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e;c[C>>2]=f;c[x>>2]=g;a[D>>0]=h;c[H>>2]=j;c[n>>2]=c[c[u>>2]>>2];if((c[x>>2]|0)==0&(c[H>>2]|0)==0){i=y;return}if(d[(c[n>>2]|0)+64>>0]|0){i=y;return}c[q>>2]=c[(c[u>>2]|0)+484>>2];if(!(c[q>>2]|0)){i=y;return}if(a[(c[n>>2]|0)+145>>0]|0)c[(c[q>>2]|0)+32>>2]=c[(c[n>>2]|0)+140>>2];do if(d[D>>0]&32){if(d[(c[q>>2]|0)+44>>0]&8){Se(c[u>>2]|0,26608,m);i=y;return}if(!(d[(c[q>>2]|0)+44>>0]&4)){e=c[u>>2]|0;c[m>>2]=c[c[q>>2]>>2];Se(e,26664,m);break}else{e=(c[q>>2]|0)+44|0;a[e>>0]=d[e>>0]|32;oy(c[u>>2]|0,c[q>>2]|0);break}}while(0);c[p>>2]=Ve(c[n>>2]|0,c[(c[q>>2]|0)+68>>2]|0)|0;if(c[(c[q>>2]|0)+24>>2]|0)iy(c[u>>2]|0,c[q>>2]|0,4,0,c[(c[q>>2]|0)+24>>2]|0);py(c[q>>2]|0);c[G>>2]=c[(c[q>>2]|0)+8>>2];while(1){if(!(c[G>>2]|0))break;ky(c[G>>2]|0);c[G>>2]=c[(c[G>>2]|0)+20>>2]}if(!(a[(c[n>>2]|0)+145>>0]|0)){c[o>>2]=dp(c[u>>2]|0)|0;if(!(c[o>>2]|0)){i=y;return}Ir(c[o>>2]|0,61,0)|0;if(!(c[(c[q>>2]|0)+12>>2]|0)){c[s>>2]=21400;c[v>>2]=26696}else{c[s>>2]=25504;c[v>>2]=26704}do if((c[H>>2]|0)!=0?(ip(c[o>>2]|0,55,1,c[(c[u>>2]|0)+388>>2]|0,c[p>>2]|0)|0,Xe(c[o>>2]|0,2),c[(c[u>>2]|0)+68>>2]=2,$s(E,14,1),ao(c[u>>2]|0,c[H>>2]|0,E)|0,Ir(c[o>>2]|0,61,1)|0,(c[(c[u>>2]|0)+64>>2]|0)==0):0){c[F>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,26816,m)}g=c[o>>2]|0;f=c[p>>2]|0;e=c[n>>2]|0;c[m>>2]=c[c[q>>2]>>2];gp(g,f,Te(e,26864,m)|0)}if(!(a[(c[n>>2]|0)+145>>0]|0)){i=y;return}c[z>>2]=c[(c[q>>2]|0)+68>>2];c[A>>2]=gh((c[z>>2]|0)+8|0,c[c[q>>2]>>2]|0,c[q>>2]|0)|0;if(c[A>>2]|0){a[(c[n>>2]|0)+64>>0]=1;i=y;return}c[(c[u>>2]|0)+484>>2]=0;e=(c[n>>2]|0)+24|0;c[e>>2]=c[e>>2]|2;if(c[(c[q>>2]|0)+12>>2]|0){i=y;return}c[B>>2]=c[(c[u>>2]|0)+496>>2];if(!(c[c[C>>2]>>2]|0))c[C>>2]=c[x>>2];c[l>>2]=(c[c[C>>2]>>2]|0)-(c[B>>2]|0);e=13+(Tm(c[B>>2]|0,c[l>>2]|0)|0)|0;c[(c[q>>2]|0)+48>>2]=e;i=y;return}function On(e,f){e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;n=i;i=i+48|0;l=n;j=n+32|0;r=n+28|0;k=n+24|0;q=n+20|0;p=n+16|0;o=n+12|0;m=n+8|0;g=n+4|0;c[j>>2]=e;c[r>>2]=f;c[m>>2]=c[c[j>>2]>>2];e=c[(c[j>>2]|0)+484>>2]|0;c[k>>2]=e;if(!e){i=n;return}if(((b[(c[k>>2]|0)+38>>1]|0)+1|0)>(c[(c[m>>2]|0)+96>>2]|0)){e=c[j>>2]|0;c[l>>2]=c[c[k>>2]>>2];Se(e,26552,l);i=n;return}c[p>>2]=Zo(c[m>>2]|0,c[r>>2]|0)|0;if(!(c[p>>2]|0)){i=n;return}c[q>>2]=0;while(1){if((c[q>>2]|0)>=(b[(c[k>>2]|0)+38>>1]|0))break;if((d[440+(d[c[p>>2]>>0]|0)>>0]|0)==(d[440+(d[c[(c[(c[k>>2]|0)+4>>2]|0)+((c[q>>2]|0)*24|0)>>2]>>0]|0)>>0]|0)?(xc((c[p>>2]|0)+1|0,(c[(c[(c[k>>2]|0)+4>>2]|0)+((c[q>>2]|0)*24|0)>>2]|0)+1|0)|0)==0:0){h=9;break}c[q>>2]=(c[q>>2]|0)+1}if((h|0)==9){e=c[j>>2]|0;c[l>>2]=c[p>>2];Se(e,26576,l);Xb(c[m>>2]|0,c[p>>2]|0);i=n;return}do if(!(b[(c[k>>2]|0)+38>>1]&7)){c[g>>2]=Fk(c[m>>2]|0,c[(c[k>>2]|0)+4>>2]|0,((b[(c[k>>2]|0)+38>>1]|0)+8|0)*24|0,0)|0;if(c[g>>2]|0){c[(c[k>>2]|0)+4>>2]=c[g>>2];break}Xb(c[m>>2]|0,c[p>>2]|0);i=n;return}while(0);c[o>>2]=(c[(c[k>>2]|0)+4>>2]|0)+((b[(c[k>>2]|0)+38>>1]|0)*24|0);e=c[o>>2]|0;c[e+0>>2]=0;c[e+4>>2]=0;c[e+8>>2]=0;c[e+12>>2]=0;c[e+16>>2]=0;c[e+20>>2]=0;c[c[o>>2]>>2]=c[p>>2];a[(c[o>>2]|0)+21>>0]=65;a[(c[o>>2]|0)+22>>0]=1;e=(c[k>>2]|0)+38|0;b[e>>1]=(b[e>>1]|0)+1<<16>>16;i=n;return}function Pn(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;j=f+12|0;k=f+8|0;g=f+4|0;h=f;c[j>>2]=d;c[k>>2]=e;c[g>>2]=c[(c[j>>2]|0)+484>>2];if(!(c[g>>2]|0)){i=f;return}if((b[(c[g>>2]|0)+38>>1]|0)<1){i=f;return}c[h>>2]=(c[(c[g>>2]|0)+4>>2]|0)+(((b[(c[g>>2]|0)+38>>1]|0)-1|0)*24|0);d=Zo(c[c[j>>2]>>2]|0,c[k>>2]|0)|0;c[(c[h>>2]|0)+12>>2]=d;d=Bp(c[(c[h>>2]|0)+12>>2]|0,(c[h>>2]|0)+22|0)|0;a[(c[h>>2]|0)+21>>0]=d;i=f;return}function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2]|0)+484>>2];c[w>>2]=0;c[t>>2]=-1;if(!(c[u>>2]|0)){f=c[m>>2]|0;f=c[f>>2]|0;e=c[l>>2]|0;sn(f,e);i=s;return}if(d[(c[m>>2]|0)+451>>0]|0){f=c[m>>2]|0;f=c[f>>2]|0;e=c[l>>2]|0;sn(f,e);i=s;return}if(d[(c[u>>2]|0)+44>>0]&4){f=c[m>>2]|0;c[n>>2]=c[c[u>>2]>>2];Se(f,26400,n);f=c[m>>2]|0;f=c[f>>2]|0;e=c[l>>2]|0;sn(f,e);i=s;return}e=(c[u>>2]|0)+44|0;a[e>>0]=d[e>>0]|4;a:do if(!(c[l>>2]|0)){c[t>>2]=(b[(c[u>>2]|0)+38>>1]|0)-1;e=(c[(c[u>>2]|0)+4>>2]|0)+((c[t>>2]|0)*24|0)+23|0;a[e>>0]=d[e>>0]|1;c[w>>2]=c[(c[(c[u>>2]|0)+4>>2]|0)+((c[t>>2]|0)*24|0)+12>>2];c[x>>2]=1}else{c[x>>2]=c[c[l>>2]>>2];c[y>>2]=0;while(1){if((c[y>>2]|0)>=(c[x>>2]|0))break a;c[t>>2]=0;while(1){if((c[t>>2]|0)>=(b[(c[u>>2]|0)+38>>1]|0))break;e=(xc(c[(c[(c[l>>2]|0)+4>>2]|0)+((c[y>>2]|0)*20|0)+4>>2]|0,c[(c[(c[u>>2]|0)+4>>2]|0)+((c[t>>2]|0)*24|0)>>2]|0)|0)==0;j=c[t>>2]|0;if(e){v=12;break}c[t>>2]=j+1}if((v|0)==12){v=0;e=(c[(c[u>>2]|0)+4>>2]|0)+(j*24|0)+23|0;a[e>>0]=d[e>>0]|1;c[w>>2]=c[(c[(c[u>>2]|0)+4>>2]|0)+((c[t>>2]|0)*24|0)+12>>2]}c[y>>2]=(c[y>>2]|0)+1}}while(0);if((c[x>>2]|0)==1&(c[w>>2]|0)!=0?(e=(xc(c[w>>2]|0,16416)|0)==0,e&(c[q>>2]|0)==0):0){b[(c[u>>2]|0)+36>>1]=c[t>>2];a[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)+16>>2]|0)+(c[C>>2]<<4)+12>>2]|0)!=(c[(c[A>>2]|0)+68>>2]|0):0){f=c[Y>>2]|0;c[D>>2]=c[c[A>>2]>>2];Se(f,25944,D);break}if(d[(c[A>>2]|0)+44>>0]&32)c[K>>2]=Zr(c[A>>2]|0)|0}else{c[A>>2]=c[p+484>>2];if(!(c[A>>2]|0))break;c[C>>2]=Ve(c[u>>2]|0,c[(c[A>>2]|0)+68>>2]|0)|0}c[Z>>2]=(c[(c[u>>2]|0)+16>>2]|0)+(c[C>>2]<<4);if(((Lb(c[c[A>>2]>>2]|0,15144,7)|0)==0?(d[(c[u>>2]|0)+145>>0]|0)==0:0)?(Lb((c[c[A>>2]>>2]|0)+7|0,26e3,9)|0)!=0:0){f=c[Y>>2]|0;c[D>>2]=c[c[A>>2]>>2];Se(f,26016,D);break}if(c[(c[A>>2]|0)+12>>2]|0){Se(c[Y>>2]|0,26048,D);break}if(d[(c[A>>2]|0)+44>>0]&16){Se(c[Y>>2]|0,26080,D);break}if(c[M>>2]|0){c[r>>2]=Zo(c[u>>2]|0,c[M>>2]|0)|0;if(!(c[r>>2]|0))break;if(Pp(c[Y>>2]|0,c[r>>2]|0)|0)break;if((a[(c[u>>2]|0)+145>>0]|0)==0?(sp(c[u>>2]|0,c[r>>2]|0,0)|0)!=0:0){f=c[Y>>2]|0;c[D>>2]=c[r>>2];Se(f,26120,D);break}if(Op(c[u>>2]|0,c[r>>2]|0,c[c[Z>>2]>>2]|0)|0){y=c[Y>>2]|0;if(c[_>>2]|0){qp(y,c[C>>2]|0);break}else{c[D>>2]=c[r>>2];Se(y,26160,D);break}}}else{c[ha>>2]=c[(c[A>>2]|0)+8>>2];c[ga>>2]=1;while(1){if(!(c[ha>>2]|0))break;c[ha>>2]=c[(c[ha>>2]|0)+20>>2];c[ga>>2]=(c[ga>>2]|0)+1}f=c[u>>2]|0;g=c[ga>>2]|0;c[D>>2]=c[c[A>>2]>>2];c[D+4>>2]=g;c[r>>2]=Te(f,26184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w>>2]|0);c:do if((c[A>>2]|0)==(c[(c[Y>>2]|0)+484>>2]|0)){c[da>>2]=c[(c[A>>2]|0)+8>>2];while(1){if(!(c[da>>2]|0))break c;if((e[(c[da>>2]|0)+50>>1]|0)==(e[(c[w>>2]|0)+50>>1]|0)){c[ea>>2]=0;while(1){if((c[ea>>2]|0)>=(e[(c[da>>2]|0)+50>>1]|0))break;if((b[(c[(c[da>>2]|0)+4>>2]|0)+(c[ea>>2]<<1)>>1]|0)!=(b[(c[(c[w>>2]|0)+4>>2]|0)+(c[ea>>2]<<1)>>1]|0))break;c[F>>2]=c[(c[(c[da>>2]|0)+32>>2]|0)+(c[ea>>2]<<2)>>2];c[G>>2]=c[(c[(c[w>>2]|0)+32>>2]|0)+(c[ea>>2]<<2)>>2];if((c[F>>2]|0)!=(c[G>>2]|0)?(xc(c[F>>2]|0,c[G>>2]|0)|0)!=0:0)break;c[ea>>2]=(c[ea>>2]|0)+1}if((c[ea>>2]|0)==(e[(c[da>>2]|0)+50>>1]|0))break}c[da>>2]=c[(c[da>>2]|0)+20>>2]}if((d[(c[da>>2]|0)+54>>0]|0)==(d[(c[w>>2]|0)+54>>0]|0))break a;do if((d[(c[da>>2]|0)+54>>0]|0)!=10){if((d[(c[w>>2]|0)+54>>0]|0)==10)break;f=c[Y>>2]|0;c[D>>2]=0;Se(f,26240,D)}while(0);if((d[(c[da>>2]|0)+54>>0]|0)!=10)break a;a[(c[da>>2]|0)+54>>0]=a[(c[w>>2]|0)+54>>0]|0;break a}while(0);do if(a[(c[u>>2]|0)+145>>0]|0){c[E>>2]=gh((c[(c[w>>2]|0)+24>>2]|0)+24|0,c[c[w>>2]>>2]|0,c[w>>2]|0)|0;C=c[u>>2]|0;if(c[E>>2]|0){a[C+64>>0]=1;break a}f=C+24|0;c[f>>2]=c[f>>2]|2;if(!(c[t>>2]|0))break;c[(c[w>>2]|0)+44>>2]=c[(c[u>>2]|0)+140>>2]}else{if(c[(c[Y>>2]|0)+64>>2]|0)break;if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f>>2]|0)+324>>2]|0)){i=j;return}fo(c[f>>2]|0,c[(c[g>>2]|0)+24>>2]|0,(c[f>>2]|0)+320|0,1);i=j;return}wn(c[c[f>>2]>>2]|0,c[h>>2]|0);i=j;return}function Xn(e,f,g,h,j){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;p=i;i=i+80|0;u=p;q=p+68|0;n=p+64|0;C=p+60|0;o=p+56|0;k=p+52|0;w=p+48|0;m=p+44|0;x=p+40|0;s=p+36|0;B=p+32|0;v=p+28|0;z=p+24|0;t=p+20|0;A=p+16|0;y=p+12|0;r=p+8|0;c[q>>2]=e;c[n>>2]=f;c[C>>2]=g;c[o>>2]=h;c[k>>2]=j;c[w>>2]=c[c[q>>2]>>2];c[m>>2]=0;c[s>>2]=c[(c[q>>2]|0)+484>>2];a:do if((c[s>>2]|0)!=0?(d[(c[q>>2]|0)+451>>0]|0)==0:0){if(!(c[n>>2]|0)){c[A>>2]=(b[(c[s>>2]|0)+38>>1]|0)-1;if((c[A>>2]|0)<0)break;if((c[o>>2]|0)!=0?(c[c[o>>2]>>2]|0)!=1:0){e=c[q>>2]|0;f=c[C>>2]|0;c[u>>2]=c[(c[(c[s>>2]|0)+4>>2]|0)+((c[A>>2]|0)*24|0)>>2];c[u+4>>2]=f;Se(e,25736,u);break}c[z>>2]=1}else{if((c[o>>2]|0)!=0?(c[c[o>>2]>>2]|0)!=(c[c[n>>2]>>2]|0):0){Se(c[q>>2]|0,25800,u);break}c[z>>2]=c[c[n>>2]>>2]}c[B>>2]=44+((c[z>>2]|0)-1<<3)+(c[(c[C>>2]|0)+4>>2]|0)+1;b:do if(c[o>>2]|0){c[v>>2]=0;while(1){if((c[v>>2]|0)>=(c[c[o>>2]>>2]|0))break b;e=(Mb(c[(c[(c[o>>2]|0)+4>>2]|0)+((c[v>>2]|0)*20|0)+4>>2]|0)|0)+1|0;c[B>>2]=(c[B>>2]|0)+e;c[v>>2]=(c[v>>2]|0)+1}}while(0);e=c[B>>2]|0;c[m>>2]=se(c[w>>2]|0,e,((e|0)<0)<<31>>31)|0;if(c[m>>2]|0){c[c[m>>2]>>2]=c[s>>2];c[(c[m>>2]|0)+4>>2]=c[(c[s>>2]|0)+16>>2];c[t>>2]=(c[m>>2]|0)+36+(c[z>>2]<<3);c[(c[m>>2]|0)+8>>2]=c[t>>2];dF(c[t>>2]|0,c[c[C>>2]>>2]|0,c[(c[C>>2]|0)+4>>2]|0)|0;a[(c[t>>2]|0)+(c[(c[C>>2]|0)+4>>2]|0)>>0]=0;sm(c[t>>2]|0)|0;c[t>>2]=(c[t>>2]|0)+((c[(c[C>>2]|0)+4>>2]|0)+1);c[(c[m>>2]|0)+20>>2]=c[z>>2];c:do if(!(c[n>>2]|0))c[(c[m>>2]|0)+36>>2]=(b[(c[s>>2]|0)+38>>1]|0)-1;else{c[v>>2]=0;while(1){if((c[v>>2]|0)>=(c[z>>2]|0))break c;c[y>>2]=0;while(1){if((c[y>>2]|0)>=(b[(c[s>>2]|0)+38>>1]|0))break;e=(xc(c[(c[(c[s>>2]|0)+4>>2]|0)+((c[y>>2]|0)*24|0)>>2]|0,c[(c[(c[n>>2]|0)+4>>2]|0)+((c[v>>2]|0)*20|0)+4>>2]|0)|0)==0;A=c[y>>2]|0;if(e){l=25;break}c[y>>2]=A+1}if((l|0)==25){l=0;c[(c[m>>2]|0)+36+(c[v>>2]<<3)>>2]=A}if((c[y>>2]|0)>=(b[(c[s>>2]|0)+38>>1]|0))break;c[v>>2]=(c[v>>2]|0)+1}e=c[q>>2]|0;c[u>>2]=c[(c[(c[n>>2]|0)+4>>2]|0)+((c[v>>2]|0)*20|0)+4>>2];Se(e,25896,u);break a}while(0);d:do if(c[o>>2]|0){c[v>>2]=0;while(1){if((c[v>>2]|0)>=(c[z>>2]|0))break d;c[r>>2]=Mb(c[(c[(c[o>>2]|0)+4>>2]|0)+((c[v>>2]|0)*20|0)+4>>2]|0)|0;c[(c[m>>2]|0)+36+(c[v>>2]<<3)+4>>2]=c[t>>2];dF(c[t>>2]|0,c[(c[(c[o>>2]|0)+4>>2]|0)+((c[v>>2]|0)*20|0)+4>>2]|0,c[r>>2]|0)|0;a[(c[t>>2]|0)+(c[r>>2]|0)>>0]=0;c[t>>2]=(c[t>>2]|0)+((c[r>>2]|0)+1);c[v>>2]=(c[v>>2]|0)+1}}while(0);a[(c[m>>2]|0)+24>>0]=0;a[(c[m>>2]|0)+25>>0]=c[k>>2];a[(c[m>>2]|0)+26>>0]=c[k>>2]>>8;c[x>>2]=gh((c[(c[s>>2]|0)+68>>2]|0)+56|0,c[(c[m>>2]|0)+8>>2]|0,c[m>>2]|0)|0;if((c[x>>2]|0)==(c[m>>2]|0)){a[(c[w>>2]|0)+64>>0]=1;break}if(c[x>>2]|0){c[(c[m>>2]|0)+12>>2]=c[x>>2];c[(c[x>>2]|0)+16>>2]=c[m>>2]}c[(c[s>>2]|0)+16>>2]=c[m>>2];c[m>>2]=0}}while(0);Xb(c[w>>2]|0,c[m>>2]|0);sn(c[w>>2]|0,c[n>>2]|0);sn(c[w>>2]|0,c[o>>2]|0);i=p;return}function Yn(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;j=e+12|0;f=e+8|0;h=e+4|0;g=e;c[j>>2]=b;c[f>>2]=d;b=c[(c[j>>2]|0)+484>>2]|0;c[h>>2]=b;if(!b){i=e;return}j=c[(c[h>>2]|0)+16>>2]|0;c[g>>2]=j;if(!j){i=e;return}a[(c[g>>2]|0)+24>>0]=c[f>>2];i=e;return}function Zn(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;j=i;i=i+32|0;k=j+24|0;m=j+20|0;g=j+16|0;h=j+12|0;f=j+8|0;l=j+4|0;e=j;c[k>>2]=a;c[m>>2]=d;a=c[(c[k>>2]|0)+484>>2]|0;c[g>>2]=a;if(!a){i=j;return}c[h>>2]=(b[(c[g>>2]|0)+38>>1]|0)-1;c[l>>2]=c[c[k>>2]>>2];c[f>>2]=Zo(c[l>>2]|0,c[m>>2]|0)|0;if(!(c[f>>2]|0)){i=j;return}a=(Or(c[k>>2]|0,c[f>>2]|0)|0)!=0;d=c[l>>2]|0;if(!a){Xb(d,c[f>>2]|0);i=j;return}Xb(d,c[(c[(c[g>>2]|0)+4>>2]|0)+((c[h>>2]|0)*24|0)+16>>2]|0);c[(c[(c[g>>2]|0)+4>>2]|0)+((c[h>>2]|0)*24|0)+16>>2]=c[f>>2];c[e>>2]=c[(c[g>>2]|0)+8>>2];while(1){if(!(c[e>>2]|0))break;if((b[c[(c[e>>2]|0)+4>>2]>>1]|0)==(c[h>>2]|0))c[c[(c[e>>2]|0)+32>>2]>>2]=c[(c[(c[g>>2]|0)+4>>2]|0)+((c[h>>2]|0)*24|0)+16>>2];c[e>>2]=c[(c[e>>2]|0)+20>>2]}i=j;return}function _n(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;k=i;i=i+64|0;o=k;l=k+48|0;j=k+44|0;p=k+40|0;m=k+36|0;n=k+32|0;u=k+28|0;q=k+24|0;t=k+20|0;r=k+16|0;v=k+12|0;h=k+8|0;s=k+4|0;c[l>>2]=b;c[j>>2]=e;c[p>>2]=f;c[m>>2]=g;c[q>>2]=c[c[l>>2]>>2];do if(!(a[(c[q>>2]|0)+64>>0]|0)){if(c[m>>2]|0){b=(c[q>>2]|0)+67|0;a[b>>0]=(a[b>>0]|0)+1<<24>>24}c[n>>2]=np(c[l>>2]|0,c[p>>2]|0,(c[j>>2]|0)+8|0)|0;if(c[m>>2]|0){b=(c[q>>2]|0)+67|0;a[b>>0]=(a[b>>0]|0)+ -1<<24>>24}if(!(c[n>>2]|0)){if(!(c[m>>2]|0))break;At(c[l>>2]|0,c[(c[j>>2]|0)+12>>2]|0);break}c[t>>2]=Ve(c[q>>2]|0,c[(c[n>>2]|0)+68>>2]|0)|0;if((d[(c[n>>2]|0)+44>>0]&16|0)!=0?(Qp(c[l>>2]|0,c[n>>2]|0)|0)!=0:0)break;c[v>>2]=(c[t>>2]|0)==1?14904:14928;c[h>>2]=c[(c[(c[q>>2]|0)+16>>2]|0)+(c[t>>2]<<4)>>2];c[s>>2]=0;if(!(ap(c[l>>2]|0,9,c[v>>2]|0,0,c[h>>2]|0)|0)){do if(c[p>>2]|0)if((c[t>>2]|0)==1){c[r>>2]=15;break}else{c[r>>2]=17;break}else{if(d[(c[n>>2]|0)+44>>0]&16){c[r>>2]=30;c[s>>2]=c[(c[(Rp(c[q>>2]|0,c[n>>2]|0)|0)+4>>2]|0)+4>>2];break}if((c[t>>2]|0)==1){c[r>>2]=13;break}else{c[r>>2]=11;break}}while(0);if((ap(c[l>>2]|0,c[r>>2]|0,c[c[n>>2]>>2]|0,c[s>>2]|0,c[h>>2]|0)|0)==0?(ap(c[l>>2]|0,9,c[c[n>>2]>>2]|0,0,c[h>>2]|0)|0)==0:0){if((Lb(c[c[n>>2]>>2]|0,15144,7)|0)==0?(Lb(c[c[n>>2]>>2]|0,25512,11)|0)!=0:0){b=c[l>>2]|0;c[o>>2]=c[c[n>>2]>>2];Se(b,25528,o);break}if((c[p>>2]|0)!=0?(c[(c[n>>2]|0)+12>>2]|0)==0:0){b=c[l>>2]|0;c[o>>2]=c[c[n>>2]>>2];Se(b,25560,o);break}if((c[p>>2]|0)==0?(c[(c[n>>2]|0)+12>>2]|0)!=0:0){b=c[l>>2]|0;c[o>>2]=c[c[n>>2]>>2];Se(b,25600,o);break}c[u>>2]=dp(c[l>>2]|0)|0;if(c[u>>2]|0){pp(c[l>>2]|0,1,c[t>>2]|0);iu(c[l>>2]|0,c[t>>2]|0,18168,c[c[n>>2]>>2]|0);dy(c[l>>2]|0,c[j>>2]|0,c[n>>2]|0);ey(c[l>>2]|0,c[n>>2]|0,c[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[c[l>>2]>>0]|0)!=59:0)c[l>>2]=(c[l>>2]|0)+(c[l+4>>2]|0);c[l+4>>2]=0;c[m>>2]=(c[l>>2]|0)-(c[c[s>>2]>>2]|0);c[n>>2]=c[c[s>>2]>>2];while(1){if((c[m>>2]|0)>0)r=(d[1224+(d[(c[n>>2]|0)+((c[m>>2]|0)-1)>>0]|0)>>0]&1|0)!=0;else r=0;q=c[m>>2]|0;if(!r)break;c[m>>2]=q+ -1}c[l>>2]=(c[n>>2]|0)+(q-1);c[l+4>>2]=1;Nn(c[o>>2]|0,0,l,0,0);i=p;return}tn(c[r>>2]|0,c[t>>2]|0);i=p;return}function ao(f,g,h){f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0;W=i;i=i+400|0;T=W+384|0;o=W+380|0;n=W+376|0;l=W+372|0;u=W+368|0;I=W+364|0;N=W+360|0;t=W+356|0;ra=W+352|0;r=W+348|0;q=W+344|0;ma=W+340|0;y=W+336|0;z=W+332|0;w=W+328|0;A=W+316|0;p=W+288|0;V=W+240|0;L=W+236|0;m=W+232|0;v=W+228|0;pa=W+224|0;ua=W+204|0;ta=W+200|0;ya=W+196|0;za=W+192|0;sa=W+188|0;qa=W+184|0;va=W+180|0;wa=W+176|0;xa=W+388|0;ba=W+144|0;S=W+140|0;R=W+136|0;Y=W+132|0;Z=W+128|0;M=W+124|0;j=W+120|0;O=W+116|0;P=W+112|0;Q=W+108|0;oa=W+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a>>1]=(d[A>>0]|0)!=0?1024:0;c[N>>2]=Hu(c[o>>2]|0,c[q>>2]|0,c[ma>>2]|0,c[p>>2]|0,c[c[n>>2]>>2]|0,b[xa>>1]|0,0)|0;if(!(c[N>>2]|0))break;g=ux(c[N>>2]|0)|0;za=D;f=(c[n>>2]|0)+24|0;h=c[f+4>>2]|0;if(za>>>0<h>>>0|((za|0)==(h|0)?g>>>0<(c[f>>2]|0)>>>0:0)){g=ux(c[N>>2]|0)|0;f=(c[n>>2]|0)+24|0;c[f>>2]=g;c[f+4>>2]=D}do if(d[A>>0]|0){if(!(vx(c[N>>2]|0)|0))break;a[A+1>>0]=vx(c[N>>2]|0)|0}while(0);do if(c[p>>2]|0){c[p+4>>2]=wx(c[N>>2]|0)|0;if((c[p+4>>2]|0)!=(c[c[p>>2]>>2]|0))break;c[p>>2]=0}while(0);do if((c[p+20>>2]|0)>=0){if(c[p>>2]|0)break;cf(c[t>>2]|0,c[p+20>>2]|0)}while(0);ya=c[o>>2]|0;za=c[n>>2]|0;h=c[r>>2]|0;g=c[l>>2]|0;f=yx(c[N>>2]|0)|0;xx(ya,za,h,-1,p,A,g,f,zx(c[N>>2]|0)|0);Iu(c[N>>2]|0)}else{c[O>>2]=0;c[P>>2]=0;c[Q>>2]=0;pa=c[n>>2]|0;do if(c[y>>2]|0){c[oa>>2]=c[c[pa>>2]>>2];c[na>>2]=c[(c[c[n>>2]>>2]|0)+4>>2];while(1){if((c[oa>>2]|0)<=0)break;b[(c[na>>2]|0)+18>>1]=0;c[oa>>2]=(c[oa>>2]|0)+ -1;c[na>>2]=(c[na>>2]|0)+20}c[oa>>2]=c[c[y>>2]>>2];c[na>>2]=c[(c[y>>2]|0)+4>>2];while(1){if((c[oa>>2]|0)<=0)break;b[(c[na>>2]|0)+18>>1]=0;c[oa>>2]=(c[oa>>2]|0)+ -1;c[na>>2]=(c[na>>2]|0)+20}f=(c[n>>2]|0)+24|0;g=c[f+4>>2]|0;if(!(g>>>0>0|(g|0)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]=0;d=c[r>>2]|0;i=p;return d|0}function eo(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;e=i;i=i+32|0;h=e+24|0;m=e+20|0;j=e+16|0;g=e+12|0;k=e+8|0;l=e+4|0;f=e;c[m>>2]=a;c[j>>2]=b;c[g>>2]=d;c[k>>2]=c[c[m>>2]>>2];if(!(c[j>>2]|0)){c[j>>2]=se(c[k>>2]|0,8,0)|0;if((c[j>>2]|0)!=0?(m=Qe(c[k>>2]|0,20,0)|0,c[(c[j>>2]|0)+4>>2]=m,(c[(c[j>>2]|0)+4>>2]|0)!=0):0)d=7;else d=8}else if(!(c[c[j>>2]>>2]&(c[c[j>>2]>>2]|0)-1)){c[l>>2]=Fk(c[k>>2]|0,c[(c[j>>2]|0)+4>>2]|0,(c[c[j>>2]>>2]<<1)*20|0,0)|0;if(!(c[l>>2]|0))d=8;else{c[(c[j>>2]|0)+4>>2]=c[l>>2];d=7}}else d=7;if((d|0)==7){a=c[j>>2]|0;m=c[a>>2]|0;c[a>>2]=m+1;c[f>>2]=(c[(c[j>>2]|0)+4>>2]|0)+(m*20|0);m=c[f>>2]|0;c[m+0>>2]=0;c[m+4>>2]=0;c[m+8>>2]=0;c[m+12>>2]=0;c[m+16>>2]=0;c[c[f>>2]>>2]=c[g>>2];c[h>>2]=c[j>>2];m=c[h>>2]|0;i=e;return m|0}else if((d|0)==8){wn(c[k>>2]|0,c[g>>2]|0);sn(c[k>>2]|0,c[j>>2]|0);c[h>>2]=0;m=c[h>>2]|0;i=e;return m|0}return 0}function fo(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+32|0;j=f+16|0;h=f+12|0;k=f+8|0;l=f+4|0;g=f;c[j>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;if(!(c[h>>2]|0)){i=f;return}c[g>>2]=(c[(c[h>>2]|0)+4>>2]|0)+(((c[c[h>>2]>>2]|0)-1|0)*20|0);a=rm(c[c[j>>2]>>2]|0,c[c[k>>2]>>2]|0,c[(c[k>>2]|0)+4>>2]|0,0)|0;c[(c[g>>2]|0)+4>>2]=a;if(!(c[l>>2]|0)){i=f;return}if(!(c[(c[g>>2]|0)+4>>2]|0)){i=f;return}sm(c[(c[g>>2]|0)+4>>2]|0)|0;i=f;return}function go(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+32|0;k=e+16|0;f=e+12|0;j=e+8|0;h=e+4|0;g=e;c[k>>2]=a;c[f>>2]=b;c[j>>2]=d;c[h>>2]=c[c[k>>2]>>2];if(!(c[f>>2]|0)){i=e;return}c[g>>2]=(c[(c[f>>2]|0)+4>>2]|0)+(((c[c[f>>2]>>2]|0)-1|0)*20|0);Xb(c[h>>2]|0,c[(c[g>>2]|0)+8>>2]|0);k=(c[(c[j>>2]|0)+8>>2]|0)-(c[(c[j>>2]|0)+4>>2]|0)|0;k=rm(c[h>>2]|0,c[(c[j>>2]|0)+4>>2]|0,k,((k|0)<0)<<31>>31)|0;c[(c[g>>2]|0)+8>>2]=k;i=e;return}function ho(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+32|0;h=e+16|0;g=e+12|0;j=e+8|0;f=e;c[h>>2]=a;c[g>>2]=b;c[j>>2]=d;c[f>>2]=c[j>>2];if(c[j>>2]|0)d=Mb(c[j>>2]|0)|0;else d=0;c[f+4>>2]=d;a=or(c[h>>2]|0,c[g>>2]|0,f,0)|0;i=e;return a|0}function io(b){b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[e>>2]=b;if(!(c[e>>2]|0)){i=d;return}c[f>>2]=(c[c[e>>2]>>2]|0)-1;while(1){if((c[f>>2]|0)<=0)break;a[(c[e>>2]|0)+8+((c[f>>2]|0)*72|0)+36>>0]=a[(c[e>>2]|0)+8+(((c[f>>2]|0)-1|0)*72|0)+36>>0]|0;c[f>>2]=(c[f>>2]|0)+ -1}a[(c[e>>2]|0)+44>>0]=0;i=d;return}function jo(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;h=f+12|0;k=f+8|0;j=f+4|0;g=f;c[h>>2]=b;c[k>>2]=d;c[j>>2]=e;if(!(c[k>>2]|0)){i=f;return}if((c[c[k>>2]>>2]|0)<=0){i=f;return}c[g>>2]=(c[k>>2]|0)+8+(((c[c[k>>2]>>2]|0)-1|0)*72|0);if((c[(c[j>>2]|0)+4>>2]|0)==1?(c[c[j>>2]>>2]|0)==0:0){b=(c[g>>2]|0)+37|0;a[b>>0]=a[b>>0]&-2|1;i=f;return}b=Zo(c[c[h>>2]>>2]|0,c[j>>2]|0)|0;c[(c[g>>2]|0)+64>>2]=b;i=f;return}function ko(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;k=i;i=i+32|0;j=k+24|0;m=k+20|0;h=k+16|0;n=k+12|0;l=k+8|0;o=k+4|0;g=k;c[m>>2]=b;c[h>>2]=d;c[n>>2]=e;c[l>>2]=f;do if(!(c[h>>2]|0)){c[h>>2]=se(c[m>>2]|0,80,0)|0;if(c[h>>2]|0){c[(c[h>>2]|0)+4>>2]=1;break}c[j>>2]=0;b=c[j>>2]|0;i=k;return b|0}while(0);c[h>>2]=mx(c[m>>2]|0,c[h>>2]|0,1,c[c[h>>2]>>2]|0)|0;if(a[(c[m>>2]|0)+64>>0]|0){vn(c[m>>2]|0,c[h>>2]|0);c[j>>2]=0;b=c[j>>2]|0;i=k;return b|0}c[o>>2]=(c[h>>2]|0)+8+(((c[c[h>>2]>>2]|0)-1|0)*72|0);if((c[l>>2]|0)!=0?(c[c[l>>2]>>2]|0)==0:0)c[l>>2]=0;if(c[l>>2]|0){c[g>>2]=c[l>>2];c[l>>2]=c[n>>2];c[n>>2]=c[g>>2]}b=Zo(c[m>>2]|0,c[n>>2]|0)|0;c[(c[o>>2]|0)+8>>2]=b;b=Zo(c[m>>2]|0,c[l>>2]|0)|0;c[(c[o>>2]|0)+4>>2]=b;c[j>>2]=c[h>>2];b=c[j>>2]|0;i=k;return b|0}function lo(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;j=i;i=i+64|0;l=j;k=j+60|0;g=j+56|0;m=j+52|0;o=j+48|0;p=j+44|0;q=j+32|0;s=j+28|0;r=j+24|0;t=j+20|0;n=j+16|0;c[k>>2]=a;c[g>>2]=b;c[m>>2]=e;c[o>>2]=f;c[p>>2]=0;c[q>>2]=c[g>>2];c[q+4>>2]=c[m>>2];c[q+8>>2]=c[o>>2];c[r>>2]=0;while(1){if((c[r>>2]|0)>=3)break;if(!(c[q+(c[r>>2]<<2)>>2]|0))break;c[s>>2]=c[q+(c[r>>2]<<2)>>2];c[t>>2]=0;while(1){if((c[t>>2]|0)>=7)break;if((c[(c[s>>2]|0)+4>>2]|0)==(d[24649+((c[t>>2]|0)*3|0)>>0]|0|0)?(Lb(c[c[s>>2]>>2]|0,24608+(d[24648+((c[t>>2]|0)*3|0)>>0]|0)|0,c[(c[s>>2]|0)+4>>2]|0)|0)==0:0){h=8;break}c[t>>2]=(c[t>>2]|0)+1}if((h|0)==8){h=0;c[p>>2]=c[p>>2]|(d[24650+((c[t>>2]|0)*3|0)>>0]|0)}if((c[t>>2]|0)>=7){h=11;break}c[r>>2]=(c[r>>2]|0)+1}if((h|0)==11)c[p>>2]=c[p>>2]|64;if((c[p>>2]&33|0)!=33?(c[p>>2]&64|0)==0:0){if(!(c[p>>2]&32)){a=c[p>>2]|0;i=j;return a|0}if((c[p>>2]&24|0)==8){a=c[p>>2]|0;i=j;return a|0}Se(c[k>>2]|0,24720,l);c[p>>2]=1;a=c[p>>2]|0;i=j;return a|0}c[n>>2]=9912;if(!(c[o>>2]|0))c[n>>2]=(c[n>>2]|0)+1;a=c[k>>2]|0;f=c[m>>2]|0;e=c[n>>2]|0;b=c[o>>2]|0;c[l>>2]=c[g>>2];c[l+4>>2]=f;c[l+8>>2]=e;c[l+12>>2]=b;Se(a,24672,l);c[p>>2]=1;a=c[p>>2]|0;i=j;return a|0}function mo(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0;f=i;i=i+16|0;g=f+4|0;h=f;j=f+8|0;c[g>>2]=b;c[h>>2]=d;a[j>>0]=e;if(!(c[h>>2]|0)){i=f;return}c[(c[h>>2]|0)+4>>2]=c[(c[g>>2]|0)+532>>2];c[(c[g>>2]|0)+532>>2]=c[h>>2];a[(c[g>>2]|0)+449>>0]=a[j>>0]|0;i=f;return}function no(e,f,g){e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0;n=i;i=i+192|0;q=n+172|0;k=n+168|0;l=n+164|0;o=n+160|0;s=n+156|0;U=n+152|0;j=n+148|0;L=n+144|0;r=n+140|0;I=n+136|0;z=n+132|0;h=n+128|0;R=n+124|0;v=n+120|0;y=n+112|0;T=n+80|0;O=n+76|0;p=n+72|0;S=n+68|0;E=n+64|0;Q=n+56|0;m=n+52|0;x=n+48|0;M=n+44|0;N=n+178|0;H=n+40|0;D=n+176|0;t=n+36|0;G=n+32|0;F=n+28|0;u=n+24|0;K=n+20|0;P=n+16|0;w=n+12|0;A=n+8|0;C=n+4|0;B=n;c[q>>2]=e;c[k>>2]=f;c[l>>2]=g;c[p>>2]=-1;c[m>>2]=0;c[M>>2]=0;b[N>>1]=1;c[t>>2]=0;c[G>>2]=0;c[F>>2]=0;c[u>>2]=0;c[K>>2]=0;c[P>>2]=0;c[y+0>>2]=0;c[y+4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>>2]|0,c[F>>2]|0);while(0);if(c[w>>2]|0)break;if(d[(c[s>>2]|0)+44>>0]&16)break;if(!(c[x>>2]|0))Ir(c[o>>2]|0,61,c[z>>2]|0)|0;c[j>>2]=0;c[r>>2]=c[(c[s>>2]|0)+8>>2];while(1){if(!(c[r>>2]|0))break c;Ir(c[o>>2]|0,61,(c[h>>2]|0)+(c[j>>2]|0)|0)|0;c[j>>2]=(c[j>>2]|0)+1;c[r>>2]=c[(c[r>>2]|0)+20>>2]}}while(0);if((d[(c[q>>2]|0)+18>>0]|0)==0?(c[(c[q>>2]|0)+412>>2]|0)==0:0)Au(c[q>>2]|0);if(((c[(c[v>>2]|0)+24>>2]&128|0)!=0?(a[(c[q>>2]|0)+18>>0]|0)==0:0)?(c[(c[q>>2]|0)+412>>2]|0)==0:0){fp(c[o>>2]|0,35,c[p>>2]|0,1)|0;Nt(c[o>>2]|0,1);Ot(c[o>>2]|0,0,0,24592,0)|0}}}}while(0);lx(y);vn(c[v>>2]|0,c[k>>2]|0);wn(c[v>>2]|0,c[l>>2]|0);Xb(c[v>>2]|0,c[m>>2]|0);i=n;return}function oo(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+32|0;h=e;f=e+16|0;j=e+12|0;g=e+8|0;k=e+4|0;c[f>>2]=a;c[j>>2]=b;c[g>>2]=d;c[k>>2]=c[(c[c[f>>2]>>2]|0)+96>>2];if(!(c[j>>2]|0)){i=e;return}if((c[c[j>>2]>>2]|0)<=(c[k>>2]|0)){i=e;return}a=c[f>>2]|0;c[h>>2]=c[g>>2];Se(a,24568,h);i=e;return}function po(f,g,h,j,k){f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0;y=i;i=i+256|0;la=y;u=y+244|0;o=y+240|0;n=y+236|0;z=y+232|0;H=y+228|0;t=y+224|0;W=y+220|0;r=y+216|0;B=y+212|0;ea=y+208|0;x=y+204|0;D=y+200|0;s=y+196|0;ca=y+192|0;fa=y+188|0;C=y+184|0;l=y+180|0;v=y+176|0;R=y+172|0;p=y+168|0;E=y+164|0;ba=y+252|0;_=y+251|0;M=y+250|0;aa=y+160|0;q=y+152|0;ja=y+120|0;na=y+112|0;Q=y+108|0;K=y+104|0;A=y+100|0;F=y+96|0;S=y+92|0;I=y+88|0;X=y+84|0;Y=y+80|0;m=y+76|0;P=y+72|0;da=y+64|0;w=y+56|0;N=y+52|0;O=y+48|0;U=y+44|0;V=y+40|0;$=y+36|0;J=y+32|0;ma=y+28|0;ka=y+24|0;ia=y+20|0;ha=y+248|0;ga=y+16|0;Z=y+12|0;G=y+8|0;L=y+4|0;c[u>>2]=f;c[o>>2]=g;c[n>>2]=h;c[z>>2]=j;c[H>>2]=k;c[B>>2]=0;c[R>>2]=0;c[p>>2]=0;c[aa>>2]=0;c[m>>2]=0;c[P>>2]=0;c[w>>2]=0;c[V>>2]=0;c[$>>2]=0;c[J>>2]=0;c[q+0>>2]=0;c[q+4>>2]=0;c[v>>2]=c[c[u>>2]>>2];if(c[(c[u>>2]|0)+64>>2]|0){lx(q);f=c[v>>2]|0;g=c[p>>2]|0;Xb(f,g);g=c[v>>2]|0;f=c[o>>2]|0;vn(g,f);f=c[v>>2]|0;g=c[n>>2]|0;sn(f,g);g=c[v>>2]|0;f=c[z>>2]|0;wn(g,f);i=y;return}if(d[(c[v>>2]|0)+64>>0]|0){lx(q);f=c[v>>2]|0;g=c[p>>2]|0;Xb(f,g);g=c[v>>2]|0;f=c[o>>2]|0;vn(g,f);f=c[v>>2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>>2]|0)*20|0)+4>>2]|0)|0)==0;k=c[W>>2]|0;if(f){T=23;break}c[W>>2]=k+1}if((T|0)==23){T=0;if((k|0)!=(b[(c[r>>2]|0)+36>>1]|0)){if((c[s>>2]|0)!=0?(d[(c[(c[r>>2]|0)+4>>2]|0)+((c[W>>2]|0)*24|0)+23>>0]&1|0)!=0:0)a[ba>>0]=1}else{a[_>>0]=1;c[aa>>2]=c[(c[(c[n>>2]|0)+4>>2]|0)+((c[t>>2]|0)*20|0)>>2]}c[(c[p>>2]|0)+(c[W>>2]<<2)>>2]=c[t>>2]}if((c[W>>2]|0)>=(b[(c[r>>2]|0)+38>>1]|0)){if(c[s>>2]|0){T=34;break}if(!(Zq(c[(c[(c[n>>2]|0)+4>>2]|0)+((c[t>>2]|0)*20|0)+4>>2]|0)|0)){T=34;break}c[W>>2]=-1;a[_>>0]=1;c[aa>>2]=c[(c[(c[n>>2]|0)+4>>2]|0)+((c[t>>2]|0)*20|0)>>2]}if((c[W>>2]|0)<0)k=17288;else k=c[(c[(c[r>>2]|0)+4>>2]|0)+((c[W>>2]|0)*24|0)>>2]|0;c[ma>>2]=ap(c[u>>2]|0,23,c[c[r>>2]>>2]|0,k,c[(c[(c[v>>2]|0)+16>>2]|0)+(c[na>>2]<<4)>>2]|0)|0;if((c[ma>>2]|0)==1){T=182;break}if((c[ma>>2]|0)==2)c[(c[p>>2]|0)+(c[W>>2]<<2)>>2]=-1;c[t>>2]=(c[t>>2]|0)+1}if((T|0)==34){f=c[u>>2]|0;c[la>>2]=c[(c[(c[n>>2]|0)+4>>2]|0)+((c[t>>2]|0)*20|0)+4>>2];Se(f,24520,la);a[(c[u>>2]|0)+17>>0]=1;lx(q);f=c[v>>2]|0;g=c[p>>2]|0;Xb(f,g);g=c[v>>2]|0;f=c[o>>2]|0;vn(g,f);f=c[v>>2]|0;g=c[n>>2]|0;sn(f,g);g=c[v>>2]|0;f=c[z>>2]|0;wn(g,f);i=y;return}else if((T|0)==41){a[M>>0]=(d[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,c[H>>2]|0)|0;c[t>>2]=0;while(1){if((c[t>>2]|0)>=(b[(c[r>>2]|0)+38>>1]|0))break;c:do if((c[t>>2]|0)==(b[(c[r>>2]|0)+36>>1]|0))fp(c[x>>2]|0,28,0,(c[U>>2]|0)+(c[t>>2]|0)|0)|0;else{c[W>>2]=c[(c[p>>2]|0)+(c[t>>2]<<2)>>2];if((c[W>>2]|0)>=0){Os(c[u>>2]|0,c[(c[(c[n>>2]|0)+4>>2]|0)+((c[W>>2]|0)*20|0)>>2]|0,(c[U>>2]|0)+(c[t>>2]|0)|0);break}do if(!((c[t>>2]|0)>31?1:0==(c[X>>2]&1|0))){if(c[Y>>2]&1<<c[t>>2])break;fp(c[x>>2]|0,28,0,(c[U>>2]|0)+(c[t>>2]|0)|0)|0;break c}while(0);zs(c[x>>2]|0,c[r>>2]|0,c[C>>2]|0,c[t>>2]|0,(c[U>>2]|0)+(c[t>>2]|0)|0)}while(0);c[t>>2]=(c[t>>2]|0)+1}d:do if(c[X>>2]&1){su(c[x>>2]|0,c[r>>2]|0,c[U>>2]|0);tu(c[u>>2]|0,c[I>>2]|0,110,c[n>>2]|0,1,c[r>>2]|0,c[N>>2]|0,c[H>>2]|0,c[F>>2]|0);X=c[x>>2]|0;W=c[C>>2]|0;V=c[F>>2]|0;if(c[s>>2]|0)We(X,68,W,V,c[J>>2]|0,c[P>>2]|0)|0;else ip(X,70,W,V,c[N>>2]|0)|0;c[t>>2]=0;while(1){if((c[t>>2]|0)>=(b[(c[r>>2]|0)+38>>1]|0))break d;do if((c[(c[p>>2]|0)+(c[t>>2]<<2)>>2]|0)<0){if((c[t>>2]|0)==(b[(c[r>>2]|0)+36>>1]|0))break;zs(c[x>>2]|0,c[r>>2]|0,c[C>>2]|0,c[t>>2]|0,(c[U>>2]|0)+(c[t>>2]|0)|0)}while(0);c[t>>2]=(c[t>>2]|0)+1}}while(0);do if(!(c[S>>2]|0)){c[G>>2]=0;c[L>>2]=0;xu(c[u>>2]|0,c[r>>2]|0,c[R>>2]|0,c[C>>2]|0,c[l>>2]|0,c[O>>2]|0,c[N>>2]|0,a[M>>0]|0,c[H>>2]&255,c[F>>2]|0,L);if(c[K>>2]|0)yu(c[u>>2]|0,c[r>>2]|0,c[N>>2]|0,0,c[p>>2]|0,d[M>>0]|0);if(!((c[L>>2]|0)==0?(d[M>>0]|0)==0:0))T=148;do if((T|0)==148){T=c[x>>2]|0;S=c[C>>2]|0;if(c[s>>2]|0){c[G>>2]=We(T,68,S,0,c[J>>2]|0,c[P>>2]|0)|0;break}else{c[G>>2]=ip(T,70,S,0,c[N>>2]|0)|0;break}}while(0);fw(c[u>>2]|0,c[r>>2]|0,c[C>>2]|0,c[l>>2]|0,c[R>>2]|0);if(!((c[K>>2]|0)==0?!((d[M>>0]|0)!=0|(c[s>>2]|0)!=0):0))fp(c[x>>2]|0,95,c[C>>2]|0,0)|0;if(!((c[L>>2]|0)==0?(d[M>>0]|0)==0:0))zp(c[x>>2]|0,c[G>>2]|0);if(c[K>>2]|0)yu(c[u>>2]|0,c[r>>2]|0,0,c[O>>2]|0,c[p>>2]|0,d[M>>0]|0);zu(c[u>>2]|0,c[r>>2]|0,c[C>>2]|0,c[l>>2]|0,c[O>>2]|0,c[R>>2]|0,1,0,0);if(!(c[K>>2]|0))break;iw(c[u>>2]|0,c[r>>2]|0,c[n>>2]|0,c[N>>2]|0,c[p>>2]|0,d[M>>0]|0)}while(0);do if(c[(c[v>>2]|0)+24>>2]&128){if(c[(c[u>>2]|0)+412>>2]|0)break;fp(c[x>>2]|0,37,c[w>>2]|0,1)|0}while(0);tu(c[u>>2]|0,c[I>>2]|0,110,c[n>>2]|0,2,c[r>>2]|0,c[N>>2]|0,c[H>>2]|0,c[F>>2]|0);do if(!(c[Q>>2]|0)){G=c[x>>2]|0;F=c[F>>2]|0;if(c[s>>2]|0){Pr(G,F);fp(c[x>>2]|0,9,c[m>>2]|0,c[B>>2]|0)|0;break}else{fp(G,16,0,F)|0;break}}while(0);Pr(c[x>>2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|0)==182){lx(q);f=c[v>>2]|0;g=c[p>>2]|0;Xb(f,g);g=c[v>>2]|0;f=c[o>>2]|0;vn(g,f);f=c[v>>2]|0;g=c[n>>2]|0;sn(f,g);g=c[v>>2]|0;f=c[z>>2]|0;wn(g,f);i=y;return}}\n\n\n\nfunction Ys(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0;B=i;i=i+160|0;J=B;k=B+140|0;l=B+136|0;p=B+132|0;q=B+128|0;x=B+124|0;o=B+120|0;m=B+116|0;n=B+112|0;K=B+108|0;h=B+144|0;r=B+104|0;G=B+100|0;s=B+96|0;F=B+92|0;E=B+72|0;D=B+68|0;z=B+64|0;C=B+60|0;y=B+56|0;t=B+52|0;u=B+48|0;A=B+44|0;w=B+40|0;v=B+36|0;I=B+32|0;H=B+12|0;c[l>>2]=b;c[p>>2]=e;c[q>>2]=f;c[x>>2]=g;c[o>>2]=-1;c[m>>2]=0;c[n>>2]=dp(c[l>>2]|0)|0;if(!(c[n>>2]|0)){c[k>>2]=0;b=c[k>>2]|0;i=B;return b|0}ws(c[l>>2]|0);if(!(c[(c[p>>2]|0)+4>>2]&32))c[o>>2]=_s(c[l>>2]|0)|0;if((d[(c[l>>2]|0)+450>>0]|0)==2){b=c[c[l>>2]>>2]|0;f=(d[c[p>>2]>>0]|0)==75?19296:19304;e=c[(c[l>>2]|0)+468>>2]|0;c[J>>2]=(c[o>>2]|0)>=0?1216:19280;c[J+4>>2]=f;c[J+8>>2]=e;c[K>>2]=Te(b,19248,J)|0;hp(c[n>>2]|0,155,c[(c[l>>2]|0)+464>>2]|0,0,0,c[K>>2]|0,-1)|0}J=c[p>>2]|0;do if((d[c[p>>2]>>0]|0)==75){c[G>>2]=c[J+12>>2];c[s>>2]=0;a[h>>0]=bq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>2]|0,c[u>>2]|0)|0;break}}while(0);c[z>>2]=(c[z>>2]|0)+ -1;c[y>>2]=(c[y>>2]|0)+20}lp(c[l>>2]|0,c[t>>2]|0);lp(c[l>>2]|0,c[u>>2]|0)}}else{c[F>>2]=c[G>>2];$s(E,11,c[(c[p>>2]|0)+28>>2]|0);a[E+1>>0]=a[h>>0]|0;c[(c[F>>2]|0)+8>>2]=0;if(!(ao(c[l>>2]|0,c[F>>2]|0,E)|0)){c[D>>2]=c[c[F>>2]>>2];b=at(c[l>>2]|0,c[(c[p>>2]|0)+12>>2]|0,c[c[(c[D>>2]|0)+4>>2]>>2]|0)|0;c[(c[s>>2]|0)+20>>2]=b;break}eh(c[s>>2]|0);c[k>>2]=0;b=c[k>>2]|0;i=B;return b|0}while(0);if(c[s>>2]|0)bf(c[n>>2]|0,c[r>>2]|0,c[s>>2]|0,-6)}else{c[I>>2]=c[J+20>>2];e=(c[l>>2]|0)+72|0;b=(c[e>>2]|0)+1|0;c[e>>2]=b;$s(H,0,b);if((d[c[p>>2]>>0]|0)==119){a[H>>0]=10;c[H+8>>2]=c[H+4>>2];fp(c[n>>2]|0,28,0,c[H+4>>2]|0)|0}else{a[H>>0]=3;fp(c[n>>2]|0,25,0,c[H+4>>2]|0)|0}wn(c[c[l>>2]>>2]|0,c[(c[I>>2]|0)+60>>2]|0);b=Rn(c[l>>2]|0,132,0,0,10160)|0;c[(c[I>>2]|0)+60>>2]=b;c[(c[I>>2]|0)+8>>2]=0;if(!(ao(c[l>>2]|0,c[I>>2]|0,H)|0)){c[m>>2]=c[H+4>>2];break}c[k>>2]=0;b=c[k>>2]|0;i=B;return b|0}while(0);if(c[q>>2]|0)bt(c[n>>2]|0,c[(c[p>>2]|0)+28>>2]|0,c[q>>2]|0);if((c[o>>2]|0)>=0)zp(c[n>>2]|0,c[o>>2]|0);us(c[l>>2]|0);c[k>>2]=c[m>>2];b=c[k>>2]|0;i=B;return b|0}function Zs(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+16|0;f=e+4|0;g=e;c[f>>2]=b;c[g>>2]=d;a[(c[f>>2]|0)+38>>0]=a[c[f>>2]>>0]|0;a[c[f>>2]>>0]=-97;c[(c[f>>2]|0)+28>>2]=c[g>>2];b=(c[f>>2]|0)+4|0;c[b>>2]=c[b>>2]&-4097;i=e;return}function _s(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;c[d>>2]=dp(c[e>>2]|0)|0;d=c[d>>2]|0;e=(c[e>>2]|0)+80|0;a=c[e>>2]|0;c[e>>2]=a+1;a=Ir(d,44,a)|0;i=b;return a|0}function $s(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0;f=i;i=i+16|0;g=f+8|0;j=f+4|0;h=f;c[g>>2]=b;c[j>>2]=d;c[h>>2]=e;a[c[g>>2]>>0]=c[j>>2];c[(c[g>>2]|0)+4>>2]=c[h>>2];a[(c[g>>2]|0)+1>>0]=0;c[(c[g>>2]|0)+8>>2]=0;c[(c[g>>2]|0)+12>>2]=0;i=f;return}function at(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;h=e+12|0;g=e+8|0;j=e+4|0;f=e;c[h>>2]=a;c[g>>2]=b;c[j>>2]=d;if(c[(c[g>>2]|0)+4>>2]&256){c[f>>2]=cq(c[h>>2]|0,c[g>>2]|0)|0;a=c[f>>2]|0;i=e;return a|0}if((c[j>>2]|0)!=0?(c[(c[j>>2]|0)+4>>2]&256|0)!=0:0){c[f>>2]=cq(c[h>>2]|0,c[j>>2]|0)|0;a=c[f>>2]|0;i=e;return a|0}c[f>>2]=cq(c[h>>2]|0,c[g>>2]|0)|0;if(c[f>>2]|0){a=c[f>>2]|0;i=e;return a|0}c[f>>2]=cq(c[h>>2]|0,c[j>>2]|0)|0;a=c[f>>2]|0;i=e;return a|0}function bt(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=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;return b|0}return 0}function et(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=i;i=i+32|0;f=e+28|0;g=e+24|0;d=e;c[f>>2]=a;c[g>>2]=b;c[d+0>>2]=0;c[d+4>>2]=0;c[d+8>>2]=0;c[d+12>>2]=0;c[d+16>>2]=0;c[d+20>>2]=0;c[d+20>>2]=c[g>>2];c[d>>2]=44;c[d+4>>2]=45;sq(d,c[f>>2]|0)|0;i=e;return c[d+20>>2]|0}function ft(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0;f=i;i=i+16|0;g=f+8|0;h=f+4|0;j=f;c[h>>2]=b;c[j>>2]=e;if((c[(c[h>>2]|0)+20>>2]|0)==2?(c[(c[j>>2]|0)+4>>2]&1|0)!=0:0){c[(c[h>>2]|0)+20>>2]=0;c[g>>2]=2;b=c[g>>2]|0;i=f;return b|0}a:do switch(d[c[j>>2]>>0]|0|0){case 153:{if((c[(c[h>>2]|0)+20>>2]|0)<3?(c[(c[j>>2]|0)+4>>2]&524288|0)==0:0){e=8;break a}c[g>>2]=0;b=c[g>>2]|0;i=f;return b|0};case 135:{if((c[(c[h>>2]|0)+20>>2]|0)==4){a[c[j>>2]>>0]=101;e=13;break a}if((c[(c[h>>2]|0)+20>>2]|0)==3){c[(c[h>>2]|0)+20>>2]=0;c[g>>2]=2;b=c[g>>2]|0;i=f;return b|0}else e=13;break};case 156:case 155:case 154:case 27:{e=8;break};default:e=13}while(0);if((e|0)==8){c[(c[h>>2]|0)+20>>2]=0;c[g>>2]=2;b=c[g>>2]|0;i=f;return b|0}else if((e|0)==13){c[g>>2]=0;b=c[g>>2]|0;i=f;return b|0}return 0}function gt(a,b){a=a|0;b=b|0;var d=0,e=0;d=i;i=i+16|0;e=d+4|0;c[e>>2]=a;c[d>>2]=b;c[(c[e>>2]|0)+20>>2]=0;i=d;return 2}function ht(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;h=e+8|0;g=e+4|0;f=e;c[h>>2]=b;c[g>>2]=d;c[f>>2]=Qe(Fs(c[h>>2]|0)|0,8,0)|0;if(!(c[f>>2]|0)){h=c[f>>2]|0;i=e;return h|0}h=c[f>>2]|0;b=c[g>>2]|0;a[h+0>>0]=a[b+0>>0]|0;a[h+1>>0]=a[b+1>>0]|0;a[h+2>>0]=a[b+2>>0]|0;a[h+3>>0]=a[b+3>>0]|0;a[h+4>>0]=a[b+4>>0]|0;a[h+5>>0]=a[b+5>>0]|0;a[h+6>>0]=a[b+6>>0]|0;a[h+7>>0]=a[b+7>>0]|0;h=c[f>>2]|0;i=e;return h|0}function it(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;j=e+12|0;g=e+8|0;h=e+4|0;f=e;c[j>>2]=b;c[g>>2]=d;c[h>>2]=0;c[f>>2]=(c[j>>2]|0)+116;while(1){if((c[h>>2]|0)>=10)break;if((c[(c[f>>2]|0)+12>>2]|0)==(c[g>>2]|0))a[(c[f>>2]|0)+6>>0]=0;c[h>>2]=(c[h>>2]|0)+1;c[f>>2]=(c[f>>2]|0)+20}i=e;return}function jt(d,f,g,h){d=d|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;q=i;i=i+32|0;l=q+28|0;o=q+24|0;p=q+20|0;j=q+16|0;r=q+12|0;s=q+8|0;m=q+4|0;n=q;c[l>>2]=d;c[o>>2]=f;c[p>>2]=g;c[j>>2]=h;if((e[(c[c[l>>2]>>2]|0)+60>>1]|0)&2){i=q;return}c[r>>2]=0;c[n>>2]=(c[l>>2]|0)+116;while(1){if((c[r>>2]|0)>=10)break;if(!(c[(c[n>>2]|0)+12>>2]|0)){k=5;break}c[r>>2]=(c[r>>2]|0)+1;c[n>>2]=(c[n>>2]|0)+20}if((k|0)==5){c[(c[n>>2]|0)+8>>2]=c[(c[l>>2]|0)+100>>2];c[c[n>>2]>>2]=c[o>>2];b[(c[n>>2]|0)+4>>1]=c[p>>2];c[(c[n>>2]|0)+12>>2]=c[j>>2];a[(c[n>>2]|0)+6>>0]=0;f=(c[l>>2]|0)+104|0;d=c[f>>2]|0;c[f>>2]=d+1;c[(c[n>>2]|0)+16>>2]=d;i=q;return}c[s>>2]=2147483647;c[m>>2]=-1;c[r>>2]=0;c[n>>2]=(c[l>>2]|0)+116;while(1){if((c[r>>2]|0)>=10)break;if((c[(c[n>>2]|0)+16>>2]|0)<(c[s>>2]|0)){c[m>>2]=c[r>>2];c[s>>2]=c[(c[n>>2]|0)+16>>2]}c[r>>2]=(c[r>>2]|0)+1;c[n>>2]=(c[n>>2]|0)+20}if((c[m>>2]|0)<0){i=q;return}c[n>>2]=(c[l>>2]|0)+116+((c[m>>2]|0)*20|0);c[(c[n>>2]|0)+8>>2]=c[(c[l>>2]|0)+100>>2];c[c[n>>2]>>2]=c[o>>2];b[(c[n>>2]|0)+4>>1]=c[p>>2];c[(c[n>>2]|0)+12>>2]=c[j>>2];a[(c[n>>2]|0)+6>>0]=0;f=(c[l>>2]|0)+104|0;d=c[f>>2]|0;c[f>>2]=d+1;c[(c[n>>2]|0)+16>>2]=d;i=q;return}function kt(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;f=e+6|0;j=e;g=e+5|0;h=e+4|0;c[j>>2]=b;a[g>>0]=d;a[h>>0]=bq(c[j>>2]|0)|0;if((a[h>>0]|0)!=0?(a[g>>0]|0)!=0:0){if((a[h>>0]|0)<67?(a[g>>0]|0)<67:0){a[f>>0]=65;j=a[f>>0]|0;i=e;return j|0}a[f>>0]=67;j=a[f>>0]|0;i=e;return j|0}if((a[h>>0]|0)!=0|(a[g>>0]|0)!=0){a[f>>0]=(a[h>>0]|0)+(a[g>>0]|0);j=a[f>>0]|0;i=e;return j|0}else{a[f>>0]=65;j=a[f>>0]|0;i=e;return j|0}return 0}function lt(a){a=a|0;var b=0,f=0,g=0,h=0,j=0,k=0;f=i;i=i+32|0;b=f+16|0;g=f+12|0;k=f+8|0;h=f+4|0;j=f;c[g>>2]=a;do if(c[g>>2]|0){if(c[(c[g>>2]|0)+52>>2]|0){c[b>>2]=0;break}if((e[(c[g>>2]|0)+6>>1]|0)&5){c[b>>2]=0;break}if(c[(c[g>>2]|0)+60>>2]|0){c[b>>2]=0;break}if(c[(c[g>>2]|0)+36>>2]|0){c[b>>2]=0;break}c[k>>2]=c[(c[g>>2]|0)+32>>2];if((c[c[k>>2]>>2]|0)!=1){c[b>>2]=0;break}if(c[(c[k>>2]|0)+28>>2]|0){c[b>>2]=0;break}c[j>>2]=c[(c[k>>2]|0)+24>>2];if(!(c[j>>2]|0)){c[b>>2]=0;break}if((d[(c[j>>2]|0)+44>>0]|0)&16){c[b>>2]=0;break}c[h>>2]=c[c[g>>2]>>2];if((c[c[h>>2]>>2]|0)!=1){c[b>>2]=0;break}if((d[c[c[(c[h>>2]|0)+4>>2]>>2]>>0]|0|0)!=154){c[b>>2]=0;break}else{c[b>>2]=1;break}}else c[b>>2]=0;while(0);i=f;return c[b>>2]|0}function mt(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;f=i;i=i+16|0;e=f+4|0;j=f;g=f+9|0;h=f+8|0;c[j>>2]=b;a[g>>0]=d;a[h>>0]=Ns(c[j>>2]|0)|0;d=a[h>>0]|0;if((d|0)==66)c[e>>2]=(a[g>>0]|0)==66&1;else if((d|0)==65)c[e>>2]=1;else c[e>>2]=(a[g>>0]|0)>=67&1;i=f;return c[e>>2]|0}function nt(a){a=a|0;var b=0,d=0,e=0,f=0;d=i;i=i+16|0;e=d+8|0;f=d+4|0;b=d;c[e>>2]=a;c[f>>2]=c[(c[e>>2]|0)+12>>2];c[(c[e>>2]|0)+12>>2]=0;c[b>>2]=Vs(c[e>>2]|0)|0;c[(c[e>>2]|0)+12>>2]=c[f>>2];i=d;return c[b>>2]|0}function ot(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;g=i;i=i+16|0;j=g+8|0;k=g+4|0;h=g;f=g+12|0;c[j>>2]=b;c[k>>2]=d;c[h>>2]=e;a[f>>0]=bq(c[k>>2]|0)|0;b=(kt(c[j>>2]|0,a[f>>0]|0)|0)&255;a[f>>0]=b|c[h>>2]&255;i=g;return a[f>>0]|0}function pt(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=et(c[d>>2]|0,2)|0;i=b;return a|0}function qt(a,d){a=a|0;d=d|0;var f=0,g=0,h=0,j=0,k=0,l=0;g=i;i=i+32|0;f=g+16|0;j=g+12|0;k=g+8|0;l=g+4|0;h=g;c[j>>2]=a;c[k>>2]=d;c[l>>2]=0;while(1){if((c[l>>2]|0)>=(e[(c[k>>2]|0)+52>>1]|0)){d=7;break}c[h>>2]=c[(c[(c[k>>2]|0)+32>>2]|0)+(c[l>>2]<<2)>>2];if((b[(c[(c[k>>2]|0)+4>>2]|0)+(c[l>>2]<<1)>>1]|0)>=0?0==(xc(c[h>>2]|0,c[j>>2]|0)|0):0){d=5;break}c[l>>2]=(c[l>>2]|0)+1}if((d|0)==5){c[f>>2]=1;a=c[f>>2]|0;i=g;return a|0}else if((d|0)==7){c[f>>2]=0;a=c[f>>2]|0;i=g;return a|0}return 0}function rt(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;h=i;i=i+160|0;f=h;k=h+28|0;o=h+20|0;j=h+16|0;m=h+12|0;l=h+8|0;n=h+4|0;g=h+32|0;c[k>>2]=b;c[h+24>>2]=d;c[o>>2]=e;c[j>>2]=Ed(c[c[o>>2]>>2]|0)|0;c[m>>2]=pe(c[k>>2]|0)|0;c[n>>2]=0;if(!(c[j>>2]|0))c[j>>2]=1216;c[l>>2]=0;while(1){if((c[l>>2]|0)>=(c[(c[m>>2]|0)+20>>2]|0))break;c[n>>2]=(c[(c[m>>2]|0)+16>>2]|0)+(c[l>>2]<<4);if((c[(c[n>>2]|0)+4>>2]|0)!=0?(xc(c[c[n>>2]>>2]|0,c[j>>2]|0)|0)==0:0)break;c[l>>2]=(c[l>>2]|0)+1}do if((c[l>>2]|0)>=(c[(c[m>>2]|0)+20>>2]|0)){c[f>>2]=c[j>>2];sc(128,g,19424,f)|0}else{if((c[l>>2]|0)<2){c[f>>2]=c[j>>2];sc(128,g,19448,f)|0;break}if(!(a[(c[m>>2]|0)+62>>0]|0)){sc(128,g,19480,f)|0;break}if((Tc(c[(c[n>>2]|0)+4>>2]|0)|0)==0?(Wk(c[(c[n>>2]|0)+4>>2]|0)|0)==0:0){Kk(c[(c[n>>2]|0)+4>>2]|0)|0;c[(c[n>>2]|0)+4>>2]=0;c[(c[n>>2]|0)+12>>2]=0;cd(c[m>>2]|0);i=h;return}c[f>>2]=c[j>>2];sc(128,g,19528,f)|0}while(0);Ud(c[k>>2]|0,g,-1);i=h;return}function st(a,e,f,g,h,j,k){a=a|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;y=i;i=i+80|0;q=y+76|0;p=y+72|0;o=y+68|0;l=y+64|0;r=y+60|0;s=y+56|0;t=y+52|0;v=y+48|0;z=y+16|0;w=y+12|0;x=y+8|0;n=y+4|0;u=y;c[q>>2]=a;c[p>>2]=e;c[o>>2]=f;c[l>>2]=g;c[r>>2]=h;c[s>>2]=j;c[t>>2]=k;c[x>>2]=c[c[q>>2]>>2];c[z+0>>2]=0;c[z+4>>2]=0;c[z+8>>2]=0;c[z+12>>2]=0;c[z+16>>2]=0;c[z+20>>2]=0;c[z+24>>2]=0;c[z+28>>2]=0;c[z>>2]=c[q>>2];a=tt(z,c[r>>2]|0)|0;c[v>>2]=a;do if((0==(a|0)?(a=tt(z,c[s>>2]|0)|0,c[v>>2]=a,0==(a|0)):0)?(a=tt(z,c[t>>2]|0)|0,c[v>>2]=a,0==(a|0)):0){if(c[l>>2]|0){if((d[c[l>>2]>>0]|0)==97)c[u>>2]=c[(c[l>>2]|0)+8>>2];else c[u>>2]=0;c[v>>2]=ap(c[q>>2]|0,c[p>>2]|0,c[u>>2]|0,0,0)|0;if(c[v>>2]|0)break}c[w>>2]=dp(c[q>>2]|0)|0;c[n>>2]=ys(c[q>>2]|0,4)|0;Os(c[q>>2]|0,c[r>>2]|0,c[n>>2]|0);Os(c[q>>2]|0,c[s>>2]|0,(c[n>>2]|0)+1|0);Os(c[q>>2]|0,c[t>>2]|0,(c[n>>2]|0)+2|0);if(c[w>>2]|0){ip(c[w>>2]|0,1,0,(c[n>>2]|0)+3-(b[c[o>>2]>>1]|0)|0,(c[n>>2]|0)+3|0)|0;Xe(c[w>>2]|0,b[c[o>>2]>>1]&255);bf(c[w>>2]|0,-1,c[o>>2]|0,-5);Ir(c[w>>2]|0,142,(c[p>>2]|0)==24&1)|0}}else m=4;while(0);if((m|0)==4){a=(c[q>>2]|0)+64|0;c[a>>2]=(c[a>>2]|0)+1}wn(c[x>>2]|0,c[r>>2]|0);wn(c[x>>2]|0,c[s>>2]|0);wn(c[x>>2]|0,c[t>>2]|0);i=y;return}function tt(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0;g=i;i=i+16|0;j=g+8|0;h=g+4|0;f=g;c[j>>2]=b;c[h>>2]=e;c[f>>2]=0;do if(c[h>>2]|0)if((d[c[h>>2]>>0]|0|0)!=27){c[f>>2]=vq(c[j>>2]|0,c[h>>2]|0)|0;break}else{a[c[h>>2]>>0]=97;break}while(0);i=g;return c[f>>2]|0}function ut(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;k=i;i=i+80|0;j=k;l=k+68|0;z=k+60|0;x=k+56|0;n=k+52|0;o=k+48|0;p=k+44|0;u=k+40|0;t=k+36|0;m=k+32|0;h=k+28|0;g=k+24|0;r=k+20|0;s=k+16|0;y=k+12|0;q=k+8|0;v=k+4|0;c[l>>2]=b;c[k+64>>2]=e;c[z>>2]=f;c[n>>2]=0;c[o>>2]=pe(c[l>>2]|0)|0;c[t>>2]=0;c[m>>2]=0;c[r>>2]=0;c[u>>2]=Ed(c[c[z>>2]>>2]|0)|0;c[p>>2]=Ed(c[(c[z>>2]|0)+4>>2]|0)|0;if(!(c[u>>2]|0))c[u>>2]=1216;if(!(c[p>>2]|0))c[p>>2]=1216;f=c[o>>2]|0;do if((c[(c[o>>2]|0)+20>>2]|0)<((c[(c[o>>2]|0)+116>>2]|0)+2|0)){if(!(a[f+62>>0]|0)){c[r>>2]=Te(c[o>>2]|0,19648,j)|0;break}c[x>>2]=0;while(1){if((c[x>>2]|0)>=(c[(c[o>>2]|0)+20>>2]|0))break;c[y>>2]=c[(c[(c[o>>2]|0)+16>>2]|0)+(c[x>>2]<<4)>>2];if(!(xc(c[y>>2]|0,c[p>>2]|0)|0)){w=12;break}c[x>>2]=(c[x>>2]|0)+1}if((w|0)==12){z=c[o>>2]|0;c[j>>2]=c[p>>2];c[r>>2]=Te(z,19696,j)|0;break}w=c[o>>2]|0;do if((c[(c[o>>2]|0)+16>>2]|0)==((c[o>>2]|0)+456|0)){c[g>>2]=Qe(w,48,0)|0;if(!(c[g>>2]|0)){i=k;return}else{z=c[g>>2]|0;b=c[(c[o>>2]|0)+16>>2]|0;c[z+0>>2]=c[b+0>>2];c[z+4>>2]=c[b+4>>2];c[z+8>>2]=c[b+8>>2];c[z+12>>2]=c[b+12>>2];c[z+16>>2]=c[b+16>>2];c[z+20>>2]=c[b+20>>2];c[z+24>>2]=c[b+24>>2];c[z+28>>2]=c[b+28>>2];break}}else{c[g>>2]=Fk(w,c[(c[o>>2]|0)+16>>2]|0,(c[(c[o>>2]|0)+20>>2]|0)+1<<4,0)|0;if(!(c[g>>2]|0)){i=k;return}}while(0);c[(c[o>>2]|0)+16>>2]=c[g>>2];c[g>>2]=(c[(c[o>>2]|0)+16>>2]|0)+(c[(c[o>>2]|0)+20>>2]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)==0:0)c[n>>2]=7;if(!(c[n>>2]|0)){Rb(c[o>>2]|0);c[n>>2]=_r(c[o>>2]|0,r)|0}if(!(c[n>>2]|0)){i=k;return}c[v>>2]=(c[(c[o>>2]|0)+20>>2]|0)-1;if(c[(c[(c[o>>2]|0)+16>>2]|0)+(c[v>>2]<<4)+4>>2]|0){Kk(c[(c[(c[o>>2]|0)+16>>2]|0)+(c[v>>2]<<4)+4>>2]|0)|0;c[(c[(c[o>>2]|0)+16>>2]|0)+(c[v>>2]<<4)+4>>2]=0;c[(c[(c[o>>2]|0)+16>>2]|0)+(c[v>>2]<<4)+12>>2]=0}cd(c[o>>2]|0);c[(c[o>>2]|0)+20>>2]=c[v>>2];if((c[n>>2]|0)==7|(c[n>>2]|0)==3082){a[(c[o>>2]|0)+64>>0]=1;Xb(c[o>>2]|0,c[r>>2]|0);c[r>>2]=Te(c[o>>2]|0,5400,j)|0;break}if(!(c[r>>2]|0)){z=c[o>>2]|0;c[j>>2]=c[u>>2];c[r>>2]=Te(z,19760,j)|0}}else{c[j>>2]=c[(c[o>>2]|0)+116>>2];c[r>>2]=Te(f,19608,j)|0}while(0);if(c[r>>2]|0){Ud(c[l>>2]|0,c[r>>2]|0,-1);Xb(c[o>>2]|0,c[r>>2]|0)}if(!(c[n>>2]|0)){i=k;return}fe(c[l>>2]|0,c[n>>2]|0);i=k;return}function vt(b,e){b=b|0;e=e|0;var f=0,g=0,h=0;f=i;i=i+16|0;g=f+4|0;h=f;c[g>>2]=b;c[h>>2]=e;if(((c[h>>2]|0)>=0?(a[(c[g>>2]|0)+12>>0]|0)==0:0)?(zt(c[(c[g>>2]|0)+208>>2]|0)|0)==0:0)a[(c[g>>2]|0)+4>>0]=c[h>>2];i=f;return d[(c[g>>2]|0)+4>>0]|0}function wt(a,d){a=a|0;d=d|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;g=f+12|0;h=f+8|0;k=f+4|0;j=f;c[h>>2]=a;c[k>>2]=d;if(!(c[h>>2]|0)){c[g>>2]=0;a=c[g>>2]|0;i=f;return a|0}Pc(c[h>>2]|0);if((c[k>>2]|0)>=0?(a=(c[(c[h>>2]|0)+4>>2]|0)+22|0,b[a>>1]=(e[a>>1]|0)&-5,(c[k>>2]|0)!=0):0){a=(c[(c[h>>2]|0)+4>>2]|0)+22|0;b[a>>1]=e[a>>1]|0|4}c[j>>2]=((e[(c[(c[h>>2]|0)+4>>2]|0)+22>>1]|0)&4|0)!=0&1;c[g>>2]=c[j>>2];a=c[g>>2]|0;i=f;return a|0}function xt(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;g=d+8|0;e=d+4|0;f=d;c[g>>2]=a;c[e>>2]=b;c[f>>2]=c[(c[g>>2]|0)+4>>2];Pc(c[g>>2]|0);yt(c[c[f>>2]>>2]|0,c[e>>2]|0);i=d;return 0}function yt(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0;g=i;i=i+16|0;h=g+8|0;f=g+4|0;j=g;c[h>>2]=b;c[f>>2]=e;c[j>>2]=c[f>>2]&3;if((c[j>>2]|0)==1)b=1;else b=(d[(c[h>>2]|0)+12>>0]|0)!=0;a[(c[h>>2]|0)+7>>0]=b?1:0;if((c[j>>2]|0)==3)j=(a[(c[h>>2]|0)+12>>0]|0)!=0^1;else j=0;a[(c[h>>2]|0)+8>>0]=j?1:0;do if(!(a[(c[h>>2]|0)+7>>0]|0)){if(c[f>>2]&4){a[(c[h>>2]|0)+11>>0]=3;a[(c[h>>2]|0)+9>>0]=3;break}e=(c[f>>2]&8|0)!=0;a[(c[h>>2]|0)+11>>0]=2;j=(c[h>>2]|0)+9|0;if(e){a[j>>0]=3;break}else{a[j>>0]=2;break}}else{a[(c[h>>2]|0)+11>>0]=0;a[(c[h>>2]|0)+9>>0]=0}while(0);a[(c[h>>2]|0)+10>>0]=a[(c[h>>2]|0)+11>>0]|0;if(a[(c[h>>2]|0)+8>>0]|0){e=(c[h>>2]|0)+10|0;a[e>>0]=d[e>>0]|32}h=(c[h>>2]|0)+20|0;j=d[h>>0]|0;if(c[f>>2]&16){a[h>>0]=j&-2;i=g;return}else{a[h>>0]=j|1;i=g;return}}function zt(a){a=a|0;var b=0,e=0;b=i;i=i+16|0;e=b;c[e>>2]=a;if(!(c[e>>2]|0)){e=0;e=e&1;i=b;return e|0}e=(d[(c[e>>2]|0)+43>>0]|0|0)==2;e=e&1;i=b;return e|0}function At(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;i=i+32|0;j=d+16|0;e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[j>>2]=a;c[e>>2]=b;c[f>>2]=c[c[j>>2]>>2];c[g>>2]=0;while(1){if((c[g>>2]|0)>=(c[(c[f>>2]|0)+20>>2]|0))break;c[h>>2]=(c[(c[f>>2]|0)+16>>2]|0)+(c[g>>2]<<4);do if(c[(c[h>>2]|0)+4>>2]|0){if((c[e>>2]|0)!=0?0!=(xc(c[e>>2]|0,c[c[h>>2]>>2]|0)|0):0)break;qp(c[j>>2]|0,c[g>>2]|0)}while(0);c[g>>2]=(c[g>>2]|0)+1}i=d;return}function Bt(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;j=i;i=i+48|0;e=j+36|0;d=j+32|0;n=j+28|0;g=j+24|0;o=j+20|0;f=j+16|0;m=j+12|0;l=j+8|0;k=j+4|0;h=j;c[e>>2]=a;c[d>>2]=b;c[o>>2]=c[c[e>>2]>>2];c[f>>2]=Ve(c[c[e>>2]>>2]|0,c[(c[d>>2]|0)+20>>2]|0)|0;c[n>>2]=Ct(c[d>>2]|0)|0;c[m>>2]=16;c[l>>2]=c[(c[(c[o>>2]|0)+16>>2]|0)+(c[f>>2]<<4)>>2];c[k>>2]=(c[f>>2]|0)==1?14904:14928;if((c[f>>2]|0)==1)c[m>>2]=14;if(ap(c[e>>2]|0,c[m>>2]|0,c[c[d>>2]>>2]|0,c[c[n>>2]>>2]|0,c[l>>2]|0)|0){i=j;return}if(ap(c[e>>2]|0,9,c[k>>2]|0,0,c[l>>2]|0)|0){i=j;return}o=dp(c[e>>2]|0)|0;c[g>>2]=o;if(!o){i=j;return}pp(c[e>>2]|0,0,c[f>>2]|0);Dt(c[e>>2]|0,c[f>>2]|0);c[h>>2]=Ye(c[g>>2]|0,9,19816,0)|0;bf(c[g>>2]|0,(c[h>>2]|0)+1|0,c[c[d>>2]>>2]|0,0);bf(c[g>>2]|0,(c[h>>2]|0)+4|0,1488,-2);ep(c[e>>2]|0,c[f>>2]|0);fp(c[g>>2]|0,61,0,0)|0;hp(c[g>>2]|0,126,c[f>>2]|0,0,0,c[c[d>>2]>>2]|0,0)|0;if((c[(c[e>>2]|0)+72>>2]|0)>=3){i=j;return}c[(c[e>>2]|0)+72>>2]=3;i=j;return}function Ct(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=bh((c[(c[d>>2]|0)+24>>2]|0)+8|0,c[(c[d>>2]|0)+4>>2]|0)|0;i=b;return a|0}function Dt(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;e=d+8|0;f=d+4|0;g=d;c[e>>2]=a;c[f>>2]=b;c[g>>2]=dp(c[e>>2]|0)|0;Jr(c[e>>2]|0,c[f>>2]|0,1,1,(c[f>>2]|0)==1?14904:14928);We(c[g>>2]|0,55,0,1,c[f>>2]|0,5)|0;if(c[(c[e>>2]|0)+68>>2]|0){i=d;return}c[(c[e>>2]|0)+68>>2]=1;i=d;return}function Et(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+32|0;l=f+12|0;k=f+16|0;j=f+8|0;g=f+4|0;h=f;c[l>>2]=b;a[k>>0]=d;c[j>>2]=e;c[g>>2]=se(c[l>>2]|0,40+(c[(c[j>>2]|0)+4>>2]|0)|0,0)|0;if(!(c[g>>2]|0)){l=c[g>>2]|0;i=f;return l|0}c[h>>2]=(c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g=0,h=0,j=0,k=0,l=0;h=i;i=i+48|0;d=h;e=h+32|0;f=h+28|0;l=h+24|0;k=h+20|0;j=h+16|0;g=h+12|0;c[f>>2]=a;c[l>>2]=b;if(!(c[l>>2]|0)){c[e>>2]=0;a=c[e>>2]|0;i=h;return a|0}c[j>>2]=c[(c[f>>2]|0)+12>>2];c[k>>2]=0;c[g>>2]=(c[l>>2]|0)+8;while(1){if((c[k>>2]|0)>=(c[c[l>>2]>>2]|0)){b=15;break}if(!(c[(c[f>>2]|0)+8>>2]|0)){if((c[(c[g>>2]|0)+4>>2]|0)!=0?(xc(c[(c[g>>2]|0)+4>>2]|0,c[j>>2]|0)|0)!=0:0){b=8;break}Xb(c[c[c[f>>2]>>2]>>2]|0,c[(c[g>>2]|0)+4>>2]|0);c[(c[g>>2]|0)+4>>2]=0;c[c[g>>2]>>2]=c[(c[f>>2]|0)+4>>2]}if(It(c[f>>2]|0,c[(c[g>>2]|0)+20>>2]|0)|0){b=11;break}if(Jt(c[f>>2]|0,c[(c[g>>2]|0)+44>>2]|0)|0){b=13;break}c[k>>2]=(c[k>>2]|0)+1;c[g>>2]=(c[g>>2]|0)+72}if((b|0)==8){a=c[c[f>>2]>>2]|0;k=c[(c[f>>2]|0)+20>>2]|0;l=c[(c[g>>2]|0)+4>>2]|0;c[d>>2]=c[(c[f>>2]|0)+16>>2];c[d+4>>2]=k;c[d+8>>2]=l;Se(a,20128,d);c[e>>2]=1;a=c[e>>2]|0;i=h;return a|0}else if((b|0)==11){c[e>>2]=1;a=c[e>>2]|0;i=h;return a|0}else if((b|0)==13){c[e>>2]=1;a=c[e>>2]|0;i=h;return a|0}else if((b|0)==15){c[e>>2]=0;a=c[e>>2]|0;i=h;return a|0}return 0}function It(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;e=d+8|0;f=d+4|0;g=d;c[f>>2]=a;c[g>>2]=b;while(1){if(!(c[g>>2]|0)){b=20;break}if(Kt(c[f>>2]|0,c[c[g>>2]>>2]|0)|0){b=4;break}if(Ht(c[f>>2]|0,c[(c[g>>2]|0)+32>>2]|0)|0){b=6;break}if(Jt(c[f>>2]|0,c[(c[g>>2]|0)+36>>2]|0)|0){b=8;break}if(Kt(c[f>>2]|0,c[(c[g>>2]|0)+40>>2]|0)|0){b=10;break}if(Jt(c[f>>2]|0,c[(c[g>>2]|0)+44>>2]|0)|0){b=12;break}if(Kt(c[f>>2]|0,c[(c[g>>2]|0)+48>>2]|0)|0){b=14;break}if(Jt(c[f>>2]|0,c[(c[g>>2]|0)+60>>2]|0)|0){b=16;break}if(Jt(c[f>>2]|0,c[(c[g>>2]|0)+64>>2]|0)|0){b=18;break}c[g>>2]=c[(c[g>>2]|0)+52>>2]}if((b|0)==4)c[e>>2]=1;else if((b|0)==6)c[e>>2]=1;else if((b|0)==8)c[e>>2]=1;else if((b|0)==10)c[e>>2]=1;else if((b|0)==12)c[e>>2]=1;else if((b|0)==14)c[e>>2]=1;else if((b|0)==16)c[e>>2]=1;else if((b|0)==18)c[e>>2]=1;else if((b|0)==20)c[e>>2]=0;i=d;return c[e>>2]|0}function Jt(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;g=i;i=i+16|0;j=g;f=g+12|0;h=g+8|0;k=g+4|0;c[h>>2]=b;c[k>>2]=e;while(1){if(!(c[k>>2]|0)){k=16;break}if((d[c[k>>2]>>0]|0)==135){if(!(a[(c[c[c[h>>2]>>2]>>2]|0)+145>>0]|0)){k=6;break}a[c[k>>2]>>0]=101}if(c[(c[k>>2]|0)+4>>2]&16384){k=16;break}b=c[h>>2]|0;e=(c[k>>2]|0)+20|0;if(c[(c[k>>2]|0)+4>>2]&2048){if(It(b,c[e>>2]|0)|0){k=10;break}}else if(Kt(b,c[e>>2]|0)|0){k=12;break}if(Jt(c[h>>2]|0,c[(c[k>>2]|0)+16>>2]|0)|0){k=14;break}c[k>>2]=c[(c[k>>2]|0)+12>>2]}if((k|0)==6){b=c[c[h>>2]>>2]|0;c[j>>2]=c[(c[h>>2]|0)+16>>2];Se(b,20176,j);c[f>>2]=1;b=c[f>>2]|0;i=g;return b|0}else if((k|0)==10){c[f>>2]=1;b=c[f>>2]|0;i=g;return b|0}else if((k|0)==12){c[f>>2]=1;b=c[f>>2]|0;i=g;return b|0}else if((k|0)==14){c[f>>2]=1;b=c[f>>2]|0;i=g;return b|0}else if((k|0)==16){c[f>>2]=0;b=c[f>>2]|0;i=g;return b|0}return 0}function Kt(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0;d=i;i=i+32|0;e=d+16|0;f=d+12|0;j=d+8|0;h=d+4|0;g=d;c[f>>2]=a;c[j>>2]=b;if(!(c[j>>2]|0)){c[e>>2]=0;a=c[e>>2]|0;i=d;return a|0}c[h>>2]=0;c[g>>2]=c[(c[j>>2]|0)+4>>2];while(1){if((c[h>>2]|0)>=(c[c[j>>2]>>2]|0)){b=8;break}if(Jt(c[f>>2]|0,c[c[g>>2]>>2]|0)|0){b=6;break}c[h>>2]=(c[h>>2]|0)+1;c[g>>2]=(c[g>>2]|0)+20}if((b|0)==6){c[e>>2]=1;a=c[e>>2]|0;i=d;return a|0}else if((b|0)==8){c[e>>2]=0;a=c[e>>2]|0;i=d;return a|0}return 0}function Lt(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;e=d+8|0;f=d+4|0;g=d;c[f>>2]=a;c[g>>2]=b;while(1){if(!(c[g>>2]|0)){b=10;break}if(It(c[f>>2]|0,c[(c[g>>2]|0)+8>>2]|0)|0){b=4;break}if(Jt(c[f>>2]|0,c[(c[g>>2]|0)+20>>2]|0)|0){b=6;break}if(Kt(c[f>>2]|0,c[(c[g>>2]|0)+24>>2]|0)|0){b=8;break}c[g>>2]=c[(c[g>>2]|0)+32>>2]}if((b|0)==4)c[e>>2]=1;else if((b|0)==6)c[e>>2]=1;else if((b|0)==8)c[e>>2]=1;else if((b|0)==10)c[e>>2]=0;i=d;return c[e>>2]|0}function Mt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return b|0}return 0}function Pt(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+32|0;m=f+24|0;j=f+20|0;l=f;h=f+16|0;g=f+12|0;k=f+8|0;c[m>>2]=a;c[j>>2]=b;b=l;c[b>>2]=d;c[b+4>>2]=e;c[h>>2]=dp(c[m>>2]|0)|0;b=(c[m>>2]|0)+72|0;a=(c[b>>2]|0)+1|0;c[b>>2]=a;c[g>>2]=a;c[k>>2]=Qe(c[c[m>>2]>>2]|0,8,0)|0;if(c[k>>2]|0){m=c[k>>2]|0;c[m+0>>2]=c[l+0>>2];c[m+4>>2]=c[l+4>>2]}hp(c[h>>2]|0,26,0,c[g>>2]|0,0,c[k>>2]|0,-13)|0;Nt(c[h>>2]|0,1);Ot(c[h>>2]|0,0,0,c[j>>2]|0,0)|0;fp(c[h>>2]|0,35,c[g>>2]|0,1)|0;i=f;return}function Qt(a){a=a|0;var b=0,d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[f>>2]=a;do if(c[f>>2]|0){if(!(xc(c[f>>2]|0,21072)|0)){c[e>>2]=1;break}if(!(xc(c[f>>2]|0,21064)|0))c[e>>2]=0;else b=6}else b=6;while(0);if((b|0)==6)c[e>>2]=-1;i=d;return c[e>>2]|0}function Rt(a){a=a|0;var b=0,d=0,e=0;d=i;i=i+16|0;b=d+4|0;e=d;c[e>>2]=a;if((c[e>>2]|0)==6)c[b>>2]=0;else c[b>>2]=c[22296+(c[e>>2]<<2)>>2];i=d;return c[b>>2]|0}function St(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+16|0;f=e+8|0;g=e;c[f>>2]=a;a=g;c[a>>2]=b;c[a+4>>2]=d;a=g;b=c[a+4>>2]|0;if(!((b|0)>-1|(b|0)==-1&(c[a>>2]|0)>>>0>=4294967295)){b=c[f>>2]|0;b=b+160|0;a=b;a=c[a>>2]|0;b=b+4|0;b=c[b>>2]|0;D=b;i=e;return a|0}d=g;a=c[d+4>>2]|0;b=(c[f>>2]|0)+160|0;c[b>>2]=c[d>>2];c[b+4>>2]=a;b=g;gu(c[(c[f>>2]|0)+208>>2]|0,c[b>>2]|0,c[b+4>>2]|0);b=c[f>>2]|0;b=b+160|0;a=b;a=c[a>>2]|0;b=b+4|0;b=c[b>>2]|0;D=b;i=e;return a|0}function Tt(b){b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=b;Pc(c[f>>2]|0);if(!(a[(c[(c[f>>2]|0)+4>>2]|0)+17>>0]|0)){f=0;c[e>>2]=f;f=c[e>>2]|0;i=d;return f|0}f=(a[(c[(c[f>>2]|0)+4>>2]|0)+18>>0]|0)!=0^1?1:2;c[e>>2]=f;f=c[e>>2]|0;i=d;return f|0}function Ut(a){a=a|0;var b=0,d=0,e=0,f=0;d=i;i=i+16|0;b=d+8|0;e=d+4|0;f=d;c[e>>2]=a;do if(xc(c[e>>2]|0,22272)|0){if(!(xc(c[e>>2]|0,21976)|0)){c[b>>2]=1;break}if(!(xc(c[e>>2]|0,22280)|0)){c[b>>2]=2;break}else{c[f>>2]=zg(c[e>>2]|0)|0;c[b>>2]=((c[f>>2]|0)>=0&(c[f>>2]|0)<=2?c[f>>2]|0:0)&255;break}}else c[b>>2]=0;while(0);i=d;return c[b>>2]|0}function Vt(b,f){b=b|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+32|0;l=g+12|0;m=g+8|0;k=g+4|0;h=g;j=g+16|0;c[l>>2]=b;c[m>>2]=f;c[k>>2]=c[(c[l>>2]|0)+4>>2];c[h>>2]=0;a[j>>0]=c[m>>2];Pc(c[l>>2]|0);if(((e[(c[k>>2]|0)+22>>1]|0)&2|0)!=0?(((d[j>>0]|0|0)!=0?1:0)|0)!=(d[(c[k>>2]|0)+17>>0]|0|0):0){c[h>>2]=8;m=c[h>>2]|0;i=g;return m|0}a[(c[k>>2]|0)+17>>0]=(d[j>>0]|0|0)!=0?1:0;a[(c[k>>2]|0)+18>>0]=(d[j>>0]|0|0)==2?1:0;m=c[h>>2]|0;i=g;return m|0}function Wt(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+32|0;g=f+16|0;k=f+12|0;l=f+8|0;h=f+4|0;j=f;c[k>>2]=b;c[l>>2]=e;c[h>>2]=fu(c[l>>2]|0)|0;c[j>>2]=c[c[k>>2]>>2];if((d[(c[j>>2]|0)+63>>0]|0|0)==(c[h>>2]|0)){c[g>>2]=0;l=c[g>>2]|0;i=f;return l|0}if(Xt(c[k>>2]|0)|0){c[g>>2]=1;l=c[g>>2]|0;i=f;return l|0}else{a[(c[j>>2]|0)+63>>0]=c[h>>2];c[g>>2]=0;l=c[g>>2]|0;i=f;return l|0}return 0}function Xt(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;e=i;i=i+16|0;h=e;d=e+12|0;g=e+8|0;f=e+4|0;c[g>>2]=b;c[f>>2]=c[c[g>>2]>>2];do if(c[(c[(c[f>>2]|0)+16>>2]|0)+20>>2]|0){if((a[(c[f>>2]|0)+62>>0]|0)!=0?(Tc(c[(c[(c[f>>2]|0)+16>>2]|0)+20>>2]|0)|0)==0:0){Kk(c[(c[(c[f>>2]|0)+16>>2]|0)+20>>2]|0)|0;c[(c[(c[f>>2]|0)+16>>2]|0)+20>>2]=0;cd(c[f>>2]|0);break}Se(c[g>>2]|0,22208,h);c[d>>2]=1;h=c[d>>2]|0;i=e;return h|0}while(0);c[d>>2]=0;h=c[d>>2]|0;i=e;return h|0}function Yt(b){b=b|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;g=e+8|0;f=e+4|0;h=e;c[g>>2]=b;if(!(a[(c[g>>2]|0)+62>>0]|0)){i=e;return}c[f>>2]=c[(c[g>>2]|0)+16>>2];c[h>>2]=c[(c[g>>2]|0)+20>>2];while(1){b=c[h>>2]|0;c[h>>2]=b+ -1;if((b|0)<=0)break;if(c[(c[f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)c[e>>2]=22176;else if((b|0)==8)c[e>>2]=22152;else if((b|0)==9)c[e>>2]=22168;else if((b|0)==7)c[e>>2]=22136;else c[e>>2]=22192;i=f;return c[e>>2]|0}function $t(f,g,h,j,k){f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;x=i;i=i+80|0;v=x;n=x+64|0;q=x+60|0;z=x+56|0;t=x+52|0;p=x+48|0;D=x+44|0;o=x+40|0;u=x+36|0;s=x+32|0;l=x+28|0;r=x+24|0;w=x+20|0;C=x+16|0;y=x+68|0;A=x+12|0;B=x+8|0;c[q>>2]=f;c[z>>2]=g;c[t>>2]=h;c[p>>2]=j;c[D>>2]=k;c[o>>2]=0;c[u>>2]=0;c[s>>2]=c[(c[t>>2]|0)+20>>2];c[l>>2]=c[(c[t>>2]|0)+40>>2];do if((c[s>>2]|0)==1){if((b[(c[z>>2]|0)+36>>1]|0)>=0){if(!(c[l>>2]|0)){c[n>>2]=0;f=c[n>>2]|0;i=x;return f|0}if(!(xc(c[(c[(c[z>>2]|0)+4>>2]|0)+((b[(c[z>>2]|0)+36>>1]|0)*24|0)>>2]|0,c[l>>2]|0)|0)){c[n>>2]=0;f=c[n>>2]|0;i=x;return f|0}}}else if(c[D>>2]|0){c[u>>2]=Qe(c[c[q>>2]>>2]|0,c[s>>2]<<2,0)|0;if(c[u>>2]|0){c[c[D>>2]>>2]=c[u>>2];break}c[n>>2]=1;f=c[n>>2]|0;i=x;return f|0}while(0);c[o>>2]=c[(c[z>>2]|0)+8>>2];a:while(1){if(!(c[o>>2]|0))break;do if((e[(c[o>>2]|0)+50>>1]|0)==(c[s>>2]|0)?(d[(c[o>>2]|0)+54>>0]|0)!=0:0){if(!(c[l>>2]|0))if((a[(c[o>>2]|0)+55>>0]&3|0)==2){m=17;break a}else break;c[w>>2]=0;while(1){if((c[w>>2]|0)>=(c[s>>2]|0))break;b[y>>1]=b[(c[(c[o>>2]|0)+4>>2]|0)+(c[w>>2]<<1)>>1]|0;f=c[(c[(c[z>>2]|0)+4>>2]|0)+((b[y>>1]|0)*24|0)+16>>2]|0;c[A>>2]=f;c[A>>2]=(c[A>>2]|0)!=0?f:3320;if(xc(c[(c[(c[o>>2]|0)+32>>2]|0)+(c[w>>2]<<2)>>2]|0,c[A>>2]|0)|0)break;c[B>>2]=c[(c[(c[z>>2]|0)+4>>2]|0)+((b[y>>1]|0)*24|0)>>2];c[C>>2]=0;while(1){if((c[C>>2]|0)>=(c[s>>2]|0))break;if(!(xc(c[(c[t>>2]|0)+36+(c[C>>2]<<3)+4>>2]|0,c[B>>2]|0)|0)){m=27;break}c[C>>2]=(c[C>>2]|0)+1}if((m|0)==27?(m=0,(c[u>>2]|0)!=0):0)c[(c[u>>2]|0)+(c[w>>2]<<2)>>2]=c[(c[t>>2]|0)+36+(c[C>>2]<<3)>>2];if((c[C>>2]|0)==(c[s>>2]|0))break;c[w>>2]=(c[w>>2]|0)+1}if((c[w>>2]|0)==(c[s>>2]|0))break a}while(0);c[o>>2]=c[(c[o>>2]|0)+20>>2]}b:do if((m|0)==17?(c[u>>2]|0)!=0:0){c[r>>2]=0;while(1){if((c[r>>2]|0)>=(c[s>>2]|0))break b;c[(c[u>>2]|0)+(c[r>>2]<<2)>>2]=c[(c[t>>2]|0)+36+(c[r>>2]<<3)>>2];c[r>>2]=(c[r>>2]|0)+1}}while(0);if(c[o>>2]|0){c[c[p>>2]>>2]=c[o>>2];c[n>>2]=0;f=c[n>>2]|0;i=x;return f|0}if(!(a[(c[q>>2]|0)+438>>0]|0)){f=c[q>>2]|0;g=c[(c[t>>2]|0)+8>>2]|0;c[v>>2]=c[c[c[t>>2]>>2]>>2];c[v+4>>2]=g;Se(f,22088,v)}Xb(c[c[q>>2]>>2]|0,c[u>>2]|0);c[n>>2]=1;f=c[n>>2]|0;i=x;return f|0}function au(d,f){d=d|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;l=i;i=i+32|0;h=l+20|0;o=l+16|0;j=l+12|0;m=l+8|0;k=l+4|0;n=l;g=l+24|0;c[o>>2]=d;c[j>>2]=f;if(!(c[(c[j>>2]|0)+16>>2]|0)){c[k>>2]=c[(c[j>>2]|0)+12>>2];c[n>>2]=Fs(c[o>>2]|0)|0;d=(e[(c[j>>2]|0)+52>>1]|0)+1|0;d=Qe(0,d,((d|0)<0)<<31>>31)|0;c[(c[j>>2]|0)+16>>2]=d;if(!(c[(c[j>>2]|0)+16>>2]|0)){a[(c[n>>2]|0)+64>>0]=1;c[h>>2]=0;d=c[h>>2]|0;i=l;return d|0}c[m>>2]=0;while(1){n=c[m>>2]|0;f=c[j>>2]|0;if((c[m>>2]|0)>=(e[(c[j>>2]|0)+52>>1]|0))break;b[g>>1]=b[(c[f+4>>2]|0)+(n<<1)>>1]|0;if((b[g>>1]|0)<0)f=68;else f=a[(c[(c[k>>2]|0)+4>>2]|0)+((b[g>>1]|0)*24|0)+21>>0]|0;a[(c[(c[j>>2]|0)+16>>2]|0)+(c[m>>2]|0)>>0]=f;c[m>>2]=(c[m>>2]|0)+1}a[(c[f+16>>2]|0)+n>>0]=0}c[h>>2]=c[(c[j>>2]|0)+16>>2];d=c[h>>2]|0;i=l;return d|0}function bu(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;f=d+8|0;e=d+4|0;g=d;c[f>>2]=a;c[e>>2]=b;if(c[e>>2]|0)c[g>>2]=22080;else c[g>>2]=8776;Qf(c[f>>2]|0,8784,2,1,c[g>>2]|0,34,0,0,0)|0;Qf(c[f>>2]|0,8784,3,1,c[g>>2]|0,34,0,0,0)|0;Qf(c[f>>2]|0,8768,2,1,1208,34,0,0,0)|0;eu(c[f>>2]|0,8768,12);eu(c[f>>2]|0,8784,((c[e>>2]|0)!=0?12:4)&255);i=d;return}function cu(a){a=a|0;var b=0,d=0,e=0,f=0;b=i;i=i+16|0;d=b+8|0;f=b+4|0;e=b;c[d>>2]=a;c[f>>2]=0;c[e>>2]=(c[d>>2]|0)+116;while(1){if((c[f>>2]|0)>=10)break;if(c[(c[e>>2]|0)+12>>2]|0){vs(c[d>>2]|0,c[e>>2]|0);c[(c[e>>2]|0)+12>>2]=0}c[f>>2]=(c[f>>2]|0)+1;c[e>>2]=(c[e>>2]|0)+20}i=b;return}function du(b,e,f,g,h,j,k){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;w=i;i=i+64|0;r=w+52|0;p=w+48|0;x=w+44|0;l=w+40|0;o=w+36|0;v=w+32|0;m=w+28|0;z=w+24|0;n=w+20|0;u=w+16|0;A=w+12|0;t=w+8|0;q=w+4|0;s=w;c[p>>2]=b;c[x>>2]=e;c[l>>2]=f;c[o>>2]=g;c[v>>2]=h;c[m>>2]=j;c[z>>2]=k;if((d[(c[x>>2]|0)+44>>0]|0)&16){c[r>>2]=0;b=c[r>>2]|0;i=w;return b|0}c[u>>2]=Ve(c[c[p>>2]>>2]|0,c[(c[x>>2]|0)+68>>2]|0)|0;c[q>>2]=dp(c[p>>2]|0)|0;if((c[o>>2]|0)<0)c[o>>2]=c[(c[p>>2]|0)+68>>2];b=c[o>>2]|0;c[o>>2]=b+1;c[A>>2]=b;if(c[m>>2]|0)c[c[m>>2]>>2]=c[A>>2];do if(!((d[(c[x>>2]|0)+44>>0]|0)&32)){if((c[v>>2]|0)!=0?(d[c[v>>2]>>0]|0|0)==0:0){y=11;break}Kr(c[p>>2]|0,c[A>>2]|0,c[u>>2]|0,c[x>>2]|0,c[l>>2]|0)}else y=11;while(0);if((y|0)==11)Jr(c[p>>2]|0,c[u>>2]|0,c[(c[x>>2]|0)+32>>2]|0,(c[l>>2]|0)==55&255,c[c[x>>2]>>2]|0);if(c[z>>2]|0)c[c[z>>2]>>2]=c[o>>2];c[n>>2]=0;c[t>>2]=c[(c[x>>2]|0)+8>>2];while(1){y=c[o>>2]|0;if(!(c[t>>2]|0))break;c[o>>2]=y+1;c[s>>2]=y;if((a[(c[t>>2]|0)+55>>0]&3|0)==2?(c[m>>2]|0)!=0?((d[(c[x>>2]|0)+44>>0]|0)&32|0)!=0:0:0)c[c[m>>2]>>2]=c[s>>2];if(!((c[v>>2]|0)!=0?(d[(c[v>>2]|0)+((c[n>>2]|0)+1)>>0]|0|0)==0:0)){ip(c[q>>2]|0,c[l>>2]|0,c[s>>2]|0,c[(c[t>>2]|0)+44>>2]|0,c[u>>2]|0)|0;Lr(c[p>>2]|0,c[t>>2]|0)}c[t>>2]=c[(c[t>>2]|0)+20>>2];c[n>>2]=(c[n>>2]|0)+1}if((y|0)>(c[(c[p>>2]|0)+68>>2]|0))c[(c[p>>2]|0)+68>>2]=c[o>>2];c[r>>2]=c[n>>2];b=c[r>>2]|0;i=w;return b|0}function eu(f,g,h){f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0;j=i;i=i+16|0;n=j+8|0;m=j+4|0;l=j+12|0;k=j;c[n>>2]=f;c[m>>2]=g;a[l>>0]=h;g=c[n>>2]|0;f=c[m>>2]|0;c[k>>2]=Sf(g,f,Mb(c[m>>2]|0)|0,2,1,0)|0;if(!(c[k>>2]|0)){i=j;return}n=(c[k>>2]|0)+2|0;b[n>>1]=e[n>>1]|0|(d[l>>0]|0);i=j;return}function fu(b){b=b|0;var d=0,e=0,f=0,g=0;e=i;i=i+16|0;f=e+4|0;g=e;c[g>>2]=b;if((a[c[g>>2]>>0]|0)>=48?(a[c[g>>2]>>0]|0)<=50:0)c[f>>2]=(a[c[g>>2]>>0]|0)-48;else d=4;do if((d|0)==4){if(!(xc(c[g>>2]|0,21448)|0)){c[f>>2]=1;break}if(!(xc(c[g>>2]|0,4792)|0)){c[f>>2]=2;break}else{c[f>>2]=0;break}}while(0);i=e;return c[f>>2]|0}function gu(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+16|0;g=e+8|0;f=e;c[g>>2]=a;a=f;c[a>>2]=b;c[a+4>>2]=d;if(!(c[g>>2]|0)){i=e;return}b=c[f+4>>2]|0;a=(c[g>>2]|0)+16|0;c[a>>2]=c[f>>2];c[a+4>>2]=b;i=e;return}function hu(d,f){d=d|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+32|0;h=g+12|0;m=g+8|0;j=g+4|0;k=g;l=g+16|0;c[h>>2]=d;c[m>>2]=f;if(!((c[h>>2]|0)!=0&(c[m>>2]|0)!=0)){i=g;return}c[j>>2]=(c[h>>2]|0)+((c[m>>2]|0)*40|0);c[k>>2]=c[(c[h>>2]|0)+32>>2];a[l>>0]=a[(c[k>>2]|0)+64>>0]|0;if(c[(c[k>>2]|0)+520>>2]|0){do{if(c[(c[h>>2]|0)+24>>2]|0)Xb(c[k>>2]|0,c[(c[h>>2]|0)+20>>2]|0);d=(c[h>>2]|0)+40|0;c[h>>2]=d}while(d>>>0<(c[j>>2]|0)>>>0);i=g;return}do{f=c[h>>2]|0;if(!((e[(c[h>>2]|0)+8>>1]|0)&9312)){if(c[f+24>>2]|0){Xb(c[k>>2]|0,c[(c[h>>2]|0)+20>>2]|0);c[(c[h>>2]|0)+24>>2]=0}}else Bd(f);b[(c[h>>2]|0)+8>>1]=128;d=(c[h>>2]|0)+40|0;c[h>>2]=d}while(d>>>0<(c[j>>2]|0)>>>0);a[(c[k>>2]|0)+64>>0]=a[l>>0]|0;i=g;return}function iu(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;l=i;i=i+64|0;f=l;g=l+36|0;o=l+32|0;h=l+28|0;j=l+24|0;n=l+20|0;k=l+16|0;m=l+40|0;c[g>>2]=a;c[o>>2]=b;c[h>>2]=d;c[j>>2]=e;c[k>>2]=c[(c[(c[c[g>>2]>>2]|0)+16>>2]|0)+(c[o>>2]<<4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0,c[k>>2]|0)|0;c[p>>2]=Fk(c[r>>2]|0,c[o>>2]|0,a,((a|0)<0)<<31>>31)|0;if(c[p>>2]|0){c[o>>2]=c[p>>2];break}c[c[l>>2]>>2]=-1;c[n>>2]=c[o>>2];a=c[n>>2]|0;i=h;return a|0}while(0);c[m>>2]=c[o>>2];a=$(c[j>>2]|0,c[k>>2]|0)|0;_E((c[m>>2]|0)+a|0,0,c[k>>2]|0)|0;c[c[l>>2]>>2]=c[j>>2];a=c[g>>2]|0;c[a>>2]=(c[a>>2]|0)+1;c[n>>2]=c[o>>2];a=c[n>>2]|0;i=h;return a|0}function lu(a,b,e,f,g){a=a|0;b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;k=i;i=i+32|0;q=k+28|0;p=k+24|0;h=k+20|0;n=k+16|0;l=k+12|0;o=k+8|0;j=k+4|0;m=k;c[q>>2]=a;c[p>>2]=b;c[h>>2]=e;c[n>>2]=f;c[l>>2]=g;c[o>>2]=0;c[j>>2]=0;if(c[(c[c[q>>2]>>2]|0)+24>>2]&8388608)c[j>>2]=wp(c[q>>2]|0,c[p>>2]|0)|0;c[m>>2]=c[j>>2];while(1){if(!(c[m>>2]|0))break;if((d[(c[m>>2]|0)+8>>0]|0|0)==(c[h>>2]|0)?(ex(c[(c[m>>2]|0)+16>>2]|0,c[n>>2]|0)|0)!=0:0)c[o>>2]=c[o>>2]|(d[(c[m>>2]|0)+9>>0]|0);c[m>>2]=c[(c[m>>2]|0)+32>>2]}if(!(c[l>>2]|0)){b=c[o>>2]|0;b=(b|0)!=0;a=c[j>>2]|0;a=b?a:0;i=k;return a|0}c[c[l>>2]>>2]=c[o>>2];b=c[o>>2]|0;b=(b|0)!=0;a=c[j>>2]|0;a=b?a:0;i=k;return a|0}function mu(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;l=i;i=i+32|0;j=l;k=l+16|0;g=l+12|0;h=l+8|0;m=l+4|0;c[g>>2]=a;c[h>>2]=b;c[m>>2]=e;if(!(((d[(c[h>>2]|0)+44>>0]|0)&16|0)!=0?(c[(c[c[(Rp(c[c[g>>2]>>2]|0,c[h>>2]|0)|0)+4>>2]>>2]|0)+52>>2]|0)==0:0))f=3;do if((f|0)==3){if((((d[(c[h>>2]|0)+44>>0]|0)&1|0)!=0?(c[(c[c[g>>2]>>2]|0)+24>>2]&2048|0)==0:0)?(d[(c[g>>2]|0)+18>>0]|0|0)==0:0)break;if((c[m>>2]|0)==0?(c[(c[h>>2]|0)+12>>2]|0)!=0:0){a=c[g>>2]|0;c[j>>2]=c[c[h>>2]>>2];Se(a,24480,j);c[k>>2]=1;a=c[k>>2]|0;i=l;return a|0}c[k>>2]=0;a=c[k>>2]|0;i=l;return a|0}while(0);a=c[g>>2]|0;c[j>>2]=c[c[h>>2]>>2];Se(a,24448,j);c[k>>2]=1;a=c[k>>2]|0;i=l;return a|0}function nu(a){a=a|0;var d=0,e=0;d=i;i=i+16|0;e=d;c[e>>2]=a;a=(c[e>>2]|0)+88|0;b[a>>1]=b[a>>1]&-17|16;i=d;return}function ou(f,g,h,j,k){f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;l=i;i=i+112|0;v=l+100|0;p=l+96|0;n=l+92|0;H=l+88|0;E=l+84|0;w=l+80|0;K=l+76|0;o=l+72|0;q=l+68|0;m=l+64|0;I=l+60|0;J=l+56|0;s=l+52|0;r=l+48|0;A=l+44|0;z=l+40|0;C=l+36|0;B=l+32|0;u=l+28|0;t=l+24|0;D=l+20|0;F=l+16|0;x=l+12|0;y=l+8|0;L=l+4|0;G=l;c[p>>2]=f;c[n>>2]=g;c[H>>2]=h;c[E>>2]=j;c[w>>2]=k;c[B>>2]=0;c[u>>2]=0;c[F>>2]=0;if(!(c[H>>2]|0)){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}if((c[(c[p>>2]|0)+532>>2]|0)==0?(c[(c[H>>2]|0)+68>>2]|0)==0:0){if(wp(c[p>>2]|0,c[n>>2]|0)|0){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}if(d[(c[n>>2]|0)+44>>0]&16){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}if((c[E>>2]|0)==10){if((b[(c[n>>2]|0)+36>>1]|0)>=0)c[E>>2]=d[(c[n>>2]|0)+45>>0];if((c[E>>2]|0)==10)c[E>>2]=2}if((c[c[(c[H>>2]|0)+32>>2]>>2]|0)!=1){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}if(c[(c[(c[H>>2]|0)+32>>2]|0)+28>>2]|0){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}if(c[(c[H>>2]|0)+36>>2]|0){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}if(c[(c[H>>2]|0)+48>>2]|0){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}if(c[(c[H>>2]|0)+40>>2]|0){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}if(c[(c[H>>2]|0)+60>>2]|0){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}if(c[(c[H>>2]|0)+52>>2]|0){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}if(e[(c[H>>2]|0)+6>>1]&1){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}c[K>>2]=c[c[H>>2]>>2];if((c[c[K>>2]>>2]|0)!=1){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}if((d[c[c[(c[K>>2]|0)+4>>2]>>2]>>0]|0)!=116){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}c[I>>2]=(c[(c[H>>2]|0)+32>>2]|0)+8;c[o>>2]=np(c[p>>2]|0,0,c[I>>2]|0)|0;if(!(c[o>>2]|0)){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}if((c[o>>2]|0)==(c[n>>2]|0)){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}if(((d[(c[n>>2]|0)+44>>0]&32|0)==0|0)!=((d[(c[o>>2]|0)+44>>0]&32|0)==0|0)){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}if(d[(c[o>>2]|0)+44>>0]&16){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}if(c[(c[o>>2]|0)+12>>2]|0){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}if((b[(c[n>>2]|0)+38>>1]|0)!=(b[(c[o>>2]|0)+38>>1]|0)){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}if((b[(c[n>>2]|0)+36>>1]|0)!=(b[(c[o>>2]|0)+36>>1]|0)){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}c[J>>2]=0;a:while(1){if((c[J>>2]|0)>=(b[(c[n>>2]|0)+38>>1]|0)){G=64;break}c[L>>2]=(c[(c[n>>2]|0)+4>>2]|0)+((c[J>>2]|0)*24|0);c[G>>2]=(c[(c[o>>2]|0)+4>>2]|0)+((c[J>>2]|0)*24|0);if((a[(c[L>>2]|0)+21>>0]|0)!=(a[(c[G>>2]|0)+21>>0]|0)){G=52;break}if(!(fx(c[(c[L>>2]|0)+16>>2]|0,c[(c[G>>2]|0)+16>>2]|0)|0)){G=54;break}if((d[(c[L>>2]|0)+20>>0]|0)!=0?(a[(c[G>>2]|0)+20>>0]|0)==0:0){G=57;break}do if((c[J>>2]|0)>0){if(((c[(c[L>>2]|0)+8>>2]|0)==0|0)!=((c[(c[G>>2]|0)+8>>2]|0)==0|0)){G=62;break a}if(!(c[(c[L>>2]|0)+8>>2]|0))break;if(UE(c[(c[L>>2]|0)+8>>2]|0,c[(c[G>>2]|0)+8>>2]|0)|0){G=62;break a}}while(0);c[J>>2]=(c[J>>2]|0)+1}if((G|0)==52){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}else if((G|0)==54){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}else if((G|0)==57){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}else if((G|0)==62){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}else if((G|0)==64){c[m>>2]=c[(c[n>>2]|0)+8>>2];while(1){if(!(c[m>>2]|0))break;if(d[(c[m>>2]|0)+54>>0]|0)c[F>>2]=1;c[q>>2]=c[(c[o>>2]|0)+8>>2];while(1){if(!(c[q>>2]|0))break;if(gx(c[m>>2]|0,c[q>>2]|0)|0)break;c[q>>2]=c[(c[q>>2]|0)+20>>2]}if(!(c[q>>2]|0)){G=73;break}c[m>>2]=c[(c[m>>2]|0)+20>>2]}if((G|0)==73){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}do if(c[(c[n>>2]|0)+24>>2]|0){if(!(Eq(c[(c[o>>2]|0)+24>>2]|0,c[(c[n>>2]|0)+24>>2]|0,-1)|0))break;c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}while(0);do if(c[(c[c[p>>2]>>2]|0)+24>>2]&524288){if(!(c[(c[n>>2]|0)+16>>2]|0))break;c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}while(0);if(c[(c[c[p>>2]>>2]|0)+24>>2]&128){c[v>>2]=0;f=c[v>>2]|0;i=l;return f|0}c[s>>2]=Ve(c[c[p>>2]>>2]|0,c[(c[o>>2]|0)+68>>2]|0)|0;c[t>>2]=dp(c[p>>2]|0)|0;qp(c[p>>2]|0,c[s>>2]|0);f=(c[p>>2]|0)+68|0;g=c[f>>2]|0;c[f>>2]=g+1;c[r>>2]=g;g=(c[p>>2]|0)+68|0;f=c[g>>2]|0;c[g>>2]=f+1;c[A>>2]=f;c[D>>2]=pu(c[p>>2]|0,c[w>>2]|0,c[n>>2]|0)|0;c[x>>2]=kp(c[p>>2]|0)|0;c[y>>2]=kp(c[p>>2]|0)|0;Kr(c[p>>2]|0,c[A>>2]|0,c[w>>2]|0,c[n>>2]|0,55);if((b[(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;j=h;c[n>>2]=a;c[f>>2]=b;c[l>>2]=e;c[m>>2]=0;if((d[(c[l>>2]|0)+44>>0]|0)&8){e=c[n>>2]|0;if(c[(c[n>>2]|0)+408>>2]|0)e=c[e+408>>2]|0;c[k>>2]=e;c[j>>2]=c[(c[k>>2]|0)+404>>2];while(1){if(c[j>>2]|0)b=(c[(c[j>>2]|0)+4>>2]|0)!=(c[l>>2]|0);else b=0;e=c[j>>2]|0;if(!b)break;c[j>>2]=c[e>>2]}do if(!e){c[j>>2]=Qe(c[c[n>>2]>>2]|0,16,0)|0;if(c[j>>2]|0){c[c[j>>2]>>2]=c[(c[k>>2]|0)+404>>2];c[(c[k>>2]|0)+404>>2]=c[j>>2];c[(c[j>>2]|0)+4>>2]=c[l>>2];c[(c[j>>2]|0)+8>>2]=c[f>>2];b=(c[k>>2]|0)+72|0;c[b>>2]=(c[b>>2]|0)+1;b=(c[k>>2]|0)+72|0;a=(c[b>>2]|0)+1|0;c[b>>2]=a;c[(c[j>>2]|0)+12>>2]=a;a=(c[k>>2]|0)+72|0;c[a>>2]=(c[a>>2]|0)+1;break}c[g>>2]=0;a=c[g>>2]|0;i=h;return a|0}while(0);c[m>>2]=c[(c[j>>2]|0)+12>>2]}c[g>>2]=c[m>>2];a=c[g>>2]|0;i=h;return a|0}function qu(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;f=i;i=i+48|0;g=f+40|0;r=f+36|0;p=f+32|0;n=f+28|0;l=f+24|0;o=f+20|0;q=f+16|0;m=f+12|0;k=f+8|0;j=f+4|0;h=f;c[r>>2]=a;c[p>>2]=b;c[n>>2]=e;c[l>>2]=dp(c[r>>2]|0)|0;c[q>>2]=Mr(c[l>>2]|0)|0;if((d[(c[n>>2]|0)+44>>0]|0)&16)e=Rp(c[c[r>>2]>>2]|0,c[n>>2]|0)|0;else e=0;c[m>>2]=e;c[o>>2]=1;a:while(1){if((c[o>>2]|0)>=(c[q>>2]|0)){h=18;break}c[k>>2]=dt(c[l>>2]|0,c[o>>2]|0)|0;b:do if((d[c[k>>2]>>0]|0|0)==54?(c[(c[k>>2]|0)+12>>2]|0)==(c[p>>2]|0):0){c[h>>2]=c[(c[k>>2]|0)+8>>2];if((c[h>>2]|0)==(c[(c[n>>2]|0)+32>>2]|0)){h=8;break a}c[j>>2]=c[(c[n>>2]|0)+8>>2];while(1){if(!(c[j>>2]|0))break b;if((c[h>>2]|0)==(c[(c[j>>2]|0)+44>>2]|0)){h=12;break a}c[j>>2]=c[(c[j>>2]|0)+20>>2]}}while(0);if((d[c[k>>2]>>0]|0|0)==147?(c[(c[k>>2]|0)+16>>2]|0)==(c[m>>2]|0):0){h=16;break}c[o>>2]=(c[o>>2]|0)+1}if((h|0)==8){c[g>>2]=1;a=c[g>>2]|0;i=f;return a|0}else if((h|0)==12){c[g>>2]=1;a=c[g>>2]|0;i=f;return a|0}else if((h|0)==16){c[g>>2]=1;a=c[g>>2]|0;i=f;return a|0}else if((h|0)==18){c[g>>2]=0;a=c[g>>2]|0;i=f;return a|0}return 0}function ru(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+32|0;k=e+16|0;g=e+12|0;h=e+8|0;j=e+4|0;f=e;c[k>>2]=a;c[g>>2]=b;c[h>>2]=d;c[j>>2]=c[(c[k>>2]|0)+8>>2];Os(c[k>>2]|0,c[g>>2]|0,c[h>>2]|0);b=(c[k>>2]|0)+72|0;a=(c[b>>2]|0)+1|0;c[b>>2]=a;c[f>>2]=a;fp(c[j>>2]|0,33,c[h>>2]|0,c[f>>2]|0)|0;Zs(c[g>>2]|0,c[f>>2]|0);i=e;return}function su(d,e,f){d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;j=i;i=i+32|0;m=j+20|0;n=j+16|0;h=j+12|0;k=j+8|0;g=j+4|0;l=j;c[m>>2]=d;c[n>>2]=e;c[h>>2]=f;c[g>>2]=c[(c[n>>2]|0)+20>>2];if(!(c[g>>2]|0)){c[l>>2]=Fs(c[m>>2]|0)|0;d=(b[(c[n>>2]|0)+38>>1]|0)+1|0;c[g>>2]=Qe(0,d,((d|0)<0)<<31>>31)|0;if(!(c[g>>2]|0)){a[(c[l>>2]|0)+64>>0]=1;i=j;return}c[k>>2]=0;while(1){if((c[k>>2]|0)>=(b[(c[n>>2]|0)+38>>1]|0))break;a[(c[g>>2]|0)+(c[k>>2]|0)>>0]=a[(c[(c[n>>2]|0)+4>>2]|0)+((c[k>>2]|0)*24|0)+21>>0]|0;c[k>>2]=(c[k>>2]|0)+1}do{d=c[k>>2]|0;c[k>>2]=d+ -1;a[(c[g>>2]|0)+d>>0]=0;if((c[k>>2]|0)<0)break}while((a[(c[g>>2]|0)+(c[k>>2]|0)>>0]|0)==65);c[(c[n>>2]|0)+20>>2]=c[g>>2]}c[k>>2]=Mb(c[g>>2]|0)|0;if(!(c[k>>2]|0)){i=j;return}f=c[m>>2]|0;if(c[h>>2]|0){hp(f,48,c[h>>2]|0,c[k>>2]|0,0,c[g>>2]|0,c[k>>2]|0)|0;i=j;return}else{bf(f,-1,c[g>>2]|0,c[k>>2]|0);i=j;return}}function tu(a,b,e,f,g,h,j,k,l){a=a|0;b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;var m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;u=i;i=i+48|0;n=u+36|0;w=u+32|0;m=u+28|0;t=u+24|0;v=u+20|0;p=u+16|0;q=u+12|0;r=u+8|0;s=u+4|0;o=u;c[n>>2]=a;c[w>>2]=b;c[m>>2]=e;c[t>>2]=f;c[v>>2]=g;c[p>>2]=h;c[q>>2]=j;c[r>>2]=k;c[s>>2]=l;c[o>>2]=c[w>>2];while(1){if(!(c[o>>2]|0))break;if(((d[(c[o>>2]|0)+8>>0]|0|0)==(c[m>>2]|0)?(d[(c[o>>2]|0)+9>>0]|0|0)==(c[v>>2]|0):0)?(ex(c[(c[o>>2]|0)+16>>2]|0,c[t>>2]|0)|0)!=0:0)kw(c[n>>2]|0,c[o>>2]|0,c[p>>2]|0,c[q>>2]|0,c[r>>2]|0,c[s>>2]|0);c[o>>2]=c[(c[o>>2]|0)+32>>2]}i=u;return}function uu(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;f=e+8|0;g=e+4|0;h=e;c[f>>2]=a;c[g>>2]=b;c[h>>2]=d;if((c[g>>2]|0)<=0){i=e;return}fp(c[(c[f>>2]|0)+8>>2]|0,136,c[g>>2]|0,c[h>>2]|0)|0;i=e;return}function vu(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,j=0;j=i;i=i+16|0;f=j+8|0;g=j+4|0;h=j;c[f>>2]=a;c[g>>2]=b;c[h>>2]=e;if((d[(c[f>>2]|0)+23>>0]|0|0)!=0?(Vs(c[g>>2]|0)|0)!=0:0){ct(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0,0);i=j;return}Os(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0);i=j;return}function wu(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;j=i;i=i+32|0;m=j+20|0;h=j+16|0;g=j+12|0;l=j+8|0;e=j+4|0;k=j;c[m>>2]=b;c[h>>2]=d;d=c[m>>2]|0;if(c[(c[m>>2]|0)+408>>2]|0)d=c[d+408>>2]|0;c[g>>2]=d;c[l>>2]=0;while(1){if((c[l>>2]|0)>=(c[(c[g>>2]|0)+452>>2]|0))break;if((c[h>>2]|0)==(c[(c[(c[g>>2]|0)+520>>2]|0)+(c[l>>2]<<2)>>2]|0)){f=10;break}c[l>>2]=(c[l>>2]|0)+1}if((f|0)==10){i=j;return}c[e>>2]=(c[(c[g>>2]|0)+452>>2]|0)+1<<2;c[k>>2]=jc(c[(c[g>>2]|0)+520>>2]|0,c[e>>2]|0)|0;if(c[k>>2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|0,-1)|0;Xe(c[V>>2]|0,1)}while(0);c[F>>2]=(c[F>>2]|0)+1}a:do if((c[(c[v>>2]|0)+24>>2]|0)!=0?(c[(c[Y>>2]|0)+24>>2]&8192|0)==0:0){c[ca>>2]=c[(c[v>>2]|0)+24>>2];c[(c[D>>2]|0)+92>>2]=(c[z>>2]|0)+1;if((d[N>>0]|0)!=10)ha=d[N>>0]|0;else ha=2;c[M>>2]=ha;c[F>>2]=0;while(1){if((c[F>>2]|0)>=(c[c[ca>>2]>>2]|0))break a;c[ea>>2]=Nr(c[V>>2]|0)|0;Gs(c[D>>2]|0,c[(c[(c[ca>>2]|0)+4>>2]|0)+((c[F>>2]|0)*20|0)>>2]|0,c[ea>>2]|0,16);if((c[M>>2]|0)==4)fp(c[V>>2]|0,16,0,c[s>>2]|0)|0;else{c[da>>2]=c[(c[(c[ca>>2]|0)+4>>2]|0)+((c[F>>2]|0)*20|0)+4>>2];if(!(c[da>>2]|0))c[da>>2]=c[c[v>>2]>>2];if((c[M>>2]|0)==5)c[M>>2]=2;ts(c[D>>2]|0,275,c[M>>2]|0,c[da>>2]|0,0,3)}Pr(c[V>>2]|0,c[ea>>2]|0);c[F>>2]=(c[F>>2]|0)+1}}while(0);if((d[I>>0]|0)!=0&(c[H>>2]|0)==0){c[ga>>2]=Nr(c[V>>2]|0)|0;c[M>>2]=d[(c[v>>2]|0)+45>>0];if((d[N>>0]|0)==10){if((c[M>>2]|0)==10)c[M>>2]=2}else c[M>>2]=d[N>>0];if(a[G>>0]|0){ip(c[V>>2]|0,79,c[z>>2]|0,c[ga>>2]|0,c[Q>>2]|0)|0;Xe(c[V>>2]|0,-112)}b:do if((c[M>>2]|0)==5?(d[N>>0]|0)!=5:0){c[w>>2]=c[(c[v>>2]|0)+8>>2];while(1){if(!(c[w>>2]|0))break b;if((d[(c[w>>2]|0)+54>>0]|0)==4)break;if((d[(c[w>>2]|0)+54>>0]|0)==3)break;c[w>>2]=c[(c[w>>2]|0)+20>>2]}c[K>>2]=mp(c[V>>2]|0,16)|0}while(0);ip(c[V>>2]|0,70,c[X>>2]|0,c[ga>>2]|0,c[z>>2]|0)|0;switch(c[M>>2]|0){case 4:{fp(c[V>>2]|0,16,0,c[s>>2]|0)|0;break};case 5:{c[ba>>2]=0;if(c[(c[Y>>2]|0)+24>>2]&262144)c[ba>>2]=lu(c[D>>2]|0,c[v>>2]|0,109,0,0)|0;if((c[ba>>2]|0)==0?(cw(c[D>>2]|0,c[v>>2]|0,0,0)|0)==0:0){if(c[(c[v>>2]|0)+8>>2]|0){dw(c[D>>2]|0);fw(c[D>>2]|0,c[v>>2]|0,c[X>>2]|0,c[A>>2]|0,0)}}else{dw(c[D>>2]|0);ew(c[D>>2]|0,c[v>>2]|0,c[ba>>2]|0,c[X>>2]|0,c[A>>2]|0,c[z>>2]|0,1,0,5,1)}c[W>>2]=1;break};case 3:case 2:case 1:{fa=52;break};default:{c[M>>2]=2;fa=52}}if((fa|0)==52)bw(c[D>>2]|0,c[M>>2]|0,c[v>>2]|0);Pr(c[V>>2]|0,c[ga>>2]|0);if(c[K>>2]|0){c[t>>2]=mp(c[V>>2]|0,16)|0;zp(c[V>>2]|0,c[K>>2]|0)}}c[u>>2]=0;c[w>>2]=c[(c[v>>2]|0)+8>>2];while(1){if(!(c[w>>2]|0))break;do if(c[(c[x>>2]|0)+(c[u>>2]<<2)>>2]|0){if(!(d[y>>0]|0)){su(c[V>>2]|0,c[v>>2]|0,(c[z>>2]|0)+1|0);a[y>>0]=1}c[B>>2]=(c[A>>2]|0)+(c[u>>2]|0);c[C>>2]=Nr(c[V>>2]|0)|0;if(c[(c[w>>2]|0)+36>>2]|0){fp(c[V>>2]|0,28,0,c[(c[x>>2]|0)+(c[u>>2]<<2)>>2]|0)|0;c[(c[D>>2]|0)+92>>2]=(c[z>>2]|0)+1;xs(c[D>>2]|0,c[(c[w>>2]|0)+36>>2]|0,c[C>>2]|0,16);c[(c[D>>2]|0)+92>>2]=0}c[E>>2]=ys(c[D>>2]|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2]<<2)>>2]|0)>=0){j=4;break}if((c[k>>2]|0)!=0?(c[l>>2]|0)==(b[(c[m>>2]|0)+36>>1]|0):0){j=6;break}c[n>>2]=(c[n>>2]|0)+1}if((j|0)==4){c[h>>2]=1;a=c[h>>2]|0;i=g;return a|0}else if((j|0)==6){c[h>>2]=1;a=c[h>>2]|0;i=g;return a|0}else if((j|0)==8){c[h>>2]=0;a=c[h>>2]|0;i=g;return a|0}return 0}function Cu(e,f,g,h,j,k,l,m,n){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;var o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0;t=i;i=i+96|0;u=t+84|0;w=t+80|0;A=t+76|0;E=t+72|0;s=t+68|0;z=t+64|0;y=t+60|0;r=t+56|0;J=t+52|0;v=t+48|0;p=t+44|0;o=t+40|0;q=t+36|0;K=t+32|0;x=t+28|0;I=t+24|0;C=t+20|0;B=t+16|0;D=t+12|0;H=t+8|0;F=t+4|0;G=t;c[u>>2]=e;c[w>>2]=f;c[A>>2]=g;c[E>>2]=h;c[s>>2]=j;c[z>>2]=k;c[y>>2]=l;c[r>>2]=m;c[J>>2]=n;c[p>>2]=dp(c[u>>2]|0)|0;c[o>>2]=(c[(c[u>>2]|0)+68>>2]|0)-1;c[q>>2]=Nr(c[p>>2]|0)|0;if((c[r>>2]|0)<0)fp(c[p>>2]|0,135,d[(c[s>>2]|0)+24>>0]|0,c[q>>2]|0)|0;c[v>>2]=0;while(1){if((c[v>>2]|0)>=(c[(c[s>>2]|0)+20>>2]|0))break;c[K>>2]=(c[(c[z>>2]|0)+(c[v>>2]<<2)>>2]|0)+(c[y>>2]|0)+1;fp(c[p>>2]|0,76,c[K>>2]|0,c[q>>2]|0)|0;c[v>>2]=(c[v>>2]|0)+1}do if(!(c[J>>2]|0)){if(!(c[E>>2]|0)){c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k;c[m>>2]=a;c[n>>2]=e;c[h>>2]=f;c[r>>2]=g;c[o>>2]=0;a:while(1){if((c[o>>2]|0)>=(c[(c[n>>2]|0)+20>>2]|0)){j=14;break}c[p>>2]=c[(c[n>>2]|0)+36+(c[o>>2]<<3)+4>>2];c[l>>2]=0;while(1){if((c[l>>2]|0)>=(b[(c[m>>2]|0)+38>>1]|0))break;if(!((c[(c[h>>2]|0)+(c[l>>2]<<2)>>2]|0)<0?!((c[r>>2]|0)!=0?(c[l>>2]|0)==(b[(c[m>>2]|0)+36>>1]|0):0):0))j=7;do if((j|0)==7){j=0;c[s>>2]=(c[(c[m>>2]|0)+4>>2]|0)+((c[l>>2]|0)*24|0);g=c[s>>2]|0;if(c[p>>2]|0)if(!(xc(c[g>>2]|0,c[p>>2]|0)|0)){j=9;break a}else break;else if(d[g+23>>0]&1){j=11;break a}else break}while(0);c[l>>2]=(c[l>>2]|0)+1}c[o>>2]=(c[o>>2]|0)+1}if((j|0)==9){c[q>>2]=1;a=c[q>>2]|0;i=k;return a|0}else if((j|0)==11){c[q>>2]=1;a=c[q>>2]|0;i=k;return a|0}else if((j|0)==14){c[q>>2]=0;a=c[q>>2]|0;i=k;return a|0}return 0}function Eu(f,g,h,j,k,l,m,n){f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;var o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0;v=i;i=i+144|0;w=v+128|0;J=v+124|0;z=v+120|0;G=v+116|0;t=v+112|0;M=v+108|0;A=v+104|0;o=v+100|0;q=v+96|0;E=v+92|0;r=v+88|0;H=v+56|0;p=v+48|0;s=v+44|0;u=v+40|0;L=v+36|0;O=v+32|0;P=v+28|0;K=v+134|0;N=v+24|0;y=v+20|0;B=v+16|0;x=v+12|0;I=v+8|0;D=v+4|0;F=v;C=v+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}}while(0);if(!((c[n>>2]|0)==1?(Wu(N)|0)!=0:0)){c[U>>2]=Xu(N)|0;if(c[U>>2]|0)break;Yu(c[t>>2]|0,0)|0;if(a[(c[u>>2]|0)+64>>0]|0)break;if((c[(c[t>>2]|0)+8>>2]|0)!=0?(Yu(c[t>>2]|0,(b[(c[t>>2]|0)+32>>1]|0)+1&65535)|0,(a[(c[u>>2]|0)+64>>0]|0)!=0):0)break}if((c[(c[t>>2]|0)+8>>2]|0)==0?(c[(c[u>>2]|0)+24>>2]&131072|0)!=0:0){f=(c[t>>2]|0)+24|0;c[f>>2]=-1;c[f+4>>2]=-1}if((c[(c[L>>2]|0)+64>>2]|0)==0?(d[(c[u>>2]|0)+64>>0]|0)==0:0){b:do if(((c[S>>2]|0)!=0?(d[(c[t>>2]|0)+41>>0]|0)>=2:0)?(e[(c[u>>2]|0)+60>>1]&1024|0)==0:0){g=Zu(c[R>>2]|0,c[S>>2]|0)|0;f=Q;c[f>>2]=g;c[f+4>>2]=D;if(c[N+8>>2]|0){h=Zu(c[R>>2]|0,c[N+8>>2]|0)|0;Z=Q;g=c[Z+4>>2]|D;f=Q;c[f>>2]=c[Z>>2]|h;c[f+4>>2]=g}while(1){if((d[(c[t>>2]|0)+41>>0]|0)<2)break b;c[v>>2]=c[(c[t>>2]|0)+736+(((d[(c[t>>2]|0)+41>>0]|0)-1|0)*72|0)+56>>2];if(!(d[(c[(c[t>>2]|0)+4>>2]|0)+8+((d[(c[v>>2]|0)+16>>0]|0)*72|0)+36>>0]&8))break b;if((e[F>>1]&1024|0)==0?(c[(c[v>>2]|0)+36>>2]&4096|0)==0:0)break b;g=Q;f=(c[v>>2]|0)+8|0;if((c[g>>2]&c[f>>2]|0)!=0?1:(c[g+4>>2]&c[f+4>>2]|0)!=0)break b;c[O>>2]=(c[(c[N+4>>2]|0)+20>>2]|0)+((c[(c[N+4>>2]|0)+12>>2]|0)*48|0);c[P>>2]=c[(c[N+4>>2]|0)+20>>2];while(1){if((c[P>>2]|0)>>>0>=(c[O>>2]|0)>>>0)break;g=(c[P>>2]|0)+40|0;f=(c[v>>2]|0)+8|0;if(((c[g>>2]&c[f>>2]|0)!=0?1:(c[g+4>>2]&c[f+4>>2]|0)!=0)?(c[(c[c[P>>2]>>2]|0)+4>>2]&1|0)==0:0)break;c[P>>2]=(c[P>>2]|0)+48}if((c[P>>2]|0)>>>0<(c[O>>2]|0)>>>0)break b;f=(c[t>>2]|0)+41|0;a[f>>0]=(a[f>>0]|0)+ -1<<24>>24;c[n>>2]=(c[n>>2]|0)+ -1}}while(0);f=(c[c[t>>2]>>2]|0)+424|0;c[f>>2]=(c[f>>2]|0)+(b[(c[t>>2]|0)+32>>1]|0);if(((e[F>>1]&4|0)!=0?(c[(c[(c[t>>2]|0)+792>>2]|0)+36>>2]&4096|0)!=0:0)?(a[(c[t>>2]|0)+38>>0]=1,(d[(c[(c[I>>2]|0)+24>>2]|0)+44>>0]&32|0)==0):0){f=(c[(c[t>>2]|0)+792>>2]|0)+36|0;c[f>>2]=c[f>>2]&-65}f=M;c[f>>2]=-1;c[f+4>>2]=-1;c[K>>2]=0;c[J>>2]=(c[t>>2]|0)+736;while(1){if((c[K>>2]|0)>=(c[n>>2]|0))break;c[y>>2]=(c[I>>2]|0)+8+((d[(c[J>>2]|0)+36>>0]|0)*72|0);c[w>>2]=c[(c[y>>2]|0)+16>>2];c[A>>2]=Ve(c[u>>2]|0,c[(c[w>>2]|0)+68>>2]|0)|0;c[v>>2]=c[(c[J>>2]|0)+56>>2];c:do if((d[(c[w>>2]|0)+44>>0]&2|0)==0?(c[(c[w>>2]|0)+12>>2]|0)==0:0){if(c[(c[v>>2]|0)+36>>2]&1024){c[x>>2]=Rp(c[u>>2]|0,c[w>>2]|0)|0;c[z>>2]=c[(c[y>>2]|0)+40>>2];hp(c[s>>2]|0,147,c[z>>2]|0,0,0,c[x>>2]|0,-10)|0;break}if(d[(c[w>>2]|0)+44>>0]&16)break;do if(!(c[(c[v>>2]|0)+36>>2]&64)){if(e[F>>1]&16)break;c[E>>2]=54;if(a[(c[t>>2]|0)+38>>0]|0){c[E>>2]=55;c[(c[t>>2]|0)+60>>2]=c[(c[y>>2]|0)+40>>2]}Kr(c[L>>2]|0,c[(c[y>>2]|0)+40>>2]|0,c[A>>2]|0,c[w>>2]|0,c[E>>2]|0);if(a[(c[t>>2]|0)+38>>0]|0)break c;if((b[(c[w>>2]|0)+38>>1]|0)>=64)break c;if(d[(c[w>>2]|0)+44>>0]&32)break c;h=(c[y>>2]|0)+56|0;g=c[h+4>>2]|0;f=C;c[f>>2]=c[h>>2];c[f+4>>2]=g;c[B>>2]=0;while(1){f=C;if(!((c[f>>2]|0)!=0|(c[f+4>>2]|0)!=0))break;g=C;g=cF(c[g>>2]|0,c[g+4>>2]|0,1)|0;f=C;c[f>>2]=g;c[f+4>>2]=D;c[B>>2]=(c[B>>2]|0)+1}g=c[s>>2]|0;f=(Mr(c[s>>2]|0)|0)-1|0;bf(g,f,c[B>>2]|0,-14);break c}while(0);Jr(c[L>>2]|0,c[A>>2]|0,c[(c[w>>2]|0)+32>>2]|0,0,c[c[w>>2]>>2]|0)}while(0);do if(c[(c[v>>2]|0)+36>>2]&512){c[G>>2]=c[(c[v>>2]|0)+28>>2];c[H>>2]=54;do if(!(d[(c[w>>2]|0)+44>>0]&32))o=87;else{if((a[(c[G>>2]|0)+55>>0]&3|0)!=2){o=87;break}if(!(e[F>>1]&64)){o=87;break}c[T>>2]=c[(c[J>>2]|0)+4>>2];c[H>>2]=0}while(0);d:do if((o|0)==87){o=0;if(a[(c[t>>2]|0)+38>>0]|0){c[W>>2]=c[(c[(c[y>>2]|0)+16>>2]|0)+8>>2];c[T>>2]=c[p>>2];while(1){if(!(c[W>>2]|0))break;if((c[W>>2]|0)==(c[G>>2]|0))break;c[T>>2]=(c[T>>2]|0)+1;c[W>>2]=c[(c[W>>2]|0)+20>>2]}c[H>>2]=55;c[(c[t>>2]|0)+64>>2]=c[T>>2];break}else{do if(c[p>>2]|0){if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>>0]|0))break;c[r>>2]=0;c[t>>2]=(c[s>>2]|0)+8+((d[(c[p>>2]|0)+36>>0]|0)*72|0);c[u>>2]=c[(c[t>>2]|0)+16>>2];c[g>>2]=c[(c[p>>2]|0)+56>>2];a:do if(((d[(c[t>>2]|0)+37>>0]|0)>>>2&1|0)!=0?(a[(c[k>>2]|0)+64>>0]|0)==0:0){c[n>>2]=Mr(c[o>>2]|0)|0;c[m>>2]=c[(c[p>>2]|0)+32>>2];c[q>>2]=dt(c[o>>2]|0,c[m>>2]|0)|0;while(1){if((c[m>>2]|0)>=(c[n>>2]|0))break a;do if((c[(c[q>>2]|0)+4>>2]|0)==(c[(c[p>>2]|0)+4>>2]|0)){A=c[q>>2]|0;if((d[c[q>>2]>>0]|0)==47){a[A>>0]=33;c[(c[q>>2]|0)+4>>2]=(c[(c[q>>2]|0)+8>>2]|0)+(c[(c[t>>2]|0)+32>>2]|0);c[(c[q>>2]|0)+8>>2]=c[(c[q>>2]|0)+12>>2];c[(c[q>>2]|0)+12>>2]=0;break}if((d[A>>0]|0)==103){a[c[q>>2]>>0]=28;c[(c[q>>2]|0)+4>>2]=0;c[(c[q>>2]|0)+12>>2]=0}}while(0);c[m>>2]=(c[m>>2]|0)+1;c[q>>2]=(c[q>>2]|0)+20}}else h=35;while(0);b:do if((h|0)==35){h=0;if(((d[(c[u>>2]|0)+44>>0]&2|0)==0?(c[(c[u>>2]|0)+12>>2]|0)==0:0)?(e[(c[v>>2]|0)+34>>1]&16|0)==0:0){c[z>>2]=c[(c[g>>2]|0)+36>>2];if((a[(c[v>>2]|0)+38>>0]|0)==0?(c[z>>2]&64|0)==0:0)Ir(c[o>>2]|0,61,c[(c[t>>2]|0)+40>>2]|0)|0;if(((c[z>>2]&512|0)!=0?(c[z>>2]&16640|0)==0:0)?(c[(c[p>>2]|0)+8>>2]|0)!=(c[(c[v>>2]|0)+64>>2]|0):0)Ir(c[o>>2]|0,61,c[(c[p>>2]|0)+8>>2]|0)|0}A=c[g>>2]|0;if(!(c[(c[g>>2]|0)+36>>2]&576)){if(c[A+36>>2]&8192)c[r>>2]=c[(c[p>>2]|0)+48>>2]}else c[r>>2]=c[A+28>>2];if((c[r>>2]|0)!=0?(a[(c[k>>2]|0)+64>>0]|0)==0:0){c[n>>2]=Mr(c[o>>2]|0)|0;c[m>>2]=c[(c[p>>2]|0)+32>>2];c[q>>2]=dt(c[o>>2]|0,c[m>>2]|0)|0;while(1){if((c[m>>2]|0)>=(c[n>>2]|0))break b;do if((c[(c[q>>2]|0)+4>>2]|0)==(c[(c[p>>2]|0)+4>>2]|0)){A=c[q>>2]|0;if((d[c[q>>2]>>0]|0)!=47){if((d[A>>0]|0)!=103)break;c[(c[q>>2]|0)+4>>2]=c[(c[p>>2]|0)+8>>2];a[c[q>>2]>>0]=112;break}c[x>>2]=c[A+8>>2];if(d[(c[u>>2]|0)+44>>0]&32){c[y>>2]=Zr(c[u>>2]|0)|0;c[x>>2]=b[(c[(c[y>>2]|0)+4>>2]|0)+(c[x>>2]<<1)>>1]}c[x>>2]=(Ds(c[r>>2]|0,c[x>>2]&65535)|0)<<16>>16;if((c[x>>2]|0)>=0){c[(c[q>>2]|0)+8>>2]=c[x>>2];c[(c[q>>2]|0)+4>>2]=c[(c[p>>2]|0)+8>>2]}}while(0);c[m>>2]=(c[m>>2]|0)+1;c[q>>2]=(c[q>>2]|0)+20}}}while(0);c[w>>2]=(c[w>>2]|0)+1;c[p>>2]=(c[p>>2]|0)+72}c[(c[j>>2]|0)+424>>2]=c[(c[v>>2]|0)+56>>2];Ju(c[k>>2]|0,c[v>>2]|0);i=l;return}function Ju(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;e=d+8|0;f=d+4|0;g=d;c[e>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){i=d;return}Ku((c[f>>2]|0)+328|0);while(1){if(!(c[(c[f>>2]|0)+16>>2]|0))break;c[g>>2]=c[(c[f>>2]|0)+16>>2];c[(c[f>>2]|0)+16>>2]=c[(c[g>>2]|0)+48>>2];Lu(c[e>>2]|0,c[g>>2]|0)}Xb(c[e>>2]|0,c[f>>2]|0);i=d;return}function Ku(a){a=a|0;var b=0,e=0,f=0,g=0,h=0;b=i;i=i+16|0;f=b+12|0;h=b+8|0;g=b+4|0;e=b;c[f>>2]=a;c[e>>2]=c[c[c[c[f>>2]>>2]>>2]>>2];c[h>>2]=(c[(c[f>>2]|0)+12>>2]|0)-1;c[g>>2]=c[(c[f>>2]|0)+20>>2];while(1){if((c[h>>2]|0)<0)break;if((d[(c[g>>2]|0)+20>>0]|0)&1)wn(c[e>>2]|0,c[c[g>>2]>>2]|0);if(!((d[(c[g>>2]|0)+20>>0]|0)&16)){if((d[(c[g>>2]|0)+20>>0]|0)&32)Qu(c[e>>2]|0,c[(c[g>>2]|0)+12>>2]|0)}else Pu(c[e>>2]|0,c[(c[g>>2]|0)+12>>2]|0);c[h>>2]=(c[h>>2]|0)+ -1;c[g>>2]=(c[g>>2]|0)+48}if((c[(c[f>>2]|0)+20>>2]|0)==((c[f>>2]|0)+24|0)){i=b;return}Xb(c[e>>2]|0,c[(c[f>>2]|0)+20>>2]|0);i=b;return}function Lu(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;Mu(c[f>>2]|0,c[e>>2]|0);Xb(c[f>>2]|0,c[e>>2]|0);i=d;return}function Mu(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;if((c[(c[e>>2]|0)+44>>2]|0)!=((c[e>>2]|0)+52|0))Xb(c[f>>2]|0,c[(c[e>>2]|0)+44>>2]|0);Nu(c[f>>2]|0,c[e>>2]|0);Ou(c[e>>2]|0);i=d;return}function Nu(b,e){b=b|0;e=e|0;var f=0,g=0,h=0;f=i;i=i+16|0;h=f+4|0;g=f;c[h>>2]=b;c[g>>2]=e;if(!(c[(c[g>>2]|0)+36>>2]&17408)){i=f;return}if((c[(c[g>>2]|0)+36>>2]&1024|0)!=0?(d[(c[g>>2]|0)+28>>0]|0|0)!=0:0){hc(c[(c[g>>2]|0)+32>>2]|0);a[(c[g>>2]|0)+28>>0]=0;c[(c[g>>2]|0)+32>>2]=0;i=f;return}if(!(c[(c[g>>2]|0)+36>>2]&16384)){i=f;return}if(!(c[(c[g>>2]|0)+28>>2]|0)){i=f;return}Xb(c[h>>2]|0,c[(c[(c[g>>2]|0)+28>>2]|0)+16>>2]|0);eh(c[(c[(c[g>>2]|0)+28>>2]|0)+40>>2]|0);Xb(c[h>>2]|0,c[(c[g>>2]|0)+28>>2]|0);c[(c[g>>2]|0)+28>>2]=0;i=f;return}function Ou(a){a=a|0;var d=0,e=0;d=i;i=i+16|0;e=d;c[e>>2]=a;c[(c[e>>2]|0)+44>>2]=(c[e>>2]|0)+52;b[(c[e>>2]|0)+40>>1]=0;b[(c[e>>2]|0)+42>>1]=4;c[(c[e>>2]|0)+36>>2]=0;i=d;return}function Pu(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;Ku(c[e>>2]|0);Xb(c[f>>2]|0,c[e>>2]|0);i=d;return}function Qu(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;Ku(c[e>>2]|0);Xb(c[f>>2]|0,c[e>>2]|0);i=d;return}function Ru(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;c[c[e>>2]>>2]=c[f>>2];c[(c[e>>2]|0)+4>>2]=0;c[(c[e>>2]|0)+12>>2]=0;c[(c[e>>2]|0)+16>>2]=8;c[(c[e>>2]|0)+20>>2]=(c[e>>2]|0)+24;i=d;return}function Su(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0;g=i;i=i+16|0;j=g+4|0;k=g;h=g+8|0;c[j>>2]=b;c[k>>2]=e;a[h>>0]=f;a[(c[j>>2]|0)+8>>0]=a[h>>0]|0;if(!(c[k>>2]|0)){i=g;return}e=c[j>>2]|0;f=c[k>>2]|0;if((d[c[k>>2]>>0]|0|0)!=(d[h>>0]|0|0)){Uv(e,f,0)|0;i=g;return}else{Su(e,c[f+12>>2]|0,a[h>>0]|0);Su(c[j>>2]|0,c[(c[k>>2]|0)+16>>2]|0,a[h>>0]|0);i=g;return}}function Tu(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;b=c[f>>2]|0;f=c[e>>2]|0;a=c[f>>2]|0;c[f>>2]=a+1;c[(c[e>>2]|0)+4+(a<<2)>>2]=b;i=d;return}function Uu(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;f=d+8|0;g=d+4|0;e=d;c[f>>2]=a;c[g>>2]=b;c[e>>2]=(c[(c[g>>2]|0)+12>>2]|0)-1;while(1){if((c[e>>2]|0)<0)break;Rv(c[f>>2]|0,c[g>>2]|0,c[e>>2]|0);c[e>>2]=(c[e>>2]|0)+ -1}i=d;return}function Vu(a,f,g,h){a=a|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;s=i;i=i+48|0;l=s+40|0;o=s+36|0;w=s+32|0;t=s+28|0;p=s+24|0;u=s+20|0;n=s+16|0;m=s+12|0;q=s+8|0;v=s+4|0;j=s+44|0;r=s;c[o>>2]=a;c[w>>2]=f;c[t>>2]=g;c[p>>2]=h;if((c[c[w>>2]>>2]|0)!=1){c[l>>2]=0;a=c[l>>2]|0;i=s;return a|0}c[q>>2]=c[(c[w>>2]|0)+48>>2];c[u>>2]=c[(c[w>>2]|0)+24>>2];c[m>>2]=0;while(1){if((c[m>>2]|0)>=(c[c[p>>2]>>2]|0))break;c[v>>2]=iq(c[(c[(c[p>>2]|0)+4>>2]|0)+((c[m>>2]|0)*20|0)>>2]|0)|0;if(((d[c[v>>2]>>0]|0)==154?(c[(c[v>>2]|0)+28>>2]|0)==(c[q>>2]|0):0)?(b[(c[v>>2]|0)+32>>1]|0)<0:0){k=8;break}c[m>>2]=(c[m>>2]|0)+1}if((k|0)==8){c[l>>2]=1;a=c[l>>2]|0;i=s;return a|0}c[n>>2]=c[(c[u>>2]|0)+8>>2];while(1){if(!(c[n>>2]|0)){k=22;break}if(d[(c[n>>2]|0)+54>>0]|0){c[m>>2]=0;while(1){if((c[m>>2]|0)>=(e[(c[n>>2]|0)+50>>1]|0))break;b[j>>1]=b[(c[(c[n>>2]|0)+4>>2]|0)+(c[m>>2]<<1)>>1]|0;if(!(hv(c[t>>2]|0,c[q>>2]|0,b[j>>1]|0,-1,-1,2,c[n>>2]|0)|0)){c[r>>2]=Qv(c[o>>2]|0,c[p>>2]|0,c[q>>2]|0,c[n>>2]|0,c[m>>2]|0)|0;if((c[r>>2]|0)<0)break;if(!(d[(c[(c[u>>2]|0)+4>>2]|0)+((b[j>>1]|0)*24|0)+20>>0]|0))break}c[m>>2]=(c[m>>2]|0)+1}if((c[m>>2]|0)==(e[(c[n>>2]|0)+50>>1]|0)){k=20;break}}c[n>>2]=c[(c[n>>2]|0)+20>>2]}if((k|0)==20){c[l>>2]=1;a=c[l>>2]|0;i=s;return a|0}else if((k|0)==22){c[l>>2]=0;a=c[l>>2]|0;i=s;return a|0}return 0}function Wu(f){f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;m=i;i=i+48|0;h=m+40|0;s=m+36|0;q=m+32|0;o=m+28|0;r=m+24|0;k=m+20|0;j=m+16|0;p=m+12|0;l=m+8|0;n=m+4|0;g=m;c[s>>2]=f;c[q>>2]=c[c[s>>2]>>2];if(e[(c[q>>2]|0)+34>>1]&32){c[h>>2]=0;s=c[h>>2]|0;i=m;return s|0}c[o>>2]=(c[(c[q>>2]|0)+4>>2]|0)+8;c[n>>2]=c[(c[o>>2]|0)+16>>2];if(d[(c[n>>2]|0)+44>>0]&16){c[h>>2]=0;s=c[h>>2]|0;i=m;return s|0}if(c[(c[o>>2]|0)+64>>2]|0){c[h>>2]=0;s=c[h>>2]|0;i=m;return s|0}c[p>>2]=c[(c[o>>2]|0)+40>>2];c[r>>2]=(c[q>>2]|0)+328;c[j>>2]=c[(c[s>>2]|0)+12>>2];c[(c[j>>2]|0)+36>>2]=0;b[(c[j>>2]|0)+26>>1]=0;c[k>>2]=hv(c[r>>2]|0,c[p>>2]|0,-1,0,0,2,0)|0;a:do if(c[k>>2]|0){c[(c[j>>2]|0)+36>>2]=4353;c[c[(c[j>>2]|0)+44>>2]>>2]=c[k>>2];b[(c[j>>2]|0)+40>>1]=1;b[(c[j>>2]|0)+24>>1]=1;b[(c[j>>2]|0)+20>>1]=33}else{c[g>>2]=c[(c[n>>2]|0)+8>>2];while(1){if(!(c[g>>2]|0))break a;if(((d[(c[g>>2]|0)+54>>0]|0)!=0?(c[(c[g>>2]|0)+36>>2]|0)==0:0)?(e[(c[g>>2]|0)+50>>1]|0)<=4:0){c[l>>2]=0;while(1){if((c[l>>2]|0)>=(e[(c[g>>2]|0)+50>>1]|0))break;c[k>>2]=hv(c[r>>2]|0,c[p>>2]|0,b[(c[(c[g>>2]|0)+4>>2]|0)+(c[l>>2]<<1)>>1]|0,0,0,2,c[g>>2]|0)|0;if(!(c[k>>2]|0))break;c[(c[(c[j>>2]|0)+44>>2]|0)+(c[l>>2]<<2)>>2]=c[k>>2];c[l>>2]=(c[l>>2]|0)+1}if((c[l>>2]|0)==(e[(c[g>>2]|0)+50>>1]|0))break}c[g>>2]=c[(c[g>>2]|0)+20>>2]}c[(c[j>>2]|0)+36>>2]=4609;if(!(((d[(c[g>>2]|0)+55>>0]|0)>>>5&1|0)==0?(s=(c[o>>2]|0)+56|0,o=c[s>>2]|0,s=c[s+4>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(c[q>>2]|0)){j=13;break}a[(c[g>>2]|0)+16>>0]=c[o>>2];r=_u((c[p>>2]|0)+68|0,c[(c[l>>2]|0)+40>>2]|0)|0;s=(c[g>>2]|0)+8|0;c[s>>2]=r;c[s+4>>2]=D;if((d[(c[l>>2]|0)+36>>0]|0|(d[n>>0]|0))&10){b=m;r=c[b+4>>2]|0;s=k;c[s>>2]=c[b>>2];c[s+4>>2]=r}a[n>>0]=a[(c[l>>2]|0)+36>>0]|0;b=c[j>>2]|0;s=k;r=c[s>>2]|0;s=c[s+4>>2]|0;if((d[(c[(c[l>>2]|0)+16>>2]|0)+44>>0]|0)&16)c[f>>2]=vv(b,r,s)|0;else c[f>>2]=wv(b,r,s)|0;if(!(c[f>>2]|0)){s=k;c[f>>2]=xv(c[j>>2]|0,c[s>>2]|0,c[s+4>>2]|0)|0}b=(c[g>>2]|0)+8|0;t=m;r=c[t+4>>2]|c[b+4>>2];s=m;c[s>>2]=c[t>>2]|c[b>>2];c[s+4>>2]=r;if(c[f>>2]|0){j=13;break}if(d[(c[h>>2]|0)+64>>0]|0){j=13;break}c[o>>2]=(c[o>>2]|0)+1;c[l>>2]=(c[l>>2]|0)+72}if((j|0)==13){Mu(c[h>>2]|0,c[g>>2]|0);i=e;return c[f>>2]|0}return 0}function Yu(f,g){f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0;q=i;i=i+160|0;y=q+32|0;j=q+132|0;m=q+128|0;t=q+146|0;P=q+124|0;p=q+120|0;E=q+116|0;k=q+112|0;u=q+108|0;B=q+104|0;N=q+100|0;S=q+96|0;K=q+92|0;Q=q+144|0;R=q+142|0;D=q+88|0;C=q+84|0;A=q+80|0;x=q+76|0;o=q+72|0;O=q+68|0;w=q+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(c[m>>2]|0,b[t>>1]|0,c[K>>2]|0,a[F>>0]|0)|0;b[(c[L>>2]|0)+(a[F>>0]<<1)>>1]=f}b[M>>1]=rv(b[H>>1]|0,b[(c[L>>2]|0)+(a[F>>0]<<1)>>1]|0)|0}else b[M>>1]=b[H>>1]|0;c[N>>2]=0;c[O>>2]=c[x>>2];while(1){if((c[N>>2]|0)>=(c[D>>2]|0))break;g=c[O>>2]|0;f=J;if(((c[g>>2]|0)==(c[f>>2]|0)?(c[g+4>>2]|0)==(c[f+4>>2]|0):0)?((a[(c[O>>2]|0)+22>>0]^a[F>>0])&128|0)==0:0)break;c[N>>2]=(c[N>>2]|0)+1;c[O>>2]=(c[O>>2]|0)+32}do if((c[N>>2]|0)<(c[D>>2]|0)){if((b[(c[O>>2]|0)+18>>1]|0)<(b[M>>1]|0))break a;if((b[(c[O>>2]|0)+18>>1]|0)!=(b[M>>1]|0))break;if((b[(c[O>>2]|0)+16>>1]|0)<=(b[I>>1]|0))break a}else{do if((c[D>>2]|0)>=(c[P>>2]|0)){if((b[M>>1]|0)>(b[Q>>1]|0))break a;if((b[M>>1]|0)!=(b[Q>>1]|0))break;if((b[H>>1]|0)>=(b[R>>1]|0))break a}while(0);if((c[D>>2]|0)<(c[P>>2]|0)){f=c[D>>2]|0;c[D>>2]=f+1;c[N>>2]=f}else c[N>>2]=c[S>>2];c[O>>2]=(c[x>>2]|0)+(c[N>>2]<<5)}while(0);T=c[o>>2]|0;f=(c[w>>2]|0)+8|0;g=c[T+4>>2]|c[f+4>>2];U=c[O>>2]|0;c[U>>2]=c[T>>2]|c[f>>2];c[U+4>>2]=g;U=G;g=c[U+4>>2]|0;f=(c[O>>2]|0)+8|0;c[f>>2]=c[U>>2];c[f+4>>2]=g;b[(c[O>>2]|0)+16>>1]=b[I>>1]|0;b[(c[O>>2]|0)+18>>1]=b[M>>1]|0;b[(c[O>>2]|0)+20>>1]=b[H>>1]|0;a[(c[O>>2]|0)+22>>0]=a[F>>0]|0;dF(c[(c[O>>2]|0)+24>>2]|0,c[(c[o>>2]|0)+24>>2]|0,c[u>>2]<<2|0)|0;c[(c[(c[O>>2]|0)+24>>2]|0)+(c[u>>2]<<2)>>2]=c[w>>2];if((c[D>>2]|0)>=(c[P>>2]|0)){c[S>>2]=0;b[Q>>1]=b[(c[x>>2]|0)+18>>1]|0;b[R>>1]=b[(c[x>>2]|0)+16>>1]|0;c[N>>2]=1;c[O>>2]=(c[x>>2]|0)+32;while(1){if((c[N>>2]|0)>=(c[P>>2]|0))break a;do if((b[(c[O>>2]|0)+18>>1]|0)<=(b[Q>>1]|0)){if((b[(c[O>>2]|0)+18>>1]|0)!=(b[Q>>1]|0))break;if((b[(c[O>>2]|0)+20>>1]|0)>(b[R>>1]|0))z=58}else z=58;while(0);if((z|0)==58){z=0;b[Q>>1]=b[(c[O>>2]|0)+18>>1]|0;b[R>>1]=b[(c[O>>2]|0)+20>>1]|0;c[S>>2]=c[N>>2]}c[N>>2]=(c[N>>2]|0)+1;c[O>>2]=(c[O>>2]|0)+32}}}while(0);c[w>>2]=c[(c[w>>2]|0)+48>>2]}c[B>>2]=(c[B>>2]|0)+1;c[o>>2]=(c[o>>2]|0)+32}c[o>>2]=c[x>>2];c[x>>2]=c[A>>2];c[A>>2]=c[o>>2];c[C>>2]=c[D>>2];c[u>>2]=(c[u>>2]|0)+1}if(!(c[C>>2]|0)){Se(c[E>>2]|0,24032,y);Xb(c[k>>2]|0,c[l>>2]|0);c[j>>2]=1;f=c[j>>2]|0;i=q;return f|0}c[o>>2]=c[A>>2];c[B>>2]=1;while(1){if((c[B>>2]|0)>=(c[C>>2]|0))break;if((b[(c[o>>2]|0)+18>>1]|0)>(b[(c[A>>2]|0)+(c[B>>2]<<5)+18>>1]|0))c[o>>2]=(c[A>>2]|0)+(c[B>>2]<<5);c[B>>2]=(c[B>>2]|0)+1}c[u>>2]=0;while(1){x=c[m>>2]|0;if((c[u>>2]|0)>=(c[p>>2]|0))break;c[v>>2]=x+736+((c[u>>2]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b=b+4|0;b=c[b>>2]|0;D=b;i=e;return a|0}else if((f|0)==6){b=d;c[b>>2]=0;c[b+4>>2]=0;b=d;a=b;a=c[a>>2]|0;b=b+4|0;b=c[b>>2]|0;D=b;i=e;return a|0}return 0}function $u(d,e,f,g,h,j){d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0;F=i;i=i+144|0;O=F+40|0;o=F+132|0;J=F+128|0;v=F+124|0;l=F+32|0;p=F+120|0;r=F+116|0;y=F+112|0;G=F+108|0;m=F+104|0;q=F+100|0;u=F+96|0;H=F+92|0;s=F+88|0;t=F+84|0;n=F+80|0;x=F+76|0;k=F+72|0;C=F+68|0;I=F+64|0;K=F+60|0;B=F+24|0;w=F+16|0;P=F+136|0;N=F+56|0;M=F+8|0;E=F+52|0;A=F;z=F+48|0;c[o>>2]=d;c[J>>2]=e;c[v>>2]=f;d=l;c[d>>2]=g;c[d+4>>2]=h;c[p>>2]=j;a[P>>0]=0;c[q>>2]=c[(c[o>>2]|0)+8>>2];c[u>>2]=_s(c[o>>2]|0)|0;c[r>>2]=0;c[H>>2]=c[(c[v>>2]|0)+16>>2];c[G>>2]=(c[(c[J>>2]|0)+20>>2]|0)+((c[(c[J>>2]|0)+12>>2]|0)*48|0);c[I>>2]=c[(c[p>>2]|0)+56>>2];h=B;c[h>>2]=0;c[h+4>>2]=0;c[y>>2]=c[(c[J>>2]|0)+20>>2];while(1){if((c[y>>2]|0)>>>0>=(c[G>>2]|0)>>>0)break;h=l;if(mv(c[y>>2]|0,c[v>>2]|0,c[h>>2]|0,c[h+4>>2]|0)|0){c[N>>2]=c[(c[y>>2]|0)+12>>2];if((c[N>>2]|0)>=64){g=0;j=-2147483648}else{g=$E(1,0,c[N>>2]|0)|0;j=D}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B+76|0;q=B+72|0;D=B+68|0;r=B+64|0;z=B+60|0;x=B+56|0;A=B+52|0;p=B+48|0;o=B+20|0;C=B+104|0;u=B+16|0;v=B+12|0;m=B+8|0;c[H>>2]=f;c[F>>2]=g;c[G>>2]=h;c[s>>2]=j;c[t>>2]=k;b[E>>1]=l;if((d[(c[H>>2]|0)+450>>0]|0|0)!=2){i=B;return}c[y>>2]=(c[F>>2]|0)+8+((d[(c[G>>2]|0)+36>>0]|0)*72|0);c[q>>2]=c[(c[H>>2]|0)+8>>2];c[D>>2]=c[c[H>>2]>>2];c[r>>2]=c[(c[H>>2]|0)+464>>2];c[x>>2]=c[(c[G>>2]|0)+56>>2];c[A>>2]=c[(c[x>>2]|0)+36>>2];if(c[A>>2]&8192){i=B;return}if((e[E>>1]|0)&64){i=B;return}do if(c[A>>2]&48)E=1;else{if((c[A>>2]&1024|0)==0?(e[(c[x>>2]|0)+24>>1]|0|0)>0:0){E=1;break}E=((e[E>>1]|0)&3|0)!=0}while(0);c[z>>2]=E&1;nc(o,C,100,1e9);c[o>>2]=c[D>>2];ss(o,(c[z>>2]|0)!=0?23640:23648);C=c[y>>2]|0;if(c[(c[y>>2]|0)+20>>2]|0){c[w>>2]=d[C+38>>0];kn(o,0,23656,w)}else{c[w>>2]=c[C+8>>2];kn(o,0,23672,w)}if(c[(c[y>>2]|0)+12>>2]|0){c[w>>2]=c[(c[y>>2]|0)+12>>2];kn(o,0,23688,w)}do if(!(c[A>>2]&1280)){c[u>>2]=0;c[v>>2]=c[(c[x>>2]|0)+28>>2];if(((d[(c[(c[y>>2]|0)+16>>2]|0)+44>>0]|0)&32|0)!=0?(a[(c[v>>2]|0)+55>>0]&3|0)==2:0){if(c[z>>2]|0)c[u>>2]=23696}else n=18;do if((n|0)==18){if(c[A>>2]&16384){c[u>>2]=23712;break}if(c[A>>2]&64){c[u>>2]=23744;break}else{c[u>>2]=23768;break}}while(0);if(c[u>>2]|0){Vm(o,23784,7);f=c[u>>2]|0;c[w>>2]=c[c[v>>2]>>2];kn(o,0,f,w);kv(o,c[x>>2]|0,c[(c[y>>2]|0)+16>>2]|0)}}else{if((c[A>>2]&256|0)!=0?(c[A>>2]&15|0)!=0:0){do if(!(c[A>>2]&5)){if((c[A>>2]&48|0)==48){c[m>>2]=23808;break}if(c[A>>2]&32){c[m>>2]=23832;break}else{c[m>>2]=23848;break}}else c[m>>2]=23792;while(0);ss(o,23864);ss(o,c[m>>2]|0);break}if(c[A>>2]&1024){f=c[(c[x>>2]|0)+32>>2]|0;c[w>>2]=c[(c[x>>2]|0)+24>>2];c[w+4>>2]=f;kn(o,0,23896,w)}}while(0);c[p>>2]=pc(o)|0;hp(c[q>>2]|0,155,c[r>>2]|0,c[s>>2]|0,c[t>>2]|0,c[p>>2]|0,-1)|0;i=B;return}function bv(f,g,h,j){f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0,Qa=0,Ra=0,Sa=0,Ta=0,Ua=0,Va=0,Wa=0,Xa=0;q=i;i=i+368|0;p=q+8|0;y=q+344|0;N=q+340|0;v=q;o=q+336|0;B=q+332|0;w=q+328|0;ma=q+324|0;ua=q+320|0;C=q+316|0;A=q+312|0;E=q+308|0;m=q+304|0;n=q+300|0;u=q+296|0;r=q+292|0;l=q+288|0;Ea=q+284|0;Ja=q+280|0;x=q+276|0;oa=q+272|0;Ra=q+268|0;Xa=q+264|0;Fa=q+260|0;Ha=q+256|0;Ga=q+252|0;Ia=q+248|0;Na=q+244|0;Va=q+240|0;Pa=q+236|0;Qa=q+232|0;Ua=q+228|0;Wa=q+224|0;Sa=q+220|0;Oa=q+216|0;Ta=q+212|0;Aa=q+350|0;xa=q+208|0;sa=q+204|0;ta=q+200|0;ra=q+196|0;va=q+192|0;la=q+188|0;ya=q+184|0;qa=q+180|0;T=q+176|0;Ma=q+172|0;wa=q+168|0;za=q+164|0;Ba=q+355|0;ka=q+354|0;Da=q+353|0;Ka=q+160|0;La=q+352|0;na=q+156|0;Ca=q+152|0;pa=q+148|0;X=q+144|0;aa=q+140|0;W=q+136|0;P=q+132|0;ca=q+128|0;ea=q+124|0;ga=q+120|0;F=q+116|0;da=q+112|0;L=q+108|0;ja=q+104|0;ia=q+348|0;Z=q+100|0;ba=q+96|0;$=q+92|0;_=q+88|0;fa=q+84|0;ha=q+80|0;Y=q+76|0;S=q+72|0;O=q+68|0;R=q+64|0;Q=q+60|0;H=q+56|0;K=q+52|0;M=q+48|0;J=q+44|0;I=q+40|0;G=q+36|0;V=q+32|0;z=q+28|0;k=q+24|0;s=q+20|0;t=q+16|0;c[y>>2]=f;c[N>>2]=g;g=v;c[g>>2]=h;c[g+4>>2]=j;c[oa>>2]=0;c[Ra>>2]=0;c[u>>2]=c[c[y>>2]>>2];c[l>>2]=c[(c[u>>2]|0)+8>>2];c[m>>2]=(c[y>>2]|0)+328;c[r>>2]=c[c[u>>2]>>2];c[A>>2]=(c[y>>2]|0)+736+((c[N>>2]|0)*72|0);c[E>>2]=c[(c[A>>2]|0)+56>>2];c[Ea>>2]=(c[(c[y>>2]|0)+4>>2]|0)+8+((d[(c[A>>2]|0)+36>>0]|0)*72|0);c[w>>2]=c[(c[Ea>>2]|0)+40>>2];g=v;j=c[g>>2]|0;g=c[g+4>>2]|0;h=_u((c[y>>2]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>>2]|0,c[T>>2]|0,c[ma>>2]|0,c[xa>>2]|0,c[ya>>2]|0)|0}dv(c[A>>2]|0,c[sa>>2]|0);dv(c[A>>2]|0,c[ta>>2]|0);do if(!(c[ua>>2]|0)){if(!(d[(c[(c[qa>>2]|0)+12>>2]|0)+44>>0]&32)){g=(c[u>>2]|0)+72|0;f=(c[g>>2]|0)+1|0;c[g>>2]=f;c[oa>>2]=f;fp(c[l>>2]|0,112,c[T>>2]|0,c[oa>>2]|0)|0;jt(c[u>>2]|0,c[w>>2]|0,-1,c[oa>>2]|0);fp(c[l>>2]|0,66,c[w>>2]|0,c[oa>>2]|0)|0;break}if((c[w>>2]|0)==(c[T>>2]|0))break;c[pa>>2]=Zr(c[(c[qa>>2]|0)+12>>2]|0)|0;c[oa>>2]=ys(c[u>>2]|0,e[(c[pa>>2]|0)+50>>1]|0)|0;c[o>>2]=0;while(1){if((c[o>>2]|0)>=(e[(c[pa>>2]|0)+50>>1]|0))break;c[B>>2]=(Ds(c[qa>>2]|0,b[(c[(c[pa>>2]|0)+4>>2]|0)+(c[o>>2]<<1)>>1]|0)|0)<<16>>16;ip(c[l>>2]|0,47,c[T>>2]|0,c[B>>2]|0,(c[oa>>2]|0)+(c[o>>2]|0)|0)|0;c[o>>2]=(c[o>>2]|0)+1}We(c[l>>2]|0,68,c[w>>2]|0,c[x>>2]|0,c[oa>>2]|0,e[(c[pa>>2]|0)+50>>1]|0)|0}while(0);do if(!(c[(c[E>>2]|0)+36>>2]&4096)){B=(c[A>>2]|0)+37|0;if(c[C>>2]|0){a[B>>0]=8;break}else{a[B>>0]=9;break}}else a[(c[A>>2]|0)+37>>0]=-102;while(0);c[(c[A>>2]|0)+40>>2]=c[T>>2];a[(c[A>>2]|0)+38>>0]=(c[(c[E>>2]|0)+36>>2]&65536|0)!=0?1:0;if(c[(c[E>>2]|0)+36>>2]&15)break;a[(c[A>>2]|0)+39>>0]=1;break}if(!(c[Fa+36>>2]&8192))if((d[(c[Ea>>2]|0)+37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(c[o>>2]|0)){c[t>>2]=0;e=c[m>>2]|0;b=c[l>>2]|0;dv(e,b);b=c[k>>2]|0;i=q;return b|0}c[o>>2]=(c[o>>2]|0)+(((c[t>>2]|0)-1|0)*12|0);c[c[o>>2]>>2]=c[s>>2];t=c[n>>2]|0;u=c[s>>2]|0;s=c[k>>2]|0;if((c[r>>2]|0)==1){b=fp(t,103,u,s)|0;c[(c[o>>2]|0)+4>>2]=b}else{b=ip(t,47,u,0,s)|0;c[(c[o>>2]|0)+4>>2]=b}a[(c[o>>2]|0)+8>>0]=(c[p>>2]|0)!=0?6:7;Ir(c[n>>2]|0,76,c[k>>2]|0)|0;e=c[m>>2]|0;b=c[l>>2]|0;dv(e,b);b=c[k>>2]|0;i=q;return b|0}function dv(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0;f=i;i=i+16|0;j=f+8|0;g=f+4|0;h=f;c[j>>2]=b;c[g>>2]=e;if(!(c[g>>2]|0)){i=f;return}if((d[(c[g>>2]|0)+20>>0]|0)&4){i=f;return}if((c[c[j>>2]>>2]|0)!=0?(c[(c[c[g>>2]>>2]|0)+4>>2]&1|0)==0:0){i=f;return}e=(c[j>>2]|0)+64|0;b=(c[g>>2]|0)+40|0;if(!((c[e>>2]&c[b>>2]|0)==0?(c[e+4>>2]&c[b+4>>2]|0)==0:0)){i=f;return}b=(c[g>>2]|0)+20|0;a[b>>0]=d[b>>0]|0|4;if((c[(c[g>>2]|0)+4>>2]|0)<0){i=f;return}c[h>>2]=(c[(c[(c[g>>2]|0)+24>>2]|0)+20>>2]|0)+((c[(c[g>>2]|0)+4>>2]|0)*48|0);g=(c[h>>2]|0)+21|0;b=(a[g>>0]|0)+ -1<<24>>24;a[g>>0]=b;if(b&255){i=f;return}dv(c[j>>2]|0,c[h>>2]|0);i=f;return}function ev(d,f,g,h,j){d=d|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,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+44>>2]|0)+(c[q>>2]<<2)>>2];c[v>>2]=cv(c[s>>2]|0,c[r>>2]|0,c[t>>2]|0,c[q>>2]|0,c[k>>2]|0,(c[n>>2]|0)+(c[q>>2]|0)|0)|0;do if((c[v>>2]|0)!=((c[n>>2]|0)+(c[q>>2]|0)|0))if((c[o>>2]|0)==1){lp(c[s>>2]|0,c[n>>2]|0);c[n>>2]=c[v>>2];break}else{fp(c[y>>2]|0,34,c[v>>2]|0,(c[n>>2]|0)+(c[q>>2]|0)|0)|0;break}while(0);if(!(e[(c[r>>2]|0)+18>>1]&129)){c[A>>2]=c[(c[c[r>>2]>>2]|0)+16>>2];if(Ps(c[A>>2]|0)|0)fp(c[y>>2]|0,76,(c[n>>2]|0)+(c[q>>2]|0)|0,c[(c[t>>2]|0)+12>>2]|0)|0;if(c[u>>2]|0){if(((kt(c[A>>2]|0,a[(c[u>>2]|0)+(c[q>>2]|0)>>0]|0)|0)<<24>>24|0)==65)a[(c[u>>2]|0)+(c[q>>2]|0)>>0]=65;if(fv(c[A>>2]|0,a[(c[u>>2]|0)+(c[q>>2]|0)>>0]|0)|0)a[(c[u>>2]|0)+(c[q>>2]|0)>>0]=65}}c[q>>2]=(c[q>>2]|0)+1}c[c[l>>2]>>2]=c[u>>2];i=m;return c[n>>2]|0}function fv(e,f){e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0;h=i;i=i+16|0;g=h+4|0;k=h;j=h+9|0;l=h+8|0;c[k>>2]=e;a[j>>0]=f;a:do if((a[j>>0]|0)==65)c[g>>2]=1;else{while(1){if((d[c[k>>2]>>0]|0)==158)f=1;else f=(d[c[k>>2]>>0]|0)==157;e=c[k>>2]|0;if(!f)break;c[k>>2]=c[e+12>>2]}a[l>>0]=a[e>>0]|0;if((d[l>>0]|0)==159)a[l>>0]=a[(c[k>>2]|0)+38>>0]|0;switch(d[l>>0]|0){case 133:{if((a[j>>0]|0)==69)j=1;else j=(a[j>>0]|0)==67;c[g>>2]=j&1;break a};case 132:{if((a[j>>0]|0)==68)j=1;else j=(a[j>>0]|0)==67;c[g>>2]=j&1;break a};case 134:{c[g>>2]=1;break a};case 154:{if((b[(c[k>>2]|0)+32>>1]|0)<0)if((a[j>>0]|0)==68)j=1;else j=(a[j>>0]|0)==67;else j=0;c[g>>2]=j&1;break a};case 97:{c[g>>2]=(a[j>>0]|0)==66&1;break a};default:{c[g>>2]=0;break a}}}while(0);i=h;return c[g>>2]|0}function gv(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;m=i;i=i+32|0;g=m+16|0;j=m+12|0;k=m+8|0;l=m+4|0;h=m;c[g>>2]=b;c[j>>2]=d;c[k>>2]=e;c[l>>2]=f;c[h>>2]=c[(c[g>>2]|0)+8>>2];if(!(c[l>>2]|0)){i=m;return}while(1){if((c[k>>2]|0)<=0)break;if((a[c[l>>2]>>0]|0)!=65)break;c[k>>2]=(c[k>>2]|0)+ -1;c[j>>2]=(c[j>>2]|0)+1;c[l>>2]=(c[l>>2]|0)+1}while(1){if((c[k>>2]|0)>1)e=(a[(c[l>>2]|0)+((c[k>>2]|0)-1)>>0]|0)==65;else e=0;f=c[k>>2]|0;if(!e)break;c[k>>2]=f+ -1}if((f|0)<=0){i=m;return}fp(c[h>>2]|0,48,c[j>>2]|0,c[k>>2]|0)|0;bf(c[h>>2]|0,-1,c[l>>2]|0,c[k>>2]|0);Us(c[g>>2]|0,c[j>>2]|0,c[k>>2]|0);i=m;return}function hv(a,b,d,f,g,h,j){a=a|0;b=b|0;d=d|0;f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;l=i;i=i+160|0;k=l+148|0;u=l+144|0;t=l+140|0;s=l+136|0;o=l;r=l+132|0;q=l+128|0;n=l+124|0;m=l+120|0;p=l+8|0;c[u>>2]=a;c[t>>2]=b;c[s>>2]=d;a=o;c[a>>2]=f;c[a+4>>2]=g;c[r>>2]=h;c[q>>2]=j;c[n>>2]=0;c[m>>2]=iv(p,c[u>>2]|0,c[t>>2]|0,c[s>>2]|0,c[r>>2]|0,c[q>>2]|0)|0;while(1){if(!(c[m>>2]|0)){h=10;break}t=(c[m>>2]|0)+32|0;u=o;if((c[t>>2]&c[u>>2]|0)==0?(c[t+4>>2]&c[u+4>>2]|0)==0:0){u=(c[m>>2]|0)+32|0;if((c[u>>2]|0)==0&(c[u+4>>2]|0)==0?((e[(c[m>>2]|0)+18>>1]|0)&2|0)!=0:0){h=6;break}if(!(c[n>>2]|0))c[n>>2]=c[m>>2]}c[m>>2]=jv(p)|0}if((h|0)==6){c[k>>2]=c[m>>2];u=c[k>>2]|0;i=l;return u|0}else if((h|0)==10){c[k>>2]=c[n>>2];u=c[k>>2]|0;i=l;return u|0}return 0}function iv(d,f,g,h,j,k){d=d|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;r=i;i=i+32|0;q=r+28|0;n=r+24|0;u=r+20|0;o=r+16|0;p=r+12|0;t=r+8|0;l=r+4|0;s=r;c[n>>2]=d;c[u>>2]=f;c[o>>2]=g;c[p>>2]=h;c[t>>2]=j;c[l>>2]=k;c[c[n>>2]>>2]=c[u>>2];c[(c[n>>2]|0)+4>>2]=c[u>>2];do if((c[l>>2]|0)!=0&(c[p>>2]|0)>=0){a[(c[n>>2]|0)+12>>0]=a[(c[(c[(c[l>>2]|0)+12>>2]|0)+4>>2]|0)+((c[p>>2]|0)*24|0)+21>>0]|0;c[s>>2]=0;while(1){j=c[s>>2]|0;k=c[l>>2]|0;if((b[(c[(c[l>>2]|0)+4>>2]|0)+(c[s>>2]<<1)>>1]|0)==(c[p>>2]|0)){m=7;break}if((j|0)>(e[k+52>>1]|0))break;c[s>>2]=(c[s>>2]|0)+1}if((m|0)==7){c[(c[n>>2]|0)+8>>2]=c[(c[k+32>>2]|0)+(j<<2)>>2];break}c[q>>2]=0;u=c[q>>2]|0;i=r;return u|0}else{a[(c[n>>2]|0)+12>>0]=0;c[(c[n>>2]|0)+8>>2]=0}while(0);c[(c[n>>2]|0)+16>>2]=c[t>>2];c[(c[n>>2]|0)+20>>2]=0;c[(c[n>>2]|0)+24>>2]=c[o>>2];c[(c[n>>2]|0)+28>>2]=c[p>>2];a[(c[n>>2]|0)+13>>0]=2;a[(c[n>>2]|0)+14>>0]=2;c[q>>2]=jv(c[n>>2]|0)|0;u=c[q>>2]|0;i=r;return u|0}function jv(f){f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;h=i;i=i+48|0;k=h+40|0;j=h+36|0;m=h+32|0;n=h+28|0;p=h+24|0;o=h+20|0;l=h+16|0;g=h+12|0;q=h+8|0;s=h+4|0;r=h;c[j>>2]=f;c[g>>2]=c[(c[j>>2]|0)+20>>2];a:while(1){if((d[(c[j>>2]|0)+14>>0]|0)>(d[(c[j>>2]|0)+13>>0]|0)){m=35;break}c[m>>2]=c[(c[j>>2]|0)+24+((d[(c[j>>2]|0)+14>>0]|0)-2<<2)>>2];c[n>>2]=c[(c[j>>2]|0)+24+((d[(c[j>>2]|0)+14>>0]|0)-1<<2)>>2];while(1){f=c[(c[j>>2]|0)+4>>2]|0;c[o>>2]=f;if(!f)break;c[l>>2]=(c[(c[o>>2]|0)+20>>2]|0)+((c[g>>2]|0)*48|0);while(1){if((c[g>>2]|0)>=(c[(c[o>>2]|0)+12>>2]|0))break;do if((c[(c[l>>2]|0)+8>>2]|0)==(c[m>>2]|0)?(c[(c[l>>2]|0)+12>>2]|0)==(c[n>>2]|0):0){if((d[(c[j>>2]|0)+14>>0]|0)>2?(c[(c[c[l>>2]>>2]|0)+4>>2]&1|0)!=0:0)break;if((e[(c[l>>2]|0)+18>>1]&1024|0)!=0?(d[(c[j>>2]|0)+13>>0]|0)<22:0){c[p>>2]=iq(c[(c[c[l>>2]>>2]|0)+16>>2]|0)|0;c[q>>2]=0;while(1){if((c[q>>2]|0)>=(d[(c[j>>2]|0)+13>>0]|0))break;if((c[(c[j>>2]|0)+24+(c[q>>2]<<2)>>2]|0)==(c[(c[p>>2]|0)+28>>2]|0)?(c[(c[j>>2]|0)+24+((c[q>>2]|0)+1<<2)>>2]|0)==(b[(c[p>>2]|0)+32>>1]|0):0)break;c[q>>2]=(c[q>>2]|0)+2}if((c[q>>2]|0)==(d[(c[j>>2]|0)+13>>0]|0)){c[(c[j>>2]|0)+24+(c[q>>2]<<2)>>2]=c[(c[p>>2]|0)+28>>2];c[(c[j>>2]|0)+24+((c[q>>2]|0)+1<<2)>>2]=b[(c[p>>2]|0)+32>>1];f=(c[j>>2]|0)+13|0;a[f>>0]=(d[f>>0]|0)+2}}if(e[(c[l>>2]|0)+18>>1]&c[(c[j>>2]|0)+16>>2]){if((c[(c[j>>2]|0)+8>>2]|0)!=0?(e[(c[l>>2]|0)+18>>1]&128|0)==0:0){c[r>>2]=c[c[c[o>>2]>>2]>>2];c[p>>2]=c[c[l>>2]>>2];if(!(mt(c[p>>2]|0,a[(c[j>>2]|0)+12>>0]|0)|0))break;c[s>>2]=at(c[r>>2]|0,c[(c[p>>2]|0)+12>>2]|0,c[(c[p>>2]|0)+16>>2]|0)|0;if(!(c[s>>2]|0))c[s>>2]=c[(c[c[r>>2]>>2]|0)+8>>2];if(xc(c[c[s>>2]>>2]|0,c[(c[j>>2]|0)+8>>2]|0)|0)break}if(!(e[(c[l>>2]|0)+18>>1]&2)){m=31;break a}f=c[(c[c[l>>2]>>2]|0)+16>>2]|0;c[p>>2]=f;if((d[f>>0]|0)!=154){m=31;break a}if((c[(c[p>>2]|0)+28>>2]|0)!=(c[(c[j>>2]|0)+24>>2]|0)){m=31;break a}if((b[(c[p>>2]|0)+32>>1]|0)!=(c[(c[j>>2]|0)+28>>2]|0)){m=31;break a}}}while(0);c[g>>2]=(c[g>>2]|0)+1;c[l>>2]=(c[l>>2]|0)+48}c[(c[j>>2]|0)+4>>2]=c[(c[(c[j>>2]|0)+4>>2]|0)+4>>2];c[g>>2]=0}c[(c[j>>2]|0)+4>>2]=c[c[j>>2]>>2];c[g>>2]=0;f=(c[j>>2]|0)+14|0;a[f>>0]=(d[f>>0]|0)+2}if((m|0)==31){c[(c[j>>2]|0)+20>>2]=(c[g>>2]|0)+1;c[k>>2]=c[l>>2];s=c[k>>2]|0;i=h;return s|0}else if((m|0)==35){c[k>>2]=0;s=c[k>>2]|0;i=h;return s|0}return 0}function kv(a,d,f){a=a|0;d=d|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;k=i;i=i+64|0;t=k;g=k+44|0;o=k+40|0;v=k+36|0;u=k+32|0;s=k+50|0;r=k+48|0;h=k+28|0;n=k+24|0;p=k+20|0;m=k+16|0;q=k+12|0;l=k+8|0;j=k+4|0;c[g>>2]=a;c[o>>2]=d;c[v>>2]=f;c[u>>2]=c[(c[o>>2]|0)+28>>2];b[s>>1]=b[(c[o>>2]|0)+24>>1]|0;b[r>>1]=b[(c[o>>2]|0)+26>>1]|0;c[p>>2]=c[(c[v>>2]|0)+4>>2];c[m>>2]=c[(c[u>>2]|0)+4>>2];if((e[s>>1]|0)==0?(c[(c[o>>2]|0)+36>>2]&48|0)==0:0){i=k;return}Vm(c[g>>2]|0,23928,2);c[h>>2]=0;while(1){f=c[h>>2]|0;if((c[h>>2]|0)>=(e[s>>1]|0))break;if((b[(c[m>>2]|0)+(f<<1)>>1]|0)<0)f=9992;else f=c[(c[p>>2]|0)+((b[(c[m>>2]|0)+(c[h>>2]<<1)>>1]|0)*24|0)>>2]|0;c[q>>2]=f;if((c[h>>2]|0)>=(e[r>>1]|0))lv(c[g>>2]|0,c[h>>2]|0,c[q>>2]|0,23936);else{if(c[h>>2]|0)Vm(c[g>>2]|0,23944,5);v=c[g>>2]|0;c[t>>2]=c[q>>2];kn(v,0,23952,t)}c[h>>2]=(c[h>>2]|0)+1}c[n>>2]=f;if(c[(c[o>>2]|0)+36>>2]&32){if((b[(c[m>>2]|0)+(c[n>>2]<<1)>>1]|0)<0)q=9992;else q=c[(c[p>>2]|0)+((b[(c[m>>2]|0)+(c[n>>2]<<1)>>1]|0)*24|0)>>2]|0;c[l>>2]=q;u=c[g>>2]|0;v=c[h>>2]|0;c[h>>2]=v+1;lv(u,v,c[l>>2]|0,23960)}if(c[(c[o>>2]|0)+36>>2]&16){if((b[(c[m>>2]|0)+(c[n>>2]<<1)>>1]|0)<0)l=9992;else l=c[(c[p>>2]|0)+((b[(c[m>>2]|0)+(c[n>>2]<<1)>>1]|0)*24|0)>>2]|0;c[j>>2]=l;lv(c[g>>2]|0,c[h>>2]|0,c[j>>2]|0,23968)}Vm(c[g>>2]|0,23976,1);i=k;return}function lv(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;g=f+12|0;k=f+8|0;j=f+4|0;h=f;c[g>>2]=a;c[k>>2]=b;c[j>>2]=d;c[h>>2]=e;if(c[k>>2]|0)Vm(c[g>>2]|0,23944,5);ss(c[g>>2]|0,c[j>>2]|0);Vm(c[g>>2]|0,c[h>>2]|0,1);Vm(c[g>>2]|0,19016,1);i=f;return}function mv(b,d,f,g){b=b|0;d=d|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0;h=i;i=i+32|0;j=h+16|0;l=h+12|0;k=h+8|0;n=h;m=h+20|0;c[l>>2]=b;c[k>>2]=d;b=n;c[b>>2]=f;c[b+4>>2]=g;if((c[(c[l>>2]|0)+8>>2]|0)!=(c[(c[k>>2]|0)+40>>2]|0)){c[j>>2]=0;b=c[j>>2]|0;i=h;return b|0}if(!((e[(c[l>>2]|0)+18>>1]|0)&2)){c[j>>2]=0;b=c[j>>2]|0;i=h;return b|0}d=(c[l>>2]|0)+32|0;b=n;if((c[d>>2]&c[b>>2]|0)!=0?1:(c[d+4>>2]&c[b+4>>2]|0)!=0){c[j>>2]=0;b=c[j>>2]|0;i=h;return b|0}if((c[(c[l>>2]|0)+12>>2]|0)<0){c[j>>2]=0;b=c[j>>2]|0;i=h;return b|0}a[m>>0]=a[(c[(c[(c[k>>2]|0)+16>>2]|0)+4>>2]|0)+((c[(c[l>>2]|0)+12>>2]|0)*24|0)+21>>0]|0;if(mt(c[c[l>>2]>>2]|0,a[m>>0]|0)|0){c[j>>2]=1;b=c[j>>2]|0;i=h;return b|0}else{c[j>>2]=0;b=c[j>>2]|0;i=h;return b|0}return 0}function nv(a,d,f){a=a|0;d=d|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+32|0;h=g+16|0;m=g+12|0;k=g+8|0;l=g+4|0;j=g;c[m>>2]=a;c[k>>2]=d;c[l>>2]=f;if((e[(c[k>>2]|0)+42>>1]|0|0)>=(c[l>>2]|0)){c[h>>2]=0;a=c[h>>2]|0;i=g;return a|0}c[l>>2]=(c[l>>2]|0)+7&-8;c[j>>2]=Qe(c[m>>2]|0,c[l>>2]<<2,0)|0;if(!(c[j>>2]|0)){c[h>>2]=7;a=c[h>>2]|0;i=g;return a|0}dF(c[j>>2]|0,c[(c[k>>2]|0)+44>>2]|0,(e[(c[k>>2]|0)+42>>1]|0)<<2|0)|0;if((c[(c[k>>2]|0)+44>>2]|0)!=((c[k>>2]|0)+52|0))Xb(c[m>>2]|0,c[(c[k>>2]|0)+44>>2]|0);c[(c[k>>2]|0)+44>>2]=c[j>>2];b[(c[k>>2]|0)+42>>1]=c[l>>2];c[h>>2]=0;a=c[h>>2]|0;i=g;return a|0}function ov(a,d,e,f){a=a|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;g=i;i=i+32|0;n=g+20|0;k=g+24|0;o=g+16|0;m=g+12|0;h=g+8|0;l=g+4|0;j=g;c[n>>2]=a;b[k>>1]=d;c[o>>2]=e;c[m>>2]=f;c[l>>2]=56+((b[k>>1]<<2)+7&-8)+(((b[k>>1]|0)+1<<1)+(b[k>>1]<<1)+(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h>>2]>>2]|0))break a;k=qv(c[j>>2]|0,c[(c[h>>2]|0)+8+((c[f>>2]|0)*72|0)+20>>2]|0)|0;l=d;b=c[l+4>>2]|D;a=d;c[a>>2]=c[l>>2]|k;c[a+4>>2]=b;a=pv(c[j>>2]|0,c[(c[h>>2]|0)+8+((c[f>>2]|0)*72|0)+44>>2]|0)|0;b=d;k=c[b+4>>2]|D;l=d;c[l>>2]=c[b>>2]|a;c[l+4>>2]=k;c[f>>2]=(c[f>>2]|0)+1}}while(0);c[g>>2]=c[(c[g>>2]|0)+52>>2]}l=d;D=c[l+4>>2]|0;i=e;return c[l>>2]|0}function rv(a,c){a=a|0;c=c|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;f=e+4|0;g=e+2|0;h=e;b[g>>1]=a;b[h>>1]=c;if((b[g>>1]|0)>=(b[h>>1]|0)){c=b[g>>1]|0;if((b[g>>1]|0)>((b[h>>1]|0)+49|0)){b[f>>1]=c;a=b[f>>1]|0;i=e;return a|0}a=b[g>>1]|0;if((c<<16>>16|0)>((b[h>>1]|0)+31|0)){b[f>>1]=a+1;a=b[f>>1]|0;i=e;return a|0}else{b[f>>1]=a+(d[24056+((b[g>>1]|0)-(b[h>>1]|0))>>0]|0);a=b[f>>1]|0;i=e;return a|0}}else{c=b[h>>1]|0;if((b[h>>1]|0)>((b[g>>1]|0)+49|0)){b[f>>1]=c;a=b[f>>1]|0;i=e;return a|0}a=b[h>>1]|0;if((c<<16>>16|0)>((b[g>>1]|0)+31|0)){b[f>>1]=a+1;a=b[f>>1]|0;i=e;return a|0}else{b[f>>1]=a+(d[24056+((b[h>>1]|0)-(b[g>>1]|0))>>0]|0);a=b[f>>1]|0;i=e;return a|0}}return 0}function sv(f,g,h,j,k,l,m){f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;var n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0,I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(c[x>>2]|0)+36>>2]&4096)){if(c[(c[x>>2]|0)+36>>2]&256){c[w>>2]=0;b[R>>1]=0;b[z>>1]=1}else{f=c[(c[x>>2]|0)+28>>2]|0;c[w>>2]=f;if(!f){n=38;break}if((d[(c[w>>2]|0)+55>>0]|0)>>>2&1){n=38;break}b[R>>1]=b[(c[w>>2]|0)+50>>1]|0;b[z>>1]=b[(c[w>>2]|0)+52>>1]|0;a[u>>0]=(d[(c[w>>2]|0)+54>>0]|0)!=0}a[M>>0]=0;a[t>>0]=0;a[Q>>0]=0;c[y>>2]=0;while(1){if((c[y>>2]|0)>=(e[z>>1]|0))break;if(((c[y>>2]|0)<(e[(c[x>>2]|0)+24>>1]|0)?(e[(c[x>>2]|0)+26>>1]|0)==0:0)?(f=e[(c[(c[(c[x>>2]|0)+44>>2]|0)+(c[y>>2]<<2)>>2]|0)+18>>1]|0,c[p>>2]=f,(f&130|0)!=0):0){if(c[p>>2]&128)a[u>>0]=0}else{if(c[w>>2]|0){c[A>>2]=b[(c[(c[w>>2]|0)+4>>2]|0)+(c[y>>2]<<1)>>1];a[B>>0]=a[(c[(c[w>>2]|0)+28>>2]|0)+(c[y>>2]|0)>>0]|0;if((c[A>>2]|0)==(b[(c[(c[w>>2]|0)+12>>2]|0)+36>>1]|0))c[A>>2]=-1}else{c[A>>2]=-1;a[B>>0]=0}do if((d[u>>0]|0)!=0&(c[A>>2]|0)>=0?(c[y>>2]|0)>=(e[(c[x>>2]|0)+24>>1]|0):0){if(d[(c[(c[(c[w>>2]|0)+12>>2]|0)+4>>2]|0)+((c[A>>2]|0)*24|0)+20>>0]|0)break;a[u>>0]=0}while(0);a[C>>0]=1;a[E>>0]=0;c[p>>2]=0;a:while(1){if(!(d[C>>0]|0))break;if((c[p>>2]|0)>=(e[N>>1]|0))break;g=$E(1,0,c[p>>2]|0)|0;f=r;do if(!((g&c[f>>2]|0)!=0?1:(D&c[f+4>>2]|0)!=0)){c[G>>2]=iq(c[(c[(c[F>>2]|0)+4>>2]|0)+((c[p>>2]|0)*20|0)>>2]|0)|0;if(!(e[H>>1]&768))a[C>>0]=0;if((d[c[G>>2]>>0]|0)!=154)break;if((c[(c[G>>2]|0)+28>>2]|0)!=(c[I>>2]|0))break;if((b[(c[G>>2]|0)+32>>1]|0)!=(c[A>>2]|0))break;if((c[A>>2]|0)<0){n=68;break a}c[K>>2]=cq(c[c[J>>2]>>2]|0,c[(c[(c[F>>2]|0)+4>>2]|0)+((c[p>>2]|0)*20|0)>>2]|0)|0;if(!(c[K>>2]|0))c[K>>2]=c[(c[L>>2]|0)+8>>2];if(!(xc(c[c[K>>2]>>2]|0,c[(c[(c[w>>2]|0)+32>>2]|0)+(c[y>>2]<<2)>>2]|0)|0)){n=68;break a}}while(0);c[p>>2]=(c[p>>2]|0)+1}if((n|0)==68){n=0;a[E>>0]=1}do if(d[E>>0]|0){if(e[H>>1]&256)break;if(a[M>>0]|0){if((d[t>>0]^d[B>>0]|0)==(d[(c[(c[F>>2]|0)+4>>2]|0)+((c[p>>2]|0)*20|0)+12>>0]|0))break;a[E>>0]=0;break}a[t>>0]=d[B>>0]^d[(c[(c[F>>2]|0)+4>>2]|0)+((c[p>>2]|0)*20|0)+12>>0];if(a[t>>0]|0){h=$E(1,0,c[O>>2]|0)|0;f=c[P>>2]|0;j=f;g=c[j+4>>2]|D;c[f>>2]=c[j>>2]|h;c[f+4>>2]=g}a[M>>0]=1}while(0);if(!(a[E>>0]|0)){n=82;break}if((c[A>>2]|0)<0)a[Q>>0]=1;h=$E(1,0,c[p>>2]|0)|0;j=r;g=c[j+4>>2]|D;f=r;c[f>>2]=c[j>>2]|h;c[f+4>>2]=g}c[y>>2]=(c[y>>2]|0)+1}do if((n|0)==82){n=0;if((c[y>>2]|0)!=0?(c[y>>2]|0)>=(e[R>>1]|0):0)break;a[u>>0]=0}while(0);if(a[Q>>0]|0)a[u>>0]=1}b:do if(a[u>>0]|0){h=(c[x>>2]|0)+8|0;j=S;g=c[j+4>>2]|c[h+4>>2];f=S;c[f>>2]=c[j>>2]|c[h>>2];c[f+4>>2]=g;c[p>>2]=0;while(1){if((c[p>>2]|0)>=(e[N>>1]|0))break b;g=$E(1,0,c[p>>2]|0)|0;f=r;do if(!((g&c[f>>2]|0)!=0?1:(D&c[f+4>>2]|0)!=0)){c[_>>2]=c[(c[(c[F>>2]|0)+4>>2]|0)+((c[p>>2]|0)*20|0)>>2];g=pv((c[J>>2]|0)+68|0,c[_>>2]|0)|0;f=$;c[f>>2]=g;c[f+4>>2]=D;f=$;if((c[f>>2]|0)==0&(c[f+4>>2]|0)==0?(Vs(c[_>>2]|0)|0)==0:0)break;g=$;f=S;if((c[g>>2]&~c[f>>2]|0)==0?(c[g+4>>2]&~c[f+4>>2]|0)==0:0){h=$E(1,0,c[p>>2]|0)|0;j=r;g=c[j+4>>2]|D;f=r;c[f>>2]=c[j>>2]|h;c[f+4>>2]=g}}while(0);c[p>>2]=(c[p>>2]|0)+1}}while(0);c[O>>2]=(c[O>>2]|0)+1}if((n|0)==16){if(a[m+29>>0]|0){h=v;g=c[h+4>>2]|0;f=r;c[f>>2]=c[h>>2];c[f+4>>2]=g}}else if((n|0)==38){a[o>>0]=0;f=a[o>>0]|0;i=s;return f|0}g=r;f=v;if((c[g>>2]|0)==(c[f>>2]|0)?(c[g+4>>2]|0)==(c[f+4>>2]|0):0){a[o>>0]=b[N>>1];f=a[o>>0]|0;i=s;return f|0}if(a[u>>0]|0){a[o>>0]=-1;f=a[o>>0]|0;i=s;return f|0}c[p>>2]=(e[N>>1]|0)-1;while(1){if((c[p>>2]|0)<=0){n=106;break}g=$E(1,0,c[p>>2]|0)|0;g=ZE(g|0,D|0,1,0)|0;h=q;c[h>>2]=g;c[h+4>>2]=D;h=r;g=q;f=q;t=c[p>>2]|0;if((c[h>>2]&c[g>>2]|0)==(c[f>>2]|0)?(c[h+4>>2]&c[g+4>>2]|0)==(c[f+4>>2]|0):0){n=104;break}c[p>>2]=t+ -1}if((n|0)==104){a[o>>0]=t;f=a[o>>0]|0;i=s;return f|0}else if((n|0)==106){a[o>>0]=0;f=a[o>>0]|0;i=s;return f|0}return 0}function tv(a,d,f,g){a=a|0;d=d|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0;h=i;i=i+32|0;k=h+8|0;m=h+16|0;n=h+4|0;o=h;l=h+14|0;j=h+12|0;c[k>>2]=a;b[m>>1]=d;c[n>>2]=f;c[o>>2]=g;a=(((c[n>>2]|0)-(c[o>>2]|0)|0)*100|0)/(c[n>>2]|0)|0;b[l>>1]=((dq(a,((a|0)<0)<<31>>31)|0)<<16>>16)-66;a=b[m>>1]|0;a=a+((uv(b[m>>1]|0)|0)<<16>>16)|0;b[j>>1]=a+(b[l>>1]|0)+16;if(!(e[(c[k>>2]|0)+34>>1]&1024)){o=b[j>>1]|0;i=h;return o|0}b[j>>1]=(b[j>>1]|0)+16;o=b[j>>1]|0;i=h;return o|0}function uv(a){a=a|0;var c=0,d=0;c=i;i=i+16|0;d=c;b[d>>1]=a;if((b[d>>1]|0)<=10){d=0;d=d&65535;i=c;return d|0}d=b[d>>1]|0;d=((dq(d,((d|0)<0)<<31>>31)|0)<<16>>16)-33|0;d=d&65535;i=c;return d|0}function vv(f,g,j){f=f|0;g=g|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0;y=i;i=i+112|0;H=y+8|0;m=y+96|0;r=y+92|0;k=y;J=y+88|0;z=y+84|0;C=y+80|0;I=y+76|0;A=y+72|0;n=y+68|0;o=y+64|0;x=y+60|0;v=y+56|0;D=y+52|0;t=y+48|0;B=y+44|0;w=y+40|0;s=y+36|0;u=y+32|0;F=y+28|0;G=y+24|0;E=y+20|0;q=y+16|0;p=y+12|0;c[r>>2]=f;f=k;c[f>>2]=g;c[f+4>>2]=j;c[F>>2]=0;c[G>>2]=0;c[p>>2]=0;c[J>>2]=c[c[r>>2]>>2];c[z>>2]=c[c[J>>2]>>2];c[n>>2]=c[c[z>>2]>>2];c[C>>2]=c[(c[r>>2]|0)+4>>2];c[q>>2]=c[(c[r>>2]|0)+12>>2];c[I>>2]=(c[(c[J>>2]|0)+4>>2]|0)+8+((d[(c[q>>2]|0)+16>>0]|0)*72|0);c[A>>2]=c[(c[I>>2]|0)+16>>2];c[o>>2]=Nv(c[z>>2]|0,c[C>>2]|0,c[I>>2]|0,c[(c[r>>2]|0)+8>>2]|0)|0;if(!(c[o>>2]|0)){c[m>>2]=7;J=c[m>>2]|0;i=y;return J|0}J=c[q>>2]|0;c[J>>2]=0;c[J+4>>2]=0;b[(c[q>>2]|0)+18>>1]=0;c[(c[q>>2]|0)+36>>2]=1024;b[(c[q>>2]|0)+40>>1]=0;a[(c[q>>2]|0)+28>>0]=0;c[v>>2]=c[(c[o>>2]|0)+16>>2];c[u>>2]=c[c[o>>2]>>2];if(nv(c[n>>2]|0,c[q>>2]|0,c[u>>2]|0)|0){Xb(c[n>>2]|0,c[o>>2]|0);c[m>>2]=7;J=c[m>>2]|0;i=y;return J|0}c[E>>2]=0;a:while(1){if((c[E>>2]|0)>3)break;if(((c[F>>2]|0)==0?(c[E>>2]&1|0)!=0:0)?(c[E>>2]=(c[E>>2]|0)+1,(c[E>>2]|0)>3):0)break;if((c[G>>2]|0)==0&(c[E>>2]|0)>1)break;c[x>>2]=c[(c[o>>2]|0)+4>>2];c[t>>2]=0;while(1){if((c[t>>2]|0)>=(c[c[o>>2]>>2]|0))break;c[B>>2]=c[(c[x>>2]|0)+8>>2];c[D>>2]=(c[(c[C>>2]|0)+20>>2]|0)+((c[B>>2]|0)*48|0);j=c[E>>2]|0;do if((j|0)==2)a[(c[x>>2]|0)+5>>0]=(e[(c[D>>2]|0)+18>>1]&1|0)==0;else if((j|0)==1){J=(c[D>>2]|0)+32|0;a[(c[x>>2]|0)+5>>0]=(c[J>>2]|0)==0&(c[J+4>>2]|0)==0&1}else if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==36){c[p>>2]=1;J=c[z>>2]|0;c[H>>2]=c[c[A>>2]>>2];Se(J,24088,H)}if(c[(c[o>>2]|0)+28>>2]|0)hc(c[(c[o>>2]|0)+24>>2]|0);Xb(c[n>>2]|0,c[o>>2]|0);c[m>>2]=c[p>>2];J=c[m>>2]|0;i=y;return J|0}function wv(f,g,h){f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0;k=i;i=i+144|0;n=k+128|0;m=k+8|0;r=k+124|0;v=k+120|0;A=k+64|0;C=k+140|0;B=k+136|0;F=k+56|0;o=k+52|0;z=k+48|0;j=k+44|0;s=k+40|0;p=k+36|0;t=k+134|0;x=k+132|0;q=k+32|0;u=k+28|0;E=k+24|0;w=k+20|0;y=k+16|0;l=k;c[n>>2]=f;f=m;c[f>>2]=g;c[f+4>>2]=h;b[B>>1]=-1;c[j>>2]=0;c[s>>2]=1;c[z>>2]=c[(c[n>>2]|0)+12>>2];c[r>>2]=c[c[n>>2]>>2];c[F>>2]=c[(c[r>>2]|0)+4>>2];c[o>>2]=(c[F>>2]|0)+8+((d[(c[z>>2]|0)+16>>0]|0)*72|0);c[u>>2]=c[(c[o>>2]|0)+16>>2];c[q>>2]=c[(c[n>>2]|0)+4>>2];do if(c[(c[o>>2]|0)+68>>2]|0)c[v>>2]=c[(c[o>>2]|0)+68>>2];else{if(d[(c[u>>2]|0)+44>>0]&32){c[v>>2]=c[(c[u>>2]|0)+8>>2];break}g=A+0|0;h=g+56|0;do{c[g>>2]=0;g=g+4|0}while((g|0)<(h|0));b[A+50>>1]=1;b[A+52>>1]=1;c[A+4>>2]=B;c[A+8>>2]=C;a[A+54>>0]=5;c[A+12>>2]=c[u>>2];b[A+48>>1]=b[(c[u>>2]|0)+42>>1]|0;b[C>>1]=b[(c[u>>2]|0)+28>>1]|0;b[C+2>>1]=0;c[E>>2]=c[(c[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|0;g=Iv(c[v>>2]|0)|0;F=l;c[F>>2]=h&~g;c[F+4>>2]=f&~D;F=l;c[(c[z>>2]|0)+36>>2]=(c[F>>2]|0)==0&(c[F+4>>2]|0)==0?576:512}if((c[p>>2]|0)==0?(d[(c[u>>2]|0)+44>>0]&32|0)==0:0){F=l;if(!((c[F>>2]|0)==0&(c[F+4>>2]|0)==0))break;if((d[(c[v>>2]|0)+55>>0]|0)>>>2&1)break;if((b[(c[v>>2]|0)+48>>1]|0)>=(b[(c[u>>2]|0)+42>>1]|0))break;if(e[(c[r>>2]|0)+34>>1]&4)break;if(!(c[9664]|0))break;if(e[(c[c[c[r>>2]>>2]>>2]|0)+60>>1]&64)break}a[(c[z>>2]|0)+17>>0]=(c[p>>2]|0)!=0?c[s>>2]|0:0;b[(c[z>>2]|0)+20>>1]=(b[t>>1]|0)+1+(((b[(c[v>>2]|0)+48>>1]|0)*15|0)/(b[(c[u>>2]|0)+42>>1]|0)|0);F=l;if((c[F>>2]|0)!=0|(c[F+4>>2]|0)!=0){F=rv(b[(c[z>>2]|0)+20>>1]|0,(b[t>>1]|0)+16&65535)|0;b[(c[z>>2]|0)+20>>1]=F}Hv(c[q>>2]|0,c[z>>2]|0,b[t>>1]|0);c[j>>2]=Av(c[n>>2]|0,c[z>>2]|0)|0;b[(c[z>>2]|0)+22>>1]=b[t>>1]|0;if(c[j>>2]|0){l=47;break b}}while(0);c[j>>2]=Jv(c[n>>2]|0,c[o>>2]|0,c[v>>2]|0,0)|0;if(c[(c[o>>2]|0)+68>>2]|0){l=47;break}}c[v>>2]=c[(c[v>>2]|0)+20>>2];c[s>>2]=(c[s>>2]|0)+1}if((l|0)==47){i=k;return c[j>>2]|0}return 0}function xv(f,g,h){f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;t=i;i=i+672|0;x=t+660|0;l=t+576|0;F=t+656|0;p=t+652|0;m=t+648|0;q=t+644|0;s=t+640|0;r=t+636|0;o=t+632|0;B=t+168|0;y=t+612|0;D=t+112|0;j=t+56|0;n=t+608|0;u=t+604|0;v=t+600|0;A=t+596|0;w=t+592|0;C=t+588|0;E=t+584|0;z=t;c[x>>2]=f;f=l;c[f>>2]=g;c[f+4>>2]=h;c[F>>2]=c[c[x>>2]>>2];c[r>>2]=0;c[p>>2]=c[(c[x>>2]|0)+4>>2];c[s>>2]=(c[(c[p>>2]|0)+20>>2]|0)+((c[(c[p>>2]|0)+12>>2]|0)*48|0);c[m>>2]=c[(c[x>>2]|0)+12>>2];g=D+0|0;h=g+56|0;do{c[g>>2]=0;g=g+4|0}while((g|0)<(h|0));c[n>>2]=(c[(c[F>>2]|0)+4>>2]|0)+8+((d[(c[m>>2]|0)+16>>0]|0)*72|0);c[o>>2]=c[(c[n>>2]|0)+40>>2];c[q>>2]=c[(c[p>>2]|0)+20>>2];while(1){if(!((c[r>>2]|0)==0?(c[q>>2]|0)>>>0<(c[s>>2]|0)>>>0:0))break;a:do if((e[(c[q>>2]|0)+18>>1]&256|0)!=0?(g=(c[(c[q>>2]|0)+12>>2]|0)+408|0,f=(c[m>>2]|0)+8|0,(c[g>>2]&c[f>>2]|0)!=0?1:(c[g+4>>2]&c[f+4>>2]|0)!=0):0){c[u>>2]=c[(c[q>>2]|0)+12>>2];c[v>>2]=(c[(c[u>>2]|0)+20>>2]|0)+((c[(c[u>>2]|0)+12>>2]|0)*48|0);c[w>>2]=1;f=c[x>>2]|0;c[y+0>>2]=c[f+0>>2];c[y+4>>2]=c[f+4>>2];c[y+8>>2]=c[f+8>>2];c[y+12>>2]=c[f+12>>2];c[y+16>>2]=c[f+16>>2];c[y+8>>2]=0;c[y+16>>2]=j;c[A>>2]=c[(c[u>>2]|0)+20>>2];b:while(1){if((c[A>>2]|0)>>>0>=(c[v>>2]|0)>>>0)break;F=c[A>>2]|0;if(!(e[(c[A>>2]|0)+18>>1]&512)){if((c[F+8>>2]|0)==(c[o>>2]|0)){c[B>>2]=c[c[p>>2]>>2];c[B+4>>2]=c[p>>2];a[B+8>>0]=72;c[B+12>>2]=1;c[B+20>>2]=c[A>>2];c[y+4>>2]=B;k=11}}else{c[y+4>>2]=c[F+12>>2];k=11}c:do if((k|0)==11){k=0;b[j>>1]=0;F=l;h=c[F>>2]|0;F=c[F+4>>2]|0;if(d[(c[(c[n>>2]|0)+16>>2]|0)+44>>0]&16)c[r>>2]=vv(y,h,F)|0;else c[r>>2]=wv(y,h,F)|0;if(!(c[r>>2]|0)){f=l;c[r>>2]=xv(y,c[f>>2]|0,c[f+4>>2]|0)|0}if(!(e[j>>1]|0)){k=17;break b}if(c[w>>2]|0){yv(D,j);c[w>>2]=0;break}yv(z,D);b[D>>1]=0;c[C>>2]=0;while(1){if((c[C>>2]|0)>=(e[z>>1]|0))break c;c[E>>2]=0;while(1){F=c[C>>2]|0;if((c[E>>2]|0)>=(e[j>>1]|0))break;f=z+8+(F<<4)|0;g=j+8+(c[E>>2]<<4)|0;h=c[f>>2]|c[g>>2];g=c[f+4>>2]|c[g+4>>2];f=rv(b[z+8+(c[C>>2]<<4)+8>>1]|0,b[j+8+(c[E>>2]<<4)+8>>1]|0)|0;zv(D,h,g,f,rv(b[z+8+(c[C>>2]<<4)+10>>1]|0,b[j+8+(c[E>>2]<<4)+10>>1]|0)|0)|0;c[E>>2]=(c[E>>2]|0)+1}c[C>>2]=F+1}}while(0);c[A>>2]=(c[A>>2]|0)+48}if((k|0)==17){k=0;b[D>>1]=0}b[(c[m>>2]|0)+40>>1]=1;c[c[(c[m>>2]|0)+44>>2]>>2]=c[q>>2];c[(c[m>>2]|0)+36>>2]=8192;b[(c[m>>2]|0)+18>>1]=0;a[(c[m>>2]|0)+17>>0]=0;f=(c[m>>2]|0)+24|0;c[f+0>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[C>>2]=0;while(1){if(c[r>>2]|0)break a;if((c[C>>2]|0)>=(e[D>>1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-1<<16>>16;c[m>>2]=(c[m>>2]|0)+16}if((r|0)==7){c[q>>2]=0;a=c[q>>2]|0;i=k;return a|0}do if((r|0)==9){r=c[p>>2]|0;if((e[c[p>>2]>>1]|0)<3){a=b[r>>1]|0;b[r>>1]=a+1<<16>>16;c[m>>2]=(c[p>>2]|0)+8+((a&65535)<<4);b[(c[m>>2]|0)+10>>1]=b[l>>1]|0;break}c[m>>2]=r+8;b[j>>1]=1;while(1){r=b[(c[m>>2]|0)+8>>1]|0;if((e[j>>1]|0)>=(e[c[p>>2]>>1]|0))break;if((r|0)>(b[(c[p>>2]|0)+8+(e[j>>1]<<4)+8>>1]|0))c[m>>2]=(c[p>>2]|0)+8+(e[j>>1]<<4);b[j>>1]=(b[j>>1]|0)+1<<16>>16}if((r|0)<=(b[o>>1]|0)){c[q>>2]=0;a=c[q>>2]|0;i=k;return a|0}}while(0);f=n;d=c[f+4>>2]|0;a=c[m>>2]|0;c[a>>2]=c[f>>2];c[a+4>>2]=d;b[(c[m>>2]|0)+8>>1]=b[o>>1]|0;if((b[(c[m>>2]|0)+10>>1]|0)>(b[l>>1]|0))b[(c[m>>2]|0)+10>>1]=b[l>>1]|0;c[q>>2]=1;a=c[q>>2]|0;i=k;return a|0}function Av(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;k=i;i=i+48|0;f=k+36|0;h=k+32|0;g=k+28|0;l=k+24|0;e=k+20|0;p=k+16|0;j=k+12|0;n=k+8|0;o=k+4|0;m=k;c[h>>2]=a;c[g>>2]=d;c[p>>2]=c[c[h>>2]>>2];c[j>>2]=c[c[c[p>>2]>>2]>>2];if(c[(c[h>>2]|0)+16>>2]|0){a=c[g>>2]|0;zv(c[(c[h>>2]|0)+16>>2]|0,c[a>>2]|0,c[a+4>>2]|0,b[(c[g>>2]|0)+20>>1]|0,b[(c[g>>2]|0)+22>>1]|0)|0;c[f>>2]=0;a=c[f>>2]|0;i=k;return a|0}Bv(c[(c[p>>2]|0)+16>>2]|0,c[g>>2]|0);c[l>>2]=Cv((c[p>>2]|0)+16|0,c[g>>2]|0)|0;if(!(c[l>>2]|0)){c[f>>2]=0;a=c[f>>2]|0;i=k;return a|0}c[e>>2]=c[c[l>>2]>>2];a:do if(!(c[e>>2]|0)){a=Qe(c[j>>2]|0,72,0)|0;c[e>>2]=a;c[c[l>>2]>>2]=a;if(c[e>>2]|0){Ou(c[e>>2]|0);c[(c[e>>2]|0)+48>>2]=0;break}c[f>>2]=7;a=c[f>>2]|0;i=k;return a|0}else{c[n>>2]=(c[e>>2]|0)+48;while(1){if(!(c[c[n>>2]>>2]|0))break a;c[n>>2]=Cv(c[n>>2]|0,c[g>>2]|0)|0;if(!(c[n>>2]|0))break a;c[o>>2]=c[c[n>>2]>>2];if(!(c[o>>2]|0))break a;c[c[n>>2]>>2]=c[(c[o>>2]|0)+48>>2];Lu(c[j>>2]|0,c[o>>2]|0)}}while(0);Dv(c[j>>2]|0,c[e>>2]|0,c[g>>2]|0)|0;if(((c[(c[e>>2]|0)+36>>2]&1024|0)==0?(c[m>>2]=c[(c[e>>2]|0)+28>>2],(c[m>>2]|0)!=0):0)?(c[(c[m>>2]|0)+44>>2]|0)==0:0)c[(c[e>>2]|0)+28>>2]=0;c[f>>2]=0;a=c[f>>2]|0;i=k;return a|0}function Bv(a,e){a=a|0;e=e|0;var f=0,g=0,h=0;f=i;i=i+16|0;g=f+4|0;h=f;c[g>>2]=a;c[h>>2]=e;if(!(c[(c[h>>2]|0)+36>>2]&512)){i=f;return}if(!((c[g>>2]|0)!=0?(c[(c[h>>2]|0)+36>>2]&32768|0)==0:0)){i=f;return}do{do if(((d[(c[g>>2]|0)+16>>0]|0)==(d[(c[h>>2]|0)+16>>0]|0)?(c[(c[g>>2]|0)+36>>2]&512|0)!=0:0)?(c[(c[g>>2]|0)+36>>2]&32768|0)==0:0){if(Ev(c[g>>2]|0,c[h>>2]|0)|0){b[(c[h>>2]|0)+20>>1]=b[(c[g>>2]|0)+20>>1]|0;b[(c[h>>2]|0)+22>>1]=(b[(c[g>>2]|0)+22>>1]|0)-1;break}if(Ev(c[h>>2]|0,c[g>>2]|0)|0){b[(c[h>>2]|0)+20>>1]=b[(c[g>>2]|0)+20>>1]|0;b[(c[h>>2]|0)+22>>1]=(b[(c[g>>2]|0)+22>>1]|0)+1}}while(0);c[g>>2]=c[(c[g>>2]|0)+48>>2]}while((c[g>>2]|0)!=0);i=f;return}function Cv(a,e){a=a|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;h=i;i=i+16|0;g=h+12|0;f=h+8|0;k=h+4|0;j=h;c[f>>2]=a;c[k>>2]=e;c[j>>2]=c[c[f>>2]>>2];while(1){if(!(c[j>>2]|0)){e=18;break}if((d[(c[j>>2]|0)+16>>0]|0)==(d[(c[k>>2]|0)+16>>0]|0)?(d[(c[j>>2]|0)+17>>0]|0)==(d[(c[k>>2]|0)+17>>0]|0):0){if((((c[(c[j>>2]|0)+36>>2]&16384|0)!=0?(c[(c[k>>2]|0)+36>>2]&512|0)!=0:0)?(c[(c[k>>2]|0)+36>>2]&1|0)!=0:0)?(l=c[j>>2]|0,e=c[k>>2]|0,a=c[k>>2]|0,(c[l>>2]&c[e>>2]|0)==(c[a>>2]|0)?(c[l+4>>2]&c[e+4>>2]|0)==(c[a+4>>2]|0):0):0){e=18;break}e=c[j>>2]|0;a=c[k>>2]|0;l=c[j>>2]|0;if(((((c[e>>2]&c[a>>2]|0)==(c[l>>2]|0)?(c[e+4>>2]&c[a+4>>2]|0)==(c[l+4>>2]|0):0)?(b[(c[j>>2]|0)+18>>1]|0)<=(b[(c[k>>2]|0)+18>>1]|0):0)?(b[(c[j>>2]|0)+20>>1]|0)<=(b[(c[k>>2]|0)+20>>1]|0):0)?(b[(c[j>>2]|0)+22>>1]|0)<=(b[(c[k>>2]|0)+22>>1]|0):0){e=13;break}e=c[j>>2]|0;a=c[k>>2]|0;l=c[k>>2]|0;if((((c[e>>2]&c[a>>2]|0)==(c[l>>2]|0)?(c[e+4>>2]&c[a+4>>2]|0)==(c[l+4>>2]|0):0)?(b[(c[j>>2]|0)+20>>1]|0)>=(b[(c[k>>2]|0)+20>>1]|0):0)?(b[(c[j>>2]|0)+22>>1]|0)>=(b[(c[k>>2]|0)+22>>1]|0):0){e=18;break}}c[f>>2]=(c[j>>2]|0)+48;c[j>>2]=c[c[f>>2]>>2]}if((e|0)==13){c[g>>2]=0;l=c[g>>2]|0;i=h;return l|0}else if((e|0)==18){c[g>>2]=c[f>>2];l=c[g>>2]|0;i=h;return l|0}return 0}function Dv(d,f,g){d=d|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0;k=i;i=i+16|0;h=k+12|0;n=k+8|0;l=k+4|0;j=k;c[n>>2]=d;c[l>>2]=f;c[j>>2]=g;Nu(c[n>>2]|0,c[l>>2]|0);n=(nv(c[n>>2]|0,c[l>>2]|0,e[(c[j>>2]|0)+40>>1]|0)|0)!=0;d=c[l>>2]|0;if(n){n=d+24|0;c[n+0>>2]=0;c[n+4>>2]=0;c[n+8>>2]=0;c[h>>2]=7;n=c[h>>2]|0;i=k;return n|0}f=c[j>>2]|0;n=d+0|0;m=f+0|0;g=n+40|0;do{c[n>>2]=c[m>>2];n=n+4|0;m=m+4|0}while((n|0)<(g|0));b[d+40>>1]=b[f+40>>1]|0;dF(c[(c[l>>2]|0)+44>>2]|0,c[(c[j>>2]|0)+44>>2]|0,(e[(c[l>>2]|0)+40>>1]|0)<<2|0)|0;l=c[j>>2]|0;if(!(c[(c[j>>2]|0)+36>>2]&1024)){if(c[l+36>>2]&16384)c[(c[j>>2]|0)+28>>2]=0}else a[l+28>>0]=0;c[h>>2]=0;n=c[h>>2]|0;i=k;return n|0}function Ev(a,d){a=a|0;d=d|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+32|0;g=f+16|0;h=f+12|0;k=f+8|0;j=f+4|0;l=f;c[h>>2]=a;c[k>>2]=d;if((e[(c[h>>2]|0)+40>>1]|0)>=(e[(c[k>>2]|0)+40>>1]|0)){c[g>>2]=0;a=c[g>>2]|0;i=f;return a|0}if((b[(c[h>>2]|0)+20>>1]|0)>=(b[(c[k>>2]|0)+20>>1]|0)){if((b[(c[h>>2]|0)+20>>1]|0)>(b[(c[k>>2]|0)+20>>1]|0)){c[g>>2]=0;a=c[g>>2]|0;i=f;return a|0}if((b[(c[h>>2]|0)+22>>1]|0)>(b[(c[k>>2]|0)+22>>1]|0)){c[g>>2]=0;a=c[g>>2]|0;i=f;return a|0}}c[j>>2]=(e[(c[h>>2]|0)+40>>1]|0)-1;while(1){if((c[j>>2]|0)<0){d=17;break}c[l>>2]=(e[(c[k>>2]|0)+40>>1]|0)-1;while(1){if((c[l>>2]|0)<0)break;if((c[(c[(c[k>>2]|0)+44>>2]|0)+(c[l>>2]<<2)>>2]|0)==(c[(c[(c[h>>2]|0)+44>>2]|0)+(c[j>>2]<<2)>>2]|0))break;c[l>>2]=(c[l>>2]|0)+ -1}if((c[l>>2]|0)<0){d=15;break}c[j>>2]=(c[j>>2]|0)+ -1}if((d|0)==15){c[g>>2]=0;a=c[g>>2]|0;i=f;return a|0}else if((d|0)==17){c[g>>2]=1;a=c[g>>2]|0;i=f;return a|0}return 0}function Fv(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;e=i;i=i+32|0;f=e+20|0;g=e+16|0;l=e+12|0;j=e+8|0;k=e+4|0;h=e;c[g>>2]=a;c[l>>2]=b;c[j>>2]=d;c[k>>2]=0;c[h>>2]=c[(c[l>>2]|0)+20>>2];while(1){if((c[k>>2]|0)>=(c[(c[l>>2]|0)+12>>2]|0)){g=6;break}if(Mv(c[c[h>>2]>>2]|0,c[j>>2]|0,c[g>>2]|0)|0){g=4;break}c[k>>2]=(c[k>>2]|0)+1;c[h>>2]=(c[h>>2]|0)+48}if((g|0)==4){c[f>>2]=1;a=c[f>>2]|0;i=e;return a|0}else if((g|0)==6){c[f>>2]=0;a=c[f>>2]|0;i=e;return a|0}return 0}function Gv(a,f,g){a=a|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;j=i;i=i+32|0;h=j+28|0;q=j+24|0;m=j+20|0;k=j+16|0;o=j+12|0;p=j+8|0;l=j+4|0;n=j;c[q>>2]=a;c[m>>2]=f;c[k>>2]=g;if((d[(c[m>>2]|0)+55>>0]|0)>>>2&1){c[h>>2]=0;a=c[h>>2]|0;i=j;return a|0}a=c[(c[c[q>>2]>>2]|0)+8>>2]|0;c[o>>2]=a;if(!a){c[h>>2]=0;a=c[h>>2]|0;i=j;return a|0}c[p>>2]=0;a:while(1){if((c[p>>2]|0)>=(c[c[o>>2]>>2]|0)){k=18;break}c[n>>2]=iq(c[(c[(c[o>>2]|0)+4>>2]|0)+((c[p>>2]|0)*20|0)>>2]|0)|0;if((d[c[n>>2]>>0]|0)!=154){k=8;break}b:do if((c[(c[n>>2]|0)+28>>2]|0)==(c[k>>2]|0)){if((b[(c[n>>2]|0)+32>>1]|0)<0){k=11;break a}c[l>>2]=0;while(1){if((c[l>>2]|0)>=(e[(c[m>>2]|0)+50>>1]|0))break b;if((b[(c[n>>2]|0)+32>>1]|0)==(b[(c[(c[m>>2]|0)+4>>2]|0)+(c[l>>2]<<1)>>1]|0)){k=15;break a}c[l>>2]=(c[l>>2]|0)+1}}while(0);c[p>>2]=(c[p>>2]|0)+1}if((k|0)==8){c[h>>2]=0;a=c[h>>2]|0;i=j;return a|0}else if((k|0)==11){c[h>>2]=1;a=c[h>>2]|0;i=j;return a|0}else if((k|0)==15){c[h>>2]=1;a=c[h>>2]|0;i=j;return a|0}else if((k|0)==18){c[h>>2]=0;a=c[h>>2]|0;i=j;return a|0}return 0}function Hv(a,f,g){a=a|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;n=i;i=i+48|0;p=n+32|0;j=n+28|0;k=n+36|0;m=n+24|0;o=n+20|0;q=n;r=n+16|0;h=n+12|0;l=n+8|0;c[p>>2]=a;c[j>>2]=f;b[k>>1]=g;s=c[j>>2]|0;g=(c[j>>2]|0)+8|0;f=~(c[s+4>>2]|c[g+4>>2]);a=q;c[a>>2]=~(c[s>>2]|c[g>>2]);c[a+4>>2]=f;c[l>>2]=0;c[r>>2]=c[(c[p>>2]|0)+12>>2];c[m>>2]=c[(c[p>>2]|0)+20>>2];while(1){if((c[r>>2]|0)<=0)break;if(d[(c[m>>2]|0)+20>>0]&2)break;a=(c[m>>2]|0)+40|0;s=(c[j>>2]|0)+8|0;do if(!((c[a>>2]&c[s>>2]|0)==0?(c[a+4>>2]&c[s+4>>2]|0)==0:0)?(a=(c[m>>2]|0)+40|0,s=q,!((c[a>>2]&c[s>>2]|0)!=0?1:(c[a+4>>2]&c[s+4>>2]|0)!=0)):0){c[h>>2]=(e[(c[j>>2]|0)+40>>1]|0)-1;while(1){if((c[h>>2]|0)<0)break;c[o>>2]=c[(c[(c[j>>2]|0)+44>>2]|0)+(c[h>>2]<<2)>>2];if(c[o>>2]|0){if((c[o>>2]|0)==(c[m>>2]|0))break;if((c[(c[o>>2]|0)+4>>2]|0)>=0?((c[(c[p>>2]|0)+20>>2]|0)+((c[(c[o>>2]|0)+4>>2]|0)*48|0)|0)==(c[m>>2]|0):0)break}c[h>>2]=(c[h>>2]|0)+ -1}if((c[h>>2]|0)<0){if((b[(c[m>>2]|0)+16>>1]|0)<=0){s=(c[j>>2]|0)+22|0;b[s>>1]=(b[s>>1]|0)+(b[(c[m>>2]|0)+16>>1]|0);break}s=(c[j>>2]|0)+22|0;b[s>>1]=(b[s>>1]|0)+ -1<<16>>16;if(e[(c[m>>2]|0)+18>>1]&2)c[l>>2]=(c[l>>2]|0)+1}}while(0);c[r>>2]=(c[r>>2]|0)+ -1;c[m>>2]=(c[m>>2]|0)+48}if(!(c[l>>2]|0)){i=n;return}if((b[(c[j>>2]|0)+22>>1]|0)<=((b[k>>1]|0)-10|0)){i=n;return}b[(c[j>>2]|0)+22>>1]=(b[k>>1]|0)-10;i=n;return}function Iv(a){a=a|0;var d=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+32|0;g=f+16|0;d=f;h=f+12|0;j=f+8|0;c[g>>2]=a;a=d;c[a>>2]=0;c[a+4>>2]=0;c[h>>2]=(e[(c[g>>2]|0)+52>>1]|0)-1;while(1){if((c[h>>2]|0)<0)break;c[j>>2]=b[(c[(c[g>>2]|0)+4>>2]|0)+(c[h>>2]<<1)>>1];if((c[j>>2]|0)>=0&(c[j>>2]|0)<63){l=$E(1,0,c[j>>2]|0)|0;m=d;k=c[m+4>>2]|D;a=d;c[a>>2]=c[m>>2]|l;c[a+4>>2]=k}c[h>>2]=(c[h>>2]|0)+ -1}m=d;D=c[m+4>>2]|0;i=f;return c[m>>2]|0}function Jv(f,g,h,j){f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0;C=i;i=i+224|0;y=C+188|0;k=C+184|0;F=C+180|0;D=C+176|0;E=C+212|0;P=C+172|0;x=C+168|0;J=C+164|0;n=C+160|0;w=C+156|0;O=C+152|0;K=C+40|0;m=C;s=C+210|0;o=C+208|0;p=C+206|0;q=C+36|0;r=C+204|0;v=C+32|0;t=C+28|0;M=C+202|0;H=C+200|0;A=C+24|0;z=C+20|0;N=C+198|0;I=C+196|0;G=C+194|0;L=C+192|0;B=C+16|0;l=C+12|0;u=C+8|0;c[k>>2]=f;c[F>>2]=g;c[D>>2]=h;b[E>>1]=j;c[P>>2]=c[c[k>>2]>>2];c[x>>2]=c[c[P>>2]>>2];c[J>>2]=c[c[x>>2]>>2];c[t>>2]=0;c[A>>2]=0;c[z>>2]=0;c[n>>2]=c[(c[k>>2]|0)+12>>2];if(a[(c[J>>2]|0)+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;g=(c[n>>2]|0)+8|0;f=(c[O+4>>2]|c[h+4>>2])&~c[g+4>>2];P=c[n>>2]|0;c[P>>2]=(c[O>>2]|c[h>>2])&~c[g>>2];c[P+4>>2]=f;do if(e[I>>1]&1){c[l>>2]=c[c[w>>2]>>2];P=(c[n>>2]|0)+36|0;c[P>>2]=c[P>>2]|4;if(c[(c[l>>2]|0)+4>>2]&2048){c[B>>2]=46;break}if((c[(c[l>>2]|0)+20>>2]|0)!=0?(c[c[(c[l>>2]|0)+20>>2]>>2]|0)!=0:0){P=c[c[(c[l>>2]|0)+20>>2]>>2]|0;c[B>>2]=(dq(P,((P|0)<0)<<31>>31)|0)<<16>>16}}else if(e[I>>1]&2){P=(c[n>>2]|0)+36|0;c[P>>2]=c[P>>2]|1;if((c[v>>2]|0)>=0){if(b[E>>1]|0)break;if((e[(c[n>>2]|0)+24>>1]|0)!=((e[(c[D>>2]|0)+50>>1]|0)-1|0))break}if((c[v>>2]|0)>=0?(d[(c[D>>2]|0)+54>>0]|0)==0:0){P=(c[n>>2]|0)+36|0;c[P>>2]=c[P>>2]|65536;break}P=(c[n>>2]|0)+36|0;c[P>>2]=c[P>>2]|4096;break}else{if(e[I>>1]&128){P=(c[n>>2]|0)+36|0;c[P>>2]=c[P>>2]|8;break}j=(c[n>>2]|0)+36|0;N=c[j>>2]|0;if(e[I>>1]&36){c[j>>2]=N|34;c[z>>2]=c[w>>2];c[A>>2]=0;break}c[j>>2]=N|18;c[A>>2]=c[w>>2];if(c[(c[n>>2]|0)+36>>2]&32)j=c[(c[(c[n>>2]|0)+44>>2]|0)+((e[(c[n>>2]|0)+40>>1]|0)-2<<2)>>2]|0;else j=0;c[z>>2]=j;break}while(0);do if(!(c[(c[n>>2]|0)+36>>2]&2)){f=(c[n>>2]|0)+24|0;P=(b[f>>1]|0)+1<<16>>16;b[f>>1]=P;c[u>>2]=P&65535;if((c[v>>2]|0)>=0?(b[(c[w>>2]|0)+16>>1]|0)<=0:0){P=(c[n>>2]|0)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]=e;b[f>>1]=b[j>>1]|0;do if(c[h>>2]|0){e=c[h>>2]|0;if((b[(c[h>>2]|0)+16>>1]|0)<=0){b[f>>1]=(b[f>>1]|0)+(b[e+16>>1]|0);break}if(!(d[e+20>>0]&0))b[f>>1]=(b[f>>1]|0)-20}while(0);i=g;return b[f>>1]|0}function Mv(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;g=f+12|0;j=f+8|0;h=f+4|0;k=f;c[j>>2]=a;c[h>>2]=b;c[k>>2]=e;if(!(Dq(c[j>>2]|0,c[h>>2]|0,c[k>>2]|0)|0)){c[g>>2]=1;a=c[g>>2]|0;i=f;return a|0}do if((d[c[h>>2]>>0]|0|0)==71){if((Mv(c[j>>2]|0,c[(c[h>>2]|0)+12>>2]|0,c[k>>2]|0)|0)==0?(Mv(c[j>>2]|0,c[(c[h>>2]|0)+16>>2]|0,c[k>>2]|0)|0)==0:0)break;c[g>>2]=1;a=c[g>>2]|0;i=f;return a|0}while(0);if((((d[c[h>>2]>>0]|0|0)==77?(Dq(c[(c[j>>2]|0)+12>>2]|0,c[(c[h>>2]|0)+12>>2]|0,c[k>>2]|0)|0)==0:0)?(d[c[j>>2]>>0]|0|0)!=76:0)?(d[c[j>>2]>>0]|0|0)!=73:0){c[g>>2]=1;a=c[g>>2]|0;i=f;return a|0}c[g>>2]=0;a=c[g>>2]|0;i=f;return a|0}function Nv(f,g,h,j){f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;n=i;i=i+80|0;l=n;m=n+68|0;v=n+64|0;u=n+60|0;t=n+56|0;C=n+52|0;o=n+48|0;r=n+44|0;w=n+40|0;q=n+36|0;x=n+32|0;z=n+28|0;p=n+24|0;y=n+20|0;k=n+16|0;A=n+12|0;B=n+8|0;s=n+72|0;D=n+4|0;c[v>>2]=f;c[u>>2]=g;c[t>>2]=h;c[C>>2]=j;c[w>>2]=0;c[o>>2]=0;c[p>>2]=c[(c[u>>2]|0)+20>>2];while(1){if((c[o>>2]|0)>=(c[(c[u>>2]|0)+12>>2]|0))break;if(((c[(c[p>>2]|0)+8>>2]|0)==(c[(c[t>>2]|0)+40>>2]|0)?(e[(c[p>>2]|0)+18>>1]&-1153|0)!=0:0)?(d[(c[p>>2]|0)+20>>0]&0|0)==0:0)c[w>>2]=(c[w>>2]|0)+1;c[o>>2]=(c[o>>2]|0)+1;c[p>>2]=(c[p>>2]|0)+48}c[y>>2]=0;if(c[C>>2]|0){c[A>>2]=c[c[C>>2]>>2];c[o>>2]=0;while(1){if((c[o>>2]|0)>=(c[A>>2]|0))break;c[B>>2]=c[(c[(c[C>>2]|0)+4>>2]|0)+((c[o>>2]|0)*20|0)>>2];if((d[c[B>>2]>>0]|0)!=154)break;if((c[(c[B>>2]|0)+28>>2]|0)!=(c[(c[t>>2]|0)+40>>2]|0))break;c[o>>2]=(c[o>>2]|0)+1}if((c[o>>2]|0)==(c[A>>2]|0))c[y>>2]=c[A>>2]}c[k>>2]=se(c[c[v>>2]>>2]|0,56+((c[w>>2]|0)*20|0)+(c[y>>2]<<3)|0,0)|0;if(!(c[k>>2]|0)){Se(c[v>>2]|0,5400,l);c[m>>2]=0;f=c[m>>2]|0;i=n;return f|0}c[q>>2]=(c[k>>2]|0)+56;c[x>>2]=(c[q>>2]|0)+((c[w>>2]|0)*12|0);c[z>>2]=(c[x>>2]|0)+(c[y>>2]<<3);c[c[k>>2]>>2]=c[w>>2];c[(c[k>>2]|0)+8>>2]=c[y>>2];c[(c[k>>2]|0)+4>>2]=c[q>>2];c[(c[k>>2]|0)+12>>2]=c[x>>2];c[(c[k>>2]|0)+16>>2]=c[z>>2];c[r>>2]=0;c[o>>2]=0;c[p>>2]=c[(c[u>>2]|0)+20>>2];while(1){if((c[o>>2]|0)>=(c[(c[u>>2]|0)+12>>2]|0))break;if(((c[(c[p>>2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j>>2]=c[(c[m>>2]|0)+8>>2];Se(e,1200,j);break}else{c[j>>2]=ge(c[n>>2]|0)|0;Se(e,1200,j);break}}while(0);hc(c[(c[m>>2]|0)+8>>2]|0);c[(c[m>>2]|0)+8>>2]=0;c[f>>2]=0;while(1){if((c[f>>2]|0)>=(c[c[k>>2]>>2]|0))break;if((a[(c[(c[k>>2]|0)+4>>2]|0)+((c[f>>2]|0)*12|0)+5>>0]|0)==0?(c[(c[(c[k>>2]|0)+16>>2]|0)+(c[f>>2]<<3)>>2]|0)>0:0){b=c[g>>2]|0;c[j>>2]=c[c[h>>2]>>2];Se(b,24120,j)}c[f>>2]=(c[f>>2]|0)+1}i=l;return c[(c[g>>2]|0)+64>>2]|0}function Pv(a){a=+a;var d=0,e=0,f=0,g=0,j=0;d=i;i=i+32|0;e=d+18|0;f=d+8|0;g=d;j=d+16|0;h[f>>3]=a;if(+h[f>>3]<=1.0){b[e>>1]=0;j=b[e>>1]|0;i=d;return j|0}if(+h[f>>3]<=2.0e9){a=+h[f>>3];b[e>>1]=dq(~~a>>>0,+O(a)>=1.0?a>0.0?(ca(+N(a/4294967296.0),4294967295.0)|0)>>>0:~~+_((a- +(~~a>>>0))/4294967296.0)>>>0:0)|0;j=b[e>>1]|0;i=d;return j|0}else{c[g+0>>2]=c[f+0>>2];c[g+4>>2]=c[f+4>>2];g=cF(c[g>>2]|0,c[g+4>>2]|0,52)|0;g=ZE(g|0,D|0,1022,0)|0;b[j>>1]=g;b[e>>1]=(b[j>>1]|0)*10;j=b[e>>1]|0;i=d;return j|0}return 0}function Qv(a,e,f,g,h){a=a|0;e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;j=i;i=i+48|0;l=j+36|0;p=j+32|0;q=j+28|0;t=j+24|0;r=j+20|0;s=j+16|0;k=j+12|0;o=j+8|0;m=j+4|0;n=j;c[p>>2]=a;c[q>>2]=e;c[t>>2]=f;c[r>>2]=g;c[s>>2]=h;c[o>>2]=c[(c[(c[r>>2]|0)+32>>2]|0)+(c[s>>2]<<2)>>2];c[k>>2]=0;while(1){if((c[k>>2]|0)>=(c[c[q>>2]>>2]|0)){m=10;break}c[m>>2]=iq(c[(c[(c[q>>2]|0)+4>>2]|0)+((c[k>>2]|0)*20|0)>>2]|0)|0;if(((((d[c[m>>2]>>0]|0)==154?(b[(c[m>>2]|0)+32>>1]|0)==(b[(c[(c[r>>2]|0)+4>>2]|0)+(c[s>>2]<<1)>>1]|0):0)?(c[(c[m>>2]|0)+28>>2]|0)==(c[t>>2]|0):0)?(c[n>>2]=cq(c[p>>2]|0,c[(c[(c[q>>2]|0)+4>>2]|0)+((c[k>>2]|0)*20|0)>>2]|0)|0,(c[n>>2]|0)!=0):0)?0==(xc(c[c[n>>2]>>2]|0,c[o>>2]|0)|0):0){m=8;break}c[k>>2]=(c[k>>2]|0)+1}if((m|0)==8){c[l>>2]=c[k>>2];a=c[l>>2]|0;i=j;return a|0}else if((m|0)==10){c[l>>2]=-1;a=c[l>>2]|0;i=j;return a|0}return 0}function Rv(f,g,h){f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0;I=i;i=i+208|0;K=I+188|0;v=I+184|0;j=I+180|0;aa=I+176|0;E=I+172|0;V=I+168|0;q=I+164|0;y=I+40|0;A=I+32|0;z=I+24|0;s=I+160|0;u=I+156|0;p=I+152|0;O=I+148|0;t=I+144|0;G=I+140|0;$=I+16|0;w=I+136|0;N=I+132|0;C=I+194|0;x=I+128|0;l=I+124|0;B=I+192|0;F=I+120|0;Q=I+116|0;P=I+112|0;R=I+108|0;S=I+104|0;r=I+100|0;m=I+96|0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2]=a;if((c[d>>2]|0)!=75?!((c[d>>2]|0)>=79&(c[d>>2]|0)<=83):0)a=(c[d>>2]|0)==76;else a=1;i=b;return a&1|0}function Tv(a){a=a|0;var d=0,e=0,f=0;e=i;i=i+16|0;f=e;d=e+4|0;c[f>>2]=a;do if((c[f>>2]|0)!=75)if((c[f>>2]|0)==76){b[d>>1]=128;break}else{b[d>>1]=2<<(c[f>>2]|0)-79;break}else b[d>>1]=1;while(0);i=e;return b[d>>1]|0}function Uv(e,f,g){e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;o=i;i=i+32|0;h=o+24|0;l=o+20|0;n=o+16|0;k=o+28|0;j=o+12|0;m=o+8|0;q=o+4|0;p=o;c[l>>2]=e;c[n>>2]=f;a[k>>0]=g;do if((c[(c[l>>2]|0)+12>>2]|0)>=(c[(c[l>>2]|0)+16>>2]|0)){c[q>>2]=c[(c[l>>2]|0)+20>>2];c[p>>2]=c[c[c[c[l>>2]>>2]>>2]>>2];e=Qe(c[p>>2]|0,(c[(c[l>>2]|0)+16>>2]|0)*48<<1,0)|0;c[(c[l>>2]|0)+20>>2]=e;if(c[(c[l>>2]|0)+20>>2]|0){dF(c[(c[l>>2]|0)+20>>2]|0,c[q>>2]|0,(c[(c[l>>2]|0)+12>>2]|0)*48|0)|0;if((c[q>>2]|0)!=((c[l>>2]|0)+24|0))Xb(c[p>>2]|0,c[q>>2]|0);e=((Bk(c[p>>2]|0,c[(c[l>>2]|0)+20>>2]|0)|0)>>>0)/48|0;c[(c[l>>2]|0)+16>>2]=e;break}if((d[k>>0]|0)&1)wn(c[p>>2]|0,c[n>>2]|0);c[(c[l>>2]|0)+20>>2]=c[q>>2];c[h>>2]=0;e=c[h>>2]|0;i=o;return e|0}while(0);f=(c[l>>2]|0)+12|0;e=c[f>>2]|0;c[f>>2]=e+1;c[m>>2]=e;c[j>>2]=(c[(c[l>>2]|0)+20>>2]|0)+(e*48|0);if((c[n>>2]|0)!=0?(c[(c[n>>2]|0)+4>>2]&262144|0)!=0:0){e=c[(c[n>>2]|0)+28>>2]|0;e=((dq(e,((e|0)<0)<<31>>31)|0)<<16>>16)-99&65535;b[(c[j>>2]|0)+16>>1]=e}else b[(c[j>>2]|0)+16>>1]=1;e=iq(c[n>>2]|0)|0;c[c[j>>2]>>2]=e;a[(c[j>>2]|0)+20>>0]=a[k>>0]|0;c[(c[j>>2]|0)+24>>2]=c[l>>2];c[(c[j>>2]|0)+4>>2]=-1;c[h>>2]=c[m>>2];e=c[h>>2]|0;i=o;return e|0}function Vv(f,g){f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0;h=i;i=i+16|0;l=h+8|0;j=h+4|0;m=h+14|0;n=h+12|0;k=h;c[l>>2]=f;c[j>>2]=g;b[m>>1]=c[(c[(c[j>>2]|0)+16>>2]|0)+4>>2]&256;b[n>>1]=c[(c[(c[j>>2]|0)+12>>2]|0)+4>>2]&256;do if((e[m>>1]|0)==(e[n>>1]|0)){if(b[m>>1]|0){n=(c[(c[j>>2]|0)+16>>2]|0)+4|0;c[n>>2]=c[n>>2]&-257;break}if(cq(c[l>>2]|0,c[(c[j>>2]|0)+12>>2]|0)|0){n=(c[(c[j>>2]|0)+12>>2]|0)+4|0;c[n>>2]=c[n>>2]|256}}while(0);c[k>>2]=c[(c[j>>2]|0)+16>>2];c[(c[j>>2]|0)+16>>2]=c[(c[j>>2]|0)+12>>2];c[(c[j>>2]|0)+12>>2]=c[k>>2];if((d[c[j>>2]>>0]|0)<80){i=h;return}a[c[j>>2]>>0]=((d[c[j>>2]>>0]|0)-80^2)+80;i=h;return}function Wv(a,d){a=a|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+16|0;f=e+4|0;g=e;c[f>>2]=a;c[g>>2]=d;if(!(c[f>>2]|0)){i=e;return}a=(c[f>>2]|0)+4|0;c[a>>2]=c[a>>2]|c[(c[g>>2]|0)+4>>2]&1;b[(c[f>>2]|0)+36>>1]=b[(c[g>>2]|0)+36>>1]|0;i=e;return}function Xv(f,g,h){f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0;C=i;i=i+144|0;q=C+140|0;o=C+136|0;r=C+132|0;y=C+128|0;w=C+124|0;t=C+120|0;s=C+116|0;m=C+112|0;z=C+108|0;A=C+104|0;x=C+100|0;P=C+96|0;j=C+24|0;K=C+16|0;J=C+92|0;M=C+88|0;N=C+84|0;L=C+80|0;O=C+8|0;Q=C;R=C+76|0;B=C+72|0;G=C+68|0;E=C+64|0;F=C+60|0;I=C+56|0;H=C+52|0;v=C+48|0;n=C+44|0;u=C+40|0;l=C+36|0;p=C+32|0;c[q>>2]=f;c[o>>2]=g;c[r>>2]=h;c[y>>2]=c[c[o>>2]>>2];c[w>>2]=c[c[y>>2]>>2];c[t>>2]=c[c[w>>2]>>2];c[s>>2]=(c[(c[o>>2]|0)+20>>2]|0)+((c[r>>2]|0)*48|0);c[m>>2]=c[c[s>>2]>>2];f=se(c[t>>2]|0,416,0)|0;c[P>>2]=f;c[(c[s>>2]|0)+12>>2]=f;if(!(c[P>>2]|0)){i=C;return}f=(c[s>>2]|0)+20|0;a[f>>0]=d[f>>0]|16;c[A>>2]=c[P>>2];Ru(c[A>>2]|0,c[y>>2]|0);Su(c[A>>2]|0,c[m>>2]|0,71);Uu(c[q>>2]|0,c[A>>2]|0);if(a[(c[t>>2]|0)+64>>0]|0){i=C;return}f=K;c[f>>2]=-1;c[f+4>>2]=-1;f=j;c[f>>2]=-1;c[f+4>>2]=-1;c[z>>2]=(c[(c[A>>2]|0)+12>>2]|0)-1;c[x>>2]=c[(c[A>>2]|0)+20>>2];while(1){f=K;if(!((c[z>>2]|0)>=0&((c[f>>2]|0)!=0|(c[f+4>>2]|0)!=0)))break;do if(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>2];c[S+4>>2]=f;if(!(e[(c[x>>2]|0)+18>>1]&2)){S=j;c[S>>2]=0;c[S+4>>2]=0;break}else{g=Q;h=j;f=c[h+4>>2]&c[g+4>>2];S=j;c[S>>2]=c[h>>2]&c[g>>2];c[S+4>>2]=f;break}}while(0);c[z>>2]=(c[z>>2]|0)+ -1;c[x>>2]=(c[x>>2]|0)+48}g=K;f=c[g+4>>2]|0;S=(c[P>>2]|0)+408|0;c[S>>2]=c[g>>2];c[S+4>>2]=f;S=K;b[(c[s>>2]|0)+18>>1]=(c[S>>2]|0)==0&(c[S+4>>2]|0)==0?0:256;S=j;if(!((c[S>>2]|0)!=0|(c[S+4>>2]|0)!=0)){i=C;return}c[B>>2]=0;c[G>>2]=-1;c[E>>2]=-1;c[F>>2]=0;c[F>>2]=0;while(1){if((c[F>>2]|0)>=2|(c[B>>2]|0)!=0)break;c[x>>2]=c[(c[A>>2]|0)+20>>2];c[z>>2]=(c[(c[A>>2]|0)+12>>2]|0)-1;while(1){if((c[z>>2]|0)<0)break;S=(c[x>>2]|0)+20|0;a[S>>0]=d[S>>0]&-65;if((c[(c[x>>2]|0)+8>>2]|0)!=(c[E>>2]|0)?(S=j,g=c[S>>2]|0,S=c[S+4>>2]|0,f=_u((c[y>>2]|0)+68|0,c[(c[x>>2]|0)+8>>2]|0)|0,!((g&f|0)==0&(S&D|0)==0)):0){k=28;break}c[z>>2]=(c[z>>2]|0)+ -1;c[x>>2]=(c[x>>2]|0)+48}if((k|0)==28){k=0;c[G>>2]=c[(c[x>>2]|0)+12>>2];c[E>>2]=c[(c[x>>2]|0)+8>>2]}if((c[z>>2]|0)<0)break;c[B>>2]=1;while(1){if(!((c[z>>2]|0)>=0&(c[B>>2]|0)!=0))break;J=c[x>>2]|0;do if((c[(c[x>>2]|0)+8>>2]|0)!=(c[E>>2]|0)){S=J+20|0;a[S>>0]=d[S>>0]&-65}else{if((c[J+12>>2]|0)!=(c[G>>2]|0)){c[B>>2]=0;break}c[H>>2]=(bq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a[y+1>>0]|0):0)A=(c[z>>2]|0)!=(a[y+2>>0]|0);else A=0;j=c[v>>2]|0;if(!A)break;c[v>>2]=j+1}if((j|0)!=0?255!=(d[(c[n>>2]|0)+((c[v>>2]|0)-1)>>0]|0):0){if((c[z>>2]|0)==(a[y>>0]|0))y=(a[(c[n>>2]|0)+((c[v>>2]|0)+1)>>0]|0)==0;else y=0;c[c[r>>2]>>2]=y&1;c[k>>2]=ho(c[w>>2]|0,97,c[n>>2]|0)|0;if(c[k>>2]|0)a[(c[(c[k>>2]|0)+8>>2]|0)+(c[v>>2]|0)>>0]=0;c[c[t>>2]>>2]=c[k>>2];if((c[u>>2]|0)!=135)break;c[p>>2]=c[(c[o>>2]|0)+8>>2];aw(c[p>>2]|0,b[(c[q>>2]|0)+32>>1]|0);if(!(c[c[r>>2]>>2]|0))break;if(!(a[(c[(c[q>>2]|0)+8>>2]|0)+1>>0]|0))break;c[l>>2]=kp(c[o>>2]|0)|0;Qs(c[o>>2]|0,c[q>>2]|0,c[l>>2]|0)|0;F=c[p>>2]|0;af(F,(Mr(c[p>>2]|0)|0)-1|0,0);lp(c[o>>2]|0,c[l>>2]|0);break}c[n>>2]=0}while(0);tf(c[m>>2]|0);c[s>>2]=(c[n>>2]|0)!=0&1;F=c[s>>2]|0;i=x;return F|0}c[s>>2]=0;F=c[s>>2]|0;i=x;return F|0}function Zv(a){a=a|0;var b=0,e=0,f=0,g=0;e=i;i=i+16|0;b=e+8|0;g=e+4|0;f=e;c[g>>2]=a;do if((d[c[g>>2]>>0]|0|0)==153){if(xc(c[(c[g>>2]|0)+8>>2]|0,21512)|0){c[b>>2]=0;break}c[f>>2]=c[(c[g>>2]|0)+20>>2];if((c[c[f>>2]>>2]|0)!=2){c[b>>2]=0;break}if((d[c[(c[(c[f>>2]|0)+4>>2]|0)+20>>2]>>0]|0|0)!=154){c[b>>2]=0;break}else{c[b>>2]=1;break}}else c[b>>2]=0;while(0);i=e;return c[b>>2]|0}function _v(b,f,g,h){b=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0}function aw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;if((c[f>>2]|0)>32){c[(c[e>>2]|0)+188>>2]=-1;i=d;return}else{a=(c[e>>2]|0)+188|0;c[a>>2]=c[a>>2]|1<<(c[f>>2]|0)-1;i=d;return}}function bw(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;l=i;i=i+32|0;f=l;k=l+24|0;h=l+20|0;m=l+16|0;g=l+12|0;j=l+8|0;c[k>>2]=a;c[h>>2]=d;c[m>>2]=e;e=c[c[k>>2]>>2]|0;d=c[c[m>>2]>>2]|0;if((b[(c[m>>2]|0)+36>>1]|0)>=0){m=c[(c[(c[m>>2]|0)+4>>2]|0)+((b[(c[m>>2]|0)+36>>1]|0)*24|0)>>2]|0;c[f>>2]=d;c[f+4>>2]=m;c[g>>2]=Te(e,17448,f)|0;c[j>>2]=1555;m=c[k>>2]|0;e=c[j>>2]|0;d=c[h>>2]|0;a=c[g>>2]|0;ts(m,e,d,a,-1,2);i=l;return}else{c[f>>2]=d;c[g>>2]=Te(e,24432,f)|0;c[j>>2]=2579;m=c[k>>2]|0;e=c[j>>2]|0;d=c[h>>2]|0;a=c[g>>2]|0;ts(m,e,d,a,-1,2);i=l;return}}function cw(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;f=i;i=i+32|0;g=f+20|0;n=f+16|0;j=f+12|0;l=f+8|0;m=f+4|0;k=f;c[n>>2]=a;c[j>>2]=b;c[l>>2]=d;c[m>>2]=e;a:do if(c[(c[c[n>>2]>>2]|0)+24>>2]&524288){e=c[j>>2]|0;if(!(c[l>>2]|0)){if(Up(e)|0)h=1;else h=(c[(c[j>>2]|0)+16>>2]|0)!=0;c[g>>2]=h&1;n=c[g>>2]|0;i=f;return n|0}c[k>>2]=c[e+16>>2];while(1){e=c[j>>2]|0;if(!(c[k>>2]|0))break;if(Bu(e,c[k>>2]|0,c[l>>2]|0,c[m>>2]|0)|0){h=9;break}c[k>>2]=c[(c[k>>2]|0)+4>>2]}if((h|0)==9){c[g>>2]=1;n=c[g>>2]|0;i=f;return n|0}c[k>>2]=Up(e)|0;while(1){if(!(c[k>>2]|0))break a;if(Du(c[j>>2]|0,c[k>>2]|0,c[l>>2]|0,c[m>>2]|0)|0)break;c[k>>2]=c[(c[k>>2]|0)+12>>2]}c[g>>2]=1;n=c[g>>2]|0;i=f;return n|0}while(0);c[g>>2]=0;n=c[g>>2]|0;i=f;return n|0}function dw(b){b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=b;b=c[f>>2]|0;if(c[(c[f>>2]|0)+408>>2]|0)b=c[b+408>>2]|0;c[e>>2]=b;a[(c[e>>2]|0)+20>>0]=1;i=d;return}function ew(e,f,g,h,j,k,l,m,n,o){e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;o=o|0;var p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;x=i;i=i+64|0;D=x+44|0;r=x+40|0;t=x+36|0;z=x+32|0;F=x+28|0;A=x+24|0;B=x+48|0;G=x+53|0;u=x+52|0;H=x+51|0;w=x+20|0;s=x+16|0;v=x+12|0;y=x+50|0;E=x+8|0;p=x+4|0;C=x;c[D>>2]=e;c[r>>2]=f;c[t>>2]=g;c[z>>2]=h;c[F>>2]=j;c[A>>2]=k;b[B>>1]=l;a[G>>0]=m;a[u>>0]=n;a[H>>0]=o;c[w>>2]=c[(c[D>>2]|0)+8>>2];c[s>>2]=0;c[v>>2]=Nr(c[w>>2]|0)|0;a[y>>0]=(d[(c[r>>2]|0)+44>>0]&32|0)==0?70:68;if(!(a[H>>0]|0))We(c[w>>2]|0,d[y>>0]|0,c[z>>2]|0,c[v>>2]|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k+4|0;h=k;c[j>>2]=a;c[f>>2]=d;c[g>>2]=0;if(!(c[(c[c[j>>2]>>2]|0)+24>>2]&524288)){a=c[g>>2]|0;i=k;return a|0}c[l>>2]=c[(c[f>>2]|0)+16>>2];while(1){if(!(c[l>>2]|0))break;c[m>>2]=0;while(1){if((c[m>>2]|0)>=(c[(c[l>>2]|0)+20>>2]|0))break;if((c[(c[l>>2]|0)+36+(c[m>>2]<<3)>>2]|0)>31)d=-1;else d=1<<c[(c[l>>2]|0)+36+(c[m>>2]<<3)>>2];c[g>>2]=c[g>>2]|d;c[m>>2]=(c[m>>2]|0)+1}c[l>>2]=c[(c[l>>2]|0)+4>>2]}c[l>>2]=Up(c[f>>2]|0)|0;while(1){if(!(c[l>>2]|0))break;c[h>>2]=0;$t(c[j>>2]|0,c[f>>2]|0,c[l>>2]|0,h,0)|0;a:do if(c[h>>2]|0){c[m>>2]=0;while(1){if((c[m>>2]|0)>=(e[(c[h>>2]|0)+50>>1]|0))break a;if((b[(c[(c[h>>2]|0)+4>>2]|0)+(c[m>>2]<<1)>>1]|0)>31)d=-1;else d=1<<b[(c[(c[h>>2]|0)+4>>2]|0)+(c[m>>2]<<1)>>1];c[g>>2]=c[g>>2]|d;c[m>>2]=(c[m>>2]|0)+1}}while(0);c[l>>2]=c[(c[l>>2]|0)+12>>2]}a=c[g>>2]|0;i=k;return a|0}function iw(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;q=i;i=i+32|0;k=q+28|0;m=q+24|0;p=q+20|0;n=q+16|0;h=q+12|0;r=q+8|0;o=q+4|0;l=q;c[k>>2]=a;c[m>>2]=b;c[p>>2]=d;c[n>>2]=e;c[h>>2]=f;c[r>>2]=g;if(!(c[(c[c[k>>2]>>2]|0)+24>>2]&524288)){i=q;return}c[o>>2]=Up(c[m>>2]|0)|0;while(1){if(!(c[o>>2]|0))break;if(!((c[h>>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0;q=c[m>>2]|0;d=(c[n>>2]|0)+72|0;r=(c[d>>2]|0)+1|0;c[d>>2]=r;ip(b,131,a,q,r)|0;bf(c[k>>2]|0,-1,c[(c[h>>2]|0)+8>>2]|0,-18);Xe(c[k>>2]|0,c[j>>2]&255);i=o;return}function lw(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+32|0;h=g+20|0;j=g+16|0;k=g+12|0;f=g+8|0;m=g+4|0;l=g;c[h>>2]=a;c[j>>2]=b;c[k>>2]=d;c[f>>2]=e;e=c[h>>2]|0;if(c[(c[h>>2]|0)+408>>2]|0)e=c[e+408>>2]|0;c[m>>2]=e;c[l>>2]=c[(c[m>>2]|0)+528>>2];while(1){if(!(c[l>>2]|0))break;if((c[c[l>>2]>>2]|0)==(c[j>>2]|0)?(c[(c[l>>2]|0)+12>>2]|0)==(c[f>>2]|0):0)break;c[l>>2]=c[(c[l>>2]|0)+4>>2]}if(c[l>>2]|0){a=c[l>>2]|0;i=g;return a|0}c[l>>2]=mw(c[h>>2]|0,c[j>>2]|0,c[k>>2]|0,c[f>>2]|0)|0;a=c[l>>2]|0;i=g;return a|0}function mw(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;q=i;i=i+96|0;j=q;s=q+84|0;w=q+80|0;l=q+76|0;u=q+72|0;p=q+68|0;v=q+64|0;k=q+60|0;t=q+56|0;m=q+52|0;r=q+48|0;n=q+16|0;x=q+12|0;o=q+8|0;h=q+4|0;c[w>>2]=b;c[l>>2]=e;c[u>>2]=f;c[p>>2]=g;g=c[w>>2]|0;if(c[(c[w>>2]|0)+408>>2]|0)g=c[g+408>>2]|0;c[v>>2]=g;c[k>>2]=c[c[w>>2]>>2];c[m>>2]=0;c[x>>2]=0;c[h>>2]=0;c[t>>2]=se(c[k>>2]|0,24,0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[m>>2]|0)}ow(c[o>>2]|0,c[(c[l>>2]|0)+28>>2]|0,c[p>>2]|0)|0;if(c[h>>2]|0)Pr(c[r>>2]|0,c[h>>2]|0);mp(c[r>>2]|0,24)|0;pw(c[w>>2]|0,c[o>>2]|0);if(!(d[(c[k>>2]|0)+64>>0]|0)){b=qw(c[r>>2]|0,(c[x>>2]|0)+4|0,(c[v>>2]|0)+392|0)|0;c[c[x>>2]>>2]=b}c[(c[x>>2]|0)+8>>2]=c[(c[o>>2]|0)+72>>2];c[(c[x>>2]|0)+12>>2]=c[(c[o>>2]|0)+68>>2];c[(c[x>>2]|0)+16>>2]=c[(c[o>>2]|0)+80>>2];c[(c[x>>2]|0)+20>>2]=c[l>>2];c[(c[t>>2]|0)+16>>2]=c[(c[o>>2]|0)+428>>2];c[(c[t>>2]|0)+20>>2]=c[(c[o>>2]|0)+432>>2];qn(c[r>>2]|0)}ef(c[o>>2]|0);Xb(c[k>>2]|0,c[o>>2]|0);c[s>>2]=c[t>>2];b=c[s>>2]|0;i=q;return b|0}function nw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[e>>2]=a;c[f>>2]=b;c[(c[f>>2]|0)+24>>2]=c[(c[e>>2]|0)+192>>2];c[(c[e>>2]|0)+192>>2]=c[f>>2];i=d;return}function ow(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;m=i;i=i+48|0;k=m+44|0;p=m+40|0;o=m+36|0;j=m+32|0;h=m+28|0;l=m+24|0;n=m+4|0;g=m;c[k>>2]=b;c[p>>2]=e;c[o>>2]=f;c[h>>2]=c[(c[k>>2]|0)+8>>2];c[l>>2]=c[c[k>>2]>>2];c[j>>2]=c[p>>2];while(1){if(!(c[j>>2]|0))break;if((c[o>>2]|0)==10)f=a[(c[j>>2]|0)+1>>0]|0;else f=c[o>>2]&255;a[(c[k>>2]|0)+437>>0]=f;f=d[c[j>>2]>>0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>>2]|0);c[c[h>>2]>>2]=c[(c[g>>2]|0)+32>>2];c[(c[g>>2]|0)+4>>2]=0;i=f;return c[e>>2]|0}function rw(e,f){e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;m=i;i=i+48|0;n=m+28|0;l=m+24|0;r=m+20|0;k=m+16|0;o=m+12|0;j=m+8|0;g=m+4|0;p=m+32|0;q=m;c[n>>2]=e;c[l>>2]=f;c[k>>2]=c[c[l>>2]>>2];c[j>>2]=c[(c[n>>2]|0)+24>>2];c[g>>2]=c[(c[j>>2]|0)+112>>2];e=(c[n>>2]|0)+88|0;b[e>>1]=b[e>>1]&-257|256;e=(c[n>>2]|0)+88|0;b[e>>1]=b[e>>1]&-513;c[o>>2]=c[(c[n>>2]|0)+4>>2];c[r>>2]=(c[(c[n>>2]|0)+32>>2]|0)-1;while(1){if((c[r>>2]|0)<0)break;a[p>>0]=a[c[o>>2]>>0]|0;switch(d[p>>0]|0|0){case 6:case 8:{c[(c[o>>2]|0)+16>>2]=47;a[(c[o>>2]|0)+1>>0]=-19;break};case 2:case 3:{h=8;break};case 10:case 1:{if((d[(c[o>>2]|0)+3>>0]|0|0)>(c[k>>2]|0))c[k>>2]=d[(c[o>>2]|0)+3>>0];break};case 12:case 13:case 11:{e=(c[n>>2]|0)+88|0;b[e>>1]=b[e>>1]&-257;e=(c[n>>2]|0)+88|0;b[e>>1]=b[e>>1]&-513|512;break};case 14:{c[q>>2]=c[(c[o>>2]|0)+ -20+4>>2];if((c[q>>2]|0)>(c[k>>2]|0))c[k>>2]=c[q>>2];break};case 15:{if((c[(c[o>>2]|0)+8>>2]|0)>(c[k>>2]|0))c[k>>2]=c[(c[o>>2]|0)+8>>2];break};case 4:{if(c[(c[o>>2]|0)+8>>2]|0){h=(c[n>>2]|0)+88|0;b[h>>1]=b[h>>1]&-257;h=8}else h=8;break};case 5:case 7:case 9:{c[(c[o>>2]|0)+16>>2]=46;a[(c[o>>2]|0)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0;f=c[j>>2]|0;i=h;return f|0}return 0}function tw(f,g){f=f|0;g=g|0;var h=0,j=0,k=0,l=0;h=i;i=i+16|0;j=h+8|0;k=h+4|0;l=h;c[k>>2]=f;c[l>>2]=g;c[c[l>>2]>>2]=0;f=(c[k>>2]|0)+72|0;a[f>>0]=d[f>>0]&-15;b[(c[k>>2]|0)+44>>1]=0;if(((d[(c[k>>2]|0)+73>>0]|0)==1?(e[(c[k>>2]|0)+78+(b[(c[k>>2]|0)+76>>1]<<1)>>1]|0)!=0:0)?(d[(c[(c[k>>2]|0)+120+(b[(c[k>>2]|0)+76>>1]<<2)>>2]|0)+5>>0]|0)!=0:0){f=(c[k>>2]|0)+78+(b[(c[k>>2]|0)+76>>1]<<1)|0;b[f>>1]=(b[f>>1]|0)+ -1<<16>>16;c[j>>2]=0;f=c[j>>2]|0;i=h;return f|0}c[j>>2]=uw(c[k>>2]|0,c[l>>2]|0)|0;f=c[j>>2]|0;i=h;return f|0}function uw(f,g){f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;k=i;i=i+32|0;j=k+20|0;m=k+16|0;l=k+12|0;n=k+8|0;o=k+4|0;p=k;c[m>>2]=f;c[l>>2]=g;if((d[(c[m>>2]|0)+73>>0]|0)!=1){if((d[(c[m>>2]|0)+73>>0]|0)>=3)g=vw(c[m>>2]|0)|0;else g=0;c[n>>2]=g;if(c[n>>2]|0){c[j>>2]=c[n>>2];f=c[j>>2]|0;i=k;return f|0}if(!(d[(c[m>>2]|0)+73>>0]|0)){c[c[l>>2]>>2]=1;c[j>>2]=0;f=c[j>>2]|0;i=k;return f|0}if((c[(c[m>>2]|0)+68>>2]|0)!=0?(a[(c[m>>2]|0)+73>>0]=1,f=(c[(c[m>>2]|0)+68>>2]|0)<0,c[(c[m>>2]|0)+68>>2]=0,f):0){c[j>>2]=0;f=c[j>>2]|0;i=k;return f|0}}c[o>>2]=c[(c[m>>2]|0)+120+(b[(c[m>>2]|0)+76>>1]<<2)>>2];do if(a[(c[o>>2]|0)+5>>0]|0){while(1){p=b[(c[m>>2]|0)+76>>1]|0;if(e[(c[m>>2]|0)+78+(b[(c[m>>2]|0)+76>>1]<<1)>>1]|0)break;g=c[m>>2]|0;if(!p){h=17;break}yw(g)}if((h|0)==17){a[g+73>>0]=0;c[c[l>>2]>>2]=1;c[j>>2]=0;f=c[j>>2]|0;i=k;return f|0}f=(c[m>>2]|0)+78+(p<<1)|0;b[f>>1]=(b[f>>1]|0)+ -1<<16>>16;c[o>>2]=c[(c[m>>2]|0)+120+(b[(c[m>>2]|0)+76>>1]<<2)>>2];if((d[(c[o>>2]|0)+2>>0]|0)!=0?(a[(c[o>>2]|0)+5>>0]|0)==0:0){c[n>>2]=tw(c[m>>2]|0,c[l>>2]|0)|0;break}c[n>>2]=0}else{c[p>>2]=e[(c[m>>2]|0)+78+(b[(c[m>>2]|0)+76>>1]<<1)>>1];f=c[m>>2]|0;c[n>>2]=ww(f,Hh((c[(c[o>>2]|0)+56>>2]|0)+(e[(c[o>>2]|0)+20>>1]&(d[(c[(c[o>>2]|0)+64>>2]|0)+(c[p>>2]<<1)>>0]<<8|d[(c[(c[o>>2]|0)+64>>2]|0)+(c[p>>2]<<1)+1>>0]))|0)|0)|0;if(!(c[n>>2]|0)){c[n>>2]=xw(c[m>>2]|0)|0;break}c[j>>2]=c[n>>2];f=c[j>>2]|0;i=k;return f|0}while(0);c[j>>2]=c[n>>2];f=c[j>>2]|0;i=k;return f|0}function vw(b){b=b|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;f=e+8|0;h=e+4|0;g=e;c[h>>2]=b;b=c[h>>2]|0;if((d[(c[h>>2]|0)+73>>0]|0|0)==4){c[f>>2]=c[b+68>>2];b=c[f>>2]|0;i=e;return b|0}a[b+73>>0]=0;b=(c[h>>2]|0)+48|0;c[g>>2]=Dw(c[h>>2]|0,c[(c[h>>2]|0)+56>>2]|0,c[b>>2]|0,c[b+4>>2]|0,0,(c[h>>2]|0)+68|0)|0;if(((c[g>>2]|0)==0?(hc(c[(c[h>>2]|0)+56>>2]|0),c[(c[h>>2]|0)+56>>2]=0,(c[(c[h>>2]|0)+68>>2]|0)!=0):0)?(d[(c[h>>2]|0)+73>>0]|0|0)==1:0)a[(c[h>>2]|0)+73>>0]=2;c[f>>2]=c[g>>2];b=c[f>>2]|0;i=e;return b|0}function ww(f,g){f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;h=i;i=i+32|0;j=h+24|0;m=h+20|0;p=h+16|0;k=h+12|0;n=h+8|0;l=h+4|0;o=h;c[m>>2]=f;c[p>>2]=g;c[n>>2]=b[(c[m>>2]|0)+76>>1];c[o>>2]=c[(c[m>>2]|0)+4>>2];if((b[(c[m>>2]|0)+76>>1]|0)>=19){c[j>>2]=kj(56561)|0;f=c[j>>2]|0;i=h;return f|0}c[k>>2]=zw(c[o>>2]|0,c[p>>2]|0,l,(d[(c[m>>2]|0)+72>>0]&1|0)==0?2:0)|0;if(c[k>>2]|0){c[j>>2]=c[k>>2];f=c[j>>2]|0;i=h;return f|0}c[(c[m>>2]|0)+120+((c[n>>2]|0)+1<<2)>>2]=c[l>>2];b[(c[m>>2]|0)+78+((c[n>>2]|0)+1<<1)>>1]=0;f=(c[m>>2]|0)+76|0;b[f>>1]=(b[f>>1]|0)+1<<16>>16;b[(c[m>>2]|0)+44>>1]=0;f=(c[m>>2]|0)+72|0;a[f>>0]=d[f>>0]&-7;if((e[(c[l>>2]|0)+18>>1]|0)>=1?(d[(c[l>>2]|0)+2>>0]|0)==(d[(c[(c[m>>2]|0)+120+(c[n>>2]<<2)>>2]|0)+2>>0]|0):0){c[j>>2]=0;f=c[j>>2]|0;i=h;return f|0}c[j>>2]=kj(56573)|0;f=c[j>>2]|0;i=h;return f|0}function xw(f){f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;j=i;i=i+32|0;h=j+16|0;g=j+12|0;m=j+8|0;k=j+4|0;l=j;c[g>>2]=f;c[k>>2]=0;c[l>>2]=0;while(1){n=c[(c[g>>2]|0)+120+(b[(c[g>>2]|0)+76>>1]<<2)>>2]|0;c[l>>2]=n;f=c[l>>2]|0;if(!((a[n+5>>0]|0)!=0^1)){l=5;break}c[m>>2]=Hh((c[(c[l>>2]|0)+56>>2]|0)+((d[f+6>>0]|0)+8)|0)|0;b[(c[g>>2]|0)+78+(b[(c[g>>2]|0)+76>>1]<<1)>>1]=b[(c[l>>2]|0)+18>>1]|0;c[k>>2]=ww(c[g>>2]|0,c[m>>2]|0)|0;if(c[k>>2]|0){l=4;break}}if((l|0)==4){c[h>>2]=c[k>>2];n=c[h>>2]|0;i=j;return n|0}else if((l|0)==5){b[(c[g>>2]|0)+78+(b[(c[g>>2]|0)+76>>1]<<1)>>1]=(e[f+18>>1]|0)-1;c[h>>2]=0;n=c[h>>2]|0;i=j;return n|0}return 0}function yw(e){e=e|0;var f=0,g=0;f=i;i=i+16|0;g=f;c[g>>2]=e;Rk(c[(c[g>>2]|0)+120+(b[(c[g>>2]|0)+76>>1]<<2)>>2]|0);e=(c[g>>2]|0)+76|0;b[e>>1]=(b[e>>1]|0)+ -1<<16>>16;b[(c[g>>2]|0)+44>>1]=0;e=(c[g>>2]|0)+72|0;a[e>>0]=d[e>>0]&-7;i=f;return}function zw(a,b,e,f){a=a|0;b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+32|0;m=g+16|0;l=g+12|0;j=g+8|0;k=g+4|0;h=g;c[m>>2]=a;c[l>>2]=b;c[j>>2]=e;c[k>>2]=f;a=c[l>>2]|0;if(a>>>0<=(Aw(c[m>>2]|0)|0)>>>0){c[h>>2]=Bw(c[m>>2]|0,c[l>>2]|0,c[j>>2]|0,c[k>>2]|0)|0;if(((c[h>>2]|0)==0?(d[c[c[j>>2]>>2]>>0]|0|0)==0:0)?(c[h>>2]=Sj(c[c[j>>2]>>2]|0)|0,(c[h>>2]|0)!=0):0)Rk(c[c[j>>2]>>2]|0)}else c[h>>2]=kj(53903)|0;i=g;return c[h>>2]|0}function Aw(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return c[(c[b>>2]|0)+44>>2]|0}function Bw(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;k=i;i=i+32|0;g=k+24|0;f=k+20|0;l=k+16|0;j=k+12|0;n=k+8|0;h=k+4|0;m=k;c[f>>2]=a;c[l>>2]=b;c[j>>2]=d;c[n>>2]=e;c[h>>2]=Xc(c[c[f>>2]>>2]|0,c[l>>2]|0,m,c[n>>2]|0)|0;if(c[h>>2]|0){c[g>>2]=c[h>>2];n=c[g>>2]|0;i=k;return n|0}else{n=Cw(c[m>>2]|0,c[l>>2]|0,c[f>>2]|0)|0;c[c[j>>2]>>2]=n;c[g>>2]=0;n=c[g>>2]|0;i=k;return n|0}return 0}function Cw(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;g=i;i=i+16|0;k=g+12|0;h=g+8|0;j=g+4|0;f=g;c[k>>2]=b;c[h>>2]=d;c[j>>2]=e;c[f>>2]=Qj(c[k>>2]|0)|0;b=Zc(c[k>>2]|0)|0;c[(c[f>>2]|0)+56>>2]=b;c[(c[f>>2]|0)+68>>2]=c[k>>2];c[(c[f>>2]|0)+52>>2]=c[j>>2];c[(c[f>>2]|0)+72>>2]=c[h>>2];a[(c[f>>2]|0)+6>>0]=(c[(c[f>>2]|0)+72>>2]|0)==1?100:0;i=g;return c[f>>2]|0}function Dw(a,b,d,f,g,h){a=a|0;b=b|0;d=d|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;q=i;i=i+240|0;k=q+36|0;l=q+32|0;s=q+28|0;n=q;p=q+24|0;j=q+20|0;r=q+16|0;o=q+12|0;m=q+8|0;c[l>>2]=a;c[s>>2]=b;a=n;c[a>>2]=d;c[a+4>>2]=f;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];b[(c[k>>2]|0)+4>>1]=(e[(c[l>>2]|0)+6>>1]|0)+1;c[j>>2]=c[k>>2];q=c[j>>2]|0;i=n;return q|0}function Fw(f,g,h,j){f=f|0;g=g|0;h=h|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;k=i;i=i+48|0;o=k+36|0;p=k+32|0;v=k+28|0;l=k+24|0;q=k+20|0;r=k+16|0;t=k+12|0;m=k+40|0;u=k+8|0;n=k+4|0;s=k;c[o>>2]=f;c[p>>2]=g;c[v>>2]=h;c[l>>2]=j;c[q>>2]=c[v>>2];c[n>>2]=c[(c[l>>2]|0)+8>>2];a[(c[l>>2]|0)+6>>0]=0;j=c[q>>2]|0;if((d[c[q>>2]>>0]|0|0)<128){c[u>>2]=d[j>>0];j=1}else j=(Rw(j,u)|0)&255;c[t>>2]=j&255;c[r>>2]=c[u>>2];b[m>>1]=0;while(1){if((c[t>>2]|0)>>>0>=(c[u>>2]|0)>>>0){n=11;break}if((c[r>>2]|0)>(c[p>>2]|0)){n=11;break}j=(c[q>>2]|0)+(c[t>>2]|0)|0;if((d[(c[q>>2]|0)+(c[t>>2]|0)>>0]|0|0)<128){c[s>>2]=d[j>>0];j=1}else j=(Rw(j,s)|0)&255;c[t>>2]=(c[t>>2]|0)+(j&255);a[(c[n>>2]|0)+10>>0]=a[(c[o>>2]|0)+4>>0]|0;c[(c[n>>2]|0)+32>>2]=c[(c[o>>2]|0)+12>>2];c[(c[n>>2]|0)+24>>2]=0;v=Xw((c[q>>2]|0)+(c[r>>2]|0)|0,c[s>>2]|0,c[n>>2]|0)|0;c[r>>2]=(c[r>>2]|0)+v;c[n>>2]=(c[n>>2]|0)+40;v=(b[m>>1]|0)+1<<16>>16;b[m>>1]=v;if((v&65535|0)>=(e[(c[l>>2]|0)+4>>1]|0|0)){n=11;break}}if((n|0)==11){b[(c[l>>2]|0)+4>>1]=b[m>>1]|0;i=k;return}}function Gw(f,g,h,j,k,l){f=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2)>>2];c[v>>2]=0;c[m>>2]=(e[(c[t>>2]|0)+18>>1]|0)-1;c[u>>2]=c[m>>2]>>1-(c[F>>2]|0);b[(c[D>>2]|0)+78+(b[(c[D>>2]|0)+76>>1]<<1)>>1]=c[u>>2];b:do if(!(c[n>>2]|0)){while(1){c[q>>2]=(c[(c[t>>2]|0)+56>>2]|0)+(e[(c[t>>2]|0)+20>>1]&(d[(c[(c[t>>2]|0)+64>>2]|0)+(c[u>>2]<<1)>>0]<<8|d[(c[(c[t>>2]|0)+64>>2]|0)+(c[u>>2]<<1)+1>>0]))+(d[(c[t>>2]|0)+7>>0]|0);c:do if(a[(c[t>>2]|0)+3>>0]|0)while(1){f=c[q>>2]|0;c[q>>2]=f+1;if(128>(d[f>>0]|0))break c;if((c[q>>2]|0)>>>0>=(c[(c[t>>2]|0)+60>>2]|0)>>>0){l=20;break a}}while(0);Jw(c[q>>2]|0,r)|0;g=r;j=c[g+4>>2]|0;f=s;h=c[f+4>>2]|0;if((j|0)<(h|0)|((j|0)==(h|0)?(c[g>>2]|0)>>>0<(c[f>>2]|0)>>>0:0)){c[v>>2]=(c[u>>2]|0)+1;if((c[v>>2]|0)>(c[m>>2]|0)){l=23;break}}else{g=r;j=c[g+4>>2]|0;f=s;h=c[f+4>>2]|0;if(!((j|0)>(h|0)|((j|0)==(h|0)?(c[g>>2]|0)>>>0>(c[f>>2]|0)>>>0:0))){l=27;break}c[m>>2]=(c[u>>2]|0)-1;if((c[v>>2]|0)>(c[m>>2]|0)){l=26;break}}c[u>>2]=(c[v>>2]|0)+(c[m>>2]|0)>>1}if((l|0)==23){c[y>>2]=-1;l=49;break}else if((l|0)==26){c[y>>2]=1;l=49;break}else if((l|0)==27){l=0;h=(c[D>>2]|0)+72|0;a[h>>0]=d[h>>0]|2;h=r;g=c[h+4>>2]|0;f=(c[D>>2]|0)+24|0;c[f>>2]=c[h>>2];c[f+4>>2]=g;b[(c[D>>2]|0)+78+(b[(c[D>>2]|0)+76>>1]<<1)>>1]=c[u>>2];if(a[(c[t>>2]|0)+5>>0]|0){l=29;break a}c[v>>2]=c[u>>2];break}}else while(1){c[q>>2]=(c[(c[t>>2]|0)+56>>2]|0)+(e[(c[t>>2]|0)+20>>1]&(d[(c[(c[t>>2]|0)+64>>2]|0)+(c[u>>2]<<1)>>0]<<8|d[(c[(c[t>>2]|0)+64>>2]|0)+(c[u>>2]<<1)+1>>0]))+(d[(c[t>>2]|0)+7>>0]|0);c[A>>2]=d[c[q>>2]>>0];do if((c[A>>2]|0)<=(d[(c[t>>2]|0)+8>>0]|0))c[y>>2]=pb[c[n>>2]&31](c[A>>2]|0,(c[q>>2]|0)+1|0,c[B>>2]|0)|0;else{if((d[(c[q>>2]|0)+1>>0]&128|0)==0?(f=((c[A>>2]&127)<<7)+(d[(c[q>>2]|0)+1>>0]|0)|0,c[A>>2]=f,(f|0)<=(e[(c[t>>2]|0)+10>>1]|0)):0){c[y>>2]=pb[c[n>>2]&31](c[A>>2]|0,(c[q>>2]|0)+2|0,c[B>>2]|0)|0;break}c[E>>2]=(c[q>>2]|0)+(0-(d[(c[t>>2]|0)+7>>0]|0));Kw(c[t>>2]|0,c[E>>2]|0,(c[D>>2]|0)+24|0);c[A>>2]=c[(c[D>>2]|0)+24>>2];f=c[A>>2]|0;c[C>>2]=gc(f,((f|0)<0)<<31>>31)|0;if(!(c[C>>2]|0)){l=37;break a}b[(c[D>>2]|0)+78+(b[(c[D>>2]|0)+76>>1]<<1)>>1]=c[u>>2];c[p>>2]=Lw(c[D>>2]|0,0,c[A>>2]|0,c[C>>2]|0,2)|0;if(c[p>>2]|0){l=39;break a}c[y>>2]=pb[c[n>>2]&31](c[A>>2]|0,c[C>>2]|0,c[B>>2]|0)|0;hc(c[C>>2]|0)}while(0);if((c[y>>2]|0)<0)c[v>>2]=(c[u>>2]|0)+1;else{if((c[y>>2]|0)<=0){l=45;break a}c[m>>2]=(c[u>>2]|0)-1}if((c[v>>2]|0)>(c[m>>2]|0)){l=49;break b}c[u>>2]=(c[v>>2]|0)+(c[m>>2]|0)>>1}while(0);if((l|0)==49?(l=0,(a[(c[t>>2]|0)+5>>0]|0)!=0):0){l=50;break}k=c[t>>2]|0;if((c[v>>2]|0)>=(e[(c[t>>2]|0)+18>>1]|0))c[x>>2]=Hh((c[(c[t>>2]|0)+56>>2]|0)+((d[k+6>>0]|0)+8)|0)|0;else c[x>>2]=Hh((c[k+56>>2]|0)+(e[(c[t>>2]|0)+20>>1]&(d[(c[(c[t>>2]|0)+64>>2]|0)+(c[v>>2]<<1)>>0]<<8|d[(c[(c[t>>2]|0)+64>>2]|0)+(c[v>>2]<<1)+1>>0]))|0)|0;b[(c[D>>2]|0)+78+(b[(c[D>>2]|0)+76>>1]<<1)>>1]=c[v>>2];c[p>>2]=ww(c[D>>2]|0,c[x>>2]|0)|0}while((c[p>>2]|0)==0);if((l|0)==20){c[w>>2]=kj(56945)|0;f=c[w>>2]|0;i=z;return f|0}else if((l|0)==29){c[c[o>>2]>>2]=0;c[p>>2]=0}else if((l|0)==37)c[p>>2]=7;else if((l|0)==39)hc(c[C>>2]|0);else if((l|0)==45){c[c[o>>2]>>2]=0;c[p>>2]=0;b[(c[D>>2]|0)+78+(b[(c[D>>2]|0)+76>>1]<<1)>>1]=c[u>>2];if(a[(c[B>>2]|0)+7>>0]|0)c[p>>2]=11}else if((l|0)==50){b[(c[D>>2]|0)+78+(b[(c[D>>2]|0)+76>>1]<<1)>>1]=c[u>>2];c[c[o>>2]>>2]=c[y>>2];c[p>>2]=0}b[(c[D>>2]|0)+44>>1]=0;f=(c[D>>2]|0)+72|0;a[f>>0]=d[f>>0]&-7;c[w>>2]=c[p>>2];f=c[w>>2]|0;i=z;return f|0}function Hw(b){b=b|0;var d=0,f=0,g=0,h=0;f=i;i=i+16|0;d=f+8|0;h=f+4|0;g=f;c[h>>2]=b;if(((e[(c[c[h>>2]>>2]|0)+6>>1]|0)+(e[(c[c[h>>2]>>2]|0)+8>>1]|0)|0)<=13){c[g>>2]=e[(c[(c[h>>2]|0)+8>>2]|0)+8>>1];b=(c[h>>2]|0)+12|0;if(a[c[(c[c[h>>2]>>2]|0)+16>>2]>>0]|0){c[b>>2]=1;c[(c[h>>2]|0)+16>>2]=-1}else{c[b>>2]=-1;c[(c[h>>2]|0)+16>>2]=1}if(c[g>>2]&4){c[d>>2]=15;b=c[d>>2]|0;i=f;return b|0}if((c[g>>2]&25|0)==0?(c[(c[c[h>>2]>>2]|0)+20>>2]|0)==0:0){c[d>>2]=16;b=c[d>>2]|0;i=f;return b|0}}c[d>>2]=17;b=c[d>>2]|0;i=f;return b|0}function Iw(f){f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;j=i;i=i+32|0;h=j+16|0;k=j+12|0;l=j+8|0;g=j+4|0;m=j;c[k>>2]=f;c[g>>2]=0;do if((d[(c[k>>2]|0)+73>>0]|0)>=3){f=c[k>>2]|0;if((d[(c[k>>2]|0)+73>>0]|0)!=4){Qk(f);break}c[h>>2]=c[f+68>>2];f=c[h>>2]|0;i=j;return f|0}while(0);a:do if((b[(c[k>>2]|0)+76>>1]|0)>=0)while(1){if(!(b[(c[k>>2]|0)+76>>1]|0))break a;n=(c[k>>2]|0)+76|0;f=b[n>>1]|0;b[n>>1]=f+ -1<<16>>16;Rk(c[(c[k>>2]|0)+120+(f<<16>>16<<2)>>2]|0)}else{f=c[k>>2]|0;if(!(c[(c[k>>2]|0)+60>>2]|0)){a[f+73>>0]=0;c[h>>2]=0;n=c[h>>2]|0;i=j;return n|0}c[g>>2]=zw(c[(c[f>>2]|0)+4>>2]|0,c[(c[k>>2]|0)+60>>2]|0,(c[k>>2]|0)+120|0,(d[(c[k>>2]|0)+72>>0]&1|0)==0?2:0)|0;f=c[k>>2]|0;if(!(c[g>>2]|0)){b[f+76>>1]=0;break}a[f+73>>0]=0;c[h>>2]=c[g>>2];n=c[h>>2]|0;i=j;return n|0}while(0);c[l>>2]=c[(c[k>>2]|0)+120>>2];if((d[c[l>>2]>>0]|0)!=0?((c[(c[k>>2]|0)+16>>2]|0)==0|0)==(d[(c[l>>2]|0)+2>>0]|0):0){b[(c[k>>2]|0)+78>>1]=0;b[(c[k>>2]|0)+44>>1]=0;n=(c[k>>2]|0)+72|0;a[n>>0]=d[n>>0]&-15;do if((e[(c[l>>2]|0)+18>>1]|0)>0)a[(c[k>>2]|0)+73>>0]=1;else{if(a[(c[l>>2]|0)+5>>0]|0){a[(c[k>>2]|0)+73>>0]=0;break}if((c[(c[l>>2]|0)+72>>2]|0)==1){c[m>>2]=Hh((c[(c[l>>2]|0)+56>>2]|0)+((d[(c[l>>2]|0)+6>>0]|0)+8)|0)|0;a[(c[k>>2]|0)+73>>0]=1;c[g>>2]=ww(c[k>>2]|0,c[m>>2]|0)|0;break}c[h>>2]=kj(56709)|0;n=c[h>>2]|0;i=j;return n|0}while(0);c[h>>2]=c[g>>2];n=c[h>>2]|0;i=j;return n|0}c[h>>2]=kj(56698)|0;n=c[h>>2]|0;i=j;return n|0}\n\n\n\nfunction Jw(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;k=i;i=i+32|0;g=k+20|0;m=k+16|0;j=k+12|0;h=k+8|0;f=k+4|0;l=k;c[m>>2]=b;c[j>>2]=e;c[h>>2]=d[c[m>>2]>>0];if(!(c[h>>2]&128)){b=c[j>>2]|0;c[b>>2]=c[h>>2];c[b+4>>2]=0;a[g>>0]=1;b=a[g>>0]|0;i=k;return b|0}c[m>>2]=(c[m>>2]|0)+1;c[f>>2]=d[c[m>>2]>>0];if(!(c[f>>2]&128)){c[h>>2]=c[h>>2]&127;c[h>>2]=c[h>>2]<<7;c[h>>2]=c[h>>2]|c[f>>2];b=c[j>>2]|0;c[b>>2]=c[h>>2];c[b+4>>2]=0;a[g>>0]=2;b=a[g>>0]|0;i=k;return b|0}c[m>>2]=(c[m>>2]|0)+1;c[h>>2]=c[h>>2]<<14;c[h>>2]=c[h>>2]|(d[c[m>>2]>>0]|0);b=(c[h>>2]&128|0)!=0;c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2]|0)+((e[(c[k>>2]|0)+20>>1]|0)&((d[(c[(c[k>>2]|0)+64>>2]|0)+(c[j>>2]<<1)>>0]|0)<<8|(d[(c[(c[k>>2]|0)+64>>2]|0)+(c[j>>2]<<1)+1>>0]|0)))|0,c[h>>2]|0);i=g;return}function Nw(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;m=i;i=i+32|0;h=m+24|0;l=m+20|0;k=m+16|0;j=m+12|0;o=m+8|0;n=m+4|0;g=m;c[l>>2]=a;c[k>>2]=b;c[j>>2]=d;c[o>>2]=e;c[n>>2]=f;do if(c[o>>2]|0){c[g>>2]=gd(c[n>>2]|0)|0;if(!(c[g>>2]|0)){dF(c[l>>2]|0,c[k>>2]|0,c[j>>2]|0)|0;break}c[h>>2]=c[g>>2];o=c[h>>2]|0;i=m;return o|0}else dF(c[k>>2]|0,c[l>>2]|0,c[j>>2]|0)|0;while(0);c[h>>2]=0;o=c[h>>2]|0;i=m;return o|0}function Ow(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;h=i;i=i+48|0;o=h+32|0;p=h+28|0;k=h+24|0;m=h+20|0;q=h+16|0;l=h+12|0;j=h+8|0;r=h+4|0;n=h;s=h+36|0;c[o>>2]=b;c[p>>2]=e;c[k>>2]=f;c[m>>2]=g;c[q>>2]=0;c[l>>2]=0;c[j>>2]=0;if(a[(c[o>>2]|0)+17>>0]|0){c[n>>2]=(c[p>>2]|0)+1;while(1){b=Pw(c[o>>2]|0,c[n>>2]|0)|0;if((b|0)==(c[n>>2]|0))f=1;else f=(c[n>>2]|0)==((((c[282]|0)>>>0)/((c[(c[o>>2]|0)+32>>2]|0)>>>0)|0)+1|0);g=c[n>>2]|0;if(!f)break;c[n>>2]=g+1}if(((g>>>0<=(Aw(c[o>>2]|0)|0)>>>0?(c[j>>2]=Qw(c[o>>2]|0,c[n>>2]|0,s,r)|0,(c[j>>2]|0)==0):0)?(d[s>>0]|0)==4:0)?(c[r>>2]|0)==(c[p>>2]|0):0){c[q>>2]=c[n>>2];c[j>>2]=101}}if((c[j>>2]|0)==0?(c[j>>2]=Bw(c[o>>2]|0,c[p>>2]|0,l,(c[k>>2]|0)==0?2:0)|0,(c[j>>2]|0)==0):0)c[q>>2]=Hh(c[(c[l>>2]|0)+56>>2]|0)|0;c[c[m>>2]>>2]=c[q>>2];l=c[l>>2]|0;if(c[k>>2]|0){c[c[k>>2]>>2]=l;e=c[j>>2]|0;e=(e|0)==101;b=c[j>>2]|0;b=e?0:b;i=h;return b|0}else{Rk(l);e=c[j>>2]|0;e=(e|0)==101;b=c[j>>2]|0;b=e?0:b;i=h;return b|0}return 0}function Pw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0;d=i;i=i+32|0;e=d+20|0;g=d+16|0;j=d+12|0;h=d+8|0;k=d+4|0;f=d;c[g>>2]=a;c[j>>2]=b;if((c[j>>2]|0)>>>0<2){c[e>>2]=0;a=c[e>>2]|0;i=d;return a|0}c[h>>2]=(((c[(c[g>>2]|0)+36>>2]|0)>>>0)/5|0)+1;c[k>>2]=(((c[j>>2]|0)-2|0)>>>0)/((c[h>>2]|0)>>>0)|0;c[f>>2]=($(c[k>>2]|0,c[h>>2]|0)|0)+2;if((c[f>>2]|0)==((((c[282]|0)>>>0)/((c[(c[g>>2]|0)+32>>2]|0)>>>0)|0)+1|0))c[f>>2]=(c[f>>2]|0)+1;c[e>>2]=c[f>>2];a=c[e>>2]|0;i=d;return a|0}function Qw(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;o=i;i=i+48|0;j=o+36|0;s=o+32|0;q=o+28|0;h=o+24|0;p=o+20|0;l=o+16|0;r=o+12|0;m=o+8|0;n=o+4|0;k=o;c[s>>2]=b;c[q>>2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=a[g>>0]|0;i=f;return b|0}c[l>>2]=(c[l>>2]|0)+ -2;a[n>>0]=Jw(c[l>>2]|0,m)|0;b=m;if(0!=(c[b+4>>2]|0)?1:(c[m>>2]|0)!=(c[b>>2]|0))c[c[h>>2]>>2]=-1;else c[c[h>>2]>>2]=c[m>>2];a[g>>0]=a[n>>0]|0;b=a[g>>0]|0;i=f;return b|0}function Sw(b,f,g){b=b|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;j=i;i=i+64|0;h=j+52|0;k=j+48|0;l=j+44|0;m=j+40|0;q=j+36|0;t=j+32|0;n=j+28|0;r=j+24|0;s=j+16|0;o=j+8|0;p=j;c[k>>2]=b;c[l>>2]=f;c[m>>2]=g;c[q>>2]=(c[l>>2]|0)+(d[c[l>>2]>>0]&63);c[t>>2]=d[(c[l>>2]|0)+1>>0];g=c[(c[m>>2]|0)+8>>2]|0;f=c[g+4>>2]|0;b=o;c[b>>2]=c[g>>2];c[b+4>>2]=f;do switch(c[t>>2]|0){case 5:{b=a[c[q>>2]>>0]<<8|d[(c[q>>2]|0)+1>>0];t=p;c[t>>2]=bF(d[(c[q>>2]|0)+2>>0]<<24|d[(c[q>>2]|0)+3>>0]<<16|d[(c[q>>2]|0)+4>>0]<<8|d[(c[q>>2]|0)+5>>0]|0,0,lF(0,1,b|0,((b|0)<0)<<31>>31|0)|0,D|0)|0;c[t+4>>2]=D;break};case 3:{b=a[c[q>>2]>>0]<<16|d[(c[q>>2]|0)+1>>0]<<8|d[(c[q>>2]|0)+2>>0];t=p;c[t>>2]=b;c[t+4>>2]=((b|0)<0)<<31>>31;break};case 2:{b=a[c[q>>2]>>0]<<8|d[(c[q>>2]|0)+1>>0];t=p;c[t>>2]=b;c[t+4>>2]=((b|0)<0)<<31>>31;break};case 7:case 0:{c[h>>2]=Uw(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0)|0;t=c[h>>2]|0;i=j;return t|0};case 4:{c[r>>2]=d[c[q>>2]>>0]<<24|d[(c[q>>2]|0)+1>>0]<<16|d[(c[q>>2]|0)+2>>0]<<8|d[(c[q>>2]|0)+3>>0];b=c[r>>2]|0;t=p;c[t>>2]=b;c[t+4>>2]=((b|0)<0)<<31>>31;break};case 6:{b=s;c[b>>2]=d[c[q>>2]>>0]<<24|d[(c[q>>2]|0)+1>>0]<<16|d[(c[q>>2]|0)+2>>0]<<8|d[(c[q>>2]|0)+3>>0];c[b+4>>2]=0;b=c[s>>2]|0;f=s;c[f>>2]=d[(c[q>>2]|0)+4>>0]<<24|d[(c[q>>2]|0)+5>>0]<<16|d[(c[q>>2]|0)+6>>0]<<8|d[(c[q>>2]|0)+7>>0];c[f+4>>2]=b;f=s;b=c[f+4>>2]|0;t=p;c[t>>2]=c[f>>2];c[t+4>>2]=b;break};case 9:{t=p;c[t>>2]=1;c[t+4>>2]=0;break};case 8:{t=p;c[t>>2]=0;c[t+4>>2]=0;break};case 1:{b=a[c[q>>2]>>0]|0;t=p;c[t>>2]=b;c[t+4>>2]=((b|0)<0)<<31>>31;break};default:{c[h>>2]=Uw(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0)|0;t=c[h>>2]|0;i=j;return t|0}}while(0);b=o;s=c[b+4>>2]|0;t=p;f=c[t+4>>2]|0;do if(!((s|0)>(f|0)|((s|0)==(f|0)?(c[b>>2]|0)>>>0>(c[t>>2]|0)>>>0:0))){b=o;s=c[b+4>>2]|0;t=p;f=c[t+4>>2]|0;o=c[m>>2]|0;if((s|0)<(f|0)|((s|0)==(f|0)?(c[b>>2]|0)>>>0<(c[t>>2]|0)>>>0:0)){c[n>>2]=c[o+16>>2];break}if((e[o+4>>1]|0)>1){c[n>>2]=Vw(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0,1)|0;break}else{c[n>>2]=a[(c[m>>2]|0)+6>>0];break}}else c[n>>2]=c[(c[m>>2]|0)+12>>2];while(0);c[h>>2]=c[n>>2];t=c[h>>2]|0;i=j;return t|0}function Tw(b,f,g){b=b|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;h=i;i=i+48|0;j=h+36|0;m=h+32|0;l=h+28|0;q=h+24|0;n=h+20|0;s=h+16|0;k=h+12|0;p=h+8|0;o=h+4|0;r=h;c[m>>2]=b;c[l>>2]=f;c[q>>2]=g;c[n>>2]=c[l>>2];g=(c[n>>2]|0)+1|0;if((d[(c[n>>2]|0)+1>>0]|0)<128)c[s>>2]=d[g>>0];else Rw(g,s)|0;do if((c[s>>2]|0)>=12){if(!(c[s>>2]&1)){c[k>>2]=c[(c[q>>2]|0)+16>>2];break}c[r>>2]=d[c[n>>2]>>0];c[o>>2]=((c[s>>2]|0)-12|0)/2|0;if(((c[r>>2]|0)+(c[o>>2]|0)|0)>(c[m>>2]|0)){b=(kj(67026)|0)&255;a[(c[q>>2]|0)+7>>0]=b;c[j>>2]=0;b=c[j>>2]|0;i=h;return b|0}if((c[(c[(c[q>>2]|0)+8>>2]|0)+12>>2]|0)<(c[o>>2]|0))s=c[(c[(c[q>>2]|0)+8>>2]|0)+12>>2]|0;else s=c[o>>2]|0;c[p>>2]=s;c[k>>2]=TE((c[n>>2]|0)+(c[r>>2]|0)|0,c[(c[(c[q>>2]|0)+8>>2]|0)+16>>2]|0,c[p>>2]|0)|0;if(c[k>>2]|0){l=c[q>>2]|0;if((c[k>>2]|0)>0){c[k>>2]=c[l+16>>2];break}else{c[k>>2]=c[l+12>>2];break}}c[k>>2]=(c[o>>2]|0)-(c[(c[(c[q>>2]|0)+8>>2]|0)+12>>2]|0);if(!(c[k>>2]|0))if((e[(c[q>>2]|0)+4>>1]|0)>1){c[k>>2]=Vw(c[m>>2]|0,c[l>>2]|0,c[q>>2]|0,1)|0;break}else{c[k>>2]=a[(c[q>>2]|0)+6>>0];break}else{l=c[q>>2]|0;if((c[k>>2]|0)>0){c[k>>2]=c[l+16>>2];break}else{c[k>>2]=c[l+12>>2];break}}}else c[k>>2]=c[(c[q>>2]|0)+12>>2];while(0);c[j>>2]=c[k>>2];b=c[j>>2]|0;i=h;return b|0}function Uw(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;h=e+8|0;g=e+4|0;f=e;c[h>>2]=a;c[g>>2]=b;c[f>>2]=d;a=Vw(c[h>>2]|0,c[g>>2]|0,c[f>>2]|0,0)|0;i=e;return a|0}function Vw(f,g,j,k){f=f|0;g=g|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0;p=i;i=i+160|0;o=p+148|0;A=p+144|0;K=p+140|0;l=p+136|0;J=p+132|0;q=p+128|0;E=p+124|0;B=p+120|0;v=p+116|0;m=p+112|0;C=p+108|0;n=p+104|0;H=p+100|0;s=p+40|0;I=p+96|0;r=p+92|0;G=p+32|0;t=p+24|0;u=p+16|0;x=p+8|0;w=p;F=p+88|0;z=p+84|0;y=p+80|0;c[A>>2]=f;c[K>>2]=g;c[l>>2]=j;c[J>>2]=k;c[m>>2]=0;c[C>>2]=c[(c[l>>2]|0)+8>>2];c[n>>2]=c[c[l>>2]>>2];c[H>>2]=c[K>>2];k=c[H>>2]|0;do if(c[J>>2]|0){j=(c[H>>2]|0)+1|0;if((d[k+1>>0]|0)<128){c[I>>2]=d[j>>0];k=1}else k=(Rw(j,I)|0)&255;c[v>>2]=1+(k&255);c[B>>2]=d[c[H>>2]>>0];K=c[B>>2]|0;c[q>>2]=K+(Ww(c[I>>2]|0)|0);c[E>>2]=1;c[C>>2]=(c[C>>2]|0)+40}else{I=c[H>>2]|0;if((d[k>>0]|0)<128){c[B>>2]=d[I>>0];I=1}else I=(Rw(I,B)|0)&255;c[v>>2]=I&255;c[q>>2]=c[B>>2];if((c[q>>2]|0)>>>0<=(c[A>>2]|0)>>>0){c[E>>2]=0;break}K=(kj(66745)|0)&255;a[(c[l>>2]|0)+7>>0]=K;c[o>>2]=0;K=c[o>>2]|0;i=p;return K|0}while(0);a:while(1){do if(e[(c[C>>2]|0)+8>>1]&4){c[r>>2]=d[(c[H>>2]|0)+(c[v>>2]|0)>>0];if((c[r>>2]|0)>>>0>=12){c[m>>2]=1;break}if(!(c[r>>2]|0)){c[m>>2]=-1;break}if((c[r>>2]|0)==7){K=c[C>>2]|0;h[G>>3]=+((c[K>>2]|0)>>>0)+4294967296.0*+(c[K+4>>2]|0);Xw((c[H>>2]|0)+(c[q>>2]|0)|0,c[r>>2]|0,s)|0;if(+h[s>>3]<+h[G>>3]){c[m>>2]=-1;break}if(!(+h[s>>3]>+h[G>>3]))break;c[m>>2]=1;break}else{g=Yw(c[r>>2]|0,(c[H>>2]|0)+(c[q>>2]|0)|0)|0;K=t;c[K>>2]=g;c[K+4>>2]=D;K=c[C>>2]|0;g=c[K+4>>2]|0;J=u;c[J>>2]=c[K>>2];c[J+4>>2]=g;J=t;g=c[J+4>>2]|0;K=u;f=c[K+4>>2]|0;if((g|0)<(f|0)|((g|0)==(f|0)?(c[J>>2]|0)>>>0<(c[K>>2]|0)>>>0:0)){c[m>>2]=-1;break}J=t;g=c[J+4>>2]|0;K=u;f=c[K+4>>2]|0;if(!((g|0)>(f|0)|((g|0)==(f|0)?(c[J>>2]|0)>>>0>(c[K>>2]|0)>>>0:0)))break;c[m>>2]=1;break}}else{if(e[(c[C>>2]|0)+8>>1]&8){c[r>>2]=d[(c[H>>2]|0)+(c[v>>2]|0)>>0];if((c[r>>2]|0)>>>0>=12){c[m>>2]=1;break}if(!(c[r>>2]|0)){c[m>>2]=-1;break}h[x>>3]=+h[c[C>>2]>>3];Xw((c[H>>2]|0)+(c[q>>2]|0)|0,c[r>>2]|0,s)|0;if((c[r>>2]|0)==7)h[w>>3]=+h[s>>3];else{K=s;h[w>>3]=+((c[K>>2]|0)>>>0)+4294967296.0*+(c[K+4>>2]|0)}if(+h[w>>3]<+h[x>>3]){c[m>>2]=-1;break}if(!(+h[w>>3]>+h[x>>3]))break;c[m>>2]=1;break}if(!(e[(c[C>>2]|0)+8>>1]&2)){k=d[(c[H>>2]|0)+(c[v>>2]|0)>>0]|0;if(!(e[(c[C>>2]|0)+8>>1]&16)){c[r>>2]=k;c[m>>2]=(c[r>>2]|0)!=0&1;break}I=(c[H>>2]|0)+(c[v>>2]|0)|0;if((k|0)<128)c[r>>2]=d[I>>0];else Rw(I,r)|0;if((c[r>>2]|0)>>>0>=12?(c[r>>2]&1|0)==0:0){c[z>>2]=(((c[r>>2]|0)-12|0)>>>0)/2|0;if(((c[q>>2]|0)+(c[z>>2]|0)|0)>>>0>(c[A>>2]|0)>>>0){q=63;break a}if((c[z>>2]|0)<(c[(c[C>>2]|0)+12>>2]|0))I=c[z>>2]|0;else I=c[(c[C>>2]|0)+12>>2]|0;c[y>>2]=I;c[m>>2]=TE((c[H>>2]|0)+(c[q>>2]|0)|0,c[(c[C>>2]|0)+16>>2]|0,c[y>>2]|0)|0;if(c[m>>2]|0)break;c[m>>2]=(c[z>>2]|0)-(c[(c[C>>2]|0)+12>>2]|0);break}c[m>>2]=-1;break}I=(c[H>>2]|0)+(c[v>>2]|0)|0;if((d[(c[H>>2]|0)+(c[v>>2]|0)>>0]|0)<128)c[r>>2]=d[I>>0];else Rw(I,r)|0;if((c[r>>2]|0)>>>0<12){c[m>>2]=-1;break}if(!(c[r>>2]&1)){c[m>>2]=1;break}c[s+12>>2]=(((c[r>>2]|0)-12|0)>>>0)/2|0;if(((c[q>>2]|0)+(c[s+12>>2]|0)|0)>>>0>(c[A>>2]|0)>>>0){q=47;break a}if(c[(c[n>>2]|0)+20+(c[E>>2]<<2)>>2]|0){a[s+10>>0]=a[(c[n>>2]|0)+4>>0]|0;c[s+32>>2]=c[(c[n>>2]|0)+12>>2];b[s+8>>1]=2;c[s+16>>2]=(c[H>>2]|0)+(c[q>>2]|0);c[m>>2]=cn(s,c[C>>2]|0,c[(c[n>>2]|0)+20+(c[E>>2]<<2)>>2]|0,(c[l>>2]|0)+7|0)|0;break}if((c[s+12>>2]|0)<(c[(c[C>>2]|0)+12>>2]|0))I=c[s+12>>2]|0;else I=c[(c[C>>2]|0)+12>>2]|0;c[F>>2]=I;c[m>>2]=TE((c[H>>2]|0)+(c[q>>2]|0)|0,c[(c[C>>2]|0)+16>>2]|0,c[F>>2]|0)|0;if(!(c[m>>2]|0))c[m>>2]=(c[s+12>>2]|0)-(c[(c[C>>2]|0)+12>>2]|0)}while(0);I=c[E>>2]|0;if(c[m>>2]|0){q=71;break}c[E>>2]=I+1;c[C>>2]=(c[C>>2]|0)+40;K=Ww(c[r>>2]|0)|0;c[q>>2]=(c[q>>2]|0)+K;K=Zw(c[r>>2]|0,0)|0;c[v>>2]=(c[v>>2]|0)+K;if((c[v>>2]|0)>>>0>=(c[B>>2]|0)>>>0){q=77;break}if((c[E>>2]|0)>=(e[(c[l>>2]|0)+4>>1]|0)){q=77;break}if((c[q>>2]|0)>>>0>(c[A>>2]|0)>>>0){q=77;break}}if((q|0)==47){K=(kj(66824)|0)&255;a[(c[l>>2]|0)+7>>0]=K;c[o>>2]=0;K=c[o>>2]|0;i=p;return K|0}else if((q|0)==63){K=(kj(66853)|0)&255;a[(c[l>>2]|0)+7>>0]=K;c[o>>2]=0;K=c[o>>2]|0;i=p;return K|0}else if((q|0)==71){if(a[(c[(c[n>>2]|0)+16>>2]|0)+I>>0]|0)c[m>>2]=0-(c[m>>2]|0);c[o>>2]=c[m>>2];K=c[o>>2]|0;i=p;return K|0}else if((q|0)==77){c[o>>2]=a[(c[l>>2]|0)+6>>0];K=c[o>>2]|0;i=p;return K|0}return 0}function Ww(a){a=a|0;var b=0,e=0,f=0;b=i;i=i+16|0;e=b+4|0;f=b;c[f>>2]=a;a=c[f>>2]|0;if((c[f>>2]|0)>>>0>=12){c[e>>2]=((a-12|0)>>>0)/2|0;f=c[e>>2]|0;i=b;return f|0}else{c[e>>2]=d[24360+a>>0];f=c[e>>2]|0;i=b;return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,((f|0)<0)<<31>>31|0)|0,D|0)|0;e=c[k>>2]|0;c[e>>2]=f;c[e+4>>2]=D;b[(c[k>>2]|0)+8>>1]=4;c[j>>2]=6;e=c[j>>2]|0;i=h;return e|0};case 7:case 6:{c[j>>2]=_w(c[l>>2]|0,c[m>>2]|0,c[k>>2]|0)|0;e=c[j>>2]|0;i=h;return e|0};case 0:case 11:case 10:{b[(c[k>>2]|0)+8>>1]=1;c[j>>2]=0;e=c[j>>2]|0;i=h;return e|0};default:{c[(c[k>>2]|0)+16>>2]=c[l>>2];c[(c[k>>2]|0)+12>>2]=(((c[m>>2]|0)-12|0)>>>0)/2|0;b[(c[k>>2]|0)+8>>1]=b[24352+((c[m>>2]&1)<<1)>>1]|0;c[j>>2]=c[(c[k>>2]|0)+12>>2];e=c[j>>2]|0;i=h;return e|0}}return 0}function Yw(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;g=i;i=i+32|0;f=g+8|0;l=g+24|0;h=g+20|0;j=g+16|0;k=g;c[l>>2]=b;c[h>>2]=e;switch(c[l>>2]|0){case 5:{k=d[(c[h>>2]|0)+2>>0]<<24|d[(c[h>>2]|0)+3>>0]<<16|d[(c[h>>2]|0)+4>>0]<<8|d[(c[h>>2]|0)+5>>0];l=a[c[h>>2]>>0]<<8|d[(c[h>>2]|0)+1>>0];b=f;c[b>>2]=bF(k|0,0,lF(0,1,l|0,((l|0)<0)<<31>>31|0)|0,D|0)|0;c[b+4>>2]=D;break};case 4:{c[j>>2]=d[c[h>>2]>>0]<<24|d[(c[h>>2]|0)+1>>0]<<16|d[(c[h>>2]|0)+2>>0]<<8|d[(c[h>>2]|0)+3>>0];l=c[j>>2]|0;b=f;c[b>>2]=l;c[b+4>>2]=((l|0)<0)<<31>>31;break};case 6:{b=k;c[b>>2]=d[c[h>>2]>>0]<<24|d[(c[h>>2]|0)+1>>0]<<16|d[(c[h>>2]|0)+2>>0]<<8|d[(c[h>>2]|0)+3>>0];c[b+4>>2]=0;b=c[k>>2]|0;l=k;c[l>>2]=d[(c[h>>2]|0)+4>>0]<<24|d[(c[h>>2]|0)+5>>0]<<16|d[(c[h>>2]|0)+6>>0]<<8|d[(c[h>>2]|0)+7>>0];c[l+4>>2]=b;l=c[k+4>>2]|0;b=f;c[b>>2]=c[k>>2];c[b+4>>2]=l;break};case 2:{l=a[c[h>>2]>>0]<<8|d[(c[h>>2]|0)+1>>0];b=f;c[b>>2]=l;c[b+4>>2]=((l|0)<0)<<31>>31;break};case 3:{l=a[c[h>>2]>>0]<<16|d[(c[h>>2]|0)+1>>0]<<8|d[(c[h>>2]|0)+2>>0];b=f;c[b>>2]=l;c[b+4>>2]=((l|0)<0)<<31>>31;break};case 1:case 0:{l=a[c[h>>2]>>0]|0;b=f;c[b>>2]=l;c[b+4>>2]=((l|0)<0)<<31>>31;break};default:{b=f;c[b>>2]=(c[l>>2]|0)-8;c[b+4>>2]=0}}b=f;D=c[b+4>>2]|0;i=g;return c[b>>2]|0}function Zw(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;f=d;e=d+8|0;g=f;c[g>>2]=a;c[g+4>>2]=b;c[e>>2]=0;do{c[e>>2]=(c[e>>2]|0)+1;a=f;a=cF(c[a>>2]|0,c[a+4>>2]|0,7)|0;g=f;c[g>>2]=a;c[g+4>>2]=D;g=f}while(((c[g>>2]|0)!=0|(c[g+4>>2]|0)!=0)&(c[e>>2]|0)<9);i=d;return c[e>>2]|0}function _w(a,e,f){a=a|0;e=e|0;f=f|0;var g=0,j=0,k=0,l=0,m=0,n=0;g=i;i=i+32|0;n=g+20|0;l=g+16|0;j=g+12|0;k=g;m=g+8|0;c[n>>2]=a;c[l>>2]=e;c[j>>2]=f;e=k;c[e>>2]=(d[c[n>>2]>>0]|0)<<24|(d[(c[n>>2]|0)+1>>0]|0)<<16|(d[(c[n>>2]|0)+2>>0]|0)<<8|(d[(c[n>>2]|0)+3>>0]|0);c[e+4>>2]=0;c[m>>2]=(d[(c[n>>2]|0)+4>>0]|0)<<24|(d[(c[n>>2]|0)+5>>0]|0)<<16|(d[(c[n>>2]|0)+6>>0]|0)<<8|(d[(c[n>>2]|0)+7>>0]|0);e=bF(0,c[k>>2]|0,c[m>>2]|0,0)|0;a=k;c[a>>2]=e;c[a+4>>2]=D;if((c[l>>2]|0)==6){l=k;m=c[l+4>>2]|0;n=c[j>>2]|0;c[n>>2]=c[l>>2];c[n+4>>2]=m;b[(c[j>>2]|0)+8>>1]=4;i=g;return 8}else{n=c[j>>2]|0;c[n+0>>2]=c[k+0>>2];c[n+4>>2]=c[k+4>>2];n=($w(+h[c[j>>2]>>3])|0)!=0;b[(c[j>>2]|0)+8>>1]=n?1:8;i=g;return 8}return 0}function $w(a){a=+a;var b=0,d=0,e=0,f=0,g=0;d=i;i=i+32|0;g=d+16|0;b=d+24|0;f=d+8|0;e=d;h[g>>3]=a;h[f>>3]=+h[g>>3];h[e>>3]=+h[f>>3];c[b>>2]=+h[f>>3]!=+h[e>>3]&1;i=d;return c[b>>2]|0}function ax(f,g){f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;l=i;i=i+32|0;k=l+20|0;n=l+16|0;m=l+12|0;o=l+8|0;p=l+4|0;h=l;c[n>>2]=f;c[m>>2]=g;if((d[(c[n>>2]|0)+73>>0]|0)!=1){if((d[(c[n>>2]|0)+73>>0]|0)>=3)g=vw(c[n>>2]|0)|0;else g=0;c[o>>2]=g;if(c[o>>2]|0){c[k>>2]=c[o>>2];f=c[k>>2]|0;i=l;return f|0}if(!(d[(c[n>>2]|0)+73>>0]|0)){c[c[m>>2]>>2]=1;c[k>>2]=0;f=c[k>>2]|0;i=l;return f|0}if((c[(c[n>>2]|0)+68>>2]|0)!=0?(a[(c[n>>2]|0)+73>>0]=1,f=(c[(c[n>>2]|0)+68>>2]|0)>0,c[(c[n>>2]|0)+68>>2]=0,f):0){c[k>>2]=0;f=c[k>>2]|0;i=l;return f|0}}c[h>>2]=c[(c[n>>2]|0)+120+(b[(c[n>>2]|0)+76>>1]<<2)>>2];f=(c[n>>2]|0)+78+(b[(c[n>>2]|0)+76>>1]<<1)|0;g=(b[f>>1]|0)+1<<16>>16;b[f>>1]=g;c[p>>2]=g&65535;g=(a[(c[h>>2]|0)+5>>0]|0)!=0;if((c[p>>2]|0)<(e[(c[h>>2]|0)+18>>1]|0))if(g){c[k>>2]=0;f=c[k>>2]|0;i=l;return f|0}else{c[k>>2]=bx(c[n>>2]|0)|0;f=c[k>>2]|0;i=l;return f|0}if(!g){f=c[n>>2]|0;c[o>>2]=ww(f,Hh((c[(c[h>>2]|0)+56>>2]|0)+((d[(c[h>>2]|0)+6>>0]|0)+8)|0)|0)|0;if(c[o>>2]|0){c[k>>2]=c[o>>2];f=c[k>>2]|0;i=l;return f|0}else{c[k>>2]=bx(c[n>>2]|0)|0;f=c[k>>2]|0;i=l;return f|0}}do{if(!(b[(c[n>>2]|0)+76>>1]|0)){j=17;break}yw(c[n>>2]|0);c[h>>2]=c[(c[n>>2]|0)+120+(b[(c[n>>2]|0)+76>>1]<<2)>>2]}while((e[(c[n>>2]|0)+78+(b[(c[n>>2]|0)+76>>1]<<1)>>1]|0)>=(e[(c[h>>2]|0)+18>>1]|0));if((j|0)==17){c[c[m>>2]>>2]=1;a[(c[n>>2]|0)+73>>0]=0;c[k>>2]=0;f=c[k>>2]|0;i=l;return f|0}if(a[(c[h>>2]|0)+2>>0]|0){c[k>>2]=sw(c[n>>2]|0,c[m>>2]|0)|0;f=c[k>>2]|0;i=l;return f|0}else{c[k>>2]=0;f=c[k>>2]|0;i=l;return f|0}return 0}function bx(f){f=f|0;var g=0,h=0,j=0,k=0,l=0;g=i;i=i+16|0;j=g+12|0;l=g+8|0;h=g+4|0;k=g;c[j>>2]=f;c[h>>2]=0;while(1){if(c[h>>2]|0){f=5;break}f=c[(c[j>>2]|0)+120+(b[(c[j>>2]|0)+76>>1]<<2)>>2]|0;c[k>>2]=f;if(!((a[f+5>>0]|0)!=0^1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2]|0,c[(c[e>>2]|0)+12>>2]|0);Xb(c[g>>2]|0,c[e>>2]|0);i=d;return}function ex(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;e=d+12|0;f=d+8|0;g=d+4|0;h=d;c[f>>2]=a;c[g>>2]=b;if((c[f>>2]|0)==0|(c[g>>2]|0)==0){c[e>>2]=1;a=c[e>>2]|0;i=d;return a|0}c[h>>2]=0;while(1){if((c[h>>2]|0)>=(c[c[g>>2]>>2]|0)){b=8;break}if((ir(c[f>>2]|0,c[(c[(c[g>>2]|0)+4>>2]|0)+((c[h>>2]|0)*20|0)+4>>2]|0)|0)>=0){b=6;break}c[h>>2]=(c[h>>2]|0)+1}if((b|0)==6){c[e>>2]=1;a=c[e>>2]|0;i=d;return a|0}else if((b|0)==8){c[e>>2]=0;a=c[e>>2]|0;i=d;return a|0}return 0}function fx(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=i;i=i+16|0;d=e+8|0;g=e+4|0;f=e;c[g>>2]=a;c[f>>2]=b;b=(c[f>>2]|0)==0;do if(c[g>>2]|0)if(b){c[d>>2]=0;break}else{c[d>>2]=(xc(c[g>>2]|0,c[f>>2]|0)|0)==0&1;break}else c[d>>2]=b&1;while(0);i=e;return c[d>>2]|0}function gx(a,f){a=a|0;f=f|0;var g=0,h=0,j=0,k=0,l=0;g=i;i=i+16|0;h=g+12|0;k=g+8|0;j=g+4|0;l=g;c[k>>2]=a;c[j>>2]=f;if((e[(c[k>>2]|0)+50>>1]|0)!=(e[(c[j>>2]|0)+50>>1]|0)){c[h>>2]=0;a=c[h>>2]|0;i=g;return a|0}if((d[(c[k>>2]|0)+54>>0]|0)!=(d[(c[j>>2]|0)+54>>0]|0)){c[h>>2]=0;a=c[h>>2]|0;i=g;return a|0}c[l>>2]=0;while(1){if((c[l>>2]|0)>=(e[(c[j>>2]|0)+50>>1]|0)){f=14;break}if((b[(c[(c[j>>2]|0)+4>>2]|0)+(c[l>>2]<<1)>>1]|0)!=(b[(c[(c[k>>2]|0)+4>>2]|0)+(c[l>>2]<<1)>>1]|0)){f=8;break}if((d[(c[(c[j>>2]|0)+28>>2]|0)+(c[l>>2]|0)>>0]|0)!=(d[(c[(c[k>>2]|0)+28>>2]|0)+(c[l>>2]|0)>>0]|0)){f=10;break}if(!(fx(c[(c[(c[j>>2]|0)+32>>2]|0)+(c[l>>2]<<2)>>2]|0,c[(c[(c[k>>2]|0)+32>>2]|0)+(c[l>>2]<<2)>>2]|0)|0)){f=12;break}c[l>>2]=(c[l>>2]|0)+1}if((f|0)==8){c[h>>2]=0;a=c[h>>2]|0;i=g;return a|0}else if((f|0)==10){c[h>>2]=0;a=c[h>>2]|0;i=g;return a|0}else if((f|0)==12){c[h>>2]=0;a=c[h>>2]|0;i=g;return a|0}else if((f|0)==14)if(Dq(c[(c[j>>2]|0)+36>>2]|0,c[(c[k>>2]|0)+36>>2]|0,-1)|0){c[h>>2]=0;a=c[h>>2]|0;i=g;return a|0}else{c[h>>2]=1;a=c[h>>2]|0;i=g;return a|0}return 0}function hx(a,d,e,f,g,h,j,k){a=a|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;l=i;i=i+96|0;z=l+88|0;y=l+84|0;v=l+80|0;C=l+76|0;A=l+72|0;D=l+68|0;m=l+64|0;q=l+60|0;n=l+56|0;x=l+52|0;u=l+48|0;E=l+44|0;r=l+40|0;w=l+36|0;s=l+32|0;o=l+28|0;t=l+24|0;p=l+20|0;B=l;c[z>>2]=a;c[y>>2]=d;c[v>>2]=e;c[C>>2]=f;c[A>>2]=g;c[D>>2]=h;c[m>>2]=j;c[q>>2]=k;c[n>>2]=c[(c[z>>2]|0)+8>>2];c[x>>2]=0;c[u>>2]=0;c[t>>2]=c[c[z>>2]>>2];c[p>>2]=Rp(c[t>>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f>>2]|0;i=g;return a|0}while(0);c[h>>2]=(c[c[l>>2]>>2]|0)-1;while(1){if((c[h>>2]|0)<(c[j>>2]|0))break;e=(c[l>>2]|0)+8+(((c[h>>2]|0)+(c[k>>2]|0)|0)*72|0)+0|0;n=(c[l>>2]|0)+8+((c[h>>2]|0)*72|0)+0|0;m=e+72|0;do{c[e>>2]=c[n>>2];e=e+4|0;n=n+4|0}while((e|0)<(m|0));c[h>>2]=(c[h>>2]|0)+ -1}a=c[l>>2]|0;c[a>>2]=(c[a>>2]|0)+(c[k>>2]|0);_E((c[l>>2]|0)+8+((c[j>>2]|0)*72|0)|0,0,(c[k>>2]|0)*72|0)|0;c[h>>2]=c[j>>2];while(1){if((c[h>>2]|0)>=((c[j>>2]|0)+(c[k>>2]|0)|0))break;c[(c[l>>2]|0)+8+((c[h>>2]|0)*72|0)+40>>2]=-1;c[h>>2]=(c[h>>2]|0)+1}c[f>>2]=c[l>>2];a=c[f>>2]|0;i=g;return a|0}function nx(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+32|0;h=f;g=f+20|0;j=f+16|0;m=f+12|0;l=f+8|0;k=f+4|0;c[j>>2]=a;c[m>>2]=b;c[l>>2]=e;c[k>>2]=d[c[m>>2]>>0];if((c[l>>2]|0)>1?(c[k>>2]|0)==10|(c[k>>2]|0)==11:0){Se(c[j>>2]|0,25392,h);c[g>>2]=1;m=c[g>>2]|0;i=f;return m|0}c[g>>2]=0;m=c[g>>2]|0;i=f;return m|0}function ox(a){a=a|0;var b=0,d=0,e=0;d=i;i=i+16|0;e=d+4|0;b=d;c[e>>2]=a;c[b>>2]=0;sr(c[e>>2]|0,b);i=d;return c[b>>2]|0}function px(f,g,h,j,k){f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=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e[(c[r>>2]|0)+6>>1]&1){c[x>>2]=0;Q=c[x>>2]|0;i=E;return Q|0}if((c[(c[r>>2]|0)+60>>2]|0)!=0?(c[s>>2]|0)!=0?1:(c[c[w>>2]>>2]|0)>1:0){c[x>>2]=0;Q=c[x>>2]|0;i=E;return Q|0}if((c[C>>2]|0)!=0?(e[(c[H>>2]|0)+6>>1]&1|0)!=0:0){c[x>>2]=0;Q=c[x>>2]|0;i=E;return Q|0}if((c[(c[H>>2]|0)+48>>2]|0)!=0?(c[(c[r>>2]|0)+48>>2]|0)!=0:0){c[x>>2]=0;Q=c[x>>2]|0;i=E;return Q|0}if((c[s>>2]|0)!=0?(c[(c[r>>2]|0)+48>>2]|0)!=0:0){c[x>>2]=0;Q=c[x>>2]|0;i=E;return Q|0}if((c[(c[r>>2]|0)+60>>2]|0)!=0?(c[(c[H>>2]|0)+36>>2]|0)!=0:0){c[x>>2]=0;Q=c[x>>2]|0;i=E;return Q|0}if((c[(c[r>>2]|0)+60>>2]|0)!=0?(e[(c[H>>2]|0)+6>>1]&1|0)!=0:0){c[x>>2]=0;Q=c[x>>2]|0;i=E;return Q|0}if(e[(c[r>>2]|0)+6>>1]&6144){c[x>>2]=0;Q=c[x>>2]|0;i=E;return Q|0}if((e[(c[H>>2]|0)+6>>1]&2048|0)!=0?(c[(c[r>>2]|0)+52>>2]|0)!=0:0){c[x>>2]=0;Q=c[x>>2]|0;i=E;return Q|0}if(d[(c[B>>2]|0)+36>>0]&32){c[x>>2]=0;Q=c[x>>2]|0;i=E;return Q|0}a:do if(c[(c[r>>2]|0)+52>>2]|0){if(c[(c[r>>2]|0)+48>>2]|0){c[x>>2]=0;Q=c[x>>2]|0;i=E;return Q|0}do if(!(c[s>>2]|0)){if(e[(c[H>>2]|0)+6>>1]&1)break;if((c[c[w>>2]>>2]|0)!=1)break;c[o>>2]=c[r>>2];while(1){if(!(c[o>>2]|0))break;if(e[(c[o>>2]|0)+6>>1]&5){N=58;break}if((c[(c[o>>2]|0)+52>>2]|0)!=0?(d[(c[o>>2]|0)+4>>0]|0)!=116:0){N=58;break}if((c[c[(c[o>>2]|0)+32>>2]>>2]|0)<1){N=58;break}if((c[c[c[r>>2]>>2]>>2]|0)!=(c[c[c[o>>2]>>2]>>2]|0)){N=58;break}c[o>>2]=c[(c[o>>2]|0)+52>>2]}if((N|0)==58){c[x>>2]=0;Q=c[x>>2]|0;i=E;return Q|0}if(!(c[(c[H>>2]|0)+48>>2]|0))break a;c[P>>2]=0;while(1){if((c[P>>2]|0)>=(c[c[(c[H>>2]|0)+48>>2]>>2]|0))break a;if(!(e[(c[(c[(c[H>>2]|0)+48>>2]|0)+4>>2]|0)+((c[P>>2]|0)*20|0)+16>>1]|0))break;c[P>>2]=(c[P>>2]|0)+1}c[x>>2]=0;Q=c[x>>2]|0;i=E;return Q|0}while(0);c[x>>2]=0;Q=c[x>>2]|0;i=E;return Q|0}while(0);c[(c[I>>2]|0)+492>>2]=c[(c[B>>2]|0)+8>>2];ap(c[I>>2]|0,21,0,0,0)|0;c[(c[I>>2]|0)+492>>2]=c[Q>>2];c[r>>2]=c[(c[r>>2]|0)+52>>2];while(1){if(!(c[r>>2]|0))break;c[O>>2]=c[(c[H>>2]|0)+48>>2];c[J>>2]=c[(c[H>>2]|0)+60>>2];c[K>>2]=c[(c[H>>2]|0)+64>>2];c[L>>2]=c[(c[H>>2]|0)+52>>2];c[(c[H>>2]|0)+48>>2]=0;c[(c[H>>2]|0)+32>>2]=0;c[(c[H>>2]|0)+52>>2]=0;c[(c[H>>2]|0)+60>>2]=0;c[(c[H>>2]|0)+64>>2]=0;c[M>>2]=Wp(c[n>>2]|0,c[H>>2]|0,0)|0;c[(c[H>>2]|0)+64>>2]=c[K>>2];c[(c[H>>2]|0)+60>>2]=c[J>>2];c[(c[H>>2]|0)+48>>2]=c[O>>2];c[(c[H>>2]|0)+32>>2]=c[w>>2];a[(c[H>>2]|0)+4>>0]=116;f=c[L>>2]|0;if(!(c[M>>2]|0))c[(c[H>>2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>>2]|0)+60>>2];c[(c[r>>2]|0)+60>>2]=0}c[p>>2]=c[(c[p>>2]|0)+52>>2];c[r>>2]=c[(c[r>>2]|0)+52>>2]}tn(c[n>>2]|0,c[o>>2]|0);c[x>>2]=1;Q=c[x>>2]|0;i=E;return Q|0}function qx(b){b=b|0;var d=0,e=0;d=i;i=i+16|0;e=d;c[e>>2]=b;a[(c[e>>2]|0)+19>>0]=0;c[(c[e>>2]|0)+56>>2]=0;i=d;return}function rx(f,g,h){f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0;q=i;i=i+224|0;G=q;p=q+212|0;s=q+208|0;o=q+204|0;m=q+200|0;j=q+196|0;C=q+192|0;z=q+188|0;n=q+168|0;k=q+164|0;l=q+160|0;x=q+156|0;y=q+152|0;A=q+148|0;B=q+144|0;r=q+140|0;M=q+216|0;L=q+136|0;J=q+132|0;K=q+128|0;O=q+124|0;N=q+104|0;F=q+100|0;E=q+96|0;H=q+92|0;I=q+88|0;R=q+84|0;U=q+80|0;Q=q+76|0;P=q+72|0;T=q+68|0;X=q+64|0;Y=q+60|0;Z=q+56|0;_=q+36|0;S=q+32|0;V=q+28|0;t=q+24|0;u=q+20|0;W=q+16|0;v=q+12|0;w=q+8|0;$=q+4|0;c[s>>2]=f;c[o>>2]=g;c[m>>2]=h;c[j>>2]=0;c[k>>2]=0;c[x>>2]=0;c[y>>2]=0;c[l>>2]=c[c[s>>2]>>2];c[C>>2]=c[(c[o>>2]|0)+52>>2];f=c[m>>2]|0;c[n+0>>2]=c[f+0>>2];c[n+4>>2]=c[f+4>>2];c[n+8>>2]=c[f+8>>2];c[n+12>>2]=c[f+12>>2];c[n+16>>2]=c[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a>>2]|0)+1;Os(c[l>>2]|0,c[(c[f>>2]|0)+64>>2]|0,c[m>>2]|0);Ir(c[g>>2]|0,38,c[m>>2]|0)|0;c[n>>2]=Ir(c[g>>2]|0,137,c[m>>2]|0)|0;fp(c[g>>2]|0,25,0,c[m>>2]|0)|0;zp(c[g>>2]|0,c[n>>2]|0);ip(c[g>>2]|0,89,c[e>>2]|0,c[m>>2]|0,(c[m>>2]|0)+1|0)|0;c[n>>2]=Ir(c[g>>2]|0,137,c[e>>2]|0)|0;fp(c[g>>2]|0,25,-1,(c[m>>2]|0)+1|0)|0;zp(c[g>>2]|0,c[n>>2]|0);i=k;return}function ux(a){a=a|0;var d=0,e=0;d=i;i=i+16|0;e=d;c[e>>2]=a;a=Zt(b[(c[e>>2]|0)+32>>1]|0)|0;i=d;return a|0}function vx(a){a=a|0;var b=0,e=0;e=i;i=i+16|0;b=e;c[b>>2]=a;i=e;return d[(c[b>>2]|0)+40>>0]|0|0}function wx(b){b=b|0;var d=0,e=0;e=i;i=i+16|0;d=e;c[d>>2]=b;i=e;return a[(c[d>>2]|0)+36>>0]|0}function xx(b,f,g,h,j,k,l,m,n){b=b|0;f=f|0;g=g|0;h=h|0;j=j|0;k=k|0;l=l|0;m=m|0;n=n|0;var o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0;r=i;i=i+128|0;q=r+124|0;s=r+120|0;P=r+116|0;U=r+112|0;t=r+108|0;R=r+104|0;x=r+100|0;J=r+96|0;o=r+92|0;p=r+88|0;H=r+84|0;T=r+80|0;u=r+76|0;z=r+72|0;v=r+68|0;y=r+64|0;w=r+60|0;S=r+56|0;K=r+52|0;L=r+48|0;O=r+44|0;M=r+40|0;B=r+36|0;Q=r+32|0;A=r+28|0;E=r+24|0;I=r+20|0;F=r+16|0;G=r+12|0;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0;fp(c[p>>2]|0,110,c[v>>2]|0,c[M>>2]|0)|0;lp(c[q>>2]|0,c[M>>2]|0);break};default:{}}while(0);if(c[t>>2]|0){i=r;return}if(!(c[(c[s>>2]|0)+8>>2]|0)){i=r;return}ip(c[p>>2]|0,139,c[(c[s>>2]|0)+8>>2]|0,c[o>>2]|0,-1)|0;i=r;return}function yx(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return c[(c[b>>2]|0)+48>>2]|0}function zx(a){a=a|0;var b=0,d=0;d=i;i=i+16|0;b=d;c[b>>2]=a;i=d;return c[(c[b>>2]|0)+52>>2]|0}function Ax(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=i;i=i+16|0;g=d+12|0;f=d+8|0;h=d+4|0;e=d;c[g>>2]=a;c[f>>2]=b;if(!(c[f>>2]|0)){i=d;return}c[h>>2]=c[(c[f>>2]|0)+4>>2];c[e>>2]=0;while(1){if((c[e>>2]|0)>=(c[c[f>>2]>>2]|0))break;Bx(c[g>>2]|0,c[c[h>>2]>>2]|0);c[e>>2]=(c[e>>2]|0)+1;c[h>>2]=(c[h>>2]|0)+20}i=d;return}function Bx(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+32|0;g=d+28|0;e=d+24|0;f=d;c[g>>2]=a;c[e>>2]=b;c[f+0>>2]=0;c[f+4>>2]=0;c[f+8>>2]=0;c[f+12>>2]=0;c[f+16>>2]=0;c[f+20>>2]=0;c[f>>2]=48;c[f+4>>2]=49;c[f+20>>2]=c[g>>2];sq(f,c[e>>2]|0)|0;i=d;return}function Cx(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+32|0;j=e;f=e+16|0;h=e+12|0;g=e+8|0;k=e+4|0;c[f>>2]=a;c[h>>2]=b;if((d[(c[f>>2]|0)+450>>0]|0|0)!=2){i=e;return}c[g>>2]=c[(c[f>>2]|0)+8>>2];a=c[c[f>>2]>>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2]|0,c[j>>2]|0);i=o;return}function Gx(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0;d=i;i=i+32|0;k=d+20|0;h=d+16|0;j=d+12|0;g=d+8|0;e=d+4|0;f=d;c[k>>2]=a;c[h>>2]=b;c[j>>2]=c[(c[k>>2]|0)+8>>2];c[g>>2]=0;c[e>>2]=c[(c[h>>2]|0)+40>>2];while(1){if((c[g>>2]|0)>=(c[(c[h>>2]|0)+44>>2]|0))break;c[f>>2]=c[(c[c[e>>2]>>2]|0)+20>>2];if(c[f>>2]|0)b=c[c[f>>2]>>2]|0;else b=0;hp(c[j>>2]|0,140,c[(c[e>>2]|0)+8>>2]|0,b,0,c[(c[e>>2]|0)+4>>2]|0,-5)|0;c[g>>2]=(c[g>>2]|0)+1;c[e>>2]=(c[e>>2]|0)+16}i=d;return}function Hx(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;h=i;i=i+48|0;m=h;j=h+32|0;d=h+28|0;l=h+24|0;g=h+20|0;e=h+16|0;n=h+12|0;f=h+8|0;k=h+4|0;c[j>>2]=a;c[d>>2]=b;c[l>>2]=c[(c[j>>2]|0)+8>>2];c[n>>2]=(c[(c[d>>2]|0)+44>>2]|0)+(c[(c[d>>2]|0)+32>>2]|0);if(!(c[n>>2]|0)){i=h;return}ip(c[l>>2]|0,28,0,c[(c[d>>2]|0)+16>>2]|0,c[(c[d>>2]|0)+20>>2]|0)|0;c[e>>2]=c[(c[d>>2]|0)+40>>2];c[g>>2]=0;while(1){if((c[g>>2]|0)>=(c[(c[d>>2]|0)+44>>2]|0))break;do if((c[(c[e>>2]|0)+12>>2]|0)>=0){c[f>>2]=c[c[e>>2]>>2];if((c[(c[f>>2]|0)+20>>2]|0)!=0?(c[c[(c[f>>2]|0)+20>>2]>>2]|0)==1:0){c[k>>2]=sx(c[j>>2]|0,c[(c[f>>2]|0)+20>>2]|0,0,0)|0;hp(c[l>>2]|0,57,c[(c[e>>2]|0)+12>>2]|0,0,0,c[k>>2]|0,-6)|0;break}Se(c[j>>2]|0,24968,m);c[(c[e>>2]|0)+12>>2]=-1}while(0);c[g>>2]=(c[g>>2]|0)+1;c[e>>2]=(c[e>>2]|0)+16}i=h;return}function Ix(a,b){a=a|0;b=b|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+32|0;g=f+16|0;l=f+12|0;k=f+8|0;h=f+4|0;j=f;c[l>>2]=a;c[k>>2]=b;if((((c[(c[l>>2]|0)+36>>2]|0)==0?(c[c[c[l>>2]>>2]>>2]|0)==1:0)?(c[c[(c[l>>2]|0)+32>>2]>>2]|0)==1:0)?(c[(c[(c[l>>2]|0)+32>>2]|0)+28>>2]|0)==0:0){c[h>>2]=c[(c[(c[l>>2]|0)+32>>2]|0)+24>>2];c[j>>2]=c[c[(c[c[l>>2]>>2]|0)+4>>2]>>2];if((d[(c[h>>2]|0)+44>>0]|0)&16){c[g>>2]=0;a=c[g>>2]|0;i=f;return a|0}if((d[c[j>>2]>>0]|0|0)!=155){c[g>>2]=0;a=c[g>>2]|0;i=f;return a|0}if(!(c[(c[k>>2]|0)+44>>2]|0)){c[g>>2]=0;a=c[g>>2]|0;i=f;return a|0}if(!((e[(c[(c[(c[k>>2]|0)+40>>2]|0)+4>>2]|0)+2>>1]|0)&256)){c[g>>2]=0;a=c[g>>2]|0;i=f;return a|0}if(c[(c[j>>2]|0)+4>>2]&16){c[g>>2]=0;a=c[g>>2]|0;i=f;return a|0}else{c[g>>2]=c[h>>2];a=c[g>>2]|0;i=f;return a|0}}c[g>>2]=0;a=c[g>>2]|0;i=f;return a|0}function Jx(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;l=i;i=i+32|0;k=l;h=l+28|0;j=l+24|0;m=l+20|0;n=l+16|0;g=l+12|0;c[h>>2]=b;c[j>>2]=e;c[m>>2]=f;if((d[(c[h>>2]|0)+450>>0]|0|0)!=2){i=l;return}if(c[m>>2]|0)if(!((d[(c[j>>2]|0)+44>>0]|0)&32))f=1;else f=(a[(c[m>>2]|0)+55>>0]&3|0)==2^1;else f=0;c[n>>2]=f&1;e=c[c[h>>2]>>2]|0;f=(c[n>>2]|0)!=0?24944:1216;if(c[n>>2]|0)m=c[c[m>>2]>>2]|0;else m=1216;c[k>>2]=c[c[j>>2]>>2];c[k+4>>2]=f;c[k+8>>2]=m;c[g>>2]=Te(e,24920,k)|0;hp(c[(c[h>>2]|0)+8>>2]|0,155,c[(c[h>>2]|0)+464>>2]|0,0,0,c[g>>2]|0,-1)|0;i=l;return}function Kx(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;e=i;i=i+32|0;l=e+20|0;h=e+16|0;f=e+12|0;j=e+8|0;g=e+4|0;k=e;c[l>>2]=a;c[h>>2]=b;c[f>>2]=0;c[c[h>>2]>>2]=0;do if((((c[(c[l>>2]|0)+44>>2]|0)==1?(c[j>>2]=c[c[(c[l>>2]|0)+40>>2]>>2],c[g>>2]=c[(c[j>>2]|0)+20>>2],(c[g>>2]|0)!=0):0)?(c[c[g>>2]>>2]|0)==1:0)?(d[c[c[(c[g>>2]|0)+4>>2]>>2]>>0]|0|0)==156:0){c[k>>2]=c[(c[j>>2]|0)+8>>2];if(!(xc(c[k>>2]|0,8312)|0)){c[f>>2]=1;c[c[h>>2]>>2]=c[g>>2];break}if(!(xc(c[k>>2]|0,8320)|0)){c[f>>2]=2;c[c[h>>2]>>2]=c[g>>2]}}while(0);i=e;return c[f>>2]&255|0}function Lx(a,b,e,f,g){a=a|0;b=b|0;e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;h=i;i=i+96|0;u=h+84|0;A=h+80|0;j=h+76|0;s=h+72|0;r=h+68|0;l=h+64|0;k=h+60|0;p=h+56|0;m=h+52|0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>>2]|0)){b=c[l>>2]|0;a=c[k>>2]|0;Pr(b,a);i=h;return}Ir(c[l>>2]|0,18,c[(c[j>>2]|0)+12>>2]|0)|0;b=c[l>>2]|0;a=c[k>>2]|0;Pr(b,a);i=h;return}function Mx(e,f,g){e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0;u=i;i=i+80|0;z=u;k=u+68|0;l=u+64|0;m=u+60|0;q=u+56|0;n=u+52|0;s=u+48|0;x=u+44|0;w=u+40|0;v=u+36|0;o=u+32|0;p=u+28|0;t=u+24|0;h=u+20|0;r=u+16|0;y=u+12|0;A=u+8|0;c[k>>2]=e;c[l>>2]=f;c[m>>2]=g;c[q>>2]=c[(c[k>>2]|0)+8>>2];c[x>>2]=c[c[k>>2]>>2];if(a[(c[k>>2]|0)+450>>0]|0){i=u;return}if((c[q>>2]|0)==0?1:(d[(c[k>>2]|0)+16>>0]|0)!=0){i=u;return}if(d[(c[x>>2]|0)+64>>0]|0){i=u;return}a[(c[k>>2]|0)+16>>0]=1;c[w>>2]=(c[(c[x>>2]|0)+24>>2]&32|0)!=0&1;c[v>>2]=(c[(c[x>>2]|0)+24>>2]&64|0)!=0&1;Nt(c[q>>2]|0,c[c[m>>2]>>2]|0);c[n>>2]=0;while(1){if((c[n>>2]|0)>=(c[c[m>>2]>>2]|0))break;c[o>>2]=c[(c[(c[m>>2]|0)+4>>2]|0)+((c[n>>2]|0)*20|0)>>2];do if(c[o>>2]|0){if(c[(c[(c[m>>2]|0)+4>>2]|0)+((c[n>>2]|0)*20|0)+4>>2]|0){c[p>>2]=c[(c[(c[m>>2]|0)+4>>2]|0)+((c[n>>2]|0)*20|0)+4>>2];Ot(c[q>>2]|0,c[n>>2]|0,0,c[p>>2]|0,-1)|0;break}if((d[c[o>>2]>>0]|0)==154){if(!(c[l>>2]|0))j=26}else if(!((c[l>>2]|0)!=0?(d[c[o>>2]>>0]|0)==156:0))j=26;if((j|0)==26){j=0;c[A>>2]=c[(c[(c[m>>2]|0)+4>>2]|0)+((c[n>>2]|0)*20|0)+8>>2];g=c[x>>2]|0;if(!(c[A>>2]|0)){c[z>>2]=(c[n>>2]|0)+1;g=Te(g,24904,z)|0}else g=ne(g,c[A>>2]|0)|0;c[A>>2]=g;Ot(c[q>>2]|0,c[n>>2]|0,0,c[A>>2]|0,16)|0;break}c[r>>2]=b[(c[o>>2]|0)+32>>1];c[s>>2]=0;while(1){if((c[s>>2]|0)>=(c[c[l>>2]>>2]|0))break;if((c[(c[l>>2]|0)+8+((c[s>>2]|0)*72|0)+40>>2]|0)==(c[(c[o>>2]|0)+28>>2]|0))break;c[s>>2]=(c[s>>2]|0)+1}c[t>>2]=c[(c[l>>2]|0)+8+((c[s>>2]|0)*72|0)+16>>2];if((c[r>>2]|0)<0)c[r>>2]=b[(c[t>>2]|0)+36>>1];if((c[r>>2]|0)<0)c[h>>2]=9992;else c[h>>2]=c[(c[(c[t>>2]|0)+4>>2]|0)+((c[r>>2]|0)*24|0)>>2];if(!((c[v>>2]|0)!=0|(c[w>>2]|0)!=0)){f=c[q>>2]|0;e=c[n>>2]|0;Ot(f,e,0,ne(c[x>>2]|0,c[(c[(c[m>>2]|0)+4>>2]|0)+((c[n>>2]|0)*20|0)+8>>2]|0)|0,16)|0;break}if(c[w>>2]|0){c[y>>2]=0;e=c[x>>2]|0;f=c[h>>2]|0;c[z>>2]=c[c[t>>2]>>2];c[z+4>>2]=f;c[y>>2]=Te(e,17448,z)|0;Ot(c[q>>2]|0,c[n>>2]|0,0,c[y>>2]|0,16)|0;break}else{Ot(c[q>>2]|0,c[n>>2]|0,0,c[h>>2]|0,-1)|0;break}}while(0);c[n>>2]=(c[n>>2]|0)+1}Nx(c[k>>2]|0,c[l>>2]|0,c[m>>2]|0);i=u;return}function Nx(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0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t=c[c[(c[j>>2]|0)+20>>2]>>2]|0;else t=0;f=Sf(q,r,s,t,a[n>>0]|0,0)|0;c[(c[h>>2]|0)+4>>2]=f;if(c[(c[j>>2]|0)+4>>2]&16){g=(c[k>>2]|0)+68|0;f=c[g>>2]|0;c[g>>2]=f+1;c[(c[h>>2]|0)+12>>2]=f;break}else{c[(c[h>>2]|0)+12>>2]=-1;break}}while(0);b[(c[j>>2]|0)+34>>1]=c[o>>2];c[(c[j>>2]|0)+40>>2]=c[p>>2];c[l>>2]=1;f=c[l>>2]|0;i=m;return f|0}c[l>>2]=0;f=c[l>>2]|0;i=m;return f|0}else if((g|0)==154|(g|0)==156){a:do if(c[A>>2]|0){c[z>>2]=(c[A>>2]|0)+8;c[o>>2]=0;while(1){if((c[o>>2]|0)>=(c[c[A>>2]>>2]|0))break a;if((c[(c[j>>2]|0)+28>>2]|0)==(c[(c[z>>2]|0)+40>>2]|0))break;c[o>>2]=(c[o>>2]|0)+1;c[z>>2]=(c[z>>2]|0)+72}c[s>>2]=c[(c[p>>2]|0)+28>>2];c[y>>2]=0;while(1){if((c[y>>2]|0)>=(c[(c[p>>2]|0)+32>>2]|0))break;if((c[(c[s>>2]|0)+4>>2]|0)==(c[(c[j>>2]|0)+28>>2]|0)?(c[(c[s>>2]|0)+8>>2]|0)==(b[(c[j>>2]|0)+32>>1]|0):0)break;c[y>>2]=(c[y>>2]|0)+1;c[s>>2]=(c[s>>2]|0)+24}if((c[y>>2]|0)>=(c[(c[p>>2]|0)+32>>2]|0)?(f=Sx(c[c[k>>2]>>2]|0,c[p>>2]|0)|0,c[y>>2]=f,(f|0)>=0):0){c[s>>2]=(c[(c[p>>2]|0)+28>>2]|0)+((c[y>>2]|0)*24|0);c[c[s>>2]>>2]=c[(c[j>>2]|0)+44>>2];c[(c[s>>2]|0)+4>>2]=c[(c[j>>2]|0)+28>>2];c[(c[s>>2]|0)+8>>2]=b[(c[j>>2]|0)+32>>1];g=(c[k>>2]|0)+72|0;f=(c[g>>2]|0)+1|0;c[g>>2]=f;c[(c[s>>2]|0)+16>>2]=f;c[(c[s>>2]|0)+12>>2]=-1;c[(c[s>>2]|0)+20>>2]=c[j>>2];b:do if(c[(c[p>>2]|0)+24>>2]|0){c[x>>2]=c[(c[p>>2]|0)+24>>2];c[t>>2]=c[(c[x>>2]|0)+4>>2];c[w>>2]=c[c[x>>2]>>2];c[v>>2]=0;while(1){if((c[v>>2]|0)>=(c[w>>2]|0))break b;c[r>>2]=c[c[t>>2]>>2];if(((d[c[r>>2]>>0]|0)==154?(c[(c[r>>2]|0)+28>>2]|0)==(c[(c[j>>2]|0)+28>>2]|0):0)?(b[(c[r>>2]|0)+32>>1]|0)==(b[(c[j>>2]|0)+32>>1]|0):0)break;c[v>>2]=(c[v>>2]|0)+1;c[t>>2]=(c[t>>2]|0)+20}c[(c[s>>2]|0)+12>>2]=c[v>>2]}while(0);if((c[(c[s>>2]|0)+12>>2]|0)<0){g=(c[p>>2]|0)+12|0;f=c[g>>2]|0;c[g>>2]=f+1;c[(c[s>>2]|0)+12>>2]=f}}c[(c[j>>2]|0)+40>>2]=c[p>>2];a[c[j>>2]>>0]=-100;b[(c[j>>2]|0)+34>>1]=c[y>>2]}while(0);c[l>>2]=1;f=c[l>>2]|0;i=m;return f|0}else{c[l>>2]=0;f=c[l>>2]|0;i=m;return f|0}return 0}function Rx(a,b){a=a|0;b=b|0;var d=0;d=i;i=i+16|0;c[d+4>>2]=a;c[d>>2]=b;i=d;return 0}function Sx(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=i;i=i+16|0;g=e+8|0;f=e+4|0;d=e;c[g>>2]=a;c[f>>2]=b;a=ku(c[g>>2]|0,c[(c[f>>2]|0)+28>>2]|0,24,(c[f>>2]|0)+32|0,d)|0;c[(c[f>>2]|0)+28>>2]=a;i=e;return c[d>>2]|0}function Tx(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;e=i;i=i+16|0;g=e+8|0;f=e+4|0;d=e;c[g>>2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;Ir(c[n>>2]|0,119,c[(c[o>>2]|0)+8>>2]|0)|0;zp(c[n>>2]|0,c[z>>2]|0);Ex(c[w>>2]|0,c[A>>2]|0,c[B>>2]|0,c[(c[o>>2]|0)+4>>2]|0);zp(c[n>>2]|0,c[y>>2]|0);break}}while(0);if(d[(c[o>>2]|0)+24>>0]&1)c[v>>2]=109;else c[v>>2]=110;fp(c[n>>2]|0,c[v>>2]|0,c[(c[o>>2]|0)+8>>2]|0,c[E>>2]|0)|0;if(!(c[(c[m>>2]|0)+8>>2]|0)){i=q;return}s=c[m>>2]|0;if(c[(c[m>>2]|0)+12>>2]|0)c[p>>2]=(c[s+12>>2]|0)+1;else c[p>>2]=c[s+8>>2];c[r>>2]=Ir(c[n>>2]|0,139,c[p>>2]|0)|0;fp(c[n>>2]|0,37,c[p>>2]|0,-1)|0;c[l>>2]=mp(c[n>>2]|0,16)|0;zp(c[n>>2]|0,c[r>>2]|0);Ir(c[n>>2]|0,105,c[(c[o>>2]|0)+8>>2]|0)|0;Ir(c[n>>2]|0,95,c[(c[o>>2]|0)+8>>2]|0)|0;zp(c[n>>2]|0,c[l>>2]|0);i=q;return}function Vx(a){a=a|0;var b=0,d=0,e=0;d=i;i=i+16|0;e=d+4|0;b=d;c[e>>2]=a;a=c[e>>2]|0;if((a|0)==117)c[b>>2]=25376;else if((a|0)==118)c[b>>2]=25360;else if((a|0)==116)c[b>>2]=25344;else c[b>>2]=25384;i=d;return c[b>>2]|0}function Wx(a,f,g){a=a|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0;x=i;i=i+112|0;n=x+108|0;o=x+104|0;q=x+100|0;H=x+96|0;D=x+92|0;t=x+88|0;y=x+84|0;v=x+80|0;l=x+76|0;r=x+72|0;p=x+68|0;u=x+64|0;k=x+60|0;B=x+56|0;E=x+52|0;z=x+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c[(c[o>>2]|0)+60>>2]=c[w>>2];c[(c[o>>2]|0)+64>>2]=c[j>>2];i=x;return}function Xx(f,g,h){f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0;X=i;i=i+224|0;W=X+212|0;A=X+208|0;l=X+204|0;C=X+200|0;_=X+196|0;ba=X+192|0;m=X+188|0;n=X+184|0;G=X+164|0;B=X+144|0;r=X+140|0;y=X+136|0;H=X+132|0;L=X+128|0;o=X+124|0;w=X+120|0;p=X+116|0;x=X+112|0;J=X+108|0;v=X+104|0;E=X+100|0;q=X+96|0;Q=X+92|0;R=X+88|0;k=X+84|0;O=X+80|0;j=X+76|0;M=X+72|0;N=X+68|0;s=X+64|0;u=X+60|0;I=X+56|0;t=X+52|0;z=X+48|0;S=X+44|0;F=X+40|0;Z=X+36|0;T=X+32|0;U=X+28|0;K=X+24|0;P=X+20|0;ca=X+16|0;aa=X+12|0;Y=X+8|0;$=X+4|0;V=X;c[A>>2]=f;c[l>>2]=g;c[C>>2]=h;c[x>>2]=0;c[z>>2]=0;c[F>>2]=c[c[A>>2]>>2];c[n>>2]=c[(c[A>>2]|0)+8>>2];c[u>>2]=Nr(c[n>>2]|0)|0;c[s>>2]=Nr(c[n>>2]|0)|0;c[t>>2]=d[(c[l>>2]|0)+4>>0];c[m>>2]=c[(c[l>>2]|0)+52>>2];c[Z>>2]=c[(c[l>>2]|0)+48>>2];c[T>>2]=c[c[Z>>2]>>2];a:do if((c[t>>2]|0)!=116){c[_>>2]=1;while(1){if(d[(c[F>>2]|0)+64>>0]|0)break a;if((c[_>>2]|0)>(c[c[c[l>>2]>>2]>>2]|0))break a;c[ba>>2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0,0,c[q>>2]|0,-1)|0;i=o;return}function Zx(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;f=i;i=i+16|0;g=f+12|0;h=f+8|0;j=f+4|0;e=f;c[g>>2]=a;c[h>>2]=b;c[j>>2]=d;if(c[(c[h>>2]|0)+52>>2]|0)c[e>>2]=Zx(c[g>>2]|0,c[(c[h>>2]|0)+52>>2]|0,c[j>>2]|0)|0;else c[e>>2]=0;if(c[e>>2]|0){a=c[e>>2]|0;i=f;return a|0}if((c[j>>2]|0)>=(c[c[c[h>>2]>>2]>>2]|0)){a=c[e>>2]|0;i=f;return a|0}c[e>>2]=cq(c[g>>2]|0,c[(c[(c[c[h>>2]>>2]|0)+4>>2]|0)+((c[j>>2]|0)*20|0)>>2]|0)|0;a=c[e>>2]|0;i=f;return a|0}function _x(b,d,f){b=b|0;d=d|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;n=i;i=i+48|0;p=n+40|0;l=n+36|0;s=n+32|0;h=n+28|0;q=n+24|0;r=n+20|0;m=n+16|0;o=n+12|0;g=n+8|0;j=n+4|0;k=n;c[p>>2]=b;c[l>>2]=d;c[s>>2]=f;c[h>>2]=c[(c[l>>2]|0)+48>>2];c[q>>2]=c[c[(c[l>>2]|0)+48>>2]>>2];c[r>>2]=c[c[p>>2]>>2];c[m>>2]=Xr(c[r>>2]|0,(c[q>>2]|0)+(c[s>>2]|0)|0,1)|0;if(!(c[m>>2]|0)){s=c[m>>2]|0;i=n;return s|0}c[o>>2]=0;while(1){if((c[o>>2]|0)>=(c[q>>2]|0))break;c[g>>2]=(c[(c[h>>2]|0)+4>>2]|0)+((c[o>>2]|0)*20|0);c[j>>2]=c[c[g>>2]>>2];f=c[p>>2]|0;if(c[(c[j>>2]|0)+4>>2]&256)c[k>>2]=cq(f,c[j>>2]|0)|0;else{c[k>>2]=Zx(f,c[l>>2]|0,(e[(c[g>>2]|0)+16>>1]|0)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0,110,c[(c[m>>2]|0)+4>>2]|0,c[z>>2]|0)|0;lp(c[u>>2]|0,c[z>>2]|0);break};case 10:{Ex(c[u>>2]|0,c[(c[x>>2]|0)+8>>2]|0,c[(c[m>>2]|0)+4>>2]|0,1);break};default:{fp(c[p>>2]|0,35,c[(c[x>>2]|0)+8>>2]|0,c[(c[x>>2]|0)+12>>2]|0)|0;Us(c[u>>2]|0,c[(c[x>>2]|0)+8>>2]|0,c[(c[x>>2]|0)+12>>2]|0)}}if(c[(c[o>>2]|0)+8>>2]|0)ip(c[p>>2]|0,139,c[(c[o>>2]|0)+8>>2]|0,c[q>>2]|0,-1)|0;Pr(c[p>>2]|0,c[r>>2]|0);Ir(c[p>>2]|0,18,c[s>>2]|0)|0;c[y>>2]=c[t>>2];b=c[y>>2]|0;i=n;return b|0}function ay(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+32|0;j=f+16|0;h=f+12|0;k=f+8|0;l=f+4|0;g=f;c[j>>2]=a;c[h>>2]=b;c[k>>2]=d;c[l>>2]=e;if(!(c[h>>2]|0)){i=f;return}c[g>>2]=0;while(1){if((c[g>>2]|0)>=(c[c[h>>2]>>2]|0))break;a=by(c[j>>2]|0,c[(c[(c[h>>2]|0)+4>>2]|0)+((c[g>>2]|0)*20|0)>>2]|0,c[k>>2]|0,c[l>>2]|0)|0;c[(c[(c[h>>2]|0)+4>>2]|0)+((c[g>>2]|0)*20|0)>>2]=a;c[g>>2]=(c[g>>2]|0)+1}i=f;return}function by(e,f,g,h){e=e|0;f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;n=i;i=i+32|0;k=n+20|0;q=n+16|0;l=n+12|0;j=n+8|0;m=n+4|0;p=n;c[q>>2]=e;c[l>>2]=f;c[j>>2]=g;c[m>>2]=h;if(!(c[l>>2]|0)){c[k>>2]=0;e=c[k>>2]|0;i=n;return e|0}do if((d[c[l>>2]>>0]|0)==154?(c[(c[l>>2]|0)+28>>2]|0)==(c[j>>2]|0):0)if((b[(c[l>>2]|0)+32>>1]|0)<0){a[c[l>>2]>>0]=101;break}else{c[p>>2]=Bq(c[q>>2]|0,c[(c[(c[m>>2]|0)+4>>2]|0)+((b[(c[l>>2]|0)+32>>1]|0)*20|0)>>2]|0,0)|0;wn(c[q>>2]|0,c[l>>2]|0);c[l>>2]=c[p>>2];break}else o=8;while(0);do if((o|0)==8){p=by(c[q>>2]|0,c[(c[l>>2]|0)+12>>2]|0,c[j>>2]|0,c[m>>2]|0)|0;c[(c[l>>2]|0)+12>>2]=p;p=by(c[q>>2]|0,c[(c[l>>2]|0)+16>>2]|0,c[j>>2]|0,c[m>>2]|0)|0;c[(c[l>>2]|0)+16>>2]=p;p=c[q>>2]|0;o=(c[l>>2]|0)+20|0;if(c[(c[l>>2]|0)+4>>2]&2048){cy(p,c[o>>2]|0,c[j>>2]|0,c[m>>2]|0);break}else{ay(p,c[o>>2]|0,c[j>>2]|0,c[m>>2]|0);break}}while(0);c[k>>2]=c[l>>2];e=c[k>>2]|0;i=n;return e|0}function cy(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;l=i;i=i+32|0;h=l+24|0;n=l+20|0;k=l+16|0;f=l+12|0;m=l+8|0;j=l+4|0;g=l;c[h>>2]=a;c[n>>2]=b;c[k>>2]=d;c[f>>2]=e;if(!(c[n>>2]|0)){i=l;return}ay(c[h>>2]|0,c[c[n>>2]>>2]|0,c[k>>2]|0,c[f>>2]|0);ay(c[h>>2]|0,c[(c[n>>2]|0)+40>>2]|0,c[k>>2]|0,c[f>>2]|0);ay(c[h>>2]|0,c[(c[n>>2]|0)+48>>2]|0,c[k>>2]|0,c[f>>2]|0);a=by(c[h>>2]|0,c[(c[n>>2]|0)+44>>2]|0,c[k>>2]|0,c[f>>2]|0)|0;c[(c[n>>2]|0)+44>>2]=a;a=by(c[h>>2]|0,c[(c[n>>2]|0)+36>>2]|0,c[k>>2]|0,c[f>>2]|0)|0;c[(c[n>>2]|0)+36>>2]=a;cy(c[h>>2]|0,c[(c[n>>2]|0)+52>>2]|0,c[k>>2]|0,c[f>>2]|0);c[m>>2]=c[(c[n>>2]|0)+32>>2];if(!(c[m>>2]|0)){i=l;return}c[g>>2]=c[c[m>>2]>>2];c[j>>2]=(c[m>>2]|0)+8;while(1){if((c[g>>2]|0)<=0)break;cy(c[h>>2]|0,c[(c[j>>2]|0)+20>>2]|0,c[k>>2]|0,c[f>>2]|0);c[g>>2]=(c[g>>2]|0)+ -1;c[j>>2]=(c[j>>2]|0)+72}i=l;return}function dy(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;l=i;i=i+32|0;k=l+24|0;m=l+20|0;h=l+16|0;g=l+12|0;n=l+8|0;o=l+4|0;j=l;c[k>>2]=b;c[m>>2]=e;c[h>>2]=f;c[g>>2]=c[c[k>>2]>>2];if(!(c[(c[g>>2]|0)+24>>2]&524288)){i=l;return}if((d[(c[h>>2]|0)+44>>0]|0)&16){i=l;return}if(c[(c[h>>2]|0)+12>>2]|0){i=l;return}c[n>>2]=0;c[o>>2]=dp(c[k>>2]|0)|0;do if(!(Up(c[h>>2]|0)|0)){c[j>>2]=c[(c[h>>2]|0)+16>>2];while(1){if(!(c[j>>2]|0))break;if(d[(c[j>>2]|0)+24>>0]|0)break;if(c[(c[g>>2]|0)+24>>2]&16777216)break;c[j>>2]=c[(c[j>>2]|0)+4>>2]}if(c[j>>2]|0){c[n>>2]=Nr(c[o>>2]|0)|0;fp(c[o>>2]|0,135,1,c[n>>2]|0)|0;break}else{i=l;return}}while(0);a[(c[k>>2]|0)+438>>0]=1;b=c[k>>2]|0;no(b,wr(c[g>>2]|0,c[m>>2]|0,0)|0,0);a[(c[k>>2]|0)+438>>0]=0;if(!(c[(c[g>>2]|0)+24>>2]&16777216)){b=c[o>>2]|0;fp(b,135,0,(Mr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>2]|0,0,0,c[c[j>>2]>>2]|0,0)|0;e=c[n>>2]|0;b=c[h>>2]|0;a=c[j>>2]|0;a=c[a>>2]|0;hp(e,124,b,0,0,a,0)|0;a=c[k>>2]|0;b=c[h>>2]|0;ep(a,b);b=c[l>>2]|0;a=c[h>>2]|0;gy(b,a);i=m;return}function fy(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;k=i;i=i+32|0;m=k+28|0;d=k+24|0;l=k+20|0;j=k+16|0;g=k+12|0;f=k+8|0;h=k+4|0;n=k;c[m>>2]=a;c[d>>2]=b;c[l>>2]=c[(c[d>>2]|0)+32>>2];c[j>>2]=0;while(1){c[f>>2]=0;if(!((c[j>>2]|0)!=0?(c[l>>2]|0)>=(c[j>>2]|0):0))c[f>>2]=c[l>>2];c[g>>2]=c[(c[d>>2]|0)+8>>2];while(1){if(!(c[g>>2]|0))break;c[h>>2]=c[(c[g>>2]|0)+44>>2];if(!((c[j>>2]|0)!=0?(c[h>>2]|0)>=(c[j>>2]|0):0))e=9;if((e|0)==9?(e=0,(c[h>>2]|0)>(c[f>>2]|0)):0)c[f>>2]=c[h>>2];c[g>>2]=c[(c[g>>2]|0)+20>>2]}if(!(c[f>>2]|0))break;c[n>>2]=Ve(c[c[m>>2]>>2]|0,c[(c[d>>2]|0)+68>>2]|0)|0;ju(c[m>>2]|0,c[f>>2]|0,c[n>>2]|0);c[j>>2]=c[f>>2]}i=k;return}function gy(a,d){a=a|0;d=d|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;g=f+12|0;h=f+8|0;j=f+4|0;k=f;c[g>>2]=a;c[h>>2]=d;if(((e[(c[(c[(c[g>>2]|0)+16>>2]|0)+(c[h>>2]<<4)+12>>2]|0)+78>>1]|0)&2|0)!=2){i=f;return}c[j>>2]=c[(c[(c[(c[g>>2]|0)+16>>2]|0)+(c[h>>2]<<4)+12>>2]|0)+16>>2];while(1){if(!(c[j>>2]|0))break;c[k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p>>2]=1;c[p+16>>2]=c[c[j>>2]>>2];c[p+24>>2]=c[j>>2];c[p+48>>2]=-1;c[l>>2]=c[k>>2];c[l+4>>2]=p;b[l+28>>1]=c[m>>2];a=(vq(l,c[n>>2]|0)|0)==0;if(!(a&(c[o>>2]|0)!=0)){i=h;return}c[q>>2]=0;while(1){if((c[q>>2]|0)>=(c[c[o>>2]>>2]|0)){j=6;break}if(vq(l,c[(c[(c[o>>2]|0)+4>>2]|0)+((c[q>>2]|0)*20|0)>>2]|0)|0){j=6;break}c[q>>2]=(c[q>>2]|0)+1}if((j|0)==6){i=h;return}}function jy(a,d,e){a=a|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;g=i;i=i+16|0;f=g+12|0;j=g+8|0;k=g+4|0;h=g;c[j>>2]=a;c[k>>2]=d;c[h>>2]=e;while(1){a=c[k>>2]|0;c[k>>2]=a+ -1;if((a|0)<=0){e=5;break}d=c[h>>2]|0;a=c[j>>2]|0;c[j>>2]=a+2;if((d|0)==(b[a>>1]|0)){e=4;break}}if((e|0)==4){c[f>>2]=1;a=c[f>>2]|0;i=g;return a|0}else if((e|0)==5){c[f>>2]=0;a=c[f>>2]|0;i=g;return a|0}return 0}function ky(a){a=a|0;var f=0,g=0,h=0,j=0,k=0,l=0;h=i;i=i+32|0;g=h+12|0;f=h+8|0;k=h+4|0;j=h;l=h+16|0;c[g>>2]=a;c[f>>2]=0;c[j>>2]=c[(c[(c[g>>2]|0)+12>>2]|0)+4>>2];c[k>>2]=0;while(1){if((c[k>>2]|0)>=(e[(c[g>>2]|0)+52>>1]|0))break;b[l>>1]=b[(c[(c[g>>2]|0)+4>>2]|0)+(c[k>>2]<<1)>>1]|0;if((b[l>>1]|0)<0)a=1;else a=d[(c[j>>2]|0)+((b[(c[(c[g>>2]|0)+4>>2]|0)+(c[k>>2]<<1)>>1]|0)*24|0)+22>>0]|0;c[f>>2]=(c[f>>2]|0)+a;c[k>>2]=(c[k>>2]|0)+1}a=dq(c[f>>2]<<2,0)|0;b[(c[g>>2]|0)+48>>1]=a;i=h;return}function ly(a,b){a=a|0;b=b|0;var e=0,f=0,g=0;g=i;i=i+16|0;e=g+4|0;f=g;c[e>>2]=a;c[f>>2]=b;my(c[e>>2]|0,c[f>>2]|0);if(!((c[e>>2]|0)!=0?(c[(c[e>>2]|0)+520>>2]|0)!=0:0))eh(c[(c[f>>2]|0)+40>>2]|0);wn(c[e>>2]|0,c[(c[f>>2]|0)+36>>2]|0);Xb(c[e>>2]|0,c[(c[f>>2]|0)+16>>2]|0);if(!((d[(c[f>>2]|0)+55>>0]|0)>>>4&1)){e=c[e>>2]|0;a=c[f>>2]|0;Xb(e,a);i=g;return}Xb(c[e>>2]|0,c[(c[f>>2]|0)+32>>2]|0);e=c[e>>2]|0;a=c[f>>2]|0;Xb(e,a);i=g;return}function my(a,b){a=a|0;b=b|0;var d=0;d=i;i=i+16|0;c[d+4>>2]=a;c[d>>2]=b;i=d;return}function ny(b,e){b=b|0;e=e|0;var f=0,g=0,h=0;f=i;i=i+16|0;h=f;g=f+4|0;c[h>>2]=b;a[g>>0]=e;b=et(c[h>>2]|0,3+(d[g>>0]|0)|0)|0;i=f;return b|0}function oy(f,g){f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;p=i;i=i+48|0;r=p+40|0;q=p+36|0;l=p+32|0;m=p+28|0;o=p+24|0;n=p+20|0;t=p+16|0;h=p+12|0;u=p+8|0;s=p+4|0;k=p;c[r>>2]=f;c[q>>2]=g;c[h>>2]=c[c[r>>2]>>2];c[u>>2]=c[(c[r>>2]|0)+8>>2];if(c[(c[r>>2]|0)+416>>2]|0)a[(dt(c[u>>2]|0,c[(c[r>>2]|0)+416>>2]|0)|0)>>0]=120;if(c[(c[r>>2]|0)+420>>2]|0)a[(dt(c[u>>2]|0,c[(c[r>>2]|0)+420>>2]|0)|0)>>0]=16;do if((b[(c[q>>2]|0)+36>>1]|0)>=0){c[s>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+50>>1]|0;break}if(ty(c[h>>2]|0,c[l>>2]|0,(e[(c[l>>2]|0)+50>>1]|0)+(c[k>>2]|0)|0)|0){j=38;break a}c[n>>2]=0;c[t>>2]=e[(c[l>>2]|0)+50>>1];while(1){if((c[n>>2]|0)>=(c[o>>2]|0))break b;if(!(jy(c[(c[l>>2]|0)+4>>2]|0,e[(c[l>>2]|0)+50>>1]|0,b[(c[(c[m>>2]|0)+4>>2]|0)+(c[n>>2]<<1)>>1]|0)|0)){b[(c[(c[l>>2]|0)+4>>2]|0)+(c[t>>2]<<1)>>1]=b[(c[(c[m>>2]|0)+4>>2]|0)+(c[n>>2]<<1)>>1]|0;c[(c[(c[l>>2]|0)+32>>2]|0)+(c[t>>2]<<2)>>2]=c[(c[(c[m>>2]|0)+32>>2]|0)+(c[n>>2]<<2)>>2];c[t>>2]=(c[t>>2]|0)+1}c[n>>2]=(c[n>>2]|0)+1}}while(0);c[l>>2]=c[(c[l>>2]|0)+20>>2]}if((j|0)==38){i=p;return}if((c[o>>2]|0)>=(b[(c[q>>2]|0)+38>>1]|0)){b[(c[m>>2]|0)+52>>1]=b[(c[q>>2]|0)+38>>1]|0;i=p;return}if(ty(c[h>>2]|0,c[m>>2]|0,b[(c[q>>2]|0)+38>>1]|0)|0){i=p;return}c[n>>2]=0;c[t>>2]=c[o>>2];while(1){if((c[n>>2]|0)>=(b[(c[q>>2]|0)+38>>1]|0))break;if(!(jy(c[(c[m>>2]|0)+4>>2]|0,c[t>>2]|0,c[n>>2]|0)|0)){b[(c[(c[m>>2]|0)+4>>2]|0)+(c[t>>2]<<1)>>1]=c[n>>2];c[(c[(c[m>>2]|0)+32>>2]|0)+(c[t>>2]<<2)>>2]=3320;c[t>>2]=(c[t>>2]|0)+1}c[n>>2]=(c[n>>2]|0)+1}i=p;return}function py(a){a=a|0;var e=0,f=0,g=0,h=0,j=0;g=i;i=i+16|0;f=g+12|0;e=g+8|0;j=g+4|0;h=g;c[f>>2]=a;c[e>>2]=0;c[h>>2]=b[(c[f>>2]|0)+38>>1];c[j>>2]=c[(c[f>>2]|0)+4>>2];while(1){if((c[h>>2]|0)<=0)break;c[e>>2]=(c[e>>2]|0)+(d[(c[j>>2]|0)+22>>0]|0);c[h>>2]=(c[h>>2]|0)+ -1;c[j>>2]=(c[j>>2]|0)+24}if((b[(c[f>>2]|0)+36>>1]|0)>=0){h=c[e>>2]|0;h=h<<2;h=dq(h,0)|0;j=c[f>>2]|0;j=j+42|0;b[j>>1]=h;i=g;return}c[e>>2]=(c[e>>2]|0)+1;h=c[e>>2]|0;h=h<<2;h=dq(h,0)|0;j=c[f>>2]|0;j=j+42|0;b[j>>1]=h;i=g;return}function qy(d,e){d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0;h=i;i=i+64|0;k=h;n=h+52|0;u=h+48|0;o=h+44|0;g=h+40|0;f=h+36|0;m=h+32|0;l=h+28|0;p=h+24|0;q=h+20|0;j=h+16|0;r=h+12|0;t=h+8|0;s=h+4|0;c[u>>2]=d;c[o>>2]=e;c[m>>2]=0;c[r>>2]=c[(c[o>>2]|0)+4>>2];c[g>>2]=0;while(1){if((c[g>>2]|0)>=(b[(c[o>>2]|0)+38>>1]|0))break;d=(ry(c[c[r>>2]>>2]|0)|0)+5|0;c[m>>2]=(c[m>>2]|0)+d;c[g>>2]=(c[g>>2]|0)+1;c[r>>2]=(c[r>>2]|0)+24}d=ry(c[c[o>>2]>>2]|0)|0;c[m>>2]=(c[m>>2]|0)+d;if((c[m>>2]|0)<50){c[p>>2]=1216;c[q>>2]=9776;c[j>>2]=23976}else{c[p>>2]=26904;c[q>>2]=26912;c[j>>2]=26920}c[m>>2]=(c[m>>2]|0)+(35+((b[(c[o>>2]|0)+38>>1]|0)*6|0));d=c[m>>2]|0;c[l>>2]=Qe(0,d,((d|0)<0)<<31>>31)|0;if(!(c[l>>2]|0)){a[(c[u>>2]|0)+64>>0]=1;c[n>>2]=0;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[l>>2]|0)+52>>1]|0|0)>=(c[m>>2]|0)){c[j>>2]=0;d=c[j>>2]|0;i=h;return d|0}c[n>>2]=(c[m>>2]|0)*7;d=c[n>>2]|0;c[k>>2]=se(c[o>>2]|0,d,((d|0)<0)<<31>>31)|0;if(!(c[k>>2]|0)){c[j>>2]=7;d=c[j>>2]|0;i=h;return d|0}else{dF(c[k>>2]|0,c[(c[l>>2]|0)+32>>2]|0,(e[(c[l>>2]|0)+52>>1]|0)<<2|0)|0;c[(c[l>>2]|0)+32>>2]=c[k>>2];c[k>>2]=(c[k>>2]|0)+(c[m>>2]<<2);dF(c[k>>2]|0,c[(c[l>>2]|0)+4>>2]|0,(e[(c[l>>2]|0)+52>>1]|0)<<1|0)|0;c[(c[l>>2]|0)+4>>2]=c[k>>2];c[k>>2]=(c[k>>2]|0)+(c[m>>2]<<1);dF(c[k>>2]|0,c[(c[l>>2]|0)+28>>2]|0,e[(c[l>>2]|0)+52>>1]|0|0)|0;c[(c[l>>2]|0)+28>>2]=c[k>>2];b[(c[l>>2]|0)+52>>1]=c[m>>2];d=(c[l>>2]|0)+55|0;a[d>>0]=a[d>>0]&-17|16;c[j>>2]=0;d=c[j>>2]|0;i=h;return d|0}return 0}function uy(a){a=a|0;var b=0,e=0,f=0,g=0,h=0,j=0;b=i;i=i+32|0;f=b+16|0;e=b+12|0;j=b+8|0;g=b+4|0;h=b;c[f>>2]=a;c[j>>2]=dp(c[f>>2]|0)|0;c[e>>2]=0;while(1){if((c[e>>2]|0)>=(c[(c[f>>2]|0)+396>>2]|0))break;c[g>>2]=(c[(c[f>>2]|0)+400>>2]|0)+(c[e>>2]<<4);c[h>>2]=c[c[g>>2]>>2];hp(c[j>>2]|0,143,c[h>>2]|0,c[(c[g>>2]|0)+4>>2]|0,d[(c[g>>2]|0)+8>>0]|0,c[(c[g>>2]|0)+12>>2]|0,-2)|0;c[e>>2]=(c[e>>2]|0)+1}i=b;return}function vy(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,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0;b=c[q>>2]|0;b=wd(e,b)|0;c[q>>2]=b;b=c[q>>2]|0;i=l;return b|0}Lk(c[m>>2]|0);c[c[n>>2]>>2]=c[m>>2];c[(c[n>>2]|0)+424>>2]=0;do if((c[C>>2]|0)>=0){if((c[C>>2]|0)!=0?(a[(c[z>>2]|0)+((c[C>>2]|0)-1)>>0]|0)==0:0){s=17;break}c[D>>2]=c[(c[m>>2]|0)+92>>2];f=c[m>>2]|0;if((c[C>>2]|0)>(c[D>>2]|0)){Lc(f,18,30968,p);c[q>>2]=wd(c[m>>2]|0,18)|0;b=c[n>>2]|0;ef(b);b=c[m>>2]|0;e=c[n>>2]|0;Xb(b,e);e=c[m>>2]|0;b=c[q>>2]|0;b=wd(e,b)|0;c[q>>2]=b;b=c[q>>2]|0;i=l;return b|0}b=c[C>>2]|0;c[A>>2]=rm(f,c[z>>2]|0,b,((b|0)<0)<<31>>31)|0;if(c[A>>2]|0){qf(c[n>>2]|0,c[A>>2]|0,o)|0;Xb(c[m>>2]|0,c[A>>2]|0);c[(c[n>>2]|0)+480>>2]=(c[z>>2]|0)+((c[(c[n>>2]|0)+480>>2]|0)-(c[A>>2]|0));break}else{c[(c[n>>2]|0)+480>>2]=(c[z>>2]|0)+(c[C>>2]|0);break}}else s=17;while(0);if((s|0)==17)qf(c[n>>2]|0,c[z>>2]|0,o)|0;if(a[(c[m>>2]|0)+64>>0]|0)c[(c[n>>2]|0)+12>>2]=7;if((c[(c[n>>2]|0)+12>>2]|0)==101)c[(c[n>>2]|0)+12>>2]=0;if(a[(c[n>>2]|0)+17>>0]|0)zy(c[n>>2]|0);if(a[(c[m>>2]|0)+64>>0]|0)c[(c[n>>2]|0)+12>>2]=7;if(c[B>>2]|0)c[c[B>>2]>>2]=c[(c[n>>2]|0)+480>>2];c[q>>2]=c[(c[n>>2]|0)+12>>2];a:do if(((c[q>>2]|0)==0?(c[(c[n>>2]|0)+8>>2]|0)!=0:0)?(d[(c[n>>2]|0)+450>>0]|0)!=0:0){A=c[(c[n>>2]|0)+8>>2]|0;if((d[(c[n>>2]|0)+450>>0]|0)==2){Nt(A,4);c[w>>2]=8;c[v>>2]=12}else{Nt(A,8);c[w>>2]=0;c[v>>2]=8}c[u>>2]=c[w>>2];while(1){if((c[u>>2]|0)>=(c[v>>2]|0))break a;Ot(c[(c[n>>2]|0)+8>>2]|0,(c[u>>2]|0)-(c[w>>2]|0)|0,0,c[30992+(c[u>>2]<<2)>>2]|0,0)|0;c[u>>2]=(c[u>>2]|0)+1}}while(0);if(!(d[(c[m>>2]|0)+145>>0]|0)){c[x>>2]=c[(c[n>>2]|0)+8>>2];Ay(c[x>>2]|0,c[z>>2]|0,(c[(c[n>>2]|0)+480>>2]|0)-(c[z>>2]|0)|0,c[t>>2]|0)}do if(c[(c[n>>2]|0)+8>>2]|0){if((c[q>>2]|0)==0?(d[(c[m>>2]|0)+64>>0]|0)==0:0){s=43;break}vd(c[(c[n>>2]|0)+8>>2]|0)|0}else s=43;while(0);if((s|0)==43)c[c[y>>2]>>2]=c[(c[n>>2]|0)+8>>2];t=c[m>>2]|0;s=c[q>>2]|0;if(c[o>>2]|0){c[p>>2]=c[o>>2];Lc(t,s,1200,p);Xb(c[m>>2]|0,c[o>>2]|0)}else Nc(t,s);while(1){if(!(c[(c[n>>2]|0)+528>>2]|0))break;c[r>>2]=c[(c[n>>2]|0)+528>>2];c[(c[n>>2]|0)+528>>2]=c[(c[r>>2]|0)+4>>2];Xb(c[m>>2]|0,c[r>>2]|0)}b=c[n>>2]|0;ef(b);b=c[m>>2]|0;e=c[n>>2]|0;Xb(b,e);e=c[m>>2]|0;b=c[q>>2]|0;b=wd(e,b)|0;c[q>>2]=b;b=c[q>>2]|0;i=l;return b|0}function yy(a){a=a|0;var b=0,d=0,e=0;d=i;i=i+16|0;e=d+4|0;b=d;c[e>>2]=a;Pc(c[e>>2]|0);c[b>>2]=By(c[e>>2]|0,1,1)|0;i=d;return c[b>>2]|0}function zy(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0;d=i;i=i+32|0;l=d+24|0;g=d+20|0;h=d+16|0;k=d+12|0;f=d+8|0;j=d+4|0;e=d;c[l>>2]=b;c[g>>2]=c[c[l>>2]>>2];c[h>>2]=0;while(1){if((c[h>>2]|0)>=(c[(c[g>>2]|0)+20>>2]|0)){b=14;break}c[j>>2]=0;c[e>>2]=c[(c[(c[g>>2]|0)+16>>2]|0)+(c[h>>2]<<4)+4>>2];if(c[e>>2]|0){if(!(Tc(c[e>>2]|0)|0)){c[k>>2]=Rc(c[e>>2]|0,0)|0;if((c[k>>2]|0)==7|(c[k>>2]|0)==3082)a[(c[g>>2]|0)+64>>0]=1;if(c[k>>2]|0){b=14;break}c[j>>2]=1}Sc(c[e>>2]|0,1,f);if((c[f>>2]|0)!=(c[c[(c[(c[g>>2]|0)+16>>2]|0)+(c[h>>2]<<4)+12>>2]>>2]|0)){as(c[g>>2]|0,c[h>>2]|0);c[(c[l>>2]|0)+12>>2]=17}if(c[j>>2]|0)gs(c[e>>2]|0)|0}c[h>>2]=(c[h>>2]|0)+1}if((b|0)==14){i=d;return}}function Ay(a,d,e,f){a=a|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0;g=i;i=i+16|0;j=g+12|0;k=g+8|0;h=g+4|0;l=g;c[j>>2]=a;c[k>>2]=d;c[h>>2]=e;c[l>>2]=f;if(!(c[j>>2]|0)){i=g;return}a=c[h>>2]|0;a=rm(c[c[j>>2]>>2]|0,c[k>>2]|0,a,((a|0)<0)<<31>>31)|0;c[(c[j>>2]|0)+168>>2]=a;a=(c[j>>2]|0)+88|0;b[a>>1]=b[a>>1]&-1025|(c[l>>2]&1)<<10&65535;i=g;return}function By(f,g,h){f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;o=i;i=i+32|0;l=o+16|0;n=o+12|0;j=o+8|0;p=o+20|0;q=o+4|0;m=o;c[n>>2]=f;c[j>>2]=g;a[p>>0]=h;c[q>>2]=c[(c[n>>2]|0)+4>>2];if(!(a[(c[n>>2]|0)+9>>0]|0)){c[l>>2]=0;f=c[l>>2]|0;i=o;return f|0}if((c[(c[q>>2]|0)+76>>2]|0)!=(c[n>>2]|0)?(e[(c[q>>2]|0)+22>>1]&32|0)!=0:0){c[l>>2]=262;f=c[l>>2]|0;i=o;return f|0}c[m>>2]=c[(c[q>>2]|0)+72>>2];while(1){if(!(c[m>>2]|0)){k=15;break}if(((c[c[m>>2]>>2]|0)!=(c[n>>2]|0)?(c[(c[m>>2]|0)+4>>2]|0)==(c[j>>2]|0):0)?(d[(c[m>>2]|0)+8>>0]|0)!=(d[p>>0]|0):0)break;c[m>>2]=c[(c[m>>2]|0)+12>>2]}if((k|0)==15){c[l>>2]=0;f=c[l>>2]|0;i=o;return f|0}if((d[p>>0]|0)==2){f=(c[q>>2]|0)+22|0;b[f>>1]=e[f>>1]|64}c[l>>2]=262;f=c[l>>2]|0;i=o;return f|0}function Cy(a,d){a=a|0;d=d|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+224|0;g=f+220|0;h=f+216|0;l=f;k=f+212|0;j=f+208|0;c[g>>2]=a;c[h>>2]=d;dF(l|0,c[g>>2]|0,208)|0;dF(c[g>>2]|0,c[h>>2]|0,208)|0;dF(c[h>>2]|0,l|0,208)|0;c[k>>2]=c[(c[g>>2]|0)+52>>2];c[(c[g>>2]|0)+52>>2]=c[(c[h>>2]|0)+52>>2];c[(c[h>>2]|0)+52>>2]=c[k>>2];c[k>>2]=c[(c[g>>2]|0)+48>>2];c[(c[g>>2]|0)+48>>2]=c[(c[h>>2]|0)+48>>2];c[(c[h>>2]|0)+48>>2]=c[k>>2];c[j>>2]=c[(c[g>>2]|0)+168>>2];c[(c[g>>2]|0)+168>>2]=c[(c[h>>2]|0)+168>>2];c[(c[h>>2]|0)+168>>2]=c[j>>2];a=(c[h>>2]|0)+88|0;b[a>>1]=b[a>>1]&-1025|((e[(c[g>>2]|0)+88>>1]|0)>>>10&1)<<10&65535;i=f;return}function Dy(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;c[(c[d>>2]|0)+80>>2]=0;i=b;return}function Ey(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0;j=i;i=i+32|0;f=j+20|0;k=j+16|0;e=j+12|0;g=j+8|0;h=j+4|0;d=j;c[f>>2]=a;c[k>>2]=b;c[e>>2]=c[(c[k>>2]|0)+16>>2];while(1){if(!(c[e>>2]|0))break;if(!((c[f>>2]|0)!=0?(c[(c[f>>2]|0)+520>>2]|0)!=0:0)){b=c[(c[e>>2]|0)+12>>2]|0;if(c[(c[e>>2]|0)+16>>2]|0)c[(c[(c[e>>2]|0)+16>>2]|0)+12>>2]=b;else{c[h>>2]=b;b=c[e>>2]|0;if(c[h>>2]|0)b=c[(c[b+12>>2]|0)+8>>2]|0;else b=c[b+8>>2]|0;c[d>>2]=b;gh((c[(c[k>>2]|0)+68>>2]|0)+56|0,c[d>>2]|0,c[h>>2]|0)|0}if(c[(c[e>>2]|0)+12>>2]|0)c[(c[(c[e>>2]|0)+12>>2]|0)+16>>2]=c[(c[e>>2]|0)+16>>2]}dx(c[f>>2]|0,c[(c[e>>2]|0)+28>>2]|0);dx(c[f>>2]|0,c[(c[e>>2]|0)+32>>2]|0);c[g>>2]=c[(c[e>>2]|0)+4>>2];Xb(c[f>>2]|0,c[e>>2]|0);c[e>>2]=c[g>>2]}i=j;return}function Fy(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=i;i=i+16|0;e=d+8|0;f=d+4|0;g=d;c[e>>2]=a;c[f>>2]=b;if(!((c[e>>2]|0)!=0?(c[(c[e>>2]|0)+520>>2]|0)!=0:0))Gy(0,c[f>>2]|0)|0;if(!(c[(c[f>>2]|0)+56>>2]|0)){i=d;return}c[g>>2]=0;while(1){if((c[g>>2]|0)>=(c[(c[f>>2]|0)+52>>2]|0))break;if((c[g>>2]|0)!=1)Xb(c[e>>2]|0,c[(c[(c[f>>2]|0)+56>>2]|0)+(c[g>>2]<<2)>>2]|0);c[g>>2]=(c[g>>2]|0)+1}Xb(c[e>>2]|0,c[(c[f>>2]|0)+56>>2]|0);i=d;return}function Gy(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0;d=i;i=i+32|0;k=d+20|0;g=d+16|0;e=d+12|0;f=d+8|0;h=d+4|0;j=d;c[k>>2]=a;c[g>>2]=b;c[e>>2]=0;c[f>>2]=c[(c[g>>2]|0)+60>>2];c[(c[g>>2]|0)+60>>2]=0;while(1){if(!(c[f>>2]|0))break;c[h>>2]=c[c[f>>2]>>2];c[j>>2]=c[(c[f>>2]|0)+24>>2];if((c[h>>2]|0)==(c[k>>2]|0)){c[e>>2]=c[f>>2];c[(c[g>>2]|0)+60>>2]=c[e>>2];c[(c[e>>2]|0)+24>>2]=0}else{c[(c[f>>2]|0)+24>>2]=c[(c[h>>2]|0)+332>>2];c[(c[h>>2]|0)+332>>2]=c[f>>2]}c[f>>2]=c[j>>2]}i=d;return c[e>>2]|0}function Hy(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;j=e+12|0;g=e+8|0;h=e+4|0;f=e;c[j>>2]=a;c[g>>2]=b;c[h>>2]=d;c[f>>2]=c[(c[j>>2]|0)+8>>2];while(1){if(!(c[f>>2]|0))break;if((c[f>>2]|0)!=(c[h>>2]|0)){if(!(c[g>>2]|0))break;if((c[(c[f>>2]|0)+60>>2]|0)==(c[g>>2]|0))break}c[f>>2]=c[(c[f>>2]|0)+8>>2]}if(!(c[f>>2]|0)){j=0;i=e;return j|0}j=Iy(c[f>>2]|0,c[g>>2]|0,c[h>>2]|0)|0;i=e;return j|0}function Iy(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;h=i;i=i+32|0;f=h+16|0;l=h+12|0;j=h+8|0;k=h+4|0;g=h;c[l>>2]=a;c[j>>2]=b;c[k>>2]=e;a:while(1){do if((c[l>>2]|0)!=(c[k>>2]|0)){if(0!=(c[j>>2]|0)?(c[(c[l>>2]|0)+60>>2]|0)!=(c[j>>2]|0):0)break;e=c[l>>2]|0;if((d[(c[l>>2]|0)+73>>0]|0|0)==1){c[g>>2]=Jy(e)|0;if(c[g>>2]|0){j=7;break a}else break}else{Ky(e);break}}while(0);c[l>>2]=c[(c[l>>2]|0)+8>>2];if(!(c[l>>2]|0)){j=10;break}}if((j|0)==7){c[f>>2]=c[g>>2];a=c[f>>2]|0;i=h;return a|0}else if((j|0)==10){c[f>>2]=0;a=c[f>>2]|0;i=h;return a|0}return 0}function Jy(b){b=b|0;var e=0,f=0,g=0,h=0;g=i;i=i+16|0;e=g+8|0;f=g+4|0;h=g;c[e>>2]=b;c[f>>2]=Ly(c[e>>2]|0,(c[e>>2]|0)+48|0)|0;do if(!(d[(c[(c[e>>2]|0)+120>>2]|0)+2>>0]|0)){b=(c[e>>2]|0)+48|0;c[h>>2]=gc(c[b>>2]|0,c[b+4>>2]|0)|0;if(!(c[h>>2]|0)){c[f>>2]=7;break}c[f>>2]=My(c[e>>2]|0,0,c[(c[e>>2]|0)+48>>2]|0,c[h>>2]|0)|0;b=c[h>>2]|0;if(!(c[f>>2]|0)){c[(c[e>>2]|0)+56>>2]=b;break}else{hc(b);break}}while(0);if(c[f>>2]|0){h=c[e>>2]|0;h=h+72|0;b=a[h>>0]|0;b=b&255;b=b&-5;b=b&255;a[h>>0]=b;h=c[f>>2]|0;i=g;return h|0}Ky(c[e>>2]|0);a[(c[e>>2]|0)+73>>0]=3;h=c[e>>2]|0;h=h+72|0;b=a[h>>0]|0;b=b&255;b=b&-5;b=b&255;a[h>>0]=b;h=c[f>>2]|0;i=g;return h|0}function Ky(a){a=a|0;var d=0,e=0,f=0;e=i;i=i+16|0;d=e+4|0;f=e;c[d>>2]=a;c[f>>2]=0;while(1){if((c[f>>2]|0)>(b[(c[d>>2]|0)+76>>1]|0))break;Rk(c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0)+(c[l>>2]|0)}else{a=c[g>>2]|0;c[a>>2]=(c[a>>2]|0)+(c[l>>2]|0)}c[h>>2]=c[j>>2];a=c[h>>2]|0;i=m;return a|0}function Oy(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;e=i;i=i+16|0;f=e+12|0;j=e+8|0;h=e+4|0;g=e;c[f>>2]=a;c[j>>2]=b;c[h>>2]=d;a:do if(c[h>>2]|0)switch(c[j>>2]|0){case-5:{Py(c[f>>2]|0,c[h>>2]|0);break a};case-6:{if(c[(c[f>>2]|0)+520>>2]|0)break a;eh(c[h>>2]|0);break a};case-11:{if(c[(c[f>>2]|0)+520>>2]|0)break a;hc(c[h>>2]|0);break a};case-8:{d=c[h>>2]|0;if(!(c[(c[f>>2]|0)+520>>2]|0)){tf(d);break a}c[g>>2]=d;if(c[(c[g>>2]|0)+24>>2]|0)Xb(c[f>>2]|0,c[(c[g>>2]|0)+20>>2]|0);Xb(c[f>>2]|0,c[g>>2]|0);break a};case-10:{if(c[(c[f>>2]|0)+520>>2]|0)break a;Nk(c[h>>2]|0);break a};case-15:case-1:case-13:case-12:{Xb(c[f>>2]|0,c[h>>2]|0);break a};default:break a}while(0);i=e;return}function Py(a,b){a=a|0;b=b|0;var d=0,f=0,g=0;d=i;i=i+16|0;f=d+4|0;g=d;c[f>>2]=a;c[g>>2]=b;if(!(c[g>>2]|0)){i=d;return}if(!((e[(c[g>>2]|0)+2>>1]|0)&16)){i=d;return}Xb(c[f>>2]|0,c[g>>2]|0);i=d;return}function Qy(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=(c[d>>2]|0)+12|0;c[a>>2]=(c[a>>2]|0)+1;i=b;return}function Ry(a,d){a=a|0;d=d|0;var e=0,f=0,g=0;f=i;i=i+16|0;g=f+4|0;e=f;c[g>>2]=a;c[e>>2]=d;Bd(c[g>>2]|0);g=(c[g>>2]|0)+0|0;a=(c[e>>2]|0)+0|0;d=g+40|0;do{c[g>>2]=c[a>>2];g=g+4|0;a=a+4|0}while((g|0)<(d|0));b[(c[e>>2]|0)+8>>1]=1;c[(c[e>>2]|0)+24>>2]=0;i=f;return}function Sy(){return 31224}function Ty(f){f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;l=i;i=i+64|0;k=l;g=l+60|0;j=l+56|0;w=l+52|0;p=l+48|0;s=l+44|0;t=l+40|0;q=l+36|0;u=l+32|0;h=l+28|0;n=l+24|0;o=l+20|0;m=l+16|0;v=l+12|0;x=l+8|0;r=l+4|0;c[j>>2]=f;c[p>>2]=0;c[s>>2]=0;c[t>>2]=0;c[q>>2]=c[c[j>>2]>>2];c[h>>2]=0;c[n>>2]=(c[(c[j>>2]|0)+8>>2]|0)+40;hu(c[n>>2]|0,8);c[(c[j>>2]|0)+20>>2]=0;if((c[(c[j>>2]|0)+80>>2]|0)==7){a[(c[q>>2]|0)+64>>0]=1;c[g>>2]=1;x=c[g>>2]|0;i=l;return x|0}c[w>>2]=c[(c[j>>2]|0)+32>>2];a:do if((b[(c[j>>2]|0)+88>>1]&3|0)==1){c[t>>2]=(c[(c[j>>2]|0)+8>>2]|0)+360;if(e[(c[t>>2]|0)+8>>1]&16){c[p>>2]=((c[(c[t>>2]|0)+12>>2]|0)>>>0)/4|0;c[s>>2]=c[(c[t>>2]|0)+16>>2]}c[u>>2]=0;while(1){if((c[u>>2]|0)>=(c[p>>2]|0))break a;c[w>>2]=(c[w>>2]|0)+(c[(c[(c[s>>2]|0)+(c[u>>2]<<2)>>2]|0)+4>>2]|0);c[u>>2]=(c[u>>2]|0)+1}}while(0);do{y=(c[j>>2]|0)+76|0;f=c[y>>2]|0;c[y>>2]=f+1;c[u>>2]=f;if((c[u>>2]|0)>=(c[w>>2]|0))break;if((b[(c[j>>2]|0)+88>>1]&3|0)!=2)break}while((d[(c[(c[j>>2]|0)+4>>2]|0)+((c[u>>2]|0)*20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m+1416|0;w=m+1412|0;ia=m+1408|0;r=m+248|0;v=m+1404|0;C=m+1400|0;j=m+1396|0;s=m+1392|0;ef=m+1388|0;z=m+1384|0;A=m+1480|0;B=m+1380|0;ea=m+1376|0;fa=m+1372|0;ga=m+1368|0;ha=m+1364|0;lf=m+1360|0;mf=m+1356|0;da=m+240|0;Y=m+1678|0;aa=m+1478|0;Z=m+1476|0;$=m+1474|0;W=m+232|0;X=m+224|0;V=m+216|0;U=m+208|0;T=m+1352|0;S=m+1348|0;P=m+1320|0;R=m+1316|0;Q=m+1312|0;E=m+200|0;H=m+192|0;F=m+184|0;G=m+1677|0;J=m+1308|0;M=m+1676|0;K=m+1472|0;L=m+1470|0;ra=m+1304|0;la=m+1300|0;oa=m+1296|0;pa=m+1292|0;ka=m+1288|0;ja=m+1284|0;ma=m+1280|0;na=m+1276|0;sa=m+1272|0;ta=m+1268|0;ua=m+1264|0;Ga=m+176|0;va=m+1260|0;ya=m+1256|0;Fa=m+1252|0;za=m+1248|0;Ea=m+1244|0;of=m+1240|0;Ba=m+1236|0;nf=m+136|0;Da=m+1232|0;pf=m+1228|0;qf=m+1224|0;xa=m+1220|0;sf=m+1216|0;wa=m+1212|0;rf=m+1208|0;Ca=m+1468|0;Aa=m+1204|0;Ha=m+1200|0;Ia=m+1675|0;Pa=m+1196|0;Ja=m+1192|0;Ra=m+128|0;Ma=m+1188|0;Qa=m+120|0;Va=m+1184|0;Sa=m+1180|0;Ka=m+1176|0;Oa=m+1172|0;Ta=m+1168|0;Ya=m+1164|0;Xa=m+1160|0;Wa=m+1156|0;La=m+1152|0;Na=m+1148|0;Ua=m+1144|0;_a=m+112|0;Za=m+1140|0;fb=m+1136|0;bb=m+1132|0;$a=m+1128|0;ab=m+1124|0;cb=m+1120|0;hb=m+1116|0;gb=m+1112|0;eb=m+1108|0;ib=m+1104|0;db=m+1100|0;jb=m+1096|0;lb=m+1092|0;kb=m+1088|0;mb=m+1084|0;nb=m+1080|0;ob=m+1076|0;tb=m+1072|0;qb=m+1068|0;rb=m+1064|0;wb=m+1060|0;Bb=m+1056|0;yf=m+1052|0;xf=m+1048|0;uf=m+1044|0;zf=m+1040|0;wf=m+1036|0;vf=m+1032|0;tf=m+1028|0;Af=m+1024|0;Cb=m+1020|0;Eb=m+1016|0;Db=m+1012|0;Fb=m+1008|0;Gb=m+1004|0;Hb=m+1e3|0;Lb=m+996|0;Ib=m+992|0;Kb=m+988|0;Nb=m+968|0;Ob=m+964|0;Jb=m+104|0;Pb=m+960|0;Tb=m+956|0;Yb=m+952|0;Rb=m+948|0;Qb=m+944|0;Ub=m+940|0;Vb=m+936|0;Wb=m+916|0;Zb=m+1484|0;$b=m+912|0;ac=m+908|0;_b=m+904|0;bc=m+96|0;cc=m+88|0;ec=m+900|0;hc=m+896|0;gc=m+892|0;dc=m+888|0;fc=m+884|0;t=m+880|0;qc=m+876|0;mc=m+80|0;ic=m+872|0;oc=m+868|0;pc=m+864|0;jc=m+860|0;kc=m+856|0;lc=m+852|0;rc=m+848|0;sc=m+844|0;wc=m+840|0;uc=m+836|0;yc=m+832|0;Bc=m+828|0;Ac=m+824|0;zc=m+820|0;Cc=m+72|0;Gc=m+816|0;Dc=m+64|0;Ec=m+812|0;Fc=m+808|0;Kc=m+804|0;Hc=m+800|0;Ic=m+796|0;Jc=m+792|0;Cf=m+788|0;Df=m+784|0;Bf=m+780|0;Lc=m+776|0;Mc=m+772|0;Nc=m+768|0;Oc=m+764|0;Qc=m+760|0;Pc=m+756|0;Yc=m+752|0;Zc=m+748|0;hf=m+744|0;_c=m+724|0;Uc=m+720|0;Xc=m+716|0;Tc=m+56|0;fd=m+712|0;ad=m+708|0;ed=m+688|0;hd=m+684|0;id=m+680|0;jd=m+676|0;gd=m+672|0;ld=m+668|0;kd=m+664|0;nd=m+660|0;od=m+656|0;md=m+652|0;rd=m+648|0;sd=m+644|0;pd=m+640|0;qd=m+624|0;vd=m+616|0;ud=m+612|0;yd=m+608|0;xd=m+604|0;td=m+600|0;wd=m+596|0;zd=m+48|0;Ad=m+592|0;Cd=m+588|0;Hd=m+584|0;Nd=m+580|0;Fd=m+576|0;Md=m+572|0;Ld=m+568|0;Gd=m+564|0;Jd=m+560|0;Od=m+556|0;Pd=m+552|0;Qd=m+548|0;Rd=m+544|0;Yd=m+540|0;Td=m+536|0;Wd=m+532|0;$d=m+528|0;Sd=m+8|0;Ud=m+500|0;Zd=m+496|0;ae=m+492|0;he=m+488|0;ie=m+476|0;je=m+472|0;de=m+468|0;be=m+464|0;ce=m+460|0;ee=m+456|0;fe=m+452|0;ke=m+448|0;oe=m+1483|0;me=m+444|0;le=m+440|0;pe=m+436|0;re=m+432|0;qe=m+428|0;ue=m+424|0;te=m+420|0;Ae=m+416|0;ze=m+412|0;xe=m+408|0;Fe=m+404|0;Ee=m+400|0;ye=m+396|0;Ce=m+392|0;ve=m+388|0;we=m+384|0;De=m+380|0;Be=m+376|0;Je=m+372|0;Ke=m+368|0;Ge=m+364|0;He=m+336|0;Ie=m+332|0;Se=m+328|0;Oe=m+324|0;Ne=m+320|0;Re=m+316|0;Le=m+312|0;Me=m+308|0;We=m+304|0;Ve=m+300|0;Xe=m+296|0;_e=m+292|0;Ue=m;Ye=m+288|0;$e=m+284|0;Ze=m+1482|0;cf=m+280|0;bf=m+276|0;af=m+272|0;df=m+268|0;c[k>>2]=f;c[n>>2]=0;c[u>>2]=c[(c[k>>2]|0)+4>>2];c[l>>2]=0;c[q>>2]=c[c[k>>2]>>2];a[nc>>0]=0;a[x>>0]=a[(c[(c[(c[q>>2]|0)+16>>2]|0)+12>>2]|0)+77>>0]|0;c[qa>>2]=0;c[o>>2]=0;c[ba>>2]=0;c[$c>>2]=c[(c[k>>2]|0)+8>>2];c[jf>>2]=0;c[I>>2]=0;c[y>>2]=0;c[w>>2]=0;c[ia>>2]=0;f=(c[q>>2]|0)+32|0;Ff=c[f+4>>2]|0;Gf=r;c[Gf>>2]=c[f>>2];c[Gf+4>>2]=Ff;a:do if((c[(c[k>>2]|0)+80>>2]|0)==7)Ef=871;else{c[(c[k>>2]|0)+80>>2]=0;Gf=(c[k>>2]|0)+136|0;c[Gf>>2]=0;c[Gf+4>>2]=0;c[(c[k>>2]|0)+20>>2]=0;c[(c[q>>2]|0)+452>>2]=0;b:do if(!(c[(c[q>>2]|0)+240>>2]|0)){do if(c[(c[q>>2]|0)+292>>2]|0){c[ba>>2]=c[(c[k>>2]|0)+124>>2];f=c[(c[q>>2]|0)+300>>2]|0;if(!(c[ba>>2]|0)){c[ba>>2]=f;break}else{c[ba>>2]=((c[ba>>2]|0)>>>0)%(f>>>0)|0;break}}while(0);c[n>>2]=c[(c[k>>2]|0)+76>>2];c:while(1){if(c[l>>2]|0)break a;if(a[(c[q>>2]|0)+64>>0]|0){Ef=871;break a}c[o>>2]=(c[o>>2]|0)+1;c[p>>2]=(c[u>>2]|0)+((c[n>>2]|0)*20|0);if(d[(c[p>>2]|0)+2>>0]&2){c[w>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+8>>2]|0)*40|0);if(e[(c[w>>2]|0)+8>>1]&9312)_d(c[w>>2]|0);b[(c[w>>2]|0)+8>>1]=4}d:do switch(d[c[p>>2]>>0]|0){case 27:{Ef=57;break};case 21:{c[jf>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+4>>2]|0)*40|0);c[v>>2]=(c[u>>2]|0)+((c[c[jf>>2]>>2]|0)*20|0);c[n>>2]=(c[(c[v>>2]|0)+8>>2]|0)-1;b[(c[jf>>2]|0)+8>>1]=128;break};case 26:{f=c[(c[p>>2]|0)+16>>2]|0;Ff=c[f+4>>2]|0;Gf=c[w>>2]|0;c[Gf>>2]=c[f>>2];c[Gf+4>>2]=Ff;break};case 133:{b[(c[w>>2]|0)+8>>1]=8;h[c[w>>2]>>3]=+h[c[(c[p>>2]|0)+16>>2]>>3];break};case 97:{a[c[p>>2]>>0]=27;Gf=Mb(c[(c[p>>2]|0)+16>>2]|0)|0;c[(c[p>>2]|0)+4>>2]=Gf;if((d[x>>0]|0)!=1){c[l>>2]=Vd(c[w>>2]|0,c[(c[p>>2]|0)+16>>2]|0,-1,1,0)|0;if((c[l>>2]|0)==18){Ef=870;break c}if(yk(c[w>>2]|0,d[x>>0]|0)|0){Ef=871;break a}c[(c[w>>2]|0)+24>>2]=0;Gf=(c[w>>2]|0)+8|0;b[Gf>>1]=e[Gf>>1]|2048;if((a[(c[p>>2]|0)+1>>0]|0)==-1)Xb(c[q>>2]|0,c[(c[p>>2]|0)+16>>2]|0);a[(c[p>>2]|0)+1>>0]=-1;c[(c[p>>2]|0)+16>>2]=c[(c[w>>2]|0)+16>>2];c[(c[p>>2]|0)+4>>2]=c[(c[w>>2]|0)+12>>2]}if((c[(c[p>>2]|0)+4>>2]|0)>(c[(c[q>>2]|0)+88>>2]|0)){Ef=870;break c}else Ef=57;break};case 16:{c[n>>2]=(c[(c[p>>2]|0)+8>>2]|0)-1;Ef=16;break};case 25:{Ff=c[(c[p>>2]|0)+4>>2]|0;Gf=c[w>>2]|0;c[Gf>>2]=Ff;c[Gf+4>>2]=((Ff|0)<0)<<31>>31;break};case 23:{c[y>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+12>>2]|0)*40|0);if(e[(c[y>>2]|0)+8>>1]&1)Ef=28;break};case 28:{c[z>>2]=(c[(c[p>>2]|0)+12>>2]|0)-(c[(c[p>>2]|0)+8>>2]|0);Gf=((c[(c[p>>2]|0)+4>>2]|0)!=0?257:1)&65535;b[A>>1]=Gf;b[(c[w>>2]|0)+8>>1]=Gf;while(1){if((c[z>>2]|0)<=0)break d;c[w>>2]=(c[w>>2]|0)+40;_d(c[w>>2]|0);b[(c[w>>2]|0)+8>>1]=b[A>>1]|0;c[z>>2]=(c[z>>2]|0)+ -1}};case 30:{Vd(c[w>>2]|0,c[(c[p>>2]|0)+16>>2]|0,c[(c[p>>2]|0)+4>>2]|0,0,0)|0;a[(c[w>>2]|0)+10>>0]=a[x>>0]|0;break};case 31:{c[B>>2]=(c[(c[k>>2]|0)+60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:{c[w>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+4>>2]|0)*40|0);b[(c[w>>2]|0)+8>>1]=(e[(c[w>>2]|0)+8>>1]|1)&-129;break};case 24:{Ef=28;break};case 37:{c[jf>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+4>>2]|0)*40|0);Mp(c[jf>>2]|0)|0;Gf=c[(c[p>>2]|0)+8>>2]|0;Hf=c[jf>>2]|0;Ff=Hf;Gf=bF(c[Ff>>2]|0,c[Ff+4>>2]|0,Gf|0,((Gf|0)<0)<<31>>31|0)|0;c[Hf>>2]=Gf;c[Hf+4>>2]=D;break};case 38:{c[jf>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+4>>2]|0)*40|0);if((e[(c[jf>>2]|0)+8>>1]&4|0)==0?(Jp(c[jf>>2]|0,67,a[x>>0]|0),(e[(c[jf>>2]|0)+8>>1]&4|0)==0):0){if(!(c[(c[p>>2]|0)+8>>2]|0)){Ef=167;break c}c[n>>2]=(c[(c[p>>2]|0)+8>>2]|0)-1;break d}b[(c[jf>>2]|0)+8>>1]=e[(c[jf>>2]|0)+8>>1]&-16896|4;break};case 40:{c[jf>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+4>>2]|0)*40|0);if(e[(c[jf>>2]|0)+8>>1]&16384)f=Dd(c[jf>>2]|0)|0;else f=0;c[l>>2]=f;Cp(c[jf>>2]|0,c[(c[p>>2]|0)+8>>2]&255,a[x>>0]|0);break};case 39:{c[jf>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+4>>2]|0)*40|0);if(e[(c[jf>>2]|0)+8>>1]&4)Np(c[jf>>2]|0)|0;break};case 83:case 80:case 81:case 82:case 78:case 79:{c[jf>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+4>>2]|0)*40|0);c[y>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+12>>2]|0)*40|0);b[K>>1]=b[(c[jf>>2]|0)+8>>1]|0;b[L>>1]=b[(c[y>>2]|0)+8>>1]|0;f=d[(c[p>>2]|0)+3>>0]|0;do if((e[K>>1]|e[L>>1])&1){if(!(f&128)){f=c[p>>2]|0;if(d[(c[p>>2]|0)+3>>0]&32){c[w>>2]=(c[$c>>2]|0)+((c[f+8>>2]|0)*40|0);b[(c[w>>2]|0)+8>>1]=e[(c[w>>2]|0)+8>>1]&-16896|1;break d}if(!(d[f+3>>0]&16))break d;c[n>>2]=(c[(c[p>>2]|0)+8>>2]|0)-1;break d}if(((e[K>>1]&1|0)!=0?(e[L>>1]&1|0)!=0:0)?(e[L>>1]&256|0)==0:0){c[J>>2]=0;break}c[J>>2]=1}else{a[M>>0]=f&71;if((a[M>>0]|0)>=67){if((e[(c[jf>>2]|0)+8>>1]&14|0)==2)Pe(c[jf>>2]|0,0);if((e[(c[y>>2]|0)+8>>1]&14|0)==2)Pe(c[y>>2]|0,0)}else if((a[M>>0]|0)==66){if((e[(c[jf>>2]|0)+8>>1]&2|0)==0?(e[(c[jf>>2]|0)+8>>1]&12|0)!=0:0)Kp(c[jf>>2]|0,a[x>>0]|0,1)|0;if((e[(c[y>>2]|0)+8>>1]&2|0)==0?(e[(c[y>>2]|0)+8>>1]&12|0)!=0:0)Kp(c[y>>2]|0,a[x>>0]|0,1)|0}if(e[(c[jf>>2]|0)+8>>1]&16384){Dd(c[jf>>2]|0)|0;b[K>>1]=e[K>>1]&-16385}if(e[(c[y>>2]|0)+8>>1]&16384){Dd(c[y>>2]|0)|0;b[L>>1]=e[L>>1]&-16385}if(a[(c[q>>2]|0)+64>>0]|0){Ef=871;break a}c[J>>2]=bn(c[y>>2]|0,c[jf>>2]|0,c[(c[p>>2]|0)+16>>2]|0)|0}while(0);switch(d[c[p>>2]>>0]|0){case 79:{c[J>>2]=(c[J>>2]|0)==0&1;break};case 78:{c[J>>2]=(c[J>>2]|0)!=0&1;break};case 81:{c[J>>2]=(c[J>>2]|0)<=0&1;break};case 80:{c[J>>2]=(c[J>>2]|0)>0&1;break};case 82:{c[J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=Gf;if(a[P+25>>0]|0){if(c[P+20>>2]|0){Gf=(c[k>>2]|0)+44|0;Hf=c[q>>2]|0;c[g>>2]=Ed(c[P>>2]|0)|0;pn(Gf,Hf,1200,g);c[l>>2]=c[P+20>>2]}hz(c[k>>2]|0,c[n>>2]|0,c[(c[p>>2]|0)+4>>2]|0)}yk(c[P>>2]|0,d[x>>0]|0)|0;if(az(c[P>>2]|0)|0){Ef=870;break c}break};case 36:{if(c[(c[p>>2]|0)+4>>2]|0)Xd((c[$c>>2]|0)+((c[(c[p>>2]|0)+4>>2]|0)*40|0)|0,0,0);break};case 93:case 92:case 91:case 90:case 89:{c[jf>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+4>>2]|0)*40|0);b[Z>>1]=ez(c[jf>>2]|0)|0;c[I>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+8>>2]|0)*40|0);b[$>>1]=ez(c[I>>2]|0)|0;c[w>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+12>>2]|0)*40|0);b[aa>>1]=e[(c[jf>>2]|0)+8>>1]|e[(c[I>>2]|0)+8>>1];e:do if(!(e[aa>>1]&1)){do if(e[Z>>1]&e[$>>1]&4){f=c[jf>>2]|0;Hf=c[f+4>>2]|0;Gf=W;c[Gf>>2]=c[f>>2];c[Gf+4>>2]=Hf;Gf=c[I>>2]|0;Hf=c[Gf+4>>2]|0;f=X;c[f>>2]=c[Gf>>2];c[f+4>>2]=Hf;a[Y>>0]=1;f=d[c[p>>2]>>0]|0;if((f|0)==89){Hf=W;if(_m(X,c[Hf>>2]|0,c[Hf+4>>2]|0)|0)break}else if((f|0)==90){Hf=W;if(fz(X,c[Hf>>2]|0,c[Hf+4>>2]|0)|0)break}else if((f|0)==91){Hf=W;if(gz(X,c[Hf>>2]|0,c[Hf+4>>2]|0)|0)break}else if((f|0)==92){Hf=W;if((c[Hf>>2]|0)==0&(c[Hf+4>>2]|0)==0)break e;Gf=W;Hf=X;if(((c[Gf>>2]|0)==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+4>>2]=Gf;Hf=W;if((c[Hf>>2]|0)==0&(c[Hf+4>>2]|0)==0)break;Hf=W;if((c[Hf>>2]|0)==-1?(c[Hf+4>>2]|0)==-1:0){Hf=W;c[Hf>>2]=1;c[Hf+4>>2]=0}Gf=X;Hf=W;Hf=kF(c[Gf>>2]|0,c[Gf+4>>2]|0,c[Hf>>2]|0,c[Hf+4>>2]|0)|0;h[U>>3]=+(Hf>>>0)+4294967296.0*+(D|0)}if(!($w(+h[U>>3])|0)){h[c[w>>2]>>3]=+h[U>>3];b[(c[w>>2]|0)+8>>1]=e[(c[w>>2]|0)+8>>1]&-16896|8;if((a[Y>>0]|0)!=0?1:((e[Z>>1]|e[$>>1])&8|0)!=0)break d;Hp(c[w>>2]|0);break d}}while(0);_d(c[w>>2]|0);break};case 34:{c[jf>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+4>>2]|0)*40|0);c[w>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+8>>2]|0)*40|0);fn(c[w>>2]|0,c[jf>>2]|0,4096);break};case 35:{if(((c[(c[q>>2]|0)+292>>2]|0)!=0?(c[o>>2]|0)>>>0>=(c[ba>>2]|0)>>>0:0)?(ub[c[(c[q>>2]|0)+292>>2]&31](c[(c[q>>2]|0)+296>>2]|0)|0)!=0:0){Ef=76;break c}Hf=bz(c[k>>2]|0,0)|0;c[l>>2]=Hf;if(0==(Hf|0)?(c[l>>2]=cz(c[k>>2]|0,1)|0,(c[l>>2]|0)==0):0){Ef=79;break c}break};case 94:{c[jf>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+4>>2]|0)*40|0);c[I>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+8>>2]|0)*40|0);c[w>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+12>>2]|0)*40|0);if((e[(c[jf>>2]|0)+8>>1]|e[(c[I>>2]|0)+8>>1])&1){_d(c[w>>2]|0);break d}if((e[(c[jf>>2]|0)+8>>1]&16384|0)!=0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case 20:{c[w>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+4>>2]|0)*40|0);Gf=(c[(c[p>>2]|0)+12>>2]|0)-1|0;Hf=c[w>>2]|0;c[Hf>>2]=Gf;c[Hf+4>>2]=((Gf|0)<0)<<31>>31;b[(c[w>>2]|0)+8>>1]=4;if(c[(c[p>>2]|0)+8>>2]|0)c[n>>2]=(c[(c[p>>2]|0)+8>>2]|0)-1;break};case 18:{c[jf>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+4>>2]|0)*40|0);c[n>>2]=c[c[jf>>2]>>2];b[(c[jf>>2]|0)+8>>1]=128;break};case 32:{c[ea>>2]=c[(c[p>>2]|0)+12>>2];c[fa>>2]=c[(c[p>>2]|0)+4>>2];c[ga>>2]=c[(c[p>>2]|0)+8>>2];c[jf>>2]=(c[$c>>2]|0)+((c[fa>>2]|0)*40|0);c[w>>2]=(c[$c>>2]|0)+((c[ga>>2]|0)*40|0);do{Ry(c[w>>2]|0,c[jf>>2]|0);c[jf>>2]=(c[jf>>2]|0)+40;c[w>>2]=(c[w>>2]|0)+40;Hf=(c[ea>>2]|0)+ -1|0;c[ea>>2]=Hf}while((Hf|0)!=0);break};case 33:{c[ha>>2]=c[(c[p>>2]|0)+12>>2];c[jf>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+4>>2]|0)*40|0);c[w>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+8>>2]|0)*40|0);while(1){fn(c[w>>2]|0,c[jf>>2]|0,4096);if((e[(c[w>>2]|0)+8>>1]&4096|0)!=0?(Ak(c[w>>2]|0)|0)!=0:0){Ef=871;break a}Hf=c[ha>>2]|0;c[ha>>2]=Hf+ -1;if(!Hf)break d;c[w>>2]=(c[w>>2]|0)+40;c[jf>>2]=(c[jf>>2]|0)+40}};case 41:{c[ia>>2]=c[(c[p>>2]|0)+16>>2];break};case 42:{if(!(d[(c[p>>2]|0)+3>>0]&1))c[ia>>2]=0;c[ra>>2]=c[(c[p>>2]|0)+12>>2];c[ka>>2]=c[(c[p>>2]|0)+16>>2];c[oa>>2]=c[(c[p>>2]|0)+4>>2];c[pa>>2]=c[(c[p>>2]|0)+8>>2];c[la>>2]=0;while(1){if((c[la>>2]|0)>=(c[ra>>2]|0))break;f=c[la>>2]|0;if(c[ia>>2]|0)f=c[(c[ia>>2]|0)+(f<<2)>>2]|0;c[ja>>2]=f;c[ma>>2]=c[(c[ka>>2]|0)+20+(c[la>>2]<<2)>>2];c[na>>2]=d[(c[(c[ka>>2]|0)+16>>2]|0)+(c[la>>2]|0)>>0];c[qa>>2]=bn((c[$c>>2]|0)+(((c[oa>>2]|0)+(c[ja>>2]|0)|0)*40|0)|0,(c[$c>>2]|0)+(((c[pa>>2]|0)+(c[ja>>2]|0)|0)*40|0)|0,c[ma>>2]|0)|0;if(c[qa>>2]|0){Ef=224;break}c[la>>2]=(c[la>>2]|0)+1}if((Ef|0)==224?(Ef=0,(c[na>>2]|0)!=0):0)c[qa>>2]=0-(c[qa>>2]|0);c[ia>>2]=0;break};case 43:{if((c[qa>>2]|0)<0){c[n>>2]=(c[(c[p>>2]|0)+4>>2]|0)-1;break d}f=c[p>>2]|0;if(!(c[qa>>2]|0)){c[n>>2]=(c[f+8>>2]|0)-1;break d}else{c[n>>2]=(c[f+12>>2]|0)-1;break d}};case 71:case 72:{c[jf>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+4>>2]|0)*40|0);if(e[(c[jf>>2]|0)+8>>1]&1)c[sa>>2]=2;else{Hf=Kd(c[jf>>2]|0)|0;c[sa>>2]=((Hf|0)!=0|(D|0)!=0)&1}c[I>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+8>>2]|0)*40|0);if(e[(c[I>>2]|0)+8>>1]&1)c[ta>>2]=2;else{Hf=Kd(c[I>>2]|0)|0;c[ta>>2]=((Hf|0)!=0|(D|0)!=0)&1}f=((c[sa>>2]|0)*3|0)+(c[ta>>2]|0)|0;if((d[c[p>>2]>>0]|0)==72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8>>1]&1)){c[ua>>2]=+Id(c[jf>>2]|0)!=0.0&1;if((d[c[p>>2]>>0]|0)==46)c[ua>>2]=((c[ua>>2]|0)!=0^1)&1}else c[ua>>2]=c[(c[p>>2]|0)+12>>2];if(c[ua>>2]|0)c[n>>2]=(c[(c[p>>2]|0)+8>>2]|0)-1;break};case 76:{c[jf>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+4>>2]|0)*40|0);if(e[(c[jf>>2]|0)+8>>1]&1)c[n>>2]=(c[(c[p>>2]|0)+8>>2]|0)-1;break};case 77:{c[jf>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+4>>2]|0)*40|0);if(!(e[(c[jf>>2]|0)+8>>1]&1))c[n>>2]=(c[(c[p>>2]|0)+8>>2]|0)-1;break};case 47:{c[va>>2]=c[(c[p>>2]|0)+8>>2];c[Ba>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+12>>2]|0)*40|0);c[ya>>2]=c[(c[(c[k>>2]|0)+56>>2]|0)+(c[(c[p>>2]|0)+4>>2]<<2)>>2];c[za>>2]=c[(c[ya>>2]|0)+80>>2];c[Fa>>2]=c[c[ya>>2]>>2];c[l>>2]=iz(c[ya>>2]|0)|0;if(c[l>>2]|0)break c;f=c[ya>>2]|0;f:do if((c[(c[ya>>2]|0)+60>>2]|0)==(c[(c[k>>2]|0)+72>>2]|0))if((e[f+22>>1]|0)<=(c[va>>2]|0))Ef=284;else Ef=308;else{do if(a[f+25>>0]|0)if(!(c[Fa>>2]|0)){c[Aa>>2]=(c[$c>>2]|0)+((c[(c[ya>>2]|0)+16>>2]|0)*40|0);Hf=c[(c[Aa>>2]|0)+12>>2]|0;c[wa>>2]=Hf;c[(c[ya>>2]|0)+68>>2]=Hf;c[(c[ya>>2]|0)+64>>2]=Hf;c[(c[ya>>2]|0)+76>>2]=c[(c[Aa>>2]|0)+16>>2];break}else{_d(c[Ba>>2]|0);break f}else{f=c[Fa>>2]|0;if(!((d[(c[ya>>2]|0)+27>>0]|0)>>>2&1)){Ly(f,Ga)|0;Hf=jz(c[Fa>>2]|0,wa)|0;c[(c[ya>>2]|0)+76>>2]=Hf;c[(c[ya>>2]|0)+64>>2]=c[Ga>>2]}else{kz(f,(c[ya>>2]|0)+64|0)|0;Hf=lz(c[Fa>>2]|0,wa)|0;c[(c[ya>>2]|0)+76>>2]=Hf}if((c[(c[ya>>2]|0)+64>>2]|0)>>>0<=(c[wa>>2]|0)>>>0)c[(c[ya>>2]|0)+68>>2]=c[(c[ya>>2]|0)+64>>2];else c[(c[ya>>2]|0)+68>>2]=c[wa>>2];if((c[(c[ya>>2]|0)+64>>2]|0)>>>0>(c[(c[q>>2]|0)+88>>2]|0)>>>0){Ef=870;break c}}while(0);c[(c[ya>>2]|0)+60>>2]=c[(c[k>>2]|0)+72>>2];f=c[(c[ya>>2]|0)+76>>2]|0;if((d[c[(c[ya>>2]|0)+76>>2]>>0]|0)<128){c[xa>>2]=d[f>>0];f=1}else f=(Rw(f,xa)|0)&255;c[(c[ya>>2]|0)+72>>2]=f&255;b[(c[ya>>2]|0)+22>>1]=0;c[c[za>>2]>>2]=c[xa>>2];if((c[xa>>2]|0)>>>0<=98307?(c[xa>>2]|0)>>>0<=(c[(c[ya>>2]|0)+64>>2]|0)>>>0:0){if((c[wa>>2]|0)>>>0>=(c[xa>>2]|0)>>>0){Ef=284;break}c[(c[ya>>2]|0)+76>>2]=0;c[(c[ya>>2]|0)+68>>2]=0;Ef=284;break}c[l>>2]=kj(71391)|0;break d}while(0);do if((Ef|0)==284){Ef=0;do if((c[(c[ya>>2]|0)+72>>2]|0)>>>0<(c[c[za>>2]>>2]|0)>>>0){if(!(c[(c[ya>>2]|0)+76>>2]|0)){Ff=nf+0|0;f=Ff+40|0;do{c[Ff>>2]=0;Ff=Ff+4|0}while((Ff|0)<(f|0));c[l>>2]=mz(c[Fa>>2]|0,0,c[c[za>>2]>>2]|0,(((d[(c[ya>>2]|0)+27>>0]|0)>>>2&1|0)!=0^1)&1,nf)|0;if(c[l>>2]|0)break d;c[Da>>2]=c[nf+16>>2]}else c[Da>>2]=c[(c[ya>>2]|0)+76>>2];c[of>>2]=e[(c[ya>>2]|0)+22>>1];c[xa>>2]=c[(c[za>>2]|0)+(c[of>>2]<<2)>>2];c[pf>>2]=(c[Da>>2]|0)+(c[(c[ya>>2]|0)+72>>2]|0);c[qf>>2]=(c[Da>>2]|0)+(c[c[za>>2]>>2]|0);do{f=c[pf>>2]|0;if((d[c[pf>>2]>>0]|0)<128){c[rf>>2]=d[f>>0];c[pf>>2]=(c[pf>>2]|0)+1}else{Hf=(Rw(f,rf)|0)&255;c[pf>>2]=(c[pf>>2]|0)+Hf}c[(c[ya>>2]|0)+84+(c[of>>2]<<2)>>2]=c[rf>>2];c[sf>>2]=Ww(c[rf>>2]|0)|0;c[xa>>2]=(c[xa>>2]|0)+(c[sf>>2]|0);if((c[xa>>2]|0)>>>0<(c[sf>>2]|0)>>>0){Ef=294;break}c[of>>2]=(c[of>>2]|0)+1;c[(c[za>>2]|0)+(c[of>>2]<<2)>>2]=c[xa>>2];if((c[of>>2]|0)>(c[va>>2]|0))break}while((c[pf>>2]|0)>>>0<(c[qf>>2]|0)>>>0);if((Ef|0)==294){Ef=0;c[pf>>2]=(c[qf>>2]|0)+1}b[(c[ya>>2]|0)+22>>1]=c[of>>2];c[(c[ya>>2]|0)+72>>2]=(c[pf>>2]|0)-(c[Da>>2]|0);if(!(c[(c[ya>>2]|0)+76>>2]|0)){Bd(nf);b[nf+8>>1]=1}if((c[pf>>2]|0)>>>0>=(c[qf>>2]|0)>>>0){if((c[pf>>2]|0)>>>0<=(c[qf>>2]|0)>>>0?(c[xa>>2]|0)==(c[(c[ya>>2]|0)+64>>2]|0):0)Ef=302}else Ef=302;if((Ef|0)==302?(Ef=0,(c[xa>>2]|0)>>>0<=(c[(c[ya>>2]|0)+64>>2]|0)>>>0):0)break;c[l>>2]=kj(71475)|0;break d}while(0);if((e[(c[ya>>2]|0)+22>>1]|0)<=(c[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]=f&1;if(!((c[ib>>2]|0)!=0&(c[fb>>2]|0)==1)){c[gb>>2]=(c[(c[q>>2]|0)+496>>2]|0)-(c[gb>>2]|0)-1;g:do if((c[fb>>2]|0)==2){c[db>>2]=(c[(c[q>>2]|0)+24>>2]&2|0)!=0&1;c[eb>>2]=0;while(1){if((c[eb>>2]|0)>=(c[(c[q>>2]|0)+20>>2]|0))break g;c[l>>2]=sz(c[(c[(c[q>>2]|0)+16>>2]|0)+(c[eb>>2]<<4)+4>>2]|0,516,(c[db>>2]|0)==0&1)|0;if(c[l>>2]|0)break c;c[eb>>2]=(c[eb>>2]|0)+1}}else c[db>>2]=0;while(0);c[eb>>2]=0;while(1){if((c[eb>>2]|0)>=(c[(c[q>>2]|0)+20>>2]|0))break;c[l>>2]=tz(c[(c[(c[q>>2]|0)+16>>2]|0)+(c[eb>>2]<<4)+4>>2]|0,c[fb>>2]|0,c[gb>>2]|0)|0;if(c[l>>2]|0)break c;c[eb>>2]=(c[eb>>2]|0)+1}if(c[db>>2]|0){gf(c[q>>2]|0);cd(c[q>>2]|0);c[(c[q>>2]|0)+24>>2]=c[(c[q>>2]|0)+24>>2]|2}}else{Hf=bz(c[k>>2]|0,1)|0;c[l>>2]=Hf;if(Hf){Ef=869;break c}a[(c[q>>2]|0)+62>>0]=1;if(($y(c[k>>2]|0)|0)==5){Ef=381;break c}a[(c[q>>2]|0)+69>>0]=0;c[l>>2]=c[(c[k>>2]|0)+80>>2]}while(1){if((c[(c[q>>2]|0)+488>>2]|0)==(c[cb>>2]|0))break;c[hb>>2]=c[(c[q>>2]|0)+488>>2];c[(c[q>>2]|0)+488>>2]=c[(c[hb>>2]|0)+24>>2];Xb(c[q>>2]|0,c[hb>>2]|0);Hf=(c[q>>2]|0)+496|0;c[Hf>>2]=(c[Hf>>2]|0)+ -1}f=c[cb>>2]|0;if((c[fb>>2]|0)==1){c[(c[q>>2]|0)+488>>2]=c[f+24>>2];Xb(c[q>>2]|0,c[cb>>2]|0);if(!(c[ib>>2]|0)){Hf=(c[q>>2]|0)+496|0;c[Hf>>2]=(c[Hf>>2]|0)+ -1}}else{Hf=f+8|0;Gf=c[Hf+4>>2]|0;Ff=(c[q>>2]|0)+504|0;c[Ff>>2]=c[Hf>>2];c[Ff+4>>2]=Gf;Ff=(c[cb>>2]|0)+16|0;Gf=c[Ff+4>>2]|0;Hf=(c[q>>2]|0)+512|0;c[Hf>>2]=c[Ff>>2];c[Hf+4>>2]=Gf}if((c[ib>>2]|0)==0?(c[l>>2]=rz(c[q>>2]|0,c[fb>>2]|0,c[gb>>2]|0)|0,(c[l>>2]|0)!=0):0)break c;break};case 3:{c[jb>>2]=c[(c[p>>2]|0)+4>>2];c[lb>>2]=c[(c[p>>2]|0)+8>>2];if(c[jb>>2]|0)f=(a[(c[q>>2]|0)+62>>0]|0)!=0^1;else f=0;c[kb>>2]=f&1;if(!((c[kb>>2]|0)==0|(c[lb>>2]|0)!=0)?(c[(c[q>>2]|0)+156>>2]|0)>0:0){pn((c[k>>2]|0)+44|0,c[q>>2]|0,31576,g);c[l>>2]=5;break d}if((c[jb>>2]|0)!=(d[(c[q>>2]|0)+62>>0]|0)){Ef=409;break c}if(c[jb>>2]|0)f=(c[lb>>2]|0)!=0?31680:31728;else f=31632;pn((c[k>>2]|0)+44|0,c[q>>2]|0,f,g);c[l>>2]=1;break};case 4:{if((c[(c[p>>2]|0)+8>>2]|0)!=0?(c[(c[q>>2]|0)+24>>2]&33554432|0)!=0:0){Ef=422;break c}c[mb>>2]=c[(c[(c[q>>2]|0)+16>>2]|0)+(c[(c[p>>2]|0)+4>>2]<<4)+4>>2];if(c[mb>>2]|0){c[l>>2]=Rc(c[mb>>2]|0,c[(c[p>>2]|0)+8>>2]|0)|0;if((c[l>>2]|0)==5){Ef=425;break c}if(c[l>>2]|0)break c;do if((c[(c[p>>2]|0)+8>>2]|0)!=0?((e[(c[k>>2]|0)+88>>1]|0)>>>7&1|0)!=0:0){if((d[(c[q>>2]|0)+62>>0]|0)!=0?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c[$c>>2]|0)+((c[(c[p>>2]|0)+8>>2]|0)*40|0);c[l>>2]=Gw(c[Zc>>2]|0,_c,0,0,0,hf)|0;if((c[l>>2]|0)==0&(c[hf>>2]|0)==0)c[l>>2]=Ez(c[Zc>>2]|0)|0;c[(c[Yc>>2]|0)+60>>2]=0;break};case 116:case 115:case 114:case 113:{c[fd>>2]=c[(c[(c[k>>2]|0)+56>>2]|0)+(c[(c[p>>2]|0)+4>>2]<<2)>>2];c[ed>>2]=c[(c[fd>>2]|0)+8>>2];b[ed+4>>1]=c[(c[p>>2]|0)+16>>2];f=ed+6|0;if((d[c[p>>2]>>0]|0)<115)a[f>>0]=-1;else a[f>>0]=0;c[ed+8>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+12>>2]|0)*40|0);c[ad>>2]=0;c[l>>2]=Oz(c[q>>2]|0,c[fd>>2]|0,ed,ad)|0;f=c[ad>>2]|0;if((d[c[p>>2]>>0]&1|0)==1)c[ad>>2]=0-f;else c[ad>>2]=f+1;if((c[ad>>2]|0)>0)c[n>>2]=(c[(c[p>>2]|0)+8>>2]|0)-1;break};case 117:{c[id>>2]=0;c[jd>>2]=c[(c[q>>2]|0)+4>>2];while(1){if(!(c[jd>>2]|0))break;if((((c[(c[jd>>2]|0)+40>>2]|0)==-1108210269?((e[(c[jd>>2]|0)+88>>1]|0)>>>9&1|0)!=0:0)?((e[(c[jd>>2]|0)+88>>1]|0)>>>2&3|0)<2:0)?(c[(c[jd>>2]|0)+76>>2]|0)>=0:0)c[id>>2]=(c[id>>2]|0)+1;c[jd>>2]=c[(c[jd>>2]|0)+52>>2]}b[(c[w>>2]|0)+8>>1]=1;if((c[id>>2]|0)>1){c[l>>2]=6;a[(c[k>>2]|0)+86>>0]=2;break d}c[gd>>2]=c[(c[p>>2]|0)+12>>2];c[hd>>2]=0;c[l>>2]=Pz(c[(c[(c[q>>2]|0)+16>>2]|0)+(c[gd>>2]<<4)+4>>2]|0,c[(c[p>>2]|0)+4>>2]|0,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2]=((Gf|0)<0)<<31>>31;break};case 123:{c[l>>2]=fs(c[q>>2]|0,c[(c[p>>2]|0)+4>>2]|0)|0;break};case 124:{Uz(c[q>>2]|0,c[(c[p>>2]|0)+4>>2]|0,c[(c[p>>2]|0)+16>>2]|0);break};case 122:{c[rd>>2]=c[(c[p>>2]|0)+4>>2];c[sd>>2]=(c[rd>>2]|0)==1?14904:14928;c[qd>>2]=c[q>>2];c[qd+8>>2]=c[(c[p>>2]|0)+4>>2];c[qd+4>>2]=(c[k>>2]|0)+44;Hf=c[q>>2]|0;Ff=c[sd>>2]|0;Gf=c[(c[p>>2]|0)+16>>2]|0;c[g>>2]=c[(c[(c[q>>2]|0)+16>>2]|0)+(c[rd>>2]<<4)>>2];c[g+4>>2]=Ff;c[g+8>>2]=Gf;c[pd>>2]=Te(Hf,31776,g)|0;if(!(c[pd>>2]|0))c[l>>2]=7;else{a[(c[q>>2]|0)+145>>0]=1;c[qd+12>>2]=0;c[l>>2]=kf(c[q>>2]|0,c[pd>>2]|0,6,qd,0)|0;if(!(c[l>>2]|0))c[l>>2]=c[qd+12>>2];Xb(c[q>>2]|0,c[pd>>2]|0);a[(c[q>>2]|0)+145>>0]=0}if(c[l>>2]|0)cd(c[q>>2]|0);if((c[l>>2]|0)==7){Ef=871;break a}break};case 126:{Wz(c[q>>2]|0,c[(c[p>>2]|0)+4>>2]|0,c[(c[p>>2]|0)+16>>2]|0);break};case 127:{c[vd>>2]=c[(c[p>>2]|0)+8>>2];c[ud>>2]=Qe(c[q>>2]|0,(c[vd>>2]|0)+1<<2,0)|0;if(!(c[ud>>2]|0)){Ef=871;break a}c[wd>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+12>>2]|0)*40|0);c[jf>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+4>>2]|0)*40|0);c[yd>>2]=0;while(1){f=c[yd>>2]|0;if((c[yd>>2]|0)>=(c[vd>>2]|0))break;Hf=Kd((c[jf>>2]|0)+(f*40|0)|0)|0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>2]=c[ee>>2];c[fe>>2]=ug(c[be>>2]|0,1)|0;do if((c[ce>>2]|0)==5){if((Mb(c[fe>>2]|0)|0)!=0?(bA(c[be>>2]|0)|0)!=0:0)break;c[ce>>2]=c[ee>>2]}while(0);do if((c[ce>>2]|0)!=(c[ee>>2]|0)?(c[ee>>2]|0)==5|(c[ce>>2]|0)==5:0){if((a[(c[q>>2]|0)+62>>0]|0)!=0?(c[(c[q>>2]|0)+152>>2]|0)<=1:0){do if((c[ee>>2]|0)==5){c[l>>2]=cA(c[be>>2]|0)|0;if(c[l>>2]|0)break;dA(c[be>>2]|0,c[ce>>2]|0)|0}else{if((c[ee>>2]|0)!=4)break;dA(c[be>>2]|0,2)|0}while(0);if(c[l>>2]|0)break;c[l>>2]=dd(c[de>>2]|0,(c[ce>>2]|0)==5?2:1)|0;break}c[l>>2]=1;Gf=(c[k>>2]|0)+44|0;Hf=c[q>>2]|0;c[g>>2]=(c[ce>>2]|0)==5?31936:31944;pn(Gf,Hf,31880,g);break d}while(0);if(c[l>>2]|0)c[ce>>2]=c[ee>>2];c[ce>>2]=dA(c[be>>2]|0,c[ce>>2]|0)|0;c[w>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+8>>2]|0)*40|0);b[(c[w>>2]|0)+8>>1]=2562;Hf=Rt(c[ce>>2]|0)|0;c[(c[w>>2]|0)+16>>2]=Hf;Hf=Mb(c[(c[w>>2]|0)+16>>2]|0)|0;c[(c[w>>2]|0)+12>>2]=Hf;a[(c[w>>2]|0)+10>>0]=1;yk(c[w>>2]|0,d[x>>0]|0)|0;break};case 11:{c[ie>>2]=0;c[ie+8>>2]=-1;c[ie+4>>2]=-1;c[l>>2]=Zf(c[q>>2]|0,c[(c[p>>2]|0)+4>>2]|0,c[(c[p>>2]|0)+8>>2]|0,ie+4|0,ie+8|0)|0;if((c[l>>2]|0)==5){c[l>>2]=0;c[ie>>2]=1}c[he>>2]=0;c[je>>2]=(c[$c>>2]|0)+((c[(c[p>>2]|0)+12>>2]|0)*40|0);while(1){if((c[he>>2]|0)>=3)break d;Hf=c[ie+(c[he>>2]<<2)>>2]|0;Xd(c[je>>2]|0,Hf,((Hf|0)<0)<<31>>31);c[he>>2]=(c[he>>2]|0)+1;c[je>>2]=(c[je>>2]|0)+40}};case 141:{c[ke>>2]=c[(c[(c[q>>2]|0)+16>>2]|0)+(c[(c[p>>2]|0)+4>>2]<<4)+4>>2];c[l>>2]=fA(c[ke>>2]|0)|0;if((c[l>>2]|0)==101){c[n>>2]=(c[(c[p>>2]|0)+8>>2]|0)-1;c[l>>2]=0}break};case 142:if(c[(c[p>>2]|0)+4>>2]|0){Hf=(c[k>>2]|0)+88|0;b[Hf>>1]=b[Hf>>1]&-33|32;break d}else{gf(c[q>>2]|0);break d};case 13:{c[l>>2]=eA((c[k>>2]|0)+44|0,c[q>>2]|0)|0;break};case 143:{a[oe>>0]=c[(c[p>>2]|0)+12>>2];if((d[oe>>0]|0)==0?0!=(c[(c[q>>2]|0)+24>>2]&16384|0):0)break d;c[me>>2]=c[(c[p>>2]|0)+4>>2];c[l>>2]=gA(c[(c[(c[q>>2]|0)+16>>2]|0)+(c[me>>2]<<4)+4>>2]|0,c[(c[p>>2]|0)+8>>2]|0,a[oe>>0]|0)|0;if((c[l>>2]&255|0)==6){c[le>>2]=c[(c[p>>2]|0)+16>>2];Gf=(c[k>>2]|0)+44|0;Hf=c[q>>2]|0;c[g>>2]=c[le>>2];pn(Gf,Hf,31952,g)}break};case 145:{c[l>>2]=iA(c[q>>2]|0,c[(c[p>>2]|0)+4>>2]|0,c[(c[p>>2]|0)+16>>2]|0,(c[k>>2]|0)+44|0)|0;break};case 146:{Hf=(c[k>>2]|0)+88|0;b[Hf>>1]=b[Hf>>1]&-13|8;c[l>>2]=jA(c[q>>2]|0,c[(c[p>>2]|0)+4>>2]|0,c[(c[p>>2]|0)+16>>2]|0)|0;Hf=(c[k>>2]|0)+88|0;b[Hf>>1]=b[Hf>>1]&-13;break};case 144:{c[pe>>2]=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2]|0)+64>>0]=a[h>>0]|0;c[(c[f>>2]|0)+52>>2]=c[e>>2];b=c[e>>2]|0;i=d;return b|0}function Xy(a){a=a|0;var b=0,d=0;b=i;i=i+16|0;d=b;c[d>>2]=a;a=Yy(c[(c[d>>2]|0)+208>>2]|0)|0;i=b;return a|0}function Yy(a){a=a|0;var b=0,d=0,e=0;b=i;i=i+16|0;e=b+4|0;d=b;c[e>>2]=a;c[d>>2]=0;if(!(c[e>>2]|0)){e=c[d>>2]|0;i=b;return e|0}c[d>>2]=c[(c[e>>2]|0)+12>>2];c[(c[e>>2]|0)+12>>2]=0;e=c[d>>2]|0;i=b;return e|0}function Zy(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;e=d;c[f>>2]=a;c[e>>2]=b;c[(c[f>>2]|0)+80>>2]=c[e>>2];a=(c[f>>2]|0)+84|0;c[a>>2]=(c[a>>2]|0)+(c[e>>2]|0);i=d;return}function _y(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;d=i;i=i+16|0;b=d+4|0;e=d;c[b>>2]=a;c[e>>2]=c[c[b>>2]>>2];c[(c[e>>2]|0)+200>>2]=c[(c[b>>2]|0)+16>>2];c[(c[e>>2]|0)+196>>2]=c[(c[b>>2]|0)+56>>2];c[(c[e>>2]|0)+4>>2]=c[(c[b>>2]|0)+8>>2];c[(c[e>>2]|0)+32>>2]=c[(c[b>>2]|0)+48>>2];c[(c[e>>2]|0)+8>>2]=c[(c[b>>2]|0)+12>>2];c[(c[e>>2]|0)+28>>2]=c[(c[b>>2]|0)+52>>2];c[(c[e>>2]|0)+56>>2]=c[(c[b>>2]|0)+20>>2];c[(c[e>>2]|0)+36>>2]=c[(c[b>>2]|0)+40>>2];g=(c[b>>2]|0)+32|0;f=c[g+4>>2]|0;a=(c[c[e>>2]>>2]|0)+32|0;c[a>>2]=c[g>>2];c[a+4>>2]=f;c[(c[e>>2]|0)+92>>2]=c[(c[b>>2]|0)+68>>2];i=d;return c[(c[b>>2]|0)+44>>2]|0}function $y(b){b=b|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0;f=i;i=i+32|0;k=f+24|0;j=f+20|0;o=f+16|0;h=f+12|0;n=f+8|0;g=f+4|0;l=f;c[j>>2]=b;c[h>>2]=c[c[j>>2]>>2];if(a[(c[c[j>>2]>>2]|0)+64>>0]|0)c[(c[j>>2]|0)+80>>2]=7;if(c[(c[j>>2]|0)+200>>2]|0)_E(c[(c[j>>2]|0)+200>>2]|0,0,c[(c[j>>2]|0)+196>>2]|0)|0;OC(c[j>>2]|0);if((c[(c[j>>2]|0)+40>>2]|0)!=-1108210269){c[k>>2]=0;b=c[k>>2]|0;i=f;return b|0}if((c[(c[j>>2]|0)+76>>2]|0)>=0?((e[(c[j>>2]|0)+88>>1]|0)>>>9&1|0)!=0:0){c[g>>2]=0;c[n>>2]=c[(c[j>>2]|0)+80>>2]&255;if((c[n>>2]|0)==7|(c[n>>2]|0)==10|(c[n>>2]|0)==9)b=1;else b=(c[n>>2]|0)==13;c[l>>2]=b&1;do if((c[l>>2]|0)!=0?(c[n>>2]|0)!=9?1:((e[(c[j>>2]|0)+88>>1]|0)>>>8&1|0)==0:0){if((c[n>>2]|0)==7|(c[n>>2]|0)==13?((e[(c[j>>2]|0)+88>>1]|0)>>>7&1|0)!=0:0){c[g>>2]=2;break}Ik(c[h>>2]|0,516);Jk(c[h>>2]|0);a[(c[h>>2]|0)+62>>0]=1}while(0);if(!(c[(c[j>>2]|0)+80>>2]|0))bz(c[j>>2]|0,0)|0;if((c[(c[h>>2]|0)+304>>2]|0)>0?(c[(c[h>>2]|0)+328>>2]|0)==0:0)m=38;else if((d[(c[h>>2]|0)+62>>0]|0)!=0?(c[(c[h>>2]|0)+156>>2]|0)==(((e[(c[j>>2]|0)+88>>1]|0)>>>8&1|0)==0|0):0){if((c[(c[j>>2]|0)+80>>2]|0)!=0?(c[l>>2]|0)!=0?1:(d[(c[j>>2]|0)+86>>0]|0)!=3:0)Ik(c[h>>2]|0,0);else m=25;do if((m|0)==25){c[o>>2]=bz(c[j>>2]|0,1)|0;do if(c[o>>2]|0){if(!((e[(c[j>>2]|0)+88>>1]|0)>>>8&1)){c[o>>2]=787;break}c[k>>2]=1;b=c[k>>2]|0;i=f;return b|0}else c[o>>2]=PC(c[h>>2]|0,c[j>>2]|0)|0;while(0);if((c[o>>2]|0)==5?((e[(c[j>>2]|0)+88>>1]|0)>>>8&1|0)!=0:0){c[k>>2]=5;b=c[k>>2]|0;i=f;return b|0}if(c[o>>2]|0){c[(c[j>>2]|0)+80>>2]=c[o>>2];Ik(c[h>>2]|0,0);break}else{b=(c[h>>2]|0)+504|0;c[b>>2]=0;c[b+4>>2]=0;b=(c[h>>2]|0)+512|0;c[b>>2]=0;c[b+4>>2]=0;b=(c[h>>2]|0)+24|0;c[b>>2]=c[b>>2]&-16777217;bs(c[h>>2]|0);break}}while(0);c[(c[h>>2]|0)+500>>2]=0}else m=38;do if((m|0)==38?(c[g>>2]|0)==0:0){if((c[(c[j>>2]|0)+80>>2]|0)!=0?(d[(c[j>>2]|0)+86>>0]|0)!=3:0)if((d[(c[j>>2]|0)+86>>0]|0)==2){c[g>>2]=2;break}else{Ik(c[h>>2]|0,516);Jk(c[h>>2]|0);a[(c[h>>2]|0)+62>>0]=1;break}c[g>>2]=1}while(0);if((c[g>>2]|0)!=0?(c[o>>2]=cz(c[j>>2]|0,c[g>>2]|0)|0,(c[o>>2]|0)!=0):0){if(!((c[(c[j>>2]|0)+80>>2]|0)!=0?(c[(c[j>>2]|0)+80>>2]&255|0)!=19:0)){c[(c[j>>2]|0)+80>>2]=c[o>>2];Xb(c[h>>2]|0,c[(c[j>>2]|0)+44>>2]|0);c[(c[j>>2]|0)+44>>2]=0}Ik(c[h>>2]|0,516);Jk(c[h>>2]|0);a[(c[h>>2]|0)+62>>0]=1}if((e[(c[j>>2]|0)+88>>1]|0)>>>4&1){l=c[h>>2]|0;if((c[g>>2]|0)!=2)Zy(l,c[(c[j>>2]|0)+92>>2]|0);else Zy(l,0);c[(c[j>>2]|0)+92>>2]=0}}if((c[(c[j>>2]|0)+76>>2]|0)>=0){b=(c[h>>2]|0)+148|0;c[b>>2]=(c[b>>2]|0)+ -1;if(!((e[(c[j>>2]|0)+88>>1]|0)>>>8&1)){b=(c[h>>2]|0)+156|0;c[b>>2]=(c[b>>2]|0)+ -1}if((e[(c[j>>2]|0)+88>>1]|0)>>>9&1){b=(c[h>>2]|0)+152|0;c[b>>2]=(c[b>>2]|0)+ -1}}c[(c[j>>2]|0)+40>>2]=1369188723;if(a[(c[c[j>>2]>>2]|0)+64>>0]|0)c[(c[j>>2]|0)+80>>2]=7;c[k>>2]=(c[(c[j>>2]|0)+80>>2]|0)==5?5:0;b=c[k>>2]|0;i=f;return b|0}function az(a){a=a|0;var b=0,d=0,f=0,g=0;b=i;i=i+16|0;d=b+8|0;g=b+4|0;f=b;c[g>>2]=a;if(!((e[(c[g>>2]|0)+8>>1]|0)&18)){c[d>>2]=0;g=c[d>>2]|0;i=b;return g|0}c[f>>2]=c[(c[g>>2]|0)+12>>2];if((e[(c[g>>2]|0)+8>>1]|0)&16384)c[f>>2]=(c[f>>2]|0)+(c[c[g>>2]>>2]|0);c[d>>2]=(c[f>>2]|0)>(c[(c[(c[g>>2]|0)+32>>2]|0)+88>>2]|0)&1;g=c[d>>2]|0;i=b;return g|0}function bz(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0;k=i;i=i+32|0;h=k;j=k+16|0;f=k+12|0;l=k+8|0;g=k+4|0;c[f>>2]=b;c[l>>2]=d;c[g>>2]=c[c[f>>2]>>2];if(!((c[l>>2]|0)!=0?(d=(c[g>>2]|0)+504|0,b=(c[g>>2]|0)+512|0,b=bF(c[d>>2]|0,c[d+4>>2]|0,c[b>>2]|0,c[b+4>>2]|0)|0,d=D,(d|0)>0|(d|0)==0&b>>>0>0):0))e=3;do if((e|0)==3){if((c[l>>2]|0)==0?(b=(c[f>>2]|0)+144|0,d=c[b+4>>2]|0,(d|0)>0|(d|0)==0&(c[b>>2]|0)>>>0>0):0)break;c[j>>2]=0;b=c[j>>2]|0;i=k;return b|0}while(0);c[(c[f>>2]|0)+80>>2]=787;a[(c[f>>2]|0)+86>>0]=2;pn((c[f>>2]|0)+44|0,c[g>>2]|0,24400,h);c[j>>2]=1;b=c[j>>2]|0;i=k;return b|0}function cz(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;h=i;i=i+32|0;g=h+28|0;d=h+24|0;f=h+20|0;e=h+16|0;k=h+12|0;m=h+8|0;j=h+4|0;l=h;c[g>>2]=a;c[d>>2]=b;c[f>>2]=c[c[g>>2]>>2];c[e>>2]=0;if(!(c[(c[f>>2]|0)+500>>2]|0)){a=c[e>>2]|0;i=h;return a|0}if(!(c[(c[g>>2]|0)+104>>2]|0)){a=c[e>>2]|0;i=h;return a|0}c[m>>2]=(c[(c[g>>2]|0)+104>>2]|0)-1;c[k>>2]=0;while(1){if((c[k>>2]|0)>=(c[(c[f>>2]|0)+20>>2]|0))break;c[j>>2]=0;c[l>>2]=c[(c[(c[f>>2]|0)+16>>2]|0)+(c[k>>2]<<4)+4>>2];if(c[l>>2]|0){if((c[d>>2]|0)==2)c[j>>2]=tz(c[l>>2]|0,2,c[m>>2]|0)|0;if(!(c[j>>2]|0))c[j>>2]=tz(c[l>>2]|0,1,c[m>>2]|0)|0;if(!(c[e>>2]|0))c[e>>2]=c[j>>2]}c[k>>2]=(c[k>>2]|0)+1}a=(c[f>>2]|0)+500|0;c[a>>2]=(c[a>>2]|0)+ -1;c[(c[g>>2]|0)+104>>2]=0;if(!(c[e>>2]|0)){if((c[d>>2]|0)==2)c[e>>2]=rz(c[f>>2]|0,2,c[m>>2]|0)|0;if(!(c[e>>2]|0))c[e>>2]=rz(c[f>>2]|0,1,c[m>>2]|0)|0}if((c[d>>2]|0)!=2){a=c[e>>2]|0;i=h;return a|0}a=(c[g>>2]|0)+152|0;m=c[a+4>>2]|0;l=(c[f>>2]|0)+504|0;c[l>>2]=c[a>>2];c[l+4>>2]=m;l=(c[g>>2]|0)+160|0;m=c[l+4>>2]|0;a=(c[f>>2]|0)+512|0;c[a>>2]=c[l>>2];c[a+4>>2]=m;a=c[e>>2]|0;i=h;return a|0}function dz(a){a=a|0;var b=0,d=0,f=0;b=i;i=i+16|0;d=b+4|0;f=b;c[f>>2]=a;if(((e[(c[f>>2]|0)+8>>1]|0)&514|0)!=2){c[d>>2]=0;f=c[d>>2]|0;i=b;return f|0}else{c[d>>2]=NC(c[f>>2]|0)|0;f=c[d>>2]|0;i=b;return f|0}return 0}function ez(a){a=a|0;var d=0,f=0,g=0;f=i;i=i+16|0;d=f+4|0;g=f;c[g>>2]=a;a=e[(c[g>>2]|0)+8>>1]|0;do if(!((e[(c[g>>2]|0)+8>>1]|0)&12))if(a&18){b[d>>1]=MC(c[g>>2]|0)|0;break}else{b[d>>1]=0;break}else b[d>>1]=a&12;while(0);i=f;return b[d>>1]|0}function fz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=i;i=i+16|0;f=e+12|0;h=e+8|0;g=e;c[h>>2]=a;a=g;c[a>>2]=b;c[a+4>>2]=d;a=g;d=c[h>>2]|0;if(!((c[a>>2]|0)==0?(c[a+4>>2]|0)==-2147483648:0)){a=g;a=ZE(0,0,c[a>>2]|0,c[a+4>>2]|0)|0;c[f>>2]=_m(d,a,D)|0;a=c[f>>2]|0;i=e;return a|0}a=d;b=c[a+4>>2]|0;if((b|0)>0|(b|0)==0&(c[a>>2]|0)>>>0>=0){c[f>>2]=1;a=c[f>>2]|0;i=e;return a|0}else{b=g;a=c[h>>2]|0;d=a;b=ZE(c[d>>2]|0,c[d+4>>2]|0,c[b>>2]|0,c[b+4>>2]|0)|0;c[a>>2]=b;c[a+4>>2]=D;c[f>>2]=0;a=c[f>>2]|0;i=e;return a|0}return 0}function gz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0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f;return o|0}o=g;o=lF(c[o>>2]|0,c[o+4>>2]|0,0,1)|0;a=g;c[a>>2]=o;c[a+4>>2]=D;a=j;o=e;o=lF(c[a>>2]|0,c[a+4>>2]|0,c[o>>2]|0,c[o+4>>2]|0)|0;if(_m(g,o,D)|0){c[k>>2]=1;o=c[k>>2]|0;i=f;return o|0}else{b=g;a=c[b+4>>2]|0;o=c[h>>2]|0;c[o>>2]=c[b>>2];c[o+4>>2]=a;c[k>>2]=0;o=c[k>>2]|0;i=f;return o|0}return 0}function hz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0;e=i;i=i+32|0;k=e+16|0;j=e+12|0;g=e+8|0;h=e+4|0;f=e;c[k>>2]=a;c[j>>2]=b;c[g>>2]=d;c[h>>2]=(c[k>>2]|0)+204;a:while(1){if(!(c[c[h>>2]>>2]|0))break;c[f>>2]=c[c[h>>2]>>2];do if((c[j>>2]|0)>=0){if((c[c[f>>2]>>2]|0)==(c[j>>2]|0)){if((c[(c[f>>2]|0)+4>>2]|0)>31)break;if(!(c[g>>2]&1<<c[(c[f>>2]|0)+4>>2]))break}c[h>>2]=(c[f>>2]|0)+16;continue a}while(0);if(c[(c[f>>2]|0)+12>>2]|0)rb[c[(c[f>>2]|0)+12>>2]&31](c[(c[f>>2]|0)+8>>2]|0);c[c[h>>2]>>2]=c[(c[f>>2]|0)+16>>2];Xb(c[c[k>>2]>>2]|0,c[f>>2]|0)}i=e;return}function iz(b){b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;e=d+4|0;f=d;c[f>>2]=b;b=c[f>>2]|0;do if(a[(c[f>>2]|0)+26>>0]|0)c[e>>2]=LC(b)|0;else{if((c[b>>2]|0)!=0?(iC(c[c[f>>2]>>2]|0)|0)!=0:0){c[e>>2]=jC(c[f>>2]|0)|0;break}c[e>>2]=0}while(0);i=d;return c[e>>2]|0}function jz(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=i;i=i+16|0;f=d+4|0;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return d|0}b[(c[j>>2]|0)+8>>1]=1;d=Lp(c[j>>2]|0,(c[k>>2]|0)+2|0)|0;c[l>>2]=d;if(d){d=c[l>>2]|0;i=m;return d|0}p=c[q>>2]|0;r=c[o>>2]|0;q=c[k>>2]|0;o=c[(c[j>>2]|0)+16>>2]|0;if(c[n>>2]|0)c[l>>2]=My(p,r,q,o)|0;else c[l>>2]=ff(p,r,q,o)|0;if(!(c[l>>2]|0)){a[(c[(c[j>>2]|0)+16>>2]|0)+(c[k>>2]|0)>>0]=0;a[(c[(c[j>>2]|0)+16>>2]|0)+((c[k>>2]|0)+1)>>0]=0;b[(c[j>>2]|0)+8>>1]=528;c[(c[j>>2]|0)+12>>2]=c[k>>2];d=c[l>>2]|0;i=m;return d|0}else{Bd(c[j>>2]|0);d=c[l>>2]|0;i=m;return d|0}return 0}function nz(a,b){a=a|0;b=b|0;var d=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0;f=i;i=i+48|0;d=f+32|0;k=f+28|0;j=f+24|0;m=f+20|0;l=f+16|0;h=f+8|0;g=f;c[k>>2]=a;c[j>>2]=b;c[m>>2]=e[(c[k>>2]|0)+8>>1];if(c[m>>2]&1){c[d>>2]=0;a=c[d>>2]|0;i=f;return a|0}if(!(c[m>>2]&4)){if(c[m>>2]&8){c[d>>2]=7;a=c[d>>2]|0;i=f;return a|0}c[l>>2]=c[(c[k>>2]|0)+12>>2];if(c[m>>2]&16384)c[l>>2]=(c[l>>2]|0)+(c[c[k>>2]>>2]|0);c[d>>2]=(c[l>>2]<<1)+12+((c[m>>2]&2|0)!=0&1);a=c[d>>2]|0;i=f;return a|0}a=c[k>>2]|0;k=c[a+4>>2]|0;b=h;c[b>>2]=c[a>>2];c[b+4>>2]=k;b=h;k=c[b>>2]|0;b=c[b+4>>2]|0;do if((c[h+4>>2]|0)<0){if(!((b|0)<-32768|(b|0)==-32768&k>>>0<1)){m=h;m=ZE(0,0,c[m>>2]|0,c[m+4>>2]|0)|0;a=g;c[a>>2]=m;c[a+4>>2]=D;break}c[d>>2]=6;a=c[d>>2]|0;i=f;return a|0}else{a=g;c[a>>2]=k;c[a+4>>2]=b}while(0);a=g;m=c[a+4>>2]|0;if(m>>>0<0|(m|0)==0&(c[a>>2]|0)>>>0<=127){a=h;if((0==(c[a+4>>2]|0)?(c[h>>2]&1|0)==(c[a>>2]|0):0)&(c[j>>2]|0)>=4)g=8+(c[g>>2]|0)|0;else g=1;c[d>>2]=g;a=c[d>>2]|0;i=f;return a|0}a=g;m=c[a+4>>2]|0;if(m>>>0<0|(m|0)==0&(c[a>>2]|0)>>>0<=32767){c[d>>2]=2;a=c[d>>2]|0;i=f;return a|0}a=g;m=c[a+4>>2]|0;if(m>>>0<0|(m|0)==0&(c[a>>2]|0)>>>0<=8388607){c[d>>2]=3;a=c[d>>2]|0;i=f;return a|0}a=g;m=c[a+4>>2]|0;if(m>>>0<0|(m|0)==0&(c[a>>2]|0)>>>0<=2147483647){c[d>>2]=4;a=c[d>>2]|0;i=f;return a|0}a=g;m=c[a+4>>2]|0;if(m>>>0<32767|(m|0)==32767&(c[a>>2]|0)>>>0<=4294967295){c[d>>2]=5;a=c[d>>2]|0;i=f;return a|0}else{c[d>>2]=6;a=c[d>>2]|0;i=f;return a|0}return 0}function oz(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;g=f+12|0;h=f+8|0;j=f;c[h>>2]=b;b=j;c[b>>2]=d;c[b+4>>2]=e;b=j;k=c[b+4>>2]|0;d=j;e=c[d>>2]|0;d=c[d+4>>2]|0;if(k>>>0<0|(k|0)==0&(c[b>>2]|0)>>>0<=127){a[c[h>>2]>>0]=e&127;c[g>>2]=1;k=c[g>>2]|0;i=f;return k|0}if(d>>>0<0|(d|0)==0&e>>>0<=16383){k=j;k=cF(c[k>>2]|0,c[k+4>>2]|0,7)|0;a[c[h>>2]>>0]=k&127|128;a[(c[h>>2]|0)+1>>0]=c[j>>2]&127;c[g>>2]=2;k=c[g>>2]|0;i=f;return k|0}else{k=j;c[g>>2]=JC(c[h>>2]|0,c[k>>2]|0,c[k+4>>2]|0)|0;k=c[g>>2]|0;i=f;return k|0}return 0}function pz(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;l=i;i=i+32|0;g=l+28|0;k=l+24|0;j=l+20|0;n=l+16|0;h=l+12|0;f=l;m=l+8|0;c[k>>2]=b;c[j>>2]=d;c[n>>2]=e;e=c[n>>2]|0;if(!((c[n>>2]|0)>>>0<=7&(c[n>>2]|0)>>>0>0))if(e>>>0>=12){c[h>>2]=c[(c[j>>2]|0)+12>>2];dF(c[k>>2]|0,c[(c[j>>2]|0)+16>>2]|0,c[h>>2]|0)|0;c[g>>2]=c[h>>2];b=c[g>>2]|0;i=l;return b|0}else{c[g>>2]=0;b=c[g>>2]|0;i=l;return b|0}if((e|0)==7){b=c[j>>2]|0;c[f+0>>2]=c[b+0>>2];c[f+4>>2]=c[b+4>>2]}else{e=c[j>>2]|0;d=c[e+4>>2]|0;b=f;c[b>>2]=c[e>>2];c[b+4>>2]=d}b=Ww(c[n>>2]|0)|0;c[m>>2]=b;c[h>>2]=b;do{b=c[f>>2]&255;d=(c[m>>2]|0)+ -1|0;c[m>>2]=d;a[(c[k>>2]|0)+d>>0]=b;d=f;d=cF(c[d>>2]|0,c[d+4>>2]|0,8)|0;b=f;c[b>>2]=d;c[b+4>>2]=D}while((c[m>>2]|0)!=0);c[g>>2]=c[h>>2];b=c[g>>2]|0;i=l;return b|0}function qz(f,g){f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;l=i;i=i+32|0;h=l+28|0;o=l+24|0;j=l+20|0;k=l;m=l+16|0;n=l+12|0;p=l+8|0;c[o>>2]=f;c[j>>2]=g;f=k;c[f>>2]=0;c[f+4>>2]=0;if(!(c[(c[o>>2]|0)+60>>2]|0)){f=c[j>>2]|0;c[f>>2]=0;c[f+4>>2]=0;c[h>>2]=0;f=c[h>>2]|0;i=l;return f|0}c[m>>2]=Iw(c[o>>2]|0)|0;a:while(1){if(c[m>>2]|0){n=16;break}c[p>>2]=c[(c[o>>2]|0)+120+(b[(c[o>>2]|0)+76>>1]<<2)>>2];if(!((d[(c[p>>2]|0)+5>>0]|0)==0?(a[(c[p>>2]|0)+2>>0]|0)!=0:0)){g=k;g=bF(c[g>>2]|0,c[g+4>>2]|0,e[(c[p>>2]|0)+18>>1]|0,0)|0;f=k;c[f>>2]=g;c[f+4>>2]=D}if(a[(c[p>>2]|0)+5>>0]|0){do{if(!(b[(c[o>>2]|0)+76>>1]|0)){n=10;break a}yw(c[o>>2]|0)}while((e[(c[o>>2]|0)+78+(b[(c[o>>2]|0)+76>>1]<<1)>>1]|0)>=(e[(c[(c[o>>2]|0)+120+(b[(c[o>>2]|0)+76>>1]<<2)>>2]|0)+18>>1]|0));f=(c[o>>2]|0)+78+(b[(c[o>>2]|0)+76>>1]<<1)|0;b[f>>1]=(b[f>>1]|0)+1<<16>>16;c[p>>2]=c[(c[o>>2]|0)+120+(b[(c[o>>2]|0)+76>>1]<<2)>>2]}c[n>>2]=e[(c[o>>2]|0)+78+(b[(c[o>>2]|0)+76>>1]<<1)>>1];f=c[o>>2]|0;g=c[p>>2]|0;if((c[n>>2]|0)==(e[(c[p>>2]|0)+18>>1]|0)){c[m>>2]=ww(f,Hh((c[(c[p>>2]|0)+56>>2]|0)+((d[g+6>>0]|0)+8)|0)|0)|0;continue}else{c[m>>2]=ww(f,Hh((c[g+56>>2]|0)+(e[(c[p>>2]|0)+20>>1]&(d[(c[(c[p>>2]|0)+64>>2]|0)+(c[n>>2]<<1)>>0]<<8|d[(c[(c[p>>2]|0)+64>>2]|0)+(c[n>>2]<<1)+1>>0]))|0)|0)|0;continue}}if((n|0)==10){p=k;g=c[p+4>>2]|0;f=c[j>>2]|0;c[f>>2]=c[p>>2];c[f+4>>2]=g;c[h>>2]=0;f=c[h>>2]|0;i=l;return f|0}else if((n|0)==16){c[h>>2]=c[m>>2];f=c[h>>2]|0;i=l;return f|0}return 0}function rz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0;f=i;i=i+32|0;m=f+28|0;g=f+24|0;k=f+20|0;e=f+16|0;n=f+12|0;j=f+8|0;l=f+4|0;h=f;c[m>>2]=a;c[g>>2]=b;c[k>>2]=d;c[e>>2]=0;if(!(c[(c[m>>2]|0)+328>>2]|0)){a=c[e>>2]|0;i=f;return a|0}c[n>>2]=0;while(1){if(c[e>>2]|0){g=15;break}if((c[n>>2]|0)>=(c[(c[m>>2]|0)+304>>2]|0)){g=15;break}c[j>>2]=c[(c[(c[m>>2]|0)+328>>2]|0)+(c[n>>2]<<2)>>2];c[l>>2]=c[c[(c[j>>2]|0)+4>>2]>>2];if((c[(c[j>>2]|0)+8>>2]|0)!=0?(c[c[l>>2]>>2]|0)>=2:0){d=c[g>>2]|0;if((d|0)==2)c[h>>2]=c[(c[l>>2]|0)+88>>2];else if(!d){c[h>>2]=c[(c[l>>2]|0)+80>>2];c[(c[j>>2]|0)+20>>2]=(c[k>>2]|0)+1}else c[h>>2]=c[(c[l>>2]|0)+84>>2];if((c[h>>2]|0)!=0?(c[(c[j>>2]|0)+20>>2]|0)>(c[k>>2]|0):0)c[e>>2]=zb[c[h>>2]&63](c[(c[j>>2]|0)+8>>2]|0,c[k>>2]|0)|0}c[n>>2]=(c[n>>2]|0)+1}if((g|0)==15){a=c[e>>2]|0;i=f;return a|0}return 0}function sz(e,f,g){e=e|0;f=f|0;g=g|0;var h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;n=i;i=i+32|0;l=n+20|0;o=n+16|0;p=n+12|0;m=n+8|0;k=n+4|0;h=n;c[l>>2]=e;c[o>>2]=f;c[p>>2]=g;c[k>>2]=0;if(!(c[l>>2]|0)){e=c[k>>2]|0;i=n;return e|0}Pc(c[l>>2]|0);c[m>>2]=c[(c[(c[l>>2]|0)+4>>2]|0)+8>>2];while(1){if(!(c[m>>2]|0)){j=14;break}if((c[p>>2]|0)!=0?(d[(c[m>>2]|0)+72>>0]&1|0)==0:0){if((d[(c[m>>2]|0)+73>>0]|0)==1?(c[k>>2]=Jy(c[m>>2]|0)|0,(c[k>>2]|0)!=0):0)break}else{Qk(c[m>>2]|0);a[(c[m>>2]|0)+73>>0]=4;c[(c[m>>2]|0)+68>>2]=c[o>>2]}c[h>>2]=0;while(1){if((c[h>>2]|0)>(b[(c[m>>2]|0)+76>>1]|0))break;Rk(c[(c[m>>2]|0)+120+(c[h>>2]<<2)>>2]|0);c[(c[m>>2]|0)+120+(c[h>>2]<<2)>>2]=0;c[h>>2]=(c[h>>2]|0)+1}c[m>>2]=c[(c[m>>2]|0)+8>>2]}if((j|0)==14){e=c[k>>2]|0;i=n;return e|0}sz(c[l>>2]|0,c[k>>2]|0,0)|0;e=c[k>>2]|0;i=n;return e|0}function tz(a,b,f){a=a|0;b=b|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0;g=i;i=i+32|0;j=g+16|0;l=g+12|0;m=g+8|0;h=g+4|0;k=g;c[j>>2]=a;c[l>>2]=b;c[m>>2]=f;c[h>>2]=0;if(!(c[j>>2]|0)){a=c[h>>2]|0;i=g;return a|0}if((d[(c[j>>2]|0)+8>>0]|0|0)!=2){a=c[h>>2]|0;i=g;return a|0}c[k>>2]=c[(c[j>>2]|0)+4>>2];Pc(c[j>>2]|0);c[h>>2]=si(c[c[k>>2]>>2]|0,c[l>>2]|0,c[m>>2]|0)|0;if(c[h>>2]|0){a=c[h>>2]|0;i=g;return a|0}if((c[m>>2]|0)<0?((e[(c[k>>2]|0)+22>>1]|0)&8|0)!=0:0)c[(c[k>>2]|0)+44>>2]=0;c[h>>2]=IC(c[k>>2]|0)|0;a=Hh((c[(c[(c[k>>2]|0)+12>>2]|0)+56>>2]|0)+28|0)|0;c[(c[k>>2]|0)+44>>2]=a;a=c[h>>2]|0;i=g;return a|0}function uz(a,b){a=a|0;b=b|0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+16>>2]|0)+(88+(c[l>>2]<<3));FC(c[c[o>>2]>>2]|0);d=c[o>>2]|0;i=j;return d|0}function wz(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,j=0,k=0,l=0,m=0,n=0;h=i;i=i+32|0;n=h+20|0;m=h+16|0;l=h+12|0;k=h+8|0;j=h+4|0;g=h;c[n>>2]=a;c[m>>2]=b;c[l>>2]=d;c[k>>2]=e;c[j>>2]=f;Pc(c[n>>2]|0);c[g>>2]=CC(c[n>>2]|0,c[m>>2]|0,c[l>>2]|0,c[k>>2]|0,c[j>>2]|0)|0;i=h;return c[g>>2]|0}function xz(b,d){b=b|0;d=d|0;var e=0,f=0,g=0;e=i;i=i+16|0;f=e+4|0;g=e;c[f>>2]=b;c[g>>2]=d;a[(c[f>>2]|0)+74>>0]=c[g>>2];i=e;return}function yz(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,j=0;f=i;i=i+16|0;j=f+12|0;h=f+8|0;g=f+4|0;e=f;c[j>>2]=a;c[h>>2]=b;c[g>>2]=d;Pc(c[j>>2]|0);c[e>>2]=BC(c[j>>2]|0,c[h>>2]|0,c[g>>2]|0)|0;i=f;return c[e>>2]|0}function zz(f,g,h){f=f|0;g=g|0;h=h|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;q=i;i=i+48|0;n=q+44|0;r=q+40|0;u=q+36|0;l=q+32|0;p=q+28|0;o=q+24|0;m=q+20|0;s=q+16|0;v=q+12|0;t=q+8|0;k=q+4|0;j=q;c[n>>2]=f;c[r>>2]=g;c[u>>2]=h;c[k>>2]=0;c[v>>2]=24+((e[(c[(c[u>>2]|0)+8>>2]|0)+6>>1]|0)-1<<2);c[t>>2]=128;f=(c[t>>2]|0)+(c[v>>2]|0)|0;c[m>>2]=se(c[n>>2]|0,f,((f|0)<0)<<31>>31)|0;c[(c[u>>2]|0)+56>>2]=c[m>>2];if(!(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2]|0)){i=e;return}AC(c[c[j>>2]>>2]|0,c[f>>2]|0);d=c[f>>2]|0;if(c[(c[f>>2]|0)+4>>2]|0){Kk(c[d+4>>2]|0)|0;i=e;return}a=c[f>>2]|0;if(c[d>>2]|0){Ok(c[a>>2]|0)|0;i=e;return}if(!(c[a+32>>2]|0)){i=e;return}c[g>>2]=c[(c[f>>2]|0)+32>>2];c[h>>2]=c[c[c[g>>2]>>2]>>2];a=(c[j>>2]|0)+88|0;b[a>>1]=b[a>>1]&-13|4;ub[c[(c[h>>2]|0)+28>>2]&31](c[g>>2]|0)|0;a=(c[j>>2]|0)+88|0;b[a>>1]=b[a>>1]&-13;i=e;return}function Bz(a){a=a|0;var b=0,e=0;e=i;i=i+16|0;b=e;c[b>>2]=a;i=e;return 1!=(d[(c[b>>2]|0)+73>>0]|0|0)|0}function Cz(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,j=0,k=0;f=i;i=i+16|0;g=f+12|0;j=f+8|0;k=f+4|0;h=f;c[j>>2]=b;c[k>>2]=e;if(1==(d[(c[j>>2]|0)+73>>0]|0|0)?((d[(c[j>>2]|0)+72>>0]|0)&8|0)!=0:0){c[g>>2]=0;b=c[g>>2]|0;i=f;return b|0}c[h>>2]=Iw(c[j>>2]|0)|0;do if(!(c[h>>2]|0)){e=c[k>>2]|0;if(!(d[(c[j>>2]|0)+73>>0]|0)){c[e>>2]=1;break}c[e>>2]=0;c[h>>2]=xw(c[j>>2]|0)|0;j=(c[j>>2]|0)+72|0;e=d[j>>0]|0;if(!(c[h>>2]|0)){a[j>>0]=e|8;break}else{a[j>>0]=e&-9;break}}while(0);c[g>>2]=c[h>>2];b=c[g>>2]|0;i=f;return b|0}\n\n\n\nfunction XE(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;d=i;h=a+b|0;l=c[a+4>>2]|0;do if(!(l&1)){p=c[a>>2]|0;if(!(l&3)){i=d;return}l=a+(0-p)|0;m=p+b|0;r=c[9754]|0;if(l>>>0<r>>>0)db();if((l|0)==(c[9755]|0)){e=a+(b+4)|0;n=c[e>>2]|0;if((n&3|0)!=3){e=l;n=m;break}c[9752]=m;c[e>>2]=n&-2;c[a+(4-p)>>2]=m|1;c[h>>2]=m;i=d;return}s=p>>>3;if(p>>>0<256){e=c[a+(8-p)>>2]|0;n=c[a+(12-p)>>2]|0;o=39040+(s<<1<<2)|0;if((e|0)!=(o|0)){if(e>>>0<r>>>0)db();if((c[e+12>>2]|0)!=(l|0))db()}if((n|0)==(e|0)){c[9750]=c[9750]&~(1<<s);e=l;n=m;break}if((n|0)!=(o|0)){if(n>>>0<r>>>0)db();o=n+8|0;if((c[o>>2]|0)==(l|0))q=o;else db()}else q=n+8|0;c[e+12>>2]=n;c[q>>2]=e;e=l;n=m;break}q=c[a+(24-p)>>2]|0;s=c[a+(12-p)>>2]|0;do if((s|0)==(l|0)){u=16-p|0;t=a+(u+4)|0;s=c[t>>2]|0;if(!s){t=a+u|0;s=c[t>>2]|0;if(!s){o=0;break}}while(1){v=s+20|0;u=c[v>>2]|0;if(u){s=u;t=v;continue}u=s+16|0;v=c[u>>2]|0;if(!v)break;else{s=v;t=u}}if(t>>>0<r>>>0)db();else{c[t>>2]=0;o=s;break}}else{t=c[a+(8-p)>>2]|0;if(t>>>0<r>>>0)db();r=t+12|0;if((c[r>>2]|0)!=(l|0))db();u=s+8|0;if((c[u>>2]|0)==(l|0)){c[r>>2]=s;c[u>>2]=t;o=s;break}else db()}while(0);if(q){s=c[a+(28-p)>>2]|0;r=39304+(s<<2)|0;if((l|0)==(c[r>>2]|0)){c[r>>2]=o;if(!o){c[9751]=c[9751]&~(1<<s);e=l;n=m;break}}else{if(q>>>0<(c[9754]|0)>>>0)db();r=q+16|0;if((c[r>>2]|0)==(l|0))c[r>>2]=o;else c[q+20>>2]=o;if(!o){e=l;n=m;break}}r=c[9754]|0;if(o>>>0<r>>>0)db();c[o+24>>2]=q;p=16-p|0;q=c[a+p>>2]|0;do if(q)if(q>>>0<r>>>0)db();else{c[o+16>>2]=q;c[q+24>>2]=o;break}while(0);p=c[a+(p+4)>>2]|0;if(p)if(p>>>0<(c[9754]|0)>>>0)db();else{c[o+20>>2]=p;c[p+24>>2]=o;e=l;n=m;break}else{e=l;n=m}}else{e=l;n=m}}else{e=a;n=b}while(0);l=c[9754]|0;if(h>>>0<l>>>0)db();m=a+(b+4)|0;o=c[m>>2]|0;if(!(o&2)){if((h|0)==(c[9756]|0)){v=(c[9753]|0)+n|0;c[9753]=v;c[9756]=e;c[e+4>>2]=v|1;if((e|0)!=(c[9755]|0)){i=d;return}c[9755]=0;c[9752]=0;i=d;return}if((h|0)==(c[9755]|0)){v=(c[9752]|0)+n|0;c[9752]=v;c[9755]=e;c[e+4>>2]=v|1;c[e+v>>2]=v;i=d;return}n=(o&-8)+n|0;m=o>>>3;do if(o>>>0>=256){k=c[a+(b+24)>>2]|0;o=c[a+(b+12)>>2]|0;do if((o|0)==(h|0)){o=a+(b+20)|0;m=c[o>>2]|0;if(!m){o=a+(b+16)|0;m=c[o>>2]|0;if(!m){j=0;break}}while(1){p=m+20|0;q=c[p>>2]|0;if(q){m=q;o=p;continue}q=m+16|0;p=c[q>>2]|0;if(!p)break;else{m=p;o=q}}if(o>>>0<l>>>0)db();else{c[o>>2]=0;j=m;break}}else{m=c[a+(b+8)>>2]|0;if(m>>>0<l>>>0)db();p=m+12|0;if((c[p>>2]|0)!=(h|0))db();l=o+8|0;if((c[l>>2]|0)==(h|0)){c[p>>2]=o;c[l>>2]=m;j=o;break}else db()}while(0);if(k){m=c[a+(b+28)>>2]|0;l=39304+(m<<2)|0;if((h|0)==(c[l>>2]|0)){c[l>>2]=j;if(!j){c[9751]=c[9751]&~(1<<m);break}}else{if(k>>>0<(c[9754]|0)>>>0)db();l=k+16|0;if((c[l>>2]|0)==(h|0))c[l>>2]=j;else c[k+20>>2]=j;if(!j)break}h=c[9754]|0;if(j>>>0<h>>>0)db();c[j+24>>2]=k;k=c[a+(b+16)>>2]|0;do if(k)if(k>>>0<h>>>0)db();else{c[j+16>>2]=k;c[k+24>>2]=j;break}while(0);h=c[a+(b+20)>>2]|0;if(h)if(h>>>0<(c[9754]|0)>>>0)db();else{c[j+20>>2]=h;c[h+24>>2]=j;break}}}else{j=c[a+(b+8)>>2]|0;a=c[a+(b+12)>>2]|0;b=39040+(m<<1<<2)|0;if((j|0)!=(b|0)){if(j>>>0<l>>>0)db();if((c[j+12>>2]|0)!=(h|0))db()}if((a|0)==(j|0)){c[9750]=c[9750]&~(1<<m);break}if((a|0)!=(b|0)){if(a>>>0<l>>>0)db();b=a+8|0;if((c[b>>2]|0)==(h|0))k=b;else db()}else k=a+8|0;c[j+12>>2]=a;c[k>>2]=j}while(0);c[e+4>>2]=n|1;c[e+n>>2]=n;if((e|0)==(c[9755]|0)){c[9752]=n;i=d;return}}else{c[m>>2]=o&-2;c[e+4>>2]=n|1;c[e+n>>2]=n}b=n>>>3;if(n>>>0<256){a=b<<1;h=39040+(a<<2)|0;j=c[9750]|0;b=1<<b;if(j&b){a=39040+(a+2<<2)|0;j=c[a>>2]|0;if(j>>>0<(c[9754]|0)>>>0)db();else{g=a;f=j}}else{c[9750]=j|b;g=39040+(a+2<<2)|0;f=h}c[g>>2]=e;c[f+12>>2]=e;c[e+8>>2]=f;c[e+12>>2]=h;i=d;return}f=n>>>8;if(f)if(n>>>0>16777215)f=31;else{u=(f+1048320|0)>>>16&8;v=f<<u;t=(v+520192|0)>>>16&4;v=v<<t;f=(v+245760|0)>>>16&2;f=14-(t|u|f)+(v<<f>>>15)|0;f=n>>>(f+7|0)&1|f<<1}else f=0;g=39304+(f<<2)|0;c[e+28>>2]=f;c[e+20>>2]=0;c[e+16>>2]=0;a=c[9751]|0;h=1<<f;if(!(a&h)){c[9751]=a|h;c[g>>2]=e;c[e+24>>2]=g;c[e+12>>2]=e;c[e+8>>2]=e;i=d;return}g=c[g>>2]|0;if((f|0)==31)f=0;else f=25-(f>>>1)|0;a:do if((c[g+4>>2]&-8|0)!=(n|0)){f=n<<f;a=g;while(1){h=a+(f>>>31<<2)+16|0;g=c[h>>2]|0;if(!g)break;if((c[g+4>>2]&-8|0)==(n|0))break a;else{f=f<<1;a=g}}if(h>>>0<(c[9754]|0)>>>0)db();c[h>>2]=e;c[e+24>>2]=a;c[e+12>>2]=e;c[e+8>>2]=e;i=d;return}while(0);f=g+8|0;h=c[f>>2]|0;v=c[9754]|0;if(!(g>>>0>=v>>>0&h>>>0>=v>>>0))db();c[h+12>>2]=e;c[f>>2]=e;c[e+8>>2]=h;c[e+12>>2]=g;c[e+24>>2]=0;i=d;return}function YE(){}function ZE(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;b=b-d-(c>>>0>a>>>0|0)>>>0;return(D=b,a-c>>>0|0)|0}function _E(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=b+e|0;if((e|0)>=20){d=d&255;i=b&3;h=d|d<<8|d<<16|d<<24;g=f&~3;if(i){i=b+4-i|0;while((b|0)<(i|0)){a[b>>0]=d;b=b+1|0}}while((b|0)<(g|0)){c[b>>2]=h;b=b+4|0}}while((b|0)<(f|0)){a[b>>0]=d;b=b+1|0}return b-e|0}function $E(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){D=b<<c|(a&(1<<c)-1<<32-c)>>>32-c;return a<<c}D=a<<c-32;return 0}function aF(b){b=b|0;var c=0;c=b;while(a[c>>0]|0)c=c+1|0;return c-b|0}function bF(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;c=a+c>>>0;return(D=b+d+(c>>>0<a>>>0|0)>>>0,c|0)|0}function cF(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){D=b>>>c;return a>>>c|(b&(1<<c)-1)<<32-c}D=0;return b>>>c-32|0}function dF(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;if((e|0)>=4096)return Na(b|0,d|0,e|0)|0;f=b|0;if((b&3)==(d&3)){while(b&3){if(!e)return f|0;a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0;e=e-1|0}while((e|0)>=4){c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0;e=e-4|0}}while((e|0)>0){a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0;e=e-1|0}return f|0}function eF(b,c,d){b=b|0;c=c|0;d=d|0;var e=0;if((c|0)<(b|0)&(b|0)<(c+d|0)){e=b;c=c+d|0;b=b+d|0;while((d|0)>0){b=b-1|0;c=c-1|0;d=d-1|0;a[b>>0]=a[c>>0]|0}b=e}else dF(b,c,d)|0;return b|0}function fF(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){D=b>>c;return a>>>c|(b&(1<<c)-1)<<32-c}D=(b|0)<0?-1:0;return b>>c-32|0}function gF(b){b=b|0;var c=0;c=a[n+(b>>>24)>>0]|0;if((c|0)<8)return c|0;c=a[n+(b>>16&255)>>0]|0;if((c|0)<8)return c+8|0;c=a[n+(b>>8&255)>>0]|0;if((c|0)<8)return c+16|0;return(a[n+(b&255)>>0]|0)+24|0}function hF(b){b=b|0;var c=0;c=a[m+(b&255)>>0]|0;if((c|0)<8)return c|0;c=a[m+(b>>8&255)>>0]|0;if((c|0)<8)return c+8|0;c=a[m+(b>>16&255)>>0]|0;if((c|0)<8)return c+16|0;return(a[m+(b>>>24)>>0]|0)+24|0}function iF(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;f=a&65535;d=b&65535;c=$(d,f)|0;e=a>>>16;d=(c>>>16)+($(d,e)|0)|0;b=b>>>16;a=$(b,f)|0;return(D=(d>>>16)+($(b,e)|0)+(((d&65535)+a|0)>>>16)|0,d+a<<16|c&65535|0)|0}function jF(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;j=b>>31|((b|0)<0?-1:0)<<1;i=((b|0)<0?-1:0)>>31|((b|0)<0?-1:0)<<1;f=d>>31|((d|0)<0?-1:0)<<1;e=((d|0)<0?-1:0)>>31|((d|0)<0?-1:0)<<1;h=ZE(j^a,i^b,j,i)|0;g=D;b=f^j;a=e^i;a=ZE((oF(h,g,ZE(f^c,e^d,f,e)|0,D,0)|0)^b,D^a,b,a)|0;return a|0}function kF(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,j=0,k=0,l=0;f=i;i=i+8|0;j=f|0;h=b>>31|((b|0)<0?-1:0)<<1;g=((b|0)<0?-1:0)>>31|((b|0)<0?-1:0)<<1;l=e>>31|((e|0)<0?-1:0)<<1;k=((e|0)<0?-1:0)>>31|((e|0)<0?-1:0)<<1;b=ZE(h^a,g^b,h,g)|0;a=D;oF(b,a,ZE(l^d,k^e,l,k)|0,D,j)|0;a=ZE(c[j>>2]^h,c[j+4>>2]^g,h,g)|0;b=D;i=f;return(D=b,a)|0}function lF(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=a;f=c;a=iF(e,f)|0;c=D;return(D=($(b,f)|0)+($(d,e)|0)+c|c&0,a|0|0)|0}function mF(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;a=oF(a,b,c,d,0)|0;return a|0}function nF(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;g=i;i=i+8|0;f=g|0;oF(a,b,d,e,f)|0;i=g;return(D=c[f+4>>2]|0,c[f>>2]|0)|0}function oF(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;h=a;j=b;i=j;l=d;g=e;k=g;if(!i){g=(f|0)!=0;if(!k){if(g){c[f>>2]=(h>>>0)%(l>>>0);c[f+4>>2]=0}k=0;m=(h>>>0)/(l>>>0)>>>0;return(D=k,m)|0}else{if(!g){l=0;m=0;return(D=l,m)|0}c[f>>2]=a|0;c[f+4>>2]=b&0;l=0;m=0;return(D=l,m)|0}}m=(k|0)==0;do if(l){if(!m){k=(gF(k|0)|0)-(gF(i|0)|0)|0;if(k>>>0<=31){m=k+1|0;l=31-k|0;a=k-31>>31;j=m;b=h>>>(m>>>0)&a|i<<l;a=i>>>(m>>>0)&a;k=0;l=h<<l;break}if(!f){l=0;m=0;return(D=l,m)|0}c[f>>2]=a|0;c[f+4>>2]=j|b&0;l=0;m=0;return(D=l,m)|0}k=l-1|0;if(k&l){l=(gF(l|0)|0)+33-(gF(i|0)|0)|0;p=64-l|0;m=32-l|0;n=m>>31;o=l-32|0;a=o>>31;j=l;b=m-1>>31&i>>>(o>>>0)|(i<<m|h>>>(l>>>0))&a;a=a&i>>>(l>>>0);k=h<<p&n;l=(i<<p|h>>>(o>>>0))&n|h<<m&l-33>>31;break}if(f){c[f>>2]=k&h;c[f+4>>2]=0}if((l|0)==1){o=j|b&0;p=a|0|0;return(D=o,p)|0}else{p=hF(l|0)|0;o=i>>>(p>>>0)|0;p=i<<32-p|h>>>(p>>>0)|0;return(D=o,p)|0}}else{if(m){if(f){c[f>>2]=(i>>>0)%(l>>>0);c[f+4>>2]=0}o=0;p=(i>>>0)/(l>>>0)>>>0;return(D=o,p)|0}if(!h){if(f){c[f>>2]=0;c[f+4>>2]=(i>>>0)%(k>>>0)}o=0;p=(i>>>0)/(k>>>0)>>>0;return(D=o,p)|0}l=k-1|0;if(!(l&k)){if(f){c[f>>2]=a|0;c[f+4>>2]=l&i|b&0}o=0;p=i>>>((hF(k|0)|0)>>>0);return(D=o,p)|0}k=(gF(k|0)|0)-(gF(i|0)|0)|0;if(k>>>0<=30){a=k+1|0;l=31-k|0;j=a;b=i<<l|h>>>(a>>>0);a=i>>>(a>>>0);k=0;l=h<<l;break}if(!f){o=0;p=0;return(D=o,p)|0}c[f>>2]=a|0;c[f+4>>2]=j|b&0;o=0;p=0;return(D=o,p)|0}while(0);if(!j){g=l;e=0;i=0}else{h=d|0|0;g=g|e&0;e=bF(h,g,-1,-1)|0;d=D;i=0;do{m=l;l=k>>>31|l<<1;k=i|k<<1;m=b<<1|m>>>31|0;n=b>>>31|a<<1|0;ZE(e,d,m,n)|0;p=D;o=p>>31|((p|0)<0?-1:0)<<1;i=o&1;b=ZE(m,n,o&h,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&g)|0;a=D;j=j-1|0}while((j|0)!=0);g=l;e=0}h=0;if(f){c[f>>2]=b;c[f+4>>2]=a}o=(k|0)>>>31|(g|h)<<1|(h<<1|k>>>31)&0|e;p=(k<<1|0>>>31)&-2|i;return(D=o,p)|0}function pF(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return pb[a&31](b|0,c|0,d|0)|0}function qF(a){a=a|0;return qb[a&1]()|0}function rF(a,b){a=a|0;b=b|0;rb[a&31](b|0)}function sF(a,b,c){a=a|0;b=b|0;c=c|0;sb[a&7](b|0,c|0)}function tF(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;return tb[a&1](b|0,c|0,d|0,e|0,f|0,g|0)|0}function uF(a,b){a=a|0;b=b|0;return ub[a&31](b|0)|0}function vF(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;vb[a&63](b|0,c|0,d|0)}function wF(a){a=a|0;wb[a&0]()}function xF(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;return xb[a&7](b|0,c|0,d|0,e|0)|0}function yF(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;yb[a&0](b|0,c|0,d|0,e|0,f|0,g|0)}function zF(a,b,c){a=a|0;b=b|0;c=c|0;return zb[a&63](b|0,c|0)|0}function AF(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;return Ab[a&15](b|0,c|0,d|0,e|0,f|0)|0}function BF(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;Bb[a&3](b|0,c|0,d|0,e|0)}function CF(a,b,c){a=a|0;b=b|0;c=c|0;aa(0);return 0}function DF(a,b,c){a=a|0;b=b|0;c=c|0;return Ca(a|0,b|0,c|0)|0}function EF(a,b,c){a=a|0;b=b|0;c=c|0;return mb(a|0,b|0,c|0)|0}function FF(a,b,c){a=a|0;b=b|0;c=c|0;return Wa(a|0,b|0,c|0)|0}function GF(){aa(1);return 0}function HF(a){a=a|0;aa(2)}function IF(a,b){a=a|0;b=b|0;aa(3)}function JF(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;aa(4);return 0}function KF(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;return jb(a|0,b|0,c|0,d|0,e|0,f|0)|0}function LF(a){a=a|0;aa(5);return 0}function MF(a){a=a|0;return lb(a|0)|0}function NF(a){a=a|0;return Oa(a|0)|0}function OF(a){a=a|0;return Aa(a|0)|0}function PF(a,b,c){a=a|0;b=b|0;c=c|0;aa(6)}function QF(){aa(7)}function RF(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;aa(8);return 0}function SF(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;aa(9)}function TF(a,b){a=a|0;b=b|0;aa(10);return 0}function UF(a,b){a=a|0;b=b|0;return xa(a|0,b|0)|0}function VF(a,b){a=a|0;b=b|0;return ta(a|0,b|0)|0}function WF(a,b){a=a|0;b=b|0;return Za(a|0,b|0)|0}function XF(a,b){a=a|0;b=b|0;return ya(a|0,b|0)|0}function YF(a,b){a=a|0;b=b|0;return Sa(a|0,b|0)|0}function ZF(a,b){a=a|0;b=b|0;return Qa(a|0,b|0)|0}function _F(a,b){a=a|0;b=b|0;return Ta(a|0,b|0)|0}function $F(a,b){a=a|0;b=b|0;return ib(a|0,b|0)|0}function aG(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;aa(11);return 0}function bG(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;aa(12)}\n\n\n\n\n// EMSCRI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2:mf,_sqlite3_close_v2:Mf,_sqlite3_open:cg,_bitshift64Shl:$E,_sqlite3_column_bytes:ye,_sqlite3_bind_int:Ie,_sqlite3_bind_blob:Ee,_memset:_E,_memcpy:dF,_sqlite3_column_blob:ve,_sqlite3_bind_parameter_index:Le,_i64Subtract:ZE,_sqlite3_column_text:Ae,_realloc:SE,_i64Add:bF,_sqlite3_finalize:td,_sqlite3_column_double:ze,_sqlite3_errmsg:nf,_sqlite3_data_count:ue,_sqlite3_bind_text:Ke,_sqlite3_bind_double:Ge,_free:RE,_memmove:eF,_sqlite3_free:hc,_sqlite3_clear_bindings:Ad,_malloc:QE,runPostSets:YE,stackAlloc:Cb,stackSave:Db,stackRestore:Eb,setThrew:Fb,setTempRet0:Ib,getTempRet0:Jb,dynCall_iiii:pF,dynCall_i:qF,dynCall_vi:rF,dynCall_vii:sF,dynCall_iiiiiii:tF,dynCall_ii:uF,dynCall_viii:vF,dynCall_v:wF,dynCall_iiiii:xF,dynCall_viiiiii:yF,dynCall_iii:zF,dynCall_iiiiii:AF,dynCall_viiii:BF}})\n\n\n// EMSCRIPTEN_END_ASM\n(r.ie,r.je,M),Ob=r._strlen=T._strlen;r._sqlite3_column_name=T._sqlite3_column_name;r._sqlite3_reset=T._sqlite3_reset;r._sqlite3_column_type=T._sqlite3_column_type;r._sqlite3_exec=T._sqlite3_exec;r._sqlite3_step=T._sqlite3_step;var xc=r._bitshift64Lshr=T._bitshift64Lshr;r._sqlite3_prepare_v2=T._sqlite3_prepare_v2;r._sqlite3_close_v2=T._sqlite3_close_v2;r._sqlite3_open=T._sqlite3_open;var Mb=r._bitshift64Shl=T._bitshift64Shl;r._sqlite3_column_bytes=T._sqlite3_column_bytes;\nr._sqlite3_bind_int=T._sqlite3_bind_int;r._sqlite3_bind_blob=T._sqlite3_bind_blob;var Kb=r._memset=T._memset,Cc=r._memcpy=T._memcpy;r._sqlite3_column_blob=T._sqlite3_column_blob;r._sqlite3_bind_parameter_index=T._sqlite3_bind_parameter_index;var Jb=r._i64Subtract=T._i64Subtract;r._sqlite3_column_text=T._sqlite3_column_text;r._realloc=T._realloc;var Pb=r._i64Add=T._i64Add;r._sqlite3_finalize=T._sqlite3_finalize;r._sqlite3_column_double=T._sqlite3_column_double;r._sqlite3_errmsg=T._sqlite3_errmsg;\nr._sqlite3_data_count=T._sqlite3_data_count;r._sqlite3_bind_text=T._sqlite3_bind_text;r._sqlite3_bind_double=T._sqlite3_bind_double;var Ka=r._free=T._free,Ec=r._memmove=T._memmove;r._sqlite3_free=T._sqlite3_free;r._sqlite3_clear_bindings=T._sqlite3_clear_bindings;var Ia=r._malloc=T._malloc;r.runPostSets=T.runPostSets;r.dynCall_iiii=T.dynCall_iiii;r.dynCall_i=T.dynCall_i;r.dynCall_vi=T.dynCall_vi;r.dynCall_vii=T.dynCall_vii;r.dynCall_iiiiiii=T.dynCall_iiiiiii;r.dynCall_ii=T.dynCall_ii;\nr.dynCall_viii=T.dynCall_viii;r.dynCall_v=T.dynCall_v;r.dynCall_iiiii=T.dynCall_iiiii;r.dynCall_viiiiii=T.dynCall_viiiiii;r.dynCall_iii=T.dynCall_iii;r.dynCall_iiiiii=T.dynCall_iiiiii;r.dynCall_viiii=T.dynCall_viiii;w.Ma=T.stackAlloc;w.Xb=T.stackSave;w.Wb=T.stackRestore;w.Lf=T.setTempRet0;w.Ye=T.getTempRet0;function U(a,b){a!=l&&(\"number\"==typeof a?this.da(a):b==l&&\"string\"!=typeof a?this.S(a,256):this.S(a,b))}function Kc(){return new U(l)}\nfunction Lc(a,b){var c=Mc[a.charCodeAt(b)];return c==l?-1:c}function Nc(a){var b=Kc();b.Aa(a);return b}function V(a,b){this.H=a|0;this.M=b|0}V.Tc={};V.Aa=function(a){if(-128<=a&&128>a){var b=V.Tc[a];if(b)return b}b=new V(a|0,0>a?-1:0);-128<=a&&128>a&&(V.Tc[a]=b);return b};V.da=function(a){return isNaN(a)||!isFinite(a)?V.ZERO:a<=-V.Vc?V.MIN_VALUE:a+1>=V.Vc?V.MAX_VALUE:0>a?V.da(-a).K():new V(a%V.ya|0,a/V.ya|0)};V.qa=function(a,b){return new V(a,b)};\nV.S=function(a,b){0==a.length&&e(Error(\"number format error: empty string\"));var c=b||10;(2>c||36<c)&&e(Error(\"radix out of range: \"+c));if(\"-\"==a.charAt(0))return V.S(a.substring(1),c).K();0<=a.indexOf(\"-\")&&e(Error('number format error: interior \"-\" character: '+a));for(var d=V.da(Math.pow(c,8)),f=V.ZERO,h=0;h<a.length;h+=8){var i=Math.min(8,a.length-h),j=parseInt(a.substring(h,h+i),c);8>i?(i=V.da(Math.pow(c,i)),f=f.multiply(i).add(V.da(j))):(f=f.multiply(d),f=f.add(V.da(j)))}return f};V.bc=65536;\nV.gi=16777216;V.ya=V.bc*V.bc;V.hi=V.ya/2;V.ii=V.ya*V.bc;V.ce=V.ya*V.ya;V.Vc=V.ce/2;V.ZERO=V.Aa(0);V.ONE=V.Aa(1);V.Uc=V.Aa(-1);V.MAX_VALUE=V.qa(-1,2147483647);V.MIN_VALUE=V.qa(0,-2147483648);V.be=V.Aa(16777216);q=V.prototype;q.Zb=function(){return this.M*V.ya+this.Ue()};\nq.toString=function(a){a=a||10;(2>a||36<a)&&e(Error(\"radix out of range: \"+a));if(this.Ja())return\"0\";if(this.Y()){if(this.ba(V.MIN_VALUE)){var b=V.da(a),c=this.Ga(b),b=c.multiply(b).rb(this);return c.toString(a)+b.H.toString(a)}return\"-\"+this.K().toString(a)}for(var c=V.da(Math.pow(a,6)),b=this,d=\"\";;){var f=b.Ga(c),h=b.rb(f.multiply(c)).H.toString(a),b=f;if(b.Ja())return h+d;for(;6>h.length;)h=\"0\"+h;d=\"\"+h+d}};q.Ue=function(){return 0<=this.H?this.H:V.ya+this.H};\nq.Ja=function(){return 0==this.M&&0==this.H};q.Y=function(){return 0>this.M};q.zd=function(){return 1==(this.H&1)};q.ba=function(a){return this.M==a.M&&this.H==a.H};q.Bd=function(){return 0>this.lc(V.be)};q.af=function(a){return 0<this.lc(a)};q.bf=function(a){return 0<=this.lc(a)};q.lc=function(a){if(this.ba(a))return 0;var b=this.Y(),c=a.Y();return b&&!c?-1:!b&&c?1:this.rb(a).Y()?-1:1};q.K=function(){return this.ba(V.MIN_VALUE)?V.MIN_VALUE:this.uf().add(V.ONE)};\nq.add=function(a){var b=this.M>>>16,c=this.M&65535,d=this.H>>>16,f=a.M>>>16,h=a.M&65535,i=a.H>>>16,j;j=0+((this.H&65535)+(a.H&65535));a=0+(j>>>16);a+=d+i;d=0+(a>>>16);d+=c+h;c=0+(d>>>16);c=c+(b+f)&65535;return V.qa((a&65535)<<16|j&65535,c<<16|d&65535)};q.rb=function(a){return this.add(a.K())};\nq.multiply=function(a){if(this.Ja()||a.Ja())return V.ZERO;if(this.ba(V.MIN_VALUE))return a.zd()?V.MIN_VALUE:V.ZERO;if(a.ba(V.MIN_VALUE))return this.zd()?V.MIN_VALUE:V.ZERO;if(this.Y())return a.Y()?this.K().multiply(a.K()):this.K().multiply(a).K();if(a.Y())return this.multiply(a.K()).K();if(this.Bd()&&a.Bd())return V.da(this.Zb()*a.Zb());var b=this.M>>>16,c=this.M&65535,d=this.H>>>16,f=this.H&65535,h=a.M>>>16,i=a.M&65535,j=a.H>>>16,a=a.H&65535,x,p,A,t;t=0+f*a;A=0+(t>>>16);A+=d*a;p=0+(A>>>16);A=(A&\n65535)+f*j;p+=A>>>16;A&=65535;p+=c*a;x=0+(p>>>16);p=(p&65535)+d*j;x+=p>>>16;p&=65535;p+=f*i;x+=p>>>16;p&=65535;x=x+(b*a+c*j+d*i+f*h)&65535;return V.qa(A<<16|t&65535,x<<16|p)};\nq.Ga=function(a){a.Ja()&&e(Error(\"division by zero\"));if(this.Ja())return V.ZERO;if(this.ba(V.MIN_VALUE)){if(a.ba(V.ONE)||a.ba(V.Uc))return V.MIN_VALUE;if(a.ba(V.MIN_VALUE))return V.ONE;var b=this.Mf().Ga(a).shiftLeft(1);if(b.ba(V.ZERO))return a.Y()?V.ONE:V.Uc;var c=this.rb(a.multiply(b));return b.add(c.Ga(a))}if(a.ba(V.MIN_VALUE))return V.ZERO;if(this.Y())return a.Y()?this.K().Ga(a.K()):this.K().Ga(a).K();if(a.Y())return this.Ga(a.K()).K();for(var d=V.ZERO,c=this;c.bf(a);){for(var b=Math.max(1,Math.floor(c.Zb()/\na.Zb())),f=Math.ceil(Math.log(b)/Math.LN2),f=48>=f?1:Math.pow(2,f-48),h=V.da(b),i=h.multiply(a);i.Y()||i.af(c);)b-=f,h=V.da(b),i=h.multiply(a);h.Ja()&&(h=V.ONE);d=d.add(h);c=c.rb(i)}return d};q.uf=function(){return V.qa(~this.H,~this.M)};q.shiftLeft=function(a){a&=63;if(0==a)return this;var b=this.H;return 32>a?V.qa(b<<a,this.M<<a|b>>>32-a):V.qa(0,b<<a-32)};q.Mf=function(){var a;a=1;if(0==a)return this;var b=this.M;return 32>a?V.qa(this.H>>>a|b<<32-a,b>>a):V.qa(b>>a-32,0<=b?0:-1)};q=U.prototype;\nq.hc=function(a,b,c,d){for(var f=0,h=0;0<=--d;){var i=a*this[f++]+b[c]+h,h=Math.floor(i/67108864);b[c++]=i&67108863}return h};q.A=26;q.la=67108863;q.ab=67108864;q.Wd=Math.pow(2,52);q.Rc=26;q.Sc=0;var Mc=[],Oc,W;Oc=48;for(W=0;9>=W;++W)Mc[Oc++]=W;Oc=97;for(W=10;36>W;++W)Mc[Oc++]=W;Oc=65;for(W=10;36>W;++W)Mc[Oc++]=W;q=U.prototype;q.copyTo=function(a){for(var b=this.g-1;0<=b;--b)a[b]=this[b];a.g=this.g;a.u=this.u};q.Aa=function(a){this.g=1;this.u=0>a?-1:0;0<a?this[0]=a:-1>a?this[0]=a+DV:this.g=0};\nq.S=function(a,b){var c;if(16==b)c=4;else if(8==b)c=3;else if(256==b)c=8;else if(2==b)c=1;else if(32==b)c=5;else if(4==b)c=2;else{this.Qe(a,b);return}this.u=this.g=0;for(var d=a.length,f=m,h=0;0<=--d;){var i=8==c?a[d]&255:Lc(a,d);0>i?\"-\"==a.charAt(d)&&(f=k):(f=m,0==h?this[this.g++]=i:h+c>this.A?(this[this.g-1]|=(i&(1<<this.A-h)-1)<<h,this[this.g++]=i>>this.A-h):this[this.g-1]|=i<<h,h+=c,h>=this.A&&(h-=this.A))}8==c&&0!=(a[0]&128)&&(this.u=-1,0<h&&(this[this.g-1]|=(1<<this.A-h)-1<<h));this.za();f&&\nU.ZERO.ka(this,this)};q.za=function(){for(var a=this.u&this.la;0<this.g&&this[this.g-1]==a;)--this.g};q.nc=function(a,b){var c;for(c=this.g-1;0<=c;--c)b[c+a]=this[c];for(c=a-1;0<=c;--c)b[c]=0;b.g=this.g+a;b.u=this.u};q.Ie=function(a,b){for(var c=a;c<this.g;++c)b[c-a]=this[c];b.g=Math.max(this.g-a,0);b.u=this.u};\nq.Ad=function(a,b){var c=a%this.A,d=this.A-c,f=(1<<d)-1,h=Math.floor(a/this.A),i=this.u<<c&this.la,j;for(j=this.g-1;0<=j;--j)b[j+h+1]=this[j]>>d|i,i=(this[j]&f)<<c;for(j=h-1;0<=j;--j)b[j]=0;b[h]=i;b.g=this.g+h+1;b.u=this.u;b.za()};q.Df=function(a,b){b.u=this.u;var c=Math.floor(a/this.A);if(c>=this.g)b.g=0;else{var d=a%this.A,f=this.A-d,h=(1<<d)-1;b[0]=this[c]>>d;for(var i=c+1;i<this.g;++i)b[i-c-1]|=(this[i]&h)<<f,b[i-c]=this[i]>>d;0<d&&(b[this.g-c-1]|=(this.u&h)<<f);b.g=this.g-c;b.za()}};\nq.ka=function(a,b){for(var c=0,d=0,f=Math.min(a.g,this.g);c<f;)d+=this[c]-a[c],b[c++]=d&this.la,d>>=this.A;if(a.g<this.g){for(d-=a.u;c<this.g;)d+=this[c],b[c++]=d&this.la,d>>=this.A;d+=this.u}else{for(d+=this.u;c<a.g;)d-=a[c],b[c++]=d&this.la,d>>=this.A;d-=a.u}b.u=0>d?-1:0;-1>d?b[c++]=this.ab+d:0<d&&(b[c++]=d);b.g=c;b.za()};q.qf=function(a){var b=X.Md,c=this.abs(),d=b.abs(),f=c.g;for(a.g=f+d.g;0<=--f;)a[f]=0;for(f=0;f<d.g;++f)a[f+c.g]=c.hc(d[f],a,f,c.g);a.u=0;a.za();this.u!=b.u&&U.ZERO.ka(a,a)};\nq.hd=function(a,b,c){var d=a.abs();if(!(0>=d.g)){var f=this.abs();if(f.g<d.g)b!=l&&b.Aa(0),c!=l&&this.copyTo(c);else{c==l&&(c=Kc());var h=Kc(),i=this.u,a=a.u,j=d[d.g-1],x=1,p;if(0!=(p=j>>>16))j=p,x+=16;if(0!=(p=j>>8))j=p,x+=8;if(0!=(p=j>>4))j=p,x+=4;if(0!=(p=j>>2))j=p,x+=2;0!=j>>1&&(x+=1);j=this.A-x;0<j?(d.Ad(j,h),f.Ad(j,c)):(d.copyTo(h),f.copyTo(c));d=h.g;f=h[d-1];if(0!=f){p=f*(1<<this.Rc)+(1<d?h[d-2]>>this.Sc:0);x=this.Wd/p;p=(1<<this.Rc)/p;var A=1<<this.Sc,t=c.g,B=t-d,I=b==l?Kc():b;h.nc(B,I);0<=\nc.Fb(I)&&(c[c.g++]=1,c.ka(I,c));U.ONE.nc(d,I);for(I.ka(h,h);h.g<d;)h[h.g++]=0;for(;0<=--B;){var ca=c[--t]==f?this.la:Math.floor(c[t]*x+(c[t-1]+A)*p);if((c[t]+=h.hc(ca,c,B,d))<ca){h.nc(B,I);for(c.ka(I,c);c[t]<--ca;)c.ka(I,c)}}b!=l&&(c.Ie(d,b),i!=a&&U.ZERO.ka(b,b));c.g=d;c.za();0<j&&c.Df(j,c);0>i&&U.ZERO.ka(c,c)}}}};\nq.toString=function(a){if(0>this.u)return\"-\"+this.K().toString(a);if(16==a)a=4;else if(8==a)a=3;else if(2==a)a=1;else if(32==a)a=5;else if(4==a)a=2;else return this.Of(a);var b=(1<<a)-1,c,d=m,f=\"\",h=this.g,i=this.A-h*this.A%a;if(0<h--){if(i<this.A&&0<(c=this[h]>>i))d=k,f=\"0123456789abcdefghijklmnopqrstuvwxyz\".charAt(c);for(;0<=h;)i<a?(c=(this[h]&(1<<i)-1)<<a-i,c|=this[--h]>>(i+=this.A-a)):(c=this[h]>>(i-=a)&b,0>=i&&(i+=this.A,--h)),0<c&&(d=k),d&&(f+=\"0123456789abcdefghijklmnopqrstuvwxyz\".charAt(c))}return d?\nf:\"0\"};q.K=function(){var a=Kc();U.ZERO.ka(this,a);return a};q.abs=function(){return 0>this.u?this.K():this};q.Fb=function(a){var b=this.u-a.u;if(0!=b)return b;var c=this.g,b=c-a.g;if(0!=b)return 0>this.u?-b:b;for(;0<=--c;)if(0!=(b=this[c]-a[c]))return b;return 0};U.ZERO=Nc(0);U.ONE=Nc(1);q=U.prototype;\nq.Qe=function(a,b){this.Aa(0);b==l&&(b=10);for(var c=this.Db(b),d=Math.pow(b,c),f=m,h=0,i=0,j=0;j<a.length;++j){var x=Lc(a,j);0>x?\"-\"==a.charAt(j)&&0==this.Hc()&&(f=k):(i=b*i+x,++h>=c&&(this.fd(d),this.ed(i),i=h=0))}0<h&&(this.fd(Math.pow(b,h)),this.ed(i));f&&U.ZERO.ka(this,this)};q.Db=function(a){return Math.floor(Math.LN2*this.A/Math.log(a))};q.Hc=function(){return 0>this.u?-1:0>=this.g||1==this.g&&0>=this[0]?0:1};q.fd=function(a){this[this.g]=this.hc(a-1,this,0,this.g);++this.g;this.za()};\nq.ed=function(a){var b=0;if(0!=a){for(;this.g<=b;)this[this.g++]=0;for(this[b]+=a;this[b]>=this.ab;)this[b]-=this.ab,++b>=this.g&&(this[this.g++]=0),++this[b]}};q.Of=function(a){a==l&&(a=10);if(0==this.Hc()||2>a||36<a)return\"0\";var b=this.Db(a),b=Math.pow(a,b),c=Nc(b),d=Kc(),f=Kc(),h=\"\";for(this.hd(c,d,f);0<d.Hc();)h=(b+f.yd()).toString(a).substr(1)+h,d.hd(c,d,f);return f.yd().toString(a)+h};\nq.yd=function(){if(0>this.u){if(1==this.g)return this[0]-this.ab;if(0==this.g)return-1}else{if(1==this.g)return this[0];if(0==this.g)return 0}return(this[1]&(1<<32-this.A)-1)<<this.A|this[0]};\nq.dc=function(a,b){for(var c=0,d=0,f=Math.min(a.g,this.g);c<f;)d+=this[c]+a[c],b[c++]=d&this.la,d>>=this.A;if(a.g<this.g){for(d+=a.u;c<this.g;)d+=this[c],b[c++]=d&this.la,d>>=this.A;d+=this.u}else{for(d+=this.u;c<a.g;)d+=a[c],b[c++]=d&this.la,d>>=this.A;d+=a.u}b.u=0>d?-1:0;0<d?b[c++]=d:-1>d&&(b[c++]=this.ab+d);b.g=c;b.za()};\nvar X={abs:function(a,b){var c=new V(a,b),c=c.Y()?c.K():c;E[ib>>2]=c.H;E[ib+4>>2]=c.M},kd:function(){X.Je||(X.Je=k,X.Md=new U,X.Md.S(\"4294967296\",10),X.Jc=new U,X.Jc.S(\"18446744073709551616\",10),X.Xi=new U,X.Yi=new U)},Oi:function(a,b){var c=new U;c.S(b.toString(),10);var d=new U;c.qf(d);c=new U;c.S(a.toString(),10);var f=new U;c.dc(d,f);return f},stringify:function(a,b,c){a=(new V(a,b)).toString();c&&\"-\"==a[0]&&(X.kd(),c=new U,c.S(a,10),a=new U,X.Jc.dc(c,a),a=a.toString(10));return a},S:function(a,\nb,c,d,f){X.kd();var h=new U;h.S(a,b);a=new U;a.S(c,10);c=new U;c.S(d,10);f&&0>h.Fb(U.ZERO)&&(d=new U,h.dc(X.Jc,d),h=d);d=m;0>h.Fb(a)?(h=a,d=k):0<h.Fb(c)&&(h=c,d=k);h=V.S(h.toString());E[ib>>2]=h.H;E[ib+4>>2]=h.M;d&&e(\"range error\")}};\nif(hb)if(\"function\"===typeof r.locateFile?hb=r.locateFile(hb):r.memoryInitializerPrefixURL&&(hb=r.memoryInitializerPrefixURL+hb),s||ga){var Pc=r.readBinary(hb);K.set(Pc,Oa)}else fb(),Ib(hb,function(a){K.set(a,Oa);gb()},function(){e(\"could not load memory initializer \"+hb)});function ka(a){this.name=\"ExitStatus\";this.message=\"Program terminated with exit(\"+a+\")\";this.status=a}ka.prototype=Error();var Qc,Rc=l,eb=function Sc(){!r.calledRun&&Tc&&Uc();r.calledRun||(eb=Sc)};\nr.callMain=r.ri=function(a){function b(){for(var a=0;3>a;a++)d.push(0)}u(0==cb,\"cannot call main when async dependencies remain! (listen on __ATMAIN__)\");u(0==Ua.length,\"cannot call main when preRun functions remain to be called\");a=a||[];Za||(Za=k,Ta(Va));var c=a.length+1,d=[H(N(r.thisProgram),\"i8\",F)];b();for(var f=0;f<c-1;f+=1)d.push(H(N(a[f]),\"i8\",F)),b();d.push(0);d=H(d,\"i32\",F);Qc=v;try{var h=r._main(c,d,0);Vc(h)}catch(i){i instanceof ka||(\"SimulateInfiniteLoop\"==i?r.noExitRuntime=k:(i&&(\"object\"===\ntypeof i&&i.stack)&&r.Ca(\"exception thrown: \"+[i,i.stack]),e(i)))}finally{}};\nfunction Uc(a){function b(){if(!r.calledRun&&(r.calledRun=k,!pa)){Za||(Za=k,Ta(Va));Ta(Wa);da&&Rc!==l&&r.Ca(\"pre-main prep time: \"+(Date.now()-Rc)+\" ms\");r._main&&Tc&&r.callMain(a);if(r.postRun)for(\"function\"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)ab(r.postRun.shift());Ta(Ya)}}a=a||r.arguments;Rc===l&&(Rc=Date.now());if(!(0<cb)){if(r.preRun)for(\"function\"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)$a(r.preRun.shift());Ta(Ua);!(0<cb)&&!r.calledRun&&(r.setStatus?\n(r.setStatus(\"Running...\"),setTimeout(function(){setTimeout(function(){r.setStatus(\"\")},1);b()},1)):b())}}r.run=r.Ui=Uc;function Vc(a){r.noExitRuntime||(pa=k,v=Qc,Ta(Xa),s?(process.stdout.once(\"drain\",function(){process.exit(a)}),console.log(\" \"),setTimeout(function(){process.exit(a)},500)):ga&&\"function\"===typeof quit&&quit(a),e(new ka(a)))}r.exit=r.wi=Vc;\nfunction ma(a){a&&(r.print(a),r.Ca(a));pa=k;e(\"abort() at \"+La()+\"\\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.\")}r.abort=r.abort=ma;if(r.preInit)for(\"function\"==typeof r.preInit&&(r.preInit=[r.preInit]);0<r.preInit.length;)r.preInit.pop()();var Tc=k;r.noInitialRun&&(Tc=m);Uc();var Database,Wc,Y,Z,Xc,Yc,Zc,$c,ad,bd,cd,dd,ed,fd,gd,hd,id,jd,kd,ld,md,nd,od,pd,qd,rd,td,w=r.Runtime;Z=w.Ma(4);Y={};function $(a,b){this.L=a;this.db=b;this.ua=1;this.gc=[]}\n$.prototype.bind=function(a){this.reset();return Array.isArray(a)?this.me(a):this.ne(a)};$.prototype.step=function(){var a;this.L||e(\"Statement closed\");this.ua=1;switch(a=td(this.L)){case Y.$d:return k;case Y.DONE:return m;default:return this.db.handleError(a)}};$.prototype.We=function(a){a==l&&(a=this.ua++);return gd(this.L,a)};$.prototype.Xe=function(a){a==l&&(a=this.ua++);return id(this.L,a)};\n$.prototype.getBlob=function(a){var b,c,d,f;a==l&&(a=this.ua++);d=fd(this.L,a);b=ed(this.L,a);c=new Uint8Array(d);for(a=f=0;0<=d?f<d:f>d;a=0<=d?++f:--f)c[a]=D[b+a];return c};$.prototype.get=function(a){var b,c,d;a!=l&&this.bind(a)&&this.step();d=[];a=b=0;for(c=kd(this.L);0<=c?b<c:b>c;a=0<=c?++b:--b)switch(jd(this.L,a)){case Y.Xd:case Y.FLOAT:d.push(this.We(a));break;case Y.ae:d.push(this.Xe(a));break;case Y.Nd:d.push(this.getBlob(a));break;default:d.push(l)}return d};\n$.prototype.getColumnNames=function(){var a,b,c,d;d=[];a=b=0;for(c=kd(this.L);0<=c?b<c:b>c;a=0<=c?++b:--b)d.push(hd(this.L,a));return d};$.prototype.getAsObject=function(a){var b,c,d,f,h,i;f=this.get(a);c=this.getColumnNames();d={};a=h=0;for(i=c.length;h<i;a=++h)b=c[a],d[b]=f[a];return d};$.prototype.run=function(a){a!=l&&this.bind(a);this.step();return this.reset()};q=$.prototype;\nq.qe=function(a,b){var c,d;b==l&&(b=this.ua++);c=N(a);this.gc.push(d=H(c,\"i8\",F));this.db.handleError(bd(this.L,b,d,c.length-1,0))};q.le=function(a,b){var c;b==l&&(b=this.ua++);this.gc.push(c=H(a,\"i8\",F));this.db.handleError(Yc(this.L,b,c,a.length,0))};q.pe=function(a,b){b==l&&(b=this.ua++);this.db.handleError((a===(a|0)?$c:Zc)(this.L,b,a))};q.oe=function(a){a==l&&(a=this.ua++);Yc(this.L,a,0,0,0)};\nq.Yc=function(a,b){b==l&&(b=this.ua++);switch(typeof a){case \"string\":this.qe(a,b);break;case \"number\":case \"boolean\":this.pe(a+0,b);break;case \"object\":if(a===l){this.oe(b);break}if(a.length!=l){this.le(a,b);break}e(\"Wrong API use : tried to bind a value of an unknown type (\"+a+\").\")}};q.ne=function(a){var b,c,d;for(b in a)d=a[b],c=ad(this.L,b),0!==c&&this.Yc(d,c);return k};q.me=function(a){var b,c,d,f;b=d=0;for(f=a.length;d<f;b=++d)c=a[b],this.Yc(c,b+1);return k};\n$.prototype.reset=function(){this.od();return cd(this.L)===Y.Bb&&rd(this.L)===Y.Bb};$.prototype.od=function(){for(var a;a=this.gc.pop();)Ka(a)};$.prototype.free=function(){var a;this.od();a=nd(this.L)===Y.Bb;delete this.db.Yb[this.L];this.L=Wc;return a};function ud(a){this.filename=\"dbfile_\"+(4294967295*Math.random()>>>0);a!=l&&z.Gb(\"/\",this.filename,a,k,k);this.handleError(od(this.filename,Z));this.db=Ga(Z,\"i32\");this.Yb={}}\nud.prototype.run=function(a,b){var c;this.db||e(\"Database closed\");b?(c=this.prepare(a,b),c.step(),c.free()):this.handleError(md(this.db,a,0,0,Z));return this};\nud.prototype.exec=function(a){var b,c,d,f,h;this.db||e(\"Database closed\");f=w.Xb();c=w.Ma(a.length<<3);xa(a,c);a=w.Ma(4);for(d=[];Ga(c,\"i8\")!==Wc;)if(ya(Z,0,\"i32\"),ya(a,0,\"i32\"),this.handleError(qd(this.db,c,-1,Z,a)),b=Ga(Z,\"i32\"),c=Ga(a,\"i32\"),b!==Wc){h=new $(b,this);for(b=l;h.step();)b===l&&(b={columns:h.getColumnNames(),values:[]},d.push(b)),b.values.push(h.get());h.free()}w.Wb(f);return d};\nud.prototype.each=function(a,b,c,d){\"function\"===typeof b&&(d=c,c=b,b=g);for(a=this.prepare(a,b);a.step();)c(a.getAsObject());a.free();if(\"function\"===typeof d)return d()};ud.prototype.prepare=function(a,b){var c,d;ya(Z,0,\"i32\");this.handleError(pd(this.db,a,-1,Z,Wc));c=Ga(Z,\"i32\");c===Wc&&e(\"Nothing to prepare\");d=new $(c,this);b!=l&&d.bind(b);return this.Yb[c]=d};\nud.prototype[\"export\"]=function(){var a,b,c;c=this.Yb;for(b in c)a=c[b],a.free();this.handleError(dd(this.db));a=z.Ef(this.filename,{encoding:\"binary\"});this.handleError(od(this.filename,Z));this.db=Ga(Z,\"i32\");return a};ud.prototype.close=function(){var a,b,c;c=this.Yb;for(b in c)a=c[b],a.free();this.handleError(dd(this.db));z.Da(\"/\"+this.filename);return this.db=l};ud.prototype.handleError=function(a){if(a===Y.Bb)return l;a=ld(this.db);e(Error(a))};Database=ud;\nod=r.cwrap(\"sqlite3_open\",\"number\",[\"string\",\"number\"]);dd=r.cwrap(\"sqlite3_close_v2\",\"number\",[\"number\"]);md=r.cwrap(\"sqlite3_exec\",\"number\",[\"number\",\"string\",\"number\",\"number\",\"number\"]);r.cwrap(\"sqlite3_free\",\"\",[\"number\"]);pd=r.cwrap(\"sqlite3_prepare_v2\",\"number\",[\"number\",\"string\",\"number\",\"number\",\"number\"]);qd=r.cwrap(\"sqlite3_prepare_v2\",\"number\",[\"number\",\"number\",\"number\",\"number\",\"number\"]);bd=r.cwrap(\"sqlite3_bind_text\",\"number\",[\"number\",\"number\",\"number\",\"number\",\"number\"]);\nYc=r.cwrap(\"sqlite3_bind_blob\",\"number\",[\"number\",\"number\",\"number\",\"number\",\"number\"]);Zc=r.cwrap(\"sqlite3_bind_double\",\"number\",[\"number\",\"number\",\"number\"]);$c=r.cwrap(\"sqlite3_bind_int\",\"number\",[\"number\",\"number\",\"number\"]);ad=r.cwrap(\"sqlite3_bind_parameter_index\",\"number\",[\"number\",\"string\"]);td=r.cwrap(\"sqlite3_step\",\"number\",[\"number\"]);ld=r.cwrap(\"sqlite3_errmsg\",\"string\",[\"number\"]);kd=r.cwrap(\"sqlite3_data_count\",\"number\",[\"number\"]);\ngd=r.cwrap(\"sqlite3_column_double\",\"number\",[\"number\",\"number\"]);id=r.cwrap(\"sqlite3_column_text\",\"string\",[\"number\",\"number\"]);ed=r.cwrap(\"sqlite3_column_blob\",\"number\",[\"number\",\"number\"]);fd=r.cwrap(\"sqlite3_column_bytes\",\"number\",[\"number\",\"number\"]);jd=r.cwrap(\"sqlite3_column_type\",\"number\",[\"number\",\"number\"]);hd=r.cwrap(\"sqlite3_column_name\",\"string\",[\"number\",\"number\"]);rd=r.cwrap(\"sqlite3_reset\",\"number\",[\"number\"]);cd=r.cwrap(\"sqlite3_clear_bindings\",\"number\",[\"number\"]);\nnd=r.cwrap(\"sqlite3_finalize\",\"number\",[\"number\"]);this.SQL={Database:Database};for(Xc in this.SQL)r[Xc]=this.SQL[Xc];Wc=0;Y.Bb=0;Y.xh=1;Y.Oh=2;Y.$h=3;Y.Sf=4;Y.Uf=5;Y.Rh=6;Y.Vh=7;Y.ci=8;Y.Ph=9;Y.Qh=10;Y.Xf=11;Y.Xh=12;Y.Nh=13;Y.Vf=14;Y.ai=15;Y.EMPTY=16;Y.di=17;Y.fi=18;Y.Wf=19;Y.Sh=20;Y.Th=21;Y.Uh=22;Y.Tf=23;Y.Mh=24;Y.bi=25;Y.Wh=26;Y.Yh=27;Y.ji=28;Y.$d=100;Y.DONE=101;Y.Xd=1;Y.FLOAT=2;Y.ae=3;Y.Nd=4;Y.Zh=5;\n\nreturn this['SQL'];\n})();\nif (typeof module !== 'undefined') module.exports = SQL;\nif (typeof define === 'function') define(SQL);\n"
  },
  {
    "path": "libs/summernote/summernote-ext-hello.js",
    "content": "(function(factory) {\n  /* global define */\n  if (typeof define === 'function' && define.amd) {\n    // AMD. Register as an anonymous module.\n    define(['jquery'], factory);\n  } else if (typeof module === 'object' && module.exports) {\n    // Node/CommonJS\n    module.exports = factory(require('jquery'));\n  } else {\n    // Browser globals\n    factory(window.jQuery);\n  }\n}(function($) {\n  // Extends plugins for adding hello.\n  //  - plugin is external module for customizing.\n  $.extend($.summernote.plugins, {\n    /**\n     * @param {Object} context - context object has status of editor.\n     */\n    'hello': function(context) {\n      var self = this;\n\n      // ui has renders to build ui elements.\n      //  - you can create a button with `ui.button`\n      var ui = $.summernote.ui;\n\n      // add hello button\n      context.memo('button.hello', function() {\n        // create button\n        var button = ui.button({\n          contents: '<i class=\"fa fa-child\"/> Hello',\n          tooltip: 'hello',\n          click: function() {\n            self.$panel.show();\n            self.$panel.hide(500);\n            // invoke insertText method with 'hello' on editor module.\n            context.invoke('editor.insertText', 'hello');\n          },\n        });\n\n        // create jQuery object from button instance.\n        var $hello = button.render();\n        return $hello;\n      });\n\n      // This events will be attached when editor is initialized.\n      this.events = {\n        // This will be called after modules are initialized.\n        'summernote.init': function(we, e) {\n          console.log('summernote initialized', we, e);\n        },\n        // This will be called when user releases a key on editable.\n        'summernote.keyup': function(we, e) {\n          console.log('summernote keyup', we, e);\n        },\n      };\n\n      // This method will be called when editor is initialized by $('..').summernote();\n      // You can create elements for plugin\n      this.initialize = function() {\n        this.$panel = $('<div class=\"hello-panel\"/>').css({\n          position: 'absolute',\n          width: 100,\n          height: 100,\n          left: '50%',\n          top: '50%',\n          background: 'red',\n        }).hide();\n\n        this.$panel.appendTo('body');\n      };\n\n      // This methods will be called when editor is destroyed by $('..').summernote('destroy');\n      // You should remove elements on `initialize`.\n      this.destroy = function() {\n        this.$panel.remove();\n        this.$panel = null;\n      };\n    },\n  });\n}));\n"
  },
  {
    "path": "libs/summernote/summernote-ext-hint.js",
    "content": "(function (factory) {\n  /* global define */\n  if (typeof define === 'function' && define.amd) {\n    // AMD. Register as an anonymous module.\n    define(['jquery'], factory);\n  } else {\n    // Browser globals: jQuery\n    factory(window.jQuery);\n  }\n}(function ($) {\n  var range = $.summernote.core.range;\n  var list = $.summernote.core.list;\n\n  var KEY = {\n    UP: 38,\n    DOWN: 40,\n    ENTER: 13\n  };\n\n  var DROPDOWN_KEYCODES = [38, 40, 13];\n\n  /**\n   * @class plugin.hint\n   * \n   * Hello Plugin  \n   */\n  $.summernote.addPlugin({\n    /** @property {String} name name of plugin */\n    name: 'hint',\n\n    /**\n     * @param {jQuery} $node\n     */\n    scrollTo: function ($node) {\n      var $parent = $node.parent();\n      $parent[0].scrollTop = $node[0].offsetTop - ($parent.innerHeight() / 2);\n    },\n\n    /**\n     * @param {jQuery} $popover\n     */\n    moveDown: function ($popover) {\n      var index = $popover.find('.active').index();\n      this.activate($popover, (index === -1) ? 0 : (index + 1) % $popover.children().length);\n    },\n\n    /**\n     * @param {jQuery} $popover\n     */\n    moveUp: function ($popover) {\n      var index = $popover.find('.active').index();\n      this.activate($popover, (index === -1) ? 0 : (index - 1) % $popover.children().length);\n    },\n\n    /**\n     * @param {jQuery} $popover\n     * @param {Number} i\n     */\n    activate: function ($popover, idx) {\n      idx = idx || 0;\n\n      if (idx < 0) {\n        idx = $popover.children().length - 1;\n      }\n\n      $popover.children().removeClass('active');\n      var $activeItem = $popover.children().eq(idx);\n      $activeItem.addClass('active');\n\n      this.scrollTo($activeItem);\n    },\n\n    /**\n     * @param {jQuery} $popover\n     */\n    replace: function ($popover) {\n      var wordRange = $popover.data('wordRange');\n      var $activeItem = $popover.find('.active');\n      var content = this.content($activeItem.html(), $activeItem.data('keyword'));\n\n      if (typeof content === 'string') {\n        content = document.createTextNode(content);\n      }\n\n      $popover.removeData('wordRange');\n\n      wordRange.insertNode(content);\n      range.createFromNode(content).collapse().select();\n    },\n\n    /**\n     * @param {String} keyword\n     * @return {Object|null}\n     */\n    searchKeyword: function (keyword) {\n      var triggerChar = keyword.charAt(0);\n\n      if (triggerChar === ':' && keyword.length > 1) {\n        var trigger = keyword.toLowerCase().replace(':', '');\n        return {\n          type: 'emoji',\n          list: $.grep(this.emojiKeys, function (item) {\n            return item.indexOf(trigger) === 0;\n          })\n        };\n      }\n\n      return null;\n    },\n\n    /**\n     * create items\n     *\n     * @param {Object} searchResult\n     * @param {String} searchResult.type\n     * @param {String[]} searchResult.list\n     * @return {jQuery[]}\n     */\n    createItems: function (searchResult) {\n      var items = [];\n      var list = searchResult.list;\n\n      for (var i = 0, len = list.length; i < len; i++) {\n        var $item = $('<a class=\"list-group-item\"></a>');\n        $item.append(this.createItem(list[i]));\n        $item.data('keyword', list[i]);\n        items.push($item);\n      }\n\n      if (items.length) {\n        items[0].addClass('active');\n      }\n\n      return items;\n    },\n\n    /**\n     * create list item template\n     *\n     * @param {Object} item\n     * @returns {String}\n     */\n    createItem: function (item) {\n      var content = this.emojiInfo[item];\n      return '<img src=\"' + content + '\" width=\"20\" /> :' + item + ':';\n    },\n\n    /**\n     * create inserted content to add in summernote\n     *\n     * @param {String} html\n     * @param {String} keyword\n     * @return {Node|String}\n     */\n    content: function (html, item) {\n      var url = this.emojiInfo[item];\n\n      if (url) {\n        var $img = $('<img />').attr('src', url).css({\n          width : 20\n        });\n        return $img[0];\n      }\n\n      return html;\n    },\n\n    /**\n     * @return {Promise}\n     */\n    loadEmojis: function () {\n      var self = this;\n      return $.getJSON('https://api.github.com/emojis').then(function (data) {\n        self.emojiKeys = Object.keys(data);\n        self.emojiInfo = data;\n      });\n    },\n\n    init: function (layoutInfo) {\n      var self = this;\n\n      var $note = layoutInfo.holder();\n      var $popover = $('<div class=\"list-group\" />').css({\n        position: 'absolute',\n        'max-height': 300,\n        'overflow-y': 'scroll',\n        'display': 'none'\n      });\n\n      // FIXME We need a handler for unload resources.\n      $popover.on('click', '.list-group-item', function () {\n        self.replace($popover);\n\n        $popover.hide();\n        $note.summernote('focus');\n      });\n\n      $(document).on('click', function () {\n        $popover.hide();\n      });\n\n      $note.on('summernote.keydown', function (customEvent, nativeEvent) {\n        if ($popover.css('display') !== 'block') {\n          return;\n        }\n\n        if (nativeEvent.keyCode === KEY.DOWN) {\n          nativeEvent.preventDefault();\n          self.moveDown($popover);\n        } else if (nativeEvent.keyCode === KEY.UP) {\n          nativeEvent.preventDefault();\n          self.moveUp($popover);\n        } else if (nativeEvent.keyCode === KEY.ENTER) {\n          nativeEvent.preventDefault();\n          self.replace($popover);\n\n          $popover.hide();\n          $note.summernote('focus');\n        }\n      });\n\n      $note.on('summernote.keyup', function (customEvent, nativeEvent) {\n        if (DROPDOWN_KEYCODES.indexOf(nativeEvent.keyCode) === -1) {\n          var wordRange = $(this).summernote('createRange').getWordRange();\n          var result = self.searchKeyword(wordRange.toString());\n          if (!result || !result.list.length) {\n            $popover.hide();\n            return;\n          }\n\n          layoutInfo.popover().append($popover);\n\n          var rect = list.last(wordRange.getClientRects());\n          $popover.html(self.createItems(result)).css({\n            left: rect.left,\n            top: rect.top + rect.height\n          }).data('wordRange', wordRange).show();\n        }\n      });\n\n      this.loadEmojis();\n    },\n\n    // FIXME Summernote doesn't support event pipeline yet.\n    //  - Plugin -> Base Code\n    events: {\n      ENTER: function () {\n        // prevent ENTER key\n        return false;\n      }\n    }\n  });\n}));\n"
  },
  {
    "path": "libs/summernote/summernote-ext-video.js",
    "content": "(function (factory) {\n  /* global define */\n  if (typeof define === 'function' && define.amd) {\n    // AMD. Register as an anonymous module.\n    define(['jquery'], factory);\n  } else {\n    // Browser globals: jQuery\n    factory(window.jQuery);\n  }\n}(function ($) {\n  // template\n  var tmpl = $.summernote.renderer.getTemplate();\n\n  // core functions: range, dom\n  var range = $.summernote.core.range;\n  var dom = $.summernote.core.dom;\n\n  /**\n   * createVideoNode\n   *  \n   * @member plugin.video\n   * @private\n   * @param {String} url\n   * @return {Node}\n   */\n  var createVideoNode = function (url) {\n    // video url patterns(youtube, instagram, vimeo, dailymotion, youku, mp4, ogg, webm)\n    var ytRegExp = /^(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11})(?:\\S+)?$/;\n    var ytMatch = url.match(ytRegExp);\n\n    var igRegExp = /\\/\\/instagram.com\\/p\\/(.[a-zA-Z0-9]*)/;\n    var igMatch = url.match(igRegExp);\n\n    var vRegExp = /\\/\\/vine.co\\/v\\/(.[a-zA-Z0-9]*)/;\n    var vMatch = url.match(vRegExp);\n\n    var vimRegExp = /\\/\\/(player.)?vimeo.com\\/([a-z]*\\/)*([0-9]{6,11})[?]?.*/;\n    var vimMatch = url.match(vimRegExp);\n\n    var dmRegExp = /.+dailymotion.com\\/(video|hub)\\/([^_]+)[^#]*(#video=([^_&]+))?/;\n    var dmMatch = url.match(dmRegExp);\n\n    var youkuRegExp = /\\/\\/v\\.youku\\.com\\/v_show\\/id_(\\w+)=*\\.html/;\n    var youkuMatch = url.match(youkuRegExp);\n\n    var mp4RegExp = /^.+.(mp4|m4v)$/;\n    var mp4Match = url.match(mp4RegExp);\n\n    var oggRegExp = /^.+.(ogg|ogv)$/;\n    var oggMatch = url.match(oggRegExp);\n\n    var webmRegExp = /^.+.(webm)$/;\n    var webmMatch = url.match(webmRegExp);\n\n    var $video;\n    if (ytMatch && ytMatch[1].length === 11) {\n      var youtubeId = ytMatch[1];\n      $video = $('<iframe>')\n        .attr('frameborder', 0)\n        .attr('src', '//www.youtube.com/embed/' + youtubeId)\n        .attr('width', '640').attr('height', '360');\n    } else if (igMatch && igMatch[0].length) {\n      $video = $('<iframe>')\n        .attr('frameborder', 0)\n        .attr('src', igMatch[0] + '/embed/')\n        .attr('width', '612').attr('height', '710')\n        .attr('scrolling', 'no')\n        .attr('allowtransparency', 'true');\n    } else if (vMatch && vMatch[0].length) {\n      $video = $('<iframe>')\n        .attr('frameborder', 0)\n        .attr('src', vMatch[0] + '/embed/simple')\n        .attr('width', '600').attr('height', '600')\n        .attr('class', 'vine-embed');\n    } else if (vimMatch && vimMatch[3].length) {\n      $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')\n        .attr('frameborder', 0)\n        .attr('src', '//player.vimeo.com/video/' + vimMatch[3])\n        .attr('width', '640').attr('height', '360');\n    } else if (dmMatch && dmMatch[2].length) {\n      $video = $('<iframe>')\n        .attr('frameborder', 0)\n        .attr('src', '//www.dailymotion.com/embed/video/' + dmMatch[2])\n        .attr('width', '640').attr('height', '360');\n    } else if (youkuMatch && youkuMatch[1].length) {\n      $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')\n        .attr('frameborder', 0)\n        .attr('height', '498')\n        .attr('width', '510')\n        .attr('src', '//player.youku.com/embed/' + youkuMatch[1]);\n    } else if (mp4Match || oggMatch || webmMatch) {\n      $video = $('<video controls>')\n        .attr('src', url)\n        .attr('width', '640').attr('height', '360');\n    } else {\n      // this is not a known video link. Now what, Cat? Now what?\n      return false;\n    }\n\n    return $video[0];\n  };\n\n  /**\n   * @member plugin.video\n   * @private\n   * @param {jQuery} $editable\n   * @return {String}\n   */\n  var getTextOnRange = function ($editable) {\n    $editable.focus();\n\n    var rng = range.create();\n\n    // if range on anchor, expand range with anchor\n    if (rng.isOnAnchor()) {\n      var anchor = dom.ancestor(rng.sc, dom.isAnchor);\n      rng = range.createFromNode(anchor);\n    }\n\n    return rng.toString();\n  };\n\n  /**\n   * toggle button status\n   *  \n   * @member plugin.video\n   * @private\n   * @param {jQuery} $btn\n   * @param {Boolean} isEnable\n   */\n  var toggleBtn = function ($btn, isEnable) {\n    $btn.toggleClass('disabled', !isEnable);\n    $btn.attr('disabled', !isEnable);\n  };\n\n  /**\n   * Show video dialog and set event handlers on dialog controls.\n   *\n   * @member plugin.video\n   * @private\n   * @param {jQuery} $dialog\n   * @param {jQuery} $dialog\n   * @param {Object} text\n   * @return {Promise}\n   */\n  var showVideoDialog = function ($editable, $dialog, text) {\n    return $.Deferred(function (deferred) {\n      var $videoDialog = $dialog.find('.note-video-dialog');\n\n      var $videoUrl = $videoDialog.find('.note-video-url'),\n          $videoBtn = $videoDialog.find('.note-video-btn');\n\n      $videoDialog.one('shown.bs.modal', function () {\n        $videoUrl.val(text).on('input', function () {\n          toggleBtn($videoBtn, $videoUrl.val());\n        }).trigger('focus');\n\n        $videoBtn.click(function (event) {\n          event.preventDefault();\n\n          deferred.resolve($videoUrl.val());\n          $videoDialog.modal('hide');\n        });\n      }).one('hidden.bs.modal', function () {\n        $videoUrl.off('input');\n        $videoBtn.off('click');\n\n        if (deferred.state() === 'pending') {\n          deferred.reject();\n        }\n      }).modal('show');\n    });\n  };\n\n  /**\n   * @class plugin.video\n   *\n   * Video Plugin\n   *\n   * video plugin is to make embeded video tag.\n   *\n   * ### load script\n   *\n   * ```\n   * < script src=\"plugin/summernote-ext-video.js\"></script >\n   * ```\n   *\n   * ### use a plugin in toolbar\n   * ```\n   *    $(\"#editor\").summernote({\n   *    ...\n   *    toolbar : [\n   *        ['group', [ 'video' ]]\n   *    ]\n   *    ...    \n   *    });\n   * ```\n   */\n  $.summernote.addPlugin({\n    /** @property {String} name name of plugin */\n    name: 'video',\n    /**\n     * @property {Object} buttons\n     * @property {function(object): string} buttons.video\n     */\n    buttons: {\n      video: function (lang, options) {\n        return tmpl.iconButton(options.iconPrefix + 'youtube-play', {\n          event: 'showVideoDialog',\n          title: lang.video.video,\n          hide: true\n        });\n      }\n    },\n\n    /**\n     * @property {Object} dialogs\n     * @property {function(object, object): string} dialogs.video\n    */\n    dialogs: {\n      video: function (lang) {\n        var body = '<div class=\"form-group row-fluid\">' +\n                     '<label>' + lang.video.url + ' <small class=\"text-muted\">' + lang.video.providers + '</small></label>' +\n                     '<input class=\"note-video-url form-control span12\" type=\"text\" />' +\n                   '</div>';\n        var footer = '<button href=\"#\" class=\"btn btn-primary note-video-btn disabled\" disabled>' + lang.video.insert + '</button>';\n        return tmpl.dialog('note-video-dialog', lang.video.insert, body, footer);\n      }\n    },\n    /**\n     * @property {Object} events\n     * @property {Function} events.showVideoDialog\n     */\n    events: {\n      showVideoDialog: function (event, editor, layoutInfo) {\n        var $dialog = layoutInfo.dialog(),\n            $editable = layoutInfo.editable(),\n            text = getTextOnRange($editable);\n\n        // save current range\n        editor.saveRange($editable);\n\n        showVideoDialog($editable, $dialog, text).then(function (url) {\n          // when ok button clicked\n\n          // restore range\n          editor.restoreRange($editable);\n          \n          // build node\n          var $node = createVideoNode(url);\n          \n          if ($node) {\n            // insert video node\n            editor.insertNode($editable, $node);\n          }\n        }).fail(function () {\n          // when cancel button clicked\n          editor.restoreRange($editable);\n        });\n      }\n    },\n\n    // define language\n    langs: {\n      'en-US': {\n        video: {\n          video: 'Video',\n          videoLink: 'Video Link',\n          insert: 'Insert Video',\n          url: 'Video URL?',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion or Youku)'\n        }\n      },\n      'ar-AR': {\n        video: {\n          video: 'فيديو',\n          videoLink: 'رابط الفيديو',\n          insert: 'إدراج الفيديو',\n          url: 'رابط الفيديو',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion ou Youku)'\n        }\n      },\n      'ca-ES': {\n        video: {\n          video: 'Video',\n          videoLink: 'Enllaç del video',\n          insert: 'Inserir video',\n          url: 'URL del video?',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, o Youku)'\n        }\n      },\n      'cs-CZ': {\n        video: {\n          video: 'Video',\n          videoLink: 'Odkaz videa',\n          insert: 'Vložit video',\n          url: 'URL videa?',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion nebo Youku)'\n        }\n      },\n      'da-DK': {\n        video: {\n          video: 'Video',\n          videoLink: 'Video Link',\n          insert: 'Indsæt Video',\n          url: 'Video URL?',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion eller Youku)'\n        }\n      },\n      'de-DE': {\n        video: {\n          video: 'Video',\n          videoLink: 'Video Link',\n          insert: 'Video einfügen',\n          url: 'Video URL?',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, oder Youku)'\n        }\n      },\n      'es-ES': {\n        video: {\n          video: 'Video',\n          videoLink: 'Link del video',\n          insert: 'Insertar video',\n          url: '¿URL del video?',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, o Youku)'\n        }\n      },\n      'es-EU': {\n        video: {\n          video: 'Bideoa',\n          videoLink: 'Bideorako esteka',\n          insert: 'Bideo berri bat txertatu',\n          url: 'Bideoaren URL helbidea',\n          providers: '(YouTube, Vimeo, Vine, Instagram, edo DailyMotion)'\n        }\n      },\n      'fa-IR': {\n        video: {\n          video: 'ویدیو',\n          videoLink: 'لینک ویدیو',\n          insert: 'افزودن ویدیو',\n          url: 'آدرس ویدیو ؟',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, یا Youku)'\n        }\n      },\n      'fi-FI': {\n        video: {\n          video: 'Video',\n          videoLink: 'Linkki videoon',\n          insert: 'Lisää video',\n          url: 'Videon URL-osoite?',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion tai Youku)'\n        }\n      },\n      'fr-FR': {\n        video: {\n          video: 'Vidéo',\n          videoLink: 'Lien vidéo',\n          insert: 'Insérer une vidéo',\n          url: 'URL de la vidéo',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion ou Youku)'\n        }\n      },\n      'he-IL': {\n        video: {\n          video: 'סרטון',\n          videoLink: 'קישור לסרטון',\n          insert: 'הוסף סרטון',\n          url: 'קישור לסרטון',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion או Youku)'\n        }\n      },\n      'hu-HU': {\n        video: {\n          video: 'Videó',\n          videoLink: 'Videó hivatkozás',\n          insert: 'Videó beszúrása',\n          url: 'Videó URL címe',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, vagy Youku)'\n        }\n      },\n      'id-ID': {\n        video: {\n          video: 'Video',\n          videoLink: 'Link video',\n          insert: 'Sisipkan video',\n          url: 'Tautan video',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, atau Youku)'\n        }\n      },\n      'it-IT': {\n        video: {\n          video: 'Video',\n          videoLink: 'Collegamento ad un Video',\n          insert: 'Inserisci Video',\n          url: 'URL del Video',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion o Youku)'\n        }\n      },\n      'ja-JP': {\n        video: {\n          video: '動画',\n          videoLink: '動画リンク',\n          insert: '動画挿入',\n          url: '動画のURL',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, Youku)'\n        }\n      },\n      'ko-KR': {\n        video: {\n          video: '동영상',\n          videoLink: '동영상 링크',\n          insert: '동영상 추가',\n          url: '동영상 URL',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, Youku 사용 가능)'\n        }\n      },\n      'nb-NO': {\n        video: {\n          video: 'Video',\n          videoLink: 'Videolenke',\n          insert: 'Sett inn video',\n          url: 'Video-URL',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion eller Youku)'\n        }\n      },\n      'nl-NL': {\n        video: {\n          video: 'Video',\n          videoLink: 'Video link',\n          insert: 'Video invoegen',\n          url: 'URL van de video',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion of Youku)'\n        }\n      },\n      'pl-PL': {\n        video: {\n          video: 'Wideo',\n          videoLink: 'Adres wideo',\n          insert: 'Wstaw wideo',\n          url: 'Adres wideo',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, lub Youku)'\n        }\n      },\n      'pt-BR': {\n        video: {\n          video: 'Vídeo',\n          videoLink: 'Link para vídeo',\n          insert: 'Inserir vídeo',\n          url: 'URL do vídeo?',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, ou Youku)'\n        }\n      },\n      'ro-RO': {\n        video: {\n          video: 'Video',\n          videoLink: 'Link video',\n          insert: 'Inserează video',\n          url: 'URL video?',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion, sau Youku)'\n        }\n      },\n      'ru-RU': {\n        video: {\n          video: 'Видео',\n          videoLink: 'Ссылка на видео',\n          insert: 'Вставить видео',\n          url: 'URL видео',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion или Youku)'\n        }\n      },\n      'sk-SK': {\n        video: {\n          video: 'Video',\n          videoLink: 'Odkaz videa',\n          insert: 'Vložiť video',\n          url: 'URL videa?',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion nebo Youku)'\n        }\n      },\n      'sl-SI': {\n        video: {\n          video: 'Video',\n          videoLink: 'Video povezava',\n          insert: 'Vstavi video',\n          url: 'Povezava do videa',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion ali Youku)'\n        }\n      },\n      'sr-RS': {\n        video: {\n          video: 'Видео',\n          videoLink: 'Веза ка видеу',\n          insert: 'Уметни видео',\n          url: 'URL видео',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion или Youku)'\n        }\n      },\n      'sr-RS-Latin': {\n        video: {\n          video: 'Video',\n          videoLink: 'Veza ka videu',\n          insert: 'Umetni video',\n          url: 'URL video',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion ili Youku)'\n        }\n      },\n      'sv-SE': {\n        video: {\n          video: 'Filmklipp',\n          videoLink: 'Länk till filmklipp',\n          insert: 'Infoga filmklipp',\n          url: 'Länk till filmklipp',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion eller Youku)'\n        }\n      },\n      'th-TH': {\n        video: {\n          video: 'วีดีโอ',\n          videoLink: 'ลิงก์ของวีดีโอ',\n          insert: 'แทรกวีดีโอ',\n          url: 'ที่อยู่ URL ของวีดีโอ?',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion หรือ Youku)'\n        }\n      },\n      'tr-TR': {\n        video: {\n          video: 'Video',\n          videoLink: 'Video bağlantısı',\n          insert: 'Video ekle',\n          url: 'Video bağlantısı?',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion veya Youku)'\n        }\n      },\n      'uk-UA': {\n        video: {\n          video: 'Відео',\n          videoLink: 'Посилання на відео',\n          insert: 'Вставити відео',\n          url: 'URL відео',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion чи Youku)'\n        }\n      },\n      'vi-VN': {\n        video: {\n          video: 'Video',\n          videoLink: 'Đường Dẫn đến Video',\n          insert: 'Chèn Video',\n          url: 'URL',\n          providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion và Youku)'\n        }\n      },\n      'zh-CN': {\n        video: {\n          video: '视频',\n          videoLink: '视频链接',\n          insert: '插入视频',\n          url: '视频地址',\n          providers: '(优酷, Instagram, DailyMotion, Youtube等)'\n        }\n      },\n      'zh-TW': {\n        video: {\n          video: '影片',\n          videoLink: '影片連結',\n          insert: '插入影片',\n          url: '影片網址',\n          providers: '(優酷, Instagram, DailyMotion, Youtube等)'\n        }\n      }\n    }\n  });\n}));\n"
  },
  {
    "path": "libs/summernote/summernote.css",
    "content": "@font-face{font-family:\"summernote\";font-style:normal;font-weight:normal;src:url(\"./font/summernote.eot?1d9aeaaff0a8939558a45be6cd52cd4c\");src:url(\"./font/summernote.eot?1d9aeaaff0a8939558a45be6cd52cd4c#iefix\") format(\"embedded-opentype\"),url(\"./font/summernote.woff?1d9aeaaff0a8939558a45be6cd52cd4c\") format(\"woff\"),url(\"./font/summernote.ttf?1d9aeaaff0a8939558a45be6cd52cd4c\") format(\"truetype\")}[class^=\"note-icon-\"]:before,[class*=\" note-icon-\"]:before{display:inline-block;font:normal normal normal 14px summernote;font-size:inherit;-webkit-font-smoothing:antialiased;text-decoration:inherit;text-rendering:auto;text-transform:none;vertical-align:middle;speak:none;-moz-osx-font-smoothing:grayscale}.note-icon-align-center:before,.note-icon-align-indent:before,.note-icon-align-justify:before,.note-icon-align-left:before,.note-icon-align-outdent:before,.note-icon-align-right:before,.note-icon-align:before,.note-icon-arrow-circle-down:before,.note-icon-arrow-circle-left:before,.note-icon-arrow-circle-right:before,.note-icon-arrow-circle-up:before,.note-icon-arrows-alt:before,.note-icon-arrows-h:before,.note-icon-arrows-v:before,.note-icon-bold:before,.note-icon-caret:before,.note-icon-chain-broken:before,.note-icon-circle:before,.note-icon-close:before,.note-icon-code:before,.note-icon-col-after:before,.note-icon-col-before:before,.note-icon-col-remove:before,.note-icon-eraser:before,.note-icon-float-left:before,.note-icon-float-none:before,.note-icon-float-right:before,.note-icon-font:before,.note-icon-frame:before,.note-icon-italic:before,.note-icon-link:before,.note-icon-magic:before,.note-icon-menu-check:before,.note-icon-minus:before,.note-icon-orderedlist:before,.note-icon-pencil:before,.note-icon-picture:before,.note-icon-question:before,.note-icon-redo:before,.note-icon-rollback:before,.note-icon-row-above:before,.note-icon-row-below:before,.note-icon-row-remove:before,.note-icon-special-character:before,.note-icon-square:before,.note-icon-strikethrough:before,.note-icon-subscript:before,.note-icon-summernote:before,.note-icon-superscript:before,.note-icon-table:before,.note-icon-text-height:before,.note-icon-trash:before,.note-icon-underline:before,.note-icon-undo:before,.note-icon-unorderedlist:before,.note-icon-video:before{display:inline-block;font-family:\"summernote\";font-style:normal;font-weight:normal;text-decoration:inherit}.note-icon-align-center:before{content:\"\\f101\"}.note-icon-align-indent:before{content:\"\\f102\"}.note-icon-align-justify:before{content:\"\\f103\"}.note-icon-align-left:before{content:\"\\f104\"}.note-icon-align-outdent:before{content:\"\\f105\"}.note-icon-align-right:before{content:\"\\f106\"}.note-icon-align:before{content:\"\\f107\"}.note-icon-arrow-circle-down:before{content:\"\\f108\"}.note-icon-arrow-circle-left:before{content:\"\\f109\"}.note-icon-arrow-circle-right:before{content:\"\\f10a\"}.note-icon-arrow-circle-up:before{content:\"\\f10b\"}.note-icon-arrows-alt:before{content:\"\\f10c\"}.note-icon-arrows-h:before{content:\"\\f10d\"}.note-icon-arrows-v:before{content:\"\\f10e\"}.note-icon-bold:before{content:\"\\f10f\"}.note-icon-caret:before{content:\"\\f110\"}.note-icon-chain-broken:before{content:\"\\f111\"}.note-icon-circle:before{content:\"\\f112\"}.note-icon-close:before{content:\"\\f113\"}.note-icon-code:before{content:\"\\f114\"}.note-icon-col-after:before{content:\"\\f115\"}.note-icon-col-before:before{content:\"\\f116\"}.note-icon-col-remove:before{content:\"\\f117\"}.note-icon-eraser:before{content:\"\\f118\"}.note-icon-float-left:before{content:\"\\f119\"}.note-icon-float-none:before{content:\"\\f11a\"}.note-icon-float-right:before{content:\"\\f11b\"}.note-icon-font:before{content:\"\\f11c\"}.note-icon-frame:before{content:\"\\f11d\"}.note-icon-italic:before{content:\"\\f11e\"}.note-icon-link:before{content:\"\\f11f\"}.note-icon-magic:before{content:\"\\f120\"}.note-icon-menu-check:before{content:\"\\f121\"}.note-icon-minus:before{content:\"\\f122\"}.note-icon-orderedlist:before{content:\"\\f123\"}.note-icon-pencil:before{content:\"\\f124\"}.note-icon-picture:before{content:\"\\f125\"}.note-icon-question:before{content:\"\\f126\"}.note-icon-redo:before{content:\"\\f127\"}.note-icon-rollback:before{content:\"\\f128\"}.note-icon-row-above:before{content:\"\\f129\"}.note-icon-row-below:before{content:\"\\f12a\"}.note-icon-row-remove:before{content:\"\\f12b\"}.note-icon-special-character:before{content:\"\\f12c\"}.note-icon-square:before{content:\"\\f12d\"}.note-icon-strikethrough:before{content:\"\\f12e\"}.note-icon-subscript:before{content:\"\\f12f\"}.note-icon-summernote:before{content:\"\\f130\"}.note-icon-superscript:before{content:\"\\f131\"}.note-icon-table:before{content:\"\\f132\"}.note-icon-text-height:before{content:\"\\f133\"}.note-icon-trash:before{content:\"\\f134\"}.note-icon-underline:before{content:\"\\f135\"}.note-icon-undo:before{content:\"\\f136\"}.note-icon-unorderedlist:before{content:\"\\f137\"}.note-icon-video:before{content:\"\\f138\"}.note-editor{position:relative}.note-editor .note-dropzone{position:absolute;z-index:100;display:none;color:#87cefa;background-color:#fff;opacity:.95}.note-editor .note-dropzone .note-dropzone-message{display:table-cell;font-size:28px;font-weight:700;text-align:center;vertical-align:middle}.note-editor .note-dropzone.hover{color:#098ddf}.note-editor.dragover .note-dropzone{display:table}.note-editor .note-editing-area{position:relative}.note-editor .note-editing-area .note-editable{outline:0}.note-editor .note-editing-area .note-editable sup{vertical-align:super}.note-editor .note-editing-area .note-editable sub{vertical-align:sub}.note-editor .note-editing-area img.note-float-left{margin-right:10px}.note-editor .note-editing-area img.note-float-right{margin-left:10px}.note-editor.note-frame{border:1px solid #a9a9a9}.note-editor.note-frame.codeview .note-editing-area .note-editable{display:none}.note-editor.note-frame.codeview .note-editing-area .note-codable{display:block}.note-editor.note-frame .note-editing-area{overflow:hidden}.note-editor.note-frame .note-editing-area .note-editable{padding:10px;overflow:auto;color:#000;word-wrap:break-word;background-color:#fff}.note-editor.note-frame .note-editing-area .note-editable[contenteditable=\"false\"]{background-color:#e5e5e5}.note-editor.note-frame .note-editing-area .note-codable{display:none;width:100%;padding:10px;margin-bottom:0;font-family:Menlo,Monaco,monospace,sans-serif;font-size:14px;color:#ccc;background-color:#222;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;outline:0;box-shadow:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;resize:none}.note-editor.note-frame.fullscreen{position:fixed;top:0;left:0;z-index:1050;width:100%!important}.note-editor.note-frame.fullscreen .note-editable{background-color:#fff}.note-editor.note-frame.fullscreen .note-resizebar{display:none}.note-editor.note-frame .note-status-output{display:block;width:100%;height:20px;margin-bottom:0;font-size:14px;line-height:1.42857143;color:#000;border:0;border-top:1px solid #e2e2e2}.note-editor.note-frame .note-status-output:empty{height:0;border-top:0 solid transparent}.note-editor.note-frame .note-status-output .pull-right{float:right!important}.note-editor.note-frame .note-status-output .text-muted{color:#777}.note-editor.note-frame .note-status-output .text-primary{color:#286090}.note-editor.note-frame .note-status-output .text-success{color:#3c763d}.note-editor.note-frame .note-status-output .text-info{color:#31708f}.note-editor.note-frame .note-status-output .text-warning{color:#8a6d3b}.note-editor.note-frame .note-status-output .text-danger{color:#a94442}.note-editor.note-frame .note-status-output .alert{padding:7px 10px 2px 10px;margin:-7px 0 0 0;color:#000;background-color:#f5f5f5;border-radius:0}.note-editor.note-frame .note-status-output .alert .note-icon{margin-right:5px}.note-editor.note-frame .note-status-output .alert-success{color:#3c763d!important;background-color:#dff0d8!important}.note-editor.note-frame .note-status-output .alert-info{color:#31708f!important;background-color:#d9edf7!important}.note-editor.note-frame .note-status-output .alert-warning{color:#8a6d3b!important;background-color:#fcf8e3!important}.note-editor.note-frame .note-status-output .alert-danger{color:#a94442!important;background-color:#f2dede!important}.note-editor.note-frame .note-statusbar{background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.note-editor.note-frame .note-statusbar .note-resizebar{width:100%;height:9px;padding-top:1px;cursor:ns-resize}.note-editor.note-frame .note-statusbar .note-resizebar .note-icon-bar{width:20px;margin:1px auto;border-top:1px solid #a9a9a9}.note-editor.note-frame .note-statusbar.locked .note-resizebar{cursor:default}.note-editor.note-frame .note-statusbar.locked .note-resizebar .note-icon-bar{display:none}.note-editor.note-frame .note-placeholder{padding:10px}.note-popover.popover{max-width:none}.note-popover.popover .popover-content a{display:inline-block;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}.note-popover.popover .arrow{left:20px!important}.note-toolbar{position:relative;z-index:500}.note-popover .popover-content,.panel-heading.note-toolbar{padding:0 0 5px 5px;margin:0}.note-popover .popover-content>.btn-group,.panel-heading.note-toolbar>.btn-group{margin-top:5px;margin-right:5px;margin-left:0}.note-popover .popover-content .btn-group .note-table,.panel-heading.note-toolbar .btn-group .note-table{min-width:0;padding:5px}.note-popover .popover-content .btn-group .note-table .note-dimension-picker,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker{font-size:18px}.note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-mousecatcher,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-mousecatcher{position:absolute!important;z-index:3;width:10em;height:10em;cursor:pointer}.note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-unhighlighted,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-unhighlighted{position:relative!important;z-index:1;width:5em;height:5em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIj4+Pjp6ekKlAqjAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKhmnaJzPAAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-popover .popover-content .btn-group .note-table .note-dimension-picker .note-dimension-picker-highlighted,.panel-heading.note-toolbar .btn-group .note-table .note-dimension-picker .note-dimension-picker-highlighted{position:absolute!important;z-index:2;width:1em;height:1em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIjd6vvD2f9LKLW+AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKwNDEVT0AAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-popover .popover-content .note-style .dropdown-style blockquote,.panel-heading.note-toolbar .note-style .dropdown-style blockquote,.note-popover .popover-content .note-style .dropdown-style pre,.panel-heading.note-toolbar .note-style .dropdown-style pre{padding:5px 10px;margin:0}.note-popover .popover-content .note-style .dropdown-style h1,.panel-heading.note-toolbar .note-style .dropdown-style h1,.note-popover .popover-content .note-style .dropdown-style h2,.panel-heading.note-toolbar .note-style .dropdown-style h2,.note-popover .popover-content .note-style .dropdown-style h3,.panel-heading.note-toolbar .note-style .dropdown-style h3,.note-popover .popover-content .note-style .dropdown-style h4,.panel-heading.note-toolbar .note-style .dropdown-style h4,.note-popover .popover-content .note-style .dropdown-style h5,.panel-heading.note-toolbar .note-style .dropdown-style h5,.note-popover .popover-content .note-style .dropdown-style h6,.panel-heading.note-toolbar .note-style .dropdown-style h6,.note-popover .popover-content .note-style .dropdown-style p,.panel-heading.note-toolbar .note-style .dropdown-style p{padding:0;margin:0}.note-popover .popover-content .note-color-all .dropdown-menu,.panel-heading.note-toolbar .note-color-all .dropdown-menu{min-width:337px}.note-popover .popover-content .note-color .dropdown-toggle,.panel-heading.note-toolbar .note-color .dropdown-toggle{width:20px;padding-left:5px}.note-popover .popover-content .note-color .dropdown-menu .note-palette,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette{display:inline-block;width:160px;margin:0}.note-popover .popover-content .note-color .dropdown-menu .note-palette:first-child,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette:first-child{margin:0 5px}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-palette-title,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-palette-title{margin:2px 7px;font-size:12px;text-align:center;border-bottom:1px solid #eee}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-color-reset,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-color-reset,.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-color-select,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-color-select{width:100%;padding:0 3px;margin:3px;font-size:11px;cursor:pointer;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-color-row,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-color-row{height:20px}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-color-reset:hover,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-color-reset:hover{background:#eee}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-color-select-btn,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-color-select-btn{display:none}.note-popover .popover-content .note-color .dropdown-menu .note-palette .note-holder-custom .note-color-btn,.panel-heading.note-toolbar .note-color .dropdown-menu .note-palette .note-holder-custom .note-color-btn{border:1px solid #eee}.note-popover .popover-content .note-para .dropdown-menu,.panel-heading.note-toolbar .note-para .dropdown-menu{min-width:216px;padding:5px}.note-popover .popover-content .note-para .dropdown-menu>div:first-child,.panel-heading.note-toolbar .note-para .dropdown-menu>div:first-child{margin-right:5px}.note-popover .popover-content .dropdown-menu,.panel-heading.note-toolbar .dropdown-menu{min-width:90px}.note-popover .popover-content .dropdown-menu.right,.panel-heading.note-toolbar .dropdown-menu.right{right:0;left:auto}.note-popover .popover-content .dropdown-menu.right::before,.panel-heading.note-toolbar .dropdown-menu.right::before{right:9px;left:auto!important}.note-popover .popover-content .dropdown-menu.right::after,.panel-heading.note-toolbar .dropdown-menu.right::after{right:10px;left:auto!important}.note-popover .popover-content .dropdown-menu.note-check li a i,.panel-heading.note-toolbar .dropdown-menu.note-check li a i{color:deepskyblue;visibility:hidden}.note-popover .popover-content .dropdown-menu.note-check li a.checked i,.panel-heading.note-toolbar .dropdown-menu.note-check li a.checked i{visibility:visible}.note-popover .popover-content .note-fontsize-10,.panel-heading.note-toolbar .note-fontsize-10{font-size:10px}.note-popover .popover-content .note-color-palette,.panel-heading.note-toolbar .note-color-palette{line-height:1}.note-popover .popover-content .note-color-palette div .note-color-btn,.panel-heading.note-toolbar .note-color-palette div .note-color-btn{width:20px;height:20px;padding:0;margin:0;border:1px solid #fff}.note-popover .popover-content .note-color-palette div .note-color-btn:hover,.panel-heading.note-toolbar .note-color-palette div .note-color-btn:hover{border:1px solid #000}.note-dialog>div{display:none}.note-dialog .form-group{margin-right:0;margin-left:0}.note-dialog .note-modal-form{margin:0}.note-dialog .note-image-dialog .note-dropzone{min-height:100px;margin-bottom:10px;font-size:30px;line-height:4;color:lightgray;text-align:center;border:4px dashed lightgray}@-moz-document url-prefix(){.note-image-input{height:auto}}.note-placeholder{position:absolute;display:none;color:gray}.note-handle .note-control-selection{position:absolute;display:none;border:1px solid #000}.note-handle .note-control-selection>div{position:absolute}.note-handle .note-control-selection .note-control-selection-bg{width:100%;height:100%;background-color:#000;-webkit-opacity:.3;-khtml-opacity:.3;-moz-opacity:.3;opacity:.3;-ms-filter:alpha(opacity=30);filter:alpha(opacity=30)}.note-handle .note-control-selection .note-control-handle{width:7px;height:7px;border:1px solid #000}.note-handle .note-control-selection .note-control-holder{width:7px;height:7px;border:1px solid #000}.note-handle .note-control-selection .note-control-sizing{width:7px;height:7px;background-color:#fff;border:1px solid #000}.note-handle .note-control-selection .note-control-nw{top:-5px;left:-5px;border-right:0;border-bottom:0}.note-handle .note-control-selection .note-control-ne{top:-5px;right:-5px;border-bottom:0;border-left:none}.note-handle .note-control-selection .note-control-sw{bottom:-5px;left:-5px;border-top:0;border-right:0}.note-handle .note-control-selection .note-control-se{right:-5px;bottom:-5px;cursor:se-resize}.note-handle .note-control-selection .note-control-se.note-control-holder{cursor:default;border-top:0;border-left:none}.note-handle .note-control-selection .note-control-selection-info{right:0;bottom:0;padding:5px;margin:5px;font-size:12px;color:#fff;background-color:#000;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-opacity:.7;-khtml-opacity:.7;-moz-opacity:.7;opacity:.7;-ms-filter:alpha(opacity=70);filter:alpha(opacity=70)}.note-hint-popover{min-width:100px;padding:2px}.note-hint-popover .popover-content{max-height:150px;padding:3px;overflow:auto}.note-hint-popover .popover-content .note-hint-group .note-hint-item{display:block!important;padding:3px}.note-hint-popover .popover-content .note-hint-group .note-hint-item.active,.note-hint-popover .popover-content .note-hint-group .note-hint-item:hover{display:block;clear:both;font-weight:400;line-height:1.4;color:#fff;text-decoration:none;white-space:nowrap;cursor:pointer;background-color:#428bca;outline:0}"
  },
  {
    "path": "libs/summernote/summernote.js",
    "content": "/**\n * Super simple wysiwyg editor v0.8.12\n * https://summernote.org\n *\n * Copyright 2013- Alan Hong. and other contributors\n * summernote may be freely distributed under the MIT license.\n *\n * Date: 2019-05-16T08:16Z\n */\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery')) :\n  typeof define === 'function' && define.amd ? define(['jquery'], factory) :\n  (global = global || self, factory(global.jQuery));\n}(this, function ($$1) { 'use strict';\n\n  $$1 = $$1 && $$1.hasOwnProperty('default') ? $$1['default'] : $$1;\n\n  var Renderer = /** @class */ (function () {\n      function Renderer(markup, children, options, callback) {\n          this.markup = markup;\n          this.children = children;\n          this.options = options;\n          this.callback = callback;\n      }\n      Renderer.prototype.render = function ($parent) {\n          var $node = $$1(this.markup);\n          if (this.options && this.options.contents) {\n              $node.html(this.options.contents);\n          }\n          if (this.options && this.options.className) {\n              $node.addClass(this.options.className);\n          }\n          if (this.options && this.options.data) {\n              $$1.each(this.options.data, function (k, v) {\n                  $node.attr('data-' + k, v);\n              });\n          }\n          if (this.options && this.options.click) {\n              $node.on('click', this.options.click);\n          }\n          if (this.children) {\n              var $container_1 = $node.find('.note-children-container');\n              this.children.forEach(function (child) {\n                  child.render($container_1.length ? $container_1 : $node);\n              });\n          }\n          if (this.callback) {\n              this.callback($node, this.options);\n          }\n          if (this.options && this.options.callback) {\n              this.options.callback($node);\n          }\n          if ($parent) {\n              $parent.append($node);\n          }\n          return $node;\n      };\n      return Renderer;\n  }());\n  var renderer = {\n      create: function (markup, callback) {\n          return function () {\n              var options = typeof arguments[1] === 'object' ? arguments[1] : arguments[0];\n              var children = Array.isArray(arguments[0]) ? arguments[0] : [];\n              if (options && options.children) {\n                  children = options.children;\n              }\n              return new Renderer(markup, children, options, callback);\n          };\n      }\n  };\n\n  var editor = renderer.create('<div class=\"note-editor note-frame panel panel-default\"/>');\n  var toolbar = renderer.create('<div class=\"note-toolbar panel-heading\" role=\"toolbar\"></div></div>');\n  var editingArea = renderer.create('<div class=\"note-editing-area\"/>');\n  var codable = renderer.create('<textarea class=\"note-codable\" role=\"textbox\" aria-multiline=\"true\"/>');\n  var editable = renderer.create('<div class=\"note-editable\" contentEditable=\"true\" role=\"textbox\" aria-multiline=\"true\"/>');\n  var statusbar = renderer.create([\n      '<output class=\"note-status-output\" aria-live=\"polite\"/>',\n      '<div class=\"note-statusbar\" role=\"status\">',\n      '  <div class=\"note-resizebar\" role=\"seperator\" aria-orientation=\"horizontal\" aria-label=\"Resize\">',\n      '    <div class=\"note-icon-bar\"/>',\n      '    <div class=\"note-icon-bar\"/>',\n      '    <div class=\"note-icon-bar\"/>',\n      '  </div>',\n      '</div>',\n  ].join(''));\n  var airEditor = renderer.create('<div class=\"note-editor\"/>');\n  var airEditable = renderer.create([\n      '<div class=\"note-editable\" contentEditable=\"true\" role=\"textbox\" aria-multiline=\"true\"/>',\n      '<output class=\"note-status-output\" aria-live=\"polite\"/>',\n  ].join(''));\n  var buttonGroup = renderer.create('<div class=\"note-btn-group btn-group\">');\n  var dropdown = renderer.create('<ul class=\"dropdown-menu\" role=\"list\">', function ($node, options) {\n      var markup = Array.isArray(options.items) ? options.items.map(function (item) {\n          var value = (typeof item === 'string') ? item : (item.value || '');\n          var content = options.template ? options.template(item) : item;\n          var option = (typeof item === 'object') ? item.option : undefined;\n          var dataValue = 'data-value=\"' + value + '\"';\n          var dataOption = (option !== undefined) ? ' data-option=\"' + option + '\"' : '';\n          return '<li role=\"listitem\" aria-label=\"' + value + '\"><a href=\"#\" ' + (dataValue + dataOption) + '>' + content + '</a></li>';\n      }).join('') : options.items;\n      $node.html(markup).attr({ 'aria-label': options.title });\n  });\n  var dropdownButtonContents = function (contents, options) {\n      return contents + ' ' + icon(options.icons.caret, 'span');\n  };\n  var dropdownCheck = renderer.create('<ul class=\"dropdown-menu note-check\" role=\"list\">', function ($node, options) {\n      var markup = Array.isArray(options.items) ? options.items.map(function (item) {\n          var value = (typeof item === 'string') ? item : (item.value || '');\n          var content = options.template ? options.template(item) : item;\n          return '<li role=\"listitem\" aria-label=\"' + item + '\"><a href=\"#\" data-value=\"' + value + '\">' + icon(options.checkClassName) + ' ' + content + '</a></li>';\n      }).join('') : options.items;\n      $node.html(markup).attr({ 'aria-label': options.title });\n  });\n  var palette = renderer.create('<div class=\"note-color-palette\"/>', function ($node, options) {\n      var contents = [];\n      for (var row = 0, rowSize = options.colors.length; row < rowSize; row++) {\n          var eventName = options.eventName;\n          var colors = options.colors[row];\n          var colorsName = options.colorsName[row];\n          var buttons = [];\n          for (var col = 0, colSize = colors.length; col < colSize; col++) {\n              var color = colors[col];\n              var colorName = colorsName[col];\n              buttons.push([\n                  '<button type=\"button\" class=\"note-color-btn\"',\n                  'style=\"background-color:', color, '\" ',\n                  'data-event=\"', eventName, '\" ',\n                  'data-value=\"', color, '\" ',\n                  'title=\"', colorName, '\" ',\n                  'aria-label=\"', colorName, '\" ',\n                  'data-toggle=\"button\" tabindex=\"-1\"></button>',\n              ].join(''));\n          }\n          contents.push('<div class=\"note-color-row\">' + buttons.join('') + '</div>');\n      }\n      $node.html(contents.join(''));\n      if (options.tooltip) {\n          $node.find('.note-color-btn').tooltip({\n              container: options.container,\n              trigger: 'hover',\n              placement: 'bottom'\n          });\n      }\n  });\n  var dialog = renderer.create('<div class=\"modal\" aria-hidden=\"false\" tabindex=\"-1\" role=\"dialog\"/>', function ($node, options) {\n      if (options.fade) {\n          $node.addClass('fade');\n      }\n      $node.attr({\n          'aria-label': options.title\n      });\n      $node.html([\n          '<div class=\"modal-dialog\">',\n          '  <div class=\"modal-content\">',\n          (options.title\n              ? '    <div class=\"modal-header\">' +\n                  '      <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\" aria-hidden=\"true\">&times;</button>' +\n                  '      <h4 class=\"modal-title\">' + options.title + '</h4>' +\n                  '    </div>' : ''),\n          '    <div class=\"modal-body\">' + options.body + '</div>',\n          (options.footer\n              ? '    <div class=\"modal-footer\">' + options.footer + '</div>' : ''),\n          '  </div>',\n          '</div>',\n      ].join(''));\n  });\n  var popover = renderer.create([\n      '<div class=\"note-popover popover in\">',\n      '  <div class=\"arrow\"/>',\n      '  <div class=\"popover-content note-children-container\"/>',\n      '</div>',\n  ].join(''), function ($node, options) {\n      var direction = typeof options.direction !== 'undefined' ? options.direction : 'bottom';\n      $node.addClass(direction);\n      if (options.hideArrow) {\n          $node.find('.arrow').hide();\n      }\n  });\n  var checkbox = renderer.create('<div class=\"checkbox\"></div>', function ($node, options) {\n      $node.html([\n          '<label' + (options.id ? ' for=\"' + options.id + '\"' : '') + '>',\n          ' <input role=\"checkbox\" type=\"checkbox\"' + (options.id ? ' id=\"' + options.id + '\"' : ''),\n          (options.checked ? ' checked' : ''),\n          ' aria-checked=\"' + (options.checked ? 'true' : 'false') + '\"/>',\n          (options.text ? options.text : ''),\n          '</label>',\n      ].join(''));\n  });\n  var icon = function (iconClassName, tagName) {\n      tagName = tagName || 'i';\n      return '<' + tagName + ' class=\"' + iconClassName + '\"/>';\n  };\n  var ui = {\n      editor: editor,\n      toolbar: toolbar,\n      editingArea: editingArea,\n      codable: codable,\n      editable: editable,\n      statusbar: statusbar,\n      airEditor: airEditor,\n      airEditable: airEditable,\n      buttonGroup: buttonGroup,\n      dropdown: dropdown,\n      dropdownButtonContents: dropdownButtonContents,\n      dropdownCheck: dropdownCheck,\n      palette: palette,\n      dialog: dialog,\n      popover: popover,\n      checkbox: checkbox,\n      icon: icon,\n      options: {},\n      button: function ($node, options) {\n          return renderer.create('<button type=\"button\" class=\"note-btn btn btn-default btn-sm\" role=\"button\" tabindex=\"-1\">', function ($node, options) {\n              if (options && options.tooltip) {\n                  $node.attr({\n                      title: options.tooltip,\n                      'aria-label': options.tooltip\n                  }).tooltip({\n                      container: (options.container !== undefined) ? options.container : 'body',\n                      trigger: 'hover',\n                      placement: 'bottom'\n                  }).on('click', function (e) {\n                      $$1(e.currentTarget).tooltip('hide');\n                  });\n              }\n          })($node, options);\n      },\n      toggleBtn: function ($btn, isEnable) {\n          $btn.toggleClass('disabled', !isEnable);\n          $btn.attr('disabled', !isEnable);\n      },\n      toggleBtnActive: function ($btn, isActive) {\n          $btn.toggleClass('active', isActive);\n      },\n      onDialogShown: function ($dialog, handler) {\n          $dialog.one('shown.bs.modal', handler);\n      },\n      onDialogHidden: function ($dialog, handler) {\n          $dialog.one('hidden.bs.modal', handler);\n      },\n      showDialog: function ($dialog) {\n          $dialog.modal('show');\n      },\n      hideDialog: function ($dialog) {\n          $dialog.modal('hide');\n      },\n      createLayout: function ($note, options) {\n          var $editor = (options.airMode ? ui.airEditor([\n              ui.editingArea([\n                  ui.airEditable(),\n              ]),\n          ]) : ui.editor([\n              ui.toolbar(),\n              ui.editingArea([\n                  ui.codable(),\n                  ui.editable(),\n              ]),\n              ui.statusbar(),\n          ])).render();\n          $editor.insertAfter($note);\n          return {\n              note: $note,\n              editor: $editor,\n              toolbar: $editor.find('.note-toolbar'),\n              editingArea: $editor.find('.note-editing-area'),\n              editable: $editor.find('.note-editable'),\n              codable: $editor.find('.note-codable'),\n              statusbar: $editor.find('.note-statusbar')\n          };\n      },\n      removeLayout: function ($note, layoutInfo) {\n          $note.html(layoutInfo.editable.html());\n          layoutInfo.editor.remove();\n          $note.show();\n      }\n  };\n\n  $$1.summernote = $$1.summernote || {\n      lang: {}\n  };\n  $$1.extend($$1.summernote.lang, {\n      'en-US': {\n          font: {\n              bold: 'Bold',\n              italic: 'Italic',\n              underline: 'Underline',\n              clear: 'Remove Font Style',\n              height: 'Line Height',\n              name: 'Font Family',\n              strikethrough: 'Strikethrough',\n              subscript: 'Subscript',\n              superscript: 'Superscript',\n              size: 'Font Size'\n          },\n          image: {\n              image: 'Picture',\n              insert: 'Insert Image',\n              resizeFull: 'Resize full',\n              resizeHalf: 'Resize half',\n              resizeQuarter: 'Resize quarter',\n              resizeNone: 'Original size',\n              floatLeft: 'Float Left',\n              floatRight: 'Float Right',\n              floatNone: 'Remove float',\n              shapeRounded: 'Shape: Rounded',\n              shapeCircle: 'Shape: Circle',\n              shapeThumbnail: 'Shape: Thumbnail',\n              shapeNone: 'Shape: None',\n              dragImageHere: 'Drag image or text here',\n              dropImage: 'Drop image or Text',\n              selectFromFiles: 'Select from files',\n              maximumFileSize: 'Maximum file size',\n              maximumFileSizeError: 'Maximum file size exceeded.',\n              url: 'Image URL',\n              remove: 'Remove Image',\n              original: 'Original'\n          },\n          video: {\n              video: 'Video',\n              videoLink: 'Video Link',\n              insert: 'Insert Video',\n              url: 'Video URL',\n              providers: '(YouTube, Vimeo, Vine, Instagram, DailyMotion or Youku)'\n          },\n          link: {\n              link: 'Link',\n              insert: 'Insert Link',\n              unlink: 'Unlink',\n              edit: 'Edit',\n              textToDisplay: 'Text to display',\n              url: 'To what URL should this link go?',\n              openInNewWindow: 'Open in new window'\n          },\n          table: {\n              table: 'Table',\n              addRowAbove: 'Add row above',\n              addRowBelow: 'Add row below',\n              addColLeft: 'Add column left',\n              addColRight: 'Add column right',\n              delRow: 'Delete row',\n              delCol: 'Delete column',\n              delTable: 'Delete table'\n          },\n          hr: {\n              insert: 'Insert Horizontal Rule'\n          },\n          style: {\n              style: 'Style',\n              p: 'Normal',\n              blockquote: 'Quote',\n              pre: 'Code',\n              h1: 'Header 1',\n              h2: 'Header 2',\n              h3: 'Header 3',\n              h4: 'Header 4',\n              h5: 'Header 5',\n              h6: 'Header 6'\n          },\n          lists: {\n              unordered: 'Unordered list',\n              ordered: 'Ordered list'\n          },\n          options: {\n              help: 'Help',\n              fullscreen: 'Full Screen',\n              codeview: 'Code View'\n          },\n          paragraph: {\n              paragraph: 'Paragraph',\n              outdent: 'Outdent',\n              indent: 'Indent',\n              left: 'Align left',\n              center: 'Align center',\n              right: 'Align right',\n              justify: 'Justify full'\n          },\n          color: {\n              recent: 'Recent Color',\n              more: 'More Color',\n              background: 'Background Color',\n              foreground: 'Foreground Color',\n              transparent: 'Transparent',\n              setTransparent: 'Set transparent',\n              reset: 'Reset',\n              resetToDefault: 'Reset to default',\n              cpSelect: 'Select'\n          },\n          shortcut: {\n              shortcuts: 'Keyboard shortcuts',\n              close: 'Close',\n              textFormatting: 'Text formatting',\n              action: 'Action',\n              paragraphFormatting: 'Paragraph formatting',\n              documentStyle: 'Document Style',\n              extraKeys: 'Extra keys'\n          },\n          help: {\n              'insertParagraph': 'Insert Paragraph',\n              'undo': 'Undoes the last command',\n              'redo': 'Redoes the last command',\n              'tab': 'Tab',\n              'untab': 'Untab',\n              'bold': 'Set a bold style',\n              'italic': 'Set a italic style',\n              'underline': 'Set a underline style',\n              'strikethrough': 'Set a strikethrough style',\n              'removeFormat': 'Clean a style',\n              'justifyLeft': 'Set left align',\n              'justifyCenter': 'Set center align',\n              'justifyRight': 'Set right align',\n              'justifyFull': 'Set full align',\n              'insertUnorderedList': 'Toggle unordered list',\n              'insertOrderedList': 'Toggle ordered list',\n              'outdent': 'Outdent on current paragraph',\n              'indent': 'Indent on current paragraph',\n              'formatPara': 'Change current block\\'s format as a paragraph(P tag)',\n              'formatH1': 'Change current block\\'s format as H1',\n              'formatH2': 'Change current block\\'s format as H2',\n              'formatH3': 'Change current block\\'s format as H3',\n              'formatH4': 'Change current block\\'s format as H4',\n              'formatH5': 'Change current block\\'s format as H5',\n              'formatH6': 'Change current block\\'s format as H6',\n              'insertHorizontalRule': 'Insert horizontal rule',\n              'linkDialog.show': 'Show Link Dialog'\n          },\n          history: {\n              undo: 'Undo',\n              redo: 'Redo'\n          },\n          specialChar: {\n              specialChar: 'SPECIAL CHARACTERS',\n              select: 'Select Special characters'\n          }\n      }\n  });\n\n  var isSupportAmd = typeof define === 'function' && define.amd; // eslint-disable-line\n  /**\n   * returns whether font is installed or not.\n   *\n   * @param {String} fontName\n   * @return {Boolean}\n   */\n  function isFontInstalled(fontName) {\n      var testFontName = fontName === 'Comic Sans MS' ? 'Courier New' : 'Comic Sans MS';\n      var testText = 'mmmmmmmmmmwwwww';\n      var testSize = '200px';\n      var canvas = document.createElement('canvas');\n      var context = canvas.getContext('2d');\n      context.font = testSize + \" '\" + testFontName + \"'\";\n      var originalWidth = context.measureText(testText).width;\n      context.font = testSize + \" '\" + fontName + \"', '\" + testFontName + \"'\";\n      var width = context.measureText(testText).width;\n      return originalWidth !== width;\n  }\n  var userAgent = navigator.userAgent;\n  var isMSIE = /MSIE|Trident/i.test(userAgent);\n  var browserVersion;\n  if (isMSIE) {\n      var matches = /MSIE (\\d+[.]\\d+)/.exec(userAgent);\n      if (matches) {\n          browserVersion = parseFloat(matches[1]);\n      }\n      matches = /Trident\\/.*rv:([0-9]{1,}[.0-9]{0,})/.exec(userAgent);\n      if (matches) {\n          browserVersion = parseFloat(matches[1]);\n      }\n  }\n  var isEdge = /Edge\\/\\d+/.test(userAgent);\n  var hasCodeMirror = !!window.CodeMirror;\n  var isSupportTouch = (('ontouchstart' in window) ||\n      (navigator.MaxTouchPoints > 0) ||\n      (navigator.msMaxTouchPoints > 0));\n  // [workaround] IE doesn't have input events for contentEditable\n  // - see: https://goo.gl/4bfIvA\n  var inputEventName = (isMSIE || isEdge) ? 'DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted' : 'input';\n  /**\n   * @class core.env\n   *\n   * Object which check platform and agent\n   *\n   * @singleton\n   * @alternateClassName env\n   */\n  var env = {\n      isMac: navigator.appVersion.indexOf('Mac') > -1,\n      isMSIE: isMSIE,\n      isEdge: isEdge,\n      isFF: !isEdge && /firefox/i.test(userAgent),\n      isPhantom: /PhantomJS/i.test(userAgent),\n      isWebkit: !isEdge && /webkit/i.test(userAgent),\n      isChrome: !isEdge && /chrome/i.test(userAgent),\n      isSafari: !isEdge && /safari/i.test(userAgent),\n      browserVersion: browserVersion,\n      jqueryVersion: parseFloat($$1.fn.jquery),\n      isSupportAmd: isSupportAmd,\n      isSupportTouch: isSupportTouch,\n      hasCodeMirror: hasCodeMirror,\n      isFontInstalled: isFontInstalled,\n      isW3CRangeSupport: !!document.createRange,\n      inputEventName: inputEventName\n  };\n\n  /**\n   * @class core.func\n   *\n   * func utils (for high-order func's arg)\n   *\n   * @singleton\n   * @alternateClassName func\n   */\n  function eq(itemA) {\n      return function (itemB) {\n          return itemA === itemB;\n      };\n  }\n  function eq2(itemA, itemB) {\n      return itemA === itemB;\n  }\n  function peq2(propName) {\n      return function (itemA, itemB) {\n          return itemA[propName] === itemB[propName];\n      };\n  }\n  function ok() {\n      return true;\n  }\n  function fail() {\n      return false;\n  }\n  function not(f) {\n      return function () {\n          return !f.apply(f, arguments);\n      };\n  }\n  function and(fA, fB) {\n      return function (item) {\n          return fA(item) && fB(item);\n      };\n  }\n  function self(a) {\n      return a;\n  }\n  function invoke(obj, method) {\n      return function () {\n          return obj[method].apply(obj, arguments);\n      };\n  }\n  var idCounter = 0;\n  /**\n   * generate a globally-unique id\n   *\n   * @param {String} [prefix]\n   */\n  function uniqueId(prefix) {\n      var id = ++idCounter + '';\n      return prefix ? prefix + id : id;\n  }\n  /**\n   * returns bnd (bounds) from rect\n   *\n   * - IE Compatibility Issue: http://goo.gl/sRLOAo\n   * - Scroll Issue: http://goo.gl/sNjUc\n   *\n   * @param {Rect} rect\n   * @return {Object} bounds\n   * @return {Number} bounds.top\n   * @return {Number} bounds.left\n   * @return {Number} bounds.width\n   * @return {Number} bounds.height\n   */\n  function rect2bnd(rect) {\n      var $document = $(document);\n      return {\n          top: rect.top + $document.scrollTop(),\n          left: rect.left + $document.scrollLeft(),\n          width: rect.right - rect.left,\n          height: rect.bottom - rect.top\n      };\n  }\n  /**\n   * returns a copy of the object where the keys have become the values and the values the keys.\n   * @param {Object} obj\n   * @return {Object}\n   */\n  function invertObject(obj) {\n      var inverted = {};\n      for (var key in obj) {\n          if (obj.hasOwnProperty(key)) {\n              inverted[obj[key]] = key;\n          }\n      }\n      return inverted;\n  }\n  /**\n   * @param {String} namespace\n   * @param {String} [prefix]\n   * @return {String}\n   */\n  function namespaceToCamel(namespace, prefix) {\n      prefix = prefix || '';\n      return prefix + namespace.split('.').map(function (name) {\n          return name.substring(0, 1).toUpperCase() + name.substring(1);\n      }).join('');\n  }\n  /**\n   * Returns a function, that, as long as it continues to be invoked, will not\n   * be triggered. The function will be called after it stops being called for\n   * N milliseconds. If `immediate` is passed, trigger the function on the\n   * leading edge, instead of the trailing.\n   * @param {Function} func\n   * @param {Number} wait\n   * @param {Boolean} immediate\n   * @return {Function}\n   */\n  function debounce(func, wait, immediate) {\n      var timeout;\n      return function () {\n          var context = this;\n          var args = arguments;\n          var later = function () {\n              timeout = null;\n              if (!immediate) {\n                  func.apply(context, args);\n              }\n          };\n          var callNow = immediate && !timeout;\n          clearTimeout(timeout);\n          timeout = setTimeout(later, wait);\n          if (callNow) {\n              func.apply(context, args);\n          }\n      };\n  }\n  /**\n   *\n   * @param {String} url\n   * @return {Boolean}\n   */\n  function isValidUrl(url) {\n      var expression = /[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#?&//=]*)/gi;\n      return expression.test(url);\n  }\n  var func = {\n      eq: eq,\n      eq2: eq2,\n      peq2: peq2,\n      ok: ok,\n      fail: fail,\n      self: self,\n      not: not,\n      and: and,\n      invoke: invoke,\n      uniqueId: uniqueId,\n      rect2bnd: rect2bnd,\n      invertObject: invertObject,\n      namespaceToCamel: namespaceToCamel,\n      debounce: debounce,\n      isValidUrl: isValidUrl\n  };\n\n  /**\n   * returns the first item of an array.\n   *\n   * @param {Array} array\n   */\n  function head(array) {\n      return array[0];\n  }\n  /**\n   * returns the last item of an array.\n   *\n   * @param {Array} array\n   */\n  function last(array) {\n      return array[array.length - 1];\n  }\n  /**\n   * returns everything but the last entry of the array.\n   *\n   * @param {Array} array\n   */\n  function initial(array) {\n      return array.slice(0, array.length - 1);\n  }\n  /**\n   * returns the rest of the items in an array.\n   *\n   * @param {Array} array\n   */\n  function tail(array) {\n      return array.slice(1);\n  }\n  /**\n   * returns item of array\n   */\n  function find(array, pred) {\n      for (var idx = 0, len = array.length; idx < len; idx++) {\n          var item = array[idx];\n          if (pred(item)) {\n              return item;\n          }\n      }\n  }\n  /**\n   * returns true if all of the values in the array pass the predicate truth test.\n   */\n  function all(array, pred) {\n      for (var idx = 0, len = array.length; idx < len; idx++) {\n          if (!pred(array[idx])) {\n              return false;\n          }\n      }\n      return true;\n  }\n  /**\n   * returns true if the value is present in the list.\n   */\n  function contains(array, item) {\n      if (array && array.length && item) {\n          return array.indexOf(item) !== -1;\n      }\n      return false;\n  }\n  /**\n   * get sum from a list\n   *\n   * @param {Array} array - array\n   * @param {Function} fn - iterator\n   */\n  function sum(array, fn) {\n      fn = fn || func.self;\n      return array.reduce(function (memo, v) {\n          return memo + fn(v);\n      }, 0);\n  }\n  /**\n   * returns a copy of the collection with array type.\n   * @param {Collection} collection - collection eg) node.childNodes, ...\n   */\n  function from(collection) {\n      var result = [];\n      var length = collection.length;\n      var idx = -1;\n      while (++idx < length) {\n          result[idx] = collection[idx];\n      }\n      return result;\n  }\n  /**\n   * returns whether list is empty or not\n   */\n  function isEmpty(array) {\n      return !array || !array.length;\n  }\n  /**\n   * cluster elements by predicate function.\n   *\n   * @param {Array} array - array\n   * @param {Function} fn - predicate function for cluster rule\n   * @param {Array[]}\n   */\n  function clusterBy(array, fn) {\n      if (!array.length) {\n          return [];\n      }\n      var aTail = tail(array);\n      return aTail.reduce(function (memo, v) {\n          var aLast = last(memo);\n          if (fn(last(aLast), v)) {\n              aLast[aLast.length] = v;\n          }\n          else {\n              memo[memo.length] = [v];\n          }\n          return memo;\n      }, [[head(array)]]);\n  }\n  /**\n   * returns a copy of the array with all false values removed\n   *\n   * @param {Array} array - array\n   * @param {Function} fn - predicate function for cluster rule\n   */\n  function compact(array) {\n      var aResult = [];\n      for (var idx = 0, len = array.length; idx < len; idx++) {\n          if (array[idx]) {\n              aResult.push(array[idx]);\n          }\n      }\n      return aResult;\n  }\n  /**\n   * produces a duplicate-free version of the array\n   *\n   * @param {Array} array\n   */\n  function unique(array) {\n      var results = [];\n      for (var idx = 0, len = array.length; idx < len; idx++) {\n          if (!contains(results, array[idx])) {\n              results.push(array[idx]);\n          }\n      }\n      return results;\n  }\n  /**\n   * returns next item.\n   * @param {Array} array\n   */\n  function next(array, item) {\n      if (array && array.length && item) {\n          var idx = array.indexOf(item);\n          return idx === -1 ? null : array[idx + 1];\n      }\n      return null;\n  }\n  /**\n   * returns prev item.\n   * @param {Array} array\n   */\n  function prev(array, item) {\n      if (array && array.length && item) {\n          var idx = array.indexOf(item);\n          return idx === -1 ? null : array[idx - 1];\n      }\n      return null;\n  }\n  /**\n   * @class core.list\n   *\n   * list utils\n   *\n   * @singleton\n   * @alternateClassName list\n   */\n  var lists = {\n      head: head,\n      last: last,\n      initial: initial,\n      tail: tail,\n      prev: prev,\n      next: next,\n      find: find,\n      contains: contains,\n      all: all,\n      sum: sum,\n      from: from,\n      isEmpty: isEmpty,\n      clusterBy: clusterBy,\n      compact: compact,\n      unique: unique\n  };\n\n  var NBSP_CHAR = String.fromCharCode(160);\n  var ZERO_WIDTH_NBSP_CHAR = '\\ufeff';\n  /**\n   * @method isEditable\n   *\n   * returns whether node is `note-editable` or not.\n   *\n   * @param {Node} node\n   * @return {Boolean}\n   */\n  function isEditable(node) {\n      return node && $$1(node).hasClass('note-editable');\n  }\n  /**\n   * @method isControlSizing\n   *\n   * returns whether node is `note-control-sizing` or not.\n   *\n   * @param {Node} node\n   * @return {Boolean}\n   */\n  function isControlSizing(node) {\n      return node && $$1(node).hasClass('note-control-sizing');\n  }\n  /**\n   * @method makePredByNodeName\n   *\n   * returns predicate which judge whether nodeName is same\n   *\n   * @param {String} nodeName\n   * @return {Function}\n   */\n  function makePredByNodeName(nodeName) {\n      nodeName = nodeName.toUpperCase();\n      return function (node) {\n          return node && node.nodeName.toUpperCase() === nodeName;\n      };\n  }\n  /**\n   * @method isText\n   *\n   *\n   *\n   * @param {Node} node\n   * @return {Boolean} true if node's type is text(3)\n   */\n  function isText(node) {\n      return node && node.nodeType === 3;\n  }\n  /**\n   * @method isElement\n   *\n   *\n   *\n   * @param {Node} node\n   * @return {Boolean} true if node's type is element(1)\n   */\n  function isElement(node) {\n      return node && node.nodeType === 1;\n  }\n  /**\n   * ex) br, col, embed, hr, img, input, ...\n   * @see http://www.w3.org/html/wg/drafts/html/master/syntax.html#void-elements\n   */\n  function isVoid(node) {\n      return node && /^BR|^IMG|^HR|^IFRAME|^BUTTON|^INPUT|^AUDIO|^VIDEO|^EMBED/.test(node.nodeName.toUpperCase());\n  }\n  function isPara(node) {\n      if (isEditable(node)) {\n          return false;\n      }\n      // Chrome(v31.0), FF(v25.0.1) use DIV for paragraph\n      return node && /^DIV|^P|^LI|^H[1-7]/.test(node.nodeName.toUpperCase());\n  }\n  function isHeading(node) {\n      return node && /^H[1-7]/.test(node.nodeName.toUpperCase());\n  }\n  var isPre = makePredByNodeName('PRE');\n  var isLi = makePredByNodeName('LI');\n  function isPurePara(node) {\n      return isPara(node) && !isLi(node);\n  }\n  var isTable = makePredByNodeName('TABLE');\n  var isData = makePredByNodeName('DATA');\n  function isInline(node) {\n      return !isBodyContainer(node) &&\n          !isList(node) &&\n          !isHr(node) &&\n          !isPara(node) &&\n          !isTable(node) &&\n          !isBlockquote(node) &&\n          !isData(node);\n  }\n  function isList(node) {\n      return node && /^UL|^OL/.test(node.nodeName.toUpperCase());\n  }\n  var isHr = makePredByNodeName('HR');\n  function isCell(node) {\n      return node && /^TD|^TH/.test(node.nodeName.toUpperCase());\n  }\n  var isBlockquote = makePredByNodeName('BLOCKQUOTE');\n  function isBodyContainer(node) {\n      return isCell(node) || isBlockquote(node) || isEditable(node);\n  }\n  var isAnchor = makePredByNodeName('A');\n  function isParaInline(node) {\n      return isInline(node) && !!ancestor(node, isPara);\n  }\n  function isBodyInline(node) {\n      return isInline(node) && !ancestor(node, isPara);\n  }\n  var isBody = makePredByNodeName('BODY');\n  /**\n   * returns whether nodeB is closest sibling of nodeA\n   *\n   * @param {Node} nodeA\n   * @param {Node} nodeB\n   * @return {Boolean}\n   */\n  function isClosestSibling(nodeA, nodeB) {\n      return nodeA.nextSibling === nodeB ||\n          nodeA.previousSibling === nodeB;\n  }\n  /**\n   * returns array of closest siblings with node\n   *\n   * @param {Node} node\n   * @param {function} [pred] - predicate function\n   * @return {Node[]}\n   */\n  function withClosestSiblings(node, pred) {\n      pred = pred || func.ok;\n      var siblings = [];\n      if (node.previousSibling && pred(node.previousSibling)) {\n          siblings.push(node.previousSibling);\n      }\n      siblings.push(node);\n      if (node.nextSibling && pred(node.nextSibling)) {\n          siblings.push(node.nextSibling);\n      }\n      return siblings;\n  }\n  /**\n   * blank HTML for cursor position\n   * - [workaround] old IE only works with &nbsp;\n   * - [workaround] IE11 and other browser works with bogus br\n   */\n  var blankHTML = env.isMSIE && env.browserVersion < 11 ? '&nbsp;' : '<br>';\n  /**\n   * @method nodeLength\n   *\n   * returns #text's text size or element's childNodes size\n   *\n   * @param {Node} node\n   */\n  function nodeLength(node) {\n      if (isText(node)) {\n          return node.nodeValue.length;\n      }\n      if (node) {\n          return node.childNodes.length;\n      }\n      return 0;\n  }\n  /**\n   * returns whether node is empty or not.\n   *\n   * @param {Node} node\n   * @return {Boolean}\n   */\n  function isEmpty$1(node) {\n      var len = nodeLength(node);\n      if (len === 0) {\n          return true;\n      }\n      else if (!isText(node) && len === 1 && node.innerHTML === blankHTML) {\n          // ex) <p><br></p>, <span><br></span>\n          return true;\n      }\n      else if (lists.all(node.childNodes, isText) && node.innerHTML === '') {\n          // ex) <p></p>, <span></span>\n          return true;\n      }\n      return false;\n  }\n  /**\n   * padding blankHTML if node is empty (for cursor position)\n   */\n  function paddingBlankHTML(node) {\n      if (!isVoid(node) && !nodeLength(node)) {\n          node.innerHTML = blankHTML;\n      }\n  }\n  /**\n   * find nearest ancestor predicate hit\n   *\n   * @param {Node} node\n   * @param {Function} pred - predicate function\n   */\n  function ancestor(node, pred) {\n      while (node) {\n          if (pred(node)) {\n              return node;\n          }\n          if (isEditable(node)) {\n              break;\n          }\n          node = node.parentNode;\n      }\n      return null;\n  }\n  /**\n   * find nearest ancestor only single child blood line and predicate hit\n   *\n   * @param {Node} node\n   * @param {Function} pred - predicate function\n   */\n  function singleChildAncestor(node, pred) {\n      node = node.parentNode;\n      while (node) {\n          if (nodeLength(node) !== 1) {\n              break;\n          }\n          if (pred(node)) {\n              return node;\n          }\n          if (isEditable(node)) {\n              break;\n          }\n          node = node.parentNode;\n      }\n      return null;\n  }\n  /**\n   * returns new array of ancestor nodes (until predicate hit).\n   *\n   * @param {Node} node\n   * @param {Function} [optional] pred - predicate function\n   */\n  function listAncestor(node, pred) {\n      pred = pred || func.fail;\n      var ancestors = [];\n      ancestor(node, function (el) {\n          if (!isEditable(el)) {\n              ancestors.push(el);\n          }\n          return pred(el);\n      });\n      return ancestors;\n  }\n  /**\n   * find farthest ancestor predicate hit\n   */\n  function lastAncestor(node, pred) {\n      var ancestors = listAncestor(node);\n      return lists.last(ancestors.filter(pred));\n  }\n  /**\n   * returns common ancestor node between two nodes.\n   *\n   * @param {Node} nodeA\n   * @param {Node} nodeB\n   */\n  function commonAncestor(nodeA, nodeB) {\n      var ancestors = listAncestor(nodeA);\n      for (var n = nodeB; n; n = n.parentNode) {\n          if (ancestors.indexOf(n) > -1)\n              return n;\n      }\n      return null; // difference document area\n  }\n  /**\n   * listing all previous siblings (until predicate hit).\n   *\n   * @param {Node} node\n   * @param {Function} [optional] pred - predicate function\n   */\n  function listPrev(node, pred) {\n      pred = pred || func.fail;\n      var nodes = [];\n      while (node) {\n          if (pred(node)) {\n              break;\n          }\n          nodes.push(node);\n          node = node.previousSibling;\n      }\n      return nodes;\n  }\n  /**\n   * listing next siblings (until predicate hit).\n   *\n   * @param {Node} node\n   * @param {Function} [pred] - predicate function\n   */\n  function listNext(node, pred) {\n      pred = pred || func.fail;\n      var nodes = [];\n      while (node) {\n          if (pred(node)) {\n              break;\n          }\n          nodes.push(node);\n          node = node.nextSibling;\n      }\n      return nodes;\n  }\n  /**\n   * listing descendant nodes\n   *\n   * @param {Node} node\n   * @param {Function} [pred] - predicate function\n   */\n  function listDescendant(node, pred) {\n      var descendants = [];\n      pred = pred || func.ok;\n      // start DFS(depth first search) with node\n      (function fnWalk(current) {\n          if (node !== current && pred(current)) {\n              descendants.push(current);\n          }\n          for (var idx = 0, len = current.childNodes.length; idx < len; idx++) {\n              fnWalk(current.childNodes[idx]);\n          }\n      })(node);\n      return descendants;\n  }\n  /**\n   * wrap node with new tag.\n   *\n   * @param {Node} node\n   * @param {Node} tagName of wrapper\n   * @return {Node} - wrapper\n   */\n  function wrap(node, wrapperName) {\n      var parent = node.parentNode;\n      var wrapper = $$1('<' + wrapperName + '>')[0];\n      parent.insertBefore(wrapper, node);\n      wrapper.appendChild(node);\n      return wrapper;\n  }\n  /**\n   * insert node after preceding\n   *\n   * @param {Node} node\n   * @param {Node} preceding - predicate function\n   */\n  function insertAfter(node, preceding) {\n      var next = preceding.nextSibling;\n      var parent = preceding.parentNode;\n      if (next) {\n          parent.insertBefore(node, next);\n      }\n      else {\n          parent.appendChild(node);\n      }\n      return node;\n  }\n  /**\n   * append elements.\n   *\n   * @param {Node} node\n   * @param {Collection} aChild\n   */\n  function appendChildNodes(node, aChild) {\n      $$1.each(aChild, function (idx, child) {\n          node.appendChild(child);\n      });\n      return node;\n  }\n  /**\n   * returns whether boundaryPoint is left edge or not.\n   *\n   * @param {BoundaryPoint} point\n   * @return {Boolean}\n   */\n  function isLeftEdgePoint(point) {\n      return point.offset === 0;\n  }\n  /**\n   * returns whether boundaryPoint is right edge or not.\n   *\n   * @param {BoundaryPoint} point\n   * @return {Boolean}\n   */\n  function isRightEdgePoint(point) {\n      return point.offset === nodeLength(point.node);\n  }\n  /**\n   * returns whether boundaryPoint is edge or not.\n   *\n   * @param {BoundaryPoint} point\n   * @return {Boolean}\n   */\n  function isEdgePoint(point) {\n      return isLeftEdgePoint(point) || isRightEdgePoint(point);\n  }\n  /**\n   * returns whether node is left edge of ancestor or not.\n   *\n   * @param {Node} node\n   * @param {Node} ancestor\n   * @return {Boolean}\n   */\n  function isLeftEdgeOf(node, ancestor) {\n      while (node && node !== ancestor) {\n          if (position(node) !== 0) {\n              return false;\n          }\n          node = node.parentNode;\n      }\n      return true;\n  }\n  /**\n   * returns whether node is right edge of ancestor or not.\n   *\n   * @param {Node} node\n   * @param {Node} ancestor\n   * @return {Boolean}\n   */\n  function isRightEdgeOf(node, ancestor) {\n      if (!ancestor) {\n          return false;\n      }\n      while (node && node !== ancestor) {\n          if (position(node) !== nodeLength(node.parentNode) - 1) {\n              return false;\n          }\n          node = node.parentNode;\n      }\n      return true;\n  }\n  /**\n   * returns whether point is left edge of ancestor or not.\n   * @param {BoundaryPoint} point\n   * @param {Node} ancestor\n   * @return {Boolean}\n   */\n  function isLeftEdgePointOf(point, ancestor) {\n      return isLeftEdgePoint(point) && isLeftEdgeOf(point.node, ancestor);\n  }\n  /**\n   * returns whether point is right edge of ancestor or not.\n   * @param {BoundaryPoint} point\n   * @param {Node} ancestor\n   * @return {Boolean}\n   */\n  function isRightEdgePointOf(point, ancestor) {\n      return isRightEdgePoint(point) && isRightEdgeOf(point.node, ancestor);\n  }\n  /**\n   * returns offset from parent.\n   *\n   * @param {Node} node\n   */\n  function position(node) {\n      var offset = 0;\n      while ((node = node.previousSibling)) {\n          offset += 1;\n      }\n      return offset;\n  }\n  function hasChildren(node) {\n      return !!(node && node.childNodes && node.childNodes.length);\n  }\n  /**\n   * returns previous boundaryPoint\n   *\n   * @param {BoundaryPoint} point\n   * @param {Boolean} isSkipInnerOffset\n   * @return {BoundaryPoint}\n   */\n  function prevPoint(point, isSkipInnerOffset) {\n      var node;\n      var offset;\n      if (point.offset === 0) {\n          if (isEditable(point.node)) {\n              return null;\n          }\n          node = point.node.parentNode;\n          offset = position(point.node);\n      }\n      else if (hasChildren(point.node)) {\n          node = point.node.childNodes[point.offset - 1];\n          offset = nodeLength(node);\n      }\n      else {\n          node = point.node;\n          offset = isSkipInnerOffset ? 0 : point.offset - 1;\n      }\n      return {\n          node: node,\n          offset: offset\n      };\n  }\n  /**\n   * returns next boundaryPoint\n   *\n   * @param {BoundaryPoint} point\n   * @param {Boolean} isSkipInnerOffset\n   * @return {BoundaryPoint}\n   */\n  function nextPoint(point, isSkipInnerOffset) {\n      var node, offset;\n      if (nodeLength(point.node) === point.offset) {\n          if (isEditable(point.node)) {\n              return null;\n          }\n          node = point.node.parentNode;\n          offset = position(point.node) + 1;\n      }\n      else if (hasChildren(point.node)) {\n          node = point.node.childNodes[point.offset];\n          offset = 0;\n      }\n      else {\n          node = point.node;\n          offset = isSkipInnerOffset ? nodeLength(point.node) : point.offset + 1;\n      }\n      return {\n          node: node,\n          offset: offset\n      };\n  }\n  /**\n   * returns whether pointA and pointB is same or not.\n   *\n   * @param {BoundaryPoint} pointA\n   * @param {BoundaryPoint} pointB\n   * @return {Boolean}\n   */\n  function isSamePoint(pointA, pointB) {\n      return pointA.node === pointB.node && pointA.offset === pointB.offset;\n  }\n  /**\n   * returns whether point is visible (can set cursor) or not.\n   *\n   * @param {BoundaryPoint} point\n   * @return {Boolean}\n   */\n  function isVisiblePoint(point) {\n      if (isText(point.node) || !hasChildren(point.node) || isEmpty$1(point.node)) {\n          return true;\n      }\n      var leftNode = point.node.childNodes[point.offset - 1];\n      var rightNode = point.node.childNodes[point.offset];\n      if ((!leftNode || isVoid(leftNode)) && (!rightNode || isVoid(rightNode))) {\n          return true;\n      }\n      return false;\n  }\n  /**\n   * @method prevPointUtil\n   *\n   * @param {BoundaryPoint} point\n   * @param {Function} pred\n   * @return {BoundaryPoint}\n   */\n  function prevPointUntil(point, pred) {\n      while (point) {\n          if (pred(point)) {\n              return point;\n          }\n          point = prevPoint(point);\n      }\n      return null;\n  }\n  /**\n   * @method nextPointUntil\n   *\n   * @param {BoundaryPoint} point\n   * @param {Function} pred\n   * @return {BoundaryPoint}\n   */\n  function nextPointUntil(point, pred) {\n      while (point) {\n          if (pred(point)) {\n              return point;\n          }\n          point = nextPoint(point);\n      }\n      return null;\n  }\n  /**\n   * returns whether point has character or not.\n   *\n   * @param {Point} point\n   * @return {Boolean}\n   */\n  function isCharPoint(point) {\n      if (!isText(point.node)) {\n          return false;\n      }\n      var ch = point.node.nodeValue.charAt(point.offset - 1);\n      return ch && (ch !== ' ' && ch !== NBSP_CHAR);\n  }\n  /**\n   * @method walkPoint\n   *\n   * @param {BoundaryPoint} startPoint\n   * @param {BoundaryPoint} endPoint\n   * @param {Function} handler\n   * @param {Boolean} isSkipInnerOffset\n   */\n  function walkPoint(startPoint, endPoint, handler, isSkipInnerOffset) {\n      var point = startPoint;\n      while (point) {\n          handler(point);\n          if (isSamePoint(point, endPoint)) {\n              break;\n          }\n          var isSkipOffset = isSkipInnerOffset &&\n              startPoint.node !== point.node &&\n              endPoint.node !== point.node;\n          point = nextPoint(point, isSkipOffset);\n      }\n  }\n  /**\n   * @method makeOffsetPath\n   *\n   * return offsetPath(array of offset) from ancestor\n   *\n   * @param {Node} ancestor - ancestor node\n   * @param {Node} node\n   */\n  function makeOffsetPath(ancestor, node) {\n      var ancestors = listAncestor(node, func.eq(ancestor));\n      return ancestors.map(position).reverse();\n  }\n  /**\n   * @method fromOffsetPath\n   *\n   * return element from offsetPath(array of offset)\n   *\n   * @param {Node} ancestor - ancestor node\n   * @param {array} offsets - offsetPath\n   */\n  function fromOffsetPath(ancestor, offsets) {\n      var current = ancestor;\n      for (var i = 0, len = offsets.length; i < len; i++) {\n          if (current.childNodes.length <= offsets[i]) {\n              current = current.childNodes[current.childNodes.length - 1];\n          }\n          else {\n              current = current.childNodes[offsets[i]];\n          }\n      }\n      return current;\n  }\n  /**\n   * @method splitNode\n   *\n   * split element or #text\n   *\n   * @param {BoundaryPoint} point\n   * @param {Object} [options]\n   * @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false\n   * @param {Boolean} [options.isNotSplitEdgePoint] - default: false\n   * @param {Boolean} [options.isDiscardEmptySplits] - default: false\n   * @return {Node} right node of boundaryPoint\n   */\n  function splitNode(point, options) {\n      var isSkipPaddingBlankHTML = options && options.isSkipPaddingBlankHTML;\n      var isNotSplitEdgePoint = options && options.isNotSplitEdgePoint;\n      var isDiscardEmptySplits = options && options.isDiscardEmptySplits;\n      if (isDiscardEmptySplits) {\n          isSkipPaddingBlankHTML = true;\n      }\n      // edge case\n      if (isEdgePoint(point) && (isText(point.node) || isNotSplitEdgePoint)) {\n          if (isLeftEdgePoint(point)) {\n              return point.node;\n          }\n          else if (isRightEdgePoint(point)) {\n              return point.node.nextSibling;\n          }\n      }\n      // split #text\n      if (isText(point.node)) {\n          return point.node.splitText(point.offset);\n      }\n      else {\n          var childNode = point.node.childNodes[point.offset];\n          var clone = insertAfter(point.node.cloneNode(false), point.node);\n          appendChildNodes(clone, listNext(childNode));\n          if (!isSkipPaddingBlankHTML) {\n              paddingBlankHTML(point.node);\n              paddingBlankHTML(clone);\n          }\n          if (isDiscardEmptySplits) {\n              if (isEmpty$1(point.node)) {\n                  remove(point.node);\n              }\n              if (isEmpty$1(clone)) {\n                  remove(clone);\n                  return point.node.nextSibling;\n              }\n          }\n          return clone;\n      }\n  }\n  /**\n   * @method splitTree\n   *\n   * split tree by point\n   *\n   * @param {Node} root - split root\n   * @param {BoundaryPoint} point\n   * @param {Object} [options]\n   * @param {Boolean} [options.isSkipPaddingBlankHTML] - default: false\n   * @param {Boolean} [options.isNotSplitEdgePoint] - default: false\n   * @return {Node} right node of boundaryPoint\n   */\n  function splitTree(root, point, options) {\n      // ex) [#text, <span>, <p>]\n      var ancestors = listAncestor(point.node, func.eq(root));\n      if (!ancestors.length) {\n          return null;\n      }\n      else if (ancestors.length === 1) {\n          return splitNode(point, options);\n      }\n      return ancestors.reduce(function (node, parent) {\n          if (node === point.node) {\n              node = splitNode(point, options);\n          }\n          return splitNode({\n              node: parent,\n              offset: node ? position(node) : nodeLength(parent)\n          }, options);\n      });\n  }\n  /**\n   * split point\n   *\n   * @param {Point} point\n   * @param {Boolean} isInline\n   * @return {Object}\n   */\n  function splitPoint(point, isInline) {\n      // find splitRoot, container\n      //  - inline: splitRoot is a child of paragraph\n      //  - block: splitRoot is a child of bodyContainer\n      var pred = isInline ? isPara : isBodyContainer;\n      var ancestors = listAncestor(point.node, pred);\n      var topAncestor = lists.last(ancestors) || point.node;\n      var splitRoot, container;\n      if (pred(topAncestor)) {\n          splitRoot = ancestors[ancestors.length - 2];\n          container = topAncestor;\n      }\n      else {\n          splitRoot = topAncestor;\n          container = splitRoot.parentNode;\n      }\n      // if splitRoot is exists, split with splitTree\n      var pivot = splitRoot && splitTree(splitRoot, point, {\n          isSkipPaddingBlankHTML: isInline,\n          isNotSplitEdgePoint: isInline\n      });\n      // if container is point.node, find pivot with point.offset\n      if (!pivot && container === point.node) {\n          pivot = point.node.childNodes[point.offset];\n      }\n      return {\n          rightNode: pivot,\n          container: container\n      };\n  }\n  function create(nodeName) {\n      return document.createElement(nodeName);\n  }\n  function createText(text) {\n      return document.createTextNode(text);\n  }\n  /**\n   * @method remove\n   *\n   * remove node, (isRemoveChild: remove child or not)\n   *\n   * @param {Node} node\n   * @param {Boolean} isRemoveChild\n   */\n  function remove(node, isRemoveChild) {\n      if (!node || !node.parentNode) {\n          return;\n      }\n      if (node.removeNode) {\n          return node.removeNode(isRemoveChild);\n      }\n      var parent = node.parentNode;\n      if (!isRemoveChild) {\n          var nodes = [];\n          for (var i = 0, len = node.childNodes.length; i < len; i++) {\n              nodes.push(node.childNodes[i]);\n          }\n          for (var i = 0, len = nodes.length; i < len; i++) {\n              parent.insertBefore(nodes[i], node);\n          }\n      }\n      parent.removeChild(node);\n  }\n  /**\n   * @method removeWhile\n   *\n   * @param {Node} node\n   * @param {Function} pred\n   */\n  function removeWhile(node, pred) {\n      while (node) {\n          if (isEditable(node) || !pred(node)) {\n              break;\n          }\n          var parent = node.parentNode;\n          remove(node);\n          node = parent;\n      }\n  }\n  /**\n   * @method replace\n   *\n   * replace node with provided nodeName\n   *\n   * @param {Node} node\n   * @param {String} nodeName\n   * @return {Node} - new node\n   */\n  function replace(node, nodeName) {\n      if (node.nodeName.toUpperCase() === nodeName.toUpperCase()) {\n          return node;\n      }\n      var newNode = create(nodeName);\n      if (node.style.cssText) {\n          newNode.style.cssText = node.style.cssText;\n      }\n      appendChildNodes(newNode, lists.from(node.childNodes));\n      insertAfter(newNode, node);\n      remove(node);\n      return newNode;\n  }\n  var isTextarea = makePredByNodeName('TEXTAREA');\n  /**\n   * @param {jQuery} $node\n   * @param {Boolean} [stripLinebreaks] - default: false\n   */\n  function value($node, stripLinebreaks) {\n      var val = isTextarea($node[0]) ? $node.val() : $node.html();\n      if (stripLinebreaks) {\n          return val.replace(/[\\n\\r]/g, '');\n      }\n      return val;\n  }\n  /**\n   * @method html\n   *\n   * get the HTML contents of node\n   *\n   * @param {jQuery} $node\n   * @param {Boolean} [isNewlineOnBlock]\n   */\n  function html($node, isNewlineOnBlock) {\n      var markup = value($node);\n      if (isNewlineOnBlock) {\n          var regexTag = /<(\\/?)(\\b(?!!)[^>\\s]*)(.*?)(\\s*\\/?>)/g;\n          markup = markup.replace(regexTag, function (match, endSlash, name) {\n              name = name.toUpperCase();\n              var isEndOfInlineContainer = /^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(name) &&\n                  !!endSlash;\n              var isBlockNode = /^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(name);\n              return match + ((isEndOfInlineContainer || isBlockNode) ? '\\n' : '');\n          });\n          markup = markup.trim();\n      }\n      return markup;\n  }\n  function posFromPlaceholder(placeholder) {\n      var $placeholder = $$1(placeholder);\n      var pos = $placeholder.offset();\n      var height = $placeholder.outerHeight(true); // include margin\n      return {\n          left: pos.left,\n          top: pos.top + height\n      };\n  }\n  function attachEvents($node, events) {\n      Object.keys(events).forEach(function (key) {\n          $node.on(key, events[key]);\n      });\n  }\n  function detachEvents($node, events) {\n      Object.keys(events).forEach(function (key) {\n          $node.off(key, events[key]);\n      });\n  }\n  /**\n   * @method isCustomStyleTag\n   *\n   * assert if a node contains a \"note-styletag\" class,\n   * which implies that's a custom-made style tag node\n   *\n   * @param {Node} an HTML DOM node\n   */\n  function isCustomStyleTag(node) {\n      return node && !isText(node) && lists.contains(node.classList, 'note-styletag');\n  }\n  var dom = {\n      /** @property {String} NBSP_CHAR */\n      NBSP_CHAR: NBSP_CHAR,\n      /** @property {String} ZERO_WIDTH_NBSP_CHAR */\n      ZERO_WIDTH_NBSP_CHAR: ZERO_WIDTH_NBSP_CHAR,\n      /** @property {String} blank */\n      blank: blankHTML,\n      /** @property {String} emptyPara */\n      emptyPara: \"<p>\" + blankHTML + \"</p>\",\n      makePredByNodeName: makePredByNodeName,\n      isEditable: isEditable,\n      isControlSizing: isControlSizing,\n      isText: isText,\n      isElement: isElement,\n      isVoid: isVoid,\n      isPara: isPara,\n      isPurePara: isPurePara,\n      isHeading: isHeading,\n      isInline: isInline,\n      isBlock: func.not(isInline),\n      isBodyInline: isBodyInline,\n      isBody: isBody,\n      isParaInline: isParaInline,\n      isPre: isPre,\n      isList: isList,\n      isTable: isTable,\n      isData: isData,\n      isCell: isCell,\n      isBlockquote: isBlockquote,\n      isBodyContainer: isBodyContainer,\n      isAnchor: isAnchor,\n      isDiv: makePredByNodeName('DIV'),\n      isLi: isLi,\n      isBR: makePredByNodeName('BR'),\n      isSpan: makePredByNodeName('SPAN'),\n      isB: makePredByNodeName('B'),\n      isU: makePredByNodeName('U'),\n      isS: makePredByNodeName('S'),\n      isI: makePredByNodeName('I'),\n      isImg: makePredByNodeName('IMG'),\n      isTextarea: isTextarea,\n      isEmpty: isEmpty$1,\n      isEmptyAnchor: func.and(isAnchor, isEmpty$1),\n      isClosestSibling: isClosestSibling,\n      withClosestSiblings: withClosestSiblings,\n      nodeLength: nodeLength,\n      isLeftEdgePoint: isLeftEdgePoint,\n      isRightEdgePoint: isRightEdgePoint,\n      isEdgePoint: isEdgePoint,\n      isLeftEdgeOf: isLeftEdgeOf,\n      isRightEdgeOf: isRightEdgeOf,\n      isLeftEdgePointOf: isLeftEdgePointOf,\n      isRightEdgePointOf: isRightEdgePointOf,\n      prevPoint: prevPoint,\n      nextPoint: nextPoint,\n      isSamePoint: isSamePoint,\n      isVisiblePoint: isVisiblePoint,\n      prevPointUntil: prevPointUntil,\n      nextPointUntil: nextPointUntil,\n      isCharPoint: isCharPoint,\n      walkPoint: walkPoint,\n      ancestor: ancestor,\n      singleChildAncestor: singleChildAncestor,\n      listAncestor: listAncestor,\n      lastAncestor: lastAncestor,\n      listNext: listNext,\n      listPrev: listPrev,\n      listDescendant: listDescendant,\n      commonAncestor: commonAncestor,\n      wrap: wrap,\n      insertAfter: insertAfter,\n      appendChildNodes: appendChildNodes,\n      position: position,\n      hasChildren: hasChildren,\n      makeOffsetPath: makeOffsetPath,\n      fromOffsetPath: fromOffsetPath,\n      splitTree: splitTree,\n      splitPoint: splitPoint,\n      create: create,\n      createText: createText,\n      remove: remove,\n      removeWhile: removeWhile,\n      replace: replace,\n      html: html,\n      value: value,\n      posFromPlaceholder: posFromPlaceholder,\n      attachEvents: attachEvents,\n      detachEvents: detachEvents,\n      isCustomStyleTag: isCustomStyleTag\n  };\n\n  var Context = /** @class */ (function () {\n      /**\n       * @param {jQuery} $note\n       * @param {Object} options\n       */\n      function Context($note, options) {\n          this.ui = $$1.summernote.ui;\n          this.$note = $note;\n          this.memos = {};\n          this.modules = {};\n          this.layoutInfo = {};\n          this.options = options;\n          this.initialize();\n      }\n      /**\n       * create layout and initialize modules and other resources\n       */\n      Context.prototype.initialize = function () {\n          this.layoutInfo = this.ui.createLayout(this.$note, this.options);\n          this._initialize();\n          this.$note.hide();\n          return this;\n      };\n      /**\n       * destroy modules and other resources and remove layout\n       */\n      Context.prototype.destroy = function () {\n          this._destroy();\n          this.$note.removeData('summernote');\n          this.ui.removeLayout(this.$note, this.layoutInfo);\n      };\n      /**\n       * destory modules and other resources and initialize it again\n       */\n      Context.prototype.reset = function () {\n          var disabled = this.isDisabled();\n          this.code(dom.emptyPara);\n          this._destroy();\n          this._initialize();\n          if (disabled) {\n              this.disable();\n          }\n      };\n      Context.prototype._initialize = function () {\n          var _this = this;\n          // add optional buttons\n          var buttons = $$1.extend({}, this.options.buttons);\n          Object.keys(buttons).forEach(function (key) {\n              _this.memo('button.' + key, buttons[key]);\n          });\n          var modules = $$1.extend({}, this.options.modules, $$1.summernote.plugins || {});\n          // add and initialize modules\n          Object.keys(modules).forEach(function (key) {\n              _this.module(key, modules[key], true);\n          });\n          Object.keys(this.modules).forEach(function (key) {\n              _this.initializeModule(key);\n          });\n      };\n      Context.prototype._destroy = function () {\n          var _this = this;\n          // destroy modules with reversed order\n          Object.keys(this.modules).reverse().forEach(function (key) {\n              _this.removeModule(key);\n          });\n          Object.keys(this.memos).forEach(function (key) {\n              _this.removeMemo(key);\n          });\n          // trigger custom onDestroy callback\n          this.triggerEvent('destroy', this);\n      };\n      Context.prototype.code = function (html) {\n          var isActivated = this.invoke('codeview.isActivated');\n          if (html === undefined) {\n              this.invoke('codeview.sync');\n              return isActivated ? this.layoutInfo.codable.val() : this.layoutInfo.editable.html();\n          }\n          else {\n              if (isActivated) {\n                  this.layoutInfo.codable.val(html);\n              }\n              else {\n                  this.layoutInfo.editable.html(html);\n              }\n              this.$note.val(html);\n              this.triggerEvent('change', html, this.layoutInfo.editable);\n          }\n      };\n      Context.prototype.isDisabled = function () {\n          return this.layoutInfo.editable.attr('contenteditable') === 'false';\n      };\n      Context.prototype.enable = function () {\n          this.layoutInfo.editable.attr('contenteditable', true);\n          this.invoke('toolbar.activate', true);\n          this.triggerEvent('disable', false);\n      };\n      Context.prototype.disable = function () {\n          // close codeview if codeview is opend\n          if (this.invoke('codeview.isActivated')) {\n              this.invoke('codeview.deactivate');\n          }\n          this.layoutInfo.editable.attr('contenteditable', false);\n          this.invoke('toolbar.deactivate', true);\n          this.triggerEvent('disable', true);\n      };\n      Context.prototype.triggerEvent = function () {\n          var namespace = lists.head(arguments);\n          var args = lists.tail(lists.from(arguments));\n          var callback = this.options.callbacks[func.namespaceToCamel(namespace, 'on')];\n          if (callback) {\n              callback.apply(this.$note[0], args);\n          }\n          this.$note.trigger('summernote.' + namespace, args);\n      };\n      Context.prototype.initializeModule = function (key) {\n          var module = this.modules[key];\n          module.shouldInitialize = module.shouldInitialize || func.ok;\n          if (!module.shouldInitialize()) {\n              return;\n          }\n          // initialize module\n          if (module.initialize) {\n              module.initialize();\n          }\n          // attach events\n          if (module.events) {\n              dom.attachEvents(this.$note, module.events);\n          }\n      };\n      Context.prototype.module = function (key, ModuleClass, withoutIntialize) {\n          if (arguments.length === 1) {\n              return this.modules[key];\n          }\n          this.modules[key] = new ModuleClass(this);\n          if (!withoutIntialize) {\n              this.initializeModule(key);\n          }\n      };\n      Context.prototype.removeModule = function (key) {\n          var module = this.modules[key];\n          if (module.shouldInitialize()) {\n              if (module.events) {\n                  dom.detachEvents(this.$note, module.events);\n              }\n              if (module.destroy) {\n                  module.destroy();\n              }\n          }\n          delete this.modules[key];\n      };\n      Context.prototype.memo = function (key, obj) {\n          if (arguments.length === 1) {\n              return this.memos[key];\n          }\n          this.memos[key] = obj;\n      };\n      Context.prototype.removeMemo = function (key) {\n          if (this.memos[key] && this.memos[key].destroy) {\n              this.memos[key].destroy();\n          }\n          delete this.memos[key];\n      };\n      /**\n       * Some buttons need to change their visual style immediately once they get pressed\n       */\n      Context.prototype.createInvokeHandlerAndUpdateState = function (namespace, value) {\n          var _this = this;\n          return function (event) {\n              _this.createInvokeHandler(namespace, value)(event);\n              _this.invoke('buttons.updateCurrentStyle');\n          };\n      };\n      Context.prototype.createInvokeHandler = function (namespace, value) {\n          var _this = this;\n          return function (event) {\n              event.preventDefault();\n              var $target = $$1(event.target);\n              _this.invoke(namespace, value || $target.closest('[data-value]').data('value'), $target);\n          };\n      };\n      Context.prototype.invoke = function () {\n          var namespace = lists.head(arguments);\n          var args = lists.tail(lists.from(arguments));\n          var splits = namespace.split('.');\n          var hasSeparator = splits.length > 1;\n          var moduleName = hasSeparator && lists.head(splits);\n          var methodName = hasSeparator ? lists.last(splits) : lists.head(splits);\n          var module = this.modules[moduleName || 'editor'];\n          if (!moduleName && this[methodName]) {\n              return this[methodName].apply(this, args);\n          }\n          else if (module && module[methodName] && module.shouldInitialize()) {\n              return module[methodName].apply(module, args);\n          }\n      };\n      return Context;\n  }());\n\n  $$1.fn.extend({\n      /**\n       * Summernote API\n       *\n       * @param {Object|String}\n       * @return {this}\n       */\n      summernote: function () {\n          var type = $$1.type(lists.head(arguments));\n          var isExternalAPICalled = type === 'string';\n          var hasInitOptions = type === 'object';\n          var options = $$1.extend({}, $$1.summernote.options, hasInitOptions ? lists.head(arguments) : {});\n          // Update options\n          options.langInfo = $$1.extend(true, {}, $$1.summernote.lang['en-US'], $$1.summernote.lang[options.lang]);\n          options.icons = $$1.extend(true, {}, $$1.summernote.options.icons, options.icons);\n          options.tooltip = options.tooltip === 'auto' ? !env.isSupportTouch : options.tooltip;\n          this.each(function (idx, note) {\n              var $note = $$1(note);\n              if (!$note.data('summernote')) {\n                  var context = new Context($note, options);\n                  $note.data('summernote', context);\n                  $note.data('summernote').triggerEvent('init', context.layoutInfo);\n              }\n          });\n          var $note = this.first();\n          if ($note.length) {\n              var context = $note.data('summernote');\n              if (isExternalAPICalled) {\n                  return context.invoke.apply(context, lists.from(arguments));\n              }\n              else if (options.focus) {\n                  context.invoke('editor.focus');\n              }\n          }\n          return this;\n      }\n  });\n\n  /**\n   * return boundaryPoint from TextRange, inspired by Andy Na's HuskyRange.js\n   *\n   * @param {TextRange} textRange\n   * @param {Boolean} isStart\n   * @return {BoundaryPoint}\n   *\n   * @see http://msdn.microsoft.com/en-us/library/ie/ms535872(v=vs.85).aspx\n   */\n  function textRangeToPoint(textRange, isStart) {\n      var container = textRange.parentElement();\n      var offset;\n      var tester = document.body.createTextRange();\n      var prevContainer;\n      var childNodes = lists.from(container.childNodes);\n      for (offset = 0; offset < childNodes.length; offset++) {\n          if (dom.isText(childNodes[offset])) {\n              continue;\n          }\n          tester.moveToElementText(childNodes[offset]);\n          if (tester.compareEndPoints('StartToStart', textRange) >= 0) {\n              break;\n          }\n          prevContainer = childNodes[offset];\n      }\n      if (offset !== 0 && dom.isText(childNodes[offset - 1])) {\n          var textRangeStart = document.body.createTextRange();\n          var curTextNode = null;\n          textRangeStart.moveToElementText(prevContainer || container);\n          textRangeStart.collapse(!prevContainer);\n          curTextNode = prevContainer ? prevContainer.nextSibling : container.firstChild;\n          var pointTester = textRange.duplicate();\n          pointTester.setEndPoint('StartToStart', textRangeStart);\n          var textCount = pointTester.text.replace(/[\\r\\n]/g, '').length;\n          while (textCount > curTextNode.nodeValue.length && curTextNode.nextSibling) {\n              textCount -= curTextNode.nodeValue.length;\n              curTextNode = curTextNode.nextSibling;\n          }\n          // [workaround] enforce IE to re-reference curTextNode, hack\n          var dummy = curTextNode.nodeValue; // eslint-disable-line\n          if (isStart && curTextNode.nextSibling && dom.isText(curTextNode.nextSibling) &&\n              textCount === curTextNode.nodeValue.length) {\n              textCount -= curTextNode.nodeValue.length;\n              curTextNode = curTextNode.nextSibling;\n          }\n          container = curTextNode;\n          offset = textCount;\n      }\n      return {\n          cont: container,\n          offset: offset\n      };\n  }\n  /**\n   * return TextRange from boundary point (inspired by google closure-library)\n   * @param {BoundaryPoint} point\n   * @return {TextRange}\n   */\n  function pointToTextRange(point) {\n      var textRangeInfo = function (container, offset) {\n          var node, isCollapseToStart;\n          if (dom.isText(container)) {\n              var prevTextNodes = dom.listPrev(container, func.not(dom.isText));\n              var prevContainer = lists.last(prevTextNodes).previousSibling;\n              node = prevContainer || container.parentNode;\n              offset += lists.sum(lists.tail(prevTextNodes), dom.nodeLength);\n              isCollapseToStart = !prevContainer;\n          }\n          else {\n              node = container.childNodes[offset] || container;\n              if (dom.isText(node)) {\n                  return textRangeInfo(node, 0);\n              }\n              offset = 0;\n              isCollapseToStart = false;\n          }\n          return {\n              node: node,\n              collapseToStart: isCollapseToStart,\n              offset: offset\n          };\n      };\n      var textRange = document.body.createTextRange();\n      var info = textRangeInfo(point.node, point.offset);\n      textRange.moveToElementText(info.node);\n      textRange.collapse(info.collapseToStart);\n      textRange.moveStart('character', info.offset);\n      return textRange;\n  }\n  /**\n     * Wrapped Range\n     *\n     * @constructor\n     * @param {Node} sc - start container\n     * @param {Number} so - start offset\n     * @param {Node} ec - end container\n     * @param {Number} eo - end offset\n     */\n  var WrappedRange = /** @class */ (function () {\n      function WrappedRange(sc, so, ec, eo) {\n          this.sc = sc;\n          this.so = so;\n          this.ec = ec;\n          this.eo = eo;\n          // isOnEditable: judge whether range is on editable or not\n          this.isOnEditable = this.makeIsOn(dom.isEditable);\n          // isOnList: judge whether range is on list node or not\n          this.isOnList = this.makeIsOn(dom.isList);\n          // isOnAnchor: judge whether range is on anchor node or not\n          this.isOnAnchor = this.makeIsOn(dom.isAnchor);\n          // isOnCell: judge whether range is on cell node or not\n          this.isOnCell = this.makeIsOn(dom.isCell);\n          // isOnData: judge whether range is on data node or not\n          this.isOnData = this.makeIsOn(dom.isData);\n      }\n      // nativeRange: get nativeRange from sc, so, ec, eo\n      WrappedRange.prototype.nativeRange = function () {\n          if (env.isW3CRangeSupport) {\n              var w3cRange = document.createRange();\n              w3cRange.setStart(this.sc, this.sc.data && this.so > this.sc.data.length ? 0 : this.so);\n              w3cRange.setEnd(this.ec, this.sc.data ? Math.min(this.eo, this.sc.data.length) : this.eo);\n              return w3cRange;\n          }\n          else {\n              var textRange = pointToTextRange({\n                  node: this.sc,\n                  offset: this.so\n              });\n              textRange.setEndPoint('EndToEnd', pointToTextRange({\n                  node: this.ec,\n                  offset: this.eo\n              }));\n              return textRange;\n          }\n      };\n      WrappedRange.prototype.getPoints = function () {\n          return {\n              sc: this.sc,\n              so: this.so,\n              ec: this.ec,\n              eo: this.eo\n          };\n      };\n      WrappedRange.prototype.getStartPoint = function () {\n          return {\n              node: this.sc,\n              offset: this.so\n          };\n      };\n      WrappedRange.prototype.getEndPoint = function () {\n          return {\n              node: this.ec,\n              offset: this.eo\n          };\n      };\n      /**\n       * select update visible range\n       */\n      WrappedRange.prototype.select = function () {\n          var nativeRng = this.nativeRange();\n          if (env.isW3CRangeSupport) {\n              var selection = document.getSelection();\n              if (selection.rangeCount > 0) {\n                  selection.removeAllRanges();\n              }\n              selection.addRange(nativeRng);\n          }\n          else {\n              nativeRng.select();\n          }\n          return this;\n      };\n      /**\n       * Moves the scrollbar to start container(sc) of current range\n       *\n       * @return {WrappedRange}\n       */\n      WrappedRange.prototype.scrollIntoView = function (container) {\n          var height = $$1(container).height();\n          if (container.scrollTop + height < this.sc.offsetTop) {\n              container.scrollTop += Math.abs(container.scrollTop + height - this.sc.offsetTop);\n          }\n          return this;\n      };\n      /**\n       * @return {WrappedRange}\n       */\n      WrappedRange.prototype.normalize = function () {\n          /**\n           * @param {BoundaryPoint} point\n           * @param {Boolean} isLeftToRight - true: prefer to choose right node\n           *                                - false: prefer to choose left node\n           * @return {BoundaryPoint}\n           */\n          var getVisiblePoint = function (point, isLeftToRight) {\n              // Just use the given point [XXX:Adhoc]\n              //  - case 01. if the point is on the middle of the node\n              //  - case 02. if the point is on the right edge and prefer to choose left node\n              //  - case 03. if the point is on the left edge and prefer to choose right node\n              //  - case 04. if the point is on the right edge and prefer to choose right node but the node is void\n              //  - case 05. if the point is on the left edge and prefer to choose left node but the node is void\n              //  - case 06. if the point is on the block node and there is no children\n              if (dom.isVisiblePoint(point)) {\n                  if (!dom.isEdgePoint(point) ||\n                      (dom.isRightEdgePoint(point) && !isLeftToRight) ||\n                      (dom.isLeftEdgePoint(point) && isLeftToRight) ||\n                      (dom.isRightEdgePoint(point) && isLeftToRight && dom.isVoid(point.node.nextSibling)) ||\n                      (dom.isLeftEdgePoint(point) && !isLeftToRight && dom.isVoid(point.node.previousSibling)) ||\n                      (dom.isBlock(point.node) && dom.isEmpty(point.node))) {\n                      return point;\n                  }\n              }\n              // point on block's edge\n              var block = dom.ancestor(point.node, dom.isBlock);\n              if (((dom.isLeftEdgePointOf(point, block) || dom.isVoid(dom.prevPoint(point).node)) && !isLeftToRight) ||\n                  ((dom.isRightEdgePointOf(point, block) || dom.isVoid(dom.nextPoint(point).node)) && isLeftToRight)) {\n                  // returns point already on visible point\n                  if (dom.isVisiblePoint(point)) {\n                      return point;\n                  }\n                  // reverse direction\n                  isLeftToRight = !isLeftToRight;\n              }\n              var nextPoint = isLeftToRight ? dom.nextPointUntil(dom.nextPoint(point), dom.isVisiblePoint)\n                  : dom.prevPointUntil(dom.prevPoint(point), dom.isVisiblePoint);\n              return nextPoint || point;\n          };\n          var endPoint = getVisiblePoint(this.getEndPoint(), false);\n          var startPoint = this.isCollapsed() ? endPoint : getVisiblePoint(this.getStartPoint(), true);\n          return new WrappedRange(startPoint.node, startPoint.offset, endPoint.node, endPoint.offset);\n      };\n      /**\n       * returns matched nodes on range\n       *\n       * @param {Function} [pred] - predicate function\n       * @param {Object} [options]\n       * @param {Boolean} [options.includeAncestor]\n       * @param {Boolean} [options.fullyContains]\n       * @return {Node[]}\n       */\n      WrappedRange.prototype.nodes = function (pred, options) {\n          pred = pred || func.ok;\n          var includeAncestor = options && options.includeAncestor;\n          var fullyContains = options && options.fullyContains;\n          // TODO compare points and sort\n          var startPoint = this.getStartPoint();\n          var endPoint = this.getEndPoint();\n          var nodes = [];\n          var leftEdgeNodes = [];\n          dom.walkPoint(startPoint, endPoint, function (point) {\n              if (dom.isEditable(point.node)) {\n                  return;\n              }\n              var node;\n              if (fullyContains) {\n                  if (dom.isLeftEdgePoint(point)) {\n                      leftEdgeNodes.push(point.node);\n                  }\n                  if (dom.isRightEdgePoint(point) && lists.contains(leftEdgeNodes, point.node)) {\n                      node = point.node;\n                  }\n              }\n              else if (includeAncestor) {\n                  node = dom.ancestor(point.node, pred);\n              }\n              else {\n                  node = point.node;\n              }\n              if (node && pred(node)) {\n                  nodes.push(node);\n              }\n          }, true);\n          return lists.unique(nodes);\n      };\n      /**\n       * returns commonAncestor of range\n       * @return {Element} - commonAncestor\n       */\n      WrappedRange.prototype.commonAncestor = function () {\n          return dom.commonAncestor(this.sc, this.ec);\n      };\n      /**\n       * returns expanded range by pred\n       *\n       * @param {Function} pred - predicate function\n       * @return {WrappedRange}\n       */\n      WrappedRange.prototype.expand = function (pred) {\n          var startAncestor = dom.ancestor(this.sc, pred);\n          var endAncestor = dom.ancestor(this.ec, pred);\n          if (!startAncestor && !endAncestor) {\n              return new WrappedRange(this.sc, this.so, this.ec, this.eo);\n          }\n          var boundaryPoints = this.getPoints();\n          if (startAncestor) {\n              boundaryPoints.sc = startAncestor;\n              boundaryPoints.so = 0;\n          }\n          if (endAncestor) {\n              boundaryPoints.ec = endAncestor;\n              boundaryPoints.eo = dom.nodeLength(endAncestor);\n          }\n          return new WrappedRange(boundaryPoints.sc, boundaryPoints.so, boundaryPoints.ec, boundaryPoints.eo);\n      };\n      /**\n       * @param {Boolean} isCollapseToStart\n       * @return {WrappedRange}\n       */\n      WrappedRange.prototype.collapse = function (isCollapseToStart) {\n          if (isCollapseToStart) {\n              return new WrappedRange(this.sc, this.so, this.sc, this.so);\n          }\n          else {\n              return new WrappedRange(this.ec, this.eo, this.ec, this.eo);\n          }\n      };\n      /**\n       * splitText on range\n       */\n      WrappedRange.prototype.splitText = function () {\n          var isSameContainer = this.sc === this.ec;\n          var boundaryPoints = this.getPoints();\n          if (dom.isText(this.ec) && !dom.isEdgePoint(this.getEndPoint())) {\n              this.ec.splitText(this.eo);\n          }\n          if (dom.isText(this.sc) && !dom.isEdgePoint(this.getStartPoint())) {\n              boundaryPoints.sc = this.sc.splitText(this.so);\n              boundaryPoints.so = 0;\n              if (isSameContainer) {\n                  boundaryPoints.ec = boundaryPoints.sc;\n                  boundaryPoints.eo = this.eo - this.so;\n              }\n          }\n          return new WrappedRange(boundaryPoints.sc, boundaryPoints.so, boundaryPoints.ec, boundaryPoints.eo);\n      };\n      /**\n       * delete contents on range\n       * @return {WrappedRange}\n       */\n      WrappedRange.prototype.deleteContents = function () {\n          if (this.isCollapsed()) {\n              return this;\n          }\n          var rng = this.splitText();\n          var nodes = rng.nodes(null, {\n              fullyContains: true\n          });\n          // find new cursor point\n          var point = dom.prevPointUntil(rng.getStartPoint(), function (point) {\n              return !lists.contains(nodes, point.node);\n          });\n          var emptyParents = [];\n          $$1.each(nodes, function (idx, node) {\n              // find empty parents\n              var parent = node.parentNode;\n              if (point.node !== parent && dom.nodeLength(parent) === 1) {\n                  emptyParents.push(parent);\n              }\n              dom.remove(node, false);\n          });\n          // remove empty parents\n          $$1.each(emptyParents, function (idx, node) {\n              dom.remove(node, false);\n          });\n          return new WrappedRange(point.node, point.offset, point.node, point.offset).normalize();\n      };\n      /**\n       * makeIsOn: return isOn(pred) function\n       */\n      WrappedRange.prototype.makeIsOn = function (pred) {\n          return function () {\n              var ancestor = dom.ancestor(this.sc, pred);\n              return !!ancestor && (ancestor === dom.ancestor(this.ec, pred));\n          };\n      };\n      /**\n       * @param {Function} pred\n       * @return {Boolean}\n       */\n      WrappedRange.prototype.isLeftEdgeOf = function (pred) {\n          if (!dom.isLeftEdgePoint(this.getStartPoint())) {\n              return false;\n          }\n          var node = dom.ancestor(this.sc, pred);\n          return node && dom.isLeftEdgeOf(this.sc, node);\n      };\n      /**\n       * returns whether range was collapsed or not\n       */\n      WrappedRange.prototype.isCollapsed = function () {\n          return this.sc === this.ec && this.so === this.eo;\n      };\n      /**\n       * wrap inline nodes which children of body with paragraph\n       *\n       * @return {WrappedRange}\n       */\n      WrappedRange.prototype.wrapBodyInlineWithPara = function () {\n          if (dom.isBodyContainer(this.sc) && dom.isEmpty(this.sc)) {\n              this.sc.innerHTML = dom.emptyPara;\n              return new WrappedRange(this.sc.firstChild, 0, this.sc.firstChild, 0);\n          }\n          /**\n           * [workaround] firefox often create range on not visible point. so normalize here.\n           *  - firefox: |<p>text</p>|\n           *  - chrome: <p>|text|</p>\n           */\n          var rng = this.normalize();\n          if (dom.isParaInline(this.sc) || dom.isPara(this.sc)) {\n              return rng;\n          }\n          // find inline top ancestor\n          var topAncestor;\n          if (dom.isInline(rng.sc)) {\n              var ancestors = dom.listAncestor(rng.sc, func.not(dom.isInline));\n              topAncestor = lists.last(ancestors);\n              if (!dom.isInline(topAncestor)) {\n                  topAncestor = ancestors[ancestors.length - 2] || rng.sc.childNodes[rng.so];\n              }\n          }\n          else {\n              topAncestor = rng.sc.childNodes[rng.so > 0 ? rng.so - 1 : 0];\n          }\n          // siblings not in paragraph\n          var inlineSiblings = dom.listPrev(topAncestor, dom.isParaInline).reverse();\n          inlineSiblings = inlineSiblings.concat(dom.listNext(topAncestor.nextSibling, dom.isParaInline));\n          // wrap with paragraph\n          if (inlineSiblings.length) {\n              var para = dom.wrap(lists.head(inlineSiblings), 'p');\n              dom.appendChildNodes(para, lists.tail(inlineSiblings));\n          }\n          return this.normalize();\n      };\n      /**\n       * insert node at current cursor\n       *\n       * @param {Node} node\n       * @return {Node}\n       */\n      WrappedRange.prototype.insertNode = function (node) {\n          var rng = this.wrapBodyInlineWithPara().deleteContents();\n          var info = dom.splitPoint(rng.getStartPoint(), dom.isInline(node));\n          if (info.rightNode) {\n              info.rightNode.parentNode.insertBefore(node, info.rightNode);\n          }\n          else {\n              info.container.appendChild(node);\n          }\n          return node;\n      };\n      /**\n       * insert html at current cursor\n       */\n      WrappedRange.prototype.pasteHTML = function (markup) {\n          var contentsContainer = $$1('<div></div>').html(markup)[0];\n          var childNodes = lists.from(contentsContainer.childNodes);\n          var rng = this.wrapBodyInlineWithPara().deleteContents();\n          if (rng.so > 0) {\n              childNodes = childNodes.reverse();\n          }\n          childNodes = childNodes.map(function (childNode) {\n              return rng.insertNode(childNode);\n          });\n          if (rng.so > 0) {\n              childNodes = childNodes.reverse();\n          }\n          return childNodes;\n      };\n      /**\n       * returns text in range\n       *\n       * @return {String}\n       */\n      WrappedRange.prototype.toString = function () {\n          var nativeRng = this.nativeRange();\n          return env.isW3CRangeSupport ? nativeRng.toString() : nativeRng.text;\n      };\n      /**\n       * returns range for word before cursor\n       *\n       * @param {Boolean} [findAfter] - find after cursor, default: false\n       * @return {WrappedRange}\n       */\n      WrappedRange.prototype.getWordRange = function (findAfter) {\n          var endPoint = this.getEndPoint();\n          if (!dom.isCharPoint(endPoint)) {\n              return this;\n          }\n          var startPoint = dom.prevPointUntil(endPoint, function (point) {\n              return !dom.isCharPoint(point);\n          });\n          if (findAfter) {\n              endPoint = dom.nextPointUntil(endPoint, function (point) {\n                  return !dom.isCharPoint(point);\n              });\n          }\n          return new WrappedRange(startPoint.node, startPoint.offset, endPoint.node, endPoint.offset);\n      };\n      /**\n       * create offsetPath bookmark\n       *\n       * @param {Node} editable\n       */\n      WrappedRange.prototype.bookmark = function (editable) {\n          return {\n              s: {\n                  path: dom.makeOffsetPath(editable, this.sc),\n                  offset: this.so\n              },\n              e: {\n                  path: dom.makeOffsetPath(editable, this.ec),\n                  offset: this.eo\n              }\n          };\n      };\n      /**\n       * create offsetPath bookmark base on paragraph\n       *\n       * @param {Node[]} paras\n       */\n      WrappedRange.prototype.paraBookmark = function (paras) {\n          return {\n              s: {\n                  path: lists.tail(dom.makeOffsetPath(lists.head(paras), this.sc)),\n                  offset: this.so\n              },\n              e: {\n                  path: lists.tail(dom.makeOffsetPath(lists.last(paras), this.ec)),\n                  offset: this.eo\n              }\n          };\n      };\n      /**\n       * getClientRects\n       * @return {Rect[]}\n       */\n      WrappedRange.prototype.getClientRects = function () {\n          var nativeRng = this.nativeRange();\n          return nativeRng.getClientRects();\n      };\n      return WrappedRange;\n  }());\n  /**\n   * Data structure\n   *  * BoundaryPoint: a point of dom tree\n   *  * BoundaryPoints: two boundaryPoints corresponding to the start and the end of the Range\n   *\n   * See to http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html#Level-2-Range-Position\n   */\n  var range = {\n      /**\n       * create Range Object From arguments or Browser Selection\n       *\n       * @param {Node} sc - start container\n       * @param {Number} so - start offset\n       * @param {Node} ec - end container\n       * @param {Number} eo - end offset\n       * @return {WrappedRange}\n       */\n      create: function (sc, so, ec, eo) {\n          if (arguments.length === 4) {\n              return new WrappedRange(sc, so, ec, eo);\n          }\n          else if (arguments.length === 2) { // collapsed\n              ec = sc;\n              eo = so;\n              return new WrappedRange(sc, so, ec, eo);\n          }\n          else {\n              var wrappedRange = this.createFromSelection();\n              if (!wrappedRange && arguments.length === 1) {\n                  wrappedRange = this.createFromNode(arguments[0]);\n                  return wrappedRange.collapse(dom.emptyPara === arguments[0].innerHTML);\n              }\n              return wrappedRange;\n          }\n      },\n      createFromSelection: function () {\n          var sc, so, ec, eo;\n          if (env.isW3CRangeSupport) {\n              var selection = document.getSelection();\n              if (!selection || selection.rangeCount === 0) {\n                  return null;\n              }\n              else if (dom.isBody(selection.anchorNode)) {\n                  // Firefox: returns entire body as range on initialization.\n                  // We won't never need it.\n                  return null;\n              }\n              var nativeRng = selection.getRangeAt(0);\n              sc = nativeRng.startContainer;\n              so = nativeRng.startOffset;\n              ec = nativeRng.endContainer;\n              eo = nativeRng.endOffset;\n          }\n          else { // IE8: TextRange\n              var textRange = document.selection.createRange();\n              var textRangeEnd = textRange.duplicate();\n              textRangeEnd.collapse(false);\n              var textRangeStart = textRange;\n              textRangeStart.collapse(true);\n              var startPoint = textRangeToPoint(textRangeStart, true);\n              var endPoint = textRangeToPoint(textRangeEnd, false);\n              // same visible point case: range was collapsed.\n              if (dom.isText(startPoint.node) && dom.isLeftEdgePoint(startPoint) &&\n                  dom.isTextNode(endPoint.node) && dom.isRightEdgePoint(endPoint) &&\n                  endPoint.node.nextSibling === startPoint.node) {\n                  startPoint = endPoint;\n              }\n              sc = startPoint.cont;\n              so = startPoint.offset;\n              ec = endPoint.cont;\n              eo = endPoint.offset;\n          }\n          return new WrappedRange(sc, so, ec, eo);\n      },\n      /**\n       * @method\n       *\n       * create WrappedRange from node\n       *\n       * @param {Node} node\n       * @return {WrappedRange}\n       */\n      createFromNode: function (node) {\n          var sc = node;\n          var so = 0;\n          var ec = node;\n          var eo = dom.nodeLength(ec);\n          // browsers can't target a picture or void node\n          if (dom.isVoid(sc)) {\n              so = dom.listPrev(sc).length - 1;\n              sc = sc.parentNode;\n          }\n          if (dom.isBR(ec)) {\n              eo = dom.listPrev(ec).length - 1;\n              ec = ec.parentNode;\n          }\n          else if (dom.isVoid(ec)) {\n              eo = dom.listPrev(ec).length;\n              ec = ec.parentNode;\n          }\n          return this.create(sc, so, ec, eo);\n      },\n      /**\n       * create WrappedRange from node after position\n       *\n       * @param {Node} node\n       * @return {WrappedRange}\n       */\n      createFromNodeBefore: function (node) {\n          return this.createFromNode(node).collapse(true);\n      },\n      /**\n       * create WrappedRange from node after position\n       *\n       * @param {Node} node\n       * @return {WrappedRange}\n       */\n      createFromNodeAfter: function (node) {\n          return this.createFromNode(node).collapse();\n      },\n      /**\n       * @method\n       *\n       * create WrappedRange from bookmark\n       *\n       * @param {Node} editable\n       * @param {Object} bookmark\n       * @return {WrappedRange}\n       */\n      createFromBookmark: function (editable, bookmark) {\n          var sc = dom.fromOffsetPath(editable, bookmark.s.path);\n          var so = bookmark.s.offset;\n          var ec = dom.fromOffsetPath(editable, bookmark.e.path);\n          var eo = bookmark.e.offset;\n          return new WrappedRange(sc, so, ec, eo);\n      },\n      /**\n       * @method\n       *\n       * create WrappedRange from paraBookmark\n       *\n       * @param {Object} bookmark\n       * @param {Node[]} paras\n       * @return {WrappedRange}\n       */\n      createFromParaBookmark: function (bookmark, paras) {\n          var so = bookmark.s.offset;\n          var eo = bookmark.e.offset;\n          var sc = dom.fromOffsetPath(lists.head(paras), bookmark.s.path);\n          var ec = dom.fromOffsetPath(lists.last(paras), bookmark.e.path);\n          return new WrappedRange(sc, so, ec, eo);\n      }\n  };\n\n  var KEY_MAP = {\n      'BACKSPACE': 8,\n      'TAB': 9,\n      'ENTER': 13,\n      'SPACE': 32,\n      'DELETE': 46,\n      // Arrow\n      'LEFT': 37,\n      'UP': 38,\n      'RIGHT': 39,\n      'DOWN': 40,\n      // Number: 0-9\n      'NUM0': 48,\n      'NUM1': 49,\n      'NUM2': 50,\n      'NUM3': 51,\n      'NUM4': 52,\n      'NUM5': 53,\n      'NUM6': 54,\n      'NUM7': 55,\n      'NUM8': 56,\n      // Alphabet: a-z\n      'B': 66,\n      'E': 69,\n      'I': 73,\n      'J': 74,\n      'K': 75,\n      'L': 76,\n      'R': 82,\n      'S': 83,\n      'U': 85,\n      'V': 86,\n      'Y': 89,\n      'Z': 90,\n      'SLASH': 191,\n      'LEFTBRACKET': 219,\n      'BACKSLASH': 220,\n      'RIGHTBRACKET': 221\n  };\n  /**\n   * @class core.key\n   *\n   * Object for keycodes.\n   *\n   * @singleton\n   * @alternateClassName key\n   */\n  var key = {\n      /**\n       * @method isEdit\n       *\n       * @param {Number} keyCode\n       * @return {Boolean}\n       */\n      isEdit: function (keyCode) {\n          return lists.contains([\n              KEY_MAP.BACKSPACE,\n              KEY_MAP.TAB,\n              KEY_MAP.ENTER,\n              KEY_MAP.SPACE,\n              KEY_MAP.DELETE,\n          ], keyCode);\n      },\n      /**\n       * @method isMove\n       *\n       * @param {Number} keyCode\n       * @return {Boolean}\n       */\n      isMove: function (keyCode) {\n          return lists.contains([\n              KEY_MAP.LEFT,\n              KEY_MAP.UP,\n              KEY_MAP.RIGHT,\n              KEY_MAP.DOWN,\n          ], keyCode);\n      },\n      /**\n       * @property {Object} nameFromCode\n       * @property {String} nameFromCode.8 \"BACKSPACE\"\n       */\n      nameFromCode: func.invertObject(KEY_MAP),\n      code: KEY_MAP\n  };\n\n  /**\n   * @method readFileAsDataURL\n   *\n   * read contents of file as representing URL\n   *\n   * @param {File} file\n   * @return {Promise} - then: dataUrl\n   */\n  function readFileAsDataURL(file) {\n      return $$1.Deferred(function (deferred) {\n          $$1.extend(new FileReader(), {\n              onload: function (e) {\n                  var dataURL = e.target.result;\n                  deferred.resolve(dataURL);\n              },\n              onerror: function (err) {\n                  deferred.reject(err);\n              }\n          }).readAsDataURL(file);\n      }).promise();\n  }\n  /**\n   * @method createImage\n   *\n   * create `<image>` from url string\n   *\n   * @param {String} url\n   * @return {Promise} - then: $image\n   */\n  function createImage(url) {\n      return $$1.Deferred(function (deferred) {\n          var $img = $$1('<img>');\n          $img.one('load', function () {\n              $img.off('error abort');\n              deferred.resolve($img);\n          }).one('error abort', function () {\n              $img.off('load').detach();\n              deferred.reject($img);\n          }).css({\n              display: 'none'\n          }).appendTo(document.body).attr('src', url);\n      }).promise();\n  }\n\n  var History = /** @class */ (function () {\n      function History($editable) {\n          this.stack = [];\n          this.stackOffset = -1;\n          this.$editable = $editable;\n          this.editable = $editable[0];\n      }\n      History.prototype.makeSnapshot = function () {\n          var rng = range.create(this.editable);\n          var emptyBookmark = { s: { path: [], offset: 0 }, e: { path: [], offset: 0 } };\n          return {\n              contents: this.$editable.html(),\n              bookmark: ((rng && rng.isOnEditable()) ? rng.bookmark(this.editable) : emptyBookmark)\n          };\n      };\n      History.prototype.applySnapshot = function (snapshot) {\n          if (snapshot.contents !== null) {\n              this.$editable.html(snapshot.contents);\n          }\n          if (snapshot.bookmark !== null) {\n              range.createFromBookmark(this.editable, snapshot.bookmark).select();\n          }\n      };\n      /**\n      * @method rewind\n      * Rewinds the history stack back to the first snapshot taken.\n      * Leaves the stack intact, so that \"Redo\" can still be used.\n      */\n      History.prototype.rewind = function () {\n          // Create snap shot if not yet recorded\n          if (this.$editable.html() !== this.stack[this.stackOffset].contents) {\n              this.recordUndo();\n          }\n          // Return to the first available snapshot.\n          this.stackOffset = 0;\n          // Apply that snapshot.\n          this.applySnapshot(this.stack[this.stackOffset]);\n      };\n      /**\n      *  @method commit\n      *  Resets history stack, but keeps current editor's content.\n      */\n      History.prototype.commit = function () {\n          // Clear the stack.\n          this.stack = [];\n          // Restore stackOffset to its original value.\n          this.stackOffset = -1;\n          // Record our first snapshot (of nothing).\n          this.recordUndo();\n      };\n      /**\n      * @method reset\n      * Resets the history stack completely; reverting to an empty editor.\n      */\n      History.prototype.reset = function () {\n          // Clear the stack.\n          this.stack = [];\n          // Restore stackOffset to its original value.\n          this.stackOffset = -1;\n          // Clear the editable area.\n          this.$editable.html('');\n          // Record our first snapshot (of nothing).\n          this.recordUndo();\n      };\n      /**\n       * undo\n       */\n      History.prototype.undo = function () {\n          // Create snap shot if not yet recorded\n          if (this.$editable.html() !== this.stack[this.stackOffset].contents) {\n              this.recordUndo();\n          }\n          if (this.stackOffset > 0) {\n              this.stackOffset--;\n              this.applySnapshot(this.stack[this.stackOffset]);\n          }\n      };\n      /**\n       * redo\n       */\n      History.prototype.redo = function () {\n          if (this.stack.length - 1 > this.stackOffset) {\n              this.stackOffset++;\n              this.applySnapshot(this.stack[this.stackOffset]);\n          }\n      };\n      /**\n       * recorded undo\n       */\n      History.prototype.recordUndo = function () {\n          this.stackOffset++;\n          // Wash out stack after stackOffset\n          if (this.stack.length > this.stackOffset) {\n              this.stack = this.stack.slice(0, this.stackOffset);\n          }\n          // Create new snapshot and push it to the end\n          this.stack.push(this.makeSnapshot());\n      };\n      return History;\n  }());\n\n  var Style = /** @class */ (function () {\n      function Style() {\n      }\n      /**\n       * @method jQueryCSS\n       *\n       * [workaround] for old jQuery\n       * passing an array of style properties to .css()\n       * will result in an object of property-value pairs.\n       * (compability with version < 1.9)\n       *\n       * @private\n       * @param  {jQuery} $obj\n       * @param  {Array} propertyNames - An array of one or more CSS properties.\n       * @return {Object}\n       */\n      Style.prototype.jQueryCSS = function ($obj, propertyNames) {\n          if (env.jqueryVersion < 1.9) {\n              var result_1 = {};\n              $$1.each(propertyNames, function (idx, propertyName) {\n                  result_1[propertyName] = $obj.css(propertyName);\n              });\n              return result_1;\n          }\n          return $obj.css(propertyNames);\n      };\n      /**\n       * returns style object from node\n       *\n       * @param {jQuery} $node\n       * @return {Object}\n       */\n      Style.prototype.fromNode = function ($node) {\n          var properties = ['font-family', 'font-size', 'text-align', 'list-style-type', 'line-height'];\n          var styleInfo = this.jQueryCSS($node, properties) || {};\n          styleInfo['font-size'] = parseInt(styleInfo['font-size'], 10);\n          return styleInfo;\n      };\n      /**\n       * paragraph level style\n       *\n       * @param {WrappedRange} rng\n       * @param {Object} styleInfo\n       */\n      Style.prototype.stylePara = function (rng, styleInfo) {\n          $$1.each(rng.nodes(dom.isPara, {\n              includeAncestor: true\n          }), function (idx, para) {\n              $$1(para).css(styleInfo);\n          });\n      };\n      /**\n       * insert and returns styleNodes on range.\n       *\n       * @param {WrappedRange} rng\n       * @param {Object} [options] - options for styleNodes\n       * @param {String} [options.nodeName] - default: `SPAN`\n       * @param {Boolean} [options.expandClosestSibling] - default: `false`\n       * @param {Boolean} [options.onlyPartialContains] - default: `false`\n       * @return {Node[]}\n       */\n      Style.prototype.styleNodes = function (rng, options) {\n          rng = rng.splitText();\n          var nodeName = (options && options.nodeName) || 'SPAN';\n          var expandClosestSibling = !!(options && options.expandClosestSibling);\n          var onlyPartialContains = !!(options && options.onlyPartialContains);\n          if (rng.isCollapsed()) {\n              return [rng.insertNode(dom.create(nodeName))];\n          }\n          var pred = dom.makePredByNodeName(nodeName);\n          var nodes = rng.nodes(dom.isText, {\n              fullyContains: true\n          }).map(function (text) {\n              return dom.singleChildAncestor(text, pred) || dom.wrap(text, nodeName);\n          });\n          if (expandClosestSibling) {\n              if (onlyPartialContains) {\n                  var nodesInRange_1 = rng.nodes();\n                  // compose with partial contains predication\n                  pred = func.and(pred, function (node) {\n                      return lists.contains(nodesInRange_1, node);\n                  });\n              }\n              return nodes.map(function (node) {\n                  var siblings = dom.withClosestSiblings(node, pred);\n                  var head = lists.head(siblings);\n                  var tails = lists.tail(siblings);\n                  $$1.each(tails, function (idx, elem) {\n                      dom.appendChildNodes(head, elem.childNodes);\n                      dom.remove(elem);\n                  });\n                  return lists.head(siblings);\n              });\n          }\n          else {\n              return nodes;\n          }\n      };\n      /**\n       * get current style on cursor\n       *\n       * @param {WrappedRange} rng\n       * @return {Object} - object contains style properties.\n       */\n      Style.prototype.current = function (rng) {\n          var $cont = $$1(!dom.isElement(rng.sc) ? rng.sc.parentNode : rng.sc);\n          var styleInfo = this.fromNode($cont);\n          // document.queryCommandState for toggle state\n          // [workaround] prevent Firefox nsresult: \"0x80004005 (NS_ERROR_FAILURE)\"\n          try {\n              styleInfo = $$1.extend(styleInfo, {\n                  'font-bold': document.queryCommandState('bold') ? 'bold' : 'normal',\n                  'font-italic': document.queryCommandState('italic') ? 'italic' : 'normal',\n                  'font-underline': document.queryCommandState('underline') ? 'underline' : 'normal',\n                  'font-subscript': document.queryCommandState('subscript') ? 'subscript' : 'normal',\n                  'font-superscript': document.queryCommandState('superscript') ? 'superscript' : 'normal',\n                  'font-strikethrough': document.queryCommandState('strikethrough') ? 'strikethrough' : 'normal',\n                  'font-family': document.queryCommandValue('fontname') || styleInfo['font-family']\n              });\n          }\n          catch (e) { }\n          // list-style-type to list-style(unordered, ordered)\n          if (!rng.isOnList()) {\n              styleInfo['list-style'] = 'none';\n          }\n          else {\n              var orderedTypes = ['circle', 'disc', 'disc-leading-zero', 'square'];\n              var isUnordered = orderedTypes.indexOf(styleInfo['list-style-type']) > -1;\n              styleInfo['list-style'] = isUnordered ? 'unordered' : 'ordered';\n          }\n          var para = dom.ancestor(rng.sc, dom.isPara);\n          if (para && para.style['line-height']) {\n              styleInfo['line-height'] = para.style.lineHeight;\n          }\n          else {\n              var lineHeight = parseInt(styleInfo['line-height'], 10) / parseInt(styleInfo['font-size'], 10);\n              styleInfo['line-height'] = lineHeight.toFixed(1);\n          }\n          styleInfo.anchor = rng.isOnAnchor() && dom.ancestor(rng.sc, dom.isAnchor);\n          styleInfo.ancestors = dom.listAncestor(rng.sc, dom.isEditable);\n          styleInfo.range = rng;\n          return styleInfo;\n      };\n      return Style;\n  }());\n\n  var Bullet = /** @class */ (function () {\n      function Bullet() {\n      }\n      /**\n       * toggle ordered list\n       */\n      Bullet.prototype.insertOrderedList = function (editable) {\n          this.toggleList('OL', editable);\n      };\n      /**\n       * toggle unordered list\n       */\n      Bullet.prototype.insertUnorderedList = function (editable) {\n          this.toggleList('UL', editable);\n      };\n      /**\n       * indent\n       */\n      Bullet.prototype.indent = function (editable) {\n          var _this = this;\n          var rng = range.create(editable).wrapBodyInlineWithPara();\n          var paras = rng.nodes(dom.isPara, { includeAncestor: true });\n          var clustereds = lists.clusterBy(paras, func.peq2('parentNode'));\n          $$1.each(clustereds, function (idx, paras) {\n              var head = lists.head(paras);\n              if (dom.isLi(head)) {\n                  var previousList_1 = _this.findList(head.previousSibling);\n                  if (previousList_1) {\n                      paras\n                          .map(function (para) { return previousList_1.appendChild(para); });\n                  }\n                  else {\n                      _this.wrapList(paras, head.parentNode.nodeName);\n                      paras\n                          .map(function (para) { return para.parentNode; })\n                          .map(function (para) { return _this.appendToPrevious(para); });\n                  }\n              }\n              else {\n                  $$1.each(paras, function (idx, para) {\n                      $$1(para).css('marginLeft', function (idx, val) {\n                          return (parseInt(val, 10) || 0) + 25;\n                      });\n                  });\n              }\n          });\n          rng.select();\n      };\n      /**\n       * outdent\n       */\n      Bullet.prototype.outdent = function (editable) {\n          var _this = this;\n          var rng = range.create(editable).wrapBodyInlineWithPara();\n          var paras = rng.nodes(dom.isPara, { includeAncestor: true });\n          var clustereds = lists.clusterBy(paras, func.peq2('parentNode'));\n          $$1.each(clustereds, function (idx, paras) {\n              var head = lists.head(paras);\n              if (dom.isLi(head)) {\n                  _this.releaseList([paras]);\n              }\n              else {\n                  $$1.each(paras, function (idx, para) {\n                      $$1(para).css('marginLeft', function (idx, val) {\n                          val = (parseInt(val, 10) || 0);\n                          return val > 25 ? val - 25 : '';\n                      });\n                  });\n              }\n          });\n          rng.select();\n      };\n      /**\n       * toggle list\n       *\n       * @param {String} listName - OL or UL\n       */\n      Bullet.prototype.toggleList = function (listName, editable) {\n          var _this = this;\n          var rng = range.create(editable).wrapBodyInlineWithPara();\n          var paras = rng.nodes(dom.isPara, { includeAncestor: true });\n          var bookmark = rng.paraBookmark(paras);\n          var clustereds = lists.clusterBy(paras, func.peq2('parentNode'));\n          // paragraph to list\n          if (lists.find(paras, dom.isPurePara)) {\n              var wrappedParas_1 = [];\n              $$1.each(clustereds, function (idx, paras) {\n                  wrappedParas_1 = wrappedParas_1.concat(_this.wrapList(paras, listName));\n              });\n              paras = wrappedParas_1;\n              // list to paragraph or change list style\n          }\n          else {\n              var diffLists = rng.nodes(dom.isList, {\n                  includeAncestor: true\n              }).filter(function (listNode) {\n                  return !$$1.nodeName(listNode, listName);\n              });\n              if (diffLists.length) {\n                  $$1.each(diffLists, function (idx, listNode) {\n                      dom.replace(listNode, listName);\n                  });\n              }\n              else {\n                  paras = this.releaseList(clustereds, true);\n              }\n          }\n          range.createFromParaBookmark(bookmark, paras).select();\n      };\n      /**\n       * @param {Node[]} paras\n       * @param {String} listName\n       * @return {Node[]}\n       */\n      Bullet.prototype.wrapList = function (paras, listName) {\n          var head = lists.head(paras);\n          var last = lists.last(paras);\n          var prevList = dom.isList(head.previousSibling) && head.previousSibling;\n          var nextList = dom.isList(last.nextSibling) && last.nextSibling;\n          var listNode = prevList || dom.insertAfter(dom.create(listName || 'UL'), last);\n          // P to LI\n          paras = paras.map(function (para) {\n              return dom.isPurePara(para) ? dom.replace(para, 'LI') : para;\n          });\n          // append to list(<ul>, <ol>)\n          dom.appendChildNodes(listNode, paras);\n          if (nextList) {\n              dom.appendChildNodes(listNode, lists.from(nextList.childNodes));\n              dom.remove(nextList);\n          }\n          return paras;\n      };\n      /**\n       * @method releaseList\n       *\n       * @param {Array[]} clustereds\n       * @param {Boolean} isEscapseToBody\n       * @return {Node[]}\n       */\n      Bullet.prototype.releaseList = function (clustereds, isEscapseToBody) {\n          var _this = this;\n          var releasedParas = [];\n          $$1.each(clustereds, function (idx, paras) {\n              var head = lists.head(paras);\n              var last = lists.last(paras);\n              var headList = isEscapseToBody ? dom.lastAncestor(head, dom.isList) : head.parentNode;\n              var parentItem = headList.parentNode;\n              if (headList.parentNode.nodeName === 'LI') {\n                  paras.map(function (para) {\n                      var newList = _this.findNextSiblings(para);\n                      if (parentItem.nextSibling) {\n                          parentItem.parentNode.insertBefore(para, parentItem.nextSibling);\n                      }\n                      else {\n                          parentItem.parentNode.appendChild(para);\n                      }\n                      if (newList.length) {\n                          _this.wrapList(newList, headList.nodeName);\n                          para.appendChild(newList[0].parentNode);\n                      }\n                  });\n                  if (headList.children.length === 0) {\n                      parentItem.removeChild(headList);\n                  }\n                  if (parentItem.childNodes.length === 0) {\n                      parentItem.parentNode.removeChild(parentItem);\n                  }\n              }\n              else {\n                  var lastList = headList.childNodes.length > 1 ? dom.splitTree(headList, {\n                      node: last.parentNode,\n                      offset: dom.position(last) + 1\n                  }, {\n                      isSkipPaddingBlankHTML: true\n                  }) : null;\n                  var middleList = dom.splitTree(headList, {\n                      node: head.parentNode,\n                      offset: dom.position(head)\n                  }, {\n                      isSkipPaddingBlankHTML: true\n                  });\n                  paras = isEscapseToBody ? dom.listDescendant(middleList, dom.isLi)\n                      : lists.from(middleList.childNodes).filter(dom.isLi);\n                  // LI to P\n                  if (isEscapseToBody || !dom.isList(headList.parentNode)) {\n                      paras = paras.map(function (para) {\n                          return dom.replace(para, 'P');\n                      });\n                  }\n                  $$1.each(lists.from(paras).reverse(), function (idx, para) {\n                      dom.insertAfter(para, headList);\n                  });\n                  // remove empty lists\n                  var rootLists = lists.compact([headList, middleList, lastList]);\n                  $$1.each(rootLists, function (idx, rootList) {\n                      var listNodes = [rootList].concat(dom.listDescendant(rootList, dom.isList));\n                      $$1.each(listNodes.reverse(), function (idx, listNode) {\n                          if (!dom.nodeLength(listNode)) {\n                              dom.remove(listNode, true);\n                          }\n                      });\n                  });\n              }\n              releasedParas = releasedParas.concat(paras);\n          });\n          return releasedParas;\n      };\n      /**\n       * @method appendToPrevious\n       *\n       * Appends list to previous list item, if\n       * none exist it wraps the list in a new list item.\n       *\n       * @param {HTMLNode} ListItem\n       * @return {HTMLNode}\n       */\n      Bullet.prototype.appendToPrevious = function (node) {\n          return node.previousSibling\n              ? dom.appendChildNodes(node.previousSibling, [node])\n              : this.wrapList([node], 'LI');\n      };\n      /**\n       * @method findList\n       *\n       * Finds an existing list in list item\n       *\n       * @param {HTMLNode} ListItem\n       * @return {Array[]}\n       */\n      Bullet.prototype.findList = function (node) {\n          return node\n              ? lists.find(node.children, function (child) { return ['OL', 'UL'].indexOf(child.nodeName) > -1; })\n              : null;\n      };\n      /**\n       * @method findNextSiblings\n       *\n       * Finds all list item siblings that follow it\n       *\n       * @param {HTMLNode} ListItem\n       * @return {HTMLNode}\n       */\n      Bullet.prototype.findNextSiblings = function (node) {\n          var siblings = [];\n          while (node.nextSibling) {\n              siblings.push(node.nextSibling);\n              node = node.nextSibling;\n          }\n          return siblings;\n      };\n      return Bullet;\n  }());\n\n  /**\n   * @class editing.Typing\n   *\n   * Typing\n   *\n   */\n  var Typing = /** @class */ (function () {\n      function Typing(context) {\n          // a Bullet instance to toggle lists off\n          this.bullet = new Bullet();\n          this.options = context.options;\n      }\n      /**\n       * insert tab\n       *\n       * @param {WrappedRange} rng\n       * @param {Number} tabsize\n       */\n      Typing.prototype.insertTab = function (rng, tabsize) {\n          var tab = dom.createText(new Array(tabsize + 1).join(dom.NBSP_CHAR));\n          rng = rng.deleteContents();\n          rng.insertNode(tab, true);\n          rng = range.create(tab, tabsize);\n          rng.select();\n      };\n      /**\n       * insert paragraph\n       *\n       * @param {jQuery} $editable\n       * @param {WrappedRange} rng Can be used in unit tests to \"mock\" the range\n       *\n       * blockquoteBreakingLevel\n       *   0 - No break, the new paragraph remains inside the quote\n       *   1 - Break the first blockquote in the ancestors list\n       *   2 - Break all blockquotes, so that the new paragraph is not quoted (this is the default)\n       */\n      Typing.prototype.insertParagraph = function (editable, rng) {\n          rng = rng || range.create(editable);\n          // deleteContents on range.\n          rng = rng.deleteContents();\n          // Wrap range if it needs to be wrapped by paragraph\n          rng = rng.wrapBodyInlineWithPara();\n          // finding paragraph\n          var splitRoot = dom.ancestor(rng.sc, dom.isPara);\n          var nextPara;\n          // on paragraph: split paragraph\n          if (splitRoot) {\n              // if it is an empty line with li\n              if (dom.isEmpty(splitRoot) && dom.isLi(splitRoot)) {\n                  // toogle UL/OL and escape\n                  this.bullet.toggleList(splitRoot.parentNode.nodeName);\n                  return;\n              }\n              else {\n                  var blockquote = null;\n                  if (this.options.blockquoteBreakingLevel === 1) {\n                      blockquote = dom.ancestor(splitRoot, dom.isBlockquote);\n                  }\n                  else if (this.options.blockquoteBreakingLevel === 2) {\n                      blockquote = dom.lastAncestor(splitRoot, dom.isBlockquote);\n                  }\n                  if (blockquote) {\n                      // We're inside a blockquote and options ask us to break it\n                      nextPara = $$1(dom.emptyPara)[0];\n                      // If the split is right before a <br>, remove it so that there's no \"empty line\"\n                      // after the split in the new blockquote created\n                      if (dom.isRightEdgePoint(rng.getStartPoint()) && dom.isBR(rng.sc.nextSibling)) {\n                          $$1(rng.sc.nextSibling).remove();\n                      }\n                      var split = dom.splitTree(blockquote, rng.getStartPoint(), { isDiscardEmptySplits: true });\n                      if (split) {\n                          split.parentNode.insertBefore(nextPara, split);\n                      }\n                      else {\n                          dom.insertAfter(nextPara, blockquote); // There's no split if we were at the end of the blockquote\n                      }\n                  }\n                  else {\n                      nextPara = dom.splitTree(splitRoot, rng.getStartPoint());\n                      // not a blockquote, just insert the paragraph\n                      var emptyAnchors = dom.listDescendant(splitRoot, dom.isEmptyAnchor);\n                      emptyAnchors = emptyAnchors.concat(dom.listDescendant(nextPara, dom.isEmptyAnchor));\n                      $$1.each(emptyAnchors, function (idx, anchor) {\n                          dom.remove(anchor);\n                      });\n                      // replace empty heading, pre or custom-made styleTag with P tag\n                      if ((dom.isHeading(nextPara) || dom.isPre(nextPara) || dom.isCustomStyleTag(nextPara)) && dom.isEmpty(nextPara)) {\n                          nextPara = dom.replace(nextPara, 'p');\n                      }\n                  }\n              }\n              // no paragraph: insert empty paragraph\n          }\n          else {\n              var next = rng.sc.childNodes[rng.so];\n              nextPara = $$1(dom.emptyPara)[0];\n              if (next) {\n                  rng.sc.insertBefore(nextPara, next);\n              }\n              else {\n                  rng.sc.appendChild(nextPara);\n              }\n          }\n          range.create(nextPara, 0).normalize().select().scrollIntoView(editable);\n      };\n      return Typing;\n  }());\n\n  /**\n   * @class Create a virtual table to create what actions to do in change.\n   * @param {object} startPoint Cell selected to apply change.\n   * @param {enum} where  Where change will be applied Row or Col. Use enum: TableResultAction.where\n   * @param {enum} action Action to be applied. Use enum: TableResultAction.requestAction\n   * @param {object} domTable Dom element of table to make changes.\n   */\n  var TableResultAction = function (startPoint, where, action, domTable) {\n      var _startPoint = { 'colPos': 0, 'rowPos': 0 };\n      var _virtualTable = [];\n      var _actionCellList = [];\n      /// ///////////////////////////////////////////\n      // Private functions\n      /// ///////////////////////////////////////////\n      /**\n       * Set the startPoint of action.\n       */\n      function setStartPoint() {\n          if (!startPoint || !startPoint.tagName || (startPoint.tagName.toLowerCase() !== 'td' && startPoint.tagName.toLowerCase() !== 'th')) {\n              console.error('Impossible to identify start Cell point.', startPoint);\n              return;\n          }\n          _startPoint.colPos = startPoint.cellIndex;\n          if (!startPoint.parentElement || !startPoint.parentElement.tagName || startPoint.parentElement.tagName.toLowerCase() !== 'tr') {\n              console.error('Impossible to identify start Row point.', startPoint);\n              return;\n          }\n          _startPoint.rowPos = startPoint.parentElement.rowIndex;\n      }\n      /**\n       * Define virtual table position info object.\n       *\n       * @param {int} rowIndex Index position in line of virtual table.\n       * @param {int} cellIndex Index position in column of virtual table.\n       * @param {object} baseRow Row affected by this position.\n       * @param {object} baseCell Cell affected by this position.\n       * @param {bool} isSpan Inform if it is an span cell/row.\n       */\n      function setVirtualTablePosition(rowIndex, cellIndex, baseRow, baseCell, isRowSpan, isColSpan, isVirtualCell) {\n          var objPosition = {\n              'baseRow': baseRow,\n              'baseCell': baseCell,\n              'isRowSpan': isRowSpan,\n              'isColSpan': isColSpan,\n              'isVirtual': isVirtualCell\n          };\n          if (!_virtualTable[rowIndex]) {\n              _virtualTable[rowIndex] = [];\n          }\n          _virtualTable[rowIndex][cellIndex] = objPosition;\n      }\n      /**\n       * Create action cell object.\n       *\n       * @param {object} virtualTableCellObj Object of specific position on virtual table.\n       * @param {enum} resultAction Action to be applied in that item.\n       */\n      function getActionCell(virtualTableCellObj, resultAction, virtualRowPosition, virtualColPosition) {\n          return {\n              'baseCell': virtualTableCellObj.baseCell,\n              'action': resultAction,\n              'virtualTable': {\n                  'rowIndex': virtualRowPosition,\n                  'cellIndex': virtualColPosition\n              }\n          };\n      }\n      /**\n       * Recover free index of row to append Cell.\n       *\n       * @param {int} rowIndex Index of row to find free space.\n       * @param {int} cellIndex Index of cell to find free space in table.\n       */\n      function recoverCellIndex(rowIndex, cellIndex) {\n          if (!_virtualTable[rowIndex]) {\n              return cellIndex;\n          }\n          if (!_virtualTable[rowIndex][cellIndex]) {\n              return cellIndex;\n          }\n          var newCellIndex = cellIndex;\n          while (_virtualTable[rowIndex][newCellIndex]) {\n              newCellIndex++;\n              if (!_virtualTable[rowIndex][newCellIndex]) {\n                  return newCellIndex;\n              }\n          }\n      }\n      /**\n       * Recover info about row and cell and add information to virtual table.\n       *\n       * @param {object} row Row to recover information.\n       * @param {object} cell Cell to recover information.\n       */\n      function addCellInfoToVirtual(row, cell) {\n          var cellIndex = recoverCellIndex(row.rowIndex, cell.cellIndex);\n          var cellHasColspan = (cell.colSpan > 1);\n          var cellHasRowspan = (cell.rowSpan > 1);\n          var isThisSelectedCell = (row.rowIndex === _startPoint.rowPos && cell.cellIndex === _startPoint.colPos);\n          setVirtualTablePosition(row.rowIndex, cellIndex, row, cell, cellHasRowspan, cellHasColspan, false);\n          // Add span rows to virtual Table.\n          var rowspanNumber = cell.attributes.rowSpan ? parseInt(cell.attributes.rowSpan.value, 10) : 0;\n          if (rowspanNumber > 1) {\n              for (var rp = 1; rp < rowspanNumber; rp++) {\n                  var rowspanIndex = row.rowIndex + rp;\n                  adjustStartPoint(rowspanIndex, cellIndex, cell, isThisSelectedCell);\n                  setVirtualTablePosition(rowspanIndex, cellIndex, row, cell, true, cellHasColspan, true);\n              }\n          }\n          // Add span cols to virtual table.\n          var colspanNumber = cell.attributes.colSpan ? parseInt(cell.attributes.colSpan.value, 10) : 0;\n          if (colspanNumber > 1) {\n              for (var cp = 1; cp < colspanNumber; cp++) {\n                  var cellspanIndex = recoverCellIndex(row.rowIndex, (cellIndex + cp));\n                  adjustStartPoint(row.rowIndex, cellspanIndex, cell, isThisSelectedCell);\n                  setVirtualTablePosition(row.rowIndex, cellspanIndex, row, cell, cellHasRowspan, true, true);\n              }\n          }\n      }\n      /**\n       * Process validation and adjust of start point if needed\n       *\n       * @param {int} rowIndex\n       * @param {int} cellIndex\n       * @param {object} cell\n       * @param {bool} isSelectedCell\n       */\n      function adjustStartPoint(rowIndex, cellIndex, cell, isSelectedCell) {\n          if (rowIndex === _startPoint.rowPos && _startPoint.colPos >= cell.cellIndex && cell.cellIndex <= cellIndex && !isSelectedCell) {\n              _startPoint.colPos++;\n          }\n      }\n      /**\n       * Create virtual table of cells with all cells, including span cells.\n       */\n      function createVirtualTable() {\n          var rows = domTable.rows;\n          for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {\n              var cells = rows[rowIndex].cells;\n              for (var cellIndex = 0; cellIndex < cells.length; cellIndex++) {\n                  addCellInfoToVirtual(rows[rowIndex], cells[cellIndex]);\n              }\n          }\n      }\n      /**\n       * Get action to be applied on the cell.\n       *\n       * @param {object} cell virtual table cell to apply action\n       */\n      function getDeleteResultActionToCell(cell) {\n          switch (where) {\n              case TableResultAction.where.Column:\n                  if (cell.isColSpan) {\n                      return TableResultAction.resultAction.SubtractSpanCount;\n                  }\n                  break;\n              case TableResultAction.where.Row:\n                  if (!cell.isVirtual && cell.isRowSpan) {\n                      return TableResultAction.resultAction.AddCell;\n                  }\n                  else if (cell.isRowSpan) {\n                      return TableResultAction.resultAction.SubtractSpanCount;\n                  }\n                  break;\n          }\n          return TableResultAction.resultAction.RemoveCell;\n      }\n      /**\n       * Get action to be applied on the cell.\n       *\n       * @param {object} cell virtual table cell to apply action\n       */\n      function getAddResultActionToCell(cell) {\n          switch (where) {\n              case TableResultAction.where.Column:\n                  if (cell.isColSpan) {\n                      return TableResultAction.resultAction.SumSpanCount;\n                  }\n                  else if (cell.isRowSpan && cell.isVirtual) {\n                      return TableResultAction.resultAction.Ignore;\n                  }\n                  break;\n              case TableResultAction.where.Row:\n                  if (cell.isRowSpan) {\n                      return TableResultAction.resultAction.SumSpanCount;\n                  }\n                  else if (cell.isColSpan && cell.isVirtual) {\n                      return TableResultAction.resultAction.Ignore;\n                  }\n                  break;\n          }\n          return TableResultAction.resultAction.AddCell;\n      }\n      function init() {\n          setStartPoint();\n          createVirtualTable();\n      }\n      /// ///////////////////////////////////////////\n      // Public functions\n      /// ///////////////////////////////////////////\n      /**\n       * Recover array os what to do in table.\n       */\n      this.getActionList = function () {\n          var fixedRow = (where === TableResultAction.where.Row) ? _startPoint.rowPos : -1;\n          var fixedCol = (where === TableResultAction.where.Column) ? _startPoint.colPos : -1;\n          var actualPosition = 0;\n          var canContinue = true;\n          while (canContinue) {\n              var rowPosition = (fixedRow >= 0) ? fixedRow : actualPosition;\n              var colPosition = (fixedCol >= 0) ? fixedCol : actualPosition;\n              var row = _virtualTable[rowPosition];\n              if (!row) {\n                  canContinue = false;\n                  return _actionCellList;\n              }\n              var cell = row[colPosition];\n              if (!cell) {\n                  canContinue = false;\n                  return _actionCellList;\n              }\n              // Define action to be applied in this cell\n              var resultAction = TableResultAction.resultAction.Ignore;\n              switch (action) {\n                  case TableResultAction.requestAction.Add:\n                      resultAction = getAddResultActionToCell(cell);\n                      break;\n                  case TableResultAction.requestAction.Delete:\n                      resultAction = getDeleteResultActionToCell(cell);\n                      break;\n              }\n              _actionCellList.push(getActionCell(cell, resultAction, rowPosition, colPosition));\n              actualPosition++;\n          }\n          return _actionCellList;\n      };\n      init();\n  };\n  /**\n  *\n  * Where action occours enum.\n  */\n  TableResultAction.where = { 'Row': 0, 'Column': 1 };\n  /**\n  *\n  * Requested action to apply enum.\n  */\n  TableResultAction.requestAction = { 'Add': 0, 'Delete': 1 };\n  /**\n  *\n  * Result action to be executed enum.\n  */\n  TableResultAction.resultAction = { 'Ignore': 0, 'SubtractSpanCount': 1, 'RemoveCell': 2, 'AddCell': 3, 'SumSpanCount': 4 };\n  /**\n   *\n   * @class editing.Table\n   *\n   * Table\n   *\n   */\n  var Table = /** @class */ (function () {\n      function Table() {\n      }\n      /**\n       * handle tab key\n       *\n       * @param {WrappedRange} rng\n       * @param {Boolean} isShift\n       */\n      Table.prototype.tab = function (rng, isShift) {\n          var cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n          var table = dom.ancestor(cell, dom.isTable);\n          var cells = dom.listDescendant(table, dom.isCell);\n          var nextCell = lists[isShift ? 'prev' : 'next'](cells, cell);\n          if (nextCell) {\n              range.create(nextCell, 0).select();\n          }\n      };\n      /**\n       * Add a new row\n       *\n       * @param {WrappedRange} rng\n       * @param {String} position (top/bottom)\n       * @return {Node}\n       */\n      Table.prototype.addRow = function (rng, position) {\n          var cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n          var currentTr = $$1(cell).closest('tr');\n          var trAttributes = this.recoverAttributes(currentTr);\n          var html = $$1('<tr' + trAttributes + '></tr>');\n          var vTable = new TableResultAction(cell, TableResultAction.where.Row, TableResultAction.requestAction.Add, $$1(currentTr).closest('table')[0]);\n          var actions = vTable.getActionList();\n          for (var idCell = 0; idCell < actions.length; idCell++) {\n              var currentCell = actions[idCell];\n              var tdAttributes = this.recoverAttributes(currentCell.baseCell);\n              switch (currentCell.action) {\n                  case TableResultAction.resultAction.AddCell:\n                      html.append('<td' + tdAttributes + '>' + dom.blank + '</td>');\n                      break;\n                  case TableResultAction.resultAction.SumSpanCount:\n                      if (position === 'top') {\n                          var baseCellTr = currentCell.baseCell.parent;\n                          var isTopFromRowSpan = (!baseCellTr ? 0 : currentCell.baseCell.closest('tr').rowIndex) <= currentTr[0].rowIndex;\n                          if (isTopFromRowSpan) {\n                              var newTd = $$1('<div></div>').append($$1('<td' + tdAttributes + '>' + dom.blank + '</td>').removeAttr('rowspan')).html();\n                              html.append(newTd);\n                              break;\n                          }\n                      }\n                      var rowspanNumber = parseInt(currentCell.baseCell.rowSpan, 10);\n                      rowspanNumber++;\n                      currentCell.baseCell.setAttribute('rowSpan', rowspanNumber);\n                      break;\n              }\n          }\n          if (position === 'top') {\n              currentTr.before(html);\n          }\n          else {\n              var cellHasRowspan = (cell.rowSpan > 1);\n              if (cellHasRowspan) {\n                  var lastTrIndex = currentTr[0].rowIndex + (cell.rowSpan - 2);\n                  $$1($$1(currentTr).parent().find('tr')[lastTrIndex]).after($$1(html));\n                  return;\n              }\n              currentTr.after(html);\n          }\n      };\n      /**\n       * Add a new col\n       *\n       * @param {WrappedRange} rng\n       * @param {String} position (left/right)\n       * @return {Node}\n       */\n      Table.prototype.addCol = function (rng, position) {\n          var cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n          var row = $$1(cell).closest('tr');\n          var rowsGroup = $$1(row).siblings();\n          rowsGroup.push(row);\n          var vTable = new TableResultAction(cell, TableResultAction.where.Column, TableResultAction.requestAction.Add, $$1(row).closest('table')[0]);\n          var actions = vTable.getActionList();\n          for (var actionIndex = 0; actionIndex < actions.length; actionIndex++) {\n              var currentCell = actions[actionIndex];\n              var tdAttributes = this.recoverAttributes(currentCell.baseCell);\n              switch (currentCell.action) {\n                  case TableResultAction.resultAction.AddCell:\n                      if (position === 'right') {\n                          $$1(currentCell.baseCell).after('<td' + tdAttributes + '>' + dom.blank + '</td>');\n                      }\n                      else {\n                          $$1(currentCell.baseCell).before('<td' + tdAttributes + '>' + dom.blank + '</td>');\n                      }\n                      break;\n                  case TableResultAction.resultAction.SumSpanCount:\n                      if (position === 'right') {\n                          var colspanNumber = parseInt(currentCell.baseCell.colSpan, 10);\n                          colspanNumber++;\n                          currentCell.baseCell.setAttribute('colSpan', colspanNumber);\n                      }\n                      else {\n                          $$1(currentCell.baseCell).before('<td' + tdAttributes + '>' + dom.blank + '</td>');\n                      }\n                      break;\n              }\n          }\n      };\n      /*\n      * Copy attributes from element.\n      *\n      * @param {object} Element to recover attributes.\n      * @return {string} Copied string elements.\n      */\n      Table.prototype.recoverAttributes = function (el) {\n          var resultStr = '';\n          if (!el) {\n              return resultStr;\n          }\n          var attrList = el.attributes || [];\n          for (var i = 0; i < attrList.length; i++) {\n              if (attrList[i].name.toLowerCase() === 'id') {\n                  continue;\n              }\n              if (attrList[i].specified) {\n                  resultStr += ' ' + attrList[i].name + '=\\'' + attrList[i].value + '\\'';\n              }\n          }\n          return resultStr;\n      };\n      /**\n       * Delete current row\n       *\n       * @param {WrappedRange} rng\n       * @return {Node}\n       */\n      Table.prototype.deleteRow = function (rng) {\n          var cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n          var row = $$1(cell).closest('tr');\n          var cellPos = row.children('td, th').index($$1(cell));\n          var rowPos = row[0].rowIndex;\n          var vTable = new TableResultAction(cell, TableResultAction.where.Row, TableResultAction.requestAction.Delete, $$1(row).closest('table')[0]);\n          var actions = vTable.getActionList();\n          for (var actionIndex = 0; actionIndex < actions.length; actionIndex++) {\n              if (!actions[actionIndex]) {\n                  continue;\n              }\n              var baseCell = actions[actionIndex].baseCell;\n              var virtualPosition = actions[actionIndex].virtualTable;\n              var hasRowspan = (baseCell.rowSpan && baseCell.rowSpan > 1);\n              var rowspanNumber = (hasRowspan) ? parseInt(baseCell.rowSpan, 10) : 0;\n              switch (actions[actionIndex].action) {\n                  case TableResultAction.resultAction.Ignore:\n                      continue;\n                  case TableResultAction.resultAction.AddCell:\n                      var nextRow = row.next('tr')[0];\n                      if (!nextRow) {\n                          continue;\n                      }\n                      var cloneRow = row[0].cells[cellPos];\n                      if (hasRowspan) {\n                          if (rowspanNumber > 2) {\n                              rowspanNumber--;\n                              nextRow.insertBefore(cloneRow, nextRow.cells[cellPos]);\n                              nextRow.cells[cellPos].setAttribute('rowSpan', rowspanNumber);\n                              nextRow.cells[cellPos].innerHTML = '';\n                          }\n                          else if (rowspanNumber === 2) {\n                              nextRow.insertBefore(cloneRow, nextRow.cells[cellPos]);\n                              nextRow.cells[cellPos].removeAttribute('rowSpan');\n                              nextRow.cells[cellPos].innerHTML = '';\n                          }\n                      }\n                      continue;\n                  case TableResultAction.resultAction.SubtractSpanCount:\n                      if (hasRowspan) {\n                          if (rowspanNumber > 2) {\n                              rowspanNumber--;\n                              baseCell.setAttribute('rowSpan', rowspanNumber);\n                              if (virtualPosition.rowIndex !== rowPos && baseCell.cellIndex === cellPos) {\n                                  baseCell.innerHTML = '';\n                              }\n                          }\n                          else if (rowspanNumber === 2) {\n                              baseCell.removeAttribute('rowSpan');\n                              if (virtualPosition.rowIndex !== rowPos && baseCell.cellIndex === cellPos) {\n                                  baseCell.innerHTML = '';\n                              }\n                          }\n                      }\n                      continue;\n                  case TableResultAction.resultAction.RemoveCell:\n                      // Do not need remove cell because row will be deleted.\n                      continue;\n              }\n          }\n          row.remove();\n      };\n      /**\n       * Delete current col\n       *\n       * @param {WrappedRange} rng\n       * @return {Node}\n       */\n      Table.prototype.deleteCol = function (rng) {\n          var cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n          var row = $$1(cell).closest('tr');\n          var cellPos = row.children('td, th').index($$1(cell));\n          var vTable = new TableResultAction(cell, TableResultAction.where.Column, TableResultAction.requestAction.Delete, $$1(row).closest('table')[0]);\n          var actions = vTable.getActionList();\n          for (var actionIndex = 0; actionIndex < actions.length; actionIndex++) {\n              if (!actions[actionIndex]) {\n                  continue;\n              }\n              switch (actions[actionIndex].action) {\n                  case TableResultAction.resultAction.Ignore:\n                      continue;\n                  case TableResultAction.resultAction.SubtractSpanCount:\n                      var baseCell = actions[actionIndex].baseCell;\n                      var hasColspan = (baseCell.colSpan && baseCell.colSpan > 1);\n                      if (hasColspan) {\n                          var colspanNumber = (baseCell.colSpan) ? parseInt(baseCell.colSpan, 10) : 0;\n                          if (colspanNumber > 2) {\n                              colspanNumber--;\n                              baseCell.setAttribute('colSpan', colspanNumber);\n                              if (baseCell.cellIndex === cellPos) {\n                                  baseCell.innerHTML = '';\n                              }\n                          }\n                          else if (colspanNumber === 2) {\n                              baseCell.removeAttribute('colSpan');\n                              if (baseCell.cellIndex === cellPos) {\n                                  baseCell.innerHTML = '';\n                              }\n                          }\n                      }\n                      continue;\n                  case TableResultAction.resultAction.RemoveCell:\n                      dom.remove(actions[actionIndex].baseCell, true);\n                      continue;\n              }\n          }\n      };\n      /**\n       * create empty table element\n       *\n       * @param {Number} rowCount\n       * @param {Number} colCount\n       * @return {Node}\n       */\n      Table.prototype.createTable = function (colCount, rowCount, options) {\n          var tds = [];\n          var tdHTML;\n          for (var idxCol = 0; idxCol < colCount; idxCol++) {\n              tds.push('<td>' + dom.blank + '</td>');\n          }\n          tdHTML = tds.join('');\n          var trs = [];\n          var trHTML;\n          for (var idxRow = 0; idxRow < rowCount; idxRow++) {\n              trs.push('<tr>' + tdHTML + '</tr>');\n          }\n          trHTML = trs.join('');\n          var $table = $$1('<table>' + trHTML + '</table>');\n          if (options && options.tableClassName) {\n              $table.addClass(options.tableClassName);\n          }\n          return $table[0];\n      };\n      /**\n       * Delete current table\n       *\n       * @param {WrappedRange} rng\n       * @return {Node}\n       */\n      Table.prototype.deleteTable = function (rng) {\n          var cell = dom.ancestor(rng.commonAncestor(), dom.isCell);\n          $$1(cell).closest('table').remove();\n      };\n      return Table;\n  }());\n\n  var KEY_BOGUS = 'bogus';\n  /**\n   * @class Editor\n   */\n  var Editor = /** @class */ (function () {\n      function Editor(context) {\n          var _this = this;\n          this.context = context;\n          this.$note = context.layoutInfo.note;\n          this.$editor = context.layoutInfo.editor;\n          this.$editable = context.layoutInfo.editable;\n          this.options = context.options;\n          this.lang = this.options.langInfo;\n          this.editable = this.$editable[0];\n          this.lastRange = null;\n          this.style = new Style();\n          this.table = new Table();\n          this.typing = new Typing(context);\n          this.bullet = new Bullet();\n          this.history = new History(this.$editable);\n          this.context.memo('help.undo', this.lang.help.undo);\n          this.context.memo('help.redo', this.lang.help.redo);\n          this.context.memo('help.tab', this.lang.help.tab);\n          this.context.memo('help.untab', this.lang.help.untab);\n          this.context.memo('help.insertParagraph', this.lang.help.insertParagraph);\n          this.context.memo('help.insertOrderedList', this.lang.help.insertOrderedList);\n          this.context.memo('help.insertUnorderedList', this.lang.help.insertUnorderedList);\n          this.context.memo('help.indent', this.lang.help.indent);\n          this.context.memo('help.outdent', this.lang.help.outdent);\n          this.context.memo('help.formatPara', this.lang.help.formatPara);\n          this.context.memo('help.insertHorizontalRule', this.lang.help.insertHorizontalRule);\n          this.context.memo('help.fontName', this.lang.help.fontName);\n          // native commands(with execCommand), generate function for execCommand\n          var commands = [\n              'bold', 'italic', 'underline', 'strikethrough', 'superscript', 'subscript',\n              'justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull',\n              'formatBlock', 'removeFormat', 'backColor',\n          ];\n          for (var idx = 0, len = commands.length; idx < len; idx++) {\n              this[commands[idx]] = (function (sCmd) {\n                  return function (value) {\n                      _this.beforeCommand();\n                      document.execCommand(sCmd, false, value);\n                      _this.afterCommand(true);\n                  };\n              })(commands[idx]);\n              this.context.memo('help.' + commands[idx], this.lang.help[commands[idx]]);\n          }\n          this.fontName = this.wrapCommand(function (value) {\n              return _this.fontStyling('font-family', \"\\'\" + value + \"\\'\");\n          });\n          this.fontSize = this.wrapCommand(function (value) {\n              return _this.fontStyling('font-size', value + 'px');\n          });\n          for (var idx = 1; idx <= 6; idx++) {\n              this['formatH' + idx] = (function (idx) {\n                  return function () {\n                      _this.formatBlock('H' + idx);\n                  };\n              })(idx);\n              this.context.memo('help.formatH' + idx, this.lang.help['formatH' + idx]);\n          }\n          this.insertParagraph = this.wrapCommand(function () {\n              _this.typing.insertParagraph(_this.editable);\n          });\n          this.insertOrderedList = this.wrapCommand(function () {\n              _this.bullet.insertOrderedList(_this.editable);\n          });\n          this.insertUnorderedList = this.wrapCommand(function () {\n              _this.bullet.insertUnorderedList(_this.editable);\n          });\n          this.indent = this.wrapCommand(function () {\n              _this.bullet.indent(_this.editable);\n          });\n          this.outdent = this.wrapCommand(function () {\n              _this.bullet.outdent(_this.editable);\n          });\n          /**\n           * insertNode\n           * insert node\n           * @param {Node} node\n           */\n          this.insertNode = this.wrapCommand(function (node) {\n              if (_this.isLimited($$1(node).text().length)) {\n                  return;\n              }\n              var rng = _this.getLastRange();\n              rng.insertNode(node);\n              range.createFromNodeAfter(node).select();\n              _this.setLastRange();\n          });\n          /**\n           * insert text\n           * @param {String} text\n           */\n          this.insertText = this.wrapCommand(function (text) {\n              if (_this.isLimited(text.length)) {\n                  return;\n              }\n              var rng = _this.getLastRange();\n              var textNode = rng.insertNode(dom.createText(text));\n              range.create(textNode, dom.nodeLength(textNode)).select();\n              _this.setLastRange();\n          });\n          /**\n           * paste HTML\n           * @param {String} markup\n           */\n          this.pasteHTML = this.wrapCommand(function (markup) {\n              if (_this.isLimited(markup.length)) {\n                  return;\n              }\n              markup = _this.context.invoke('codeview.purify', markup);\n              var contents = _this.getLastRange().pasteHTML(markup);\n              range.createFromNodeAfter(lists.last(contents)).select();\n              _this.setLastRange();\n          });\n          /**\n           * formatBlock\n           *\n           * @param {String} tagName\n           */\n          this.formatBlock = this.wrapCommand(function (tagName, $target) {\n              var onApplyCustomStyle = _this.options.callbacks.onApplyCustomStyle;\n              if (onApplyCustomStyle) {\n                  onApplyCustomStyle.call(_this, $target, _this.context, _this.onFormatBlock);\n              }\n              else {\n                  _this.onFormatBlock(tagName, $target);\n              }\n          });\n          /**\n           * insert horizontal rule\n           */\n          this.insertHorizontalRule = this.wrapCommand(function () {\n              var hrNode = _this.getLastRange().insertNode(dom.create('HR'));\n              if (hrNode.nextSibling) {\n                  range.create(hrNode.nextSibling, 0).normalize().select();\n                  _this.setLastRange();\n              }\n          });\n          /**\n           * lineHeight\n           * @param {String} value\n           */\n          this.lineHeight = this.wrapCommand(function (value) {\n              _this.style.stylePara(_this.getLastRange(), {\n                  lineHeight: value\n              });\n          });\n          /**\n           * create link (command)\n           *\n           * @param {Object} linkInfo\n           */\n          this.createLink = this.wrapCommand(function (linkInfo) {\n              var linkUrl = linkInfo.url;\n              var linkText = linkInfo.text;\n              var isNewWindow = linkInfo.isNewWindow;\n              var rng = linkInfo.range || _this.getLastRange();\n              var additionalTextLength = linkText.length - rng.toString().length;\n              if (additionalTextLength > 0 && _this.isLimited(additionalTextLength)) {\n                  return;\n              }\n              var isTextChanged = rng.toString() !== linkText;\n              // handle spaced urls from input\n              if (typeof linkUrl === 'string') {\n                  linkUrl = linkUrl.trim();\n              }\n              if (_this.options.onCreateLink) {\n                  linkUrl = _this.options.onCreateLink(linkUrl);\n              }\n              else {\n                  // if url doesn't have any protocol and not even a relative or a label, use http:// as default\n                  linkUrl = /^([A-Za-z][A-Za-z0-9+-.]*\\:|#|\\/)/.test(linkUrl)\n                      ? linkUrl : 'http://' + linkUrl;\n              }\n              var anchors = [];\n              if (isTextChanged) {\n                  rng = rng.deleteContents();\n                  var anchor = rng.insertNode($$1('<A>' + linkText + '</A>')[0]);\n                  anchors.push(anchor);\n              }\n              else {\n                  anchors = _this.style.styleNodes(rng, {\n                      nodeName: 'A',\n                      expandClosestSibling: true,\n                      onlyPartialContains: true\n                  });\n              }\n              $$1.each(anchors, function (idx, anchor) {\n                  $$1(anchor).attr('href', linkUrl);\n                  if (isNewWindow) {\n                      $$1(anchor).attr('target', '_blank');\n                  }\n                  else {\n                      $$1(anchor).removeAttr('target');\n                  }\n              });\n              var startRange = range.createFromNodeBefore(lists.head(anchors));\n              var startPoint = startRange.getStartPoint();\n              var endRange = range.createFromNodeAfter(lists.last(anchors));\n              var endPoint = endRange.getEndPoint();\n              range.create(startPoint.node, startPoint.offset, endPoint.node, endPoint.offset).select();\n              _this.setLastRange();\n          });\n          /**\n           * setting color\n           *\n           * @param {Object} sObjColor  color code\n           * @param {String} sObjColor.foreColor foreground color\n           * @param {String} sObjColor.backColor background color\n           */\n          this.color = this.wrapCommand(function (colorInfo) {\n              var foreColor = colorInfo.foreColor;\n              var backColor = colorInfo.backColor;\n              if (foreColor) {\n                  document.execCommand('foreColor', false, foreColor);\n              }\n              if (backColor) {\n                  document.execCommand('backColor', false, backColor);\n              }\n          });\n          /**\n           * Set foreground color\n           *\n           * @param {String} colorCode foreground color code\n           */\n          this.foreColor = this.wrapCommand(function (colorInfo) {\n              document.execCommand('styleWithCSS', false, true);\n              document.execCommand('foreColor', false, colorInfo);\n          });\n          /**\n           * insert Table\n           *\n           * @param {String} dimension of table (ex : \"5x5\")\n           */\n          this.insertTable = this.wrapCommand(function (dim) {\n              var dimension = dim.split('x');\n              var rng = _this.getLastRange().deleteContents();\n              rng.insertNode(_this.table.createTable(dimension[0], dimension[1], _this.options));\n          });\n          /**\n           * remove media object and Figure Elements if media object is img with Figure.\n           */\n          this.removeMedia = this.wrapCommand(function () {\n              var $target = $$1(_this.restoreTarget()).parent();\n              if ($target.parent('figure').length) {\n                  $target.parent('figure').remove();\n              }\n              else {\n                  $target = $$1(_this.restoreTarget()).detach();\n              }\n              _this.context.triggerEvent('media.delete', $target, _this.$editable);\n          });\n          /**\n           * float me\n           *\n           * @param {String} value\n           */\n          this.floatMe = this.wrapCommand(function (value) {\n              var $target = $$1(_this.restoreTarget());\n              $target.toggleClass('note-float-left', value === 'left');\n              $target.toggleClass('note-float-right', value === 'right');\n              $target.css('float', (value === 'none' ? '' : value));\n          });\n          /**\n           * resize overlay element\n           * @param {String} value\n           */\n          this.resize = this.wrapCommand(function (value) {\n              var $target = $$1(_this.restoreTarget());\n              value = parseFloat(value);\n              if (value === 0) {\n                  $target.css('width', '');\n              }\n              else {\n                  $target.css({\n                      width: value * 100 + '%',\n                      height: ''\n                  });\n              }\n          });\n      }\n      Editor.prototype.initialize = function () {\n          var _this = this;\n          // bind custom events\n          this.$editable.on('keydown', function (event) {\n              if (event.keyCode === key.code.ENTER) {\n                  _this.context.triggerEvent('enter', event);\n              }\n              _this.context.triggerEvent('keydown', event);\n              if (!event.isDefaultPrevented()) {\n                  if (_this.options.shortcuts) {\n                      _this.handleKeyMap(event);\n                  }\n                  else {\n                      _this.preventDefaultEditableShortCuts(event);\n                  }\n              }\n              if (_this.isLimited(1, event)) {\n                  return false;\n              }\n          }).on('keyup', function (event) {\n              _this.setLastRange();\n              _this.context.triggerEvent('keyup', event);\n          }).on('focus', function (event) {\n              _this.setLastRange();\n              _this.context.triggerEvent('focus', event);\n          }).on('blur', function (event) {\n              _this.context.triggerEvent('blur', event);\n          }).on('mousedown', function (event) {\n              _this.context.triggerEvent('mousedown', event);\n          }).on('mouseup', function (event) {\n              _this.setLastRange();\n              _this.context.triggerEvent('mouseup', event);\n          }).on('scroll', function (event) {\n              _this.context.triggerEvent('scroll', event);\n          }).on('paste', function (event) {\n              _this.setLastRange();\n              _this.context.triggerEvent('paste', event);\n          });\n          this.$editable.attr('spellcheck', this.options.spellCheck);\n          // init content before set event\n          this.$editable.html(dom.html(this.$note) || dom.emptyPara);\n          this.$editable.on(env.inputEventName, func.debounce(function () {\n              _this.context.triggerEvent('change', _this.$editable.html(), _this.$editable);\n          }, 10));\n          this.$editor.on('focusin', function (event) {\n              _this.context.triggerEvent('focusin', event);\n          }).on('focusout', function (event) {\n              _this.context.triggerEvent('focusout', event);\n          });\n          if (!this.options.airMode) {\n              if (this.options.width) {\n                  this.$editor.outerWidth(this.options.width);\n              }\n              if (this.options.height) {\n                  this.$editable.outerHeight(this.options.height);\n              }\n              if (this.options.maxHeight) {\n                  this.$editable.css('max-height', this.options.maxHeight);\n              }\n              if (this.options.minHeight) {\n                  this.$editable.css('min-height', this.options.minHeight);\n              }\n          }\n          this.history.recordUndo();\n          this.setLastRange();\n      };\n      Editor.prototype.destroy = function () {\n          this.$editable.off();\n      };\n      Editor.prototype.handleKeyMap = function (event) {\n          var keyMap = this.options.keyMap[env.isMac ? 'mac' : 'pc'];\n          var keys = [];\n          if (event.metaKey) {\n              keys.push('CMD');\n          }\n          if (event.ctrlKey && !event.altKey) {\n              keys.push('CTRL');\n          }\n          if (event.shiftKey) {\n              keys.push('SHIFT');\n          }\n          var keyName = key.nameFromCode[event.keyCode];\n          if (keyName) {\n              keys.push(keyName);\n          }\n          var eventName = keyMap[keys.join('+')];\n          if (eventName) {\n              if (this.context.invoke(eventName) !== false) {\n                  event.preventDefault();\n              }\n          }\n          else if (key.isEdit(event.keyCode)) {\n              this.afterCommand();\n          }\n      };\n      Editor.prototype.preventDefaultEditableShortCuts = function (event) {\n          // B(Bold, 66) / I(Italic, 73) / U(Underline, 85)\n          if ((event.ctrlKey || event.metaKey) &&\n              lists.contains([66, 73, 85], event.keyCode)) {\n              event.preventDefault();\n          }\n      };\n      Editor.prototype.isLimited = function (pad, event) {\n          pad = pad || 0;\n          if (typeof event !== 'undefined') {\n              if (key.isMove(event.keyCode) ||\n                  (event.ctrlKey || event.metaKey) ||\n                  lists.contains([key.code.BACKSPACE, key.code.DELETE], event.keyCode)) {\n                  return false;\n              }\n          }\n          if (this.options.maxTextLength > 0) {\n              if ((this.$editable.text().length + pad) >= this.options.maxTextLength) {\n                  return true;\n              }\n          }\n          return false;\n      };\n      /**\n       * create range\n       * @return {WrappedRange}\n       */\n      Editor.prototype.createRange = function () {\n          this.focus();\n          this.setLastRange();\n          return this.getLastRange();\n      };\n      Editor.prototype.setLastRange = function () {\n          this.lastRange = range.create(this.editable);\n      };\n      Editor.prototype.getLastRange = function () {\n          if (!this.lastRange) {\n              this.setLastRange();\n          }\n          return this.lastRange;\n      };\n      /**\n       * saveRange\n       *\n       * save current range\n       *\n       * @param {Boolean} [thenCollapse=false]\n       */\n      Editor.prototype.saveRange = function (thenCollapse) {\n          if (thenCollapse) {\n              this.getLastRange().collapse().select();\n          }\n      };\n      /**\n       * restoreRange\n       *\n       * restore lately range\n       */\n      Editor.prototype.restoreRange = function () {\n          if (this.lastRange) {\n              this.lastRange.select();\n              this.focus();\n          }\n      };\n      Editor.prototype.saveTarget = function (node) {\n          this.$editable.data('target', node);\n      };\n      Editor.prototype.clearTarget = function () {\n          this.$editable.removeData('target');\n      };\n      Editor.prototype.restoreTarget = function () {\n          return this.$editable.data('target');\n      };\n      /**\n       * currentStyle\n       *\n       * current style\n       * @return {Object|Boolean} unfocus\n       */\n      Editor.prototype.currentStyle = function () {\n          var rng = range.create();\n          if (rng) {\n              rng = rng.normalize();\n          }\n          return rng ? this.style.current(rng) : this.style.fromNode(this.$editable);\n      };\n      /**\n       * style from node\n       *\n       * @param {jQuery} $node\n       * @return {Object}\n       */\n      Editor.prototype.styleFromNode = function ($node) {\n          return this.style.fromNode($node);\n      };\n      /**\n       * undo\n       */\n      Editor.prototype.undo = function () {\n          this.context.triggerEvent('before.command', this.$editable.html());\n          this.history.undo();\n          this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n      };\n      /*\n      * commit\n      */\n      Editor.prototype.commit = function () {\n          this.context.triggerEvent('before.command', this.$editable.html());\n          this.history.commit();\n          this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n      };\n      /**\n       * redo\n       */\n      Editor.prototype.redo = function () {\n          this.context.triggerEvent('before.command', this.$editable.html());\n          this.history.redo();\n          this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n      };\n      /**\n       * before command\n       */\n      Editor.prototype.beforeCommand = function () {\n          this.context.triggerEvent('before.command', this.$editable.html());\n          // keep focus on editable before command execution\n          this.focus();\n      };\n      /**\n       * after command\n       * @param {Boolean} isPreventTrigger\n       */\n      Editor.prototype.afterCommand = function (isPreventTrigger) {\n          this.normalizeContent();\n          this.history.recordUndo();\n          if (!isPreventTrigger) {\n              this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n          }\n      };\n      /**\n       * handle tab key\n       */\n      Editor.prototype.tab = function () {\n          var rng = this.getLastRange();\n          if (rng.isCollapsed() && rng.isOnCell()) {\n              this.table.tab(rng);\n          }\n          else {\n              if (this.options.tabSize === 0) {\n                  return false;\n              }\n              if (!this.isLimited(this.options.tabSize)) {\n                  this.beforeCommand();\n                  this.typing.insertTab(rng, this.options.tabSize);\n                  this.afterCommand();\n              }\n          }\n      };\n      /**\n       * handle shift+tab key\n       */\n      Editor.prototype.untab = function () {\n          var rng = this.getLastRange();\n          if (rng.isCollapsed() && rng.isOnCell()) {\n              this.table.tab(rng, true);\n          }\n          else {\n              if (this.options.tabSize === 0) {\n                  return false;\n              }\n          }\n      };\n      /**\n       * run given function between beforeCommand and afterCommand\n       */\n      Editor.prototype.wrapCommand = function (fn) {\n          return function () {\n              this.beforeCommand();\n              fn.apply(this, arguments);\n              this.afterCommand();\n          };\n      };\n      /**\n       * insert image\n       *\n       * @param {String} src\n       * @param {String|Function} param\n       * @return {Promise}\n       */\n      Editor.prototype.insertImage = function (src, param) {\n          var _this = this;\n          return createImage(src, param).then(function ($image) {\n              _this.beforeCommand();\n              if (typeof param === 'function') {\n                  param($image);\n              }\n              else {\n                  if (typeof param === 'string') {\n                      $image.attr('data-filename', param);\n                  }\n                  $image.css('width', Math.min(_this.$editable.width(), $image.width()));\n              }\n              $image.show();\n              range.create(_this.editable).insertNode($image[0]);\n              range.createFromNodeAfter($image[0]).select();\n              _this.setLastRange();\n              _this.afterCommand();\n          }).fail(function (e) {\n              _this.context.triggerEvent('image.upload.error', e);\n          });\n      };\n      /**\n       * insertImages\n       * @param {File[]} files\n       */\n      Editor.prototype.insertImagesAsDataURL = function (files) {\n          var _this = this;\n          $$1.each(files, function (idx, file) {\n              var filename = file.name;\n              if (_this.options.maximumImageFileSize && _this.options.maximumImageFileSize < file.size) {\n                  _this.context.triggerEvent('image.upload.error', _this.lang.image.maximumFileSizeError);\n              }\n              else {\n                  readFileAsDataURL(file).then(function (dataURL) {\n                      return _this.insertImage(dataURL, filename);\n                  }).fail(function () {\n                      _this.context.triggerEvent('image.upload.error');\n                  });\n              }\n          });\n      };\n      /**\n       * insertImagesOrCallback\n       * @param {File[]} files\n       */\n      Editor.prototype.insertImagesOrCallback = function (files) {\n          var callbacks = this.options.callbacks;\n          // If onImageUpload set,\n          if (callbacks.onImageUpload) {\n              this.context.triggerEvent('image.upload', files);\n              // else insert Image as dataURL\n          }\n          else {\n              this.insertImagesAsDataURL(files);\n          }\n      };\n      /**\n       * return selected plain text\n       * @return {String} text\n       */\n      Editor.prototype.getSelectedText = function () {\n          var rng = this.getLastRange();\n          // if range on anchor, expand range with anchor\n          if (rng.isOnAnchor()) {\n              rng = range.createFromNode(dom.ancestor(rng.sc, dom.isAnchor));\n          }\n          return rng.toString();\n      };\n      Editor.prototype.onFormatBlock = function (tagName, $target) {\n          // [workaround] for MSIE, IE need `<`\n          document.execCommand('FormatBlock', false, env.isMSIE ? '<' + tagName + '>' : tagName);\n          // support custom class\n          if ($target && $target.length) {\n              // find the exact element has given tagName\n              if ($target[0].tagName.toUpperCase() !== tagName.toUpperCase()) {\n                  $target = $target.find(tagName);\n              }\n              if ($target && $target.length) {\n                  var className = $target[0].className || '';\n                  if (className) {\n                      var currentRange = this.createRange();\n                      var $parent = $$1([currentRange.sc, currentRange.ec]).closest(tagName);\n                      $parent.addClass(className);\n                  }\n              }\n          }\n      };\n      Editor.prototype.formatPara = function () {\n          this.formatBlock('P');\n      };\n      Editor.prototype.fontStyling = function (target, value) {\n          var rng = this.getLastRange();\n          if (rng) {\n              var spans = this.style.styleNodes(rng);\n              $$1(spans).css(target, value);\n              // [workaround] added styled bogus span for style\n              //  - also bogus character needed for cursor position\n              if (rng.isCollapsed()) {\n                  var firstSpan = lists.head(spans);\n                  if (firstSpan && !dom.nodeLength(firstSpan)) {\n                      firstSpan.innerHTML = dom.ZERO_WIDTH_NBSP_CHAR;\n                      range.createFromNodeAfter(firstSpan.firstChild).select();\n                      this.setLastRange();\n                      this.$editable.data(KEY_BOGUS, firstSpan);\n                  }\n              }\n          }\n      };\n      /**\n       * unlink\n       *\n       * @type command\n       */\n      Editor.prototype.unlink = function () {\n          var rng = this.getLastRange();\n          if (rng.isOnAnchor()) {\n              var anchor = dom.ancestor(rng.sc, dom.isAnchor);\n              rng = range.createFromNode(anchor);\n              rng.select();\n              this.setLastRange();\n              this.beforeCommand();\n              document.execCommand('unlink');\n              this.afterCommand();\n          }\n      };\n      /**\n       * returns link info\n       *\n       * @return {Object}\n       * @return {WrappedRange} return.range\n       * @return {String} return.text\n       * @return {Boolean} [return.isNewWindow=true]\n       * @return {String} [return.url=\"\"]\n       */\n      Editor.prototype.getLinkInfo = function () {\n          var rng = this.getLastRange().expand(dom.isAnchor);\n          // Get the first anchor on range(for edit).\n          var $anchor = $$1(lists.head(rng.nodes(dom.isAnchor)));\n          var linkInfo = {\n              range: rng,\n              text: rng.toString(),\n              url: $anchor.length ? $anchor.attr('href') : ''\n          };\n          // When anchor exists,\n          if ($anchor.length) {\n              // Set isNewWindow by checking its target.\n              linkInfo.isNewWindow = $anchor.attr('target') === '_blank';\n          }\n          return linkInfo;\n      };\n      Editor.prototype.addRow = function (position) {\n          var rng = this.getLastRange(this.$editable);\n          if (rng.isCollapsed() && rng.isOnCell()) {\n              this.beforeCommand();\n              this.table.addRow(rng, position);\n              this.afterCommand();\n          }\n      };\n      Editor.prototype.addCol = function (position) {\n          var rng = this.getLastRange(this.$editable);\n          if (rng.isCollapsed() && rng.isOnCell()) {\n              this.beforeCommand();\n              this.table.addCol(rng, position);\n              this.afterCommand();\n          }\n      };\n      Editor.prototype.deleteRow = function () {\n          var rng = this.getLastRange(this.$editable);\n          if (rng.isCollapsed() && rng.isOnCell()) {\n              this.beforeCommand();\n              this.table.deleteRow(rng);\n              this.afterCommand();\n          }\n      };\n      Editor.prototype.deleteCol = function () {\n          var rng = this.getLastRange(this.$editable);\n          if (rng.isCollapsed() && rng.isOnCell()) {\n              this.beforeCommand();\n              this.table.deleteCol(rng);\n              this.afterCommand();\n          }\n      };\n      Editor.prototype.deleteTable = function () {\n          var rng = this.getLastRange(this.$editable);\n          if (rng.isCollapsed() && rng.isOnCell()) {\n              this.beforeCommand();\n              this.table.deleteTable(rng);\n              this.afterCommand();\n          }\n      };\n      /**\n       * @param {Position} pos\n       * @param {jQuery} $target - target element\n       * @param {Boolean} [bKeepRatio] - keep ratio\n       */\n      Editor.prototype.resizeTo = function (pos, $target, bKeepRatio) {\n          var imageSize;\n          if (bKeepRatio) {\n              var newRatio = pos.y / pos.x;\n              var ratio = $target.data('ratio');\n              imageSize = {\n                  width: ratio > newRatio ? pos.x : pos.y / ratio,\n                  height: ratio > newRatio ? pos.x * ratio : pos.y\n              };\n          }\n          else {\n              imageSize = {\n                  width: pos.x,\n                  height: pos.y\n              };\n          }\n          $target.css(imageSize);\n      };\n      /**\n       * returns whether editable area has focus or not.\n       */\n      Editor.prototype.hasFocus = function () {\n          return this.$editable.is(':focus');\n      };\n      /**\n       * set focus\n       */\n      Editor.prototype.focus = function () {\n          // [workaround] Screen will move when page is scolled in IE.\n          //  - do focus when not focused\n          if (!this.hasFocus()) {\n              this.$editable.focus();\n          }\n      };\n      /**\n       * returns whether contents is empty or not.\n       * @return {Boolean}\n       */\n      Editor.prototype.isEmpty = function () {\n          return dom.isEmpty(this.$editable[0]) || dom.emptyPara === this.$editable.html();\n      };\n      /**\n       * Removes all contents and restores the editable instance to an _emptyPara_.\n       */\n      Editor.prototype.empty = function () {\n          this.context.invoke('code', dom.emptyPara);\n      };\n      /**\n       * normalize content\n       */\n      Editor.prototype.normalizeContent = function () {\n          this.$editable[0].normalize();\n      };\n      return Editor;\n  }());\n\n  var Clipboard = /** @class */ (function () {\n      function Clipboard(context) {\n          this.context = context;\n          this.$editable = context.layoutInfo.editable;\n      }\n      Clipboard.prototype.initialize = function () {\n          this.$editable.on('paste', this.pasteByEvent.bind(this));\n      };\n      /**\n       * paste by clipboard event\n       *\n       * @param {Event} event\n       */\n      Clipboard.prototype.pasteByEvent = function (event) {\n          var clipboardData = event.originalEvent.clipboardData;\n          if (clipboardData && clipboardData.items && clipboardData.items.length) {\n              // paste img file\n              var item = clipboardData.items.length > 1 ? clipboardData.items[1] : lists.head(clipboardData.items);\n              if (item.kind === 'file' && item.type.indexOf('image/') !== -1) {\n                  this.context.invoke('editor.insertImagesOrCallback', [item.getAsFile()]);\n              }\n              this.context.invoke('editor.afterCommand');\n          }\n      };\n      return Clipboard;\n  }());\n\n  var Dropzone = /** @class */ (function () {\n      function Dropzone(context) {\n          this.context = context;\n          this.$eventListener = $$1(document);\n          this.$editor = context.layoutInfo.editor;\n          this.$editable = context.layoutInfo.editable;\n          this.options = context.options;\n          this.lang = this.options.langInfo;\n          this.documentEventHandlers = {};\n          this.$dropzone = $$1([\n              '<div class=\"note-dropzone\">',\n              '  <div class=\"note-dropzone-message\"/>',\n              '</div>',\n          ].join('')).prependTo(this.$editor);\n      }\n      /**\n       * attach Drag and Drop Events\n       */\n      Dropzone.prototype.initialize = function () {\n          if (this.options.disableDragAndDrop) {\n              // prevent default drop event\n              this.documentEventHandlers.onDrop = function (e) {\n                  e.preventDefault();\n              };\n              // do not consider outside of dropzone\n              this.$eventListener = this.$dropzone;\n              this.$eventListener.on('drop', this.documentEventHandlers.onDrop);\n          }\n          else {\n              this.attachDragAndDropEvent();\n          }\n      };\n      /**\n       * attach Drag and Drop Events\n       */\n      Dropzone.prototype.attachDragAndDropEvent = function () {\n          var _this = this;\n          var collection = $$1();\n          var $dropzoneMessage = this.$dropzone.find('.note-dropzone-message');\n          this.documentEventHandlers.onDragenter = function (e) {\n              var isCodeview = _this.context.invoke('codeview.isActivated');\n              var hasEditorSize = _this.$editor.width() > 0 && _this.$editor.height() > 0;\n              if (!isCodeview && !collection.length && hasEditorSize) {\n                  _this.$editor.addClass('dragover');\n                  _this.$dropzone.width(_this.$editor.width());\n                  _this.$dropzone.height(_this.$editor.height());\n                  $dropzoneMessage.text(_this.lang.image.dragImageHere);\n              }\n              collection = collection.add(e.target);\n          };\n          this.documentEventHandlers.onDragleave = function (e) {\n              collection = collection.not(e.target);\n              if (!collection.length) {\n                  _this.$editor.removeClass('dragover');\n              }\n          };\n          this.documentEventHandlers.onDrop = function () {\n              collection = $$1();\n              _this.$editor.removeClass('dragover');\n          };\n          // show dropzone on dragenter when dragging a object to document\n          // -but only if the editor is visible, i.e. has a positive width and height\n          this.$eventListener.on('dragenter', this.documentEventHandlers.onDragenter)\n              .on('dragleave', this.documentEventHandlers.onDragleave)\n              .on('drop', this.documentEventHandlers.onDrop);\n          // change dropzone's message on hover.\n          this.$dropzone.on('dragenter', function () {\n              _this.$dropzone.addClass('hover');\n              $dropzoneMessage.text(_this.lang.image.dropImage);\n          }).on('dragleave', function () {\n              _this.$dropzone.removeClass('hover');\n              $dropzoneMessage.text(_this.lang.image.dragImageHere);\n          });\n          // attach dropImage\n          this.$dropzone.on('drop', function (event) {\n              var dataTransfer = event.originalEvent.dataTransfer;\n              // stop the browser from opening the dropped content\n              event.preventDefault();\n              if (dataTransfer && dataTransfer.files && dataTransfer.files.length) {\n                  _this.$editable.focus();\n                  _this.context.invoke('editor.insertImagesOrCallback', dataTransfer.files);\n              }\n              else {\n                  $$1.each(dataTransfer.types, function (idx, type) {\n                      var content = dataTransfer.getData(type);\n                      if (type.toLowerCase().indexOf('text') > -1) {\n                          _this.context.invoke('editor.pasteHTML', content);\n                      }\n                      else {\n                          $$1(content).each(function (idx, item) {\n                              _this.context.invoke('editor.insertNode', item);\n                          });\n                      }\n                  });\n              }\n          }).on('dragover', false); // prevent default dragover event\n      };\n      Dropzone.prototype.destroy = function () {\n          var _this = this;\n          Object.keys(this.documentEventHandlers).forEach(function (key) {\n              _this.$eventListener.off(key.substr(2).toLowerCase(), _this.documentEventHandlers[key]);\n          });\n          this.documentEventHandlers = {};\n      };\n      return Dropzone;\n  }());\n\n  var CodeMirror;\n  if (env.hasCodeMirror) {\n      CodeMirror = window.CodeMirror;\n  }\n  /**\n   * @class Codeview\n   */\n  var CodeView = /** @class */ (function () {\n      function CodeView(context) {\n          this.context = context;\n          this.$editor = context.layoutInfo.editor;\n          this.$editable = context.layoutInfo.editable;\n          this.$codable = context.layoutInfo.codable;\n          this.options = context.options;\n      }\n      CodeView.prototype.sync = function () {\n          var isCodeview = this.isActivated();\n          if (isCodeview && env.hasCodeMirror) {\n              this.$codable.data('cmEditor').save();\n          }\n      };\n      /**\n       * @return {Boolean}\n       */\n      CodeView.prototype.isActivated = function () {\n          return this.$editor.hasClass('codeview');\n      };\n      /**\n       * toggle codeview\n       */\n      CodeView.prototype.toggle = function () {\n          if (this.isActivated()) {\n              this.deactivate();\n          }\n          else {\n              this.activate();\n          }\n          this.context.triggerEvent('codeview.toggled');\n      };\n      /**\n       * purify input value\n       * @param value\n       * @returns {*}\n       */\n      CodeView.prototype.purify = function (value) {\n          if (this.options.codeviewFilter) {\n              // filter code editor regex\n              value = value.replace(this.options.codeviewFilterRegex, '');\n              // allow specific iframe tag\n              if (this.options.codeviewIframeFilter) {\n                  var whitelist_1 = this.options.codeviewIframeWhitelistSrc.concat(this.options.codeviewIframeWhitelistSrcBase);\n                  value = value.replace(/(<iframe.*?>.*?(?:<\\/iframe>)?)/gi, function (tag) {\n                      // remove if src attribute is duplicated\n                      if (/<.+src(?==?('|\"|\\s)?)[\\s\\S]+src(?=('|\"|\\s)?)[^>]*?>/i.test(tag)) {\n                          return '';\n                      }\n                      for (var _i = 0, whitelist_2 = whitelist_1; _i < whitelist_2.length; _i++) {\n                          var src = whitelist_2[_i];\n                          // pass if src is trusted\n                          if ((new RegExp('src=\"(https?:)?\\/\\/' + src.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&') + '\\/(.+)\"')).test(tag)) {\n                              return tag;\n                          }\n                      }\n                      return '';\n                  });\n              }\n          }\n          return value;\n      };\n      /**\n       * activate code editor\n       */\n      CodeView.prototype.activate = function () {\n          var _this = this;\n          this.$codable.val(dom.html(this.$editable, this.options.prettifyHtml));\n          this.$codable.height(this.$editable.height());\n          this.context.invoke('toolbar.updateCodeview', true);\n          this.$editor.addClass('codeview');\n          this.$codable.focus();\n          // activate CodeMirror as codable\n          if (env.hasCodeMirror) {\n              var cmEditor_1 = CodeMirror.fromTextArea(this.$codable[0], this.options.codemirror);\n              // CodeMirror TernServer\n              if (this.options.codemirror.tern) {\n                  var server_1 = new CodeMirror.TernServer(this.options.codemirror.tern);\n                  cmEditor_1.ternServer = server_1;\n                  cmEditor_1.on('cursorActivity', function (cm) {\n                      server_1.updateArgHints(cm);\n                  });\n              }\n              cmEditor_1.on('blur', function (event) {\n                  _this.context.triggerEvent('blur.codeview', cmEditor_1.getValue(), event);\n              });\n              cmEditor_1.on('change', function (event) {\n                  _this.context.triggerEvent('change.codeview', cmEditor_1.getValue(), cmEditor_1);\n              });\n              // CodeMirror hasn't Padding.\n              cmEditor_1.setSize(null, this.$editable.outerHeight());\n              this.$codable.data('cmEditor', cmEditor_1);\n          }\n          else {\n              this.$codable.on('blur', function (event) {\n                  _this.context.triggerEvent('blur.codeview', _this.$codable.val(), event);\n              });\n              this.$codable.on('input', function (event) {\n                  _this.context.triggerEvent('change.codeview', _this.$codable.val(), _this.$codable);\n              });\n          }\n      };\n      /**\n       * deactivate code editor\n       */\n      CodeView.prototype.deactivate = function () {\n          // deactivate CodeMirror as codable\n          if (env.hasCodeMirror) {\n              var cmEditor = this.$codable.data('cmEditor');\n              this.$codable.val(cmEditor.getValue());\n              cmEditor.toTextArea();\n          }\n          var value = this.purify(dom.value(this.$codable, this.options.prettifyHtml) || dom.emptyPara);\n          var isChange = this.$editable.html() !== value;\n          this.$editable.html(value);\n          this.$editable.height(this.options.height ? this.$codable.height() : 'auto');\n          this.$editor.removeClass('codeview');\n          if (isChange) {\n              this.context.triggerEvent('change', this.$editable.html(), this.$editable);\n          }\n          this.$editable.focus();\n          this.context.invoke('toolbar.updateCodeview', false);\n      };\n      CodeView.prototype.destroy = function () {\n          if (this.isActivated()) {\n              this.deactivate();\n          }\n      };\n      return CodeView;\n  }());\n\n  var EDITABLE_PADDING = 24;\n  var Statusbar = /** @class */ (function () {\n      function Statusbar(context) {\n          this.$document = $$1(document);\n          this.$statusbar = context.layoutInfo.statusbar;\n          this.$editable = context.layoutInfo.editable;\n          this.options = context.options;\n      }\n      Statusbar.prototype.initialize = function () {\n          var _this = this;\n          if (this.options.airMode || this.options.disableResizeEditor) {\n              this.destroy();\n              return;\n          }\n          this.$statusbar.on('mousedown', function (event) {\n              event.preventDefault();\n              event.stopPropagation();\n              var editableTop = _this.$editable.offset().top - _this.$document.scrollTop();\n              var onMouseMove = function (event) {\n                  var height = event.clientY - (editableTop + EDITABLE_PADDING);\n                  height = (_this.options.minheight > 0) ? Math.max(height, _this.options.minheight) : height;\n                  height = (_this.options.maxHeight > 0) ? Math.min(height, _this.options.maxHeight) : height;\n                  _this.$editable.height(height);\n              };\n              _this.$document.on('mousemove', onMouseMove).one('mouseup', function () {\n                  _this.$document.off('mousemove', onMouseMove);\n              });\n          });\n      };\n      Statusbar.prototype.destroy = function () {\n          this.$statusbar.off();\n          this.$statusbar.addClass('locked');\n      };\n      return Statusbar;\n  }());\n\n  var Fullscreen = /** @class */ (function () {\n      function Fullscreen(context) {\n          var _this = this;\n          this.context = context;\n          this.$editor = context.layoutInfo.editor;\n          this.$toolbar = context.layoutInfo.toolbar;\n          this.$editable = context.layoutInfo.editable;\n          this.$codable = context.layoutInfo.codable;\n          this.$window = $$1(window);\n          this.$scrollbar = $$1('html, body');\n          this.onResize = function () {\n              _this.resizeTo({\n                  h: _this.$window.height() - _this.$toolbar.outerHeight()\n              });\n          };\n      }\n      Fullscreen.prototype.resizeTo = function (size) {\n          this.$editable.css('height', size.h);\n          this.$codable.css('height', size.h);\n          if (this.$codable.data('cmeditor')) {\n              this.$codable.data('cmeditor').setsize(null, size.h);\n          }\n      };\n      /**\n       * toggle fullscreen\n       */\n      Fullscreen.prototype.toggle = function () {\n          this.$editor.toggleClass('fullscreen');\n          if (this.isFullscreen()) {\n              this.$editable.data('orgHeight', this.$editable.css('height'));\n              this.$editable.data('orgMaxHeight', this.$editable.css('maxHeight'));\n              this.$editable.css('maxHeight', '');\n              this.$window.on('resize', this.onResize).trigger('resize');\n              this.$scrollbar.css('overflow', 'hidden');\n          }\n          else {\n              this.$window.off('resize', this.onResize);\n              this.resizeTo({ h: this.$editable.data('orgHeight') });\n              this.$editable.css('maxHeight', this.$editable.css('orgMaxHeight'));\n              this.$scrollbar.css('overflow', 'visible');\n          }\n          this.context.invoke('toolbar.updateFullscreen', this.isFullscreen());\n      };\n      Fullscreen.prototype.isFullscreen = function () {\n          return this.$editor.hasClass('fullscreen');\n      };\n      return Fullscreen;\n  }());\n\n  var Handle = /** @class */ (function () {\n      function Handle(context) {\n          var _this = this;\n          this.context = context;\n          this.$document = $$1(document);\n          this.$editingArea = context.layoutInfo.editingArea;\n          this.options = context.options;\n          this.lang = this.options.langInfo;\n          this.events = {\n              'summernote.mousedown': function (we, e) {\n                  if (_this.update(e.target, e)) {\n                      e.preventDefault();\n                  }\n              },\n              'summernote.keyup summernote.scroll summernote.change summernote.dialog.shown': function () {\n                  _this.update();\n              },\n              'summernote.disable': function () {\n                  _this.hide();\n              },\n              'summernote.codeview.toggled': function () {\n                  _this.update();\n              }\n          };\n      }\n      Handle.prototype.initialize = function () {\n          var _this = this;\n          this.$handle = $$1([\n              '<div class=\"note-handle\">',\n              '<div class=\"note-control-selection\">',\n              '<div class=\"note-control-selection-bg\"></div>',\n              '<div class=\"note-control-holder note-control-nw\"></div>',\n              '<div class=\"note-control-holder note-control-ne\"></div>',\n              '<div class=\"note-control-holder note-control-sw\"></div>',\n              '<div class=\"',\n              (this.options.disableResizeImage ? 'note-control-holder' : 'note-control-sizing'),\n              ' note-control-se\"></div>',\n              (this.options.disableResizeImage ? '' : '<div class=\"note-control-selection-info\"></div>'),\n              '</div>',\n              '</div>',\n          ].join('')).prependTo(this.$editingArea);\n          this.$handle.on('mousedown', function (event) {\n              if (dom.isControlSizing(event.target)) {\n                  event.preventDefault();\n                  event.stopPropagation();\n                  var $target_1 = _this.$handle.find('.note-control-selection').data('target');\n                  var posStart_1 = $target_1.offset();\n                  var scrollTop_1 = _this.$document.scrollTop();\n                  var onMouseMove_1 = function (event) {\n                      _this.context.invoke('editor.resizeTo', {\n                          x: event.clientX - posStart_1.left,\n                          y: event.clientY - (posStart_1.top - scrollTop_1)\n                      }, $target_1, !event.shiftKey);\n                      _this.update($target_1[0]);\n                  };\n                  _this.$document\n                      .on('mousemove', onMouseMove_1)\n                      .one('mouseup', function (e) {\n                      e.preventDefault();\n                      _this.$document.off('mousemove', onMouseMove_1);\n                      _this.context.invoke('editor.afterCommand');\n                  });\n                  if (!$target_1.data('ratio')) { // original ratio.\n                      $target_1.data('ratio', $target_1.height() / $target_1.width());\n                  }\n              }\n          });\n          // Listen for scrolling on the handle overlay.\n          this.$handle.on('wheel', function (e) {\n              e.preventDefault();\n              _this.update();\n          });\n      };\n      Handle.prototype.destroy = function () {\n          this.$handle.remove();\n      };\n      Handle.prototype.update = function (target, event) {\n          if (this.context.isDisabled()) {\n              return false;\n          }\n          var isImage = dom.isImg(target);\n          var $selection = this.$handle.find('.note-control-selection');\n          this.context.invoke('imagePopover.update', target, event);\n          if (isImage) {\n              var $image = $$1(target);\n              var position = $image.position();\n              var pos = {\n                  left: position.left + parseInt($image.css('marginLeft'), 10),\n                  top: position.top + parseInt($image.css('marginTop'), 10)\n              };\n              // exclude margin\n              var imageSize = {\n                  w: $image.outerWidth(false),\n                  h: $image.outerHeight(false)\n              };\n              $selection.css({\n                  display: 'block',\n                  left: pos.left,\n                  top: pos.top,\n                  width: imageSize.w,\n                  height: imageSize.h\n              }).data('target', $image); // save current image element.\n              var origImageObj = new Image();\n              origImageObj.src = $image.attr('src');\n              var sizingText = imageSize.w + 'x' + imageSize.h + ' (' + this.lang.image.original + ': ' + origImageObj.width + 'x' + origImageObj.height + ')';\n              $selection.find('.note-control-selection-info').text(sizingText);\n              this.context.invoke('editor.saveTarget', target);\n          }\n          else {\n              this.hide();\n          }\n          return isImage;\n      };\n      /**\n       * hide\n       *\n       * @param {jQuery} $handle\n       */\n      Handle.prototype.hide = function () {\n          this.context.invoke('editor.clearTarget');\n          this.$handle.children().hide();\n      };\n      return Handle;\n  }());\n\n  var defaultScheme = 'http://';\n  var linkPattern = /^([A-Za-z][A-Za-z0-9+-.]*\\:[\\/]{2}|mailto:[A-Z0-9._%+-]+@)?(www\\.)?(.+)$/i;\n  var AutoLink = /** @class */ (function () {\n      function AutoLink(context) {\n          var _this = this;\n          this.context = context;\n          this.events = {\n              'summernote.keyup': function (we, e) {\n                  if (!e.isDefaultPrevented()) {\n                      _this.handleKeyup(e);\n                  }\n              },\n              'summernote.keydown': function (we, e) {\n                  _this.handleKeydown(e);\n              }\n          };\n      }\n      AutoLink.prototype.initialize = function () {\n          this.lastWordRange = null;\n      };\n      AutoLink.prototype.destroy = function () {\n          this.lastWordRange = null;\n      };\n      AutoLink.prototype.replace = function () {\n          if (!this.lastWordRange) {\n              return;\n          }\n          var keyword = this.lastWordRange.toString();\n          var match = keyword.match(linkPattern);\n          if (match && (match[1] || match[2])) {\n              var link = match[1] ? keyword : defaultScheme + keyword;\n              var node = $$1('<a />').html(keyword).attr('href', link)[0];\n              if (this.context.options.linkTargetBlank) {\n                  $$1(node).attr('target', '_blank');\n              }\n              this.lastWordRange.insertNode(node);\n              this.lastWordRange = null;\n              this.context.invoke('editor.focus');\n          }\n      };\n      AutoLink.prototype.handleKeydown = function (e) {\n          if (lists.contains([key.code.ENTER, key.code.SPACE], e.keyCode)) {\n              var wordRange = this.context.invoke('editor.createRange').getWordRange();\n              this.lastWordRange = wordRange;\n          }\n      };\n      AutoLink.prototype.handleKeyup = function (e) {\n          if (lists.contains([key.code.ENTER, key.code.SPACE], e.keyCode)) {\n              this.replace();\n          }\n      };\n      return AutoLink;\n  }());\n\n  /**\n   * textarea auto sync.\n   */\n  var AutoSync = /** @class */ (function () {\n      function AutoSync(context) {\n          var _this = this;\n          this.$note = context.layoutInfo.note;\n          this.events = {\n              'summernote.change': function () {\n                  _this.$note.val(context.invoke('code'));\n              }\n          };\n      }\n      AutoSync.prototype.shouldInitialize = function () {\n          return dom.isTextarea(this.$note[0]);\n      };\n      return AutoSync;\n  }());\n\n  var AutoReplace = /** @class */ (function () {\n      function AutoReplace(context) {\n          var _this = this;\n          this.context = context;\n          this.options = context.options.replace || {};\n          this.keys = [key.code.ENTER, key.code.SPACE, key.code.PERIOD, key.code.COMMA, key.code.SEMICOLON, key.code.SLASH];\n          this.previousKeydownCode = null;\n          this.events = {\n              'summernote.keyup': function (we, e) {\n                  if (!e.isDefaultPrevented()) {\n                      _this.handleKeyup(e);\n                  }\n              },\n              'summernote.keydown': function (we, e) {\n                  _this.handleKeydown(e);\n              }\n          };\n      }\n      AutoReplace.prototype.shouldInitialize = function () {\n          return !!this.options.match;\n      };\n      AutoReplace.prototype.initialize = function () {\n          this.lastWord = null;\n      };\n      AutoReplace.prototype.destroy = function () {\n          this.lastWord = null;\n      };\n      AutoReplace.prototype.replace = function () {\n          if (!this.lastWord) {\n              return;\n          }\n          var self = this;\n          var keyword = this.lastWord.toString();\n          this.options.match(keyword, function (match) {\n              if (match) {\n                  var node = '';\n                  if (typeof match === 'string') {\n                      node = dom.createText(match);\n                  }\n                  else if (match instanceof jQuery) {\n                      node = match[0];\n                  }\n                  else if (match instanceof Node) {\n                      node = match;\n                  }\n                  if (!node)\n                      return;\n                  self.lastWord.insertNode(node);\n                  self.lastWord = null;\n                  self.context.invoke('editor.focus');\n              }\n          });\n      };\n      AutoReplace.prototype.handleKeydown = function (e) {\n          // this forces it to remember the last whole word, even if multiple termination keys are pressed\n          // before the previous key is let go.\n          if (this.previousKeydownCode && lists.contains(this.keys, this.previousKeydownCode)) {\n              this.previousKeydownCode = e.keyCode;\n              return;\n          }\n          if (lists.contains(this.keys, e.keyCode)) {\n              var wordRange = this.context.invoke('editor.createRange').getWordRange();\n              this.lastWord = wordRange;\n          }\n          this.previousKeydownCode = e.keyCode;\n      };\n      AutoReplace.prototype.handleKeyup = function (e) {\n          if (lists.contains(this.keys, e.keyCode)) {\n              this.replace();\n          }\n      };\n      return AutoReplace;\n  }());\n\n  var Placeholder = /** @class */ (function () {\n      function Placeholder(context) {\n          var _this = this;\n          this.context = context;\n          this.$editingArea = context.layoutInfo.editingArea;\n          this.options = context.options;\n          this.events = {\n              'summernote.init summernote.change': function () {\n                  _this.update();\n              },\n              'summernote.codeview.toggled': function () {\n                  _this.update();\n              }\n          };\n      }\n      Placeholder.prototype.shouldInitialize = function () {\n          return !!this.options.placeholder;\n      };\n      Placeholder.prototype.initialize = function () {\n          var _this = this;\n          this.$placeholder = $$1('<div class=\"note-placeholder\">');\n          this.$placeholder.on('click', function () {\n              _this.context.invoke('focus');\n          }).html(this.options.placeholder).prependTo(this.$editingArea);\n          this.update();\n      };\n      Placeholder.prototype.destroy = function () {\n          this.$placeholder.remove();\n      };\n      Placeholder.prototype.update = function () {\n          var isShow = !this.context.invoke('codeview.isActivated') && this.context.invoke('editor.isEmpty');\n          this.$placeholder.toggle(isShow);\n      };\n      return Placeholder;\n  }());\n\n  var Buttons = /** @class */ (function () {\n      function Buttons(context) {\n          this.ui = $$1.summernote.ui;\n          this.context = context;\n          this.$toolbar = context.layoutInfo.toolbar;\n          this.options = context.options;\n          this.lang = this.options.langInfo;\n          this.invertedKeyMap = func.invertObject(this.options.keyMap[env.isMac ? 'mac' : 'pc']);\n      }\n      Buttons.prototype.representShortcut = function (editorMethod) {\n          var shortcut = this.invertedKeyMap[editorMethod];\n          if (!this.options.shortcuts || !shortcut) {\n              return '';\n          }\n          if (env.isMac) {\n              shortcut = shortcut.replace('CMD', '⌘').replace('SHIFT', '⇧');\n          }\n          shortcut = shortcut.replace('BACKSLASH', '\\\\')\n              .replace('SLASH', '/')\n              .replace('LEFTBRACKET', '[')\n              .replace('RIGHTBRACKET', ']');\n          return ' (' + shortcut + ')';\n      };\n      Buttons.prototype.button = function (o) {\n          if (!this.options.tooltip && o.tooltip) {\n              delete o.tooltip;\n          }\n          o.container = this.options.container;\n          return this.ui.button(o);\n      };\n      Buttons.prototype.initialize = function () {\n          this.addToolbarButtons();\n          this.addImagePopoverButtons();\n          this.addLinkPopoverButtons();\n          this.addTablePopoverButtons();\n          this.fontInstalledMap = {};\n      };\n      Buttons.prototype.destroy = function () {\n          delete this.fontInstalledMap;\n      };\n      Buttons.prototype.isFontInstalled = function (name) {\n          if (!this.fontInstalledMap.hasOwnProperty(name)) {\n              this.fontInstalledMap[name] = env.isFontInstalled(name) ||\n                  lists.contains(this.options.fontNamesIgnoreCheck, name);\n          }\n          return this.fontInstalledMap[name];\n      };\n      Buttons.prototype.isFontDeservedToAdd = function (name) {\n          var genericFamilies = ['sans-serif', 'serif', 'monospace', 'cursive', 'fantasy'];\n          name = name.toLowerCase();\n          return (name !== '' && this.isFontInstalled(name) && genericFamilies.indexOf(name) === -1);\n      };\n      Buttons.prototype.colorPalette = function (className, tooltip, backColor, foreColor) {\n          var _this = this;\n          return this.ui.buttonGroup({\n              className: 'note-color ' + className,\n              children: [\n                  this.button({\n                      className: 'note-current-color-button',\n                      contents: this.ui.icon(this.options.icons.font + ' note-recent-color'),\n                      tooltip: tooltip,\n                      click: function (e) {\n                          var $button = $$1(e.currentTarget);\n                          if (backColor && foreColor) {\n                              _this.context.invoke('editor.color', {\n                                  backColor: $button.attr('data-backColor'),\n                                  foreColor: $button.attr('data-foreColor')\n                              });\n                          }\n                          else if (backColor) {\n                              _this.context.invoke('editor.color', {\n                                  backColor: $button.attr('data-backColor')\n                              });\n                          }\n                          else if (foreColor) {\n                              _this.context.invoke('editor.color', {\n                                  foreColor: $button.attr('data-foreColor')\n                              });\n                          }\n                      },\n                      callback: function ($button) {\n                          var $recentColor = $button.find('.note-recent-color');\n                          if (backColor) {\n                              $recentColor.css('background-color', _this.options.colorButton.backColor);\n                              $button.attr('data-backColor', _this.options.colorButton.backColor);\n                          }\n                          if (foreColor) {\n                              $recentColor.css('color', _this.options.colorButton.foreColor);\n                              $button.attr('data-foreColor', _this.options.colorButton.foreColor);\n                          }\n                          else {\n                              $recentColor.css('color', 'transparent');\n                          }\n                      }\n                  }),\n                  this.button({\n                      className: 'dropdown-toggle',\n                      contents: this.ui.dropdownButtonContents('', this.options),\n                      tooltip: this.lang.color.more,\n                      data: {\n                          toggle: 'dropdown'\n                      }\n                  }),\n                  this.ui.dropdown({\n                      items: (backColor ? [\n                          '<div class=\"note-palette\">',\n                          '  <div class=\"note-palette-title\">' + this.lang.color.background + '</div>',\n                          '  <div>',\n                          '    <button type=\"button\" class=\"note-color-reset btn btn-light\" data-event=\"backColor\" data-value=\"inherit\">',\n                          this.lang.color.transparent,\n                          '    </button>',\n                          '  </div>',\n                          '  <div class=\"note-holder\" data-event=\"backColor\"/>',\n                          '  <div>',\n                          '    <button type=\"button\" class=\"note-color-select btn\" data-event=\"openPalette\" data-value=\"backColorPicker\">',\n                          this.lang.color.cpSelect,\n                          '    </button>',\n                          '    <input type=\"color\" id=\"backColorPicker\" class=\"note-btn note-color-select-btn\" value=\"' + this.options.colorButton.backColor + '\" data-event=\"backColorPalette\">',\n                          '  </div>',\n                          '  <div class=\"note-holder-custom\" id=\"backColorPalette\" data-event=\"backColor\"/>',\n                          '</div>',\n                      ].join('') : '') +\n                          (foreColor ? [\n                              '<div class=\"note-palette\">',\n                              '  <div class=\"note-palette-title\">' + this.lang.color.foreground + '</div>',\n                              '  <div>',\n                              '    <button type=\"button\" class=\"note-color-reset btn btn-light\" data-event=\"removeFormat\" data-value=\"foreColor\">',\n                              this.lang.color.resetToDefault,\n                              '    </button>',\n                              '  </div>',\n                              '  <div class=\"note-holder\" data-event=\"foreColor\"/>',\n                              '  <div>',\n                              '    <button type=\"button\" class=\"note-color-select btn\" data-event=\"openPalette\" data-value=\"foreColorPicker\">',\n                              this.lang.color.cpSelect,\n                              '    </button>',\n                              '    <input type=\"color\" id=\"foreColorPicker\" class=\"note-btn note-color-select-btn\" value=\"' + this.options.colorButton.foreColor + '\" data-event=\"foreColorPalette\">',\n                              '  <div class=\"note-holder-custom\" id=\"foreColorPalette\" data-event=\"foreColor\"/>',\n                              '</div>',\n                          ].join('') : ''),\n                      callback: function ($dropdown) {\n                          $dropdown.find('.note-holder').each(function (idx, item) {\n                              var $holder = $$1(item);\n                              $holder.append(_this.ui.palette({\n                                  colors: _this.options.colors,\n                                  colorsName: _this.options.colorsName,\n                                  eventName: $holder.data('event'),\n                                  container: _this.options.container,\n                                  tooltip: _this.options.tooltip\n                              }).render());\n                          });\n                          /* TODO: do we have to record recent custom colors within cookies? */\n                          var customColors = [\n                              ['#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF'],\n                          ];\n                          $dropdown.find('.note-holder-custom').each(function (idx, item) {\n                              var $holder = $$1(item);\n                              $holder.append(_this.ui.palette({\n                                  colors: customColors,\n                                  colorsName: customColors,\n                                  eventName: $holder.data('event'),\n                                  container: _this.options.container,\n                                  tooltip: _this.options.tooltip\n                              }).render());\n                          });\n                          $dropdown.find('input[type=color]').each(function (idx, item) {\n                              $$1(item).change(function () {\n                                  var $chip = $dropdown.find('#' + $$1(this).data('event')).find('.note-color-btn').first();\n                                  var color = this.value.toUpperCase();\n                                  $chip.css('background-color', color)\n                                      .attr('aria-label', color)\n                                      .attr('data-value', color)\n                                      .attr('data-original-title', color);\n                                  $chip.click();\n                              });\n                          });\n                      },\n                      click: function (event) {\n                          event.stopPropagation();\n                          var $parent = $$1('.' + className);\n                          var $button = $$1(event.target);\n                          var eventName = $button.data('event');\n                          var value = $button.attr('data-value');\n                          if (eventName === 'openPalette') {\n                              var $picker = $parent.find('#' + value);\n                              var $palette = $$1($parent.find('#' + $picker.data('event')).find('.note-color-row')[0]);\n                              // Shift palette chips\n                              var $chip = $palette.find('.note-color-btn').last().detach();\n                              // Set chip attributes\n                              var color = $picker.val();\n                              $chip.css('background-color', color)\n                                  .attr('aria-label', color)\n                                  .attr('data-value', color)\n                                  .attr('data-original-title', color);\n                              $palette.prepend($chip);\n                              $picker.click();\n                          }\n                          else if (lists.contains(['backColor', 'foreColor'], eventName)) {\n                              var key = eventName === 'backColor' ? 'background-color' : 'color';\n                              var $color = $button.closest('.note-color').find('.note-recent-color');\n                              var $currentButton = $button.closest('.note-color').find('.note-current-color-button');\n                              $color.css(key, value);\n                              $currentButton.attr('data-' + eventName, value);\n                              _this.context.invoke('editor.' + eventName, value);\n                          }\n                      }\n                  }),\n              ]\n          }).render();\n      };\n      Buttons.prototype.addToolbarButtons = function () {\n          var _this = this;\n          this.context.memo('button.style', function () {\n              return _this.ui.buttonGroup([\n                  _this.button({\n                      className: 'dropdown-toggle',\n                      contents: _this.ui.dropdownButtonContents(_this.ui.icon(_this.options.icons.magic), _this.options),\n                      tooltip: _this.lang.style.style,\n                      data: {\n                          toggle: 'dropdown'\n                      }\n                  }),\n                  _this.ui.dropdown({\n                      className: 'dropdown-style',\n                      items: _this.options.styleTags,\n                      title: _this.lang.style.style,\n                      template: function (item) {\n                          if (typeof item === 'string') {\n                              item = { tag: item, title: (_this.lang.style.hasOwnProperty(item) ? _this.lang.style[item] : item) };\n                          }\n                          var tag = item.tag;\n                          var title = item.title;\n                          var style = item.style ? ' style=\"' + item.style + '\" ' : '';\n                          var className = item.className ? ' class=\"' + item.className + '\"' : '';\n                          return '<' + tag + style + className + '>' + title + '</' + tag + '>';\n                      },\n                      click: _this.context.createInvokeHandler('editor.formatBlock')\n                  }),\n              ]).render();\n          });\n          var _loop_1 = function (styleIdx, styleLen) {\n              var item = this_1.options.styleTags[styleIdx];\n              this_1.context.memo('button.style.' + item, function () {\n                  return _this.button({\n                      className: 'note-btn-style-' + item,\n                      contents: '<div data-value=\"' + item + '\">' + item.toUpperCase() + '</div>',\n                      tooltip: _this.lang.style[item],\n                      click: _this.context.createInvokeHandler('editor.formatBlock')\n                  }).render();\n              });\n          };\n          var this_1 = this;\n          for (var styleIdx = 0, styleLen = this.options.styleTags.length; styleIdx < styleLen; styleIdx++) {\n              _loop_1(styleIdx, styleLen);\n          }\n          this.context.memo('button.bold', function () {\n              return _this.button({\n                  className: 'note-btn-bold',\n                  contents: _this.ui.icon(_this.options.icons.bold),\n                  tooltip: _this.lang.font.bold + _this.representShortcut('bold'),\n                  click: _this.context.createInvokeHandlerAndUpdateState('editor.bold')\n              }).render();\n          });\n          this.context.memo('button.italic', function () {\n              return _this.button({\n                  className: 'note-btn-italic',\n                  contents: _this.ui.icon(_this.options.icons.italic),\n                  tooltip: _this.lang.font.italic + _this.representShortcut('italic'),\n                  click: _this.context.createInvokeHandlerAndUpdateState('editor.italic')\n              }).render();\n          });\n          this.context.memo('button.underline', function () {\n              return _this.button({\n                  className: 'note-btn-underline',\n                  contents: _this.ui.icon(_this.options.icons.underline),\n                  tooltip: _this.lang.font.underline + _this.representShortcut('underline'),\n                  click: _this.context.createInvokeHandlerAndUpdateState('editor.underline')\n              }).render();\n          });\n          this.context.memo('button.clear', function () {\n              return _this.button({\n                  contents: _this.ui.icon(_this.options.icons.eraser),\n                  tooltip: _this.lang.font.clear + _this.representShortcut('removeFormat'),\n                  click: _this.context.createInvokeHandler('editor.removeFormat')\n              }).render();\n          });\n          this.context.memo('button.strikethrough', function () {\n              return _this.button({\n                  className: 'note-btn-strikethrough',\n                  contents: _this.ui.icon(_this.options.icons.strikethrough),\n                  tooltip: _this.lang.font.strikethrough + _this.representShortcut('strikethrough'),\n                  click: _this.context.createInvokeHandlerAndUpdateState('editor.strikethrough')\n              }).render();\n          });\n          this.context.memo('button.superscript', function () {\n              return _this.button({\n                  className: 'note-btn-superscript',\n                  contents: _this.ui.icon(_this.options.icons.superscript),\n                  tooltip: _this.lang.font.superscript,\n                  click: _this.context.createInvokeHandlerAndUpdateState('editor.superscript')\n              }).render();\n          });\n          this.context.memo('button.subscript', function () {\n              return _this.button({\n                  className: 'note-btn-subscript',\n                  contents: _this.ui.icon(_this.options.icons.subscript),\n                  tooltip: _this.lang.font.subscript,\n                  click: _this.context.createInvokeHandlerAndUpdateState('editor.subscript')\n              }).render();\n          });\n          this.context.memo('button.fontname', function () {\n              var styleInfo = _this.context.invoke('editor.currentStyle');\n              // Add 'default' fonts into the fontnames array if not exist\n              $$1.each(styleInfo['font-family'].split(','), function (idx, fontname) {\n                  fontname = fontname.trim().replace(/['\"]+/g, '');\n                  if (_this.isFontDeservedToAdd(fontname)) {\n                      if (_this.options.fontNames.indexOf(fontname) === -1) {\n                          _this.options.fontNames.push(fontname);\n                      }\n                  }\n              });\n              return _this.ui.buttonGroup([\n                  _this.button({\n                      className: 'dropdown-toggle',\n                      contents: _this.ui.dropdownButtonContents('<span class=\"note-current-fontname\"/>', _this.options),\n                      tooltip: _this.lang.font.name,\n                      data: {\n                          toggle: 'dropdown'\n                      }\n                  }),\n                  _this.ui.dropdownCheck({\n                      className: 'dropdown-fontname',\n                      checkClassName: _this.options.icons.menuCheck,\n                      items: _this.options.fontNames.filter(_this.isFontInstalled.bind(_this)),\n                      title: _this.lang.font.name,\n                      template: function (item) {\n                          return '<span style=\"font-family: \\'' + item + '\\'\">' + item + '</span>';\n                      },\n                      click: _this.context.createInvokeHandlerAndUpdateState('editor.fontName')\n                  }),\n              ]).render();\n          });\n          this.context.memo('button.fontsize', function () {\n              return _this.ui.buttonGroup([\n                  _this.button({\n                      className: 'dropdown-toggle',\n                      contents: _this.ui.dropdownButtonContents('<span class=\"note-current-fontsize\"/>', _this.options),\n                      tooltip: _this.lang.font.size,\n                      data: {\n                          toggle: 'dropdown'\n                      }\n                  }),\n                  _this.ui.dropdownCheck({\n                      className: 'dropdown-fontsize',\n                      checkClassName: _this.options.icons.menuCheck,\n                      items: _this.options.fontSizes,\n                      title: _this.lang.font.size,\n                      click: _this.context.createInvokeHandlerAndUpdateState('editor.fontSize')\n                  }),\n              ]).render();\n          });\n          this.context.memo('button.color', function () {\n              return _this.colorPalette('note-color-all', _this.lang.color.recent, true, true);\n          });\n          this.context.memo('button.forecolor', function () {\n              return _this.colorPalette('note-color-fore', _this.lang.color.foreground, false, true);\n          });\n          this.context.memo('button.backcolor', function () {\n              return _this.colorPalette('note-color-back', _this.lang.color.background, true, false);\n          });\n          this.context.memo('button.ul', function () {\n              return _this.button({\n                  contents: _this.ui.icon(_this.options.icons.unorderedlist),\n                  tooltip: _this.lang.lists.unordered + _this.representShortcut('insertUnorderedList'),\n                  click: _this.context.createInvokeHandler('editor.insertUnorderedList')\n              }).render();\n          });\n          this.context.memo('button.ol', function () {\n              return _this.button({\n                  contents: _this.ui.icon(_this.options.icons.orderedlist),\n                  tooltip: _this.lang.lists.ordered + _this.representShortcut('insertOrderedList'),\n                  click: _this.context.createInvokeHandler('editor.insertOrderedList')\n              }).render();\n          });\n          var justifyLeft = this.button({\n              contents: this.ui.icon(this.options.icons.alignLeft),\n              tooltip: this.lang.paragraph.left + this.representShortcut('justifyLeft'),\n              click: this.context.createInvokeHandler('editor.justifyLeft')\n          });\n          var justifyCenter = this.button({\n              contents: this.ui.icon(this.options.icons.alignCenter),\n              tooltip: this.lang.paragraph.center + this.representShortcut('justifyCenter'),\n              click: this.context.createInvokeHandler('editor.justifyCenter')\n          });\n          var justifyRight = this.button({\n              contents: this.ui.icon(this.options.icons.alignRight),\n              tooltip: this.lang.paragraph.right + this.representShortcut('justifyRight'),\n              click: this.context.createInvokeHandler('editor.justifyRight')\n          });\n          var justifyFull = this.button({\n              contents: this.ui.icon(this.options.icons.alignJustify),\n              tooltip: this.lang.paragraph.justify + this.representShortcut('justifyFull'),\n              click: this.context.createInvokeHandler('editor.justifyFull')\n          });\n          var outdent = this.button({\n              contents: this.ui.icon(this.options.icons.outdent),\n              tooltip: this.lang.paragraph.outdent + this.representShortcut('outdent'),\n              click: this.context.createInvokeHandler('editor.outdent')\n          });\n          var indent = this.button({\n              contents: this.ui.icon(this.options.icons.indent),\n              tooltip: this.lang.paragraph.indent + this.representShortcut('indent'),\n              click: this.context.createInvokeHandler('editor.indent')\n          });\n          this.context.memo('button.justifyLeft', func.invoke(justifyLeft, 'render'));\n          this.context.memo('button.justifyCenter', func.invoke(justifyCenter, 'render'));\n          this.context.memo('button.justifyRight', func.invoke(justifyRight, 'render'));\n          this.context.memo('button.justifyFull', func.invoke(justifyFull, 'render'));\n          this.context.memo('button.outdent', func.invoke(outdent, 'render'));\n          this.context.memo('button.indent', func.invoke(indent, 'render'));\n          this.context.memo('button.paragraph', function () {\n              return _this.ui.buttonGroup([\n                  _this.button({\n                      className: 'dropdown-toggle',\n                      contents: _this.ui.dropdownButtonContents(_this.ui.icon(_this.options.icons.alignLeft), _this.options),\n                      tooltip: _this.lang.paragraph.paragraph,\n                      data: {\n                          toggle: 'dropdown'\n                      }\n                  }),\n                  _this.ui.dropdown([\n                      _this.ui.buttonGroup({\n                          className: 'note-align',\n                          children: [justifyLeft, justifyCenter, justifyRight, justifyFull]\n                      }),\n                      _this.ui.buttonGroup({\n                          className: 'note-list',\n                          children: [outdent, indent]\n                      }),\n                  ]),\n              ]).render();\n          });\n          this.context.memo('button.height', function () {\n              return _this.ui.buttonGroup([\n                  _this.button({\n                      className: 'dropdown-toggle',\n                      contents: _this.ui.dropdownButtonContents(_this.ui.icon(_this.options.icons.textHeight), _this.options),\n                      tooltip: _this.lang.font.height,\n                      data: {\n                          toggle: 'dropdown'\n                      }\n                  }),\n                  _this.ui.dropdownCheck({\n                      items: _this.options.lineHeights,\n                      checkClassName: _this.options.icons.menuCheck,\n                      className: 'dropdown-line-height',\n                      title: _this.lang.font.height,\n                      click: _this.context.createInvokeHandler('editor.lineHeight')\n                  }),\n              ]).render();\n          });\n          this.context.memo('button.table', function () {\n              return _this.ui.buttonGroup([\n                  _this.button({\n                      className: 'dropdown-toggle',\n                      contents: _this.ui.dropdownButtonContents(_this.ui.icon(_this.options.icons.table), _this.options),\n                      tooltip: _this.lang.table.table,\n                      data: {\n                          toggle: 'dropdown'\n                      }\n                  }),\n                  _this.ui.dropdown({\n                      title: _this.lang.table.table,\n                      className: 'note-table',\n                      items: [\n                          '<div class=\"note-dimension-picker\">',\n                          '  <div class=\"note-dimension-picker-mousecatcher\" data-event=\"insertTable\" data-value=\"1x1\"/>',\n                          '  <div class=\"note-dimension-picker-highlighted\"/>',\n                          '  <div class=\"note-dimension-picker-unhighlighted\"/>',\n                          '</div>',\n                          '<div class=\"note-dimension-display\">1 x 1</div>',\n                      ].join('')\n                  }),\n              ], {\n                  callback: function ($node) {\n                      var $catcher = $node.find('.note-dimension-picker-mousecatcher');\n                      $catcher.css({\n                          width: _this.options.insertTableMaxSize.col + 'em',\n                          height: _this.options.insertTableMaxSize.row + 'em'\n                      }).mousedown(_this.context.createInvokeHandler('editor.insertTable'))\n                          .on('mousemove', _this.tableMoveHandler.bind(_this));\n                  }\n              }).render();\n          });\n          this.context.memo('button.link', function () {\n              return _this.button({\n                  contents: _this.ui.icon(_this.options.icons.link),\n                  tooltip: _this.lang.link.link + _this.representShortcut('linkDialog.show'),\n                  click: _this.context.createInvokeHandler('linkDialog.show')\n              }).render();\n          });\n          this.context.memo('button.picture', function () {\n              return _this.button({\n                  contents: _this.ui.icon(_this.options.icons.picture),\n                  tooltip: _this.lang.image.image,\n                  click: _this.context.createInvokeHandler('imageDialog.show')\n              }).render();\n          });\n          this.context.memo('button.video', function () {\n              return _this.button({\n                  contents: _this.ui.icon(_this.options.icons.video),\n                  tooltip: _this.lang.video.video,\n                  click: _this.context.createInvokeHandler('videoDialog.show')\n              }).render();\n          });\n          this.context.memo('button.hr', function () {\n              return _this.button({\n                  contents: _this.ui.icon(_this.options.icons.minus),\n                  tooltip: _this.lang.hr.insert + _this.representShortcut('insertHorizontalRule'),\n                  click: _this.context.createInvokeHandler('editor.insertHorizontalRule')\n              }).render();\n          });\n          this.context.memo('button.fullscreen', function () {\n              return _this.button({\n                  className: 'btn-fullscreen',\n                  contents: _this.ui.icon(_this.options.icons.arrowsAlt),\n                  tooltip: _this.lang.options.fullscreen,\n                  click: _this.context.createInvokeHandler('fullscreen.toggle')\n              }).render();\n          });\n          this.context.memo('button.codeview', function () {\n              return _this.button({\n                  className: 'btn-codeview',\n                  contents: _this.ui.icon(_this.options.icons.code),\n                  tooltip: _this.lang.options.codeview,\n                  click: _this.context.createInvokeHandler('codeview.toggle')\n              }).render();\n          });\n          this.context.memo('button.redo', function () {\n              return _this.button({\n                  contents: _this.ui.icon(_this.options.icons.redo),\n                  tooltip: _this.lang.history.redo + _this.representShortcut('redo'),\n                  click: _this.context.createInvokeHandler('editor.redo')\n              }).render();\n          });\n          this.context.memo('button.undo', function () {\n              return _this.button({\n                  contents: _this.ui.icon(_this.options.icons.undo),\n                  tooltip: _this.lang.history.undo + _this.representShortcut('undo'),\n                  click: _this.context.createInvokeHandler('editor.undo')\n              }).render();\n          });\n          this.context.memo('button.help', function () {\n              return _this.button({\n                  contents: _this.ui.icon(_this.options.icons.question),\n                  tooltip: _this.lang.options.help,\n                  click: _this.context.createInvokeHandler('helpDialog.show')\n              }).render();\n          });\n      };\n      /**\n       * image: [\n       *   ['imageResize', ['resizeFull', 'resizeHalf', 'resizeQuarter', 'resizeNone']],\n       *   ['float', ['floatLeft', 'floatRight', 'floatNone']],\n       *   ['remove', ['removeMedia']],\n       * ],\n       */\n      Buttons.prototype.addImagePopoverButtons = function () {\n          var _this = this;\n          // Image Size Buttons\n          this.context.memo('button.resizeFull', function () {\n              return _this.button({\n                  contents: '<span class=\"note-fontsize-10\">100%</span>',\n                  tooltip: _this.lang.image.resizeFull,\n                  click: _this.context.createInvokeHandler('editor.resize', '1')\n              }).render();\n          });\n          this.context.memo('button.resizeHalf', function () {\n              return _this.button({\n                  contents: '<span class=\"note-fontsize-10\">50%</span>',\n                  tooltip: _this.lang.image.resizeHalf,\n                  click: _this.context.createInvokeHandler('editor.resize', '0.5')\n              }).render();\n          });\n          this.context.memo('button.resizeQuarter', function () {\n              return _this.button({\n                  contents: '<span class=\"note-fontsize-10\">25%</span>',\n                  tooltip: _this.lang.image.resizeQuarter,\n                  click: _this.context.createInvokeHandler('editor.resize', '0.25')\n              }).render();\n          });\n          this.context.memo('button.resizeNone', function () {\n              return _this.button({\n                  contents: _this.ui.icon(_this.options.icons.rollback),\n                  tooltip: _this.lang.image.resizeNone,\n                  click: _this.context.createInvokeHandler('editor.resize', '0')\n              }).render();\n          });\n          // Float Buttons\n          this.context.memo('button.floatLeft', function () {\n              return _this.button({\n                  contents: _this.ui.icon(_this.options.icons.floatLeft),\n                  tooltip: _this.lang.image.floatLeft,\n                  click: _this.context.createInvokeHandler('editor.floatMe', 'left')\n              }).render();\n          });\n          this.context.memo('button.floatRight', function () {\n              return _this.button({\n                  contents: _this.ui.icon(_this.options.icons.floatRight),\n                  tooltip: _this.lang.image.floatRight,\n                  click: _this.context.createInvokeHandler('editor.floatMe', 'right')\n              }).render();\n          });\n          this.context.memo('button.floatNone', function () {\n              return _this.button({\n                  contents: _this.ui.icon(_this.options.icons.rollback),\n                  tooltip: _this.lang.image.floatNone,\n                  click: _this.context.createInvokeHandler('editor.floatMe', 'none')\n              }).render();\n          });\n          // Remove Buttons\n          this.context.memo('button.removeMedia', function () {\n              return _this.button({\n                  contents: _this.ui.icon(_this.options.icons.trash),\n                  tooltip: _this.lang.image.remove,\n                  click: _this.context.createInvokeHandler('editor.removeMedia')\n              }).render();\n          });\n      };\n      Buttons.prototype.addLinkPopoverButtons = function () {\n          var _this = this;\n          this.context.memo('button.linkDialogShow', function () {\n              return _this.button({\n                  contents: _this.ui.icon(_this.options.icons.link),\n                  tooltip: _this.lang.link.edit,\n                  click: _this.context.createInvokeHandler('linkDialog.show')\n              }).render();\n          });\n          this.context.memo('button.unlink', function () {\n              return _this.button({\n                  contents: _this.ui.icon(_this.options.icons.unlink),\n                  tooltip: _this.lang.link.unlink,\n                  click: _this.context.createInvokeHandler('editor.unlink')\n              }).render();\n          });\n      };\n      /**\n       * table : [\n       *  ['add', ['addRowDown', 'addRowUp', 'addColLeft', 'addColRight']],\n       *  ['delete', ['deleteRow', 'deleteCol', 'deleteTable']]\n       * ],\n       */\n      Buttons.prototype.addTablePopoverButtons = function () {\n          var _this = this;\n          this.context.memo('button.addRowUp', function () {\n              return _this.button({\n                  className: 'btn-md',\n                  contents: _this.ui.icon(_this.options.icons.rowAbove),\n                  tooltip: _this.lang.table.addRowAbove,\n                  click: _this.context.createInvokeHandler('editor.addRow', 'top')\n              }).render();\n          });\n          this.context.memo('button.addRowDown', function () {\n              return _this.button({\n                  className: 'btn-md',\n                  contents: _this.ui.icon(_this.options.icons.rowBelow),\n                  tooltip: _this.lang.table.addRowBelow,\n                  click: _this.context.createInvokeHandler('editor.addRow', 'bottom')\n              }).render();\n          });\n          this.context.memo('button.addColLeft', function () {\n              return _this.button({\n                  className: 'btn-md',\n                  contents: _this.ui.icon(_this.options.icons.colBefore),\n                  tooltip: _this.lang.table.addColLeft,\n                  click: _this.context.createInvokeHandler('editor.addCol', 'left')\n              }).render();\n          });\n          this.context.memo('button.addColRight', function () {\n              return _this.button({\n                  className: 'btn-md',\n                  contents: _this.ui.icon(_this.options.icons.colAfter),\n                  tooltip: _this.lang.table.addColRight,\n                  click: _this.context.createInvokeHandler('editor.addCol', 'right')\n              }).render();\n          });\n          this.context.memo('button.deleteRow', function () {\n              return _this.button({\n                  className: 'btn-md',\n                  contents: _this.ui.icon(_this.options.icons.rowRemove),\n                  tooltip: _this.lang.table.delRow,\n                  click: _this.context.createInvokeHandler('editor.deleteRow')\n              }).render();\n          });\n          this.context.memo('button.deleteCol', function () {\n              return _this.button({\n                  className: 'btn-md',\n                  contents: _this.ui.icon(_this.options.icons.colRemove),\n                  tooltip: _this.lang.table.delCol,\n                  click: _this.context.createInvokeHandler('editor.deleteCol')\n              }).render();\n          });\n          this.context.memo('button.deleteTable', function () {\n              return _this.button({\n                  className: 'btn-md',\n                  contents: _this.ui.icon(_this.options.icons.trash),\n                  tooltip: _this.lang.table.delTable,\n                  click: _this.context.createInvokeHandler('editor.deleteTable')\n              }).render();\n          });\n      };\n      Buttons.prototype.build = function ($container, groups) {\n          for (var groupIdx = 0, groupLen = groups.length; groupIdx < groupLen; groupIdx++) {\n              var group = groups[groupIdx];\n              var groupName = Array.isArray(group) ? group[0] : group;\n              var buttons = Array.isArray(group) ? ((group.length === 1) ? [group[0]] : group[1]) : [group];\n              var $group = this.ui.buttonGroup({\n                  className: 'note-' + groupName\n              }).render();\n              for (var idx = 0, len = buttons.length; idx < len; idx++) {\n                  var btn = this.context.memo('button.' + buttons[idx]);\n                  if (btn) {\n                      $group.append(typeof btn === 'function' ? btn() : btn);\n                  }\n              }\n              $group.appendTo($container);\n          }\n      };\n      /**\n       * @param {jQuery} [$container]\n       */\n      Buttons.prototype.updateCurrentStyle = function ($container) {\n          var _this = this;\n          var $cont = $container || this.$toolbar;\n          var styleInfo = this.context.invoke('editor.currentStyle');\n          this.updateBtnStates($cont, {\n              '.note-btn-bold': function () {\n                  return styleInfo['font-bold'] === 'bold';\n              },\n              '.note-btn-italic': function () {\n                  return styleInfo['font-italic'] === 'italic';\n              },\n              '.note-btn-underline': function () {\n                  return styleInfo['font-underline'] === 'underline';\n              },\n              '.note-btn-subscript': function () {\n                  return styleInfo['font-subscript'] === 'subscript';\n              },\n              '.note-btn-superscript': function () {\n                  return styleInfo['font-superscript'] === 'superscript';\n              },\n              '.note-btn-strikethrough': function () {\n                  return styleInfo['font-strikethrough'] === 'strikethrough';\n              }\n          });\n          if (styleInfo['font-family']) {\n              var fontNames = styleInfo['font-family'].split(',').map(function (name) {\n                  return name.replace(/[\\'\\\"]/g, '')\n                      .replace(/\\s+$/, '')\n                      .replace(/^\\s+/, '');\n              });\n              var fontName_1 = lists.find(fontNames, this.isFontInstalled.bind(this));\n              $cont.find('.dropdown-fontname a').each(function (idx, item) {\n                  var $item = $$1(item);\n                  // always compare string to avoid creating another func.\n                  var isChecked = ($item.data('value') + '') === (fontName_1 + '');\n                  $item.toggleClass('checked', isChecked);\n              });\n              $cont.find('.note-current-fontname').text(fontName_1).css('font-family', fontName_1);\n          }\n          if (styleInfo['font-size']) {\n              var fontSize_1 = styleInfo['font-size'];\n              $cont.find('.dropdown-fontsize a').each(function (idx, item) {\n                  var $item = $$1(item);\n                  // always compare with string to avoid creating another func.\n                  var isChecked = ($item.data('value') + '') === (fontSize_1 + '');\n                  $item.toggleClass('checked', isChecked);\n              });\n              $cont.find('.note-current-fontsize').text(fontSize_1);\n          }\n          if (styleInfo['line-height']) {\n              var lineHeight_1 = styleInfo['line-height'];\n              $cont.find('.dropdown-line-height li a').each(function (idx, item) {\n                  // always compare with string to avoid creating another func.\n                  var isChecked = ($$1(item).data('value') + '') === (lineHeight_1 + '');\n                  _this.className = isChecked ? 'checked' : '';\n              });\n          }\n      };\n      Buttons.prototype.updateBtnStates = function ($container, infos) {\n          var _this = this;\n          $$1.each(infos, function (selector, pred) {\n              _this.ui.toggleBtnActive($container.find(selector), pred());\n          });\n      };\n      Buttons.prototype.tableMoveHandler = function (event) {\n          var PX_PER_EM = 18;\n          var $picker = $$1(event.target.parentNode); // target is mousecatcher\n          var $dimensionDisplay = $picker.next();\n          var $catcher = $picker.find('.note-dimension-picker-mousecatcher');\n          var $highlighted = $picker.find('.note-dimension-picker-highlighted');\n          var $unhighlighted = $picker.find('.note-dimension-picker-unhighlighted');\n          var posOffset;\n          // HTML5 with jQuery - e.offsetX is undefined in Firefox\n          if (event.offsetX === undefined) {\n              var posCatcher = $$1(event.target).offset();\n              posOffset = {\n                  x: event.pageX - posCatcher.left,\n                  y: event.pageY - posCatcher.top\n              };\n          }\n          else {\n              posOffset = {\n                  x: event.offsetX,\n                  y: event.offsetY\n              };\n          }\n          var dim = {\n              c: Math.ceil(posOffset.x / PX_PER_EM) || 1,\n              r: Math.ceil(posOffset.y / PX_PER_EM) || 1\n          };\n          $highlighted.css({ width: dim.c + 'em', height: dim.r + 'em' });\n          $catcher.data('value', dim.c + 'x' + dim.r);\n          if (dim.c > 3 && dim.c < this.options.insertTableMaxSize.col) {\n              $unhighlighted.css({ width: dim.c + 1 + 'em' });\n          }\n          if (dim.r > 3 && dim.r < this.options.insertTableMaxSize.row) {\n              $unhighlighted.css({ height: dim.r + 1 + 'em' });\n          }\n          $dimensionDisplay.html(dim.c + ' x ' + dim.r);\n      };\n      return Buttons;\n  }());\n\n  var Toolbar = /** @class */ (function () {\n      function Toolbar(context) {\n          this.context = context;\n          this.$window = $$1(window);\n          this.$document = $$1(document);\n          this.ui = $$1.summernote.ui;\n          this.$note = context.layoutInfo.note;\n          this.$editor = context.layoutInfo.editor;\n          this.$toolbar = context.layoutInfo.toolbar;\n          this.$editable = context.layoutInfo.editable;\n          this.$statusbar = context.layoutInfo.statusbar;\n          this.options = context.options;\n          this.isFollowing = false;\n          this.followScroll = this.followScroll.bind(this);\n      }\n      Toolbar.prototype.shouldInitialize = function () {\n          return !this.options.airMode;\n      };\n      Toolbar.prototype.initialize = function () {\n          var _this = this;\n          this.options.toolbar = this.options.toolbar || [];\n          if (!this.options.toolbar.length) {\n              this.$toolbar.hide();\n          }\n          else {\n              this.context.invoke('buttons.build', this.$toolbar, this.options.toolbar);\n          }\n          if (this.options.toolbarContainer) {\n              this.$toolbar.appendTo(this.options.toolbarContainer);\n          }\n          this.changeContainer(false);\n          this.$note.on('summernote.keyup summernote.mouseup summernote.change', function () {\n              _this.context.invoke('buttons.updateCurrentStyle');\n          });\n          this.context.invoke('buttons.updateCurrentStyle');\n          if (this.options.followingToolbar) {\n              this.$window.on('scroll resize', this.followScroll);\n          }\n      };\n      Toolbar.prototype.destroy = function () {\n          this.$toolbar.children().remove();\n          if (this.options.followingToolbar) {\n              this.$window.off('scroll resize', this.followScroll);\n          }\n      };\n      Toolbar.prototype.followScroll = function () {\n          if (this.$editor.hasClass('fullscreen')) {\n              return false;\n          }\n          var editorHeight = this.$editor.outerHeight();\n          var editorWidth = this.$editor.width();\n          var toolbarHeight = this.$toolbar.height();\n          var statusbarHeight = this.$statusbar.height();\n          // check if the web app is currently using another static bar\n          var otherBarHeight = 0;\n          if (this.options.otherStaticBar) {\n              otherBarHeight = $$1(this.options.otherStaticBar).outerHeight();\n          }\n          var currentOffset = this.$document.scrollTop();\n          var editorOffsetTop = this.$editor.offset().top;\n          var editorOffsetBottom = editorOffsetTop + editorHeight;\n          var activateOffset = editorOffsetTop - otherBarHeight;\n          var deactivateOffsetBottom = editorOffsetBottom - otherBarHeight - toolbarHeight - statusbarHeight;\n          if (!this.isFollowing &&\n              (currentOffset > activateOffset) && (currentOffset < deactivateOffsetBottom - toolbarHeight)) {\n              this.isFollowing = true;\n              this.$toolbar.css({\n                  position: 'fixed',\n                  top: otherBarHeight,\n                  width: editorWidth\n              });\n              this.$editable.css({\n                  marginTop: this.$toolbar.height() + 5\n              });\n          }\n          else if (this.isFollowing &&\n              ((currentOffset < activateOffset) || (currentOffset > deactivateOffsetBottom))) {\n              this.isFollowing = false;\n              this.$toolbar.css({\n                  position: 'relative',\n                  top: 0,\n                  width: '100%'\n              });\n              this.$editable.css({\n                  marginTop: ''\n              });\n          }\n      };\n      Toolbar.prototype.changeContainer = function (isFullscreen) {\n          if (isFullscreen) {\n              this.$toolbar.prependTo(this.$editor);\n          }\n          else {\n              if (this.options.toolbarContainer) {\n                  this.$toolbar.appendTo(this.options.toolbarContainer);\n              }\n          }\n          this.followScroll();\n      };\n      Toolbar.prototype.updateFullscreen = function (isFullscreen) {\n          this.ui.toggleBtnActive(this.$toolbar.find('.btn-fullscreen'), isFullscreen);\n          this.changeContainer(isFullscreen);\n      };\n      Toolbar.prototype.updateCodeview = function (isCodeview) {\n          this.ui.toggleBtnActive(this.$toolbar.find('.btn-codeview'), isCodeview);\n          if (isCodeview) {\n              this.deactivate();\n          }\n          else {\n              this.activate();\n          }\n      };\n      Toolbar.prototype.activate = function (isIncludeCodeview) {\n          var $btn = this.$toolbar.find('button');\n          if (!isIncludeCodeview) {\n              $btn = $btn.not('.btn-codeview');\n          }\n          this.ui.toggleBtn($btn, true);\n      };\n      Toolbar.prototype.deactivate = function (isIncludeCodeview) {\n          var $btn = this.$toolbar.find('button');\n          if (!isIncludeCodeview) {\n              $btn = $btn.not('.btn-codeview');\n          }\n          this.ui.toggleBtn($btn, false);\n      };\n      return Toolbar;\n  }());\n\n  var LinkDialog = /** @class */ (function () {\n      function LinkDialog(context) {\n          this.context = context;\n          this.ui = $$1.summernote.ui;\n          this.$body = $$1(document.body);\n          this.$editor = context.layoutInfo.editor;\n          this.options = context.options;\n          this.lang = this.options.langInfo;\n          context.memo('help.linkDialog.show', this.options.langInfo.help['linkDialog.show']);\n      }\n      LinkDialog.prototype.initialize = function () {\n          var $container = this.options.dialogsInBody ? this.$body : this.$editor;\n          var body = [\n              '<div class=\"form-group note-form-group\">',\n              \"<label class=\\\"note-form-label\\\">\" + this.lang.link.textToDisplay + \"</label>\",\n              '<input class=\"note-link-text form-control note-form-control note-input\" type=\"text\" />',\n              '</div>',\n              '<div class=\"form-group note-form-group\">',\n              \"<label class=\\\"note-form-label\\\">\" + this.lang.link.url + \"</label>\",\n              '<input class=\"note-link-url form-control note-form-control note-input\" type=\"text\" value=\"http://\" />',\n              '</div>',\n              !this.options.disableLinkTarget\n                  ? $$1('<div/>').append(this.ui.checkbox({\n                      className: 'sn-checkbox-open-in-new-window',\n                      text: this.lang.link.openInNewWindow,\n                      checked: true\n                  }).render()).html()\n                  : '',\n          ].join('');\n          var buttonClass = 'btn btn-primary note-btn note-btn-primary note-link-btn';\n          var footer = \"<input type=\\\"button\\\" href=\\\"#\\\" class=\\\"\" + buttonClass + \"\\\" value=\\\"\" + this.lang.link.insert + \"\\\" disabled>\";\n          this.$dialog = this.ui.dialog({\n              className: 'link-dialog',\n              title: this.lang.link.insert,\n              fade: this.options.dialogsFade,\n              body: body,\n              footer: footer\n          }).render().appendTo($container);\n      };\n      LinkDialog.prototype.destroy = function () {\n          this.ui.hideDialog(this.$dialog);\n          this.$dialog.remove();\n      };\n      LinkDialog.prototype.bindEnterKey = function ($input, $btn) {\n          $input.on('keypress', function (event) {\n              if (event.keyCode === key.code.ENTER) {\n                  event.preventDefault();\n                  $btn.trigger('click');\n              }\n          });\n      };\n      /**\n       * toggle update button\n       */\n      LinkDialog.prototype.toggleLinkBtn = function ($linkBtn, $linkText, $linkUrl) {\n          this.ui.toggleBtn($linkBtn, $linkText.val() && $linkUrl.val());\n      };\n      /**\n       * Show link dialog and set event handlers on dialog controls.\n       *\n       * @param {Object} linkInfo\n       * @return {Promise}\n       */\n      LinkDialog.prototype.showLinkDialog = function (linkInfo) {\n          var _this = this;\n          return $$1.Deferred(function (deferred) {\n              var $linkText = _this.$dialog.find('.note-link-text');\n              var $linkUrl = _this.$dialog.find('.note-link-url');\n              var $linkBtn = _this.$dialog.find('.note-link-btn');\n              var $openInNewWindow = _this.$dialog\n                  .find('.sn-checkbox-open-in-new-window input[type=checkbox]');\n              _this.ui.onDialogShown(_this.$dialog, function () {\n                  _this.context.triggerEvent('dialog.shown');\n                  // If no url was given and given text is valid URL then copy that into URL Field\n                  if (!linkInfo.url && func.isValidUrl(linkInfo.text)) {\n                      linkInfo.url = linkInfo.text;\n                  }\n                  $linkText.on('input paste propertychange', function () {\n                      // If linktext was modified by input events,\n                      // cloning text from linkUrl will be stopped.\n                      linkInfo.text = $linkText.val();\n                      _this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);\n                  }).val(linkInfo.text);\n                  $linkUrl.on('input paste propertychange', function () {\n                      // Display same text on `Text to display` as default\n                      // when linktext has no text\n                      if (!linkInfo.text) {\n                          $linkText.val($linkUrl.val());\n                      }\n                      _this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);\n                  }).val(linkInfo.url);\n                  if (!env.isSupportTouch) {\n                      $linkUrl.trigger('focus');\n                  }\n                  _this.toggleLinkBtn($linkBtn, $linkText, $linkUrl);\n                  _this.bindEnterKey($linkUrl, $linkBtn);\n                  _this.bindEnterKey($linkText, $linkBtn);\n                  var isNewWindowChecked = linkInfo.isNewWindow !== undefined\n                      ? linkInfo.isNewWindow : _this.context.options.linkTargetBlank;\n                  $openInNewWindow.prop('checked', isNewWindowChecked);\n                  $linkBtn.one('click', function (event) {\n                      event.preventDefault();\n                      deferred.resolve({\n                          range: linkInfo.range,\n                          url: $linkUrl.val(),\n                          text: $linkText.val(),\n                          isNewWindow: $openInNewWindow.is(':checked')\n                      });\n                      _this.ui.hideDialog(_this.$dialog);\n                  });\n              });\n              _this.ui.onDialogHidden(_this.$dialog, function () {\n                  // detach events\n                  $linkText.off();\n                  $linkUrl.off();\n                  $linkBtn.off();\n                  if (deferred.state() === 'pending') {\n                      deferred.reject();\n                  }\n              });\n              _this.ui.showDialog(_this.$dialog);\n          }).promise();\n      };\n      /**\n       * @param {Object} layoutInfo\n       */\n      LinkDialog.prototype.show = function () {\n          var _this = this;\n          var linkInfo = this.context.invoke('editor.getLinkInfo');\n          this.context.invoke('editor.saveRange');\n          this.showLinkDialog(linkInfo).then(function (linkInfo) {\n              _this.context.invoke('editor.restoreRange');\n              _this.context.invoke('editor.createLink', linkInfo);\n          }).fail(function () {\n              _this.context.invoke('editor.restoreRange');\n          });\n      };\n      return LinkDialog;\n  }());\n\n  var LinkPopover = /** @class */ (function () {\n      function LinkPopover(context) {\n          var _this = this;\n          this.context = context;\n          this.ui = $$1.summernote.ui;\n          this.options = context.options;\n          this.events = {\n              'summernote.keyup summernote.mouseup summernote.change summernote.scroll': function () {\n                  _this.update();\n              },\n              'summernote.disable summernote.dialog.shown': function () {\n                  _this.hide();\n              }\n          };\n      }\n      LinkPopover.prototype.shouldInitialize = function () {\n          return !lists.isEmpty(this.options.popover.link);\n      };\n      LinkPopover.prototype.initialize = function () {\n          this.$popover = this.ui.popover({\n              className: 'note-link-popover',\n              callback: function ($node) {\n                  var $content = $node.find('.popover-content,.note-popover-content');\n                  $content.prepend('<span><a target=\"_blank\"></a>&nbsp;</span>');\n              }\n          }).render().appendTo(this.options.container);\n          var $content = this.$popover.find('.popover-content,.note-popover-content');\n          this.context.invoke('buttons.build', $content, this.options.popover.link);\n      };\n      LinkPopover.prototype.destroy = function () {\n          this.$popover.remove();\n      };\n      LinkPopover.prototype.update = function () {\n          // Prevent focusing on editable when invoke('code') is executed\n          if (!this.context.invoke('editor.hasFocus')) {\n              this.hide();\n              return;\n          }\n          var rng = this.context.invoke('editor.getLastRange');\n          if (rng.isCollapsed() && rng.isOnAnchor()) {\n              var anchor = dom.ancestor(rng.sc, dom.isAnchor);\n              var href = $$1(anchor).attr('href');\n              this.$popover.find('a').attr('href', href).html(href);\n              var pos = dom.posFromPlaceholder(anchor);\n              this.$popover.css({\n                  display: 'block',\n                  left: pos.left,\n                  top: pos.top\n              });\n          }\n          else {\n              this.hide();\n          }\n      };\n      LinkPopover.prototype.hide = function () {\n          this.$popover.hide();\n      };\n      return LinkPopover;\n  }());\n\n  var ImageDialog = /** @class */ (function () {\n      function ImageDialog(context) {\n          this.context = context;\n          this.ui = $$1.summernote.ui;\n          this.$body = $$1(document.body);\n          this.$editor = context.layoutInfo.editor;\n          this.options = context.options;\n          this.lang = this.options.langInfo;\n      }\n      ImageDialog.prototype.initialize = function () {\n          var $container = this.options.dialogsInBody ? this.$body : this.$editor;\n          var imageLimitation = '';\n          if (this.options.maximumImageFileSize) {\n              var unit = Math.floor(Math.log(this.options.maximumImageFileSize) / Math.log(1024));\n              var readableSize = (this.options.maximumImageFileSize / Math.pow(1024, unit)).toFixed(2) * 1 +\n                  ' ' + ' KMGTP'[unit] + 'B';\n              imageLimitation = \"<small>\" + (this.lang.image.maximumFileSize + ' : ' + readableSize) + \"</small>\";\n          }\n          var body = [\n              '<div class=\"form-group note-form-group note-group-select-from-files\">',\n              '<label class=\"note-form-label\">' + this.lang.image.selectFromFiles + '</label>',\n              '<input class=\"note-image-input form-control-file note-form-control note-input\" ',\n              ' type=\"file\" name=\"files\" accept=\"image/*\" multiple=\"multiple\" />',\n              imageLimitation,\n              '</div>',\n              '<div class=\"form-group note-group-image-url\" style=\"overflow:auto;\">',\n              '<label class=\"note-form-label\">' + this.lang.image.url + '</label>',\n              '<input class=\"note-image-url form-control note-form-control note-input ',\n              ' col-md-12\" type=\"text\" />',\n              '</div>',\n          ].join('');\n          var buttonClass = 'btn btn-primary note-btn note-btn-primary note-image-btn';\n          var footer = \"<input type=\\\"button\\\" href=\\\"#\\\" class=\\\"\" + buttonClass + \"\\\" value=\\\"\" + this.lang.image.insert + \"\\\" disabled>\";\n          this.$dialog = this.ui.dialog({\n              title: this.lang.image.insert,\n              fade: this.options.dialogsFade,\n              body: body,\n              footer: footer\n          }).render().appendTo($container);\n      };\n      ImageDialog.prototype.destroy = function () {\n          this.ui.hideDialog(this.$dialog);\n          this.$dialog.remove();\n      };\n      ImageDialog.prototype.bindEnterKey = function ($input, $btn) {\n          $input.on('keypress', function (event) {\n              if (event.keyCode === key.code.ENTER) {\n                  event.preventDefault();\n                  $btn.trigger('click');\n              }\n          });\n      };\n      ImageDialog.prototype.show = function () {\n          var _this = this;\n          this.context.invoke('editor.saveRange');\n          this.showImageDialog().then(function (data) {\n              // [workaround] hide dialog before restore range for IE range focus\n              _this.ui.hideDialog(_this.$dialog);\n              _this.context.invoke('editor.restoreRange');\n              if (typeof data === 'string') { // image url\n                  // If onImageLinkInsert set,\n                  if (_this.options.callbacks.onImageLinkInsert) {\n                      _this.context.triggerEvent('image.link.insert', data);\n                  }\n                  else {\n                      _this.context.invoke('editor.insertImage', data);\n                  }\n              }\n              else { // array of files\n                  _this.context.invoke('editor.insertImagesOrCallback', data);\n              }\n          }).fail(function () {\n              _this.context.invoke('editor.restoreRange');\n          });\n      };\n      /**\n       * show image dialog\n       *\n       * @param {jQuery} $dialog\n       * @return {Promise}\n       */\n      ImageDialog.prototype.showImageDialog = function () {\n          var _this = this;\n          return $$1.Deferred(function (deferred) {\n              var $imageInput = _this.$dialog.find('.note-image-input');\n              var $imageUrl = _this.$dialog.find('.note-image-url');\n              var $imageBtn = _this.$dialog.find('.note-image-btn');\n              _this.ui.onDialogShown(_this.$dialog, function () {\n                  _this.context.triggerEvent('dialog.shown');\n                  // Cloning imageInput to clear element.\n                  $imageInput.replaceWith($imageInput.clone().on('change', function (event) {\n                      deferred.resolve(event.target.files || event.target.value);\n                  }).val(''));\n                  $imageUrl.on('input paste propertychange', function () {\n                      _this.ui.toggleBtn($imageBtn, $imageUrl.val());\n                  }).val('');\n                  if (!env.isSupportTouch) {\n                      $imageUrl.trigger('focus');\n                  }\n                  $imageBtn.click(function (event) {\n                      event.preventDefault();\n                      deferred.resolve($imageUrl.val());\n                  });\n                  _this.bindEnterKey($imageUrl, $imageBtn);\n              });\n              _this.ui.onDialogHidden(_this.$dialog, function () {\n                  $imageInput.off();\n                  $imageUrl.off();\n                  $imageBtn.off();\n                  if (deferred.state() === 'pending') {\n                      deferred.reject();\n                  }\n              });\n              _this.ui.showDialog(_this.$dialog);\n          });\n      };\n      return ImageDialog;\n  }());\n\n  /**\n   * Image popover module\n   *  mouse events that show/hide popover will be handled by Handle.js.\n   *  Handle.js will receive the events and invoke 'imagePopover.update'.\n   */\n  var ImagePopover = /** @class */ (function () {\n      function ImagePopover(context) {\n          var _this = this;\n          this.context = context;\n          this.ui = $$1.summernote.ui;\n          this.editable = context.layoutInfo.editable[0];\n          this.options = context.options;\n          this.events = {\n              'summernote.disable': function () {\n                  _this.hide();\n              }\n          };\n      }\n      ImagePopover.prototype.shouldInitialize = function () {\n          return !lists.isEmpty(this.options.popover.image);\n      };\n      ImagePopover.prototype.initialize = function () {\n          this.$popover = this.ui.popover({\n              className: 'note-image-popover'\n          }).render().appendTo(this.options.container);\n          var $content = this.$popover.find('.popover-content,.note-popover-content');\n          this.context.invoke('buttons.build', $content, this.options.popover.image);\n      };\n      ImagePopover.prototype.destroy = function () {\n          this.$popover.remove();\n      };\n      ImagePopover.prototype.update = function (target, event) {\n          if (dom.isImg(target)) {\n              var pos = dom.posFromPlaceholder(target);\n              var posEditor = dom.posFromPlaceholder(this.editable);\n              this.$popover.css({\n                  display: 'block',\n                  left: this.options.popatmouse ? event.pageX - 20 : pos.left,\n                  top: this.options.popatmouse ? event.pageY : Math.min(pos.top, posEditor.top)\n              });\n          }\n          else {\n              this.hide();\n          }\n      };\n      ImagePopover.prototype.hide = function () {\n          this.$popover.hide();\n      };\n      return ImagePopover;\n  }());\n\n  var TablePopover = /** @class */ (function () {\n      function TablePopover(context) {\n          var _this = this;\n          this.context = context;\n          this.ui = $$1.summernote.ui;\n          this.options = context.options;\n          this.events = {\n              'summernote.mousedown': function (we, e) {\n                  _this.update(e.target);\n              },\n              'summernote.keyup summernote.scroll summernote.change': function () {\n                  _this.update();\n              },\n              'summernote.disable': function () {\n                  _this.hide();\n              }\n          };\n      }\n      TablePopover.prototype.shouldInitialize = function () {\n          return !lists.isEmpty(this.options.popover.table);\n      };\n      TablePopover.prototype.initialize = function () {\n          this.$popover = this.ui.popover({\n              className: 'note-table-popover'\n          }).render().appendTo(this.options.container);\n          var $content = this.$popover.find('.popover-content,.note-popover-content');\n          this.context.invoke('buttons.build', $content, this.options.popover.table);\n          // [workaround] Disable Firefox's default table editor\n          if (env.isFF) {\n              document.execCommand('enableInlineTableEditing', false, false);\n          }\n      };\n      TablePopover.prototype.destroy = function () {\n          this.$popover.remove();\n      };\n      TablePopover.prototype.update = function (target) {\n          if (this.context.isDisabled()) {\n              return false;\n          }\n          var isCell = dom.isCell(target);\n          if (isCell) {\n              var pos = dom.posFromPlaceholder(target);\n              this.$popover.css({\n                  display: 'block',\n                  left: pos.left,\n                  top: pos.top\n              });\n          }\n          else {\n              this.hide();\n          }\n          return isCell;\n      };\n      TablePopover.prototype.hide = function () {\n          this.$popover.hide();\n      };\n      return TablePopover;\n  }());\n\n  var VideoDialog = /** @class */ (function () {\n      function VideoDialog(context) {\n          this.context = context;\n          this.ui = $$1.summernote.ui;\n          this.$body = $$1(document.body);\n          this.$editor = context.layoutInfo.editor;\n          this.options = context.options;\n          this.lang = this.options.langInfo;\n      }\n      VideoDialog.prototype.initialize = function () {\n          var $container = this.options.dialogsInBody ? this.$body : this.$editor;\n          var body = [\n              '<div class=\"form-group note-form-group row-fluid\">',\n              \"<label class=\\\"note-form-label\\\">\" + this.lang.video.url + \" <small class=\\\"text-muted\\\">\" + this.lang.video.providers + \"</small></label>\",\n              '<input class=\"note-video-url form-control note-form-control note-input\" type=\"text\" />',\n              '</div>',\n          ].join('');\n          var buttonClass = 'btn btn-primary note-btn note-btn-primary note-video-btn';\n          var footer = \"<input type=\\\"button\\\" href=\\\"#\\\" class=\\\"\" + buttonClass + \"\\\" value=\\\"\" + this.lang.video.insert + \"\\\" disabled>\";\n          this.$dialog = this.ui.dialog({\n              title: this.lang.video.insert,\n              fade: this.options.dialogsFade,\n              body: body,\n              footer: footer\n          }).render().appendTo($container);\n      };\n      VideoDialog.prototype.destroy = function () {\n          this.ui.hideDialog(this.$dialog);\n          this.$dialog.remove();\n      };\n      VideoDialog.prototype.bindEnterKey = function ($input, $btn) {\n          $input.on('keypress', function (event) {\n              if (event.keyCode === key.code.ENTER) {\n                  event.preventDefault();\n                  $btn.trigger('click');\n              }\n          });\n      };\n      VideoDialog.prototype.createVideoNode = function (url) {\n          // video url patterns(youtube, instagram, vimeo, dailymotion, youku, mp4, ogg, webm)\n          var ytRegExp = /\\/\\/(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))([\\w|-]{11})(?:(?:[\\?&]t=)(\\S+))?$/;\n          var ytRegExpForStart = /^(?:(\\d+)h)?(?:(\\d+)m)?(?:(\\d+)s)?$/;\n          var ytMatch = url.match(ytRegExp);\n          var igRegExp = /(?:www\\.|\\/\\/)instagram\\.com\\/p\\/(.[a-zA-Z0-9_-]*)/;\n          var igMatch = url.match(igRegExp);\n          var vRegExp = /\\/\\/vine\\.co\\/v\\/([a-zA-Z0-9]+)/;\n          var vMatch = url.match(vRegExp);\n          var vimRegExp = /\\/\\/(player\\.)?vimeo\\.com\\/([a-z]*\\/)*(\\d+)[?]?.*/;\n          var vimMatch = url.match(vimRegExp);\n          var dmRegExp = /.+dailymotion.com\\/(video|hub)\\/([^_]+)[^#]*(#video=([^_&]+))?/;\n          var dmMatch = url.match(dmRegExp);\n          var youkuRegExp = /\\/\\/v\\.youku\\.com\\/v_show\\/id_(\\w+)=*\\.html/;\n          var youkuMatch = url.match(youkuRegExp);\n          var qqRegExp = /\\/\\/v\\.qq\\.com.*?vid=(.+)/;\n          var qqMatch = url.match(qqRegExp);\n          var qqRegExp2 = /\\/\\/v\\.qq\\.com\\/x?\\/?(page|cover).*?\\/([^\\/]+)\\.html\\??.*/;\n          var qqMatch2 = url.match(qqRegExp2);\n          var mp4RegExp = /^.+.(mp4|m4v)$/;\n          var mp4Match = url.match(mp4RegExp);\n          var oggRegExp = /^.+.(ogg|ogv)$/;\n          var oggMatch = url.match(oggRegExp);\n          var webmRegExp = /^.+.(webm)$/;\n          var webmMatch = url.match(webmRegExp);\n          var fbRegExp = /(?:www\\.|\\/\\/)facebook\\.com\\/([^\\/]+)\\/videos\\/([0-9]+)/;\n          var fbMatch = url.match(fbRegExp);\n          var $video;\n          if (ytMatch && ytMatch[1].length === 11) {\n              var youtubeId = ytMatch[1];\n              var start = 0;\n              if (typeof ytMatch[2] !== 'undefined') {\n                  var ytMatchForStart = ytMatch[2].match(ytRegExpForStart);\n                  if (ytMatchForStart) {\n                      for (var n = [3600, 60, 1], i = 0, r = n.length; i < r; i++) {\n                          start += (typeof ytMatchForStart[i + 1] !== 'undefined' ? n[i] * parseInt(ytMatchForStart[i + 1], 10) : 0);\n                      }\n                  }\n              }\n              $video = $$1('<iframe>')\n                  .attr('frameborder', 0)\n                  .attr('src', '//www.youtube.com/embed/' + youtubeId + (start > 0 ? '?start=' + start : ''))\n                  .attr('width', '640').attr('height', '360');\n          }\n          else if (igMatch && igMatch[0].length) {\n              $video = $$1('<iframe>')\n                  .attr('frameborder', 0)\n                  .attr('src', 'https://instagram.com/p/' + igMatch[1] + '/embed/')\n                  .attr('width', '612').attr('height', '710')\n                  .attr('scrolling', 'no')\n                  .attr('allowtransparency', 'true');\n          }\n          else if (vMatch && vMatch[0].length) {\n              $video = $$1('<iframe>')\n                  .attr('frameborder', 0)\n                  .attr('src', vMatch[0] + '/embed/simple')\n                  .attr('width', '600').attr('height', '600')\n                  .attr('class', 'vine-embed');\n          }\n          else if (vimMatch && vimMatch[3].length) {\n              $video = $$1('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')\n                  .attr('frameborder', 0)\n                  .attr('src', '//player.vimeo.com/video/' + vimMatch[3])\n                  .attr('width', '640').attr('height', '360');\n          }\n          else if (dmMatch && dmMatch[2].length) {\n              $video = $$1('<iframe>')\n                  .attr('frameborder', 0)\n                  .attr('src', '//www.dailymotion.com/embed/video/' + dmMatch[2])\n                  .attr('width', '640').attr('height', '360');\n          }\n          else if (youkuMatch && youkuMatch[1].length) {\n              $video = $$1('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')\n                  .attr('frameborder', 0)\n                  .attr('height', '498')\n                  .attr('width', '510')\n                  .attr('src', '//player.youku.com/embed/' + youkuMatch[1]);\n          }\n          else if ((qqMatch && qqMatch[1].length) || (qqMatch2 && qqMatch2[2].length)) {\n              var vid = ((qqMatch && qqMatch[1].length) ? qqMatch[1] : qqMatch2[2]);\n              $video = $$1('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>')\n                  .attr('frameborder', 0)\n                  .attr('height', '310')\n                  .attr('width', '500')\n                  .attr('src', 'http://v.qq.com/iframe/player.html?vid=' + vid + '&amp;auto=0');\n          }\n          else if (mp4Match || oggMatch || webmMatch) {\n              $video = $$1('<video controls>')\n                  .attr('src', url)\n                  .attr('width', '640').attr('height', '360');\n          }\n          else if (fbMatch && fbMatch[0].length) {\n              $video = $$1('<iframe>')\n                  .attr('frameborder', 0)\n                  .attr('src', 'https://www.facebook.com/plugins/video.php?href=' + encodeURIComponent(fbMatch[0]) + '&show_text=0&width=560')\n                  .attr('width', '560').attr('height', '301')\n                  .attr('scrolling', 'no')\n                  .attr('allowtransparency', 'true');\n          }\n          else {\n              // this is not a known video link. Now what, Cat? Now what?\n              return false;\n          }\n          $video.addClass('note-video-clip');\n          return $video[0];\n      };\n      VideoDialog.prototype.show = function () {\n          var _this = this;\n          var text = this.context.invoke('editor.getSelectedText');\n          this.context.invoke('editor.saveRange');\n          this.showVideoDialog(text).then(function (url) {\n              // [workaround] hide dialog before restore range for IE range focus\n              _this.ui.hideDialog(_this.$dialog);\n              _this.context.invoke('editor.restoreRange');\n              // build node\n              var $node = _this.createVideoNode(url);\n              if ($node) {\n                  // insert video node\n                  _this.context.invoke('editor.insertNode', $node);\n              }\n          }).fail(function () {\n              _this.context.invoke('editor.restoreRange');\n          });\n      };\n      /**\n       * show image dialog\n       *\n       * @param {jQuery} $dialog\n       * @return {Promise}\n       */\n      VideoDialog.prototype.showVideoDialog = function (text) {\n          var _this = this;\n          return $$1.Deferred(function (deferred) {\n              var $videoUrl = _this.$dialog.find('.note-video-url');\n              var $videoBtn = _this.$dialog.find('.note-video-btn');\n              _this.ui.onDialogShown(_this.$dialog, function () {\n                  _this.context.triggerEvent('dialog.shown');\n                  $videoUrl.on('input paste propertychange', function () {\n                      _this.ui.toggleBtn($videoBtn, $videoUrl.val());\n                  });\n                  if (!env.isSupportTouch) {\n                      $videoUrl.trigger('focus');\n                  }\n                  $videoBtn.click(function (event) {\n                      event.preventDefault();\n                      deferred.resolve($videoUrl.val());\n                  });\n                  _this.bindEnterKey($videoUrl, $videoBtn);\n              });\n              _this.ui.onDialogHidden(_this.$dialog, function () {\n                  $videoUrl.off();\n                  $videoBtn.off();\n                  if (deferred.state() === 'pending') {\n                      deferred.reject();\n                  }\n              });\n              _this.ui.showDialog(_this.$dialog);\n          });\n      };\n      return VideoDialog;\n  }());\n\n  var HelpDialog = /** @class */ (function () {\n      function HelpDialog(context) {\n          this.context = context;\n          this.ui = $$1.summernote.ui;\n          this.$body = $$1(document.body);\n          this.$editor = context.layoutInfo.editor;\n          this.options = context.options;\n          this.lang = this.options.langInfo;\n      }\n      HelpDialog.prototype.initialize = function () {\n          var $container = this.options.dialogsInBody ? this.$body : this.$editor;\n          var body = [\n              '<p class=\"text-center\">',\n              '<a href=\"http://summernote.org/\" target=\"_blank\">Summernote 0.8.12</a> · ',\n              '<a href=\"https://github.com/summernote/summernote\" target=\"_blank\">Project</a> · ',\n              '<a href=\"https://github.com/summernote/summernote/issues\" target=\"_blank\">Issues</a>',\n              '</p>',\n          ].join('');\n          this.$dialog = this.ui.dialog({\n              title: this.lang.options.help,\n              fade: this.options.dialogsFade,\n              body: this.createShortcutList(),\n              footer: body,\n              callback: function ($node) {\n                  $node.find('.modal-body,.note-modal-body').css({\n                      'max-height': 300,\n                      'overflow': 'scroll'\n                  });\n              }\n          }).render().appendTo($container);\n      };\n      HelpDialog.prototype.destroy = function () {\n          this.ui.hideDialog(this.$dialog);\n          this.$dialog.remove();\n      };\n      HelpDialog.prototype.createShortcutList = function () {\n          var _this = this;\n          var keyMap = this.options.keyMap[env.isMac ? 'mac' : 'pc'];\n          return Object.keys(keyMap).map(function (key) {\n              var command = keyMap[key];\n              var $row = $$1('<div><div class=\"help-list-item\"/></div>');\n              $row.append($$1('<label><kbd>' + key + '</kdb></label>').css({\n                  'width': 180,\n                  'margin-right': 10\n              })).append($$1('<span/>').html(_this.context.memo('help.' + command) || command));\n              return $row.html();\n          }).join('');\n      };\n      /**\n       * show help dialog\n       *\n       * @return {Promise}\n       */\n      HelpDialog.prototype.showHelpDialog = function () {\n          var _this = this;\n          return $$1.Deferred(function (deferred) {\n              _this.ui.onDialogShown(_this.$dialog, function () {\n                  _this.context.triggerEvent('dialog.shown');\n                  deferred.resolve();\n              });\n              _this.ui.showDialog(_this.$dialog);\n          }).promise();\n      };\n      HelpDialog.prototype.show = function () {\n          var _this = this;\n          this.context.invoke('editor.saveRange');\n          this.showHelpDialog().then(function () {\n              _this.context.invoke('editor.restoreRange');\n          });\n      };\n      return HelpDialog;\n  }());\n\n  var AIR_MODE_POPOVER_X_OFFSET = 20;\n  var AirPopover = /** @class */ (function () {\n      function AirPopover(context) {\n          var _this = this;\n          this.context = context;\n          this.ui = $$1.summernote.ui;\n          this.options = context.options;\n          this.events = {\n              'summernote.keyup summernote.mouseup summernote.scroll': function () {\n                  _this.update();\n              },\n              'summernote.disable summernote.change summernote.dialog.shown': function () {\n                  _this.hide();\n              },\n              'summernote.focusout': function (we, e) {\n                  // [workaround] Firefox doesn't support relatedTarget on focusout\n                  //  - Ignore hide action on focus out in FF.\n                  if (env.isFF) {\n                      return;\n                  }\n                  if (!e.relatedTarget || !dom.ancestor(e.relatedTarget, func.eq(_this.$popover[0]))) {\n                      _this.hide();\n                  }\n              }\n          };\n      }\n      AirPopover.prototype.shouldInitialize = function () {\n          return this.options.airMode && !lists.isEmpty(this.options.popover.air);\n      };\n      AirPopover.prototype.initialize = function () {\n          this.$popover = this.ui.popover({\n              className: 'note-air-popover'\n          }).render().appendTo(this.options.container);\n          var $content = this.$popover.find('.popover-content');\n          this.context.invoke('buttons.build', $content, this.options.popover.air);\n      };\n      AirPopover.prototype.destroy = function () {\n          this.$popover.remove();\n      };\n      AirPopover.prototype.update = function () {\n          var styleInfo = this.context.invoke('editor.currentStyle');\n          if (styleInfo.range && !styleInfo.range.isCollapsed()) {\n              var rect = lists.last(styleInfo.range.getClientRects());\n              if (rect) {\n                  var bnd = func.rect2bnd(rect);\n                  this.$popover.css({\n                      display: 'block',\n                      left: Math.max(bnd.left + bnd.width / 2, 0) - AIR_MODE_POPOVER_X_OFFSET,\n                      top: bnd.top + bnd.height\n                  });\n                  this.context.invoke('buttons.updateCurrentStyle', this.$popover);\n              }\n          }\n          else {\n              this.hide();\n          }\n      };\n      AirPopover.prototype.hide = function () {\n          this.$popover.hide();\n      };\n      return AirPopover;\n  }());\n\n  var POPOVER_DIST = 5;\n  var HintPopover = /** @class */ (function () {\n      function HintPopover(context) {\n          var _this = this;\n          this.context = context;\n          this.ui = $$1.summernote.ui;\n          this.$editable = context.layoutInfo.editable;\n          this.options = context.options;\n          this.hint = this.options.hint || [];\n          this.direction = this.options.hintDirection || 'bottom';\n          this.hints = Array.isArray(this.hint) ? this.hint : [this.hint];\n          this.events = {\n              'summernote.keyup': function (we, e) {\n                  if (!e.isDefaultPrevented()) {\n                      _this.handleKeyup(e);\n                  }\n              },\n              'summernote.keydown': function (we, e) {\n                  _this.handleKeydown(e);\n              },\n              'summernote.disable summernote.dialog.shown': function () {\n                  _this.hide();\n              }\n          };\n      }\n      HintPopover.prototype.shouldInitialize = function () {\n          return this.hints.length > 0;\n      };\n      HintPopover.prototype.initialize = function () {\n          var _this = this;\n          this.lastWordRange = null;\n          this.$popover = this.ui.popover({\n              className: 'note-hint-popover',\n              hideArrow: true,\n              direction: ''\n          }).render().appendTo(this.options.container);\n          this.$popover.hide();\n          this.$content = this.$popover.find('.popover-content,.note-popover-content');\n          this.$content.on('click', '.note-hint-item', function (e) {\n              _this.$content.find('.active').removeClass('active');\n              $$1(e.currentTarget).addClass('active');\n              _this.replace();\n          });\n      };\n      HintPopover.prototype.destroy = function () {\n          this.$popover.remove();\n      };\n      HintPopover.prototype.selectItem = function ($item) {\n          this.$content.find('.active').removeClass('active');\n          $item.addClass('active');\n          this.$content[0].scrollTop = $item[0].offsetTop - (this.$content.innerHeight() / 2);\n      };\n      HintPopover.prototype.moveDown = function () {\n          var $current = this.$content.find('.note-hint-item.active');\n          var $next = $current.next();\n          if ($next.length) {\n              this.selectItem($next);\n          }\n          else {\n              var $nextGroup = $current.parent().next();\n              if (!$nextGroup.length) {\n                  $nextGroup = this.$content.find('.note-hint-group').first();\n              }\n              this.selectItem($nextGroup.find('.note-hint-item').first());\n          }\n      };\n      HintPopover.prototype.moveUp = function () {\n          var $current = this.$content.find('.note-hint-item.active');\n          var $prev = $current.prev();\n          if ($prev.length) {\n              this.selectItem($prev);\n          }\n          else {\n              var $prevGroup = $current.parent().prev();\n              if (!$prevGroup.length) {\n                  $prevGroup = this.$content.find('.note-hint-group').last();\n              }\n              this.selectItem($prevGroup.find('.note-hint-item').last());\n          }\n      };\n      HintPopover.prototype.replace = function () {\n          var $item = this.$content.find('.note-hint-item.active');\n          if ($item.length) {\n              var node = this.nodeFromItem($item);\n              // XXX: consider to move codes to editor for recording redo/undo.\n              this.lastWordRange.insertNode(node);\n              range.createFromNode(node).collapse().select();\n              this.lastWordRange = null;\n              this.hide();\n              this.context.triggerEvent('change', this.$editable.html(), this.$editable[0]);\n              this.context.invoke('editor.focus');\n          }\n      };\n      HintPopover.prototype.nodeFromItem = function ($item) {\n          var hint = this.hints[$item.data('index')];\n          var item = $item.data('item');\n          var node = hint.content ? hint.content(item) : item;\n          if (typeof node === 'string') {\n              node = dom.createText(node);\n          }\n          return node;\n      };\n      HintPopover.prototype.createItemTemplates = function (hintIdx, items) {\n          var hint = this.hints[hintIdx];\n          return items.map(function (item, idx) {\n              var $item = $$1('<div class=\"note-hint-item\"/>');\n              $item.append(hint.template ? hint.template(item) : item + '');\n              $item.data({\n                  'index': hintIdx,\n                  'item': item\n              });\n              return $item;\n          });\n      };\n      HintPopover.prototype.handleKeydown = function (e) {\n          if (!this.$popover.is(':visible')) {\n              return;\n          }\n          if (e.keyCode === key.code.ENTER) {\n              e.preventDefault();\n              this.replace();\n          }\n          else if (e.keyCode === key.code.UP) {\n              e.preventDefault();\n              this.moveUp();\n          }\n          else if (e.keyCode === key.code.DOWN) {\n              e.preventDefault();\n              this.moveDown();\n          }\n      };\n      HintPopover.prototype.searchKeyword = function (index, keyword, callback) {\n          var hint = this.hints[index];\n          if (hint && hint.match.test(keyword) && hint.search) {\n              var matches = hint.match.exec(keyword);\n              hint.search(matches[1], callback);\n          }\n          else {\n              callback();\n          }\n      };\n      HintPopover.prototype.createGroup = function (idx, keyword) {\n          var _this = this;\n          var $group = $$1('<div class=\"note-hint-group note-hint-group-' + idx + '\"/>');\n          this.searchKeyword(idx, keyword, function (items) {\n              items = items || [];\n              if (items.length) {\n                  $group.html(_this.createItemTemplates(idx, items));\n                  _this.show();\n              }\n          });\n          return $group;\n      };\n      HintPopover.prototype.handleKeyup = function (e) {\n          var _this = this;\n          if (!lists.contains([key.code.ENTER, key.code.UP, key.code.DOWN], e.keyCode)) {\n              var wordRange = this.context.invoke('editor.getLastRange').getWordRange();\n              var keyword_1 = wordRange.toString();\n              if (this.hints.length && keyword_1) {\n                  this.$content.empty();\n                  var bnd = func.rect2bnd(lists.last(wordRange.getClientRects()));\n                  if (bnd) {\n                      this.$popover.hide();\n                      this.lastWordRange = wordRange;\n                      this.hints.forEach(function (hint, idx) {\n                          if (hint.match.test(keyword_1)) {\n                              _this.createGroup(idx, keyword_1).appendTo(_this.$content);\n                          }\n                      });\n                      // select first .note-hint-item\n                      this.$content.find('.note-hint-item:first').addClass('active');\n                      // set position for popover after group is created\n                      if (this.direction === 'top') {\n                          this.$popover.css({\n                              left: bnd.left,\n                              top: bnd.top - this.$popover.outerHeight() - POPOVER_DIST\n                          });\n                      }\n                      else {\n                          this.$popover.css({\n                              left: bnd.left,\n                              top: bnd.top + bnd.height + POPOVER_DIST\n                          });\n                      }\n                  }\n              }\n              else {\n                  this.hide();\n              }\n          }\n      };\n      HintPopover.prototype.show = function () {\n          this.$popover.show();\n      };\n      HintPopover.prototype.hide = function () {\n          this.$popover.hide();\n      };\n      return HintPopover;\n  }());\n\n  $$1.summernote = $$1.extend($$1.summernote, {\n      version: '0.8.12',\n      plugins: {},\n      dom: dom,\n      range: range,\n      options: {\n          langInfo: $$1.summernote.lang['en-US'],\n          modules: {\n              'editor': Editor,\n              'clipboard': Clipboard,\n              'dropzone': Dropzone,\n              'codeview': CodeView,\n              'statusbar': Statusbar,\n              'fullscreen': Fullscreen,\n              'handle': Handle,\n              // FIXME: HintPopover must be front of autolink\n              //  - Script error about range when Enter key is pressed on hint popover\n              'hintPopover': HintPopover,\n              'autoLink': AutoLink,\n              'autoSync': AutoSync,\n              'autoReplace': AutoReplace,\n              'placeholder': Placeholder,\n              'buttons': Buttons,\n              'toolbar': Toolbar,\n              'linkDialog': LinkDialog,\n              'linkPopover': LinkPopover,\n              'imageDialog': ImageDialog,\n              'imagePopover': ImagePopover,\n              'tablePopover': TablePopover,\n              'videoDialog': VideoDialog,\n              'helpDialog': HelpDialog,\n              'airPopover': AirPopover\n          },\n          buttons: {},\n          lang: 'en-US',\n          followingToolbar: false,\n          otherStaticBar: '',\n          // toolbar\n          toolbar: [\n              ['style', ['style']],\n              ['font', ['bold', 'underline', 'clear']],\n              ['fontname', ['fontname']],\n              ['color', ['color']],\n              ['para', ['ul', 'ol', 'paragraph']],\n              ['table', ['table']],\n              ['insert', ['link', 'picture', 'video']],\n              ['view', ['fullscreen', 'codeview', 'help']],\n          ],\n          // popover\n          popatmouse: true,\n          popover: {\n              image: [\n                  ['resize', ['resizeFull', 'resizeHalf', 'resizeQuarter', 'resizeNone']],\n                  ['float', ['floatLeft', 'floatRight', 'floatNone']],\n                  ['remove', ['removeMedia']],\n              ],\n              link: [\n                  ['link', ['linkDialogShow', 'unlink']],\n              ],\n              table: [\n                  ['add', ['addRowDown', 'addRowUp', 'addColLeft', 'addColRight']],\n                  ['delete', ['deleteRow', 'deleteCol', 'deleteTable']],\n              ],\n              air: [\n                  ['color', ['color']],\n                  ['font', ['bold', 'underline', 'clear']],\n                  ['para', ['ul', 'paragraph']],\n                  ['table', ['table']],\n                  ['insert', ['link', 'picture']],\n              ]\n          },\n          // air mode: inline editor\n          airMode: false,\n          width: null,\n          height: null,\n          linkTargetBlank: true,\n          focus: false,\n          tabSize: 4,\n          styleWithSpan: true,\n          shortcuts: true,\n          textareaAutoSync: true,\n          hintDirection: 'bottom',\n          tooltip: 'auto',\n          container: 'body',\n          maxTextLength: 0,\n          blockquoteBreakingLevel: 2,\n          spellCheck: true,\n          styleTags: ['p', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'],\n          fontNames: [\n              'Arial', 'Arial Black', 'Comic Sans MS', 'Courier New',\n              'Helvetica Neue', 'Helvetica', 'Impact', 'Lucida Grande',\n              'Tahoma', 'Times New Roman', 'Verdana',\n          ],\n          fontNamesIgnoreCheck: [],\n          fontSizes: ['8', '9', '10', '11', '12', '14', '18', '24', '36'],\n          // pallete colors(n x n)\n          colors: [\n              ['#000000', '#424242', '#636363', '#9C9C94', '#CEC6CE', '#EFEFEF', '#F7F7F7', '#FFFFFF'],\n              ['#FF0000', '#FF9C00', '#FFFF00', '#00FF00', '#00FFFF', '#0000FF', '#9C00FF', '#FF00FF'],\n              ['#F7C6CE', '#FFE7CE', '#FFEFC6', '#D6EFD6', '#CEDEE7', '#CEE7F7', '#D6D6E7', '#E7D6DE'],\n              ['#E79C9C', '#FFC69C', '#FFE79C', '#B5D6A5', '#A5C6CE', '#9CC6EF', '#B5A5D6', '#D6A5BD'],\n              ['#E76363', '#F7AD6B', '#FFD663', '#94BD7B', '#73A5AD', '#6BADDE', '#8C7BC6', '#C67BA5'],\n              ['#CE0000', '#E79439', '#EFC631', '#6BA54A', '#4A7B8C', '#3984C6', '#634AA5', '#A54A7B'],\n              ['#9C0000', '#B56308', '#BD9400', '#397B21', '#104A5A', '#085294', '#311873', '#731842'],\n              ['#630000', '#7B3900', '#846300', '#295218', '#083139', '#003163', '#21104A', '#4A1031'],\n          ],\n          // http://chir.ag/projects/name-that-color/\n          colorsName: [\n              ['Black', 'Tundora', 'Dove Gray', 'Star Dust', 'Pale Slate', 'Gallery', 'Alabaster', 'White'],\n              ['Red', 'Orange Peel', 'Yellow', 'Green', 'Cyan', 'Blue', 'Electric Violet', 'Magenta'],\n              ['Azalea', 'Karry', 'Egg White', 'Zanah', 'Botticelli', 'Tropical Blue', 'Mischka', 'Twilight'],\n              ['Tonys Pink', 'Peach Orange', 'Cream Brulee', 'Sprout', 'Casper', 'Perano', 'Cold Purple', 'Careys Pink'],\n              ['Mandy', 'Rajah', 'Dandelion', 'Olivine', 'Gulf Stream', 'Viking', 'Blue Marguerite', 'Puce'],\n              ['Guardsman Red', 'Fire Bush', 'Golden Dream', 'Chelsea Cucumber', 'Smalt Blue', 'Boston Blue', 'Butterfly Bush', 'Cadillac'],\n              ['Sangria', 'Mai Tai', 'Buddha Gold', 'Forest Green', 'Eden', 'Venice Blue', 'Meteorite', 'Claret'],\n              ['Rosewood', 'Cinnamon', 'Olive', 'Parsley', 'Tiber', 'Midnight Blue', 'Valentino', 'Loulou'],\n          ],\n          colorButton: {\n              foreColor: '#000000',\n              backColor: '#FFFF00'\n          },\n          lineHeights: ['1.0', '1.2', '1.4', '1.5', '1.6', '1.8', '2.0', '3.0'],\n          tableClassName: 'table table-bordered',\n          insertTableMaxSize: {\n              col: 10,\n              row: 10\n          },\n          dialogsInBody: false,\n          dialogsFade: false,\n          maximumImageFileSize: null,\n          callbacks: {\n              onBeforeCommand: null,\n              onBlur: null,\n              onBlurCodeview: null,\n              onChange: null,\n              onChangeCodeview: null,\n              onDialogShown: null,\n              onEnter: null,\n              onFocus: null,\n              onImageLinkInsert: null,\n              onImageUpload: null,\n              onImageUploadError: null,\n              onInit: null,\n              onKeydown: null,\n              onKeyup: null,\n              onMousedown: null,\n              onMouseup: null,\n              onPaste: null,\n              onScroll: null\n          },\n          codemirror: {\n              mode: 'text/html',\n              htmlMode: true,\n              lineNumbers: true\n          },\n          codeviewFilter: false,\n          codeviewFilterRegex: /<\\/*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|ilayer|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|t(?:itle|extarea)|xml)[^>]*?>/gi,\n          codeviewIframeFilter: true,\n          codeviewIframeWhitelistSrc: [],\n          codeviewIframeWhitelistSrcBase: [\n              'www.youtube.com',\n              'www.youtube-nocookie.com',\n              'www.facebook.com',\n              'vine.co',\n              'instagram.com',\n              'player.vimeo.com',\n              'www.dailymotion.com',\n              'player.youku.com',\n              'v.qq.com',\n          ],\n          keyMap: {\n              pc: {\n                  'ENTER': 'insertParagraph',\n                  'CTRL+Z': 'undo',\n                  'CTRL+Y': 'redo',\n                  'TAB': 'tab',\n                  'SHIFT+TAB': 'untab',\n                  'CTRL+B': 'bold',\n                  'CTRL+I': 'italic',\n                  'CTRL+U': 'underline',\n                  'CTRL+SHIFT+S': 'strikethrough',\n                  'CTRL+BACKSLASH': 'removeFormat',\n                  'CTRL+SHIFT+L': 'justifyLeft',\n                  'CTRL+SHIFT+E': 'justifyCenter',\n                  'CTRL+SHIFT+R': 'justifyRight',\n                  'CTRL+SHIFT+J': 'justifyFull',\n                  'CTRL+SHIFT+NUM7': 'insertUnorderedList',\n                  'CTRL+SHIFT+NUM8': 'insertOrderedList',\n                  'CTRL+LEFTBRACKET': 'outdent',\n                  'CTRL+RIGHTBRACKET': 'indent',\n                  'CTRL+NUM0': 'formatPara',\n                  'CTRL+NUM1': 'formatH1',\n                  'CTRL+NUM2': 'formatH2',\n                  'CTRL+NUM3': 'formatH3',\n                  'CTRL+NUM4': 'formatH4',\n                  'CTRL+NUM5': 'formatH5',\n                  'CTRL+NUM6': 'formatH6',\n                  'CTRL+ENTER': 'insertHorizontalRule',\n                  'CTRL+K': 'linkDialog.show'\n              },\n              mac: {\n                  'ENTER': 'insertParagraph',\n                  'CMD+Z': 'undo',\n                  'CMD+SHIFT+Z': 'redo',\n                  'TAB': 'tab',\n                  'SHIFT+TAB': 'untab',\n                  'CMD+B': 'bold',\n                  'CMD+I': 'italic',\n                  'CMD+U': 'underline',\n                  'CMD+SHIFT+S': 'strikethrough',\n                  'CMD+BACKSLASH': 'removeFormat',\n                  'CMD+SHIFT+L': 'justifyLeft',\n                  'CMD+SHIFT+E': 'justifyCenter',\n                  'CMD+SHIFT+R': 'justifyRight',\n                  'CMD+SHIFT+J': 'justifyFull',\n                  'CMD+SHIFT+NUM7': 'insertUnorderedList',\n                  'CMD+SHIFT+NUM8': 'insertOrderedList',\n                  'CMD+LEFTBRACKET': 'outdent',\n                  'CMD+RIGHTBRACKET': 'indent',\n                  'CMD+NUM0': 'formatPara',\n                  'CMD+NUM1': 'formatH1',\n                  'CMD+NUM2': 'formatH2',\n                  'CMD+NUM3': 'formatH3',\n                  'CMD+NUM4': 'formatH4',\n                  'CMD+NUM5': 'formatH5',\n                  'CMD+NUM6': 'formatH6',\n                  'CMD+ENTER': 'insertHorizontalRule',\n                  'CMD+K': 'linkDialog.show'\n              }\n          },\n          icons: {\n              'align': 'note-icon-align',\n              'alignCenter': 'note-icon-align-center',\n              'alignJustify': 'note-icon-align-justify',\n              'alignLeft': 'note-icon-align-left',\n              'alignRight': 'note-icon-align-right',\n              'rowBelow': 'note-icon-row-below',\n              'colBefore': 'note-icon-col-before',\n              'colAfter': 'note-icon-col-after',\n              'rowAbove': 'note-icon-row-above',\n              'rowRemove': 'note-icon-row-remove',\n              'colRemove': 'note-icon-col-remove',\n              'indent': 'note-icon-align-indent',\n              'outdent': 'note-icon-align-outdent',\n              'arrowsAlt': 'note-icon-arrows-alt',\n              'bold': 'note-icon-bold',\n              'caret': 'note-icon-caret',\n              'circle': 'note-icon-circle',\n              'close': 'note-icon-close',\n              'code': 'note-icon-code',\n              'eraser': 'note-icon-eraser',\n              'floatLeft': 'note-icon-float-left',\n              'floatRight': 'note-icon-float-right',\n              'font': 'note-icon-font',\n              'frame': 'note-icon-frame',\n              'italic': 'note-icon-italic',\n              'link': 'note-icon-link',\n              'unlink': 'note-icon-chain-broken',\n              'magic': 'note-icon-magic',\n              'menuCheck': 'note-icon-menu-check',\n              'minus': 'note-icon-minus',\n              'orderedlist': 'note-icon-orderedlist',\n              'pencil': 'note-icon-pencil',\n              'picture': 'note-icon-picture',\n              'question': 'note-icon-question',\n              'redo': 'note-icon-redo',\n              'rollback': 'note-icon-rollback',\n              'square': 'note-icon-square',\n              'strikethrough': 'note-icon-strikethrough',\n              'subscript': 'note-icon-subscript',\n              'superscript': 'note-icon-superscript',\n              'table': 'note-icon-table',\n              'textHeight': 'note-icon-text-height',\n              'trash': 'note-icon-trash',\n              'underline': 'note-icon-underline',\n              'undo': 'note-icon-undo',\n              'unorderedlist': 'note-icon-unorderedlist',\n              'video': 'note-icon-video'\n          }\n      }\n  });\n\n  $$1.summernote = $$1.extend($$1.summernote, {\n      ui: ui\n  });\n\n}));\n//# sourceMappingURL=summernote.js.map\n"
  },
  {
    "path": "makefile",
    "content": ".PHONY: docs\ndocs:\n\tjsdoc -c docs/conf.json\nmerge:\n\tpython merge.py\nbuild:\n\tpython build.py\nupdate_kennel:\n\tpython merge.py ; cd ../kennel ; C:/Users/acbart/Anaconda3/python.exe manage.py update_blockpy ; cd ../blockpy\nupdate_pedal:\n\tcp -R C:/Users/acbart/Projects/pedal/pedal/ C:/Users/acbart/Projects/skulpt/src/lib/ ; cd ../skulpt/ ; python skulpt.py dist --compile ; cd ../blockpy/\n"
  },
  {
    "path": "merge.py",
    "content": "nodejs_in = [\n         \"src/front.js\",\n         \"src/utilities.js\",\n         \"src/python_errors.js\",\n         \"src/ast_node_visitor.js\",\n         \"src/abstract_interpreter.js\",\n         \"src/pytifa.js\",\n         \"src/abstract_interpreter_definitions.js\",\n         \"src/treeMatching.js\",\n         \"src/sk_mod_instructor_extended.js\",\n         \"src/sk_mod_instructor.js\",\n         \"src/feedback.js\",\n         \"src/printer.js\",\n         \"src/engine.js\",\n            ]\n\njs_in = [\"src/front.js\",\n         \"src/utilities.js\",\n         #\"src/python_errors.js\",\n         #\"src/ast_node_visitor.js\",\n         #\"src/abstract_interpreter.js\",\n         #\"src/pytifa.js\",\n         #\"src/abstract_interpreter_definitions.js\",\n         \"src/python_to_blockly.js\",\n         \"src/treeMatching.js\",\n         #\"src/sk_mod_instructor_extended.js\",\n         \"src/sk_mod_instructor.js\",\n         \"src/imported.js\",\n         \"src/blockly_blocks/class.js\",\n         \"src/blockly_blocks/comment.js\",\n         \"src/blockly_blocks/comprehensions.js\",\n         \"src/blockly_blocks/dict.js\",\n         \"src/blockly_blocks/if.js\",\n         \"src/blockly_blocks/io.js\",\n         \"src/blockly_blocks/lists.js\",\n         \"src/blockly_blocks/sets.js\",\n         \"src/blockly_blocks/loops.js\",\n         \"src/blockly_blocks/parking.js\",\n         \"src/blockly_blocks/tuple.js\",\n         \"src/blockly_blocks/turtles.js\",\n         \"src/blockly_blocks/text.js\",\n         \"src/blockly_blocks/plots.js\",\n         \"src/dialog.js\",\n         \"src/storage.js\",\n         \"src/printer.js\",\n         \"src/interface.js\",\n         \"src/server.js\",\n         \"src/presentation.js\",\n         \"src/editor.js\",\n         \"src/corgis.js\",\n         \"src/history.js\",\n         \"src/english.js\",\n         \"src/feedback.js\",\n         \"src/toolbar.js\",\n         \"src/engine.js\",\n         \"src/main_v4.js\"]\ncss_in = ['src/blockpy.css']\n\n#js_out = 'kennel_dist/blockpy.js'\n#css_out = 'kennel_dist/blockpy.css'\njs_out = r'dist/blockpy.js'\nnodejs_out = r'dist/blockpy_node.js'\ncss_out = r'dist/blockpy.css'\n\nfor files_in, file_out in [ (js_in, js_out), (css_in, css_out), (nodejs_in, nodejs_out) ]:\n    with open(file_out, 'w') as outfile:\n        for fname in files_in:\n            with open(fname) as infile:\n                for line in infile:\n                    outfile.write(line)\n                outfile.write(\"\\n\")"
  },
  {
    "path": "npm-shrinkwrap.json",
    "content": "{\n  \"name\": \"blockpy\",\n  \"version\": \"1.0.0\",\n  \"lockfileVersion\": 3,\n  \"requires\": true,\n  \"packages\": {\n    \"\": {\n      \"name\": \"blockpy\",\n      \"version\": \"1.0.0\",\n      \"license\": \"ISC\",\n      \"devDependencies\": {\n        \"@babel/core\": \"7.0.0\",\n        \"@babel/preset-env\": \"7.11.0\",\n        \"babel-loader\": \"8.1.0\",\n        \"css-loader\": \"4.2.0\",\n        \"eslint\": \"5.0.0\",\n        \"eslint-loader\": \"4.0.2\",\n        \"jquery\": \"3.5.1\",\n        \"knockout\": \"3.5.1\",\n        \"mini-css-extract-plugin\": \"0.9.0\",\n        \"path\": \"0.12.7\",\n        \"webpack\": \"4.44.1\",\n        \"webpack-cli\": \"^4.2.0\",\n        \"yargs\": \"15.4.1\"\n      }\n    },\n    \"node_modules/@babel/code-frame\": {\n      \"version\": \"7.27.1\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz\",\n      \"integrity\": \"sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"@babel/helper-validator-identifier\": \"^7.27.1\",\n        \"js-tokens\": \"^4.0.0\",\n        \"picocolors\": \"^1.1.1\"\n      },\n      \"engines\": {\n        \"node\": \">=6.9.0\"\n      }\n    },\n    \"node_modules/@babel/compat-data\": {\n      \"version\": \"7.11.0\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.11.0.tgz\",\n      \"integrity\": \"sha512-TPSvJfv73ng0pfnEOh17bYMPQbI95+nGWc71Ss4vZdRBHTDqmM9Z8ZV4rYz8Ks7sfzc95n30k6ODIq5UGnXcYQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"browserslist\": \"^4.12.0\",\n        \"invariant\": \"^2.2.4\",\n        \"semver\": \"^5.5.0\"\n      }\n    },\n    \"node_modules/@babel/core\": {\n      \"version\": \"7.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/core/-/core-7.0.0.tgz\",\n      \"integrity\": \"sha512-nrvxS5u6QUN5gLl1GEakIcmOeoUHT1/gQtdMRq18WFURJ5osn4ppJLVSseMQo4zVWKJfBTF4muIYijXUnKlRLQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"@babel/code-frame\": \"^7.0.0\",\n        \"@babel/generator\": \"^7.0.0\",\n        \"@babel/helpers\": \"^7.0.0\",\n        \"@babel/parser\": \"^7.0.0\",\n        \"@babel/template\": \"^7.0.0\",\n        \"@babel/traverse\": \"^7.0.0\",\n        \"@babel/types\": \"^7.0.0\",\n        \"convert-source-map\": \"^1.1.0\",\n        \"debug\": \"^3.1.0\",\n        \"json5\": \"^0.5.0\",\n        \"lodash\": \"^4.17.10\",\n        \"resolve\": \"^1.3.2\",\n        \"semver\": \"^5.4.1\",\n        \"source-map\": \"^0.5.0\"\n      },\n      \"engines\": {\n        \"node\": \">=6.9.0\"\n      }\n    },\n    \"node_modules/@babel/core/node_modules/debug\": {\n      \"version\": \"3.2.7\",\n      \"resolved\": \"https://registry.npmjs.org/debug/-/debug-3.2.7.tgz\",\n      \"integrity\": \"sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"ms\": \"^2.1.1\"\n      }\n    },\n    \"node_modules/@babel/core/node_modules/json5\": {\n      \"version\": \"0.5.1\",\n      \"resolved\": \"https://registry.npmjs.org/json5/-/json5-0.5.1.tgz\",\n      \"integrity\": \"sha512-4xrs1aW+6N5DalkqSVA8fxh458CXvR99WU8WLKmq4v8eWAL86Xo3BVqyd3SkA9wEVjCMqyvvRRkshAdOnBp5rw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"bin\": {\n        \"json5\": \"lib/cli.js\"\n      }\n    },\n    \"node_modules/@babel/core/node_modules/ms\": {\n      \"version\": \"2.1.3\",\n      \"resolved\": \"https://registry.npmjs.org/ms/-/ms-2.1.3.tgz\",\n      \"integrity\": \"sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==\",\n      \"dev\": true,\n      \"license\": \"MIT\"\n    },\n    \"node_modules/@babel/generator\": {\n      \"version\": \"7.11.0\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/generator/-/generator-7.11.0.tgz\",\n      \"integrity\": \"sha512-fEm3Uzw7Mc9Xi//qU20cBKatTfs2aOtKqmvy/Vm7RkJEGFQ4xc9myCfbXxqK//ZS8MR/ciOHw6meGASJuKmDfQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/types\": \"^7.11.0\",\n        \"jsesc\": \"^2.5.1\",\n        \"source-map\": \"^0.5.0\"\n      }\n    },\n    \"node_modules/@babel/helper-annotate-as-pure\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.10.4.tgz\",\n      \"integrity\": \"sha512-XQlqKQP4vXFB7BN8fEEerrmYvHp3fK/rBkRFz9jaJbzK0B1DSfej9Kc7ZzE8Z/OnId1jpJdNAZ3BFQjWG68rcA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/types\": \"^7.10.4\"\n      }\n    },\n    \"node_modules/@babel/helper-builder-binary-assignment-operator-visitor\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.10.4.tgz\",\n      \"integrity\": \"sha512-L0zGlFrGWZK4PbT8AszSfLTM5sDU1+Az/En9VrdT8/LmEiJt4zXt+Jve9DCAnQcbqDhCI+29y/L93mrDzddCcg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-explode-assignable-expression\": \"^7.10.4\",\n        \"@babel/types\": \"^7.10.4\"\n      }\n    },\n    \"node_modules/@babel/helper-compilation-targets\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.10.4.tgz\",\n      \"integrity\": \"sha512-a3rYhlsGV0UHNDvrtOXBg8/OpfV0OKTkxKPzIplS1zpx7CygDcWWxckxZeDd3gzPzC4kUT0A4nVFDK0wGMh4MQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/compat-data\": \"^7.10.4\",\n        \"browserslist\": \"^4.12.0\",\n        \"invariant\": \"^2.2.4\",\n        \"levenary\": \"^1.1.1\",\n        \"semver\": \"^5.5.0\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0\"\n      }\n    },\n    \"node_modules/@babel/helper-create-class-features-plugin\": {\n      \"version\": \"7.10.5\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.10.5.tgz\",\n      \"integrity\": \"sha512-0nkdeijB7VlZoLT3r/mY3bUkw3T8WG/hNw+FATs/6+pG2039IJWjTYL0VTISqsNHMUTEnwbVnc89WIJX9Qed0A==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-function-name\": \"^7.10.4\",\n        \"@babel/helper-member-expression-to-functions\": \"^7.10.5\",\n        \"@babel/helper-optimise-call-expression\": \"^7.10.4\",\n        \"@babel/helper-plugin-utils\": \"^7.10.4\",\n        \"@babel/helper-replace-supers\": \"^7.10.4\",\n        \"@babel/helper-split-export-declaration\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0\"\n      }\n    },\n    \"node_modules/@babel/helper-create-regexp-features-plugin\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.10.4.tgz\",\n      \"integrity\": \"sha512-2/hu58IEPKeoLF45DBwx3XFqsbCXmkdAay4spVr2x0jYgRxrSNp+ePwvSsy9g6YSaNDcKIQVPXk1Ov8S2edk2g==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-annotate-as-pure\": \"^7.10.4\",\n        \"@babel/helper-regex\": \"^7.10.4\",\n        \"regexpu-core\": \"^4.7.0\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0\"\n      }\n    },\n    \"node_modules/@babel/helper-define-map\": {\n      \"version\": \"7.10.5\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.10.5.tgz\",\n      \"integrity\": \"sha512-fMw4kgFB720aQFXSVaXr79pjjcW5puTCM16+rECJ/plGS+zByelE8l9nCpV1GibxTnFVmUuYG9U8wYfQHdzOEQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-function-name\": \"^7.10.4\",\n        \"@babel/types\": \"^7.10.5\",\n        \"lodash\": \"^4.17.19\"\n      }\n    },\n    \"node_modules/@babel/helper-explode-assignable-expression\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.10.4.tgz\",\n      \"integrity\": \"sha512-4K71RyRQNPRrR85sr5QY4X3VwG4wtVoXZB9+L3r1Gp38DhELyHCtovqydRi7c1Ovb17eRGiQ/FD5s8JdU0Uy5A==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/traverse\": \"^7.10.4\",\n        \"@babel/types\": \"^7.10.4\"\n      }\n    },\n    \"node_modules/@babel/helper-function-name\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz\",\n      \"integrity\": \"sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-get-function-arity\": \"^7.10.4\",\n        \"@babel/template\": \"^7.10.4\",\n        \"@babel/types\": \"^7.10.4\"\n      }\n    },\n    \"node_modules/@babel/helper-get-function-arity\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz\",\n      \"integrity\": \"sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/types\": \"^7.10.4\"\n      }\n    },\n    \"node_modules/@babel/helper-hoist-variables\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.10.4.tgz\",\n      \"integrity\": \"sha512-wljroF5PgCk2juF69kanHVs6vrLwIPNp6DLD+Lrl3hoQ3PpPPikaDRNFA+0t81NOoMt2DL6WW/mdU8k4k6ZzuA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/types\": \"^7.10.4\"\n      }\n    },\n    \"node_modules/@babel/helper-member-expression-to-functions\": {\n      \"version\": \"7.11.0\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.11.0.tgz\",\n      \"integrity\": \"sha512-JbFlKHFntRV5qKw3YC0CvQnDZ4XMwgzzBbld7Ly4Mj4cbFy3KywcR8NtNctRToMWJOVvLINJv525Gd6wwVEx/Q==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/types\": \"^7.11.0\"\n      }\n    },\n    \"node_modules/@babel/helper-module-imports\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz\",\n      \"integrity\": \"sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/types\": \"^7.10.4\"\n      }\n    },\n    \"node_modules/@babel/helper-module-transforms\": {\n      \"version\": \"7.11.0\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.11.0.tgz\",\n      \"integrity\": \"sha512-02EVu8COMuTRO1TAzdMtpBPbe6aQ1w/8fePD2YgQmxZU4gpNWaL9gK3Jp7dxlkUlUCJOTaSeA+Hrm1BRQwqIhg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-module-imports\": \"^7.10.4\",\n        \"@babel/helper-replace-supers\": \"^7.10.4\",\n        \"@babel/helper-simple-access\": \"^7.10.4\",\n        \"@babel/helper-split-export-declaration\": \"^7.11.0\",\n        \"@babel/template\": \"^7.10.4\",\n        \"@babel/types\": \"^7.11.0\",\n        \"lodash\": \"^4.17.19\"\n      }\n    },\n    \"node_modules/@babel/helper-optimise-call-expression\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz\",\n      \"integrity\": \"sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/types\": \"^7.10.4\"\n      }\n    },\n    \"node_modules/@babel/helper-plugin-utils\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz\",\n      \"integrity\": \"sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==\",\n      \"dev\": true\n    },\n    \"node_modules/@babel/helper-regex\": {\n      \"version\": \"7.10.5\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.10.5.tgz\",\n      \"integrity\": \"sha512-68kdUAzDrljqBrio7DYAEgCoJHxppJOERHOgOrDN7WjOzP0ZQ1LsSDRXcemzVZaLvjaJsJEESb6qt+znNuENDg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"lodash\": \"^4.17.19\"\n      }\n    },\n    \"node_modules/@babel/helper-remap-async-to-generator\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.10.4.tgz\",\n      \"integrity\": \"sha512-86Lsr6NNw3qTNl+TBcF1oRZMaVzJtbWTyTko+CQL/tvNvcGYEFKbLXDPxtW0HKk3McNOk4KzY55itGWCAGK5tg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-annotate-as-pure\": \"^7.10.4\",\n        \"@babel/helper-wrap-function\": \"^7.10.4\",\n        \"@babel/template\": \"^7.10.4\",\n        \"@babel/traverse\": \"^7.10.4\",\n        \"@babel/types\": \"^7.10.4\"\n      }\n    },\n    \"node_modules/@babel/helper-replace-supers\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz\",\n      \"integrity\": \"sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-member-expression-to-functions\": \"^7.10.4\",\n        \"@babel/helper-optimise-call-expression\": \"^7.10.4\",\n        \"@babel/traverse\": \"^7.10.4\",\n        \"@babel/types\": \"^7.10.4\"\n      }\n    },\n    \"node_modules/@babel/helper-simple-access\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz\",\n      \"integrity\": \"sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/template\": \"^7.10.4\",\n        \"@babel/types\": \"^7.10.4\"\n      }\n    },\n    \"node_modules/@babel/helper-skip-transparent-expression-wrappers\": {\n      \"version\": \"7.11.0\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.11.0.tgz\",\n      \"integrity\": \"sha512-0XIdiQln4Elglgjbwo9wuJpL/K7AGCY26kmEt0+pRP0TAj4jjyNq1MjoRvikrTVqKcx4Gysxt4cXvVFXP/JO2Q==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/types\": \"^7.11.0\"\n      }\n    },\n    \"node_modules/@babel/helper-split-export-declaration\": {\n      \"version\": \"7.11.0\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz\",\n      \"integrity\": \"sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/types\": \"^7.11.0\"\n      }\n    },\n    \"node_modules/@babel/helper-string-parser\": {\n      \"version\": \"7.27.1\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz\",\n      \"integrity\": \"sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=6.9.0\"\n      }\n    },\n    \"node_modules/@babel/helper-validator-identifier\": {\n      \"version\": \"7.27.1\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz\",\n      \"integrity\": \"sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=6.9.0\"\n      }\n    },\n    \"node_modules/@babel/helper-wrap-function\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.10.4.tgz\",\n      \"integrity\": \"sha512-6py45WvEF0MhiLrdxtRjKjufwLL1/ob2qDJgg5JgNdojBAZSAKnAjkyOCNug6n+OBl4VW76XjvgSFTdaMcW0Ug==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-function-name\": \"^7.10.4\",\n        \"@babel/template\": \"^7.10.4\",\n        \"@babel/traverse\": \"^7.10.4\",\n        \"@babel/types\": \"^7.10.4\"\n      }\n    },\n    \"node_modules/@babel/helpers\": {\n      \"version\": \"7.28.3\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.3.tgz\",\n      \"integrity\": \"sha512-PTNtvUQihsAsDHMOP5pfobP8C6CM4JWXmP8DrEIt46c3r2bf87Ua1zoqevsMo9g+tWDwgWrFP5EIxuBx5RudAw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"@babel/template\": \"^7.27.2\",\n        \"@babel/types\": \"^7.28.2\"\n      },\n      \"engines\": {\n        \"node\": \">=6.9.0\"\n      }\n    },\n    \"node_modules/@babel/parser\": {\n      \"version\": \"7.28.3\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/parser/-/parser-7.28.3.tgz\",\n      \"integrity\": \"sha512-7+Ey1mAgYqFAx2h0RuoxcQT5+MlG3GTV0TQrgr7/ZliKsm/MNDxVVutlWaziMq7wJNAz8MTqz55XLpWvva6StA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"@babel/types\": \"^7.28.2\"\n      },\n      \"bin\": {\n        \"parser\": \"bin/babel-parser.js\"\n      },\n      \"engines\": {\n        \"node\": \">=6.0.0\"\n      }\n    },\n    \"node_modules/@babel/plugin-proposal-async-generator-functions\": {\n      \"version\": \"7.10.5\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.10.5.tgz\",\n      \"integrity\": \"sha512-cNMCVezQbrRGvXJwm9fu/1sJj9bHdGAgKodZdLqOQIpfoH3raqmRPBM17+lh7CzhiKRRBrGtZL9WcjxSoGYUSg==\",\n      \"deprecated\": \"This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead.\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\",\n        \"@babel/helper-remap-async-to-generator\": \"^7.10.4\",\n        \"@babel/plugin-syntax-async-generators\": \"^7.8.0\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-proposal-class-properties\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.10.4.tgz\",\n      \"integrity\": \"sha512-vhwkEROxzcHGNu2mzUC0OFFNXdZ4M23ib8aRRcJSsW8BZK9pQMD7QB7csl97NBbgGZO7ZyHUyKDnxzOaP4IrCg==\",\n      \"deprecated\": \"This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-create-class-features-plugin\": \"^7.10.4\",\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-proposal-dynamic-import\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.10.4.tgz\",\n      \"integrity\": \"sha512-up6oID1LeidOOASNXgv/CFbgBqTuKJ0cJjz6An5tWD+NVBNlp3VNSBxv2ZdU7SYl3NxJC7agAQDApZusV6uFwQ==\",\n      \"deprecated\": \"This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-dynamic-import instead.\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\",\n        \"@babel/plugin-syntax-dynamic-import\": \"^7.8.0\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-proposal-export-namespace-from\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.10.4.tgz\",\n      \"integrity\": \"sha512-aNdf0LY6/3WXkhh0Fdb6Zk9j1NMD8ovj3F6r0+3j837Pn1S1PdNtcwJ5EG9WkVPNHPxyJDaxMaAOVq4eki0qbg==\",\n      \"deprecated\": \"This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead.\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\",\n        \"@babel/plugin-syntax-export-namespace-from\": \"^7.8.3\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-proposal-json-strings\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.10.4.tgz\",\n      \"integrity\": \"sha512-fCL7QF0Jo83uy1K0P2YXrfX11tj3lkpN7l4dMv9Y9VkowkhkQDwFHFd8IiwyK5MZjE8UpbgokkgtcReH88Abaw==\",\n      \"deprecated\": \"This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-json-strings instead.\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\",\n        \"@babel/plugin-syntax-json-strings\": \"^7.8.0\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-proposal-logical-assignment-operators\": {\n      \"version\": \"7.11.0\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.11.0.tgz\",\n      \"integrity\": \"sha512-/f8p4z+Auz0Uaf+i8Ekf1iM7wUNLcViFUGiPxKeXvxTSl63B875YPiVdUDdem7hREcI0E0kSpEhS8tF5RphK7Q==\",\n      \"deprecated\": \"This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-logical-assignment-operators instead.\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\",\n        \"@babel/plugin-syntax-logical-assignment-operators\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-proposal-nullish-coalescing-operator\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.10.4.tgz\",\n      \"integrity\": \"sha512-wq5n1M3ZUlHl9sqT2ok1T2/MTt6AXE0e1Lz4WzWBr95LsAZ5qDXe4KnFuauYyEyLiohvXFMdbsOTMyLZs91Zlw==\",\n      \"deprecated\": \"This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\",\n        \"@babel/plugin-syntax-nullish-coalescing-operator\": \"^7.8.0\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-proposal-numeric-separator\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.10.4.tgz\",\n      \"integrity\": \"sha512-73/G7QoRoeNkLZFxsoCCvlg4ezE4eM+57PnOqgaPOozd5myfj7p0muD1mRVJvbUWbOzD+q3No2bWbaKy+DJ8DA==\",\n      \"deprecated\": \"This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\",\n        \"@babel/plugin-syntax-numeric-separator\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-proposal-object-rest-spread\": {\n      \"version\": \"7.11.0\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.11.0.tgz\",\n      \"integrity\": \"sha512-wzch41N4yztwoRw0ak+37wxwJM2oiIiy6huGCoqkvSTA9acYWcPfn9Y4aJqmFFJ70KTJUu29f3DQ43uJ9HXzEA==\",\n      \"deprecated\": \"This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\",\n        \"@babel/plugin-syntax-object-rest-spread\": \"^7.8.0\",\n        \"@babel/plugin-transform-parameters\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-proposal-optional-catch-binding\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.10.4.tgz\",\n      \"integrity\": \"sha512-LflT6nPh+GK2MnFiKDyLiqSqVHkQnVf7hdoAvyTnnKj9xB3docGRsdPuxp6qqqW19ifK3xgc9U5/FwrSaCNX5g==\",\n      \"deprecated\": \"This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-catch-binding instead.\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\",\n        \"@babel/plugin-syntax-optional-catch-binding\": \"^7.8.0\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-proposal-optional-chaining\": {\n      \"version\": \"7.11.0\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.11.0.tgz\",\n      \"integrity\": \"sha512-v9fZIu3Y8562RRwhm1BbMRxtqZNFmFA2EG+pT2diuU8PT3H6T/KXoZ54KgYisfOFZHV6PfvAiBIZ9Rcz+/JCxA==\",\n      \"deprecated\": \"This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\",\n        \"@babel/helper-skip-transparent-expression-wrappers\": \"^7.11.0\",\n        \"@babel/plugin-syntax-optional-chaining\": \"^7.8.0\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-proposal-private-methods\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.10.4.tgz\",\n      \"integrity\": \"sha512-wh5GJleuI8k3emgTg5KkJK6kHNsGEr0uBTDBuQUBJwckk9xs1ez79ioheEVVxMLyPscB0LfkbVHslQqIzWV6Bw==\",\n      \"deprecated\": \"This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead.\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-create-class-features-plugin\": \"^7.10.4\",\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-proposal-unicode-property-regex\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.10.4.tgz\",\n      \"integrity\": \"sha512-H+3fOgPnEXFL9zGYtKQe4IDOPKYlZdF1kqFDQRRb8PK4B8af1vAGK04tF5iQAAsui+mHNBQSAtd2/ndEDe9wuA==\",\n      \"deprecated\": \"This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-unicode-property-regex instead.\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-create-regexp-features-plugin\": \"^7.10.4\",\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-syntax-async-generators\": {\n      \"version\": \"7.8.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz\",\n      \"integrity\": \"sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.8.0\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-syntax-class-properties\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.10.4.tgz\",\n      \"integrity\": \"sha512-GCSBF7iUle6rNugfURwNmCGG3Z/2+opxAMLs1nND4bhEG5PuxTIggDBoeYYSujAlLtsupzOHYJQgPS3pivwXIA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-syntax-dynamic-import\": {\n      \"version\": \"7.8.3\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz\",\n      \"integrity\": \"sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.8.0\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-syntax-export-namespace-from\": {\n      \"version\": \"7.8.3\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz\",\n      \"integrity\": \"sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.8.3\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-syntax-json-strings\": {\n      \"version\": \"7.8.3\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz\",\n      \"integrity\": \"sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.8.0\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-syntax-logical-assignment-operators\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz\",\n      \"integrity\": \"sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-syntax-nullish-coalescing-operator\": {\n      \"version\": \"7.8.3\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz\",\n      \"integrity\": \"sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.8.0\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-syntax-numeric-separator\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz\",\n      \"integrity\": \"sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-syntax-object-rest-spread\": {\n      \"version\": \"7.8.3\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz\",\n      \"integrity\": \"sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.8.0\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-syntax-optional-catch-binding\": {\n      \"version\": \"7.8.3\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz\",\n      \"integrity\": \"sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.8.0\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-syntax-optional-chaining\": {\n      \"version\": \"7.8.3\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz\",\n      \"integrity\": \"sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.8.0\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-syntax-top-level-await\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.10.4.tgz\",\n      \"integrity\": \"sha512-ni1brg4lXEmWyafKr0ccFWkJG0CeMt4WV1oyeBW6EFObF4oOHclbkj5cARxAPQyAQ2UTuplJyK4nfkXIMMFvsQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-arrow-functions\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.10.4.tgz\",\n      \"integrity\": \"sha512-9J/oD1jV0ZCBcgnoFWFq1vJd4msoKb/TCpGNFyyLt0zABdcvgK3aYikZ8HjzB14c26bc7E3Q1yugpwGy2aTPNA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-async-to-generator\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.10.4.tgz\",\n      \"integrity\": \"sha512-F6nREOan7J5UXTLsDsZG3DXmZSVofr2tGNwfdrVwkDWHfQckbQXnXSPfD7iO+c/2HGqycwyLST3DnZ16n+cBJQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-module-imports\": \"^7.10.4\",\n        \"@babel/helper-plugin-utils\": \"^7.10.4\",\n        \"@babel/helper-remap-async-to-generator\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-block-scoped-functions\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.10.4.tgz\",\n      \"integrity\": \"sha512-WzXDarQXYYfjaV1szJvN3AD7rZgZzC1JtjJZ8dMHUyiK8mxPRahynp14zzNjU3VkPqPsO38CzxiWO1c9ARZ8JA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-block-scoping\": {\n      \"version\": \"7.11.1\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.11.1.tgz\",\n      \"integrity\": \"sha512-00dYeDE0EVEHuuM+26+0w/SCL0BH2Qy7LwHuI4Hi4MH5gkC8/AqMN5uWFJIsoXZrAphiMm1iXzBw6L2T+eA0ew==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-classes\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.10.4.tgz\",\n      \"integrity\": \"sha512-2oZ9qLjt161dn1ZE0Ms66xBncQH4In8Sqw1YWgBUZuGVJJS5c0OFZXL6dP2MRHrkU/eKhWg8CzFJhRQl50rQxA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-annotate-as-pure\": \"^7.10.4\",\n        \"@babel/helper-define-map\": \"^7.10.4\",\n        \"@babel/helper-function-name\": \"^7.10.4\",\n        \"@babel/helper-optimise-call-expression\": \"^7.10.4\",\n        \"@babel/helper-plugin-utils\": \"^7.10.4\",\n        \"@babel/helper-replace-supers\": \"^7.10.4\",\n        \"@babel/helper-split-export-declaration\": \"^7.10.4\",\n        \"globals\": \"^11.1.0\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-computed-properties\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.10.4.tgz\",\n      \"integrity\": \"sha512-JFwVDXcP/hM/TbyzGq3l/XWGut7p46Z3QvqFMXTfk6/09m7xZHJUN9xHfsv7vqqD4YnfI5ueYdSJtXqqBLyjBw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-destructuring\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.10.4.tgz\",\n      \"integrity\": \"sha512-+WmfvyfsyF603iPa6825mq6Qrb7uLjTOsa3XOFzlYcYDHSS4QmpOWOL0NNBY5qMbvrcf3tq0Cw+v4lxswOBpgA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-dotall-regex\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.10.4.tgz\",\n      \"integrity\": \"sha512-ZEAVvUTCMlMFAbASYSVQoxIbHm2OkG2MseW6bV2JjIygOjdVv8tuxrCTzj1+Rynh7ODb8GivUy7dzEXzEhuPaA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-create-regexp-features-plugin\": \"^7.10.4\",\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-duplicate-keys\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.10.4.tgz\",\n      \"integrity\": \"sha512-GL0/fJnmgMclHiBTTWXNlYjYsA7rDrtsazHG6mglaGSTh0KsrW04qml+Bbz9FL0LcJIRwBWL5ZqlNHKTkU3xAA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-exponentiation-operator\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.10.4.tgz\",\n      \"integrity\": \"sha512-S5HgLVgkBcRdyQAHbKj+7KyuWx8C6t5oETmUuwz1pt3WTWJhsUV0WIIXuVvfXMxl/QQyHKlSCNNtaIamG8fysw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-builder-binary-assignment-operator-visitor\": \"^7.10.4\",\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-for-of\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.10.4.tgz\",\n      \"integrity\": \"sha512-ItdQfAzu9AlEqmusA/65TqJ79eRcgGmpPPFvBnGILXZH975G0LNjP1yjHvGgfuCxqrPPueXOPe+FsvxmxKiHHQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-function-name\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.10.4.tgz\",\n      \"integrity\": \"sha512-OcDCq2y5+E0dVD5MagT5X+yTRbcvFjDI2ZVAottGH6tzqjx/LKpgkUepu3hp/u4tZBzxxpNGwLsAvGBvQ2mJzg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-function-name\": \"^7.10.4\",\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-literals\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.10.4.tgz\",\n      \"integrity\": \"sha512-Xd/dFSTEVuUWnyZiMu76/InZxLTYilOSr1UlHV+p115Z/Le2Fi1KXkJUYz0b42DfndostYlPub3m8ZTQlMaiqQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-member-expression-literals\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.10.4.tgz\",\n      \"integrity\": \"sha512-0bFOvPyAoTBhtcJLr9VcwZqKmSjFml1iVxvPL0ReomGU53CX53HsM4h2SzckNdkQcHox1bpAqzxBI1Y09LlBSw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-modules-amd\": {\n      \"version\": \"7.10.5\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.10.5.tgz\",\n      \"integrity\": \"sha512-elm5uruNio7CTLFItVC/rIzKLfQ17+fX7EVz5W0TMgIHFo1zY0Ozzx+lgwhL4plzl8OzVn6Qasx5DeEFyoNiRw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-module-transforms\": \"^7.10.5\",\n        \"@babel/helper-plugin-utils\": \"^7.10.4\",\n        \"babel-plugin-dynamic-import-node\": \"^2.3.3\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-modules-commonjs\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.10.4.tgz\",\n      \"integrity\": \"sha512-Xj7Uq5o80HDLlW64rVfDBhao6OX89HKUmb+9vWYaLXBZOma4gA6tw4Ni1O5qVDoZWUV0fxMYA0aYzOawz0l+1w==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-module-transforms\": \"^7.10.4\",\n        \"@babel/helper-plugin-utils\": \"^7.10.4\",\n        \"@babel/helper-simple-access\": \"^7.10.4\",\n        \"babel-plugin-dynamic-import-node\": \"^2.3.3\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-modules-systemjs\": {\n      \"version\": \"7.10.5\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.10.5.tgz\",\n      \"integrity\": \"sha512-f4RLO/OL14/FP1AEbcsWMzpbUz6tssRaeQg11RH1BP/XnPpRoVwgeYViMFacnkaw4k4wjRSjn3ip1Uw9TaXuMw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-hoist-variables\": \"^7.10.4\",\n        \"@babel/helper-module-transforms\": \"^7.10.5\",\n        \"@babel/helper-plugin-utils\": \"^7.10.4\",\n        \"babel-plugin-dynamic-import-node\": \"^2.3.3\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-modules-umd\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.10.4.tgz\",\n      \"integrity\": \"sha512-mohW5q3uAEt8T45YT7Qc5ws6mWgJAaL/8BfWD9Dodo1A3RKWli8wTS+WiQ/knF+tXlPirW/1/MqzzGfCExKECA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-module-transforms\": \"^7.10.4\",\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-named-capturing-groups-regex\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.10.4.tgz\",\n      \"integrity\": \"sha512-V6LuOnD31kTkxQPhKiVYzYC/Jgdq53irJC/xBSmqcNcqFGV+PER4l6rU5SH2Vl7bH9mLDHcc0+l9HUOe4RNGKA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-create-regexp-features-plugin\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-new-target\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.10.4.tgz\",\n      \"integrity\": \"sha512-YXwWUDAH/J6dlfwqlWsztI2Puz1NtUAubXhOPLQ5gjR/qmQ5U96DY4FQO8At33JN4XPBhrjB8I4eMmLROjjLjw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-object-super\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.10.4.tgz\",\n      \"integrity\": \"sha512-5iTw0JkdRdJvr7sY0vHqTpnruUpTea32JHmq/atIWqsnNussbRzjEDyWep8UNztt1B5IusBYg8Irb0bLbiEBCQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\",\n        \"@babel/helper-replace-supers\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-parameters\": {\n      \"version\": \"7.10.5\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.10.5.tgz\",\n      \"integrity\": \"sha512-xPHwUj5RdFV8l1wuYiu5S9fqWGM2DrYc24TMvUiRrPVm+SM3XeqU9BcokQX/kEUe+p2RBwy+yoiR1w/Blq6ubw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-get-function-arity\": \"^7.10.4\",\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-property-literals\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.10.4.tgz\",\n      \"integrity\": \"sha512-ofsAcKiUxQ8TY4sScgsGeR2vJIsfrzqvFb9GvJ5UdXDzl+MyYCaBj/FGzXuv7qE0aJcjWMILny1epqelnFlz8g==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-regenerator\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.10.4.tgz\",\n      \"integrity\": \"sha512-3thAHwtor39A7C04XucbMg17RcZ3Qppfxr22wYzZNcVIkPHfpM9J0SO8zuCV6SZa265kxBJSrfKTvDCYqBFXGw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"regenerator-transform\": \"^0.14.2\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-reserved-words\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.10.4.tgz\",\n      \"integrity\": \"sha512-hGsw1O6Rew1fkFbDImZIEqA8GoidwTAilwCyWqLBM9f+e/u/sQMQu7uX6dyokfOayRuuVfKOW4O7HvaBWM+JlQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-shorthand-properties\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.10.4.tgz\",\n      \"integrity\": \"sha512-AC2K/t7o07KeTIxMoHneyX90v3zkm5cjHJEokrPEAGEy3UCp8sLKfnfOIGdZ194fyN4wfX/zZUWT9trJZ0qc+Q==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-spread\": {\n      \"version\": \"7.11.0\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.11.0.tgz\",\n      \"integrity\": \"sha512-UwQYGOqIdQJe4aWNyS7noqAnN2VbaczPLiEtln+zPowRNlD+79w3oi2TWfYe0eZgd+gjZCbsydN7lzWysDt+gw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\",\n        \"@babel/helper-skip-transparent-expression-wrappers\": \"^7.11.0\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-sticky-regex\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.10.4.tgz\",\n      \"integrity\": \"sha512-Ddy3QZfIbEV0VYcVtFDCjeE4xwVTJWTmUtorAJkn6u/92Z/nWJNV+mILyqHKrUxXYKA2EoCilgoPePymKL4DvQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\",\n        \"@babel/helper-regex\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-template-literals\": {\n      \"version\": \"7.10.5\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.10.5.tgz\",\n      \"integrity\": \"sha512-V/lnPGIb+KT12OQikDvgSuesRX14ck5FfJXt6+tXhdkJ+Vsd0lDCVtF6jcB4rNClYFzaB2jusZ+lNISDk2mMMw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-annotate-as-pure\": \"^7.10.4\",\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-typeof-symbol\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.10.4.tgz\",\n      \"integrity\": \"sha512-QqNgYwuuW0y0H+kUE/GWSR45t/ccRhe14Fs/4ZRouNNQsyd4o3PG4OtHiIrepbM2WKUBDAXKCAK/Lk4VhzTaGA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-unicode-escapes\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.10.4.tgz\",\n      \"integrity\": \"sha512-y5XJ9waMti2J+e7ij20e+aH+fho7Wb7W8rNuu72aKRwCHFqQdhkdU2lo3uZ9tQuboEJcUFayXdARhcxLQ3+6Fg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/plugin-transform-unicode-regex\": {\n      \"version\": \"7.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.10.4.tgz\",\n      \"integrity\": \"sha512-wNfsc4s8N2qnIwpO/WP2ZiSyjfpTamT2C9V9FDH/Ljub9zw6P3SjkXcFmc0RQUt96k2fmIvtla2MMjgTwIAC+A==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-create-regexp-features-plugin\": \"^7.10.4\",\n        \"@babel/helper-plugin-utils\": \"^7.10.4\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/preset-env\": {\n      \"version\": \"7.11.0\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.11.0.tgz\",\n      \"integrity\": \"sha512-2u1/k7rG/gTh02dylX2kL3S0IJNF+J6bfDSp4DI2Ma8QN6Y9x9pmAax59fsCk6QUQG0yqH47yJWA+u1I1LccAg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/compat-data\": \"^7.11.0\",\n        \"@babel/helper-compilation-targets\": \"^7.10.4\",\n        \"@babel/helper-module-imports\": \"^7.10.4\",\n        \"@babel/helper-plugin-utils\": \"^7.10.4\",\n        \"@babel/plugin-proposal-async-generator-functions\": \"^7.10.4\",\n        \"@babel/plugin-proposal-class-properties\": \"^7.10.4\",\n        \"@babel/plugin-proposal-dynamic-import\": \"^7.10.4\",\n        \"@babel/plugin-proposal-export-namespace-from\": \"^7.10.4\",\n        \"@babel/plugin-proposal-json-strings\": \"^7.10.4\",\n        \"@babel/plugin-proposal-logical-assignment-operators\": \"^7.11.0\",\n        \"@babel/plugin-proposal-nullish-coalescing-operator\": \"^7.10.4\",\n        \"@babel/plugin-proposal-numeric-separator\": \"^7.10.4\",\n        \"@babel/plugin-proposal-object-rest-spread\": \"^7.11.0\",\n        \"@babel/plugin-proposal-optional-catch-binding\": \"^7.10.4\",\n        \"@babel/plugin-proposal-optional-chaining\": \"^7.11.0\",\n        \"@babel/plugin-proposal-private-methods\": \"^7.10.4\",\n        \"@babel/plugin-proposal-unicode-property-regex\": \"^7.10.4\",\n        \"@babel/plugin-syntax-async-generators\": \"^7.8.0\",\n        \"@babel/plugin-syntax-class-properties\": \"^7.10.4\",\n        \"@babel/plugin-syntax-dynamic-import\": \"^7.8.0\",\n        \"@babel/plugin-syntax-export-namespace-from\": \"^7.8.3\",\n        \"@babel/plugin-syntax-json-strings\": \"^7.8.0\",\n        \"@babel/plugin-syntax-logical-assignment-operators\": \"^7.10.4\",\n        \"@babel/plugin-syntax-nullish-coalescing-operator\": \"^7.8.0\",\n        \"@babel/plugin-syntax-numeric-separator\": \"^7.10.4\",\n        \"@babel/plugin-syntax-object-rest-spread\": \"^7.8.0\",\n        \"@babel/plugin-syntax-optional-catch-binding\": \"^7.8.0\",\n        \"@babel/plugin-syntax-optional-chaining\": \"^7.8.0\",\n        \"@babel/plugin-syntax-top-level-await\": \"^7.10.4\",\n        \"@babel/plugin-transform-arrow-functions\": \"^7.10.4\",\n        \"@babel/plugin-transform-async-to-generator\": \"^7.10.4\",\n        \"@babel/plugin-transform-block-scoped-functions\": \"^7.10.4\",\n        \"@babel/plugin-transform-block-scoping\": \"^7.10.4\",\n        \"@babel/plugin-transform-classes\": \"^7.10.4\",\n        \"@babel/plugin-transform-computed-properties\": \"^7.10.4\",\n        \"@babel/plugin-transform-destructuring\": \"^7.10.4\",\n        \"@babel/plugin-transform-dotall-regex\": \"^7.10.4\",\n        \"@babel/plugin-transform-duplicate-keys\": \"^7.10.4\",\n        \"@babel/plugin-transform-exponentiation-operator\": \"^7.10.4\",\n        \"@babel/plugin-transform-for-of\": \"^7.10.4\",\n        \"@babel/plugin-transform-function-name\": \"^7.10.4\",\n        \"@babel/plugin-transform-literals\": \"^7.10.4\",\n        \"@babel/plugin-transform-member-expression-literals\": \"^7.10.4\",\n        \"@babel/plugin-transform-modules-amd\": \"^7.10.4\",\n        \"@babel/plugin-transform-modules-commonjs\": \"^7.10.4\",\n        \"@babel/plugin-transform-modules-systemjs\": \"^7.10.4\",\n        \"@babel/plugin-transform-modules-umd\": \"^7.10.4\",\n        \"@babel/plugin-transform-named-capturing-groups-regex\": \"^7.10.4\",\n        \"@babel/plugin-transform-new-target\": \"^7.10.4\",\n        \"@babel/plugin-transform-object-super\": \"^7.10.4\",\n        \"@babel/plugin-transform-parameters\": \"^7.10.4\",\n        \"@babel/plugin-transform-property-literals\": \"^7.10.4\",\n        \"@babel/plugin-transform-regenerator\": \"^7.10.4\",\n        \"@babel/plugin-transform-reserved-words\": \"^7.10.4\",\n        \"@babel/plugin-transform-shorthand-properties\": \"^7.10.4\",\n        \"@babel/plugin-transform-spread\": \"^7.11.0\",\n        \"@babel/plugin-transform-sticky-regex\": \"^7.10.4\",\n        \"@babel/plugin-transform-template-literals\": \"^7.10.4\",\n        \"@babel/plugin-transform-typeof-symbol\": \"^7.10.4\",\n        \"@babel/plugin-transform-unicode-escapes\": \"^7.10.4\",\n        \"@babel/plugin-transform-unicode-regex\": \"^7.10.4\",\n        \"@babel/preset-modules\": \"^0.1.3\",\n        \"@babel/types\": \"^7.11.0\",\n        \"browserslist\": \"^4.12.0\",\n        \"core-js-compat\": \"^3.6.2\",\n        \"invariant\": \"^2.2.2\",\n        \"levenary\": \"^1.1.1\",\n        \"semver\": \"^5.5.0\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/preset-modules\": {\n      \"version\": \"0.1.3\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.3.tgz\",\n      \"integrity\": \"sha512-Ra3JXOHBq2xd56xSF7lMKXdjBn3T772Y1Wet3yWnkDly9zHvJki029tAFzvAAK5cf4YV3yoxuP61crYRol6SVg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/helper-plugin-utils\": \"^7.0.0\",\n        \"@babel/plugin-proposal-unicode-property-regex\": \"^7.4.4\",\n        \"@babel/plugin-transform-dotall-regex\": \"^7.4.4\",\n        \"@babel/types\": \"^7.4.4\",\n        \"esutils\": \"^2.0.2\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0-0\"\n      }\n    },\n    \"node_modules/@babel/runtime\": {\n      \"version\": \"7.11.2\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/runtime/-/runtime-7.11.2.tgz\",\n      \"integrity\": \"sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"regenerator-runtime\": \"^0.13.4\"\n      }\n    },\n    \"node_modules/@babel/template\": {\n      \"version\": \"7.27.2\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/template/-/template-7.27.2.tgz\",\n      \"integrity\": \"sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"@babel/code-frame\": \"^7.27.1\",\n        \"@babel/parser\": \"^7.27.2\",\n        \"@babel/types\": \"^7.27.1\"\n      },\n      \"engines\": {\n        \"node\": \">=6.9.0\"\n      }\n    },\n    \"node_modules/@babel/traverse\": {\n      \"version\": \"7.11.0\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.0.tgz\",\n      \"integrity\": \"sha512-ZB2V+LskoWKNpMq6E5UUCrjtDUh5IOTAyIl0dTjIEoXum/iKWkoIEKIRDnUucO6f+2FzNkE0oD4RLKoPIufDtg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/code-frame\": \"^7.10.4\",\n        \"@babel/generator\": \"^7.11.0\",\n        \"@babel/helper-function-name\": \"^7.10.4\",\n        \"@babel/helper-split-export-declaration\": \"^7.11.0\",\n        \"@babel/parser\": \"^7.11.0\",\n        \"@babel/types\": \"^7.11.0\",\n        \"debug\": \"^4.1.0\",\n        \"globals\": \"^11.1.0\",\n        \"lodash\": \"^4.17.19\"\n      }\n    },\n    \"node_modules/@babel/traverse/node_modules/debug\": {\n      \"version\": \"4.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/debug/-/debug-4.1.1.tgz\",\n      \"integrity\": \"sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==\",\n      \"deprecated\": \"Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"ms\": \"^2.1.1\"\n      }\n    },\n    \"node_modules/@babel/traverse/node_modules/ms\": {\n      \"version\": \"2.1.2\",\n      \"resolved\": \"https://registry.npmjs.org/ms/-/ms-2.1.2.tgz\",\n      \"integrity\": \"sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==\",\n      \"dev\": true\n    },\n    \"node_modules/@babel/types\": {\n      \"version\": \"7.28.2\",\n      \"resolved\": \"https://registry.npmjs.org/@babel/types/-/types-7.28.2.tgz\",\n      \"integrity\": \"sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"@babel/helper-string-parser\": \"^7.27.1\",\n        \"@babel/helper-validator-identifier\": \"^7.27.1\"\n      },\n      \"engines\": {\n        \"node\": \">=6.9.0\"\n      }\n    },\n    \"node_modules/@discoveryjs/json-ext\": {\n      \"version\": \"0.5.7\",\n      \"resolved\": \"https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz\",\n      \"integrity\": \"sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=10.0.0\"\n      }\n    },\n    \"node_modules/@types/color-name\": {\n      \"version\": \"1.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz\",\n      \"integrity\": \"sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==\",\n      \"dev\": true\n    },\n    \"node_modules/@types/json-schema\": {\n      \"version\": \"7.0.5\",\n      \"resolved\": \"https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.5.tgz\",\n      \"integrity\": \"sha512-7+2BITlgjgDhH0vvwZU/HZJVyk+2XUlvxXe8dFMedNX/aMkaOq++rMAFXc0tM7ij15QaWlbdQASBR9dihi+bDQ==\",\n      \"dev\": true\n    },\n    \"node_modules/@webassemblyjs/ast\": {\n      \"version\": \"1.9.0\",\n      \"resolved\": \"https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz\",\n      \"integrity\": \"sha512-C6wW5L+b7ogSDVqymbkkvuW9kruN//YisMED04xzeBBqjHa2FYnmvOlS6Xj68xWQRgWvI9cIglsjFowH/RJyEA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@webassemblyjs/helper-module-context\": \"1.9.0\",\n        \"@webassemblyjs/helper-wasm-bytecode\": \"1.9.0\",\n        \"@webassemblyjs/wast-parser\": \"1.9.0\"\n      }\n    },\n    \"node_modules/@webassemblyjs/floating-point-hex-parser\": {\n      \"version\": \"1.9.0\",\n      \"resolved\": \"https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.9.0.tgz\",\n      \"integrity\": \"sha512-TG5qcFsS8QB4g4MhrxK5TqfdNe7Ey/7YL/xN+36rRjl/BlGE/NcBvJcqsRgCP6Z92mRE+7N50pRIi8SmKUbcQA==\",\n      \"dev\": true\n    },\n    \"node_modules/@webassemblyjs/helper-api-error\": {\n      \"version\": \"1.9.0\",\n      \"resolved\": \"https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.9.0.tgz\",\n      \"integrity\": \"sha512-NcMLjoFMXpsASZFxJ5h2HZRcEhDkvnNFOAKneP5RbKRzaWJN36NC4jqQHKwStIhGXu5mUWlUUk7ygdtrO8lbmw==\",\n      \"dev\": true\n    },\n    \"node_modules/@webassemblyjs/helper-buffer\": {\n      \"version\": \"1.9.0\",\n      \"resolved\": \"https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.9.0.tgz\",\n      \"integrity\": \"sha512-qZol43oqhq6yBPx7YM3m9Bv7WMV9Eevj6kMi6InKOuZxhw+q9hOkvq5e/PpKSiLfyetpaBnogSbNCfBwyB00CA==\",\n      \"dev\": true\n    },\n    \"node_modules/@webassemblyjs/helper-code-frame\": {\n      \"version\": \"1.9.0\",\n      \"resolved\": \"https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.9.0.tgz\",\n      \"integrity\": \"sha512-ERCYdJBkD9Vu4vtjUYe8LZruWuNIToYq/ME22igL+2vj2dQ2OOujIZr3MEFvfEaqKoVqpsFKAGsRdBSBjrIvZA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@webassemblyjs/wast-printer\": \"1.9.0\"\n      }\n    },\n    \"node_modules/@webassemblyjs/helper-fsm\": {\n      \"version\": \"1.9.0\",\n      \"resolved\": \"https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.9.0.tgz\",\n      \"integrity\": \"sha512-OPRowhGbshCb5PxJ8LocpdX9Kl0uB4XsAjl6jH/dWKlk/mzsANvhwbiULsaiqT5GZGT9qinTICdj6PLuM5gslw==\",\n      \"dev\": true\n    },\n    \"node_modules/@webassemblyjs/helper-module-context\": {\n      \"version\": \"1.9.0\",\n      \"resolved\": \"https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.9.0.tgz\",\n      \"integrity\": \"sha512-MJCW8iGC08tMk2enck1aPW+BE5Cw8/7ph/VGZxwyvGbJwjktKkDK7vy7gAmMDx88D7mhDTCNKAW5tED+gZ0W8g==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@webassemblyjs/ast\": \"1.9.0\"\n      }\n    },\n    \"node_modules/@webassemblyjs/helper-wasm-bytecode\": {\n      \"version\": \"1.9.0\",\n      \"resolved\": \"https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.9.0.tgz\",\n      \"integrity\": \"sha512-R7FStIzyNcd7xKxCZH5lE0Bqy+hGTwS3LJjuv1ZVxd9O7eHCedSdrId/hMOd20I+v8wDXEn+bjfKDLzTepoaUw==\",\n      \"dev\": true\n    },\n    \"node_modules/@webassemblyjs/helper-wasm-section\": {\n      \"version\": \"1.9.0\",\n      \"resolved\": \"https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.9.0.tgz\",\n      \"integrity\": \"sha512-XnMB8l3ek4tvrKUUku+IVaXNHz2YsJyOOmz+MMkZvh8h1uSJpSen6vYnw3IoQ7WwEuAhL8Efjms1ZWjqh2agvw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@webassemblyjs/ast\": \"1.9.0\",\n        \"@webassemblyjs/helper-buffer\": \"1.9.0\",\n        \"@webassemblyjs/helper-wasm-bytecode\": \"1.9.0\",\n        \"@webassemblyjs/wasm-gen\": \"1.9.0\"\n      }\n    },\n    \"node_modules/@webassemblyjs/ieee754\": {\n      \"version\": \"1.9.0\",\n      \"resolved\": \"https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.9.0.tgz\",\n      \"integrity\": \"sha512-dcX8JuYU/gvymzIHc9DgxTzUUTLexWwt8uCTWP3otys596io0L5aW02Gb1RjYpx2+0Jus1h4ZFqjla7umFniTg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@xtuc/ieee754\": \"^1.2.0\"\n      }\n    },\n    \"node_modules/@webassemblyjs/leb128\": {\n      \"version\": \"1.9.0\",\n      \"resolved\": \"https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.9.0.tgz\",\n      \"integrity\": \"sha512-ENVzM5VwV1ojs9jam6vPys97B/S65YQtv/aanqnU7D8aSoHFX8GyhGg0CMfyKNIHBuAVjy3tlzd5QMMINa7wpw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@xtuc/long\": \"4.2.2\"\n      }\n    },\n    \"node_modules/@webassemblyjs/utf8\": {\n      \"version\": \"1.9.0\",\n      \"resolved\": \"https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.9.0.tgz\",\n      \"integrity\": \"sha512-GZbQlWtopBTP0u7cHrEx+73yZKrQoBMpwkGEIqlacljhXCkVM1kMQge/Mf+csMJAjEdSwhOyLAS0AoR3AG5P8w==\",\n      \"dev\": true\n    },\n    \"node_modules/@webassemblyjs/wasm-edit\": {\n      \"version\": \"1.9.0\",\n      \"resolved\": \"https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.9.0.tgz\",\n      \"integrity\": \"sha512-FgHzBm80uwz5M8WKnMTn6j/sVbqilPdQXTWraSjBwFXSYGirpkSWE2R9Qvz9tNiTKQvoKILpCuTjBKzOIm0nxw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@webassemblyjs/ast\": \"1.9.0\",\n        \"@webassemblyjs/helper-buffer\": \"1.9.0\",\n        \"@webassemblyjs/helper-wasm-bytecode\": \"1.9.0\",\n        \"@webassemblyjs/helper-wasm-section\": \"1.9.0\",\n        \"@webassemblyjs/wasm-gen\": \"1.9.0\",\n        \"@webassemblyjs/wasm-opt\": \"1.9.0\",\n        \"@webassemblyjs/wasm-parser\": \"1.9.0\",\n        \"@webassemblyjs/wast-printer\": \"1.9.0\"\n      }\n    },\n    \"node_modules/@webassemblyjs/wasm-gen\": {\n      \"version\": \"1.9.0\",\n      \"resolved\": \"https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.9.0.tgz\",\n      \"integrity\": \"sha512-cPE3o44YzOOHvlsb4+E9qSqjc9Qf9Na1OO/BHFy4OI91XDE14MjFN4lTMezzaIWdPqHnsTodGGNP+iRSYfGkjA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@webassemblyjs/ast\": \"1.9.0\",\n        \"@webassemblyjs/helper-wasm-bytecode\": \"1.9.0\",\n        \"@webassemblyjs/ieee754\": \"1.9.0\",\n        \"@webassemblyjs/leb128\": \"1.9.0\",\n        \"@webassemblyjs/utf8\": \"1.9.0\"\n      }\n    },\n    \"node_modules/@webassemblyjs/wasm-opt\": {\n      \"version\": \"1.9.0\",\n      \"resolved\": \"https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.9.0.tgz\",\n      \"integrity\": \"sha512-Qkjgm6Anhm+OMbIL0iokO7meajkzQD71ioelnfPEj6r4eOFuqm4YC3VBPqXjFyyNwowzbMD+hizmprP/Fwkl2A==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@webassemblyjs/ast\": \"1.9.0\",\n        \"@webassemblyjs/helper-buffer\": \"1.9.0\",\n        \"@webassemblyjs/wasm-gen\": \"1.9.0\",\n        \"@webassemblyjs/wasm-parser\": \"1.9.0\"\n      }\n    },\n    \"node_modules/@webassemblyjs/wasm-parser\": {\n      \"version\": \"1.9.0\",\n      \"resolved\": \"https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.9.0.tgz\",\n      \"integrity\": \"sha512-9+wkMowR2AmdSWQzsPEjFU7njh8HTO5MqO8vjwEHuM+AMHioNqSBONRdr0NQQ3dVQrzp0s8lTcYqzUdb7YgELA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@webassemblyjs/ast\": \"1.9.0\",\n        \"@webassemblyjs/helper-api-error\": \"1.9.0\",\n        \"@webassemblyjs/helper-wasm-bytecode\": \"1.9.0\",\n        \"@webassemblyjs/ieee754\": \"1.9.0\",\n        \"@webassemblyjs/leb128\": \"1.9.0\",\n        \"@webassemblyjs/utf8\": \"1.9.0\"\n      }\n    },\n    \"node_modules/@webassemblyjs/wast-parser\": {\n      \"version\": \"1.9.0\",\n      \"resolved\": \"https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.9.0.tgz\",\n      \"integrity\": \"sha512-qsqSAP3QQ3LyZjNC/0jBJ/ToSxfYJ8kYyuiGvtn/8MK89VrNEfwj7BPQzJVHi0jGTRK2dGdJ5PRqhtjzoww+bw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@webassemblyjs/ast\": \"1.9.0\",\n        \"@webassemblyjs/floating-point-hex-parser\": \"1.9.0\",\n        \"@webassemblyjs/helper-api-error\": \"1.9.0\",\n        \"@webassemblyjs/helper-code-frame\": \"1.9.0\",\n        \"@webassemblyjs/helper-fsm\": \"1.9.0\",\n        \"@xtuc/long\": \"4.2.2\"\n      }\n    },\n    \"node_modules/@webassemblyjs/wast-printer\": {\n      \"version\": \"1.9.0\",\n      \"resolved\": \"https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.9.0.tgz\",\n      \"integrity\": \"sha512-2J0nE95rHXHyQ24cWjMKJ1tqB/ds8z/cyeOZxJhcb+rW+SQASVjuznUSmdz5GpVJTzU8JkhYut0D3siFDD6wsA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@webassemblyjs/ast\": \"1.9.0\",\n        \"@webassemblyjs/wast-parser\": \"1.9.0\",\n        \"@xtuc/long\": \"4.2.2\"\n      }\n    },\n    \"node_modules/@webpack-cli/configtest\": {\n      \"version\": \"1.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.2.0.tgz\",\n      \"integrity\": \"sha512-4FB8Tj6xyVkyqjj1OaTqCjXYULB9FMkqQ8yGrZjRDrYh0nOE+7Lhs45WioWQQMV+ceFlE368Ukhe6xdvJM9Egg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"peerDependencies\": {\n        \"webpack\": \"4.x.x || 5.x.x\",\n        \"webpack-cli\": \"4.x.x\"\n      }\n    },\n    \"node_modules/@webpack-cli/info\": {\n      \"version\": \"1.5.0\",\n      \"resolved\": \"https://registry.npmjs.org/@webpack-cli/info/-/info-1.5.0.tgz\",\n      \"integrity\": \"sha512-e8tSXZpw2hPl2uMJY6fsMswaok5FdlGNRTktvFk2sD8RjH0hE2+XistawJx1vmKteh4NmGmNUrp+Tb2w+udPcQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"envinfo\": \"^7.7.3\"\n      },\n      \"peerDependencies\": {\n        \"webpack-cli\": \"4.x.x\"\n      }\n    },\n    \"node_modules/@webpack-cli/serve\": {\n      \"version\": \"1.7.0\",\n      \"resolved\": \"https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.7.0.tgz\",\n      \"integrity\": \"sha512-oxnCNGj88fL+xzV+dacXs44HcDwf1ovs3AuEzvP7mqXw7fQntqIhQ1BRmynh4qEKQSSSRSWVyXRjmTbZIX9V2Q==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"peerDependencies\": {\n        \"webpack-cli\": \"4.x.x\"\n      },\n      \"peerDependenciesMeta\": {\n        \"webpack-dev-server\": {\n          \"optional\": true\n        }\n      }\n    },\n    \"node_modules/@xtuc/ieee754\": {\n      \"version\": \"1.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz\",\n      \"integrity\": \"sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==\",\n      \"dev\": true\n    },\n    \"node_modules/@xtuc/long\": {\n      \"version\": \"4.2.2\",\n      \"resolved\": \"https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz\",\n      \"integrity\": \"sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==\",\n      \"dev\": true\n    },\n    \"node_modules/acorn\": {\n      \"version\": \"6.4.1\",\n      \"resolved\": \"https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz\",\n      \"integrity\": \"sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==\",\n      \"dev\": true,\n      \"bin\": {\n        \"acorn\": \"bin/acorn\"\n      },\n      \"engines\": {\n        \"node\": \">=0.4.0\"\n      }\n    },\n    \"node_modules/acorn-jsx\": {\n      \"version\": \"5.3.2\",\n      \"resolved\": \"https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz\",\n      \"integrity\": \"sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"peerDependencies\": {\n        \"acorn\": \"^6.0.0 || ^7.0.0 || ^8.0.0\"\n      }\n    },\n    \"node_modules/ajv\": {\n      \"version\": \"6.12.3\",\n      \"resolved\": \"https://registry.npmjs.org/ajv/-/ajv-6.12.3.tgz\",\n      \"integrity\": \"sha512-4K0cK3L1hsqk9xIb2z9vs/XU+PGJZ9PNpJRDS9YLzmNdX6jmVPfamLvTJr0aDAusnHyCHO6MjzlkAsgtqp9teA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"fast-deep-equal\": \"^3.1.1\",\n        \"fast-json-stable-stringify\": \"^2.0.0\",\n        \"json-schema-traverse\": \"^0.4.1\",\n        \"uri-js\": \"^4.2.2\"\n      },\n      \"funding\": {\n        \"type\": \"github\",\n        \"url\": \"https://github.com/sponsors/epoberezkin\"\n      }\n    },\n    \"node_modules/ajv-errors\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz\",\n      \"integrity\": \"sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==\",\n      \"dev\": true,\n      \"peerDependencies\": {\n        \"ajv\": \">=5.0.0\"\n      }\n    },\n    \"node_modules/ajv-keywords\": {\n      \"version\": \"3.5.2\",\n      \"resolved\": \"https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz\",\n      \"integrity\": \"sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==\",\n      \"dev\": true,\n      \"peerDependencies\": {\n        \"ajv\": \"^6.9.1\"\n      }\n    },\n    \"node_modules/ansi-escapes\": {\n      \"version\": \"3.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz\",\n      \"integrity\": \"sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/ansi-regex\": {\n      \"version\": \"5.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz\",\n      \"integrity\": \"sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/ansi-styles\": {\n      \"version\": \"4.2.1\",\n      \"resolved\": \"https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz\",\n      \"integrity\": \"sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@types/color-name\": \"^1.1.1\",\n        \"color-convert\": \"^2.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/chalk/ansi-styles?sponsor=1\"\n      }\n    },\n    \"node_modules/anymatch\": {\n      \"version\": \"3.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz\",\n      \"integrity\": \"sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==\",\n      \"dev\": true,\n      \"optional\": true,\n      \"dependencies\": {\n        \"normalize-path\": \"^3.0.0\",\n        \"picomatch\": \"^2.0.4\"\n      },\n      \"engines\": {\n        \"node\": \">= 8\"\n      }\n    },\n    \"node_modules/aproba\": {\n      \"version\": \"1.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz\",\n      \"integrity\": \"sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==\",\n      \"dev\": true\n    },\n    \"node_modules/argparse\": {\n      \"version\": \"1.0.10\",\n      \"resolved\": \"https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz\",\n      \"integrity\": \"sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"sprintf-js\": \"~1.0.2\"\n      }\n    },\n    \"node_modules/arr-diff\": {\n      \"version\": \"4.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz\",\n      \"integrity\": \"sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/arr-flatten\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz\",\n      \"integrity\": \"sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/arr-union\": {\n      \"version\": \"3.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz\",\n      \"integrity\": \"sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/array-buffer-byte-length\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz\",\n      \"integrity\": \"sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bound\": \"^1.0.3\",\n        \"is-array-buffer\": \"^3.0.5\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/array-unique\": {\n      \"version\": \"0.3.2\",\n      \"resolved\": \"https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz\",\n      \"integrity\": \"sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/arraybuffer.prototype.slice\": {\n      \"version\": \"1.0.4\",\n      \"resolved\": \"https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz\",\n      \"integrity\": \"sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"array-buffer-byte-length\": \"^1.0.1\",\n        \"call-bind\": \"^1.0.8\",\n        \"define-properties\": \"^1.2.1\",\n        \"es-abstract\": \"^1.23.5\",\n        \"es-errors\": \"^1.3.0\",\n        \"get-intrinsic\": \"^1.2.6\",\n        \"is-array-buffer\": \"^3.0.4\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/asn1.js\": {\n      \"version\": \"4.10.1\",\n      \"resolved\": \"https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz\",\n      \"integrity\": \"sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"bn.js\": \"^4.0.0\",\n        \"inherits\": \"^2.0.1\",\n        \"minimalistic-assert\": \"^1.0.0\"\n      }\n    },\n    \"node_modules/asn1.js/node_modules/bn.js\": {\n      \"version\": \"4.11.9\",\n      \"resolved\": \"https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz\",\n      \"integrity\": \"sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==\",\n      \"dev\": true\n    },\n    \"node_modules/assert\": {\n      \"version\": \"1.5.0\",\n      \"resolved\": \"https://registry.npmjs.org/assert/-/assert-1.5.0.tgz\",\n      \"integrity\": \"sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"object-assign\": \"^4.1.1\",\n        \"util\": \"0.10.3\"\n      }\n    },\n    \"node_modules/assert/node_modules/inherits\": {\n      \"version\": \"2.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz\",\n      \"integrity\": \"sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=\",\n      \"dev\": true\n    },\n    \"node_modules/assert/node_modules/util\": {\n      \"version\": \"0.10.3\",\n      \"resolved\": \"https://registry.npmjs.org/util/-/util-0.10.3.tgz\",\n      \"integrity\": \"sha1-evsa/lCAUkZInj23/g7TeTNqwPk=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"inherits\": \"2.0.1\"\n      }\n    },\n    \"node_modules/assign-symbols\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz\",\n      \"integrity\": \"sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/async-each\": {\n      \"version\": \"1.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz\",\n      \"integrity\": \"sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==\",\n      \"dev\": true,\n      \"optional\": true\n    },\n    \"node_modules/async-function\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz\",\n      \"integrity\": \"sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      }\n    },\n    \"node_modules/atob\": {\n      \"version\": \"2.1.2\",\n      \"resolved\": \"https://registry.npmjs.org/atob/-/atob-2.1.2.tgz\",\n      \"integrity\": \"sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==\",\n      \"dev\": true,\n      \"bin\": {\n        \"atob\": \"bin/atob.js\"\n      },\n      \"engines\": {\n        \"node\": \">= 4.5.0\"\n      }\n    },\n    \"node_modules/available-typed-arrays\": {\n      \"version\": \"1.0.7\",\n      \"resolved\": \"https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz\",\n      \"integrity\": \"sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"possible-typed-array-names\": \"^1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/babel-code-frame\": {\n      \"version\": \"6.26.0\",\n      \"resolved\": \"https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz\",\n      \"integrity\": \"sha512-XqYMR2dfdGMW+hd0IUZ2PwK+fGeFkOxZJ0wY+JaQAHzt1Zx8LcvpiZD2NiGkEG8qx0CfkAOr5xt76d1e8vG90g==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"chalk\": \"^1.1.3\",\n        \"esutils\": \"^2.0.2\",\n        \"js-tokens\": \"^3.0.2\"\n      }\n    },\n    \"node_modules/babel-code-frame/node_modules/ansi-regex\": {\n      \"version\": \"2.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz\",\n      \"integrity\": \"sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/babel-code-frame/node_modules/ansi-styles\": {\n      \"version\": \"2.2.1\",\n      \"resolved\": \"https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz\",\n      \"integrity\": \"sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/babel-code-frame/node_modules/chalk\": {\n      \"version\": \"1.1.3\",\n      \"resolved\": \"https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz\",\n      \"integrity\": \"sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"ansi-styles\": \"^2.2.1\",\n        \"escape-string-regexp\": \"^1.0.2\",\n        \"has-ansi\": \"^2.0.0\",\n        \"strip-ansi\": \"^3.0.0\",\n        \"supports-color\": \"^2.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/babel-code-frame/node_modules/js-tokens\": {\n      \"version\": \"3.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz\",\n      \"integrity\": \"sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg==\",\n      \"dev\": true,\n      \"license\": \"MIT\"\n    },\n    \"node_modules/babel-code-frame/node_modules/strip-ansi\": {\n      \"version\": \"3.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz\",\n      \"integrity\": \"sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"ansi-regex\": \"^2.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/babel-code-frame/node_modules/supports-color\": {\n      \"version\": \"2.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz\",\n      \"integrity\": \"sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=0.8.0\"\n      }\n    },\n    \"node_modules/babel-loader\": {\n      \"version\": \"8.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/babel-loader/-/babel-loader-8.1.0.tgz\",\n      \"integrity\": \"sha512-7q7nC1tYOrqvUrN3LQK4GwSk/TQorZSOlO9C+RZDZpODgyN4ZlCqE5q9cDsyWOliN+aU9B4JX01xK9eJXowJLw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"find-cache-dir\": \"^2.1.0\",\n        \"loader-utils\": \"^1.4.0\",\n        \"mkdirp\": \"^0.5.3\",\n        \"pify\": \"^4.0.1\",\n        \"schema-utils\": \"^2.6.5\"\n      },\n      \"engines\": {\n        \"node\": \">= 6.9\"\n      },\n      \"peerDependencies\": {\n        \"@babel/core\": \"^7.0.0\",\n        \"webpack\": \">=2\"\n      }\n    },\n    \"node_modules/babel-loader/node_modules/schema-utils\": {\n      \"version\": \"2.7.0\",\n      \"resolved\": \"https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz\",\n      \"integrity\": \"sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@types/json-schema\": \"^7.0.4\",\n        \"ajv\": \"^6.12.2\",\n        \"ajv-keywords\": \"^3.4.1\"\n      },\n      \"engines\": {\n        \"node\": \">= 8.9.0\"\n      },\n      \"funding\": {\n        \"type\": \"opencollective\",\n        \"url\": \"https://opencollective.com/webpack\"\n      }\n    },\n    \"node_modules/babel-plugin-dynamic-import-node\": {\n      \"version\": \"2.3.3\",\n      \"resolved\": \"https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz\",\n      \"integrity\": \"sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"object.assign\": \"^4.1.0\"\n      }\n    },\n    \"node_modules/balanced-match\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz\",\n      \"integrity\": \"sha1-ibTRmasr7kneFk6gK4nORi1xt2c=\",\n      \"dev\": true\n    },\n    \"node_modules/base\": {\n      \"version\": \"0.11.2\",\n      \"resolved\": \"https://registry.npmjs.org/base/-/base-0.11.2.tgz\",\n      \"integrity\": \"sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"cache-base\": \"^1.0.1\",\n        \"class-utils\": \"^0.3.5\",\n        \"component-emitter\": \"^1.2.1\",\n        \"define-property\": \"^1.0.0\",\n        \"isobject\": \"^3.0.1\",\n        \"mixin-deep\": \"^1.2.0\",\n        \"pascalcase\": \"^0.1.1\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/base/node_modules/define-property\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz\",\n      \"integrity\": \"sha1-dp66rz9KY6rTr56NMEybvnm/sOY=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-descriptor\": \"^1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/base/node_modules/is-accessor-descriptor\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz\",\n      \"integrity\": \"sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==\",\n      \"deprecated\": \"Please upgrade to v1.0.1\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"kind-of\": \"^6.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/base/node_modules/is-data-descriptor\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz\",\n      \"integrity\": \"sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==\",\n      \"deprecated\": \"Please upgrade to v1.0.1\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"kind-of\": \"^6.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/base/node_modules/is-descriptor\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz\",\n      \"integrity\": \"sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-accessor-descriptor\": \"^1.0.0\",\n        \"is-data-descriptor\": \"^1.0.0\",\n        \"kind-of\": \"^6.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/base64-js\": {\n      \"version\": \"1.3.1\",\n      \"resolved\": \"https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz\",\n      \"integrity\": \"sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==\",\n      \"dev\": true\n    },\n    \"node_modules/big.js\": {\n      \"version\": \"5.2.2\",\n      \"resolved\": \"https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz\",\n      \"integrity\": \"sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \"*\"\n      }\n    },\n    \"node_modules/binary-extensions\": {\n      \"version\": \"2.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz\",\n      \"integrity\": \"sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==\",\n      \"dev\": true,\n      \"optional\": true,\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/bluebird\": {\n      \"version\": \"3.7.2\",\n      \"resolved\": \"https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz\",\n      \"integrity\": \"sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==\",\n      \"dev\": true\n    },\n    \"node_modules/bn.js\": {\n      \"version\": \"5.1.2\",\n      \"resolved\": \"https://registry.npmjs.org/bn.js/-/bn.js-5.1.2.tgz\",\n      \"integrity\": \"sha512-40rZaf3bUNKTVYu9sIeeEGOg7g14Yvnj9kH7b50EiwX0Q7A6umbvfI5tvHaOERH0XigqKkfLkFQxzb4e6CIXnA==\",\n      \"dev\": true\n    },\n    \"node_modules/brace-expansion\": {\n      \"version\": \"1.1.11\",\n      \"resolved\": \"https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz\",\n      \"integrity\": \"sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"balanced-match\": \"^1.0.0\",\n        \"concat-map\": \"0.0.1\"\n      }\n    },\n    \"node_modules/braces\": {\n      \"version\": \"2.3.2\",\n      \"resolved\": \"https://registry.npmjs.org/braces/-/braces-2.3.2.tgz\",\n      \"integrity\": \"sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"arr-flatten\": \"^1.1.0\",\n        \"array-unique\": \"^0.3.2\",\n        \"extend-shallow\": \"^2.0.1\",\n        \"fill-range\": \"^4.0.0\",\n        \"isobject\": \"^3.0.1\",\n        \"repeat-element\": \"^1.1.2\",\n        \"snapdragon\": \"^0.8.1\",\n        \"snapdragon-node\": \"^2.0.1\",\n        \"split-string\": \"^3.0.2\",\n        \"to-regex\": \"^3.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/braces/node_modules/extend-shallow\": {\n      \"version\": \"2.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz\",\n      \"integrity\": \"sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-extendable\": \"^0.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/brorand\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz\",\n      \"integrity\": \"sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=\",\n      \"dev\": true\n    },\n    \"node_modules/browserify-aes\": {\n      \"version\": \"1.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz\",\n      \"integrity\": \"sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"buffer-xor\": \"^1.0.3\",\n        \"cipher-base\": \"^1.0.0\",\n        \"create-hash\": \"^1.1.0\",\n        \"evp_bytestokey\": \"^1.0.3\",\n        \"inherits\": \"^2.0.1\",\n        \"safe-buffer\": \"^5.0.1\"\n      }\n    },\n    \"node_modules/browserify-cipher\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz\",\n      \"integrity\": \"sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"browserify-aes\": \"^1.0.4\",\n        \"browserify-des\": \"^1.0.0\",\n        \"evp_bytestokey\": \"^1.0.0\"\n      }\n    },\n    \"node_modules/browserify-des\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz\",\n      \"integrity\": \"sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"cipher-base\": \"^1.0.1\",\n        \"des.js\": \"^1.0.0\",\n        \"inherits\": \"^2.0.1\",\n        \"safe-buffer\": \"^5.1.2\"\n      }\n    },\n    \"node_modules/browserify-rsa\": {\n      \"version\": \"4.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz\",\n      \"integrity\": \"sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"bn.js\": \"^4.1.0\",\n        \"randombytes\": \"^2.0.1\"\n      }\n    },\n    \"node_modules/browserify-rsa/node_modules/bn.js\": {\n      \"version\": \"4.11.9\",\n      \"resolved\": \"https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz\",\n      \"integrity\": \"sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==\",\n      \"dev\": true\n    },\n    \"node_modules/browserify-sign\": {\n      \"version\": \"4.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.0.tgz\",\n      \"integrity\": \"sha512-hEZC1KEeYuoHRqhGhTy6gWrpJA3ZDjFWv0DE61643ZnOXAKJb3u7yWcrU0mMc9SwAqK1n7myPGndkp0dFG7NFA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"bn.js\": \"^5.1.1\",\n        \"browserify-rsa\": \"^4.0.1\",\n        \"create-hash\": \"^1.2.0\",\n        \"create-hmac\": \"^1.1.7\",\n        \"elliptic\": \"^6.5.2\",\n        \"inherits\": \"^2.0.4\",\n        \"parse-asn1\": \"^5.1.5\",\n        \"readable-stream\": \"^3.6.0\",\n        \"safe-buffer\": \"^5.2.0\"\n      }\n    },\n    \"node_modules/browserify-sign/node_modules/readable-stream\": {\n      \"version\": \"3.6.0\",\n      \"resolved\": \"https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz\",\n      \"integrity\": \"sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"inherits\": \"^2.0.3\",\n        \"string_decoder\": \"^1.1.1\",\n        \"util-deprecate\": \"^1.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">= 6\"\n      }\n    },\n    \"node_modules/browserify-sign/node_modules/safe-buffer\": {\n      \"version\": \"5.2.1\",\n      \"resolved\": \"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz\",\n      \"integrity\": \"sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==\",\n      \"dev\": true,\n      \"funding\": [\n        {\n          \"type\": \"github\",\n          \"url\": \"https://github.com/sponsors/feross\"\n        },\n        {\n          \"type\": \"patreon\",\n          \"url\": \"https://www.patreon.com/feross\"\n        },\n        {\n          \"type\": \"consulting\",\n          \"url\": \"https://feross.org/support\"\n        }\n      ]\n    },\n    \"node_modules/browserify-zlib\": {\n      \"version\": \"0.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz\",\n      \"integrity\": \"sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"pako\": \"~1.0.5\"\n      }\n    },\n    \"node_modules/browserslist\": {\n      \"version\": \"4.13.0\",\n      \"resolved\": \"https://registry.npmjs.org/browserslist/-/browserslist-4.13.0.tgz\",\n      \"integrity\": \"sha512-MINatJ5ZNrLnQ6blGvePd/QOz9Xtu+Ne+x29iQSCHfkU5BugKVJwZKn/iiL8UbpIpa3JhviKjz+XxMo0m2caFQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"caniuse-lite\": \"^1.0.30001093\",\n        \"electron-to-chromium\": \"^1.3.488\",\n        \"escalade\": \"^3.0.1\",\n        \"node-releases\": \"^1.1.58\"\n      },\n      \"bin\": {\n        \"browserslist\": \"cli.js\"\n      },\n      \"engines\": {\n        \"node\": \"^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7\"\n      },\n      \"funding\": {\n        \"type\": \"tidelift\",\n        \"url\": \"https://tidelift.com/funding/github/npm/browserslist\"\n      }\n    },\n    \"node_modules/buffer\": {\n      \"version\": \"4.9.2\",\n      \"resolved\": \"https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz\",\n      \"integrity\": \"sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"base64-js\": \"^1.0.2\",\n        \"ieee754\": \"^1.1.4\",\n        \"isarray\": \"^1.0.0\"\n      }\n    },\n    \"node_modules/buffer-from\": {\n      \"version\": \"1.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz\",\n      \"integrity\": \"sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==\",\n      \"dev\": true\n    },\n    \"node_modules/buffer-xor\": {\n      \"version\": \"1.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz\",\n      \"integrity\": \"sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=\",\n      \"dev\": true\n    },\n    \"node_modules/builtin-status-codes\": {\n      \"version\": \"3.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz\",\n      \"integrity\": \"sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=\",\n      \"dev\": true\n    },\n    \"node_modules/cacache\": {\n      \"version\": \"12.0.4\",\n      \"resolved\": \"https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz\",\n      \"integrity\": \"sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"bluebird\": \"^3.5.5\",\n        \"chownr\": \"^1.1.1\",\n        \"figgy-pudding\": \"^3.5.1\",\n        \"glob\": \"^7.1.4\",\n        \"graceful-fs\": \"^4.1.15\",\n        \"infer-owner\": \"^1.0.3\",\n        \"lru-cache\": \"^5.1.1\",\n        \"mississippi\": \"^3.0.0\",\n        \"mkdirp\": \"^0.5.1\",\n        \"move-concurrently\": \"^1.0.1\",\n        \"promise-inflight\": \"^1.0.1\",\n        \"rimraf\": \"^2.6.3\",\n        \"ssri\": \"^6.0.1\",\n        \"unique-filename\": \"^1.1.1\",\n        \"y18n\": \"^4.0.0\"\n      }\n    },\n    \"node_modules/cache-base\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz\",\n      \"integrity\": \"sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"collection-visit\": \"^1.0.0\",\n        \"component-emitter\": \"^1.2.1\",\n        \"get-value\": \"^2.0.6\",\n        \"has-value\": \"^1.0.0\",\n        \"isobject\": \"^3.0.1\",\n        \"set-value\": \"^2.0.0\",\n        \"to-object-path\": \"^0.3.0\",\n        \"union-value\": \"^1.0.0\",\n        \"unset-value\": \"^1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/call-bind\": {\n      \"version\": \"1.0.8\",\n      \"resolved\": \"https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz\",\n      \"integrity\": \"sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bind-apply-helpers\": \"^1.0.0\",\n        \"es-define-property\": \"^1.0.0\",\n        \"get-intrinsic\": \"^1.2.4\",\n        \"set-function-length\": \"^1.2.2\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/call-bind-apply-helpers\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz\",\n      \"integrity\": \"sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"es-errors\": \"^1.3.0\",\n        \"function-bind\": \"^1.1.2\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      }\n    },\n    \"node_modules/call-bound\": {\n      \"version\": \"1.0.4\",\n      \"resolved\": \"https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz\",\n      \"integrity\": \"sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bind-apply-helpers\": \"^1.0.2\",\n        \"get-intrinsic\": \"^1.3.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/caller-path\": {\n      \"version\": \"0.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz\",\n      \"integrity\": \"sha512-UJiE1otjXPF5/x+T3zTnSFiTOEmJoGTD9HmBoxnCUwho61a2eSNn/VwtwuIBDAo2SEOv1AJ7ARI5gCmohFLu/g==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"callsites\": \"^0.2.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/callsites\": {\n      \"version\": \"0.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz\",\n      \"integrity\": \"sha512-Zv4Dns9IbXXmPkgRRUjAaJQgfN4xX5p6+RQFhWUqscdvvK2xK/ZL8b3IXIJsj+4sD+f24NwnWy2BY8AJ82JB0A==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/camelcase\": {\n      \"version\": \"5.3.1\",\n      \"resolved\": \"https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz\",\n      \"integrity\": \"sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=6\"\n      }\n    },\n    \"node_modules/caniuse-lite\": {\n      \"version\": \"1.0.30001111\",\n      \"resolved\": \"https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001111.tgz\",\n      \"integrity\": \"sha512-xnDje2wchd/8mlJu8sXvWxOGvMgv+uT3iZ3bkIAynKOzToCssWCmkz/ZIkQBs/2pUB4uwnJKVORWQ31UkbVjOg==\",\n      \"dev\": true\n    },\n    \"node_modules/chalk\": {\n      \"version\": \"2.4.2\",\n      \"resolved\": \"https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz\",\n      \"integrity\": \"sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"ansi-styles\": \"^3.2.1\",\n        \"escape-string-regexp\": \"^1.0.5\",\n        \"supports-color\": \"^5.3.0\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/chalk/node_modules/ansi-styles\": {\n      \"version\": \"3.2.1\",\n      \"resolved\": \"https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz\",\n      \"integrity\": \"sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"color-convert\": \"^1.9.0\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/chalk/node_modules/color-convert\": {\n      \"version\": \"1.9.3\",\n      \"resolved\": \"https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz\",\n      \"integrity\": \"sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"color-name\": \"1.1.3\"\n      }\n    },\n    \"node_modules/chalk/node_modules/color-name\": {\n      \"version\": \"1.1.3\",\n      \"resolved\": \"https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz\",\n      \"integrity\": \"sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=\",\n      \"dev\": true\n    },\n    \"node_modules/chardet\": {\n      \"version\": \"0.4.2\",\n      \"resolved\": \"https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz\",\n      \"integrity\": \"sha512-j/Toj7f1z98Hh2cYo2BVr85EpIRWqUi7rtRSGxh/cqUjqrnJe9l9UE7IUGd2vQ2p+kSHLkSzObQPZPLUC6TQwg==\",\n      \"dev\": true,\n      \"license\": \"MIT\"\n    },\n    \"node_modules/chokidar\": {\n      \"version\": \"3.4.1\",\n      \"resolved\": \"https://registry.npmjs.org/chokidar/-/chokidar-3.4.1.tgz\",\n      \"integrity\": \"sha512-TQTJyr2stihpC4Sya9hs2Xh+O2wf+igjL36Y75xx2WdHuiICcn/XJza46Jwt0eT5hVpQOzo3FpY3cj3RVYLX0g==\",\n      \"dev\": true,\n      \"optional\": true,\n      \"dependencies\": {\n        \"anymatch\": \"~3.1.1\",\n        \"braces\": \"~3.0.2\",\n        \"glob-parent\": \"~5.1.0\",\n        \"is-binary-path\": \"~2.1.0\",\n        \"is-glob\": \"~4.0.1\",\n        \"normalize-path\": \"~3.0.0\",\n        \"readdirp\": \"~3.4.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 8.10.0\"\n      },\n      \"optionalDependencies\": {\n        \"fsevents\": \"~2.1.2\"\n      }\n    },\n    \"node_modules/chokidar/node_modules/braces\": {\n      \"version\": \"3.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/braces/-/braces-3.0.2.tgz\",\n      \"integrity\": \"sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==\",\n      \"dev\": true,\n      \"optional\": true,\n      \"dependencies\": {\n        \"fill-range\": \"^7.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/chokidar/node_modules/fill-range\": {\n      \"version\": \"7.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz\",\n      \"integrity\": \"sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==\",\n      \"dev\": true,\n      \"optional\": true,\n      \"dependencies\": {\n        \"to-regex-range\": \"^5.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/chokidar/node_modules/is-number\": {\n      \"version\": \"7.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz\",\n      \"integrity\": \"sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==\",\n      \"dev\": true,\n      \"optional\": true,\n      \"engines\": {\n        \"node\": \">=0.12.0\"\n      }\n    },\n    \"node_modules/chokidar/node_modules/to-regex-range\": {\n      \"version\": \"5.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz\",\n      \"integrity\": \"sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==\",\n      \"dev\": true,\n      \"optional\": true,\n      \"dependencies\": {\n        \"is-number\": \"^7.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=8.0\"\n      }\n    },\n    \"node_modules/chownr\": {\n      \"version\": \"1.1.4\",\n      \"resolved\": \"https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz\",\n      \"integrity\": \"sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==\",\n      \"dev\": true\n    },\n    \"node_modules/chrome-trace-event\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz\",\n      \"integrity\": \"sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"tslib\": \"^1.9.0\"\n      },\n      \"engines\": {\n        \"node\": \">=6.0\"\n      }\n    },\n    \"node_modules/cipher-base\": {\n      \"version\": \"1.0.4\",\n      \"resolved\": \"https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz\",\n      \"integrity\": \"sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"inherits\": \"^2.0.1\",\n        \"safe-buffer\": \"^5.0.1\"\n      }\n    },\n    \"node_modules/circular-json\": {\n      \"version\": \"0.3.3\",\n      \"resolved\": \"https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz\",\n      \"integrity\": \"sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==\",\n      \"deprecated\": \"CircularJSON is in maintenance only, flatted is its successor.\",\n      \"dev\": true,\n      \"license\": \"MIT\"\n    },\n    \"node_modules/class-utils\": {\n      \"version\": \"0.3.6\",\n      \"resolved\": \"https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz\",\n      \"integrity\": \"sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"arr-union\": \"^3.1.0\",\n        \"define-property\": \"^0.2.5\",\n        \"isobject\": \"^3.0.0\",\n        \"static-extend\": \"^0.1.1\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/class-utils/node_modules/define-property\": {\n      \"version\": \"0.2.5\",\n      \"resolved\": \"https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz\",\n      \"integrity\": \"sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-descriptor\": \"^0.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/cli-cursor\": {\n      \"version\": \"2.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz\",\n      \"integrity\": \"sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"restore-cursor\": \"^2.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/cli-width\": {\n      \"version\": \"2.2.1\",\n      \"resolved\": \"https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz\",\n      \"integrity\": \"sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==\",\n      \"dev\": true,\n      \"license\": \"ISC\"\n    },\n    \"node_modules/cliui\": {\n      \"version\": \"6.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz\",\n      \"integrity\": \"sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"string-width\": \"^4.2.0\",\n        \"strip-ansi\": \"^6.0.0\",\n        \"wrap-ansi\": \"^6.2.0\"\n      }\n    },\n    \"node_modules/clone-deep\": {\n      \"version\": \"4.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz\",\n      \"integrity\": \"sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"is-plain-object\": \"^2.0.4\",\n        \"kind-of\": \"^6.0.2\",\n        \"shallow-clone\": \"^3.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=6\"\n      }\n    },\n    \"node_modules/collection-visit\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz\",\n      \"integrity\": \"sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"map-visit\": \"^1.0.0\",\n        \"object-visit\": \"^1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/color-convert\": {\n      \"version\": \"2.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz\",\n      \"integrity\": \"sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"color-name\": \"~1.1.4\"\n      },\n      \"engines\": {\n        \"node\": \">=7.0.0\"\n      }\n    },\n    \"node_modules/color-name\": {\n      \"version\": \"1.1.4\",\n      \"resolved\": \"https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz\",\n      \"integrity\": \"sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==\",\n      \"dev\": true\n    },\n    \"node_modules/colorette\": {\n      \"version\": \"2.0.20\",\n      \"resolved\": \"https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz\",\n      \"integrity\": \"sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==\",\n      \"dev\": true,\n      \"license\": \"MIT\"\n    },\n    \"node_modules/commander\": {\n      \"version\": \"2.20.3\",\n      \"resolved\": \"https://registry.npmjs.org/commander/-/commander-2.20.3.tgz\",\n      \"integrity\": \"sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==\",\n      \"dev\": true\n    },\n    \"node_modules/commondir\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz\",\n      \"integrity\": \"sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=\",\n      \"dev\": true\n    },\n    \"node_modules/component-emitter\": {\n      \"version\": \"1.3.0\",\n      \"resolved\": \"https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz\",\n      \"integrity\": \"sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==\",\n      \"dev\": true\n    },\n    \"node_modules/concat-map\": {\n      \"version\": \"0.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz\",\n      \"integrity\": \"sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=\",\n      \"dev\": true\n    },\n    \"node_modules/concat-stream\": {\n      \"version\": \"1.6.2\",\n      \"resolved\": \"https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz\",\n      \"integrity\": \"sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==\",\n      \"dev\": true,\n      \"engines\": [\n        \"node >= 0.8\"\n      ],\n      \"dependencies\": {\n        \"buffer-from\": \"^1.0.0\",\n        \"inherits\": \"^2.0.3\",\n        \"readable-stream\": \"^2.2.2\",\n        \"typedarray\": \"^0.0.6\"\n      }\n    },\n    \"node_modules/console-browserify\": {\n      \"version\": \"1.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz\",\n      \"integrity\": \"sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==\",\n      \"dev\": true\n    },\n    \"node_modules/constants-browserify\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz\",\n      \"integrity\": \"sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=\",\n      \"dev\": true\n    },\n    \"node_modules/convert-source-map\": {\n      \"version\": \"1.9.0\",\n      \"resolved\": \"https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz\",\n      \"integrity\": \"sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==\",\n      \"dev\": true,\n      \"license\": \"MIT\"\n    },\n    \"node_modules/copy-concurrently\": {\n      \"version\": \"1.0.5\",\n      \"resolved\": \"https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz\",\n      \"integrity\": \"sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==\",\n      \"deprecated\": \"This package is no longer supported.\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"aproba\": \"^1.1.1\",\n        \"fs-write-stream-atomic\": \"^1.0.8\",\n        \"iferr\": \"^0.1.5\",\n        \"mkdirp\": \"^0.5.1\",\n        \"rimraf\": \"^2.5.4\",\n        \"run-queue\": \"^1.0.0\"\n      }\n    },\n    \"node_modules/copy-descriptor\": {\n      \"version\": \"0.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz\",\n      \"integrity\": \"sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/core-js-compat\": {\n      \"version\": \"3.6.5\",\n      \"resolved\": \"https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.6.5.tgz\",\n      \"integrity\": \"sha512-7ItTKOhOZbznhXAQ2g/slGg1PJV5zDO/WdkTwi7UEOJmkvsE32PWvx6mKtDjiMpjnR2CNf6BAD6sSxIlv7ptng==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"browserslist\": \"^4.8.5\",\n        \"semver\": \"7.0.0\"\n      },\n      \"funding\": {\n        \"type\": \"opencollective\",\n        \"url\": \"https://opencollective.com/core-js\"\n      }\n    },\n    \"node_modules/core-js-compat/node_modules/semver\": {\n      \"version\": \"7.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/semver/-/semver-7.0.0.tgz\",\n      \"integrity\": \"sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==\",\n      \"dev\": true,\n      \"bin\": {\n        \"semver\": \"bin/semver.js\"\n      }\n    },\n    \"node_modules/core-util-is\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz\",\n      \"integrity\": \"sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=\",\n      \"dev\": true\n    },\n    \"node_modules/create-ecdh\": {\n      \"version\": \"4.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz\",\n      \"integrity\": \"sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"bn.js\": \"^4.1.0\",\n        \"elliptic\": \"^6.0.0\"\n      }\n    },\n    \"node_modules/create-ecdh/node_modules/bn.js\": {\n      \"version\": \"4.11.9\",\n      \"resolved\": \"https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz\",\n      \"integrity\": \"sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==\",\n      \"dev\": true\n    },\n    \"node_modules/create-hash\": {\n      \"version\": \"1.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz\",\n      \"integrity\": \"sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"cipher-base\": \"^1.0.1\",\n        \"inherits\": \"^2.0.1\",\n        \"md5.js\": \"^1.3.4\",\n        \"ripemd160\": \"^2.0.1\",\n        \"sha.js\": \"^2.4.0\"\n      }\n    },\n    \"node_modules/create-hmac\": {\n      \"version\": \"1.1.7\",\n      \"resolved\": \"https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz\",\n      \"integrity\": \"sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"cipher-base\": \"^1.0.3\",\n        \"create-hash\": \"^1.1.0\",\n        \"inherits\": \"^2.0.1\",\n        \"ripemd160\": \"^2.0.0\",\n        \"safe-buffer\": \"^5.0.1\",\n        \"sha.js\": \"^2.4.8\"\n      }\n    },\n    \"node_modules/cross-spawn\": {\n      \"version\": \"6.0.6\",\n      \"resolved\": \"https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz\",\n      \"integrity\": \"sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"nice-try\": \"^1.0.4\",\n        \"path-key\": \"^2.0.1\",\n        \"semver\": \"^5.5.0\",\n        \"shebang-command\": \"^1.2.0\",\n        \"which\": \"^1.2.9\"\n      },\n      \"engines\": {\n        \"node\": \">=4.8\"\n      }\n    },\n    \"node_modules/crypto-browserify\": {\n      \"version\": \"3.12.0\",\n      \"resolved\": \"https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz\",\n      \"integrity\": \"sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"browserify-cipher\": \"^1.0.0\",\n        \"browserify-sign\": \"^4.0.0\",\n        \"create-ecdh\": \"^4.0.0\",\n        \"create-hash\": \"^1.1.0\",\n        \"create-hmac\": \"^1.1.0\",\n        \"diffie-hellman\": \"^5.0.0\",\n        \"inherits\": \"^2.0.1\",\n        \"pbkdf2\": \"^3.0.3\",\n        \"public-encrypt\": \"^4.0.0\",\n        \"randombytes\": \"^2.0.0\",\n        \"randomfill\": \"^1.0.3\"\n      },\n      \"engines\": {\n        \"node\": \"*\"\n      }\n    },\n    \"node_modules/css-loader\": {\n      \"version\": \"4.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/css-loader/-/css-loader-4.2.0.tgz\",\n      \"integrity\": \"sha512-ko7a9b0iFpWtk9eSI/C8IICvZeGtYnjxYjw45rJprokXj/+kBd/siX4vAIBq9Uij8Jubc4jL1EvSnTjCEwaHSw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"camelcase\": \"^6.0.0\",\n        \"cssesc\": \"^3.0.0\",\n        \"icss-utils\": \"^4.1.1\",\n        \"loader-utils\": \"^2.0.0\",\n        \"normalize-path\": \"^3.0.0\",\n        \"postcss\": \"^7.0.32\",\n        \"postcss-modules-extract-imports\": \"^2.0.0\",\n        \"postcss-modules-local-by-default\": \"^3.0.3\",\n        \"postcss-modules-scope\": \"^2.2.0\",\n        \"postcss-modules-values\": \"^3.0.0\",\n        \"postcss-value-parser\": \"^4.1.0\",\n        \"schema-utils\": \"^2.7.0\",\n        \"semver\": \"^7.3.2\"\n      },\n      \"engines\": {\n        \"node\": \">= 10.13.0\"\n      },\n      \"funding\": {\n        \"type\": \"opencollective\",\n        \"url\": \"https://opencollective.com/webpack\"\n      },\n      \"peerDependencies\": {\n        \"webpack\": \"^4.27.0 || ^5.0.0\"\n      }\n    },\n    \"node_modules/css-loader/node_modules/camelcase\": {\n      \"version\": \"6.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/camelcase/-/camelcase-6.0.0.tgz\",\n      \"integrity\": \"sha512-8KMDF1Vz2gzOq54ONPJS65IvTUaB1cHJ2DMM7MbPmLZljDH1qpzzLsWdiN9pHh6qvkRVDTi/07+eNGch/oLU4w==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=10\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/sindresorhus\"\n      }\n    },\n    \"node_modules/css-loader/node_modules/json5\": {\n      \"version\": \"2.1.3\",\n      \"resolved\": \"https://registry.npmjs.org/json5/-/json5-2.1.3.tgz\",\n      \"integrity\": \"sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"minimist\": \"^1.2.5\"\n      },\n      \"bin\": {\n        \"json5\": \"lib/cli.js\"\n      },\n      \"engines\": {\n        \"node\": \">=6\"\n      }\n    },\n    \"node_modules/css-loader/node_modules/loader-utils\": {\n      \"version\": \"2.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz\",\n      \"integrity\": \"sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"big.js\": \"^5.2.2\",\n        \"emojis-list\": \"^3.0.0\",\n        \"json5\": \"^2.1.2\"\n      },\n      \"engines\": {\n        \"node\": \">=8.9.0\"\n      }\n    },\n    \"node_modules/css-loader/node_modules/schema-utils\": {\n      \"version\": \"2.7.0\",\n      \"resolved\": \"https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz\",\n      \"integrity\": \"sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@types/json-schema\": \"^7.0.4\",\n        \"ajv\": \"^6.12.2\",\n        \"ajv-keywords\": \"^3.4.1\"\n      },\n      \"engines\": {\n        \"node\": \">= 8.9.0\"\n      },\n      \"funding\": {\n        \"type\": \"opencollective\",\n        \"url\": \"https://opencollective.com/webpack\"\n      }\n    },\n    \"node_modules/css-loader/node_modules/semver\": {\n      \"version\": \"7.3.2\",\n      \"resolved\": \"https://registry.npmjs.org/semver/-/semver-7.3.2.tgz\",\n      \"integrity\": \"sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==\",\n      \"dev\": true,\n      \"bin\": {\n        \"semver\": \"bin/semver.js\"\n      },\n      \"engines\": {\n        \"node\": \">=10\"\n      }\n    },\n    \"node_modules/cssesc\": {\n      \"version\": \"3.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz\",\n      \"integrity\": \"sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==\",\n      \"dev\": true,\n      \"bin\": {\n        \"cssesc\": \"bin/cssesc\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/cyclist\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz\",\n      \"integrity\": \"sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=\",\n      \"dev\": true\n    },\n    \"node_modules/data-view-buffer\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz\",\n      \"integrity\": \"sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bound\": \"^1.0.3\",\n        \"es-errors\": \"^1.3.0\",\n        \"is-data-view\": \"^1.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/data-view-byte-length\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz\",\n      \"integrity\": \"sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bound\": \"^1.0.3\",\n        \"es-errors\": \"^1.3.0\",\n        \"is-data-view\": \"^1.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/inspect-js\"\n      }\n    },\n    \"node_modules/data-view-byte-offset\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz\",\n      \"integrity\": \"sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bound\": \"^1.0.2\",\n        \"es-errors\": \"^1.3.0\",\n        \"is-data-view\": \"^1.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/debug\": {\n      \"version\": \"2.6.9\",\n      \"resolved\": \"https://registry.npmjs.org/debug/-/debug-2.6.9.tgz\",\n      \"integrity\": \"sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"ms\": \"2.0.0\"\n      }\n    },\n    \"node_modules/decamelize\": {\n      \"version\": \"1.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz\",\n      \"integrity\": \"sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/decode-uri-component\": {\n      \"version\": \"0.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz\",\n      \"integrity\": \"sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10\"\n      }\n    },\n    \"node_modules/deep-is\": {\n      \"version\": \"0.1.4\",\n      \"resolved\": \"https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz\",\n      \"integrity\": \"sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\"\n    },\n    \"node_modules/define-data-property\": {\n      \"version\": \"1.1.4\",\n      \"resolved\": \"https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz\",\n      \"integrity\": \"sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"es-define-property\": \"^1.0.0\",\n        \"es-errors\": \"^1.3.0\",\n        \"gopd\": \"^1.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/define-properties\": {\n      \"version\": \"1.2.1\",\n      \"resolved\": \"https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz\",\n      \"integrity\": \"sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"define-data-property\": \"^1.0.1\",\n        \"has-property-descriptors\": \"^1.0.0\",\n        \"object-keys\": \"^1.1.1\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/define-property\": {\n      \"version\": \"2.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz\",\n      \"integrity\": \"sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-descriptor\": \"^1.0.2\",\n        \"isobject\": \"^3.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/define-property/node_modules/is-accessor-descriptor\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz\",\n      \"integrity\": \"sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==\",\n      \"deprecated\": \"Please upgrade to v1.0.1\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"kind-of\": \"^6.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/define-property/node_modules/is-data-descriptor\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz\",\n      \"integrity\": \"sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==\",\n      \"deprecated\": \"Please upgrade to v1.0.1\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"kind-of\": \"^6.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/define-property/node_modules/is-descriptor\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz\",\n      \"integrity\": \"sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-accessor-descriptor\": \"^1.0.0\",\n        \"is-data-descriptor\": \"^1.0.0\",\n        \"kind-of\": \"^6.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/des.js\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz\",\n      \"integrity\": \"sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"inherits\": \"^2.0.1\",\n        \"minimalistic-assert\": \"^1.0.0\"\n      }\n    },\n    \"node_modules/diffie-hellman\": {\n      \"version\": \"5.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz\",\n      \"integrity\": \"sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"bn.js\": \"^4.1.0\",\n        \"miller-rabin\": \"^4.0.0\",\n        \"randombytes\": \"^2.0.0\"\n      }\n    },\n    \"node_modules/diffie-hellman/node_modules/bn.js\": {\n      \"version\": \"4.11.9\",\n      \"resolved\": \"https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz\",\n      \"integrity\": \"sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==\",\n      \"dev\": true\n    },\n    \"node_modules/doctrine\": {\n      \"version\": \"2.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz\",\n      \"integrity\": \"sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==\",\n      \"dev\": true,\n      \"license\": \"Apache-2.0\",\n      \"dependencies\": {\n        \"esutils\": \"^2.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/domain-browser\": {\n      \"version\": \"1.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz\",\n      \"integrity\": \"sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.4\",\n        \"npm\": \">=1.2\"\n      }\n    },\n    \"node_modules/dunder-proto\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz\",\n      \"integrity\": \"sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bind-apply-helpers\": \"^1.0.1\",\n        \"es-errors\": \"^1.3.0\",\n        \"gopd\": \"^1.2.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      }\n    },\n    \"node_modules/duplexify\": {\n      \"version\": \"3.7.1\",\n      \"resolved\": \"https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz\",\n      \"integrity\": \"sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"end-of-stream\": \"^1.0.0\",\n        \"inherits\": \"^2.0.1\",\n        \"readable-stream\": \"^2.0.0\",\n        \"stream-shift\": \"^1.0.0\"\n      }\n    },\n    \"node_modules/electron-to-chromium\": {\n      \"version\": \"1.3.523\",\n      \"resolved\": \"https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.523.tgz\",\n      \"integrity\": \"sha512-D4/3l5DpciddD92IDRtpLearQSGzly8FwBJv+nITvLH8YJrFabpDFe4yuiOJh2MS4/EsXqyQTXyw1toeYPtshQ==\",\n      \"dev\": true\n    },\n    \"node_modules/elliptic\": {\n      \"version\": \"6.5.3\",\n      \"resolved\": \"https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz\",\n      \"integrity\": \"sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"bn.js\": \"^4.4.0\",\n        \"brorand\": \"^1.0.1\",\n        \"hash.js\": \"^1.0.0\",\n        \"hmac-drbg\": \"^1.0.0\",\n        \"inherits\": \"^2.0.1\",\n        \"minimalistic-assert\": \"^1.0.0\",\n        \"minimalistic-crypto-utils\": \"^1.0.0\"\n      }\n    },\n    \"node_modules/elliptic/node_modules/bn.js\": {\n      \"version\": \"4.11.9\",\n      \"resolved\": \"https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz\",\n      \"integrity\": \"sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==\",\n      \"dev\": true\n    },\n    \"node_modules/emoji-regex\": {\n      \"version\": \"8.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz\",\n      \"integrity\": \"sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==\",\n      \"dev\": true\n    },\n    \"node_modules/emojis-list\": {\n      \"version\": \"3.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz\",\n      \"integrity\": \"sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">= 4\"\n      }\n    },\n    \"node_modules/end-of-stream\": {\n      \"version\": \"1.4.4\",\n      \"resolved\": \"https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz\",\n      \"integrity\": \"sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"once\": \"^1.4.0\"\n      }\n    },\n    \"node_modules/enhanced-resolve\": {\n      \"version\": \"4.3.0\",\n      \"resolved\": \"https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.3.0.tgz\",\n      \"integrity\": \"sha512-3e87LvavsdxyoCfGusJnrZ5G8SLPOFeHSNpZI/ATL9a5leXo2k0w6MKnbqhdBad9qTobSfB20Ld7UmgoNbAZkQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"graceful-fs\": \"^4.1.2\",\n        \"memory-fs\": \"^0.5.0\",\n        \"tapable\": \"^1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=6.9.0\"\n      }\n    },\n    \"node_modules/enhanced-resolve/node_modules/memory-fs\": {\n      \"version\": \"0.5.0\",\n      \"resolved\": \"https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz\",\n      \"integrity\": \"sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"errno\": \"^0.1.3\",\n        \"readable-stream\": \"^2.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">=4.3.0 <5.0.0 || >=5.10\"\n      }\n    },\n    \"node_modules/envinfo\": {\n      \"version\": \"7.14.0\",\n      \"resolved\": \"https://registry.npmjs.org/envinfo/-/envinfo-7.14.0.tgz\",\n      \"integrity\": \"sha512-CO40UI41xDQzhLB1hWyqUKgFhs250pNcGbyGKe1l/e4FSaI/+YE4IMG76GDt0In67WLPACIITC+sOi08x4wIvg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"bin\": {\n        \"envinfo\": \"dist/cli.js\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/errno\": {\n      \"version\": \"0.1.7\",\n      \"resolved\": \"https://registry.npmjs.org/errno/-/errno-0.1.7.tgz\",\n      \"integrity\": \"sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"prr\": \"~1.0.1\"\n      },\n      \"bin\": {\n        \"errno\": \"cli.js\"\n      }\n    },\n    \"node_modules/es-abstract\": {\n      \"version\": \"1.24.0\",\n      \"resolved\": \"https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.0.tgz\",\n      \"integrity\": \"sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"array-buffer-byte-length\": \"^1.0.2\",\n        \"arraybuffer.prototype.slice\": \"^1.0.4\",\n        \"available-typed-arrays\": \"^1.0.7\",\n        \"call-bind\": \"^1.0.8\",\n        \"call-bound\": \"^1.0.4\",\n        \"data-view-buffer\": \"^1.0.2\",\n        \"data-view-byte-length\": \"^1.0.2\",\n        \"data-view-byte-offset\": \"^1.0.1\",\n        \"es-define-property\": \"^1.0.1\",\n        \"es-errors\": \"^1.3.0\",\n        \"es-object-atoms\": \"^1.1.1\",\n        \"es-set-tostringtag\": \"^2.1.0\",\n        \"es-to-primitive\": \"^1.3.0\",\n        \"function.prototype.name\": \"^1.1.8\",\n        \"get-intrinsic\": \"^1.3.0\",\n        \"get-proto\": \"^1.0.1\",\n        \"get-symbol-description\": \"^1.1.0\",\n        \"globalthis\": \"^1.0.4\",\n        \"gopd\": \"^1.2.0\",\n        \"has-property-descriptors\": \"^1.0.2\",\n        \"has-proto\": \"^1.2.0\",\n        \"has-symbols\": \"^1.1.0\",\n        \"hasown\": \"^2.0.2\",\n        \"internal-slot\": \"^1.1.0\",\n        \"is-array-buffer\": \"^3.0.5\",\n        \"is-callable\": \"^1.2.7\",\n        \"is-data-view\": \"^1.0.2\",\n        \"is-negative-zero\": \"^2.0.3\",\n        \"is-regex\": \"^1.2.1\",\n        \"is-set\": \"^2.0.3\",\n        \"is-shared-array-buffer\": \"^1.0.4\",\n        \"is-string\": \"^1.1.1\",\n        \"is-typed-array\": \"^1.1.15\",\n        \"is-weakref\": \"^1.1.1\",\n        \"math-intrinsics\": \"^1.1.0\",\n        \"object-inspect\": \"^1.13.4\",\n        \"object-keys\": \"^1.1.1\",\n        \"object.assign\": \"^4.1.7\",\n        \"own-keys\": \"^1.0.1\",\n        \"regexp.prototype.flags\": \"^1.5.4\",\n        \"safe-array-concat\": \"^1.1.3\",\n        \"safe-push-apply\": \"^1.0.0\",\n        \"safe-regex-test\": \"^1.1.0\",\n        \"set-proto\": \"^1.0.0\",\n        \"stop-iteration-iterator\": \"^1.1.0\",\n        \"string.prototype.trim\": \"^1.2.10\",\n        \"string.prototype.trimend\": \"^1.0.9\",\n        \"string.prototype.trimstart\": \"^1.0.8\",\n        \"typed-array-buffer\": \"^1.0.3\",\n        \"typed-array-byte-length\": \"^1.0.3\",\n        \"typed-array-byte-offset\": \"^1.0.4\",\n        \"typed-array-length\": \"^1.0.7\",\n        \"unbox-primitive\": \"^1.1.0\",\n        \"which-typed-array\": \"^1.1.19\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/es-define-property\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz\",\n      \"integrity\": \"sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      }\n    },\n    \"node_modules/es-errors\": {\n      \"version\": \"1.3.0\",\n      \"resolved\": \"https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz\",\n      \"integrity\": \"sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      }\n    },\n    \"node_modules/es-object-atoms\": {\n      \"version\": \"1.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz\",\n      \"integrity\": \"sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"es-errors\": \"^1.3.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      }\n    },\n    \"node_modules/es-set-tostringtag\": {\n      \"version\": \"2.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz\",\n      \"integrity\": \"sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"es-errors\": \"^1.3.0\",\n        \"get-intrinsic\": \"^1.2.6\",\n        \"has-tostringtag\": \"^1.0.2\",\n        \"hasown\": \"^2.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      }\n    },\n    \"node_modules/es-to-primitive\": {\n      \"version\": \"1.3.0\",\n      \"resolved\": \"https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz\",\n      \"integrity\": \"sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"is-callable\": \"^1.2.7\",\n        \"is-date-object\": \"^1.0.5\",\n        \"is-symbol\": \"^1.0.4\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/escalade\": {\n      \"version\": \"3.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/escalade/-/escalade-3.0.2.tgz\",\n      \"integrity\": \"sha512-gPYAU37hYCUhW5euPeR+Y74F7BL+IBsV93j5cvGriSaD1aG6MGsqsV1yamRdrWrb2j3aiZvb0X+UBOWpx3JWtQ==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=6\"\n      }\n    },\n    \"node_modules/escape-string-regexp\": {\n      \"version\": \"1.0.5\",\n      \"resolved\": \"https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz\",\n      \"integrity\": \"sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.8.0\"\n      }\n    },\n    \"node_modules/eslint\": {\n      \"version\": \"5.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/eslint/-/eslint-5.0.0.tgz\",\n      \"integrity\": \"sha512-MA0YWJLeK7BPEBxJCINvKnQdKpeTwbac3Xonh0PPFjWYZkowZf+Xl30lJWJ/BWOqFQdAdPcyOh0aBqlbH6ojAg==\",\n      \"deprecated\": \"This version is no longer supported. Please see https://eslint.org/version-support for other options.\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"ajv\": \"^6.5.0\",\n        \"babel-code-frame\": \"^6.26.0\",\n        \"chalk\": \"^2.1.0\",\n        \"cross-spawn\": \"^6.0.5\",\n        \"debug\": \"^3.1.0\",\n        \"doctrine\": \"^2.1.0\",\n        \"eslint-scope\": \"^4.0.0\",\n        \"eslint-visitor-keys\": \"^1.0.0\",\n        \"espree\": \"^4.0.0\",\n        \"esquery\": \"^1.0.1\",\n        \"esutils\": \"^2.0.2\",\n        \"file-entry-cache\": \"^2.0.0\",\n        \"functional-red-black-tree\": \"^1.0.1\",\n        \"glob\": \"^7.1.2\",\n        \"globals\": \"^11.5.0\",\n        \"ignore\": \"^3.3.3\",\n        \"imurmurhash\": \"^0.1.4\",\n        \"inquirer\": \"^5.2.0\",\n        \"is-resolvable\": \"^1.1.0\",\n        \"js-yaml\": \"^3.11.0\",\n        \"json-stable-stringify-without-jsonify\": \"^1.0.1\",\n        \"levn\": \"^0.3.0\",\n        \"lodash\": \"^4.17.5\",\n        \"minimatch\": \"^3.0.4\",\n        \"mkdirp\": \"^0.5.1\",\n        \"natural-compare\": \"^1.4.0\",\n        \"optionator\": \"^0.8.2\",\n        \"path-is-inside\": \"^1.0.2\",\n        \"pluralize\": \"^7.0.0\",\n        \"progress\": \"^2.0.0\",\n        \"regexpp\": \"^1.1.0\",\n        \"require-uncached\": \"^1.0.3\",\n        \"semver\": \"^5.5.0\",\n        \"string.prototype.matchall\": \"^2.0.0\",\n        \"strip-ansi\": \"^4.0.0\",\n        \"strip-json-comments\": \"^2.0.1\",\n        \"table\": \"^4.0.3\",\n        \"text-table\": \"^0.2.0\"\n      },\n      \"bin\": {\n        \"eslint\": \"bin/eslint.js\"\n      },\n      \"engines\": {\n        \"node\": \"^6.14.0 || ^8.10.0 || >=9.10.0\"\n      }\n    },\n    \"node_modules/eslint-loader\": {\n      \"version\": \"4.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/eslint-loader/-/eslint-loader-4.0.2.tgz\",\n      \"integrity\": \"sha512-EDpXor6lsjtTzZpLUn7KmXs02+nIjGcgees9BYjNkWra3jVq5vVa8IoCKgzT2M7dNNeoMBtaSG83Bd40N3poLw==\",\n      \"deprecated\": \"This loader has been deprecated. Please use eslint-webpack-plugin\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"find-cache-dir\": \"^3.3.1\",\n        \"fs-extra\": \"^8.1.0\",\n        \"loader-utils\": \"^2.0.0\",\n        \"object-hash\": \"^2.0.3\",\n        \"schema-utils\": \"^2.6.5\"\n      },\n      \"engines\": {\n        \"node\": \">= 10.13.0\"\n      },\n      \"peerDependencies\": {\n        \"eslint\": \"^6.0.0 || ^7.0.0\",\n        \"webpack\": \"^4.0.0 || ^5.0.0\"\n      }\n    },\n    \"node_modules/eslint-loader/node_modules/find-cache-dir\": {\n      \"version\": \"3.3.1\",\n      \"resolved\": \"https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz\",\n      \"integrity\": \"sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"commondir\": \"^1.0.1\",\n        \"make-dir\": \"^3.0.2\",\n        \"pkg-dir\": \"^4.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/avajs/find-cache-dir?sponsor=1\"\n      }\n    },\n    \"node_modules/eslint-loader/node_modules/find-up\": {\n      \"version\": \"4.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz\",\n      \"integrity\": \"sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"locate-path\": \"^5.0.0\",\n        \"path-exists\": \"^4.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/eslint-loader/node_modules/json5\": {\n      \"version\": \"2.1.3\",\n      \"resolved\": \"https://registry.npmjs.org/json5/-/json5-2.1.3.tgz\",\n      \"integrity\": \"sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"minimist\": \"^1.2.5\"\n      },\n      \"bin\": {\n        \"json5\": \"lib/cli.js\"\n      },\n      \"engines\": {\n        \"node\": \">=6\"\n      }\n    },\n    \"node_modules/eslint-loader/node_modules/loader-utils\": {\n      \"version\": \"2.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz\",\n      \"integrity\": \"sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"big.js\": \"^5.2.2\",\n        \"emojis-list\": \"^3.0.0\",\n        \"json5\": \"^2.1.2\"\n      },\n      \"engines\": {\n        \"node\": \">=8.9.0\"\n      }\n    },\n    \"node_modules/eslint-loader/node_modules/locate-path\": {\n      \"version\": \"5.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz\",\n      \"integrity\": \"sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"p-locate\": \"^4.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/eslint-loader/node_modules/make-dir\": {\n      \"version\": \"3.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz\",\n      \"integrity\": \"sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"semver\": \"^6.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/sindresorhus\"\n      }\n    },\n    \"node_modules/eslint-loader/node_modules/p-locate\": {\n      \"version\": \"4.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz\",\n      \"integrity\": \"sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"p-limit\": \"^2.2.0\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/eslint-loader/node_modules/path-exists\": {\n      \"version\": \"4.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz\",\n      \"integrity\": \"sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/eslint-loader/node_modules/pkg-dir\": {\n      \"version\": \"4.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz\",\n      \"integrity\": \"sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"find-up\": \"^4.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/eslint-loader/node_modules/schema-utils\": {\n      \"version\": \"2.7.0\",\n      \"resolved\": \"https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.0.tgz\",\n      \"integrity\": \"sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@types/json-schema\": \"^7.0.4\",\n        \"ajv\": \"^6.12.2\",\n        \"ajv-keywords\": \"^3.4.1\"\n      },\n      \"engines\": {\n        \"node\": \">= 8.9.0\"\n      },\n      \"funding\": {\n        \"type\": \"opencollective\",\n        \"url\": \"https://opencollective.com/webpack\"\n      }\n    },\n    \"node_modules/eslint-loader/node_modules/semver\": {\n      \"version\": \"6.3.0\",\n      \"resolved\": \"https://registry.npmjs.org/semver/-/semver-6.3.0.tgz\",\n      \"integrity\": \"sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==\",\n      \"dev\": true,\n      \"bin\": {\n        \"semver\": \"bin/semver.js\"\n      }\n    },\n    \"node_modules/eslint-scope\": {\n      \"version\": \"4.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz\",\n      \"integrity\": \"sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"esrecurse\": \"^4.1.0\",\n        \"estraverse\": \"^4.1.1\"\n      },\n      \"engines\": {\n        \"node\": \">=4.0.0\"\n      }\n    },\n    \"node_modules/eslint-visitor-keys\": {\n      \"version\": \"1.3.0\",\n      \"resolved\": \"https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz\",\n      \"integrity\": \"sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==\",\n      \"dev\": true,\n      \"license\": \"Apache-2.0\",\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/eslint/node_modules/ansi-regex\": {\n      \"version\": \"3.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz\",\n      \"integrity\": \"sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/eslint/node_modules/debug\": {\n      \"version\": \"3.2.7\",\n      \"resolved\": \"https://registry.npmjs.org/debug/-/debug-3.2.7.tgz\",\n      \"integrity\": \"sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"ms\": \"^2.1.1\"\n      }\n    },\n    \"node_modules/eslint/node_modules/ms\": {\n      \"version\": \"2.1.3\",\n      \"resolved\": \"https://registry.npmjs.org/ms/-/ms-2.1.3.tgz\",\n      \"integrity\": \"sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==\",\n      \"dev\": true,\n      \"license\": \"MIT\"\n    },\n    \"node_modules/eslint/node_modules/strip-ansi\": {\n      \"version\": \"4.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz\",\n      \"integrity\": \"sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"ansi-regex\": \"^3.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/espree\": {\n      \"version\": \"4.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/espree/-/espree-4.1.0.tgz\",\n      \"integrity\": \"sha512-I5BycZW6FCVIub93TeVY1s7vjhP9CY6cXCznIRfiig7nRviKZYdRnj/sHEWC6A7WE9RDWOFq9+7OsWSYz8qv2w==\",\n      \"dev\": true,\n      \"license\": \"BSD-2-Clause\",\n      \"dependencies\": {\n        \"acorn\": \"^6.0.2\",\n        \"acorn-jsx\": \"^5.0.0\",\n        \"eslint-visitor-keys\": \"^1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=6.0.0\"\n      }\n    },\n    \"node_modules/esprima\": {\n      \"version\": \"4.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz\",\n      \"integrity\": \"sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==\",\n      \"dev\": true,\n      \"license\": \"BSD-2-Clause\",\n      \"bin\": {\n        \"esparse\": \"bin/esparse.js\",\n        \"esvalidate\": \"bin/esvalidate.js\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/esquery\": {\n      \"version\": \"1.6.0\",\n      \"resolved\": \"https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz\",\n      \"integrity\": \"sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==\",\n      \"dev\": true,\n      \"license\": \"BSD-3-Clause\",\n      \"dependencies\": {\n        \"estraverse\": \"^5.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10\"\n      }\n    },\n    \"node_modules/esquery/node_modules/estraverse\": {\n      \"version\": \"5.3.0\",\n      \"resolved\": \"https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz\",\n      \"integrity\": \"sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==\",\n      \"dev\": true,\n      \"license\": \"BSD-2-Clause\",\n      \"engines\": {\n        \"node\": \">=4.0\"\n      }\n    },\n    \"node_modules/esrecurse\": {\n      \"version\": \"4.2.1\",\n      \"resolved\": \"https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz\",\n      \"integrity\": \"sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"estraverse\": \"^4.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=4.0\"\n      }\n    },\n    \"node_modules/estraverse\": {\n      \"version\": \"4.3.0\",\n      \"resolved\": \"https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz\",\n      \"integrity\": \"sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=4.0\"\n      }\n    },\n    \"node_modules/esutils\": {\n      \"version\": \"2.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz\",\n      \"integrity\": \"sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/events\": {\n      \"version\": \"3.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/events/-/events-3.2.0.tgz\",\n      \"integrity\": \"sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.8.x\"\n      }\n    },\n    \"node_modules/evp_bytestokey\": {\n      \"version\": \"1.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz\",\n      \"integrity\": \"sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"md5.js\": \"^1.3.4\",\n        \"safe-buffer\": \"^5.1.1\"\n      }\n    },\n    \"node_modules/expand-brackets\": {\n      \"version\": \"2.1.4\",\n      \"resolved\": \"https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz\",\n      \"integrity\": \"sha1-t3c14xXOMPa27/D4OwQVGiJEliI=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"debug\": \"^2.3.3\",\n        \"define-property\": \"^0.2.5\",\n        \"extend-shallow\": \"^2.0.1\",\n        \"posix-character-classes\": \"^0.1.0\",\n        \"regex-not\": \"^1.0.0\",\n        \"snapdragon\": \"^0.8.1\",\n        \"to-regex\": \"^3.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/expand-brackets/node_modules/define-property\": {\n      \"version\": \"0.2.5\",\n      \"resolved\": \"https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz\",\n      \"integrity\": \"sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-descriptor\": \"^0.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/expand-brackets/node_modules/extend-shallow\": {\n      \"version\": \"2.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz\",\n      \"integrity\": \"sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-extendable\": \"^0.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/extend-shallow\": {\n      \"version\": \"3.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz\",\n      \"integrity\": \"sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"assign-symbols\": \"^1.0.0\",\n        \"is-extendable\": \"^1.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/extend-shallow/node_modules/is-extendable\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz\",\n      \"integrity\": \"sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-plain-object\": \"^2.0.4\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/external-editor\": {\n      \"version\": \"2.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz\",\n      \"integrity\": \"sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"chardet\": \"^0.4.0\",\n        \"iconv-lite\": \"^0.4.17\",\n        \"tmp\": \"^0.0.33\"\n      },\n      \"engines\": {\n        \"node\": \">=0.12\"\n      }\n    },\n    \"node_modules/extglob\": {\n      \"version\": \"2.0.4\",\n      \"resolved\": \"https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz\",\n      \"integrity\": \"sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"array-unique\": \"^0.3.2\",\n        \"define-property\": \"^1.0.0\",\n        \"expand-brackets\": \"^2.1.4\",\n        \"extend-shallow\": \"^2.0.1\",\n        \"fragment-cache\": \"^0.2.1\",\n        \"regex-not\": \"^1.0.0\",\n        \"snapdragon\": \"^0.8.1\",\n        \"to-regex\": \"^3.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/extglob/node_modules/define-property\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz\",\n      \"integrity\": \"sha1-dp66rz9KY6rTr56NMEybvnm/sOY=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-descriptor\": \"^1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/extglob/node_modules/extend-shallow\": {\n      \"version\": \"2.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz\",\n      \"integrity\": \"sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-extendable\": \"^0.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/extglob/node_modules/is-accessor-descriptor\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz\",\n      \"integrity\": \"sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==\",\n      \"deprecated\": \"Please upgrade to v1.0.1\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"kind-of\": \"^6.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/extglob/node_modules/is-data-descriptor\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz\",\n      \"integrity\": \"sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==\",\n      \"deprecated\": \"Please upgrade to v1.0.1\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"kind-of\": \"^6.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/extglob/node_modules/is-descriptor\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz\",\n      \"integrity\": \"sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-accessor-descriptor\": \"^1.0.0\",\n        \"is-data-descriptor\": \"^1.0.0\",\n        \"kind-of\": \"^6.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/fast-deep-equal\": {\n      \"version\": \"3.1.3\",\n      \"resolved\": \"https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz\",\n      \"integrity\": \"sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==\",\n      \"dev\": true\n    },\n    \"node_modules/fast-json-stable-stringify\": {\n      \"version\": \"2.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz\",\n      \"integrity\": \"sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==\",\n      \"dev\": true\n    },\n    \"node_modules/fast-levenshtein\": {\n      \"version\": \"2.0.6\",\n      \"resolved\": \"https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz\",\n      \"integrity\": \"sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==\",\n      \"dev\": true,\n      \"license\": \"MIT\"\n    },\n    \"node_modules/fastest-levenshtein\": {\n      \"version\": \"1.0.16\",\n      \"resolved\": \"https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz\",\n      \"integrity\": \"sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">= 4.9.1\"\n      }\n    },\n    \"node_modules/figgy-pudding\": {\n      \"version\": \"3.5.2\",\n      \"resolved\": \"https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz\",\n      \"integrity\": \"sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==\",\n      \"deprecated\": \"This module is no longer supported.\",\n      \"dev\": true\n    },\n    \"node_modules/figures\": {\n      \"version\": \"2.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/figures/-/figures-2.0.0.tgz\",\n      \"integrity\": \"sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"escape-string-regexp\": \"^1.0.5\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/file-entry-cache\": {\n      \"version\": \"2.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz\",\n      \"integrity\": \"sha512-uXP/zGzxxFvFfcZGgBIwotm+Tdc55ddPAzF7iHshP4YGaXMww7rSF9peD9D1sui5ebONg5UobsZv+FfgEpGv/w==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"flat-cache\": \"^1.2.1\",\n        \"object-assign\": \"^4.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/fill-range\": {\n      \"version\": \"4.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz\",\n      \"integrity\": \"sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"extend-shallow\": \"^2.0.1\",\n        \"is-number\": \"^3.0.0\",\n        \"repeat-string\": \"^1.6.1\",\n        \"to-regex-range\": \"^2.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/fill-range/node_modules/extend-shallow\": {\n      \"version\": \"2.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz\",\n      \"integrity\": \"sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-extendable\": \"^0.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/find-cache-dir\": {\n      \"version\": \"2.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz\",\n      \"integrity\": \"sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"commondir\": \"^1.0.1\",\n        \"make-dir\": \"^2.0.0\",\n        \"pkg-dir\": \"^3.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=6\"\n      }\n    },\n    \"node_modules/find-up\": {\n      \"version\": \"3.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz\",\n      \"integrity\": \"sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"locate-path\": \"^3.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=6\"\n      }\n    },\n    \"node_modules/flat\": {\n      \"version\": \"5.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/flat/-/flat-5.0.2.tgz\",\n      \"integrity\": \"sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==\",\n      \"dev\": true,\n      \"license\": \"BSD-3-Clause\",\n      \"bin\": {\n        \"flat\": \"cli.js\"\n      }\n    },\n    \"node_modules/flat-cache\": {\n      \"version\": \"1.3.4\",\n      \"resolved\": \"https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz\",\n      \"integrity\": \"sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"circular-json\": \"^0.3.1\",\n        \"graceful-fs\": \"^4.1.2\",\n        \"rimraf\": \"~2.6.2\",\n        \"write\": \"^0.2.1\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/flat-cache/node_modules/rimraf\": {\n      \"version\": \"2.6.3\",\n      \"resolved\": \"https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz\",\n      \"integrity\": \"sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==\",\n      \"deprecated\": \"Rimraf versions prior to v4 are no longer supported\",\n      \"dev\": true,\n      \"license\": \"ISC\",\n      \"dependencies\": {\n        \"glob\": \"^7.1.3\"\n      },\n      \"bin\": {\n        \"rimraf\": \"bin.js\"\n      }\n    },\n    \"node_modules/flush-write-stream\": {\n      \"version\": \"1.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz\",\n      \"integrity\": \"sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"inherits\": \"^2.0.3\",\n        \"readable-stream\": \"^2.3.6\"\n      }\n    },\n    \"node_modules/for-each\": {\n      \"version\": \"0.3.5\",\n      \"resolved\": \"https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz\",\n      \"integrity\": \"sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"is-callable\": \"^1.2.7\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/for-in\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz\",\n      \"integrity\": \"sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/fragment-cache\": {\n      \"version\": \"0.2.1\",\n      \"resolved\": \"https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz\",\n      \"integrity\": \"sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"map-cache\": \"^0.2.2\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/from2\": {\n      \"version\": \"2.3.0\",\n      \"resolved\": \"https://registry.npmjs.org/from2/-/from2-2.3.0.tgz\",\n      \"integrity\": \"sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"inherits\": \"^2.0.1\",\n        \"readable-stream\": \"^2.0.0\"\n      }\n    },\n    \"node_modules/fs-extra\": {\n      \"version\": \"8.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz\",\n      \"integrity\": \"sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"graceful-fs\": \"^4.2.0\",\n        \"jsonfile\": \"^4.0.0\",\n        \"universalify\": \"^0.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=6 <7 || >=8\"\n      }\n    },\n    \"node_modules/fs-write-stream-atomic\": {\n      \"version\": \"1.0.10\",\n      \"resolved\": \"https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz\",\n      \"integrity\": \"sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=\",\n      \"deprecated\": \"This package is no longer supported.\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"graceful-fs\": \"^4.1.2\",\n        \"iferr\": \"^0.1.5\",\n        \"imurmurhash\": \"^0.1.4\",\n        \"readable-stream\": \"1 || 2\"\n      }\n    },\n    \"node_modules/fs.realpath\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz\",\n      \"integrity\": \"sha1-FQStJSMVjKpA20onh8sBQRmU6k8=\",\n      \"dev\": true\n    },\n    \"node_modules/function-bind\": {\n      \"version\": \"1.1.2\",\n      \"resolved\": \"https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz\",\n      \"integrity\": \"sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/function.prototype.name\": {\n      \"version\": \"1.1.8\",\n      \"resolved\": \"https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz\",\n      \"integrity\": \"sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bind\": \"^1.0.8\",\n        \"call-bound\": \"^1.0.3\",\n        \"define-properties\": \"^1.2.1\",\n        \"functions-have-names\": \"^1.2.3\",\n        \"hasown\": \"^2.0.2\",\n        \"is-callable\": \"^1.2.7\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/functional-red-black-tree\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz\",\n      \"integrity\": \"sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==\",\n      \"dev\": true,\n      \"license\": \"MIT\"\n    },\n    \"node_modules/functions-have-names\": {\n      \"version\": \"1.2.3\",\n      \"resolved\": \"https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz\",\n      \"integrity\": \"sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/get-caller-file\": {\n      \"version\": \"2.0.5\",\n      \"resolved\": \"https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz\",\n      \"integrity\": \"sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \"6.* || 8.* || >= 10.*\"\n      }\n    },\n    \"node_modules/get-intrinsic\": {\n      \"version\": \"1.3.0\",\n      \"resolved\": \"https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz\",\n      \"integrity\": \"sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bind-apply-helpers\": \"^1.0.2\",\n        \"es-define-property\": \"^1.0.1\",\n        \"es-errors\": \"^1.3.0\",\n        \"es-object-atoms\": \"^1.1.1\",\n        \"function-bind\": \"^1.1.2\",\n        \"get-proto\": \"^1.0.1\",\n        \"gopd\": \"^1.2.0\",\n        \"has-symbols\": \"^1.1.0\",\n        \"hasown\": \"^2.0.2\",\n        \"math-intrinsics\": \"^1.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/get-proto\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz\",\n      \"integrity\": \"sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"dunder-proto\": \"^1.0.1\",\n        \"es-object-atoms\": \"^1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      }\n    },\n    \"node_modules/get-symbol-description\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz\",\n      \"integrity\": \"sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bound\": \"^1.0.3\",\n        \"es-errors\": \"^1.3.0\",\n        \"get-intrinsic\": \"^1.2.6\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/get-value\": {\n      \"version\": \"2.0.6\",\n      \"resolved\": \"https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz\",\n      \"integrity\": \"sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/glob\": {\n      \"version\": \"7.1.6\",\n      \"resolved\": \"https://registry.npmjs.org/glob/-/glob-7.1.6.tgz\",\n      \"integrity\": \"sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==\",\n      \"deprecated\": \"Glob versions prior to v9 are no longer supported\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"fs.realpath\": \"^1.0.0\",\n        \"inflight\": \"^1.0.4\",\n        \"inherits\": \"2\",\n        \"minimatch\": \"^3.0.4\",\n        \"once\": \"^1.3.0\",\n        \"path-is-absolute\": \"^1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \"*\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/isaacs\"\n      }\n    },\n    \"node_modules/glob-parent\": {\n      \"version\": \"5.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz\",\n      \"integrity\": \"sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==\",\n      \"dev\": true,\n      \"optional\": true,\n      \"dependencies\": {\n        \"is-glob\": \"^4.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">= 6\"\n      }\n    },\n    \"node_modules/globals\": {\n      \"version\": \"11.12.0\",\n      \"resolved\": \"https://registry.npmjs.org/globals/-/globals-11.12.0.tgz\",\n      \"integrity\": \"sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/globalthis\": {\n      \"version\": \"1.0.4\",\n      \"resolved\": \"https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz\",\n      \"integrity\": \"sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"define-properties\": \"^1.2.1\",\n        \"gopd\": \"^1.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/gopd\": {\n      \"version\": \"1.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz\",\n      \"integrity\": \"sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/graceful-fs\": {\n      \"version\": \"4.2.4\",\n      \"resolved\": \"https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz\",\n      \"integrity\": \"sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==\",\n      \"dev\": true\n    },\n    \"node_modules/has-ansi\": {\n      \"version\": \"2.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz\",\n      \"integrity\": \"sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"ansi-regex\": \"^2.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/has-ansi/node_modules/ansi-regex\": {\n      \"version\": \"2.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz\",\n      \"integrity\": \"sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/has-bigints\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz\",\n      \"integrity\": \"sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/has-flag\": {\n      \"version\": \"3.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz\",\n      \"integrity\": \"sha1-tdRU3CGZriJWmfNGfloH87lVuv0=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/has-property-descriptors\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz\",\n      \"integrity\": \"sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"es-define-property\": \"^1.0.0\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/has-proto\": {\n      \"version\": \"1.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz\",\n      \"integrity\": \"sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"dunder-proto\": \"^1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/has-symbols\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz\",\n      \"integrity\": \"sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/has-tostringtag\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz\",\n      \"integrity\": \"sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"has-symbols\": \"^1.0.3\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/has-value\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz\",\n      \"integrity\": \"sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"get-value\": \"^2.0.6\",\n        \"has-values\": \"^1.0.0\",\n        \"isobject\": \"^3.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/has-values\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz\",\n      \"integrity\": \"sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-number\": \"^3.0.0\",\n        \"kind-of\": \"^4.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/has-values/node_modules/kind-of\": {\n      \"version\": \"4.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz\",\n      \"integrity\": \"sha1-IIE989cSkosgc3hpGkUGb65y3Vc=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-buffer\": \"^1.1.5\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/hash-base\": {\n      \"version\": \"3.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz\",\n      \"integrity\": \"sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"inherits\": \"^2.0.4\",\n        \"readable-stream\": \"^3.6.0\",\n        \"safe-buffer\": \"^5.2.0\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/hash-base/node_modules/readable-stream\": {\n      \"version\": \"3.6.0\",\n      \"resolved\": \"https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz\",\n      \"integrity\": \"sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"inherits\": \"^2.0.3\",\n        \"string_decoder\": \"^1.1.1\",\n        \"util-deprecate\": \"^1.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">= 6\"\n      }\n    },\n    \"node_modules/hash-base/node_modules/safe-buffer\": {\n      \"version\": \"5.2.1\",\n      \"resolved\": \"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz\",\n      \"integrity\": \"sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==\",\n      \"dev\": true,\n      \"funding\": [\n        {\n          \"type\": \"github\",\n          \"url\": \"https://github.com/sponsors/feross\"\n        },\n        {\n          \"type\": \"patreon\",\n          \"url\": \"https://www.patreon.com/feross\"\n        },\n        {\n          \"type\": \"consulting\",\n          \"url\": \"https://feross.org/support\"\n        }\n      ]\n    },\n    \"node_modules/hash.js\": {\n      \"version\": \"1.1.7\",\n      \"resolved\": \"https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz\",\n      \"integrity\": \"sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"inherits\": \"^2.0.3\",\n        \"minimalistic-assert\": \"^1.0.1\"\n      }\n    },\n    \"node_modules/hasown\": {\n      \"version\": \"2.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz\",\n      \"integrity\": \"sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"function-bind\": \"^1.1.2\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      }\n    },\n    \"node_modules/hmac-drbg\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz\",\n      \"integrity\": \"sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"hash.js\": \"^1.0.3\",\n        \"minimalistic-assert\": \"^1.0.0\",\n        \"minimalistic-crypto-utils\": \"^1.0.1\"\n      }\n    },\n    \"node_modules/https-browserify\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz\",\n      \"integrity\": \"sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=\",\n      \"dev\": true\n    },\n    \"node_modules/iconv-lite\": {\n      \"version\": \"0.4.24\",\n      \"resolved\": \"https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz\",\n      \"integrity\": \"sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"safer-buffer\": \">= 2.1.2 < 3\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/icss-utils\": {\n      \"version\": \"4.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/icss-utils/-/icss-utils-4.1.1.tgz\",\n      \"integrity\": \"sha512-4aFq7wvWyMHKgxsH8QQtGpvbASCf+eM3wPRLI6R+MgAnTCZ6STYsRvttLvRWK0Nfif5piF394St3HeJDaljGPA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"postcss\": \"^7.0.14\"\n      },\n      \"engines\": {\n        \"node\": \">= 6\"\n      }\n    },\n    \"node_modules/ieee754\": {\n      \"version\": \"1.1.13\",\n      \"resolved\": \"https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz\",\n      \"integrity\": \"sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==\",\n      \"dev\": true\n    },\n    \"node_modules/iferr\": {\n      \"version\": \"0.1.5\",\n      \"resolved\": \"https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz\",\n      \"integrity\": \"sha1-xg7taebY/bazEEofy8ocGS3FtQE=\",\n      \"dev\": true\n    },\n    \"node_modules/ignore\": {\n      \"version\": \"3.3.10\",\n      \"resolved\": \"https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz\",\n      \"integrity\": \"sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==\",\n      \"dev\": true,\n      \"license\": \"MIT\"\n    },\n    \"node_modules/import-local\": {\n      \"version\": \"3.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz\",\n      \"integrity\": \"sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"pkg-dir\": \"^4.2.0\",\n        \"resolve-cwd\": \"^3.0.0\"\n      },\n      \"bin\": {\n        \"import-local-fixture\": \"fixtures/cli.js\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/sindresorhus\"\n      }\n    },\n    \"node_modules/import-local/node_modules/find-up\": {\n      \"version\": \"4.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz\",\n      \"integrity\": \"sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"locate-path\": \"^5.0.0\",\n        \"path-exists\": \"^4.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/import-local/node_modules/locate-path\": {\n      \"version\": \"5.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz\",\n      \"integrity\": \"sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"p-locate\": \"^4.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/import-local/node_modules/p-locate\": {\n      \"version\": \"4.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz\",\n      \"integrity\": \"sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"p-limit\": \"^2.2.0\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/import-local/node_modules/path-exists\": {\n      \"version\": \"4.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz\",\n      \"integrity\": \"sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/import-local/node_modules/pkg-dir\": {\n      \"version\": \"4.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz\",\n      \"integrity\": \"sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"find-up\": \"^4.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/imurmurhash\": {\n      \"version\": \"0.1.4\",\n      \"resolved\": \"https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz\",\n      \"integrity\": \"sha1-khi5srkoojixPcT7a21XbyMUU+o=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.8.19\"\n      }\n    },\n    \"node_modules/indexes-of\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz\",\n      \"integrity\": \"sha1-8w9xbI4r00bHtn0985FVZqfAVgc=\",\n      \"dev\": true\n    },\n    \"node_modules/infer-owner\": {\n      \"version\": \"1.0.4\",\n      \"resolved\": \"https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz\",\n      \"integrity\": \"sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==\",\n      \"dev\": true\n    },\n    \"node_modules/inflight\": {\n      \"version\": \"1.0.6\",\n      \"resolved\": \"https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz\",\n      \"integrity\": \"sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=\",\n      \"deprecated\": \"This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"once\": \"^1.3.0\",\n        \"wrappy\": \"1\"\n      }\n    },\n    \"node_modules/inherits\": {\n      \"version\": \"2.0.4\",\n      \"resolved\": \"https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz\",\n      \"integrity\": \"sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==\",\n      \"dev\": true\n    },\n    \"node_modules/inquirer\": {\n      \"version\": \"5.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/inquirer/-/inquirer-5.2.0.tgz\",\n      \"integrity\": \"sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"ansi-escapes\": \"^3.0.0\",\n        \"chalk\": \"^2.0.0\",\n        \"cli-cursor\": \"^2.1.0\",\n        \"cli-width\": \"^2.0.0\",\n        \"external-editor\": \"^2.1.0\",\n        \"figures\": \"^2.0.0\",\n        \"lodash\": \"^4.3.0\",\n        \"mute-stream\": \"0.0.7\",\n        \"run-async\": \"^2.2.0\",\n        \"rxjs\": \"^5.5.2\",\n        \"string-width\": \"^2.1.0\",\n        \"strip-ansi\": \"^4.0.0\",\n        \"through\": \"^2.3.6\"\n      },\n      \"engines\": {\n        \"node\": \">=6.0.0\"\n      }\n    },\n    \"node_modules/inquirer/node_modules/ansi-regex\": {\n      \"version\": \"3.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz\",\n      \"integrity\": \"sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/inquirer/node_modules/is-fullwidth-code-point\": {\n      \"version\": \"2.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz\",\n      \"integrity\": \"sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/inquirer/node_modules/string-width\": {\n      \"version\": \"2.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz\",\n      \"integrity\": \"sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"is-fullwidth-code-point\": \"^2.0.0\",\n        \"strip-ansi\": \"^4.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/inquirer/node_modules/strip-ansi\": {\n      \"version\": \"4.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz\",\n      \"integrity\": \"sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"ansi-regex\": \"^3.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/internal-slot\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz\",\n      \"integrity\": \"sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"es-errors\": \"^1.3.0\",\n        \"hasown\": \"^2.0.2\",\n        \"side-channel\": \"^1.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      }\n    },\n    \"node_modules/interpret\": {\n      \"version\": \"2.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz\",\n      \"integrity\": \"sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">= 0.10\"\n      }\n    },\n    \"node_modules/invariant\": {\n      \"version\": \"2.2.4\",\n      \"resolved\": \"https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz\",\n      \"integrity\": \"sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"loose-envify\": \"^1.0.0\"\n      }\n    },\n    \"node_modules/is-accessor-descriptor\": {\n      \"version\": \"0.1.6\",\n      \"resolved\": \"https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz\",\n      \"integrity\": \"sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=\",\n      \"deprecated\": \"Please upgrade to v0.1.7\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"kind-of\": \"^3.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/is-accessor-descriptor/node_modules/kind-of\": {\n      \"version\": \"3.2.2\",\n      \"resolved\": \"https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz\",\n      \"integrity\": \"sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-buffer\": \"^1.1.5\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/is-array-buffer\": {\n      \"version\": \"3.0.5\",\n      \"resolved\": \"https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz\",\n      \"integrity\": \"sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bind\": \"^1.0.8\",\n        \"call-bound\": \"^1.0.3\",\n        \"get-intrinsic\": \"^1.2.6\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/is-async-function\": {\n      \"version\": \"2.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz\",\n      \"integrity\": \"sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"async-function\": \"^1.0.0\",\n        \"call-bound\": \"^1.0.3\",\n        \"get-proto\": \"^1.0.1\",\n        \"has-tostringtag\": \"^1.0.2\",\n        \"safe-regex-test\": \"^1.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/is-bigint\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz\",\n      \"integrity\": \"sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"has-bigints\": \"^1.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/is-binary-path\": {\n      \"version\": \"2.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz\",\n      \"integrity\": \"sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==\",\n      \"dev\": true,\n      \"optional\": true,\n      \"dependencies\": {\n        \"binary-extensions\": \"^2.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/is-boolean-object\": {\n      \"version\": \"1.2.2\",\n      \"resolved\": \"https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz\",\n      \"integrity\": \"sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bound\": \"^1.0.3\",\n        \"has-tostringtag\": \"^1.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/is-buffer\": {\n      \"version\": \"1.1.6\",\n      \"resolved\": \"https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz\",\n      \"integrity\": \"sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==\",\n      \"dev\": true\n    },\n    \"node_modules/is-callable\": {\n      \"version\": \"1.2.7\",\n      \"resolved\": \"https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz\",\n      \"integrity\": \"sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/is-core-module\": {\n      \"version\": \"2.16.1\",\n      \"resolved\": \"https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz\",\n      \"integrity\": \"sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"hasown\": \"^2.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/is-data-descriptor\": {\n      \"version\": \"0.1.4\",\n      \"resolved\": \"https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz\",\n      \"integrity\": \"sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=\",\n      \"deprecated\": \"Please upgrade to v0.1.5\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"kind-of\": \"^3.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/is-data-descriptor/node_modules/kind-of\": {\n      \"version\": \"3.2.2\",\n      \"resolved\": \"https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz\",\n      \"integrity\": \"sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-buffer\": \"^1.1.5\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/is-data-view\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz\",\n      \"integrity\": \"sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bound\": \"^1.0.2\",\n        \"get-intrinsic\": \"^1.2.6\",\n        \"is-typed-array\": \"^1.1.13\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/is-date-object\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz\",\n      \"integrity\": \"sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bound\": \"^1.0.2\",\n        \"has-tostringtag\": \"^1.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/is-descriptor\": {\n      \"version\": \"0.1.6\",\n      \"resolved\": \"https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz\",\n      \"integrity\": \"sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-accessor-descriptor\": \"^0.1.6\",\n        \"is-data-descriptor\": \"^0.1.4\",\n        \"kind-of\": \"^5.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/is-descriptor/node_modules/kind-of\": {\n      \"version\": \"5.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz\",\n      \"integrity\": \"sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/is-extendable\": {\n      \"version\": \"0.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz\",\n      \"integrity\": \"sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/is-extglob\": {\n      \"version\": \"2.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz\",\n      \"integrity\": \"sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=\",\n      \"dev\": true,\n      \"optional\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/is-finalizationregistry\": {\n      \"version\": \"1.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz\",\n      \"integrity\": \"sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bound\": \"^1.0.3\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/is-fullwidth-code-point\": {\n      \"version\": \"3.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz\",\n      \"integrity\": \"sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/is-generator-function\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz\",\n      \"integrity\": \"sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bound\": \"^1.0.3\",\n        \"get-proto\": \"^1.0.0\",\n        \"has-tostringtag\": \"^1.0.2\",\n        \"safe-regex-test\": \"^1.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/is-glob\": {\n      \"version\": \"4.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz\",\n      \"integrity\": \"sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==\",\n      \"dev\": true,\n      \"optional\": true,\n      \"dependencies\": {\n        \"is-extglob\": \"^2.1.1\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/is-map\": {\n      \"version\": \"2.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz\",\n      \"integrity\": \"sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/is-negative-zero\": {\n      \"version\": \"2.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz\",\n      \"integrity\": \"sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/is-number\": {\n      \"version\": \"3.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz\",\n      \"integrity\": \"sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"kind-of\": \"^3.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/is-number-object\": {\n      \"version\": \"1.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz\",\n      \"integrity\": \"sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bound\": \"^1.0.3\",\n        \"has-tostringtag\": \"^1.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/is-number/node_modules/kind-of\": {\n      \"version\": \"3.2.2\",\n      \"resolved\": \"https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz\",\n      \"integrity\": \"sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-buffer\": \"^1.1.5\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/is-plain-obj\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz\",\n      \"integrity\": \"sha1-caUMhCnfync8kqOQpKA7OfzVHT4=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/is-plain-object\": {\n      \"version\": \"2.0.4\",\n      \"resolved\": \"https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz\",\n      \"integrity\": \"sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"isobject\": \"^3.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/is-regex\": {\n      \"version\": \"1.2.1\",\n      \"resolved\": \"https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz\",\n      \"integrity\": \"sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bound\": \"^1.0.2\",\n        \"gopd\": \"^1.2.0\",\n        \"has-tostringtag\": \"^1.0.2\",\n        \"hasown\": \"^2.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/is-resolvable\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz\",\n      \"integrity\": \"sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==\",\n      \"dev\": true,\n      \"license\": \"ISC\"\n    },\n    \"node_modules/is-set\": {\n      \"version\": \"2.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz\",\n      \"integrity\": \"sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/is-shared-array-buffer\": {\n      \"version\": \"1.0.4\",\n      \"resolved\": \"https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz\",\n      \"integrity\": \"sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bound\": \"^1.0.3\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/is-string\": {\n      \"version\": \"1.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz\",\n      \"integrity\": \"sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bound\": \"^1.0.3\",\n        \"has-tostringtag\": \"^1.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/is-symbol\": {\n      \"version\": \"1.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz\",\n      \"integrity\": \"sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bound\": \"^1.0.2\",\n        \"has-symbols\": \"^1.1.0\",\n        \"safe-regex-test\": \"^1.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/is-typed-array\": {\n      \"version\": \"1.1.15\",\n      \"resolved\": \"https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz\",\n      \"integrity\": \"sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"which-typed-array\": \"^1.1.16\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/is-weakmap\": {\n      \"version\": \"2.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz\",\n      \"integrity\": \"sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/is-weakref\": {\n      \"version\": \"1.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz\",\n      \"integrity\": \"sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bound\": \"^1.0.3\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/is-weakset\": {\n      \"version\": \"2.0.4\",\n      \"resolved\": \"https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz\",\n      \"integrity\": \"sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bound\": \"^1.0.3\",\n        \"get-intrinsic\": \"^1.2.6\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/is-windows\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz\",\n      \"integrity\": \"sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/is-wsl\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz\",\n      \"integrity\": \"sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/isarray\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz\",\n      \"integrity\": \"sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=\",\n      \"dev\": true\n    },\n    \"node_modules/isexe\": {\n      \"version\": \"2.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz\",\n      \"integrity\": \"sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==\",\n      \"dev\": true,\n      \"license\": \"ISC\"\n    },\n    \"node_modules/isobject\": {\n      \"version\": \"3.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz\",\n      \"integrity\": \"sha1-TkMekrEalzFjaqH5yNHMvP2reN8=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/jquery\": {\n      \"version\": \"3.5.1\",\n      \"resolved\": \"https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz\",\n      \"integrity\": \"sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg==\",\n      \"dev\": true\n    },\n    \"node_modules/js-tokens\": {\n      \"version\": \"4.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz\",\n      \"integrity\": \"sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==\",\n      \"dev\": true\n    },\n    \"node_modules/js-yaml\": {\n      \"version\": \"3.14.1\",\n      \"resolved\": \"https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz\",\n      \"integrity\": \"sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"argparse\": \"^1.0.7\",\n        \"esprima\": \"^4.0.0\"\n      },\n      \"bin\": {\n        \"js-yaml\": \"bin/js-yaml.js\"\n      }\n    },\n    \"node_modules/jsesc\": {\n      \"version\": \"2.5.2\",\n      \"resolved\": \"https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz\",\n      \"integrity\": \"sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==\",\n      \"dev\": true,\n      \"bin\": {\n        \"jsesc\": \"bin/jsesc\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/json-parse-better-errors\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz\",\n      \"integrity\": \"sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==\",\n      \"dev\": true\n    },\n    \"node_modules/json-schema-traverse\": {\n      \"version\": \"0.4.1\",\n      \"resolved\": \"https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz\",\n      \"integrity\": \"sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==\",\n      \"dev\": true\n    },\n    \"node_modules/json-stable-stringify-without-jsonify\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz\",\n      \"integrity\": \"sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==\",\n      \"dev\": true,\n      \"license\": \"MIT\"\n    },\n    \"node_modules/json5\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/json5/-/json5-1.0.1.tgz\",\n      \"integrity\": \"sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"minimist\": \"^1.2.0\"\n      },\n      \"bin\": {\n        \"json5\": \"lib/cli.js\"\n      }\n    },\n    \"node_modules/jsonfile\": {\n      \"version\": \"4.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz\",\n      \"integrity\": \"sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=\",\n      \"dev\": true,\n      \"optionalDependencies\": {\n        \"graceful-fs\": \"^4.1.6\"\n      }\n    },\n    \"node_modules/kind-of\": {\n      \"version\": \"6.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz\",\n      \"integrity\": \"sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/knockout\": {\n      \"version\": \"3.5.1\",\n      \"resolved\": \"https://registry.npmjs.org/knockout/-/knockout-3.5.1.tgz\",\n      \"integrity\": \"sha512-wRJ9I4az0QcsH7A4v4l0enUpkS++MBx0BnL/68KaLzJg7x1qmbjSlwEoCNol7KTYZ+pmtI7Eh2J0Nu6/2Z5J/Q==\",\n      \"dev\": true\n    },\n    \"node_modules/leven\": {\n      \"version\": \"3.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/leven/-/leven-3.1.0.tgz\",\n      \"integrity\": \"sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=6\"\n      }\n    },\n    \"node_modules/levenary\": {\n      \"version\": \"1.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/levenary/-/levenary-1.1.1.tgz\",\n      \"integrity\": \"sha512-mkAdOIt79FD6irqjYSs4rdbnlT5vRonMEvBVPVb3XmevfS8kgRXwfes0dhPdEtzTWD/1eNE/Bm/G1iRt6DcnQQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"leven\": \"^3.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 6\"\n      }\n    },\n    \"node_modules/levn\": {\n      \"version\": \"0.3.0\",\n      \"resolved\": \"https://registry.npmjs.org/levn/-/levn-0.3.0.tgz\",\n      \"integrity\": \"sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"prelude-ls\": \"~1.1.2\",\n        \"type-check\": \"~0.3.2\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.8.0\"\n      }\n    },\n    \"node_modules/loader-runner\": {\n      \"version\": \"2.4.0\",\n      \"resolved\": \"https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz\",\n      \"integrity\": \"sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=4.3.0 <5.0.0 || >=5.10\"\n      }\n    },\n    \"node_modules/loader-utils\": {\n      \"version\": \"1.4.0\",\n      \"resolved\": \"https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz\",\n      \"integrity\": \"sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"big.js\": \"^5.2.2\",\n        \"emojis-list\": \"^3.0.0\",\n        \"json5\": \"^1.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">=4.0.0\"\n      }\n    },\n    \"node_modules/locate-path\": {\n      \"version\": \"3.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz\",\n      \"integrity\": \"sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"p-locate\": \"^3.0.0\",\n        \"path-exists\": \"^3.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=6\"\n      }\n    },\n    \"node_modules/lodash\": {\n      \"version\": \"4.17.19\",\n      \"resolved\": \"https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz\",\n      \"integrity\": \"sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==\",\n      \"dev\": true\n    },\n    \"node_modules/loose-envify\": {\n      \"version\": \"1.4.0\",\n      \"resolved\": \"https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz\",\n      \"integrity\": \"sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"js-tokens\": \"^3.0.0 || ^4.0.0\"\n      },\n      \"bin\": {\n        \"loose-envify\": \"cli.js\"\n      }\n    },\n    \"node_modules/lru-cache\": {\n      \"version\": \"5.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz\",\n      \"integrity\": \"sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"yallist\": \"^3.0.2\"\n      }\n    },\n    \"node_modules/make-dir\": {\n      \"version\": \"2.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz\",\n      \"integrity\": \"sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"pify\": \"^4.0.1\",\n        \"semver\": \"^5.6.0\"\n      },\n      \"engines\": {\n        \"node\": \">=6\"\n      }\n    },\n    \"node_modules/map-cache\": {\n      \"version\": \"0.2.2\",\n      \"resolved\": \"https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz\",\n      \"integrity\": \"sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/map-visit\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz\",\n      \"integrity\": \"sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"object-visit\": \"^1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/math-intrinsics\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz\",\n      \"integrity\": \"sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      }\n    },\n    \"node_modules/md5.js\": {\n      \"version\": \"1.3.5\",\n      \"resolved\": \"https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz\",\n      \"integrity\": \"sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"hash-base\": \"^3.0.0\",\n        \"inherits\": \"^2.0.1\",\n        \"safe-buffer\": \"^5.1.2\"\n      }\n    },\n    \"node_modules/memory-fs\": {\n      \"version\": \"0.4.1\",\n      \"resolved\": \"https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz\",\n      \"integrity\": \"sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"errno\": \"^0.1.3\",\n        \"readable-stream\": \"^2.0.1\"\n      }\n    },\n    \"node_modules/micromatch\": {\n      \"version\": \"3.1.10\",\n      \"resolved\": \"https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz\",\n      \"integrity\": \"sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"arr-diff\": \"^4.0.0\",\n        \"array-unique\": \"^0.3.2\",\n        \"braces\": \"^2.3.1\",\n        \"define-property\": \"^2.0.2\",\n        \"extend-shallow\": \"^3.0.2\",\n        \"extglob\": \"^2.0.4\",\n        \"fragment-cache\": \"^0.2.1\",\n        \"kind-of\": \"^6.0.2\",\n        \"nanomatch\": \"^1.2.9\",\n        \"object.pick\": \"^1.3.0\",\n        \"regex-not\": \"^1.0.0\",\n        \"snapdragon\": \"^0.8.1\",\n        \"to-regex\": \"^3.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/miller-rabin\": {\n      \"version\": \"4.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz\",\n      \"integrity\": \"sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"bn.js\": \"^4.0.0\",\n        \"brorand\": \"^1.0.1\"\n      },\n      \"bin\": {\n        \"miller-rabin\": \"bin/miller-rabin\"\n      }\n    },\n    \"node_modules/miller-rabin/node_modules/bn.js\": {\n      \"version\": \"4.11.9\",\n      \"resolved\": \"https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz\",\n      \"integrity\": \"sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==\",\n      \"dev\": true\n    },\n    \"node_modules/mimic-fn\": {\n      \"version\": \"1.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz\",\n      \"integrity\": \"sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/mini-css-extract-plugin\": {\n      \"version\": \"0.9.0\",\n      \"resolved\": \"https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.0.tgz\",\n      \"integrity\": \"sha512-lp3GeY7ygcgAmVIcRPBVhIkf8Us7FZjA+ILpal44qLdSu11wmjKQ3d9k15lfD7pO4esu9eUIAW7qiYIBppv40A==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"loader-utils\": \"^1.1.0\",\n        \"normalize-url\": \"1.9.1\",\n        \"schema-utils\": \"^1.0.0\",\n        \"webpack-sources\": \"^1.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 6.9.0\"\n      },\n      \"peerDependencies\": {\n        \"webpack\": \"^4.4.0\"\n      }\n    },\n    \"node_modules/minimalistic-assert\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz\",\n      \"integrity\": \"sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==\",\n      \"dev\": true\n    },\n    \"node_modules/minimalistic-crypto-utils\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz\",\n      \"integrity\": \"sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=\",\n      \"dev\": true\n    },\n    \"node_modules/minimatch\": {\n      \"version\": \"3.0.4\",\n      \"resolved\": \"https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz\",\n      \"integrity\": \"sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"brace-expansion\": \"^1.1.7\"\n      },\n      \"engines\": {\n        \"node\": \"*\"\n      }\n    },\n    \"node_modules/minimist\": {\n      \"version\": \"1.2.5\",\n      \"resolved\": \"https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz\",\n      \"integrity\": \"sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==\",\n      \"dev\": true\n    },\n    \"node_modules/mississippi\": {\n      \"version\": \"3.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz\",\n      \"integrity\": \"sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"concat-stream\": \"^1.5.0\",\n        \"duplexify\": \"^3.4.2\",\n        \"end-of-stream\": \"^1.1.0\",\n        \"flush-write-stream\": \"^1.0.0\",\n        \"from2\": \"^2.1.0\",\n        \"parallel-transform\": \"^1.1.0\",\n        \"pump\": \"^3.0.0\",\n        \"pumpify\": \"^1.3.3\",\n        \"stream-each\": \"^1.1.0\",\n        \"through2\": \"^2.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=4.0.0\"\n      }\n    },\n    \"node_modules/mixin-deep\": {\n      \"version\": \"1.3.2\",\n      \"resolved\": \"https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz\",\n      \"integrity\": \"sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"for-in\": \"^1.0.2\",\n        \"is-extendable\": \"^1.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/mixin-deep/node_modules/is-extendable\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz\",\n      \"integrity\": \"sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-plain-object\": \"^2.0.4\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/mkdirp\": {\n      \"version\": \"0.5.5\",\n      \"resolved\": \"https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz\",\n      \"integrity\": \"sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"minimist\": \"^1.2.5\"\n      },\n      \"bin\": {\n        \"mkdirp\": \"bin/cmd.js\"\n      }\n    },\n    \"node_modules/move-concurrently\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz\",\n      \"integrity\": \"sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=\",\n      \"deprecated\": \"This package is no longer supported.\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"aproba\": \"^1.1.1\",\n        \"copy-concurrently\": \"^1.0.0\",\n        \"fs-write-stream-atomic\": \"^1.0.8\",\n        \"mkdirp\": \"^0.5.1\",\n        \"rimraf\": \"^2.5.4\",\n        \"run-queue\": \"^1.0.3\"\n      }\n    },\n    \"node_modules/ms\": {\n      \"version\": \"2.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/ms/-/ms-2.0.0.tgz\",\n      \"integrity\": \"sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=\",\n      \"dev\": true\n    },\n    \"node_modules/mute-stream\": {\n      \"version\": \"0.0.7\",\n      \"resolved\": \"https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz\",\n      \"integrity\": \"sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==\",\n      \"dev\": true,\n      \"license\": \"ISC\"\n    },\n    \"node_modules/nanomatch\": {\n      \"version\": \"1.2.13\",\n      \"resolved\": \"https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz\",\n      \"integrity\": \"sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"arr-diff\": \"^4.0.0\",\n        \"array-unique\": \"^0.3.2\",\n        \"define-property\": \"^2.0.2\",\n        \"extend-shallow\": \"^3.0.2\",\n        \"fragment-cache\": \"^0.2.1\",\n        \"is-windows\": \"^1.0.2\",\n        \"kind-of\": \"^6.0.2\",\n        \"object.pick\": \"^1.3.0\",\n        \"regex-not\": \"^1.0.0\",\n        \"snapdragon\": \"^0.8.1\",\n        \"to-regex\": \"^3.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/natural-compare\": {\n      \"version\": \"1.4.0\",\n      \"resolved\": \"https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz\",\n      \"integrity\": \"sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==\",\n      \"dev\": true,\n      \"license\": \"MIT\"\n    },\n    \"node_modules/neo-async\": {\n      \"version\": \"2.6.2\",\n      \"resolved\": \"https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz\",\n      \"integrity\": \"sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==\",\n      \"dev\": true\n    },\n    \"node_modules/nice-try\": {\n      \"version\": \"1.0.5\",\n      \"resolved\": \"https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz\",\n      \"integrity\": \"sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\"\n    },\n    \"node_modules/node-libs-browser\": {\n      \"version\": \"2.2.1\",\n      \"resolved\": \"https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz\",\n      \"integrity\": \"sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"assert\": \"^1.1.1\",\n        \"browserify-zlib\": \"^0.2.0\",\n        \"buffer\": \"^4.3.0\",\n        \"console-browserify\": \"^1.1.0\",\n        \"constants-browserify\": \"^1.0.0\",\n        \"crypto-browserify\": \"^3.11.0\",\n        \"domain-browser\": \"^1.1.1\",\n        \"events\": \"^3.0.0\",\n        \"https-browserify\": \"^1.0.0\",\n        \"os-browserify\": \"^0.3.0\",\n        \"path-browserify\": \"0.0.1\",\n        \"process\": \"^0.11.10\",\n        \"punycode\": \"^1.2.4\",\n        \"querystring-es3\": \"^0.2.0\",\n        \"readable-stream\": \"^2.3.3\",\n        \"stream-browserify\": \"^2.0.1\",\n        \"stream-http\": \"^2.7.2\",\n        \"string_decoder\": \"^1.0.0\",\n        \"timers-browserify\": \"^2.0.4\",\n        \"tty-browserify\": \"0.0.0\",\n        \"url\": \"^0.11.0\",\n        \"util\": \"^0.11.0\",\n        \"vm-browserify\": \"^1.0.1\"\n      }\n    },\n    \"node_modules/node-libs-browser/node_modules/punycode\": {\n      \"version\": \"1.4.1\",\n      \"resolved\": \"https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz\",\n      \"integrity\": \"sha1-wNWmOycYgArY4esPpSachN1BhF4=\",\n      \"dev\": true\n    },\n    \"node_modules/node-releases\": {\n      \"version\": \"1.1.60\",\n      \"resolved\": \"https://registry.npmjs.org/node-releases/-/node-releases-1.1.60.tgz\",\n      \"integrity\": \"sha512-gsO4vjEdQaTusZAEebUWp2a5d7dF5DYoIpDG7WySnk7BuZDW+GPpHXoXXuYawRBr/9t5q54tirPz79kFIWg4dA==\",\n      \"dev\": true\n    },\n    \"node_modules/normalize-path\": {\n      \"version\": \"3.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz\",\n      \"integrity\": \"sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/normalize-url\": {\n      \"version\": \"1.9.1\",\n      \"resolved\": \"https://registry.npmjs.org/normalize-url/-/normalize-url-1.9.1.tgz\",\n      \"integrity\": \"sha1-LMDWazHqIwNkWENuNiDYWVTGbDw=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"object-assign\": \"^4.0.1\",\n        \"prepend-http\": \"^1.0.0\",\n        \"query-string\": \"^4.1.0\",\n        \"sort-keys\": \"^1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/object-assign\": {\n      \"version\": \"4.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz\",\n      \"integrity\": \"sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/object-copy\": {\n      \"version\": \"0.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz\",\n      \"integrity\": \"sha1-fn2Fi3gb18mRpBupde04EnVOmYw=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"copy-descriptor\": \"^0.1.0\",\n        \"define-property\": \"^0.2.5\",\n        \"kind-of\": \"^3.0.3\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/object-copy/node_modules/define-property\": {\n      \"version\": \"0.2.5\",\n      \"resolved\": \"https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz\",\n      \"integrity\": \"sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-descriptor\": \"^0.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/object-copy/node_modules/kind-of\": {\n      \"version\": \"3.2.2\",\n      \"resolved\": \"https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz\",\n      \"integrity\": \"sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-buffer\": \"^1.1.5\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/object-hash\": {\n      \"version\": \"2.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/object-hash/-/object-hash-2.0.3.tgz\",\n      \"integrity\": \"sha512-JPKn0GMu+Fa3zt3Bmr66JhokJU5BaNBIh4ZeTlaCBzrBsOeXzwcKKAK1tbLiPKgvwmPXsDvvLHoWh5Bm7ofIYg==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">= 6\"\n      }\n    },\n    \"node_modules/object-inspect\": {\n      \"version\": \"1.13.4\",\n      \"resolved\": \"https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz\",\n      \"integrity\": \"sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/object-keys\": {\n      \"version\": \"1.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz\",\n      \"integrity\": \"sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      }\n    },\n    \"node_modules/object-visit\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz\",\n      \"integrity\": \"sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"isobject\": \"^3.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/object.assign\": {\n      \"version\": \"4.1.7\",\n      \"resolved\": \"https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz\",\n      \"integrity\": \"sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bind\": \"^1.0.8\",\n        \"call-bound\": \"^1.0.3\",\n        \"define-properties\": \"^1.2.1\",\n        \"es-object-atoms\": \"^1.0.0\",\n        \"has-symbols\": \"^1.1.0\",\n        \"object-keys\": \"^1.1.1\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/object.pick\": {\n      \"version\": \"1.3.0\",\n      \"resolved\": \"https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz\",\n      \"integrity\": \"sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"isobject\": \"^3.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/once\": {\n      \"version\": \"1.4.0\",\n      \"resolved\": \"https://registry.npmjs.org/once/-/once-1.4.0.tgz\",\n      \"integrity\": \"sha1-WDsap3WWHUsROsF9nFC6753Xa9E=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"wrappy\": \"1\"\n      }\n    },\n    \"node_modules/onetime\": {\n      \"version\": \"2.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz\",\n      \"integrity\": \"sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"mimic-fn\": \"^1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/optionator\": {\n      \"version\": \"0.8.3\",\n      \"resolved\": \"https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz\",\n      \"integrity\": \"sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"deep-is\": \"~0.1.3\",\n        \"fast-levenshtein\": \"~2.0.6\",\n        \"levn\": \"~0.3.0\",\n        \"prelude-ls\": \"~1.1.2\",\n        \"type-check\": \"~0.3.2\",\n        \"word-wrap\": \"~1.2.3\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.8.0\"\n      }\n    },\n    \"node_modules/os-browserify\": {\n      \"version\": \"0.3.0\",\n      \"resolved\": \"https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz\",\n      \"integrity\": \"sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=\",\n      \"dev\": true\n    },\n    \"node_modules/os-tmpdir\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz\",\n      \"integrity\": \"sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/own-keys\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz\",\n      \"integrity\": \"sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"get-intrinsic\": \"^1.2.6\",\n        \"object-keys\": \"^1.1.1\",\n        \"safe-push-apply\": \"^1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/p-limit\": {\n      \"version\": \"2.3.0\",\n      \"resolved\": \"https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz\",\n      \"integrity\": \"sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"p-try\": \"^2.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=6\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/sindresorhus\"\n      }\n    },\n    \"node_modules/p-locate\": {\n      \"version\": \"3.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz\",\n      \"integrity\": \"sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"p-limit\": \"^2.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=6\"\n      }\n    },\n    \"node_modules/p-try\": {\n      \"version\": \"2.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz\",\n      \"integrity\": \"sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=6\"\n      }\n    },\n    \"node_modules/pako\": {\n      \"version\": \"1.0.11\",\n      \"resolved\": \"https://registry.npmjs.org/pako/-/pako-1.0.11.tgz\",\n      \"integrity\": \"sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==\",\n      \"dev\": true\n    },\n    \"node_modules/parallel-transform\": {\n      \"version\": \"1.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz\",\n      \"integrity\": \"sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"cyclist\": \"^1.0.1\",\n        \"inherits\": \"^2.0.3\",\n        \"readable-stream\": \"^2.1.5\"\n      }\n    },\n    \"node_modules/parse-asn1\": {\n      \"version\": \"5.1.5\",\n      \"resolved\": \"https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz\",\n      \"integrity\": \"sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"asn1.js\": \"^4.0.0\",\n        \"browserify-aes\": \"^1.0.0\",\n        \"create-hash\": \"^1.1.0\",\n        \"evp_bytestokey\": \"^1.0.0\",\n        \"pbkdf2\": \"^3.0.3\",\n        \"safe-buffer\": \"^5.1.1\"\n      }\n    },\n    \"node_modules/pascalcase\": {\n      \"version\": \"0.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz\",\n      \"integrity\": \"sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/path\": {\n      \"version\": \"0.12.7\",\n      \"resolved\": \"https://registry.npmjs.org/path/-/path-0.12.7.tgz\",\n      \"integrity\": \"sha1-1NwqUGxM4hl+tIHr/NWzbAFAsQ8=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"process\": \"^0.11.1\",\n        \"util\": \"^0.10.3\"\n      }\n    },\n    \"node_modules/path-browserify\": {\n      \"version\": \"0.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz\",\n      \"integrity\": \"sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==\",\n      \"dev\": true\n    },\n    \"node_modules/path-dirname\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz\",\n      \"integrity\": \"sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=\",\n      \"dev\": true,\n      \"optional\": true\n    },\n    \"node_modules/path-exists\": {\n      \"version\": \"3.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz\",\n      \"integrity\": \"sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/path-is-absolute\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz\",\n      \"integrity\": \"sha1-F0uSaHNVNP+8es5r9TpanhtcX18=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/path-is-inside\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz\",\n      \"integrity\": \"sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==\",\n      \"dev\": true,\n      \"license\": \"(WTFPL OR MIT)\"\n    },\n    \"node_modules/path-key\": {\n      \"version\": \"2.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz\",\n      \"integrity\": \"sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/path-parse\": {\n      \"version\": \"1.0.7\",\n      \"resolved\": \"https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz\",\n      \"integrity\": \"sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==\",\n      \"dev\": true,\n      \"license\": \"MIT\"\n    },\n    \"node_modules/path/node_modules/inherits\": {\n      \"version\": \"2.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz\",\n      \"integrity\": \"sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=\",\n      \"dev\": true\n    },\n    \"node_modules/path/node_modules/util\": {\n      \"version\": \"0.10.4\",\n      \"resolved\": \"https://registry.npmjs.org/util/-/util-0.10.4.tgz\",\n      \"integrity\": \"sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"inherits\": \"2.0.3\"\n      }\n    },\n    \"node_modules/pbkdf2\": {\n      \"version\": \"3.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz\",\n      \"integrity\": \"sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"create-hash\": \"^1.1.2\",\n        \"create-hmac\": \"^1.1.4\",\n        \"ripemd160\": \"^2.0.1\",\n        \"safe-buffer\": \"^5.0.1\",\n        \"sha.js\": \"^2.4.8\"\n      },\n      \"engines\": {\n        \"node\": \">=0.12\"\n      }\n    },\n    \"node_modules/picocolors\": {\n      \"version\": \"1.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz\",\n      \"integrity\": \"sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==\",\n      \"dev\": true,\n      \"license\": \"ISC\"\n    },\n    \"node_modules/picomatch\": {\n      \"version\": \"2.2.2\",\n      \"resolved\": \"https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz\",\n      \"integrity\": \"sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==\",\n      \"dev\": true,\n      \"optional\": true,\n      \"engines\": {\n        \"node\": \">=8.6\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/jonschlinkert\"\n      }\n    },\n    \"node_modules/pify\": {\n      \"version\": \"4.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/pify/-/pify-4.0.1.tgz\",\n      \"integrity\": \"sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=6\"\n      }\n    },\n    \"node_modules/pkg-dir\": {\n      \"version\": \"3.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz\",\n      \"integrity\": \"sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"find-up\": \"^3.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=6\"\n      }\n    },\n    \"node_modules/pluralize\": {\n      \"version\": \"7.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz\",\n      \"integrity\": \"sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/posix-character-classes\": {\n      \"version\": \"0.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz\",\n      \"integrity\": \"sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/possible-typed-array-names\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz\",\n      \"integrity\": \"sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      }\n    },\n    \"node_modules/postcss\": {\n      \"version\": \"7.0.32\",\n      \"resolved\": \"https://registry.npmjs.org/postcss/-/postcss-7.0.32.tgz\",\n      \"integrity\": \"sha512-03eXong5NLnNCD05xscnGKGDZ98CyzoqPSMjOe6SuoQY7Z2hIj0Ld1g/O/UQRuOle2aRtiIRDg9tDcTGAkLfKw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"chalk\": \"^2.4.2\",\n        \"source-map\": \"^0.6.1\",\n        \"supports-color\": \"^6.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=6.0.0\"\n      },\n      \"funding\": {\n        \"type\": \"tidelift\",\n        \"url\": \"https://tidelift.com/funding/github/npm/postcss\"\n      }\n    },\n    \"node_modules/postcss-modules-extract-imports\": {\n      \"version\": \"2.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-2.0.0.tgz\",\n      \"integrity\": \"sha512-LaYLDNS4SG8Q5WAWqIJgdHPJrDDr/Lv775rMBFUbgjTz6j34lUznACHcdRWroPvXANP2Vj7yNK57vp9eFqzLWQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"postcss\": \"^7.0.5\"\n      },\n      \"engines\": {\n        \"node\": \">= 6\"\n      }\n    },\n    \"node_modules/postcss-modules-local-by-default\": {\n      \"version\": \"3.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-3.0.3.tgz\",\n      \"integrity\": \"sha512-e3xDq+LotiGesympRlKNgaJ0PCzoUIdpH0dj47iWAui/kyTgh3CiAr1qP54uodmJhl6p9rN6BoNcdEDVJx9RDw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"icss-utils\": \"^4.1.1\",\n        \"postcss\": \"^7.0.32\",\n        \"postcss-selector-parser\": \"^6.0.2\",\n        \"postcss-value-parser\": \"^4.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 6\"\n      }\n    },\n    \"node_modules/postcss-modules-scope\": {\n      \"version\": \"2.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-2.2.0.tgz\",\n      \"integrity\": \"sha512-YyEgsTMRpNd+HmyC7H/mh3y+MeFWevy7V1evVhJWewmMbjDHIbZbOXICC2y+m1xI1UVfIT1HMW/O04Hxyu9oXQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"postcss\": \"^7.0.6\",\n        \"postcss-selector-parser\": \"^6.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 6\"\n      }\n    },\n    \"node_modules/postcss-modules-values\": {\n      \"version\": \"3.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-3.0.0.tgz\",\n      \"integrity\": \"sha512-1//E5jCBrZ9DmRX+zCtmQtRSV6PV42Ix7Bzj9GbwJceduuf7IqP8MgeTXuRDHOWj2m0VzZD5+roFWDuU8RQjcg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"icss-utils\": \"^4.0.0\",\n        \"postcss\": \"^7.0.6\"\n      }\n    },\n    \"node_modules/postcss-selector-parser\": {\n      \"version\": \"6.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.2.tgz\",\n      \"integrity\": \"sha512-36P2QR59jDTOAiIkqEprfJDsoNrvwFei3eCqKd1Y0tUsBimsq39BLp7RD+JWny3WgB1zGhJX8XVePwm9k4wdBg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"cssesc\": \"^3.0.0\",\n        \"indexes-of\": \"^1.0.1\",\n        \"uniq\": \"^1.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/postcss-value-parser\": {\n      \"version\": \"4.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz\",\n      \"integrity\": \"sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==\",\n      \"dev\": true\n    },\n    \"node_modules/postcss/node_modules/source-map\": {\n      \"version\": \"0.6.1\",\n      \"resolved\": \"https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz\",\n      \"integrity\": \"sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/postcss/node_modules/supports-color\": {\n      \"version\": \"6.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz\",\n      \"integrity\": \"sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"has-flag\": \"^3.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=6\"\n      }\n    },\n    \"node_modules/prelude-ls\": {\n      \"version\": \"1.1.2\",\n      \"resolved\": \"https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz\",\n      \"integrity\": \"sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">= 0.8.0\"\n      }\n    },\n    \"node_modules/prepend-http\": {\n      \"version\": \"1.0.4\",\n      \"resolved\": \"https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz\",\n      \"integrity\": \"sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/process\": {\n      \"version\": \"0.11.10\",\n      \"resolved\": \"https://registry.npmjs.org/process/-/process-0.11.10.tgz\",\n      \"integrity\": \"sha1-czIwDoQBYb2j5podHZGn1LwW8YI=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">= 0.6.0\"\n      }\n    },\n    \"node_modules/process-nextick-args\": {\n      \"version\": \"2.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz\",\n      \"integrity\": \"sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==\",\n      \"dev\": true\n    },\n    \"node_modules/progress\": {\n      \"version\": \"2.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/progress/-/progress-2.0.3.tgz\",\n      \"integrity\": \"sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=0.4.0\"\n      }\n    },\n    \"node_modules/promise-inflight\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz\",\n      \"integrity\": \"sha1-mEcocL8igTL8vdhoEputEsPAKeM=\",\n      \"dev\": true\n    },\n    \"node_modules/prr\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/prr/-/prr-1.0.1.tgz\",\n      \"integrity\": \"sha1-0/wRS6BplaRexok/SEzrHXj19HY=\",\n      \"dev\": true\n    },\n    \"node_modules/public-encrypt\": {\n      \"version\": \"4.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz\",\n      \"integrity\": \"sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"bn.js\": \"^4.1.0\",\n        \"browserify-rsa\": \"^4.0.0\",\n        \"create-hash\": \"^1.1.0\",\n        \"parse-asn1\": \"^5.0.0\",\n        \"randombytes\": \"^2.0.1\",\n        \"safe-buffer\": \"^5.1.2\"\n      }\n    },\n    \"node_modules/public-encrypt/node_modules/bn.js\": {\n      \"version\": \"4.11.9\",\n      \"resolved\": \"https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz\",\n      \"integrity\": \"sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==\",\n      \"dev\": true\n    },\n    \"node_modules/pump\": {\n      \"version\": \"3.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/pump/-/pump-3.0.0.tgz\",\n      \"integrity\": \"sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"end-of-stream\": \"^1.1.0\",\n        \"once\": \"^1.3.1\"\n      }\n    },\n    \"node_modules/pumpify\": {\n      \"version\": \"1.5.1\",\n      \"resolved\": \"https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz\",\n      \"integrity\": \"sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"duplexify\": \"^3.6.0\",\n        \"inherits\": \"^2.0.3\",\n        \"pump\": \"^2.0.0\"\n      }\n    },\n    \"node_modules/pumpify/node_modules/pump\": {\n      \"version\": \"2.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/pump/-/pump-2.0.1.tgz\",\n      \"integrity\": \"sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"end-of-stream\": \"^1.1.0\",\n        \"once\": \"^1.3.1\"\n      }\n    },\n    \"node_modules/punycode\": {\n      \"version\": \"2.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz\",\n      \"integrity\": \"sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=6\"\n      }\n    },\n    \"node_modules/query-string\": {\n      \"version\": \"4.3.4\",\n      \"resolved\": \"https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz\",\n      \"integrity\": \"sha1-u7aTucqRXCMlFbIosaArYJBD2+s=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"object-assign\": \"^4.1.0\",\n        \"strict-uri-encode\": \"^1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/querystring\": {\n      \"version\": \"0.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz\",\n      \"integrity\": \"sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=\",\n      \"deprecated\": \"The querystring API is considered Legacy. new code should use the URLSearchParams API instead.\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.4.x\"\n      }\n    },\n    \"node_modules/querystring-es3\": {\n      \"version\": \"0.2.1\",\n      \"resolved\": \"https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz\",\n      \"integrity\": \"sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.4.x\"\n      }\n    },\n    \"node_modules/randombytes\": {\n      \"version\": \"2.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz\",\n      \"integrity\": \"sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"safe-buffer\": \"^5.1.0\"\n      }\n    },\n    \"node_modules/randomfill\": {\n      \"version\": \"1.0.4\",\n      \"resolved\": \"https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz\",\n      \"integrity\": \"sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"randombytes\": \"^2.0.5\",\n        \"safe-buffer\": \"^5.1.0\"\n      }\n    },\n    \"node_modules/readable-stream\": {\n      \"version\": \"2.3.7\",\n      \"resolved\": \"https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz\",\n      \"integrity\": \"sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"core-util-is\": \"~1.0.0\",\n        \"inherits\": \"~2.0.3\",\n        \"isarray\": \"~1.0.0\",\n        \"process-nextick-args\": \"~2.0.0\",\n        \"safe-buffer\": \"~5.1.1\",\n        \"string_decoder\": \"~1.1.1\",\n        \"util-deprecate\": \"~1.0.1\"\n      }\n    },\n    \"node_modules/readdirp\": {\n      \"version\": \"3.4.0\",\n      \"resolved\": \"https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz\",\n      \"integrity\": \"sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==\",\n      \"dev\": true,\n      \"optional\": true,\n      \"dependencies\": {\n        \"picomatch\": \"^2.2.1\"\n      },\n      \"engines\": {\n        \"node\": \">=8.10.0\"\n      }\n    },\n    \"node_modules/rechoir\": {\n      \"version\": \"0.7.1\",\n      \"resolved\": \"https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz\",\n      \"integrity\": \"sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"resolve\": \"^1.9.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.10\"\n      }\n    },\n    \"node_modules/reflect.getprototypeof\": {\n      \"version\": \"1.0.10\",\n      \"resolved\": \"https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz\",\n      \"integrity\": \"sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bind\": \"^1.0.8\",\n        \"define-properties\": \"^1.2.1\",\n        \"es-abstract\": \"^1.23.9\",\n        \"es-errors\": \"^1.3.0\",\n        \"es-object-atoms\": \"^1.0.0\",\n        \"get-intrinsic\": \"^1.2.7\",\n        \"get-proto\": \"^1.0.1\",\n        \"which-builtin-type\": \"^1.2.1\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/regenerate\": {\n      \"version\": \"1.4.1\",\n      \"resolved\": \"https://registry.npmjs.org/regenerate/-/regenerate-1.4.1.tgz\",\n      \"integrity\": \"sha512-j2+C8+NtXQgEKWk49MMP5P/u2GhnahTtVkRIHr5R5lVRlbKvmQ+oS+A5aLKWp2ma5VkT8sh6v+v4hbH0YHR66A==\",\n      \"dev\": true\n    },\n    \"node_modules/regenerate-unicode-properties\": {\n      \"version\": \"8.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz\",\n      \"integrity\": \"sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"regenerate\": \"^1.4.0\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/regenerator-runtime\": {\n      \"version\": \"0.13.7\",\n      \"resolved\": \"https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz\",\n      \"integrity\": \"sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==\",\n      \"dev\": true\n    },\n    \"node_modules/regenerator-transform\": {\n      \"version\": \"0.14.5\",\n      \"resolved\": \"https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz\",\n      \"integrity\": \"sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@babel/runtime\": \"^7.8.4\"\n      }\n    },\n    \"node_modules/regex-not\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz\",\n      \"integrity\": \"sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"extend-shallow\": \"^3.0.2\",\n        \"safe-regex\": \"^1.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/regexp.prototype.flags\": {\n      \"version\": \"1.5.4\",\n      \"resolved\": \"https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz\",\n      \"integrity\": \"sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bind\": \"^1.0.8\",\n        \"define-properties\": \"^1.2.1\",\n        \"es-errors\": \"^1.3.0\",\n        \"get-proto\": \"^1.0.1\",\n        \"gopd\": \"^1.2.0\",\n        \"set-function-name\": \"^2.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/regexpp\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz\",\n      \"integrity\": \"sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=4.0.0\"\n      }\n    },\n    \"node_modules/regexpu-core\": {\n      \"version\": \"4.7.0\",\n      \"resolved\": \"https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.0.tgz\",\n      \"integrity\": \"sha512-TQ4KXRnIn6tz6tjnrXEkD/sshygKH/j5KzK86X8MkeHyZ8qst/LZ89j3X4/8HEIfHANTFIP/AbXakeRhWIl5YQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"regenerate\": \"^1.4.0\",\n        \"regenerate-unicode-properties\": \"^8.2.0\",\n        \"regjsgen\": \"^0.5.1\",\n        \"regjsparser\": \"^0.6.4\",\n        \"unicode-match-property-ecmascript\": \"^1.0.4\",\n        \"unicode-match-property-value-ecmascript\": \"^1.2.0\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/regjsgen\": {\n      \"version\": \"0.5.2\",\n      \"resolved\": \"https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz\",\n      \"integrity\": \"sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==\",\n      \"dev\": true\n    },\n    \"node_modules/regjsparser\": {\n      \"version\": \"0.6.4\",\n      \"resolved\": \"https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.4.tgz\",\n      \"integrity\": \"sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"jsesc\": \"~0.5.0\"\n      },\n      \"bin\": {\n        \"regjsparser\": \"bin/parser\"\n      }\n    },\n    \"node_modules/regjsparser/node_modules/jsesc\": {\n      \"version\": \"0.5.0\",\n      \"resolved\": \"https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz\",\n      \"integrity\": \"sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=\",\n      \"dev\": true,\n      \"bin\": {\n        \"jsesc\": \"bin/jsesc\"\n      }\n    },\n    \"node_modules/remove-trailing-separator\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz\",\n      \"integrity\": \"sha1-wkvOKig62tW8P1jg1IJJuSN52O8=\",\n      \"dev\": true,\n      \"optional\": true\n    },\n    \"node_modules/repeat-element\": {\n      \"version\": \"1.1.3\",\n      \"resolved\": \"https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz\",\n      \"integrity\": \"sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/repeat-string\": {\n      \"version\": \"1.6.1\",\n      \"resolved\": \"https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz\",\n      \"integrity\": \"sha1-jcrkcOHIirwtYA//Sndihtp15jc=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10\"\n      }\n    },\n    \"node_modules/require-directory\": {\n      \"version\": \"2.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz\",\n      \"integrity\": \"sha1-jGStX9MNqxyXbiNE/+f3kqam30I=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/require-main-filename\": {\n      \"version\": \"2.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz\",\n      \"integrity\": \"sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==\",\n      \"dev\": true\n    },\n    \"node_modules/require-uncached\": {\n      \"version\": \"1.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz\",\n      \"integrity\": \"sha512-Xct+41K3twrbBHdxAgMoOS+cNcoqIjfM2/VxBF4LL2hVph7YsF8VSKyQ3BDFZwEVbok9yeDl2le/qo0S77WG2w==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"caller-path\": \"^0.1.0\",\n        \"resolve-from\": \"^1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/resolve\": {\n      \"version\": \"1.22.10\",\n      \"resolved\": \"https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz\",\n      \"integrity\": \"sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"is-core-module\": \"^2.16.0\",\n        \"path-parse\": \"^1.0.7\",\n        \"supports-preserve-symlinks-flag\": \"^1.0.0\"\n      },\n      \"bin\": {\n        \"resolve\": \"bin/resolve\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/resolve-cwd\": {\n      \"version\": \"3.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz\",\n      \"integrity\": \"sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"resolve-from\": \"^5.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/resolve-cwd/node_modules/resolve-from\": {\n      \"version\": \"5.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz\",\n      \"integrity\": \"sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/resolve-from\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz\",\n      \"integrity\": \"sha512-kT10v4dhrlLNcnO084hEjvXCI1wUG9qZLoz2RogxqDQQYy7IxjI/iMUkOtQTNEh6rzHxvdQWHsJyel1pKOVCxg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/resolve-url\": {\n      \"version\": \"0.2.1\",\n      \"resolved\": \"https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz\",\n      \"integrity\": \"sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=\",\n      \"deprecated\": \"https://github.com/lydell/resolve-url#deprecated\",\n      \"dev\": true\n    },\n    \"node_modules/restore-cursor\": {\n      \"version\": \"2.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz\",\n      \"integrity\": \"sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"onetime\": \"^2.0.0\",\n        \"signal-exit\": \"^3.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/ret\": {\n      \"version\": \"0.1.15\",\n      \"resolved\": \"https://registry.npmjs.org/ret/-/ret-0.1.15.tgz\",\n      \"integrity\": \"sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.12\"\n      }\n    },\n    \"node_modules/rimraf\": {\n      \"version\": \"2.7.1\",\n      \"resolved\": \"https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz\",\n      \"integrity\": \"sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==\",\n      \"deprecated\": \"Rimraf versions prior to v4 are no longer supported\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"glob\": \"^7.1.3\"\n      },\n      \"bin\": {\n        \"rimraf\": \"bin.js\"\n      }\n    },\n    \"node_modules/ripemd160\": {\n      \"version\": \"2.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz\",\n      \"integrity\": \"sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"hash-base\": \"^3.0.0\",\n        \"inherits\": \"^2.0.1\"\n      }\n    },\n    \"node_modules/run-async\": {\n      \"version\": \"2.4.1\",\n      \"resolved\": \"https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz\",\n      \"integrity\": \"sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=0.12.0\"\n      }\n    },\n    \"node_modules/run-queue\": {\n      \"version\": \"1.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz\",\n      \"integrity\": \"sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"aproba\": \"^1.1.1\"\n      }\n    },\n    \"node_modules/rxjs\": {\n      \"version\": \"5.5.12\",\n      \"resolved\": \"https://registry.npmjs.org/rxjs/-/rxjs-5.5.12.tgz\",\n      \"integrity\": \"sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw==\",\n      \"dev\": true,\n      \"license\": \"Apache-2.0\",\n      \"dependencies\": {\n        \"symbol-observable\": \"1.0.1\"\n      },\n      \"engines\": {\n        \"npm\": \">=2.0.0\"\n      }\n    },\n    \"node_modules/safe-array-concat\": {\n      \"version\": \"1.1.3\",\n      \"resolved\": \"https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz\",\n      \"integrity\": \"sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bind\": \"^1.0.8\",\n        \"call-bound\": \"^1.0.2\",\n        \"get-intrinsic\": \"^1.2.6\",\n        \"has-symbols\": \"^1.1.0\",\n        \"isarray\": \"^2.0.5\"\n      },\n      \"engines\": {\n        \"node\": \">=0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/safe-array-concat/node_modules/isarray\": {\n      \"version\": \"2.0.5\",\n      \"resolved\": \"https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz\",\n      \"integrity\": \"sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==\",\n      \"dev\": true,\n      \"license\": \"MIT\"\n    },\n    \"node_modules/safe-buffer\": {\n      \"version\": \"5.1.2\",\n      \"resolved\": \"https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz\",\n      \"integrity\": \"sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==\",\n      \"dev\": true\n    },\n    \"node_modules/safe-push-apply\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz\",\n      \"integrity\": \"sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"es-errors\": \"^1.3.0\",\n        \"isarray\": \"^2.0.5\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/safe-push-apply/node_modules/isarray\": {\n      \"version\": \"2.0.5\",\n      \"resolved\": \"https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz\",\n      \"integrity\": \"sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==\",\n      \"dev\": true,\n      \"license\": \"MIT\"\n    },\n    \"node_modules/safe-regex\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz\",\n      \"integrity\": \"sha1-QKNmnzsHfR6UPURinhV91IAjvy4=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"ret\": \"~0.1.10\"\n      }\n    },\n    \"node_modules/safe-regex-test\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz\",\n      \"integrity\": \"sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bound\": \"^1.0.2\",\n        \"es-errors\": \"^1.3.0\",\n        \"is-regex\": \"^1.2.1\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/safer-buffer\": {\n      \"version\": \"2.1.2\",\n      \"resolved\": \"https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz\",\n      \"integrity\": \"sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==\",\n      \"dev\": true,\n      \"license\": \"MIT\"\n    },\n    \"node_modules/schema-utils\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz\",\n      \"integrity\": \"sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"ajv\": \"^6.1.0\",\n        \"ajv-errors\": \"^1.0.0\",\n        \"ajv-keywords\": \"^3.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 4\"\n      }\n    },\n    \"node_modules/semver\": {\n      \"version\": \"5.7.1\",\n      \"resolved\": \"https://registry.npmjs.org/semver/-/semver-5.7.1.tgz\",\n      \"integrity\": \"sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==\",\n      \"dev\": true,\n      \"bin\": {\n        \"semver\": \"bin/semver\"\n      }\n    },\n    \"node_modules/serialize-javascript\": {\n      \"version\": \"3.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-3.1.0.tgz\",\n      \"integrity\": \"sha512-JIJT1DGiWmIKhzRsG91aS6Ze4sFUrYbltlkg2onR5OrnNM02Kl/hnY/T4FN2omvyeBbQmMJv+K4cPOpGzOTFBg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"randombytes\": \"^2.1.0\"\n      }\n    },\n    \"node_modules/set-blocking\": {\n      \"version\": \"2.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz\",\n      \"integrity\": \"sha1-BF+XgtARrppoA93TgrJDkrPYkPc=\",\n      \"dev\": true\n    },\n    \"node_modules/set-function-length\": {\n      \"version\": \"1.2.2\",\n      \"resolved\": \"https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz\",\n      \"integrity\": \"sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"define-data-property\": \"^1.1.4\",\n        \"es-errors\": \"^1.3.0\",\n        \"function-bind\": \"^1.1.2\",\n        \"get-intrinsic\": \"^1.2.4\",\n        \"gopd\": \"^1.0.1\",\n        \"has-property-descriptors\": \"^1.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      }\n    },\n    \"node_modules/set-function-name\": {\n      \"version\": \"2.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz\",\n      \"integrity\": \"sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"define-data-property\": \"^1.1.4\",\n        \"es-errors\": \"^1.3.0\",\n        \"functions-have-names\": \"^1.2.3\",\n        \"has-property-descriptors\": \"^1.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      }\n    },\n    \"node_modules/set-proto\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz\",\n      \"integrity\": \"sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"dunder-proto\": \"^1.0.1\",\n        \"es-errors\": \"^1.3.0\",\n        \"es-object-atoms\": \"^1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      }\n    },\n    \"node_modules/set-value\": {\n      \"version\": \"2.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz\",\n      \"integrity\": \"sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"extend-shallow\": \"^2.0.1\",\n        \"is-extendable\": \"^0.1.1\",\n        \"is-plain-object\": \"^2.0.3\",\n        \"split-string\": \"^3.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/set-value/node_modules/extend-shallow\": {\n      \"version\": \"2.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz\",\n      \"integrity\": \"sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-extendable\": \"^0.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/setimmediate\": {\n      \"version\": \"1.0.5\",\n      \"resolved\": \"https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz\",\n      \"integrity\": \"sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=\",\n      \"dev\": true\n    },\n    \"node_modules/sha.js\": {\n      \"version\": \"2.4.11\",\n      \"resolved\": \"https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz\",\n      \"integrity\": \"sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"inherits\": \"^2.0.1\",\n        \"safe-buffer\": \"^5.0.1\"\n      },\n      \"bin\": {\n        \"sha.js\": \"bin.js\"\n      }\n    },\n    \"node_modules/shallow-clone\": {\n      \"version\": \"3.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz\",\n      \"integrity\": \"sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"kind-of\": \"^6.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/shebang-command\": {\n      \"version\": \"1.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz\",\n      \"integrity\": \"sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"shebang-regex\": \"^1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/shebang-regex\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz\",\n      \"integrity\": \"sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/side-channel\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz\",\n      \"integrity\": \"sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"es-errors\": \"^1.3.0\",\n        \"object-inspect\": \"^1.13.3\",\n        \"side-channel-list\": \"^1.0.0\",\n        \"side-channel-map\": \"^1.0.1\",\n        \"side-channel-weakmap\": \"^1.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/side-channel-list\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz\",\n      \"integrity\": \"sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"es-errors\": \"^1.3.0\",\n        \"object-inspect\": \"^1.13.3\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/side-channel-map\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz\",\n      \"integrity\": \"sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bound\": \"^1.0.2\",\n        \"es-errors\": \"^1.3.0\",\n        \"get-intrinsic\": \"^1.2.5\",\n        \"object-inspect\": \"^1.13.3\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/side-channel-weakmap\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz\",\n      \"integrity\": \"sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bound\": \"^1.0.2\",\n        \"es-errors\": \"^1.3.0\",\n        \"get-intrinsic\": \"^1.2.5\",\n        \"object-inspect\": \"^1.13.3\",\n        \"side-channel-map\": \"^1.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/signal-exit\": {\n      \"version\": \"3.0.7\",\n      \"resolved\": \"https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz\",\n      \"integrity\": \"sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==\",\n      \"dev\": true,\n      \"license\": \"ISC\"\n    },\n    \"node_modules/slice-ansi\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz\",\n      \"integrity\": \"sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"is-fullwidth-code-point\": \"^2.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/slice-ansi/node_modules/is-fullwidth-code-point\": {\n      \"version\": \"2.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz\",\n      \"integrity\": \"sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/snapdragon\": {\n      \"version\": \"0.8.2\",\n      \"resolved\": \"https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz\",\n      \"integrity\": \"sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"base\": \"^0.11.1\",\n        \"debug\": \"^2.2.0\",\n        \"define-property\": \"^0.2.5\",\n        \"extend-shallow\": \"^2.0.1\",\n        \"map-cache\": \"^0.2.2\",\n        \"source-map\": \"^0.5.6\",\n        \"source-map-resolve\": \"^0.5.0\",\n        \"use\": \"^3.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/snapdragon-node\": {\n      \"version\": \"2.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz\",\n      \"integrity\": \"sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"define-property\": \"^1.0.0\",\n        \"isobject\": \"^3.0.0\",\n        \"snapdragon-util\": \"^3.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/snapdragon-node/node_modules/define-property\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz\",\n      \"integrity\": \"sha1-dp66rz9KY6rTr56NMEybvnm/sOY=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-descriptor\": \"^1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/snapdragon-node/node_modules/is-accessor-descriptor\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz\",\n      \"integrity\": \"sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==\",\n      \"deprecated\": \"Please upgrade to v1.0.1\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"kind-of\": \"^6.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/snapdragon-node/node_modules/is-data-descriptor\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz\",\n      \"integrity\": \"sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==\",\n      \"deprecated\": \"Please upgrade to v1.0.1\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"kind-of\": \"^6.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/snapdragon-node/node_modules/is-descriptor\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz\",\n      \"integrity\": \"sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-accessor-descriptor\": \"^1.0.0\",\n        \"is-data-descriptor\": \"^1.0.0\",\n        \"kind-of\": \"^6.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/snapdragon-util\": {\n      \"version\": \"3.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz\",\n      \"integrity\": \"sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"kind-of\": \"^3.2.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/snapdragon-util/node_modules/kind-of\": {\n      \"version\": \"3.2.2\",\n      \"resolved\": \"https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz\",\n      \"integrity\": \"sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-buffer\": \"^1.1.5\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/snapdragon/node_modules/define-property\": {\n      \"version\": \"0.2.5\",\n      \"resolved\": \"https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz\",\n      \"integrity\": \"sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-descriptor\": \"^0.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/snapdragon/node_modules/extend-shallow\": {\n      \"version\": \"2.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz\",\n      \"integrity\": \"sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-extendable\": \"^0.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/sort-keys\": {\n      \"version\": \"1.1.2\",\n      \"resolved\": \"https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz\",\n      \"integrity\": \"sha1-RBttTTRnmPG05J6JIK37oOVD+a0=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-plain-obj\": \"^1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/source-list-map\": {\n      \"version\": \"2.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz\",\n      \"integrity\": \"sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==\",\n      \"dev\": true\n    },\n    \"node_modules/source-map\": {\n      \"version\": \"0.5.7\",\n      \"resolved\": \"https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz\",\n      \"integrity\": \"sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/source-map-resolve\": {\n      \"version\": \"0.5.3\",\n      \"resolved\": \"https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz\",\n      \"integrity\": \"sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==\",\n      \"deprecated\": \"See https://github.com/lydell/source-map-resolve#deprecated\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"atob\": \"^2.1.2\",\n        \"decode-uri-component\": \"^0.2.0\",\n        \"resolve-url\": \"^0.2.1\",\n        \"source-map-url\": \"^0.4.0\",\n        \"urix\": \"^0.1.0\"\n      }\n    },\n    \"node_modules/source-map-support\": {\n      \"version\": \"0.5.19\",\n      \"resolved\": \"https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz\",\n      \"integrity\": \"sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"buffer-from\": \"^1.0.0\",\n        \"source-map\": \"^0.6.0\"\n      }\n    },\n    \"node_modules/source-map-support/node_modules/source-map\": {\n      \"version\": \"0.6.1\",\n      \"resolved\": \"https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz\",\n      \"integrity\": \"sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/source-map-url\": {\n      \"version\": \"0.4.0\",\n      \"resolved\": \"https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz\",\n      \"integrity\": \"sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=\",\n      \"deprecated\": \"See https://github.com/lydell/source-map-url#deprecated\",\n      \"dev\": true\n    },\n    \"node_modules/split-string\": {\n      \"version\": \"3.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz\",\n      \"integrity\": \"sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"extend-shallow\": \"^3.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/sprintf-js\": {\n      \"version\": \"1.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz\",\n      \"integrity\": \"sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==\",\n      \"dev\": true,\n      \"license\": \"BSD-3-Clause\"\n    },\n    \"node_modules/ssri\": {\n      \"version\": \"6.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz\",\n      \"integrity\": \"sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"figgy-pudding\": \"^3.5.1\"\n      }\n    },\n    \"node_modules/static-extend\": {\n      \"version\": \"0.1.2\",\n      \"resolved\": \"https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz\",\n      \"integrity\": \"sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"define-property\": \"^0.2.5\",\n        \"object-copy\": \"^0.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/static-extend/node_modules/define-property\": {\n      \"version\": \"0.2.5\",\n      \"resolved\": \"https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz\",\n      \"integrity\": \"sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-descriptor\": \"^0.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/stop-iteration-iterator\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz\",\n      \"integrity\": \"sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"es-errors\": \"^1.3.0\",\n        \"internal-slot\": \"^1.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      }\n    },\n    \"node_modules/stream-browserify\": {\n      \"version\": \"2.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz\",\n      \"integrity\": \"sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"inherits\": \"~2.0.1\",\n        \"readable-stream\": \"^2.0.2\"\n      }\n    },\n    \"node_modules/stream-each\": {\n      \"version\": \"1.2.3\",\n      \"resolved\": \"https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz\",\n      \"integrity\": \"sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"end-of-stream\": \"^1.1.0\",\n        \"stream-shift\": \"^1.0.0\"\n      }\n    },\n    \"node_modules/stream-http\": {\n      \"version\": \"2.8.3\",\n      \"resolved\": \"https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz\",\n      \"integrity\": \"sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"builtin-status-codes\": \"^3.0.0\",\n        \"inherits\": \"^2.0.1\",\n        \"readable-stream\": \"^2.3.6\",\n        \"to-arraybuffer\": \"^1.0.0\",\n        \"xtend\": \"^4.0.0\"\n      }\n    },\n    \"node_modules/stream-shift\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz\",\n      \"integrity\": \"sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==\",\n      \"dev\": true\n    },\n    \"node_modules/strict-uri-encode\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz\",\n      \"integrity\": \"sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/string_decoder\": {\n      \"version\": \"1.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz\",\n      \"integrity\": \"sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"safe-buffer\": \"~5.1.0\"\n      }\n    },\n    \"node_modules/string-width\": {\n      \"version\": \"4.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz\",\n      \"integrity\": \"sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"emoji-regex\": \"^8.0.0\",\n        \"is-fullwidth-code-point\": \"^3.0.0\",\n        \"strip-ansi\": \"^6.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/string.prototype.matchall\": {\n      \"version\": \"2.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-2.0.0.tgz\",\n      \"integrity\": \"sha512-WoZ+B2ypng1dp4iFLF2kmZlwwlE19gmjgKuhL1FJfDgCREWb3ye3SDVHSzLH6bxfnvYmkCxbzkmWcQZHA4P//Q==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"define-properties\": \"^1.1.2\",\n        \"es-abstract\": \"^1.10.0\",\n        \"function-bind\": \"^1.1.1\",\n        \"has-symbols\": \"^1.0.0\",\n        \"regexp.prototype.flags\": \"^1.2.0\"\n      }\n    },\n    \"node_modules/string.prototype.trim\": {\n      \"version\": \"1.2.10\",\n      \"resolved\": \"https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz\",\n      \"integrity\": \"sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bind\": \"^1.0.8\",\n        \"call-bound\": \"^1.0.2\",\n        \"define-data-property\": \"^1.1.4\",\n        \"define-properties\": \"^1.2.1\",\n        \"es-abstract\": \"^1.23.5\",\n        \"es-object-atoms\": \"^1.0.0\",\n        \"has-property-descriptors\": \"^1.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/string.prototype.trimend\": {\n      \"version\": \"1.0.9\",\n      \"resolved\": \"https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz\",\n      \"integrity\": \"sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bind\": \"^1.0.8\",\n        \"call-bound\": \"^1.0.2\",\n        \"define-properties\": \"^1.2.1\",\n        \"es-object-atoms\": \"^1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/string.prototype.trimstart\": {\n      \"version\": \"1.0.8\",\n      \"resolved\": \"https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz\",\n      \"integrity\": \"sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bind\": \"^1.0.7\",\n        \"define-properties\": \"^1.2.1\",\n        \"es-object-atoms\": \"^1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/strip-ansi\": {\n      \"version\": \"6.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz\",\n      \"integrity\": \"sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"ansi-regex\": \"^5.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/strip-json-comments\": {\n      \"version\": \"2.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz\",\n      \"integrity\": \"sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/supports-color\": {\n      \"version\": \"5.5.0\",\n      \"resolved\": \"https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz\",\n      \"integrity\": \"sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"has-flag\": \"^3.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/supports-preserve-symlinks-flag\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz\",\n      \"integrity\": \"sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/symbol-observable\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz\",\n      \"integrity\": \"sha512-Kb3PrPYz4HanVF1LVGuAdW6LoVgIwjUYJGzFe7NDrBLCN4lsV/5J0MFurV+ygS4bRVwrCEt2c7MQ1R2a72oJDw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/table\": {\n      \"version\": \"4.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/table/-/table-4.0.3.tgz\",\n      \"integrity\": \"sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg==\",\n      \"dev\": true,\n      \"license\": \"BSD-3-Clause\",\n      \"dependencies\": {\n        \"ajv\": \"^6.0.1\",\n        \"ajv-keywords\": \"^3.0.0\",\n        \"chalk\": \"^2.1.0\",\n        \"lodash\": \"^4.17.4\",\n        \"slice-ansi\": \"1.0.0\",\n        \"string-width\": \"^2.1.1\"\n      },\n      \"engines\": {\n        \"node\": \">=4.0.0\"\n      }\n    },\n    \"node_modules/table/node_modules/ansi-regex\": {\n      \"version\": \"3.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz\",\n      \"integrity\": \"sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/table/node_modules/is-fullwidth-code-point\": {\n      \"version\": \"2.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz\",\n      \"integrity\": \"sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/table/node_modules/string-width\": {\n      \"version\": \"2.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz\",\n      \"integrity\": \"sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"is-fullwidth-code-point\": \"^2.0.0\",\n        \"strip-ansi\": \"^4.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/table/node_modules/strip-ansi\": {\n      \"version\": \"4.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz\",\n      \"integrity\": \"sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"ansi-regex\": \"^3.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/tapable\": {\n      \"version\": \"1.1.3\",\n      \"resolved\": \"https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz\",\n      \"integrity\": \"sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=6\"\n      }\n    },\n    \"node_modules/terser\": {\n      \"version\": \"4.8.0\",\n      \"resolved\": \"https://registry.npmjs.org/terser/-/terser-4.8.0.tgz\",\n      \"integrity\": \"sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"commander\": \"^2.20.0\",\n        \"source-map\": \"~0.6.1\",\n        \"source-map-support\": \"~0.5.12\"\n      },\n      \"bin\": {\n        \"terser\": \"bin/terser\"\n      },\n      \"engines\": {\n        \"node\": \">=6.0.0\"\n      }\n    },\n    \"node_modules/terser-webpack-plugin\": {\n      \"version\": \"1.4.4\",\n      \"resolved\": \"https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.4.tgz\",\n      \"integrity\": \"sha512-U4mACBHIegmfoEe5fdongHESNJWqsGU+W0S/9+BmYGVQDw1+c2Ow05TpMhxjPK1sRb7cuYq1BPl1e5YHJMTCqA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"cacache\": \"^12.0.2\",\n        \"find-cache-dir\": \"^2.1.0\",\n        \"is-wsl\": \"^1.1.0\",\n        \"schema-utils\": \"^1.0.0\",\n        \"serialize-javascript\": \"^3.1.0\",\n        \"source-map\": \"^0.6.1\",\n        \"terser\": \"^4.1.2\",\n        \"webpack-sources\": \"^1.4.0\",\n        \"worker-farm\": \"^1.7.0\"\n      },\n      \"engines\": {\n        \"node\": \">= 6.9.0\"\n      },\n      \"peerDependencies\": {\n        \"webpack\": \"^4.0.0\"\n      }\n    },\n    \"node_modules/terser-webpack-plugin/node_modules/source-map\": {\n      \"version\": \"0.6.1\",\n      \"resolved\": \"https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz\",\n      \"integrity\": \"sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/terser/node_modules/source-map\": {\n      \"version\": \"0.6.1\",\n      \"resolved\": \"https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz\",\n      \"integrity\": \"sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/text-table\": {\n      \"version\": \"0.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz\",\n      \"integrity\": \"sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==\",\n      \"dev\": true,\n      \"license\": \"MIT\"\n    },\n    \"node_modules/through\": {\n      \"version\": \"2.3.8\",\n      \"resolved\": \"https://registry.npmjs.org/through/-/through-2.3.8.tgz\",\n      \"integrity\": \"sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==\",\n      \"dev\": true,\n      \"license\": \"MIT\"\n    },\n    \"node_modules/through2\": {\n      \"version\": \"2.0.5\",\n      \"resolved\": \"https://registry.npmjs.org/through2/-/through2-2.0.5.tgz\",\n      \"integrity\": \"sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"readable-stream\": \"~2.3.6\",\n        \"xtend\": \"~4.0.1\"\n      }\n    },\n    \"node_modules/timers-browserify\": {\n      \"version\": \"2.0.11\",\n      \"resolved\": \"https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.11.tgz\",\n      \"integrity\": \"sha512-60aV6sgJ5YEbzUdn9c8kYGIqOubPoUdqQCul3SBAsRCZ40s6Y5cMcrW4dt3/k/EsbLVJNl9n6Vz3fTc+k2GeKQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"setimmediate\": \"^1.0.4\"\n      },\n      \"engines\": {\n        \"node\": \">=0.6.0\"\n      }\n    },\n    \"node_modules/tmp\": {\n      \"version\": \"0.0.33\",\n      \"resolved\": \"https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz\",\n      \"integrity\": \"sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"os-tmpdir\": \"~1.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">=0.6.0\"\n      }\n    },\n    \"node_modules/to-arraybuffer\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz\",\n      \"integrity\": \"sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=\",\n      \"dev\": true\n    },\n    \"node_modules/to-object-path\": {\n      \"version\": \"0.3.0\",\n      \"resolved\": \"https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz\",\n      \"integrity\": \"sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"kind-of\": \"^3.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/to-object-path/node_modules/kind-of\": {\n      \"version\": \"3.2.2\",\n      \"resolved\": \"https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz\",\n      \"integrity\": \"sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-buffer\": \"^1.1.5\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/to-regex\": {\n      \"version\": \"3.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz\",\n      \"integrity\": \"sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"define-property\": \"^2.0.2\",\n        \"extend-shallow\": \"^3.0.2\",\n        \"regex-not\": \"^1.0.2\",\n        \"safe-regex\": \"^1.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/to-regex-range\": {\n      \"version\": \"2.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz\",\n      \"integrity\": \"sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"is-number\": \"^3.0.0\",\n        \"repeat-string\": \"^1.6.1\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/tslib\": {\n      \"version\": \"1.13.0\",\n      \"resolved\": \"https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz\",\n      \"integrity\": \"sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==\",\n      \"dev\": true\n    },\n    \"node_modules/tty-browserify\": {\n      \"version\": \"0.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz\",\n      \"integrity\": \"sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=\",\n      \"dev\": true\n    },\n    \"node_modules/type-check\": {\n      \"version\": \"0.3.2\",\n      \"resolved\": \"https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz\",\n      \"integrity\": \"sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"prelude-ls\": \"~1.1.2\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.8.0\"\n      }\n    },\n    \"node_modules/typed-array-buffer\": {\n      \"version\": \"1.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz\",\n      \"integrity\": \"sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bound\": \"^1.0.3\",\n        \"es-errors\": \"^1.3.0\",\n        \"is-typed-array\": \"^1.1.14\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      }\n    },\n    \"node_modules/typed-array-byte-length\": {\n      \"version\": \"1.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz\",\n      \"integrity\": \"sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bind\": \"^1.0.8\",\n        \"for-each\": \"^0.3.3\",\n        \"gopd\": \"^1.2.0\",\n        \"has-proto\": \"^1.2.0\",\n        \"is-typed-array\": \"^1.1.14\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/typed-array-byte-offset\": {\n      \"version\": \"1.0.4\",\n      \"resolved\": \"https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz\",\n      \"integrity\": \"sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"available-typed-arrays\": \"^1.0.7\",\n        \"call-bind\": \"^1.0.8\",\n        \"for-each\": \"^0.3.3\",\n        \"gopd\": \"^1.2.0\",\n        \"has-proto\": \"^1.2.0\",\n        \"is-typed-array\": \"^1.1.15\",\n        \"reflect.getprototypeof\": \"^1.0.9\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/typed-array-length\": {\n      \"version\": \"1.0.7\",\n      \"resolved\": \"https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz\",\n      \"integrity\": \"sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bind\": \"^1.0.7\",\n        \"for-each\": \"^0.3.3\",\n        \"gopd\": \"^1.0.1\",\n        \"is-typed-array\": \"^1.1.13\",\n        \"possible-typed-array-names\": \"^1.0.0\",\n        \"reflect.getprototypeof\": \"^1.0.6\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/typedarray\": {\n      \"version\": \"0.0.6\",\n      \"resolved\": \"https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz\",\n      \"integrity\": \"sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=\",\n      \"dev\": true\n    },\n    \"node_modules/unbox-primitive\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz\",\n      \"integrity\": \"sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bound\": \"^1.0.3\",\n        \"has-bigints\": \"^1.0.2\",\n        \"has-symbols\": \"^1.1.0\",\n        \"which-boxed-primitive\": \"^1.1.1\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/unicode-canonical-property-names-ecmascript\": {\n      \"version\": \"1.0.4\",\n      \"resolved\": \"https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz\",\n      \"integrity\": \"sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/unicode-match-property-ecmascript\": {\n      \"version\": \"1.0.4\",\n      \"resolved\": \"https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz\",\n      \"integrity\": \"sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"unicode-canonical-property-names-ecmascript\": \"^1.0.4\",\n        \"unicode-property-aliases-ecmascript\": \"^1.0.4\"\n      },\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/unicode-match-property-value-ecmascript\": {\n      \"version\": \"1.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz\",\n      \"integrity\": \"sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/unicode-property-aliases-ecmascript\": {\n      \"version\": \"1.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz\",\n      \"integrity\": \"sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=4\"\n      }\n    },\n    \"node_modules/union-value\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz\",\n      \"integrity\": \"sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"arr-union\": \"^3.1.0\",\n        \"get-value\": \"^2.0.6\",\n        \"is-extendable\": \"^0.1.1\",\n        \"set-value\": \"^2.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/uniq\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz\",\n      \"integrity\": \"sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=\",\n      \"dev\": true\n    },\n    \"node_modules/unique-filename\": {\n      \"version\": \"1.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz\",\n      \"integrity\": \"sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"unique-slug\": \"^2.0.0\"\n      }\n    },\n    \"node_modules/unique-slug\": {\n      \"version\": \"2.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz\",\n      \"integrity\": \"sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"imurmurhash\": \"^0.1.4\"\n      }\n    },\n    \"node_modules/universalify\": {\n      \"version\": \"0.1.2\",\n      \"resolved\": \"https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz\",\n      \"integrity\": \"sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">= 4.0.0\"\n      }\n    },\n    \"node_modules/unset-value\": {\n      \"version\": \"1.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz\",\n      \"integrity\": \"sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"has-value\": \"^0.3.1\",\n        \"isobject\": \"^3.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/unset-value/node_modules/has-value\": {\n      \"version\": \"0.3.1\",\n      \"resolved\": \"https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz\",\n      \"integrity\": \"sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"get-value\": \"^2.0.3\",\n        \"has-values\": \"^0.1.4\",\n        \"isobject\": \"^2.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/unset-value/node_modules/has-value/node_modules/isobject\": {\n      \"version\": \"2.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz\",\n      \"integrity\": \"sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"isarray\": \"1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/unset-value/node_modules/has-values\": {\n      \"version\": \"0.1.4\",\n      \"resolved\": \"https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz\",\n      \"integrity\": \"sha1-bWHeldkd/Km5oCCJrThL/49it3E=\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/upath\": {\n      \"version\": \"1.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/upath/-/upath-1.2.0.tgz\",\n      \"integrity\": \"sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==\",\n      \"dev\": true,\n      \"optional\": true,\n      \"engines\": {\n        \"node\": \">=4\",\n        \"yarn\": \"*\"\n      }\n    },\n    \"node_modules/uri-js\": {\n      \"version\": \"4.2.2\",\n      \"resolved\": \"https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz\",\n      \"integrity\": \"sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"punycode\": \"^2.1.0\"\n      }\n    },\n    \"node_modules/urix\": {\n      \"version\": \"0.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/urix/-/urix-0.1.0.tgz\",\n      \"integrity\": \"sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=\",\n      \"deprecated\": \"Please see https://github.com/lydell/urix#deprecated\",\n      \"dev\": true\n    },\n    \"node_modules/url\": {\n      \"version\": \"0.11.0\",\n      \"resolved\": \"https://registry.npmjs.org/url/-/url-0.11.0.tgz\",\n      \"integrity\": \"sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"punycode\": \"1.3.2\",\n        \"querystring\": \"0.2.0\"\n      }\n    },\n    \"node_modules/url/node_modules/punycode\": {\n      \"version\": \"1.3.2\",\n      \"resolved\": \"https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz\",\n      \"integrity\": \"sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=\",\n      \"dev\": true\n    },\n    \"node_modules/use\": {\n      \"version\": \"3.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/use/-/use-3.1.1.tgz\",\n      \"integrity\": \"sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/util\": {\n      \"version\": \"0.11.1\",\n      \"resolved\": \"https://registry.npmjs.org/util/-/util-0.11.1.tgz\",\n      \"integrity\": \"sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"inherits\": \"2.0.3\"\n      }\n    },\n    \"node_modules/util-deprecate\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz\",\n      \"integrity\": \"sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=\",\n      \"dev\": true\n    },\n    \"node_modules/util/node_modules/inherits\": {\n      \"version\": \"2.0.3\",\n      \"resolved\": \"https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz\",\n      \"integrity\": \"sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=\",\n      \"dev\": true\n    },\n    \"node_modules/vm-browserify\": {\n      \"version\": \"1.1.2\",\n      \"resolved\": \"https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz\",\n      \"integrity\": \"sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==\",\n      \"dev\": true\n    },\n    \"node_modules/watchpack\": {\n      \"version\": \"1.7.4\",\n      \"resolved\": \"https://registry.npmjs.org/watchpack/-/watchpack-1.7.4.tgz\",\n      \"integrity\": \"sha512-aWAgTW4MoSJzZPAicljkO1hsi1oKj/RRq/OJQh2PKI2UKL04c2Bs+MBOB+BBABHTXJpf9mCwHN7ANCvYsvY2sg==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"graceful-fs\": \"^4.1.2\",\n        \"neo-async\": \"^2.5.0\"\n      },\n      \"optionalDependencies\": {\n        \"chokidar\": \"^3.4.1\",\n        \"watchpack-chokidar2\": \"^2.0.0\"\n      }\n    },\n    \"node_modules/watchpack-chokidar2\": {\n      \"version\": \"2.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/watchpack-chokidar2/-/watchpack-chokidar2-2.0.0.tgz\",\n      \"integrity\": \"sha512-9TyfOyN/zLUbA288wZ8IsMZ+6cbzvsNyEzSBp6e/zkifi6xxbl8SmQ/CxQq32k8NNqrdVEVUVSEf56L4rQ/ZxA==\",\n      \"dev\": true,\n      \"optional\": true,\n      \"dependencies\": {\n        \"chokidar\": \"^2.1.8\"\n      },\n      \"engines\": {\n        \"node\": \"<8.10.0\"\n      }\n    },\n    \"node_modules/watchpack-chokidar2/node_modules/anymatch\": {\n      \"version\": \"2.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz\",\n      \"integrity\": \"sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==\",\n      \"dev\": true,\n      \"optional\": true,\n      \"dependencies\": {\n        \"micromatch\": \"^3.1.4\",\n        \"normalize-path\": \"^2.1.1\"\n      }\n    },\n    \"node_modules/watchpack-chokidar2/node_modules/anymatch/node_modules/normalize-path\": {\n      \"version\": \"2.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz\",\n      \"integrity\": \"sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=\",\n      \"dev\": true,\n      \"optional\": true,\n      \"dependencies\": {\n        \"remove-trailing-separator\": \"^1.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/watchpack-chokidar2/node_modules/binary-extensions\": {\n      \"version\": \"1.13.1\",\n      \"resolved\": \"https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz\",\n      \"integrity\": \"sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==\",\n      \"dev\": true,\n      \"optional\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/watchpack-chokidar2/node_modules/chokidar\": {\n      \"version\": \"2.1.8\",\n      \"resolved\": \"https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz\",\n      \"integrity\": \"sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==\",\n      \"dev\": true,\n      \"optional\": true,\n      \"dependencies\": {\n        \"anymatch\": \"^2.0.0\",\n        \"async-each\": \"^1.0.1\",\n        \"braces\": \"^2.3.2\",\n        \"glob-parent\": \"^3.1.0\",\n        \"inherits\": \"^2.0.3\",\n        \"is-binary-path\": \"^1.0.0\",\n        \"is-glob\": \"^4.0.0\",\n        \"normalize-path\": \"^3.0.0\",\n        \"path-is-absolute\": \"^1.0.0\",\n        \"readdirp\": \"^2.2.1\",\n        \"upath\": \"^1.1.1\"\n      },\n      \"optionalDependencies\": {\n        \"fsevents\": \"^1.2.7\"\n      }\n    },\n    \"node_modules/watchpack-chokidar2/node_modules/glob-parent\": {\n      \"version\": \"3.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz\",\n      \"integrity\": \"sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=\",\n      \"dev\": true,\n      \"optional\": true,\n      \"dependencies\": {\n        \"is-glob\": \"^3.1.0\",\n        \"path-dirname\": \"^1.0.0\"\n      }\n    },\n    \"node_modules/watchpack-chokidar2/node_modules/glob-parent/node_modules/is-glob\": {\n      \"version\": \"3.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz\",\n      \"integrity\": \"sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=\",\n      \"dev\": true,\n      \"optional\": true,\n      \"dependencies\": {\n        \"is-extglob\": \"^2.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/watchpack-chokidar2/node_modules/is-binary-path\": {\n      \"version\": \"1.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz\",\n      \"integrity\": \"sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=\",\n      \"dev\": true,\n      \"optional\": true,\n      \"dependencies\": {\n        \"binary-extensions\": \"^1.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/watchpack-chokidar2/node_modules/readdirp\": {\n      \"version\": \"2.2.1\",\n      \"resolved\": \"https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz\",\n      \"integrity\": \"sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==\",\n      \"dev\": true,\n      \"optional\": true,\n      \"dependencies\": {\n        \"graceful-fs\": \"^4.1.11\",\n        \"micromatch\": \"^3.1.10\",\n        \"readable-stream\": \"^2.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10\"\n      }\n    },\n    \"node_modules/webpack\": {\n      \"version\": \"4.44.1\",\n      \"resolved\": \"https://registry.npmjs.org/webpack/-/webpack-4.44.1.tgz\",\n      \"integrity\": \"sha512-4UOGAohv/VGUNQJstzEywwNxqX417FnjZgZJpJQegddzPmTvph37eBIRbRTfdySXzVtJXLJfbMN3mMYhM6GdmQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"@webassemblyjs/ast\": \"1.9.0\",\n        \"@webassemblyjs/helper-module-context\": \"1.9.0\",\n        \"@webassemblyjs/wasm-edit\": \"1.9.0\",\n        \"@webassemblyjs/wasm-parser\": \"1.9.0\",\n        \"acorn\": \"^6.4.1\",\n        \"ajv\": \"^6.10.2\",\n        \"ajv-keywords\": \"^3.4.1\",\n        \"chrome-trace-event\": \"^1.0.2\",\n        \"enhanced-resolve\": \"^4.3.0\",\n        \"eslint-scope\": \"^4.0.3\",\n        \"json-parse-better-errors\": \"^1.0.2\",\n        \"loader-runner\": \"^2.4.0\",\n        \"loader-utils\": \"^1.2.3\",\n        \"memory-fs\": \"^0.4.1\",\n        \"micromatch\": \"^3.1.10\",\n        \"mkdirp\": \"^0.5.3\",\n        \"neo-async\": \"^2.6.1\",\n        \"node-libs-browser\": \"^2.2.1\",\n        \"schema-utils\": \"^1.0.0\",\n        \"tapable\": \"^1.1.3\",\n        \"terser-webpack-plugin\": \"^1.4.3\",\n        \"watchpack\": \"^1.7.4\",\n        \"webpack-sources\": \"^1.4.1\"\n      },\n      \"bin\": {\n        \"webpack\": \"bin/webpack.js\"\n      },\n      \"engines\": {\n        \"node\": \">=6.11.5\"\n      },\n      \"funding\": {\n        \"type\": \"opencollective\",\n        \"url\": \"https://opencollective.com/webpack\"\n      },\n      \"peerDependenciesMeta\": {\n        \"webpack-cli\": {\n          \"optional\": true\n        },\n        \"webpack-command\": {\n          \"optional\": true\n        }\n      }\n    },\n    \"node_modules/webpack-cli\": {\n      \"version\": \"4.10.0\",\n      \"resolved\": \"https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.10.0.tgz\",\n      \"integrity\": \"sha512-NLhDfH/h4O6UOy+0LSso42xvYypClINuMNBVVzX4vX98TmTaTUxwRbXdhucbFMd2qLaCTcLq/PdYrvi8onw90w==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"@discoveryjs/json-ext\": \"^0.5.0\",\n        \"@webpack-cli/configtest\": \"^1.2.0\",\n        \"@webpack-cli/info\": \"^1.5.0\",\n        \"@webpack-cli/serve\": \"^1.7.0\",\n        \"colorette\": \"^2.0.14\",\n        \"commander\": \"^7.0.0\",\n        \"cross-spawn\": \"^7.0.3\",\n        \"fastest-levenshtein\": \"^1.0.12\",\n        \"import-local\": \"^3.0.2\",\n        \"interpret\": \"^2.2.0\",\n        \"rechoir\": \"^0.7.0\",\n        \"webpack-merge\": \"^5.7.3\"\n      },\n      \"bin\": {\n        \"webpack-cli\": \"bin/cli.js\"\n      },\n      \"engines\": {\n        \"node\": \">=10.13.0\"\n      },\n      \"funding\": {\n        \"type\": \"opencollective\",\n        \"url\": \"https://opencollective.com/webpack\"\n      },\n      \"peerDependencies\": {\n        \"webpack\": \"4.x.x || 5.x.x\"\n      },\n      \"peerDependenciesMeta\": {\n        \"@webpack-cli/generators\": {\n          \"optional\": true\n        },\n        \"@webpack-cli/migrate\": {\n          \"optional\": true\n        },\n        \"webpack-bundle-analyzer\": {\n          \"optional\": true\n        },\n        \"webpack-dev-server\": {\n          \"optional\": true\n        }\n      }\n    },\n    \"node_modules/webpack-cli/node_modules/commander\": {\n      \"version\": \"7.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/commander/-/commander-7.2.0.tgz\",\n      \"integrity\": \"sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">= 10\"\n      }\n    },\n    \"node_modules/webpack-cli/node_modules/cross-spawn\": {\n      \"version\": \"7.0.6\",\n      \"resolved\": \"https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz\",\n      \"integrity\": \"sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"path-key\": \"^3.1.0\",\n        \"shebang-command\": \"^2.0.0\",\n        \"which\": \"^2.0.1\"\n      },\n      \"engines\": {\n        \"node\": \">= 8\"\n      }\n    },\n    \"node_modules/webpack-cli/node_modules/path-key\": {\n      \"version\": \"3.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz\",\n      \"integrity\": \"sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/webpack-cli/node_modules/shebang-command\": {\n      \"version\": \"2.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz\",\n      \"integrity\": \"sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"shebang-regex\": \"^3.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/webpack-cli/node_modules/shebang-regex\": {\n      \"version\": \"3.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz\",\n      \"integrity\": \"sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/webpack-cli/node_modules/which\": {\n      \"version\": \"2.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/which/-/which-2.0.2.tgz\",\n      \"integrity\": \"sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==\",\n      \"dev\": true,\n      \"license\": \"ISC\",\n      \"dependencies\": {\n        \"isexe\": \"^2.0.0\"\n      },\n      \"bin\": {\n        \"node-which\": \"bin/node-which\"\n      },\n      \"engines\": {\n        \"node\": \">= 8\"\n      }\n    },\n    \"node_modules/webpack-merge\": {\n      \"version\": \"5.10.0\",\n      \"resolved\": \"https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.10.0.tgz\",\n      \"integrity\": \"sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"clone-deep\": \"^4.0.1\",\n        \"flat\": \"^5.0.2\",\n        \"wildcard\": \"^2.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=10.0.0\"\n      }\n    },\n    \"node_modules/webpack-sources\": {\n      \"version\": \"1.4.3\",\n      \"resolved\": \"https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz\",\n      \"integrity\": \"sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"source-list-map\": \"^2.0.0\",\n        \"source-map\": \"~0.6.1\"\n      }\n    },\n    \"node_modules/webpack-sources/node_modules/source-map\": {\n      \"version\": \"0.6.1\",\n      \"resolved\": \"https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz\",\n      \"integrity\": \"sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/which\": {\n      \"version\": \"1.3.1\",\n      \"resolved\": \"https://registry.npmjs.org/which/-/which-1.3.1.tgz\",\n      \"integrity\": \"sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==\",\n      \"dev\": true,\n      \"license\": \"ISC\",\n      \"dependencies\": {\n        \"isexe\": \"^2.0.0\"\n      },\n      \"bin\": {\n        \"which\": \"bin/which\"\n      }\n    },\n    \"node_modules/which-boxed-primitive\": {\n      \"version\": \"1.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz\",\n      \"integrity\": \"sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"is-bigint\": \"^1.1.0\",\n        \"is-boolean-object\": \"^1.2.1\",\n        \"is-number-object\": \"^1.1.1\",\n        \"is-string\": \"^1.1.1\",\n        \"is-symbol\": \"^1.1.1\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/which-builtin-type\": {\n      \"version\": \"1.2.1\",\n      \"resolved\": \"https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz\",\n      \"integrity\": \"sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"call-bound\": \"^1.0.2\",\n        \"function.prototype.name\": \"^1.1.6\",\n        \"has-tostringtag\": \"^1.0.2\",\n        \"is-async-function\": \"^2.0.0\",\n        \"is-date-object\": \"^1.1.0\",\n        \"is-finalizationregistry\": \"^1.1.0\",\n        \"is-generator-function\": \"^1.0.10\",\n        \"is-regex\": \"^1.2.1\",\n        \"is-weakref\": \"^1.0.2\",\n        \"isarray\": \"^2.0.5\",\n        \"which-boxed-primitive\": \"^1.1.0\",\n        \"which-collection\": \"^1.0.2\",\n        \"which-typed-array\": \"^1.1.16\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/which-builtin-type/node_modules/isarray\": {\n      \"version\": \"2.0.5\",\n      \"resolved\": \"https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz\",\n      \"integrity\": \"sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==\",\n      \"dev\": true,\n      \"license\": \"MIT\"\n    },\n    \"node_modules/which-collection\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz\",\n      \"integrity\": \"sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"is-map\": \"^2.0.3\",\n        \"is-set\": \"^2.0.3\",\n        \"is-weakmap\": \"^2.0.2\",\n        \"is-weakset\": \"^2.0.3\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/which-module\": {\n      \"version\": \"2.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz\",\n      \"integrity\": \"sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=\",\n      \"dev\": true\n    },\n    \"node_modules/which-typed-array\": {\n      \"version\": \"1.1.19\",\n      \"resolved\": \"https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz\",\n      \"integrity\": \"sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"available-typed-arrays\": \"^1.0.7\",\n        \"call-bind\": \"^1.0.8\",\n        \"call-bound\": \"^1.0.4\",\n        \"for-each\": \"^0.3.5\",\n        \"get-proto\": \"^1.0.1\",\n        \"gopd\": \"^1.2.0\",\n        \"has-tostringtag\": \"^1.0.2\"\n      },\n      \"engines\": {\n        \"node\": \">= 0.4\"\n      },\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/ljharb\"\n      }\n    },\n    \"node_modules/wildcard\": {\n      \"version\": \"2.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz\",\n      \"integrity\": \"sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==\",\n      \"dev\": true,\n      \"license\": \"MIT\"\n    },\n    \"node_modules/word-wrap\": {\n      \"version\": \"1.2.5\",\n      \"resolved\": \"https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz\",\n      \"integrity\": \"sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/worker-farm\": {\n      \"version\": \"1.7.0\",\n      \"resolved\": \"https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz\",\n      \"integrity\": \"sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"errno\": \"~0.1.7\"\n      }\n    },\n    \"node_modules/wrap-ansi\": {\n      \"version\": \"6.2.0\",\n      \"resolved\": \"https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz\",\n      \"integrity\": \"sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"ansi-styles\": \"^4.0.0\",\n        \"string-width\": \"^4.1.0\",\n        \"strip-ansi\": \"^6.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/wrappy\": {\n      \"version\": \"1.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz\",\n      \"integrity\": \"sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=\",\n      \"dev\": true\n    },\n    \"node_modules/write\": {\n      \"version\": \"0.2.1\",\n      \"resolved\": \"https://registry.npmjs.org/write/-/write-0.2.1.tgz\",\n      \"integrity\": \"sha512-CJ17OoULEKXpA5pef3qLj5AxTJ6mSt7g84he2WIskKwqFO4T97d5V7Tadl0DYDk7qyUOQD5WlUlOMChaYrhxeA==\",\n      \"dev\": true,\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"mkdirp\": \"^0.5.1\"\n      },\n      \"engines\": {\n        \"node\": \">=0.10.0\"\n      }\n    },\n    \"node_modules/xtend\": {\n      \"version\": \"4.0.2\",\n      \"resolved\": \"https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz\",\n      \"integrity\": \"sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=0.4\"\n      }\n    },\n    \"node_modules/y18n\": {\n      \"version\": \"4.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz\",\n      \"integrity\": \"sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==\",\n      \"dev\": true\n    },\n    \"node_modules/yallist\": {\n      \"version\": \"3.1.1\",\n      \"resolved\": \"https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz\",\n      \"integrity\": \"sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==\",\n      \"dev\": true\n    },\n    \"node_modules/yargs\": {\n      \"version\": \"15.4.1\",\n      \"resolved\": \"https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz\",\n      \"integrity\": \"sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"cliui\": \"^6.0.0\",\n        \"decamelize\": \"^1.2.0\",\n        \"find-up\": \"^4.1.0\",\n        \"get-caller-file\": \"^2.0.1\",\n        \"require-directory\": \"^2.1.1\",\n        \"require-main-filename\": \"^2.0.0\",\n        \"set-blocking\": \"^2.0.0\",\n        \"string-width\": \"^4.2.0\",\n        \"which-module\": \"^2.0.0\",\n        \"y18n\": \"^4.0.0\",\n        \"yargs-parser\": \"^18.1.2\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/yargs-parser\": {\n      \"version\": \"18.1.3\",\n      \"resolved\": \"https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz\",\n      \"integrity\": \"sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"camelcase\": \"^5.0.0\",\n        \"decamelize\": \"^1.2.0\"\n      },\n      \"engines\": {\n        \"node\": \">=6\"\n      }\n    },\n    \"node_modules/yargs/node_modules/find-up\": {\n      \"version\": \"4.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz\",\n      \"integrity\": \"sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"locate-path\": \"^5.0.0\",\n        \"path-exists\": \"^4.0.0\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/yargs/node_modules/locate-path\": {\n      \"version\": \"5.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz\",\n      \"integrity\": \"sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"p-locate\": \"^4.1.0\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/yargs/node_modules/p-locate\": {\n      \"version\": \"4.1.0\",\n      \"resolved\": \"https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz\",\n      \"integrity\": \"sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==\",\n      \"dev\": true,\n      \"dependencies\": {\n        \"p-limit\": \"^2.2.0\"\n      },\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    },\n    \"node_modules/yargs/node_modules/path-exists\": {\n      \"version\": \"4.0.0\",\n      \"resolved\": \"https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz\",\n      \"integrity\": \"sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==\",\n      \"dev\": true,\n      \"engines\": {\n        \"node\": \">=8\"\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"blockpy\",\n  \"version\": \"1.0.0\",\n  \"description\": \"corgis-blockly\",\n  \"main\": \"index.js\",\n  \"directories\": {\n    \"doc\": \"docs\",\n    \"test\": \"tests\"\n  },\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" && exit 1\",\n    \"dev\": \"webpack --progress --color --watch --env dev\",\n    \"build\": \"webpack --env dev && webpack --env build\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/RealTimeWeb/blockpy.git\"\n  },\n  \"keywords\": [],\n  \"author\": \"\",\n  \"license\": \"ISC\",\n  \"bugs\": {\n    \"url\": \"https://github.com/RealTimeWeb/blockpy/issues\"\n  },\n  \"homepage\": \"https://github.com/RealTimeWeb/blockpy#readme\",\n  \"devDependencies\": {\n    \"@babel/core\": \"7.0.0\",\n    \"@babel/preset-env\": \"7.11.0\",\n    \"babel-loader\": \"8.1.0\",\n    \"css-loader\": \"4.2.0\",\n    \"eslint\": \"5.0.0\",\n    \"eslint-loader\": \"4.0.2\",\n    \"jquery\": \"3.5.1\",\n    \"knockout\": \"3.5.1\",\n    \"mini-css-extract-plugin\": \"0.9.0\",\n    \"path\": \"0.12.7\",\n    \"webpack\": \"4.44.1\",\n    \"webpack-cli\": \"^4.2.0\",\n    \"yargs\": \"15.4.1\"\n  }\n}\n"
  },
  {
    "path": "src/blockly_blocks/parking.js",
    "content": "var DAYS = [\n    [\"Monday\", \"MON\"],\n    [\"Tuesday\", \"TUE\"],\n    [\"Wednesday\", \"WED\"],\n    [\"Thursday\", \"THU\"],\n    [\"Friday\", \"FRI\"],\n    [\"Saturday\", \"SAT\"],\n    [\"Sunday\", \"SUN\"]\n];\n\nvar DAYS_MAP = {\n    \"mon\": 'parking.Day(\"MON\")',\n    \"tue\": 'parking.Day(\"TUE\")',\n    \"wed\": 'parking.Day(\"WED\")',\n    \"thu\": 'parking.Day(\"THU\")',\n    \"fri\": 'parking.Day(\"FRI\")',\n    \"sat\": 'parking.Day(\"SAT\")',\n    \"sun\": 'parking.Day(\"SUN\")',\n    \"tod\": \"parking.today()\"\n};\n\n\nBlockly.Blocks[\"datetime_day\"] = {\n    /**\n   * Block for datetime day.\n   * @this Blockly.Block\n   */\n    init: function() {\n        this.jsonInit({\n            \"message0\": \"%1\",\n            \"args0\": [\n                {\n                    \"type\": \"field_dropdown\",\n                    \"name\": \"DAY\",\n                    \"options\": [[\"Today\", \"TODAY\"]].concat(DAYS)\n                }\n            ],\n            \"output\": \"DatetimeDay\",\n            \"colour\": DATA_HUE,\n            \"tooltip\": \"Returns a day of the week\",\n            \"helpUrl\": \"\"\n        });\n    }\n};\nBlockly.Python[\"datetime_day\"] = function(block) {\n    Blockly.Python.definitions_[\"import_parking\"] = \"import parking\";\n    var operator = DAYS_MAP[block.getFieldValue(\"DAY\").slice(0, 3).toLowerCase()];\n    return [operator, Blockly.Python.ORDER_ATOMIC];\n};\n\nvar HOURS = [[\"1\", \"1\"], [\"2\", \"2\"], [\"3\", \"3\"],\n             [\"4\", \"4\"], [\"5\", \"5\"], [\"6\", \"6\"], [\"7\", \"7\"],\n             [\"8\", \"8\"], [\"9\", \"9\"], [\"10\", \"10\"], [\"11\", \"11\"],\n             [\"12\", \"12\"]];\nvar MINUTES = [[\"00\", \"00\"], [\"30\", \"30\"]];\nvar MERIDIANS = [[\"am\", \"AM\"], [\"pm\", \"PM\"]];\n\nBlockly.Blocks[\"datetime_time\"] = {\n    /**\n   * Block for datetime day.\n   * @this Blockly.Block\n   */\n    init: function() {\n        this.setColour(DATA_HUE);\n        var dropdown = new Blockly.FieldDropdown([[\"Now\", \"NOW\"]].concat(HOURS), function(opt) {\n            var isNow = (opt == \"NOW\");\n            this.sourceBlock_.updateShape_(isNow);\n        });\n        this.appendDummyInput()\n            .appendField(dropdown, \"HOUR\");\n        this.setInputsInline(true);\n        this.setOutput(true, \"DatetimeTime\");\n        this.setTooltip(\"Returns a time of day\");\n    },\n    mutationToDom: function() {\n        var container = document.createElement(\"mutation\");\n        var isNow = (this.getFieldValue(\"HOUR\").toUpperCase() == \"NOW\");\n        container.setAttribute(\"isnow\", isNow);\n        return container;\n    },\n    domToMutation: function(xmlElement) {\n        var isNow = (xmlElement.getAttribute(\"isnow\") == \"true\");\n        this.updateShape_(isNow);\n    },\n    updateShape_: function(isNow) {\n        // Add or remove a Value Input.\n        var inputExists = this.getInput(\"EXTENDED\");\n        if (!isNow) {\n            if (!inputExists) {\n                var minuteMenu = new Blockly.FieldDropdown(MINUTES);\n                var meridianMenu = new Blockly.FieldDropdown(MERIDIANS);\n                this.appendDummyInput(\"EXTENDED\")\n                    .appendField(\":\")\n                    .appendField(minuteMenu, \"MINUTE\")\n                    .appendField(meridianMenu, \"MERIDIAN\");\n            }\n        } else if (inputExists) {\n            this.removeInput(\"EXTENDED\");\n        }\n    }\n};\n\nvar HOURS_MAP = {\n    \"1\": \"parking.one()\",\n    \"2\": \"parking.two()\",\n    \"3\": \"parking.three()\",\n    \"4\": \"parking.four()\",\n    \"5\": \"parking.five()\",\n    \"6\": \"parking.six()\",\n    \"7\": \"parking.seven()\",\n    \"8\": \"parking.eight()\",\n    \"9\": \"parking.nine()\",\n    \"10\": \"parking.ten()\",\n    \"11\": \"parking.eleven()\",\n    \"12\": \"parking.twelve()\",\n    \"NOW\": \"parking.now()\"\n};\nvar MINUTES_MAP = {\n    \"00\": \"parking.exactly()\",\n    \"30\": \"parking.half()\"\n};\nvar MERIDIANS_MAP = {\n    \"AM\": \"parking.am()\",\n    \"PM\": \"parking.pm()\"\n};\n\nBlockly.Python[\"datetime_time\"] = function(block) {\n    Blockly.Python.definitions_[\"import_parking\"] = \"import parking\";\n    var hour = block.getFieldValue(\"HOUR\");\n    var code;\n    if (hour == \"NOW\") {\n        code = \"parking.now()\";\n    } else {\n        var minute = parseInt(block.getFieldValue(\"MINUTE\"));\n        var meridian = Blockly.Python.quote_(block.getFieldValue(\"MERIDIAN\"));\n        code = \"parking.Time(\"+hour+\",\"+minute+\",\"+meridian+\")\";\n    }\n    return [code, Blockly.Python.ORDER_ATOMIC];\n};\n\nvar convertDate = function(date) {\n    date = date.slice(0, 3).toLowerCase();\n    switch (date) {\n        case \"mon\": return \"Monday\";\n        case \"tue\": return \"Tuesday\";\n        case \"wed\": return \"Wednesday\";\n        case \"thu\": return \"Thursday\";\n        case \"fri\": return \"Friday\";\n        case \"sat\": return \"Saturday\";\n        case \"sun\": return \"Sunday\";\n        default: return date;\n    }\n};\nvar convertMinute = function(minute) {\n    if (minute < 10) {\n        return \"0\"+minute;\n    } else {\n        return \"\"+minute;\n    }\n};\n\nPythonToBlocks.KNOWN_MODULES[\"parking\"] = {\n    \"today\": [\"datetime_day\", [\"DAY\", \"TODAY\"]],\n    \"day_compare\": [\"datetime_check_day\", \"OP\", \n                    {\"type\": \"variable\", \"mode\": \"value\", \"name\": \"LEFT\"}, \n                    {\"type\": \"mapper\", \"name\": \"VALUE\", \"method\": convertDate}],\n    \"Day\": [\"datetime_day\", {\"type\": \"mapper\", \"name\": \"DAY\", \"method\": convertDate}],\n    \"now\": [\"datetime_time\", [\"HOUR\", \"NOW\"]],\n    \"Time\": [\"datetime_time\", {\"type\": \"integer\", \"name\": \"HOUR\", \"add_mutation\": {\"name\": \"@isnow\", \"value\": \"false\"}}, \n             {\"type\": \"integer_mapper\", \"name\": \"MINUTE\", \"method\": convertMinute}, \n             \"MERIDIAN\"],\n    \"time_compare\": [\"datetime_check_time\", \"OP\",\n                     {\"type\": \"variable\", \"mode\": \"value\", \"name\": \"LEFT\"}, \n                     {\"type\": \"integer\", \"name\": \"HOURS\"},\n                     {\"type\": \"integer_mapper\", \"name\": \"MINUTES\", \"method\": convertMinute},\n                     \"MERIDIANS\"]\n};\n\nvar equalityOperators = [\n    [\"==\", \"IS\"],\n    [\"<\", \"BEFORE\"],\n    [\">\", \"AFTER\"],\n    [\"<=\", \"BEFORE_EQUAL\"],\n    [\"=>\", \"AFTER_EQUAL\"],\n    [\"!=\", \"IS_NOT\"]\n];\nvar equalityOperatorsConversions = {\n    \"IS\": \"parking.equal\",\n    \"BEFORE\": \"parking.before\",\n    \"AFTER\": \"parking.after\",\n    \"BEFORE_EQUAL\": \"parking.before_equal\",\n    \"AFTER_EQUAL\": \"parking.after_equal\",\n    \"IS_NOT\": \"parking.not_equal\",\n};\n// FINISH _time and _day\n// Add in numbers and days to KNOWN_MODULES\n\nBlockly.Blocks[\"datetime_check_day\"] = {\n    /**\n   * Block for testing if something contains something.\n   * @this Blockly.Block\n   */\n    init: function() {\n        this.setColour(Blockly.Blocks.logic.HUE);\n        this.setOutput(true, \"Boolean\");\n        this.appendValueInput(\"LEFT\")\n            .setCheck(\"DatetimeDay\")\n            .appendField(new Blockly.FieldDropdown(DAYS), \"VALUE\")\n            .appendField(new Blockly.FieldDropdown(equalityOperators), \"OP\");\n    \n        this.setInputsInline(false);\n    }\n};\n\nBlockly.Python[\"datetime_check_day\"] = function(block) {\n    Blockly.Python.definitions_[\"import_parking\"] = \"import parking\";\n    var value = Blockly.Python.quote_(block.getFieldValue(\"VALUE\"));\n    var operator = Blockly.Python.quote_(block.getFieldValue(\"OP\"));\n    var left = Blockly.Python.valueToCode(block, \"LEFT\", Blockly.Python.ORDER_ATOMIC) || \"___\";\n    var code = \"parking.day_compare(\" + operator + \", \" + left + \", \" + value + \")\";\n    return [code, Blockly.Python.ORDER_ATOMIC];\n};\n\n\nBlockly.Blocks[\"datetime_check_time\"] = {\n    /**\n   * Block for testing if something contains something.\n   * @this Blockly.Block\n   */\n    init: function() {\n        this.setColour(Blockly.Blocks.logic.HUE);\n        this.setOutput(true, \"Boolean\");\n        this.appendValueInput(\"LEFT\")\n            .setCheck(\"DatetimeTime\")\n            .appendField(new Blockly.FieldDropdown(HOURS), \"HOURS\")\n            .appendField(\":\")\n            .appendField(new Blockly.FieldDropdown(MINUTES), \"MINUTES\")\n            .appendField(new Blockly.FieldDropdown(MERIDIANS), \"MERIDIANS\")\n            .appendField(new Blockly.FieldDropdown(equalityOperators), \"OP\");\n    //this.setInputsInline(true);\n    }\n};\n\nBlockly.Python[\"datetime_check_time\"] = function(block) {\n    Blockly.Python.definitions_[\"import_parking\"] = \"import parking\";\n    var hour = parseInt(block.getFieldValue(\"HOURS\"));\n    var minute = parseInt(block.getFieldValue(\"MINUTES\"));\n    var meridian = Blockly.Python.quote_(block.getFieldValue(\"MERIDIANS\"));\n    var operator = Blockly.Python.quote_(block.getFieldValue(\"OP\"));\n    var left = Blockly.Python.valueToCode(block, \"LEFT\", Blockly.Python.ORDER_ATOMIC);\n    var code = \"parking.time_compare(\" + operator+\", \"+left + \",\" + hour + \",\" + minute + \",\" +meridian + \")\";\n    return [code, Blockly.Python.ORDER_ATOMIC];\n};"
  },
  {
    "path": "src/blockly_blocks/turtles.js",
    "content": "/**\n * Turtles!\n */\nBlockly.Blocks[\"turtle_create\"] = {\n    init: function() {\n        this.appendDummyInput()\n            .appendField(\"create new turtle\");\n        this.setOutput(true, \"Turtle\");\n        this.setColour(180);\n        this.setTooltip(\"Creates a new turtle\");\n        this.setHelpUrl(\"\");\n    }\n};\nBlockly.Python[\"turtle_create\"] = function(block) {\n    Blockly.Python.definitions_[\"import_turtle\"] = \"import turtle\";\n    var code = \"turtle.Turtle()\";\n    // TODO: Change ORDER_NONE to the correct strength.\n    return [code, Blockly.Python.ORDER_NONE];\n};\nPythonToBlocks.KNOWN_MODULES[\"turtle\"] = {\n    \"Turtle\": [\"turtle_create\"]\n};\n\nBlockly.Blocks[\"turtle_color\"] = {\n    init: function() {\n        this.appendValueInput(\"TURTLE\")\n            .setCheck(\"Turtle\")\n            .appendField(\"make turtle\");\n        this.appendValueInput(\"COLOR\")\n            .setCheck(null)\n            .appendField(\"color\");\n        this.setPreviousStatement(true);\n        this.setNextStatement(true);\n        this.setOutput(false);\n        this.setInputsInline(true);\n        this.setColour(180);\n        this.setTooltip(\"\");\n        this.setHelpUrl(\"\");\n    }\n};\nBlockly.Python[\"turtle_color\"] = function(block) {\n    var turtle = Blockly.Python.valueToCode(block, \"TURTLE\", Blockly.Python.ORDER_ATOMIC);\n    var color = Blockly.Python.valueToCode(block, \"COLOR\", Blockly.Python.ORDER_ATOMIC);\n    var code = turtle+\".color(\"+color+\")\\n\";\n    return code;\n};\nPythonToBlocks.KNOWN_ATTR_FUNCTIONS[\"color\"] = function(func, args, keywords, starargs, kwargs, node) {\n    if (args.length < 1 || args.length > 2) {\n        throw new Error(\"Incorrect number of arguments to turtle.color!\");\n    }\n    return [block(\"turtle_color\", func.lineno, {}, { \n        \"COLOR\": this.convert(args[0]),\n        \"TURTLE\": this.convert(func.value)\n    }, {\"inline\": \"true\"})];\n};\n\nBlockly.Blocks[\"turtle_forward\"] = {\n    init: function() {\n        this.appendValueInput(\"TURTLE\")\n            .setCheck(\"Turtle\")\n            .appendField(\"make turtle\");\n        this.appendValueInput(\"DISTANCE\")\n            .setCheck(null)\n            .appendField(\"move forward by\");\n        this.setPreviousStatement(true);\n        this.setNextStatement(true);\n        this.setInputsInline(true);\n        this.setOutput(false);\n        this.setColour(180);\n        this.setTooltip(\"\");\n        this.setHelpUrl(\"\");\n    }\n};\nBlockly.Python[\"turtle_forward\"] = function(block) {\n    var turtle = Blockly.Python.valueToCode(block, \"TURTLE\", Blockly.Python.ORDER_ATOMIC);\n    var distance = Blockly.Python.valueToCode(block, \"DISTANCE\", Blockly.Python.ORDER_ATOMIC);\n    // TODO: Assemble Python into code variable.\n    var code = turtle+\".forward(\"+distance+\")\\n\";\n    return code;\n};\nPythonToBlocks.KNOWN_ATTR_FUNCTIONS[\"forward\"] = function(func, args, keywords, starargs, kwargs, node) {\n    if (args.length != 1) {\n        throw new Error(\"Incorrect number of arguments to turtle.forward!\");\n    }\n    return [block(\"turtle_forward\", func.lineno, {}, { \n        \"DISTANCE\": this.convert(args[0]),\n        \"TURTLE\": this.convert(func.value)\n    }, {\"inline\": \"true\"})];\n};\n\nBlockly.Blocks[\"turtle_backward\"] = {\n    init: function() {\n        this.appendValueInput(\"TURTLE\")\n            .setCheck(\"Turtle\")\n            .appendField(\"make turtle\");\n        this.appendValueInput(\"DISTANCE\")\n            .setCheck(null)\n            .appendField(\"move backward by\");\n        this.setPreviousStatement(true);\n        this.setInputsInline(true);\n        this.setNextStatement(true);\n        this.setOutput(false);\n        this.setColour(180);\n        this.setTooltip(\"\");\n        this.setHelpUrl(\"\");\n    }\n};\nBlockly.Python[\"turtle_backward\"] = function(block) {\n    var turtle = Blockly.Python.valueToCode(block, \"TURTLE\", Blockly.Python.ORDER_ATOMIC);\n    var distance = Blockly.Python.valueToCode(block, \"DISTANCE\", Blockly.Python.ORDER_ATOMIC);\n    // TODO: Assemble Python into code variable.\n    var code = turtle+\".backward(\"+distance+\")\\n\";\n    return code;\n};\nPythonToBlocks.KNOWN_ATTR_FUNCTIONS[\"backward\"] = function(func, args, keywords, starargs, kwargs, node) {\n    if (args.length != 1) {\n        throw new Error(\"Incorrect number of arguments to turtle.backward!\");\n    }\n    return [block(\"turtle_backward\", func.lineno, {}, { \n        \"DISTANCE\": this.convert(args[0]),\n        \"TURTLE\": this.convert(func.value)\n    }, {\"inline\": \"true\"})];\n};\n\nBlockly.Blocks[\"turtle_left\"] = {\n    init: function() {\n        this.appendValueInput(\"TURTLE\")\n            .setCheck(\"Turtle\")\n            .appendField(\"make turtle\");\n        this.appendValueInput(\"ANGLE\")\n            .setCheck(null)\n            .appendField(\"turn left by\");\n        this.setPreviousStatement(true);\n        this.setNextStatement(true);\n        this.setInputsInline(true);\n        this.setOutput(false);\n        this.setColour(180);\n        this.setTooltip(\"\");\n        this.setHelpUrl(\"\");\n    }\n};\nBlockly.Python[\"turtle_left\"] = function(block) {\n    var turtle = Blockly.Python.valueToCode(block, \"TURTLE\", Blockly.Python.ORDER_ATOMIC);\n    var angle = Blockly.Python.valueToCode(block, \"ANGLE\", Blockly.Python.ORDER_ATOMIC);\n    // TODO: Assemble Python into code variable.\n    var code = turtle+\".left(\"+angle+\")\\n\";\n    return code;\n};\nPythonToBlocks.KNOWN_ATTR_FUNCTIONS[\"left\"] = function(func, args, keywords, starargs, kwargs, node) {\n    if (args.length != 1) {\n        throw new Error(\"Incorrect number of arguments to turtle.left!\");\n    }\n    return [block(\"turtle_left\", func.lineno, {}, { \n        \"ANGLE\": this.convert(args[0]),\n        \"TURTLE\": this.convert(func.value)\n    }, {\"inline\": \"true\"})];\n};\n\nBlockly.Blocks[\"turtle_right\"] = {\n    init: function() {\n        this.appendValueInput(\"TURTLE\")\n            .setCheck(\"Turtle\")\n            .appendField(\"make turtle\");\n        this.appendValueInput(\"ANGLE\")\n            .setCheck(null)\n            .appendField(\"turn right by\");\n        this.setPreviousStatement(true);\n        this.setNextStatement(true);\n        this.setInputsInline(true);\n        this.setOutput(false);\n        this.setColour(180);\n        this.setTooltip(\"\");\n        this.setHelpUrl(\"\");\n    }\n};\nBlockly.Python[\"turtle_right\"] = function(block) {\n    var turtle = Blockly.Python.valueToCode(block, \"TURTLE\", Blockly.Python.ORDER_ATOMIC);\n    var angle = Blockly.Python.valueToCode(block, \"ANGLE\", Blockly.Python.ORDER_ATOMIC);\n    // TODO: Assemble Python into code variable.\n    var code = turtle+\".right(\"+angle+\")\\n\";\n    return code;\n};\nPythonToBlocks.KNOWN_ATTR_FUNCTIONS[\"right\"] = function(func, args, keywords, starargs, kwargs, node) {\n    if (args.length != 1) {\n        throw new Error(\"Incorrect number of arguments to turtle.right!\");\n    }\n    return [block(\"turtle_right\", func.lineno, {}, { \n        \"ANGLE\": this.convert(args[0]),\n        \"TURTLE\": this.convert(func.value)\n    }, {\"inline\": \"true\"})];\n};"
  },
  {
    "path": "src/blockpy.js",
    "content": "/**\n * @fileoverview Starting point of the BlockPy application, containing the main\n * BlockPy class.\n */\nimport \"./css/blockpy.css\";\nimport \"./css/bootstrap_retheme.css\";\nimport $ from \"jquery\";\nimport {$builtinmodule as imageModule} from \"skulpt_modules/image\";\nimport {$builtinmodule as weakrefModule} from \"skulpt_modules/weakref\";\n//import {$builtinmodule as matplotlibModule} from \"skulpt_modules/matplotlib2\";\nimport {LocalStorageWrapper} from \"storage.js\";\nimport {EditorsEnum} from \"editors.js\";\nimport {DisplayModes} from \"editor/python.js\";\nimport {StatusState} from \"server.js\";\nimport {makeInterface, makeExtraInterfaceSubscriptions, SecondRowSecondPanelOptions} from \"interface.js\";\nimport {Editors} from \"editors.js\";\nimport {\n    BlockPyFileSystem,\n    loadConcatenatedFile,\n    makeModelFile,\n    observeConcatenatedFile,\n    UNDELETABLE_FILES,\n    UNRENAMABLE_FILES\n} from \"./files\";\nimport {uploadFile, downloadFile} from \"./editor/abstract_editor\";\nimport {BlockPyEngine} from \"engine.js\";\nimport {AST_DESCRIPTIONS, BlockPyTrace} from \"./trace\";\nimport {BlockPyConsole} from \"./console\";\nimport {BlockPyFeedback} from \"feedback.js\";\nimport {BlockPyServer} from \"./server\";\nimport {BlockPyDialog} from \"./dialog\";\nimport {AssigmentType, loadAssignmentSettings, makeAssignmentSettingsModel} from \"./editor/assignment_settings\";\nimport {BlockPyCorgis, _IMPORTED_COMPLETE_DATASETS, _IMPORTED_DATASETS} from \"./corgis\";\nimport {BlockPyHistory} from \"./history\";\nimport {capitalize, extractPart, getCurrentTime} from \"./utilities\";\nimport {SampleSubmission, SubmissionStatuses} from \"./editor/sample_submissions\";\n\nexport {_IMPORTED_COMPLETE_DATASETS, _IMPORTED_DATASETS};\n\nconst EDITOR_VERSION = \"5.1.2\";\n\n/**\n * Major entry point for creating a BlockPy instance.\n * Two most important fields are `model` and `components`.\n * The `model` holds all the data about the interface.\n * The `components` are references to the disparate parts of BlockPy.\n *\n * Most of this classes definition is just initializing the model and updating\n * it on an assignment switch.\n */\nexport class BlockPy {\n    /**\n     * @param {Object} configuration - User level settings (e.g., what editor mode, whether to mute semantic errors, etc.)\n     * @param {Object} assignment - Assignment level settings (data about the loaded assignment, user, submission, etc.)\n     * @param {Object} submission - Includes the source code of any programs to be loaded\n     */\n    constructor(configuration, assignment, submission) {\n        this.initModel(configuration);\n        if (assignment !== undefined) {\n            this.setAssignment(configuration, assignment, submission);\n        }\n        this.initMain();\n    }\n\n    /**\n     * Initializes the BlockPy object by initializing its interface,\n     * model, and components.\n     *\n     */\n    initMain() {\n        this.initUtilities();\n        this.initModelMethods();\n        this.turnOnHacks();\n        this.initInterface();\n        this.applyModel();\n        this.initComponents();\n        this.makeExtraSubscriptions();\n        this.start();\n    };\n\n    /**\n     * Retrieves a default value or\n     * @param {string} key - the key to look up a value for\n     * @param {Object} defaultValue - if the key is not found anywhere, use this value\n     */\n    getSetting(key, defaultValue) {\n        if (key in this.initialConfiguration_) {\n            return this.initialConfiguration_[key];\n        } else if (this.localSettings_.has(key)) {\n            return this.localSettings_.get(key);\n        } else {\n            return defaultValue;\n        }\n    }\n\n    /**\n     * Initializes the model to its defaults.\n     *\n     * Categories:\n     *   * user: values for the current user (stored to server)\n     *   * assignment: values for the current assignment (stored to server)\n     *   * submission: values for the current submission (stored to server)\n     *   * display: flags related to current visibility (stored to localSettings)\n     *   * status: messages related to current status (not stored)\n     *   * execution: values related to last run (not stored)\n     *   * configuration: constant values related to setup (not stored)\n     */\n    initModel(configuration) {\n        // Connect to local storage\n        this.localSettings_ = new LocalStorageWrapper(\"localSettings\");\n        this.initialConfiguration_ = configuration;\n        //console.log(configuration, configuration[\"submission.code\"], configuration[\"partId\"], extractPart(configuration[\"submission.code\"] || \"\", configuration[\"partId\"]));\n\n        this.model = {\n            user: {\n                id: ko.observable(configuration[\"user.id\"]),\n                name: ko.observable(configuration[\"user.name\"]),\n                /**\n                 * Whether you are an Owner (can modify the assignment), Grader (can view\n                 * the assignments' information) or Student (can not see any instructor stuff).\n                 * @type {bool}\n                 */\n                role: ko.observable(this.getSetting(\"user.role\", \"owner\")),\n                /**\n                 * Current course for this user\n                 */\n                courseId: ko.observable(configuration[\"user.course_id\"]),\n                /**\n                 * Current assignment group that this user is inside\n                 */\n                groupId: ko.observable(configuration[\"user.group_id\"])\n            },\n            assignment: {\n                id: ko.observable(null),\n                name: ko.observable(\"Scratch Canvas\"),\n                instructions: ko.observable(\"Welcome to BlockPy. Try editing and running the code below.\"),\n                /**\n                 * The human-friendly URL to use as a shortcut for this assignment\n                 */\n                url: ko.observable(\"\"),\n                // TODO: warning message if maze\n                type: ko.observable(AssigmentType.BLOCKPY),\n                points: ko.observable(null),\n                startingCode: ko.observable(configuration[\"assignment.starting_code\"] || \"\"),\n                onRun: ko.observable(configuration[\"assignment.on_run\"] || \"\"),\n                onChange: ko.observable(configuration[\"assignment.on_change\"] || null),\n                onEval: ko.observable(configuration[\"assignment.on_eval\"] || null),\n                extraInstructorFiles: ko.observableArray(loadConcatenatedFile(configuration[\"assignment.extra_instructor_files\"]) || []),\n                extraStartingFiles: ko.observableArray([]),\n                forkedId: ko.observable(null),\n                forkedVersion: ko.observable(null),\n                ownerId: ko.observable(null),\n                courseId: ko.observable(null),\n                version: ko.observable(null),\n                tags: ko.observableArray([]),\n                sampleSubmissions: ko.observableArray([]),\n                reviewed: ko.observable(configuration[\"assignment.reviewed\"]),\n                public: ko.observable(configuration[\"assignment.public\"]),\n                hidden: ko.observable(configuration[\"assignment.hidden\"]),\n                ipRanges: ko.observable(configuration[\"assignment.ip_ranges\"]),\n                settings: makeAssignmentSettingsModel(configuration)\n            },\n            submission: {\n                id: ko.observable(null),\n                code: ko.observable(extractPart(configuration[\"submission.code\"] || \"\", configuration[\"partId\"]) || \"\"),\n                extraFiles: ko.observableArray([]),\n                url: ko.observable(\"\"),\n                endpoint: ko.observable(\"\"),\n                score: ko.observable(0),\n                correct: ko.observable(false),\n                // assignmentId inferred from assignment.id\n                // courseId inferred from user.courseId\n                // userId inferred from user.id\n                // assignmentVersion inferred from assignment.version\n                version: ko.observable(0),\n                submissionStatus: ko.observable(\"Started\"),\n                gradingStatus: ko.observable(\"NotReady\"),\n                ownerId: ko.observable(null)\n            },\n            display: {\n                /**\n                 * Currently visible File, if applicable\n                 * @type {String}\n                 */\n                filename: ko.observable(null),\n                /**\n                 * Whether or not to be presented with the instructor settings and files\n                 * @type {bool}\n                 */\n                instructor: ko.observable(\"\"+this.getSetting(\"display.instructor\", \"false\")===\"true\"),\n                /**\n                 * Whether or not to prevent the printer from showing things\n                 */\n                mutePrinter: ko.observable(false),\n                /**\n                 * (Python Views) The current editor mode.\n                 * @type {DisplayModes}\n                 */\n                pythonMode: ko.observable(this.getSetting(\"display.python.mode\", DisplayModes.TEXT)),\n                /**\n                 * Whether or not History mode is engaged.\n                 * @type {bool}\n                 */\n                historyMode: ko.observable(false),\n                /**\n                 * Whether or not to be auto-saving changes in Python editor\n                 * If an integer, specifies the delay that should be used (microseconds).\n                 * This is never on in non-Python editors.\n                 * @type {bool|int}\n                 */\n                autoSave: ko.observable(true),\n                /**\n                 * Whether or not the console is full width and feedback is hidden\n                 */\n                bigConsole: ko.observable(false),\n                /**\n                 * The height to use for the console.\n                 *    If null, then let the height remain unchanged\n                 *    If a number, then the\n                 */\n                previousConsoleHeight: ko.observable(null),\n                currentConsoleHeight: ko.observable(null),\n                /**\n                 * Which panel to show in the second row's second column\n                 * @type {SecondRowSecondPanelOptions}\n                 */\n                secondRowSecondPanel: ko.observable(SecondRowSecondPanelOptions.FEEDBACK),\n                previousSecondRowSecondPanel: ko.observable(null),\n                /**\n                 * Whether or not to be tracing the code right now\n                 */\n                traceExecution: ko.observable(false),\n                /**\n                 * The list of promises to still resolve while loading datasets\n                 * @type {Array<Promise>}\n                 */\n                loadingDatasets: ko.observableArray([]),\n                /**\n                 * The temporary changed value of the instructions have been changed from what is in the assignment\n                 */\n                changedInstructions: ko.observable(null),\n                /**\n                 * A holder for the timer to trigger on-changes\n                 */\n                triggerOnChange: null,\n                /**\n                 * Whether the current feedback and output corresponds to the current submission.\n                 * This would be false if there is no feedback/output (i.e., code has not been run),\n                 * or if the user has modified the submission after the last run (e.g., by editing\n                 * the text).\n                 */\n                dirtySubmission: ko.observable(true),\n                /**\n                 *  Whether or not to make the BlockPy element in FULL SCREEN mode. Sadly, not fullscreen\n                 *  within the window, but FULL SCREEN. Very aggressive.\n                 */\n                fullscreen: ko.observable(false),\n                /**\n                 * User-supplied passcode to compare on the server against the current passcode.\n                 */\n                passcode: ko.observable(\"\"),\n                /**\n                 * Whether or not to clear out inputs after a run/on_run cycle\n                 */\n                clearInputs: ko.observable(true),\n                /**\n                 * Whether or not images should be rendered (true), or just stay as text code (false).\n                 */\n                renderImages: ko.observable(true),\n                editorVersion: EDITOR_VERSION,\n                readOnly: ko.observable(this.getSetting(\"display.read_only\", \"false\").toString()===\"true\"),\n                /**\n                 * Uploaded files are ones that have been listed by the remote\n                 */\n                uploadedFiles: ko.observable(null),\n                /**\n                 * Backup copy of the latest known full code for the Submission. This is relevant if there was a\n                 * PartID specified, in which case the submission.code in the model is only showing what we know\n                 * locally.\n                 */\n                backupSubmissionCode: ko.observable(configuration[\"submission.code\"] || \"\"),\n                /**\n                 * Controls the rating system\n                 */\n                showRating: ko.observable(this.getSetting(\"display.showRating\", \"true\").toString()===\"true\"),\n                /**\n                 * Whether the student has rated this current feedback\n                 */\n                hasRated: ko.observable(false),\n            },\n            status: {\n                // @type {ServerStatus}\n                loadAssignment: ko.observable(StatusState.READY),\n                loadAssignmentMessage: ko.observable(\"\"),\n                // @type {ServerStatus}\n                loadHistory: ko.observable(StatusState.READY),\n                loadHistoryMessage: ko.observable(\"\"),\n                // @type {ServerStatus}\n                loadFile: ko.observable(StatusState.READY),\n                loadFileMessage: ko.observable(\"\"),\n                // @type {ServerStatus}\n                loadDataset: ko.observable(StatusState.READY),\n                loadDatasetMessage: ko.observable(\"\"),\n                // @type {ServerStatus}\n                logEvent: ko.observable(StatusState.READY),\n                logEventMessage: ko.observable(\"\"),\n                // @type {ServerStatus}\n                saveImage: ko.observable(StatusState.READY),\n                saveImageMessage: ko.observable(\"\"),\n                // @type {ServerStatus}\n                saveFile: ko.observable(StatusState.READY),\n                saveFileMessage: ko.observable(\"\"),\n                // @type {ServerStatus}\n                saveAssignment: ko.observable(StatusState.READY),\n                saveAssignmentMessage: ko.observable(\"\"),\n                // @type {ServerStatus}\n                updateSubmission: ko.observable(StatusState.READY),\n                updateSubmissionMessage: ko.observable(\"\"),\n                // @type {ServerStatus}\n                updateSubmissionStatus: ko.observable(StatusState.READY),\n                updateSubmissionStatusMessage: ko.observable(\"\"),\n                // @type {ServerStatus}\n                listUploadedFiles: ko.observable(StatusState.READY),\n                listUploadedFilesMessage: ko.observable(\"\"),\n                // @type {ServerStatus}\n                downloadFile: ko.observable(StatusState.READY),\n                downloadFileMessage: ko.observable(\"\"),\n                // @type {ServerStatus}\n                uploadFile: ko.observable(StatusState.READY),\n                uploadFileMessage: ko.observable(\"\"),\n                // @type {ServerStatus}\n                renameFile: ko.observable(StatusState.READY),\n                renameFileMessage: ko.observable(\"\"),\n                // @type {ServerStatus}\n                externalAPI: ko.observable(StatusState.READY),\n                externalAPIMessage: ko.observable(\"\"),\n                // @type {ServerStatus}\n                onExecution: ko.observable(StatusState.READY),\n            },\n            execution: {\n                // Information about in-progress executions\n                reports: {},\n                // list of Output objects\n                output: ko.observableArray([]),\n                // List of inputted strings\n                input: ko.observableArray([]),\n                inputIndex: ko.observable(0),\n                // Information related to a student run\n                student: {\n                    // str: the filename that was last executed and is associated with these results\n                    filename: ko.observable(null),\n                    // integer\n                    currentStep: ko.observable(null),\n                    // integer\n                    lastStep: ko.observable(null),\n                    // integer\n                    currentLine: ko.observable(null),\n                    lastLine: ko.observable(0),\n                    // array of simple objects\n                    currentTraceData: ko.observableArray([]),\n                    // integer\n                    currentTraceStep: ko.observable(0),\n                    // Actual execution results\n                    results: null,\n                    globals: ko.observable(null),\n                    calls: {}\n                },\n                instructor: {\n                    globals: null,\n                    sysmodules: undefined\n                },\n                // Information related to feedback from the instructor run\n                feedback: {\n                    // str (markdown)\n                    message: ko.observable(\"Ready\"),\n                    category: ko.observable(null),\n                    label: ko.observable(null),\n                    hidden: ko.observable(false),\n                    linesError: ko.observableArray([]),\n                    linesUncovered: ko.observableArray([]),\n                    // The results of the last execution\n                    results: null,\n                },\n            },\n            configuration: {\n                /**\n                 * Functions to fire when certain events occur\n                 */\n                callbacks: {\n                    /**\n                     * When the student gets a success\n                     */\n                    \"success\": this.initialConfiguration_[\"callback.success\"],\n                },\n                /**\n                 * Whether or not the server is connected.\n                 * @type {bool}\n                 */\n                serverConnected: ko.observable(this.getSetting(\"server.connected\", true)),\n                // string\n                blocklyPath: this.initialConfiguration_[\"blockly.path\"],\n                // string\n                attachmentPoint: this.initialConfiguration_[\"attachment.point\"],\n                // JQuery object\n                container: null,\n                // Maps codes ('log_event', 'save_code') to URLs\n                urls: this.initialConfiguration_[\"urls\"] || {},\n                /**\n                 * Unique Part ID that can distinguish this editor instance's region of the assignment.\n                 * It's possible that other editors may be attached to a different Part of the same assignmnet, on the\n                 * same page.\n                 * **/\n                partId: ko.observable(configuration[\"partId\"] || \"\"),\n                accessToken: ko.observable(configuration[\"access_token\"] || undefined),\n            }\n        };\n    };\n\n    /**\n     * Creates the interface\n     */\n    initInterface() {\n        let constants = this.model.configuration;\n        let gui = makeInterface(this);\n        constants.container = $(constants.attachmentPoint).html($(gui));\n    };\n\n    loadAssignment(assignment_id) {\n        this.components.server.loadAssignment(assignment_id);\n    }\n\n    loadTags(tags) {\n        // Already a JSON list representing tags\n    }\n\n    loadSampleSubmissions(samples) {\n        // Already a JSON list representing samples\n    }\n\n    loadNoSubmission(assignment) {\n        this.model.submission.code(assignment.starting_code);\n        loadConcatenatedFile(assignment.extra_starting_files, this.model.submission.extraFiles);\n    }\n\n    loadSubmission(submission, assignment) {\n        if (!submission) {\n            // TODO: Scarier \"You are not logged in message\"\n            this.loadNoSubmission(assignment);\n            return false;\n        }\n        // TODO: What if submissions' assignment version and the assignments' version conflict?\n        this.model.submission.id(submission.id);\n        this.model.display.backupSubmissionCode(submission.code);\n        this.model.submission.code(extractPart(submission.code, this.model.configuration.partId()) || \"\");\n        this.model.submission.correct(submission.correct);\n        this.model.submission.score(submission.score);\n        this.model.submission.endpoint(submission.endpoint);\n        this.model.submission.url(submission.url);\n        this.model.submission.version(submission.version);\n        this.model.submission.gradingStatus(submission.grading_status || SubmissionStatuses.UNKNOWN);\n        this.model.submission.submissionStatus(submission.submission_status || SubmissionStatuses.UNKNOWN);\n        this.model.submission.ownerId(submission.user_id);\n        this.model.user.courseId(submission.course_id);\n        loadConcatenatedFile(submission.extra_files, this.model.submission.extraFiles);\n    }\n\n    loadAssignmentData_(data) {\n        console.debug(data);\n        this.resetInterface();\n        this.components.fileSystem.dismountExtraFiles();\n        let wasServerConnected = this.model.configuration.serverConnected();\n        this.model.configuration.serverConnected(false);\n        let assignment = data.assignment;\n        this.model.assignment.id(assignment.id);\n        this.model.assignment.version(assignment.version);\n        this.model.assignment.courseId(assignment.course_id);\n        this.model.assignment.forkedId(assignment.forked_id);\n        this.model.assignment.forkedVersion(assignment.forked_version);\n        this.model.assignment.hidden(assignment.hidden);\n        this.model.assignment.reviewed(assignment.reviewed);\n        this.model.assignment.public(assignment.public);\n        this.model.assignment.type(assignment.type);\n        this.model.assignment.url(assignment.url);\n        this.model.assignment.points(assignment.points);\n        this.model.assignment.ipRanges(assignment.ip_ranges);\n        this.model.assignment.instructions(assignment.instructions);\n        this.model.assignment.name(assignment.name);\n        this.model.assignment.onChange(assignment.on_change || null);\n        if (assignment.on_change) {\n            this.components.fileSystem.newFile(\"!on_change.py\", assignment.on_change);\n        }\n        this.model.assignment.onEval(assignment.on_eval || null);\n        if (assignment.on_eval) {\n            this.components.fileSystem.newFile(\"!on_eval.py\", assignment.on_eval);\n        }\n        this.model.assignment.onRun(assignment.on_run);\n        this.model.assignment.startingCode(assignment.starting_code);\n        this.model.assignment.ownerId(assignment.owner_id);\n        this.loadTags(assignment.tags);\n        this.loadSampleSubmissions(assignment.sample_submissions);\n        loadConcatenatedFile(assignment.extra_instructor_files, this.model.assignment.extraInstructorFiles);\n        loadConcatenatedFile(assignment.extra_starting_files, this.model.assignment.extraStartingFiles);\n        loadAssignmentSettings(this.model, assignment.settings);\n        this.loadSubmission(data.submission, assignment);\n        this.model.display.dirtySubmission(true);\n        this.model.display.changedInstructions(null);\n        this.model.configuration.serverConnected(wasServerConnected);\n        this.components.corgis.loadDatasets(true);\n        this.components.pythonEditor.bm.refresh();\n        this.components.fileSystem.loadRemoteFiles();\n\n        this.components.server.setStatus(\"saveFile\", StatusState.READY);\n    }\n\n    initModelMethods() {\n        let self = this;\n        let model = this.model;\n        model.ui = {\n            smallLayout: ko.pureComputed(()=>\n                !model.display.instructor() && model.assignment.settings.smallLayout()),\n            role: {\n                isGrader: ko.pureComputed(()=>\n                    model.user.role() === \"owner\" || model.user.role() === \"grader\")\n            },\n            instructions: {\n                isChanged: ko.pureComputed(() =>\n                    model.display.changedInstructions() !== null\n                ),\n                current: ko.pureComputed(() =>\n                    model.ui.instructions.isChanged() ?\n                        self.utilities.markdown(model.display.changedInstructions()) :\n                        self.utilities.markdown(model.assignment.instructions())\n                ),\n                reset: () =>\n                    model.display.changedInstructions(null)\n            },\n            menu: {\n                visible: ko.pureComputed(\n                    () =>\n                        model.display.instructor() || !model.assignment.settings.onlyInteractive()\n                ),\n                textFullscreen: ko.pureComputed(() =>\n                    (model.display.fullscreen()) ? \"fa-compress-arrows-alt\" : \"fa-expand-arrows-alt\"\n                ),\n                clickFullscreen: () =>{\n                    model.display.fullscreen(!model.display.fullscreen());\n                },\n                editInputs: () => {\n                    this.components.dialog.EDIT_INPUTS();\n                },\n                toggleImages: () => {\n                    if (model.display.renderImages()) {\n                        self.components.pythonEditor.bm.textEditor.disableImages();\n                    } else {\n                        self.components.pythonEditor.bm.textEditor.enableImages();\n                    }\n                    model.display.renderImages(!model.display.renderImages());\n                },\n                canMarkSubmitted: ko.pureComputed(() =>\n                    model.assignment.hidden() || model.assignment.reviewed() ||\n                    model.assignment.settings.canClose()\n                ),\n                textMarkSubmitted: ko.pureComputed(() => {\n                    if (model.ui.menu.isCompleted()) {\n                        return model.user.groupId() ? \"Problem closed\" : \"Assignment closed\";\n                    } else if (model.ui.menu.isSubmitted()) {\n                        return \"Reopen for editing\";\n                    } else if (model.display.dirtySubmission()) {\n                        return \"Run\";\n                    } else {\n                        if (!model.assignment.hidden() && model.submission.correct()) {\n                            return \"Submit\";\n                        } else {\n                            return \"Submit early\";\n                        }\n                    }\n                }),\n                clickMarkSubmitted: () => {\n                    if (model.ui.menu.isCompleted()) {\n                        alert(\"You cannot reopen closed assignments. Contact a grader!\");\n                    } else if (model.ui.menu.isSubmitted()) {\n                        self.components.server.updateSubmissionStatus(\"inProgress\");\n                    } else if (model.display.dirtySubmission()) {\n                        self.components.engine.delayedRun();\n                    } else {\n                        self.components.server.updateSubmissionStatus(\"Submitted\");\n                    }\n                },\n                isSubmitted: ko.pureComputed(() =>\n                    (model.assignment.reviewed() || model.assignment.settings.canClose()) &&\n                    model.submission.submissionStatus().toLowerCase() === \"submitted\"\n                ),\n                isCompleted: ko.pureComputed(()=>\n                    model.submission.submissionStatus().toLowerCase() === \"completed\"\n                ),\n                showQueuedInputs: ko.pureComputed(() =>\n                    !model.assignment.settings.hideQueuedInputs()\n                ),\n                showClock: ko.pureComputed(() =>\n                    !model.assignment.settings.hasClock()\n                ),\n                canShare: ko.pureComputed(() =>\n                    model.configuration.urls[\"shareUrl\"] !== undefined\n                ),\n                getShareUrl: (wasPrompted) => {\n                    const parts = [\"group\", model.user.courseId(), model.user.groupId(), model.assignment.id(), model.user.id()];\n                    /*const interestingDetails = {\n                        \"when\": new Date().toISOString(),\n                        // \"feedback\": model.execution.feedback.category() + \"|\" + model.execution.feedback.label(),\n                        // \"wasPrompted\": wasPrompted\n                    };\n                    parts.push(btoa(JSON.stringify(interestingDetails)));\n                    console.log(interestingDetails);*/\n                    parts.push(new Date().toISOString());\n\n                    // Base64 encode the parts\n                    const encoded = btoa(parts.join(\"_\"));\n                    // Construct the target URL using model.configuration.urls[\"shareUrl\"]\n                    const baseUrl = model.configuration.urls[\"shareUrl\"];\n                    return baseUrl + (baseUrl.endsWith(\"/\") ? \"\" : \"/\") + encoded;\n                },\n                startShare: (wasPrompted) => {\n                    this.components.dialog.START_SHARE(\n                        model.ui.menu.getShareUrl(wasPrompted),\n                        wasPrompted\n                    );\n                },\n            },\n            secondRow: {\n                width: ko.pureComputed(()=>\n                    model.display.instructor() || !model.assignment.settings.smallLayout() ?\n                        \"col-md-12\" : \"col-md-5\"\n                ),\n                hideTraceButton: ko.pureComputed(()=>\n                    !model.display.instructor() && model.assignment.settings.hideTraceButton()\n                ),\n                isAllVisible: ko.pureComputed(() =>\n                    !model.assignment.settings.hideMiddlePanel()\n                ),\n                isFeedbackVisible: ko.pureComputed(() =>\n                    model.display.secondRowSecondPanel() === SecondRowSecondPanelOptions.FEEDBACK\n                ),\n                isTraceVisible: ko.pureComputed(() =>\n                    model.display.secondRowSecondPanel() === SecondRowSecondPanelOptions.TRACE\n                ),\n                isConsoleShowVisible: ko.pureComputed(() =>\n                    model.ui.secondRow.isFeedbackVisible() || model.ui.secondRow.isTraceVisible()\n                ),\n                switchLabel: ko.pureComputed(() =>\n                    model.execution.student.lastStep() !== null ?\n                        \"View Trace\" : \"\"\n                ),\n                advanceState: function () {\n                    let currentPanel = model.display.secondRowSecondPanel;\n                    if (currentPanel() === SecondRowSecondPanelOptions.NONE) {\n                        currentPanel(SecondRowSecondPanelOptions.FEEDBACK);\n                    } else if (currentPanel() === SecondRowSecondPanelOptions.TRACE) {\n                        currentPanel(SecondRowSecondPanelOptions.NONE);\n                    } else if (model.execution.student.lastStep() !== null) {\n                        currentPanel(SecondRowSecondPanelOptions.TRACE);\n                    } else {\n                        currentPanel(SecondRowSecondPanelOptions.NONE);\n                    }\n                },\n                makeWide: function () {\n                    const currentPanel = model.display.secondRowSecondPanel;\n                    model.display.previousSecondRowSecondPanel(currentPanel());\n                    currentPanel(SecondRowSecondPanelOptions.NONE);\n                },\n                restorePanel: function() {\n                    const oldPanel = model.display.previousSecondRowSecondPanel;\n                    if (oldPanel() !== null) {\n                        model.display.secondRowSecondPanel(oldPanel());\n                        oldPanel(null);\n                    }\n                }\n            },\n            console: {\n                size: ko.pureComputed(() =>\n                    (!model.display.instructor() && model.assignment.settings.smallLayout()) ||\n                    (model.display.secondRowSecondPanel() === SecondRowSecondPanelOptions.NONE) ?\n                        \"col-md-12\" :\n                        \"col-md-6\"\n                ),\n                hideEvaluate: ko.pureComputed( ()=>\n                    model.assignment.settings.hideEvaluate() || !model.execution.student.globals() ||\n                    model.status.onExecution() === StatusState.ACTIVE\n                )\n            },\n            feedback: {\n                badge: ko.pureComputed(function () {\n                    if (model.execution.feedback.category() === null) {\n                        return \"label-none\";\n                    }\n                    switch (model.execution.feedback.category().toLowerCase()) {\n                        default:\n                        case \"none\":\n                            return \"label-none\";\n                        case \"runtime\":\n                            return \"label-runtime-error\";\n                        case \"syntax\":\n                            return \"label-syntax-error\";\n                        case \"editor\":\n                            return \"label-syntax-error\";\n                        case \"internal\":\n                            return \"label-internal-error\";\n                        case \"semantic\":\n                        case \"analyzer\":\n                            return \"label-semantic-error\";\n                        case \"feedback\":\n                        case \"instructor\":\n                            return \"label-feedback-error\";\n                        case \"complete\":\n                            return \"label-problem-complete\";\n                        case \"instructions\":\n                            return \"label-instructions\";\n                        case \"no errors\":\n                            return \"label-no-errors\";\n                    }\n                }),\n                category: ko.pureComputed(function () {\n                    if (model.execution.feedback.category() === null) {\n                        return \"\";\n                    }\n                    switch (model.execution.feedback.category().toLowerCase()) {\n                        default:\n                        case \"none\":\n                            return \"\";\n                        case \"runtime\":\n                            return \"Runtime Error\";\n                        case \"syntax\":\n                            return \"Syntax Error\";\n                        case \"editor\":\n                            return \"Editor Error\";\n                        case \"internal\":\n                            return \"Internal Error\";\n                        case \"semantic\":\n                        case \"analyzer\":\n                            return \"Algorithm Error\";\n                        case \"feedback\":\n                        case \"instructions\":\n                            return \"Instructions\";\n                        case \"instructor\":\n                            return \"Incorrect Answer\";\n                        case \"complete\":\n                            return \"Complete\";\n                        case \"no errors\":\n                            return \"No errors\";\n                    }\n                }),\n                resetScore: () => {\n                    model.submission.score(0);\n                    model.submission.correct(false);\n                    self.components.server.updateSubmission(model.submission.score(), model.submission.correct(), true, true);\n                },\n                provideRatings: ko.pureComputed(() =>\n                    !model.assignment.hidden()\n                ),\n                flipRating: () => {\n                    const newState = !model.display.showRating();\n                    model.display.showRating(newState);\n                    self.localSettings_.set(\"display.showRating\", newState.toString());\n                },\n                rate: (rating, suggestShare=false) => {\n                    self.components.server.logEvent(\"X-Rating\",\n                                                    model.execution.feedback.category(),\n                                                    model.execution.feedback.label(),\n                                                    rating);\n                    model.configuration.container.find(\".blockpy-rating\").fadeOut(500, function() {\n                        $(this).fadeIn(500);\n                        model.display.hasRated(true);\n                    });\n                    const thankYou = model.configuration.container.find(\".blockpy-feedback-thank-you\");\n                    thankYou.addClass(\"show\");\n                    setTimeout(() => {\n                        thankYou.removeClass(\"show\");\n                        if (model.display.hasRated()) {\n                            model.ui.menu.startShare(true);\n                        }\n                    }, 1000);\n                },\n                hasRatedClass: ko.pureComputed(() =>\n                    model.display.hasRated() ? \"far\" : \"fas\"\n                ),\n                addPositiveFeedback: (text, icon, color, onclick, toEnd, instructorOnly) => {\n                    if (!instructorOnly || model.display.instructor()) {\n                        self.components.feedback.addPositiveFeedback(text, icon, color, onclick, toEnd);\n                    }\n                }\n            },\n            trace: {\n                has: ko.pureComputed(() =>\n                    model.execution.student.currentTraceData() !== null\n                ),\n                highlightedLine: ko.pureComputed(() => {\n                    if (model.display.secondRowSecondPanel() !== SecondRowSecondPanelOptions.TRACE) {\n                        return [];\n                    }\n                    let step = model.execution.student.currentTraceStep();\n                    let lastStep = model.execution.student.lastStep();\n                    let traceData = model.execution.student.currentTraceData();\n                    if (!traceData || step === null) {\n                        return [];\n                    } else if (step === 0) {\n                        return [];\n                    } else {\n                        return [traceData[step-1].line];\n                    }\n                }),\n                line: ko.pureComputed(function () {\n                    let step = model.execution.student.currentTraceStep();\n                    let lastStep = model.execution.student.lastStep();\n                    let traceData = model.execution.student.currentTraceData();\n                    if (!traceData || step === null) {\n                        return \"No trace\";\n                    }\n                    if (step === 0) {\n                        return \"Before run\";\n                    } else if (step === lastStep) {\n                        return \"Finished run\";\n                    } else {\n                        // TODO: why are these numbers wonky?\n                        return \"Line \"+(traceData[step-1].line);\n                    }\n                }),\n                ast: ko.pureComputed(function () {\n                    let step = model.execution.student.currentTraceStep();\n                    let lastStep = model.execution.student.lastStep();\n                    let traceData = model.execution.student.currentTraceData();\n                    if (!traceData) {\n                        return \"Nothing traced.\";\n                    }\n                    switch (step) {\n                        case 0:\n                            return \"Starting execution\";\n                        case lastStep:\n                            if (!model.execution.reports.student.success) {\n                                return \"Execution halted (error)\";\n                            }\n                            return \"Finished execution\";\n                        default:\n                            return \"Current step: \" + AST_DESCRIPTIONS[traceData[step-1].ast];\n                    }\n                }),\n                first: function () {\n                    model.execution.student.currentTraceStep(0);\n                },\n                backward: function () {\n                    let previous = Math.max(0, model.execution.student.currentTraceStep() - 1);\n                    model.execution.student.currentTraceStep(previous);\n                },\n                forward: function () {\n                    let next = Math.min(model.execution.student.lastStep(), model.execution.student.currentTraceStep() + 1);\n                    model.execution.student.currentTraceStep(next);\n                },\n                last: function () {\n                    model.execution.student.currentTraceStep(model.execution.student.lastStep());\n                },\n                data: ko.pureComputed(function () {\n                    let step = model.execution.student.currentTraceStep();\n                    let lastStep = model.execution.student.lastStep();\n                    let traceData = model.execution.student.currentTraceData();\n                    if (!traceData) {\n                        return [];\n                    }\n                    switch (step) {\n                        case 0:\n                            return [];\n                        case lastStep:\n                            return traceData[step - 1];\n                        default:\n                            return traceData[step];\n                    }\n                }),\n            },\n            files: {\n                visible: ko.pureComputed(() =>\n                    model.display.instructor() || !model.assignment.settings.hideFiles() || model.assignment.settings.preloadAllFiles()\n                ),\n                addIsVisible: ko.pureComputed(() =>\n                    model.display.instructor() || !model.assignment.settings.hideFiles()\n                ),\n                width: ko.pureComputed(()=>\n                    model.display.instructor() || !model.assignment.settings.smallLayout() ?\n                        \"col-md-12\" : \"col-md-6\"\n                ),\n                hasContents: function(path) {\n                    switch (path) {\n                        case \"answer.py\": return model.submission.code();\n                        case \"!instructions.md\": return model.assignment.instructions();\n                        case \"!on_change.py\": return model.assignment.onChange() !== null;\n                        case \"!on_eval.py\": return model.assignment.onEval() !== null;\n                        case \"?mock_urls.blockpy\": return model.assignment.extraInstructorFiles().some(file =>\n                            file.filename() === \"?mock_urls.blockpy\");\n                        case \"images.blockpy\": return model.assignment.extraInstructorFiles().some(file =>\n                            file.filename() === \"images.blockpy\");\n                        case \"!answer_prefix.py\": return model.assignment.extraInstructorFiles().some(file =>\n                            file.filename() === \"!answer_prefix.py\");\n                        case \"!answer_suffix.py\": return model.assignment.extraInstructorFiles().some(file =>\n                            file.filename() === \"!answer_suffix.py\");\n                        case \"?toolbox.blockpy\": return model.assignment.extraInstructorFiles().some(file =>\n                            file.filename() === \"?toolbox.blockpy\");\n                        case \"!tags.blockpy\": return model.assignment.tags().length;\n                        case \"!sample_submissions.blockpy\": return model.assignment.sampleSubmissions().length;\n                        default: return false;\n                    }\n                },\n                add: function(path) {\n                    switch (path) {\n                        case \"?mock_urls.blockpy\":\n                        case \"!answer_prefix.py\":\n                        case \"!answer_suffix.py\":\n                        case \"?tags.blockpy\":\n                        case \"?settings.blockpy\":\n                            self.components.fileSystem.newFile(path);\n                            break;\n                        case \"images.blockpy\":\n                            self.components.fileSystem.newFile(path, \"{}\");\n                            break;\n                        case \"?toolbox.blockpy\":\n                            let normalToolbox = self.components.pythonEditor.bm.blockEditor.TOOLBOXES[\"normal\"];\n                            normalToolbox = JSON.stringify(normalToolbox, null, 2);\n                            self.components.fileSystem.newFile(path, normalToolbox);\n                            break;\n                        case \"!sample_submissions.blockpy\":\n                            model.assignment.sampleSubmissions([SampleSubmission.Blank()]);\n                            self.components.fileSystem.newFile(path);\n                            break;\n                        case \"!on_change.py\":\n                            model.assignment.onChange(\"\");\n                            self.components.fileSystem.newFile(path);\n                            break;\n                            // TODO fix extrafiles for instructor and student\n                        case \"!on_eval.py\":\n                            model.assignment.onEval(\"\");\n                            self.components.fileSystem.newFile(path);\n                            break;\n                        case \"instructor\":\n                            self.components.fileSystem.newFileDialog(\"instructor\");\n                            return;\n                        case \"student\":\n                            self.components.fileSystem.newFileDialog(\"student\");\n                            return;\n                        case \"starting\":\n                            self.components.fileSystem.newFileDialog(\"starting\");\n                            return;\n                        default:\n\n                    }\n                    model.display.filename(path);\n                },\n                delete: function() {\n                    return self.components.fileSystem.deleteFile(model.display.filename());\n                },\n                rename: (newName) => {\n                    return self.components.fileSystem.renameFile(model.display.filename(), newName);\n                },\n                getStudentCode: function() {\n                    let prefixPy = self.components.fileSystem.getFile(\"!answer_prefix.py\");\n                    let suffixPy = self.components.fileSystem.getFile(\"!answer_suffix.py\");\n                    let code = self.model.submission.code();\n                    if (prefixPy && prefixPy.handle && prefixPy.handle()) {\n                        code = prefixPy.handle() + code;\n                    }\n                    if (suffixPy && suffixPy.handle && suffixPy.handle()) {\n                        code = code + suffixPy.handle();\n                    }\n                    return code;\n                },\n                extraStudentFiles: observeConcatenatedFile(model.submission.extraFiles),\n                extraInstructorFiles: observeConcatenatedFile(model.assignment.extraInstructorFiles),\n                extraStartingFiles: observeConcatenatedFile(model.assignment.extraStartingFiles),\n                displayFilename: function(path) {\n                    if (path === \"?mock_urls.blockpy\") {\n                        return \"URL Data\";\n                    }\n                    if (path === \"images.blockpy\") {\n                        return \"Images\";\n                    }\n                    if (path === \"!answer_prefix.py\") {\n                        return \"Answer Prefix\";\n                    }\n                    if (path === \"!answer_suffix.py\") {\n                        return \"Answer Suffix\";\n                    }\n                    if (path === \"?toolbox.blockpy\") {\n                        return \"Toolbox\";\n                    }\n                    if (path.startsWith(\"&\")) {\n                        return path.slice(1);\n                    }\n                    return path;\n                },\n            },\n            editors: {\n                current: ko.pureComputed( ()=>\n                    self.components.editors.getEditor(model.display.filename())\n                ),\n                width: ko.pureComputed(()=>\n                    model.display.instructor() || !model.assignment.settings.smallLayout() ?\n                        \"col-md-12\" : \"col-md-7\"\n                ),\n                view: ko.pureComputed(() =>\n                    (!model.display.instructor() && (\n                        model.assignment.settings.hideEditors() ||\n                        model.assignment.settings.onlyInteractive())) ? \"None\" :\n                    model.display.filename() ? model.ui.editors.current() : \"None\"\n                ),\n                reset: function() {\n                    self.components.server.logEvent(\"X-File.Reset\", \"\", \"\", \"\", \"answer.py\");\n                    model.submission.code(model.assignment.startingCode());\n                    model.submission.extraFiles(model.assignment.extraStartingFiles().map(\n                        file => {\n                            let filename = file.filename().substr(1);\n                            return makeModelFile(filename, file.contents());\n                        }\n                    ));\n                },\n                canSave: ko.pureComputed(() =>\n                    !model.display.autoSave()),\n                canDelete: ko.pureComputed(() =>\n                    (!model.assignment.settings.hideFiles() || model.display.instructor()) &&\n                    UNDELETABLE_FILES.indexOf(model.display.filename()) === -1),\n                canRename: ko.pureComputed(() =>\n                    (!model.assignment.settings.hideFiles() || model.display.instructor()) &&\n                    UNRENAMABLE_FILES.indexOf(model.display.filename()) === -1),\n                upload: uploadFile.bind(self),\n                download: downloadFile.bind(self),\n                importDataset: () => {\n                    self.components.corgis.openDialog();\n                },\n                python: {\n                    fullscreen: () => {\n                        let codeMirror = self.components.pythonEditor.bm.textEditor.codeMirror;\n                        return codeMirror.setOption(\"fullScreen\", !codeMirror.getOption(\"fullScreen\"));\n                    },\n                    updateMode: (newMode) => {\n                        self.components.server.logEvent(\"X-View.Change\", \"\", \"\", newMode, model.display.filename());\n                        model.display.pythonMode(newMode);\n                        if (model.display.filename() === \"answer.py\") {\n                            self.components.pythonEditor.oldPythonMode = newMode;\n                        }\n                    },\n                    isHistoryAvailable: ko.pureComputed(()=>\n                        model.ui.server.isEndpointConnected(\"loadHistory\")),\n                    turnOffHistoryMode: () => {\n                        self.components.pythonEditor.updateEditor();\n                        self.components.pythonEditor.setReadOnly(false);\n                        model.display.historyMode(false);\n                    },\n                    turnOnHistoryMode: () => {\n                        self.components.server.loadHistory((response) =>{\n                            if (response.success) {\n                                self.components.history.load(response.history);\n                                model.display.historyMode(true);\n                                self.components.pythonEditor.setReadOnly(true);\n                            } else {\n                                self.components.dialog.ERROR_LOADING_HISTORY();\n                            }\n                        });\n                    },\n                    toggleHistoryMode: () => {\n                        if (model.display.historyMode()) {\n                            model.ui.editors.python.turnOffHistoryMode();\n                        } else {\n                            model.ui.editors.python.turnOnHistoryMode();\n                        }\n                    },\n                    history: {\n                        start: ()=>{ self.components.history.moveToStart(); },\n                        previous: ()=>{ self.components.history.movePrevious(); },\n                        next: ()=>{ self.components.history.moveNext(); },\n                        mostRecent: ()=>{ self.components.history.moveToMostRecent(); },\n                        use: ()=>{ self.components.history.use(); }\n                    }\n                },\n                images: {\n                    uploadFile: () => self.components.editors.byName(\"image\").uploadFile(),\n                    deleteFile: (fileInfo) => self.components.editors.byName(\"image\").deleteFile(fileInfo),\n                    renameFile: (fileInfo) => self.components.editors.byName(\"image\").renameFile(fileInfo),\n                    reloadImages: () => self.components.editors.byName(\"image\").reloadImages(),\n                    canChoosePlacement: ko.pureComputed(() => model.display.instructor()),\n                    canModify: (placement) => model.display.instructor() || placement === \"submission\" || placement === \"user\",\n                },\n                settings: {\n                    save: () => self.components.server.saveAssignment()\n                },\n                sampleSubmissions: {\n                    buildEditor: (newDOM, index, newElement) => {\n                        let editor = self.components.editors.byName(\"Sample Submissions\");\n                        editor.buildEditor(newDOM, index, newElement);\n                    }\n                },\n            },\n            execute: {\n                isRunning: ko.pureComputed(() =>\n                    model.status.onExecution() === StatusState.ACTIVE\n                ),\n                runLabel: ko.pureComputed(() =>\n                    model.status.onExecution() === StatusState.ACTIVE ? \"Stop\" : \"Run\"\n                ),\n                run: () => {\n                    if (model.status.onExecution() === StatusState.ACTIVE) {\n                        if (typeof PygameLib !== \"undefined\" && PygameLib.running) {\n                            PygameLib.StopPygame();\n                        }\n                        model.status.onExecution(StatusState.READY);\n                    } else {\n                        self.components.engine.delayedRun();\n                    }\n                },\n                runQuietlyLabel: ko.pureComputed(()=>\n                    model.status.onExecution() === StatusState.ACTIVE ? \"Stop\" : \"Run without feedback\"\n                ),\n                runQuietly: () => {\n                    if (model.status.onExecution() === StatusState.ACTIVE) {\n                        if (typeof PygameLib !== \"undefined\" && PygameLib.running) {\n                            PygameLib.StopPygame();\n                        }\n                        model.status.onExecution(StatusState.READY);\n                    } else {\n                        self.components.engine.delayedRun(true);\n                    }\n                },\n                evaluate: () =>\n                    self.components.engine.evaluate()\n            },\n            server: {\n                status: (endpoint =>\n                    \"server-status-\" + model.status[endpoint]()\n                ),\n                isEndpointConnected: (endpoint) =>\n                    model.configuration.serverConnected() &&\n                    model.configuration.urls !== undefined &&\n                    model.configuration.urls[endpoint] !== undefined,\n                messages: ko.pureComputed(() =>\n                    capitalize(model.status.loadAssignmentMessage() ||\n                        model.status.saveAssignmentMessage() ||\n                        model.status.loadHistoryMessage() ||\n                        model.status.loadFileMessage() ||\n                        model.status.saveFileMessage() ||\n                        model.status.loadDatasetMessage() ||\n                        model.status.logEventMessage() ||\n                        model.status.saveImage() ||\n                        model.status.updateSubmissionMessage() ||\n                        model.status.externalAPI() ||\n                        model.status.updateSubmissionStatusMessage() || \"\")\n                ),\n                force: {\n                    loadAssignment: (data, event) => {\n                        //let fileHandler = $(\".blockpy-force-load-assignment-file\");\n                        let assignmentForceLoadButton = $(event.target);\n                        //fileHandler.click();\n                        $(event.target).parent().fadeOut(100).fadeIn(100);\n                        // Allow user to upload a file containing an assignment submission\n                        var fr = new FileReader();\n                        var files = assignmentForceLoadButton[0].files;\n                        fr.onload = function(e) {\n                            let assignmentSubmission = JSON.parse(e.target.result);\n                            self.loadAssignmentData_(assignmentSubmission);\n                        };\n                        fr.fileName = files[0].name;\n                        fr.readAsText(files[0]);\n                        assignmentForceLoadButton.val(\"\");\n                    },\n                    updateSubmission: (data, event) => {\n                        console.log(event);\n                        self.components.server.updateSubmission(self.model.submission.score(),\n                                                                self.model.submission.correct(),\n                                                                false, true);\n                        $(event.target).fadeOut(100).fadeIn(100);\n                    }\n                }\n            },\n            footer: {\n                visible: ko.pureComputed(\n                    () =>\n                        model.display.instructor() || !model.ui.smallLayout()\n                ),\n            }\n        };\n        makeExtraInterfaceSubscriptions(self, model);\n    }\n\n    turnOnHacks() {\n        //console.log(\"TODO\");\n        Sk.builtinFiles.files[\"src/lib/image.js\"] = imageModule.toString();\n        //Sk.builtinFiles.files[\"src/lib/weakref.js\"] = weakrefModule.toString();\n        //Sk.builtinFiles.files[\"src/lib/matplotlib/pyplot/__init__.js\"] = matplotlibModule.toString();\n    }\n\n    /**\n     * Applys the KnockoutJS bindings to the model, instantiating the values into the\n     * HTML.\n     */\n    applyModel() {\n        ko.applyBindings(this.model, this.model.configuration.container[0]);\n    }\n\n    initUtilities() {\n        let main = this;\n        this.utilities = {\n            markdown: (text) => text ? EasyMDE.prototype.markdown(text) : \"<p></p>\"\n        };\n    }\n\n    initComponents() {\n        let container = this.model.configuration.container;\n        let components = this.components = {};\n        let main = this;\n        // Each of these components will take the BlockPy instance, and possibly a\n        // reference to the relevant HTML location where it will be embedded.\n        components.dialog = new BlockPyDialog(main, container.find(\".blockpy-dialog\"));\n        components.feedback = new BlockPyFeedback(main, container.find(\".blockpy-feedback\"));\n        components.trace = new BlockPyTrace(main);\n        components.console = new BlockPyConsole(main, container.find(\".blockpy-console\"));\n        components.engine = new BlockPyEngine(main);\n        components.fileSystem = new BlockPyFileSystem(main);\n        components.editors = new Editors(main, container.find(\".blockpy-editor\"));\n        // Convenient shortcut directly to PythonEditor\n        components.pythonEditor = this.components.editors.byName(\"python\");\n        components.server = new BlockPyServer(main);\n        components.corgis = new BlockPyCorgis(main);\n        components.history = new BlockPyHistory(main, container.find(\".blockpy-history-toolbar\"));\n    }\n\n    show() {\n        this.model.configuration.container.show();\n        //this.model.configuration.container.find(\".blockpy-file-instructor\").toggle(this.model.display.instructor());\n    }\n\n    hide() {\n        this.model.configuration.container.hide();\n    }\n\n    makeExtraSubscriptions() {\n        this.model.display.changedInstructions.subscribe((changed) => {\n            this.components.server.logEvent(\"X-Instructions.Change\", \"\", \"\",\n                                            changed, \"instructions.md\");\n        });\n        this.clock = null;\n        const container = this.model.configuration.container;\n        const updateClock = () => container.find(\".blockpy-menu-clock\").text(getCurrentTime());\n        if (this.model.ui.menu.showClock()) {\n            this.clock = setInterval(updateClock, 1000);\n        }\n\n        this.model.ui.menu.showClock.subscribe((changed) => {\n            if (this.model.ui.menu.showClock()) {\n                if (this.clock) {\n                    clearInterval(this.clock);\n                    this.clock = null;\n                }\n            } else {\n                if (!this.clock) {\n                    this.clock = setInterval(updateClock, 1000);\n                }\n            }\n        });\n    }\n\n    start() {\n        this.model.display.filename(\"answer.py\");\n    }\n\n    resetInterface() {\n        this.components.engine.reset();\n        // Disable any alternative logEntry functions we have been given\n        this.components.server.altLogEntry = null;\n    }\n\n    requestPasscode() {\n        let userSuppliedPasscode = prompt(\"Please enter the passcode.\");\n        this.model.display.passcode(userSuppliedPasscode);\n    }\n\n    destroy() {\n\n    }\n\n}\n\n"
  },
  {
    "path": "src/console.js",
    "content": "import {encodeHTML} from \"./utilities\";\n\n/**\n * Evaluate button HTML template\n * @type {string}\n */\nconst START_EVAL_HTML = `\n<button type=\"button\" class=\"btn btn-sm btn-outline float-right blockpy-btn-eval\">\n    Evaluate\n</button>`;\n\n/**\n * HTML template for a new line in the console.\n * @type {string}\n */\nconst NEW_CONSOLE_LINE_HTML = \"<div></div>\";\n\n/**\n * HTML template for the entire console area\n * @type {string}\n */\nexport const CONSOLE_HTML = `\n    <div class='blockpy-panel blockpy-console'\n          role=\"region\" aria-label=\"Console\"\n          data-bind=\"class: ui.console.size\">\n          \n        <!-- Feedback/Trace Visibility Control -->\n        <button type='button'\n                class='btn btn-sm btn-outline-secondary float-right blockpy-show-feedback'\n                data-bind=\"hidden: ui.secondRow.isConsoleShowVisible, click: ui.secondRow.advanceState\">\n            <span class='fas fa-eye'></span>\n        </button>\n          \n        <strong>Console:</strong>\n        \n        <div class='blockpy-printer blockpy-printer-default'>\n        </div>\n        \n     </div>`;\n\n/**\n * All the possible types for a line in the console.\n * @enum\n */\nexport let ConsoleLineType = {\n    TEXT: \"text\",\n    HTML: \"html\",\n    PLOT: \"plot\",\n    IMAGE: \"image\",\n    PYGAME: \"pygame\",\n    DRAFTER: \"drafter\",\n    TURTLE: \"turtle\",\n    EVAL: \"eval\",\n    START_EVAL: \"start_eval\",\n    VALUE: \"value\",\n    INPUT: \"input\",\n    TEST_CASE: \"test_case\"\n};\n\n/**\n * Abstract version of a line in the console. All other console lines\n * should extend this class. Critically, they need to implement a render function.\n */\nclass ConsoleLine {\n    constructor(main, type, content) {\n        /**\n         * Reference back to the main BlockPy instance.\n         * @const\n         * @type {BlockPy}\n         */\n        this.main = main;\n        /**\n         * Categorizes what kind of line this is (text/html/plot/etc.)\n         * @type {ConsoleLineType}\n         */\n        this.type = type;\n        /**\n         * The actual data stored on this line.\n         * @type {string}\n         */\n        this.content = content;\n        /**\n         * Metadata about where the line originated from in the code.\n         * @type {{filename: string, line: number, step: number}}\n         */\n        this.origin = {\n            filename: Sk.currFilename,\n            step: main.components.engine.executionBuffer.step,\n            line: main.components.engine.executionBuffer.line\n        };\n        /**\n         * The HTML content stored on this line, meant to be rendered\n         * to the user.\n         * @type {*|jQuery.fn.init|jQuery|HTMLElement}\n         */\n        this.html = $(\"<div></div>\", {\n            \"class\":  \"blockpy-printer-output\",\n            \"data-container\": main.model.configuration.attachmentPoint,\n            \"data-toggle\": \"tooltip\",\n            \"data-placement\": \"auto\",\n            \"data-step\": this.origin.step,\n            \"title\": \"Step \" + this.origin.step + \", Line \" + this.origin.line\n        });\n        /**\n         * Whether or not this line should be visible\n         * @type {boolean}\n         */\n        this.visible = !main.model.display.mutePrinter();\n        /**\n         *\n         * @type {number}\n         */\n        this.index = 0;\n    }\n\n    /**\n     * Create a Skulpt representation of this console line's content.\n     * @returns {*}\n     */\n    toSkulpt() {\n        return Sk.ffi.remapToPy(this.content);\n    }\n\n    /**\n     * Remove this console line by deleting its HTML representation.\n     */\n    delete() {\n        this.html.remove();\n    }\n}\n\nclass ConsoleLineTurtle extends ConsoleLine {\n    // TODO: Capture turtle commands for tracing purposes\n    constructor(main) {\n        super(main, ConsoleLineType.TURTLE);\n        this.html.addClass(\"blockpy-console-turtle-output\");\n    }\n\n    render(where) {\n        if (this.visible) {\n            where.prepend(this.html);\n            //this.html[0].scrollIntoView({ behavior: \"smooth\" });\n            var top = this.html.offset().top;\n            //$('html').scrollTop(top);\n            $(\"html\").scrollTop(top);\n            //this.html.tooltip();\n        }\n    }\n}\n\nclass ConsoleLineDrafter extends ConsoleLine {\n    constructor(main, size, fullscreen) {\n        super(main, ConsoleLineType.DRAFTER);\n        this.html.addClass(\"blockpy-console-drafter-output\");\n        this.size = size;\n        this.fullscreen = fullscreen;\n    }\n\n    render(where) {\n        if (this.visible) {\n            where.prepend(this.html);\n            var top = this.html.offset().top;\n            $(\"html\").scrollTop(top);\n        }\n    }\n\n    cleanup() {\n        // Starts off as a no-op\n    }\n\n    stop() {\n        this.main.model.ui.secondRow.restorePanel();\n    }\n}\n\nclass ConsoleLinePygame extends ConsoleLine {\n    constructor(main, size, fullscreen, pygameObj) {\n        super(main, ConsoleLineType.PYGAME);\n        this.html.addClass(\"blockpy-console-pygame-output\");\n        this.size = size;\n        this.fullscreen = fullscreen;\n        this.pygameObj = pygameObj;\n        this.initialized = false;\n        this.canvas = document.createElement(\"canvas\");\n        //Sk.main_canvas = document.getElementById(\"myCanvas\");\n    }\n\n    render(where) {\n        if (this.visible) {\n            this.html.append(this.canvas);\n            where.prepend(this.html);\n            var top = this.html.offset().top;\n            $(\"html\").scrollTop(top);\n        }\n    }\n\n    cleanup() {\n        // Starts off as a no-op\n    }\n\n    stop() {\n        this.cleanup = () => {};\n        this.main.model.ui.secondRow.restorePanel();\n    }\n\n    finalize(cleanupFunction, listeners) {\n        this.initialized = true;\n        this.cleanup = () => cleanupFunction(this.pygameObj, listeners);\n    }\n\n}\n\nclass ConsoleLineImage extends ConsoleLine {\n    constructor(main, content) {\n        super(main, ConsoleLineType.IMAGE, content);\n        this.html.addClass(\"blockpy-console-image-output\");\n    }\n\n    render(where) {\n        if (this.visible) {\n            console.log(this.content);\n            this.html.append(this.content);\n            where.append(this.html);\n            //this.html.tooltip();\n        }\n    }\n}\n\nclass ConsoleLinePlot extends ConsoleLine {\n    constructor(main, content) {\n        super(main, ConsoleLineType.PLOT, content);\n        this.html.addClass(\"blockpy-console-plot-output\");\n    }\n\n    render(where) {\n        if (this.visible) {\n            where.append(this.html);\n            //this.html.tooltip();\n        }\n    }\n}\n\nclass ConsoleLineText extends ConsoleLine {\n\n    addContent(content) {\n        this.content = this.content + content;\n    }\n\n    render(where) {\n        if (this.visible) {\n            let encodedText = encodeHTML(this.content);\n            if (!encodedText || encodedText.trim().length <= 0) {\n                encodedText = \"\\n\";\n            }\n            let lineData = $(\"<samp></samp>\", { \"html\": encodedText });\n            this.html.append(lineData);\n            where.append(this.html);\n            this.html.tooltip();\n        }\n    }\n}\n\nclass ConsoleLineValue extends ConsoleLine {\n\n    constructor(main, content) {\n        super(main, ConsoleLineType.VALUE, content);\n    }\n\n    render(where) {\n        if (this.visible) {\n            let encodedText = encodeHTML(this.content);\n            let lineData = $(\"<code></code>\", { \"html\": encodedText });\n            this.html.append(lineData);\n            where.append(this.html);\n            this.html.tooltip();\n        }\n    }\n}\n\nclass ConsoleLineInput extends ConsoleLine {\n    constructor(main, promptMessage) {\n        super(main, ConsoleLineType.INPUT, promptMessage);\n        this.visible = true;\n    }\n\n    /**\n     * Creates an Input box for receiving input() from the user.\n     *\n     */\n    render(where) {\n        // Perform any necessary cleaning\n        if (this.visible) {\n            // Input form\n            let inputForm = $(\"<input type='text' />\");\n            // Enter button\n            let inputBtn = $(\"<button></button>\", {\"html\": \"Enter\"});\n            // Group form and button\n            let inputGroup = $(\"<div></div>\", {\"class\": \"blockpy-console-input\"});\n            inputGroup.append(inputForm);\n            inputGroup.append(inputBtn);\n            // Prompt box, new line, input group\n            let inputBox = $(\"<div></div>\");\n            if (this.content !== \"\\n\") {\n                let encodedText = encodeHTML(this.content);\n                let inputMsg = $(\"<samp></samp>\",  {\"html\": encodedText});\n                inputBox.append(inputMsg);\n            }\n            inputBox.append($(\"<br>\"))\n                .append(inputGroup);\n            // Render\n            this.html.append(inputBox);\n            where.append(this.html);\n            // Make it interactive\n            return this.makeInteractive(inputForm, inputBtn);\n        }\n        return \"\";\n    };\n\n    makeInteractive(input, button) {\n        let resolveOnClick;\n        let submittedPromise = new Promise((resolve) => {\n            resolveOnClick = resolve;\n        });\n        let inputIndex = this.main.model.execution.inputIndex();\n        let submitForm = () => {\n            let userInputtedValue = input.val();\n            Sk.queuedInput.push(userInputtedValue);\n            this.main.model.execution.inputIndex(inputIndex+1);\n            this.main.model.execution.input().push(userInputtedValue);\n            resolveOnClick(userInputtedValue);\n            input.prop(\"disabled\", true);\n            button.prop(\"disabled\", true);\n            this.html.tooltip();\n        };\n        button.click(submitForm);\n        input.keyup((e) => {\n            if (e.keyCode === 13) {\n                submitForm();\n            }\n        });\n        input.focus();\n        console.log(inputIndex, this.main.model.execution.input().length);\n        if (inputIndex < this.main.model.execution.input().length) {\n            let userInputtedValue = this.main.model.execution.input()[inputIndex];\n            input.val(userInputtedValue);\n            this.main.model.execution.inputIndex(inputIndex+1);\n            return new Promise((resolve) => {\n                input.prop(\"disabled\", true);\n                button.prop(\"disabled\", true);\n                this.html.tooltip();\n                resolve(userInputtedValue);\n            });\n        }\n        return submittedPromise;\n    }\n}\n\nclass ConsoleLineEvaluate extends ConsoleLineInput {\n    constructor(main) {\n        super(main, \"Evaluate:\");\n    }\n}\n\nclass ConsoleLineStartEvaluate extends ConsoleLine {\n    constructor(main) {\n        super(main, ConsoleLineType.START_EVAL);\n        this.html.append($(START_EVAL_HTML));\n        this.html.click(() => {\n            this.main.model.ui.execute.evaluate();\n            this.delete();\n        });\n    }\n\n    render(where) {\n        where.append(this.html);\n    }\n}\n\nexport class BlockPyConsole {\n\n    /**\n     * An object for managing the console, with features for things like printing, plotting, evaling, inputing.\n     * The \"printer\" is the region where we put things, as opposed to the console as a whole.\n     *\n     * @constructor\n     * @param {Object} main - The main BlockPy instance\n     * @param {HTMLElement} tag - The HTML object this is attached to.\n     */\n    constructor (main, tag) {\n        this.main = main;\n        this.tag = tag;\n        this.printerTag = tag.find(\".blockpy-printer\");\n\n        this.MINIMUM_WIDTH = 200;\n        this.MINIMUM_HEIGHT = 200;\n        this.DEFAULT_HEIGHT = this.printerTag.height(); // Let CSS define this\n        this.main.model.display.previousConsoleHeight(this.DEFAULT_HEIGHT);\n\n        this.output = this.main.model.execution.output;\n        //this.input = this.main.model.execution.input;\n        this.settings = {};\n        this.clear();\n\n        // TODO: If the user modifies a file, then make the console look faded a little\n    };\n\n    /**\n     * Reset the status of the printer, including removing any text in it and\n     * fixing its size.\n     */\n    clear() {\n        this.output.removeAll();\n\n        this.lineBuffer = null;\n        this.plotBuffer = null;\n        this.printerTag.empty();\n        // If the user hasn't changed the console size, we'll reset it\n        if (this.main.model.display.previousConsoleHeight() === this.printerTag.height()) {\n            this.printerTag.height(this.DEFAULT_HEIGHT);\n            this.main.model.display.previousConsoleHeight(this.printerTag.height());\n        }\n\n        this.turtleLine = null;\n        Sk.TurtleGraphics = {\n            target: this.getTurtleLine.bind(this),\n            width: this.getWidth(),\n            height: this.getHeight(),\n            assets: this.loadAsset.bind(this)\n        };\n\n        this.pygameLine = null;\n        this.drafterLine = null;\n    };\n\n    loadAsset(name) {\n        return name;\n    }\n\n    getTurtleLine() {\n        if (this.turtleLine === null) {\n            this.turtleLine = new ConsoleLineTurtle(this.main);\n            this.turtleLine.render(this.printerTag);\n            // If the user hasn't changed the console size, we'll do so\n            if (this.main.model.display.previousConsoleHeight() === this.printerTag.height()) {\n                let currentPrinterDimension = this.printerTag.width();\n                this.printerTag.height(currentPrinterDimension);\n                this.main.model.display.previousConsoleHeight(this.printerTag.height());\n                Sk.TurtleGraphics.height = currentPrinterDimension-40;\n            }\n        }\n        return this.turtleLine.html[0];\n    }\n\n    handlePygameResize(newWidth, newHeight) {\n        // If the user hasn't changed the console size, and the newHeight is bigger than default, we'll change it\n        if (this.main.model.display.previousConsoleHeight() === this.printerTag.height() &&\n            newHeight > this.DEFAULT_HEIGHT) {\n            this.printerTag.height(30+newHeight);\n            this.main.model.display.previousConsoleHeight(this.printerTag.height());\n        }\n        // If the pygame window is wider than the console, we'll expand temporarily.\n        if (newWidth > this.printerTag.width()) {\n            this.main.model.ui.secondRow.makeWide();\n        }\n    }\n\n    finishTurtles() {\n        if (this.main.model.assignment.settings.saveTurtleOutput()) {\n            if (this.turtleLine) {\n                let canvas = this.turtleLine.html.find(\"canvas\").last()[0];\n                let dataUrl = canvas.toDataURL(\"image/png\");\n                this.main.components.server.saveImage(\"turtle_output\", dataUrl);\n            } else if (this.pygameLine) {\n                let canvas = this.pygameLine.canvas;\n                let dataUrl = canvas.toDataURL(\"image/png\");\n                this.main.components.server.saveImage(\"turtle_output\", dataUrl);\n            } else {\n                // TODO: What if there are no turtles to save?\n            }\n        }\n    }\n\n    // TODO: turtles should be based on the current width\n    newTurtle() {\n        return this;\n    }\n\n    getWidth() {\n        return Math.max(this.MINIMUM_WIDTH, this.printerTag.width()-40);\n    }\n\n    getHeight() {\n        return Math.max(this.MINIMUM_HEIGHT, this.printerTag.height()+40);\n    }\n\n    isMuted() {\n        return this.main.model.display.mutePrinter();\n    }\n\n    /**\n     * Updates each printed element in the printer and makes it hidden\n     * or visible, depending on what step we're on.\n     *\n     * @param {Number} step - The current step of the executed program that we're on; each element in the printer must be marked with a \"data-step\" property to resolve this.\n     * @param {Number} page - Deprecated, not sure what this even does.\n     */\n    stepPrinter(step, page) {\n        this.printerTag.find(\".blockpy-printer-output\").each(function() {\n            if ($(this).attr(\"data-step\") <= step) {\n                $(this).show();\n            } else {\n                $(this).hide();\n            }\n        });\n    };\n\n    /**\n     * Print a line to the on-screen printer.\n     * @param {String} lineText - A line of text to be printed out.\n     */\n    print(lineText) {\n        // Empty strings means do nothing.\n        // print(\"\", end=\"\")\n        if (!lineText) {\n            return;\n        }\n        let flush = false;\n        if (lineText.charAt(lineText.length-1) === \"\\n\") {\n            flush = true;\n        }\n        let splitLines = lineText.split(\"\\n\");\n        if (this.lineBuffer === null) {\n            this.lineBuffer = new ConsoleLineText(this.main, ConsoleLineType.TEXT, splitLines[0]);\n        } else {\n            this.lineBuffer.addContent(splitLines[0]);\n        }\n        for (let i=1; i < splitLines.length-1; i++) {\n            this.output.push(this.lineBuffer);\n            this.lineBuffer.render(this.printerTag);\n            this.lineBuffer = new ConsoleLineText(this.main, ConsoleLineType.TEXT, splitLines[i]);\n        }\n        if (flush) {\n            this.output.push(this.lineBuffer);\n            this.lineBuffer.render(this.printerTag);\n            this.lineBuffer = null;\n        }\n    };\n\n\n    plot(plots) {\n        this.plotBuffer = new ConsoleLinePlot(this.main, plots);\n        this.plotBuffer.render(this.printerTag);\n        return this.plotBuffer;\n    }\n\n    pygame(size, fullscreen, pygameObj) {\n        if (this.pygameLine === null) {\n            this.pygameLine = new ConsoleLinePygame(this.main, size, fullscreen, pygameObj);\n            this.pygameLine.render(this.printerTag);\n        }\n        return this.pygameLine;\n    }\n\n    drafter(size, fullscreen) {\n        if (this.drafterLine === null) {\n            this.drafterLine = new ConsoleLineDrafter(this.main, size, fullscreen);\n            this.drafterLine.render(this.printerTag);\n        }\n        return this.drafterLine;\n    }\n\n    printPILImage(imageData) {\n        console.log(\"TEST\", imageData.image);\n        this.imageBuffer = new ConsoleLineImage(this.main, imageData.image);\n        this.imageBuffer.render(this.printerTag);\n        return this.imageBuffer;\n    }\n\n    printValue(value) {\n        let printedValue = new ConsoleLineValue(this.main, value);\n        printedValue.render(this.printerTag);\n        return printedValue;\n    }\n\n    /**\n     * Creates and registers a Promise from the Input box\n     * @param {String} promptMessage - Message to display to the user.\n     *\n     */\n    input(promptMessage) {\n        this.inputBuffer = new ConsoleLineInput(this.main, promptMessage);\n        return this.inputBuffer.render(this.printerTag);\n    };\n\n\n    evaluate() {\n        this.inputBuffer = new ConsoleLineEvaluate(this.main);\n        return this.inputBuffer.render(this.printerTag);\n    }\n\n    beginEval() {\n        let startEvaluation = new ConsoleLineStartEvaluate(this.main);\n        return startEvaluation.render(this.printerTag);\n    }\n\n    /**\n     * Unconditionally scroll to the bottom of the window.\n     *\n     */\n    scrollToBottom() {\n        this.tag.animate({\n            scrollTop: this.tag.prop(\"scrollHeight\") - this.tag.prop(\"clientHeight\")\n        }, 500);\n    };\n\n}"
  },
  {
    "path": "src/corgis.js",
    "content": "import {slug} from \"./utilities\";\n\n// TODO: editor.bm.blockEditor.extraTools[]\n\nexport let _IMPORTED_DATASETS = {};\nexport let _IMPORTED_COMPLETE_DATASETS = {};\n\n/**\n * This is a very simplistic helper function that will transform\n * a given button into a \"Loaded\" state (disabled, pressed state, etc.).\n *\n * @param {HTMLElement} btn - An HTML element to change the text of.\n */\nlet setButtonLoaded = function (btn) {\n    btn.addClass(\"active\")\n        .addClass(\"btn-success\")\n        .removeClass(\"btn-primary\")\n        .prop(\"disabled\", true)\n        .text(\"Loaded\")\n        .attr(\"aria-pressed\", \"true\");\n};\n\n\n/**\n * Module that connects to the CORGIS datasets and manages interactions\n * with them. This includes loading in datasets at launch and on-the-fly.\n * Note that this has no presence on screen, so it does not have a tag.\n *\n * @constructor\n * @this {BlockPyCorgis}\n * @param {Object} main - The main BlockPy instance\n */\nexport function BlockPyCorgis(main) {\n    this.main = main;\n\n    this.loadedDatasets = [];\n    this.loadDatasets();\n}\n\nBlockPyCorgis.prototype.loadDatasets = function (silently) {\n    // Load in each the datasets\n    let model = this.main.model,\n        editor = this.main.components.pythonEditor,\n        server = this.main.components.server;\n    let imports = [];\n    model.assignment.settings.datasets().split(\",\").forEach((name) => {\n        if (name && !(name in BlockMirrorBlockEditor.EXTRA_TOOLS)) {\n            imports.push.apply(imports, this.importDataset(slug(name), name, silently));\n        }\n    });\n\n    // When datasets are loaded, update the toolbox.\n    $.when.apply($, imports).done(function () {\n        //console.log(\"TRIGGERED\");\n        editor.bm.forceBlockRefresh();\n        editor.bm.blockEditor.remakeToolbox();\n    }).fail(function (e) {\n        console.log(arguments);\n        console.error(e);\n    }).always(function () {\n        server.finalizeSubscriptions();\n    });\n};\n\n/**\n * Loads the definitions for a dataset into the environment, including\n * the dataset (as a JS file), the skulpt bindings, and the blockly\n * bindings. This requires access to a CORGIS server, and occurs\n * asynchronously. The requests are fired and their deferred objects\n * are returned - callers can use this information to perform an action\n * on completion of the import.\n *\n * @param {String} slug - The URL safe version of the dataset name\n * @param {String} name - The user-friendly version of the dataset name.\n * @returns {Array.<Deferred>} - Returns the async requests as deferred objects.\n */\nBlockPyCorgis.prototype.importDataset = function (slug, name) {\n    let url_retrievals = [];\n    if (this.main.model.ui.server.isEndpointConnected(\"importDatasets\")) {\n        let root = this.main.model.configuration.urls.importDatasets + \"blockpy/\" + slug + \"/\" + slug;\n        this.main.model.display.loadingDatasets.push(name);\n        // Actually get data\n        let getDataset = $.getScript(root + \"_dataset.js\");\n        // Load getComplete silently in the background because its big :(\n        let getComplete = $.getScript(root + \"_complete.js\");\n        let getSkulpt = $.get(root + \"_skulpt.js\", function (data) {\n            Sk.builtinFiles[\"files\"][\"src/lib/\" + slug + \"/__init__.js\"] = data;\n        });\n        let getBlockly = $.getScript(root + \"_blockly.js\");\n        // On completion, update menus.\n        $.when(getDataset, getSkulpt, getBlockly).done(() => {\n            this.loadedDatasets.push(slug);\n            this.main.components.pythonEditor.bm.textToBlocks.hiddenImports.push(slug);\n            this.main.components.pythonEditor.bm.forceBlockRefresh();\n            this.main.components.pythonEditor.bm.blockEditor.remakeToolbox();\n            this.main.model.display.loadingDatasets.remove(name);\n        });\n        url_retrievals.push(getDataset, getSkulpt, getBlockly);\n    }\n    return url_retrievals;\n};\n\n/**\n * Opens a dialog box to present the user with the datasets available\n * through the CORGIS server. This requires a call, so this method\n * completes asynchronously. The dialog is composed of a table with\n * buttons to load the datasets (More than one dataset can be loaded\n * from within the dialog at a time).\n */\nBlockPyCorgis.prototype.openDialog = function () {\n    if (this.main.model.ui.server.isEndpointConnected(\"importDatasets\")) {\n        let root = this.main.model.configuration.urls.importDatasets;\n        $.getJSON(root + \"index.json\",  (data) => {\n            // Make up the Body\n            let datasets = data.blockpy;\n            let documentation = root+\"blockpy/index.html\";\n            let start = $(`<p>Documentation is available at <a href='${documentation}' target=_blank>url</a></p>`);\n            let body = $(\"<table></table>\", {\"class\": \"table table-bordered table-sm table-striped\"});\n            Object.keys(datasets).sort().map((name) => {\n                let sluggedName = slug(datasets[name].name);\n                let titleName = name;\n                let btn = $('<button type=\"button\" class=\"btn btn-primary\" data-toggle=\"button\" aria-pressed=\"false\" autocomplete=\"off\">Load</button>');\n                let imgSrc = root+\"../images/datasets/\"+name+\"-icon.png\";\n                if (this.loadedDatasets.indexOf(sluggedName) > -1) {\n                    setButtonLoaded(btn);\n                } else {\n                    btn.click( () => {\n                        this.importDataset(sluggedName, \"Data - \" + datasets[name].title);\n                        setButtonLoaded(btn);\n                    });\n                }\n                //let img = `<img src='${imgSrc}' class=\"corgis-icon\">`;\n                $(\"<tr></tr>\")\n                    //.append($(\"<td>\" + img + \"</td>\"))\n                    .append($(\"<td>\" + datasets[name].title + \"</td>\"))\n                    .append($(\"<td>\" + datasets[name].overview + \"</td>\"))\n                    .append($(\"<td></td>\").append(btn))\n                    .appendTo(body);\n            });\n            body.appendTo(start);\n            // Show the actual dialog\n            this.main.components.dialog.show(\"Import Datasets\", start, null);\n        });\n    }\n};\n\n"
  },
  {
    "path": "src/css/blockpy.css",
    "content": "/** Entire Page **/\n.blockpy-content .row {\n    border-bottom: 1px solid #faebcc;\n}\n\n.blockpy-content .blockpy-panel {\n    padding-left: 10px;\n    padding-right: 10px;\n    padding-bottom: 5px;\n}\n\n.blockpy-bottom {\n    height: 25%;\n}\n\n.blockpy-header {\n    height: 25%;\n}\n\n.blockpy-overlay {\n    position: fixed;\n    top: 0;\n    left: 0;\n    width: 100%;\n    height: 100%;\n    background-color: #000;\n    filter: alpha(opacity=50);\n    -moz-opacity: 0.5;\n    -khtml-opacity: 0.5;\n    opacity: 0.5;\n    z-index: 10000;\n}\n\n.green-check-mark {\n    font-weight: bold;\n    color: green;\n    text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;\n}\n\n.blockpy-content .fas {\n    font-size: 12px;\n}\n\n/** Pop-up **/\n\n.blockpy-dialog .modal-body {\n    overflow-y: auto;\n}\n\n.blockpy-dialog .modal-body table {\n    width: 100%;\n}\n\n.blockpy-dialog .row {\n    border-bottom: 0;\n}\n\n.corgis-icon {\n    max-width: 32px;\n}\n\n/** First Row **/\n\n.blockpy-content .blockpy-instructions * {\n    /* font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif; */\n}\n\n.blockpy-content .blockpy-instructions pre, .blockpy-content .blockpy-instructions code {\n    font-family: monospace;\n}\n\n.blockpy-content .blockpy-instructions blockquote {\n    font-style: italic;\n}\n\n.blockpy-content .blockpy-instructions p, .blockpy-content .blockpy-instructions pre {\n    margin-bottom: 4px;\n}\n\n.blockpy-instructions-reset a {\n    font-size: smaller;\n}\n\n.blockpy-content .blockpy-instructions {\n}\n\n.blockpy-content .blockpy-quick-menu {\n    padding-left: 10px;\n    border-left: 1px solid #faebcc;\n}\n\n/** Second Row **/\n\n.blockpy-content .blockpy-console {\n    padding-top: 10px;\n}\n\n.blockpy-content .blockpy-show-feedback {\n    margin-top: 10px;\n    margin-left: 10px;\n}\n\n.blockpy-printer {\n    height: 200px;\n    overflow: auto;\n    resize: vertical;\n    padding-bottom: 64px;\n}\n\n.blockpy-printer-default {\n    background-color: white;\n    border: 1px solid lightgray;\n}\n\n.blockpy-printer-inverse {\n    background-color: black;\n    border: 1px solid darkgray;\n    color: white;\n}\n\n.blockpy-printer .blockpy-printer-output {\n    display: block;\n    padding-left: 10px;\n    border-bottom: 1px dashed lightgray;\n}\n\n.blockpy-printer .blockpy-printer-output samp {\n    white-space: pre;\n}\n\n.blockpy-console-plot-output {\n    cursor: pointer;\n}\n\n.blockpy-console-image-output img {\n    max-height: 100px;\n}\n\n.blockpy-console-input input {\n    width: 75%;\n}\n\n.blockpy-btn-eval {\n    position: absolute;\n    bottom: 2px;\n    left: 20px;\n}\n\n/** Feedback **/\n\n.blockpy-content .feedback-badge {\n    font-size: 75%;\n    color: white;\n}\n\n.blockpy-content .label-internal-error {\n    background-color: black;\n}\n\n.blockpy-content .label-syntax-error {\n    background-color: darkred;\n}\n\n.blockpy-content .label-runtime-error {\n    background-color: #d9534f;\n}\n\n.blockpy-content .label-semantic-error {\n    background-color: orangered;\n}\n\n.blockpy-content .label-feedback-error {\n    background-color: #f0ad4e;\n}\n\n.blockpy-content .label-problem-complete {\n    background-color: #5cb85c;\n}\n\n.blockpy-content .label-none {\n    background-color: rgba(0, 0, 0, 0);\n}\n\n.blockpy-content .label-no-errors {\n    background-color: #5bc0de;\n}\n\n.blockpy-content .label-instructions {\n    background-color: #5bc0de;\n}\n\n.blockpy-content .label-success {\n    background-color: #358535;\n}\n\n.blockpy-feedback {\n    padding: 10px;\n    overflow-y: auto;\n    display: flex;\n    flex-direction: column;\n    /*max-height: 230px;*/\n}\n\n.blockpy-feedback-traces table {\n    background: white;\n    width: 100%;\n}\n\n.blockpy-feedback-thank-you {\n    position: absolute;\n    bottom: 0;\n    right: 0;\n    opacity: 0;\n    transition: all 0.5s ease-out;\n}\n\n.blockpy-feedback-thank-you.show {\n    opacity: 1;\n    transform: translateY(-16px);\n}\n\ntable.pedal-table {\n    background: white;\n    width: 100%;\n    padding-top: 4px;\n}\n\ntable.pedal-table tr.pedal-row {\n    border-top: 1px solid lightgray;\n}\n\ntable.pedal-table pre.pedal-python-code {\n    display: inline-block;\n}\n\n.blockpy-feedback pre {\n    background: #f0f0f0;\n    border: 1px solid lightgrey;\n    font-size: 12px;\n    padding: 3px 5px;\n    border-radius: 4px;\n    overflow-x: auto;\n}\n\n.blockpy-feedback pre strong {\n    font-size: 12px;\n}\n\n.blockpy-feedback pre span.filename {\n    color: green;\n    font-weight: bold;\n    font-size: 12px;\n}\n\n.blockpy-feedback pre span.lineno {\n    color: orangered;\n    font-weight: bold;\n    font-size: 12px;\n}\n\n.blockpy-feedback-unit code {\n    color: black;\n    background-color: transparent;\n}\n\n.blockpy-feedback-original {\n    white-space: pre-wrap;\n}\n\n.blockpy-content .blockpy-floating-feedback {\n    z-index: 100;\n    margin-top: 10px;\n    display: none;\n    color: red;\n}\n\n/** Trace **/\n.blockpy-content .blockpy-trace {\n    padding-top: 10px;\n}\n\n.blockpy-content .blockpy-hide-trace {\n    margin-top: 10px;\n    margin-left: 10px;\n}\n\n.blockpy-content .blockpy-trace-controls button {\n    margin-top: 0px;\n    margin-bottom: 0px;\n}\n\n/** Third Row **/\n\n.blockpy-content .blockpy-files {\n}\n\n.blockpy-content .nav-tabs {\n    border-bottom: none;\n}\n\n.blockpy-content .nav-link {\n    padding: .2rem .5rem;\n    background-color: #cccccc;\n    color: black;\n    border: none;\n    border-left: 2px solid #ddd;\n    border-right: 2px solid #ddd;\n    border-radius: 0;\n}\n\n.blockpy-content .nav-link.active {\n    background-color: white;\n    color: black;\n    border: 1px solid #ddd;\n    border-right: 2px solid #ddd;\n    border-left: 2px solid #ddd;\n    /* padding: .2rem .3rem .1rem; */\n    padding-bottom: .1rem;\n    font-weight: bold;\n}\n\n.blockpy-content .nav-link:hover {\n    background-color: #ddd;\n}\n\n.blockpy-content .nav-link.active:hover {\n    background-color: white;\n}\n\n.blockpy-content a.nav-link {\n    text-decoration: none;\n}\n\n.blockpy-content .nav-link.uneditable {\n    color: darkblue;\n    font-style: italic;\n}\n\n.blockpy-content .nav-item strong {\n    vertical-align: middle;\n    padding-right: 5px;\n}\n\n.blockpy-content .nav-tabs .nav-item:first-child {\n    padding-top: 7px;\n}\n\n.blockpy-content .nav-tabs .nav-item {\n    padding-top: 5px;\n}\n\n.btn-file {\n    position: relative;\n    overflow: hidden;\n    cursor: pointer;\n}\n\n.btn-file input[type=file] {\n    position: absolute;\n    top: 0;\n    right: 0;\n    min-width: 100%;\n    min-height: 100%;\n    font-size: 100px;\n    text-align: right;\n    filter: alpha(opacity=0);\n    opacity: 0;\n    outline: none;\n    background: white;\n    cursor: pointer;\n    display: block;\n}\n\n/** View Rows **/\n\n.blockpy-content .blockpy-python-toolbar {\n    /*background-color: #fcf8e3;\n    padding-bottom: 10px;\n    border: 1px solid #faebcc*/\n    padding-left: 0px;\n}\n\nbutton.blockpy-run {\n    background-color: rgb(40, 130, 40);\n    color: white;\n}\n\nbutton.blockpy-run:focus {\n    background-color: rgb(20, 100, 20);\n}\n\n.blockpy-content button.blockpy-run.blockpy-run-running {\n    background-color: #f0ad4e;\n}\n\n.blockpy-content button.blockpy-run.blockpy-run-error {\n    background-color: #d9534f;\n}\n\nbutton.blockpy-delete {\n    background-color: white;\n    border-color: rgb(130, 40, 40);\n    color: black;\n}\n\nbutton.blockpy-delete:focus {\n    border-color: rgb(100, 20, 20);\n}\n\nbutton.blockpy-delete:active {\n    background-color: rgb(100, 20, 20);\n    color: white;\n}\n\n.blockpy-text {\n    border: 1px solid lightgray;\n}\n\n.blockpy-upload {\n    border: 1px solid lightgray;\n}\n\n.editor-active-line {\n    background: #C4FBC4 !important;\n    color: #8a1f11 !important;\n}\n\n.CodeMirror-gutters {\n    background-color: #ddd;\n    border-left: 1px solid #bbb;\n}\n\n.editor-error-line {\n    background: #FBC4C4 !important;\n}\n\n.editor-uncovered-line {\n    background: #FBFBC4 !important;\n}\n\n.editor-traced-line {\n    background: #C4FBC4 !important;\n}\n\ndiv.blockpy-text.blockpy-editor-menu.col-md-6 {\n    padding-left: 0px;\n    padding-right: 0px;\n}\n\ndiv.blockpy-blocks.blockpy-editor-menu.col-md-6 {\n    padding-left: 0px;\n}\n\n.CodeMirror-code div pre {\n    border-bottom: 1px dashed rgba(1, 1, 1, .1);\n}\n\n.blockpy-read-only .CodeMirror-scroll {\n    background-color: #E5E5E5;\n}\n\n/** Markdown Editor **/\n.blockpy-content .editor-preview {\n    background: #fcf8e3;\n    padding: 0px;\n    border: 1px solid #faebcd;\n}\n\n.blockpy-content .editor-toolbar {\n    background: #eee;\n    border: 1px solid lightgrey\n}\n\n.blockpy-content .cm-s-easymde {\n    border-bottom: 1px solid lightgrey;\n    border-left: 1px solid lightgrey;\n    border-right: 1px solid lightgrey;\n}\n\n.blockpy-content .cm-s-easymde .CodeMirror-scroll {\n    width: 100%;\n}\n\n/** Assignment Settings **/\n.blockpy-view-settings .row {\n    border-bottom: 0;\n}\n\n/** Footer Row **/\n\n.blockpy-content .blockpy-status span,.blockpy-content .blockpy-status label {\n    font-size: 12px;\n}\n\n.blockpy-content .badge {\n    font-size: 75%;\n    color: white;\n}\n\n.blockpy-content .badge.server-status-ready {\n    background-color: #5cb85c;\n}\n\n.blockpy-content .badge.server-status-active {\n    background-color: #5bc0de;\n}\n\n.blockpy-content .badge.server-status-retrying {\n    background-color: #f0ad4e;\n}\n\n.blockpy-content .badge.server-status-failed {\n    background-color: #d9534f;\n}\n\n.blockpy-content .badge.server-status-offline {\n    background-color: #333;\n}\n\n.blockpy-content .blockpy-hidden-file {\n    display: none;\n}\n\n.notransition {\n  -webkit-transition: none !important;\n  -moz-transition: none !important;\n  -o-transition: none !important;\n  transition: none !important;\n}\n\n.blockpy-content .blockpy-feedback-message p {\n    margin-bottom: 0;\n}\n\n.blockpy-content .blockpy-feedback-message p+p {\n    margin-top: .5rem;\n}\n\n.blockpy-content .blockpy-feedback-message pre {\n    margin: 0;\n}\n\n.blockpy-content .blockpy-feedback-message pre+p {\n    margin-top: .5rem;\n}\n\n.blockpy-content .blockpy-feedback-message code {\n    padding: 0;\n}\n\n.blockpy-content .blockpy-feedback-positive {\n    right: 10px;\n    /*position: absolute;*/\n    bottom: 0;\n}\n\n.blockpy-content .blockpy-feedback-positive .blockpy-feedback-positive-icon {\n    font-size: 16px;\n    cursor: pointer;\n}\n\n.blockpy-content .blockpy-dialog-student-error-message {\n    padding: 10px;\n    border: 1px solid lightgray;\n}\n\n.blockpy-quick-menu .blockpy-student-error {\n    font-size: 16px;\n    cursor: pointer;\n    color: pink;\n    display: none;\n}\n\n.blockpy-content sup {\n    font-size: 12px;\n}\n\n.pedal-positive-mark {\n    color: green;\n    font-size: 16px;\n    font-family: -apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";\n}\n\n.blockpy-console-pygame-output {\n    z-index: 9;\n    cursor: pointer;\n    /*position: absolute;*/\n}\n\n.pygame-title-bar {\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n    /*line-height: 24px;*/\n    /*height: 24px;*/\n    border: 1px solid darkgray;\n    border-bottom: none;\n    position: relative;\n    padding-left: 2px;\n    background-color: #F0F0F0;\n    border-top-left-radius: 1px;\n    border-top-right-radius: 1px;\n}\n\n.pygame-title-exit {\n    width: 20px;\n    height: 20px;\n    line-height: 0;\n    padding: 0;\n    margin-right: 4px;\n    vertical-align: middle;\n    text-align: center;\n    border: 1px solid rgb(200, 33, 49);\n    background-color: rgb(220, 53, 69);\n    color: white;\n    border-radius: 2px;\n    cursor: pointer;\n}\n\n.pygame-title-exit:hover {\n    background-color: rgb(240, 73, 89);\n}\n\n.pygame-title-exit:active {\n    background-color: rgb(255, 150, 150);\n}\n\n.feedback-shrunk {\n    max-height: 4em;\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n}\n\n.feedback-expand-on-click {\n    cursor: pointer;\n    border: 1px solid lightgray;\n}\n\n.feedback-shrunk.feedback-expand-on-click::before {\n    content: \"+\";\n    float: right;\n}\n\n.feedback-expand-on-click:not(.feedback-shrunk)::before {\n    content: \"-\";\n    float: right;\n}\n\n.blockpy-copy-share-link-area {\n    overflow-x: auto;\n    user-select: all;\n}"
  },
  {
    "path": "src/css/bootstrap_retheme.css",
    "content": "/**\n * Override bad accessibility in Bootstrap\n */\n\nbody {\n    font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n}\n\n.blockpy-content * {\n    font-size: 14px;\n}\n\n.blockpy-content .btn-sm, .blockpy-content .btn-sm span {\n    font-size: 12px;\n}\n\n.blockpy-content a {\n    text-decoration: underline;\n}\n\n.blockpy-content {\n    background-color: #fcf8e3;\n    border: 1px solid #faebcc;\n    padding-left: 0px;\n    padding-right: 0px;\n}\n\n.blockpy-content .btn {\n    margin-bottom: 5px;\n    margin-top: 5px;\n}\n\n.blockpy-content .btn-outline-secondary {\n    background-color: white;\n    color: #333;\n}\n\n.blockpy-content .btn-outline-secondary:focus {\n    color: #333;\n    border-color: #8c8c8c;\n    background-color: #e6e6e6;\n}\n\n.blockpy-content .btn-outline-secondary:hover {\n    color: #333;\n    border-color: #adadad;\n    background-color: #e6e6e6;\n}\n\n.blockpy-content .text-muted-less {\n    color: #444;\n}\n\n.blockpy-content .label-default {\n    background-color: #666;\n}\n\n.row {\n    margin-left: 0px;\n    margin-right: 0px;\n}\n\n.blockpy-content .alert {\n    color: black;\n}\n\n.blockpy-content table {\n    background-color: white;\n}\n\n.blockpy-content p, .blockpy-content pre {\n    /*margin-bottom: 4px;*/\n}"
  },
  {
    "path": "src/dialog.js",
    "content": "// TODO: Dyanmically populate aria-labelledby in this and other places\n\nexport let DIALOG_HTML = `\n    <div class='blockpy-dialog modal hidden'\n         role=\"dialog\"\n         aria-label='Dialog'\n         aria-hidden=\"true\"\n         aria-modal=\"true\">\n        <div class='modal-dialog modal-lg' role=\"document\">\n            <div class='modal-content' role='region' aria-label='Dialog content'>\n                <div class='modal-header'>\n                    <h4 class='modal-title'>Dynamic Content</h4>\n                    <button type='button' class='close' data-dismiss='modal' aria-hidden='true'>\n                        <span aria-hidden=\"true\">&times;</span>\n                    </button>\n                </div>\n                <div class='modal-body' style='max-width:100%; max-height:400px'>\n                </div>\n                <div class='modal-footer'>\n                    <button type='button' class='btn btn-white modal-close' data-dismiss='modal'>Close</button>\n                    <button type='button' class='btn btn-success modal-okay' data-dismiss='modal'>Okay</button>\n                </div>    \n            </div>\n        </div>\n    </div>\n`;\n\n/**\n * A utility object for quickly and conveniently generating dialog boxes.\n * Unfortunately, this doesn't dynamically create new boxes; it reuses the same one\n * over and over again. It turns out dynamically generating new dialog boxes\n * is a pain! So we can't stack them.\n *\n * @constructor\n * @this {BlockPyDialog}\n * @param {Object} main - The main BlockPy instance\n * @param {HTMLElement} tag - The HTML object this is attached to.\n */\nexport function BlockPyDialog(main, tag) {\n    this.main = main;\n    this.tag = tag;\n\n    this.titleTag = tag.find(\".modal-title\");\n    this.bodyTag = tag.find(\".modal-body\");\n    this.footerTag = tag.find(\".modal-footer\");\n    this.okayButton = tag.find(\".modal-okay\");\n    this.closeButton = tag.find(\".modal-close\");\n\n    this.yes = () => {};\n    this.no = () => {};\n    this.okayButton.click(() => {\n        this.yes();\n        this.tag.modal(\"hide\");\n    });\n    this.closeButton.click(() => {\n        this.no();\n        //this.tag.modal(\"hide\");\n    });\n}\n\nBlockPyDialog.prototype.close = function () {\n    this.tag.modal(\"hide\");\n};\n\n/**\n * A simple externally available function for popping up a dialog\n * message. This menu will be draggable by its title.\n *\n * @param {String} title - The title of the message dialog. Can have HTML.\n * @param {String} body - The body of the message dialog. Can have HTML.\n * @param {function} onclose - A function to be run when the user closes the dialog.\n */\nBlockPyDialog.prototype.show = function (title, body, onclose) {\n    this.titleTag.html(title);\n    this.bodyTag.html(body);\n    this.tag.modal(\"show\");\n    this.okayButton.hide();\n    this.tag.draggable({\n        \"handle\": \".modal-title\"\n    });\n\n    this.tag.on(\"hidden.bs.modal\", function (e) {\n        if (onclose !== undefined && onclose !== null) {\n            onclose();\n        }\n    });\n};\n\nBlockPyDialog.prototype.confirm = function (title, body, yes, no, yesText) {\n    if (yesText === undefined) {\n        yesText = \"Okay\";\n    }\n    this.show(title, body, no);\n    this.yes = yes;\n    this.no = no;\n    this.okayButton.show().html(yesText);\n    // TODO: add okay button and cancel button\n};\n\nBlockPyDialog.prototype.ASSIGNMENT_VERSION_CHANGED = function () {\n    this.confirm(\"Assignment Changed\", \"Your instructor has made changes to this assignment. Would you like to reload? All your work has been saved.\",);\n};\n\nBlockPyDialog.prototype.ERROR_LOADING_ASSIGNMNENT = function (reason) {\n    this.show(\"Error Loading Assignment\", `BlockPy encountered an error while loading the assignment.<br>\nPlease reload the page and try again.<br>Response from server was:<br><pre>${reason}</pre>`,);\n};\n\nBlockPyDialog.prototype.ERROR_LISTING_UPLOADED_FILES = function (reason) {\n    this.show(\"Error Listing Uploaded Files\", `BlockPy encountered an error while listing the uploaded files.<br>\nPlease reload the page and try again.<br>Response from server was:<br><pre>${reason}</pre>`,);\n};\n\nBlockPyDialog.prototype.ERROR_UPLOADING_FILE = function (reason) {\n    this.show(\"Error Uploaded File\", `BlockPy encountered an error while uploading the file.<br>\nPlease try again.<br>Response from server was:<br><pre>${reason}</pre>`,);\n};\n\nBlockPyDialog.prototype.ERROR_DOWNLOADING_FILE = function (reason) {\n    this.show(\"Error Downloading File\", `BlockPy encountered an error while downloading a file.<br>\nPlease try again.<br>Response from server was:<br><pre>${reason}</pre>`,);\n};\n\nBlockPyDialog.prototype.ERROR_RENAMING_FILE = function (reason) {\n    this.show(\"Error Renaming File\", `BlockPy encountered an error while renaming a file.<br>\nPlease try again.<br>Response from server was:<br><pre>${reason}</pre>`,);\n};\n\nBlockPyDialog.prototype.ERROR_DELETING_FILE = function (reason) {\n    this.show(\"Error Deleting File\", `BlockPy encountered an error while deleting a file.<br>\nPlease try again.<br>Response from server was:<br><pre>${reason}</pre>`,);\n};\n\nBlockPyDialog.prototype.ERROR_SAVING_ASSIGNMNENT = function (reason) {\n    this.show(\"Error Saving Assignment\", `BlockPy encountered an error while saving the assignment.<br>\nPlease reload the page and try again.<br>Response from server was:<br><pre>${reason}</pre>`,);\n};\n\nBlockPyDialog.prototype.ERROR_SHOW_STUDENT_ERROR = function (error) {\n    this.show(\"Original Error\", `When I ran your code, I encountered an error:\\n\\n<div class=\"blockpy-dialog-student-error-message\">${error}</div>`);\n};\n\nBlockPyDialog.prototype.POSITIVE_FEEDBACK_FULL = function (title, message) {\n    this.show(title, message);\n};\n\nBlockPyDialog.prototype.SCREENSHOT_BLOCKS = function () {\n    // TODO\n};\n\nBlockPyDialog.prototype.ERROR_UPDATING_SUBMISSION_STATUS = function () {\n    this.show(\"Error Updating Submission Status\", `BlockPy encountered an error while updating your submission status.<br>\nPlease reload the page and try again.`);\n};\n\nBlockPyDialog.prototype.ERROR_LOADING_HISTORY = function () {\n    this.show(\"Error Loading History\", `BlockPy encountered an error while loading your history.<br>\nPlease reload the page and try again.`);\n};\n\nBlockPyDialog.prototype.OFFER_FORK = function () {\n    let setupUrl = this.main.model.configuration.urls.instructionsAssignmentSetup;\n    setupUrl = setupUrl ? ` (<a href=\"${setupUrl}\" target=\"_blank\">How do I do that?</a>)` : \"\";\n    this.show(\"Assignment Not Owned; Fork?\", `\n    <div class=\"mb-4\">\n        It looks like you want to edit this assignment, but you are not an instructor\n    or designer in the course that owns it (\"Course Name\"). Would you like to fork\n    this assignment (or its entire group) so that you can save your modifications?\n    </div>\n    \n    <div class=\"mb-4\">\n        Remember to update the Launch URL in the assignments' settings on Canvas!${setupUrl}\n    </div>\n    \n    <div><button type='button' class='btn btn-white'>Fork entire assignment group</button></div>\n    <div><button type='button' class='btn btn-white'>Fork just this assignment</button></div>\n    <div><button type='button' class='btn btn-danger'>Reset my local changes</button></div>\n    \n    <div class=\"form-check\">\n        <input type=\"checkbox\" class=\"form-check-input\"\n                name=\"blockpy-transfer-submissions\">\n        <label class=\"form-check-label\" for=\"blockpy-transfer-submissions\">Transfer Student Submissions for this course</label>\n    </div>\n    \n    <div class=\"form-check\">\n    <label class=\"form-text\" for=\"blockpy-course-id\">New owning course id: </label>\n        <input type=\"text\" name=\"blockpy-course-id\" value=\"${this.main.model.user.courseId()}\">\n    </div>\n    `);\n};\n\nBlockPyDialog.prototype.EDIT_INPUTS = function () {\n    let inputText = this.main.model.execution.input().join(\"\\n\");\n    let clearInputs = this.main.model.display.clearInputs() ? \"\" : \"checked\";\n    let yes = () => {\n        let checked = this.tag.find(\".blockpy-remember-inputs\").prop(\"checked\");\n        let inputs = this.tag.find(\".blockpy-input-list\").val().split(\"\\n\");\n        this.main.model.display.clearInputs(!checked);\n        this.main.model.execution.input(inputs);\n    };\n    this.confirm(\"Edit Remembered Inputs\", `\n\n<div class=\"form-check\">\n<input type=\"checkbox\" class=\"blockpy-remember-inputs form-check-input\"\n        name=\"blockpy-remember-inputs\" ${clearInputs}>\n<label class=\"form-check-label\" for=\"blockpy-remember-inputs\">Reuse inputs for next execution</label>\n</div>\n\n<textarea class=\"blockpy-input-list form-control\" rows=\"4\">${inputText}</textarea><br>\nEdit the inputs above to store and reuse them across multiple executions.\nEach input should be put on its own line.\nYou do not need quotes; the text will be entered literally.\n \n`, yes, this.no, \"Save\");\n    // TODO: Allow user to specify the infinite string to keep giving when the others run out\n};\n\nBlockPyDialog.prototype.START_SHARE = function (url, wasPrompted) {\n    const initialMessage = wasPrompted ? `\n    It looks like you are having some trouble with this problem, your code, or this feedback.\n    If you plan to reach out for help from the course staff, then we recommend you include this link\n    in your message. It will make it much easier for them to help you quickly. \n    ` : \"You can quickly share your code with instructors and TAs by providing them with this link:\";\n    this.show(\"Share Your Code\", `\n    <div class=\"mb-4\">\n        ${initialMessage}\n    </div>\n    <div class=\"mb-4\">\n        <pre class=\"blockpy-copy-share-link-area\">${url}</pre>\n        <button type='button' class='btn btn-white blockpy-copy-share-link'>Copy Link</button>\n    </div>\n    <div class=\"mb-4\">\n        Note that you CANNOT share this link with other students, or access it yourself.\n        This is strictly for sharing with the course staff when something goes wrong or you need help with your code.\n    </div>\n    `);\n\n    this.tag.find(\".blockpy-copy-share-link\").on(\"click\", () => {\n        // Copy the URL to the clipboard\n        navigator.clipboard.writeText(url).then(() => {\n            this.tag.find(\".blockpy-copy-share-link\").html(\"Copied!\");\n        });\n    });\n};"
  },
  {
    "path": "src/editor/abstract_editor.js",
    "content": "import {Editors} from \"../editors\";\n\nexport function uploadFile(model, event) {\n    let fileReader = new FileReader();\n    let files = event.target.files;\n    fileReader.onload = (e =>\n        model.ui.editors.current().uploadFile(e)\n    );\n    fileReader.fileName = files[0].name;\n    fileReader.readAsText(files[0]);\n    event.target.value = \"\";\n}\n\nexport function sluggify(text) {\n    return text.replace(/[^a-z0-9]/gi, \"_\").toLowerCase();\n}\n\nexport function downloadFile(model, event) {\n    let {name, extension, contents, mimetype} = model.ui.editors.current().downloadFile();\n    // Make safe\n    name = sluggify(name);\n    name = name + extension;\n    // Make the data download as a file\n    let blob = new Blob([contents], {type: mimetype});\n    if (window.navigator.msSaveOrOpenBlob) {\n        window.navigator.msSaveBlob(blob, name);\n    } else{\n        let temporaryDownloadLink = window.document.createElement(\"a\");\n        temporaryDownloadLink.href = window.URL.createObjectURL(blob);\n        temporaryDownloadLink.download = name;\n        document.body.appendChild(temporaryDownloadLink);\n        temporaryDownloadLink.click();\n        document.body.removeChild(temporaryDownloadLink);\n    }\n}\n\nexport class AbstractEditor {\n    constructor(main, tag) {\n        this.main = main;\n        this.tag = tag;\n\n        this.fileSystem = main.components.fileSystem;\n        this.filename = null;\n        this.file = null;\n    }\n\n    deleteFile() {\n        this.fileSystem.deleteFile(this.filename);\n        this.main.model.display.filename(\"answer.py\");\n        this.main.components.editors.changeEditor(\"answer.py\");\n    }\n\n    onFileDeleted() {\n        // TODO: Switch to the previous file instead of a default file\n        this.main.model.display.filename(\"answer.py\");\n        this.main.components.editors.changeEditor(\"answer.py\");\n    }\n\n    onFileUpdated(file) {\n        if (file.filename === this.filename) {\n            //this.file = file;\n            this.main.components.editors.changeEditor(this.filename);\n            //this.fileSystem.stopWatchingFile(this.filename);\n            //this.trackCurrentFile();\n        }\n    }\n\n    trackCurrentFile() {\n        this.fileSystem.watchFile(this.filename, {\n            updated: this.onFileUpdated.bind(this),\n            deleted: this.onFileDeleted.bind(this)\n        });\n    }\n\n    enter(newFilename, oldEditor) {\n        this.filename = newFilename;\n        this.file = this.fileSystem.getFile(newFilename);\n        this.trackCurrentFile();\n    }\n\n    /**\n     *\n     * @param newFilename - the filename that the other editor will be switching to\n     * @param oldEditor\n     * @param newEditor\n     */\n    exit(newFilename, oldEditor, newEditor) {\n        this.fileSystem.stopWatchingFile(this.filename);\n        this.file = null;\n        this.filename = null;\n    }\n\n    uploadFile(event) {\n        let filename = event.target.fileName;\n        let contents = event.target.result;\n        this.file.handle(contents);\n    }\n\n    downloadFile() {\n        let filename = Editors.parseFilename(this.filename);\n        return {\n            name: filename.name,\n            extension: filename.type,\n            contents: this.file.handle(),\n            mimetype: \"text/plain\"\n        };\n    }\n}"
  },
  {
    "path": "src/editor/assignment_settings.js",
    "content": "import {AbstractEditor} from \"./abstract_editor\";\nimport {DisplayModes} from \"./python\";\n\nconst ASSIGNMENT_SETTINGS = [\n    [\"toolbox\", \"toolbox\", \"normal\", \"toolbox\", \"Which version of the toolbox to present to the user.\"],\n    [\"type\", \"type\", \"blockpy\", \"type\", \"The type of question; BlockPy programming problems are the default, but we also support static readings, quiz questions, and a Maze game.\"],\n    [\"passcode\", \"passcode\", \"\", \"string\", \"A string that the user must enter to access the problem. If blank, then no passcode is prompted.\"],\n    //[\"toolboxLevel\", \"toolbox_level\", \"normal\", \"toolbox\", \"INCOMPLETE: What level of toolbox to present to the user (hiding and showing categories).\"],\n    [\"startView\", \"start_view\", DisplayModes.TEXT, DisplayModes, \"The Python editor mode to start in when the student starts the problem.\"],\n    [\"datasets\", \"datasets\", \"\", \"string\", \"The current list of datasets available on load as a comma-separated string.\"],\n    [\"disableTimeout\", \"disable_timeout\", false, \"bool\", \"If checked, then students code is allowed to run without timeouts (potentially allowing infinite loops).\"],\n    [\"partId\", \"part_id\", \"\", \"string\", \"The Part ID of an Assignment that this editor is responsible for. Assignments can have regions (\\\"Parts\\\") that behave independently to the user but all correspond to the same assignment on the backend. Blank corresponds to the full document. Note that most assignment settings will apply UNIVERSALLY across all parts, including the on_run.py and the other settings on this page.\"],\n    [\"isParsons\", \"is_parsons\", false, \"bool\", \"If checked, then this is a parson's style question (jumbled).\"],\n    [\"saveTurtleOutput\", \"save_turtle_output\", false, \"bool\", \"If checked, then turtle (and pygame) output is saved whenever the program uses it.\"],\n    [\"disableFeedback\", \"disable_feedback\", false, \"bool\", \"If checked, then no instructor scripts are run (e.g., on_run and on_eval).\"],\n    [\"disableInstructorRun\", \"disable_instructor_run\", false, \"bool\", \"If checked, then the instructor on_run will not automatically run the students' code. This still runs the students' code once beforehand, but the output/data will not be available to the instructor's on_run.py script.\"],\n    [\"disableStudentRun\", \"disable_student_run\", false, \"bool\", \"If checked, then the run button no longer run the students' code. This still runs the instructor's feedback on_run script.\"],\n    [\"disableTifa\", \"disable_tifa\", false, \"bool\", \"If checked, then do not automatically run Tifa (which can be slow).\"],\n    [\"disableTrace\", \"disable_trace\", false, \"bool\", \"If checked, then the students code will not have its execution traced (no variables recorded, no coverage tracked).\"],\n    [\"disableEdit\", \"disable_edit\", false, \"bool\", \"If checked, then the students' file will not be editable.\"],\n    [\"preloadAllFiles\", \"preload_all_files\", false, \"bool\", \"If checked, then the students can upload and use images and other files. This preloads all available files and images. You can filter them using the Preloaded Files setting.\"],\n    [\"enableImages\", \"can_image\", false, \"bool\", \"If checked, then users can copy/paste images directly into the text editor.\"],\n    [\"enableBlocks\", \"can_blocks\", true, \"bool\", \"If checked, then the student can edit the block interface (if not, then it is visible but not editable).\"],\n    [\"canClose\", \"can_close\", false, \"bool\", \"If checked, then the student should mark their submission closed when they are done. There is no way to force a student to do so. Unlike Reviewed, this still submits the correctness.\"],\n    [\"onlyInteractive\", \"only_interactive\", false, \"bool\", \"If checked, the editors are hidden, the program is automatically run, and then the console enters Eval mode (interactive).\"],\n    [\"onlyUploads\", \"only_uploads\", false, \"bool\", \"If checked, then the students' file will not be directly editable (they will have to upload submissions).\"],\n    // What menus/feedback to show and hide\n    [\"hideSubmission\", \"hide_submission\", false, \"bool\", \"If checked, then students will not be able to see their submission's code or history on Canvas.\"],\n    [\"hideFiles\", \"hide_files\", true, \"bool\", \"If checked, then students will not see the View Files toolbar.\"],\n    [\"hideQueuedInputs\", \"hide_queued_inputs\", false, \"bool\", \"If checked, then the students cannot access the queued inputs box (makes repeated debugging easier for the input function).\"],\n    [\"hideEditors\", \"hide_editors\", false, \"bool\", \"If checked, then all of the editors are hidden.\"],\n    [\"hideMiddlePanel\", \"hide_middle_panel\", false, \"bool\", \"If checked, then the console and feedback areas is hidden.\"],\n    [\"hideAll\", \"hide_all\", false, \"bool\", \"INCOMPLETE: If checked, then the entire interface is hidden.\"],\n    [\"hideEvaluate\", \"hide_evaluate\", false, \"bool\", \"If checked, then the Evaluate button is not shown on the console.\"],\n    [\"hideImportDatasetsButton\", \"hide_import_datasets_button\", false, \"bool\", \"If checked, then students cannot see the import datasets button.\"],\n    // TODO: Fix this one to be settable\n    [\"hideImportStatements\", \"hide_import_statements\", false, \"bool\", \"INCOMPLETE: If checked, certain kinds of import statements (matplotlib, turtle, datasets) are not shown in the block interface.\"],\n    [\"hideCoverageButton\", \"hide_coverage_button\", false, \"bool\", \"INCOMPLETE: If checked, the coverage button is not shown.\"],\n    [\"hideTraceButton\", \"hide_trace_button\", false, \"bool\", \"If checked, then the Trace button is not shown.\"],\n    [\"smallLayout\", \"small_layout\", false, \"bool\", \"If checked, then the interface fits into a smaller region.\"],\n    [\"hasClock\", \"has_clock\", false, \"bool\", \"If checked, then a clock is shown in the top right corner.\"],\n    [\"preloadFiles\", \"preload_files\", \"\", \"string\", \"A JSON structure representing the files that should be loaded on start from the remote, as if they were local.\"]\n];\n\nexport let AssigmentType = {\n    BLOCKPY: \"blockpy\",\n    MAZE: \"maze\",\n    QUIZ: \"quiz\",\n    READING: \"reading\"\n};\n\nfunction getDocumentation(name) {\n    for (let i=0; i < ASSIGNMENT_SETTINGS.length; i++) {\n        if (ASSIGNMENT_SETTINGS[i][0] === name) {\n            return ASSIGNMENT_SETTINGS[i][4];\n        }\n    }\n    return \"Documentation not found for field\";\n}\n\nfunction makeStartViewTab(name, icon, mode) {\n    return `<label class=\"btn btn-outline-secondary blockpy-mode-set-blocks\"\n                data-bind=\"css: {active: assignment.settings.startView() === '${mode}'},\n                           click: assignment.settings.startView.bind($data, '${mode}')\">\n                <span class='fas fa-${icon}'></span>\n                <input type=\"radio\" name=\"blockpy-start-view-set\" autocomplete=\"off\" checked> ${name}\n            </label>`;\n}\n\nconst ASSIGNMENT_SETTINGS_BOOLEAN_COMPONENTS_HTML = ASSIGNMENT_SETTINGS\n    // Only handle the simple booleans this way\n    .filter((setting) => setting[3] === \"bool\")\n    .map((setting) => {\n        let prettyName = setting[1].split(\"_\").map(word=>(word.charAt(0).toUpperCase()+word.slice(1))).join(\" \");\n        return `\n        <div class=\"form-group row\">\n            <div class=\"col-sm-2 text-right\">\n                <label class=\"form-check-label\" for=\"blockpy-settings-${setting[0]}\">${prettyName}</label>\n            </div>\n            <div class=\"col-sm-1\">\n                <div class=\"form-check\">\n                    <input class=\"form-check-input\" type=\"checkbox\" id=\"blockpy-settings-${setting[0]}\"\n                    data-bind=\"checked: assignment.settings.${setting[0]}\">\n                </div>  \n            </div>            \n            <div class=\"col-sm-9\">\n                <small class=\"form-text text-muted\">\n                    ${setting[4]}\n                </small>\n            </div>\n        </div>\n        `;\n    }).join(\"\\n\\n\");\n\nexport const ASSIGNMENT_SETTINGS_EDITOR_HTML = `\n    <div class=\"blockpy-view-settings\">\n    \n    <form>\n\n        <div class=\"form-group row\">\n            <div class=\"col-sm-12 mx-auto\">\n                <button type=\"button\" class=\"btn btn-success\"\n                    data-bind=\"click: ui.editors.settings.save\">Save changes</button>\n            </div>\n        </div>\n    \n        <div class=\"form-group row\">\n            <label for=\"blockpy-settings-name\" class=\"col-sm-2 col-form-label text-right\">Name:</label>\n            <div class=\"col-sm-10\">\n                <input type=\"text\" class=\"form-control\" id=\"blockpy-settings-name\"\n                data-bind=\"value: assignment.name\">\n                <small class=\"form-text text-muted\">\n                    The student-facing name of the assignment. Assignments within a group are ordered alphabetically\n                    by their name, so you may want to use a naming scheme like \"#43.5) Whatever\".\n                </small>\n            </div>\n        </div>\n        \n        <div class=\"form-group row\">\n            <label for=\"blockpy-settings-url\" class=\"col-sm-2 col-form-label text-right\">URL:</label>\n            <div class=\"col-sm-10\">\n                <input type=\"text\" class=\"form-control\" id=\"blockpy-settings-url\"\n                data-bind=\"value: assignment.url\">\n                <small class=\"form-text text-muted\">\n                    The course-unique URL that can be used to consistently refer to this assignment. \n                </small>\n            </div>\n        </div>\n        \n        <div class=\"form-group row\">\n            <div class=\"col-sm-2 text-right\">\n                <label class=\"form-check-label\" for=\"blockpy-settings-public\">Public:</label>\n            </div>\n            <div class=\"col-sm-1\">\n                <div class=\"form-check\">\n                    <input class=\"form-check-input\" type=\"checkbox\" id=\"blockpy-settings-public\"\n                    data-bind=\"checked: assignment.public\">\n                </div>  \n            </div>            \n            <div class=\"col-sm-9\">\n                <small class=\"form-text text-muted\">\n                    If not public, users outside of the course will not be able to see the assignment in course listings.\n                </small>\n            </div>\n        </div>\n        \n        <div class=\"form-group row\">\n            <div class=\"col-sm-2 text-right\">\n                <label class=\"form-check-label\" for=\"blockpy-settings-hidden\">Hidden:</label>\n            </div>\n            <div class=\"col-sm-1\">\n                <div class=\"form-check\">\n                    <input class=\"form-check-input\" type=\"checkbox\" id=\"blockpy-settings-hidden\"\n                    data-bind=\"checked: assignment.hidden\">\n                </div>  \n            </div>            \n            <div class=\"col-sm-9\">\n                <small class=\"form-text text-muted\">\n                    If hidden, students will not be able to see their grade while working on the assignment.\n                </small>\n            </div>\n        </div>\n        \n        <div class=\"form-group row\">\n            <div class=\"col-sm-2 text-right\">\n                <label class=\"form-check-label\" for=\"blockpy-settings-reviewed\">Reviewed:</label>\n            </div>\n            <div class=\"col-sm-1\">\n                <div class=\"form-check\">\n                    <input class=\"form-check-input\" type=\"checkbox\" id=\"blockpy-settings-reviewed\"\n                    data-bind=\"checked: assignment.reviewed\">\n                </div>  \n            </div>            \n            <div class=\"col-sm-9\">\n                <small class=\"form-text text-muted\">\n                    If reviewed, the assignment need to be commented upon and regraded by the staff after submission.\n                </small>\n            </div>\n        </div>\n        \n        <div class=\"form-group row\">\n            <label for=\"blockpy-settings-points\" class=\"col-sm-2 col-form-label text-right\">Points:</label>\n            <div class=\"col-sm-10\">\n                <input type=\"number\" class=\"form-control\" id=\"blockpy-settings-points\"\n                data-bind=\"value: assignment.points\">\n                <small class=\"form-text text-muted\">\n                    The number of points this assignment is worth; defaults to 1 point. \n                </small>\n            </div>\n        </div>\n        \n        <div class=\"form-group row\">\n            <div class=\"col-sm-2 text-right\">\n                <label class=\"form-check-label\" for=\"blockpy-settings-reviewed\">Starting View:</label>\n            </div>\n            <div class=\"col-sm-3\">\n                <div class=\"btn-group btn-group-toggle mr-2\" data-toggle=\"buttons\">\n                    ${makeStartViewTab(\"Blocks\", \"th-large\", DisplayModes.BLOCK)}\n                    ${makeStartViewTab(\"Split\", \"columns\", DisplayModes.SPLIT)}\n                    ${makeStartViewTab(\"Text\", \"align-left\", DisplayModes.TEXT)}\n                 </div>\n            </div>            \n            <div class=\"col-sm-7\">\n                <small class=\"form-text text-muted\">\n                    ${getDocumentation(\"startView\")}\n                </small>\n            </div>\n        </div>\n        \n        <div class=\"form-group row\">\n            <label for=\"blockpy-settings-ip-ranges\" class=\"col-sm-2 col-form-label text-right\">IP Ranges:</label>\n            <div class=\"col-sm-10\">\n                <input type=\"text\" class=\"form-control\" id=\"blockpy-settings-ip-ranges\"\n                data-bind=\"value: assignment.ipRanges\">\n                <small class=\"form-text text-muted\">\n                    Provide a comma-separated list of IP Addresses that will be explicitly allowed. If blank,\n                    then all addresses are allowed. If an address starts with <code>^</code> then it it is explicitly\n                    blacklisted, but that can be overridden in turn with a <code>!</code>. Addresses can also\n                    include a bit mask to allow a range of addresses.\n                </small>\n            </div>\n        </div>\n        \n        <div class=\"form-group row\">\n            <label for=\"blockpy-settings-passcode\" class=\"col-sm-2 col-form-label text-right\">Passcode:</label>\n            <div class=\"col-sm-10\">\n                <input type=\"text\" class=\"form-control\" id=\"blockpy-settings-passcode\"\n                data-bind=\"value: assignment.settings.passcode\">\n                <small class=\"form-text text-muted\">\n                    ${getDocumentation(\"passcode\")}\n                </small>\n            </div>\n        </div>\n        \n        <div class=\"form-group row\">\n            <label for=\"blockpy-settings-datasets\" class=\"col-sm-2 col-form-label text-right\">Preloaded Datasets:</label>\n            <div class=\"col-sm-10\">\n                <input type=\"text\" class=\"form-control\" id=\"blockpy-settings-datasets\"\n                data-bind=\"value: assignment.settings.datasets\">\n                <small class=\"form-text text-muted\">\n                    ${getDocumentation(\"datasets\")}\n                </small>\n            </div>\n        </div>\n        \n        <div class=\"form-group row\">\n            <label for=\"blockpy-settings-preload-files\" class=\"col-sm-2 col-form-label text-right\">Preloaded Files:</label>\n            <div class=\"col-sm-10\">\n                <input type=\"text\" class=\"form-control\" id=\"blockpy-settings-preload-files\"\n                data-bind=\"value: assignment.settings.preloadFiles\">\n                <small class=\"form-text text-muted\">\n                    ${getDocumentation(\"preloadFiles\")}\n                </small>\n            </div>\n        </div>\n        \n        <div class=\"form-group row\">\n            <label for=\"blockpy-settings-toolbox\" class=\"col-sm-2 col-form-label text-right\">Block Toolbox:</label>\n            <div class=\"col-sm-10\">\n                <select class=\"form-control\" id=\"blockpy-settings-toolbox\"\n                       data-bind=\"value: assignment.settings.toolbox\">\n                   <option value=\"normal\">Normal Toolbox</option>\n                   <option value=\"ct\">CT@VT Toolbox</option>\n                   <option value=\"ct2\">CT@VT Toolbox V2</option>\n                   <option value=\"minimal\">Minimal Set</option>\n                   <option value=\"full\">All Blocks</option>\n                   <option value=\"custom\">Custom</option>\n                </select>\n                <small class=\"form-text text-muted\">\n                    ${getDocumentation(\"toolbox\")}\n                </small>\n            </div>\n        </div>\n        \n        <div class=\"form-group row\">\n            <label for=\"blockpy-settings-type\" class=\"col-sm-2 col-form-label text-right\">Problem Type:</label>\n            <div class=\"col-sm-10\">\n                <select class=\"form-control\" id=\"blockpy-settings-type\"\n                       data-bind=\"value: assignment.type\">\n                   <option value=\"blockpy\">BlockPy</option>\n                   <option value=\"maze\">Maze</option>\n                   <option value=\"quiz\">Quiz Question</option>\n                   <option value=\"reading\">Reading</option>\n                </select>\n                <small class=\"form-text text-muted\">\n                    ${getDocumentation(\"type\")}\n                </small>\n            </div>\n        </div>\n        \n        <div class=\"form-group row\">\n            <label for=\"blockpy-settings-part-id\" class=\"col-sm-2 col-form-label text-right\">Part ID:</label>\n            <div class=\"col-sm-10\">\n                <input type=\"text\" class=\"form-control\" id=\"blockpy-settings-part-id\"\n                data-bind=\"value: configuration.partId\">\n                <small class=\"form-text text-muted\">\n                    ${getDocumentation(\"partId\")}\n                </small>\n            </div>\n        </div>\n        \n        ${ASSIGNMENT_SETTINGS_BOOLEAN_COMPONENTS_HTML}\n    </form>\n    \n    </div>\n`;\n\nexport function saveAssignmentSettings(model) {\n    let settings = {};\n    ASSIGNMENT_SETTINGS.forEach(setting => {\n        let clientName = setting[0], serverName = setting[1], defaultValue = setting[2];\n        let value = model.assignment.settings[clientName]();\n        // Only store this setting if its different from the default\n        if (value !== defaultValue) {\n            settings[serverName] = value;\n        }\n    });\n    return JSON.stringify(settings);\n}\n\nexport function loadAssignmentSettings(model, settings) {\n    if (settings) {\n        settings = JSON.parse(settings);\n        ASSIGNMENT_SETTINGS.forEach(setting => {\n            let clientName = setting[0], serverName = setting[1];\n            if (serverName in settings) {\n                model.assignment.settings[clientName](settings[serverName]);\n            } else {\n                model.assignment.settings[clientName](setting[2]);\n            }\n        });\n\n        if (settings.start_view) {\n            model.display.pythonMode(settings.start_view);\n        }\n    }\n}\n\nexport function makeAssignmentSettingsModel(configuration) {\n    let settings = {};\n    ASSIGNMENT_SETTINGS.forEach(setting => {\n        let clientName = setting[0], serverName = setting[1], defaultValue = setting[2],\n            fieldType = setting[3];\n        if (configuration[\"assignment.settings.\"+serverName] === undefined) {\n            settings[clientName] = ko.observable(defaultValue);\n        } else {\n            let configValue = configuration[\"assignment.settings.\"+serverName];\n            if (fieldType === \"bool\") {\n                configValue = configValue.toLowerCase() === \"true\";\n            }\n            settings[clientName] = ko.observable(configValue);\n        }\n    });\n\n    return settings;\n}\n\nclass AssignmentSettingsView extends AbstractEditor {\n    constructor(main, tag) {\n        super(main, tag);\n        this.dirty = false;\n    }\n\n    enter(newFilename, oldEditor) {\n        super.enter(newFilename, oldEditor);\n        this.dirty = false;\n        //TODO: this.updateEditor(this.file.handle());\n        // Subscribe to the relevant File\n        // this.currentSubscription = this.file.handle.subscribe(this.updateEditor.bind(this));\n        // Notify relevant file of changes to BM\n        this.currentListener = this.updateHandle.bind(this);\n\n        //TODO: this.codeMirror.on(\"change\", this.currentListener);\n    }\n\n    updateEditor(newContents) {\n        this.dirty = !this.dirty;\n        if (this.dirty) {\n            this.dirty = true;\n            // TODO: Do update\n\n            this.dirty = false;\n        }\n    }\n\n    updateHandle(event) {\n        this.dirty = !this.dirty;\n        if (this.dirty) {\n            this.dirty = true;\n            //this.file.handle(this.codeMirror.value());\n            // TODO: Update\n            this.dirty = false;\n        }\n    }\n\n    exit(newFilename, oldEditor, newEditor) {\n        // Remove subscriber\n        //this.currentSubscription.dispose();\n        // TODO: update\n        //this.codeMirror.off(\"change\", this.currentListener);\n        super.exit(newFilename, oldEditor);\n    }\n}\n\nexport const AssignmentSettings = {\n    name: \"Assignment Settings\",\n    extensions: [\"!assignment_settings.blockpy\"],\n    constructor: AssignmentSettingsView,\n    template: ASSIGNMENT_SETTINGS_EDITOR_HTML\n};"
  },
  {
    "path": "src/editor/default_header.js",
    "content": "\n\nexport const default_header = `\n<div class=\"blockpy-python-toolbar col-md-12 btn-toolbar\"\n     role=\"toolbar\" aria-label=\"Python Toolbar\">\n     <div class=\"btn-group mr-2\">\n        <label class=\"btn btn-outline-secondary\">\n            <span class=\"fas fa-file-upload\"></span> Upload\n            <input class=\"blockpy-toolbar-upload\" type=\"file\"\n                hidden\n                data-bind=\"event: {change: ui.editors.upload}\">\n         </label>\n\n        <button type=\"button\" class=\"btn btn-outline-secondary dropdown-toggle dropdown-toggle-split\"\n            data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n            <span class=\"caret\"></span>\n            <span class=\"sr-only\">Toggle Dropdown</span>\n        </button>\n        \n        <div class=\"dropdown-menu dropdown-menu-right\">\n            <a class='dropdown-item blockpy-toolbar-download'\n                data-bind=\"click: ui.editors.download\">\n            <span class='fas fa-download'></span> Download\n            </a>\n        </div>\n    </div>\n    \n    <div class=\"btn-group mr-2\" role=\"group\" aria-label=\"Delete Group\"\n        data-bind=\"visible: ui.editors.canDelete\">\n        <button type=\"button\" class=\"btn btn-outline-secondary\",\n            data-bind=\"click: ui.files.delete\">\n            <span class=\"fas fa-trash\"></span> Delete\n         </button>\n     </div>\n </div>\n`;\n"
  },
  {
    "path": "src/editor/images.js",
    "content": "import {AbstractEditor} from \"./abstract_editor\";\nimport * as FilePond from \"filepond\";\n\nexport const IMAGE_EDITOR_HTML = `\n     <div>\n        <strong>Available Files</strong><br>\n            All the files available to open with <code>PIL</code> for this assignment:\n            <button data-bind=\"click: ui.editors.images.reloadImages\"\n                class=\"btn btn-outline-secondary float-right\"\n            >Reload Available Images</button>\n        <!-- ko if: display.uploadedFiles() !== null -->\n            <ul>\n                <!-- ko foreach: { data: Object.keys(display.uploadedFiles()), as: 'placement' } -->\n                <li>\n                    <strong data-bind=\"text: $data[0].toUpperCase() + $data.slice(1)\"></strong>:\n                    <table class=\"table table-striped table-bordered table-hover table-sm\">\n                        <thead>\n                            <tr>\n                                <th>Filename</th>\n                                <th>Preview</th>\n                                <th>Actions</th>\n                            </tr>\n                        </thead>\n                        <tbody>\n                    <!-- ko foreach: { data: $root.display.uploadedFiles()[placement], as: 'filename' } -->\n                        <tr>\n                            <td>\n                                <code data-bind=\"text: filename[0]\"></code>\n                            </td>\n                            <td>\n                                <details>\n                                    <summary><img data-bind=\"attr: { src: filename[1], alt: filename[1] }\"\n                                        width=\"30px\" height=\"30px\" onerror=\"this.style.display='none'\"/>\n                                    </summary>\n                                    <img data-bind=\"attr: { src: filename[1], alt: filename[1] }\"\n                                        onerror=\"this.style.display='none'\"/>\n                                </details>\n                            </td>\n                            <td>\n                                <button class=\"btn btn-danger\" \n                                    data-bind=\"click: $root.ui.editors.images.deleteFile.bind(filename[0]),\n                                               visible: $root.ui.editors.images.canModify(placement)\">Delete</button>\n                                <button class=\"btn btn-danger\" \n                                    data-bind=\"click: $root.ui.editors.images.renameFile.bind(filename[0]),\n                                               visible: $root.ui.editors.images.canModify(placement)\">Rename</button>\n                            </td>\n                        </tr>\n                    <!-- /ko -->\n                    </table>\n                </li>\n                <!-- /ko -->\n            </ul>\n        <!-- /ko -->\n        \n        <strong>Add more files</strong><br>\n        Upload more files using the forms below:\n                \n        <div class=\"form-group row\">\n            <div class=\"col-sm-2 text-right\">\n                <label class=\"form-label\" for=\"blockpy-editor-images-upload-file\">File:</label>\n            </div>\n            <div class=\"col-sm-10\">\n                <input type=\"file\" class=\"form-control blockpy-editor-images-upload-file\" id=\"blockpy-editor-images-upload-file\"\n            name=\"blockpy-editor-images-upload-file\">\n                <small class=\"form-text text-muted\">\n                    The file to make available in your code\n                </small>\n            </div>\n        </div>\n        \n        <div class=\"form-group row\" data-bind=\"visible: ui.editors.images.canChoosePlacement()\">\n            <div class=\"col-sm-2 text-right\">\n                <label class=\"form-label\" for=\"blockpy-editor-images-upload-placement\">Placement:</label>\n            </div>\n            <div class=\"col-sm-10\">\n                <select id=\"blockpy-editor-images-upload-placement\" name=\"blockpy-editor-images-upload-placement\"\n                    class=\"form-control blockpy-editor-images-upload-placement\">\n                    <option value=\"submission\" selected>Only your submission</option>\n                    <option value=\"assignment\">For all submissions of this assignment</option>\n                    <option value=\"course\">Across the entire course</option>\n                    <option value=\"user\">For just your user account</option>\n                </select>\n                <small class=\"form-text text-muted\">\n                    The placement of the file in the system. This controls whether other users can see the file.\n                    If you want to provide a file to all students for just this specific problem, then you should\n                    use <code>For all submissions of this assignment</code>. If you want to use this same image\n                    across other assignments (including assignments within this assignment group), then you should\n                    use <code>Across the entire course</code>.\n                </small>\n            </div>\n        </div>\n        \n        <div class=\"form-group row\">\n            <div class=\"col-sm-2 text-right\">\n                <label class=\"form-label\" for=\"blockpy-editor-images-upload-filename\">Filename:</label>\n            </div>\n            <div class=\"col-sm-10\">\n                <input type=\"text\" class=\"form-control blockpy-editor-images-upload-filename\" id=\"blockpy-editor-images-upload-filename\"\n                             name=\"blockpy-editor-images-upload-filename\">\n                <small class=\"form-text text-muted\">\n                    The filename that will be made available in the code. This should be a valid filename for the\n                    system, and should not contain spaces or special characters. It should also have a valid file\n                    extension (e.g., <code>.png</code>, <code>.jpg</code>, <code>.txt</code>).\n                </small>\n            </div>\n        </div>\n        <div class=\"form-group row\">\n            <button data-bind=\"click: ui.editors.images.uploadFile\" class=\"btn btn-success\">Upload</button>\n        </div>\n    </div>\n`;\n\nclass ImageEditorView extends AbstractEditor {\n    constructor(main, tag) {\n        super(main, tag);\n\n        this.tagUploadFileButton = this.tag.find(\".blockpy-editor-images-upload-file\");\n        this.tagUploadFilePlacement = this.tag.find(\".blockpy-editor-images-upload-placement\");\n        this.tagUploadFileName = this.tag.find(\".blockpy-editor-images-upload-filename\");\n\n        this.tagUploadFileButton.on(\"change\", (event) => {\n            this.tagUploadFileName.val(event.target.files[0].name);\n        });\n    }\n\n    enter(newFilename, oldEditor) {\n        super.enter(newFilename, oldEditor);\n\n        let uploadedFiles = this.main.model.display.uploadedFiles();\n        if (uploadedFiles === null) {\n            this.reloadImages();\n        }\n\n        this.currentSubscription = this.file.handle.subscribe(this.updateEditor.bind(this));\n\n        // const target = this.tag.find(\".blockpy-editor-images-filepond\")[0];\n        //console.log(target);\n        /*const uploadUrl = new URL(this.main.model.configuration.urls[\"uploadFile\"]);\n        uploadUrl.searchParams.set(\"directory\", this.main.model.assignment.id());\n        uploadUrl.searchParams.set(\"placement\", \"submission\");*/\n        // this.filepond = FilePond.create(target, {\n        //     //files: [],\n        //     allowMultiple: true,\n        //     server: {\n        //         url: this.main.model.configuration.urls[\"downloadFile\"],\n        //         load: (source, load) => {\n        //             const params = new URL(source, window.location.origin).searchParams;\n        //             this.main.components.server.downloadFile(\n        //                 params.get(\"placement\"),\n        //                 params.get(\"directory\"),\n        //                 params.get(\"filename\"),\n        //                 (response) => {\n        //                     load(new File([response], params.get(\"filename\")));\n        //                 }\n        //             );\n        //             console.log(source, load);\n        //         },\n        //         process: {\n        //             url: this.main.model.configuration.urls[\"uploadFile\"],\n        //             // url: \"blockpy/upload_file?placement=assignment&directory=\"+this.main.model.assignment.id(),\n        //         }\n        //     }\n        // });\n        // console.log(this.filepond);\n        /*\n        this.updateEditor(this.file.handle());\n        // Subscribe to the relevant File\n\n        // Notify relevant file of changes to BM\n        this.currentListener = this.updateHandle.bind(this);\n        this.codeMirror.on(\"change\", this.currentListener);*/\n    }\n\n    reloadImages() {\n        this.main.components.server.listUploadedFiles((response) => {\n            if (response.success) {\n                this.main.model.display.uploadedFiles(response.files);\n                this.main.components.fileSystem.loadRemoteFiles(response.files);\n                // const allFiles = [];\n                // Object.entries(response.files).forEach(([group, files]) => {\n                //     files.forEach(([filename, url]) => allFiles.push({\n                //         source: url,\n                //         options: {\n                //             type: \"local\"\n                //         }\n                //     }));\n                // });\n                // this.filepond.addFiles(allFiles);\n            } else {\n                this.main.components.dialog.ERROR_LISTING_UPLOADED_FILES(response.message);\n            }\n        });\n    }\n\n    updateEditor(newContents) {\n\n    }\n\n    updateHandle(event) {\n        /*this.dirty = !this.dirty;\n        if (this.dirty) {\n            this.dirty = true;\n            this.file.handle(this.codeMirror.getValue());\n            this.dirty = false;\n        }*/\n    }\n\n    getPlacementDirectory(placement) {\n        switch (placement) {\n            case \"submission\":\n                return this.main.model.submission.id();\n            case \"assignment\":\n                return this.main.model.assignment.id();\n            case \"course\":\n                return this.main.model.course.id();\n            case \"user\":\n                return this.main.model.user.id();\n            default:\n                return null;\n        }\n    }\n\n    uploadFile(event) {\n        this.main.components.server.uploadFile(\n            this.tagUploadFilePlacement.val(),\n            this.getPlacementDirectory(this.tagUploadFilePlacement.val()),\n            this.tagUploadFileName.val(),\n            this.tagUploadFileButton[0].files[0],\n            (response) => {\n                if (response.success) {\n                    this.reloadImages();\n                } else {\n                    this.main.components.dialog.ERROR_UPLOADING_FILE(response.message);\n                }\n            }\n        );\n    }\n\n    deleteFile(fileInfo) {\n        const [filename, url] = fileInfo;\n        const queryParams = new URL(url, window.location.origin).searchParams;\n        this.main.components.server.uploadFile(\n            queryParams.get(\"placement\"),\n            queryParams.get(\"directory\"),\n            filename,\n            \"\",\n            (response) => {\n                if (response.success) {\n                    this.reloadImages();\n                } else {\n                    this.main.components.dialog.ERROR_DELETING_FILE(response.message);\n                }\n            },\n            true\n        );\n    }\n    renameFile(fileInfo) {\n        const [filename, url] = fileInfo;\n        const queryParams = new URL(url, window.location.origin).searchParams;\n        const newFilename = prompt(\"Enter the new filename for this file:\", filename);\n        if (newFilename) {\n            this.main.components.server.renameFile(\n                queryParams.get(\"placement\"),\n                queryParams.get(\"directory\"),\n                filename,\n                newFilename,\n                (response) => {\n                    if (response.success) {\n                        this.reloadImages();\n                    } else {\n                        this.main.components.dialog.ERROR_RENAMING_FILE(response.message);\n                    }\n                }\n            );\n        }\n    }\n\n    exit(newFilename, oldEditor, newEditor) {\n        // Remove subscriber\n        this.currentSubscription.dispose();\n        super.exit(newFilename, oldEditor);\n        // if (this.filepond) {\n        //     this.filepond.destroy();\n        // }\n    }\n}\n\nexport const ImageEditor = {\n    name: \"Image\",\n    extensions: [\"images.blockpy\"],\n    constructor: ImageEditorView,\n    template: IMAGE_EDITOR_HTML\n};"
  },
  {
    "path": "src/editor/json.js",
    "content": "import {AbstractEditor} from \"./abstract_editor\";\nimport {default_header} from \"./default_header\";\n\nexport const JSON_EDITOR_HTML = `\n    ${default_header}\n     <div>\n        <textarea class=\"blockpy-editor-json\"></textarea>\n    </div>\n`;\n\nclass JsonEditorView extends AbstractEditor {\n    constructor(main, tag) {\n        super(main, tag);\n        this.codeMirror = CodeMirror.fromTextArea(tag.find(\".blockpy-editor-json\")[0], {\n            showCursorWhenSelecting: true,\n            lineNumbers: true,\n            firstLineNumber: 1,\n            indentUnit: 4,\n            tabSize: 4,\n            indentWithTabs: false,\n            mode: \"json\",\n            extraKeys: {\n                \"Tab\": \"indentMore\",\n                \"Shift-Tab\": \"indentLess\",\n                \"Esc\": function (cm) {\n                    if (cm.getOption(\"fullScreen\")) {\n                        cm.setOption(\"fullScreen\", false);\n                    } else {\n                        cm.display.input.blur();\n                    }\n                },\n                \"F11\": function (cm) {\n                    cm.setOption(\"fullScreen\", !cm.getOption(\"fullScreen\"));\n                }\n            }\n        });\n        this.dirty = false;\n    }\n\n    enter(newFilename, oldEditor) {\n        super.enter(newFilename, oldEditor);\n        this.dirty = false;\n        this.updateEditor(this.file.handle());\n        // Subscribe to the relevant File\n        this.currentSubscription = this.file.handle.subscribe(this.updateEditor.bind(this));\n        // Notify relevant file of changes to BM\n        this.currentListener = this.updateHandle.bind(this);\n        this.codeMirror.on(\"change\", this.currentListener);\n        if (oldEditor !== this) {\n            // Delay so that everything is rendered\n            setTimeout(this.codeMirror.refresh.bind(this.codeMirror), 1);\n        }\n        // TODO: update dynamically when changing instructor status\n        this.codeMirror.setOption(\"readOnly\", newFilename.startsWith(\"&\") && !this.main.model.display.instructor());\n\n    }\n\n    updateEditor(newContents) {\n        this.dirty = !this.dirty;\n        if (this.dirty) {\n            this.dirty = true;\n            this.codeMirror.setValue(newContents);\n            this.codeMirror.refresh();\n            this.dirty = false;\n        }\n    }\n\n    updateHandle(event) {\n        this.dirty = !this.dirty;\n        if (this.dirty) {\n            this.dirty = true;\n            this.file.handle(this.codeMirror.getValue());\n            this.dirty = false;\n        }\n    }\n\n    exit(newFilename, oldEditor, newEditor) {\n        // Remove subscriber\n        this.currentSubscription.dispose();\n        this.codeMirror.off(\"change\", this.currentListener);\n        this.codeMirror.setOption(\"readOnly\", false);\n        super.exit(newFilename, oldEditor);\n    }\n}\n\nexport const JsonEditor = {\n    name: \"JSON\",\n    extensions: [\".json\"],\n    constructor: JsonEditorView,\n    template: JSON_EDITOR_HTML\n};"
  },
  {
    "path": "src/editor/markdown.js",
    "content": "import {AbstractEditor} from \"./abstract_editor\";\nimport {default_header} from \"./default_header\";\n\nexport const MARKDOWN_EDITOR_HTML = `\n    ${default_header}\n    <textarea class=\"blockpy-editor-markdown\"></textarea>    \n`;\n\n\nclass MarkdownEditorView extends AbstractEditor {\n    constructor(main, tag) {\n        super(main, tag);\n        this.mde = new EasyMDE({\n            element: tag.find(\".blockpy-editor-markdown\")[0],\n            autoDownloadFontAwesome: false,\n            forceSync: true,\n            minHeight: \"300px\",\n            //scrollbarStyle: \"native\",\n            // TODO: imageUploadFunction\n            renderingConfig: {\n                codeSyntaxHighlighting: true,\n            },\n            indentWithTabs: false,\n            tabSize: 4,\n        });\n        this.dirty = false;\n    }\n\n    enter(newFilename, oldEditor) {\n        super.enter(newFilename, oldEditor);\n        this.dirty = false;\n        this.updateEditor(this.file.handle());\n        // Subscribe to the relevant File\n        this.currentSubscription = this.file.handle.subscribe(this.updateEditor.bind(this));\n        // Notify relevant file of changes to BM\n        this.currentListener = this.updateHandle.bind(this);\n        this.mde.codemirror.on(\"change\", this.currentListener);\n        if (oldEditor !== this) {\n            // Delay so that everything is rendered\n            setTimeout(this.mde.codemirror.refresh.bind(this.mde.codemirror), 1);\n        }\n    }\n\n    updateEditor(newContents) {\n        this.dirty = !this.dirty;\n        if (this.dirty) {\n            this.dirty = true;\n            this.mde.value(newContents);\n            this.mde.codemirror.refresh();\n            this.dirty = false;\n        }\n    }\n\n    updateHandle(event) {\n        this.dirty = !this.dirty;\n        if (this.dirty) {\n            this.dirty = true;\n            this.file.handle(this.mde.value());\n            this.dirty = false;\n        }\n    }\n\n    exit(newFilename, oldEditor, newEditor) {\n        // Remove subscriber\n        this.currentSubscription.dispose();\n        this.mde.codemirror.off(\"change\", this.currentListener);\n        super.exit(newFilename, oldEditor);\n    }\n}\n\nexport const MarkdownEditor = {\n    name: \"Markdown\",\n    extensions: [\".md\"],\n    constructor: MarkdownEditorView,\n    template: MARKDOWN_EDITOR_HTML\n};"
  },
  {
    "path": "src/editor/python.js",
    "content": "/**\n * TODO: rename files, manual save, tags, sample_submissions, on_eval, non-builtin files\n * TODO: import data, history, run, url_data, assignment_settings, parsons_mode\n * TODO: delete becomes \"clear\" for instructor files\n */\n\n/**\n *\n * @enum {str}\n */\nimport {AbstractEditor, sluggify} from \"./abstract_editor\";\nimport {HISTORY_TOOLBAR_HTML} from \"../history\";\nimport {SecondRowSecondPanelOptions} from \"../interface\";\n\nexport let DisplayModes = {\n    BLOCK: \"block\",\n    SPLIT: \"split\",\n    TEXT: \"text\"\n};\n\nfunction makeTab(name, icon, mode) {\n    return `<label class=\"btn btn-outline-secondary blockpy-mode-set-blocks\"\n                data-bind=\"css: {active: display.pythonMode() === '${mode}'},\n                           click: ui.editors.python.updateMode.bind($data, '${mode}')\">\n                <span class='fas fa-${icon}'></span>\n                <input type=\"radio\" name=\"blockpy-mode-set\" autocomplete=\"off\" checked> ${name}\n            </label>`;\n}\n\nexport const PYTHON_EDITOR_HTML = `\n\n    <div class=\"blockpy-python-toolbar col-md-12 btn-toolbar\"\n         role=\"toolbar\" aria-label=\"Python Toolbar\">\n\n         <div class=\"btn-group mr-2\" role=\"group\" aria-label=\"Run Group\">         \n            <button type=\"button\" class=\"btn blockpy-run notransition\"\n                data-bind=\"click: ui.execute.run,\n                            css: {'blockpy-run-running': ui.execute.isRunning}\">\n                <span class=\"fas fa-play\"></span> <span data-bind=\"text: ui.execute.runLabel\"></span>\n             </button>\n         </div>\n         \n         <div class=\"btn-group btn-group-toggle mr-2\" data-toggle=\"buttons\">\n            <!-- ko if: $root.assignment.settings.enableBlocks() -->\n            ${makeTab(\"Blocks\", \"th-large\", DisplayModes.BLOCK)}\n            ${makeTab(\"Split\", \"columns\", DisplayModes.SPLIT)}\n            ${makeTab(\"Text\", \"align-left\", DisplayModes.TEXT)}\n            <!-- /ko -->\n         </div>\n\n         <div class=\"btn-group mr-2\" role=\"group\" aria-label=\"Reset Group\">\n             <button type=\"button\" class=\"btn btn-outline-secondary\"\n                 data-bind=\"click: ui.editors.reset\">\n                 <span class=\"fas fa-sync\"></span> Reset\n              </button>\n         </div>\n         \n         <!-- ko if: !assignment.settings.hideImportDatasetsButton() && !ui.smallLayout()-->\n         <div class=\"btn-group mr-2\" role=\"group\" aria-label=\"Import Group\">\n            <button type=\"button\" class=\"btn btn-outline-secondary\"\n                data-bind=\"click: ui.editors.importDataset\">\n                <span class=\"fas fa-cloud-download-alt\"></span> Import datasets\n             </button>\n         </div>\n         <!-- /ko -->\n         \n         <div class=\"btn-group mr-2\" data-bind=\"hidden: ui.smallLayout\">\n                <label class=\"btn btn-outline-secondary\">\n                    <span class=\"fas fa-file-upload\"></span> Upload\n                    <input class=\"blockpy-toolbar-upload\" type=\"file\"\n                        hidden\n                        data-bind=\"event: {change: ui.editors.upload}\">\n                 </label>\n\n                <button type=\"button\" class=\"btn btn-outline-secondary dropdown-toggle dropdown-toggle-split\"\n                    data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n                    <span class=\"caret\"></span>\n                    <span class=\"sr-only\">Toggle Dropdown</span>\n                </button>\n                \n                <div class=\"dropdown-menu dropdown-menu-right\">\n                    <a class='dropdown-item blockpy-toolbar-download'\n                        data-bind=\"click: ui.editors.download\">\n                    <span class='fas fa-download'></span> Download\n                    </a>\n                </div>\n            </div>\n         \n         <div class=\"btn-group mr-2\" role=\"group\" aria-label=\"History Group\" data-bind=\"hidden: ui.smallLayout\">\n            <button type=\"button\" class=\"btn btn-outline-secondary\"\n                aria-pressed=\"false\"\n                data-bind=\"click: ui.editors.python.toggleHistoryMode,\n                           enable: ui.editors.python.isHistoryAvailable,\n                           css: { active: display.historyMode },\n                           attr: { 'aria-pressed': display.historyMode }\">\n                <span class=\"fas fa-history\"></span> History\n             </button>\n         </div>\n         \n         <!-- Fully functional, but a little too.. Invasive \n         <div class=\"btn-group mr-2\" role=\"group\" aria-label=\"Fullscreen Group\"\n            data-bind=\"visible: display.pythonMode() === 'text'\">\n            <button type=\"button\" class=\"btn btn-outline-secondary\"\n                data-bind=\"click: ui.editors.python.fullscreen\">\n                <span class=\"fas fa-expand-arrows-alt\"></span> Fullscreen\n             </button>\n         </div>\n         -->\n         \n         <div class=\"btn-group mr-2\" role=\"group\" aria-label=\"Save Group\"\n            data-bind=\"visible: ui.editors.canSave\">\n            <button type=\"button\" class=\"btn btn-outline-secondary\">\n                <span class=\"fas fa-save\"></span> Save\n             </button>\n         </div>\n         \n         <div class=\"btn-group mr-2\" role=\"group\" aria-label=\"Delete Group\"\n            data-bind=\"visible: ui.editors.canDelete\">\n            <button type=\"button\" class=\"btn btn-outline-secondary\",\n                data-bind=\"click: ui.files.delete\">\n                <span class=\"fas fa-trash\"></span> Delete\n             </button>\n         </div>\n         \n         <div class=\"btn-group mr-2\">\n                <button type=\"button\" class=\"btn btn-outline-secondary dropdown-toggle dropdown-toggle-split\"\n                    data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">\n                    <span class=\"fas fa-ellipsis-v\"></span>\n                    <span class=\"sr-only\">Toggle Extra Features</span>\n                </button>\n                \n                <div class=\"dropdown-menu dropdown-menu-right\">\n                    <a class='dropdown-item blockpy-toolbar-run-quietly notransition' role=\"button\"\n                        href=\"\"\n                        data-bind=\"click: ui.execute.runQuietly,\n                                    css: {'blockpy-run-running': ui.execute.isRunning}\">\n                        <span class=\"fas fa-comment-slash\"></span> <span data-bind=\"text: ui.execute.runQuietlyLabel\"></span>\n                    </a>\n                </div>\n            </div>\n         \n         <!--<div class=\"btn-group mr-2\" role=\"group\" aria-label=\"Rename Group\"\n            data-bind=\"visible: ui.editors.canRename\">\n             <button type=\"button\" class=\"btn btn-outline-secondary\">\n                <span class=\"fas fa-file-signature\"></span> Rename\n             </button>\n         </div>-->\n         \n    </div>\n    \n    ${HISTORY_TOOLBAR_HTML}\n\n\n    <div class=\"blockpy-python-blockmirror\"\n        data-bind=\"hidden: ui.menu.isSubmitted\">\n    </div>\n`;\n\n\n\nfunction convertIpynbToPython(code) {\n    let ipynb = JSON.parse(code);\n    let isUsable = function(cell) {\n        if (cell.cell_type === \"code\") {\n            return cell.source.length > 0 &&\n                !cell.source[0].startsWith(\"%\");\n        } else {\n            return cell.cell_type === \"markdown\" ||\n                cell.cell_type === \"raw\";\n        }\n    };\n    let makePython = function(cell) {\n        if (cell.cell_type === \"code\") {\n            return cell.source.join(\"\\n\");\n        } else if (cell.cell_type === \"markdown\" ||\n            cell.cell_type === \"raw\") {\n            return \"'''\"+cell.source.join(\"\\n\")+\"'''\";\n        }\n    };\n    return ipynb.cells.filter(isUsable).map(makePython).join(\"\\n\");\n}\n\nclass PythonEditorView extends AbstractEditor {\n    constructor(main, tag) {\n        super(main, tag.find(\".blockpy-python-blockmirror\"));\n        Blockly.setParentContainer(main.model.configuration.container[0]);\n        this.bm = new BlockMirror({\n            \"container\": this.tag[0],\n            \"run\": main.components.engine.run.bind(main.components.engine),\n            \"skipSkulpt\": true,\n            \"blocklyMediaPath\": main.model.configuration.blocklyPath,\n            \"toolbox\": main.model.assignment.settings.toolbox(),\n            \"imageMode\": true,\n            imageDownloadHook: (oldUrl) => {\n                return oldUrl;\n            },\n            imageUploadHook: (blob) => {\n                //const uuid = window.URL.createObjectURL(new Blob([])).substring(31);\n                return new Promise((resolve, reject) => {\n                    const submissionId = main.model.submission.id();\n                    main.components.server.uploadFile(\"submission\", submissionId, blob.name, blob, (response) => {\n                        resolve(JSON.stringify(response.endpoint));\n                        //resolve(JSON.stringify(main.model.configuration.urls[\"downloadFile\"] + `?placement=submission&directory=${submissionId}&filename=${blob.name}`));\n                    });\n                    //return Promise.resolve(\"Image(\"+JSON.stringify(URL.createObjectURL(blob))+\")\");\n                    //return Promise.resolve(JSON.stringify(URL.createObjectURL(blob)));\n                });\n            },\n            imageLiteralHook: (oldUrl) => {\n                //return `Image(\"${oldUrl}\")`;\n                return `\"${oldUrl}\"`;\n            },\n            //'height': '2000px'\n        });\n        // TODO: Prevent INS and OVR mode (... this.bm.textEditor.codeMirror.\n\n        this.dirty = false;\n        this.readOnly = false;\n        this.makeSubscriptions();\n        this.lineErrorSubscription = null;\n        this.lineUncoveredSubscription = null;\n        this.lineTraceSubscription = null;\n        this.oldPythonMode = this.main.model.display.pythonMode();\n\n        this.makePerAssignmentSubscriptions();\n    }\n\n    configureExtraBlockly() {\n        this.bm.blockEditor.workspace.configureContextMenu = (options) => {\n            options.push({\n                enabled: true,\n                text: \"Screenshot\",\n                callback: () => this.main.components.dialog.SCREENSHOT_BLOCKS\n            });\n        };\n    }\n\n    enter(newFilename, oldEditor) {\n        let oldFilename = this.filename;\n        super.enter(newFilename, oldEditor);\n        this.dirty = false;\n\n        if (newFilename !== \"answer.py\") {\n            if (oldFilename === \"answer.py\") {\n                this.oldPythonMode = this.main.model.display.pythonMode();\n            }\n            this.main.model.display.pythonMode(DisplayModes.TEXT);\n        } else {\n            this.main.model.display.pythonMode(this.oldPythonMode);\n        }\n\n        this.updateEditor(this.file.handle());\n\n        // Subscribe to the relevant File\n        this.currentSubscription = this.file.handle.subscribe(this.updateEditor.bind(this));\n\n        // Notify relevant file of changes to BM\n        this.currentBMListener = this.updateHandle.bind(this);\n        this.bm.addChangeListener(this.currentBMListener);\n\n        if (newFilename !== \"answer.py\") {\n            this.bm.isParsons = () => false;\n        } else {\n            this.bm.isParsons = this.main.model.assignment.settings.isParsons;\n\n            this.lineErrorSubscription = this.main.model.execution.feedback.linesError.subscribe((lines) =>{\n                return this.bm.setHighlightedLines(lines, \"editor-error-line\");\n            });\n            this.lineUncoveredSubscription = this.main.model.execution.feedback.linesUncovered.subscribe((lines) =>\n                this.bm.setHighlightedLines(lines, \"editor-uncovered-line\")\n            );\n\n            this.lineTraceSubscription = this.main.model.ui.trace.highlightedLine.subscribe((lines) => {\n                this.bm.clearHighlightedLines(\"editor-traced-line\");\n                this.bm.setHighlightedLines(lines, \"editor-traced-line\");\n            });\n        }\n\n\n        //this.bm.blockEditor.workspace.render();\n        //this.bm.refresh();\n        // TODO: Figure out why this doesn't end up looking right (go to a different editor, come back, and it'll be squished)\n        //this.bm.refresh();\n        setTimeout(() => this.bm.refresh(), 0);\n    }\n\n    updateEditor(newContents) {\n        if (newContents === undefined) {\n            if (this.file !== null) {\n                newContents = this.file.handle();\n            } else {\n                // Doesn't matter, file was already shut down.\n                newContents = \"\";\n            }\n        } else if (newContents === null) {\n            // We're closing this file\n            this.main.components.fileSystem.deleteFileLocally_(this.filename);\n            return;\n        }\n        this.dirty = !this.dirty;\n        if (this.dirty) {\n            this.dirty = true;\n            this.bm.setCode(newContents);\n            // Delay so that everything is rendered\n            this.dirty = false;\n        }\n    }\n\n    updateHandle(event) {\n        this.bm.clearHighlightedLines();\n\n        this.dirty = !this.dirty;\n        if (this.dirty) {\n            this.dirty = true;\n            if (!this.main.model.display.historyMode()) {\n                this.file.handle(this.bm.getCode());\n            }\n            this.dirty = false;\n        }\n    }\n\n    exit(newFilename, oldEditor, newEditor) {\n        // Remove subscriber\n        this.dirty = false;\n        this.currentSubscription.dispose();\n        this.bm.removeChangeListener(this.currentBMListener);\n        if (this.main.model.display.historyMode()) {\n            this.main.model.ui.editors.python.turnOffHistoryMode();\n        }\n        this.clearLineSubscriptions();\n        super.exit(newFilename, oldEditor);\n    }\n\n    clearLineSubscriptions() {\n        this.bm.clearHighlightedLines();\n        if (this.lineErrorSubscription) {\n            this.lineErrorSubscription.dispose();\n            this.lineErrorSubscription = null;\n        }\n        if (this.lineUncoveredSubscription) {\n            this.lineUncoveredSubscription.dispose();\n            this.lineUncoveredSubscription = null;\n        }\n        if (this.lineTraceSubscription) {\n            this.lineTraceSubscription.dispose();\n            this.lineTraceSubscription = null;\n        }\n    }\n\n    makeSubscriptions() {\n        this.bm.setMode(this.main.model.display.pythonMode());\n        this.main.model.display.pythonMode.subscribe(mode => {\n            this.bm.setMode(mode);\n        });\n        this.main.model.assignment.settings.enableBlocks.subscribe(enabled => {\n            if (!enabled) {\n                this.bm.setMode(DisplayModes.TEXT);\n            } else {\n                this.bm.setMode(this.main.model.display.pythonMode());\n            }\n        });\n        this.main.model.assignment.settings.toolbox.subscribe(this.reloadToolbox.bind(this));\n        this.main.model.assignment.settings.enableImages.subscribe(imageMode => {\n            this.bm.setImageMode(imageMode);\n        });\n\n        // Small Layout Stuff\n        this.oldHeight = null;\n        if (this.main.model.ui.smallLayout()) {\n            this.useSmallLayout();\n        }\n        this.main.model.ui.smallLayout.subscribe(useSmallLayout => {\n            if (useSmallLayout) {\n                this.useSmallLayout();\n            } else if (this.oldHeight !== null) {\n                this.bm.configuration.height = this.oldHeight;\n                this.bm.textEditor.resizeResponsively();\n                this.oldHeight = null;\n            }\n        });\n    }\n\n    useSmallLayout() {\n        this.bm.textEditor.updateGutter({indentSidebar: false});\n        this.oldHeight = this.bm.configuration.height;\n        this.bm.configuration.height = 300; // TODO: Parameterize this\n        this.bm.textEditor.resizeResponsively();\n    }\n\n    reloadToolbox(toolbox) {\n        if (toolbox === \"custom\") {\n            let customToolbox = this.main.components.fileSystem.getFile(\"?toolbox.blockpy\");\n            if (customToolbox == null) {\n                toolbox = \"empty\";\n            } else {\n                try {\n                    toolbox = JSON.parse(customToolbox.handle());\n                } catch (e) {\n                    console.error(e); // TODO: Improve error message for instructor\n                    toolbox = \"minimal\";\n                }\n            }\n        }\n        this.bm.configuration.toolbox = toolbox;\n        // TODO: Handle invalid toolbox better\n        try {\n            this.bm.blockEditor.remakeToolbox();\n        } catch (e) {\n            console.error(e);\n            this.bm.configuration.toolbox = \"empty\";\n            this.bm.blockEditor.remakeToolbox();\n        }\n    }\n\n    makePerAssignmentSubscriptions() {\n        this.main.model.display.instructor.subscribe((changed) => {\n            this.setReadOnly(this.decideIfNotEditable());\n        });\n        this.main.model.assignment.settings.onlyUploads.subscribe((changed) => {\n            this.setReadOnly(this.decideIfNotEditable());\n        });\n        this.main.model.configuration.partId.subscribe((changed) => {\n            // TODO: Handle part id changing after everything is loaded\n        });\n    }\n\n    decideIfNotEditable() {\n        let model = this.main.model;\n        return model.display.historyMode() || (\n            model.assignment.settings.onlyUploads() && !model.display.instructor()\n        );\n    }\n\n    setReadOnly(isReadOnly) {\n        this.readOnly = isReadOnly;\n        this.bm.setReadOnly(isReadOnly);\n    }\n\n    uploadFile(event) {\n        let filename = event.target.fileName;\n        let code = event.target.result;\n        if (filename.endsWith(\".ipynb\")) {\n            code = convertIpynbToPython(code);\n        }\n        this.main.components.server.logEvent(\"X-File.Upload\", \"\", \"\", code, this.filename);\n        this.file.handle(code);\n        this.main.components.engine.run();\n        // TODO: Run code\n    }\n\n    downloadFile() {\n        let result = super.downloadFile();\n        if (result.name === \"answer\" && result.extension === \".py\") {\n            result.name = sluggify(this.main.model.assignment.name());\n        }\n        result.mimetype = \"text/x-python\";\n        this.main.components.server.logEvent(\"X-File.Download\", \"\", \"\", \"\", result.name);\n        return result;\n    }\n\n}\n\nexport const PythonEditor = {\n    name: \"Python\",\n    extensions: [\".py\", \".reading\"],\n    constructor: PythonEditorView,\n    template: PYTHON_EDITOR_HTML\n};"
  },
  {
    "path": "src/editor/quiz.js",
    "content": "import {AbstractEditor} from \"./abstract_editor\";\n\nexport const QUIZ_EDITOR_HTML = `\n    <div>\n    <textarea class=\"blockpy-editor-quiz\"></textarea>\n    </div>\n`;\n\nclass QuizEditorView extends AbstractEditor {\n    constructor(main, tag) {\n        super(main, tag);\n        this.codeMirror = CodeMirror.fromTextArea(tag.find(\".blockpy-editor-quiz\")[0], {\n            showCursorWhenSelecting: true,\n            lineNumbers: true,\n            firstLineNumber: 1,\n            indentUnit: 4,\n            tabSize: 4,\n            indentWithTabs: false,\n            extraKeys: {\n                \"Tab\": \"indentMore\",\n                \"Shift-Tab\": \"indentLess\",\n                \"Esc\": function (cm) {\n                    if (cm.getOption(\"fullScreen\")) {\n                        cm.setOption(\"fullScreen\", false);\n                    } else {\n                        cm.display.input.blur();\n                    }\n                },\n                \"F11\": function (cm) {\n                    cm.setOption(\"fullScreen\", !cm.getOption(\"fullScreen\"));\n                }\n            }\n        });\n        this.dirty = false;\n    }\n\n    enter(newFilename, oldEditor) {\n        super.enter(newFilename, oldEditor);\n        this.dirty = false;\n        this.updateEditor(this.file.handle());\n        // Subscribe to the relevant File\n        this.currentSubscription = this.file.handle.subscribe(this.updateEditor.bind(this));\n        // Notify relevant file of changes to BM\n        this.currentListener = this.updateHandle.bind(this);\n        this.codeMirror.on(\"change\", this.currentListener);\n        if (oldEditor !== this) {\n            // Delay so that everything is rendered\n            setTimeout(this.codeMirror.refresh.bind(this.codeMirror), 1);\n        }\n        // TODO: update dynamically when changing instructor status\n        this.codeMirror.setOption(\"readOnly\", newFilename.startsWith(\"&\") && !this.main.model.display.instructor());\n    }\n\n    updateEditor(newContents) {\n        this.dirty = !this.dirty;\n        if (this.dirty) {\n            this.dirty = true;\n            this.codeMirror.setValue(newContents);\n            this.codeMirror.refresh();\n            this.dirty = false;\n        }\n    }\n\n    updateHandle(event) {\n        this.dirty = !this.dirty;\n        if (this.dirty) {\n            this.dirty = true;\n            this.file.handle(this.codeMirror.getValue());\n            this.dirty = false;\n        }\n    }\n\n    exit(newFilename, oldEditor, newEditor) {\n        // Remove subscriber\n        this.currentSubscription.dispose();\n        this.codeMirror.off(\"change\", this.currentListener);\n        this.codeMirror.setOption(\"readOnly\", false);\n        super.exit(newFilename, oldEditor);\n    }\n}\n\nexport const QuizEditor = {\n    name: \"Quiz\",\n    extensions: [\".quiz\"],\n    constructor: QuizEditorView,\n    template: QUIZ_EDITOR_HTML\n};"
  },
  {
    "path": "src/editor/sample_submissions.js",
    "content": "/**\n * Panel for editing the set of Sample Submissions.\n * These are not provided at all to students without the Grader role.\n */\n\nimport {AbstractEditor} from \"./abstract_editor\";\n\nexport const SubmissionStatuses = {\n    UNKNOWN: \"unknown\",\n    PASSED: \"passed\",\n    FAILED: \"failed\",\n    ERROR: \"error\",\n    SKIPPED: \"skipped\"\n};\n\nexport class SampleSubmission {\n    constructor(name, status, code) {\n        this.name = name;\n        this.status = status;\n        this.code = code;\n    }\n\n    static Blank(count) {\n        return new SampleSubmission(\"Untitled\"+(count || 1),\n                                    SubmissionStatuses.UNKNOWN, \"a=0\");\n    }\n\n    static deserialize(data) {\n        return new SampleSubmission(data.name, data.status, data.code);\n    }\n\n    serialize() {\n        return {\n            name: this.name,\n            status: this.status,\n            code: this.code\n        };\n    }\n}\n\nexport const SAMPLE_SUBMISSIONS_HTML = `\n<div>\n    <div data-bind=\"foreach: {data: assignment.sampleSubmissions}\"\n        class=\"row\">\n        <div class=\"col-md-6\">\n            <span data-bind=\"text: name\"></span>\n            <textarea class=\"blockpy-editor-sample-submissions-code\"\n                data-bind=\"codeMirrorInstance: code\"></textarea>\n        </div>\n        <div class=\"col-md-6\">\n            <span data-bind=\"text: status\"></span>        \n        </div>\n    </div>\n</div>\n`;\n\nko.bindingHandlers.codeMirrorInstance = {\n    init: function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n        // This will be called when the binding is first applied to an element\n        // Set up any initial state, event handlers, etc. here\n        console.log(\"INIT\");\n        let cm = CodeMirror.fromTextArea(element, {\n            showCursorWhenSelecting: true,\n            lineNumbers: true,\n            firstLineNumber: 1,\n            indentUnit: 4,\n            tabSize: 4,\n            indentWithTabs: false,\n            extraKeys: {\n                \"Tab\": \"indentMore\",\n                \"Shift-Tab\": \"indentLess\",\n                \"Esc\": function (cm) {\n                    if (cm.getOption(\"fullScreen\")) {\n                        cm.setOption(\"fullScreen\", false);\n                    } else {\n                        cm.display.input.blur();\n                    }\n                },\n                \"F11\": function (cm) {\n                    cm.setOption(\"fullScreen\", !cm.getOption(\"fullScreen\"));\n                }\n            }\n        });\n        cm.setSize(\"100%\", \"100px\");\n        return cm;\n    },\n    update: function(element, valueAccessor, allBindings, viewModel, bindingContext) {\n        // This will be called once when the binding is first applied to an element,\n        // and again whenever any observables/computeds that are accessed change\n        // Update the DOM element based on the supplied values here.\n        console.log(\"UPDATE\");\n    }\n};\n\nclass SampleSubmissionsView extends AbstractEditor {\n    constructor(main, tag) {\n        super(main, tag);\n        this.tag = tag;\n        this.codeMirrors = [];\n        this.dirty = false;\n    }\n\n    buildEditor(newDOM, index, newElement) {\n\n    }\n\n    rebuildEditors() {\n        console.log(\"Rebuilding editors\");\n    }\n\n    enter(newFilename, oldEditor) {\n        super.enter(newFilename, oldEditor);\n        this.dirty = false;\n        this.updateEditor(this.file.handle());\n        // Subscribe to the relevant File\n        this.currentSubscription = this.file.handle.subscribe(this.updateEditor.bind(this));\n        // Notify relevant file of changes to BM\n        this.currentListener = this.updateHandle.bind(this);\n        //this.rebuildEditors();\n        //this.codeMirror.on(\"change\", this.currentListener);\n        if (oldEditor !== this) {\n            console.log(this.tag);\n            console.log(this.tag.find(\".CodeMirror\"));\n            console.log(this.tag.find(\".CodeMirror\").map((i,cm) => console.log(\"+++\", cm.CodeMirror)));\n            this.tag.find(\".CodeMirror\").map((i, cm) => cm.CodeMirror.refresh());\n            console.log(\"REFRESH\");\n            // Delay so that everything is rendered\n            setTimeout(() => this.tag.find(\".CodeMirror\").map((i, cm) => cm.CodeMirror.refresh()), 1);\n        }\n        // TODO: update dynamically when changing instructor status\n        //this.codeMirror.setOption(\"readOnly\", newFilename.startsWith(\"&\") && !this.main.model.display.instructor());\n    }\n\n    updateEditor(newContents) {\n        this.dirty = !this.dirty;\n        if (this.dirty) {\n            this.dirty = true;\n            console.log(this.codeMirrors);\n            //this.codeMirrors.each( (i, cm) => cm.setValue(newContents.join(\"\\n\")));\n            //this.codeMirrors.each( (i, cm) => cm.refresh());\n            this.dirty = false;\n        }\n    }\n\n    updateHandle(event) {\n        this.dirty = !this.dirty;\n        if (this.dirty) {\n            this.dirty = true;\n            this.file.handle(this.codeMirrors.map(cm => cm.getValue()));\n            this.dirty = false;\n        }\n    }\n\n    exit(newFilename, oldEditor, newEditor) {\n        // Remove subscriber\n        this.currentSubscription.dispose();\n        this.codeMirrors = [];\n        //this.codeMirrors.off(\"change\", this.currentListener);\n        //this.codeMirror.setOption(\"readOnly\", false);\n        super.exit(newFilename, oldEditor);\n    }\n}\n\nexport const SampleSubmissions = {\n    name: \"Sample Submissions\",\n    extensions: [\"!sample_submissions.blockpy\"],\n    constructor: SampleSubmissionsView,\n    template: SAMPLE_SUBMISSIONS_HTML\n};\n"
  },
  {
    "path": "src/editor/tags.js",
    "content": "import {AbstractEditor} from \"./abstract_editor\";\n\nexport const TAGS_EDITOR_HTML = `\nCreate new\nImport by name\nFind by owner/course/kind\n\nTags:\n    Data:\n        Name\n        Kind\n        Level\n        Version\n        Description\n    Controls:\n        Edit\n        Remove\n        Delete \n`;\n\nclass TagsEditorView extends AbstractEditor {\n    constructor(main, tag) {\n        super(main, tag.find(\".blockpy-editor-tags\"));\n    }\n}\n\nexport const TagsEditor = {\n    name: \"Tags\",\n    extensions: [\"!tags.blockpy\"],\n    constructor: TagsEditorView,\n    template: TAGS_EDITOR_HTML\n};"
  },
  {
    "path": "src/editor/text.js",
    "content": "import {AbstractEditor} from \"./abstract_editor\";\nimport {default_header} from \"./default_header\";\n\nexport const TEXT_EDITOR_HTML = `\n    ${default_header}\n    <div>\n    <textarea class=\"blockpy-editor-text\"></textarea>\n    </div>\n`;\n\nclass TextEditorView extends AbstractEditor {\n    constructor(main, tag) {\n        super(main, tag);\n        this.codeMirror = CodeMirror.fromTextArea(tag.find(\".blockpy-editor-text\")[0], {\n            showCursorWhenSelecting: true,\n            lineNumbers: true,\n            firstLineNumber: 1,\n            indentUnit: 4,\n            tabSize: 4,\n            indentWithTabs: false,\n            extraKeys: {\n                \"Tab\": \"indentMore\",\n                \"Shift-Tab\": \"indentLess\",\n                \"Esc\": function (cm) {\n                    if (cm.getOption(\"fullScreen\")) {\n                        cm.setOption(\"fullScreen\", false);\n                    } else {\n                        cm.display.input.blur();\n                    }\n                },\n                \"F11\": function (cm) {\n                    cm.setOption(\"fullScreen\", !cm.getOption(\"fullScreen\"));\n                }\n            }\n        });\n        this.dirty = false;\n    }\n\n    enter(newFilename, oldEditor) {\n        super.enter(newFilename, oldEditor);\n        this.dirty = false;\n        this.updateEditor(this.file.handle());\n        // Subscribe to the relevant File\n        this.currentSubscription = this.file.handle.subscribe(this.updateEditor.bind(this));\n        // Notify relevant file of changes to BM\n        this.currentListener = this.updateHandle.bind(this);\n        this.codeMirror.on(\"change\", this.currentListener);\n        if (oldEditor !== this) {\n            // Delay so that everything is rendered\n            setTimeout(this.codeMirror.refresh.bind(this.codeMirror), 1);\n        }\n        // TODO: update dynamically when changing instructor status\n        this.codeMirror.setOption(\"readOnly\", newFilename.startsWith(\"&\") && !this.main.model.display.instructor());\n    }\n\n    updateEditor(newContents) {\n        this.dirty = !this.dirty;\n        if (this.dirty) {\n            this.dirty = true;\n            this.codeMirror.setValue(newContents);\n            this.codeMirror.refresh();\n            this.dirty = false;\n        }\n    }\n\n    updateHandle(event) {\n        this.dirty = !this.dirty;\n        if (this.dirty) {\n            this.dirty = true;\n            this.file.handle(this.codeMirror.getValue());\n            this.dirty = false;\n        }\n    }\n\n    exit(newFilename, oldEditor, newEditor) {\n        // Remove subscriber\n        this.currentSubscription.dispose();\n        this.codeMirror.off(\"change\", this.currentListener);\n        this.codeMirror.setOption(\"readOnly\", false);\n        super.exit(newFilename, oldEditor);\n    }\n}\n\nexport const TextEditor = {\n    name: \"Text\",\n    extensions: [\".txt\"],\n    constructor: TextEditorView,\n    template: TEXT_EDITOR_HTML\n};"
  },
  {
    "path": "src/editor/toolbox.js",
    "content": "import {AbstractEditor} from \"./abstract_editor\";\n\nexport const TOOLBOX_EDITOR_HTML = `\n    <div>\n        <div class=\"col-md-12\"\n         role=\"toolbar\" aria-label=\"Toolbox Toolbar\">\n             <div class=\"btn-group mr-2\" role=\"group\" aria-label=\"Save Group\">         \n                <button type=\"button\" class=\"btn btn-outline-secondary btn-editor-json-save\">\n                    <span class=\"fas fa-save\"></span> Save\n                 </button>\n             </div>\n         </div>\n        <textarea class=\"blockpy-editor-toolbox\"></textarea>\n    </div>\n`;\n\nclass ToolboxEditorView extends AbstractEditor {\n    constructor(main, tag) {\n        super(main, tag);\n        this.codeMirror = CodeMirror.fromTextArea(tag.find(\".blockpy-editor-toolbox\")[0], {\n            showCursorWhenSelecting: true,\n            lineNumbers: true,\n            firstLineNumber: 1,\n            indentUnit: 4,\n            tabSize: 4,\n            indentWithTabs: false,\n            mode: \"json\",\n            extraKeys: {\n                \"Tab\": \"indentMore\",\n                \"Shift-Tab\": \"indentLess\",\n                \"Esc\": function (cm) {\n                    if (cm.getOption(\"fullScreen\")) {\n                        cm.setOption(\"fullScreen\", false);\n                    } else {\n                        cm.display.input.blur();\n                    }\n                },\n                \"F11\": function (cm) {\n                    cm.setOption(\"fullScreen\", !cm.getOption(\"fullScreen\"));\n                }\n            }\n        });\n        this.dirty = false;\n    }\n\n    enter(newFilename, oldEditor) {\n        super.enter(newFilename, oldEditor);\n        this.dirty = false;\n        this.updateEditor(this.file.handle());\n        // Subscribe to the relevant File\n        this.currentSubscription = this.file.handle.subscribe(this.updateEditor.bind(this));\n        // Notify relevant file of changes to BM\n        this.currentListener = this.updateHandle.bind(this);\n        this.tag.find(\".btn-editor-json-save\").on(\"click\", this.currentListener);\n        //this.codeMirror.on(\"change\", this.currentListener);\n        if (oldEditor !== this) {\n            // Delay so that everything is rendered\n            setTimeout(this.codeMirror.refresh.bind(this.codeMirror), 1);\n        }\n        // TODO: update dynamically when changing instructor status\n        this.codeMirror.setOption(\"readOnly\", newFilename.startsWith(\"&\") && !this.main.model.display.instructor());\n\n    }\n\n    updateEditor(newContents) {\n        this.dirty = !this.dirty;\n        if (this.dirty) {\n            this.dirty = true;\n            this.codeMirror.setValue(newContents);\n            this.codeMirror.refresh();\n            this.dirty = false;\n        }\n    }\n\n    updateHandle(event) {\n        this.dirty = !this.dirty;\n        if (this.dirty) {\n            this.dirty = true;\n            this.file.handle(this.codeMirror.getValue());\n            if (this.main.model.assignment.settings.toolbox() === \"custom\") {\n                this.main.components.pythonEditor.reloadToolbox(\"custom\");\n            }\n            this.dirty = false;\n        }\n    }\n\n    exit(newFilename, oldEditor, newEditor) {\n        // Remove subscriber\n        this.currentSubscription.dispose();\n        this.tag.find(\".btn-editor-toolbox-save\").off(\"click\", this.currentListener);\n        //this.codeMirror.off(\"change\", this.currentListener);\n        this.codeMirror.setOption(\"readOnly\", false);\n        super.exit(newFilename, oldEditor);\n    }\n}\n\nexport const ToolboxEditor = {\n    name: \"Toolbox\",\n    extensions: [\"?toolbox.blockpy\"],\n    constructor: ToolboxEditorView,\n    template: TOOLBOX_EDITOR_HTML\n};"
  },
  {
    "path": "src/editors.js",
    "content": "/**\n * Editors are inferred from Filenames.\n *\n * The editor is based on the extension:\n *  .blockpy: Special editor (will be chosen by filename)\n *  .py: Python Editor\n *  .md: Markdown Editor\n *  .txt: Text Editor (also used for other types)\n *  .peml: PEML Editor\n *  .png, .gif, .jpeg, .jpg, .bmp: Image Editor\n *  .json: JSON Editor\n *  .yaml: YAML Editor\n */\n\nimport {PythonEditor} from \"./editor/python\";\nimport {TextEditor} from \"./editor/text\";\nimport {AssigmentType as AssignmentType, AssignmentSettings} from \"./editor/assignment_settings\";\nimport {TagsEditor} from \"./editor/tags\";\nimport {MarkdownEditor} from \"./editor/markdown\";\nimport {SampleSubmissions} from \"./editor/sample_submissions\";\nimport {JsonEditor} from \"./editor/json\";\nimport {ToolboxEditor} from \"./editor/toolbox\";\nimport {QuizEditor} from \"./editor/quiz\";\nimport {ImageEditor} from \"./editor/images\";\n\n/**\n * The different possible editors available\n * @enum {string}\n */\nexport let EditorsEnum = {\n    SUBMISSION: \"submission\",\n    ASSIGNMENT: \"assignment\",\n    INSTRUCTIONS: \"instructions\",\n    ON_RUN: \"on_run\",\n    ON_CHANGE: \"on_change\",\n    ON_EVAL: \"on_eval\",\n    STARTING_CODE: \"starting_code\",\n    SAMPLE_SUBMISSIONS: \"sample_submissions\",\n    INSTRUCTOR_FILE: \"instructor_file\"\n};\n\nconst SPECIAL_NAMESPACES = [\"!\", \"^\", \"?\", \"$\"];\n\nconst AVAILABLE_EDITORS = [\n    TextEditor, PythonEditor, AssignmentSettings, TagsEditor, MarkdownEditor,\n    SampleSubmissions, JsonEditor, ToolboxEditor, QuizEditor, ImageEditor\n];\n\nexport const EDITORS_HTML = AVAILABLE_EDITORS.map(editor => `\n<div class=\"blockpy-panel blockpy-editor\" \n     data-bind=\"visible: ui.editors.view().name === '${editor.name}', class: ui.editors.width\">\n    <div>\n    ${editor.template}\n    </div>\n</div>\n`\n    /*\n    `\n<!-- ko if: ui.editors.view().name === '${editor.name}' -->\n${editor.template}\n<!-- /ko -->`*/\n).join(\"\\n\");\n\nexport class Editors {\n    constructor(main, tag) {\n        this.main = main;\n        this.tag = tag;\n        this.current = null;\n        this.registered_ = [];\n        this.extensions_ = {};\n        this.byName_ = {};\n        AVAILABLE_EDITORS.forEach(editor => this.registerEditor(editor));\n        this.main.model.display.filename.subscribe(this.changeEditor, this);\n    }\n\n    registerEditor(data) {\n        let extensions = data.extensions;\n        let instance = new data.constructor(this.main, this.tag);\n        instance.name = data.name;\n        this.registered_.push(instance);\n        this.byName_[data.name.toLowerCase()] = instance;\n        for (let i=0; i < extensions.length; i++) {\n            this.extensions_[extensions[i]] = instance;\n        }\n    }\n\n    byName(name) {\n        return this.byName_[name.toLowerCase()];\n    }\n\n    changeEditor(newFilename) {\n        let oldEditor = this.current;\n        let newEditor = this.getEditor(newFilename, oldEditor);\n        if (oldEditor !== null) {\n            oldEditor.exit(newFilename, oldEditor, newEditor);\n        }\n        this.current = newEditor;\n        this.current.enter(newFilename, oldEditor);\n    }\n\n    static parseFilename(path) {\n        let space = path.charAt(0);\n        if (SPECIAL_NAMESPACES.indexOf(space) !== -1) {\n            path = path.substr(1);\n        } else {\n            space = \"\";\n        }\n        let name = path.substr(0, path.lastIndexOf(\".\"));\n        let type = path.substr(path.lastIndexOf(\".\"));\n        return {\"space\": space, \"name\": name, \"type\": type};\n    }\n\n    getEditor(path) {\n        let {space, name, type} = Editors.parseFilename(path);\n        if (type === \".blockpy\" && path in this.extensions_) {\n            return this.extensions_[path];\n        }\n        let assignmentType = this.main.model.assignment.type();\n        if (assignmentType !== AssignmentType.BLOCKPY) {\n            if (name === \"answer\" && type === \".py\") {\n                if (\".\"+assignmentType in this.extensions_) {\n                    return this.extensions_[\".\"+assignmentType];\n                } else {\n                    console.error(\"No editor registered for assignment type:\", assignmentType);\n                    return this.registered_[0];\n                }\n            }\n        }\n        if (type in this.extensions_) {\n            return this.extensions_[type];\n        } else {\n            return this.registered_[0];\n        }\n        //console.log(this.main.model.assignment.type(), space, name, type);\n    }\n\n}"
  },
  {
    "path": "src/engine/configurations.js",
    "content": "export const EMPTY_MODULE = \"let $builtinmodule = function(mod){ return mod; }\";\n\n/**\n * A container for holding settings of a particular run configuration.\n * This is the root class for all other configurations.\n */\nexport class Configuration {\n\n    constructor(main) {\n        this.main = main;\n        this.filename = null;\n        this.code = null;\n        this.sysmodules = undefined;\n    }\n\n    use(engine) {\n        // Access point for instructor data\n        this.engine = engine;\n        Sk.executionReports = this.main.model.execution.reports;\n        Sk.console = this.main.components.console;\n        Sk.queuedInput = [];\n        Sk.configure(this.getSkulptOptions());\n        // Set openFile as mechanism to read files\n        Sk.inBrowser = this.openFile.bind(this);\n        // Function to convert filenames to URLs\n        Sk.fileToURL = this.getUrlFromFilename.bind(this);\n        // Proxy requests\n        Sk.requestsGet = (url, data, timeout) => this.openURL(url, data, timeout);\n        // Configure a \"do you want to wait? prompt\"\n        Sk.timeoutHandler = (timePassed, execLimit) => {\n            if (this.main.model.assignment.settings.disableTimeout()) {\n                return null;\n            }\n            let promptMessage = this.getTimeoutPrompt(timePassed/1000 > 30);\n            let delay = prompt(promptMessage, Sk.execLimit/1000);\n            if (delay !== null || delay==0) {\n                delay = Sk.execLimit + parseInt(delay, 10) * 1000;\n                Sk.execLimit = delay;\n                Sk.execLimitFunction = () =>\n                    this.main.model.assignment.settings.disableTimeout() ? Infinity : delay;\n            }\n            return delay;\n        };\n        // Attach beforeCall\n        Sk.beforeCall = this.beforeCall.bind(this);\n        return this;\n    }\n\n    getTimeoutPrompt(longTimeout) {\n        if (longTimeout) {\n            return \"The program has taken a REALLY long time to run (30 or more seconds). You might want to cancel and check your code. Or, you can add more seconds to wait below.\";\n        } else {\n            return \"The program is taking a while to run. How many more seconds would you like to wait?\";\n        }\n    }\n\n    getSkulptOptions() {\n        return {\n            __future__: Sk.python3,\n            // import\n            read: this.importFile.bind(this),\n            // open\n            //fileopen: this.openFile.bind(this),\n            // file.write\n            filewrite: this.writeFile.bind(this),\n            // print\n            output: this.print.bind(this),\n            // input\n            inputfun: this.input.bind(this),\n            inputfunTakesPrompt: true,\n            // Media Image Proxy URL\n            imageProxy: this.getImageProxy.bind(this),\n            // TODO: Make this set by the system so we can use our own servers in practice\n            emojiProxy: (part) => `https://twemoji.maxcdn.com/v/13.1.0/svg/${part.toLowerCase()}.svg`,\n            // Whether or not to keep the globals\n            retainGlobals: true\n        };\n    }\n\n    getUrlFromFilename(filename) {\n        const found = this.main.components.fileSystem.filesToUrls[filename];\n        if (found === undefined) {\n            throw new Sk.builtin.OSError(\"File not found: \" + filename);\n        }\n        return found;\n    }\n\n    /**\n     * Used to access Skulpt built-ins. This is pretty generic, taken\n     * almost directly from the Skulpt docs.\n     *\n     * @param {String} filename - The python filename (e.g., \"os\" or \"pprint\") that will be loaded.\n     * @returns {String} The JavaScript source code of the file (weird, right?)\n     * @throws Will throw an error if the file isn't found.\n     */\n    importFile(filename) {\n        console.warn(\"Unimplemented method!\");\n        // TODO\n    };\n\n    openURL(url, data, timeout) {\n        //return new Promise((resolve, reject) => {\n        let mockUrlData = this.main.components.fileSystem.getFile(\"?mock_urls.blockpy\");\n        if (mockUrlData == null) {\n            throw (new Sk.builtin.IOError(\"Cannot access url: URL Data was not made available for this assignment\"));\n        }\n        mockUrlData = JSON.parse(mockUrlData.handle());\n        for (let filename in mockUrlData) {\n            if (mockUrlData.hasOwnProperty(filename)) {\n                for (let i=0; i < mockUrlData[filename].length; i+= 1) {\n                    if (mockUrlData[filename][i] === url) {\n                        let fileData = this.main.components.fileSystem.readFile(filename);\n                        return (fileData);\n                    }\n                }\n            }\n        }\n        //reject(new Sk.builtin.IOError(\"Cannot access url: \"+url+\" was not made available for this assignment\"));\n        throw (new Sk.builtin.IOError(\"Cannot access url: \"+url+\" was not made available for this assignment\"));\n        //});\n    }\n\n    openFile() {\n        console.warn(\"Unimplemented method!\");\n        // TODO\n    }\n\n    writeFile() {\n        console.warn(\"Unimplemented method!\");\n        // TODO\n    }\n\n    print(value) {\n        this.main.components.console.print(value);\n    }\n\n    input() {\n        console.warn(\"Unimplemented method!\");\n        // TODO\n    }\n\n    clearInput() {\n        if (this.main.model.display.clearInputs()) {\n            this.main.model.execution.input([]);\n        }\n        this.main.model.execution.inputIndex(0);\n    }\n\n    static inputMockFunction() {\n        if (Sk.queuedInput.length) {\n            return Sk.queuedInput.pop();\n        } else {\n            return \"\";\n        }\n    };\n\n    getImageProxy(url) {\n        // TODO\n        return url;\n    }\n\n    step() {\n\n    }\n\n    lastStep() {\n\n    }\n\n    isForbidden(filename) {\n        return false;\n    }\n\n    success(module) {\n        throw new Error(\"Abstract success execution\");\n    }\n\n    failure(error) {\n        throw new Error(\"Abstract failure execution\");\n    }\n\n    finally(result) {\n        // Force Pygame to stop trapping keyboard events\n        if (this.main.components.console.pygameLine) {\n            this.main.components.console.pygameLine.cleanup();\n            this.main.components.console.pygameLine.stop();\n        }\n    }\n\n    dummyOutSandbox() {\n        //Sk.builtinFiles.files[\"src/lib/pedal/sandbox/sandbox.py\"] = \"class Sandbox: pass\\ndef run(): pass\\ndef reset(): pass\\n\";\n    }\n\n    beforeCall(functionName, posargs, kwargs) {\n        //console.log(\"TRACKING CALL\", functionName, posargs, kwargs);\n        // TODO: Handle fastcall too? Check how that works in Skulpt side\n        let studentModel = this.main.model.execution.reports.student;\n        if (!(\"calls\" in studentModel)) {\n            studentModel.calls = {};\n        }\n        if (!(functionName in studentModel.calls)) {\n            studentModel.calls[functionName] = [];\n        }\n        let args = {};\n        // Get actual parameter names!!\n        for (let i=0; i < posargs.length; i+= 1) {\n            args[\"__ARG\"+i] = posargs[i];\n        }\n        if (kwargs && kwargs[0] != null) {\n            args[\"__ARGS\"] = kwargs[0];\n        }\n        if (kwargs && kwargs[1] != null) {\n            args[\"__KWARGS\"] = kwargs[1];\n        }\n        //console.log(args);\n        studentModel.calls[functionName].push(args);\n    }\n}\n\n"
  },
  {
    "path": "src/engine/eval.js",
    "content": "import {StudentConfiguration} from \"./student\";\nimport {StatusState} from \"../server\";\nimport {BlockPyTrace} from \"../trace\";\n\nexport class EvalConfiguration extends StudentConfiguration {\n    use(engine, code) {\n        // TODO: fix to be currently added line\n        this.main.model.execution.feedback.message(\"Running...\");\n        this.filename = \"answer\";\n        this.code = \"_ = \" + code;\n        Sk.afterSingleExecution = null;\n        Sk.beforeCall = null;\n\n        super.use(engine);\n\n        Sk.retainGlobals = true;\n        Sk.globals = this.main.model.execution.student.globals();\n\n        this.main.components.server.logEvent(\"X-File.Add\", \"\", \"\", code, \"evaluations\");\n        this.main.components.server.logEvent(\"Compile\", \"\", \"\", this.code, \"evaluations\");\n\n        return this;\n    }\n\n    success(module) {\n        console.log(\"Eval success\");\n        this.main.components.server.logEvent(\"X-Evaluate.Program\", \"\", \"\", \"\", \"evaluations\");\n        this.main.model.status.onExecution(StatusState.READY);\n        this.main.model.execution.student.globals(Sk.globals);\n        Sk.globals = {};\n        let report = this.main.model.execution.reports;\n        let filename = this.filename;\n        this.main.model.execution.student.results = module;\n        this.main.components.console.printValue(Sk.ffi.remapToJs(module.$d._.$r()));\n        return new Promise((resolve, reject) => {\n            //this.step(module.$d, module.$d,-1, 0, filename + \".py\");\n            this.lastStep();\n            report[\"student\"] = {\n                \"success\": true,\n                \"trace\": this.engine.executionBuffer.trace,\n                \"lines\": this.engine.executionBuffer.trace.map(x => x.line),\n                \"realLines\": this.engine.executionBuffer.trace.filter(x => !x.isDocstring).map(x => x.line),\n                \"results\": module,\n                \"output\": this.main.model.execution.output,\n                \"evaluation\": this.code,\n                \"calls\": this.main.model.execution.student.calls,\n                \"tracing\": []\n            };\n            resolve();\n        });\n    }\n\n    failure(error) {\n        console.log(\"Eval failure\", error);\n        this.main.model.status.onExecution(StatusState.FAILED);\n        let report = this.main.model.execution.reports;\n        this.main.components.server.logEvent(\"Compile.Error\", \"\", \"\", error.toString(), \"evaluations\");\n        return new Promise((resolve, reject) => {\n            report[\"student\"] = {\n                \"success\": false,\n                \"error\": error,\n                \"evaluation\": this.code,\n                \"tracing\": []\n            };\n            resolve();\n        });\n    }\n}"
  },
  {
    "path": "src/engine/instructor.js",
    "content": "import {Configuration, EMPTY_MODULE} from \"./configurations.js\";\nimport {$sk_mod_instructor} from \"../skulpt_modules/sk_mod_instructor\";\nimport {$sk_mod_coverage} from \"../skulpt_modules/coverage\";\nimport {$pedal_tracer} from \"../skulpt_modules/pedal_tracer\";\nimport {chompSpecialFile} from \"../files\";\n\nconst UTILITY_MODULE_CODE = \"var $builtinmodule = \" + $sk_mod_instructor.toString();\nconst COVERAGE_MODULE_CODE = $sk_mod_coverage;\n\nexport class InstructorConfiguration extends Configuration {\n    use(engine) {\n        super.use(engine);\n        // Instructors get 4 seconds\n        Sk.execLimitFunction = () =>\n            this.main.model.assignment.settings.disableTimeout() ? Infinity : 7000;\n        Sk.execLimit = Sk.execLimitFunction();\n        // Stepper! Executed after every statement.\n        Sk.afterSingleExecution = null; // 10 *1000\n        // Mute everything\n        this.main.model.display.mutePrinter(true);\n        // Disable input box\n        Sk.queuedInput = [];\n        // TODO Sk.inputfun = BlockPyEngine.inputMockFunction;\n        // TODO: Allow input function to disable the timer, somehow\n        // Disable the beforeCall checker unless specifically requested\n        Sk.beforeCallBackup = Sk.beforeCall;\n        Sk.beforeCall = null;\n        // Enable utility mode\n        Sk.builtinFiles.files[\"src/lib/utility/__init__.js\"] = UTILITY_MODULE_CODE;\n        Sk.builtinFiles.files[\"src/lib/coverage.py\"] = COVERAGE_MODULE_CODE;\n        // TODO: Check if this needs to be optimized\n        //const PEDAL_TRACER_MODULE_CODE = Sk.compile($pedal_tracer, \"tracer.py\", \"exec\", true, false);\n        Sk.builtinFiles.files[\"src/lib/pedal/sandbox/tracer.py\"] = $pedal_tracer;\n        delete Sk.builtinFiles.files[\"src/lib/pedal/sandbox/tracer.js\"];\n        // TODO: Mock Pedal's tracer module with the appropriate version\n        Sk.builtinFiles.files[\"./_instructor/__init__.js\"] = EMPTY_MODULE;\n        // Reuse any existing sysmodules that we previously found, but not __main__ modules\n        this.sysmodules = this.clearExistingStudentImports();\n        // Horrific hack, to prevent Tifa from caching a bad version of the students' import\n        Sk.clearExistingStudentImports = this.clearExistingStudentImports;\n        return this;\n    }\n\n    print(value) {\n        super.print(value);\n        console.info(\"Printed:\", value);\n    }\n\n    clearExistingStudentImports() {\n        let sysmodules = this.main.model.execution.instructor.sysmodules;\n        // Remove any existing __main__ modules\n        if (sysmodules !== undefined) {\n            for (let filename of this.getAllFilenames()) {\n                let skFilename = new Sk.builtin.str(filename);\n                /*if (sysmodules.quick$lookup(skFilename)) {\n                    sysmodules.pop$item(skFilename);\n                }*/\n                sysmodules.pop$item(skFilename);\n            }\n        }\n        return sysmodules;\n    }\n\n    getAllStudentFiles() {\n        const files = {\n            \"answer.py\": this.main.model.ui.files.getStudentCode()\n        };\n        // Skip special instructor files\n        this.main.model.assignment.extraInstructorFiles().forEach(file => {\n            if (!(\"!^$#\".includes(file.filename()[0]))) {\n                files[chompSpecialFile(file.filename())] = file.contents();\n            }\n        });\n        // Include normal student extra files\n        this.main.model.submission.extraFiles().forEach(file => {\n            files[file.filename()] = file.contents();\n        });\n        return files;\n    }\n\n    getAllFilenames() {\n        function clean(filename) {\n            filename = chompSpecialFile(filename);\n            if (filename.endsWith(\".py\")) {\n                filename = filename.slice(0, -3);\n            }\n            return filename;\n        }\n        return [\n            \"__main__\",\n            \"_instructor\",\n            ...this.main.model.assignment.extraInstructorFiles().map(file => \"_instructor.\" + clean(file.filename())),\n            ...this.main.model.submission.extraFiles().map(file => clean(file.filename())),\n        ];\n    }\n\n    getTimeoutPrompt(longTimeout) {\n        if (longTimeout) {\n            return \"The instructor code has taken a REALLY long time to check your code (30 or more seconds). You might want to cancel and check your code (or get help from an instructor). Or, you can add more seconds to wait below.\";\n        } else {\n            return \"The instructor code is taking a little while to check your code; it might just need a little more time. How many more seconds would you like to wait?\";\n        }\n    }\n\n    openFile(filename) {\n        let found = this.main.components.fileSystem.searchForFile(filename, false);\n        if (found === undefined) {\n            throw new Sk.builtin.OSError(\"File not found: \"+filename);\n        } else {\n            return found.contents();\n        }\n    }\n\n    openURL(url, data, timeout) {\n        // TODO: Figure out why parameters are misaligned..?\n        if (data.v === \"OPENAI\") {\n            return this.main.components.server.openaiProxy(timeout.v);\n        } else {\n            return super.openURL(url, data, timeout);\n        }\n    }\n\n    importFile(filename) {\n        if (filename === \"./answer.py\") {\n            return this.main.model.submission.code();\n        } else if (filename === \"./_instructor/on_run.py\") {\n            return this.main.model.assignment.onRun();\n        } else if (filename === \"./_instructor/on_eval.py\") {\n            return this.main.model.assignment.onEval() || \"\";\n        } else if (filename === \"./_instructor/__init__.js\") {\n            return EMPTY_MODULE;\n        } else if (Sk.builtinFiles === undefined) {\n            throw new Sk.builtin.OSError(\"Built-in modules not accessible.\");\n        } else if (Sk.builtinFiles[\"files\"][filename] !== undefined) {\n            return Sk.builtinFiles[\"files\"][filename];\n        } else {\n            let found = this.main.components.fileSystem.searchForFile(filename, false);\n            if (found === undefined) {\n                throw new Sk.builtin.OSError(\"File not found: '\"+filename + \"'\");\n            } else {\n                return found.contents();\n            }\n        }\n    };\n\n    input(promptMessage) {\n        //return \"ApplePie\";\n        console.log(\">>>\", this.main.model.execution.input(), this.main.model.execution.inputIndex());\n        if (this.main.model.execution.inputIndex() < this.main.model.execution.input().length) {\n            let inputIndex = this.main.model.execution.inputIndex();\n            let nextInput = this.main.model.execution.input()[inputIndex];\n            this.main.model.execution.inputIndex(inputIndex+1);\n            return nextInput;\n        } else {\n            return \"ApplePie\";\n        }\n        /*return new Promise((resolve) => {\n            resolve(Sk.queuedInput.pop());\n        });*/\n    }\n\n    beforeCall(functionName, posargs, kwargs) {\n        let studentModel = this.main.model.execution.reports.student;\n        //console.log(\"HEY INSTRUCTOR CALL\", functionName, studentModel.tracing);\n        if (studentModel.tracing && studentModel.tracing.length) {\n            super.beforeCall(functionName, posargs, kwargs);\n        }\n    }\n\n}"
  },
  {
    "path": "src/engine/on_change.js",
    "content": "import {InstructorConfiguration} from \"./instructor\";\n\nexport class OnChangeConfiguration extends InstructorConfiguration {\n    use(engine) {\n        super.use(engine);\n        this.filename = \"on_change.py\";\n        this.code = this.main.model.assignment.onChange();\n\n        clearTimeout(this.main.model.display.triggerOnChange);\n\n        return this;\n    }\n}"
  },
  {
    "path": "src/engine/on_eval.js",
    "content": "import {InstructorConfiguration} from \"./instructor\";\nimport {StatusState} from \"../server\";\nimport {findActualInstructorOffset, INSTRUCTOR_MARKER, NEW_LINE_REGEX} from \"./on_run\";\nimport {indent} from \"../utilities\";\n\n/**\n * @return {string}\n */\nexport const WRAP_INSTRUCTOR_CODE = function (studentCode, instructorCode, quick, isSafe) {\n    let safeCode = JSON.stringify(studentCode);\n\n    return `\nfrom utility import *\n\n# Load in some commonly used tools\nfrom pedal.cait.cait_api import parse_program\nfrom pedal.sandbox.commands import *\nfrom pedal.core.commands import *\n\n# Backup the feedback\non_run_feedback = []\nfor feedback in MAIN_REPORT.feedback:\n    on_run_feedback.append(feedback)\nMAIN_REPORT.feedback.clear()\n\nfrom pedal.environments.blockpy import setup_environment\n# Add in evaluated stuff from last time\nstudent = get_sandbox()\n# TODO: What about new inputs since we last ran/evaled?\n# MAIN_REPORT.submission.files['evaluation'] = ${safeCode}\nevaluate(${safeCode}['evaluation'])\n\n# TODO: Refactor resolver to return instructions\n# Monkey-patch questions\n#from pedal import questions\n#questions.show_question = set_instructions\n\n${INSTRUCTOR_MARKER}\n${instructorCode}\n\n# Resolve everything\nfrom pedal.resolvers.simple import resolve\nfinal = resolve()\nSUCCESS = final.success\nSCORE = final.score\nCATEGORY = final.category\nLABEL = final.title\nMESSAGE = final.message\nDATA = final.data\nHIDE = final.hide_correctness\n\n# Handle questions\nif final.instructions:\n    set_instructions(final.instructions[-1].message)\n    \n# Handle positive feedback\nPOSITIVE = []\nfor positive in final.positives:\n    message = positive.message\n    if not positive:\n        message = positive.else_message\n    POSITIVE.append({\n        \"title\": positive.title,\n        \"label\": positive.label,\n        \"message\": message\n    })\n    \n# Handle system messages\nfor system in final.systems:\n    if system.label == 'log':\n        console_log(system.title, system.message);\n    if system.label == 'debug':\n        console_debug(system.title, system.message);\n\n`;\n};\n\nexport class OnEvalConfiguration extends InstructorConfiguration {\n    use(engine) {\n        super.use(engine);\n        this.filename = \"_instructor.on_eval\";\n        this.code = this.main.model.assignment.onEval() || \"\";\n\n        let disableTifa = this.main.model.assignment.settings.disableTifa();\n\n        let report = this.main.model.execution.reports;\n        //let studentCodeSafe = this.main.model.execution.reports.student.evaluation || \"None\";\n        let studentFiles = this.getAllStudentFiles();\n        studentFiles[\"evaluation\"] = this.main.model.execution.reports.student.evaluation || \"None\";\n        this.dummyOutSandbox();\n        let instructorCode = this.code;\n        let isSafe = !report[\"parser\"].empty && report[\"verifier\"].success;\n        instructorCode = WRAP_INSTRUCTOR_CODE(studentFiles, instructorCode, disableTifa, isSafe);\n        console.log(\">>>\", instructorCode);\n        let lineOffset = findActualInstructorOffset(instructorCode); //instructorCode.split(NEW_LINE_REGEX).length;\n        report[\"instructor\"] = {\n            \"compliments\": [],\n            \"filename\": \"./_instructor/on_eval.py\",\n            \"code\": instructorCode,\n            \"lineOffset\": lineOffset\n            //'complete': false // Actually, let's use undefined for now.\n        };\n        this.code = instructorCode;\n\n        super.use(engine);\n\n        //Sk.retainGlobals = false;\n        Sk.globals = this.main.model.execution.instructor.globals;\n\n        return this;\n    }\n\n    success(module) {\n        console.log(\"OnEval success\");\n        // TODO: Actually parse results\n        this.main.model.execution.instructor.globals = Sk.globals;\n        this.main.model.execution.instructor.sysmodules = Sk.sysmodules;\n        console.log(module);\n        let results = module.$d.on_eval.$d;\n        console.log(module.$d);\n        this.main.components.feedback.presentFeedback(results);\n        this.main.model.execution.reports[\"instructor\"][\"success\"] = true;\n        let success = Sk.ffi.remapToJs(results.SUCCESS);\n        this.main.model.submission.correct(success || this.main.model.submission.correct());\n        // Cannot exceed 1 point, cannot go below 0 points\n        let score = Sk.ffi.remapToJs(results.SCORE);\n        score = Math.max(0.0, Math.min(1.0, score));\n        let oldScore = this.main.model.submission.score();\n        this.main.model.submission.score(Math.max(oldScore, score));\n        // Hide status\n        let hide = Sk.ffi.remapToJs(results.HIDE);\n        // And fire the result!\n        this.main.components.server.updateSubmission(score, success, hide, false);\n        this.main.model.status.onExecution(StatusState.READY);\n        //after(module);\n\n        /*if (success && this.main.model.configuration.callbacks.success) {\n            this.main.model.configuration.callbacks.success(this.main.model.assignment.id());\n        }*/\n\n        if (!Sk.executionReports.instructor.scrolling) {\n            try {\n                this.main.components.console.scrollToBottom();\n            } catch (e) {\n            }\n        }\n    }\n\n    failure(error) {\n        console.log(\"OnEval failure\", error);\n        let report = this.main.model.execution.reports;\n        if (error.tp$name === \"GracefulExit\") {\n            report[\"instructor\"][\"success\"] = true;\n            this.main.model.status.onExecution(StatusState.READY);\n        } else {\n            this.main.model.status.onExecution(StatusState.FAILED);\n            //console.log(report[\"instructor\"][\"code\"]);\n            this.main.components.feedback.presentInternalError(error, this.filename);\n            //report[\"instructor\"][\"success\"] = false;\n            //report[\"instructor\"][\"error\"] = error;\n            //TODO: report[\"instructor\"][\"line_offset\"] = lineOffset;\n        }\n        //TODO: after(error);\n    }\n}"
  },
  {
    "path": "src/engine/on_run.js",
    "content": "import {indent} from \"../utilities\";\nimport {StatusState} from \"../server\";\nimport {InstructorConfiguration} from \"./instructor\";\n\nexport function findActualInstructorOffset(instructorCode) {\n    const index = instructorCode.indexOf(INSTRUCTOR_MARKER);\n    const before = instructorCode.slice(0, index);\n    const match = before.match(NEW_LINE_REGEX);\n    return match ? (1+match.length) : 0;\n}\n\nexport const INSTRUCTOR_MARKER = \"###Run the actual instructor code###\";\nexport const NEW_LINE_REGEX = /\\n/g;\n/**\n * @return {string}\n */\nexport const WRAP_INSTRUCTOR_CODE = function (studentFiles, instructorCode, quick, isSafe) {\n    let safeCode = JSON.stringify(studentFiles);\n    let skip_tifa = quick ? \"True\": \"False\";\n\n    // TODO: Add in Sk.queuedInput to be passed in\n\n    return `\n# Support our sysmodules hack by clearing out any lingering old data\nfrom pedal.core.report import MAIN_REPORT\nMAIN_REPORT.clear()\n\nfrom bakery import student_tests\nstudent_tests.reset()\n\nfrom utility import *\n\n# Load in some commonly used tools\nfrom pedal.cait.cait_api import parse_program\nfrom pedal.sandbox.commands import *\nfrom pedal.core.commands import *\n\nfrom pedal.environments.blockpy import setup_environment\n# Do we execute student's code?\nskip_run = get_model_info('assignment.settings.disableInstructorRun')\ninputs = None if skip_run else get_model_info('execution.input')\n\n# Set the seed to the submission ID by default?\nfrom pedal.questions import set_seed\nset_seed(str(get_model_info(\"submission.id\")))\n\n# Initialize the BlockPy environment\npedal = setup_environment(skip_tifa=${skip_tifa},\n                          skip_run=skip_run,\n                          inputs=inputs,\n                          main_file='answer.py',\n                          files=${safeCode})\nstudent = pedal.fields['student']\n\n# TODO: Refactor resolver to return instructions\n# Monkey-patch questions\n#from pedal import questions\n#questions.show_question = set_instructions\n\n${INSTRUCTOR_MARKER}\n${instructorCode}\n\n# Resolve everything\nfrom pedal.resolvers.simple import resolve\nfinal = resolve()\nSUCCESS = final.success\nSCORE = final.score\nCATEGORY = final.category\nLABEL = final.title\nMESSAGE = final.message\nDATA = final.data\nHIDE = final.hide_correctness\n\n# Handle questions\nif final.instructions:\n    set_instructions(final.instructions[-1].message)\n    \n# Handle positive feedback\nPOSITIVE = []\nfor positive in final.positives:\n    message = positive.message\n    if not positive:\n        message = positive.else_message\n    POSITIVE.append({\n        \"title\": positive.title,\n        \"label\": positive.label,\n        \"message\": message\n    })\n    \n# Handle system messages\nfor system in final.systems:\n    if system.label == 'log':\n        console_log(system.title, system.message);\n    if system.label == 'debug':\n        console_debug(system.title, system.message);\n\n`;\n};\n\nexport class OnRunConfiguration extends InstructorConfiguration {\n    use(engine) {\n        super.use(engine);\n        this.filename = \"_instructor.on_run\";\n        this.code = this.main.model.assignment.onRun();\n\n        let disableTifa = this.main.model.assignment.settings.disableTifa();\n        // Put the input index back to the front, so we can replay inputs\n        this.main.model.execution.inputIndex(1);\n\n        let report = this.main.model.execution.reports;\n        //let studentCodeSafe = this.main.model.submission.code();\n        let studentFiles = this.getAllStudentFiles();\n        this.dummyOutSandbox();\n        let instructorCode = this.code;\n        let isSafe = !report[\"parser\"].empty && report[\"verifier\"].success;\n        instructorCode = WRAP_INSTRUCTOR_CODE(studentFiles, instructorCode, disableTifa, isSafe);\n        let lineOffset = findActualInstructorOffset(instructorCode); //instructorCode.split(NEW_LINE_REGEX).length;\n        //lineOffset = 0; //instructorCode.split(NEW_LINE_REGEX).length - lineOffset - 4;\n        report[\"instructor\"] = {\n            \"compliments\": [],\n            \"filename\": \"./_instructor/on_run.py\",\n            \"code\": instructorCode,\n            \"lineOffset\": lineOffset\n            //'complete': false // Actually, let's use undefined for now.\n        };\n        /*\n        TODO: Interesting situation. If you have an instructor-file (not a student-file),\n        then it gets imported into sysmodules as `_instructor.MODULE_NAME`. But the instructor\n        script will attempt to import it as `MODULE_NAME`, and fail. UNLESS the *student* has\n        previously imported that module successfully. So there's a common case here where the\n        students' code fails to import the module THEREBY breaking the instructor code.\n         */\n\n        this.code = instructorCode;\n\n        Sk.retainGlobals = false;\n\n        return this;\n    }\n\n    success(module) {\n        // TODO Logging!!!!\n        //console.log(\"OnRun success\");\n        // TODO: Actually parse results\n        this.main.model.execution.instructor.globals = Sk.globals;\n        this.main.model.execution.instructor.sysmodules = Sk.sysmodules;\n        Sk.globals = {};\n        let results = module.$d.on_run.$d;\n        this.main.components.feedback.presentFeedback(results);\n        this.main.model.execution.reports[\"instructor\"][\"success\"] = true;\n        let success = Sk.ffi.remapToJs(results.SUCCESS);\n        this.main.model.submission.correct(success || this.main.model.submission.correct());\n        // Cannot exceed 1 point, cannot go below 0 points\n        let score = Sk.ffi.remapToJs(results.SCORE);\n        score = Math.max(0, Math.min(1, score));\n        let oldScore = this.main.model.submission.score();\n        score = Math.max(oldScore, score);\n        this.main.model.submission.score(score);\n        // Hide status\n        let hide = Sk.ffi.remapToJs(results.HIDE);\n        // And fire the result!\n        this.main.components.server.updateSubmission(score, success, hide, false);\n        this.main.model.status.onExecution(StatusState.READY);\n        //after(module);\n\n        /*if (success && this.main.model.configuration.callbacks.success) {\n            this.main.model.configuration.callbacks.success(this.main.model.assignment.id());\n        }*/\n\n        if (!Sk.executionReports.instructor.scrolling) {\n            try {\n                this.main.components.console.scrollToBottom();\n            } catch (e) {\n            }\n        }\n    }\n\n    failure(error) {\n        console.error(\"OnRun failure\", error);\n        let report = this.main.model.execution.reports;\n        if (error.tp$name === \"GracefulExit\") {\n            report[\"instructor\"][\"success\"] = true;\n            this.main.model.status.onExecution(StatusState.READY);\n        } else {\n            this.main.model.status.onExecution(StatusState.FAILED);\n            //console.log(report[\"instructor\"][\"code\"]);\n            this.main.components.feedback.presentInternalError(error, this.filename);\n            //report[\"instructor\"][\"success\"] = false;\n            //report[\"instructor\"][\"error\"] = error;\n            //TODO: report[\"instructor\"][\"line_offset\"] = lineOffset;\n        }\n        //TODO: after(error);\n    }\n}\n\n\n/*\n# The following is the old instructor code, leaving it here for now.\n\nfrom pedal.core.report import MAIN_REPORT\n# Support our sysmodules hack by clearing out any lingering old data\nMAIN_REPORT.clear()\nfrom pedal.core.commands import contextualize_report\ncontextualize_report(${safeCode}, \"answer.py\")\n${tifaAnalysis}\nfrom pedal.sandbox.sandbox import Sandbox\nfrom pedal.sandbox import compatibility\nfrom utility import *\nstudent = MAIN_REPORT['sandbox']['run'] = Sandbox()\nstudent.report_exceptions_mode = True\nlog(get_model_info('execution.input'))\nstudent.set_input(get_model_info('execution.input'))\nif not get_model_info('assignment.settings.disableInstructorRun'):\n    compatibility.run_student(raise_exceptions=False)\n#log(student.data)\n#student = get_student_data()\n#error, position = get_student_error()\n#compatibility.raise_exception(error, position)\nrun_student = compatibility.run_student\nreset_output = compatibility.reset_output\nqueue_input = compatibility.queue_input\nget_output = compatibility.get_output\nget_plots = compatibility.get_plots\ncompatibility.trace_lines = trace_lines\nfrom pedal import questions\nquestions.show_question = set_instructions\n# TODO: Remove the need for this hack!\ndef capture_output(func, *args):\n   reset_output()\n   student.call(func.__name__, *args)\n   return get_output()\ncompatibility.capture_output = capture_output\n\nfrom pedal.cait.cait_api import parse_program\n${instructorCode}\nfrom pedal.resolvers import simple\nfinal = simple.resolve()\nSUCCESS = final.success\nSCORE = final.score\nCATEGORY = final.category\nLABEL = final.title\nMESSAGE = final.message\nDATA = final.data\nHIDE = final.hide_correctness\n\n */"
  },
  {
    "path": "src/engine/on_sample.js",
    "content": "import {OnRunConfiguration} from \"./on_run\";\n\nexport class OnSampleConfiguration extends OnRunConfiguration {\n    use(engine) {\n        super.use(engine);\n        this.filename = \"on_run.py\";\n        this.code = this.main.model.assignment.onRun();\n\n        return this;\n    }\n}"
  },
  {
    "path": "src/engine/run.js",
    "content": "import {StudentConfiguration} from \"./student\";\nimport {StatusState} from \"../server\";\n\nexport class RunConfiguration extends StudentConfiguration {\n    use(engine) {\n        this.main.model.execution.feedback.message(\"Running...\");\n        this.filename = \"answer\";\n        this.code = this.main.model.ui.files.getStudentCode();\n        if (this.main.model.assignment.settings.disableStudentRun()) {\n            this.code = \"\";\n        }\n        //this.code = this.main.model.submission.code();\n        this.main.components.server.saveFile(\"answer.py\", this.main.model.submission.code(), null);\n        this.main.components.server.logEvent(\"Compile\", \"\", \"\", \"\", \"answer.py\");\n        //console.log(this.code);\n        super.use(engine);\n\n        engine.reset();\n        this.updateParse();\n\n        this.main.model.execution.reports[\"verifier\"] = {\n            \"success\": Boolean(this.code.trim()),\n            \"code\": this.code\n        };\n\n        if (typeof Sk.environ == \"undefined\") {\n            Sk.environ = new Sk.builtin.dict();\n        }\n        const printerTag = this.main.components.console.printerTag,\n            width = printerTag.width()-50,\n            height = Math.max(300, printerTag.height()-50);\n        Sk.environ.set$item(new Sk.builtin.str(\"DESIGNER_WINDOW_WIDTH\"), new Sk.builtin.int_(Math.round(width)));\n        Sk.environ.set$item(new Sk.builtin.str(\"DESIGNER_WINDOW_HEIGHT\"), new Sk.builtin.int_(Math.round(height)));\n\n        Sk.retainGlobals = false;\n\n        this.clearInput();\n\n        return this;\n    }\n\n    success(module) {\n        console.log(\"Run success\");\n        let message = {\n            \"inputs\": this.main.model.execution.input().join(\"\\n\"),\n            \"outputs\": this.main.model.execution.output().map(line => line.content).join(\"\\n\"),\n        };\n        this.main.components.server.logEvent(\"Run.Program\", \"\", \"\", JSON.stringify(message), \"answer.py\");\n        this.main.model.display.dirtySubmission(false);\n        this.main.components.console.finishTurtles();\n        this.main.model.status.onExecution(StatusState.READY);\n        this.main.model.execution.student.globals(Sk.globals);\n        Sk.globals = {};\n        let report = this.main.model.execution.reports;\n        let filename = this.filename;\n        this.main.model.execution.student.results = module;\n        if (!this.main.model.assignment.settings.hideEvaluate()) {\n            this.main.components.console.beginEval();\n        }\n        return new Promise((resolve, reject) => {\n            this.step(module.$d, module.$d,-1, 0, filename + \".py\");\n            this.lastStep();\n            report[\"student\"] = {\n                \"success\": true,\n                \"trace\": this.engine.executionBuffer.trace,\n                \"lines\": this.engine.executionBuffer.trace.map(x => x.line),\n                \"realLines\": this.engine.executionBuffer.trace.filter(x => !x.isDocstring).map(x => x.line),\n                \"results\": module,\n                \"output\": this.main.model.execution.output,\n                \"input\": this.main.model.execution.input,\n                \"calls\": this.main.model.execution.student.calls,\n                \"tracing\": []\n            };\n            resolve();\n        });\n    }\n\n    failure(error) {\n        console.error(\"Run failure\", error);\n        this.main.model.status.onExecution(StatusState.FAILED);\n        let report = this.main.model.execution.reports;\n        if (report.parser.success && report.verifier.success) {\n            this.main.components.server.logEvent(\"Compile.Error\", \"\", \"\", error.toString(), \"answer.py\");\n        } else {\n            this.main.components.server.logEvent(\"Run.Program\", \"ProgramErrorOutput\", \"\", error.toString(), \"answer.py\");\n        }\n        this.lastStep();\n        return new Promise((resolve, reject) => {\n            report[\"student\"] = {\n                \"success\": false,\n                \"error\": error,\n                \"trace\": this.engine.executionBuffer.trace,\n                \"lines\": this.engine.executionBuffer.trace.map(x => x.line),\n                \"realLines\": this.engine.executionBuffer.trace.filter(x => !x.isDocstring).map(x => x.line),\n                \"input\": this.main.model.execution.input,\n                \"calls\": this.main.model.execution.student.calls,\n                \"tracing\": []\n            };\n            resolve();\n        });\n    }\n}"
  },
  {
    "path": "src/engine/sample.js",
    "content": "import {StudentConfiguration} from \"./student\";\n\nexport class SampleConfiguration extends StudentConfiguration {\n    use(engine) {\n        super.use(engine);\n        // TODO: Fix to be the current sample submission\n        this.filename = \"answer.py\";\n        this.code = \"print('Not ready yet!')\";\n\n        return this;\n    }\n}"
  },
  {
    "path": "src/engine/student.js",
    "content": "import {Configuration, EMPTY_MODULE} from \"./configurations\";\n\nexport class StudentConfiguration extends Configuration {\n    use(engine) {\n        super.use(engine);\n        // Limit execution to 4 seconds\n        let settings = this.main.model.settings;\n        Sk.execLimitFunction = () =>\n            this.main.model.assignment.settings.disableTimeout() ? Infinity : 5000;\n        Sk.execLimit = Sk.execLimitFunction();\n        // Stepper! Executed after every statement.\n        Sk.afterSingleExecution = this.step.bind(this);\n\n        // Unmute everything\n        this.main.model.display.mutePrinter(false);\n\n        // Function to call after each step\n        // afterSingleExecution\n\n        Sk.builtinFiles.files[\"src/lib/utility/__init__.js\"] = EMPTY_MODULE;\n\n        return this;\n    }\n\n    openFile(filename) {\n        let found = this.main.components.fileSystem.searchForFile(filename, true);\n        //console.log(filename, found);\n        if (found === undefined) {\n            if (Sk.builtinFiles && Sk.builtinFiles[\"files\"][filename] !== undefined) {\n                return Sk.builtinFiles[\"files\"][filename];\n            } else {\n                throw new Sk.builtin.OSError(\"File not found: \" + filename);\n            }\n        } else {\n            return found.contents();\n        }\n    }\n\n    importFile(filename) {\n        if (this.isForbidden(filename)) {\n            throw \"File not accessible: '\" + filename + \"'\";\n        } else if (filename === \"./answer.py\") {\n            return this.main.model.submission.code();\n        } else if (Sk.builtinFiles === undefined) {\n            throw new Sk.builtin.OSError(\"Built-in modules not accessible.\");\n        } else if (Sk.builtinFiles[\"files\"][filename] !== undefined) {\n            return Sk.builtinFiles[\"files\"][filename];\n        } else {\n            let found = this.main.components.fileSystem.searchForFile(filename, true);\n            if (found === undefined) {\n                throw new Sk.builtin.OSError(\"File not found: '\"+filename + \"'\");\n            } else {\n                return found.contents();\n            }\n        }\n    }\n\n    input(promptMessage) {\n        return this.main.components.console.input(promptMessage);\n    }\n\n    isForbidden(filename) {\n        return filename.startsWith(\"src/lib/utility/\") ||\n            filename.startsWith(\"src/lib/pedal/\") ||\n            filename.startsWith(\"./_instructor/\");\n    }\n\n    /**\n     * \"Steps\" the execution of the code, meant to be used as a callback to the Skulpt\n     * environment.\n     *\n     * @param {Object} globals - Hash that maps the names of global variables (Strings) to their Skulpt representation.\n     * @param {Object} locals - Hash that maps the names of local variables (Strings) to their Skulpt representation.\n     * @param {Number} lineNumber - The corresponding line number in the source code that is being executed.\n     * @param {Number} columnNumber - The corresponding column number in the source code that is being executed.\n     *                                Think of it as the \"X\" position to the lineNumber's \"Y\" position.\n     * @param {String} filename - The name of the python file being executed (e.g., \"__main__.py\").\n     * @param {Boolean} isDocstring - Whether or not this is an actual line or a docstring.\n     */\n    step(globals, locals, lineNumber, columnNumber, filename, isDocstring, astName) {\n        if (filename === \"answer.py\") {\n            /*if (execStack) {\n                console.log(execStack.map(([n, o]) => [n, {...o}]));\n            }*/\n            let currentStep = this.engine.executionBuffer.step;\n            globals = this.main.components.trace.parseGlobals({...globals, ...locals});\n            // TODO: Trace local variables properly\n            //let locals = this.main.components.trace.parseGlobals(locals);\n            //Object.assign(globals, locals);\n            this.engine.executionBuffer.trace.push({\n                \"step\": currentStep,\n                \"filename\": filename,\n                //'block': highlightMap[lineNumber-1],\n                \"line\": lineNumber,\n                \"column\": columnNumber,\n                \"properties\": globals.properties,\n                \"modules\": globals.modules,\n                \"isDocstring\": isDocstring,\n                \"ast\": astName\n            });\n            this.engine.executionBuffer.step = currentStep + 1;\n            this.engine.executionBuffer.line = lineNumber;\n        }\n    };\n\n\n\n    /**\n     * Called at the end of the Skulpt execution to terminate the executionBuffer\n     * and hand it off to the execution trace in the model.\n     */\n    lastStep() {\n        let execution = this.main.model.execution;\n        execution.student.currentTraceData(this.engine.executionBuffer.trace);\n        execution.student.currentStep(this.engine.executionBuffer.step);\n        execution.student.lastStep(this.engine.executionBuffer.step);\n        execution.student.currentLine(this.engine.executionBuffer.line);\n        execution.student.lastLine(this.engine.executionBuffer.line);\n        execution.student.currentTraceStep(this.engine.executionBuffer.step);\n    };\n\n    getLines(ast) {\n        let visitedLines = new Set();\n        let visitBody = (node) => {\n            if (node.lineno !== undefined) {\n                visitedLines.add(node.lineno);\n            }\n            if (node.body) {\n                node.body.forEach((statement) => visitBody(statement));\n            }\n            if (node.orelse) {\n                node.orelse.forEach((statement) => visitBody(statement));\n            }\n            if (node.finalbody) {\n                node.finalbody.forEach((statement) => visitBody(statement));\n            }\n        };\n        visitBody(ast);\n        return Array.from(visitedLines);\n    }\n\n    /**\n     * Ensure that the parse information is up-to-date\n     */\n    updateParse() {\n        let report = this.main.model.execution.reports;\n        // Hold all the actually discovered lines from the parse\n        let lines = [];\n        // Attempt a parse\n        let ast;\n        try {\n            let parse = Sk.parse(this.filename, this.code);\n            ast = Sk.astFromParse(parse.cst, this.filename, parse.flags);\n            lines = this.getLines(ast);\n        } catch (error) {\n            // Report the error\n            report[\"parser\"] = {\n                \"success\": false,\n                \"error\": error,\n                \"empty\": true,\n                \"lines\": lines\n            };\n            console.error(error);\n            console.log(this.filename, this.code);\n            return false;\n        }\n        // Successful parse\n        report[\"parser\"] = {\n            \"success\": true,\n            \"ast\": ast,\n            \"empty\": ast.body.length === 0,\n            \"lines\": lines\n        };\n        return true;\n    }\n\n    showErrors() {\n        let report = this.main.model.execution.reports;\n        if (report[\"student\"].success) {\n            this.main.components.feedback.clear(\"Execution finished. No errors to report.\");\n        } else {\n            this.main.components.feedback.presentRunError(report.student.error);\n        }\n    }\n\n    provideSecretError() {\n        let report = this.main.model.execution.reports;\n        let feedback = this.main.components.feedback;\n        if (!report[\"student\"].success) {\n            let errorButton = this.main.model.configuration.container.find(\".blockpy-student-error\");\n            let message = feedback.presentRunError(report.student.error, true);\n            errorButton.attr(\"title\", \"Click to see Original Error\");\n            errorButton.tooltip({\"trigger\": \"hover\", \"container\": this.main.model.configuration.attachmentPoint});\n            errorButton.click(() => this.main.components.dialog.ERROR_SHOW_STUDENT_ERROR(message));\n            errorButton.show();\n        }\n    }\n}"
  },
  {
    "path": "src/engine.js",
    "content": "import {StatusState} from \"./server\";\nimport {OnRunConfiguration} from \"./engine/on_run\";\nimport {RunConfiguration} from \"./engine/run\";\nimport {EvalConfiguration} from \"./engine/eval\";\nimport {SampleConfiguration} from \"./engine/sample\";\nimport {OnChangeConfiguration} from \"./engine/on_change\";\nimport {OnEvalConfiguration} from \"./engine/on_eval\";\nimport {OnSampleConfiguration} from \"./engine/on_sample\";\n\n/**\n * An object for executing Python code and passing the results along to interested components.\n *\n * Interesting components:\n *  Execution Buffer: Responsible for collecting the trace during program execution.\n *                    This prevents Knockoutjs from updating the editor during execution.\n *\n * @constructor\n * @this {BlockPyEditor}\n * @param {Object} main - The main BlockPy instance\n * @param {HTMLElement} tag - The HTML object this is attached to.\n */\nexport class BlockPyEngine {\n    constructor(main) {\n        this.main = main;\n        this.executionModel = this.main.model.execution;\n\n        this.configurations = {\n            run: new RunConfiguration(main),\n            eval: new EvalConfiguration(main),\n            onRun: new OnRunConfiguration(main),\n            onChange: new OnChangeConfiguration(main),\n            onEval: new OnEvalConfiguration(main)\n        };\n\n        // Preconfigure skulpt so we can parse\n        Sk.configure(this.configurations.run.getSkulptOptions());\n\n        // Keeps track of the tracing while the program is executing\n        this.executionBuffer = {};\n\n        /**\n         * Definable function to be run when execution has fully ended,\n         * whether it succeeds or fails.\n         */\n        this.onExecutionBegin = null;\n        this.onExecutionEnd = null;\n    }\n\n    /**\n     * Reset reports\n     */\n    resetReports() {\n        let report = this.executionModel.reports;\n        report[\"verifier\"] = {};\n        report[\"parser\"] = {};\n        report[\"student\"] = {};\n        report[\"instructor\"] = {};\n        report[\"model\"] = this.main.model;\n    };\n\n    resetStudentModel() {\n        let student = this.executionModel.student;\n        student.calls = {};\n        student.currentStep(null);\n        student.currentTraceStep(0);\n        student.lastStep(0);\n        student.currentLine(null);\n        student.currentTraceData.removeAll();\n        student.results = null;\n        student.tracing = [];\n    }\n\n    resetExecutionBuffer() {\n        this.executionBuffer = {\n            \"trace\": [],\n            \"step\": 0,\n            \"line\": 0,\n        };\n    };\n\n    /**\n     * Remove all interface aspects of the previous Run.\n     */\n    reset() {\n        // TODO: Clear out any coverage/trace/error highlights in editors\n        // Reset execution in model\n        this.resetStudentModel();\n        // Get reports ready\n        this.resetReports();\n        // Clear out the execution buffer\n        this.resetExecutionBuffer();\n        // Clear out the console of printed stuff\n        this.main.components.console.clear();\n        // Clear out any old feedback\n        this.main.components.feedback.clear();\n    }\n\n    delayedRun(disableFeedback=false) {\n        //this.main.model.status.onExecution(StatusState.ACTIVE);\n        //$(\".blockpy-run\").addClass(\"blockpy-run-running\");\n        this.run(disableFeedback);\n        //setTimeout(this.run.bind(this), 1);\n    }\n\n    stop() {\n\n    }\n\n    run(disableFeedback=false) {\n        this.configuration = this.configurations.run.use(this);\n        let execution = this.execute().then(\n            this.configuration.success.bind(this.configuration),\n            this.configuration.failure.bind(this.configuration)\n        );\n        if (!this.main.model.assignment.settings.disableFeedback() && !disableFeedback) {\n            execution.then(() => {\n                this.configuration.provideSecretError();\n                return this.onRun();\n            });\n        } else {\n            execution.then(this.configuration.showErrors.bind(this.configuration));\n        }\n        execution.then(this.configuration.finally.bind(this.configuration));\n    }\n\n    onRun() {\n        this.configuration = this.configurations.onRun.use(this);\n        this.execute().then(\n            this.configuration.success.bind(this.configuration),\n            this.configuration.failure.bind(this.configuration)\n        )\n            .then(this.configuration.finally.bind(this.configuration))\n            .then(this.executionEnd_.bind(this));\n    }\n\n    evaluate() {\n        this.main.model.status.onExecution(StatusState.ACTIVE);\n        let evaluationInput = this.main.components.console.evaluate();\n        console.log(evaluationInput);\n        evaluationInput.then((userInput) => {\n            this.configuration = this.configurations.eval.use(this, userInput);\n            let execution = this.execute().then(\n                this.configuration.success.bind(this.configuration),\n                this.configuration.failure.bind(this.configuration)\n            );\n            if (!this.main.model.assignment.settings.disableFeedback() &&\n                this.main.model.assignment.onEval()) {\n                this.configuration.provideSecretError();\n                execution.then(this.onEval.bind(this));\n            } else {\n                execution.then(this.configuration.showErrors.bind(this.configuration))\n                    .then(this.evaluate.bind(this));\n            }\n            execution.then(this.configuration.finally.bind(this.configuration));\n        });\n    }\n\n    onEval() {\n        this.configuration = this.configurations.onEval.use(this);\n        this.execute().then(\n            this.configuration.success.bind(this.configuration),\n            this.configuration.failure.bind(this.configuration)\n        )\n            .then(this.evaluate.bind(this))\n            .then(this.configuration.finally.bind(this.configuration));\n    }\n\n    onChange() {\n        this.configuration = this.configurations.onChange.use(this);\n    }\n\n    execute() {\n        this.main.model.status.onExecution(StatusState.ACTIVE);\n        return Sk.misceval.asyncToPromise(() =>\n            Sk.importMainWithBody(this.configuration.filename, false,\n                                  this.configuration.code, true,\n                                  this.configuration.sysmodules)\n        );\n    }\n\n    /**\n     * Activated whenever the Python code changes\n     */\n    on_change() {\n        let FILENAME = \"on_change\";\n        // Skip if the instructor has not defined anything\n        if (!this.main.model.programs[FILENAME]().trim()) {\n            return false;\n        }\n        this.main.model.execution.status(\"changing\");\n        this.main.components.server.saveCode();\n        // On step does not perform parse analysis by default or run student code\n        let engine = this;\n        let feedback = this.main.components.feedback;\n        engine.resetReports();\n        engine.verifyCode();\n        engine.updateParse();\n        engine.runInstructorCode(FILENAME, true, function (module) {\n            if (Sk.executionReports[\"instructor\"][\"success\"]) {\n                // SUCCESS, SCORE, CATEGORY, LABEL, MESSAGE, DATA, HIDE\n                // TODO: only show under certain circumstances\n                if (!success &&\n                    !(category === \"Instructor\" && label === \"No errors\")) {\n                    feedback.presentFeedback(category, label, message, line);\n                }\n                engine.main.components.feedback.presentFeedback(module.$d);\n                engine.main.model.execution.status(\"complete\");\n            }\n        });\n        engine.main.components.server.logEvent(\"engine\", \"on_change\");\n    };\n\n\n    /**\n     * Helper function that will attempt to call the defined onExecutionEnd,\n     * but will do nothing if there is no function defined.\n     */\n    executionEnd_() {\n        if (this.onExecutionEnd !== null) {\n            this.onExecutionEnd();\n        }\n    }\n\n    /**\n     *\n     */\n    executionBegin_() {\n        if (this.onExecutionBegin !== null) {\n            this.onExecutionBegin();\n        }\n    }\n\n}\n\n"
  },
  {
    "path": "src/feedback.js",
    "content": "import {arrayMove, capitalize, pyStr} from \"./utilities\";\n\nexport let FEEDBACK_HTML = `\n\n<span class='blockpy-floating-feedback text-muted-less pull-right position-sticky sticky-top'\n    aria-hidden=\"true\" role=\"presentation\" aria-label=\"New Feedback Alert\">\n    New feedback &uarr;\n</span>\n\n<div class='blockpy-feedback blockpy-panel'\n            role=\"region\" aria-label=\"Feedback\"\n            aria-live=\"polite\"\n            data-bind=\"class: ui.console.size\">\n\n    <div>\n    <!-- Feedback/Trace Visibility Control -->\n    <!-- ko ifnot: ui.secondRow.hideTraceButton -->\n    <button type='button'\n            class='btn btn-sm btn-outline-secondary float-right'\n            data-bind=\"click: ui.secondRow.advanceState\">\n        <span class='fas fa-eye'></span>\n        <span data-bind=\"text: ui.secondRow.switchLabel\"></span>\n    </button>\n    <!-- /ko -->\n\n    <!-- Actual Feedback Region -->    \n    <div>\n        <strong>Feedback: </strong>\n        <span class='badge blockpy-feedback-category feedback-badge'\n            data-bind=\"css: ui.feedback.badge,\n                       text: ui.feedback.category\">Feedback Kind</span>\n        <small data-bind=\"text: (100*submission.score())+'%',\n                          visible: display.instructor() && execution.feedback.label()\"\n            class=\"text-muted\"></small>\n        <small data-bind=\"click: ui.feedback.resetScore,\n                          visible: display.instructor() && execution.feedback.label() && submission.score() > 0\"\n            class=\"text-muted\" style=\"cursor: pointer\"><u>(reset)</u></small>\n    </div>\n    <div>\n        <strong class=\"blockpy-feedback-label\"\n            data-bind=\"text: execution.feedback.label\"></strong>\n        <div class=\"blockpy-feedback-message\"\n            data-bind=\"html: execution.feedback.message\"></div>\n    </div>\n    </div>\n    <div style=\"position: relative;\">\n        <!-- The thank you message will appear above the span -->\n        <span class=\"blockpy-feedback-thank-you\">Thank you!</span>\n    </div>\n    <small class=\"blockpy-feedback-response-full\" style=\"text-align: right\"\n        data-bind=\"visible: ui.feedback.provideRatings() && execution.feedback.label() && display.showRating()\">\n        <span style=\"cursor: pointer;\" class=\"far fa-minus-square\"\n            data-bind=\"click: ui.feedback.flipRating\"></span>\n        Rate this Feedback:\n        <span style=\"cursor: pointer; font-size: 20px\" class=\"blockpy-rating fa-thumbs-up\"\n            data-bind=\"click: ()=>ui.feedback.rate('thumbs-up'),\n                        css: ui.feedback.hasRatedClass\"></span>\n<!--        <span style=\"cursor: pointer; font-size: 20px\" class=\"blockpy-rating fa-meh\"-->\n<!--            data-bind=\"click: ()=>ui.feedback.rate('meh'),-->\n<!--                        css: ui.feedback.hasRatedClass\"></span>-->\n        <span style=\"cursor: pointer; font-size: 20px\" class=\"blockpy-rating fa-thumbs-down\"\n            data-bind=\"click: ()=>ui.feedback.rate('thumbs-down', true),\n                        css: ui.feedback.hasRatedClass\"></span>\n    </small>\n    <!-- Positive Feedback Region -->\n    <div class=\"blockpy-feedback-positive\" style=\"text-align: right\">\n    </div>\n    <small class=\"blockpy-feedback-response-collapsed\" \n        style=\"position: absolute; right: 0; bottom: 0\"\n        data-bind=\"visible: execution.feedback.label() && !display.showRating()\">\n        <span style=\"cursor: pointer; vertical-align: middle\" class=\"far fa-plus-square\"\n            data-bind=\"click: ui.feedback.flipRating\"></span> Rate\n    </small>\n</div>            \n`;\n\nexport class BlockPyFeedback {\n\n    /**\n     * An object that manages the feedback area, where users are told the state of their\n     * program's execution and given guidance. Also manages the creation of the Trace Table.\n     *\n     * @constructor\n     * @this {BlockPyFeedback}\n     * @param {Object} main - The main BlockPy instance\n     * @param {HTMLElement} tag - The HTML object this is attached to.\n     */\n    constructor(main, tag) {\n        this.main = main;\n        this.tag = tag;\n\n        this.feedbackModel = this.main.model.execution.feedback;\n\n        this.category = this.tag.find(\".blockpy-feedback-category\");\n        this.label = this.tag.find(\".blockpy-feedback-label\");\n        this.message = this.tag.find(\".blockpy-feedback-message\");\n        this.positive = this.tag.find(\".blockpy-feedback-positive\");\n\n        // TODO: If they change the student extra files, also update the dirty flag\n        this.main.model.submission.code.subscribe(() => this.main.model.display.dirtySubmission(true));\n    };\n\n    /**\n     * Moves the screen (takes 1 second) to make the Feedback area visible.\n     */\n    scrollIntoView() {\n        $(\"html, body\").animate({\n            scrollTop: this.tag.offset().top\n        }, 700);\n    };\n\n    /**\n     * Determines if the feedback area is currently visible\n     * @returns {boolean}\n     */\n    isFeedbackVisible() {\n        let visibilityBuffer = 100;\n        let topOfElement = this.tag.offset().top;\n        //let bottomOfElement = this.tag.offset().top + this.tag.outerHeight();\n        let bottomOfElement = topOfElement + visibilityBuffer;\n        let bottomOfScreen = $(window).scrollTop() + $(window).height();\n        let topOfScreen = $(window).scrollTop();\n        //bottom_of_element -= 40; // User friendly padding\n        return (\n            (topOfElement < bottomOfScreen) &&\n            (topOfScreen < bottomOfElement));\n    };\n\n    /**\n     * Clears any output currently in the feedback area. Also resets the printer and\n     * any highlighted lines in the editor.\n     */\n    clear(message=\"Ready\") {\n        this.feedbackModel.message(message);\n        this.feedbackModel.category(null);\n        this.feedbackModel.label(null);\n        this.feedbackModel.hidden(false);\n        this.feedbackModel.linesError.removeAll();\n        this.feedbackModel.linesUncovered.removeAll();\n        this.clearPositiveFeedback();\n        this.category.off(\"click\");\n        this.main.model.display.hasRated(false);\n    };\n\n    static findFirstErrorLine(feedbackData) {\n        if (feedbackData.quick$lookup) {\n            let location = feedbackData.quick$lookup(new Sk.builtin.str(\"location\"));\n            if (location) {\n                let line = location.tp$getattr(new Sk.builtin.str(\"line\"));\n                if (line) {\n                    return Sk.ffi.remapToJs(line);\n                }\n            }\n        }\n        return null;\n        /*for (let i = feedbackData.length-1; i >= 0; i-= 1) {\n            if (\"position\" in feedbackData[i]) {\n                return feedbackData[i].position.line;\n            }\n        }\n        return null;*/\n    };\n\n    updateRegularFeedback() {\n\n    }\n\n    /**\n     * Updates the model with these new execution results\n     * @param executionResults\n     */\n    updateFeedback(executionResults) {\n        // Parse out data\n        let message = Sk.ffi.remapToJs(executionResults.MESSAGE);\n        let category = Sk.ffi.remapToJs(executionResults.CATEGORY);\n        let label = Sk.ffi.remapToJs(executionResults.LABEL);\n        let hide = Sk.ffi.remapToJs(executionResults.HIDE);\n        let data = executionResults.DATA;\n        let positives = Sk.ffi.remapToJs(executionResults.POSITIVE);\n\n        // Override based on assignments' settings\n        let hideScore = this.main.model.assignment.hidden();\n        if (hideScore && category.toLowerCase() === \"complete\") {\n            category = \"no errors\";\n            label = \"No errors\";\n            message = \"No errors reported.\";\n        }\n\n        // Remap to expected BlockPy labels\n        if (category.toLowerCase() === \"instructor\" && label.toLowerCase() === \"explain\") {\n            label = \"Instructor Feedback\";\n        }\n\n        // Don't present a lack of error as being incorrect\n        if (category === \"Instructor\" && label === \"No errors\") {\n            category = \"no errors\";\n        }\n\n        // Update model accordingly\n        message = this.main.utilities.markdown(message).replace(/<pre>\\n/g, \"<pre>\\n\\n\");\n        this.feedbackModel.message(message);\n        this.feedbackModel.category(category);\n        this.feedbackModel.label(label);\n        //let highlightTimeout = setTimeout(() => {\n        this.message.find(\"pre code\").map( (i, block) => {\n            window.hljs.highlightBlock(block);\n        });\n        //}, 400);\n        // TODO: Instead of tracking student file, let's track the instructor file\n        this.main.components.server.logEvent(\"Intervention\", category, label, message, \"answer.py\");\n\n        // Clear out any previously highlighted lines\n        this.main.components.pythonEditor.bm.clearHighlightedLines();\n\n        // Find the first error on a line and report that\n        let line = BlockPyFeedback.findFirstErrorLine(data);\n        this.feedbackModel.linesError.removeAll();\n        if (line !== null && line !== undefined) {\n            this.feedbackModel.linesError.push(line);\n        }\n\n        // Invert the set of traced lines\n        let studentReport = this.main.model.execution.reports.student;\n        this.feedbackModel.linesUncovered.removeAll();\n        if (studentReport.success) {\n            let uncoveredLines = [];\n            this.main.model.execution.reports.parser.lines.forEach((line) => {\n                if (studentReport.lines.indexOf(line) === -1) {\n                    uncoveredLines.push(line);\n                }\n            });\n            this.feedbackModel.linesUncovered(uncoveredLines);\n        }\n\n        for (let i=0; i<positives.length; i+=1) {\n            let positiveData = positives[i];\n            this.addPositiveFeedback(positiveData.message, \"star\", \"green\", () => this.main.components.dialog.POSITIVE_FEEDBACK_FULL(positiveData.title, positiveData.message));\n        }\n    }\n\n    clearPositiveFeedback() {\n        this.positive.empty();\n        this.main.model.configuration.container.find(\".blockpy-student-error\").hide();\n    }\n\n    addPositiveFeedback(text, icon, color, onclick, toEnd) {\n        let positive = $(\"<span></span>\");\n        positive.addClass(\"blockpy-feedback-positive-icon fas fa-\"+icon);\n        positive.css(\"color\", color);\n        positive.attr(\"title\", text);\n        if (toEnd) {\n            this.positive.append(positive);\n        } else {\n            this.positive.prepend(positive);\n        }\n        positive.tooltip({\"trigger\": \"hover\", \"container\": this.main.model.configuration.attachmentPoint});\n        if (onclick !== undefined) {\n            positive.click(onclick);\n        }\n        positive.hover(() => {\n            this.main.components.server.logEvent(\"X-Feedback\", \"positive\", \"hover\", text, \"\");\n        });\n    }\n\n    /**\n     * Present any accumulated feedback\n     */\n    presentFeedback(executionResults) {\n        this.updateFeedback(executionResults);\n\n        this.category.off(\"click\");\n        if (this.main.model.display.instructor()) {\n            this.updateFullFeedback(executionResults);\n        }\n\n        // TODO: Logging\n        //this.main.components.server.logEvent(\"feedback\", category+\"|\"+label, message);\n\n        this.notifyFeedbackUpdate();\n    };\n\n    processSingleFeedback(element) {\n        const title = element.tp$getattr(new pyStr(\"title\")).toString();\n        const category = capitalize(element.tp$getattr(new pyStr(\"category\")).toString());\n        const kind = element.tp$getattr(new pyStr(\"kind\")).toString();\n        const active = Sk.misceval.isTrue(element);\n        let message = element.tp$getattr(new pyStr(\"message\")).toString();\n        const unused_message = element.tp$getattr(new pyStr(\"unused_message\")).toString();\n        message = message === \"None\" ? unused_message : message;\n        const justification = element.tp$getattr(new pyStr(\"justification\")).toString();\n        const parent = element.tp$getattr(new pyStr(\"parent\"));\n        const hasParent = !Sk.builtin.checkNone(parent);\n        let score = element.tp$getattr(new pyStr(\"resolved_score\"));\n        score = score === Sk.builtin.none.none$ ? \"\"\n            : score.tp$name === \"float\"\n                ? \"+\" + Math.round(score.v*100).toString() + \"%\"\n                : score.toString();\n        return [element, parent, `\n        <div class=\"list-group-item flex-column align-items-start\" ${hasParent ? \"style='margin-left: 50px;'\" : \"\"}>\n            <div class=\"d-flex w-100 justify-content-between align-items-center\">\n                <span><strong class=\"mb-1\" style=\"${active ? \"\" : \"text-decoration: line-through;\"}\">${title}</strong> (${category} - ${kind})</span>\n                <span class=\"badge badge-info badge-pill\">${score}</span>\n            </div>\n            ${active ? \"\" : \"<div>(Muted - Not shown to student)</div>\"}\n            <div class=\"mb-1 p-1 feedback-expand-on-click feedback-shrunk\">\n                ${message}\n            </div>\n            <small style=\"white-space: pre\">${justification}</small>\n        </div>\n        `];\n    }\n\n    updateFullFeedback(executionResults) {\n        console.log(executionResults);\n        if (!(\"MAIN_REPORT\" in executionResults)) {\n            return;\n        }\n        let mainReport = executionResults.MAIN_REPORT;\n        const feedback = mainReport.tp$getattr(new pyStr(\"feedback\"));\n        if (!feedback) {\n            return;\n        }\n        let feedbacks = [];\n        Sk.misceval.iterFor(feedback.tp$iter(), (element) => {\n            feedbacks.push(this.processSingleFeedback(element));\n        });\n        Sk.misceval.iterFor(mainReport.tp$getattr(new pyStr(\"ignored_feedback\")).tp$iter(), (element) => {\n            feedbacks.push(this.processSingleFeedback(element));\n        });\n        const parents = new Map();\n        for (let i = 0; i < feedbacks.length; i += 1) {\n            const [element, parent, text] = feedbacks[i];\n            const hasParent = !Sk.builtin.checkNone(parent);\n            if (hasParent) {\n                if (!parents.has(parent)) {\n                    parents.set(parent, []);\n                }\n                parents.get(parent).push(text);\n            } else {\n                if (!parents.has(element)) {\n                    parents.set(element, []);\n                }\n                parents.get(element).unshift(text);\n            }\n        }\n        feedbacks = [...parents.values()].flat();\n        this.category.on(\"click\", () => {\n            this.main.components.dialog.show(\"Full Feedback Information\", '<div class=\"list-group\">'+\n                feedbacks.join(\"\\n\") + \"</div>\");\n            $(\".feedback-expand-on-click\").on(\"click\", (event) => {\n                $(event.target).toggleClass(\"feedback-shrunk\");\n            });\n        });\n    }\n\n    notifyFeedbackUpdate() {\n        if (!this.isFeedbackVisible()) {\n            this.tag.find(\".blockpy-floating-feedback\").show().fadeOut(7000);\n            if (this.shouldScrollIntoView()) {\n                this.scrollIntoView();\n            }\n        }\n    };\n\n    shouldScrollIntoView() {\n        return !this.main.model.ui.smallLayout();\n    }\n\n    presentRunError(error, just_return) {\n        if (just_return === undefined) {\n            just_return = false;\n        }\n        let message, label, category, lineno;\n        label = error.tp$name;\n        category = \"runtime\";\n        message = this.convertSkulptError(error);\n\n        if (just_return) {\n            return message;\n        }\n        this.feedbackModel.message(message);\n        this.feedbackModel.category(category);\n        this.feedbackModel.label(label);\n        this.feedbackModel.linesError.removeAll();\n        if (lineno !== undefined && lineno !== null) {\n            this.feedbackModel.linesError.push(lineno);\n        }\n    }\n\n    buildTraceback(error, filenameExecuted) {\n        return error.traceback.map(frame => {\n            if (!frame) {\n                return \"??\";\n            }\n            let lineno = frame.lineno;\n            if (frame.filename.slice(0, -3) === filenameExecuted) {\n                lineno -= this.main.model.execution.reports.instructor.lineOffset;\n            }\n            let file = `File <code class=\"filename\">\"${frame.filename}\"</code>, `;\n            let line = `on line <code class=\"lineno\">${lineno}</code>, `;\n            let scope = (frame.scope !== \"<module>\" &&\n            frame.scope !== undefined) ? `in scope ${frame.scope}` : \"\";\n            let source = \"\";\n            if (frame.source !== undefined) {\n                source = `\\n<pre><code>${frame.source}</code></pre>`;\n            }\n            return file + line + scope + source;\n        });\n    }\n\n    convertSkulptError(error, filenameExecuted, isInstructor) {\n        let name = error.tp$name;\n        let args = Sk.ffi.remapToJs(error.args);\n        let top = `${name}: ${args[0]}\\n<br>\\n<br>`;\n        let traceback = \"\";\n        if (name === \"TimeoutError\") {\n            if (error.err && error.err.traceback && error.err.traceback.length) {\n                const allFrames = this.buildTraceback(error.err, filenameExecuted);\n                const result = [\"Traceback:\"];\n                if (allFrames.length > 5) {\n                    result.push(...allFrames.slice(0, 3),\n                                `... Hiding ${allFrames.length - 3} other stack frames ...,`,\n                                ...allFrames.slice(-3, -2));\n                } else {\n                    result.push(...allFrames);\n                }\n                traceback = result.join(\"\\n<br>\");\n            }\n        } else {\n            if (isInstructor) {\n                top = \"Error in instructor feedback. Please show the following to an instructor:<br>\\n\"+top;\n            }\n            if (error.traceback && error.traceback.length) {\n                traceback = \"Traceback:<br>\\n\" + this.buildTraceback(error, filenameExecuted).join(\"\\n<br>\");\n            }\n        }\n        return top+\"\\n\"+traceback;\n    }\n\n    presentInternalError(error, filenameExecuted) {\n        if (error.tp$name === \"TimeoutError\") {\n            this.main.model.execution.feedback.category(\"runtime\");\n            this.main.model.execution.feedback.label(\"Timeout Error\");\n        } else {\n            this.main.model.execution.feedback.category(\"internal\");\n            this.main.model.execution.feedback.label(\"Internal Error\");\n        }\n        let message = this.convertSkulptError(error, filenameExecuted, true);\n        this.main.model.execution.feedback.message(message);\n\n        this.notifyFeedbackUpdate();\n\n        this.main.components.server.logEvent(\"X-System.Error\", \"internal\", \"Internal Error\", message, filenameExecuted);\n    }\n\n\n\n}"
  },
  {
    "path": "src/files.js",
    "content": "import {firstDefinedValue} from \"utilities.js\";\n\n// ${makeTab(\"?mock_urls.blockpy\", \"URL Data\", true)}\n\nconst makeTab = function(filename, friendlyName, hideIfEmpty, notInstructor) {\n    if (friendlyName === undefined) {\n        friendlyName = filename;\n    }\n    let instructorFileClass = \"\";\n    let hideIfNotInstructor = \"true\";\n    if (!notInstructor) {\n        instructorFileClass = \"blockpy-file-instructor\";\n        hideIfNotInstructor = \"display.instructor()\";\n    }\n    return `\n    <li class=\"nav-item ${instructorFileClass}\">\n        <a class=\"nav-link\" href=\"#\"\n            data-toggle=\"tab\"\n            data-bind=\"css: {active: display.filename() === '${filename}'},\n                click: display.filename.bind($data, '${filename}'),\n                visible: (!${hideIfEmpty} || ui.files.hasContents('${filename}')) && ${hideIfNotInstructor}\">\n            ${friendlyName}</a>\n    </li>`;\n};\n\nexport let FILES_HTML = `\n<div class=\"blockpy-panel blockpy-files\"\n    data-bind=\"visible: ui.files.visible, class: ui.files.width\">\n<ul class=\"nav nav-tabs\" role=\"tablist\">\n\n    <li class=\"nav-item\">\n        <strong>View: </strong>\n    </li>\n\n    ${makeTab(\"answer.py\", undefined, undefined, true)}\n    ${makeTab(\"!instructions.md\", \"Instructions\")}\n    ${makeTab(\"!assignment_settings.blockpy\", \"Settings\")}\n    ${makeTab(\"^starting_code.py\", \"Starting Code\")}\n    ${makeTab(\"!on_run.py\", \"On Run\")}\n    ${makeTab(\"!on_change.py\", \"On Change\", true)}\n    ${makeTab(\"!on_eval.py\", \"On Eval\", true)}\n    ${makeTab(\"!sample_submissions.blockpy\", \"Sample Submissions\", true)}\n    ${makeTab(\"!tags.blockpy\", \"Tags\", true)}\n    \n    <!-- ko foreach: assignment.extraInstructorFiles -->\n        <li class=\"nav-item\"\n            data-bind=\"css: {'blockpy-file-instructor': !filename().startsWith('&')},\n                       visible: filename().startsWith('&') || $root.display.instructor() \">\n            <a class=\"nav-link\" href=\"#\"\n                data-toggle=\"tab\"\n                data-bind=\"css: {active: $root.display.filename() === filename(),\n                                 uneditable: filename().startsWith('&')},\n                            click: $root.display.filename.bind($data, filename()),\n                            text: $root.ui.files.displayFilename(filename())\">\n            </a>        \n        </li>\n    <!-- /ko -->\n    <!-- ko foreach: assignment.extraStartingFiles -->\n        <li class=\"nav-item blockpy-file-instructor\"\n            data-bind=\"visible: $root.display.instructor()\">\n            <a class=\"nav-link\" href=\"#\"\n                data-toggle=\"tab\"\n                data-bind=\"css: {active: $root.display.filename() === filename()},\n                            click: $root.display.filename.bind($data, filename()),\n                            text: filename\">\n            </a>        \n        </li>\n    <!-- /ko -->\n    \n    <!-- ko foreach: submission.extraFiles -->\n        <li class=\"nav-item\">\n            <a class=\"nav-link\" href=\"#\"\n                data-toggle=\"tab\"\n                data-bind=\"css: {active: $root.display.filename() === filename()},\n                            click: $root.display.filename.bind($data, filename()),\n                            text: $root.ui.files.displayFilename(filename())\">\n            </a>\n        </li>\n    <!-- /ko -->\n  \n    <li class=\"nav-item dropdown\" data-bind=\"visible: ui.files.addIsVisible\">\n        <a class=\"nav-link dropdown-toggle\" href=\"#\" data-toggle=\"dropdown\"\n         role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">Add New</a>\n        <!-- ko if: $root.display.instructor() -->\n        <div class=\"dropdown-menu dropdown-menu-right\">\n            <a class=\"dropdown-item blockpy-file-instructor\" href=\"#\"\n                data-bind=\"hidden: ui.files.hasContents('?mock_urls.blockpy'),\n                           click: ui.files.add.bind($data, '?mock_urls.blockpy')\">URL Data</a>\n            <a class=\"dropdown-item blockpy-file-instructor\" href=\"#\"\n                data-bind=\"hidden: ui.files.hasContents('images.blockpy'),\n                           click: ui.files.add.bind($data, 'images.blockpy')\">Images</a>\n            <a class=\"dropdown-item blockpy-file-instructor\" href=\"#\"\n                data-bind=\"hidden: ui.files.hasContents('?toolbox.blockpy'),\n                           click: ui.files.add.bind($data, '?toolbox.blockpy')\">Toolbox</a>\n            \n            <a class=\"dropdown-item blockpy-file-instructor\" href=\"#\"\n                data-bind=\"hidden: ui.files.hasContents('!tags.blockpy')\">Tags</a>\n            <a class=\"dropdown-item blockpy-file-instructor\" href=\"#\"\n                data-bind=\"hidden: ui.files.hasContents('!sample_submissions.blockpy'),\n                           click: ui.files.add.bind($data, '!sample_submissions.blockpy')\">Sample Submissions</a>\n            <div class=\"dropdown-divider\"></div>\n            <a class=\"dropdown-item blockpy-file-instructor\" href=\"#\"\n                data-bind=\"hidden: assignment.onChange,\n                           click: ui.files.add.bind($data, '!on_change.py')\">On Change</a>\n            <a class=\"dropdown-item blockpy-file-instructor\" href=\"#\"\n                data-bind=\"hidden: assignment.onEval,\n                           click: ui.files.add.bind($data, '!on_eval.py')\">On Eval</a>\n            <div class=\"dropdown-divider\"></div>\n           <a class=\"dropdown-item blockpy-file-instructor\" href=\"#\"\n                data-bind=\"hidden: ui.files.hasContents('!answer_prefix.py'),\n                           click: ui.files.add.bind($data, '!answer_prefix.py')\">Answer Prefix</a>\n           <a class=\"dropdown-item blockpy-file-instructor\" href=\"#\"\n                data-bind=\"hidden: ui.files.hasContents('!answer_suffix.py'),\n                           click: ui.files.add.bind($data, '!answer_suffix.py')\">Answer Suffix</a>\n            <div class=\"dropdown-divider\"></div>\n            <a class=\"dropdown-item blockpy-file-instructor\" href=\"#\"\n                data-bind=\"click: ui.files.add.bind($data, 'starting')\">Starting File</a>\n            <a class=\"dropdown-item blockpy-file-instructor\" href=\"#\"\n                data-bind=\"click: ui.files.add.bind($data, 'instructor')\">Instructor File</a>\n            <a class=\"dropdown-item\" href=\"#\"\n                data-bind=\"click: ui.files.add.bind($data, 'student')\">Student File</a>\n        </div>\n        <!-- /ko -->\n        <!-- ko ifnot: $root.display.instructor() -->\n        <div class=\"dropdown-menu dropdown-menu-right\">\n        <a class=\"dropdown-item\" href=\"#\"\n                data-bind=\"click: ui.files.add.bind($data, 'student')\">Student File</a>\n        </div>\n        <!-- /ko -->\n    </li>\n  \n</ul>\n</div>\n`;\n\nconst NEW_INSTRUCTOR_FILE_DIALOG_HTML = `\n<form>\n<div class=\"form-group row\">\n    <div>\n        <p>This dialog box is for creating text files (e.g., Python code, Markdown, etc.) that will be\n        accessible from Python. If you want to upload a binary file (e.g., an image, a sqlite database),\n        then you should use the \"Images\" or \"URL Data\" options.</p>\n        \n        <p>Students will not be able to see file tabs unless you change the \"Hide Files\" setting to be unchecked.</p>\n    </div>\n    <!-- Filename -->\n    <div class=\"col-sm-2 text-right\">\n        <label for=\"blockpy-instructor-file-dialog-filename\">Filename:</label>\n    </div>\n    <div class=\"col-sm-10\">\n        <input type=\"text\" class=\"form-control blockpy-instructor-file-dialog-filename\"\n            id=\"blockpy-instructor-file-dialog-filename\">    \n    </div>\n    <!-- Filetype -->\n    <div class=\"col-sm-2 text-right mt-2\">\n        <label for=\"blockpy-instructor-file-dialog-filetype\">Filetype: </label>\n    </div>\n    <div class=\"col-sm-10\">\n        <span class=\"blockpy-instructor-file-dialog-filetype\"\n            id=\"blockpy-instructor-file-dialog-filetype\"></span>    \n    </div>\n    <!-- Inaccessible to student? -->\n    <div class=\"col-sm-2 text-right mt-2\">\n        <label for=\"blockpy-instructor-file-dialog-namespace\">Namespace: </label>\n    </div>\n    <div class=\"col-sm-4\">\n        <select class=\"form-control blockpy-instructor-file-dialog-namespace\"\n            id=\"blockpy-instructor-file-dialog-namespace\">\n            <option value=\"!\">Completely inaccessible</option>\n            <option value=\"?\">Hidden from student, accessible programatically</option>\n            <option value=\"&\">Visible to student, but not editable</option>\n        </select>\n    </div>\n</div>\n</form>\n`;\n\n/**\n * Filenames live in one of five possible namespaces:\n *  Instructor (!): Invisible to the student under all circumstances\n *  Start Space (^): Used to reset the student namespace\n *  Student Space (): Visible to the student when display.hideFiles is not true, able to be edited\n *  Hidden Space (?): Not directly visible to the student, but accessible programmatically\n *  Read-only Space (&): An instructor file type visible to the student, but is uneditable by them\n *  Secret Space ($): Not visible from the menu at all, some other mechanism controls it\n *  Generated Space (*): Visible to the student, but destroyed after Engine.Clear. Can shadow an actual file.\n *  Concatenated Space (#): Used when bundling a space for the server.\n */\n\nexport let STARTING_FILES = [\n    // Submission\n    \"answer.py\",\n    // Instructor files\n    \"!instructions.md\",\n    \"!assignment_settings.blockpy\",\n    \"^starting_code.py\",\n    \"!on_run.py\",\n    \"$settings.blockpy\",\n];\n\nexport const BASIC_NEW_FILES = [\n    \"!on_change.py\",\n    \"!on_eval.py\",\n    \"?mock_urls.blockpy\",\n    \"?toolbox.blockpy\",\n    \"!tags.blockpy\",\n    \"!sample_submissions.blockpy\",\n    \"!answer_prefix.py\",\n    \"!answer_suffix.py\"\n];\n\nexport function chompSpecialFile(filename) {\n    if (\"!^?&$*#\".includes(filename[0])) {\n        return filename.slice(1);\n    } else {\n        return filename;\n    }\n}\n\nconst INSTRUCTOR_DIRECTORY = \"_instructor/\";\nconst STUDENT_DIRECTORY = \"_student/\";\n\nconst SearchModes = {\n    EVERYWHERE: \"EVERYWHERE\",\n    START_WITH_INSTRUCTOR: \"START_WITH_INSTRUCTOR\",\n    ONLY_STUDENT_FILES: \"ONLY_STUDENT_FILES\"\n};\n\nconst DELETABLE_SIMPLE_FILES = [\"!on_change.py\", \"!on_eval.py\"];\n\nexport const UNDELETABLE_FILES = [\"answer.py\", \"!instructions.md\", \"!assignment_settings.py\",\n                                  \"^starting_code.py\", \"!on_run.py\", \"$settings.blockpy\"];\n\nexport const UNRENAMABLE_FILES = [\"answer.py\", \"!instructions.md\", \"!assignment_settings.py\",\n                                  \"^starting_code.py\", \"!on_run.py\", \"$settings.blockpy\",\n                                  \"!on_change.py\", \"!on_eval.py\",\n                                  \"?mock_urls.blockpy\", \"?toolbox.blockpy\",\n                                  \"!tags.blockpy\", \"!sample_submissions.blockpy\",\n                                  \"!answer_prefix.py\", \"!answer_suffix.py\"];\n\nclass BlockPyFile {\n    constructor(main, filename, contents) {\n        this.main = main;\n        this.filename = filename;\n        this.contents = contents || \"\";\n        this.owner = null;\n        this.handle = null;\n    }\n}\n\nexport function makeModelFile(filename, contents) {\n    return {\"filename\": ko.observable(filename), contents: ko.observable(contents || \"\")};\n}\n\nfunction makeMockModelFile(filename, contents) {\n    return { filename: () => filename, contents: () => contents };\n}\n\nexport function loadConcatenatedFile(concatenatedFile, modelFileList) {\n    if (concatenatedFile) {\n        let files = JSON.parse(concatenatedFile);\n        let modelFiles = [];\n        for (let filename in files) {\n            if (files.hasOwnProperty(filename)) {\n                modelFiles.push(makeModelFile(filename, files[filename]));\n            }\n        }\n        //files = files.map(file => makeModelFile(file.filename, file.contents));\n        if (modelFileList) {\n            modelFileList(modelFiles);\n        } else {\n            return modelFiles;\n        }\n    } else {\n        if (modelFileList) {\n            modelFileList([]);\n        } else {\n            return [];\n        }\n    }\n}\n\nexport function createConcatenatedFile(modelFileList) {\n    return JSON.stringify(modelFileList().map(file => {\n        return {\n            filename: file.filename(),\n            contents: file.contents()\n        };\n    }));\n}\n\nexport function observeConcatenatedFile(modelFileList) {\n    return ko.pureComputed(() => {\n        let result = {};\n        modelFileList().forEach(file =>\n            result[file.filename()] = file.contents());\n        return JSON.stringify(result);\n    });\n}\n\n/**\n * Abstracts away database logic\n */\nexport class BlockPyFileSystem {\n    constructor(main) {\n        this.main = main;\n        this.files_ = {};\n        this.mountFiles();\n\n        this.watchModel();\n        this.watches_ = {};\n\n        this.remoteFiles_ = {};\n        this.filesToUrls = {};\n\n        /*main.model.configuration.container.find(\".blockpy-file-instructor\").toggle(this.main.model.display.instructor());\n        this.main.model.display.instructor.subscribe((visiblity)=> {\n            main.model.configuration.container.find(\".blockpy-file-instructor\").toggle(visiblity);\n        });*/\n    }\n\n    watchFile(filename, callback) {\n        if (!(filename in this.watches_)) {\n            this.watches_[filename] = [];\n        }\n        this.watches_[filename].push(callback);\n    }\n\n    stopWatchingFile(filename) {\n        delete this.watches_[filename];\n    }\n\n    watchModel() {\n        let filesystem = this;\n        [this.main.model.submission.extraFiles,\n         this.main.model.assignment.extraStartingFiles,\n         this.main.model.assignment.extraInstructorFiles].forEach(fileArray =>\n            fileArray.subscribe(function(changes) {\n                changes.sort((first, second) => second.status.localeCompare(first.status))\n                    .forEach(function (change) {\n                        let modelFile = change.value;\n                        if (change.status === \"added\") {\n                            // Track new file\n                            let file = filesystem.newFile(modelFile.filename(), modelFile.contents(), modelFile.contents);\n                            filesystem.notifyWatches(file);\n                        } else if (change.status === \"deleted\") {\n                            // Delete file\n                            let file = filesystem.deleteFileLocally_(modelFile.filename());\n                            if (filesystem.main.model.display.filename() === modelFile.filename()) {\n                                filesystem.main.model.display.filename(\"answer.py\");\n                            }\n                        }\n                    });\n            }, this, \"arrayChange\")\n        );\n    }\n\n    // answer.py\n    //   => subscribe to first element of submission.code)\n    // !on_run.py, !on_change.py, !on_eval.py\n    //   => subscribe to relevant assignment.<whatever>\n    // ^starting_code.py\n    //   => subscribe to first element of assignment.startingCode\n    // ^whatever\n    //   => subscribe to rest of the elements of assignment.startingCode\n    // !whatever or ?whatever\n    //   => subscribe to elements of assignment.extraFiles\n    // Otherwise:\n    //   => subscribe to rest of the elements of submission.code\n    /**\n     * New special files need to be registered here\n     * @param file {BlockPyFile}\n     * @private\n     */\n    observeFile_(file) {\n        if (file.filename === \"answer.py\") {\n            file.handle = this.main.model.submission.code;\n        } else if (file.filename === \"!on_run.py\") {\n            file.handle = this.main.model.assignment.onRun;\n        } else if (file.filename === \"!on_change.py\") {\n            file.handle = this.main.model.assignment.onChange;\n        } else if (file.filename === \"!on_eval.py\") {\n            file.handle = this.main.model.assignment.onEval;\n        } else if (file.filename === \"!instructions.md\") {\n            file.handle = this.main.model.assignment.instructions;\n        } else if (file.filename === \"^starting_code.py\") {\n            file.handle = this.main.model.assignment.startingCode;\n        } else if (file.filename === \"?mock_urls.blockpy\") {\n            this.observeInArray_(file, this.main.model.assignment.extraInstructorFiles);\n        } else if (file.filename === \"?toolbox.blockpy\") {\n            this.observeInArray_(file, this.main.model.assignment.extraInstructorFiles);\n        } else if (file.filename === \"!answer_prefix.py\") {\n            this.observeInArray_(file, this.main.model.assignment.extraInstructorFiles);\n        } else if (file.filename === \"!answer_suffix.py\") {\n            this.observeInArray_(file, this.main.model.assignment.extraInstructorFiles);\n        } else if (file.filename === \"!tags.blockpy\") {\n            file.handle = this.main.model.assignment.tags;\n        } else if (file.filename === \"!assignment_settings.blockpy\") {\n            file.handle = this.main.model.assignment.settings;\n        } else if (file.filename === \"!sample_submissions.blockpy\") {\n            file.handle = this.main.model.assignment.sampleSubmissions;\n        } else if (file.filename === \"$settings.blockpy\") {\n            file.handle = this.main.model.display;\n        } else if (file.filename.startsWith(\"^\")) {\n            this.observeInArray_(file, this.main.model.assignment.extraStartingFiles);\n        } else if (file.filename.startsWith(\"!\") ||\n                   file.filename.startsWith(\"?\") ||\n                   file.filename.startsWith(\"&\")) {\n            this.observeInArray_(file, this.main.model.assignment.extraInstructorFiles);\n        } else {\n            this.observeInArray_(file, this.main.model.submission.extraFiles);\n        }\n    }\n\n    observeInArray_(file, array) {\n        file.owner = array;\n        let codeBundle = file.owner();\n        for (let i=0; i < codeBundle.length; i++) {\n            if (codeBundle[i].filename() === file.filename) {\n                file.handle = codeBundle[i].contents;\n            }\n        }\n        if (file.handle === null) {\n            let newFile = makeModelFile(file.filename);\n            file.handle = newFile.contents;\n            array.push(newFile);\n        }\n    }\n\n    mountFiles() {\n        this.newFile(\"answer.py\");\n        this.newFile(\"^starting_code.py\");\n        this.newFile(\"!on_run.py\");\n        this.newFile(\"!instructions.md\");\n        this.newFile(\"!assignment_settings.blockpy\");\n    }\n\n    dismountExtraFiles() {\n        for (let name in this.files_) {\n            if (this.files_.hasOwnProperty(name)) {\n                if (UNDELETABLE_FILES.indexOf(name) === -1) {\n                    delete this.files_[name];\n                    delete this.watches_[name];\n                }\n            }\n        }\n        // submission.codeTODO: Shouldn't we notify the UI that the file was deleted?\n    }\n\n    newFile(filename, contents, modelFile) {\n        if (filename in this.files_) {\n            // File already exists! Just update its handle\n            let existingFile = this.files_[filename];\n            if (modelFile === undefined) {\n                this.observeFile_(existingFile);\n            } else {\n                existingFile.handle = modelFile;\n            }\n            existingFile.handle(contents || \"\");\n            return existingFile;\n        } else {\n            // File does not exist\n            let newFile = new BlockPyFile(this.main, filename);\n            this.files_[filename] = newFile;\n            if (modelFile === undefined) {\n                this.observeFile_(newFile);\n            } else {\n                newFile.handle = modelFile;\n            }\n            if (contents !== undefined) {\n                newFile.handle(contents);\n            }\n            return newFile;\n        }\n    }\n\n    writeFile(filename, contents) {\n        contents = contents || \"\";\n        this.files_[filename].handle(contents);\n    }\n\n    readFile(filename) {\n        return this.files_[filename].handle();\n    }\n\n    getFile(filename) {\n        return this.files_[filename];\n    }\n\n    /**\n     *\n     * @param filename\n     * @returns {boolean|object} The info about the file, or false if it could not be deleted\n     */\n    deleteFile(filename) {\n        if (DELETABLE_SIMPLE_FILES.indexOf(filename) !== -1) {\n            let file = this.deleteFileLocally_(filename);\n            file.handle(null);\n            return true;\n        } else if (this.files_[filename].owner === null) {\n            return false;\n        } else {\n            // Triggers a callback to eventually call deleteFileLocally_\n            let found = this.files_[filename].owner.remove(modelFile => modelFile.filename() === filename);\n            return found || false;\n        }\n    }\n\n    deleteFileLocally_(filename) {\n        let file = this.files_[filename];\n        delete this.files_[filename];\n        if (filename in this.watches_) {\n            this.watches_[filename].forEach(callback => callback.deleted());\n        }\n        return file;\n    }\n\n    renameFile(source, destination) {\n        if (UNRENAMABLE_FILES.indexOf(source) !== -1) {\n            return false;\n        } else if (this.files_[filename].owner === null) {\n            return false;\n        } else {\n            // Triggers a callback to eventually call deleteFileLocally_\n            let found = this.files_[filename].owner.remove(modelFile => modelFile.filename() === filename);\n            return found || false;\n        }\n    }\n\n    notifyWatches(file) {\n        if (file.filename in this.watches_) {\n            this.watches_[file.filename].forEach(callback => callback.updated(file));\n        }\n    }\n\n    searchForFile(name, studentSearch) {\n        /*\n        TODO: This is called quite a bit by the Import mechanism, might need\n              to optimize it some more. Do timing tests.\n\n        files.*\n        _instructor/files.*\n        _student/files.*\n\n        If a student searches for a file, it checks the \"?\", \"&\", \"*\", \"\" namespaces\n            import helper => \"./helper.py\"\n            open(\"external.json\") => \"external.json\"\n        If an instructor searches for a file, it checks \"!\", \"^\", \"?\", \"&\", \"*\", \"\" namespaces\n            To explicitly search instructor namespaces first\n                import _instructor.helper => \"./instructor/helper.py\"\n                open(\"_instructor/external.json\") => \"_instructor/external.json\"\n            to allow student files to override:\n                import helper => \"./helper.py\"\n                open(\"external.json\") => \"external.json\"\n            to only check student files, prepend with _student\n         */\n        // Chop off starting \"./\"\n        if (name.startsWith(\"./\")) {\n            name = name.slice(2);\n        }\n        let searchMode = SearchModes.EVERYWHERE;\n        // Should the search be start with instructor side?\n        if (name.startsWith(INSTRUCTOR_DIRECTORY)) {\n            name = name.slice(INSTRUCTOR_DIRECTORY.length);\n            searchMode = SearchModes.START_WITH_INSTRUCTOR;\n        }\n        // Should the search be limited to the student mode?\n        if (name.startsWith(STUDENT_DIRECTORY)) {\n            name = name.slice(STUDENT_DIRECTORY.length);\n            searchMode = SearchModes.ONLY_STUDENT_FILES;\n        } else if (studentSearch) {\n            searchMode = SearchModes.ONLY_STUDENT_FILES;\n        }\n        // Shortcut for instructor versions\n        let extraStudentFiles = this.main.model.submission.extraFiles();\n        let extraInstructorFiles = this.main.model.assignment.extraInstructorFiles();\n        let extraStartingFiles = this.main.model.assignment.extraStartingFiles();\n        // Check special files (TODO: how would an instructor access \"./_instructor/answer.py\"?\n        let specialFile = this.searchForSpecialFiles_(name, searchMode);\n        if (specialFile !== undefined) {\n            return specialFile;\n        }\n        // Start looking through possible files\n        let studentVersion = this.searchForFileInList_(extraStudentFiles, name);\n        let generatedVersion = this.searchForFileInList_(extraStudentFiles, \"*\"+name);\n        let defaultVersion = this.searchForFileInList_(extraInstructorFiles, \"&\"+name);\n        let hiddenVersion = this.searchForFileInList_(extraInstructorFiles, \"?\"+name);\n        let remoteVersion = this.remoteFiles_[name];\n        if (searchMode === SearchModes.ONLY_STUDENT_FILES) {\n            return firstDefinedValue(hiddenVersion, defaultVersion, studentVersion, generatedVersion, remoteVersion);\n        }\n        let instructorVersion = this.searchForFileInList_(extraInstructorFiles, \"!\"+name);\n        let startingVersion = this.searchForFileInList_(extraStartingFiles, \"^\"+name);\n        if (searchMode === SearchModes.START_WITH_INSTRUCTOR) {\n            return firstDefinedValue(instructorVersion, hiddenVersion, startingVersion,\n                                     defaultVersion, studentVersion, generatedVersion, remoteVersion);\n        } else if (searchMode === SearchModes.EVERYWHERE) {\n            return firstDefinedValue(defaultVersion, studentVersion, generatedVersion,\n                                     instructorVersion, hiddenVersion, startingVersion, remoteVersion);\n        }\n    }\n\n    searchForFileInList_(modelList, filename) {\n        for (let i=0; i < modelList.length; i++) {\n            if (modelList[i].filename() === filename) {\n                return modelList[i];\n            }\n        }\n        return undefined;\n    }\n\n    searchForSpecialFiles_(filename, searchMode) {\n        if (searchMode === SearchModes.ONLY_STUDENT_FILES) {\n            if (filename === \"answer.py\") {\n                return makeMockModelFile(\"_instructor/answer.py\", this.main.model.submission.code());\n            }\n            return undefined;\n        }\n        switch (filename) {\n            case \"answer.py\":\n                return makeMockModelFile(\"_instructor/answer.py\", this.main.model.submission.code());\n            case \"on_run.py\":\n                return makeMockModelFile(\"_instructor/on_run.py\", this.main.model.assignment.onRun());\n            case \"on_change.py\":\n                return makeMockModelFile(\"_instructor/on_change.py\", this.main.model.assignment.onChange());\n            case \"on_eval.py\":\n                return makeMockModelFile(\"_instructor/on_eval.md\", this.main.model.assignment.onEval());\n            case \"instructions.md\":\n                return makeMockModelFile(\"_instructor/instructions.md\", this.main.model.assignment.instructions());\n            case \"starting_code.py\":\n                return makeMockModelFile(\"_instructor/starting_code.py\", this.main.model.assignment.startingCode());\n        }\n        return undefined;\n    }\n\n    newFileDialog(kind) {\n        let body = $(NEW_INSTRUCTOR_FILE_DIALOG_HTML);\n        let filename = body.find(\".blockpy-instructor-file-dialog-filename\");\n        let filetype = body.find(\".blockpy-instructor-file-dialog-filetype\");\n        let namespace = body.find(\".blockpy-instructor-file-dialog-namespace\");\n        let extensionRegex = /(?:\\.([^.]+))?$/;\n        filename.on(\"input\", () => {\n            let extension = extensionRegex.exec(filename.val())[1];\n            extension = extension === undefined ? \"No extension\" : extension;\n            //TODO: this.main.components.editors.getEditorFromExtension(extension);\n            filetype.text(extension);\n        });\n        let yes = () => {\n            let prefix = \"\";\n            if (kind === \"instructor\") {\n                prefix = namespace.val();\n            } else if (kind === \"starting\") {\n                prefix = \"^\";\n            }\n\n            if (filename.val()) {\n                filename = prefix+filename.val();\n                this.newFile(filename);\n            }\n        };\n        body.submit((e) => {\n            e.preventDefault();\n            yes();\n            this.main.components.dialog.close();\n        });\n        this.main.components.dialog.confirm(\"Make New File\", body, yes, ()=>{}, \"Add\");\n    }\n\n    loadRemoteFiles(files=null) {\n        // Clear existing remote files (?)\n        /*\n        Object.getOwnPropertyNames(this.remoteFiles_).forEach(function (prop) {\n            delete this.remoteFiles_[prop];\n        });*/\n        let model = this.main.model;\n\n        const preloadFiles = model.assignment.settings.preloadFiles() || model.assignment.settings.preloadAllFiles();\n        if (!preloadFiles && !files) {\n            return null;\n        }\n        if (model.assignment.settings.preloadFiles()) {\n            try {\n                files = JSON.parse(preloadFiles);\n            } catch (e) {\n                console.error(\"Failed to preload files, invalid structure: \", e);\n                return null;\n            }\n            this.downloadRemoteFiles(files);\n        } else if (files) {\n            this.downloadRemoteFiles(this.reorganizeFiles(files));\n        } else {\n            this.main.components.server.listUploadedFiles((data) => {\n                this.downloadRemoteFiles(this.reorganizeFiles(data.files));\n            });\n        }\n    }\n\n    reorganizeFiles(files) {\n        const organized = {};\n        Object.entries(files).forEach(([placement, placedFiles]) => {\n            placedFiles.forEach(([filename, url]) => {\n                const searchParams = new URL(url, window.location.origin).searchParams;\n                const directory = searchParams.get(\"directory\");\n                const placement = searchParams.get(\"placement\");\n                if (!(placement in organized)) {\n                    organized[placement] = {};\n                }\n                if (!(directory in organized[placement])) {\n                    organized[placement][directory] = {};\n                }\n                organized[placement][directory][filename] = true;\n                this.filesToUrls[filename] = url;\n            });\n        });\n        return organized;\n    }\n\n    downloadRemoteFiles(files) {\n        const oldRemainingFiles = Object.keys(this.remoteFiles_);\n        Object.entries(files).forEach(([placement, placementData]) => {\n            Object.entries(placementData).forEach(([directory, directoryData]) => {\n                Object.entries(directoryData).forEach(([filename, renamedFile]) => {\n                    if (renamedFile === true) {\n                        renamedFile = filename;\n                    }\n                    if (!(renamedFile in this.remoteFiles_)) {\n                        this.main.components.server.downloadFile(placement, directory, filename, (data) => {\n                            this.newFile(\"images.blockpy\", \"{}\");\n                            this.remoteFiles_[renamedFile] = makeMockModelFile(renamedFile, data);\n                            delete oldRemainingFiles[renamedFile];\n                        });\n                    }\n                });\n            });\n        });\n        // TODO: Clean up the old files after all the new ones are loaded\n    }\n}"
  },
  {
    "path": "src/footer.js",
    "content": "//TODO: Move get link down to footer, remove vertical bar from quick-menu\nexport let FOOTER_HTML = `\n<div class=\"col-md-12 blockpy-panel blockpy-status\">\n    <div>\n        <label class=\"badge\" data-bind=\"class: ui.server.status('loadAssignment')\">Load Assignment\n            <!-- ko if: display.instructor -->\n            <input type=\"file\"\n            class=\"blockpy-force-load-assignment-file blockpy-hidden-file\"\n            accept=\"application/JSON\"\n            data-bind=\"event: {change: ui.server.force.loadAssignment}\">\n            <!-- /ko -->\n        </label>, \n        <span class=\"badge\" data-bind=\"class: ui.server.status('saveAssignment')\">Save Assignment</span>, \n        <span class=\"badge\" data-bind=\"class: ui.server.status('loadFile')\">Load File</span>, \n        <span class=\"badge\" data-bind=\"class: ui.server.status('saveFile')\">Save File</span>, \n        <span class=\"badge\" data-bind=\"class: ui.server.status('loadDataset')\">Load Dataset</span>, \n        <span class=\"badge\" data-bind=\"class: ui.server.status('logEvent')\">Log Event</span>, \n        <span class=\"badge\" data-bind=\"class: ui.server.status('updateSubmission'),\n                                        click: ui.server.force.updateSubmission\">Update Submission</span>, \n        <span class=\"badge\" data-bind=\"class: ui.server.status('onExecution')\">Execution</span>\n    </div>\n    <div\n        <span data-bind=\"text: ui.server.messages\"></span>\n    </div>\n    <div>\n        <span>User: <span data-bind=\"text: user.id\"></span> (<span data-bind=\"text: user.name\"></span>, <span data-bind=\"text: user.role\"></span>)</span>, \n        <span>Course: <span data-bind=\"text: user.courseId\"></span></span>,\n        <span>Group: <span data-bind=\"text: user.groupId\"></span></span>,\n        <span>Assignment: <span data-bind=\"text: assignment.id\"></span></span>,\n        <span>Assignment Version: <span data-bind=\"text: assignment.version\"></span></span>,\n        <span>Submission: \n            <span data-bind=\"text: submission.id\"></span>\n            <span data-bind=\"if: submission.ownerId() != user.id()\">\n                (Owner ID: <span data-bind=\"text: submission.ownerId()\"></span>)\n            </span>\n        </span>, \n        <span>Submission Version: <span data-bind=\"text: submission.version\"></span></span>,\n        <span>Editor Version: <span data-bind=\"text: display.editorVersion\"></span></span>\n    </div>\n</div>\n`;"
  },
  {
    "path": "src/history.js",
    "content": "// TODO: Should disable buttons if we can't activate them.\n\nexport const HISTORY_TOOLBAR_HTML = `\n<div class=\"blockpy-history-toolbar col-md-12\" data-bind=\"visible: display.historyMode\">\n\n    <form class=\"form-inline\">\n        <button class=\"blockpy-history-start btn btn-outline-secondary mr-2\" type=\"button\"\n            data-bind=\"click: ui.editors.python.history.start\">\n            <span class='fas fa-step-backward'></span> Start\n        </button>\n        <button class=\"btn btn-outline-secondary mr-2\" type=\"button\"\n            data-bind=\"click: ui.editors.python.history.previous\">\n            <span class='fas fa-backward'></span> Previous\n        </button>\n        <select class=\"blockpy-history-selector form-control custom-select mr-2\" aria-title=\"History Selector\">\n        </select>\n        <button class=\"btn btn-outline-secondary mr-2\" type=\"button\"\n            data-bind=\"click: ui.editors.python.history.use\">\n            <span class='fas fa-file-import'></span> Use\n        </button>\n        <button class=\"btn btn-outline-secondary mr-2\" type=\"button\"\n            data-bind=\"click: ui.editors.python.history.next\">\n            <span class='fas fa-forward'></span> Next\n        </button>\n        <button class=\"btn btn-outline-secondary\" type=\"button\"\n            data-bind=\"click: ui.editors.python.history.mostRecent\">\n            <span class='fas fa-step-forward'></span> Most Recent\n        </button>\n    </form>\n</div>\n`;\n\n/**\n * An object for displaying the user's coding logs (their history).\n * A lightweight component, its only job is to open a dialog.\n *\n * @constructor\n * @this {BlockPyHistory}\n * @param {Object} main - The main BlockPy instance\n */\nexport class BlockPyHistory {\n    constructor(main, tag) {\n        this.main = main;\n        this.tag = tag;\n        this.currentId = null;\n        this.history = [];\n        this.editEvents = [];\n    }\n\n    load(history) {\n        this.history = history;\n        this.editEvents = [];\n        this.selector = $(\".blockpy-history-selector\").empty();\n        let editId = 0;\n        history\n            .filter((entry) => (\n                !entry.file_path.startsWith(\"_instructor.\") &&\n                    entry.event_type !== \"Compile\" &&\n                    entry.event_type !== \"Intervention\" &&\n                    (!this.main.model.assignment.hidden() || entry.event_type !== \"X-Submission.LMS\")\n            ))\n            .forEach((entry, index) => {\n                let event_type = REMAP_EVENT_TYPES[entry.event_type] || entry.event_type;\n                let displayed = prettyPrintDateTime(entry.client_timestamp) +\" - \"+event_type;\n                let disable = (entry.event_type !== \"File.Edit\");\n                let option = $(\"<option></option>\", {text: displayed, disabled: disable});\n                if (this.isEditEvent(entry)) {\n                    option.attr(\"value\", editId);\n                    this.editEvents.push(entry);\n                    editId += 1;\n                }\n                this.selector.append(option);\n            });\n        this.selector.val(Math.max(0, editId-1));\n        this.selector.change((evt) => {\n            this.updateEditor();\n        });\n    }\n\n    moveToStart() {\n        this.selector.val(0);\n        this.updateEditor();\n    }\n\n    movePrevious() {\n        let currentId = parseInt(this.selector.val(), 10);\n        this.selector.val(Math.max(0, currentId-1));\n        this.updateEditor();\n    }\n\n    moveNext() {\n        let currentId = parseInt(this.selector.val(), 10);\n        this.selector.val(Math.min(this.editEvents.length-1, currentId+1));\n        this.updateEditor();\n    }\n\n    moveToMostRecent() {\n        this.selector.val(this.editEvents.length-1);\n        this.updateEditor();\n    }\n\n    updateEditor() {\n        if (this.editEvents.length) {\n            let currentId = parseInt(this.selector.val(), 10);\n            this.main.components.pythonEditor.bm.setCode(this.editEvents[currentId].message);\n        }\n    }\n\n    use() {\n        if (this.editEvents.length) {\n            let currentId = parseInt(this.selector.val(), 10);\n            let code = this.editEvents[currentId].message;\n            this.main.model.ui.editors.python.turnOffHistoryMode();\n            this.main.components.pythonEditor.file.handle(code);\n        }\n    }\n\n    isEditEvent(entry) {\n        return ((entry.event_type === \"File.Edit\" ||\n                 entry.event_type === \"File.Create\") &&\n                this.main.model.display.filename() === entry.file_path);\n    }\n\n}\n\nconst REMAP_EVENT_TYPES = {\n    \"Session.Start\": \"Began session\",\n    \"X-IP.Change\": \"Changed IP address\",\n    \"File.Edit\": \"Edited code\",\n    \"File.Create\": \"Started assignment\",\n    \"Run.Program\": \"Ran program\",\n    \"Compile.Error\": \"Syntax error\",\n    \"X-Submission.LMS\": \"Updated grade\"\n};\n\nconst monthNames = [\n    \"Jan\", \"Feb\", \"Mar\",\n    \"Apr\", \"May\", \"June\", \"July\",\n    \"Aug\", \"Sept\", \"Oct\",\n    \"Nov\", \"Dec\"\n];\nconst weekDays = [\n    \"Sun\", \"Mon\", \"Tue\",\n    \"Wed\", \"Thu\", \"Fri\",\n    \"Sat\"\n];\n\nfunction isSameDay(first, second) {\n    return first.getDate() === second.getDate() &&\n        first.getMonth() === second.getMonth() &&\n        first.getFullYear() === second.getFullYear();\n}\n\n/**\n * Helper function to parse a date/time string and rewrite it as something\n * more human readable.\n * @param {String} timeString - the string representation of time (\"YYYYMMDD HHMMSS\")\n * @returns {String} - A human-readable time string.\n */\nfunction prettyPrintDateTime(timeString) {\n    /*let year = timeString.slice(0, 4),\n        month = parseInt(timeString.slice(4, 6), 10)-1,\n        day = timeString.slice(6, 8),\n        hour = timeString.slice(9, 11),\n        minutes = timeString.slice(11, 13),\n        seconds = timeString.slice(13, 15);*/\n    // TODO: Handle timezones correctly\n    if (timeString === undefined) {\n        return \"Undefined Time\";\n    }\n    let now = new Date();\n    let past = new Date(parseInt(timeString, 10));\n    if (isSameDay(now, past)) {\n        return \"Today at \"+past.toLocaleTimeString();\n    } else {\n        let dayStr = weekDays[past.getDay()];\n        let monthStr = monthNames[past.getMonth()];\n        let date = dayStr + \", \" + monthStr + \" \" + past.getDate();\n        if (now.getFullYear() === past.getFullYear()) {\n            return date + \" at \"+past.toLocaleTimeString();\n        } else {\n            return date + \", \"+past.getFullYear() + \" at \"+past.toLocaleTimeString();\n        }\n    }\n}\n\n\n/**\n * Opens the history dialog box. This requires a trip to the server and\n * occurs asynchronously. The users' code is shown in preformatted text\n * tags (no code highlighting currently) along with the timestamp.\n */\nBlockPyHistory.prototype.openDialog = function() {\n    var dialog = this.main.components.dialog;\n    var body = \"<pre>a = 0</pre>\";\n    this.main.components.server.getHistory(function (data) {\n        body = data.reverse().reduce(function (complete, elem) { \n            var complete_str = prettyPrintDateTime(elem.time);\n            var new_line = \"<b>\"+complete_str+\"</b><br><pre>\"+elem.code+\"</pre>\";\n            return complete+\"\\n\"+new_line;\n        }, \"\");\n        dialog.show(\"Work History\", body, function() {});\n    });\n};"
  },
  {
    "path": "src/interface.js",
    "content": "/**\n * @fileoverview Contains main HTML of BlockPy interface, and helper functions.\n * Combines a lot of HTML from components.\n *\n * Here's the layout:\n *  Row 1: Header and Quick Menu\n *  Row 2: Console and Feedback\n *  Row 3: File Navigation\n *  Row 4: View Row\n *  Row 5: Footer Row\n */\n\nimport {TRACE_HTML} from \"trace.js\";\nimport {DIALOG_HTML} from \"dialog.js\";\nimport {FEEDBACK_HTML} from \"feedback.js\";\nimport {FILES_HTML} from \"files.js\";\nimport {FOOTER_HTML} from \"footer.js\";\nimport {EDITORS_HTML} from \"editors.js\";\nimport {CONSOLE_HTML} from \"console.js\";\n\n/**\n * The different layout options of the panes in the second row of the layout.\n * @enum {String}\n */\nexport let SecondRowSecondPanelOptions = {\n    FEEDBACK: \"feedback\",\n    TRACE: \"trace\",\n    NONE: \"none\"\n};\n\n/**\n * Setup any additional Knockout subscriptions to fire on interface changes.\n * @param self\n * @param model\n */\nexport function makeExtraInterfaceSubscriptions(self, model) {\n    // Highlight Markdown when instructions update\n    let highlightTimeout = null;\n    model.ui.instructions.current.subscribe(() => {\n        if (highlightTimeout !== null) {\n            clearTimeout(highlightTimeout);\n        }\n        highlightTimeout = setTimeout(() => {\n            model.configuration.container.find(\".blockpy-instructions pre code\").map( (i, block) => {\n                window.hljs.highlightBlock(block);\n            });\n        }, 400);\n    });\n    // Provide Fullscreen support\n    model.display.fullscreen.subscribe((isFullscreen) => {\n        self.components.server.logEvent(\"X-Display.Fullscreen.Request\", \"\", \"\",\n                                        isFullscreen.toString(), \"\");\n        if (isFullscreen) {\n            // NOTE: navigationUI could allow us to force controls to show\n            model.configuration.container.parent()[0].requestFullscreen().catch(err => {\n                let message = `Error attempting to enable full-screen mode: ${err.message} (${err.name})`;\n                self.components.server.logEvent(\"X-Display.Fullscreen.Error\", \"\", \"\",\n                                                message,  \"\");\n                alert(message);\n            }).then(() => {\n                self.components.server.logEvent(\"X-Display.Fullscreen.Success\", \"\", \"\",\n                                                \"\", \"\");\n                model.display.fullscreen(true);\n                model.configuration.container.css(\"overflow-y\", \"auto\");\n            });\n        } else {\n            document.exitFullscreen().then(() => {\n                self.components.server.logEvent(\"X-Display.Fullscreen.Exit\", \"\", \"\",\n                                                isFullscreen.toString(), \"\");\n                model.display.fullscreen(false);\n            });\n        }\n    });\n}\n\n// TODO: Get shareable link button\n\nexport function makeInterface(main) {\n    return `\n<div class='blockpy-content container-fluid'>\n\n    <!-- Dialog -->\n    ${DIALOG_HTML}\n    \n    <!-- Hidden Capture Canvas -->\n    <canvas id='capture-canvas' class='d-none' role=\"presentation\" aria-hidden=\"true\"></canvas>\n    \n    <!-- Row 1: Header and Quick Menu -->\n    <div class='row' data-bind=\"hidden: ui.smallLayout()\">\n         \n         <!-- Description -->\n         <div class='col-md-9 blockpy-panel blockpy-header'\n               role='heading' aria-label='Assignment Description'>\n         \n            <!-- Assignment Name -->\n            <span role='heading' aria-level='1'\n                  class=\"blockpy-name\">\n                <strong>BlockPy: </strong> \n                <span data-bind='text: assignment.name'></span>\n            </span>\n            \n            <!-- Reset Instructions Button -->\n            <div class=\"blockpy-instructions-reset\"\n                data-bind=\"visible: ui.instructions.isChanged\">\n                <a class=\"float-right\"\n                    data-bind=\"click: ui.instructions.reset\"\n                    href=\"\">\n                    Reset instructions</a>\n            </div>\n            \n            <!-- Instructions -->\n            <div class='blockpy-instructions'\n                 data-bind=\"html: ui.instructions.current\">\n            </div>\n        </div>\n        \n        <div class='col-md-3 blockpy-panel blockpy-quick-menu'\n             role='menubar' aria-label='Quick Menu' title=\"Quick Menu\">\n            <!-- Get Shareable Link -->\n            <!--<button class=\"btn btn-outline-secondary btn-sm\">\n                Get shareable link</button>-->\n            <span data-bind=\"visible: ui.menu.isSubmitted\">\n                Your submission is ready to be reviewed!</span>\n            <button class=\"btn btn-outline-secondary btn-sm\"\n                data-bind=\"visible: ui.menu.canMarkSubmitted,\n                           text: ui.menu.textMarkSubmitted,\n                           click: ui.menu.clickMarkSubmitted\"></button>\n            <!-- View as instructor -->\n            <div class=\"form-check\"\n                 data-bind=\"visible: ui.role.isGrader\">\n                <input class=\"form-check-input\" type=\"checkbox\" value=\"\" id=\"blockpy-as-instructor\"\n                    data-bind=\"checked: display.instructor\">\n                <label class=\"form-check-label\" for=\"blockpy-as-instructor\">\n                    View as instructor\n                </label>\n            </div>\n            <!-- Readonly mode for spying -->\n            <div data-bind=\"if: submission.ownerId() != user.id()\">\n                Owner: <span data-bind=\"text: submission.ownerId\"></span>\n                <div class=\"form-check\">\n                    <input class=\"form-check-input\" type=\"checkbox\" value=\"blockpy-read-only\"\n                        data-bind=\"checked: display.readOnly\">\n                    <label class=\"form-check-label\" for=\"blockpy-read-only\">\n                        Readonly?\n                    </label>\n                </div>\n            </div>\n            \n            \n            <!-- Fullscreen button -->\n            <button class=\"btn btn-outline-secondary btn-sm\"\n                data-bind=\"click: ui.menu.clickFullscreen\"\n                title=\"Full Screen\">\n                <span class='fas' data-bind=\"class: ui.menu.textFullscreen\"></span>\n            </button>\n            <!-- Edit Queued Inputs -->\n            <button class=\"btn btn-outline-secondary btn-sm\"\n                data-bind=\"click: ui.menu.editInputs, visible: ui.menu.showQueuedInputs\" title=\"Edit Inputs\">\n                <span class='fas fa-list-alt'></span>\n            </button>\n            <!-- Toggle Image Rendering -->\n            <button class=\"btn btn-outline-secondary btn-sm\"\n                data-toggle=\"button\"\n                data-bind=\"click: ui.menu.toggleImages\" title=\"Toggle Images\">\n                <span class=\"fas fa-images\"></span>\n            </button>\n            <!-- Get Shareable Link Dialog -->\n            <button class=\"btn btn-outline-secondary btn-sm\"\n                data-bind=\"click: ()=>ui.menu.startShare(false), visible: ui.menu.canShare\"\n                title=\"Get Shareable Link for Instructors or TAs\">\n                <span class=\"fas fa-link\"></span>\n            </button>\n            <!-- Pink Bug for actual errors -->\n            <span class=\"blockpy-student-error fas fa-bug\"></span>\n            <span data-bind=\"hidden: ui.menu.showClock\" class=\"blockpy-menu-clock\"></span>\n        </div>\n         \n    </div>\n    \n    <!-- ko if: ui.smallLayout() -->\n    <!-- Small layout View as instructor -->\n    <div class=\"form-check\"\n         data-bind=\"visible: ui.role.isGrader\">\n        <input class=\"form-check-input\" type=\"checkbox\" value=\"\" id=\"blockpy-as-instructor\"\n            data-bind=\"checked: display.instructor\">\n        <label class=\"form-check-label\" for=\"blockpy-as-instructor\">\n            View as instructor\n        </label>\n    </div>\n    <!-- ko if: ui.files.visible() -->\n    ${FILES_HTML}\n    <!-- /ko -->\n    <!-- /ko -->\n    \n    <div class='row'>\n    <!-- Row 2: Console and Feedback -->\n    <!-- ko if: ui.secondRow.isAllVisible -->\n    <div data-bind=\"class: ui.secondRow.width\">\n    <div class='row'>\n        <!-- Console -->\n        ${CONSOLE_HTML}\n        <!-- Feedback -->\n        <!-- ko if: ui.secondRow.isFeedbackVisible -->\n        ${FEEDBACK_HTML}\n        <!-- /ko -->\n        <!-- Trace -->\n        <!-- ko if: ui.secondRow.isTraceVisible -->\n        ${TRACE_HTML}\n        <!-- /ko -->\n    </div>\n    </div>\n    <!-- /ko -->\n    \n    <!-- Row 3: File Navigation -->\n    <!-- ko if: ui.files.visible() && !ui.smallLayout() -->\n    ${FILES_HTML}\n    <!-- /ko -->\n    \n    <!-- Row 4: View Row -->\n    ${EDITORS_HTML}\n    \n    </div>\n    \n    \n    <!-- Row 5: Footer Row -->    \n    <!-- ko if: ui.footer.visible -->\n    <div class=\"row\">\n        ${FOOTER_HTML}\n    </div>\n    <!-- /ko -->\n    \n</div>\n    `;\n}"
  },
  {
    "path": "src/server.js",
    "content": "import {LocalStorageWrapper} from \"./storage\";\nimport {loadAssignmentSettings, saveAssignmentSettings} from \"./editor/assignment_settings\";\n\n/**\n *\n * @enum {string}\n */\nexport let StatusState = {\n    READY: \"ready\",\n    ACTIVE: \"active\",\n    RETRYING: \"retrying\",\n    FAILED: \"failed\",\n    OFFLINE: \"offline\"\n};\n\n/**\n * Object for communicating with the external servers. This includes functionality for\n * saving and loading files, logging events, saving completions, and retrieving history.\n *\n * @constructor\n * @this {BlockPyServer}\n * @param {Object} main - The main BlockPy instance\n */\nexport function BlockPyServer(main) {\n    this.main = main;\n\n    // Save URLs locally for quicker access\n    this.urls = main.model.configuration.urls;\n\n    // Add the LocalStorage connection\n    this.storage = new LocalStorageWrapper(\"BLOCKPY\");\n\n    // FaultResistantCache\n    this.queue = {\n        \"logEvent\": JSON.parse(this.storage.getDefault(\"logEvent\", \"[]\")),\n        \"updateSubmission\": JSON.parse(this.storage.getDefault(\"updateSubmission\", \"[]\"))\n    };\n    this.MAX_QUEUE_SIZE = {\n        \"logEvent\": 200,\n        \"updateSubmission\": 50\n    };\n\n    this.TIMER_DELAY = 1000;\n    this.FAIL_DELAY = 2000;\n\n    this.timers = {};\n\n    this.overlay = null;\n    this.blockingAttempts = 0;\n\n    this.cachedFilenames = [];\n    this.createSubscriptions();\n    this.checkCaches();\n\n    this.altLogEntry = null;\n}\n\n/**\n * Checks whether the IP address has changed, logging an event if that occurs.\n * @param response\n */\nBlockPyServer.prototype.checkIP = function (response) {\n    if (response.success) {\n        if (this.storage.has(\"IP\")) {\n            let oldIP = this.storage.get(\"IP\");\n            if (oldIP !== response.ip) {\n                let message = JSON.stringify({\n                    \"old\": oldIP,\n                    \"new\": response.ip\n                });\n                if (this.altLogEntry) {\n                    this.altLogEntry(\"X-IP.Change\", undefined, undefined, message);\n                } else {\n                    this.logEvent(\"X-IP.Change\", undefined, undefined, message);\n                }\n                this.storage.set(\"IP\", response.ip);\n            }\n        } else {\n            this.storage.set(\"IP\", response.ip);\n        }\n    }\n};\n\n/**\n * Determines if there have been previous failures cached, and if so retries them.\n * TODO: update\n */\nBlockPyServer.prototype.checkCaches = function () {\n    if (this.storage.has(\"saveAssignment\")) {\n        let data = JSON.parse(this.storage.get(\"saveAssignment\"));\n        this._postLatestRetry(data, \"assignment\",\n                              \"saveAssignment\", this.TIMER_DELAY);\n    }\n    this.cachedFilenames.forEach((filename) => {\n        if (this.storage.has(\"saveFile\" + filename)) {\n            let data = JSON.parse(this.storage.get(\"saveFile\" + filename));\n            this._postLatestRetry(data, filename, \"saveFile\", this.TIMER_DELAY);\n        }\n    });\n    var server = this;\n    Object.keys(this.queue).forEach(function (endpoint) {\n        (function pushAnyQueued(response) {\n            if (response.success) {\n                if (server.queue[endpoint].length) {\n                    var data = JSON.parse(server.queue[endpoint].pop());\n                    var url = server.urls[endpoint];\n                    server._postRetry(data, endpoint, 1000, pushAnyQueued);\n                }\n            }\n        })({\"success\": true});\n    });\n};\n\nBlockPyServer.prototype.createFileSubscription = function (model, filename) {\n    model.subscribe((contents) =>\n        this.main.model.display.autoSave() ? this.saveFile(filename, contents) : false, this);\n    this.cachedFilenames.push(filename);\n};\n\n/**\n * TODO: fix\n */\nBlockPyServer.prototype.createSubscriptions = function () {\n    let model = this.main.model;\n    this.createFileSubscription(model.submission.code, \"answer.py\");\n    this.createFileSubscription(model.assignment.onRun, \"!on_run.py\");\n    this.createFileSubscription(model.assignment.onEval, \"!on_eval.py\");\n    this.createFileSubscription(model.assignment.onChange, \"!on_change.py\");\n    this.createFileSubscription(model.assignment.instructions, \"!instructions.md\");\n    this.createFileSubscription(model.assignment.startingCode, \"^starting_code.py\");\n    this.createFileSubscription(model.ui.files.extraStudentFiles, \"#extra_student_files.blockpy\");\n    this.createFileSubscription(model.ui.files.extraStartingFiles, \"#extra_starting_files.blockpy\");\n    this.createFileSubscription(model.ui.files.extraInstructorFiles, \"#extra_instructor_files.blockpy\");\n};\n\nBlockPyServer.prototype.createEventLogs = function() {\n    window.onblur = () => {\n        this.logEvent(\"Session.End\", undefined, undefined, undefined);\n    };\n    window.onfocus = () => {\n        this.logEvent(\"Session.Start\", undefined, undefined, undefined);\n    };\n\n    // TODO: Add in beacon?\n};\n\n/**\n *\n * Some subscriptions have to happen after other things have been loaded.\n * Right now this is just after CORGIS libraries have been loaded, but maybe\n * we'll add more later and this will need to be refactored.\n *\n * TODO: fix\n *\n */\nBlockPyServer.prototype.finalizeSubscriptions = function () {\n    //this.main.model.assignment.settings.datasets.subscribe(this.saveAssignment.bind(this));\n};\n\nBlockPyServer.prototype.authorizeHeader = function(currentSettings) {\n    if (!currentSettings) {\n        currentSettings = {};\n    }\n    const accessToken = this.main.model.configuration.accessToken();\n    if (accessToken) {\n        if (!currentSettings.headers) {\n            currentSettings.headers = {};\n        }\n        currentSettings.headers[\"Authorization\"] = \"Bearer \" + accessToken;\n    }\n    return currentSettings;\n};\n\n/**\n * Creates the default payload for any communication with the server API\n * @returns {{assignment_id: *, course_id: *, group_id: *, user_id: *, timezone: *, version: *, timestamp: *}}\n */\nBlockPyServer.prototype.createServerData = function () {\n    let assignment = this.main.model.assignment;\n    let user = this.main.model.user;\n    let submission = this.main.model.submission;\n    let display = this.main.model.display;\n    const configuration = this.main.model.configuration;\n    let now = new Date();\n    let microseconds = now.getTime();\n    let result = {\n        \"assignment_id\": assignment.id(),\n        \"assignment_group_id\": user.groupId(),\n        \"course_id\": user.courseId(),\n        \"submission_id\": submission.id(),\n        \"user_id\": user.id(),\n        \"version\": assignment.version(),\n        \"timestamp\": microseconds,\n        \"timezone\": now.getTimezoneOffset(),\n        \"passcode\": display.passcode(),\n        \"part_id\": configuration.partId()\n    };\n    return result;\n};\n\n/**\n * Updates the status and message for the relevant endpoint.\n * @param endpoint {string} one of the URL endpoints\n * @param status {StatusState}\n * @param message {string?}\n */\nBlockPyServer.prototype.setStatus = function (endpoint, status, message) {\n    if (endpoint in this.main.model.status) {\n        this.main.model.status[endpoint](status);\n        this.main.model.status[endpoint + \"Message\"](message || \"\");\n    }\n};\n\n/**\n * Renders an overlay on the screen that blocks operation until the system is ready.\n * The overlay gets progressively darker to indicate repeated failures.\n */\nBlockPyServer.prototype.showOverlay = function (attempt) {\n    this.blockingAttempts += 1;\n    if (!document.getElementsByClassName(\"blockpy-overlay\").length) {\n        this.overlay = $('<div class=\"blockpy-overlay\"> </div>');\n        this.overlay.appendTo(document.body);\n    }\n    switch (attempt) {\n        case 0:\n            this.overlay.css(\"background-color\", \"#988\");\n            break;\n        case 1:\n            this.overlay.css(\"background-color\", \"#655\");\n            break;\n        case 2:\n            this.overlay.css(\"background-color\", \"#333\");\n            break;\n        default:\n            this.overlay.css(\"background-color\", \"black\");\n            break;\n    }\n};\n\n/**\n * Undo a level of overlay; if this was the last level, removes it from the screen.\n */\nBlockPyServer.prototype.hideOverlay = function () {\n    this.blockingAttempts -= 1;\n    if (this.blockingAttempts <= 0) {\n        this.overlay.remove();\n    }\n};\n\nBlockPyServer.prototype._enqueueData = function (cache, data) {\n    // Ensure we have not overfilled the queue\n    let length = this.queue[cache].length;\n    let max = this.MAX_QUEUE_SIZE[cache];\n    if (length > max) {\n        this.queue[cache] = this.queue[cache].slice(length - max, max);\n    }\n    // Only add the element if it's new\n    let key = JSON.stringify(data);\n    let index = this.queue[cache].indexOf(key);\n    if (index === -1) {\n        this.queue[cache].push(key);\n        this.storage.set(cache, JSON.stringify(this.queue[cache]));\n    }\n};\n\nBlockPyServer.prototype._dequeueData = function (cache, data) {\n    let key = JSON.stringify(data);\n    let index = this.queue[cache].indexOf(key);\n    if (index >= 0) {\n        this.queue[cache].splice(index);\n        this.storage.set(cache, JSON.stringify(this.queue[cache]));\n    }\n};\n\n\nBlockPyServer.prototype._postRetry = function (data, endpoint, delay, callback) {\n    // Trigger request\n    let postRequest = () => {\n        // Make a backup of the current post\n        this._enqueueData(endpoint, data);\n        $.ajax({url: this.urls[endpoint], type: \"post\", data: data, ...this.authorizeHeader()})\n            .done((response) => {\n                this._dequeueData(endpoint, data);\n                if (response.success) {\n                    this.setStatus(endpoint, StatusState.READY);\n                } else {\n                    console.error(response);\n                    this.setStatus(endpoint, StatusState.FAILED, response.message);\n                }\n                if (callback) {\n                    callback(response);\n                }\n                if (response.success) {\n                    this.checkIP(response.ip);\n                }\n            })\n            // If server request is the latest one, then let's try it again in a bit\n            .fail((error, textStatus) => {\n                this.setStatus(endpoint, StatusState.RETRYING, textStatus.toString());\n                this._postRetry(data, endpoint, delay + this.FAIL_DELAY, callback);\n            });\n    };\n    if (delay === null) {\n        postRequest();\n    } else {\n        setTimeout(postRequest, delay);\n    }\n};\n\n/**\n * Make a AJAX request that, upon failure, will check to see if this was the\n * latest attempt for this `cache` marker. If so, it will attempt again until\n * successful; otherwise, it gives up the request.\n *\n * @param {Object} data - The AJAX-ready data to be posted\n * @param {String} filename - The unique name given to the relevant timer\n * @param {String} endpoint - The unique name given to the relevant cache entry\n * @param {Integer} delay - The current number of milliseconds to wait before\n trying the request again.\n */\nBlockPyServer.prototype._postLatestRetry = function (data, filename, endpoint, delay, failureFunction, doneFunction) {\n    let cache = endpoint + filename;\n    let request = () => {\n        // Make a backup of the current post\n        this.storage.set(cache, JSON.stringify(data));\n        let time = this.storage.getTime(cache);\n        // Send the request\n        $.ajax({url: this.urls[endpoint], data: data, type: \"post\", ...this.authorizeHeader()})\n            .done((response) => {\n                if (response.success) {\n                    this.checkIP(response);\n                    // If server request is the latest one, clear it from the cache\n                    let cachedTime = this.storage.getTime(cache);\n                    if (time >= cachedTime) {\n                        this.storage.remove(cache);\n                    }\n                    this.setStatus(endpoint, StatusState.READY);\n                } else {\n                    // This connected but failed, don't try again but let the user know why.\n                    this.setStatus(endpoint, StatusState.FAILED, response.message);\n                    if (response.success === false) {\n                        // If we're the latest one, clear it from the cache\n                        let cachedTime = this.storage.getTime(cache);\n                        if (time >= cachedTime) {\n                            this.storage.remove(cache);\n                        }\n                        if (failureFunction) {\n                            failureFunction(response);\n                        }\n                    }\n                }\n            })\n            .fail((error, textStatus) => {\n                this.setStatus(endpoint, StatusState.RETRYING, textStatus.toString());\n                // If server request is the latest one, then let's try it again in a bit\n                let cachedTime = this.storage.getTime(cache);\n                if (time >= cachedTime) {\n                    this._postLatestRetry(data, filename, endpoint, delay + this.FAIL_DELAY);\n                }\n            })\n            .done(doneFunction);\n    };\n    clearTimeout(this.timers[cache]);\n    if (delay === null) {\n        return request();\n    } else {\n        this.timers[cache] = setTimeout(request, delay);\n    }\n};\n\nBlockPyServer.prototype._postBlocking = function (endpoint, data, attempts, success, failure, extraSettings={}) {\n    this.showOverlay(attempts);\n    return $.ajax({\n        type: \"POST\",\n        url: this.urls[endpoint],\n        data: data,\n        ...this.authorizeHeader(extraSettings)\n    })\n        .done((response) => {\n            this.hideOverlay();\n            this.setStatus(endpoint, StatusState.READY);\n            success(response);\n            this.checkIP(response);\n        })\n        .fail((e, textStatus, errorThrown) => {\n            if (attempts <= 0) {\n                this.hideOverlay();\n                this.setStatus(endpoint, StatusState.FAILED, textStatus.toString());\n                if (failure) {\n                    failure(e, textStatus, errorThrown);\n                }\n            } else {\n                setTimeout(() => {\n                    this.hideOverlay();\n                    this.setStatus(endpoint, StatusState.RETRYING, textStatus.toString());\n                    this._postBlocking(endpoint, data, attempts - 1, success, failure, extraSettings);\n                }, this.FAIL_DELAY);\n            }\n        });\n};\n\n\nBlockPyServer.prototype.loadAssignment = function (assignment_id) {\n    let model = this.main.model;\n    if (model.ui.server.isEndpointConnected(\"loadAssignment\")) {\n        let data = this.createServerData();\n        data[\"assignment_id\"] = assignment_id;\n        this._postBlocking(\"loadAssignment\", data, 4,\n                           (response) => {\n                               if (response.success) {\n                                   this.main.loadAssignmentData_(response);\n                               } else {\n                                   this.setStatus(\"loadAssignment\", StatusState.FAILED, response.message);\n                                   this.main.components.dialog.ERROR_LOADING_ASSIGNMNENT(response.message);\n                               }\n                           },\n                           (e, textStatus, errorThrown) => {\n                               this.main.components.dialog.ERROR_LOADING_ASSIGNMNENT(textStatus);\n                               console.error(e, textStatus, errorThrown);\n                           });\n    } else {\n        this.setStatus(\"loadAssignment\", StatusState.OFFLINE);\n    }\n};\n\nBlockPyServer.prototype.saveAssignment = function () {\n    let model = this.main.model;\n    if (model.ui.server.isEndpointConnected(\"saveAssignment\")) {\n        let data = this.createServerData();\n        data[\"hidden\"] = model.assignment.hidden();\n        data[\"reviewed\"] = model.assignment.reviewed();\n        data[\"public\"] = model.assignment.public();\n        data[\"url\"] = model.assignment.url();\n        data[\"points\"] = model.assignment.points();\n        data[\"ip_ranges\"] = model.assignment.ipRanges();\n        data[\"name\"] = model.assignment.name();\n        data[\"settings\"] = saveAssignmentSettings(model);\n\n        this._postBlocking(\"saveAssignment\", data, 3,\n                           this.startPossibleFork.bind(this),\n                           (e, textStatus, errorThrown) => {\n                               this.main.components.dialog.ERROR_SAVING_ASSIGNMNENT(textStatus);\n                               console.error(e, textStatus, errorThrown);\n                           });\n    } else {\n        this.setStatus(\"saveAssignment\", StatusState.OFFLINE, \"Server is not connected! (Save Assignment)\");\n    }\n};\n\nBlockPyServer.prototype.loadHistory = function (callback) {\n    if (this.main.model.ui.server.isEndpointConnected(\"loadHistory\")) {\n        let model = this.main.model;\n        let data = this.createServerData();\n        this._postBlocking(\"loadHistory\", data, 2, callback,\n                           (e, textStatus, errorThrown) => {\n                               this.main.components.dialog.ERROR_LOADING_HISTORY();\n                               console.error(e, textStatus, errorThrown);\n                           });\n    }\n};\n\nBlockPyServer.prototype.listUploadedFiles = function (callback) {\n    if (this.main.model.ui.server.isEndpointConnected(\"listUploadedFiles\")) {\n        let model = this.main.model;\n        let data = this.createServerData();\n        this._postBlocking(\"listUploadedFiles\", data, 2, callback,\n                           (e, textStatus, errorThrown) => {\n                               this.main.components.dialog.ERROR_LISTING_UPLOADED_FILES(textStatus);\n                               console.error(e, textStatus, errorThrown);\n                           });\n    }\n};\n\nBlockPyServer.prototype.uploadFile = function (placement, directory, filename, contents, callback, deleteInstead=false) {\n    let model = this.main.model;\n    if (model.ui.server.isEndpointConnected(\"uploadFile\")) {\n        let data = this.createServerData();\n        data[\"placement\"] = placement;\n        data[\"directory\"] = directory;\n        data[\"filename\"] = filename;\n        data[\"contents\"] = contents;\n        if (deleteInstead) {\n            data[\"delete\"] = true;\n        }\n        let fd = Object.entries(data).reduce((d,e) => (d.append(...e), d), new FormData());\n        return this._postBlocking(\"uploadFile\", fd, 3,\n                                  callback,\n                                  (e, textStatus, errorThrown) => {\n                                      if (deleteInstead) {\n                                          this.main.components.dialog.ERROR_DELETING_FILE(textStatus);\n                                      } else {\n                                          this.main.components.dialog.ERROR_UPLOADING_FILE(textStatus);\n                                      }\n                                      console.error(e, textStatus, errorThrown);\n                                  }, {processData: false, contentType: false});\n    } else {\n        this.setStatus(\"uploadFile\", StatusState.OFFLINE, \"Server is not connected! (Upload File)\");\n    }\n};\n\nBlockPyServer.prototype.downloadFile = function (placement, directory, filename, callback) {\n    let model = this.main.model;\n    if (model.ui.server.isEndpointConnected(\"downloadFile\")) {\n        let data = this.createServerData();\n        data[\"placement\"] = placement;\n        data[\"directory\"] = directory;\n        data[\"filename\"] = filename;\n        let fd = Object.entries(data).reduce((d,e) => (d.append(...e), d), new FormData());\n        return this._postBlocking(\"downloadFile\", fd, 3,\n                                  callback,\n                                  (e, textStatus, errorThrown) => {\n                                      this.main.components.dialog.ERROR_DOWNLOADING_FILE(textStatus);\n                                      console.error(e, textStatus, errorThrown);\n                                  }, {processData: false, contentType: false, dataType: \"text\"});\n    } else {\n        this.setStatus(\"uploadFile\", StatusState.OFFLINE, \"Server is not connected! (Upload File)\");\n    }\n};\n\nBlockPyServer.prototype.renameFile = function (placement, directory, old_filename, new_filename, callback) {\n    let model = this.main.model;\n    if (model.ui.server.isEndpointConnected(\"renameFile\")) {\n        let data = this.createServerData();\n        data[\"placement\"] = placement;\n        data[\"directory\"] = directory;\n        data[\"old_filename\"] = old_filename;\n        data[\"new_filename\"] = new_filename;\n        let fd = Object.entries(data).reduce((d,e) => (d.append(...e), d), new FormData());\n        return this._postBlocking(\"renameFile\", fd, 3,\n                                  callback,\n                                  (e, textStatus, errorThrown) => {\n                                      this.main.components.dialog.ERROR_UPLOADING_FILE(textStatus);\n                                      console.error(e, textStatus, errorThrown);\n                                  }, {processData: false, contentType: false});\n    } else {\n        this.setStatus(\"renameFile\", StatusState.OFFLINE, \"Server is not connected! (Rename File)\");\n    }\n};\n\nBlockPyServer.prototype.logEvent = function (event_type, category, label, message, file_path) {\n    if (this.main.model.display.readOnly()) {\n        this.setStatus(\"logEvent\", StatusState.OFFLINE);\n        return;\n    }\n    if (this.main.model.ui.server.isEndpointConnected(\"logEvent\")) {\n        let data = this.createServerData();\n        data[\"event_type\"] = event_type;\n        data[\"category\"] = category;\n        data[\"label\"] = label;\n        data[\"message\"] = message;\n        data[\"file_path\"] = file_path;\n        this.setStatus(\"logEvent\", StatusState.ACTIVE);\n        // Trigger request\n        this._postRetry(data, \"logEvent\", 0, () => {\n        });\n    } else {\n        this.setStatus(\"logEvent\", StatusState.OFFLINE);\n    }\n};\n\nBlockPyServer.prototype.saveImage = function (directory, image) {\n    if (this.main.model.display.readOnly()) {\n        this.setStatus(\"saveImage\", StatusState.OFFLINE);\n        return;\n    }\n    if (this.main.model.ui.server.isEndpointConnected(\"saveImage\")) {\n        let data = this.createServerData();\n        data[\"directory\"] = directory;\n        data[\"image\"] = image;\n        this.setStatus(\"saveImage\", StatusState.ACTIVE);\n        // Trigger request\n        this._postLatestRetry(data, \"turtle_output\", \"saveImage\", 0);\n    } else {\n        this.setStatus(\"saveImage\", StatusState.OFFLINE);\n    }\n};\n\nBlockPyServer.prototype.updateSubmissionStatus = function(newStatus) {\n    if (this.main.model.display.readOnly()) {\n        this.setStatus(\"updateSubmissionStatus\", StatusState.OFFLINE);\n        return;\n    }\n    if (this.main.model.ui.server.isEndpointConnected(\"updateSubmissionStatus\")) {\n        let data = this.createServerData();\n        data[\"status\"] = newStatus;\n        let postStatusChange = (data) => {\n            if (data.success) {\n                this.main.model.submission.submissionStatus(newStatus);\n            }\n        };\n        this._postBlocking(\"updateSubmissionStatus\", data, 2, postStatusChange,\n                           (e, textStatus, errorThrown) => {\n                               this.main.components.dialog.ERROR_UPDATING_SUBMISSION_STATUS();\n                               console.error(e, textStatus, errorThrown);\n                           });\n    }\n};\n\n/**\n * This function can be used to load files and web resources.\n *\n * DEPRECATED\n */\nBlockPyServer.prototype.loadFile = function (filename, type, callback, errorCallback) {\n    var model = this.main.model;\n    var server = this;\n    if (model.ui.server.isEndpointConnected(\"load_file\")) {\n        var data = this.createServerData();\n        data[\"filename\"] = filename;\n        data[\"type\"] = type;\n        this._postBlocking(this.urls.load_file, data, 5,\n                           function (response) {\n                               if (response.success) {\n                                   callback(response.data);\n                               } else {\n                                   errorCallback(response.message);\n                                   server.setStatus(\"loadFile\", StatusState.FAILED, response.message);\n                               }\n                           },\n                           function (e, textStatus, errorThrown) {\n                               errorCallback(\"Server failure! Report to instructor\");\n                               console.error(errorThrown);\n                           });\n    } else {\n        errorCallback(\"No file server available.\");\n        this.setStatus(\"loadFile\", StatusState.OFFLINE, \"Server is not connected! (Load File)\");\n    }\n};\n\nBlockPyServer.prototype.saveFile = function (filename, contents, delay) {\n    if (delay === undefined) {\n        delay = this.TIMER_DELAY;\n    }\n    let model = this.main.model;\n    if (model.display.readOnly()) {\n        this.setStatus(\"saveFile\", StatusState.OFFLINE);\n        return;\n    }\n    if (model.ui.server.isEndpointConnected(\"saveFile\")) {\n        let data = this.createServerData();\n        data[\"filename\"] = filename;\n        data[\"code\"] = contents;\n        this.setStatus(\"saveFile\", StatusState.ACTIVE);\n        return this._postLatestRetry(data, filename, \"saveFile\", delay, this.startPossibleFork.bind(this));\n    } else {\n        return this.setStatus(\"saveFile\", StatusState.OFFLINE);\n    }\n};\n\nBlockPyServer.prototype.startPossibleFork = function (response) {\n    if (!response.success && response.forkable) {\n        this.main.components.dialog.OFFER_FORK();\n    }\n};\n\nBlockPyServer.prototype.updateSubmission = function (score, correct, hiddenOverride, forceUpdate) {\n    if (this.main.model.display.readOnly()) {\n        this.setStatus(\"updateSubmission\", StatusState.OFFLINE);\n        return;\n    }\n    let callback = this.main.model.configuration.callbacks.success;\n    if (this.main.model.ui.server.isEndpointConnected(\"updateSubmission\")) {\n        let data = this.createServerData();\n        data[\"score\"] = score;\n        data[\"correct\"] = correct;\n        data[\"hidden_override\"] = hiddenOverride;\n        data[\"force_update\"] = forceUpdate;\n        this.main.components.pythonEditor.bm.blockEditor.getPngFromBlocks((pngData, img) => {\n            data[\"image\"] = pngData;\n            if (img.remove) {\n                img.remove();\n            }\n            this._postRetry(data, \"updateSubmission\", 0,\n                            (response) => {\n                                if (response.success) {\n                                    this.setStatus(\"updateSubmission\", StatusState.READY);\n                                } else {\n                                    this.setStatus(\"updateSubmission\", StatusState.FAILED, response.message);\n                                }\n                                if (!hiddenOverride && correct && callback) {\n                                    callback(data[\"assignment_id\"]);\n                                }\n                            });\n        });\n    }\n};\n\nBlockPyServer.prototype.openaiProxy = function (openai_data) {\n    var model = this.main.model;\n    var server = this;\n    var data = this.createServerData();\n    data[\"openai_data\"] = openai_data;\n    return this._postBlocking(this.urls.openai_proxy, data);\n};"
  },
  {
    "path": "src/skulpt_modules/coverage.js",
    "content": "export const $sk_mod_coverage = `\n\"\"\"\nHideous fill-in replacement for Coverage, leveraging some magic from the\nUtility function. The data this returns is false - it doesn't actually\ndescribe the missing lines and all lines; it just describes the traced lines.\nBut since Pedal doesn't need the other two, it works out fine when you do:\n\nstatements - missing\n\"\"\"\n\nimport utility\n\nclass Coverage:\n    def start(self):\n        pass\n\n    def stop(self):\n        pass\n\n    def save(self):\n        pass\n\n    def _analyze(self, filename: str):\n        lines = set(utility.trace_lines())\n        # lines will be the lines that were actually executed\n        return Analysis(None, len(lines), None, set(), lines)\n\n\nclass Numbers:\n    def __init__(self, n_missing, n_statements, pc_covered):\n        self.n_missing = n_missing\n        self.n_statements = n_statements\n        self.pc_covered = pc_covered\n\n\nclass Analysis:\n    def __init__(self, n_missing, n_statements, pc_covered, missing, statements):\n        self.missing = missing\n        self.statements = statements\n        self.numbers = Numbers(n_missing, n_statements, pc_covered)\n\n\nclass python:\n    def get_python_source(self):\n        return None\n`;"
  },
  {
    "path": "src/skulpt_modules/image.js",
    "content": "export var $builtinmodule = function(name) {\n    var mod, sampleWrapper;\n    mod = {__name__: \"image\"};\n\n    if (!Sk.PIL) {\n        Sk.PIL = {assets: {}};\n    }\n\n    // InstantPromise is a workaround to allow usage of the clean promise-style\n    // then/catch syntax but to instantly call resolve the then/catch chain so we\n    // can avoid creating Suspensions in unnecessary cases.  This is desirable\n    // because Suspensions have a fairly large negative impact on overall\n    // performance.  These 'instant promises' come into play when a tracer()\n    // call is made with a value other than 1.  When tracer is 0 or greater than 1\n    // , we can bypass the creation of a Suspension and proceed to the next line of\n    // code immediately if the current line is not going to involve a screen\n    // update. We determine if a real promise or InstantPromise is necessary by\n    // checking FrameManager.willRenderNext()\n    function InstantPromise(err, result) {\n        this.lastResult = result;\n        this.lastError  = err;\n    }\n\n    InstantPromise.prototype.then = function(cb) {\n        if (this.lastError) {\n            return this;\n        }\n\n        try {\n            this.lastResult = cb(this.lastResult);\n        } catch(e) {\n            this.lastResult = undefined;\n            this.lastError  = e;\n        }\n\n        return this.lastResult instanceof Promise ? this.lastResult : this;\n    };\n\n    InstantPromise.prototype.catch = function(cb) {\n        if (this.lastError) {\n            try {\n                this.lastResult = cb(this.lastError);\n                this.lastError  = undefined;\n            } catch(e) {\n                this.lastResult = undefined;\n                this.lastError = e;\n            }\n        }\n\n        return this.lastResult instanceof Promise ? this.lastResult : this;\n    };\n\n    var buildImage = function(imageData) {\n\n    };\n\n    function getAsset(name) {\n        return new Promise(function(resolve, reject) {\n            if (Sk.PIL.assets[name] !== undefined) {\n                //return Sk.PIL.assets[name];\n                resolve(Sk.PIL.assets[name]);\n            } else {\n                var img = new Image();\n                img.crossOrigin = \"Anonymous\";\n                img.onload = function () {\n                    Sk.PIL.assets[name] = img;\n                    resolve(img);\n                };\n                img.onerror = function () {\n                    //throw new Error(\"Failed to load asset: \" + name);\n                    reject(name);\n                };\n                img.src = name;\n            }\n        });\n    }\n\n    var image = function($gbl, $loc) {\n        // open(filename) or open(url)\n        // show()\n\n        $loc.__init__ = new Sk.builtin.func(function (self, file_or_url) {\n            Sk.builtin.pyCheckArgs(\"__init__\", arguments, 2, 2);\n            Sk.builtin.pyCheckType(\"file_or_url\", \"string\", Sk.builtin.checkString(file_or_url));\n            self.file_or_url = file_or_url;\n            // TODO: Change to suspension\n            var imagePromise = getAsset(Sk.ffi.remapToJs(file_or_url));\n            var susp = new Sk.misceval.Suspension();\n            self.image = Sk.builtin.none.none$;\n            susp.resume = function() {\n                if (susp.data[\"error\"]) {\n                    //throw new Sk.builtin.IOError(susp.data[\"error\"].message);\n                    throw susp.data[\"error\"];\n                } else {\n                    //return self.image;\n                }\n            };\n            susp.data = {\n                type: \"Sk.promise\",\n                promise: imagePromise.then(function(value) {\n                    self.image = value;\n                    self.canvas = document.createElement(\"canvas\");\n                    self.canvas.width = self.image.width;\n                    self.canvas.height = self.image.height;\n                    self.canvas.getContext(\"2d\").drawImage(self.image, 0, 0, self.image.width, self.image.height);\n                    self.pixels = self.canvas.getContext(\"2d\").getImageData(0, 0, self.image.width, self.image.height).data;\n                    //return value;\n                }, function(err) {\n                    self.image = \"\";\n                    throw err;\n                    //return err;\n                })\n            };\n\n            return susp;\n        });\n\n        $loc.show = new Sk.builtin.func(function(self) {\n            if (Sk.console === undefined) {\n                throw new Sk.builtin.NameError(\"Can not resolve drawing area. Sk.console is undefined!\");\n            }\n\n            var consoleData = {\n                image: self.image,\n                file_or_url: self.file_or_url\n            };\n\n            Sk.console.printPILImage(consoleData);\n        });\n\n        $loc.flip = new Sk.builtin.func(function(self) {\n            self.image.style.transform = \"scaleX(-1)\";\n            if (Sk.console === undefined) {\n                throw new Sk.builtin.NameError(\"Can not resolve drawing area. Sk.console is undefined!\");\n            }\n            return self;\n        });\n    };\n    mod.Image = Sk.misceval.buildClass(mod, image, \"Image\", []);\n\n    return mod;\n};"
  },
  {
    "path": "src/skulpt_modules/matplotlib2.js",
    "content": "Sk.jsplotlib = Sk.jsplotlib || {};\n\n// Skulpt translation\nexport let $builtinmodule = function (name) {\n    let mod = {__name__: \"matplotlib.pyplot\"};\n\n    const STRING_COLOR = new Sk.builtin.str(\"color\");\n    const STRING_COLORS = new Sk.builtin.str(\"colors\");\n    const STRING_DATA = new Sk.builtin.str(\"data\");\n    const STRING_LABEL = new Sk.builtin.str(\"label\");\n    const STRING_ALPHA = new Sk.builtin.str(\"alpha\");\n    const STRING_DASH_CAPSTYLE = new Sk.builtin.str(\"dash_capstyle\");\n    const STRING_DASH_JOINSTYLE = new Sk.builtin.str(\"dash_joinstyle\");\n    const STRING_FILLSTYLE = new Sk.builtin.str(\"fillstyle\");\n    const STRING_LINEWIDTH = new Sk.builtin.str(\"linewidth\");\n    const STRING_MARKER = new Sk.builtin.str(\"marker\");\n    const STRING_LINESTYLE = new Sk.builtin.str(\"linestyle\");\n    const STRING_LINESTYLES = new Sk.builtin.str(\"linestyles\");\n    const STRING_BINS = new Sk.builtin.str(\"bins\");\n    const STRING_ALIGN = new Sk.builtin.str(\"align\");\n    const STRING_DOT_LIMIT = new Sk.builtin.str(\"dot_limit\");\n    const STRING_S = new Sk.builtin.str(\"s\");\n    const STRING_C = new Sk.builtin.str(\"c\");\n    const STRING_LINEWIDTHS = new Sk.builtin.str(\"linewidths\");\n    const STRING_EDGECOLORS = new Sk.builtin.str(\"edgecolors\");\n    const STRING_WIDTH = new Sk.builtin.str(\"width\");\n    const STRING_TICK_LABEL = new Sk.builtin.str(\"tick_label\");\n    const STRING_ROTATION = new Sk.builtin.str(\"rotation\");\n\n    const DEFAULT_PLOT_PADDING = .5;\n\n\n    if (Sk.console === undefined) {\n        throw new Sk.builtin.NameError(\"Can not resolve drawing area. Sk.console is undefined!\");\n    }\n    function getConsole() {\n        return Sk.console;\n    }\n\n    // Unique ID generator for charts\n    let chartCounter = 0;\n\n    function makePlot(type, data, style, label) {\n        return {\n            type: type,\n            data: data,\n            style: style,\n            label: label\n        };\n    }\n\n    function makeChart() {\n        let margin = {top: 20, right: 30, bottom: 50, left: 40};\n        let chartIdNumber = chartCounter++;\n        return {\n            plots: [],\n            labels: {\n                title: \"\",\n                \"x-axis\": \"\",\n                \"y-axis\": \"\"\n            },\n            extents: {\n                xMin: null,\n                xMax: null,\n                yMin: null,\n                yMax: null\n            },\n            ticks: {\n                x: {},\n                y: {},\n                xRotate: \"horizontal\",\n                yRotate: \"horizontal\",\n                xEstimate: new Set(),\n                yEstimate: new Set()\n            },\n            margin: margin,\n            width: getConsole().getWidth() - margin.left - margin.right,\n            height: getConsole().getHeight() - margin.top - margin.bottom,\n            idNumber: chartIdNumber,\n            id: \"chart\" + chartIdNumber,\n            colorCycle: 0\n        };\n    }\n\n    function updateExtent(chart, attr, array, padding) {\n        if (padding === undefined) {\n            padding = 0;\n        }\n        if (chart.extents[attr + \"Min\"] === null) {\n            chart.extents[attr + \"Min\"] = d3.min(array)-padding;\n        } else {\n            chart.extents[attr + \"Min\"] = Math.min(d3.min(array)-padding, chart.extents[attr + \"Min\"]);\n        }\n        if (chart.extents[attr + \"Max\"] === null) {\n            chart.extents[attr + \"Max\"] = d3.max(array)+padding;\n        } else {\n            chart.extents[attr + \"Max\"] = Math.max(d3.max(array)+padding, chart.extents[attr + \"Max\"]);\n        }\n    }\n\n    let chart = null;\n    function getChart() {\n        if (!chart) {\n            chart = makeChart();\n        }\n        return chart;\n    }\n\n    function resetChart() {\n        chart = makeChart();\n    }\n\n    function parseFormat(styleString, chart, kwargs, defaultLinestyle, defaultMarker) {\n        // TODO: Handle ls, lw, and other abbreviated keyword parameters\n        let format = {\n            alpha: getKeywordParameter(kwargs, STRING_ALPHA, null),\n            dash_capstyle: getKeywordParameter(kwargs, STRING_DASH_CAPSTYLE, \"butt\"),\n            dash_joinstyle: getKeywordParameter(kwargs, STRING_DASH_JOINSTYLE, \"miter\"),\n            fillstyle: getKeywordParameter(kwargs, STRING_FILLSTYLE, \"full\"),\n            linewidth: getKeywordParameter(kwargs, STRING_LINEWIDTH, 1),\n        };\n        if (styleString) {\n            let ftmTuple = Sk.jsplotlib._process_plot_format(styleString);\n            format[\"linestyle\"] = getKeywordParameter(kwargs, STRING_LINESTYLE, ftmTuple.linestyle);\n            format[\"marker\"] = getKeywordParameter(kwargs, STRING_MARKER, Sk.jsplotlib.parse_marker(ftmTuple.marker));\n            format[\"color\"] = getKeywordParameter(kwargs, STRING_COLOR, Sk.jsplotlib.color_to_hex(ftmTuple.color));\n        } else {\n            let cycle = Sk.jsplotlib.rc[\"axes.color_cycle\"];\n            format[\"linestyle\"] = getKeywordParameter(kwargs, STRING_LINESTYLE, defaultLinestyle);\n            format[\"marker\"] = getKeywordParameter(kwargs, STRING_MARKER, defaultMarker);\n            format[\"color\"] = getKeywordParameter(kwargs, STRING_COLOR, Sk.jsplotlib.color_to_hex(cycle[chart.colorCycle % cycle.length]));\n            chart.colorCycle += 1;\n        }\n        return format;\n    }\n\n    function getIndices(values) {\n        return values.map((value, index) => index);\n    }\n\n    function chompPlotArgs(args, data) {\n        if (data !== null) {\n            if (args.length >= 2) {\n                throw new Sk.builtin.ValueError(\"Must provide at least 2 arguments when plotting with 'data' keyword\");\n            }\n            let xAttr = args[0];\n            let yAttr = args[1];\n            let xs = [], ys = [];\n            const values = Sk.misceval.arrayFromIterable(data);\n            for (let i = 0; i < values.length; i++) {\n                if (values[i].sq$contains(xAttr)) {\n                    xs.push(values[i].mp$subscript(xAttr));\n                    ys.push(values[i].mp$subscript(yAttr));\n                } else {\n                    throw new Sk.builtin.ValueError(`Item at index ${i} is missing expected attribute.`);\n                }\n            }\n            return [xs, ys, args[2]];\n        } else {\n            // x, y, style\n            if (args.length >= 3) {\n                if (Sk.builtin.checkString(args[2])) {\n                    return [[args[0], args[1], args[2]].map(Sk.ffi.remapToJs)].concat(chompPlotArgs(args.slice(3), data));\n                }\n            }\n            if (args.length >= 2) {\n                let ys = Sk.ffi.remapToJs(args[0]);\n                if (Sk.builtin.checkString(args[1])) {\n                    // y, style\n                    let xs = getIndices(ys);\n                    let style = Sk.ffi.remapToJs(args[1]);\n                    return [[xs, ys, style]].concat(chompPlotArgs(args.slice(2), data));\n                } else {\n                    // x, y\n                    let xs = ys;\n                    ys = Sk.ffi.remapToJs(args[1]);\n                    return [[xs, ys, \"\"]].concat(chompPlotArgs(args.slice(2), data));\n                }\n            }\n            if (args.length >= 1) {\n                // y\n                let ys = Sk.ffi.remapToJs(args[0]);\n                let xs = getIndices(ys);\n                return [[xs, ys, \"\"]].concat(chompPlotArgs(args.slice(1), data));\n            }\n            return [];\n        }\n    }\n\n    function getKeywordParameter(kwargs, key, otherwise) {\n        if (kwargs.sq$contains(key)) {\n            return Sk.ffi.remapToJs(kwargs.mp$subscript(key));\n        } else {\n            return otherwise;\n        }\n    }\n\n    function updateTickEstimates(chart, xValues, yValues) {\n        xValues.forEach(value => chart.ticks.xEstimate.add(value));\n        yValues.forEach(value => chart.ticks.yEstimate.add(value));\n    }\n\n    // Main plotting function\n    let plot_f = function (kwa) {\n        // Parse arguments\n        Sk.builtin.pyCheckArgs(\"plot\", arguments, 1, Infinity, true, false);\n        let args = Array.prototype.slice.call(arguments, 1);\n        let kwargs = new Sk.builtins.dict(kwa); // Get argument as object\n        let data = getKeywordParameter(kwargs, STRING_DATA, null);\n        let label = getKeywordParameter(kwargs, STRING_LABEL, null);\n        let chart = getChart();\n        let plotData = chompPlotArgs(args, data);\n        for (let i=0; i<plotData.length; i+= 1) {\n            let plotDatum = plotData[i];\n            let zippedData = d3.zip(plotDatum[0], plotDatum[1]).map(value => {return {x: value[0], y: value[1]};});\n            let style = parseFormat(plotDatum[2], chart, kwargs, \"-\", \"\");\n            let plot = makePlot(\"line\", zippedData, style, label);\n            chart.plots.push(plot);\n            updateExtent(chart, \"x\", plotDatum[0], DEFAULT_PLOT_PADDING);\n            updateExtent(chart, \"y\", plotDatum[1], DEFAULT_PLOT_PADDING);\n            updateTickEstimates(chart, plotDatum[0], plotDatum[1]);\n        }\n    };\n    plot_f.co_kwargs = true;\n    mod.plot = new Sk.builtin.func(plot_f);\n\n\n    let hist_f = function (kwa) {\n        // Parse arguments\n        Sk.builtin.pyCheckArgs(\"hist\", arguments, 1, Infinity, true, false);\n        let args = Array.prototype.slice.call(arguments, 1);\n        let kwargs = new Sk.builtins.dict(kwa); // Get argument as object\n\n        // Parse different args combinations\n        let plotData = Sk.ffi.remapToJs(args[0]);\n        if (plotData.length > 0) {\n            if (!Array.isArray(plotData[0])) {\n                plotData = [plotData];\n            }\n        }\n\n        let label = getKeywordParameter(kwargs, STRING_LABEL, null);\n        let chart = getChart();\n        for (let i=0; i<plotData.length; i+= 1) {\n            let plotDatum = plotData[i];\n            let style = parseFormat(null, chart, kwargs, \"\", \"\");\n            let plot = makePlot(\"hist\", plotDatum, style, label);\n            plot.bins = getKeywordParameter(kwargs, STRING_BINS, null);\n            plot.align = getKeywordParameter(kwargs, STRING_ALIGN, \"mid\");\n            let estimatedBins = plotDatum;\n            if (Array.isArray(plot.bins)) {\n                let max = d3.max(plot.bins), min = d3.min(plot.bins);\n                plot.data = plotDatum = plot.data.map((value) => Math.max(Math.min(value, max), min));\n                estimatedBins = plot.bins;\n            }\n            chart.plots.push(plot);\n            updateExtent(chart, \"x\", plotDatum, DEFAULT_PLOT_PADDING);\n            updateTickEstimates(chart, estimatedBins, d3.range(plotDatum.length));\n        }\n        // Ensure that the axis line is always the middle!\n        updateExtent(chart, \"y\", [0]);\n    };\n    hist_f.co_kwargs = true;\n    mod.hist = new Sk.builtin.func(hist_f);\n\n    let scatter_f = function (kwa) {\n        // Parse arguments\n        Sk.builtin.pyCheckArgs(\"scatter\", arguments, 1, Infinity, true, false);\n        let args = Array.prototype.slice.call(arguments, 1);\n        let kwargs = new Sk.builtins.dict(kwa); // Get argument as object\n\n        let data = getKeywordParameter(kwargs, STRING_DATA, null);\n        let label = getKeywordParameter(kwargs, STRING_LABEL, null);\n\n        let plotData = chompPlotArgs(args, data);\n\n        // Special dot_limit parameter to prevent crashing from too many dots in browser\n        let dotLimit = getKeywordParameter(kwargs, STRING_DOT_LIMIT, 256);\n        if (plotData[0] && plotData[0].length > dotLimit) {\n            let xSampled = [], ySampled = [];\n            let LENGTH = plotData[0].length, RATE = LENGTH / dotLimit;\n            for (let i = 0; i < dotLimit; i += 1) {\n                let index = Math.floor((i + Math.random()) * RATE);\n                xSampled.push(plotData[0][index]);\n                ySampled.push(plotData[1][index]);\n            }\n            plotData[0] = xSampled;\n            plotData[1] = ySampled;\n        }\n\n\n        let chart = getChart();\n        for (let i=0; i<plotData.length; i+= 1) {\n            let plotDatum = plotData[i];\n            let style = parseFormat(plotDatum[2], chart, kwargs, \" \", \"o\");\n            let zippedData = d3.zip(plotDatum[0], plotDatum[1]).map(value => {return {x: value[0], y: value[1]};});\n            let plot = makePlot(\"scatter\", zippedData, style, label);\n            plot.sizes = getKeywordParameter(kwargs, STRING_S, null);\n            plot.colors = getKeywordParameter(kwargs, STRING_C, null);\n            plot.linewidths = getKeywordParameter(kwargs, STRING_LINEWIDTHS, 1.5);\n            plot.edgecolors = getKeywordParameter(kwargs, STRING_EDGECOLORS, \"face\");\n            chart.plots.push(plot);\n            updateExtent(chart, \"x\", plotDatum[0], DEFAULT_PLOT_PADDING);\n            updateExtent(chart, \"y\", plotDatum[1], DEFAULT_PLOT_PADDING);\n            updateTickEstimates(chart, plotDatum[0], plotDatum[1]);\n        }\n    };\n    scatter_f.co_kwargs = true;\n    mod.scatter = new Sk.builtin.func(scatter_f);\n\n    let bar_f = function (kwa) {\n        // Parse arguments\n        Sk.builtin.pyCheckArgs(\"bar\", arguments, 1, Infinity, true, false);\n        let args = Array.prototype.slice.call(arguments, 1);\n        let kwargs = new Sk.builtins.dict(kwa); // Get argument as object\n\n        let data = getKeywordParameter(kwargs, STRING_DATA, null);\n        let label = getKeywordParameter(kwargs, STRING_LABEL, null);\n        let tickLabels = getKeywordParameter(kwargs, STRING_TICK_LABEL, []);\n\n        let plotData = chompPlotArgs(args, data);\n\n        let chart = getChart();\n        for (let i=0; i<plotData.length; i+= 1) {\n            let plotDatum = plotData[i];\n            let zippedData = d3.zip(plotDatum[0], plotDatum[1]).map(value => {return {x: value[0], y: value[1]};});\n            let style = parseFormat(null, chart, kwargs, \"\", \"\");\n            let plot = makePlot(\"bar\", zippedData, style, label);\n            plot.width = getKeywordParameter(kwargs, STRING_WIDTH, 0.8);\n            plot.align = getKeywordParameter(kwargs, STRING_ALIGN, \"center\");\n            for (let x=0; x<Math.min(tickLabels.length, plotDatum[0].length); x+=1) {\n                chart.ticks.x[plotDatum[0][x]] = tickLabels[x];\n            }\n            chart.plots.push(plot);\n            let lowestX = d3.min(plotDatum[0])-(plot.align === \"center\" ? 1 : 0), lowestY = d3.max(plotDatum[0])+1;\n            updateExtent(chart, \"x\", plotDatum[0].concat([lowestX, lowestY])); // Account for width\n            updateExtent(chart, \"y\", plotDatum[1]);\n            updateTickEstimates(chart, plotDatum[0].concat([lowestX, lowestY]), plotDatum[1]);\n        }\n        // Ensure that the axis line is always the middle!\n        updateExtent(chart, \"y\", [-.1]);\n    };\n    bar_f.co_kwargs = true;\n    mod.bar = new Sk.builtin.func(bar_f);\n\n    let boxplot_f = function (kwa) {\n        // Parse arguments\n        Sk.builtin.pyCheckArgs(\"boxplot\", arguments, 1, Infinity, true, false);\n        let args = Array.prototype.slice.call(arguments, 1);\n        let kwargs = new Sk.builtins.dict(kwa); // Get argument as object\n\n        let plotData = Sk.ffi.remapToJs(args[0]);\n        let label = getKeywordParameter(kwargs, STRING_LABEL, null);\n        let chart = getChart();\n        let dataSorted = plotData.sort(d3.ascending);\n        let q1 = d3.quantile(dataSorted, .25);\n        let median = d3.quantile(dataSorted, .5);\n        let q3 = d3.quantile(dataSorted, .75);\n        let interQuantileRange = q3 - q1;\n        let min = d3.min(plotData);\n        let max = d3.max(plotData);\n        let data = {x: chart.plots.length+1, y: [min, q1, median, q3, max]};\n        let style = parseFormat(null, chart, kwargs, \"\", \"\");\n        let plot = makePlot(\"boxplot\", data, style, label);\n        chart.plots.push(plot);\n        console.log(plot);\n        updateExtent(chart, \"x\", [data.x-1, data.x, data.x+1]); // Account for width\n        updateExtent(chart, \"y\", data.y);\n        updateExtent(chart, \"y\", [-.1]);\n        updateTickEstimates(chart, [data.x-1, data.x+1], data.y);\n    };\n    boxplot_f.co_kwargs = true;\n    mod.boxplot = new Sk.builtin.func(boxplot_f);\n\n    function getLinesData(args) {\n        args = args.slice(0, 3).map(Sk.ffi.remapToJs);\n        let length = d3.max(args.filter(Array.isArray).map(a => a.length)) || 1;\n        args = args.map(a => Array.isArray(a) ? a : Array(length).fill(a));\n        return d3.zip(args[0], args[1], args[2]);\n    }\n\n    let hlines_f = function (kwa) {\n        // Parse arguments\n        Sk.builtin.pyCheckArgs(\"hlines\", arguments, 1, Infinity, true, false);\n        let args = Array.prototype.slice.call(arguments, 1);\n        let kwargs = new Sk.builtins.dict(kwa); // Get argument as object\n\n        let data = getKeywordParameter(kwargs, STRING_DATA, null);\n        let label = getKeywordParameter(kwargs, STRING_LABEL, null);\n        let colors = getKeywordParameter(kwargs, STRING_COLORS, null);\n        let linestyles = getKeywordParameter(kwargs, STRING_LINESTYLES, null);\n\n        let plotData = getLinesData(args);\n\n        let chart = getChart();\n        let style = parseFormat(null, chart, kwargs, \"\", \"\");\n        for (let i=0; i<plotData.length; i+= 1) {\n            let plotDatum = plotData[i];\n            let zippedData = {x1: plotDatum[1], x2: plotDatum[2], y1: plotDatum[0], y2: plotDatum[0]};\n            let plot = makePlot(\"one_line\", zippedData, style, label);\n            plot.color = Array.isArray(colors) ? colors[i] : plot.color;\n            plot.linestyle = linestyles === null ? plot.linestyle : linestyles;\n            chart.plots.push(plot);\n            updateExtent(chart, \"x\", [zippedData.x1, zippedData.x2]); // Account for width\n            updateExtent(chart, \"y\", [zippedData.y1, zippedData.y2]);\n            updateTickEstimates(chart, [zippedData.x1, zippedData.x2], [zippedData.y1, zippedData.y2]);\n        }\n    };\n    hlines_f.co_kwargs = true;\n    mod.hlines = new Sk.builtin.func(hlines_f);\n\n    let vlines_f = function (kwa) {\n        // Parse arguments\n        Sk.builtin.pyCheckArgs(\"vlines\", arguments, 1, Infinity, true, false);\n        let args = Array.prototype.slice.call(arguments, 1);\n        let kwargs = new Sk.builtins.dict(kwa); // Get argument as object\n\n        let data = getKeywordParameter(kwargs, STRING_DATA, null);\n        let label = getKeywordParameter(kwargs, STRING_LABEL, null);\n        let colors = getKeywordParameter(kwargs, STRING_COLORS, null);\n        let linestyles = getKeywordParameter(kwargs, STRING_LINESTYLES, null);\n\n        let plotData = getLinesData(args);\n\n        let chart = getChart();\n        let style = parseFormat(null, chart, kwargs, \"\", \"\");\n        for (let i=0; i<plotData.length; i+= 1) {\n            let plotDatum = plotData[i];\n            let zippedData = {x1: plotDatum[0], x2: plotDatum[0], y1: plotDatum[1], y2: plotDatum[2]};\n            let plot = makePlot(\"one_line\", zippedData, style, label);\n            plot.color = Array.isArray(colors) ? colors[i] : plot.color;\n            plot.linestyle = linestyles === null ? plot.linestyle : linestyles;\n            chart.plots.push(plot);\n            updateExtent(chart, \"x\", [zippedData.x1, zippedData.x2]); // Account for width\n            updateExtent(chart, \"y\", [zippedData.y1, zippedData.y2]);\n            updateTickEstimates(chart, [zippedData.x1, zippedData.x2], [zippedData.y1, zippedData.y2]);\n        }\n    };\n    vlines_f.co_kwargs = true;\n    mod.vlines = new Sk.builtin.func(vlines_f);\n\n    function getRotation(chart, dimension) {\n        let amount = chart.ticks[dimension+\"Rotate\"];\n        switch (amount) {\n            case \"horizontal\": return \"rotate(0)\";\n            case \"vertical\": return \"rotate(275)\";\n            default: return \"rotate(\"+(-amount)+\")\";\n        }\n    }\n\n    function attachCanvasToChart(chart, yAxisBuffer) {\n        let outputTarget = Sk.console.plot(chart);\n        chart.svg = d3.select(outputTarget.html[0]).append(\"div\").append(\"svg\");\n        chart.svg.attr(\"class\", \"chart\");\n        chart.svg.attr(\"width\", Sk.console.getWidth());\n        chart.svg.attr(\"height\", Sk.console.getHeight());\n        chart.svg.attr(\"chartCount\", chart.idNumber);\n\n        let translation = \"translate(\" + (chart.margin.left + yAxisBuffer) + \",\" + chart.margin.top + \")\";\n        chart.canvas = chart.svg.append(\"g\")\n            .attr(\"transform\", translation);\n        // X-axis\n        chart.canvas.append(\"g\")\n            .attr(\"class\", \"x axis\")\n            .attr(\"transform\", \"translate(0,\" + chart.height + \")\")\n            .call(chart.xAxis);\n        // Y-axis\n        chart.canvas.append(\"g\")\n            .attr(\"class\", \"y axis\")\n            .call(chart.yAxis);\n        // X-axis ticks\n        let xticks = chart.canvas.select(\".x.axis\")\n            .selectAll(\"text\")\n            .style(\"font-size\", \"12px\");\n        if (chart.ticks.xRotate !== \"horizontal\") {\n            xticks.style(\"text-anchor\", \"end\").attr(\"transform\", getRotation(chart, \"x\"));\n        }\n        // Y-axis ticks\n        let yticks = chart.canvas.select(\".y.axis\")\n            .selectAll(\"text\")\n            .style(\"font-size\", \"12px\");\n            //.style(\"text-anchor\", \"start\")\n        if (chart.ticks.yRotate !== \"horizontal\") {\n            yticks.attr(\"transform\", getRotation(chart, \"y\"));\n        }\n\n        translation = \"translate(\" + ((chart.width - yAxisBuffer) / 2) + \" ,\" + (chart.height + chart.margin.bottom - 14) + \")\";\n        // X-axis label\n        chart.canvas.append(\"text\")      // text label for the x axis\n            .attr(\"transform\", translation)\n            .attr(\"class\", \"x-axis-label\")\n            .style(\"font-size\", \"14px\")\n            .text(chart.labels[\"x-axis\"])\n            .style(\"text-anchor\", \"middle\");\n        // Y-axis label\n        chart.canvas.append(\"text\")\n            .attr(\"transform\", \"rotate(-90)\")\n            .attr(\"class\", \"y-axis-label\")\n            .attr(\"y\", 0 - chart.margin.left - yAxisBuffer)\n            .attr(\"x\", 0 - (chart.height / 2))\n            .attr(\"dy\", \"1em\")\n            .text(chart.labels[\"y-axis\"])\n            .style(\"font-size\", \"14px\")\n            .style(\"text-anchor\", \"middle\");\n        // Title text\n        chart.canvas.append(\"text\")\n            .attr(\"x\", ((chart.width - yAxisBuffer) / 2))\n            .attr(\"y\", 0 - (chart.margin.top / 2))\n            .attr(\"class\", \"title-text\")\n            .text(chart.labels[\"title\"])\n            .attr(\"text-anchor\", \"middle\")\n            .style(\"font-size\", \"14px\")\n            .style(\"text-decoration\", \"underline\");\n        // Hidden watermark\n        chart.canvas.append(\"text\")\n            .attr(\"x\", 0)\n            .attr(\"y\", 0)\n            .text(\"BlockPy\")\n            .style(\"stroke\", \"#FDFDFD\")\n            .style(\"font-size\", \"8px\");\n        // Additional CSS\n        chart.svg.insert(\"defs\", \":first-child\")\n            .append(\"style\")\n            .attr(\"type\", \"text/css\")\n            .text(\"svg { background-color: white; }\\n\" +\n                \".axis path,.axis line { fill: none; stroke: black; shape-rendering: crispEdges;}\\n\" +\n                \".line { fill: none; stroke-width: 1px;}\\n\" +\n                \".circle { r: 3; shape-rendering: crispEdges; }\\n\" +\n                \".bar { shape-rendering: crispEdges;}\\n\");\n        return chart;\n    }\n\n    function getDigits(value) {\n        return value.toLocaleString().length;\n    }\n\n    function isEmpty(obj) {\n        return Object.keys(obj).length === 0;\n    }\n\n    function makeHistogram(plot) {\n        let domain = d3.extent(plot.data);\n        // Adjust bin sizes to capture last group properly\n        if (Array.isArray(plot.bins)) {\n            domain[1] += 1;\n            plot.bins[plot.bins.length-1] += 1;\n        }\n        let histogram = d3.histogram().domain(domain);\n        if (plot.bins) {\n            histogram = histogram.thresholds(plot.bins);\n        }\n        let result = histogram(plot.data);\n        // Unadjust bin sizes\n        if (Array.isArray(plot.bins)) {\n            result[result.length - 1].x1 -= 1;\n        }\n        return result;\n    }\n\n    function finalizeHistogram(chart) {\n        if (!chart.plots.some(plot => plot.type === \"hist\")) {\n            return false;\n        }\n        let yMax = 0;\n        for (let i = 0; i < chart.plots.length; i += 1) {\n            let plot = chart.plots[i];\n            if (plot.type !== \"hist\") {\n                continue;\n            }\n            let histogram = makeHistogram(plot);\n            yMax = Math.max(yMax, d3.max(histogram, (d) => d.length));\n        }\n        chart.extents.yMax = Math.max(yMax, chart.extents.yMax);\n        return true;\n    }\n\n    function setupXScale(chart, yAxisBuffer) {\n        // Calculate an appropriate offset based on the width of the numbers on the axis\n        // Set up x-scaling\n        chart.xScale = d3.scaleLinear()\n            .domain([chart.extents.xMin, chart.extents.xMax])\n            .range([0, chart.width - yAxisBuffer]);\n        // Set up x-axis\n        chart.xAxis = d3.axisBottom()\n            .scale(chart.xScale);\n        // Choose a smaller number of ticks if few discrete points\n        if (chart.ticks.xEstimate.size < 10) {\n            console.log(chart.ticks.xEstimate.size);\n            chart.xAxis.ticks(chart.ticks.xEstimate.size);\n        }\n        // If necessary, add in X ticks\n        if (!isEmpty(chart.ticks.x)) {\n            chart.xAxis = chart.xAxis.ticks().tickFormat(function (d) {\n                return chart.ticks.x[d];\n            });\n        }\n    }\n\n    function setupYScale(chart) {\n        chart.yScale = d3.scaleLinear()\n            .domain([chart.extents.yMin, chart.extents.yMax])\n            .range([chart.height, 0]);\n        chart.yAxis = d3.axisLeft()\n            .scale(chart.yScale);\n        // Choose a smaller number of ticks if few discrete points\n        if (chart.ticks.yEstimate.size < 10) {\n            chart.yAxis.ticks(chart.ticks.yEstimate.size);\n        }\n        // If necessary, add in Y ticks\n        if (!isEmpty(chart.ticks.y)) {\n            chart.yAxis = chart.yAxis.ticks().tickFormat(function (d) {\n                return chart.ticks.y[d];\n            });\n        }\n    }\n\n    function finalizeChart(chart) {\n        let doctype = \"<?xml version=\\\"1.0\\\" standalone=\\\"no\\\"?>\" + \"<\" + \"!DOCTYPE svg PUBLIC \\\"-//W3C//DTD SVG 1.1//EN\\\" \\\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\\\">\";\n        let xml = new XMLSerializer().serializeToString(chart.svg.node());\n        let blob = new Blob([doctype + xml], {type: \"image/svg+xml\"});\n        let url = window.URL.createObjectURL(blob);\n        //var data = \"data:image/svg+xml;base64,\" + btoa(unescape(encodeURIComponent(xml)));\n        let anchor = document.createElement(\"a\");\n        let img = document.createElement(\"img\");\n        img.style.display = \"block\";\n        let oldChart = chart;\n        let filename = chart.labels.title;\n        resetChart();\n        //outputTarget.html[0].appendChild(img);\n        // TODO: Consider using the SVG as the actual image, and using this as the href\n        //       surrounding it instead.\n        oldChart.svg.node().parentNode.replaceChild(anchor, oldChart.svg.node());\n        img.onload = function () {\n            img.onload = null;\n            //TODO: Make this capture a class descendant. Cross the D3/Jquery barrier!\n            let canvas = document.createElement(\"canvas\");\n            canvas.width = Sk.console.getWidth();\n            canvas.height = Sk.console.getHeight();\n            let ctx = canvas.getContext(\"2d\");\n            ctx.drawImage(img, 0, 0);\n            let canvasUrl = canvas.toDataURL(\"image/png\");\n            img.setAttribute(\"src\", canvasUrl);\n            img.setAttribute(\"title\", \"Generated plot titled: \" + filename);\n            img.setAttribute(\"alt\", \"Generated plot titled: \" + filename);\n            anchor.setAttribute(\"href\", canvasUrl);\n            anchor.setAttribute(\"download\", filename);\n            // Snip off this chart, we can now start a new one.\n        };\n        img.onerror = function (e) {\n            console.error(e);\n        };\n        img.setAttribute(\"src\", url);\n        anchor.appendChild(img);\n    }\n\n    const DEFAULT_MARKER_SIZE = 2;\n\n    let show_f = function () {\n        let chart = getChart();\n\n        // Sanity checks\n        if (chart.plots.length === 0) {\n            return;\n        }\n        if (chart.extents.xMin === undefined || chart.extents.yMin === undefined) {\n            return;\n        }\n\n        // Establish x/y scalers and axes\n        let yAxisBuffer = 5 * Math.max(getDigits(chart.extents.xMin), getDigits(chart.extents.xMax),\n                                       getDigits(chart.extents.yMin), getDigits(chart.extents.yMin));\n        setupXScale(chart, yAxisBuffer);\n        finalizeHistogram(chart);\n        setupYScale(chart);\n\n        chart.mapX = d => chart.xScale(d.x);\n        chart.mapY = d => chart.yScale(d.y);\n        chart.mapLine = d3.line().x(chart.mapX).y(chart.mapY);\n        attachCanvasToChart(chart, yAxisBuffer);\n\n        // Actually draw the chart objects\n        for (let i = 0; i < chart.plots.length; i += 1) {\n            let plot = chart.plots[i];\n            switch (plot.type) {\n                case \"line\":\n                    chart.canvas.append(\"path\")\n                        .style(\"fill\", \"none\")\n                        .style(\"stroke\", plot.style.color)\n                        .style(\"stroke-width\", plot.style[\"linewidth\"])\n                        .style(\"fill-opacity\", plot.style[\"alpha\"])\n                        .attr(\"class\", \"line\")\n                        //.data(plot.data)\n                        .attr(\"d\", chart.mapLine(plot.data));\n                    break;\n                case \"one_line\":\n                    chart.canvas.append(\"line\")\n                        .style(\"stroke\", plot.style.color)\n                        .style(\"stroke-width\", plot.style[\"linewidth\"])\n                        .style(\"fill-opacity\", plot.style[\"alpha\"])\n                        .attr(\"x1\", chart.xScale(plot.data.x1))\n                        .attr(\"x2\", chart.xScale(plot.data.x2))\n                        .attr(\"y1\", chart.yScale(plot.data.y1) )\n                        .attr(\"y2\", chart.yScale(plot.data.y2) );\n                    break;\n                case \"scatter\":\n                    chart.canvas.append(\"g\")\n                        .attr(\"class\", \"series\")\n                        .selectAll(\".point\")\n                        .data(plot.data)\n                        // Entering\n                        .enter()\n                        .append(\"circle\")\n                        .style(\"fill\", (d, i) => {\n                            if (plot.colors == null) {\n                                return plot.style.color;\n                            } else if (Array.isArray(plot.colors)) {\n                                return plot.colors[i] || plot.style.color;\n                            } else {\n                                return plot.colors;\n                            }\n                        })\n                        .style(\"fill-opacity\", plot.style[\"alpha\"])\n                        .attr(\"class\", \"circle\")\n                        .attr(\"cx\", chart.mapX)\n                        .attr(\"cy\", chart.mapY)\n                        .attr(\"r\", (d, i) => {\n                            if (plot.sizes == null) {\n                                return DEFAULT_MARKER_SIZE;\n                            } else if (Array.isArray(plot.sizes)) {\n                                return plot.sizes[i] || DEFAULT_MARKER_SIZE;\n                            } else {\n                                return plot.sizes;\n                            }\n                        });\n                    break;\n                case \"hist\":\n                    let histogram = makeHistogram(plot);\n                    chart.canvas.selectAll(\".bar\")\n                        .data(histogram)\n                        // Enter\n                        .enter()\n                        .append(\"rect\")\n                        .attr(\"class\", \"bar\")\n                        .style(\"fill\", plot[\"style\"][\"color\"])\n                        .style(\"stroke\", \"black\")\n                        .attr(\"x\", function (d) {\n                            // TODO: Handle align\n                            return chart.xScale(d.x0);\n                        })\n                        .attr(\"width\", (d) => chart.xScale(d.x1) - chart.xScale(d.x0))\n                        .attr(\"y\", function (d) {\n                            return chart.yScale(d.length);\n                        })\n                        .attr(\"height\", function (d) {\n                            return chart.height - chart.yScale(d.length);\n                        });\n                    break;\n                case \"bar\":\n                    chart.canvas.selectAll(\".bar\")\n                        .data(plot.data)\n                        // Enter\n                        .enter()\n                        .append(\"rect\")\n                        .attr(\"class\", \"bar\")\n                        .style(\"fill\", plot[\"style\"][\"color\"])\n                        .style(\"stroke\", \"black\")\n                        .attr(\"x\", function (d) {\n                            let increment = (plot.align === \"center\" ? plot.width/2 : 0);\n                            return chart.xScale(d.x-increment);\n                        })\n                        .attr(\"width\", function (d) {\n                            return chart.xScale(d.x+plot.width) - chart.xScale(d.x);\n                        })\n                        .attr(\"y\", chart.mapY)\n                        .attr(\"height\", function (d) {\n                            return chart.height - chart.yScale(d.y);\n                        });\n                    break;\n                case \"boxplot\":\n                    const WIDTH = .6;\n                    chart.canvas.append(\"line\")\n                        .attr(\"x1\", chart.xScale(plot.data.x))\n                        .attr(\"x2\", chart.xScale(plot.data.x))\n                        .attr(\"y1\", chart.yScale(plot.data.y[0]) )\n                        .attr(\"y2\", chart.yScale(plot.data.y[1]) )\n                        .attr(\"stroke\", \"black\");\n                    chart.canvas.append(\"line\")\n                        .attr(\"x1\", chart.xScale(plot.data.x))\n                        .attr(\"x2\", chart.xScale(plot.data.x))\n                        .attr(\"y1\", chart.yScale(plot.data.y[3]) )\n                        .attr(\"y2\", chart.yScale(plot.data.y[4]) )\n                        .attr(\"stroke\", \"black\");\n                    chart.canvas.append(\"rect\")\n                        .attr(\"x\", chart.xScale(plot.data.x-WIDTH/2))\n                        .attr(\"y\", chart.yScale(plot.data.y[3]) )\n                        .attr(\"height\", (chart.yScale(plot.data.y[1])-chart.yScale(plot.data.y[3])))\n                        .attr(\"width\", chart.xScale(WIDTH) )\n                        .attr(\"stroke\", \"black\")\n                        .style(\"fill\", \"none\");\n                    chart.canvas.selectAll(\".boxplot\")\n                        .data([plot.data.y[0], plot.data.y[2], plot.data.y[4]])\n                        .enter()\n                        .append(\"line\")\n                        .attr(\"x1\", chart.xScale(plot.data.x-WIDTH/2))\n                        .attr(\"x2\", chart.xScale(plot.data.x+WIDTH/2))\n                        .attr(\"y1\", chart.yScale )\n                        .attr(\"y2\", chart.yScale )\n                        .attr(\"class\", \"boxplot\")\n                        .attr(\"stroke\", \"black\");\n                    break;\n            }\n        }\n        ////////////////////////////////////////////////////////////////////\n\n        finalizeChart(chart);\n    };\n    mod.show = new Sk.builtin.func(show_f);\n\n    let title_f = function (s) {\n        Sk.builtin.pyCheckArgs(\"title\", arguments, 1, 1);\n\n        if (!Sk.builtin.checkString(s)) {\n            throw new Sk.builtin.TypeError(\"'\" + Sk.abstr.typeName(s) +\n                \"' is not supported for title; should be a string.\");\n        }\n\n        getChart().labels[\"title\"] = Sk.ffi.remapToJs(s);\n    };\n    mod.title = new Sk.builtin.func(title_f);\n\n    let xlabel_f = function (s) {\n        Sk.builtin.pyCheckArgs(\"xlabel\", arguments, 1, 1);\n\n        if (!Sk.builtin.checkString(s)) {\n            throw new Sk.builtin.TypeError(\"'\" + Sk.abstr.typeName(s) +\n                \"' is not supported for xlabel; should be a string.\");\n        }\n        getChart().labels[\"x-axis\"] = Sk.ffi.remapToJs(s);\n    };\n    mod.xlabel = new Sk.builtin.func(xlabel_f);\n\n    let ylabel_f = function (s) {\n        Sk.builtin.pyCheckArgs(\"ylabel\", arguments, 1, 1);\n\n        if (!Sk.builtin.checkString(s)) {\n            throw new Sk.builtin.TypeError(\"'\" + Sk.abstr.typeName(s) +\n                \"' is not supported for ylabel; should be a string.\");\n        }\n        getChart().labels[\"y-axis\"] = Sk.ffi.remapToJs(s);\n    };\n    mod.ylabel = new Sk.builtin.func(ylabel_f);\n\n    let xticks_f = function (kwa) {\n        Sk.builtin.pyCheckArgs(\"xticks\", arguments, 0, Infinity, true, false);\n        let args = Array.prototype.slice.call(arguments, 1);\n        let kwargs = new Sk.builtins.dict(kwa); // Get argument as object\n\n        let rotation = getKeywordParameter(kwargs, STRING_ROTATION, \"horizontal\");\n\n        let chart = getChart();\n        if (args.length === 1) {\n            chart.ticks.x = {};\n            for (let i=0; i<args[0].length;i+= 1) {\n                chart.ticks.x[i] = i;\n            }\n        } else if (args.length === 2) {\n            chart.ticks.x = {};\n            for (let i=0; i<args[0].length;i+= 1) {\n                chart.ticks.x[i] = args[2][i];\n            }\n        }\n        chart.ticks.xRotate = rotation;\n    };\n    xticks_f.co_kwargs = true;\n    mod.xticks = new Sk.builtin.func(xticks_f);\n\n    // Clear the current figure\n    let clf_f = function () {\n        resetChart();\n    };\n    mod.clf = new Sk.builtin.func(clf_f);\n\n    const UNSUPPORTED = [\"semilogx\", \"semilogy\", \"specgram\", \"stackplot\", \"stem\", \"step\", \"streamplot\",\n                         \"tricontour\", \"tricontourf\", \"tripcolor\", \"triplot\", \"xcorr\", \"barbs\",\n                         \"cla\", \"grid\", \"table\", \"text\", \"annotate\", \"ticklabel_format\", \"locator_params\",\n                         \"tick_params\", \"margins\", \"autoscale\", \"autumn\", \"cool\", \"copper\", \"flag\", \"gray\",\n                         \"hot\", \"hsv\", \"jet\", \"pink\", \"prism\", \"spring\", \"summer\", \"winter\", \"spectral\",\n                         \"loglog\", \"magnitude_spectrum\", \"pcolor\", \"pcolormesh\", \"phase_spectrum\",\n                         \"pie\", \"plot_date\", \"psd\", \"quiver\", \"quiverkey\", \"findobj\", \"switch_backend\",\n                         \"isinteractive\", \"ioff\", \"ion\", \"pause\", \"rc\", \"rc_context\", \"rcdefaults\",\n                         \"gci\", \"sci\", \"xkcd\", \"figure\", \"gcf\", \"get_fignums\", \"get_figlabels\",\n                         \"get_current_fig_manager\", \"connect\", \"disconnect\", \"close\", \"savefig\",\n                         \"ginput\", \"waitforbuttonpress\", \"figtext\", \"suptitle\", \"figimage\", \"figlegend\",\n                         \"hold\", \"ishold\", \"over\", \"delaxes\", \"sca\", \"gca\", \"subplot\", \"subplots\",\n                         \"subplot2grid\", \"twinx\", \"twiny\", \"subplots_adjust\", \"subplot_tool\",\n                         \"tight_layout\", \"box\", \"xlim\", \"ylim\", \"xscale\", \"yscale\", \"yticks\",\n                         \"minorticks_on\", \"minorticks_off\", \"rgrids\", \"thetagrids\", \"plotting\", \"get_plot_commands\",\n                         \"colors\", \"colormaps\", \"_setup_pyplot_info_docstrings\", \"colorbar\", \"clim\", \"set_cmap\",\n                         \"imread\", \"imsave\", \"matshow\", \"polar\", \"plotfile\", \"_autogen_docstring\", \"acorr\",\n                         \"arrow\", \"axhline\", \"axhspan\", \"axvline\", \"axvspan\",, \"broken_barh\", \"cohere\",\n                         \"clabel\", \"contour\", \"contourf\", \"csd\", \"errorbar\", \"eventplot\", \"fill\", \"fill_between\",\n                         \"fill_betweenx\", \"hexbin\", \"hist2d\", \"axis\"];\n\n    for (let i = 0; i < UNSUPPORTED.length; i += 1) {\n        mod[UNSUPPORTED[i]] = new Sk.builtin.func(function () {\n            throw new Sk.builtin.NotImplementedError(UNSUPPORTED[i] + \" is not yet implemented\");\n        });\n    }\n\n    let legend_f = function () {\n        return Sk.builtin.none.none$;\n    };\n    mod.legend = new Sk.builtin.func(legend_f);\n\n\n    return mod;\n};\n\n//TODO: Make font size controllable\nSk.jsplotlib.rc = {\n    \"lines.linewidth\": 1.0,\n    \"lines.linestyle\": \"-\",\n    \"lines.color\": \"blue\",\n    \"lines.marker\": \"None\",\n    \"lines.markeredgewidth\": 0.5,\n    \"lines.markersize\": 6,\n    \"lines.dash_joinstyle\": \"miter\",\n    \"lines.dash_capstyle\": \"butt\",\n    \"lines.solid_jointyle\": \"miter\",\n    \"lines.solid_capstyle\": \"projecting\",\n    \"lines.antialiased\": true,\n    \"patch.linewidth\": 1.0,\n    \"patch.facecolor\": \"blue\",\n    \"patch.edgecolor\": \"black\",\n    \"patch.antialiased\": true,\n    \"text.color\": \"black\",\n    \"axes.hold\": true, // whether to clear the axes by default on\n    \"axes.facecolor\": \"white\", // axes background color\n    \"axes.edgecolor\": \"black\", // axes edge color\n    \"axes.grid\": false,\n    \"axes.titlesize\": \"large\",\n    \"axes.labelsize\": \"medium\",\n    \"axes.labelweigth\": \"normal\",\n    \"axes.labelcolor\": \"black\",\n    \"axes.axisbelow\": false,\n    \"axes.color_cycle\": [\"b\", \"g\", \"r\", \"c\", \"m\", \"y\", \"k\"]\n};\n\nSk.jsplotlib._line_counter = 0;\n\n/** List of all supported line styles **/\nSk.jsplotlib.lineStyles = {\n    \"-\": \"_draw_solid\",\n    \"--\": \"_draw_dashed\",\n    \"-.\": \"_draw_dash_dot\",\n    \":\": \"_draw_dotted\",\n    \"None\": \"_draw_nothing\",\n    \" \": \"_draw_nothing\",\n    \"\": \"_draw_nothing\",\n};\n\nSk.jsplotlib.lineMarkers = {\n    \".\": \"point\",\n    \",\": \"pixel\",\n    \"o\": \"circle\",\n    \"v\": \"triangle_down\",\n    \"^\": \"triangle_up\",\n    \"<\": \"triangle_left\",\n    \">\": \"triangle_right\",\n    \"1\": \"tri_down\",\n    \"2\": \"tri_up\",\n    \"3\": \"tri_left\",\n    \"4\": \"tri_right\",\n    \"8\": \"octagon\",\n    \"s\": \"square\",\n    \"p\": \"pentagon\",\n    \"*\": \"star\",\n    \"h\": \"hexagon1\",\n    \"H\": \"hexagon2\",\n    \"+\": \"plus\",\n    \"x\": \"x\",\n    \"D\": \"diamond\",\n    \"d\": \"thin_diamond\",\n    \"|\": \"vline\",\n    \"_\": \"hline\",\n    //TICKLEFT: 'tickleft',\n    //TICKRIGHT: 'tickright',\n    //TICKUP: 'tickup',\n    //TICKDOWN: 'tickdown',\n    //CARETLEFT: 'caretleft',\n    //CARETRIGHT: 'caretright',\n    //CARETUP: 'caretup',\n    //CARETDOWN: 'caretdown',\n    \"None\": \"nothing\",\n    //Sk.builtin.none.none$: 'nothing',\n    \" \": \"nothing\",\n    \"\": \"nothing\"\n};\n\n/**\n Color short keys\n **/\nSk.jsplotlib.colors = {\n    \"b\": \"blue\",\n    \"g\": \"green\",\n    \"r\": \"red\",\n    \"c\": \"cyan\",\n    \"m\": \"magenta\",\n    \"y\": \"yellow\",\n    \"k\": \"black\",\n    \"w\": \"white\"\n};\n\n/**\n Mapping of all possible CSS colors, that are supported by matplotlib\n **/\nSk.jsplotlib.cnames = {\n    \"aliceblue\": \"#F0F8FF\",\n    \"antiquewhite\": \"#FAEBD7\",\n    \"aqua\": \"#00FFFF\",\n    \"aquamarine\": \"#7FFFD4\",\n    \"azure\": \"#F0FFFF\",\n    \"beige\": \"#F5F5DC\",\n    \"bisque\": \"#FFE4C4\",\n    \"black\": \"#000000\",\n    \"blanchedalmond\": \"#FFEBCD\",\n    \"blue\": \"#0000FF\",\n    \"blueviolet\": \"#8A2BE2\",\n    \"brown\": \"#A52A2A\",\n    \"burlywood\": \"#DEB887\",\n    \"cadetblue\": \"#5F9EA0\",\n    \"chartreuse\": \"#7FFF00\",\n    \"chocolate\": \"#D2691E\",\n    \"coral\": \"#FF7F50\",\n    \"cornflowerblue\": \"#6495ED\",\n    \"cornsilk\": \"#FFF8DC\",\n    \"crimson\": \"#DC143C\",\n    \"cyan\": \"#00FFFF\",\n    \"darkblue\": \"#00008B\",\n    \"darkcyan\": \"#008B8B\",\n    \"darkgoldenrod\": \"#B8860B\",\n    \"darkgray\": \"#A9A9A9\",\n    \"darkgreen\": \"#006400\",\n    \"darkkhaki\": \"#BDB76B\",\n    \"darkmagenta\": \"#8B008B\",\n    \"darkolivegreen\": \"#556B2F\",\n    \"darkorange\": \"#FF8C00\",\n    \"darkorchid\": \"#9932CC\",\n    \"darkred\": \"#8B0000\",\n    \"darksage\": \"#598556\",\n    \"darksalmon\": \"#E9967A\",\n    \"darkseagreen\": \"#8FBC8F\",\n    \"darkslateblue\": \"#483D8B\",\n    \"darkslategray\": \"#2F4F4F\",\n    \"darkturquoise\": \"#00CED1\",\n    \"darkviolet\": \"#9400D3\",\n    \"deeppink\": \"#FF1493\",\n    \"deepskyblue\": \"#00BFFF\",\n    \"dimgray\": \"#696969\",\n    \"dodgerblue\": \"#1E90FF\",\n    \"firebrick\": \"#B22222\",\n    \"floralwhite\": \"#FFFAF0\",\n    \"forestgreen\": \"#228B22\",\n    \"fuchsia\": \"#FF00FF\",\n    \"gainsboro\": \"#DCDCDC\",\n    \"ghostwhite\": \"#F8F8FF\",\n    \"gold\": \"#FFD700\",\n    \"goldenrod\": \"#DAA520\",\n    \"gray\": \"#808080\",\n    \"green\": \"#008000\",\n    \"greenyellow\": \"#ADFF2F\",\n    \"honeydew\": \"#F0FFF0\",\n    \"hotpink\": \"#FF69B4\",\n    \"indianred\": \"#CD5C5C\",\n    \"indigo\": \"#4B0082\",\n    \"ivory\": \"#FFFFF0\",\n    \"khaki\": \"#F0E68C\",\n    \"lavender\": \"#E6E6FA\",\n    \"lavenderblush\": \"#FFF0F5\",\n    \"lawngreen\": \"#7CFC00\",\n    \"lemonchiffon\": \"#FFFACD\",\n    \"lightblue\": \"#ADD8E6\",\n    \"lightcoral\": \"#F08080\",\n    \"lightcyan\": \"#E0FFFF\",\n    \"lightgoldenrodyellow\": \"#FAFAD2\",\n    \"lightgreen\": \"#90EE90\",\n    \"lightgray\": \"#D3D3D3\",\n    \"lightpink\": \"#FFB6C1\",\n    \"lightsage\": \"#BCECAC\",\n    \"lightsalmon\": \"#FFA07A\",\n    \"lightseagreen\": \"#20B2AA\",\n    \"lightskyblue\": \"#87CEFA\",\n    \"lightslategray\": \"#778899\",\n    \"lightsteelblue\": \"#B0C4DE\",\n    \"lightyellow\": \"#FFFFE0\",\n    \"lime\": \"#00FF00\",\n    \"limegreen\": \"#32CD32\",\n    \"linen\": \"#FAF0E6\",\n    \"magenta\": \"#FF00FF\",\n    \"maroon\": \"#800000\",\n    \"mediumaquamarine\": \"#66CDAA\",\n    \"mediumblue\": \"#0000CD\",\n    \"mediumorchid\": \"#BA55D3\",\n    \"mediumpurple\": \"#9370DB\",\n    \"mediumseagreen\": \"#3CB371\",\n    \"mediumslateblue\": \"#7B68EE\",\n    \"mediumspringgreen\": \"#00FA9A\",\n    \"mediumturquoise\": \"#48D1CC\",\n    \"mediumvioletred\": \"#C71585\",\n    \"midnightblue\": \"#191970\",\n    \"mintcream\": \"#F5FFFA\",\n    \"mistyrose\": \"#FFE4E1\",\n    \"moccasin\": \"#FFE4B5\",\n    \"navajowhite\": \"#FFDEAD\",\n    \"navy\": \"#000080\",\n    \"oldlace\": \"#FDF5E6\",\n    \"olive\": \"#808000\",\n    \"olivedrab\": \"#6B8E23\",\n    \"orange\": \"#FFA500\",\n    \"orangered\": \"#FF4500\",\n    \"orchid\": \"#DA70D6\",\n    \"palegoldenrod\": \"#EEE8AA\",\n    \"palegreen\": \"#98FB98\",\n    \"paleturquoise\": \"#AFEEEE\",\n    \"palevioletred\": \"#DB7093\",\n    \"papayawhip\": \"#FFEFD5\",\n    \"peachpuff\": \"#FFDAB9\",\n    \"peru\": \"#CD853F\",\n    \"pink\": \"#FFC0CB\",\n    \"plum\": \"#DDA0DD\",\n    \"powderblue\": \"#B0E0E6\",\n    \"purple\": \"#800080\",\n    \"red\": \"#FF0000\",\n    \"rosybrown\": \"#BC8F8F\",\n    \"royalblue\": \"#4169E1\",\n    \"saddlebrown\": \"#8B4513\",\n    \"salmon\": \"#FA8072\",\n    \"sage\": \"#87AE73\",\n    \"sandybrown\": \"#FAA460\",\n    \"seagreen\": \"#2E8B57\",\n    \"seashell\": \"#FFF5EE\",\n    \"sienna\": \"#A0522D\",\n    \"silver\": \"#C0C0C0\",\n    \"skyblue\": \"#87CEEB\",\n    \"slateblue\": \"#6A5ACD\",\n    \"slategray\": \"#708090\",\n    \"snow\": \"#FFFAFA\",\n    \"springgreen\": \"#00FF7F\",\n    \"steelblue\": \"#4682B4\",\n    \"tan\": \"#D2B48C\",\n    \"teal\": \"#008080\",\n    \"thistle\": \"#D8BFD8\",\n    \"tomato\": \"#FF6347\",\n    \"turquoise\": \"#40E0D0\",\n    \"violet\": \"#EE82EE\",\n    \"wheat\": \"#F5DEB3\",\n    \"white\": \"#FFFFFF\",\n    \"whitesmoke\": \"#F5F5F5\",\n    \"yellow\": \"#FFFF00\",\n    \"yellowgreen\": \"#9ACD32\"\n};\n\nSk.jsplotlib.color_to_hex = function (color) {\n    // is color a shortcut?\n    if (Sk.jsplotlib.colors[color]) {\n        color = Sk.jsplotlib.colors[color];\n    }\n\n    // is inside cnames array?\n    if (Sk.jsplotlib.cnames[color]) {\n        return Sk.jsplotlib.cnames[color];\n    }\n\n    // check if it is already a hex value\n    if (typeof color == \"string\") {\n        var match = color.match(/^#(?:[0-9a-fA-F]{3}){1,2}$/);\n        if (match && match.length === 1) {\n            return match[0];\n        }\n    }\n\n    // add rgb colors here\n    if (Array.isArray(color) && color.length === 3) {\n        return Sk.jsplotlib.rgb2hex(color);\n    }\n\n    // back to default\n    return Sk.jsplotlib.cnames[Sk.jsplotlib.rc[\"lines.color\"]];\n};\n\nSk.jsplotlib.get_color = function (cs) {\n    return Sk.jsplotlib.colors[cs] ? Sk.jsplotlib.colors[cs] : Sk.jsplotlib.colors.b;\n};\n\nSk.jsplotlib.parse_marker = function (style) {\n    if (!style) {\n        return \"x\";\n    }\n    switch (style) {\n        case \".\":\n            return \".\";\n        case \",\":\n            return \"x\";\n        case \"o\":\n            return \"o\";\n        case \"v\":\n            return \"x\";\n        case \"^\":\n            return \"x\";\n        case \"<\":\n            return \"x\";\n        case \">\":\n            return \"x\";\n        case \"1\":\n            return \"x\";\n        case \"2\":\n            return \"x\";\n        case \"3\":\n            return \"x\";\n        case \"4\":\n            return \"x\";\n        case \"s\":\n            return \"s\";\n        case \"p\":\n            return \"x\";\n        case \"*\":\n            return \"x\";\n        case \"h\":\n            return \"x\";\n        case \"H\":\n            return \"x\";\n        case \"+\":\n            return \"x\";\n        case \"x\":\n            return \"x\";\n        case \"D\":\n            return \"x\";\n        case \"d\":\n            return \"x\";\n        case \"|\":\n            return \"x\";\n        case \"_\":\n            return \"x\";\n        default:\n            return \"\";\n    }\n};\n\n/**\n Process a MATLAB style color/line style format string.  Return a\n (*linestyle*, *color*) tuple as a result of the processing.  Default\n values are ('-', 'b').  Example format strings include:\n\n * 'ko': black circles\n * '.b': blue dots\n * 'r--': red dashed lines\n\n .. seealso::\n\n :func:`~matplotlib.Line2D.lineStyles` and\n :func:`~matplotlib.pyplot.colors`\n for all possible styles and color format string.\n **/\nSk.jsplotlib._process_plot_format = function (fmt) {\n    var linestyle = null;\n    var marker = null;\n    var color = null;\n\n    // Is fmt just a colorspec\n    try {\n        color = Sk.jsplotlib.to_rgb(fmt);\n        if (color) {\n            return {\n                \"linestyle\": linestyle,\n                \"marker\": marker,\n                \"color\": color\n            };\n        }\n    } catch (e) {\n    }\n\n    // handle the multi char special cases and strip them for the string\n    if (fmt.search(/--/) >= 0) {\n        linestyle = \"--\";\n        fmt = fmt.replace(/--/, \"\");\n    }\n    if (fmt.search(/-\\./) >= 0) {\n        linestyle = \"-.\";\n        fmt = fmt.replace(/-\\./, \"\");\n    }\n    if (fmt.search(/ /) >= 0) {\n        linestyle = \"\";\n        fmt = fmt.replace(/ /, \"\");\n    }\n\n    var i;\n    for (i = 0; i < fmt.length; i++) {\n        var c = fmt.charAt(i);\n        if (Sk.jsplotlib.lineStyles[c]) {\n            if (linestyle) {\n                throw new Sk.builtin.ValueError(\"Illegal format string \\\"\" + fmt +\n                    \"\\\"; two linestyle symbols\");\n            }\n            linestyle = c;\n        } else if (Sk.jsplotlib.lineMarkers[c]) {\n            if (marker) {\n                throw new Sk.builtin.ValueError(\"Illegal format string \\\"\" + fmt +\n                    \"\\\"; two marker symbols\");\n            }\n            marker = c;\n        } else if (Sk.jsplotlib.colors[c]) {\n            if (color) {\n                throw new Sk.builtin.ValueError(\"Illegal format string \\\"\" + fmt +\n                    \"\\\"; two color symbols\");\n            }\n            color = c;\n        } else {\n            throw new Sk.builtin.ValueError(\"Unrecognized character \" + c +\n                \" in format string\");\n        }\n    }\n\n    if (!linestyle && !marker) {\n        // use defaults --> rcParams['lines.linestyle']\n        linestyle = \"-\";\n    }\n    if (!linestyle) {\n        linestyle = \" \";\n    }\n    if (!marker) {\n        marker = \"\";\n    }\n\n    return {\n        \"linestyle\": linestyle,\n        \"marker\": marker,\n        \"color\": color\n    };\n};\n\n/**\n https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/colors.py\n http://matplotlib.org/api/colors_api.html\n\n Returns an *RGB* tuple of three floats from 0-1.\n\n *arg* can be an *RGB* or *RGBA* sequence or a string in any of\n several forms:\n\n 1) a letter from the set 'rgbcmykw'\n 2) a hex color string, like '#00FFFF'\n 3) a standard name, like 'aqua'\n 4) a string representation of a float, like '0.4',\n indicating gray on a 0-1 scale\n\n if *arg* is *RGBA*, the *A* will simply be discarded.\n **/\nSk.jsplotlib.to_rgb = function (fmt) {\n    if (!fmt) {\n        return null;\n    }\n\n    var color = null;\n\n    if (typeof fmt == \"string\") {\n        let fmt_lower = fmt.toLowerCase();\n\n        if (Sk.jsplotlib.colors[fmt_lower]) {\n            return Sk.jsplotlib.hex2color(Sk.jsplotlib.cnames[Sk.jsplotlib.colors[fmt_lower]]);\n        }\n\n        // is inside cnames array?\n        if (Sk.jsplotlib.cnames[fmt_lower]) {\n            return Sk.jsplotlib.hex2color(Sk.jsplotlib.cnames[fmt_lower]);\n        }\n\n        if (fmt_lower.indexOf(\"#\") === 0) {\n            return Sk.jsplotlib.hex2color(fmt_lower);\n        }\n\n        // is it simple grey shade?\n        var fl = parseFloat(fmt_lower);\n        if (isNaN(fl)) {\n            throw new Sk.builtin.ValueError(\"cannot convert argument to rgb sequence\");\n        }\n\n        if (fl < 0 || fl > 1) {\n            throw new Sk.builtin.ValueError(\"gray (string) must be in range 0-1\");\n        }\n\n        return [fl, fl, fl];\n    }\n\n    // check if its a color tuple [r,g,b, [a]] with values from [0-1]\n    if (Array.isArray(fmt)) {\n        if (fmt.length > 4 || fmt.length < 3) {\n            throw new Sk.builtin.ValueError(\"sequence length is \" + fmt.length +\n                \"; must be 3 or 4\");\n        }\n\n        color = fmt.slice(0, 3);\n        var i;\n\n        for (i = 0; i < 3; i++) {\n            var fl_rgb = parseFloat(fmt);\n\n            if (fl_rgb < 0 || fl_rgb > 1) {\n                throw new Sk.builtin.ValueError(\n                    \"number in rbg sequence outside 0-1 range\");\n            }\n        }\n    }\n\n    return color;\n};\n\n/**\n Take a hex string *s* and return the corresponding rgb 3-tuple\n Example: #efefef -> (0.93725, 0.93725, 0.93725)\n **/\nSk.jsplotlib.hex2color = function (s) {\n    if (!s || typeof s != \"string\") {\n        throw new Sk.builtin.TypeError(\"hex2color requires a string argument\");\n    }\n    // check if it is a hex value\n    var i;\n    var s_copy = s;\n    var hex_tuple = [];\n    for (i = 0; i < 3; i++) {\n        var match = s_copy.match(/(?:[0-9a-fA-F]){1,2}$/);\n        if (match && match.length === 1) {\n            hex_tuple.push(match[0]);\n            s_copy = s_copy.substring(0, match.index);\n        }\n    }\n    //var match = s.match(/^#(?:[0-9a-fA-F]{3}){1,2}$/);\n    if (hex_tuple.length === 3) {\n        // yeah positiv --> convert into right color spec\n        var color = [];\n        color[0] = parseInt(hex_tuple[0], 16) / 255.0;\n        color[1] = parseInt(hex_tuple[1], 16) / 255.0;\n        color[2] = parseInt(hex_tuple[2], 16) / 255.0;\n\n        return color.reverse();\n    } else {\n        throw new Sk.builtin.ValueError(\"invalid hex color string \\\"\" + s + \"\\\"\");\n    }\n};\n\n/**\n Expects and rgb tuple with values [0,1]\n **/\nSk.jsplotlib.rgb2hex = function (rgb) {\n    if (!rgb) {\n        return null;\n    }\n\n    if (rgb.length && rgb.length >= 3) {\n        var i;\n        // some hacky code to rebuild string format :(\n        var hex_str = \"#\";\n        for (i = 0; i < 3; i++) {\n            var val = Math.round(rgb[i] * 255).toString(16);\n            hex_str += val.length == 2 ? val : \"0\" + val;\n        }\n\n        return hex_str;\n    }\n};\n"
  },
  {
    "path": "src/skulpt_modules/pedal_tracer.js",
    "content": "export const $pedal_tracer = `\n\n\"\"\"\nWraps the tracer module in Pedal\n\"\"\"\n\nimport os\nimport utility\n        \nclass SandboxBasicTracer:\n    \"\"\"\n\n    \"\"\"\n    def __init__(self):\n        super().__init__()\n        self.filename = \"student.py\"\n        self.code = None\n\n    def as_filename(self, filename, code):\n        if os.path.isabs(filename):\n            self.filename = filename\n        else:\n            self.filename = os.path.abspath(filename)\n        self.code = code\n        return self\n\n    def __enter__(self):\n        pass\n\n    def __exit__(self, exc_type, exc_val, traceback):\n        pass\n\nclass SandboxNativeTracer(SandboxBasicTracer):\n    \"\"\"\n    Tracks lines covered and function calls. Possibly other things? We could track variables, if that\n    was something people wanted.\n\n    TODO: Handle multiple submission files?\n    \"\"\"\n    def __init__(self):\n        super().__init__()\n        #self.calls = utility.trace_calls()\n        self.lines = utility.trace_lines()\n        self.step_index = len(utility.trace_lines())\n    \n    def get_calls(self):\n        return utility.trace_calls()\n    \n    calls = property(get_calls)\n    \n    def __enter__(self):\n        utility.start_trace(self)\n\n    def __exit__(self, exc_type, exc_val, traceback):\n        utility.stop_trace(self)\n\nTRACER_STYLES = {\n    'none': SandboxBasicTracer,\n    'native': SandboxNativeTracer\n}\n\n`;"
  },
  {
    "path": "src/skulpt_modules/sk_mod_instructor.js",
    "content": "/**\n * Skulpt Module for holding the Instructor API.\n *\n * This module is loaded in by getting the functions' source code from toString.\n * Isn't that crazy?\n *\n *\n */\nexport let $sk_mod_instructor = function() {\n    // Main module object that gets returned at the end.\n    let mod = {};\n    let none = Sk.builtin.none.none$;\n    \n    let prior = null;\n    mod.timeit = new Sk.builtin.func(function(name) {\n        Sk.builtin.pyCheckArgs(\"timeit\", arguments, 1, 1);\n        let difference;\n        if (prior === null) {\n            difference = 0;\n        } else {\n            difference = Date.now() - prior;\n        }\n        console.log(Sk.ffi.remapToJs(name), difference/1000);\n        prior = Date.now();\n    });\n    \n    /**\n     * Logs feedback to javascript console\n     */\n    mod.console_log = new Sk.builtin.func(function() {\n        const strArgs = ([...arguments]).map(Sk.ffi.remapToJs);\n        strArgs.forEach(function(arg) {\n            Sk.executionReports[\"model\"].ui.feedback.addPositiveFeedback(\n                arg, \"comment\", \"rgb(128, 128, 128)\", undefined, true, true\n            );\n        });\n    });\n    \n    /**\n     * Logs debug to javascript console\n     */\n    mod.console_debug = new Sk.builtin.func(function() {\n        console.log(\"debug\", arguments);\n        try {\n            const strArgs = ([...arguments]).map(JSON.stringify);\n            strArgs.forEach(function(arg) {\n                Sk.executionReports[\"model\"].ui.feedback.addPositiveFeedback(\n                    arg, \"info-circle\", \"rgb(128, 128, 128)\", undefined, true, true\n                );\n            });\n        } catch (e) {\n            Sk.executionReports[\"model\"].ui.feedback.addPositiveFeedback(\n                `Failed to render debug message: ${e}`, \"exclamation-triangle\", \"rgb(128, 128, 128)\", undefined, true, true\n            );\n        }\n    });\n\n    /**\n     * This function coverts the output in the student report to a python \n     * list and returns it.\n    **/\n    mod.get_output = new Sk.builtin.func(function() {\n        Sk.builtin.pyCheckArgs(\"get_output\", arguments, 0, 0);\n        if (Sk.executionReports[\"student\"].success) {\n            let output = Sk.executionReports[\"student\"][\"output\"]();\n            output = output.map(function(item) { return item.toSkulpt(); });\n            return new Sk.builtin.list(output);\n        } else {\n            return new Sk.builtin.list([]);\n        }\n    });\n    \n    /**\n     * This function resets the output, particularly useful if the student\n     * code is going to be rerun.\n     */\n    mod.reset_output = new Sk.builtin.func(function() {\n        Sk.builtin.pyCheckArgs(\"reset_output\", arguments, 0, 0);\n        if (Sk.executionReports[\"student\"].success) {\n            Sk.executionReports[\"student\"].output.removeAll();\n        }\n        return Sk.builtin.none.none$;\n    });\n    \n    /*mod.queue_input = new Sk.builtin.func(function() {\n        Sk.builtin.pyCheckArgs(\"queue_input\", arguments, 1, Infinity);\n        let args = arguments;\n        for (let i = args.length-1; i >= 0; i--) {\n            let input = args[i];\n            Sk.builtin.pyCheckType(\"input\", \"string\", Sk.builtin.checkString(input));\n            Sk.queuedInput.push(Sk.ffi.remapToJs(input));\n        }\n    });*/\n    \n    /**\n     * This function is called by instructors to get the students' code as a string.\n    **/\n    mod.get_program = new Sk.builtin.func(function() {\n        Sk.builtin.pyCheckArgs(\"get_program\", arguments, 0, 0);\n        return Sk.ffi.remapToPy(Sk.executionReports[\"verifier\"].code);\n    });\n\n    /**\n     * This function is called by instructors to get the students' code as a string.\n    **/\n    mod.get_evaluation = new Sk.builtin.func(function() {\n        Sk.builtin.pyCheckArgs(\"get_evaluation\", arguments, 0, 0);\n        return Sk.ffi.remapToPy(Sk.executionReports[\"student\"].evaluation || \"\");\n    });\n    \n    mod.trace_lines = new Sk.builtin.func(function() {\n        if (Sk.executionReports[\"student\"].success) {\n            let lines = Sk.executionReports[\"student\"].realLines;\n            return Sk.ffi.remapToPy(lines);\n        } else {\n            return new Sk.builtin.list([]);\n        }\n    });\n\n    mod.trace_calls = new Sk.builtin.func(function() {\n        //console.log(\"--\", Sk.executionReports[\"student\"]);\n        //console.log(\"CHECKING CALLS\", Sk.executionReports['student'].success);\n        if (Sk.executionReports[\"student\"].success) {\n            let calls = Sk.executionReports[\"student\"].calls;\n            return Sk.ffi.remapToPy(calls);\n        }\n        return new Sk.builtin.dict([]);\n    });\n\n    mod.start_trace = new Sk.builtin.func(function() {\n        //console.log(\"START/BEGIN\", Sk.beforeCall, Sk.executionReports.student.tracing);\n        if (Sk.beforeCall === null) {\n            Sk.beforeCall = Sk.beforeCallBackup;\n        }\n        Sk.executionReports[\"student\"].tracing.push(true);\n        //console.log(\"START/END\", Sk.beforeCall, Sk.executionReports.student.tracing);\n    });\n\n    mod.stop_trace = new Sk.builtin.func(function() {\n        //console.log(\"STOP/BEGIN\", Sk.beforeCall, Sk.executionReports.student.tracing);\n        Sk.executionReports[\"student\"].tracing.pop();\n        if (Sk.executionReports[\"student\"].tracing.length === 0) {\n            Sk.beforeCall = null;\n        }\n        //console.log(\"STOP/END\", Sk.beforeCall, Sk.executionReports.student.tracing);\n    });\n    \n    /**\n     *\n     */\n    mod.get_student_error = new Sk.builtin.func(function() {\n        Sk.builtin.pyCheckArgs(\"get_student_error\", arguments, 0, 0);\n        if (Sk.executionReports[\"student\"].success) {\n            return new Sk.builtin.tuple([none, none]);\n        } else {\n            let error = Sk.executionReports[\"student\"].error,\n                position = {};\n            if (error && error.traceback && error.traceback.length > 0) {\n                position[\"line\"] = error.traceback[0].lineno;\n            } else {\n                error = none;\n            }\n            position = Sk.ffi.remapToPy(position);\n            return new Sk.builtin.tuple([error, position]);\n        }\n    });\n\n    \n    mod.had_execution_time_error = new Sk.builtin.func(function() {\n        Sk.builtin.pyCheckArgs(\"had_execution_time_error\", arguments, 0, 0);\n        return !Sk.executionReports[\"student\"].success && \n                Sk.executionReports[\"student\"].error &&\n                Sk.executionReports[\"student\"].error.tp$name === \"TimeLimitError\";\n    });\n    \n    let backupTime = undefined;\n    mod.limit_execution_time = new Sk.builtin.func(function() {\n        Sk.builtin.pyCheckArgs(\"limit_execution_time\", arguments, 0, 0);\n        backupTime = Sk.execLimit;\n        if (Sk.execLimitFunction) {\n            Sk.execLimit = Sk.execLimitFunction();\n            Sk.execStart = Date.now();\n        }\n    });\n    mod.unlimit_execution_time = new Sk.builtin.func(function() {\n        Sk.builtin.pyCheckArgs(\"unlimit_execution_time\", arguments, 0, 0);\n        Sk.execLimit = backupTime;\n        Sk.execStart = Date.now();\n    });\n    \n    mod.suppress_scrolling = new Sk.builtin.func(function() {\n        Sk.builtin.pyCheckArgs(\"suppress_scrolling\", arguments, 0, 0);\n        Sk.executionReports.instructor.scrolling = true;\n    });\n\n    \n    /*\n    def hist(self, data, **kwargs):\n        label = kwargs.get('label', None)\n        self.active_plot['data'].append({'type': 'Histogram', 'values': data, 'label': label})\n    def plot(self, xs, ys=None, **kwargs):\n        label = kwargs.get('label', None)\n        if ys == None:\n            self.active_plot['data'].append({'type': 'Line', \n                                            'x': range(len(xs)), 'y': xs, 'label': label})\n        else:\n            self.active_plot['data'].append({'type': 'Line', 'x': xs, 'y': ys, 'label': label})\n    def scatter(self, xs, ys, **kwargs):\n        label = kwargs.get('label', None)\n        self.active_plot['data'].append({'type': 'Scatter', 'x': xs, 'y': ys, 'label': label})\n    */\n    mod.get_plots = new Sk.builtin.func(function() {\n        Sk.builtin.pyCheckArgs(\"get_plots\", arguments, 0, 0);\n        if (Sk.executionReports[\"student\"].success) {\n            let outputs = Sk.executionReports[\"student\"][\"output\"]();\n            outputs = outputs.filter(function(output) { \n                return output.type === \"plot\";\n            }).map(function(graph) {\n                return {\"data\": graph.content.map(function(plot) {\n                    let newPlot = { \"type\": plot.type,\n                        \"label\": \"\" };\n                    if (plot.type === \"line\" || plot.type === \"scatter\") {\n                        newPlot[\"x\"] = plot.data.map(function(v) { return v.x; });\n                        newPlot[\"y\"] = plot.data.map(function(v) { return v.y; });\n                    } else if (plot.type === \"hist\") {\n                        newPlot[\"values\"] = plot.data;\n                    }\n                    return newPlot;\n                }), \n                \"xlabel\": \"\", \"ylabel\": \"\", \n                \"title\": \"\", \"legend\": false\n                };\n            });\n            return Sk.ffi.remapToPy(outputs);\n        } else {\n            return Sk.ffi.remapToPy([]);\n        }\n    });\n\n    \n    // Provides `student` as an object with all the data that the student declared.\n    mod.StudentData = Sk.misceval.buildClass(mod, function($gbl, $loc) {\n        $loc.__init__ = new Sk.builtin.func(function(self) {\n            //self.data = Sk.builtin.dict();\n            let newDict = new Sk.builtin.dict();\n            Sk.abstr.sattr(self, new Sk.builtin.str(\"data\"), newDict, true);\n            self.module = Sk.executionReports[\"student\"].results;\n            if (self.module !== undefined) {\n                self.module = self.module.$d;\n                for (let key in self.module) {\n                    if (self.module.hasOwnProperty(key)) {\n                        Sk.abstr.objectSetItem(newDict, Sk.ffi.remapToPy(Sk.unfixReserved(key)),\n                                               self.module[key]);\n                    }\n                }\n            } else {\n                self.module = {};\n            }\n            return Sk.builtin.none.none$;\n        });\n        var call_f = function(kwa) {\n            Sk.builtin.pyCheckArgsLen(\"call\", arguments.length, 1, Infinity, true, true);\n            var args = Array.prototype.slice.call(arguments, 1);\n            var kwargs = new Sk.builtins.dict(kwa);\n\n            var self = args[0];\n            var functionName = args[1];\n            args = args.slice(2);\n\n            var inputs = kwargs.mp$lookup(new Sk.builtin.str(\"inputs\"));\n            if (inputs !== undefined) {\n                inputs = Sk.ffi.remapToJs(inputs);\n                if (inputs.constructor === Array) {\n                    inputs.forEach(function(item) {\n                        Sk.queuedInput.push(item);\n                    });\n                } else {\n                    Sk.queuedInput.push(input);\n                }\n            }\n\n            var data = self.tp$getattr(new Sk.builtin.str(\"data\"));\n            var functionObject = data.mp$lookup(functionName);\n            var result = functionObject.tp$call(args);\n            return result;\n        };\n        call_f.co_kwargs = true;\n        //call_f.co_varnames = [\"self\", \"function\"];\n        call_f.co_name= new Sk.builtin.str(\"call\");\n        $loc[\"call_$rn$\"] = new Sk.builtin.func(call_f);\n\n        $loc[\"__repr__\"] = new Sk.builtin.func(function(self) {\n            return new Sk.builtin.str(\"\");\n        });\n\n        $loc.get_names_by_type = new Sk.builtin.func(function(self, type, exclude_builtins) {\n            Sk.builtin.pyCheckArgs(\"get_names_by_type\", arguments, 2, 3);\n            if (exclude_builtins === undefined) {\n                exclude_builtins = true;\n            } else {\n                Sk.builtin.pyCheckType(\"exclude_builtins\", \"boolean\", Sk.builtin.checkBool(exclude_builtins));\n                exclude_builtins = Sk.ffi.remapToJs(exclude_builtins);\n            }\n            let result = [];\n            for (let property in self.module) {\n                if (self.module.hasOwnProperty(property)) {\n                    if (self.module[property].tp$name === type.tp$name) {\n                        //console.log(exclude_builtins);\n                        if (exclude_builtins && property.startsWith(\"__\")) {\n                            continue;\n                        }\n                        result.push(Sk.ffi.remapToPy(Sk.unfixReserved(property)));\n                    }\n                }\n            }\n            return new Sk.builtin.list(result);\n        });\n    \n        $loc.get_values_by_type = new Sk.builtin.func(function(self, type, exclude_builtins) {\n            Sk.builtin.pyCheckArgs(\"get_values_by_type\", arguments, 2, 3);\n            if (exclude_builtins === undefined) {\n                exclude_builtins = true;\n            } else {\n                Sk.builtin.pyCheckType(\"exclude_builtins\", \"boolean\", Sk.builtin.checkBool(exclude_builtins));\n                exclude_builtins = Sk.ffi.remapToJs(exclude_builtins);\n            }\n            let result = [];\n            for (let property in self.module) {\n                if (self.module.hasOwnProperty(property)) {\n                    if (self.module[property].tp$name === type.tp$name) {\n                        if (exclude_builtins && property.startsWith(\"__\")) {\n                            continue;\n                        }\n                        result.push(self.module[property]);\n                    }\n                }\n            }\n            return new Sk.builtin.list(result);\n        });\n    }, \"StudentData\");\n    mod.student = Sk.misceval.callsimOrSuspend(mod.StudentData);\n    \n    mod.get_student_data = new Sk.builtin.func(function() {\n        Sk.builtin.pyCheckArgs(\"get_student_data\", arguments, 0, 0);\n        return mod.student;\n    });\n\n    mod.set_instructions = new Sk.builtin.func(function(newInstructions) {\n        Sk.builtin.pyCheckArgs(\"set_instructions\", arguments, 1, 2);\n        newInstructions = Sk.ffi.remapToJs(newInstructions);\n        Sk.executionReports[\"model\"].display.changedInstructions(newInstructions);\n    });\n\n    mod.get_model_info = new Sk.builtin.func(function(keys) {\n        Sk.builtin.pyCheckArgs(\"get_model_info\", arguments, 1, 1);\n        let model = Sk.executionReports[\"model\"];\n        keys = Sk.ffi.remapToJs(keys).split(\".\");\n        for (var i=0; i < keys.length; i++) {\n            model = model[keys[i]];\n        }\n        return Sk.ffi.remapToPy(model());\n    });\n\n    mod.clear_existing_student_imports = new Sk.builtin.func(function() {\n        Sk.builtin.pyCheckArgs(\"clear_existing_student_imports\", arguments, 0, 0);\n        Sk.clearExistingStudentImports();\n    });\n\n    mod.download_file = new Sk.builtin.func(function(placement, directory, filename) {\n        Sk.builtin.pyCheckArgs(\"download_file\", arguments, 3, 3);\n        const downloadFileUrl = Sk.executionReports[\"model\"].configuration.urls[\"downloadFile\"];\n        const combiner = downloadFileUrl.includes(\"?\") ? \"&\" : \"?\";\n        const url = `${downloadFileUrl}${combiner}placement=${placement}&directory=${directory}&filename=${filename}`;\n        const prom = new Promise(function (resolve, reject) {\n            const xmlhttp = new XMLHttpRequest();\n            // TODO: Figure out if this needs headers\n\n            xmlhttp.addEventListener(\"loadend\", function (e) {\n                resolve(Sk.ffi.remapToPy(xmlhttp.responseText));\n            });\n\n            xmlhttp.open(\"GET\", url);\n            xmlhttp.send(null);\n        });\n        const susp = new Sk.misceval.Suspension();\n        let resolution = null;\n        susp.resume = ()=>resolution;\n        susp.data = {\n            type: \"Sk.promise\",\n            promise: prom.then((value) => {\n                resolution = value;\n                return value;\n            }, (err) => {\n                resolution =\"\";\n                return err;\n            })\n        };\n        return susp;\n    });\n    \n    return mod;\n};\n"
  },
  {
    "path": "src/skulpt_modules/weakref.js",
    "content": "export var $builtinmodule = function(name) {\n    var mod, sampleWrapper;\n    mod = {__name__: \"weakref\"};\n\n    /*mod.WeakSet = Sk.abstr.buildNativeClass(\"weakref.WeakSet\", {\n        constructor: function WeakSet()\n    });*/\n\n    var WeakSet = function($gbl, $loc) {\n        $loc.__init__ = new Sk.builtin.func(function (self, data) {\n            Sk.builtin.pyCheckArgs(\"__init__\", arguments, 2, 2);\n            Sk.builtin.pyCheckType(\"data\", \"iterable\", Sk.builtin.checkIterable(data));\n            self.data = [];\n            let iter = Sk.abstr.iter(data);\n            let next;\n            do {\n                next = Sk.abstr.iternext(iter);\n                if (next !== undefined) {\n                    self.data.push(new WeakRef(next));\n                }\n            } while (next !== undefined);\n            return Sk.builtin.none.none$;\n        });\n\n        $loc.__iter__ = new Sk.builtin.func(function(self) {\n            const viewOfData = [];\n            for (let i=0; i < self.data.length; i++) {\n                const item = self.data[i].deref();\n                if (item !== undefined) {\n                    viewOfData.push(item);\n                }\n            }\n            self.data = viewOfData;\n            return Sk.abstr.iter(new Sk.builtin.list(viewOfData));\n        });\n\n        /*$loc.next$ = new Sk.builtin.func(function (self) {\n            return self.tp$iter();\n        });*/\n\n        $loc.add = new Sk.builtin.func(function(self, item) {\n            self.data.push(new WeakRef(item));\n        });\n    };\n    mod.WeakSet = Sk.misceval.buildClass(mod, WeakSet, \"WeakSet\", []);\n\n    return mod;\n};"
  },
  {
    "path": "src/storage.js",
    "content": "let LOCAL_STORAGE_REF;\ntry {\n    LOCAL_STORAGE_REF = localStorage;\n    let mod = \"BLOCKPY_LOCALSTORAGE_TEST\";\n    LOCAL_STORAGE_REF.setItem(mod, mod);\n    LOCAL_STORAGE_REF.removeItem(mod);\n} catch(e) {\n    LOCAL_STORAGE_REF = {\n        _data       : {},\n        setItem     : function(id, val) { return this._data[id] = String(val); },\n        getItem     : function(id) { return this._data.hasOwnProperty(id) ? this._data[id] : null; },\n        removeItem  : function(id) { return delete this._data[id]; },\n        clear       : function() { return this._data = {}; }\n    };\n}\n\n/**\n * Helper object for interfacing with the LocalStorage. The LocalStorage\n * browser API allows for offline storage. That API is very unsophisticated,\n * and is essentially a lame key-value store. This object sits on top\n * and provides a number of useful utilities, including rudimentarycache\n * cache expiration.\n *\n * @constructor\n * @this {LocalStorageWrapper}\n * @param {String} namespace - A namespace to use in grouping access to localstorage. This keeps access clean and organized, while also making it possible to have multiple LocalStorage connections.\n */\nexport function LocalStorageWrapper(namespace) {\n    this.namespace = namespace;\n}\n/**\n * A method for adding a key/value pair to LocalStorage.\n * Note that both parameters must be strings (JSON.stringify is your friend).\n *\n * @param {String} key - The name of the key.\n * @param {String} value - The value.\n */\nLocalStorageWrapper.prototype.set =  function(key, value) {\n    LOCAL_STORAGE_REF.setItem(this.namespace+\"_\"+key+\"_value\", value);\n    LOCAL_STORAGE_REF.setItem(this.namespace+\"_\"+key+\"_timestamp\", $.now());\n};\n\n/**\n * A method for removing a key from LocalStorage.\n *\n * @param {String} key - The name of the key to remove.\n */\nLocalStorageWrapper.prototype.remove = function(key) {\n    LOCAL_STORAGE_REF.removeItem(this.namespace+\"_\"+key+\"_value\");\n    LOCAL_STORAGE_REF.removeItem(this.namespace+\"_\"+key+\"_timestamp\");\n};\n\n/**\n * A method for retrieving the value associated with the given key.\n *\n * @param {String} key - The name of the key to retrieve the value for.\n */\nLocalStorageWrapper.prototype.get = function(key) {\n    return LOCAL_STORAGE_REF.getItem(this.namespace+\"_\"+key+\"_value\");\n};\n\n/**\n * A method for retrieving the time associated with the given key.\n *\n * @param {String} key - The name of the key to retrieve the time for.\n * @returns {Integer} - The timestamp (local epoch) when the key was last set.\n */\nLocalStorageWrapper.prototype.getTime = function(key) {\n    return parseInt(LOCAL_STORAGE_REF.getItem(this.namespace+\"_\"+key+\"_timestamp\"));\n};\n\n/**\n * A method for retrieving the value associated with the given key.\n * If the key does not exist, then the default value is used instead.\n * This default will be set.\n *\n * @param {String} key - The name of the key to retrieve the value for.\n * @param {String} defaultValue - The default value to use. Must be a string.\n */\nLocalStorageWrapper.prototype.getDefault = function(key, defaultValue) {\n    if (this.has(key)) {\n        return this.get(key);\n    } else {\n        this.set(key, defaultValue);\n        return defaultValue;\n    }\n};\n\n/**\n * A test for whether the given key is in LocalStorage.\n *\n * @param {String} key - The key to test existence for.\n */\nLocalStorageWrapper.prototype.has = function(key) {\n    return LOCAL_STORAGE_REF.getItem(this.namespace+\"_\"+key+\"_value\") !== null;\n};\n\n/**\n * A test for whether the server has the newer version. This function\n * assumes that the server trip takes about 5 seconds. This method\n * is largely deprecated.\n *\n * @param {String} key - The key to check.\n * @param {Integer} server_time - The server's time as an epoch (in milliseconds)\n */\nLocalStorageWrapper.prototype.is_new = function(key, server_time) {\n    var stored_time = LOCAL_STORAGE_REF.getItem(this.namespace+\"_\"+key+\"_timestamp\");\n    return (server_time >= stored_time+5000);\n};\n"
  },
  {
    "path": "src/toolbar.js",
    "content": "/**\n * An object that manages the main toolbar, including the different mode buttons.\n * This doesn't actually have many responsibilities after the initial load.\n *\n * @constructor\n * @this {BlockPyToolbar}\n * @param {Object} main - The main BlockPy instance\n * @param {HTMLElement} tag - The HTML object this is attached to.\n */\nfunction BlockPyToolbar(main, tag) {\n    this.main = main;\n    this.tag = tag;\n    \n    // Holds the HTMLElement tags for each of the toolbar items\n    this.tags = {};\n    this.tags.mode_set_text = this.tag.find(\".blockpy-mode-set-text\");\n    this.tags.filename_picker = this.tag.find(\".blockpy-toolbar-filename-picker\");\n    \n    // Actually set up the toolbar!\n    this.activateToolbar();\n}\n\n\n\n/**\n * Register click events for more complex toolbar actions.\n *\n * Note: Pretty sure these are all deprecated!\n */\nBlockPyToolbar.prototype.activateToolbar = function() {\n    var main = this.main;\n    this.tag.find(\".blockpy-run\").click(function(e) {\n        //main.components.server.logEvent('editor', 'run')\n        var backup = this;\n        main.components.feedback.clear();\n        $(this).removeClass(\"btn-success\").addClass(\"btn-warning\")\n        //.html(\"Running\")\n        ;\n        //setTimeout(function() {\n        main.components.engine.on_run();\n        $(backup)\n            //.html('<span class=\"glyphicon glyphicon-play\"></span> Run')\n            .removeClass(\"btn-warning\")\n            .addClass(\"btn-success\");\n        //}, 20);\n    });\n    this.tags.mode_set_text.click(function() {\n        main.components.server.logEvent(\"editor\", \"text\");\n        main.model.settings.editor(\"Text\");\n    });\n    this.tag.find(\".blockpy-toolbar-reset\").click(function() {\n        main.model.programs[\"__main__\"](main.model.programs[\"starting_code\"]());\n        //main.components.editor.updateBlocks();\n        main.components.server.logEvent(\"editor\", \"reset\");\n        if (main.model.assignment.parsons()) {\n            main.components.editor.blockly.shuffle();\n        }\n    });\n    this.tag.find(\".blockpy-mode-set-blocks\").click(function(event) {\n        if (main.model.areBlocksUpdating()) {\n            main.components.server.logEvent(\"editor\", \"blocks\");\n            main.model.settings.editor(\"Blocks\");\n        } else {\n            event.preventDefault();\n            return false;\n        }\n    });\n    /*this.tag.find('.blockpy-mode-set-instructor').click(function() {\n        main.model.settings.editor(\"Instructor\");\n        main.components.server.logEvent('editor', 'instructor')\n    });*/\n    this.tag.find(\".blockpy-mode-set-split\").click(function(event) {\n        if (main.model.areBlocksUpdating()) {\n            main.model.settings.editor(\"Split\");\n            main.components.server.logEvent(\"editor\", \"split\");\n        } else {\n            event.preventDefault();\n            return false;\n        }\n    });\n    this.tag.find(\".blockpy-toolbar-import\").click(function() {\n        main.components.corgis.openDialog();\n        main.components.server.logEvent(\"editor\", \"import\");\n    });\n    this.tag.find(\".blockpy-toolbar-history\").click(function() {\n        main.components.history.openDialog();\n        main.components.server.logEvent(\"editor\", \"history\");\n    });\n    var instructorDialog = this.main.model.constants.container.find(\".blockpy-instructor-popup\");\n    this.tag.find(\".blockpy-toolbar-instructor\").click(function() {\n        instructorDialog.modal({\"backdrop\": false}).modal(\"show\");\n        instructorDialog.draggable({\n            \"handle\": \".modal-title\"\n        });\n        main.components.server.logEvent(\"editor\", \"instructor\");\n    });\n    this.tag.find(\".blockpy-toolbar-english\").click(function() {\n        main.components.english.openDialog();\n        main.components.server.logEvent(\"editor\", \"english\");\n    });\n    /*\n    var uploadButton = this.tag.find(\".blockpy-toolbar-upload\");\n    uploadButton.change(function() {\n        var fr = new FileReader();\n        var files = uploadButton[0].files;\n        fr.onload = function(e) {\n            fn = e.target.fileName;\n            var code = e.target.result;\n            if (fn.endsWith(\".ipynb\")) {\n                ipynb = JSON.parse(code);\n                var makePython = function(cell) {\n                    if (cell.cell_type == \"code\") {\n                        return cell.source.join(\"\\n\");\n                    } else if (cell.cell_type == \"markdown\" ||\n                               cell.cell_type == \"raw\") {\n                        return \"'''\"+cell.source.join(\"\\n\")+\"'''\";\n                    }\n                };\n                var isUsable = function(cell) {\n                    if (cell.cell_type == \"code\") {\n                        return cell.source.length > 0 && \n                               !cell.source[0].startsWith(\"%\");\n                    } else {\n                        return cell.cell_type == \"markdown\" ||\n                               cell.cell_type == \"raw\";\n                    }\n                };\n                code = ipynb.cells.filter(isUsable).map(makePython).join(\"\\n\");\n            }\n            main.setCode(code);\n            main.components.server.logEvent(\"editor\", \"upload\", code);\n            main.components.engine.on_run();\n        };\n        fr.fileName = files[0].name;\n        fr.readAsText(files[0]);\n        uploadButton.val(\"\");\n    });*/\n\n    /*\n    var downloadButton = this.tag.find(\".blockpy-toolbar-download\");\n    downloadButton.click(function() {\n        var data = main.model.programs[\"__main__\"]();\n        var filename=\"blockpy_\"+main.model.assignment.name();\n        // Make safe\n        filename = filename.replace(/[^a-z0-9]/gi, \"_\").toLowerCase();\n        // Make the data download as a file\n        var blob = new Blob([data], {type: \"text/plain\"});\n        if(window.navigator.msSaveOrOpenBlob) {\n            window.navigator.msSaveBlob(blob, filename);\n        } else{\n            var elem = window.document.createElement(\"a\");\n            elem.href = window.URL.createObjectURL(blob);\n            elem.download = filename;        \n            document.body.appendChild(elem);\n            elem.click();        \n            document.body.removeChild(elem);\n        }\n        main.components.server.logEvent(\"editor\", \"download\");\n    });*/\n    \n    this.tag.find(\".blockpy-toolbar-filename-picker label\").click(function() {\n        main.model.settings.filename($(this).data(\"filename\"));\n    });\n};"
  },
  {
    "path": "src/trace.js",
    "content": "export const TRACE_HTML = `\n\n<div class=\"blockpy-trace col-md-6 blockpy-panel\"\n            role=\"region\" aria-label=\"Trace\">\n    \n    <div class=\"clearfix\">\n        <strong>Trace: </strong>\n        \n        <!-- Feedback/Trace Visibility Control -->\n        <button type='button'\n                class='btn btn-sm btn-outline-secondary float-right blockpy-hide-trace'\n                data-bind=\"click: ui.secondRow.advanceState\">\n            <span class='fas fa-eye'></span> Hide Trace\n        </button>\n    </div>\n\n    <div class=\"input-group mb-3 blockpy-trace-controls\">\n        <div class=\"input-group-prepend\">\n            <button type='button' class='btn btn-outline-secondary'\n                data-bind=\"click: ui.trace.first\">\n                <span class='fas fa-step-backward'></span>\n            </button>\n            <button type='button' class='btn btn-outline-secondary'\n                data-bind=\"click: ui.trace.backward\">\n                <span class='fas fa-backward'></span>\n            </button>\n            <span class=\"input-group-text\">Step:</span>\n            <span class=\"input-group-text\">\n                <span data-bind='text: execution.student.currentTraceStep'></span>\n                / <span data-bind='text: execution.student.lastStep'></span>\n            </span>\n        </div>\n        <div class=\"input-group-append\">\n            <button type='button' class='btn btn-outline-secondary'\n                data-bind=\"click: ui.trace.forward\">\n                <span class='fas fa-forward'></span>\n            </button>\n            <button type='button' class='btn btn-outline-secondary'\n                data-bind=\"click: ui.trace.last\">\n                <span class='fas fa-step-forward'></span>\n            </button>\n            <span class=\"input-group-text\">\n                <span data-bind='text: ui.trace.line'></span>\n            </span>\n        </div>\n    </div>\n    <p data-bind=\"text: ui.trace.ast\"></p>\n    <p>Variables after this step:</p>\n    <table class='table table-sm table-striped table-bordered table-hover'>\n        <thead>\n            <tr><th>Name</th><th>Type</th><th>Value</th></tr>\n        </thead>\n        <tbody data-bind=\"foreach: ui.trace.data().properties\">\n            <tr data-bind=\"visible: name != '__file__' && name != '__path__'\">\n                <td data-bind=\"text: name\"></td>\n                <td data-bind=\"text: type\"></td>\n                <td>\n                    <code data-bind=\"text: value\"></code>\n                    <!-- ko if: type == \"List\" -->\n                    \n                    <a href=\"\" data-bind=\"click: //$root.viewExactValue(type, exact_value)\">\n                    <span class='glyphicon glyphicon-new-window'></span>\n                    </a>\n                    <!-- /ko -->\n                </td>\n            </tr>\n        </tbody>\n    </table>\n    \n</div>\n`;\n\nexport const AST_DESCRIPTIONS = {\n    \"Add\": \"An addition operator\",\n    \"And\": \"A boolean AND operator\",\n    \"AnnAssign\": \"An annotated assignment\",\n    \"Assert\": \"An assert statement\",\n    \"Assign\": \"An assignment statement\",\n    \"AsyncFor\": \"An asychronous for loop\",\n    \"AsyncFunctionDef\": \"An asychronous function definition\",\n    \"AsyncWith\": \"An asychronous with statement\",\n    \"Attribute\": \"An attribute lookup (access a field)\",\n    \"AugAssign\": \"An augmented assignment\",\n    \"AugLoad\": \"An augmented load\",\n    \"AugStore\": \"An augmented store\",\n    \"Await\": \"An await statement\",\n    \"BinOp\": \"A binary operator\",\n    \"BitAnd\": \"A bitwise AND operator\",\n    \"BitOr\": \"A bitwise OR operator\",\n    \"BitXor\": \"A bitwise XOR operator\",\n    \"BoolOp\": \"A boolean operator\",\n    \"Break\": \"A break statement\",\n    \"Bytes\": \"A literal bytes string\",\n    \"Call\": \"A function call\",\n    \"ClassDef\": \"A class definition\",\n    \"Compare\": \"A boolean comparison\",\n    \"Constant\": \"A literal value\",\n    \"Continue\": \"A continue statement\",\n    \"Del\": \"A delete statement\",\n    \"Delete\": \"A deletion\",\n    \"Dict\": \"A dictionary literal\",\n    \"DictComp\": \"A dictionary comprehension\",\n    \"Div\": \"A division operator\",\n    \"Ellipsis\": \"An ellipsis\",\n    \"Eq\": \"An equality comparison operator\",\n    \"ExceptHandler\": \"An except handler\",\n    \"Expr\": \"An expression used as a statement\",\n    \"Expression\": \"An evaluated expression\",\n    \"ExtSlice\": \"A multi-dimensional slice\",\n    \"FloorDiv\": \"An integer division operator\",\n    \"For\": \"A FOR loop\",\n    \"FormattedValue\": \"A formatted value in an f-string\",\n    \"FunctionDef\": \"A function definition\",\n    \"GeneratorExp\": \"A generator expression\",\n    \"Global\": \"A global statement\",\n    \"Gt\": \"A greater than comparison operator\",\n    \"GtE\": \"A greater than or equal to comparison operator\",\n    \"If\": \"An IF statement\",\n    \"IfExp\": \"An IF expression\",\n    \"Import\": \"An import statement\",\n    \"ImportFrom\": \"An import/from statement\",\n    \"In\": \"An IN operator\",\n    \"Index\": \"An index\",\n    \"Interactive\": \"An interactive expression\",\n    \"Invert\": \"An invert operator\",\n    \"Is\": \"An IS operator\",\n    \"IsNot\": \"An IS NOT operator\",\n    \"JoinedStr\": \"An f-string\",\n    \"LShift\": \"A left shift operator\",\n    \"Lambda\": \"A lambda expression\",\n    \"List\": \"A list literal\",\n    \"ListComp\": \"A list comprehension\",\n    \"Load\": \"A load\",\n    \"Lt\": \"A less than comparison operator\",\n    \"LtE\": \"A less than or equal to comparison operator\",\n    \"MatMult\": \"A matrix multiplication operator\",\n    \"Mod\": \"A modulo operator\",\n    \"Module\": \"A module\",\n    \"Mult\": \"A multiplication operator\",\n    \"Name\": \"A name\",\n    \"NameConstant\": \"A name constant\",\n    \"Nonlocal\": \"A nonlocal statement\",\n    \"Not\": \"A not operator\",\n    \"NotEq\": \"A not equal to comparison operator\",\n    \"NotIn\": \"A NOT IN operator\",\n    \"Num\": \"A numeric literal\",\n    \"Or\": \"A boolean OR operator\",\n    \"Param\": \"A parameter\",\n    \"Pass\": \"A pass statement\",\n    \"Pow\": \"A power operator\",\n    \"RShift\": \"A right shift operator\",\n    \"Raise\": \"A raise statement\",\n    \"Return\": \"A return statement\",\n    \"Set\": \"A set literal\",\n    \"SetComp\": \"A set comprehension\",\n    \"Slice\": \"A slice\",\n    \"Starred\": \"A starred argument\",\n    \"Store\": \"A store\",\n    \"Str\": \"A string literal\",\n    \"Sub\": \"A subtraction operator\",\n    \"Subscript\": \"A subscript\",\n    \"Suite\": \"A suite\",\n    \"Try\": \"A try statement\",\n    \"Tuple\": \"A tuple literal\",\n    \"TypeIgnore\": \" a type ignore\",\n    \"UAdd\": \"A unary addition operator\",\n    \"USub\": \"A unary subtraction operator\",\n    \"UnaryOp\": \"A unary operator\",\n    \"While\": \"A while loop\",\n    \"With\": \"A with statement\",\n    \"Yield\": \"A yield statement\",\n    \"YieldFrom\": \"A yield/from statement\"\n};\n\nexport class BlockPyTrace {\n\n    constructor(main, tag) {\n        this.main = main;\n        this.tag = tag;\n\n        this.IGNORED_GLOBALS = [\"__name__\", \"__doc__\", \"__package__\",\n                                \"classmethod\", \"property\", \"staticmethod\", \"$free\", \"$cell\"];\n\n        // this.trace.click(this.buildTraceTable.bind(this));\n    }\n\n    /**\n     * Consume a set of variables traced from the execution and parse out any\n     * global variables and modules.\n     *\n     * @param {Object} variables - a mapping of variable names to their Skupt value.\n     */\n    parseGlobals(variables) {\n        let result = [];\n        let modules = [];\n        //console.log(variables);\n        if (!this.main.model.display.traceExecution()) {\n            /*if (\"$cell\" in variables) {\n                variables = {...variables, ...variables.$cell};\n            }*/\n            /*if (\"$free\" in variables) {\n                variables = {...variables, ...variables.$free};\n            }*/\n            for (let property in variables) {\n                let value = variables[property];\n                if (this.IGNORED_GLOBALS.indexOf(property) === -1 && value !== undefined) {\n                    property = property.replace(\"_$rw$\", \"\")\n                        .replace(\"_$rn$\", \"\");\n                    let parsed;\n                    try {\n                        parsed = BlockPyTrace.parseValue(property, value);\n                    } catch {\n                        parsed = {\"name\": property, \"type\": \"Unknown\", \"value\": value.toString()};\n                    }\n                    if (parsed !== null) {\n                        result.push(parsed);\n                    } else if (value.constructor === Sk.builtin.module) {\n                        modules.push(value.$d.__name__.v);\n                    }\n                }\n            }\n        }\n        return {\"properties\": result, \"modules\": modules};\n    };\n\n    /**\n     * Convert a Skulpt value into a more easily printable object.\n     *\n     * @param {String} property\n     * @param {Object} value - the skulpt value\n     */\n    static parseValue(property, value, fullLength) {\n        if (value === undefined) {\n            return {\"name\": property,\n                \"type\": \"Unknown\",\n                \"value\": \"Undefined\"\n            };\n        }\n        switch (property) {\n            case \"dataclass\":\n                return {\n                    name: property,\n                    type: \"Decorator\",\n                    value: \"<dataclass decorator>\"\n                };\n        }\n        switch (value.constructor) {\n            case Sk.builtin.func:\n                return {\"name\": property,\n                    \"type\": \"Function\",\n                    \"value\":\n                        (value.func_code.co_varnames !== undefined ?\n                            \" Parameters: \"+value.func_code.co_varnames.join(\", \") :\n                            \" No parameters\")\n                };\n            case Sk.builtin.module: return null;\n            case Sk.builtin.str:\n                if (fullLength || value.v.length <= 32) {\n                    return {\"name\": property,\n                        \"type\": \"String\",\n                        \"value\": value.$r().v\n                    };\n                } else {\n                    return {\"name\": property,\n                        \"type\": \"String\",\n                        \"value\": \"[\"+value.sq$length()+\" characters not shown]\"\n                    };\n                }\n            case Sk.builtin.none:\n                return {\"name\": property,\n                    \"type\": \"None\",\n                    \"value\": \"None\"\n                };\n            case Sk.builtin.bool:\n                return {\"name\": property,\n                    \"type\": \"Boolean\",\n                    \"value\": value.$r().v\n                };\n            case Sk.builtin.nmber:\n                return {\"name\": property,\n                    \"type\": \"int\" === value.skType ? \"Integer\": \"Float\",\n                    \"value\": value.$r().v\n                };\n            case Sk.builtin.int_:\n                return {\"name\": property,\n                    \"type\": \"Integer\",\n                    \"value\": value.$r().v\n                };\n            case Sk.builtin.float_:\n                return {\"name\": property,\n                    \"type\": \"Float\",\n                    \"value\": value.$r().v\n                };\n            case Sk.builtin.tuple:\n                return {\"name\": property,\n                    \"type\": \"Tuple\",\n                    \"value\": value.$r().v\n                };\n            case Sk.builtin.list:\n                if (value.v.length <= 20) {\n                    return {\"name\": property,\n                        \"type\": \"List\",\n                        \"value\": value.$r().v,\n                        \"exact_value\": value\n                    };\n                } else {\n                    return {\"name\": property,\n                        \"type\": \"List\",\n                        \"value\": \"[... \"+value.v.length+\" elements ...]\",\n                        \"exact_value\": value\n                    };\n                }\n            case Sk.builtin.dict:\n                return {\"name\": property,\n                    \"type\": \"Dictionary\",\n                    \"value\": value.$r().v\n                };\n            case Number:\n                return {\"name\": property,\n                    \"type\": value % 1 === 0 ? \"Integer\" : \"Float\",\n                    \"value\": value\n                };\n            case String:\n                return {\"name\": property,\n                    \"type\": \"String\",\n                    \"value\": value\n                };\n            case Boolean:\n                return {\"name\": property,\n                    \"type\": \"Boolean\",\n                    \"value\": (value ? \"True\": \"False\")\n                };\n            default:\n                return {\"name\": property,\n                    \"type\": value.tp$name === undefined ? value : value.tp$name,\n                    \"value\": value.$r === undefined ? value : value.$r().v\n                };\n        }\n    };\n\n\n}\n\n// TODO: viewExactValue"
  },
  {
    "path": "src/utilities.js",
    "content": "/**\n * Move an element from index in an array to a new index.\n * O(n)\n * Courtesy:\n * https://stackoverflow.com/a/73877680/1718155\n * @param arr\n * @param oldIndex\n * @param newIndex\n * @returns {*}\n */\nexport function arrayMove(arr, oldIndex, newIndex) {\n    const length = arr.length;\n    const itemToMove = arr[oldIndex];\n\n    if (oldIndex === newIndex || oldIndex > length || newIndex > length) {\n        return arr;\n    }\n\n    return arr.reduce((acc, item, index) => {\n        if (index === oldIndex) {return acc;}\n        if (index === newIndex) {return oldIndex < newIndex ? [...acc, item, itemToMove] : [...acc, itemToMove, item];}\n        return [...acc, item];\n    }, []);\n}\n\n/**\n * Determines if the element is in the list.\n * @param {anything} needle - The element to look for.\n * @param {Array} haystack - The list to search.\n * @return {Boolean} Whether the element exists\n */\nfunction arrayContains(needle, haystack) {\n    return haystack.indexOf(needle) > -1;\n}\n\n/**\n * Remove duplicate values from an array, preserving order.\n * Creates a new array, so is non-destructive.\n * Courtesy:\n * https://stackoverflow.com/questions/1584370/how-to-merge-two-arrays-in-javascript-and-de-duplicate-items\n *\n * @param {Array} array - The array to uniquify. Elements compared with ===.\n */\nfunction arrayUnique(array) {\n    var a = array.concat();\n    for(var i=0; i<a.length; ++i) {\n        for(var j=i+1; j<a.length; ++j) {\n            if(a[i] === a[j]) {a.splice(j--, 1);}\n        }\n    }\n\n    return a;\n}\n\n/**\n * A helper function for extending an array based\n * on an \"addArray\" and \"removeArray\". Any element\n * found in removeArray is removed from the first array\n * and all the elements of addArray are added.\n * Any duplicate items are removed.\n * Creates a new array, so is non-destructive.\n *\n * @param {Array} array - the array to manipulate\n * @param {Array} addArray - the elements to add to the array\n * @param {Array} removeArray - the elements to remove from the array\n * @return {Array} The modified array\n */\nfunction expandArray(array, addArray, removeArray) {\n    var copyArray = array.filter(function(item) {\n        return removeArray.indexOf(item) === -1;\n    });\n    return arrayUnique(copyArray.concat(addArray));\n}\n\n/**\n * Deeply clones a node\n * @param {Node} node A node to clone\n * @return {Node} A clone of the given node and all its children\n */\nfunction cloneNode(node) {\n    // If the node is a text node, then re-create it rather than clone it\n    var clone = node.nodeType == 3 ? document.createTextNode(node.nodeValue) : node.cloneNode(false);\n \n    // Recurse     \n    var child = node.firstChild;\n    while(child) {\n        clone.appendChild(cloneNode(child));\n        child = child.nextSibling;\n    }\n     \n    return clone;\n}\n\n/**\n * Indents the given string by 4 spaces. This correctly handles multi-line strings.\n *\n * @param {String} str - The string to be manipulated.\n * @returns {String} The string with four spaces added at the start of every new line.\n */\nexport function indent(str) {\n    return str.replace(/^(?=.)/gm, \"    \");\n}\n\n/**\n * Turns spaces into underscores in the string, makes it lowercase.\n * @param {String} str - the string to be manipulated\n * @returns {string}\n */\nexport function slug(str) {\n    return str.replace(/\\s/g, \"_\").toLowerCase();\n}\n\n/**\n * Capitalize the first letter of a string.\n * @param {String} s - The string to be capitalized.\n * @returns {string}\n */\nexport function capitalize(s) {\n    if (typeof s !== \"string\") {\n        return \"\";\n    }\n    return s.charAt(0).toUpperCase() + s.slice(1);\n}\n\n/**\n * Return a random integer between [`min`, `max`].\n * \n * @param {number} min - The lowest possible integer.\n * @param {number} max - The highest possible integer (inclusive).\n * @returns {number} A random integer.\n */\nfunction randomInteger(min,max) {\n    return Math.floor(Math.random()*(max-min+1)+min);\n}\n\n/**\n * Encodes some text so that it can be safely written into an HTML box.\n * This includes replacing special HTML characters (&, <, >, etc.).\n *\n * @param {string} str - The text to be converted.\n * @return {string} The HTML-safe text.\n */\nexport function encodeHTML(str) {\n    return str.replace(/&/g, \"&amp;\")\n        .replace(/</g, \"&lt;\")\n        .replace(/>/g, \"&gt;\")\n        .replace(/\"/g, \"&quot;\")\n        .replace(/'/g, \"&apos;\");\n}\n\n/**\n * Shuffle the blocks in the workspace\n */\nif (typeof Blockly !== \"undefined\") {\n    Blockly.WorkspaceSvg.prototype.shuffle = function() {\n        var metrics = this.getMetrics();\n        var width = metrics.viewWidth / 2,\n            height = metrics.viewHeight;\n        var blocks = this.getTopBlocks(false);\n        var y = 5, x = 0,\n            maximal_increase = height/blocks.length;\n        for (var i = 0; i < blocks.length; i++){\n            // Get a block\n            var block = blocks[i];\n            var properties = block.getRelativeToSurfaceXY();\n            if (i == 0) {\n                x = 5;\n            } else {\n                x = -properties.x+randomInteger(10, width);\n            }\n            block.moveBy(x, \n                         -properties.y+y);\n            y = y + randomInteger(5, maximal_increase);\n        }\n    };\n}\n\n/**\n * Move elements from one array to another based on a conditional check.\n * https://stackoverflow.com/questions/31887967/javascript-move-objects-from-one-array-to-another-best-approach\n */\nfunction moveElements(source, target, moveCheck) {\n    for (var i = 0; i < source.length; i++) {\n        var element = source[i];\n        if (moveCheck(element)) {\n            source.splice(i, 1);\n            target.push(element);\n            i--;\n        }\n    } \n}\n\n\nexport function firstDefinedValue() {\n    for (var i = 0; i < arguments.length; i++) {\n        if (arguments[i] != null) {\n            return arguments[i];\n        }\n    }\n    return undefined;\n}\n\n/**\n * This function checks if the given object is one of the Sk.builtin objects\n * TODO: make this so we don't have to explicitly put out every option\n *          one possible thing we could do is get a string version of the \n *          of the constructor and look for the substring \"return new Sk.builtin\"\n *          But I don't know how reliable that is.  Rather, it's kind of hackish.\n *          Should tehoretically belong in Sk.ffi\n * @param {object} obj - the object to be examined\n * @return {boolean} true if the object is one of the Sk.builtin types\n**/\nfunction isSkBuiltin(obj){\n    return (obj instanceof Sk.builtin.dict) ||\n        (obj instanceof Sk.builtin.list) ||\n        (obj instanceof Sk.builtin.tuple) ||\n        (obj instanceof Sk.builtin.bool) ||\n        (obj instanceof Sk.builtin.int_) ||\n        (obj instanceof Sk.builtin.float_) ||\n        (obj instanceof Sk.builtin.str) ||\n        (obj instanceof Sk.builtin.lng);\n    //var cons_str = obj.constructor + \"\";\n    //return cons_str.indexOf(\"return new Sk.builtin\") !== -1;\n}\n\nfunction isAstNode(obj){\n    return obj instanceof Object && \"_astname\" in obj;\n}\n\nconst DEFAULT_SECTION_PATTERN = /^(##### Part (.+))$/gm;\n\n/**\n * Finds the given Part ID using the pattern `#### Part whatever` (on its own separate line). If the pattern\n * is not found, then null is returned. If no pattern is given (empty string or null), then the original text\n * is returned without modifications.\n * @param text\n * @param partId\n * @returns {null|*}\n */\nexport function extractPart(text, partId) {\n    if (partId === \"\" || partId == null) {\n        return text;\n    }\n    const parts = text.split(DEFAULT_SECTION_PATTERN);\n    for (let i=2; i < parts.length; i+=3) {\n        /* // Unnecessary assertion, but not bad to think about\n        if (!parts[i-1].startsWith(\"#### Part \")) {\n            throw \"Error: part format is broken!\";\n        }*/\n        if (parts[i] === partId) {\n            let body = parts[i+1];\n            if (body && body[0] === \"\\n\") {\n                body = body.slice(1);\n            }\n            if (i !== parts.length - 3 && body && body.slice(-1) === \"\\n\") {\n                body = body.slice(0, -1);\n            }\n            return body;\n        }\n    }\n    return null;\n}\n\n/**\n * Should theoretically belong in Sk.ffi, but I put it here instead to not mess up the skulpt files\n * like the normal Sk.ffi.remapToPy, it doesn't work for functions or more complex objects, but it handles\n * cases where the types in obj are a mix of python SIMPLE objects and SIMPLE normal javascript objects\n * @param {object} obj - the object to be converted\n * @return {Sk.builtin.???} - returns the corresponding python object, dropping all functions and things it can't convert\n**/\nfunction mixedRemapToPy(obj){\n    var k;\n    var kvs;\n    var i;\n    var arr;\n    //@TODO: should theoretically check if the object is a pyhon dict or array with js objects\n    if (isSkBuiltin(obj)){\n        //object is already python ready\n        return obj;\n    } else if (Object.prototype.toString.call(obj) === \"[object Array]\") {\n        //object is actually a javascript array\n        arr = [];\n        for (i = 0; i < obj.length; ++i) {\n            //for each object, convert it to a python object if it isn't one already\n            var subval = obj[i];\n            if(!isSkBuiltin(subval)){\n                arr.push(mixedRemapToPy(subval));\n            }else{\n                arr.push(subval);\n            }\n        }\n        return new Sk.builtin.list(arr);\n    } else if (obj === null) {//null object\n        return Sk.builtin.none.none$;\n    } else if (typeof obj === \"object\") {\n        if(!isSkBuiltin(obj)){\n            //assuming it's a standard dictionary\n            kvs = [];//Sk.builtin.dict uses an array of key-value,key-value...\n            for (k in obj) {\n                //convert the key if it needs to be converted\n                kvs.push(mixedRemapToPy(k));\n                //covert corresponding value if it needs to be converted\n                kvs.push(mixedRemapToPy(obj[k]));\n            }\n            //create the new dictionary\n            return new Sk.builtin.dict(kvs);\n        }else{\n            return obj;\n        }\n    } else if (typeof obj === \"string\") {\n        return new Sk.builtin.str(obj);\n    } else if (typeof obj === \"number\") {\n        return Sk.builtin.assk$(obj);\n    } else if (typeof obj === \"boolean\") {\n        return new Sk.builtin.bool(obj);\n    } else if(typeof obj === \"function\") {\n        return new Sk.builtin.str(obj.name);\n    }\n}\n\n\nexport function getCurrentTime() {\n    const today = new Date();\n    let h = Math.floor(today.getHours()%12);\n    let m = today.getMinutes();\n    //let s = today.getSeconds();\n    if (m < 10) {m = \"0\" + m;}\n    //if (s < 10) {s = \"0\" + s;}\n    let p = \"am\";\n    if (today.getHours()>=12) {\n        p = \"pm\";\n    }\n    return `${h}:${m}${p}`;\n}\n\nexport const pyInt = Sk.builtin.int_;\nexport const pyNone = Sk.builtin.none.none$;\nexport const pyStr = Sk.builtin.str;\nexport const pyTuple = Sk.builtin.tuple;\nexport const pyCallOrSuspend = Sk.misceval.callsimOrSuspendArray;\n\nexport const { isTrue, richCompareBool, chain } = Sk.misceval;\nexport const { typeName, setUpModuleMethods, buildNativeClass } = Sk.abstr;\nexport const { TypeError, ValueError, KeyError, IndexError, checkString, asnum$ } = Sk.builtin;\nexport const { remapToPy, remapToJs } = Sk.ffi;\nexport const { getAttr, setAttr } = Sk.generic;\nexport const chainOrSuspend = chain;"
  },
  {
    "path": "tests/block_coloration.html",
    "content": "<script src='https://code.jquery.com/jquery-2.1.3.min.js'></script>\n\n<style>\nspan {\n    display: inline-block;\n}\n</style>\n\n<div>\n<span>Control:</span>\n    <span>Decisions: 330</span>\n    <span>Iteration: 300</span>\n    <span>Functions: 210</span>\n<span>Properties:</span>\n    <span>Manipulations: 240</span>\n    <span>Calculations: 270</span>\n<span>Special:</span>\n    <span>Generic Function: 180</span>\n    <span>Plotting: 170</span>\n    <span>Utility: 160</span>\n<span>Data:</span>\n    <span>Simple Data: 100</span>\n    <span>Lists: 30</span>\n    <span>Dictionaries: 0</span>\n    <span>Concrete:</span>\n        <span>UNRESERVED: 75</span>\n        <span>Weather: 70</span>\n        <span>Earthquakes: 65</span>\n        <span>Stocks: 60</span>\n        <span>Crime: 55</span>\n        <span>Books: 50</span>\n    <span>ENDING: 330</span>\n</div>\n\n<script>\n// Changes the RGB/HEX temporarily to a HSL-Value, modifies that value \n// and changes it back to RGB/HEX.\n\nfunction changeHue(rgb, degree) {\n    var hsl = rgbToHSL(rgb);\n    hsl.h += degree;\n    if (hsl.h > 360) {\n        hsl.h -= 360;\n    }\n    else if (hsl.h < 0) {\n        hsl.h += 360;\n    }\n    return hslToRGB(hsl);\n}\n\n// exepcts a string and returns an object\nfunction rgbToHSL(rgb) {\n    // strip the leading # if it's there\n    rgb = rgb.replace(/^\\s*#|\\s*$/g, '');\n\n    // convert 3 char codes --> 6, e.g. `E0F` --> `EE00FF`\n    if(rgb.length == 3){\n        rgb = rgb.replace(/(.)/g, '$1$1');\n    }\n\n    var r = parseInt(rgb.substr(0, 2), 16) / 255,\n        g = parseInt(rgb.substr(2, 2), 16) / 255,\n        b = parseInt(rgb.substr(4, 2), 16) / 255,\n        cMax = Math.max(r, g, b),\n        cMin = Math.min(r, g, b),\n        delta = cMax - cMin,\n        l = (cMax + cMin) / 2,\n        h = 0,\n        s = 0;\n\n    if (delta == 0) {\n        h = 0;\n    }\n    else if (cMax == r) {\n        h = 60 * (((g - b) / delta) % 6);\n    }\n    else if (cMax == g) {\n        h = 60 * (((b - r) / delta) + 2);\n    }\n    else {\n        h = 60 * (((r - g) / delta) + 4);\n    }\n\n    if (delta == 0) {\n        s = 0;\n    }\n    else {\n        s = (delta/(1-Math.abs(2*l - 1)))\n    }\n\n    return {\n        h: h,\n        s: s,\n        l: l\n    }\n}\n\n// expects an object and returns a string\nfunction hslToRGB(hsl) {\n    var h = hsl.h,\n        s = hsl.s,\n        l = hsl.l,\n        c = (1 - Math.abs(2*l - 1)) * s,\n        x = c * ( 1 - Math.abs((h / 60 ) % 2 - 1 )),\n        m = l - c/ 2,\n        r, g, b;\n\n    if (h < 60) {\n        r = c;\n        g = x;\n        b = 0;\n    }\n    else if (h < 120) {\n        r = x;\n        g = c;\n        b = 0;\n    }\n    else if (h < 180) {\n        r = 0;\n        g = c;\n        b = x;\n    }\n    else if (h < 240) {\n        r = 0;\n        g = x;\n        b = c;\n    }\n    else if (h < 300) {\n        r = x;\n        g = 0;\n        b = c;\n    }\n    else {\n        r = c;\n        g = 0;\n        b = x;\n    }\n\n    r = normalize_rgb_value(r, m);\n    g = normalize_rgb_value(g, m);\n    b = normalize_rgb_value(b, m);\n\n    return rgbToHex(r,g,b);\n}\n\nfunction normalize_rgb_value(color, m) {\n    color = Math.floor((color + m) * 255);\n    if (color < 0) {\n        color = 0;\n    }\n    return color;\n}\n\nfunction rgbToHex(r, g, b) {\n    return \"#\" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);\n}\n\n$(\"span\").each(function(i, e) {\n    var i = parseInt($(e).text().split(\":\")[1])-130;\n   $(e).css(\"background-color\", \n            changeHue('5ba55b', \n                     i)).after(\"<br/>\");\n});</script>"
  },
  {
    "path": "tests/canvas_frame.html",
    "content": "<!DOCTYPE html>\n<!--[if gte IE 9 ]><html class=\"ie ie9 scripts-not-loaded\" lang=\"en\"> <![endif]-->\n<!--[if !(IE)]><!--> <html class=\"not-ie scripts-not-loaded\" lang=\"en\"> <!--<![endif]-->\n<head>\n  <meta charset=\"utf-8\">\n  <title>BlockPy #1.4</title>\n  <!--[if lte IE 8]> <meta http-equiv=refresh content=\"0; URL=/ie-8-is-not-supported.html\" /> <![endif]-->\n\n  <link href=\"https://du11hjcvx0uqb.cloudfront.net/dist/images/favicon-e10d657a73.ico\" rel=\"shortcut icon\" type=\"image/vnd.microsoft.icon\" />\n  <link href=\"https://du11hjcvx0uqb.cloudfront.net/dist/images/apple-touch-icon-585e5d997d.png\" rel=\"apple-touch-icon\" />\n\n  \n  <link href=\"https://du11hjcvx0uqb.cloudfront.net/dist/brandable_css/879eb50b2fa1b220ddccbe3f99101b8c/new_styles_normal_contrast/bundles/common-23d3b420b9.css\" media=\"all\" rel=\"stylesheet\" />\n  \n  <meta content=\"app-id=480883488\" name=\"apple-itunes-app\" />\n<meta content=\"app-id=com.instructure.candroid\" name=\"google-play-app\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n    <meta name=\"theme-color\" content=\"#0096db\">\n  \n  \n  \n  <script>\n    // listen for any clicks on links that have href=\"#\" and queue them to be fired on dom ready.\n      function _earlyClick(e){\n        var cur = e.target || e.srcElement;\n        while ( cur && cur.ownerDocument ) {\n          if ( cur.getAttribute('href') == '#' ) {\n            e.preventDefault();\n            _earlyClick.clicks = _earlyClick.clicks || [];\n            _earlyClick.clicks.push(cur);\n            break;\n          }\n          cur = cur.parentNode;\n        }\n      }\n      document.addEventListener('click', _earlyClick);\n  </script>\n</head>\n\n<body class=\"ic-framed-lti-tool with-left-side course-menu-expanded\">\n<noscript>\n  <div role=\"alert\" class=\"ic-flash-static ic-flash-error\">\n    <h1>You need to have JavaScript enabled in order to access this site.</h1>\n  </div>\n</noscript>\n\n\n\n\n<ul role=\"alert\" aria-live=\"assertive\" id=\"flash_message_holder\"></ul>\n<div role=\"alert\" aria-live=\"assertive\" aria-relevant=\"additions\" id=\"flash_screenreader_holder\" class=\"screenreader-only\"></div>\n\n<div id=\"application\" class=\"ic-app\">\n\n      <header id=\"header\" class=\"ic-app-header no-print \">\n    <div class=\"ic-app-header__layout\">\n      <div class=\"ic-app-header__primary\">\n      <a href=\"#content\" id=\"skip_navigation_link\">Skip To Content</a>\n        <div role=\"navigation\" class=\"ic-app-header__main-navigation\">\n          <div class=\"ic-app-header__logomark-container\">\n            <a href=\"https://canvas.instructure.com/\" class=\"ic-app-header__logomark\">\n              <span class=\"screenreader-only\">Dashboard</span>\n            </a>\n          </div>\n          <ul role=\"menu\" id=\"menu\"\n            class=\"ic-app-header__menu-list\"\n            aria-label=\"Main Navigation\"\n          >\n              <li class=\"menu-item ic-app-header__menu-list-item \">\n                <a id=\"global_nav_profile_link\" href=\"/profile\" class=\"ic-app-header__menu-list-link\">\n                  <div class=\"menu-item-icon-container\" aria-hidden=\"true\">\n                    <div class=\"ic-avatar ic-avatar--fake-student\">\n                      <img src=\"https://secure.gravatar.com/avatar/000?s=50&amp;d=https%3A%2F%2Fcanvas.instructure.com%2Fimages%2Fmessages%2Favatar-50.png\" alt=\"Test Student\" />\n                    </div>\n                  </div>\n                  <div class=\"menu-item__text\">\n                    Account\n                  </div>\n                </a>\n              </li>\n            <li class=\"ic-app-header__menu-list-item \">\n              <a id=\"global_nav_dashboard_link\" href=\"https://canvas.instructure.com/\" class=\"ic-app-header__menu-list-link\">\n                <div class=\"menu-item-icon-container\" aria-hidden=\"true\">\n                    <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"ic-icon-svg ic-icon-svg--dashboard\" version=\"1.1\" x=\"0\" y=\"0\" viewBox=\"0 0 280 200\" enable-background=\"new 0 0 280 200\" xml:space=\"preserve\"><path d=\"M231.6 94.2c-2.5-4.9-8.5-6.9-13.4-4.5l-57.3 28.6c-5.4-5.2-12.7-8.4-20.8-8.4 -16.6 0-30 13.5-30 30 0 16.6 13.5 30 30 30 16.6 0 30-13.5 30-30 0-1.3-0.1-2.5-0.2-3.8l57.3-28.6C232 105.2 234 99.2 231.6 94.2zM140 150c-5.5 0-10-4.5-10-10s4.5-10 10-10c5.5 0 10 4.5 10 10S145.6 150 140 150zM70 150H50c-5.5 0-10-4.5-10-10s4.5-10 10-10h20c5.5 0 10 4.5 10 10S75.5 150 70 150zM140 80c-5.5 0-10-4.5-10-10V50c0-5.5 4.5-10 10-10 5.5 0 10 4.5 10 10v20C150 75.5 145.5 80 140 80zM105 89.6c-3.5 0-6.8-1.8-8.7-5l-10-17.3c-2.8-4.8-1.1-10.9 3.7-13.7 4.8-2.8 10.9-1.1 13.7 3.7l10 17.3c2.8 4.8 1.1 10.9-3.7 13.7C108.4 89.1 106.7 89.6 105 89.6zM79.4 115.4c-1.7 0-3.4-0.4-5-1.3l-17.3-10c-4.8-2.8-6.4-8.9-3.7-13.7 2.8-4.8 8.9-6.4 13.7-3.7l17.3 10c4.8 2.8 6.4 8.9 3.7 13.7C86.2 113.6 82.8 115.4 79.4 115.4zM173.6 89.6c-1.7 0-3.4-0.4-5-1.3 -4.8-2.8-6.4-8.9-3.7-13.7l10-17.3c2.8-4.8 8.9-6.4 13.7-3.7 4.8 2.8 6.4 8.9 3.7 13.7l-10 17.3C180.4 87.8 177.1 89.6 173.6 89.6zM140 0C62.8 0 0 63 0 140.5V190c0 5.5 4.5 10 10 10h260c5.5 0 10-4.5 10-10v-49.5C280 63 217.2 0 140 0zM260 180H20v-39.5C20 74.1 73.8 20 140 20c66.2 0 120 54.1 120 120.5V180zM230 150h-20c-5.5 0-10-4.5-10-10s4.5-10 10-10h20c5.5 0 10 4.5 10 10S235.5 150 230 150z\"/></svg>\n                </div>\n                <div class=\"menu-item__text\">Dashboard</div>\n              </a>\n            </li>\n            <li class=\"menu-item ic-app-header__menu-list-item ic-app-header__menu-list-item--active\">\n              <a id=\"global_nav_courses_link\" href=\"/courses\" class=\"ic-app-header__menu-list-link\">\n                <div class=\"menu-item-icon-container\" aria-hidden=\"true\">\n                  <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"ic-icon-svg ic-icon-svg--courses\" version=\"1.1\" x=\"0\" y=\"0\" viewBox=\"0 0 280 259\" enable-background=\"new 0 0 280 259\" xml:space=\"preserve\"><path d=\"M226.2 259H32.3c-5.9 0-10.8-4.8-10.8-10.8v-43.5H10.8C4.8 204.8 0 199.9 0 194c0-6 4.8-10.8 10.8-10.8h10.8v-21.6H10.8c-5.9 0-10.8-4.8-10.8-10.8s4.8-10.8 10.8-10.8h10.8v-21.6H10.8c-5.9 0-10.8-4.8-10.8-10.8 0-6 4.8-10.8 10.8-10.8h10.8V75.4H10.8C4.8 75.4 0 70.6 0 64.7s4.8-10.8 10.8-10.8h10.8V10.8c0-6 4.8-10.8 10.8-10.8h193.9c5.9 0 10.8 4.8 10.8 10.8v21.6h32.3c5.9 0 10.8 4.8 10.8 10.8v172.4c0 6-4.8 10.8-10.8 10.8H237v21.9C237 254.2 232.2 259 226.2 259zM43.1 237.4h172.4V21.6H43.1v32.3h10.7c5.9 0 10.8 4.8 10.8 10.8s-4.8 10.8-10.8 10.8H43.1V97h10.7c5.9 0 10.8 4.8 10.8 10.8 0 6-4.8 10.8-10.8 10.8H43.1v21.6h10.7c5.9 0 10.8 4.8 10.8 10.8s-4.8 10.8-10.8 10.8H43.1v21.6h10.7c5.9 0 10.8 4.8 10.8 10.8 0 6-4.8 10.8-10.8 10.8H43.1V237.4zM237 204.8h21.5v-21.6H237V204.8zM237 161.7h21.5v-21.6H237V161.7zM237 118.5h21.5V97H237V118.5zM237 75.4h21.5V53.9H237V75.4zM172.2 129.3H96.9c-5.9 0-10.8-4.8-10.8-10.8V64.7c0-6 4.8-10.8 10.8-10.8h75.3c5.9 0 10.8 4.8 10.8 10.8v53.9C183 124.5 178.2 129.3 172.2 129.3zM107.7 107.8h53.8V75.4h-53.8V107.8z\"/></svg>\n                </div>\n                <div class=\"menu-item__text\">\n                  Courses\n                </div>\n              </a>\n            </li>\n            <li class=\"menu-item ic-app-header__menu-list-item \">\n              <a id=\"global_nav_calendar_link\" href=\"/calendar\" class=\"ic-app-header__menu-list-link\">\n                <div class=\"menu-item-icon-container\" aria-hidden=\"true\">\n                  <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"ic-icon-svg ic-icon-svg--calendar\" version=\"1.1\" x=\"0\" y=\"0\" viewBox=\"0 0 280 280\" enable-background=\"new 0 0 280 280\" xml:space=\"preserve\"><path d=\"M268.3 280H11.7C5.2 280 0 274.8 0 268.3V35c0-6.4 5.2-11.7 11.7-11.7h35V11.7C46.7 5.2 51.9 0 58.3 0h35C99.8 0 105 5.2 105 11.7v11.7h70V11.7C175 5.2 180.2 0 186.7 0h35c6.4 0 11.7 5.2 11.7 11.7v11.7h35c6.4 0 11.7 5.2 11.7 11.7v233.3C280 274.8 274.8 280 268.3 280zM23.3 256.7h233.3v-210h-23.3v11.7c0 6.4-5.2 11.7-11.7 11.7h-35c-6.4 0-11.7-5.2-11.7-11.7V46.7h-70v11.7c0 6.4-5.2 11.7-11.7 11.7h-35c-6.4 0-11.7-5.2-11.7-11.7V46.7H23.3V256.7zM198.3 46.7H210V23.3h-11.7V46.7zM70 46.7h11.7V23.3H70V46.7zM198.3 245c-6.4 0-11.7-5.2-11.7-11.7v-11.7h-35v11.7c0 6.4-5.2 11.7-11.7 11.7 -6.4 0-11.7-5.2-11.7-11.7v-11.7h-35v11.7c0 6.4-5.2 11.7-11.7 11.7S70 239.8 70 233.3v-11.7H46.7c-6.4 0-11.7-5.2-11.7-11.7s5.2-11.7 11.7-11.7H70V175H46.7c-6.4 0-11.7-5.2-11.7-11.7 0-6.4 5.2-11.7 11.7-11.7H70v-23.3H46.7c-6.4 0-11.7-5.2-11.7-11.7S40.2 105 46.7 105H70V93.3c0-6.4 5.2-11.7 11.7-11.7s11.7 5.2 11.7 11.7V105h35V93.3c0-6.4 5.2-11.7 11.7-11.7 6.4 0 11.7 5.2 11.7 11.7V105h35V93.3c0-6.4 5.2-11.7 11.7-11.7 6.4 0 11.7 5.2 11.7 11.7V105h23.3c6.4 0 11.7 5.2 11.7 11.7s-5.2 11.7-11.7 11.7H210v23.3h23.3c6.4 0 11.7 5.2 11.7 11.7 0 6.4-5.2 11.7-11.7 11.7H210v23.3h23.3c6.4 0 11.7 5.2 11.7 11.7s-5.2 11.7-11.7 11.7H210v11.7C210 239.8 204.8 245 198.3 245zM151.7 198.3h35V175h-35V198.3zM93.3 198.3h35V175h-35V198.3zM151.7 151.7h35v-23.3h-35V151.7zM93.3 151.7h35v-23.3h-35V151.7z\"/></svg>\n                </div>\n                <div class=\"menu-item__text\">\n                  Calendar\n                </div>\n              </a>\n            </li>\n            <li class=\"menu-item ic-app-header__menu-list-item \">\n              <a id=\"global_nav_conversations_link\" href=\"/conversations\" class=\"ic-app-header__menu-list-link\">\n                <div class=\"menu-item-icon-container\" aria-hidden=\"true\">\n                  <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"ic-icon-svg ic-icon-svg--inbox\" version=\"1.1\" x=\"0\" y=\"0\" viewBox=\"0 0 280 280\" enable-background=\"new 0 0 280 280\" xml:space=\"preserve\"><path d=\"M93.3 105c0-6.4 5.2-11.7 11.7-11.7h70c6.4 0 11.7 5.2 11.7 11.7s-5.2 11.7-11.7 11.7h-70C98.6 116.7 93.3 111.4 93.3 105zM105 70h23.3c6.4 0 11.7-5.2 11.7-11.7s-5.2-11.7-11.7-11.7H105c-6.4 0-11.7 5.2-11.7 11.7S98.6 70 105 70zM280 198.3v70c0 6.4-5.2 11.7-11.7 11.7H11.7C5.2 280 0 274.8 0 268.3v-69.8c0-1.1 0.1-2.2 0.4-3.3 0.3-1.1 0.8-2.1 1.3-3L36.7 134c2.1-3.5 5.9-5.7 10-5.7h11.7V11.7C58.3 5.2 63.6 0 70 0h140c6.4 0 11.7 5.2 11.7 11.7v116.7h11.7c4.1 0 7.9 2.1 10 5.7l35 58.3c0.1 0.2 0.1 0.5 0.3 0.7 0.4 0.7 0.6 1.4 0.8 2.2 0.2 0.8 0.4 1.5 0.5 2.3C279.9 197.8 280 198.1 280 198.3zM32.3 186.7h67.9c6.4 0 11.7 5.2 11.7 11.7V210c0 7.8 3.5 7.8 6 7.8h48.7c5.7 0 10.5-3.6 10.5-7.8v-11.7c0-6.4 5.2-11.7 11.7-11.7h59l-21-35h-5.1v11.7c0 6.4-5.2 11.7-11.7 11.7s-11.7-5.2-11.7-11.7v-140H81.7v140c0 6.4-5.2 11.7-11.7 11.7s-11.7-5.2-11.7-11.7v-11.7h-5.1L32.3 186.7zM256.7 210h-56.3c0 17.2-15.2 31.1-33.8 31.1h-48.7c-17.6 0-29.4-12.5-29.4-31.1H23.3v46.7h233.3V210zM175 163.3c6.4 0 11.7-5.2 11.7-11.7 0-6.4-5.2-11.7-11.7-11.7h-70c-6.4 0-11.7 5.2-11.7 11.7 0 6.4 5.2 11.7 11.7 11.7H175z\"/></svg>\n                  <span class=\"menu-item__badge\" style=\"display: none\">0</span>\n                </div>\n                <div class=\"menu-item__text\">\n                  Inbox\n                </div>\n              </a>\n            </li>\n              \n\n          </ul>\n        </div>\n        <div role=\"navigation\" class=\"ic-app-header__secondary-navigation\">\n          <ul role=\"menu\" class=\"ic-app-header__menu-list\">\n            <li class=\"ic-app-header__menu-list-item\">\n              <a class=\"support_url help_dialog_trigger ic-app-header__menu-list-link\" data-track-category=\"help system\" data-track-label=\"help button\" href=\"http://help.instructure.com/\">\n                <div class=\"menu-item-icon-container\" role=\"presentation\">\n                  <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"ic-icon-svg ic-icon-svg--help\" version=\"1.1\" x=\"0\" y=\"0\" viewBox=\"0 0 280 280\" enable-background=\"new 0 0 280 280\" xml:space=\"preserve\"><defs><rect x=\"-580\" y=\"-372\" width=\"1440\" height=\"1024\"/></defs><clipPath><use overflow=\"visible\"/></clipPath><g clip-path=\"url(#SVGID_2_)\"><defs><path d=\"M-557-42h-3v-3h3V-42zM-572-57h27v27h-27V-57z\"/></defs><clipPath><use overflow=\"visible\"/></clipPath><rect x=\"-560\" y=\"-45\" clip-path=\"url(#SVGID_4_)\" fill=\"none\" stroke=\"#FFFFFF\" stroke-width=\"4\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-miterlimit=\"10\" width=\"3\" height=\"3\"/></g><defs><rect x=\"-580\" y=\"-372\" width=\"1440\" height=\"1024\"/></defs><clipPath><use overflow=\"visible\"/></clipPath><g clip-path=\"url(#SVGID_6_)\"><defs><path d=\"M-557-24h-3v-3h3V-24zM-572-39h27v27h-27V-39z\"/></defs><clipPath><use overflow=\"visible\"/></clipPath><rect x=\"-560\" y=\"-27\" clip-path=\"url(#SVGID_8_)\" fill=\"none\" stroke=\"#FFFFFF\" stroke-width=\"4\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-miterlimit=\"10\" width=\"3\" height=\"3\"/></g><defs><rect x=\"-580\" y=\"-372\" width=\"1440\" height=\"1024\"/></defs><clipPath><use overflow=\"visible\"/></clipPath><g clip-path=\"url(#SVGID_10_)\"><defs><path d=\"M-539-33h-3v-3h3V-33zM-554-48h27v27h-27V-48z\"/></defs><clipPath><use overflow=\"visible\"/></clipPath><rect x=\"-542\" y=\"-36\" clip-path=\"url(#SVGID_12_)\" fill=\"none\" stroke=\"#FFFFFF\" stroke-width=\"4\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-miterlimit=\"10\" width=\"3\" height=\"3\"/></g><defs><rect x=\"-580\" y=\"-372\" width=\"1440\" height=\"1024\"/></defs><clipPath><use overflow=\"visible\"/></clipPath><g clip-path=\"url(#SVGID_14_)\"><defs><path d=\"M-539-42h-3v-3h3V-42zM-554-57h27v27h-27V-57z\"/></defs><clipPath><use overflow=\"visible\"/></clipPath><rect x=\"-542\" y=\"-45\" clip-path=\"url(#SVGID_16_)\" fill=\"none\" stroke=\"#FFFFFF\" stroke-width=\"4\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-miterlimit=\"10\" width=\"3\" height=\"3\"/></g><defs><rect x=\"-580\" y=\"-372\" width=\"1440\" height=\"1024\"/></defs><clipPath><use overflow=\"visible\"/></clipPath><g clip-path=\"url(#SVGID_18_)\"><defs><path d=\"M-539-24h-3v-3h3V-24zM-554-39h27v27h-27V-39z\"/></defs><clipPath><use overflow=\"visible\"/></clipPath><rect x=\"-542\" y=\"-27\" clip-path=\"url(#SVGID_20_)\" fill=\"none\" stroke=\"#FFFFFF\" stroke-width=\"4\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-miterlimit=\"10\" width=\"3\" height=\"3\"/></g><defs><rect x=\"-580\" y=\"-372\" width=\"1440\" height=\"1024\"/></defs><clipPath><use overflow=\"visible\"/></clipPath><g clip-path=\"url(#SVGID_22_)\"><defs><path d=\"M-557-33h-3v-3h3V-33zM-572-48h27v27h-27V-48z\"/></defs><clipPath><use overflow=\"visible\"/></clipPath><rect x=\"-560\" y=\"-36\" clip-path=\"url(#SVGID_24_)\" fill=\"none\" stroke=\"#FFFFFF\" stroke-width=\"4\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-miterlimit=\"10\" width=\"3\" height=\"3\"/></g><defs><rect x=\"-580\" y=\"-372\" width=\"1440\" height=\"1024\"/></defs><clipPath><use overflow=\"visible\"/></clipPath><g clip-path=\"url(#SVGID_26_)\"><defs><path d=\"M-548-42h-3v-3h3V-42zM-563-57h27v27h-27V-57z\"/></defs><clipPath><use overflow=\"visible\"/></clipPath><rect x=\"-551\" y=\"-45\" clip-path=\"url(#SVGID_28_)\" fill=\"none\" stroke=\"#FFFFFF\" stroke-width=\"4\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-miterlimit=\"10\" width=\"3\" height=\"3\"/></g><defs><rect x=\"-580\" y=\"-372\" width=\"1440\" height=\"1024\"/></defs><clipPath><use overflow=\"visible\"/></clipPath><g clip-path=\"url(#SVGID_30_)\"><defs><path d=\"M-548-24h-3v-3h3V-24zM-563-39h27v27h-27V-39z\"/></defs><clipPath><use overflow=\"visible\"/></clipPath><rect x=\"-551\" y=\"-27\" clip-path=\"url(#SVGID_32_)\" fill=\"none\" stroke=\"#FFFFFF\" stroke-width=\"4\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-miterlimit=\"10\" width=\"3\" height=\"3\"/></g><defs><rect x=\"-580\" y=\"-372\" width=\"1440\" height=\"1024\"/></defs><clipPath><use overflow=\"visible\"/></clipPath><g clip-path=\"url(#SVGID_34_)\"><defs><path d=\"M-548-33h-3v-3h3V-33zM-563-48h27v27h-27V-48z\"/></defs><clipPath><use overflow=\"visible\"/></clipPath><rect x=\"-551\" y=\"-36\" clip-path=\"url(#SVGID_36_)\" fill=\"none\" stroke=\"#FFFFFF\" stroke-width=\"4\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-miterlimit=\"10\" width=\"3\" height=\"3\"/></g><path d=\"M140 20c32.1 0 62.2 12.5 84.9 35.1C247.5 77.8 260 107.9 260 140s-12.5 62.2-35.1 84.9C202.2 247.5 172.1 260 140 260s-62.2-12.5-84.9-35.1C32.5 202.2 20 172.1 20 140s12.5-62.2 35.1-84.9C77.8 32.5 107.9 20 140 20M140 0C62.7 0 0 62.7 0 140s62.7 140 140 140 140-62.7 140-140S217.3 0 140 0L140 0z\"/><path d=\"M94.7 109.3c0-5.7 1.8-11.5 5.5-17.4 3.7-5.9 9.1-10.8 16.1-14.6 7.1-3.9 15.3-5.8 24.7-5.8 8.7 0 16.5 1.6 23.2 4.8 6.7 3.2 11.9 7.6 15.5 13.2 3.7 5.6 5.5 11.6 5.5 18.1 0 5.1-1 9.6-3.1 13.5 -2.1 3.9-4.6 7.2-7.4 10 -2.9 2.8-8 7.5-15.4 14.2 -2.1 1.9-3.7 3.5-4.9 4.9 -1.2 1.4-2.2 2.7-2.8 3.9 -0.6 1.2-1.1 2.4-1.4 3.5 -0.3 1.2-0.8 3.2-1.5 6.2 -1.1 6.3-4.7 9.4-10.8 9.4 -3.1 0-5.8-1-7.9-3.1 -2.1-2.1-3.2-5.1-3.2-9.1 0-5.1 0.8-9.5 2.4-13.2 1.6-3.7 3.7-7 6.2-9.8 2.6-2.8 6.1-6.1 10.5-10 3.9-3.4 6.7-5.9 8.4-7.6 1.7-1.7 3.2-3.6 4.3-5.7 1.2-2.1 1.8-4.4 1.8-6.9 0-4.8-1.8-8.9-5.4-12.2 -3.6-3.3-8.2-5-13.9-5 -6.6 0-11.5 1.7-14.7 5 -3.1 3.3-5.8 8.3-8 14.8 -2.1 6.8-5.9 10.2-11.7 10.2 -3.4 0-6.2-1.2-8.6-3.6C95.9 114.7 94.7 112.1 94.7 109.3zM138.9 208.5c-3.7 0-6.9-1.2-9.6-3.6 -2.7-2.4-4.1-5.7-4.1-10 0-3.8 1.3-7 4-9.6 2.7-2.6 5.9-3.9 9.8-3.9 3.8 0 7 1.3 9.6 3.9 2.6 2.6 3.9 5.8 3.9 9.6 0 4.2-1.4 7.5-4.1 10C145.6 207.3 142.5 208.5 138.9 208.5z\"/></svg>\n                </div>\n                <div class=\"menu-item__text\">\n                  Help\n                </div>\n</a>            </li>\n          </ul>\n        </div>\n      </div>\n    </div>\n    <div id=\"global_nav_tray_container\"></div>\n  </header>\n\n\n  <div id=\"instructure_ajax_error_box\">\n    <div style=\"text-align: right; background-color: #fff;\"><a href=\"#\" class=\"close_instructure_ajax_error_box_link\">Close</a></div>\n    <iframe id=\"instructure_ajax_error_result\" src=\"about:blank\" style=\"border: 0;\" title=\"Error\"></iframe>\n  </div>\n\n  \n\n  <div id=\"wrapper-container\" class=\"ic-app-container\">\n    <div id=\"wrapper\" class=\"ic-app-main-layout-vertical\">\n        <div class=\"ic-app-nav-toggle-and-crumbs no-print\">\n            <button type=\"button\" aria-hidden=\"true\" id=\"courseMenuToggle\" class=\"Button Button--link Button--small ic-app-course-nav-toggle\" title=\"Show and hide courses menu\"><i class=\"icon-hamburger\"></i></button>\n            <div class=\"ic-app-crumbs\">\n          <nav aria-label=\"breadcrumbs\" id=\"breadcrumbs\" role=\"navigation\"><ul><li class=\"home\"><a href=\"/\"><span class=\"ellipsible\">      <i class=\"icon-home\"\n                                                                                                                                              title=\"My Dashboard\">\n        <span class=\"screenreader-only\">My Dashboard</span>\n      </i>\n</span></a></li><li><a href=\"/courses/946043\"><span class=\"ellipsible\">Computational</span></a></li><li><a href=\"/courses/946043/assignments\"><span class=\"ellipsible\">Assignments</span></a></li><li><span class=\"ellipsible\">BlockPy #1.4</span></li></ul></nav>\n          </div>\n        </div>\n    <div class=\"ic-app-main-layout-horizontal\">\n          <div id=\"left-side\" class=\"list-view ic-app-course-menu\">\n            <nav aria-label=\"context\" role=\"navigation\"><ul id=\"section-tabs\"><li class=\"section\"><a class=\"home\" href=\"/courses/946043\">Home</a></li><li class=\"section\"><a aria-label=\"Course Assignments\" class=\"assignments active\" href=\"/courses/946043/assignments\">Assignments</a></li><li class=\"section\"><a aria-label=\"Course Discussions\" class=\"discussions\" href=\"/courses/946043/discussion_topics\">Discussions</a></li><li class=\"section\"><a aria-label=\"Course Grades\" class=\"grades\" href=\"/courses/946043/grades\">Grades</a></li><li class=\"section\"><a class=\"people\" href=\"/courses/946043/users\">People</a></li><li class=\"section\"><a class=\"pages\" href=\"/courses/946043/wiki\">Pages</a></li><li class=\"section\"><a aria-label=\"Course Files\" class=\"files\" href=\"/courses/946043/files\">Files</a></li><li class=\"section\"><a class=\"syllabus\" href=\"/courses/946043/assignments/syllabus\">Syllabus</a></li><li class=\"section\"><a class=\"outcomes\" href=\"/courses/946043/outcomes\">Outcomes</a></li><li class=\"section\"><a class=\"conferences\" href=\"/courses/946043/conferences\">Conferences</a></li><li class=\"section\"><a class=\"collaborations\" href=\"/courses/946043/collaborations\">Collaborations</a></li></ul></nav>\n        </div>\n        <div id=\"main\" class=\"ic-app-main-and-right-side\">\n          <div id=\"not_right_side\" class=\"ic-app-main-content\">\n            <div id=\"content-wrapper\" class=\"ic-app-main-content__primary\">\n                \n                \n              <div id=\"content\" role=\"main\" >\n                \n\n\n\n\n\n\n<div class=\"tool_content_wrapper\">\n\n<form action=\"https://localhost:5000/lti_assignments/lti?assignment_id=18\"\n      class=\"hide\"\n      method=\"POST\" target=tool_content\n      id=\"tool_form\"\n      data-tool-launch-type=\"\"\n      data-tool-id=\"blockpy-v1\"\n      data-tool-path=\"/lti_assignments/lti\"\n      data-message-type=\"tool_launch\">\n        <input id=\"oauth_consumer_key\" name=\"oauth_consumer_key\" type=\"hidden\" value=\"BlockPy is fun\" />\n        <input id=\"oauth_signature_method\" name=\"oauth_signature_method\" type=\"hidden\" value=\"HMAC-SHA1\" />\n        <input id=\"oauth_timestamp\" name=\"oauth_timestamp\" type=\"hidden\" value=\"1462861025\" />\n        <input id=\"oauth_nonce\" name=\"oauth_nonce\" type=\"hidden\" value=\"lEhmuLDkkjWoOe4aNupkwcL7uCoVhjQFL2TeglIMKE\" />\n        <input id=\"oauth_version\" name=\"oauth_version\" type=\"hidden\" value=\"1.0\" />\n        <input id=\"assignment_id\" name=\"assignment_id\" type=\"hidden\" value=\"18\" />\n        <input id=\"context_id\" name=\"context_id\" type=\"hidden\" value=\"cbdd860576c6c08ccb998b93009305c318bd269b\" />\n        <input id=\"context_label\" name=\"context_label\" type=\"hidden\" value=\"Computational\" />\n        <input id=\"context_title\" name=\"context_title\" type=\"hidden\" value=\"Computational Thinking - Dev\" />\n        <input id=\"custom_\" name=\"custom_\" type=\"hidden\" />\n        <input id=\"custom_canvas_assignment_points_possible\" name=\"custom_canvas_assignment_points_possible\" type=\"hidden\" value=\"10\" />\n        <input id=\"custom_canvas_assignment_title\" name=\"custom_canvas_assignment_title\" type=\"hidden\" value=\"BlockPy #1.4\" />\n        <input id=\"custom_canvas_enrollment_state\" name=\"custom_canvas_enrollment_state\" type=\"hidden\" value=\"active\" />\n        <input id=\"ext_ims_lis_basic_outcome_url\" name=\"ext_ims_lis_basic_outcome_url\" type=\"hidden\" value=\"https://canvas.instructure.com/api/lti/v1/tools/79954/ext_grade_passback\" />\n        <input id=\"ext_outcome_data_values_accepted\" name=\"ext_outcome_data_values_accepted\" type=\"hidden\" value=\"url,text\" />\n        <input id=\"ext_outcome_result_total_score_accepted\" name=\"ext_outcome_result_total_score_accepted\" type=\"hidden\" value=\"true\" />\n        <input id=\"ext_outcomes_tool_placement_url\" name=\"ext_outcomes_tool_placement_url\" type=\"hidden\" value=\"https://canvas.instructure.com/api/lti/v1/turnitin/outcomes_placement/79954\" />\n        <input id=\"ext_roles\" name=\"ext_roles\" type=\"hidden\" value=\"urn:lti:instrole:ims/lis/Student,urn:lti:role:ims/lis/Learner,urn:lti:sysrole:ims/lis/User\" />\n        <input id=\"launch_presentation_document_target\" name=\"launch_presentation_document_target\" type=\"hidden\" value=\"iframe\" />\n        <input id=\"launch_presentation_locale\" name=\"launch_presentation_locale\" type=\"hidden\" value=\"en\" />\n        <input id=\"launch_presentation_return_url\" name=\"launch_presentation_return_url\" type=\"hidden\" value=\"https://canvas.instructure.com/courses/946043/external_content/success/external_tool_redirect\" />\n        <input id=\"lis_outcome_service_url\" name=\"lis_outcome_service_url\" type=\"hidden\" value=\"https://canvas.instructure.com/api/lti/v1/tools/79954/grade_passback\" />\n        <input id=\"lis_person_name_family\" name=\"lis_person_name_family\" type=\"hidden\" value=\"Student\" />\n        <input id=\"lis_person_name_full\" name=\"lis_person_name_full\" type=\"hidden\" value=\"Test Student\" />\n        <input id=\"lis_person_name_given\" name=\"lis_person_name_given\" type=\"hidden\" value=\"Test\" />\n        <input id=\"lis_result_sourcedid\" name=\"lis_result_sourcedid\" type=\"hidden\" value=\"79954-946043-4639601-4860212-7000044813712002831daff49d5f861432e1cf1c\" />\n        <input id=\"lti_message_type\" name=\"lti_message_type\" type=\"hidden\" value=\"basic-lti-launch-request\" />\n        <input id=\"lti_version\" name=\"lti_version\" type=\"hidden\" value=\"LTI-1p0\" />\n        <input id=\"oauth_callback\" name=\"oauth_callback\" type=\"hidden\" value=\"about:blank\" />\n        <input id=\"resource_link_id\" name=\"resource_link_id\" type=\"hidden\" value=\"6cfd8d3e1524f79088289a20d14f6e59c0a3996e\" />\n        <input id=\"resource_link_title\" name=\"resource_link_title\" type=\"hidden\" value=\"BlockPy #1.4\" />\n        <input id=\"roles\" name=\"roles\" type=\"hidden\" value=\"Learner\" />\n        <input id=\"tool_consumer_info_product_family_code\" name=\"tool_consumer_info_product_family_code\" type=\"hidden\" value=\"canvas\" />\n        <input id=\"tool_consumer_info_version\" name=\"tool_consumer_info_version\" type=\"hidden\" value=\"cloud\" />\n        <input id=\"tool_consumer_instance_contact_email\" name=\"tool_consumer_instance_contact_email\" type=\"hidden\" value=\"notifications@instructure.com\" />\n        <input id=\"tool_consumer_instance_guid\" name=\"tool_consumer_instance_guid\" type=\"hidden\" value=\"07adb3e60637ff02d9ea11c7c74f1ca921699bd7.canvas.instructure.com\" />\n        <input id=\"tool_consumer_instance_name\" name=\"tool_consumer_instance_name\" type=\"hidden\" value=\"Free For Teachers\" />\n        <input id=\"user_id\" name=\"user_id\" type=\"hidden\" value=\"9f5f37ebb0c8e7b2f3e69dbc182df65299165307\" />\n        <input id=\"oauth_signature\" name=\"oauth_signature\" type=\"hidden\" value=\"Wlc91n4C3KVkPeh1iJNvPDuGq5c=\" />\n    <div style=\"margin-bottom: 20px;\">\n        <div class=\"load_tab\">\n            This tool needs to be loaded in a new browser window\n            <div style=\"margin: 10px 0;\">\n                <button class=\"btn\" type=\"submit\"\n                        data-expired_message=\"The session for this tool has expired. Please reload the page to access the tool again\">\n                    Load BlockPy #1.4 in a new window\n                </button>\n            </div>\n        </div>\n        <div class=\"tab_loaded\" style=\"display: none;\">\n            This tool was successfully loaded in a new browser window. Reload the page to access the tool again.\n        </div>\n    </div>\n</form>\n<iframe allowfullscreen=\"true\" class=\"tool_launch\" id=\"tool_content\" mozallowfullscreen=\"true\" name=\"tool_content\" src=\"index_v4.html\" tabindex=\"0\" title=\"Tool Content\" webkitallowfullscreen=\"true\"></iframe>\n\n</div>\n\n\n<div id=\"module_sequence_footer\"></div>\n\n              </div>\n            </div>\n            <div id=\"right-side-wrapper\" class=\"ic-app-main-content__secondary\">\n              <aside id=\"right-side\" role=\"complementary\">\n                \n              </aside>\n            </div>\n          </div>\n        </div>\n      </div>\n    </div>\n  </div>\n\n\n    <div id=\"fixed_bottom\">\n</div>\n\n\n    <div style=\"display:none;\"><!-- Everything inside of this should always stay hidden -->\n        <div id=\"page_view_id\">8ba2522e-446d-4e9e-96d4-b7876c314f5c</div>\n        <a id=\"equella_endpoint_url\" href=\"http://oer.equella.com/signon.do\">&nbsp;</a>\n        <a id=\"equella_callback_url\" href=\"https://canvas.instructure.com/external_content/success/equella\">&nbsp;</a>\n        <a id=\"equella_cancel_url\" href=\"https://canvas.instructure.com/external_content/cancel/equella\">&nbsp;</a>\n        <a id=\"equella_action\" href=\"selectOrAdd\">&nbsp;</a>\n          <div id=\"equella_teaser\">Equella is a shared content repository that organizations can use to easily track and reuse content.  This OER repository is a collection of free resources provided by Equella.</div>\n    </div>\n    <div id=\"cant_record_dialog\" style=\"display: none;\">\n  <div>\n    In order to create video or audio recordings your computer needs to be \n    webcam-enabled.  If you don&#39;t have a webcam on your computer, you can still\n    record audio-only messages by first installing the Google Video Chat\n    plugin.\n  </div>\n  <div style=\"text-align: center; font-size: 1.5em; margin: 10px;\">\n    <a href=\"http://www.google.com/chat/video\" target=\"_blank\" class=\"btn\">Install the Video Plugin</a>\n  </div>\n  <div class=\"links\" style=\"text-align: right; font-size: 0.8em; display: none;\">\n    <a href=\"#\" class=\"cant_record_link\">Don&#39;t have a webcam?</a>\n  </div>\n</div>\n  <div id='aria_alerts' class='hide-text affix' role=\"alert\" aria-live=\"assertive\"></div>\n  <script>\n  INST = {\"environment\":\"production\",\"allowMediaComments\":true,\"kalturaSettings\":{\"domain\":\"nv.instructuremedia.com\",\"resource_domain\":\"nv.instructuremedia.com\",\"rtmp_domain\":\"fms-prod.instructuremedia.com\",\"partner_id\":\"9\",\"subpartner_id\":\"0\",\"player_ui_conf\":\"0\",\"kcw_ui_conf\":\"0\",\"upload_ui_conf\":\"0\",\"max_file_size_bytes\":534773760,\"do_analytics\":false,\"hide_rte_button\":false,\"js_uploader\":true},\"equellaEnabled\":true,\"googleAnalyticsAccount\":\"UA-9138420-1\",\"disableScribdPreviews\":true,\"logPageViews\":true,\"maxVisibleEditorButtons\":3,\"editorButtons\":[{\"name\":\"BlockpyTesting\",\"id\":79954,\"url\":\"https:\\/\\/localhost:5000\\/lti_assignments\\/share\",\"icon_url\":\"https:\\/\\/localhost:5000\\/static\\/images\\/puppy-corgi-head-tiny.png\",\"canvas_icon_class\":null,\"width\":700,\"height\":600}],\"pandaPubSettings\":{\"push_url\":\"https:\\/\\/pp-beta.instructure.com\\/push\",\"application_id\":\"o9lhB0KU5xBx3SIiP8et\"}};\n  ENV = {\"ASSET_HOST\":\"https:\\/\\/du11hjcvx0uqb.cloudfront.net\",\"active_brand_config\":\"879eb50b2fa1b220ddccbe3f99101b8c\",\"url_to_what_gets_loaded_inside_the_tinymce_editor_css\":\"https:\\/\\/du11hjcvx0uqb.cloudfront.net\\/dist\\/brandable_css\\/879eb50b2fa1b220ddccbe3f99101b8c\\/new_styles_normal_contrast\\/bundles\\/what_gets_loaded_inside_the_tinymce_editor-cf41a971bd.css\",\"current_user_id\":\"4860212\",\"current_user\":{\"id\":\"4860212\",\"display_name\":\"Test Student\",\"avatar_image_url\":\"https:\\/\\/secure.gravatar.com\\/avatar\\/000?s=50\\u0026d=https%3A%2F%2Fcanvas.instructure.com%2Fimages%2Fmessages%2Favatar-50.png\",\"html_url\":\"https:\\/\\/canvas.instructure.com\\/about\\/4860212\",\"fake_student\":true},\"current_user_roles\":[\"user\",\"student\"],\"files_domain\":\"safefiles.instructure.com\",\"DOMAIN_ROOT_ACCOUNT_ID\":70000000000010,\"use_new_styles\":true,\"k12\":false,\"use_high_contrast\":false,\"SETTINGS\":{\"open_registration\":true},\"page_view_update_url\":\"\\/page_views\\/8ba2522e-446d-4e9e-96d4-b7876c314f5c?page_view_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpIjoiOGJhMjUyMmUtNDQ2ZC00ZTllLTk2ZDQtYjc4NzZjMzE0ZjVjIiwidSI6NzAwMDAwMDQ4NjAyMTIsImMiOiIyMDE2LTA1LTEwVDA2OjE3OjA0LjQyWiJ9.5eiCDwUo17QFF_EYgd-0b3HckfnGhZmTwsU9aweqZJ4\",\"context_asset_string\":\"course_946043\",\"ping_url\":\"https:\\/\\/canvas.instructure.com\\/api\\/v1\\/courses\\/946043\\/ping\",\"TIMEZONE\":\"America\\/Denver\",\"CONTEXT_TIMEZONE\":\"America\\/Denver\",\"LOCALE\":\"en-US\",\"TOURS\":[],\"RICH_CONTENT_SERVICE_ENABLED\":false,\"redirect_return_success_url\":\"https:\\/\\/canvas.instructure.com\\/courses\\/946043\\/assignments\",\"redirect_return_cancel_url\":\"https:\\/\\/canvas.instructure.com\\/courses\\/946043\\/assignments\",\"badge_counts\":{\"submissions\":2},\"notices\":[]};\n\n    // TODO: move this out when we have a single require call\n    require = {\n      translate: true,\n      baseUrl: '/optimized',\n      paths: {\n    \"common\":\"compiled\\/bundles\\/common\",\n    \"jqueryui\":\"vendor\\/jqueryui\",\n    \"compiled\\/tinymce\":\"compiled\\/tinymce.js?v2\",\n    \"demo_site\":\"plugins\\/demo_site\",\n    \"migration_tool\":\"plugins\\/migration_tool\",\n    \"catalog_provisioner\":\"plugins\\/catalog_provisioner\",\n    \"instructure_misc_plugin\":\"plugins\\/instructure_misc_plugin\",\n    \"analytics\":\"plugins\\/analytics\",\n    \"multiple_root_accounts\":\"plugins\\/multiple_root_accounts\",\n    \"canvasnet_registration\":\"plugins\\/canvasnet_registration\",\n    \"compiled\\/bundles\\/modules\\/content_migration_setup_without_extensions\":\"compiled\\/bundles\\/modules\\/content_migration_setup\",\n    \"compiled\\/bundles\\/modules\\/content_migration_setup\":\"compiled\\/bundles\\/modules\\/content_migration_setup_with_extensions\",\n    \"compiled\\/registration\\/main_without_extensions\":\"compiled\\/registration\\/main\",\n    \"compiled\\/registration\\/main\":\"compiled\\/registration\\/main_with_extensions\",\n    \"compiled\\/registration\\/signupDialog_without_extensions\":\"compiled\\/registration\\/signupDialog\",\n    \"compiled\\/registration\\/signupDialog\":\"compiled\\/registration\\/signupDialog_with_extensions\",\n    \"compiled\\/bundles\\/modules\\/account_quota_settings_without_extensions\":\"compiled\\/bundles\\/modules\\/account_quota_settings\",\n    \"compiled\\/bundles\\/modules\\/account_quota_settings\":\"compiled\\/bundles\\/modules\\/account_quota_settings_with_extensions\",\n    \"canvas_quizzes\":\"client_apps\\/canvas_quizzes\",\n    \"app\\/config\\/environments\\/production\":\"empty:\"},\n      packages : [{\"name\":\"ic-ajax\",\"location\":\"bower\\/ic-ajax\\/dist\\/amd\"},{\"name\":\"ic-styled\",\"location\":\"bower\\/ic-styled\"},{\"name\":\"ic-menu\",\"location\":\"bower\\/ic-menu\"},{\"name\":\"ic-tabs\",\"location\":\"bower\\/ic-tabs\\/dist\\/amd\"},{\"name\":\"ic-droppable\",\"location\":\"bower\\/ic-droppable\\/dist\\/amd\"},{\"name\":\"ic-sortable\",\"location\":\"bower\\/ic-sortable\\/dist\\/amd\"},{\"name\":\"ic-modal\",\"location\":\"bower\\/ic-modal\\/dist\\/amd\"},{\"name\":\"ic-lazy-list\",\"location\":\"bower\\/ic-lazy-list\"},{\"name\":\"ember-qunit\",\"location\":\"bower\\/ember-qunit\\/dist\\/amd\"}],\n      shim: {\n    'bower/react-router/build/umd/ReactRouter': {\n      deps: ['react'],\n      exports: 'ReactRouter'\n    },\n    'bower/react-tray/dist/react-tray': {\n      deps: ['react']\n    },\n    'bower/react-modal/dist/react-modal': {\n      deps: ['react']\n    },\n    'bower/react-tokeninput/dist/react-tokeninput': {\n      deps: ['react'],\n    },\n    'bower/react-select-box/dist/react-select-box': {\n      deps: ['react'],\n    },\n    'bower/ember/ember': {\n      deps: ['jquery', 'handlebars'],\n      exports: 'Ember'\n    },\n    'bower/ember-data/ember-data': {\n      deps: ['ember'],\n      exports: 'DS'\n    },\n    'bower/handlebars/handlebars.runtime': {\n      exports: 'Handlebars'\n    },\n    'bower/reflux/dist/reflux.js': {\n      deps: ['react'],\n      exports: 'Reflux'\n    },\n    'vendor/FileAPI/FileAPI.min': {\n      deps: ['jquery', 'vendor/FileAPI/config'],\n      exports: 'FileAPI'\n    },\n    'fixed-data-table': {\n      deps: ['object_assign', 'react'],\n      exports: 'fixed-data-table'\n    },\n    'vendor/bootstrap-select/bootstrap-select' : {\n      deps: ['jquery'],\n      exports: '$'\n    },\n    'vendor/jquery.jcrop': {\n      deps: ['jquery'],\n      exports: '$'\n    },\n    'vendor/jquery.smartbanner': {\n      deps: ['jquery'],\n      exports: '$'\n    },\n    'vendor/md5': {\n      exports: 'CryptoJS'\n    },\n    'handlebars': {\n      deps: ['bower/handlebars/handlebars.runtime.amd'],\n      exports: 'Handlebars'\n    },\n    'vendor/i18n': {\n      exports: 'I18n'\n    },\n    'vendor/react-infinite-scroll.min' : {\n      deps: ['react'],\n      exports: 'InfiniteScroll'\n    },\n    'bower/tinymce/tinymce' : {\n      exports: 'tinymce'\n    },\n    'bower/axios/dist/axios' : {\n      exports: 'axios'\n    },\n    'bower/tinymce/themes/modern/theme' : {\n      deps: ['bower/tinymce/tinymce'],\n      exports: 'tinymce'\n    }\n  }\n,\n      map: {\"canvas_quizzes\":{\"lodash\":\"underscore\",\"d3\":\"vendor\\/d3.v3\",\"backbone\":\"vendor\\/backbone\",\"jquery\\/instructure_date_and_time\":\"jquery.instructure_date_and_time\",\"react\":\"old_unsupported_dont_use_react\",\"react-router\":\"old_unsupported_dont_use_react-router\"},\"*\":{\"React\":\"react\"}},\n      waitSeconds: 60\n    };\n</script>\n\n  <script src=\"https://du11hjcvx0uqb.cloudfront.net/dist/optimized/vendor/require-749d0c60e9.js\"></script>\n\n<script src=\"https://du11hjcvx0uqb.cloudfront.net/dist/optimized/compiled/bundles/common-c72deef4f9.js\"></script>\n<script src=\"https://du11hjcvx0uqb.cloudfront.net/dist/optimized/compiled/bundles/legacy/external_tools_tool_show-9bdbf7a803.js\"></script>\n<script src=\"https://du11hjcvx0uqb.cloudfront.net/dist/optimized/compiled/bundles/external_tool_redirect-821f8da478.js\"></script>\n<script src=\"https://du11hjcvx0uqb.cloudfront.net/dist/optimized/compiled/bundles/module_sequence_footer-edd2e800ce.js\"></script>\n<script src=\"https://du11hjcvx0uqb.cloudfront.net/dist/optimized/compiled/bundles/navigation_header-c3b6fef525.js\"></script>\n<script>\n//<![CDATA[\n          require(['jquery'], function () {\n            [\"https:\\/\\/instructure-uploads.s3.amazonaws.com\\/account_70000000000010\\/attachments\\/40660842\\/newUIcanvabadges-plus-tracking.js?AWSAccessKeyId=AKIAJFNFXH2V2O7RPCAA\\u0026Expires=1931096420\\u0026Signature=8caL6WA8E70VZLhB66zcvEzucL4%3D\\u0026response-cache-control=Cache-Control%3Amax-age%3D473364000%2C%20public\\u0026response-expires=473364000\"].forEach(function (src) {\n              var s = document.createElement('script');\n              s.src = src;\n              document.body.appendChild(s);\n            });\n          });\n\n//]]>\n</script>\n\n\n\n  <script>\n  // Determines if the scripts are loaded.\n  // When we get everything out of the views, and have a single top-level\n  // `require`, this becomes meaningless and will be abandoned.\n  (function() {\n    var attempts = 0;\n    var timeout = 10;\n    var check = function() {\n      attempts++;\n      var done = !window.requirejs.s.contexts._.defQueue.length\n      var giveup = attempts === 100; // 1 second\n      if (done || giveup) {\n        var className = document.documentElement.className;\n        document.documentElement.className = className.replace(/scripts-not-loaded/, '');\n        return;\n      }\n      setTimeout(check, timeout);\n    };\n\n    check();\n  }).call(this);\n  </script>\n\n\n</div> <!-- #application -->\n</body>\n</html>\n"
  },
  {
    "path": "tests/d3test.html",
    "content": "<!DOCTYPE html>\n<meta charset=\"utf-8\">\n<style>\n\nbody {\n  font: 10px sans-serif;\n}\n\n.axis path,\n.axis line {\n  fill: none;\n  stroke: #000;\n  shape-rendering: crispEdges;\n}\n\n.grid path,\n.grid line {\n  fill: none;\n  stroke: rgba(0, 0, 0, 0.25);\n  shape-rendering: crispEdges;\n}\n\n.x.axis path {\n  display: none;\n}\n\n.line {\n  fill: none;\n  stroke-width: 2.5px;\n}\n\n</style>\n<body>\n<script src=\"libs/d3.min.js\"></script>\n<script>\nvar data = [ { label: \"Data Set 1\", \n               x: [0, 1, 2, 3, 4], \n               y: [0, 1, 2, 3, 4] }, \n             { label: \"Data Set 2\", \n               x: [0, 1, 2, 3, 4], \n               y: [0, 1, 4, 9, 16] } ] ;\nvar xy_chart = d3_xy_chart()\n    .width(960)\n    .height(500)\n    .xlabel(\"X Axis\")\n    .ylabel(\"Y Axis\") ;\nvar svg = d3.select(\"body\").append(\"svg\")\n    .datum(data)\n    .call(xy_chart) ;\n\nfunction d3_xy_chart() {\n    var width = 640,  \n        height = 480, \n        xlabel = \"X Axis Label\",\n        ylabel = \"Y Axis Label\" ;\n    \n    function chart(selection) {\n        selection.each(function(datasets) {\n            //\n            // Create the plot. \n            //\n            var margin = {top: 20, right: 80, bottom: 30, left: 50}, \n                innerwidth = width - margin.left - margin.right,\n                innerheight = height - margin.top - margin.bottom ;\n            \n            var x_scale = d3.scale.linear()\n                .range([0, innerwidth])\n                .domain([ d3.min(datasets, function(d) { return d3.min(d.x); }), \n                          d3.max(datasets, function(d) { return d3.max(d.x); }) ]) ;\n            \n            var y_scale = d3.scale.linear()\n                .range([innerheight, 0])\n                .domain([ d3.min(datasets, function(d) { return d3.min(d.y); }),\n                          d3.max(datasets, function(d) { return d3.max(d.y); }) ]) ;\n\n            var color_scale = d3.scale.category10()\n                .domain(d3.range(datasets.length)) ;\n\n            var x_axis = d3.svg.axis()\n                .scale(x_scale)\n                .orient(\"bottom\") ;\n\n            var y_axis = d3.svg.axis()\n                .scale(y_scale)\n                .orient(\"left\") ;\n\n            var x_grid = d3.svg.axis()\n                .scale(x_scale)\n                .orient(\"bottom\")\n                .tickSize(-innerheight)\n                .tickFormat(\"\") ;\n\n            var y_grid = d3.svg.axis()\n                .scale(y_scale)\n                .orient(\"left\") \n                .tickSize(-innerwidth)\n                .tickFormat(\"\") ;\n\n            var draw_line = d3.svg.line()\n                .interpolate(\"basis\")\n                .x(function(d) { return x_scale(d[0]); })\n                .y(function(d) { return y_scale(d[1]); }) ;\n\n            var svg = d3.select(this)\n                .attr(\"width\", width)\n                .attr(\"height\", height)\n                .append(\"g\")\n                .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\") ;\n            \n            svg.append(\"g\")\n                .attr(\"class\", \"x grid\")\n                .attr(\"transform\", \"translate(0,\" + innerheight + \")\")\n                .call(x_grid) ;\n\n            svg.append(\"g\")\n                .attr(\"class\", \"y grid\")\n                .call(y_grid) ;\n\n            svg.append(\"g\")\n                .attr(\"class\", \"x axis\")\n                .attr(\"transform\", \"translate(0,\" + innerheight + \")\") \n                .call(x_axis)\n                .append(\"text\")\n                .attr(\"dy\", \"-.71em\")\n                .attr(\"x\", innerwidth)\n                .style(\"text-anchor\", \"end\")\n                .text(xlabel) ;\n            \n            svg.append(\"g\")\n                .attr(\"class\", \"y axis\")\n                .call(y_axis)\n                .append(\"text\")\n                .attr(\"transform\", \"rotate(-90)\")\n                .attr(\"y\", 6)\n                .attr(\"dy\", \"0.71em\")\n                .style(\"text-anchor\", \"end\")\n                .text(ylabel) ;\n\n            var data_lines = svg.selectAll(\".d3_xy_chart_line\")\n                .data(datasets.map(function(d) {return d3.zip(d.x, d.y);}))\n                .enter().append(\"g\")\n                .attr(\"class\", \".d3_xy_chart_line\") ;\n            \n            data_lines.append(\"path\")\n                .attr(\"class\", \"line\")\n                .attr(\"d\", function(d) {return draw_line(d); })\n                .attr(\"stroke\", function(_, i) {return color_scale(i);}) ;\n            \n            data_lines.append(\"text\")\n                .datum(function(d, i) { return {name: datasets[i].label, final: d[d.length-1]}; }) \n                .attr(\"transform\", function(d) { \n                    return ( \"translate(\" + x_scale(d.final[0]) + \",\" + \n                             y_scale(d.final[1]) + \")\" ) ; })\n                .attr(\"x\", 3)\n                .attr(\"dy\", \".35em\")\n                .attr(\"fill\", function(_, i) { return color_scale(i); })\n                .text(function(d) { return d.name; }) ;\n\n        }) ;\n    }\n\n    chart.width = function(value) {\n        if (!arguments.length) return width;\n        width = value;\n        return chart;\n    };\n\n    chart.height = function(value) {\n        if (!arguments.length) return height;\n        height = value;\n        return chart;\n    };\n\n    chart.xlabel = function(value) {\n        if(!arguments.length) return xlabel ;\n        xlabel = value ;\n        return chart ;\n    } ;\n\n    chart.ylabel = function(value) {\n        if(!arguments.length) return ylabel ;\n        ylabel = value ;\n        return chart ;\n    } ;\n\n    return chart;\n}\n\n</script>"
  },
  {
    "path": "tests/example_pil.py",
    "content": "from PIL import Image\n\n# Open an image\nimg = Image.open(\"corgi.png\")\n\nimg.show()\n\n# Convert to grayscale (mode 'L')\nimg_gray = img.convert('L')\nimg_gray.show()\n\nif True:\n    def first(alpha: int) -> str:\n        beta = str(alpha)\n\n        def third(apple: int) -> int:\n            corn = apple + alpha\n            return corn\n\n        third(5)\n        return beta\n\n\n    def second(gamma: list, alpha: str) -> str:\n        delta = first(int(gamma[0]))\n        if True:\n            alpha = first(int(delta)) + alpha\n        else:\n            banana = 100\n            print(banana)\n        for gamma_item in gamma:\n            epsilon = gamma_item + gamma_item\n        return str(epsilon) + alpha\n\n\n    second([1, 2, 3, 4], \"Hello\")\n    second([\"0\", \"1\", \"2\", \"3\"], \"World\")\nelse:\n    other_side = 100\n    print(other_side)\nfrom pedal import MAIN_REPORT\nfrom pprint import pprint\n\n\n# gently(\"Hello World\" * 110, title=\"A super long title that will try to wrap offscreen; just need it to go a little further!\")\n\ndef print_trace(state, indent=2):\n    yield \" \" * indent + repr(state) + \" -- \" + str(state.name) + \" -- \" + str(state.position)\n    for child in state.trace:\n        for result in print_trace(child, indent + 2):\n            yield result\n\n# tifa = MAIN_REPORT._tool_data['tifa']['instance']\n# for k, v in vars(tifa).items():\n#    print(k, repr(v))\n# print(tifa.path_names)\n\n# for path_id, states in tifa.name_map.items():\n#    for name, state in states.items():\n#        print(path_id, name, repr(state), \"\\n\" + \"\\n\".join(print_trace(state)))\n# console_log(MAIN_REPORT._tool_data['tifa']['instance'])"
  },
  {
    "path": "tests/example_server.py",
    "content": "from flask import Flask\nfrom flask import render_template, request, send_from_directory, jsonify\nfrom pprint import pprint\n\napp = Flask(__name__, template_folder='./')\napp.config['DEBUG'] = True\n\n@app.route('/<path:path>')\ndef send_static(path):\n    return send_from_directory('./', path)\n    \n@app.route('/submit_grade', methods=[\"GET\", \"POST\"])\n@app.route('/submit_grade/', methods=[\"GET\", \"POST\"])\ndef submit_grade():\n    pprint(request.values)\n    return jsonify({\"success\": True, \"message\": \"It uploaded!\"})\n\n\n@app.route('/')\ndef index():\n    return render_template('blockpy_new.html')\n\nif __name__ == \"__main__\":\n    app.run(port=8000)"
  },
  {
    "path": "tests/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <title>BlockPy Example</title>\n\n    <!-- D3 -->\n    <script src=\"../libs/d3/d3.6.3.1.min.js\"></script>\n\n    <!-- FontAwesome 5 -->\n    <link rel=\"stylesheet\" href=\"../libs/fontawesome/all.min.css\">\n\n    <!-- JQuery -->\n    <script src=\"../libs/jquery/jquery-3.4.1.min.js\"></script>\n\n    <!-- JQuery UI -->\n    <script src=\"../libs/jquery/jquery-ui.min.js\"></script>\n\n    <!-- JQuery Multi-select -->\n    <link rel=\"stylesheet\" href=\"../libs/jquery/multi-select.css\">\n    <script src=\"../libs/jquery/jquery.multi-select.js\"></script>\n\n    <!-- Bootstrap -->\n    <link rel=\"stylesheet\" href=\"../libs/bootstrap/bootstrap.min.css\">\n    <script src=\"../libs/bootstrap/popper.min.js\"></script>\n    <script src=\"../libs/bootstrap/bootstrap.min.js\"></script>\n\n    <!-- Knockout -->\n    <script src=\"../libs/knockout/knockout-3.5.0.js\"></script>\n\n    <!-- HighlightJS -->\n    <link rel=\"stylesheet\" href=\"../libs/highlight/default.min.css\">\n    <script src=\"../libs/highlight/highlight.min.js\"></script>\n\n    <!-- EasyMD -->\n    <link rel=\"stylesheet\" href=\"../libs/easymde/easymde.css\">\n    <script src=\"../libs/easymde/easymde.min.js\"></script>\n\n    <!-- Code Mirror -->\n    <link rel=\"stylesheet\" href=\"../libs/codemirror/codemirror.css\">\n    <link rel=\"stylesheet\" href=\"../libs/codemirror/fullscreen.css\">\n    <script src=\"../libs/codemirror/codemirror.js\"></script>\n    <script src=\"../libs/codemirror/diff.js\"></script>\n    <script src=\"../libs/codemirror/django.js\"></script>\n    <script src=\"../libs/codemirror/fullscreen.js\"></script>\n    <script src=\"../libs/codemirror/markdown.js\"></script>\n    <script src=\"../libs/codemirror/python.js\"></script>\n    <script src=\"../libs/codemirror/shell.js\"></script>\n    <script src=\"../libs/codemirror/yaml-frontmatter.js\"></script>\n\n    <!-- Filepond -->\n    <link rel=\"stylesheet\" href=\"../libs/filepond/filepond.min.css\">\n    <link rel=\"stylesheet\" href=\"../libs/filepond/filepond-plugin-image-preview.css\">\n    <link rel=\"stylesheet\" href=\"../libs/filepond/filepond-plugin-file-poster.css\">\n    <script src=\"../libs/filepond/filepond-plugin-image-preview.js\"></script>\n    <script src=\"../libs/filepond/filepond-plugin-file-poster.js\"></script>\n    <script src=\"../libs/filepond/filepond.min.js\"></script>\n    <script>\n        FilePond.registerPlugin(FilePondPluginImagePreview);\n        FilePond.registerPlugin(FilePondPluginFilePoster);\n    </script>\n\n    <!-- Blockly -->\n    <script src=\"../../blockly/blockly_compressed.js\" type=\"text/javascript\"></script>\n    <script src=\"../../blockly/blocks_compressed.js\" type=\"text/javascript\"></script>\n    <script src=\"../../blockly/msg/js/en.js\" type=\"text/javascript\"></script>\n    <script src=\"../../blockly/python_compressed.js\" type=\"text/javascript\"></script>\n\n    <!-- Skulpt -->\n    <script src=\"../../skulpt/dist/skulpt.js\" type=\"text/javascript\"></script>\n    <script src=\"../../skulpt/dist/skulpt-stdlib.js\" type=\"text/javascript\"></script>\n\n    <!-- PygameSkulpt -->\n    <script src=\"../../pygame4skulpt/dist/pygameskulpt.js\" type=\"text/javascript\"></script>\n    \n    <!-- Designer -->\n    <script src=\"../../../gamedev/designer/dist-js/skulpt-designer.js\" type=\"text/javascript\"></script>\n    <script src=\"../../../gamedev/designer/dist-js/skulpt-designer-files.js\" type=\"text/javascript\"></script>\n\n    <!-- Pedal -->\n    <script src=\"../../../pedal-edu/pedal/dist-js/skulpt-pedal.js\" type=\"text/javascript\"></script>\n    <script src=\"../../../pedal-edu/curriculum-ctvt/dist-js/skulpt-curriculum-ctvt.js\" type=\"text/javascript\"></script>\n    <script src=\"../../../pedal-edu/curriculum-sneks/dist-js/skulpt-curriculum-sneks.js\" type=\"text/javascript\"></script>\n\n    <!-- Drafter -->\n    <script src=\"../../../drafter-edu/drafter/dist-js/skulpt-drafter.js\" type=\"text/javascript\"></script>\n\n    <!-- BlockMirror -->\n    <link rel=\"stylesheet\" href=\"../../BlockMirror/dist/block_mirror.css\">\n    <script src=\"../../BlockMirror/dist/block_mirror.js\" type=\"text/javascript\"></script>\n\n    <!-- BlockPy -->\n    <link rel=\"stylesheet\" href=\"../dist/blockpy.css\">\n    <script src=\"../dist/blockpy.js\"></script>\n\n</head>\n<body>\n\n<div style=\"width:900px;  margin:0 auto;\">\n\n<div id=\"main-editor\"></div>\n\n    <!-- Debugging code\nimport turtle\nturtle.bgpic(\"https://i.imgur.com/A8eQsll.jpg\")\nturtle.forward(50)\nturtle.right(90)\nturtle.forward(100)\nturtle.circle(10)\n\n# Image manipulation\nfrom PIL import Image\n\ni = Image()\ni.open(\"http://placecorgi.com/260/180\")\ni.show()\n-->\n\n<script>\n    let LOCAL_FILES = {\n        LOCAL_ON_RUN_CODE: \"\",\n        LOCAL_ON_EVAL_CODE: \"\",\n        LOCAL_ANSWER_CODE: \"\",\n        //LOCAL_INSTRUCTOR_EXTRA_FILES: \"\"\n    }\n    try {\n        if (localStorage) {\n            for (let key in LOCAL_FILES) {\n                let LOCAL = localStorage.getItem(key);\n                if (LOCAL) {\n                    LOCAL_FILES[key] = LOCAL;\n                }\n            }\n        }\n    } catch (e) {\n        console.error(e);\n    }\n\n    $(document).ready(function() {\n        editor = new blockpy.BlockPy({\n            'attachment.point': '#main-editor',\n            \"urls\": {\n                \"importDatasets\": \"https://corgis-edu.github.io/corgis/datasets/\",\n                \"openai_proxy\": \"https://localhost:5000/blockpy/openai\",\n                \"instructionsAssignmentSetup\": \"https://localhost:5000\",\n                \"listUploadedFiles\": \"https://localhost:5000/blockpy/list_files\",\n                \"uploadFile\": \"https://localhost:5000/blockpy/upload_file\",\n                \"downloadFile\": \"https://localhost:5000/blockpy/download_file\",\n                \"shareUrl\": \"https://localhost:5000/blockpy/share\",\n            },\n            \"display.instructor\": true,\n            //\"assignment.on_eval\": \"console_log(ABC)\",\n            \"assignment.on_run\": LOCAL_FILES.LOCAL_ON_RUN_CODE,\n            //\"assignment.on_eval\": LOCAL_FILES.LOCAL_ON_EVAL_CODE,\n            \"submission.code\": LOCAL_FILES.LOCAL_ANSWER_CODE,\n            \"assignment.extra_instructor_files\": LOCAL_FILES.LOCAL_INSTRUCTOR_EXTRA_FILES,\n            // Pygame tests\n            \"display.python.mode\": \"text\",\n            //\"assignment.settings.disable_timeout\": true,\n            //\"assignment.settings.disable_instructor_run\": \"true\"\n            //\"assignment.settings.small_layout\": \"true\",\n            //\"assignment.settings.hide_files\": \"false\"\n        });\n/*\nfrom image import Image\ndog = Image(\"http://localhost:8000/images/swimming.gif\")\ndog.flip().show()\n */\n        blockmirror = editor.components.editors.registered_[1].bm;\n\n        // TODO: HACK, need to make this cleaner\n        Sk.emojiProxy = (part) => `https://twemoji.maxcdn.com/v/13.1.0/svg/${part.toLowerCase()}.svg`;\n\n        updateClient();\n    });\n\n    function saveNewClient() {\n        LOCAL_FILES.LOCAL_ANSWER_CODE = editor.model.submission.code();\n        LOCAL_FILES.LOCAL_ON_RUN_CODE = editor.model.assignment.onRun();\n        LOCAL_FILES.LOCAL_ON_EVAL_CODE = editor.model.assignment.onEval();\n        LOCAL_FILES.LOCAL_INSTRUCTOR_EXTRA_FILES = JSON.stringify(Object.fromEntries(editor.model.assignment.extraInstructorFiles().map(file => {\n            return [file.filename(), file.contents()];\n        })));\n        localStorage.setItem(\"LOCAL_ANSWER_CODE\", LOCAL_FILES.LOCAL_ANSWER_CODE);\n        localStorage.setItem(\"LOCAL_ON_RUN_CODE\", LOCAL_FILES.LOCAL_ON_RUN_CODE);\n        localStorage.setItem(\"LOCAL_ON_EVAL_CODE\", LOCAL_FILES.LOCAL_ON_EVAL_CODE);\n        localStorage.setItem(\"LOCAL_INSTRUCTOR_EXTRA_FILES\", LOCAL_FILES.LOCAL_INSTRUCTOR_EXTRA_FILES);\n        updateClient();\n    }\n\n    function updateClient() {\n        $(\"#old-answer-code\").text(LOCAL_FILES.LOCAL_ANSWER_CODE);\n        $(\"#old-on-run-code\").text(LOCAL_FILES.LOCAL_ON_RUN_CODE);\n        $(\"#old-on-eval-code\").text(LOCAL_FILES.LOCAL_ON_EVAL_CODE);\n        $(\"#old-extra-instructor-files\").text(LOCAL_FILES.LOCAL_INSTRUCTOR_EXTRA_FILES);\n    }\n\n    function deleteOldClient() {\n        localStorage.removeItem(\"LOCAL_ANSWER_CODE\");\n        localStorage.removeItem(\"LOCAL_ON_RUN_CODE\");\n        localStorage.removeItem(\"LOCAL_ON_EVAL_CODE\");\n        localStorage.removeItem(\"LOCAL_INSTRUCTOR_EXTRA_FILES\");\n        LOCAL_FILES.LOCAL_ANSWER_CODE = \"\";\n        LOCAL_FILES.LOCAL_ON_RUN_CODE = \"\";\n        LOCAL_FILES.LOCAL_ON_EVAL_CODE = \"\";\n        LOCAL_FILES.LOCAL_INSTRUCTOR_EXTRA_FILES = \"\";\n        updateClient();\n    }\n</script>\n\n    <button onclick=\"deleteOldClient()\">Reset old client</button>\n    <button onclick=\"saveNewClient()\">Save code now</button>\n    <table>\n        <tr>\n            <td><pre id=\"old-answer-code\"></pre></td>\n            <td><pre id=\"old-on-run-code\"></pre></td>\n            <td><pre id=\"old-on-eval-code\"></pre></td>\n            <td><pre id=\"old-extra-instructor-files\"></pre></td>\n        </tr>\n    </table>\n\n\n</div>\n\n</body>\n</html>"
  },
  {
    "path": "tests/index_v4.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>Blockpy</title>\n\n    <!-- Dependencies -->\n\n    <!-- Core -->\n    \n    <link rel=\"stylesheet\" href=\"../libs/bootstrap.min.css\">\n    <link rel=\"stylesheet\" href=\"../libs/codemirror/codemirror.css\">\n    <link rel=\"stylesheet\" href=\"../libs/font-awesome.min.css\">\n    <link rel=\"stylesheet\" href=\"../libs/summernote/summernote.css\">\n    <link rel=\"stylesheet\" href=\"../libs/multi-select.css\">\n    <link rel=\"stylesheet\" href=\"../src/css/blockpy.css\">\n    <!--<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css\">-->\n    \n    <!-- JQuery, D3, Math.js, Bootstrap -->\n    <script type=\"text/javascript\" src=\"../libs/jquery/jquery.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/jquery/jquery-ui.min.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/jquery/jquery.hotkeys.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/jquery/jquery.multi-select.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/d3.min.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/math.0.19.0.min.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/bootstrap.min.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/bootstrap-wysiwyg.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/mindmup-editabletable.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/codemirror/codemirror.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/codemirror/python.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/codemirror/htmlmixed.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/codemirror/xml.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/knockout-3.4.0.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/stringify.js\"></script>\n    \n    <!-- Summernote, a rich text editor -->\n    <script type=\"text/javascript\" src=\"../libs/summernote/summernote.min.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/summernote/summernote-ext-hint.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/summernote/summernote-ext-video.js\"></script>\n    \n    <!-- Blockly -->\n    <script type=\"text/javascript\" src=\"../../blockly/blockly_uncompressed.js\"></script>\n    <script type=\"text/javascript\" src=\"../../blockly/blocks_compressed.js\"></script>\n    <script type=\"text/javascript\" src=\"../../blockly/python_compressed.js\"></script>\n    <script type=\"text/javascript\" src=\"../blockly/pseudo_compressed.js\"></script>\n    <script type=\"text/javascript\" src=\"../../blockly/javascript_compressed.js\"></script>\n    <script type=\"text/javascript\" src=\"../../blockly/msg/js/en.js\"></script>\n    \n    <!-- Skulpt -->\n    <script type=\"text/javascript\" src=\"../skulpt/dist/skulpt.min.js\"></script>\n    <script type=\"text/javascript\" src=\"../../skulpt/dist/skulpt-stdlib.js\"></script>\n    \n    <!-- Source Code -->\n    <script type=\"text/javascript\" src=\"../src/utilities.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/python_errors.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/ast_node_visitor.js\"></script>\n    <!--<script type=\"text/javascript\" src=\"src/abstract_interpreter.js\"></script>\n    <script type=\"text/javascript\" src=\"src/pytifa.js\"></script>\n    <script type=\"text/javascript\" src=\"src/abstract_interpreter_definitions.js\"></script>\n    <script type=\"text/javascript\" src=\"src/abstract_interpreter_tests.js\"></script>-->\n    <script type=\"text/javascript\" src=\"../src/python_to_blockly.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/imported.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/class.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/comment.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/comprehensions.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/dict.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/if.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/io.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/lists.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/sets.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/loops.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/parking.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/tuple.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/turtles.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/text.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/plots.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/dialog.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/storage.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/printer.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/interface.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/server.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/english.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/corgis.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/history.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/presentation.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/editor.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/feedback.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/toolbar.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/sk_mod_instructor_extended.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/skulpt_modules/sk_mod_instructor.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/engine.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/main_v4.js\"></script>\n    \n    <!-- CORGIS -->\n    <!--<script type=\"text/javascript\" src=\"test_corgis/blockpy/school_scores/school_scores_dataset.js\"></script>\n    <script type=\"text/javascript\" src=\"test_corgis/blockpy/school_scores/school_scores_blockly.js\"></script>\n    <script type=\"text/javascript\" src=\"test_corgis/blockpy/school_scores/school_scores_skulpt.js\"></script>-->\n    \n    <!--<script type=\"text/javascript\" src=\"test_corgis/blockpy/tate/tate_blockly.js\"></script>\n    <script type=\"text/javascript\" src=\"test_corgis/blockpy/tate/tate_skulpt.js\"></script>\n    <script type=\"text/javascript\" src=\"test_corgis/blockpy/tate/tate_dataset.js\"></script>-->\n    \n    <!--<script type=\"text/javascript\" src=\"test_corgis/blockpy/broadway/broadway_blockly.js\"></script>\n    <script type=\"text/javascript\" src=\"test_corgis/blockpy/broadway/broadway_skulpt.js\"></script>\n    <script type=\"text/javascript\" src=\"test_corgis/blockpy/broadway/broadway_dataset.js\"></script>-->\n    \n    <!--<script type=\"text/javascript\" src=\"test_corgis/blockpy/tate/publishers_blockly.js\"></script>\n    <script type=\"text/javascript\" src=\"test_corgis/blockpy/tate/publishers_skulpt.js\"></script>\n    <script type=\"text/javascript\" src=\"test_corgis/blockpy/tate/publishers_dataset.js\"></script>-->\n    \n    <!--<script type=\"text/javascript\" src=\"test_corgis/blockpy/weather/weather_blockly.js\"></script>\n    <script type=\"text/javascript\" src=\"test_corgis/blockpy/weather/weather_skulpt.js\"></script>\n    <script type=\"text/javascript\" src=\"test_corgis/blockpy/weather/weather_dataset.js\"></script>-->\n    \n    <style>\n\n    </style>\n    \n    <script>\n    $(document).ready(function() {\n        blockpy = new BlockPy({\n            'blocklyPath': \"../blockly/\",\n            'attachmentPoint': document.getElementById('blockpy-div'),\n            'instructor': !getQueryParams()[\"instructor\"] || getQueryParams()[\"instructor\"]==\"true\",\n            'developer': true,\n            'editor': getQueryParams()[\"mode\"] || 'Split',\n            'urls': {\n                'import_datasets': '../datasets/datasets/',\n                //'walk_old_code': 'http://localhost:8000/walk_code/',\n                //'log_event': 'http://localhost:8000/save_events/'\n                /*'save_code': 'http://localhost:8000/save_code/',\n                'save_success': 'http://localhost:8000/submit_grade/',\n                'log_event': 'http://localhost:8000/save_events/'*/\n            }\n        });\n        blockpy.setAssignment(\n            // settings\n            {\n                'editor': getQueryParams()[\"mode\"] || 'Split',\n                'read_only': getQueryParams()[\"upload\"]==\"true\",\n                'disable_semantic_errors': false,\n                'disable_timeout': true,\n                'presentation_mode': getQueryParams()[\"presentation\"]==\"true\",\n            },\n            // assignment\n            {\n                'introduction': \"Use the canvas below to calculate the sum of a list of 4 numbers.\",\n                'name': \"#1.3\",\n                'give_feedback': $(\"#testing-give-feedback\").text(),\n                //'give_feedback': \"\",\n                //'give_feedback': 'run_student()\\nexplain(\"Hey, Listen!\")',\n                //'give_feedback': 'import utility\\nfrom pedal.cait.cait_api import parse_program, find_match, data_type\\nparse_program()\\nmatch = find_match(\"fun = __expr__\")\\nutility.log(data_type(\"fun\"))\\nutility.log(match)\\ngently(\"Hello\")',\n                //'give_feedback': 'from instructor_functions import *\\nsuppress(\"analyzer\", \"Incompatible types\")\\nmatch_signature(\"curve_grade\", 1, \"old\")\\n#unit_test(\"curve_grade\", (64, True), (0, 0), (100, 100))\\noutput_test(\"curve_grade\", (1, \"1\"), (2, \"2\"))',\n                //'give_feedback': 'from instructor_functions import *\\n5+\"\"\\nsuppress(\"analyzer\", \"Incompatible types\")\\nmatch_signature(\"rate_animal\", 1, \"old\")\\nunit_test(\"rate_animal\", (64, True))',\n                //'give_feedback': \"log(parse_program().find_all('FunctionDef')[0].args.args[0].arg)\",\n                //'give_feedback': 'set_success()',\n                //'give_feedback': 'from instructor_utility import *\\nfrom instructor_printing import *\\n\\nsuppress(\"analyzer\")\\nsuppress(\"instructor\")\\nhide_correctness()\\n\\nast = parse_program()\\n\\nall_checked = True\\nanswers = [(\"1*2*3\", \"6\"), (\"3*4\",\"12\"), (\"0\",\"0\"), (\"5*-5\", \"-25\")]\\nfor an_input, result in answers:\\n    reset_output()\\n    queue_input(an_input)\\n    run_student()\\n    if not get_output():\\n        all_checked = False\\n    elif result not in get_output():\\n        if str(float(result)) in get_output():\\n            give_partial(.1/len(answers), \"Checking Float \"+an_input)\\n        all_checked = False\\n    else:\\n        give_partial(.2/len(answers), \"Checking \"+an_input)',\n                //'give_feedback': \"from instructor_utility import *\\nensure_operation('in')\",\n                //'give_feedback': 'for x in range(2):\\n    reset_output()\\n    queue_input(\"Test\", \"\")\\n    e = run_student()\\n    if e:\\n        gently(str(e))\\n    log(get_output())\\nif not e:\\n    set_success()',\n                //'give_feedback': \"from instructor_files import *\\nfiles_not_handled_correctly('example.txt')\",\n                //'give_feedback': \"from instructor_imports import *\\nensure_imports('math', 'random')\",\n                //'give_feedback': \"from instructor_plotting import * \\nprevent_incorrect_plt() \\nensure_correct_plot('plot') \\nensure_show() \\ncheck_for_plot('line', [[1,2,3],[4,5,6]])\",\n                //'give_feedback': 'ast = parse_program()\\nassignments = ast.find_all(\"Assign\")\\nfor assignment in assignments:\\n    if assignment.targets.id == \"parking_allowed\":\\n        log(assignment.targets.data_type)',\n                'on_change': '',\n                //'on_change': 'gently(\"Test\")',\n                'parsons': false,\n                'starting_code': '',\n                'importable': true,\n                'initial_view': getQueryParams()[\"mode\"] || 'Split',\n                'upload': getQueryParams()[\"upload\"]==\"true\",\n                'modules': {\n                    'added': ['Functions', 'Classes', 'Data - Parking', 'Tuples', 'Conversion'],\n                    // , 'Data - Publishers'\n                    'removed': []\n                }\n            },\n            // programs\n            {\n                '__main__': $(\"#testing-student-code\").text(),\n                //'__main__': 'import json\\njson.loads(\"0\") + \"1\"',\n                //'__main__': 'import random\\nprint(random.random())\\nss = [\"Testing\", \"Here\"]\\nfor a in ss:\\n    print(a)\\nfor b in a:\\n    print(b)',\n                //'__main__': 'print(\"Hello world\"[1:5])',\n                //'__main__':  decodeURIComponent(getQueryParams()[\"code\"]) || 'a = 0\\nprint(a)',\n                //'__main__': 'num = input(\"\")\\nnum_list = [int(n) for n in num.split(\"*\")]\\nfor n in num_list:\\n    n*n\\n    return 4\\nprint(n)',\n                //'__main__': 'def rate_animal(an_animal):\\n    if an_animal != \"dog\":\\n        1 + \"\"\\nrate_animal(\"dog\")',\n                //'__main__': 'round(float(\"9.5\", ___))',\n                //'__main__': getQueryParams()[\"code\"] || \"import matplotlib.pyplot as plt\\nplt.plot([1, 2, 3],[4, 5, 6])\\nplt.show()\",\n                //'__main__': 'i=0\\nwhile i!=\"0\":\\n    i=input(\"\")\\n    print(i)',\n                //'__main__': \"import requests\\nprint(requests.get('https://pastebin.com/raw/V7tWn1Rj').text)\"\n                //'__main__': \"print(open('example.txt').read())\"\n                //'__main__': \"import math\\nmath\\nfrom random import choice\\nchoice\"\n                //'__main__': \"from random import randint\\nprint(5+randint(1,10))\"\n                //'__main__': 'print(input(\"Prompt:\"))',\n                //'__main__': 'import parking\\nparking_allowed = parking.now()\\nif parking.now() > parking.Time(8,30,\"AM\") and parking.now() < parking.Time(5,30,\"PM\"):\\n    parking_allowed = False\\nelse:\\n    parking_allowed = True \\nprint(parking_allowed)'\n                //'__main__': 'print(\"Banana\"[:int(len(\"Banana\")/2)])',\n                //'__main__': 'def curve_grade(old):\\n    print(old)\\n    return (old ** .3) * 10\\n\\nprint(90, \"becomes\", curve_grade(90))\\nprint(50, \"becomes\", curve_grade(50))\\nprint(20, \"becomes\", curve_grade(20))'\n                //'__main__': 't=(100*\"A\")*8671',\n                //'__main__': 'print(1 != 2 and 2 != 1)'\n            }\n        )\n        \n        function inIframe () {\n            try {\n                return window.self !== window.top;\n            } catch (e) {\n                return true;\n            }\n        }\n        if (inIframe()) {\n            $(\"#blockpy-container\").width(\"100%\");\n        }\n    });\n    </script>\n  \n</head>\n<body>\n<div style=\"width:900px;  margin:0 auto;\" id='blockpy-container'> <!-- 900px -->\n    <div id=\"blockpy-div\" style='height:100%'></div>\n</div>\n<div id=\"blockpy-div2\" style='height:100%'></div>\n<script>\n\nfunction getQueryParams(){\n    try{\n        url = window.location.href;\n        query_str = url.substr(url.indexOf('?')+1, url.length-1);\n        r_params = query_str.split('&');\n        params = {}\n        for( i in r_params){\n            param = r_params[i].split('=');\n            params[ param[0] ] = param[1];\n        }\n        return params;\n    }\n    catch(e){\n       return {};\n    }\n}\n</script>\n\n<div style='display:none' id='testing-student-code'>\nimport matplotlib.pyplot as plt\n\nplt.plot([1,2,3])\nplt.show()\n</div>\n\n<div style='display:none' id='testing-give-feedback'>\nlog(get_output())\nreset_output()\nrun_student()\nlog(get_output())\n</div>\n\n  \n<!-- Google Analytics -->\n<script>\nswitch(window.location.protocol) {\ncase 'file:':\n    break;\ndefault:\n    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n    ga('create', 'UA-38802329-2', 'auto');\n    ga('send', 'pageview');\n    }\n</script>\n\n</body>\n</html>\n"
  },
  {
    "path": "tests/jsplotlib_test.html",
    "content": "<html>\n<head>\n<style>\n\nbody {\n  font: 10px sans-serif;\n}\n\n</style>\n</head>\n<body>\n<script src=\"libs/d3.min.js\"></script>\n<script type=\"text/javascript\" src=\"libs/math.0.19.0.min.js\"></script>\n<script src=\"libs/jquery.js\"></script>\n\n<script type=\"text/javascript\" src=\"skulpt/dist/skulpt.min.js\"></script>\n<script type=\"text/javascript\" src=\"skulpt/dist/skulpt-stdlib.js\"></script>\n<script type=\"text/javascript\">\n        function outf(text)\n        {\n            var output = document.getElementById(\"html-output\");\n            text = text.replace(/</g, '&lt;');\n            output.innerHTML = output.innerHTML + text;\n        }\n        \n        function builtinRead(x) {\n            if (Sk.builtinFiles === undefined || Sk.builtinFiles[\"files\"][x] === undefined)\n                throw \"File not found: '\" + x + \"'\";\n            return Sk.builtinFiles[\"files\"][x];\n        }\n        \n        function runit() {\n            runProgram($(\"#python-output\").text());\n        }\n\n        function runProgram(prog)\n        {\n            var output = document.getElementById(\"html-output\");\n            output.innerHTML = '';\n            Sk.configure({output:outf, read: builtinRead});\n            Sk.canvas = \"mycanvas\";\n            try {\n                module = Sk.importMainWithBody(\"<stdin>\", false, prog);\n                //var obj = module.tp$getattr('a');\n                //var runMethod = obj.tp$getattr('run');\n                //var ret = Sk.misceval.callsim(runMethod, 10);\n            } catch (e) {\n                $(\"#error-output\").text(e);\n            }\n            \n        }\n        \n        $(document).ready(function() {\n            runit();\n        });\n        \n        \n    </script>\n    \n    <pre id=\"python-output\">\nimport matplotlib.pyplot as pp\nimport numpy as np\npp.plot([0,1,20, 30, 40, 50])\npp.show()</pre>\n    <button onclick=\"runit()\" type=\"button\">Run</button>\n    <pre id=\"html-output\"></pre>\n    <pre id=\"error-output\"></pre>\n    <svg id=\"mycanvas\"  height=\"400\" width=\"400\" style=\"border:1px solid #000000;\">\n    </svg>\n</body>\n</html>"
  },
  {
    "path": "tests/multiple.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <title>BlockPy Example</title>\n\n    <!-- D3 -->\n    <script src=\"../libs/d3/d3.6.3.1.min.js\"></script>\n\n    <!-- FontAwesome 5 -->\n    <link rel=\"stylesheet\" href=\"../libs/fontawesome/all.min.css\">\n\n    <!-- JQuery -->\n    <script src=\"../libs/jquery/jquery-3.4.1.min.js\"></script>\n\n    <!-- JQuery UI -->\n    <script src=\"../libs/jquery/jquery-ui.min.js\"></script>\n\n    <!-- JQuery Multi-select -->\n    <link rel=\"stylesheet\" href=\"../libs/jquery/multi-select.css\">\n    <script src=\"../libs/jquery/jquery.multi-select.js\"></script>\n\n    <!-- Bootstrap -->\n    <link rel=\"stylesheet\" href=\"../libs/bootstrap/bootstrap.min.css\">\n    <script src=\"../libs/bootstrap/popper.min.js\"></script>\n    <script src=\"../libs/bootstrap/bootstrap.min.js\"></script>\n\n    <!-- Knockout -->\n    <script src=\"../libs/knockout/knockout-3.5.0.js\"></script>\n\n    <!-- HighlightJS -->\n    <link rel=\"stylesheet\" href=\"../libs/highlight/default.min.css\">\n    <script src=\"../libs/highlight/highlight.min.js\"></script>\n\n    <!-- EasyMD -->\n    <link rel=\"stylesheet\" href=\"../libs/easymde/easymde.css\">\n    <script src=\"../libs/easymde/easymde.min.js\"></script>\n\n    <!-- Code Mirror -->\n    <link rel=\"stylesheet\" href=\"../libs/codemirror/codemirror.css\">\n    <link rel=\"stylesheet\" href=\"../libs/codemirror/fullscreen.css\">\n    <script src=\"../libs/codemirror/codemirror.js\"></script>\n    <script src=\"../libs/codemirror/diff.js\"></script>\n    <script src=\"../libs/codemirror/django.js\"></script>\n    <script src=\"../libs/codemirror/fullscreen.js\"></script>\n    <script src=\"../libs/codemirror/markdown.js\"></script>\n    <script src=\"../libs/codemirror/python.js\"></script>\n    <script src=\"../libs/codemirror/shell.js\"></script>\n    <script src=\"../libs/codemirror/yaml-frontmatter.js\"></script>\n\n    <!-- Blockly -->\n    <script src=\"../../blockly/blockly_compressed.js\" type=\"text/javascript\"></script>\n    <script src=\"../../blockly/blocks_compressed.js\" type=\"text/javascript\"></script>\n    <script src=\"../../blockly/msg/js/en.js\" type=\"text/javascript\"></script>\n    <script src=\"../../blockly/python_compressed.js\" type=\"text/javascript\"></script>\n\n    <!-- Skulpt -->\n    <script src=\"../../skulpt/dist/skulpt.js\" type=\"text/javascript\"></script>\n    <script src=\"../../skulpt/dist/skulpt-stdlib.js\" type=\"text/javascript\"></script>\n\n    <!-- PygameSkulpt -->\n    <script src=\"../../pygame4skulpt/dist/pygameskulpt.js\" type=\"text/javascript\"></script>\n    \n    <!-- Designer -->\n    <script src=\"../../../gamedev/designer/dist-js/skulpt-designer.js\" type=\"text/javascript\"></script>\n    <script src=\"../../../gamedev/designer/dist-js/skulpt-designer-files.js\" type=\"text/javascript\"></script>\n\n    <!-- Pedal -->\n    <script src=\"../../../pedal-edu/pedal/dist-js/skulpt-pedal.js\" type=\"text/javascript\"></script>\n    <script src=\"../../../pedal-edu/curriculum-ctvt/dist-js/skulpt-curriculum-ctvt.js\" type=\"text/javascript\"></script>\n    <script src=\"../../../pedal-edu/curriculum-sneks/dist-js/skulpt-curriculum-sneks.js\" type=\"text/javascript\"></script>\n\n    <!-- BlockMirror -->\n    <link rel=\"stylesheet\" href=\"../../BlockMirror/dist/block_mirror.css\">\n    <script src=\"../../BlockMirror/dist/block_mirror.js\" type=\"text/javascript\"></script>\n\n    <!-- BlockPy -->\n    <link rel=\"stylesheet\" href=\"../dist/blockpy.css\">\n    <script src=\"../dist/blockpy.js\"></script>\n\n</head>\n<body>\n\n<div style=\"width:900px;  margin:0 auto;\">\n\n<div id=\"first-editor\"></div>\n    <hr style=\"margin-top: 20px; margin-bottom: 20px\">\n<div id=\"second-editor\"></div>\n    <hr style=\"margin-top: 20px; margin-bottom: 20px\">\n<div id=\"third-editor\"></div>\n    <!-- Debugging code\nimport turtle\nturtle.bgpic(\"https://i.imgur.com/A8eQsll.jpg\")\nturtle.forward(50)\nturtle.right(90)\nturtle.forward(100)\nturtle.circle(10)\n\n# Image manipulation\nfrom PIL import Image\n\ni = Image()\ni.open(\"http://placecorgi.com/260/180\")\ni.show()\n-->\n\n<script>\n    let LOCAL_FILES = {\n        LOCAL_ON_RUN_CODE: \"\",\n        LOCAL_ON_EVAL_CODE: \"\",\n        LOCAL_ANSWER_CODE: \"\",\n        //LOCAL_INSTRUCTOR_EXTRA_FILES: \"\"\n    }\n    try {\n        if (localStorage) {\n            for (let key in LOCAL_FILES) {\n                let LOCAL = localStorage.getItem(key);\n                if (LOCAL) {\n                    LOCAL_FILES[key] = LOCAL;\n                }\n            }\n        }\n    } catch (e) {\n        console.error(e);\n    }\n\n    $(document).ready(function() {\n        editors = [\"#first-editor\", \"#second-editor\", \"#third-editor\"].map((id) => (\n            new blockpy.BlockPy({\n                'attachment.point': id,\n                'partId': id,\n                \"urls\": {\n                    \"importDatasets\": \"https://corgis-edu.github.io/corgis/datasets/\",\n                    \"instructionsAssignmentSetup\": \"https://localhost:5000\"\n                },\n                \"display.instructor\": false,\n                //\"assignment.on_eval\": \"console_log(ABC)\",\n                \"assignment.on_run\": LOCAL_FILES.LOCAL_ON_RUN_CODE,\n                //\"assignment.on_eval\": LOCAL_FILES.LOCAL_ON_EVAL_CODE,\n                \"submission.code\": LOCAL_FILES.LOCAL_ANSWER_CODE,\n                \"assignment.extra_instructor_files\": LOCAL_FILES.LOCAL_INSTRUCTOR_EXTRA_FILES,\n                // Pygame tests\n                \"display.python.mode\": \"text\",\n                //\"assignment.settings.disable_timeout\": true,\n                //\"assignment.settings.disable_instructor_run\": \"true\"\n                \"assignment.settings.small_layout\": \"true\"\n            })\n        ));\n/*\nfrom image import Image\ndog = Image(\"http://localhost:8000/images/swimming.gif\")\ndog.flip().show()\n */\n        blockmirrors = editors.map(editor => editor.components.editors.registered_[1].bm);\n\n        // TODO: HACK, need to make this cleaner\n        Sk.emojiProxy = (part) => `https://twemoji.maxcdn.com/v/13.1.0/svg/${part.toLowerCase()}.svg`;\n\n        updateClient();\n    });\n\n    function saveNewClient() {\n        LOCAL_FILES.LOCAL_ANSWER_CODE = editors[0].model.submission.code();\n        LOCAL_FILES.LOCAL_ON_RUN_CODE = editors[0].model.assignment.onRun();\n        LOCAL_FILES.LOCAL_ON_EVAL_CODE = editors[0].model.assignment.onEval();\n        LOCAL_FILES.LOCAL_INSTRUCTOR_EXTRA_FILES = JSON.stringify(Object.fromEntries(editors[0].model.assignment.extraInstructorFiles().map(file => {\n            return [file.filename(), file.contents()];\n        })));\n        localStorage.setItem(\"LOCAL_ANSWER_CODE\", LOCAL_FILES.LOCAL_ANSWER_CODE);\n        localStorage.setItem(\"LOCAL_ON_RUN_CODE\", LOCAL_FILES.LOCAL_ON_RUN_CODE);\n        localStorage.setItem(\"LOCAL_ON_EVAL_CODE\", LOCAL_FILES.LOCAL_ON_EVAL_CODE);\n        localStorage.setItem(\"LOCAL_INSTRUCTOR_EXTRA_FILES\", LOCAL_FILES.LOCAL_INSTRUCTOR_EXTRA_FILES);\n        updateClient();\n    }\n\n    function updateClient() {\n        $(\"#old-answer-code\").text(LOCAL_FILES.LOCAL_ANSWER_CODE);\n        $(\"#old-on-run-code\").text(LOCAL_FILES.LOCAL_ON_RUN_CODE);\n        $(\"#old-on-eval-code\").text(LOCAL_FILES.LOCAL_ON_EVAL_CODE);\n        $(\"#old-extra-instructor-files\").text(LOCAL_FILES.LOCAL_INSTRUCTOR_EXTRA_FILES);\n    }\n\n    function deleteOldClient() {\n        localStorage.removeItem(\"LOCAL_ANSWER_CODE\");\n        localStorage.removeItem(\"LOCAL_ON_RUN_CODE\");\n        localStorage.removeItem(\"LOCAL_ON_EVAL_CODE\");\n        localStorage.removeItem(\"LOCAL_INSTRUCTOR_EXTRA_FILES\");\n        LOCAL_FILES.LOCAL_ANSWER_CODE = \"\";\n        LOCAL_FILES.LOCAL_ON_RUN_CODE = \"\";\n        LOCAL_FILES.LOCAL_ON_EVAL_CODE = \"\";\n        LOCAL_FILES.LOCAL_INSTRUCTOR_EXTRA_FILES = \"\";\n        updateClient();\n    }\n</script>\n\n    <button onclick=\"deleteOldClient()\">Reset old client</button>\n    <button onclick=\"saveNewClient()\">Save code now</button>\n    <table>\n        <tr>\n            <td><pre id=\"old-answer-code\"></pre></td>\n            <td><pre id=\"old-on-run-code\"></pre></td>\n            <td><pre id=\"old-on-eval-code\"></pre></td>\n            <td><pre id=\"old-extra-instructor-files\"></pre></td>\n        </tr>\n    </table>\n\n\n</div>\n\n</body>\n</html>"
  },
  {
    "path": "tests/python_files/assignment.py",
    "content": "import weather\n\n___ = 5\n\nweather.get_temperature(\"Miami, FL\")\n\n32\n\nprint(___)\n\nfahrenheit = ___\n\nprint(___)\n\n___ - ___\n\ncelsius = ___\n\nfahrenheit\n\n1.8\n\n___ / ___\n\nfahrenheit\n\ncelsius\n"
  },
  {
    "path": "tests/python_files/dummy.py",
    "content": "import weather\n\n\nu = weather.get_all()['test']\n\nfor assignment in []:\n    print(\"Hello\")\n\nplt.plot([])"
  },
  {
    "path": "tests/python_files/example.py",
    "content": "a  5 + \"hello\""
  },
  {
    "path": "tests/python_files/grader.py",
    "content": "import weather\n\n\ndef on_run(code, output, properties):\n    f = weather.get_temperature(\"Miami, FL\")\n    c = (f - 32) / 1.8\n    if not output:\n        return \"You have to print the temperature in Farenheit and Celsius.\"\n    elif \"weather.get_temperature(\\\"Miami, FL\\\")\" not in code:\n        return \"You need to request Miami's current temperature.\"\n    elif \"celsius = (fahrenheit - 32) / 1.8\" not in code:\n        return \"You are not converting the temperature to celsius using the right formula.\"\n    elif (str(f)+\"\\n\" in output) or (str(c)+\"\\n\" in output):\n        return True\n    else:\n        return \"You must print Miami's temperature in both scales.\"\n"
  },
  {
    "path": "tests/python_files/invalid.py",
    "content": "for x in 1:\n    pass"
  },
  {
    "path": "tests/python_files/simple.py",
    "content": "a = 0\nprint(a)"
  },
  {
    "path": "tests/python_files/triple_quotes.py",
    "content": "\"\"\"\nCreated on Tue Apr  5 09:40:10 2016\n\nThis code creates a line graph that compares the violent crime rates\nin Washington and Texas from 1960 to 2012, and also a map that shows\nthe number of violent crimes per state in 2012.\n\n@author: Shane Aubain\n         Ryan Buzzard\n         Cassidy Deerin\n         Tara King\n         Valarie McLean\n         Aaron Quartes III\n\"\"\"\n\n\"\"\"\nLine graph of Washington crime rates and Texas crime rates over time\n\"\"\"\nimport crime\nimport matplotlib.pyplot as plt\nfrom matplotlib.legend_handler import HandlerLine2D\n\nallCrime = crime.get_all()\n\ntexasCrime = allCrime[\"texas\"]\nwashCrime = allCrime[\"washington\"]\n\nyearList = []\ntexCrimeList = []\nwashCrimeList = []\n\nfor data in texasCrime[\"data\"]:\n    yearList.append(data[\"year\"])\n    texCrimeList.append(data[\"rates\"][\"violent\"][\"all\"])\n    \nfor data in washCrime[\"data\"]:\n    washCrimeList.append(data[\"rates\"][\"violent\"][\"all\"])\n    \nline1, = plt.plot(yearList, texCrimeList, label=\"Texas crime\")\nline2, = plt.plot(yearList, washCrimeList, label=\"Washington crime\")\nplt.title(\"Texas and Washington crime rates over time\")\nplt.xlabel(\"year\")\nplt.ylabel(\"crime rate\")\nplt.legend(handler_map={line1:HandlerLine2D(numpoints=4)}, loc=4)\nplt.show()\n\n\"\"\"\nNumber of violent crimes per state in 2012\n\"\"\"\nimport US_Map\n\ncrimesPerState = [\n  {'name': 'New Jersey',     'data': allCrime[\"new jersey\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Rhode Island',   'data': allCrime[\"rhode island\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Massachusetts',  'data': allCrime[\"massachusetts\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Connecticut',    'data': allCrime[\"connecticut\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Maryland',       'data': allCrime[\"maryland\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'New York',       'data': allCrime[\"new york\"][\"data\"][47][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Delaware',       'data': allCrime[\"delaware\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Florida',        'data': allCrime[\"florida\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Ohio',           'data': allCrime[\"ohio\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Pennsylvania',   'data': allCrime[\"pennsylvania\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Illinois',       'data': allCrime[\"illinois\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'California',     'data': allCrime[\"california\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Hawaii',         'data': allCrime[\"hawaii\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Virginia',       'data': allCrime[\"virginia\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Michigan',       'data': allCrime[\"michigan\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Indiana',        'data': allCrime[\"indiana\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'North Carolina', 'data': allCrime[\"north carolina\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Georgia',        'data': allCrime[\"georgia\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Tennessee',      'data': allCrime[\"tennessee\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'New Hampshire',  'data': allCrime[\"new hampshire\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'South Carolina', 'data': allCrime[\"south carolina\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Louisiana',      'data': allCrime[\"louisiana\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Kentucky',       'data': allCrime[\"kentucky\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Wisconsin',      'data': allCrime[\"wisconsin\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Washington',     'data': allCrime[\"washington\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Alabama',        'data': allCrime[\"alabama\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Missouri',       'data': allCrime[\"missouri\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Texas',          'data': allCrime[\"texas\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'West Virginia',  'data': allCrime[\"west virginia\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Vermont',        'data': allCrime[\"vermont\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Minnesota',      'data': allCrime[\"minnesota\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Mississippi',    'data': allCrime[\"mississippi\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Iowa',           'data': allCrime[\"iowa\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Arkansas',       'data': allCrime[\"arkansas\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Oklahoma',       'data': allCrime[\"oklahoma\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Arizona',        'data': allCrime[\"arizona\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Colorado',       'data': allCrime[\"colorado\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Maine',          'data': allCrime[\"maine\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Oregon',         'data': allCrime[\"oregon\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Kansas',         'data': allCrime[\"kansas\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Utah',           'data': allCrime[\"utah\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Nebraska',       'data': allCrime[\"nebraska\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Nevada',         'data': allCrime[\"nevada\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Idaho',          'data': allCrime[\"idaho\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'New Mexico',     'data': allCrime[\"new mexico\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'South Dakota',   'data': allCrime[\"south dakota\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'North Dakota',   'data': allCrime[\"north dakota\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Montana',        'data': allCrime[\"montana\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Wyoming',        'data': allCrime[\"wyoming\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]},\n  {'name': 'Alaska',         'data': allCrime[\"alaska\"][\"data\"][52][\"totals\"][\"violent\"][\"all\"]}  ]\n\nUS_Map.map_init()\nUS_Map.color_US_map(crimesPerState)\n\nplt.title('Amount of Violent Crimes per State in 2012')        \nplt.show()"
  },
  {
    "path": "tests/python_files/weather.py",
    "content": "import weather\nimport matplotlib.pyplot as plt\n\nreports = weather.get_weather()\ntemperatures = []\nt2 = []\nfor report in reports:\n    temperatures.append(report['Data']['Temperature']['Avg Temp'])\n    t2.append(report['Data']['Temperature']['Min Temp'])\nplt.scatter(temperatures, t2)\nplt.show()"
  },
  {
    "path": "tests/replay.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>BlockPy Replay</title>\n    \n    <link rel=\"stylesheet\" href=\"../libs/bootstrap.min.css\">\n    <link rel=\"stylesheet\" href=\"../libs/codemirror/codemirror.css\">\n    <link rel=\"stylesheet\" href=\"../libs/font-awesome.min.css\">\n    <link rel=\"stylesheet\" href=\"../libs/summernote/summernote.css\">\n    <link rel=\"stylesheet\" href=\"../libs/multi-select.css\">\n    <link rel=\"stylesheet\" href=\"../src/css/blockpy.css\">\n    <!--<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css\">-->\n    \n    <!-- JQuery, D3, Math.js, Bootstrap -->\n    <script type=\"text/javascript\" src=\"../libs/jquery/jquery.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/jquery/jquery-ui.min.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/jquery/jquery.hotkeys.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/jquery/jquery.multi-select.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/d3.min.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/math.0.19.0.min.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/bootstrap.min.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/bootstrap-wysiwyg.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/mindmup-editabletable.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/codemirror/codemirror.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/codemirror/python.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/codemirror/htmlmixed.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/codemirror/xml.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/knockout-3.4.0.js\"></script>\n    \n    <!-- Summernote, a rich text editor -->\n    <script type=\"text/javascript\" src=\"../libs/summernote/summernote.min.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/summernote/summernote-ext-hint.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/summernote/summernote-ext-video.js\"></script>\n    \n    <!-- Blockly -->\n    <script type=\"text/javascript\" src=\"blockly/blockly_uncompressed.js\"></script>\n    <script type=\"text/javascript\" src=\"blockly/blocks_compressed.js\"></script>\n    <script type=\"text/javascript\" src=\"blockly/python_compressed.js\"></script>\n    <script type=\"text/javascript\" src=\"blockly/pseudo_compressed.js\"></script>\n    <script type=\"text/javascript\" src=\"blockly/javascript_compressed.js\"></script>\n    <script type=\"text/javascript\" src=\"blockly/msg/js/en.js\"></script>\n    \n    <!-- Skulpt -->\n    <script type=\"text/javascript\" src=\"skulpt/dist/skulpt.min.js\"></script>\n    <script type=\"text/javascript\" src=\"skulpt/dist/skulpt-stdlib.js\"></script>\n    \n    <!-- Source Code -->\n    <script type=\"text/javascript\" src=\"../src/utilities.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/python_errors.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/ast_node_visitor.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/abstract_interpreter.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/abstract_interpreter_definitions.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/abstract_interpreter_tests.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/python_to_blockly.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/imported.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/class.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/comment.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/comprehensions.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/dict.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/if.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/io.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/lists.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/sets.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/loops.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/parking.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/tuple.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/turtles.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/text.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/dialog.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/storage.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/printer.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/interface.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/server.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/english.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/corgis.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/history.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/presentation.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/editor.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/feedback.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/toolbar.js\"></script>\n\n    <script type=\"text/javascript\" src=\"../src/treeMatching.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/sk_mod_instructor_extended.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/skulpt_modules/sk_mod_instructor.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/engine.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/main_v4.js\"></script>\n    \n    <!--<script type=\"text/javascript\" src=\"test_corgis/blockpy/tate/tate_blockly.js\"></script>\n    <script type=\"text/javascript\" src=\"test_corgis/blockpy/tate/tate_skulpt.js\"></script>\n    <script type=\"text/javascript\" src=\"test_corgis/blockpy/tate/tate_dataset.js\"></script>-->\n    \n    <style>\n\n    </style>\n    <script>\n    $(document).ready(function() {\n        blockpy = new BlockPy({\n            'blocklyPath': \"blockly/\",\n            'attachmentPoint': document.getElementById('blockpy-div'),\n            'instructor': true,\n            'developer': true,\n            'editor': 'Text',\n            'urls': {\n                'import_datasets': 'https://think.cs.vt.edu/blockpy/load_corgis/',\n                //'walk_old_code': 'http://localhost:8000/walk_code/',\n                //'log_event': 'http://localhost:8000/save_events/'\n                /*'save_code': 'http://localhost:8000/save_code/',\n                'save_success': 'http://localhost:8000/submit_grade/',\n                'log_event': 'http://localhost:8000/save_events/'*/\n            }\n        });\n        blockpy.setAssignment(\n            // settings\n            {\n                'editor': 'Text',\n                'read_only': false,\n                'disable_semantic_errors': false,\n            },\n            // assignment\n            {\n                'introduction': \"Welcome to BlockPy. Try running the code below.\",\n                'name': \"#1.2\",\n                'give_feedback': 'import instructor_histogram as ins_hist\\nimport instructor_append as ins_app\\nimport instructor_iteration as ins_iter\\nimport instructor_filter as ins_filt\\nimport iteration_context as ins_cont\\nins_app.missing_append_in_iteration()\\nins_app.wrong_not_append_to_list()\\nins_app.missing_append_list_initialization()\\nins_app.wrong_append_list_initiatization()\\nins_app.append_list_wrong_slot()\\n',\n                'parsons': false,\n                'starting_code': '',\n                'importable': true,\n                'initial_view': 'Blocks',\n                'modules': {\n                    'added': ['Functions', 'Data - Weather'],\n                    'removed': []\n                }\n            },\n            // programs\n            {\n                '__main__': 'import matplotlib.pyplot as plt\\nquakes = [1,2,3,4]\\nquakes_in_miles = []\\nfor quake in quakes:\\n    quakes_in_miles.append(quake * 0.62)\\nplt.hist(quakes_in_miles)\\nplt.xlabel(\"Depth in Miles\")\\nplt.ylabel(\"Number of Earthquakes\")\\nplt.title(\"Distribution of Depth in Miles of Earthquakes\")\\nplt.show()\\n'\n            }\n        )\n        \n        function inIframe () {\n            try {\n                return window.self !== window.top;\n            } catch (e) {\n                return true;\n            }\n        }\n        if (inIframe()) {\n            $(\"#blockpy-container\").width(\"100%\");\n        }\n\n        function updatePauseButton(){\n            if(global_isPaused){\n                document.getElementById(\"pause-button\").innerHTML = \"Play\";\n            }else{\n                document.getElementById(\"pause-button\").innerHTML = \"Pause\";\n            }\n        };\n\n        var global_isPaused = false;\n        const FORWARD_SCRUB = \"forward\";\n        const BACKWARD_SCRUB = \"backward\";\n        const STOP_SCRUB = \"stop\"\n        var global_scrubing = STOP_SCRUB;\n        var speed = 50;\n        document.onkeydown = navigationStroke;\n        \n        function pauseEvent(){\n            global_isPaused = !global_isPaused;\n            updatePauseButton();\n        }\n        function forwardEvent(){\n            global_isPaused = true;\n            global_scrubing = FORWARD_SCRUB;\n            updatePauseButton();\n        }\n        function backEvent(){\n            global_isPaused = true;\n            global_scrubing = BACKWARD_SCRUB;\n            updatePauseButton();\n        }\n        function navigationStroke(key){\n            var KeyNavigationEnabled = document.getElementById(\"myCheck\").checked;\n            if(KeyNavigationEnabled == true){\n                key = key || window.event;\n                if (key.keyCode == '80') {\n                    // p is pressed\n                    pauseEvent();\n                }\n                else if (key.keyCode == '37') {\n                   // left arrow\n                   backEvent();\n                }\n                else if (key.keyCode == '39') {\n                   // right arrow\n                   forwardEvent();\n                }\n            }\n        }\n\n        $('#speed-slider').change(function() {\n            var sliderValue = document.getElementById(\"speed-slider\").value;\n            speed = 100 - document.getElementById(\"speed-slider\").value;\n            document.getElementById(\"sliderValue\").innerHTML = sliderValue;\n        });\n\n        $('#pause-button').click(function() {\n            global_isPaused = !global_isPaused;\n            updatePauseButton();\n        });\n\n        $('#forward-button').click(function() {\n            forwardEvent();\n        });\n\n        $('#backward-button').click(function() {\n            backEvent();\n        });\n        \n        function handleCodeEvents(record){\n            switch (record.action.toLowerCase()) {\n                case \"set\":\n                    blockpy.model.programs['__main__'](record.body);\n                    blockpy.components.editor.updateBlocks();\n                    break;\n                }\n        }\n\n        function executeLastCodeEvent(pastRecords){\n            var codeEvent = null;\n            for(i = pastRecords.length-1; i >= 0; i--){\n                var rawRecord = pastRecords[i];\n                record = JSON.parse(rawRecord);\n                if(record.event.toLowerCase() == \"code\"){\n                    codeEvent = record;\n                    break;\n                }\n            }\n            if(codeEvent != null){\n                handleCodeEvents(codeEvent);\n            }\n        }\n\n        function handleFeedbackEvents(record){\n            var messages = record.body.split(\"\\n\");\n            var detailError = messages[0];\n            var bodyMessage = \"\";\n            var regex = /line (\\d{1,})/i;\n            for(i = 1; i < messages.length; i++){\n                bodyMessage += messages[i];\n            }\n            var results = regex.exec(bodyMessage);\n            var line = results != null && results.length > 1 ? results[1] : null;\n            try{\n                switch (record.action.toLowerCase()) {\n                    case \"success\":\n                        blockpy.components.feedback.complete(detailError, bodyMessage, line);\n                        break;\n                    case \"editor error\":\n                        blockpy.components.feedback.editorError(detailError, bodyMessage, line);\n                        break;\n                    case \"no errors\":\n                        blockpy.components.feedback.noErrors(detailError, bodyMessage, line);\n                        break;\n                    case \"syntax error\":\n                        blockpy.components.feedback.syntaxError(detailError, bodyMessage, line);\n                        break;\n                    case \"semantic error\":\n                        blockpy.components.feedback.semanticError(detailError, bodyMessage, line);\n                        break;\n                    case \"internal error\":\n                        blockpy.components.feedback.internalError(detailError, bodyMessage, line);\n                        break;\n                    case \"instructor feedback\":\n                        blockpy.components.feedback.instructorFeedback(detailError, bodyMessage, line);\n                        break;\n                    case \"empty program\":\n                        blockpy.components.feedback.emptyProgram(detailError, bodyMessage, line);\n                        break;\n                    default:\n                        console.log(record.action.toLowerCase());\n                        break;\n                    // ...\n                }\n            }catch(err){\n                console.error(err);\n            }\n        };\n\n\n        $('#replay-button').click(function() {\n            var records = $('#replay-data').val().split(/\\r?\\n/);\n            var previousTime = null;\n            var pastRecords = [];\n            var goingBackwards = false;\n            var clearRunFlag = false;\n            function processAnother(recordsLeft) {\n                var gap = 100;\n                var moveForward = true;\n                if(global_isPaused){\n                    switch(global_scrubing){\n                        case BACKWARD_SCRUB:\n                            if(pastRecords.length > 1){\n                                blockpy.components.feedback.clearEditorErrors();\n                                blockpy.components.feedback.clear();\n                                recordsLeft.unshift(pastRecords.pop());\n                                recordsLeft.unshift(pastRecords.pop());\n                                goingBackwards = true;\n                                //TODO: Handle when going backwards to a feedback event\n                            }else{\n                                moveForward = false;\n                            }\n                            //NOTE: This cascades into FORWARD_SCRUB\n                        case FORWARD_SCRUB:\n                            global_scrubing = STOP_SCRUB;\n                            previousTime = null;\n                            break;\n                        default:\n                        moveForward = false;\n                        break;\n                    };\n                }\n                if(moveForward && recordsLeft.length > 0){\n                    blockpy.components.feedback.clearEditorErrors();\n                    blockpy.components.feedback.clear();\n                    var rawRecord = recordsLeft.shift();\n                    var record = JSON.parse(rawRecord);\n                    pastRecords.push(rawRecord);\n                    switch (record.event.toLowerCase()) {\n                        case \"code\":\n                            handleCodeEvents(record);\n                            break;\n                        case \"feedback\":\n                            if(goingBackwards){\n                                executeLastCodeEvent(pastRecords);\n                            }\n                            handleFeedbackEvents(record);\n                            break;\n                    }\n                    var cur_time = new Date(record.time*1000);\n                    if(!global_isPaused){\n                        gap = previousTime != null ? record.time - previousTime : 0;\n                        gap = (gap > 2000 ? 2000 : gap)*speed;\n                        previousTime = record.time;\n                        //var cur_time = new Date(record.time*1000);\n                        //var cur_time = record.time;\n                        //cur_time = cur_time.getHours();\n                        console.log(gap + \": \" + cur_time.getHours() + \":\" + cur_time.getMinutes() + \":\" + cur_time.getSeconds() + \":\" + cur_time.getMilliseconds() + \"/\" + record.time + \", ass: \" + record.assignment + \", user: \" + record.user);\n                    }else{\n                        console.log(\"freeze frame\" + \": \" + cur_time.getHours() + \":\" + cur_time.getMinutes() + \":\" + cur_time.getSeconds() + \":\" + cur_time.getMilliseconds() + \"/\" + record.time + \", ass:\" + record.assignment + \", user: \" + record.user);\n                    }\n                    //blockpy.components.editor.getPngFromBlocks\n                }\n                if(!clearRunFlag){\n                   setTimeout(function() {processAnother(recordsLeft)}, gap);\n                }\n            }\n            processAnother(records);\n        });\n    });\n    </script>\n\n</head>\n<body>\n<div style=\"width:900px;  margin:0 auto;\" id='blockpy-container'> <!-- 900px -->\n    <!-- Replay stuff -->\n    <textarea class=\"form-control\" rows=\"3\" id='replay-data'></textarea>\n    <button type='button' class='btn btn-submit' id='replay-button'>Replay</button>\n    <button type='button' class='btn btn-submit' id='pause-button'>Pause</button>\n    <button type='button' class='btn btn-submit' id='backward-button'>Backward</button>\n    <button type='button' class='btn btn-submit' id='forward-button'>Forward</button>\n    KeyNavigation: <input type=\"checkbox\" id=\"myCheck\" checked=\"check\">\n    <input type=\"range\" id=\"speed-slider\" value=\"50\" min=\"1\" max=\"100\">\n    <p id=\"sliderValue\" value=\"50\"></p>\n    <div id=\"blockpy-div\" style='height:100%'></div>\n</div>\n\n<script>\n\n</script>\n\n</body>\n</html>\n"
  },
  {
    "path": "tests/treeCompTest.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"utf-8\">\n    <title>Tree Comp Test</title>\n    \n    <link rel=\"stylesheet\" href=\"../libs/bootstrap.min.css\">\n    <link rel=\"stylesheet\" href=\"../libs/codemirror/codemirror.css\">\n    <link rel=\"stylesheet\" href=\"../libs/font-awesome.min.css\">\n    <link rel=\"stylesheet\" href=\"../libs/summernote/summernote.css\">\n    <link rel=\"stylesheet\" href=\"../libs/multi-select.css\">\n    <link rel=\"stylesheet\" href=\"../src/css/blockpy.css\">\n    <!--<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css\">-->\n    \n    <!-- JQuery, D3, Math.js, Bootstrap -->\n    <script type=\"text/javascript\" src=\"../libs/jquery/jquery.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/jquery/jquery-ui.min.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/jquery/jquery.hotkeys.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/jquery/jquery.multi-select.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/d3.min.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/math.0.19.0.min.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/bootstrap.min.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/bootstrap-wysiwyg.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/mindmup-editabletable.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/codemirror/codemirror.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/codemirror/python.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/codemirror/htmlmixed.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/codemirror/xml.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/knockout-3.4.0.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/stringify.js\"></script>\n\n    <!-- Summernote, a rich text editor -->\n    <script type=\"text/javascript\" src=\"../libs/summernote/summernote.min.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/summernote/summernote-ext-hint.js\"></script>\n    <script type=\"text/javascript\" src=\"../libs/summernote/summernote-ext-video.js\"></script>\n    \n    <!-- Blockly -->\n    <script type=\"text/javascript\" src=\"blockly/blockly_uncompressed.js\"></script>\n    <script type=\"text/javascript\" src=\"blockly/blocks_compressed.js\"></script>\n    <script type=\"text/javascript\" src=\"blockly/python_compressed.js\"></script>\n    <script type=\"text/javascript\" src=\"blockly/pseudo_compressed.js\"></script>\n    <script type=\"text/javascript\" src=\"blockly/javascript_compressed.js\"></script>\n    <script type=\"text/javascript\" src=\"blockly/msg/js/en.js\"></script>\n    \n    <!-- Skulpt -->\n    <script type=\"text/javascript\" src=\"skulpt/dist/skulpt.min.js\"></script>\n    <script type=\"text/javascript\" src=\"skulpt/dist/skulpt-stdlib.js\"></script>\n    \n    <!-- Source Code -->\n    <script type=\"text/javascript\" src=\"../src/utilities.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/python_errors.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/ast_node_visitor.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/abstract_interpreter.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/pytifa.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/abstract_interpreter_definitions.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/abstract_interpreter_tests.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/python_to_blockly.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/imported.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/class.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/comment.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/comprehensions.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/dict.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/if.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/io.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/lists.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/sets.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/loops.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/parking.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/tuple.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/turtles.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/text.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/blockly_blocks/plots.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/dialog.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/storage.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/printer.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/interface.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/server.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/english.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/corgis.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/history.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/presentation.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/editor.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/feedback.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/toolbar.js\"></script>\n\n    <script type=\"text/javascript\" src=\"../src/treeMatching.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/sk_mod_instructor_extended.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/skulpt_modules/sk_mod_instructor.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/engine.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/main_v4.js\"></script>\n    <script type=\"text/javascript\" src=\"../src/treeCompTest.js\"></script>\n    <!--<script type=\"text/javascript\" src=\"test_corgis/blockpy/tate/tate_blockly.js\"></script>\n    <script type=\"text/javascript\" src=\"test_corgis/blockpy/tate/tate_skulpt.js\"></script>\n    <script type=\"text/javascript\" src=\"test_corgis/blockpy/tate/tate_dataset.js\"></script>-->\n    \n    <style>\n\n    </style>\n    <script>\n    $(document).ready(function() {\n        blockpy = new BlockPy({\n            'blocklyPath': \"blockly/\",\n            'attachmentPoint': document.getElementById('blockpy-div'),\n            'instructor': true,\n            'developer': true,\n            'editor': 'Text',\n            'urls': {\n                //'import_datasets': 'https://think.cs.vt.edu/blockpy/load_corgis/',\n                //'walk_old_code': 'http://localhost:8000/walk_code/',\n                //'log_event': 'http://localhost:8000/save_events/'\n                /*'save_code': 'http://localhost:8000/save_code/',\n                'save_success': 'http://localhost:8000/submit_grade/',\n                'log_event': 'http://localhost:8000/save_events/'*/\n            }\n        });\n        blockpy.setAssignment(\n            // settings\n            {\n                'editor': 'Text',\n                'read_only': false,\n                'disable_semantic_errors': false,\n            },\n            // assignment\n            {\n                'introduction': \"Welcome to BlockPy. Try running the code below.\",\n                'name': \"#1.2\",\n                'give_feedback': 'import instructor_histogram as ins_hist\\nimport instructor_append as ins_app\\nimport instructor_iteration as ins_iter\\nimport instructor_filter as ins_filt\\nimport iteration_context as ins_cont\\nins_app.missing_append_in_iteration()\\nins_app.wrong_not_append_to_list()\\nins_app.missing_append_list_initialization()\\nins_app.wrong_append_list_initiatization()\\nins_app.append_list_wrong_slot()\\n',\n                'parsons': false,\n                'starting_code': '',\n                'importable': true,\n                'initial_view': 'Blocks',\n                'modules': {\n                    'added': ['Functions', 'Data - Weather'],\n                    'removed': []\n                }\n            },\n            // programs\n            {\n                '__main__': ''\n            }\n        )\n        \n        function inIframe () {\n            try {\n                return window.self !== window.top;\n            } catch (e) {\n                return true;\n            }\n        }\n        if (inIframe()) {\n            $(\"#blockpy-container\").width(\"100%\");\n        }\n\n        function updatePauseButton(){\n            if(global_isPaused){\n                document.getElementById(\"pause-button\").innerHTML = \"Play\";\n            }else{\n                document.getElementById(\"pause-button\").innerHTML = \"Pause\";\n            }\n        };\n\n        var global_isPaused = false;\n        const FORWARD_SCRUB = \"forward\";\n        const BACKWARD_SCRUB = \"backward\";\n        const STOP_SCRUB = \"stop\"\n        var global_scrubing = STOP_SCRUB;\n        var speed = 50;\n        document.onkeydown = navigationStroke;\n        \n        function pauseEvent(){\n            global_isPaused = !global_isPaused;\n            updatePauseButton();\n        }\n        function forwardEvent(){\n            global_isPaused = true;\n            global_scrubing = FORWARD_SCRUB;\n            updatePauseButton();\n        }\n        function backEvent(){\n            global_isPaused = true;\n            global_scrubing = BACKWARD_SCRUB;\n            updatePauseButton();\n        }\n        function navigationStroke(key){\n            var KeyNavigationEnabled = document.getElementById(\"myCheck\").checked;\n            if(KeyNavigationEnabled == true){\n                key = key || window.event;\n                if (key.keyCode == '80') {\n                    // p is pressed\n                    pauseEvent();\n                }\n                else if (key.keyCode == '37') {\n                   // left arrow\n                   backEvent();\n                }\n                else if (key.keyCode == '39') {\n                   // right arrow\n                   forwardEvent();\n                }\n            }\n        }\n\n        $('#speed-slider').change(function() {\n            var sliderValue = document.getElementById(\"speed-slider\").value;\n            speed = 100 - document.getElementById(\"speed-slider\").value;\n            document.getElementById(\"sliderValue\").innerHTML = sliderValue;\n        });\n\n        $('#pause-button').click(function() {\n            global_isPaused = !global_isPaused;\n            updatePauseButton();\n        });\n\n        $('#forward-button').click(function() {\n            forwardEvent();\n        });\n\n        $('#backward-button').click(function() {\n            backEvent();\n        });\n\n        $('#test-button').click(function() {\n            runTreeCompTestSuite();\n        });\n        $('#parse-button').click(function() {\n            var code = $('#replay-data').val().split(/\\n#==========\\n/);\n            var stdCode = null;\n            var insCode = null;\n            var insTree = null;\n            var insAST = null;\n            var stdAST = null;\n            var mappings = null;\n            try{\n                stdCode = code[0];\n                insCode = code[1];\n                insTree = new StretchyTreeMatcher(insCode);\n                insAST = insTree.rootNode;\n                stdAST = parseCode(stdCode);\n                mappings = null;\n                mappings = insTree.findMatches(stdAST.astNode);\n            }catch(exception){\n                console.error(\"parse failed\");\n            }\n            console.log(insAST);\n            console.log(stdAST);\n            console.log(mappings);            \n        });\n        function handleCodeEvents(record){\n            switch (record.action.toLowerCase()) {\n                case \"set\":\n                    blockpy.model.programs['__main__'](record.body);\n                    blockpy.components.editor.updateBlocks();\n                    break;\n                }\n        }\n\n        function executeLastCodeEvent(pastRecords){\n            var codeEvent = null;\n            for(i = pastRecords.length-1; i >= 0; i--){\n                var rawRecord = pastRecords[i];\n                record = JSON.parse(rawRecord);\n                if(record.event.toLowerCase() == \"code\"){\n                    codeEvent = record;\n                    break;\n                }\n            }\n            if(codeEvent != null){\n                handleCodeEvents(codeEvent);\n            }\n        }\n\n        function handleFeedbackEvents(record){\n            var messages = record.body.split(\"\\n\");\n            var detailError = messages[0];\n            var bodyMessage = \"\";\n            var regex = /line (\\d{1,})/i;\n            for(i = 1; i < messages.length; i++){\n                bodyMessage += messages[i];\n            }\n            var results = regex.exec(bodyMessage);\n            var line = results != null && results.length > 1 ? results[1] : null;\n            try{\n                switch (record.action.toLowerCase()) {\n                    case \"success\":\n                        blockpy.components.feedback.complete(detailError, bodyMessage, line);\n                        break;\n                    case \"editor error\":\n                        blockpy.components.feedback.editorError(detailError, bodyMessage, line);\n                        break;\n                    case \"no errors\":\n                        blockpy.components.feedback.noErrors(detailError, bodyMessage, line);\n                        break;\n                    case \"syntax error\":\n                        blockpy.components.feedback.syntaxError(detailError, bodyMessage, line);\n                        break;\n                    case \"semantic error\":\n                        blockpy.components.feedback.semanticError(detailError, bodyMessage, line);\n                        break;\n                    case \"internal error\":\n                        blockpy.components.feedback.internalError(detailError, bodyMessage, line);\n                        break;\n                    case \"instructor feedback\":\n                        blockpy.components.feedback.instructorFeedback(detailError, bodyMessage, line);\n                        break;\n                    case \"empty program\":\n                        blockpy.components.feedback.emptyProgram(detailError, bodyMessage, line);\n                        break;\n                    default:\n                        console.log(record.action.toLowerCase());\n                        break;\n                    // ...\n                }\n            }catch(err){\n                console.error(err);\n            }\n        };\n\n\n        $('#replay-button').click(function() {\n            var records = $('#replay-data').val().split(/\\r?\\n/);\n            var previousTime = null;\n            var pastRecords = [];\n            var goingBackwards = false;\n            var clearRunFlag = false;\n            function processAnother(recordsLeft) {\n                var gap = 100;\n                var moveForward = true;\n                if(global_isPaused){\n                    switch(global_scrubing){\n                        case BACKWARD_SCRUB:\n                            if(pastRecords.length > 1){\n                                blockpy.components.feedback.clearEditorErrors();\n                                blockpy.components.feedback.clear();\n                                recordsLeft.unshift(pastRecords.pop());\n                                recordsLeft.unshift(pastRecords.pop());\n                                goingBackwards = true;\n                                //TODO: Handle when going backwards to a feedback event\n                            }else{\n                                moveForward = false;\n                            }\n                            //NOTE: This cascades into FORWARD_SCRUB\n                        case FORWARD_SCRUB:\n                            global_scrubing = STOP_SCRUB;\n                            previousTime = null;\n                            break;\n                        default:\n                        moveForward = false;\n                        break;\n                    };\n                }\n                if(moveForward && recordsLeft.length > 0){\n                    blockpy.components.feedback.clearEditorErrors();\n                    blockpy.components.feedback.clear();\n                    var rawRecord = recordsLeft.shift();\n                    var record = JSON.parse(rawRecord);\n                    pastRecords.push(rawRecord);\n                    switch (record.event.toLowerCase()) {\n                        case \"code\":\n                            handleCodeEvents(record);\n                            break;\n                        case \"feedback\":\n                            if(goingBackwards){\n                                executeLastCodeEvent(pastRecords);\n                            }\n                            handleFeedbackEvents(record);\n                            break;\n                    }\n                    var cur_time = new Date(record.time*1000);\n                    if(!global_isPaused){\n                        gap = previousTime != null ? record.time - previousTime : 0;\n                        gap = (gap > 2000 ? 2000 : gap)*speed;\n                        previousTime = record.time;\n                        //var cur_time = new Date(record.time*1000);\n                        //var cur_time = record.time;\n                        //cur_time = cur_time.getHours();\n                        console.log(gap + \": \" + cur_time.getHours() + \":\" + cur_time.getMinutes() + \":\" + cur_time.getSeconds() + \":\" + cur_time.getMilliseconds() + \"/\" + record.time + \", ass: \" + record.assignment + \", user: \" + record.user);\n                    }else{\n                        console.log(\"freeze frame\" + \": \" + cur_time.getHours() + \":\" + cur_time.getMinutes() + \":\" + cur_time.getSeconds() + \":\" + cur_time.getMilliseconds() + \"/\" + record.time + \", ass:\" + record.assignment + \", user: \" + record.user);\n                    }\n                    //blockpy.components.editor.getPngFromBlocks\n                }\n                if(!clearRunFlag){\n                   setTimeout(function() {processAnother(recordsLeft)}, gap);\n                }\n            }\n            processAnother(records);\n        });\n    });\n    </script>\n\n</head>\n<body>\n<div style=\"width:900px;  margin:0 auto;\" id='blockpy-container'> <!-- 900px -->\n    <!-- Replay stuff -->\n    <textarea class=\"form-control\" rows=\"10\" id='replay-data'></textarea>\n    <button type='button' class='btn btn-submit' id='replay-button'>Replay</button>\n    <button type='button' class='btn btn-submit' id='pause-button'>Pause</button>\n    <button type='button' class='btn btn-submit' id='backward-button'>Backward</button>\n    <button type='button' class='btn btn-submit' id='forward-button'>Forward</button>\n    KeyNavigation: <input type=\"checkbox\" id=\"myCheck\" checked=\"check\">\n    <input type=\"range\" id=\"speed-slider\" value=\"50\" min=\"1\" max=\"100\">\n    <p id=\"sliderValue\" value=\"50\"></p>\n    <button type='button' class='btn btn-submit' id='test-button'>Test</button>\n    <button type='button' class='btn btn-submit' id='parse-button'>Parse</button>\n    <div id=\"blockpy-div\" style='height:100%'></div>\n</div>\n\n<script>\n\n</script>\n\n</body>\n</html>\n"
  },
  {
    "path": "todo.txt",
    "content": "Table Block\nAssessment API/Blocks\n\nUnrolled Loop mode\nTime rewinder\nTooltips over errors\nMultiple block levels by manipulating the paths in the block.js file\n    Remove color, reduce padding, simplify text\n    Swap append order\n    Drop \"set\" from assignment\n    Add colons onto the end of lines\n    create empty list becomes []\nAdd in variable dictionary access block\nTabular block\nCall friend\n    Identifies students in the cohort who are on the same problem\n    Signals to the TA that the student has an issue\n    Emails a question to the TA\nPopup question dialog\n    Fill in the blank\n    Multiple choice\n        What variable is a dictionary (selectable list of variables) - optionally show type.\n    TAs see answers to questions\n\nIf then else - logic for instructor API\n    Allowed to write python snippets\n    Should the whole thing translate to python?\n\nTurn off name wrangler? It might be better to let them make mistakes and then point them out.\nHighlight parser error line in the code block!\n\nInstead of having it shown as a value changing, visualize it as a cursor moving through list\n    Integrate with JSAV\nPredict the next value of the trace\nExplain a given line of code\n\"All the variables you need are here\" <-- prevent them from creating new variables.\n\nSlowmode - when you run, it executes the code but \"plays\" its results slightly slowed down, so you can see the code highlighting.\n\nMultiple levels of blocks (Block sets)\n\nURL shortened forms\n\nNameError\n    Have they defined the variable after use? (differentiate between an update and an initialization)\n        Line X attempts to use the variable <A> before it is declared. You have a declaration on Line Y. However, remember that your program executes top-to-bottom.\n        \n        If line X and line Y are equal\n            Line X attempts to update the variable <A> with itself. You must initialize a variable before you can update it. Remember that the RIGHT-side of assignment statements are evaluate BEFORE the LEFT-side.\n        \n        Check to see if the usage is within a loop\n            \n    Have they possibly typo'd it?\n        You attempted to use a variable <A> on line X. You have not declared a variable with that name. However, there is an <integer> variable named <A'>.\n        \n    Is there just nothing about it anywhere?\n        You attempted to use the variable <A> before it is declared. Currently, you have not declared the variable anywhere. Remember that your program executes top-to-bottom.\n        \nTypeError\n    Addition/Subtraction between list and number\n    Addition/Subtraction between string and number\n    Iterating over integer\n        \n    \nZeroDivisionError\n    This error occurs because you attempted to divide by zero.\n    It looks like you are using an empty list \n    \n\nUsing color heatmaps to teach students about iteration and decision- can we demonstrate how some code paths are explored more often? \n\nColor code (site creations) and (site overwrites)\n\nFor testing:\nairlines.get_all(testing=True)\n\nFor production:\nairlines.get_all()\n\n\n"
  },
  {
    "path": "webpack.config.js",
    "content": "const webpack = require(\"webpack\");\nconst path = require(\"path\");\nconst env = require(\"yargs\").argv.env;\nconst MiniCssExtractPlugin = require(\"mini-css-extract-plugin\");\n\nconst libraryName = \"blockpy\";\nlet outputFile, mode;\n\nif (env === \"build\") {\n    mode = \"production\";\n    outputFile = libraryName + \".min.js\";\n} else {\n    mode = \"development\";\n    outputFile = libraryName + \".js\";\n}\n\nlet config = {\n    mode: mode,\n    entry: {\n        blockpy: __dirname + \"/src/blockpy.js\"\n    },\n    devtool: \"inline-source-map\",\n    output: {\n        path: __dirname + \"/dist\",\n        filename: outputFile,\n        library: libraryName,\n        libraryTarget: \"umd\",\n        umdNamedDefine: true,\n        globalObject: \"typeof self !== 'undefined' ? self : this\"\n    },\n    module: {\n        rules: [\n            {\n                test: /(\\.jsx|\\.js)$/,\n                /*loader: \"babel-loader\",*/\n                use: {\n                    loader: \"babel-loader\"\n                },\n                exclude: /(node_modules|bower_components)/\n            },\n            {\n                test: /(\\.jsx|\\.js)$/,\n                loader: \"eslint-loader\",\n                exclude: /node_modules/\n            },\n            {\n                test: /\\.css$/,\n                use: [\n                    {\n                        loader: MiniCssExtractPlugin.loader,\n                        options: {\n                            // you can specify a publicPath here\n                            // by default it uses publicPath in webpackOptions.output\n                            publicPath: \"../\",\n                            hmr: mode === \"development\",\n                        },\n                    },\n                    \"css-loader\",\n                ],\n            }\n        ]\n    },\n    resolve: {\n        modules: [path.resolve(\"./node_modules\"), path.resolve(\"./src\")],\n        extensions: [\".json\", \".js\"]\n    },\n    plugins: [\n        new MiniCssExtractPlugin({\n            // Options similar to the same options in webpackOptions.output\n            // all options are optional\n            filename: \"[name].css\",\n            chunkFilename: \"[id].css\",\n            ignoreOrder: false, // Enable to remove warnings about conflicting order\n        }),\n        new webpack.ProvidePlugin({\n            $: \"jquery\",\n            jQuery: \"jquery\",\n            ko: \"knockout\",\n            FilePond: \"filepond\"\n        })\n    ],\n    externals: {\n        jquery: \"jQuery\",\n        knockout: \"ko\",\n        filepond: \"FilePond\"\n    }\n};\n\nmodule.exports = config;"
  }
]