Repository: Z-Siqi/Clash-for-Windows_Chinese Branch: main Commit: d530262f46af Files: 81 Total size: 48.1 MB Directory structure: gitextract_qv68qdhq/ ├── .github/ │ ├── FUNDING.yml │ ├── ISSUE_TEMPLATE/ │ │ └── issues-template-and-rules.yaml │ └── workflows/ │ └── CloseStaleIssues.yml ├── .gitignore ├── CFW/ │ └── README.md ├── README.md ├── app/ │ ├── README.md │ ├── build_default.bat │ ├── build_linux_arm64.ps1 │ ├── build_linux_x64.ps1 │ ├── build_win32-ia32.ps1 │ ├── build_win32_arm64.ps1 │ ├── build_win_x64.ps1 │ ├── clash_core/ │ │ ├── linux-arm64/ │ │ │ └── static/ │ │ │ └── files/ │ │ │ ├── default/ │ │ │ │ └── Country.mmdb │ │ │ └── linux/ │ │ │ └── arm64/ │ │ │ ├── clash-linux │ │ │ ├── clash-linux.sign │ │ │ └── service/ │ │ │ └── clash-core-service │ │ ├── linux-x64/ │ │ │ └── static/ │ │ │ └── files/ │ │ │ ├── default/ │ │ │ │ └── Country.mmdb │ │ │ └── linux/ │ │ │ └── x64/ │ │ │ ├── clash-linux │ │ │ ├── clash-linux.sign │ │ │ └── service/ │ │ │ └── clash-core-service │ │ ├── win32-arm64/ │ │ │ └── static/ │ │ │ └── files/ │ │ │ ├── default/ │ │ │ │ └── Country.mmdb │ │ │ └── win/ │ │ │ ├── arm64/ │ │ │ │ └── clash-win-arm64.exe.sign │ │ │ └── common/ │ │ │ ├── schtasks.xml │ │ │ ├── service.yml │ │ │ └── tun2socks/ │ │ │ ├── add_tap_device.bat │ │ │ ├── amd64/ │ │ │ │ ├── OemVista.inf │ │ │ │ ├── tap0901.cat │ │ │ │ └── tap0901.sys │ │ │ ├── find_tap_device_name.bat │ │ │ ├── i386/ │ │ │ │ ├── OemVista.inf │ │ │ │ ├── tap0901.cat │ │ │ │ └── tap0901.sys │ │ │ └── remove_tap_device.bat │ │ ├── win32-ia32/ │ │ │ └── static/ │ │ │ └── files/ │ │ │ ├── default/ │ │ │ │ └── Country.mmdb │ │ │ └── win/ │ │ │ ├── common/ │ │ │ │ ├── schtasks.xml │ │ │ │ ├── service.yml │ │ │ │ └── tun2socks/ │ │ │ │ ├── add_tap_device.bat │ │ │ │ ├── amd64/ │ │ │ │ │ ├── OemVista.inf │ │ │ │ │ ├── tap0901.cat │ │ │ │ │ └── tap0901.sys │ │ │ │ ├── find_tap_device_name.bat │ │ │ │ ├── i386/ │ │ │ │ │ ├── OemVista.inf │ │ │ │ │ ├── tap0901.cat │ │ │ │ │ └── tap0901.sys │ │ │ │ └── remove_tap_device.bat │ │ │ └── ia32/ │ │ │ └── clash-win32.exe.sign │ │ └── win_x64/ │ │ └── static/ │ │ └── files/ │ │ ├── default/ │ │ │ └── Country.mmdb │ │ └── win/ │ │ ├── common/ │ │ │ ├── schtasks.xml │ │ │ ├── service.yml │ │ │ └── tun2socks/ │ │ │ ├── add_tap_device.bat │ │ │ ├── amd64/ │ │ │ │ ├── OemVista.inf │ │ │ │ ├── tap0901.cat │ │ │ │ └── tap0901.sys │ │ │ ├── find_tap_device_name.bat │ │ │ ├── i386/ │ │ │ │ ├── OemVista.inf │ │ │ │ ├── tap0901.cat │ │ │ │ └── tap0901.sys │ │ │ └── remove_tap_device.bat │ │ └── x64/ │ │ └── clash-win64.exe.sign │ └── main/ │ ├── ABOUT/ │ │ ├── LICENSE.electron.txt │ │ └── state.txt │ ├── dist/ │ │ └── electron/ │ │ ├── 287.js │ │ ├── 295.js │ │ ├── 585.js │ │ ├── editor.worker.js │ │ ├── index.html │ │ ├── main.js │ │ ├── renderer.js │ │ └── renderer.js.LICENSE.txt │ └── package.json ├── chinese_file/ │ ├── Auto/ │ │ ├── main-chinese.txt │ │ └── renderer-chinese.txt │ ├── Manual-Chinese/ │ │ ├── Clash_Sinicization_Comparison_Table_Old │ │ ├── main │ │ └── renderer │ ├── Sinicization_files/ │ │ ├── main.js │ │ └── renderer.js │ └── packing_script.iss ├── image/ │ └── This folder stores pictures └── update ================================================ FILE CONTENTS ================================================ ================================================ FILE: .github/FUNDING.yml ================================================ # These are supported funding model platforms github: Z-Siqi ================================================ FILE: .github/ISSUE_TEMPLATE/issues-template-and-rules.yaml ================================================ name: Issues Release Rule description: 通过这个模板发布你的问题 body: - type: markdown attributes: value: | 请遵循模板发布问题 - type: textarea id: text attributes: label: 你的问题/建议/想说的内容是什么? description: 提出问题前,先看看主页中的 "下载前你需要知晓的内容:"
发布问题前请检查是否有重复的
如果是反馈bug,请先确定是由汉化导致的,否则请在原版的Issues提交问题 placeholder: "说些什么?建议尽可能清晰的描述问题" validations: required: true - type: textarea id: version attributes: label: 版本 description: 这个问题发生在哪个版本?
如果是建议,汉化或故障请填写当前最新的版本号 placeholder: "no-version" validations: required: true ================================================ FILE: .github/workflows/CloseStaleIssues.yml ================================================ name: "Close Stale Issues" on: schedule: - cron: "0 0 * * *" jobs: stale: runs-on: ubuntu-latest steps: - uses: actions/stale@v4 with: repo-token: ${{ secrets.GITHUB_TOKEN }} days-before-stale: 14 days-before-close: 14 exempt-issue-labels: 'bug, Put on Hold, In Processing, Investigating' close-issue-reason: 'not_planned' ================================================ FILE: .gitignore ================================================ /.vs /app/output ================================================ FILE: CFW/README.md ================================================ ### 众所周知 Clash for Windows 原版仓库已经删库跑路,~这个库将再无活动的必要,因此该仓库将被存档~ **考虑到因为原版的online资料都已经缺失,部分维护仍然是必要的** *** **以下是一些原版包的存档** * https://github.com/Z-Siqi/Clash-for-Windows_Chinese/releases/tag/CFW ================================================ FILE: README.md ================================================ # Clash for Windows Chinese ### Clash 汉化版 **提供clash for windows的汉化版, 汉化补丁以及汉化版Clash安装程序** 效果图 [![photo](https://github.com/user-attachments/assets/83ed7ff1-9ec8-462b-be65-69a192440594)](https://github.com/Z-Siqi/Clash-for-Windows_Chinese/releases/) **支持的clash版本:** [0.15.3](https://github.com/Z-Siqi/Clash-for-Windows_Chinese/releases/tag/CFW-V0.15.3_CN-V4) ~ [当前的最新兼容](https://github.com/Z-Siqi/Clash-for-Windows_Chinese/releases/latest) **基本特征&介绍:** * 使用安装程序(Clash.for.Windows.Setup. ** . ** . ** .exe)安装的汉化版CFW将劫持更新,之后可直接通过应用内置的更新方式进行汉化版/软件更新 * 使用安装包(Clash.for.Windows- ** . ** . ** -win.7z)请不要在解压时选择解压到当前文件夹,否则软件相关的所有文件将放到当前所在文件夹 * ~app.asar需要替换掉对应版本的原版app.asar以完成汉化~ * ~使用7z格式压缩包(app.7z)需要先进行解压,然后提取里面的app.asar并替换掉原有文件以完成汉化,即在节省流量~ **
下载前你需要知晓的内容:** ~**The repository was archived (Nov 3, 2023) due to: [README.md](https://github.com/Z-Siqi/Clash-for-Windows_Chinese/blob/main/CFW/README.md)**~ **下载将代表你对以下内容无任何异议** **非官方版本,Unofficial!** *简单来说,这个库提供的Clash for Windows是修改过的,请在向原版Clash for Windows反馈漏洞前先更换回原版* **修改的方式/内容大致说明列表 (可能不适用于 Optimize 版本)** 对Clash for Windows进行的修改: 1, 修改"app.asar"文件中的"renderer.js" 2, 修改"app.asar"文件中的"main.js" 3, 修改"app.asar"文件中的其它内容(具体参见 https://github.com/Z-Siqi/Clash-for-Windows_Chinese/tree/main/app 目录下的所有 .md 文件) 对Clash for Windows植入的第三方链接: 1, https://github.com/Z-Siqi/Clash-for-Windows_Chinese-Attached 对app.asar替换的文件: 1, app.asar\dist\electron\static\* 汉化的方式 通过Notepad++进行替换 (已被淘汰) 手动替换用表位置: Clash-for-Windows_Chinese/chinese_file/Clash_Sinicization_Comparison_Table 下载链接: https://notepad-plus-plus.org/downloads/ 通过Replace Pioneer的Batch Rnuuer工具配合替换表进行批量替换 替换表的位置: Clash-for-Windows_Chinese/chinese_file/Auto/main-chinese Clash-for-Windows_Chinese/chinese_file/Auto/renderer-chinese 下载链接 https://www.mind-pioneer.com/ zh-cn.js的汉化方式: 将文件中的"后"改为"前" 在app.asar中的位置: app.asar\node_modules\moment\locale\zh-cn.js 封包方式 安装程序的封包程序: 简易封包工具_3.2.0.1.exe (已被淘汰) Inno Setup Compiler 下载链接: https://jrsoftware.org/isdl.php .7z扩展名的封包程序: 7-zip (已弃用) 下载链接: https://7-zip.org/ NanaZip 下载链接: In the Microsoft Store **Optimize (优化) 版本** 源代码:https://github.com/Z-Siqi/Clash-for-Windows_Chinese/tree/main/app **重要内容** ---------------------------------------------------- * Important, You MUST agree! * 此项目不为中国大陆地区提供任何帮助与支持 * 赞助商的一切内容与该库无关 * 该库不承担由使用者造成的任何行为 * 该库的所有内容仅存在于GitHub * 此汉化版适用于Clash for Windows免责声明的 1 ~ 6 条 ---------------------------------------------------- **免责声明** 免责声明如下: 1. 本软件仅供学习和研究网络技术之用,用户必须遵守所在地区的法律法规,不得用于非法用途,本软件不对任何人的行为负责。 2. 用户在使用本软件时必须严格遵守所在国家/地区的法律、法规和政策。 因违反有关法律、法规和政策而导致的任何后果或责任由用户自行承担。 3. 本软件不负责传输内容。 因此,如因使用本软件而产生任何问题或后果,由用户自行承担全部责任。 4. 如本软件违反用户所在国家/地区的任何法律法规,用户必须立即停止使用并承担相应的法律责任。 5. 用户在使用本软件时,即承认并同意本软件不能保证网络的稳定性、准确性、及时性和安全性。 因网络拥塞、防火墙限制、DNS污染、运营商干扰等原因造成的连接问题或无法连接,本软件不承担任何责任。 6. 本软件不提供技术支持,对因用户使用本软件而造成的任何直接或间接损失,包括但不限于财产损失、数据丢失及其他形式的损失不承担任何责任。
*** ### 讨论/Discussions **[参与或发起讨论](https://github.com/Z-Siqi/Clash-for-Windows_Chinese/discussions)** ### 参与该项目的开发/工作 *通过提出 Pull Request 将你的维护添加到下一个版本的更新里并成为这个库的共同维护者* **[这些issues非常需要您的帮助/贡献](https://github.com/Z-Siqi/Clash-for-Windows_Chinese/issues?q=label%3A%22Need+Help%22+)** *** #### 赞助商的广告 [![ads](https://github.com/user-attachments/assets/9fd317b9-33c4-493c-b869-67e1cb6a853c)](https://live.cute-cloud.de/register?code=uIyXpA5O) [[CUTECLOUD](https://live.cute-cloud.de/register?code=uIyXpA5O)] 多年老牌机场,有试用,线路优秀,解锁全面,并提供丰富的共享账户。速度与稳定性很好,Youtube全天8K无压。 [点击此处或图片直达](https://live.cute-cloud.de/register?code=uIyXpA5O) *** ### 快速导航 [前往汉化下载界面](https://github.com/Z-Siqi/Clash-for-Windows_Chinese/releases) [Clash for Windows 线上文档副本](https://github.com/Z-Siqi/Clash-for-Windows_Chinese/wiki) ~[前往原版Clash for Windows下载界面](https://github.com/Fndroid/clash_for_windows_pkg/releases)~ #### 能够解压7z格式的软件 [NanaZip](https://github.com/M2Team/NanaZip) *(兼容Windows11)* [7-Zip](https://www.7-zip.org/) [WinRAR](https://www.rarlab.com/) *** ### 如果你喜欢的话,可以考虑[向我赞助](https://github.com/sponsors/Z-Siqi) ================================================ FILE: app/README.md ================================================ ### Guide * Extract these files in ONE folder * Run `build_default_.bat` to quick generate runnable software (Windows x64) * Run `xxx.ps1` to build the program (linux, arm, etc.) ================================================ FILE: app/build_default.bat ================================================ @echo off cd /d "%~dp0" powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0\build_win_x64.ps1" %* ================================================ FILE: app/build_linux_arm64.ps1 ================================================ # Requires PowerShell 3.0+ # Script Directory $scriptDir = $PSScriptRoot $staticDir = Join-Path $scriptDir 'clash_core\linux-arm64\static' $mainDir = Join-Path $scriptDir 'main' $logoFile = Join-Path $scriptDir 'logo.ico' $outputDir = Join-Path $scriptDir 'output' $outWinDir = Join-Path $outputDir 'cfw-linux-arm64' Write-Host 'Checking environment...' # Checking static if (-not (Test-Path $staticDir)) { Write-Error 'Failed! "static" folder not found!' Read-Host 'Press Enter to exit' exit 1 } # Checking main if (-not (Test-Path $mainDir)) { Write-Error 'Failed! "main" folder not found!' Read-Host 'Press Enter to exit' exit 1 } # Checking logo.ico if (-not (Test-Path $logoFile)) { Write-Error 'Failed! "logo.ico" not found!' Read-Host 'Press Enter to exit' exit 1 } # Checking npm & npm --version > $null 2>&1 if ($LASTEXITCODE -eq 0) { Write-Host 'npm is detected...' } else { Write-Error 'Failed! No npm command!' Write-Host 'Install Node.js might fix this.' Read-Host 'Press Enter to exit' exit 1 } # Checking electron-packager & npx electron-packager --version > $null 2>&1 if ($LASTEXITCODE -eq 0) { Write-Host 'electron-packager is detected...' } else { Write-Warning 'Failed! No electron-packager command!' Write-Host 'But npm is detected!' Read-Host 'Press Enter to install electron-packager or Ctrl+C to exit' npm install -g electron-packager } # Checking asar & npx asar --version > $null 2>&1 if ($LASTEXITCODE -eq 0) { Write-Host 'asar is detected...' } else { Write-Warning 'Failed! No asar command!' Write-Host 'But npm is detected!' Read-Host 'Press Enter to install asar or Ctrl+C to exit' npm install -g asar } Write-Host 'Success!' # Clear old output if (Test-Path $outWinDir) { Write-Host 'Detected old output!' Read-Host 'Press Enter to delete and rebuild' Remove-Item -Recurse -Force $outWinDir Write-Host 'Success!' } # Make sure output dir is existed if (-not (Test-Path $outputDir)) { New-Item -ItemType Directory -Path $outputDir | Out-Null } # Start packaging Write-Host 'Starting electron-packager...' & npx electron-packager ` "`"$mainDir`"" "cfw" ` --platform=linux --arch=arm64 --electron-version=34.0.0 ` --icon="`"$logoFile`"" --out="`"$outputDir`"" --prune=true --asar if ($LASTEXITCODE -ne 0) { Write-Error 'electron-packager Failed!' exit 1 } Write-Host 'Waiting app building...' Write-Host 'Note: If wait too long, it may mean that the execution has failed. Press Ctrl+C to terminate.' # Wait for the program $exePath = Join-Path $outWinDir 'cfw' while (-not (Test-Path $exePath)) { Start-Sleep -Seconds 5 } Write-Host 'Success!' # Adding files Write-Host 'Adding proxy core files...' Start-Sleep -Seconds 1 $destStatic = Join-Path $outWinDir 'resources\static' # Make sure resources dir is existed $resourcesDir = Split-Path $destStatic -Parent if (-not (Test-Path $resourcesDir)) { New-Item -ItemType Directory -Path $resourcesDir | Out-Null } # Make sure static dir is existed if (-not (Test-Path $destStatic)) { New-Item -ItemType Directory -Path $destStatic | Out-Null } # Then copy it Copy-Item -Path "$staticDir\*" -Destination $destStatic -Recurse -Force Write-Host 'Success!' Write-Host 'Finish!' Read-Host 'Press Enter to exit' ================================================ FILE: app/build_linux_x64.ps1 ================================================ # Requires PowerShell 3.0+ # Script Directory $scriptDir = $PSScriptRoot $staticDir = Join-Path $scriptDir 'clash_core\linux-x64\static' $mainDir = Join-Path $scriptDir 'main' $logoFile = Join-Path $scriptDir 'logo.ico' $outputDir = Join-Path $scriptDir 'output' $outWinDir = Join-Path $outputDir 'cfw-linux-x64' Write-Host 'Checking environment...' # Checking static if (-not (Test-Path $staticDir)) { Write-Error 'Failed! "static" folder not found!' Read-Host 'Press Enter to exit' exit 1 } # Checking main if (-not (Test-Path $mainDir)) { Write-Error 'Failed! "main" folder not found!' Read-Host 'Press Enter to exit' exit 1 } # Checking logo.ico if (-not (Test-Path $logoFile)) { Write-Error 'Failed! "logo.ico" not found!' Read-Host 'Press Enter to exit' exit 1 } # Checking npm & npm --version > $null 2>&1 if ($LASTEXITCODE -eq 0) { Write-Host 'npm is detected...' } else { Write-Error 'Failed! No npm command!' Write-Host 'Install Node.js might fix this.' Read-Host 'Press Enter to exit' exit 1 } # Checking electron-packager & npx electron-packager --version > $null 2>&1 if ($LASTEXITCODE -eq 0) { Write-Host 'electron-packager is detected...' } else { Write-Warning 'Failed! No electron-packager command!' Write-Host 'But npm is detected!' Read-Host 'Press Enter to install electron-packager or Ctrl+C to exit' npm install -g electron-packager } # Checking asar & npx asar --version > $null 2>&1 if ($LASTEXITCODE -eq 0) { Write-Host 'asar is detected...' } else { Write-Warning 'Failed! No asar command!' Write-Host 'But npm is detected!' Read-Host 'Press Enter to install asar or Ctrl+C to exit' npm install -g asar } Write-Host 'Success!' # Clear old output if (Test-Path $outWinDir) { Write-Host 'Detected old output!' Read-Host 'Press Enter to delete and rebuild' Remove-Item -Recurse -Force $outWinDir Write-Host 'Success!' } # Make sure output dir is existed if (-not (Test-Path $outputDir)) { New-Item -ItemType Directory -Path $outputDir | Out-Null } # Start packaging Write-Host 'Starting electron-packager...' & npx electron-packager ` "`"$mainDir`"" "cfw" ` --platform=linux --arch=x64 --electron-version=34.0.0 ` --icon="`"$logoFile`"" --out="`"$outputDir`"" --prune=true --asar if ($LASTEXITCODE -ne 0) { Write-Error 'electron-packager Failed!' exit 1 } Write-Host 'Waiting app building...' Write-Host 'Note: If wait too long, it may mean that the execution has failed. Press Ctrl+C to terminate.' # Wait for the program $exePath = Join-Path $outWinDir 'cfw' while (-not (Test-Path $exePath)) { Start-Sleep -Seconds 5 } Write-Host 'Success!' # Adding files Write-Host 'Adding proxy core files...' Start-Sleep -Seconds 1 $destStatic = Join-Path $outWinDir 'resources\static' # Make sure resources dir is existed $resourcesDir = Split-Path $destStatic -Parent if (-not (Test-Path $resourcesDir)) { New-Item -ItemType Directory -Path $resourcesDir | Out-Null } # Make sure static dir is existed if (-not (Test-Path $destStatic)) { New-Item -ItemType Directory -Path $destStatic | Out-Null } # Then copy it Copy-Item -Path "$staticDir\*" -Destination $destStatic -Recurse -Force Write-Host 'Success!' Write-Host 'Finish!' Read-Host 'Press Enter to exit' ================================================ FILE: app/build_win32-ia32.ps1 ================================================ # Requires PowerShell 3.0+ # Script Directory $scriptDir = $PSScriptRoot $staticDir = Join-Path $scriptDir 'clash_core\win32-ia32\static' $mainDir = Join-Path $scriptDir 'main' $logoFile = Join-Path $scriptDir 'logo.ico' $outputDir = Join-Path $scriptDir 'output' $outWinDir = Join-Path $outputDir 'Clash for Windows-win32-ia32' Write-Host 'Checking environment...' # Checking static if (-not (Test-Path $staticDir)) { Write-Error 'Failed! "static" folder not found!' Read-Host 'Press Enter to exit' exit 1 } # Checking main if (-not (Test-Path $mainDir)) { Write-Error 'Failed! "main" folder not found!' Read-Host 'Press Enter to exit' exit 1 } # Checking logo.ico if (-not (Test-Path $logoFile)) { Write-Error 'Failed! "logo.ico" not found!' Read-Host 'Press Enter to exit' exit 1 } # Checking npm & npm --version > $null 2>&1 if ($LASTEXITCODE -eq 0) { Write-Host 'npm is detected...' } else { Write-Error 'Failed! No npm command!' Write-Host 'Install Node.js might fix this.' Read-Host 'Press Enter to exit' exit 1 } # Checking electron-packager & npx electron-packager --version > $null 2>&1 if ($LASTEXITCODE -eq 0) { Write-Host 'electron-packager is detected...' } else { Write-Warning 'Failed! No electron-packager command!' Write-Host 'But npm is detected!' Read-Host 'Press Enter to install electron-packager or Ctrl+C to exit' npm install -g electron-packager } # Checking asar & npx asar --version > $null 2>&1 if ($LASTEXITCODE -eq 0) { Write-Host 'asar is detected...' } else { Write-Warning 'Failed! No asar command!' Write-Host 'But npm is detected!' Read-Host 'Press Enter to install asar or Ctrl+C to exit' npm install -g asar } Write-Host 'Success!' # Clear old output if (Test-Path $outWinDir) { Write-Host 'Detected old output!' Read-Host 'Press Enter to delete and rebuild' Remove-Item -Recurse -Force $outWinDir Write-Host 'Success!' } # Make sure output dir is existed if (-not (Test-Path $outputDir)) { New-Item -ItemType Directory -Path $outputDir | Out-Null } # Start packaging Write-Host 'Starting electron-packager...' & npx electron-packager ` "`"$mainDir`"" "Clash for Windows" ` --platform=win32 --arch=ia32 --electron-version=34.0.0 ` --icon="`"$logoFile`"" --out="`"$outputDir`"" --prune=true --asar if ($LASTEXITCODE -ne 0) { Write-Error 'electron-packager Failed!' exit 1 } Write-Host 'Waiting app building...' Write-Host 'Note: If wait too long, it may mean that the execution has failed. Press Ctrl+C to terminate.' # Wait for the program $exePath = Join-Path $outWinDir 'Clash for Windows.exe' while (-not (Test-Path $exePath)) { Start-Sleep -Seconds 5 } Write-Host 'Success!' # Adding files Write-Host 'Adding proxy core files...' Start-Sleep -Seconds 1 $destStatic = Join-Path $outWinDir 'resources\static' # Make sure resources dir is existed $resourcesDir = Split-Path $destStatic -Parent if (-not (Test-Path $resourcesDir)) { New-Item -ItemType Directory -Path $resourcesDir | Out-Null } # Make sure static dir is existed if (-not (Test-Path $destStatic)) { New-Item -ItemType Directory -Path $destStatic | Out-Null } # Then copy it Copy-Item -Path "$staticDir\*" -Destination $destStatic -Recurse -Force Write-Host 'Success!' Write-Host 'Finish!' Read-Host 'Press Enter to exit' ================================================ FILE: app/build_win32_arm64.ps1 ================================================ # Requires PowerShell 3.0+ # Script Directory $scriptDir = $PSScriptRoot $staticDir = Join-Path $scriptDir 'clash_core\win32-arm64\static' $mainDir = Join-Path $scriptDir 'main' $logoFile = Join-Path $scriptDir 'logo.ico' $outputDir = Join-Path $scriptDir 'output' $outWinDir = Join-Path $outputDir 'Clash for Windows-win32-arm64' Write-Host 'Checking environment...' # Checking static if (-not (Test-Path $staticDir)) { Write-Error 'Failed! "static" folder not found!' Read-Host 'Press Enter to exit' exit 1 } # Checking main if (-not (Test-Path $mainDir)) { Write-Error 'Failed! "main" folder not found!' Read-Host 'Press Enter to exit' exit 1 } # Checking logo.ico if (-not (Test-Path $logoFile)) { Write-Error 'Failed! "logo.ico" not found!' Read-Host 'Press Enter to exit' exit 1 } # Checking npm & npm --version > $null 2>&1 if ($LASTEXITCODE -eq 0) { Write-Host 'npm is detected...' } else { Write-Error 'Failed! No npm command!' Write-Host 'Install Node.js might fix this.' Read-Host 'Press Enter to exit' exit 1 } # Checking electron-packager & npx electron-packager --version > $null 2>&1 if ($LASTEXITCODE -eq 0) { Write-Host 'electron-packager is detected...' } else { Write-Warning 'Failed! No electron-packager command!' Write-Host 'But npm is detected!' Read-Host 'Press Enter to install electron-packager or Ctrl+C to exit' npm install -g electron-packager } # Checking asar & npx asar --version > $null 2>&1 if ($LASTEXITCODE -eq 0) { Write-Host 'asar is detected...' } else { Write-Warning 'Failed! No asar command!' Write-Host 'But npm is detected!' Read-Host 'Press Enter to install asar or Ctrl+C to exit' npm install -g asar } Write-Host 'Success!' # Clear old output if (Test-Path $outWinDir) { Write-Host 'Detected old output!' Read-Host 'Press Enter to delete and rebuild' Remove-Item -Recurse -Force $outWinDir Write-Host 'Success!' } # Make sure output dir is existed if (-not (Test-Path $outputDir)) { New-Item -ItemType Directory -Path $outputDir | Out-Null } # Start packaging Write-Host 'Starting electron-packager...' & npx electron-packager ` "`"$mainDir`"" "Clash for Windows" ` --platform=win32 --arch=arm64 --electron-version=34.0.0 ` --icon="`"$logoFile`"" --out="`"$outputDir`"" --prune=true --asar if ($LASTEXITCODE -ne 0) { Write-Error 'electron-packager Failed!' exit 1 } Write-Host 'Waiting app building...' Write-Host 'Note: If wait too long, it may mean that the execution has failed. Press Ctrl+C to terminate.' # Wait for the program $exePath = Join-Path $outWinDir 'Clash for Windows.exe' while (-not (Test-Path $exePath)) { Start-Sleep -Seconds 5 } Write-Host 'Success!' # Adding files Write-Host 'Adding proxy core files...' Start-Sleep -Seconds 1 $destStatic = Join-Path $outWinDir 'resources\static' # Make sure resources dir is existed $resourcesDir = Split-Path $destStatic -Parent if (-not (Test-Path $resourcesDir)) { New-Item -ItemType Directory -Path $resourcesDir | Out-Null } # Make sure static dir is existed if (-not (Test-Path $destStatic)) { New-Item -ItemType Directory -Path $destStatic | Out-Null } # Then copy it Copy-Item -Path "$staticDir\*" -Destination $destStatic -Recurse -Force Write-Host 'Success!' Write-Host 'Finish!' Read-Host 'Press Enter to exit' ================================================ FILE: app/build_win_x64.ps1 ================================================ # Requires PowerShell 3.0+ # Script Directory $scriptDir = $PSScriptRoot $staticDir = Join-Path $scriptDir 'clash_core\win_x64\static' $mainDir = Join-Path $scriptDir 'main' $logoFile = Join-Path $scriptDir 'logo.ico' $outputDir = Join-Path $scriptDir 'output' $oldWinDir = Join-Path $outputDir 'Clash for Windows' $wrongWinDir = Join-Path $outputDir 'Clash for Windows-win32-x64' Write-Host 'Checking environment...' # Checking static if (-not (Test-Path $staticDir)) { Write-Error 'Failed! "static" folder not found!' Read-Host 'Press Enter to exit' exit 1 } # Checking main if (-not (Test-Path $mainDir)) { Write-Error 'Failed! "main" folder not found!' Read-Host 'Press Enter to exit' exit 1 } # Checking logo.ico if (-not (Test-Path $logoFile)) { Write-Error 'Failed! "logo.ico" not found!' Read-Host 'Press Enter to exit' exit 1 } # Checking npm & npm --version > $null 2>&1 if ($LASTEXITCODE -eq 0) { Write-Host 'npm is detected...' } else { Write-Error 'Failed! No npm command!' Write-Host 'Install Node.js might fix this.' Read-Host 'Press Enter to exit' exit 1 } # Checking electron-packager & npx electron-packager --version > $null 2>&1 if ($LASTEXITCODE -eq 0) { Write-Host 'electron-packager is detected...' } else { Write-Warning 'Failed! No electron-packager command!' Write-Host 'But npm is detected!' Read-Host 'Press Enter to install electron-packager or Ctrl+C to exit' npm install -g electron-packager } # Checking asar & npx asar --version > $null 2>&1 if ($LASTEXITCODE -eq 0) { Write-Host 'asar is detected...' } else { Write-Warning 'Failed! No asar command!' Write-Host 'But npm is detected!' Read-Host 'Press Enter to install asar or Ctrl+C to exit' npm install -g asar } Write-Host 'Success!' # Clear old output if (Test-Path $oldWinDir) { Write-Host 'Detected old output!' Read-Host 'Press Enter to delete and rebuild' Remove-Item -Recurse -Force $oldWinDir Write-Host 'Success!' } if (Test-Path $wrongWinDir) { Write-Host 'Detected wrong building files!' Read-Host 'Press Enter to delete and continue' Remove-Item -Recurse -Force $wrongWinDir Write-Host 'Success!' } # Make sure output dir is existed if (-not (Test-Path $outputDir)) { New-Item -ItemType Directory -Path $outputDir | Out-Null } # Start packaging Write-Host 'Starting electron-packager...' & npx electron-packager ` "`"$mainDir`"" "Clash for Windows" ` --platform=win32 --arch=x64 --electron-version=34.0.0 ` --icon="`"$logoFile`"" --out="`"$outputDir`"" --prune=true --asar if ($LASTEXITCODE -ne 0) { Write-Error 'electron-packager Failed!' exit 1 } Write-Host 'Waiting app building...' Write-Host 'Note: If wait too long, it may mean that the execution has failed. Press Ctrl+C to terminate.' # Wait for the program $exePath = Join-Path $wrongWinDir 'Clash for Windows.exe' while (-not (Test-Path $exePath)) { Start-Sleep -Seconds 5 } Write-Host 'Success!' # Adding files and rename Write-Host 'Adding proxy core files...' Start-Sleep -Seconds 1 Rename-Item -Path $wrongWinDir -NewName 'Clash for Windows' $destStatic = Join-Path $oldWinDir 'resources\static' # Make sure resources dir is existed $resourcesDir = Split-Path $destStatic -Parent if (-not (Test-Path $resourcesDir)) { New-Item -ItemType Directory -Path $resourcesDir | Out-Null } # Make sure static dir is existed if (-not (Test-Path $destStatic)) { New-Item -ItemType Directory -Path $destStatic | Out-Null } # Then copy it Copy-Item -Path "$staticDir\*" -Destination $destStatic -Recurse -Force Write-Host 'Success!' Write-Host 'Finish!' Read-Host 'Press Enter to exit' ================================================ FILE: app/clash_core/linux-arm64/static/files/linux/arm64/clash-linux ================================================ [File too large to display: 18.4 MB] ================================================ FILE: app/clash_core/linux-arm64/static/files/linux/arm64/clash-linux.sign ================================================ U2KIAkV6aF08JlUXVPChLl6W2d0/78V16zzz7Mz5bH2nbYfNADFCVK10wB8/LDGz9PrIkSNaceKGbdn7zdVhyQ== ================================================ FILE: app/clash_core/linux-x64/static/files/linux/x64/clash-linux ================================================ [File too large to display: 19.0 MB] ================================================ FILE: app/clash_core/linux-x64/static/files/linux/x64/clash-linux.sign ================================================ g4db2Nr6eFh0TnYY1jiDD/wENCzputDYksyhcs9AyOoJxvcbr1dVhTgk0OJwvzdiPd+QV/u958/YkmbB1iytBw== ================================================ FILE: app/clash_core/win32-arm64/static/files/win/arm64/clash-win-arm64.exe.sign ================================================ ITc2EBlFAD1GjpFIotoMMlMk9xt5GrqaVEJSnoyirU2zM/hMts4RfwFL3rXpa3IL/dSgmnsaPTuBLzPIK6IGKA== ================================================ FILE: app/clash_core/win32-arm64/static/files/win/common/schtasks.xml ================================================ true StopExisting false false false true false true false true true false false false PT0S 7 PT1M 5 "" ================================================ FILE: app/clash_core/win32-arm64/static/files/win/common/service.yml ================================================ id: Clash Core Service name: Clash Core Service description: Clash Core Service started by Clash for Windows executable: clash-core-service log: mode: none ================================================ FILE: app/clash_core/win32-arm64/static/files/win/common/tun2socks/add_tap_device.bat ================================================ :: Copyright 2018 The Outline Authors :: :: Licensed under the Apache License, Version 2.0 (the "License"); :: you may not use this file except in compliance with the License. :: You may obtain a copy of the License at :: :: http://www.apache.org/licenses/LICENSE-2.0 :: :: Unless required by applicable law or agreed to in writing, software :: distributed under the License is distributed on an "AS IS" BASIS, :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. :: See the License for the specific language governing permissions and :: limitations under the License. @echo off :: See https://ss64.com/nt/delayedexpansion.html setlocal enabledelayedexpansion set DEVICE_NAME=cfw-tap set DEVICE_HWID=tap0901 set SCRIPT_DIR=%~dp0 set ARCH=%1 set IP=%2 set SUBNET=%3 set GATEWAY=%4 :: Error codes for surfacing to the user and sentry. set ERROR_TAP_INSTALL=1 set ERROR_TAP_FIND_NAME=2 set ERROR_TAP_RENAME=3 set ERROR_TAP_CONFIGURE_SUBNET=4 set ERROR_TAP_CONFIGURE_DNS=5 :: Because we've seen multiple failures due to commands (netsh, etc.) not being :: found, append some common directories to the PATH. :: :: Note: :: - %SystemRoot% almost always expands to c:\windows. :: - Do *not* surround with quotes. set PATH=%PATH%;%SystemRoot%\system32;%SystemRoot%\system32\wbem;%SystemRoot%\system32\WindowsPowerShell/v1.0 :: Check whether the device already exists. netsh interface show interface name=%DEVICE_NAME% if %errorlevel% equ 0 ( echo TAP network device already exists. goto :configure ) echo Creating TAP network device... "%SCRIPT_DIR%\%ARCH%\tapinstall" install "%SCRIPT_DIR%\%ARCH%\OemVista.inf" %DEVICE_HWID% if %errorlevel% neq 0 ( echo Could not create TAP network device. Try to do it manually. >&2 REM exit /b %ERROR_TAP_INSTALL% start /wait /D "%SCRIPT_DIR%" tap-windows-installer.exe ) :: Find the name of the most recently installed TAP device in the registry and rename it. echo Searching for new TAP network device name... call "%SCRIPT_DIR%\find_tap_device_name.bat" TAP_NAME if %errorlevel% neq 0 ( echo Could not find TAP device name. >&2 exit /b %ERROR_TAP_FIND_NAME% ) echo Found TAP device name: "%TAP_NAME%" :: We've occasionally seen delays before netsh will "see" the new device, at least for :: purposes of configuring IP and DNS ("netsh interface show interface name=xxx" does not :: seem to be affected). call :wait_for_device "%TAP_NAME%" :: Attempt to rename the device even if waiting timed out. netsh interface set interface name="%TAP_NAME%" newname="%DEVICE_NAME%" if %errorlevel% neq 0 ( :: Try to rename the device through powershell in case netsh failed due to not being able to "see" :: the device. Pipe input from /dev/null to prevent powershell from waiting forever on EOF. powershell "Rename-NetAdapter -Name \"%TAP_NAME%\" -NewName \"%DEVICE_NAME%\"" &2 exit /b %ERROR_TAP_RENAME% ) ) :: Wait for the new name to propagate to netsh. call :wait_for_device "%DEVICE_NAME%" :: Attempt to configure the device even if waiting timed out. :configure :: Try to enable the device, in case it's somehow been disabled. :: :: Annoyingly, this returns an error and outputs a confusing message if the device exists and is :: already enabled: :: This network connection does not exist. :: :: So, continue even if this command fails - and always include its output. echo (Re-)enabling TAP network device... netsh interface set interface "%DEVICE_NAME%" admin=enabled :: The powershell command is used to ensure the adapter is enabled if netsh fails and leaves it in :: a disabled state. While no such failure has yet been observed, this command would correct it and :: should behave idempotently otherwise. powershell "Enable-NetAdapter -Name \"%DEVICE_NAME%\"" &2 exit /b %ERROR_TAP_CONFIGURE_SUBNET% ) :: Windows has no system-wide DNS server; each network device can have its :: "own" set of DNS servers. Windows seems to use the DNS server(s) of the :: network device associated with the default gateway. This is good for us :: as it means we do not have to modify the DNS settings of any other network :: device in the system. Configure with OpenDNS and Dyn resolvers. echo Configuring primary DNS... netsh interface ip set dnsservers %DEVICE_NAME% static address=%IP% if %errorlevel% neq 0 ( echo Could not configure TAP device primary DNS. >&2 exit /b %ERROR_TAP_CONFIGURE_DNS% ) echo Setting interface metric (1) for this interface... powershell "Set-NetIPInterface -InterfaceAlias \"%DEVICE_NAME%\" -InterfaceMetric 1" &2 exit /b 1 ) echo TAP network device added and configured successfully exit /b 0 :: Waits up to a minute until a device is visible to netsh. Accepts the device name as a parameter. :: Exits with a non-zero code if the operation times out. :wait_for_device echo Testing that the network device "%~1" is visible to netsh... netsh interface ip show interfaces | find "%~1" >nul 2>&1 if %errorlevel% equ 0 exit /b 0 for /l %%N in (1, 1, 6) do ( echo Waiting... %%N :: timeout doesn't like the environment created by nsExec::ExecToStack and exits with: :: "ERROR: Input redirection is not supported, exiting the process immediately." waitfor /t 10 thisisnotarealsignalname >nul 2>&1 netsh interface ip show interfaces | find "%~1" >nul 2>&1 if !errorlevel! equ 0 exit /b 0 ) exit /b 1 ================================================ FILE: app/clash_core/win32-arm64/static/files/win/common/tun2socks/amd64/OemVista.inf ================================================ ; **************************************************************************** ; * Copyright (C) 2002-2014 OpenVPN Technologies, Inc. * ; * This program is free software; you can redistribute it and/or modify * ; * it under the terms of the GNU General Public License version 2 * ; * as published by the Free Software Foundation. * ; **************************************************************************** ; SYNTAX CHECKER ; cd \WINDDK\3790\tools\chkinf ; chkinf c:\src\openvpn\tap-win32\i386\oemvista.inf ; OUTPUT -> file:///c:/WINDDK/3790/tools/chkinf/htm/c%23+src+openvpn+tap-win32+i386+__OemWin2k.htm ; INSTALL/REMOVE DRIVER ; tapinstall install OemVista.inf tapoas ; tapinstall update OemVista.inf tapoas ; tapinstall remove tapoas ;********************************************************* ; Note to Developers: ; ; If you are bundling the TAP-Windows driver with your app, ; you should try to rename it in such a way that it will ; not collide with other instances of TAP-Windows defined ; by other apps. Multiple versions of the TAP-Windows ; driver, each installed by different apps, can coexist ; on the same machine if you follow these guidelines. ; NOTE: these instructions assume you are editing the ; generated OemWin2k.inf file, not the source ; OemWin2k.inf.in file which is preprocessed by winconfig ; and uses macro definitions from settings.in. ; ; (1) Rename all tapXXXX instances in this file to ; something different (use at least 5 characters ; for this name!) ; (2) Change the "!define TAP" definition in openvpn.nsi ; to match what you changed tapXXXX to. ; (3) Change TARGETNAME in SOURCES to match what you ; changed tapXXXX to. ; (4) Change TAP_COMPONENT_ID in common.h to match what ; you changed tapXXXX to. ; (5) Change SZDEPENDENCIES in service.h to match what ; you changed tapXXXX to. ; (6) Change DeviceDescription and Provider strings. ; (7) Change PRODUCT_TAP_WIN_DEVICE_DESCRIPTION in constants.h to what you ; set DeviceDescription to. ; ;********************************************************* [Version] Signature = "$Windows NT$" CatalogFile = tap0901.cat ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318} Provider = %Provider% Class = Net ; This version number should match the version ; number given in ..\version.m4. DriverVer = 04/16/2019,9.23.1.601 [Strings] DeviceDescription = "TAP-Windows Adapter V9" Provider = "TAP-Windows Provider V9" ;---------------------------------------------------------------- ; Manufacturer + Product Section (Done) ;---------------------------------------------------------------- [Manufacturer] %Provider% = tap0901, NTamd64 [tap0901.NTamd64] %DeviceDescription% = tap0901.ndi, root\tap0901 ; Root enumerated %DeviceDescription% = tap0901.ndi, tap0901 ; Legacy ;--------------------------------------------------------------- ; Driver Section (Done) ;--------------------------------------------------------------- ;----------------- Characteristics ------------ ; NCF_PHYSICAL = 0x04 ; NCF_VIRTUAL = 0x01 ; NCF_SOFTWARE_ENUMERATED = 0x02 ; NCF_HIDDEN = 0x08 ; NCF_NO_SERVICE = 0x10 ; NCF_HAS_UI = 0x80 ;----------------- Characteristics ------------ [tap0901.ndi] CopyFiles = tap0901.driver, tap0901.files AddReg = tap0901.reg AddReg = tap0901.params.reg Characteristics = 0x81 *IfType = 0x6 ; IF_TYPE_ETHERNET_CSMACD *MediaType = 0x0 ; NdisMedium802_3 *PhysicalMediaType = 14 ; NdisPhysicalMedium802_3 [tap0901.ndi.Services] AddService = tap0901, 2, tap0901.service [tap0901.reg] HKR, Ndi, Service, 0, "tap0901" HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" HKR, Ndi\Interfaces, LowerRange, 0, "ethernet" HKR, , Manufacturer, 0, "%Provider%" HKR, , ProductName, 0, "%DeviceDescription%" [tap0901.params.reg] HKR, Ndi\params\MTU, ParamDesc, 0, "MTU" HKR, Ndi\params\MTU, Type, 0, "int" HKR, Ndi\params\MTU, Default, 0, "1500" HKR, Ndi\params\MTU, Optional, 0, "0" HKR, Ndi\params\MTU, Min, 0, "100" HKR, Ndi\params\MTU, Max, 0, "1500" HKR, Ndi\params\MTU, Step, 0, "1" HKR, Ndi\params\MediaStatus, ParamDesc, 0, "Media Status" HKR, Ndi\params\MediaStatus, Type, 0, "enum" HKR, Ndi\params\MediaStatus, Default, 0, "0" HKR, Ndi\params\MediaStatus, Optional, 0, "0" HKR, Ndi\params\MediaStatus\enum, "0", 0, "Application Controlled" HKR, Ndi\params\MediaStatus\enum, "1", 0, "Always Connected" HKR, Ndi\params\MAC, ParamDesc, 0, "MAC Address" HKR, Ndi\params\MAC, Type, 0, "edit" HKR, Ndi\params\MAC, Optional, 0, "1" HKR, Ndi\params\AllowNonAdmin, ParamDesc, 0, "Non-Admin Access" HKR, Ndi\params\AllowNonAdmin, Type, 0, "enum" HKR, Ndi\params\AllowNonAdmin, Default, 0, "1" HKR, Ndi\params\AllowNonAdmin, Optional, 0, "0" HKR, Ndi\params\AllowNonAdmin\enum, "0", 0, "Not Allowed" HKR, Ndi\params\AllowNonAdmin\enum, "1", 0, "Allowed" ;---------------------------------------------------------------- ; Service Section ;---------------------------------------------------------------- ;---------- Service Type ------------- ; SERVICE_KERNEL_DRIVER = 0x01 ; SERVICE_WIN32_OWN_PROCESS = 0x10 ;---------- Service Type ------------- ;---------- Start Mode --------------- ; SERVICE_BOOT_START = 0x0 ; SERVICE_SYSTEM_START = 0x1 ; SERVICE_AUTO_START = 0x2 ; SERVICE_DEMAND_START = 0x3 ; SERVICE_DISABLED = 0x4 ;---------- Start Mode --------------- [tap0901.service] DisplayName = %DeviceDescription% ServiceType = 1 StartType = 3 ErrorControl = 1 LoadOrderGroup = NDIS ServiceBinary = %12%\tap0901.sys ;----------------------------------------------------------------- ; File Installation ;----------------------------------------------------------------- ;----------------- Copy Flags ------------ ; COPYFLG_NOSKIP = 0x02 ; COPYFLG_NOVERSIONCHECK = 0x04 ;----------------- Copy Flags ------------ ; SourceDisksNames ; diskid = description[, [tagfile] [, , subdir]] ; 1 = "Intel Driver Disk 1",e100bex.sys,, [SourceDisksNames] 1 = %DeviceDescription%, tap0901.sys ; SourceDisksFiles ; filename_on_source = diskID[, [subdir][, size]] ; e100bex.sys = 1,, ; on distribution disk 1 [SourceDisksFiles] tap0901.sys = 1 [DestinationDirs] tap0901.files = 11 tap0901.driver = 12 [tap0901.files] ; TapPanel.cpl,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK ; cipsrvr.exe,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK [tap0901.driver] tap0901.sys,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK ;--------------------------------------------------------------- ; End ;--------------------------------------------------------------- ================================================ FILE: app/clash_core/win32-arm64/static/files/win/common/tun2socks/find_tap_device_name.bat ================================================ :: Copyright 2020 The Outline Authors :: :: Licensed under the Apache License, Version 2.0 (the "License"); :: you may not use this file except in compliance with the License. :: You may obtain a copy of the License at :: :: http://www.apache.org/licenses/LICENSE-2.0 :: :: Unless required by applicable law or agreed to in writing, software :: distributed under the License is distributed on an "AS IS" BASIS, :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. :: See the License for the specific language governing permissions and :: limitations under the License. :: Queries the registry in order to retrieve the most recently installed TAP network adapter's name. :: Accepts a single argument, the name of an environment variable to store the adapter's name. :: Exits with a non-zero exit code on failure. :: Usage example: find_tap_name.bat TAP_NAME @echo off :: See https://ss64.com/nt/delayedexpansion.html setlocal enabledelayedexpansion set NET_ADAPTERS_CLASS_GUID={4D36E972-E325-11CE-BFC1-08002BE10318} set NET_ADAPTERS_KEY=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\%NET_ADAPTERS_CLASS_GUID% set NET_CONFIG_KEY=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\%NET_ADAPTERS_CLASS_GUID% set NET_ADAPTERS_FILE="%tmp%\netadapters.txt" :: Find all network adapters that match the "tap0901" component ID and store their registry path in a file. :: Note that adapter keys are increasing four-digit integers, padded with leading zeros. reg query %NET_ADAPTERS_KEY% /s /f "tap0901" /e /d | findstr "HKEY.*\\[0-9][0-9][0-9][0-9]$" > %NET_ADAPTERS_FILE% if %errorlevel% neq 0 ( echo Could not find TAP network adapter in the registry. >&2 exit /b 1 ) set TIMESTAMP=0 set NAME= for /f "tokens=*" %%K in ('type "%NET_ADAPTERS_FILE%"') do ( set ADAPTER_NAME= set ADAPTER_NET_CONFIG_ID= set ADAPTER_TIMESTAMP= :: Retrieve the adapter's network config ID. set ADAPTER_KEY=%%K for /f "tokens=3" %%I in ('reg query !ADAPTER_KEY! /v "NetCfgInstanceId"') do ( set ADAPTER_NET_CONFIG_ID=%%I ) :: Retrieve the adapter's install timestamp. for /f "tokens=3" %%T in ('reg query !ADAPTER_KEY! /v "InstallTimeStamp"') do ( set ADAPTER_TIMESTAMP=%%T ) :: Retrieve the adapter's name. set ADAPTER_CONFIG_KEY=!NET_CONFIG_KEY!\!ADAPTER_NET_CONFIG_ID!\Connection for /f "tokens=3*" %%N in ('reg query !ADAPTER_CONFIG_KEY! /v "Name"') do ( :: If the name contains spaces our tokenization will store the rest of the name in %%O. if [%%O] == [] ( set ADAPTER_NAME=%%N ) else ( set ADAPTER_NAME=%%N %%O ) ) :: Ensure we found the adapter's install timestamp and name. if not [!ADAPTER_TIMESTAMP!] == [] ( if not [!ADAPTER_NAME!] == [] ( echo Found adapter "!ADAPTER_NAME!", !ADAPTER_TIMESTAMP! :: Store the adapter's name if it's the most recently installed one. if !ADAPTER_TIMESTAMP! gtr !TIMESTAMP! ( set TIMESTAMP=!ADAPTER_TIMESTAMP! set NAME=!ADAPTER_NAME! ) ) else ( echo Failed to retrieve name of adapter !ADAPTER_KEY! >&2 ) ) else ( echo Failed to retrieve install timestamp of adapter !ADAPTER_KEY! >&2 ) ) if [!NAME!] == [] ( echo Could not find TAP adapter name. >&2 exit /b 1 ) echo TAP device name: "!NAME!" endlocal & set "%1=%NAME%" exit /b 0 ================================================ FILE: app/clash_core/win32-arm64/static/files/win/common/tun2socks/i386/OemVista.inf ================================================ ; **************************************************************************** ; * Copyright (C) 2002-2014 OpenVPN Technologies, Inc. * ; * This program is free software; you can redistribute it and/or modify * ; * it under the terms of the GNU General Public License version 2 * ; * as published by the Free Software Foundation. * ; **************************************************************************** ; SYNTAX CHECKER ; cd \WINDDK\3790\tools\chkinf ; chkinf c:\src\openvpn\tap-win32\i386\oemvista.inf ; OUTPUT -> file:///c:/WINDDK/3790/tools/chkinf/htm/c%23+src+openvpn+tap-win32+i386+__OemWin2k.htm ; INSTALL/REMOVE DRIVER ; tapinstall install OemVista.inf tapoas ; tapinstall update OemVista.inf tapoas ; tapinstall remove tapoas ;********************************************************* ; Note to Developers: ; ; If you are bundling the TAP-Windows driver with your app, ; you should try to rename it in such a way that it will ; not collide with other instances of TAP-Windows defined ; by other apps. Multiple versions of the TAP-Windows ; driver, each installed by different apps, can coexist ; on the same machine if you follow these guidelines. ; NOTE: these instructions assume you are editing the ; generated OemWin2k.inf file, not the source ; OemWin2k.inf.in file which is preprocessed by winconfig ; and uses macro definitions from settings.in. ; ; (1) Rename all tapXXXX instances in this file to ; something different (use at least 5 characters ; for this name!) ; (2) Change the "!define TAP" definition in openvpn.nsi ; to match what you changed tapXXXX to. ; (3) Change TARGETNAME in SOURCES to match what you ; changed tapXXXX to. ; (4) Change TAP_COMPONENT_ID in common.h to match what ; you changed tapXXXX to. ; (5) Change SZDEPENDENCIES in service.h to match what ; you changed tapXXXX to. ; (6) Change DeviceDescription and Provider strings. ; (7) Change PRODUCT_TAP_WIN_DEVICE_DESCRIPTION in constants.h to what you ; set DeviceDescription to. ; ;********************************************************* [Version] Signature = "$Windows NT$" CatalogFile = tap0901.cat ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318} Provider = %Provider% Class = Net ; This version number should match the version ; number given in SOURCES. DriverVer=04/21/2016,9.00.00.21 [Strings] DeviceDescription = "TAP-Windows Adapter V9" Provider = "TAP-Windows Provider V9" ;---------------------------------------------------------------- ; Manufacturer + Product Section (Done) ;---------------------------------------------------------------- [Manufacturer] %Provider% = tap0901 [tap0901] %DeviceDescription% = tap0901.ndi, root\tap0901 ; Root enumerated %DeviceDescription% = tap0901.ndi, tap0901 ; Legacy ;--------------------------------------------------------------- ; Driver Section (Done) ;--------------------------------------------------------------- ;----------------- Characteristics ------------ ; NCF_PHYSICAL = 0x04 ; NCF_VIRTUAL = 0x01 ; NCF_SOFTWARE_ENUMERATED = 0x02 ; NCF_HIDDEN = 0x08 ; NCF_NO_SERVICE = 0x10 ; NCF_HAS_UI = 0x80 ;----------------- Characteristics ------------ [tap0901.ndi] CopyFiles = tap0901.driver, tap0901.files AddReg = tap0901.reg AddReg = tap0901.params.reg Characteristics = *IfType = 0x6 ; IF_TYPE_ETHERNET_CSMACD *MediaType = 0x0 ; NdisMedium802_3 *PhysicalMediaType = 14 ; NdisPhysicalMedium802_3 [tap0901.ndi.Services] AddService = tap0901, 2, tap0901.service [tap0901.reg] HKR, Ndi, Service, 0, "tap0901" HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" HKR, Ndi\Interfaces, LowerRange, 0, "ethernet" HKR, , Manufacturer, 0, "%Provider%" HKR, , ProductName, 0, "%DeviceDescription%" [tap0901.params.reg] HKR, Ndi\params\MTU, ParamDesc, 0, "MTU" HKR, Ndi\params\MTU, Type, 0, "int" HKR, Ndi\params\MTU, Default, 0, "1500" HKR, Ndi\params\MTU, Optional, 0, "0" HKR, Ndi\params\MTU, Min, 0, "100" HKR, Ndi\params\MTU, Max, 0, "1500" HKR, Ndi\params\MTU, Step, 0, "1" HKR, Ndi\params\MediaStatus, ParamDesc, 0, "Media Status" HKR, Ndi\params\MediaStatus, Type, 0, "enum" HKR, Ndi\params\MediaStatus, Default, 0, "0" HKR, Ndi\params\MediaStatus, Optional, 0, "0" HKR, Ndi\params\MediaStatus\enum, "0", 0, "Application Controlled" HKR, Ndi\params\MediaStatus\enum, "1", 0, "Always Connected" HKR, Ndi\params\MAC, ParamDesc, 0, "MAC Address" HKR, Ndi\params\MAC, Type, 0, "edit" HKR, Ndi\params\MAC, Optional, 0, "1" HKR, Ndi\params\AllowNonAdmin, ParamDesc, 0, "Non-Admin Access" HKR, Ndi\params\AllowNonAdmin, Type, 0, "enum" HKR, Ndi\params\AllowNonAdmin, Default, 0, "1" HKR, Ndi\params\AllowNonAdmin, Optional, 0, "0" HKR, Ndi\params\AllowNonAdmin\enum, "0", 0, "Not Allowed" HKR, Ndi\params\AllowNonAdmin\enum, "1", 0, "Allowed" ;---------------------------------------------------------------- ; Service Section ;---------------------------------------------------------------- ;---------- Service Type ------------- ; SERVICE_KERNEL_DRIVER = 0x01 ; SERVICE_WIN32_OWN_PROCESS = 0x10 ;---------- Service Type ------------- ;---------- Start Mode --------------- ; SERVICE_BOOT_START = 0x0 ; SERVICE_SYSTEM_START = 0x1 ; SERVICE_AUTO_START = 0x2 ; SERVICE_DEMAND_START = 0x3 ; SERVICE_DISABLED = 0x4 ;---------- Start Mode --------------- [tap0901.service] DisplayName = %DeviceDescription% ServiceType = 1 StartType = 3 ErrorControl = 1 LoadOrderGroup = NDIS ServiceBinary = %12%\tap0901.sys ;----------------------------------------------------------------- ; File Installation ;----------------------------------------------------------------- ;----------------- Copy Flags ------------ ; COPYFLG_NOSKIP = 0x02 ; COPYFLG_NOVERSIONCHECK = 0x04 ;----------------- Copy Flags ------------ ; SourceDisksNames ; diskid = description[, [tagfile] [, , subdir]] ; 1 = "Intel Driver Disk 1",e100bex.sys,, [SourceDisksNames] 1 = %DeviceDescription%, tap0901.sys ; SourceDisksFiles ; filename_on_source = diskID[, [subdir][, size]] ; e100bex.sys = 1,, ; on distribution disk 1 [SourceDisksFiles] tap0901.sys = 1 [DestinationDirs] tap0901.files = 11 tap0901.driver = 12 [tap0901.files] ; TapPanel.cpl,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK ; cipsrvr.exe,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK [tap0901.driver] tap0901.sys,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK ;--------------------------------------------------------------- ; End ;--------------------------------------------------------------- ================================================ FILE: app/clash_core/win32-arm64/static/files/win/common/tun2socks/remove_tap_device.bat ================================================ @echo off setlocal set DEVICE_NAME=cfw-tap set DEVICE_HWID=tap0901 set SCRIPT_DIR=%~dp0 set ARCH=%1 set PATH=%PATH%;%SystemRoot%\system32;%SystemRoot%\system32\wbem;%SystemRoot%\system32\WindowsPowerShell/v1.0 echo Removing old TAP network device... "%SCRIPT_DIR%\%ARCH%\tapinstall" remove %DEVICE_HWID% if %errorlevel% neq 0 ( echo Could not remove TAP network device. >&2 exit /b 1 ) ================================================ FILE: app/clash_core/win32-ia32/static/files/win/common/schtasks.xml ================================================ true StopExisting false false false true false true false true true false false false PT0S 7 PT1M 5 "" ================================================ FILE: app/clash_core/win32-ia32/static/files/win/common/service.yml ================================================ id: Clash Core Service name: Clash Core Service description: Clash Core Service started by Clash for Windows executable: clash-core-service log: mode: none ================================================ FILE: app/clash_core/win32-ia32/static/files/win/common/tun2socks/add_tap_device.bat ================================================ :: Copyright 2018 The Outline Authors :: :: Licensed under the Apache License, Version 2.0 (the "License"); :: you may not use this file except in compliance with the License. :: You may obtain a copy of the License at :: :: http://www.apache.org/licenses/LICENSE-2.0 :: :: Unless required by applicable law or agreed to in writing, software :: distributed under the License is distributed on an "AS IS" BASIS, :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. :: See the License for the specific language governing permissions and :: limitations under the License. @echo off :: See https://ss64.com/nt/delayedexpansion.html setlocal enabledelayedexpansion set DEVICE_NAME=cfw-tap set DEVICE_HWID=tap0901 set SCRIPT_DIR=%~dp0 set ARCH=%1 set IP=%2 set SUBNET=%3 set GATEWAY=%4 :: Error codes for surfacing to the user and sentry. set ERROR_TAP_INSTALL=1 set ERROR_TAP_FIND_NAME=2 set ERROR_TAP_RENAME=3 set ERROR_TAP_CONFIGURE_SUBNET=4 set ERROR_TAP_CONFIGURE_DNS=5 :: Because we've seen multiple failures due to commands (netsh, etc.) not being :: found, append some common directories to the PATH. :: :: Note: :: - %SystemRoot% almost always expands to c:\windows. :: - Do *not* surround with quotes. set PATH=%PATH%;%SystemRoot%\system32;%SystemRoot%\system32\wbem;%SystemRoot%\system32\WindowsPowerShell/v1.0 :: Check whether the device already exists. netsh interface show interface name=%DEVICE_NAME% if %errorlevel% equ 0 ( echo TAP network device already exists. goto :configure ) echo Creating TAP network device... "%SCRIPT_DIR%\%ARCH%\tapinstall" install "%SCRIPT_DIR%\%ARCH%\OemVista.inf" %DEVICE_HWID% if %errorlevel% neq 0 ( echo Could not create TAP network device. Try to do it manually. >&2 REM exit /b %ERROR_TAP_INSTALL% start /wait /D "%SCRIPT_DIR%" tap-windows-installer.exe ) :: Find the name of the most recently installed TAP device in the registry and rename it. echo Searching for new TAP network device name... call "%SCRIPT_DIR%\find_tap_device_name.bat" TAP_NAME if %errorlevel% neq 0 ( echo Could not find TAP device name. >&2 exit /b %ERROR_TAP_FIND_NAME% ) echo Found TAP device name: "%TAP_NAME%" :: We've occasionally seen delays before netsh will "see" the new device, at least for :: purposes of configuring IP and DNS ("netsh interface show interface name=xxx" does not :: seem to be affected). call :wait_for_device "%TAP_NAME%" :: Attempt to rename the device even if waiting timed out. netsh interface set interface name="%TAP_NAME%" newname="%DEVICE_NAME%" if %errorlevel% neq 0 ( :: Try to rename the device through powershell in case netsh failed due to not being able to "see" :: the device. Pipe input from /dev/null to prevent powershell from waiting forever on EOF. powershell "Rename-NetAdapter -Name \"%TAP_NAME%\" -NewName \"%DEVICE_NAME%\"" &2 exit /b %ERROR_TAP_RENAME% ) ) :: Wait for the new name to propagate to netsh. call :wait_for_device "%DEVICE_NAME%" :: Attempt to configure the device even if waiting timed out. :configure :: Try to enable the device, in case it's somehow been disabled. :: :: Annoyingly, this returns an error and outputs a confusing message if the device exists and is :: already enabled: :: This network connection does not exist. :: :: So, continue even if this command fails - and always include its output. echo (Re-)enabling TAP network device... netsh interface set interface "%DEVICE_NAME%" admin=enabled :: The powershell command is used to ensure the adapter is enabled if netsh fails and leaves it in :: a disabled state. While no such failure has yet been observed, this command would correct it and :: should behave idempotently otherwise. powershell "Enable-NetAdapter -Name \"%DEVICE_NAME%\"" &2 exit /b %ERROR_TAP_CONFIGURE_SUBNET% ) :: Windows has no system-wide DNS server; each network device can have its :: "own" set of DNS servers. Windows seems to use the DNS server(s) of the :: network device associated with the default gateway. This is good for us :: as it means we do not have to modify the DNS settings of any other network :: device in the system. Configure with OpenDNS and Dyn resolvers. echo Configuring primary DNS... netsh interface ip set dnsservers %DEVICE_NAME% static address=%IP% if %errorlevel% neq 0 ( echo Could not configure TAP device primary DNS. >&2 exit /b %ERROR_TAP_CONFIGURE_DNS% ) echo Setting interface metric (1) for this interface... powershell "Set-NetIPInterface -InterfaceAlias \"%DEVICE_NAME%\" -InterfaceMetric 1" &2 exit /b 1 ) echo TAP network device added and configured successfully exit /b 0 :: Waits up to a minute until a device is visible to netsh. Accepts the device name as a parameter. :: Exits with a non-zero code if the operation times out. :wait_for_device echo Testing that the network device "%~1" is visible to netsh... netsh interface ip show interfaces | find "%~1" >nul 2>&1 if %errorlevel% equ 0 exit /b 0 for /l %%N in (1, 1, 6) do ( echo Waiting... %%N :: timeout doesn't like the environment created by nsExec::ExecToStack and exits with: :: "ERROR: Input redirection is not supported, exiting the process immediately." waitfor /t 10 thisisnotarealsignalname >nul 2>&1 netsh interface ip show interfaces | find "%~1" >nul 2>&1 if !errorlevel! equ 0 exit /b 0 ) exit /b 1 ================================================ FILE: app/clash_core/win32-ia32/static/files/win/common/tun2socks/amd64/OemVista.inf ================================================ ; **************************************************************************** ; * Copyright (C) 2002-2014 OpenVPN Technologies, Inc. * ; * This program is free software; you can redistribute it and/or modify * ; * it under the terms of the GNU General Public License version 2 * ; * as published by the Free Software Foundation. * ; **************************************************************************** ; SYNTAX CHECKER ; cd \WINDDK\3790\tools\chkinf ; chkinf c:\src\openvpn\tap-win32\i386\oemvista.inf ; OUTPUT -> file:///c:/WINDDK/3790/tools/chkinf/htm/c%23+src+openvpn+tap-win32+i386+__OemWin2k.htm ; INSTALL/REMOVE DRIVER ; tapinstall install OemVista.inf tapoas ; tapinstall update OemVista.inf tapoas ; tapinstall remove tapoas ;********************************************************* ; Note to Developers: ; ; If you are bundling the TAP-Windows driver with your app, ; you should try to rename it in such a way that it will ; not collide with other instances of TAP-Windows defined ; by other apps. Multiple versions of the TAP-Windows ; driver, each installed by different apps, can coexist ; on the same machine if you follow these guidelines. ; NOTE: these instructions assume you are editing the ; generated OemWin2k.inf file, not the source ; OemWin2k.inf.in file which is preprocessed by winconfig ; and uses macro definitions from settings.in. ; ; (1) Rename all tapXXXX instances in this file to ; something different (use at least 5 characters ; for this name!) ; (2) Change the "!define TAP" definition in openvpn.nsi ; to match what you changed tapXXXX to. ; (3) Change TARGETNAME in SOURCES to match what you ; changed tapXXXX to. ; (4) Change TAP_COMPONENT_ID in common.h to match what ; you changed tapXXXX to. ; (5) Change SZDEPENDENCIES in service.h to match what ; you changed tapXXXX to. ; (6) Change DeviceDescription and Provider strings. ; (7) Change PRODUCT_TAP_WIN_DEVICE_DESCRIPTION in constants.h to what you ; set DeviceDescription to. ; ;********************************************************* [Version] Signature = "$Windows NT$" CatalogFile = tap0901.cat ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318} Provider = %Provider% Class = Net ; This version number should match the version ; number given in ..\version.m4. DriverVer = 04/16/2019,9.23.1.601 [Strings] DeviceDescription = "TAP-Windows Adapter V9" Provider = "TAP-Windows Provider V9" ;---------------------------------------------------------------- ; Manufacturer + Product Section (Done) ;---------------------------------------------------------------- [Manufacturer] %Provider% = tap0901, NTamd64 [tap0901.NTamd64] %DeviceDescription% = tap0901.ndi, root\tap0901 ; Root enumerated %DeviceDescription% = tap0901.ndi, tap0901 ; Legacy ;--------------------------------------------------------------- ; Driver Section (Done) ;--------------------------------------------------------------- ;----------------- Characteristics ------------ ; NCF_PHYSICAL = 0x04 ; NCF_VIRTUAL = 0x01 ; NCF_SOFTWARE_ENUMERATED = 0x02 ; NCF_HIDDEN = 0x08 ; NCF_NO_SERVICE = 0x10 ; NCF_HAS_UI = 0x80 ;----------------- Characteristics ------------ [tap0901.ndi] CopyFiles = tap0901.driver, tap0901.files AddReg = tap0901.reg AddReg = tap0901.params.reg Characteristics = 0x81 *IfType = 0x6 ; IF_TYPE_ETHERNET_CSMACD *MediaType = 0x0 ; NdisMedium802_3 *PhysicalMediaType = 14 ; NdisPhysicalMedium802_3 [tap0901.ndi.Services] AddService = tap0901, 2, tap0901.service [tap0901.reg] HKR, Ndi, Service, 0, "tap0901" HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" HKR, Ndi\Interfaces, LowerRange, 0, "ethernet" HKR, , Manufacturer, 0, "%Provider%" HKR, , ProductName, 0, "%DeviceDescription%" [tap0901.params.reg] HKR, Ndi\params\MTU, ParamDesc, 0, "MTU" HKR, Ndi\params\MTU, Type, 0, "int" HKR, Ndi\params\MTU, Default, 0, "1500" HKR, Ndi\params\MTU, Optional, 0, "0" HKR, Ndi\params\MTU, Min, 0, "100" HKR, Ndi\params\MTU, Max, 0, "1500" HKR, Ndi\params\MTU, Step, 0, "1" HKR, Ndi\params\MediaStatus, ParamDesc, 0, "Media Status" HKR, Ndi\params\MediaStatus, Type, 0, "enum" HKR, Ndi\params\MediaStatus, Default, 0, "0" HKR, Ndi\params\MediaStatus, Optional, 0, "0" HKR, Ndi\params\MediaStatus\enum, "0", 0, "Application Controlled" HKR, Ndi\params\MediaStatus\enum, "1", 0, "Always Connected" HKR, Ndi\params\MAC, ParamDesc, 0, "MAC Address" HKR, Ndi\params\MAC, Type, 0, "edit" HKR, Ndi\params\MAC, Optional, 0, "1" HKR, Ndi\params\AllowNonAdmin, ParamDesc, 0, "Non-Admin Access" HKR, Ndi\params\AllowNonAdmin, Type, 0, "enum" HKR, Ndi\params\AllowNonAdmin, Default, 0, "1" HKR, Ndi\params\AllowNonAdmin, Optional, 0, "0" HKR, Ndi\params\AllowNonAdmin\enum, "0", 0, "Not Allowed" HKR, Ndi\params\AllowNonAdmin\enum, "1", 0, "Allowed" ;---------------------------------------------------------------- ; Service Section ;---------------------------------------------------------------- ;---------- Service Type ------------- ; SERVICE_KERNEL_DRIVER = 0x01 ; SERVICE_WIN32_OWN_PROCESS = 0x10 ;---------- Service Type ------------- ;---------- Start Mode --------------- ; SERVICE_BOOT_START = 0x0 ; SERVICE_SYSTEM_START = 0x1 ; SERVICE_AUTO_START = 0x2 ; SERVICE_DEMAND_START = 0x3 ; SERVICE_DISABLED = 0x4 ;---------- Start Mode --------------- [tap0901.service] DisplayName = %DeviceDescription% ServiceType = 1 StartType = 3 ErrorControl = 1 LoadOrderGroup = NDIS ServiceBinary = %12%\tap0901.sys ;----------------------------------------------------------------- ; File Installation ;----------------------------------------------------------------- ;----------------- Copy Flags ------------ ; COPYFLG_NOSKIP = 0x02 ; COPYFLG_NOVERSIONCHECK = 0x04 ;----------------- Copy Flags ------------ ; SourceDisksNames ; diskid = description[, [tagfile] [, , subdir]] ; 1 = "Intel Driver Disk 1",e100bex.sys,, [SourceDisksNames] 1 = %DeviceDescription%, tap0901.sys ; SourceDisksFiles ; filename_on_source = diskID[, [subdir][, size]] ; e100bex.sys = 1,, ; on distribution disk 1 [SourceDisksFiles] tap0901.sys = 1 [DestinationDirs] tap0901.files = 11 tap0901.driver = 12 [tap0901.files] ; TapPanel.cpl,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK ; cipsrvr.exe,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK [tap0901.driver] tap0901.sys,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK ;--------------------------------------------------------------- ; End ;--------------------------------------------------------------- ================================================ FILE: app/clash_core/win32-ia32/static/files/win/common/tun2socks/find_tap_device_name.bat ================================================ :: Copyright 2020 The Outline Authors :: :: Licensed under the Apache License, Version 2.0 (the "License"); :: you may not use this file except in compliance with the License. :: You may obtain a copy of the License at :: :: http://www.apache.org/licenses/LICENSE-2.0 :: :: Unless required by applicable law or agreed to in writing, software :: distributed under the License is distributed on an "AS IS" BASIS, :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. :: See the License for the specific language governing permissions and :: limitations under the License. :: Queries the registry in order to retrieve the most recently installed TAP network adapter's name. :: Accepts a single argument, the name of an environment variable to store the adapter's name. :: Exits with a non-zero exit code on failure. :: Usage example: find_tap_name.bat TAP_NAME @echo off :: See https://ss64.com/nt/delayedexpansion.html setlocal enabledelayedexpansion set NET_ADAPTERS_CLASS_GUID={4D36E972-E325-11CE-BFC1-08002BE10318} set NET_ADAPTERS_KEY=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\%NET_ADAPTERS_CLASS_GUID% set NET_CONFIG_KEY=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\%NET_ADAPTERS_CLASS_GUID% set NET_ADAPTERS_FILE="%tmp%\netadapters.txt" :: Find all network adapters that match the "tap0901" component ID and store their registry path in a file. :: Note that adapter keys are increasing four-digit integers, padded with leading zeros. reg query %NET_ADAPTERS_KEY% /s /f "tap0901" /e /d | findstr "HKEY.*\\[0-9][0-9][0-9][0-9]$" > %NET_ADAPTERS_FILE% if %errorlevel% neq 0 ( echo Could not find TAP network adapter in the registry. >&2 exit /b 1 ) set TIMESTAMP=0 set NAME= for /f "tokens=*" %%K in ('type "%NET_ADAPTERS_FILE%"') do ( set ADAPTER_NAME= set ADAPTER_NET_CONFIG_ID= set ADAPTER_TIMESTAMP= :: Retrieve the adapter's network config ID. set ADAPTER_KEY=%%K for /f "tokens=3" %%I in ('reg query !ADAPTER_KEY! /v "NetCfgInstanceId"') do ( set ADAPTER_NET_CONFIG_ID=%%I ) :: Retrieve the adapter's install timestamp. for /f "tokens=3" %%T in ('reg query !ADAPTER_KEY! /v "InstallTimeStamp"') do ( set ADAPTER_TIMESTAMP=%%T ) :: Retrieve the adapter's name. set ADAPTER_CONFIG_KEY=!NET_CONFIG_KEY!\!ADAPTER_NET_CONFIG_ID!\Connection for /f "tokens=3*" %%N in ('reg query !ADAPTER_CONFIG_KEY! /v "Name"') do ( :: If the name contains spaces our tokenization will store the rest of the name in %%O. if [%%O] == [] ( set ADAPTER_NAME=%%N ) else ( set ADAPTER_NAME=%%N %%O ) ) :: Ensure we found the adapter's install timestamp and name. if not [!ADAPTER_TIMESTAMP!] == [] ( if not [!ADAPTER_NAME!] == [] ( echo Found adapter "!ADAPTER_NAME!", !ADAPTER_TIMESTAMP! :: Store the adapter's name if it's the most recently installed one. if !ADAPTER_TIMESTAMP! gtr !TIMESTAMP! ( set TIMESTAMP=!ADAPTER_TIMESTAMP! set NAME=!ADAPTER_NAME! ) ) else ( echo Failed to retrieve name of adapter !ADAPTER_KEY! >&2 ) ) else ( echo Failed to retrieve install timestamp of adapter !ADAPTER_KEY! >&2 ) ) if [!NAME!] == [] ( echo Could not find TAP adapter name. >&2 exit /b 1 ) echo TAP device name: "!NAME!" endlocal & set "%1=%NAME%" exit /b 0 ================================================ FILE: app/clash_core/win32-ia32/static/files/win/common/tun2socks/i386/OemVista.inf ================================================ ; **************************************************************************** ; * Copyright (C) 2002-2014 OpenVPN Technologies, Inc. * ; * This program is free software; you can redistribute it and/or modify * ; * it under the terms of the GNU General Public License version 2 * ; * as published by the Free Software Foundation. * ; **************************************************************************** ; SYNTAX CHECKER ; cd \WINDDK\3790\tools\chkinf ; chkinf c:\src\openvpn\tap-win32\i386\oemvista.inf ; OUTPUT -> file:///c:/WINDDK/3790/tools/chkinf/htm/c%23+src+openvpn+tap-win32+i386+__OemWin2k.htm ; INSTALL/REMOVE DRIVER ; tapinstall install OemVista.inf tapoas ; tapinstall update OemVista.inf tapoas ; tapinstall remove tapoas ;********************************************************* ; Note to Developers: ; ; If you are bundling the TAP-Windows driver with your app, ; you should try to rename it in such a way that it will ; not collide with other instances of TAP-Windows defined ; by other apps. Multiple versions of the TAP-Windows ; driver, each installed by different apps, can coexist ; on the same machine if you follow these guidelines. ; NOTE: these instructions assume you are editing the ; generated OemWin2k.inf file, not the source ; OemWin2k.inf.in file which is preprocessed by winconfig ; and uses macro definitions from settings.in. ; ; (1) Rename all tapXXXX instances in this file to ; something different (use at least 5 characters ; for this name!) ; (2) Change the "!define TAP" definition in openvpn.nsi ; to match what you changed tapXXXX to. ; (3) Change TARGETNAME in SOURCES to match what you ; changed tapXXXX to. ; (4) Change TAP_COMPONENT_ID in common.h to match what ; you changed tapXXXX to. ; (5) Change SZDEPENDENCIES in service.h to match what ; you changed tapXXXX to. ; (6) Change DeviceDescription and Provider strings. ; (7) Change PRODUCT_TAP_WIN_DEVICE_DESCRIPTION in constants.h to what you ; set DeviceDescription to. ; ;********************************************************* [Version] Signature = "$Windows NT$" CatalogFile = tap0901.cat ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318} Provider = %Provider% Class = Net ; This version number should match the version ; number given in SOURCES. DriverVer=04/21/2016,9.00.00.21 [Strings] DeviceDescription = "TAP-Windows Adapter V9" Provider = "TAP-Windows Provider V9" ;---------------------------------------------------------------- ; Manufacturer + Product Section (Done) ;---------------------------------------------------------------- [Manufacturer] %Provider% = tap0901 [tap0901] %DeviceDescription% = tap0901.ndi, root\tap0901 ; Root enumerated %DeviceDescription% = tap0901.ndi, tap0901 ; Legacy ;--------------------------------------------------------------- ; Driver Section (Done) ;--------------------------------------------------------------- ;----------------- Characteristics ------------ ; NCF_PHYSICAL = 0x04 ; NCF_VIRTUAL = 0x01 ; NCF_SOFTWARE_ENUMERATED = 0x02 ; NCF_HIDDEN = 0x08 ; NCF_NO_SERVICE = 0x10 ; NCF_HAS_UI = 0x80 ;----------------- Characteristics ------------ [tap0901.ndi] CopyFiles = tap0901.driver, tap0901.files AddReg = tap0901.reg AddReg = tap0901.params.reg Characteristics = *IfType = 0x6 ; IF_TYPE_ETHERNET_CSMACD *MediaType = 0x0 ; NdisMedium802_3 *PhysicalMediaType = 14 ; NdisPhysicalMedium802_3 [tap0901.ndi.Services] AddService = tap0901, 2, tap0901.service [tap0901.reg] HKR, Ndi, Service, 0, "tap0901" HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" HKR, Ndi\Interfaces, LowerRange, 0, "ethernet" HKR, , Manufacturer, 0, "%Provider%" HKR, , ProductName, 0, "%DeviceDescription%" [tap0901.params.reg] HKR, Ndi\params\MTU, ParamDesc, 0, "MTU" HKR, Ndi\params\MTU, Type, 0, "int" HKR, Ndi\params\MTU, Default, 0, "1500" HKR, Ndi\params\MTU, Optional, 0, "0" HKR, Ndi\params\MTU, Min, 0, "100" HKR, Ndi\params\MTU, Max, 0, "1500" HKR, Ndi\params\MTU, Step, 0, "1" HKR, Ndi\params\MediaStatus, ParamDesc, 0, "Media Status" HKR, Ndi\params\MediaStatus, Type, 0, "enum" HKR, Ndi\params\MediaStatus, Default, 0, "0" HKR, Ndi\params\MediaStatus, Optional, 0, "0" HKR, Ndi\params\MediaStatus\enum, "0", 0, "Application Controlled" HKR, Ndi\params\MediaStatus\enum, "1", 0, "Always Connected" HKR, Ndi\params\MAC, ParamDesc, 0, "MAC Address" HKR, Ndi\params\MAC, Type, 0, "edit" HKR, Ndi\params\MAC, Optional, 0, "1" HKR, Ndi\params\AllowNonAdmin, ParamDesc, 0, "Non-Admin Access" HKR, Ndi\params\AllowNonAdmin, Type, 0, "enum" HKR, Ndi\params\AllowNonAdmin, Default, 0, "1" HKR, Ndi\params\AllowNonAdmin, Optional, 0, "0" HKR, Ndi\params\AllowNonAdmin\enum, "0", 0, "Not Allowed" HKR, Ndi\params\AllowNonAdmin\enum, "1", 0, "Allowed" ;---------------------------------------------------------------- ; Service Section ;---------------------------------------------------------------- ;---------- Service Type ------------- ; SERVICE_KERNEL_DRIVER = 0x01 ; SERVICE_WIN32_OWN_PROCESS = 0x10 ;---------- Service Type ------------- ;---------- Start Mode --------------- ; SERVICE_BOOT_START = 0x0 ; SERVICE_SYSTEM_START = 0x1 ; SERVICE_AUTO_START = 0x2 ; SERVICE_DEMAND_START = 0x3 ; SERVICE_DISABLED = 0x4 ;---------- Start Mode --------------- [tap0901.service] DisplayName = %DeviceDescription% ServiceType = 1 StartType = 3 ErrorControl = 1 LoadOrderGroup = NDIS ServiceBinary = %12%\tap0901.sys ;----------------------------------------------------------------- ; File Installation ;----------------------------------------------------------------- ;----------------- Copy Flags ------------ ; COPYFLG_NOSKIP = 0x02 ; COPYFLG_NOVERSIONCHECK = 0x04 ;----------------- Copy Flags ------------ ; SourceDisksNames ; diskid = description[, [tagfile] [, , subdir]] ; 1 = "Intel Driver Disk 1",e100bex.sys,, [SourceDisksNames] 1 = %DeviceDescription%, tap0901.sys ; SourceDisksFiles ; filename_on_source = diskID[, [subdir][, size]] ; e100bex.sys = 1,, ; on distribution disk 1 [SourceDisksFiles] tap0901.sys = 1 [DestinationDirs] tap0901.files = 11 tap0901.driver = 12 [tap0901.files] ; TapPanel.cpl,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK ; cipsrvr.exe,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK [tap0901.driver] tap0901.sys,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK ;--------------------------------------------------------------- ; End ;--------------------------------------------------------------- ================================================ FILE: app/clash_core/win32-ia32/static/files/win/common/tun2socks/remove_tap_device.bat ================================================ @echo off setlocal set DEVICE_NAME=cfw-tap set DEVICE_HWID=tap0901 set SCRIPT_DIR=%~dp0 set ARCH=%1 set PATH=%PATH%;%SystemRoot%\system32;%SystemRoot%\system32\wbem;%SystemRoot%\system32\WindowsPowerShell/v1.0 echo Removing old TAP network device... "%SCRIPT_DIR%\%ARCH%\tapinstall" remove %DEVICE_HWID% if %errorlevel% neq 0 ( echo Could not remove TAP network device. >&2 exit /b 1 ) ================================================ FILE: app/clash_core/win32-ia32/static/files/win/ia32/clash-win32.exe.sign ================================================ 3VaQI4a8c85DFudDHL1gSc6TUm49Hf9TxMf337ImoDXvTDwOf/XngT1FyzatFgZ+h1FBT5uEqlJFcAKKkVvY1w== ================================================ FILE: app/clash_core/win_x64/static/files/win/common/schtasks.xml ================================================ true StopExisting false false false true false true false true true false false false PT0S 7 PT1M 5 "" ================================================ FILE: app/clash_core/win_x64/static/files/win/common/service.yml ================================================ id: Clash Core Service name: Clash Core Service description: Clash Core Service started by Clash for Windows executable: clash-core-service log: mode: none ================================================ FILE: app/clash_core/win_x64/static/files/win/common/tun2socks/add_tap_device.bat ================================================ :: Copyright 2018 The Outline Authors :: :: Licensed under the Apache License, Version 2.0 (the "License"); :: you may not use this file except in compliance with the License. :: You may obtain a copy of the License at :: :: http://www.apache.org/licenses/LICENSE-2.0 :: :: Unless required by applicable law or agreed to in writing, software :: distributed under the License is distributed on an "AS IS" BASIS, :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. :: See the License for the specific language governing permissions and :: limitations under the License. @echo off :: See https://ss64.com/nt/delayedexpansion.html setlocal enabledelayedexpansion set DEVICE_NAME=cfw-tap set DEVICE_HWID=tap0901 set SCRIPT_DIR=%~dp0 set ARCH=%1 set IP=%2 set SUBNET=%3 set GATEWAY=%4 :: Error codes for surfacing to the user and sentry. set ERROR_TAP_INSTALL=1 set ERROR_TAP_FIND_NAME=2 set ERROR_TAP_RENAME=3 set ERROR_TAP_CONFIGURE_SUBNET=4 set ERROR_TAP_CONFIGURE_DNS=5 :: Because we've seen multiple failures due to commands (netsh, etc.) not being :: found, append some common directories to the PATH. :: :: Note: :: - %SystemRoot% almost always expands to c:\windows. :: - Do *not* surround with quotes. set PATH=%PATH%;%SystemRoot%\system32;%SystemRoot%\system32\wbem;%SystemRoot%\system32\WindowsPowerShell/v1.0 :: Check whether the device already exists. netsh interface show interface name=%DEVICE_NAME% if %errorlevel% equ 0 ( echo TAP network device already exists. goto :configure ) echo Creating TAP network device... "%SCRIPT_DIR%\%ARCH%\tapinstall" install "%SCRIPT_DIR%\%ARCH%\OemVista.inf" %DEVICE_HWID% if %errorlevel% neq 0 ( echo Could not create TAP network device. Try to do it manually. >&2 REM exit /b %ERROR_TAP_INSTALL% start /wait /D "%SCRIPT_DIR%" tap-windows-installer.exe ) :: Find the name of the most recently installed TAP device in the registry and rename it. echo Searching for new TAP network device name... call "%SCRIPT_DIR%\find_tap_device_name.bat" TAP_NAME if %errorlevel% neq 0 ( echo Could not find TAP device name. >&2 exit /b %ERROR_TAP_FIND_NAME% ) echo Found TAP device name: "%TAP_NAME%" :: We've occasionally seen delays before netsh will "see" the new device, at least for :: purposes of configuring IP and DNS ("netsh interface show interface name=xxx" does not :: seem to be affected). call :wait_for_device "%TAP_NAME%" :: Attempt to rename the device even if waiting timed out. netsh interface set interface name="%TAP_NAME%" newname="%DEVICE_NAME%" if %errorlevel% neq 0 ( :: Try to rename the device through powershell in case netsh failed due to not being able to "see" :: the device. Pipe input from /dev/null to prevent powershell from waiting forever on EOF. powershell "Rename-NetAdapter -Name \"%TAP_NAME%\" -NewName \"%DEVICE_NAME%\"" &2 exit /b %ERROR_TAP_RENAME% ) ) :: Wait for the new name to propagate to netsh. call :wait_for_device "%DEVICE_NAME%" :: Attempt to configure the device even if waiting timed out. :configure :: Try to enable the device, in case it's somehow been disabled. :: :: Annoyingly, this returns an error and outputs a confusing message if the device exists and is :: already enabled: :: This network connection does not exist. :: :: So, continue even if this command fails - and always include its output. echo (Re-)enabling TAP network device... netsh interface set interface "%DEVICE_NAME%" admin=enabled :: The powershell command is used to ensure the adapter is enabled if netsh fails and leaves it in :: a disabled state. While no such failure has yet been observed, this command would correct it and :: should behave idempotently otherwise. powershell "Enable-NetAdapter -Name \"%DEVICE_NAME%\"" &2 exit /b %ERROR_TAP_CONFIGURE_SUBNET% ) :: Windows has no system-wide DNS server; each network device can have its :: "own" set of DNS servers. Windows seems to use the DNS server(s) of the :: network device associated with the default gateway. This is good for us :: as it means we do not have to modify the DNS settings of any other network :: device in the system. Configure with OpenDNS and Dyn resolvers. echo Configuring primary DNS... netsh interface ip set dnsservers %DEVICE_NAME% static address=%IP% if %errorlevel% neq 0 ( echo Could not configure TAP device primary DNS. >&2 exit /b %ERROR_TAP_CONFIGURE_DNS% ) echo Setting interface metric (1) for this interface... powershell "Set-NetIPInterface -InterfaceAlias \"%DEVICE_NAME%\" -InterfaceMetric 1" &2 exit /b 1 ) echo TAP network device added and configured successfully exit /b 0 :: Waits up to a minute until a device is visible to netsh. Accepts the device name as a parameter. :: Exits with a non-zero code if the operation times out. :wait_for_device echo Testing that the network device "%~1" is visible to netsh... netsh interface ip show interfaces | find "%~1" >nul 2>&1 if %errorlevel% equ 0 exit /b 0 for /l %%N in (1, 1, 6) do ( echo Waiting... %%N :: timeout doesn't like the environment created by nsExec::ExecToStack and exits with: :: "ERROR: Input redirection is not supported, exiting the process immediately." waitfor /t 10 thisisnotarealsignalname >nul 2>&1 netsh interface ip show interfaces | find "%~1" >nul 2>&1 if !errorlevel! equ 0 exit /b 0 ) exit /b 1 ================================================ FILE: app/clash_core/win_x64/static/files/win/common/tun2socks/amd64/OemVista.inf ================================================ ; **************************************************************************** ; * Copyright (C) 2002-2014 OpenVPN Technologies, Inc. * ; * This program is free software; you can redistribute it and/or modify * ; * it under the terms of the GNU General Public License version 2 * ; * as published by the Free Software Foundation. * ; **************************************************************************** ; SYNTAX CHECKER ; cd \WINDDK\3790\tools\chkinf ; chkinf c:\src\openvpn\tap-win32\i386\oemvista.inf ; OUTPUT -> file:///c:/WINDDK/3790/tools/chkinf/htm/c%23+src+openvpn+tap-win32+i386+__OemWin2k.htm ; INSTALL/REMOVE DRIVER ; tapinstall install OemVista.inf tapoas ; tapinstall update OemVista.inf tapoas ; tapinstall remove tapoas ;********************************************************* ; Note to Developers: ; ; If you are bundling the TAP-Windows driver with your app, ; you should try to rename it in such a way that it will ; not collide with other instances of TAP-Windows defined ; by other apps. Multiple versions of the TAP-Windows ; driver, each installed by different apps, can coexist ; on the same machine if you follow these guidelines. ; NOTE: these instructions assume you are editing the ; generated OemWin2k.inf file, not the source ; OemWin2k.inf.in file which is preprocessed by winconfig ; and uses macro definitions from settings.in. ; ; (1) Rename all tapXXXX instances in this file to ; something different (use at least 5 characters ; for this name!) ; (2) Change the "!define TAP" definition in openvpn.nsi ; to match what you changed tapXXXX to. ; (3) Change TARGETNAME in SOURCES to match what you ; changed tapXXXX to. ; (4) Change TAP_COMPONENT_ID in common.h to match what ; you changed tapXXXX to. ; (5) Change SZDEPENDENCIES in service.h to match what ; you changed tapXXXX to. ; (6) Change DeviceDescription and Provider strings. ; (7) Change PRODUCT_TAP_WIN_DEVICE_DESCRIPTION in constants.h to what you ; set DeviceDescription to. ; ;********************************************************* [Version] Signature = "$Windows NT$" CatalogFile = tap0901.cat ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318} Provider = %Provider% Class = Net ; This version number should match the version ; number given in ..\version.m4. DriverVer = 04/16/2019,9.23.1.601 [Strings] DeviceDescription = "TAP-Windows Adapter V9" Provider = "TAP-Windows Provider V9" ;---------------------------------------------------------------- ; Manufacturer + Product Section (Done) ;---------------------------------------------------------------- [Manufacturer] %Provider% = tap0901, NTamd64 [tap0901.NTamd64] %DeviceDescription% = tap0901.ndi, root\tap0901 ; Root enumerated %DeviceDescription% = tap0901.ndi, tap0901 ; Legacy ;--------------------------------------------------------------- ; Driver Section (Done) ;--------------------------------------------------------------- ;----------------- Characteristics ------------ ; NCF_PHYSICAL = 0x04 ; NCF_VIRTUAL = 0x01 ; NCF_SOFTWARE_ENUMERATED = 0x02 ; NCF_HIDDEN = 0x08 ; NCF_NO_SERVICE = 0x10 ; NCF_HAS_UI = 0x80 ;----------------- Characteristics ------------ [tap0901.ndi] CopyFiles = tap0901.driver, tap0901.files AddReg = tap0901.reg AddReg = tap0901.params.reg Characteristics = 0x81 *IfType = 0x6 ; IF_TYPE_ETHERNET_CSMACD *MediaType = 0x0 ; NdisMedium802_3 *PhysicalMediaType = 14 ; NdisPhysicalMedium802_3 [tap0901.ndi.Services] AddService = tap0901, 2, tap0901.service [tap0901.reg] HKR, Ndi, Service, 0, "tap0901" HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" HKR, Ndi\Interfaces, LowerRange, 0, "ethernet" HKR, , Manufacturer, 0, "%Provider%" HKR, , ProductName, 0, "%DeviceDescription%" [tap0901.params.reg] HKR, Ndi\params\MTU, ParamDesc, 0, "MTU" HKR, Ndi\params\MTU, Type, 0, "int" HKR, Ndi\params\MTU, Default, 0, "1500" HKR, Ndi\params\MTU, Optional, 0, "0" HKR, Ndi\params\MTU, Min, 0, "100" HKR, Ndi\params\MTU, Max, 0, "1500" HKR, Ndi\params\MTU, Step, 0, "1" HKR, Ndi\params\MediaStatus, ParamDesc, 0, "Media Status" HKR, Ndi\params\MediaStatus, Type, 0, "enum" HKR, Ndi\params\MediaStatus, Default, 0, "0" HKR, Ndi\params\MediaStatus, Optional, 0, "0" HKR, Ndi\params\MediaStatus\enum, "0", 0, "Application Controlled" HKR, Ndi\params\MediaStatus\enum, "1", 0, "Always Connected" HKR, Ndi\params\MAC, ParamDesc, 0, "MAC Address" HKR, Ndi\params\MAC, Type, 0, "edit" HKR, Ndi\params\MAC, Optional, 0, "1" HKR, Ndi\params\AllowNonAdmin, ParamDesc, 0, "Non-Admin Access" HKR, Ndi\params\AllowNonAdmin, Type, 0, "enum" HKR, Ndi\params\AllowNonAdmin, Default, 0, "1" HKR, Ndi\params\AllowNonAdmin, Optional, 0, "0" HKR, Ndi\params\AllowNonAdmin\enum, "0", 0, "Not Allowed" HKR, Ndi\params\AllowNonAdmin\enum, "1", 0, "Allowed" ;---------------------------------------------------------------- ; Service Section ;---------------------------------------------------------------- ;---------- Service Type ------------- ; SERVICE_KERNEL_DRIVER = 0x01 ; SERVICE_WIN32_OWN_PROCESS = 0x10 ;---------- Service Type ------------- ;---------- Start Mode --------------- ; SERVICE_BOOT_START = 0x0 ; SERVICE_SYSTEM_START = 0x1 ; SERVICE_AUTO_START = 0x2 ; SERVICE_DEMAND_START = 0x3 ; SERVICE_DISABLED = 0x4 ;---------- Start Mode --------------- [tap0901.service] DisplayName = %DeviceDescription% ServiceType = 1 StartType = 3 ErrorControl = 1 LoadOrderGroup = NDIS ServiceBinary = %12%\tap0901.sys ;----------------------------------------------------------------- ; File Installation ;----------------------------------------------------------------- ;----------------- Copy Flags ------------ ; COPYFLG_NOSKIP = 0x02 ; COPYFLG_NOVERSIONCHECK = 0x04 ;----------------- Copy Flags ------------ ; SourceDisksNames ; diskid = description[, [tagfile] [, , subdir]] ; 1 = "Intel Driver Disk 1",e100bex.sys,, [SourceDisksNames] 1 = %DeviceDescription%, tap0901.sys ; SourceDisksFiles ; filename_on_source = diskID[, [subdir][, size]] ; e100bex.sys = 1,, ; on distribution disk 1 [SourceDisksFiles] tap0901.sys = 1 [DestinationDirs] tap0901.files = 11 tap0901.driver = 12 [tap0901.files] ; TapPanel.cpl,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK ; cipsrvr.exe,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK [tap0901.driver] tap0901.sys,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK ;--------------------------------------------------------------- ; End ;--------------------------------------------------------------- ================================================ FILE: app/clash_core/win_x64/static/files/win/common/tun2socks/find_tap_device_name.bat ================================================ :: Copyright 2020 The Outline Authors :: :: Licensed under the Apache License, Version 2.0 (the "License"); :: you may not use this file except in compliance with the License. :: You may obtain a copy of the License at :: :: http://www.apache.org/licenses/LICENSE-2.0 :: :: Unless required by applicable law or agreed to in writing, software :: distributed under the License is distributed on an "AS IS" BASIS, :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. :: See the License for the specific language governing permissions and :: limitations under the License. :: Queries the registry in order to retrieve the most recently installed TAP network adapter's name. :: Accepts a single argument, the name of an environment variable to store the adapter's name. :: Exits with a non-zero exit code on failure. :: Usage example: find_tap_name.bat TAP_NAME @echo off :: See https://ss64.com/nt/delayedexpansion.html setlocal enabledelayedexpansion set NET_ADAPTERS_CLASS_GUID={4D36E972-E325-11CE-BFC1-08002BE10318} set NET_ADAPTERS_KEY=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\%NET_ADAPTERS_CLASS_GUID% set NET_CONFIG_KEY=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\%NET_ADAPTERS_CLASS_GUID% set NET_ADAPTERS_FILE="%tmp%\netadapters.txt" :: Find all network adapters that match the "tap0901" component ID and store their registry path in a file. :: Note that adapter keys are increasing four-digit integers, padded with leading zeros. reg query %NET_ADAPTERS_KEY% /s /f "tap0901" /e /d | findstr "HKEY.*\\[0-9][0-9][0-9][0-9]$" > %NET_ADAPTERS_FILE% if %errorlevel% neq 0 ( echo Could not find TAP network adapter in the registry. >&2 exit /b 1 ) set TIMESTAMP=0 set NAME= for /f "tokens=*" %%K in ('type "%NET_ADAPTERS_FILE%"') do ( set ADAPTER_NAME= set ADAPTER_NET_CONFIG_ID= set ADAPTER_TIMESTAMP= :: Retrieve the adapter's network config ID. set ADAPTER_KEY=%%K for /f "tokens=3" %%I in ('reg query !ADAPTER_KEY! /v "NetCfgInstanceId"') do ( set ADAPTER_NET_CONFIG_ID=%%I ) :: Retrieve the adapter's install timestamp. for /f "tokens=3" %%T in ('reg query !ADAPTER_KEY! /v "InstallTimeStamp"') do ( set ADAPTER_TIMESTAMP=%%T ) :: Retrieve the adapter's name. set ADAPTER_CONFIG_KEY=!NET_CONFIG_KEY!\!ADAPTER_NET_CONFIG_ID!\Connection for /f "tokens=3*" %%N in ('reg query !ADAPTER_CONFIG_KEY! /v "Name"') do ( :: If the name contains spaces our tokenization will store the rest of the name in %%O. if [%%O] == [] ( set ADAPTER_NAME=%%N ) else ( set ADAPTER_NAME=%%N %%O ) ) :: Ensure we found the adapter's install timestamp and name. if not [!ADAPTER_TIMESTAMP!] == [] ( if not [!ADAPTER_NAME!] == [] ( echo Found adapter "!ADAPTER_NAME!", !ADAPTER_TIMESTAMP! :: Store the adapter's name if it's the most recently installed one. if !ADAPTER_TIMESTAMP! gtr !TIMESTAMP! ( set TIMESTAMP=!ADAPTER_TIMESTAMP! set NAME=!ADAPTER_NAME! ) ) else ( echo Failed to retrieve name of adapter !ADAPTER_KEY! >&2 ) ) else ( echo Failed to retrieve install timestamp of adapter !ADAPTER_KEY! >&2 ) ) if [!NAME!] == [] ( echo Could not find TAP adapter name. >&2 exit /b 1 ) echo TAP device name: "!NAME!" endlocal & set "%1=%NAME%" exit /b 0 ================================================ FILE: app/clash_core/win_x64/static/files/win/common/tun2socks/i386/OemVista.inf ================================================ ; **************************************************************************** ; * Copyright (C) 2002-2014 OpenVPN Technologies, Inc. * ; * This program is free software; you can redistribute it and/or modify * ; * it under the terms of the GNU General Public License version 2 * ; * as published by the Free Software Foundation. * ; **************************************************************************** ; SYNTAX CHECKER ; cd \WINDDK\3790\tools\chkinf ; chkinf c:\src\openvpn\tap-win32\i386\oemvista.inf ; OUTPUT -> file:///c:/WINDDK/3790/tools/chkinf/htm/c%23+src+openvpn+tap-win32+i386+__OemWin2k.htm ; INSTALL/REMOVE DRIVER ; tapinstall install OemVista.inf tapoas ; tapinstall update OemVista.inf tapoas ; tapinstall remove tapoas ;********************************************************* ; Note to Developers: ; ; If you are bundling the TAP-Windows driver with your app, ; you should try to rename it in such a way that it will ; not collide with other instances of TAP-Windows defined ; by other apps. Multiple versions of the TAP-Windows ; driver, each installed by different apps, can coexist ; on the same machine if you follow these guidelines. ; NOTE: these instructions assume you are editing the ; generated OemWin2k.inf file, not the source ; OemWin2k.inf.in file which is preprocessed by winconfig ; and uses macro definitions from settings.in. ; ; (1) Rename all tapXXXX instances in this file to ; something different (use at least 5 characters ; for this name!) ; (2) Change the "!define TAP" definition in openvpn.nsi ; to match what you changed tapXXXX to. ; (3) Change TARGETNAME in SOURCES to match what you ; changed tapXXXX to. ; (4) Change TAP_COMPONENT_ID in common.h to match what ; you changed tapXXXX to. ; (5) Change SZDEPENDENCIES in service.h to match what ; you changed tapXXXX to. ; (6) Change DeviceDescription and Provider strings. ; (7) Change PRODUCT_TAP_WIN_DEVICE_DESCRIPTION in constants.h to what you ; set DeviceDescription to. ; ;********************************************************* [Version] Signature = "$Windows NT$" CatalogFile = tap0901.cat ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318} Provider = %Provider% Class = Net ; This version number should match the version ; number given in SOURCES. DriverVer=04/21/2016,9.00.00.21 [Strings] DeviceDescription = "TAP-Windows Adapter V9" Provider = "TAP-Windows Provider V9" ;---------------------------------------------------------------- ; Manufacturer + Product Section (Done) ;---------------------------------------------------------------- [Manufacturer] %Provider% = tap0901 [tap0901] %DeviceDescription% = tap0901.ndi, root\tap0901 ; Root enumerated %DeviceDescription% = tap0901.ndi, tap0901 ; Legacy ;--------------------------------------------------------------- ; Driver Section (Done) ;--------------------------------------------------------------- ;----------------- Characteristics ------------ ; NCF_PHYSICAL = 0x04 ; NCF_VIRTUAL = 0x01 ; NCF_SOFTWARE_ENUMERATED = 0x02 ; NCF_HIDDEN = 0x08 ; NCF_NO_SERVICE = 0x10 ; NCF_HAS_UI = 0x80 ;----------------- Characteristics ------------ [tap0901.ndi] CopyFiles = tap0901.driver, tap0901.files AddReg = tap0901.reg AddReg = tap0901.params.reg Characteristics = *IfType = 0x6 ; IF_TYPE_ETHERNET_CSMACD *MediaType = 0x0 ; NdisMedium802_3 *PhysicalMediaType = 14 ; NdisPhysicalMedium802_3 [tap0901.ndi.Services] AddService = tap0901, 2, tap0901.service [tap0901.reg] HKR, Ndi, Service, 0, "tap0901" HKR, Ndi\Interfaces, UpperRange, 0, "ndis5" HKR, Ndi\Interfaces, LowerRange, 0, "ethernet" HKR, , Manufacturer, 0, "%Provider%" HKR, , ProductName, 0, "%DeviceDescription%" [tap0901.params.reg] HKR, Ndi\params\MTU, ParamDesc, 0, "MTU" HKR, Ndi\params\MTU, Type, 0, "int" HKR, Ndi\params\MTU, Default, 0, "1500" HKR, Ndi\params\MTU, Optional, 0, "0" HKR, Ndi\params\MTU, Min, 0, "100" HKR, Ndi\params\MTU, Max, 0, "1500" HKR, Ndi\params\MTU, Step, 0, "1" HKR, Ndi\params\MediaStatus, ParamDesc, 0, "Media Status" HKR, Ndi\params\MediaStatus, Type, 0, "enum" HKR, Ndi\params\MediaStatus, Default, 0, "0" HKR, Ndi\params\MediaStatus, Optional, 0, "0" HKR, Ndi\params\MediaStatus\enum, "0", 0, "Application Controlled" HKR, Ndi\params\MediaStatus\enum, "1", 0, "Always Connected" HKR, Ndi\params\MAC, ParamDesc, 0, "MAC Address" HKR, Ndi\params\MAC, Type, 0, "edit" HKR, Ndi\params\MAC, Optional, 0, "1" HKR, Ndi\params\AllowNonAdmin, ParamDesc, 0, "Non-Admin Access" HKR, Ndi\params\AllowNonAdmin, Type, 0, "enum" HKR, Ndi\params\AllowNonAdmin, Default, 0, "1" HKR, Ndi\params\AllowNonAdmin, Optional, 0, "0" HKR, Ndi\params\AllowNonAdmin\enum, "0", 0, "Not Allowed" HKR, Ndi\params\AllowNonAdmin\enum, "1", 0, "Allowed" ;---------------------------------------------------------------- ; Service Section ;---------------------------------------------------------------- ;---------- Service Type ------------- ; SERVICE_KERNEL_DRIVER = 0x01 ; SERVICE_WIN32_OWN_PROCESS = 0x10 ;---------- Service Type ------------- ;---------- Start Mode --------------- ; SERVICE_BOOT_START = 0x0 ; SERVICE_SYSTEM_START = 0x1 ; SERVICE_AUTO_START = 0x2 ; SERVICE_DEMAND_START = 0x3 ; SERVICE_DISABLED = 0x4 ;---------- Start Mode --------------- [tap0901.service] DisplayName = %DeviceDescription% ServiceType = 1 StartType = 3 ErrorControl = 1 LoadOrderGroup = NDIS ServiceBinary = %12%\tap0901.sys ;----------------------------------------------------------------- ; File Installation ;----------------------------------------------------------------- ;----------------- Copy Flags ------------ ; COPYFLG_NOSKIP = 0x02 ; COPYFLG_NOVERSIONCHECK = 0x04 ;----------------- Copy Flags ------------ ; SourceDisksNames ; diskid = description[, [tagfile] [, , subdir]] ; 1 = "Intel Driver Disk 1",e100bex.sys,, [SourceDisksNames] 1 = %DeviceDescription%, tap0901.sys ; SourceDisksFiles ; filename_on_source = diskID[, [subdir][, size]] ; e100bex.sys = 1,, ; on distribution disk 1 [SourceDisksFiles] tap0901.sys = 1 [DestinationDirs] tap0901.files = 11 tap0901.driver = 12 [tap0901.files] ; TapPanel.cpl,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK ; cipsrvr.exe,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK [tap0901.driver] tap0901.sys,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK ;--------------------------------------------------------------- ; End ;--------------------------------------------------------------- ================================================ FILE: app/clash_core/win_x64/static/files/win/common/tun2socks/remove_tap_device.bat ================================================ @echo off setlocal set DEVICE_NAME=cfw-tap set DEVICE_HWID=tap0901 set SCRIPT_DIR=%~dp0 set ARCH=%1 set PATH=%PATH%;%SystemRoot%\system32;%SystemRoot%\system32\wbem;%SystemRoot%\system32\WindowsPowerShell/v1.0 echo Removing old TAP network device... "%SCRIPT_DIR%\%ARCH%\tapinstall" remove %DEVICE_HWID% if %errorlevel% neq 0 ( echo Could not remove TAP network device. >&2 exit /b 1 ) ================================================ FILE: app/clash_core/win_x64/static/files/win/x64/clash-win64.exe.sign ================================================ 0BpClCU/jf0VdpLKDVPSHLec5YpcR2GiqM589Z2k4t5K5WTfSTTcQWHbS5T+lxoO8pRvi+aILnLytkbNvFhi1w== ================================================ FILE: app/main/ABOUT/LICENSE.electron.txt ================================================ Copyright (c) Electron contributors Copyright (c) 2013-2020 GitHub Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: app/main/ABOUT/state.txt ================================================ Disclaimer Statement 1. This software is only intended for the purpose of learning and researching network technology. Users must comply with the laws and regulations in their respective regions and must not use it for illegal purposes. The software will not be held responsible for any actions of the user. 2. Users must strictly abide by the laws, regulations, and policies of their own countries/regions when using this software. Any consequences or liabilities resulting from violations of relevant laws, regulations, and policies shall be borne by the user. 3. The software is not responsible for the transmission of content. Therefore, if any problems or consequences arise from the use of this software, the user shall bear all responsibility. 4. If the software violates any laws and regulations of the user's country/region, the user must immediately stop using it and bear the corresponding legal responsibility. 5. While using this software, the user acknowledges and agrees that the software cannot guarantee network stability, accuracy, timeliness, and security. The software will not be held responsible for any connection problems or inability to connect caused by network congestion, firewall restrictions, DNS pollution, operator interference, and other reasons. 6. The software does not provide technical support and is not responsible for any direct or indirect losses caused by the user's use of this software, including but not limited to property damage, data loss, and other forms of loss. Links Official Link: https://github.com/Fndroid/clash_for_windows_pkg CFW Chinese version link: https://github.com/Z-Siqi/Clash-for-Windows_Chinese ================================================ FILE: app/main/dist/electron/287.js ================================================ "use strict"; (global.webpackChunkclash_win = global.webpackChunkclash_win || []).push([ [287], { 37287: (e, n, s) => { s.r(n), s.d(n, { conf: () => r, language: () => i }); var t = s(89587), r = { comments: { lineComment: "#", blockComment: ["'''", "'''"] }, brackets: [ ["{", "}"], ["[", "]"], ["(", ")"] ], autoClosingPairs: [{ open: "{", close: "}" }, { open: "[", close: "]" }, { open: "(", close: ")" }, { open: '"', close: '"', notIn: ["string"] }, { open: "'", close: "'", notIn: ["string", "comment"] }], surroundingPairs: [{ open: "{", close: "}" }, { open: "[", close: "]" }, { open: "(", close: ")" }, { open: '"', close: '"' }, { open: "'", close: "'" }], onEnterRules: [{ beforeText: new RegExp("^\\s*(?:def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\\s*$"), action: { indentAction: t.Mj.IndentAction.Indent } }], folding: { offSide: !0, markers: { start: new RegExp("^\\s*#region\\b"), end: new RegExp("^\\s*#endregion\\b") } } }, i = { defaultToken: "", tokenPostfix: ".python", keywords: ["False", "None", "True", "and", "as", "assert", "async", "await", "break", "class", "continue", "def", "del", "elif", "else", "except", "exec", "finally", "for", "from", "global", "if", "import", "in", "is", "lambda", "nonlocal", "not", "or", "pass", "print", "raise", "return", "try", "while", "with", "yield", "int", "float", "long", "complex", "hex", "abs", "all", "any", "apply", "basestring", "bin", "bool", "buffer", "bytearray", "callable", "chr", "classmethod", "cmp", "coerce", "compile", "complex", "delattr", "dict", "dir", "divmod", "enumerate", "eval", "execfile", "file", "filter", "format", "frozenset", "getattr", "globals", "hasattr", "hash", "help", "id", "input", "intern", "isinstance", "issubclass", "iter", "len", "locals", "list", "map", "max", "memoryview", "min", "next", "object", "oct", "open", "ord", "pow", "print", "property", "reversed", "range", "raw_input", "reduce", "reload", "repr", "reversed", "round", "self", "set", "setattr", "slice", "sorted", "staticmethod", "str", "sum", "super", "tuple", "type", "unichr", "unicode", "vars", "xrange", "zip", "__dict__", "__methods__", "__members__", "__class__", "__bases__", "__name__", "__mro__", "__subclasses__", "__init__", "__import__"], brackets: [{ open: "{", close: "}", token: "delimiter.curly" }, { open: "[", close: "]", token: "delimiter.bracket" }, { open: "(", close: ")", token: "delimiter.parenthesis" }], tokenizer: { root: [{ include: "@whitespace" }, { include: "@numbers" }, { include: "@strings" }, [/[,:;]/, "delimiter"], [/[{}\[\]()]/, "@brackets"], [/@[a-zA-Z_]\w*/, "tag"], [/[a-zA-Z_]\w*/, { cases: { "@keywords": "keyword", "@default": "identifier" } }] ], whitespace: [ [/\s+/, "white"], [/(^#.*$)/, "comment"], [/'''/, "string", "@endDocString"], [/"""/, "string", "@endDblDocString"] ], endDocString: [ [/[^']+/, "string"], [/\\'/, "string"], [/'''/, "string", "@popall"], [/'/, "string"] ], endDblDocString: [ [/[^"]+/, "string"], [/\\"/, "string"], [/"""/, "string", "@popall"], [/"/, "string"] ], numbers: [ [/-?0x([abcdef]|[ABCDEF]|\d)+[lL]?/, "number.hex"], [/-?(\d*\.)?\d+([eE][+\-]?\d+)?[jJ]?[lL]?/, "number"] ], strings: [ [/'$/, "string.escape", "@popall"], [/'/, "string.escape", "@stringBody"], [/"$/, "string.escape", "@popall"], [/"/, "string.escape", "@dblStringBody"] ], stringBody: [ [/[^\\']+$/, "string", "@popall"], [/[^\\']+/, "string"], [/\\./, "string"], [/'/, "string.escape", "@popall"], [/\\$/, "string"] ], dblStringBody: [ [/[^\\"]+$/, "string", "@popall"], [/[^\\"]+/, "string"], [/\\./, "string"], [/"/, "string.escape", "@popall"], [/\\$/, "string"] ] } } } } ]); ================================================ FILE: app/main/dist/electron/295.js ================================================ "use strict"; (global.webpackChunkclash_win = global.webpackChunkclash_win || []).push([ [295], { 62295: (e, t, n) => { n.r(t), n.d(t, { conf: () => s, language: () => r }); var o = n(89587), i = { defaultToken: "invalid", tokenPostfix: ".ts", keywords: ["abstract", "any", "as", "asserts", "bigint", "boolean", "break", "case", "catch", "class", "continue", "const", "constructor", "debugger", "declare", "default", "delete", "do", "else", "enum", "export", "extends", "false", "finally", "for", "from", "function", "get", "if", "implements", "import", "in", "infer", "instanceof", "interface", "is", "keyof", "let", "module", "namespace", "never", "new", "null", "number", "object", "package", "private", "protected", "public", "override", "readonly", "require", "global", "return", "set", "static", "string", "super", "switch", "symbol", "this", "throw", "true", "try", "type", "typeof", "undefined", "unique", "unknown", "var", "void", "while", "with", "yield", "async", "await", "of"], operators: ["<=", ">=", "==", "!=", "===", "!==", "=>", "+", "-", "**", "*", "/", "%", "++", "--", "<<", ">", ">>>", "&", "|", "^", "!", "~", "&&", "||", "??", "?", ":", "=", "+=", "-=", "*=", "**=", "/=", "%=", "<<=", ">>=", ">>>=", "&=", "|=", "^=", "@"], symbols: /[=>](?!@symbols)/, "@brackets"], [/!(?=([^=]|$))/, "delimiter"], [/@symbols/, { cases: { "@operators": "delimiter", "@default": "" } }], [/(@digits)[eE]([\-+]?(@digits))?/, "number.float"], [/(@digits)\.(@digits)([eE][\-+]?(@digits))?/, "number.float"], [/0[xX](@hexdigits)n?/, "number.hex"], [/0[oO]?(@octaldigits)n?/, "number.octal"], [/0[bB](@binarydigits)n?/, "number.binary"], [/(@digits)n?/, "number"], [/[;,.]/, "delimiter"], [/"([^"\\]|\\.)*$/, "string.invalid"], [/'([^'\\]|\\.)*$/, "string.invalid"], [/"/, "string", "@string_double"], [/'/, "string", "@string_single"], [/`/, "string", "@string_backtick"] ], whitespace: [ [/[ \t\r\n]+/, ""], [/\/\*\*(?!\/)/, "comment.doc", "@jsdoc"], [/\/\*/, "comment", "@comment"], [/\/\/.*$/, "comment"] ], comment: [ [/[^\/*]+/, "comment"], [/\*\//, "comment", "@pop"], [/[\/*]/, "comment"] ], jsdoc: [ [/[^\/*]+/, "comment.doc"], [/\*\//, "comment.doc", "@pop"], [/[\/*]/, "comment.doc"] ], regexp: [ [/(\{)(\d+(?:,\d*)?)(\})/, ["regexp.escape.control", "regexp.escape.control", "regexp.escape.control"]], [/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/, ["regexp.escape.control", { token: "regexp.escape.control", next: "@regexrange" }]], [/(\()(\?:|\?=|\?!)/, ["regexp.escape.control", "regexp.escape.control"]], [/[()]/, "regexp.escape.control"], [/@regexpctl/, "regexp.escape.control"], [/[^\\\/]/, "regexp"], [/@regexpesc/, "regexp.escape"], [/\\\./, "regexp.invalid"], [/(\/)([dgimsuy]*)/, [{ token: "regexp", bracket: "@close", next: "@pop" }, "keyword.other"]] ], regexrange: [ [/-/, "regexp.escape.control"], [/\^/, "regexp.invalid"], [/@regexpesc/, "regexp.escape"], [/[^\]]/, "regexp"], [/\]/, { token: "regexp.escape.control", next: "@pop", bracket: "@close" }] ], string_double: [ [/[^\\"]+/, "string"], [/@escapes/, "string.escape"], [/\\./, "string.escape.invalid"], [/"/, "string", "@pop"] ], string_single: [ [/[^\\']+/, "string"], [/@escapes/, "string.escape"], [/\\./, "string.escape.invalid"], [/'/, "string", "@pop"] ], string_backtick: [ [/\$\{/, { token: "delimiter.bracket", next: "@bracketCounting" }], [/[^\\`$]+/, "string"], [/@escapes/, "string.escape"], [/\\./, "string.escape.invalid"], [/`/, "string", "@pop"] ], bracketCounting: [ [/\{/, "delimiter.bracket", "@bracketCounting"], [/\}/, "delimiter.bracket", "@pop"], { include: "common" } ] } }, s = { wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, comments: { lineComment: "//", blockComment: ["/*", "*/"] }, brackets: [ ["{", "}"], ["[", "]"], ["(", ")"] ], onEnterRules: [{ beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/, afterText: /^\s*\*\/$/, action: { indentAction: o.Mj.IndentAction.IndentOutdent, appendText: " * " } }, { beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/, action: { indentAction: o.Mj.IndentAction.None, appendText: " * " } }, { beforeText: /^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/, action: { indentAction: o.Mj.IndentAction.None, appendText: "* " } }, { beforeText: /^(\t|(\ \ ))*\ \*\/\s*$/, action: { indentAction: o.Mj.IndentAction.None, removeText: 1 } }], autoClosingPairs: [{ open: "{", close: "}" }, { open: "[", close: "]" }, { open: "(", close: ")" }, { open: '"', close: '"', notIn: ["string"] }, { open: "'", close: "'", notIn: ["string", "comment"] }, { open: "`", close: "`", notIn: ["string", "comment"] }, { open: "/**", close: " */", notIn: ["string"] }], folding: { markers: { start: new RegExp("^\\s*//\\s*#?region\\b"), end: new RegExp("^\\s*//\\s*#?endregion\\b") } } }, r = { defaultToken: "invalid", tokenPostfix: ".js", keywords: ["break", "case", "catch", "class", "continue", "const", "constructor", "debugger", "default", "delete", "do", "else", "export", "extends", "false", "finally", "for", "from", "function", "get", "if", "import", "in", "instanceof", "let", "new", "null", "return", "set", "super", "switch", "symbol", "this", "throw", "true", "try", "typeof", "undefined", "var", "void", "while", "with", "yield", "async", "await", "of"], typeKeywords: [], operators: i.operators, symbols: i.symbols, escapes: i.escapes, digits: i.digits, octaldigits: i.octaldigits, binarydigits: i.binarydigits, hexdigits: i.hexdigits, regexpctl: i.regexpctl, regexpesc: i.regexpesc, tokenizer: i.tokenizer } } } ]); ================================================ FILE: app/main/dist/electron/585.js ================================================ "use strict"; (global.webpackChunkclash_win = global.webpackChunkclash_win || []).push([ [585], { 23585: (e, n, t) => { t.r(n), t.d(n, { conf: () => r, language: () => o }); var r = { comments: { lineComment: "#" }, brackets: [ ["{", "}"], ["[", "]"], ["(", ")"] ], autoClosingPairs: [{ open: "{", close: "}" }, { open: "[", close: "]" }, { open: "(", close: ")" }, { open: '"', close: '"' }, { open: "'", close: "'" }], surroundingPairs: [{ open: "{", close: "}" }, { open: "[", close: "]" }, { open: "(", close: ")" }, { open: '"', close: '"' }, { open: "'", close: "'" }], folding: { offSide: !0 } }, o = { tokenPostfix: ".yaml", brackets: [{ token: "delimiter.bracket", open: "{", close: "}" }, { token: "delimiter.square", open: "[", close: "]" }], keywords: ["true", "True", "TRUE", "false", "False", "FALSE", "null", "Null", "Null", "~"], numberInteger: /(?:0|[+-]?[0-9]+)/, numberFloat: /(?:0|[+-]?[0-9]+)(?:\.[0-9]+)?(?:e[-+][1-9][0-9]*)?/, numberOctal: /0o[0-7]+/, numberHex: /0x[0-9a-fA-F]+/, numberInfinity: /[+-]?\.(?:inf|Inf|INF)/, numberNaN: /\.(?:nan|Nan|NAN)/, numberDate: /\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/, escapes: /\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/, tokenizer: { root: [{ include: "@whitespace" }, { include: "@comment" }, [/%[^ ]+.*$/, "meta.directive"], [/---/, "operators.directivesEnd"], [/\.{3}/, "operators.documentEnd"], [/[-?:](?= )/, "operators"], { include: "@anchor" }, { include: "@tagHandle" }, { include: "@flowCollections" }, { include: "@blockStyle" }, [/@numberInteger(?![ \t]*\S+)/, "number"], [/@numberFloat(?![ \t]*\S+)/, "number.float"], [/@numberOctal(?![ \t]*\S+)/, "number.octal"], [/@numberHex(?![ \t]*\S+)/, "number.hex"], [/@numberInfinity(?![ \t]*\S+)/, "number.infinity"], [/@numberNaN(?![ \t]*\S+)/, "number.nan"], [/@numberDate(?![ \t]*\S+)/, "number.date"], [/(".*?"|'.*?'|.*?)([ \t]*)(:)( |$)/, ["type", "white", "operators", "white"]], { include: "@flowScalars" }, [/[^#]+/, { cases: { "@keywords": "keyword", "@default": "string" } }] ], object: [{ include: "@whitespace" }, { include: "@comment" }, [/\}/, "@brackets", "@pop"], [/,/, "delimiter.comma"], [/:(?= )/, "operators"], [/(?:".*?"|'.*?'|[^,\{\[]+?)(?=: )/, "type"], { include: "@flowCollections" }, { include: "@flowScalars" }, { include: "@tagHandle" }, { include: "@anchor" }, { include: "@flowNumber" }, [/[^\},]+/, { cases: { "@keywords": "keyword", "@default": "string" } }] ], array: [{ include: "@whitespace" }, { include: "@comment" }, [/\]/, "@brackets", "@pop"], [/,/, "delimiter.comma"], { include: "@flowCollections" }, { include: "@flowScalars" }, { include: "@tagHandle" }, { include: "@anchor" }, { include: "@flowNumber" }, [/[^\],]+/, { cases: { "@keywords": "keyword", "@default": "string" } }] ], multiString: [ [/^( +).+$/, "string", "@multiStringContinued.$1"] ], multiStringContinued: [ [/^( *).+$/, { cases: { "$1==$S2": "string", "@default": { token: "@rematch", next: "@popall" } } }] ], whitespace: [ [/[ \t\r\n]+/, "white"] ], comment: [ [/#.*$/, "comment"] ], flowCollections: [ [/\[/, "@brackets", "@array"], [/\{/, "@brackets", "@object"] ], flowScalars: [ [/"([^"\\]|\\.)*$/, "string.invalid"], [/'([^'\\]|\\.)*$/, "string.invalid"], [/'[^']*'/, "string"], [/"/, "string", "@doubleQuotedString"] ], doubleQuotedString: [ [/[^\\"]+/, "string"], [/@escapes/, "string.escape"], [/\\./, "string.escape.invalid"], [/"/, "string", "@pop"] ], blockStyle: [ [/[>|][0-9]*[+-]?$/, "operators", "@multiString"] ], flowNumber: [ [/@numberInteger(?=[ \t]*[,\]\}])/, "number"], [/@numberFloat(?=[ \t]*[,\]\}])/, "number.float"], [/@numberOctal(?=[ \t]*[,\]\}])/, "number.octal"], [/@numberHex(?=[ \t]*[,\]\}])/, "number.hex"], [/@numberInfinity(?=[ \t]*[,\]\}])/, "number.infinity"], [/@numberNaN(?=[ \t]*[,\]\}])/, "number.nan"], [/@numberDate(?=[ \t]*[,\]\}])/, "number.date"] ], tagHandle: [ [/\![^ ]*/, "tag"] ], anchor: [ [/[&*][^ ]+/, "namespace"] ] } } } } ]); ================================================ FILE: app/main/dist/electron/editor.worker.js ================================================ (() => { "use strict"; const e = new class { constructor() { this.listeners = [], this.unexpectedErrorHandler = function(e) { setTimeout((() => { if (e.stack) throw new Error(e.message + "\n\n" + e.stack); throw e }), 0) } } emit(e) { this.listeners.forEach((t => { t(e) })) } onUnexpectedError(e) { this.unexpectedErrorHandler(e), this.emit(e) } onUnexpectedExternalError(e) { this.unexpectedErrorHandler(e) } }; function t(t) { r(t) || e.onUnexpectedError(t) } function n(e) { if (e instanceof Error) { let { name: t, message: n } = e; return { $isError: !0, name: t, message: n, stack: e.stacktrace || e.stack } } return e } const i = "Canceled"; function r(e) { return e instanceof Error && e.name === i && e.message === i } function s(e) { const t = this; let n, i = !1; return function() { return i || (i = !0, n = e.apply(t, arguments)), n } } var o; ! function(e) { e.is = function(e) { return e && "object" == typeof e && "function" == typeof e[Symbol.iterator] }; const t = Object.freeze([]); e.empty = function() { return t }, e.single = function*(e) { yield e }, e.from = function(e) { return e || t }, e.isEmpty = function(e) { return !e || !0 === e[Symbol.iterator]().next().done }, e.first = function(e) { return e[Symbol.iterator]().next().value }, e.some = function(e, t) { for (const n of e) if (t(n)) return !0; return !1 }, e.find = function(e, t) { for (const n of e) if (t(n)) return n }, e.filter = function*(e, t) { for (const n of e) t(n) && (yield n) }, e.map = function*(e, t) { let n = 0; for (const i of e) yield t(i, n++) }, e.concat = function*(...e) { for (const t of e) for (const e of t) yield e }, e.concatNested = function*(e) { for (const t of e) for (const e of t) yield e }, e.reduce = function(e, t, n) { let i = n; for (const n of e) i = t(i, n); return i }, e.slice = function*(e, t, n = e.length) { for (t < 0 && (t += e.length), n < 0 ? n += e.length : n > e.length && (n = e.length); t < n; t++) yield e[t] }, e.consume = function(t, n = Number.POSITIVE_INFINITY) { const i = []; if (0 === n) return [i, t]; const r = t[Symbol.iterator](); for (let t = 0; t < n; t++) { const t = r.next(); if (t.done) return [i, e.empty()]; i.push(t.value) } return [i, { [Symbol.iterator]: () => r }] }, e.equals = function(e, t, n = ((e, t) => e === t)) { const i = e[Symbol.iterator](), r = t[Symbol.iterator](); for (;;) { const e = i.next(), t = r.next(); if (e.done !== t.done) return !1; if (e.done) return !0; if (!n(e.value, t.value)) return !1 } } }(o || (o = {})); let a = null; var l; function u(e) { return null == a || a.trackDisposable(e), e } function h(e) { null == a || a.markAsDisposed(e) } function d(e, t) { null == a || a.setParent(e, t) } class c extends Error { constructor(e) { super(`Encountered errors while disposing of store. Errors: [${e.join(", ")}]`), this.errors = e } } function m(e) { if (o.is(e)) { let t = []; for (const n of e) if (n) try { n.dispose() } catch (e) { t.push(e) } if (1 === t.length) throw t[0]; if (t.length > 1) throw new c(t); return Array.isArray(e) ? [] : e } if (e) return e.dispose(), e } function f(...e) { const t = g((() => m(e))); return function(e, t) { if (a) for (const n of e) a.setParent(n, t) }(e, t), t } function g(e) { const t = u({ dispose: s((() => { h(t), e() })) }); return t } class _ { constructor() { this._toDispose = new Set, this._isDisposed = !1, u(this) } dispose() { this._isDisposed || (h(this), this._isDisposed = !0, this.clear()) } clear() { try { m(this._toDispose.values()) } finally { this._toDispose.clear() } } add(e) { if (!e) return e; if (e === this) throw new Error("Cannot register a disposable on itself!"); return d(e, this), this._isDisposed ? _.DISABLE_DISPOSED_WARNING || console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack) : this._toDispose.add(e), e } } _.DISABLE_DISPOSED_WARNING = !1; class p { constructor() { this._store = new _, u(this), d(this._store, this) } dispose() { h(this), this._store.dispose() } _register(e) { if (e === this) throw new Error("Cannot register a disposable on itself!"); return this._store.add(e) } } p.None = Object.freeze({ dispose() {} }); class C { constructor(e) { this.element = e, this.next = C.Undefined, this.prev = C.Undefined } } C.Undefined = new C(void 0); class L { constructor() { this._first = C.Undefined, this._last = C.Undefined, this._size = 0 } get size() { return this._size } isEmpty() { return this._first === C.Undefined } clear() { let e = this._first; for (; e !== C.Undefined;) { const t = e.next; e.prev = C.Undefined, e.next = C.Undefined, e = t } this._first = C.Undefined, this._last = C.Undefined, this._size = 0 } unshift(e) { return this._insert(e, !1) } push(e) { return this._insert(e, !0) } _insert(e, t) { const n = new C(e); if (this._first === C.Undefined) this._first = n, this._last = n; else if (t) { const e = this._last; this._last = n, n.prev = e, e.next = n } else { const e = this._first; this._first = n, n.next = e, e.prev = n } this._size += 1; let i = !1; return () => { i || (i = !0, this._remove(n)) } } shift() { if (this._first !== C.Undefined) { const e = this._first.element; return this._remove(this._first), e } } pop() { if (this._last !== C.Undefined) { const e = this._last.element; return this._remove(this._last), e } } _remove(e) { if (e.prev !== C.Undefined && e.next !== C.Undefined) { const t = e.prev; t.next = e.next, e.next.prev = t } else e.prev === C.Undefined && e.next === C.Undefined ? (this._first = C.Undefined, this._last = C.Undefined) : e.next === C.Undefined ? (this._last = this._last.prev, this._last.next = C.Undefined) : e.prev === C.Undefined && (this._first = this._first.next, this._first.prev = C.Undefined); this._size -= 1 }*[Symbol.iterator]() { let e = this._first; for (; e !== C.Undefined;) yield e.element, e = e.next } } const S = "en"; let b, N, E = !1, y = !1, A = !1, w = !1, v = !1, M = !1, K = !1, O = null, T = null; const R = "object" == typeof self ? self : "object" == typeof global ? global : {}; let V; void 0 !== R.vscode && void 0 !== R.vscode.process ? V = R.vscode.process : "undefined" != typeof process && (V = process); const I = "string" == typeof(null === (l = null == V ? void 0 : V.versions) || void 0 === l ? void 0 : l.electron) && "renderer" === V.type; if ("object" != typeof navigator || I) if ("object" == typeof V) { E = "win32" === V.platform, y = "darwin" === V.platform, A = "linux" === V.platform, w = A && !!V.env.SNAP && !!V.env.SNAP_REVISION, b = S, O = S; const e = V.env.VSCODE_NLS_CONFIG; if (e) try { const t = JSON.parse(e), n = t.availableLanguages["*"]; b = t.locale, O = n || S, T = t._translationsConfigFile } catch (e) {} v = !0 } else console.error("Unable to resolve platform."); else N = navigator.userAgent, E = N.indexOf("Windows") >= 0, y = N.indexOf("Macintosh") >= 0, K = (N.indexOf("Macintosh") >= 0 || N.indexOf("iPad") >= 0 || N.indexOf("iPhone") >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0, A = N.indexOf("Linux") >= 0, M = !0, b = navigator.language, O = b; let P = 0; y ? P = 1 : E ? P = 3 : A && (P = 2); const x = E, k = y, D = function() { if (R.setImmediate) return R.setImmediate.bind(R); if ("function" == typeof R.postMessage && !R.importScripts) { let e = []; R.addEventListener("message", (t => { if (t.data && t.data.vscodeSetImmediateId) for (let n = 0, i = e.length; n < i; n++) { const i = e[n]; if (i.id === t.data.vscodeSetImmediateId) return e.splice(n, 1), void i.callback() } })); let t = 0; return n => { const i = ++t; e.push({ id: i, callback: n }), R.postMessage({ vscodeSetImmediateId: i }, "*") } } if ("function" == typeof(null == V ? void 0 : V.nextTick)) return V.nextTick.bind(V); const e = Promise.resolve(); return t => e.then(t) }(); const F = R.performance && "function" == typeof R.performance.now; class U { constructor(e) { this._highResolution = F && e, this._startTime = this._now(), this._stopTime = -1 } static create(e = !0) { return new U(e) } stop() { this._stopTime = this._now() } elapsed() { return -1 !== this._stopTime ? this._stopTime - this._startTime : this._now() - this._startTime } _now() { return this._highResolution ? R.performance.now() : Date.now() } } var B; ! function(e) { function t(e) { return (t, n = null, i) => { let r, s = !1; return r = e((e => { if (!s) return r ? r.dispose() : s = !0, t.call(n, e) }), null, i), s && r.dispose(), r } } function n(e, t) { return o(((n, i = null, r) => e((e => n.call(i, t(e))), null, r))) } function i(e, t) { return o(((n, i = null, r) => e((e => { t(e), n.call(i, e) }), null, r))) } function r(e, t) { return o(((n, i = null, r) => e((e => t(e) && n.call(i, e)), null, r))) } function s(e, t, i) { let r = i; return n(e, (e => (r = t(r, e), r))) } function o(e) { let t; const n = new H({ onFirstListenerAdd() { t = e(n.fire, n) }, onLastListenerRemove() { t.dispose() } }); return n.event } function a(e, t, n = 100, i = !1, r) { let s, o, a, l = 0; const u = new H({ leakWarningThreshold: r, onFirstListenerAdd() { s = e((e => { l++, o = t(o, e), i && !a && (u.fire(o), o = void 0), clearTimeout(a), a = setTimeout((() => { const e = o; o = void 0, a = void 0, (!i || l > 1) && u.fire(e), l = 0 }), n) })) }, onLastListenerRemove() { s.dispose() } }); return u.event } function l(e, t = ((e, t) => e === t)) { let n, i = !0; return r(e, (e => { const r = i || !t(e, n); return i = !1, n = e, r })) } e.None = () => p.None, e.once = t, e.map = n, e.forEach = i, e.filter = r, e.signal = function(e) { return e }, e.any = function(...e) { return (t, n = null, i) => f(...e.map((e => e((e => t.call(n, e)), null, i)))) }, e.reduce = s, e.debounce = a, e.latch = l, e.split = function(t, n) { return [e.filter(t, n), e.filter(t, (e => !n(e)))] }, e.buffer = function(e, t = !1, n = []) { let i = n.slice(), r = e((e => { i ? i.push(e) : o.fire(e) })); const s = () => { i && i.forEach((e => o.fire(e))), i = null }, o = new H({ onFirstListenerAdd() { r || (r = e((e => o.fire(e)))) }, onFirstListenerDidAdd() { i && (t ? setTimeout(s) : s()) }, onLastListenerRemove() { r && r.dispose(), r = null } }); return o.event }; class u { constructor(e) { this.event = e } map(e) { return new u(n(this.event, e)) } forEach(e) { return new u(i(this.event, e)) } filter(e) { return new u(r(this.event, e)) } reduce(e, t) { return new u(s(this.event, e, t)) } latch() { return new u(l(this.event)) } debounce(e, t = 100, n = !1, i) { return new u(a(this.event, e, t, n, i)) } on(e, t, n) { return this.event(e, t, n) } once(e, n, i) { return t(this.event)(e, n, i) } } e.chain = function(e) { return new u(e) }, e.fromNodeEventEmitter = function(e, t, n = (e => e)) { const i = (...e) => r.fire(n(...e)), r = new H({ onFirstListenerAdd: () => e.on(t, i), onLastListenerRemove: () => e.removeListener(t, i) }); return r.event }, e.fromDOMEventEmitter = function(e, t, n = (e => e)) { const i = (...e) => r.fire(n(...e)), r = new H({ onFirstListenerAdd: () => e.addEventListener(t, i), onLastListenerRemove: () => e.removeEventListener(t, i) }); return r.event }, e.toPromise = function(e) { return new Promise((n => t(e)(n))) } }(B || (B = {})); class q { constructor(e) { this._listenerCount = 0, this._invocationCount = 0, this._elapsedOverall = 0, this._name = `${e}_${q._idPool++}` } start(e) { this._stopWatch = new U(!0), this._listenerCount = e } stop() { if (this._stopWatch) { const e = this._stopWatch.elapsed(); this._elapsedOverall += e, this._invocationCount += 1, console.info(`did FIRE ${this._name}: elapsed_ms: ${e.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`), this._stopWatch = void 0 } } } q._idPool = 0; class H { constructor(e) { var t; this._disposed = !1, this._options = e, this._leakageMon = void 0, this._perfMon = (null === (t = this._options) || void 0 === t ? void 0 : t._profName) ? new q(this._options._profName) : void 0 } get event() { return this._event || (this._event = (e, t, n) => { var i; this._listeners || (this._listeners = new L); const r = this._listeners.isEmpty(); r && this._options && this._options.onFirstListenerAdd && this._options.onFirstListenerAdd(this); const s = this._listeners.push(t ? [e, t] : e); r && this._options && this._options.onFirstListenerDidAdd && this._options.onFirstListenerDidAdd(this), this._options && this._options.onListenerDidAdd && this._options.onListenerDidAdd(this, e, t); const o = null === (i = this._leakageMon) || void 0 === i ? void 0 : i.check(this._listeners.size), a = g((() => { if (o && o(), !this._disposed && (s(), this._options && this._options.onLastListenerRemove)) { this._listeners && !this._listeners.isEmpty() || this._options.onLastListenerRemove(this) } })); return n instanceof _ ? n.add(a) : Array.isArray(n) && n.push(a), a }), this._event } fire(e) { var n, i; if (this._listeners) { this._deliveryQueue || (this._deliveryQueue = new L); for (let t of this._listeners) this._deliveryQueue.push([t, e]); for (null === (n = this._perfMon) || void 0 === n || n.start(this._deliveryQueue.size); this._deliveryQueue.size > 0;) { const [e, n] = this._deliveryQueue.shift(); try { "function" == typeof e ? e.call(void 0, n) : e[0].call(e[1], n) } catch (e) { t(e) } } null === (i = this._perfMon) || void 0 === i || i.stop() } } dispose() { var e, t, n, i, r; this._disposed || (this._disposed = !0, null === (e = this._listeners) || void 0 === e || e.clear(), null === (t = this._deliveryQueue) || void 0 === t || t.clear(), null === (i = null === (n = this._options) || void 0 === n ? void 0 : n.onLastListenerRemove) || void 0 === i || i.call(n), null === (r = this._leakageMon) || void 0 === r || r.dispose()) } } function W(e) { const t = []; for (const n of function(e) { let t = [], n = Object.getPrototypeOf(e); for (; Object.prototype !== n;) t = t.concat(Object.getOwnPropertyNames(n)), n = Object.getPrototypeOf(n); return t }(e)) "function" == typeof e[n] && t.push(n); return t } function $(e) { return e >= 65 && e <= 90 } function j(e) { return 55296 <= e && e <= 56319 } function G(e) { return 56320 <= e && e <= 57343 } function z(e, t) { return t - 56320 + (e - 55296 << 10) + 65536 } String.fromCharCode(65279); class Y { constructor() { this._data = JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]") } static getInstance() { return Y._INSTANCE || (Y._INSTANCE = new Y), Y._INSTANCE } getGraphemeBreakType(e) { if (e < 32) return 10 === e ? 3 : 13 === e ? 2 : 4; if (e < 127) return 0; const t = this._data, n = t.length / 3; let i = 1; for (; i <= n;) if (e < t[3 * i]) i *= 2; else { if (!(e > t[3 * i + 1])) return t[3 * i + 2]; i = 2 * i + 1 } return 0 } } Y._INSTANCE = null; const Q = "$initialize"; let X; class Z { constructor(e, t, n, i) { this.vsWorker = e, this.req = t, this.method = n, this.args = i, this.type = 0 } } class J { constructor(e, t, n, i) { this.vsWorker = e, this.seq = t, this.res = n, this.err = i, this.type = 1 } } class ee { constructor(e, t, n, i) { this.vsWorker = e, this.req = t, this.eventName = n, this.arg = i, this.type = 2 } } class te { constructor(e, t, n) { this.vsWorker = e, this.req = t, this.event = n, this.type = 3 } } class ne { constructor(e, t) { this.vsWorker = e, this.req = t, this.type = 4 } } class ie { constructor(e) { this._workerId = -1, this._handler = e, this._lastSentReq = 0, this._pendingReplies = Object.create(null), this._pendingEmitters = new Map, this._pendingEvents = new Map } setWorkerId(e) { this._workerId = e } sendMessage(e, t) { const n = String(++this._lastSentReq); return new Promise(((i, r) => { this._pendingReplies[n] = { resolve: i, reject: r }, this._send(new Z(this._workerId, n, e, t)) })) } listen(e, t) { let n = null; const i = new H({ onFirstListenerAdd: () => { n = String(++this._lastSentReq), this._pendingEmitters.set(n, i), this._send(new ee(this._workerId, n, e, t)) }, onLastListenerRemove: () => { this._pendingEmitters.delete(n), this._send(new ne(this._workerId, n)), n = null } }); return i.event } handleMessage(e) { e && e.vsWorker && (-1 !== this._workerId && e.vsWorker !== this._workerId || this._handleMessage(e)) } _handleMessage(e) { switch (e.type) { case 1: return this._handleReplyMessage(e); case 0: return this._handleRequestMessage(e); case 2: return this._handleSubscribeEventMessage(e); case 3: return this._handleEventMessage(e); case 4: return this._handleUnsubscribeEventMessage(e) } } _handleReplyMessage(e) { if (!this._pendingReplies[e.seq]) return void console.warn("Got reply to unknown seq"); let t = this._pendingReplies[e.seq]; if (delete this._pendingReplies[e.seq], e.err) { let n = e.err; return e.err.$isError && (n = new Error, n.name = e.err.name, n.message = e.err.message, n.stack = e.err.stack), void t.reject(n) } t.resolve(e.res) } _handleRequestMessage(e) { let t = e.req; this._handler.handleMessage(e.method, e.args).then((e => { this._send(new J(this._workerId, t, e, void 0)) }), (e => { e.detail instanceof Error && (e.detail = n(e.detail)), this._send(new J(this._workerId, t, void 0, n(e))) })) } _handleSubscribeEventMessage(e) { const t = e.req, n = this._handler.handleEvent(e.eventName, e.arg)((e => { this._send(new te(this._workerId, t, e)) })); this._pendingEvents.set(t, n) } _handleEventMessage(e) { this._pendingEmitters.has(e.req) ? this._pendingEmitters.get(e.req).fire(e.event) : console.warn("Got event for unknown req") } _handleUnsubscribeEventMessage(e) { this._pendingEvents.has(e.req) ? (this._pendingEvents.get(e.req).dispose(), this._pendingEvents.delete(e.req)) : console.warn("Got unsubscribe for unknown req") } _send(e) { let t = []; if (0 === e.type) for (let n = 0; n < e.args.length; n++) e.args[n] instanceof ArrayBuffer && t.push(e.args[n]); else 1 === e.type && e.res instanceof ArrayBuffer && t.push(e.res); this._handler.sendMessage(e, t) } } function re(e) { return "o" === e[0] && "n" === e[1] && $(e.charCodeAt(2)) } function se(e) { return /^onDynamic/.test(e) && $(e.charCodeAt(9)) } function oe(e, t, n) { const i = e => function() { const n = Array.prototype.slice.call(arguments, 0); return t(e, n) }, r = e => function(t) { return n(e, t) }; let s = {}; for (const t of e) se(t) ? s[t] = r(t) : re(t) ? s[t] = n(t, void 0) : s[t] = i(t); return s } class ae { constructor(e, t) { this._requestHandlerFactory = t, this._requestHandler = null, this._protocol = new ie({ sendMessage: (t, n) => { e(t, n) }, handleMessage: (e, t) => this._handleMessage(e, t), handleEvent: (e, t) => this._handleEvent(e, t) }) } onmessage(e) { this._protocol.handleMessage(e) } _handleMessage(e, t) { if (e === Q) return this.initialize(t[0], t[1], t[2], t[3]); if (!this._requestHandler || "function" != typeof this._requestHandler[e]) return Promise.reject(new Error("Missing requestHandler or method: " + e)); try { return Promise.resolve(this._requestHandler[e].apply(this._requestHandler, t)) } catch (e) { return Promise.reject(e) } } _handleEvent(e, t) { if (!this._requestHandler) throw new Error("Missing requestHandler"); if (se(e)) { const n = this._requestHandler[e].call(this._requestHandler, t); if ("function" != typeof n) throw new Error(`Missing dynamic event ${e} on request handler.`); return n } if (re(e)) { const t = this._requestHandler[e]; if ("function" != typeof t) throw new Error(`Missing event ${e} on request handler.`); return t } throw new Error(`Malformed event name ${e}`) } initialize(e, t, n, i) { this._protocol.setWorkerId(e); const r = oe(i, ((e, t) => this._protocol.sendMessage(e, t)), ((e, t) => this._protocol.listen(e, t))); return this._requestHandlerFactory ? (this._requestHandler = this._requestHandlerFactory(r), Promise.resolve(W(this._requestHandler))) : (t && (void 0 !== t.baseUrl && delete t.baseUrl, void 0 !== t.paths && void 0 !== t.paths.vs && delete t.paths.vs, void 0 !== typeof t.trustedTypesPolicy && delete t.trustedTypesPolicy, t.catchError = !0, R.require.config(t)), new Promise(((e, t) => { (0, R.require)([n], (n => { this._requestHandler = n.create(r), this._requestHandler ? e(W(this._requestHandler)) : t(new Error("No RequestHandler!")) }), t) }))) } } class le { constructor(e, t, n, i) { this.originalStart = e, this.originalLength = t, this.modifiedStart = n, this.modifiedLength = i } getOriginalEnd() { return this.originalStart + this.originalLength } getModifiedEnd() { return this.modifiedStart + this.modifiedLength } } function ue(e, t) { return (t << 5) - t + e | 0 } function he(e, t) { t = ue(149417, t); for (let n = 0, i = e.length; n < i; n++) t = ue(e.charCodeAt(n), t); return t } function de(e, t, n = 32) { const i = n - t; return (e << t | (~((1 << i) - 1) & e) >>> i) >>> 0 } function ce(e, t = 0, n = e.byteLength, i = 0) { for (let r = 0; r < n; r++) e[t + r] = i } function me(e, t = 32) { return e instanceof ArrayBuffer ? Array.from(new Uint8Array(e)).map((e => e.toString(16).padStart(2, "0"))).join("") : function(e, t, n = "0") { for (; e.length < t;) e = n + e; return e }((e >>> 0).toString(16), t / 4) } class fe { constructor() { this._h0 = 1732584193, this._h1 = 4023233417, this._h2 = 2562383102, this._h3 = 271733878, this._h4 = 3285377520, this._buff = new Uint8Array(67), this._buffDV = new DataView(this._buff.buffer), this._buffLen = 0, this._totalLen = 0, this._leftoverHighSurrogate = 0, this._finished = !1 } update(e) { const t = e.length; if (0 === t) return; const n = this._buff; let i, r, s = this._buffLen, o = this._leftoverHighSurrogate; for (0 !== o ? (i = o, r = -1, o = 0) : (i = e.charCodeAt(0), r = 0);;) { let a = i; if (j(i)) { if (!(r + 1 < t)) { o = i; break } { const t = e.charCodeAt(r + 1); G(t) ? (r++, a = z(i, t)) : a = 65533 } } else G(i) && (a = 65533); if (s = this._push(n, s, a), r++, !(r < t)) break; i = e.charCodeAt(r) } this._buffLen = s, this._leftoverHighSurrogate = o } _push(e, t, n) { return n < 128 ? e[t++] = n : n < 2048 ? (e[t++] = 192 | (1984 & n) >>> 6, e[t++] = 128 | (63 & n) >>> 0) : n < 65536 ? (e[t++] = 224 | (61440 & n) >>> 12, e[t++] = 128 | (4032 & n) >>> 6, e[t++] = 128 | (63 & n) >>> 0) : (e[t++] = 240 | (1835008 & n) >>> 18, e[t++] = 128 | (258048 & n) >>> 12, e[t++] = 128 | (4032 & n) >>> 6, e[t++] = 128 | (63 & n) >>> 0), t >= 64 && (this._step(), t -= 64, this._totalLen += 64, e[0] = e[64], e[1] = e[65], e[2] = e[66]), t } digest() { return this._finished || (this._finished = !0, this._leftoverHighSurrogate && (this._leftoverHighSurrogate = 0, this._buffLen = this._push(this._buff, this._buffLen, 65533)), this._totalLen += this._buffLen, this._wrapUp()), me(this._h0) + me(this._h1) + me(this._h2) + me(this._h3) + me(this._h4) } _wrapUp() { this._buff[this._buffLen++] = 128, ce(this._buff, this._buffLen), this._buffLen > 56 && (this._step(), ce(this._buff)); const e = 8 * this._totalLen; this._buffDV.setUint32(56, Math.floor(e / 4294967296), !1), this._buffDV.setUint32(60, e % 4294967296, !1), this._step() } _step() { const e = fe._bigBlock32, t = this._buffDV; for (let n = 0; n < 64; n += 4) e.setUint32(n, t.getUint32(n, !1), !1); for (let t = 64; t < 320; t += 4) e.setUint32(t, de(e.getUint32(t - 12, !1) ^ e.getUint32(t - 32, !1) ^ e.getUint32(t - 56, !1) ^ e.getUint32(t - 64, !1), 1), !1); let n, i, r, s = this._h0, o = this._h1, a = this._h2, l = this._h3, u = this._h4; for (let t = 0; t < 80; t++) t < 20 ? (n = o & a | ~o & l, i = 1518500249) : t < 40 ? (n = o ^ a ^ l, i = 1859775393) : t < 60 ? (n = o & a | o & l | a & l, i = 2400959708) : (n = o ^ a ^ l, i = 3395469782), r = de(s, 5) + n + u + i + e.getUint32(4 * t, !1) & 4294967295, u = l, l = a, a = de(o, 30), o = s, s = r; this._h0 = this._h0 + s & 4294967295, this._h1 = this._h1 + o & 4294967295, this._h2 = this._h2 + a & 4294967295, this._h3 = this._h3 + l & 4294967295, this._h4 = this._h4 + u & 4294967295 } } fe._bigBlock32 = new DataView(new ArrayBuffer(320)); class ge { constructor(e) { this.source = e } getElements() { const e = this.source, t = new Int32Array(e.length); for (let n = 0, i = e.length; n < i; n++) t[n] = e.charCodeAt(n); return t } } function _e(e, t, n) { return new Se(new ge(e), new ge(t)).ComputeDiff(n).changes } class pe { static Assert(e, t) { if (!e) throw new Error(t) } } class Ce { static Copy(e, t, n, i, r) { for (let s = 0; s < r; s++) n[i + s] = e[t + s] } static Copy2(e, t, n, i, r) { for (let s = 0; s < r; s++) n[i + s] = e[t + s] } } class Le { constructor() { this.m_changes = [], this.m_originalStart = 1073741824, this.m_modifiedStart = 1073741824, this.m_originalCount = 0, this.m_modifiedCount = 0 } MarkNextChange() { (this.m_originalCount > 0 || this.m_modifiedCount > 0) && this.m_changes.push(new le(this.m_originalStart, this.m_originalCount, this.m_modifiedStart, this.m_modifiedCount)), this.m_originalCount = 0, this.m_modifiedCount = 0, this.m_originalStart = 1073741824, this.m_modifiedStart = 1073741824 } AddOriginalElement(e, t) { this.m_originalStart = Math.min(this.m_originalStart, e), this.m_modifiedStart = Math.min(this.m_modifiedStart, t), this.m_originalCount++ } AddModifiedElement(e, t) { this.m_originalStart = Math.min(this.m_originalStart, e), this.m_modifiedStart = Math.min(this.m_modifiedStart, t), this.m_modifiedCount++ } getChanges() { return (this.m_originalCount > 0 || this.m_modifiedCount > 0) && this.MarkNextChange(), this.m_changes } getReverseChanges() { return (this.m_originalCount > 0 || this.m_modifiedCount > 0) && this.MarkNextChange(), this.m_changes.reverse(), this.m_changes } } class Se { constructor(e, t, n = null) { this.ContinueProcessingPredicate = n, this._originalSequence = e, this._modifiedSequence = t; const [i, r, s] = Se._getElements(e), [o, a, l] = Se._getElements(t); this._hasStrings = s && l, this._originalStringElements = i, this._originalElementsOrHash = r, this._modifiedStringElements = o, this._modifiedElementsOrHash = a, this.m_forwardHistory = [], this.m_reverseHistory = [] } static _isStringArray(e) { return e.length > 0 && "string" == typeof e[0] } static _getElements(e) { const t = e.getElements(); if (Se._isStringArray(t)) { const e = new Int32Array(t.length); for (let n = 0, i = t.length; n < i; n++) e[n] = he(t[n], 0); return [t, e, !0] } return t instanceof Int32Array ? [ [], t, !1 ] : [ [], new Int32Array(t), !1 ] } ElementsAreEqual(e, t) { return this._originalElementsOrHash[e] === this._modifiedElementsOrHash[t] && (!this._hasStrings || this._originalStringElements[e] === this._modifiedStringElements[t]) } ElementsAreStrictEqual(e, t) { if (!this.ElementsAreEqual(e, t)) return !1; return Se._getStrictElement(this._originalSequence, e) === Se._getStrictElement(this._modifiedSequence, t) } static _getStrictElement(e, t) { return "function" == typeof e.getStrictElement ? e.getStrictElement(t) : null } OriginalElementsAreEqual(e, t) { return this._originalElementsOrHash[e] === this._originalElementsOrHash[t] && (!this._hasStrings || this._originalStringElements[e] === this._originalStringElements[t]) } ModifiedElementsAreEqual(e, t) { return this._modifiedElementsOrHash[e] === this._modifiedElementsOrHash[t] && (!this._hasStrings || this._modifiedStringElements[e] === this._modifiedStringElements[t]) } ComputeDiff(e) { return this._ComputeDiff(0, this._originalElementsOrHash.length - 1, 0, this._modifiedElementsOrHash.length - 1, e) } _ComputeDiff(e, t, n, i, r) { const s = [!1]; let o = this.ComputeDiffRecursive(e, t, n, i, s); return r && (o = this.PrettifyChanges(o)), { quitEarly: s[0], changes: o } } ComputeDiffRecursive(e, t, n, i, r) { for (r[0] = !1; e <= t && n <= i && this.ElementsAreEqual(e, n);) e++, n++; for (; t >= e && i >= n && this.ElementsAreEqual(t, i);) t--, i--; if (e > t || n > i) { let r; return n <= i ? (pe.Assert(e === t + 1, "originalStart should only be one more than originalEnd"), r = [new le(e, 0, n, i - n + 1)]) : e <= t ? (pe.Assert(n === i + 1, "modifiedStart should only be one more than modifiedEnd"), r = [new le(e, t - e + 1, n, 0)]) : (pe.Assert(e === t + 1, "originalStart should only be one more than originalEnd"), pe.Assert(n === i + 1, "modifiedStart should only be one more than modifiedEnd"), r = []), r } const s = [0], o = [0], a = this.ComputeRecursionPoint(e, t, n, i, s, o, r), l = s[0], u = o[0]; if (null !== a) return a; if (!r[0]) { const s = this.ComputeDiffRecursive(e, l, n, u, r); let o = []; return o = r[0] ? [new le(l + 1, t - (l + 1) + 1, u + 1, i - (u + 1) + 1)] : this.ComputeDiffRecursive(l + 1, t, u + 1, i, r), this.ConcatenateChanges(s, o) } return [new le(e, t - e + 1, n, i - n + 1)] } WALKTRACE(e, t, n, i, r, s, o, a, l, u, h, d, c, m, f, g, _, p) { let C = null, L = null, S = new Le, b = t, N = n, E = c[0] - g[0] - i, y = -1073741824, A = this.m_forwardHistory.length - 1; do { const t = E + e; t === b || t < N && l[t - 1] < l[t + 1] ? (m = (h = l[t + 1]) - E - i, h < y && S.MarkNextChange(), y = h, S.AddModifiedElement(h + 1, m), E = t + 1 - e) : (m = (h = l[t - 1] + 1) - E - i, h < y && S.MarkNextChange(), y = h - 1, S.AddOriginalElement(h, m + 1), E = t - 1 - e), A >= 0 && (e = (l = this.m_forwardHistory[A])[0], b = 1, N = l.length - 1) } while (--A >= -1); if (C = S.getReverseChanges(), p[0]) { let e = c[0] + 1, t = g[0] + 1; if (null !== C && C.length > 0) { const n = C[C.length - 1]; e = Math.max(e, n.getOriginalEnd()), t = Math.max(t, n.getModifiedEnd()) } L = [new le(e, d - e + 1, t, f - t + 1)] } else { S = new Le, b = s, N = o, E = c[0] - g[0] - a, y = 1073741824, A = _ ? this.m_reverseHistory.length - 1 : this.m_reverseHistory.length - 2; do { const e = E + r; e === b || e < N && u[e - 1] >= u[e + 1] ? (m = (h = u[e + 1] - 1) - E - a, h > y && S.MarkNextChange(), y = h + 1, S.AddOriginalElement(h + 1, m + 1), E = e + 1 - r) : (m = (h = u[e - 1]) - E - a, h > y && S.MarkNextChange(), y = h, S.AddModifiedElement(h + 1, m + 1), E = e - 1 - r), A >= 0 && (r = (u = this.m_reverseHistory[A])[0], b = 1, N = u.length - 1) } while (--A >= -1); L = S.getChanges() } return this.ConcatenateChanges(C, L) } ComputeRecursionPoint(e, t, n, i, r, s, o) { let a = 0, l = 0, u = 0, h = 0, d = 0, c = 0; e--, n--, r[0] = 0, s[0] = 0, this.m_forwardHistory = [], this.m_reverseHistory = []; const m = t - e + (i - n), f = m + 1, g = new Int32Array(f), _ = new Int32Array(f), p = i - n, C = t - e, L = e - n, S = t - i, b = (C - p) % 2 == 0; g[p] = e, _[C] = t, o[0] = !1; for (let N = 1; N <= m / 2 + 1; N++) { let m = 0, E = 0; u = this.ClipDiagonalBound(p - N, N, p, f), h = this.ClipDiagonalBound(p + N, N, p, f); for (let e = u; e <= h; e += 2) { a = e === u || e < h && g[e - 1] < g[e + 1] ? g[e + 1] : g[e - 1] + 1, l = a - (e - p) - L; const n = a; for (; a < t && l < i && this.ElementsAreEqual(a + 1, l + 1);) a++, l++; if (g[e] = a, a + l > m + E && (m = a, E = l), !b && Math.abs(e - C) <= N - 1 && a >= _[e]) return r[0] = a, s[0] = l, n <= _[e] && N <= 1448 ? this.WALKTRACE(p, u, h, L, C, d, c, S, g, _, a, t, r, l, i, s, b, o) : null } const y = (m - e + (E - n) - N) / 2; if (null !== this.ContinueProcessingPredicate && !this.ContinueProcessingPredicate(m, y)) return o[0] = !0, r[0] = m, s[0] = E, y > 0 && N <= 1448 ? this.WALKTRACE(p, u, h, L, C, d, c, S, g, _, a, t, r, l, i, s, b, o) : (e++, n++, [new le(e, t - e + 1, n, i - n + 1)]); d = this.ClipDiagonalBound(C - N, N, C, f), c = this.ClipDiagonalBound(C + N, N, C, f); for (let m = d; m <= c; m += 2) { a = m === d || m < c && _[m - 1] >= _[m + 1] ? _[m + 1] - 1 : _[m - 1], l = a - (m - C) - S; const f = a; for (; a > e && l > n && this.ElementsAreEqual(a, l);) a--, l--; if (_[m] = a, b && Math.abs(m - p) <= N && a <= g[m]) return r[0] = a, s[0] = l, f >= g[m] && N <= 1448 ? this.WALKTRACE(p, u, h, L, C, d, c, S, g, _, a, t, r, l, i, s, b, o) : null } if (N <= 1447) { let e = new Int32Array(h - u + 2); e[0] = p - u + 1, Ce.Copy2(g, u, e, 1, h - u + 1), this.m_forwardHistory.push(e), e = new Int32Array(c - d + 2), e[0] = C - d + 1, Ce.Copy2(_, d, e, 1, c - d + 1), this.m_reverseHistory.push(e) } } return this.WALKTRACE(p, u, h, L, C, d, c, S, g, _, a, t, r, l, i, s, b, o) } PrettifyChanges(e) { for (let t = 0; t < e.length; t++) { const n = e[t], i = t < e.length - 1 ? e[t + 1].originalStart : this._originalElementsOrHash.length, r = t < e.length - 1 ? e[t + 1].modifiedStart : this._modifiedElementsOrHash.length, s = n.originalLength > 0, o = n.modifiedLength > 0; for (; n.originalStart + n.originalLength < i && n.modifiedStart + n.modifiedLength < r && (!s || this.OriginalElementsAreEqual(n.originalStart, n.originalStart + n.originalLength)) && (!o || this.ModifiedElementsAreEqual(n.modifiedStart, n.modifiedStart + n.modifiedLength));) { const e = this.ElementsAreStrictEqual(n.originalStart, n.modifiedStart); if (this.ElementsAreStrictEqual(n.originalStart + n.originalLength, n.modifiedStart + n.modifiedLength) && !e) break; n.originalStart++, n.modifiedStart++ } let a = [null]; t < e.length - 1 && this.ChangesOverlap(e[t], e[t + 1], a) && (e[t] = a[0], e.splice(t + 1, 1), t--) } for (let t = e.length - 1; t >= 0; t--) { const n = e[t]; let i = 0, r = 0; if (t > 0) { const n = e[t - 1]; i = n.originalStart + n.originalLength, r = n.modifiedStart + n.modifiedLength } const s = n.originalLength > 0, o = n.modifiedLength > 0; let a = 0, l = this._boundaryScore(n.originalStart, n.originalLength, n.modifiedStart, n.modifiedLength); for (let e = 1;; e++) { const t = n.originalStart - e, u = n.modifiedStart - e; if (t < i || u < r) break; if (s && !this.OriginalElementsAreEqual(t, t + n.originalLength)) break; if (o && !this.ModifiedElementsAreEqual(u, u + n.modifiedLength)) break; const h = (t === i && u === r ? 5 : 0) + this._boundaryScore(t, n.originalLength, u, n.modifiedLength); h > l && (l = h, a = e) } n.originalStart -= a, n.modifiedStart -= a; const u = [null]; t > 0 && this.ChangesOverlap(e[t - 1], e[t], u) && (e[t - 1] = u[0], e.splice(t, 1), t++) } if (this._hasStrings) for (let t = 1, n = e.length; t < n; t++) { const n = e[t - 1], i = e[t], r = i.originalStart - n.originalStart - n.originalLength, s = n.originalStart, o = i.originalStart + i.originalLength, a = o - s, l = n.modifiedStart, u = i.modifiedStart + i.modifiedLength, h = u - l; if (r < 5 && a < 20 && h < 20) { const e = this._findBetterContiguousSequence(s, a, l, h, r); if (e) { const [t, s] = e; t === n.originalStart + n.originalLength && s === n.modifiedStart + n.modifiedLength || (n.originalLength = t - n.originalStart, n.modifiedLength = s - n.modifiedStart, i.originalStart = t + r, i.modifiedStart = s + r, i.originalLength = o - i.originalStart, i.modifiedLength = u - i.modifiedStart) } } } return e } _findBetterContiguousSequence(e, t, n, i, r) { if (t < r || i < r) return null; const s = e + t - r + 1, o = n + i - r + 1; let a = 0, l = 0, u = 0; for (let t = e; t < s; t++) for (let e = n; e < o; e++) { const n = this._contiguousSequenceScore(t, e, r); n > 0 && n > a && (a = n, l = t, u = e) } return a > 0 ? [l, u] : null } _contiguousSequenceScore(e, t, n) { let i = 0; for (let r = 0; r < n; r++) { if (!this.ElementsAreEqual(e + r, t + r)) return 0; i += this._originalStringElements[e + r].length } return i } _OriginalIsBoundary(e) { return e <= 0 || e >= this._originalElementsOrHash.length - 1 || this._hasStrings && /^\s*$/.test(this._originalStringElements[e]) } _OriginalRegionIsBoundary(e, t) { if (this._OriginalIsBoundary(e) || this._OriginalIsBoundary(e - 1)) return !0; if (t > 0) { const n = e + t; if (this._OriginalIsBoundary(n - 1) || this._OriginalIsBoundary(n)) return !0 } return !1 } _ModifiedIsBoundary(e) { return e <= 0 || e >= this._modifiedElementsOrHash.length - 1 || this._hasStrings && /^\s*$/.test(this._modifiedStringElements[e]) } _ModifiedRegionIsBoundary(e, t) { if (this._ModifiedIsBoundary(e) || this._ModifiedIsBoundary(e - 1)) return !0; if (t > 0) { const n = e + t; if (this._ModifiedIsBoundary(n - 1) || this._ModifiedIsBoundary(n)) return !0 } return !1 } _boundaryScore(e, t, n, i) { return (this._OriginalRegionIsBoundary(e, t) ? 1 : 0) + (this._ModifiedRegionIsBoundary(n, i) ? 1 : 0) } ConcatenateChanges(e, t) { let n = []; if (0 === e.length || 0 === t.length) return t.length > 0 ? t : e; if (this.ChangesOverlap(e[e.length - 1], t[0], n)) { const i = new Array(e.length + t.length - 1); return Ce.Copy(e, 0, i, 0, e.length - 1), i[e.length - 1] = n[0], Ce.Copy(t, 1, i, e.length, t.length - 1), i } { const n = new Array(e.length + t.length); return Ce.Copy(e, 0, n, 0, e.length), Ce.Copy(t, 0, n, e.length, t.length), n } } ChangesOverlap(e, t, n) { if (pe.Assert(e.originalStart <= t.originalStart, "Left change is not less than or equal to right change"), pe.Assert(e.modifiedStart <= t.modifiedStart, "Left change is not less than or equal to right change"), e.originalStart + e.originalLength >= t.originalStart || e.modifiedStart + e.modifiedLength >= t.modifiedStart) { const i = e.originalStart; let r = e.originalLength; const s = e.modifiedStart; let o = e.modifiedLength; return e.originalStart + e.originalLength >= t.originalStart && (r = t.originalStart + t.originalLength - e.originalStart), e.modifiedStart + e.modifiedLength >= t.modifiedStart && (o = t.modifiedStart + t.modifiedLength - e.modifiedStart), n[0] = new le(i, r, s, o), !0 } return n[0] = null, !1 } ClipDiagonalBound(e, t, n, i) { if (e >= 0 && e < i) return e; const r = t % 2 == 0; if (e < 0) { return r === (n % 2 == 0) ? 0 : 1 } return r === ((i - n - 1) % 2 == 0) ? i - 1 : i - 2 } } if (void 0 !== R.vscode && void 0 !== R.vscode.process) { const e = R.vscode.process; X = { get platform() { return e.platform }, get arch() { return e.arch }, get env() { return e.env }, cwd: () => e.cwd(), nextTick: e => D(e) } } else X = "undefined" != typeof process ? { get platform() { return process.platform }, get arch() { return process.arch }, get env() { return process.env }, cwd: () => process.env.VSCODE_CWD || process.cwd(), nextTick: e => process.nextTick(e) } : { get platform() { return x ? "win32" : k ? "darwin" : "linux" }, get arch() {}, nextTick: e => D(e), get env() { return {} }, cwd: () => "/" }; const be = X.cwd, Ne = X.env, Ee = X.platform, ye = 46, Ae = 47, we = 92, ve = 58; class Me extends Error { constructor(e, t, n) { let i; "string" == typeof t && 0 === t.indexOf("not ") ? (i = "must not be", t = t.replace(/^not /, "")) : i = "must be"; const r = -1 !== e.indexOf(".") ? "property" : "argument"; let s = `The "${e}" ${r} ${i} of type ${t}`; s += ". Received type " + typeof n, super(s), this.code = "ERR_INVALID_ARG_TYPE" } } function Ke(e, t) { if ("string" != typeof e) throw new Me(t, "string", e) } function Oe(e) { return e === Ae || e === we } function Te(e) { return e === Ae } function Re(e) { return e >= 65 && e <= 90 || e >= 97 && e <= 122 } function Ve(e, t, n, i) { let r = "", s = 0, o = -1, a = 0, l = 0; for (let u = 0; u <= e.length; ++u) { if (u < e.length) l = e.charCodeAt(u); else { if (i(l)) break; l = Ae } if (i(l)) { if (o === u - 1 || 1 === a); else if (2 === a) { if (r.length < 2 || 2 !== s || r.charCodeAt(r.length - 1) !== ye || r.charCodeAt(r.length - 2) !== ye) { if (r.length > 2) { const e = r.lastIndexOf(n); - 1 === e ? (r = "", s = 0) : (r = r.slice(0, e), s = r.length - 1 - r.lastIndexOf(n)), o = u, a = 0; continue } if (0 !== r.length) { r = "", s = 0, o = u, a = 0; continue } } t && (r += r.length > 0 ? `${n}..` : "..", s = 2) } else r.length > 0 ? r += `${n}${e.slice(o+1,u)}` : r = e.slice(o + 1, u), s = u - o - 1; o = u, a = 0 } else l === ye && -1 !== a ? ++a : a = -1 } return r } function Ie(e, t) { if (null === t || "object" != typeof t) throw new Me("pathObject", "Object", t); const n = t.dir || t.root, i = t.base || `${t.name||""}${t.ext||""}`; return n ? n === t.root ? `${n}${i}` : `${n}${e}${i}` : i } const Pe = { resolve(...e) { let t = "", n = "", i = !1; for (let r = e.length - 1; r >= -1; r--) { let s; if (r >= 0) { if (s = e[r], Ke(s, "path"), 0 === s.length) continue } else 0 === t.length ? s = be() : (s = Ne[`=${t}`] || be(), (void 0 === s || s.slice(0, 2).toLowerCase() !== t.toLowerCase() && s.charCodeAt(2) === we) && (s = `${t}\\`)); const o = s.length; let a = 0, l = "", u = !1; const h = s.charCodeAt(0); if (1 === o) Oe(h) && (a = 1, u = !0); else if (Oe(h)) if (u = !0, Oe(s.charCodeAt(1))) { let e = 2, t = e; for (; e < o && !Oe(s.charCodeAt(e));) e++; if (e < o && e !== t) { const n = s.slice(t, e); for (t = e; e < o && Oe(s.charCodeAt(e));) e++; if (e < o && e !== t) { for (t = e; e < o && !Oe(s.charCodeAt(e));) e++; e !== o && e === t || (l = `\\\\${n}\\${s.slice(t,e)}`, a = e) } } } else a = 1; else Re(h) && s.charCodeAt(1) === ve && (l = s.slice(0, 2), a = 2, o > 2 && Oe(s.charCodeAt(2)) && (u = !0, a = 3)); if (l.length > 0) if (t.length > 0) { if (l.toLowerCase() !== t.toLowerCase()) continue } else t = l; if (i) { if (t.length > 0) break } else if (n = `${s.slice(a)}\\${n}`, i = u, u && t.length > 0) break } return n = Ve(n, !i, "\\", Oe), i ? `${t}\\${n}` : `${t}${n}` || "." }, normalize(e) { Ke(e, "path"); const t = e.length; if (0 === t) return "."; let n, i = 0, r = !1; const s = e.charCodeAt(0); if (1 === t) return Te(s) ? "\\" : e; if (Oe(s)) if (r = !0, Oe(e.charCodeAt(1))) { let r = 2, s = r; for (; r < t && !Oe(e.charCodeAt(r));) r++; if (r < t && r !== s) { const o = e.slice(s, r); for (s = r; r < t && Oe(e.charCodeAt(r));) r++; if (r < t && r !== s) { for (s = r; r < t && !Oe(e.charCodeAt(r));) r++; if (r === t) return `\\\\${o}\\${e.slice(s)}\\`; r !== s && (n = `\\\\${o}\\${e.slice(s,r)}`, i = r) } } } else i = 1; else Re(s) && e.charCodeAt(1) === ve && (n = e.slice(0, 2), i = 2, t > 2 && Oe(e.charCodeAt(2)) && (r = !0, i = 3)); let o = i < t ? Ve(e.slice(i), !r, "\\", Oe) : ""; return 0 !== o.length || r || (o = "."), o.length > 0 && Oe(e.charCodeAt(t - 1)) && (o += "\\"), void 0 === n ? r ? `\\${o}` : o : r ? `${n}\\${o}` : `${n}${o}` }, isAbsolute(e) { Ke(e, "path"); const t = e.length; if (0 === t) return !1; const n = e.charCodeAt(0); return Oe(n) || t > 2 && Re(n) && e.charCodeAt(1) === ve && Oe(e.charCodeAt(2)) }, join(...e) { if (0 === e.length) return "."; let t, n; for (let i = 0; i < e.length; ++i) { const r = e[i]; Ke(r, "path"), r.length > 0 && (void 0 === t ? t = n = r : t += `\\${r}`) } if (void 0 === t) return "."; let i = !0, r = 0; if ("string" == typeof n && Oe(n.charCodeAt(0))) { ++r; const e = n.length; e > 1 && Oe(n.charCodeAt(1)) && (++r, e > 2 && (Oe(n.charCodeAt(2)) ? ++r : i = !1)) } if (i) { for (; r < t.length && Oe(t.charCodeAt(r));) r++; r >= 2 && (t = `\\${t.slice(r)}`) } return Pe.normalize(t) }, relative(e, t) { if (Ke(e, "from"), Ke(t, "to"), e === t) return ""; const n = Pe.resolve(e), i = Pe.resolve(t); if (n === i) return ""; if ((e = n.toLowerCase()) === (t = i.toLowerCase())) return ""; let r = 0; for (; r < e.length && e.charCodeAt(r) === we;) r++; let s = e.length; for (; s - 1 > r && e.charCodeAt(s - 1) === we;) s--; const o = s - r; let a = 0; for (; a < t.length && t.charCodeAt(a) === we;) a++; let l = t.length; for (; l - 1 > a && t.charCodeAt(l - 1) === we;) l--; const u = l - a, h = o < u ? o : u; let d = -1, c = 0; for (; c < h; c++) { const n = e.charCodeAt(r + c); if (n !== t.charCodeAt(a + c)) break; n === we && (d = c) } if (c !== h) { if (-1 === d) return i } else { if (u > h) { if (t.charCodeAt(a + c) === we) return i.slice(a + c + 1); if (2 === c) return i.slice(a + c) } o > h && (e.charCodeAt(r + c) === we ? d = c : 2 === c && (d = 3)), -1 === d && (d = 0) } let m = ""; for (c = r + d + 1; c <= s; ++c) c !== s && e.charCodeAt(c) !== we || (m += 0 === m.length ? ".." : "\\.."); return a += d, m.length > 0 ? `${m}${i.slice(a,l)}` : (i.charCodeAt(a) === we && ++a, i.slice(a, l)) }, toNamespacedPath(e) { if ("string" != typeof e) return e; if (0 === e.length) return ""; const t = Pe.resolve(e); if (t.length <= 2) return e; if (t.charCodeAt(0) === we) { if (t.charCodeAt(1) === we) { const e = t.charCodeAt(2); if (63 !== e && e !== ye) return `\\\\?\\UNC\\${t.slice(2)}` } } else if (Re(t.charCodeAt(0)) && t.charCodeAt(1) === ve && t.charCodeAt(2) === we) return `\\\\?\\${t}`; return e }, dirname(e) { Ke(e, "path"); const t = e.length; if (0 === t) return "."; let n = -1, i = 0; const r = e.charCodeAt(0); if (1 === t) return Oe(r) ? e : "."; if (Oe(r)) { if (n = i = 1, Oe(e.charCodeAt(1))) { let r = 2, s = r; for (; r < t && !Oe(e.charCodeAt(r));) r++; if (r < t && r !== s) { for (s = r; r < t && Oe(e.charCodeAt(r));) r++; if (r < t && r !== s) { for (s = r; r < t && !Oe(e.charCodeAt(r));) r++; if (r === t) return e; r !== s && (n = i = r + 1) } } } } else Re(r) && e.charCodeAt(1) === ve && (n = t > 2 && Oe(e.charCodeAt(2)) ? 3 : 2, i = n); let s = -1, o = !0; for (let n = t - 1; n >= i; --n) if (Oe(e.charCodeAt(n))) { if (!o) { s = n; break } } else o = !1; if (-1 === s) { if (-1 === n) return "."; s = n } return e.slice(0, s) }, basename(e, t) { void 0 !== t && Ke(t, "ext"), Ke(e, "path"); let n, i = 0, r = -1, s = !0; if (e.length >= 2 && Re(e.charCodeAt(0)) && e.charCodeAt(1) === ve && (i = 2), void 0 !== t && t.length > 0 && t.length <= e.length) { if (t === e) return ""; let o = t.length - 1, a = -1; for (n = e.length - 1; n >= i; --n) { const l = e.charCodeAt(n); if (Oe(l)) { if (!s) { i = n + 1; break } } else -1 === a && (s = !1, a = n + 1), o >= 0 && (l === t.charCodeAt(o) ? -1 == --o && (r = n) : (o = -1, r = a)) } return i === r ? r = a : -1 === r && (r = e.length), e.slice(i, r) } for (n = e.length - 1; n >= i; --n) if (Oe(e.charCodeAt(n))) { if (!s) { i = n + 1; break } } else -1 === r && (s = !1, r = n + 1); return -1 === r ? "" : e.slice(i, r) }, extname(e) { Ke(e, "path"); let t = 0, n = -1, i = 0, r = -1, s = !0, o = 0; e.length >= 2 && e.charCodeAt(1) === ve && Re(e.charCodeAt(0)) && (t = i = 2); for (let a = e.length - 1; a >= t; --a) { const t = e.charCodeAt(a); if (Oe(t)) { if (!s) { i = a + 1; break } } else -1 === r && (s = !1, r = a + 1), t === ye ? -1 === n ? n = a : 1 !== o && (o = 1) : -1 !== n && (o = -1) } return -1 === n || -1 === r || 0 === o || 1 === o && n === r - 1 && n === i + 1 ? "" : e.slice(n, r) }, format: Ie.bind(null, "\\"), parse(e) { Ke(e, "path"); const t = { root: "", dir: "", base: "", ext: "", name: "" }; if (0 === e.length) return t; const n = e.length; let i = 0, r = e.charCodeAt(0); if (1 === n) return Oe(r) ? (t.root = t.dir = e, t) : (t.base = t.name = e, t); if (Oe(r)) { if (i = 1, Oe(e.charCodeAt(1))) { let t = 2, r = t; for (; t < n && !Oe(e.charCodeAt(t));) t++; if (t < n && t !== r) { for (r = t; t < n && Oe(e.charCodeAt(t));) t++; if (t < n && t !== r) { for (r = t; t < n && !Oe(e.charCodeAt(t));) t++; t === n ? i = t : t !== r && (i = t + 1) } } } } else if (Re(r) && e.charCodeAt(1) === ve) { if (n <= 2) return t.root = t.dir = e, t; if (i = 2, Oe(e.charCodeAt(2))) { if (3 === n) return t.root = t.dir = e, t; i = 3 } } i > 0 && (t.root = e.slice(0, i)); let s = -1, o = i, a = -1, l = !0, u = e.length - 1, h = 0; for (; u >= i; --u) if (r = e.charCodeAt(u), Oe(r)) { if (!l) { o = u + 1; break } } else -1 === a && (l = !1, a = u + 1), r === ye ? -1 === s ? s = u : 1 !== h && (h = 1) : -1 !== s && (h = -1); return -1 !== a && (-1 === s || 0 === h || 1 === h && s === a - 1 && s === o + 1 ? t.base = t.name = e.slice(o, a) : (t.name = e.slice(o, s), t.base = e.slice(o, a), t.ext = e.slice(s, a))), t.dir = o > 0 && o !== i ? e.slice(0, o - 1) : t.root, t }, sep: "\\", delimiter: ";", win32: null, posix: null }, xe = { resolve(...e) { let t = "", n = !1; for (let i = e.length - 1; i >= -1 && !n; i--) { const r = i >= 0 ? e[i] : be(); Ke(r, "path"), 0 !== r.length && (t = `${r}/${t}`, n = r.charCodeAt(0) === Ae) } return t = Ve(t, !n, "/", Te), n ? `/${t}` : t.length > 0 ? t : "." }, normalize(e) { if (Ke(e, "path"), 0 === e.length) return "."; const t = e.charCodeAt(0) === Ae, n = e.charCodeAt(e.length - 1) === Ae; return 0 === (e = Ve(e, !t, "/", Te)).length ? t ? "/" : n ? "./" : "." : (n && (e += "/"), t ? `/${e}` : e) }, isAbsolute: e => (Ke(e, "path"), e.length > 0 && e.charCodeAt(0) === Ae), join(...e) { if (0 === e.length) return "."; let t; for (let n = 0; n < e.length; ++n) { const i = e[n]; Ke(i, "path"), i.length > 0 && (void 0 === t ? t = i : t += `/${i}`) } return void 0 === t ? "." : xe.normalize(t) }, relative(e, t) { if (Ke(e, "from"), Ke(t, "to"), e === t) return ""; if ((e = xe.resolve(e)) === (t = xe.resolve(t))) return ""; const n = e.length, i = n - 1, r = t.length - 1, s = i < r ? i : r; let o = -1, a = 0; for (; a < s; a++) { const n = e.charCodeAt(1 + a); if (n !== t.charCodeAt(1 + a)) break; n === Ae && (o = a) } if (a === s) if (r > s) { if (t.charCodeAt(1 + a) === Ae) return t.slice(1 + a + 1); if (0 === a) return t.slice(1 + a) } else i > s && (e.charCodeAt(1 + a) === Ae ? o = a : 0 === a && (o = 0)); let l = ""; for (a = 1 + o + 1; a <= n; ++a) a !== n && e.charCodeAt(a) !== Ae || (l += 0 === l.length ? ".." : "/.."); return `${l}${t.slice(1+o)}` }, toNamespacedPath: e => e, dirname(e) { if (Ke(e, "path"), 0 === e.length) return "."; const t = e.charCodeAt(0) === Ae; let n = -1, i = !0; for (let t = e.length - 1; t >= 1; --t) if (e.charCodeAt(t) === Ae) { if (!i) { n = t; break } } else i = !1; return -1 === n ? t ? "/" : "." : t && 1 === n ? "//" : e.slice(0, n) }, basename(e, t) { void 0 !== t && Ke(t, "ext"), Ke(e, "path"); let n, i = 0, r = -1, s = !0; if (void 0 !== t && t.length > 0 && t.length <= e.length) { if (t === e) return ""; let o = t.length - 1, a = -1; for (n = e.length - 1; n >= 0; --n) { const l = e.charCodeAt(n); if (l === Ae) { if (!s) { i = n + 1; break } } else -1 === a && (s = !1, a = n + 1), o >= 0 && (l === t.charCodeAt(o) ? -1 == --o && (r = n) : (o = -1, r = a)) } return i === r ? r = a : -1 === r && (r = e.length), e.slice(i, r) } for (n = e.length - 1; n >= 0; --n) if (e.charCodeAt(n) === Ae) { if (!s) { i = n + 1; break } } else -1 === r && (s = !1, r = n + 1); return -1 === r ? "" : e.slice(i, r) }, extname(e) { Ke(e, "path"); let t = -1, n = 0, i = -1, r = !0, s = 0; for (let o = e.length - 1; o >= 0; --o) { const a = e.charCodeAt(o); if (a !== Ae) - 1 === i && (r = !1, i = o + 1), a === ye ? -1 === t ? t = o : 1 !== s && (s = 1) : -1 !== t && (s = -1); else if (!r) { n = o + 1; break } } return -1 === t || -1 === i || 0 === s || 1 === s && t === i - 1 && t === n + 1 ? "" : e.slice(t, i) }, format: Ie.bind(null, "/"), parse(e) { Ke(e, "path"); const t = { root: "", dir: "", base: "", ext: "", name: "" }; if (0 === e.length) return t; const n = e.charCodeAt(0) === Ae; let i; n ? (t.root = "/", i = 1) : i = 0; let r = -1, s = 0, o = -1, a = !0, l = e.length - 1, u = 0; for (; l >= i; --l) { const t = e.charCodeAt(l); if (t !== Ae) - 1 === o && (a = !1, o = l + 1), t === ye ? -1 === r ? r = l : 1 !== u && (u = 1) : -1 !== r && (u = -1); else if (!a) { s = l + 1; break } } if (-1 !== o) { const i = 0 === s && n ? 1 : s; - 1 === r || 0 === u || 1 === u && r === o - 1 && r === s + 1 ? t.base = t.name = e.slice(i, o) : (t.name = e.slice(i, r), t.base = e.slice(i, o), t.ext = e.slice(r, o)) } return s > 0 ? t.dir = e.slice(0, s - 1) : n && (t.dir = "/"), t }, sep: "/", delimiter: ":", win32: null, posix: null }; xe.win32 = Pe.win32 = Pe, xe.posix = Pe.posix = xe; "win32" === Ee ? Pe.normalize : xe.normalize, "win32" === Ee ? Pe.resolve : xe.resolve, "win32" === Ee ? Pe.relative : xe.relative, "win32" === Ee ? Pe.dirname : xe.dirname, "win32" === Ee ? Pe.basename : xe.basename, "win32" === Ee ? Pe.extname : xe.extname, "win32" === Ee ? Pe.sep : xe.sep; const ke = /^\w[\w\d+.-]*$/, De = /^\//, Fe = /^\/\//; function Ue(e, t) { if (!e.scheme && t) throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`); if (e.scheme && !ke.test(e.scheme)) throw new Error("[UriError]: Scheme contains illegal characters."); if (e.path) if (e.authority) { if (!De.test(e.path)) throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character') } else if (Fe.test(e.path)) throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")') } const Be = "", qe = "/", He = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/; class We { constructor(e, t, n, i, r, s = !1) { "object" == typeof e ? (this.scheme = e.scheme || Be, this.authority = e.authority || Be, this.path = e.path || Be, this.query = e.query || Be, this.fragment = e.fragment || Be) : (this.scheme = function(e, t) { return e || t ? e : "file" }(e, s), this.authority = t || Be, this.path = function(e, t) { switch (e) { case "https": case "http": case "file": t ? t[0] !== qe && (t = qe + t) : t = qe } return t }(this.scheme, n || Be), this.query = i || Be, this.fragment = r || Be, Ue(this, s)) } static isUri(e) { return e instanceof We || !!e && ("string" == typeof e.authority && "string" == typeof e.fragment && "string" == typeof e.path && "string" == typeof e.query && "string" == typeof e.scheme && "string" == typeof e.fsPath && "function" == typeof e.with && "function" == typeof e.toString) } get fsPath() { return Qe(this, !1) } with(e) { if (!e) return this; let { scheme: t, authority: n, path: i, query: r, fragment: s } = e; return void 0 === t ? t = this.scheme : null === t && (t = Be), void 0 === n ? n = this.authority : null === n && (n = Be), void 0 === i ? i = this.path : null === i && (i = Be), void 0 === r ? r = this.query : null === r && (r = Be), void 0 === s ? s = this.fragment : null === s && (s = Be), t === this.scheme && n === this.authority && i === this.path && r === this.query && s === this.fragment ? this : new je(t, n, i, r, s) } static parse(e, t = !1) { const n = He.exec(e); return n ? new je(n[2] || Be, et(n[4] || Be), et(n[5] || Be), et(n[7] || Be), et(n[9] || Be), t) : new je(Be, Be, Be, Be, Be) } static file(e) { let t = Be; if (x && (e = e.replace(/\\/g, qe)), e[0] === qe && e[1] === qe) { const n = e.indexOf(qe, 2); - 1 === n ? (t = e.substring(2), e = qe) : (t = e.substring(2, n), e = e.substring(n) || qe) } return new je("file", t, e, Be, Be) } static from(e) { const t = new je(e.scheme, e.authority, e.path, e.query, e.fragment); return Ue(t, !0), t } static joinPath(e, ...t) { if (!e.path) throw new Error("[UriError]: cannot call joinPath on URI without path"); let n; return n = x && "file" === e.scheme ? We.file(Pe.join(Qe(e, !0), ...t)).path : xe.join(e.path, ...t), e.with({ path: n }) } toString(e = !1) { return Xe(this, e) } toJSON() { return this } static revive(e) { if (e) { if (e instanceof We) return e; { const t = new je(e); return t._formatted = e.external, t._fsPath = e._sep === $e ? e.fsPath : null, t } } return e } } const $e = x ? 1 : void 0; class je extends We { constructor() { super(...arguments), this._formatted = null, this._fsPath = null } get fsPath() { return this._fsPath || (this._fsPath = Qe(this, !1)), this._fsPath } toString(e = !1) { return e ? Xe(this, !0) : (this._formatted || (this._formatted = Xe(this, !1)), this._formatted) } toJSON() { const e = { $mid: 1 }; return this._fsPath && (e.fsPath = this._fsPath, e._sep = $e), this._formatted && (e.external = this._formatted), this.path && (e.path = this.path), this.scheme && (e.scheme = this.scheme), this.authority && (e.authority = this.authority), this.query && (e.query = this.query), this.fragment && (e.fragment = this.fragment), e } } const Ge = { 58: "%3A", 47: "%2F", 63: "%3F", 35: "%23", 91: "%5B", 93: "%5D", 64: "%40", 33: "%21", 36: "%24", 38: "%26", 39: "%27", 40: "%28", 41: "%29", 42: "%2A", 43: "%2B", 44: "%2C", 59: "%3B", 61: "%3D", 32: "%20" }; function ze(e, t) { let n, i = -1; for (let r = 0; r < e.length; r++) { const s = e.charCodeAt(r); if (s >= 97 && s <= 122 || s >= 65 && s <= 90 || s >= 48 && s <= 57 || 45 === s || 46 === s || 95 === s || 126 === s || t && 47 === s) - 1 !== i && (n += encodeURIComponent(e.substring(i, r)), i = -1), void 0 !== n && (n += e.charAt(r)); else { void 0 === n && (n = e.substr(0, r)); const t = Ge[s]; void 0 !== t ? (-1 !== i && (n += encodeURIComponent(e.substring(i, r)), i = -1), n += t) : -1 === i && (i = r) } } return -1 !== i && (n += encodeURIComponent(e.substring(i))), void 0 !== n ? n : e } function Ye(e) { let t; for (let n = 0; n < e.length; n++) { const i = e.charCodeAt(n); 35 === i || 63 === i ? (void 0 === t && (t = e.substr(0, n)), t += Ge[i]) : void 0 !== t && (t += e[n]) } return void 0 !== t ? t : e } function Qe(e, t) { let n; return n = e.authority && e.path.length > 1 && "file" === e.scheme ? `//${e.authority}${e.path}` : 47 === e.path.charCodeAt(0) && (e.path.charCodeAt(1) >= 65 && e.path.charCodeAt(1) <= 90 || e.path.charCodeAt(1) >= 97 && e.path.charCodeAt(1) <= 122) && 58 === e.path.charCodeAt(2) ? t ? e.path.substr(1) : e.path[1].toLowerCase() + e.path.substr(2) : e.path, x && (n = n.replace(/\//g, "\\")), n } function Xe(e, t) { const n = t ? Ye : ze; let i = "", { scheme: r, authority: s, path: o, query: a, fragment: l } = e; if (r && (i += r, i += ":"), (s || "file" === r) && (i += qe, i += qe), s) { let e = s.indexOf("@"); if (-1 !== e) { const t = s.substr(0, e); s = s.substr(e + 1), e = t.indexOf(":"), -1 === e ? i += n(t, !1) : (i += n(t.substr(0, e), !1), i += ":", i += n(t.substr(e + 1), !1)), i += "@" } s = s.toLowerCase(), e = s.indexOf(":"), -1 === e ? i += n(s, !1) : (i += n(s.substr(0, e), !1), i += s.substr(e)) } if (o) { if (o.length >= 3 && 47 === o.charCodeAt(0) && 58 === o.charCodeAt(2)) { const e = o.charCodeAt(1); e >= 65 && e <= 90 && (o = `/${String.fromCharCode(e+32)}:${o.substr(3)}`) } else if (o.length >= 2 && 58 === o.charCodeAt(1)) { const e = o.charCodeAt(0); e >= 65 && e <= 90 && (o = `${String.fromCharCode(e+32)}:${o.substr(2)}`) } i += n(o, !0) } return a && (i += "?", i += n(a, !1)), l && (i += "#", i += t ? l : ze(l, !1)), i } function Ze(e) { try { return decodeURIComponent(e) } catch (t) { return e.length > 3 ? e.substr(0, 3) + Ze(e.substr(3)) : e } } const Je = /(%[0-9A-Za-z][0-9A-Za-z])+/g; function et(e) { return e.match(Je) ? e.replace(Je, (e => Ze(e))) : e } class tt { constructor(e, t) { this.lineNumber = e, this.column = t } with(e = this.lineNumber, t = this.column) { return e === this.lineNumber && t === this.column ? this : new tt(e, t) } delta(e = 0, t = 0) { return this.with(this.lineNumber + e, this.column + t) } equals(e) { return tt.equals(this, e) } static equals(e, t) { return !e && !t || !!e && !!t && e.lineNumber === t.lineNumber && e.column === t.column } isBefore(e) { return tt.isBefore(this, e) } static isBefore(e, t) { return e.lineNumber < t.lineNumber || !(t.lineNumber < e.lineNumber) && e.column < t.column } isBeforeOrEqual(e) { return tt.isBeforeOrEqual(this, e) } static isBeforeOrEqual(e, t) { return e.lineNumber < t.lineNumber || !(t.lineNumber < e.lineNumber) && e.column <= t.column } static compare(e, t) { let n = 0 | e.lineNumber, i = 0 | t.lineNumber; if (n === i) { return (0 | e.column) - (0 | t.column) } return n - i } clone() { return new tt(this.lineNumber, this.column) } toString() { return "(" + this.lineNumber + "," + this.column + ")" } static lift(e) { return new tt(e.lineNumber, e.column) } static isIPosition(e) { return e && "number" == typeof e.lineNumber && "number" == typeof e.column } } class nt { constructor(e, t, n, i) { e > n || e === n && t > i ? (this.startLineNumber = n, this.startColumn = i, this.endLineNumber = e, this.endColumn = t) : (this.startLineNumber = e, this.startColumn = t, this.endLineNumber = n, this.endColumn = i) } isEmpty() { return nt.isEmpty(this) } static isEmpty(e) { return e.startLineNumber === e.endLineNumber && e.startColumn === e.endColumn } containsPosition(e) { return nt.containsPosition(this, e) } static containsPosition(e, t) { return !(t.lineNumber < e.startLineNumber || t.lineNumber > e.endLineNumber) && (!(t.lineNumber === e.startLineNumber && t.column < e.startColumn) && !(t.lineNumber === e.endLineNumber && t.column > e.endColumn)) } containsRange(e) { return nt.containsRange(this, e) } static containsRange(e, t) { return !(t.startLineNumber < e.startLineNumber || t.endLineNumber < e.startLineNumber) && (!(t.startLineNumber > e.endLineNumber || t.endLineNumber > e.endLineNumber) && (!(t.startLineNumber === e.startLineNumber && t.startColumn < e.startColumn) && !(t.endLineNumber === e.endLineNumber && t.endColumn > e.endColumn))) } strictContainsRange(e) { return nt.strictContainsRange(this, e) } static strictContainsRange(e, t) { return !(t.startLineNumber < e.startLineNumber || t.endLineNumber < e.startLineNumber) && (!(t.startLineNumber > e.endLineNumber || t.endLineNumber > e.endLineNumber) && (!(t.startLineNumber === e.startLineNumber && t.startColumn <= e.startColumn) && !(t.endLineNumber === e.endLineNumber && t.endColumn >= e.endColumn))) } plusRange(e) { return nt.plusRange(this, e) } static plusRange(e, t) { let n, i, r, s; return t.startLineNumber < e.startLineNumber ? (n = t.startLineNumber, i = t.startColumn) : t.startLineNumber === e.startLineNumber ? (n = t.startLineNumber, i = Math.min(t.startColumn, e.startColumn)) : (n = e.startLineNumber, i = e.startColumn), t.endLineNumber > e.endLineNumber ? (r = t.endLineNumber, s = t.endColumn) : t.endLineNumber === e.endLineNumber ? (r = t.endLineNumber, s = Math.max(t.endColumn, e.endColumn)) : (r = e.endLineNumber, s = e.endColumn), new nt(n, i, r, s) } intersectRanges(e) { return nt.intersectRanges(this, e) } static intersectRanges(e, t) { let n = e.startLineNumber, i = e.startColumn, r = e.endLineNumber, s = e.endColumn, o = t.startLineNumber, a = t.startColumn, l = t.endLineNumber, u = t.endColumn; return n < o ? (n = o, i = a) : n === o && (i = Math.max(i, a)), r > l ? (r = l, s = u) : r === l && (s = Math.min(s, u)), n > r || n === r && i > s ? null : new nt(n, i, r, s) } equalsRange(e) { return nt.equalsRange(this, e) } static equalsRange(e, t) { return !!e && !!t && e.startLineNumber === t.startLineNumber && e.startColumn === t.startColumn && e.endLineNumber === t.endLineNumber && e.endColumn === t.endColumn } getEndPosition() { return nt.getEndPosition(this) } static getEndPosition(e) { return new tt(e.endLineNumber, e.endColumn) } getStartPosition() { return nt.getStartPosition(this) } static getStartPosition(e) { return new tt(e.startLineNumber, e.startColumn) } toString() { return "[" + this.startLineNumber + "," + this.startColumn + " -> " + this.endLineNumber + "," + this.endColumn + "]" } setEndPosition(e, t) { return new nt(this.startLineNumber, this.startColumn, e, t) } setStartPosition(e, t) { return new nt(e, t, this.endLineNumber, this.endColumn) } collapseToStart() { return nt.collapseToStart(this) } static collapseToStart(e) { return new nt(e.startLineNumber, e.startColumn, e.startLineNumber, e.startColumn) } static fromPositions(e, t = e) { return new nt(e.lineNumber, e.column, t.lineNumber, t.column) } static lift(e) { return e ? new nt(e.startLineNumber, e.startColumn, e.endLineNumber, e.endColumn) : null } static isIRange(e) { return e && "number" == typeof e.startLineNumber && "number" == typeof e.startColumn && "number" == typeof e.endLineNumber && "number" == typeof e.endColumn } static areIntersectingOrTouching(e, t) { return !(e.endLineNumber < t.startLineNumber || e.endLineNumber === t.startLineNumber && e.endColumn < t.startColumn) && !(t.endLineNumber < e.startLineNumber || t.endLineNumber === e.startLineNumber && t.endColumn < e.startColumn) } static areIntersecting(e, t) { return !(e.endLineNumber < t.startLineNumber || e.endLineNumber === t.startLineNumber && e.endColumn <= t.startColumn) && !(t.endLineNumber < e.startLineNumber || t.endLineNumber === e.startLineNumber && t.endColumn <= e.startColumn) } static compareRangesUsingStarts(e, t) { if (e && t) { const n = 0 | e.startLineNumber, i = 0 | t.startLineNumber; if (n === i) { const n = 0 | e.startColumn, i = 0 | t.startColumn; if (n === i) { const n = 0 | e.endLineNumber, i = 0 | t.endLineNumber; if (n === i) { return (0 | e.endColumn) - (0 | t.endColumn) } return n - i } return n - i } return n - i } return (e ? 1 : 0) - (t ? 1 : 0) } static compareRangesUsingEnds(e, t) { return e.endLineNumber === t.endLineNumber ? e.endColumn === t.endColumn ? e.startLineNumber === t.startLineNumber ? e.startColumn - t.startColumn : e.startLineNumber - t.startLineNumber : e.endColumn - t.endColumn : e.endLineNumber - t.endLineNumber } static spansMultipleLines(e) { return e.endLineNumber > e.startLineNumber } } function it(e, t, n, i) { return new Se(e, t, n).ComputeDiff(i) } class rt { constructor(e) { const t = [], n = []; for (let i = 0, r = e.length; i < r; i++) t[i] = ut(e[i], 1), n[i] = ht(e[i], 1); this.lines = e, this._startColumns = t, this._endColumns = n } getElements() { const e = []; for (let t = 0, n = this.lines.length; t < n; t++) e[t] = this.lines[t].substring(this._startColumns[t] - 1, this._endColumns[t] - 1); return e } getStrictElement(e) { return this.lines[e] } getStartLineNumber(e) { return e + 1 } getEndLineNumber(e) { return e + 1 } createCharSequence(e, t, n) { const i = [], r = [], s = []; let o = 0; for (let a = t; a <= n; a++) { const t = this.lines[a], n = e ? this._startColumns[a] : 1, l = e ? this._endColumns[a] : t.length + 1; for (let e = n; e < l; e++) i[o] = t.charCodeAt(e - 1), r[o] = a + 1, s[o] = e, o++ } return new st(i, r, s) } } class st { constructor(e, t, n) { this._charCodes = e, this._lineNumbers = t, this._columns = n } getElements() { return this._charCodes } getStartLineNumber(e) { return this._lineNumbers[e] } getStartColumn(e) { return this._columns[e] } getEndLineNumber(e) { return this._lineNumbers[e] } getEndColumn(e) { return this._columns[e] + 1 } } class ot { constructor(e, t, n, i, r, s, o, a) { this.originalStartLineNumber = e, this.originalStartColumn = t, this.originalEndLineNumber = n, this.originalEndColumn = i, this.modifiedStartLineNumber = r, this.modifiedStartColumn = s, this.modifiedEndLineNumber = o, this.modifiedEndColumn = a } static createFromDiffChange(e, t, n) { let i, r, s, o, a, l, u, h; return 0 === e.originalLength ? (i = 0, r = 0, s = 0, o = 0) : (i = t.getStartLineNumber(e.originalStart), r = t.getStartColumn(e.originalStart), s = t.getEndLineNumber(e.originalStart + e.originalLength - 1), o = t.getEndColumn(e.originalStart + e.originalLength - 1)), 0 === e.modifiedLength ? (a = 0, l = 0, u = 0, h = 0) : (a = n.getStartLineNumber(e.modifiedStart), l = n.getStartColumn(e.modifiedStart), u = n.getEndLineNumber(e.modifiedStart + e.modifiedLength - 1), h = n.getEndColumn(e.modifiedStart + e.modifiedLength - 1)), new ot(i, r, s, o, a, l, u, h) } } class at { constructor(e, t, n, i, r) { this.originalStartLineNumber = e, this.originalEndLineNumber = t, this.modifiedStartLineNumber = n, this.modifiedEndLineNumber = i, this.charChanges = r } static createFromDiffResult(e, t, n, i, r, s, o) { let a, l, u, h, d; if (0 === t.originalLength ? (a = n.getStartLineNumber(t.originalStart) - 1, l = 0) : (a = n.getStartLineNumber(t.originalStart), l = n.getEndLineNumber(t.originalStart + t.originalLength - 1)), 0 === t.modifiedLength ? (u = i.getStartLineNumber(t.modifiedStart) - 1, h = 0) : (u = i.getStartLineNumber(t.modifiedStart), h = i.getEndLineNumber(t.modifiedStart + t.modifiedLength - 1)), s && t.originalLength > 0 && t.originalLength < 20 && t.modifiedLength > 0 && t.modifiedLength < 20 && r()) { const s = n.createCharSequence(e, t.originalStart, t.originalStart + t.originalLength - 1), a = i.createCharSequence(e, t.modifiedStart, t.modifiedStart + t.modifiedLength - 1); let l = it(s, a, r, !0).changes; o && (l = function(e) { if (e.length <= 1) return e; const t = [e[0]]; let n = t[0]; for (let i = 1, r = e.length; i < r; i++) { const r = e[i], s = r.originalStart - (n.originalStart + n.originalLength), o = r.modifiedStart - (n.modifiedStart + n.modifiedLength); Math.min(s, o) < 3 ? (n.originalLength = r.originalStart + r.originalLength - n.originalStart, n.modifiedLength = r.modifiedStart + r.modifiedLength - n.modifiedStart) : (t.push(r), n = r) } return t }(l)), d = []; for (let e = 0, t = l.length; e < t; e++) d.push(ot.createFromDiffChange(l[e], s, a)) } return new at(a, l, u, h, d) } } class lt { constructor(e, t, n) { this.shouldComputeCharChanges = n.shouldComputeCharChanges, this.shouldPostProcessCharChanges = n.shouldPostProcessCharChanges, this.shouldIgnoreTrimWhitespace = n.shouldIgnoreTrimWhitespace, this.shouldMakePrettyDiff = n.shouldMakePrettyDiff, this.originalLines = e, this.modifiedLines = t, this.original = new rt(e), this.modified = new rt(t), this.continueLineDiff = dt(n.maxComputationTime), this.continueCharDiff = dt(0 === n.maxComputationTime ? 0 : Math.min(n.maxComputationTime, 5e3)) } computeDiff() { if (1 === this.original.lines.length && 0 === this.original.lines[0].length) return 1 === this.modified.lines.length && 0 === this.modified.lines[0].length ? { quitEarly: !1, changes: [] } : { quitEarly: !1, changes: [{ originalStartLineNumber: 1, originalEndLineNumber: 1, modifiedStartLineNumber: 1, modifiedEndLineNumber: this.modified.lines.length, charChanges: [{ modifiedEndColumn: 0, modifiedEndLineNumber: 0, modifiedStartColumn: 0, modifiedStartLineNumber: 0, originalEndColumn: 0, originalEndLineNumber: 0, originalStartColumn: 0, originalStartLineNumber: 0 }] }] }; if (1 === this.modified.lines.length && 0 === this.modified.lines[0].length) return { quitEarly: !1, changes: [{ originalStartLineNumber: 1, originalEndLineNumber: this.original.lines.length, modifiedStartLineNumber: 1, modifiedEndLineNumber: 1, charChanges: [{ modifiedEndColumn: 0, modifiedEndLineNumber: 0, modifiedStartColumn: 0, modifiedStartLineNumber: 0, originalEndColumn: 0, originalEndLineNumber: 0, originalStartColumn: 0, originalStartLineNumber: 0 }] }] }; const e = it(this.original, this.modified, this.continueLineDiff, this.shouldMakePrettyDiff), t = e.changes, n = e.quitEarly; if (this.shouldIgnoreTrimWhitespace) { const e = []; for (let n = 0, i = t.length; n < i; n++) e.push(at.createFromDiffResult(this.shouldIgnoreTrimWhitespace, t[n], this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges)); return { quitEarly: n, changes: e } } const i = []; let r = 0, s = 0; for (let e = -1, n = t.length; e < n; e++) { const o = e + 1 < n ? t[e + 1] : null, a = o ? o.originalStart : this.originalLines.length, l = o ? o.modifiedStart : this.modifiedLines.length; for (; r < a && s < l;) { const e = this.originalLines[r], t = this.modifiedLines[s]; if (e !== t) { { let n = ut(e, 1), o = ut(t, 1); for (; n > 1 && o > 1;) { if (e.charCodeAt(n - 2) !== t.charCodeAt(o - 2)) break; n--, o-- }(n > 1 || o > 1) && this._pushTrimWhitespaceCharChange(i, r + 1, 1, n, s + 1, 1, o) } { let n = ht(e, 1), o = ht(t, 1); const a = e.length + 1, l = t.length + 1; for (; n < a && o < l;) { if (e.charCodeAt(n - 1) !== e.charCodeAt(o - 1)) break; n++, o++ }(n < a || o < l) && this._pushTrimWhitespaceCharChange(i, r + 1, n, a, s + 1, o, l) } } r++, s++ } o && (i.push(at.createFromDiffResult(this.shouldIgnoreTrimWhitespace, o, this.original, this.modified, this.continueCharDiff, this.shouldComputeCharChanges, this.shouldPostProcessCharChanges)), r += o.originalLength, s += o.modifiedLength) } return { quitEarly: n, changes: i } } _pushTrimWhitespaceCharChange(e, t, n, i, r, s, o) { if (this._mergeTrimWhitespaceCharChange(e, t, n, i, r, s, o)) return; let a; this.shouldComputeCharChanges && (a = [new ot(t, n, t, i, r, s, r, o)]), e.push(new at(t, t, r, r, a)) } _mergeTrimWhitespaceCharChange(e, t, n, i, r, s, o) { const a = e.length; if (0 === a) return !1; const l = e[a - 1]; return 0 !== l.originalEndLineNumber && 0 !== l.modifiedEndLineNumber && (l.originalEndLineNumber + 1 === t && l.modifiedEndLineNumber + 1 === r && (l.originalEndLineNumber = t, l.modifiedEndLineNumber = r, this.shouldComputeCharChanges && l.charChanges && l.charChanges.push(new ot(t, n, t, i, r, s, r, o)), !0)) } } function ut(e, t) { const n = function(e) { for (let t = 0, n = e.length; t < n; t++) { const n = e.charCodeAt(t); if (32 !== n && 9 !== n) return t } return -1 }(e); return -1 === n ? t : n + 1 } function ht(e, t) { const n = function(e, t = e.length - 1) { for (let n = t; n >= 0; n--) { const t = e.charCodeAt(n); if (32 !== t && 9 !== t) return n } return -1 }(e); return -1 === n ? t : n + 2 } function dt(e) { if (0 === e) return () => !0; const t = Date.now(); return () => Date.now() - t < e } function ct(e) { return e < 0 ? 0 : e > 255 ? 255 : 0 | e } function mt(e) { return e < 0 ? 0 : e > 4294967295 ? 4294967295 : 0 | e } class ft { constructor(e, t) { this._prefixSumIndexOfResultBrand = void 0, this.index = e, this.remainder = t } } class gt { constructor(e) { this.values = e, this.prefixSum = new Uint32Array(e.length), this.prefixSumValidIndex = new Int32Array(1), this.prefixSumValidIndex[0] = -1 } insertValues(e, t) { e = mt(e); const n = this.values, i = this.prefixSum, r = t.length; return 0 !== r && (this.values = new Uint32Array(n.length + r), this.values.set(n.subarray(0, e), 0), this.values.set(n.subarray(e), e + r), this.values.set(t, e), e - 1 < this.prefixSumValidIndex[0] && (this.prefixSumValidIndex[0] = e - 1), this.prefixSum = new Uint32Array(this.values.length), this.prefixSumValidIndex[0] >= 0 && this.prefixSum.set(i.subarray(0, this.prefixSumValidIndex[0] + 1)), !0) } changeValue(e, t) { return e = mt(e), t = mt(t), this.values[e] !== t && (this.values[e] = t, e - 1 < this.prefixSumValidIndex[0] && (this.prefixSumValidIndex[0] = e - 1), !0) } removeValues(e, t) { e = mt(e), t = mt(t); const n = this.values, i = this.prefixSum; if (e >= n.length) return !1; let r = n.length - e; return t >= r && (t = r), 0 !== t && (this.values = new Uint32Array(n.length - t), this.values.set(n.subarray(0, e), 0), this.values.set(n.subarray(e + t), e), this.prefixSum = new Uint32Array(this.values.length), e - 1 < this.prefixSumValidIndex[0] && (this.prefixSumValidIndex[0] = e - 1), this.prefixSumValidIndex[0] >= 0 && this.prefixSum.set(i.subarray(0, this.prefixSumValidIndex[0] + 1)), !0) } getTotalSum() { return 0 === this.values.length ? 0 : this._getPrefixSum(this.values.length - 1) } getPrefixSum(e) { return e < 0 ? 0 : (e = mt(e), this._getPrefixSum(e)) } _getPrefixSum(e) { if (e <= this.prefixSumValidIndex[0]) return this.prefixSum[e]; let t = this.prefixSumValidIndex[0] + 1; 0 === t && (this.prefixSum[0] = this.values[0], t++), e >= this.values.length && (e = this.values.length - 1); for (let n = t; n <= e; n++) this.prefixSum[n] = this.prefixSum[n - 1] + this.values[n]; return this.prefixSumValidIndex[0] = Math.max(this.prefixSumValidIndex[0], e), this.prefixSum[e] } getIndexOf(e) { e = Math.floor(e), this.getTotalSum(); let t = 0, n = this.values.length - 1, i = 0, r = 0, s = 0; for (; t <= n;) if (i = t + (n - t) / 2 | 0, r = this.prefixSum[i], s = r - this.values[i], e < s) n = i - 1; else { if (!(e >= r)) break; t = i + 1 } return new ft(i, e - s) } } class _t { constructor(e, t, n, i) { this._uri = e, this._lines = t, this._eol = n, this._versionId = i, this._lineStarts = null, this._cachedTextValue = null } dispose() { this._lines.length = 0 } get version() { return this._versionId } getText() { return null === this._cachedTextValue && (this._cachedTextValue = this._lines.join(this._eol)), this._cachedTextValue } onEvents(e) { e.eol && e.eol !== this._eol && (this._eol = e.eol, this._lineStarts = null); const t = e.changes; for (const e of t) this._acceptDeleteRange(e.range), this._acceptInsertText(new tt(e.range.startLineNumber, e.range.startColumn), e.text); this._versionId = e.versionId, this._cachedTextValue = null } _ensureLineStarts() { if (!this._lineStarts) { const e = this._eol.length, t = this._lines.length, n = new Uint32Array(t); for (let i = 0; i < t; i++) n[i] = this._lines[i].length + e; this._lineStarts = new gt(n) } } _setLineText(e, t) { this._lines[e] = t, this._lineStarts && this._lineStarts.changeValue(e, this._lines[e].length + this._eol.length) } _acceptDeleteRange(e) { if (e.startLineNumber !== e.endLineNumber) this._setLineText(e.startLineNumber - 1, this._lines[e.startLineNumber - 1].substring(0, e.startColumn - 1) + this._lines[e.endLineNumber - 1].substring(e.endColumn - 1)), this._lines.splice(e.startLineNumber, e.endLineNumber - e.startLineNumber), this._lineStarts && this._lineStarts.removeValues(e.startLineNumber, e.endLineNumber - e.startLineNumber); else { if (e.startColumn === e.endColumn) return; this._setLineText(e.startLineNumber - 1, this._lines[e.startLineNumber - 1].substring(0, e.startColumn - 1) + this._lines[e.startLineNumber - 1].substring(e.endColumn - 1)) } } _acceptInsertText(e, t) { if (0 === t.length) return; let n = t.split(/\r\n|\r|\n/); if (1 === n.length) return void this._setLineText(e.lineNumber - 1, this._lines[e.lineNumber - 1].substring(0, e.column - 1) + n[0] + this._lines[e.lineNumber - 1].substring(e.column - 1)); n[n.length - 1] += this._lines[e.lineNumber - 1].substring(e.column - 1), this._setLineText(e.lineNumber - 1, this._lines[e.lineNumber - 1].substring(0, e.column - 1) + n[0]); let i = new Uint32Array(n.length - 1); for (let t = 1; t < n.length; t++) this._lines.splice(e.lineNumber + t - 1, 0, n[t]), i[t - 1] = n[t].length + this._eol.length; this._lineStarts && this._lineStarts.insertValues(e.lineNumber, i) } } const pt = function(e = "") { let t = "(-?\\d*\\.\\d\\w*)|([^"; for (const n of "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?") e.indexOf(n) >= 0 || (t += "\\" + n); return t += "\\s]+)", new RegExp(t, "g") }(); const Ct = { maxLen: 1e3, windowSize: 15, timeBudget: 150 }; function Lt(e, t, n, i, r = Ct) { if (n.length > r.maxLen) { let s = e - r.maxLen / 2; return s < 0 ? s = 0 : i += s, Lt(e, t, n = n.substring(s, e + r.maxLen / 2), i, r) } const s = Date.now(), o = e - 1 - i; let a = -1, l = null; for (let e = 1; !(Date.now() - s >= r.timeBudget); e++) { const i = o - r.windowSize * e; t.lastIndex = Math.max(0, i); const s = St(t, n, o, a); if (!s && l) break; if (l = s, i <= 0) break; a = i } if (l) { let e = { word: l[0], startColumn: i + 1 + l.index, endColumn: i + 1 + l.index + l[0].length }; return t.lastIndex = 0, e } return null } function St(e, t, n, i) { let r; for (; r = e.exec(t);) { const t = r.index || 0; if (t <= n && e.lastIndex >= n) return r; if (i > 0 && t > i) return null } return null } class bt { constructor(e) { let t = ct(e); this._defaultValue = t, this._asciiMap = bt._createAsciiMap(t), this._map = new Map } static _createAsciiMap(e) { let t = new Uint8Array(256); for (let n = 0; n < 256; n++) t[n] = e; return t } set(e, t) { let n = ct(t); e >= 0 && e < 256 ? this._asciiMap[e] = n : this._map.set(e, n) } get(e) { return e >= 0 && e < 256 ? this._asciiMap[e] : this._map.get(e) || this._defaultValue } } class Nt { constructor(e, t, n) { const i = new Uint8Array(e * t); for (let r = 0, s = e * t; r < s; r++) i[r] = n; this._data = i, this.rows = e, this.cols = t } get(e, t) { return this._data[e * this.cols + t] } set(e, t, n) { this._data[e * this.cols + t] = n } } class Et { constructor(e) { let t = 0, n = 0; for (let i = 0, r = e.length; i < r; i++) { let [r, s, o] = e[i]; s > t && (t = s), r > n && (n = r), o > n && (n = o) } t++, n++; let i = new Nt(n, t, 0); for (let t = 0, n = e.length; t < n; t++) { let [n, r, s] = e[t]; i.set(n, r, s) } this._states = i, this._maxCharCode = t } nextState(e, t) { return t < 0 || t >= this._maxCharCode ? 0 : this._states.get(e, t) } } let yt = null; let At = null; class wt { static _createLink(e, t, n, i, r) { let s = r - 1; do { const n = t.charCodeAt(s); if (2 !== e.get(n)) break; s-- } while (s > i); if (i > 0) { const e = t.charCodeAt(i - 1), n = t.charCodeAt(s); (40 === e && 41 === n || 91 === e && 93 === n || 123 === e && 125 === n) && s-- } return { range: { startLineNumber: n, startColumn: i + 1, endLineNumber: n, endColumn: s + 2 }, url: t.substring(i, s + 1) } } static computeLinks(e, t = function() { return null === yt && (yt = new Et([ [1, 104, 2], [1, 72, 2], [1, 102, 6], [1, 70, 6], [2, 116, 3], [2, 84, 3], [3, 116, 4], [3, 84, 4], [4, 112, 5], [4, 80, 5], [5, 115, 9], [5, 83, 9], [5, 58, 10], [6, 105, 7], [6, 73, 7], [7, 108, 8], [7, 76, 8], [8, 101, 9], [8, 69, 9], [9, 58, 10], [10, 47, 11], [11, 47, 12] ])), yt }()) { const n = function() { if (null === At) { At = new bt(0); const e = " \t<>'\"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…"; for (let t = 0; t < e.length; t++) At.set(e.charCodeAt(t), 1); const t = ".,;"; for (let e = 0; e < t.length; e++) At.set(t.charCodeAt(e), 2) } return At }(); let i = []; for (let r = 1, s = e.getLineCount(); r <= s; r++) { const s = e.getLineContent(r), o = s.length; let a = 0, l = 0, u = 0, h = 1, d = !1, c = !1, m = !1, f = !1; for (; a < o;) { let e = !1; const o = s.charCodeAt(a); if (13 === h) { let t; switch (o) { case 40: d = !0, t = 0; break; case 41: t = d ? 0 : 1; break; case 91: m = !0, c = !0, t = 0; break; case 93: m = !1, t = c ? 0 : 1; break; case 123: f = !0, t = 0; break; case 125: t = f ? 0 : 1; break; case 39: t = 34 === u || 96 === u ? 0 : 1; break; case 34: t = 39 === u || 96 === u ? 0 : 1; break; case 96: t = 39 === u || 34 === u ? 0 : 1; break; case 42: t = 42 === u ? 1 : 0; break; case 124: t = 124 === u ? 1 : 0; break; case 32: t = m ? 0 : 1; break; default: t = n.get(o) } 1 === t && (i.push(wt._createLink(n, s, r, l, a)), e = !0) } else if (12 === h) { let t; 91 === o ? (c = !0, t = 0) : t = n.get(o), 1 === t ? e = !0 : h = 13 } else h = t.nextState(h, o), 0 === h && (e = !0); e && (h = 1, d = !1, c = !1, f = !1, l = a + 1, u = o), a++ } 13 === h && i.push(wt._createLink(n, s, r, l, o)) } return i } } class vt { constructor() { this._defaultValueSet = [ ["true", "false"], ["True", "False"], ["Private", "Public", "Friend", "ReadOnly", "Partial", "Protected", "WriteOnly"], ["public", "protected", "private"] ] } navigateValueSet(e, t, n, i, r) { if (e && t) { let n = this.doNavigateValueSet(t, r); if (n) return { range: e, value: n } } if (n && i) { let e = this.doNavigateValueSet(i, r); if (e) return { range: n, value: e } } return null } doNavigateValueSet(e, t) { let n = this.numberReplace(e, t); return null !== n ? n : this.textReplace(e, t) } numberReplace(e, t) { let n = Math.pow(10, e.length - (e.lastIndexOf(".") + 1)), i = Number(e), r = parseFloat(e); return isNaN(i) || isNaN(r) || i !== r ? null : 0 !== i || t ? (i = Math.floor(i * n), i += t ? n : -n, String(i / n)) : null } textReplace(e, t) { return this.valueSetsReplace(this._defaultValueSet, e, t) } valueSetsReplace(e, t, n) { let i = null; for (let r = 0, s = e.length; null === i && r < s; r++) i = this.valueSetReplace(e[r], t, n); return i } valueSetReplace(e, t, n) { let i = e.indexOf(t); return i >= 0 ? (i += n ? 1 : -1, i < 0 ? i = e.length - 1 : i %= e.length, e[i]) : null } } vt.INSTANCE = new vt; const Mt = Object.freeze((function(e, t) { const n = setTimeout(e.bind(t), 0); return { dispose() { clearTimeout(n) } } })); var Kt; ! function(e) { e.isCancellationToken = function(t) { return t === e.None || t === e.Cancelled || (t instanceof Ot || !(!t || "object" != typeof t) && ("boolean" == typeof t.isCancellationRequested && "function" == typeof t.onCancellationRequested)) }, e.None = Object.freeze({ isCancellationRequested: !1, onCancellationRequested: B.None }), e.Cancelled = Object.freeze({ isCancellationRequested: !0, onCancellationRequested: Mt }) }(Kt || (Kt = {})); class Ot { constructor() { this._isCancelled = !1, this._emitter = null } cancel() { this._isCancelled || (this._isCancelled = !0, this._emitter && (this._emitter.fire(void 0), this.dispose())) } get isCancellationRequested() { return this._isCancelled } get onCancellationRequested() { return this._isCancelled ? Mt : (this._emitter || (this._emitter = new H), this._emitter.event) } dispose() { this._emitter && (this._emitter.dispose(), this._emitter = null) } } class Tt { constructor(e) { this._token = void 0, this._parentListener = void 0, this._parentListener = e && e.onCancellationRequested(this.cancel, this) } get token() { return this._token || (this._token = new Ot), this._token } cancel() { this._token ? this._token instanceof Ot && this._token.cancel() : this._token = Kt.Cancelled } dispose(e = !1) { e && this.cancel(), this._parentListener && this._parentListener.dispose(), this._token ? this._token instanceof Ot && this._token.dispose() : this._token = Kt.None } } class Rt { constructor() { this._keyCodeToStr = [], this._strToKeyCode = Object.create(null) } define(e, t) { this._keyCodeToStr[e] = t, this._strToKeyCode[t.toLowerCase()] = e } keyCodeToStr(e) { return this._keyCodeToStr[e] } strToKeyCode(e) { return this._strToKeyCode[e.toLowerCase()] || 0 } } const Vt = new Rt, It = new Rt, Pt = new Rt, xt = new Array(230), kt = {}, Dt = [], Ft = Object.create(null), Ut = Object.create(null), Bt = [], qt = []; for (let e = 0; e <= 193; e++) Bt[e] = -1; for (let e = 0; e <= 126; e++) qt[e] = -1; var Ht, Wt, $t, jt, Gt, zt, Yt, Qt, Xt, Zt, Jt, en, tn, nn, rn, sn, on, an, ln, un, hn, dn, cn, mn, fn, gn, _n, pn, Cn, Ln, Sn, bn, Nn, En, yn, An; ! function() { const e = "", t = [ [0, 1, 0, "None", 0, "unknown", 0, "VK_UNKNOWN", e, e], [0, 1, 1, "Hyper", 0, e, 0, e, e, e], [0, 1, 2, "Super", 0, e, 0, e, e, e], [0, 1, 3, "Fn", 0, e, 0, e, e, e], [0, 1, 4, "FnLock", 0, e, 0, e, e, e], [0, 1, 5, "Suspend", 0, e, 0, e, e, e], [0, 1, 6, "Resume", 0, e, 0, e, e, e], [0, 1, 7, "Turbo", 0, e, 0, e, e, e], [0, 1, 8, "Sleep", 0, e, 0, "VK_SLEEP", e, e], [0, 1, 9, "WakeUp", 0, e, 0, e, e, e], [31, 0, 10, "KeyA", 31, "A", 65, "VK_A", e, e], [32, 0, 11, "KeyB", 32, "B", 66, "VK_B", e, e], [33, 0, 12, "KeyC", 33, "C", 67, "VK_C", e, e], [34, 0, 13, "KeyD", 34, "D", 68, "VK_D", e, e], [35, 0, 14, "KeyE", 35, "E", 69, "VK_E", e, e], [36, 0, 15, "KeyF", 36, "F", 70, "VK_F", e, e], [37, 0, 16, "KeyG", 37, "G", 71, "VK_G", e, e], [38, 0, 17, "KeyH", 38, "H", 72, "VK_H", e, e], [39, 0, 18, "KeyI", 39, "I", 73, "VK_I", e, e], [40, 0, 19, "KeyJ", 40, "J", 74, "VK_J", e, e], [41, 0, 20, "KeyK", 41, "K", 75, "VK_K", e, e], [42, 0, 21, "KeyL", 42, "L", 76, "VK_L", e, e], [43, 0, 22, "KeyM", 43, "M", 77, "VK_M", e, e], [44, 0, 23, "KeyN", 44, "N", 78, "VK_N", e, e], [45, 0, 24, "KeyO", 45, "O", 79, "VK_O", e, e], [46, 0, 25, "KeyP", 46, "P", 80, "VK_P", e, e], [47, 0, 26, "KeyQ", 47, "Q", 81, "VK_Q", e, e], [48, 0, 27, "KeyR", 48, "R", 82, "VK_R", e, e], [49, 0, 28, "KeyS", 49, "S", 83, "VK_S", e, e], [50, 0, 29, "KeyT", 50, "T", 84, "VK_T", e, e], [51, 0, 30, "KeyU", 51, "U", 85, "VK_U", e, e], [52, 0, 31, "KeyV", 52, "V", 86, "VK_V", e, e], [53, 0, 32, "KeyW", 53, "W", 87, "VK_W", e, e], [54, 0, 33, "KeyX", 54, "X", 88, "VK_X", e, e], [55, 0, 34, "KeyY", 55, "Y", 89, "VK_Y", e, e], [56, 0, 35, "KeyZ", 56, "Z", 90, "VK_Z", e, e], [22, 0, 36, "Digit1", 22, "1", 49, "VK_1", e, e], [23, 0, 37, "Digit2", 23, "2", 50, "VK_2", e, e], [24, 0, 38, "Digit3", 24, "3", 51, "VK_3", e, e], [25, 0, 39, "Digit4", 25, "4", 52, "VK_4", e, e], [26, 0, 40, "Digit5", 26, "5", 53, "VK_5", e, e], [27, 0, 41, "Digit6", 27, "6", 54, "VK_6", e, e], [28, 0, 42, "Digit7", 28, "7", 55, "VK_7", e, e], [29, 0, 43, "Digit8", 29, "8", 56, "VK_8", e, e], [30, 0, 44, "Digit9", 30, "9", 57, "VK_9", e, e], [21, 0, 45, "Digit0", 21, "0", 48, "VK_0", e, e], [3, 1, 46, "Enter", 3, "Enter", 13, "VK_RETURN", e, e], [9, 1, 47, "Escape", 9, "Escape", 27, "VK_ESCAPE", e, e], [1, 1, 48, "Backspace", 1, "Backspace", 8, "VK_BACK", e, e], [2, 1, 49, "Tab", 2, "Tab", 9, "VK_TAB", e, e], [10, 1, 50, "Space", 10, "Space", 32, "VK_SPACE", e, e], [83, 0, 51, "Minus", 83, "-", 189, "VK_OEM_MINUS", "-", "OEM_MINUS"], [81, 0, 52, "Equal", 81, "=", 187, "VK_OEM_PLUS", "=", "OEM_PLUS"], [87, 0, 53, "BracketLeft", 87, "[", 219, "VK_OEM_4", "[", "OEM_4"], [89, 0, 54, "BracketRight", 89, "]", 221, "VK_OEM_6", "]", "OEM_6"], [88, 0, 55, "Backslash", 88, "\\", 220, "VK_OEM_5", "\\", "OEM_5"], [0, 0, 56, "IntlHash", 0, e, 0, e, e, e], [80, 0, 57, "Semicolon", 80, ";", 186, "VK_OEM_1", ";", "OEM_1"], [90, 0, 58, "Quote", 90, "'", 222, "VK_OEM_7", "'", "OEM_7"], [86, 0, 59, "Backquote", 86, "`", 192, "VK_OEM_3", "`", "OEM_3"], [82, 0, 60, "Comma", 82, ",", 188, "VK_OEM_COMMA", ",", "OEM_COMMA"], [84, 0, 61, "Period", 84, ".", 190, "VK_OEM_PERIOD", ".", "OEM_PERIOD"], [85, 0, 62, "Slash", 85, "/", 191, "VK_OEM_2", "/", "OEM_2"], [8, 1, 63, "CapsLock", 8, "CapsLock", 20, "VK_CAPITAL", e, e], [59, 1, 64, "F1", 59, "F1", 112, "VK_F1", e, e], [60, 1, 65, "F2", 60, "F2", 113, "VK_F2", e, e], [61, 1, 66, "F3", 61, "F3", 114, "VK_F3", e, e], [62, 1, 67, "F4", 62, "F4", 115, "VK_F4", e, e], [63, 1, 68, "F5", 63, "F5", 116, "VK_F5", e, e], [64, 1, 69, "F6", 64, "F6", 117, "VK_F6", e, e], [65, 1, 70, "F7", 65, "F7", 118, "VK_F7", e, e], [66, 1, 71, "F8", 66, "F8", 119, "VK_F8", e, e], [67, 1, 72, "F9", 67, "F9", 120, "VK_F9", e, e], [68, 1, 73, "F10", 68, "F10", 121, "VK_F10", e, e], [69, 1, 74, "F11", 69, "F11", 122, "VK_F11", e, e], [70, 1, 75, "F12", 70, "F12", 123, "VK_F12", e, e], [0, 1, 76, "PrintScreen", 0, e, 0, e, e, e], [79, 1, 77, "ScrollLock", 79, "ScrollLock", 145, "VK_SCROLL", e, e], [7, 1, 78, "Pause", 7, "PauseBreak", 19, "VK_PAUSE", e, e], [19, 1, 79, "Insert", 19, "Insert", 45, "VK_INSERT", e, e], [14, 1, 80, "Home", 14, "Home", 36, "VK_HOME", e, e], [11, 1, 81, "PageUp", 11, "PageUp", 33, "VK_PRIOR", e, e], [20, 1, 82, "Delete", 20, "Delete", 46, "VK_DELETE", e, e], [13, 1, 83, "End", 13, "End", 35, "VK_END", e, e], [12, 1, 84, "PageDown", 12, "PageDown", 34, "VK_NEXT", e, e], [17, 1, 85, "ArrowRight", 17, "RightArrow", 39, "VK_RIGHT", "Right", e], [15, 1, 86, "ArrowLeft", 15, "LeftArrow", 37, "VK_LEFT", "Left", e], [18, 1, 87, "ArrowDown", 18, "DownArrow", 40, "VK_DOWN", "Down", e], [16, 1, 88, "ArrowUp", 16, "UpArrow", 38, "VK_UP", "Up", e], [78, 1, 89, "NumLock", 78, "NumLock", 144, "VK_NUMLOCK", e, e], [108, 1, 90, "NumpadDivide", 108, "NumPad_Divide", 111, "VK_DIVIDE", e, e], [103, 1, 91, "NumpadMultiply", 103, "NumPad_Multiply", 106, "VK_MULTIPLY", e, e], [106, 1, 92, "NumpadSubtract", 106, "NumPad_Subtract", 109, "VK_SUBTRACT", e, e], [104, 1, 93, "NumpadAdd", 104, "NumPad_Add", 107, "VK_ADD", e, e], [3, 1, 94, "NumpadEnter", 3, e, 0, e, e, e], [94, 1, 95, "Numpad1", 94, "NumPad1", 97, "VK_NUMPAD1", e, e], [95, 1, 96, "Numpad2", 95, "NumPad2", 98, "VK_NUMPAD2", e, e], [96, 1, 97, "Numpad3", 96, "NumPad3", 99, "VK_NUMPAD3", e, e], [97, 1, 98, "Numpad4", 97, "NumPad4", 100, "VK_NUMPAD4", e, e], [98, 1, 99, "Numpad5", 98, "NumPad5", 101, "VK_NUMPAD5", e, e], [99, 1, 100, "Numpad6", 99, "NumPad6", 102, "VK_NUMPAD6", e, e], [100, 1, 101, "Numpad7", 100, "NumPad7", 103, "VK_NUMPAD7", e, e], [101, 1, 102, "Numpad8", 101, "NumPad8", 104, "VK_NUMPAD8", e, e], [102, 1, 103, "Numpad9", 102, "NumPad9", 105, "VK_NUMPAD9", e, e], [93, 1, 104, "Numpad0", 93, "NumPad0", 96, "VK_NUMPAD0", e, e], [107, 1, 105, "NumpadDecimal", 107, "NumPad_Decimal", 110, "VK_DECIMAL", e, e], [92, 0, 106, "IntlBackslash", 92, "OEM_102", 226, "VK_OEM_102", e, e], [58, 1, 107, "ContextMenu", 58, "ContextMenu", 93, e, e, e], [0, 1, 108, "Power", 0, e, 0, e, e, e], [0, 1, 109, "NumpadEqual", 0, e, 0, e, e, e], [71, 1, 110, "F13", 71, "F13", 124, "VK_F13", e, e], [72, 1, 111, "F14", 72, "F14", 125, "VK_F14", e, e], [73, 1, 112, "F15", 73, "F15", 126, "VK_F15", e, e], [74, 1, 113, "F16", 74, "F16", 127, "VK_F16", e, e], [75, 1, 114, "F17", 75, "F17", 128, "VK_F17", e, e], [76, 1, 115, "F18", 76, "F18", 129, "VK_F18", e, e], [77, 1, 116, "F19", 77, "F19", 130, "VK_F19", e, e], [0, 1, 117, "F20", 0, e, 0, "VK_F20", e, e], [0, 1, 118, "F21", 0, e, 0, "VK_F21", e, e], [0, 1, 119, "F22", 0, e, 0, "VK_F22", e, e], [0, 1, 120, "F23", 0, e, 0, "VK_F23", e, e], [0, 1, 121, "F24", 0, e, 0, "VK_F24", e, e], [0, 1, 122, "Open", 0, e, 0, e, e, e], [0, 1, 123, "Help", 0, e, 0, e, e, e], [0, 1, 124, "Select", 0, e, 0, e, e, e], [0, 1, 125, "Again", 0, e, 0, e, e, e], [0, 1, 126, "Undo", 0, e, 0, e, e, e], [0, 1, 127, "Cut", 0, e, 0, e, e, e], [0, 1, 128, "Copy", 0, e, 0, e, e, e], [0, 1, 129, "Paste", 0, e, 0, e, e, e], [0, 1, 130, "Find", 0, e, 0, e, e, e], [0, 1, 131, "AudioVolumeMute", 112, "AudioVolumeMute", 173, "VK_VOLUME_MUTE", e, e], [0, 1, 132, "AudioVolumeUp", 113, "AudioVolumeUp", 175, "VK_VOLUME_UP", e, e], [0, 1, 133, "AudioVolumeDown", 114, "AudioVolumeDown", 174, "VK_VOLUME_DOWN", e, e], [105, 1, 134, "NumpadComma", 105, "NumPad_Separator", 108, "VK_SEPARATOR", e, e], [110, 0, 135, "IntlRo", 110, "ABNT_C1", 193, "VK_ABNT_C1", e, e], [0, 1, 136, "KanaMode", 0, e, 0, e, e, e], [0, 0, 137, "IntlYen", 0, e, 0, e, e, e], [0, 1, 138, "Convert", 0, e, 0, e, e, e], [0, 1, 139, "NonConvert", 0, e, 0, e, e, e], [0, 1, 140, "Lang1", 0, e, 0, e, e, e], [0, 1, 141, "Lang2", 0, e, 0, e, e, e], [0, 1, 142, "Lang3", 0, e, 0, e, e, e], [0, 1, 143, "Lang4", 0, e, 0, e, e, e], [0, 1, 144, "Lang5", 0, e, 0, e, e, e], [0, 1, 145, "Abort", 0, e, 0, e, e, e], [0, 1, 146, "Props", 0, e, 0, e, e, e], [0, 1, 147, "NumpadParenLeft", 0, e, 0, e, e, e], [0, 1, 148, "NumpadParenRight", 0, e, 0, e, e, e], [0, 1, 149, "NumpadBackspace", 0, e, 0, e, e, e], [0, 1, 150, "NumpadMemoryStore", 0, e, 0, e, e, e], [0, 1, 151, "NumpadMemoryRecall", 0, e, 0, e, e, e], [0, 1, 152, "NumpadMemoryClear", 0, e, 0, e, e, e], [0, 1, 153, "NumpadMemoryAdd", 0, e, 0, e, e, e], [0, 1, 154, "NumpadMemorySubtract", 0, e, 0, e, e, e], [0, 1, 155, "NumpadClear", 0, e, 0, e, e, e], [0, 1, 156, "NumpadClearEntry", 0, e, 0, e, e, e], [5, 1, 0, e, 5, "Ctrl", 17, "VK_CONTROL", e, e], [4, 1, 0, e, 4, "Shift", 16, "VK_SHIFT", e, e], [6, 1, 0, e, 6, "Alt", 18, "VK_MENU", e, e], [57, 1, 0, e, 57, "Meta", 0, "VK_COMMAND", e, e], [5, 1, 157, "ControlLeft", 5, e, 0, "VK_LCONTROL", e, e], [4, 1, 158, "ShiftLeft", 4, e, 0, "VK_LSHIFT", e, e], [6, 1, 159, "AltLeft", 6, e, 0, "VK_LMENU", e, e], [57, 1, 160, "MetaLeft", 57, e, 0, "VK_LWIN", e, e], [5, 1, 161, "ControlRight", 5, e, 0, "VK_RCONTROL", e, e], [4, 1, 162, "ShiftRight", 4, e, 0, "VK_RSHIFT", e, e], [6, 1, 163, "AltRight", 6, e, 0, "VK_RMENU", e, e], [57, 1, 164, "MetaRight", 57, e, 0, "VK_RWIN", e, e], [0, 1, 165, "BrightnessUp", 0, e, 0, e, e, e], [0, 1, 166, "BrightnessDown", 0, e, 0, e, e, e], [0, 1, 167, "MediaPlay", 0, e, 0, e, e, e], [0, 1, 168, "MediaRecord", 0, e, 0, e, e, e], [0, 1, 169, "MediaFastForward", 0, e, 0, e, e, e], [0, 1, 170, "MediaRewind", 0, e, 0, e, e, e], [114, 1, 171, "MediaTrackNext", 119, "MediaTrackNext", 176, "VK_MEDIA_NEXT_TRACK", e, e], [115, 1, 172, "MediaTrackPrevious", 120, "MediaTrackPrevious", 177, "VK_MEDIA_PREV_TRACK", e, e], [116, 1, 173, "MediaStop", 121, "MediaStop", 178, "VK_MEDIA_STOP", e, e], [0, 1, 174, "Eject", 0, e, 0, e, e, e], [117, 1, 175, "MediaPlayPause", 122, "MediaPlayPause", 179, "VK_MEDIA_PLAY_PAUSE", e, e], [0, 1, 176, "MediaSelect", 123, "LaunchMediaPlayer", 181, "VK_MEDIA_LAUNCH_MEDIA_SELECT", e, e], [0, 1, 177, "LaunchMail", 124, "LaunchMail", 180, "VK_MEDIA_LAUNCH_MAIL", e, e], [0, 1, 178, "LaunchApp2", 125, "LaunchApp2", 183, "VK_MEDIA_LAUNCH_APP2", e, e], [0, 1, 179, "LaunchApp1", 0, e, 0, "VK_MEDIA_LAUNCH_APP1", e, e], [0, 1, 180, "SelectTask", 0, e, 0, e, e, e], [0, 1, 181, "LaunchScreenSaver", 0, e, 0, e, e, e], [0, 1, 182, "BrowserSearch", 115, "BrowserSearch", 170, "VK_BROWSER_SEARCH", e, e], [0, 1, 183, "BrowserHome", 116, "BrowserHome", 172, "VK_BROWSER_HOME", e, e], [112, 1, 184, "BrowserBack", 117, "BrowserBack", 166, "VK_BROWSER_BACK", e, e], [113, 1, 185, "BrowserForward", 118, "BrowserForward", 167, "VK_BROWSER_FORWARD", e, e], [0, 1, 186, "BrowserStop", 0, e, 0, "VK_BROWSER_STOP", e, e], [0, 1, 187, "BrowserRefresh", 0, e, 0, "VK_BROWSER_REFRESH", e, e], [0, 1, 188, "BrowserFavorites", 0, e, 0, "VK_BROWSER_FAVORITES", e, e], [0, 1, 189, "ZoomToggle", 0, e, 0, e, e, e], [0, 1, 190, "MailReply", 0, e, 0, e, e, e], [0, 1, 191, "MailForward", 0, e, 0, e, e, e], [0, 1, 192, "MailSend", 0, e, 0, e, e, e], [109, 1, 0, e, 109, "KeyInComposition", 229, e, e, e], [111, 1, 0, e, 111, "ABNT_C2", 194, "VK_ABNT_C2", e, e], [91, 1, 0, e, 91, "OEM_8", 223, "VK_OEM_8", e, e], [0, 1, 0, e, 0, e, 0, "VK_CLEAR", e, e], [0, 1, 0, e, 0, e, 0, "VK_KANA", e, e], [0, 1, 0, e, 0, e, 0, "VK_HANGUL", e, e], [0, 1, 0, e, 0, e, 0, "VK_JUNJA", e, e], [0, 1, 0, e, 0, e, 0, "VK_FINAL", e, e], [0, 1, 0, e, 0, e, 0, "VK_HANJA", e, e], [0, 1, 0, e, 0, e, 0, "VK_KANJI", e, e], [0, 1, 0, e, 0, e, 0, "VK_CONVERT", e, e], [0, 1, 0, e, 0, e, 0, "VK_NONCONVERT", e, e], [0, 1, 0, e, 0, e, 0, "VK_ACCEPT", e, e], [0, 1, 0, e, 0, e, 0, "VK_MODECHANGE", e, e], [0, 1, 0, e, 0, e, 0, "VK_SELECT", e, e], [0, 1, 0, e, 0, e, 0, "VK_PRINT", e, e], [0, 1, 0, e, 0, e, 0, "VK_EXECUTE", e, e], [0, 1, 0, e, 0, e, 0, "VK_SNAPSHOT", e, e], [0, 1, 0, e, 0, e, 0, "VK_HELP", e, e], [0, 1, 0, e, 0, e, 0, "VK_APPS", e, e], [0, 1, 0, e, 0, e, 0, "VK_PROCESSKEY", e, e], [0, 1, 0, e, 0, e, 0, "VK_PACKET", e, e], [0, 1, 0, e, 0, e, 0, "VK_DBE_SBCSCHAR", e, e], [0, 1, 0, e, 0, e, 0, "VK_DBE_DBCSCHAR", e, e], [0, 1, 0, e, 0, e, 0, "VK_ATTN", e, e], [0, 1, 0, e, 0, e, 0, "VK_CRSEL", e, e], [0, 1, 0, e, 0, e, 0, "VK_EXSEL", e, e], [0, 1, 0, e, 0, e, 0, "VK_EREOF", e, e], [0, 1, 0, e, 0, e, 0, "VK_PLAY", e, e], [0, 1, 0, e, 0, e, 0, "VK_ZOOM", e, e], [0, 1, 0, e, 0, e, 0, "VK_NONAME", e, e], [0, 1, 0, e, 0, e, 0, "VK_PA1", e, e], [0, 1, 0, e, 0, e, 0, "VK_OEM_CLEAR", e, e] ]; let n = [], i = []; for (const e of t) { const [t, r, s, o, a, l, u, h, d, c] = e; if (i[s] || (i[s] = !0, Dt[s] = o, Ft[o] = s, Ut[o.toLowerCase()] = s, r && (Bt[s] = a, 0 !== a && 3 !== a && 5 !== a && 4 !== a && 6 !== a && 57 !== a && (qt[a] = s))), !n[a]) { if (n[a] = !0, !l) throw new Error(`String representation missing for key code ${a} around scan code ${o}`); Vt.define(a, l), It.define(a, d || l), Pt.define(a, c || d || l) } u && (xt[u] = a), h && (kt[h] = a) } qt[3] = 46 }(), function(e) { e.toString = function(e) { return Vt.keyCodeToStr(e) }, e.fromString = function(e) { return Vt.strToKeyCode(e) }, e.toUserSettingsUS = function(e) { return It.keyCodeToStr(e) }, e.toUserSettingsGeneral = function(e) { return Pt.keyCodeToStr(e) }, e.fromUserSettings = function(e) { return It.strToKeyCode(e) || Pt.strToKeyCode(e) }, e.toElectronAccelerator = function(e) { if (e >= 93 && e <= 108) return null; switch (e) { case 16: return "Up"; case 18: return "Down"; case 15: return "Left"; case 17: return "Right" } return Vt.keyCodeToStr(e) } }(Ht || (Ht = {})); class wn extends nt { constructor(e, t, n, i) { super(e, t, n, i), this.selectionStartLineNumber = e, this.selectionStartColumn = t, this.positionLineNumber = n, this.positionColumn = i } toString() { return "[" + this.selectionStartLineNumber + "," + this.selectionStartColumn + " -> " + this.positionLineNumber + "," + this.positionColumn + "]" } equalsSelection(e) { return wn.selectionsEqual(this, e) } static selectionsEqual(e, t) { return e.selectionStartLineNumber === t.selectionStartLineNumber && e.selectionStartColumn === t.selectionStartColumn && e.positionLineNumber === t.positionLineNumber && e.positionColumn === t.positionColumn } getDirection() { return this.selectionStartLineNumber === this.startLineNumber && this.selectionStartColumn === this.startColumn ? 0 : 1 } setEndPosition(e, t) { return 0 === this.getDirection() ? new wn(this.startLineNumber, this.startColumn, e, t) : new wn(e, t, this.startLineNumber, this.startColumn) } getPosition() { return new tt(this.positionLineNumber, this.positionColumn) } setStartPosition(e, t) { return 0 === this.getDirection() ? new wn(e, t, this.endLineNumber, this.endColumn) : new wn(this.endLineNumber, this.endColumn, e, t) } static fromPositions(e, t = e) { return new wn(e.lineNumber, e.column, t.lineNumber, t.column) } static liftSelection(e) { return new wn(e.selectionStartLineNumber, e.selectionStartColumn, e.positionLineNumber, e.positionColumn) } static selectionsArrEqual(e, t) { if (e && !t || !e && t) return !1; if (!e && !t) return !0; if (e.length !== t.length) return !1; for (let n = 0, i = e.length; n < i; n++) if (!this.selectionsEqual(e[n], t[n])) return !1; return !0 } static isISelection(e) { return e && "number" == typeof e.selectionStartLineNumber && "number" == typeof e.selectionStartColumn && "number" == typeof e.positionLineNumber && "number" == typeof e.positionColumn } static createWithDirection(e, t, n, i, r) { return 0 === r ? new wn(e, t, n, i) : new wn(n, i, e, t) } } class vn { constructor(e, t, n) { this._tokenBrand = void 0, this.offset = 0 | e, this.type = t, this.language = n } toString() { return "(" + this.offset + ", " + this.type + ")" } }! function(e) { e[e.Unknown = 0] = "Unknown", e[e.Disabled = 1] = "Disabled", e[e.Enabled = 2] = "Enabled" }(Wt || (Wt = {})), function(e) { e[e.KeepWhitespace = 1] = "KeepWhitespace", e[e.InsertAsSnippet = 4] = "InsertAsSnippet" }($t || ($t = {})), function(e) { e[e.Method = 0] = "Method", e[e.Function = 1] = "Function", e[e.Constructor = 2] = "Constructor", e[e.Field = 3] = "Field", e[e.Variable = 4] = "Variable", e[e.Class = 5] = "Class", e[e.Struct = 6] = "Struct", e[e.Interface = 7] = "Interface", e[e.Module = 8] = "Module", e[e.Property = 9] = "Property", e[e.Event = 10] = "Event", e[e.Operator = 11] = "Operator", e[e.Unit = 12] = "Unit", e[e.Value = 13] = "Value", e[e.Constant = 14] = "Constant", e[e.Enum = 15] = "Enum", e[e.EnumMember = 16] = "EnumMember", e[e.Keyword = 17] = "Keyword", e[e.Text = 18] = "Text", e[e.Color = 19] = "Color", e[e.File = 20] = "File", e[e.Reference = 21] = "Reference", e[e.Customcolor = 22] = "Customcolor", e[e.Folder = 23] = "Folder", e[e.TypeParameter = 24] = "TypeParameter", e[e.User = 25] = "User", e[e.Issue = 26] = "Issue", e[e.Snippet = 27] = "Snippet" }(jt || (jt = {})), function(e) { e[e.Deprecated = 1] = "Deprecated" }(Gt || (Gt = {})), function(e) { e[e.Invoke = 0] = "Invoke", e[e.TriggerCharacter = 1] = "TriggerCharacter", e[e.TriggerForIncompleteCompletions = 2] = "TriggerForIncompleteCompletions" }(zt || (zt = {})), function(e) { e[e.EXACT = 0] = "EXACT", e[e.ABOVE = 1] = "ABOVE", e[e.BELOW = 2] = "BELOW" }(Yt || (Yt = {})), function(e) { e[e.NotSet = 0] = "NotSet", e[e.ContentFlush = 1] = "ContentFlush", e[e.RecoverFromMarkers = 2] = "RecoverFromMarkers", e[e.Explicit = 3] = "Explicit", e[e.Paste = 4] = "Paste", e[e.Undo = 5] = "Undo", e[e.Redo = 6] = "Redo" }(Qt || (Qt = {})), function(e) { e[e.LF = 1] = "LF", e[e.CRLF = 2] = "CRLF" }(Xt || (Xt = {})), function(e) { e[e.Text = 0] = "Text", e[e.Read = 1] = "Read", e[e.Write = 2] = "Write" }(Zt || (Zt = {})), function(e) { e[e.None = 0] = "None", e[e.Keep = 1] = "Keep", e[e.Brackets = 2] = "Brackets", e[e.Advanced = 3] = "Advanced", e[e.Full = 4] = "Full" }(Jt || (Jt = {})), function(e) { e[e.acceptSuggestionOnCommitCharacter = 0] = "acceptSuggestionOnCommitCharacter", e[e.acceptSuggestionOnEnter = 1] = "acceptSuggestionOnEnter", e[e.accessibilitySupport = 2] = "accessibilitySupport", e[e.accessibilityPageSize = 3] = "accessibilityPageSize", e[e.ariaLabel = 4] = "ariaLabel", e[e.autoClosingBrackets = 5] = "autoClosingBrackets", e[e.autoClosingDelete = 6] = "autoClosingDelete", e[e.autoClosingOvertype = 7] = "autoClosingOvertype", e[e.autoClosingQuotes = 8] = "autoClosingQuotes", e[e.autoIndent = 9] = "autoIndent", e[e.automaticLayout = 10] = "automaticLayout", e[e.autoSurround = 11] = "autoSurround", e[e.bracketPairColorization = 12] = "bracketPairColorization", e[e.guides = 13] = "guides", e[e.codeLens = 14] = "codeLens", e[e.codeLensFontFamily = 15] = "codeLensFontFamily", e[e.codeLensFontSize = 16] = "codeLensFontSize", e[e.colorDecorators = 17] = "colorDecorators", e[e.columnSelection = 18] = "columnSelection", e[e.comments = 19] = "comments", e[e.contextmenu = 20] = "contextmenu", e[e.copyWithSyntaxHighlighting = 21] = "copyWithSyntaxHighlighting", e[e.cursorBlinking = 22] = "cursorBlinking", e[e.cursorSmoothCaretAnimation = 23] = "cursorSmoothCaretAnimation", e[e.cursorStyle = 24] = "cursorStyle", e[e.cursorSurroundingLines = 25] = "cursorSurroundingLines", e[e.cursorSurroundingLinesStyle = 26] = "cursorSurroundingLinesStyle", e[e.cursorWidth = 27] = "cursorWidth", e[e.disableLayerHinting = 28] = "disableLayerHinting", e[e.disableMonospaceOptimizations = 29] = "disableMonospaceOptimizations", e[e.domReadOnly = 30] = "domReadOnly", e[e.dragAndDrop = 31] = "dragAndDrop", e[e.emptySelectionClipboard = 32] = "emptySelectionClipboard", e[e.extraEditorClassName = 33] = "extraEditorClassName", e[e.fastScrollSensitivity = 34] = "fastScrollSensitivity", e[e.find = 35] = "find", e[e.fixedOverflowWidgets = 36] = "fixedOverflowWidgets", e[e.folding = 37] = "folding", e[e.foldingStrategy = 38] = "foldingStrategy", e[e.foldingHighlight = 39] = "foldingHighlight", e[e.foldingImportsByDefault = 40] = "foldingImportsByDefault", e[e.unfoldOnClickAfterEndOfLine = 41] = "unfoldOnClickAfterEndOfLine", e[e.fontFamily = 42] = "fontFamily", e[e.fontInfo = 43] = "fontInfo", e[e.fontLigatures = 44] = "fontLigatures", e[e.fontSize = 45] = "fontSize", e[e.fontWeight = 46] = "fontWeight", e[e.formatOnPaste = 47] = "formatOnPaste", e[e.formatOnType = 48] = "formatOnType", e[e.glyphMargin = 49] = "glyphMargin", e[e.gotoLocation = 50] = "gotoLocation", e[e.hideCursorInOverviewRuler = 51] = "hideCursorInOverviewRuler", e[e.hover = 52] = "hover", e[e.inDiffEditor = 53] = "inDiffEditor", e[e.inlineSuggest = 54] = "inlineSuggest", e[e.letterSpacing = 55] = "letterSpacing", e[e.lightbulb = 56] = "lightbulb", e[e.lineDecorationsWidth = 57] = "lineDecorationsWidth", e[e.lineHeight = 58] = "lineHeight", e[e.lineNumbers = 59] = "lineNumbers", e[e.lineNumbersMinChars = 60] = "lineNumbersMinChars", e[e.linkedEditing = 61] = "linkedEditing", e[e.links = 62] = "links", e[e.matchBrackets = 63] = "matchBrackets", e[e.minimap = 64] = "minimap", e[e.mouseStyle = 65] = "mouseStyle", e[e.mouseWheelScrollSensitivity = 66] = "mouseWheelScrollSensitivity", e[e.mouseWheelZoom = 67] = "mouseWheelZoom", e[e.multiCursorMergeOverlapping = 68] = "multiCursorMergeOverlapping", e[e.multiCursorModifier = 69] = "multiCursorModifier", e[e.multiCursorPaste = 70] = "multiCursorPaste", e[e.occurrencesHighlight = 71] = "occurrencesHighlight", e[e.overviewRulerBorder = 72] = "overviewRulerBorder", e[e.overviewRulerLanes = 73] = "overviewRulerLanes", e[e.padding = 74] = "padding", e[e.parameterHints = 75] = "parameterHints", e[e.peekWidgetDefaultFocus = 76] = "peekWidgetDefaultFocus", e[e.definitionLinkOpensInPeek = 77] = "definitionLinkOpensInPeek", e[e.quickSuggestions = 78] = "quickSuggestions", e[e.quickSuggestionsDelay = 79] = "quickSuggestionsDelay", e[e.readOnly = 80] = "readOnly", e[e.renameOnType = 81] = "renameOnType", e[e.renderControlCharacters = 82] = "renderControlCharacters", e[e.renderFinalNewline = 83] = "renderFinalNewline", e[e.renderLineHighlight = 84] = "renderLineHighlight", e[e.renderLineHighlightOnlyWhenFocus = 85] = "renderLineHighlightOnlyWhenFocus", e[e.renderValidationDecorations = 86] = "renderValidationDecorations", e[e.renderWhitespace = 87] = "renderWhitespace", e[e.revealHorizontalRightPadding = 88] = "revealHorizontalRightPadding", e[e.roundedSelection = 89] = "roundedSelection", e[e.rulers = 90] = "rulers", e[e.scrollbar = 91] = "scrollbar", e[e.scrollBeyondLastColumn = 92] = "scrollBeyondLastColumn", e[e.scrollBeyondLastLine = 93] = "scrollBeyondLastLine", e[e.scrollPredominantAxis = 94] = "scrollPredominantAxis", e[e.selectionClipboard = 95] = "selectionClipboard", e[e.selectionHighlight = 96] = "selectionHighlight", e[e.selectOnLineNumbers = 97] = "selectOnLineNumbers", e[e.showFoldingControls = 98] = "showFoldingControls", e[e.showUnused = 99] = "showUnused", e[e.snippetSuggestions = 100] = "snippetSuggestions", e[e.smartSelect = 101] = "smartSelect", e[e.smoothScrolling = 102] = "smoothScrolling", e[e.stickyTabStops = 103] = "stickyTabStops", e[e.stopRenderingLineAfter = 104] = "stopRenderingLineAfter", e[e.suggest = 105] = "suggest", e[e.suggestFontSize = 106] = "suggestFontSize", e[e.suggestLineHeight = 107] = "suggestLineHeight", e[e.suggestOnTriggerCharacters = 108] = "suggestOnTriggerCharacters", e[e.suggestSelection = 109] = "suggestSelection", e[e.tabCompletion = 110] = "tabCompletion", e[e.tabIndex = 111] = "tabIndex", e[e.unusualLineTerminators = 112] = "unusualLineTerminators", e[e.useShadowDOM = 113] = "useShadowDOM", e[e.useTabStops = 114] = "useTabStops", e[e.wordSeparators = 115] = "wordSeparators", e[e.wordWrap = 116] = "wordWrap", e[e.wordWrapBreakAfterCharacters = 117] = "wordWrapBreakAfterCharacters", e[e.wordWrapBreakBeforeCharacters = 118] = "wordWrapBreakBeforeCharacters", e[e.wordWrapColumn = 119] = "wordWrapColumn", e[e.wordWrapOverride1 = 120] = "wordWrapOverride1", e[e.wordWrapOverride2 = 121] = "wordWrapOverride2", e[e.wrappingIndent = 122] = "wrappingIndent", e[e.wrappingStrategy = 123] = "wrappingStrategy", e[e.showDeprecated = 124] = "showDeprecated", e[e.inlayHints = 125] = "inlayHints", e[e.editorClassName = 126] = "editorClassName", e[e.pixelRatio = 127] = "pixelRatio", e[e.tabFocusMode = 128] = "tabFocusMode", e[e.layoutInfo = 129] = "layoutInfo", e[e.wrappingInfo = 130] = "wrappingInfo" }(en || (en = {})), function(e) { e[e.TextDefined = 0] = "TextDefined", e[e.LF = 1] = "LF", e[e.CRLF = 2] = "CRLF" }(tn || (tn = {})), function(e) { e[e.LF = 0] = "LF", e[e.CRLF = 1] = "CRLF" }(nn || (nn = {})), function(e) { e[e.None = 0] = "None", e[e.Indent = 1] = "Indent", e[e.IndentOutdent = 2] = "IndentOutdent", e[e.Outdent = 3] = "Outdent" }(rn || (rn = {})), function(e) { e[e.Other = 0] = "Other", e[e.Type = 1] = "Type", e[e.Parameter = 2] = "Parameter" }(sn || (sn = {})), function(e) { e[e.Automatic = 0] = "Automatic", e[e.Explicit = 1] = "Explicit" }(on || (on = {})), function(e) { e[e.DependsOnKbLayout = -1] = "DependsOnKbLayout", e[e.Unknown = 0] = "Unknown", e[e.Backspace = 1] = "Backspace", e[e.Tab = 2] = "Tab", e[e.Enter = 3] = "Enter", e[e.Shift = 4] = "Shift", e[e.Ctrl = 5] = "Ctrl", e[e.Alt = 6] = "Alt", e[e.PauseBreak = 7] = "PauseBreak", e[e.CapsLock = 8] = "CapsLock", e[e.Escape = 9] = "Escape", e[e.Space = 10] = "Space", e[e.PageUp = 11] = "PageUp", e[e.PageDown = 12] = "PageDown", e[e.End = 13] = "End", e[e.Home = 14] = "Home", e[e.LeftArrow = 15] = "LeftArrow", e[e.UpArrow = 16] = "UpArrow", e[e.RightArrow = 17] = "RightArrow", e[e.DownArrow = 18] = "DownArrow", e[e.Insert = 19] = "Insert", e[e.Delete = 20] = "Delete", e[e.Digit0 = 21] = "Digit0", e[e.Digit1 = 22] = "Digit1", e[e.Digit2 = 23] = "Digit2", e[e.Digit3 = 24] = "Digit3", e[e.Digit4 = 25] = "Digit4", e[e.Digit5 = 26] = "Digit5", e[e.Digit6 = 27] = "Digit6", e[e.Digit7 = 28] = "Digit7", e[e.Digit8 = 29] = "Digit8", e[e.Digit9 = 30] = "Digit9", e[e.KeyA = 31] = "KeyA", e[e.KeyB = 32] = "KeyB", e[e.KeyC = 33] = "KeyC", e[e.KeyD = 34] = "KeyD", e[e.KeyE = 35] = "KeyE", e[e.KeyF = 36] = "KeyF", e[e.KeyG = 37] = "KeyG", e[e.KeyH = 38] = "KeyH", e[e.KeyI = 39] = "KeyI", e[e.KeyJ = 40] = "KeyJ", e[e.KeyK = 41] = "KeyK", e[e.KeyL = 42] = "KeyL", e[e.KeyM = 43] = "KeyM", e[e.KeyN = 44] = "KeyN", e[e.KeyO = 45] = "KeyO", e[e.KeyP = 46] = "KeyP", e[e.KeyQ = 47] = "KeyQ", e[e.KeyR = 48] = "KeyR", e[e.KeyS = 49] = "KeyS", e[e.KeyT = 50] = "KeyT", e[e.KeyU = 51] = "KeyU", e[e.KeyV = 52] = "KeyV", e[e.KeyW = 53] = "KeyW", e[e.KeyX = 54] = "KeyX", e[e.KeyY = 55] = "KeyY", e[e.KeyZ = 56] = "KeyZ", e[e.Meta = 57] = "Meta", e[e.ContextMenu = 58] = "ContextMenu", e[e.F1 = 59] = "F1", e[e.F2 = 60] = "F2", e[e.F3 = 61] = "F3", e[e.F4 = 62] = "F4", e[e.F5 = 63] = "F5", e[e.F6 = 64] = "F6", e[e.F7 = 65] = "F7", e[e.F8 = 66] = "F8", e[e.F9 = 67] = "F9", e[e.F10 = 68] = "F10", e[e.F11 = 69] = "F11", e[e.F12 = 70] = "F12", e[e.F13 = 71] = "F13", e[e.F14 = 72] = "F14", e[e.F15 = 73] = "F15", e[e.F16 = 74] = "F16", e[e.F17 = 75] = "F17", e[e.F18 = 76] = "F18", e[e.F19 = 77] = "F19", e[e.NumLock = 78] = "NumLock", e[e.ScrollLock = 79] = "ScrollLock", e[e.Semicolon = 80] = "Semicolon", e[e.Equal = 81] = "Equal", e[e.Comma = 82] = "Comma", e[e.Minus = 83] = "Minus", e[e.Period = 84] = "Period", e[e.Slash = 85] = "Slash", e[e.Backquote = 86] = "Backquote", e[e.BracketLeft = 87] = "BracketLeft", e[e.Backslash = 88] = "Backslash", e[e.BracketRight = 89] = "BracketRight", e[e.Quote = 90] = "Quote", e[e.OEM_8 = 91] = "OEM_8", e[e.IntlBackslash = 92] = "IntlBackslash", e[e.Numpad0 = 93] = "Numpad0", e[e.Numpad1 = 94] = "Numpad1", e[e.Numpad2 = 95] = "Numpad2", e[e.Numpad3 = 96] = "Numpad3", e[e.Numpad4 = 97] = "Numpad4", e[e.Numpad5 = 98] = "Numpad5", e[e.Numpad6 = 99] = "Numpad6", e[e.Numpad7 = 100] = "Numpad7", e[e.Numpad8 = 101] = "Numpad8", e[e.Numpad9 = 102] = "Numpad9", e[e.NumpadMultiply = 103] = "NumpadMultiply", e[e.NumpadAdd = 104] = "NumpadAdd", e[e.NUMPAD_SEPARATOR = 105] = "NUMPAD_SEPARATOR", e[e.NumpadSubtract = 106] = "NumpadSubtract", e[e.NumpadDecimal = 107] = "NumpadDecimal", e[e.NumpadDivide = 108] = "NumpadDivide", e[e.KEY_IN_COMPOSITION = 109] = "KEY_IN_COMPOSITION", e[e.ABNT_C1 = 110] = "ABNT_C1", e[e.ABNT_C2 = 111] = "ABNT_C2", e[e.AudioVolumeMute = 112] = "AudioVolumeMute", e[e.AudioVolumeUp = 113] = "AudioVolumeUp", e[e.AudioVolumeDown = 114] = "AudioVolumeDown", e[e.BrowserSearch = 115] = "BrowserSearch", e[e.BrowserHome = 116] = "BrowserHome", e[e.BrowserBack = 117] = "BrowserBack", e[e.BrowserForward = 118] = "BrowserForward", e[e.MediaTrackNext = 119] = "MediaTrackNext", e[e.MediaTrackPrevious = 120] = "MediaTrackPrevious", e[e.MediaStop = 121] = "MediaStop", e[e.MediaPlayPause = 122] = "MediaPlayPause", e[e.LaunchMediaPlayer = 123] = "LaunchMediaPlayer", e[e.LaunchMail = 124] = "LaunchMail", e[e.LaunchApp2 = 125] = "LaunchApp2", e[e.MAX_VALUE = 126] = "MAX_VALUE" }(an || (an = {})), function(e) { e[e.Hint = 1] = "Hint", e[e.Info = 2] = "Info", e[e.Warning = 4] = "Warning", e[e.Error = 8] = "Error" }(ln || (ln = {})), function(e) { e[e.Unnecessary = 1] = "Unnecessary", e[e.Deprecated = 2] = "Deprecated" }(un || (un = {})), function(e) { e[e.Inline = 1] = "Inline", e[e.Gutter = 2] = "Gutter" }(hn || (hn = {})), function(e) { e[e.UNKNOWN = 0] = "UNKNOWN", e[e.TEXTAREA = 1] = "TEXTAREA", e[e.GUTTER_GLYPH_MARGIN = 2] = "GUTTER_GLYPH_MARGIN", e[e.GUTTER_LINE_NUMBERS = 3] = "GUTTER_LINE_NUMBERS", e[e.GUTTER_LINE_DECORATIONS = 4] = "GUTTER_LINE_DECORATIONS", e[e.GUTTER_VIEW_ZONE = 5] = "GUTTER_VIEW_ZONE", e[e.CONTENT_TEXT = 6] = "CONTENT_TEXT", e[e.CONTENT_EMPTY = 7] = "CONTENT_EMPTY", e[e.CONTENT_VIEW_ZONE = 8] = "CONTENT_VIEW_ZONE", e[e.CONTENT_WIDGET = 9] = "CONTENT_WIDGET", e[e.OVERVIEW_RULER = 10] = "OVERVIEW_RULER", e[e.SCROLLBAR = 11] = "SCROLLBAR", e[e.OVERLAY_WIDGET = 12] = "OVERLAY_WIDGET", e[e.OUTSIDE_EDITOR = 13] = "OUTSIDE_EDITOR" }(dn || (dn = {})), function(e) { e[e.TOP_RIGHT_CORNER = 0] = "TOP_RIGHT_CORNER", e[e.BOTTOM_RIGHT_CORNER = 1] = "BOTTOM_RIGHT_CORNER", e[e.TOP_CENTER = 2] = "TOP_CENTER" }(cn || (cn = {})), function(e) { e[e.Left = 1] = "Left", e[e.Center = 2] = "Center", e[e.Right = 4] = "Right", e[e.Full = 7] = "Full" }(mn || (mn = {})), function(e) { e[e.Off = 0] = "Off", e[e.On = 1] = "On", e[e.Relative = 2] = "Relative", e[e.Interval = 3] = "Interval", e[e.Custom = 4] = "Custom" }(fn || (fn = {})), function(e) { e[e.None = 0] = "None", e[e.Text = 1] = "Text", e[e.Blocks = 2] = "Blocks" }(gn || (gn = {})), function(e) { e[e.Smooth = 0] = "Smooth", e[e.Immediate = 1] = "Immediate" }(_n || (_n = {})), function(e) { e[e.Auto = 1] = "Auto", e[e.Hidden = 2] = "Hidden", e[e.Visible = 3] = "Visible" }(pn || (pn = {})), function(e) { e[e.LTR = 0] = "LTR", e[e.RTL = 1] = "RTL" }(Cn || (Cn = {})), function(e) { e[e.Invoke = 1] = "Invoke", e[e.TriggerCharacter = 2] = "TriggerCharacter", e[e.ContentChange = 3] = "ContentChange" }(Ln || (Ln = {})), function(e) { e[e.File = 0] = "File", e[e.Module = 1] = "Module", e[e.Namespace = 2] = "Namespace", e[e.Package = 3] = "Package", e[e.Class = 4] = "Class", e[e.Method = 5] = "Method", e[e.Property = 6] = "Property", e[e.Field = 7] = "Field", e[e.Constructor = 8] = "Constructor", e[e.Enum = 9] = "Enum", e[e.Interface = 10] = "Interface", e[e.Function = 11] = "Function", e[e.Variable = 12] = "Variable", e[e.Constant = 13] = "Constant", e[e.String = 14] = "String", e[e.Number = 15] = "Number", e[e.Boolean = 16] = "Boolean", e[e.Array = 17] = "Array", e[e.Object = 18] = "Object", e[e.Key = 19] = "Key", e[e.Null = 20] = "Null", e[e.EnumMember = 21] = "EnumMember", e[e.Struct = 22] = "Struct", e[e.Event = 23] = "Event", e[e.Operator = 24] = "Operator", e[e.TypeParameter = 25] = "TypeParameter" }(Sn || (Sn = {})), function(e) { e[e.Deprecated = 1] = "Deprecated" }(bn || (bn = {})), function(e) { e[e.Hidden = 0] = "Hidden", e[e.Blink = 1] = "Blink", e[e.Smooth = 2] = "Smooth", e[e.Phase = 3] = "Phase", e[e.Expand = 4] = "Expand", e[e.Solid = 5] = "Solid" }(Nn || (Nn = {})), function(e) { e[e.Line = 1] = "Line", e[e.Block = 2] = "Block", e[e.Underline = 3] = "Underline", e[e.LineThin = 4] = "LineThin", e[e.BlockOutline = 5] = "BlockOutline", e[e.UnderlineThin = 6] = "UnderlineThin" }(En || (En = {})), function(e) { e[e.AlwaysGrowsWhenTypingAtEdges = 0] = "AlwaysGrowsWhenTypingAtEdges", e[e.NeverGrowsWhenTypingAtEdges = 1] = "NeverGrowsWhenTypingAtEdges", e[e.GrowsOnlyWhenTypingBefore = 2] = "GrowsOnlyWhenTypingBefore", e[e.GrowsOnlyWhenTypingAfter = 3] = "GrowsOnlyWhenTypingAfter" }(yn || (yn = {})), function(e) { e[e.None = 0] = "None", e[e.Same = 1] = "Same", e[e.Indent = 2] = "Indent", e[e.DeepIndent = 3] = "DeepIndent" }(An || (An = {})); class Mn { static chord(e, t) { return function(e, t) { return (e | (65535 & t) << 16 >>> 0) >>> 0 }(e, t) } } Mn.CtrlCmd = 2048, Mn.Shift = 1024, Mn.Alt = 512, Mn.WinCtrl = 256; var Kn = function(e, t, n, i) { return new(n || (n = Promise))((function(r, s) { function o(e) { try { l(i.next(e)) } catch (e) { s(e) } } function a(e) { try { l(i.throw(e)) } catch (e) { s(e) } } function l(e) { var t; e.done ? r(e.value) : (t = e.value, t instanceof n ? t : new n((function(e) { e(t) }))).then(o, a) } l((i = i.apply(e, t || [])).next()) })) }; class On extends _t { get uri() { return this._uri } get eol() { return this._eol } getValue() { return this.getText() } getLinesContent() { return this._lines.slice(0) } getLineCount() { return this._lines.length } getLineContent(e) { return this._lines[e - 1] } getWordAtPosition(e, t) { let n = Lt(e.column, function(e) { let t = pt; if (e && e instanceof RegExp) if (e.global) t = e; else { let n = "g"; e.ignoreCase && (n += "i"), e.multiline && (n += "m"), e.unicode && (n += "u"), t = new RegExp(e.source, n) } return t.lastIndex = 0, t }(t), this._lines[e.lineNumber - 1], 0); return n ? new nt(e.lineNumber, n.startColumn, e.lineNumber, n.endColumn) : null } words(e) { const t = this._lines, n = this._wordenize.bind(this); let i = 0, r = "", s = 0, o = []; return { *[Symbol.iterator]() { for (;;) if (s < o.length) { const e = r.substring(o[s].start, o[s].end); s += 1, yield e } else { if (!(i < t.length)) break; r = t[i], o = n(r, e), s = 0, i += 1 } } } } getLineWords(e, t) { let n = this._lines[e - 1], i = this._wordenize(n, t), r = []; for (const e of i) r.push({ word: n.substring(e.start, e.end), startColumn: e.start + 1, endColumn: e.end + 1 }); return r } _wordenize(e, t) { const n = []; let i; for (t.lastIndex = 0; (i = t.exec(e)) && 0 !== i[0].length;) n.push({ start: i.index, end: i.index + i[0].length }); return n } getValueInRange(e) { if ((e = this._validateRange(e)).startLineNumber === e.endLineNumber) return this._lines[e.startLineNumber - 1].substring(e.startColumn - 1, e.endColumn - 1); let t = this._eol, n = e.startLineNumber - 1, i = e.endLineNumber - 1, r = []; r.push(this._lines[n].substring(e.startColumn - 1)); for (let e = n + 1; e < i; e++) r.push(this._lines[e]); return r.push(this._lines[i].substring(0, e.endColumn - 1)), r.join(t) } offsetAt(e) { return e = this._validatePosition(e), this._ensureLineStarts(), this._lineStarts.getPrefixSum(e.lineNumber - 2) + (e.column - 1) } positionAt(e) { e = Math.floor(e), e = Math.max(0, e), this._ensureLineStarts(); let t = this._lineStarts.getIndexOf(e), n = this._lines[t.index].length; return { lineNumber: 1 + t.index, column: 1 + Math.min(t.remainder, n) } } _validateRange(e) { const t = this._validatePosition({ lineNumber: e.startLineNumber, column: e.startColumn }), n = this._validatePosition({ lineNumber: e.endLineNumber, column: e.endColumn }); return t.lineNumber !== e.startLineNumber || t.column !== e.startColumn || n.lineNumber !== e.endLineNumber || n.column !== e.endColumn ? { startLineNumber: t.lineNumber, startColumn: t.column, endLineNumber: n.lineNumber, endColumn: n.column } : e } _validatePosition(e) { if (!tt.isIPosition(e)) throw new Error("bad position"); let { lineNumber: t, column: n } = e, i = !1; if (t < 1) t = 1, n = 1, i = !0; else if (t > this._lines.length) t = this._lines.length, n = this._lines[t - 1].length + 1, i = !0; else { let e = this._lines[t - 1].length + 1; n < 1 ? (n = 1, i = !0) : n > e && (n = e, i = !0) } return i ? { lineNumber: t, column: n } : e } } class Tn { constructor(e, t) { this._host = e, this._models = Object.create(null), this._foreignModuleFactory = t, this._foreignModule = null } dispose() { this._models = Object.create(null) } _getModel(e) { return this._models[e] } _getModels() { let e = []; return Object.keys(this._models).forEach((t => e.push(this._models[t]))), e } acceptNewModel(e) { this._models[e.url] = new On(We.parse(e.url), e.lines, e.EOL, e.versionId) } acceptModelChanged(e, t) { if (!this._models[e]) return; this._models[e].onEvents(t) } acceptRemovedModel(e) { this._models[e] && delete this._models[e] } computeDiff(e, t, n, i) { return Kn(this, void 0, void 0, (function*() { const r = this._getModel(e), s = this._getModel(t); if (!r || !s) return null; const o = r.getLinesContent(), a = s.getLinesContent(), l = new lt(o, a, { shouldComputeCharChanges: !0, shouldPostProcessCharChanges: !0, shouldIgnoreTrimWhitespace: n, shouldMakePrettyDiff: !0, maxComputationTime: i }).computeDiff(), u = !(l.changes.length > 0) && this._modelsAreIdentical(r, s); return { quitEarly: l.quitEarly, identical: u, changes: l.changes } })) } _modelsAreIdentical(e, t) { const n = e.getLineCount(); if (n !== t.getLineCount()) return !1; for (let i = 1; i <= n; i++) { if (e.getLineContent(i) !== t.getLineContent(i)) return !1 } return !0 } computeMoreMinimalEdits(e, t) { return Kn(this, void 0, void 0, (function*() { const n = this._getModel(e); if (!n) return t; const i = []; let r; t = t.slice(0).sort(((e, t) => { if (e.range && t.range) return nt.compareRangesUsingStarts(e.range, t.range); return (e.range ? 0 : 1) - (t.range ? 0 : 1) })); for (let { range: e, text: s, eol: o } of t) { if ("number" == typeof o && (r = o), nt.isEmpty(e) && !s) continue; const t = n.getValueInRange(e); if (s = s.replace(/\r\n|\n|\r/g, n.eol), t === s) continue; if (Math.max(s.length, t.length) > Tn._diffLimit) { i.push({ range: e, text: s }); continue } const a = _e(t, s, !1), l = n.offsetAt(nt.lift(e).getStartPosition()); for (const e of a) { const t = n.positionAt(l + e.originalStart), r = n.positionAt(l + e.originalStart + e.originalLength), o = { text: s.substr(e.modifiedStart, e.modifiedLength), range: { startLineNumber: t.lineNumber, startColumn: t.column, endLineNumber: r.lineNumber, endColumn: r.column } }; n.getValueInRange(o.range) !== o.text && i.push(o) } } return "number" == typeof r && i.push({ eol: r, text: "", range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } }), i })) } computeLinks(e) { return Kn(this, void 0, void 0, (function*() { let t = this._getModel(e); return t ? function(e) { return e && "function" == typeof e.getLineCount && "function" == typeof e.getLineContent ? wt.computeLinks(e) : [] }(t) : null })) } textualSuggest(e, t, n, i) { return Kn(this, void 0, void 0, (function*() { const r = new U(!0), s = new RegExp(n, i), o = new Set; e: for (let n of e) { const e = this._getModel(n); if (e) for (let n of e.words(s)) if (n !== t && isNaN(Number(n)) && (o.add(n), o.size > Tn._suggestionsLimit)) break e } return { words: Array.from(o), duration: r.elapsed() } })) } computeWordRanges(e, t, n, i) { return Kn(this, void 0, void 0, (function*() { let r = this._getModel(e); if (!r) return Object.create(null); const s = new RegExp(n, i), o = Object.create(null); for (let e = t.startLineNumber; e < t.endLineNumber; e++) { let t = r.getLineWords(e, s); for (const n of t) { if (!isNaN(Number(n.word))) continue; let t = o[n.word]; t || (t = [], o[n.word] = t), t.push({ startLineNumber: e, startColumn: n.startColumn, endLineNumber: e, endColumn: n.endColumn }) } } return o })) } navigateValueSet(e, t, n, i, r) { return Kn(this, void 0, void 0, (function*() { let s = this._getModel(e); if (!s) return null; let o = new RegExp(i, r); t.startColumn === t.endColumn && (t = { startLineNumber: t.startLineNumber, startColumn: t.startColumn, endLineNumber: t.endLineNumber, endColumn: t.endColumn + 1 }); let a = s.getValueInRange(t), l = s.getWordAtPosition({ lineNumber: t.startLineNumber, column: t.startColumn }, o); if (!l) return null; let u = s.getValueInRange(l); return vt.INSTANCE.navigateValueSet(t, a, l, u, n) })) } loadForeignModule(e, t, n) { const i = function(e, t) { const n = e => function() { const n = Array.prototype.slice.call(arguments, 0); return t(e, n) }; let i = {}; for (const t of e) i[t] = n(t); return i }(n, ((e, t) => this._host.fhr(e, t))); let r = { host: i, getMirrorModels: () => this._getModels() }; return this._foreignModuleFactory ? (this._foreignModule = this._foreignModuleFactory(r, t), Promise.resolve(W(this._foreignModule))) : Promise.reject(new Error("Unexpected usage")) } fmr(e, t) { if (!this._foreignModule || "function" != typeof this._foreignModule[e]) return Promise.reject(new Error("Missing requestHandler or method: " + e)); try { return Promise.resolve(this._foreignModule[e].apply(this._foreignModule, t)) } catch (e) { return Promise.reject(e) } } } Tn._diffLimit = 1e5, Tn._suggestionsLimit = 1e4, "function" == typeof importScripts && (R.monaco = { editor: void 0, languages: void 0, CancellationTokenSource: Tt, Emitter: H, KeyCode: an, KeyMod: Mn, Position: tt, Range: nt, Selection: wn, SelectionDirection: Cn, MarkerSeverity: ln, MarkerTag: un, Uri: We, Token: vn }); let Rn = !1; self.onmessage = e => { Rn || function(e) { if (Rn) return; Rn = !0; const t = new ae((e => { self.postMessage(e) }), (t => new Tn(t, e))); self.onmessage = e => { t.onmessage(e.data) } }(null) } })(); ================================================ FILE: app/main/dist/electron/index.html ================================================ Clash for Windows
================================================ FILE: app/main/dist/electron/main.js ================================================ function language(v, en, cn) { return v === 0 ? cn : v === 1 ? en : en; } (() => { var e = { 228: e => { e.exports = function(ar, len) { if (null == len || len > ar.length) { len = ar.length; } /** @type {number} */ var i = 0; /** @type {Array} */ var a = new Array(len); for (; i < len; i++) { a[i] = ar[i]; } return a; }, e.exports.default = e.exports, e.exports.__esModule = true; }, 858: e => { e.exports = function(argv) { if (Array.isArray(argv)) { return argv; } }, e.exports.default = e.exports, e.exports.__esModule = true; }, 646: (e, t, n) => { var r = n(228); e.exports = function(args) { if (Array.isArray(args)) { return r(args); } }, e.exports.default = e.exports, e.exports.__esModule = true; }, 926: e => { function t(args, next, b, c, reject, type, message) { try { var input = args[type](message); var val = input.value; } catch (self) { return void b(self); } if (input.done) { next(val); } else { Promise.resolve(val).then(c, reject); } } e.exports = function(e) { return function() { var n = this, r = arguments; return new Promise((function(o, i) { var a = e.apply(n, r); function c(e) { t(a, o, i, c, s, "next", e) } function s(e) { t(a, o, i, c, s, "throw", e) } c(void 0) })) } }, e.exports.default = e.exports, e.exports.__esModule = !0 }, 713: e => { e.exports = function(e, t, n) { return t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e }, e.exports.default = e.exports, e.exports.__esModule = !0 }, 860: e => { e.exports = function(e) { if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e) }, e.exports.default = e.exports, e.exports.__esModule = !0 }, 884: e => { e.exports = function(e, t) { var n = e && ("undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"]); if (null != n) { var r, o, i = [], a = !0, c = !1; try { for (n = n.call(e); !(a = (r = n.next()).done) && (i.push(r.value), !t || i.length !== t); a = !0); } catch (e) { c = !0, o = e } finally { try { a || null == n.return || n.return() } finally { if (c) throw o } } return i } }, e.exports.default = e.exports, e.exports.__esModule = !0 }, 521: e => { e.exports = function() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") }, e.exports.default = e.exports, e.exports.__esModule = !0 }, 206: e => { e.exports = function() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") }, e.exports.default = e.exports, e.exports.__esModule = !0 }, 38: (e, t, n) => { var r = n(858), o = n(884), i = n(379), a = n(521); e.exports = function(e, t) { return r(e) || o(e, t) || i(e, t) || a() }, e.exports.default = e.exports, e.exports.__esModule = !0 }, 319: (e, t, n) => { var r = n(646), o = n(860), i = n(379), a = n(206); e.exports = function(e) { return r(e) || o(e) || i(e) || a() }, e.exports.default = e.exports, e.exports.__esModule = !0 }, 379: (e, t, n) => { var r = n(228); e.exports = function(e, t) { if (e) { if ("string" == typeof e) return r(e, t); var n = Object.prototype.toString.call(e).slice(8, -1); return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? r(e, t) : void 0 } }, e.exports.default = e.exports, e.exports.__esModule = !0 }, 757: (e, t, n) => { e.exports = n(666) }, 666: e => { var t = function(e) { "use strict"; var t, n = Object.prototype, r = n.hasOwnProperty, o = "function" == typeof Symbol ? Symbol : {}, i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator", c = o.toStringTag || "@@toStringTag"; function s(e, t, n) { return Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }), e[t] } try { s({}, "") } catch (e) { s = function(e, t, n) { return e[t] = n } } function l(e, t, n, r) { var o = t && t.prototype instanceof b ? t : b, i = Object.create(o.prototype), a = new P(r || []); return i._invoke = function(e, t, n) { var r = p; return function(o, i) { if (r === f) throw new Error("Generator is already running"); if (r === h) { if ("throw" === o) throw i; return T() } for (n.method = o, n.arg = i;;) { var a = n.delegate; if (a) { var c = _(a, n); if (c) { if (c === m) continue; return c } } if ("next" === n.method) n.sent = n._sent = n.arg; else if ("throw" === n.method) { if (r === p) throw r = h, n.arg; n.dispatchException(n.arg) } else "return" === n.method && n.abrupt("return", n.arg); r = f; var s = u(e, t, n); if ("normal" === s.type) { if (r = n.done ? h : d, s.arg === m) continue; return { value: s.arg, done: n.done } } "throw" === s.type && (r = h, n.method = "throw", n.arg = s.arg) } } }(e, n, a), i } function u(e, t, n) { try { return { type: "normal", arg: e.call(t, n) } } catch (e) { return { type: "throw", arg: e } } } e.wrap = l; var p = "suspendedStart", d = "suspendedYield", f = "executing", h = "completed", m = {}; function b() {} function g() {} function y() {} var w = {}; w[i] = function() { return this }; var v = Object.getPrototypeOf, x = v && v(v(I([]))); x && x !== n && r.call(x, i) && (w = x); var k = y.prototype = b.prototype = Object.create(w); function C(e) { ["next", "throw", "return"].forEach((function(t) { s(e, t, (function(e) { return this._invoke(t, e) })) })) } function M(e, t) { function n(o, i, a, c) { var s = u(e[o], e, i); if ("throw" !== s.type) { var l = s.arg, p = l.value; return p && "object" == typeof p && r.call(p, "__await") ? t.resolve(p.__await).then((function(e) { n("next", e, a, c) }), (function(e) { n("throw", e, a, c) })) : t.resolve(p).then((function(e) { l.value = e, a(l) }), (function(e) { return n("throw", e, a, c) })) } c(s.arg) } var o; this._invoke = function(e, r) { function i() { return new t((function(t, o) { n(e, r, t, o) })) } return o = o ? o.then(i, i) : i() } } function _(e, n) { var r = e.iterator[n.method]; if (r === t) { if (n.delegate = null, "throw" === n.method) { if (e.iterator.return && (n.method = "return", n.arg = t, _(e, n), "throw" === n.method)) return m; n.method = "throw", n.arg = new TypeError("The iterator does not provide a 'throw' method") } return m } var o = u(r, e.iterator, n.arg); if ("throw" === o.type) return n.method = "throw", n.arg = o.arg, n.delegate = null, m; var i = o.arg; return i ? i.done ? (n[e.resultName] = i.value, n.next = e.nextLoc, "return" !== n.method && (n.method = "next", n.arg = t), n.delegate = null, m) : i : (n.method = "throw", n.arg = new TypeError("iterator result is not an object"), n.delegate = null, m) } function S(e) { var t = { tryLoc: e[0] }; 1 in e && (t.catchLoc = e[1]), 2 in e && (t.finallyLoc = e[2], t.afterLoc = e[3]), this.tryEntries.push(t) } function O(e) { var t = e.completion || {}; t.type = "normal", delete t.arg, e.completion = t } function P(e) { this.tryEntries = [{ tryLoc: "root" }], e.forEach(S, this), this.reset(!0) } function I(e) { if (e) { var n = e[i]; if (n) return n.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, a = function n() { for (; ++o < e.length;) if (r.call(e, o)) return n.value = e[o], n.done = !1, n; return n.value = t, n.done = !0, n }; return a.next = a } } return { next: T } } function T() { return { value: t, done: !0 } } return g.prototype = k.constructor = y, y.constructor = g, g.displayName = s(y, c, "GeneratorFunction"), e.isGeneratorFunction = function(e) { var t = "function" == typeof e && e.constructor; return !!t && (t === g || "GeneratorFunction" === (t.displayName || t.name)) }, e.mark = function(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, y) : (e.__proto__ = y, s(e, c, "GeneratorFunction")), e.prototype = Object.create(k), e }, e.awrap = function(e) { return { __await: e } }, C(M.prototype), M.prototype[a] = function() { return this }, e.AsyncIterator = M, e.async = function(t, n, r, o, i) { void 0 === i && (i = Promise); var a = new M(l(t, n, r, o), i); return e.isGeneratorFunction(n) ? a : a.next().then((function(e) { return e.done ? e.value : a.next() })) }, C(k), s(k, c, "Generator"), k[i] = function() { return this }, k.toString = function() { return "[object Generator]" }, e.keys = function(e) { var t = []; for (var n in e) t.push(n); return t.reverse(), function n() { for (; t.length;) { var r = t.pop(); if (r in e) return n.value = r, n.done = !1, n } return n.done = !0, n } }, e.values = I, P.prototype = { constructor: P, reset: function(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(O), !e) for (var n in this) "t" === n.charAt(0) && r.call(this, n) && !isNaN(+n.slice(1)) && (this[n] = t) }, stop: function() { this.done = !0; var e = this.tryEntries[0].completion; if ("throw" === e.type) throw e.arg; return this.rval }, dispatchException: function(e) { if (this.done) throw e; var n = this; function o(r, o) { return c.type = "throw", c.arg = e, n.next = r, o && (n.method = "next", n.arg = t), !!o } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var a = this.tryEntries[i], c = a.completion; if ("root" === a.tryLoc) return o("end"); if (a.tryLoc <= this.prev) { var s = r.call(a, "catchLoc"), l = r.call(a, "finallyLoc"); if (s && l) { if (this.prev < a.catchLoc) return o(a.catchLoc, !0); if (this.prev < a.finallyLoc) return o(a.finallyLoc) } else if (s) { if (this.prev < a.catchLoc) return o(a.catchLoc, !0) } else { if (!l) throw new Error("try statement without catch or finally"); if (this.prev < a.finallyLoc) return o(a.finallyLoc) } } } }, abrupt: function(e, t) { for (var n = this.tryEntries.length - 1; n >= 0; --n) { var o = this.tryEntries[n]; if (o.tryLoc <= this.prev && r.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break } } i && ("break" === e || "continue" === e) && i.tryLoc <= t && t <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = e, a.arg = t, i ? (this.method = "next", this.next = i.finallyLoc, m) : this.complete(a) }, complete: function(e, t) { if ("throw" === e.type) throw e.arg; return "break" === e.type || "continue" === e.type ? this.next = e.arg : "return" === e.type ? (this.rval = this.arg = e.arg, this.method = "return", this.next = "end") : "normal" === e.type && t && (this.next = t), m }, finish: function(e) { for (var t = this.tryEntries.length - 1; t >= 0; --t) { var n = this.tryEntries[t]; if (n.finallyLoc === e) return this.complete(n.completion, n.afterLoc), O(n), m } }, catch: function(e) { for (var t = this.tryEntries.length - 1; t >= 0; --t) { var n = this.tryEntries[t]; if (n.tryLoc === e) { var r = n.completion; if ("throw" === r.type) { var o = r.arg; O(n) } return o } } throw new Error("illegal catch attempt") }, delegateYield: function(e, n, r) { return this.delegate = { iterator: I(e), resultName: n, nextLoc: r }, "next" === this.method && (this.arg = t), m } }, e }(e.exports); try { regeneratorRuntime = t } catch (e) { Function("r", "regeneratorRuntime = r")(t) } }, 354: e => { "use strict"; e.exports = require("@fndroid/network-interface") }, 113: e => { "use strict"; e.exports = require("electron-window-bounds") }, 948: e => { "use strict"; e.exports = require("fix-path") }, 793: e => { "use strict"; e.exports = require("lodash") }, 298: e => { "use strict"; e.exports = require("electron") }, 147: e => { "use strict"; e.exports = require("fs") }, 17: e => { "use strict"; e.exports = require("path") } }, t = {}; function n(r) { var o = t[r]; if (void 0 !== o) return o.exports; var i = t[r] = { exports: {} }; return e[r](i, i.exports, n), i.exports } n.names = e => { var t = e && e.__esModule ? () => e.default : () => e; return n.d(t, { a: t }), t }, n.d = (e, t) => { for (var r in t) n.o(t, r) && !n.o(e, r) && Object.defineProperty(e, r, { enumerable: !0, get: t[r] }) }, n.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t), n.r = e => { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }) }; var r = {}; (() => { "use strict"; n.r(r); var e = n(319), t = n.names(e), o = n(38), i = n.names(o), a = n(713), c = n.names(a), s = n(926), l = n.names(s), u = n(757), p = n.names(u); require("@vue/reactivity"); const d = require("axios"); var f = n.names(d), host = n(298); function m(e, t) { var n = Object.keys(e); if (Object.getOwnPropertySymbols) { var r = Object.getOwnPropertySymbols(e); t && (r = r.filter((function(t) { return Object.getOwnPropertyDescriptor(e, t).enumerable }))), n.push.apply(n, r) } return n } function b(e) { for (var t = 1; t < arguments.length; t++) { var n = null != arguments[t] ? arguments[t] : {}; t % 2 ? m(Object(n), !0).forEach((function(t) { c()(e, t, n[t]) })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : m(Object(n)).forEach((function(t) { Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t)) })) } return e } var g, y, w, toolBar, x, k = n(298).TouchBar, C = k.TouchBarButton, M = n(17), _ = n(147), S = n(793), O = n(948); global.__static = n(17).join(__dirname, "/static").replace(/\\/g, "\\\\"), O(), host.app.disableHardwareAcceleration(), host.app.commandLine.appendSwitch("disable-features", "OutOfBlinkCors"), "darwin" === process.platform && host.app.dock.hide(); var P, I = [], T = "file://".concat(__dirname, "/index.html"); function j() { return "linux" === process.platform } function Launch() { if (g) { if ("win32" === process.platform) { if (g.isMinimized()) { g.restore(); } else { g.show(); } } else { g.setVisibleOnAllWorkspaces(true); setTimeout(function() { g.show(); g.setVisibleOnAllWorkspaces(false); }, 1); } } } function D() { var e, r; (g = new host.BrowserWindow({ height: 603, width: 850, minWidth: 850, minHeight: 603, backgroundColor: host.nativeTheme.shouldUseDarkColors ? "#272531" : "#f5f5f5", useContentSize: true, show: false, minimizable: true, frame: false, titleBarStyle: "hidden", icon: j() ? M.join(__static, "imgs", "icon_512.png") : void 0, webPreferences: { nodeIntegration: true, webSecurity: true, nodeIntegrationInWorker: false, contextIsolation: false, preload: M.resolve(M.join(__dirname, "preload.js")) } })).setMenu(null), g.webContents.on("will-navigate", function(types) { return types.preventDefault(); }), g.loadURL(T, { userAgent: "ClashforWindows/".concat(host.app.getVersion()) }), g.webContents.on("render-process-gone", (e = l()(p().mark(function e$$12(n, err) { var reason; var par; return p().wrap(function(self) { for (;;) { switch (self.prev = self.next) { case 0: if (reason = err.reason, "darwin" !== process.platform) { /** @type {number} */ self.next = 3; break; } return self.abrupt("return"); case 3: if ("crashed" !== reason) { /** @type {number} */ self.next = 10; break; } return par = { type: "error", title: "Clash for Windows", message: language(state.language, "Dashboard has crashed!", "\u4eea\u8868\u677f\u5d29\u6e83\u4e86!"), buttons: language(state.language, ["Reload", "Exit"], ["重新加载", "退出"]) }, self.next = 7, host.dialog.showMessageBox(g, par); case 7: if (0 === self.sent.response) { RelaunchApp(); } else { host.app.quit(); }; case 10: ; case "end": return self.stop(); } } }, e$$12); })), function(dataAndEvents, deepDataAndEvents) { return e.apply(this, arguments); })), host.ipcMain.handle("start-download", function(dataAndEvents, deepDataAndEvents, minX) { g.webContents.downloadURL(deepDataAndEvents); /** @type {Function} */ x = minX; }), g.webContents.session.on("will-download", function(dataAndEvents, model, deepDataAndEvents) { if (x) { model.setSavePath(x); model.on("updated", function(deepDataAndEvents, dataAndEvents) { if ("interrupted" === dataAndEvents) { g.webContents.send("download", "interrupted"); } else { if ("progressing" === dataAndEvents) { if (model.isPaused()) { g.webContents.send("download", "paused"); } else { g.webContents.send("download", "downloading", model.getReceivedBytes() / model.getTotalBytes()); } } } }); model.once("done", function(dataAndEvents, opt_content) { if ("completed" === opt_content) { g.webContents.send("download", "completed"); } else { g.webContents.send("download", "failed", opt_content); } }); /** @type {null} */ x = null; } }), host.ipcMain.handle("app", function(deepDataAndEvents, dataAndEvents) { /** @type {number} */ var len = arguments.length; /** @type {Array} */ var newArgs = new Array(len > 2 ? len - 2 : 0); /** @type {number} */ var i = 2; for (; i < len; i++) { newArgs[i - 2] = arguments[i]; } switch (dataAndEvents) { case "isPackaged": return host.app.isPackaged; case "getPath": return host.app.getPath.apply(host.app, newArgs); case "getAppPath": return host.app.getAppPath(); case "getName": return host.app.getName(); case "getVersion": return host.app.getVersion(); case "setLoginItemSettings": return host.app.setLoginItemSettings.apply(host.app, newArgs); case "relaunch": return host.app.relaunch(); case "exit": if (g.isMaximized) { g.unmaximize(); } return host.app.exit.apply(host.app, newArgs); case "quit": return host.app.quit(); } }), host.ipcMain.handle("window", (function(e, t) { for (var n, r, o = arguments.length, i = new Array(o > 2 ? o - 2 : 0), a = 2; a < o; a++) i[a - 2] = arguments[a]; switch (t) { case "close": return g.close(); case "minimize": return g.minimize(); case "maximize": return g.maximize(); case "unmaximize": return g.unmaximize(); case "setAlwaysOnTop": return (n = g).setAlwaysOnTop.apply(n, i); case "isVisible": return g.isVisible(); case "isMaximized": return g.isMaximized(); case "setFullScreen": return (r = g).setFullScreen.apply(r, i); case "reload": return g.reload() } })), g.on("hide", (function() { g.webContents.send("window-event", "hide") })), g.on("show", (function() { "darwin" === process.platform && host.app.dock.show(), g.webContents.send("window-event", "show") })), g.on("close", (function(e) { if (host.app.isQuiting) { if (g.isMaximized) { g.unmaximize(); } host.globalShortcut.unregisterAll(); host.app.exit(); } else { if (e.preventDefault(), "darwin" === process.platform && g.isFullScreen()) return void g.setFullScreen(!1); g.webContents.send("window-event", "close"), toolBar ? (g.blur(), g.hide(), "darwin" === process.platform && host.app.dock.hide()) : g.minimize() } return !1 })), g.on("maximize", (function(e) { g.webContents.send("window-event", "maximize") })), g.on("unmaximize", (function(e) { g.webContents.send("window-event", "unmaximize") })), g.on("enter-full-screen", (function(e) { g.webContents.send("window-event", "enter-full-screen") })), g.on("leave-full-screen", (function(e) { g.webContents.send("window-event", "leave-full-screen") })), g.on("session-end", (function(e) { if (g.isMaximized) { g.unmaximize(); } e.preventDefault(), g.webContents.send("app-exit") })), host.ipcMain.handle("webContent", (function(e, t) { if ("toggleDevTools" === t) return g.webContents.toggleDevTools() })), host.ipcMain.handle("dialog", (r = l()(p().mark((function e(t, n) { var r, o, i, a = arguments; return p().wrap((function(e) { for (;;) switch (e.prev = e.next) { case 0: for (r = a.length, o = new Array(r > 2 ? r - 2 : 0), i = 2; i < r; i++) o[i - 2] = a[i]; e.t0 = n, e.next = "showMessageBox" === e.t0 ? 4 : "showOpenDialogSync" === e.t0 ? 7 : 8; break; case 4: return e.next = 6, host.dialog.showMessageBox.apply(host.dialog, [g].concat(o)); case 6: return e.abrupt("return", e.sent); case 7: return e.abrupt("return", host.dialog.showOpenDialogSync.apply(host.dialog, [g].concat(o))); case 8: case "end": return e.stop() } }), e) }))), function(e, t) { return r.apply(this, arguments) })), host.ipcMain.handle("globalShortcut", (function(e, t) { for (var n = arguments.length, r = new Array(n > 2 ? n - 2 : 0), o = 2; o < n; o++) r[o - 2] = arguments[o]; switch (t) { case "register": return host.globalShortcut.register(r[0], (function() { g.webContents.send("shortcut-pressed", r[0]) })); case "unregister": return host.globalShortcut.unregister.apply(host.globalShortcut, r); case "isRegistered": return host.globalShortcut.isRegistered.apply(host.globalShortcut, r) } })), host.ipcMain.handle("nativeTheme", (function(e, t) { if ("shouldUseDarkColors" === t) return host.nativeTheme.shouldUseDarkColors })), host.nativeTheme.on("updated", (function() { g.webContents.send("native-theme-updated", host.nativeTheme.shouldUseDarkColors) })), host.ipcMain.handle("powerSaveBlocker", (function(e, t) { for (var n, r, o = arguments.length, i = new Array(o > 2 ? o - 2 : 0), a = 2; a < o; a++) i[a - 2] = arguments[a]; switch (t) { case "start": return (n = powerSaveBlocker).start.apply(n, i); case "stop": return (r = powerSaveBlocker).stop.apply(r, i) } })), host.ipcMain.on("set-allow-unsafe-urls", (function(e, t) { I = t })), g.setTouchBar(new k({ items: [new C({ label: "General", backgroundColor: "#505050", click: function() { g.webContents.send("menu-item-change", "general") } }), new C({ label: "Proxies", backgroundColor: "#505050", click: function() { g.webContents.send("menu-item-change", "proxy") } }), new C({ label: "Profiles", backgroundColor: "#505050", click: function() { g.webContents.send("menu-item-change", "server") } }), new C({ label: "Logs", backgroundColor: "#505050", click: function() { g.webContents.send("menu-item-change", "log") } }), new C({ label: "连接", backgroundColor: "#505050", click: function() { g.webContents.send("menu-item-change", "connection") } }), new C({ label: "Settings", backgroundColor: "#505050", click: function() { g.webContents.send("menu-item-change", "setting") } }), new C({ label: "Feedback", backgroundColor: "#505050", click: function() { g.webContents.send("menu-item-change", "about") } })] })), host.powerMonitor.on("suspend", (function() { g.webContents.send("power-event", "suspend") })), host.powerMonitor.on("resume", (function() { g.webContents.send("power-event", "resume") })), host.ipcMain.handle("window-control", (function(e, t) { switch (t) { case "hide": host.app.quit(); break; case "show": Launch(); break; case "show-or-hide": if (g.isVisible() && g.isFocused()) { host.app.quit(); } else { Launch(); }; default: host.app.quit(); } })), host.ipcMain.on("cleanup-done", (function(e) { host.app.isQuiting = !0, host.app.quit() })), host.ipcMain.on("status-changed", (function(e, t) { try { "darwin" !== process.platform && toolBar.setImage(t) } catch (e) {} })), host.ipcMain.on("show-notification", (function(e, t) { var n = M.join(global.__static, "imgs/logo_64.png"), notification = new host.Notification(b(b({}, t), {}, { icon: "darwin" !== process.platform ? host.nativeImage.createFromPath(n) : null })), o = t.folder, i = t.url; o && notification.on("click", (function() { host.shell.openPath(t.folder) })), i && notification.on("click", (function() { host.shell.openExternal(i) })), notification.show() })), host.ipcMain.on("clash-core-info", (function(e, t) { var n = t.port, r = t.secret; n > 0 && (P = f().create({ baseURL: "http://127.0.0.1:".concat(n, "/"), timeout: 5e3, headers: { Authorization: "Bearer ".concat(r) } })) })); var o; var state = { systemProxyChecked: false, tunModeChecked: false, mixinChecked: false, isReady: false, menuMode: "", menuStyle: 0, isShowDelayIcon: false, language: 0, }; /** * @param {string} event * @return {?} */ var s = function(event) { return host.nativeImage.createFromPath(M.join(__static, "imgs", "tray-proxy-".concat(event, ".png"))).resize({ width: 8, height: 8 }); }; var u = (s("default"), s("online")); var d = s("offline"); /** @type {function (): ?} */ var m = (o = l()(p().mark(function e$$13() { var samePartsLength; var radixToPower; var result; var path; var payload; var l; var config; var pdataOld; var events; var sort; var rule; var queuelen; return p().wrap(function(self) { for (;;) { switch (self.prev = self.next) { case 0: if (samePartsLength = [], self.prev = 1, j() && 2 !== !state.menuStyle) { /** @type {number} */ self.next = 12; break; } return self.next = 5, Promise.all([P.get("/proxies"), P.get("/providers/proxies")]); case 5: radixToPower = self.sent; result = i()(radixToPower, 2); path = result[0]; payload = result[1]; l = (null == path ? void 0 : path.data) || {}; config = l.proxies; pdataOld = (null == payload ? void 0 : payload.data) || {}; events = pdataOld.providers; if (config) { (sort = Object.entries(config).reduce(function(env, layers) { var error = i()(layers, 2); var errorName = error[0]; var params = error[1]; return "Selector" === (params || {}).type ? [].concat(t()(env), [{ name: errorName, all: params.all, now: params.now }]) : env; }, [])).sort(function(pkg, t) { var $ = config.GLOBAL.all; return $.findIndex(function(moduleName) { return moduleName === pkg.name; }) - $.findIndex(function(type) { return type === t.name; }); }); rule = Object.entries(events).reduce(function(env, owner) { var unlock = i()(owner, 2); var value = (unlock[0], (unlock[1] || {}).proxies); var computed = void 0 === value ? [] : value; return [].concat(t()(env), t()(computed)); }); samePartsLength = sort.map(function(result) { var text = result.name; var deps = result.all; var id = result.now; return { label: text, submenu: deps.map(function(name) { var me = rule.find(function(v) { return v.name === name; }) || []; return { label: name, type: "radio", checked: name === id, icon: state.isShowDelayIcon ? me.alive ? u : d : null, /** * @return {undefined} */ click: function() { if (P) { P.put("/proxies/".concat(encodeURIComponent(text)), { name: name }).then(function(jqXHR) { if (204 === jqXHR.status) { g.webContents.send("persist-selected-proxy"); g.webContents.send("break-connections", text); } }).catch(function(dataAndEvents) {}); } } }; }) }; }); }; case 12: /** @type {number} */ self.next = 16; break; case 14: /** @type {number} */ self.prev = 14; self.t0 = self.catch(1); case 16: return queuelen = [ [{ label: language(state.language, "Proxy Groups", "\u4ee3\u7406\u7ec4"), //代理组 enabled: false }].concat(t()(samePartsLength)), [{ label: language(state.language, "Proxy Groups", "\u4ee3\u7406\u7ec4"), //代理组 submenu: samePartsLength }], [] ][state.menuStyle || 0], self.abrupt("return", [{ label: language(state.language, "Dashboard", "\u4eea\u8868\u76d8"), //仪表盘 click: Launch }, { label: language(state.language, "Run Tray Script", "\u8fd0\u884c\u4efb\u52a1\u680f\u811a\u672c"), //运行任务栏脚本 visible: "linux" !== process.platform, /** * @return {?} */ click: function() { return g.webContents.send("run-tray-script"); } }, { type: "separator" }, { label: language(state.language, "System Proxy", "&\u7cfb\u7edf\u4ee3\u7406"), //系统代理 type: "checkbox", id: "system-proxy", checked: state.systemProxyChecked, enabled: state.isReady, visible: "linux" !== process.platform, /** * @param {Element} e * @return {undefined} */ click: function(e) { var status = e.checked; g.webContents.send("system-proxy-changed", status); } }, { label: language(state.language, "TUN Mode", "TUN \u6a21\u5f0f"), type: "checkbox", id: "tun", enabled: state.isReady, checked: state.tunModeChecked, /** * @param {Element} e * @return {undefined} */ click: function(e) { var status = e.checked; g.webContents.send("tun-changed", status); } }, { label: language(state.language, "Mixin", "\u6df7\u5408\u914d\u7f6e"), //混合配置 type: "checkbox", id: "mixin", enabled: state.isReady, checked: state.mixinChecked, /** * @param {Element} e * @return {undefined} */ click: function(e) { var status = e.checked; g.webContents.send("mixin-changed", status); } }, { type: "separator" }, { label: language(state.language, "Proxy Mode", "\u4ee3\u7406\u6a21\u5f0f"), //代理模式 id: "mode", enabled: false }, { label: language(state.language, "Global", "\u5168\u5c40"), //Global type: "radio", id: "mode-global", enabled: state.isReady, checked: "global" === state.menuMode, /** * @return {?} */ click: function() { return g.webContents.send("mode-changed", "global"); } }, { label: language(state.language, "Rule", "\u89c4\u5219"), //Rule type: "radio", id: "mode-rule", enabled: state.isReady, checked: "rule" === state.menuMode, /** * @return {?} */ click: function() { return g.webContents.send("mode-changed", "rule"); } }, { label: language(state.language, "Direct", "\u76f4\u8fde"), // Direct type: "radio", id: "mode-direct", enabled: state.isReady, checked: "direct" === state.menuMode, /** * @return {?} */ click: function() { return g.webContents.send("mode-changed", "direct"); } }, { label: language(state.language, "Script", "\u811a\u672c"), //Script type: "radio", id: "mode-script", enabled: state.isReady, checked: "script" === state.menuMode, /** * @return {?} */ click: function() { return g.webContents.send("mode-changed", "script"); } }, { type: "separator" }].concat(t()(queuelen), [{ type: "separator" }, { label: language(state.language, "Connections", "\u8fde\u63a5"), //Connections id: "connection", enabled: false }, { label: language(state.language, "Close All", "\u5173\u95ed\u5168\u90e8"), //Close All type: "normal", enabled: state.isReady, /** * @return {undefined} */ click: function() { P.delete("/connections"); } }, { type: "separator" }, { label: language(state.language, "More", "\u66f4\u591a"), //More submenu: [{ label: language(state.language, "Toggle DevTools", "\u5207\u6362Dev\u5de5\u5177"), //Toggle DevTools /** * @return {undefined} */ click: function() { g.webContents.toggleDevTools(); } }, { label: language(state.language, "Move Dashboard To Nearest Monitor", "\u5c06\u4eea\u8868\u677f\u79fb\u81f3\u6700\u8fd1\u7684\u663e\u793a\u5668"), //Move Dashboard To Nearest Monitor /** * @return {undefined} */ click: function() { g.setBounds(B(g.getBounds())); Launch(); } }, { label: language(state.language, "Restart", "\u91cd\u542f"), //Restart /** * @return {undefined} */ click: function() { if (g.isMaximized) { g.unmaximize(); } host.app.relaunch(); host.app.exit(0); } }, { label: language(state.language, "Force Quit", "\u5f3a\u5236\u9000\u51fa"), //Force Quit /** * @return {undefined} */ click: function() { /** @type {boolean} */ host.app.isQuiting = true; host.app.quit(); } }] }, { type: "separator" }, { label: language(state.language, "Quit", "\u9000\u51fa"), //Quit /** * @return {?} */ click: function() { if (g.isMaximized) { g.unmaximize(); } return g.webContents.send("app-exit"); } }])); case 18: ; case "end": return self.stop(); } } }, e$$13, null, [ [1, 14] ]); })), function() { return o.apply(this, arguments); }); /** * @return {undefined} */ var S = function() { var restoreScript; if (!toolBar) { var udataCur = host.nativeImage.createFromPath(M.join(__static, "imgs", "logo_64_eyes.png")).resize({ width: 24, height: 24 }); udataCur.setTemplateImage(true); var r20 = M.join(__static, "tray", "win", "tray_normal.ico"); var rreturn = M.join(__static, "imgs", "logo_reverse_32.png"); var trayOptions = (restoreScript = {}, c()(restoreScript, "win32", r20), c()(restoreScript, "darwin", udataCur), c()(restoreScript, "linux", rreturn), restoreScript)[process.platform]; (toolBar = new host.Tray(trayOptions)).setToolTip("Clash for Windows"); toolBar.on("right-click", function() { m().then(function(deepDataAndEvents) { toolBar.popUpContextMenu(host.Menu.buildFromTemplate(deepDataAndEvents)); }); }); toolBar.on("click", function() { if ("darwin" !== process.platform) { Launch(); } }); toolBar.on("mouse-down", Launch); } }; S(), host.ipcMain.handle("tray-create-destroy", function(dataAndEvents) { var method = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "create"; if ("create" === method) { S(); } if ("destroy" === method) { if (toolBar) { toolBar.destroy(); /** @type {null} */ toolBar = null; } } }); var O_CN = host.Menu.buildFromTemplate([{ label: "仪表盘", click: Launch }, { type: "separator" }, { label: "TUN 模式", type: "checkbox", id: "tun", enabled: !1, click: function(e) { var t = e.checked; g.webContents.send("tun-changed", t) } }, { label: "混合配置", type: "checkbox", id: "mixin", enabled: !1, click: function(e) { var t = e.checked; g.webContents.send("mixin-changed", t) } }, { type: "separator" }, { label: "代理模式", id: "mode", enabled: !1 }, { label: "全局", type: "radio", id: "mode-global", enabled: !1, click: function() { return g.webContents.send("mode-changed", "global") } }, { label: "规则", type: "radio", id: "mode-rule", enabled: state.isReady, checked: "rule" === state.menuMode, click: function() { return g.webContents.send("mode-changed", "rule") } }, { label: "直连", type: "radio", id: "mode-direct", enabled: !1, click: function() { return g.webContents.send("mode-changed", "direct") } }, { label: "脚本", type: "radio", id: "mode-script", enabled: !1, click: function() { return g.webContents.send("mode-changed", "script") } }, { type: "separator" }, { label: "更多", submenu: [{ label: "切换Dev工具", click: function() { g.webContents.toggleDevTools() } }, { label: "将仪表板移至最近的显示器", click: function() { g.setBounds(B(g.getBounds())), Launch() } }, { label: "重启", click: function() { if (g.isMaximized) { g.unmaximize(); } host.app.relaunch(), host.app.exit(0) } }, { label: "强制退出", click: function() { host.app.isQuiting = !0, host.app.quit() } }] }, { type: "separator" }, { label: "退出", click: function() { if (g.isMaximized) { g.unmaximize(); } return g.webContents.send("app-exit") } }]); var O_EN = host.Menu.buildFromTemplate([{ label: "Dashboard", click: Launch }, { type: "separator" }, { label: "TUN Mode", type: "checkbox", id: "tun", enabled: !1, click: function (e) { var t = e.checked; g.webContents.send("tun-changed", t) } }, { label: "Mixin", type: "checkbox", id: "mixin", enabled: !1, click: function (e) { var t = e.checked; g.webContents.send("mixin-changed", t) } }, { type: "separator" }, { label: "Proxy Mode", id: "mode", enabled: !1 }, { label: "Global", type: "radio", id: "mode-global", enabled: !1, click: function () { return g.webContents.send("mode-changed", "global") } }, { label: "Rule", type: "radio", id: "mode-rule", enabled: state.isReady, checked: "rule" === state.menuMode, click: function () { return g.webContents.send("mode-changed", "rule") } }, { label: "Direct", type: "radio", id: "mode-direct", enabled: !1, click: function () { return g.webContents.send("mode-changed", "direct") } }, { label: "Script", type: "radio", id: "mode-script", enabled: !1, click: function () { return g.webContents.send("mode-changed", "script") } }, { type: "separator" }, { label: "More", submenu: [{ label: "Toggle DevTools", click: function () { g.webContents.toggleDevTools() } }, { label: "Move Dashboard To Nearest Monitor", click: function () { g.setBounds(B(g.getBounds())), Launch() } }, { label: "Restart", click: function () { if (g.isMaximized) { g.unmaximize(); } host.app.relaunch(), host.app.exit(0) } }, { label: "Force Quit", click: function () { host.app.isQuiting = !0, host.app.quit() } }] }, { type: "separator" }, { label: "Quit", click: function () { if (g.isMaximized) { g.unmaximize(); } return g.webContents.send("app-exit") } }]); function D() { j() && toolBar && toolBar.setContextMenu(language(state.language, O_EN, O_CN)) } D(), host.ipcMain.on("clash-core-status-change", (function(e, t) { if (state.isReady = !0, j()) { var n = language(state.language, O_EN, O_CN).getMenuItemById("system-proxy"); n && (n.enabled = 1 !== t); var r = language(state.language, O_EN, O_CN).getMenuItemById("mixin"); r && (r.enabled = 1 !== t); var o = language(state.language, O_EN, O_CN).getMenuItemById("tun"); o && (o.enabled = 1 !== t), ["global", "rule", "direct", "script"].forEach((function(e) { var n = language(state.language, O_EN, O_CN).getMenuItemById("mode-".concat(e)); n && (n.enabled = 1 !== t) })), D() } })), host.ipcMain.handle("tray-proxies-style", (function(e, t) { if (t === 0) { state.menuStyle = 1; } else if (t === 1) { state.menuStyle = 0; } else { state.menuStyle = 2 } })), host.ipcMain.handle("tray-proxies-icon", (function(e, t) { state.isShowDelayIcon = t })), host.ipcMain.on("mode-changed", (function(e, t) { if (state.menuMode = t, j()) { var n = "mode-".concat(t), r = language(state.language, O_EN, O_CN).getMenuItemById(n); r && (r.checked = !0), D() } })), host.ipcMain.handle("cfw-language", (function (e, t) { state.language = t })), host.ipcMain.on("system-proxy-changed", (function(e, t) { state.systemProxyChecked = t })), host.ipcMain.on("mixin-changed", (function(e, t) { if (state.mixinChecked = t, j()) { var n = language(state.language, O_EN, O_CN).getMenuItemById("mixin"); n && (n.checked = t), D() } })), host.ipcMain.on("tun-changed", (function(e, t) { if (state.tunModeChecked = t, j()) { var n = language(state.language, O_EN, O_CN).getMenuItemById("tun"); n && (n.checked = t), D() } })), host.ipcMain.on("enhanced-tray-click", Launch), host.ipcMain.on("speed-update", (function(e, t, n) { var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "#fff"; try { if (toolBar) { var o = host.nativeImage.createFromDataURL(t); if ("win32" === process.platform) { if (60 === n) return void(y && (y.destroy(), y = null, w = 0)); var i = o.crop({ x: 0, y: 0, width: n + 8, height: 69 }); var a = M.join(host.app.getPath("temp"), "cfw-sub.html"); var c = i.getSize(); var s = c.width; var l = c.height; _.writeFileSync(a, '\n \n \n
\n \n