nadesiko3 3.3.45 → 3.3.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +143 -132
- package/batch/browsers.template.md +3 -3
- package/batch/build_browsers.nako3 +72 -72
- package/batch/build_command.nako3 +44 -44
- package/batch/build_nako_version.nako3 +42 -42
- package/batch/calc_hash.nako3 +29 -29
- package/batch/cmd_txt2json.nako3 +74 -74
- package/batch/command.txt +270 -338
- package/batch/command_nakopad.txt +9 -69
- package/batch/download-extlib.nako3 +43 -43
- package/batch/gen_command_nakopad.nako3 +57 -57
- package/batch/jsplugin2text.nako3 +285 -285
- package/batch/pickup_command.nako3 +110 -110
- package/batch/pickup_reserved_words.nako3 +11 -11
- package/batch/publish_version.nako3 +46 -46
- package/batch/show_agents.js +14 -14
- package/batch/turtle2js.nako3 +21 -21
- package/bin/cnako3 +10 -10
- package/core/.editorconfig +6 -0
- package/core/.eslintrc.cjs +33 -0
- package/core/.github/dependabot.yml +7 -0
- package/core/.github/workflows/nodejs.yml +37 -0
- package/core/.github/workflows/super-linter.yml +61 -0
- package/core/.github/workflows/textlint.yml +199 -0
- package/core/LICENSE +21 -0
- package/core/README.md +66 -0
- package/core/batch/build_nako_version.nako3 +42 -0
- package/core/command/snako.mjs +105 -0
- package/core/command/snako.mts +116 -0
- package/core/index.mjs +21 -0
- package/core/index.mts +21 -0
- package/core/package.json +47 -0
- package/core/sample/hello.nako3 +7 -0
- package/core/sample/hoge.mjs +4 -0
- package/core/sample/hoge.mts +6 -0
- package/core/src/nako3.mjs +858 -0
- package/core/src/nako3.mts +967 -0
- package/core/src/nako_colors.mjs +78 -0
- package/core/src/nako_colors.mts +86 -0
- package/core/src/nako_core_version.mjs +8 -0
- package/core/src/nako_core_version.mts +19 -0
- package/core/src/nako_csv.mjs +185 -0
- package/core/src/nako_csv.mts +188 -0
- package/core/src/nako_errors.mjs +173 -0
- package/core/src/nako_errors.mts +197 -0
- package/core/src/nako_from_dncl.mjs +255 -0
- package/core/src/nako_from_dncl.mts +250 -0
- package/core/src/nako_gen.mjs +1648 -0
- package/core/src/nako_gen.mts +1719 -0
- package/core/src/nako_gen_async.mjs +1659 -0
- package/core/src/nako_gen_async.mts +1732 -0
- package/core/src/nako_global.mjs +107 -0
- package/core/src/nako_global.mts +138 -0
- package/core/src/nako_indent.mjs +445 -0
- package/core/src/nako_indent.mts +492 -0
- package/core/src/nako_josi_list.mjs +38 -0
- package/core/src/nako_josi_list.mts +45 -0
- package/core/src/nako_lex_rules.mjs +253 -0
- package/core/src/nako_lex_rules.mts +260 -0
- package/core/src/nako_lexer.mjs +609 -0
- package/core/src/nako_lexer.mts +612 -0
- package/core/src/nako_logger.mjs +199 -0
- package/core/src/nako_logger.mts +232 -0
- package/core/src/nako_parser3.mjs +2439 -0
- package/core/src/nako_parser3.mts +2195 -0
- package/core/src/nako_parser_base.mjs +370 -0
- package/core/src/nako_parser_base.mts +370 -0
- package/core/src/nako_parser_const.mjs +37 -0
- package/core/src/nako_parser_const.mts +37 -0
- package/core/src/nako_prepare.mjs +304 -0
- package/core/src/nako_prepare.mts +315 -0
- package/core/src/nako_reserved_words.mjs +38 -0
- package/core/src/nako_reserved_words.mts +38 -0
- package/core/src/nako_source_mapping.mjs +207 -0
- package/core/src/nako_source_mapping.mts +262 -0
- package/core/src/nako_test.mjs +37 -0
- package/core/src/nako_types.mjs +25 -0
- package/core/src/nako_types.mts +151 -0
- package/core/src/plugin_csv.mjs +49 -0
- package/core/src/plugin_csv.mts +50 -0
- package/core/src/plugin_math.mjs +328 -0
- package/core/src/plugin_math.mts +326 -0
- package/core/src/plugin_promise.mjs +91 -0
- package/core/src/plugin_promise.mts +91 -0
- package/core/src/plugin_system.mjs +2832 -0
- package/core/src/plugin_system.mts +2690 -0
- package/core/src/plugin_test.mjs +34 -0
- package/core/src/plugin_test.mts +34 -0
- package/core/test/array_test.mjs +34 -0
- package/core/test/basic_test.mjs +344 -0
- package/core/test/calc_test.mjs +140 -0
- package/core/test/core_module_test.mjs +23 -0
- package/core/test/debug_test.mjs +16 -0
- package/core/test/dncl_test.mjs +94 -0
- package/core/test/error_message_test.mjs +210 -0
- package/core/test/error_test.mjs +16 -0
- package/core/test/flow_test.mjs +373 -0
- package/core/test/func_call.mjs +160 -0
- package/core/test/func_test.mjs +149 -0
- package/core/test/indent_test.mjs +364 -0
- package/core/test/lex_test.mjs +168 -0
- package/core/test/literal_test.mjs +73 -0
- package/core/test/nako_lexer_test.mjs +35 -0
- package/core/test/nako_logger_test.mjs +76 -0
- package/core/test/nako_logger_test.mts +78 -0
- package/core/test/plugin_csv_test.mjs +38 -0
- package/core/test/plugin_promise_test.mjs +18 -0
- package/core/test/plugin_system_test.mjs +630 -0
- package/core/test/prepare_test.mjs +96 -0
- package/core/test/re_test.mjs +22 -0
- package/core/test/side_effects_test.mjs +92 -0
- package/core/test/variable_scope_test.mjs +149 -0
- package/core/tsconfig.json +101 -0
- package/demo/ace_editor.html +89 -89
- package/demo/ace_editor_tabs.html +161 -161
- package/demo/basic.html +71 -71
- package/demo/browsers.html +9 -10
- package/demo/css/basic.css +3 -3
- package/demo/css/common.css +157 -157
- package/demo/css/editor.css +8 -8
- package/demo/css/flow.css +3 -3
- package/demo/css/index.css +3 -3
- package/demo/flow.html +98 -98
- package/demo/graph.html +53 -53
- package/demo/image/nakopad-icon256.png +0 -0
- package/demo/index.html +133 -133
- package/demo/js/common.js +17 -17
- package/demo/js/turtle3d_test.js +44 -44
- package/demo/js/turtle_test.js +45 -45
- package/demo/nako3/calc.nako3 +4 -4
- package/demo/runscript.html +47 -47
- package/demo/runscript2.html +33 -33
- package/demo/runscript3.html +35 -35
- package/demo/runscript4.html +33 -33
- package/demo/turtle.html +58 -58
- package/demo/turtle2.html +141 -141
- package/demo/turtle3.html +279 -279
- package/demo/turtle3d.html +58 -58
- package/demo/turtle3d2.html +107 -107
- package/demo/version.html +24 -24
- package/doc/SETUP.md +157 -157
- package/doc/about.md +17 -17
- package/doc/browsers.md +26 -26
- package/doc/docgen.md +21 -21
- package/doc/editor.md +44 -44
- package/doc/files.md +39 -39
- package/doc/plugins.md +234 -234
- package/doc/release.md +79 -79
- package/doc/textlint.md +43 -43
- package/doc/win32.md +57 -57
- package/package.json +195 -192
- package/release/_hash.txt +28 -28
- package/release/_script-tags.txt +14 -14
- package/release/command.json +1 -1
- package/release/command.json.js +1 -1
- package/release/command_cnako3.json +1 -1
- package/release/command_list.json +1 -1
- package/release/editor.js +1 -1
- package/release/nako_gen_async.js +1 -1
- package/release/plugin_csv.js +1 -1
- package/release/stats.json +1 -1
- package/release/version.js +1 -1
- package/release/wnako3.js +1 -1
- package/release/wnako3webworker.js +1 -1
- package/src/browsers.txt +11 -12
- package/src/browsers_agents.json +2 -2
- package/src/browsers_agents.mjs +1 -1
- package/src/cnako3.mjs +17 -10
- package/src/cnako3.mts +18 -12
- package/src/cnako3mod.mjs +707 -687
- package/src/cnako3mod.mts +712 -696
- package/src/commander_ja.mjs +164 -164
- package/src/commander_ja.mts +161 -161
- package/src/enako3.mjs +68 -69
- package/src/era.mjs +22 -22
- package/src/image_turtle-elephant.mjs +2 -5
- package/src/image_turtle-panda.mjs +2 -5
- package/src/image_turtle64.mjs +2 -5
- package/src/index.mjs +9 -9
- package/src/index.mts +10 -11
- package/src/nako3editorfix.sfd +106 -106
- package/src/nako_version.mjs +8 -8
- package/src/nako_version.mts +2 -2
- package/src/plugin_browser.mjs +213 -212
- package/src/plugin_browser.mts +206 -205
- package/src/plugin_browser_ajax.mjs +399 -399
- package/src/plugin_browser_audio.mjs +109 -109
- package/src/plugin_browser_canvas.mjs +449 -449
- package/src/plugin_browser_chart.mjs +294 -294
- package/src/plugin_browser_color.mjs +49 -49
- package/src/plugin_browser_crypto.mjs +26 -26
- package/src/plugin_browser_dialog.mjs +53 -53
- package/src/plugin_browser_dom_basic.mjs +336 -336
- package/src/plugin_browser_dom_event.mjs +193 -193
- package/src/plugin_browser_dom_parts.mjs +396 -396
- package/src/plugin_browser_geolocation.mjs +51 -51
- package/src/plugin_browser_hotkey.mjs +25 -25
- package/src/plugin_browser_html.mjs +59 -59
- package/src/plugin_browser_in_worker.mjs +45 -45
- package/src/plugin_browser_location.mjs +21 -21
- package/src/plugin_browser_speech.mjs +111 -111
- package/src/plugin_browser_storage.mjs +121 -121
- package/src/plugin_browser_system.mjs +31 -31
- package/src/plugin_browser_websocket.mjs +73 -73
- package/src/plugin_caniuse.mjs +29 -29
- package/src/plugin_datetime.mjs +394 -394
- package/src/plugin_httpserver.mjs +277 -0
- package/src/plugin_httpserver.mts +286 -0
- package/src/plugin_kansuji.mjs +224 -224
- package/src/plugin_keigo.mjs +55 -55
- package/src/plugin_markup.mjs +32 -32
- package/src/plugin_node.mjs +1047 -1047
- package/src/plugin_node.mts +980 -980
- package/src/plugin_turtle.mjs +647 -647
- package/src/plugin_webworker.mjs +334 -334
- package/src/plugin_weykturtle3d.mjs +1214 -1214
- package/src/plugin_worker.mjs +95 -95
- package/src/repl.nako3 +63 -63
- package/src/wnako3.mjs +12 -12
- package/src/wnako3.mts +11 -11
- package/src/wnako3_editor.css +215 -215
- package/src/wnako3_editor.mjs +1542 -1542
- package/src/wnako3_editor.mts +1657 -1656
- package/src/wnako3mod.mjs +213 -213
- package/src/wnako3mod.mts +214 -214
- package/src/wnako3webworker.mjs +69 -68
- package/test/ace_editor/karma.config.js +94 -94
- package/test/ace_editor/test/.babelrc.json +3 -3
- package/test/ace_editor/test/ace_editor_test.js +178 -178
- package/test/ace_editor/test/html/custom_context.html +139 -139
- package/test/async/async_basic_test.mjs +122 -122
- package/test/browser/karma.config.js +221 -221
- package/test/browser/test/.babelrc.json +3 -3
- package/test/browser/test/compare_util.js +50 -50
- package/test/browser/test/html/div_basic.html +2 -2
- package/test/browser/test/html/event_dom_form.html +4 -4
- package/test/browser/test/html/event_dom_scrolldiv.html +5 -5
- package/test/browser/test/import_plugin_checker.js +24 -24
- package/test/browser/test/plugin_browser_test.js +51 -51
- package/test/browser/test/plugin_browser_test_ajax.js +123 -123
- package/test/browser/test/plugin_browser_test_color.js +18 -18
- package/test/browser/test/plugin_browser_test_dialog.js +72 -72
- package/test/browser/test/plugin_browser_test_dom_event.js +598 -598
- package/test/browser/test/plugin_browser_test_dom_parts.js +125 -125
- package/test/browser/test/plugin_browser_test_system.js +9 -9
- package/test/browser/test/plugin_turtle_test.js +817 -817
- package/test/browser/test/plugin_webworker_test.js +86 -86
- package/test/browser/test/require_test.js +68 -68
- package/test/bundled/karma.config.base.js +117 -117
- package/test/bundled/karma.config.js +86 -86
- package/test/bundled/test/.babelrc.json +3 -3
- package/test/bundled/test/bundled_test.js +69 -69
- package/test/bundled/test/html/custom_context.html +65 -65
- package/test/bundled/test/html/custom_debug.html +66 -66
- package/test/bundled/test4b.cmd +52 -52
- package/test/bundled/test_base/.babelrc.json +3 -3
- package/test/bundled/test_base/_checktool_test.js +25 -25
- package/test/bundled/test_base/basic_ajax_test.js +56 -56
- package/test/bundled/test_base/basic_async_test.js +18 -18
- package/test/bundled/test_base/basic_test.js +153 -153
- package/test/bundled/test_base/calc_test.js +132 -132
- package/test/bundled/test_base/css/browsers_box.css +114 -114
- package/test/bundled/test_base/html/custom_context.html +69 -69
- package/test/bundled/test_base/html/custom_debug.html +71 -71
- package/test/bundled/test_base/js/browsers_box.js +72 -72
- package/test/bundled/test_base/plugin_csv_test.js +37 -37
- package/test/bundled/test_base/plugin_datetime_test.js +115 -115
- package/test/bundled/test_base/plugin_kansuji_test.js +49 -49
- package/test/bundled/test_base/plugin_system_test.js +410 -410
- package/test/bundled/test_base/plugin_webworker_test.js +53 -53
- package/test/bundled/test_base/test_utils.js +191 -191
- package/test/common/plugin_browser_test.mjs +22 -24
- package/test/common/plugin_browser_ut_audio_test.mjs +108 -108
- package/test/common/plugin_browser_ut_color_test.mjs +21 -21
- package/test/common/plugin_browser_ut_dialog_test.mjs +100 -100
- package/test/common/plugin_browser_ut_html_test.mjs +13 -13
- package/test/common/plugin_browser_ut_system_test.mjs +10 -10
- package/test/common/plugin_markup_test.mjs +23 -23
- package/test/jsconfig.json +19 -19
- package/test/karma.config.js +91 -91
- package/test/node/async_test.mjs +96 -82
- package/test/node/commander_ja_test.mjs +89 -89
- package/test/node/error_message_test.mjs +243 -253
- package/test/node/kai_test.nako3 +6 -6
- package/test/node/node_test.mjs +60 -60
- package/test/node/plugin_broken.js.txt +3 -3
- package/test/node/plugin_browser_ut_ajax_test.mjs.todo +357 -357
- package/test/node/plugin_browser_ut_location_test.mjs +42 -42
- package/test/node/plugin_markup_test.mjs +47 -46
- package/test/node/plugin_math_test.mjs +45 -44
- package/test/node/plugin_node_test.mjs +98 -97
- package/test/node/plugin_test.mjs +44 -43
- package/test/node/relative_import_test_1.nako3 +1 -1
- package/test/node/relative_import_test_2.nako3 +2 -2
- package/test/node/require_nako3_test.mjs +67 -66
- package/test/node/requiretest.nako3 +4 -4
- package/test/node/requiretest_indirect.nako3 +1 -1
- package/test/node/requiretest_name.nako3 +5 -5
- package/test/node/runtime_error.nako3 +2 -2
- package/test/node/scope1.nako3 +10 -10
- package/test/node/scope2.nako3 +12 -12
- package/test/node/side_effects_test.mjs +39 -119
- package/test/node/sjis.txt +5 -5
- package/test/node/syntax_error.nako3 +1 -1
- package/test/node/wnako3_editor_test.mjs +384 -384
- package/tools/README.md +12 -7
- package/tools/check_new_version.nako3 +25 -25
- package/tools/nako3edit/html/daisyui/LICENSE +22 -22
- package/tools/nako3edit/html/daisyui/version_2.14.1 +1 -1
- package/tools/nako3edit/html/edit.html +170 -170
- package/tools/nako3edit/html/edit_plugin.js +6 -6
- package/tools/nako3edit/html/files.html +125 -125
- package/tools/nako3edit/html/nako3edit.css +65 -65
- package/tools/nako3edit/index.mjs +248 -244
- package/tools/nako3server/index.html +10 -0
- package/tools/nako3server/index.mjs +116 -116
- package/tools/nako3server/index.nako3 +34 -0
- package/release/nako_gen_async.js.LICENSE.txt +0 -35
- package/release/plugin_caniuse.js.LICENSE.txt +0 -11
- package/release/plugin_csv.js.LICENSE.txt +0 -15
- package/release/plugin_datetime.js.LICENSE.txt +0 -15
- package/release/plugin_kansuji.js.LICENSE.txt +0 -3
- package/release/plugin_markup.js.LICENSE.txt +0 -11
- package/release/plugin_turtle.js.LICENSE.txt +0 -15
- package/release/plugin_webworker.js.LICENSE.txt +0 -3
- package/release/plugin_weykturtle3d.js.LICENSE.txt +0 -3
- package/release/wnako3webworker.js.LICENSE.txt +0 -131
- package/tools/nako3edit/a.sqlite3 +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";var __webpack_modules__={6211:function(e,t){t.Z={version:"3.3.45",major:3,minor:3,patch:45}},5154:function(e,t,n){n.d(t,{as:function(){return a},cg:function(){return o},ih:function(){return c},k:function(){return r},l0:function(){return f},t5:function(){return i},tO:function(){return u}});var s=n(6211);class r extends Error{constructor(e,t,n,r){const i=`${n||""}${void 0===r?"":`(${r+1}行目): `}`;super(`[${e}]${i}${t}\n[バージョン] ${s.Z.version}`),this.tag="["+e+"]",this.positionJa=i,t=t.replace(/『main__(.+?)』/g,"『$1』"),this.msg=t}}class i extends r{constructor(e,t,n){super("インデントエラー",e,n,t),this.line=t,this.file=n}}class o extends r{constructor(e,t,n,s,r){super("字句解析エラー(内部エラー)",e,r,s),this.preprocessedCodeStartOffset=t,this.preprocessedCodeEndOffset=n,this.line=s,this.file=r}}class u extends r{constructor(e,t,n,s,r){super("字句解析エラー",e,r,s),this.startOffset=t,this.endOffset=n,this.line=s,this.file=r}}class c extends r{constructor(e,t,n,s,r){super("文法エラー",e,r,t),this.file=r,this.line=t,this.startOffset=n,this.endOffset=s}static fromNode(e,t,n){if(!t)return new c(e,void 0,void 0,void 0,void 0);const s="number"==typeof t.startOffset?t.startOffset:void 0,r=n&&"number"==typeof n.endOffset?n.endOffset:"number"==typeof t.endOffset?t.endOffset:void 0;return new c(e,t.line,s,r,t.file)}}class a extends r{constructor(e,t){const n=e instanceof Error&&e.constructor!==Error&&e.constructor!==a?e.constructor.name+": ":"",s=e instanceof Error?e.message:e+"";let r,i,o;void 0===t?(r=void 0,i=void 0):(o=/^l(-?\d+):(.*)$/.exec(t))?(r=+o[1],i=o[2]):(o=/^l(-?\d+)$/.exec(t))?(r=+o[1],i=void 0):(r=void 0,i=t),super("実行時エラー",`エラー『${n}${s}』が発生しました。`,i,r),this.error=e,this.lineNo=t,this.line=r,this.file=i}}class f extends r{constructor(e,t,n){super("取り込みエラー",e,t,n),this.file=t,this.line=n}}},7636:function(e,t,n){n.d(t,{Im:function(){return u},Jc:function(){return o},un:function(){return i}});var s=n(5154),r=n(4392);class i{constructor(e=!1,t=[],n="",s=""){this.isTest=e,this.codeStandalone=n,this.codeEnv=s,this.importFiles=["plugin_system.mjs","plugin_math.mjs","plugin_csv.mjs","plugin_promise.mjs","plugin_test.mjs"],t.map((e=>{this.importFiles.push(e)}))}}class o{constructor(e){this.nakoFuncList={...e.getNakoFuncList()},this.nakoTestFuncs={},this.usedFuncSet=new Set,this.loopId=1,this.numAsyncFn=0,this.usedAsyncFn=!1,this.flagLoop=!1,this.__self=e,this.genMode="sync",this.lastLineNo=null,this.varslistSet=e.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varsSet={isFunction:!1,names:new Set,readonly:new Set},this.varslistSet[2]=this.varsSet,this.speedMode={lineNumbers:0,implicitTypeCasting:0,invalidSore:0,forcePure:0},this.performanceMonitor={userFunction:0,systemFunction:0,systemFunctionBody:0,mumeiId:0},this.warnUndefinedVar=!0,this.warnUndefinedReturnUserFunc=1,this.warnUndefinedCallingUserFunc=1,this.warnUndefinedCallingSystemFunc=1,this.warnUndefinedCalledUserFuncArgs=1}static isValidIdentifier(e){return/^(?!(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$)[$A-Z_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(e)}convLineno(e,t=!1){if(this.speedMode.lineNumbers>0)return"";let n;if(n="number"!=typeof e.line?"unknown":"string"!=typeof e.file?`l${e.line}`:`l${e.line}:${e.file}`,!t){if(n===this.lastLineNo)return"";this.lastLineNo=n}return`__v0.line=${JSON.stringify(n)};`}varname(e){return 3===this.varslistSet.length?`__varslist[2][${JSON.stringify(e)}]`:o.isValidIdentifier(e)?e:`__vars[${JSON.stringify(e)}]`}static getFuncName(e){if(e.indexOf("__")>=0){const t=e.split("__");return`${t[0]}__${o.getFuncName(t[1])}`}let t=e.replace(/[ぁ-ん]+$/,"");return""===t&&(t=e),t}static convPrint(e){return`__print(${e});`}convRequire(e){const t=e.value;return this.convLineno(e,!1)+`__module['${t}'] = require('${t}');\n`}getDefFuncCode(e,t){let n="";n+=`const nakoVersion = { version: ${JSON.stringify(e.version)} }\n`,n+="const __self = self;\n",n+="self.__self = self;\n",n+="const __varslist = self.__varslist;\n",n+="const __module = self.__module;\n",n+="const __v0 = self.__v0 = self.__varslist[0];\n",n+="const __v1 = self.__v1 = self.__varslist[1];\n",n+="const __vars = self.__vars = self.__varslist[2];\n";let s="";for(const e in this.nakoFuncList){const t=this.nakoFuncList[e].fn;s+=`//[DEF_FUNC name='${e}' asyncFn=${this.nakoFuncList[e].asyncFn?"true":"false"}]\nself.__varslist[1]["${e}"]=${t};\n;//[/DEF_FUNC name='${e}']\n`}if(""!==s&&(n+="__v0.line='関数の定義';\n"+s),t.isTest){let e="const __tests = [];\n";for(const t in this.nakoTestFuncs){e+=`${this.nakoTestFuncs[t].fn};\n;`}""!==e&&(n+="__v0.line='テストの定義';\n",n+=e+"\n")}return n}addPlugin(e){return this.__self.addPlugin(e)}addPluginObject(e,t){this.__self.addPluginObject(e,t)}addPluginFile(e,t,n){this.__self.addPluginFile(e,t,n)}addFunc(e,t,n){this.__self.addFunc(e,t,n)}getFunc(e){return this.__self.getFunc(e)}registerFunction(e){if("block"!==e.type)throw s.ih.fromNode("構文解析に失敗しています。構文は必ずblockが先頭になります",e);const t=[],n=e=>{if(!e.block)return;const s=e.block instanceof Array?e.block:[e.block];for(let e=0;e<s.length;e++){const r=s[e];if("def_func"===r.type){if(!r.name)throw new Error("[System Error] 関数の定義で関数名が指定されていない");const e=r.name.value;this.usedFuncSet.add(e),this.__self.__varslist[1][e]=function(){},this.varslistSet[1].names.add(e);const n=r.name.meta;this.nakoFuncList[e]={josi:n.josi,fn:()=>{},type:"func",asyncFn:r.asyncFn},t.push({name:e,node:r})}else if("speed_mode"===r.type){if(!r.block)continue;"block"===r.block.type?n(r.block):n(r)}else if("performance_monitor"===r.type){if(!r.block)continue;"block"===r.block.type?n(r.block):n(r)}}};n(e);const r=new Set;0===this.speedMode.invalidSore&&r.add("それ"),this.varsSet={isFunction:!1,names:r,readonly:new Set},this.varslistSet=this.__self.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varslistSet[2]=this.varsSet}convGen(e,t){const n=this.convLineno(e,!1)+this._convGen(e,!0);return t.isTest?"":n}_convGen(e,t){if(!e)return"";let n="";if(e instanceof Array){for(let s=0;s<e.length;s++){const r=e[s];n+=this._convGen(r,t)}return n}if(null===e)return"null";if(void 0===e)return"undefined";if("object"!=typeof e)return""+e;switch(e.type){case"nop":break;case"block":if(n+=`;__self.__modName='${r.S.filenameToModName(e.file||"")}';\n`,!e.block)return n;const s=e.block instanceof Array?e.block:[e.block];for(let e=0;e<s.length;e++){const t=s[e];n+=this._convGen(t,!1)}break;case"comment":case"eol":n+=this.convComment(e);break;case"break":n+=this.convCheckLoop(e,"break");break;case"continue":n+=this.convCheckLoop(e,"continue");break;case"end":n+="__varslist[0]['終']();";break;case"number":n+=e.value;break;case"string":n+=this.convString(e);break;case"def_local_var":n+=this.convDefLocalVar(e);break;case"def_local_varlist":n+=this.convDefLocalVarlist(e);break;case"let":n+=this.convLet(e);break;case"inc":n+=this.convInc(e);break;case"word":case"variable":n+=this.convGetVar(e);break;case"op":case"calc":n+=this.convOp(e);break;case"renbun":n+=this.convRenbun(e);break;case"not":n+="(("+this._convGen(e.value,!0)+")?0:1)";break;case"func":case"func_pointer":case"calc_func":n+=this.convCallFunc(e,t);break;case"if":n+=this.convIf(e);break;case"tikuji":n+=this.convTikuji(e);break;case"for":n+=this.convFor(e);break;case"foreach":n+=this.convForeach(e);break;case"repeat_times":n+=this.convRepeatTimes(e);break;case"speed_mode":n+=this.convSpeedMode(e,t);break;case"performance_monitor":n+=this.convPerformanceMonitor(e,t);break;case"while":n+=this.convWhile(e);break;case"atohantei":n+=this.convAtohantei(e);break;case"switch":n+=this.convSwitch(e);break;case"let_array":n+=this.convLetArray(e);break;case"配列参照":n+=this.convRefArray(e);break;case"json_array":n+=this.convJsonArray(e);break;case"json_obj":n+=this.convJsonObj(e);break;case"func_obj":n+=this.convFuncObj(e);break;case"bool":n+=e.value?"true":"false";break;case"null":n+="null";break;case"def_test":n+=this.convDefTest(e);break;case"def_func":n+=this.convDefFunc(e);break;case"return":n+=this.convReturn(e);break;case"try_except":n+=this.convTryExcept(e);break;case"require":n+=this.convRequire(e);break;default:throw new Error("System Error: unknown_type="+e.type)}return n}findVar(e){if(this.varslistSet.length>3&&this.varsSet.names.has(e))return{i:this.varslistSet.length-1,name:e,isTop:!0,js:this.varname(e)};for(let t=2;t>=0;t--)if(this.varslistSet[t].names.has(e))return{i:t,name:e,isTop:!1,js:`__varslist[${t}][${JSON.stringify(e)}]`};return null}genVar(e,t){const n=this.findVar(e),r=t.line;if(null===n){if("引数"===e||"それ"===e||"対象"===e||"対象キー"===e);else if(this.warnUndefinedVar){const n=e.replace(/^main__(.+)$/,"$1");this.__self.getLogger().warn(`変数『${n}』は定義されていません。`,t)}return this.varsSet.names.add(e),this.varname(e)}if(0===n.i){const i=this.__self.getNakoFunc(e);if(!i)return`${n.js}/*err:${r}*/`;if("const"===i.type||"var"===i.type)return n.js;if("func"===i.type){if(!i.josi||0===i.josi.length)return`(${n.js}())`;throw s.ih.fromNode(`『${e}』が複文で使われました。単文で記述してください。(v1非互換)`,t)}throw s.ih.fromNode(`『${e}』は関数であり参照できません。`,t)}return n.js}convGetVar(e){const t=e.value;return this.genVar(t,e)}convComment(e){let t=String(e.value);t=t.replace(/\n/g,"¶");const n=this.convLineno(e,!1);return""===t&&""===n?";":""===t?";"+n+"\n":";"+n+"//"+t+"\n"}convReturn(e){if(this.varsSet.names.has("!関数"))throw s.ih.fromNode("『戻る』がありますが、関数定義内のみで使用可能です。",e);const t=this.convLineno(e,!1);let n;if(e.value)n=this._convGen(e.value,!0);else{if(0!==this.speedMode.invalidSore)return t+"return;";n=this.varname("それ")}return 0===this.warnUndefinedReturnUserFunc?t+`return ${n};`:t+`return (function(a){if(a===undefined){__self.logger.warn('ユーザ関数からundefinedが返されています',{file:'${e.file}',line:${e.line}});};return a;})(${n});`}convCheckLoop(e,t){if(!this.flagLoop){const n="continue"===t?"続ける":"抜ける";throw s.ih.fromNode(`『${n}』文がありますが、それは繰り返しの中で利用してください。`,e)}return this.convLineno(e)+t+";"}convDefFuncCommon(e,t){let n="",s="";if(0!==this.performanceMonitor.userFunction){let e=t;e||(void 0===this.performanceMonitor.mumeiId&&(this.performanceMonitor.mumeiId=0),this.performanceMonitor.mumeiId++,e=`anous_${this.performanceMonitor.mumeiId}`),n=`const performanceMonitorEnd = (function (key, type) {\nconst uf_start = performance.now() * 1000;\nreturn function () {\nconst el_time = performance.now() * 1000 - uf_start;\nif (!__self.__performance_monitor) {\n__self.__performance_monitor={};\n__self.__performance_monitor[key] = { called:1, totel_usec: el_time, min_usec: el_time, max_usec: el_time, type: type };\n} else if (!__self.__performance_monitor[key]) {\n__self.__performance_monitor[key] = { called:1, totel_usec: el_time, min_usec: el_time, max_usec: el_time, type: type };\n} else {\n__self.__performance_monitor[key].called++;\n__self.__performance_monitor[key].totel_usec+=el_time;\nif(__self.__performance_monitor[key].min_usec>el_time){__self.__performance_monitor[key].min_usec=el_time;}\nif(__self.__performance_monitor[key].max_usec<el_time){__self.__performance_monitor[key].max_usec=el_time;}\n}};})('${e}', 'user');try {\n`,s="} finally { performanceMonitorEnd(); }\n"}let r="";const i=new Set;0===this.speedMode.invalidSore&&i.add("それ"),this.varsSet={isFunction:!0,names:i,readonly:new Set},this.varslistSet.push(this.varsSet),r+=" var 引数 = arguments;\n",r+=" var __vars = {};\n";const u=Array.from(this.varsSet.names.values());let c="";const a=t?e.name.meta:e.meta;for(let n=0;n<a.varnames.length;n++){const s=a.varnames[n];0===this.warnUndefinedCalledUserFuncArgs?c+=` ${this.varname(s)} = arguments[${n}];\n`:c+=t?` ${this.varname(s)} = (function(a){if(a===undefined){__self.logger.warn('ユーザ関数(${t})の引数(${this.varname(s)})にundefinedが渡されました',{file:'${e.file}',line:${e.line}});};return a;})(arguments[${n}]);\n`:` ${this.varname(s)} = (function(a){if(a===undefined){__self.logger.warn('匿名関数の引数(${this.varname(s)})にundefinedが渡されました',{file:'${e.file}',line:${e.line}});};return a;})(arguments[${n}]);\n`,this.varsSet.names.add(s)}t&&(this.usedFuncSet.add(t),this.varslistSet[1].names.add(t),void 0===this.nakoFuncList[t]&&(this.nakoFuncList[t]={josi:e.name.meta.josi,fn:()=>{},type:"func",asyncFn:!1}));const f=this.usedAsyncFn;this.usedAsyncFn=!1;c+=this._convGen(e.block,!1).split("\n").map((e=>" "+e)).join("\n")+"\n",0===this.speedMode.invalidSore&&(c+=` return (${this.varname("それ")});\n`),c+=s,t&&this.usedAsyncFn&&(this.nakoFuncList[t].asyncFn=!0);for(const e of Array.from(this.varsSet.names.values()))u.includes(e)||o.isValidIdentifier(e)&&(r+=` var ${e};\n`);0===this.speedMode.invalidSore&&(o.isValidIdentifier("それ")?r+=" var それ = '';\n":r+=` ${this.varname("それ")} = '';`);return c=(this.usedAsyncFn?"(async function(){\n":"(function(){\n")+n+r+c+"",c+="})",t&&(this.nakoFuncList[t].fn=c,this.nakoFuncList[t].asyncFn=this.usedAsyncFn,a.asyncFn=this.usedAsyncFn),this.usedAsyncFn=f,this.varslistSet.pop(),this.varsSet=this.varslistSet[this.varslistSet.length-1],t&&(this.__self.__varslist[1][t]=c),c}convDefTest(e){const t=e.name.value;let n=`__tests.push({ name: '${t}', f: () => {\n`;return n+=` ${this._convGen(e.block,!1)}\n}});`,this.nakoTestFuncs[t]={josi:e.name.meta.josi,fn:n,type:"test_func"},""}convDefFunc(e){if(!e.name)return"";const t=o.getFuncName(e.name.value);return this.convDefFuncCommon(e,t),""}convFuncObj(e){return this.convDefFuncCommon(e,"")}convJsonObj(e){return"{"+e.value.map((e=>`${this._convGen(e.key,!0)}:${this._convGen(e.value,!0)}`)).join(",")+"}"}convJsonArray(e){return"["+e.value.map((e=>this._convGen(e,!0))).join(",")+"]"}convRefArray(e){const t=this._convGen(e.name,!0),n=e.index;let s=t;if(!n)return s;for(let e=0;e<n.length;e++){s+="["+this._convGen(n[e],!0)+"]"}return s}convLetArray(e){const t=this._convGen(e.name,!0),n=e.index||[];let s="",r=t,i="";if(e.checkInit){const e="[0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0]";s+=`\n/*配列初期化*/if (!(${t} instanceof Array)) { ${t} = ${e}; console.log('初期化:${t}') };`;for(let r=0;r<n.length-1;r++){i+=`[${this._convGen(n[r],!0)}]`,s+=`\n/*配列初期化${r}*/if (!(${t}${i} instanceof Array)) { ${t}${i} = ${e}; };`}s+="\n"}for(let e=0;e<n.length;e++){r+="["+this._convGen(n[e],!0)+"]"}r+=" = "+this._convGen(e.value,!0)+";\n";return this.convLineno(e,!1)+s+r}convGenLoop(e){const t=this.flagLoop;this.flagLoop=!0;try{return this._convGen(e,!1)}finally{this.flagLoop=t}}convFor(e){let t;if(null!==e.word){const n=e.word.value;this.varsSet.names.add(n),t=this.varname(n)}else this.varsSet.names.add("dummy"),t=this.varname("dummy");const n=this.loopId++,s=`$nako_i${n}`,r=this._convGen(e.from,!0),i=this._convGen(e.to,!0);let o="1";null===e.inc&&void 0!==e.inc&&"null"!==e.inc||(o=this._convGen(e.inc,!0));const u=this.convGenLoop(e.block),c=`$nako_from${n}`,a=`$nako_to${n}`;let f="";0===this.speedMode.invalidSore&&(f=`${this.varname("それ")} = `);const l=`\n//[FOR id=${n}]\nconst ${c} = ${r};\nconst ${a} = ${i};\nif (${c} <= ${a}) { // up\n for (let ${s} = ${c}; ${s} <= ${a}; ${s}+= ${o}) {\n ${f}${t} = ${s};\n ${u}\n };\n} else { // down\n for (let ${s} = ${c}; ${s} >= ${a}; ${s}-= ${o}) {\n ${f}${t} = ${s};\n ${u}\n };\n};\n//[/FOR id=${n}]\n`;return this.convLineno(e,!1)+l}convForeach(e){let t;if(null===e.target){if(0!==this.speedMode.invalidSore)throw s.ih.fromNode("『反復』の対象がありません。",e);t=this.varname("それ")}else t=this._convGen(e.target,!0);let n='__v0["対象"]';e.name&&(n=this.varname(e.name.value),this.varsSet.names.add(e.name.value));const r=this.convGenLoop(e.block),i=this.loopId++;let o="";0===this.speedMode.invalidSore&&(o=`${this.varname("それ")} = `);const u=`let $nako_foreach_v${i}=${t};\nfor (let $nako_i${i} in $nako_foreach_v${i}){\n if ($nako_foreach_v${i}.hasOwnProperty($nako_i${i})) {\n ${n} = ${o}$nako_foreach_v${i}[$nako_i${i}];\n __v0["対象キー"] = $nako_i${i};\n ${r}\n }\n};\n`;return this.convLineno(e,!1)+u}convRepeatTimes(e){const t=this.loopId++,n=this._convGen(e.value,!0),s=this.convGenLoop(e.block);let r="";0===this.speedMode.invalidSore&&(r=`${this.varname("それ")} = `);const i=`let $nako_times_v${t} = ${n};\nfor(var $nako_i${t} = 1; $nako_i${t} <= $nako_times_v${t}; $nako_i${t}++){\n ${r}__v0["回数"] = $nako_i${t};\n `+s+"\n}\n";return this.convLineno(e,!1)+i}convSpeedMode(e,t){if(!e.options)return"";const n={...this.speedMode};e.options["行番号無し"]&&this.speedMode.lineNumbers++,e.options["暗黙の型変換無し"]&&this.speedMode.implicitTypeCasting++,e.options["強制ピュア"]&&this.speedMode.forcePure++,e.options["それ無効"]&&this.speedMode.invalidSore++;try{return this._convGen(e.block,t)}finally{this.speedMode=n}}convPerformanceMonitor(e,t){const n={...this.performanceMonitor};if(!e.options)return"";e.options["ユーザ関数"]&&this.performanceMonitor.userFunction++,e.options["システム関数本体"]&&this.performanceMonitor.systemFunctionBody++,e.options["システム関数"]&&this.performanceMonitor.systemFunction++;try{return this._convGen(e.block,t)}finally{this.performanceMonitor=n}}convWhile(e){const t=`while (${this._convGen(e.cond,!0)}){\n ${this.convGenLoop(e.block)}\n}\n`;return this.convLineno(e,!1)+t}convAtohantei(e){const t=`$nako_i${this.loopId++}`,n=this._convGen(e.cond,!0),s=`for(;;) {\n ${this.convGenLoop(e.block)}\n let ${t} = ${n};\n if (${t}) { continue } else { break }\n}\n\n`;return this.convLineno(e,!1)+s}convSwitch(e){const t=this._convGen(e.value,!0),n=e.cases||[];let s="";for(let e=0;e<n.length;e++){const t=n[e][0],r=this.convGenLoop(n[e][1]);if("違えば"===t.type)s+=" default:\n";else{s+=` case ${this._convGen(t,!0)}:\n`}s+=` ${r}\n break\n`}const r=`switch (${t}){\n${s}\n}\n`;return this.convLineno(e,!1)+r}convIf(e){const t=this._convGen(e.expr,!0),n=this._convGen(e.block,!1),s=null===e.false_block?"":"else {"+this._convGen(e.false_block,!1)+"};\n";return this.convLineno(e,!1)+`if (${t}) {\n ${n}\n}`+s+";\n"}convTikuji(e){const t=`__tikuji${this.loopId++}`;let n=`const ${t} = []\n`;const s=e.blocks?e.blocks:[];for(let e=0;e<s.length;e++){const r=this._convGen(s[e],!1).replace(/\s+$/,"")+"\n";n+=`${t}.push(function(resolve, reject) {\n __self.resolve = resolve;\n __self.reject = reject;\n __self.resolveCount = 0;\n ${this.convLineno(s[e],!0)}\n ${r} if (__self.resolveCount === 0) resolve();\n}); // end of tikuji__\${pid}[{$i}]\n`}n+=`// end of ${t} \n`;let r=` ${t}.splice(0);\n __v0["エラーメッセージ"]=errMsg;\n`;if(null!=e.errorBlock){r+=this._convGen(e.errorBlock,!1).replace(/\s+$/,"")+"\n"}return n+=`const ${t}__reject = function(errMsg){\n${r}};\n`,n+="__self.resolve = undefined;\n",n+=`const ${t}__resolve = function(){\n`,n+=" setTimeout(function(){\n",n+=` if (${t}.length == 0) {return}\n`,n+=` const f = ${t}.shift()\n`,n+=` f(${t}__resolve, ${t}__reject);\n`,n+=" }, 0);\n",n+="};\n",n+=`${t}__resolve()\n`,this.convLineno(e,!1)+n}convFuncGetArgsCalcType(e,t,n){const s=[],r={},i=n.args?n.args:[];for(let e=0;e<i.length;e++){const t=i[e];0===e&&null===t&&0===this.speedMode.invalidSore?(s.push(this.varname("それ")),r.sore=!0):s.push(this._convGen(t,!0))}return[s,r]}getPluginList(){const e=[];for(const t in this.__self.__module)e.push(t);return e}convCallFunc(e,t){const n=o.getFuncName(e.name),r=this.findVar(n);if(null===r)throw s.ih.fromNode(`関数『${n}』が見当たりません。有効プラグイン=[`+this.getPluginList().join(", ")+"]",e);let i;if(0===r.i){if(i=this.__self.getFunc(n),!i)throw new Error(`[System Error] 関数「${n}」NakoCompiler.nakoFuncList の不整合があります。`);if("func"!==i.type)throw s.ih.fromNode(`『${n}』は関数ではありません。`,e)}else i=this.nakoFuncList[n],void 0===i&&(i={return_none:!1});if("func_pointer"===e.type)return r.js;const u=this.convFuncGetArgsCalcType(n,i,e),c=u[0],a=u[1];this.usedFuncSet.add(n),c.push("__self");let f="function",l="",h="";if(e.setter&&(l+=";__self.isSetter = true;\n",h+=";__self.isSetter = false;\n"),0===r.i&&this.varslistSet.length>3&&!0!==i.pure&&0===this.speedMode.forcePure){const e=[];for(const t of Array.from(this.varsSet.names.values()))o.isValidIdentifier(t)&&e.push({str:JSON.stringify(t),js:this.varname(t)});l+="__self.__locals = __vars;\n";for(const t of e)l+=`__self.__locals[${t.str}] = ${t.js};\n`;for(const t of e)"それ"!==t.js&&(h+=`${t.js} = __self.__locals[${t.str}];\n`)}a.sore&&(l+="/*[sore]*/");const p=(e,t)=>{let n="";for(const s of e.split("\n"))""!==s&&(n+=" ".repeat(t)+s+"\n");return n};let d;0===this.warnUndefinedCallingUserFunc&&0!==r.i||0===this.warnUndefinedCallingSystemFunc&&0===r.i?d=c.join(","):(d="",c.forEach((t=>{"__self"===t?d+=`,${t}`:0===r.i?d+=`,(function(a){if(a===undefined){__self.logger.warn('命令『${n}』の引数にundefinedを渡しています。',{file:'${e.file}',line:${e.line}});};return a;})(${t})`:d+=`,(function(a){if(a===undefined){__self.logger.warn('ユーザ関数『${n}』の引数にundefinedを渡しています。',{file:'${e.file}',line:${e.line}});};return a;})(${t})`})),d=d.substring(1));let _=`${r.js}(${d})`;if(i.asyncFn&&(f=`async ${f}`,_=`await ${_}`,this.numAsyncFn++,this.usedAsyncFn=!0),0===r.i&&0!==this.performanceMonitor.systemFunctionBody){let e=n;e||(void 0===this.performanceMonitor.mumeiId&&(this.performanceMonitor.mumeiId=0),this.performanceMonitor.mumeiId++,e=`anous_${this.performanceMonitor.mumeiId}`),_=`(${f} (key, type) {\nconst sbf_start = performance.now() * 1000;\ntry {\nreturn `+_+";\n} finally {\nconst sbl_time = performance.now() * 1000 - sbf_start;\nif (!__self.__performance_monitor) {\n__self.__performance_monitor={};\n__self.__performance_monitor[key] = { called:1, totel_usec: sbl_time, min_usec: sbl_time, max_usec: sbl_time, type: type };\n} else if (!__self.__performance_monitor[key]) {\n__self.__performance_monitor[key] = { called:1, totel_usec: sbl_time, min_usec: sbl_time, max_usec: sbl_time, type: type };\n} else {\n__self.__performance_monitor[key].called++;\n__self.__performance_monitor[key].totel_usec+=sbl_time;\nif(__self.__performance_monitor[key].min_usec>sbl_time){__self.__performance_monitor[key].min_usec=sbl_time;}\nif(__self.__performance_monitor[key].max_usec<sbl_time){__self.__performance_monitor[key].max_usec=sbl_time;}\n"+`}}})('${n}_body', 'sysbody')\n`}let y="";if(i.return_none)y=""===h?""===l?`${_};\n`:`${l} ${_};\n`:`${l}try {\n${p(_,1)};\n} finally {\n${p(h,1)}}\n`;else{let n="";0===this.speedMode.invalidSore&&(n=`${this.varname("それ")} = `),y=""===l&&""===h?`(${n}${_})`:""===h?`(${f}(){\n${p(`${l};\nreturn ${n} ${_}`,1)}}).call(this)`:`(${f}(){\n${p(`${l}try {\n${p(`return ${n}${_};`,1)}\n} finally {\n${p(h,1)}}`,1)}}).call(this)`,("して"===e.josi||""===e.josi&&!t)&&(y+=";\n")}return 0===r.i&&0!==this.performanceMonitor.systemFunction&&(y="(function (key, type) {\nconst sf_start = performance.now() * 1000;\ntry {\nreturn "+y+";\n} finally {\nconst sl_time = performance.now() * 1000 - sf_start;\nif (!__self.__performance_monitor) {\n__self.__performance_monitor={};\n__self.__performance_monitor[key] = { called:1, totel_usec: sl_time, min_usec: sl_time, max_usec: sl_time, type: type };\n} else if (!__self.__performance_monitor[key]) {\n__self.__performance_monitor[key] = { called:1, totel_usec: sl_time, min_usec: sl_time, max_usec: sl_time, type: type };\n} else {\n__self.__performance_monitor[key].called++;\n__self.__performance_monitor[key].totel_usec+=sl_time;\nif(__self.__performance_monitor[key].min_usec>sl_time){__self.__performance_monitor[key].min_usec=sl_time;}\nif(__self.__performance_monitor[key].max_usec<sl_time){__self.__performance_monitor[key].max_usec=sl_time;}\n"+`}}})('${n}_sys', 'system')\n`),y}convRenbun(e){const t=this._convGen(e.right,!0);return`(function(){${this._convGen(e.left,!1)}; return ${t}}).call(this)`}convOp(e){const t={"&":'+""+',eq:"==",noteq:"!=","===":"===","!==":"!==",gt:">",lt:"<",gteq:">=",lteq:"<=",and:"&&",or:"||",shift_l:"<<",shift_r:">>",shift_r0:">>>","÷":"/"};let n=e.operator||"",s=this._convGen(e.right,!0),r=this._convGen(e.left,!0);return"+"===n&&0===this.speedMode.implicitTypeCasting&&(e.left&&"number"!==e.left.type&&(r=`parseFloat(${r})`),e.right&&"number"!==e.right.type&&(s=`parseFloat(${s})`)),"^"===n?`(Math.pow(${r}, ${s}))`:"÷÷"===n?`(Math.floor(${r} / ${s}))`:(t[n]&&(n=t[n]),`(${r} ${n} ${s})`)}convInc(e){let t=null;if(0===this.speedMode.invalidSore&&(t=this.varname("それ")),e.value&&(t=this._convGen(e.value,!0)),null==t)throw s.ih.fromNode("加算する先の変数名がありません。",e);const n=e.name.value;let r=this.findVar(n),i="";if(null===r&&(this.varsSet.names.add(n),r=this.findVar(n),!r))throw new Error("『増』または『減』で変数が見当たりません。");const o=r.js;return i+=`if (typeof(${o}) === 'undefined') { ${o} = 0; }`,i+=`${o} += ${t}`,";"+this.convLineno(e,!1)+i+"\n"}convLet(e){let t=null;if(0===this.speedMode.invalidSore&&(t=this.varname("それ")),e.value&&(t=this._convGen(e.value,!0)),null==t)throw s.ih.fromNode("代入する先の変数名がありません。",e);const n=e.name.value,r=this.findVar(n);let i="";if(null===r)this.varsSet.names.add(n),i=`${this.varname(n)} = ${t};`;else{if(this.varslistSet[r.i].readonly.has(n))throw s.ih.fromNode(`定数『${n}』は既に定義済みなので、値を代入することはできません。`,e);i=`${r.js} = ${t};`}return";"+this.convLineno(e,!1)+i+"\n"}convDefLocalVar(e){const t=null===e.value?"null":this._convGen(e.value,!0),n=e.name.value,r=e.vartype;if(this.varsSet.names.has(n))throw s.ih.fromNode(`${r}『${n}』の二重定義はできません。`,e);this.varsSet.names.add(n),"定数"===r&&this.varsSet.readonly.add(n);const i=`${this.varname(n)}=${t};\n`;return this.convLineno(e,!1)+i}convDefLocalVarlist(e){let t="";const n=e.vartype,s=null===e.value?"null":this._convGen(e.value,!0);this.loopId++;const r=`$nako_i${this.loopId}`;t+=`${r}=${s}\n`,t+=`if (!(${r} instanceof Array)) { ${r}=[${r}] }\n`;const i=e.names?e.names:[];for(let e=0;e<i.length;e++){const s=i[e].value;this.varsSet.names.has(s),this.varsSet.names.add(s),"定数"===n&&this.varsSet.readonly.add(s);t+=`${this.varname(s)}=${r}[${e}];\n`}return this.convLineno(e,!1)+t}convString(e){let t=""+e.value;const n=e.mode;if(t=t.replace(/\\/g,"\\\\"),t=t.replace(/"/g,'\\"'),t=t.replace(/\r/g,"\\r"),t=t.replace(/\n/g,"\\n"),"ex"===n){const n=(t,n)=>'"+'+this.genVar(n,e)+'+"';t=t.replace(/\{(.+?)\}/g,n),t=t.replace(/{(.+?)}/g,n)}return'"'+t+'"'}convTryExcept(e){const t=this._convGen(e.block,!1),n=this._convGen(e.errBlock,!1);return this.convLineno(e,!1)+`try {\n${t}\n} catch (e) {\n __v0["エラーメッセージ"] = e.message;\n;\n`+`${n}}\n`}getUsedFuncSet(){return this.usedFuncSet}getPluginInitCode(){let e="",t="";for(const e in this.__self.__module){const n=`!${e}:初期化`;this.varslistSet[0].names.has(n)&&(this.usedFuncSet.add(`!${e}:初期化`),t+=`__v0["!${e}:初期化"](__self);\n`)}return""!==t&&(e+="__v0.line='プラグインの初期化';\n"+t),e}}function u(e,t,n){const r=new o(e);r.registerFunction(t);let i=r.convGen(t,n);const u=r.getDefFuncCode(e,n);if(i&&n.isTest&&(i+="\n__self._runTests(__tests);\n"),r.numAsyncFn>0){const e="__nako3async"+(new Date).getTime()+"_"+(""+Math.random()).replace(".","_")+"__";i=`\n// --------------------------------------------------\n// <nadesiko3::gen::async times="${r.numAsyncFn}">\nasync function ${e}(self) {\n${u}\n${i}\n} // end of ${e}\n${e}.call(self, self).catch(err => {\n if (!(err instanceof NakoRuntimeError)) {\n err = new NakoRuntimeError(err, self.__v0.line)\n }\n self.logger.error(err)\n})\n// <nadesiko3::gen::async>\n// --------------------------------------------------\n`}else i=`\n// --------------------------------------------------\ntry {\n ${u}\n ${i}\n} catch (err) {\n if (!(err instanceof NakoRuntimeError)) {\n err = new NakoRuntimeError(err, self.__v0.line)\n }\n self.logger.error(err)\n}\n// --------------------------------------------------\n`;e.getLogger().trace("--- generate ---\n"+i);let c="";const a=[];for(const e of n.importFiles){if("nako_errors.mjs"===e)continue;const t="nako3runtime_"+e.replace(/\.(js|mjs)$/,"").replace(/[^a-zA-Z0-9_]/g,"_");a.push(t),c+=`import ${t} from './nako3runtime/${e}'\n`}const f=`// <standaloneCode>\n// 将来的に ESModule に対応する #1217\nimport path from 'path'\nimport { NakoRuntimeError } from './nako3runtime/nako_errors.mjs'\n${c}\nconst self = {}\nself.coreVersion = '${e.coreVersion}'\nself.version = '${e.version}'\nself.logger = {\n error: (message) => { console.error(message) },\n warn: (message) => { console.warn(message) },\n send: (level, message) => { console.log(message) },\n};\nself.__varslist = [{}, {}, {}]\nself.__v0 = self.__varslist[0]\nself.initFuncList = []\nself.clearFuncList = []\n// Copy module functions\nfor (const mod of [${a.join(", ")}]) {\n for (const funcName in mod) {\n if (funcName === '初期化') {\n self.initFuncList.push(mod[funcName].fn)\n continue\n }\n if (funcName === '!クリア') {\n self.clearFuncList.push(mod[funcName].fn)\n continue\n }\n self.__varslist[0][funcName] = mod[funcName].fn\n }\n}\nself.__vars = self.__varslist[2];\nself.__module = {};\nself.__locals = {};\nself.__genMode = 'sync';\n\n// プラグインの初期化コードを実行\nself.initFuncList.map(f => f(self))\n\ntry {\n${n.codeStandalone}\n// <JS>\n${i}\n// </JS>\n // プラグインのクリアコードを実行\n self.clearFuncList.map(f => f(self))\n} catch (err) {\n self.logger.error(err);\n throw err;\n}\n// </standaloneCode>\n`,l=r.getPluginInitCode();return{runtimeEnv:`\n// runtimeEnv\n${s.k.toString()}\n${s.as.toString()}\nconst self = this\n${n.codeEnv}\n${u}\n${l}\n${i}\n// end of runtimeEnv\n`,standalone:f,gen:r}}},970:function(e,t,n){n.d(t,{g:function(){return g}});var s=n(5154),r=n(6211),i=n(7636);const o="NOP",u="LBL",c="EOL",a="JMP",f="JMP_T",l="JMP_F",h="CALL",p="CALL_OBJ",d="RET",_="TRY",y="CODE";class m{constructor(e,t){this.type=e,this.value=t,this.no=-1,this.tag=0}}class g{constructor(e){this.com=e,this.nakoFuncList={...e.getNakoFuncList()},this.nakoTestList={},this.usedFuncSet=new Set,this.loopId=1,this.flagLoop=!1,this.codeId=0,this.codeArray=[],this.labelContinue=null,this.labelBreak=null,this.labels={},this.__self=e,this.genMode="非同期モード",this.lastLineNo=null,this.varslistSet=e.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varsSet={isFunction:!1,names:new Set,readonly:new Set},this.varslistSet[2]=this.varsSet,this.speedMode={lineNumbers:0,implicitTypeCasting:0,invalidSore:0,forcePure:0},this.performanceMonitor={userFunction:0,systemFunction:0,systemFunctionBody:0}}static generate(e,t,n){const i=new g(e);i.registerFunction(t);let o=i.convGen(t,!!n);return o=i.getDefFuncCode(n)+o,e.getLogger().trace("--- generate(非同期モード) ---\n"+o),o&&n&&(o+="\n__self._runTests(__tests);\n"),{runtimeEnv:o,standalone:`const nakoVersion = ${JSON.stringify(r.Z)};\n${s.k.toString()}\n${s.as.toString()}\nthis.logger = {\n error(message) { console.error(message) },\n send(level, message) { console.log(message) },\n};\nthis.__varslist = [{}, {}, {}];\nthis.__vars = this.__varslist[2];\nthis.__module = {};\nthis.__locals = {};\nthis.__labels = {};\nthis.__code = [];\nthis.__callstack = [];\nthis.__stack = [];\nthis.__genMode = '非同期モード';\ntry {\n ${i.getVarsCode()}\n ${o}\n} catch (err) {\n if (!(err instanceof NakoRuntimeError)) {\n err = new NakoRuntimeError(err, this.__varslist[0].line);\n }\n this.logger.error(err);\n throw err;\n}`,gen:i}}convLineno(e,t){if(this.speedMode.lineNumbers>0)return"";let n;if(n="number"!=typeof e.line?"unknown":"string"!=typeof e.file?`l${e.line}`:`l${e.line}:${e.file}`,!t){if(n===this.lastLineNo)return"";this.lastLineNo=n}return`__v0.line=${JSON.stringify(n)};`}varname(e){return`sys.__vars[${JSON.stringify(e)}]`}getVarsCode(){let e="";for(const t of Array.from(this.usedFuncSet.values())){const n=this.__self.__varslist[0][t],s=`this.__varslist[0]["${t}"]`;e+="function"==typeof n?s+"="+n.toString()+";\n":s+"="+JSON.stringify(n)+";\n"}return e}getDefFuncCode(e){let t="";t+="const __self = this.__self = this;\n",t+="const __varslist = this.__varslist;\n",t+="const __module = this.__module;\n",t+="const __v0 = this.__v0 = this.__varslist[0];\n",t+="const __v1 = this.__v1 = this.__varslist[1];\n",t+="const __vars = this.__vars = this.__varslist[2];\n",t+="const __code = this.__code;\n";let n="";for(const e in this.nakoFuncList){n+=`//[DEF_FUNC name='${e}']\n__v1["${e}"]=${this.nakoFuncList[e].fn};\n;//[/DEF_FUNC name='${e}']\n`}""!==n&&(t+="__v0.line='関数の定義';\n"+n);let s="";for(const e in this.__self.__module){const t=`!${e}:初期化`;this.varslistSet[0].names.has(t)&&(this.usedFuncSet.add(`!${e}:初期化`),s+=`__v0["!${e}:初期化"](__self);\n`)}if(""!==s&&(t+="__v0.line='プラグインの初期化';\n"+s),e){let n="const __tests = [];\n";for(const t in this.nakoTestList)if(!0===e||"string"==typeof e&&e===t){n+=`${this.nakoTestList[t].fn};\n;`}""!==n&&(t+="__v0.line='テストの定義';\n",t+=n+"\n")}return t}addPlugin(e){return this.__self.addPlugin(e)}addPluginObject(e,t){this.__self.addPluginObject(e,t)}addPluginFile(e,t,n){this.__self.addPluginFile(e,t,n)}addFunc(e,t,n){this.__self.addFunc(e,t,n)}getFunc(e){return this.__self.getFunc(e)}registerFunction(e){if("block"!==e.type)throw s.ih.fromNode("構文解析に失敗しています。構文は必ずblockが先頭になります",e);const t=e=>{for(let n=0;n<e.block.length;n++){const s=e.block[n];if("def_func"===s.type){const e=s.name.value;this.usedFuncSet.add(e),this.__self.__varslist[1][e]=function(){},this.nakoFuncList[e]={josi:s.name.meta.josi,fn:"",type:"func"}}else("speed_mode"===s.type||"performance_monitor"===s.type)&&("block"===s.block.type?t(s.block):t(s))}};t(e);const n=new Set;0===this.speedMode.invalidSore&&n.add("それ"),this.varsSet={isFunction:!1,names:n,readonly:new Set},this.varslistSet=this.__self.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varslistSet[2]=this.varsSet}convGen(e,t){this._convGen(e,!0);const n=new Set([a,f,l,h,_]);let s=this.codeArray;{s=s.filter((e=>e.type!==o));const e=new Set;s.forEach((t=>{n.has(t.type)&&e.add(t.value)})),s=s.filter((t=>t.type!==u||(15===t.tag||e.has(t.value))));let t=0;for(;t<s.length-1;)s[t].type!==c||s[t+1].type!==c?t++:s.splice(t+1,1);this.codeArray=s}s.forEach(((e,t)=>{e.type===u&&(this.labels[e.value]=t)})),s.forEach((e=>{n.has(e.type)&&e.no<0&&(e.no=this.labels[e.value])}));let r="";return s.forEach(((e,t)=>{switch(e.type){case o:r+=`case ${t}: break; // [NOP] ${e.value}\n`;break;case u:r+=`case ${t}: break; // [LABEL] ${e.value}\n`;break;case c:r+=`case ${t}: ${e.value}; break; // [EOL]\n`;break;case a:r+=`case ${t}: sys.nextIndex = ${e.no}; break; // ${e.value}\n`;break;case f:r+=`case ${t}: if (sys.__stack.pop()) { sys.nextIndex = ${e.no};} break; // ${e.value}\n`;break;case l:r+=`case ${t}: if (!sys.__stack.pop()) { sys.nextIndex = ${e.no}} break; // ${e.value}\n`;break;case d:r+=`case ${t}: sys.__return(sys); break;\n`;break;case h:r+=`case ${t}: sys.__call(${e.no}, sys); break; // ${e.value}\n`;break;case p:r+=`case ${t}: sys.__callObj('${e.value}', ${t}, sys); break; // ${e.value}\n`;break;case _:r+=`case ${t}: sys.tryIndex = ${e.no}; break; // TRY \n`;break;case y:{const n=e.value.replace(/\s+$/,"");r+=`case ${t}: {\n${n}\n};break;\n`;break}default:throw new Error("invalid code type")}})),r=`\n //-------------------------\n // main_code\n this.__labels = ${JSON.stringify(this.labels)};\n this.nextAsync = (sys) => {\n if (sys.index >= sys.codeSize || sys.index < 0) {return}\n const __v0 = sys.__v0\n try {\n sys.inLoop = true\n while (sys.index < sys.codeSize && sys.index >= 0) {\n // console.log('@@[run]', sys.index)\n switch (sys.index) {\n // --- CODE.BEGIN ---\n ${r}\n // --- CODE.END ---\n default:\n sys.inLoop = false\n console.log(sys.index, sys.__stack)\n throw new Error('Invalid sys.index:' + sys.index)\n break\n }\n // check next\n if (sys.nextIndex >= 0) {\n sys.index = sys.nextIndex\n sys.nextIndex = -1\n } else {\n sys.index++\n }\n if (sys.async) {\n sys.__saveSysenv(sys)\n sys.async = false\n break\n }\n } // end of while\n sys.inLoop = false\n } catch (e) {\n sys.__errorAsync(e, sys)\n }\n }\n this.__errorAsync = (e, sys) => { // エラーが起きた時呼び出す\n sys.__v0["エラーメッセージ"] = e.message;\n if (e.message == '__終わる__') {\n sys.__stopAsync(sys)\n return\n }\n if (sys.tryIndex >= 0) {\n sys.index = sys.tryIndex;\n setTimeout(() => {sys.nextAsync(sys)}, 1)\n } else {\n throw e\n }\n }\n this.__call = (no, sys) => {\n const info = {lastVars:sys.__vars, backNo: this.index + 1}\n sys.__callstack.push(info);\n sys.__vars = {"それ":""}\n sys.__varslist.push(sys.__vars)\n sys.nextIndex = no;\n }\n this.__return = sys => {\n if (sys.__callstack.length === 0) {\n sys.__destroySysenv(sys, sys.curSysenv.envid)\n sys.index = -2\n sys.nextIndex = -1\n return\n }\n const sore = sys.__vars['それ'];\n sys.__varslist.pop();\n const info = sys.__callstack.pop();\n sys.nextIndex = info.backNo;\n sys.__vars = info.lastVars;\n sys.__vars['それ'] = sore\n sys.__stack.push(sore);\n }\n this.__resetAsync = sys => {\n sys.index = 0\n sys.codeSize = ${s.length};\n sys.async = false\n sys.nextIndex = -1\n sys.tryIndex = -1\n }\n this.__stopAsync = sys => {\n sys.__resetAsync(sys)\n sys.index = -1 // force stop!!\n }\n this.__callNakoCode = (no, backNo, sys) => {\n this.__call(backNo, sys)\n sys.nextIndex = no\n const sysenv = sys.setAsync(sys)\n setTimeout(() => {\n // console.log('//__callNakoCode, back=', backNo, 'no=', no)\n sys.compAsync(sys, sysenv)\n } ,1)\n }\n this.__callNakoCodeEntry = (no, sys) => {\n sys.__saveSysenv(sys)\n sys.curSysenv = sys.__generateSysenv(sys)\n sys.__restoreSysenv(sys)\n sys.__vars = {"それ":""}\n sys.__varslist.push(sys.__vars)\n sys.index = no;\n sys.nextAsync(sys)\n }\n this.__callObj = (vname, curNo, sys) => {\n if (sys.__vars[vname]) {\n const fname = sys.__vars[vname]\n // console.log(sys.__labels)\n if (fname && sys.__labels[fname]) {\n const no = sys.__labels[fname]\n sys.__call(no, sys)\n return\n } else {\n console.log('vname=', vname, 'label=', fname)\n }\n }\n throw new Error('async error in __callObj::', vname)\n }\n this.__generateSysenv = sys => {\n sys.envid = ( sys.envid == null ? 0 : sys.envid ) + 1\n const sysenv = {\n callstack: [],\n varstack: [],\n varslist: [sys.__varslist[0], sys.__varslist[1], sys.__varslist[2]],\n index: -1,\n nextIndex: -1,\n tryIndex: -1,\n envid: sys.envid\n }\n sysenv.vars = sysenv.varslist[2]\n if (sys.sysenvs == null) { sys.sysenvs={} }\n sys.sysenvs[sys.envid] = sysenv\n // console.log('generete envid '+sys.envid)\n return sysenv\n }\n this.__destroySysenv = (sys, envid) => {\n delete sys.sysenvs[envid]\n // console.log('destroy envid '+envid)\n }\n this.__saveSysenv = sys => {\n const sysenv = sys.curSysenv\n sysenv.callstack = sys.__callstack\n sysenv.varstack = sys.__stack\n sysenv.varslist = sys.__varslist\n sysenv.vars = sys.__vars\n sysenv.index = sys.index\n sysenv.nextIndex = sys.nextIndex\n sysenv.tryIndex = sys.tryIndex\n }\n this.__restoreSysenv = sys => {\n const sysenv = sys.curSysenv\n sys.__callstack = sysenv.callstack\n sys.__stack = sysenv.varstack\n sys.__varslist = sysenv.varslist\n sys.__vars = sysenv.vars\n ___vars = sys.__vars\n sys.index = sysenv.index\n sys.nextIndex = sysenv.nextIndex\n sys.tryIndex = sysenv.tryIndex\n }\n this.setAsync = sys => {\n sys.async = true\n return sys.curSysenv\n }\n this.compAsync = (sys,sysenv) => {\n if (sys.async && sys.curSysenv != null && sysenv != null && sys.curSysenv.envid === sysenv.envid) {\n sys.async = false\n } else {\n if (sys.curSysenv == null || sysenv == null || sys.curSysenv.envid !== sysenv.envid) {\n sys.__saveSysenv(sys)\n const envid = sys.curSysenv.envid\n sys.curSysenv = sysenv\n sys.__restoreSysenv(sys)\n // console.log('switch envid '+envid+' to '+sys.curSysenv.envid)\n }\n sys.nextAsync(sys)\n }\n }\n\n this.__resetAsync(this)\n this.curSysenv = this.__generateSysenv(this)\n this.nextAsync(this)\n //-------------------------\n `,t?"":r}_convGen(e,t){let n="";if(e instanceof Array){for(let s=0;s<e.length;s++){const r=e[s];n+=this._convGen(r,t)}return n}if(null===e)return"null";if(void 0===e)return"undefined";if("object"!=typeof e)return""+e;switch(e.type){case"nop":break;case"comment":e.value||(e.value=""),this.addCode(new m(o,e.value));break;case"eol":this.addCode(new m(c,this.convLineno(e,!0)));break;case"number":this.addCodeStr(`sys.__stack.push(${e.value});//number`);break;case"string":this.convString(e);break;case"word":case"variable":this.convGetVar(e);break;case"op":case"calc":this.convOp(e);break;case"renbun":this.convRenbun(e);break;case"not":this._convGen(e.value,!0),this.addCodeStr("if (sys.__stack.length==0) throw new Error('NOTでスタックに値がありません');sys.__stack[sys.__stack.length-1] = (sys.__stack[sys.__stack.length-1]) ? 0:1");break;case"配列参照":this.convRefArray(e);break;case"json_array":this.convJsonArray(e);break;case"json_obj":this.convJsonObj(e);break;case"bool":{const t=e.value?"true":"false";this.addCodeStr(`sys.__stack.push(${t})`);break}case"null":this.addCodeStr("sys.__stack.push(null)");break;case"func":case"func_pointer":case"calc_func":this.convFunc(e,t);break;case"let":this.convLet(e);break;case"let_array":this.convLetArray(e);break;case"block":for(let t=0;t<e.block.length;t++){const n=e.block[t];this._convGen(n,!1)}break;case"if":this.convIf(e);break;case"repeat_times":this.convRepeatTimes(e);break;case"break":this.addCodeStr(this.convCheckLoop(e,"break"));break;case"continue":this.addCodeStr(this.convCheckLoop(e,"continue"));break;case"for":this.convFor(e);break;case"foreach":this.convForeach(e);break;case"while":this.convWhile(e);break;case"switch":this.convSwitch(e);break;case"return":this.convReturn(e);break;case"end":n+=this.addCodeStr("__varslist[0]['終']();");break;case"def_local_var":this.convDefLocalVar(e);break;case"def_local_varlist":n+=this.addCodeStr(this.convDefLocalVarlist(e));break;case"tikuji":throw s.ih.fromNode("「逐次実行」構文は「!非同期モード」では使えません。",e);case"speed_mode":throw s.ih.fromNode("「速度有線」構文は「!非同期モード」では使えません。",e);case"performance_monitor":this.convPerformanceMonitor(e,t);break;case"func_obj":this.convFuncObj(e);break;case"def_test":this.convDefTest(e);break;case"def_func":n+=this.addCodeStr(this.convDefFunc(e));break;case"try_except":n+=this.convTryExcept(e);break;case"require":n+=this.convRequire(e);break;default:throw new Error("System Error: unknown_type="+e.type)}return n}convRequire(e){const t=new i.Jc(this.com);return this.addCodeStr(t.convRequire(e)),""}addCodeStr(e){if(""===e)return"";const t=e.split("\n").map((e=>" "+e.replace(/\s+$/,""))),n=new m(y,t.join("\n"));return this.addCode(n)}addCode(e){return this.codeArray[this.codeId]=e,this.codeId++,""}makeLabel(e){const t=e+"_"+this.loopId++;return this.makeLabelDirectly(t)}makeLabelDirectly(e){const t=new m(u,e);return this.labels[e]=-1,t}makeJump(e){return new m(a,e.value)}makeJumpIfTrue(e){return new m(f,e.value)}makeJumpIfFalse(e){return new m(l,e.value)}convIf(e){const t=this.makeLabel("もし:ここから"),n=this.makeLabel("もし:ここまで"),s=this.makeLabel("もし:違えば");return this.addCode(t),this._convGen(e.expr,!0),this.addCode(this.makeJumpIfFalse(s)),this._convGen(e.block,!1),this.addCode(this.makeJump(n)),this.addCode(s),e.falseBlock&&this._convGen(e.falseBlock,!1),this.addCode(n),""}convRepeatTimes(e){this.flagLoop=!0,this.varsSet.names.add("回数"),this.varsSet.readonly.add("回数");const t=`sys.__tmp_i${this.loopId}`;this.loopId++;const n=`sys.__tmp_count${this.loopId}`;this.loopId++,this._convGen(e.value,!0),this.addCodeStr(`${n} = sys.__stack.pop(); ${t} = 0;`);const s=this.makeLabel("回:条件チェック");this.addCode(s);const r=this.makeLabel("回:ここまで");this.labelBreak=r,this.labelContinue=s;const i=`sys.__vars["回数"] = ++${t}\nsys.__stack.push(${t} > ${n})\n`;return this.addCodeStr(i),this.addCode(this.makeJumpIfTrue(r)),this.convGenLoop(e.block),this.addCode(this.makeJump(s)),this.addCode(r),this.flagLoop=!1,""}findVar(e){if(this.varsSet.names.has(e))return{i:this.varslistSet.length-1,name:e,isTop:!0,js:`sys.__vars[${JSON.stringify(e)}]`};for(let t=2;t>=0;t--)if(this.varslistSet[t].names.has(e))return{i:t,name:e,isTop:!1,js:`sys.__varslist[${t}][${JSON.stringify(e)}]`};return null}genVar(e,t){const n=this.findVar(e),r=t.line;if(null===n)return"引数"===e||"それ"===e||"対象"===e||"対象キー"===e||"回数"===e||this.__self.getLogger().warn(`変数『${e}』は定義されていません。`,t),this.varsSet.names.add(e),this.varname(e);if(0===n.i){const i=this.__self.getFunc(e);if(!i)return`${n.js}/*err:${r}*/`;if("const"===i.type||"var"===i.type)return n.js;if("func"===i.type){if(!i.josi)throw new Error("[System Error]");if(0===i.josi.length)return`(${n.js}())`;throw s.ih.fromNode(`『${e}』が複文で使われました。単文で記述してください。(v1非互換)`,t)}throw s.ih.fromNode(`『${e}』は関数であり参照できません。`,t)}return n.js}convGetVar(e){const t=e.value;let n=`sys.__vars[${JSON.stringify(t)}]`;const s=this.findVar(t);null!=s&&(n=s.js),this.addCodeStr(`sys.__stack.push(${n});`)}convComment(e){let t=String(e.value);t=t.replace(/\n/g,"¶");const n=this.convLineno(e,!1);return""===t&&""===n?";":""===t?";"+n+"\n":";"+n+"//"+t+"\n"}convReturn(e){if(this.varsSet.names.has("!関数"))throw s.ih.fromNode("『戻る』がありますが、関数定義内のみで使用可能です。",e);return e.value&&(this._convGen(e.value,!0),this.addCodeStr('sys.__vars["それ"] = sys.__stack.pop()')),this.addCode(new m(d,"")),""}convCheckLoop(e,t){if(!this.flagLoop){const n="continue"===t?"続ける":"抜ける";throw s.ih.fromNode(`『${n}』文がありますが、それは繰り返しの中で利用してください。`,e)}return"continue"===t?this.labelContinue&&this.addCode(this.makeJump(this.labelContinue)):this.labelBreak&&this.addCode(this.makeJump(this.labelBreak)),""}convDefFuncCommon(e,t){const n=""===t;let s=t;n&&(s="無名関数:"+this.loopId++);const r=this.makeLabel(`関数「${s}」:ここまで`);this.addCode(this.makeJump(r));const i=this.makeLabelDirectly(s);i.tag=15,this.addCode(i);const o=new Set;this.varsSet={isFunction:!0,names:o,readonly:new Set},this.varsSet.names.add("それ"),this.varslistSet.push(this.varsSet);const u=n?e.meta:e.name.meta;let c="",a="";c+=`//関数『${s}』の初期化処理\n`,c+="// 引数をローカル変数として登録\n";for(let e=u.varnames.length-1;e>=0;e--){const t=u.varnames[e];c+=` ${this.varname(t)} = sys.__stack.pop();\n`,this.varsSet.names.add(t),a+=""}return c+="// ここまで:引数をローカル変数として登録\n",this.addCodeStr(c),this.usedFuncSet.add(s),this.varslistSet[1].names.add(s),this.nakoFuncList[s]={josi:u.josi,fn:`(function(){\n const sys = (arguments.length > 0) ? arguments[arguments.length-1] : {}; \n if (sys.newenv) { \n sys.newenv = false\n sys.__callNakoCodeEntry(sys.__labels['${s}'], sys);\n } else {\n `+a+"\n"+` sys.__callNakoCode(sys.__labels['${s}'], sys.nextIndex, sys);\n if (!sys.inLoop) { sys.nextAsync(sys) }\n } })`,type:"func"},this._convGen(e.block,!1),this.varslistSet.pop(),this.varsSet=this.varslistSet[this.varslistSet.length-1],this.__self.__varslist[1][s]=function(){},this.addCode(new m(d,"")),this.addCode(r),t||this.addCodeStr(`sys.__stack.push('${s}')`),""}convDefTest(e){throw s.ih.fromNode("テスト構文は!非同期モードでは使えません。",e)}convDefFunc(e){const t=i.Jc.getFuncName(e.name.value);return this.convDefFuncCommon(e,t),""}convFuncObj(e){return this.convDefFuncCommon(e,"")}convJsonObj(e){const t=e.value,n="sys.__tmp_obj"+this.loopId++;return this.addCodeStr(n+"={}; // convJsonObj::ここから"),t.forEach((e=>{this._convGen(e.value,!0),this._convGen(e.key,!0),this.addCodeStr(`${n}[sys.__stack.pop()]=sys.__stack.pop()`)})),this.addCodeStr(`this.__stack.push(${n}); delete $objName; // convJsonObj::ここまで`),""}convJsonArray(e){const t=e.value;this.addCode(this.makeLabel("convJsonArray::ここから")),t.forEach((e=>this._convGen(e,!0)));const n=t.length;return this.addCodeStr(`sys.__stack.push(sys.__stack.splice(sys.__stack.length-${n},${n}))`),""}convRefArray(e){this._convGen(e.name,!0);const t=e.index;for(let e=0;e<t.length;e++)this._convGen(t[e],!0),this.addCodeStr("const idx = sys.__stack.pop();\nconst obj = sys.__stack.pop();\nsys.__stack.push(obj[idx]);");return""}convLetArray(e){this._convGen(e.value,!0),this._convGen(e.name,!0);const t=e.index;for(let e=0;e<t.length;e++){if(this._convGen(t[e],!0),e===t.length-1){this.addCodeStr("const idx = this.__stack.pop();const obj = this.__stack.pop();const val = this.__stack.pop();obj[idx]=val;");break}this.addCodeStr("const idx = sys.__stack.pop();\nconst obj = sys.__stack.pop();\nsys.__stack.push(obj[idx]);")}return""}convGenLoop(e){const t=this.flagLoop;this.flagLoop=!0;try{return this._convGen(e,!1)}finally{this.flagLoop=t}}convFor(e){let t;if(this.flagLoop=!0,null!==e.word){const n=e.word.value;this.varsSet.names.add(n),t=this.varname(n)}else this.varsSet.names.add("dummy"),t=this.varname("dummy");const n=this.varname("それ"),s=this.loopId++,r=`sys.__tmp__i${s}`,i=`sys.__tmp__to${s}`;this._convGen(e.from,!0),this._convGen(e.to,!0),this.addCodeStr(`${i}=sys.__stack.pop();${r}=sys.__stack.pop();`),this.addCodeStr(`${n} = ${t} = ${r}`);const o=this.makeLabel("繰返:条件確認"),u=this.makeLabel("繰返:加算");this.addCode(o);const c=this.makeLabel("繰返:ここまで");return this.addCodeStr(`sys.__stack.push(${t} <= ${i})`),this.addCode(this.makeJumpIfFalse(c)),this.labelContinue=u,this.labelBreak=c,this.convGenLoop(e.block),this.addCode(u),this.addCodeStr(`${n} = ++${t};`),this.addCode(this.makeJump(o)),this.addCode(c),this.addCodeStr(`delete ${r};delete ${i};//繰返:掃除`),this.flagLoop=!1,""}convForeach(e){this.flagLoop=!0;let t='__v0["対象"]';e.name&&(t=this.varname(e.name.value),this.varsSet.names.add(e.name.value));if(null===e.target)throw s.ih.fromNode("『反復』の対象がありません。",e);const n=this.varname("それ"),r="sys.__tmp__target"+this.loopId++,i="sys.__tmp__keys"+this.loopId++,o="sys.__tmp__i"+this.loopId++,u="sys.__tmp__count"+this.loopId++;this._convGen(e.target,!0);const c=`// 反復: 初期化\n${r} = sys.__stack.pop();\n${o} = 0;\nif (typeof(${r}) == 'string' || typeof(${r}) == 'number') { ${r} = [${r}]; }\nif (${r} instanceof Array) { ${u} = ${r}.length; }\nelse { // キーの一覧を得る\n ${i} = Object.keys(${r}); \n // hasOwnPropertyがfalseならばkeyを消す処理\n ${i} = ${i}.filter((key)=>{ return ${r}.hasOwnProperty(key) })\n ${u} = ${i}.length;\n}\n`;this.addCodeStr(c);const a=this.makeLabel("反復:条件確認"),f=this.makeLabel("反復:加算"),l=this.makeLabel("反復:ここまで");this.labelBreak=l,this.labelContinue=f,this.addCode(a);const h=`if (${r} instanceof Array) {\n ${t} = ${n} = ${r}[${o}]; __v0["対象キー"] = ${o};\n} else {\n __v0["対象キー"] = ${i}[${o}]; ${t} = ${n} = ${r}[__v0["対象キー"]];\n}\n`;return this.addCodeStr(`${h}\nsys.__stack.push(${o} < ${u});`),this.addCode(this.makeJumpIfFalse(l)),this.convGenLoop(e.block),this.addCode(f),this.addCodeStr(`${o}++`),this.addCode(this.makeJump(a)),this.addCode(l),this.flagLoop=!1,""}convWhile(e){this.flagLoop=!0;const t=this.makeLabel("間:ここから"),n=this.makeLabel("間:ここまで");return this.labelContinue=t,this.labelBreak=n,this.addCode(t),this._convGen(e.cond,!0),this.addCode(this.makeJumpIfFalse(n)),this.convGenLoop(e.block),this.addCode(this.makeJump(t)),this.addCode(n),this.flagLoop=!1,""}convSpeedMode(e,t){return""}convPerformanceMonitor(e,t){const n={...this.performanceMonitor};e.options["ユーザ関数"]&&this.performanceMonitor.userFunction++,e.options["システム関数本体"]&&this.performanceMonitor.systemFunctionBody++,e.options["システム関数"]&&this.performanceMonitor.systemFunction++,this._convGen(e.block,t),this.performanceMonitor=n}convSwitch(e){this._convGen(e.value,!0);const t="sys.__tmp__i"+this.loopId++;this.addCodeStr(`${t} = sys.__stack.pop()`);const n=this.makeLabel("条件分岐:ここまで"),s=e.cases;for(let e=0;e<s.length;e++){const r=s[e][0];if("違えば"===r.type)this.convGenLoop(s[e][1]);else{const i=this.makeLabel("条件分岐:次");this._convGen(r,!0),this.addCodeStr(`sys.__stack.push(sys.__stack.pop() == ${t})`),this.addCode(this.makeJumpIfFalse(i)),this.convGenLoop(s[e][1]),this.addCode(this.makeJump(n)),this.addCode(i)}}return this.addCode(n),this.addCodeStr(`delete ${t}//条件分岐:掃除`),""}convFuncGetArgsCalcType(e,t,n){const s={};for(let e=0;e<n.args.length;e++){const t=n.args[e];0===e&&null===t?(this.addCodeStr("sys.__stack.push(sys.__vars['それ'])"),s.sore=!0):this._convGen(t,!0)}return s}getPluginList(){const e=[];for(const t in this.__self.__module)e.push(t);return e}convFunc(e,t){let n=!1,r=!1;const o=i.Jc.getFuncName(e.name),u=this.findVar(o);if(null===u)throw s.ih.fromNode(`関数『${o}』が見当たりません。有効プラグイン=[`+this.getPluginList().join(", ")+"]",e);let c;if(0===u.i){if(c=this.__self.getFunc(o),"func"!==c.type)throw s.ih.fromNode(`『${o}』は関数ではありません。`,e);n=!0}else c=this.nakoFuncList[o],void 0===c&&(r=!0,c={return_none:!1});if("func_pointer"===e.type)return u.js;const a=this.convFuncGetArgsCalcType(o,c,e);this.usedFuncSet.add(o);let f="",l="";e.setter&&(f+=";__self.isSetter = true;\n",l+=";__self.isSetter = false;\n"),a.sore&&(f+="/*[sore]*/");const d=e.args.length;let _="";n?(_+=f,_+=`const args = sys.__stack.splice(sys.__stack.length - ${d}, ${d});\n`,_+="args.push(sys);\n",_+=`const ret = ${u.js}.apply(sys, args);\n`,c.return_none||(_+="sys.__vars['それ'] = ret;\n",t&&(_+="sys.__stack.push(ret);\n")),_+=l,this.addCodeStr(_)):(r?this.addCode(new m(p,o)):this.addCode(new m(h,o)),t||this.addCodeStr("sys.__stack.pop();// 戻り値を利用しない関数呼出"))}convRenbun(e){this._convGen(e.left,!1),this._convGen(e.right,!0)}convOp(e){const t={"&":'+""+',eq:"==",noteq:"!=","===":"===","!==":"!==",gt:">",lt:"<",gteq:">=",lteq:"<=",and:"&&",or:"||",shift_l:"<<",shift_r:">>",shift_r0:">>>","÷":"/"},n=e.operator;this._convGen(e.left,!0),this._convGen(e.right,!0);let s="const rv = sys.__stack.pop();\nconst lv = sys.__stack.pop();\n";if("^"===n)s+="const v = (Math.pow(lv, rv))\n";else{s+=`const v = ((lv) ${t[n]||n} (rv));\n`}s+=`sys.__stack.push(v); //op:${n}\n`,this.addCodeStr(s)}convLet(e){let t="";null===e.value?this.addCodeStr("sys.__stack.push(sys.__vars['それ'])"):this._convGen(e.value,!0);const n=e.name.value,r=this.findVar(n);if(null===r)this.varsSet.names.add(n),t=`${this.varname(n)}=sys.__stack.pop();`;else{if(this.varslistSet[r.i].readonly.has(n))throw s.ih.fromNode(`定数『${n}』は既に定義済みなので、値を代入することはできません。`,e);t=`${r.js}=sys.__stack.pop();`}this.addCodeStr(t+"//let")}convDefLocalVar(e){null===e.value?this.addCodeStr("sys.__stack.push(null)"):this._convGen(e.value,!0);const t=e.name.value,n=e.vartype;if(this.varsSet.names.has(t))throw s.ih.fromNode(`${n}『${t}』の二重定義はできません。`,e);return this.varsSet.names.add(t),"定数"===n&&this.varsSet.readonly.add(t),this.addCodeStr(`${this.varname(t)}=sys.__stack.pop()`),""}convDefLocalVarlist(e){const t=e.vartype;null===e.value?this.addCodeStr("sys.__stack.push(null)"):this._convGen(e.value,!0);const n=`sys.__tmp_i${this.loopId}`;this.loopId++,this.addCodeStr(`${n}=sys.__stack.pop();if (!(${n} instanceof Array)) { ${n}=[${n}] }`);for(const r of e.names){const i=r.value;if(this.varsSet.names.has(i))throw s.ih.fromNode(`${t}『${i}』の二重定義はできません。`,e);this.varsSet.names.add(i),"定数"===t&&this.varsSet.readonly.add(i);const o=this.varname(i);this.addCodeStr(`${o}=${n}.pop()`)}return this.addCodeStr(`delete ${n}//複数代入:掃除`),""}convString(e){let t=""+e.value;const n=e.mode;if(t=t.replace(/\\/g,"\\\\"),t=t.replace(/"/g,'\\"'),t=t.replace(/\r/g,"\\r"),t=t.replace(/\n/g,"\\n"),"ex"===n)throw new Error("[システムエラー] ジェネレーターでの文字列の展開はサポートしていません");return this.addCodeStr(`sys.__stack.push("${t}")//string`),'"'+t+'"'}convTryExcept(e){const t=this.makeLabel("エラー監視:ならば"),n=this.makeLabel("エラー監視:ここまで");this.addCode(new m(_,t.value)),this._convGen(e.block,!1),this.addCode(this.makeJump(n)),this.addCode(t),this._convGen(e.errBlock,!1),this.addCode(n)}}if("object"==typeof navigator&&"object"==typeof navigator.nako3){const e=navigator.nako3;e.addCodeGenerator&&e.addCodeGenerator("非同期モード",g)}},5564:function(e,t,n){n.r(t),n.d(t,{josiList:function(){return s},josiRE:function(){return c},removeJosiList:function(){return i},removeJosiMap:function(){return u},tararebaJosiList:function(){return r},tararebaMap:function(){return o}});const s=["について","くらい","なのか","までを","までの","による","とは","から","まで","だけ","より","ほど","など","いて","えて","きて","けて","して","って","にて","みて","めて","ねて","では","には","は~","んで","ずつ","は","を","に","へ","で","と","が","の"],r=["でなければ","なければ","ならば","なら","たら","れば"],i=["こと","である","です","します","でした"],o={};r.forEach((e=>{s.push(e),o[e]=!0}));const u={};i.forEach((e=>{s.push(e),u[e]=!0})),s.sort(((e,t)=>t.length-e.length));const c=new RegExp("^[\\t ]*("+s.join("|")+")")},4392:function(e,t,n){n.d(t,{S:function(){return y}});var s=n(9493),r=n(9078),i=n(5564);const o=/^[\u3005\u4E00-\u9FCF_a-zA-Z0-9ァ-ヶー\u2460-\u24FF\u2776-\u277F\u3251-\u32BF]+/,u=/^[ぁ-ん]/,c=/^[ぁ-ん]+$/,a=/^.+(以上|以下|超|未満)$/,f=e=>function(){throw new Error("突然の『"+e+"』があります。")},l=/^(円|ドル|元|歩|㎡|坪|度|℃|°|個|つ|本|冊|才|歳|匹|枚|皿|セット|羽|人|件|行|列|機|品|m|mm|cm|km|g|kg|t|px|dot|pt|em|b|mb|kb|gb)/,h=[{name:"ここまで",pattern:/^;;;/},{name:"eol",pattern:/^\n/},{name:"eol",pattern:/^;/},{name:"space",pattern:/^(\x20|\x09|・)+/},{name:"comma",pattern:/^,/},{name:"line_comment",pattern:/^#[^\n]*/},{name:"line_comment",pattern:/^\/\/[^\n]*/},{name:"range_comment",pattern:/^\/\*/,cbParser:function(e){let t="";let n=0;const s=(e=e.substring(2)).indexOf("*/");s<0?(t=e,e=""):(t=e.substring(0,s),e=e.substring(s+2));for(let e=0;e<t.length;e++)"\n"===t.charAt(e)&&n++;return t=t.replace(/(^\s+|\s+$)/,""),{src:e,res:t,josi:"",numEOL:n}}},{name:"def_test",pattern:/^●テスト:/},{name:"def_func",pattern:/^●/},{name:"number",pattern:/^0[xX][0-9a-fA-F]+(_[0-9a-fA-F]+)*/,readJosi:!0,cb:d},{name:"number",pattern:/^0[oO][0-7]+(_[0-7]+)*/,readJosi:!0,cb:d},{name:"number",pattern:/^0[bB][0-1]+(_[0-1]+)*/,readJosi:!0,cb:d},{name:"number",pattern:/^\d+(_\d+)*\.(\d+(_\d+)*)?([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:d},{name:"number",pattern:/^\.\d+(_\d+)*([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:d},{name:"number",pattern:/^\d+(_\d+)*([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:d},{name:"ここから",pattern:/^(ここから),?/},{name:"ここまで",pattern:/^(ここまで|💧)/},{name:"もし",pattern:/^もしも?/},{name:"違えば",pattern:/^違(えば)?/},{name:"shift_r0",pattern:/^>>>/},{name:"shift_r",pattern:/^>>/},{name:"shift_l",pattern:/^<</},{name:"===",pattern:/^===/},{name:"!==",pattern:/^!==/},{name:"gteq",pattern:/^(≧|>=|=>)/},{name:"lteq",pattern:/^(≦|<=|=<)/},{name:"noteq",pattern:/^(≠|<>|!=)/},{name:"←",pattern:/^(←|<--)/},{name:"eq",pattern:/^(=|🟰)/},{name:"line_comment",pattern:/^(!|💡)(インデント構文|ここまでだるい)[^\n]*/},{name:"not",pattern:/^(!|💡)/},{name:"gt",pattern:/^>/},{name:"lt",pattern:/^</},{name:"and",pattern:/^(かつ|&&)/},{name:"or",pattern:/^(または|或いは|あるいは|\|\|)/},{name:"@",pattern:/^@/},{name:"+",pattern:/^\+/},{name:"-",pattern:/^-/},{name:"*",pattern:/^(×|\*)/},{name:"÷÷",pattern:/^÷÷/},{name:"÷",pattern:/^(÷|\/)/},{name:"%",pattern:/^%/},{name:"^",pattern:/^\^/},{name:"&",pattern:/^&/},{name:"[",pattern:/^\[/},{name:"]",pattern:/^]/,readJosi:!0},{name:"(",pattern:/^\(/},{name:")",pattern:/^\)/,readJosi:!0},{name:"|",pattern:/^\|/},{name:"string",pattern:/^🌿/,cbParser:e=>p("🌿","🌿",e)},{name:"string_ex",pattern:/^🌴/,cbParser:e=>p("🌴","🌴",e)},{name:"string_ex",pattern:/^「/,cbParser:e=>p("「","」",e)},{name:"string",pattern:/^『/,cbParser:e=>p("『","』",e)},{name:"string_ex",pattern:/^“/,cbParser:e=>p("“","”",e)},{name:"string_ex",pattern:/^"/,cbParser:e=>p('"','"',e)},{name:"string",pattern:/^'/,cbParser:e=>p("'","'",e)},{name:"」",pattern:/^」/,cbParser:f("」")},{name:"』",pattern:/^』/,cbParser:f("』")},{name:"func",pattern:/^\{関数\},?/},{name:"{",pattern:/^\{/},{name:"}",pattern:/^\}/,readJosi:!0},{name:":",pattern:/^:/},{name:"_eol",pattern:/^_\s*\n/},{name:"dec_lineno",pattern:/^‰/},{name:"word",pattern:/^[\uD800-\uDBFF][\uDC00-\uDFFF][_a-zA-Z0-9]*/,readJosi:!0},{name:"word",pattern:/^[\u1F60-\u1F6F][_a-zA-Z0-9]*/,readJosi:!0},{name:"word",pattern:/^《.+?》/,readJosi:!0},{name:"word",pattern:/^[_a-zA-Z\u3005\u4E00-\u9FCFぁ-んァ-ヶ\u2460-\u24FF\u2776-\u277F\u3251-\u32BF]/,cbParser:function(e,t=!0){let n="",s="";for(;""!==e;){if(n.length>0){const t=i.josiRE.exec(e);if(t){s=t[0].replace(/^\s+/,""),","===(e=e.substr(t[0].length)).charAt(0)&&(e=e.substr(1));break}}const t=o.exec(e);if(t){n+=t[0],e=e.substr(t[0].length);continue}if(!u.test(e))break;n+=e.charAt(0),e=e.substr(1)}/[ぁ-ん]間$/.test(n)&&(e=n.charAt(n.length-1)+e,n=n.slice(0,-1));const r=a.exec(n);r&&(e=r[1]+s+e,s="",n=n.substr(0,n.length-r[1].length));i.removeJosiMap[s]&&(s="");t&&(n=function(e){if(!u.test(e))return e.replace(/[ぁ-ん]+/g,"");if(c.test(e))return e;return e.replace(/[ぁ-ん]+$/g,"")}(n));""===n&&""!==s&&(n=s,s="");return{src:e,res:n,josi:s,numEOL:0}}}];function p(e,t,n){let s="",r="",o=0;const u=(n=n.substr(e.length)).indexOf(t);if(u<0)s=n,n="";else if(s=n.substr(0,u),n=n.substr(u+t.length),s.indexOf(e)>=0)throw"『"===e?new Error("「『」で始めた文字列の中に「『」を含めることはできません。"):new Error(`『${e}』で始めた文字列の中に『${e}』を含めることはできません。`);const c=i.josiRE.exec(n);c&&(r=c[0].replace(/^\s+/,""),","===(n=n.substr(c[0].length)).charAt(0)&&(n=n.substr(1))),i.removeJosiMap[r]&&(r="");for(let e=0;e<s.length;e++)"\n"===s.charAt(e)&&o++;return{src:n,res:s,josi:r,numEOL:o}}function d(e){return Number(e.replace(/_/g,""))}var _=n(5154);class y{constructor(e){this.logger=e,this.funclist={},this.modList=[],this.result=[],this.modName="inline"}setFuncList(e){this.funclist=e}replaceTokens(e,t,n){if(this.result=e,this.modName=y.filenameToModName(n),y.preDefineFunc(e,this.logger,this.funclist),this._replaceWord(this.result),t)if(this.result.length>0){const e=this.result[this.result.length-1];this.result.push({type:"eol",line:e.line,column:0,file:e.file,josi:"",value:"---",startOffset:e.startOffset,endOffset:e.endOffset,rawJosi:""}),this.result.push({type:"eof",line:e.line,column:0,file:e.file,josi:"",value:"",startOffset:e.startOffset,endOffset:e.endOffset,rawJosi:""})}else this.result.push({type:"eol",line:0,column:0,file:"",josi:"",value:"---",startOffset:0,endOffset:0,rawJosi:""}),this.result.push({type:"eof",line:0,column:0,file:"",josi:"",value:"",startOffset:0,endOffset:0,rawJosi:""});return this.result}static preDefineFunc(e,t,n){let s=0,i=!1;const o=()=>{const t=[],n={};if("("!==e[s].type)return[];for(s++;e[s];){const r=e[s];if(s++,")"===r.type)break;"func"===r.type?i=!0:"|"!==r.type&&"comma"!==r.type&&(i&&(r.funcPointer=!0,i=!1),t.push(r),n[r.value]||(n[r.value]=[]),n[r.value].push(r.josi))}const r=[],o=[],u=[],c={};for(const e of t)if(!c[e.value]){const t=n[e.value];u.push(t),r.push(e.value),e.funcPointer?o.push(e.value):o.push(null),c[e.value]=!0}return[u,r,o]};for(;s<e.length;){const i=e[s];if("word"===i.type&&"には"===i.josi||"word"===i.type&&"は~"===i.josi){i.josi="には",e.splice(s+1,0,{type:"def_func",value:"関数",line:i.line,column:i.column,file:i.file,josi:"",startOffset:i.endOffset,endOffset:i.endOffset,rawJosi:"",tag:"無名関数"}),s++;continue}if("word"===i.type&&""===i.josi&&i.value.length>=2&&i.value.match(/回$/)){i.value=i.value.substring(0,i.value.length-1),i.endOffset||(i.endOffset=1);const t={type:"回",value:"回",line:i.line,column:i.column,file:i.file,josi:"",startOffset:i.endOffset-1,endOffset:i.endOffset,rawJosi:""};e.splice(s+1,0,t),i.endOffset--,s++}if("word"===i.type&&r.default[i.value]&&(i.type=r.default[i.value],"そう"===i.value&&(i.value="それ")),"def_test"!==i.type&&"def_func"!==i.type){s++;continue}let u=!0,c={type:"eol"};s>=1&&(c=e[s-1]),"eol"===c.type&&(u=!1);const a=i;s++;let f=[],l=[],h=[],p="",d=null;if(e[s]&&"("===e[s].type&&([f,l,h]=o()),!u&&e[s]&&"word"===e[s].type&&(d=e[s++],p=d.value),0===f.length&&e[s]&&"("===e[s].type&&([f,l,h]=o()),""!==p&&d){if(p=y.filenameToModName(i.file)+"__"+p,p in n){const e=p.replace(/^main__/,"");t.warn(`関数『${e}』は既に定義されています。`,a)}d.value=p,n[p]={type:"func",josi:f,fn:null,asyncFn:!1,varnames:l,funcPointers:h}}a.meta={type:"func",josi:f,varnames:l,funcPointers:h}}}splitStringEx(e){const t=[],n=e.split(/[{{]/);t.push(n[0]);for(const e of n.slice(1)){const n=e.replace("}","}").indexOf("}");if(-1===n)return null;t.push(e.slice(0,n),e.slice(n+1))}return t}_replaceWord(e){let t=[],n=0;const r=e.length>0?y.filenameToModName(e[0].file):"inline";for(;n<e.length;){const o=e[n];if("word"===o.type&&"それ"!==o.value){const e=o.value;if(e.indexOf("__")<0){const t=`${r}__${e}`,n=this.funclist[t];if(n&&"func"===n.type){o.type="func",o.meta=n,o.value=t;continue}for(const t of this.modList){const n=`${t}__${e}`,s=this.funclist[n];if(s&&"func"===s.type){o.type="func",o.meta=s,o.value=n;break}}if("func"===o.type)continue}const t=this.funclist[e];t&&"func"===t.type&&(o.type="func",o.meta=t)}if("-"===o.type&&e[n+1]&&"number"===e[n+1].type){const t=n<=0?"eol":e[n-1].type;("eol"===t||s.bW[t]||""!==e[n-1].josi)&&(e.splice(n,1),e[n].value*=-1)}if(void 0===o.josi&&(o.josi=""),"は"!==o.josi)if("とは"!==o.josi)if(i.tararebaMap[o.josi]){const t="でなければ"===o.josi||"なければ"===o.josi?"でなければ":"ならば";o.rawJosi||(o.rawJosi=t);const s=void 0===o.endOffset?void 0:o.endOffset-o.rawJosi.length;e.splice(n+1,0,{type:"ならば",value:t,line:o.line,column:o.column,file:o.file,startOffset:s,endOffset:o.endOffset,josi:"",rawJosi:""}),o.josi=o.rawJosi="",o.endOffset=s,n+=2}else"_eol"!==o.type?"line_comment"!==o.type&&"range_comment"!==o.type?("eol"===o.type&&(o.value=t.join("/"),t=[]),n++):(t.push(o.value),e.splice(n,1)):e.splice(n,1);else{o.rawJosi||(o.rawJosi=o.josi);const t=void 0===o.endOffset?void 0:o.endOffset-o.rawJosi.length;e.splice(n+1,0,{type:o.josi,line:o.line,column:o.column,file:o.file,startOffset:t,endOffset:o.endOffset,josi:"",rawJosi:"",value:void 0}),o.josi=o.rawJosi="",o.endOffset=t,n+=2}else{o.rawJosi||(o.rawJosi=o.josi);const t=void 0===o.endOffset?void 0:o.endOffset-o.rawJosi.length;e.splice(n+1,0,{type:"eq",line:o.line,column:o.column,file:o.file,startOffset:t,endOffset:o.endOffset,josi:"",rawJosi:"",value:void 0}),n+=2,o.josi=o.rawJosi="",o.endOffset=t}}}tokenize(e,t,n){const s=e.length,r=[];let o,u,c=1,a=!1;for(;""!==e;){let f=!1;for(const p of h){const h=p.pattern.exec(e);if(!h)continue;if(f=!0,"space"===p.name){c+=h[0].length,e=e.substring(h[0].length);continue}if(p.cbParser){let i;if(a&&"word"===p.name)i=p.cbParser(e,!1);else try{i=p.cbParser(e)}catch(r){throw new _.tO(r.message,s-e.length,s-e.length+1,t,n)}if("string_ex"===p.name){const o=this.splitStringEx(i.res);if(null===o)throw new _.cg("展開あり文字列で値の埋め込み{...}が対応していません。",s-e.length,s-i.src.length,t,n);let u=0;for(let a=0;a<o.length;a++){const f=a===o.length-1?i.josi:"";a%2==0?(r.push({type:"string",value:o[a],file:n,josi:f,line:t,column:c,preprocessedCodeOffset:s-e.length+u,preprocessedCodeLength:o[a].length+2+f.length}),u+=o[a].length+2):(r.push({type:"&",value:"&",josi:"",file:n,line:t,column:c,preprocessedCodeOffset:s-e.length+u,preprocessedCodeLength:0}),r.push({type:"(",value:"(",josi:"",file:n,line:t,column:c,preprocessedCodeOffset:s-e.length+u,preprocessedCodeLength:0}),r.push({type:"code",value:o[a],josi:"",file:n,line:t,column:c,preprocessedCodeOffset:s-e.length+u,preprocessedCodeLength:o[a].length}),r.push({type:")",value:")",josi:"",file:n,line:t,column:c,preprocessedCodeOffset:s-e.length+u+o[a].length,preprocessedCodeLength:0}),r.push({type:"&",value:"&",josi:"",file:n,line:t,column:c,preprocessedCodeOffset:s-e.length+u+o[a].length,preprocessedCodeLength:0}),u+=o[a].length)}t+=i.numEOL,c+=e.length-i.src.length,e=i.src,i.numEOL>0&&(c=1);break}o=c,c+=e.length-i.src.length,r.push({type:p.name,value:i.res,josi:i.josi,line:t,column:o,file:n,preprocessedCodeOffset:s-e.length,preprocessedCodeLength:e.length-i.src.length}),e=i.src,t+=i.numEOL,i.numEOL>0&&(c=1);break}const d=s-e.length;let y=h[0];if(p.cb&&(y=p.cb(y)),o=c,u=t,c+=h[0].length,e=e.substring(h[0].length),("eol"===p.name&&"\n"===y||"_eol"===p.name)&&(y=t++,c=1),"number"===p.name){const t=l.exec(e);t&&(e=e.substring(t[0].length),c+=h[0].length)}let m="";if(p.readJosi){const t=i.josiRE.exec(e);t&&(m=t[0].replace(/^\s+/,""),c+=t[0].length,","===(e=e.substring(t[0].length)).charAt(0)&&(e=e.substring(1)),i.removeJosiMap[m]&&(m=""))}switch(p.name){case"def_test":a=!0;break;case"eol":a=!1}if("dec_lineno"!==p.name){r.push({type:p.name,value:y,line:u,column:o,file:n,josi:m,preprocessedCodeOffset:d,preprocessedCodeLength:s-e.length-d});break}t--}if(!f)throw new _.cg("未知の語句: "+e.substring(0,3)+"...",s-e.length,s-s+3,t,n)}return r}static tokensToTypeStr(e,t){return e.map((e=>e.type)).join(t)}static filenameToModName(e){if(!e)return"inline";if((e=e.replace(/[\\:]/g,"/")).indexOf("/")>=0){const t=e.split("/");e=t[t.length-1]}return e=e.replace(/\.nako3?$/,"")}}},9493:function(e,t,n){n.d(t,{Ij:function(){return i},QQ:function(){return r},bW:function(){return s}});const s={and:1,or:1,eq:2,noteq:2,"===":2,"!==":2,gt:2,gteq:2,lt:2,lteq:2,"&":3,"+":4,"-":4,shift_l:4,shift_r:4,shift_r0:4,"*":5,"/":5,"÷":5,"÷÷":5,"%":5,"^":6},r=["いて","えて","きて","けて","して","って","にて","みて","めて","ねて","には","んで"],i=[];for(const e in s)i.push(e)},9078:function(e,t,n){n.r(t);t.default={"回":"回","回繰返":"回","間":"間","間繰返":"間","繰返":"繰返","増繰返":"増繰返","減繰返":"減繰返","後判定":"後判定","反復":"反復","抜":"抜ける","続":"続ける","戻":"戻る","先":"先に","次":"次に","代入":"代入","実行速度優先":"実行速度優先","パフォーマンスモニタ適用":"パフォーマンスモニタ適用","定":"定める","逐次実行":"逐次実行","条件分岐":"条件分岐","増":"増","減":"減","変数":"変数","定数":"定数","エラー監視":"エラー監視","エラー":"エラー","それ":"word","そう":"word","関数":"def_func","インデント構文":"インデント構文","非同期モード":"非同期モード","DNCLモード":"DNCLモード","モード設定":"モード設定","取込":"取込"}},4085:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){var _nako_errors_mjs__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(5154);__webpack_exports__.Z={meta:{type:"const",value:{pluginName:"plugin_system",pluginVersion:"3.3.38",nakoRuntime:["wnako","cnako","phpnako"],nakoVersion:"^3.3.38"}},"初期化":{type:"func",josi:[],pure:!1,fn:function(e){e.__v0["ナデシコバージョン"]=e.version,e.__v0["ナデシコ言語バージョン"]=e.coreVersion,e.__findVar=function(t,n){if("function"==typeof t)return t;if(e.__locals[t])return e.__locals[t];const s=void 0!==e.__modName?e.__modName:"inline",r=t.indexOf("__")>=0?t:s+"__"+t;for(let t=2;t>=0;t--){const n=e.__varslist[t];if(n[r])return n[r]}return n},e.__findFunc=function(t,n){const s=e.__findVar(t);if("function"==typeof s)return s;throw new Error(`『${n}』に実行できない関数が指定されました。`)},e.__exec=function(t,n){const s=e.__v0[t];if(s)return s.apply(this,n);const r=e.__findVar(t);if(!r)throw new Error("システム関数でエイリアスの指定ミス:"+t);return r.apply(this,n)},e.__timeout=[],e.__interval=[];const t=e.__zero2=e=>(e="00"+e).substring(e.length-2);e.__zero=(e,t)=>{let n="";for(let e=0;e<t;e++)n+="0";return(e=n+e).substring(e.length-t)},e.__formatDate=e=>e.getFullYear()+"/"+t(e.getMonth()+1)+"/"+t(e.getDate()),e.__formatTime=e=>t(e.getHours())+":"+t(e.getSeconds())+":"+t(e.getMinutes()),e.__formatDateTime=(e,n)=>{const s=e.getFullYear()+"/"+t(e.getMonth()+1)+"/"+t(e.getDate()),r=t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds());return n.match(/^\d+\/\d+\/\d+\s+\d+:\d+:\d+$/)?s+" "+r:n.match(/^\d+\/\d+\/\d+$/)?s:n.match(/^\d+:\d+:\d+$/)?r:s+" "+r},e.__str2date=e=>{if((e=(""+e).replace(/(^\s+|\s+$)/,"")).match(/^(\d+|\d+\.\d+)$/))return new Date(1e3*parseFloat(e));if(e.match(/^\d+:\d+(:\d+)?$/)){const t=new Date,n=(e+":0").split(":");return new Date(t.getFullYear(),t.getMonth(),t.getDate(),parseInt(n[0]),parseInt(n[1]),parseInt(n[2]))}e=e.replace(/[\s:-]/g,"/");const t=(e+="/0/0/0").split("/");return new Date(parseInt(t[0]),parseInt(t[1])-1,parseInt(t[2]),parseInt(t[3]),parseInt(t[4]),parseInt(t[5]))},e.__printPool=""}},"!クリア":{type:"func",josi:[],pure:!1,fn:function(e){e.__exec("全タイマー停止",[e]),"非同期モード"===e.__genMode&&e.__stopAsync(e)}},"ナデシコバージョン":{type:"const",value:"?"},"ナデシコ言語バージョン":{type:"const",value:"?"},"ナデシコエンジン":{type:"const",value:"nadesi.com/v3"},"ナデシコ種類":{type:"const",value:"?"},"はい":{type:"const",value:1},"いいえ":{type:"const",value:0},"真":{type:"const",value:1},"偽":{type:"const",value:0},"永遠":{type:"const",value:1},"オン":{type:"const",value:1},"オフ":{type:"const",value:0},"改行":{type:"const",value:"\n"},"タブ":{type:"const",value:"\t"},"カッコ":{type:"const",value:"「"},"カッコ閉":{type:"const",value:"」"},"波カッコ":{type:"const",value:"{"},"波カッコ閉":{type:"const",value:"}"},OK:{type:"const",value:!0},NG:{type:"const",value:!1},"キャンセル":{type:"const",value:0},PI:{type:"const",value:Math.PI},"空":{type:"const",value:""},NULL:{type:"const",value:null},undefined:{type:"const",value:void 0},"未定義":{type:"const",value:void 0},"エラーメッセージ":{type:"const",value:""},"対象":{type:"const",value:""},"対象キー":{type:"const",value:""},"回数":{type:"const",value:""},CR:{type:"const",value:"\r"},LF:{type:"const",value:"\n"},"非数":{type:"const",value:NaN},"無限大":{type:"const",value:1/0},"空配列":{type:"func",josi:[],pure:!0,fn:function(){return[]}},"空辞書":{type:"func",josi:[],pure:!0,fn:function(){return{}}},"空ハッシュ":{type:"func",josi:[],pure:!0,fn:function(){return{}}},"空オブジェクト":{type:"func",josi:[],pure:!1,fn:function(e){return e.__exec("空ハッシュ",[e])}},"表示":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){e=t.__printPool+e,t.__printPool="",t.__varslist[0]["表示ログ"]+=e+"\n",t.logger.send("stdout",e+"")},return_none:!0},"継続表示":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){t.__printPool+=e},return_none:!0},"連続表示":{type:"func",josi:[["と","を"]],isVariableJosi:!0,pure:!0,fn:function(...e){const t=e.pop(),n=e.join("");t.__exec("表示",[n,t])},return_none:!0},"連続無改行表示":{type:"func",josi:[["と","を"]],isVariableJosi:!0,pure:!0,fn:function(...e){const t=e.pop(),n=e.join("");t.__exec("継続表示",[n,t])},return_none:!0},"表示ログ":{type:"const",value:""},"表示ログクリア":{type:"func",josi:[],pure:!0,fn:function(e){e.__varslist[0]["表示ログ"]=""},return_none:!0},"言":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){t.logger.send("stdout",e+"")},return_none:!0},"コンソール表示":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e){console.log(e)},return_none:!0},"足":{type:"func",josi:[["に","と"],["を"]],isVariableJosi:!1,pure:!0,fn:function(e,t){return e+t}},"引":{type:"func",josi:[["から"],["を"]],pure:!0,fn:function(e,t){return e-t}},"掛":{type:"func",josi:[["に","と"],["を"]],pure:!0,fn:function(e,t){return e*t}},"倍":{type:"func",josi:[["の"],[""]],pure:!0,fn:function(e,t){return e*t}},"割":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e/t}},"割余":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e%t}},"偶数":{type:"func",josi:[["が"]],pure:!0,fn:function(e){return parseInt(e)%2==0}},"奇数":{type:"func",josi:[["が"]],pure:!0,fn:function(e){return parseInt(e)%2==1}},"二乗":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return e*e}},"べき乗":{type:"func",josi:[["の"],["の"]],pure:!0,fn:function(e,t){return Math.pow(e,t)}},"以上":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e>=t}},"以下":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e<=t}},"未満":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e<t}},"超":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e>t}},"等":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){return e===t}},"等無":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){return e!==t}},"一致":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){if("object"==typeof e){return JSON.stringify(e)===JSON.stringify(t)}return e===t}},"不一致":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){if("object"==typeof e){return JSON.stringify(e)!==JSON.stringify(t)}return e!==t}},"範囲内":{type:"func",josi:[["が"],["から"],["の"]],pure:!0,fn:function(e,t,n){return t<=e&&e<=n}},"連続加算":{type:"func",josi:[["を"],["に","と"]],isVariableJosi:!0,pure:!0,fn:function(e,...t){return t.pop(),t.push(e),t.reduce(((e,t)=>e+t))}},"ください":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu||(e.__reisetu=0),e.__reisetu++},return_none:!0},"お願":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu||(e.__reisetu=0),e.__reisetu++},return_none:!0},"です":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu||(e.__reisetu=0),e.__reisetu++},return_none:!0},"拝啓":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu=0},return_none:!0},"敬具":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu+=100},return_none:!0},"礼節レベル取得":{type:"func",josi:[],pure:!0,fn:function(e){return e.__reisetu||(e.__reisetu=0),e.__reisetu}},"JS実行":{type:"func",josi:[["を","で"]],pure:!0,fn:function(src,sys){return eval(src)}},"JSオブジェクト取得":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__findVar(e,null)}},"JS関数実行":{type:"func",josi:[["を"],["で"]],fn:function(name,args){if("string"==typeof name&&(name=eval(name)),"function"!=typeof name)throw new Error("JS関数取得で実行できません。");return args instanceof Array||(args=[args]),name.apply(null,args)}},"JSメソッド実行":{type:"func",josi:[["の"],["を"],["で"]],fn:function(obj,m,args){if("string"==typeof obj&&(obj=eval(obj)),"object"!=typeof obj)throw new Error("JSオブジェクトを取得できませんでした。");return"function"!=typeof m&&(m=obj[m]),args instanceof Array||(args=[args]),m.apply(obj,args)}},"ナデシコ":{type:"func",josi:[["を","で"]],pure:!1,fn:function(e,t){if("非同期モード"===t.__genMode)throw new Error("非同期モードでは「ナデシコ」は利用できません。");t.__varslist[0]["表示ログ"]="",t.__self.runEx(e,t.__modName,{resetEnv:!1,resetLog:!0});const n=t.__varslist[0]["表示ログ"]+"";return n&&t.logger.trace(n),n}},"ナデシコ続":{type:"func",josi:[["を","で"]],fn:function(e,t){if("非同期モード"===t.__genMode)throw new Error("非同期モードでは「ナデシコ続」は利用できません。");t.__self.runEx(e,t.__modName,{resetEnv:!1,resetLog:!1});const n=t.__varslist[0]["表示ログ"]+"";return n&&t.logger.trace(n),n}},"実行":{type:"func",josi:[["を","に","で"]],pure:!1,fn:function(e,t){if("function"==typeof e)return e(t);if("string"==typeof e){const n=t.__findFunc(e,"実行");if("function"==typeof n)return n(t)}return e}},"実行時間計測":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){if("string"==typeof e&&(e=t.__findFunc(e,"実行時間計測")),performance&&performance.now){const n=performance.now();e(t);return performance.now()-n}{const n=Date.now();e(t);return Date.now()-n}}},"変数型確認":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return typeof e}},TYPEOF:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return typeof e}},"文字列変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return String(e)}},TOSTR:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return String(e)}},"整数変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseInt(e)}},TOINT:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseInt(e)}},"実数変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseFloat(e)}},TOFLOAT:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseFloat(e)}},INT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return parseInt(e)}},FLOAT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return parseFloat(e)}},"NAN判定":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return isNaN(e)}},"非数判定":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Number.isNaN(e)}},HEX:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return parseInt(e).toString(16)}},"進数変換":{type:"func",josi:[["を","の"],[""]],pure:!0,fn:function(e,t){return parseInt(e).toString(t)}},"二進":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e){return parseInt(e).toString(2)}},"二進表示":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e,t){const n=parseInt(e).toString(2);t.__exec("表示",[n,t])}},RGB:{type:"func",josi:[["と"],["の"],["で"]],pure:!0,fn:function(e,t,n){const s=e=>{const t="00"+parseInt(""+e).toString(16);return t.substring(t.length-2,t.length)};return"#"+s(e)+s(t)+s(n)}},"論理OR":{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e||t}},"論理AND":{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e&&t}},"論理NOT":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e?0:1}},OR:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e|t}},AND:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e&t}},XOR:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e^t}},NOT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return~e}},SHIFT_L:{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e<<t}},SHIFT_R:{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e>>t}},SHIFT_UR:{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e>>>t}},"文字数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Array.from?Array.from(e).length:String(e).length}},"何文字目":{type:"func",josi:[["で","の"],["が"]],pure:!0,fn:function(e,t){return String(e).indexOf(t)+1}},CHR:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return String.fromCodePoint?String.fromCodePoint(e):String.fromCharCode(e)}},ASC:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return String.prototype.codePointAt?String(e).codePointAt(0):String(e).charCodeAt(0)}},"文字挿入":{type:"func",josi:[["で","の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){t<=0&&(t=1);const s=String(e);return s.substring(0,t-1)+n+s.substring(t-1)}},"文字検索":{type:"func",josi:[["で","の"],["から"],["を"]],pure:!0,fn:function(e,t,n){let s=String(e);s=s.substring(t);const r=s.indexOf(n);return-1===r?0:r+1+t}},"追加":{type:"func",josi:[["で","に","へ"],["を"]],pure:!0,fn:function(e,t){return e instanceof Array?(e.push(t),e):String(e)+String(t)}},"一行追加":{type:"func",josi:[["で","に","へ"],["を"]],pure:!0,fn:function(e,t){return e instanceof Array?(e.push(t),e):String(e)+String(t)+"\n"}},"文字列分解":{type:"func",josi:[["を","の","で"]],pure:!0,fn:function(e){return Array.from?Array.from(e):String(e).split("")}},"リフレイン":{type:"func",josi:[["を","の"],["で"]],pure:!0,fn:function(e,t){let n="";for(let s=0;s<t;s++)n+=String(e);return n}},"出現回数":{type:"func",josi:[["で"],["の"]],pure:!0,fn:function(e,t){return(e=""+e).split(t=""+t).length-1}},MID:{type:"func",josi:[["で","の"],["から"],["を"]],pure:!0,fn:function(e,t,n){return n=n||1,String(e).substring(t-1,t+n-1)}},"文字抜出":{type:"func",josi:[["で","の"],["から"],["を",""]],pure:!0,fn:function(e,t,n){return n=n||1,String(e).substring(t-1,t+n-1)}},LEFT:{type:"func",josi:[["の","で"],["だけ"]],pure:!0,fn:function(e,t){return String(e).substring(0,t)}},"文字左部分":{type:"func",josi:[["の","で"],["だけ",""]],pure:!0,fn:function(e,t){return String(e).substring(0,t)}},RIGHT:{type:"func",josi:[["の","で"],["だけ"]],pure:!0,fn:function(e,t){return(e=""+e).substring(e.length-t,e.length)}},"文字右部分":{type:"func",josi:[["の","で"],["だけ",""]],pure:!0,fn:function(e,t){return(e=""+e).substring(e.length-t,e.length)}},"区切":{type:"func",josi:[["の","を"],["で"]],pure:!0,fn:function(e,t){return(""+e).split(""+t)}},"文字列分割":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=(e=""+e).indexOf(t=""+t);return n<0?[e]:[e.substring(0,n),e.substring(n+t.length)]}},"切取":{type:"func",josi:[["から","の"],["まで","を"]],pure:!0,fn:function(e,t,n){const s=(e=String(e)).indexOf(t);return s<0?(n.__v0["対象"]="",e):(n.__v0["対象"]=e.substring(s+t.length),e.substring(0,s))}},"文字削除":{type:"func",josi:[["の"],["から"],["だけ","を",""]],pure:!0,fn:function(e,t,n){return(e=""+e).substring(0,t-1)+e.substring(t-1+n)}},"置換":{type:"func",josi:[["の","で"],["を","から"],["に","へ"]],pure:!0,fn:function(e,t,n){return String(e).split(t).join(n)}},"単置換":{type:"func",josi:[["の","で"],["を"],["に","へ"]],pure:!0,fn:function(e,t,n){return String(e).replace(t,n)}},"トリム":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return e=String(e).replace(/^\s+/,"").replace(/\s+$/,"")}},"空白除去":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return e=String(e).replace(/^\s+/,"").replace(/\s+$/,"")}},"大文字変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).toUpperCase()}},"小文字変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).toLowerCase()}},"平仮名変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(""+e).replace(/[\u30a1-\u30f6]/g,(function(e){const t=e.charCodeAt(0)-96;return String.fromCharCode(t)}))}},"カタカナ変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(""+e).replace(/[\u3041-\u3096]/g,(function(e){const t=e.charCodeAt(0)+96;return String.fromCharCode(t)}))}},"英数全角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[A-Za-z0-9]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)+65248)}))}},"英数半角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[A-Za-z0-9]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)-65248)}))}},"英数記号全角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[\x20-\x7F]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)+65248)}))}},"英数記号半角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[\uFF00-\uFF5F]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)-65248)}))}},"カタカナ全角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e,t){const n=t.__v0["全角カナ一覧"],s=t.__v0["半角カナ一覧"],r=t.__v0["全角カナ濁音一覧"],i=t.__v0["半角カナ濁音一覧"];let o="",u=0;for(;u<e.length;){const t=e.substring(u,u+2),c=i.indexOf(t);if(c>=0){o+=r.charAt(c/2),u+=2;continue}const a=e.charAt(u),f=s.indexOf(a);f>=0?(o+=n.charAt(f),u++):(o+=a,u++)}return o}},"カタカナ半角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e,t){const n=t.__v0["全角カナ一覧"],s=t.__v0["半角カナ一覧"],r=t.__v0["全角カナ濁音一覧"],i=t.__v0["半角カナ濁音一覧"];return e.split("").map((e=>{const t=n.indexOf(e);if(t>=0)return s.charAt(t);const o=r.indexOf(e);return o>=0?i.substring(2*o,2*o+2):e})).join("")}},"全角変換":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){let n=e;return n=t.__exec("カタカナ全角変換",[n,t]),n=t.__exec("英数記号全角変換",[n,t]),n}},"半角変換":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){let n=e;return n=t.__exec("カタカナ半角変換",[n,t]),n=t.__exec("英数記号半角変換",[n,t]),n}},"全角カナ一覧":{type:"const",value:"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲンァィゥェォャュョッ、。ー「」"},"全角カナ濁音一覧":{type:"const",value:"ガギグゲゴザジズゼゾダヂヅデドバビブベボパピプペポ"},"半角カナ一覧":{type:"const",value:"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲンァィゥェォャュョッ、。ー「」゙゚"},"半角カナ濁音一覧":{type:"const",value:"ガギグゲゴザジズゼゾダヂヅデドバビブベボパピプペポ"},"JSONエンコード":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return JSON.stringify(e)}},"JSONエンコード整形":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return JSON.stringify(e,null,2)}},"JSONデコード":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e){return JSON.parse(e)}},"正規表現マッチ":{type:"func",josi:[["を","が"],["で","に"]],pure:!0,fn:function(e,t,n){let s;const r=(""+t).match(/^\/(.+)\/([a-zA-Z]*)$/);s=null===r?new RegExp(t,"g"):new RegExp(r[1],r[2]);const i=n.__varslist[0]["抽出文字列"]=[],o=String(e).match(s);let u=o;if(s.global);else if(o&&o.length>0){u=o[0];for(let e=1;e<o.length;e++)i[e-1]=o[e]}return u}},"抽出文字列":{type:"const",value:[]},"正規表現置換":{type:"func",josi:[["の"],["を","から"],["で","に","へ"]],pure:!0,fn:function(e,t,n){let s;const r=t.match(/^\/(.+)\/([a-zA-Z]*)/);return s=null===r?new RegExp(t,"g"):new RegExp(r[1],r[2]),String(e).replace(s,n)}},"正規表現区切":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){let n;const s=t.match(/^\/(.+)\/([a-zA-Z]*)/);return n=null===s?new RegExp(t,"g"):new RegExp(s[1],s[2]),String(e).split(n)}},"通貨形式":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return String(e).replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")}},"ゼロ埋":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){e=String(e);let n="0";for(let e=0;e<t;e++)n+="0";(t=parseInt(t))<e.length&&(t=e.length);const s=n+String(e);return s.substring(s.length-t,s.length)}},"空白埋":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){e=String(e);let n=" ";for(let e=0;e<t;e++)n+=" ";(t=parseInt(t))<e.length&&(t=e.length);const s=n+String(e);return s.substring(s.length-t,s.length)}},"かなか判定":{type:"func",josi:[["を","の","が"]],pure:!0,fn:function(e){const t=String(e).charCodeAt(0);return t>=12353&&t<=12447}},"カタカナ判定":{type:"func",josi:[["を","の","が"]],pure:!0,fn:function(e){const t=String(e).charCodeAt(0);return t>=12449&&t<=12538}},"数字判定":{type:"func",josi:[["を","が"]],pure:!0,fn:function(e){const t=String(e).charAt(0);return t>="0"&&t<="9"||t>="0"&&t<="9"}},"数列判定":{type:"func",josi:[["を","が"]],pure:!0,fn:function(e){return null!==String(e).match(/^[0-9.]+$/)}},"配列結合":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){if(e instanceof Array)return e.join(""+t);return String(e).split("\n").join(""+t)}},"配列検索":{type:"func",josi:[["の","から"],["を"]],pure:!0,fn:function(e,t){return e instanceof Array?e.indexOf(t):-1}},"配列要素数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e instanceof Array?e.length:e instanceof Object?Object.keys(e).length:1}},"要素数":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__exec("配列要素数",[e])}},"配列挿入":{type:"func",josi:[["の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){if(e instanceof Array)return e.splice(t,0,n);throw new Error("『配列挿入』で配列以外の要素への挿入。")}},"配列一括挿入":{type:"func",josi:[["の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){if(e instanceof Array&&n instanceof Array){for(let s=0;s<n.length;s++)e.splice(t+s,0,n[s]);return e}throw new Error("『配列一括挿入』で配列以外の要素への挿入。")}},"配列ソート":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array)return e.sort();throw new Error("『配列ソート』で配列以外が指定されました。")}},"配列数値ソート":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array)return e.sort(((e,t)=>parseFloat(e)-parseFloat(t)));throw new Error("『配列数値ソート』で配列以外が指定されました。")}},"配列カスタムソート":{type:"func",josi:[["で"],["の","を"]],pure:!1,fn:function(e,t,n){let s=e;if("string"==typeof e&&(s=n.__findFunc(e,"配列カスタムソート")),t instanceof Array)return t.sort(s);throw new Error("『配列カスタムソート』で配列以外が指定されました。")}},"配列逆順":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array)return e.reverse();throw new Error("『配列ソート』で配列以外が指定されました。")}},"配列シャッフル":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array){for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1)),s=e[t];e[t]=e[n],e[n]=s}return e}throw new Error("『配列シャッフル』で配列以外が指定されました。")}},"配列削除":{type:"func",josi:[["の","から"],["を"]],pure:!1,fn:function(e,t,n){return n.__exec("配列切取",[e,t,n])}},"配列切取":{type:"func",josi:[["の","から"],["を"]],pure:!0,fn:function(e,t){if(e instanceof Array){const n=e.splice(t,1);return n instanceof Array?n[0]:null}if(!(e instanceof Object&&"string"==typeof t))throw new Error("『配列切取』で配列以外を指定。");if(e[t]){const n=e[t];return delete e[t],n}}},"配列取出":{type:"func",josi:[["の"],["から"],["を"]],pure:!0,fn:function(e,t,n){if(e instanceof Array)return e.splice(t,n);throw new Error("『配列取出』で配列以外を指定。")}},"配列ポップ":{type:"func",josi:[["の","から"]],pure:!0,fn:function(e){if(e instanceof Array)return e.pop();throw new Error("『配列ポップ』で配列以外の処理。")}},"配列追加":{type:"func",josi:[["に","へ"],["を"]],pure:!0,fn:function(e,t){if(e instanceof Array)return e.push(t),e;throw new Error("『配列追加』で配列以外の処理。")}},"配列複製":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return JSON.parse(JSON.stringify(e))}},"配列足":{type:"func",josi:[["に","へ","と"],["を"]],pure:!0,fn:function(e,t){return e instanceof Array?e.concat(t):JSON.parse(JSON.stringify(e))}},"配列最大値":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e.reduce(((e,t)=>Math.max(e,t)))}},"配列最小値":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e.reduce(((e,t)=>Math.min(e,t)))}},"配列合計":{type:"func",josi:[["の"]],pure:!0,fn:function(e){if(e instanceof Array){let t=0;return e.forEach((e=>{const n=parseFloat(e);isNaN(n)||(t+=n)})),t}throw new Error("『配列合計』で配列変数以外の値が指定されました。")}},"表ソート":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表ソート』には配列を指定する必要があります。");return e.sort(((e,n)=>{const s=e[t],r=n[t];return s===r?0:s<r?-1:1})),e}},"表数値ソート":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表数値ソート』には配列を指定する必要があります。");return e.sort(((e,n)=>e[t]-n[t])),e}},"表ピックアップ":{type:"func",josi:[["の"],["から"],["を","で"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表ピックアップ』には配列を指定する必要があります。");return e.filter((e=>String(e[t]).indexOf(n)>=0))}},"表完全一致ピックアップ":{type:"func",josi:[["の"],["から"],["を","で"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表完全ピックアップ』には配列を指定する必要があります。");return e.filter((e=>e[t]===n))}},"表検索":{type:"func",josi:[["の"],["で","に"],["から"],["を"]],pure:!0,fn:function(e,t,n,s){if(!(e instanceof Array))throw new Error("『表検索』には配列を指定する必要があります。");for(let r=n;r<e.length;r++)if(e[r][t]===s)return r;return-1}},"表列数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){if(!(e instanceof Array))throw new Error("『表列数』には配列を指定する必要があります。");let t=1;for(let n=0;n<e.length;n++)e[n].length>t&&(t=e[n].length);return t}},"表行数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){if(!(e instanceof Array))throw new Error("『表行数』には配列を指定する必要があります。");return e.length}},"表行列交換":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表行列交換』には配列を指定する必要があります。");const n=t.__exec("表列数",[e]),s=e.length,r=[];for(let t=0;t<n;t++){const n=[];r.push(n);for(let r=0;r<s;r++)n[r]=void 0!==e[r][t]?e[r][t]:""}return r}},"表右回転":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表右回転』には配列を指定する必要があります。");const n=t.__exec("表列数",[e]),s=e.length,r=[];for(let t=0;t<n;t++){const n=[];r.push(n);for(let r=0;r<s;r++)n[r]=e[s-r-1][t]}return r}},"表重複削除":{type:"func",josi:[["の"],["を","で"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表重複削除』には配列を指定する必要があります。");const n=[],s={};for(let r=0;r<e.length;r++){const i=e[r][t];void 0===s[i]&&(s[i]=!0,n.push(e[r]))}return n}},"表列取得":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表列取得』には配列を指定する必要があります。");return e.map((e=>e[t]))}},"表列挿入":{type:"func",josi:[["の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表列挿入』には配列を指定する必要があります。");const s=[];return e.forEach(((e,r)=>{let i=[];t>0&&(i=i.concat(e.slice(0,t))),i.push(n[r]),i=i.concat(e.slice(t)),s.push(i)})),s}},"表列削除":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表列削除』には配列を指定する必要があります。");const n=[];return e.forEach((e=>{const s=e.slice(0);s.splice(t,1),n.push(s)})),n}},"表列合計":{type:"func",josi:[["の"],["を","で"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表列合計』には配列を指定する必要があります。");let n=0;return e.forEach((e=>{n+=e[t]})),n}},"表曖昧検索":{type:"func",josi:[["の"],["から"],["で"],["を"]],pure:!0,fn:function(e,t,n,s){if(!(e instanceof Array))throw new Error("『表曖昧検索』には配列を指定する必要があります。");const r=new RegExp(s);for(let s=t;s<e.length;s++){const t=e[s];if(r.test(t[n]))return s}return-1}},"表正規表現ピックアップ":{type:"func",josi:[["の","で"],["から"],["を"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表正規表現ピックアップ』には配列を指定する必要があります。");const s=new RegExp(n),r=[];for(let n=0;n<e.length;n++){const i=e[n];s.test(i[t])&&r.push(i.slice(0))}return r}},"辞書キー列挙":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=[];if(e instanceof Object){for(const n in e)t.push(n);return t}if(e instanceof Array){for(let n=0;n<e.length;n++)t.push(n);return t}throw new Error("『辞書キー列挙』でハッシュ以外が与えられました。")}},"辞書キー削除":{type:"func",josi:[["から","の"],["を"]],pure:!0,fn:function(e,t){if(e instanceof Object)return e[t]&&delete e[t],e;throw new Error("『辞書キー削除』でハッシュ以外が与えられました。")}},"辞書キー存在":{type:"func",josi:[["の","に"],["が"]],pure:!0,fn:function(e,t){return t in e}},"ハッシュキー列挙":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__exec("辞書キー列挙",[e,t])}},"ハッシュ内容列挙":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=[];if(e instanceof Object){for(const n in e)t.push(e[n]);return t}throw new Error("『ハッシュ内容列挙』でハッシュ以外が与えられました。")}},"ハッシュキー削除":{type:"func",josi:[["から","の"],["を"]],pure:!1,fn:function(e,t,n){return n.__exec("辞書キー削除",[e,t,n])}},"ハッシュキー存在":{type:"func",josi:[["の","に"],["が"]],pure:!0,fn:function(e,t){return t in e}},"秒待":{type:"func",josi:[[""]],pure:!0,asyncFn:!0,fn:function(e){return new Promise(((t,n)=>{try{setTimeout((()=>{t()}),1e3*parseFloat(e))}catch(e){n(e)}}))},return_none:!0},"秒待機":{type:"func",josi:[[""]],pure:!0,fn:function(e,t){if("非同期モード"!==t.__genMode){if(void 0===t.resolve)throw new Error("『秒待機』命令は『!非同期モード』で使ってください。");t.__exec("秒逐次待機",[e,t])}else{const n=t.setAsync(t);setTimeout((()=>{t.compAsync(t,n)}),1e3*e)}},return_none:!0},"秒逐次待機":{type:"func",josi:[[""]],pure:!0,fn:function(e,t){if(void 0===t.resolve)throw new Error("『秒逐次待機』命令は『逐次実行』構文と一緒に使ってください。");const n=t.resolve;t.resolveCount++;const s=setTimeout((function(){const e=t.__timeout.indexOf(s);e>=0&&t.__timeout.splice(e,1),n()}),1e3*e);t.__timeout.unshift(s)},return_none:!0},"秒後":{type:"func",josi:[["を"],[""]],pure:!1,fn:function(e,t,n){"string"==typeof e&&(e=n.__findFunc(e,"秒後"));const s=setTimeout((()=>{const t=n.__timeout.indexOf(s);t>=0&&n.__timeout.splice(t,1),"非同期モード"===n.__genMode&&(n.newenv=!0);try{e(s,n)}catch(e){let t=e;e instanceof _nako_errors_mjs__WEBPACK_IMPORTED_MODULE_0__.as||(t=new _nako_errors_mjs__WEBPACK_IMPORTED_MODULE_0__.as(e,n.__varslist[0].line)),n.logger.error(t)}}),1e3*parseFloat(t));return n.__timeout.unshift(s),n.__v0["対象"]=s,s}},"秒毎":{type:"func",josi:[["を"],[""]],pure:!1,fn:function(e,t,n){"string"==typeof e&&(e=n.__findFunc(e,"秒毎"));const s=setInterval((()=>{"非同期モード"===n.__genMode&&(n.newenv=!0),e(s,n)}),1e3*parseFloat(t));return n.__interval.unshift(s),n.__v0["対象"]=s,s}},"秒タイマー開始時":{type:"func",josi:[["を"],[""]],pure:!1,fn:function(e,t,n){return n.__exec("秒毎",[e,t,n])}},"タイマー停止":{type:"func",josi:[["の","で"]],pure:!0,fn:function(e,t){const n=t.__interval.indexOf(e);if(n>=0)return t.__interval.splice(n,1),clearInterval(e),!0;const s=t.__timeout.indexOf(e);return s>=0&&(t.__timeout.splice(s,1),clearTimeout(e),!0)},return_none:!1},"全タイマー停止":{type:"func",josi:[],pure:!0,fn:function(e){for(let t=0;t<e.__interval.length;t++){const n=e.__interval[t];clearInterval(n)}e.__interval=[];for(let t=0;t<e.__timeout.length;t++){const n=e.__timeout[t];clearTimeout(n)}e.__timeout=[]},return_none:!0},"元号データ":{type:"const",value:[{"元号":"令和","改元日":"2019/05/01"},{"元号":"平成","改元日":"1989/01/08"},{"元号":"昭和","改元日":"1926/12/25"},{"元号":"大正","改元日":"1912/07/30"},{"元号":"明治","改元日":"1868/10/23"}]},"今":{type:"func",josi:[],pure:!0,fn:function(){const e=e=>(e="00"+e).substring(e.length-2,e.length),t=new Date;return e(t.getHours())+":"+e(t.getMinutes())+":"+e(t.getSeconds())}},"システム時間":{type:"func",josi:[],pure:!0,fn:function(){const e=new Date;return Math.floor(e.getTime()/1e3)}},"システム時間ミリ秒":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getTime()}},"今日":{type:"func",josi:[],pure:!0,fn:function(e){return e.__formatDate(new Date)}},"明日":{type:"func",josi:[],pure:!0,fn:function(e){const t=Date.now()+864e5;return e.__formatDate(new Date(t))}},"昨日":{type:"func",josi:[],pure:!0,fn:function(e){const t=Date.now()-864e5;return e.__formatDate(new Date(t))}},"今年":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getFullYear()}},"来年":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getFullYear()+1}},"去年":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getFullYear()-1}},"今月":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getMonth()+1}},"来月":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getMonth()+2}},"先月":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getMonth()}},"曜日":{type:"func",josi:[["の"]],pure:!0,fn:function(e,t){const n=t.__str2date(e);return"日月火水木金土".charAt(n.getDay()%7)}},"曜日番号取得":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=e.split("/");return new Date(t[0],t[1]-1,t[2]).getDay()}},"UNIXTIME変換":{type:"func",josi:[["の","を","から"]],pure:!0,fn:function(e,t){return t.__str2date(e).getTime()/1e3}},"UNIX時間変換":{type:"func",josi:[["の","を","から"]],pure:!0,fn:function(e,t){return t.__str2date(e).getTime()/1e3}},"日時変換":{type:"func",josi:[["を","から"]],pure:!0,fn:function(e,t){const n=1e3*e;return t.__formatDateTime(new Date(n),"2022/01/01 00:00:00")}},"日時書式変換":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t,n){const s=n.__str2date(e);return t=t.replace(/(YYYY|ccc|WWW|MMM|YY|MM|DD|HH|mm|ss|[MDHmsW])/g,(e=>{switch(e){case"YYYY":return s.getFullYear();case"YY":return(""+s.getFullYear()).substring(2);case"MM":return n.__zero2(s.getMonth()+1);case"DD":return n.__zero2(s.getDate());case"M":return s.getMonth()+1;case"D":return s.getDate();case"HH":return n.__zero2(s.getHours());case"mm":return n.__zero2(s.getMinutes());case"ss":return n.__zero2(s.getSeconds());case"ccc":return n.__zero(s.getMilliseconds(),3);case"H":return s.getHours();case"m":return s.getMinutes();case"s":return s.getSeconds();case"W":return"日月火水木金土".charAt(s.getDay()%7);case"WWW":return["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][s.getDay()%7];case"MMM":return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][s.getMonth()]}return e}))}},"和暦変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){const n=t.__str2date(e),s=n.getTime();for(const e of t.__v0["元号データ"]){const r=e["元号"],i=t.__str2date(e["改元日"]);if(i.getTime()<=s){let e=n.getFullYear()-i.getFullYear()+1;return 1===e&&(e="元"),r+e+"年"+t.__zero2(n.getMonth()+1)+"月"+t.__zero2(n.getDate())+"日"}}throw new Error("『和暦変換』は明示以前の日付には対応していません。")}},"年数差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=n.__str2date(e);return n.__str2date(t).getFullYear()-s.getFullYear()}},"月数差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=n.__str2date(e),r=n.__str2date(t);return 12*r.getFullYear()+r.getMonth()-(12*s.getFullYear()+s.getMonth())}},"日数差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil((r-s)/86400)}},"時間差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil((r-s)/3600)}},"分差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil((r-s)/60)}},"秒差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil(r-s)}},"日時差":{type:"func",josi:[["と","から"],["の","までの"],["による"]],pure:!0,fn:function(e,t,n,s){switch(n){case"年":return s.__exec("年数差",[e,t,s]);case"月":return s.__exec("月数差",[e,t,s]);case"日":return s.__exec("日数差",[e,t,s]);case"時間":return s.__exec("時間差",[e,t,s]);case"分":return s.__exec("分差",[e,t,s]);case"秒":return s.__exec("秒差",[e,t,s])}throw new Error("『日時差』で不明な単位です。")}},"時間加算":{type:"func",josi:[["に"],["を"]],pure:!0,fn:function(e,t,n){const s=t.charAt(0);"-"!==s&&"+"!==s||(t=t.substring(1));const r=n.__str2date(e),i=(t+":0:0").split(":");let o=60*parseInt(i[0])*60+60*parseInt(i[1])+parseInt(i[2]);"-"===s&&(o*=-1);const u=new Date(r.getTime()+1e3*o);return n.__formatDateTime(u,e)}},"日付加算":{type:"func",josi:[["に"],["を"]],pure:!0,fn:function(e,t,n){let s=1;const r=t.charAt(0);"-"!==r&&"+"!==r||(t=t.substring(1),"-"===r&&(s*=-1));const i=n.__str2date(e),o=(t+"/0/0").split("/"),u=parseInt(o[0])*s,c=parseInt(o[1])*s,a=parseInt(o[2])*s;return i.setFullYear(i.getFullYear()+u),i.setMonth(i.getMonth()+c),i.setDate(i.getDate()+a),n.__formatDateTime(i,e)}},"日時加算":{type:"func",josi:[["に"],["を"]],pure:!0,fn:function(e,t,n){const s=(""+t).match(/([+|-]?)(\d+)(年|ヶ月|日|週間|時間|分|秒)$/);if(!s)throw new Error("『日付加算』は『(+|-)1(年|ヶ月|日|時間|分|秒)』の書式で指定します。");switch(s[3]){case"年":return n.__exec("日付加算",[e,`${s[1]}${s[2]}/0/0`,n]);case"ヶ月":return n.__exec("日付加算",[e,`${s[1]}0/${s[2]}/0`,n]);case"週間":return n.__exec("日付加算",[e,`${s[1]}0/0/${7*parseInt(s[2])}`,n]);case"日":return n.__exec("日付加算",[e,`${s[1]}0/0/${s[2]}`,n]);case"時間":return n.__exec("時間加算",[e,`${s[1]}${s[2]}:0:0`,n]);case"分":return n.__exec("時間加算",[e,`${s[1]}0:${s[2]}:0`,n]);case"秒":return n.__exec("時間加算",[e,`${s[1]}0:0:${s[2]}`,n])}}},"時間ミリ秒取得":{type:"func",josi:[],pure:!0,fn:function(){if(performance&&performance.now)return performance.now();if(Date.now)return Date.now();return(new Date).getTime()}},"エラー発生":{type:"func",josi:[["の","で"]],pure:!0,fn:function(e){throw new Error(e)}},"グローバル関数一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){const t=e.__varslist[1],n=[];for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push(e);return n}},"システム関数一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){const t=e.__varslist[0],n=[];for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push(e);return n}},"システム関数存在":{type:"func",josi:[["が","の"]],pure:!0,fn:function(e,t){return void 0!==t.__v0[e]}},"プラグイン一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){const t=[];for(const n in e.pluginfiles)t.push(n);return t}},"モジュール一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){const t=[];for(const n in e.__module)t.push(n);return t}},"助詞一覧取得":{type:"func",josi:[],pure:!0,asyncFn:!0,fn:function(){return new Promise(((e,t)=>{Promise.resolve().then(__webpack_require__.bind(__webpack_require__,5564)).then((t=>{const n=Object.assign({},t);e(n.josiList)})).catch((e=>{t(e)}))}))}},"予約語一覧取得":{type:"func",josi:[],pure:!0,asyncFn:!0,fn:function(){return new Promise(((e,t)=>{Promise.resolve().then(__webpack_require__.bind(__webpack_require__,9078)).then((t=>{const n=Object.assign({},t),s=[];for(const e in n.default)s.push(e);e(s)})).catch((e=>{t(e)}))}))}},"プラグイン名":{type:"const",value:"メイン"},"プラグイン名設定":{type:"func",josi:[["に","へ"]],pure:!0,fn:function(e,t){t.__v0["プラグイン名"]=e},return_none:!0},"URLエンコード":{type:"func",josi:[["を","から"]],pure:!0,fn:function(e){return encodeURIComponent(e)}},"URLデコード":{type:"func",josi:[["を","へ","に"]],pure:!0,fn:function(e){return decodeURIComponent(e)}},"URLパラメータ解析":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e,t){const n={};if("string"!=typeof e)return n;const s=e.split("?");if(s.length<=1)return n;const r=s[1].split("&");for(const e of r){const s=(e+"=").split("=");n[t.__exec("URLデコード",[s[0]])]=t.__exec("URLデコード",[s[1]])}return n}},"BASE64エンコード":{type:"func",josi:[["を","から"]],pure:!0,fn:function(e){if("undefined"!=typeof window&&window.btoa){const t=(new TextEncoder).encode(e),n=String.fromCharCode.apply(null,t);return btoa(n)}if("undefined"!=typeof Buffer)return Buffer.from(e).toString("base64");throw new Error("『BASE64エンコード』は利用できません。")}},"BASE64デコード":{type:"func",josi:[["を","へ","に"]],pure:!0,fn:function(e){if("undefined"!=typeof window&&window.atob){const t=atob(e),n=Array.prototype.map.call(t,(e=>e.charCodeAt())),s=new Uint8Array(n);return new TextDecoder("UTF-8").decode(s)}if("undefined"!=typeof Buffer)return Buffer.from(e,"base64").toString();throw new Error("『BASE64デコード』は利用できません。")}}}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=function(e,t){for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};!function(){var e=__webpack_require__(9493);function t(e="?",t={},n=0,s="main.nako3"){return{type:e,value:t,line:n,column:0,file:s,josi:""}}var n=__webpack_require__(5154),s=__webpack_require__(4392);class r extends class{constructor(e){this.logger=e,this.stackList=[],this.tokens=[],this.stack=[],this.index=0,this.y=[],this.modName="inline",this.modList=[],this.funclist={},this.funcLevel=0,this.usedAsyncFn=!1,this.localvars={"それ":{type:"var",value:""}},this.genMode="sync",this.arrayIndexFrom=0,this.flagReverseArrayIndex=!1,this.flagCheckArrayInit=!1,this.recentlyCalledFunc=[],this.init()}init(){this.funclist={},this.reset()}reset(){this.tokens=[],this.index=0,this.stack=[],this.y=[],this.genMode="sync"}setFuncList(e){this.funclist=e}popStack(e){if(!e){const e=this.stack.pop();return e||null}for(let t=0;t<this.stack.length;t++){const n=this.stack[t];if(0===e.length||e.indexOf(n.josi)>=0)return this.stack.splice(t,1),this.logger.trace("POP :"+JSON.stringify(n)),n}return null}saveStack(){this.stackList.push(this.stack),this.stack=[]}loadStack(){this.stack=this.stackList.pop()}findVar(e){if(this.localvars[e])return{name:e,scope:"local",info:this.localvars[e]};if(e.indexOf("__")>=0)return this.funclist[e]?{name:e,scope:"global",info:this.funclist[e]}:void 0;const t=`${this.modName}__${e}`;if(this.funclist[t])return{name:t,scope:"global",info:this.funclist[t]};for(const t of this.modList){const n=`${t}__${e}`;if(this.funclist[n])return{name:n,scope:"global",info:this.funclist[n]}}return this.funclist[e]?{name:e,scope:"system",info:this.funclist[e]}:void 0}pushStack(e){this.logger.debug("PUSH:"+JSON.stringify(e)),this.stack.push(e)}isEOF(){return this.index>=this.tokens.length}getIndex(){return this.index}check(e){return this.tokens[this.index].type===e}check2(e){for(let t=0;t<e.length;t++){const n=t+this.index;if(this.tokens.length<=n)return!1;if("*"===e[t])continue;const s=this.tokens[n];if(e[t]instanceof Array){if(e[t].indexOf(s.type)<0)return!1}else if(s.type!==e[t])return!1}return!0}checkTypes(e){const t=this.tokens[this.index].type;return e.indexOf(t)>=0}accept(e){const t=[],n=this.index,s=()=>(this.index=n,!1);for(let n=0;n<e.length;n++){if(this.isEOF())return s();const r=e[n];if(null==r)return s();if("string"!=typeof r)if("function"!=typeof r){if(!(r instanceof Array))throw new Error("System Error : accept broken : "+typeof r);if(!this.checkTypes(r))return s();t[n]=this.get()}else{const e=r.bind(this)(t);if(null===e)return s();t[n]=e}else{const e=this.get();if(e&&e.type!==r)return s();t[n]=e}}return this.y=t,!0}get(){return this.isEOF()?null:this.tokens[this.index++]}getCur(){if(this.isEOF())throw new Error("トークンが取得できません。");const e=this.tokens[this.index++];if(!e)throw new Error("トークンが取得できません。");return e}unget(){this.index>0&&this.index--}peek(e=0){return this.isEOF()?null:this.tokens[this.index+e]}peekDef(e=null){return this.isEOF()?(e||(e=t()),e):this.tokens[this.index]}peekSourceMap(){const e=this.peek();return null===e?{startOffset:void 0,endOffset:void 0,file:void 0,line:0,column:0}:{startOffset:e.startOffset,endOffset:e.endOffset,file:e.file,line:e.line,column:e.column}}nodeToStr(e,t,n){const s=t.depth-1,r=e=>void 0!==t.typeName?t.typeName:e,i=n?" debug: "+JSON.stringify(e,null,2):"";if(!e)return"(NULL)";switch(e.type){case"not":if(s>=0){const t=e.value;return`${r("")}『${this.nodeToStr(t,{depth:s},n)}に演算子『not』を適用した式${i}』`}return`${r("演算子")}『not』`;case"op":{const t=e;let o=t.operator||"";const u={eq:"=",not:"!",gt:">",lt:"<",and:"かつ",or:"または"};if(o in u&&(o=u[o]),s>=0){const e=this.nodeToStr(t.left,{depth:s},n),u=this.nodeToStr(t.right,{depth:s},n);return"eq"===t.operator?`${r("")}『${e}と${u}が等しいかどうかの比較${i}』`:`${r("")}『${e}と${u}に演算子『${o}』を適用した式${i}』`}return`${r("演算子")}『${o}${i}』`}case"number":return`${r("数値")}${e.value}`;case"string":return`${r("文字列")}『${e.value}${i}』`;case"word":return`${r("単語")}『${e.value}${i}』`;case"func":return`${r("関数")}『${e.name||e.value}${i}』`;case"eol":return"行の末尾";case"eof":return"ファイルの末尾";default:{let t=e.name;return t&&(t=e.value),"string"!=typeof t&&(t=e.type),`${r("")}『${t}${i}』`}}}}{parse(e,t){return this.reset(),this.tokens=e,this.modName=s.S.filenameToModName(t),this.modList.push(this.modName),this.startParser()}startParser(){const e=this.ySentenceList(),t=this.get();if(t&&"eof"!==t.type)throw this.logger.debug(`構文解析でエラー。${this.nodeToStr(t,{depth:1},!0)}の使い方が間違っています。`,t),n.ih.fromNode(`構文解析でエラー。${this.nodeToStr(t,{depth:1},!1)}の使い方が間違っています。`,t);return e}ySentenceList(){const e=[];let t=-1;const s=this.peekSourceMap();for(;!this.isEOF();){const n=this.ySentence();if(!n)break;e.push(n),t<0&&(t=n.line)}if(0===e.length){const e=this.peek()||this.tokens[0];throw this.logger.debug("構文解析に失敗:"+this.nodeToStr(this.peek(),{depth:1},!0),e),n.ih.fromNode("構文解析に失敗:"+this.nodeToStr(this.peek(),{depth:1},!1),e)}return{type:"block",block:e,...s,end:this.peekSourceMap(),genMode:this.genMode}}yEOL(){const e=this.get();if(!e)return null;if(this.stack.length>0){const t=[];this.stack.forEach((e=>{let n=this.nodeToStr(e,{depth:1},!1);e.josi&&(n+=e.josi),t.push(n)}));const s=t.join(",");let r="";const i="A".charCodeAt(0);for(const e of this.recentlyCalledFunc){r+=" - ";let t=0;const n=e.josi;if(n)for(const e of n){r+=String.fromCharCode(i+t),1===e.length?r+=e[0]:r+=`(${e.join("|")})`,t++}r+=e.name+"\n"}throw n.ih.fromNode(`未解決の単語があります: [${s}]\n次の命令の可能性があります:\n${r}`,e)}return this.recentlyCalledFunc=[],e}ySentence(){const e=this.peekSourceMap();if(this.check("eol"))return this.yEOL();if(this.check("もし"))return this.yIF();if(this.check("後判定"))return this.yAtohantei();if(this.check("エラー監視"))return this.yTryExcept();if(this.check("逐次実行"))return this.yTikuji();if(this.accept(["抜ける"]))return{type:"break",josi:"",...e,end:this.peekSourceMap()};if(this.accept(["続ける"]))return{type:"continue",josi:"",...e,end:this.peekSourceMap()};if(this.accept(["require","string","取込"]))return this.yRequire();if(this.accept(["not","非同期モード"]))return this.yASyncMode();if(this.accept(["not","DNCLモード"]))return this.yDNCLMode();if(this.accept(["not","string","モード設定"]))return this.ySetGenMode(this.y[1].value);if(this.check2(["func","←"]))return this.yCallOp();if(this.check2(["func","eq"])){const s=this.get()||t("?","?",e.line,e.file||"");throw n.ih.fromNode(`関数『${s.value}』に代入できません。『←』を使ってください。`,s)}if(this.accept([this.ySpeedMode]))return this.y[0];if(this.accept([this.yPerformanceMonitor]))return this.y[0];if(this.accept([this.yLet]))return this.y[0];if(this.accept([this.yDefTest]))return this.y[0];if(this.accept([this.yDefFunc]))return this.y[0];if(this.accept([this.yCall])){const t=this.y[0];if("して"===t.josi){const n=this.ySentence();if(null!==n)return{type:"block",block:[t,n],josi:n.josi,...e,end:this.peekSourceMap()}}return t}return null}yASyncMode(){const e=this.peekSourceMap();return this.genMode="非同期モード",{type:"eol",...e,end:this.peekSourceMap()}}yDNCLMode(){const e=this.peekSourceMap();return this.arrayIndexFrom=1,this.flagReverseArrayIndex=!0,this.flagCheckArrayInit=!0,{type:"eol",...e,end:this.peekSourceMap()}}ySetGenMode(e){const t=this.peekSourceMap();return this.genMode=e,{type:"eol",...t,end:this.peekSourceMap()}}yRequire(){const e=this.y[1].value,t=s.S.filenameToModName(e);if(this.modList.indexOf(t)<0){const e=this.modList.shift();e&&(this.modList.unshift(t),this.modList.unshift(e))}return{type:"require",value:e,josi:"",...this.peekSourceMap(),end:this.peekSourceMap()}}yBlock(){const e=this.peekSourceMap(),t=[];for(this.check("ここから")&&this.get();!this.isEOF()&&!this.checkTypes(["違えば","ここまで","エラー"])&&this.accept([this.ySentence]);)t.push(this.y[0]);return{type:"block",block:t,...e,end:this.peekSourceMap()}}yDefFuncReadArgs(){if(!this.check("("))return null;const e=[];for(this.get();!this.isEOF();){if(this.check(")")){this.get();break}const t=this.get();t&&e.push(t),this.check("comma")&&this.get()}return e}yDefTest(){return this.yDef("def_test")}yDefFunc(){return this.yDef("def_func")}yDef(e){if(!this.check(e))return null;const t=this.peekSourceMap(),s=this.get();if(!s)return null;let r=[];this.check("(")&&(r=this.yDefFuncReadArgs()||[]);const i=this.get();if(!i||"func"!==i.type)throw this.logger.debug(this.nodeToStr(i,{depth:0,typeName:"関数"},!0)+"の宣言でエラー。",i),n.ih.fromNode(this.nodeToStr(i,{depth:0,typeName:"関数"},!1)+"の宣言でエラー。",s);if(this.check("(")){if(r.length>0)throw this.logger.debug(this.nodeToStr(i,{depth:0,typeName:"関数"},!0)+"の宣言で、引数定義は名前の前か後に一度だけ可能です。",i),n.ih.fromNode(this.nodeToStr(i,{depth:0,typeName:"関数"},!1)+"の宣言で、引数定義は名前の前か後に一度だけ可能です。",i);r=this.yDefFuncReadArgs()||[]}this.check("とは")&&this.get();let o=null,u=!1,c=!1;this.check("ここから")&&(u=!0),this.check("eol")&&(u=!0);try{this.funcLevel++,this.usedAsyncFn=!1;const e=this.localvars;if(this.localvars={"それ":{type:"var",value:""}},u){this.saveStack();for(const e of r){const t=e.value?e.value+"":"";this.localvars[t]={type:"var",value:""}}if(o=this.yBlock(),!this.check("ここまで"))throw n.ih.fromNode("『ここまで』がありません。関数定義の末尾に必要です。",s);this.get(),this.loadStack()}else this.saveStack(),o=this.ySentence(),this.loadStack();this.funcLevel--,c=this.usedAsyncFn,this.localvars=e}catch(e){throw this.logger.debug(this.nodeToStr(i,{depth:0,typeName:"関数"},!0)+"の定義で以下のエラーがありました。\n"+e.message,s),n.ih.fromNode(this.nodeToStr(i,{depth:0,typeName:"関数"},!1)+"の定義で以下のエラーがありました。\n"+e.message,s)}return{type:e,name:i,args:r,block:o||[],asyncFn:c,josi:"",...t,end:this.peekSourceMap()}}yIFCond(){const e=this.peekSourceMap();let t=this.yGetArg();if(!t)return null;if("が"===t.josi){const n=this.index,s=this.yGetArg(),r=this.get();if(s&&"func"!==s.type&&r&&"ならば"===r.type)return{type:"op",operator:"でなければ"===r.value?"noteq":"eq",left:t,right:s,josi:"",...e,end:this.peekSourceMap()};this.index=n}if(""!==t.josi&&(this.stack.push(t),t=this.yCall()),!this.check("ならば")){const s=t||{type:"?",...e};throw this.logger.debug("もし文で『ならば』がないか、条件が複雑過ぎます。"+this.nodeToStr(this.peek(),{depth:1},!1)+"の直前に『ならば』を書いてください。",s),n.ih.fromNode("もし文で『ならば』がないか、条件が複雑過ぎます。"+this.nodeToStr(this.peek(),{depth:1},!1)+"の直前に『ならば』を書いてください。",s)}const s=this.get();return s&&"でなければ"===s.value&&(t={type:"not",value:t,josi:"",...e,end:this.peekSourceMap()}),t}yIF(){const e=this.peekSourceMap();if(!this.check("もし"))return null;const t=this.get();if(null==t)return null;for(;this.check("comma");)this.get();let s=null;try{s=this.yIFCond()}catch(e){throw n.ih.fromNode("『もし』文の条件で次のエラーがあります。\n"+e.message,t)}if(null===s)throw n.ih.fromNode("『もし』文で条件の指定が空です。",t);let r=null,i=null,o=!1;for(this.check("eol")?r=this.yBlock():(r=this.ySentence(),o=!0);this.check("eol");)this.get();if(this.check("違えば")){for(this.get();this.check("comma");)this.get();this.check("eol")?i=this.yBlock():(i=this.ySentence(),o=!0)}if(!1===o){if(!this.check("ここまで"))throw n.ih.fromNode("『もし』文で『ここまで』がありません。",t);this.get()}return{type:"if",expr:s||[],block:r||[],false_block:i||[],josi:"",...e,end:this.peekSourceMap()}}ySpeedMode(){const e=this.peekSourceMap();if(!this.check2(["string","実行速度優先"]))return null;const t=this.get();this.get();let n="";if(!t||!t.value)return null;n=t.value;const s={"行番号無し":!1,"暗黙の型変換無し":!1,"強制ピュア":!1,"それ無効":!1};for(const e of n.split("/")){if("全て"===e){for(const e of Object.keys(s))s[e]=!0;break}Object.keys(s).includes(e)?s[e]=!0:this.logger.warn(`実行速度優先文のオプション『${e}』は存在しません。`,t)}let r=!1;this.check("ここから")?(this.get(),r=!0):this.check("eol")&&(r=!0);let i=null;return r?(i=this.yBlock(),this.check("ここまで")&&this.get()):i=this.ySentence(),{type:"speed_mode",options:s,block:i||[],josi:"",...e}}yPerformanceMonitor(){const e=this.peekSourceMap();if(!this.check2(["string","パフォーマンスモニタ適用"]))return null;const t=this.get();if(!t)return null;this.get();const n={"ユーザ関数":!1,"システム関数本体":!1,"システム関数":!1};for(const e of t.value.split("/")){if("全て"===e){for(const e of Object.keys(n))n[e]=!0;break}Object.keys(n).includes(e)?n[e]=!0:this.logger.warn(`パフォーマンスモニタ適用文のオプション『${e}』は存在しません。`,t)}let s=!1;this.check("ここから")?(this.get(),s=!0):this.check("eol")&&(s=!0);let r=null;return s?(r=this.yBlock(),this.check("ここまで")&&this.get()):r=this.ySentence(),{type:"performance_monitor",options:n,block:r||[],josi:"",...e}}yTikuji(){const e=this.peekSourceMap();if(!this.check("逐次実行"))return null;const t=this.getCur();this.logger.warn("『逐次実行』構文の使用は非推奨になりました(https://nadesi.com/v3/doc/go.php?944)。",t);const s=[];let r=null;if(!t||!this.check("eol"))throw n.ih.fromNode("『逐次実行』の直後は改行が必要です。",t);for(;!this.check("ここまで");){if(this.check("eol")){this.get();continue}if(this.check2(["エラー","ならば"])){this.get(),this.get(),r=this.yBlock();break}let t=null;if(this.check("先に")||this.check("次に")){const s=this.get();if(this.check("comma")&&this.get(),this.check("eol")){if(t=this.yBlock(),!this.check("ここまで")){let t="次に";throw null!=s&&(t=s.type),n.ih.fromNode(`『${t}』...『ここまで』を対応させてください。`,e)}this.get()}else t=this.ySentence()}else t=this.ySentence();null!=t&&s.push(t)}if(!this.check("ここまで"))throw console.log(s,this.peek()),n.ih.fromNode("『逐次実行』...『ここまで』を対応させてください。",t);return this.get(),{type:"tikuji",blocks:s||[],errorBlock:r||[],josi:"",...e,end:this.peekSourceMap()}}yGetArgOperator(t){const s=[t];for(;!this.isEOF();){let r=this.peek();if(!r||!e.bW[r.type])break;{r=this.getCur(),s.push(r);const e=this.yValue();if(null===e)throw n.ih.fromNode(`計算式で演算子『${r.value}』後に値がありません`,t);s.push(e)}}return 0===s.length?null:1===s.length?s[0]:this.infixToAST(s)}yGetArg(){const e=this.yValue();return null===e?null:this.yGetArgOperator(e)}infixToPolish(t){const n=t=>e.bW[t.type]?e.bW[t.type]:10,s=[],r=[];for(;t.length>0;){const e=t.shift();if(!e)break;for(;s.length>0;){const t=s[s.length-1];if(n(e)>n(t))break;const i=s.pop();if(!i){this.logger.error("計算式に間違いがあります。",e);break}r.push(i)}s.push(e)}for(;s.length>0;){const e=s.pop();e&&r.push(e)}return r}infixToAST(t){if(0===t.length)return null;const s=t[t.length-1].josi,r=t[t.length-1],i=this.infixToPolish(t),o=[];for(const t of i){if(!e.bW[t.type]){o.push(t);continue}const u=o.pop(),c=o.pop();if(void 0===c||void 0===u)throw this.logger.debug("--- 計算式(逆ポーランド) ---\n"+JSON.stringify(i)),n.ih.fromNode("計算式でエラー",r);const a={type:"op",operator:t.type,left:c,right:u,josi:s,startOffset:c.startOffset,endOffset:c.endOffset,line:c.line,column:c.column,file:c.file};o.push(a)}const u=o.pop();return u||null}yGetArgParen(e){let t=!1;const s=this.stack.length;for(;!this.isEOF();){if(this.check(")")){t=!0;break}const e=this.yGetArg();if(!e)break;this.pushStack(e),this.check("comma")&&this.get()}if(!t)throw n.ih.fromNode(`C風関数『${e[0].value}』でカッコが閉じていません`,e[0]);const r=[];for(;s<this.stack.length;){const e=this.popStack();e&&r.unshift(e)}return r}yRepeatTime(){const e=this.peekSourceMap();if(!this.check("回"))return null;this.get(),this.check("comma")&&this.get(),this.check("繰返")&&this.get();let t=this.popStack([]),s=!1,r=null;if(null===t&&(t={type:"word",value:"それ",josi:"",...e,end:this.peekSourceMap()}),this.check("comma")&&this.get(),this.check("ここから")?(this.get(),s=!0):this.check("eol")&&(s=!0),s){if(r=this.yBlock(),!this.check("ここまで"))throw n.ih.fromNode("『ここまで』がありません。『回』...『ここまで』を対応させてください。",e);this.get()}else r=this.ySentence();return{type:"repeat_times",value:t,block:r||[],josi:"",...e,end:this.peekSourceMap()}}yWhile(){const e=this.peekSourceMap();if(!this.check("間"))return null;for(this.get();this.check("comma");)this.get();this.check("繰返")&&this.get();const t=this.popStack();if(null===t)throw n.ih.fromNode("『間』で条件がありません。",e);if(this.check("comma")&&this.get(),!this.checkTypes(["ここから","eol"]))throw n.ih.fromNode("『間』の直後は改行が必要です",e);const s=this.yBlock();return this.check("ここまで")&&this.get(),{type:"while",cond:t,block:s,josi:"",...e,end:this.peekSourceMap()}}yAtohantei(){const e=this.peekSourceMap();this.check("後判定")&&this.get(),this.check("繰返")&&this.get(),this.check("ここから")&&this.get();const t=this.yBlock();this.check("ここまで")&&this.get(),this.check("comma")&&this.get();let n=this.yGetArg(),s=!1;const r=this.peek();return!r||"なる"!==r.value||"まで"!==r.josi&&"までの"!==r.josi||(this.get(),s=!0),this.check("間")&&this.get(),s&&(n={type:"not",value:n,josi:"",...e,end:this.peekSourceMap()}),{type:"atohantei",cond:n||[],block:t,josi:"",...e,end:this.peekSourceMap()}}yFor(){const e=this.peekSourceMap();if(!(this.check("繰返")||this.check("増繰返")||this.check("減繰返")))return null;const t=this.getCur(),s=this.stack.pop();s&&("word"!==s.type||"増"!==s.value&&"減"!==s.value?this.stack.push(s):t.type=s.value+t.type);let r=null;"増繰返"!==t.type&&"減繰返"!==t.type||(r=this.popStack(["ずつ"]));const i=this.popStack(["まで"]),o=this.popStack(["から"]),u=this.popStack(["を","で"]);if(null===o||null===i)throw n.ih.fromNode("『繰り返す』文でAからBまでの指定がありません。",t);this.check("comma")&&this.get();let c=!1;(this.check("ここから")||this.check("eol"))&&(c=!0,this.get());let a=null;if(c){if(a=this.yBlock(),!this.check("ここまで"))throw n.ih.fromNode("『ここまで』がありません。『繰り返す』...『ここまで』を対応させてください。",e);this.get()}else a=this.ySentence();return{type:"for",from:o,to:i,inc:r,word:u,block:a||[],josi:"",...e,end:this.peekSourceMap()}}yReturn(){const e=this.peekSourceMap();if(!this.check("戻る"))return null;this.get();const t=this.popStack(["で","を"]);if(this.stack.length>0)throw n.ih.fromNode("『戻』文の直前に未解決の引数があります。『(式)を戻す』のように式をカッコで括ってください。",e);return{type:"return",value:t,josi:"",...e,end:this.peekSourceMap()}}yForEach(){const e=this.peekSourceMap();if(!this.check("反復"))return null;for(this.get();this.check("comma");)this.get();const t=this.popStack(["を"]),n=this.popStack(["で"]);let s=null,r=!1;return this.check("ここから")?(r=!0,this.get()):this.check("eol")&&(r=!0),r?(s=this.yBlock(),this.check("ここまで")&&this.get()):s=this.ySentence(),{type:"foreach",name:n,target:t,block:s||[],josi:"",...e,end:this.peekSourceMap()}}ySwitch(){const e=this.peekSourceMap();if(!this.check("条件分岐"))return null;const t=this.get();if(!t)return null;const s=this.get();if(!s)return null;const r=this.popStack(["で"]);if(!r)throw n.ih.fromNode("『(値)で条件分岐』のように記述してください。",t);if("eol"!==s.type)throw n.ih.fromNode("『条件分岐』の直後は改行してください。",t);let i=!1,o=!1;const u=[];for(;!this.isEOF();){if(this.check("ここまで")){if(o)throw n.ih.fromNode("『条件分岐』は『(条件)ならば〜ここまで』と記述してください。",t);this.get();break}if(this.check("eol")){this.get();continue}if(i)throw n.ih.fromNode("『条件分岐』で『違えば〜ここまで』の後に処理を続けることは出来ません。",t);let e=null;const s=this.peek();if(s&&"違えば"===s.type)o=!1,i=!0,e=this.get(),this.check("comma")&&this.get();else{if(o)throw n.ih.fromNode("『条件分岐』は『(条件)ならば〜ここまで』と記述してください。",t);if(e=this.yValue(),!e)throw n.ih.fromNode("『条件分岐』は『(条件)ならば〜ここまで』と記述してください。",t);const s=this.get();if(!s||"ならば"!==s.type)throw n.ih.fromNode("『条件分岐』で条件は**ならばと記述してください。",t);this.check("comma")&&this.get()}const r=this.yBlock(),c=this.peek();if(c&&"ここまで"===c.type)this.get();else{if(i)throw n.ih.fromNode("『条件分岐』は『違えば〜ここまで』と記述してください。",t);o=!0}u.push([e,r])}return{type:"switch",value:r,cases:u||[],josi:"",...e,end:this.peekSourceMap()}}yMumeiFunc(){const e=this.peekSourceMap();if(!this.check("def_func"))return null;const t=this.get();if(!t)return null;let s=[];this.check("comma")&&this.get(),this.check("(")&&(s=this.yDefFuncReadArgs()||[]),this.check("comma")&&this.get(),this.funcLevel++,this.saveStack();const r=this.yBlock();if(!this.check("ここまで"))throw n.ih.fromNode("『ここまで』がありません。『には』構文か無名関数の末尾に『ここまで』が必要です。",e);return this.get(),this.loadStack(),this.funcLevel--,{type:"func_obj",args:s,block:r,meta:t.meta,josi:"",...e,end:this.peekSourceMap()}}yDainyu(){const e=this.peekSourceMap(),t=this.get();if(null===t)return null;const s=this.popStack(["を"]),r=this.popStack(["へ","に"]);if(!r||"word"!==r.type&&"func"!==r.type&&"配列参照"!==r.type)throw n.ih.fromNode("代入文で代入先の変数が見当たりません。『(変数名)に(値)を代入』のように使います。",t);if("配列参照"===r.type)return{type:"let_array",name:r.name,index:r.index,value:s,josi:"",checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()};return{type:"let",name:this.getVarName(r),value:s,josi:"",...e,end:this.peekSourceMap()}}ySadameru(){const e=this.peekSourceMap(),t=this.get();if(null===t)return null;const s=this.popStack(["を"]),r=this.popStack(["へ","に"]);if(!s||"word"!==s.type&&"func"!==s.type&&"配列参照"!==s.type)throw n.ih.fromNode("『定める』文で定数が見当たりません。『(定数名)を(値)に定める』のように使います。",t);return{type:"def_local_var",name:this.getVarName(s),vartype:"定数",value:r,josi:"",...e,end:this.peekSourceMap()}}yIncDec(){const e=this.peekSourceMap(),t=this.get();if(null===t)return null;if(this.check("繰返"))return this.pushStack({type:"word",value:t.value,josi:t.josi,...e,end:this.peekSourceMap()}),this.yFor();let s=this.popStack(["だけ",""]);s||(s={type:"number",value:1,josi:"だけ",...e,end:this.peekSourceMap()});const r=this.popStack(["を"]);if(!r||"word"!==r.type&&"配列参照"!==r.type)throw n.ih.fromNode(`『${t.type}』文で定数が見当たりません。『(変数名)を(値)だけ${t.type}』のように使います。`,t);return"減"===t.value&&(s={type:"op",operator:"*",left:s,right:{type:"number",value:-1,line:t.line},josi:"",...e}),{type:"inc",name:r,value:s,josi:t.josi,...e,end:this.peekSourceMap()}}yCall(){if(this.isEOF())return null;for(;!this.isEOF();){if(this.check("ここから")&&this.get(),this.check("代入"))return this.yDainyu();if(this.check("定める"))return this.ySadameru();if(this.check("回"))return this.yRepeatTime();if(this.check("間"))return this.yWhile();if(this.check("繰返")||this.check("増繰返")||this.check("減繰返"))return this.yFor();if(this.check("反復"))return this.yForEach();if(this.check("条件分岐"))return this.ySwitch();if(this.check("戻る"))return this.yReturn();if(this.check("増")||this.check("減"))return this.yIncDec();if(this.check2([["func","word"],"("])){const t=this.peek();if(t&&""===t.josi){const t=this.yValue();if(t){const n=t.josi||"";if("func"===t.type&&(""===t.josi||e.QQ.indexOf(n)>=0))return t.josi="",t;this.pushStack(t)}this.check("comma")&&this.get();continue}}if(this.check("func")){const t=this.yCallFunc();if(null===t)continue;if(this.check("間")){this.pushStack(t);continue}if(!this.checkTypes(e.Ij))return t;this.pushStack(this.yGetArgOperator(t));continue}const t=this.yGetArg();if(!t)break;this.pushStack(t)}if(this.stack.length>0){this.logger.debug("--- stack dump ---\n"+JSON.stringify(this.stack,null,2)+"\npeek: "+JSON.stringify(this.peek(),null,2));let e=`不完全な文です。${this.stack.map((e=>this.nodeToStr(e,{depth:0},!0))).join("、")}が解決していません。`,t=`不完全な文です。${this.stack.map((e=>this.nodeToStr(e,{depth:0},!1))).join("、")}が解決していません。`;for(const n of this.stack){const s=this.nodeToStr(n,{depth:0},!1),r=this.nodeToStr(n,{depth:1},!1);s!==r&&(e+=`${this.nodeToStr(n,{depth:0},!0)}は${this.nodeToStr(n,{depth:1},!0)}として使われています。`,t+=`${s}は${r}として使われています。`)}const s=this.stack[0],r=this.stack[this.stack.length-1];throw this.logger.debug(e,s),n.ih.fromNode(t,s,r)}return this.popStack([])}yCallFunc(){const t=this.peekSourceMap(),r=this.get();if(!r)return null;const i=r.meta,o=r.value;let u=null;if("には"===r.josi){try{u=this.yMumeiFunc()}catch(e){throw n.ih.fromNode(`『${r.value}には...』で無名関数の定義で以下の間違いがあります。\n${e.message}`,r)}if(null===u)throw n.ih.fromNode("『Fには』構文がありましたが、関数定義が見当たりません。",r)}if(!i||void 0===i.josi)throw n.ih.fromNode("関数の定義でエラー。",r);this.recentlyCalledFunc.push({name:o,...i}),i&&i.asyncFn&&(this.usedAsyncFn=!0);const c=[];let a=0,f=0;for(let e=0;e<i.josi.length;e++)for(;;){let t=this.popStack(i.josi[e]);if(null!==t)f++;else{if(!(e<i.josi.length-1)&&i.isVariableJosi)break;a++,t=u}if(null!==t&&void 0!==i.funcPointers&&null!==i.funcPointers[e]){if("func"!==t.type){const t=i.varnames?i.varnames[e]:`${e+1}番目の引数`;throw n.ih.fromNode(`関数『${r.value}』の引数『${t}』には関数オブジェクトが必要です。`,r)}t.type="func_pointer"}if(c.push(t),e<i.josi.length-1||!i.isVariableJosi)break}if(a>=2&&(f>0||""===r.josi||e.QQ.indexOf(r.josi)>=0))throw n.ih.fromNode(`関数『${r.value}』の引数が不足しています。`,r);const l={type:"func",name:r.value,args:c,josi:r.josi,...t,end:this.peekSourceMap()};if("プラグイン名設定"===l.name&&c.length>0&&c[0]){let e=""+c[0].value;"メイン"===e&&(e=""+c[0].file),this.modName=s.S.filenameToModName(e)}return""===r.josi?l:e.QQ.indexOf(r.josi)>=0?(l.josi="して",l):(l.meta=i,this.pushStack(l),null)}yCallOp(){if(!this.check2(["func","←"]))return null;const e=this.peekSourceMap(),t=this.get();if(null==t)throw new Error("関数が取得できません。");try{if(null==this.get())throw new Error("関数呼び出し演算子が取得できません。");const s=t.value;if(!t.meta)throw new Error("関数本体を取得できません。");if(!t.meta.josi)throw new Error("関数の引数情報を取得できません。");const r=t.meta.josi.length;if(0===r)throw n.ih.fromNode(`引数がない関数『${s}』を関数呼び出し演算子で呼び出すことはできません。`,t);const i=this.stack.length;for(;!this.isEOF();){const e=this.yGetArg();if(!e)break;if(this.pushStack(e),this.stack.length-i===r)break}const o=this.stack.length-i;if(o!==r)throw n.ih.fromNode(`関数『${s}』呼び出しで引数の数(${o})が定義(${r})と違います。`,t);const u=this.stack.splice(i,r);let c=u;if(r>=2){c=[];t.meta.josi.forEach(((e,t)=>{for(let n=0;n<u.length;n++){const s=u[n];if(e.indexOf(s.josi)>=0)return void(c[t]=s)}const n=e.join(",");throw new Error(`助詞『${n}』が見当たりません。`)}))}return{type:"func",name:s,args:c,setter:!0,josi:"",...e,end:this.peekSourceMap()}}catch(e){throw this.logger.debug(`${this.nodeToStr(t,{depth:0},!0)}の関数呼び出しで引数(『←』以降)が読み取れません。`,t),n.ih.fromNode(`${this.nodeToStr(t,{depth:0},!1)}の関数呼び出しでエラーがあります。\n${e.message}`,t)}}yLet(){const e=this.peekSourceMap();if(this.check2(["word","eq"])){const t=this.peek();let s=!1;try{if(this.accept(["word","eq",this.yCalc])||this.accept(["word","eq",this.ySentence])){if("eol"===this.y[2].type)throw new Error("値が空です。");this.check("comma")&&this.get();const t=this.getVarName(this.y[0]);return{type:"let",name:t,value:this.y[2],...e,end:this.peekSourceMap()}}throw s=!0,this.logger.debug(`${this.nodeToStr(t,{depth:1},!0)}への代入文で計算式に書き間違いがあります。`,t),n.ih.fromNode(`${this.nodeToStr(t,{depth:1},!1)}への代入文で計算式に書き間違いがあります。`,e)}catch(r){if(s)throw r;throw this.logger.debug(`${this.nodeToStr(t,{depth:1},!0)}への代入文で計算式に以下の書き間違いがあります。\n${r.message}`,t),n.ih.fromNode(`${this.nodeToStr(t,{depth:1},!1)}への代入文で計算式に以下の書き間違いがあります。\n${r.message}`,e)}}if(this.check2(["word","@"])){const t=this.yLetArrayAt(e);if(this.check("comma")&&this.get(),t)return t.checkInit=this.flagCheckArrayInit,t}if(this.check2(["word","["])){const t=this.yLetArrayBracket(e);if(this.check("comma")&&this.get(),t)return t.checkInit=this.flagCheckArrayInit,t}if(this.accept(["word","とは"])){const t=this.getVarName(this.y[0]);if(!this.checkTypes(["変数","定数"]))throw n.ih.fromNode("ローカル変数『"+t.value+"』の定義エラー",t);const s=this.getCur();let r=null;return this.check("eq")&&(this.get(),r=this.yCalc()),this.check("comma")&&this.get(),{type:"def_local_var",name:t,vartype:s.type,value:r,...e,end:this.peekSourceMap()}}if(this.accept(["変数","word","eq",this.yCalc])){return{type:"def_local_var",name:this.getVarName(this.y[1]),vartype:"変数",value:this.y[3],...e,end:this.peekSourceMap()}}if(this.accept(["定数","word","eq",this.yCalc])){return{type:"def_local_var",name:this.getVarName(this.y[1]),vartype:"定数",value:this.y[3],...e,end:this.peekSourceMap()}}if(this.accept(["定数",this.yJSONArray,"eq",this.yCalc])){const t=this.y[1];if(!(t&&t.value instanceof Array))throw n.ih.fromNode("複数定数の代入文でエラー。『定数[A,B,C]=[1,2,3]』の書式で記述してください。",this.y[0]);for(const e in t.value)if("word"!==t.value[e].type)throw n.ih.fromNode(`複数定数の代入文${e+1}番目でエラー。『定数[A,B,C]=[1,2,3]』の書式で記述してください。`,this.y[0]);return t.value=this.getVarNameList(t.value),{type:"def_local_varlist",names:t.value,vartype:"定数",value:this.y[3],...e,end:this.peekSourceMap()}}if(this.accept(["変数",this.yJSONArray,"eq",this.yCalc])){const t=this.y[1];if(!(t&&t.value instanceof Array))throw n.ih.fromNode("複数変数の代入文でエラー。『変数[A,B,C]=[1,2,3]』の書式で記述してください。",this.y[0]);for(const e in t.value)if("word"!==t.value[e].type)throw n.ih.fromNode(`複数変数の代入文${e+1}番目でエラー。『変数[A,B,C]=[1,2,3]』の書式で記述してください。`,this.y[0]);return t.value=this.getVarNameList(t.value),{type:"def_local_varlist",names:t.value,vartype:"変数",value:this.y[3],...e,end:this.peekSourceMap()}}if(this.check2(["word","comma","word"])){if(this.accept(["word","comma","word","eq",this.yCalc])){let t=[this.y[0],this.y[2]];return t=this.getVarNameList(t),{type:"def_local_varlist",names:t,vartype:"変数",value:this.y[4],...e,end:this.peekSourceMap()}}if(this.accept(["word","comma","word","comma","word","eq",this.yCalc])){let t=[this.y[0],this.y[2],this.y[4]];return t=this.getVarNameList(t),{type:"def_local_varlist",names:t,vartype:"変数",value:this.y[6],...e,end:this.peekSourceMap()}}if(this.accept(["word","comma","word","comma","word","comma","word","eq",this.yCalc])){let t=[this.y[0],this.y[2],this.y[4],this.y[6]];return t=this.getVarNameList(t),{type:"def_local_varlist",names:t,vartype:"変数",value:this.y[8],...e,end:this.peekSourceMap()}}if(this.accept(["word","comma","word","comma","word","comma","word","comma","word","eq",this.yCalc])){let t=[this.y[0],this.y[2],this.y[4],this.y[6],this.y[8]];return t=this.getVarNameList(t),{type:"def_local_varlist",names:t,vartype:"変数",value:this.y[10],...e,end:this.peekSourceMap()}}}return null}checkArrayIndex(e){return 0===this.arrayIndexFrom?e:{...e,type:"op",operator:"-",left:e,right:{...e,type:"number",value:this.arrayIndexFrom}}}checkArrayReverse(e){return e?this.flagReverseArrayIndex?e.length<=1?e:e.reverse():e:[]}yLetArrayAt(e){return this.accept(["word","@",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:[this.checkArrayIndex(this.y[2])],value:this.y[4],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"@",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]),value:this.y[6],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"@",this.yValue,"@",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]),value:this.y[8],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"comma",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]),value:this.y[6],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"comma",this.yValue,"comma",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]),value:this.y[8],...e,end:this.peekSourceMap()}:null}yLetArrayBracket(e){return this.accept(["word","[",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:[this.checkArrayIndex(this.y[2])],value:this.y[5],...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"]","[",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[5])]),value:this.y[8],tag:"2",...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"comma",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]),value:this.y[7],tag:"2",...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"]","[",this.yCalc,"]","[",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[5]),this.checkArrayIndex(this.y[8])]),value:this.y[11],...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"comma",this.yCalc,"comma",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]),value:this.y[9],...e,end:this.peekSourceMap()}:null}yCalc(){const e=this.peekSourceMap();if(this.check("eol"))return null;const t=this.yGetArg();if(!t)return null;if(""===t.josi)return t;this.pushStack(t);const n=this.yCall();if(!n)return this.popStack();if("して"!==n.josi)return n;const s=this.yCalc();return s?{type:"renbun",left:n,right:s,josi:s.josi,...e,end:this.peekSourceMap()}:n}yValueKakko(){if(!this.check("("))return null;const e=this.get();if(!e)throw new Error("[System Error] check したのに get できない");this.saveStack();const t=this.yCalc()||this.ySentence();if(null===t){const t=this.get();throw this.logger.debug("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!0)+"の近く",e),n.ih.fromNode("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!1)+"の近く",e)}if(!this.check(")"))throw this.logger.debug("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!0)+"の近く",e),n.ih.fromNode("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!1)+"の近く",e);const s=this.get();return this.loadStack(),s&&(t.josi=s.josi),t}yValue(){const s=this.peekSourceMap();if(this.check("comma")&&this.get(),this.checkTypes(["number","string"]))return this.getCur();if(this.check("("))return this.yValueKakko();if(this.check2(["-","number"])||this.check2(["-","word"])||this.check2(["-","func"])){const e=this.get(),t=this.yValue(),n=t&&t.josi?t.josi:"";return{type:"op",operator:"*",left:{type:"number",value:-1,line:e&&e.line?e.line:0},right:t||[],josi:n,...s,end:this.peekSourceMap()}}if(this.check("not")){this.get();const e=this.yValue();return{type:"not",value:e,josi:e&&e.josi?e.josi:"",...s,end:this.peekSourceMap()}}const r=this.yJSONArray();if(r)return r;const i=this.yJSONObject();if(i)return i;const o=e.Ij.concat(["eol",")","]","ならば","回","間","反復","条件分岐"]);if(this.check2(["func",o])){const e=this.get();if(!e)throw new Error("[System Error] 正しく値が取れませんでした。");const t=this.getVarNameRef(e);return{type:"func",name:t.value,args:[],josi:t.josi,...s,end:this.peekSourceMap()}}if(this.check2([["func","word"],"("])&&""===this.peekDef().josi){const e=this.peek();if(this.accept([["func","word"],"(",this.yGetArgParen,")"]))return{type:"func",name:this.getVarNameRef(this.y[0]).value,args:this.y[2],josi:this.y[3].josi,...s,end:this.peekSourceMap()};throw n.ih.fromNode("C風関数呼び出しのエラー",e||t())}if(this.check2(["func","←"]))return this.yCallOp();if(this.check("def_func"))return this.yMumeiFunc();const u=this.yValueWord();return u||null}yValueWordGetIndex(e){if(e.index||(e.index=[]),this.check("@")){if(this.accept(["@",this.yValue,"comma",this.yValue,"comma",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.index.push(this.checkArrayIndex(this.y[3])),e.index.push(this.checkArrayIndex(this.y[5])),e.index=this.checkArrayReverse(e.index),e.josi=this.y[5].josi,!0;if(this.accept(["@",this.yValue,"comma",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.index.push(this.checkArrayIndex(this.y[3])),e.index=this.checkArrayReverse(e.index),e.josi=this.y[3].josi,!0;if(this.accept(["@",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.josi=this.y[1].josi,!0;throw n.ih.fromNode("変数の後ろの『@要素』の指定が不正です。",e)}if(this.check("[")&&this.accept(["[",this.yCalc,"]"]))return e.index.push(this.checkArrayIndex(this.y[1])),e.josi=this.y[2].josi,!0;if(this.check("[")&&this.accept(["[",this.yCalc,"comma",this.yCalc,"]"])){const t=[this.checkArrayIndex(this.y[1]),this.checkArrayIndex(this.y[3])];return e.index=this.checkArrayReverse(t),e.josi=this.y[4].josi,!0}if(this.check("[")&&this.accept(["[",this.yCalc,"comma",this.yCalc,"comma",this.yCalc,"]"])){const t=[this.checkArrayIndex(this.y[1]),this.checkArrayIndex(this.y[3]),this.checkArrayIndex(this.y[5])];return e.index=this.checkArrayReverse(t),e.josi=this.y[6].josi,!0}return!1}yValueWord(){const e=this.peekSourceMap();if(this.check("word")){const t=this.getCur(),s=this.getVarNameRef(t);if(""===s.josi&&this.checkTypes(["[","@"])){const t={type:"配列参照",name:s,index:[],josi:"",...e,end:this.peekSourceMap()};for(;!this.isEOF()&&this.yValueWordGetIndex(t););if(t.index&&0===t.index.length)throw n.ih.fromNode(`配列『${s.value}』アクセスで指定ミス`,s);return t}return s}return null}getVarName(e){const t=this.findVar(e.value);if(t)t&&"global"===t.scope&&(e.value=t.name);else if(0===this.funcLevel){let t=e.value;t.indexOf("__")<0&&(t=this.modName+"__"+e.value),this.funclist[t]={type:"var",value:""},e.value=t}else this.localvars[e.value]={type:"var",value:""};return e}getVarNameRef(e){const t=this.findVar(e.value);return t?t&&"global"===t.scope&&(e.value=t.name):0===this.funcLevel&&e.value.indexOf("__")<0&&(e.value=this.modName+"__"+e.value),e}getVarNameList(e){for(let t=0;t<e.length;t++)e[t]=this.getVarName(e[t]);return e}yJSONObjectValue(){const e=[],t=this.peek();if(!t)return null;for(;!this.isEOF();){for(;this.check("eol");)this.get();if(this.check("}"))break;if(this.accept(["word",":",this.yCalc]))this.y[0].type="string",e.push({key:this.y[0],value:this.y[2]});else if(this.accept(["string",":",this.yCalc]))e.push({key:this.y[0],value:this.y[2]});else if(this.check("word")){const t=this.getCur();t.type="string",e.push({key:t,value:t})}else{if(!this.checkTypes(["string","number"]))throw n.ih.fromNode("辞書オブジェクトの宣言で末尾の『}』がありません。",t);{const t=this.getCur();e.push({key:t,value:t})}}this.check("comma")&&this.get()}return e}yJSONObject(){const e=this.peekSourceMap();if(this.accept(["{","}"]))return{type:"json_obj",value:[],josi:this.y[1].josi,...e,end:this.peekSourceMap()};if(this.accept(["{",this.yJSONObjectValue,"}"]))return{type:"json_obj",value:this.y[1],josi:this.y[2].josi,...e,end:this.peekSourceMap()};if(this.accept(["{",this.yJSONObjectValue]))throw n.ih.fromNode("辞書型変数の初期化が『}』で閉じられていません。",this.y[1]);return null}yJSONArrayValue(){this.check("eol")&&this.get();const e=this.yCalc();if(null===e)return null;this.check("comma")&&this.get();const t=[e];for(;!this.isEOF()&&(this.check("eol")&&this.get(),!this.check("]"));){const e=this.yCalc();if(null===e)break;this.check("comma")&&this.get(),t.push(e)}return t}yJSONArray(){const e=this.peekSourceMap();if(this.accept(["[","]"]))return{type:"json_array",value:[],josi:this.y[1].josi,...e,end:this.peekSourceMap()};if(this.accept(["[",this.yJSONArrayValue,"]"]))return{type:"json_array",value:this.y[1],josi:this.y[2].josi,...e,end:this.peekSourceMap()};if(this.accept(["[",this.yJSONArrayValue]))throw n.ih.fromNode("配列変数の初期化が『]』で閉じられていません。",this.y[1]);return null}yTryExcept(){const e=this.peekSourceMap();if(!this.check("エラー監視"))return null;const t=this.getCur(),s=this.yBlock();if(!this.check2(["エラー","ならば"]))throw n.ih.fromNode("エラー構文で『エラーならば』がありません。『エラー監視..エラーならば..ここまで』を対で記述します。",t);this.get(),this.get();const r=this.yBlock();if(!this.check("ここまで"))throw n.ih.fromNode("『ここまで』がありません。『エラー監視』...『エラーならば』...『ここまで』を対応させてください。",e);return this.get(),{type:"try_except",block:s,errBlock:r||[],josi:"",...e,end:this.peekSourceMap()}}}class i{constructor(e,t,n){this.from=e,this.to=t,this.index=n}}class o{constructor(e,t){this.text=e,this.sourcePosition=t}}class u{constructor(e){this.history=[],this.code=e}getText(){return this.code}replaceAll(e,t){for(;;){const n=this.getText().indexOf(e);if(-1===n)break;e.length!==t.length&&this.history.unshift(new i(e.length,t.length,n)),this.code=this.code.replace(e,t)}}getSourcePosition(e){for(const t of this.history)e>=t.index+t.to?e+=t.from-t.to:t.index<=e&&e<t.index+t.to&&(e=t.to>=2&&e===t.index+t.to-1?t.index+t.from-1:t.index);return e}}class c{constructor(){this.convertTable=new Map([[8208,"-"],[8209,"-"],[8211,"-"],[8212,"-"],[8213,"-"],[8722,"-"],[732,"~"],[759,"~"],[8275,"~"],[8764,"~"],[12316,"~"],[65374,"~"],[8192," "],[8194," "],[8195," "],[8196," "],[8197," "],[8198," "],[8199," "],[8201," "],[8202," "],[8203," "],[8239," "],[8287," "],[12288," "],[12644," "],[9," "],[8251,"#"],[12290,";"],[12304,"["],[12305,"]"],[12289,","],[65292,","],[10006,"*"],[10133,"+"],[10134,"-"],[10135,"÷"]])}static getInstance(){return c._instance||(c._instance=new c),c._instance}convert1ch(e){if(!e)return"";const t=e.codePointAt(0)||0,n=this.convertTable.get(t)||"";if(n)return n;if(t<127)return e;if(t>=65281&&t<=65374){const e=t-65248;return String.fromCodePoint(e)}return e}convert(e){if(!e)return[];const t=new u(e);t.replaceAll("\r\n","\n"),t.replaceAll("\r","\n");let n=!1,s=!1,r="";const i=[];let c=0,a="",f=0;for(;f<t.getText().length;){const e=t.getText().charAt(f),u=t.getText().substr(f,2);if(n){if(e===r){n=!1,i.push(new o(a+r,t.getSourcePosition(c))),f++,c=f;continue}a+=e,f++;continue}if(s){if(u===r){s=!1,i.push(new o(a+r,t.getSourcePosition(c))),f+=2,c=f;continue}a+=e,f++;continue}if("「"===e){i.push(new o(e,t.getSourcePosition(c))),f++,c=f,n=!0,r="」",a="";continue}if("『"===e){i.push(new o(e,t.getSourcePosition(c))),f++,c=f,n=!0,r="』",a="";continue}if("“"===e){i.push(new o(e,t.getSourcePosition(c))),f++,c=f,n=!0,r="”",a="";continue}if("🌴"===u||"🌿"===u){i.push(new o(u,t.getSourcePosition(c))),f+=2,c=f,s=!0,r=u,a="";continue}const l=this.convert1ch(e);'"'!==l&&"'"!==l?"#"!==l?"//"!==u&&"//"!==u?"/*"!==u?(i.push(new o(l,t.getSourcePosition(c))),f++,c=f):(i.push(new o(u,t.getSourcePosition(c))),f+=2,c=f,s=!0,r="*/",a=""):(i.push(new o("//",t.getSourcePosition(c))),f+=2,c=f,n=!0,r="\n",a=""):(i.push(new o(l,t.getSourcePosition(c))),f++,c=f,n=!0,r="\n",a=""):(i.push(new o(l,t.getSourcePosition(c))),f++,c=f,n=!0,r=e,a="")}return(n||s)&&i.push(new o(a+r,t.getSourcePosition(c))),i}}function a(e,t){const n=(e=(e=(e=e.substring(0,256)).replace(/(!|💡)/,"!")).replace(/\/\*.*?\*\//g,"")).split(/[;。\n]/,30);for(let e of n)if(e=e.replace(/^\s+/,"").replace(/\s+$/,""),t.indexOf(e)>=0)return!0;return!1}var f=__webpack_require__(7636),l=__webpack_require__(970);const h=["!インデント構文","!ここまでだるい"];const p="🌟🌟改行🌟🌟s4j#WjcSb😀/FcX3🌟🌟";function d(e){const t=c.getInstance(),n=e.length;let s="",r="",i=0,o=!1;for(;i<n;){const n=e.charAt(i),u=e.substring(i,2),c=t.convert1ch(n),a=u.split("").map((e=>t.convert1ch(e))).join("");if(""===r){switch(c){case'"':case"'":r=n,s+=n,i++;continue;case"「":r="」",s+=n,i++;continue;case"『":r="』",s+=n,i++;continue;case"“":r="”",s+=n,i++;continue;case"{":r="}",s+=n,i++;continue;case"[":r="]",s+=n,i++;continue}switch(u){case"🌴":r="🌴",s+=u,i+=2;continue;case"🌿":r="🌿",s+=u,i+=2;continue}"#"!==c?"//"!==a?"/*"!==a?(s+=n,i++):(r="*/",o=!0,i+=2):(r="\n",o=!0,i+=2):(r="\n",o=!0,i++)}else r===(1===r.length?c:a)?(o||(s+=e.substr(i,r.length)),i+=r.length,o=!1,r=""):(o||(s+=n),i++)}return s}function _(e){let t="";for(let n=0;n<e;n++)t+=" ";return t}function y(e){const t=/^([ ・\t]*)/.exec(d(e));return t?t[1]:""}function m(e){let t=0;for(let n=0;n<e.length;n++){const s=e.charAt(n);if(" "!==s)if(" "!==s)if("・"!==s){if("\t"!==s)break;t+=4}else t+=2;else t+=2;else t++}return t}function g(e){const t=c.getInstance(),n=e.length;let s="",r="",i=0;for(;i<n;){const n=e.charAt(i),o=e.substr(i,2),u=t.convert1ch(n),c=o.split("").map((e=>t.convert1ch(e))).join("");if(""===r){switch(u){case'"':case"'":r=n,s+=n,i++;continue;case"「":r="」",s+=n,i++;continue;case"『":r="』",s+=n,i++;continue;case"“":r="”",s+=n,i++;continue;case"{":r="}",s+=n,i++;continue;case"[":r="]",s+=n,i++;continue}switch(o){case"🌴":r="🌴",s+=o,i+=2;continue;case"🌿":r="🌿",s+=o,i+=2;continue}"#"!==u?"//"!==c?"/*"!==c?(s+=n,i++):(r="*/",s+=o,i+=2):(r="\n",s+=o,i+=2):(r="\n",s+=n,i++)}else r===(1===r.length?u:c)?(s+=e.substr(i,r.length),i+=r.length,r=""):(s+="\n"===n?p:n,i++)}return s}var v={convert:function(e,t="main.nako3"){return a(e,h)?function(e,t){const s=[],r=[],i="ここまで‰",o=g(e).split("\n"),u=[],c=[];let a=0,f=-1;o.forEach((e=>{if(f+=e.split(p).length,/^[ ・\t]*$/.test(e))return void r.push({lineNumber:u.length,len:e.length});const o=d(e).replace(/^[ ・\t]+/,"").replace(/\s+$/,"");if(""===o)return void u.push(e);if("ここまで"===o)throw new n.t5("インデント構文が有効化されているときに『ここまで』を使うことはできません。",f,t);const l=m(e);if(a!==l){if(a<l)return c.push(a),a=l,void u.push(e);if(a>l)for(a=l;c.length>0;){const t=c.pop()||0;if(t===l)return"違えば"!==o.substring(0,3)&&(s.push(u.length),u.push(_(t)+i)),void u.push(e);l<t&&(s.push(u.length),u.push(_(t)+i))}}else u.push(e)}));for(;c.length>0;){const e=c.pop()||0;s.push(u.length),u.push(_(e)+i)}const l=[];for(let e=0;e<u.length;e++)if(u[e].includes(p)){const t=u[e].split(p);for(let e=0;e<s.length;e++)l.length<s[e]&&(s[e]+=t.length-1);for(let e=0;e<r.length;e++)l.length<r[e].lineNumber&&(r[e].lineNumber+=t.length-1);l.push(...t)}else l.push(u[e]);return{code:l.join("\n"),insertedLines:s,deletedLines:r}}(e,t):{code:e,insertedLines:[],deletedLines:[]}},getBlockStructure:function(e){const t={lines:[],pairs:[],parents:[],spaces:[]},n=g(e).split("\n"),s=[];let r=0,i=m(n[0]);for(const e of n){const n=e.split(p).length,o=d(e),u=""===o.replace(/^[ ・\t]+/,"")?i:m(o);if(t.lines.push(...Array(n).fill(u)),t.spaces.push(...Array(n).fill(y(o))),i<u)s.push(r-1);else if(i>u){const e=s.pop();void 0!==e&&t.pairs.push([e,r])}const c=void 0!==s[s.length-1]?s[s.length-1]:null;t.parents.push(...Array(n).fill(c)),i=u,r+=n}for(const e of s)t.pairs.push([e,r]);return t},getIndent:y,countIndent:m,isIndentSyntaxEnabled:function(e){return a(e,h)}};const b=["!DNCLモード"];function k(e,t){if(!a(e=e.replace(/(\r\n|\r)/g,"\n"),b))return e;return w(e,t)}function S(e){let t="";for(let n=0;n<e;n++)t+=" ";return t}function w(e,t){e=function(e){const t=c.getInstance();let n="",s=!1,r="";for(let i=0;i<e.length;i++){const o=e.charAt(i);let u=t.convert1ch(o);if(s){if(u===r){s=!1,r="",n+=u;continue}n+=o}else"「"!==u?'"'!==u?("{"===u&&(u="["),"}"===u&&(u="]"),"←"===u&&(u="="),"÷"===u&&(u="÷÷"),n+=u):(s=!0,r='"',n+=u):(s=!0,r="」",n+=u)}return n}(e);const n=e.split("\n");for(let e=0;e<n.length;e++){let s=n[e];n[e]=s.replace(/^(\s*[|\s]+)(.*$)/,((e,t,n)=>S(t.length)+n)),s=n[e];const r=s.replace(/^\s+/,"").replace(/\s+$/,"");"繰り返し,"!==r&&"繰り返し"!==r||(n[e]="後判定で繰り返し");const i=s.match(/^\s*を,?(.+)になるまで(繰り返す|実行する)/);if(i){n[e]=`ここまで、(${i[1]})になるまでの間`;continue}const o=s.match(/^もし(.+)を実行する(。|.)*/);if(o){const s=w(o[1],t);n[e]=`もし、${s};`;continue}const u=s.match(/^(.+?)のすべての(要素|値)(を|に)(.+?)(にする|を代入)/);if(u){const t=u[1],s=u[4];n[e]=`${t} = [${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s}]`}else;}e=n.join("\n");const s={"を実行する":"ここまで","を実行し,そうでなくもし":"違えば、もし","を実行し,そうでなくもし":"違えば、もし","を実行し、そうでなくもし":"違えば、もし","を実行し,そうでなければ":"違えば","を実行し,そうでなければ":"違えば","を実行し、そうでなければ":"違えば","を繰り返す":"ここまで","改行なしで表示":"連続無改行表示","ずつ増やしながら":"ずつ増やし繰り返す","ずつ減らしながら":"ずつ減らし繰り返す","二進で表示":"二進表示","でないならば":"でなければ"},r=()=>{const t=e.charAt(0);return e=e.substring(1),t};let i=!1,o="",u="",a="";for(;""!==e;){const t=e.charAt(0);if(i){if(t===u){a+=o+u,o="",i=!1,r();continue}o+=r();continue}if('"'===t){i=!0,u='"',o=r();continue}if("「"===t){i=!0,u="」",o=r();continue}if("『"===t){i=!0,u="』",o=r();continue}if(" "===t||" "===t||"\t"===t){a+=r();continue}const n=e.substring(0,3);if("を表示"===n){a+="を連続表示",e=e.substring(3);continue}if("を 表示"===e.substring(0,4)){a+="を連続表示",e=e.substring(4);continue}if("乱数"===e.substring(0,2)&&"乱数範囲"!==e.substring(0,4)){a+="乱数範囲",e=e.substring(2);continue}"増やす"!==n&&"減らす"!==n||("だけ"!==a.substring(a.length-2)&&(a+="だけ"),a+=n,e=e.substring(3));let c=!1;for(const t in s){if(e.substring(0,t.length)===t){a+=s[t],e=e.substring(t.length),c=!0;break}}c||(a+=r())}return a}var j=__webpack_require__(4085),$={"初期化":{type:"func",josi:[],pure:!0,fn:function(){}},SIN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.sin(e)}},COS:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.cos(e)}},TAN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.tan(e)}},ARCSIN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.asin(e)}},ARCCOS:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.acos(e)}},ARCTAN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.atan(e)}},ATAN2:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return Math.atan2(e,t)}},"座標角度計算":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return 180*Math.atan2(e[1],e[0])/Math.PI}},RAD2DEG:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/Math.PI*180}},DEG2RAD:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/180*Math.PI}},"度変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/Math.PI*180}},"ラジアン変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/180*Math.PI}},SIGN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return 0===parseFloat(e)?0:e>0?1:-1}},"符号":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__exec("SIGN",[e])}},ABS:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.abs(e)}},"絶対値":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.abs(e)}},EXP:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.exp(e)}},HYPOT:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return Math.hypot(e,t)}},"斜辺":{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return Math.hypot(e,t)}},LN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.log(e)}},LOG:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.log(e)}},LOGN:{type:"func",josi:[["で"],["の"]],pure:!0,fn:function(e,t){return 2===e?Math.LOG2E*Math.log(t):10===e?Math.LOG10E*Math.log(t):Math.log(t)/Math.log(e)}},FRAC:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e%1}},"小数部分":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e%1}},"整数部分":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.trunc(e)}},"乱数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.floor(Math.random()*e)}},"乱数範囲":{type:"func",josi:[["から"],["までの","の"]],pure:!0,fn:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}},SQRT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.sqrt(e)}},"平方根":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.sqrt(e)}},ROUND:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.round(e)}},"四捨五入":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return Math.round(e)}},"小数点切上":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=Math.pow(10,t);return Math.ceil(e*n)/n}},"小数点切下":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=Math.pow(10,t);return Math.floor(e*n)/n}},"小数点四捨五入":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}},CEIL:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.ceil(e)}},"切上":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.ceil(e)}},FLOOR:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.floor(e)}},"切捨":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.floor(e)}}};const x={delimiter:",",eol:"\r\n"};function O(e,t){void 0===t&&(t=x.delimiter),e=(e=(e+="\n").replace(/(\r\n|\r)/g,"\n")).replace(/\s+$/,"")+"\n";const n=new RegExp("^(.*?)([\\"+t+"\\n])"),s=function(e){return"string"==typeof e&&e.search(/^[0-9.]+$/)>=0&&(e=parseFloat(e)),e},r=[];let i=[],o="";for(;""!==e;){if(o=e.charAt(0),o===t){e=e.substring(1),i.push("");continue}if("\n"===o){i.push(""),r.push(i),i=[],e=e.substring(1);continue}if(o=(e=e.replace(/^\s+/,"")).charAt(0),o===t){console.log("delimiter"),i.push(""),e=e.substring(t.length);continue}if("="===o&&'"'===e.charAt(1)){e=e.substring(1);continue}if('"'!==o){const o=n.exec(e);if(!o){i.push(s(e)),r.push(i),i=[];break}"\n"===o[2]?(i.push(s(o[1])),r.push(i),i=[]):o[2]===t&&i.push(s(o[1])),e=e.substring(o[0].length);continue}if('""'===e.substring(0,2)){i.push(""),e=e.substring(2);continue}let u=1,c="";for(;u<e.length;){const n=e.charAt(u),o=e.charAt(u+1);if('"'!==n||'"'!==o)if('"'!==n)c+=n,u++;else{if(u++,o===t){u++,i.push(s(c)),c="";break}if("\n"===o){u++,i.push(s(c)),r.push(i),i=[];break}u++}else u+=2,c+='"'}e=e.substr(u)}return i.length>0&&r.push(i),r}function A(e,t,n){void 0===t&&(t=x.delimiter),void 0===n&&(n=x.eol);const s=function(e){return function(t){let n=!1;return((t=""+t).indexOf("\n")>=0||t.indexOf("\r")>=0)&&(n=!0),t.indexOf(e)>=0&&(n=!0),t.indexOf('"')>=0&&(n=!0,t=t.replace(/"/g,'""')),n&&(t='"'+t+'"'),t}}(t);if(void 0===e)return"";let r="";for(let i=0;i<e.length;i++){const o=e[i];if(void 0!==o){for(let e=0;e<o.length;e++)o[e]=s(o[e]);r+=o.join(t)+n}else r+=n}return r=r.replace(/(\r\n|\r|\n)/g,n),r}var F={"初期化":{type:"func",josi:[],pure:!0,fn:function(){}},"CSV取得":{type:"func",josi:[["を","の","で"]],pure:!0,fn:function(e){return x.delimiter=",",O(e)}},"TSV取得":{type:"func",josi:[["を","の","で"]],pure:!0,fn:function(e){return x.delimiter="\t",O(e)}},"表CSV変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return x.delimiter=",",A(e)}},"表TSV変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return x.delimiter="\t",A(e)}}},C={"初期化":{type:"func",josi:[],pure:!0,fn:function(e){null==e.__promise&&(e.__promise={setLastPromise:function(t){return e.__v0["そ"]=t,t}})}},"そ":{type:"const",value:""},"動時":{type:"func",josi:[["を","で"]],pure:!0,fn:function(e,t){return t.__promise.setLastPromise(new Promise(((t,n)=>e(t,n))))},return_none:!1},"成功時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.then((t=>(n.__v0["対象"]=t,e(t)))))},return_none:!1},"処理時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.then((t=>(n.__v0["対象"]=t,e(!0,t,n))),(t=>(n.__v0["対象"]=t,e(!1,t,n)))))},return_none:!1},"失敗時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.catch((t=>(n.__v0["対象"]=t,e(t)))))},return_none:!1},"終了時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.finally((()=>e())))},return_none:!1},"束":{type:"func",josi:[["と","を"]],pure:!0,fn:function(...e){return e.pop().__promise.setLastPromise(Promise.all(e))},return_none:!1}},N={"ASSERT等":{type:"func",josi:[["と"],["が"]],pure:!0,fn:function(e,t){if(e!==t)throw new Error(`不一致 [実際]${e} [期待]${t}`);return!0}},"テスト実行":{type:"func",josi:[["と"],["で"]],pure:!1,fn:function(e,t,n){n.__exec("ASSERT等",[e,t,n])}},"テスト等":{type:"func",josi:[["と"],["が"]],pure:!1,fn:function(e,t,n){n.__exec("ASSERT等",[e,t,n])}}};class M{constructor(e,t){this.sourceCodeLength=e,this.preprocessed=t;let n=0;this.cumulativeSum=[];for(const e of t)this.cumulativeSum.push(n),n+=e.text.length;this.lastIndex=0,this.lastPreprocessedCodePosition=0}map(e){const t=this.findIndex(e);return Math.min(this.preprocessed[t].sourcePosition+(e-this.cumulativeSum[t]),t===this.preprocessed.length-1?this.sourceCodeLength:this.preprocessed[t+1].sourcePosition-1)}findIndex(e){e<this.lastPreprocessedCodePosition&&(this.lastIndex=0),this.lastPreprocessedCodePosition=e;for(let t=this.lastIndex;t<this.preprocessed.length-1;t++)if(e<this.cumulativeSum[t+1])return this.lastIndex=t,t;return this.lastIndex=this.preprocessed.length-1,this.preprocessed.length-1}}class L{constructor(e,t,n){this.lines=[],this.linesInsertedByIndentationSyntax=t,this.linesDeletedByIndentationSyntax=n;let s=0;for(const t of e.split("\n"))this.lines.push({offset:s,len:t.length}),s+=t.length+1;this.lastLineNumber=0,this.lastOffset=0}map(e,t){if(null===e)return{startOffset:e,endOffset:t};const n=this.getLineNumber(e);for(const s of this.linesInsertedByIndentationSyntax){if(n===s){e=null,t=null;break}n>s&&(e-=this.lines[s].len+1,null!==t&&(t-=this.lines[s].len+1))}for(const s of this.linesDeletedByIndentationSyntax)n>=s.lineNumber&&(null!==e&&(e+=s.len+1),null!==t&&(t+=s.len+1));return{startOffset:e,endOffset:t}}getLineNumber(e){e<this.lastOffset&&(this.lastLineNumber=0),this.lastOffset=e;for(let t=this.lastLineNumber;t<this.lines.length-1;t++)if(e<this.lines[t+1].offset)return this.lastLineNumber=t,t;return this.lastLineNumber=this.lines.length-1,this.lines.length-1}}class E{constructor(e){this.lineOffsets=[];let t=0;for(const n of e.split("\n"))this.lineOffsets.push(t),t+=n.length+1;this.lastLineNumber=0,this.lastOffset=0}map(e,t){e<this.lastOffset&&(this.lastLineNumber=0),this.lastOffset=e;for(let n=this.lastLineNumber;n<this.lineOffsets.length-1;n++)if(e<this.lineOffsets[n+1])return this.lastLineNumber=n,{line:n+(t?1:0),column:e-this.lineOffsets[n]};return this.lastLineNumber=this.lineOffsets.length-1,{line:this.lineOffsets.length-1+(t?1:0),column:e-this.lineOffsets[this.lineOffsets.length-1]}}}function T(e,t){if("number"==typeof e.startOffset&&(e.startOffset-=t.length),"number"==typeof e.endOffset&&(e.endOffset-=t.length),""!==t){const n=t.split("\n");"number"==typeof e.line&&(e.line-=n.length-1),0===e.line&&"number"==typeof e.column&&(e.column-=n[n.length-1].length)}return e}const I=["black","red","green","yellow","blue","magenta","cyan","white"],P=e=>{const t=e.replace(/\x1b\[\d+m/g,""),n=[];let s="inherit",r="inherit";const i=e===t?t:e.replace(/\x1b\[(\d+)m/g,((e,t)=>{const i=+t;return 0===i&&(s="inherit",r="inherit"),1===i&&(r="bold"),i>=30&&i<=37&&(s=I[i-30]),n.push(`color: ${s}; font-weight: ${r};`),"%c"}));let o="inherit",u="inherit";var c;return{noColor:t,nodeConsole:e===t?t:e+"[0m",html:e===t?t:"<span>"+(c=e,c.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")).replace(/\x1b\[(\d+)m/g,((e,t)=>{const n=+t;return 0===n&&(o="inherit",u="inherit"),1===n&&(u="bold"),n>=30&&n<=37&&(o=I[n-30]),`</span><span style="color: ${o}; font-weight: ${u};">`}))+"</span>",browserConsole:[i,...n]}},J={reset:"[0m",bold:"[1m",black:"[30m",red:"[31m",green:"[32m",yellow:"[33m",blue:"[34m",magenta:"[35m",cyan:"[36m",white:"[37m"};class G{static fromS(e){let t=G.trace;switch(e){case"all":t=G.all;break;case"trace":t=G.trace;break;case"debug":t=G.debug;break;case"info":t=G.info;break;case"warn":t=G.warn;break;case"error":t=G.error;break;case"stdout":t=G.stdout;break;default:throw new Error("[NakoLogger] unknown logger level:"+e)}return t}static toString(e){return["all","trace","debug","info","warn","error","stdout"][e]}}function R(e){return e?`${e.file||""}${void 0===e.line?"":`(${e.line+1}行目): `}`:""}G.all=0,G.trace=1,G.debug=2,G.info=3,G.warn=4,G.error=5,G.stdout=6;class D{constructor(){this.listeners=[]}addListener(e,t){const n=G.fromS(e);this.listeners.push({level:n,callback:t})}removeListener(e){this.listeners=this.listeners.filter((t=>t.callback!==e))}trace(e,t=null){this.sendI(G.trace,`${J.bold}[デバッグ情報(詳細)]${J.reset}${R(t)}${e}`,t)}debug(e,t=null){this.sendI(G.debug,`${J.bold}[デバッグ情報]${J.reset}${R(t)}${e}`,t)}info(e,t=null){this.sendI(G.info,`${J.bold}${J.blue}[情報]${J.reset}${R(t)}${e}`,t)}warn(e,t=null){this.sendI(G.warn,`${J.bold}${J.green}[警告]${J.reset}${R(t)}${e}`,t)}error(e,t=null){e instanceof n.k?this.sendI(G.error,`${J.red}${e.tag}${J.reset}${e.positionJa}${e.msg}`,t):(e instanceof Error&&(e=e.message),this.sendI(G.error,`${J.bold}${J.red}[エラー]${J.reset}${R(t)}${e}`,t))}stdout(e,t=null){this.sendI(G.stdout,`${e}`,t)}send(e,t,n,s=null,r=null){const i=G.fromS(e);this.sendI(i,t,n,s,r)}sendI(e,t,n,s=null,r=null){const i=()=>{const i=P(t);let o="";t.includes("\n")&&(o+="border-top: 1px solid #8080806b; border-bottom: 1px solid #8080806b;");return{noColor:i.noColor,nodeConsole:i.nodeConsole,browserConsole:r||i.browserConsole,html:`<div style="${o}">`+(s||i.html)+"</div>",level:G.toString(e),position:n}};for(const t of this.listeners)if(t.level<=e){const e=i();t.callback(e)}}}class V{constructor(e,t){this.__locals={},this.__varslist=[{...e.__varslist[0]},{...e.__varslist[1]},{...e.__varslist[2]}],this.numFailures=0,this.index=0,this.nextIndex=-1,this.__code=[],this.__callstack=[],this.__stack=[],this.__labels=[],this.__genMode=t.genMode,this.version=e.version,this.coreVersion=e.coreVersion,this.__module={...e.__module},this.pluginfiles={...e.getPluginfiles()},this.gen=t,this.logger=e.getLogger(),this.compiler=e}clearLog(){this.__varslist[0]["表示ログ"]=""}get log(){let e=this.__varslist[0]["表示ログ"];return e=e.replace(/\s+$/,""),e}runEx(e,t,n,s=""){return this.compiler._runEx(e,t,n,s,this)}_runTests(e){let t=`${J.bold}テストの実行結果${J.reset}\n`,n=0,s=0;for(const r of e)try{r.f(),t+=`${J.green}✔${J.reset} ${r.name}\n`,n++}catch(e){t+=`${J.red}☓${J.reset} ${r.name}: ${e.message}\n`,s++}t+=s>0?`${J.green}成功 ${n}件 ${J.red}失敗 ${s}件`:`${J.green}成功 ${n}件`,this.numFailures=s,this.logger.stdout(t)}clearPlugins(){for(const e in this.pluginfiles){const t=this.__module[e];t["!クリア"]&&t["!クリア"].fn&&t["!クリア"].fn(this)}}reset(){this.clearPlugins()}destroy(){this.reset()}}var q=__webpack_require__(6211);const B=e=>JSON.parse(JSON.stringify(e));class W{constructor(e){void 0===e&&(e={useBasicPlugin:!0}),this.__varslist=[{},{},{}],this.__locals={},this.__self=this,this.__vars=this.__varslist[2],this.__v0=this.__varslist[0],this.__v1=this.__varslist[1],this.version=q.Z.version,this.coreVersion=q.Z.version,this.__globals=[],this.__module={},this.pluginFunclist={},this.funclist={},this.pluginfiles={},this.commandlist=new Set,this.nakoFuncList={},this.eventList=[],this.logger=new D,this.prepare=c.getInstance(),this.parser=new r(this.logger),this.lexer=new s.S(this.logger),this.dependencies={},this.usedFuncs=new Set,this.numFailures=0,e.useBasicPlugin&&this.addBasicPlugins()}getLogger(){return this.logger}getNakoFuncList(){return this.nakoFuncList}getNakoFunc(e){return this.nakoFuncList[e]}getPluginfiles(){return this.pluginfiles}addBasicPlugins(){this.addPluginObject("PluginSystem",j.Z),this.addPluginObject("PluginMath",$),this.addPluginObject("PluginPromise",C),this.addPluginObject("PluginAssert",N),this.addPluginObject("PluginCSV",F)}replaceLogger(){return this.lexer.logger=this.parser.logger=this.logger=new D}static listRequireStatements(e){const t=[];for(let n=0;n+2<e.length;n++)"not"!==e[n].type||"string"!==e[n+1].type&&"string_ex"!==e[n+1].type||"取込"!==e[n+2].value||(t.push({...e[n],start:n,end:n+3,value:e[n+1].value+"",firstToken:e[n],lastToken:e[n+2]}),n+=2);return t}_loadDependencies(e,t,r,i){const o={},u=new W({useBasicPlugin:!0}),c=(e,t)=>{const n=i.readJs(e.filePath,e.firstToken);t.push(n.task.then((t=>{const n=t();this.addPluginFile(e.value,e.filePath,n,!1),o[e.filePath].funclist=n,o[e.filePath].addPluginFile=()=>{this.addPluginFile(e.value,e.filePath,n,!1)}})))},a=(e,t)=>{const n=i.readNako3(e.filePath,e.firstToken),r=t=>{t=`『${s.S.filenameToModName(e.filePath)}』にプラグイン名設定;`+t+";『メイン』にプラグイン名設定;";const n=this.rawtokenize(t,0,e.filePath);o[e.filePath].tokens=n;const r={};return s.S.preDefineFunc(B(n),this.logger,r),o[e.filePath].funclist=r,f(t,e.filePath,"")};t.push(n.task.then((e=>r(e))))},f=(e,t,s)=>{const r=[],f=W.listRequireStatements(u.rawtokenize(e,0,t,s)).map((e=>({...e,...i.resolvePath(e.value,e.firstToken,t)})));for(const e of f)if(o.hasOwnProperty(e.filePath))o[e.filePath].alias.add(e.value);else if(o[e.filePath]={tokens:[],alias:new Set([e.value]),addPluginFile:()=>{},funclist:{}},"js"===e.type||"mjs"===e.type)c(e,r);else{if("nako3"!==e.type)throw new n.l0(`ファイル『${e.value}』を読み込めません。ファイルが存在しないか未対応の拡張子です。`,e.firstToken.file,e.firstToken.line);a(e,r)}if(r.length>0)return Promise.all(r)};try{const n=f(e,t,r);return void 0!==n&&n.catch((e=>{this.logger.warn(e.msg)})),this.dependencies=o,n}catch(e){throw this.logger.warn(""+e),e}}rawtokenize(e,t,s,r=""){if(!e.startsWith(r))throw new Error("codeの先頭にはpreCodeを含める必要があります。");const{code:i,insertedLines:o,deletedLines:u}=v.convert(e,s),c=k(i,s),a=this.prepare.convert(c),f=new M(i.length,a),l=new L(i,o,u),h=new E(e);let p;try{p=this.lexer.tokenize(a.map((e=>e.text)).join(""),t,s)}catch(e){if(!(e instanceof n.cg))throw e;const t=l.map(f.map(e.preprocessedCodeStartOffset),f.map(e.preprocessedCodeEndOffset)),i=null===t.startOffset?e.line:h.map(t.startOffset,!1).line,o=T({...t,line:i},r);throw new n.tO(e.msg,o.startOffset,o.endOffset,o.line,s)}return p.map((e=>{const t=l.map(f.map(e.preprocessedCodeOffset||0),f.map((e.preprocessedCodeOffset||0)+(e.preprocessedCodeLength||0)));let n=e.line,s=0;if("eol"===e.type&&null!==t.endOffset){const e=h.map(t.endOffset,!1);n=e.line,s=e.column}else if(null!==t.startOffset){const e=h.map(t.startOffset,!1);n=e.line,s=e.column}return{...e,...T({line:n,column:s,startOffset:t.startOffset,endOffset:t.endOffset},r),rawJosi:e.josi}}))}converttoken(e,t,n){return this.lexer.replaceTokens(e,t,n)}reset(){this.__varslist=[this.__varslist[0],{},{}],this.__v0=this.__varslist[0],this.__v1=this.__varslist[1],this.__vars=this.__varslist[2],this.__locals={},this.funclist={};for(const e of Object.keys(this.__v0)){const t=this.pluginFunclist[e];t&&(this.funclist[e]=JSON.parse(JSON.stringify(t)))}this.lexer.setFuncList(this.funclist)}lexCodeToken(e,t,n,s){let r=this.rawtokenize(e,t,n,"");if(null===s)for(const e of r)e.startOffset=void 0,e.endOffset=void 0;else for(const e of r)void 0!==e.startOffset&&(e.startOffset+=s),void 0!==e.endOffset&&(e.endOffset+=s);const i=r.filter((e=>"line_comment"===e.type||"range_comment"===e.type)).map((e=>({...e})));return r=this.converttoken(r,!1,n),{tokens:r,commentTokens:i}}replaceRequireStatements(e,t=new Set){const s=[];for(const r of W.listRequireStatements(e).reverse()){if(t.has(r.value)){s.push(...e.splice(r.start||0,(r.end||0)-(r.start||0)));continue}const i=Object.keys(this.dependencies).find((e=>this.dependencies[e].alias.has(r.value)));if(void 0===i){if(!r.firstToken)throw new Error(`ファイル『${r.value}』が読み込まれていません。`);throw new n.tO(`ファイル『${r.value}』が読み込まれていません。`,r.firstToken.startOffset||0,r.firstToken.endOffset||0,r.firstToken.line,r.firstToken.file)}this.dependencies[i].addPluginFile();const o=B(this.dependencies[i].tokens);t.add(r.value),s.push(...this.replaceRequireStatements(o,t)),s.push(...e.splice(r.start||0,(r.end||0)-(r.start||0),...o))}return s}removeRequireStatements(e){const t=[];for(const n of W.listRequireStatements(e).reverse()){const s=Object.keys(this.dependencies).find((e=>this.dependencies[e].alias.has(n.value)));void 0!==s&&this.dependencies[s].addPluginFile(),t.push(...e.splice(n.start||0,(n.end||0)-(n.start||0)))}return t}lex(e,t="main.nako3",n="",r=!1){let i=this.rawtokenize(e,0,t,n);const o=r?this.removeRequireStatements(i):this.replaceRequireStatements(i,void 0);for(const e of o)"word"!==e.type&&"not"!==e.type||(e.type="require");if(o.length>=3)for(let e=0;e<o.length;e+=3){let t=o[e+1].value;t=s.S.filenameToModName(t),this.lexer.modList.indexOf(t)<0&&this.lexer.modList.push(t)}const u=i.filter((e=>"line_comment"===e.type||"range_comment"===e.type)).map((e=>({...e})));i=this.converttoken(i,!0,t);for(let e=0;e<i.length;e++)if(i[e]&&"code"===i[e].type){const n=this.lexCodeToken(i[e].value,i[e].line,t,i[e].startOffset||0);u.push(...n.commentTokens),i.splice(e,1,...n.tokens),e--}return this.logger.trace("--- lex ---\n"+JSON.stringify(i,null,2)),{commentTokens:u,tokens:i,requireTokens:o}}parse(e,t,s=""){this.lexer.setFuncList(this.funclist),this.parser.setFuncList(this.funclist);const r=this.lex(e,t,s);let i;try{this.parser.genMode="sync",i=this.parser.parse(r.tokens,t)}catch(e){if("number"!=typeof e.startOffset)throw n.ih.fromNode(e.message,r.tokens[this.parser.getIndex()]);throw e}return this.usedFuncs=this.getUsedFuncs(i),this.logger.trace("--- ast ---\n"+JSON.stringify(i,null,2)),i}getUsedFuncs(e){const t=[e];for(this.usedFuncs=new Set;t.length>0;){const e=t.pop();null!=e&&null!==e.block&&void 0!==e.block&&this.getUsedAndDefFuncs(t,JSON.parse(JSON.stringify(e.block)))}return this.deleteUnNakoFuncs()}getUsedAndDefFuncs(e,t){for(;t.length>0;){const n=t.pop();null!=n&&this.getUsedAndDefFunc(n,e,t)}}getUsedAndDefFunc(e,t,n){["func","func_pointer"].includes(e.type)&&null!==e.name&&void 0!==e.name&&this.usedFuncs.add(e.name),t.push([e,e.block]),n.push.apply(n,[e.value].concat(e.args))}deleteUnNakoFuncs(){for(const e of this.usedFuncs)this.commandlist.has(e)||this.usedFuncs.delete(e);return this.usedFuncs}compile(e,t,n=!1,s=""){const r=this.parse(e,t,s);return this.generateCode(r,new f.un(n)).runtimeEnv}generateCode(e,t){switch(e.genMode){case"sync":return(0,f.Im)(this,e,t);case"非同期モード":return this.logger.warn("『!非同期モード』の利用は非推奨です。[詳細](https://github.com/kujirahand/nadesiko3/issues/1164)"),l.g.generate(this,e,t.isTest);default:throw new Error(`コードジェネレータの「${e.genMode}」はサポートされていません。`)}}_run(e,t,n,s,r=""){const i={resetEnv:n,resetAll:n,testOnly:s};return this._runEx(e,t,i,r)}clearPlugins(){this.__globals.forEach((e=>{e.reset()}))}_runEx(e,t,n,s="",r){let i;try{const r=Object.assign({resetEnv:!0,testOnly:!1,resetAll:!0},n);r.resetEnv&&this.reset(),r.resetAll&&this.clearPlugins(),this.eventList.filter((e=>"beforeParse"===e.eventName)).map((t=>t.callback(e)));const o=this.parse(e,t,s);this.eventList.filter((e=>"beforeGenerate"===e.eventName)).map((e=>e.callback(o))),i=this.generateCode(o,new f.un(r.testOnly)),this.eventList.filter((e=>"afterGenerate"===e.eventName)).map((e=>e.callback(i)))}catch(e){throw this.logger.error(e),e}r=r||new V(this,i.gen),this.__globals.indexOf(r)<0&&this.__globals.push(r),this.eventList.filter((e=>"beforeRun"===e.eventName)).map((e=>e.callback(r)));return new Function(i.runtimeEnv).apply(r),this.eventList.filter((e=>"afterRun"===e.eventName)).map((e=>e.callback(r))),r}addListener(e,t){this.eventList.push({eventName:e,callback:t})}runEx(e,t,n,s=""){return this._runEx(e,t,n,s)}test(e,t,n="",s){return this._runEx(e,t,{testOnly:s||!0},n)}run(e,t="main.nako3",n=""){return this._runEx(e,t,{resetAll:!1},n)}runReset(e,t="main.nako3",n=""){return this._runEx(e,t,{resetAll:!0,resetEnv:!0},n)}compileStandalone(e,t,n){const s=this.parse(e,t);return this.generateCode(s,n).standalone}addPlugin(e,t=!0){const n=this.__varslist[0];void 0===n.meta&&(n.meta={});for(const s in e){const r=e[s];if(this.funclist[s]=r,t&&(this.pluginFunclist[s]=JSON.parse(JSON.stringify(r))),"func"===r.type)n[s]=r.fn;else{if("const"!==r.type&&"var"!==r.type)throw console.error("[プラグイン追加エラー]",r),new Error("プラグインの追加でエラー。");n[s]=r.value,n.meta[s]={readonly:"const"===r.type}}"初期化"!==s&&"!"!==s.substring(0,1)&&this.commandlist.add(s)}}addPluginObject(e,t,n=!0){if(this.__module[e]=t,this.pluginfiles[e]="*","object"==typeof t["初期化"]){const n=t["初期化"];delete t["初期化"];t[`!${e}:初期化`]=n}if(t.meta&&t.meta.value&&"object"==typeof t.meta){const n=t.meta;delete t.meta;t[`__${n.value.pluginName||e}`.replace("-","__")]=n}this.addPlugin(t,n)}addPluginFile(e,t,n,s=!0){e.indexOf("\\")>=0&&(e=e.replace(/\\/g,"/")),this.addPluginObject(e,n,s),void 0===this.pluginfiles[e]&&(this.pluginfiles[e]=t)}addFunc(e,t,n,s=!0,r=!1){this.funclist[e]={josi:t,fn:n,type:"func",return_none:s,asyncFn:r},this.pluginFunclist[e]=B(this.funclist[e]),this.__varslist[0][e]=n}getFunc(e){return this.funclist[e]}}var U={"AJAX送信時":{type:"func",josi:[["の"],["まで","へ","に"]],pure:!0,fn:function(e,t,n){let s=n.__v0["AJAXオプション"];""===s&&(s={method:"GET"}),fetch(t,s).then((e=>e.text())).then((t=>{n.__v0["対象"]=t,"非同期モード"===n.__genMode&&(n.newenv=!0),e(t,n)})).catch((e=>{console.log("[fetch.error]",e),n.__v0["AJAX:ONERROR"](e)}))},return_none:!0},"AJAX受信":{type:"func",josi:[["から","を"]],pure:!0,fn:function(e,t){if("非同期モード"!==t.__genMode)throw new Error("『AJAX受信』を使うには、プログラムの冒頭で「!非同期モード」と宣言してください。");const n=t.setAsync(t);let s=t.__v0["AJAXオプション"];""===s&&(s={method:"GET"}),fetch(e,s).then((e=>{if(e.ok)return e.text();throw new Error("status="+e.status)})).then((e=>{t.__v0["対象"]=e,t.compAsync(t,n)})).catch((e=>{console.error("[AJAX受信のエラー]",e),t.__errorAsync(e,t)}))},return_none:!0},"AJAX受信時":{type:"func",josi:[["で"],["から","を"]],pure:!0,fn:function(e,t,n){n.__exec("AJAX送信時",[e,t,n])},return_none:!0},"GET送信時":{type:"func",josi:[["の"],["まで","へ","に"]],pure:!1,fn:function(e,t,n){n.__exec("AJAX送信時",[e,t,n])},return_none:!0},"POSTデータ生成":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e,t){const n=[];for(const t in e){const s=e[t],r=encodeURIComponent(t)+"="+encodeURIComponent(s);n.push(r)}return n.join("&")}},"POST送信時":{type:"func",josi:[["の"],["まで","へ","に"],["を"]],pure:!1,fn:function(e,t,n,s){const r=s.__exec("POSTデータ生成",[n,s]);fetch(t,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r}).then((e=>e.text())).then((t=>{s.__v0["対象"]=t,e(t)})).catch((e=>{s.__v0["AJAX:ONERROR"](e)}))}},"POSTフォーム送信時":{type:"func",josi:[["の"],["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n,s){const r=new FormData;for(const e in n)r.set(e,n[e]);fetch(t,{method:"POST",body:r}).then((e=>e.text())).then((t=>{s.__v0["対象"]=t,e(t)})).catch((e=>{s.__v0["AJAX:ONERROR"](e)}))}},"AJAX失敗時":{type:"func",josi:[["の"]],pure:!0,fn:function(e,t){t.__v0["AJAX:ONERROR"]=e}},"AJAXオプション":{type:"const",value:""},"AJAXオプション設定":{type:"func",josi:[["に","へ","と"]],pure:!0,fn:function(e,t){t.__v0["AJAXオプション"]=e},return_none:!0},"AJAXオプションPOST設定":{type:"func",josi:[["を","で"]],pure:!0,fn:function(e,t){const n={method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t.__exec("POSTデータ生成",[e,t])};t.__v0["AJAXオプション"]=n},return_none:!0},"AJAX送信":{type:"func",josi:[["まで","へ","に"]],pure:!0,fn:function(e,t){if(!t.resolve)throw new Error("『AJAX送信』は『逐次実行』構文内で利用する必要があります。");t.__exec("AJAX逐次送信",[e,t])},return_none:!0},"AJAX逐次送信":{type:"func",josi:[["まで","へ","に"]],pure:!0,fn:function(e,t){if(!t.resolve)throw new Error("『AJAX逐次送信』は『逐次実行』構文内で利用する必要があります。");t.resolveCount++;const n=t.resolve,s=t.reject;let r=t.__v0["AJAXオプション"];""===r&&(r={method:"GET"}),fetch(e,r).then((e=>e.text())).then((e=>{t.__v0["対象"]=e,n()})).catch((e=>{s(e.message)}))},return_none:!0},"AJAX保障送信":{type:"func",josi:[["まで","へ","に"]],pure:!0,fn:function(e,t){let n=t.__v0["AJAXオプション"];return""===n&&(n={method:"GET"}),fetch(e,n)},return_none:!1},"HTTP取得":{type:"func",josi:[["の","から","を"]],pure:!0,fn:function(e,t){if(!t.resolve)throw new Error("『HTTP取得』は『逐次実行』構文内で利用する必要があります。");t.__exec("AJAX逐次送信",[e,t])},return_none:!0},"HTTP逐次取得":{type:"func",josi:[["の","から","を"]],pure:!1,fn:function(e,t){if(!t.resolve)throw new Error("『HTTP逐次取得』は『逐次実行』構文内で利用する必要があります。");t.__exec("AJAX逐次送信",[e,t])},return_none:!0},"HTTP保障取得":{type:"func",josi:[["の","から","を"]],pure:!0,fn:function(e,t){return t.__exec("AJAX保障送信",[e,t])},return_none:!1},"POST逐次送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!1,fn:function(e,t,n){if(!n.resolve)throw new Error("『POST送信』は『逐次実行』構文内で利用する必要があります。");n.resolveCount++;const s=n.resolve,r=n.reject,i=n.__exec("POSTデータ生成",[t,n]);fetch(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i}).then((e=>e.text())).then((e=>{n.__v0["対象"]=e,s(e)})).catch((e=>{r(e.message)}))},return_none:!0},"POST送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!1,fn:function(e,t,n){if(!n.resolve)throw new Error("『POST送信』は『逐次実行』構文内で利用する必要があります。");n.__exec("POST逐次送信",[e,t,n])},return_none:!0},"POST保障送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n){const s=n.__exec("POSTデータ生成",[t,n]);return fetch(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s})},return_none:!1},"POSTフォーム逐次送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n){if(!n.resolve)throw new Error("『POSTフォーム逐次送信』は『逐次実行』構文内で利用する必要があります。");n.resolveCount++;const s=n.resolve,r=n.reject,i=new FormData;for(const e in t)i.set(e,t[e]);fetch(e,{method:"POST",body:i}).then((e=>e.text())).then((e=>{n.__v0["対象"]=e,s(e)})).catch((e=>{r(e.message)}))},return_none:!0},"POSTフォーム送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!1,fn:function(e,t,n){if(!n.resolve)throw new Error("『POSTフォーム送信』は『逐次実行』構文内で利用する必要があります。");n.__exec("POSTフォーム逐次送信",[e,t,n])},return_none:!0},"POSTフォーム保障送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n){const s=new FormData;for(const e in t)s.set(e,t[e]);return fetch(e,{method:"POST",body:s})},return_none:!1},"AJAX内容取得":{type:"func",josi:[["から"],["で"]],pure:!0,fn:function(e,t,n){return"TEXT"===(t=t.toString().toUpperCase())||"テキスト"===t?e.text():"JSON"===t?e.json():"BLOB"===t?e.blob():"ARRAY"===t||"配列"===t?e.arrayBuffer():"BODY"===t||"本体"===t?e.body:e.body()},return_none:!1},"AJAXテキスト取得":{type:"func",josi:[["から"]],pure:!0,asyncFn:!0,fn:async function(e,t){let n=t.__v0["AJAXオプション"];""===n&&(n={method:"GET"});const s=await fetch(e,n);return await s.text()},return_none:!1},"AJAX_JSON取得":{type:"func",josi:[["から"]],pure:!0,asyncFn:!0,fn:async function(e,t){let n=t.__v0["AJAXオプション"];""===n&&(n={method:"GET"});const s=await fetch(e,n);return await s.json()},return_none:!1}};const X={"初期化":{type:"func",josi:[],pure:!0,fn:function(e){"undefined"==typeof self&&(self={}),"undefined"==typeof navigator&&(navigator={}),e.__v0["AJAX:ONERROR"]=e=>{console.log(e)},e.__v0.SELF=self,e.__v0.NAVIGATOR=navigator}}};[{"水色":{type:"const",value:"aqua"},"紫色":{type:"const",value:"fuchsia"},"緑色":{type:"const",value:"lime"},"青色":{type:"const",value:"blue"},"赤色":{type:"const",value:"red"},"黄色":{type:"const",value:"yellow"},"黒色":{type:"const",value:"black"},"白色":{type:"const",value:"white"},"茶色":{type:"const",value:"maroon"},"灰色":{type:"const",value:"gray"},"金色":{type:"const",value:"gold"},"黄金色":{type:"const",value:"gold"},"銀色":{type:"const",value:"silver"},"白金色":{type:"const",value:"silver"},"オリーブ色":{type:"const",value:"olive"},"ベージュ色":{type:"const",value:"beige"},"アリスブルー色":{type:"const",value:"aliceblue"},RGB:{type:"func",josi:[["と"],["と"],["で","の"]],pure:!0,fn:function(e,t,n){const s=e=>{const t="00"+e.toString(16);return t.substr(t.length-2,2)};return"#"+s(e)+s(t)+s(n)},return_none:!1},"色混":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=e=>{const t="00"+e.toString(16);return t.substr(t.length-2,2)};if(!e)throw new Error("『色混ぜる』の引数には配列を指定します");if(e.length<3)throw new Error("『色混ぜる』の引数には[RR,GG,BB]形式の配列を指定します");return"#"+t(e[0])+t(e[1])+t(e[2])},return_none:!1}},U,{"HTML変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return String(e).replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<")}},"クリップボード設定":{type:"func",josi:[["を"]],pure:!0,fn:function(e){if(navigator.clipboard)navigator.clipboard.writeText(e);else{const t=document.createElement("div"),n=document.createElement("pre");n.style.webkitUserSelect="auto",n.style.userSelect="auto",t.appendChild(n).textContent=e,t.style.position="fixed",t.right="200%",document.body.appendChild(t),document.getSelection().selectAllChildren(t),document.execCommand("copy"),document.body.removeChild(t)}},return_none:!0},"クリップボード取得時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){if(!navigator.clipboard)throw new Error("Clipbard APIが利用できません。");"string"==typeof e&&(e=t.__findFunc(e,"クリップボード取得時"));navigator.clipboard.readText().then((n=>{t.__v0["対象"]=n,e(t)}))}}},{"WS接続完了時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){t.__v0["WS:ONOPEN"]=e},return_none:!0},"WS受信時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){t.__v0["WS:ONMESSAGE"]=e},return_none:!0},"WSエラー発生時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){t.__v0["WS:ONERROR"]=e},return_none:!0},"WS接続":{type:"func",josi:[["に","へ","の"]],pure:!0,fn:function(e,t){const n=new WebSocket(e);return n.onopen=()=>{const e=t.__v0["WS:ONOPEN"];e&&e(t)},n.onerror=e=>{const n=t.__v0["WS:ONERROR"];n&&n(e,t),console.log("WSエラー",e)},n.onmessage=e=>{t.__v0["対象"]=e.data;const n=t.__v0["WS:ONMESSAGE"];n&&n(t)},t.__v0["WS:SOCKET"]=n,n}},"WS送信":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){t.__v0["WS:SOCKET"].send(e)}},"WS切断":{type:"func",josi:[],pure:!0,fn:function(e){e.__v0["WS:SOCKET"].close()}}}].forEach((e=>{const t={};Object.assign(t,e),void 0!==t["初期化"]&&delete t["初期化"],Object.assign(X,t)}));var Y=X;var z={"初期化":{type:"func",josi:[],pure:!0,fn:function(e){e.__v0.SELF=self||{},e.__v0["依頼主"]=self||{}}},"対象イベント":{type:"const",value:""},"受信データ":{type:"const",value:""},SELF:{type:"const",value:""},"依頼主":{type:"const",value:""},"NAKOワーカーデータ受信時":{type:"func",josi:[["で"]],pure:!1,fn:function(e,t){e=t.__findVar(e,null),t.__varslist[0]["PluginWorker:ondata"]=(n,s)=>(t.__v0["受信データ"]=n,t.__v0["対象イベント"]=s,e(s,t))},return_none:!0},"ワーカーメッセージ受信時":{type:"func",josi:[["で"]],pure:!1,fn:function(e,t){e=t.__findVar(e,null),self.onmessage=n=>(t.__v0["受信データ"]=n.data,t.__v0["対象イベント"]=n,e(n,t))},return_none:!0},"NAKOワーカーデータ送信":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){postMessage({type:"data",data:e})},return_none:!0},"ワーカーメッセージ送信":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){postMessage(e)},return_none:!0},"表示":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){postMessage({type:"output",data:e})},return_none:!0},"終了":{type:"func",josi:[],pure:!0,fn:function(e){close()},return_none:!0}};class H extends W{constructor(){super(),this.__varslist[0]["ナデシコ種類"]="wwnako3",this.__varslist[0]["PluginWorker:ondata"]=(e,t)=>{throw new Error("『NAKOワーカーデータ受信時』が呼ばれていません。")}}}if("object"==typeof navigator&&self&&self instanceof WorkerGlobalScope){const e=navigator.nako3=new H;let t=e;e.addPluginObject("PluginBrowserInWorker",Y),e.addPluginObject("PluginWorker",z),e.logger.addListener("error",(function(e){self.postMessage({type:"error",data:e})}),!1),self.onmessage=n=>{const s=n.data||{type:"",data:""},r=s.type||"",i=s.data||"";switch(r){case"reset":e.reset();break;case"close":self.close();break;case"run":t=t.runEx(i,"_webworker.nako3",{resetEnv:!1,resetLog:!1});break;case"trans":i.forEach((t=>{"func"===t.type?(e.nako_func[t.name]=t.content.meta,e.funclist[t.name]=t.content.func,e.__varslist[1][t.name]=()=>{}):"val"===t.type&&(e.__varslist[2][t.name]=t.content)}));break;case"data":t.__varslist[0]["PluginWorker:ondata"]&&t.__varslist[0]["PluginWorker:ondata"].apply(t,[i,n])}}}}()})();
|
|
1
|
+
(function(){"use strict";var __webpack_modules__={4228:function(e,t){t.Z={version:"3.3.47",major:3,minor:3,patch:47}},6297:function(e,t,n){n.d(t,{as:function(){return a},cg:function(){return o},ih:function(){return c},k:function(){return r},l0:function(){return f},t5:function(){return i},tO:function(){return u}});var s=n(4228);class r extends Error{constructor(e,t,n,r){const i=`${n||""}${void 0===r?"":`(${r+1}行目): `}`;super(`[${e}]${i}${t=t.replace(/『main__(.+?)』/g,"『$1』")}\n[バージョン] ${s.Z.version}`),this.name="NakoError",this.type="NakoError",this.tag="["+e+"]",this.positionJa=i,this.msg=t}}class i extends r{constructor(e,t,n){super("インデントエラー",e,n,t),this.type="NakoIndentError",this.line=t,this.file=n}}class o extends r{constructor(e,t,n,s,r){super("字句解析エラー(内部エラー)",e,r,s),this.type="InternalLexerError",this.preprocessedCodeStartOffset=t,this.preprocessedCodeEndOffset=n,this.line=s,this.file=r}}class u extends r{constructor(e,t,n,s,r){super("字句解析エラー",e,r,s),this.type="NakoLexerError",this.startOffset=t,this.endOffset=n,this.line=s,this.file=r}}class c extends r{constructor(e,t,n,s,r){super("文法エラー",e,r,t),this.type="NakoSyntaxError",this.file=r,this.line=t,this.startOffset=n,this.endOffset=s}static fromNode(e,t,n){if(!t)return new c(e,void 0,void 0,void 0,void 0);const s="number"==typeof t.startOffset?t.startOffset:void 0,r=n&&"number"==typeof n.endOffset?n.endOffset:"number"==typeof t.endOffset?t.endOffset:void 0;return new c(e,t.line,s,r,t.file)}}class a extends r{constructor(e,t){let n,s,i,o="unknown";"string"==typeof e?o=e:e instanceof a||e instanceof r?o=e.msg:e instanceof Error&&(o="Error"===e.name?e.message:`${e.name}: ${e.message}`),void 0===t?(n=void 0,s=void 0):(i=/^l(-?\d+):(.*)$/.exec(t))?(n=parseInt(i[1]),s=i[2]):(i=/^l(-?\d+)$/.exec(t))?(n=parseInt(i[1]),s="main.nako3"):(n=0,s=t),super("実行時エラー",o,s,n),this.type="NakoRuntimeError",this.lineNo=t,this.line=n,this.file=s}}class f extends r{constructor(e,t,n){super("取り込みエラー",e,t,n),this.file=t,this.line=n}}},9485:function(e,t,n){n.d(t,{Im:function(){return u},Jc:function(){return o},un:function(){return i}});var s=n(6297),r=n(8294);class i{constructor(e=!1,t=[],n="",s=""){this.isTest=e,this.codeStandalone=n,this.codeEnv=s,this.importFiles=["plugin_system.mjs","plugin_math.mjs","plugin_csv.mjs","plugin_promise.mjs","plugin_test.mjs"];for(const e of t)this.importFiles.push(e)}}class o{constructor(e){this.nakoFuncList={...e.getNakoFuncList()},this.nakoTestFuncs={},this.usedFuncSet=new Set,this.loopId=1,this.numAsyncFn=0,this.usedAsyncFn=!1,this.flagLoop=!1,this.__self=e,this.genMode="sync",this.lastLineNo=null,this.varslistSet=e.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varsSet={isFunction:!1,names:new Set,readonly:new Set},this.varslistSet[2]=this.varsSet,this.speedMode={lineNumbers:0,implicitTypeCasting:0,invalidSore:0,forcePure:0},this.performanceMonitor={userFunction:0,systemFunction:0,systemFunctionBody:0,mumeiId:0},this.warnUndefinedVar=!0,this.warnUndefinedReturnUserFunc=1,this.warnUndefinedCallingUserFunc=1,this.warnUndefinedCallingSystemFunc=1,this.warnUndefinedCalledUserFuncArgs=1}static isValidIdentifier(e){return/^(?!(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$)[$A-Z_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(e)}convLineno(e,t=!1){if(this.speedMode.lineNumbers>0)return"";let n;if(n="number"!=typeof e.line?"unknown":"string"!=typeof e.file?`l${e.line}`:`l${e.line}:${e.file}`,!t){if(n===this.lastLineNo)return"";this.lastLineNo=n}return`__v0.line=${JSON.stringify(n)};`}varname(e){return 3===this.varslistSet.length?`__varslist[2][${JSON.stringify(e)}]`:o.isValidIdentifier(e)?e:`__vars[${JSON.stringify(e)}]`}static getFuncName(e){if(e.indexOf("__")>=0){const t=e.split("__");return`${t[0]}__${o.getFuncName(t[1])}`}let t=e.replace(/[ぁ-ん]+$/,"");return""===t&&(t=e),t}static convPrint(e){return`__print(${e});`}convRequire(e){const t=e.value;return this.convLineno(e,!1)+`__module['${t}'] = require('${t}');\n`}getDefFuncCode(e,t){let n="";n+=`const nakoVersion = { version: ${JSON.stringify(e.version)} }\n`,n+="const __self = self;\n",n+="self.__self = self;\n",n+="const __varslist = self.__varslist;\n",n+="const __module = self.__module;\n",n+="const __v0 = self.__v0 = self.__varslist[0];\n",n+="const __v1 = self.__v1 = self.__varslist[1];\n",n+="const __vars = self.__vars = self.__varslist[2];\n";let s="";for(const e in this.nakoFuncList){const t=this.nakoFuncList[e].fn;s+=`//[DEF_FUNC name='${e}' asyncFn=${this.nakoFuncList[e].asyncFn?"true":"false"}]\nself.__varslist[1]["${e}"]=${t};\n;//[/DEF_FUNC name='${e}']\n`}if(""!==s&&(n+="__v0.line='関数の定義';\n"+s),t.isTest){let e="const __tests = [];\n";for(const t in this.nakoTestFuncs){e+=`${this.nakoTestFuncs[t].fn};\n;`}""!==e&&(n+="__v0.line='テストの定義';\n",n+=e+"\n")}return n}addPlugin(e){return this.__self.addPlugin(e)}addPluginObject(e,t){this.__self.addPluginObject(e,t)}addPluginFile(e,t,n){this.__self.addPluginFile(e,t,n)}addFunc(e,t,n){this.__self.addFunc(e,t,n)}getFunc(e){return this.__self.getFunc(e)}registerFunction(e){if("block"!==e.type)throw s.ih.fromNode("構文解析に失敗しています。構文は必ずblockが先頭になります",e);const t=[],n=e=>{if(!e.block)return;const s=e.block instanceof Array?e.block:[e.block];for(let e=0;e<s.length;e++){const r=s[e];if("def_func"===r.type){if(!r.name)throw new Error("[System Error] 関数の定義で関数名が指定されていない");const e=r.name.value;this.usedFuncSet.add(e),this.__self.__varslist[1][e]=function(){},this.varslistSet[1].names.add(e);const n=r.name.meta;this.nakoFuncList[e]={josi:n.josi,fn:()=>{},type:"func",asyncFn:r.asyncFn},t.push({name:e,node:r})}else if("speed_mode"===r.type){if(!r.block)continue;"block"===r.block.type?n(r.block):n(r)}else if("performance_monitor"===r.type){if(!r.block)continue;"block"===r.block.type?n(r.block):n(r)}}};n(e);const r=new Set;0===this.speedMode.invalidSore&&r.add("それ"),this.varsSet={isFunction:!1,names:r,readonly:new Set},this.varslistSet=this.__self.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varslistSet[2]=this.varsSet}convGen(e,t){const n=this.convLineno(e,!1)+this._convGen(e,!0);return t.isTest?"":n}_convGen(e,t){if(!e)return"";let n="";if(e instanceof Array){for(let s=0;s<e.length;s++){const r=e[s];n+=this._convGen(r,t)}return n}if(null===e)return"null";if(void 0===e)return"undefined";if("object"!=typeof e)return""+e;switch(e.type){case"nop":break;case"block":if(n+=`;__self.__modName='${r.S.filenameToModName(e.file||"")}';\n`,!e.block)return n;const s=e.block instanceof Array?e.block:[e.block];for(let e=0;e<s.length;e++){const t=s[e];n+=this._convGen(t,!1)}break;case"comment":case"eol":n+=this.convComment(e);break;case"break":n+=this.convCheckLoop(e,"break");break;case"continue":n+=this.convCheckLoop(e,"continue");break;case"end":n+="__varslist[0]['終']();";break;case"number":n+=e.value;break;case"string":n+=this.convString(e);break;case"def_local_var":n+=this.convDefLocalVar(e);break;case"def_local_varlist":n+=this.convDefLocalVarlist(e);break;case"let":n+=this.convLet(e);break;case"inc":n+=this.convInc(e);break;case"word":case"variable":n+=this.convGetVar(e);break;case"op":case"calc":n+=this.convOp(e);break;case"renbun":n+=this.convRenbun(e);break;case"not":n+="(("+this._convGen(e.value,!0)+")?0:1)";break;case"func":case"func_pointer":case"calc_func":n+=this.convCallFunc(e,t);break;case"if":n+=this.convIf(e);break;case"tikuji":n+=this.convTikuji(e);break;case"for":n+=this.convFor(e);break;case"foreach":n+=this.convForeach(e);break;case"repeat_times":n+=this.convRepeatTimes(e);break;case"speed_mode":n+=this.convSpeedMode(e,t);break;case"performance_monitor":n+=this.convPerformanceMonitor(e,t);break;case"while":n+=this.convWhile(e);break;case"atohantei":n+=this.convAtohantei(e);break;case"switch":n+=this.convSwitch(e);break;case"let_array":n+=this.convLetArray(e);break;case"配列参照":n+=this.convRefArray(e);break;case"json_array":n+=this.convJsonArray(e);break;case"json_obj":n+=this.convJsonObj(e);break;case"func_obj":n+=this.convFuncObj(e);break;case"bool":n+=e.value?"true":"false";break;case"null":n+="null";break;case"def_test":n+=this.convDefTest(e);break;case"def_func":n+=this.convDefFunc(e);break;case"return":n+=this.convReturn(e);break;case"try_except":n+=this.convTryExcept(e);break;case"require":n+=this.convRequire(e);break;default:throw new Error("System Error: unknown_type="+e.type)}return n}findVar(e){if(this.varslistSet.length>3&&this.varsSet.names.has(e))return{i:this.varslistSet.length-1,name:e,isTop:!0,js:this.varname(e)};for(let t=2;t>=0;t--)if(this.varslistSet[t].names.has(e))return{i:t,name:e,isTop:!1,js:`__varslist[${t}][${JSON.stringify(e)}]`};return null}genVar(e,t){const n=this.findVar(e),r=t.line;if(null===n){if("引数"===e||"それ"===e||"対象"===e||"対象キー"===e);else if(this.warnUndefinedVar){const n=e.replace(/^main__(.+)$/,"$1");this.__self.getLogger().warn(`変数『${n}』は定義されていません。`,t)}return this.varsSet.names.add(e),this.varname(e)}if(0===n.i){const i=this.__self.getNakoFunc(e);if(!i)return`${n.js}/*err:${r}*/`;if("const"===i.type||"var"===i.type)return n.js;if("func"===i.type){if(!i.josi||0===i.josi.length)return`(${n.js}())`;throw s.ih.fromNode(`『${e}』が複文で使われました。単文で記述してください。(v1非互換)`,t)}throw s.ih.fromNode(`『${e}』は関数であり参照できません。`,t)}return n.js}convGetVar(e){const t=e.value;return this.genVar(t,e)}convComment(e){let t=String(e.value);t=t.replace(/\n/g,"¶");const n=this.convLineno(e,!1);return""===t&&""===n?";":""===t?";"+n+"\n":";"+n+"//"+t+"\n"}convReturn(e){if(this.varsSet.names.has("!関数"))throw s.ih.fromNode("『戻る』がありますが、関数定義内のみで使用可能です。",e);const t=this.convLineno(e,!1);let n;if(e.value)n=this._convGen(e.value,!0);else{if(0!==this.speedMode.invalidSore)return t+"return;";n=this.varname("それ")}return 0===this.warnUndefinedReturnUserFunc?t+`return ${n};`:t+`return (function(a){if(a===undefined){__self.logger.warn('ユーザ関数からundefinedが返されています',{file:'${e.file}',line:${e.line}});};return a;})(${n});`}convCheckLoop(e,t){if(!this.flagLoop){const n="continue"===t?"続ける":"抜ける";throw s.ih.fromNode(`『${n}』文がありますが、それは繰り返しの中で利用してください。`,e)}return this.convLineno(e)+t+";"}convDefFuncCommon(e,t){let n="",s="";if(0!==this.performanceMonitor.userFunction){let e=t;e||(void 0===this.performanceMonitor.mumeiId&&(this.performanceMonitor.mumeiId=0),this.performanceMonitor.mumeiId++,e=`anous_${this.performanceMonitor.mumeiId}`),n=`const performanceMonitorEnd = (function (key, type) {\nconst uf_start = performance.now() * 1000;\nreturn function () {\nconst el_time = performance.now() * 1000 - uf_start;\nif (!__self.__performance_monitor) {\n__self.__performance_monitor={};\n__self.__performance_monitor[key] = { called:1, totel_usec: el_time, min_usec: el_time, max_usec: el_time, type: type };\n} else if (!__self.__performance_monitor[key]) {\n__self.__performance_monitor[key] = { called:1, totel_usec: el_time, min_usec: el_time, max_usec: el_time, type: type };\n} else {\n__self.__performance_monitor[key].called++;\n__self.__performance_monitor[key].totel_usec+=el_time;\nif(__self.__performance_monitor[key].min_usec>el_time){__self.__performance_monitor[key].min_usec=el_time;}\nif(__self.__performance_monitor[key].max_usec<el_time){__self.__performance_monitor[key].max_usec=el_time;}\n}};})('${e}', 'user');try {\n`,s="} finally { performanceMonitorEnd(); }\n"}let r="";const i=new Set;0===this.speedMode.invalidSore&&i.add("それ"),this.varsSet={isFunction:!0,names:i,readonly:new Set},this.varslistSet.push(this.varsSet),r+=" var 引数 = arguments;\n",r+=" var __vars = {};\n";const u=Array.from(this.varsSet.names.values());let c="";const a=t?e.name.meta:e.meta;for(let n=0;n<a.varnames.length;n++){const s=a.varnames[n];0===this.warnUndefinedCalledUserFuncArgs?c+=` ${this.varname(s)} = arguments[${n}];\n`:c+=t?` ${this.varname(s)} = (function(a){if(a===undefined){__self.logger.warn('ユーザ関数(${t})の引数(${this.varname(s)})にundefinedが渡されました',{file:'${e.file}',line:${e.line}});};return a;})(arguments[${n}]);\n`:` ${this.varname(s)} = (function(a){if(a===undefined){__self.logger.warn('匿名関数の引数(${this.varname(s)})にundefinedが渡されました',{file:'${e.file}',line:${e.line}});};return a;})(arguments[${n}]);\n`,this.varsSet.names.add(s)}t&&(this.usedFuncSet.add(t),this.varslistSet[1].names.add(t),void 0===this.nakoFuncList[t]&&(this.nakoFuncList[t]={josi:e.name.meta.josi,fn:()=>{},type:"func",asyncFn:!1}));const f=this.usedAsyncFn;this.usedAsyncFn=!1;c+=this._convGen(e.block,!1).split("\n").map((e=>" "+e)).join("\n")+"\n",0===this.speedMode.invalidSore&&(c+=` return (${this.varname("それ")});\n`),c+=s,t&&this.usedAsyncFn&&(this.nakoFuncList[t].asyncFn=!0);for(const e of Array.from(this.varsSet.names.values()))u.includes(e)||o.isValidIdentifier(e)&&(r+=` var ${e};\n`);0===this.speedMode.invalidSore&&(o.isValidIdentifier("それ")?r+=" var それ = '';\n":r+=` ${this.varname("それ")} = '';`);return c=(this.usedAsyncFn?"(async function(){\n":"(function(){\n")+n+r+c+"",c+="})",t&&(this.nakoFuncList[t].fn=c,this.nakoFuncList[t].asyncFn=this.usedAsyncFn,a.asyncFn=this.usedAsyncFn),this.usedAsyncFn=f,this.varslistSet.pop(),this.varsSet=this.varslistSet[this.varslistSet.length-1],t&&(this.__self.__varslist[1][t]=c),c}convDefTest(e){const t=e.name.value;let n=`__tests.push({ name: '${t}', f: () => {\n`;return n+=` ${this._convGen(e.block,!1)}\n}});`,this.nakoTestFuncs[t]={josi:e.name.meta.josi,fn:n,type:"test_func"},""}convDefFunc(e){if(!e.name)return"";const t=o.getFuncName(e.name.value);return this.convDefFuncCommon(e,t),""}convFuncObj(e){return this.convDefFuncCommon(e,"")}convJsonObj(e){return"{"+e.value.map((e=>`${this._convGen(e.key,!0)}:${this._convGen(e.value,!0)}`)).join(",")+"}"}convJsonArray(e){return"["+e.value.map((e=>this._convGen(e,!0))).join(",")+"]"}convRefArray(e){const t=this._convGen(e.name,!0),n=e.index;let s=t;if(!n)return s;for(let e=0;e<n.length;e++){s+="["+this._convGen(n[e],!0)+"]"}return s}convLetArray(e){const t=this._convGen(e.name,!0),n=e.index||[];let s="",r=t,i="";if(e.checkInit){const e="[0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0]";s+=`\n/*配列初期化*/if (!(${t} instanceof Array)) { ${t} = ${e}; console.log('初期化:${t}') };`;for(let r=0;r<n.length-1;r++){i+=`[${this._convGen(n[r],!0)}]`,s+=`\n/*配列初期化${r}*/if (!(${t}${i} instanceof Array)) { ${t}${i} = ${e}; };`}s+="\n"}for(let e=0;e<n.length;e++){r+="["+this._convGen(n[e],!0)+"]"}r+=" = "+this._convGen(e.value,!0)+";\n";return this.convLineno(e,!1)+s+r}convGenLoop(e){const t=this.flagLoop;this.flagLoop=!0;try{return this._convGen(e,!1)}finally{this.flagLoop=t}}convFor(e){let t;if(null!==e.word){const n=e.word.value;this.varsSet.names.add(n),t=this.varname(n)}else this.varsSet.names.add("dummy"),t=this.varname("dummy");const n=this.loopId++,s=`$nako_i${n}`,r=this._convGen(e.from,!0),i=this._convGen(e.to,!0);let o="1";null===e.inc&&void 0!==e.inc&&"null"!==e.inc||(o=this._convGen(e.inc,!0));const u=this.convGenLoop(e.block),c=`$nako_from${n}`,a=`$nako_to${n}`;let f="";0===this.speedMode.invalidSore&&(f=`${this.varname("それ")} = `);const l=`\n//[FOR id=${n}]\nconst ${c} = ${r};\nconst ${a} = ${i};\nif (${c} <= ${a}) { // up\n for (let ${s} = ${c}; ${s} <= ${a}; ${s}+= ${o}) {\n ${f}${t} = ${s};\n ${u}\n };\n} else { // down\n for (let ${s} = ${c}; ${s} >= ${a}; ${s}-= ${o}) {\n ${f}${t} = ${s};\n ${u}\n };\n};\n//[/FOR id=${n}]\n`;return this.convLineno(e,!1)+l}convForeach(e){let t;if(null===e.target){if(0!==this.speedMode.invalidSore)throw s.ih.fromNode("『反復』の対象がありません。",e);t=this.varname("それ")}else t=this._convGen(e.target,!0);let n='__v0["対象"]';e.name&&(n=this.varname(e.name.value),this.varsSet.names.add(e.name.value));const r=this.convGenLoop(e.block),i=this.loopId++;let o="";0===this.speedMode.invalidSore&&(o=`${this.varname("それ")} = `);const u=`let $nako_foreach_v${i}=${t};\nfor (let $nako_i${i} in $nako_foreach_v${i}){\n if ($nako_foreach_v${i}.hasOwnProperty($nako_i${i})) {\n ${n} = ${o}$nako_foreach_v${i}[$nako_i${i}];\n __v0["対象キー"] = $nako_i${i};\n ${r}\n }\n};\n`;return this.convLineno(e,!1)+u}convRepeatTimes(e){const t=this.loopId++,n=this._convGen(e.value,!0),s=this.convGenLoop(e.block);let r="";0===this.speedMode.invalidSore&&(r=`${this.varname("それ")} = `);const i=`let $nako_times_v${t} = ${n};\nfor(var $nako_i${t} = 1; $nako_i${t} <= $nako_times_v${t}; $nako_i${t}++){\n ${r}__v0["回数"] = $nako_i${t};\n `+s+"\n}\n";return this.convLineno(e,!1)+i}convSpeedMode(e,t){if(!e.options)return"";const n={...this.speedMode};e.options["行番号無し"]&&this.speedMode.lineNumbers++,e.options["暗黙の型変換無し"]&&this.speedMode.implicitTypeCasting++,e.options["強制ピュア"]&&this.speedMode.forcePure++,e.options["それ無効"]&&this.speedMode.invalidSore++;try{return this._convGen(e.block,t)}finally{this.speedMode=n}}convPerformanceMonitor(e,t){const n={...this.performanceMonitor};if(!e.options)return"";e.options["ユーザ関数"]&&this.performanceMonitor.userFunction++,e.options["システム関数本体"]&&this.performanceMonitor.systemFunctionBody++,e.options["システム関数"]&&this.performanceMonitor.systemFunction++;try{return this._convGen(e.block,t)}finally{this.performanceMonitor=n}}convWhile(e){const t=`while (${this._convGen(e.cond,!0)}){\n ${this.convGenLoop(e.block)}\n}\n`;return this.convLineno(e,!1)+t}convAtohantei(e){const t=`$nako_i${this.loopId++}`,n=this._convGen(e.cond,!0),s=`for(;;) {\n ${this.convGenLoop(e.block)}\n let ${t} = ${n};\n if (${t}) { continue } else { break }\n}\n\n`;return this.convLineno(e,!1)+s}convSwitch(e){const t=this._convGen(e.value,!0),n=e.cases||[];let s="";for(let e=0;e<n.length;e++){const t=n[e][0],r=this.convGenLoop(n[e][1]);if("違えば"===t.type)s+=" default:\n";else{s+=` case ${this._convGen(t,!0)}:\n`}s+=` ${r}\n break\n`}const r=`switch (${t}){\n${s}\n}\n`;return this.convLineno(e,!1)+r}convIf(e){const t=this._convGen(e.expr,!0),n=this._convGen(e.block,!1),s=null===e.false_block?"":"else {"+this._convGen(e.false_block,!1)+"};\n";return this.convLineno(e,!1)+`if (${t}) {\n ${n}\n}`+s+";\n"}convTikuji(e){const t=`__tikuji${this.loopId++}`;let n=`const ${t} = []\n`;const s=e.blocks?e.blocks:[];for(let e=0;e<s.length;e++){const r=this._convGen(s[e],!1).replace(/\s+$/,"")+"\n";n+=`${t}.push(function(resolve, reject) {\n __self.resolve = resolve;\n __self.reject = reject;\n __self.resolveCount = 0;\n ${this.convLineno(s[e],!0)}\n ${r} if (__self.resolveCount === 0) resolve();\n}); // end of tikuji__\${pid}[{$i}]\n`}n+=`// end of ${t} \n`;let r=` ${t}.splice(0);\n __v0["エラーメッセージ"]=errMsg;\n`;if(null!=e.errorBlock){r+=this._convGen(e.errorBlock,!1).replace(/\s+$/,"")+"\n"}return n+=`const ${t}__reject = function(errMsg){\n${r}};\n`,n+="__self.resolve = undefined;\n",n+=`const ${t}__resolve = function(){\n`,n+=" setTimeout(function(){\n",n+=` if (${t}.length == 0) {return}\n`,n+=` const f = ${t}.shift()\n`,n+=` f(${t}__resolve, ${t}__reject);\n`,n+=" }, 0);\n",n+="};\n",n+=`${t}__resolve()\n`,this.convLineno(e,!1)+n}convFuncGetArgsCalcType(e,t,n){const s=[],r={},i=n.args?n.args:[];for(let e=0;e<i.length;e++){const t=i[e];0===e&&null===t&&0===this.speedMode.invalidSore?(s.push(this.varname("それ")),r.sore=!0):s.push(this._convGen(t,!0))}return[s,r]}getPluginList(){const e=[];for(const t in this.__self.__module)e.push(t);return e}convCallFunc(e,t){const n=o.getFuncName(e.name),r=this.findVar(n);if(null===r)throw s.ih.fromNode(`関数『${n}』が見当たりません。有効プラグイン=[`+this.getPluginList().join(", ")+"]",e);let i;if(0===r.i){if(i=this.__self.getFunc(n),!i)throw new Error(`[System Error] 関数「${n}」NakoCompiler.nakoFuncList の不整合があります。`);if("func"!==i.type)throw s.ih.fromNode(`『${n}』は関数ではありません。`,e)}else i=this.nakoFuncList[n],void 0===i&&(i={return_none:!1});if("func_pointer"===e.type)return r.js;const u=this.convFuncGetArgsCalcType(n,i,e),c=u[0],a=u[1];this.usedFuncSet.add(n),c.push("__self");let f="function",l="",h="";if(e.setter&&(l+=";__self.isSetter = true;\n",h+=";__self.isSetter = false;\n"),0===r.i&&this.varslistSet.length>3&&!0!==i.pure&&0===this.speedMode.forcePure){const e=[];for(const t of Array.from(this.varsSet.names.values()))o.isValidIdentifier(t)&&e.push({str:JSON.stringify(t),js:this.varname(t)});l+="__self.__locals = __vars;\n";for(const t of e)l+=`__self.__locals[${t.str}] = ${t.js};\n`;for(const t of e)"それ"!==t.js&&(h+=`${t.js} = __self.__locals[${t.str}];\n`)}a.sore&&(l+="/*[sore]*/");const p=(e,t)=>{let n="";for(const s of e.split("\n"))""!==s&&(n+=" ".repeat(t)+s+"\n");return n};let d;0===this.warnUndefinedCallingUserFunc&&0!==r.i||0===this.warnUndefinedCallingSystemFunc&&0===r.i?d=c.join(","):(d="",c.forEach((t=>{"__self"===t?d+=`,${t}`:0===r.i?d+=`,(function(a){if(a===undefined){__self.logger.warn('命令『${n}』の引数にundefinedを渡しています。',{file:'${e.file}',line:${e.line}});};return a;})(${t})`:d+=`,(function(a){if(a===undefined){__self.logger.warn('ユーザ関数『${n}』の引数にundefinedを渡しています。',{file:'${e.file}',line:${e.line}});};return a;})(${t})`})),d=d.substring(1));let _=`${r.js}(${d})`;if(i.asyncFn&&(f=`async ${f}`,_=`await ${_}`,this.numAsyncFn++,this.usedAsyncFn=!0),0===r.i&&0!==this.performanceMonitor.systemFunctionBody){let e=n;e||(void 0===this.performanceMonitor.mumeiId&&(this.performanceMonitor.mumeiId=0),this.performanceMonitor.mumeiId++,e=`anous_${this.performanceMonitor.mumeiId}`),_=`(${f} (key, type) {\nconst sbf_start = performance.now() * 1000;\ntry {\nreturn `+_+";\n} finally {\nconst sbl_time = performance.now() * 1000 - sbf_start;\nif (!__self.__performance_monitor) {\n__self.__performance_monitor={};\n__self.__performance_monitor[key] = { called:1, totel_usec: sbl_time, min_usec: sbl_time, max_usec: sbl_time, type: type };\n} else if (!__self.__performance_monitor[key]) {\n__self.__performance_monitor[key] = { called:1, totel_usec: sbl_time, min_usec: sbl_time, max_usec: sbl_time, type: type };\n} else {\n__self.__performance_monitor[key].called++;\n__self.__performance_monitor[key].totel_usec+=sbl_time;\nif(__self.__performance_monitor[key].min_usec>sbl_time){__self.__performance_monitor[key].min_usec=sbl_time;}\nif(__self.__performance_monitor[key].max_usec<sbl_time){__self.__performance_monitor[key].max_usec=sbl_time;}\n"+`}}})('${n}_body', 'sysbody')\n`}let y="";if(i.return_none)y=""===h?""===l?`${_};\n`:`${l} ${_};\n`:`${l}try {\n${p(_,1)};\n} finally {\n${p(h,1)}}\n`;else{let n="";0===this.speedMode.invalidSore&&(n=`${this.varname("それ")} = `),y=""===l&&""===h?`(${n}${_})`:""===h?`(${f}(){\n${p(`${l};\nreturn ${n} ${_}`,1)}}).call(this)`:`(${f}(){\n${p(`${l}try {\n${p(`return ${n}${_};`,1)}\n} finally {\n${p(h,1)}}`,1)}}).call(this)`,("して"===e.josi||""===e.josi&&!t)&&(y+=";\n")}return 0===r.i&&0!==this.performanceMonitor.systemFunction&&(y="(function (key, type) {\nconst sf_start = performance.now() * 1000;\ntry {\nreturn "+y+";\n} finally {\nconst sl_time = performance.now() * 1000 - sf_start;\nif (!__self.__performance_monitor) {\n__self.__performance_monitor={};\n__self.__performance_monitor[key] = { called:1, totel_usec: sl_time, min_usec: sl_time, max_usec: sl_time, type: type };\n} else if (!__self.__performance_monitor[key]) {\n__self.__performance_monitor[key] = { called:1, totel_usec: sl_time, min_usec: sl_time, max_usec: sl_time, type: type };\n} else {\n__self.__performance_monitor[key].called++;\n__self.__performance_monitor[key].totel_usec+=sl_time;\nif(__self.__performance_monitor[key].min_usec>sl_time){__self.__performance_monitor[key].min_usec=sl_time;}\nif(__self.__performance_monitor[key].max_usec<sl_time){__self.__performance_monitor[key].max_usec=sl_time;}\n"+`}}})('${n}_sys', 'system')\n`),y}convRenbun(e){const t=this._convGen(e.right,!0);return`(function(){${this._convGen(e.left,!1)}; return ${t}}).call(this)`}convOp(e){const t={"&":'+""+',eq:"==",noteq:"!=","===":"===","!==":"!==",gt:">",lt:"<",gteq:">=",lteq:"<=",and:"&&",or:"||",shift_l:"<<",shift_r:">>",shift_r0:">>>","÷":"/"};let n=e.operator||"",s=this._convGen(e.right,!0),r=this._convGen(e.left,!0);return"+"===n&&0===this.speedMode.implicitTypeCasting&&(e.left&&"number"!==e.left.type&&(r=`parseFloat(${r})`),e.right&&"number"!==e.right.type&&(s=`parseFloat(${s})`)),"^"===n?`(Math.pow(${r}, ${s}))`:"÷÷"===n?`(Math.floor(${r} / ${s}))`:(t[n]&&(n=t[n]),`(${r} ${n} ${s})`)}convInc(e){let t=null;if(0===this.speedMode.invalidSore&&(t=this.varname("それ")),e.value&&(t=this._convGen(e.value,!0)),null==t)throw s.ih.fromNode("加算する先の変数名がありません。",e);const n=e.name.value;let r=this.findVar(n),i="";if(null===r&&(this.varsSet.names.add(n),r=this.findVar(n),!r))throw new Error("『増』または『減』で変数が見当たりません。");const o=r.js;return i+=`if (typeof(${o}) === 'undefined') { ${o} = 0; }`,i+=`${o} += ${t}`,";"+this.convLineno(e,!1)+i+"\n"}convLet(e){let t=null;if(0===this.speedMode.invalidSore&&(t=this.varname("それ")),e.value&&(t=this._convGen(e.value,!0)),null==t)throw s.ih.fromNode("代入する先の変数名がありません。",e);const n=e.name.value,r=this.findVar(n);let i="";if(null===r)this.varsSet.names.add(n),i=`${this.varname(n)} = ${t};`;else{if(this.varslistSet[r.i].readonly.has(n))throw s.ih.fromNode(`定数『${n}』は既に定義済みなので、値を代入することはできません。`,e);i=`${r.js} = ${t};`}return";"+this.convLineno(e,!1)+i+"\n"}convDefLocalVar(e){const t=null===e.value?"null":this._convGen(e.value,!0),n=e.name.value,r=e.vartype;if(this.varsSet.names.has(n))throw s.ih.fromNode(`${r}『${n}』の二重定義はできません。`,e);this.varsSet.names.add(n),"定数"===r&&this.varsSet.readonly.add(n);const i=`${this.varname(n)}=${t};\n`;return this.convLineno(e,!1)+i}convDefLocalVarlist(e){let t="";const n=e.vartype,s=null===e.value?"null":this._convGen(e.value,!0);this.loopId++;const r=`$nako_i${this.loopId}`;t+=`${r}=${s}\n`,t+=`if (!(${r} instanceof Array)) { ${r}=[${r}] }\n`;const i=e.names?e.names:[];for(let e=0;e<i.length;e++){const s=i[e].value;this.varsSet.names.has(s),this.varsSet.names.add(s),"定数"===n&&this.varsSet.readonly.add(s);t+=`${this.varname(s)}=${r}[${e}];\n`}return this.convLineno(e,!1)+t}convString(e){let t=""+e.value;const n=e.mode;if(t=t.replace(/\\/g,"\\\\"),t=t.replace(/"/g,'\\"'),t=t.replace(/\r/g,"\\r"),t=t.replace(/\n/g,"\\n"),"ex"===n){const n=(t,n)=>'"+'+this.genVar(n,e)+'+"';t=t.replace(/\{(.+?)\}/g,n),t=t.replace(/{(.+?)}/g,n)}return'"'+t+'"'}convTryExcept(e){const t=this._convGen(e.block,!1),n=this._convGen(e.errBlock,!1);return this.convLineno(e,!1)+`try {\n${t}\n} catch (e) {\n __v0["エラーメッセージ"] = e.message;\n;\n`+`${n}}\n`}getUsedFuncSet(){return this.usedFuncSet}getPluginInitCode(){let e="",t="";for(const e in this.__self.__module){const n=`!${e}:初期化`;this.varslistSet[0].names.has(n)&&(this.usedFuncSet.add(`!${e}:初期化`),t+=`__v0["!${e}:初期化"](__self);\n`)}return""!==t&&(e+="__v0.line='l0:プラグインの初期化';\n"+t),e}}function u(e,t,n){const r=new o(e);r.registerFunction(t);let i=r.convGen(t,n);const u=r.getDefFuncCode(e,n);if(i&&n.isTest&&(i+="\n__self._runTests(__tests);\n"),r.numAsyncFn>0){const e="__nako3async"+(new Date).getTime()+"_"+(""+Math.random()).replace(".","_")+"__";i=`\n// --------------------------------------------------\n// <nadesiko3::gen::async times="${r.numAsyncFn}">\nasync function ${e}(self) {\n${u}\n${i}\n} // end of ${e}\n${e}.call(self, self).catch(err => {\n self.numFailures++\n throw new NakoRuntimeError(err, self.__v0.line) // エラー位置を認識\n})\n// <nadesiko3::gen::async>\n// --------------------------------------------------\n`}else i=`\n// --------------------------------------------------\ntry {\n ${u}\n ${i}\n} catch (err) {\n self.numFailures++\n throw new NakoRuntimeError(err, self.__v0.line) // エラー位置を認識\n}\n// --------------------------------------------------\n`;e.getLogger().trace("--- generate ---\n"+i);let c="";const a=[];for(const e of n.importFiles){if("nako_errors.mjs"===e)continue;const t="nako3runtime_"+e.replace(/\.(js|mjs)$/,"").replace(/[^a-zA-Z0-9_]/g,"_");a.push(t),c+=`import ${t} from './nako3runtime/${e}'\n`}const f=`// <standaloneCode>\n// 将来的に ESModule に対応する #1217\nimport path from 'path'\nimport { NakoRuntimeError } from './nako3runtime/nako_errors.mjs'\n${c}\nconst self = {}\nself.coreVersion = '${e.coreVersion}'\nself.version = '${e.version}'\nself.logger = {\n error: (message) => { console.error(message) },\n warn: (message) => { console.warn(message) },\n send: (level, message) => { console.log(message) },\n};\nself.__varslist = [{}, {}, {}]\nself.__v0 = self.__varslist[0]\nself.initFuncList = []\nself.clearFuncList = []\n// Copy module functions\nfor (const mod of [${a.join(", ")}]) {\n for (const funcName in mod) {\n if (funcName === '初期化') {\n self.initFuncList.push(mod[funcName].fn)\n continue\n }\n if (funcName === '!クリア') {\n self.clearFuncList.push(mod[funcName].fn)\n continue\n }\n self.__varslist[0][funcName] = mod[funcName].fn\n }\n}\nself.__vars = self.__varslist[2];\nself.__module = {};\nself.__locals = {};\nself.__genMode = 'sync';\n\n// プラグインの初期化コードを実行\nself.initFuncList.map(f => f(self))\n\ntry {\n${n.codeStandalone}\n// <JS>\n${i}\n// </JS>\n // プラグインのクリアコードを実行\n self.clearFuncList.map(f => f(self))\n} catch (err) {\n self.logger.error(err);\n throw err;\n}\n// </standaloneCode>\n`,l=r.getPluginInitCode();return{runtimeEnv:`\n// runtimeEnv\n${s.k.toString()}\n${s.as.toString()}\nconst self = this\n${n.codeEnv}\n${u}\n${l}\n${i}\n// end of runtimeEnv\n`,standalone:f,gen:r}}},8801:function(e,t,n){n.d(t,{g:function(){return g}});var s=n(6297),r=n(4228),i=n(9485);const o="NOP",u="LBL",c="EOL",a="JMP",f="JMP_T",l="JMP_F",h="CALL",p="CALL_OBJ",d="RET",_="TRY",y="CODE";class m{constructor(e,t){this.type=e,this.value=t,this.no=-1,this.tag=0}}class g{constructor(e){this.com=e,this.nakoFuncList={...e.getNakoFuncList()},this.nakoTestList={},this.usedFuncSet=new Set,this.loopId=1,this.flagLoop=!1,this.codeId=0,this.codeArray=[],this.labelContinue=null,this.labelBreak=null,this.labels={},this.__self=e,this.genMode="非同期モード",this.lastLineNo=null,this.varslistSet=e.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varsSet={isFunction:!1,names:new Set,readonly:new Set},this.varslistSet[2]=this.varsSet,this.speedMode={lineNumbers:0,implicitTypeCasting:0,invalidSore:0,forcePure:0},this.performanceMonitor={userFunction:0,systemFunction:0,systemFunctionBody:0}}static generate(e,t,n){const i=new g(e);i.registerFunction(t);let o=i.convGen(t,!!n);return o=i.getDefFuncCode(n)+o,e.getLogger().trace("--- generate(非同期モード) ---\n"+o),o&&n&&(o+="\n__self._runTests(__tests);\n"),{runtimeEnv:o,standalone:`const nakoVersion = ${JSON.stringify(r.Z)};\n${s.k.toString()}\n${s.as.toString()}\nthis.logger = {\n error(message) { console.error(message) },\n send(level, message) { console.log(message) },\n};\nthis.__varslist = [{}, {}, {}];\nthis.__vars = this.__varslist[2];\nthis.__module = {};\nthis.__locals = {};\nthis.__labels = {};\nthis.__code = [];\nthis.__callstack = [];\nthis.__stack = [];\nthis.__genMode = '非同期モード';\ntry {\n ${i.getVarsCode()}\n ${o}\n} catch (err) {\n if (!(err instanceof NakoRuntimeError)) {\n err = new NakoRuntimeError(err, this.__varslist[0].line);\n }\n this.logger.error(err);\n throw err;\n}`,gen:i}}convLineno(e,t){if(this.speedMode.lineNumbers>0)return"";let n;if(n="number"!=typeof e.line?"unknown":"string"!=typeof e.file?`l${e.line}`:`l${e.line}:${e.file}`,!t){if(n===this.lastLineNo)return"";this.lastLineNo=n}return`__v0.line=${JSON.stringify(n)};`}varname(e){return`sys.__vars[${JSON.stringify(e)}]`}getVarsCode(){let e="";for(const t of Array.from(this.usedFuncSet.values())){const n=this.__self.__varslist[0][t],s=`this.__varslist[0]["${t}"]`;e+="function"==typeof n?s+"="+n.toString()+";\n":s+"="+JSON.stringify(n)+";\n"}return e}getDefFuncCode(e){let t="";t+="const __self = this.__self = this;\n",t+="const __varslist = this.__varslist;\n",t+="const __module = this.__module;\n",t+="const __v0 = this.__v0 = this.__varslist[0];\n",t+="const __v1 = this.__v1 = this.__varslist[1];\n",t+="const __vars = this.__vars = this.__varslist[2];\n",t+="const __code = this.__code;\n";let n="";for(const e in this.nakoFuncList){n+=`//[DEF_FUNC name='${e}']\n__v1["${e}"]=${this.nakoFuncList[e].fn};\n;//[/DEF_FUNC name='${e}']\n`}""!==n&&(t+="__v0.line='関数の定義';\n"+n);let s="";for(const e in this.__self.__module){const t=`!${e}:初期化`;this.varslistSet[0].names.has(t)&&(this.usedFuncSet.add(`!${e}:初期化`),s+=`__v0["!${e}:初期化"](__self);\n`)}if(""!==s&&(t+="__v0.line='プラグインの初期化';\n"+s),e){let n="const __tests = [];\n";for(const t in this.nakoTestList)if(!0===e||"string"==typeof e&&e===t){n+=`${this.nakoTestList[t].fn};\n;`}""!==n&&(t+="__v0.line='テストの定義';\n",t+=n+"\n")}return t}addPlugin(e){return this.__self.addPlugin(e)}addPluginObject(e,t){this.__self.addPluginObject(e,t)}addPluginFile(e,t,n){this.__self.addPluginFile(e,t,n)}addFunc(e,t,n){this.__self.addFunc(e,t,n)}getFunc(e){return this.__self.getFunc(e)}registerFunction(e){if("block"!==e.type)throw s.ih.fromNode("構文解析に失敗しています。構文は必ずblockが先頭になります",e);const t=e=>{for(let n=0;n<e.block.length;n++){const s=e.block[n];if("def_func"===s.type){const e=s.name.value;this.usedFuncSet.add(e),this.__self.__varslist[1][e]=function(){},this.nakoFuncList[e]={josi:s.name.meta.josi,fn:"",type:"func"}}else("speed_mode"===s.type||"performance_monitor"===s.type)&&("block"===s.block.type?t(s.block):t(s))}};t(e);const n=new Set;0===this.speedMode.invalidSore&&n.add("それ"),this.varsSet={isFunction:!1,names:n,readonly:new Set},this.varslistSet=this.__self.__varslist.map((e=>({isFunction:!1,names:new Set(Object.keys(e)),readonly:new Set}))),this.varslistSet[2]=this.varsSet}convGen(e,t){this._convGen(e,!0);const n=new Set([a,f,l,h,_]);let s=this.codeArray;{s=s.filter((e=>e.type!==o));const e=new Set;s.forEach((t=>{n.has(t.type)&&e.add(t.value)})),s=s.filter((t=>t.type!==u||(15===t.tag||e.has(t.value))));let t=0;for(;t<s.length-1;)s[t].type!==c||s[t+1].type!==c?t++:s.splice(t+1,1);this.codeArray=s}s.forEach(((e,t)=>{e.type===u&&(this.labels[e.value]=t)})),s.forEach((e=>{n.has(e.type)&&e.no<0&&(e.no=this.labels[e.value])}));let r="";return s.forEach(((e,t)=>{switch(e.type){case o:r+=`case ${t}: break; // [NOP] ${e.value}\n`;break;case u:r+=`case ${t}: break; // [LABEL] ${e.value}\n`;break;case c:r+=`case ${t}: ${e.value}; break; // [EOL]\n`;break;case a:r+=`case ${t}: sys.nextIndex = ${e.no}; break; // ${e.value}\n`;break;case f:r+=`case ${t}: if (sys.__stack.pop()) { sys.nextIndex = ${e.no};} break; // ${e.value}\n`;break;case l:r+=`case ${t}: if (!sys.__stack.pop()) { sys.nextIndex = ${e.no}} break; // ${e.value}\n`;break;case d:r+=`case ${t}: sys.__return(sys); break;\n`;break;case h:r+=`case ${t}: sys.__call(${e.no}, sys); break; // ${e.value}\n`;break;case p:r+=`case ${t}: sys.__callObj('${e.value}', ${t}, sys); break; // ${e.value}\n`;break;case _:r+=`case ${t}: sys.tryIndex = ${e.no}; break; // TRY \n`;break;case y:{const n=e.value.replace(/\s+$/,"");r+=`case ${t}: {\n${n}\n};break;\n`;break}default:throw new Error("invalid code type")}})),r=`\n //-------------------------\n // main_code\n this.__labels = ${JSON.stringify(this.labels)};\n this.nextAsync = (sys) => {\n if (sys.index >= sys.codeSize || sys.index < 0) {return}\n const __v0 = sys.__v0\n try {\n sys.inLoop = true\n while (sys.index < sys.codeSize && sys.index >= 0) {\n // console.log('@@[run]', sys.index)\n switch (sys.index) {\n // --- CODE.BEGIN ---\n ${r}\n // --- CODE.END ---\n default:\n sys.inLoop = false\n console.log(sys.index, sys.__stack)\n throw new Error('Invalid sys.index:' + sys.index)\n break\n }\n // check next\n if (sys.nextIndex >= 0) {\n sys.index = sys.nextIndex\n sys.nextIndex = -1\n } else {\n sys.index++\n }\n if (sys.async) {\n sys.__saveSysenv(sys)\n sys.async = false\n break\n }\n } // end of while\n sys.inLoop = false\n } catch (e) {\n sys.__errorAsync(e, sys)\n }\n }\n this.__errorAsync = (e, sys) => { // エラーが起きた時呼び出す\n sys.__v0["エラーメッセージ"] = e.message;\n if (e.message == '__終わる__') {\n sys.__stopAsync(sys)\n return\n }\n if (sys.tryIndex >= 0) {\n sys.index = sys.tryIndex;\n setTimeout(() => {sys.nextAsync(sys)}, 1)\n } else {\n throw e\n }\n }\n this.__call = (no, sys) => {\n const info = {lastVars:sys.__vars, backNo: this.index + 1}\n sys.__callstack.push(info);\n sys.__vars = {"それ":""}\n sys.__varslist.push(sys.__vars)\n sys.nextIndex = no;\n }\n this.__return = sys => {\n if (sys.__callstack.length === 0) {\n sys.__destroySysenv(sys, sys.curSysenv.envid)\n sys.index = -2\n sys.nextIndex = -1\n return\n }\n const sore = sys.__vars['それ'];\n sys.__varslist.pop();\n const info = sys.__callstack.pop();\n sys.nextIndex = info.backNo;\n sys.__vars = info.lastVars;\n sys.__vars['それ'] = sore\n sys.__stack.push(sore);\n }\n this.__resetAsync = sys => {\n sys.index = 0\n sys.codeSize = ${s.length};\n sys.async = false\n sys.nextIndex = -1\n sys.tryIndex = -1\n }\n this.__stopAsync = sys => {\n sys.__resetAsync(sys)\n sys.index = -1 // force stop!!\n }\n this.__callNakoCode = (no, backNo, sys) => {\n this.__call(backNo, sys)\n sys.nextIndex = no\n const sysenv = sys.setAsync(sys)\n setTimeout(() => {\n // console.log('//__callNakoCode, back=', backNo, 'no=', no)\n sys.compAsync(sys, sysenv)\n } ,1)\n }\n this.__callNakoCodeEntry = (no, sys) => {\n sys.__saveSysenv(sys)\n sys.curSysenv = sys.__generateSysenv(sys)\n sys.__restoreSysenv(sys)\n sys.__vars = {"それ":""}\n sys.__varslist.push(sys.__vars)\n sys.index = no;\n sys.nextAsync(sys)\n }\n this.__callObj = (vname, curNo, sys) => {\n if (sys.__vars[vname]) {\n const fname = sys.__vars[vname]\n // console.log(sys.__labels)\n if (fname && sys.__labels[fname]) {\n const no = sys.__labels[fname]\n sys.__call(no, sys)\n return\n } else {\n console.log('vname=', vname, 'label=', fname)\n }\n }\n throw new Error('async error in __callObj::', vname)\n }\n this.__generateSysenv = sys => {\n sys.envid = ( sys.envid == null ? 0 : sys.envid ) + 1\n const sysenv = {\n callstack: [],\n varstack: [],\n varslist: [sys.__varslist[0], sys.__varslist[1], sys.__varslist[2]],\n index: -1,\n nextIndex: -1,\n tryIndex: -1,\n envid: sys.envid\n }\n sysenv.vars = sysenv.varslist[2]\n if (sys.sysenvs == null) { sys.sysenvs={} }\n sys.sysenvs[sys.envid] = sysenv\n // console.log('generete envid '+sys.envid)\n return sysenv\n }\n this.__destroySysenv = (sys, envid) => {\n delete sys.sysenvs[envid]\n // console.log('destroy envid '+envid)\n }\n this.__saveSysenv = sys => {\n const sysenv = sys.curSysenv\n sysenv.callstack = sys.__callstack\n sysenv.varstack = sys.__stack\n sysenv.varslist = sys.__varslist\n sysenv.vars = sys.__vars\n sysenv.index = sys.index\n sysenv.nextIndex = sys.nextIndex\n sysenv.tryIndex = sys.tryIndex\n }\n this.__restoreSysenv = sys => {\n const sysenv = sys.curSysenv\n sys.__callstack = sysenv.callstack\n sys.__stack = sysenv.varstack\n sys.__varslist = sysenv.varslist\n sys.__vars = sysenv.vars\n ___vars = sys.__vars\n sys.index = sysenv.index\n sys.nextIndex = sysenv.nextIndex\n sys.tryIndex = sysenv.tryIndex\n }\n this.setAsync = sys => {\n sys.async = true\n return sys.curSysenv\n }\n this.compAsync = (sys,sysenv) => {\n if (sys.async && sys.curSysenv != null && sysenv != null && sys.curSysenv.envid === sysenv.envid) {\n sys.async = false\n } else {\n if (sys.curSysenv == null || sysenv == null || sys.curSysenv.envid !== sysenv.envid) {\n sys.__saveSysenv(sys)\n const envid = sys.curSysenv.envid\n sys.curSysenv = sysenv\n sys.__restoreSysenv(sys)\n // console.log('switch envid '+envid+' to '+sys.curSysenv.envid)\n }\n sys.nextAsync(sys)\n }\n }\n\n this.__resetAsync(this)\n this.curSysenv = this.__generateSysenv(this)\n this.nextAsync(this)\n //-------------------------\n `,t?"":r}_convGen(e,t){let n="";if(e instanceof Array){for(let s=0;s<e.length;s++){const r=e[s];n+=this._convGen(r,t)}return n}if(null===e)return"null";if(void 0===e)return"undefined";if("object"!=typeof e)return""+e;switch(e.type){case"nop":break;case"comment":e.value||(e.value=""),this.addCode(new m(o,e.value));break;case"eol":this.addCode(new m(c,this.convLineno(e,!0)));break;case"number":this.addCodeStr(`sys.__stack.push(${e.value});//number`);break;case"string":this.convString(e);break;case"word":case"variable":this.convGetVar(e);break;case"op":case"calc":this.convOp(e);break;case"renbun":this.convRenbun(e);break;case"not":this._convGen(e.value,!0),this.addCodeStr("if (sys.__stack.length==0) throw new Error('NOTでスタックに値がありません');sys.__stack[sys.__stack.length-1] = (sys.__stack[sys.__stack.length-1]) ? 0:1");break;case"配列参照":this.convRefArray(e);break;case"json_array":this.convJsonArray(e);break;case"json_obj":this.convJsonObj(e);break;case"bool":{const t=e.value?"true":"false";this.addCodeStr(`sys.__stack.push(${t})`);break}case"null":this.addCodeStr("sys.__stack.push(null)");break;case"func":case"func_pointer":case"calc_func":this.convFunc(e,t);break;case"let":this.convLet(e);break;case"let_array":this.convLetArray(e);break;case"block":for(let t=0;t<e.block.length;t++){const n=e.block[t];this._convGen(n,!1)}break;case"if":this.convIf(e);break;case"repeat_times":this.convRepeatTimes(e);break;case"break":this.addCodeStr(this.convCheckLoop(e,"break"));break;case"continue":this.addCodeStr(this.convCheckLoop(e,"continue"));break;case"for":this.convFor(e);break;case"foreach":this.convForeach(e);break;case"while":this.convWhile(e);break;case"switch":this.convSwitch(e);break;case"return":this.convReturn(e);break;case"end":n+=this.addCodeStr("__varslist[0]['終']();");break;case"def_local_var":this.convDefLocalVar(e);break;case"def_local_varlist":n+=this.addCodeStr(this.convDefLocalVarlist(e));break;case"tikuji":throw s.ih.fromNode("「逐次実行」構文は「!非同期モード」では使えません。",e);case"speed_mode":throw s.ih.fromNode("「速度有線」構文は「!非同期モード」では使えません。",e);case"performance_monitor":this.convPerformanceMonitor(e,t);break;case"func_obj":this.convFuncObj(e);break;case"def_test":this.convDefTest(e);break;case"def_func":n+=this.addCodeStr(this.convDefFunc(e));break;case"try_except":n+=this.convTryExcept(e);break;case"require":n+=this.convRequire(e);break;default:throw new Error("System Error: unknown_type="+e.type)}return n}convRequire(e){const t=new i.Jc(this.com);return this.addCodeStr(t.convRequire(e)),""}addCodeStr(e){if(""===e)return"";const t=e.split("\n").map((e=>" "+e.replace(/\s+$/,""))),n=new m(y,t.join("\n"));return this.addCode(n)}addCode(e){return this.codeArray[this.codeId]=e,this.codeId++,""}makeLabel(e){const t=e+"_"+this.loopId++;return this.makeLabelDirectly(t)}makeLabelDirectly(e){const t=new m(u,e);return this.labels[e]=-1,t}makeJump(e){return new m(a,e.value)}makeJumpIfTrue(e){return new m(f,e.value)}makeJumpIfFalse(e){return new m(l,e.value)}convIf(e){const t=this.makeLabel("もし:ここから"),n=this.makeLabel("もし:ここまで"),s=this.makeLabel("もし:違えば");return this.addCode(t),this._convGen(e.expr,!0),this.addCode(this.makeJumpIfFalse(s)),this._convGen(e.block,!1),this.addCode(this.makeJump(n)),this.addCode(s),e.falseBlock&&this._convGen(e.falseBlock,!1),this.addCode(n),""}convRepeatTimes(e){this.flagLoop=!0,this.varsSet.names.add("回数"),this.varsSet.readonly.add("回数");const t=`sys.__tmp_i${this.loopId}`;this.loopId++;const n=`sys.__tmp_count${this.loopId}`;this.loopId++,this._convGen(e.value,!0),this.addCodeStr(`${n} = sys.__stack.pop(); ${t} = 0;`);const s=this.makeLabel("回:条件チェック");this.addCode(s);const r=this.makeLabel("回:ここまで");this.labelBreak=r,this.labelContinue=s;const i=`sys.__vars["回数"] = ++${t}\nsys.__stack.push(${t} > ${n})\n`;return this.addCodeStr(i),this.addCode(this.makeJumpIfTrue(r)),this.convGenLoop(e.block),this.addCode(this.makeJump(s)),this.addCode(r),this.flagLoop=!1,""}findVar(e){if(this.varsSet.names.has(e))return{i:this.varslistSet.length-1,name:e,isTop:!0,js:`sys.__vars[${JSON.stringify(e)}]`};for(let t=2;t>=0;t--)if(this.varslistSet[t].names.has(e))return{i:t,name:e,isTop:!1,js:`sys.__varslist[${t}][${JSON.stringify(e)}]`};return null}genVar(e,t){const n=this.findVar(e),r=t.line;if(null===n)return"引数"===e||"それ"===e||"対象"===e||"対象キー"===e||"回数"===e||this.__self.getLogger().warn(`変数『${e}』は定義されていません。`,t),this.varsSet.names.add(e),this.varname(e);if(0===n.i){const i=this.__self.getFunc(e);if(!i)return`${n.js}/*err:${r}*/`;if("const"===i.type||"var"===i.type)return n.js;if("func"===i.type){if(!i.josi)throw new Error("[System Error]");if(0===i.josi.length)return`(${n.js}())`;throw s.ih.fromNode(`『${e}』が複文で使われました。単文で記述してください。(v1非互換)`,t)}throw s.ih.fromNode(`『${e}』は関数であり参照できません。`,t)}return n.js}convGetVar(e){const t=e.value;let n=`sys.__vars[${JSON.stringify(t)}]`;const s=this.findVar(t);null!=s&&(n=s.js),this.addCodeStr(`sys.__stack.push(${n});`)}convComment(e){let t=String(e.value);t=t.replace(/\n/g,"¶");const n=this.convLineno(e,!1);return""===t&&""===n?";":""===t?";"+n+"\n":";"+n+"//"+t+"\n"}convReturn(e){if(this.varsSet.names.has("!関数"))throw s.ih.fromNode("『戻る』がありますが、関数定義内のみで使用可能です。",e);return e.value&&(this._convGen(e.value,!0),this.addCodeStr('sys.__vars["それ"] = sys.__stack.pop()')),this.addCode(new m(d,"")),""}convCheckLoop(e,t){if(!this.flagLoop){const n="continue"===t?"続ける":"抜ける";throw s.ih.fromNode(`『${n}』文がありますが、それは繰り返しの中で利用してください。`,e)}return"continue"===t?this.labelContinue&&this.addCode(this.makeJump(this.labelContinue)):this.labelBreak&&this.addCode(this.makeJump(this.labelBreak)),""}convDefFuncCommon(e,t){const n=""===t;let s=t;n&&(s="無名関数:"+this.loopId++);const r=this.makeLabel(`関数「${s}」:ここまで`);this.addCode(this.makeJump(r));const i=this.makeLabelDirectly(s);i.tag=15,this.addCode(i);const o=new Set;this.varsSet={isFunction:!0,names:o,readonly:new Set},this.varsSet.names.add("それ"),this.varslistSet.push(this.varsSet);const u=n?e.meta:e.name.meta;let c="",a="";c+=`//関数『${s}』の初期化処理\n`,c+="// 引数をローカル変数として登録\n";for(let e=u.varnames.length-1;e>=0;e--){const t=u.varnames[e];c+=` ${this.varname(t)} = sys.__stack.pop();\n`,this.varsSet.names.add(t),a+=""}return c+="// ここまで:引数をローカル変数として登録\n",this.addCodeStr(c),this.usedFuncSet.add(s),this.varslistSet[1].names.add(s),this.nakoFuncList[s]={josi:u.josi,fn:`(function(){\n const sys = (arguments.length > 0) ? arguments[arguments.length-1] : {}; \n if (sys.newenv) { \n sys.newenv = false\n sys.__callNakoCodeEntry(sys.__labels['${s}'], sys);\n } else {\n `+a+"\n"+` sys.__callNakoCode(sys.__labels['${s}'], sys.nextIndex, sys);\n if (!sys.inLoop) { sys.nextAsync(sys) }\n } })`,type:"func"},this._convGen(e.block,!1),this.varslistSet.pop(),this.varsSet=this.varslistSet[this.varslistSet.length-1],this.__self.__varslist[1][s]=function(){},this.addCode(new m(d,"")),this.addCode(r),t||this.addCodeStr(`sys.__stack.push('${s}')`),""}convDefTest(e){throw s.ih.fromNode("テスト構文は!非同期モードでは使えません。",e)}convDefFunc(e){const t=i.Jc.getFuncName(e.name.value);return this.convDefFuncCommon(e,t),""}convFuncObj(e){return this.convDefFuncCommon(e,"")}convJsonObj(e){const t=e.value,n="sys.__tmp_obj"+this.loopId++;return this.addCodeStr(n+"={}; // convJsonObj::ここから"),t.forEach((e=>{this._convGen(e.value,!0),this._convGen(e.key,!0),this.addCodeStr(`${n}[sys.__stack.pop()]=sys.__stack.pop()`)})),this.addCodeStr(`this.__stack.push(${n}); delete $objName; // convJsonObj::ここまで`),""}convJsonArray(e){const t=e.value;this.addCode(this.makeLabel("convJsonArray::ここから")),t.forEach((e=>this._convGen(e,!0)));const n=t.length;return this.addCodeStr(`sys.__stack.push(sys.__stack.splice(sys.__stack.length-${n},${n}))`),""}convRefArray(e){this._convGen(e.name,!0);const t=e.index;for(let e=0;e<t.length;e++)this._convGen(t[e],!0),this.addCodeStr("const idx = sys.__stack.pop();\nconst obj = sys.__stack.pop();\nsys.__stack.push(obj[idx]);");return""}convLetArray(e){this._convGen(e.value,!0),this._convGen(e.name,!0);const t=e.index;for(let e=0;e<t.length;e++){if(this._convGen(t[e],!0),e===t.length-1){this.addCodeStr("const idx = this.__stack.pop();const obj = this.__stack.pop();const val = this.__stack.pop();obj[idx]=val;");break}this.addCodeStr("const idx = sys.__stack.pop();\nconst obj = sys.__stack.pop();\nsys.__stack.push(obj[idx]);")}return""}convGenLoop(e){const t=this.flagLoop;this.flagLoop=!0;try{return this._convGen(e,!1)}finally{this.flagLoop=t}}convFor(e){let t;if(this.flagLoop=!0,null!==e.word){const n=e.word.value;this.varsSet.names.add(n),t=this.varname(n)}else this.varsSet.names.add("dummy"),t=this.varname("dummy");const n=this.varname("それ"),s=this.loopId++,r=`sys.__tmp__i${s}`,i=`sys.__tmp__to${s}`;this._convGen(e.from,!0),this._convGen(e.to,!0),this.addCodeStr(`${i}=sys.__stack.pop();${r}=sys.__stack.pop();`),this.addCodeStr(`${n} = ${t} = ${r}`);const o=this.makeLabel("繰返:条件確認"),u=this.makeLabel("繰返:加算");this.addCode(o);const c=this.makeLabel("繰返:ここまで");return this.addCodeStr(`sys.__stack.push(${t} <= ${i})`),this.addCode(this.makeJumpIfFalse(c)),this.labelContinue=u,this.labelBreak=c,this.convGenLoop(e.block),this.addCode(u),this.addCodeStr(`${n} = ++${t};`),this.addCode(this.makeJump(o)),this.addCode(c),this.addCodeStr(`delete ${r};delete ${i};//繰返:掃除`),this.flagLoop=!1,""}convForeach(e){this.flagLoop=!0;let t='__v0["対象"]';e.name&&(t=this.varname(e.name.value),this.varsSet.names.add(e.name.value));if(null===e.target)throw s.ih.fromNode("『反復』の対象がありません。",e);const n=this.varname("それ"),r="sys.__tmp__target"+this.loopId++,i="sys.__tmp__keys"+this.loopId++,o="sys.__tmp__i"+this.loopId++,u="sys.__tmp__count"+this.loopId++;this._convGen(e.target,!0);const c=`// 反復: 初期化\n${r} = sys.__stack.pop();\n${o} = 0;\nif (typeof(${r}) == 'string' || typeof(${r}) == 'number') { ${r} = [${r}]; }\nif (${r} instanceof Array) { ${u} = ${r}.length; }\nelse { // キーの一覧を得る\n ${i} = Object.keys(${r}); \n // hasOwnPropertyがfalseならばkeyを消す処理\n ${i} = ${i}.filter((key)=>{ return ${r}.hasOwnProperty(key) })\n ${u} = ${i}.length;\n}\n`;this.addCodeStr(c);const a=this.makeLabel("反復:条件確認"),f=this.makeLabel("反復:加算"),l=this.makeLabel("反復:ここまで");this.labelBreak=l,this.labelContinue=f,this.addCode(a);const h=`if (${r} instanceof Array) {\n ${t} = ${n} = ${r}[${o}]; __v0["対象キー"] = ${o};\n} else {\n __v0["対象キー"] = ${i}[${o}]; ${t} = ${n} = ${r}[__v0["対象キー"]];\n}\n`;return this.addCodeStr(`${h}\nsys.__stack.push(${o} < ${u});`),this.addCode(this.makeJumpIfFalse(l)),this.convGenLoop(e.block),this.addCode(f),this.addCodeStr(`${o}++`),this.addCode(this.makeJump(a)),this.addCode(l),this.flagLoop=!1,""}convWhile(e){this.flagLoop=!0;const t=this.makeLabel("間:ここから"),n=this.makeLabel("間:ここまで");return this.labelContinue=t,this.labelBreak=n,this.addCode(t),this._convGen(e.cond,!0),this.addCode(this.makeJumpIfFalse(n)),this.convGenLoop(e.block),this.addCode(this.makeJump(t)),this.addCode(n),this.flagLoop=!1,""}convSpeedMode(e,t){return""}convPerformanceMonitor(e,t){const n={...this.performanceMonitor};e.options["ユーザ関数"]&&this.performanceMonitor.userFunction++,e.options["システム関数本体"]&&this.performanceMonitor.systemFunctionBody++,e.options["システム関数"]&&this.performanceMonitor.systemFunction++,this._convGen(e.block,t),this.performanceMonitor=n}convSwitch(e){this._convGen(e.value,!0);const t="sys.__tmp__i"+this.loopId++;this.addCodeStr(`${t} = sys.__stack.pop()`);const n=this.makeLabel("条件分岐:ここまで"),s=e.cases;for(let e=0;e<s.length;e++){const r=s[e][0];if("違えば"===r.type)this.convGenLoop(s[e][1]);else{const i=this.makeLabel("条件分岐:次");this._convGen(r,!0),this.addCodeStr(`sys.__stack.push(sys.__stack.pop() == ${t})`),this.addCode(this.makeJumpIfFalse(i)),this.convGenLoop(s[e][1]),this.addCode(this.makeJump(n)),this.addCode(i)}}return this.addCode(n),this.addCodeStr(`delete ${t}//条件分岐:掃除`),""}convFuncGetArgsCalcType(e,t,n){const s={};for(let e=0;e<n.args.length;e++){const t=n.args[e];0===e&&null===t?(this.addCodeStr("sys.__stack.push(sys.__vars['それ'])"),s.sore=!0):this._convGen(t,!0)}return s}getPluginList(){const e=[];for(const t in this.__self.__module)e.push(t);return e}convFunc(e,t){let n=!1,r=!1;const o=i.Jc.getFuncName(e.name),u=this.findVar(o);if(null===u)throw s.ih.fromNode(`関数『${o}』が見当たりません。有効プラグイン=[`+this.getPluginList().join(", ")+"]",e);let c;if(0===u.i){if(c=this.__self.getFunc(o),"func"!==c.type)throw s.ih.fromNode(`『${o}』は関数ではありません。`,e);n=!0}else c=this.nakoFuncList[o],void 0===c&&(r=!0,c={return_none:!1});if("func_pointer"===e.type)return u.js;const a=this.convFuncGetArgsCalcType(o,c,e);this.usedFuncSet.add(o);let f="",l="";e.setter&&(f+=";__self.isSetter = true;\n",l+=";__self.isSetter = false;\n"),a.sore&&(f+="/*[sore]*/");const d=e.args.length;let _="";n?(_+=f,_+=`const args = sys.__stack.splice(sys.__stack.length - ${d}, ${d});\n`,_+="args.push(sys);\n",_+=`const ret = ${u.js}.apply(sys, args);\n`,c.return_none||(_+="sys.__vars['それ'] = ret;\n",t&&(_+="sys.__stack.push(ret);\n")),_+=l,this.addCodeStr(_)):(r?this.addCode(new m(p,o)):this.addCode(new m(h,o)),t||this.addCodeStr("sys.__stack.pop();// 戻り値を利用しない関数呼出"))}convRenbun(e){this._convGen(e.left,!1),this._convGen(e.right,!0)}convOp(e){const t={"&":'+""+',eq:"==",noteq:"!=","===":"===","!==":"!==",gt:">",lt:"<",gteq:">=",lteq:"<=",and:"&&",or:"||",shift_l:"<<",shift_r:">>",shift_r0:">>>","÷":"/"},n=e.operator;this._convGen(e.left,!0),this._convGen(e.right,!0);let s="const rv = sys.__stack.pop();\nconst lv = sys.__stack.pop();\n";if("^"===n)s+="const v = (Math.pow(lv, rv))\n";else{s+=`const v = ((lv) ${t[n]||n} (rv));\n`}s+=`sys.__stack.push(v); //op:${n}\n`,this.addCodeStr(s)}convLet(e){let t="";null===e.value?this.addCodeStr("sys.__stack.push(sys.__vars['それ'])"):this._convGen(e.value,!0);const n=e.name.value,r=this.findVar(n);if(null===r)this.varsSet.names.add(n),t=`${this.varname(n)}=sys.__stack.pop();`;else{if(this.varslistSet[r.i].readonly.has(n))throw s.ih.fromNode(`定数『${n}』は既に定義済みなので、値を代入することはできません。`,e);t=`${r.js}=sys.__stack.pop();`}this.addCodeStr(t+"//let")}convDefLocalVar(e){null===e.value?this.addCodeStr("sys.__stack.push(null)"):this._convGen(e.value,!0);const t=e.name.value,n=e.vartype;if(this.varsSet.names.has(t))throw s.ih.fromNode(`${n}『${t}』の二重定義はできません。`,e);return this.varsSet.names.add(t),"定数"===n&&this.varsSet.readonly.add(t),this.addCodeStr(`${this.varname(t)}=sys.__stack.pop()`),""}convDefLocalVarlist(e){const t=e.vartype;null===e.value?this.addCodeStr("sys.__stack.push(null)"):this._convGen(e.value,!0);const n=`sys.__tmp_i${this.loopId}`;this.loopId++,this.addCodeStr(`${n}=sys.__stack.pop();if (!(${n} instanceof Array)) { ${n}=[${n}] }`);for(const r of e.names){const i=r.value;if(this.varsSet.names.has(i))throw s.ih.fromNode(`${t}『${i}』の二重定義はできません。`,e);this.varsSet.names.add(i),"定数"===t&&this.varsSet.readonly.add(i);const o=this.varname(i);this.addCodeStr(`${o}=${n}.pop()`)}return this.addCodeStr(`delete ${n}//複数代入:掃除`),""}convString(e){let t=""+e.value;const n=e.mode;if(t=t.replace(/\\/g,"\\\\"),t=t.replace(/"/g,'\\"'),t=t.replace(/\r/g,"\\r"),t=t.replace(/\n/g,"\\n"),"ex"===n)throw new Error("[システムエラー] ジェネレーターでの文字列の展開はサポートしていません");return this.addCodeStr(`sys.__stack.push("${t}")//string`),'"'+t+'"'}convTryExcept(e){const t=this.makeLabel("エラー監視:ならば"),n=this.makeLabel("エラー監視:ここまで");this.addCode(new m(_,t.value)),this._convGen(e.block,!1),this.addCode(this.makeJump(n)),this.addCode(t),this._convGen(e.errBlock,!1),this.addCode(n)}}if("object"==typeof navigator&&"object"==typeof navigator.nako3){const e=navigator.nako3;e.addCodeGenerator&&e.addCodeGenerator("非同期モード",g)}},8775:function(e,t,n){n.r(t),n.d(t,{josiList:function(){return s},josiRE:function(){return c},removeJosiList:function(){return i},removeJosiMap:function(){return u},tararebaJosiList:function(){return r},tararebaMap:function(){return o}});const s=["について","くらい","なのか","までを","までの","による","とは","から","まで","だけ","より","ほど","など","いて","えて","きて","けて","して","って","にて","みて","めて","ねて","では","には","は~","んで","ずつ","は","を","に","へ","で","と","が","の"],r=["でなければ","なければ","ならば","なら","たら","れば"],i=["こと","である","です","します","でした"],o={};r.forEach((e=>{s.push(e),o[e]=!0}));const u={};i.forEach((e=>{s.push(e),u[e]=!0})),s.sort(((e,t)=>t.length-e.length));const c=new RegExp("^[\\t ]*("+s.join("|")+")")},8294:function(e,t,n){n.d(t,{S:function(){return y}});var s=n(7206),r=n(515),i=n(8775);const o=/^[\u3005\u4E00-\u9FCF_a-zA-Z0-9ァ-ヶー\u2460-\u24FF\u2776-\u277F\u3251-\u32BF]+/,u=/^[ぁ-ん]/,c=/^[ぁ-ん]+$/,a=/^.+(以上|以下|超|未満)$/,f=e=>function(){throw new Error("突然の『"+e+"』があります。")},l=/^(円|ドル|元|歩|㎡|坪|度|℃|°|個|つ|本|冊|才|歳|匹|枚|皿|セット|羽|人|件|行|列|機|品|m|mm|cm|km|g|kg|t|px|dot|pt|em|b|mb|kb|gb)/,h=[{name:"ここまで",pattern:/^;;;/},{name:"eol",pattern:/^\n/},{name:"eol",pattern:/^;/},{name:"space",pattern:/^(\x20|\x09|・)+/},{name:"comma",pattern:/^,/},{name:"line_comment",pattern:/^#[^\n]*/},{name:"line_comment",pattern:/^\/\/[^\n]*/},{name:"range_comment",pattern:/^\/\*/,cbParser:function(e){let t="";let n=0;const s=(e=e.substring(2)).indexOf("*/");s<0?(t=e,e=""):(t=e.substring(0,s),e=e.substring(s+2));for(let e=0;e<t.length;e++)"\n"===t.charAt(e)&&n++;return t=t.replace(/(^\s+|\s+$)/,""),{src:e,res:t,josi:"",numEOL:n}}},{name:"def_test",pattern:/^●テスト:/},{name:"def_func",pattern:/^●/},{name:"number",pattern:/^0[xX][0-9a-fA-F]+(_[0-9a-fA-F]+)*/,readJosi:!0,cb:d},{name:"number",pattern:/^0[oO][0-7]+(_[0-7]+)*/,readJosi:!0,cb:d},{name:"number",pattern:/^0[bB][0-1]+(_[0-1]+)*/,readJosi:!0,cb:d},{name:"number",pattern:/^\d+(_\d+)*\.(\d+(_\d+)*)?([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:d},{name:"number",pattern:/^\.\d+(_\d+)*([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:d},{name:"number",pattern:/^\d+(_\d+)*([eE][+|-]?\d+(_\d+)*)?/,readJosi:!0,cb:d},{name:"ここから",pattern:/^(ここから),?/},{name:"ここまで",pattern:/^(ここまで|💧)/},{name:"もし",pattern:/^もしも?/},{name:"違えば",pattern:/^違(えば)?/},{name:"shift_r0",pattern:/^>>>/},{name:"shift_r",pattern:/^>>/},{name:"shift_l",pattern:/^<</},{name:"===",pattern:/^===/},{name:"!==",pattern:/^!==/},{name:"gteq",pattern:/^(≧|>=|=>)/},{name:"lteq",pattern:/^(≦|<=|=<)/},{name:"noteq",pattern:/^(≠|<>|!=)/},{name:"←",pattern:/^(←|<--)/},{name:"eq",pattern:/^(=|🟰)/},{name:"line_comment",pattern:/^(!|💡)(インデント構文|ここまでだるい)[^\n]*/},{name:"not",pattern:/^(!|💡)/},{name:"gt",pattern:/^>/},{name:"lt",pattern:/^</},{name:"and",pattern:/^(かつ|&&)/},{name:"or",pattern:/^(または|或いは|あるいは|\|\|)/},{name:"@",pattern:/^@/},{name:"+",pattern:/^\+/},{name:"-",pattern:/^-/},{name:"*",pattern:/^(×|\*)/},{name:"÷÷",pattern:/^÷÷/},{name:"÷",pattern:/^(÷|\/)/},{name:"%",pattern:/^%/},{name:"^",pattern:/^\^/},{name:"&",pattern:/^&/},{name:"[",pattern:/^\[/},{name:"]",pattern:/^]/,readJosi:!0},{name:"(",pattern:/^\(/},{name:")",pattern:/^\)/,readJosi:!0},{name:"|",pattern:/^\|/},{name:"string",pattern:/^🌿/,cbParser:e=>p("🌿","🌿",e)},{name:"string_ex",pattern:/^🌴/,cbParser:e=>p("🌴","🌴",e)},{name:"string_ex",pattern:/^「/,cbParser:e=>p("「","」",e)},{name:"string",pattern:/^『/,cbParser:e=>p("『","』",e)},{name:"string_ex",pattern:/^“/,cbParser:e=>p("“","”",e)},{name:"string_ex",pattern:/^"/,cbParser:e=>p('"','"',e)},{name:"string",pattern:/^'/,cbParser:e=>p("'","'",e)},{name:"」",pattern:/^」/,cbParser:f("」")},{name:"』",pattern:/^』/,cbParser:f("』")},{name:"func",pattern:/^\{関数\},?/},{name:"{",pattern:/^\{/},{name:"}",pattern:/^\}/,readJosi:!0},{name:":",pattern:/^:/},{name:"_eol",pattern:/^_\s*\n/},{name:"dec_lineno",pattern:/^‰/},{name:"word",pattern:/^[\uD800-\uDBFF][\uDC00-\uDFFF][_a-zA-Z0-9]*/,readJosi:!0},{name:"word",pattern:/^[\u1F60-\u1F6F][_a-zA-Z0-9]*/,readJosi:!0},{name:"word",pattern:/^《.+?》/,readJosi:!0},{name:"word",pattern:/^[_a-zA-Z\u3005\u4E00-\u9FCFぁ-んァ-ヶ\u2460-\u24FF\u2776-\u277F\u3251-\u32BF]/,cbParser:function(e,t=!0){let n="",s="";for(;""!==e;){if(n.length>0){const t=i.josiRE.exec(e);if(t){s=t[0].replace(/^\s+/,""),","===(e=e.substr(t[0].length)).charAt(0)&&(e=e.substr(1));break}}const t=o.exec(e);if(t){n+=t[0],e=e.substr(t[0].length);continue}if(!u.test(e))break;n+=e.charAt(0),e=e.substr(1)}/[ぁ-ん]間$/.test(n)&&(e=n.charAt(n.length-1)+e,n=n.slice(0,-1));const r=a.exec(n);r&&(e=r[1]+s+e,s="",n=n.substr(0,n.length-r[1].length));i.removeJosiMap[s]&&(s="");t&&(n=function(e){if(!u.test(e))return e.replace(/[ぁ-ん]+/g,"");if(c.test(e))return e;return e.replace(/[ぁ-ん]+$/g,"")}(n));""===n&&""!==s&&(n=s,s="");return{src:e,res:n,josi:s,numEOL:0}}}];function p(e,t,n){let s="",r="",o=0;const u=(n=n.substr(e.length)).indexOf(t);if(u<0)s=n,n="";else if(s=n.substr(0,u),n=n.substr(u+t.length),s.indexOf(e)>=0)throw"『"===e?new Error("「『」で始めた文字列の中に「『」を含めることはできません。"):new Error(`『${e}』で始めた文字列の中に『${e}』を含めることはできません。`);const c=i.josiRE.exec(n);c&&(r=c[0].replace(/^\s+/,""),","===(n=n.substr(c[0].length)).charAt(0)&&(n=n.substr(1))),i.removeJosiMap[r]&&(r="");for(let e=0;e<s.length;e++)"\n"===s.charAt(e)&&o++;return{src:n,res:s,josi:r,numEOL:o}}function d(e){return Number(e.replace(/_/g,""))}var _=n(6297);class y{constructor(e){this.logger=e,this.funclist={},this.modList=[],this.result=[],this.modName="main.nako3"}setFuncList(e){this.funclist=e}replaceTokens(e,t,n){if(this.result=e,this.modName=y.filenameToModName(n),y.preDefineFunc(e,this.logger,this.funclist),this._replaceWord(this.result),t)if(this.result.length>0){const e=this.result[this.result.length-1];this.result.push({type:"eol",line:e.line,column:0,file:e.file,josi:"",value:"---",startOffset:e.startOffset,endOffset:e.endOffset,rawJosi:""}),this.result.push({type:"eof",line:e.line,column:0,file:e.file,josi:"",value:"",startOffset:e.startOffset,endOffset:e.endOffset,rawJosi:""})}else this.result.push({type:"eol",line:0,column:0,file:"",josi:"",value:"---",startOffset:0,endOffset:0,rawJosi:""}),this.result.push({type:"eof",line:0,column:0,file:"",josi:"",value:"",startOffset:0,endOffset:0,rawJosi:""});return this.result}static preDefineFunc(e,t,n){let s=0,i=!1;const o=()=>{const t=[],n={};if("("!==e[s].type)return[];for(s++;e[s];){const r=e[s];if(s++,")"===r.type)break;"func"===r.type?i=!0:"|"!==r.type&&"comma"!==r.type&&(i&&(r.funcPointer=!0,i=!1),t.push(r),n[r.value]||(n[r.value]=[]),n[r.value].push(r.josi))}const r=[],o=[],u=[],c={};for(const e of t)if(!c[e.value]){const t=n[e.value];u.push(t),r.push(e.value),e.funcPointer?o.push(e.value):o.push(null),c[e.value]=!0}return[u,r,o]};for(;s<e.length;){const i=e[s];if("word"===i.type&&"には"===i.josi||"word"===i.type&&"は~"===i.josi){i.josi="には",e.splice(s+1,0,{type:"def_func",value:"関数",line:i.line,column:i.column,file:i.file,josi:"",startOffset:i.endOffset,endOffset:i.endOffset,rawJosi:"",tag:"無名関数"}),s++;continue}if("word"===i.type&&""===i.josi&&i.value.length>=2&&i.value.match(/回$/)){i.value=i.value.substring(0,i.value.length-1),i.endOffset||(i.endOffset=1);const t={type:"回",value:"回",line:i.line,column:i.column,file:i.file,josi:"",startOffset:i.endOffset-1,endOffset:i.endOffset,rawJosi:""};e.splice(s+1,0,t),i.endOffset--,s++}if("word"===i.type&&r.default[i.value]&&(i.type=r.default[i.value],"そう"===i.value&&(i.value="それ")),"def_test"!==i.type&&"def_func"!==i.type){s++;continue}let u=!0,c={type:"eol"};s>=1&&(c=e[s-1]),"eol"===c.type&&(u=!1);const a=i;s++;let f=[],l=[],h=[],p="",d=null;if(e[s]&&"("===e[s].type&&([f,l,h]=o()),!u&&e[s]&&"word"===e[s].type&&(d=e[s++],p=d.value),0===f.length&&e[s]&&"("===e[s].type&&([f,l,h]=o()),""!==p&&d){if(p=y.filenameToModName(i.file)+"__"+p,p in n){const e=p.replace(/^main__/,"");t.warn(`関数『${e}』は既に定義されています。`,a)}d.value=p,n[p]={type:"func",josi:f,fn:null,asyncFn:!1,varnames:l,funcPointers:h}}a.meta={type:"func",josi:f,varnames:l,funcPointers:h}}}splitStringEx(e){const t=[],n=e.split(/[{{]/);t.push(n[0]);for(const e of n.slice(1)){const n=e.replace("}","}").indexOf("}");if(-1===n)return null;t.push(e.slice(0,n),e.slice(n+1))}return t}_replaceWord(e){let t=[],n=0;const r=e.length>0?y.filenameToModName(e[0].file):"main.nako3";for(;n<e.length;){const o=e[n];if("word"===o.type&&"それ"!==o.value){const e=o.value;if(e.indexOf("__")<0){const t=`${r}__${e}`,n=this.funclist[t];if(n&&"func"===n.type){o.type="func",o.meta=n,o.value=t;continue}for(const t of this.modList){const n=`${t}__${e}`,s=this.funclist[n];if(s&&"func"===s.type){o.type="func",o.meta=s,o.value=n;break}}if("func"===o.type)continue}const t=this.funclist[e];t&&"func"===t.type&&(o.type="func",o.meta=t)}if("-"===o.type&&e[n+1]&&"number"===e[n+1].type){const t=n<=0?"eol":e[n-1].type;("eol"===t||s.bW[t]||""!==e[n-1].josi)&&(e.splice(n,1),e[n].value*=-1)}if(void 0===o.josi&&(o.josi=""),"は"!==o.josi)if("とは"!==o.josi)if(i.tararebaMap[o.josi]){const t="でなければ"===o.josi||"なければ"===o.josi?"でなければ":"ならば";o.rawJosi||(o.rawJosi=t);const s=void 0===o.endOffset?void 0:o.endOffset-o.rawJosi.length;e.splice(n+1,0,{type:"ならば",value:t,line:o.line,column:o.column,file:o.file,startOffset:s,endOffset:o.endOffset,josi:"",rawJosi:""}),o.josi=o.rawJosi="",o.endOffset=s,n+=2}else"_eol"!==o.type?"line_comment"!==o.type&&"range_comment"!==o.type?("eol"===o.type&&(o.value=t.join("/"),t=[]),n++):(t.push(o.value),e.splice(n,1)):e.splice(n,1);else{o.rawJosi||(o.rawJosi=o.josi);const t=void 0===o.endOffset?void 0:o.endOffset-o.rawJosi.length;e.splice(n+1,0,{type:o.josi,line:o.line,column:o.column,file:o.file,startOffset:t,endOffset:o.endOffset,josi:"",rawJosi:"",value:void 0}),o.josi=o.rawJosi="",o.endOffset=t,n+=2}else{o.rawJosi||(o.rawJosi=o.josi);const t=void 0===o.endOffset?void 0:o.endOffset-o.rawJosi.length;e.splice(n+1,0,{type:"eq",line:o.line,column:o.column,file:o.file,startOffset:t,endOffset:o.endOffset,josi:"",rawJosi:"",value:void 0}),n+=2,o.josi=o.rawJosi="",o.endOffset=t}}}tokenize(e,t,n){const s=e.length,r=[];let o,u,c=1,a=!1;for(;""!==e;){let f=!1;for(const p of h){const h=p.pattern.exec(e);if(!h)continue;if(f=!0,"space"===p.name){c+=h[0].length,e=e.substring(h[0].length);continue}if(p.cbParser){let i;if(a&&"word"===p.name)i=p.cbParser(e,!1);else try{i=p.cbParser(e)}catch(r){throw new _.tO(r.message,s-e.length,s-e.length+1,t,n)}if("string_ex"===p.name){const o=this.splitStringEx(i.res);if(null===o)throw new _.cg("展開あり文字列で値の埋め込み{...}が対応していません。",s-e.length,s-i.src.length,t,n);let u=0;for(let a=0;a<o.length;a++){const f=a===o.length-1?i.josi:"";a%2==0?(r.push({type:"string",value:o[a],file:n,josi:f,line:t,column:c,preprocessedCodeOffset:s-e.length+u,preprocessedCodeLength:o[a].length+2+f.length}),u+=o[a].length+2):(r.push({type:"&",value:"&",josi:"",file:n,line:t,column:c,preprocessedCodeOffset:s-e.length+u,preprocessedCodeLength:0}),r.push({type:"(",value:"(",josi:"",file:n,line:t,column:c,preprocessedCodeOffset:s-e.length+u,preprocessedCodeLength:0}),r.push({type:"code",value:o[a],josi:"",file:n,line:t,column:c,preprocessedCodeOffset:s-e.length+u,preprocessedCodeLength:o[a].length}),r.push({type:")",value:")",josi:"",file:n,line:t,column:c,preprocessedCodeOffset:s-e.length+u+o[a].length,preprocessedCodeLength:0}),r.push({type:"&",value:"&",josi:"",file:n,line:t,column:c,preprocessedCodeOffset:s-e.length+u+o[a].length,preprocessedCodeLength:0}),u+=o[a].length)}t+=i.numEOL,c+=e.length-i.src.length,e=i.src,i.numEOL>0&&(c=1);break}o=c,c+=e.length-i.src.length,r.push({type:p.name,value:i.res,josi:i.josi,line:t,column:o,file:n,preprocessedCodeOffset:s-e.length,preprocessedCodeLength:e.length-i.src.length}),e=i.src,t+=i.numEOL,i.numEOL>0&&(c=1);break}const d=s-e.length;let y=h[0];if(p.cb&&(y=p.cb(y)),o=c,u=t,c+=h[0].length,e=e.substring(h[0].length),("eol"===p.name&&"\n"===y||"_eol"===p.name)&&(y=t++,c=1),"number"===p.name){const t=l.exec(e);t&&(e=e.substring(t[0].length),c+=h[0].length)}let m="";if(p.readJosi){const t=i.josiRE.exec(e);t&&(m=t[0].replace(/^\s+/,""),c+=t[0].length,","===(e=e.substring(t[0].length)).charAt(0)&&(e=e.substring(1)),i.removeJosiMap[m]&&(m=""))}switch(p.name){case"def_test":a=!0;break;case"eol":a=!1}if("dec_lineno"!==p.name){r.push({type:p.name,value:y,line:u,column:o,file:n,josi:m,preprocessedCodeOffset:d,preprocessedCodeLength:s-e.length-d});break}t--}if(!f)throw new _.cg("未知の語句: "+e.substring(0,3)+"...",s-e.length,s-s+3,t,n)}return r}static tokensToTypeStr(e,t){return e.map((e=>e.type)).join(t)}static filenameToModName(e){if(!e)return"main";if((e=e.replace(/[\\:]/g,"/")).indexOf("/")>=0){const t=e.split("/");e=t[t.length-1]}return e=e.replace(/\.nako3?$/,"")}}},7206:function(e,t,n){n.d(t,{Ij:function(){return i},QQ:function(){return r},bW:function(){return s}});const s={and:1,or:1,eq:2,noteq:2,"===":2,"!==":2,gt:2,gteq:2,lt:2,lteq:2,"&":3,"+":4,"-":4,shift_l:4,shift_r:4,shift_r0:4,"*":5,"/":5,"÷":5,"÷÷":5,"%":5,"^":6},r=["いて","えて","きて","けて","して","って","にて","みて","めて","ねて","には","んで"],i=[];for(const e in s)i.push(e)},515:function(e,t,n){n.r(t);t.default={"回":"回","回繰返":"回","間":"間","間繰返":"間","繰返":"繰返","増繰返":"増繰返","減繰返":"減繰返","後判定":"後判定","反復":"反復","抜":"抜ける","続":"続ける","戻":"戻る","先":"先に","次":"次に","代入":"代入","実行速度優先":"実行速度優先","パフォーマンスモニタ適用":"パフォーマンスモニタ適用","定":"定める","逐次実行":"逐次実行","条件分岐":"条件分岐","増":"増","減":"減","変数":"変数","定数":"定数","エラー監視":"エラー監視","エラー":"エラー","それ":"word","そう":"word","関数":"def_func","インデント構文":"インデント構文","非同期モード":"非同期モード","DNCLモード":"DNCLモード","モード設定":"モード設定","取込":"取込"}},6758:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){var _nako_errors_mjs__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(6297);__webpack_exports__.Z={meta:{type:"const",value:{pluginName:"plugin_system",pluginVersion:"3.3.38",nakoRuntime:["wnako","cnako","phpnako"],nakoVersion:"^3.3.38"}},"初期化":{type:"func",josi:[],pure:!1,fn:function(e){e.__v0["ナデシコバージョン"]=e.version,e.__v0["ナデシコ言語バージョン"]=e.coreVersion,e.__findVar=function(t,n){if("function"==typeof t)return t;if(e.__locals[t])return e.__locals[t];const s=void 0!==e.__modName?e.__modName:"inline",r=t.indexOf("__")>=0?t:s+"__"+t;for(let t=2;t>=0;t--){const n=e.__varslist[t];if(n[r])return n[r]}return n},e.__findFunc=function(t,n){const s=e.__findVar(t);if("function"==typeof s)return s;throw new Error(`『${n}』に実行できない関数が指定されました。`)},e.__exec=function(t,n){const s=e.__v0[t];if(s)return s.apply(this,n);const r=e.__findVar(t);if(!r)throw new Error("システム関数でエイリアスの指定ミス:"+t);return r.apply(this,n)},e.__timeout=[],e.__interval=[];const t=e.__zero2=e=>(e="00"+e).substring(e.length-2);e.__zero=(e,t)=>{let n="";for(let e=0;e<t;e++)n+="0";return(e=n+e).substring(e.length-t)},e.__formatDate=e=>e.getFullYear()+"/"+t(e.getMonth()+1)+"/"+t(e.getDate()),e.__formatTime=e=>t(e.getHours())+":"+t(e.getSeconds())+":"+t(e.getMinutes()),e.__formatDateTime=(e,n)=>{const s=e.getFullYear()+"/"+t(e.getMonth()+1)+"/"+t(e.getDate()),r=t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds());return n.match(/^\d+\/\d+\/\d+\s+\d+:\d+:\d+$/)?s+" "+r:n.match(/^\d+\/\d+\/\d+$/)?s:n.match(/^\d+:\d+:\d+$/)?r:s+" "+r},e.__str2date=e=>{if((e=(""+e).replace(/(^\s+|\s+$)/,"")).match(/^(\d+|\d+\.\d+)$/))return new Date(1e3*parseFloat(e));if(e.match(/^\d+:\d+(:\d+)?$/)){const t=new Date,n=(e+":0").split(":");return new Date(t.getFullYear(),t.getMonth(),t.getDate(),parseInt(n[0]),parseInt(n[1]),parseInt(n[2]))}e=e.replace(/[\s:-]/g,"/");const t=(e+="/0/0/0").split("/");return new Date(parseInt(t[0]),parseInt(t[1])-1,parseInt(t[2]),parseInt(t[3]),parseInt(t[4]),parseInt(t[5]))},e.__printPool=""}},"!クリア":{type:"func",josi:[],pure:!1,fn:function(e){e.__exec("全タイマー停止",[e]),"非同期モード"===e.__genMode&&e.__stopAsync(e),e.__v0["表示ログ"]=""}},"ナデシコバージョン":{type:"const",value:"?"},"ナデシコ言語バージョン":{type:"const",value:"?"},"ナデシコエンジン":{type:"const",value:"nadesi.com/v3"},"ナデシコ種類":{type:"const",value:"?"},"はい":{type:"const",value:1},"いいえ":{type:"const",value:0},"真":{type:"const",value:1},"偽":{type:"const",value:0},"永遠":{type:"const",value:1},"オン":{type:"const",value:1},"オフ":{type:"const",value:0},"改行":{type:"const",value:"\n"},"タブ":{type:"const",value:"\t"},"カッコ":{type:"const",value:"「"},"カッコ閉":{type:"const",value:"」"},"波カッコ":{type:"const",value:"{"},"波カッコ閉":{type:"const",value:"}"},OK:{type:"const",value:!0},NG:{type:"const",value:!1},"キャンセル":{type:"const",value:0},PI:{type:"const",value:Math.PI},"空":{type:"const",value:""},NULL:{type:"const",value:null},undefined:{type:"const",value:void 0},"未定義":{type:"const",value:void 0},"エラーメッセージ":{type:"const",value:""},"対象":{type:"const",value:""},"対象キー":{type:"const",value:""},"回数":{type:"const",value:""},CR:{type:"const",value:"\r"},LF:{type:"const",value:"\n"},"非数":{type:"const",value:NaN},"無限大":{type:"const",value:1/0},"空配列":{type:"func",josi:[],pure:!0,fn:function(){return[]}},"空辞書":{type:"func",josi:[],pure:!0,fn:function(){return{}}},"空ハッシュ":{type:"func",josi:[],pure:!0,fn:function(){return{}}},"空オブジェクト":{type:"func",josi:[],pure:!1,fn:function(e){return e.__exec("空ハッシュ",[e])}},"表示":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){e=t.__printPool+e,t.__printPool="",t.__varslist[0]["表示ログ"]+=e+"\n",t.logger.send("stdout",e+"")},return_none:!0},"継続表示":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){t.__printPool+=e},return_none:!0},"連続表示":{type:"func",josi:[["と","を"]],isVariableJosi:!0,pure:!0,fn:function(...e){const t=e.pop(),n=e.join("");t.__exec("表示",[n,t])},return_none:!0},"連続無改行表示":{type:"func",josi:[["と","を"]],isVariableJosi:!0,pure:!0,fn:function(...e){const t=e.pop(),n=e.join("");t.__exec("継続表示",[n,t])},return_none:!0},"表示ログ":{type:"const",value:""},"表示ログクリア":{type:"func",josi:[],pure:!0,fn:function(e){e.__varslist[0]["表示ログ"]=""},return_none:!0},"言":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){t.logger.send("stdout",e+"")},return_none:!0},"コンソール表示":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e){console.log(e)},return_none:!0},"足":{type:"func",josi:[["に","と"],["を"]],isVariableJosi:!1,pure:!0,fn:function(e,t){return e+t}},"引":{type:"func",josi:[["から"],["を"]],pure:!0,fn:function(e,t){return e-t}},"掛":{type:"func",josi:[["に","と"],["を"]],pure:!0,fn:function(e,t){return e*t}},"倍":{type:"func",josi:[["の"],[""]],pure:!0,fn:function(e,t){return e*t}},"割":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e/t}},"割余":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e%t}},"偶数":{type:"func",josi:[["が"]],pure:!0,fn:function(e){return parseInt(e)%2==0}},"奇数":{type:"func",josi:[["が"]],pure:!0,fn:function(e){return parseInt(e)%2==1}},"二乗":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return e*e}},"べき乗":{type:"func",josi:[["の"],["の"]],pure:!0,fn:function(e,t){return Math.pow(e,t)}},"以上":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e>=t}},"以下":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e<=t}},"未満":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e<t}},"超":{type:"func",josi:[["が"],[""]],pure:!0,fn:function(e,t){return e>t}},"等":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){return e===t}},"等無":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){return e!==t}},"一致":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){if("object"==typeof e){return JSON.stringify(e)===JSON.stringify(t)}return e===t}},"不一致":{type:"func",josi:[["が"],["と"]],pure:!0,fn:function(e,t){if("object"==typeof e){return JSON.stringify(e)!==JSON.stringify(t)}return e!==t}},"範囲内":{type:"func",josi:[["が"],["から"],["の"]],pure:!0,fn:function(e,t,n){return t<=e&&e<=n}},"連続加算":{type:"func",josi:[["を"],["に","と"]],isVariableJosi:!0,pure:!0,fn:function(e,...t){return t.pop(),t.push(e),t.reduce(((e,t)=>e+t))}},"ください":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu||(e.__reisetu=0),e.__reisetu++},return_none:!0},"お願":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu||(e.__reisetu=0),e.__reisetu++},return_none:!0},"です":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu||(e.__reisetu=0),e.__reisetu++},return_none:!0},"拝啓":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu=0},return_none:!0},"敬具":{type:"func",josi:[],pure:!0,fn:function(e){e.__reisetu+=100},return_none:!0},"礼節レベル取得":{type:"func",josi:[],pure:!0,fn:function(e){return e.__reisetu||(e.__reisetu=0),e.__reisetu}},"JS実行":{type:"func",josi:[["を","で"]],pure:!0,fn:function(src,sys){return eval(src)}},"JSオブジェクト取得":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__findVar(e,null)}},"JS関数実行":{type:"func",josi:[["を"],["で"]],fn:function(name,args){if("string"==typeof name&&(name=eval(name)),"function"!=typeof name)throw new Error("JS関数取得で実行できません。");return args instanceof Array||(args=[args]),name.apply(null,args)}},"JSメソッド実行":{type:"func",josi:[["の"],["を"],["で"]],fn:function(obj,m,args){if("string"==typeof obj&&(obj=eval(obj)),"object"!=typeof obj)throw new Error("JSオブジェクトを取得できませんでした。");return"function"!=typeof m&&(m=obj[m]),args instanceof Array||(args=[args]),m.apply(obj,args)}},"ナデシコ":{type:"func",josi:[["を","で"]],pure:!1,fn:function(e,t){if("非同期モード"===t.__genMode)throw new Error("非同期モードでは「ナデシコ」は利用できません。");t.__varslist[0]["表示ログ"]="",t.__self.runEx(e,t.__modName,{resetEnv:!1,resetLog:!0});const n=t.__varslist[0]["表示ログ"]+"";return n&&t.logger.trace(n),n}},"ナデシコ続":{type:"func",josi:[["を","で"]],fn:function(e,t){if("非同期モード"===t.__genMode)throw new Error("非同期モードでは「ナデシコ続」は利用できません。");t.__self.runEx(e,t.__modName,{resetEnv:!1,resetLog:!1});const n=t.__varslist[0]["表示ログ"]+"";return n&&t.logger.trace(n),n}},"実行":{type:"func",josi:[["を","に","で"]],pure:!1,fn:function(e,t){if("function"==typeof e)return e(t);if("string"==typeof e){const n=t.__findFunc(e,"実行");if("function"==typeof n)return n(t)}return e}},"実行時間計測":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){if("string"==typeof e&&(e=t.__findFunc(e,"実行時間計測")),performance&&performance.now){const n=performance.now();e(t);return performance.now()-n}{const n=Date.now();e(t);return Date.now()-n}}},"変数型確認":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return typeof e}},TYPEOF:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return typeof e}},"文字列変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return String(e)}},TOSTR:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return String(e)}},"整数変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseInt(e)}},TOINT:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseInt(e)}},"実数変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseFloat(e)}},TOFLOAT:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return parseFloat(e)}},INT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return parseInt(e)}},FLOAT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return parseFloat(e)}},"NAN判定":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return isNaN(e)}},"非数判定":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Number.isNaN(e)}},HEX:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return parseInt(e).toString(16)}},"進数変換":{type:"func",josi:[["を","の"],[""]],pure:!0,fn:function(e,t){return parseInt(e).toString(t)}},"二進":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e){return parseInt(e).toString(2)}},"二進表示":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e,t){const n=parseInt(e).toString(2);t.__exec("表示",[n,t])}},RGB:{type:"func",josi:[["と"],["の"],["で"]],pure:!0,fn:function(e,t,n){const s=e=>{const t="00"+parseInt(""+e).toString(16);return t.substring(t.length-2,t.length)};return"#"+s(e)+s(t)+s(n)}},"論理OR":{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e||t}},"論理AND":{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e&&t}},"論理NOT":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e?0:1}},OR:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e|t}},AND:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e&t}},XOR:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return e^t}},NOT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return~e}},SHIFT_L:{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e<<t}},SHIFT_R:{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e>>t}},SHIFT_UR:{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){return e>>>t}},"文字数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Array.from?Array.from(e).length:String(e).length}},"何文字目":{type:"func",josi:[["で","の"],["が"]],pure:!0,fn:function(e,t){return String(e).indexOf(t)+1}},CHR:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return String.fromCodePoint?String.fromCodePoint(e):String.fromCharCode(e)}},ASC:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return String.prototype.codePointAt?String(e).codePointAt(0):String(e).charCodeAt(0)}},"文字挿入":{type:"func",josi:[["で","の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){t<=0&&(t=1);const s=String(e);return s.substring(0,t-1)+n+s.substring(t-1)}},"文字検索":{type:"func",josi:[["で","の"],["から"],["を"]],pure:!0,fn:function(e,t,n){let s=String(e);s=s.substring(t);const r=s.indexOf(n);return-1===r?0:r+1+t}},"追加":{type:"func",josi:[["で","に","へ"],["を"]],pure:!0,fn:function(e,t){return e instanceof Array?(e.push(t),e):String(e)+String(t)}},"一行追加":{type:"func",josi:[["で","に","へ"],["を"]],pure:!0,fn:function(e,t){return e instanceof Array?(e.push(t),e):String(e)+String(t)+"\n"}},"文字列分解":{type:"func",josi:[["を","の","で"]],pure:!0,fn:function(e){return Array.from?Array.from(e):String(e).split("")}},"リフレイン":{type:"func",josi:[["を","の"],["で"]],pure:!0,fn:function(e,t){let n="";for(let s=0;s<t;s++)n+=String(e);return n}},"出現回数":{type:"func",josi:[["で"],["の"]],pure:!0,fn:function(e,t){return(e=""+e).split(t=""+t).length-1}},MID:{type:"func",josi:[["で","の"],["から"],["を"]],pure:!0,fn:function(e,t,n){return n=n||1,String(e).substring(t-1,t+n-1)}},"文字抜出":{type:"func",josi:[["で","の"],["から"],["を",""]],pure:!0,fn:function(e,t,n){return n=n||1,String(e).substring(t-1,t+n-1)}},LEFT:{type:"func",josi:[["の","で"],["だけ"]],pure:!0,fn:function(e,t){return String(e).substring(0,t)}},"文字左部分":{type:"func",josi:[["の","で"],["だけ",""]],pure:!0,fn:function(e,t){return String(e).substring(0,t)}},RIGHT:{type:"func",josi:[["の","で"],["だけ"]],pure:!0,fn:function(e,t){return(e=""+e).substring(e.length-t,e.length)}},"文字右部分":{type:"func",josi:[["の","で"],["だけ",""]],pure:!0,fn:function(e,t){return(e=""+e).substring(e.length-t,e.length)}},"区切":{type:"func",josi:[["の","を"],["で"]],pure:!0,fn:function(e,t){return(""+e).split(""+t)}},"文字列分割":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=(e=""+e).indexOf(t=""+t);return n<0?[e]:[e.substring(0,n),e.substring(n+t.length)]}},"切取":{type:"func",josi:[["から","の"],["まで","を"]],pure:!0,fn:function(e,t,n){const s=(e=String(e)).indexOf(t);return s<0?(n.__v0["対象"]="",e):(n.__v0["対象"]=e.substring(s+t.length),e.substring(0,s))}},"文字削除":{type:"func",josi:[["の"],["から"],["だけ","を",""]],pure:!0,fn:function(e,t,n){return(e=""+e).substring(0,t-1)+e.substring(t-1+n)}},"置換":{type:"func",josi:[["の","で"],["を","から"],["に","へ"]],pure:!0,fn:function(e,t,n){return String(e).split(t).join(n)}},"単置換":{type:"func",josi:[["の","で"],["を"],["に","へ"]],pure:!0,fn:function(e,t,n){return String(e).replace(t,n)}},"トリム":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return e=String(e).replace(/^\s+/,"").replace(/\s+$/,"")}},"空白除去":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return e=String(e).replace(/^\s+/,"").replace(/\s+$/,"")}},"大文字変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).toUpperCase()}},"小文字変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).toLowerCase()}},"平仮名変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(""+e).replace(/[\u30a1-\u30f6]/g,(function(e){const t=e.charCodeAt(0)-96;return String.fromCharCode(t)}))}},"カタカナ変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(""+e).replace(/[\u3041-\u3096]/g,(function(e){const t=e.charCodeAt(0)+96;return String.fromCharCode(t)}))}},"英数全角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[A-Za-z0-9]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)+65248)}))}},"英数半角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[A-Za-z0-9]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)-65248)}))}},"英数記号全角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[\x20-\x7F]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)+65248)}))}},"英数記号半角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){return String(e).replace(/[\uFF00-\uFF5F]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)-65248)}))}},"カタカナ全角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e,t){const n=t.__v0["全角カナ一覧"],s=t.__v0["半角カナ一覧"],r=t.__v0["全角カナ濁音一覧"],i=t.__v0["半角カナ濁音一覧"];let o="",u=0;for(;u<e.length;){const t=e.substring(u,u+2),c=i.indexOf(t);if(c>=0){o+=r.charAt(c/2),u+=2;continue}const a=e.charAt(u),f=s.indexOf(a);f>=0?(o+=n.charAt(f),u++):(o+=a,u++)}return o}},"カタカナ半角変換":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e,t){const n=t.__v0["全角カナ一覧"],s=t.__v0["半角カナ一覧"],r=t.__v0["全角カナ濁音一覧"],i=t.__v0["半角カナ濁音一覧"];return e.split("").map((e=>{const t=n.indexOf(e);if(t>=0)return s.charAt(t);const o=r.indexOf(e);return o>=0?i.substring(2*o,2*o+2):e})).join("")}},"全角変換":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){let n=e;return n=t.__exec("カタカナ全角変換",[n,t]),n=t.__exec("英数記号全角変換",[n,t]),n}},"半角変換":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){let n=e;return n=t.__exec("カタカナ半角変換",[n,t]),n=t.__exec("英数記号半角変換",[n,t]),n}},"全角カナ一覧":{type:"const",value:"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲンァィゥェォャュョッ、。ー「」"},"全角カナ濁音一覧":{type:"const",value:"ガギグゲゴザジズゼゾダヂヅデドバビブベボパピプペポ"},"半角カナ一覧":{type:"const",value:"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲンァィゥェォャュョッ、。ー「」゙゚"},"半角カナ濁音一覧":{type:"const",value:"ガギグゲゴザジズゼゾダヂヅデドバビブベボパピプペポ"},"JSONエンコード":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return JSON.stringify(e)}},"JSONエンコード整形":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return JSON.stringify(e,null,2)}},"JSONデコード":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e){return JSON.parse(e)}},"正規表現マッチ":{type:"func",josi:[["を","が"],["で","に"]],pure:!0,fn:function(e,t,n){let s;const r=(""+t).match(/^\/(.+)\/([a-zA-Z]*)$/);s=null===r?new RegExp(t,"g"):new RegExp(r[1],r[2]);const i=n.__varslist[0]["抽出文字列"]=[],o=String(e).match(s);let u=o;if(s.global);else if(o&&o.length>0){u=o[0];for(let e=1;e<o.length;e++)i[e-1]=o[e]}return u}},"抽出文字列":{type:"const",value:[]},"正規表現置換":{type:"func",josi:[["の"],["を","から"],["で","に","へ"]],pure:!0,fn:function(e,t,n){let s;const r=t.match(/^\/(.+)\/([a-zA-Z]*)/);return s=null===r?new RegExp(t,"g"):new RegExp(r[1],r[2]),String(e).replace(s,n)}},"正規表現区切":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){let n;const s=t.match(/^\/(.+)\/([a-zA-Z]*)/);return n=null===s?new RegExp(t,"g"):new RegExp(s[1],s[2]),String(e).split(n)}},"通貨形式":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return String(e).replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")}},"ゼロ埋":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){e=String(e);let n="0";for(let e=0;e<t;e++)n+="0";(t=parseInt(t))<e.length&&(t=e.length);const s=n+String(e);return s.substring(s.length-t,s.length)}},"空白埋":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){e=String(e);let n=" ";for(let e=0;e<t;e++)n+=" ";(t=parseInt(t))<e.length&&(t=e.length);const s=n+String(e);return s.substring(s.length-t,s.length)}},"かなか判定":{type:"func",josi:[["を","の","が"]],pure:!0,fn:function(e){const t=String(e).charCodeAt(0);return t>=12353&&t<=12447}},"カタカナ判定":{type:"func",josi:[["を","の","が"]],pure:!0,fn:function(e){const t=String(e).charCodeAt(0);return t>=12449&&t<=12538}},"数字判定":{type:"func",josi:[["を","が"]],pure:!0,fn:function(e){const t=String(e).charAt(0);return t>="0"&&t<="9"||t>="0"&&t<="9"}},"数列判定":{type:"func",josi:[["を","が"]],pure:!0,fn:function(e){return null!==String(e).match(/^[0-9.]+$/)}},"配列結合":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){if(e instanceof Array)return e.join(""+t);return String(e).split("\n").join(""+t)}},"配列検索":{type:"func",josi:[["の","から"],["を"]],pure:!0,fn:function(e,t){return e instanceof Array?e.indexOf(t):-1}},"配列要素数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e instanceof Array?e.length:e instanceof Object?Object.keys(e).length:1}},"要素数":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__exec("配列要素数",[e])}},"配列挿入":{type:"func",josi:[["の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){if(e instanceof Array)return e.splice(t,0,n);throw new Error("『配列挿入』で配列以外の要素への挿入。")}},"配列一括挿入":{type:"func",josi:[["の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){if(e instanceof Array&&n instanceof Array){for(let s=0;s<n.length;s++)e.splice(t+s,0,n[s]);return e}throw new Error("『配列一括挿入』で配列以外の要素への挿入。")}},"配列ソート":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array)return e.sort();throw new Error("『配列ソート』で配列以外が指定されました。")}},"配列数値ソート":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array)return e.sort(((e,t)=>parseFloat(e)-parseFloat(t)));throw new Error("『配列数値ソート』で配列以外が指定されました。")}},"配列カスタムソート":{type:"func",josi:[["で"],["の","を"]],pure:!1,fn:function(e,t,n){let s=e;if("string"==typeof e&&(s=n.__findFunc(e,"配列カスタムソート")),t instanceof Array)return t.sort(s);throw new Error("『配列カスタムソート』で配列以外が指定されました。")}},"配列逆順":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array)return e.reverse();throw new Error("『配列ソート』で配列以外が指定されました。")}},"配列シャッフル":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e){if(e instanceof Array){for(let t=e.length-1;t>0;t--){const n=Math.floor(Math.random()*(t+1)),s=e[t];e[t]=e[n],e[n]=s}return e}throw new Error("『配列シャッフル』で配列以外が指定されました。")}},"配列削除":{type:"func",josi:[["の","から"],["を"]],pure:!1,fn:function(e,t,n){return n.__exec("配列切取",[e,t,n])}},"配列切取":{type:"func",josi:[["の","から"],["を"]],pure:!0,fn:function(e,t){if(e instanceof Array){const n=e.splice(t,1);return n instanceof Array?n[0]:null}if(!(e instanceof Object&&"string"==typeof t))throw new Error("『配列切取』で配列以外を指定。");if(e[t]){const n=e[t];return delete e[t],n}}},"配列取出":{type:"func",josi:[["の"],["から"],["を"]],pure:!0,fn:function(e,t,n){if(e instanceof Array)return e.splice(t,n);throw new Error("『配列取出』で配列以外を指定。")}},"配列ポップ":{type:"func",josi:[["の","から"]],pure:!0,fn:function(e){if(e instanceof Array)return e.pop();throw new Error("『配列ポップ』で配列以外の処理。")}},"配列追加":{type:"func",josi:[["に","へ"],["を"]],pure:!0,fn:function(e,t){if(e instanceof Array)return e.push(t),e;throw new Error("『配列追加』で配列以外の処理。")}},"配列複製":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return JSON.parse(JSON.stringify(e))}},"配列足":{type:"func",josi:[["に","へ","と"],["を"]],pure:!0,fn:function(e,t){return e instanceof Array?e.concat(t):JSON.parse(JSON.stringify(e))}},"配列最大値":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e.reduce(((e,t)=>Math.max(e,t)))}},"配列最小値":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e.reduce(((e,t)=>Math.min(e,t)))}},"配列合計":{type:"func",josi:[["の"]],pure:!0,fn:function(e){if(e instanceof Array){let t=0;return e.forEach((e=>{const n=parseFloat(e);isNaN(n)||(t+=n)})),t}throw new Error("『配列合計』で配列変数以外の値が指定されました。")}},"表ソート":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表ソート』には配列を指定する必要があります。");return e.sort(((e,n)=>{const s=e[t],r=n[t];return s===r?0:s<r?-1:1})),e}},"表数値ソート":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表数値ソート』には配列を指定する必要があります。");return e.sort(((e,n)=>e[t]-n[t])),e}},"表ピックアップ":{type:"func",josi:[["の"],["から"],["を","で"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表ピックアップ』には配列を指定する必要があります。");return e.filter((e=>String(e[t]).indexOf(n)>=0))}},"表完全一致ピックアップ":{type:"func",josi:[["の"],["から"],["を","で"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表完全ピックアップ』には配列を指定する必要があります。");return e.filter((e=>e[t]===n))}},"表検索":{type:"func",josi:[["の"],["で","に"],["から"],["を"]],pure:!0,fn:function(e,t,n,s){if(!(e instanceof Array))throw new Error("『表検索』には配列を指定する必要があります。");for(let r=n;r<e.length;r++)if(e[r][t]===s)return r;return-1}},"表列数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){if(!(e instanceof Array))throw new Error("『表列数』には配列を指定する必要があります。");let t=1;for(let n=0;n<e.length;n++)e[n].length>t&&(t=e[n].length);return t}},"表行数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){if(!(e instanceof Array))throw new Error("『表行数』には配列を指定する必要があります。");return e.length}},"表行列交換":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表行列交換』には配列を指定する必要があります。");const n=t.__exec("表列数",[e]),s=e.length,r=[];for(let t=0;t<n;t++){const n=[];r.push(n);for(let r=0;r<s;r++)n[r]=void 0!==e[r][t]?e[r][t]:""}return r}},"表右回転":{type:"func",josi:[["の","を"]],pure:!1,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表右回転』には配列を指定する必要があります。");const n=t.__exec("表列数",[e]),s=e.length,r=[];for(let t=0;t<n;t++){const n=[];r.push(n);for(let r=0;r<s;r++)n[r]=e[s-r-1][t]}return r}},"表重複削除":{type:"func",josi:[["の"],["を","で"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表重複削除』には配列を指定する必要があります。");const n=[],s={};for(let r=0;r<e.length;r++){const i=e[r][t];void 0===s[i]&&(s[i]=!0,n.push(e[r]))}return n}},"表列取得":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表列取得』には配列を指定する必要があります。");return e.map((e=>e[t]))}},"表列挿入":{type:"func",josi:[["の"],["に","へ"],["を"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表列挿入』には配列を指定する必要があります。");const s=[];return e.forEach(((e,r)=>{let i=[];t>0&&(i=i.concat(e.slice(0,t))),i.push(n[r]),i=i.concat(e.slice(t)),s.push(i)})),s}},"表列削除":{type:"func",josi:[["の"],["を"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表列削除』には配列を指定する必要があります。");const n=[];return e.forEach((e=>{const s=e.slice(0);s.splice(t,1),n.push(s)})),n}},"表列合計":{type:"func",josi:[["の"],["を","で"]],pure:!0,fn:function(e,t){if(!(e instanceof Array))throw new Error("『表列合計』には配列を指定する必要があります。");let n=0;return e.forEach((e=>{n+=e[t]})),n}},"表曖昧検索":{type:"func",josi:[["の"],["から"],["で"],["を"]],pure:!0,fn:function(e,t,n,s){if(!(e instanceof Array))throw new Error("『表曖昧検索』には配列を指定する必要があります。");const r=new RegExp(s);for(let s=t;s<e.length;s++){const t=e[s];if(r.test(t[n]))return s}return-1}},"表正規表現ピックアップ":{type:"func",josi:[["の","で"],["から"],["を"]],pure:!0,fn:function(e,t,n){if(!(e instanceof Array))throw new Error("『表正規表現ピックアップ』には配列を指定する必要があります。");const s=new RegExp(n),r=[];for(let n=0;n<e.length;n++){const i=e[n];s.test(i[t])&&r.push(i.slice(0))}return r}},"辞書キー列挙":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=[];if(e instanceof Object){for(const n in e)t.push(n);return t}if(e instanceof Array){for(let n=0;n<e.length;n++)t.push(n);return t}throw new Error("『辞書キー列挙』でハッシュ以外が与えられました。")}},"辞書キー削除":{type:"func",josi:[["から","の"],["を"]],pure:!0,fn:function(e,t){if(e instanceof Object)return e[t]&&delete e[t],e;throw new Error("『辞書キー削除』でハッシュ以外が与えられました。")}},"辞書キー存在":{type:"func",josi:[["の","に"],["が"]],pure:!0,fn:function(e,t){return t in e}},"ハッシュキー列挙":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__exec("辞書キー列挙",[e,t])}},"ハッシュ内容列挙":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=[];if(e instanceof Object){for(const n in e)t.push(e[n]);return t}throw new Error("『ハッシュ内容列挙』でハッシュ以外が与えられました。")}},"ハッシュキー削除":{type:"func",josi:[["から","の"],["を"]],pure:!1,fn:function(e,t,n){return n.__exec("辞書キー削除",[e,t,n])}},"ハッシュキー存在":{type:"func",josi:[["の","に"],["が"]],pure:!0,fn:function(e,t){return t in e}},"秒待":{type:"func",josi:[[""]],pure:!0,asyncFn:!0,fn:function(e){return new Promise(((t,n)=>{try{setTimeout((()=>{t()}),1e3*parseFloat(e))}catch(e){n(e)}}))},return_none:!0},"秒待機":{type:"func",josi:[[""]],pure:!0,fn:function(e,t){if("非同期モード"!==t.__genMode){if(void 0===t.resolve)throw new Error("『秒待機』命令は『!非同期モード』で使ってください。");t.__exec("秒逐次待機",[e,t])}else{const n=t.setAsync(t);setTimeout((()=>{t.compAsync(t,n)}),1e3*e)}},return_none:!0},"秒逐次待機":{type:"func",josi:[[""]],pure:!0,fn:function(e,t){if(void 0===t.resolve)throw new Error("『秒逐次待機』命令は『逐次実行』構文と一緒に使ってください。");const n=t.resolve;t.resolveCount++;const s=setTimeout((function(){const e=t.__timeout.indexOf(s);e>=0&&t.__timeout.splice(e,1),n()}),1e3*e);t.__timeout.unshift(s)},return_none:!0},"秒後":{type:"func",josi:[["を"],[""]],pure:!1,fn:function(e,t,n){"string"==typeof e&&(e=n.__findFunc(e,"秒後"));const s=setTimeout((()=>{const t=n.__timeout.indexOf(s);t>=0&&n.__timeout.splice(t,1),"非同期モード"===n.__genMode&&(n.newenv=!0);try{e(s,n)}catch(e){let t=e;e instanceof _nako_errors_mjs__WEBPACK_IMPORTED_MODULE_0__.as||(t=new _nako_errors_mjs__WEBPACK_IMPORTED_MODULE_0__.as(e,n.__varslist[0].line)),n.logger.error(t)}}),1e3*parseFloat(t));return n.__timeout.unshift(s),n.__v0["対象"]=s,s}},"秒毎":{type:"func",josi:[["を"],[""]],pure:!1,fn:function(e,t,n){"string"==typeof e&&(e=n.__findFunc(e,"秒毎"));const s=setInterval((()=>{"非同期モード"===n.__genMode&&(n.newenv=!0),e(s,n)}),1e3*parseFloat(t));return n.__interval.unshift(s),n.__v0["対象"]=s,s}},"秒タイマー開始時":{type:"func",josi:[["を"],[""]],pure:!1,fn:function(e,t,n){return n.__exec("秒毎",[e,t,n])}},"タイマー停止":{type:"func",josi:[["の","で"]],pure:!0,fn:function(e,t){const n=t.__interval.indexOf(e);if(n>=0)return t.__interval.splice(n,1),clearInterval(e),!0;const s=t.__timeout.indexOf(e);return s>=0&&(t.__timeout.splice(s,1),clearTimeout(e),!0)},return_none:!1},"全タイマー停止":{type:"func",josi:[],pure:!0,fn:function(e){for(let t=0;t<e.__interval.length;t++){const n=e.__interval[t];clearInterval(n)}e.__interval=[];for(let t=0;t<e.__timeout.length;t++){const n=e.__timeout[t];clearTimeout(n)}e.__timeout=[]},return_none:!0},"元号データ":{type:"const",value:[{"元号":"令和","改元日":"2019/05/01"},{"元号":"平成","改元日":"1989/01/08"},{"元号":"昭和","改元日":"1926/12/25"},{"元号":"大正","改元日":"1912/07/30"},{"元号":"明治","改元日":"1868/10/23"}]},"今":{type:"func",josi:[],pure:!0,fn:function(){const e=e=>(e="00"+e).substring(e.length-2,e.length),t=new Date;return e(t.getHours())+":"+e(t.getMinutes())+":"+e(t.getSeconds())}},"システム時間":{type:"func",josi:[],pure:!0,fn:function(){const e=new Date;return Math.floor(e.getTime()/1e3)}},"システム時間ミリ秒":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getTime()}},"今日":{type:"func",josi:[],pure:!0,fn:function(e){return e.__formatDate(new Date)}},"明日":{type:"func",josi:[],pure:!0,fn:function(e){const t=Date.now()+864e5;return e.__formatDate(new Date(t))}},"昨日":{type:"func",josi:[],pure:!0,fn:function(e){const t=Date.now()-864e5;return e.__formatDate(new Date(t))}},"今年":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getFullYear()}},"来年":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getFullYear()+1}},"去年":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getFullYear()-1}},"今月":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getMonth()+1}},"来月":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getMonth()+2}},"先月":{type:"func",josi:[],pure:!0,fn:function(){return(new Date).getMonth()}},"曜日":{type:"func",josi:[["の"]],pure:!0,fn:function(e,t){const n=t.__str2date(e);return"日月火水木金土".charAt(n.getDay()%7)}},"曜日番号取得":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=e.split("/");return new Date(t[0],t[1]-1,t[2]).getDay()}},"UNIXTIME変換":{type:"func",josi:[["の","を","から"]],pure:!0,fn:function(e,t){return t.__str2date(e).getTime()/1e3}},"UNIX時間変換":{type:"func",josi:[["の","を","から"]],pure:!0,fn:function(e,t){return t.__str2date(e).getTime()/1e3}},"日時変換":{type:"func",josi:[["を","から"]],pure:!0,fn:function(e,t){const n=1e3*e;return t.__formatDateTime(new Date(n),"2022/01/01 00:00:00")}},"日時書式変換":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t,n){const s=n.__str2date(e);return t=t.replace(/(YYYY|ccc|WWW|MMM|YY|MM|DD|HH|mm|ss|[MDHmsW])/g,(e=>{switch(e){case"YYYY":return s.getFullYear();case"YY":return(""+s.getFullYear()).substring(2);case"MM":return n.__zero2(s.getMonth()+1);case"DD":return n.__zero2(s.getDate());case"M":return s.getMonth()+1;case"D":return s.getDate();case"HH":return n.__zero2(s.getHours());case"mm":return n.__zero2(s.getMinutes());case"ss":return n.__zero2(s.getSeconds());case"ccc":return n.__zero(s.getMilliseconds(),3);case"H":return s.getHours();case"m":return s.getMinutes();case"s":return s.getSeconds();case"W":return"日月火水木金土".charAt(s.getDay()%7);case"WWW":return["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][s.getDay()%7];case"MMM":return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][s.getMonth()]}return e}))}},"和暦変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){const n=t.__str2date(e),s=n.getTime();for(const e of t.__v0["元号データ"]){const r=e["元号"],i=t.__str2date(e["改元日"]);if(i.getTime()<=s){let e=n.getFullYear()-i.getFullYear()+1;return 1===e&&(e="元"),r+e+"年"+t.__zero2(n.getMonth()+1)+"月"+t.__zero2(n.getDate())+"日"}}throw new Error("『和暦変換』は明示以前の日付には対応していません。")}},"年数差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=n.__str2date(e);return n.__str2date(t).getFullYear()-s.getFullYear()}},"月数差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=n.__str2date(e),r=n.__str2date(t);return 12*r.getFullYear()+r.getMonth()-(12*s.getFullYear()+s.getMonth())}},"日数差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil((r-s)/86400)}},"時間差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil((r-s)/3600)}},"分差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil((r-s)/60)}},"秒差":{type:"func",josi:[["と","から"],["の","までの"]],pure:!0,fn:function(e,t,n){const s=Math.ceil(n.__str2date(e).getTime()/1e3),r=Math.ceil(n.__str2date(t).getTime()/1e3);return Math.ceil(r-s)}},"日時差":{type:"func",josi:[["と","から"],["の","までの"],["による"]],pure:!0,fn:function(e,t,n,s){switch(n){case"年":return s.__exec("年数差",[e,t,s]);case"月":return s.__exec("月数差",[e,t,s]);case"日":return s.__exec("日数差",[e,t,s]);case"時間":return s.__exec("時間差",[e,t,s]);case"分":return s.__exec("分差",[e,t,s]);case"秒":return s.__exec("秒差",[e,t,s])}throw new Error("『日時差』で不明な単位です。")}},"時間加算":{type:"func",josi:[["に"],["を"]],pure:!0,fn:function(e,t,n){const s=t.charAt(0);"-"!==s&&"+"!==s||(t=t.substring(1));const r=n.__str2date(e),i=(t+":0:0").split(":");let o=60*parseInt(i[0])*60+60*parseInt(i[1])+parseInt(i[2]);"-"===s&&(o*=-1);const u=new Date(r.getTime()+1e3*o);return n.__formatDateTime(u,e)}},"日付加算":{type:"func",josi:[["に"],["を"]],pure:!0,fn:function(e,t,n){let s=1;const r=t.charAt(0);"-"!==r&&"+"!==r||(t=t.substring(1),"-"===r&&(s*=-1));const i=n.__str2date(e),o=(t+"/0/0").split("/"),u=parseInt(o[0])*s,c=parseInt(o[1])*s,a=parseInt(o[2])*s;return i.setFullYear(i.getFullYear()+u),i.setMonth(i.getMonth()+c),i.setDate(i.getDate()+a),n.__formatDateTime(i,e)}},"日時加算":{type:"func",josi:[["に"],["を"]],pure:!0,fn:function(e,t,n){const s=(""+t).match(/([+|-]?)(\d+)(年|ヶ月|日|週間|時間|分|秒)$/);if(!s)throw new Error("『日付加算』は『(+|-)1(年|ヶ月|日|時間|分|秒)』の書式で指定します。");switch(s[3]){case"年":return n.__exec("日付加算",[e,`${s[1]}${s[2]}/0/0`,n]);case"ヶ月":return n.__exec("日付加算",[e,`${s[1]}0/${s[2]}/0`,n]);case"週間":return n.__exec("日付加算",[e,`${s[1]}0/0/${7*parseInt(s[2])}`,n]);case"日":return n.__exec("日付加算",[e,`${s[1]}0/0/${s[2]}`,n]);case"時間":return n.__exec("時間加算",[e,`${s[1]}${s[2]}:0:0`,n]);case"分":return n.__exec("時間加算",[e,`${s[1]}0:${s[2]}:0`,n]);case"秒":return n.__exec("時間加算",[e,`${s[1]}0:0:${s[2]}`,n])}}},"時間ミリ秒取得":{type:"func",josi:[],pure:!0,fn:function(){if(performance&&performance.now)return performance.now();if(Date.now)return Date.now();return(new Date).getTime()}},"エラー発生":{type:"func",josi:[["の","で"]],pure:!0,fn:function(e){throw new Error(e)}},"グローバル関数一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){const t=e.__varslist[1],n=[];for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push(e);return n}},"システム関数一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){const t=e.__varslist[0],n=[];for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&n.push(e);return n}},"システム関数存在":{type:"func",josi:[["が","の"]],pure:!0,fn:function(e,t){return void 0!==t.__v0[e]}},"プラグイン一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){const t=[];for(const n in e.pluginfiles)t.push(n);return t}},"モジュール一覧取得":{type:"func",josi:[],pure:!0,fn:function(e){const t=[];for(const n in e.__module)t.push(n);return t}},"助詞一覧取得":{type:"func",josi:[],pure:!0,asyncFn:!0,fn:function(){return new Promise(((e,t)=>{Promise.resolve().then(__webpack_require__.bind(__webpack_require__,8775)).then((t=>{const n=Object.assign({},t);e(n.josiList)})).catch((e=>{t(e)}))}))}},"予約語一覧取得":{type:"func",josi:[],pure:!0,asyncFn:!0,fn:function(){return new Promise(((e,t)=>{Promise.resolve().then(__webpack_require__.bind(__webpack_require__,515)).then((t=>{const n=Object.assign({},t),s=[];for(const e in n.default)s.push(e);e(s)})).catch((e=>{t(e)}))}))}},"プラグイン名":{type:"const",value:"メイン"},"プラグイン名設定":{type:"func",josi:[["に","へ"]],pure:!0,fn:function(e,t){t.__v0["プラグイン名"]=e},return_none:!0},"URLエンコード":{type:"func",josi:[["を","から"]],pure:!0,fn:function(e){return encodeURIComponent(e)}},"URLデコード":{type:"func",josi:[["を","へ","に"]],pure:!0,fn:function(e){return decodeURIComponent(e)}},"URLパラメータ解析":{type:"func",josi:[["を","の","から"]],pure:!0,fn:function(e,t){const n={};if("string"!=typeof e)return n;const s=e.split("?");if(s.length<=1)return n;const r=s[1].split("&");for(const e of r){const s=(e+"=").split("=");n[t.__exec("URLデコード",[s[0]])]=t.__exec("URLデコード",[s[1]])}return n}},"BASE64エンコード":{type:"func",josi:[["を","から"]],pure:!0,fn:function(e){if("undefined"!=typeof window&&window.btoa){const t=(new TextEncoder).encode(e),n=String.fromCharCode.apply(null,t);return btoa(n)}if("undefined"!=typeof Buffer)return Buffer.from(e).toString("base64");throw new Error("『BASE64エンコード』は利用できません。")}},"BASE64デコード":{type:"func",josi:[["を","へ","に"]],pure:!0,fn:function(e){if("undefined"!=typeof window&&window.atob){const t=atob(e),n=Array.prototype.map.call(t,(e=>e.charCodeAt())),s=new Uint8Array(n);return new TextDecoder("UTF-8").decode(s)}if("undefined"!=typeof Buffer)return Buffer.from(e,"base64").toString();throw new Error("『BASE64デコード』は利用できません。")}}}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.d=function(e,t){for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};!function(){function e(e="?",t={},n=0,s="main.nako3"){return{type:e,value:t,line:n,column:0,file:s,josi:""}}class t{constructor(e={}){this.testOnly=e.testOnly||!1,this.resetEnv=e.resetEnv||!1,this.resetAll=e.resetAll||!1,this.preCode=e.preCode||"",this.nakoGlobal=e.nakoGlobal||null}}var n=__webpack_require__(7206);var s=__webpack_require__(6297),r=__webpack_require__(8294);class i extends class{constructor(e){this.logger=e,this.stackList=[],this.tokens=[],this.stack=[],this.index=0,this.y=[],this.modName="inline",this.modList=[],this.funclist={},this.funcLevel=0,this.usedAsyncFn=!1,this.localvars={"それ":{type:"var",value:""}},this.genMode="sync",this.arrayIndexFrom=0,this.flagReverseArrayIndex=!1,this.flagCheckArrayInit=!1,this.recentlyCalledFunc=[],this.init()}init(){this.funclist={},this.reset()}reset(){this.tokens=[],this.index=0,this.stack=[],this.y=[],this.genMode="sync"}setFuncList(e){this.funclist=e}popStack(e){if(!e){const e=this.stack.pop();return e||null}for(let t=0;t<this.stack.length;t++){const n=this.stack[t];if(0===e.length||e.indexOf(n.josi)>=0)return this.stack.splice(t,1),this.logger.trace("POP :"+JSON.stringify(n)),n}return null}saveStack(){this.stackList.push(this.stack),this.stack=[]}loadStack(){this.stack=this.stackList.pop()}findVar(e){if(this.localvars[e])return{name:e,scope:"local",info:this.localvars[e]};if(e.indexOf("__")>=0)return this.funclist[e]?{name:e,scope:"global",info:this.funclist[e]}:void 0;const t=`${this.modName}__${e}`;if(this.funclist[t])return{name:t,scope:"global",info:this.funclist[t]};for(const t of this.modList){const n=`${t}__${e}`;if(this.funclist[n])return{name:n,scope:"global",info:this.funclist[n]}}return this.funclist[e]?{name:e,scope:"system",info:this.funclist[e]}:void 0}pushStack(e){this.logger.debug("PUSH:"+JSON.stringify(e)),this.stack.push(e)}isEOF(){return this.index>=this.tokens.length}getIndex(){return this.index}check(e){return this.tokens[this.index].type===e}check2(e){for(let t=0;t<e.length;t++){const n=t+this.index;if(this.tokens.length<=n)return!1;if("*"===e[t])continue;const s=this.tokens[n];if(e[t]instanceof Array){if(e[t].indexOf(s.type)<0)return!1}else if(s.type!==e[t])return!1}return!0}checkTypes(e){const t=this.tokens[this.index].type;return e.indexOf(t)>=0}accept(e){const t=[],n=this.index,s=()=>(this.index=n,!1);for(let n=0;n<e.length;n++){if(this.isEOF())return s();const r=e[n];if(null==r)return s();if("string"!=typeof r)if("function"!=typeof r){if(!(r instanceof Array))throw new Error("System Error : accept broken : "+typeof r);if(!this.checkTypes(r))return s();t[n]=this.get()}else{const e=r.bind(this)(t);if(null===e)return s();t[n]=e}else{const e=this.get();if(e&&e.type!==r)return s();t[n]=e}}return this.y=t,!0}get(){return this.isEOF()?null:this.tokens[this.index++]}getCur(){if(this.isEOF())throw new Error("トークンが取得できません。");const e=this.tokens[this.index++];if(!e)throw new Error("トークンが取得できません。");return e}unget(){this.index>0&&this.index--}peek(e=0){return this.isEOF()?null:this.tokens[this.index+e]}peekDef(t=null){return this.isEOF()?(t||(t=e()),t):this.tokens[this.index]}peekSourceMap(){const e=this.peek();return null===e?{startOffset:void 0,endOffset:void 0,file:void 0,line:0,column:0}:{startOffset:e.startOffset,endOffset:e.endOffset,file:e.file,line:e.line,column:e.column}}nodeToStr(e,t,n){const s=t.depth-1,r=e=>void 0!==t.typeName?t.typeName:e,i=n?" debug: "+JSON.stringify(e,null,2):"";if(!e)return"(NULL)";switch(e.type){case"not":if(s>=0){const t=e.value;return`${r("")}『${this.nodeToStr(t,{depth:s},n)}に演算子『not』を適用した式${i}』`}return`${r("演算子")}『not』`;case"op":{const t=e;let o=t.operator||"";const u={eq:"=",not:"!",gt:">",lt:"<",and:"かつ",or:"または"};if(o in u&&(o=u[o]),s>=0){const e=this.nodeToStr(t.left,{depth:s},n),u=this.nodeToStr(t.right,{depth:s},n);return"eq"===t.operator?`${r("")}『${e}と${u}が等しいかどうかの比較${i}』`:`${r("")}『${e}と${u}に演算子『${o}』を適用した式${i}』`}return`${r("演算子")}『${o}${i}』`}case"number":return`${r("数値")}${e.value}`;case"string":return`${r("文字列")}『${e.value}${i}』`;case"word":return`${r("単語")}『${e.value}${i}』`;case"func":return`${r("関数")}『${e.name||e.value}${i}』`;case"eol":return"行の末尾";case"eof":return"ファイルの末尾";default:{let t=e.name;return t&&(t=e.value),"string"!=typeof t&&(t=e.type),`${r("")}『${t}${i}』`}}}}{parse(e,t){return this.reset(),this.tokens=e,this.modName=r.S.filenameToModName(t),this.modList.push(this.modName),this.startParser()}startParser(){const e=this.ySentenceList(),t=this.get();if(t&&"eof"!==t.type)throw this.logger.debug(`構文解析でエラー。${this.nodeToStr(t,{depth:1},!0)}の使い方が間違っています。`,t),s.ih.fromNode(`構文解析でエラー。${this.nodeToStr(t,{depth:1},!1)}の使い方が間違っています。`,t);return e}ySentenceList(){const e=[];let t=-1;const n=this.peekSourceMap();for(;!this.isEOF();){const n=this.ySentence();if(!n)break;e.push(n),t<0&&(t=n.line)}if(0===e.length){const e=this.peek()||this.tokens[0];throw this.logger.debug("構文解析に失敗:"+this.nodeToStr(this.peek(),{depth:1},!0),e),s.ih.fromNode("構文解析に失敗:"+this.nodeToStr(this.peek(),{depth:1},!1),e)}return{type:"block",block:e,...n,end:this.peekSourceMap(),genMode:this.genMode}}yEOL(){const e=this.get();if(!e)return null;if(this.stack.length>0){const t=[];this.stack.forEach((e=>{let n=this.nodeToStr(e,{depth:1},!1);e.josi&&(n+=e.josi),t.push(n)}));const n=t.join(",");let r="";const i="A".charCodeAt(0);for(const e of this.recentlyCalledFunc){r+=" - ";let t=0;const n=e.josi;if(n)for(const e of n){r+=String.fromCharCode(i+t),1===e.length?r+=e[0]:r+=`(${e.join("|")})`,t++}r+=e.name+"\n"}throw s.ih.fromNode(`未解決の単語があります: [${n}]\n次の命令の可能性があります:\n${r}`,e)}return this.recentlyCalledFunc=[],e}ySentence(){const t=this.peekSourceMap();if(this.check("eol"))return this.yEOL();if(this.check("もし"))return this.yIF();if(this.check("後判定"))return this.yAtohantei();if(this.check("エラー監視"))return this.yTryExcept();if(this.check("逐次実行"))return this.yTikuji();if(this.accept(["抜ける"]))return{type:"break",josi:"",...t,end:this.peekSourceMap()};if(this.accept(["続ける"]))return{type:"continue",josi:"",...t,end:this.peekSourceMap()};if(this.accept(["require","string","取込"]))return this.yRequire();if(this.accept(["not","非同期モード"]))return this.yASyncMode();if(this.accept(["not","DNCLモード"]))return this.yDNCLMode();if(this.accept(["not","string","モード設定"]))return this.ySetGenMode(this.y[1].value);if(this.check2(["func","←"]))return this.yCallOp();if(this.check2(["func","eq"])){const n=this.get()||e("?","?",t.line,t.file||"");throw s.ih.fromNode(`関数『${n.value}』に代入できません。『←』を使ってください。`,n)}if(this.accept([this.ySpeedMode]))return this.y[0];if(this.accept([this.yPerformanceMonitor]))return this.y[0];if(this.accept([this.yLet]))return this.y[0];if(this.accept([this.yDefTest]))return this.y[0];if(this.accept([this.yDefFunc]))return this.y[0];if(this.accept([this.yCall])){const e=this.y[0];if("して"===e.josi){const n=this.ySentence();if(null!==n)return{type:"block",block:[e,n],josi:n.josi,...t,end:this.peekSourceMap()}}return e}return null}yASyncMode(){const e=this.peekSourceMap();return this.genMode="非同期モード",{type:"eol",...e,end:this.peekSourceMap()}}yDNCLMode(){const e=this.peekSourceMap();return this.arrayIndexFrom=1,this.flagReverseArrayIndex=!0,this.flagCheckArrayInit=!0,{type:"eol",...e,end:this.peekSourceMap()}}ySetGenMode(e){const t=this.peekSourceMap();return this.genMode=e,{type:"eol",...t,end:this.peekSourceMap()}}yRequire(){const e=this.y[1].value,t=r.S.filenameToModName(e);if(this.modList.indexOf(t)<0){const e=this.modList.shift();e&&(this.modList.unshift(t),this.modList.unshift(e))}return{type:"require",value:e,josi:"",...this.peekSourceMap(),end:this.peekSourceMap()}}yBlock(){const e=this.peekSourceMap(),t=[];for(this.check("ここから")&&this.get();!this.isEOF()&&!this.checkTypes(["違えば","ここまで","エラー"])&&this.accept([this.ySentence]);)t.push(this.y[0]);return{type:"block",block:t,...e,end:this.peekSourceMap()}}yDefFuncReadArgs(){if(!this.check("("))return null;const e=[];for(this.get();!this.isEOF();){if(this.check(")")){this.get();break}const t=this.get();t&&e.push(t),this.check("comma")&&this.get()}return e}yDefTest(){return this.yDef("def_test")}yDefFunc(){return this.yDef("def_func")}yDef(e){if(!this.check(e))return null;const t=this.peekSourceMap(),n=this.get();if(!n)return null;let r=[];this.check("(")&&(r=this.yDefFuncReadArgs()||[]);const i=this.get();if(!i||"func"!==i.type)throw this.logger.debug(this.nodeToStr(i,{depth:0,typeName:"関数"},!0)+"の宣言でエラー。",i),s.ih.fromNode(this.nodeToStr(i,{depth:0,typeName:"関数"},!1)+"の宣言でエラー。",n);if(this.check("(")){if(r.length>0)throw this.logger.debug(this.nodeToStr(i,{depth:0,typeName:"関数"},!0)+"の宣言で、引数定義は名前の前か後に一度だけ可能です。",i),s.ih.fromNode(this.nodeToStr(i,{depth:0,typeName:"関数"},!1)+"の宣言で、引数定義は名前の前か後に一度だけ可能です。",i);r=this.yDefFuncReadArgs()||[]}this.check("とは")&&this.get();let o=null,u=!1,c=!1;this.check("ここから")&&(u=!0),this.check("eol")&&(u=!0);try{this.funcLevel++,this.usedAsyncFn=!1;const e=this.localvars;if(this.localvars={"それ":{type:"var",value:""}},u){this.saveStack();for(const e of r){const t=e.value?e.value+"":"";this.localvars[t]={type:"var",value:""}}if(o=this.yBlock(),!this.check("ここまで"))throw s.ih.fromNode("『ここまで』がありません。関数定義の末尾に必要です。",n);this.get(),this.loadStack()}else this.saveStack(),o=this.ySentence(),this.loadStack();this.funcLevel--,c=this.usedAsyncFn,this.localvars=e}catch(e){throw this.logger.debug(this.nodeToStr(i,{depth:0,typeName:"関数"},!0)+"の定義で以下のエラーがありました。\n"+e.message,n),s.ih.fromNode(this.nodeToStr(i,{depth:0,typeName:"関数"},!1)+"の定義で以下のエラーがありました。\n"+e.message,n)}return{type:e,name:i,args:r,block:o||[],asyncFn:c,josi:"",...t,end:this.peekSourceMap()}}yIFCond(){const e=this.peekSourceMap();let t=this.yGetArg();if(!t)return null;if("が"===t.josi){const n=this.index,s=this.yGetArg(),r=this.get();if(s&&"func"!==s.type&&r&&"ならば"===r.type)return{type:"op",operator:"でなければ"===r.value?"noteq":"eq",left:t,right:s,josi:"",...e,end:this.peekSourceMap()};this.index=n}if(""!==t.josi&&(this.stack.push(t),t=this.yCall()),!this.check("ならば")){const n=t||{type:"?",...e};throw this.logger.debug("もし文で『ならば』がないか、条件が複雑過ぎます。"+this.nodeToStr(this.peek(),{depth:1},!1)+"の直前に『ならば』を書いてください。",n),s.ih.fromNode("もし文で『ならば』がないか、条件が複雑過ぎます。"+this.nodeToStr(this.peek(),{depth:1},!1)+"の直前に『ならば』を書いてください。",n)}const n=this.get();return n&&"でなければ"===n.value&&(t={type:"not",value:t,josi:"",...e,end:this.peekSourceMap()}),t}yIF(){const e=this.peekSourceMap();if(!this.check("もし"))return null;const t=this.get();if(null==t)return null;for(;this.check("comma");)this.get();let n=null;try{n=this.yIFCond()}catch(e){throw s.ih.fromNode("『もし』文の条件で次のエラーがあります。\n"+e.message,t)}if(null===n)throw s.ih.fromNode("『もし』文で条件の指定が空です。",t);let r=null,i=null,o=!1;for(this.check("eol")?r=this.yBlock():(r=this.ySentence(),o=!0);this.check("eol");)this.get();if(this.check("違えば")){for(this.get();this.check("comma");)this.get();this.check("eol")?i=this.yBlock():(i=this.ySentence(),o=!0)}if(!1===o){if(!this.check("ここまで"))throw s.ih.fromNode("『もし』文で『ここまで』がありません。",t);this.get()}return{type:"if",expr:n||[],block:r||[],false_block:i||[],josi:"",...e,end:this.peekSourceMap()}}ySpeedMode(){const e=this.peekSourceMap();if(!this.check2(["string","実行速度優先"]))return null;const t=this.get();this.get();let n="";if(!t||!t.value)return null;n=t.value;const s={"行番号無し":!1,"暗黙の型変換無し":!1,"強制ピュア":!1,"それ無効":!1};for(const e of n.split("/")){if("全て"===e){for(const e of Object.keys(s))s[e]=!0;break}Object.keys(s).includes(e)?s[e]=!0:this.logger.warn(`実行速度優先文のオプション『${e}』は存在しません。`,t)}let r=!1;this.check("ここから")?(this.get(),r=!0):this.check("eol")&&(r=!0);let i=null;return r?(i=this.yBlock(),this.check("ここまで")&&this.get()):i=this.ySentence(),{type:"speed_mode",options:s,block:i||[],josi:"",...e}}yPerformanceMonitor(){const e=this.peekSourceMap();if(!this.check2(["string","パフォーマンスモニタ適用"]))return null;const t=this.get();if(!t)return null;this.get();const n={"ユーザ関数":!1,"システム関数本体":!1,"システム関数":!1};for(const e of t.value.split("/")){if("全て"===e){for(const e of Object.keys(n))n[e]=!0;break}Object.keys(n).includes(e)?n[e]=!0:this.logger.warn(`パフォーマンスモニタ適用文のオプション『${e}』は存在しません。`,t)}let s=!1;this.check("ここから")?(this.get(),s=!0):this.check("eol")&&(s=!0);let r=null;return s?(r=this.yBlock(),this.check("ここまで")&&this.get()):r=this.ySentence(),{type:"performance_monitor",options:n,block:r||[],josi:"",...e}}yTikuji(){const e=this.peekSourceMap();if(!this.check("逐次実行"))return null;const t=this.getCur();this.logger.warn("『逐次実行』構文の使用は非推奨になりました(https://nadesi.com/v3/doc/go.php?944)。",t);const n=[];let r=null;if(!t||!this.check("eol"))throw s.ih.fromNode("『逐次実行』の直後は改行が必要です。",t);for(;!this.check("ここまで");){if(this.check("eol")){this.get();continue}if(this.check2(["エラー","ならば"])){this.get(),this.get(),r=this.yBlock();break}let t=null;if(this.check("先に")||this.check("次に")){const n=this.get();if(this.check("comma")&&this.get(),this.check("eol")){if(t=this.yBlock(),!this.check("ここまで")){let t="次に";throw null!=n&&(t=n.type),s.ih.fromNode(`『${t}』...『ここまで』を対応させてください。`,e)}this.get()}else t=this.ySentence()}else t=this.ySentence();null!=t&&n.push(t)}if(!this.check("ここまで"))throw console.log(n,this.peek()),s.ih.fromNode("『逐次実行』...『ここまで』を対応させてください。",t);return this.get(),{type:"tikuji",blocks:n||[],errorBlock:r||[],josi:"",...e,end:this.peekSourceMap()}}yGetArgOperator(e){const t=[e];for(;!this.isEOF();){let r=this.peek();if(!r||!n.bW[r.type])break;{r=this.getCur(),t.push(r);const n=this.yValue();if(null===n)throw s.ih.fromNode(`計算式で演算子『${r.value}』後に値がありません`,e);t.push(n)}}return 0===t.length?null:1===t.length?t[0]:this.infixToAST(t)}yGetArg(){const e=this.yValue();return null===e?null:this.yGetArgOperator(e)}infixToPolish(e){const t=e=>n.bW[e.type]?n.bW[e.type]:10,s=[],r=[];for(;e.length>0;){const n=e.shift();if(!n)break;for(;s.length>0;){const e=s[s.length-1];if(t(n)>t(e))break;const i=s.pop();if(!i){this.logger.error("計算式に間違いがあります。",n);break}r.push(i)}s.push(n)}for(;s.length>0;){const e=s.pop();e&&r.push(e)}return r}infixToAST(e){if(0===e.length)return null;const t=e[e.length-1].josi,r=e[e.length-1],i=this.infixToPolish(e),o=[];for(const e of i){if(!n.bW[e.type]){o.push(e);continue}const u=o.pop(),c=o.pop();if(void 0===c||void 0===u)throw this.logger.debug("--- 計算式(逆ポーランド) ---\n"+JSON.stringify(i)),s.ih.fromNode("計算式でエラー",r);const a={type:"op",operator:e.type,left:c,right:u,josi:t,startOffset:c.startOffset,endOffset:c.endOffset,line:c.line,column:c.column,file:c.file};o.push(a)}const u=o.pop();return u||null}yGetArgParen(e){let t=!1;const n=this.stack.length;for(;!this.isEOF();){if(this.check(")")){t=!0;break}const e=this.yGetArg();if(!e)break;this.pushStack(e),this.check("comma")&&this.get()}if(!t)throw s.ih.fromNode(`C風関数『${e[0].value}』でカッコが閉じていません`,e[0]);const r=[];for(;n<this.stack.length;){const e=this.popStack();e&&r.unshift(e)}return r}yRepeatTime(){const e=this.peekSourceMap();if(!this.check("回"))return null;this.get(),this.check("comma")&&this.get(),this.check("繰返")&&this.get();let t=this.popStack([]),n=!1,r=null;if(null===t&&(t={type:"word",value:"それ",josi:"",...e,end:this.peekSourceMap()}),this.check("comma")&&this.get(),this.check("ここから")?(this.get(),n=!0):this.check("eol")&&(n=!0),n){if(r=this.yBlock(),!this.check("ここまで"))throw s.ih.fromNode("『ここまで』がありません。『回』...『ここまで』を対応させてください。",e);this.get()}else r=this.ySentence();return{type:"repeat_times",value:t,block:r||[],josi:"",...e,end:this.peekSourceMap()}}yWhile(){const e=this.peekSourceMap();if(!this.check("間"))return null;for(this.get();this.check("comma");)this.get();this.check("繰返")&&this.get();const t=this.popStack();if(null===t)throw s.ih.fromNode("『間』で条件がありません。",e);if(this.check("comma")&&this.get(),!this.checkTypes(["ここから","eol"]))throw s.ih.fromNode("『間』の直後は改行が必要です",e);const n=this.yBlock();return this.check("ここまで")&&this.get(),{type:"while",cond:t,block:n,josi:"",...e,end:this.peekSourceMap()}}yAtohantei(){const e=this.peekSourceMap();this.check("後判定")&&this.get(),this.check("繰返")&&this.get(),this.check("ここから")&&this.get();const t=this.yBlock();this.check("ここまで")&&this.get(),this.check("comma")&&this.get();let n=this.yGetArg(),s=!1;const r=this.peek();return!r||"なる"!==r.value||"まで"!==r.josi&&"までの"!==r.josi||(this.get(),s=!0),this.check("間")&&this.get(),s&&(n={type:"not",value:n,josi:"",...e,end:this.peekSourceMap()}),{type:"atohantei",cond:n||[],block:t,josi:"",...e,end:this.peekSourceMap()}}yFor(){const e=this.peekSourceMap();if(!(this.check("繰返")||this.check("増繰返")||this.check("減繰返")))return null;const t=this.getCur(),n=this.stack.pop();n&&("word"!==n.type||"増"!==n.value&&"減"!==n.value?this.stack.push(n):t.type=n.value+t.type);let r=null;"増繰返"!==t.type&&"減繰返"!==t.type||(r=this.popStack(["ずつ"]));const i=this.popStack(["まで"]),o=this.popStack(["から"]),u=this.popStack(["を","で"]);if(null===o||null===i)throw s.ih.fromNode("『繰り返す』文でAからBまでの指定がありません。",t);this.check("comma")&&this.get();let c=!1;(this.check("ここから")||this.check("eol"))&&(c=!0,this.get());let a=null;if(c){if(a=this.yBlock(),!this.check("ここまで"))throw s.ih.fromNode("『ここまで』がありません。『繰り返す』...『ここまで』を対応させてください。",e);this.get()}else a=this.ySentence();return{type:"for",from:o,to:i,inc:r,word:u,block:a||[],josi:"",...e,end:this.peekSourceMap()}}yReturn(){const e=this.peekSourceMap();if(!this.check("戻る"))return null;this.get();const t=this.popStack(["で","を"]);if(this.stack.length>0)throw s.ih.fromNode("『戻』文の直前に未解決の引数があります。『(式)を戻す』のように式をカッコで括ってください。",e);return{type:"return",value:t,josi:"",...e,end:this.peekSourceMap()}}yForEach(){const e=this.peekSourceMap();if(!this.check("反復"))return null;for(this.get();this.check("comma");)this.get();const t=this.popStack(["を"]),n=this.popStack(["で"]);let s=null,r=!1;return this.check("ここから")?(r=!0,this.get()):this.check("eol")&&(r=!0),r?(s=this.yBlock(),this.check("ここまで")&&this.get()):s=this.ySentence(),{type:"foreach",name:n,target:t,block:s||[],josi:"",...e,end:this.peekSourceMap()}}ySwitch(){const e=this.peekSourceMap();if(!this.check("条件分岐"))return null;const t=this.get();if(!t)return null;const n=this.get();if(!n)return null;const r=this.popStack(["で"]);if(!r)throw s.ih.fromNode("『(値)で条件分岐』のように記述してください。",t);if("eol"!==n.type)throw s.ih.fromNode("『条件分岐』の直後は改行してください。",t);let i=!1,o=!1;const u=[];for(;!this.isEOF();){if(this.check("ここまで")){if(o)throw s.ih.fromNode("『条件分岐』は『(条件)ならば〜ここまで』と記述してください。",t);this.get();break}if(this.check("eol")){this.get();continue}if(i)throw s.ih.fromNode("『条件分岐』で『違えば〜ここまで』の後に処理を続けることは出来ません。",t);let e=null;const n=this.peek();if(n&&"違えば"===n.type)o=!1,i=!0,e=this.get(),this.check("comma")&&this.get();else{if(o)throw s.ih.fromNode("『条件分岐』は『(条件)ならば〜ここまで』と記述してください。",t);if(e=this.yValue(),!e)throw s.ih.fromNode("『条件分岐』は『(条件)ならば〜ここまで』と記述してください。",t);const n=this.get();if(!n||"ならば"!==n.type)throw s.ih.fromNode("『条件分岐』で条件は**ならばと記述してください。",t);this.check("comma")&&this.get()}const r=this.yBlock(),c=this.peek();if(c&&"ここまで"===c.type)this.get();else{if(i)throw s.ih.fromNode("『条件分岐』は『違えば〜ここまで』と記述してください。",t);o=!0}u.push([e,r])}return{type:"switch",value:r,cases:u||[],josi:"",...e,end:this.peekSourceMap()}}yMumeiFunc(){const e=this.peekSourceMap();if(!this.check("def_func"))return null;const t=this.get();if(!t)return null;let n=[];this.check("comma")&&this.get(),this.check("(")&&(n=this.yDefFuncReadArgs()||[]),this.check("comma")&&this.get(),this.funcLevel++,this.saveStack();const r=this.yBlock();if(!this.check("ここまで"))throw s.ih.fromNode("『ここまで』がありません。『には』構文か無名関数の末尾に『ここまで』が必要です。",e);return this.get(),this.loadStack(),this.funcLevel--,{type:"func_obj",args:n,block:r,meta:t.meta,josi:"",...e,end:this.peekSourceMap()}}yDainyu(){const e=this.peekSourceMap(),t=this.get();if(null===t)return null;const n=this.popStack(["を"]),r=this.popStack(["へ","に"]);if(!r||"word"!==r.type&&"func"!==r.type&&"配列参照"!==r.type)throw s.ih.fromNode("代入文で代入先の変数が見当たりません。『(変数名)に(値)を代入』のように使います。",t);if("配列参照"===r.type)return{type:"let_array",name:r.name,index:r.index,value:n,josi:"",checkInit:this.flagCheckArrayInit,...e,end:this.peekSourceMap()};return{type:"let",name:this.getVarName(r),value:n,josi:"",...e,end:this.peekSourceMap()}}ySadameru(){const e=this.peekSourceMap(),t=this.get();if(null===t)return null;const n=this.popStack(["を"]),r=this.popStack(["へ","に"]);if(!n||"word"!==n.type&&"func"!==n.type&&"配列参照"!==n.type)throw s.ih.fromNode("『定める』文で定数が見当たりません。『(定数名)を(値)に定める』のように使います。",t);return{type:"def_local_var",name:this.getVarName(n),vartype:"定数",value:r,josi:"",...e,end:this.peekSourceMap()}}yIncDec(){const e=this.peekSourceMap(),t=this.get();if(null===t)return null;if(this.check("繰返"))return this.pushStack({type:"word",value:t.value,josi:t.josi,...e,end:this.peekSourceMap()}),this.yFor();let n=this.popStack(["だけ",""]);n||(n={type:"number",value:1,josi:"だけ",...e,end:this.peekSourceMap()});const r=this.popStack(["を"]);if(!r||"word"!==r.type&&"配列参照"!==r.type)throw s.ih.fromNode(`『${t.type}』文で定数が見当たりません。『(変数名)を(値)だけ${t.type}』のように使います。`,t);return"減"===t.value&&(n={type:"op",operator:"*",left:n,right:{type:"number",value:-1,line:t.line},josi:"",...e}),{type:"inc",name:r,value:n,josi:t.josi,...e,end:this.peekSourceMap()}}yCall(){if(this.isEOF())return null;for(;!this.isEOF();){if(this.check("ここから")&&this.get(),this.check("代入"))return this.yDainyu();if(this.check("定める"))return this.ySadameru();if(this.check("回"))return this.yRepeatTime();if(this.check("間"))return this.yWhile();if(this.check("繰返")||this.check("増繰返")||this.check("減繰返"))return this.yFor();if(this.check("反復"))return this.yForEach();if(this.check("条件分岐"))return this.ySwitch();if(this.check("戻る"))return this.yReturn();if(this.check("増")||this.check("減"))return this.yIncDec();if(this.check2([["func","word"],"("])){const e=this.peek();if(e&&""===e.josi){const e=this.yValue();if(e){const t=e.josi||"";if("func"===e.type&&(""===e.josi||n.QQ.indexOf(t)>=0))return e.josi="",e;this.pushStack(e)}this.check("comma")&&this.get();continue}}if(this.check("func")){const e=this.yCallFunc();if(null===e)continue;if(this.check("間")){this.pushStack(e);continue}if(!this.checkTypes(n.Ij))return e;this.pushStack(this.yGetArgOperator(e));continue}const e=this.yGetArg();if(!e)break;this.pushStack(e)}if(this.stack.length>0){this.logger.debug("--- stack dump ---\n"+JSON.stringify(this.stack,null,2)+"\npeek: "+JSON.stringify(this.peek(),null,2));let e=`不完全な文です。${this.stack.map((e=>this.nodeToStr(e,{depth:0},!0))).join("、")}が解決していません。`,t=`不完全な文です。${this.stack.map((e=>this.nodeToStr(e,{depth:0},!1))).join("、")}が解決していません。`;for(const n of this.stack){const s=this.nodeToStr(n,{depth:0},!1),r=this.nodeToStr(n,{depth:1},!1);s!==r&&(e+=`${this.nodeToStr(n,{depth:0},!0)}は${this.nodeToStr(n,{depth:1},!0)}として使われています。`,t+=`${s}は${r}として使われています。`)}const n=this.stack[0],r=this.stack[this.stack.length-1];throw this.logger.debug(e,n),s.ih.fromNode(t,n,r)}return this.popStack([])}yCallFunc(){const e=this.peekSourceMap(),t=this.get();if(!t)return null;const i=t.meta,o=t.value;let u=null;if("には"===t.josi){try{u=this.yMumeiFunc()}catch(e){throw s.ih.fromNode(`『${t.value}には...』で無名関数の定義で以下の間違いがあります。\n${e.message}`,t)}if(null===u)throw s.ih.fromNode("『Fには』構文がありましたが、関数定義が見当たりません。",t)}if(!i||void 0===i.josi)throw s.ih.fromNode("関数の定義でエラー。",t);this.recentlyCalledFunc.push({name:o,...i}),i&&i.asyncFn&&(this.usedAsyncFn=!0);const c=[];let a=0,f=0;for(let e=0;e<i.josi.length;e++)for(;;){let n=this.popStack(i.josi[e]);if(null!==n)f++;else{if(!(e<i.josi.length-1)&&i.isVariableJosi)break;a++,n=u}if(null!==n&&void 0!==i.funcPointers&&null!==i.funcPointers[e]){if("func"!==n.type){const n=i.varnames?i.varnames[e]:`${e+1}番目の引数`;throw s.ih.fromNode(`関数『${t.value}』の引数『${n}』には関数オブジェクトが必要です。`,t)}n.type="func_pointer"}if(c.push(n),e<i.josi.length-1||!i.isVariableJosi)break}if(a>=2&&(f>0||""===t.josi||n.QQ.indexOf(t.josi)>=0))throw s.ih.fromNode(`関数『${t.value}』の引数が不足しています。`,t);const l={type:"func",name:t.value,args:c,josi:t.josi,...e,end:this.peekSourceMap()};if("プラグイン名設定"===l.name&&c.length>0&&c[0]){let e=""+c[0].value;"メイン"===e&&(e=""+c[0].file),this.modName=r.S.filenameToModName(e)}return""===t.josi?l:n.QQ.indexOf(t.josi)>=0?(l.josi="して",l):(l.meta=i,this.pushStack(l),null)}yCallOp(){if(!this.check2(["func","←"]))return null;const e=this.peekSourceMap(),t=this.get();if(null==t)throw new Error("関数が取得できません。");try{if(null==this.get())throw new Error("関数呼び出し演算子が取得できません。");const n=t.value;if(!t.meta)throw new Error("関数本体を取得できません。");if(!t.meta.josi)throw new Error("関数の引数情報を取得できません。");const r=t.meta.josi.length;if(0===r)throw s.ih.fromNode(`引数がない関数『${n}』を関数呼び出し演算子で呼び出すことはできません。`,t);const i=this.stack.length;for(;!this.isEOF();){const e=this.yGetArg();if(!e)break;if(this.pushStack(e),this.stack.length-i===r)break}const o=this.stack.length-i;if(o!==r)throw s.ih.fromNode(`関数『${n}』呼び出しで引数の数(${o})が定義(${r})と違います。`,t);const u=this.stack.splice(i,r);let c=u;if(r>=2){c=[];t.meta.josi.forEach(((e,t)=>{for(let n=0;n<u.length;n++){const s=u[n];if(e.indexOf(s.josi)>=0)return void(c[t]=s)}const n=e.join(",");throw new Error(`助詞『${n}』が見当たりません。`)}))}return{type:"func",name:n,args:c,setter:!0,josi:"",...e,end:this.peekSourceMap()}}catch(e){throw this.logger.debug(`${this.nodeToStr(t,{depth:0},!0)}の関数呼び出しで引数(『←』以降)が読み取れません。`,t),s.ih.fromNode(`${this.nodeToStr(t,{depth:0},!1)}の関数呼び出しでエラーがあります。\n${e.message}`,t)}}yLet(){const e=this.peekSourceMap();if(this.check2(["word","eq"])){const t=this.peek();let n=!1;try{if(this.accept(["word","eq",this.yCalc])||this.accept(["word","eq",this.ySentence])){if("eol"===this.y[2].type)throw new Error("値が空です。");this.check("comma")&&this.get();const t=this.getVarName(this.y[0]);return{type:"let",name:t,value:this.y[2],...e,end:this.peekSourceMap()}}throw n=!0,this.logger.debug(`${this.nodeToStr(t,{depth:1},!0)}への代入文で計算式に書き間違いがあります。`,t),s.ih.fromNode(`${this.nodeToStr(t,{depth:1},!1)}への代入文で計算式に書き間違いがあります。`,e)}catch(r){if(n)throw r;throw this.logger.debug(`${this.nodeToStr(t,{depth:1},!0)}への代入文で計算式に以下の書き間違いがあります。\n${r.message}`,t),s.ih.fromNode(`${this.nodeToStr(t,{depth:1},!1)}への代入文で計算式に以下の書き間違いがあります。\n${r.message}`,e)}}if(this.check2(["word","@"])){const t=this.yLetArrayAt(e);if(this.check("comma")&&this.get(),t)return t.checkInit=this.flagCheckArrayInit,t}if(this.check2(["word","["])){const t=this.yLetArrayBracket(e);if(this.check("comma")&&this.get(),t)return t.checkInit=this.flagCheckArrayInit,t}if(this.accept(["word","とは"])){const t=this.getVarName(this.y[0]);if(!this.checkTypes(["変数","定数"]))throw s.ih.fromNode("ローカル変数『"+t.value+"』の定義エラー",t);const n=this.getCur();let r=null;return this.check("eq")&&(this.get(),r=this.yCalc()),this.check("comma")&&this.get(),{type:"def_local_var",name:t,vartype:n.type,value:r,...e,end:this.peekSourceMap()}}if(this.accept(["変数","word","eq",this.yCalc])){return{type:"def_local_var",name:this.getVarName(this.y[1]),vartype:"変数",value:this.y[3],...e,end:this.peekSourceMap()}}if(this.accept(["定数","word","eq",this.yCalc])){return{type:"def_local_var",name:this.getVarName(this.y[1]),vartype:"定数",value:this.y[3],...e,end:this.peekSourceMap()}}if(this.accept(["定数",this.yJSONArray,"eq",this.yCalc])){const t=this.y[1];if(!(t&&t.value instanceof Array))throw s.ih.fromNode("複数定数の代入文でエラー。『定数[A,B,C]=[1,2,3]』の書式で記述してください。",this.y[0]);for(const e in t.value)if("word"!==t.value[e].type)throw s.ih.fromNode(`複数定数の代入文${e+1}番目でエラー。『定数[A,B,C]=[1,2,3]』の書式で記述してください。`,this.y[0]);return t.value=this.getVarNameList(t.value),{type:"def_local_varlist",names:t.value,vartype:"定数",value:this.y[3],...e,end:this.peekSourceMap()}}if(this.accept(["変数",this.yJSONArray,"eq",this.yCalc])){const t=this.y[1];if(!(t&&t.value instanceof Array))throw s.ih.fromNode("複数変数の代入文でエラー。『変数[A,B,C]=[1,2,3]』の書式で記述してください。",this.y[0]);for(const e in t.value)if("word"!==t.value[e].type)throw s.ih.fromNode(`複数変数の代入文${e+1}番目でエラー。『変数[A,B,C]=[1,2,3]』の書式で記述してください。`,this.y[0]);return t.value=this.getVarNameList(t.value),{type:"def_local_varlist",names:t.value,vartype:"変数",value:this.y[3],...e,end:this.peekSourceMap()}}if(this.check2(["word","comma","word"])){if(this.accept(["word","comma","word","eq",this.yCalc])){let t=[this.y[0],this.y[2]];return t=this.getVarNameList(t),{type:"def_local_varlist",names:t,vartype:"変数",value:this.y[4],...e,end:this.peekSourceMap()}}if(this.accept(["word","comma","word","comma","word","eq",this.yCalc])){let t=[this.y[0],this.y[2],this.y[4]];return t=this.getVarNameList(t),{type:"def_local_varlist",names:t,vartype:"変数",value:this.y[6],...e,end:this.peekSourceMap()}}if(this.accept(["word","comma","word","comma","word","comma","word","eq",this.yCalc])){let t=[this.y[0],this.y[2],this.y[4],this.y[6]];return t=this.getVarNameList(t),{type:"def_local_varlist",names:t,vartype:"変数",value:this.y[8],...e,end:this.peekSourceMap()}}if(this.accept(["word","comma","word","comma","word","comma","word","comma","word","eq",this.yCalc])){let t=[this.y[0],this.y[2],this.y[4],this.y[6],this.y[8]];return t=this.getVarNameList(t),{type:"def_local_varlist",names:t,vartype:"変数",value:this.y[10],...e,end:this.peekSourceMap()}}}return null}checkArrayIndex(e){return 0===this.arrayIndexFrom?e:{...e,type:"op",operator:"-",left:e,right:{...e,type:"number",value:this.arrayIndexFrom}}}checkArrayReverse(e){return e?this.flagReverseArrayIndex?e.length<=1?e:e.reverse():e:[]}yLetArrayAt(e){return this.accept(["word","@",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:[this.checkArrayIndex(this.y[2])],value:this.y[4],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"@",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]),value:this.y[6],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"@",this.yValue,"@",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]),value:this.y[8],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"comma",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]),value:this.y[6],...e,end:this.peekSourceMap()}:this.accept(["word","@",this.yValue,"comma",this.yValue,"comma",this.yValue,"eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]),value:this.y[8],...e,end:this.peekSourceMap()}:null}yLetArrayBracket(e){return this.accept(["word","[",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:[this.checkArrayIndex(this.y[2])],value:this.y[5],...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"]","[",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[5])]),value:this.y[8],tag:"2",...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"comma",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4])]),value:this.y[7],tag:"2",...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"]","[",this.yCalc,"]","[",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[5]),this.checkArrayIndex(this.y[8])]),value:this.y[11],...e,end:this.peekSourceMap()}:this.accept(["word","[",this.yCalc,"comma",this.yCalc,"comma",this.yCalc,"]","eq",this.yCalc])?{type:"let_array",name:this.getVarName(this.y[0]),index:this.checkArrayReverse([this.checkArrayIndex(this.y[2]),this.checkArrayIndex(this.y[4]),this.checkArrayIndex(this.y[6])]),value:this.y[9],...e,end:this.peekSourceMap()}:null}yCalc(){const e=this.peekSourceMap();if(this.check("eol"))return null;const t=this.yGetArg();if(!t)return null;if(""===t.josi)return t;this.pushStack(t);const n=this.yCall();if(!n)return this.popStack();if("して"!==n.josi)return n;const s=this.yCalc();return s?{type:"renbun",left:n,right:s,josi:s.josi,...e,end:this.peekSourceMap()}:n}yValueKakko(){if(!this.check("("))return null;const e=this.get();if(!e)throw new Error("[System Error] check したのに get できない");this.saveStack();const t=this.yCalc()||this.ySentence();if(null===t){const t=this.get();throw this.logger.debug("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!0)+"の近く",e),s.ih.fromNode("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!1)+"の近く",e)}if(!this.check(")"))throw this.logger.debug("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!0)+"の近く",e),s.ih.fromNode("(...)の解析エラー。"+this.nodeToStr(t,{depth:1},!1)+"の近く",e);const n=this.get();return this.loadStack(),n&&(t.josi=n.josi),t}yValue(){const t=this.peekSourceMap();if(this.check("comma")&&this.get(),this.checkTypes(["number","string"]))return this.getCur();if(this.check("("))return this.yValueKakko();if(this.check2(["-","number"])||this.check2(["-","word"])||this.check2(["-","func"])){const e=this.get(),n=this.yValue(),s=n&&n.josi?n.josi:"";return{type:"op",operator:"*",left:{type:"number",value:-1,line:e&&e.line?e.line:0},right:n||[],josi:s,...t,end:this.peekSourceMap()}}if(this.check("not")){this.get();const e=this.yValue();return{type:"not",value:e,josi:e&&e.josi?e.josi:"",...t,end:this.peekSourceMap()}}const r=this.yJSONArray();if(r)return r;const i=this.yJSONObject();if(i)return i;const o=n.Ij.concat(["eol",")","]","ならば","回","間","反復","条件分岐"]);if(this.check2(["func",o])){const e=this.get();if(!e)throw new Error("[System Error] 正しく値が取れませんでした。");const n=this.getVarNameRef(e);return{type:"func",name:n.value,args:[],josi:n.josi,...t,end:this.peekSourceMap()}}if(this.check2([["func","word"],"("])&&""===this.peekDef().josi){const n=this.peek();if(this.accept([["func","word"],"(",this.yGetArgParen,")"]))return{type:"func",name:this.getVarNameRef(this.y[0]).value,args:this.y[2],josi:this.y[3].josi,...t,end:this.peekSourceMap()};throw s.ih.fromNode("C風関数呼び出しのエラー",n||e())}if(this.check2(["func","←"]))return this.yCallOp();if(this.check("def_func"))return this.yMumeiFunc();const u=this.yValueWord();return u||null}yValueWordGetIndex(e){if(e.index||(e.index=[]),this.check("@")){if(this.accept(["@",this.yValue,"comma",this.yValue,"comma",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.index.push(this.checkArrayIndex(this.y[3])),e.index.push(this.checkArrayIndex(this.y[5])),e.index=this.checkArrayReverse(e.index),e.josi=this.y[5].josi,!0;if(this.accept(["@",this.yValue,"comma",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.index.push(this.checkArrayIndex(this.y[3])),e.index=this.checkArrayReverse(e.index),e.josi=this.y[3].josi,!0;if(this.accept(["@",this.yValue]))return e.index.push(this.checkArrayIndex(this.y[1])),e.josi=this.y[1].josi,!0;throw s.ih.fromNode("変数の後ろの『@要素』の指定が不正です。",e)}if(this.check("[")&&this.accept(["[",this.yCalc,"]"]))return e.index.push(this.checkArrayIndex(this.y[1])),e.josi=this.y[2].josi,!0;if(this.check("[")&&this.accept(["[",this.yCalc,"comma",this.yCalc,"]"])){const t=[this.checkArrayIndex(this.y[1]),this.checkArrayIndex(this.y[3])];return e.index=this.checkArrayReverse(t),e.josi=this.y[4].josi,!0}if(this.check("[")&&this.accept(["[",this.yCalc,"comma",this.yCalc,"comma",this.yCalc,"]"])){const t=[this.checkArrayIndex(this.y[1]),this.checkArrayIndex(this.y[3]),this.checkArrayIndex(this.y[5])];return e.index=this.checkArrayReverse(t),e.josi=this.y[6].josi,!0}return!1}yValueWord(){const e=this.peekSourceMap();if(this.check("word")){const t=this.getCur(),n=this.getVarNameRef(t);if(""===n.josi&&this.checkTypes(["[","@"])){const t={type:"配列参照",name:n,index:[],josi:"",...e,end:this.peekSourceMap()};for(;!this.isEOF()&&this.yValueWordGetIndex(t););if(t.index&&0===t.index.length)throw s.ih.fromNode(`配列『${n.value}』アクセスで指定ミス`,n);return t}return n}return null}getVarName(e){const t=this.findVar(e.value);if(t)t&&"global"===t.scope&&(e.value=t.name);else if(0===this.funcLevel){let t=e.value;t.indexOf("__")<0&&(t=this.modName+"__"+e.value),this.funclist[t]={type:"var",value:""},e.value=t}else this.localvars[e.value]={type:"var",value:""};return e}getVarNameRef(e){const t=this.findVar(e.value);return t?t&&"global"===t.scope&&(e.value=t.name):0===this.funcLevel&&e.value.indexOf("__")<0&&(e.value=this.modName+"__"+e.value),e}getVarNameList(e){for(let t=0;t<e.length;t++)e[t]=this.getVarName(e[t]);return e}yJSONObjectValue(){const e=[],t=this.peek();if(!t)return null;for(;!this.isEOF();){for(;this.check("eol");)this.get();if(this.check("}"))break;if(this.accept(["word",":",this.yCalc]))this.y[0].type="string",e.push({key:this.y[0],value:this.y[2]});else if(this.accept(["string",":",this.yCalc]))e.push({key:this.y[0],value:this.y[2]});else if(this.check("word")){const t=this.getCur();t.type="string",e.push({key:t,value:t})}else{if(!this.checkTypes(["string","number"]))throw s.ih.fromNode("辞書オブジェクトの宣言で末尾の『}』がありません。",t);{const t=this.getCur();e.push({key:t,value:t})}}this.check("comma")&&this.get()}return e}yJSONObject(){const e=this.peekSourceMap();if(this.accept(["{","}"]))return{type:"json_obj",value:[],josi:this.y[1].josi,...e,end:this.peekSourceMap()};if(this.accept(["{",this.yJSONObjectValue,"}"]))return{type:"json_obj",value:this.y[1],josi:this.y[2].josi,...e,end:this.peekSourceMap()};if(this.accept(["{",this.yJSONObjectValue]))throw s.ih.fromNode("辞書型変数の初期化が『}』で閉じられていません。",this.y[1]);return null}yJSONArrayValue(){this.check("eol")&&this.get();const e=this.yCalc();if(null===e)return null;this.check("comma")&&this.get();const t=[e];for(;!this.isEOF()&&(this.check("eol")&&this.get(),!this.check("]"));){const e=this.yCalc();if(null===e)break;this.check("comma")&&this.get(),t.push(e)}return t}yJSONArray(){const e=this.peekSourceMap();if(this.accept(["[","]"]))return{type:"json_array",value:[],josi:this.y[1].josi,...e,end:this.peekSourceMap()};if(this.accept(["[",this.yJSONArrayValue,"]"]))return{type:"json_array",value:this.y[1],josi:this.y[2].josi,...e,end:this.peekSourceMap()};if(this.accept(["[",this.yJSONArrayValue]))throw s.ih.fromNode("配列変数の初期化が『]』で閉じられていません。",this.y[1]);return null}yTryExcept(){const e=this.peekSourceMap();if(!this.check("エラー監視"))return null;const t=this.getCur(),n=this.yBlock();if(!this.check2(["エラー","ならば"]))throw s.ih.fromNode("エラー構文で『エラーならば』がありません。『エラー監視..エラーならば..ここまで』を対で記述します。",t);this.get(),this.get();const r=this.yBlock();if(!this.check("ここまで"))throw s.ih.fromNode("『ここまで』がありません。『エラー監視』...『エラーならば』...『ここまで』を対応させてください。",e);return this.get(),{type:"try_except",block:n,errBlock:r||[],josi:"",...e,end:this.peekSourceMap()}}}class o{constructor(e,t,n){this.from=e,this.to=t,this.index=n}}class u{constructor(e,t){this.text=e,this.sourcePosition=t}}class c{constructor(e){this.history=[],this.code=e}getText(){return this.code}replaceAll(e,t){for(;;){const n=this.getText().indexOf(e);if(-1===n)break;e.length!==t.length&&this.history.unshift(new o(e.length,t.length,n)),this.code=this.code.replace(e,t)}}getSourcePosition(e){for(const t of this.history)e>=t.index+t.to?e+=t.from-t.to:t.index<=e&&e<t.index+t.to&&(e=t.to>=2&&e===t.index+t.to-1?t.index+t.from-1:t.index);return e}}class a{constructor(){this.convertTable=new Map([[8208,"-"],[8209,"-"],[8211,"-"],[8212,"-"],[8213,"-"],[8722,"-"],[732,"~"],[759,"~"],[8275,"~"],[8764,"~"],[12316,"~"],[65374,"~"],[8192," "],[8194," "],[8195," "],[8196," "],[8197," "],[8198," "],[8199," "],[8201," "],[8202," "],[8203," "],[8239," "],[8287," "],[12288," "],[12644," "],[9," "],[8251,"#"],[12290,";"],[12304,"["],[12305,"]"],[12289,","],[65292,","],[10006,"*"],[10133,"+"],[10134,"-"],[10135,"÷"]])}static getInstance(){return a._instance||(a._instance=new a),a._instance}convert1ch(e){if(!e)return"";const t=e.codePointAt(0)||0,n=this.convertTable.get(t)||"";if(n)return n;if(t<127)return e;if(t>=65281&&t<=65374){const e=t-65248;return String.fromCodePoint(e)}return e}convert(e){if(!e)return[];const t=new c(e);t.replaceAll("\r\n","\n"),t.replaceAll("\r","\n");let n=!1,s=!1,r="";const i=[];let o=0,a="",f=0;for(;f<t.getText().length;){const e=t.getText().charAt(f),c=t.getText().substr(f,2);if(n){if(e===r){n=!1,i.push(new u(a+r,t.getSourcePosition(o))),f++,o=f;continue}a+=e,f++;continue}if(s){if(c===r){s=!1,i.push(new u(a+r,t.getSourcePosition(o))),f+=2,o=f;continue}a+=e,f++;continue}if("「"===e){i.push(new u(e,t.getSourcePosition(o))),f++,o=f,n=!0,r="」",a="";continue}if("『"===e){i.push(new u(e,t.getSourcePosition(o))),f++,o=f,n=!0,r="』",a="";continue}if("“"===e){i.push(new u(e,t.getSourcePosition(o))),f++,o=f,n=!0,r="”",a="";continue}if("🌴"===c||"🌿"===c){i.push(new u(c,t.getSourcePosition(o))),f+=2,o=f,s=!0,r=c,a="";continue}const l=this.convert1ch(e);'"'!==l&&"'"!==l?"#"!==l?"//"!==c&&"//"!==c?"/*"!==c?(i.push(new u(l,t.getSourcePosition(o))),f++,o=f):(i.push(new u(c,t.getSourcePosition(o))),f+=2,o=f,s=!0,r="*/",a=""):(i.push(new u("//",t.getSourcePosition(o))),f+=2,o=f,n=!0,r="\n",a=""):(i.push(new u(l,t.getSourcePosition(o))),f++,o=f,n=!0,r="\n",a=""):(i.push(new u(l,t.getSourcePosition(o))),f++,o=f,n=!0,r=e,a="")}return(n||s)&&i.push(new u(a+r,t.getSourcePosition(o))),i}}function f(e,t){const n=(e=(e=(e=e.substring(0,256)).replace(/(!|💡)/,"!")).replace(/\/\*.*?\*\//g,"")).split(/[;。\n]/,30);for(let e of n)if(e=e.replace(/^\s+/,"").replace(/\s+$/,""),t.indexOf(e)>=0)return!0;return!1}var l=__webpack_require__(9485),h=__webpack_require__(8801);const p=["!インデント構文","!ここまでだるい"];const d="🌟🌟改行🌟🌟s4j#WjcSb😀/FcX3🌟🌟";function _(e){const t=a.getInstance(),n=e.length;let s="",r="",i=0,o=!1;for(;i<n;){const n=e.charAt(i),u=e.substring(i,2),c=t.convert1ch(n),a=u.split("").map((e=>t.convert1ch(e))).join("");if(""===r){switch(c){case'"':case"'":r=n,s+=n,i++;continue;case"「":r="」",s+=n,i++;continue;case"『":r="』",s+=n,i++;continue;case"“":r="”",s+=n,i++;continue;case"{":r="}",s+=n,i++;continue;case"[":r="]",s+=n,i++;continue}switch(u){case"🌴":r="🌴",s+=u,i+=2;continue;case"🌿":r="🌿",s+=u,i+=2;continue}"#"!==c?"//"!==a?"/*"!==a?(s+=n,i++):(r="*/",o=!0,i+=2):(r="\n",o=!0,i+=2):(r="\n",o=!0,i++)}else r===(1===r.length?c:a)?(o||(s+=e.substr(i,r.length)),i+=r.length,o=!1,r=""):(o||(s+=n),i++)}return s}function y(e){let t="";for(let n=0;n<e;n++)t+=" ";return t}function m(e){const t=/^([ ・\t]*)/.exec(_(e));return t?t[1]:""}function g(e){let t=0;for(let n=0;n<e.length;n++){const s=e.charAt(n);if(" "!==s)if(" "!==s)if("・"!==s){if("\t"!==s)break;t+=4}else t+=2;else t+=2;else t++}return t}function v(e){const t=a.getInstance(),n=e.length;let s="",r="",i=0;for(;i<n;){const n=e.charAt(i),o=e.substr(i,2),u=t.convert1ch(n),c=o.split("").map((e=>t.convert1ch(e))).join("");if(""===r){switch(u){case'"':case"'":r=n,s+=n,i++;continue;case"「":r="」",s+=n,i++;continue;case"『":r="』",s+=n,i++;continue;case"“":r="”",s+=n,i++;continue;case"{":r="}",s+=n,i++;continue;case"[":r="]",s+=n,i++;continue}switch(o){case"🌴":r="🌴",s+=o,i+=2;continue;case"🌿":r="🌿",s+=o,i+=2;continue}"#"!==u?"//"!==c?"/*"!==c?(s+=n,i++):(r="*/",s+=o,i+=2):(r="\n",s+=o,i+=2):(r="\n",s+=n,i++)}else r===(1===r.length?u:c)?(s+=e.substr(i,r.length),i+=r.length,r=""):(s+="\n"===n?d:n,i++)}return s}var b={convert:function(e,t="main.nako3"){return f(e,p)?function(e,t){const n=[],r=[],i="ここまで‰",o=v(e).split("\n"),u=[],c=[];let a=0,f=-1;o.forEach((e=>{if(f+=e.split(d).length,/^[ ・\t]*$/.test(e))return void r.push({lineNumber:u.length,len:e.length});const o=_(e).replace(/^[ ・\t]+/,"").replace(/\s+$/,"");if(""===o)return void u.push(e);if("ここまで"===o)throw new s.t5("インデント構文が有効化されているときに『ここまで』を使うことはできません。",f,t);const l=g(e);if(a!==l){if(a<l)return c.push(a),a=l,void u.push(e);if(a>l)for(a=l;c.length>0;){const t=c.pop()||0;if(t===l)return"違えば"!==o.substring(0,3)&&(n.push(u.length),u.push(y(t)+i)),void u.push(e);l<t&&(n.push(u.length),u.push(y(t)+i))}}else u.push(e)}));for(;c.length>0;){const e=c.pop()||0;n.push(u.length),u.push(y(e)+i)}const l=[];for(let e=0;e<u.length;e++)if(u[e].includes(d)){const t=u[e].split(d);for(let e=0;e<n.length;e++)l.length<n[e]&&(n[e]+=t.length-1);for(let e=0;e<r.length;e++)l.length<r[e].lineNumber&&(r[e].lineNumber+=t.length-1);l.push(...t)}else l.push(u[e]);return{code:l.join("\n"),insertedLines:n,deletedLines:r}}(e,t):{code:e,insertedLines:[],deletedLines:[]}},getBlockStructure:function(e){const t={lines:[],pairs:[],parents:[],spaces:[]},n=v(e).split("\n"),s=[];let r=0,i=g(n[0]);for(const e of n){const n=e.split(d).length,o=_(e),u=""===o.replace(/^[ ・\t]+/,"")?i:g(o);if(t.lines.push(...Array(n).fill(u)),t.spaces.push(...Array(n).fill(m(o))),i<u)s.push(r-1);else if(i>u){const e=s.pop();void 0!==e&&t.pairs.push([e,r])}const c=void 0!==s[s.length-1]?s[s.length-1]:null;t.parents.push(...Array(n).fill(c)),i=u,r+=n}for(const e of s)t.pairs.push([e,r]);return t},getIndent:m,countIndent:g,isIndentSyntaxEnabled:function(e){return f(e,p)}};const k=["!DNCLモード"];function S(e,t){if(!f(e=e.replace(/(\r\n|\r)/g,"\n"),k))return e;return j(e,t)}function w(e){let t="";for(let n=0;n<e;n++)t+=" ";return t}function j(e,t){e=function(e){const t=a.getInstance();let n="",s=!1,r="";for(let i=0;i<e.length;i++){const o=e.charAt(i);let u=t.convert1ch(o);if(s){if(u===r){s=!1,r="",n+=u;continue}n+=o}else"「"!==u?'"'!==u?("{"===u&&(u="["),"}"===u&&(u="]"),"←"===u&&(u="="),"÷"===u&&(u="÷÷"),n+=u):(s=!0,r='"',n+=u):(s=!0,r="」",n+=u)}return n}(e);const n=e.split("\n");for(let e=0;e<n.length;e++){let s=n[e];n[e]=s.replace(/^(\s*[|\s]+)(.*$)/,((e,t,n)=>w(t.length)+n)),s=n[e];const r=s.replace(/^\s+/,"").replace(/\s+$/,"");"繰り返し,"!==r&&"繰り返し"!==r||(n[e]="後判定で繰り返し");const i=s.match(/^\s*を,?(.+)になるまで(繰り返す|実行する)/);if(i){n[e]=`ここまで、(${i[1]})になるまでの間`;continue}const o=s.match(/^もし(.+)を実行する(。|.)*/);if(o){const s=j(o[1],t);n[e]=`もし、${s};`;continue}const u=s.match(/^(.+?)のすべての(要素|値)(を|に)(.+?)(にする|を代入)/);if(u){const t=u[1],s=u[4];n[e]=`${t} = [${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s},${s}]`}else;}e=n.join("\n");const s={"を実行する":"ここまで","を実行し,そうでなくもし":"違えば、もし","を実行し,そうでなくもし":"違えば、もし","を実行し、そうでなくもし":"違えば、もし","を実行し,そうでなければ":"違えば","を実行し,そうでなければ":"違えば","を実行し、そうでなければ":"違えば","を繰り返す":"ここまで","改行なしで表示":"連続無改行表示","ずつ増やしながら":"ずつ増やし繰り返す","ずつ減らしながら":"ずつ減らし繰り返す","二進で表示":"二進表示","でないならば":"でなければ"},r=()=>{const t=e.charAt(0);return e=e.substring(1),t};let i=!1,o="",u="",c="";for(;""!==e;){const t=e.charAt(0);if(i){if(t===u){c+=o+u,o="",i=!1,r();continue}o+=r();continue}if('"'===t){i=!0,u='"',o=r();continue}if("「"===t){i=!0,u="」",o=r();continue}if("『"===t){i=!0,u="』",o=r();continue}if(" "===t||" "===t||"\t"===t){c+=r();continue}const n=e.substring(0,3);if("を表示"===n){c+="を連続表示",e=e.substring(3);continue}if("を 表示"===e.substring(0,4)){c+="を連続表示",e=e.substring(4);continue}if("乱数"===e.substring(0,2)&&"乱数範囲"!==e.substring(0,4)){c+="乱数範囲",e=e.substring(2);continue}"増やす"!==n&&"減らす"!==n||("だけ"!==c.substring(c.length-2)&&(c+="だけ"),c+=n,e=e.substring(3));let a=!1;for(const t in s){if(e.substring(0,t.length)===t){c+=s[t],e=e.substring(t.length),a=!0;break}}a||(c+=r())}return c}class ${constructor(e,t){this.sourceCodeLength=e,this.preprocessed=t;let n=0;this.cumulativeSum=[];for(const e of t)this.cumulativeSum.push(n),n+=e.text.length;this.lastIndex=0,this.lastPreprocessedCodePosition=0}map(e){const t=this.findIndex(e);return Math.min(this.preprocessed[t].sourcePosition+(e-this.cumulativeSum[t]),t===this.preprocessed.length-1?this.sourceCodeLength:this.preprocessed[t+1].sourcePosition-1)}findIndex(e){e<this.lastPreprocessedCodePosition&&(this.lastIndex=0),this.lastPreprocessedCodePosition=e;for(let t=this.lastIndex;t<this.preprocessed.length-1;t++)if(e<this.cumulativeSum[t+1])return this.lastIndex=t,t;return this.lastIndex=this.preprocessed.length-1,this.preprocessed.length-1}}class x{constructor(e,t,n){this.lines=[],this.linesInsertedByIndentationSyntax=t,this.linesDeletedByIndentationSyntax=n;let s=0;for(const t of e.split("\n"))this.lines.push({offset:s,len:t.length}),s+=t.length+1;this.lastLineNumber=0,this.lastOffset=0}map(e,t){if(null===e)return{startOffset:e,endOffset:t};const n=this.getLineNumber(e);for(const s of this.linesInsertedByIndentationSyntax){if(n===s){e=null,t=null;break}n>s&&(e-=this.lines[s].len+1,null!==t&&(t-=this.lines[s].len+1))}for(const s of this.linesDeletedByIndentationSyntax)n>=s.lineNumber&&(null!==e&&(e+=s.len+1),null!==t&&(t+=s.len+1));return{startOffset:e,endOffset:t}}getLineNumber(e){e<this.lastOffset&&(this.lastLineNumber=0),this.lastOffset=e;for(let t=this.lastLineNumber;t<this.lines.length-1;t++)if(e<this.lines[t+1].offset)return this.lastLineNumber=t,t;return this.lastLineNumber=this.lines.length-1,this.lines.length-1}}class O{constructor(e){this.lineOffsets=[];let t=0;for(const n of e.split("\n"))this.lineOffsets.push(t),t+=n.length+1;this.lastLineNumber=0,this.lastOffset=0}map(e,t){e<this.lastOffset&&(this.lastLineNumber=0),this.lastOffset=e;for(let n=this.lastLineNumber;n<this.lineOffsets.length-1;n++)if(e<this.lineOffsets[n+1])return this.lastLineNumber=n,{line:n+(t?1:0),column:e-this.lineOffsets[n]};return this.lastLineNumber=this.lineOffsets.length-1,{line:this.lineOffsets.length-1+(t?1:0),column:e-this.lineOffsets[this.lineOffsets.length-1]}}}function A(e,t){if("number"==typeof e.startOffset&&(e.startOffset-=t.length),"number"==typeof e.endOffset&&(e.endOffset-=t.length),""!==t){const n=t.split("\n");"number"==typeof e.line&&(e.line-=n.length-1),0===e.line&&"number"==typeof e.column&&(e.column-=n[n.length-1].length)}return e}const C=["black","red","green","yellow","blue","magenta","cyan","white"],F=e=>{const t=e.replace(/\x1b\[\d+m/g,""),n=[];let s="inherit",r="inherit";const i=e===t?t:e.replace(/\x1b\[(\d+)m/g,((e,t)=>{const i=+t;return 0===i&&(s="inherit",r="inherit"),1===i&&(r="bold"),i>=30&&i<=37&&(s=C[i-30]),n.push(`color: ${s}; font-weight: ${r};`),"%c"}));let o="inherit",u="inherit";var c;return{noColor:t,nodeConsole:e===t?t:e+"[0m",html:e===t?t:"<span>"+(c=e,c.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")).replace(/\x1b\[(\d+)m/g,((e,t)=>{const n=+t;return 0===n&&(o="inherit",u="inherit"),1===n&&(u="bold"),n>=30&&n<=37&&(o=C[n-30]),`</span><span style="color: ${o}; font-weight: ${u};">`}))+"</span>",browserConsole:[i,...n]}},N={reset:"[0m",bold:"[1m",black:"[30m",red:"[31m",green:"[32m",yellow:"[33m",blue:"[34m",magenta:"[35m",cyan:"[36m",white:"[37m"};class M{static fromS(e){let t=M.trace;switch(e){case"all":t=M.all;break;case"trace":t=M.trace;break;case"debug":t=M.debug;break;case"info":t=M.info;break;case"warn":t=M.warn;break;case"error":t=M.error;break;case"stdout":t=M.stdout;break;default:throw new Error("[NakoLogger] unknown logger level:"+e)}return t}static toString(e){return["all","trace","debug","info","warn","error","stdout"][e]}}function L(e){return e?`${e.file||""}${void 0===e.line?"":`(${e.line+1}行目): `}`:""}M.all=0,M.trace=1,M.debug=2,M.info=3,M.warn=4,M.error=5,M.stdout=6;class E{constructor(){this.listeners=[],this.logs="",this.position=""}getErrorLogs(){return[this.logs.replace(/\s+$/,""),this.position]}clear(){this.logs="",this.position=""}addListener(e,t){const n=M.fromS(e);this.listeners.push({level:n,callback:t})}removeListener(e){this.listeners=this.listeners.filter((t=>t.callback!==e))}trace(e,t=null){this.sendI(M.trace,`${N.bold}[デバッグ情報(詳細)]${N.reset}${L(t)}${e}`,t)}debug(e,t=null){this.sendI(M.debug,`${N.bold}[デバッグ情報]${N.reset}${L(t)}${e}`,t)}info(e,t=null){this.sendI(M.info,`${N.bold}${N.blue}[情報]${N.reset}${L(t)}${e}`,t)}warn(e,t=null){this.sendI(M.warn,`${N.bold}${N.green}[警告]${N.reset}${L(t)}${e}`,t)}error(e,t=null){if(e instanceof Error&&"string"==typeof e.type){switch(e.type){case"NakoRuntimeError":case"NakoError":if(e instanceof s.k){const n=e;let s=t;return null==s&&(s={file:n.file,line:n.line||0,startOffset:0,endOffset:0}),void this.sendI(M.error,n.message,s)}}}e instanceof Error&&(e=e.message),this.sendI(M.error,`${N.bold}${N.red}[エラー]${N.reset}${L(t)}${e}`,t)}stdout(e,t=null){this.sendI(M.stdout,`${e}`,t)}send(e,t,n,s=null,r=null){const i=M.fromS(e);this.sendI(i,t,n,s,r)}sendI(e,t,n,s=null,r=null){const i=()=>{const i=F(t);let o="";t.includes("\n")&&(o+="border-top: 1px solid #8080806b; border-bottom: 1px solid #8080806b;");return{noColor:i.noColor,nodeConsole:i.nodeConsole,browserConsole:r||i.browserConsole,html:`<div style="${o}">`+(s||i.html)+"</div>",level:M.toString(e),position:n}};if(e===M.error){const e=i();this.logs+=e.noColor+"\n",n&&null!==this.position&&(this.position=`l${n.line}:${n.file}`)}for(const t of this.listeners)if(t.level<=e){const e=i();t.callback(e)}}}class T{constructor(e,t){this.__locals={},this.__varslist=[{...e.__varslist[0]},{...e.__varslist[1]},{...e.__varslist[2]}],this.numFailures=0,this.index=0,this.nextIndex=-1,this.__code=[],this.__callstack=[],this.__stack=[],this.__labels=[],this.__genMode=t.genMode,this.version=e.version,this.coreVersion=e.coreVersion,this.__module={...e.__module},this.pluginfiles={...e.getPluginfiles()},this.gen=t,this.logger=e.getLogger(),this.compiler=e}clearLog(){this.__varslist[0]["表示ログ"]=""}get log(){let e=this.__varslist[0]["表示ログ"];return e=e.replace(/\s+$/,""),e}runEx(e,t,n,s=""){return n.preCode=s,this.compiler.runSync(e,t,n)}_runTests(e){let t=`${N.bold}テストの実行結果${N.reset}\n`,n=0,s=0;for(const r of e)try{r.f(),t+=`${N.green}✔${N.reset} ${r.name}\n`,n++}catch(e){t+=`${N.red}☓${N.reset} ${r.name}: ${e.message}\n`,s++}t+=s>0?`${N.green}成功 ${n}件 ${N.red}失敗 ${s}件`:`${N.green}成功 ${n}件`,this.numFailures=s,this.logger.stdout(t)}clearPlugins(){for(const e in this.pluginfiles){const t=this.__module[e];t["!クリア"]&&t["!クリア"].fn&&t["!クリア"].fn(this)}}reset(){this.clearPlugins()}destroy(){this.reset()}}var I=__webpack_require__(4228),P=__webpack_require__(6758),J={"初期化":{type:"func",josi:[],pure:!0,fn:function(){}},SIN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.sin(e)}},COS:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.cos(e)}},TAN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.tan(e)}},ARCSIN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.asin(e)}},ARCCOS:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.acos(e)}},ARCTAN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.atan(e)}},ATAN2:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return Math.atan2(e,t)}},"座標角度計算":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return 180*Math.atan2(e[1],e[0])/Math.PI}},RAD2DEG:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/Math.PI*180}},DEG2RAD:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/180*Math.PI}},"度変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/Math.PI*180}},"ラジアン変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return e/180*Math.PI}},SIGN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return 0===parseFloat(e)?0:e>0?1:-1}},"符号":{type:"func",josi:[["の"]],pure:!1,fn:function(e,t){return t.__exec("SIGN",[e])}},ABS:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.abs(e)}},"絶対値":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.abs(e)}},EXP:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.exp(e)}},HYPOT:{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return Math.hypot(e,t)}},"斜辺":{type:"func",josi:[["と"],["の"]],pure:!0,fn:function(e,t){return Math.hypot(e,t)}},LN:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.log(e)}},LOG:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.log(e)}},LOGN:{type:"func",josi:[["で"],["の"]],pure:!0,fn:function(e,t){return 2===e?Math.LOG2E*Math.log(t):10===e?Math.LOG10E*Math.log(t):Math.log(t)/Math.log(e)}},FRAC:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e%1}},"小数部分":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return e%1}},"整数部分":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.trunc(e)}},"乱数":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.floor(Math.random()*e)}},"乱数範囲":{type:"func",josi:[["から"],["までの","の"]],pure:!0,fn:function(e,t){return Math.floor(Math.random()*(t-e+1))+e}},SQRT:{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.sqrt(e)}},"平方根":{type:"func",josi:[["の"]],pure:!0,fn:function(e){return Math.sqrt(e)}},ROUND:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.round(e)}},"四捨五入":{type:"func",josi:[["を","の"]],pure:!0,fn:function(e){return Math.round(e)}},"小数点切上":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=Math.pow(10,t);return Math.ceil(e*n)/n}},"小数点切下":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=Math.pow(10,t);return Math.floor(e*n)/n}},"小数点四捨五入":{type:"func",josi:[["を"],["で"]],pure:!0,fn:function(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}},CEIL:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.ceil(e)}},"切上":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.ceil(e)}},FLOOR:{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.floor(e)}},"切捨":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return Math.floor(e)}}};const G={delimiter:",",eol:"\r\n"};function R(e,t){void 0===t&&(t=G.delimiter),e=(e=(e+="\n").replace(/(\r\n|\r)/g,"\n")).replace(/\s+$/,"")+"\n";const n=new RegExp("^(.*?)([\\"+t+"\\n])"),s=function(e){return"string"==typeof e&&e.search(/^[0-9.]+$/)>=0&&(e=parseFloat(e)),e},r=[];let i=[],o="";for(;""!==e;){if(o=e.charAt(0),o===t){e=e.substring(1),i.push("");continue}if("\n"===o){i.push(""),r.push(i),i=[],e=e.substring(1);continue}if(o=(e=e.replace(/^\s+/,"")).charAt(0),o===t){console.log("delimiter"),i.push(""),e=e.substring(t.length);continue}if("="===o&&'"'===e.charAt(1)){e=e.substring(1);continue}if('"'!==o){const o=n.exec(e);if(!o){i.push(s(e)),r.push(i),i=[];break}"\n"===o[2]?(i.push(s(o[1])),r.push(i),i=[]):o[2]===t&&i.push(s(o[1])),e=e.substring(o[0].length);continue}if('""'===e.substring(0,2)){i.push(""),e=e.substring(2);continue}let u=1,c="";for(;u<e.length;){const n=e.charAt(u),o=e.charAt(u+1);if('"'!==n||'"'!==o)if('"'!==n)c+=n,u++;else{if(u++,o===t){u++,i.push(s(c)),c="";break}if("\n"===o){u++,i.push(s(c)),r.push(i),i=[];break}u++}else u+=2,c+='"'}e=e.substr(u)}return i.length>0&&r.push(i),r}function D(e,t,n){void 0===t&&(t=G.delimiter),void 0===n&&(n=G.eol);const s=function(e){return function(t){let n=!1;return((t=""+t).indexOf("\n")>=0||t.indexOf("\r")>=0)&&(n=!0),t.indexOf(e)>=0&&(n=!0),t.indexOf('"')>=0&&(n=!0,t=t.replace(/"/g,'""')),n&&(t='"'+t+'"'),t}}(t);if(void 0===e)return"";let r="";for(let i=0;i<e.length;i++){const o=e[i];if(void 0!==o){for(let e=0;e<o.length;e++)o[e]=s(o[e]);r+=o.join(t)+n}else r+=n}return r=r.replace(/(\r\n|\r|\n)/g,n),r}var V={"初期化":{type:"func",josi:[],pure:!0,fn:function(){}},"CSV取得":{type:"func",josi:[["を","の","で"]],pure:!0,fn:function(e){return G.delimiter=",",R(e)}},"TSV取得":{type:"func",josi:[["を","の","で"]],pure:!0,fn:function(e){return G.delimiter="\t",R(e)}},"表CSV変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return G.delimiter=",",D(e)}},"表TSV変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return G.delimiter="\t",D(e)}}},q={"初期化":{type:"func",josi:[],pure:!0,fn:function(e){null==e.__promise&&(e.__promise={setLastPromise:function(t){return e.__v0["そ"]=t,t}})}},"そ":{type:"const",value:""},"動時":{type:"func",josi:[["を","で"]],pure:!0,fn:function(e,t){return t.__promise.setLastPromise(new Promise(((t,n)=>e(t,n))))},return_none:!1},"成功時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.then((t=>(n.__v0["対象"]=t,e(t)))))},return_none:!1},"処理時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.then((t=>(n.__v0["対象"]=t,e(!0,t,n))),(t=>(n.__v0["対象"]=t,e(!1,t,n)))))},return_none:!1},"失敗時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.catch((t=>(n.__v0["対象"]=t,e(t)))))},return_none:!1},"終了時":{type:"func",josi:[["を"],["の","が","に"]],pure:!0,fn:function(e,t,n){return n.__promise.setLastPromise(t.finally((()=>e())))},return_none:!1},"束":{type:"func",josi:[["と","を"]],pure:!0,fn:function(...e){return e.pop().__promise.setLastPromise(Promise.all(e))},return_none:!1}},B={"ASSERT等":{type:"func",josi:[["と"],["が"]],pure:!0,fn:function(e,t){if(e!==t)throw new Error(`不一致 [実際]${e} [期待]${t}`);return!0}},"テスト実行":{type:"func",josi:[["と"],["で"]],pure:!1,fn:function(e,t,n){n.__exec("ASSERT等",[e,t,n])}},"テスト等":{type:"func",josi:[["と"],["が"]],pure:!1,fn:function(e,t,n){n.__exec("ASSERT等",[e,t,n])}}};const W=e=>JSON.parse(JSON.stringify(e));class U{constructor(e){void 0===e&&(e={useBasicPlugin:!0}),this.__varslist=[{},{},{}],this.__locals={},this.__self=this,this.__vars=this.__varslist[2],this.__v0=this.__varslist[0],this.__v1=this.__varslist[1],this.version=I.Z.version,this.coreVersion=I.Z.version,this.__globals=[],this.__module={},this.pluginFunclist={},this.funclist={},this.pluginfiles={},this.commandlist=new Set,this.nakoFuncList={},this.eventList=[],this.logger=new E,this.prepare=a.getInstance(),this.parser=new i(this.logger),this.lexer=new r.S(this.logger),this.dependencies={},this.usedFuncs=new Set,this.numFailures=0,e.useBasicPlugin&&this.addBasicPlugins()}getLogger(){return this.logger}getNakoFuncList(){return this.nakoFuncList}getNakoFunc(e){return this.nakoFuncList[e]}getPluginfiles(){return this.pluginfiles}addBasicPlugins(){this.addPluginObject("PluginSystem",P.Z),this.addPluginObject("PluginMath",J),this.addPluginObject("PluginPromise",q),this.addPluginObject("PluginAssert",B),this.addPluginObject("PluginCSV",V)}replaceLogger(){return this.lexer.logger=this.parser.logger=this.logger=new E}static listRequireStatements(e){const t=[];for(let n=0;n+2<e.length;n++)"not"!==e[n].type||"string"!==e[n+1].type&&"string_ex"!==e[n+1].type||"取込"!==e[n+2].value||(t.push({...e[n],start:n,end:n+3,value:e[n+1].value+"",firstToken:e[n],lastToken:e[n+2]}),n+=2);return t}_loadDependencies(e,t,n,i){const o={},u=new U({useBasicPlugin:!0}),c=(e,t)=>{const n=i.readJs(e.filePath,e.firstToken);t.push(n.task.then((t=>{const n=t();this.addPluginFile(e.value,e.filePath,n,!1),o[e.filePath].funclist=n,o[e.filePath].addPluginFile=()=>{this.addPluginFile(e.value,e.filePath,n,!1)}})))},a=(e,t)=>{const n=i.readNako3(e.filePath,e.firstToken),s=t=>{t=`『${r.S.filenameToModName(e.filePath)}』にプラグイン名設定;`+t+";『メイン』にプラグイン名設定;";const n=this.rawtokenize(t,0,e.filePath);o[e.filePath].tokens=n;const s={};return r.S.preDefineFunc(W(n),this.logger,s),o[e.filePath].funclist=s,f(t,e.filePath,"")};t.push(n.task.then((e=>s(e))))},f=(e,t,n)=>{const r=[],f=U.listRequireStatements(u.rawtokenize(e,0,t,n)).map((e=>({...e,...i.resolvePath(e.value,e.firstToken,t)})));for(const e of f)if(o.hasOwnProperty(e.filePath))o[e.filePath].alias.add(e.value);else if(o[e.filePath]={tokens:[],alias:new Set([e.value]),addPluginFile:()=>{},funclist:{}},"js"===e.type||"mjs"===e.type)c(e,r);else{if("nako3"!==e.type)throw new s.l0(`ファイル『${e.value}』を読み込めません。ファイルが存在しないか未対応の拡張子です。`,e.firstToken.file,e.firstToken.line);a(e,r)}if(r.length>0)return Promise.all(r)};try{const s=f(e,t,n);return void 0!==s&&s.catch((e=>{this.logger.warn(e.msg)})),this.dependencies=o,s}catch(e){throw this.logger.warn(""+e),e}}rawtokenize(e,t,n,r=""){if(!e.startsWith(r))throw new Error("codeの先頭にはpreCodeを含める必要があります。");const{code:i,insertedLines:o,deletedLines:u}=b.convert(e,n),c=S(i,n),a=this.prepare.convert(c),f=new $(i.length,a),l=new x(i,o,u),h=new O(e);let p;try{p=this.lexer.tokenize(a.map((e=>e.text)).join(""),t,n)}catch(e){if(!(e instanceof s.cg))throw e;const t=l.map(f.map(e.preprocessedCodeStartOffset),f.map(e.preprocessedCodeEndOffset)),i=null===t.startOffset?e.line:h.map(t.startOffset,!1).line,o=A({...t,line:i},r);throw new s.tO(e.msg,o.startOffset,o.endOffset,o.line,n)}return p.map((e=>{const t=l.map(f.map(e.preprocessedCodeOffset||0),f.map((e.preprocessedCodeOffset||0)+(e.preprocessedCodeLength||0)));let n=e.line,s=0;if("eol"===e.type&&null!==t.endOffset){const e=h.map(t.endOffset,!1);n=e.line,s=e.column}else if(null!==t.startOffset){const e=h.map(t.startOffset,!1);n=e.line,s=e.column}return{...e,...A({line:n,column:s,startOffset:t.startOffset,endOffset:t.endOffset},r),rawJosi:e.josi}}))}converttoken(e,t,n){return this.lexer.replaceTokens(e,t,n)}reset(){this.__varslist=[this.__varslist[0],{},{}],this.__v0=this.__varslist[0],this.__v1=this.__varslist[1],this.__vars=this.__varslist[2],this.__locals={},this.funclist={};for(const e of Object.keys(this.__v0)){const t=this.pluginFunclist[e];t&&(this.funclist[e]=JSON.parse(JSON.stringify(t)))}this.lexer.setFuncList(this.funclist),this.clearPlugins(),this.logger.clear()}lexCodeToken(e,t,n,s){let r=this.rawtokenize(e,t,n,"");if(null===s)for(const e of r)e.startOffset=void 0,e.endOffset=void 0;else for(const e of r)void 0!==e.startOffset&&(e.startOffset+=s),void 0!==e.endOffset&&(e.endOffset+=s);const i=r.filter((e=>"line_comment"===e.type||"range_comment"===e.type)).map((e=>({...e})));return r=this.converttoken(r,!1,n),{tokens:r,commentTokens:i}}replaceRequireStatements(e,t=new Set){const n=[];for(const r of U.listRequireStatements(e).reverse()){if(t.has(r.value)){n.push(...e.splice(r.start||0,(r.end||0)-(r.start||0)));continue}const i=Object.keys(this.dependencies).find((e=>this.dependencies[e].alias.has(r.value)));if(void 0===i){if(!r.firstToken)throw new Error(`ファイル『${r.value}』が読み込まれていません。`);throw new s.tO(`ファイル『${r.value}』が読み込まれていません。`,r.firstToken.startOffset||0,r.firstToken.endOffset||0,r.firstToken.line,r.firstToken.file)}this.dependencies[i].addPluginFile();const o=W(this.dependencies[i].tokens);t.add(r.value),n.push(...this.replaceRequireStatements(o,t)),n.push(...e.splice(r.start||0,(r.end||0)-(r.start||0),...o))}return n}removeRequireStatements(e){const t=[];for(const n of U.listRequireStatements(e).reverse()){const s=Object.keys(this.dependencies).find((e=>this.dependencies[e].alias.has(n.value)));void 0!==s&&this.dependencies[s].addPluginFile(),t.push(...e.splice(n.start||0,(n.end||0)-(n.start||0)))}return t}lex(e,t="main.nako3",n="",s=!1){let i=this.rawtokenize(e,0,t,n);const o=s?this.removeRequireStatements(i):this.replaceRequireStatements(i,void 0);for(const e of o)"word"!==e.type&&"not"!==e.type||(e.type="require");if(o.length>=3)for(let e=0;e<o.length;e+=3){let t=o[e+1].value;t=r.S.filenameToModName(t),this.lexer.modList.indexOf(t)<0&&this.lexer.modList.push(t)}const u=i.filter((e=>"line_comment"===e.type||"range_comment"===e.type)).map((e=>({...e})));i=this.converttoken(i,!0,t);for(let e=0;e<i.length;e++)if(i[e]&&"code"===i[e].type){const n=this.lexCodeToken(i[e].value,i[e].line,t,i[e].startOffset||0);u.push(...n.commentTokens),i.splice(e,1,...n.tokens),e--}return this.logger.trace("--- lex ---\n"+JSON.stringify(i,null,2)),{commentTokens:u,tokens:i,requireTokens:o}}parse(e,t,n=""){this.lexer.setFuncList(this.funclist),this.parser.setFuncList(this.funclist);const r=this.lex(e,t,n);let i;try{this.parser.genMode="sync",i=this.parser.parse(r.tokens,t)}catch(e){if("number"!=typeof e.startOffset)throw s.ih.fromNode(e.message,r.tokens[this.parser.getIndex()]);throw e}return this.usedFuncs=this.getUsedFuncs(i),this.logger.trace("--- ast ---\n"+JSON.stringify(i,null,2)),i}getUsedFuncs(e){const t=[e];for(this.usedFuncs=new Set;t.length>0;){const e=t.pop();null!=e&&null!==e.block&&void 0!==e.block&&this.getUsedAndDefFuncs(t,JSON.parse(JSON.stringify(e.block)))}return this.deleteUnNakoFuncs()}getUsedAndDefFuncs(e,t){for(;t.length>0;){const n=t.pop();null!=n&&this.getUsedAndDefFunc(n,e,t)}}getUsedAndDefFunc(e,t,n){["func","func_pointer"].includes(e.type)&&null!==e.name&&void 0!==e.name&&this.usedFuncs.add(e.name),t.push([e,e.block]),n.push.apply(n,[e.value].concat(e.args))}deleteUnNakoFuncs(){for(const e of this.usedFuncs)this.commandlist.has(e)||this.usedFuncs.delete(e);return this.usedFuncs}compile(e,n,s=!1,r=""){const i=new t;i.testOnly=s,i.preCode=r;return this.compileFromCode(e,n,i).runtimeEnv}compileFromCode(e,t,n){""===t&&(t="main.nako3");try{n.resetEnv&&this.reset(),n.resetAll&&this.clearPlugins(),this.eventList.filter((e=>"beforeParse"===e.eventName)).map((t=>t.callback(e)));const s=this.parse(e,t,n.preCode);this.eventList.filter((e=>"beforeGenerate"===e.eventName)).map((e=>e.callback(s)));const r=this.generateCode(s,new l.un(n.testOnly));return this.eventList.filter((e=>"afterGenerate"===e.eventName)).map((e=>e.callback(r))),r}catch(e){throw this.logger.error(e),e}}generateCode(e,t){switch(e.genMode){case"sync":return(0,l.Im)(this,e,t);case"非同期モード":return this.logger.warn("『!非同期モード』の利用は非推奨です。[詳細](https://github.com/kujirahand/nadesiko3/issues/1164)"),h.g.generate(this,e,t.isTest);default:throw new Error(`コードジェネレータの「${e.genMode}」はサポートされていません。`)}}async _run(e,n,s,r,i=""){const o=new t({resetEnv:s,resetAll:s,testOnly:r,preCode:i});return this._runEx(e,n,o)}clearPlugins(){this.__globals.forEach((e=>{e.reset()})),this.__globals=[]}evalJS(e,t){this.eventList.filter((e=>"beforeRun"===e.eventName)).map((e=>e.callback(t)));new Function(e).apply(t),this.eventList.filter((e=>"finish"===e.eventName)).map((e=>e.callback(t)))}runSync(e,n,s=new t){const r=this.compileFromCode(e,n,s),i=this.getNakoGlobal(s,r.gen);return this.evalJS(r.runtimeEnv,i),i}async runAsync(e,n,s=new t){const r=this.compileFromCode(e,n,s),i=this.getNakoGlobal(s,r.gen);return this.evalJS(r.runtimeEnv,i),i}getNakoGlobal(e,t){let n=e.nakoGlobal;return n||(n=this.__globals.length>0&&!1===e.resetAll&&!1===e.resetEnv?this.__globals[this.__globals.length-1]:new T(this,t)),this.__globals.indexOf(n)<0&&this.__globals.push(n),n}addListener(e,t){this.eventList.push({eventName:e,callback:t})}test(e,n,s="",r=!1){const i=new t;return i.preCode=s,i.testOnly=r,this.runSync(e,n,i)}run(e,n="main.nako3",s=""){const r=new t;return r.preCode=s,this.runSync(e,n,r)}compileStandalone(e,t,n=null){null===n&&(n=new l.un);const s=this.parse(e,t);return this.generateCode(s,n).standalone}addPlugin(e,t=!0){const n=this.__varslist[0];void 0===n.meta&&(n.meta={});for(const s in e){const r=e[s];if(this.funclist[s]=r,t&&(this.pluginFunclist[s]=JSON.parse(JSON.stringify(r))),"func"===r.type)n[s]=r.fn;else{if("const"!==r.type&&"var"!==r.type)throw console.error("[プラグイン追加エラー]",r),new Error("プラグインの追加でエラー。");n[s]=r.value,n.meta[s]={readonly:"const"===r.type}}"初期化"!==s&&"!"!==s.substring(0,1)&&this.commandlist.add(s)}}addPluginObject(e,t,n=!0){if(this.__module[e]=t,this.pluginfiles[e]="*","object"==typeof t["初期化"]){const n=t["初期化"];delete t["初期化"];t[`!${e}:初期化`]=n}if(t.meta&&t.meta.value&&"object"==typeof t.meta){const n=t.meta;delete t.meta;t[`__${n.value.pluginName||e}`.replace("-","__")]=n}this.addPlugin(t,n)}addPluginFile(e,t,n,s=!0){e.indexOf("\\")>=0&&(e=e.replace(/\\/g,"/")),this.addPluginObject(e,n,s),void 0===this.pluginfiles[e]&&(this.pluginfiles[e]=t)}addFunc(e,t,n,s=!0,r=!1){this.funclist[e]={josi:t,fn:n,type:"func",return_none:s,asyncFn:r},this.pluginFunclist[e]=W(this.funclist[e]),this.__varslist[0][e]=n}setFunc(e,t,n,s=!0,r=!1){this.addFunc(e,t,n,s,r)}getFunc(e){return this.funclist[e]}_runEx(e,n,s,r="",i){const o=new t(s);return o.preCode=r,i&&(o.nakoGlobal=i),this.runSync(e,n,o)}runEx(e,t,n,s=""){return this._runEx(e,t,n,s)}async runReset(e,t="main.nako3",n=""){return this._runEx(e,t,{resetAll:!0,resetEnv:!0},n)}}var X={"AJAX送信時":{type:"func",josi:[["の"],["まで","へ","に"]],pure:!0,fn:function(e,t,n){let s=n.__v0["AJAXオプション"];""===s&&(s={method:"GET"}),fetch(t,s).then((e=>e.text())).then((t=>{n.__v0["対象"]=t,"非同期モード"===n.__genMode&&(n.newenv=!0),e(t,n)})).catch((e=>{console.log("[fetch.error]",e),n.__v0["AJAX:ONERROR"](e)}))},return_none:!0},"AJAX受信":{type:"func",josi:[["から","を"]],pure:!0,fn:function(e,t){if("非同期モード"!==t.__genMode)throw new Error("『AJAX受信』を使うには、プログラムの冒頭で「!非同期モード」と宣言してください。");const n=t.setAsync(t);let s=t.__v0["AJAXオプション"];""===s&&(s={method:"GET"}),fetch(e,s).then((e=>{if(e.ok)return e.text();throw new Error("status="+e.status)})).then((e=>{t.__v0["対象"]=e,t.compAsync(t,n)})).catch((e=>{console.error("[AJAX受信のエラー]",e),t.__errorAsync(e,t)}))},return_none:!0},"AJAX受信時":{type:"func",josi:[["で"],["から","を"]],pure:!0,fn:function(e,t,n){n.__exec("AJAX送信時",[e,t,n])},return_none:!0},"GET送信時":{type:"func",josi:[["の"],["まで","へ","に"]],pure:!1,fn:function(e,t,n){n.__exec("AJAX送信時",[e,t,n])},return_none:!0},"POSTデータ生成":{type:"func",josi:[["の","を"]],pure:!0,fn:function(e,t){const n=[];for(const t in e){const s=e[t],r=encodeURIComponent(t)+"="+encodeURIComponent(s);n.push(r)}return n.join("&")}},"POST送信時":{type:"func",josi:[["の"],["まで","へ","に"],["を"]],pure:!1,fn:function(e,t,n,s){const r=s.__exec("POSTデータ生成",[n,s]);fetch(t,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r}).then((e=>e.text())).then((t=>{s.__v0["対象"]=t,e(t)})).catch((e=>{s.__v0["AJAX:ONERROR"](e)}))}},"POSTフォーム送信時":{type:"func",josi:[["の"],["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n,s){const r=new FormData;for(const e in n)r.set(e,n[e]);fetch(t,{method:"POST",body:r}).then((e=>e.text())).then((t=>{s.__v0["対象"]=t,e(t)})).catch((e=>{s.__v0["AJAX:ONERROR"](e)}))}},"AJAX失敗時":{type:"func",josi:[["の"]],pure:!0,fn:function(e,t){t.__v0["AJAX:ONERROR"]=e}},"AJAXオプション":{type:"const",value:""},"AJAXオプション設定":{type:"func",josi:[["に","へ","と"]],pure:!0,fn:function(e,t){t.__v0["AJAXオプション"]=e},return_none:!0},"AJAXオプションPOST設定":{type:"func",josi:[["を","で"]],pure:!0,fn:function(e,t){const n={method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t.__exec("POSTデータ生成",[e,t])};t.__v0["AJAXオプション"]=n},return_none:!0},"AJAX送信":{type:"func",josi:[["まで","へ","に"]],pure:!0,fn:function(e,t){if(!t.resolve)throw new Error("『AJAX送信』は『逐次実行』構文内で利用する必要があります。");t.__exec("AJAX逐次送信",[e,t])},return_none:!0},"AJAX逐次送信":{type:"func",josi:[["まで","へ","に"]],pure:!0,fn:function(e,t){if(!t.resolve)throw new Error("『AJAX逐次送信』は『逐次実行』構文内で利用する必要があります。");t.resolveCount++;const n=t.resolve,s=t.reject;let r=t.__v0["AJAXオプション"];""===r&&(r={method:"GET"}),fetch(e,r).then((e=>e.text())).then((e=>{t.__v0["対象"]=e,n()})).catch((e=>{s(e.message)}))},return_none:!0},"AJAX保障送信":{type:"func",josi:[["まで","へ","に"]],pure:!0,fn:function(e,t){let n=t.__v0["AJAXオプション"];return""===n&&(n={method:"GET"}),fetch(e,n)},return_none:!1},"HTTP取得":{type:"func",josi:[["の","から","を"]],pure:!0,fn:function(e,t){if(!t.resolve)throw new Error("『HTTP取得』は『逐次実行』構文内で利用する必要があります。");t.__exec("AJAX逐次送信",[e,t])},return_none:!0},"HTTP逐次取得":{type:"func",josi:[["の","から","を"]],pure:!1,fn:function(e,t){if(!t.resolve)throw new Error("『HTTP逐次取得』は『逐次実行』構文内で利用する必要があります。");t.__exec("AJAX逐次送信",[e,t])},return_none:!0},"HTTP保障取得":{type:"func",josi:[["の","から","を"]],pure:!0,fn:function(e,t){return t.__exec("AJAX保障送信",[e,t])},return_none:!1},"POST逐次送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!1,fn:function(e,t,n){if(!n.resolve)throw new Error("『POST送信』は『逐次実行』構文内で利用する必要があります。");n.resolveCount++;const s=n.resolve,r=n.reject,i=n.__exec("POSTデータ生成",[t,n]);fetch(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i}).then((e=>e.text())).then((e=>{n.__v0["対象"]=e,s(e)})).catch((e=>{r(e.message)}))},return_none:!0},"POST送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!1,fn:function(e,t,n){if(!n.resolve)throw new Error("『POST送信』は『逐次実行』構文内で利用する必要があります。");n.__exec("POST逐次送信",[e,t,n])},return_none:!0},"POST保障送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n){const s=n.__exec("POSTデータ生成",[t,n]);return fetch(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s})},return_none:!1},"POSTフォーム逐次送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n){if(!n.resolve)throw new Error("『POSTフォーム逐次送信』は『逐次実行』構文内で利用する必要があります。");n.resolveCount++;const s=n.resolve,r=n.reject,i=new FormData;for(const e in t)i.set(e,t[e]);fetch(e,{method:"POST",body:i}).then((e=>e.text())).then((e=>{n.__v0["対象"]=e,s(e)})).catch((e=>{r(e.message)}))},return_none:!0},"POSTフォーム送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!1,fn:function(e,t,n){if(!n.resolve)throw new Error("『POSTフォーム送信』は『逐次実行』構文内で利用する必要があります。");n.__exec("POSTフォーム逐次送信",[e,t,n])},return_none:!0},"POSTフォーム保障送信":{type:"func",josi:[["まで","へ","に"],["を"]],pure:!0,fn:function(e,t,n){const s=new FormData;for(const e in t)s.set(e,t[e]);return fetch(e,{method:"POST",body:s})},return_none:!1},"AJAX内容取得":{type:"func",josi:[["から"],["で"]],pure:!0,fn:function(e,t,n){return"TEXT"===(t=t.toString().toUpperCase())||"テキスト"===t?e.text():"JSON"===t?e.json():"BLOB"===t?e.blob():"ARRAY"===t||"配列"===t?e.arrayBuffer():"BODY"===t||"本体"===t?e.body:e.body()},return_none:!1},"AJAXテキスト取得":{type:"func",josi:[["から"]],pure:!0,asyncFn:!0,fn:async function(e,t){let n=t.__v0["AJAXオプション"];""===n&&(n={method:"GET"});const s=await fetch(e,n);return await s.text()},return_none:!1},"AJAX_JSON取得":{type:"func",josi:[["から"]],pure:!0,asyncFn:!0,fn:async function(e,t){let n=t.__v0["AJAXオプション"];""===n&&(n={method:"GET"});const s=await fetch(e,n);return await s.json()},return_none:!1}};const Y={"初期化":{type:"func",josi:[],pure:!0,fn:function(e){"undefined"==typeof self&&(self={}),"undefined"==typeof navigator&&(navigator={}),e.__v0["AJAX:ONERROR"]=e=>{console.log(e)},e.__v0.SELF=self,e.__v0.NAVIGATOR=navigator}}};[{"水色":{type:"const",value:"aqua"},"紫色":{type:"const",value:"fuchsia"},"緑色":{type:"const",value:"lime"},"青色":{type:"const",value:"blue"},"赤色":{type:"const",value:"red"},"黄色":{type:"const",value:"yellow"},"黒色":{type:"const",value:"black"},"白色":{type:"const",value:"white"},"茶色":{type:"const",value:"maroon"},"灰色":{type:"const",value:"gray"},"金色":{type:"const",value:"gold"},"黄金色":{type:"const",value:"gold"},"銀色":{type:"const",value:"silver"},"白金色":{type:"const",value:"silver"},"オリーブ色":{type:"const",value:"olive"},"ベージュ色":{type:"const",value:"beige"},"アリスブルー色":{type:"const",value:"aliceblue"},RGB:{type:"func",josi:[["と"],["と"],["で","の"]],pure:!0,fn:function(e,t,n){const s=e=>{const t="00"+e.toString(16);return t.substr(t.length-2,2)};return"#"+s(e)+s(t)+s(n)},return_none:!1},"色混":{type:"func",josi:[["の"]],pure:!0,fn:function(e){const t=e=>{const t="00"+e.toString(16);return t.substr(t.length-2,2)};if(!e)throw new Error("『色混ぜる』の引数には配列を指定します");if(e.length<3)throw new Error("『色混ぜる』の引数には[RR,GG,BB]形式の配列を指定します");return"#"+t(e[0])+t(e[1])+t(e[2])},return_none:!1}},X,{"HTML変換":{type:"func",josi:[["を"]],pure:!0,fn:function(e){return String(e).replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<")}},"クリップボード設定":{type:"func",josi:[["を"]],pure:!0,fn:function(e){if(navigator.clipboard)navigator.clipboard.writeText(e);else{const t=document.createElement("div"),n=document.createElement("pre");n.style.webkitUserSelect="auto",n.style.userSelect="auto",t.appendChild(n).textContent=e,t.style.position="fixed",t.right="200%",document.body.appendChild(t),document.getSelection().selectAllChildren(t),document.execCommand("copy"),document.body.removeChild(t)}},return_none:!0},"クリップボード取得時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){if(!navigator.clipboard)throw new Error("Clipbard APIが利用できません。");"string"==typeof e&&(e=t.__findFunc(e,"クリップボード取得時"));navigator.clipboard.readText().then((n=>{t.__v0["対象"]=n,e(t)}))}}},{"WS接続完了時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){t.__v0["WS:ONOPEN"]=e},return_none:!0},"WS受信時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){t.__v0["WS:ONMESSAGE"]=e},return_none:!0},"WSエラー発生時":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){t.__v0["WS:ONERROR"]=e},return_none:!0},"WS接続":{type:"func",josi:[["に","へ","の"]],pure:!0,fn:function(e,t){const n=new WebSocket(e);return n.onopen=()=>{const e=t.__v0["WS:ONOPEN"];e&&e(t)},n.onerror=e=>{const n=t.__v0["WS:ONERROR"];n&&n(e,t),console.log("WSエラー",e)},n.onmessage=e=>{t.__v0["対象"]=e.data;const n=t.__v0["WS:ONMESSAGE"];n&&n(t)},t.__v0["WS:SOCKET"]=n,n}},"WS送信":{type:"func",josi:[["を","と"]],pure:!0,fn:function(e,t){t.__v0["WS:SOCKET"].send(e)}},"WS切断":{type:"func",josi:[],pure:!0,fn:function(e){e.__v0["WS:SOCKET"].close()}}}].forEach((e=>{const t={};Object.assign(t,e),void 0!==t["初期化"]&&delete t["初期化"],Object.assign(Y,t)}));var z=Y;var H={"初期化":{type:"func",josi:[],pure:!0,fn:function(e){e.__v0.SELF=self||{},e.__v0["依頼主"]=self||{}}},"対象イベント":{type:"const",value:""},"受信データ":{type:"const",value:""},SELF:{type:"const",value:""},"依頼主":{type:"const",value:""},"NAKOワーカーデータ受信時":{type:"func",josi:[["で"]],pure:!1,fn:function(e,t){e=t.__findVar(e,null),t.__varslist[0]["PluginWorker:ondata"]=(n,s)=>(t.__v0["受信データ"]=n,t.__v0["対象イベント"]=s,e(s,t))},return_none:!0},"ワーカーメッセージ受信時":{type:"func",josi:[["で"]],pure:!1,fn:function(e,t){e=t.__findVar(e,null),self.onmessage=n=>(t.__v0["受信データ"]=n.data,t.__v0["対象イベント"]=n,e(n,t))},return_none:!0},"NAKOワーカーデータ送信":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){postMessage({type:"data",data:e})},return_none:!0},"ワーカーメッセージ送信":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){postMessage(e)},return_none:!0},"表示":{type:"func",josi:[["を"]],pure:!0,fn:function(e,t){postMessage({type:"output",data:e})},return_none:!0},"終了":{type:"func",josi:[],pure:!0,fn:function(e){close()},return_none:!0}};class Z extends U{constructor(){super(),this.__varslist[0]["ナデシコ種類"]="wwnako3",this.__varslist[0]["PluginWorker:ondata"]=(e,t)=>{throw new Error("『NAKOワーカーデータ受信時』が呼ばれていません。")}}}if("object"==typeof navigator&&self&&self instanceof WorkerGlobalScope){const e=navigator.nako3=new Z;let t=e;e.addPluginObject("PluginBrowserInWorker",z),e.addPluginObject("PluginWorker",H),e.logger.addListener("error",(function(e){self.postMessage({type:"error",data:e})}),!1),self.onmessage=n=>{const s=n.data||{type:"",data:""},r=s.type||"",i=s.data||"";switch(r){case"reset":e.reset();break;case"close":self.close();break;case"run":t=t.runEx(i,"_webworker.nako3",{resetEnv:!1,resetLog:!1});break;case"trans":i.forEach((t=>{"func"===t.type?(e.nako_func[t.name]=t.content.meta,e.funclist[t.name]=t.content.func,e.__varslist[1][t.name]=()=>{}):"val"===t.type&&(e.__varslist[2][t.name]=t.content)}));break;case"data":t.__varslist[0]["PluginWorker:ondata"]&&t.__varslist[0]["PluginWorker:ondata"].apply(t,[i,n])}}}}()})();
|