Compare commits

..

No commits in common. "master" and "v1.4.2" have entirely different histories.

129 changed files with 103714 additions and 11756 deletions

View File

@ -1,5 +1,5 @@
name: Bug Report
description: Submit an error report. Failure to respond within 3 days after receiving a response will result in closure. Attention! Asking questions without starting is very unethical.(提交错误报告。在收到回复后3天内未做出回复将导致关闭。注意不star却提问是很没有道德的。)
description: File a bug report
title: "[Bug]: "
labels: ["bug"]

View File

@ -1,56 +0,0 @@
name: Auto Close Issues if Not Starred
on:
issues:
types: [opened]
jobs:
close_issue:
runs-on: ubuntu-latest
steps:
- name: Check if user has starred the repo
id: check_star
run: |
ISSUE_USER=$(jq -r '.issue.user.login' < $GITHUB_EVENT_PATH)
echo "Issue created by user: $ISSUE_USER"
PAGE=1
STARRED=""
while [[ -z "$STARRED" ]]; do
STARRED_RESPONSE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/stargazers?per_page=100&page=$PAGE")
echo "STARRED_RESPONSE=$STARRED_RESPONSE" # 输出 API 返回的数据以检查结构
if [[ -z "$STARRED_RESPONSE" || "$STARRED_RESPONSE" == "[]" ]]; then
break
fi
STARRED=$(echo "$STARRED_RESPONSE" | jq -r '.[] | select(.login == "'$ISSUE_USER'") | .login')
PAGE=$((PAGE + 1))
done
if [[ -z "$STARRED" ]]; then
echo "User has not starred the repo."
else
echo "User has starred the repo."
fi
echo "starred=$STARRED" >> $GITHUB_ENV
- name: Close issue if not starred
if: env.starred == '0'
run: |
ISSUE_NUMBER=$(jq -r '.issue.number' < $GITHUB_EVENT_PATH)
echo "Closing issue #$ISSUE_NUMBER"
curl -s -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE_NUMBER/comments \
-d '{"body":"Please star the project before submitting an issue."}'
curl -s -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/$ISSUE_NUMBER \
-d '{"state":"closed"}'

View File

@ -1,119 +0,0 @@
name: RustDesk Web Api
on:
workflow_dispatch:
inputs:
docker_username:
description: 'docker user name'
required: true
default: ''
docker_password:
description: 'docker user password'
required: true
default: ''
jobs:
alpine:
runs-on: ubuntu-latest
name: Build Docker Image (Alpine)
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Release version
id: release_version
run: |
app_version=$(cat version.py |sed -ne "s/APP_VERSION\s=\s'v\(.*\)'/\1/gp")
echo "app_version=${app_version}" >> $GITHUB_ENV
- name: Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ github.event.inputs.docker_username }}/rustdesk-api-server
tags: |
type=raw,value=${{ env.app_version }}
type=raw,value=latest
-
name: Set Up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set Up Buildx
uses: docker/setup-buildx-action@v2
-
name: Login DockerHub
uses: docker/login-action@v2
with:
username: ${{ github.event.inputs.docker_username }}
password: ${{ github.event.inputs.docker_password }}
-
name: Build Image
uses: docker/build-push-action@v4
with:
context: docker
file: docker/Dockerfile
platforms: |
linux/amd64
linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
debian:
runs-on: ubuntu-latest
name: Build Docker Image (Debian)
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Release version
id: release_version
run: |
app_version=$(cat version.py |sed -ne "s/APP_VERSION\s=\s'v\(.*\)'/\1/gp")
echo "app_version=${app_version}-debian" >> $GITHUB_ENV
- name: Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ github.event.inputs.docker_username }}/rustdesk-api-server
tags: |
type=raw,value=${{ env.app_version }}
type=raw,value=debian
-
name: Set Up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set Up Buildx
uses: docker/setup-buildx-action@v2
-
name: Login DockerHub
uses: docker/login-action@v2
with:
username: ${{ github.event.inputs.docker_username }}
password: ${{ github.event.inputs.docker_password }}
-
name: Build Image
uses: docker/build-push-action@v4
with:
context: docker
file: docker/debian.Dockerfile
platforms: |
linux/amd64
linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@ -10,9 +10,10 @@ on:
branches:
- master
tags:
- "v*"
- "v*.*"
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
@ -20,18 +21,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v2
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.IMAGE_NAME }}
ghcr.io/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=tag
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
@ -42,16 +38,10 @@ jobs:
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
@ -68,12 +58,3 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Update repo description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: ${{ env.IMAGE_NAME }}
short-description: ${{ github.event.repository.description }}
enable-url-completion: true

12
.gitignore vendored
View File

@ -15,17 +15,7 @@ test
# Files
*.bat
server.ico
start.py
# Build
build
dist
dist-
dist_py38
LICENSE.rst
db/test_db.sqlite3
job2en.py
新建文本文档.txt
dist

View File

@ -3,13 +3,6 @@ FROM python:3.10.3-alpine
WORKDIR /rustdesk-api-server
ADD . /rustdesk-api-server
# 安装系统依赖
RUN apk add --no-cache \
gcc \
musl-dev \
mariadb-connector-c-dev \
pkgconfig
RUN set -ex \
&& pip install --no-cache-dir --disable-pip-version-check -r requirements.txt \
&& rm -rf /var/cache/apk/* \

View File

@ -1,12 +1,9 @@
# rustdesk-api-server
[The English explanation is available by clicking here.](https://github.com/kingmo888/rustdesk-api-server/blob/master/README_EN.md)
<p align="center">
<i>一个 python 实现的 Rustdesk API 接口,支持 WebUI 管理</i>
<br/>
<img src ="https://img.shields.io/badge/Version-1.5.2-blueviolet.svg"/>
<img src ="https://img.shields.io/badge/Version-1.4.2-blueviolet.svg"/>
<img src ="https://img.shields.io/badge/Python-3.7|3.8|3.9|3.10|3.11-blue.svg" />
<img src ="https://img.shields.io/badge/Django-3.2+|4.x-yelow.svg" />
<br/>
@ -14,29 +11,9 @@
<img src ="https://img.shields.io/badge/Docker-arm|arm64|amd64-blue.svg" />
</p>
# 1.2.3版本与1.2.6+版本区别
#### **请使用自定义key因不填写key、或使用服务端自动生成的key而引起的链接超时或建立链接时间过长的问题不在本项目解决范围内。**
## 缘起
> rustdesk官方在其新版服务端中已[强制要求key](https://rustdesk.com/docs/zh-cn/self-host/rustdesk-server-oss/install/#key)(rustdesk-server版本号大概>=1.1.10)
- rustdesk版本<=1.2.3, 服务端请配合使用rustdesk-server<=1.1.10
- 根据自身需要来选择是否配置服务端的key参数。
- rustdesk版本>1.2.3, 服务端请配合使用rustdesk-server>=1.1.11
- 当使用rustdesk-server自动生成的key时会出现链接缓慢甚至链接超时。
- 解决办法使用自定义k——配置rustdesk-server时传入k参数来自定义key值同时客户端同步配置相同的key即可秒连。
- rustdesk-server的dock-compose配置参考
![demo](images/compose_demo.png)
`key是保证别人不能在知道你中继服务器的IP后利用你的IP做中继。如果不配置key就做好中继IP的保密工作不要泄露给其他人。
而只要服务端配置了密钥无论是随机生成生成后本身就固定了还是自定义的如果控制客户端不配置对应key就无法控制其他机器被控机器可以不填key`
对于自定义key是否生效请看rustdesk server中`hbbs`的日志:
![demo](images/key_activate.png)
## 展示
看了市面上各类 RustDesk WEB API 版本或多或少的存在一些问题比如说需要通过url注册、新版客户端某些接口不支持、无法方便的修改密码等不足因此博采众长撸一个自己喜欢的版本来用。在此要感谢论坛及github的各位朋友写的接口省去了我抓包找接口的时间。
![主页面](images/front_main.png)
@ -68,10 +45,11 @@
### 方法1开箱即用
仅支持Windows请前往 release 下载,无需安装环境,直接运行`启动.bat`即可。 截图:
仅支持Windows请前往 release 下载,无需安装环境,直接运行`启动.bat`即可。独立版截图:
![window直接运行版](/images/windows_run.png)
![window独立绿色版](/images/windows_run.png)
另外该方式下的webui(暂时)无法使用可以通过domain.com:21114/static/web-client/index.html来访问。需要修改`_internal/static/web-client/index.html`中的23行为你的中继服务器地址。
### 方法2代码运行
@ -154,16 +132,6 @@ services:
| `CSRF_TRUSTED_ORIGINS` | 可选,默认关闭验证;<br>如需开启填写你的访问地址 `http://yourdomain.com:21114` <br>**如需关闭验证请删除此变量,而不是留空** | 防跨域信任来源 |
| `ID_SERVER` | 可选默认为和API服务器同主机。<br>可自定义如 `yourdomain.com` | Web控制端使用的ID服务器 |
| `DEBUG` | 可选,默认 `False` | 调试模式 |
| `ALLOW_REGISTRATION` | 可选,默认 `True` | 是否允许新用户注册 |
| 数据库配置 | -- 开始 -- | 若不使用MYSQL则以下皆无需配置 |
| `DATABASE_TYPE` | 可选,默认 `SQLITE3` | 数据库类型(SQLITE/MYSQL) |
| `MYSQL_DBNAME` | 可选,默认 `-` | MYSQL数据库名 |
| `MYSQL_HOST` | 可选,默认 `127.0.0.1` | MYSQL数据库的服务器IP |
| `MYSQL_USER` | 可选,默认 `-` | MYSQL数据库的用户名 |
| `MYSQL_PASSWORD` | 可选,默认 `-` | MYSQL数据库的密码 |
| `MYSQL_PORT` | 可选,默认 `3306` | MYSQL数据库端口 |
| 数据库配置 | -- 结束 -- | 查看【[sqlite3迁移mysql教程](/tutorial/sqlite2mysql.md)】 |
| `LANGUAGE_CODE` | 可选,默认 `zh-hans` | 语言,支持中文(`zh-hans`)、英语(`en`) |
## 使用问题
@ -193,10 +161,6 @@ services:
这种操作大概率是docker配置+nginx反代+SSL的组合要注意修改CSRF_TRUSTED_ORIGINS如果是ssl那就是https开头否则就是http。
- Mysql版本要求
如果你使用的是Mysql数据库需要注意django4.x版本需要Mysql8.0如果要使用mysql5.8则需要将django版本降至3.2。
## 开发计划
- [x] 分享设备给其他已注册用户v1.3+
@ -208,37 +172,10 @@ services:
> 将大神的web客户端集成进来已集成。 [来源](https://www.52pojie.cn/thread-1708319-1-1.html)
- [x] 对过期(不在线)设备的过滤,用以区分在线&离线设备(1.4.7)
> 通过配置方式,对过期超过指定时间的设备清理或过滤。
- [x] 首屏拆分为用户列表页与管理员列表页并增加分页(1.4.6)。
- [x] 支持信息导出到为xlsx文件(1.4.6)。
> 支持管理员在【所有设备】页面导出所有设备信息。
- [x] 通过配置项设定是否允许新用户注册(1.4.7)。
- [x] 支持mysql及sqlite3迁移mysql(1.4.8)。
- [-] 用户前端修改密码。
- [-] 前端改造,所有页面自适应,前后端分离(计划V2)。
## 其他相关工具
- [可以修改客户端ID的CMD脚本](https://github.com/abdullah-erturk/RustDesk-ID-Changer)
- [rustdesk](https://github.com/rustdesk/rustdesk)
- [rustdesk-server](https://github.com/rustdesk/rustdesk-server)
## Stargazers over time
[![Stargazers over time](https://starchart.cc/kingmo888/rustdesk-api-server.svg?variant=adaptive)](https://starchart.cc/kingmo888/rustdesk-api-server)
## 联络我
![wechat](images/wechat.png)
- [rustdesk-server](https://github.com/rustdesk/rustdesk-server)

View File

@ -1,210 +0,0 @@
# rustdesk-api-server
## If the project has helped you, giving a star isn't too much, right?
## Please use the latest version 1.2.3 of the client.
[点击这里查看中文说明。](https://github.com/kingmo888/rustdesk-api-server/blob/master/README.md)
<p align="center">
<i>A Rustdesk API interface implemented in Python, with WebUI management support</i>
<br/>
<img src ="https://img.shields.io/badge/Version-1.5.1-blueviolet.svg"/>
<img src ="https://img.shields.io/badge/Python-3.7|3.8|3.9|3.10|3.11-blue.svg" />
<img src ="https://img.shields.io/badge/Django-3.2+|4.x-yelow.svg" />
<br/>
<img src ="https://img.shields.io/badge/Platform-Windows|Linux-green.svg"/>
<img src ="https://img.shields.io/badge/Docker-arm|arm64|amd64-blue.svg" />
</p>
![Main Page](images/front_main.png)
## Features
- Supports self-registration and login on the front-end webpage.
- Registration and login pages:
![Front Registration](images/front_reg.png)
![Front Login](images/front_login.png)
- Supports displaying device information on the front end, divided into administrator and user versions.
- Supports custom aliases (remarks).
- Supports backend management.
- Supports colored tags.
![Rust Books](images/rust_books.png)
- Supports device online statistics.
- Supports saving device passwords.
- Automatically manages tokens and keeps them alive using the heartbeat interface.
- Supports sharing devices with other users.
![Rust Share](images/share.png)
- Supports web control terminal (currently only supports non-SSL mode, see below for usage issues)
![Rust Share](images/webui.png)
Admin Home Page:
![Admin Main](images/admin_main.png)
## Installation
### Method 1: Out-of-the-box
Only supports Windows, please go to the release to download, no need to install environment, just run `启动.bat` directly. Screenshots:
![Windows Run Directly Version](/images/windows_run.png)
### Method 2: Running the Code
```bash
# Clone the code locally
git clone https://github.com/kingmo888/rustdesk-api-server.git
# Enter the directory
cd rustdesk-api-server
# Install dependencies
pip install -r requirements.txt
# After ensuring dependencies are installed correctly, execute:
# Please modify the port number yourself, it is recommended to keep 21114 as the default port for Rustdesk API
python manage.py runserver 0.0.0.0:21114
```
Now you can access it using `http://localhostIP:Port`.
**Note**: When configuring on CentOS, Django4 may have problems due to the low version of sqlite3 in the system. Please modify the file in the dependency library. Path: `xxxx/Lib/site-packages/django/db/backends/sqlite3/base.py` (Find the package address according to the situation), modify the content:
```python
# from sqlite3 import dbapi2 as Database #(comment out this line)
from pysqlite3 import dbapi2 as Database # enable pysqlite3
```
### Method 3: Docker Run
#### Docker Method 1: Build Yourself
```bash
git clone https://github.com/kingmo888/rustdesk-api-server.git
cd rustdesk-api-server
docker compose --compatibility up --build -d
```
Thanks to the enthusiastic netizen @ferocknew for providing.
#### Docker Method 2: Pre-built Run
docker run command:
```bash
docker run -d \
--name rustdesk-api-server \
-p 21114:21114 \
-e CSRF_TRUSTED_ORIGINS=http://yourdomain.com:21114 \ #Cross-origin trusted source, optional
-e ID_SERVER=yourdomain.com \ #ID server used by the web control terminal
-v /yourpath/db:/rustdesk-api-server/db \ #Modify /yourpath/db to your host database mount directory
-v /etc/timezone:/etc/timezone:ro \
-v /etc/localtime:/etc/localtime:ro \
--network bridge \
--restart unless-stopped \
ghcr.io/kingmo888/rustdesk-api-server:latest
```
docker-compose method:
```yaml
version: "3.8"
services:
rustdesk-api-server:
container_name: rustdesk-api-server
image: ghcr.io/kingmo888/rustdesk-api-server:latest
environment:
- CSRF_TRUSTED_ORIGINS=http://yourdomain.com:21114 #Cross-origin trusted source, optional
- ID_SERVER=yourdomain.com #ID server used by the web control terminal
volumes:
- /yourpath/db:/rustdesk-api-server/db #Modify /yourpath/db to your host database mount directory
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
network_mode: bridge
ports:
- "21114:21114"
restart: unless-stopped
```
## Environment Variables
| Variable Name | Reference Value | Note |
| ---- | ------- | ----------- |
| `HOST` | Default `0.0.0.0` | IP binding of the service |
| `TZ` | Default `Asia/Shanghai`, optional | Timezone |
| `SECRET_KEY` | Optional, custom a random string | Program encryption key |
| `CSRF_TRUSTED_ORIGINS` | Optional, verification off by default;<br>If you need to enable it, fill in your access address `http://yourdomain.com:21114` <br>**To disable verification, please delete this variable instead of leaving it blank** | Cross-origin trusted source |
| `ID_SERVER` | Optional, default is the same host as the API server.<br>Customizable like `yourdomain.com` | ID server used by the web control terminal |
| `DEBUG` | Optional, default `False` | Debug mode |
| `ALLOW_REGISTRATION` | Optional, default `True` | Whether to allow new user registration |
| Database Configuration | -- Start -- | If not using MYSQL, the following are unnecessary |
| `DATABASE_TYPE` | Optional, default `SQLITE3` | Database type (SQLITE/MYSQL) |
| `MYSQL_DBNAME` | Optional, default `-` | MYSQL database name |
| `MYSQL_HOST` | Optional, default `127.0.0.1` | MYSQL database server IP |
| `MYSQL_USER` | Optional, default `-` | MYSQL database username |
| `MYSQL_PASSWORD` | Optional, default `-` | MYSQL database password |
| `MYSQL_PORT` | Optional, default `3306` | MYSQL database port |
| Database Configuration | -- End -- | See [sqlite3 migration to mysql tutorial](/tutorial/sqlite2mysql.md) |
## Usage Issues
- Administrator Settings
When there are no accounts in the database, the first registered account directly obtains super administrator privileges,
and subsequently registered accounts are ordinary accounts.
- Device Information
Tested, the client will send device information to the API interface regularly in the mode of installation as a service under non-green mode, so if you want device information, you need to install the Rustdesk client and start the service.
- Slow Connection Speed
The new version Key mode connection speed is slow. You can start the service on the server without the -k parameter. At this time, the client cannot configure the key either.
- Web Control Terminal Configuration
- Set the ID_SERVER environment variable or modify the ID_SERVER configuration item in the rustdesk_server_api/settings.py file and fill in the IP or domain name of the ID server/relay server.
- Web Control Terminal Keeps Spinning
- Check if the ID server filling is correct.
- The web control terminal currently only supports non-SSL mode. If the webui is accessed via https, remove the 's', otherwise ws cannot connect and keeps spinning. For example: https://domain.com/webui, change to http://domain.com/webui
- CSRF verification failed when logging in or logging out of backend operations. Request interrupted.
This operation is highly likely to be a combination of docker configuration + nginx reverse proxy + SSL. Pay attention to modifying CSRF_TRUSTED_ORIGINS. If it is SSL, it starts with https, otherwise it is http.
## Development Plans
- [x] Share devices with other registered users (v1.3+)
> Explanation: Similar to sharing URLs of network disks, the URL can be activated to obtain devices under a certain group or certain label.
> Note: In fact, there is not much that can be done with the web API as middleware. More functions still need to be implemented by modifying the client, which is not very worthwhile.
- [x] Integration of Web client form (v1.4+)
> Integrating the great god's web client, already integrated. [Source](https://www.52pojie.cn/thread-1708319-1-1.html)
- [x] Filter expired (offline) devices to distinguish between online and offline devices (1.4.7)
> By configuration, clean or filter devices that have expired for more than a specified time.
- [x] Split the first screen into user list page and administrator list page and add pagination (1.4.6).
- [x] Support exporting information to xlsx files (1.4.6).
> Allows administrators to export all device information on the [All Devices] page.
- [x] Set whether to allow new user registration through configuration items (1.4.7).
- [x] Support mysql and sqlite3 migration to mysql (1.4.8).
## Other Related Tools
- [CMD script for modifying client ID](https://github.com/abdullah-erturk/RustDesk-ID-Changer)
- [rustdesk](https://github.com/rustdesk/rustdesk)
- [rustdesk-server](https://github.com/rustdesk/rustdesk-server)
## Stargazers over time
[![Stargazers over time](https://starchart.cc/kingmo888/rustdesk-api-server.svg?variant=adaptive)](https://starchart.cc/kingmo888/rustdesk-api-server)

View File

@ -5,14 +5,14 @@ from django import forms
from django.contrib.auth.models import Group
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.utils.translation import gettext as _
class UserCreationForm(forms.ModelForm):
"""A form for creating new users. Includes all the required
fields, plus a repeated password."""
password1 = forms.CharField(label=_('密码'), widget=forms.PasswordInput)
password2 = forms.CharField(label=_('再次输入密码'), widget=forms.PasswordInput)
password1 = forms.CharField(label='密码', widget=forms.PasswordInput)
password2 = forms.CharField(label='再次输入密码', widget=forms.PasswordInput)
class Meta:
model = models.UserProfile
@ -23,7 +23,7 @@ class UserCreationForm(forms.ModelForm):
password1 = self.cleaned_data.get("password1")
password2 = self.cleaned_data.get("password2")
if password1 and password2 and password1 != password2:
raise forms.ValidationError(_("密码校验失败,两次密码不一致。"))
raise forms.ValidationError("密码校验失败,两次密码不一致。")
return password2
@ -41,7 +41,7 @@ class UserChangeForm(forms.ModelForm):
the user, but replaces the password field with admin's
password hash display field.
"""
password = ReadOnlyPasswordHashField(label=(_("密码Hash值")), help_text=("<a href=\"../password/\">点击修改密码</a>."))
password = ReadOnlyPasswordHashField(label=("密码Hash值"), help_text=("<a href=\"../password/\">点击修改密码</a>."))
class Meta:
model = models.UserProfile
fields = ('username', 'is_active', 'is_admin')
@ -72,7 +72,7 @@ class UserAdmin(BaseUserAdmin):
list_display = ('username', 'rid')
list_filter = ('is_admin', 'is_active')
fieldsets = (
(_('基本信息'), {'fields': ('username', 'password', 'is_active', 'is_admin', 'rid', 'uuid', 'deviceInfo',)}),
('基本信息', {'fields': ('username', 'password', 'is_active', 'is_admin', 'rid', 'uuid', 'deviceInfo',)}),
)
readonly_fields = ( 'rid', 'uuid')
@ -94,8 +94,6 @@ admin.site.register(models.RustDeskTag, models.RustDeskTagAdmin)
admin.site.register(models.RustDeskPeer, models.RustDeskPeerAdmin)
admin.site.register(models.RustDesDevice, models.RustDesDeviceAdmin)
admin.site.register(models.ShareLink, models.ShareLinkAdmin)
admin.site.register(models.ConnLog, models.ConnLogAdmin)
admin.site.register(models.FileLog, models.FileLogAdmin)
admin.site.unregister(Group)
admin.site.site_header = _('RustDesk自建Web')
admin.site.site_title = _('未定义')
admin.site.site_header = 'RustDesk自建Web'
admin.site.site_title = '未定义'

View File

@ -1,78 +0,0 @@
from django.utils.translation import gettext as _
_('管理后台')
_('ID列表')
_('分享机器')
_('这么简易的东西,忘记密码这功能就没必要了吧。')
_('立即注册')
_('创建时间')
_('注册成功,请前往登录页登录。')
_('注册日期')
_('2、所分享的机器被分享人享有相同的权限如果机器设置了保存密码被分享人也可以直接连接。')
_('导出xlsx')
_('生成分享链接')
_('请输入8~20位密码。可以包含字母、数字和特殊字符。')
_('尾页')
_('请确认密码')
_('注册')
_('内存')
_('首页')
_('网页控制')
_('注册时间')
_('链接地址')
_('请输入密码')
_('系统用户名')
_('状态')
_('已有账号?立即登录')
_('密码')
_('别名')
_('上一页')
_('更新时间')
_('综合屏')
_('平台')
_('全部用户')
_('注册页')
_('分享机器给其他用户')
_('所有设备')
_('连接密码')
_('设备统计')
_('所属用户')
_('分享')
_('请输入用户名')
_('1、链接有效期为15分钟切勿随意分享给他人。')
_('CPU')
_('客户端ID')
_('下一页')
_('登录')
_('退出')
_('请将要分享的机器调整到右侧')
_('成功!如需分享,请复制以下链接给其他人:<br>')
_('忘记密码?')
_('计算机名')
_('两次输入密码不一致!')
_('页码')
_('版本')
_('用户名')
_('3、为保障安全链接有效期为15分钟、链接仅有效1次。链接一旦被非分享人的登录用户访问分享生效后续访问链接失效。')
_('系统')
_('我的机器')
_('信息')
_('远程ID')
_('远程别名')
_('用户ID')
_('用户别名')
_('用户IP')
_('文件大小')
_('发送/接受')
_('记录于')
_('连接开始时间')
_('连接结束时间')
_('时长')
_('连接日志')
_('文件传输日志')
_('页码 #')
_('下一页 #')
_('上一页 #')
_('第一页')
_('上页')

View File

@ -1,48 +0,0 @@
# Generated by Django 4.2.7 on 2024-02-21 10:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("api", "0001_initial"),
]
operations = [
migrations.AlterField(
model_name="rustdesdevice",
name="cpu",
field=models.CharField(max_length=100, verbose_name="CPU"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="hostname",
field=models.CharField(max_length=100, verbose_name="主机名"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="memory",
field=models.CharField(max_length=100, verbose_name="内存"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="os",
field=models.CharField(max_length=100, verbose_name="操作系统"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="username",
field=models.CharField(blank=True, max_length=100, verbose_name="系统用户名"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="uuid",
field=models.CharField(max_length=100, verbose_name="uuid"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="version",
field=models.CharField(max_length=100, verbose_name="客户端版本"),
),
]

View File

@ -1,238 +0,0 @@
# Generated by Django 4.2.7 on 2024-03-15 20:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("api", "0002_alter_rustdesdevice_cpu_alter_rustdesdevice_hostname_and_more"),
]
operations = [
migrations.AlterModelOptions(
name="rustdesdevice",
options={
"ordering": ("-rid",),
"verbose_name": "Device",
"verbose_name_plural": "Device List",
},
),
migrations.AlterModelOptions(
name="rustdeskpeer",
options={
"ordering": ("-username",),
"verbose_name": "Peers",
"verbose_name_plural": "Peers List",
},
),
migrations.AlterModelOptions(
name="rustdesktag",
options={
"ordering": ("-uid",),
"verbose_name": "Tags",
"verbose_name_plural": "Tags List",
},
),
migrations.AlterModelOptions(
name="rustdesktoken",
options={
"ordering": ("-username",),
"verbose_name": "Token",
"verbose_name_plural": "Token List",
},
),
migrations.AlterModelOptions(
name="sharelink",
options={
"ordering": ("-create_time",),
"verbose_name": "Share Link",
"verbose_name_plural": "Link List",
},
),
migrations.AlterModelOptions(
name="userprofile",
options={
"permissions": (
("view_task", "Can see available tasks"),
("change_task_status", "Can change the status of tasks"),
("close_task", "Can remove a task by setting its status as closed"),
),
"verbose_name": "User",
"verbose_name_plural": "User List",
},
),
migrations.AlterField(
model_name="rustdesdevice",
name="create_time",
field=models.DateTimeField(
auto_now_add=True, verbose_name="Device Registration Time"
),
),
migrations.AlterField(
model_name="rustdesdevice",
name="hostname",
field=models.CharField(max_length=100, verbose_name="Hostname"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="memory",
field=models.CharField(max_length=100, verbose_name="Memory"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="os",
field=models.CharField(max_length=100, verbose_name="Operating System"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="rid",
field=models.CharField(blank=True, max_length=60, verbose_name="Client ID"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="username",
field=models.CharField(
blank=True, max_length=100, verbose_name="System Username"
),
),
migrations.AlterField(
model_name="rustdesdevice",
name="version",
field=models.CharField(max_length=100, verbose_name="Client Version"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="alias",
field=models.CharField(max_length=30, verbose_name="Alias"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="hostname",
field=models.CharField(max_length=30, verbose_name="Operating System Name"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="platform",
field=models.CharField(max_length=30, verbose_name="Platform"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="rhash",
field=models.CharField(
max_length=60, verbose_name="Device Connection Password"
),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="rid",
field=models.CharField(max_length=60, verbose_name="Client ID"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="tags",
field=models.CharField(max_length=30, verbose_name="Tag"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="uid",
field=models.CharField(max_length=16, verbose_name="User ID"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="username",
field=models.CharField(max_length=20, verbose_name="System Username"),
),
migrations.AlterField(
model_name="rustdesktag",
name="tag_color",
field=models.CharField(blank=True, max_length=60, verbose_name="Tag Color"),
),
migrations.AlterField(
model_name="rustdesktag",
name="tag_name",
field=models.CharField(max_length=60, verbose_name="Tag Name"),
),
migrations.AlterField(
model_name="rustdesktag",
name="uid",
field=models.CharField(max_length=16, verbose_name="Belongs to User ID"),
),
migrations.AlterField(
model_name="rustdesktoken",
name="access_token",
field=models.CharField(
blank=True, max_length=60, verbose_name="Access Token"
),
),
migrations.AlterField(
model_name="rustdesktoken",
name="create_time",
field=models.DateTimeField(auto_now_add=True, verbose_name="Login Time"),
),
migrations.AlterField(
model_name="rustdesktoken",
name="uid",
field=models.CharField(max_length=16, verbose_name="User ID"),
),
migrations.AlterField(
model_name="rustdesktoken",
name="username",
field=models.CharField(max_length=20, verbose_name="Username"),
),
migrations.AlterField(
model_name="rustdesktoken",
name="uuid",
field=models.CharField(max_length=60, verbose_name="UUID"),
),
migrations.AlterField(
model_name="sharelink",
name="create_time",
field=models.DateTimeField(auto_now_add=True, verbose_name="Creation Time"),
),
migrations.AlterField(
model_name="sharelink",
name="is_expired",
field=models.BooleanField(default=False, verbose_name="Is Expired"),
),
migrations.AlterField(
model_name="sharelink",
name="is_used",
field=models.BooleanField(default=False, verbose_name="Is Used"),
),
migrations.AlterField(
model_name="sharelink",
name="peers",
field=models.CharField(max_length=20, verbose_name="Machine ID List"),
),
migrations.AlterField(
model_name="sharelink",
name="shash",
field=models.CharField(max_length=60, verbose_name="Link Key"),
),
migrations.AlterField(
model_name="sharelink",
name="uid",
field=models.CharField(max_length=16, verbose_name="User ID"),
),
migrations.AlterField(
model_name="userprofile",
name="deviceInfo",
field=models.TextField(blank=True, verbose_name="Login Information:"),
),
migrations.AlterField(
model_name="userprofile",
name="is_active",
field=models.BooleanField(default=True, verbose_name="Is Activated"),
),
migrations.AlterField(
model_name="userprofile",
name="is_admin",
field=models.BooleanField(default=False, verbose_name="Is Admin"),
),
migrations.AlterField(
model_name="userprofile",
name="username",
field=models.CharField(max_length=50, unique=True, verbose_name="Username"),
),
]

View File

@ -1,232 +0,0 @@
# Generated by Django 4.2.7 on 2024-03-15 23:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("api", "0003_alter_rustdesdevice_options_and_more"),
]
operations = [
migrations.AlterModelOptions(
name="rustdesdevice",
options={
"ordering": ("-rid",),
"verbose_name": "设备",
"verbose_name_plural": "设备列表",
},
),
migrations.AlterModelOptions(
name="rustdeskpeer",
options={
"ordering": ("-username",),
"verbose_name": "Peers",
"verbose_name_plural": "Peers列表",
},
),
migrations.AlterModelOptions(
name="rustdesktag",
options={
"ordering": ("-uid",),
"verbose_name": "Tags",
"verbose_name_plural": "Tags列表",
},
),
migrations.AlterModelOptions(
name="rustdesktoken",
options={
"ordering": ("-username",),
"verbose_name": "Token",
"verbose_name_plural": "Token列表",
},
),
migrations.AlterModelOptions(
name="sharelink",
options={
"ordering": ("-create_time",),
"verbose_name": "分享链接",
"verbose_name_plural": "链接列表",
},
),
migrations.AlterModelOptions(
name="userprofile",
options={
"permissions": (
("view_task", "Can see available tasks"),
("change_task_status", "Can change the status of tasks"),
("close_task", "Can remove a task by setting its status as closed"),
),
"verbose_name": "用户",
"verbose_name_plural": "用户列表",
},
),
migrations.AlterField(
model_name="rustdesdevice",
name="create_time",
field=models.DateTimeField(auto_now_add=True, verbose_name="设备注册时间"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="hostname",
field=models.CharField(max_length=100, verbose_name="主机名"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="memory",
field=models.CharField(max_length=100, verbose_name="内存"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="os",
field=models.CharField(max_length=100, verbose_name="操作系统"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="rid",
field=models.CharField(blank=True, max_length=60, verbose_name="客户端ID"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="username",
field=models.CharField(blank=True, max_length=100, verbose_name="系统用户名"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="version",
field=models.CharField(max_length=100, verbose_name="客户端版本"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="alias",
field=models.CharField(max_length=30, verbose_name="别名"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="hostname",
field=models.CharField(max_length=30, verbose_name="操作系统名"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="platform",
field=models.CharField(max_length=30, verbose_name="平台"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="rhash",
field=models.CharField(max_length=60, verbose_name="设备链接密码"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="rid",
field=models.CharField(max_length=60, verbose_name="客户端ID"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="tags",
field=models.CharField(max_length=30, verbose_name="标签"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="uid",
field=models.CharField(max_length=16, verbose_name="用户ID"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="username",
field=models.CharField(max_length=20, verbose_name="系统用户名"),
),
migrations.AlterField(
model_name="rustdesktag",
name="tag_color",
field=models.CharField(blank=True, max_length=60, verbose_name="标签颜色"),
),
migrations.AlterField(
model_name="rustdesktag",
name="tag_name",
field=models.CharField(max_length=60, verbose_name="标签名称"),
),
migrations.AlterField(
model_name="rustdesktag",
name="uid",
field=models.CharField(max_length=16, verbose_name="所属用户ID"),
),
migrations.AlterField(
model_name="rustdesktoken",
name="access_token",
field=models.CharField(
blank=True, max_length=60, verbose_name="access_token"
),
),
migrations.AlterField(
model_name="rustdesktoken",
name="create_time",
field=models.DateTimeField(auto_now_add=True, verbose_name="登录时间"),
),
migrations.AlterField(
model_name="rustdesktoken",
name="uid",
field=models.CharField(max_length=16, verbose_name="用户ID"),
),
migrations.AlterField(
model_name="rustdesktoken",
name="username",
field=models.CharField(max_length=20, verbose_name="用户名"),
),
migrations.AlterField(
model_name="rustdesktoken",
name="uuid",
field=models.CharField(max_length=60, verbose_name="uuid"),
),
migrations.AlterField(
model_name="sharelink",
name="create_time",
field=models.DateTimeField(auto_now_add=True, verbose_name="生成时间"),
),
migrations.AlterField(
model_name="sharelink",
name="is_expired",
field=models.BooleanField(default=False, verbose_name="是否过期"),
),
migrations.AlterField(
model_name="sharelink",
name="is_used",
field=models.BooleanField(default=False, verbose_name="是否使用"),
),
migrations.AlterField(
model_name="sharelink",
name="peers",
field=models.CharField(max_length=20, verbose_name="机器ID列表"),
),
migrations.AlterField(
model_name="sharelink",
name="shash",
field=models.CharField(max_length=60, verbose_name="链接Key"),
),
migrations.AlterField(
model_name="sharelink",
name="uid",
field=models.CharField(max_length=16, verbose_name="用户ID"),
),
migrations.AlterField(
model_name="userprofile",
name="deviceInfo",
field=models.TextField(blank=True, verbose_name="登录信息:"),
),
migrations.AlterField(
model_name="userprofile",
name="is_active",
field=models.BooleanField(default=True, verbose_name="是否激活"),
),
migrations.AlterField(
model_name="userprofile",
name="is_admin",
field=models.BooleanField(default=False, verbose_name="是否管理员"),
),
migrations.AlterField(
model_name="userprofile",
name="username",
field=models.CharField(max_length=50, unique=True, verbose_name="用户名"),
),
]

View File

@ -1,41 +0,0 @@
# Generated by Django 5.0.3 on 2024-04-17 08:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0004_alter_rustdesdevice_options_and_more'),
]
operations = [
migrations.CreateModel(
name='ConnLog',
fields=[
('id', models.IntegerField(primary_key=True, serialize=False, verbose_name='ID')),
('action', models.CharField(max_length=20, null=True, verbose_name='Action')),
('conn_id', models.CharField(max_length=10, null=True, verbose_name='Connection ID')),
('from_ip', models.CharField(max_length=30, null=True, verbose_name='From IP')),
('from_id', models.CharField(max_length=20, null=True, verbose_name='From ID')),
('rid', models.CharField(max_length=20, null=True, verbose_name='To ID')),
('conn_start', models.DateTimeField(null=True, verbose_name='Connected')),
('conn_end', models.DateTimeField(null=True, verbose_name='Disconnected')),
('session_id', models.CharField(max_length=60, null=True, verbose_name='Session ID')),
('uuid', models.CharField(max_length=60, null=True, verbose_name='uuid')),
],
),
migrations.CreateModel(
name='FileLog',
fields=[
('id', models.IntegerField(primary_key=True, serialize=False, verbose_name='ID')),
('file', models.CharField(max_length=500, verbose_name='Path')),
('remote_id', models.CharField(default='0', max_length=20, verbose_name='Remote ID')),
('user_id', models.CharField(default='0', max_length=20, verbose_name='User ID')),
('user_ip', models.CharField(default='0', max_length=20, verbose_name='User IP')),
('filesize', models.CharField(default='', max_length=500, verbose_name='Filesize')),
('direction', models.IntegerField(default=0, verbose_name='Direction')),
('logged_at', models.DateTimeField(null=True, verbose_name='Logged At')),
],
),
]

View File

@ -1,240 +0,0 @@
# Generated by Django 4.2.7 on 2024-05-14 10:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("api", "0005_connlog_filelog"),
]
operations = [
migrations.AlterModelOptions(
name="rustdesdevice",
options={
"ordering": ("-rid",),
"verbose_name": "Device",
"verbose_name_plural": "Device List",
},
),
migrations.AlterModelOptions(
name="rustdeskpeer",
options={
"ordering": ("-username",),
"verbose_name": "Peers",
"verbose_name_plural": "Peers List",
},
),
migrations.AlterModelOptions(
name="rustdesktag",
options={
"ordering": ("-uid",),
"verbose_name": "Tags",
"verbose_name_plural": "Tags List",
},
),
migrations.AlterModelOptions(
name="rustdesktoken",
options={
"ordering": ("-username",),
"verbose_name": "Token",
"verbose_name_plural": "Token List",
},
),
migrations.AlterModelOptions(
name="sharelink",
options={
"ordering": ("-create_time",),
"verbose_name": "Share Link",
"verbose_name_plural": "Link List",
},
),
migrations.AlterModelOptions(
name="userprofile",
options={
"permissions": (
("view_task", "Can see available tasks"),
("change_task_status", "Can change the status of tasks"),
("close_task", "Can remove a task by setting its status as closed"),
),
"verbose_name": "User",
"verbose_name_plural": "User List",
},
),
migrations.AlterField(
model_name="rustdesdevice",
name="create_time",
field=models.DateTimeField(
auto_now_add=True, verbose_name="Device Registration Time"
),
),
migrations.AlterField(
model_name="rustdesdevice",
name="hostname",
field=models.CharField(max_length=100, verbose_name="Hostname"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="memory",
field=models.CharField(max_length=100, verbose_name="Memory"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="os",
field=models.CharField(max_length=100, verbose_name="Operating System"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="rid",
field=models.CharField(blank=True, max_length=60, verbose_name="Client ID"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="username",
field=models.CharField(
blank=True, max_length=100, verbose_name="System Username"
),
),
migrations.AlterField(
model_name="rustdesdevice",
name="version",
field=models.CharField(max_length=100, verbose_name="Client Version"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="alias",
field=models.CharField(max_length=30, verbose_name="Alias"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="hostname",
field=models.CharField(max_length=30, verbose_name="Operating System Name"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="platform",
field=models.CharField(max_length=30, verbose_name="Platform"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="rhash",
field=models.CharField(
max_length=60, verbose_name="Device Connection Password"
),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="rid",
field=models.CharField(max_length=60, verbose_name="Client ID"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="tags",
field=models.CharField(max_length=30, verbose_name="Tag"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="uid",
field=models.CharField(max_length=16, verbose_name="User ID"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="username",
field=models.CharField(max_length=20, verbose_name="System Username"),
),
migrations.AlterField(
model_name="rustdesktag",
name="tag_color",
field=models.CharField(blank=True, max_length=60, verbose_name="Tag Color"),
),
migrations.AlterField(
model_name="rustdesktag",
name="tag_name",
field=models.CharField(max_length=60, verbose_name="Tag Name"),
),
migrations.AlterField(
model_name="rustdesktag",
name="uid",
field=models.CharField(max_length=16, verbose_name="Belongs to User ID"),
),
migrations.AlterField(
model_name="rustdesktoken",
name="access_token",
field=models.CharField(
blank=True, max_length=60, verbose_name="Access Token"
),
),
migrations.AlterField(
model_name="rustdesktoken",
name="create_time",
field=models.DateTimeField(auto_now_add=True, verbose_name="Login Time"),
),
migrations.AlterField(
model_name="rustdesktoken",
name="uid",
field=models.CharField(max_length=16, verbose_name="User ID"),
),
migrations.AlterField(
model_name="rustdesktoken",
name="username",
field=models.CharField(max_length=20, verbose_name="Username"),
),
migrations.AlterField(
model_name="rustdesktoken",
name="uuid",
field=models.CharField(max_length=60, verbose_name="UUID"),
),
migrations.AlterField(
model_name="sharelink",
name="create_time",
field=models.DateTimeField(
auto_now_add=True, verbose_name="Generation Time"
),
),
migrations.AlterField(
model_name="sharelink",
name="is_expired",
field=models.BooleanField(default=False, verbose_name="Is Expired"),
),
migrations.AlterField(
model_name="sharelink",
name="is_used",
field=models.BooleanField(default=False, verbose_name="Is Used"),
),
migrations.AlterField(
model_name="sharelink",
name="peers",
field=models.CharField(max_length=20, verbose_name="Machine ID List"),
),
migrations.AlterField(
model_name="sharelink",
name="shash",
field=models.CharField(max_length=60, verbose_name="Link Key"),
),
migrations.AlterField(
model_name="sharelink",
name="uid",
field=models.CharField(max_length=16, verbose_name="User ID"),
),
migrations.AlterField(
model_name="userprofile",
name="deviceInfo",
field=models.TextField(blank=True, verbose_name="Login Information:"),
),
migrations.AlterField(
model_name="userprofile",
name="is_active",
field=models.BooleanField(default=True, verbose_name="Is Active"),
),
migrations.AlterField(
model_name="userprofile",
name="is_admin",
field=models.BooleanField(default=False, verbose_name="Is Administrator"),
),
migrations.AlterField(
model_name="userprofile",
name="username",
field=models.CharField(max_length=50, unique=True, verbose_name="Username"),
),
]

View File

@ -1,232 +0,0 @@
# Generated by Django 4.2.7 on 2024-05-14 10:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("api", "0006_alter_rustdesdevice_options_and_more"),
]
operations = [
migrations.AlterModelOptions(
name="rustdesdevice",
options={
"ordering": ("-rid",),
"verbose_name": "设备",
"verbose_name_plural": "设备列表",
},
),
migrations.AlterModelOptions(
name="rustdeskpeer",
options={
"ordering": ("-username",),
"verbose_name": "Peers",
"verbose_name_plural": "Peers列表",
},
),
migrations.AlterModelOptions(
name="rustdesktag",
options={
"ordering": ("-uid",),
"verbose_name": "Tags",
"verbose_name_plural": "Tags列表",
},
),
migrations.AlterModelOptions(
name="rustdesktoken",
options={
"ordering": ("-username",),
"verbose_name": "Token",
"verbose_name_plural": "Token列表",
},
),
migrations.AlterModelOptions(
name="sharelink",
options={
"ordering": ("-create_time",),
"verbose_name": "分享链接",
"verbose_name_plural": "链接列表",
},
),
migrations.AlterModelOptions(
name="userprofile",
options={
"permissions": (
("view_task", "Can see available tasks"),
("change_task_status", "Can change the status of tasks"),
("close_task", "Can remove a task by setting its status as closed"),
),
"verbose_name": "用户",
"verbose_name_plural": "用户列表",
},
),
migrations.AlterField(
model_name="rustdesdevice",
name="create_time",
field=models.DateTimeField(auto_now_add=True, verbose_name="设备注册时间"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="hostname",
field=models.CharField(max_length=100, verbose_name="主机名"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="memory",
field=models.CharField(max_length=100, verbose_name="内存"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="os",
field=models.CharField(max_length=100, verbose_name="操作系统"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="rid",
field=models.CharField(blank=True, max_length=60, verbose_name="客户端ID"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="username",
field=models.CharField(blank=True, max_length=100, verbose_name="系统用户名"),
),
migrations.AlterField(
model_name="rustdesdevice",
name="version",
field=models.CharField(max_length=100, verbose_name="客户端版本"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="alias",
field=models.CharField(max_length=30, verbose_name="别名"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="hostname",
field=models.CharField(max_length=30, verbose_name="操作系统名"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="platform",
field=models.CharField(max_length=30, verbose_name="平台"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="rhash",
field=models.CharField(max_length=60, verbose_name="设备链接密码"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="rid",
field=models.CharField(max_length=60, verbose_name="客户端ID"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="tags",
field=models.CharField(max_length=30, verbose_name="标签"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="uid",
field=models.CharField(max_length=16, verbose_name="用户ID"),
),
migrations.AlterField(
model_name="rustdeskpeer",
name="username",
field=models.CharField(max_length=20, verbose_name="系统用户名"),
),
migrations.AlterField(
model_name="rustdesktag",
name="tag_color",
field=models.CharField(blank=True, max_length=60, verbose_name="标签颜色"),
),
migrations.AlterField(
model_name="rustdesktag",
name="tag_name",
field=models.CharField(max_length=60, verbose_name="标签名称"),
),
migrations.AlterField(
model_name="rustdesktag",
name="uid",
field=models.CharField(max_length=16, verbose_name="所属用户ID"),
),
migrations.AlterField(
model_name="rustdesktoken",
name="access_token",
field=models.CharField(
blank=True, max_length=60, verbose_name="access_token"
),
),
migrations.AlterField(
model_name="rustdesktoken",
name="create_time",
field=models.DateTimeField(auto_now_add=True, verbose_name="登录时间"),
),
migrations.AlterField(
model_name="rustdesktoken",
name="uid",
field=models.CharField(max_length=16, verbose_name="用户ID"),
),
migrations.AlterField(
model_name="rustdesktoken",
name="username",
field=models.CharField(max_length=20, verbose_name="用户名"),
),
migrations.AlterField(
model_name="rustdesktoken",
name="uuid",
field=models.CharField(max_length=60, verbose_name="uuid"),
),
migrations.AlterField(
model_name="sharelink",
name="create_time",
field=models.DateTimeField(auto_now_add=True, verbose_name="生成时间"),
),
migrations.AlterField(
model_name="sharelink",
name="is_expired",
field=models.BooleanField(default=False, verbose_name="是否过期"),
),
migrations.AlterField(
model_name="sharelink",
name="is_used",
field=models.BooleanField(default=False, verbose_name="是否使用"),
),
migrations.AlterField(
model_name="sharelink",
name="peers",
field=models.CharField(max_length=20, verbose_name="机器ID列表"),
),
migrations.AlterField(
model_name="sharelink",
name="shash",
field=models.CharField(max_length=60, verbose_name="链接Key"),
),
migrations.AlterField(
model_name="sharelink",
name="uid",
field=models.CharField(max_length=16, verbose_name="用户ID"),
),
migrations.AlterField(
model_name="userprofile",
name="deviceInfo",
field=models.TextField(blank=True, verbose_name="登录信息:"),
),
migrations.AlterField(
model_name="userprofile",
name="is_active",
field=models.BooleanField(default=True, verbose_name="是否激活"),
),
migrations.AlterField(
model_name="userprofile",
name="is_admin",
field=models.BooleanField(default=False, verbose_name="是否管理员"),
),
migrations.AlterField(
model_name="userprofile",
name="username",
field=models.CharField(max_length=50, unique=True, verbose_name="用户名"),
),
]

View File

@ -1,18 +0,0 @@
# Generated by Django 3.2 on 2024-09-09 10:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0007_alter_rustdesdevice_options_and_more'),
]
operations = [
migrations.AddField(
model_name='rustdesdevice',
name='ip_address',
field=models.CharField(blank=True, max_length=60, verbose_name='IP'),
),
]

View File

@ -4,7 +4,7 @@ from django.contrib.auth.models import (
BaseUserManager,AbstractBaseUser,PermissionsMixin
)
from .models_work import *
from django.utils.translation import gettext as _
class MyUserManager(BaseUserManager):
def create_user(self, username, password=None):
@ -29,7 +29,7 @@ class MyUserManager(BaseUserManager):
class UserProfile(AbstractBaseUser, PermissionsMixin):
username = models.CharField(_('用户名'),
username = models.CharField('用户名',
unique=True,
max_length=50)
@ -37,10 +37,10 @@ class UserProfile(AbstractBaseUser, PermissionsMixin):
uuid = models.CharField(verbose_name='uuid', max_length=60)
autoLogin = models.BooleanField(verbose_name='autoLogin', default=True)
rtype = models.CharField(verbose_name='rtype', max_length=20)
deviceInfo = models.TextField(verbose_name=_('登录信息:'), blank=True)
deviceInfo = models.TextField(verbose_name='登录信息:', blank=True)
is_active = models.BooleanField(verbose_name=_('是否激活'), default=True)
is_admin = models.BooleanField(verbose_name=_('是否管理员'), default=False)
is_active = models.BooleanField(verbose_name='是否激活', default=True)
is_admin = models.BooleanField(verbose_name='是否管理员', default=False)
objects = MyUserManager()
@ -79,8 +79,8 @@ class UserProfile(AbstractBaseUser, PermissionsMixin):
class Meta:
verbose_name = _("用户")
verbose_name_plural = _("用户列表")
verbose_name = "用户"
verbose_name_plural = "用户列表"
permissions = (
("view_task", "Can see available tasks"),
("change_task_status", "Can change the status of tasks"),

View File

@ -1,153 +1,114 @@
# cython:language_level=3
from django.db import models
from django.contrib import admin
from django.utils.translation import gettext as _
class RustDeskToken(models.Model):
''' Token
'''
username = models.CharField(verbose_name=_('用户名'), max_length=20)
rid = models.CharField(verbose_name=_('RustDesk ID'), max_length=16)
uid = models.CharField(verbose_name=_('用户ID'), max_length=16)
uuid = models.CharField(verbose_name=_('uuid'), max_length=60)
access_token = models.CharField(verbose_name=_('access_token'), max_length=60, blank=True)
create_time = models.DateTimeField(verbose_name=_('登录时间'), auto_now_add=True)
# expire_time = models.DateTimeField(verbose_name='过期时间')
username = models.CharField(verbose_name='用户名', max_length=20)
rid = models.CharField(verbose_name='RustDesk ID', max_length=16)
uid = models.CharField(verbose_name='用户ID', max_length=16)
uuid = models.CharField(verbose_name='uuid', max_length=60)
access_token = models.CharField(verbose_name='access_token', max_length=60, blank=True)
create_time = models.DateTimeField(verbose_name='登录时间', auto_now_add=True)
#expire_time = models.DateTimeField(verbose_name='过期时间')
class Meta:
ordering = ('-username',)
verbose_name = "Token"
verbose_name_plural = _("Token列表")
verbose_name_plural = "Token列表"
class RustDeskTokenAdmin(admin.ModelAdmin):
list_display = ('username', 'uid')
search_fields = ('username', 'uid')
list_filter = ('create_time', ) # 过滤器
list_filter = ('create_time', ) #过滤器
class RustDeskTag(models.Model):
''' Tags
'''
uid = models.CharField(verbose_name=_('所属用户ID'), max_length=16)
tag_name = models.CharField(verbose_name=_('标签名称'), max_length=60)
tag_color = models.CharField(verbose_name=_('标签颜色'), max_length=60, blank=True)
uid = models.CharField(verbose_name='所属用户ID', max_length=16)
tag_name = models.CharField(verbose_name='标签名称', max_length=60)
tag_color = models.CharField(verbose_name='标签颜色', max_length=60, blank=True)
class Meta:
ordering = ('-uid',)
verbose_name = "Tags"
verbose_name_plural = _("Tags列表")
verbose_name_plural = "Tags列表"
class RustDeskTagAdmin(admin.ModelAdmin):
list_display = ('tag_name', 'uid', 'tag_color')
search_fields = ('tag_name', 'uid')
list_filter = ('uid', )
class RustDeskPeer(models.Model):
''' Pees
'''
uid = models.CharField(verbose_name=_('用户ID'), max_length=16)
rid = models.CharField(verbose_name=_('客户端ID'), max_length=60)
username = models.CharField(verbose_name=_('系统用户名'), max_length=20)
hostname = models.CharField(verbose_name=_('操作系统名'), max_length=30)
alias = models.CharField(verbose_name=_('别名'), max_length=30)
platform = models.CharField(verbose_name=_('平台'), max_length=30)
tags = models.CharField(verbose_name=_('标签'), max_length=30)
rhash = models.CharField(verbose_name=_('设备链接密码'), max_length=60)
uid = models.CharField(verbose_name='用户ID', max_length=16)
rid = models.CharField(verbose_name='客户端ID', max_length=60)
username = models.CharField(verbose_name='系统用户名', max_length=20)
hostname = models.CharField(verbose_name='操作系统名', max_length=30)
alias = models.CharField(verbose_name='别名', max_length=30)
platform = models.CharField(verbose_name='平台', max_length=30)
tags = models.CharField(verbose_name='标签', max_length=30)
rhash = models.CharField(verbose_name='设备链接密码', max_length=60)
class Meta:
ordering = ('-username',)
verbose_name = "Peers"
verbose_name_plural = _("Peers列表")
verbose_name_plural = "Peers列表"
class RustDeskPeerAdmin(admin.ModelAdmin):
list_display = ('rid', 'uid', 'username', 'hostname', 'platform', 'alias', 'tags')
search_fields = ('deviceid', 'alias')
list_filter = ('rid', 'uid', )
class RustDesDevice(models.Model):
rid = models.CharField(verbose_name=_('客户端ID'), max_length=60, blank=True)
cpu = models.CharField(verbose_name='CPU', max_length=100)
hostname = models.CharField(verbose_name=_('主机名'), max_length=100)
memory = models.CharField(verbose_name=_('内存'), max_length=100)
os = models.CharField(verbose_name=_('操作系统'), max_length=100)
uuid = models.CharField(verbose_name='uuid', max_length=100)
username = models.CharField(verbose_name=_('系统用户名'), max_length=100, blank=True)
version = models.CharField(verbose_name=_('客户端版本'), max_length=100)
ip_address = models.CharField(verbose_name=_('IP'), max_length=60, blank=True)
create_time = models.DateTimeField(verbose_name=_('设备注册时间'), auto_now_add=True)
update_time = models.DateTimeField(verbose_name=('设备更新时间'), auto_now=True, blank=True)
rid = models.CharField(verbose_name='客户端ID', max_length=60, blank=True)
cpu = models.CharField(verbose_name='CPU', max_length=20)
hostname = models.CharField(verbose_name='主机名', max_length=20)
memory = models.CharField(verbose_name='内存', max_length=20)
os = models.CharField(verbose_name='操作系统', max_length=20)
uuid = models.CharField(verbose_name='uuid', max_length=60)
username = models.CharField(verbose_name='系统用户名', max_length=60, blank=True)
version = models.CharField(verbose_name='客户端版本', max_length=20)
create_time = models.DateTimeField(verbose_name='设备注册时间', auto_now_add=True)
update_time = models.DateTimeField(verbose_name='设备更新时间', auto_now=True, blank=True)
class Meta:
ordering = ('-rid',)
verbose_name = _("设备")
verbose_name_plural = _("设备列表")
verbose_name = "设备"
verbose_name_plural = "设备列表"
class RustDesDeviceAdmin(admin.ModelAdmin):
list_display = ('rid', 'hostname', 'memory', 'uuid', 'version', 'create_time', 'update_time')
search_fields = ('hostname', 'memory')
list_filter = ('rid', )
class ConnLog(models.Model):
id = models.IntegerField(verbose_name='ID', primary_key=True)
action = models.CharField(verbose_name='Action', max_length=20, null=True)
conn_id = models.CharField(verbose_name='Connection ID', max_length=10, null=True)
from_ip = models.CharField(verbose_name='From IP', max_length=30, null=True)
from_id = models.CharField(verbose_name='From ID', max_length=20, null=True)
rid = models.CharField(verbose_name='To ID', max_length=20, null=True)
conn_start = models.DateTimeField(verbose_name='Connected', null=True)
conn_end = models.DateTimeField(verbose_name='Disconnected', null=True)
session_id = models.CharField(verbose_name='Session ID', max_length=60, null=True)
uuid = models.CharField(verbose_name='uuid', max_length=60, null=True)
class ConnLogAdmin(admin.ModelAdmin):
list_display = ('id', 'action', 'conn_id', 'from_ip', 'from_id', 'rid', 'conn_start', 'conn_end', 'session_id', 'uuid')
search_fields = ('from_ip', 'rid')
list_filter = ('id', 'from_ip', 'from_id', 'rid', 'conn_start', 'conn_end')
class FileLog(models.Model):
id = models.IntegerField(verbose_name='ID', primary_key=True)
file = models.CharField(verbose_name='Path', max_length=500)
remote_id = models.CharField(verbose_name='Remote ID', max_length=20, default='0')
user_id = models.CharField(verbose_name='User ID', max_length=20, default='0')
user_ip = models.CharField(verbose_name='User IP', max_length=20, default='0')
filesize = models.CharField(verbose_name='Filesize', max_length=500, default='')
direction = models.IntegerField(verbose_name='Direction', default=0)
logged_at = models.DateTimeField(verbose_name='Logged At', null=True)
class FileLogAdmin(admin.ModelAdmin):
list_display = ('id', 'file', 'remote_id', 'user_id', 'user_ip', 'filesize', 'direction', 'logged_at')
search_fields = ('file', 'remote_id', 'user_id', 'user_ip')
list_filter = ('id', 'file', 'remote_id', 'user_id', 'user_ip', 'filesize', 'direction', 'logged_at')
class ShareLink(models.Model):
''' 分享链接
'''
uid = models.CharField(verbose_name=_('用户ID'), max_length=16)
shash = models.CharField(verbose_name=_('链接Key'), max_length=60)
peers = models.CharField(verbose_name=_('机器ID列表'), max_length=20)
is_used = models.BooleanField(verbose_name=_('是否使用'), default=False)
is_expired = models.BooleanField(verbose_name=_('是否过期'), default=False)
create_time = models.DateTimeField(verbose_name=_('生成时间'), auto_now_add=True)
uid = models.CharField(verbose_name='用户ID', max_length=16)
shash = models.CharField(verbose_name='链接Key', max_length=60)
peers = models.CharField(verbose_name='机器ID列表', max_length=20)
is_used = models.BooleanField(verbose_name='是否使用', default=False)
is_expired = models.BooleanField(verbose_name='是否过期', default=False)
create_time = models.DateTimeField(verbose_name='生成时间', auto_now_add=True)
class Meta:
ordering = ('-create_time',)
verbose_name = _("分享链接")
verbose_name_plural = _("链接列表")
verbose_name = "分享链接"
verbose_name_plural = "链接列表"
class ShareLinkAdmin(admin.ModelAdmin):
list_display = ('shash', 'uid', 'peers', 'is_used', 'is_expired', 'create_time')
search_fields = ('peers', )
list_filter = ('is_used', 'uid', 'is_expired')
list_filter = ('is_used', 'uid', 'is_expired' )

View File

@ -1,5 +1,4 @@
{% load static %}
{% load i18n %}
<!DOCTYPE html>
<html>
@ -28,25 +27,15 @@
</script>
<ul class="layui-nav">
<li class="layui-nav-item"><a href="/">{% trans "首页" %}</a></li>
{% if u.is_admin %}
<li class="layui-nav-item"><a href="/api/work?show_type=admin">{% trans "所有设备" %}</a>
</li>
{% endif %}
<li class="layui-nav-item"><a href="/api/share">{% trans "分享" %}</a></li>
<li class="layui-nav-item"><a href="/webui" target="_blank">{% trans "网页控制" %}</a></li>
<li class="layui-nav-item"><a href="/">首页</a></li>
<li class="layui-nav-item"><a href="/api/share">分享</a></li>
<li class="layui-nav-item"><a href="/webui" target="_blank">网页控制</a></li>
{% if u.is_admin %}
<li class="layui-nav-item">
<a href="">{% trans "日志" %}</a>
<dl class="layui-nav-child">
<dd><a href="/api/conn_log">{% trans "连接日志" %}</a></dd>
<dd><a href="/api/file_log">{% trans "文件传输日志" %}</a></dd>
</dl>
<li class="layui-nav-item"><a href="/admin" target="_blank">管理后台</a>
</li>
<li class="layui-nav-item"><a href="/admin" target="_blank">{% trans "管理后台" %}</a></li>
{% endif %}
<li class="layui-nav-item"><a href="/api/user_action?action=logout" target="_blank">{% trans "退出" %}</a></li>
<li class="layui-nav-item"><a href="/api/user_action?action=logout" target="_blank">退出</a></li>
</ul>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">

View File

@ -1,11 +1,10 @@
{% load static %}
{% load my_filters %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{{ "登录" | translate }}_RustDeskWeb</title>
<title>登录_RustDeskWeb</title>
<link rel="stylesheet" href="{% static 'layui/css/layui.css' %}">
<link rel="stylesheet" href="{% static 'layui/css/style.css' %}">
@ -14,21 +13,21 @@
<body>
<div class="login-main">
<header class="layui-elip">{{ "登录" | translate }}</header>
<header class="layui-elip">登录</header>
<form class="layui-form">
<div class="layui-input-inline">
<input type="text" name="account" required lay-verify="required" placeholder="{{ "用户名" | translate }}" autocomplete="off"
<input type="text" name="account" required lay-verify="required" placeholder="用户名" autocomplete="off"
class="layui-input">
</div>
<div class="layui-input-inline">
<input type="password" name="password" required lay-verify="required" placeholder="{{ "密码" | translate }}" autocomplete="off"
<input type="password" name="password" required lay-verify="required" placeholder="密码" autocomplete="off"
class="layui-input">
</div>
<div class="layui-input-inline login-btn">
<button lay-submit lay-filter="login" class="layui-btn">{{ "登录" | translate }}</button>
<button lay-submit lay-filter="login" class="layui-btn">登录</button>
</div>
<hr/>
<p><a href="/api/user_action?action=register" class="fl">{{ "立即注册" | translate }}</a><a href="javascript:;" class="fr">{{ "忘记密码?" | translate }}</a></p>
<p><a href="/api/user_action?action=register" class="fl">立即注册</a><a href="javascript:;" class="fr">忘记密码</a></p>
</form>
</div>
@ -60,7 +59,7 @@
return false;
})
$('.fr').on('click', function(){
layer.alert("{{ "这么简易的东西忘记密码这功能就没必要了吧" | translate }}",{icon:5});
layer.alert("这么简易的东西,忘记密码这功能就没必要了吧。",{icon:5});
})

View File

@ -1,7 +1,6 @@
{% extends "base.html" %}
{% load my_filters %}
{% block title %}{{title}}{% endblock %}
{% block legend_name %}{{ "信息" | translate }}{% endblock %}
{% block legend_name %}信息{% endblock %}
{% block content %}
<div style="padding: 20px; background-color: #F2F2F2;">
<div class="layui-row layui-col-space15">

View File

@ -1,5 +1,4 @@
{% load static %}
{% load my_filters %}
<!DOCTYPE html>
<html lang="en">
<head>
@ -7,7 +6,7 @@
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>{{ "注册" | translate }}_RustDeskWeb</title>
<title>注册_RustDeskWeb</title>
<link rel="stylesheet" href="{% static 'layui/css/layui.css' %}">
<link rel="stylesheet" href="{% static 'layui/css/style.css' %}">
<link rel="icon" href="../frame/static/image/code.png">
@ -15,14 +14,14 @@
<body>
<div class="login-main">
<header class="layui-elip" style="width: 82%">{{ "注册页" | translate }}</header>
<header class="layui-elip" style="width: 82%">注册页</header>
<!-- 表单选项 -->
<form class="layui-form">
<div class="layui-input-inline">
<!-- 用户名 -->
<div class="layui-inline" style="width: 85%">
<input type="text" id="user" name="account" required lay-verify="required" placeholder="{{ "请输入用户名" | translate }}" autocomplete="off" class="layui-input">
<input type="text" id="user" name="account" required lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
</div>
<!-- 对号 -->
<div class="layui-inline">
@ -36,7 +35,7 @@
<!-- 密码 -->
<div class="layui-input-inline">
<div class="layui-inline" style="width: 85%">
<input type="password" id="pwd" name="password" required lay-verify="required" placeholder="{{ "请输入密码" | translate }}" autocomplete="off" class="layui-input">
<input type="password" id="pwd" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
</div>
<!-- 对号 -->
<div class="layui-inline">
@ -50,7 +49,7 @@
<!-- 确认密码 -->
<div class="layui-input-inline">
<div class="layui-inline" style="width: 85%">
<input type="password" id="rpwd" name="repassword" required lay-verify="required" placeholder="{{ "请确认密码" | translate }}" autocomplete="off" class="layui-input">
<input type="password" id="rpwd" name="repassword" required lay-verify="required" placeholder="请确认密码" autocomplete="off" class="layui-input">
</div>
<!-- 对号 -->
<div class="layui-inline">
@ -64,10 +63,10 @@
<div class="layui-input-inline login-btn" style="width: 85%">
<button type="submit" lay-submit lay-filter="sub" class="layui-btn">{{ "注册" | translate }}</button>
<button type="submit" lay-submit lay-filter="sub" class="layui-btn">注册</button>
</div>
<hr style="width: 85%" />
<p style="width: 85%"><a href="/api/user_action?action=login" class="fl">{{ "已有账号?立即登录" | translate }}</a></p>
<p style="width: 85%"><a href="/api/user_action?action=login" class="fl">已有账号立即登录</a></p>
</form>
</div>
@ -95,7 +94,7 @@
//layer.msg('请输入合法密码');
$('#pwr').removeAttr('hidden');
$('#pri').attr('hidden','hidden');
layer.msg('{{ "请输入8~20位密码。可以包含字母、数字和特殊字符。" | translate }}');
layer.msg('请输入8~20位密码。可以包含字母、数字和特殊字符。');
}else {
$('#pri').removeAttr('hidden');
$('#pwr').attr('hidden','hidden');
@ -107,7 +106,7 @@
if($('#pwd').val() != $('#rpwd').val()){
$('#rpwr').removeAttr('hidden');
$('#rpri').attr('hidden','hidden');
layer.msg('{{ "两次输入密码不一致!" | translate }}');
layer.msg('两次输入密码不一致!');
}else {
$('#rpri').removeAttr('hidden');
$('#rpwr').attr('hidden','hidden');
@ -127,7 +126,7 @@
},
success:function(data){
if (data.code == 1) {
layer.msg('{{ "注册成功,请前往登录页登录。" | translate }}');
layer.msg('注册成功,请前往登录页登录。');
///location.href = "login.html";
}else {
layer.msg(data.msg);

View File

@ -1,21 +1,20 @@
{% extends "base.html" %}{% load static %}
{% load my_filters %}
{% block title %}{{ "分享机器" | translate }}{% endblock %}
{% block title %}分享机器{% endblock %}
{% block link %}<link rel="stylesheet" href="{% static 'layui/css/style.css' %}">{% endblock %}
{% block legend_name %}{{ "分享机器给其他用户" | translate }}{% endblock %}
{% block legend_name %}分享机器给其他用户{% endblock %}
{% block content %}
<div class="layui-container">
<div class="layui-card layui-col-md3-offset2">
<div class="layui-card-header">{{ "请将要分享的机器调整到右侧" | translate }}</div>
<div class="layui-card-header">请将要分享的机器调整到右侧</div>
<div id="showdevice"></div>
<button id="create" type="button" class="layui-btn padding-5" lay-on="getData">{{ "生成分享链接" | translate }}</button>
<button id="create" type="button" class="layui-btn padding-5" lay-on="getData">生成分享链接</button>
</div>
<div class="layui-card">{{ "1、链接有效期为15分钟切勿随意分享给他人。" | translate }}</div>
<div class="layui-card">{{ "2、所分享的机器被分享人享有相同的权限如果机器设置了保存密码被分享人也可以直接连接。" | translate }}</div>
<div class="layui-card">{{ "3、为保障安全链接有效期为15分钟、链接仅有效1次。链接一旦被非分享人的登录用户访问分享生效后续访问链接失效。" | translate }}</div>
<div class="layui-card">1链接有效期为15分钟切勿随意分享给他人</div>
<div class="layui-card">2所分享的机器被分享人享有相同的权限如果机器设置了保存密码被分享人也可以直接连接</div>
<div class="layui-card">3为保障安全链接有效期为15分钟链接仅有效1次链接一旦被非分享人的登录用户访问分享生效后续访问链接失效</div>
<div class="layui-card layui-col-md6-offset1">
<table class="layui-table">
@ -27,16 +26,16 @@
</colgroup>
<thead>
<tr>
<th>{{ "链接地址" | translate }}</th>
<th>{{ "创建时间" | translate }}</th>
<th>{{ "ID列表" | translate }}</th>
<th>链接地址</th>
<th>创建时间</th>
<th>ID列表</th>
</tr>
</thead>
<tbody>
{% for one in sharelinks %}
<tr>
<td><script> document.write(window.location);</script>/{{one.shash}} </td>
<td><script> document.write(window.location);</script>{{one.shash}} </td>
<td>{{one.create_time}} </td>
<td>{{one.peers}} </td>
@ -58,7 +57,7 @@
//渲染
transfer.render({
elem: '#showdevice' //绑定元素
,title: ['{{ "我的机器" | translate }}', '{{ "分享机器" | translate }}'] //自定义标题
,title: ['我的机器', '分享机器'] //自定义标题
//,width: 500 //定义宽度
//,height: 300 //定义高度
,data: [//定义数据源
@ -91,7 +90,7 @@
// time:false //取消自动关闭
// });
//layer.msg('注册成功,请前往登录页登录。');
layer.alert('{{ "成功!如需分享,请复制以下链接给其他人:<br>" | translate }}'+ window.location + '/' +data.shash, function (index) {
layer.alert('成功!如需分享,请复制以下链接给其他人:<br>'+ window.location + '/' +data.shash, function (index) {
location.reload();});
}else {
layer.msg(data.msg);

View File

@ -1,62 +0,0 @@
{% extends "base.html" %}
{% load my_filters %}
{% block title %}RustDesk WebUI{% endblock %}
{% block content %}
<div style="padding: 20px; background-color: #F2F2F2;">
<div class="layui-row layui-col-space15">
<div class="layui-col-md15">
<div class="layui-card">
<div class="layui-card-header">{{ "连接日志" | translate }}:{{u.username}}</div>
<div class="layui-card-body">
<table class="layui-table">
<thead>
<tr>
<th>{{ "用户IP" | translate }}</th>
<th>{{ "用户ID" | translate }}</th>
<th>{{ "用户别名" | translate }}</th>
<th>{{ "远程ID" | translate }}</th>
<th>{{ "远程别名" | translate }}</th>
<th>{{ "连接开始时间" | translate }}</th>
<th>{{ "连接结束时间" | translate }}</th>
<th>{{ "时长" | translate }}(HH:MM:SS)</th>
</tr>
</thead>
<tbody>
{% for one in page_obj %}
<tr>
<td>{{one.from_ip}} </td>
<td>{{one.from_id}}</td>
<td>{{one.from_alias}}</td>
<td>{{one.rid}}</td>
<td>{{one.alias}}</td>
<td>{{one.conn_start}}</td>
<td>{{one.conn_end}}</td>
<td>{{one.duration}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
<div class="layui-col-md4 layui-col-md-offset4">
<span class="step-links">
{% if page_obj.has_previous %}
<button class="layui-btn" ><a href="?page=1">&laquo; {{ "First" | translate }}</a></button>
<button class="layui-btn" ><a href="?page={{ page_obj.previous_page_number }}">{{ "Previous" | translate }}</a></button>
{% endif %}
{% if page_obj.paginator.num_pages > 1 %}
<span class="current">
{{ "页码 #" | translate }} {{ page_obj.number }} / {{ page_obj.paginator.num_pages }}
</span>
{% endif %}
{% if page_obj.has_next %}
<button class="layui-btn" > <a href="?page={{ page_obj.next_page_number }}">{{ "Next" | translate }}</a></button>
<button class="layui-btn" ><a href="?page={{ page_obj.paginator.num_pages }}">{{ "Last" | translate }} &raquo;</a></button>
{% endif %}
</span>
</div>
</div>
</div>
{% endblock %}

View File

@ -1,68 +0,0 @@
{% extends "base.html" %}
{% load my_filters %}
{% block title %}RustDesk WebUI{% endblock %}
{% block content %}
<div style="padding: 20px; background-color: #F2F2F2;">
<div class="layui-row layui-col-space15">
<div class="layui-col-md15">
<div class="layui-card">
<div class="layui-card-header">{{ "文件传输日志" | translate }}:{{u.username}}</div>
<div class="layui-card-body">
<table class="layui-table">
<thead>
<tr>
<th>{{ "文件" | translate }}</th>
<th>{{ "远程ID" | translate }}</th>
<th>{{ "远程别名" | translate }}</th>
<th>{{ "用户ID" | translate }}</th>
<th>{{ "用户别名" | translate }}</th>
<th>{{ "用户IP" | translate }}</th>
<th>{{ "文件大小" | translate }}</th>
<th>{{ "发送/接受" | translate }}</th>
<th>{{ "记录于" | translate }}</th>
</tr>
</thead>
<tbody>
{% for one in page_obj %}
<tr>
<td>{{one.file}}</td>
<td>{{one.remote_id}} </td>
<td>{{one.remote_alias}}</td>
<td>{{one.user_id}}</td>
<td>{{one.user_alias}}</td>
<td>{{one.user_ip}}</td>
<td>{{one.filesize}}</td>
{% if one.direction == 0 %}
<td>User Received File</td>
{% else %}
<td>User Sent File</td>
{% endif %}
<td>{{one.logged_at}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
<div class="layui-col-md4 layui-col-md-offset4">
<span class="step-links">
{% if page_obj.has_previous %}
<button class="layui-btn" ><a href="?page=1">&laquo; {{ "首页" | translate }}</a></button>
<button class="layui-btn" ><a href="?page={{ page_obj.previous_page_number }}">{{ "Previous" | translate }}</a></button>
{% endif %}
{% if page_obj.paginator.num_pages > 1 %}
<span class="current">
{{ "页码 #" | translate }} {{ page_obj.number }} / {{ page_obj.paginator.num_pages }}
</span>
{% endif %}
{% if page_obj.has_next %}
<button class="layui-btn" > <a href="?page={{ page_obj.next_page_number }}">{{ "Next" | translate }}</a></button>
<button class="layui-btn" ><a href="?page={{ page_obj.paginator.num_pages }}">{{ "Last" | translate }} &raquo;</a></button>
{% endif %}
</span>
</div>
</div>
</div>
{% endblock %}

View File

@ -1,36 +1,32 @@
{% extends "base.html" %}
{% load my_filters %}
{% block title %}RustDesk WebUI{% endblock %}
{% block legend_name %}{{ "综合屏" | translate }}{% endblock %}
{% block legend_name %}综合屏{% endblock %}
{% block content %}
<div style="padding: 20px; background-color: #F2F2F2;">
<div class="layui-row layui-col-space15">
{% if not show_all %}
<div class="layui-col-md15">
<div class="layui-card">
<div class="layui-card-header">{{ "设备统计" | translate }} - {{ "用户名" | translate }}:{{u.username}}</div>
<div class="layui-card-header">设备统计 - 用户名:{{u.username}}</div>
<div class="layui-card-body">
<table class="layui-table">
<thead>
<tr>
<th>{{ "客户端ID" | translate }}</th>
<th>{{ "版本" | translate }}</th>
<th>{{ "连接密码" | translate }}</th>
<th>{{ "系统用户名" | translate }}</th>
<th>{{ "计算机名" | translate }}</th>
<th>{{ "别名" | translate }}</th>
<th>{{ "平台" | translate }}</th>
<th>{{ "系统" | translate }}</th>
<th>{{ "CPU" | translate }}</th>
<th>{{ "内存" | translate }}</th>
<th>{{ "IP" | translate }}</th>
<th>{{ "注册时间" | translate }}</th>
<th>{{ "更新时间" | translate }}</th>
<th>{{ "状态" | translate }}</th>
<th>客户端ID</th>
<th>版本</th>
<th>连接密码</th>
<th>系统用户名</th>
<th>计算机名</th>
<th>别名</th>
<th>平台</th>
<th>系统</th>
<th>CPU</th>
<th>内存</th>
<th>注册时间</th>
<th>更新时间</th>
</tr>
</thead>
<tbody>
{% for one in page_obj %}
{% for one in single_info %}
<tr>
<td>{{one.rid}} </td>
<td>{{one.version}}</td>
@ -42,10 +38,8 @@
<td>{{one.os}}</td>
<td>{{one.cpu}}</td>
<td>{{one.memory}}</td>
<td>{{one.ip_address}}</td>
<td>{{one.create_time}}</td>
<td>{{one.update_time}}</td>
<td>{{one.status}} </td>
</tr>
{% endfor %}
</tbody>
@ -53,53 +47,30 @@
</div>
</div>
</div>
<div class="layui-col-md4 layui-col-md-offset4">
<span class="step-links">
{% if page_obj.has_previous %}
<button class="layui-btn" ><a href="?page=1">&laquo; {{ "首页" | translate }}</a></button>
<button class="layui-btn" ><a href="?page={{ page_obj.previous_page_number }}">{{ "上一页" | translate }}</a></button>
{% endif %}
{% if page_obj.paginator.num_pages > 1 %}
<span class="current">
{{ "页码" | translate }} {{ page_obj.number }} / {{ page_obj.paginator.num_pages }}
</span>
{% endif %}
{% if page_obj.has_next %}
<button class="layui-btn" > <a href="?page={{ page_obj.next_page_number }}">{{ "下一页" | translate }}</a></button>
<button class="layui-btn" ><a href="?page={{ page_obj.paginator.num_pages }}">{{ "尾页" | translate }} &raquo;</a></button>
{% endif %}
</span>
</div>
{% endif %}
{% if u.is_admin and show_all %}
{% if u.is_admin %}
<div class="layui-col-md15">
<div class="layui-card">
<div class="layui-card-header">{{ "全部用户" | translate }} &raquo;
<div class="layui-btn" ><a href="/api/down_peers">{{ "导出xlsx" | translate }}</a></div>
</div>
<div class="layui-card-header">全部用户</div>
<div class="layui-card-body">
<table class="layui-table">
<thead>
<tr>
<th>{{ "客户端ID" | translate }}</th>
<th>{{ "所属用户" | translate }}</th>
<th>{{ "版本" | translate }}</th>
<th>{{ "系统用户名" | translate }}</th>
<th>{{ "计算机名" | translate }}</th>
<th>{{ "系统" | translate }}</th>
<th>{{ "CPU" | translate }}</th>
<th>{{ "内存" | translate }}</th>
<th>{{ "IP" | translate }}</th>
<th>{{ "注册日期" | translate }}</th>
<th>{{ "更新时间" | translate }}</th>
<th>{{ "状态" | translate }}</th>
<th>客户端ID</th>
<th>所属用户</th>
<th>版本</th>
<th>系统用户名</th>
<th>计算机名</th>
<th>系统</th>
<th>CPU</th>
<th>内存</th>
<th>注册时间</th>
<th>更新时间</th>
</tr>
</thead>
<tbody>
{% for one in page_obj %}
{% for one in all_info %}
<tr>
<td>{{one.rid}} </td>
<td>{{one.rust_user}} </td>
@ -109,10 +80,8 @@
<td>{{one.os}} </td>
<td>{{one.cpu}} </td>
<td>{{one.memory}} </td>
<td>{{one.ip_address}}</td>
<td>{{one.create_time}} </td>
<td>{{one.update_time}} </td>
<td>{{one.status}} </td>
</tr>
{% endfor %}
</tbody>
@ -120,28 +89,8 @@
</div>
</div>
</div>
<div class="layui-col-md4 layui-col-md-offset4">
<span class="step-links">
{% if page_obj.has_previous %}
<button class="layui-btn" ><a href="?show_type=admin&page=1">&laquo; {{ "首页" | translate }}</a></button>
<button class="layui-btn" ><a href="?show_type=admin&page={{ page_obj.previous_page_number }}">{{ "上一页" | translate }}</a></button>
{% endif %}
{% if page_obj.paginator.num_pages > 1 %}
<span class="current">
{{ "页码" | translate }} {{ page_obj.number }} / {{ page_obj.paginator.num_pages }}
</span>
{% endif %}
{% if page_obj.has_next %}
<button class="layui-btn" > <a href="?show_type=admin&page={{ page_obj.next_page_number }}">{{ "下一页" | translate }}</a></button>
<button class="layui-btn" ><a href="?show_type=admin&page={{ page_obj.paginator.num_pages }}">{{ "尾页" | translate }} &raquo;</a></button>
{% endif %}
</span>
</div>
{% endif %}
</div>
</div>

View File

@ -1,8 +0,0 @@
from django import template
from django.utils.translation import gettext as _
register = template.Library()
@register.filter
def translate(text):
return _(text)

View File

@ -9,8 +9,7 @@ from api import views
urlpatterns = [
url(r'^login',views.login),
url(r'^logout',views.logout),
url(r'^ab$',views.ab),
url(r'^ab\/get',views.ab_get), # 兼容 x86-sciter 版客户端
url(r'^ab',views.ab),
url(r'^users',views.users),
url(r'^peers',views.peers),
url(r'^currentUser',views.currentUser),
@ -18,10 +17,6 @@ urlpatterns = [
url(r'^heartbeat',views.heartbeat),
#url(r'^register',views.register),
url(r'^user_action',views.user_action), # 前端
url(r'^work',views.work), # 前端
url(r'^down_peers$',views.down_peers), # 前端
url(r'^share',views.share), # 前端
url(r'^conn_log',views.conn_log),
url(r'^file_log',views.file_log),
url(r'^audit',views.audit),
url(r'^work',views.work), # 前端
url(r'^share',views.share), # 前端
]

View File

@ -22,4 +22,3 @@ import copy
from .views_front import *
from .views_api import *
from .front_locale import *

View File

@ -3,34 +3,24 @@ from django.http import JsonResponse
import json
import time
import datetime
# import hashlib
import math
import hashlib
from django.contrib import auth
# from django.forms.models import model_to_dict
from api.models import RustDeskToken, UserProfile, RustDeskTag, RustDeskPeer, RustDesDevice, ConnLog, FileLog
from django.forms.models import model_to_dict
from api.models import RustDeskToken, UserProfile, RustDeskTag, RustDeskPeer, RustDesDevice
from django.db.models import Q
import copy
from .views_front import *
from django.utils.translation import gettext as _
def get_client_ip(request):
x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR')
if x_forwarded_for:
ip = x_forwarded_for.split(',')[0]
else:
ip = request.META.get('REMOTE_ADDR')
return ip
def login(request):
result = {}
if request.method == 'GET':
result['error'] = _('请求方式错误请使用POST方式。')
result['error'] = '请求方式错误请使用POST方式。'
return JsonResponse(result)
data = json.loads(request.body.decode())
username = data.get('username', '')
password = data.get('password', '')
rid = data.get('id', '')
@ -38,31 +28,19 @@ def login(request):
autoLogin = data.get('autoLogin', True)
rtype = data.get('type', '')
deviceInfo = data.get('deviceInfo', '')
user = auth.authenticate(username=username, password=password)
user = auth.authenticate(username=username,password=password)
if not user:
result['error'] = _('帐号或密码错误请重试多次重试后将被锁定IP')
result['error'] = '帐号或密码错误请重试多次重试后将被锁定IP'
return JsonResponse(result)
user.rid = rid
user.uuid = uuid
user.autoLogin = autoLogin
user.rtype = rtype
user.rtype = rtype
user.deviceInfo = json.dumps(deviceInfo)
user.save()
# 绑定设备 20240819
peer = RustDeskPeer.objects.filter(Q(rid=rid)).first()
if not peer:
device = RustDesDevice.objects.filter(Q(uuid=uuid)).first()
if device:
peer = RustDeskPeer()
peer.uid = user.id
peer.rid = device.rid
# peer.abid = ab.guid # v2, current version not used
peer.hostname = device.hostname
peer.username = device.username
peer.save()
token = RustDeskToken.objects.filter(Q(uid=user.id) & Q(username=user.username) & Q(rid=user.rid)).first()
# 检查是否过期
if token:
now_t = datetime.datetime.now()
@ -70,7 +48,7 @@ def login(request):
if nums >= EFFECTIVE_SECONDS:
token.delete()
token = None
if not token:
# 获取并保存token
token = RustDeskToken(
@ -78,52 +56,52 @@ def login(request):
uid=user.id,
uuid=user.uuid,
rid=user.rid,
access_token=getStrMd5(str(time.time()) + salt)
access_token=getStrMd5(str(time.time())+salt)
)
token.save()
result['access_token'] = token.access_token
result['type'] = 'access_token'
result['user'] = {'name': user.username}
result['user'] = {'name':user.username}
return JsonResponse(result)
def logout(request):
if request.method == 'GET':
result = {'error': _('请求方式错误!')}
result = {'error':'请求方式错误!'}
return JsonResponse(result)
data = json.loads(request.body.decode())
rid = data.get('id', '')
uuid = data.get('uuid', '')
user = UserProfile.objects.filter(Q(rid=rid) & Q(uuid=uuid)).first()
if not user:
result = {'error': _('异常请求!')}
result = {'error':'异常请求!'}
return JsonResponse(result)
token = RustDeskToken.objects.filter(Q(uid=user.id) & Q(rid=user.rid)).first()
if token:
token.delete()
result = {'code': 1}
result = {'code':1}
return JsonResponse(result)
def currentUser(request):
result = {}
if request.method == 'GET':
result['error'] = _('错误的提交方式!')
result['error'] = '错误的提交方式!'
return JsonResponse(result)
# postdata = json.loads(request.body)
# rid = postdata.get('id', '')
# uuid = postdata.get('uuid', '')
postdata = json.loads(request.body)
rid = postdata.get('id', '')
uuid = postdata.get('uuid', '')
access_token = request.META.get('HTTP_AUTHORIZATION', '')
access_token = access_token.split('Bearer ')[-1]
token = RustDeskToken.objects.filter(Q(access_token=access_token)).first()
token = RustDeskToken.objects.filter(Q(access_token=access_token) ).first()
user = None
if token:
user = UserProfile.objects.filter(Q(id=token.uid)).first()
if user:
if token:
result['access_token'] = token.access_token
@ -137,53 +115,53 @@ def ab(request):
'''
access_token = request.META.get('HTTP_AUTHORIZATION', '')
access_token = access_token.split('Bearer ')[-1]
token = RustDeskToken.objects.filter(Q(access_token=access_token)).first()
token = RustDeskToken.objects.filter(Q(access_token=access_token) ).first()
if not token:
result = {'error': _('拉取列表错误!')}
result = {'error':'拉取列表错误!'}
return JsonResponse(result)
if request.method == 'GET':
result = {}
uid = token.uid
tags = RustDeskTag.objects.filter(Q(uid=uid))
tags = RustDeskTag.objects.filter(Q(uid=uid) )
tag_names = []
tag_colors = {}
if tags:
tag_names = [str(x.tag_name) for x in tags]
tag_colors = {str(x.tag_name): int(x.tag_color) for x in tags if x.tag_color != ''}
tag_colors = {str(x.tag_name):int(x.tag_color) for x in tags if x.tag_color!=''}
peers_result = []
peers = RustDeskPeer.objects.filter(Q(uid=uid))
peers = RustDeskPeer.objects.filter(Q(uid=uid) )
if peers:
for peer in peers:
tmp = {
'id': peer.rid,
'username': peer.username,
'hostname': peer.hostname,
'alias': peer.alias,
'platform': peer.platform,
'tags': peer.tags.split(','),
'hash': peer.rhash,
'id':peer.rid,
'username':peer.username,
'hostname':peer.hostname,
'alias':peer.alias,
'platform':peer.platform,
'tags':peer.tags.split(','),
'hash':peer.rhash,
}
peers_result.append(tmp)
result['updated_at'] = datetime.datetime.now()
result['data'] = {
'tags': tag_names,
'peers': peers_result,
'tag_colors': json.dumps(tag_colors)
'tags':tag_names,
'peers':peers_result,
'tag_colors':json.dumps(tag_colors)
}
result['data'] = json.dumps(result['data'])
return JsonResponse(result)
else:
postdata = json.loads(request.body.decode())
data = postdata.get('data', '')
data = {} if data == '' else json.loads(data)
data = {} if data=='' else json.loads(data)
tagnames = data.get('tags', [])
tag_colors = data.get('tag_colors', '')
tag_colors = {} if tag_colors == '' else json.loads(tag_colors)
tag_colors = {} if tag_colors=='' else json.loads(tag_colors)
peers = data.get('peers', [])
if tagnames:
# 删除旧的tag
RustDeskTag.objects.filter(uid=token.uid).delete()
@ -210,34 +188,27 @@ def ab(request):
platform=one['platform'],
tags=','.join(one['tags']),
rhash=one['hash'],
)
newlist.append(peer)
RustDeskPeer.objects.bulk_create(newlist)
result = {
'code': 102,
'data': _('更新地址簿有误')
'code':102,
'data':'更新地址簿有误'
}
return JsonResponse(result)
def ab_get(request):
# 兼容 x86-sciter 版客户端,此版客户端通过访问 "POST /api/ab/get" 来获取地址簿
request.method = 'GET'
return ab(request)
def sysinfo(request):
# 客户端注册服务后,才会发送设备信息
result = {}
if request.method == 'GET':
result['error'] = _('错误的提交方式!')
result['error'] = '错误的提交方式!'
return JsonResponse(result)
client_ip = get_client_ip(request)
postdata = json.loads(request.body)
device = RustDesDevice.objects.filter(Q(rid=postdata['id']) & Q(uuid=postdata['uuid'])).first()
device = RustDesDevice.objects.filter(Q(rid=postdata['id']) & Q(uuid=postdata['uuid']) ).first()
if not device:
device = RustDesDevice(
rid=postdata['id'],
@ -248,101 +219,38 @@ def sysinfo(request):
username=postdata.get('username', '-'),
uuid=postdata['uuid'],
version=postdata['version'],
ip_address=client_ip
)
device.save()
else:
postdata2 = copy.copy(postdata)
postdata2['rid'] = postdata2['id']
postdata2.pop('id')
RustDesDevice.objects.filter(Q(rid=postdata['id']) & Q(uuid=postdata['uuid'])).update(**postdata2)
RustDesDevice.objects.filter(Q(rid=postdata['id']) & Q(uuid=postdata['uuid']) ).update(**postdata2)
result['data'] = 'ok'
return JsonResponse(result)
def heartbeat(request):
postdata = json.loads(request.body)
device = RustDesDevice.objects.filter(Q(rid=postdata['id']) & Q(uuid=postdata['uuid'])).first()
device = RustDesDevice.objects.filter(Q(rid=postdata['id']) & Q(uuid=postdata['uuid']) ).first()
if device:
client_ip = get_client_ip(request)
device.ip_address = client_ip
device.save()
# token保活
create_time = datetime.datetime.now() + datetime.timedelta(seconds=EFFECTIVE_SECONDS)
RustDeskToken.objects.filter(Q(rid=postdata['id']) & Q(uuid=postdata['uuid'])).update(create_time=create_time)
RustDeskToken.objects.filter(Q(rid=postdata['id']) & Q(uuid=postdata['uuid']) ).update(create_time=create_time)
result = {}
result['data'] = _('在线')
result['data'] = '在线'
return JsonResponse(result)
def audit(request):
postdata = json.loads(request.body)
# print(postdata)
audit_type = postdata['action'] if 'action' in postdata else ''
if audit_type == 'new':
new_conn_log = ConnLog(
action=postdata['action'] if 'action' in postdata else '',
conn_id=postdata['conn_id'] if 'conn_id' in postdata else 0,
from_ip=postdata['ip'] if 'ip' in postdata else '',
from_id='',
rid=postdata['id'] if 'id' in postdata else '',
conn_start=datetime.datetime.now(),
session_id=postdata['session_id'] if 'session_id' in postdata else 0,
uuid=postdata['uuid'] if 'uuid' in postdata else '',
)
new_conn_log.save()
elif audit_type == "close":
ConnLog.objects.filter(Q(conn_id=postdata['conn_id'])).update(conn_end=datetime.datetime.now())
elif 'is_file' in postdata:
print(postdata)
files = json.loads(postdata['info'])['files']
filesize = convert_filesize(int(files[0][1]))
new_file_log = FileLog(
file=postdata['path'],
user_id=postdata['peer_id'],
user_ip=json.loads(postdata['info'])['ip'],
remote_id=postdata['id'],
filesize=filesize,
direction=postdata['type'],
logged_at=datetime.datetime.now(),
)
new_file_log.save()
else:
try:
peer = postdata['peer']
ConnLog.objects.filter(Q(conn_id=postdata['conn_id'])).update(session_id=postdata['session_id'])
ConnLog.objects.filter(Q(conn_id=postdata['conn_id'])).update(from_id=peer[0])
except Exception as e:
print(postdata, e)
result = {
'code': 1,
'data': 'ok'
}
return JsonResponse(result)
def convert_filesize(size_bytes):
if size_bytes == 0:
return "0B"
size_name = ("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB")
i = int(math.floor(math.log(size_bytes, 1024)))
p = math.pow(1024, i)
s = round(size_bytes / p, 2)
return "%s %s" % (s, size_name[i])
def users(request):
result = {
'code': 1,
'data': _('好的')
'code':1,
'data':'好的'
}
return JsonResponse(result)
def peers(request):
result = {
'code': 1,
'data': 'ok'
'code':1,
'data':'ok'
}
return JsonResponse(result)
return JsonResponse(result)

View File

@ -6,11 +6,8 @@ from django.http import JsonResponse
from django.db.models import Q
from django.contrib.auth.decorators import login_required
from django.contrib import auth
from api.models import RustDeskPeer, RustDesDevice, UserProfile, ShareLink, ConnLog, FileLog
from api.models import RustDeskPeer, RustDesDevice, UserProfile, ShareLink
from django.forms.models import model_to_dict
from django.core.paginator import Paginator
from django.http import HttpResponse
from django.conf import settings
from itertools import chain
from django.db.models.fields import DateTimeField, DateField, CharField, TextField
@ -21,14 +18,9 @@ import time
import hashlib
import sys
from io import BytesIO
import xlwt
from django.utils.translation import gettext as _
salt = 'xiaomo'
EFFECTIVE_SECONDS = 7200
def getStrMd5(s):
if not isinstance(s, (str,)):
s = str(s)
@ -38,7 +30,6 @@ def getStrMd5(s):
return myHash.hexdigest()
def model_to_dict2(instance, fields=None, exclude=None, replace=None, default=None):
"""
:params instance: 模型对象不能是queryset数据集
@ -49,23 +40,23 @@ def model_to_dict2(instance, fields=None, exclude=None, replace=None, default=No
"""
# 对传递进来的模型对象校验
if not isinstance(instance, Model):
raise Exception(_('model_to_dict接收的参数必须是模型对象'))
raise Exception('model_to_dict接收的参数必须是模型对象')
# 对替换数据库字段名字校验
if replace and type(replace) == dict: # noqa
if replace and type(replace) == dict:
for replace_field in replace.values():
if hasattr(instance, replace_field):
raise Exception(_(f'model_to_dict,要替换成{replace_field}字段已经存在了'))
raise Exception(f'model_to_dict,要替换成{replace_field}字段已经存在了')
# 对要新增的默认值进行校验
if default and type(default) == dict: # noqa
if default and type(default) == dict:
for default_key in default.keys():
if hasattr(instance, default_key):
raise Exception(_(f'model_to_dict,要新增默认值,但字段{default_key}已经存在了')) # noqa
raise Exception(f'model_to_dict,要新增默认值,但字段{default_key}已经存在了')
opts = instance._meta
data = {}
for f in chain(opts.concrete_fields, opts.private_fields, opts.many_to_many):
# 源码下:这块代码会将时间字段剔除掉,我加上一层判断,让其不再剔除时间字段
if not getattr(f, 'editable', False):
if type(f) == DateField or type(f) == DateTimeField: # noqa
if type(f) == DateField or type(f) == DateTimeField:
pass
else:
continue
@ -78,22 +69,22 @@ def model_to_dict2(instance, fields=None, exclude=None, replace=None, default=No
key = f.name
# 获取字段对应的数据
if type(f) == DateTimeField: # noqa
if type(f) == DateTimeField:
# 字段类型是DateTimeFiled 使用自己的方式操作
value = getattr(instance, key)
value = datetime.datetime.strftime(value, '%Y-%m-%d %H:%M')
elif type(f) == DateField: # noqa
value = datetime.datetime.strftime(value, '%Y-%m-%d')
elif type(f) == DateField:
# 字段类型是DateFiled 使用自己的方式操作
value = getattr(instance, key)
value = datetime.datetime.strftime(value, '%Y-%m-%d')
elif type(f) == CharField or type(f) == TextField: # noqa
elif type(f) == CharField or type(f) == TextField:
# 字符串数据是否可以进行序列化转成python结构数据
value = getattr(instance, key)
try:
value = json.loads(value)
except Exception as _: # noqa
except Exception as _:
value = value
else: # 其他类型的字段
else:#其他类型的字段
# value = getattr(instance, key)
key = f.name
value = f.value_from_object(instance)
@ -102,30 +93,30 @@ def model_to_dict2(instance, fields=None, exclude=None, replace=None, default=No
if replace and key in replace.keys():
key = replace.get(key)
data[key] = value
# 2、新增默认的字段数据
#2、新增默认的字段数据
if default:
data.update(default)
return data
def index(request):
print('sdf', sys.argv)
if request.user and request.user.username != 'AnonymousUser':
print('sdf',sys.argv)
if request.user and request.user.username!='AnonymousUser':
return HttpResponseRedirect('/api/work')
return HttpResponseRedirect('/api/user_action?action=login')
def user_action(request):
action = request.GET.get('action', '')
if action == '':
return
if action == 'login':
return user_login(request)
elif action == 'register':
if action == 'register':
return user_register(request)
elif action == 'logout':
if action == 'logout':
return user_logout(request)
else:
return
def user_login(request):
if request.method == 'GET':
@ -134,157 +125,110 @@ def user_login(request):
username = request.POST.get('account', '')
password = request.POST.get('password', '')
if not username or not password:
return JsonResponse({'code': 0, 'msg': _('出了点问题,未获取用户名或密码')})
return JsonResponse({'code':0, 'msg':'出了点问题'})
user = auth.authenticate(username=username, password=password)
user = auth.authenticate(username=username,password=password)
if user:
auth.login(request, user)
return JsonResponse({'code': 1, 'url': '/api/work'})
return JsonResponse({'code':1, 'url':'/api/work'})
else:
return JsonResponse({'code': 0, 'msg': _('帐号或密码错误!')})
return JsonResponse({'code':0, 'msg':'帐号或密码错误!'})
def user_register(request):
info = ''
if request.method == 'GET':
return render(request, 'reg.html')
ALLOW_REGISTRATION = settings.ALLOW_REGISTRATION
result = {
'code': 0,
'msg': ''
}
if not ALLOW_REGISTRATION:
result['msg'] = _('当前未开放注册,请联系管理员!')
return JsonResponse(result)
result = {
'code':0,
'msg':''
}
username = request.POST.get('user', '')
password1 = request.POST.get('pwd', '')
if len(username) <= 3:
info = _('用户名不得小于3位')
info = '用户名不得小于3位'
result['msg'] = info
return JsonResponse(result)
if len(password1) < 8 or len(password1) > 20:
info = _('密码长度不符合要求, 应在8~20位。')
if len(password1)<8 or len(password1)>20:
info = '密码长度不符合要求, 应在8~20位。'
result['msg'] = info
return JsonResponse(result)
user = UserProfile.objects.filter(Q(username=username)).first()
if user:
info = _('用户名已存在。')
info = '用户名已存在。'
result['msg'] = info
return JsonResponse(result)
user = UserProfile(
username=username,
password=make_password(password1),
is_admin=True if UserProfile.objects.count() == 0 else False,
is_superuser=True if UserProfile.objects.count() == 0 else False,
is_active=True
is_admin = True if UserProfile.objects.count()==0 else False,
is_superuser = True if UserProfile.objects.count()==0 else False,
is_active = True
)
user.save()
result['msg'] = info
result['code'] = 1
return JsonResponse(result)
@login_required(login_url='/api/user_action?action=login')
def user_logout(request):
# info=''
info = ''
auth.logout(request)
return HttpResponseRedirect('/api/user_action?action=login')
def get_single_info(uid):
peers = RustDeskPeer.objects.filter(Q(uid=uid))
rids = [x.rid for x in peers]
peers = {x.rid: model_to_dict(x) for x in peers}
# print(peers)
peers = {x.rid:model_to_dict(x) for x in peers}
#print(peers)
devices = RustDesDevice.objects.filter(rid__in=rids)
devices = {x.rid: x for x in devices}
now = datetime.datetime.now()
devices = {x.rid:x for x in devices}
for rid, device in devices.items():
peers[rid]['create_time'] = device.create_time.strftime('%Y-%m-%d')
peers[rid]['update_time'] = device.update_time.strftime('%Y-%m-%d %H:%M')
peers[rid]['update_time'] = device.update_time.strftime('%Y-%m-%d')
peers[rid]['version'] = device.version
peers[rid]['memory'] = device.memory
peers[rid]['cpu'] = device.cpu
peers[rid]['os'] = device.os
peers[rid]['status'] = _('在线') if (now - device.update_time).seconds <= 120 else _('离线')
for rid in peers.keys():
peers[rid]['has_rhash'] = _('') if len(peers[rid]['rhash']) > 1 else _('')
return [v for k, v in peers.items()]
peers[rid]['has_rhash'] = '' if len(peers[rid]['rhash'])>1 else ''
return [v for k,v in peers.items()]
def get_all_info():
devices = RustDesDevice.objects.all()
peers = RustDeskPeer.objects.all()
devices = {x.rid: model_to_dict2(x) for x in devices}
now = datetime.datetime.now()
devices = {x.rid:model_to_dict2(x) for x in devices}
for peer in peers:
user = UserProfile.objects.filter(Q(id=peer.uid)).first()
device = devices.get(peer.rid, None)
if device:
devices[peer.rid]['rust_user'] = user.username
for rid in devices.keys():
if not devices[rid].get('rust_user', ''):
devices[rid]['rust_user'] = _('未登录')
for k, v in devices.items():
devices[k]['status'] = _('在线') if (now - datetime.datetime.strptime(v['update_time'], '%Y-%m-%d %H:%M')).seconds <= 120 else _('离线')
return [v for k, v in devices.items()]
return [v for k,v in devices.items()]
@login_required(login_url='/api/user_action?action=login')
def work(request):
username = request.user
u = UserProfile.objects.get(username=username)
show_type = request.GET.get('show_type', '')
show_all = True if show_type == 'admin' and u.is_admin else False
paginator = Paginator(get_all_info(), 15) if show_type == 'admin' and u.is_admin else Paginator(get_single_info(u.id), 15)
page_number = request.GET.get('page')
page_obj = paginator.get_page(page_number)
return render(request, 'show_work.html', {'u': u, 'show_all': show_all, 'page_obj': page_obj})
@login_required(login_url='/api/user_action?action=login')
def down_peers(request):
username = request.user
u = UserProfile.objects.get(username=username)
if not u.is_admin:
print(u.is_admin)
return HttpResponseRedirect('/api/work')
single_info = get_single_info(u.id)
all_info = get_all_info()
f = xlwt.Workbook(encoding='utf-8')
sheet1 = f.add_sheet(_(u'设备信息表'), cell_overwrite_ok=True)
all_fields = [x.name for x in RustDesDevice._meta.get_fields()]
all_fields.append('rust_user')
for i, one in enumerate(all_info):
for j, name in enumerate(all_fields):
if i == 0:
# 写入列名
sheet1.write(i, j, name)
sheet1.write(i + 1, j, one.get(name, '-'))
print(all_info)
sio = BytesIO()
f.save(sio)
sio.seek(0)
response = HttpResponse(sio.getvalue(), content_type='application/vnd.ms-excel')
response['Content-Disposition'] = 'attachment; filename=DeviceInfo.xls'
response.write(sio.getvalue())
return response
return render(request, 'show_work.html', {'single_info':single_info, 'all_info':all_info, 'u':u})
def check_sharelink_expired(sharelink):
now = datetime.datetime.now()
if sharelink.create_time > now:
return False
if (now - sharelink.create_time).seconds < 15 * 60:
if (now - sharelink.create_time).seconds <15 * 60:
return False
else:
sharelink.is_expired = True
@ -297,18 +241,19 @@ def share(request):
peers = RustDeskPeer.objects.filter(Q(uid=request.user.id))
sharelinks = ShareLink.objects.filter(Q(uid=request.user.id) & Q(is_used=False) & Q(is_expired=False))
# 省资源:处理已过期请求,不主动定时任务轮询请求,在任意地方请求时,检查是否过期,过期则保存。
# now = datetime.datetime.now()
now = datetime.datetime.now()
for sl in sharelinks:
check_sharelink_expired(sl)
sharelinks = ShareLink.objects.filter(Q(uid=request.user.id) & Q(is_used=False) & Q(is_expired=False))
peers = [{'id': ix + 1, 'name': f'{p.rid}|{p.alias}'} for ix, p in enumerate(peers)]
sharelinks = [{'shash': s.shash, 'is_used': s.is_used, 'is_expired': s.is_expired, 'create_time': s.create_time, 'peers': s.peers} for ix, s in enumerate(sharelinks)]
peers = [{'id':ix+1, 'name':f'{p.rid}|{p.alias}'} for ix, p in enumerate(peers)]
sharelinks = [{'shash':s.shash, 'is_used':s.is_used, 'is_expired':s.is_expired, 'create_time':s.create_time, 'peers':s.peers} for ix, s in enumerate(sharelinks)]
if request.method == 'GET':
url = request.build_absolute_uri()
if url.endswith('share'):
return render(request, 'share.html', {'peers': peers, 'sharelinks': sharelinks})
return render(request, 'share.html', {'peers':peers, 'sharelinks':sharelinks})
else:
shash = url.split('/')[-1]
sharelink = ShareLink.objects.filter(Q(shash=shash))
@ -329,22 +274,13 @@ def share(request):
peers = peers.split(',')
# 自己的peers若重叠需要跳过
peers_self_ids = [x.rid for x in RustDeskPeer.objects.filter(Q(uid=request.user.id))]
peers_share = RustDeskPeer.objects.filter(Q(rid__in=peers) & Q(uid=sharelink.uid))
# peers_share_ids = [x.rid for x in peers_share]
peers_share = RustDeskPeer.objects.filter(rid__in=peers)
peers_share_ids = [x.rid for x in peers_share]
for peer in peers_share:
if peer.rid in peers_self_ids:
continue
# peer = RustDeskPeer.objects.get(rid=peer.rid)
peer_f = RustDeskPeer.objects.filter(Q(rid=peer.rid) & Q(uid=sharelink.uid))
if not peer_f:
msg += f"{peer.rid}已存在,"
continue
if len(peer_f) > 1:
msg += f'{peer.rid}存在多个,已经跳过。 '
continue
peer = peer_f[0]
peer = RustDeskPeer.objects.get(rid=peer.rid)
peer.id = None
peer.uid = request.user.id
peer.save()
@ -352,99 +288,21 @@ def share(request):
msg += '已被成功获取。'
title = _(title)
msg = _(msg)
return render(request, 'msg.html', {'title': msg, 'msg': msg})
return render(request, 'msg.html', {'title':msg, 'msg':msg})
else:
data = request.POST.get('data', '[]')
data = json.loads(data)
if not data:
return JsonResponse({'code': 0, 'msg': _('数据为空。')})
return JsonResponse({'code':0, 'msg':'数据为空。'})
rustdesk_ids = [x['title'].split('|')[0] for x in data]
rustdesk_ids = ','.join(rustdesk_ids)
sharelink = ShareLink(
uid=request.user.id,
shash=getStrMd5(str(time.time()) + salt),
shash = getStrMd5(str(time.time())+salt),
peers=rustdesk_ids,
)
sharelink.save()
return JsonResponse({'code': 1, 'shash': sharelink.shash})
return JsonResponse({'code':1, 'shash':sharelink.shash})
def get_conn_log():
logs = ConnLog.objects.all()
logs = {x.id: model_to_dict(x) for x in logs}
for k, v in logs.items():
try:
peer = RustDeskPeer.objects.get(rid=v['rid'])
logs[k]['alias'] = peer.alias
except: # noqa
logs[k]['alias'] = _('UNKNOWN')
try:
peer = RustDeskPeer.objects.get(rid=v['from_id'])
logs[k]['from_alias'] = peer.alias
except: # noqa
logs[k]['from_alias'] = _('UNKNOWN')
# from_zone = tz.tzutc()
# to_zone = tz.tzlocal()
# utc = logs[k]['logged_at']
# utc = utc.replace(tzinfo=from_zone)
# logs[k]['logged_at'] = utc.astimezone(to_zone)
try:
duration = round((logs[k]['conn_end'] - logs[k]['conn_start']).total_seconds())
m, s = divmod(duration, 60)
h, m = divmod(m, 60)
# d, h = divmod(h, 24)
logs[k]['duration'] = f'{h:02d}:{m:02d}:{s:02d}'
except: # noqa
logs[k]['duration'] = -1
sorted_logs = sorted(logs.items(), key=lambda x: x[1]['conn_start'], reverse=True)
new_ordered_dict = {}
for key, alog in sorted_logs:
new_ordered_dict[key] = alog
return [v for k, v in new_ordered_dict.items()]
def get_file_log():
logs = FileLog.objects.all()
logs = {x.id: model_to_dict(x) for x in logs}
for k, v in logs.items():
try:
peer_remote = RustDeskPeer.objects.get(rid=v['remote_id'])
logs[k]['remote_alias'] = peer_remote.alias
except: # noqa
logs[k]['remote_alias'] = _('UNKNOWN')
try:
peer_user = RustDeskPeer.objects.get(rid=v['user_id'])
logs[k]['user_alias'] = peer_user.alias
except: # noqa
logs[k]['user_alias'] = _('UNKNOWN')
sorted_logs = sorted(logs.items(), key=lambda x: x[1]['logged_at'], reverse=True)
new_ordered_dict = {}
for key, alog in sorted_logs:
new_ordered_dict[key] = alog
return [v for k, v in new_ordered_dict.items()]
@login_required(login_url='/api/user_action?action=login')
def conn_log(request):
paginator = Paginator(get_conn_log(), 20)
page_number = request.GET.get('page')
page_obj = paginator.get_page(page_number)
return render(request, 'show_conn_log.html', {'page_obj': page_obj})
@login_required(login_url='/api/user_action?action=login')
def file_log(request):
paginator = Paginator(get_file_log(), 20)
page_number = request.GET.get('page')
page_obj = paginator.get_page(page_number)
return render(request, 'show_file_log.html', {'page_obj': page_obj})

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 343 KiB

After

Width:  |  Height:  |  Size: 459 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

View File

@ -1,592 +0,0 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-05-14 10:44+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: .\api\admin_user.py:14 .\api\front_locale.py:28
msgid "密码"
msgstr "Password"
#: .\api\admin_user.py:15
msgid "再次输入密码"
msgstr "Re-enter password"
#: .\api\admin_user.py:26
msgid "密码校验失败,两次密码不一致。"
msgstr "Password verification failed, passwords do not match."
#: .\api\admin_user.py:44
msgid "密码Hash值"
msgstr "Password Hash Value"
#: .\api\admin_user.py:75
msgid "基本信息"
msgstr "Basic Information"
#: .\api\admin_user.py:100
msgid "RustDesk自建Web"
msgstr "RustDesk Self-Hosted Web"
#: .\api\admin_user.py:101
msgid "未定义"
msgstr "Undefined"
#: .\api\front_locale.py:4 .\api\templates\base.html:42
msgid "管理后台"
msgstr "Admin Panel"
#: .\api\front_locale.py:5
msgid "ID列表"
msgstr "ID List"
#: .\api\front_locale.py:6
msgid "分享机器"
msgstr "Share Machine"
#: .\api\front_locale.py:7
msgid "这么简易的东西,忘记密码这功能就没必要了吧。"
msgstr ""
"For such a simple thing, the forgot password feature is unnecessary, right?"
#: .\api\front_locale.py:8
msgid "立即注册"
msgstr "Register Now"
#: .\api\front_locale.py:9
msgid "创建时间"
msgstr "Creation Time"
#: .\api\front_locale.py:10
msgid "注册成功,请前往登录页登录。"
msgstr "Registration successful, please go to the login page to login."
#: .\api\front_locale.py:11
msgid "注册日期"
msgstr "Registration Date"
#: .\api\front_locale.py:12
msgid ""
"2、所分享的机器被分享人享有相同的权限如果机器设置了保存密码被分享人也可"
"以直接连接。"
msgstr ""
"2. The shared machine grants the same permissions to the recipient. If the "
"machine is set to save password, the recipient can also connect directly."
#: .\api\front_locale.py:13
msgid "导出xlsx"
msgstr "Export as xlsx"
#: .\api\front_locale.py:14
msgid "生成分享链接"
msgstr "Generate Share Link"
#: .\api\front_locale.py:15
msgid "请输入8~20位密码。可以包含字母、数字和特殊字符。"
msgstr ""
"Please enter a password of 8~20 characters. It can contain letters, numbers, "
"and special characters."
#: .\api\front_locale.py:16
msgid "尾页"
msgstr "Last Page"
#: .\api\front_locale.py:17
msgid "请确认密码"
msgstr "Please confirm password"
#: .\api\front_locale.py:18
msgid "注册"
msgstr "Register"
#: .\api\front_locale.py:19 .\api\models_work.py:73
msgid "内存"
msgstr "Memory"
#: .\api\front_locale.py:20 .\api\templates\base.html:31
msgid "首页"
msgstr "Home"
#: .\api\front_locale.py:21 .\api\templates\base.html:37
msgid "网页控制"
msgstr "Web Control"
#: .\api\front_locale.py:22
msgid "注册时间"
msgstr "Registration Time"
#: .\api\front_locale.py:23
msgid "链接地址"
msgstr "Link Address"
#: .\api\front_locale.py:24
msgid "请输入密码"
msgstr "Please enter password"
#: .\api\front_locale.py:25 .\api\models_work.py:50 .\api\models_work.py:76
msgid "系统用户名"
msgstr "System Username"
#: .\api\front_locale.py:26
msgid "状态"
msgstr "Status"
#: .\api\front_locale.py:27
msgid "已有账号?立即登录"
msgstr "Already have an account? Login now"
#: .\api\front_locale.py:29 .\api\models_work.py:52
msgid "别名"
msgstr "Alias"
#: .\api\front_locale.py:30
msgid "上一页"
msgstr "Previous Page"
#: .\api\front_locale.py:31
msgid "更新时间"
msgstr "Update Time"
#: .\api\front_locale.py:32
msgid "综合屏"
msgstr "Comprehensive Screen"
#: .\api\front_locale.py:33 .\api\models_work.py:53
msgid "平台"
msgstr "Platform"
#: .\api\front_locale.py:34
msgid "全部用户"
msgstr "All Users"
#: .\api\front_locale.py:35
msgid "注册页"
msgstr "Registration Page"
#: .\api\front_locale.py:36
msgid "分享机器给其他用户"
msgstr "Share machine with other users"
#: .\api\front_locale.py:37 .\api\templates\base.html:33
msgid "所有设备"
msgstr "All Devices"
#: .\api\front_locale.py:38
msgid "连接密码"
msgstr "Connection Password"
#: .\api\front_locale.py:39
msgid "设备统计"
msgstr "Device Statistics"
#: .\api\front_locale.py:40
msgid "所属用户"
msgstr "Belongs to User"
#: .\api\front_locale.py:41 .\api\templates\base.html:36
msgid "分享"
msgstr "Share"
#: .\api\front_locale.py:42
msgid "请输入用户名"
msgstr "Please enter username"
#: .\api\front_locale.py:43
msgid "1、链接有效期为15分钟切勿随意分享给他人。"
msgstr ""
"1. The link is valid for 15 minutes. Do not share it with others casually."
#: .\api\front_locale.py:44
msgid "CPU"
msgstr "CPU"
#: .\api\front_locale.py:45 .\api\models_work.py:49 .\api\models_work.py:70
msgid "客户端ID"
msgstr "Client ID"
#: .\api\front_locale.py:46
msgid "下一页"
msgstr "Next Page"
#: .\api\front_locale.py:47
msgid "登录"
msgstr "Login"
#: .\api\front_locale.py:48 .\api\templates\base.html:45
msgid "退出"
msgstr "Logout"
#: .\api\front_locale.py:49
msgid "请将要分享的机器调整到右侧"
msgstr "Please adjust the machines to be shared to the right"
#: .\api\front_locale.py:50
msgid "成功!如需分享,请复制以下链接给其他人:<br>"
msgstr ""
"Success! If you need to share, please copy the following link to others:<br>"
#: .\api\front_locale.py:51
msgid "忘记密码?"
msgstr "Forgot Password?"
#: .\api\front_locale.py:52
msgid "计算机名"
msgstr "Computer Name"
#: .\api\front_locale.py:53
msgid "两次输入密码不一致!"
msgstr "Passwords do not match!"
#: .\api\front_locale.py:54
msgid "页码"
msgstr "Page Number"
#: .\api\front_locale.py:55
msgid "版本"
msgstr "Version"
#: .\api\front_locale.py:56 .\api\models_user.py:32 .\api\models_work.py:9
msgid "用户名"
msgstr "Username"
#: .\api\front_locale.py:57
msgid ""
"3、为保障安全链接有效期为15分钟、链接仅有效1次。链接一旦被非分享人的登录"
"用户)访问,分享生效,后续访问链接失效。"
msgstr ""
"3. For security reasons, the link is valid for 15 minutes and only valid "
"once. Once the link is accessed by a user (other than the sharing person), "
"the sharing becomes effective, and subsequent access to the link will be "
"invalid."
#: .\api\front_locale.py:58
msgid "系统"
msgstr "System"
#: .\api\front_locale.py:59
msgid "我的机器"
msgstr "My Machine"
#: .\api\front_locale.py:60
#, fuzzy
#| msgid "基本信息"
msgid "信息"
msgstr "Basic Information"
#: .\api\front_locale.py:61
msgid "远程ID"
msgstr "Remote ID"
#: .\api\front_locale.py:62
msgid "远程别名"
msgstr "Remote Alias"
#: .\api\front_locale.py:63 .\api\models_work.py:11 .\api\models_work.py:48
#: .\api\models_work.py:126
msgid "用户ID"
msgstr "User ID"
#: .\api\front_locale.py:64
msgid "用户别名"
msgstr "User Alias"
#: .\api\front_locale.py:65
msgid "用户IP"
msgstr "User IP"
#: .\api\front_locale.py:66
msgid "文件大小"
msgstr "Filesize"
#: .\api\front_locale.py:67
msgid "发送/接受"
msgstr "Sent/Received"
#: .\api\front_locale.py:68
msgid "记录于"
msgstr "Logged At"
#: .\api\front_locale.py:69
msgid "连接开始时间"
msgstr "Connection Start Time\t"
#: .\api\front_locale.py:70
msgid "连接结束时间"
msgstr "Connection End Time"
#: .\api\front_locale.py:71
msgid "时长"
msgstr "Duration"
#: .\api\front_locale.py:72 .\api\templates\base.html:40
msgid "连接日志"
msgstr "Connection Log"
#: .\api\front_locale.py:73 .\api\templates\base.html:41
msgid "文件传输日志"
msgstr "File Transfer Log"
#: .\api\front_locale.py:74
msgid "页码 #"
msgstr "Page #"
#: .\api\front_locale.py:75
msgid "下一页 #"
msgstr "Next #"
#: .\api\front_locale.py:76
msgid "上一页 #"
msgstr "Previous #"
#: .\api\front_locale.py:77
#, fuzzy
#| msgid "上一页"
msgid "第一页"
msgstr "First"
#: .\api\front_locale.py:78
#, fuzzy
#| msgid "上一页"
msgid "上页"
msgstr "Previous Page"
#: .\api\models_user.py:40
msgid "登录信息:"
msgstr "Login Information:"
#: .\api\models_user.py:42
msgid "是否激活"
msgstr "Is Active"
#: .\api\models_user.py:43
msgid "是否管理员"
msgstr "Is Administrator"
#: .\api\models_user.py:82
msgid "用户"
msgstr "User"
#: .\api\models_user.py:83
msgid "用户列表"
msgstr "User List"
#: .\api\models_work.py:10
msgid "RustDesk ID"
msgstr "RustDesk ID"
#: .\api\models_work.py:12
msgid "uuid"
msgstr "UUID"
#: .\api\models_work.py:13
msgid "access_token"
msgstr "Access Token"
#: .\api\models_work.py:14
msgid "登录时间"
msgstr "Login Time"
#: .\api\models_work.py:19
msgid "Token列表"
msgstr "Token List"
#: .\api\models_work.py:30
msgid "所属用户ID"
msgstr "Belongs to User ID"
#: .\api\models_work.py:31
msgid "标签名称"
msgstr "Tag Name"
#: .\api\models_work.py:32
msgid "标签颜色"
msgstr "Tag Color"
#: .\api\models_work.py:37
msgid "Tags列表"
msgstr "Tags List"
#: .\api\models_work.py:51
msgid "操作系统名"
msgstr "Operating System Name"
#: .\api\models_work.py:54
msgid "标签"
msgstr "Tag"
#: .\api\models_work.py:55
msgid "设备链接密码"
msgstr "Device Connection Password"
#: .\api\models_work.py:60
msgid "Peers列表"
msgstr "Peers List"
#: .\api\models_work.py:72
msgid "主机名"
msgstr "Hostname"
#: .\api\models_work.py:74
msgid "操作系统"
msgstr "Operating System"
#: .\api\models_work.py:77
msgid "客户端版本"
msgstr "Client Version"
#: .\api\models_work.py:78
msgid "设备注册时间"
msgstr "Device Registration Time"
#: .\api\models_work.py:83
msgid "设备"
msgstr "Device"
#: .\api\models_work.py:84
msgid "设备列表"
msgstr "Device List"
#: .\api\models_work.py:127
msgid "链接Key"
msgstr "Link Key"
#: .\api\models_work.py:128
msgid "机器ID列表"
msgstr "Machine ID List"
#: .\api\models_work.py:129
msgid "是否使用"
msgstr "Is Used"
#: .\api\models_work.py:130
msgid "是否过期"
msgstr "Is Expired"
#: .\api\models_work.py:131
msgid "生成时间"
msgstr "Generation Time"
#: .\api\models_work.py:137
msgid "分享链接"
msgstr "Share Link"
#: .\api\models_work.py:138
msgid "链接列表"
msgstr "Link List"
#: .\api\views_api.py:20
msgid "请求方式错误请使用POST方式。"
msgstr "Request method error! Please use the POST method."
#: .\api\views_api.py:34
msgid "帐号或密码错误请重试多次重试后将被锁定IP"
msgstr ""
"Account or password error! Please retry. After multiple retries, the IP will "
"be locked!"
#: .\api\views_api.py:72
msgid "请求方式错误!"
msgstr "Request method error!"
#: .\api\views_api.py:80
msgid "异常请求!"
msgstr "Abnormal request!"
#: .\api\views_api.py:93 .\api\views_api.py:213
msgid "错误的提交方式!"
msgstr "Incorrect submission method!"
#: .\api\views_api.py:121
msgid "拉取列表错误!"
msgstr "Error fetching list!"
#: .\api\views_api.py:200
msgid "更新地址簿有误"
msgstr "Error updating address book"
#: .\api\views_api.py:247 .\api\views_front.py:207 .\api\views_front.py:226
msgid "在线"
msgstr "Online"
#: .\api\views_api.py:308
msgid "好的"
msgstr "Okay"
#: .\api\views_front.py:50
msgid "model_to_dict接收的参数必须是模型对象"
msgstr "The parameter received by model_to_dict must be a model object"
#: .\api\views_front.py:55
#, python-brace-format
msgid "model_to_dict,要替换成{replace_field}字段已经存在了"
msgstr ""
"model_to_dict, the field to be replaced with {replace_field} already exists"
#: .\api\views_front.py:60
#, python-brace-format
msgid "model_to_dict,要新增默认值,但字段{default_key}已经存在了"
msgstr ""
"model_to_dict, to add default values, but the field {default_key} already "
"exists"
#: .\api\views_front.py:134
msgid "出了点问题,未获取用户名或密码。"
msgstr "There was a problem, username or password not obtained."
#: .\api\views_front.py:141
msgid "帐号或密码错误!"
msgstr "Account or password error!"
#: .\api\views_front.py:153
msgid "当前未开放注册,请联系管理员!"
msgstr "Registration is currently not open, please contact the administrator!"
#: .\api\views_front.py:160
msgid "用户名不得小于3位"
msgstr "Username must be at least 3 characters"
#: .\api\views_front.py:165
msgid "密码长度不符合要求, 应在8~20位。"
msgstr ""
"Password length does not meet requirements, should be between 8~20 "
"characters."
#: .\api\views_front.py:171
msgid "用户名已存在。"
msgstr "Username already exists."
#: .\api\views_front.py:207 .\api\views_front.py:226
msgid "离线"
msgstr "Offline"
#: .\api\views_front.py:210
msgid "是"
msgstr "Yes"
#: .\api\views_front.py:210
msgid "否"
msgstr "No"
#: .\api\views_front.py:252
msgid "设备信息表"
msgstr "Device Information Table"
#: .\api\views_front.py:351
msgid "数据为空。"
msgstr "Data is empty."
#: .\api\views_front.py:373 .\api\views_front.py:378 .\api\views_front.py:409
#: .\api\views_front.py:414
msgid "UNKNOWN"
msgstr ""
#~ msgid "未知"
#~ msgstr "UNKNOWN"

View File

@ -1,3 +1 @@
django
xlwt
mysqlclient
django

2
run.sh
View File

@ -7,6 +7,4 @@ if [ ! -e "./db/db.sqlite3" ]; then
echo "首次运行,初始化数据库"
fi
python manage.py makemigrations
python manage.py migrate
python manage.py runserver $HOST:21114;

View File

@ -30,23 +30,7 @@ ID_SERVER = os.environ.get("ID_SERVER", '')
DEBUG = os.environ.get("DEBUG", False)
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
ALLOWED_HOSTS = ["*"]
AUTH_USER_MODEL = 'api.UserProfile' # AppName.自定义user
ALLOW_REGISTRATION = os.environ.get("ALLOW_REGISTRATION", "True") # 是否允许注册, True为允许False为不允许
ALLOW_REGISTRATION = True if ALLOW_REGISTRATION.lower() == 'true' else False
# ==========数据库配置 开始=====================
DATABASE_TYPE = os.environ.get("DATABASE_TYPE", 'SQLITE')
MYSQL_DBNAME = os.environ.get("MYSQL_DBNAME", '-')
MYSQL_HOST = os.environ.get("MYSQL_HOST", '127.0.0.1')
MYSQL_USER = os.environ.get("MYSQL_USER", '-')
MYSQL_PASSWORD = os.environ.get("MYSQL_PASSWORD", '-')
MYSQL_PORT = os.environ.get("MYSQL_PORT", '3306')
# ==========数据库配置 结束=====================
LANGUAGE_CODE = os.environ.get("LANGUAGE_CODE", 'zh-hans')
# #LANGUAGE_CODE = os.environ.get("LANGUAGE_CODE", 'en')
AUTH_USER_MODEL = 'api.UserProfile' #AppName.自定义user
# Application definition
@ -64,9 +48,8 @@ INSTALLED_APPS = [
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
# 'django.middleware.csrf.CsrfViewMiddleware', # 取消post的验证。
#'django.middleware.csrf.CsrfViewMiddleware', # 取消post的验证。
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
@ -97,26 +80,13 @@ WSGI_APPLICATION = 'rustdesk_server_api.wsgi.application'
# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db/db.sqlite3',
}
}
if DATABASE_TYPE == 'MYSQL' and MYSQL_DBNAME != '-' and MYSQL_USER != '-' and MYSQL_PASSWORD != '-':
# 简单通过数据库名、账密信息过滤下防止用户未配置mysql却使用mysql
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': MYSQL_DBNAME, # 数据库名
'HOST': MYSQL_HOST, # 数据库服务器IP
'USER': MYSQL_USER, # 数据库用户名
'PASSWORD': MYSQL_PASSWORD, # 数据库密码
'PORT': MYSQL_PORT, # 端口
'OPTIONS': {'charset': 'utf8'},
}
}
# Password validation
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
@ -140,15 +110,14 @@ AUTH_PASSWORD_VALIDATORS = [
# Internationalization
# https://docs.djangoproject.com/en/3.1/topics/i18n/
# LANGUAGE_CODE = 'zh-hans'
LANGUAGE_CODE = 'zh-hans'
TIME_ZONE = 'Asia/Shanghai'
USE_I18N = True
USE_L10N = True
# USE_TZ = True
#USE_TZ = True
USE_TZ = False
@ -161,14 +130,6 @@ if DEBUG:
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
else:
STATIC_ROOT = os.path.join(BASE_DIR, 'static') # 新增
LANGUAGES = (
('zh-hans', '中文简体'),
('en', 'English'),
)
LOCALE_PATHS = (
os.path.join(BASE_DIR, 'locale'),
)

View File

@ -25,10 +25,7 @@ else:
from django.conf.urls import url, include
from django.views import static ##新增
from django.conf import settings
urlpatterns = [
path('i18n/', include('django.conf.urls.i18n')),
path('admin/', admin.site.urls),
url(r'^$', index),
url(r'^api/', include('api.urls')),

View File

@ -0,0 +1 @@
{"assets/android.png":["assets/android.png"],"assets/gestures.ttf":["assets/gestures.ttf"],"assets/insecure.png":["assets/insecure.png"],"assets/insecure_relay.png":["assets/insecure_relay.png"],"assets/linux.png":["assets/linux.png"],"assets/mac.png":["assets/mac.png"],"assets/secure.png":["assets/secure.png"],"assets/secure_relay.png":["assets/secure_relay.png"],"assets/win.png":["assets/win.png"],"packages/cupertino_icons/assets/CupertinoIcons.ttf":["../fonts/CupertinoIcons.ttf"],"../js/no_sleep.js":["../js/no_sleep.js"]}

View File

@ -0,0 +1 @@
[{"family":"MaterialIcons","fonts":[{"asset":"fonts/MaterialIcons-Regular.otf"}]},{"family":"GestureIcons","fonts":[{"asset":"fonts/gestures.ttf"}]},{"family":"CupertinoIcons","fonts":[{"asset":"fonts/CupertinoIcons.ttf"}]}]

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,281 @@
var CanvasKitInit = (() => {
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
return (
function(CanvasKitInit) {
CanvasKitInit = CanvasKitInit || {};
null;var t;t||(t=typeof CanvasKitInit !== 'undefined' ? CanvasKitInit : {});var da=Object.assign,fa,ha;t.ready=new Promise(function(a,b){fa=a;ha=b});
(function(a){a.Vd=a.Vd||[];a.Vd.push(function(){a.MakeSWCanvasSurface=function(b){var c=b;if("CANVAS"!==c.tagName&&(c=document.getElementById(b),!c))throw"Canvas with id "+b+" was not found";if(b=a.MakeSurface(c.width,c.height))b.Nd=c;return b};a.MakeCanvasSurface||(a.MakeCanvasSurface=a.MakeSWCanvasSurface);a.MakeSurface=function(b,c){var f={width:b,height:c,colorType:a.ColorType.RGBA_8888,alphaType:a.AlphaType.Unpremul,colorSpace:a.ColorSpace.SRGB},h=b*c*4,l=a._malloc(h);if(f=a.Surface._makeRasterDirect(f,
l,4*b))f.Nd=null,f.Cf=b,f.zf=c,f.Bf=h,f.bf=l,f.getCanvas().clear(a.TRANSPARENT);return f};a.MakeRasterDirectSurface=function(b,c,f){return a.Surface._makeRasterDirect(b,c.byteOffset,f)};a.Surface.prototype.flush=function(b){a.Od(this.Md);this._flush();if(this.Nd){var c=new Uint8ClampedArray(a.HEAPU8.buffer,this.bf,this.Bf);c=new ImageData(c,this.Cf,this.zf);b?this.Nd.getContext("2d").putImageData(c,0,0,b[0],b[1],b[2]-b[0],b[3]-b[1]):this.Nd.getContext("2d").putImageData(c,0,0)}};a.Surface.prototype.dispose=
function(){this.bf&&a._free(this.bf);this.delete()};a.Od=a.Od||function(){}})})(t);
(function(a){a.Vd=a.Vd||[];a.Vd.push(function(){function b(l,n,q){return l&&l.hasOwnProperty(n)?l[n]:q}function c(l){var n=ka(la);la[n]=l;return n}function f(l){return l.naturalHeight||l.videoHeight||l.displayHeight||l.height}function h(l){return l.naturalWidth||l.videoWidth||l.displayWidth||l.width}a.GetWebGLContext=function(l,n){if(!l)throw"null canvas passed into makeWebGLContext";var q={alpha:b(n,"alpha",1),depth:b(n,"depth",1),stencil:b(n,"stencil",8),antialias:b(n,"antialias",0),premultipliedAlpha:b(n,
"premultipliedAlpha",1),preserveDrawingBuffer:b(n,"preserveDrawingBuffer",0),preferLowPowerToHighPerformance:b(n,"preferLowPowerToHighPerformance",0),failIfMajorPerformanceCaveat:b(n,"failIfMajorPerformanceCaveat",0),enableExtensionsByDefault:b(n,"enableExtensionsByDefault",1),explicitSwapControl:b(n,"explicitSwapControl",0),renderViaOffscreenBackBuffer:b(n,"renderViaOffscreenBackBuffer",0)};q.majorVersion=n&&n.majorVersion?n.majorVersion:"undefined"!==typeof WebGL2RenderingContext?2:1;if(q.explicitSwapControl)throw"explicitSwapControl is not supported";
l=ma(l,q);if(!l)return 0;na(l);return l};a.deleteContext=function(l){v===qa[l]&&(v=null);"object"===typeof JSEvents&&JSEvents.Hg(qa[l].je.canvas);qa[l]&&qa[l].je.canvas&&(qa[l].je.canvas.yf=void 0);qa[l]=null};a._setTextureCleanup({deleteTexture:function(l,n){var q=la[n];q&&qa[l].je.deleteTexture(q);la[n]=null}});a.MakeGrContext=function(l){if(!this.Od(l))return null;var n=this._MakeGrContext();if(!n)return null;n.Md=l;return n};a.MakeOnScreenGLSurface=function(l,n,q,w){if(!this.Od(l.Md))return null;
n=this._MakeOnScreenGLSurface(l,n,q,w);if(!n)return null;n.Md=l.Md;return n};a.MakeRenderTarget=function(){var l=arguments[0];if(!this.Od(l.Md))return null;if(3===arguments.length){var n=this._MakeRenderTargetWH(l,arguments[1],arguments[2]);if(!n)return null}else if(2===arguments.length){if(n=this._MakeRenderTargetII(l,arguments[1]),!n)return null}else return null;n.Md=l.Md;return n};a.MakeWebGLCanvasSurface=function(l,n,q){n=n||null;var w=l,x="undefined"!==typeof OffscreenCanvas&&w instanceof OffscreenCanvas;
if(!("undefined"!==typeof HTMLCanvasElement&&w instanceof HTMLCanvasElement||x||(w=document.getElementById(l),w)))throw"Canvas with id "+l+" was not found";l=this.GetWebGLContext(w,q);if(!l||0>l)throw"failed to create webgl context: err "+l;l=this.MakeGrContext(l);n=this.MakeOnScreenGLSurface(l,w.width,w.height,n);return n?n:(n=w.cloneNode(!0),w.parentNode.replaceChild(n,w),n.classList.add("ck-replaced"),a.MakeSWCanvasSurface(n))};a.MakeCanvasSurface=a.MakeWebGLCanvasSurface;a.Surface.prototype.makeImageFromTexture=
function(l,n){a.Od(this.Md);l=c(l);if(n=this._makeImageFromTexture(this.Md,l,n))n.Ke=l;return n};a.Surface.prototype.makeImageFromTextureSource=function(l,n){n||(n={height:f(l),width:h(l),colorType:a.ColorType.RGBA_8888,alphaType:a.AlphaType.Unpremul});n.colorSpace||(n.colorSpace=a.ColorSpace.SRGB);a.Od(this.Md);var q=v.je,w=q.createTexture();q.bindTexture(q.TEXTURE_2D,w);2===v.version?q.texImage2D(q.TEXTURE_2D,0,q.RGBA,n.width,n.height,0,q.RGBA,q.UNSIGNED_BYTE,l):q.texImage2D(q.TEXTURE_2D,0,q.RGBA,
q.RGBA,q.UNSIGNED_BYTE,l);q.bindTexture(q.TEXTURE_2D,null);return this.makeImageFromTexture(w,n)};a.Surface.prototype.updateTextureFromSource=function(l,n){if(l.Ke){a.Od(this.Md);var q=v.je,w=la[l.Ke];q.bindTexture(q.TEXTURE_2D,w);2===v.version?q.texImage2D(q.TEXTURE_2D,0,q.RGBA,h(n),f(n),0,q.RGBA,q.UNSIGNED_BYTE,n):q.texImage2D(q.TEXTURE_2D,0,q.RGBA,q.RGBA,q.UNSIGNED_BYTE,n);q.bindTexture(q.TEXTURE_2D,null);this._resetContext();la[l.Ke]=null;l.Ke=c(w);n=l.getImageInfo();n.colorSpace=l.getColorSpace();
q=this._makeImageFromTexture(this.Md,l.Ke,n);w=l.Ld.Qd;var x=l.Ld.$d;l.Ld.Qd=q.Ld.Qd;l.Ld.$d=q.Ld.$d;q.Ld.Qd=w;q.Ld.$d=x;q.delete();n.colorSpace.delete()}};a.MakeLazyImageFromTextureSource=function(l,n){n||(n={height:f(l),width:h(l),colorType:a.ColorType.RGBA_8888,alphaType:a.AlphaType.Unpremul});n.colorSpace||(n.colorSpace=a.ColorSpace.SRGB);var q={makeTexture:function(){var w=v,x=w.je,J=x.createTexture();x.bindTexture(x.TEXTURE_2D,J);2===w.version?x.texImage2D(x.TEXTURE_2D,0,x.RGBA,n.width,n.height,
0,x.RGBA,x.UNSIGNED_BYTE,l):x.texImage2D(x.TEXTURE_2D,0,x.RGBA,x.RGBA,x.UNSIGNED_BYTE,l);x.bindTexture(x.TEXTURE_2D,null);return c(J)},freeSrc:function(){}};"VideoFrame"===l.constructor.name&&(q.freeSrc=function(){l.close()});return a.Image._makeFromGenerator(n,q)};a.Od=function(l){return l?na(l):!1}})})(t);
(function(a){function b(e,d,g,m,r){for(var y=0;y<e.length;y++)d[y*g+(y*r+m+g)%g]=e[y];return d}function c(e){for(var d=e*e,g=Array(d);d--;)g[d]=0===d%(e+1)?1:0;return g}function f(e){return e?e.constructor===Float32Array&&4===e.length:!1}function h(e){return(q(255*e[3])<<24|q(255*e[0])<<16|q(255*e[1])<<8|q(255*e[2])<<0)>>>0}function l(e){if(e&&e._ck)return e;if(e instanceof Float32Array){for(var d=Math.floor(e.length/4),g=new Uint32Array(d),m=0;m<d;m++)g[m]=h(e.slice(4*m,4*(m+1)));return g}if(e instanceof
Uint32Array)return e;if(e instanceof Array&&e[0]instanceof Float32Array)return e.map(h)}function n(e){if(void 0===e)return 1;var d=parseFloat(e);return e&&-1!==e.indexOf("%")?d/100:d}function q(e){return Math.round(Math.max(0,Math.min(e||0,255)))}function w(e,d){d&&d._ck||a._free(e)}function x(e,d,g){if(!e||!e.length)return V;if(e&&e._ck)return e.byteOffset;var m=a[d].BYTES_PER_ELEMENT;g||(g=a._malloc(e.length*m));a[d].set(e,g/m);return g}function J(e){var d={de:V,count:e.length,Le:a.ColorType.RGBA_F32};
if(e instanceof Float32Array)d.de=x(e,"HEAPF32"),d.count=e.length/4;else if(e instanceof Uint32Array)d.de=x(e,"HEAPU32"),d.Le=a.ColorType.RGBA_8888;else if(e instanceof Array){if(e&&e.length){for(var g=a._malloc(16*e.length),m=0,r=g/4,y=0;y<e.length;y++)for(var D=0;4>D;D++)a.HEAPF32[r+m]=e[y][D],m++;e=g}else e=V;d.de=e}else throw"Invalid argument to copyFlexibleColorArray, Not a color array "+typeof e;return d}function K(e){if(!e)return V;if(e.length){if(6===e.length||9===e.length)return x(e,"HEAPF32",
Oa),6===e.length&&a.HEAPF32.set(Fd,6+Oa/4),Oa;if(16===e.length){var d=yb.toTypedArray();d[0]=e[0];d[1]=e[1];d[2]=e[3];d[3]=e[4];d[4]=e[5];d[5]=e[7];d[6]=e[12];d[7]=e[13];d[8]=e[15];return Oa}throw"invalid matrix size";}d=yb.toTypedArray();d[0]=e.m11;d[1]=e.m21;d[2]=e.m41;d[3]=e.m12;d[4]=e.m22;d[5]=e.m42;d[6]=e.m14;d[7]=e.m24;d[8]=e.m44;return Oa}function Q(e){if(!e)return V;var d=Yb.toTypedArray();if(e.length){if(16!==e.length&&6!==e.length&&9!==e.length)throw"invalid matrix size";if(16===e.length)return x(e,
"HEAPF32",Za);d.fill(0);d[0]=e[0];d[1]=e[1];d[3]=e[2];d[4]=e[3];d[5]=e[4];d[7]=e[5];d[12]=e[6];d[13]=e[7];d[15]=e[8];6===e.length&&(d[12]=0,d[13]=0,d[15]=1);return Za}d[0]=e.m11;d[1]=e.m21;d[2]=e.m31;d[3]=e.m41;d[4]=e.m12;d[5]=e.m22;d[6]=e.m32;d[7]=e.m42;d[8]=e.m13;d[9]=e.m23;d[10]=e.m33;d[11]=e.m43;d[12]=e.m14;d[13]=e.m24;d[14]=e.m34;d[15]=e.m44;return Za}function A(e,d){return x(e,"HEAPF32",d||fb)}function L(e,d,g,m){var r=Zb.toTypedArray();r[0]=e;r[1]=d;r[2]=g;r[3]=m;return fb}function S(e){for(var d=
new Float32Array(4),g=0;4>g;g++)d[g]=a.HEAPF32[e/4+g];return d}function T(e,d){return x(e,"HEAPF32",d||ia)}function oa(e,d){return x(e,"HEAPF32",d||$b)}function ta(){for(var e=0,d=0;d<arguments.length-1;d+=2)e+=arguments[d]*arguments[d+1];return e}function gb(e,d,g){for(var m=Array(e.length),r=0;r<g;r++)for(var y=0;y<g;y++){for(var D=0,I=0;I<g;I++)D+=e[g*r+I]*d[g*I+y];m[r*g+y]=D}return m}function hb(e,d){for(var g=gb(d[0],d[1],e),m=2;m<d.length;)g=gb(g,d[m],e),m++;return g}a.Color=function(e,d,g,
m){void 0===m&&(m=1);return a.Color4f(q(e)/255,q(d)/255,q(g)/255,m)};a.ColorAsInt=function(e,d,g,m){void 0===m&&(m=255);return(q(m)<<24|q(e)<<16|q(d)<<8|q(g)<<0&268435455)>>>0};a.Color4f=function(e,d,g,m){void 0===m&&(m=1);return Float32Array.of(e,d,g,m)};Object.defineProperty(a,"TRANSPARENT",{get:function(){return a.Color4f(0,0,0,0)}});Object.defineProperty(a,"BLACK",{get:function(){return a.Color4f(0,0,0,1)}});Object.defineProperty(a,"WHITE",{get:function(){return a.Color4f(1,1,1,1)}});Object.defineProperty(a,
"RED",{get:function(){return a.Color4f(1,0,0,1)}});Object.defineProperty(a,"GREEN",{get:function(){return a.Color4f(0,1,0,1)}});Object.defineProperty(a,"BLUE",{get:function(){return a.Color4f(0,0,1,1)}});Object.defineProperty(a,"YELLOW",{get:function(){return a.Color4f(1,1,0,1)}});Object.defineProperty(a,"CYAN",{get:function(){return a.Color4f(0,1,1,1)}});Object.defineProperty(a,"MAGENTA",{get:function(){return a.Color4f(1,0,1,1)}});a.getColorComponents=function(e){return[Math.floor(255*e[0]),Math.floor(255*
e[1]),Math.floor(255*e[2]),e[3]]};a.parseColorString=function(e,d){e=e.toLowerCase();if(e.startsWith("#")){d=255;switch(e.length){case 9:d=parseInt(e.slice(7,9),16);case 7:var g=parseInt(e.slice(1,3),16);var m=parseInt(e.slice(3,5),16);var r=parseInt(e.slice(5,7),16);break;case 5:d=17*parseInt(e.slice(4,5),16);case 4:g=17*parseInt(e.slice(1,2),16),m=17*parseInt(e.slice(2,3),16),r=17*parseInt(e.slice(3,4),16)}return a.Color(g,m,r,d/255)}return e.startsWith("rgba")?(e=e.slice(5,-1),e=e.split(","),a.Color(+e[0],
+e[1],+e[2],n(e[3]))):e.startsWith("rgb")?(e=e.slice(4,-1),e=e.split(","),a.Color(+e[0],+e[1],+e[2],n(e[3]))):e.startsWith("gray(")||e.startsWith("hsl")||!d||(e=d[e],void 0===e)?a.BLACK:e};a.multiplyByAlpha=function(e,d){e=e.slice();e[3]=Math.max(0,Math.min(e[3]*d,1));return e};a.Malloc=function(e,d){var g=a._malloc(d*e.BYTES_PER_ELEMENT);return{_ck:!0,length:d,byteOffset:g,pe:null,subarray:function(m,r){m=this.toTypedArray().subarray(m,r);m._ck=!0;return m},toTypedArray:function(){if(this.pe&&this.pe.length)return this.pe;
this.pe=new e(a.HEAPU8.buffer,g,d);this.pe._ck=!0;return this.pe}}};a.Free=function(e){a._free(e.byteOffset);e.byteOffset=V;e.toTypedArray=null;e.pe=null};var Oa=V,yb,Za=V,Yb,fb=V,Zb,Ha,ia=V,Ic,Ta=V,Jc,ac=V,Kc,bc=V,Lc,cc=V,Mc,$b=V,Nc,Oc=V,Fd=Float32Array.of(0,0,1),V=0;a.onRuntimeInitialized=function(){function e(d,g,m,r,y,D){D||(D=4*r.width,r.colorType===a.ColorType.RGBA_F16?D*=2:r.colorType===a.ColorType.RGBA_F32&&(D*=4));var I=D*r.height;var N=y?y.byteOffset:a._malloc(I);if(!d._readPixels(r,N,D,
g,m))return y||a._free(N),null;if(y)return y.toTypedArray();switch(r.colorType){case a.ColorType.RGBA_8888:case a.ColorType.RGBA_F16:d=(new Uint8Array(a.HEAPU8.buffer,N,I)).slice();break;case a.ColorType.RGBA_F32:d=(new Float32Array(a.HEAPU8.buffer,N,I)).slice();break;default:return null}a._free(N);return d}Zb=a.Malloc(Float32Array,4);fb=Zb.byteOffset;Yb=a.Malloc(Float32Array,16);Za=Yb.byteOffset;yb=a.Malloc(Float32Array,9);Oa=yb.byteOffset;Mc=a.Malloc(Float32Array,12);$b=Mc.byteOffset;Nc=a.Malloc(Float32Array,
12);Oc=Nc.byteOffset;Ha=a.Malloc(Float32Array,4);ia=Ha.byteOffset;Ic=a.Malloc(Float32Array,4);Ta=Ic.byteOffset;Jc=a.Malloc(Float32Array,3);ac=Jc.byteOffset;Kc=a.Malloc(Float32Array,3);bc=Kc.byteOffset;Lc=a.Malloc(Int32Array,4);cc=Lc.byteOffset;a.ColorSpace.SRGB=a.ColorSpace._MakeSRGB();a.ColorSpace.DISPLAY_P3=a.ColorSpace._MakeDisplayP3();a.ColorSpace.ADOBE_RGB=a.ColorSpace._MakeAdobeRGB();a.GlyphRunFlags={IsWhiteSpace:a._GlyphRunFlags_isWhiteSpace};a.Path.MakeFromCmds=function(d){var g=x(d,"HEAPF32"),
m=a.Path._MakeFromCmds(g,d.length);w(g,d);return m};a.Path.MakeFromVerbsPointsWeights=function(d,g,m){var r=x(d,"HEAPU8"),y=x(g,"HEAPF32"),D=x(m,"HEAPF32"),I=a.Path._MakeFromVerbsPointsWeights(r,d.length,y,g.length,D,m&&m.length||0);w(r,d);w(y,g);w(D,m);return I};a.Path.prototype.addArc=function(d,g,m){d=T(d);this._addArc(d,g,m);return this};a.Path.prototype.addOval=function(d,g,m){void 0===m&&(m=1);d=T(d);this._addOval(d,!!g,m);return this};a.Path.prototype.addPath=function(){var d=Array.prototype.slice.call(arguments),
g=d[0],m=!1;"boolean"===typeof d[d.length-1]&&(m=d.pop());if(1===d.length)this._addPath(g,1,0,0,0,1,0,0,0,1,m);else if(2===d.length)d=d[1],this._addPath(g,d[0],d[1],d[2],d[3],d[4],d[5],d[6]||0,d[7]||0,d[8]||1,m);else if(7===d.length||10===d.length)this._addPath(g,d[1],d[2],d[3],d[4],d[5],d[6],d[7]||0,d[8]||0,d[9]||1,m);else return null;return this};a.Path.prototype.addPoly=function(d,g){var m=x(d,"HEAPF32");this._addPoly(m,d.length/2,g);w(m,d);return this};a.Path.prototype.addRect=function(d,g){d=
T(d);this._addRect(d,!!g);return this};a.Path.prototype.addRRect=function(d,g){d=oa(d);this._addRRect(d,!!g);return this};a.Path.prototype.addVerbsPointsWeights=function(d,g,m){var r=x(d,"HEAPU8"),y=x(g,"HEAPF32"),D=x(m,"HEAPF32");this._addVerbsPointsWeights(r,d.length,y,g.length,D,m&&m.length||0);w(r,d);w(y,g);w(D,m)};a.Path.prototype.arc=function(d,g,m,r,y,D){d=a.LTRBRect(d-m,g-m,d+m,g+m);y=(y-r)/Math.PI*180-360*!!D;D=new a.Path;D.addArc(d,r/Math.PI*180,y);this.addPath(D,!0);D.delete();return this};
a.Path.prototype.arcToOval=function(d,g,m,r){d=T(d);this._arcToOval(d,g,m,r);return this};a.Path.prototype.arcToRotated=function(d,g,m,r,y,D,I){this._arcToRotated(d,g,m,!!r,!!y,D,I);return this};a.Path.prototype.arcToTangent=function(d,g,m,r,y){this._arcToTangent(d,g,m,r,y);return this};a.Path.prototype.close=function(){this._close();return this};a.Path.prototype.conicTo=function(d,g,m,r,y){this._conicTo(d,g,m,r,y);return this};a.Path.prototype.computeTightBounds=function(d){this._computeTightBounds(ia);
var g=Ha.toTypedArray();return d?(d.set(g),d):g.slice()};a.Path.prototype.cubicTo=function(d,g,m,r,y,D){this._cubicTo(d,g,m,r,y,D);return this};a.Path.prototype.dash=function(d,g,m){return this._dash(d,g,m)?this:null};a.Path.prototype.getBounds=function(d){this._getBounds(ia);var g=Ha.toTypedArray();return d?(d.set(g),d):g.slice()};a.Path.prototype.lineTo=function(d,g){this._lineTo(d,g);return this};a.Path.prototype.moveTo=function(d,g){this._moveTo(d,g);return this};a.Path.prototype.offset=function(d,
g){this._transform(1,0,d,0,1,g,0,0,1);return this};a.Path.prototype.quadTo=function(d,g,m,r){this._quadTo(d,g,m,r);return this};a.Path.prototype.rArcTo=function(d,g,m,r,y,D,I){this._rArcTo(d,g,m,r,y,D,I);return this};a.Path.prototype.rConicTo=function(d,g,m,r,y){this._rConicTo(d,g,m,r,y);return this};a.Path.prototype.rCubicTo=function(d,g,m,r,y,D){this._rCubicTo(d,g,m,r,y,D);return this};a.Path.prototype.rLineTo=function(d,g){this._rLineTo(d,g);return this};a.Path.prototype.rMoveTo=function(d,g){this._rMoveTo(d,
g);return this};a.Path.prototype.rQuadTo=function(d,g,m,r){this._rQuadTo(d,g,m,r);return this};a.Path.prototype.stroke=function(d){d=d||{};d.width=d.width||1;d.miter_limit=d.miter_limit||4;d.cap=d.cap||a.StrokeCap.Butt;d.join=d.join||a.StrokeJoin.Miter;d.precision=d.precision||1;return this._stroke(d)?this:null};a.Path.prototype.transform=function(){if(1===arguments.length){var d=arguments[0];this._transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6]||0,d[7]||0,d[8]||1)}else if(6===arguments.length||9===
arguments.length)d=arguments,this._transform(d[0],d[1],d[2],d[3],d[4],d[5],d[6]||0,d[7]||0,d[8]||1);else throw"transform expected to take 1 or 9 arguments. Got "+arguments.length;return this};a.Path.prototype.trim=function(d,g,m){return this._trim(d,g,!!m)?this:null};a.Image.prototype.makeShaderCubic=function(d,g,m,r,y){y=K(y);return this._makeShaderCubic(d,g,m,r,y)};a.Image.prototype.makeShaderOptions=function(d,g,m,r,y){y=K(y);return this._makeShaderOptions(d,g,m,r,y)};a.Image.prototype.readPixels=
function(d,g,m,r,y){return e(this,d,g,m,r,y)};a.Canvas.prototype.clear=function(d){a.Od(this.Md);d=A(d);this._clear(d)};a.Canvas.prototype.clipRRect=function(d,g,m){a.Od(this.Md);d=oa(d);this._clipRRect(d,g,m)};a.Canvas.prototype.clipRect=function(d,g,m){a.Od(this.Md);d=T(d);this._clipRect(d,g,m)};a.Canvas.prototype.concat=function(d){a.Od(this.Md);d=Q(d);this._concat(d)};a.Canvas.prototype.drawArc=function(d,g,m,r,y){a.Od(this.Md);d=T(d);this._drawArc(d,g,m,r,y)};a.Canvas.prototype.drawAtlas=function(d,
g,m,r,y,D,I){if(d&&r&&g&&m&&g.length===m.length){a.Od(this.Md);y||(y=a.BlendMode.SrcOver);var N=x(g,"HEAPF32"),P=x(m,"HEAPF32"),W=m.length/4,u=x(l(D),"HEAPU32");if(I&&"B"in I&&"C"in I)this._drawAtlasCubic(d,P,N,u,W,y,I.B,I.C,r);else{let H=a.FilterMode.Linear,R=a.MipmapMode.None;I&&(H=I.filter,"mipmap"in I&&(R=I.mipmap));this._drawAtlasOptions(d,P,N,u,W,y,H,R,r)}w(N,g);w(P,m);w(u,D)}};a.Canvas.prototype.drawCircle=function(d,g,m,r){a.Od(this.Md);this._drawCircle(d,g,m,r)};a.Canvas.prototype.drawColor=
function(d,g){a.Od(this.Md);d=A(d);void 0!==g?this._drawColor(d,g):this._drawColor(d)};a.Canvas.prototype.drawColorInt=function(d,g){a.Od(this.Md);this._drawColorInt(d,g||a.BlendMode.SrcOver)};a.Canvas.prototype.drawColorComponents=function(d,g,m,r,y){a.Od(this.Md);d=L(d,g,m,r);void 0!==y?this._drawColor(d,y):this._drawColor(d)};a.Canvas.prototype.drawDRRect=function(d,g,m){a.Od(this.Md);d=oa(d,$b);g=oa(g,Oc);this._drawDRRect(d,g,m)};a.Canvas.prototype.drawGlyphs=function(d,g,m,r,y,D){if(!(2*d.length<=
g.length))throw"Not enough positions for the array of gyphs";a.Od(this.Md);const I=x(d,"HEAPU16"),N=x(g,"HEAPF32");this._drawGlyphs(d.length,I,N,m,r,y,D);w(N,g);w(I,d)};a.Canvas.prototype.drawImage=function(d,g,m,r){a.Od(this.Md);this._drawImage(d,g,m,r||null)};a.Canvas.prototype.drawImageCubic=function(d,g,m,r,y,D){a.Od(this.Md);this._drawImageCubic(d,g,m,r,y,D||null)};a.Canvas.prototype.drawImageOptions=function(d,g,m,r,y,D){a.Od(this.Md);this._drawImageOptions(d,g,m,r,y,D||null)};a.Canvas.prototype.drawImageNine=
function(d,g,m,r,y){a.Od(this.Md);g=x(g,"HEAP32",cc);m=T(m);this._drawImageNine(d,g,m,r,y||null)};a.Canvas.prototype.drawImageRect=function(d,g,m,r,y){a.Od(this.Md);T(g,ia);T(m,Ta);this._drawImageRect(d,ia,Ta,r,!!y)};a.Canvas.prototype.drawImageRectCubic=function(d,g,m,r,y,D){a.Od(this.Md);T(g,ia);T(m,Ta);this._drawImageRectCubic(d,ia,Ta,r,y,D||null)};a.Canvas.prototype.drawImageRectOptions=function(d,g,m,r,y,D){a.Od(this.Md);T(g,ia);T(m,Ta);this._drawImageRectOptions(d,ia,Ta,r,y,D||null)};a.Canvas.prototype.drawLine=
function(d,g,m,r,y){a.Od(this.Md);this._drawLine(d,g,m,r,y)};a.Canvas.prototype.drawOval=function(d,g){a.Od(this.Md);d=T(d);this._drawOval(d,g)};a.Canvas.prototype.drawPaint=function(d){a.Od(this.Md);this._drawPaint(d)};a.Canvas.prototype.drawParagraph=function(d,g,m){a.Od(this.Md);this._drawParagraph(d,g,m)};a.Canvas.prototype.drawPatch=function(d,g,m,r,y){if(24>d.length)throw"Need 12 cubic points";if(g&&4>g.length)throw"Need 4 colors";if(m&&8>m.length)throw"Need 4 shader coordinates";a.Od(this.Md);
const D=x(d,"HEAPF32"),I=g?x(l(g),"HEAPU32"):V,N=m?x(m,"HEAPF32"):V;r||(r=a.BlendMode.Modulate);this._drawPatch(D,I,N,r,y);w(N,m);w(I,g);w(D,d)};a.Canvas.prototype.drawPath=function(d,g){a.Od(this.Md);this._drawPath(d,g)};a.Canvas.prototype.drawPicture=function(d){a.Od(this.Md);this._drawPicture(d)};a.Canvas.prototype.drawPoints=function(d,g,m){a.Od(this.Md);var r=x(g,"HEAPF32");this._drawPoints(d,r,g.length/2,m);w(r,g)};a.Canvas.prototype.drawRRect=function(d,g){a.Od(this.Md);d=oa(d);this._drawRRect(d,
g)};a.Canvas.prototype.drawRect=function(d,g){a.Od(this.Md);d=T(d);this._drawRect(d,g)};a.Canvas.prototype.drawRect4f=function(d,g,m,r,y){a.Od(this.Md);this._drawRect4f(d,g,m,r,y)};a.Canvas.prototype.drawShadow=function(d,g,m,r,y,D,I){a.Od(this.Md);var N=x(y,"HEAPF32"),P=x(D,"HEAPF32");g=x(g,"HEAPF32",ac);m=x(m,"HEAPF32",bc);this._drawShadow(d,g,m,r,N,P,I);w(N,y);w(P,D)};a.getShadowLocalBounds=function(d,g,m,r,y,D,I){d=K(d);m=x(m,"HEAPF32",ac);r=x(r,"HEAPF32",bc);if(!this._getShadowLocalBounds(d,
g,m,r,y,D,ia))return null;g=Ha.toTypedArray();return I?(I.set(g),I):g.slice()};a.Canvas.prototype.drawTextBlob=function(d,g,m,r){a.Od(this.Md);this._drawTextBlob(d,g,m,r)};a.Canvas.prototype.drawVertices=function(d,g,m){a.Od(this.Md);this._drawVertices(d,g,m)};a.Canvas.prototype.getLocalToDevice=function(){this._getLocalToDevice(Za);for(var d=Za,g=Array(16),m=0;16>m;m++)g[m]=a.HEAPF32[d/4+m];return g};a.Canvas.prototype.getTotalMatrix=function(){this._getTotalMatrix(Oa);for(var d=Array(9),g=0;9>g;g++)d[g]=
a.HEAPF32[Oa/4+g];return d};a.Canvas.prototype.makeSurface=function(d){d=this._makeSurface(d);d.Md=this.Md;return d};a.Canvas.prototype.readPixels=function(d,g,m,r,y){a.Od(this.Md);return e(this,d,g,m,r,y)};a.Canvas.prototype.saveLayer=function(d,g,m,r){g=T(g);return this._saveLayer(d||null,g,m||null,r||0)};a.Canvas.prototype.writePixels=function(d,g,m,r,y,D,I,N){if(d.byteLength%(g*m))throw"pixels length must be a multiple of the srcWidth * srcHeight";a.Od(this.Md);var P=d.byteLength/(g*m);D=D||a.AlphaType.Unpremul;
I=I||a.ColorType.RGBA_8888;N=N||a.ColorSpace.SRGB;var W=P*g;P=x(d,"HEAPU8");g=this._writePixels({width:g,height:m,colorType:I,alphaType:D,colorSpace:N},P,W,r,y);w(P,d);return g};a.ColorFilter.MakeBlend=function(d,g){d=A(d);return a.ColorFilter._MakeBlend(d,g)};a.ColorFilter.MakeMatrix=function(d){if(!d||20!==d.length)throw"invalid color matrix";var g=x(d,"HEAPF32"),m=a.ColorFilter._makeMatrix(g);w(g,d);return m};a.ContourMeasure.prototype.getPosTan=function(d,g){this._getPosTan(d,ia);d=Ha.toTypedArray();
return g?(g.set(d),g):d.slice()};a.ImageFilter.MakeMatrixTransform=function(d,g,m){d=K(d);if("B"in g&&"C"in g)return a.ImageFilter._MakeMatrixTransformCubic(d,g.Ag,g.Bg,m);const r=g.filter;let y=a.MipmapMode.None;"mipmap"in g&&(y=g.mipmap);return a.ImageFilter._MakeMatrixTransformOptions(d,r,y,m)};a.Paint.prototype.getColor=function(){this._getColor(fb);return S(fb)};a.Paint.prototype.setColor=function(d,g){g=g||null;d=A(d);this._setColor(d,g)};a.Paint.prototype.setColorComponents=function(d,g,m,
r,y){y=y||null;d=L(d,g,m,r);this._setColor(d,y)};a.Path.prototype.getPoint=function(d,g){this._getPoint(d,ia);d=Ha.toTypedArray();return g?(g[0]=d[0],g[1]=d[1],g):d.slice(0,2)};a.PictureRecorder.prototype.beginRecording=function(d){d=T(d);return this._beginRecording(d)};a.Surface.prototype.getCanvas=function(){var d=this._getCanvas();d.Md=this.Md;return d};a.Surface.prototype.makeImageSnapshot=function(d){a.Od(this.Md);d=x(d,"HEAP32",cc);return this._makeImageSnapshot(d)};a.Surface.prototype.makeSurface=
function(d){a.Od(this.Md);d=this._makeSurface(d);d.Md=this.Md;return d};a.Surface.prototype.requestAnimationFrame=function(d,g){this.Ge||(this.Ge=this.getCanvas());requestAnimationFrame(function(){a.Od(this.Md);d(this.Ge);this.flush(g)}.bind(this))};a.Surface.prototype.drawOnce=function(d,g){this.Ge||(this.Ge=this.getCanvas());requestAnimationFrame(function(){a.Od(this.Md);d(this.Ge);this.flush(g);this.dispose()}.bind(this))};a.PathEffect.MakeDash=function(d,g){g||(g=0);if(!d.length||1===d.length%
2)throw"Intervals array must have even length";var m=x(d,"HEAPF32");g=a.PathEffect._MakeDash(m,d.length,g);w(m,d);return g};a.PathEffect.MakeLine2D=function(d,g){g=K(g);return a.PathEffect._MakeLine2D(d,g)};a.PathEffect.MakePath2D=function(d,g){d=K(d);return a.PathEffect._MakePath2D(d,g)};a.Shader.MakeColor=function(d,g){g=g||null;d=A(d);return a.Shader._MakeColor(d,g)};a.Shader.Blend=a.Shader.MakeBlend;a.Shader.Color=a.Shader.MakeColor;a.Shader.MakeLinearGradient=function(d,g,m,r,y,D,I,N){N=N||null;
var P=J(m),W=x(r,"HEAPF32");I=I||0;D=K(D);var u=Ha.toTypedArray();u.set(d);u.set(g,2);d=a.Shader._MakeLinearGradient(ia,P.de,P.Le,W,P.count,y,I,D,N);w(P.de,m);r&&w(W,r);return d};a.Shader.MakeRadialGradient=function(d,g,m,r,y,D,I,N){N=N||null;var P=J(m),W=x(r,"HEAPF32");I=I||0;D=K(D);d=a.Shader._MakeRadialGradient(d[0],d[1],g,P.de,P.Le,W,P.count,y,I,D,N);w(P.de,m);r&&w(W,r);return d};a.Shader.MakeSweepGradient=function(d,g,m,r,y,D,I,N,P,W){W=W||null;var u=J(m),H=x(r,"HEAPF32");I=I||0;N=N||0;P=P||
360;D=K(D);d=a.Shader._MakeSweepGradient(d,g,u.de,u.Le,H,u.count,y,N,P,I,D,W);w(u.de,m);r&&w(H,r);return d};a.Shader.MakeTwoPointConicalGradient=function(d,g,m,r,y,D,I,N,P,W){W=W||null;var u=J(y),H=x(D,"HEAPF32");P=P||0;N=K(N);var R=Ha.toTypedArray();R.set(d);R.set(m,2);d=a.Shader._MakeTwoPointConicalGradient(ia,g,r,u.de,u.Le,H,u.count,I,P,N,W);w(u.de,y);D&&w(H,D);return d};a.Vertices.prototype.bounds=function(d){this._bounds(ia);var g=Ha.toTypedArray();return d?(d.set(g),d):g.slice()};a.Vd&&a.Vd.forEach(function(d){d()})};
a.computeTonalColors=function(e){var d=x(e.ambient,"HEAPF32"),g=x(e.spot,"HEAPF32");this._computeTonalColors(d,g);var m={ambient:S(d),spot:S(g)};w(d,e.ambient);w(g,e.spot);return m};a.LTRBRect=function(e,d,g,m){return Float32Array.of(e,d,g,m)};a.XYWHRect=function(e,d,g,m){return Float32Array.of(e,d,e+g,d+m)};a.LTRBiRect=function(e,d,g,m){return Int32Array.of(e,d,g,m)};a.XYWHiRect=function(e,d,g,m){return Int32Array.of(e,d,e+g,d+m)};a.RRectXY=function(e,d,g){return Float32Array.of(e[0],e[1],e[2],e[3],
d,g,d,g,d,g,d,g)};a.MakeAnimatedImageFromEncoded=function(e){e=new Uint8Array(e);var d=a._malloc(e.byteLength);a.HEAPU8.set(e,d);return(e=a._decodeAnimatedImage(d,e.byteLength))?e:null};a.MakeImageFromEncoded=function(e){e=new Uint8Array(e);var d=a._malloc(e.byteLength);a.HEAPU8.set(e,d);return(e=a._decodeImage(d,e.byteLength))?e:null};var ib=null;a.MakeImageFromCanvasImageSource=function(e){var d=e.width,g=e.height;ib||(ib=document.createElement("canvas"));ib.width=d;ib.height=g;var m=ib.getContext("2d",
{Jg:!0});m.drawImage(e,0,0);e=m.getImageData(0,0,d,g);return a.MakeImage({width:d,height:g,alphaType:a.AlphaType.Unpremul,colorType:a.ColorType.RGBA_8888,colorSpace:a.ColorSpace.SRGB},e.data,4*d)};a.MakeImage=function(e,d,g){var m=a._malloc(d.length);a.HEAPU8.set(d,m);return a._MakeImage(e,m,d.length,g)};a.MakeVertices=function(e,d,g,m,r,y){var D=r&&r.length||0,I=0;g&&g.length&&(I|=1);m&&m.length&&(I|=2);void 0===y||y||(I|=4);e=new a._VerticesBuilder(e,d.length/2,D,I);x(d,"HEAPF32",e.positions());
e.texCoords()&&x(g,"HEAPF32",e.texCoords());e.colors()&&x(l(m),"HEAPU32",e.colors());e.indices()&&x(r,"HEAPU16",e.indices());return e.detach()};a.Matrix={};a.Matrix.identity=function(){return c(3)};a.Matrix.invert=function(e){var d=e[0]*e[4]*e[8]+e[1]*e[5]*e[6]+e[2]*e[3]*e[7]-e[2]*e[4]*e[6]-e[1]*e[3]*e[8]-e[0]*e[5]*e[7];return d?[(e[4]*e[8]-e[5]*e[7])/d,(e[2]*e[7]-e[1]*e[8])/d,(e[1]*e[5]-e[2]*e[4])/d,(e[5]*e[6]-e[3]*e[8])/d,(e[0]*e[8]-e[2]*e[6])/d,(e[2]*e[3]-e[0]*e[5])/d,(e[3]*e[7]-e[4]*e[6])/d,(e[1]*
e[6]-e[0]*e[7])/d,(e[0]*e[4]-e[1]*e[3])/d]:null};a.Matrix.mapPoints=function(e,d){for(var g=0;g<d.length;g+=2){var m=d[g],r=d[g+1],y=e[6]*m+e[7]*r+e[8],D=e[3]*m+e[4]*r+e[5];d[g]=(e[0]*m+e[1]*r+e[2])/y;d[g+1]=D/y}return d};a.Matrix.multiply=function(){return hb(3,arguments)};a.Matrix.rotated=function(e,d,g){d=d||0;g=g||0;var m=Math.sin(e);e=Math.cos(e);return[e,-m,ta(m,g,1-e,d),m,e,ta(-m,d,1-e,g),0,0,1]};a.Matrix.scaled=function(e,d,g,m){g=g||0;m=m||0;var r=b([e,d],c(3),3,0,1);return b([g-e*g,m-d*
m],r,3,2,0)};a.Matrix.skewed=function(e,d,g,m){g=g||0;m=m||0;var r=b([e,d],c(3),3,1,-1);return b([-e*g,-d*m],r,3,2,0)};a.Matrix.translated=function(e,d){return b(arguments,c(3),3,2,0)};a.Vector={};a.Vector.dot=function(e,d){return e.map(function(g,m){return g*d[m]}).reduce(function(g,m){return g+m})};a.Vector.lengthSquared=function(e){return a.Vector.dot(e,e)};a.Vector.length=function(e){return Math.sqrt(a.Vector.lengthSquared(e))};a.Vector.mulScalar=function(e,d){return e.map(function(g){return g*
d})};a.Vector.add=function(e,d){return e.map(function(g,m){return g+d[m]})};a.Vector.sub=function(e,d){return e.map(function(g,m){return g-d[m]})};a.Vector.dist=function(e,d){return a.Vector.length(a.Vector.sub(e,d))};a.Vector.normalize=function(e){return a.Vector.mulScalar(e,1/a.Vector.length(e))};a.Vector.cross=function(e,d){return[e[1]*d[2]-e[2]*d[1],e[2]*d[0]-e[0]*d[2],e[0]*d[1]-e[1]*d[0]]};a.M44={};a.M44.identity=function(){return c(4)};a.M44.translated=function(e){return b(e,c(4),4,3,0)};a.M44.scaled=
function(e){return b(e,c(4),4,0,1)};a.M44.rotated=function(e,d){return a.M44.rotatedUnitSinCos(a.Vector.normalize(e),Math.sin(d),Math.cos(d))};a.M44.rotatedUnitSinCos=function(e,d,g){var m=e[0],r=e[1];e=e[2];var y=1-g;return[y*m*m+g,y*m*r-d*e,y*m*e+d*r,0,y*m*r+d*e,y*r*r+g,y*r*e-d*m,0,y*m*e-d*r,y*r*e+d*m,y*e*e+g,0,0,0,0,1]};a.M44.lookat=function(e,d,g){d=a.Vector.normalize(a.Vector.sub(d,e));g=a.Vector.normalize(g);g=a.Vector.normalize(a.Vector.cross(d,g));var m=a.M44.identity();b(g,m,4,0,0);b(a.Vector.cross(g,
d),m,4,1,0);b(a.Vector.mulScalar(d,-1),m,4,2,0);b(e,m,4,3,0);e=a.M44.invert(m);return null===e?a.M44.identity():e};a.M44.perspective=function(e,d,g){var m=1/(d-e);g/=2;g=Math.cos(g)/Math.sin(g);return[g,0,0,0,0,g,0,0,0,0,(d+e)*m,2*d*e*m,0,0,-1,1]};a.M44.rc=function(e,d,g){return e[4*d+g]};a.M44.multiply=function(){return hb(4,arguments)};a.M44.invert=function(e){var d=e[0],g=e[4],m=e[8],r=e[12],y=e[1],D=e[5],I=e[9],N=e[13],P=e[2],W=e[6],u=e[10],H=e[14],R=e[3],aa=e[7],ja=e[11];e=e[15];var pa=d*D-g*
y,ua=d*I-m*y,Aa=d*N-r*y,ea=g*I-m*D,F=g*N-r*D,k=m*N-r*I,p=P*aa-W*R,z=P*ja-u*R,B=P*e-H*R,C=W*ja-u*aa,E=W*e-H*aa,M=u*e-H*ja,ba=pa*M-ua*E+Aa*C+ea*B-F*z+k*p,ca=1/ba;if(0===ba||Infinity===ca)return null;pa*=ca;ua*=ca;Aa*=ca;ea*=ca;F*=ca;k*=ca;p*=ca;z*=ca;B*=ca;C*=ca;E*=ca;M*=ca;d=[D*M-I*E+N*C,I*B-y*M-N*z,y*E-D*B+N*p,D*z-y*C-I*p,m*E-g*M-r*C,d*M-m*B+r*z,g*B-d*E-r*p,d*C-g*z+m*p,aa*k-ja*F+e*ea,ja*Aa-R*k-e*ua,R*F-aa*Aa+e*pa,aa*ua-R*ea-ja*pa,u*F-W*k-H*ea,P*k-u*Aa+H*ua,W*Aa-P*F-H*pa,P*ea-W*ua+u*pa];return d.every(function(Ia){return!isNaN(Ia)&&
Infinity!==Ia&&-Infinity!==Ia})?d:null};a.M44.transpose=function(e){return[e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15]]};a.M44.mustInvert=function(e){e=a.M44.invert(e);if(null===e)throw"Matrix not invertible";return e};a.M44.setupCamera=function(e,d,g){var m=a.M44.lookat(g.eye,g.coa,g.up);g=a.M44.perspective(g.near,g.far,g.angle);d=[(e[2]-e[0])/2,(e[3]-e[1])/2,d];e=a.M44.multiply(a.M44.translated([(e[0]+e[2])/2,(e[1]+e[3])/2,0]),a.M44.scaled(d));return a.M44.multiply(e,
g,m,a.M44.mustInvert(e))};a.ColorMatrix={};a.ColorMatrix.identity=function(){var e=new Float32Array(20);e[0]=1;e[6]=1;e[12]=1;e[18]=1;return e};a.ColorMatrix.scaled=function(e,d,g,m){var r=new Float32Array(20);r[0]=e;r[6]=d;r[12]=g;r[18]=m;return r};var Gd=[[6,7,11,12],[0,10,2,12],[0,1,5,6]];a.ColorMatrix.rotated=function(e,d,g){var m=a.ColorMatrix.identity();e=Gd[e];m[e[0]]=g;m[e[1]]=d;m[e[2]]=-d;m[e[3]]=g;return m};a.ColorMatrix.postTranslate=function(e,d,g,m,r){e[4]+=d;e[9]+=g;e[14]+=m;e[19]+=
r;return e};a.ColorMatrix.concat=function(e,d){for(var g=new Float32Array(20),m=0,r=0;20>r;r+=5){for(var y=0;4>y;y++)g[m++]=e[r]*d[y]+e[r+1]*d[y+5]+e[r+2]*d[y+10]+e[r+3]*d[y+15];g[m++]=e[r]*d[4]+e[r+1]*d[9]+e[r+2]*d[14]+e[r+3]*d[19]+e[r+4]}return g};(function(e){e.Vd=e.Vd||[];e.Vd.push(function(){function d(u){if(!u||!u.length)return[];for(var H=[],R=0;R<u.length;R+=5){var aa=e.LTRBRect(u[R],u[R+1],u[R+2],u[R+3]);aa.direction=0===u[R+4]?e.TextDirection.RTL:e.TextDirection.LTR;H.push(aa)}e._free(u.byteOffset);
return H}function g(u){u=u||{};void 0===u.weight&&(u.weight=e.FontWeight.Normal);u.width=u.width||e.FontWidth.Normal;u.slant=u.slant||e.FontSlant.Upright;return u}function m(u){if(!u||!u.length)return V;for(var H=[],R=0;R<u.length;R++){var aa=r(u[R]);H.push(aa)}return x(H,"HEAPU32")}function r(u){if(I[u])return I[u];var H=ra(u)+1,R=e._malloc(H);sa(u,G,R,H);return I[u]=R}function y(u){u._colorPtr=A(u.color);u._foregroundColorPtr=V;u._backgroundColorPtr=V;u._decorationColorPtr=V;u.foregroundColor&&
(u._foregroundColorPtr=A(u.foregroundColor,N));u.backgroundColor&&(u._backgroundColorPtr=A(u.backgroundColor,P));u.decorationColor&&(u._decorationColorPtr=A(u.decorationColor,W));Array.isArray(u.fontFamilies)&&u.fontFamilies.length?(u._fontFamiliesPtr=m(u.fontFamilies),u._fontFamiliesLen=u.fontFamilies.length):(u._fontFamiliesPtr=V,u._fontFamiliesLen=0);if(u.locale){var H=u.locale;u._localePtr=r(H);u._localeLen=ra(H)+1}else u._localePtr=V,u._localeLen=0;if(Array.isArray(u.shadows)&&u.shadows.length){H=
u.shadows;var R=H.map(function(ea){return ea.color||e.BLACK}),aa=H.map(function(ea){return ea.blurRadius||0});u._shadowLen=H.length;for(var ja=e._malloc(8*H.length),pa=ja/4,ua=0;ua<H.length;ua++){var Aa=H[ua].offset||[0,0];e.HEAPF32[pa]=Aa[0];e.HEAPF32[pa+1]=Aa[1];pa+=2}u._shadowColorsPtr=J(R).de;u._shadowOffsetsPtr=ja;u._shadowBlurRadiiPtr=x(aa,"HEAPF32")}else u._shadowLen=0,u._shadowColorsPtr=V,u._shadowOffsetsPtr=V,u._shadowBlurRadiiPtr=V;Array.isArray(u.fontFeatures)&&u.fontFeatures.length?(H=
u.fontFeatures,R=H.map(function(ea){return ea.name}),aa=H.map(function(ea){return ea.value}),u._fontFeatureLen=H.length,u._fontFeatureNamesPtr=m(R),u._fontFeatureValuesPtr=x(aa,"HEAPU32")):(u._fontFeatureLen=0,u._fontFeatureNamesPtr=V,u._fontFeatureValuesPtr=V)}function D(u){e._free(u._fontFamiliesPtr);e._free(u._shadowColorsPtr);e._free(u._shadowOffsetsPtr);e._free(u._shadowBlurRadiiPtr);e._free(u._fontFeatureNamesPtr);e._free(u._fontFeatureValuesPtr)}e.Paragraph.prototype.getRectsForRange=function(u,
H,R,aa){u=this._getRectsForRange(u,H,R,aa);return d(u)};e.Paragraph.prototype.getRectsForPlaceholders=function(){var u=this._getRectsForPlaceholders();return d(u)};e.TypefaceFontProvider.prototype.registerFont=function(u,H){u=e.Typeface.MakeFreeTypeFaceFromData(u);if(!u)return null;H=r(H);this._registerFont(u,H)};e.ParagraphStyle=function(u){u.disableHinting=u.disableHinting||!1;if(u.ellipsis){var H=u.ellipsis;u._ellipsisPtr=r(H);u._ellipsisLen=ra(H)+1}else u._ellipsisPtr=V,u._ellipsisLen=0;u.heightMultiplier=
u.heightMultiplier||0;u.maxLines=u.maxLines||0;H=(H=u.strutStyle)||{};H.strutEnabled=H.strutEnabled||!1;H.strutEnabled&&Array.isArray(H.fontFamilies)&&H.fontFamilies.length?(H._fontFamiliesPtr=m(H.fontFamilies),H._fontFamiliesLen=H.fontFamilies.length):(H._fontFamiliesPtr=V,H._fontFamiliesLen=0);H.fontStyle=g(H.fontStyle);H.fontSize=H.fontSize||0;H.heightMultiplier=H.heightMultiplier||0;H.halfLeading=H.halfLeading||!1;H.leading=H.leading||0;H.forceStrutHeight=H.forceStrutHeight||!1;u.strutStyle=H;
u.textAlign=u.textAlign||e.TextAlign.Start;u.textDirection=u.textDirection||e.TextDirection.LTR;u.textHeightBehavior=u.textHeightBehavior||e.TextHeightBehavior.All;u.textStyle=e.TextStyle(u.textStyle);return u};e.TextStyle=function(u){u.color||(u.color=e.BLACK);u.decoration=u.decoration||0;u.decorationThickness=u.decorationThickness||0;u.decorationStyle=u.decorationStyle||e.DecorationStyle.Solid;u.textBaseline=u.textBaseline||e.TextBaseline.Alphabetic;u.fontSize=u.fontSize||0;u.letterSpacing=u.letterSpacing||
0;u.wordSpacing=u.wordSpacing||0;u.heightMultiplier=u.heightMultiplier||0;u.halfLeading=u.halfLeading||!1;u.fontStyle=g(u.fontStyle);return u};var I={},N=e._malloc(16),P=e._malloc(16),W=e._malloc(16);e.ParagraphBuilder.Make=function(u,H){y(u.textStyle);H=e.ParagraphBuilder._Make(u,H);D(u.textStyle);return H};e.ParagraphBuilder.MakeFromFontProvider=function(u,H){y(u.textStyle);H=e.ParagraphBuilder._MakeFromFontProvider(u,H);D(u.textStyle);return H};e.ParagraphBuilder.ShapeText=function(u,H,R){let aa=
0;for(const ja of H)aa+=ja.length;if(aa!==u.length)throw"Accumulated block lengths must equal text.length";return e.ParagraphBuilder._ShapeText(u,H,R)};e.ParagraphBuilder.prototype.pushStyle=function(u){y(u);this._pushStyle(u);D(u)};e.ParagraphBuilder.prototype.pushPaintStyle=function(u,H,R){y(u);this._pushPaintStyle(u,H,R);D(u)};e.ParagraphBuilder.prototype.addPlaceholder=function(u,H,R,aa,ja){R=R||e.PlaceholderAlignment.Baseline;aa=aa||e.TextBaseline.Alphabetic;this._addPlaceholder(u||0,H||0,R,
aa,ja||0)}})})(t);a.Vd=a.Vd||[];a.Vd.push(function(){a.Path.prototype.op=function(e,d){return this._op(e,d)?this:null};a.Path.prototype.simplify=function(){return this._simplify()?this:null}});a.Vd=a.Vd||[];a.Vd.push(function(){a.Canvas.prototype.drawText=function(e,d,g,m,r){var y=ra(e),D=a._malloc(y+1);sa(e,G,D,y+1);this._drawSimpleText(D,y,d,g,r,m);a._free(D)};a.Font.prototype.getGlyphBounds=function(e,d,g){var m=x(e,"HEAPU16"),r=a._malloc(16*e.length);this._getGlyphWidthBounds(m,e.length,V,r,d||
null);d=new Float32Array(a.HEAPU8.buffer,r,4*e.length);w(m,e);if(g)return g.set(d),a._free(r),g;e=Float32Array.from(d);a._free(r);return e};a.Font.prototype.getGlyphIDs=function(e,d,g){d||(d=e.length);var m=ra(e)+1,r=a._malloc(m);sa(e,G,r,m);e=a._malloc(2*d);d=this._getGlyphIDs(r,m-1,d,e);a._free(r);if(0>d)return a._free(e),null;r=new Uint16Array(a.HEAPU8.buffer,e,d);if(g)return g.set(r),a._free(e),g;g=Uint16Array.from(r);a._free(e);return g};a.Font.prototype.getGlyphIntercepts=function(e,d,g,m){var r=
x(e,"HEAPU16"),y=x(d,"HEAPF32");return this._getGlyphIntercepts(r,e.length,!(e&&e._ck),y,d.length,!(d&&d._ck),g,m)};a.Font.prototype.getGlyphWidths=function(e,d,g){var m=x(e,"HEAPU16"),r=a._malloc(4*e.length);this._getGlyphWidthBounds(m,e.length,r,V,d||null);d=new Float32Array(a.HEAPU8.buffer,r,e.length);w(m,e);if(g)return g.set(d),a._free(r),g;e=Float32Array.from(d);a._free(r);return e};a.FontMgr.FromData=function(){if(!arguments.length)return null;var e=arguments;1===e.length&&Array.isArray(e[0])&&
(e=arguments[0]);if(!e.length)return null;for(var d=[],g=[],m=0;m<e.length;m++){var r=new Uint8Array(e[m]),y=x(r,"HEAPU8");d.push(y);g.push(r.byteLength)}d=x(d,"HEAPU32");g=x(g,"HEAPU32");e=a.FontMgr._fromData(d,g,e.length);a._free(d);a._free(g);return e};a.Typeface.MakeFreeTypeFaceFromData=function(e){e=new Uint8Array(e);var d=x(e,"HEAPU8");return(e=a.Typeface._MakeFreeTypeFaceFromData(d,e.byteLength))?e:null};a.Typeface.prototype.getGlyphIDs=function(e,d,g){d||(d=e.length);var m=ra(e)+1,r=a._malloc(m);
sa(e,G,r,m);e=a._malloc(2*d);d=this._getGlyphIDs(r,m-1,d,e);a._free(r);if(0>d)return a._free(e),null;r=new Uint16Array(a.HEAPU8.buffer,e,d);if(g)return g.set(r),a._free(e),g;g=Uint16Array.from(r);a._free(e);return g};a.TextBlob.MakeOnPath=function(e,d,g,m){if(e&&e.length&&d&&d.countPoints()){if(1===d.countPoints())return this.MakeFromText(e,g);m||(m=0);var r=g.getGlyphIDs(e);r=g.getGlyphWidths(r);var y=[];d=new a.ContourMeasureIter(d,!1,1);for(var D=d.next(),I=new Float32Array(4),N=0;N<e.length&&
D;N++){var P=r[N];m+=P/2;if(m>D.length()){D.delete();D=d.next();if(!D){e=e.substring(0,N);break}m=P/2}D.getPosTan(m,I);var W=I[2],u=I[3];y.push(W,u,I[0]-P/2*W,I[1]-P/2*u);m+=P/2}e=this.MakeFromRSXform(e,y,g);D&&D.delete();d.delete();return e}};a.TextBlob.MakeFromRSXform=function(e,d,g){var m=ra(e)+1,r=a._malloc(m);sa(e,G,r,m);e=x(d,"HEAPF32");g=a.TextBlob._MakeFromRSXform(r,m-1,e,g);a._free(r);return g?g:null};a.TextBlob.MakeFromRSXformGlyphs=function(e,d,g){var m=x(e,"HEAPU16");d=x(d,"HEAPF32");
g=a.TextBlob._MakeFromRSXformGlyphs(m,2*e.length,d,g);w(m,e);return g?g:null};a.TextBlob.MakeFromGlyphs=function(e,d){var g=x(e,"HEAPU16");d=a.TextBlob._MakeFromGlyphs(g,2*e.length,d);w(g,e);return d?d:null};a.TextBlob.MakeFromText=function(e,d){var g=ra(e)+1,m=a._malloc(g);sa(e,G,m,g);e=a.TextBlob._MakeFromText(m,g-1,d);a._free(m);return e?e:null};a.MallocGlyphIDs=function(e){return a.Malloc(Uint16Array,e)}});a.Vd=a.Vd||[];a.Vd.push(function(){a.MakePicture=function(e){e=new Uint8Array(e);var d=
a._malloc(e.byteLength);a.HEAPU8.set(e,d);return(e=a._MakePicture(d,e.byteLength))?e:null}});(function(){function e(F){for(var k=0;k<F.length;k++)if(void 0!==F[k]&&!Number.isFinite(F[k]))return!1;return!0}function d(F){var k=a.getColorComponents(F);F=k[0];var p=k[1],z=k[2];k=k[3];if(1===k)return F=F.toString(16).toLowerCase(),p=p.toString(16).toLowerCase(),z=z.toString(16).toLowerCase(),F=1===F.length?"0"+F:F,p=1===p.length?"0"+p:p,z=1===z.length?"0"+z:z,"#"+F+p+z;k=0===k||1===k?k:k.toFixed(8);return"rgba("+
F+", "+p+", "+z+", "+k+")"}function g(F){return a.parseColorString(F,ua)}function m(F){F=Aa.exec(F);if(!F)return null;var k=parseFloat(F[4]),p=16;switch(F[5]){case "em":case "rem":p=16*k;break;case "pt":p=4*k/3;break;case "px":p=k;break;case "pc":p=16*k;break;case "in":p=96*k;break;case "cm":p=96*k/2.54;break;case "mm":p=96/25.4*k;break;case "q":p=96/25.4/4*k;break;case "%":p=16/75*k}return{style:F[1],variant:F[2],weight:F[3],sizePx:p,family:F[6].trim()}}function r(F){this.Nd=F;this.Rd=new a.Paint;
this.Rd.setAntiAlias(!0);this.Rd.setStrokeMiter(10);this.Rd.setStrokeCap(a.StrokeCap.Butt);this.Rd.setStrokeJoin(a.StrokeJoin.Miter);this.Re="10px monospace";this.ne=new a.Font(null,10);this.ne.setSubpixel(!0);this.ce=this.he=a.BLACK;this.ue=0;this.Ie=a.TRANSPARENT;this.we=this.ve=0;this.Je=this.ke=1;this.He=0;this.te=[];this.Pd=a.BlendMode.SrcOver;this.Rd.setStrokeWidth(this.Je);this.Rd.setBlendMode(this.Pd);this.Td=new a.Path;this.Ud=a.Matrix.identity();this.lf=[];this.Ae=[];this.me=function(){this.Td.delete();
this.Rd.delete();this.ne.delete();this.Ae.forEach(function(k){k.me()})};Object.defineProperty(this,"currentTransform",{enumerable:!0,get:function(){return{a:this.Ud[0],c:this.Ud[1],e:this.Ud[2],b:this.Ud[3],d:this.Ud[4],f:this.Ud[5]}},set:function(k){k.a&&this.setTransform(k.a,k.b,k.c,k.d,k.e,k.f)}});Object.defineProperty(this,"fillStyle",{enumerable:!0,get:function(){return f(this.ce)?d(this.ce):this.ce},set:function(k){"string"===typeof k?this.ce=g(k):k.se&&(this.ce=k)}});Object.defineProperty(this,
"font",{enumerable:!0,get:function(){return this.Re},set:function(k){var p=m(k),z=p.family;p.typeface=ea[z]?ea[z][(p.style||"normal")+"|"+(p.variant||"normal")+"|"+(p.weight||"normal")]||ea[z]["*"]:null;p&&(this.ne.setSize(p.sizePx),this.ne.setTypeface(p.typeface),this.Re=k)}});Object.defineProperty(this,"globalAlpha",{enumerable:!0,get:function(){return this.ke},set:function(k){!isFinite(k)||0>k||1<k||(this.ke=k)}});Object.defineProperty(this,"globalCompositeOperation",{enumerable:!0,get:function(){switch(this.Pd){case a.BlendMode.SrcOver:return"source-over";
case a.BlendMode.DstOver:return"destination-over";case a.BlendMode.Src:return"copy";case a.BlendMode.Dst:return"destination";case a.BlendMode.Clear:return"clear";case a.BlendMode.SrcIn:return"source-in";case a.BlendMode.DstIn:return"destination-in";case a.BlendMode.SrcOut:return"source-out";case a.BlendMode.DstOut:return"destination-out";case a.BlendMode.SrcATop:return"source-atop";case a.BlendMode.DstATop:return"destination-atop";case a.BlendMode.Xor:return"xor";case a.BlendMode.Plus:return"lighter";
case a.BlendMode.Multiply:return"multiply";case a.BlendMode.Screen:return"screen";case a.BlendMode.Overlay:return"overlay";case a.BlendMode.Darken:return"darken";case a.BlendMode.Lighten:return"lighten";case a.BlendMode.ColorDodge:return"color-dodge";case a.BlendMode.ColorBurn:return"color-burn";case a.BlendMode.HardLight:return"hard-light";case a.BlendMode.SoftLight:return"soft-light";case a.BlendMode.Difference:return"difference";case a.BlendMode.Exclusion:return"exclusion";case a.BlendMode.Hue:return"hue";
case a.BlendMode.Saturation:return"saturation";case a.BlendMode.Color:return"color";case a.BlendMode.Luminosity:return"luminosity"}},set:function(k){switch(k){case "source-over":this.Pd=a.BlendMode.SrcOver;break;case "destination-over":this.Pd=a.BlendMode.DstOver;break;case "copy":this.Pd=a.BlendMode.Src;break;case "destination":this.Pd=a.BlendMode.Dst;break;case "clear":this.Pd=a.BlendMode.Clear;break;case "source-in":this.Pd=a.BlendMode.SrcIn;break;case "destination-in":this.Pd=a.BlendMode.DstIn;
break;case "source-out":this.Pd=a.BlendMode.SrcOut;break;case "destination-out":this.Pd=a.BlendMode.DstOut;break;case "source-atop":this.Pd=a.BlendMode.SrcATop;break;case "destination-atop":this.Pd=a.BlendMode.DstATop;break;case "xor":this.Pd=a.BlendMode.Xor;break;case "lighter":this.Pd=a.BlendMode.Plus;break;case "plus-lighter":this.Pd=a.BlendMode.Plus;break;case "plus-darker":throw"plus-darker is not supported";case "multiply":this.Pd=a.BlendMode.Multiply;break;case "screen":this.Pd=a.BlendMode.Screen;
break;case "overlay":this.Pd=a.BlendMode.Overlay;break;case "darken":this.Pd=a.BlendMode.Darken;break;case "lighten":this.Pd=a.BlendMode.Lighten;break;case "color-dodge":this.Pd=a.BlendMode.ColorDodge;break;case "color-burn":this.Pd=a.BlendMode.ColorBurn;break;case "hard-light":this.Pd=a.BlendMode.HardLight;break;case "soft-light":this.Pd=a.BlendMode.SoftLight;break;case "difference":this.Pd=a.BlendMode.Difference;break;case "exclusion":this.Pd=a.BlendMode.Exclusion;break;case "hue":this.Pd=a.BlendMode.Hue;
break;case "saturation":this.Pd=a.BlendMode.Saturation;break;case "color":this.Pd=a.BlendMode.Color;break;case "luminosity":this.Pd=a.BlendMode.Luminosity;break;default:return}this.Rd.setBlendMode(this.Pd)}});Object.defineProperty(this,"imageSmoothingEnabled",{enumerable:!0,get:function(){return!0},set:function(){}});Object.defineProperty(this,"imageSmoothingQuality",{enumerable:!0,get:function(){return"high"},set:function(){}});Object.defineProperty(this,"lineCap",{enumerable:!0,get:function(){switch(this.Rd.getStrokeCap()){case a.StrokeCap.Butt:return"butt";
case a.StrokeCap.Round:return"round";case a.StrokeCap.Square:return"square"}},set:function(k){switch(k){case "butt":this.Rd.setStrokeCap(a.StrokeCap.Butt);break;case "round":this.Rd.setStrokeCap(a.StrokeCap.Round);break;case "square":this.Rd.setStrokeCap(a.StrokeCap.Square)}}});Object.defineProperty(this,"lineDashOffset",{enumerable:!0,get:function(){return this.He},set:function(k){isFinite(k)&&(this.He=k)}});Object.defineProperty(this,"lineJoin",{enumerable:!0,get:function(){switch(this.Rd.getStrokeJoin()){case a.StrokeJoin.Miter:return"miter";
case a.StrokeJoin.Round:return"round";case a.StrokeJoin.Bevel:return"bevel"}},set:function(k){switch(k){case "miter":this.Rd.setStrokeJoin(a.StrokeJoin.Miter);break;case "round":this.Rd.setStrokeJoin(a.StrokeJoin.Round);break;case "bevel":this.Rd.setStrokeJoin(a.StrokeJoin.Bevel)}}});Object.defineProperty(this,"lineWidth",{enumerable:!0,get:function(){return this.Rd.getStrokeWidth()},set:function(k){0>=k||!k||(this.Je=k,this.Rd.setStrokeWidth(k))}});Object.defineProperty(this,"miterLimit",{enumerable:!0,
get:function(){return this.Rd.getStrokeMiter()},set:function(k){0>=k||!k||this.Rd.setStrokeMiter(k)}});Object.defineProperty(this,"shadowBlur",{enumerable:!0,get:function(){return this.ue},set:function(k){0>k||!isFinite(k)||(this.ue=k)}});Object.defineProperty(this,"shadowColor",{enumerable:!0,get:function(){return d(this.Ie)},set:function(k){this.Ie=g(k)}});Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,get:function(){return this.ve},set:function(k){isFinite(k)&&(this.ve=k)}});Object.defineProperty(this,
"shadowOffsetY",{enumerable:!0,get:function(){return this.we},set:function(k){isFinite(k)&&(this.we=k)}});Object.defineProperty(this,"strokeStyle",{enumerable:!0,get:function(){return d(this.he)},set:function(k){"string"===typeof k?this.he=g(k):k.se&&(this.he=k)}});this.arc=function(k,p,z,B,C,E){H(this.Td,k,p,z,z,0,B,C,E)};this.arcTo=function(k,p,z,B,C){P(this.Td,k,p,z,B,C)};this.beginPath=function(){this.Td.delete();this.Td=new a.Path};this.bezierCurveTo=function(k,p,z,B,C,E){var M=this.Td;e([k,
p,z,B,C,E])&&(M.isEmpty()&&M.moveTo(k,p),M.cubicTo(k,p,z,B,C,E))};this.clearRect=function(k,p,z,B){this.Rd.setStyle(a.PaintStyle.Fill);this.Rd.setBlendMode(a.BlendMode.Clear);this.Nd.drawRect(a.XYWHRect(k,p,z,B),this.Rd);this.Rd.setBlendMode(this.Pd)};this.clip=function(k,p){"string"===typeof k?(p=k,k=this.Td):k&&k.af&&(k=k.Wd);k||(k=this.Td);k=k.copy();p&&"evenodd"===p.toLowerCase()?k.setFillType(a.FillType.EvenOdd):k.setFillType(a.FillType.Winding);this.Nd.clipPath(k,a.ClipOp.Intersect,!0);k.delete()};
this.closePath=function(){W(this.Td)};this.createImageData=function(){if(1===arguments.length){var k=arguments[0];return new I(new Uint8ClampedArray(4*k.width*k.height),k.width,k.height)}if(2===arguments.length){k=arguments[0];var p=arguments[1];return new I(new Uint8ClampedArray(4*k*p),k,p)}throw"createImageData expects 1 or 2 arguments, got "+arguments.length;};this.createLinearGradient=function(k,p,z,B){if(e(arguments)){var C=new N(k,p,z,B);this.Ae.push(C);return C}};this.createPattern=function(k,
p){k=new ja(k,p);this.Ae.push(k);return k};this.createRadialGradient=function(k,p,z,B,C,E){if(e(arguments)){var M=new pa(k,p,z,B,C,E);this.Ae.push(M);return M}};this.drawImage=function(k){k instanceof D&&(k=k.tf());var p=this.Qe();if(3===arguments.length||5===arguments.length)var z=a.XYWHRect(arguments[1],arguments[2],arguments[3]||k.width(),arguments[4]||k.height()),B=a.XYWHRect(0,0,k.width(),k.height());else if(9===arguments.length)z=a.XYWHRect(arguments[5],arguments[6],arguments[7],arguments[8]),
B=a.XYWHRect(arguments[1],arguments[2],arguments[3],arguments[4]);else throw"invalid number of args for drawImage, need 3, 5, or 9; got "+arguments.length;this.Nd.drawImageRect(k,B,z,p,!1);p.dispose()};this.ellipse=function(k,p,z,B,C,E,M,ba){H(this.Td,k,p,z,B,C,E,M,ba)};this.Qe=function(){var k=this.Rd.copy();k.setStyle(a.PaintStyle.Fill);if(f(this.ce)){var p=a.multiplyByAlpha(this.ce,this.ke);k.setColor(p)}else p=this.ce.se(this.Ud),k.setColor(a.Color(0,0,0,this.ke)),k.setShader(p);k.dispose=function(){this.delete()};
return k};this.fill=function(k,p){"string"===typeof k?(p=k,k=this.Td):k&&k.af&&(k=k.Wd);if("evenodd"===p)this.Td.setFillType(a.FillType.EvenOdd);else{if("nonzero"!==p&&p)throw"invalid fill rule";this.Td.setFillType(a.FillType.Winding)}k||(k=this.Td);p=this.Qe();var z=this.xe(p);z&&(this.Nd.save(),this.qe(),this.Nd.drawPath(k,z),this.Nd.restore(),z.dispose());this.Nd.drawPath(k,p);p.dispose()};this.fillRect=function(k,p,z,B){var C=this.Qe(),E=this.xe(C);E&&(this.Nd.save(),this.qe(),this.Nd.drawRect(a.XYWHRect(k,
p,z,B),E),this.Nd.restore(),E.dispose());this.Nd.drawRect(a.XYWHRect(k,p,z,B),C);C.dispose()};this.fillText=function(k,p,z){var B=this.Qe();k=a.TextBlob.MakeFromText(k,this.ne);var C=this.xe(B);C&&(this.Nd.save(),this.qe(),this.Nd.drawTextBlob(k,p,z,C),this.Nd.restore(),C.dispose());this.Nd.drawTextBlob(k,p,z,B);k.delete();B.dispose()};this.getImageData=function(k,p,z,B){return(k=this.Nd.readPixels(k,p,{width:z,height:B,colorType:a.ColorType.RGBA_8888,alphaType:a.AlphaType.Unpremul,colorSpace:a.ColorSpace.SRGB}))?
new I(new Uint8ClampedArray(k.buffer),z,B):null};this.getLineDash=function(){return this.te.slice()};this.mf=function(k){var p=a.Matrix.invert(this.Ud);a.Matrix.mapPoints(p,k);return k};this.isPointInPath=function(k,p,z){var B=arguments;if(3===B.length)var C=this.Td;else if(4===B.length)C=B[0],k=B[1],p=B[2],z=B[3];else throw"invalid arg count, need 3 or 4, got "+B.length;if(!isFinite(k)||!isFinite(p))return!1;z=z||"nonzero";if("nonzero"!==z&&"evenodd"!==z)return!1;B=this.mf([k,p]);k=B[0];p=B[1];C.setFillType("nonzero"===
z?a.FillType.Winding:a.FillType.EvenOdd);return C.contains(k,p)};this.isPointInStroke=function(k,p){var z=arguments;if(2===z.length)var B=this.Td;else if(3===z.length)B=z[0],k=z[1],p=z[2];else throw"invalid arg count, need 2 or 3, got "+z.length;if(!isFinite(k)||!isFinite(p))return!1;z=this.mf([k,p]);k=z[0];p=z[1];B=B.copy();B.setFillType(a.FillType.Winding);B.stroke({width:this.lineWidth,miter_limit:this.miterLimit,cap:this.Rd.getStrokeCap(),join:this.Rd.getStrokeJoin(),precision:.3});z=B.contains(k,
p);B.delete();return z};this.lineTo=function(k,p){R(this.Td,k,p)};this.measureText=function(k){k=this.ne.getGlyphIDs(k);k=this.ne.getGlyphWidths(k);let p=0;for(const z of k)p+=z;return{width:p}};this.moveTo=function(k,p){var z=this.Td;e([k,p])&&z.moveTo(k,p)};this.putImageData=function(k,p,z,B,C,E,M){if(e([p,z,B,C,E,M]))if(void 0===B)this.Nd.writePixels(k.data,k.width,k.height,p,z);else if(B=B||0,C=C||0,E=E||k.width,M=M||k.height,0>E&&(B+=E,E=Math.abs(E)),0>M&&(C+=M,M=Math.abs(M)),0>B&&(E+=B,B=0),
0>C&&(M+=C,C=0),!(0>=E||0>=M)){k=a.MakeImage({width:k.width,height:k.height,alphaType:a.AlphaType.Unpremul,colorType:a.ColorType.RGBA_8888,colorSpace:a.ColorSpace.SRGB},k.data,4*k.width);var ba=a.XYWHRect(B,C,E,M);p=a.XYWHRect(p+B,z+C,E,M);z=a.Matrix.invert(this.Ud);this.Nd.save();this.Nd.concat(z);this.Nd.drawImageRect(k,ba,p,null,!1);this.Nd.restore();k.delete()}};this.quadraticCurveTo=function(k,p,z,B){var C=this.Td;e([k,p,z,B])&&(C.isEmpty()&&C.moveTo(k,p),C.quadTo(k,p,z,B))};this.rect=function(k,
p,z,B){var C=this.Td;k=a.XYWHRect(k,p,z,B);e(k)&&C.addRect(k)};this.resetTransform=function(){this.Td.transform(this.Ud);var k=a.Matrix.invert(this.Ud);this.Nd.concat(k);this.Ud=this.Nd.getTotalMatrix()};this.restore=function(){var k=this.lf.pop();if(k){var p=a.Matrix.multiply(this.Ud,a.Matrix.invert(k.Ff));this.Td.transform(p);this.Rd.delete();this.Rd=k.dg;this.te=k.$f;this.Je=k.vg;this.he=k.ug;this.ce=k.fs;this.ve=k.sg;this.we=k.tg;this.ue=k.hg;this.Ie=k.rg;this.ke=k.Nf;this.Pd=k.Of;this.He=k.ag;
this.Re=k.Mf;this.Nd.restore();this.Ud=this.Nd.getTotalMatrix()}};this.rotate=function(k){if(isFinite(k)){var p=a.Matrix.rotated(-k);this.Td.transform(p);this.Nd.rotate(k/Math.PI*180,0,0);this.Ud=this.Nd.getTotalMatrix()}};this.save=function(){if(this.ce.re){var k=this.ce.re();this.Ae.push(k)}else k=this.ce;if(this.he.re){var p=this.he.re();this.Ae.push(p)}else p=this.he;this.lf.push({Ff:this.Ud.slice(),$f:this.te.slice(),vg:this.Je,ug:p,fs:k,sg:this.ve,tg:this.we,hg:this.ue,rg:this.Ie,Nf:this.ke,
ag:this.He,Of:this.Pd,dg:this.Rd.copy(),Mf:this.Re});this.Nd.save()};this.scale=function(k,p){if(e(arguments)){var z=a.Matrix.scaled(1/k,1/p);this.Td.transform(z);this.Nd.scale(k,p);this.Ud=this.Nd.getTotalMatrix()}};this.setLineDash=function(k){for(var p=0;p<k.length;p++)if(!isFinite(k[p])||0>k[p])return;1===k.length%2&&Array.prototype.push.apply(k,k);this.te=k};this.setTransform=function(k,p,z,B,C,E){e(arguments)&&(this.resetTransform(),this.transform(k,p,z,B,C,E))};this.qe=function(){var k=a.Matrix.invert(this.Ud);
this.Nd.concat(k);this.Nd.concat(a.Matrix.translated(this.ve,this.we));this.Nd.concat(this.Ud)};this.xe=function(k){var p=a.multiplyByAlpha(this.Ie,this.ke);if(!a.getColorComponents(p)[3]||!(this.ue||this.we||this.ve))return null;k=k.copy();k.setColor(p);var z=a.MaskFilter.MakeBlur(a.BlurStyle.Normal,this.ue/2,!1);k.setMaskFilter(z);k.dispose=function(){z.delete();this.delete()};return k};this.cf=function(){var k=this.Rd.copy();k.setStyle(a.PaintStyle.Stroke);if(f(this.he)){var p=a.multiplyByAlpha(this.he,
this.ke);k.setColor(p)}else p=this.he.se(this.Ud),k.setColor(a.Color(0,0,0,this.ke)),k.setShader(p);k.setStrokeWidth(this.Je);if(this.te.length){var z=a.PathEffect.MakeDash(this.te,this.He);k.setPathEffect(z)}k.dispose=function(){z&&z.delete();this.delete()};return k};this.stroke=function(k){k=k?k.Wd:this.Td;var p=this.cf(),z=this.xe(p);z&&(this.Nd.save(),this.qe(),this.Nd.drawPath(k,z),this.Nd.restore(),z.dispose());this.Nd.drawPath(k,p);p.dispose()};this.strokeRect=function(k,p,z,B){var C=this.cf(),
E=this.xe(C);E&&(this.Nd.save(),this.qe(),this.Nd.drawRect(a.XYWHRect(k,p,z,B),E),this.Nd.restore(),E.dispose());this.Nd.drawRect(a.XYWHRect(k,p,z,B),C);C.dispose()};this.strokeText=function(k,p,z){var B=this.cf();k=a.TextBlob.MakeFromText(k,this.ne);var C=this.xe(B);C&&(this.Nd.save(),this.qe(),this.Nd.drawTextBlob(k,p,z,C),this.Nd.restore(),C.dispose());this.Nd.drawTextBlob(k,p,z,B);k.delete();B.dispose()};this.translate=function(k,p){if(e(arguments)){var z=a.Matrix.translated(-k,-p);this.Td.transform(z);
this.Nd.translate(k,p);this.Ud=this.Nd.getTotalMatrix()}};this.transform=function(k,p,z,B,C,E){k=[k,z,C,p,B,E,0,0,1];p=a.Matrix.invert(k);this.Td.transform(p);this.Nd.concat(k);this.Ud=this.Nd.getTotalMatrix()};this.addHitRegion=function(){};this.clearHitRegions=function(){};this.drawFocusIfNeeded=function(){};this.removeHitRegion=function(){};this.scrollPathIntoView=function(){};Object.defineProperty(this,"canvas",{value:null,writable:!1})}function y(F){this.df=F;this.Md=new r(F.getCanvas());this.Se=
[];this.decodeImage=function(k){k=a.MakeImageFromEncoded(k);if(!k)throw"Invalid input";this.Se.push(k);return new D(k)};this.loadFont=function(k,p){k=a.Typeface.MakeFreeTypeFaceFromData(k);if(!k)return null;this.Se.push(k);var z=(p.style||"normal")+"|"+(p.variant||"normal")+"|"+(p.weight||"normal");p=p.family;ea[p]||(ea[p]={"*":k});ea[p][z]=k};this.makePath2D=function(k){k=new aa(k);this.Se.push(k.Wd);return k};this.getContext=function(k){return"2d"===k?this.Md:null};this.toDataURL=function(k,p){this.df.flush();
var z=this.df.makeImageSnapshot();if(z){k=k||"image/png";var B=a.ImageFormat.PNG;"image/jpeg"===k&&(B=a.ImageFormat.JPEG);if(p=z.encodeToBytes(B,p||.92)){z.delete();k="data:"+k+";base64,";if("undefined"!==typeof Buffer)p=Buffer.from(p).toString("base64");else{z=0;B=p.length;for(var C="",E;z<B;)E=p.slice(z,Math.min(z+32768,B)),C+=String.fromCharCode.apply(null,E),z+=32768;p=btoa(C)}return k+p}}};this.dispose=function(){this.Md.me();this.Se.forEach(function(k){k.delete()});this.df.dispose()}}function D(F){this.width=
F.width();this.height=F.height();this.naturalWidth=this.width;this.naturalHeight=this.height;this.tf=function(){return F}}function I(F,k,p){if(!k||0===p)throw"invalid dimensions, width and height must be non-zero";if(F.length%4)throw"arr must be a multiple of 4";p=p||F.length/(4*k);Object.defineProperty(this,"data",{value:F,writable:!1});Object.defineProperty(this,"height",{value:p,writable:!1});Object.defineProperty(this,"width",{value:k,writable:!1})}function N(F,k,p,z){this.Yd=null;this.ee=[];
this.ae=[];this.addColorStop=function(B,C){if(0>B||1<B||!isFinite(B))throw"offset must be between 0 and 1 inclusively";C=g(C);var E=this.ae.indexOf(B);if(-1!==E)this.ee[E]=C;else{for(E=0;E<this.ae.length&&!(this.ae[E]>B);E++);this.ae.splice(E,0,B);this.ee.splice(E,0,C)}};this.re=function(){var B=new N(F,k,p,z);B.ee=this.ee.slice();B.ae=this.ae.slice();return B};this.me=function(){this.Yd&&(this.Yd.delete(),this.Yd=null)};this.se=function(B){var C=[F,k,p,z];a.Matrix.mapPoints(B,C);B=C[0];var E=C[1],
M=C[2];C=C[3];this.me();return this.Yd=a.Shader.MakeLinearGradient([B,E],[M,C],this.ee,this.ae,a.TileMode.Clamp)}}function P(F,k,p,z,B,C){if(e([k,p,z,B,C])){if(0>C)throw"radii cannot be negative";F.isEmpty()&&F.moveTo(k,p);F.arcToTangent(k,p,z,B,C)}}function W(F){if(!F.isEmpty()){var k=F.getBounds();(k[3]-k[1]||k[2]-k[0])&&F.close()}}function u(F,k,p,z,B,C,E){E=(E-C)/Math.PI*180;C=C/Math.PI*180;k=a.LTRBRect(k-z,p-B,k+z,p+B);1E-5>Math.abs(Math.abs(E)-360)?(p=E/2,F.arcToOval(k,C,p,!1),F.arcToOval(k,
C+p,p,!1)):F.arcToOval(k,C,E,!1)}function H(F,k,p,z,B,C,E,M,ba){if(e([k,p,z,B,C,E,M])){if(0>z||0>B)throw"radii cannot be negative";var ca=2*Math.PI,Ia=E%ca;0>Ia&&(Ia+=ca);var $a=Ia-E;E=Ia;M+=$a;!ba&&M-E>=ca?M=E+ca:ba&&E-M>=ca?M=E-ca:!ba&&E>M?M=E+(ca-(E-M)%ca):ba&&E<M&&(M=E-(ca-(M-E)%ca));C?(ba=a.Matrix.rotated(C,k,p),C=a.Matrix.rotated(-C,k,p),F.transform(C),u(F,k,p,z,B,E,M),F.transform(ba)):u(F,k,p,z,B,E,M)}}function R(F,k,p){e([k,p])&&(F.isEmpty()&&F.moveTo(k,p),F.lineTo(k,p))}function aa(F){this.Wd=
null;this.Wd="string"===typeof F?a.Path.MakeFromSVGString(F):F&&F.af?F.Wd.copy():new a.Path;this.af=function(){return this.Wd};this.addPath=function(k,p){p||(p={a:1,c:0,e:0,b:0,d:1,f:0});this.Wd.addPath(k.Wd,[p.a,p.c,p.e,p.b,p.d,p.f])};this.arc=function(k,p,z,B,C,E){H(this.Wd,k,p,z,z,0,B,C,E)};this.arcTo=function(k,p,z,B,C){P(this.Wd,k,p,z,B,C)};this.bezierCurveTo=function(k,p,z,B,C,E){var M=this.Wd;e([k,p,z,B,C,E])&&(M.isEmpty()&&M.moveTo(k,p),M.cubicTo(k,p,z,B,C,E))};this.closePath=function(){W(this.Wd)};
this.ellipse=function(k,p,z,B,C,E,M,ba){H(this.Wd,k,p,z,B,C,E,M,ba)};this.lineTo=function(k,p){R(this.Wd,k,p)};this.moveTo=function(k,p){var z=this.Wd;e([k,p])&&z.moveTo(k,p)};this.quadraticCurveTo=function(k,p,z,B){var C=this.Wd;e([k,p,z,B])&&(C.isEmpty()&&C.moveTo(k,p),C.quadTo(k,p,z,B))};this.rect=function(k,p,z,B){var C=this.Wd;k=a.XYWHRect(k,p,z,B);e(k)&&C.addRect(k)}}function ja(F,k){this.Yd=null;F instanceof D&&(F=F.tf());this.Af=F;this._transform=a.Matrix.identity();""===k&&(k="repeat");switch(k){case "repeat-x":this.ye=
a.TileMode.Repeat;this.ze=a.TileMode.Decal;break;case "repeat-y":this.ye=a.TileMode.Decal;this.ze=a.TileMode.Repeat;break;case "repeat":this.ze=this.ye=a.TileMode.Repeat;break;case "no-repeat":this.ze=this.ye=a.TileMode.Decal;break;default:throw"invalid repetition mode "+k;}this.setTransform=function(p){p=[p.a,p.c,p.e,p.b,p.d,p.f,0,0,1];e(p)&&(this._transform=p)};this.re=function(){var p=new ja;p.ye=this.ye;p.ze=this.ze;return p};this.me=function(){this.Yd&&(this.Yd.delete(),this.Yd=null)};this.se=
function(){this.me();return this.Yd=this.Af.makeShaderCubic(this.ye,this.ze,1/3,1/3,this._transform)}}function pa(F,k,p,z,B,C){this.Yd=null;this.ee=[];this.ae=[];this.addColorStop=function(E,M){if(0>E||1<E||!isFinite(E))throw"offset must be between 0 and 1 inclusively";M=g(M);var ba=this.ae.indexOf(E);if(-1!==ba)this.ee[ba]=M;else{for(ba=0;ba<this.ae.length&&!(this.ae[ba]>E);ba++);this.ae.splice(ba,0,E);this.ee.splice(ba,0,M)}};this.re=function(){var E=new pa(F,k,p,z,B,C);E.ee=this.ee.slice();E.ae=
this.ae.slice();return E};this.me=function(){this.Yd&&(this.Yd.delete(),this.Yd=null)};this.se=function(E){var M=[F,k,z,B];a.Matrix.mapPoints(E,M);var ba=M[0],ca=M[1],Ia=M[2];M=M[3];var $a=(Math.abs(E[0])+Math.abs(E[4]))/2;E=p*$a;$a*=C;this.me();return this.Yd=a.Shader.MakeTwoPointConicalGradient([ba,ca],E,[Ia,M],$a,this.ee,this.ae,a.TileMode.Clamp)}}a._testing={};var ua={aliceblue:Float32Array.of(.941,.973,1,1),antiquewhite:Float32Array.of(.98,.922,.843,1),aqua:Float32Array.of(0,1,1,1),aquamarine:Float32Array.of(.498,
1,.831,1),azure:Float32Array.of(.941,1,1,1),beige:Float32Array.of(.961,.961,.863,1),bisque:Float32Array.of(1,.894,.769,1),black:Float32Array.of(0,0,0,1),blanchedalmond:Float32Array.of(1,.922,.804,1),blue:Float32Array.of(0,0,1,1),blueviolet:Float32Array.of(.541,.169,.886,1),brown:Float32Array.of(.647,.165,.165,1),burlywood:Float32Array.of(.871,.722,.529,1),cadetblue:Float32Array.of(.373,.62,.627,1),chartreuse:Float32Array.of(.498,1,0,1),chocolate:Float32Array.of(.824,.412,.118,1),coral:Float32Array.of(1,
.498,.314,1),cornflowerblue:Float32Array.of(.392,.584,.929,1),cornsilk:Float32Array.of(1,.973,.863,1),crimson:Float32Array.of(.863,.078,.235,1),cyan:Float32Array.of(0,1,1,1),darkblue:Float32Array.of(0,0,.545,1),darkcyan:Float32Array.of(0,.545,.545,1),darkgoldenrod:Float32Array.of(.722,.525,.043,1),darkgray:Float32Array.of(.663,.663,.663,1),darkgreen:Float32Array.of(0,.392,0,1),darkgrey:Float32Array.of(.663,.663,.663,1),darkkhaki:Float32Array.of(.741,.718,.42,1),darkmagenta:Float32Array.of(.545,0,
.545,1),darkolivegreen:Float32Array.of(.333,.42,.184,1),darkorange:Float32Array.of(1,.549,0,1),darkorchid:Float32Array.of(.6,.196,.8,1),darkred:Float32Array.of(.545,0,0,1),darksalmon:Float32Array.of(.914,.588,.478,1),darkseagreen:Float32Array.of(.561,.737,.561,1),darkslateblue:Float32Array.of(.282,.239,.545,1),darkslategray:Float32Array.of(.184,.31,.31,1),darkslategrey:Float32Array.of(.184,.31,.31,1),darkturquoise:Float32Array.of(0,.808,.82,1),darkviolet:Float32Array.of(.58,0,.827,1),deeppink:Float32Array.of(1,
.078,.576,1),deepskyblue:Float32Array.of(0,.749,1,1),dimgray:Float32Array.of(.412,.412,.412,1),dimgrey:Float32Array.of(.412,.412,.412,1),dodgerblue:Float32Array.of(.118,.565,1,1),firebrick:Float32Array.of(.698,.133,.133,1),floralwhite:Float32Array.of(1,.98,.941,1),forestgreen:Float32Array.of(.133,.545,.133,1),fuchsia:Float32Array.of(1,0,1,1),gainsboro:Float32Array.of(.863,.863,.863,1),ghostwhite:Float32Array.of(.973,.973,1,1),gold:Float32Array.of(1,.843,0,1),goldenrod:Float32Array.of(.855,.647,.125,
1),gray:Float32Array.of(.502,.502,.502,1),green:Float32Array.of(0,.502,0,1),greenyellow:Float32Array.of(.678,1,.184,1),grey:Float32Array.of(.502,.502,.502,1),honeydew:Float32Array.of(.941,1,.941,1),hotpink:Float32Array.of(1,.412,.706,1),indianred:Float32Array.of(.804,.361,.361,1),indigo:Float32Array.of(.294,0,.51,1),ivory:Float32Array.of(1,1,.941,1),khaki:Float32Array.of(.941,.902,.549,1),lavender:Float32Array.of(.902,.902,.98,1),lavenderblush:Float32Array.of(1,.941,.961,1),lawngreen:Float32Array.of(.486,
.988,0,1),lemonchiffon:Float32Array.of(1,.98,.804,1),lightblue:Float32Array.of(.678,.847,.902,1),lightcoral:Float32Array.of(.941,.502,.502,1),lightcyan:Float32Array.of(.878,1,1,1),lightgoldenrodyellow:Float32Array.of(.98,.98,.824,1),lightgray:Float32Array.of(.827,.827,.827,1),lightgreen:Float32Array.of(.565,.933,.565,1),lightgrey:Float32Array.of(.827,.827,.827,1),lightpink:Float32Array.of(1,.714,.757,1),lightsalmon:Float32Array.of(1,.627,.478,1),lightseagreen:Float32Array.of(.125,.698,.667,1),lightskyblue:Float32Array.of(.529,
.808,.98,1),lightslategray:Float32Array.of(.467,.533,.6,1),lightslategrey:Float32Array.of(.467,.533,.6,1),lightsteelblue:Float32Array.of(.69,.769,.871,1),lightyellow:Float32Array.of(1,1,.878,1),lime:Float32Array.of(0,1,0,1),limegreen:Float32Array.of(.196,.804,.196,1),linen:Float32Array.of(.98,.941,.902,1),magenta:Float32Array.of(1,0,1,1),maroon:Float32Array.of(.502,0,0,1),mediumaquamarine:Float32Array.of(.4,.804,.667,1),mediumblue:Float32Array.of(0,0,.804,1),mediumorchid:Float32Array.of(.729,.333,
.827,1),mediumpurple:Float32Array.of(.576,.439,.859,1),mediumseagreen:Float32Array.of(.235,.702,.443,1),mediumslateblue:Float32Array.of(.482,.408,.933,1),mediumspringgreen:Float32Array.of(0,.98,.604,1),mediumturquoise:Float32Array.of(.282,.82,.8,1),mediumvioletred:Float32Array.of(.78,.082,.522,1),midnightblue:Float32Array.of(.098,.098,.439,1),mintcream:Float32Array.of(.961,1,.98,1),mistyrose:Float32Array.of(1,.894,.882,1),moccasin:Float32Array.of(1,.894,.71,1),navajowhite:Float32Array.of(1,.871,.678,
1),navy:Float32Array.of(0,0,.502,1),oldlace:Float32Array.of(.992,.961,.902,1),olive:Float32Array.of(.502,.502,0,1),olivedrab:Float32Array.of(.42,.557,.137,1),orange:Float32Array.of(1,.647,0,1),orangered:Float32Array.of(1,.271,0,1),orchid:Float32Array.of(.855,.439,.839,1),palegoldenrod:Float32Array.of(.933,.91,.667,1),palegreen:Float32Array.of(.596,.984,.596,1),paleturquoise:Float32Array.of(.686,.933,.933,1),palevioletred:Float32Array.of(.859,.439,.576,1),papayawhip:Float32Array.of(1,.937,.835,1),
peachpuff:Float32Array.of(1,.855,.725,1),peru:Float32Array.of(.804,.522,.247,1),pink:Float32Array.of(1,.753,.796,1),plum:Float32Array.of(.867,.627,.867,1),powderblue:Float32Array.of(.69,.878,.902,1),purple:Float32Array.of(.502,0,.502,1),rebeccapurple:Float32Array.of(.4,.2,.6,1),red:Float32Array.of(1,0,0,1),rosybrown:Float32Array.of(.737,.561,.561,1),royalblue:Float32Array.of(.255,.412,.882,1),saddlebrown:Float32Array.of(.545,.271,.075,1),salmon:Float32Array.of(.98,.502,.447,1),sandybrown:Float32Array.of(.957,
.643,.376,1),seagreen:Float32Array.of(.18,.545,.341,1),seashell:Float32Array.of(1,.961,.933,1),sienna:Float32Array.of(.627,.322,.176,1),silver:Float32Array.of(.753,.753,.753,1),skyblue:Float32Array.of(.529,.808,.922,1),slateblue:Float32Array.of(.416,.353,.804,1),slategray:Float32Array.of(.439,.502,.565,1),slategrey:Float32Array.of(.439,.502,.565,1),snow:Float32Array.of(1,.98,.98,1),springgreen:Float32Array.of(0,1,.498,1),steelblue:Float32Array.of(.275,.51,.706,1),tan:Float32Array.of(.824,.706,.549,
1),teal:Float32Array.of(0,.502,.502,1),thistle:Float32Array.of(.847,.749,.847,1),tomato:Float32Array.of(1,.388,.278,1),transparent:Float32Array.of(0,0,0,0),turquoise:Float32Array.of(.251,.878,.816,1),violet:Float32Array.of(.933,.51,.933,1),wheat:Float32Array.of(.961,.871,.702,1),white:Float32Array.of(1,1,1,1),whitesmoke:Float32Array.of(.961,.961,.961,1),yellow:Float32Array.of(1,1,0,1),yellowgreen:Float32Array.of(.604,.804,.196,1)};a._testing.parseColor=g;a._testing.colorToString=d;var Aa=RegExp("(italic|oblique|normal|)\\s*(small-caps|normal|)\\s*(bold|bolder|lighter|[1-9]00|normal|)\\s*([\\d\\.]+)(px|pt|pc|in|cm|mm|%|em|ex|ch|rem|q)(.+)"),
ea={"Noto Mono":{"*":null},monospace:{"*":null}};a._testing.parseFontString=m;a.MakeCanvas=function(F,k){return(F=a.MakeSurface(F,k))?new y(F):null};a.ImageData=function(){if(2===arguments.length){var F=arguments[0],k=arguments[1];return new I(new Uint8ClampedArray(4*F*k),F,k)}if(3===arguments.length){var p=arguments[0];if(p.prototype.constructor!==Uint8ClampedArray)throw"bytes must be given as a Uint8ClampedArray";F=arguments[1];k=arguments[2];if(p%4)throw"bytes must be given in a multiple of 4";
if(p%F)throw"bytes must divide evenly by width";if(k&&k!==p/(4*F))throw"invalid height given";return new I(p,F,p/(4*F))}throw"invalid number of arguments - takes 2 or 3, saw "+arguments.length;}})()})(t);var va=da({},t),wa="./this.program",xa=(a,b)=>{throw b;},ya="object"===typeof window,za="function"===typeof importScripts,Ba="object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node,Ca="",Da,Ea,Fa,fs,Ga,Ja;
if(Ba)Ca=za?require("path").dirname(Ca)+"/":__dirname+"/",Ja=()=>{Ga||(fs=require("fs"),Ga=require("path"))},Da=function(a,b){Ja();a=Ga.normalize(a);return fs.readFileSync(a,b?null:"utf8")},Fa=a=>{a=Da(a,!0);a.buffer||(a=new Uint8Array(a));return a},Ea=(a,b,c)=>{Ja();a=Ga.normalize(a);fs.readFile(a,function(f,h){f?c(f):b(h.buffer)})},1<process.argv.length&&(wa=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",function(a){if(!(a instanceof Ka))throw a;}),process.on("unhandledRejection",
function(a){throw a;}),xa=(a,b)=>{if(noExitRuntime||0<La)throw process.exitCode=a,b;b instanceof Ka||Ma("exiting due to exception: "+b);process.exit(a)},t.inspect=function(){return"[Emscripten Module object]"};else if(ya||za)za?Ca=self.location.href:"undefined"!==typeof document&&document.currentScript&&(Ca=document.currentScript.src),_scriptDir&&(Ca=_scriptDir),0!==Ca.indexOf("blob:")?Ca=Ca.substr(0,Ca.replace(/[?#].*/,"").lastIndexOf("/")+1):Ca="",Da=a=>{var b=new XMLHttpRequest;b.open("GET",a,
!1);b.send(null);return b.responseText},za&&(Fa=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)}),Ea=(a,b,c)=>{var f=new XMLHttpRequest;f.open("GET",a,!0);f.responseType="arraybuffer";f.onload=()=>{200==f.status||0==f.status&&f.response?b(f.response):c()};f.onerror=c;f.send(null)};var Na=t.print||console.log.bind(console),Ma=t.printErr||console.warn.bind(console);da(t,va);va=null;t.thisProgram&&(wa=t.thisProgram);
t.quit&&(xa=t.quit);var Pa=0,Qa;t.wasmBinary&&(Qa=t.wasmBinary);var noExitRuntime=t.noExitRuntime||!0;"object"!==typeof WebAssembly&&Ra("no native wasm support detected");var Sa,Ua=!1,Va="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;
function Wa(a,b,c){var f=b+c;for(c=b;a[c]&&!(c>=f);)++c;if(16<c-b&&a.subarray&&Va)return Va.decode(a.subarray(b,c));for(f="";b<c;){var h=a[b++];if(h&128){var l=a[b++]&63;if(192==(h&224))f+=String.fromCharCode((h&31)<<6|l);else{var n=a[b++]&63;h=224==(h&240)?(h&15)<<12|l<<6|n:(h&7)<<18|l<<12|n<<6|a[b++]&63;65536>h?f+=String.fromCharCode(h):(h-=65536,f+=String.fromCharCode(55296|h>>10,56320|h&1023))}}else f+=String.fromCharCode(h)}return f}function Xa(a,b){return a?Wa(G,a,b):""}
function sa(a,b,c,f){if(!(0<f))return 0;var h=c;f=c+f-1;for(var l=0;l<a.length;++l){var n=a.charCodeAt(l);if(55296<=n&&57343>=n){var q=a.charCodeAt(++l);n=65536+((n&1023)<<10)|q&1023}if(127>=n){if(c>=f)break;b[c++]=n}else{if(2047>=n){if(c+1>=f)break;b[c++]=192|n>>6}else{if(65535>=n){if(c+2>=f)break;b[c++]=224|n>>12}else{if(c+3>=f)break;b[c++]=240|n>>18;b[c++]=128|n>>12&63}b[c++]=128|n>>6&63}b[c++]=128|n&63}}b[c]=0;return c-h}
function ra(a){for(var b=0,c=0;c<a.length;++c){var f=a.charCodeAt(c);55296<=f&&57343>=f&&(f=65536+((f&1023)<<10)|a.charCodeAt(++c)&1023);127>=f?++b:b=2047>=f?b+2:65535>=f?b+3:b+4}return b}var Ya="undefined"!==typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function ab(a,b){var c=a>>1;for(var f=c+b/2;!(c>=f)&&bb[c];)++c;c<<=1;if(32<c-a&&Ya)return Ya.decode(G.subarray(a,c));c="";for(f=0;!(f>=b/2);++f){var h=cb[a+2*f>>1];if(0==h)break;c+=String.fromCharCode(h)}return c}
function db(a,b,c){void 0===c&&(c=2147483647);if(2>c)return 0;c-=2;var f=b;c=c<2*a.length?c/2:a.length;for(var h=0;h<c;++h)cb[b>>1]=a.charCodeAt(h),b+=2;cb[b>>1]=0;return b-f}function eb(a){return 2*a.length}function jb(a,b){for(var c=0,f="";!(c>=b/4);){var h=O[a+4*c>>2];if(0==h)break;++c;65536<=h?(h-=65536,f+=String.fromCharCode(55296|h>>10,56320|h&1023)):f+=String.fromCharCode(h)}return f}
function kb(a,b,c){void 0===c&&(c=2147483647);if(4>c)return 0;var f=b;c=f+c-4;for(var h=0;h<a.length;++h){var l=a.charCodeAt(h);if(55296<=l&&57343>=l){var n=a.charCodeAt(++h);l=65536+((l&1023)<<10)|n&1023}O[b>>2]=l;b+=4;if(b+4>c)break}O[b>>2]=0;return b-f}function lb(a){for(var b=0,c=0;c<a.length;++c){var f=a.charCodeAt(c);55296<=f&&57343>=f&&++c;b+=4}return b}var mb,nb,G,cb,bb,O,ob,U,pb;
function qb(){var a=Sa.buffer;mb=a;t.HEAP8=nb=new Int8Array(a);t.HEAP16=cb=new Int16Array(a);t.HEAP32=O=new Int32Array(a);t.HEAPU8=G=new Uint8Array(a);t.HEAPU16=bb=new Uint16Array(a);t.HEAPU32=ob=new Uint32Array(a);t.HEAPF32=U=new Float32Array(a);t.HEAPF64=pb=new Float64Array(a)}var rb,sb=[],tb=[],ub=[],La=0;function vb(){var a=t.preRun.shift();sb.unshift(a)}var wb=0,xb=null,zb=null;t.preloadedImages={};t.preloadedAudios={};
function Ra(a){if(t.onAbort)t.onAbort(a);a="Aborted("+a+")";Ma(a);Ua=!0;a=new WebAssembly.RuntimeError(a+". Build with -s ASSERTIONS=1 for more info.");ha(a);throw a;}function Ab(){return Bb.startsWith("data:application/octet-stream;base64,")}var Bb;Bb="canvaskit.wasm";if(!Ab()){var Cb=Bb;Bb=t.locateFile?t.locateFile(Cb,Ca):Ca+Cb}function Db(){var a=Bb;try{if(a==Bb&&Qa)return new Uint8Array(Qa);if(Fa)return Fa(a);throw"both async and sync fetching of the wasm failed";}catch(b){Ra(b)}}
function Eb(){if(!Qa&&(ya||za)){if("function"===typeof fetch&&!Bb.startsWith("file://"))return fetch(Bb,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+Bb+"'";return a.arrayBuffer()}).catch(function(){return Db()});if(Ea)return new Promise(function(a,b){Ea(Bb,function(c){a(new Uint8Array(c))},b)})}return Promise.resolve().then(function(){return Db()})}
function Fb(a){for(;0<a.length;){var b=a.shift();if("function"==typeof b)b(t);else{var c=b.Dg;"number"===typeof c?void 0===b.ef?Gb(c)():Gb(c)(b.ef):c(void 0===b.ef?null:b.ef)}}}function Gb(a){return rb.get(a)}
function Hb(a){this.Qd=a-16;this.mg=function(b){O[this.Qd+4>>2]=b};this.jg=function(b){O[this.Qd+8>>2]=b};this.kg=function(){O[this.Qd>>2]=0};this.ig=function(){nb[this.Qd+12>>0]=0};this.lg=function(){nb[this.Qd+13>>0]=0};this.Xf=function(b,c){this.mg(b);this.jg(c);this.kg();this.ig();this.lg()}}var Ib=0,Jb={},Kb=[null,[],[]],Lb={},Mb={};function Nb(a){for(;a.length;){var b=a.pop();a.pop()(b)}}function Ob(a){return this.fromWireType(ob[a>>2])}var Pb={},Qb={},Rb={};
function Sb(a){if(void 0===a)return"_unknown";a=a.replace(/[^a-zA-Z0-9_]/g,"$");var b=a.charCodeAt(0);return 48<=b&&57>=b?"_"+a:a}function Tb(a,b){a=Sb(a);return function(){null;return b.apply(this,arguments)}}
function Ub(a){var b=Error,c=Tb(a,function(f){this.name=a;this.message=f;f=Error(f).stack;void 0!==f&&(this.stack=this.toString()+"\n"+f.replace(/^Error(:[^\n]*)?\n/,""))});c.prototype=Object.create(b.prototype);c.prototype.constructor=c;c.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message};return c}var Vb=void 0;function Wb(a){throw new Vb(a);}
function Xb(a,b,c){function f(q){q=c(q);q.length!==a.length&&Wb("Mismatched type converter count");for(var w=0;w<a.length;++w)dc(a[w],q[w])}a.forEach(function(q){Rb[q]=b});var h=Array(b.length),l=[],n=0;b.forEach(function(q,w){Qb.hasOwnProperty(q)?h[w]=Qb[q]:(l.push(q),Pb.hasOwnProperty(q)||(Pb[q]=[]),Pb[q].push(function(){h[w]=Qb[q];++n;n===l.length&&f(h)}))});0===l.length&&f(h)}
function ec(a){switch(a){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+a);}}var fc=void 0;function gc(a){for(var b="";G[a];)b+=fc[G[a++]];return b}var hc=void 0;function X(a){throw new hc(a);}
function dc(a,b,c={}){if(!("argPackAdvance"in b))throw new TypeError("registerType registeredInstance requires argPackAdvance");var f=b.name;a||X('type "'+f+'" must have a positive integer typeid pointer');if(Qb.hasOwnProperty(a)){if(c.Wf)return;X("Cannot register type '"+f+"' twice")}Qb[a]=b;delete Rb[a];Pb.hasOwnProperty(a)&&(b=Pb[a],delete Pb[a],b.forEach(function(h){h()}))}function ic(a){X(a.Ld.Xd.Sd.name+" instance already deleted")}var jc=!1;function kc(){}
function lc(a){--a.count.value;0===a.count.value&&(a.$d?a.ge.le(a.$d):a.Xd.Sd.le(a.Qd))}function mc(a){if("undefined"===typeof FinalizationGroup)return mc=b=>b,a;jc=new FinalizationGroup(function(b){for(var c=b.next();!c.done;c=b.next())c=c.value,c.Qd?lc(c):console.warn("object already deleted: "+c.Qd)});mc=b=>{jc.register(b,b.Ld,b.Ld);return b};kc=b=>{jc.unregister(b.Ld)};return mc(a)}var nc=void 0,oc=[];function pc(){for(;oc.length;){var a=oc.pop();a.Ld.De=!1;a["delete"]()}}function qc(){}
var rc={};function sc(a,b,c){if(void 0===a[b].Zd){var f=a[b];a[b]=function(){a[b].Zd.hasOwnProperty(arguments.length)||X("Function '"+c+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+a[b].Zd+")!");return a[b].Zd[arguments.length].apply(this,arguments)};a[b].Zd=[];a[b].Zd[f.Be]=f}}
function tc(a,b,c){t.hasOwnProperty(a)?((void 0===c||void 0!==t[a].Zd&&void 0!==t[a].Zd[c])&&X("Cannot register public name '"+a+"' twice"),sc(t,a,a),t.hasOwnProperty(c)&&X("Cannot register multiple overloads of a function with the same number of arguments ("+c+")!"),t[a].Zd[c]=b):(t[a]=b,void 0!==c&&(t[a].Fg=c))}function uc(a,b,c,f,h,l,n,q){this.name=a;this.constructor=b;this.Ee=c;this.le=f;this.ie=h;this.Pf=l;this.Pe=n;this.Jf=q;this.fg=[]}
function vc(a,b,c){for(;b!==c;)b.Pe||X("Expected null or instance of "+c.name+", got an instance of "+b.name),a=b.Pe(a),b=b.ie;return a}function wc(a,b){if(null===b)return this.gf&&X("null is not a valid "+this.name),0;b.Ld||X('Cannot pass "'+xc(b)+'" as a '+this.name);b.Ld.Qd||X("Cannot pass deleted object as a pointer of type "+this.name);return vc(b.Ld.Qd,b.Ld.Xd.Sd,this.Sd)}
function yc(a,b){if(null===b){this.gf&&X("null is not a valid "+this.name);if(this.Ue){var c=this.hf();null!==a&&a.push(this.le,c);return c}return 0}b.Ld||X('Cannot pass "'+xc(b)+'" as a '+this.name);b.Ld.Qd||X("Cannot pass deleted object as a pointer of type "+this.name);!this.Te&&b.Ld.Xd.Te&&X("Cannot convert argument of type "+(b.Ld.ge?b.Ld.ge.name:b.Ld.Xd.name)+" to parameter type "+this.name);c=vc(b.Ld.Qd,b.Ld.Xd.Sd,this.Sd);if(this.Ue)switch(void 0===b.Ld.$d&&X("Passing raw pointer to smart pointer is illegal"),
this.qg){case 0:b.Ld.ge===this?c=b.Ld.$d:X("Cannot convert argument of type "+(b.Ld.ge?b.Ld.ge.name:b.Ld.Xd.name)+" to parameter type "+this.name);break;case 1:c=b.Ld.$d;break;case 2:if(b.Ld.ge===this)c=b.Ld.$d;else{var f=b.clone();c=this.gg(c,zc(function(){f["delete"]()}));null!==a&&a.push(this.le,c)}break;default:X("Unsupporting sharing policy")}return c}
function Ac(a,b){if(null===b)return this.gf&&X("null is not a valid "+this.name),0;b.Ld||X('Cannot pass "'+xc(b)+'" as a '+this.name);b.Ld.Qd||X("Cannot pass deleted object as a pointer of type "+this.name);b.Ld.Xd.Te&&X("Cannot convert argument of type "+b.Ld.Xd.name+" to parameter type "+this.name);return vc(b.Ld.Qd,b.Ld.Xd.Sd,this.Sd)}function Bc(a,b,c){if(b===c)return a;if(void 0===c.ie)return null;a=Bc(a,b,c.ie);return null===a?null:c.Jf(a)}var Cc={};
function Dc(a,b){for(void 0===b&&X("ptr should not be undefined");a.ie;)b=a.Pe(b),a=a.ie;return Cc[b]}function Ec(a,b){b.Xd&&b.Qd||Wb("makeClassHandle requires ptr and ptrType");!!b.ge!==!!b.$d&&Wb("Both smartPtrType and smartPtr must be specified");b.count={value:1};return mc(Object.create(a,{Ld:{value:b}}))}
function Fc(a,b,c,f,h,l,n,q,w,x,J){this.name=a;this.Sd=b;this.gf=c;this.Te=f;this.Ue=h;this.eg=l;this.qg=n;this.vf=q;this.hf=w;this.gg=x;this.le=J;h||void 0!==b.ie?this.toWireType=yc:(this.toWireType=f?wc:Ac,this.fe=null)}function Gc(a,b,c){t.hasOwnProperty(a)||Wb("Replacing nonexistant public symbol");void 0!==t[a].Zd&&void 0!==c?t[a].Zd[c]=b:(t[a]=b,t[a].Be=c)}
function Hc(a,b){var c=[];return function(){c.length=arguments.length;for(var f=0;f<arguments.length;f++)c[f]=arguments[f];a.includes("j")?(f=t["dynCall_"+a],f=c&&c.length?f.apply(null,[b].concat(c)):f.call(null,b)):f=Gb(b).apply(null,c);return f}}function Pc(a,b){a=gc(a);var c=a.includes("j")?Hc(a,b):Gb(b);"function"!==typeof c&&X("unknown function pointer with signature "+a+": "+b);return c}var Qc=void 0;function Rc(a){a=Sc(a);var b=gc(a);Tc(a);return b}
function Uc(a,b){function c(l){h[l]||Qb[l]||(Rb[l]?Rb[l].forEach(c):(f.push(l),h[l]=!0))}var f=[],h={};b.forEach(c);throw new Qc(a+": "+f.map(Rc).join([", "]));}
function Vc(a,b,c,f,h){var l=b.length;2>l&&X("argTypes array size mismatch! Must at least get return value and 'this' types!");var n=null!==b[1]&&null!==c,q=!1;for(c=1;c<b.length;++c)if(null!==b[c]&&void 0===b[c].fe){q=!0;break}var w="void"!==b[0].name,x=l-2,J=Array(x),K=[],Q=[];return function(){arguments.length!==x&&X("function "+a+" called with "+arguments.length+" arguments, expected "+x+" args!");Q.length=0;K.length=n?2:1;K[0]=h;if(n){var A=b[1].toWireType(Q,this);K[1]=A}for(var L=0;L<x;++L)J[L]=
b[L+2].toWireType(Q,arguments[L]),K.push(J[L]);L=f.apply(null,K);if(q)Nb(Q);else for(var S=n?1:2;S<b.length;S++){var T=1===S?A:J[S-2];null!==b[S].fe&&b[S].fe(T)}A=w?b[0].fromWireType(L):void 0;return A}}function Wc(a,b){for(var c=[],f=0;f<a;f++)c.push(O[(b>>2)+f]);return c}var Xc=[],Yc=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Zc(a){4<a&&0===--Yc[a].jf&&(Yc[a]=void 0,Xc.push(a))}function $c(a){a||X("Cannot use deleted val. handle = "+a);return Yc[a].value}
function zc(a){switch(a){case void 0:return 1;case null:return 2;case !0:return 3;case !1:return 4;default:var b=Xc.length?Xc.pop():Yc.length;Yc[b]={jf:1,value:a};return b}}function ad(a,b,c){switch(b){case 0:return function(f){return this.fromWireType((c?nb:G)[f])};case 1:return function(f){return this.fromWireType((c?cb:bb)[f>>1])};case 2:return function(f){return this.fromWireType((c?O:ob)[f>>2])};default:throw new TypeError("Unknown integer type: "+a);}}
function bd(a,b){var c=Qb[a];void 0===c&&X(b+" has unknown type "+Rc(a));return c}function xc(a){if(null===a)return"null";var b=typeof a;return"object"===b||"array"===b||"function"===b?a.toString():""+a}function cd(a,b){switch(b){case 2:return function(c){return this.fromWireType(U[c>>2])};case 3:return function(c){return this.fromWireType(pb[c>>3])};default:throw new TypeError("Unknown float type: "+a);}}
function dd(a,b,c){switch(b){case 0:return c?function(f){return nb[f]}:function(f){return G[f]};case 1:return c?function(f){return cb[f>>1]}:function(f){return bb[f>>1]};case 2:return c?function(f){return O[f>>2]}:function(f){return ob[f>>2]};default:throw new TypeError("Unknown integer type: "+a);}}var ed={};function fd(a){var b=ed[a];return void 0===b?gc(a):b}var gd=[];
function hd(){function a(b){b.$$$embind_global$$$=b;var c="object"===typeof $$$embind_global$$$&&b.$$$embind_global$$$===b;c||delete b.$$$embind_global$$$;return c}if("object"===typeof globalThis)return globalThis;if("object"===typeof $$$embind_global$$$)return $$$embind_global$$$;"object"===typeof global&&a(global)?$$$embind_global$$$=global:"object"===typeof self&&a(self)&&($$$embind_global$$$=self);if("object"===typeof $$$embind_global$$$)return $$$embind_global$$$;throw Error("unable to get global object.");
}function jd(a){var b=gd.length;gd.push(a);return b}function kd(a,b){for(var c=Array(a),f=0;f<a;++f)c[f]=bd(O[(b>>2)+f],"parameter "+f);return c}var ld=[];function md(a){var b=Array(a+1);return function(c,f,h){b[0]=c;for(var l=0;l<a;++l){var n=bd(O[(f>>2)+l],"parameter "+l);b[l+1]=n.readValueFromPointer(h);h+=n.argPackAdvance}c=new (c.bind.apply(c,b));return zc(c)}}var nd={},od;od=Ba?()=>{var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:()=>performance.now();
function pd(a){var b=a.getExtension("ANGLE_instanced_arrays");b&&(a.vertexAttribDivisor=function(c,f){b.vertexAttribDivisorANGLE(c,f)},a.drawArraysInstanced=function(c,f,h,l){b.drawArraysInstancedANGLE(c,f,h,l)},a.drawElementsInstanced=function(c,f,h,l,n){b.drawElementsInstancedANGLE(c,f,h,l,n)})}
function qd(a){var b=a.getExtension("OES_vertex_array_object");b&&(a.createVertexArray=function(){return b.createVertexArrayOES()},a.deleteVertexArray=function(c){b.deleteVertexArrayOES(c)},a.bindVertexArray=function(c){b.bindVertexArrayOES(c)},a.isVertexArray=function(c){return b.isVertexArrayOES(c)})}function rd(a){var b=a.getExtension("WEBGL_draw_buffers");b&&(a.drawBuffers=function(c,f){b.drawBuffersWEBGL(c,f)})}
var sd=1,td=[],ud=[],vd=[],wd=[],la=[],xd=[],yd=[],qa=[],zd=[],Ad=[],Bd={},Cd={},Dd=4;function Ed(a){Hd||(Hd=a)}function ka(a){for(var b=sd++,c=a.length;c<b;c++)a[c]=null;return b}function ma(a,b){a.sf||(a.sf=a.getContext,a.getContext=function(f,h){h=a.sf(f,h);return"webgl"==f==h instanceof WebGLRenderingContext?h:null});var c=1<b.majorVersion?a.getContext("webgl2",b):a.getContext("webgl",b);return c?Id(c,b):0}
function Id(a,b){var c=ka(qa),f={Vf:c,attributes:b,version:b.majorVersion,je:a};a.canvas&&(a.canvas.yf=f);qa[c]=f;("undefined"===typeof b.Kf||b.Kf)&&Jd(f);return c}function na(a){v=qa[a];t.Cg=Y=v&&v.je;return!(a&&!Y)}
function Jd(a){a||(a=v);if(!a.Yf){a.Yf=!0;var b=a.je;pd(b);qd(b);rd(b);b.pf=b.getExtension("WEBGL_draw_instanced_base_vertex_base_instance");b.uf=b.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance");2<=a.version&&(b.qf=b.getExtension("EXT_disjoint_timer_query_webgl2"));if(2>a.version||!b.qf)b.qf=b.getExtension("EXT_disjoint_timer_query");b.Eg=b.getExtension("WEBGL_multi_draw");(b.getSupportedExtensions()||[]).forEach(function(c){c.includes("lose_context")||c.includes("debug")||b.getExtension(c)})}}
var v,Hd,Kd=[];function Ld(a,b,c,f){for(var h=0;h<a;h++){var l=Y[c](),n=l&&ka(f);l?(l.name=n,f[n]=l):Ed(1282);O[b+4*h>>2]=n}}
function Md(a,b){if(b){var c=void 0;switch(a){case 36346:c=1;break;case 36344:return;case 34814:case 36345:c=0;break;case 34466:var f=Y.getParameter(34467);c=f?f.length:0;break;case 33309:if(2>v.version){Ed(1282);return}c=2*(Y.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(2>v.version){Ed(1280);return}c=33307==a?3:0}if(void 0===c)switch(f=Y.getParameter(a),typeof f){case "number":c=f;break;case "boolean":c=f?1:0;break;case "string":Ed(1280);return;case "object":if(null===f)switch(a){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:c=
0;break;default:Ed(1280);return}else{if(f instanceof Float32Array||f instanceof Uint32Array||f instanceof Int32Array||f instanceof Array){for(a=0;a<f.length;++a)O[b+4*a>>2]=f[a];return}try{c=f.name|0}catch(h){Ed(1280);Ma("GL_INVALID_ENUM in glGet0v: Unknown object returned from WebGL getParameter("+a+")! (error: "+h+")");return}}break;default:Ed(1280);Ma("GL_INVALID_ENUM in glGet0v: Native code calling glGet0v("+a+") and it returns "+f+" of type "+typeof f+"!");return}O[b>>2]=c}else Ed(1281)}
function Nd(a){var b=ra(a)+1,c=Od(b);sa(a,G,c,b);return c}function Pd(a){return"]"==a.slice(-1)&&a.lastIndexOf("[")}function Qd(a){a-=5120;return 0==a?nb:1==a?G:2==a?cb:4==a?O:6==a?U:5==a||28922==a||28520==a||30779==a||30782==a?ob:bb}function Rd(a,b,c,f,h){a=Qd(a);var l=31-Math.clz32(a.BYTES_PER_ELEMENT),n=Dd;return a.subarray(h>>l,h+f*(c*({5:3,6:4,8:2,29502:3,29504:4,26917:2,26918:2,29846:3,29847:4}[b-6402]||1)*(1<<l)+n-1&-n)>>l)}
function Z(a){var b=Y.Gf;if(b){var c=b.Oe[a];"number"===typeof c&&(b.Oe[a]=c=Y.getUniformLocation(b,b.wf[a]+(0<c?"["+c+"]":"")));return c}Ed(1282)}var Sd=[],Td=[],Ud={};
function Vd(){if(!Wd){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"===typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:wa||"./this.program"},b;for(b in Ud)void 0===Ud[b]?delete a[b]:a[b]=Ud[b];var c=[];for(b in a)c.push(b+"="+a[b]);Wd=c}return Wd}var Wd;function Xd(a){return 0===a%4&&(0!==a%100||0===a%400)}function Yd(a,b){for(var c=0,f=0;f<=b;c+=a[f++]);return c}
var Zd=[31,29,31,30,31,30,31,31,30,31,30,31],$d=[31,28,31,30,31,30,31,31,30,31,30,31];function ae(a,b){for(a=new Date(a.getTime());0<b;){var c=a.getMonth(),f=(Xd(a.getFullYear())?Zd:$d)[c];if(b>f-a.getDate())b-=f-a.getDate()+1,a.setDate(1),11>c?a.setMonth(c+1):(a.setMonth(0),a.setFullYear(a.getFullYear()+1));else{a.setDate(a.getDate()+b);break}}return a}
function be(a,b,c,f){function h(A,L,S){for(A="number"===typeof A?A.toString():A||"";A.length<L;)A=S[0]+A;return A}function l(A,L){return h(A,L,"0")}function n(A,L){function S(oa){return 0>oa?-1:0<oa?1:0}var T;0===(T=S(A.getFullYear()-L.getFullYear()))&&0===(T=S(A.getMonth()-L.getMonth()))&&(T=S(A.getDate()-L.getDate()));return T}function q(A){switch(A.getDay()){case 0:return new Date(A.getFullYear()-1,11,29);case 1:return A;case 2:return new Date(A.getFullYear(),0,3);case 3:return new Date(A.getFullYear(),
0,2);case 4:return new Date(A.getFullYear(),0,1);case 5:return new Date(A.getFullYear()-1,11,31);case 6:return new Date(A.getFullYear()-1,11,30)}}function w(A){A=ae(new Date(A.be+1900,0,1),A.$e);var L=new Date(A.getFullYear()+1,0,4),S=q(new Date(A.getFullYear(),0,4));L=q(L);return 0>=n(S,A)?0>=n(L,A)?A.getFullYear()+1:A.getFullYear():A.getFullYear()-1}var x=O[f+40>>2];f={yg:O[f>>2],xg:O[f+4>>2],Ye:O[f+8>>2],Ne:O[f+12>>2],Fe:O[f+16>>2],be:O[f+20>>2],Ze:O[f+24>>2],$e:O[f+28>>2],Ig:O[f+32>>2],wg:O[f+
36>>2],zg:x?Xa(x):""};c=Xa(c);x={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var J in x)c=c.replace(new RegExp(J,"g"),x[J]);var K="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),
Q="January February March April May June July August September October November December".split(" ");x={"%a":function(A){return K[A.Ze].substring(0,3)},"%A":function(A){return K[A.Ze]},"%b":function(A){return Q[A.Fe].substring(0,3)},"%B":function(A){return Q[A.Fe]},"%C":function(A){return l((A.be+1900)/100|0,2)},"%d":function(A){return l(A.Ne,2)},"%e":function(A){return h(A.Ne,2," ")},"%g":function(A){return w(A).toString().substring(2)},"%G":function(A){return w(A)},"%H":function(A){return l(A.Ye,
2)},"%I":function(A){A=A.Ye;0==A?A=12:12<A&&(A-=12);return l(A,2)},"%j":function(A){return l(A.Ne+Yd(Xd(A.be+1900)?Zd:$d,A.Fe-1),3)},"%m":function(A){return l(A.Fe+1,2)},"%M":function(A){return l(A.xg,2)},"%n":function(){return"\n"},"%p":function(A){return 0<=A.Ye&&12>A.Ye?"AM":"PM"},"%S":function(A){return l(A.yg,2)},"%t":function(){return"\t"},"%u":function(A){return A.Ze||7},"%U":function(A){var L=new Date(A.be+1900,0,1),S=0===L.getDay()?L:ae(L,7-L.getDay());A=new Date(A.be+1900,A.Fe,A.Ne);return 0>
n(S,A)?l(Math.ceil((31-S.getDate()+(Yd(Xd(A.getFullYear())?Zd:$d,A.getMonth()-1)-31)+A.getDate())/7),2):0===n(S,L)?"01":"00"},"%V":function(A){var L=new Date(A.be+1901,0,4),S=q(new Date(A.be+1900,0,4));L=q(L);var T=ae(new Date(A.be+1900,0,1),A.$e);return 0>n(T,S)?"53":0>=n(L,T)?"01":l(Math.ceil((S.getFullYear()<A.be+1900?A.$e+32-S.getDate():A.$e+1-S.getDate())/7),2)},"%w":function(A){return A.Ze},"%W":function(A){var L=new Date(A.be,0,1),S=1===L.getDay()?L:ae(L,0===L.getDay()?1:7-L.getDay()+1);A=
new Date(A.be+1900,A.Fe,A.Ne);return 0>n(S,A)?l(Math.ceil((31-S.getDate()+(Yd(Xd(A.getFullYear())?Zd:$d,A.getMonth()-1)-31)+A.getDate())/7),2):0===n(S,L)?"01":"00"},"%y":function(A){return(A.be+1900).toString().substring(2)},"%Y":function(A){return A.be+1900},"%z":function(A){A=A.wg;var L=0<=A;A=Math.abs(A)/60;return(L?"+":"-")+String("0000"+(A/60*100+A%60)).slice(-4)},"%Z":function(A){return A.zg},"%%":function(){return"%"}};for(J in x)c.includes(J)&&(c=c.replace(new RegExp(J,"g"),x[J](f)));J=ce(c);
if(J.length>b)return 0;nb.set(J,a);return J.length-1}Vb=t.InternalError=Ub("InternalError");for(var de=Array(256),ee=0;256>ee;++ee)de[ee]=String.fromCharCode(ee);fc=de;hc=t.BindingError=Ub("BindingError");qc.prototype.isAliasOf=function(a){if(!(this instanceof qc&&a instanceof qc))return!1;var b=this.Ld.Xd.Sd,c=this.Ld.Qd,f=a.Ld.Xd.Sd;for(a=a.Ld.Qd;b.ie;)c=b.Pe(c),b=b.ie;for(;f.ie;)a=f.Pe(a),f=f.ie;return b===f&&c===a};
qc.prototype.clone=function(){this.Ld.Qd||ic(this);if(this.Ld.Me)return this.Ld.count.value+=1,this;var a=mc,b=Object,c=b.create,f=Object.getPrototypeOf(this),h=this.Ld;a=a(c.call(b,f,{Ld:{value:{count:h.count,De:h.De,Me:h.Me,Qd:h.Qd,Xd:h.Xd,$d:h.$d,ge:h.ge}}}));a.Ld.count.value+=1;a.Ld.De=!1;return a};qc.prototype["delete"]=function(){this.Ld.Qd||ic(this);this.Ld.De&&!this.Ld.Me&&X("Object already scheduled for deletion");kc(this);lc(this.Ld);this.Ld.Me||(this.Ld.$d=void 0,this.Ld.Qd=void 0)};
qc.prototype.isDeleted=function(){return!this.Ld.Qd};qc.prototype.deleteLater=function(){this.Ld.Qd||ic(this);this.Ld.De&&!this.Ld.Me&&X("Object already scheduled for deletion");oc.push(this);1===oc.length&&nc&&nc(pc);this.Ld.De=!0;return this};Fc.prototype.Qf=function(a){this.vf&&(a=this.vf(a));return a};Fc.prototype.nf=function(a){this.le&&this.le(a)};Fc.prototype.argPackAdvance=8;Fc.prototype.readValueFromPointer=Ob;Fc.prototype.deleteObject=function(a){if(null!==a)a["delete"]()};
Fc.prototype.fromWireType=function(a){function b(){return this.Ue?Ec(this.Sd.Ee,{Xd:this.eg,Qd:c,ge:this,$d:a}):Ec(this.Sd.Ee,{Xd:this,Qd:a})}var c=this.Qf(a);if(!c)return this.nf(a),null;var f=Dc(this.Sd,c);if(void 0!==f){if(0===f.Ld.count.value)return f.Ld.Qd=c,f.Ld.$d=a,f.clone();f=f.clone();this.nf(a);return f}f=this.Sd.Pf(c);f=rc[f];if(!f)return b.call(this);f=this.Te?f.Ef:f.pointerType;var h=Bc(c,this.Sd,f.Sd);return null===h?b.call(this):this.Ue?Ec(f.Sd.Ee,{Xd:f,Qd:h,ge:this,$d:a}):Ec(f.Sd.Ee,
{Xd:f,Qd:h})};t.getInheritedInstanceCount=function(){return Object.keys(Cc).length};t.getLiveInheritedInstances=function(){var a=[],b;for(b in Cc)Cc.hasOwnProperty(b)&&a.push(Cc[b]);return a};t.flushPendingDeletes=pc;t.setDelayFunction=function(a){nc=a;oc.length&&nc&&nc(pc)};Qc=t.UnboundTypeError=Ub("UnboundTypeError");t.count_emval_handles=function(){for(var a=0,b=5;b<Yc.length;++b)void 0!==Yc[b]&&++a;return a};
t.get_first_emval=function(){for(var a=5;a<Yc.length;++a)if(void 0!==Yc[a])return Yc[a];return null};for(var Y,fe=0;32>fe;++fe)Kd.push(Array(fe));var ge=new Float32Array(288);for(fe=0;288>fe;++fe)Sd[fe]=ge.subarray(0,fe+1);var he=new Int32Array(288);for(fe=0;288>fe;++fe)Td[fe]=he.subarray(0,fe+1);function ce(a){var b=Array(ra(a)+1);sa(a,b,0,b.length);return b}
var ze={Lb:function(a){return Od(a+16)+16},Eb:function(a,b,c){(new Hb(a)).Xf(b,c);Ib++;throw a;},P:function(){return 0},zb:function(){},xb:function(){},Cb:function(){return 0},wb:function(){},tb:function(a,b,c,f,h,l){l<<=12;if(0!==(f&16)&&0!==a%65536)b=-28;else if(0!==(f&32)){a=65536*Math.ceil(b/65536);var n=ie(65536,a);n?(G.fill(0,n,n+a),a=n):a=0;a?(Jb[a]={cg:a,bg:b,Df:!0,fd:h,Gg:c,flags:f,offset:l},b=a):b=-48}else b=-52;return b},sb:function(a,b){var c=Jb[a];0!==b&&c?(b===c.bg&&(Jb[a]=null,c.Df&&
Tc(c.cg)),a=0):a=-28;return a},Q:function(){},yb:function(){},x:function(a){var b=Mb[a];delete Mb[a];var c=b.hf,f=b.le,h=b.rf,l=h.map(function(n){return n.Uf}).concat(h.map(function(n){return n.og}));Xb([a],l,function(n){var q={};h.forEach(function(w,x){var J=n[x],K=w.Sf,Q=w.Tf,A=n[x+h.length],L=w.ng,S=w.pg;q[w.Lf]={read:function(T){return J.fromWireType(K(Q,T))},write:function(T,oa){var ta=[];L(S,T,A.toWireType(ta,oa));Nb(ta)}}});return[{name:b.name,fromWireType:function(w){var x={},J;for(J in q)x[J]=
q[J].read(w);f(w);return x},toWireType:function(w,x){for(var J in q)if(!(J in x))throw new TypeError('Missing field: "'+J+'"');var K=c();for(J in q)q[J].write(K,x[J]);null!==w&&w.push(f,K);return K},argPackAdvance:8,readValueFromPointer:Ob,fe:f}]})},mb:function(){},Fb:function(a,b,c,f,h){var l=ec(c);b=gc(b);dc(a,{name:b,fromWireType:function(n){return!!n},toWireType:function(n,q){return q?f:h},argPackAdvance:8,readValueFromPointer:function(n){if(1===c)var q=nb;else if(2===c)q=cb;else if(4===c)q=
O;else throw new TypeError("Unknown boolean type size: "+b);return this.fromWireType(q[n>>l])},fe:null})},l:function(a,b,c,f,h,l,n,q,w,x,J,K,Q){J=gc(J);l=Pc(h,l);q&&(q=Pc(n,q));x&&(x=Pc(w,x));Q=Pc(K,Q);var A=Sb(J);tc(A,function(){Uc("Cannot construct "+J+" due to unbound types",[f])});Xb([a,b,c],f?[f]:[],function(L){L=L[0];if(f){var S=L.Sd;var T=S.Ee}else T=qc.prototype;L=Tb(A,function(){if(Object.getPrototypeOf(this)!==oa)throw new hc("Use 'new' to construct "+J);if(void 0===ta.oe)throw new hc(J+
" has no accessible constructor");var hb=ta.oe[arguments.length];if(void 0===hb)throw new hc("Tried to invoke ctor of "+J+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(ta.oe).toString()+") parameters instead!");return hb.apply(this,arguments)});var oa=Object.create(T,{constructor:{value:L}});L.prototype=oa;var ta=new uc(J,L,oa,Q,S,l,q,x);S=new Fc(J,ta,!0,!1,!1);T=new Fc(J+"*",ta,!1,!1,!1);var gb=new Fc(J+" const*",ta,!1,!0,!1);rc[a]={pointerType:T,Ef:gb};Gc(A,
L);return[S,T,gb]})},e:function(a,b,c,f,h,l,n){var q=Wc(c,f);b=gc(b);l=Pc(h,l);Xb([],[a],function(w){function x(){Uc("Cannot call "+J+" due to unbound types",q)}w=w[0];var J=w.name+"."+b;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);var K=w.Sd.constructor;void 0===K[b]?(x.Be=c-1,K[b]=x):(sc(K,b,J),K[b].Zd[c-1]=x);Xb([],q,function(Q){Q=[Q[0],null].concat(Q.slice(1));Q=Vc(J,Q,null,l,n);void 0===K[b].Zd?(Q.Be=c-1,K[b]=Q):K[b].Zd[c-1]=Q;return[]});return[]})},u:function(a,b,c,f,h,l){0<b||Ra(void 0);
var n=Wc(b,c);h=Pc(f,h);Xb([],[a],function(q){q=q[0];var w="constructor "+q.name;void 0===q.Sd.oe&&(q.Sd.oe=[]);if(void 0!==q.Sd.oe[b-1])throw new hc("Cannot register multiple constructors with identical number of parameters ("+(b-1)+") for class '"+q.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");q.Sd.oe[b-1]=()=>{Uc("Cannot construct "+q.name+" due to unbound types",n)};Xb([],n,function(x){x.splice(1,0,null);q.Sd.oe[b-1]=Vc(w,x,null,h,
l);return[]});return[]})},d:function(a,b,c,f,h,l,n,q){var w=Wc(c,f);b=gc(b);l=Pc(h,l);Xb([],[a],function(x){function J(){Uc("Cannot call "+K+" due to unbound types",w)}x=x[0];var K=x.name+"."+b;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);q&&x.Sd.fg.push(b);var Q=x.Sd.Ee,A=Q[b];void 0===A||void 0===A.Zd&&A.className!==x.name&&A.Be===c-2?(J.Be=c-2,J.className=x.name,Q[b]=J):(sc(Q,b,K),Q[b].Zd[c-2]=J);Xb([],w,function(L){L=Vc(K,L,x,l,n);void 0===Q[b].Zd?(L.Be=c-2,Q[b]=L):Q[b].Zd[c-2]=L;return[]});
return[]})},V:function(a,b,c){a=gc(a);Xb([],[b],function(f){f=f[0];t[a]=f.fromWireType(c);return[]})},Db:function(a,b){b=gc(b);dc(a,{name:b,fromWireType:function(c){var f=$c(c);Zc(c);return f},toWireType:function(c,f){return zc(f)},argPackAdvance:8,readValueFromPointer:Ob,fe:null})},k:function(a,b,c,f){function h(){}c=ec(c);b=gc(b);h.values={};dc(a,{name:b,constructor:h,fromWireType:function(l){return this.constructor.values[l]},toWireType:function(l,n){return n.value},argPackAdvance:8,readValueFromPointer:ad(b,
c,f),fe:null});tc(b,h)},j:function(a,b,c){var f=bd(a,"enum");b=gc(b);a=f.constructor;f=Object.create(f.constructor.prototype,{value:{value:c},constructor:{value:Tb(f.name+"_"+b,function(){})}});a.values[c]=f;a[b]=f},S:function(a,b,c){c=ec(c);b=gc(b);dc(a,{name:b,fromWireType:function(f){return f},toWireType:function(f,h){return h},argPackAdvance:8,readValueFromPointer:cd(b,c),fe:null})},t:function(a,b,c,f,h,l){var n=Wc(b,c);a=gc(a);h=Pc(f,h);tc(a,function(){Uc("Cannot call "+a+" due to unbound types",
n)},b-1);Xb([],n,function(q){q=[q[0],null].concat(q.slice(1));Gc(a,Vc(a,q,null,h,l),b-1);return[]})},w:function(a,b,c,f,h){b=gc(b);-1===h&&(h=4294967295);h=ec(c);var l=q=>q;if(0===f){var n=32-8*c;l=q=>q<<n>>>n}c=b.includes("unsigned")?function(q,w){return w>>>0}:function(q,w){return w};dc(a,{name:b,fromWireType:l,toWireType:c,argPackAdvance:8,readValueFromPointer:dd(b,h,0!==f),fe:null})},p:function(a,b,c){function f(l){l>>=2;var n=ob;return new h(mb,n[l+1],n[l])}var h=[Int8Array,Uint8Array,Int16Array,
Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][b];c=gc(c);dc(a,{name:c,fromWireType:f,argPackAdvance:8,readValueFromPointer:f},{Wf:!0})},o:function(a,b,c,f,h,l,n,q,w,x,J,K){c=gc(c);l=Pc(h,l);q=Pc(n,q);x=Pc(w,x);K=Pc(J,K);Xb([a],[b],function(Q){Q=Q[0];return[new Fc(c,Q.Sd,!1,!1,!0,Q,f,l,q,x,K)]})},R:function(a,b){b=gc(b);var c="std::string"===b;dc(a,{name:b,fromWireType:function(f){var h=ob[f>>2];if(c)for(var l=f+4,n=0;n<=h;++n){var q=f+4+n;if(n==h||0==G[q]){l=Xa(l,q-l);if(void 0===
w)var w=l;else w+=String.fromCharCode(0),w+=l;l=q+1}}else{w=Array(h);for(n=0;n<h;++n)w[n]=String.fromCharCode(G[f+4+n]);w=w.join("")}Tc(f);return w},toWireType:function(f,h){h instanceof ArrayBuffer&&(h=new Uint8Array(h));var l="string"===typeof h;l||h instanceof Uint8Array||h instanceof Uint8ClampedArray||h instanceof Int8Array||X("Cannot pass non-string to std::string");var n=(c&&l?()=>ra(h):()=>h.length)(),q=Od(4+n+1);ob[q>>2]=n;if(c&&l)sa(h,G,q+4,n+1);else if(l)for(l=0;l<n;++l){var w=h.charCodeAt(l);
255<w&&(Tc(q),X("String has UTF-16 code units that do not fit in 8 bits"));G[q+4+l]=w}else for(l=0;l<n;++l)G[q+4+l]=h[l];null!==f&&f.push(Tc,q);return q},argPackAdvance:8,readValueFromPointer:Ob,fe:function(f){Tc(f)}})},H:function(a,b,c){c=gc(c);if(2===b){var f=ab;var h=db;var l=eb;var n=()=>bb;var q=1}else 4===b&&(f=jb,h=kb,l=lb,n=()=>ob,q=2);dc(a,{name:c,fromWireType:function(w){for(var x=ob[w>>2],J=n(),K,Q=w+4,A=0;A<=x;++A){var L=w+4+A*b;if(A==x||0==J[L>>q])Q=f(Q,L-Q),void 0===K?K=Q:(K+=String.fromCharCode(0),
K+=Q),Q=L+b}Tc(w);return K},toWireType:function(w,x){"string"!==typeof x&&X("Cannot pass non-string to C++ string type "+c);var J=l(x),K=Od(4+J+b);ob[K>>2]=J>>q;h(x,K+4,J+b);null!==w&&w.push(Tc,K);return K},argPackAdvance:8,readValueFromPointer:Ob,fe:function(w){Tc(w)}})},y:function(a,b,c,f,h,l){Mb[a]={name:gc(b),hf:Pc(c,f),le:Pc(h,l),rf:[]}},g:function(a,b,c,f,h,l,n,q,w,x){Mb[a].rf.push({Lf:gc(b),Uf:c,Sf:Pc(f,h),Tf:l,og:n,ng:Pc(q,w),pg:x})},Gb:function(a,b){b=gc(b);dc(a,{Zf:!0,name:b,argPackAdvance:0,
fromWireType:function(){},toWireType:function(){}})},pb:function(){throw"longjmp";},A:function(a,b,c){a=$c(a);b=bd(b,"emval::as");var f=[],h=zc(f);O[c>>2]=h;return b.toWireType(f,a)},M:function(a,b,c,f,h){a=gd[a];b=$c(b);c=fd(c);var l=[];O[f>>2]=zc(l);return a(b,c,l,h)},B:function(a,b,c,f){a=gd[a];b=$c(b);c=fd(c);a(b,c,null,f)},D:Zc,Bb:function(a){if(0===a)return zc(hd());a=fd(a);return zc(hd()[a])},z:function(a,b){var c=kd(a,b),f=c[0];b=f.name+"_$"+c.slice(1).map(function(n){return n.name}).join("_")+
"$";var h=ld[b];if(void 0!==h)return h;var l=Array(a-1);h=jd((n,q,w,x)=>{for(var J=0,K=0;K<a-1;++K)l[K]=c[K+1].readValueFromPointer(x+J),J+=c[K+1].argPackAdvance;n=n[q].apply(n,l);for(K=0;K<a-1;++K)c[K+1].Hf&&c[K+1].Hf(l[K]);if(!f.Zf)return f.toWireType(w,n)});return ld[b]=h},K:function(a,b){a=$c(a);b=$c(b);return zc(a[b])},F:function(a){4<a&&(Yc[a].jf+=1)},rb:function(a,b,c,f){a=$c(a);var h=nd[b];h||(h=md(b),nd[b]=h);return h(a,c,f)},gb:function(){return zc([])},Ka:function(a){return zc(fd(a))},
hb:function(){return zc({})},fb:function(a){a=$c(a);return!a},jb:function(a){var b=$c(a);Nb(b);Zc(a)},v:function(a,b,c){a=$c(a);b=$c(b);c=$c(c);a[b]=c},r:function(a,b){a=bd(a,"_emval_take_value");a=a.readValueFromPointer(b);return zc(a)},a:function(){Ra("")},ob:function(a,b){if(0===a)a=Date.now();else if(1===a||4===a)a=od();else return O[je()>>2]=28,-1;O[b>>2]=a/1E3|0;O[b+4>>2]=a%1E3*1E6|0;return 0},_c:function(a){Y.activeTexture(a)},$c:function(a,b){Y.attachShader(ud[a],xd[b])},ad:function(a,b,c){Y.bindAttribLocation(ud[a],
b,Xa(c))},Y:function(a,b){35051==a?Y.ff=b:35052==a&&(Y.Ce=b);Y.bindBuffer(a,td[b])},X:function(a,b){Y.bindFramebuffer(a,vd[b])},cc:function(a,b){Y.bindRenderbuffer(a,wd[b])},Qb:function(a,b){Y.bindSampler(a,zd[b])},Z:function(a,b){Y.bindTexture(a,la[b])},wc:function(a){Y.bindVertexArray(yd[a])},zc:function(a){Y.bindVertexArray(yd[a])},_:function(a,b,c,f){Y.blendColor(a,b,c,f)},$:function(a){Y.blendEquation(a)},aa:function(a,b){Y.blendFunc(a,b)},Xb:function(a,b,c,f,h,l,n,q,w,x){Y.blitFramebuffer(a,
b,c,f,h,l,n,q,w,x)},ba:function(a,b,c,f){2<=v.version?c?Y.bufferData(a,G,f,c,b):Y.bufferData(a,b,f):Y.bufferData(a,c?G.subarray(c,c+b):b,f)},ca:function(a,b,c,f){2<=v.version?Y.bufferSubData(a,b,G,f,c):Y.bufferSubData(a,b,G.subarray(f,f+c))},dc:function(a){return Y.checkFramebufferStatus(a)},L:function(a){Y.clear(a)},W:function(a,b,c,f){Y.clearColor(a,b,c,f)},O:function(a){Y.clearStencil(a)},db:function(a,b,c,f){return Y.clientWaitSync(Ad[a],b,(c>>>0)+4294967296*f)},da:function(a,b,c,f){Y.colorMask(!!a,
!!b,!!c,!!f)},ea:function(a){Y.compileShader(xd[a])},fa:function(a,b,c,f,h,l,n,q){2<=v.version?Y.Ce?Y.compressedTexImage2D(a,b,c,f,h,l,n,q):Y.compressedTexImage2D(a,b,c,f,h,l,G,q,n):Y.compressedTexImage2D(a,b,c,f,h,l,q?G.subarray(q,q+n):null)},ga:function(a,b,c,f,h,l,n,q,w){2<=v.version?Y.Ce?Y.compressedTexSubImage2D(a,b,c,f,h,l,n,q,w):Y.compressedTexSubImage2D(a,b,c,f,h,l,n,G,w,q):Y.compressedTexSubImage2D(a,b,c,f,h,l,n,w?G.subarray(w,w+q):null)},ha:function(a,b,c,f,h,l,n,q){Y.copyTexSubImage2D(a,
b,c,f,h,l,n,q)},ia:function(){var a=ka(ud),b=Y.createProgram();b.name=a;b.Xe=b.Ve=b.We=0;b.kf=1;ud[a]=b;return a},ja:function(a){var b=ka(xd);xd[b]=Y.createShader(a);return b},ka:function(a){Y.cullFace(a)},la:function(a,b){for(var c=0;c<a;c++){var f=O[b+4*c>>2],h=td[f];h&&(Y.deleteBuffer(h),h.name=0,td[f]=null,f==Y.ff&&(Y.ff=0),f==Y.Ce&&(Y.Ce=0))}},ec:function(a,b){for(var c=0;c<a;++c){var f=O[b+4*c>>2],h=vd[f];h&&(Y.deleteFramebuffer(h),h.name=0,vd[f]=null)}},ma:function(a){if(a){var b=ud[a];b?(Y.deleteProgram(b),
b.name=0,ud[a]=null):Ed(1281)}},fc:function(a,b){for(var c=0;c<a;c++){var f=O[b+4*c>>2],h=wd[f];h&&(Y.deleteRenderbuffer(h),h.name=0,wd[f]=null)}},Rb:function(a,b){for(var c=0;c<a;c++){var f=O[b+4*c>>2],h=zd[f];h&&(Y.deleteSampler(h),h.name=0,zd[f]=null)}},na:function(a){if(a){var b=xd[a];b?(Y.deleteShader(b),xd[a]=null):Ed(1281)}},Zb:function(a){if(a){var b=Ad[a];b?(Y.deleteSync(b),b.name=0,Ad[a]=null):Ed(1281)}},oa:function(a,b){for(var c=0;c<a;c++){var f=O[b+4*c>>2],h=la[f];h&&(Y.deleteTexture(h),
h.name=0,la[f]=null)}},xc:function(a,b){for(var c=0;c<a;c++){var f=O[b+4*c>>2];Y.deleteVertexArray(yd[f]);yd[f]=null}},Ac:function(a,b){for(var c=0;c<a;c++){var f=O[b+4*c>>2];Y.deleteVertexArray(yd[f]);yd[f]=null}},pa:function(a){Y.depthMask(!!a)},qa:function(a){Y.disable(a)},ra:function(a){Y.disableVertexAttribArray(a)},sa:function(a,b,c){Y.drawArrays(a,b,c)},uc:function(a,b,c,f){Y.drawArraysInstanced(a,b,c,f)},sc:function(a,b,c,f,h){Y.pf.drawArraysInstancedBaseInstanceWEBGL(a,b,c,f,h)},qc:function(a,
b){for(var c=Kd[a],f=0;f<a;f++)c[f]=O[b+4*f>>2];Y.drawBuffers(c)},ta:function(a,b,c,f){Y.drawElements(a,b,c,f)},vc:function(a,b,c,f,h){Y.drawElementsInstanced(a,b,c,f,h)},tc:function(a,b,c,f,h,l,n){Y.pf.drawElementsInstancedBaseVertexBaseInstanceWEBGL(a,b,c,f,h,l,n)},kc:function(a,b,c,f,h,l){Y.drawElements(a,f,h,l)},ua:function(a){Y.enable(a)},va:function(a){Y.enableVertexAttribArray(a)},Vb:function(a,b){return(a=Y.fenceSync(a,b))?(b=ka(Ad),a.name=b,Ad[b]=a,b):0},wa:function(){Y.finish()},xa:function(){Y.flush()},
gc:function(a,b,c,f){Y.framebufferRenderbuffer(a,b,c,wd[f])},hc:function(a,b,c,f,h){Y.framebufferTexture2D(a,b,c,la[f],h)},ya:function(a){Y.frontFace(a)},za:function(a,b){Ld(a,b,"createBuffer",td)},ic:function(a,b){Ld(a,b,"createFramebuffer",vd)},jc:function(a,b){Ld(a,b,"createRenderbuffer",wd)},Sb:function(a,b){Ld(a,b,"createSampler",zd)},Aa:function(a,b){Ld(a,b,"createTexture",la)},yc:function(a,b){Ld(a,b,"createVertexArray",yd)},Bc:function(a,b){Ld(a,b,"createVertexArray",yd)},_b:function(a){Y.generateMipmap(a)},
Ba:function(a,b,c){c?O[c>>2]=Y.getBufferParameter(a,b):Ed(1281)},Ca:function(){var a=Y.getError()||Hd;Hd=0;return a},$b:function(a,b,c,f){a=Y.getFramebufferAttachmentParameter(a,b,c);if(a instanceof WebGLRenderbuffer||a instanceof WebGLTexture)a=a.name|0;O[f>>2]=a},E:function(a,b){Md(a,b)},Da:function(a,b,c,f){a=Y.getProgramInfoLog(ud[a]);null===a&&(a="(unknown error)");b=0<b&&f?sa(a,G,f,b):0;c&&(O[c>>2]=b)},Ea:function(a,b,c){if(c)if(a>=sd)Ed(1281);else if(a=ud[a],35716==b)a=Y.getProgramInfoLog(a),
null===a&&(a="(unknown error)"),O[c>>2]=a.length+1;else if(35719==b){if(!a.Xe)for(b=0;b<Y.getProgramParameter(a,35718);++b)a.Xe=Math.max(a.Xe,Y.getActiveUniform(a,b).name.length+1);O[c>>2]=a.Xe}else if(35722==b){if(!a.Ve)for(b=0;b<Y.getProgramParameter(a,35721);++b)a.Ve=Math.max(a.Ve,Y.getActiveAttrib(a,b).name.length+1);O[c>>2]=a.Ve}else if(35381==b){if(!a.We)for(b=0;b<Y.getProgramParameter(a,35382);++b)a.We=Math.max(a.We,Y.getActiveUniformBlockName(a,b).length+1);O[c>>2]=a.We}else O[c>>2]=Y.getProgramParameter(a,
b);else Ed(1281)},ac:function(a,b,c){c?O[c>>2]=Y.getRenderbufferParameter(a,b):Ed(1281)},Fa:function(a,b,c,f){a=Y.getShaderInfoLog(xd[a]);null===a&&(a="(unknown error)");b=0<b&&f?sa(a,G,f,b):0;c&&(O[c>>2]=b)},Nb:function(a,b,c,f){a=Y.getShaderPrecisionFormat(a,b);O[c>>2]=a.rangeMin;O[c+4>>2]=a.rangeMax;O[f>>2]=a.precision},Ga:function(a,b,c){c?35716==b?(a=Y.getShaderInfoLog(xd[a]),null===a&&(a="(unknown error)"),O[c>>2]=a?a.length+1:0):35720==b?(a=Y.getShaderSource(xd[a]),O[c>>2]=a?a.length+1:0):
O[c>>2]=Y.getShaderParameter(xd[a],b):Ed(1281)},J:function(a){var b=Bd[a];if(!b){switch(a){case 7939:b=Y.getSupportedExtensions()||[];b=b.concat(b.map(function(f){return"GL_"+f}));b=Nd(b.join(" "));break;case 7936:case 7937:case 37445:case 37446:(b=Y.getParameter(a))||Ed(1280);b=b&&Nd(b);break;case 7938:b=Y.getParameter(7938);b=2<=v.version?"OpenGL ES 3.0 ("+b+")":"OpenGL ES 2.0 ("+b+")";b=Nd(b);break;case 35724:b=Y.getParameter(35724);var c=b.match(/^WebGL GLSL ES ([0-9]\.[0-9][0-9]?)(?:$| .*)/);
null!==c&&(3==c[1].length&&(c[1]+="0"),b="OpenGL ES GLSL ES "+c[1]+" ("+b+")");b=Nd(b);break;default:Ed(1280)}Bd[a]=b}return b},cb:function(a,b){if(2>v.version)return Ed(1282),0;var c=Cd[a];if(c)return 0>b||b>=c.length?(Ed(1281),0):c[b];switch(a){case 7939:return c=Y.getSupportedExtensions()||[],c=c.concat(c.map(function(f){return"GL_"+f})),c=c.map(function(f){return Nd(f)}),c=Cd[a]=c,0>b||b>=c.length?(Ed(1281),0):c[b];default:return Ed(1280),0}},Ha:function(a,b){b=Xa(b);if(a=ud[a]){var c=a,f=c.Oe,
h=c.xf,l;if(!f)for(c.Oe=f={},c.wf={},l=0;l<Y.getProgramParameter(c,35718);++l){var n=Y.getActiveUniform(c,l);var q=n.name;n=n.size;var w=Pd(q);w=0<w?q.slice(0,w):q;var x=c.kf;c.kf+=n;h[w]=[n,x];for(q=0;q<n;++q)f[x]=q,c.wf[x++]=w}c=a.Oe;f=0;h=b;l=Pd(b);0<l&&(f=parseInt(b.slice(l+1))>>>0,h=b.slice(0,l));if((h=a.xf[h])&&f<h[0]&&(f+=h[1],c[f]=c[f]||Y.getUniformLocation(a,b)))return f}else Ed(1281);return-1},Ob:function(a,b,c){for(var f=Kd[b],h=0;h<b;h++)f[h]=O[c+4*h>>2];Y.invalidateFramebuffer(a,f)},
Pb:function(a,b,c,f,h,l,n){for(var q=Kd[b],w=0;w<b;w++)q[w]=O[c+4*w>>2];Y.invalidateSubFramebuffer(a,q,f,h,l,n)},Wb:function(a){return Y.isSync(Ad[a])},Ia:function(a){return(a=la[a])?Y.isTexture(a):0},Ja:function(a){Y.lineWidth(a)},La:function(a){a=ud[a];Y.linkProgram(a);a.Oe=0;a.xf={}},oc:function(a,b,c,f,h,l){Y.uf.multiDrawArraysInstancedBaseInstanceWEBGL(a,O,b>>2,O,c>>2,O,f>>2,ob,h>>2,l)},pc:function(a,b,c,f,h,l,n,q){Y.uf.multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(a,O,b>>2,c,O,f>>2,
O,h>>2,O,l>>2,ob,n>>2,q)},Ma:function(a,b){3317==a&&(Dd=b);Y.pixelStorei(a,b)},rc:function(a){Y.readBuffer(a)},Na:function(a,b,c,f,h,l,n){if(2<=v.version)if(Y.ff)Y.readPixels(a,b,c,f,h,l,n);else{var q=Qd(l);Y.readPixels(a,b,c,f,h,l,q,n>>31-Math.clz32(q.BYTES_PER_ELEMENT))}else(n=Rd(l,h,c,f,n))?Y.readPixels(a,b,c,f,h,l,n):Ed(1280)},bc:function(a,b,c,f){Y.renderbufferStorage(a,b,c,f)},Yb:function(a,b,c,f,h){Y.renderbufferStorageMultisample(a,b,c,f,h)},Tb:function(a,b,c){Y.samplerParameteri(zd[a],b,
c)},Ub:function(a,b,c){Y.samplerParameteri(zd[a],b,O[c>>2])},Oa:function(a,b,c,f){Y.scissor(a,b,c,f)},Pa:function(a,b,c,f){for(var h="",l=0;l<b;++l){var n=f?O[f+4*l>>2]:-1;h+=Xa(O[c+4*l>>2],0>n?void 0:n)}Y.shaderSource(xd[a],h)},Qa:function(a,b,c){Y.stencilFunc(a,b,c)},Ra:function(a,b,c,f){Y.stencilFuncSeparate(a,b,c,f)},Sa:function(a){Y.stencilMask(a)},Ta:function(a,b){Y.stencilMaskSeparate(a,b)},Ua:function(a,b,c){Y.stencilOp(a,b,c)},Va:function(a,b,c,f){Y.stencilOpSeparate(a,b,c,f)},Wa:function(a,
b,c,f,h,l,n,q,w){if(2<=v.version)if(Y.Ce)Y.texImage2D(a,b,c,f,h,l,n,q,w);else if(w){var x=Qd(q);Y.texImage2D(a,b,c,f,h,l,n,q,x,w>>31-Math.clz32(x.BYTES_PER_ELEMENT))}else Y.texImage2D(a,b,c,f,h,l,n,q,null);else Y.texImage2D(a,b,c,f,h,l,n,q,w?Rd(q,n,f,h,w):null)},Xa:function(a,b,c){Y.texParameterf(a,b,c)},Ya:function(a,b,c){Y.texParameterf(a,b,U[c>>2])},Za:function(a,b,c){Y.texParameteri(a,b,c)},_a:function(a,b,c){Y.texParameteri(a,b,O[c>>2])},lc:function(a,b,c,f,h){Y.texStorage2D(a,b,c,f,h)},$a:function(a,
b,c,f,h,l,n,q,w){if(2<=v.version)if(Y.Ce)Y.texSubImage2D(a,b,c,f,h,l,n,q,w);else if(w){var x=Qd(q);Y.texSubImage2D(a,b,c,f,h,l,n,q,x,w>>31-Math.clz32(x.BYTES_PER_ELEMENT))}else Y.texSubImage2D(a,b,c,f,h,l,n,q,null);else x=null,w&&(x=Rd(q,n,h,l,w)),Y.texSubImage2D(a,b,c,f,h,l,n,q,x)},ab:function(a,b){Y.uniform1f(Z(a),b)},bb:function(a,b,c){if(2<=v.version)Y.uniform1fv(Z(a),U,c>>2,b);else{if(288>=b)for(var f=Sd[b-1],h=0;h<b;++h)f[h]=U[c+4*h>>2];else f=U.subarray(c>>2,c+4*b>>2);Y.uniform1fv(Z(a),f)}},
Wc:function(a,b){Y.uniform1i(Z(a),b)},Xc:function(a,b,c){if(2<=v.version)Y.uniform1iv(Z(a),O,c>>2,b);else{if(288>=b)for(var f=Td[b-1],h=0;h<b;++h)f[h]=O[c+4*h>>2];else f=O.subarray(c>>2,c+4*b>>2);Y.uniform1iv(Z(a),f)}},Yc:function(a,b,c){Y.uniform2f(Z(a),b,c)},Zc:function(a,b,c){if(2<=v.version)Y.uniform2fv(Z(a),U,c>>2,2*b);else{if(144>=b)for(var f=Sd[2*b-1],h=0;h<2*b;h+=2)f[h]=U[c+4*h>>2],f[h+1]=U[c+(4*h+4)>>2];else f=U.subarray(c>>2,c+8*b>>2);Y.uniform2fv(Z(a),f)}},Vc:function(a,b,c){Y.uniform2i(Z(a),
b,c)},Uc:function(a,b,c){if(2<=v.version)Y.uniform2iv(Z(a),O,c>>2,2*b);else{if(144>=b)for(var f=Td[2*b-1],h=0;h<2*b;h+=2)f[h]=O[c+4*h>>2],f[h+1]=O[c+(4*h+4)>>2];else f=O.subarray(c>>2,c+8*b>>2);Y.uniform2iv(Z(a),f)}},Tc:function(a,b,c,f){Y.uniform3f(Z(a),b,c,f)},Sc:function(a,b,c){if(2<=v.version)Y.uniform3fv(Z(a),U,c>>2,3*b);else{if(96>=b)for(var f=Sd[3*b-1],h=0;h<3*b;h+=3)f[h]=U[c+4*h>>2],f[h+1]=U[c+(4*h+4)>>2],f[h+2]=U[c+(4*h+8)>>2];else f=U.subarray(c>>2,c+12*b>>2);Y.uniform3fv(Z(a),f)}},Rc:function(a,
b,c,f){Y.uniform3i(Z(a),b,c,f)},Qc:function(a,b,c){if(2<=v.version)Y.uniform3iv(Z(a),O,c>>2,3*b);else{if(96>=b)for(var f=Td[3*b-1],h=0;h<3*b;h+=3)f[h]=O[c+4*h>>2],f[h+1]=O[c+(4*h+4)>>2],f[h+2]=O[c+(4*h+8)>>2];else f=O.subarray(c>>2,c+12*b>>2);Y.uniform3iv(Z(a),f)}},Pc:function(a,b,c,f,h){Y.uniform4f(Z(a),b,c,f,h)},Oc:function(a,b,c){if(2<=v.version)Y.uniform4fv(Z(a),U,c>>2,4*b);else{if(72>=b){var f=Sd[4*b-1],h=U;c>>=2;for(var l=0;l<4*b;l+=4){var n=c+l;f[l]=h[n];f[l+1]=h[n+1];f[l+2]=h[n+2];f[l+3]=
h[n+3]}}else f=U.subarray(c>>2,c+16*b>>2);Y.uniform4fv(Z(a),f)}},Cc:function(a,b,c,f,h){Y.uniform4i(Z(a),b,c,f,h)},Dc:function(a,b,c){if(2<=v.version)Y.uniform4iv(Z(a),O,c>>2,4*b);else{if(72>=b)for(var f=Td[4*b-1],h=0;h<4*b;h+=4)f[h]=O[c+4*h>>2],f[h+1]=O[c+(4*h+4)>>2],f[h+2]=O[c+(4*h+8)>>2],f[h+3]=O[c+(4*h+12)>>2];else f=O.subarray(c>>2,c+16*b>>2);Y.uniform4iv(Z(a),f)}},Ec:function(a,b,c,f){if(2<=v.version)Y.uniformMatrix2fv(Z(a),!!c,U,f>>2,4*b);else{if(72>=b)for(var h=Sd[4*b-1],l=0;l<4*b;l+=4)h[l]=
U[f+4*l>>2],h[l+1]=U[f+(4*l+4)>>2],h[l+2]=U[f+(4*l+8)>>2],h[l+3]=U[f+(4*l+12)>>2];else h=U.subarray(f>>2,f+16*b>>2);Y.uniformMatrix2fv(Z(a),!!c,h)}},Fc:function(a,b,c,f){if(2<=v.version)Y.uniformMatrix3fv(Z(a),!!c,U,f>>2,9*b);else{if(32>=b)for(var h=Sd[9*b-1],l=0;l<9*b;l+=9)h[l]=U[f+4*l>>2],h[l+1]=U[f+(4*l+4)>>2],h[l+2]=U[f+(4*l+8)>>2],h[l+3]=U[f+(4*l+12)>>2],h[l+4]=U[f+(4*l+16)>>2],h[l+5]=U[f+(4*l+20)>>2],h[l+6]=U[f+(4*l+24)>>2],h[l+7]=U[f+(4*l+28)>>2],h[l+8]=U[f+(4*l+32)>>2];else h=U.subarray(f>>
2,f+36*b>>2);Y.uniformMatrix3fv(Z(a),!!c,h)}},Gc:function(a,b,c,f){if(2<=v.version)Y.uniformMatrix4fv(Z(a),!!c,U,f>>2,16*b);else{if(18>=b){var h=Sd[16*b-1],l=U;f>>=2;for(var n=0;n<16*b;n+=16){var q=f+n;h[n]=l[q];h[n+1]=l[q+1];h[n+2]=l[q+2];h[n+3]=l[q+3];h[n+4]=l[q+4];h[n+5]=l[q+5];h[n+6]=l[q+6];h[n+7]=l[q+7];h[n+8]=l[q+8];h[n+9]=l[q+9];h[n+10]=l[q+10];h[n+11]=l[q+11];h[n+12]=l[q+12];h[n+13]=l[q+13];h[n+14]=l[q+14];h[n+15]=l[q+15]}}else h=U.subarray(f>>2,f+64*b>>2);Y.uniformMatrix4fv(Z(a),!!c,h)}},
Hc:function(a){a=ud[a];Y.useProgram(a);Y.Gf=a},Ic:function(a,b){Y.vertexAttrib1f(a,b)},Jc:function(a,b){Y.vertexAttrib2f(a,U[b>>2],U[b+4>>2])},Kc:function(a,b){Y.vertexAttrib3f(a,U[b>>2],U[b+4>>2],U[b+8>>2])},Lc:function(a,b){Y.vertexAttrib4f(a,U[b>>2],U[b+4>>2],U[b+8>>2],U[b+12>>2])},mc:function(a,b){Y.vertexAttribDivisor(a,b)},nc:function(a,b,c,f,h){Y.vertexAttribIPointer(a,b,c,f,h)},Mc:function(a,b,c,f,h,l){Y.vertexAttribPointer(a,b,c,!!f,h,l)},Nc:function(a,b,c,f){Y.viewport(a,b,c,f)},eb:function(a,
b,c,f){Y.waitSync(Ad[a],b,(c>>>0)+4294967296*f)},qb:function(a){var b=G.length;a>>>=0;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var f=b*(1+.2/c);f=Math.min(f,a+100663296);f=Math.max(a,f);0<f%65536&&(f+=65536-f%65536);a:{try{Sa.grow(Math.min(2147483648,f)-mb.byteLength+65535>>>16);qb();var h=1;break a}catch(l){}h=void 0}if(h)return!0}return!1},ib:function(){return v?v.Vf:0},ub:function(a,b){var c=0;Vd().forEach(function(f,h){var l=b+c;h=O[a+4*h>>2]=l;for(l=0;l<f.length;++l)nb[h++>>0]=f.charCodeAt(l);
nb[h>>0]=0;c+=f.length+1});return 0},vb:function(a,b){var c=Vd();O[a>>2]=c.length;var f=0;c.forEach(function(h){f+=h.length+1});O[b>>2]=f;return 0},Hb:function(a){if(!(noExitRuntime||0<La)){if(t.onExit)t.onExit(a);Ua=!0}xa(a,new Ka(a))},G:function(){return 0},kb:function(a,b,c,f,h,l){a=Lb.Rf(a);b=Lb.If(a,b,c,f);O[l>>2]=b;return 0},Ab:function(a,b,c,f){a=Lb.Rf(a);b=Lb.If(a,b,c);O[f>>2]=b;return 0},lb:function(){},N:function(a,b,c,f){for(var h=0,l=0;l<c;l++){var n=O[b>>2],q=O[b+4>>2];b+=8;for(var w=
0;w<q;w++){var x=G[n+w],J=Kb[a];0===x||10===x?((1===a?Na:Ma)(Wa(J,0)),J.length=0):J.push(x)}h+=q}O[f>>2]=h;return 0},b:function(){return Pa},i:ke,n:le,f:me,C:ne,Mb:oe,U:pe,T:qe,I:re,m:se,s:te,h:ue,q:ve,Kb:we,Ib:xe,Jb:ye,c:function(a){Pa=a},nb:function(a,b,c,f){return be(a,b,c,f)}};
(function(){function a(h){t.asm=h.exports;Sa=t.asm.bd;qb();rb=t.asm.dd;tb.unshift(t.asm.cd);wb--;t.monitorRunDependencies&&t.monitorRunDependencies(wb);0==wb&&(null!==xb&&(clearInterval(xb),xb=null),zb&&(h=zb,zb=null,h()))}function b(h){a(h.instance)}function c(h){return Eb().then(function(l){return WebAssembly.instantiate(l,f)}).then(function(l){return l}).then(h,function(l){Ma("failed to asynchronously prepare wasm: "+l);Ra(l)})}var f={a:ze};wb++;t.monitorRunDependencies&&t.monitorRunDependencies(wb);
if(t.instantiateWasm)try{return t.instantiateWasm(f,a)}catch(h){return Ma("Module.instantiateWasm callback failed with error: "+h),!1}(function(){return Qa||"function"!==typeof WebAssembly.instantiateStreaming||Ab()||Bb.startsWith("file://")||"function"!==typeof fetch?c(b):fetch(Bb,{credentials:"same-origin"}).then(function(h){return WebAssembly.instantiateStreaming(h,f).then(b,function(l){Ma("wasm streaming compile failed: "+l);Ma("falling back to ArrayBuffer instantiation");return c(b)})})})().catch(ha);
return{}})();t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.cd).apply(null,arguments)};var Od=t._malloc=function(){return(Od=t._malloc=t.asm.ed).apply(null,arguments)},Tc=t._free=function(){return(Tc=t._free=t.asm.fd).apply(null,arguments)},je=t.___errno_location=function(){return(je=t.___errno_location=t.asm.gd).apply(null,arguments)},Sc=t.___getTypeName=function(){return(Sc=t.___getTypeName=t.asm.hd).apply(null,arguments)};
t.___embind_register_native_and_builtin_types=function(){return(t.___embind_register_native_and_builtin_types=t.asm.id).apply(null,arguments)};var ie=t._memalign=function(){return(ie=t._memalign=t.asm.jd).apply(null,arguments)},Ae=t._setThrew=function(){return(Ae=t._setThrew=t.asm.kd).apply(null,arguments)},Be=t.stackSave=function(){return(Be=t.stackSave=t.asm.ld).apply(null,arguments)},Ce=t.stackRestore=function(){return(Ce=t.stackRestore=t.asm.md).apply(null,arguments)};
t.dynCall_iiiji=function(){return(t.dynCall_iiiji=t.asm.nd).apply(null,arguments)};t.dynCall_ji=function(){return(t.dynCall_ji=t.asm.od).apply(null,arguments)};t.dynCall_iiji=function(){return(t.dynCall_iiji=t.asm.pd).apply(null,arguments)};t.dynCall_iijjiii=function(){return(t.dynCall_iijjiii=t.asm.qd).apply(null,arguments)};t.dynCall_iij=function(){return(t.dynCall_iij=t.asm.rd).apply(null,arguments)};t.dynCall_vijjjii=function(){return(t.dynCall_vijjjii=t.asm.sd).apply(null,arguments)};
t.dynCall_viji=function(){return(t.dynCall_viji=t.asm.td).apply(null,arguments)};t.dynCall_vijiii=function(){return(t.dynCall_vijiii=t.asm.ud).apply(null,arguments)};t.dynCall_viiiiij=function(){return(t.dynCall_viiiiij=t.asm.vd).apply(null,arguments)};t.dynCall_jii=function(){return(t.dynCall_jii=t.asm.wd).apply(null,arguments)};t.dynCall_iiij=function(){return(t.dynCall_iiij=t.asm.xd).apply(null,arguments)};t.dynCall_iiiij=function(){return(t.dynCall_iiiij=t.asm.yd).apply(null,arguments)};
t.dynCall_viij=function(){return(t.dynCall_viij=t.asm.zd).apply(null,arguments)};t.dynCall_viiij=function(){return(t.dynCall_viiij=t.asm.Ad).apply(null,arguments)};t.dynCall_vij=function(){return(t.dynCall_vij=t.asm.Bd).apply(null,arguments)};t.dynCall_jiiii=function(){return(t.dynCall_jiiii=t.asm.Cd).apply(null,arguments)};t.dynCall_jiiiiii=function(){return(t.dynCall_jiiiiii=t.asm.Dd).apply(null,arguments)};t.dynCall_jiiiiji=function(){return(t.dynCall_jiiiiji=t.asm.Ed).apply(null,arguments)};
t.dynCall_iijj=function(){return(t.dynCall_iijj=t.asm.Fd).apply(null,arguments)};t.dynCall_jiji=function(){return(t.dynCall_jiji=t.asm.Gd).apply(null,arguments)};t.dynCall_viijii=function(){return(t.dynCall_viijii=t.asm.Hd).apply(null,arguments)};t.dynCall_iiiiij=function(){return(t.dynCall_iiiiij=t.asm.Id).apply(null,arguments)};t.dynCall_iiiiijj=function(){return(t.dynCall_iiiiijj=t.asm.Jd).apply(null,arguments)};t.dynCall_iiiiiijj=function(){return(t.dynCall_iiiiiijj=t.asm.Kd).apply(null,arguments)};
function ke(a,b){var c=Be();try{return Gb(a)(b)}catch(f){Ce(c);if(f!==f+0&&"longjmp"!==f)throw f;Ae(1,0)}}function le(a,b,c){var f=Be();try{return Gb(a)(b,c)}catch(h){Ce(f);if(h!==h+0&&"longjmp"!==h)throw h;Ae(1,0)}}function ue(a,b,c,f){var h=Be();try{Gb(a)(b,c,f)}catch(l){Ce(h);if(l!==l+0&&"longjmp"!==l)throw l;Ae(1,0)}}function me(a,b,c,f){var h=Be();try{return Gb(a)(b,c,f)}catch(l){Ce(h);if(l!==l+0&&"longjmp"!==l)throw l;Ae(1,0)}}
function se(a,b){var c=Be();try{Gb(a)(b)}catch(f){Ce(c);if(f!==f+0&&"longjmp"!==f)throw f;Ae(1,0)}}function te(a,b,c){var f=Be();try{Gb(a)(b,c)}catch(h){Ce(f);if(h!==h+0&&"longjmp"!==h)throw h;Ae(1,0)}}function oe(a,b,c,f,h,l){var n=Be();try{return Gb(a)(b,c,f,h,l)}catch(q){Ce(n);if(q!==q+0&&"longjmp"!==q)throw q;Ae(1,0)}}function ve(a,b,c,f,h){var l=Be();try{Gb(a)(b,c,f,h)}catch(n){Ce(l);if(n!==n+0&&"longjmp"!==n)throw n;Ae(1,0)}}
function pe(a,b,c,f,h,l,n){var q=Be();try{return Gb(a)(b,c,f,h,l,n)}catch(w){Ce(q);if(w!==w+0&&"longjmp"!==w)throw w;Ae(1,0)}}function ne(a,b,c,f,h){var l=Be();try{return Gb(a)(b,c,f,h)}catch(n){Ce(l);if(n!==n+0&&"longjmp"!==n)throw n;Ae(1,0)}}function we(a,b,c,f,h,l){var n=Be();try{Gb(a)(b,c,f,h,l)}catch(q){Ce(n);if(q!==q+0&&"longjmp"!==q)throw q;Ae(1,0)}}function ye(a,b,c,f,h,l,n,q,w,x){var J=Be();try{Gb(a)(b,c,f,h,l,n,q,w,x)}catch(K){Ce(J);if(K!==K+0&&"longjmp"!==K)throw K;Ae(1,0)}}
function re(a){var b=Be();try{Gb(a)()}catch(c){Ce(b);if(c!==c+0&&"longjmp"!==c)throw c;Ae(1,0)}}function xe(a,b,c,f,h,l,n){var q=Be();try{Gb(a)(b,c,f,h,l,n)}catch(w){Ce(q);if(w!==w+0&&"longjmp"!==w)throw w;Ae(1,0)}}function qe(a,b,c,f,h,l,n,q,w,x){var J=Be();try{return Gb(a)(b,c,f,h,l,n,q,w,x)}catch(K){Ce(J);if(K!==K+0&&"longjmp"!==K)throw K;Ae(1,0)}}var De;function Ka(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}zb=function Ee(){De||Fe();De||(zb=Ee)};
function Fe(){function a(){if(!De&&(De=!0,t.calledRun=!0,!Ua)){Fb(tb);fa(t);if(t.onRuntimeInitialized)t.onRuntimeInitialized();if(t.postRun)for("function"==typeof t.postRun&&(t.postRun=[t.postRun]);t.postRun.length;){var b=t.postRun.shift();ub.unshift(b)}Fb(ub)}}if(!(0<wb)){if(t.preRun)for("function"==typeof t.preRun&&(t.preRun=[t.preRun]);t.preRun.length;)vb();Fb(sb);0<wb||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1);a()},1)):a())}}
t.run=Fe;if(t.preInit)for("function"==typeof t.preInit&&(t.preInit=[t.preInit]);0<t.preInit.length;)t.preInit.pop()();Fe();
return CanvasKitInit.ready
}
);
})();
if (typeof exports === 'object' && typeof module === 'object')
module.exports = CanvasKitInit;
else if (typeof define === 'function' && define['amd'])
define([], function() { return CanvasKitInit; });
else if (typeof exports === 'object')
exports["CanvasKitInit"] = CanvasKitInit;

Binary file not shown.

View File

@ -0,0 +1 @@
<svg viewBox="0 0 375 375" style="width:32px;height:32px;margin:0 4px 4px 0" xmlns="http://www.w3.org/2000/svg"><rect transform="matrix(.91553 0 0 .91553 -152.92 116.76)" x="167.03" y="-127.54" width="409.6" height="409.6" rx="64" ry="64" fill="#0071ff"></rect><path d="M150.428 322.264c-29.063-6.202-53.897-22.439-73.115-47.804-19.507-25.746-27.838-55.355-25.723-91.414 6.655-62.013 47.667-106.753 99.687-120.411 4.509-.989 8.353-3.462 12.55-1.322 3.22 1.64 6.028 4.467 7.206 7.251 1.25 2.955 1.877 21.54.99 29.331-1.076 9.46-3.877 12.418-14.566 15.388-29.723 10.195-48.105 34.07-53.697 61.017-4.8 29.668 2.951 59.729 21.528 78.727 8.966 8.993 17.92 14.24 30.869 18.086 8.646 2.57 13.393 5.758 15.036 10.102 1.085 2.867 1.63 22.984.779 28.772-1.33 9.046-1.702 9.796-5.792 11.667-5.029 2.3-7.404 2.392-15.752.61zm50.708.29c-3.092-1.402-5.673-4.83-6.73-8.94-.134-9.408-2.366-25.754 1.02-33.373 1.88-4.128 4.65-5.999 12.433-8.396 21.267-6.551 37.593-19.88 46.806-38.213 11.11-22.108 11.877-55.183 1.808-77.975-9.154-20.723-25.7-35.217-48.555-42.534-8.872-2.84-12.004-5.065-12.968-9.21-1.002-4.31-1.435-19.87-.785-28.218.682-8.766 1.249-9.99 6.162-13.318 3.701-2.505 5.482-2.446 17.223.575 36.718 10.077 65.97 33.597 83.026 66.68 18.495 37.034 19.191 86.11 1.742 122.655-17.233 36.09-50.591 62.511-88.622 70.194-8.172 1.65-9.07 1.656-12.56.073z" fill="#fff"></path></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,170 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="Remote Desktop.">
<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="RustDesk">
<link rel="apple-touch-icon" href="icons/Icon-192.png">
<!-- Favicon -->
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
<title>RustDesk</title>
<link rel="manifest" href="manifest.json">
<script src="ogvjs-1.8.6/ogv.js"></script>
<script>
var api = ["这里修改你的地址"];
</script>
<script type="module" crossorigin src="module/index.b7bb6fa2.js"></script>
<script src="js/yuv-canvas-1.2.6.js"></script>
<style>
.loading {
display: flex;
justify-content: center;
align-items: center;
margin: 0;
position: absolute;
top: 50%;
left: 50%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.loader {
border: 16px solid #f3f3f3;
border-radius: 50%;
border: 15px solid;
border-top: 16px solid #024eff;
border-right: 16px solid white;
border-bottom: 16px solid #024eff;
border-left: 16px solid white;
width: 120px;
height: 120px;
-webkit-animation: spin 2s linear infinite;
animation: spin 2s linear infinite;
}
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div class="loading">
<div class="loader"></div>
</div>
<!-- This script installs service_worker.js to provide PWA functionality to
application. For more information, see:
https://developers.google.com/web/fundamentals/primers/service-workers -->
<script>
var serviceWorkerVersion = null;
var scriptLoaded = false;
function loadMainDartJs() {
if (scriptLoaded) {
return;
}
scriptLoaded = true;
var scriptTag = document.createElement('script');
scriptTag.src = 'js/main.dart.js';
scriptTag.type = 'application/javascript';
document.body.append(scriptTag);
}
if ('serviceWorker' in navigator) {
// Service workers are supported. Use them.
window.addEventListener('load', function () {
// Wait for registration to finish before dropping the <script> tag.
// Otherwise, the browser will load the script multiple times,
// potentially different versions.
var serviceWorkerUrl = 'flutter_service_worker.js?v=' + serviceWorkerVersion;
navigator.serviceWorker.register(serviceWorkerUrl)
.then((reg) => {
function waitForActivation(serviceWorker) {
serviceWorker.addEventListener('statechange', () => {
if (serviceWorker.state == 'activated') {
console.log('Installed new service worker.');
loadMainDartJs();
}
});
}
if (!reg.active && (reg.installing || reg.waiting)) {
// No active web worker and we have installed or are installing
// one for the first time. Simply wait for it to activate.
waitForActivation(reg.installing || reg.waiting);
} else if (!reg.active.scriptURL.endsWith(serviceWorkerVersion)) {
// When the app updates the serviceWorkerVersion changes, so we
// need to ask the service worker to update.
console.log('New service worker available.');
reg.update();
waitForActivation(reg.installing);
} else {
// Existing service worker is still good.
console.log('Loading app from service worker.');
loadMainDartJs();
}
});
// If service worker doesn't succeed in a reasonable amount of time,
// fallback to plaint <script> tag.
setTimeout(() => {
if (!scriptLoaded) {
console.warn(
'Failed to load app from service worker. Falling back to plain <script> tag.',
);
loadMainDartJs();
}
}, 4000);
});
} else {
// Service workers not supported. Just drop the <script> tag.
loadMainDartJs();
}
</script>
<script src="libs/firebase-app.js?8.10.1"></script>
<script>
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
apiKey: "AIzaSyCgehIZk1aFP0E7wZtYRRqrfvNiNAF39-A",
authDomain: "rustdesk.firebaseapp.com",
databaseURL: "https://rustdesk.firebaseio.com",
projectId: "rustdesk",
storageBucket: "rustdesk.appspot.com",
messagingSenderId: "768133699366",
appId: "1:768133699366:web:d50faf0792cb208d7993e7",
measurementId: "G-9PEH85N6ZQ"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
//firebase.analytics();
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,73 @@
var wasmExports;
fetch('js/yuv.wasm').then(function (res) { return res.arrayBuffer(); })
.then(function (file) { return WebAssembly.instantiate(file); })
.then(function (wasm) {
wasmExports = wasm.instance.exports;
console.log('yuv ready');
});
var yPtr, yPtrLen, uPtr, uPtrLen, vPtr, vPtrLen, outPtr, outPtrLen;
let testSpeed = [0, 0];
function I420ToARGB(yb) {
if (!wasmExports) return;
var tm0 = new Date().getTime();
var { malloc, free, memory } = wasmExports;
var HEAPU8 = new Uint8Array(memory.buffer);
let n = yb.y.bytes.length;
if (yPtrLen != n) {
if (yPtr) free(yPtr);
yPtrLen = n;
yPtr = malloc(n);
}
HEAPU8.set(yb.y.bytes, yPtr);
n = yb.u.bytes.length;
if (uPtrLen != n) {
if (uPtr) free(uPtr);
uPtrLen = n;
uPtr = malloc(n);
}
HEAPU8.set(yb.u.bytes, uPtr);
n = yb.v.bytes.length;
if (vPtrLen != n) {
if (vPtr) free(vPtr);
vPtrLen = n;
vPtr = malloc(n);
}
HEAPU8.set(yb.v.bytes, vPtr);
var w = yb.format.displayWidth;
var h = yb.format.displayHeight;
n = w * h * 4;
if (outPtrLen != n) {
if (outPtr) free(outPtr);
outPtrLen = n;
outPtr = malloc(n);
HEAPU8.fill(255, outPtr, outPtr + n);
}
// var res = wasmExports.I420ToARGB(yPtr, yb.y.stride, uPtr, yb.u.stride, vPtr, yb.v.stride, outPtr, w * 4, w, h);
// var res = wasmExports.AVX_YUV_to_ARGB(outPtr, yPtr, yb.y.stride, uPtr, yb.u.stride, vPtr, yb.v.stride, w, h);
var res = wasmExports.yuv420_rgb24_std(w, h, yPtr, uPtr, vPtr, yb.y.stride, yb.v.stride, outPtr, w * 4, 1);
var out = HEAPU8.slice(outPtr, outPtr + n);
testSpeed[1] += new Date().getTime() - tm0;
testSpeed[0] += 1;
if (testSpeed[0] > 30) {
console.log('yuv: ' + parseInt('' + testSpeed[1] / testSpeed[0]));
testSpeed = [0, 0];
}
return out;
}
var currentFrame;
self.addEventListener('message', (e) => {
currentFrame = e.data;
});
function run() {
if (currentFrame) {
self.postMessage(I420ToARGB(currentFrame));
currentFrame = undefined;
}
setTimeout(run, 1);
}
run();

Binary file not shown.

5555
static/web-client/libopus.js Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,35 @@
{
"name": "rustdesk",
"short_name": "rustdesk",
"start_url": ".",
"display": "standalone",
"background_color": "#0175C2",
"theme_color": "#0175C2",
"description": "Remote Desktop.",
"orientation": "portrait-primary",
"prefer_related_applications": false,
"icons": [
{
"src": "icons/Icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/Icon-512.png",
"sizes": "512x512",
"type": "image/png"
},
{
"src": "icons/Icon-maskable-192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "icons/Icon-maskable-512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
]
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,21 @@
ogv.js wrapper and player code
Copyright (c) 2013-2019 Brion Vibber and other contributors
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.

View File

@ -0,0 +1,23 @@
Copyright © 2018-2019, VideoLAN and dav1d authors
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -0,0 +1,28 @@
Copyright (c) 2002, Xiph.org Foundation
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -0,0 +1,44 @@
Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic,
Jean-Marc Valin, Timothy B. Terriberry,
CSIRO, Gregory Maxwell, Mark Borgerding,
Erik de Castro Lopo
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of Internet Society, IETF or IETF Trust, nor the
names of specific contributors, may be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Opus is subject to the royalty-free patent licenses which are
specified at:
Xiph.Org Foundation:
https://datatracker.ietf.org/ipr/1524/
Microsoft Corporation:
https://datatracker.ietf.org/ipr/1914/
Broadcom Corporation:
https://datatracker.ietf.org/ipr/1526/

View File

@ -0,0 +1,28 @@
Copyright (C) 2002-2009 Xiph.org Foundation
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -0,0 +1,28 @@
Copyright (c) 2002-2018 Xiph.org Foundation
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of the Xiph.org Foundation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -0,0 +1,13 @@
Copyright © 2010 Mozilla Foundation
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View File

@ -0,0 +1,31 @@
Copyright (c) 2010, The WebM Project authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Google, nor the WebM Project, nor the names
of its contributors may be used to endorse or promote products
derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -0,0 +1,23 @@
Additional IP Rights Grant (Patents)
------------------------------------
"These implementations" means the copyrightable works that implement the WebM
codecs distributed by Google as part of the WebM Project.
Google hereby grants to you a perpetual, worldwide, non-exclusive, no-charge,
royalty-free, irrevocable (except as stated in this section) patent license to
make, have made, use, offer to sell, sell, import, transfer, and otherwise
run, modify and propagate the contents of these implementations of WebM, where
such license applies only to those patent claims, both currently owned by
Google and acquired in the future, licensable by Google that are necessarily
infringed by these implementations of WebM. This grant does not include claims
that would be infringed only as a consequence of further modification of these
implementations. If you or your agent or exclusive licensee institute or order
or agree to the institution of patent litigation or any other patent
enforcement activity against any entity (including a cross-claim or
counterclaim in a lawsuit) alleging that any of these implementations of WebM
or any code incorporated within any of these implementations of WebM
constitute direct or contributory patent infringement, or inducement of
patent infringement, then any patent rights granted to you under this License
for these implementations of WebM shall terminate as of the date such
litigation is filed.

View File

@ -0,0 +1,391 @@
ogv.js
======
Media decoder and player for Ogg Vorbis/Opus/Theora and WebM VP8/VP9/AV1 video.
Based around libogg, libvorbis, libtheora, libopus, libvpx, libnestegg and dav1d compiled to JavaScript and WebAssembly with Emscripten.
## Updates
1.8.6 - 2022-01-12
* Bump to yuv-canvas
* Fix demo for removal of video-canvas mode
1.8.5 - 2022-01-11
* Remove unnecessary user-agent checks
* Remove flaky, obsolete support for faking CSS `object-fit`
* Remove experimental support for streaming `<canvas>` into `<video>`
1.8.4 - 2021-07-02
* Fix for fix for OGVLoader.base fix
1.8.3 - 2021-07-02
* Fixes for build with emscripten 2.0.25
* Fix for nextTick/setImmediate-style polyfill in front-end
* Provisional fix for OGVLoader.base not working with CDNs
* the fallback code for loading a non-local worker had been broken with WebAssembly for some time, sorry!
1.8.2 - errored out
1.8.1 - 2021-02-18
* Fixed OGVCompat APIs to correctly return false without WebAssembly and Web Audio
1.8.0 - 2021-02-09
* Dropping IE support and Flash audio backend
* Updated to stream-file 0.3.0
* Updated to audio-feeder 0.5.0
* The old IE 10/11 support _no longer works_ due to the Flash plugin being disabled, and so is being removed
* Drop es6-promise shim
* Now requires WebAssembly, which requires native Promise support
* Build & fixes
* Demo fixed (removed test files that are now offline)
* Builds with emscripten 2.0.13
* Requires latest meson from git pending a fix hitting release
1.7.0 - 2020-09-28
* Builds with emscripten's LLVM upstream backend
* Updated to build with emscripten 2.0.4
* Reduced amount of memory used between GC runs by reusing frame buffers
* Removed `memoryLimit` option
* JS, Wasm, and threaded Wasm builds now all use dynamic memory growth
* Updated dav1d
* Updated libvpx to 1.8.1
* Experimental SIMD builds of AV1 decoder optional, with `make SIMD=1`
* These work in Chrome with the "WebAssembly SIMD" flag enabled in chrome://flags/
* Significant speed boost when available.
* Available with and without multithreading.
* Must enable explicitly with `simd: true` in `options`.
* Experimental SIMD work for VP9 as well, incomplete.
1.6.1 - 2019-06-18
* playbackSpeed attribute now supported
* updated audio-feeder to 0.4.21;
* mono audio is now less loud, matching native playback better
* audio resampling now uses linear interpolation for upscaling
* fix for IE in bundling scenarios that use strict mode
* tempo change support thanks to a great patch from velochy!
* updated yuv-canvas to 1.2.6;
* fixes for capturing WebGL canvas as MediaStream
* fixes for seeks on low frame rate video
* updated emscripten toolchain to 1.38.36
* drop OUTLINING_LIMIT from AV1 JS build; doesn't work in newer emscripten and not really needed
1.6.0 - 2019-02-26
* experimental support for AV1 video in WebM
* update buildchain to emscripten 1.38.28
* fix a stray global
* starting to move to ES6 classes and modules
* building with babel for ES5/IE11 compat
* updated eslint
* updated yuv-canvas to 1.2.4; fixes for software GL rendering
* updated audio-feeder to 0.4.15; fixes for resampling and Flash perf
* retooled buffer copies
* sync fix for audio packets with discard padding
* clients can pass a custom `StreamFile` instance as `{stream:foo}` in options. This can be useful for custom streaming until MSE interfaces are ready.
* refactored WebM keyframe detection
* prefill the frame pipeline as well as the audio pipeline before starting audio
* removed BINARYEN_IGNORE_IMPLICIT_TRAPS=1 option which can cause intermittent breakages
* changed download streaming method to avoid data corruption problem on certain files
* fix for seek on very short WebM files
* fix for replay-after-end-of-playback in WebM
See more details and history in [CHANGES.md](https://github.com/brion/ogv.js/blob/master/CHANGES.md)
## Current status
Note that as of 2021 ogv.js works pretty nicely but may still have some packagine oddities with tools like webpack. It should work via CDNs again as of 1.8.2 if you can't or don't want to package locally, but this is not documented well yet. Improved documentation will come with the next major update & code cleanup!
Since August 2015, ogv.js can be seen in action [on Wikipedia and Wikimedia Commons](https://commons.wikimedia.org/wiki/Commons:Video) in Safari and IE/Edge where native Ogg and WebM playback is not available. (See [technical details on MediaWiki integration](https://www.mediawiki.org/wiki/Extension:TimedMediaHandler/ogv.js).)
See also a standalone demo with performance metrics at https://brionv.com/misc/ogv.js/demo/
* streaming: yes (with Range header)
* seeking: yes for Ogg and WebM (with Range header)
* color: yes
* audio: yes, with a/v sync (requires Web Audio or Flash)
* background threading: yes (video, audio decoders in Workers)
* [GPU accelerated drawing: yes (WebGL)](https://github.com/brion/ogv.js/wiki/GPU-acceleration)
* GPU accelerated decoding: no
* SIMD acceleration: no
* Web Assembly: yes (with asm.js fallback)
* multithreaded VP8, VP9, AV1: in development (set `options.threading` to `true`; requires flags to be enabled in Firefox 65 and Chrome 72, no support yet in Safari)
* controls: no (currently provided by demo or other UI harness)
Ogg and WebM files are fairly well supported.
## Goals
Long-form goal is to create a drop-in replacement for the HTML5 video and audio tags which can be used for basic playback of Ogg Theora and Vorbis or WebM media on browsers that don't support Ogg or WebM natively.
The API isn't quite complete, but works pretty well.
## Compatibility
ogv.js requires a fast JS engine with typed arrays, and Web Audio for audio playback.
The primary target browsers are (testing 360p/30fps and up):
* Safari 6.1-12 on Mac OS X 10.7-10.14
* Safari on iOS 10-11 64-bit
Older versions of Safari have flaky JIT compilers. IE 9 and below lack typed arrays, and IE 10/11 no longer support an audio channel since the Flash plugin was sunset.
(Note that Windows and Mac OS X can support Ogg and WebM by installing codecs or alternate browsers with built-in support, but this is not possible on iOS where all browsers are really Safari.)
Testing browsers (these support .ogv and .webm natively):
* Firefox 65
* Chrome 73
## Package installation
Pre-built releases of ogv.js are available as [.zip downloads from the GitHub releases page](https://github.com/brion/ogv.js/releases) and through the npm package manager.
You can load the `ogv.js` main entry point directly in a script tag, or bundle it through whatever build process you like. The other .js files must be made available for runtime loading, together in the same directory.
ogv.js will try to auto-detect the path to its resources based on the script element that loads ogv.js or ogv-support.js. If you load ogv.js through another bundler (such as browserify or MediaWiki's ResourceLoader) you may need to override this manually before instantiating players:
```
// Path to ogv-demuxer-ogg.js, ogv-worker-audio.js, etc
OGVLoader.base = '/path/to/resources';
```
To fetch from npm:
```
npm install ogv
```
The distribution-ready files will appear in 'node_modules/ogv/dist'.
To load the player library into your browserify or webpack project:
```
var ogv = require('ogv');
// Access public classes either as ogv.OGVPlayer or just OGVPlayer.
// Your build/lint tools may be happier with ogv.OGVPlayer!
ogv.OGVLoader.base = '/path/to/resources';
var player = new ogv.OGVPlayer();
```
## Usage
The `OGVPlayer` class implements a player, and supports a subset of the events, properties and methods from [HTMLMediaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement) and [HTMLVideoElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement).
```
// Create a new player with the constructor
var player = new OGVPlayer();
// Or with options
var player = new OGVPlayer({
debug: true,
debugFilter: /demuxer/
});
// Now treat it just like a video or audio element
containerElement.appendChild(player);
player.src = 'path/to/media.ogv';
player.play();
player.addEventListener('ended', function() {
// ta-da!
});
```
To check for compatibility before creating a player, include `ogv-support.js` and use the `OGVCompat` API:
```
if (OGVCompat.supported('OGVPlayer')) {
// go load the full player from ogv.js and instantiate stuff
}
```
This will check for typed arrays, web audio, blacklisted iOS versions, and super-slow/broken JIT compilers.
If you need a URL versioning/cache-buster parameter for dynamic loading of `ogv.js`, you can use the `OGVVersion` symbol provided by `ogv-support.js` or the even tinier `ogv-version.js`:
```
var script = document.createElement('script');
script.src = 'ogv.js?version=' + encodeURIComponent(OGVVersion);
document.querySelector('head').appendChild(script);
```
## Distribution notes
Entry points:
* `ogv.js` contains the main runtime classes, including OGVPlayer, OGVLoader, and OGVCompat.
* `ogv-support.js` contains the OGVCompat class and OGVVersion symbol, useful for checking for runtime support before loading the main `ogv.js`.
* `ogv-version.js` contains only the OGVVersion symbol.
These entry points may be loaded directly from a script element, or concatenated into a larger project, or otherwise loaded as you like.
Further code modules are loaded at runtime, which must be available with their defined names together in a directory. If the files are not hosted same-origin to the web page that includes them, you will need to set up appropriate CORS headers to allow loading of the worker JS modules.
Dynamically loaded assets:
* `ogv-worker-audio.js`, `ogv-worker-video.js`, and `*.worker.js` are Worker entry points, used to run video and audio decoders in the background.
* `ogv-demuxer-ogg-wasm.js/.wasm` are used in playing .ogg, .oga, and .ogv files.
* `ogv-demuxer-webm-wasm.js/.wasm` are used in playing .webm files.
* `ogv-decoder-audio-vorbis-wasm.js/.wasm` and `ogv-decoder-audio-opus-wasm.js/.wasm` are used in playing both Ogg and WebM files containing audio.
* `ogv-decoder-video-theora-wasm.js/.wasm` are used in playing .ogg and .ogv video files.
* `ogv-decoder-video-vp8-wasm.js/.wasm` and `ogv-decoder-video-vp9-wasm.js/.wasm` are used in playing .webm video files.
* `*-mt.js/.wasm` are the multithreaded versions of some of the above modules. They have additional support files.
If you know you will never use particular formats or codecs you can skip bundling them; for instance if you only need to play Ogg files you don't need `ogv-demuxer-webm-wasm.js` or `ogv-decoder-video-vp8-wasm.js` which are only used for WebM.
## Performance
(This section is somewhat out of date.)
As of 2015, for SD-or-less resolution basic Ogg Theora decoding speed is reliable on desktop and newer high-end mobile devices; current high-end desktops and laptops can even reach HD resolutions. Older and low-end mobile devices may have difficulty on any but audio and the lowest-resolution video files.
WebM VP8/VP9 is slower, but works pretty well at a resolution step below Theora.
AV1 is slower still, and tops out around 360p for single-threaded decoding on a fast desktop or iOS device.
*Low-res targets*
I've gotten acceptable performance for Vorbis audio and 160p/15fps Theora files on 32-bit iOS devices: iPhone 4s, iPod Touch 5th-gen and iPad 3. These have difficulty at 240p and above, and just won't keep up with higher resolutions.
Meanwhile, newer 64-bit iPhones and iPads are comparable to low-end laptops, and videos at 360p and often 480p play acceptably. Since 32-bit and 64-bit iOS devices have the same user-agent, a benchmark must be used to approximately test minimum CPU speed.
(On iOS, Safari performs significantly better than some alternative browsers that are unable to enable the JIT due to use of the old UIWebView API. Chrome 49 and Firefox for iOS are known to work using the newer WKWebView API internally. Again, a benchmark must be used to detect slow performance, as the browser remains otherwise compatible.)
Windows on 32-bit ARM platforms is similar... IE 11 on Windows RT 8.1 on a Surface tablet (NVidia Tegra 3) does not work (crashes IE), while Edge on Windows 10 Mobile works ok at low resolutions, having trouble starting around 240p.
In both cases, a native application looms as a possibly better alternative. See [OGVKit](https://github.com/brion/OGVKit) and [OgvRt](https://github.com/brion/OgvRT) projects for experiments in those directions.
Note that at these lower resolutions, Vorbis audio and Theora video decoding are about equally expensive operations -- dual-core phones and tablets should be able to eke out a little parallelism here thanks to audio and video being in separate Worker threads.
*WebGL drawing acceleration*
Accelerated YCbCr->RGB conversion and drawing is done using WebGL on supporting browsers, or through software CPU conversion if not. This is abstracted in the [yuv-canvas](https://github.com/brion/yuv-canvas) package, now separately installable.
It may be possible to do further acceleration of actual decoding operations using WebGL shaders, but this could be ... tricky. WebGL is also only available on the main thread, and there are no compute shaders yet so would have to use fragment shaders.
## Difficulties
*Threading*
Currently the video and audio codecs run in worker threads by default, while the demuxer and player logic run on the UI thread. This seems to work pretty well.
There is some overhead in extracting data out of each emscripten module's heap and in the thread-to-thread communications, but the parallelism and smoother main thread makes up for it.
*Streaming download*
Streaming buffering is done by chunking the requests at up to a megabyte each, using the HTTP Range header. For cross-site playback, this requires CORS setup to whitelist the Range header! Chunks are downloaded as ArrayBuffers, so a chunk must be loaded in full before demuxing or playback can start.
Old versions of [Safari have a bug with Range headers](https://bugs.webkit.org/show_bug.cgi?id=82672) which is worked around as necessary with a 'cache-busting' URL string parameter.
*Seeking*
Seeking is implemented via the HTTP Range: header.
For Ogg files with keyframe indices in a skeleton index, seeking is very fast. Otherwise, a bisection search is used to locate the target frame or audio position, which is very slow over the internet as it creates a lot of short-lived HTTP requests.
For WebM files with cues, efficient seeking is supported as well as of 1.1.2. WebM files without cues can be seeked in 1.5.5, but inefficiently via linear seek from the beginning. This is fine for small audio-only files, but might be improved for large files with a bisection in future.
As with chunked streaming, cross-site playback requires CORS support for the Range header.
*Audio output*
Audio output is handled through the [AudioFeeder](https://github.com/brion/audio-feeder) library, which encapsulates use of Web Audio API:
Firefox, Safari, Chrome, and Edge support the W3C Web Audio API.
IE is no longer supported; the workaround using Flash no longer works due to sunsetting of the Flash plugin.
A/V synchronization is performed on files with both audio and video, and seems to actually work. Yay!
Note that autoplay with audio doesn't work on iOS Safari due to limitations with starting audio playback from event handlers; if playback is started outside an event handler, the player will hang due to broken audio.
As of 1.1.1, muting before script-triggered playback allows things to work:
```
player = new OGVPlayer();
player.muted = true;
player.src = 'path/to/file-with-audio.ogv';
player.play();
```
You can then unmute the video in response to a touch or click handler. Alternately if audio is not required, do not include an audio track in the file.
*WebM*
WebM support was added in June 2015, with some major issues finally worked out in May 2016. Initial VP9 support was added in February 2017. It's pretty stable in production use at Wikipedia and is enabled by default as of October 2015.
Beware that performance of WebM VP8 is much slower than Ogg Theora, and VP9 is slightly slower still.
For best WebM decode speed, consider encoding VP8 with "profile 1" (simple deblocking filter) which will sacrifice quality modestly, mainly in high-motion scenes. When encoding with ffmpeg, this is the `-profile:v 1` option to the `libvpx` codec.
It is also recommended to use the `-slices` option for VP8, or `-tile-columns` for VP9, to maximize ability to use multithreaded decoding when available in the future.
*AV1*
WebM files containing the AV1 codec are supported as of 1.6.0 (February 2019) using the [dav1d](https://code.videolan.org/videolan/dav1d) decoder.
Currently this is experimental, and does not advertise support via `canPlayType`.
Performance is about 2-3x slower than VP8 or VP9, and may require bumping down a resolution step or two to maintain frame rate. There may be further optimizations that can be done to improve this a bit, but the best improvements will come from future improvements to WebAssembly multithreading and SIMD.
Currently AV1 in MP4 container is not supported.
## Upstream library notes
We've experimented with tremor (libivorbis), an integer-only variant of libvorbis. This actually does *not* decode faster, but does save about 200kb off our generated JavaScript, presumably thanks to not including an encoder in the library. However on slow devices like iPod Touch 5th-generation, it makes a significant negative impact on the decode time so we've gone back to libvorbis.
The Ogg Skeleton library (libskeleton) is a bit ... unfinished and is slightly modified here.
libvpx is slightly modified to work around emscripten threading limitations in the VP8 decoder.
## WebAssembly
WebAssembly (Wasm) builds are used exclusively as of 1.8.0, as Safari's Wasm support is pretty well established now and IE no longer works due to the Flash plugin deprecation.
## Multithreading
Experimental multithreaded VP8, VP9, and AV1 decoding up to 4 cores is in development, requiring emscripten 1.38.27 to build.
Multithreading is used only if `options.threading` is true. This requires browser support for the new `SharedArrayBuffer` and `Atomics` APIs, currently available in Firefox and Chrome with experimental flags enabled.
Threading currently requires WebAssembly; JavaScript builds are possible but perform poorly.
Speedups will only be noticeable when using the "slices" or "token partitions" option for VP8 encoding, or the "tile columns" option for VP9 encoding.
If you are making a slim build and will not use the `threading` option, you can leave out the `*-mt.*` files.
## Building JS components
Building ogv.js is known to work on Mac OS X and Linux (tested Fedora 29 and Ubuntu 18.10 with Meson manually updated).
1. You will need autoconf, automake, libtool, pkg-config, meson, ninja, and node (nodejs). These can be installed through Homebrew on Mac OS X, or through distribution-specific methods on Linux. For meson, you may need a newer version than your distro packages -- install it manually with `pip3` or from source.
2. Install [Emscripten](http://kripken.github.io/emscripten-site/docs/getting_started/Tutorial.html); currently building with 2.0.13.
3. `git submodule update --init`
4. Run `npm install` to install build utilities
5. Run `make js` to configure and build the libraries and the C wrapper
## Building the demo
If you did all the setup above, just run `make demo` or `make`. Look in build/demo/ and enjoy!
## License
libogg, libvorbis, libtheora, libopus, nestegg, libvpx, and dav1d are available under their respective licenses, and the JavaScript and C wrapper code in this repo is licensed under MIT.
Based on build scripts from https://github.com/devongovett/ogg.js
See [AUTHORS.md](https://github.com/brion/ogv.js/blob/master/AUTHORS.md) and/or the git history for a list of contributors.

View File

@ -0,0 +1,39 @@
var OGVDecoderAudioOpusW = (() => {
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
return (
function(OGVDecoderAudioOpusW) {
OGVDecoderAudioOpusW = OGVDecoderAudioOpusW || {};
var a;a||(a=typeof OGVDecoderAudioOpusW !== 'undefined' ? OGVDecoderAudioOpusW : {});var g=Object.assign,h,m;a.ready=new Promise(function(b,c){h=b;m=c});var n=a,p=g({},a),q="object"===typeof window,r="function"===typeof importScripts,t="",u,v,w,fs,x,y;
if("object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)t=r?require("path").dirname(t)+"/":__dirname+"/",y=function(){x||(fs=require("fs"),x=require("path"))},u=function(b,c){y();b=x.normalize(b);return fs.readFileSync(b,c?null:"utf8")},w=function(b){b=u(b,!0);b.buffer||(b=new Uint8Array(b));return b},v=function(b,c,e){y();b=x.normalize(b);fs.readFile(b,function(d,f){d?e(d):c(f.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),
process.on("unhandledRejection",function(b){throw b;}),a.inspect=function(){return"[Emscripten Module object]"};else if(q||r)r?t=self.location.href:"undefined"!==typeof document&&document.currentScript&&(t=document.currentScript.src),_scriptDir&&(t=_scriptDir),0!==t.indexOf("blob:")?t=t.substr(0,t.replace(/[?#].*/,"").lastIndexOf("/")+1):t="",u=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);c.send(null);return c.responseText},r&&(w=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);
c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),v=function(b,c,e){var d=new XMLHttpRequest;d.open("GET",b,!0);d.responseType="arraybuffer";d.onload=function(){200==d.status||0==d.status&&d.response?c(d.response):e()};d.onerror=e;d.send(null)};a.print||console.log.bind(console);var z=a.printErr||console.warn.bind(console);g(a,p);p=null;var A;a.wasmBinary&&(A=a.wasmBinary);var noExitRuntime=a.noExitRuntime||!0;"object"!==typeof WebAssembly&&B("no native wasm support detected");
var C,D=!1,E,F;function G(){var b=C.buffer;E=b;a.HEAP8=new Int8Array(b);a.HEAP16=new Int16Array(b);a.HEAP32=new Int32Array(b);a.HEAPU8=F=new Uint8Array(b);a.HEAPU16=new Uint16Array(b);a.HEAPU32=new Uint32Array(b);a.HEAPF32=new Float32Array(b);a.HEAPF64=new Float64Array(b)}var H,I=[],J=[],K=[];function aa(){var b=a.preRun.shift();I.unshift(b)}var L=0,M=null,N=null;a.preloadedImages={};a.preloadedAudios={};
function B(b){if(a.onAbort)a.onAbort(b);b="Aborted("+b+")";z(b);D=!0;b=new WebAssembly.RuntimeError(b+". Build with -s ASSERTIONS=1 for more info.");m(b);throw b;}function O(){return P.startsWith("data:application/octet-stream;base64,")}var P;P="ogv-decoder-audio-opus-wasm.wasm";if(!O()){var Q=P;P=a.locateFile?a.locateFile(Q,t):t+Q}function R(){var b=P;try{if(b==P&&A)return new Uint8Array(A);if(w)return w(b);throw"both async and sync fetching of the wasm failed";}catch(c){B(c)}}
function ba(){if(!A&&(q||r)){if("function"===typeof fetch&&!P.startsWith("file://"))return fetch(P,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+P+"'";return b.arrayBuffer()}).catch(function(){return R()});if(v)return new Promise(function(b,c){v(P,function(e){b(new Uint8Array(e))},c)})}return Promise.resolve().then(function(){return R()})}
function S(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c(a);else{var e=c.s;"number"===typeof e?void 0===c.o?ca(e)():ca(e)(c.o):e(void 0===c.o?null:c.o)}}}var T=[];function ca(b){var c=T[b];c||(b>=T.length&&(T.length=b+1),T[b]=c=H.get(b));return c}
var da={a:function(b,c,e){F.copyWithin(b,c,c+e)},b:function(b){var c=F.length;b>>>=0;if(2147483648<b)return!1;for(var e=1;4>=e;e*=2){var d=c*(1+.2/e);d=Math.min(d,b+100663296);d=Math.max(b,d);0<d%65536&&(d+=65536-d%65536);a:{try{C.grow(Math.min(2147483648,d)-E.byteLength+65535>>>16);G();var f=1;break a}catch(k){}f=void 0}if(f)return!0}return!1},c:function(b,c,e){var d=C.buffer,f=new Uint32Array(d,b,c),k=[];if(0!==b)for(b=0;b<c;b++){var l=f[b];d.slice?(l=d.slice(l,l+4*e),l=new Float32Array(l)):(l=
new Float32Array(d,l,e),l=new Float32Array(l));k.push(l)}a.audioBuffer=k},d:function(b,c){a.audioFormat={channels:b,rate:c};a.loadedMetadata=!0}};
(function(){function b(f){a.asm=f.exports;C=a.asm.e;G();H=a.asm.m;J.unshift(a.asm.f);L--;a.monitorRunDependencies&&a.monitorRunDependencies(L);0==L&&(null!==M&&(clearInterval(M),M=null),N&&(f=N,N=null,f()))}function c(f){b(f.instance)}function e(f){return ba().then(function(k){return WebAssembly.instantiate(k,d)}).then(function(k){return k}).then(f,function(k){z("failed to asynchronously prepare wasm: "+k);B(k)})}var d={a:da};L++;a.monitorRunDependencies&&a.monitorRunDependencies(L);if(a.instantiateWasm)try{return a.instantiateWasm(d,
b)}catch(f){return z("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return A||"function"!==typeof WebAssembly.instantiateStreaming||O()||P.startsWith("file://")||"function"!==typeof fetch?e(c):fetch(P,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(c,function(k){z("wasm streaming compile failed: "+k);z("falling back to ArrayBuffer instantiation");return e(c)})})})().catch(m);return{}})();
a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.f).apply(null,arguments)};a._ogv_audio_decoder_init=function(){return(a._ogv_audio_decoder_init=a.asm.g).apply(null,arguments)};a._ogv_audio_decoder_process_header=function(){return(a._ogv_audio_decoder_process_header=a.asm.h).apply(null,arguments)};a._ogv_audio_decoder_process_audio=function(){return(a._ogv_audio_decoder_process_audio=a.asm.i).apply(null,arguments)};a._malloc=function(){return(a._malloc=a.asm.j).apply(null,arguments)};
a._free=function(){return(a._free=a.asm.k).apply(null,arguments)};a._ogv_audio_decoder_destroy=function(){return(a._ogv_audio_decoder_destroy=a.asm.l).apply(null,arguments)};var U;N=function ea(){U||V();U||(N=ea)};
function V(){function b(){if(!U&&(U=!0,a.calledRun=!0,!D)){S(J);h(a);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;){var c=a.postRun.shift();K.unshift(c)}S(K)}}if(!(0<L)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)aa();S(I);0<L||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}a.run=V;
if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();V();var W,X;function fa(b){if(W&&X>=b)return W;W&&a._free(W);X=b;return W=a._malloc(X)}var Y;"undefined"===typeof performance||"undefined"===typeof performance.now?Y=Date.now:Y=performance.now.bind(performance);function Z(b){var c=Y();b=b();a.cpuTime+=Y()-c;return b}a.loadedMetadata=!!n.audioFormat;a.audioFormat=n.audioFormat||null;a.audioBuffer=null;a.cpuTime=0;
Object.defineProperty(a,"processing",{get:function(){return!1}});a.init=function(b){Z(function(){a._ogv_audio_decoder_init()});b()};a.processHeader=function(b,c){var e=Z(function(){var d=b.byteLength,f=fa(d);(new Uint8Array(C.buffer,f,d)).set(new Uint8Array(b));return a._ogv_audio_decoder_process_header(f,d)});c(e)};a.processAudio=function(b,c){var e=Z(function(){var d=b.byteLength,f=fa(d);(new Uint8Array(C.buffer,f,d)).set(new Uint8Array(b));return a._ogv_audio_decoder_process_audio(f,d)});c(e)};
a.close=function(){};
return OGVDecoderAudioOpusW.ready
}
);
})();
if (typeof exports === 'object' && typeof module === 'object')
module.exports = OGVDecoderAudioOpusW;
else if (typeof define === 'function' && define['amd'])
define([], function() { return OGVDecoderAudioOpusW; });
else if (typeof exports === 'object')
exports["OGVDecoderAudioOpusW"] = OGVDecoderAudioOpusW;

View File

@ -0,0 +1,40 @@
var OGVDecoderAudioVorbisW = (() => {
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
return (
function(OGVDecoderAudioVorbisW) {
OGVDecoderAudioVorbisW = OGVDecoderAudioVorbisW || {};
var b;b||(b=typeof OGVDecoderAudioVorbisW !== 'undefined' ? OGVDecoderAudioVorbisW : {});var g=Object.assign,h,m;b.ready=new Promise(function(a,c){h=a;m=c});var n=b,p=g({},b),q=(a,c)=>{throw c;},r="object"===typeof window,t="function"===typeof importScripts,u="",v,w,x,fs,y,z;
if("object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)u=t?require("path").dirname(u)+"/":__dirname+"/",z=function(){y||(fs=require("fs"),y=require("path"))},v=function(a,c){z();a=y.normalize(a);return fs.readFileSync(a,c?null:"utf8")},x=function(a){a=v(a,!0);a.buffer||(a=new Uint8Array(a));return a},w=function(a,c,e){z();a=y.normalize(a);fs.readFile(a,function(d,f){d?e(d):c(f.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),
process.on("unhandledRejection",function(a){throw a;}),q=(a,c)=>{if(noExitRuntime||0<A)throw process.exitCode=a,c;c instanceof B||C("exiting due to exception: "+c);process.exit(a)},b.inspect=function(){return"[Emscripten Module object]"};else if(r||t)t?u=self.location.href:"undefined"!==typeof document&&document.currentScript&&(u=document.currentScript.src),_scriptDir&&(u=_scriptDir),0!==u.indexOf("blob:")?u=u.substr(0,u.replace(/[?#].*/,"").lastIndexOf("/")+1):u="",v=function(a){var c=new XMLHttpRequest;
c.open("GET",a,!1);c.send(null);return c.responseText},t&&(x=function(a){var c=new XMLHttpRequest;c.open("GET",a,!1);c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),w=function(a,c,e){var d=new XMLHttpRequest;d.open("GET",a,!0);d.responseType="arraybuffer";d.onload=function(){200==d.status||0==d.status&&d.response?c(d.response):e()};d.onerror=e;d.send(null)};b.print||console.log.bind(console);var C=b.printErr||console.warn.bind(console);g(b,p);p=null;b.quit&&(q=b.quit);
var D;b.wasmBinary&&(D=b.wasmBinary);var noExitRuntime=b.noExitRuntime||!0;"object"!==typeof WebAssembly&&E("no native wasm support detected");var F,G=!1,H,I;function J(){var a=F.buffer;H=a;b.HEAP8=new Int8Array(a);b.HEAP16=new Int16Array(a);b.HEAP32=new Int32Array(a);b.HEAPU8=I=new Uint8Array(a);b.HEAPU16=new Uint16Array(a);b.HEAPU32=new Uint32Array(a);b.HEAPF32=new Float32Array(a);b.HEAPF64=new Float64Array(a)}var K,L=[],M=[],N=[],A=0;function aa(){var a=b.preRun.shift();L.unshift(a)}
var O=0,P=null,Q=null;b.preloadedImages={};b.preloadedAudios={};function E(a){if(b.onAbort)b.onAbort(a);a="Aborted("+a+")";C(a);G=!0;a=new WebAssembly.RuntimeError(a+". Build with -s ASSERTIONS=1 for more info.");m(a);throw a;}function ba(){return R.startsWith("data:application/octet-stream;base64,")}var R;R="ogv-decoder-audio-vorbis-wasm.wasm";if(!ba()){var ca=R;R=b.locateFile?b.locateFile(ca,u):u+ca}
function da(){var a=R;try{if(a==R&&D)return new Uint8Array(D);if(x)return x(a);throw"both async and sync fetching of the wasm failed";}catch(c){E(c)}}
function ea(){if(!D&&(r||t)){if("function"===typeof fetch&&!R.startsWith("file://"))return fetch(R,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+R+"'";return a.arrayBuffer()}).catch(function(){return da()});if(w)return new Promise(function(a,c){w(R,function(e){a(new Uint8Array(e))},c)})}return Promise.resolve().then(function(){return da()})}
function S(a){for(;0<a.length;){var c=a.shift();if("function"==typeof c)c(b);else{var e=c.s;"number"===typeof e?void 0===c.o?fa(e)():fa(e)(c.o):e(void 0===c.o?null:c.o)}}}var T=[];function fa(a){var c=T[a];c||(a>=T.length&&(T.length=a+1),T[a]=c=K.get(a));return c}
var ha={a:function(a,c,e){I.copyWithin(a,c,c+e)},b:function(a){var c=I.length;a>>>=0;if(2147483648<a)return!1;for(var e=1;4>=e;e*=2){var d=c*(1+.2/e);d=Math.min(d,a+100663296);d=Math.max(a,d);0<d%65536&&(d+=65536-d%65536);a:{try{F.grow(Math.min(2147483648,d)-H.byteLength+65535>>>16);J();var f=1;break a}catch(k){}f=void 0}if(f)return!0}return!1},c:function(a){if(!(noExitRuntime||0<A)){if(b.onExit)b.onExit(a);G=!0}q(a,new B(a))},d:function(a,c,e){var d=F.buffer,f=new Uint32Array(d,a,c),k=[];if(0!==
a)for(a=0;a<c;a++){var l=f[a];d.slice?(l=d.slice(l,l+4*e),l=new Float32Array(l)):(l=new Float32Array(d,l,e),l=new Float32Array(l));k.push(l)}b.audioBuffer=k},e:function(a,c){b.audioFormat={channels:a,rate:c};b.loadedMetadata=!0}};
(function(){function a(f){b.asm=f.exports;F=b.asm.f;J();K=b.asm.n;M.unshift(b.asm.g);O--;b.monitorRunDependencies&&b.monitorRunDependencies(O);0==O&&(null!==P&&(clearInterval(P),P=null),Q&&(f=Q,Q=null,f()))}function c(f){a(f.instance)}function e(f){return ea().then(function(k){return WebAssembly.instantiate(k,d)}).then(function(k){return k}).then(f,function(k){C("failed to asynchronously prepare wasm: "+k);E(k)})}var d={a:ha};O++;b.monitorRunDependencies&&b.monitorRunDependencies(O);if(b.instantiateWasm)try{return b.instantiateWasm(d,
a)}catch(f){return C("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return D||"function"!==typeof WebAssembly.instantiateStreaming||ba()||R.startsWith("file://")||"function"!==typeof fetch?e(c):fetch(R,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(c,function(k){C("wasm streaming compile failed: "+k);C("falling back to ArrayBuffer instantiation");return e(c)})})})().catch(m);return{}})();
b.___wasm_call_ctors=function(){return(b.___wasm_call_ctors=b.asm.g).apply(null,arguments)};b._ogv_audio_decoder_init=function(){return(b._ogv_audio_decoder_init=b.asm.h).apply(null,arguments)};b._ogv_audio_decoder_process_header=function(){return(b._ogv_audio_decoder_process_header=b.asm.i).apply(null,arguments)};b._ogv_audio_decoder_process_audio=function(){return(b._ogv_audio_decoder_process_audio=b.asm.j).apply(null,arguments)};
b._ogv_audio_decoder_destroy=function(){return(b._ogv_audio_decoder_destroy=b.asm.k).apply(null,arguments)};b._malloc=function(){return(b._malloc=b.asm.l).apply(null,arguments)};b._free=function(){return(b._free=b.asm.m).apply(null,arguments)};var U;function B(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}Q=function ia(){U||V();U||(Q=ia)};
function V(){function a(){if(!U&&(U=!0,b.calledRun=!0,!G)){S(M);h(b);if(b.onRuntimeInitialized)b.onRuntimeInitialized();if(b.postRun)for("function"==typeof b.postRun&&(b.postRun=[b.postRun]);b.postRun.length;){var c=b.postRun.shift();N.unshift(c)}S(N)}}if(!(0<O)){if(b.preRun)for("function"==typeof b.preRun&&(b.preRun=[b.preRun]);b.preRun.length;)aa();S(L);0<O||(b.setStatus?(b.setStatus("Running..."),setTimeout(function(){setTimeout(function(){b.setStatus("")},1);a()},1)):a())}}b.run=V;
if(b.preInit)for("function"==typeof b.preInit&&(b.preInit=[b.preInit]);0<b.preInit.length;)b.preInit.pop()();V();var W,X;function ja(a){if(W&&X>=a)return W;W&&b._free(W);X=a;return W=b._malloc(X)}var Y;"undefined"===typeof performance||"undefined"===typeof performance.now?Y=Date.now:Y=performance.now.bind(performance);function Z(a){var c=Y();a=a();b.cpuTime+=Y()-c;return a}b.loadedMetadata=!!n.audioFormat;b.audioFormat=n.audioFormat||null;b.audioBuffer=null;b.cpuTime=0;
Object.defineProperty(b,"processing",{get:function(){return!1}});b.init=function(a){Z(function(){b._ogv_audio_decoder_init()});a()};b.processHeader=function(a,c){var e=Z(function(){var d=a.byteLength,f=ja(d);(new Uint8Array(F.buffer,f,d)).set(new Uint8Array(a));return b._ogv_audio_decoder_process_header(f,d)});c(e)};b.processAudio=function(a,c){var e=Z(function(){var d=a.byteLength,f=ja(d);(new Uint8Array(F.buffer,f,d)).set(new Uint8Array(a));return b._ogv_audio_decoder_process_audio(f,d)});c(e)};
b.close=function(){};
return OGVDecoderAudioVorbisW.ready
}
);
})();
if (typeof exports === 'object' && typeof module === 'object')
module.exports = OGVDecoderAudioVorbisW;
else if (typeof define === 'function' && define['amd'])
define([], function() { return OGVDecoderAudioVorbisW; });
else if (typeof exports === 'object')
exports["OGVDecoderAudioVorbisW"] = OGVDecoderAudioVorbisW;

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
"use strict";var Module={};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:function(f){(0,eval)(nodeFS.readFileSync(f,"utf8"))},postMessage:function(msg){parentPort.postMessage(msg)},performance:global.performance||{now:function(){return Date.now()}}})}function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}OGVDecoderVideoAV1MTW(Module).then(function(instance){Module=instance})}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0,1);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
"use strict";var Module={};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){var nodeWorkerThreads=require("worker_threads");var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");Object.assign(global,{self:global,require:require,Module:Module,location:{href:__filename},Worker:nodeWorkerThreads.Worker,importScripts:function(f){(0,eval)(nodeFS.readFileSync(f,"utf8"))},postMessage:function(msg){parentPort.postMessage(msg)},performance:global.performance||{now:function(){return Date.now()}}})}function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;self.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};self.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}OGVDecoderVideoAV1SIMDMTW(Module).then(function(instance){Module=instance})}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0,1);Module["establishStackSpace"]();Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["__emscripten_thread_exit"](result)}}catch(ex){if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["__emscripten_thread_exit"](ex.status)}}else{throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["__emscripten_thread_exit"](-1)}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};

View File

@ -0,0 +1,43 @@
var OGVDecoderVideoAV1SIMDW = (() => {
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
return (
function(OGVDecoderVideoAV1SIMDW) {
OGVDecoderVideoAV1SIMDW = OGVDecoderVideoAV1SIMDW || {};
var a;a||(a=typeof OGVDecoderVideoAV1SIMDW !== 'undefined' ? OGVDecoderVideoAV1SIMDW : {});var aa=Object.assign,ba,q;a.ready=new Promise(function(b,c){ba=b;q=c});var ca=a,da=aa({},a),ea="object"===typeof window,r="function"===typeof importScripts,A="",fa,F,G,fs,I,ha;
if("object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)A=r?require("path").dirname(A)+"/":__dirname+"/",ha=function(){I||(fs=require("fs"),I=require("path"))},fa=function(b,c){ha();b=I.normalize(b);return fs.readFileSync(b,c?null:"utf8")},G=function(b){b=fa(b,!0);b.buffer||(b=new Uint8Array(b));return b},F=function(b,c,e){ha();b=I.normalize(b);fs.readFile(b,function(d,f){d?e(d):c(f.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),
process.argv.slice(2),process.on("unhandledRejection",function(b){throw b;}),a.inspect=function(){return"[Emscripten Module object]"};else if(ea||r)r?A=self.location.href:"undefined"!==typeof document&&document.currentScript&&(A=document.currentScript.src),_scriptDir&&(A=_scriptDir),0!==A.indexOf("blob:")?A=A.substr(0,A.replace(/[?#].*/,"").lastIndexOf("/")+1):A="",fa=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);c.send(null);return c.responseText},r&&(G=function(b){var c=new XMLHttpRequest;
c.open("GET",b,!1);c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),F=function(b,c,e){var d=new XMLHttpRequest;d.open("GET",b,!0);d.responseType="arraybuffer";d.onload=function(){200==d.status||0==d.status&&d.response?c(d.response):e()};d.onerror=e;d.send(null)};var ia=a.print||console.log.bind(console),J=a.printErr||console.warn.bind(console);aa(a,da);da=null;var K;a.wasmBinary&&(K=a.wasmBinary);var noExitRuntime=a.noExitRuntime||!0;"object"!==typeof WebAssembly&&M("no native wasm support detected");
var N,ja=!1,ka="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0,la,O,P;function ma(){var b=N.buffer;la=b;a.HEAP8=new Int8Array(b);a.HEAP16=new Int16Array(b);a.HEAP32=P=new Int32Array(b);a.HEAPU8=O=new Uint8Array(b);a.HEAPU16=new Uint16Array(b);a.HEAPU32=new Uint32Array(b);a.HEAPF32=new Float32Array(b);a.HEAPF64=new Float64Array(b)}var na,oa=[],pa=[],qa=[];function ra(){var b=a.preRun.shift();oa.unshift(b)}var Q=0,sa=null,R=null;a.preloadedImages={};a.preloadedAudios={};
function M(b){if(a.onAbort)a.onAbort(b);b="Aborted("+b+")";J(b);ja=!0;b=new WebAssembly.RuntimeError(b+". Build with -s ASSERTIONS=1 for more info.");q(b);throw b;}function ta(){return S.startsWith("data:application/octet-stream;base64,")}var S;S="ogv-decoder-video-av1-simd-wasm.wasm";if(!ta()){var ua=S;S=a.locateFile?a.locateFile(ua,A):A+ua}function va(){var b=S;try{if(b==S&&K)return new Uint8Array(K);if(G)return G(b);throw"both async and sync fetching of the wasm failed";}catch(c){M(c)}}
function wa(){if(!K&&(ea||r)){if("function"===typeof fetch&&!S.startsWith("file://"))return fetch(S,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+S+"'";return b.arrayBuffer()}).catch(function(){return va()});if(F)return new Promise(function(b,c){F(S,function(e){b(new Uint8Array(e))},c)})}return Promise.resolve().then(function(){return va()})}
function xa(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c(a);else{var e=c.B;"number"===typeof e?void 0===c.s?Ja(e)():Ja(e)(c.s):e(void 0===c.s?null:c.s)}}}var T=[];function Ja(b){var c=T[b];c||(b>=T.length&&(T.length=b+1),T[b]=c=na.get(b));return c}
var Ka=[null,[],[]],La={b:function(){M("")},d:function(b,c,e){O.copyWithin(b,c,c+e)},e:function(b){var c=O.length;b>>>=0;if(2147483648<b)return!1;for(var e=1;4>=e;e*=2){var d=c*(1+.2/e);d=Math.min(d,b+100663296);d=Math.max(b,d);0<d%65536&&(d+=65536-d%65536);a:{try{N.grow(Math.min(2147483648,d)-la.byteLength+65535>>>16);ma();var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},f:function(){return 0},c:function(){},a:function(b,c,e,d){for(var f=0,g=0;g<e;g++){var x=P[c>>2],u=P[c+4>>2];c+=8;for(var y=
0;y<u;y++){var n=O[x+y],w=Ka[b];if(0===n||10===n){n=1===b?ia:J;var l=w;for(var p=0,t=p+NaN,v=p;l[v]&&!(v>=t);)++v;if(16<v-p&&l.subarray&&ka)l=ka.decode(l.subarray(p,v));else{for(t="";p<v;){var h=l[p++];if(h&128){var B=l[p++]&63;if(192==(h&224))t+=String.fromCharCode((h&31)<<6|B);else{var U=l[p++]&63;h=224==(h&240)?(h&15)<<12|B<<6|U:(h&7)<<18|B<<12|U<<6|l[p++]&63;65536>h?t+=String.fromCharCode(h):(h-=65536,t+=String.fromCharCode(55296|h>>10,56320|h&1023))}}else t+=String.fromCharCode(h)}l=t}n(l);w.length=
0}else w.push(n)}f+=u}P[d>>2]=f;return 0},g:function(b,c,e,d,f,g,x,u,y,n,w,l,p,t,v,h){function B(H,k,C,ya,za,Aa,Na,Oa,V){H.set(new Uint8Array(U,k,C*ya));var D,z;for(D=z=0;D<Aa;D++,z+=C)for(k=0;k<C;k++)H[z+k]=V;for(;D<Aa+Oa;D++,z+=C){for(k=0;k<za;k++)H[z+k]=V;for(k=za+Na;k<C;k++)H[z+k]=V}for(;D<ya;D++,z+=C)for(k=0;k<C;k++)H[z+k]=V;return H}var U=N.buffer,m=a.videoFormat,Ba=(p&-2)*y/x,Ca=(t&-2)*n/u,Da=w*y/x,Ea=l*n/u;w===m.cropWidth&&l===m.cropHeight&&(v=m.displayWidth,h=m.displayHeight);for(var Fa=
a.recycledFrames,E,Ga=u*c,Ha=n*d,Ia=n*g;0<Fa.length;){var L=Fa.shift();m=L.format;if(m.width===x&&m.height===u&&m.chromaWidth===y&&m.chromaHeight===n&&m.cropLeft===p&&m.cropTop===t&&m.cropWidth===w&&m.cropHeight===l&&m.displayWidth===v&&m.displayHeight===h&&L.y.bytes.length===Ga&&L.u.bytes.length===Ha&&L.v.bytes.length===Ia){E=L;break}}E||(E={format:{width:x,height:u,chromaWidth:y,chromaHeight:n,cropLeft:p,cropTop:t,cropWidth:w,cropHeight:l,displayWidth:v,displayHeight:h},y:{bytes:new Uint8Array(Ga),
stride:c},u:{bytes:new Uint8Array(Ha),stride:d},v:{bytes:new Uint8Array(Ia),stride:g}});B(E.y.bytes,b,c,u,p,t,w,l,0);B(E.u.bytes,e,d,n,Ba,Ca,Da,Ea,128);B(E.v.bytes,f,g,n,Ba,Ca,Da,Ea,128);a.frameBuffer=E}};
(function(){function b(f){a.asm=f.exports;N=a.asm.h;ma();na=a.asm.p;pa.unshift(a.asm.i);Q--;a.monitorRunDependencies&&a.monitorRunDependencies(Q);0==Q&&(null!==sa&&(clearInterval(sa),sa=null),R&&(f=R,R=null,f()))}function c(f){b(f.instance)}function e(f){return wa().then(function(g){return WebAssembly.instantiate(g,d)}).then(function(g){return g}).then(f,function(g){J("failed to asynchronously prepare wasm: "+g);M(g)})}var d={a:La};Q++;a.monitorRunDependencies&&a.monitorRunDependencies(Q);if(a.instantiateWasm)try{return a.instantiateWasm(d,
b)}catch(f){return J("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return K||"function"!==typeof WebAssembly.instantiateStreaming||ta()||S.startsWith("file://")||"function"!==typeof fetch?e(c):fetch(S,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(c,function(g){J("wasm streaming compile failed: "+g);J("falling back to ArrayBuffer instantiation");return e(c)})})})().catch(q);return{}})();
a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.i).apply(null,arguments)};a._ogv_video_decoder_init=function(){return(a._ogv_video_decoder_init=a.asm.j).apply(null,arguments)};a._ogv_video_decoder_async=function(){return(a._ogv_video_decoder_async=a.asm.k).apply(null,arguments)};a._ogv_video_decoder_destroy=function(){return(a._ogv_video_decoder_destroy=a.asm.l).apply(null,arguments)};
a._ogv_video_decoder_process_header=function(){return(a._ogv_video_decoder_process_header=a.asm.m).apply(null,arguments)};a._ogv_video_decoder_process_frame=function(){return(a._ogv_video_decoder_process_frame=a.asm.n).apply(null,arguments)};a._free=function(){return(a._free=a.asm.o).apply(null,arguments)};a._malloc=function(){return(a._malloc=a.asm.q).apply(null,arguments)};var W;R=function Ma(){W||Pa();W||(R=Ma)};
function Pa(){function b(){if(!W&&(W=!0,a.calledRun=!0,!ja)){xa(pa);ba(a);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;){var c=a.postRun.shift();qa.unshift(c)}xa(qa)}}if(!(0<Q)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)ra();xa(oa);0<Q||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}a.run=Pa;
if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();Pa();var X,Qa,Y;"undefined"===typeof performance||"undefined"===typeof performance.now?Y=Date.now:Y=performance.now.bind(performance);function Z(b){var c=Y();b=b();a.cpuTime+=Y()-c;return b}a.loadedMetadata=!!ca.videoFormat;a.videoFormat=ca.videoFormat||null;a.frameBuffer=null;a.cpuTime=0;Object.defineProperty(a,"processing",{get:function(){return!1}});
a.init=function(b){Z(function(){a._ogv_video_decoder_init()});b()};a.processHeader=function(b,c){var e=Z(function(){var d=b.byteLength;X&&Qa>=d||(X&&a._free(X),Qa=d,X=a._malloc(Qa));var f=X;(new Uint8Array(N.buffer,f,d)).set(new Uint8Array(b));return a._ogv_video_decoder_process_header(f,d)});c(e)};a.A=[];
a.processFrame=function(b,c){function e(u){a._free(g);c(u)}var d=a._ogv_video_decoder_async(),f=b.byteLength,g=a._malloc(f);d&&a.A.push(e);var x=Z(function(){(new Uint8Array(N.buffer,g,f)).set(new Uint8Array(b));return a._ogv_video_decoder_process_frame(g,f)});d||e(x)};a.close=function(){};a.sync=function(){a._ogv_video_decoder_async()&&(a.A.push(function(){}),Z(function(){a._ogv_video_decoder_process_frame(0,0)}))};a.recycledFrames=[];
a.recycleFrame=function(b){var c=a.recycledFrames;c.push(b);16<c.length&&c.shift()};
return OGVDecoderVideoAV1SIMDW.ready
}
);
})();
if (typeof exports === 'object' && typeof module === 'object')
module.exports = OGVDecoderVideoAV1SIMDW;
else if (typeof define === 'function' && define['amd'])
define([], function() { return OGVDecoderVideoAV1SIMDW; });
else if (typeof exports === 'object')
exports["OGVDecoderVideoAV1SIMDW"] = OGVDecoderVideoAV1SIMDW;

View File

@ -0,0 +1,43 @@
var OGVDecoderVideoAV1W = (() => {
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
return (
function(OGVDecoderVideoAV1W) {
OGVDecoderVideoAV1W = OGVDecoderVideoAV1W || {};
var a;a||(a=typeof OGVDecoderVideoAV1W !== 'undefined' ? OGVDecoderVideoAV1W : {});var aa=Object.assign,ba,q;a.ready=new Promise(function(b,c){ba=b;q=c});var ca=a,da=aa({},a),ea="object"===typeof window,r="function"===typeof importScripts,A="",fa,F,G,fs,I,ha;
if("object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)A=r?require("path").dirname(A)+"/":__dirname+"/",ha=function(){I||(fs=require("fs"),I=require("path"))},fa=function(b,c){ha();b=I.normalize(b);return fs.readFileSync(b,c?null:"utf8")},G=function(b){b=fa(b,!0);b.buffer||(b=new Uint8Array(b));return b},F=function(b,c,e){ha();b=I.normalize(b);fs.readFile(b,function(d,f){d?e(d):c(f.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),
process.argv.slice(2),process.on("unhandledRejection",function(b){throw b;}),a.inspect=function(){return"[Emscripten Module object]"};else if(ea||r)r?A=self.location.href:"undefined"!==typeof document&&document.currentScript&&(A=document.currentScript.src),_scriptDir&&(A=_scriptDir),0!==A.indexOf("blob:")?A=A.substr(0,A.replace(/[?#].*/,"").lastIndexOf("/")+1):A="",fa=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);c.send(null);return c.responseText},r&&(G=function(b){var c=new XMLHttpRequest;
c.open("GET",b,!1);c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),F=function(b,c,e){var d=new XMLHttpRequest;d.open("GET",b,!0);d.responseType="arraybuffer";d.onload=function(){200==d.status||0==d.status&&d.response?c(d.response):e()};d.onerror=e;d.send(null)};var ia=a.print||console.log.bind(console),J=a.printErr||console.warn.bind(console);aa(a,da);da=null;var K;a.wasmBinary&&(K=a.wasmBinary);var noExitRuntime=a.noExitRuntime||!0;"object"!==typeof WebAssembly&&M("no native wasm support detected");
var N,ja=!1,ka="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0,la,O,P;function ma(){var b=N.buffer;la=b;a.HEAP8=new Int8Array(b);a.HEAP16=new Int16Array(b);a.HEAP32=P=new Int32Array(b);a.HEAPU8=O=new Uint8Array(b);a.HEAPU16=new Uint16Array(b);a.HEAPU32=new Uint32Array(b);a.HEAPF32=new Float32Array(b);a.HEAPF64=new Float64Array(b)}var na,oa=[],pa=[],qa=[];function ra(){var b=a.preRun.shift();oa.unshift(b)}var Q=0,sa=null,R=null;a.preloadedImages={};a.preloadedAudios={};
function M(b){if(a.onAbort)a.onAbort(b);b="Aborted("+b+")";J(b);ja=!0;b=new WebAssembly.RuntimeError(b+". Build with -s ASSERTIONS=1 for more info.");q(b);throw b;}function ta(){return S.startsWith("data:application/octet-stream;base64,")}var S;S="ogv-decoder-video-av1-wasm.wasm";if(!ta()){var ua=S;S=a.locateFile?a.locateFile(ua,A):A+ua}function va(){var b=S;try{if(b==S&&K)return new Uint8Array(K);if(G)return G(b);throw"both async and sync fetching of the wasm failed";}catch(c){M(c)}}
function wa(){if(!K&&(ea||r)){if("function"===typeof fetch&&!S.startsWith("file://"))return fetch(S,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+S+"'";return b.arrayBuffer()}).catch(function(){return va()});if(F)return new Promise(function(b,c){F(S,function(e){b(new Uint8Array(e))},c)})}return Promise.resolve().then(function(){return va()})}
function xa(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c(a);else{var e=c.B;"number"===typeof e?void 0===c.s?Ja(e)():Ja(e)(c.s):e(void 0===c.s?null:c.s)}}}var T=[];function Ja(b){var c=T[b];c||(b>=T.length&&(T.length=b+1),T[b]=c=na.get(b));return c}
var Ka=[null,[],[]],La={f:function(){M("")},c:function(b,c,e){O.copyWithin(b,c,c+e)},d:function(b){var c=O.length;b>>>=0;if(2147483648<b)return!1;for(var e=1;4>=e;e*=2){var d=c*(1+.2/e);d=Math.min(d,b+100663296);d=Math.max(b,d);0<d%65536&&(d+=65536-d%65536);a:{try{N.grow(Math.min(2147483648,d)-la.byteLength+65535>>>16);ma();var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},e:function(){return 0},b:function(){},a:function(b,c,e,d){for(var f=0,g=0;g<e;g++){var x=P[c>>2],u=P[c+4>>2];c+=8;for(var y=
0;y<u;y++){var n=O[x+y],w=Ka[b];if(0===n||10===n){n=1===b?ia:J;var l=w;for(var p=0,t=p+NaN,v=p;l[v]&&!(v>=t);)++v;if(16<v-p&&l.subarray&&ka)l=ka.decode(l.subarray(p,v));else{for(t="";p<v;){var h=l[p++];if(h&128){var B=l[p++]&63;if(192==(h&224))t+=String.fromCharCode((h&31)<<6|B);else{var U=l[p++]&63;h=224==(h&240)?(h&15)<<12|B<<6|U:(h&7)<<18|B<<12|U<<6|l[p++]&63;65536>h?t+=String.fromCharCode(h):(h-=65536,t+=String.fromCharCode(55296|h>>10,56320|h&1023))}}else t+=String.fromCharCode(h)}l=t}n(l);w.length=
0}else w.push(n)}f+=u}P[d>>2]=f;return 0},g:function(b,c,e,d,f,g,x,u,y,n,w,l,p,t,v,h){function B(H,k,C,ya,za,Aa,Na,Oa,V){H.set(new Uint8Array(U,k,C*ya));var D,z;for(D=z=0;D<Aa;D++,z+=C)for(k=0;k<C;k++)H[z+k]=V;for(;D<Aa+Oa;D++,z+=C){for(k=0;k<za;k++)H[z+k]=V;for(k=za+Na;k<C;k++)H[z+k]=V}for(;D<ya;D++,z+=C)for(k=0;k<C;k++)H[z+k]=V;return H}var U=N.buffer,m=a.videoFormat,Ba=(p&-2)*y/x,Ca=(t&-2)*n/u,Da=w*y/x,Ea=l*n/u;w===m.cropWidth&&l===m.cropHeight&&(v=m.displayWidth,h=m.displayHeight);for(var Fa=
a.recycledFrames,E,Ga=u*c,Ha=n*d,Ia=n*g;0<Fa.length;){var L=Fa.shift();m=L.format;if(m.width===x&&m.height===u&&m.chromaWidth===y&&m.chromaHeight===n&&m.cropLeft===p&&m.cropTop===t&&m.cropWidth===w&&m.cropHeight===l&&m.displayWidth===v&&m.displayHeight===h&&L.y.bytes.length===Ga&&L.u.bytes.length===Ha&&L.v.bytes.length===Ia){E=L;break}}E||(E={format:{width:x,height:u,chromaWidth:y,chromaHeight:n,cropLeft:p,cropTop:t,cropWidth:w,cropHeight:l,displayWidth:v,displayHeight:h},y:{bytes:new Uint8Array(Ga),
stride:c},u:{bytes:new Uint8Array(Ha),stride:d},v:{bytes:new Uint8Array(Ia),stride:g}});B(E.y.bytes,b,c,u,p,t,w,l,0);B(E.u.bytes,e,d,n,Ba,Ca,Da,Ea,128);B(E.v.bytes,f,g,n,Ba,Ca,Da,Ea,128);a.frameBuffer=E}};
(function(){function b(f){a.asm=f.exports;N=a.asm.h;ma();na=a.asm.p;pa.unshift(a.asm.i);Q--;a.monitorRunDependencies&&a.monitorRunDependencies(Q);0==Q&&(null!==sa&&(clearInterval(sa),sa=null),R&&(f=R,R=null,f()))}function c(f){b(f.instance)}function e(f){return wa().then(function(g){return WebAssembly.instantiate(g,d)}).then(function(g){return g}).then(f,function(g){J("failed to asynchronously prepare wasm: "+g);M(g)})}var d={a:La};Q++;a.monitorRunDependencies&&a.monitorRunDependencies(Q);if(a.instantiateWasm)try{return a.instantiateWasm(d,
b)}catch(f){return J("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return K||"function"!==typeof WebAssembly.instantiateStreaming||ta()||S.startsWith("file://")||"function"!==typeof fetch?e(c):fetch(S,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(c,function(g){J("wasm streaming compile failed: "+g);J("falling back to ArrayBuffer instantiation");return e(c)})})})().catch(q);return{}})();
a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.i).apply(null,arguments)};a._ogv_video_decoder_init=function(){return(a._ogv_video_decoder_init=a.asm.j).apply(null,arguments)};a._ogv_video_decoder_async=function(){return(a._ogv_video_decoder_async=a.asm.k).apply(null,arguments)};a._ogv_video_decoder_destroy=function(){return(a._ogv_video_decoder_destroy=a.asm.l).apply(null,arguments)};
a._ogv_video_decoder_process_header=function(){return(a._ogv_video_decoder_process_header=a.asm.m).apply(null,arguments)};a._ogv_video_decoder_process_frame=function(){return(a._ogv_video_decoder_process_frame=a.asm.n).apply(null,arguments)};a._free=function(){return(a._free=a.asm.o).apply(null,arguments)};a._malloc=function(){return(a._malloc=a.asm.q).apply(null,arguments)};var W;R=function Ma(){W||Pa();W||(R=Ma)};
function Pa(){function b(){if(!W&&(W=!0,a.calledRun=!0,!ja)){xa(pa);ba(a);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;){var c=a.postRun.shift();qa.unshift(c)}xa(qa)}}if(!(0<Q)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)ra();xa(oa);0<Q||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}a.run=Pa;
if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();Pa();var X,Qa,Y;"undefined"===typeof performance||"undefined"===typeof performance.now?Y=Date.now:Y=performance.now.bind(performance);function Z(b){var c=Y();b=b();a.cpuTime+=Y()-c;return b}a.loadedMetadata=!!ca.videoFormat;a.videoFormat=ca.videoFormat||null;a.frameBuffer=null;a.cpuTime=0;Object.defineProperty(a,"processing",{get:function(){return!1}});
a.init=function(b){Z(function(){a._ogv_video_decoder_init()});b()};a.processHeader=function(b,c){var e=Z(function(){var d=b.byteLength;X&&Qa>=d||(X&&a._free(X),Qa=d,X=a._malloc(Qa));var f=X;(new Uint8Array(N.buffer,f,d)).set(new Uint8Array(b));return a._ogv_video_decoder_process_header(f,d)});c(e)};a.A=[];
a.processFrame=function(b,c){function e(u){a._free(g);c(u)}var d=a._ogv_video_decoder_async(),f=b.byteLength,g=a._malloc(f);d&&a.A.push(e);var x=Z(function(){(new Uint8Array(N.buffer,g,f)).set(new Uint8Array(b));return a._ogv_video_decoder_process_frame(g,f)});d||e(x)};a.close=function(){};a.sync=function(){a._ogv_video_decoder_async()&&(a.A.push(function(){}),Z(function(){a._ogv_video_decoder_process_frame(0,0)}))};a.recycledFrames=[];
a.recycleFrame=function(b){var c=a.recycledFrames;c.push(b);16<c.length&&c.shift()};
return OGVDecoderVideoAV1W.ready
}
);
})();
if (typeof exports === 'object' && typeof module === 'object')
module.exports = OGVDecoderVideoAV1W;
else if (typeof define === 'function' && define['amd'])
define([], function() { return OGVDecoderVideoAV1W; });
else if (typeof exports === 'object')
exports["OGVDecoderVideoAV1W"] = OGVDecoderVideoAV1W;

View File

@ -0,0 +1,42 @@
var OGVDecoderVideoTheoraW = (() => {
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;
return (
function(OGVDecoderVideoTheoraW) {
OGVDecoderVideoTheoraW = OGVDecoderVideoTheoraW || {};
var a;a||(a=typeof OGVDecoderVideoTheoraW !== 'undefined' ? OGVDecoderVideoTheoraW : {});var ca=Object.assign,da,l;a.ready=new Promise(function(b,c){da=b;l=c});var ea=a,fa=ca({},a),ha="object"===typeof window,m="function"===typeof importScripts,t="",y,B,C,fs,D,E;
if("object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)t=m?require("path").dirname(t)+"/":__dirname+"/",E=function(){D||(fs=require("fs"),D=require("path"))},y=function(b,c){E();b=D.normalize(b);return fs.readFileSync(b,c?null:"utf8")},C=function(b){b=y(b,!0);b.buffer||(b=new Uint8Array(b));return b},B=function(b,c,e){E();b=D.normalize(b);fs.readFile(b,function(d,f){d?e(d):c(f.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),
process.on("unhandledRejection",function(b){throw b;}),a.inspect=function(){return"[Emscripten Module object]"};else if(ha||m)m?t=self.location.href:"undefined"!==typeof document&&document.currentScript&&(t=document.currentScript.src),_scriptDir&&(t=_scriptDir),0!==t.indexOf("blob:")?t=t.substr(0,t.replace(/[?#].*/,"").lastIndexOf("/")+1):t="",y=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);c.send(null);return c.responseText},m&&(C=function(b){var c=new XMLHttpRequest;c.open("GET",b,!1);
c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)}),B=function(b,c,e){var d=new XMLHttpRequest;d.open("GET",b,!0);d.responseType="arraybuffer";d.onload=function(){200==d.status||0==d.status&&d.response?c(d.response):e()};d.onerror=e;d.send(null)};a.print||console.log.bind(console);var H=a.printErr||console.warn.bind(console);ca(a,fa);fa=null;var I;a.wasmBinary&&(I=a.wasmBinary);var noExitRuntime=a.noExitRuntime||!0;"object"!==typeof WebAssembly&&J("no native wasm support detected");
var K,ia=!1,ja,L;function ka(){var b=K.buffer;ja=b;a.HEAP8=new Int8Array(b);a.HEAP16=new Int16Array(b);a.HEAP32=new Int32Array(b);a.HEAPU8=L=new Uint8Array(b);a.HEAPU16=new Uint16Array(b);a.HEAPU32=new Uint32Array(b);a.HEAPF32=new Float32Array(b);a.HEAPF64=new Float64Array(b)}var la,ma=[],na=[],oa=[];function pa(){var b=a.preRun.shift();ma.unshift(b)}var P=0,Q=null,R=null;a.preloadedImages={};a.preloadedAudios={};
function J(b){if(a.onAbort)a.onAbort(b);b="Aborted("+b+")";H(b);ia=!0;b=new WebAssembly.RuntimeError(b+". Build with -s ASSERTIONS=1 for more info.");l(b);throw b;}function qa(){return S.startsWith("data:application/octet-stream;base64,")}var S;S="ogv-decoder-video-theora-wasm.wasm";if(!qa()){var ra=S;S=a.locateFile?a.locateFile(ra,t):t+ra}function sa(){var b=S;try{if(b==S&&I)return new Uint8Array(I);if(C)return C(b);throw"both async and sync fetching of the wasm failed";}catch(c){J(c)}}
function ta(){if(!I&&(ha||m)){if("function"===typeof fetch&&!S.startsWith("file://"))return fetch(S,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+S+"'";return b.arrayBuffer()}).catch(function(){return sa()});if(B)return new Promise(function(b,c){B(S,function(e){b(new Uint8Array(e))},c)})}return Promise.resolve().then(function(){return sa()})}
function T(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c(a);else{var e=c.A;"number"===typeof e?void 0===c.o?ua(e)():ua(e)(c.o):e(void 0===c.o?null:c.o)}}}var U=[];function ua(b){var c=U[b];c||(b>=U.length&&(U.length=b+1),U[b]=c=la.get(b));return c}
var Ga={a:function(b,c,e){L.copyWithin(b,c,c+e)},b:function(b){var c=L.length;b>>>=0;if(2147483648<b)return!1;for(var e=1;4>=e;e*=2){var d=c*(1+.2/e);d=Math.min(d,b+100663296);d=Math.max(b,d);0<d%65536&&(d+=65536-d%65536);a:{try{K.grow(Math.min(2147483648,d)-ja.byteLength+65535>>>16);ka();var f=1;break a}catch(g){}f=void 0}if(f)return!0}return!1},c:function(b,c,e,d,f,g,q,n,z,p,u,F,M,N,Z,aa){function ba(A,h,v,va,wa,xa,Ia,Ja,O){A.set(new Uint8Array(Ka,h,v*va));var w,r;for(w=r=0;w<xa;w++,r+=v)for(h=
0;h<v;h++)A[r+h]=O;for(;w<xa+Ja;w++,r+=v){for(h=0;h<wa;h++)A[r+h]=O;for(h=wa+Ia;h<v;h++)A[r+h]=O}for(;w<va;w++,r+=v)for(h=0;h<v;h++)A[r+h]=O;return A}var Ka=K.buffer,k=a.videoFormat,ya=(M&-2)*z/q,za=(N&-2)*p/n,Aa=u*z/q,Ba=F*p/n;u===k.cropWidth&&F===k.cropHeight&&(Z=k.displayWidth,aa=k.displayHeight);for(var Ca=a.recycledFrames,x,Da=n*c,Ea=p*d,Fa=p*g;0<Ca.length;){var G=Ca.shift();k=G.format;if(k.width===q&&k.height===n&&k.chromaWidth===z&&k.chromaHeight===p&&k.cropLeft===M&&k.cropTop===N&&k.cropWidth===
u&&k.cropHeight===F&&k.displayWidth===Z&&k.displayHeight===aa&&G.y.bytes.length===Da&&G.u.bytes.length===Ea&&G.v.bytes.length===Fa){x=G;break}}x||(x={format:{width:q,height:n,chromaWidth:z,chromaHeight:p,cropLeft:M,cropTop:N,cropWidth:u,cropHeight:F,displayWidth:Z,displayHeight:aa},y:{bytes:new Uint8Array(Da),stride:c},u:{bytes:new Uint8Array(Ea),stride:d},v:{bytes:new Uint8Array(Fa),stride:g}});ba(x.y.bytes,b,c,n,M,N,u,F,0);ba(x.u.bytes,e,d,p,ya,za,Aa,Ba,128);ba(x.v.bytes,f,g,p,ya,za,Aa,Ba,128);
a.frameBuffer=x},d:function(b,c,e,d,f,g,q,n,z,p,u){a.videoFormat={width:b,height:c,chromaWidth:e,chromaHeight:d,cropLeft:n,cropTop:z,cropWidth:g,cropHeight:q,displayWidth:p,displayHeight:u,fps:f};a.loadedMetadata=!0}};
(function(){function b(f){a.asm=f.exports;K=a.asm.e;ka();la=a.asm.n;na.unshift(a.asm.f);P--;a.monitorRunDependencies&&a.monitorRunDependencies(P);0==P&&(null!==Q&&(clearInterval(Q),Q=null),R&&(f=R,R=null,f()))}function c(f){b(f.instance)}function e(f){return ta().then(function(g){return WebAssembly.instantiate(g,d)}).then(function(g){return g}).then(f,function(g){H("failed to asynchronously prepare wasm: "+g);J(g)})}var d={a:Ga};P++;a.monitorRunDependencies&&a.monitorRunDependencies(P);if(a.instantiateWasm)try{return a.instantiateWasm(d,
b)}catch(f){return H("Module.instantiateWasm callback failed with error: "+f),!1}(function(){return I||"function"!==typeof WebAssembly.instantiateStreaming||qa()||S.startsWith("file://")||"function"!==typeof fetch?e(c):fetch(S,{credentials:"same-origin"}).then(function(f){return WebAssembly.instantiateStreaming(f,d).then(c,function(g){H("wasm streaming compile failed: "+g);H("falling back to ArrayBuffer instantiation");return e(c)})})})().catch(l);return{}})();
a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.f).apply(null,arguments)};a._ogv_video_decoder_init=function(){return(a._ogv_video_decoder_init=a.asm.g).apply(null,arguments)};a._ogv_video_decoder_async=function(){return(a._ogv_video_decoder_async=a.asm.h).apply(null,arguments)};a._ogv_video_decoder_process_header=function(){return(a._ogv_video_decoder_process_header=a.asm.i).apply(null,arguments)};
a._ogv_video_decoder_process_frame=function(){return(a._ogv_video_decoder_process_frame=a.asm.j).apply(null,arguments)};a._ogv_video_decoder_destroy=function(){return(a._ogv_video_decoder_destroy=a.asm.k).apply(null,arguments)};a._malloc=function(){return(a._malloc=a.asm.l).apply(null,arguments)};a._free=function(){return(a._free=a.asm.m).apply(null,arguments)};var V;R=function Ha(){V||La();V||(R=Ha)};
function La(){function b(){if(!V&&(V=!0,a.calledRun=!0,!ia)){T(na);da(a);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;){var c=a.postRun.shift();oa.unshift(c)}T(oa)}}if(!(0<P)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)pa();T(ma);0<P||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);b()},1)):b())}}a.run=La;
if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();La();var W,Ma,X;"undefined"===typeof performance||"undefined"===typeof performance.now?X=Date.now:X=performance.now.bind(performance);function Y(b){var c=X();b=b();a.cpuTime+=X()-c;return b}a.loadedMetadata=!!ea.videoFormat;a.videoFormat=ea.videoFormat||null;a.frameBuffer=null;a.cpuTime=0;Object.defineProperty(a,"processing",{get:function(){return!1}});
a.init=function(b){Y(function(){a._ogv_video_decoder_init()});b()};a.processHeader=function(b,c){var e=Y(function(){var d=b.byteLength;W&&Ma>=d||(W&&a._free(W),Ma=d,W=a._malloc(Ma));var f=W;(new Uint8Array(K.buffer,f,d)).set(new Uint8Array(b));return a._ogv_video_decoder_process_header(f,d)});c(e)};a.s=[];
a.processFrame=function(b,c){function e(n){a._free(g);c(n)}var d=a._ogv_video_decoder_async(),f=b.byteLength,g=a._malloc(f);d&&a.s.push(e);var q=Y(function(){(new Uint8Array(K.buffer,g,f)).set(new Uint8Array(b));return a._ogv_video_decoder_process_frame(g,f)});d||e(q)};a.close=function(){};a.sync=function(){a._ogv_video_decoder_async()&&(a.s.push(function(){}),Y(function(){a._ogv_video_decoder_process_frame(0,0)}))};a.recycledFrames=[];
a.recycleFrame=function(b){var c=a.recycledFrames;c.push(b);16<c.length&&c.shift()};
return OGVDecoderVideoTheoraW.ready
}
);
})();
if (typeof exports === 'object' && typeof module === 'object')
module.exports = OGVDecoderVideoTheoraW;
else if (typeof define === 'function' && define['amd'])
define([], function() { return OGVDecoderVideoTheoraW; });
else if (typeof exports === 'object')
exports["OGVDecoderVideoTheoraW"] = OGVDecoderVideoTheoraW;

Some files were not shown because too many files have changed in this diff Show More