diff --git a/.gitignore b/.gitignore
index c97ac56..0ad2ba8 100755
--- a/.gitignore
+++ b/.gitignore
@@ -72,3 +72,5 @@ application-local.properties
/admin-frontend/node_modules/
/workplace/
+
+/node_modules/
\ No newline at end of file
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..7344e8b
--- /dev/null
+++ b/package.json
@@ -0,0 +1,21 @@
+{
+ "name": "plugin-live2d",
+ "private": true,
+ "author": {
+ "name": "LIlGG",
+ "url": "https://github.com/LIlGG"
+ },
+ "contributors": [
+ {
+ "name": "LIlGG",
+ "email": "mail@e.lixingyong.com",
+ "url": "https://github.com/LIlGG"
+ }
+ ],
+ "license": "MIT",
+ "devDependencies": {
+ "@biomejs/biome": "^1.9.3",
+ "typescript": "^5.7.2"
+ },
+ "packageManager": "pnpm@9.4.0+sha512.f549b8a52c9d2b8536762f99c0722205efc5af913e77835dbccc3b0b0b2ca9e7dc8022b78062c17291c48e88749c70ce88eb5a74f1fa8c4bf5e18bb46c8bd83a"
+}
diff --git a/packages/live2d/.editorconfig b/packages/live2d/.editorconfig
new file mode 100644
index 0000000..3c2d313
--- /dev/null
+++ b/packages/live2d/.editorconfig
@@ -0,0 +1,11 @@
+# EditorConfig is awesome: https://EditorConfig.org
+
+# top-most EditorConfig file
+root = true
+
+[*]
+indent_style = space
+indent_size = 2
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = false
\ No newline at end of file
diff --git a/packages/live2d/.gitignore b/packages/live2d/.gitignore
new file mode 100644
index 0000000..38d7344
--- /dev/null
+++ b/packages/live2d/.gitignore
@@ -0,0 +1,13 @@
+# Local
+.DS_Store
+*.local
+*.log*
+
+# Dist
+node_modules
+dist/
+
+# IDE
+.vscode/*
+!.vscode/extensions.json
+.idea
diff --git a/packages/live2d/README.md b/packages/live2d/README.md
new file mode 100644
index 0000000..37b1dd3
--- /dev/null
+++ b/packages/live2d/README.md
@@ -0,0 +1,29 @@
+# Rsbuild Project
+
+## Setup
+
+Install the dependencies:
+
+```bash
+pnpm install
+```
+
+## Get Started
+
+Start the dev server:
+
+```bash
+pnpm dev
+```
+
+Build the app for production:
+
+```bash
+pnpm build
+```
+
+Preview the production build locally:
+
+```bash
+pnpm preview
+```
diff --git a/packages/live2d/biome.json b/packages/live2d/biome.json
new file mode 100644
index 0000000..f281009
--- /dev/null
+++ b/packages/live2d/biome.json
@@ -0,0 +1,30 @@
+{
+ "$schema": "https://biomejs.dev/schemas/1.8.0/schema.json",
+ "organizeImports": {
+ "enabled": true
+ },
+ "vcs": {
+ "enabled": true,
+ "clientKind": "git",
+ "useIgnoreFile": true
+ },
+ "formatter": {
+ "indentStyle": "space"
+ },
+ "javascript": {
+ "formatter": {
+ "quoteStyle": "single"
+ }
+ },
+ "css": {
+ "parser": {
+ "cssModules": true
+ }
+ },
+ "linter": {
+ "enabled": true,
+ "rules": {
+ "recommended": true
+ }
+ }
+}
diff --git a/packages/live2d/index.html b/packages/live2d/index.html
new file mode 100644
index 0000000..7f0cf33
--- /dev/null
+++ b/packages/live2d/index.html
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+ Live2d Demo
+
+
+
+
+
+
diff --git a/packages/live2d/package.json b/packages/live2d/package.json
new file mode 100644
index 0000000..5ea11bf
--- /dev/null
+++ b/packages/live2d/package.json
@@ -0,0 +1,40 @@
+{
+ "name": "live2d",
+ "private": true,
+ "version": "1.0.0",
+ "type": "module",
+ "files": ["dist"],
+ "main": "./dist/live2d.umd.cjs",
+ "module": "./dist/live2d.js",
+ "exports": {
+ ".": {
+ "import": "./dist/live2d.js",
+ "require": "./dist/live2d.umd.cjs"
+ }
+ },
+ "scripts": {
+ "dev": "vite --open",
+ "build": "tsc -b && vite build",
+ "check": "biome check --write"
+ },
+ "dependencies": {
+ "@lit/context": "^1.1.3",
+ "@lit/react": "^1.0.7",
+ "iconify-icon": "^2.3.0",
+ "lit": "^3.2.1",
+ "pixi-live2d-display": "^0.4.0",
+ "pixi.js": "^6.5.2",
+ "query-string": "^9.1.1",
+ "react": "^19.0.0",
+ "react-dom": "^19.0.0"
+ },
+ "devDependencies": {
+ "@types/react": "^19.0.0",
+ "@types/react-dom": "^19.0.0",
+ "@unocss/postcss": "^65.4.3",
+ "@vitejs/plugin-react": "^4.3.4",
+ "ts-lit-plugin": "^2.0.2",
+ "unocss": "^65.4.3",
+ "vite": "^6.1.0"
+ }
+}
diff --git a/packages/live2d/postcss.config.mjs b/packages/live2d/postcss.config.mjs
new file mode 100644
index 0000000..b30e274
--- /dev/null
+++ b/packages/live2d/postcss.config.mjs
@@ -0,0 +1,5 @@
+import UnoCSS from '@unocss/postcss';
+
+export default {
+ plugins: [UnoCSS()],
+};
diff --git a/packages/live2d/src/Demo.tsx b/packages/live2d/src/Demo.tsx
new file mode 100644
index 0000000..e45a8b3
--- /dev/null
+++ b/packages/live2d/src/Demo.tsx
@@ -0,0 +1,13 @@
+import React from 'react';
+import ReactDOM from 'react-dom/client';
+import { Live2dContextComponent } from './components/Live2dContext';
+
+const rootEl = document.getElementById('root');
+if (rootEl) {
+ const root = ReactDOM.createRoot(rootEl);
+ root.render(
+
+
+ ,
+ );
+}
diff --git a/packages/live2d/src/common/UnoLitElement.ts b/packages/live2d/src/common/UnoLitElement.ts
new file mode 100644
index 0000000..afb1175
--- /dev/null
+++ b/packages/live2d/src/common/UnoLitElement.ts
@@ -0,0 +1,4 @@
+import { LitElement } from 'lit';
+import { UNO } from '../utils/unoMixin';
+
+export const UnoLitElement = UNO(LitElement);
diff --git a/packages/live2d/src/components/Live2dCanvas.tsx b/packages/live2d/src/components/Live2dCanvas.tsx
new file mode 100644
index 0000000..3533788
--- /dev/null
+++ b/packages/live2d/src/components/Live2dCanvas.tsx
@@ -0,0 +1,46 @@
+import { consume } from "@lit/context";
+import { createComponent } from "@lit/react";
+import { type PropertyValues, type TemplateResult, html } from "lit";
+import { property, query, state } from "lit/decorators.js";
+import React from "react";
+import { UnoLitElement } from "../common/UnoLitElement";
+import { type Live2dConfig, configContext } from "../context/config-context";
+import { BeforeInitEvent } from "../events/before-init.js";
+import Model from "../live2d/model";
+
+export class Live2dCanvas extends UnoLitElement {
+ @consume({ context: configContext })
+ @property({ attribute: false })
+ public config?: Live2dConfig;
+
+ @state()
+ private _model: unknown;
+
+ @query("#live2d")
+ private _live2d: HTMLCanvasElement;
+
+ render(): TemplateResult {
+ return html` `;
+ }
+
+ connectedCallback(): void {
+ super.connectedCallback();
+ // 发出 Live2d beforeInit 事件
+ window.dispatchEvent(new BeforeInitEvent({ config: this.config }));
+ }
+
+ protected firstUpdated(_changedProperties: PropertyValues): void {
+ super.firstUpdated(_changedProperties);
+ if (this.config && this._live2d) {
+ this._model = new Model(this._live2d, this.config);
+ }
+ }
+}
+
+customElements.define("live2d-canvas", Live2dCanvas);
+
+export const Live2dCanvasComponent = createComponent({
+ tagName: "live2d-canvas",
+ elementClass: Live2dCanvas,
+ react: React,
+});
diff --git a/packages/live2d/src/components/Live2dContext.tsx b/packages/live2d/src/components/Live2dContext.tsx
new file mode 100644
index 0000000..403ae28
--- /dev/null
+++ b/packages/live2d/src/components/Live2dContext.tsx
@@ -0,0 +1,30 @@
+import { createComponent } from '@lit/react';
+import { type TemplateResult, html } from 'lit';
+import React from 'react';
+import { UnoLitElement } from '../common/UnoLitElement';
+import './Live2dWidget';
+import { provide } from '@lit/context';
+import { type Live2dConfig, configContext } from '../context/config-context';
+import '../events';
+
+export class Live2dContext extends UnoLitElement {
+ @provide({ context: configContext })
+ config = {
+ apiPath: 'https://live2d.fghrsh.net/api',
+ live2dLocation: 'right',
+ consoleShowStatus: false,
+ isTools: true,
+ } as Live2dConfig;
+
+ render(): TemplateResult {
+ return html` `;
+ }
+}
+
+customElements.define('live2d-context', Live2dContext);
+
+export const Live2dContextComponent = createComponent({
+ tagName: 'live2d-context',
+ elementClass: Live2dContext,
+ react: React,
+});
diff --git a/packages/live2d/src/components/Live2dTips.tsx b/packages/live2d/src/components/Live2dTips.tsx
new file mode 100644
index 0000000..65910bc
--- /dev/null
+++ b/packages/live2d/src/components/Live2dTips.tsx
@@ -0,0 +1,94 @@
+import { consume } from '@lit/context';
+import { createComponent } from '@lit/react';
+import { type TemplateResult, html } from 'lit';
+import { property, state } from 'lit/decorators.js';
+import { classMap } from 'lit/directives/class-map.js';
+import { unsafeHTML } from 'lit/directives/unsafe-html.js';
+import React from 'react';
+import { UnoLitElement } from '../common/UnoLitElement';
+import { type Live2dConfig, configContext } from '../context/config-context';
+import type { SendMessageEvent } from '../events/send-message';
+import { isNotEmpty } from '../utils/isNotEmpty';
+import { randomSelection } from '../utils/randomSelection';
+
+export class Live2dTips extends UnoLitElement {
+ @consume({ context: configContext })
+ @property({ attribute: false })
+ public config?: Live2dConfig;
+
+ @state()
+ private _isShow = false;
+ @state()
+ private _message = '';
+ private priority = -1;
+ private messageTimer: number | null = null;
+
+ constructor() {
+ super();
+ this._isShow = false;
+ this._message = '';
+ }
+
+ render(): TemplateResult {
+ const classes = {
+ 'opacity-100': this._isShow,
+ 'opacity-0': !this._isShow,
+ };
+ return html`
+
+ ${unsafeHTML(this._message)}
+
+ `;
+ }
+
+ connectedCallback(): void {
+ super.connectedCallback();
+ // 为 tips 注册 tips 相关事件
+ window.addEventListener(
+ 'live2d:send-message',
+ this.handleMessage.bind(this),
+ );
+ }
+
+ disconnectedCallback(): void {
+ super.disconnectedCallback();
+ window.removeEventListener(
+ 'live2d:send-message',
+ this.handleMessage.bind(this),
+ );
+ }
+
+ handleMessage(e: SendMessageEvent): void {
+ const { text, timeout, priority } = e.detail;
+ if (!isNotEmpty(text)) {
+ return;
+ }
+ if (priority < this.priority) {
+ return;
+ }
+ if (this.messageTimer) {
+ clearTimeout(this.messageTimer);
+ this.messageTimer = null;
+ }
+ const message = randomSelection(text);
+ if (!isNotEmpty(message)) {
+ return;
+ }
+ this.priority = priority;
+ this._message = message;
+ this._isShow = true;
+ this.messageTimer = setTimeout(() => {
+ this._isShow = false;
+ this.priority = -1;
+ }, timeout);
+ }
+}
+
+customElements.define('live2d-tips', Live2dTips);
+
+export const Live2dTipsComponent = createComponent({
+ tagName: 'live2d-tips',
+ elementClass: Live2dTips,
+ react: React,
+});
diff --git a/packages/live2d/src/components/Live2dToggle.tsx b/packages/live2d/src/components/Live2dToggle.tsx
new file mode 100644
index 0000000..4d93934
--- /dev/null
+++ b/packages/live2d/src/components/Live2dToggle.tsx
@@ -0,0 +1,72 @@
+import { createComponent } from '@lit/react';
+import { type TemplateResult, html } from 'lit';
+import { state } from 'lit/decorators.js';
+import React from 'react';
+import { UnoLitElement } from '../common/UnoLitElement';
+import { ToggleCanvasEvent } from '../events/toggle-canvas';
+
+export class Live2dToggle extends UnoLitElement {
+ @state()
+ // 当前工具栏是否显示
+ private _isShow = false;
+
+ connectedCallback(): void {
+ super.connectedCallback();
+ this.addEventListener('click', this.handleClick);
+
+ // 初始化时,判断是否已经隐藏看板娘超过一天,如果是,则显示看板娘。否则,继续隐藏看板娘。
+ const live2dDisplay = localStorage.getItem('live2d-display');
+ if (live2dDisplay) {
+ if (Date.now() - Number.parseInt(live2dDisplay) <= 24 * 60 * 60 * 1000) {
+ this.triggerToggleLive2d(false);
+ return;
+ }
+ }
+ this.triggerToggleLive2d(true);
+ }
+
+ disconnectedCallback(): void {
+ super.disconnectedCallback();
+ this.removeEventListener('click', this.handleClick);
+ }
+
+ render(): TemplateResult {
+ return html`
+ 看板娘
+
`;
+ }
+
+ handleClick() {
+ this.triggerToggleLive2d(!!this._isShow);
+ }
+
+ triggerToggleLive2d(isShow: boolean) {
+ // 当前切换栏与 Live2d 的显示状态相反
+ this._isShow = !isShow;
+ if (isShow) {
+ localStorage.removeItem('live2d-display');
+ } else {
+ localStorage.setItem('live2d-display', Date.now().toString());
+ }
+ this.dispatchEvent(
+ new ToggleCanvasEvent({
+ isShow,
+ }),
+ );
+ }
+}
+
+customElements.define('live2d-toggle', Live2dToggle);
+
+export const Live2dToggleComponent = createComponent({
+ tagName: 'live2d-toggle',
+ elementClass: Live2dToggle,
+ react: React,
+});
diff --git a/packages/live2d/src/components/Live2dTools.tsx b/packages/live2d/src/components/Live2dTools.tsx
new file mode 100644
index 0000000..067db9f
--- /dev/null
+++ b/packages/live2d/src/components/Live2dTools.tsx
@@ -0,0 +1,104 @@
+import { consume } from '@lit/context';
+import { createComponent } from '@lit/react';
+import { type TemplateResult, html } from 'lit';
+import { property, state } from 'lit/decorators.js';
+import React from 'react';
+import { UnoLitElement } from '../common/UnoLitElement';
+import { type Live2dConfig, configContext } from '../context/config-context';
+import presetTools from '../live2d/tools';
+import { CustomTool } from '../live2d/tools/custom-tool';
+import type { Tool } from '../live2d/tools/tools';
+import 'iconify-icon';
+
+export class Live2dTools extends UnoLitElement {
+ @consume({ context: configContext })
+ @property({ attribute: false })
+ public config?: Live2dConfig;
+
+ @state()
+ private _tools: Tool[] = [];
+
+ render(): TemplateResult {
+ return html`
+ ${this._tools.map(this.renderTool)}
+
`;
+ }
+
+ renderTool(tool: Tool): TemplateResult {
+ return html` tool.execute()}
+ >
+
+ `;
+ }
+
+ connectedCallback(): void {
+ super.connectedCallback();
+ // 根据配置生成对应的工具
+ this.initializeTools();
+ }
+
+ private initializeTools(): void {
+ // 获取预设工具
+ const presetTools = this.getPresetTools();
+ // 获取自定义工具
+ const customTools = this.getCustomTools();
+ // 合并所有工具,并按照 priority 排序
+ const tools = [...presetTools, ...customTools].sort(
+ (a, b) => b.priority - a.priority,
+ );
+ this._tools.push(...tools);
+ }
+
+ private getCustomTools(): Tool[] {
+ if (!this.config) {
+ return [];
+ }
+ const customTools = this.config?.customTools;
+ if (!customTools || customTools.length === 0) {
+ return [];
+ }
+ const mountTool: Tool[] = [];
+ for (const tool of customTools) {
+ const customTool = new CustomTool(this.config, tool);
+ mountTool.push(customTool);
+ }
+ return mountTool;
+ }
+
+ // 获取预设工具
+ private getPresetTools(): Tool[] {
+ if (!this.config) {
+ return [];
+ }
+ const mountTool: Tool[] = [];
+ const tools = this.config?.tools;
+ if (!tools || tools.length === 0) {
+ // 加载所有预设工具
+ for (const Tool of presetTools) {
+ mountTool.push(new Tool(this.config));
+ }
+ return mountTool;
+ }
+
+ for (const toolName of tools) {
+ const ToolClass = presetTools.find((t) => t.name === toolName);
+ if (ToolClass) {
+ mountTool.push(new ToolClass(this.config));
+ }
+ }
+ return mountTool;
+ }
+}
+
+customElements.define('live2d-tools', Live2dTools);
+
+export const Live2dToolsComponent = createComponent({
+ tagName: 'live2d-tools',
+ elementClass: Live2dTools,
+ react: React,
+});
diff --git a/packages/live2d/src/components/Live2dWidget.tsx b/packages/live2d/src/components/Live2dWidget.tsx
new file mode 100644
index 0000000..461812e
--- /dev/null
+++ b/packages/live2d/src/components/Live2dWidget.tsx
@@ -0,0 +1,62 @@
+import { consume } from '@lit/context';
+import { createComponent } from '@lit/react';
+import { type TemplateResult, html } from 'lit';
+import { property, state } from 'lit/decorators.js';
+import React from 'react';
+import { UnoLitElement } from '../common/UnoLitElement';
+import { type Live2dConfig, configContext } from '../context/config-context';
+import './Live2dToggle';
+import './Live2dTips';
+import './Live2dCanvas';
+import './Live2dTools';
+import type { ToggleCanvasEvent } from '../events/toggle-canvas';
+
+export class Live2dWidget extends UnoLitElement {
+ @consume({ context: configContext })
+ @property({ attribute: false })
+ public config?: Live2dConfig;
+
+ @state()
+ private _isShow = false;
+
+ render(): TemplateResult {
+ return html`
+
+ ${this.renderLive2dWidget()}
+ `;
+ }
+
+ renderLive2dTools() {
+ if (this.config?.isTools) {
+ return html``;
+ }
+ }
+
+ renderLive2dWidget() {
+ if (this._isShow) {
+ return html``;
+ }
+ }
+
+ handleToggleWidget(e: ToggleCanvasEvent) {
+ this._isShow = e.detail.isShow;
+ }
+}
+
+customElements.define('live2d-widget', Live2dWidget);
+
+export const Live2dWidgetComponent = createComponent({
+ tagName: 'live2d-widget',
+ elementClass: Live2dWidget,
+ react: React,
+});
diff --git a/packages/live2d/src/context/config-context.ts b/packages/live2d/src/context/config-context.ts
new file mode 100644
index 0000000..b547493
--- /dev/null
+++ b/packages/live2d/src/context/config-context.ts
@@ -0,0 +1,110 @@
+import { createContext } from '@lit/context';
+import type { CustomToolConfig } from 'live2d/tools/custom-tool';
+
+export interface ObjectAny extends Record {}
+
+export interface TipMouseover extends ObjectAny {
+ selector: string;
+ text: string[] | string;
+}
+
+export interface TipClick extends ObjectAny {
+ selector: string;
+ text: string[] | string;
+}
+
+export interface TipSeason extends ObjectAny {
+ date: string;
+ text: string[] | string;
+}
+
+export interface TipTime extends ObjectAny {
+ hour: string;
+ text: string[] | string;
+}
+
+export interface TipMessage extends ObjectAny {
+ default?: string[] | string;
+ console?: string[] | string;
+ copy?: string[] | string;
+ visibilitychange?: string[] | string;
+}
+
+export interface TipConfig {
+ mouseover: TipMouseover[];
+ click: TipClick[];
+ seasons: TipSeason[];
+ time: TipTime[];
+ message: TipMessage;
+}
+
+export interface Live2dToolsConfig {
+ // 是否显示右侧工具栏
+ isTools?: boolean;
+ // 显示的预设工具
+ tools?: string[];
+ // 自定义工具
+ customTools?: CustomToolConfig[];
+ // openai 图标
+ openaiIcon?: string;
+ // 一言图标
+ hitokotoIcon?: string;
+ // 一言API
+ hitokotoApi?: string;
+ // 小宇宙游戏图标
+ asteroidsIcon?: string;
+ // 切换模型图标
+ switchModelIcon?: string;
+ // 切换纹理图标
+ switchTextureIcon?: string;
+ // 截图生成的图片名称
+ screenshotName?: string;
+ // 截图图标
+ screenshotIcon?: string;
+ // 信息图标
+ infoIcon?: string;
+ // 信息站点地址
+ infoSite?: string;
+ // 退出 Live2d 图标
+ exitIcon?: string;
+}
+
+export interface Live2dConfig extends Live2dToolsConfig {
+ // Live2d API 路径
+ apiPath: string;
+ // Live2d 定位
+ live2dLocation: 'left' | 'right';
+ // 是否在控制台显示状态
+ consoleShowStatus?: boolean;
+ // 是否强制使用默认配置
+ isForceUseDefaultConfig?: boolean;
+ // 模型编号
+ modelId?: number;
+ // 纹理编号
+ modelTexturesId?: number;
+ // 主题下的 tips 文件路径
+ themeTipsPath?: string;
+ // 用户自定义的 tips 文件路径
+ tipsPath?: string;
+ // 用户使用插件定义的 tips
+ selectorTips?: [
+ {
+ messageTexts?: {
+ message: string;
+ }[];
+ selector: string;
+ mouseAction: 'click' | 'mouseover' | string | undefined;
+ },
+ ];
+ // 页面可见性变化时的 tips
+ backSiteTip: string[] | string;
+ // 复制内容时的 tips
+ copyContentTip: string[] | string;
+ // 控制台打印 tips
+ openConsoleTip: string[] | string;
+ // 首次打开站点是否显示 tips
+ firstOpenSite?: boolean;
+ [key: string]: unknown;
+}
+
+export const configContext = createContext('config');
diff --git a/packages/live2d/src/env.d.ts b/packages/live2d/src/env.d.ts
new file mode 100644
index 0000000..b0ac762
--- /dev/null
+++ b/packages/live2d/src/env.d.ts
@@ -0,0 +1 @@
+///
diff --git a/packages/live2d/src/events/add-default-message.ts b/packages/live2d/src/events/add-default-message.ts
new file mode 100644
index 0000000..85ea866
--- /dev/null
+++ b/packages/live2d/src/events/add-default-message.ts
@@ -0,0 +1,24 @@
+import { Live2dEvent } from './types';
+
+export const ADD_DEFAULT_MESSAGE_EVENT_NAME =
+ 'live2d:add-default-message' as const;
+
+declare global {
+ interface GlobalEventHandlersEventMap {
+ [ADD_DEFAULT_MESSAGE_EVENT_NAME]: AddDefaultMessageEvent;
+ }
+}
+
+export interface Live2dAddDefaultMessageEventDetail {
+ // 默认消息
+ message: string[] | string;
+}
+
+/**
+ * 添加默认消息事件
+ */
+export class AddDefaultMessageEvent extends Live2dEvent {
+ constructor(detail: Live2dAddDefaultMessageEventDetail) {
+ super(ADD_DEFAULT_MESSAGE_EVENT_NAME, detail);
+ }
+}
diff --git a/packages/live2d/src/events/before-init.ts b/packages/live2d/src/events/before-init.ts
new file mode 100644
index 0000000..66d728e
--- /dev/null
+++ b/packages/live2d/src/events/before-init.ts
@@ -0,0 +1,23 @@
+import type { Live2dConfig } from 'context/config-context';
+import { Live2dEvent } from './types';
+
+export const BEFORE_INIT_EVENT_NAME = 'live2d:before-init' as const;
+
+declare global {
+ interface GlobalEventHandlersEventMap {
+ [BEFORE_INIT_EVENT_NAME]: BeforeInitEvent;
+ }
+}
+
+export interface Live2dBeforeInitEventDetail {
+ config?: Live2dConfig;
+}
+
+/**
+ * Live2d 初始化前事件
+ */
+export class BeforeInitEvent extends Live2dEvent {
+ constructor(detail: Live2dBeforeInitEventDetail) {
+ super(BEFORE_INIT_EVENT_NAME, detail);
+ }
+}
diff --git a/packages/live2d/src/events/index.ts b/packages/live2d/src/events/index.ts
new file mode 100644
index 0000000..6513bc6
--- /dev/null
+++ b/packages/live2d/src/events/index.ts
@@ -0,0 +1 @@
+import './tip-events';
diff --git a/packages/live2d/src/events/send-message.ts b/packages/live2d/src/events/send-message.ts
new file mode 100644
index 0000000..87eeef4
--- /dev/null
+++ b/packages/live2d/src/events/send-message.ts
@@ -0,0 +1,27 @@
+import { Live2dEvent } from './types';
+
+export const SEND_MESSAGE_EVENT_NAME = 'live2d:send-message' as const;
+
+declare global {
+ interface GlobalEventHandlersEventMap {
+ [SEND_MESSAGE_EVENT_NAME]: SendMessageEvent;
+ }
+}
+
+export interface Live2dMessageEventDetail {
+ // 消息内容
+ text: string[] | string;
+ // 消息显示时间
+ timeout: number;
+ // 消息优先级
+ priority: number;
+}
+
+/**
+ * 发送消息事件
+ */
+export class SendMessageEvent extends Live2dEvent {
+ constructor(detail: Live2dMessageEventDetail) {
+ super(SEND_MESSAGE_EVENT_NAME, detail);
+ }
+}
diff --git a/packages/live2d/src/events/tip-events.ts b/packages/live2d/src/events/tip-events.ts
new file mode 100644
index 0000000..3a9f13d
--- /dev/null
+++ b/packages/live2d/src/events/tip-events.ts
@@ -0,0 +1,235 @@
+import type {
+ Live2dConfig,
+ TipClick,
+ TipConfig,
+ TipMessage,
+ TipMouseover,
+ TipSeason,
+ TipTime,
+} from '../context/config-context';
+import { dataWithinRange } from '../helpers/dateWithinRange';
+import { getPluginTips } from '../helpers/getPluginTips';
+import { loadTipsResource } from '../helpers/loadTipsResource';
+import { mergeTips } from '../helpers/mergeTips';
+import { sendMessage } from '../helpers/sendMessage';
+import { timeWithinRange } from '../helpers/timeWithinRange';
+import { isNotEmptyString, isString } from '../utils/isString';
+import { randomSelection } from '../utils/randomSelection';
+import {
+ documentTitle,
+ getReferrerDomain,
+ hasWebsiteHome,
+} from '../utils/util';
+import { AddDefaultMessageEvent } from './add-default-message';
+
+window.addEventListener('live2d:before-init', async (e) => {
+ const config = e.detail.config;
+ if (!config) {
+ return;
+ }
+ const tips = await _loadTips(config);
+ if (!tips) {
+ return;
+ }
+ _registerTipEventListener(config, tips);
+});
+
+const _getWelComeMessage = (times: TipTime[]) => {
+ if (hasWebsiteHome) {
+ for (const { hour, text } of times) {
+ if (timeWithinRange(hour)) {
+ return text;
+ }
+ }
+ }
+
+ const message = `欢迎阅读「${documentTitle}」`;
+ const domain = getReferrerDomain();
+ return domain
+ ? `Hello!来自 ${domain} 的朋友
${message}`
+ : message;
+};
+
+const _welcomeEvent = (times: TipTime[]) => {
+ const message = _getWelComeMessage(times);
+ if (!message) {
+ return;
+ }
+ sendMessage(message, 7000, 4);
+};
+
+const _holidayEvent = (seasons: TipSeason[]) => {
+ for (const { date, text } of seasons) {
+ if (dataWithinRange(date)) {
+ window.dispatchEvent(new AddDefaultMessageEvent({ message: text }));
+ }
+ }
+};
+
+const _userLeaveEvent = (message: TipMessage) => {
+ const { visibilitychange } = message;
+ document.addEventListener('visibilitychange', () => {
+ if (!document.hidden) {
+ sendMessage(visibilitychange, 6000, 2);
+ }
+ });
+};
+
+const _userCopyEvent = (message: TipMessage) => {
+ const { copy } = message;
+ window.addEventListener('copy', () => {
+ sendMessage(copy, 6000, 2);
+ });
+};
+
+const _userOpenConsoleEvent = (message: TipMessage) => {
+ const { console } = message;
+ const devtools = () => {};
+ devtools.toString = () => {
+ sendMessage(console, 6000, 2);
+ };
+};
+
+const _userClickEvent = (clicks: TipClick[]) => {
+ window.addEventListener('click', (event) => {
+ const path = event.composedPath();
+ const target = path[0];
+ if (!(target instanceof HTMLElement)) {
+ return;
+ }
+ for (const { selector, text } of clicks) {
+ if (!target.matches(selector)) {
+ continue;
+ }
+ let message = randomSelection(text);
+ if (!message) {
+ continue;
+ }
+ message = message.replace('{text}', target.innerText);
+ sendMessage(message, 4000, 1);
+ return;
+ }
+ });
+};
+
+const _userMouseoverEvent = (mouseovers: TipMouseover[]) => {
+ window.addEventListener('mouseover', (event: MouseEvent) => {
+ const path = event.composedPath();
+ const target = path[0];
+ if (!(target instanceof HTMLElement)) {
+ return;
+ }
+ for (const { selector, text } of mouseovers) {
+ if (!target.matches(selector)) {
+ continue;
+ }
+ let message = randomSelection(text);
+ if (!message) {
+ continue;
+ }
+ message = message.replace('{text}', target.innerText);
+ sendMessage(message, 4000, 1);
+ return;
+ }
+ });
+};
+
+/**
+ * 监听用户是否处于活动状态,如果用户长时间不活动,则向 Live2d 发送消息
+ */
+const _userActionEvent = (message: TipMessage) => {
+ let userAction = false;
+ let userActionTimer: number | undefined;
+ const defaultMessage = message.default;
+ const idleMessage: string[] = isString(defaultMessage)
+ ? [defaultMessage]
+ : defaultMessage || [];
+
+ window.addEventListener('mousemove', () => {
+ userAction = true;
+ });
+ window.addEventListener('keydown', () => {
+ userAction = true;
+ });
+ window.addEventListener('live2d:add-default-message', (ev) => {
+ const message = ev.detail.message;
+ if (Array.isArray(message)) {
+ idleMessage.push(...message);
+ } else {
+ idleMessage.push(message);
+ }
+ });
+ setInterval(() => {
+ if (userAction) {
+ userAction = false;
+ clearInterval(userActionTimer);
+ userActionTimer = undefined;
+ return;
+ }
+ if (userActionTimer) {
+ return;
+ }
+ userActionTimer = setInterval(() => {
+ sendMessage(message.default, 6000, 2);
+ }, 20000);
+ }, 1000);
+};
+
+const _registerTipEventListener = (config: Live2dConfig, tips: TipConfig) => {
+ // 首次进入页面时
+ if (config.firstOpenSite) {
+ _welcomeEvent(tips.time);
+ }
+ // 节日事件
+ _holidayEvent(tips.seasons);
+ // 用户是否活动事件
+ _userActionEvent(tips.message);
+ // 注册用户鼠标悬停事件
+ _userMouseoverEvent(tips.mouseover);
+ // 注册用户点击事件
+ _userClickEvent(tips.click);
+ // 用户打开控制台事件
+ _userOpenConsoleEvent(tips.message);
+ // 用户复制内容事件
+ _userCopyEvent(tips.message);
+ // 用户离开页面事件
+ _userLeaveEvent(tips.message);
+};
+
+const _loadTips = async (config: Live2dConfig) => {
+ if (!config) {
+ return;
+ }
+ // 后台配置 tips,其中包含 mouseover 及 click 两种配置,以及单独配置的 message
+ const pluginTips = getPluginTips(config);
+ // 主题设置 tips,只会包含 mouseover 及 click 两种配置(会过滤掉其他配置)
+ const themeTipsResult = await loadTipsResource(config.themeTipsPath);
+ const themeTips: TipConfig = {
+ click: themeTipsResult?.click || [],
+ mouseover: themeTipsResult?.mouseover || [],
+ seasons: [],
+ time: [],
+ message: {},
+ };
+ const fullOrDefaultTips = await _getFullOrDefaultTips(config);
+ // 合并三种 tips
+ return mergeTips({
+ pluginTips,
+ themeTips,
+ fullOrDefaultTips,
+ });
+};
+
+export const _getFullOrDefaultTips = async (
+ config: Live2dConfig,
+): Promise => {
+ // 获取插件文件中的全量 tips 文件
+ if (isNotEmptyString(config?.tipsPath)) {
+ const tipsResult = await loadTipsResource(config.tipsPath);
+ if (tipsResult) {
+ return tipsResult;
+ }
+ }
+ // 获取默认的 tips 文件
+ return (await import('../libs/live2d-tips.json')).default;
+};
diff --git a/packages/live2d/src/events/toggle-canvas.ts b/packages/live2d/src/events/toggle-canvas.ts
new file mode 100644
index 0000000..4ac5451
--- /dev/null
+++ b/packages/live2d/src/events/toggle-canvas.ts
@@ -0,0 +1,26 @@
+import { Live2dEvent } from './types';
+
+export const TOGGLE_CANVAS_EVENT_NAME = 'live2d:toggle-canvas' as const;
+
+declare global {
+ interface GlobalEventHandlersEventMap {
+ [TOGGLE_CANVAS_EVENT_NAME]: ToggleCanvasEvent;
+ }
+}
+
+export interface Live2dToggleCanvasEventDetail {
+ // 是否显示看板娘
+ isShow: boolean;
+}
+
+/**
+ * 切换 canvas 显示状态事件
+ */
+export class ToggleCanvasEvent extends Live2dEvent {
+ constructor(detail: Live2dToggleCanvasEventDetail) {
+ super(TOGGLE_CANVAS_EVENT_NAME, detail, {
+ bubbles: true,
+ composed: true,
+ });
+ }
+}
diff --git a/packages/live2d/src/events/types.ts b/packages/live2d/src/events/types.ts
new file mode 100644
index 0000000..97b330f
--- /dev/null
+++ b/packages/live2d/src/events/types.ts
@@ -0,0 +1,5 @@
+export abstract class Live2dEvent extends CustomEvent {
+ constructor(type: string, detail: T, options?: EventInit) {
+ super(type, { detail, ...options });
+ }
+}
diff --git a/packages/live2d/src/helpers/dateWithinRange.ts b/packages/live2d/src/helpers/dateWithinRange.ts
new file mode 100644
index 0000000..d071f54
--- /dev/null
+++ b/packages/live2d/src/helpers/dateWithinRange.ts
@@ -0,0 +1,26 @@
+const RANGE_SEPARATOR = '-';
+const DATE_SEPARATOR = '/';
+
+/**
+ * 检查指定的日期是否在当前日期范围内。
+ *
+ * @param date 指定的日期格式为 `MM/DD` 或 `MM/DD-MM/DD`。
+ * @returns 如果日期在当前范围内则返回 true, 否则返回 false。
+ */
+export const dataWithinRange = (date: string): boolean => {
+ const now = new Date();
+ const currentMonth = now.getMonth() + 1;
+ const currentDate = now.getDate();
+
+ const [startDate, endDate = startDate] = date.split(RANGE_SEPARATOR);
+
+ const [startMonth, startDay] = startDate.split(DATE_SEPARATOR).map(Number);
+ const [endMonth, endDay] = endDate.split(DATE_SEPARATOR).map(Number);
+
+ return (
+ startMonth <= currentMonth &&
+ currentMonth <= endMonth &&
+ startDay <= currentDate &&
+ currentDate <= endDay
+ );
+};
diff --git a/packages/live2d/src/helpers/getPluginTips.ts b/packages/live2d/src/helpers/getPluginTips.ts
new file mode 100644
index 0000000..465e54c
--- /dev/null
+++ b/packages/live2d/src/helpers/getPluginTips.ts
@@ -0,0 +1,57 @@
+import type { Live2dConfig, TipConfig } from '../context/config-context';
+import { isNotEmpty } from '../utils/isNotEmpty';
+
+/**
+ * 整合插件配置中的 tips 元素。
+ *
+ * 插件配置中的元素如下所示:
+ * "selectorTips" : [ {
+ * "mouseAction" : "mouseover",
+ * "selector" : "#select",
+ * "messageTexts" : [ {
+ * "message" : "123"
+ * }, {
+ * "message" : "1231"
+ * }]
+ * }],
+ * "copyContentTip" : "你都复制了些什么呀,转载要记得加上出处哦!",
+ * "openConsoleTip" : "你是想要看看我的小秘密吗?",
+ */
+export const getPluginTips = (config: Live2dConfig): TipConfig => {
+ const tips: TipConfig = {
+ seasons: [],
+ click: [],
+ mouseover: [],
+ time: [],
+ message: {},
+ };
+ // selector
+ if (config.selectorTips) {
+ for (const item of config.selectorTips) {
+ const texts = item.messageTexts?.map((text) => text.message);
+ if (!texts) {
+ continue;
+ }
+ const obj = {
+ selector: item.selector,
+ text: texts,
+ };
+ if (item.mouseAction === 'click') {
+ tips.click?.push(obj);
+ } else {
+ tips.mouseover?.push(obj);
+ }
+ }
+ }
+ // message
+ if (isNotEmpty(config.backSiteTip)) {
+ tips.message.visibilitychange = config.backSiteTip;
+ }
+ if (isNotEmpty(config.copyContentTip)) {
+ tips.message.copy = config.copyContentTip;
+ }
+ if (isNotEmpty(config.openConsoleTip)) {
+ tips.message.console = config.openConsoleTip;
+ }
+ return tips;
+};
diff --git a/packages/live2d/src/helpers/loadTipsResource.ts b/packages/live2d/src/helpers/loadTipsResource.ts
new file mode 100644
index 0000000..ce32508
--- /dev/null
+++ b/packages/live2d/src/helpers/loadTipsResource.ts
@@ -0,0 +1,35 @@
+import type { TipConfig } from '../context/config-context';
+
+/**
+ * 远程加载提示资源
+ *
+ * @param url
+ * @returns
+ */
+export function loadTipsResource(url?: string) {
+ const defaultObj: TipConfig = {
+ mouseover: [],
+ click: [],
+ seasons: [],
+ message: {},
+ time: [],
+ };
+ return new Promise((resolve) => {
+ if (!url) {
+ resolve(defaultObj);
+ return;
+ }
+ try {
+ fetch(url)
+ .then((response) => response.json())
+ .then((result) => {
+ resolve(result);
+ })
+ .catch(() => {
+ resolve(defaultObj);
+ });
+ } catch (e) {
+ // ignore
+ }
+ });
+}
diff --git a/packages/live2d/src/helpers/mergeTips.ts b/packages/live2d/src/helpers/mergeTips.ts
new file mode 100644
index 0000000..20d86f7
--- /dev/null
+++ b/packages/live2d/src/helpers/mergeTips.ts
@@ -0,0 +1,43 @@
+import type { TipConfig } from '../context/config-context';
+import { distinctArray } from '../utils/distinctArray';
+
+/**
+ * 合并各个渠道的 tips,根据获取位置不同,合并时优先级也不同。优先级按高到低的顺序为
+ *
+ *
+ * 后台插件配置文件中获得的 tips。(该配置文件只支持 mouseover 与 click 两种类型的 tips 属性,另外包括单独配置的 message)
+ * 主题文件中设置的 tips (该配置文件只支持 mouseover 与 click 两种类型的 tips 属性)
+ * 配置/默认的 tips 文件(该配置文件支持所有的 tips 属性,但其属性会被优先级高的覆盖)
+ *
+ *
+ * 请注意,此项返回值为修改后的 defaultTips,任何修改 defaultTips 的情况都将导致返回值同步修改。
+ *
+ * @param pluginTips 后台配置文件中设置的 tips
+ * @param themeTips 主题提供的 tips
+ * @param defaultTips 配置/默认的 tips
+ */
+export const mergeTips = ({
+ pluginTips,
+ themeTips,
+ fullOrDefaultTips,
+}: {
+ pluginTips: TipConfig;
+ themeTips: TipConfig;
+ fullOrDefaultTips: TipConfig;
+}) => {
+ const defaultTips = { ...fullOrDefaultTips };
+ const duplicateClick = [
+ ...pluginTips.click,
+ ...themeTips.click,
+ ...fullOrDefaultTips.click,
+ ];
+ const duplicateMouseover = [
+ ...pluginTips.mouseover,
+ ...themeTips.mouseover,
+ ...fullOrDefaultTips.mouseover,
+ ];
+ defaultTips.click = distinctArray(duplicateClick, 'selector');
+ defaultTips.mouseover = distinctArray(duplicateMouseover, 'selector');
+ defaultTips.message = { ...defaultTips.message, ...pluginTips.message };
+ return defaultTips;
+};
diff --git a/packages/live2d/src/helpers/sendMessage.ts b/packages/live2d/src/helpers/sendMessage.ts
new file mode 100644
index 0000000..c8214ce
--- /dev/null
+++ b/packages/live2d/src/helpers/sendMessage.ts
@@ -0,0 +1,18 @@
+import { SendMessageEvent } from '../events/send-message';
+
+/**
+ * 向 Live2D 发送消息事件
+ * @param text
+ * @param timeout
+ * @param priority
+ */
+export function sendMessage(
+ text: string | string[] | undefined,
+ timeout = 3000,
+ priority = 0,
+) {
+ if (!text) {
+ return;
+ }
+ window.dispatchEvent(new SendMessageEvent({ text, timeout, priority }));
+}
diff --git a/packages/live2d/src/helpers/timeWithinRange.ts b/packages/live2d/src/helpers/timeWithinRange.ts
new file mode 100644
index 0000000..e34fee3
--- /dev/null
+++ b/packages/live2d/src/helpers/timeWithinRange.ts
@@ -0,0 +1,23 @@
+const SEPARATOR = '-';
+
+/**
+ * 判断当前是否在指定时间范围内。
+ *
+ * @param hour 指定的时间范围格式为 `HH-HH`。
+ * @returns 如果当前时间在指定范围内则返回 true, 否则返回 false。
+ */
+export const timeWithinRange = (hour: string): boolean => {
+ const spiltTime = hour.split(SEPARATOR);
+ const now = new Date();
+ const after = Number.parseInt(spiltTime[0]);
+ const before = Number.parseInt(spiltTime[1]) || after;
+
+ if (after < 0 || before > 23 || after > before) {
+ throw new Error('时间范围不正确');
+ }
+
+ if (after <= now.getHours() && now.getHours() <= before) {
+ return true;
+ }
+ return false;
+};
diff --git a/packages/live2d/src/index.ts b/packages/live2d/src/index.ts
new file mode 100644
index 0000000..37dd2ca
--- /dev/null
+++ b/packages/live2d/src/index.ts
@@ -0,0 +1,5 @@
+import { Live2dContext } from './components/Live2dContext';
+import { Live2dToggle } from './components/Live2dToggle';
+import { Live2dWidget } from './components/Live2dWidget';
+
+export { Live2dToggle, Live2dWidget, Live2dContext };
diff --git a/packages/live2d/src/libs/asteroids.min.js b/packages/live2d/src/libs/asteroids.min.js
new file mode 100644
index 0000000..78fc3ca
--- /dev/null
+++ b/packages/live2d/src/libs/asteroids.min.js
@@ -0,0 +1,640 @@
+// http://www.websiteasteroids.com
+function Asteroids() {
+ if (!window.ASTEROIDS) window.ASTEROIDS = {
+ enemiesKilled: 0
+ };
+ class Vector {
+ constructor(x, y) {
+ if (typeof x === "Object") {
+ this.x = x.x;
+ this.y = x.y;
+ } else {
+ this.x = x;
+ this.y = y;
+ }
+ }
+ cp() {
+ return new Vector(this.x, this.y);
+ }
+ mul(factor) {
+ this.x *= factor;
+ this.y *= factor;
+ return this;
+ }
+ mulNew(factor) {
+ return new Vector(this.x * factor, this.y * factor);
+ }
+ add(vec) {
+ this.x += vec.x;
+ this.y += vec.y;
+ return this;
+ }
+ addNew(vec) {
+ return new Vector(this.x + vec.x, this.y + vec.y);
+ }
+ sub(vec) {
+ this.x -= vec.x;
+ this.y -= vec.y;
+ return this;
+ }
+ subNew(vec) {
+ return new Vector(this.x - vec.x, this.y - vec.y);
+ }
+ rotate(angle) {
+ const x = this.x, y = this.y;
+ this.x = x * Math.cos(angle) - Math.sin(angle) * y;
+ this.y = x * Math.sin(angle) + Math.cos(angle) * y;
+ return this;
+ }
+ rotateNew(angle) {
+ return this.cp().rotate(angle);
+ }
+ setAngle(angle) {
+ const l = this.len();
+ this.x = Math.cos(angle) * l;
+ this.y = Math.sin(angle) * l;
+ return this;
+ }
+ setAngleNew(angle) {
+ return this.cp().setAngle(angle);
+ }
+ setLength(length) {
+ const l = this.len();
+ if (l) this.mul(length / l);
+ else this.x = this.y = length;
+ return this;
+ }
+ setLengthNew(length) {
+ return this.cp().setLength(length);
+ }
+ normalize() {
+ const l = this.len();
+ this.x /= l;
+ this.y /= l;
+ return this;
+ }
+ normalizeNew() {
+ return this.cp().normalize();
+ }
+ angle() {
+ return Math.atan2(this.y, this.x);
+ }
+ collidesWith(rect) {
+ return this.x > rect.x && this.y > rect.y && this.x < rect.x + rect.width && this.y < rect.y + rect.height;
+ }
+ len() {
+ const l = Math.sqrt(this.x * this.x + this.y * this.y);
+ if (l < 0.005 && l > -0.005) return 0;
+ return l;
+ }
+ is(test) {
+ return typeof test === "object" && this.x === test.x && this.y === test.y;
+ }
+ toString() {
+ return "[Vector(" + this.x + ", " + this.y + ") angle: " + this.angle() + ", length: " + this.len() + "]";
+ }
+ }
+
+ class Line {
+ constructor(p1, p2) {
+ this.p1 = p1;
+ this.p2 = p2;
+ }
+ shift(pos) {
+ this.p1.add(pos);
+ this.p2.add(pos);
+ }
+ intersectsWithRect(rect) {
+ const LL = new Vector(rect.x, rect.y + rect.height);
+ const UL = new Vector(rect.x, rect.y);
+ const LR = new Vector(rect.x + rect.width, rect.y + rect.height);
+ const UR = new Vector(rect.x + rect.width, rect.y);
+ if (this.p1.x > LL.x && this.p1.x < UR.x && this.p1.y < LL.y && this.p1.y > UR.y && this.p2.x > LL.x && this.p2.x < UR.x && this.p2.y < LL.y && this.p2.y > UR.y) return true;
+ if (this.intersectsLine(new Line(UL, LL))) return true;
+ if (this.intersectsLine(new Line(LL, LR))) return true;
+ if (this.intersectsLine(new Line(UL, UR))) return true;
+ if (this.intersectsLine(new Line(UR, LR))) return true;
+ return false;
+ }
+ intersectsLine(line2) {
+ const v1 = this.p1, v2 = this.p2;
+ const v3 = line2.p1, v4 = line2.p2;
+ const denom = ((v4.y - v3.y) * (v2.x - v1.x)) - ((v4.x - v3.x) * (v2.y - v1.y));
+ const numerator = ((v4.x - v3.x) * (v1.y - v3.y)) - ((v4.y - v3.y) * (v1.x - v3.x));
+ const numerator2 = ((v2.x - v1.x) * (v1.y - v3.y)) - ((v2.y - v1.y) * (v1.x - v3.x));
+ if (denom === 0.0) {
+ return false;
+ }
+ const ua = numerator / denom;
+ const ub = numerator2 / denom;
+ return (ua >= 0.0 && ua <= 1.0 && ub >= 0.0 && ub <= 1.0);
+ }
+ }
+ const that = this;
+ const isIE = !! window.ActiveXObject;
+ let w = document.documentElement.clientWidth, h = document.documentElement.clientHeight;
+ const playerWidth = 20, playerHeight = 30;
+ const playerVerts = [
+ [-1 * playerHeight / 2, -1 * playerWidth / 2],
+ [-1 * playerHeight / 2, playerWidth / 2],
+ [playerHeight / 2, 0]
+ ];
+ const ignoredTypes = ["HTML", "HEAD", "BODY", "SCRIPT", "TITLE", "META", "STYLE", "LINK", "SHAPE", "LINE", "GROUP", "IMAGE", "STROKE", "FILL", "SKEW", "PATH", "TEXTPATH"];
+ const hiddenTypes = ["BR", "HR"];
+ const FPS = 50;
+ const acc = 300;
+ const maxSpeed = 600;
+ const rotSpeed = 360;
+ const bulletSpeed = 700;
+ const particleSpeed = 400;
+ const timeBetweenFire = 150;
+ const timeBetweenBlink = 250;
+ const bulletRadius = 2;
+ const maxParticles = isIE ? 20 : 40;
+ const maxBullets = isIE ? 10 : 20;
+ this.flame = {
+ r: [],
+ y: []
+ };
+ this.toggleBlinkStyle = function() {
+ if (this.updated.blink.isActive) {
+ document.body.classList.remove("ASTEROIDSBLINK");
+ } else {
+ document.body.classList.add("ASTEROIDSBLINK");
+ }
+ this.updated.blink.isActive = !this.updated.blink.isActive;
+ };
+ addStylesheet(".ASTEROIDSBLINK .ASTEROIDSYEAHENEMY", "outline: 2px dotted red;");
+ this.pos = new Vector(100, 100);
+ this.lastPos = false;
+ this.vel = new Vector(0, 0);
+ this.dir = new Vector(0, 1);
+ this.keysPressed = {};
+ this.firedAt = false;
+ this.updated = {
+ enemies: false,
+ flame: new Date().getTime(),
+ blink: {
+ time: 0,
+ isActive: false
+ }
+ };
+ this.scrollPos = new Vector(0, 0);
+ this.bullets = [];
+ this.enemies = [];
+ this.dying = [];
+ this.totalEnemies = 0;
+ this.particles = [];
+
+ function updateEnemyIndex() {
+ for (let enemy of that.enemies) {
+ enemy.classList.remove("ASTEROIDSYEAHENEMY");
+ }
+ const all = document.body.getElementsByTagName("*");
+ that.enemies = [];
+ for (let i = 0, el; el = all[i]; i++) {
+ if (!(ignoredTypes.includes(el.tagName.toUpperCase())) && el.prefix !== "g_vml_" && hasOnlyTextualChildren(el) && el.className !== "ASTEROIDSYEAH" && el.offsetHeight > 0) {
+ el.aSize = size(el);
+ that.enemies.push(el);
+ el.classList.add("ASTEROIDSYEAHENEMY");
+ if (!el.aAdded) {
+ el.aAdded = true;
+ that.totalEnemies++;
+ }
+ }
+ }
+ };
+ updateEnemyIndex();
+ let createFlames;
+ (function() {
+ const rWidth = playerWidth, rIncrease = playerWidth * 0.1, yWidth = playerWidth * 0.6, yIncrease = yWidth * 0.2, halfR = rWidth / 2, halfY = yWidth / 2, halfPlayerHeight = playerHeight / 2;
+ createFlames = function() {
+ that.flame.r = [
+ [-1 * halfPlayerHeight, -1 * halfR]
+ ];
+ that.flame.y = [
+ [-1 * halfPlayerHeight, -1 * halfY]
+ ];
+ for (let x = 0; x < rWidth; x += rIncrease) {
+ that.flame.r.push([-random(2, 7) - halfPlayerHeight, x - halfR]);
+ }
+ that.flame.r.push([-1 * halfPlayerHeight, halfR]);
+ for (let x = 0; x < yWidth; x += yIncrease) {
+ that.flame.y.push([-random(2, 7) - halfPlayerHeight, x - halfY]);
+ }
+ that.flame.y.push([-1 * halfPlayerHeight, halfY]);
+ };
+ })();
+ createFlames();
+
+ function radians(deg) {
+ return deg * Math.PI / 180;
+ };
+
+ function random(from, to) {
+ return Math.floor(Math.random() * (to + 1) + from);
+ };
+
+ function boundsCheck(vec) {
+ if (vec.x > w) vec.x = 0;
+ else if (vec.x < 0) vec.x = w;
+ if (vec.y > h) vec.y = 0;
+ else if (vec.y < 0) vec.y = h;
+ };
+
+ function size(element) {
+ let el = element, left = 0, top = 0;
+ do {
+ left += el.offsetLeft || 0;
+ top += el.offsetTop || 0;
+ el = el.offsetParent;
+ } while (el);
+ return {
+ x: left,
+ y: top,
+ width: element.offsetWidth || 10,
+ height: element.offsetHeight || 10
+ };
+ };
+
+ function applyVisibility(vis) {
+ for (let p of window.ASTEROIDSPLAYERS) {
+ p.gameContainer.style.visibility = vis;
+ }
+ }
+
+ function getElementFromPoint(x, y) {
+ applyVisibility("hidden");
+ let element = document.elementFromPoint(x, y);
+ if (!element) {
+ applyVisibility("visible");
+ return false;
+ }
+ if (element.nodeType === 3) element = element.parentNode;
+ applyVisibility("visible");
+ return element;
+ };
+
+ function addParticles(startPos) {
+ const time = new Date().getTime();
+ const amount = maxParticles;
+ for (let i = 0; i < amount; i++) {
+ that.particles.push({
+ dir: (new Vector(Math.random() * 20 - 10, Math.random() * 20 - 10)).normalize(),
+ pos: startPos.cp(),
+ cameAlive: time
+ });
+ }
+ };
+
+ function setScore() {
+ that.points.innerHTML = window.ASTEROIDS.enemiesKilled * 10;
+ };
+
+ function hasOnlyTextualChildren(element) {
+ if (element.offsetLeft < -100 && element.offsetWidth > 0 && element.offsetHeight > 0) return false;
+ if (hiddenTypes.includes(element.tagName)) return true;
+ if (element.offsetWidth === 0 && element.offsetHeight === 0) return false;
+ for (let i = 0; i < element.childNodes.length; i++) {
+ if (!(hiddenTypes.includes(element.childNodes[i].tagName)) && element.childNodes[i].childNodes.length !== 0) return false;
+ }
+ return true;
+ };
+
+ function addStylesheet(selector, rules) {
+ const stylesheet = document.createElement("style");
+ stylesheet.rel = "stylesheet";
+ stylesheet.id = "ASTEROIDSYEAHSTYLES";
+ try {
+ stylesheet.innerHTML = selector + "{" + rules + "}";
+ } catch (e) {
+ stylesheet.styleSheet.addRule(selector, rules);
+ }
+ document.getElementsByTagName("head")[0].appendChild(stylesheet);
+ };
+
+ function removeStylesheet(name) {
+ const stylesheet = document.getElementById(name);
+ if (stylesheet) {
+ stylesheet.parentNode.removeChild(stylesheet);
+ }
+ };
+ this.gameContainer = document.createElement("div");
+ this.gameContainer.className = "ASTEROIDSYEAH";
+ document.body.appendChild(this.gameContainer);
+ this.canvas = document.createElement("canvas");
+ this.canvas.setAttribute("width", w);
+ this.canvas.setAttribute("height", h);
+ this.canvas.className = "ASTEROIDSYEAH";
+ Object.assign(this.canvas.style, {
+ width: w + "px",
+ height: h + "px",
+ position: "fixed",
+ top: "0px",
+ left: "0px",
+ bottom: "0px",
+ right: "0px",
+ zIndex: "10000"
+ });
+ this.canvas.addEventListener("mousedown", function(e) {
+ const message = document.createElement("span");
+ message.style.position = "absolute";
+ message.style.color = "red";
+ message.innerHTML = "Press Esc to Quit";
+ document.body.appendChild(message);
+ const x = e.pageX || (e.clientX + document.documentElement.scrollLeft);
+ const y = e.pageY || (e.clientY + document.documentElement.scrollTop);
+ message.style.left = x - message.offsetWidth / 2 + "px";
+ message.style.top = y - message.offsetHeight / 2 + "px";
+ setTimeout(function() {
+ try {
+ message.parentNode.removeChild(message);
+ } catch (e) {}
+ }, 1000);
+ }, false);
+ const eventResize = function() {
+ that.canvas.style.display = "none";
+ w = document.documentElement.clientWidth;
+ h = document.documentElement.clientHeight;
+ that.canvas.setAttribute("width", w);
+ that.canvas.setAttribute("height", h);
+ Object.assign(that.canvas.style, {
+ display: "block",
+ width: w + "px",
+ height: h + "px"
+ });
+ };
+ window.addEventListener("resize", eventResize, false);
+ this.gameContainer.appendChild(this.canvas);
+ this.ctx = this.canvas.getContext("2d");
+ this.ctx.fillStyle = "black";
+ this.ctx.strokeStyle = "black";
+ if (!document.getElementById("ASTEROIDS-NAVIGATION")) {
+ this.navigation = document.createElement("div");
+ this.navigation.id = "ASTEROIDS-NAVIGATION";
+ this.navigation.className = "ASTEROIDSYEAH";
+ Object.assign(this.navigation.style, {
+ fontFamily: "Arial,sans-serif",
+ position: "fixed",
+ zIndex: "10001",
+ bottom: "20px",
+ right: "10px",
+ textAlign: "right"
+ });
+ this.navigation.innerHTML = "(Press Esc to Quit) ";
+ this.gameContainer.appendChild(this.navigation);
+ this.points = document.createElement("span");
+ this.points.id = "ASTEROIDS-POINTS";
+ this.points.style.font = "28pt Arial, sans-serif";
+ this.points.style.fontWeight = "bold";
+ this.points.className = "ASTEROIDSYEAH";
+ this.navigation.appendChild(this.points);
+ } else {
+ this.navigation = document.getElementById("ASTEROIDS-NAVIGATION");
+ this.points = document.getElementById("ASTEROIDS-POINTS");
+ }
+ setScore();
+ const eventKeydown = function(event) {
+ that.keysPressed[event.key] = true;
+ switch (event.key) {
+ case " ":
+ that.firedAt = 1;
+ break;
+ }
+ if (["ArrowUp", "ArrowDown", "ArrowRight", "ArrowLeft", " ", "b", "w", "a", "s", "d"].includes(event.key)) {
+ if (event.preventDefault) event.preventDefault();
+ if (event.stopPropagation) event.stopPropagation();
+ event.returnValue = false;
+ event.cancelBubble = true;
+ return false;
+ }
+ };
+ document.addEventListener("keydown", eventKeydown, false);
+ const eventKeypress = function(event) {
+ if (["ArrowUp", "ArrowDown", "ArrowRight", "ArrowLeft", " ", "w", "a", "s", "d"].includes(event.key)) {
+ if (event.preventDefault) event.preventDefault();
+ if (event.stopPropagation) event.stopPropagation();
+ event.returnValue = false;
+ event.cancelBubble = true;
+ return false;
+ }
+ };
+ document.addEventListener("keypress", eventKeypress, false);
+ const eventKeyup = function(event) {
+ that.keysPressed[event.key] = false;
+ if (["ArrowUp", "ArrowDown", "ArrowRight", "ArrowLeft", " ", "b", "w", "a", "s", "d"].includes(event.key)) {
+ if (event.preventDefault) event.preventDefault();
+ if (event.stopPropagation) event.stopPropagation();
+ event.returnValue = false;
+ event.cancelBubble = true;
+ return false;
+ }
+ };
+ document.addEventListener("keyup", eventKeyup, false);
+ this.ctx.clear = function() {
+ this.clearRect(0, 0, w, h);
+ };
+ this.ctx.clear();
+ this.ctx.drawLine = function(xFrom, yFrom, xTo, yTo) {
+ this.beginPath();
+ this.moveTo(xFrom, yFrom);
+ this.lineTo(xTo, yTo);
+ this.lineTo(xTo + 1, yTo + 1);
+ this.closePath();
+ this.fill();
+ };
+ this.ctx.tracePoly = function(verts) {
+ this.beginPath();
+ this.moveTo(verts[0][0], verts[0][1]);
+ for (let i = 1; i < verts.length; i++)
+ this.lineTo(verts[i][0], verts[i][1]);
+ this.closePath();
+ };
+ this.ctx.drawPlayer = function() {
+ this.save();
+ this.translate(that.pos.x, that.pos.y);
+ this.rotate(that.dir.angle());
+ this.tracePoly(playerVerts);
+ this.fillStyle = "white";
+ this.fill();
+ this.tracePoly(playerVerts);
+ this.stroke();
+ this.restore();
+ };
+ this.ctx.drawBullets = function(bullets) {
+ for (let i = 0; i < bullets.length; i++) {
+ this.beginPath();
+ this.arc(bullets[i].pos.x, bullets[i].pos.y, bulletRadius, 0, Math.PI * 2, true);
+ this.closePath();
+ this.fill();
+ }
+ };
+ const randomParticleColor = function() {
+ return (["red", "yellow"])[random(0, 1)];
+ };
+ this.ctx.drawParticles = function(particles) {
+ const oldColor = this.fillStyle;
+ for (let i = 0; i < particles.length; i++) {
+ this.fillStyle = randomParticleColor();
+ this.drawLine(particles[i].pos.x, particles[i].pos.y, particles[i].pos.x - particles[i].dir.x * 10, particles[i].pos.y - particles[i].dir.y * 10);
+ }
+ this.fillStyle = oldColor;
+ };
+ this.ctx.drawFlames = function(flame) {
+ this.save();
+ this.translate(that.pos.x, that.pos.y);
+ this.rotate(that.dir.angle());
+ const oldColor = this.strokeStyle;
+ this.strokeStyle = "red";
+ this.tracePoly(flame.r);
+ this.stroke();
+ this.strokeStyle = "yellow";
+ this.tracePoly(flame.y);
+ this.stroke();
+ this.strokeStyle = oldColor;
+ this.restore();
+ }
+ addParticles(this.pos);
+ document.body.classList.add("ASTEROIDSYEAH");
+ let lastUpdate = new Date().getTime();
+ function updateFunc() {
+ that.update.call(that);
+ };
+ setTimeout(updateFunc, 1000 / FPS);
+ this.update = function() {
+ let forceChange = false;
+ const nowTime = new Date().getTime();
+ const tDelta = (nowTime - lastUpdate) / 1000;
+ lastUpdate = nowTime;
+ let drawFlame = false;
+ if (nowTime - this.updated.flame > 50) {
+ createFlames();
+ this.updated.flame = nowTime;
+ }
+ this.scrollPos.x = window.pageXOffset || document.documentElement.scrollLeft;
+ this.scrollPos.y = window.pageYOffset || document.documentElement.scrollTop;
+ if ((this.keysPressed["ArrowUp"]) || (this.keysPressed["w"])) {
+ this.vel.add(this.dir.mulNew(acc * tDelta));
+ drawFlame = true;
+ } else {
+ this.vel.mul(0.96);
+ }
+ if ((this.keysPressed["ArrowLeft"]) || (this.keysPressed["a"])) {
+ forceChange = true;
+ this.dir.rotate(radians(rotSpeed * tDelta * -1));
+ }
+ if ((this.keysPressed["ArrowRight"]) || (this.keysPressed["d"])) {
+ forceChange = true;
+ this.dir.rotate(radians(rotSpeed * tDelta));
+ }
+ if (this.keysPressed[" "] && nowTime - this.firedAt > timeBetweenFire) {
+ this.bullets.unshift({
+ dir: this.dir.cp(),
+ pos: this.pos.cp(),
+ startVel: this.vel.cp(),
+ cameAlive: nowTime
+ });
+ this.firedAt = nowTime;
+ if (this.bullets.length > maxBullets) {
+ this.bullets.pop();
+ }
+ }
+ if (this.keysPressed["b"]) {
+ if (!this.updated.enemies) {
+ updateEnemyIndex();
+ this.updated.enemies = true;
+ }
+ forceChange = true;
+ this.updated.blink.time += tDelta * 1000;
+ if (this.updated.blink.time > timeBetweenBlink) {
+ this.toggleBlinkStyle();
+ this.updated.blink.time = 0;
+ }
+ } else {
+ this.updated.enemies = false;
+ }
+ if (this.keysPressed["Escape"]) {
+ destroy.apply(this);
+ return;
+ }
+ if (this.vel.len() > maxSpeed) {
+ this.vel.setLength(maxSpeed);
+ }
+ this.pos.add(this.vel.mulNew(tDelta));
+ if (this.pos.x > w) {
+ window.scrollTo(this.scrollPos.x + 50, this.scrollPos.y);
+ this.pos.x = 0;
+ } else if (this.pos.x < 0) {
+ window.scrollTo(this.scrollPos.x - 50, this.scrollPos.y);
+ this.pos.x = w;
+ }
+ if (this.pos.y > h) {
+ window.scrollTo(this.scrollPos.x, this.scrollPos.y + h * 0.75);
+ this.pos.y = 0;
+ } else if (this.pos.y < 0) {
+ window.scrollTo(this.scrollPos.x, this.scrollPos.y - h * 0.75);
+ this.pos.y = h;
+ }
+ for (let i = this.bullets.length - 1; i >= 0; i--) {
+ if (nowTime - this.bullets[i].cameAlive > 2000) {
+ this.bullets.splice(i, 1);
+ forceChange = true;
+ continue;
+ }
+ const bulletVel = this.bullets[i].dir.setLengthNew(bulletSpeed * tDelta).add(this.bullets[i].startVel.mulNew(tDelta));
+ this.bullets[i].pos.add(bulletVel);
+ boundsCheck(this.bullets[i].pos);
+ const murdered = getElementFromPoint(this.bullets[i].pos.x, this.bullets[i].pos.y);
+ if (murdered && murdered.tagName && !(ignoredTypes.includes(murdered.tagName.toUpperCase())) && hasOnlyTextualChildren(murdered) && murdered.className !== "ASTEROIDSYEAH") {
+ addParticles(this.bullets[i].pos);
+ this.dying.push(murdered);
+ this.bullets.splice(i, 1);
+ continue;
+ }
+ }
+ if (this.dying.length) {
+ for (let i = this.dying.length - 1; i >= 0; i--) {
+ try {
+ if (this.dying[i].parentNode) window.ASTEROIDS.enemiesKilled++;
+ this.dying[i].parentNode.removeChild(this.dying[i]);
+ } catch (e) {}
+ }
+ setScore();
+ this.dying = [];
+ }
+ for (let i = this.particles.length - 1; i >= 0; i--) {
+ this.particles[i].pos.add(this.particles[i].dir.mulNew(particleSpeed * tDelta * Math.random()));
+ if (nowTime - this.particles[i].cameAlive > 1000) {
+ this.particles.splice(i, 1);
+ forceChange = true;
+ continue;
+ }
+ }
+ if (forceChange || this.bullets.length !== 0 || this.particles.length !== 0 || !this.pos.is(this.lastPos) || this.vel.len() > 0) {
+ this.ctx.clear();
+ this.ctx.drawPlayer();
+ if (drawFlame) this.ctx.drawFlames(that.flame);
+ if (this.bullets.length) {
+ this.ctx.drawBullets(this.bullets);
+ }
+ if (this.particles.length) {
+ this.ctx.drawParticles(this.particles);
+ }
+ }
+ this.lastPos = this.pos;
+ setTimeout(updateFunc, 1000 / FPS);
+ }
+
+ function destroy() {
+ document.removeEventListener("keydown", eventKeydown, false);
+ document.removeEventListener("keypress", eventKeypress, false);
+ document.removeEventListener("keyup", eventKeyup, false);
+ window.removeEventListener("resize", eventResize, false);
+ removeStylesheet("ASTEROIDSYEAHSTYLES");
+ document.body.classList.remove("ASTEROIDSYEAH");
+ this.gameContainer.parentNode.removeChild(this.gameContainer);
+ };
+}
+
+if (!window.ASTEROIDSPLAYERS) window.ASTEROIDSPLAYERS = [];
+window.ASTEROIDSPLAYERS.push(new Asteroids());
\ No newline at end of file
diff --git a/packages/live2d/src/libs/live2d-tips.json b/packages/live2d/src/libs/live2d-tips.json
new file mode 100644
index 0000000..1846253
--- /dev/null
+++ b/packages/live2d/src/libs/live2d-tips.json
@@ -0,0 +1,412 @@
+{
+ "mouseover": [
+ {
+ "selector": "#live2d",
+ "text": [
+ "干嘛呢你,快把手拿开~~",
+ "鼠…鼠标放错地方了!",
+ "你要干嘛呀?",
+ "喵喵喵?",
+ "怕怕(ノ≧∇≦)ノ",
+ "非礼呀!救命!",
+ "这样的话,只能使用武力了!",
+ "我要生气了哦",
+ "不要动手动脚的!",
+ "真…真的是不知羞耻!",
+ "Hentai!"
+ ]
+ },
+ {
+ "selector": "#live2d-tool-openai",
+ "text": [
+ "想要和我聊天吗?",
+ "我可是知道不少东西的!",
+ "呐呐,来和我聊聊天嘛~"
+ ]
+ },
+ {
+ "selector": "#live2d-tool-hitokoto",
+ "text": ["猜猜我要说些什么?", "我从青蛙王子那里听到了不少人生经验。"]
+ },
+ {
+ "selector": "#live2d-tool-asteroids",
+ "text": [
+ "要不要来玩飞机大战?",
+ "这个按钮上写着「不要点击」。",
+ "想来和我一起玩个游戏吗?",
+ "听说这样可以蹦迪!"
+ ]
+ },
+ {
+ "selector": "#live2d-tool-switch-model",
+ "text": [
+ "你是不是不爱人家了呀,呜呜呜~",
+ "要见见我的姐姐嘛?",
+ "想要看看我妹妹嘛?",
+ "要切换看板娘吗?"
+ ]
+ },
+ {
+ "selector": "#live2d-tool-switch-texture",
+ "text": [
+ "喜欢换装 PLAY 吗?",
+ "这次要扮演什么呢?",
+ "变装!",
+ "让我们看看接下来会发生什么!"
+ ]
+ },
+ {
+ "selector": "#live2d-tool-photo",
+ "text": [
+ "你要给我拍照呀?一二三~茄子~",
+ "要不,我们来合影吧!",
+ "保持微笑就好了~"
+ ]
+ },
+ {
+ "selector": "#live2d-tool-info",
+ "text": [
+ "想要知道更多关于我的事么?",
+ "这里记录着我搬家的历史呢。",
+ "你想深入了解我什么呢?"
+ ]
+ },
+ {
+ "selector": "#live2d-tool-quit",
+ "text": [
+ "到了要说再见的时候了吗?",
+ "呜呜 QAQ 后会有期……",
+ "不要抛弃我呀……",
+ "我们,还能再见面吗……",
+ "哼,你会后悔的!"
+ ]
+ },
+ {
+ "selector": "a[href='/']",
+ "text": [
+ "点击前往首页,想回到上一页可以使用浏览器的后退功能哦。",
+ "点它就可以回到首页啦!",
+ "回首页看看吧。"
+ ]
+ },
+ {
+ "selector": "a[href$='/about']",
+ "text": [
+ "你想知道我家主人是谁吗?",
+ "这里有一些关于我家主人的秘密哦,要不要看看呢?",
+ "发现主人出没地点!"
+ ]
+ },
+ {
+ "selector": "a[href='/tags']",
+ "text": ["点击就可以看文章的标签啦!", "点击来查看所有标签哦。"]
+ },
+ {
+ "selector": "a[href='/categories']",
+ "text": ["文章都分类好啦~", "点击来查看文章分类哦。"]
+ },
+ {
+ "selector": "a[href='/archives']",
+ "text": [
+ "翻页比较麻烦吗,那就来看看文章归档吧。",
+ "文章目录都整理在这里啦!"
+ ]
+ },
+ {
+ "selector": "#header-menu a",
+ "text": ["快看看这里都有什么呢?"]
+ },
+ {
+ "selector": ".site-author",
+ "text": ["我家主人好看吗?", "这是我家主人(*´∇`*)"]
+ },
+ {
+ "selector": ".site-state",
+ "text": ["这是文章的统计信息~", "要不要点进去看看?"]
+ },
+ {
+ "selector": ".cc-opacity, .post-copyright-author",
+ "text": [
+ "要记得规范转载哦。",
+ "所有文章均采用 CC BY-NC-SA 4.0 许可协议~",
+ "转载前要先注意下文章的版权协议呢。"
+ ]
+ },
+ {
+ "selector": ".links-of-author",
+ "text": ["这里是主人的常驻地址哦。", "这里有主人的联系方式!"]
+ },
+ {
+ "selector": ".followme",
+ "text": ["手机扫一下就能继续看,很方便呢~", "扫一扫,打开新世界的大门!"]
+ },
+ {
+ "selector": ".fancybox img, img.medium-zoom-image",
+ "text": ["点击图片可以放大呢!"]
+ },
+ {
+ "selector": ".copy-btn",
+ "text": ["代码可以直接点击复制哟。"]
+ },
+ {
+ "selector": ".highlight .table-container, .gist",
+ "text": ["GitHub!我是新手!", "有问题为什么不先问问神奇海螺呢?"]
+ },
+ {
+ "selector": "a[href^='mailto']",
+ "text": ["邮件我会及时回复的!", "点击就可以发送邮件啦~"]
+ },
+ {
+ "selector": "a[href^='/tags/']",
+ "text": [
+ "要去看看 {text} 标签么?",
+ "点它可以查看此标签下的所有文章哟!"
+ ]
+ },
+ {
+ "selector": "a[href^='/categories/']",
+ "text": [
+ "要去看看 {text} 分类么?",
+ "点它可以查看此分类下的所有文章哟!"
+ ]
+ },
+ {
+ "selector": "#post-list > div",
+ "text": ["要看看 {text} 这篇文章吗?"]
+ },
+ {
+ "selector": "a[rel='contents']",
+ "text": ["点击来阅读全文哦。"]
+ },
+ {
+ "selector": ".beian a",
+ "text": ["我也是有户口的人哦。", "我的主人可是遵纪守法的好主人。"]
+ },
+ {
+ "selector": ".container a[href^='http'], .nav-link .nav-text",
+ "text": [
+ "要去看看 {text} 么?",
+ "去 {text} 逛逛吧。",
+ "到 {text} 看看吧。"
+ ]
+ },
+ {
+ "selector": ".back-to-top",
+ "text": [
+ "点它就可以回到顶部啦!",
+ "又回到最初的起点~",
+ "要回到开始的地方么?"
+ ]
+ },
+ {
+ "selector": ".reward-container",
+ "text": [
+ "我是不是棒棒哒~快给我点赞吧!",
+ "要打赏我嘛?好期待啊~",
+ "主人最近在吃土呢,很辛苦的样子,给他一些钱钱吧~"
+ ]
+ },
+ {
+ "selector": "#wechat",
+ "text": ["这是我的微信二维码~"]
+ },
+ {
+ "selector": "#alipay",
+ "text": ["这是我的支付宝哦!"]
+ },
+ {
+ "selector": ".need-share-button_weibo",
+ "text": ["微博?来分享一波喵!"]
+ },
+ {
+ "selector": ".need-share-button_wechat",
+ "text": ["分享到微信吧!"]
+ },
+ {
+ "selector": ".need-share-button_douban",
+ "text": ["分享到豆瓣好像也不错!"]
+ },
+ {
+ "selector": ".need-share-button_qqzone",
+ "text": ["QQ 空间,一键转发,耶~"]
+ },
+ {
+ "selector": ".need-share-button_twitter",
+ "text": ["Twitter?好像是不存在的东西?"]
+ },
+ {
+ "selector": ".need-share-button_facebook",
+ "text": ["emmm…FB 好像也是不存在的东西?"]
+ },
+ {
+ "selector": ".post-nav-item a[rel='next']",
+ "text": [
+ "来看看下一篇文章吧。",
+ "点它可以看下一篇文章哦!",
+ "要翻到下一篇文章吗?"
+ ]
+ },
+ {
+ "selector": ".post-nav-item a[rel='prev']",
+ "text": [
+ "来看看上一篇文章吧。",
+ "点它可以看上一篇文章哦!",
+ "要翻到上一篇文章吗?"
+ ]
+ },
+ {
+ "selector": ".extend.next",
+ "text": ["去下一页看看吧。", "点它可以前进哦!", "要翻到下一页吗?"]
+ },
+ {
+ "selector": ".extend.prev",
+ "text": ["去上一页看看吧。", "点它可以后退哦!", "要翻到上一页吗?"]
+ },
+ {
+ "selector": ".rounded-base",
+ "text": [
+ "想要去评论些什么吗?",
+ "要说点什么吗?",
+ "觉得博客不错?快来留言和主人交流吧!"
+ ]
+ },
+ {
+ "selector": ".rounded-base a",
+ "text": [
+ "你会不会熟练使用 Markdown 呀?",
+ "使用 Markdown 让评论更美观吧~"
+ ]
+ },
+ {
+ "selector": ".relative",
+ "text": ["要插入一个萌萌哒的表情吗?", "要来一发表情吗?"]
+ },
+ {
+ "selector": ".btn-secondary",
+ "text": ["要对自己的发言负责哦~", "要提交了吗,请耐心等待回复哦~"]
+ },
+ {
+ "selector": ".comment-item",
+ "text": ["哇,快看看这个精彩评论!", "如果有疑问,请尽快留言哦~"]
+ }
+ ],
+ "click": [
+ {
+ "selector": "#live2d",
+ "text": [
+ "是…是不小心碰到了吧…",
+ "萝莉控是什么呀?",
+ "你看到我的小熊了吗?",
+ "再摸的话我可要报警了!⌇●﹏●⌇",
+ "110 吗,这里有个变态一直在摸我(ó﹏ò。)",
+ "不要摸我了,我会告诉老婆来打你的!",
+ "干嘛动我呀!小心我咬你!",
+ "别摸我,有什么好摸的!"
+ ]
+ },
+ {
+ "selector": ".rounded-base",
+ "text": ["要吐槽些什么呢?", "一定要认真填写喵~", "有什么想说的吗?"]
+ },
+ {
+ "selector": ".btn-secondary",
+ "text": ["提交评论啦~"]
+ }
+ ],
+ "seasons": [
+ {
+ "date": "01/01",
+ "text": "元旦了呢,新的一年又开始了,今年是{year}年~"
+ },
+ {
+ "date": "02/14",
+ "text": "又是一年情人节,{year}年找到对象了嘛~"
+ },
+ {
+ "date": "03/08",
+ "text": "今天是国际妇女节!"
+ },
+ {
+ "date": "03/12",
+ "text": "今天是植树节,要保护环境呀!"
+ },
+ {
+ "date": "04/01",
+ "text": "悄悄告诉你一个秘密~今天是愚人节,不要被骗了哦~"
+ },
+ {
+ "date": "05/01",
+ "text": "今天是五一劳动节,计划好假期去哪里了吗~"
+ },
+ {
+ "date": "06/01",
+ "text": "儿童节了呢,快活的时光总是短暂,要是永远长不大该多好啊…"
+ },
+ {
+ "date": "09/03",
+ "text": "中国人民抗日战争胜利纪念日,铭记历史、缅怀先烈、珍爱和平、开创未来。"
+ },
+ {
+ "date": "09/10",
+ "text": "教师节,在学校要给老师问声好呀~"
+ },
+ {
+ "date": "10/01",
+ "text": "国庆节到了,为祖国母亲庆生!"
+ },
+ {
+ "date": "11/05-11/12",
+ "text": "今年的双十一是和谁一起过的呢~"
+ },
+ {
+ "date": "12/20-12/31",
+ "text": "这几天是圣诞节,主人肯定又去剁手买买买了~"
+ }
+ ],
+ "time": [
+ {
+ "hour": "6-7",
+ "text": "早上好!一日之计在于晨,美好的一天就要开始了~"
+ },
+ {
+ "hour": "8-11",
+ "text": "上午好!工作顺利嘛,不要久坐,多起来走动走动哦!"
+ },
+ {
+ "hour": "12-13",
+ "text": "中午了,工作了一个上午,现在是午餐时间!"
+ },
+ {
+ "hour": "14-17",
+ "text": "午后很容易犯困呢,今天的运动目标完成了吗?"
+ },
+ {
+ "hour": "18-19",
+ "text": "傍晚了!窗外夕阳的景色很美丽呢,最美不过夕阳红~"
+ },
+ {
+ "hour": "20-21",
+ "text": "晚上好,今天过得怎么样?"
+ },
+ {
+ "hour": "22-23",
+ "text": ["已经这么晚了呀,早点休息吧,晚安~", "深夜时要爱护眼睛呀!"]
+ },
+ {
+ "hour": "0-5",
+ "text": "你是夜猫子呀?这么晚还不睡觉,明天起的来嘛?"
+ }
+ ],
+ "message": {
+ "default": [
+ "好久不见,日子过得好快呢……",
+ "大坏蛋!你都多久没理人家了呀,嘤嘤嘤~",
+ "呐~快来逗我玩吧!",
+ "拿小拳拳锤你胸口!",
+ "记得把小家加入收藏夹哦!"
+ ],
+ "console": "哈哈,你打开了控制台,是想要看看我的小秘密吗?",
+ "copy": "你都复制了些什么呀,转载要记得加上出处哦!",
+ "visibilitychange": "哇,你终于回来了~"
+ }
+}
diff --git a/packages/live2d/src/libs/live2d.min.js b/packages/live2d/src/libs/live2d.min.js
new file mode 100644
index 0000000..c3ed3bc
--- /dev/null
+++ b/packages/live2d/src/libs/live2d.min.js
@@ -0,0 +1,2 @@
+
+(function(){var j=true;function aa(){if(j){return;}this._$MT=null;this._$5S=null;this._$NP=0;aa._$42++;this._$5S=new y(this);}aa._$0s=1;aa._$4s=2;aa._$42=0;aa._$62=function(aQ,aU){try{if(aU instanceof ArrayBuffer){aU=new DataView(aU);}if(!(aU instanceof DataView)){throw new J("_$SS#loadModel(b) / b _$x be DataView or ArrayBuffer");}var aS=new K(aU);var aM=aS._$ST();var aK=aS._$ST();var aJ=aS._$ST();var aN;if(aM==109&&aK==111&&aJ==99){aN=aS._$ST();}else{throw new J("_$gi _$C _$li , _$Q0 _$P0.");}aS._$gr(aN);if(aN>ay._$T7){aQ._$NP|=aa._$4s;var aR=ay._$T7;var aI="_$gi _$C _$li , _$n0 _$_ version _$li ( SDK : "+aR+" < _$f0 : "+aN+" )@_$SS#loadModel()\n";throw new J(aI);}var aL=aS._$nP();if(aN>=ay._$s7){var aH=aS._$9T();var aT=aS._$9T();if(aH!=-30584||aT!=-30584){aQ._$NP|=aa._$0s;throw new J("_$gi _$C _$li , _$0 _$6 _$Ui.");}}aQ._$KS(aL);var aP=aQ.getModelContext();aP.setDrawParam(aQ.getDrawParam());aP.init();}catch(aO){q._$Rb(aO);}};aa.prototype._$KS=function(aH){this._$MT=aH;};aa.prototype.getModelImpl=function(){if(this._$MT==null){this._$MT=new w();this._$MT._$zP();}return this._$MT;};aa.prototype.getCanvasWidth=function(){if(this._$MT==null){return 0;}return this._$MT.getCanvasWidth();};aa.prototype.getCanvasHeight=function(){if(this._$MT==null){return 0;}return this._$MT.getCanvasHeight();};aa.prototype.getParamFloat=function(aH){if(typeof aH!="number"){aH=this._$5S.getParamIndex(z.getID(aH));}return this._$5S.getParamFloat(aH);};aa.prototype.setParamFloat=function(aH,aJ,aI){if(typeof aH!="number"){aH=this._$5S.getParamIndex(z.getID(aH));}if(arguments.length<3){aI=1;}this._$5S.setParamFloat(aH,this._$5S.getParamFloat(aH)*(1-aI)+aJ*aI);};aa.prototype.addToParamFloat=function(aH,aJ,aI){if(typeof aH!="number"){aH=this._$5S.getParamIndex(z.getID(aH));}if(arguments.length<3){aI=1;}this._$5S.setParamFloat(aH,this._$5S.getParamFloat(aH)+aJ*aI);};aa.prototype.multParamFloat=function(aH,aJ,aI){if(typeof aH!="number"){aH=this._$5S.getParamIndex(z.getID(aH));}if(arguments.length<3){aI=1;}this._$5S.setParamFloat(aH,this._$5S.getParamFloat(aH)*(1+(aJ-1)*aI));};aa.prototype.getParamIndex=function(aH){return this._$5S.getParamIndex(z.getID(aH));};aa.prototype.loadParam=function(){this._$5S.loadParam();};aa.prototype.saveParam=function(){this._$5S.saveParam();};aa.prototype.init=function(){this._$5S.init();};aa.prototype.update=function(){this._$5S.update();};aa.prototype._$Rs=function(){q._$li("_$60 _$PT _$Rs()");return -1;};aa.prototype._$Ds=function(aH){q._$li("_$60 _$PT _$SS#_$Ds() \n");};aa.prototype._$K2=function(){};aa.prototype.draw=function(){};aa.prototype.getModelContext=function(){return this._$5S;};aa.prototype._$s2=function(){return this._$NP;};aa.prototype._$P7=function(aK,aR,aH,a0){var aU=-1;var aY=0;var aM=this;var aJ=0.5;var aI=0.15;var aX=true;if(aH==0){for(var aV=0;aV1){aQ=1;}}else{aQ-=aW;if(aQ<0){aQ=0;}}aM.setPartsOpacity(aO,aQ);}else{for(var aV=0;aV=0){break;}aU=aV;var aO=aR[aV];aY=aM.getPartsOpacity(aO);aY+=aH/a0;if(aY>1){aY=1;}}}if(aU<0){console.log("No _$wi _$q0/ _$U default[%s]",aK[0]);aU=0;aY=1;aM.loadParam();aM.setParamFloat(aK[aU],aY);aM.saveParam();}for(var aV=0;aVaI){aZ=1-aI/(1-aY);}}if(aL>aZ){aL=aZ;}aM.setPartsOpacity(aO,aL);}}}}};aa.prototype.setPartsOpacity=function(aI,aH){if(typeof aI!="number"){aI=this._$5S.getPartsDataIndex(i.getID(aI));}this._$5S.setPartsOpacity(aI,aH);};aa.prototype.getPartsDataIndex=function(aH){if(!(aH instanceof i)){aH=i.getID(aH);}return this._$5S.getPartsDataIndex(aH);};aa.prototype.getPartsOpacity=function(aH){if(typeof aH!="number"){aH=this._$5S.getPartsDataIndex(i.getID(aH));}if(aH<0){return 0;}return this._$5S.getPartsOpacity(aH);};aa.prototype.getDrawParam=function(){};aa.prototype.getDrawDataIndex=function(aH){return this._$5S.getDrawDataIndex(Z.getID(aH));};aa.prototype.getDrawData=function(aH){return this._$5S.getDrawData(aH);};aa.prototype.getTransformedPoints=function(aH){var aI=this._$5S._$C2(aH);if(aI instanceof ag){return(aI).getTransformedPoints();}return null;};aa.prototype.getIndexArray=function(aI){if(aI<0||aI>=this._$5S._$aS.length){return null;}var aH=this._$5S._$aS[aI];if(aH!=null&&aH.getType()==a._$wb){if(aH instanceof b){return aH.getIndexArray();}}return null;};function W(aJ){if(j){return;}this.clipContextList=new Array();this.glcontext=aJ.gl;this.dp_webgl=aJ;this.curFrameNo=0;this.firstError_clipInNotUpdate=true;this.colorBuffer=0;this.isInitGLFBFunc=false;this.tmpBoundsOnModel=new av();if(Q.glContext.length>Q.frameBuffers.length){this.curFrameNo=this.getMaskRenderTexture();}else{}this.tmpModelToViewMatrix=new ac();this.tmpMatrix2=new ac();this.tmpMatrixForMask=new ac();this.tmpMatrixForDraw=new ac();this.CHANNEL_COLORS=new Array();var aI=new o();aI=new o();aI.r=0;aI.g=0;aI.b=0;aI.a=1;this.CHANNEL_COLORS.push(aI);aI=new o();aI.r=1;aI.g=0;aI.b=0;aI.a=0;this.CHANNEL_COLORS.push(aI);aI=new o();aI.r=0;aI.g=1;aI.b=0;aI.a=0;this.CHANNEL_COLORS.push(aI);aI=new o();aI.r=0;aI.g=0;aI.b=1;aI.a=0;this.CHANNEL_COLORS.push(aI);for(var aH=0;aH=0;--aH){this.CHANNEL_COLORS.splice(aH,1);}this.CHANNEL_COLORS=[];}this.releaseShader();};W.prototype.releaseShader=function(){var aI=Q.frameBuffers.length;for(var aH=0;aH0){var aM=aQ.gl.getParameter(aQ.gl.FRAMEBUFFER_BINDING);var aW=new Array(4);aW[0]=0;aW[1]=0;aW[2]=aQ.gl.canvas.width;aW[3]=aQ.gl.canvas.height;aQ.gl.viewport(0,0,Q.clippingMaskBufferSize,Q.clippingMaskBufferSize);this.setupLayoutBounds(aK);aQ.gl.bindFramebuffer(aQ.gl.FRAMEBUFFER,Q.frameBuffers[this.curFrameNo].framebuffer);aQ.gl.clearColor(0,0,0,0);aQ.gl.clear(aQ.gl.COLOR_BUFFER_BIT);for(var aO=0;aOa5?aU:a5;var aT=aJ;var aR=aJ;var aS=0;var aP=0;var aL=aV.clippedDrawContextList.length;for(var aM=0;aMaS){aS=a0;}if(aZ>aP){aP=aZ;}}}if(aT==aJ){aV.allClippedDrawRect.x=0;aV.allClippedDrawRect.y=0;aV.allClippedDrawRect.width=0;aV.allClippedDrawRect.height=0;aV.isUsing=false;}else{var aQ=aS-aT;var aY=aP-aR;aV.allClippedDrawRect.x=aT;aV.allClippedDrawRect.y=aR;aV.allClippedDrawRect.width=aQ;aV.allClippedDrawRect.height=aY;aV.isUsing=true;}};W.prototype.setupLayoutBounds=function(aQ){var aI=aQ/W.CHANNEL_COUNT;var aP=aQ%W.CHANNEL_COUNT;aI=~~aI;aP=~~aP;var aH=0;for(var aJ=0;aJ=1){return 1;}}var aS=aQ;var aI=aS*aS;var aH=aS*aI;var aT=aY*aH+aX*aI+aW*aS+aV;return aT;};ah.prototype._$a0=function(){};ah.prototype.setFadeIn=function(aH){this._$dP=aH;};ah.prototype.setFadeOut=function(aH){this._$eo=aH;};ah.prototype._$pT=function(aH){this._$V0=aH;};ah.prototype.getFadeOut=function(){return this._$eo;};ah.prototype._$4T=function(){return this._$eo;};ah.prototype._$mT=function(){return this._$V0;};ah.prototype.getDurationMSec=function(){return -1;};ah.prototype.getLoopDurationMSec=function(){return -1;};ah.prototype.updateParam=function(aJ,aN){if(!aN._$AT||aN._$9L){return;}var aL=P.getUserTimeMSec();if(aN._$z2<0){aN._$z2=aL;aN._$bs=aL;var aM=this.getDurationMSec();if(aN._$Do<0){aN._$Do=(aM<=0)?-1:aN._$z2+aM;}}var aI=this._$V0;var aH=(this._$dP==0)?1:A._$r2(((aL-aN._$bs)/(this._$dP)));var aK=(this._$eo==0||aN._$Do<0)?1:A._$r2(((aN._$Do-aL)/(this._$eo)));aI=aI*aH*aK;if(!((0<=aI&&aI<=1))){console.log("### assert!! ### ");}this.updateParamExe(aJ,aL,aI,aN);if(aN._$Do>0&&aN._$Do0){console.log("\n");}else{if(aH%8==0&&aH>0){console.log(" ");}}console.log("%02X ",(aJ[aH]&255));}console.log("\n");};q._$nr=function(aL,aI,aK){console.log("%s\n",aL);var aH=aI.length;for(var aJ=0;aJ=0;--aJ){var aM=this._$lL[aJ];aM._$oP(aI,this);}this._$oo(aI,aK);this._$M2=this._$Yb();this._$9b=(this._$M2-this._$ks)/aK;this._$ks=this._$M2;}for(var aJ=this._$qP.length-1;aJ>=0;--aJ){var aH=this._$qP[aJ];aH._$YS(aI,this);}this._$iT=aL;};u.prototype._$oo=function(aN,aI){if(aI<0.033){aI=0.033;}var aU=1/aI;this.p1.vx=(this.p1.x-this.p1._$s0)*aU;this.p1.vy=(this.p1.y-this.p1._$70)*aU;this.p1.ax=(this.p1.vx-this.p1._$7L)*aU;this.p1.ay=(this.p1.vy-this.p1._$HL)*aU;this.p1.fx=this.p1.ax*this.p1._$p;this.p1.fy=this.p1.ay*this.p1._$p;this.p1._$xT();var aM=-(Math.atan2((this.p1.y-this.p2.y),this.p1.x-this.p2.x));var aL;var aV;var aR=Math.cos(aM);var aH=Math.sin(aM);var aW=9.8*this.p2._$p;var aQ=(this._$Db*aC._$bS);var aP=(aW*Math.cos(aM-aQ));aL=(aP*aH);aV=(aP*aR);var aK=(-this.p1.fx*aH*aH);var aT=(-this.p1.fy*aH*aR);var aJ=((-this.p2.vx*this._$L2));var aS=((-this.p2.vy*this._$L2));this.p2.fx=((aL+aK+aJ));this.p2.fy=((aV+aT+aS));this.p2.ax=this.p2.fx/this.p2._$p;this.p2.ay=this.p2.fy/this.p2._$p;this.p2.vx+=this.p2.ax*aI;this.p2.vy+=this.p2.ay*aI;this.p2.x+=this.p2.vx*aI;this.p2.y+=this.p2.vy*aI;var aO=(Math.sqrt((this.p1.x-this.p2.x)*(this.p1.x-this.p2.x)+(this.p1.y-this.p2.y)*(this.p1.y-this.p2.y)));this.p2.x=this.p1.x+this._$Fo*(this.p2.x-this.p1.x)/aO;this.p2.y=this.p1.y+this._$Fo*(this.p2.y-this.p1.y)/aO;this.p2.vx=(this.p2.x-this.p2._$s0)*aU;this.p2.vy=(this.p2.y-this.p2._$70)*aU;this.p2._$xT();};function N(){this._$p=1;this.x=0;this.y=0;this.vx=0;this.vy=0;this.ax=0;this.ay=0;this.fx=0;this.fy=0;this._$s0=0;this._$70=0;this._$7L=0;this._$HL=0;}N.prototype._$xT=function(){this._$s0=this.x;this._$70=this.y;this._$7L=this.vx;this._$HL=this.vy;};function at(aJ,aI,aH){this._$wL=null;this.scale=null;this._$V0=null;this._$wL=aJ;this.scale=aI;this._$V0=aH;}at.prototype._$oP=function(aI,aH){};function h(aJ,aK,aI,aH){at.prototype.constructor.call(this,aK,aI,aH);this._$tL=null;this._$tL=aJ;}h.prototype=new at();h.prototype._$oP=function(aJ,aH){var aK=this.scale*aJ.getParamFloat(this._$wL);var aL=aH.getPhysicsPoint1();switch(this._$tL){default:case u.Src.SRC_TO_X:aL.x=aL.x+(aK-aL.x)*this._$V0;break;case u.Src.SRC_TO_Y:aL.y=aL.y+(aK-aL.y)*this._$V0;break;case u.Src.SRC_TO_G_ANGLE:var aI=aH._$qr();aI=aI+(aK-aI)*this._$V0;aH._$pr(aI);break;}};function d(aJ,aI,aH){this._$wL=null;this.scale=null;this._$V0=null;this._$wL=aJ;this.scale=aI;this._$V0=aH;}d.prototype._$YS=function(aI,aH){};function aF(aI,aK,aJ,aH){d.prototype.constructor.call(this,aK,aJ,aH);this._$YP=null;this._$YP=aI;}aF.prototype=new d();aF.prototype._$YS=function(aI,aH){switch(this._$YP){default:case u.Target.TARGET_FROM_ANGLE:aI.setParamFloat(this._$wL,this.scale*aH._$5r(),this._$V0);break;case u.Target.TARGET_FROM_ANGLE_V:aI.setParamFloat(this._$wL,this.scale*aH._$Cs(),this._$V0);break;}};u.Src=function(){};u.Src.SRC_TO_X="SRC_TO_X";u.Src.SRC_TO_Y="SRC_TO_Y";u.Src.SRC_TO_G_ANGLE="SRC_TO_G_ANGLE";u.Target=function(){};u.Target.TARGET_FROM_ANGLE="TARGET_FROM_ANGLE";u.Target.TARGET_FROM_ANGLE_V="TARGET_FROM_ANGLE_V";function X(){if(j){return;}this._$fL=0;this._$gL=0;this._$B0=1;this._$z0=1;this._$qT=0;this.reflectX=false;this.reflectY=false;}X.prototype.init=function(aH){this._$fL=aH._$fL;this._$gL=aH._$gL;this._$B0=aH._$B0;this._$z0=aH._$z0;this._$qT=aH._$qT;this.reflectX=aH.reflectX;this.reflectY=aH.reflectY;};X.prototype._$F0=function(aH){this._$fL=aH._$_T();this._$gL=aH._$_T();this._$B0=aH._$_T();this._$z0=aH._$_T();this._$qT=aH._$_T();if(aH.getFormatVersion()>=ay.LIVE2D_FORMAT_VERSION_V2_10_SDK2){this.reflectX=aH._$po();this.reflectY=aH._$po();}};X.prototype._$e=function(){};var ad=function(){};ad._$ni=function(aL,aJ,aR,aQ,aK,aI,aH,aS,aN){var aM=(aH*aI-aS*aK);if(aM==0){return null;}else{var aO=((aL-aR)*aI-(aJ-aQ)*aK)/aM;var aP;if(aK!=0){aP=(aL-aR-aO*aH)/aK;}else{aP=(aJ-aQ-aO*aS)/aI;}if(isNaN(aP)){aP=(aL-aR-aO*aH)/aK;if(isNaN(aP)){aP=(aJ-aQ-aO*aS)/aI;}if(isNaN(aP)){console.log("a is NaN @UtVector#_$ni() ");console.log("v1x : "+aK);console.log("v1x != 0 ? "+(aK!=0));}}if(aN==null){return new Array(aP,aO);}else{aN[0]=aP;aN[1]=aO;return aN;}}};function av(){if(j){return;}this.x=null;this.y=null;this.width=null;this.height=null;}av.prototype._$8P=function(){return this.x+0.5*this.width;};av.prototype._$6P=function(){return this.y+0.5*this.height;};av.prototype._$EL=function(){return this.x+this.width;};av.prototype._$5T=function(){return this.y+this.height;};av.prototype._$jL=function(aI,aK,aJ,aH){this.x=aI;this.y=aK;this.width=aJ;this.height=aH;};av.prototype._$jL=function(aH){this.x=aH.x;this.y=aH.y;this.width=aH.width;this.height=aH.height;};av.prototype.contains=function(aH,aI){return this.x<=this.x&&this.y<=this.y&&(this.x<=this.x+this.width)&&(this.y<=this.y+this.height);};av.prototype.expand=function(aH,aI){this.x-=aH;this.y-=aI;this.width+=aH*2;this.height+=aI*2;};function aG(){}aG._$Z2=function(bb,bo,bp,a2){var a1=bo._$Q2(bb,bp);var a3=bb._$vs();var ba=bb._$Tr();bo._$zr(a3,ba,a1);if(a1<=0){return a2[a3[0]];}else{if(a1==1){var bj=a2[a3[0]];var bi=a2[a3[1]];var a9=ba[0];return(bj+(bi-bj)*a9)|0;}else{if(a1==2){var bj=a2[a3[0]];var bi=a2[a3[1]];var a0=a2[a3[2]];var aZ=a2[a3[3]];var a9=ba[0];var a8=ba[1];var br=(bj+(bi-bj)*a9)|0;var bq=(a0+(aZ-a0)*a9)|0;return(br+(bq-br)*a8)|0;}else{if(a1==3){var aP=a2[a3[0]];var aO=a2[a3[1]];var bn=a2[a3[2]];var bm=a2[a3[3]];var aK=a2[a3[4]];var aJ=a2[a3[5]];var bg=a2[a3[6]];var bf=a2[a3[7]];var a9=ba[0];var a8=ba[1];var a6=ba[2];var bj=(aP+(aO-aP)*a9)|0;var bi=(bn+(bm-bn)*a9)|0;var a0=(aK+(aJ-aK)*a9)|0;var aZ=(bg+(bf-bg)*a9)|0;var br=(bj+(bi-bj)*a8)|0;var bq=(a0+(aZ-a0)*a8)|0;return(br+(bq-br)*a6)|0;}else{if(a1==4){var aT=a2[a3[0]];var aS=a2[a3[1]];var bu=a2[a3[2]];var bt=a2[a3[3]];var aN=a2[a3[4]];var aM=a2[a3[5]];var bl=a2[a3[6]];var bk=a2[a3[7]];var be=a2[a3[8]];var bc=a2[a3[9]];var aX=a2[a3[10]];var aW=a2[a3[11]];var a7=a2[a3[12]];var a5=a2[a3[13]];var aR=a2[a3[14]];var aQ=a2[a3[15]];var a9=ba[0];var a8=ba[1];var a6=ba[2];var a4=ba[3];var aP=(aT+(aS-aT)*a9)|0;var aO=(bu+(bt-bu)*a9)|0;var bn=(aN+(aM-aN)*a9)|0;var bm=(bl+(bk-bl)*a9)|0;var aK=(be+(bc-be)*a9)|0;var aJ=(aX+(aW-aX)*a9)|0;var bg=(a7+(a5-a7)*a9)|0;var bf=(aR+(aQ-aR)*a9)|0;var bj=(aP+(aO-aP)*a8)|0;var bi=(bn+(bm-bn)*a8)|0;var a0=(aK+(aJ-aK)*a8)|0;var aZ=(bg+(bf-bg)*a8)|0;var br=(bj+(bi-bj)*a6)|0;var bq=(a0+(aZ-a0)*a6)|0;return(br+(bq-br)*a4)|0;}else{var aV=1<=ay._$T7){this.clipID=aH._$nP();this.clipIDList=this.convertClipIDForV2_11(this.clipID);}else{this.clipIDList=[];}this._$MS(this._$Lb);};ae.prototype.getClipIDList=function(){return this.clipIDList;};ae.prototype.init=function(aH){};ae.prototype._$Nr=function(aH,aI){aI._$IS[0]=false;aI._$Us=aG._$Z2(aH,this._$GS,aI._$IS,this._$Lb);if(Q._$Zs){}else{if(aI._$IS[0]){return;}}aI._$7s=aG._$br(aH,this._$GS,aI._$IS,this._$mS);};ae.prototype._$2b=function(aH,aI){};ae.prototype.getDrawDataID=function(){return this._$gP;};ae.prototype._$j2=function(aH){this._$gP=aH;};ae.prototype.getOpacity=function(aH,aI){return aI._$7s;};ae.prototype._$zS=function(aH,aI){return aI._$Us;};ae.prototype._$MS=function(aJ){for(var aI=aJ.length-1;aI>=0;--aI){var aH=aJ[aI];if(aHae._$R2){ae._$R2=aH;}}}};ae.prototype.getTargetBaseDataID=function(){return this._$dr;};ae.prototype._$gs=function(aH){this._$dr=aH;};ae.prototype._$32=function(){return(this._$dr!=null&&(this._$dr!=n._$2o()));};ae.prototype.preDraw=function(aJ,aH,aI){};ae.prototype.draw=function(aJ,aH,aI){};ae.prototype.getType=function(){};ae.prototype._$B2=function(aI,aH,aJ){};function ax(){if(j){return;}this._$Eb=ax._$ps;this._$lT=1;this._$C0=1;this._$tT=1;this._$WL=1;this.culling=false;this.matrix4x4=new Float32Array(16);this.premultipliedAlpha=false;this.anisotropy=0;this.clippingProcess=ax.CLIPPING_PROCESS_NONE;this.clipBufPre_clipContextMask=null;this.clipBufPre_clipContextDraw=null;this.CHANNEL_COLORS=new Array();}ax._$ps=32;ax.CLIPPING_PROCESS_NONE=0;ax.CLIPPING_PROCESS_OVERWRITE_ALPHA=1;ax.CLIPPING_PROCESS_MULTIPLY_ALPHA=2;ax.CLIPPING_PROCESS_DRAW=3;ax.CLIPPING_PROCESS_CLEAR_ALPHA=4;ax.prototype.setChannelFlagAsColor=function(aH,aI){this.CHANNEL_COLORS[aH]=aI;};ax.prototype.getChannelFlagAsColor=function(aH){return this.CHANNEL_COLORS[aH];};ax.prototype._$ZT=function(){};ax.prototype._$Uo=function(aM,aK,aJ,aL,aN,aI,aH){};ax.prototype._$Rs=function(){return -1;};ax.prototype._$Ds=function(aH){};ax.prototype.setBaseColor=function(aK,aJ,aI,aH){if(aK<0){aK=0;}else{if(aK>1){aK=1;}}if(aJ<0){aJ=0;}else{if(aJ>1){aJ=1;}}if(aI<0){aI=0;}else{if(aI>1){aI=1;}}if(aH<0){aH=0;}else{if(aH>1){aH=1;}}this._$lT=aK;this._$C0=aJ;this._$tT=aI;this._$WL=aH;};ax.prototype._$WP=function(aH){this.culling=aH;};ax.prototype.setMatrix=function(aH){for(var aI=0;aI<16;aI++){this.matrix4x4[aI]=aH[aI];}};ax.prototype._$IT=function(){return this.matrix4x4;};ax.prototype.setPremultipliedAlpha=function(aH){this.premultipliedAlpha=aH;};ax.prototype.isPremultipliedAlpha=function(){return this.premultipliedAlpha;};ax.prototype.setAnisotropy=function(aH){this.anisotropy=aH;};ax.prototype.getAnisotropy=function(){return this.anisotropy;};ax.prototype.getClippingProcess=function(){return this.clippingProcess;};ax.prototype.setClippingProcess=function(aH){this.clippingProcess=aH;};ax.prototype.setClipBufPre_clipContextForMask=function(aH){this.clipBufPre_clipContextMask=aH;};ax.prototype.getClipBufPre_clipContextMask=function(){return this.clipBufPre_clipContextMask;};ax.prototype.setClipBufPre_clipContextForDraw=function(aH){this.clipBufPre_clipContextDraw=aH;};ax.prototype.getClipBufPre_clipContextDraw=function(){return this.clipBufPre_clipContextDraw;};function o(){if(j){return;}this.a=1;this.r=1;this.g=1;this.b=1;this.scale=1;this._$ho=1;this.blendMode=Q.L2D_COLOR_BLEND_MODE_MULT;}function c(){if(j){return;}this._$kP=null;this._$dr=null;this._$Ai=true;this._$mS=null;}c._$ur=-2;c._$c2=1;c._$_b=2;c.prototype._$F0=function(aH){this._$kP=aH._$nP();this._$dr=aH._$nP();};c.prototype.readV2_opacity=function(aH){if(aH.getFormatVersion()>=ay.LIVE2D_FORMAT_VERSION_V2_10_SDK2){this._$mS=aH._$Tb();}};c.prototype.init=function(aH){};c.prototype._$Nr=function(aI,aH){};c.prototype.interpolateOpacity=function(aJ,aK,aI,aH){if(this._$mS==null){aI.setInterpolatedOpacity(1);}else{aI.setInterpolatedOpacity(aG._$br(aJ,aK,aH,this._$mS));}};c.prototype._$2b=function(aI,aH){};c.prototype._$nb=function(aL,aK,aM,aH,aI,aJ,aN){};c.prototype.getType=function(){};c.prototype._$gs=function(aH){this._$dr=aH;};c.prototype._$a2=function(aH){this._$kP=aH;};c.prototype.getTargetBaseDataID=function(){return this._$dr;};c.prototype.getBaseDataID=function(){return this._$kP;};c.prototype._$32=function(){return(this._$dr!=null&&(this._$dr!=n._$2o()));};function P(){}P._$W2=0;P._$CS=P._$W2;P._$Mo=function(){return true;};P._$XP=function(aI){try{var aJ=getTimeMSec();while(getTimeMSec()-aJ=aJ.length){return false;}for(var aI=aL;aI=0;--aJ){var aI=this._$Ob[aJ].getParamIndex(aH);if(aI==aA._$ds){aI=aK.getParamIndex(this._$Ob[aJ].getParamID());}if(aK._$Xb(aI)){return true;}}return false;};g.prototype._$Q2=function(aL,aV){var aX=this._$Ob.length;var aJ=aL._$v2();var aN=0;var aI;var aQ;for(var aK=0;aKaw._$Qb){console.log("err 23245\n");}var aS=this._$Ob.length;var aK=1;var aH=1;var aJ=0;for(var aQ=0;aQ=0;--aK){aM[aK]=aL[aK];}}else{this.mult_fast(aI,aH,aM,aJ);}};ac.prototype.mult_fast=function(aI,aH,aK,aJ){if(aJ){aK[0]=aI[0]*aH[0]+aI[4]*aH[1]+aI[8]*aH[2];aK[4]=aI[0]*aH[4]+aI[4]*aH[5]+aI[8]*aH[6];aK[8]=aI[0]*aH[8]+aI[4]*aH[9]+aI[8]*aH[10];aK[12]=aI[0]*aH[12]+aI[4]*aH[13]+aI[8]*aH[14]+aI[12];aK[1]=aI[1]*aH[0]+aI[5]*aH[1]+aI[9]*aH[2];aK[5]=aI[1]*aH[4]+aI[5]*aH[5]+aI[9]*aH[6];aK[9]=aI[1]*aH[8]+aI[5]*aH[9]+aI[9]*aH[10];aK[13]=aI[1]*aH[12]+aI[5]*aH[13]+aI[9]*aH[14]+aI[13];aK[2]=aI[2]*aH[0]+aI[6]*aH[1]+aI[10]*aH[2];aK[6]=aI[2]*aH[4]+aI[6]*aH[5]+aI[10]*aH[6];aK[10]=aI[2]*aH[8]+aI[6]*aH[9]+aI[10]*aH[10];aK[14]=aI[2]*aH[12]+aI[6]*aH[13]+aI[10]*aH[14]+aI[14];aK[3]=aK[7]=aK[11]=0;aK[15]=1;}else{aK[0]=aI[0]*aH[0]+aI[4]*aH[1]+aI[8]*aH[2]+aI[12]*aH[3];aK[4]=aI[0]*aH[4]+aI[4]*aH[5]+aI[8]*aH[6]+aI[12]*aH[7];aK[8]=aI[0]*aH[8]+aI[4]*aH[9]+aI[8]*aH[10]+aI[12]*aH[11];aK[12]=aI[0]*aH[12]+aI[4]*aH[13]+aI[8]*aH[14]+aI[12]*aH[15];aK[1]=aI[1]*aH[0]+aI[5]*aH[1]+aI[9]*aH[2]+aI[13]*aH[3];aK[5]=aI[1]*aH[4]+aI[5]*aH[5]+aI[9]*aH[6]+aI[13]*aH[7];aK[9]=aI[1]*aH[8]+aI[5]*aH[9]+aI[9]*aH[10]+aI[13]*aH[11];aK[13]=aI[1]*aH[12]+aI[5]*aH[13]+aI[9]*aH[14]+aI[13]*aH[15];aK[2]=aI[2]*aH[0]+aI[6]*aH[1]+aI[10]*aH[2]+aI[14]*aH[3];aK[6]=aI[2]*aH[4]+aI[6]*aH[5]+aI[10]*aH[6]+aI[14]*aH[7];aK[10]=aI[2]*aH[8]+aI[6]*aH[9]+aI[10]*aH[10]+aI[14]*aH[11];aK[14]=aI[2]*aH[12]+aI[6]*aH[13]+aI[10]*aH[14]+aI[14]*aH[15];aK[3]=aI[3]*aH[0]+aI[7]*aH[1]+aI[11]*aH[2]+aI[15]*aH[3];aK[7]=aI[3]*aH[4]+aI[7]*aH[5]+aI[11]*aH[6]+aI[15]*aH[7];aK[11]=aI[3]*aH[8]+aI[7]*aH[9]+aI[11]*aH[10]+aI[15]*aH[11];aK[15]=aI[3]*aH[12]+aI[7]*aH[13]+aI[11]*aH[14]+aI[15]*aH[15];}};ac.prototype.translate=function(aH,aJ,aI){this.m[12]=this.m[0]*aH+this.m[4]*aJ+this.m[8]*aI+this.m[12];this.m[13]=this.m[1]*aH+this.m[5]*aJ+this.m[9]*aI+this.m[13];this.m[14]=this.m[2]*aH+this.m[6]*aJ+this.m[10]*aI+this.m[14];this.m[15]=this.m[3]*aH+this.m[7]*aJ+this.m[11]*aI+this.m[15];};ac.prototype.scale=function(aJ,aI,aH){this.m[0]*=aJ;this.m[4]*=aI;this.m[8]*=aH;this.m[1]*=aJ;this.m[5]*=aI;this.m[9]*=aH;this.m[2]*=aJ;this.m[6]*=aI;this.m[10]*=aH;this.m[3]*=aJ;this.m[7]*=aI;this.m[11]*=aH;};ac.prototype.rotateX=function(aH){var aK=aC.fcos(aH);var aJ=aC._$9(aH);var aI=this.m[4];this.m[4]=aI*aK+this.m[8]*aJ;this.m[8]=aI*-aJ+this.m[8]*aK;aI=this.m[5];this.m[5]=aI*aK+this.m[9]*aJ;this.m[9]=aI*-aJ+this.m[9]*aK;aI=this.m[6];this.m[6]=aI*aK+this.m[10]*aJ;this.m[10]=aI*-aJ+this.m[10]*aK;aI=this.m[7];this.m[7]=aI*aK+this.m[11]*aJ;this.m[11]=aI*-aJ+this.m[11]*aK;};ac.prototype.rotateY=function(aH){var aK=aC.fcos(aH);var aJ=aC._$9(aH);var aI=this.m[0];this.m[0]=aI*aK+this.m[8]*-aJ;this.m[8]=aI*aJ+this.m[8]*aK;aI=this.m[1];this.m[1]=aI*aK+this.m[9]*-aJ;this.m[9]=aI*aJ+this.m[9]*aK;aI=m[2];this.m[2]=aI*aK+this.m[10]*-aJ;this.m[10]=aI*aJ+this.m[10]*aK;aI=m[3];this.m[3]=aI*aK+this.m[11]*-aJ;this.m[11]=aI*aJ+this.m[11]*aK;};ac.prototype.rotateZ=function(aH){var aK=aC.fcos(aH);var aJ=aC._$9(aH);var aI=this.m[0];this.m[0]=aI*aK+this.m[4]*aJ;this.m[4]=aI*-aJ+this.m[4]*aK;aI=this.m[1];this.m[1]=aI*aK+this.m[5]*aJ;this.m[5]=aI*-aJ+this.m[5]*aK;aI=this.m[2];this.m[2]=aI*aK+this.m[6]*aJ;this.m[6]=aI*-aJ+this.m[6]*aK;aI=this.m[3];this.m[3]=aI*aK+this.m[7]*aJ;this.m[7]=aI*-aJ+this.m[7]*aK;};function Z(aH){if(j){return;}ak.prototype.constructor.call(this,aH);}Z.prototype=new ak();Z._$tP=new Object();Z._$27=function(){Z._$tP.clear();};Z.getID=function(aH){var aI=Z._$tP[aH];if(aI==null){aI=new Z(aH);Z._$tP[aH]=aI;}return aI;};Z.prototype._$3s=function(){return new Z();};function aD(){if(j){return;}this._$7=1;this._$f=0;this._$H=0;this._$g=1;this._$k=0;this._$w=0;this._$hi=STATE_IDENTITY;this._$Z=_$pS;}aD._$kS=-1;aD._$pS=0;aD._$hb=1;aD.STATE_IDENTITY=0;aD._$gb=1;aD._$fo=2;aD._$go=4;aD.prototype.transform=function(aK,aI,aH){var aT,aS,aR,aM,aL,aJ;var aQ=0;var aN=0;switch(this._$hi){default:return;case (aD._$go|aD._$fo|aD._$gb):aT=this._$7;aS=this._$H;aR=this._$k;aM=this._$f;aL=this._$g;aJ=this._$w;while(--aH>=0){var aP=aK[aQ++];var aO=aK[aQ++];aI[aN++]=(aT*aP+aS*aO+aR);aI[aN++]=(aM*aP+aL*aO+aJ);}return;case (aD._$go|aD._$fo):aT=this._$7;aS=this._$H;aM=this._$f;aL=this._$g;while(--aH>=0){var aP=aK[aQ++];var aO=aK[aQ++];aI[aN++]=(aT*aP+aS*aO);aI[aN++]=(aM*aP+aL*aO);}return;case (aD._$go|aD._$gb):aS=this._$H;aR=this._$k;aM=this._$f;aJ=this._$w;while(--aH>=0){var aP=aK[aQ++];aI[aN++]=(aS*aK[aQ++]+aR);aI[aN++]=(aM*aP+aJ);}return;case (aD._$go):aS=this._$H;aM=this._$f;while(--aH>=0){var aP=aK[aQ++];aI[aN++]=(aS*aK[aQ++]);aI[aN++]=(aM*aP);}return;case (aD._$fo|aD._$gb):aT=this._$7;aR=this._$k;aL=this._$g;aJ=this._$w;while(--aH>=0){aI[aN++]=(aT*aK[aQ++]+aR);aI[aN++]=(aL*aK[aQ++]+aJ);}return;case (aD._$fo):aT=this._$7;aL=this._$g;while(--aH>=0){aI[aN++]=(aT*aK[aQ++]);aI[aN++]=(aL*aK[aQ++]);}return;case (aD._$gb):aR=this._$k;aJ=this._$w;while(--aH>=0){aI[aN++]=(aK[aQ++]+aR);aI[aN++]=(aK[aQ++]+aJ);}return;case (aD.STATE_IDENTITY):if(aK!=aI||aQ!=aN){P._$jT(aK,aQ,aI,aN,aH*2);}return;}};aD.prototype.update=function(){if(this._$H==0&&this._$f==0){if(this._$7==1&&this._$g==1){if(this._$k==0&&this._$w==0){this._$hi=aD.STATE_IDENTITY;this._$Z=aD._$pS;}else{this._$hi=aD._$gb;this._$Z=aD._$hb;}}else{if(this._$k==0&&this._$w==0){this._$hi=aD._$fo;this._$Z=aD._$kS;}else{this._$hi=(aD._$fo|aD._$gb);this._$Z=aD._$kS;}}}else{if(this._$7==0&&this._$g==0){if(this._$k==0&&this._$w==0){this._$hi=aD._$go;this._$Z=aD._$kS;}else{this._$hi=(aD._$go|aD._$gb);this._$Z=aD._$kS;}}else{if(this._$k==0&&this._$w==0){this._$hi=(aD._$go|aD._$fo);this._$Z=aD._$kS;}else{this._$hi=(aD._$go|aD._$fo|aD._$gb);this._$Z=aD._$kS;}}}};aD.prototype._$RT=function(aK){this._$IT(aK);var aJ=aK[0];var aH=aK[2];var aN=aK[1];var aM=aK[3];var aI=Math.sqrt(aJ*aJ+aN*aN);var aL=aJ*aM-aH*aN;if(aI==0){if(Q._$so){console.log("affine._$RT() / rt==0");}}else{aK[0]=aI;aK[1]=aL/aI;aK[2]=(aN*aM+aJ*aH)/aL;aK[3]=Math.atan2(aN,aJ);}};aD.prototype._$ho=function(aN,aM,aI,aH){var aL=new Float32Array(6);var aK=new Float32Array(6);aN._$RT(aL);aM._$RT(aK);var aJ=new Float32Array(6);aJ[0]=aL[0]+(aK[0]-aL[0])*aI;aJ[1]=aL[1]+(aK[1]-aL[1])*aI;aJ[2]=aL[2]+(aK[2]-aL[2])*aI;aJ[3]=aL[3]+(aK[3]-aL[3])*aI;aJ[4]=aL[4]+(aK[4]-aL[4])*aI;aJ[5]=aL[5]+(aK[5]-aL[5])*aI;aH._$CT(aJ);};aD.prototype._$CT=function(aJ){var aI=Math.cos(aJ[3]);var aH=Math.sin(aJ[3]);this._$7=aJ[0]*aI;this._$f=aJ[0]*aH;this._$H=aJ[1]*(aJ[2]*aI-aH);this._$g=aJ[1]*(aJ[2]*aH+aI);this._$k=aJ[4];this._$w=aJ[5];this.update();};aD.prototype._$IT=function(aH){aH[0]=this._$7;aH[1]=this._$f;aH[2]=this._$H;aH[3]=this._$g;aH[4]=this._$k;aH[5]=this._$w;};function Y(){if(j){return;}ah.prototype.constructor.call(this);this.motions=new Array();this._$7r=null;this._$7r=Y._$Co++;this._$D0=30;this._$yT=0;this._$E=true;this.loopFadeIn=true;this._$AS=-1;_$a0();}Y.prototype=new ah();Y._$cs="VISIBLE:";Y._$ar="LAYOUT:";Y._$Co=0;Y._$D2=[];Y._$1T=1;Y.loadMotion=function(aR){var aM=new Y();var aI=[0];var aP=aR.length;aM._$yT=0;for(var aJ=0;aJ=0){if(aK==aT+4&&aR[aT+1]=="f"&&aR[aT+2]=="p"&&aR[aT+3]=="s"){aO=true;}for(aJ=aK+1;aJ0){if(aO&&5=0){var aN=new t();if(G.startsWith(aR,aT,Y._$cs)){aN._$RP=t._$hs;aN._$4P=new String(aR,aT,aK-aT);}else{if(G.startsWith(aR,aT,Y._$ar)){aN._$4P=new String(aR,aT+7,aK-aT-7);if(G.startsWith(aR,aT+7,"ANCHOR_X")){aN._$RP=t._$xs;}else{if(G.startsWith(aR,aT+7,"ANCHOR_Y")){aN._$RP=t._$us;}else{if(G.startsWith(aR,aT+7,"SCALE_X")){aN._$RP=t._$qs;}else{if(G.startsWith(aR,aT+7,"SCALE_Y")){aN._$RP=t._$Ys;}else{if(G.startsWith(aR,aT+7,"X")){aN._$RP=t._$ws;}else{if(G.startsWith(aR,aT+7,"Y")){aN._$RP=t._$Ns;}}}}}}}else{aN._$RP=t._$Fr;aN._$4P=new String(aR,aT,aK-aT);}}aM.motions.push(aN);var aS=0;Y._$D2.clear();for(aJ=aK+1;aJ0){Y._$D2.push(aL);aS++;var aH=aI[0];if(aHaM._$yT){aM._$yT=aS;}}}}aM._$AS=((1000*aM._$yT)/aM._$D0)|0;return aM;};Y.prototype.getDurationMSec=function(){return this._$AS;};Y.prototype.dump=function(){for(var aJ=0;aJ=aK?aK-1:aJ)];aH.setParamFloat(aQ,aT);}else{if(t._$ws<=aS._$RP&&aS._$RP<=t._$Ys){}else{var aR=aH.getParamFloat(aQ);var aY=aS._$I0[(aJ>=aK?aK-1:aJ)];var aW=aS._$I0[(aJ+1>=aK?aK-1:aJ+1)];var aI=aY+(aW-aY)*aP;var aN=aR+(aI-aR)*aO;aH.setParamFloat(aQ,aN);}}}if(aJ>=this._$yT){if(this._$E){aX._$z2=aL;if(this.loopFadeIn){aX._$bs=aL;}}else{aX._$9L=true;}}};Y.prototype._$r0=function(){return this._$E;};Y.prototype._$aL=function(aH){this._$E=aH;};Y.prototype.isLoopFadeIn=function(){return this.loopFadeIn;};Y.prototype.setLoopFadeIn=function(aH){this.loopFadeIn=aH;};function aE(){this._$P=new Float32Array(100);this.size=0;}aE.prototype.clear=function(){this.size=0;};aE.prototype.add=function(aI){if(this._$P.length<=this.size){var aH=new Float32Array(this.size*2);P._$jT(this._$P,0,aH,0,this.size);this._$P=aH;}this._$P[this.size++]=aI;};aE.prototype._$BL=function(){var aH=new Float32Array(this.size);P._$jT(this._$P,0,aH,0,this.size);return aH;};function t(){this._$4P=null;this._$I0=null;this._$RP=null;}t._$Fr=0;t._$hs=1;t._$ws=100;t._$Ns=101;t._$xs=102;t._$us=103;t._$qs=104;t._$Ys=105;function aw(){}aw._$Ms=1;aw._$Qs=2;aw._$i2=0;aw._$No=2;aw._$do=aw._$Ms;aw._$Ls=true;aw._$1r=5;aw._$Qb=65;aw._$J=0.0001;aw._$FT=0.001;aw._$Ss=3;function ay(){}ay._$o7=6;ay._$S7=7;ay._$s7=8;ay._$77=9;ay.LIVE2D_FORMAT_VERSION_V2_10_SDK2=10;ay.LIVE2D_FORMAT_VERSION_V2_11_SDK2_1=11;ay._$T7=ay.LIVE2D_FORMAT_VERSION_V2_11_SDK2_1;ay._$Is=-2004318072;ay._$h0=0;ay._$4L=23;ay._$7P=33;ay._$uT=function(aH){console.log("_$bo :: _$6 _$mo _$E0 : %d\n",aH);};ay._$9o=function(aH){if(aH<40){ay._$uT(aH);return null;}else{if(aH<50){ay._$uT(aH);return null;}else{if(aH<60){ay._$uT(aH);return null;}else{if(aH<100){switch(aH){case 65:return new E();case 66:return new g();case 67:return new aA();case 68:return new ab();case 69:return new X();case 70:return new b();default:ay._$uT(aH);return null;}}else{if(aH<150){switch(aH){case 131:return new f();case 133:return new s();case 136:return new w();case 137:return new an();case 142:return new aq();}}}}}}ay._$uT(aH);return null;};function y(aH){if(j){return;}this._$QT=true;this._$co=-1;this._$qo=0;this._$pb=new Array(y._$is);this._$_2=new Float32Array(y._$is);this._$vr=new Float32Array(y._$is);this._$Rr=new Float32Array(y._$is);this._$Or=new Float32Array(y._$is);this._$fs=new Float32Array(y._$is);this._$Js=new Array(y._$is);this._$3S=new Array();this._$aS=new Array();this._$Bo=null;this._$F2=new Array();this._$db=new Array();this._$8b=new Array();this._$Hr=new Array();this._$Ws=null;this._$Vs=null;this._$Er=null;this._$Es=new Int16Array(aw._$Qb);this._$ZP=new Float32Array(aw._$1r*2);this._$Ri=aH;this._$b0=y._$HP++;this.clipManager=null;this.dp_webgl=null;}y._$HP=0;y._$_0=true;y._$V2=-1;y._$W0=-1;y._$jr=false;y._$ZS=true;y._$tr=(-1000000);y._$lr=(1000000);y._$is=32;y._$e=false;y.prototype.getDrawDataIndex=function(aI){for(var aH=this._$aS.length-1;aH>=0;--aH){if(this._$aS[aH]!=null&&this._$aS[aH].getDrawDataID()==aI){return aH;}}return -1;};y.prototype.getDrawData=function(aH){if(aH instanceof Z){if(this._$Bo==null){this._$Bo=new Object();var aJ=this._$aS.length;for(var aI=0;aI0){this.release();}var aO=this._$Ri.getModelImpl();var aT=aO._$Xr();var aS=aT.length;var aH=new Array();var a3=new Array();for(var aV=0;aV=0){this._$3S.push(aL);this._$db.push(a3[aV]);aH[aV]=null;aX=true;}}if(!aX){break;}}var aI=aO._$E2();if(aI!=null){var aJ=aI._$1s();if(aJ!=null){var aW=aJ.length;for(var aV=0;aV=0;aW--){this._$Js[aW]=y._$jr;}this._$QT=false;if(y._$e){q.dump("_$eL");}return aX;};y.prototype.preDraw=function(aH){if(this.clipManager!=null){aH._$ZT();this.clipManager.setupClip(this,aH);}};y.prototype.draw=function(aM){if(this._$Ws==null){q._$li("call _$Ri.update() before _$Ri.draw() ");return;}var aP=this._$Ws.length;aM._$ZT();for(var aK=0;aK=0;--aI){if(this._$pb[aI]==aH){return aI;}}return this._$02(aH,0,y._$tr,y._$lr);};y.prototype._$BS=function(aH){return this.getBaseDataIndex(aH);};y.prototype.getBaseDataIndex=function(aH){for(var aI=this._$3S.length-1;aI>=0;--aI){if(this._$3S[aI]!=null&&this._$3S[aI].getBaseDataID()==aH){return aI;}}return -1;};y.prototype._$UT=function(aJ,aH){var aI=new Float32Array(aH);P._$jT(aJ,0,aI,0,aJ.length);return aI;};y.prototype._$02=function(aN,aM,aL,aH){if(this._$qo>=this._$pb.length){var aK=this._$pb.length;var aJ=new Array(aK*2);P._$jT(this._$pb,0,aJ,0,aK);this._$pb=aJ;this._$_2=this._$UT(this._$_2,aK*2);this._$vr=this._$UT(this._$vr,aK*2);this._$Rr=this._$UT(this._$Rr,aK*2);this._$Or=this._$UT(this._$Or,aK*2);var aI=new Array();P._$jT(this._$Js,0,aI,0,aK);this._$Js=aI;}this._$pb[this._$qo]=aN;this._$_2[this._$qo]=aM;this._$vr[this._$qo]=aM;this._$Rr[this._$qo]=aL;this._$Or[this._$qo]=aH;this._$Js[this._$qo]=y._$ZS;return this._$qo++;};y.prototype._$Zo=function(aI,aH){this._$3S[aI]=aH;};y.prototype.setParamFloat=function(aH,aI){if(aIthis._$Or[aH]){aI=this._$Or[aH];}this._$_2[aH]=aI;};y.prototype.loadParam=function(){var aH=this._$_2.length;if(aH>this._$fs.length){aH=this._$fs.length;}P._$jT(this._$fs,0,this._$_2,0,aH);};y.prototype.saveParam=function(){var aH=this._$_2.length;if(aH>this._$fs.length){this._$fs=new Float32Array(aH);}P._$jT(this._$_2,0,this._$fs,0,aH);};y.prototype._$v2=function(){return this._$co;};y.prototype._$WS=function(){return this._$QT;};y.prototype._$Xb=function(aH){return this._$Js[aH]==y._$ZS;};y.prototype._$vs=function(){return this._$Es;};y.prototype._$Tr=function(){return this._$ZP;};y.prototype.getBaseData=function(aH){return this._$3S[aH];};y.prototype.getParamFloat=function(aH){return this._$_2[aH];};y.prototype.getParamMax=function(aH){return this._$Or[aH];};y.prototype.getParamMin=function(aH){return this._$Rr[aH];};y.prototype.setPartsOpacity=function(aJ,aH){var aI=this._$Hr[aJ];aI.setPartsOpacity(aH);};y.prototype.getPartsOpacity=function(aI){var aH=this._$Hr[aI];return aH.getPartsOpacity();};y.prototype.getPartsDataIndex=function(aI){for(var aH=this._$F2.length-1;aH>=0;--aH){if(this._$F2[aH]!=null&&this._$F2[aH]._$p2()==aI){return aH;}}return -1;};y.prototype._$q2=function(aH){return this._$db[aH];};y.prototype._$C2=function(aH){return this._$8b[aH];};y.prototype._$Bb=function(aH){return this._$Hr[aH];};y.prototype._$5s=function(aO,aK){var aJ=this._$Ws.length;var aN=aO;for(var aL=0;aL0){aL+=aK;}return aI;};ap._$C=function(aJ){var aI=null;var aL=null;try{aI=(aJ instanceof Array)?aJ:new _$Xs(aJ,8192);aL=new _$js();var aM=1000;var aK;var aH=new Int8Array(aM);while((aK=aI.read(aH))>0){aL.write(aH,0,aK);}return aL._$TS();}finally{if(aJ!=null){aJ.close();}if(aL!=null){aL.flush();aL.close();}}};function ar(){if(j){return;}this._$12=null;this._$bb=null;this._$_L=null;this._$jo=null;this._$iL=null;this._$0L=null;this._$Br=null;this._$Dr=null;this._$Cb=null;this._$mr=null;this._$_L=az.STATE_FIRST;this._$Br=4000;this._$Dr=100;this._$Cb=50;this._$mr=150;this._$jo=true;this._$iL="PARAM_EYE_L_OPEN";this._$0L="PARAM_EYE_R_OPEN";}ar.prototype._$T2=function(){var aI=P.getUserTimeMSec();var aH=Math._$10();return(aI+aH*(2*this._$Br-1));};ar.prototype._$uo=function(aH){this._$Br=aH;};ar.prototype._$QS=function(aI,aH,aJ){this._$Dr=aI;this._$Cb=aH;this._$mr=aJ;};ar.prototype._$7T=function(aI){var aK=P.getUserTimeMSec();var aH;var aJ=0;switch(this._$_L){case STATE_CLOSING:aJ=(aK-this._$bb)/this._$Dr;if(aJ>=1){aJ=1;this._$_L=az.STATE_CLOSED;this._$bb=aK;}aH=1-aJ;break;case STATE_CLOSED:aJ=(aK-this._$bb)/this._$Cb;if(aJ>=1){this._$_L=az.STATE_OPENING;this._$bb=aK;}aH=0;break;case STATE_OPENING:aJ=(aK-this._$bb)/this._$mr;if(aJ>=1){aJ=1;this._$_L=az.STATE_INTERVAL;this._$12=this._$T2();}aH=aJ;break;case STATE_INTERVAL:if(this._$120.9?Q.EXPAND_W:0;this.gl.drawElements(aL,aP,aI,aQ,aM,aN,this.transform,aJ);};x.prototype._$Rs=function(){throw new Error("_$Rs");};x.prototype._$Ds=function(aH){throw new Error("_$Ds");};x.prototype._$K2=function(){for(var aH=0;aH=0;--aI){var aH=aJ[aI];if(aHa._$R2){a._$R2=aH;}}}};a._$or=function(){return a._$52;};a._$Pr=function(){return a._$R2;};a.prototype._$F0=function(aH){this._$gP=aH._$nP();this._$dr=aH._$nP();this._$GS=aH._$nP();this._$qb=aH._$6L();this._$Lb=aH._$cS();this._$mS=aH._$Tb();if(aH.getFormatVersion()>=ay._$T7){this.clipID=aH._$nP();this.clipIDList=this.convertClipIDForV2_11(this.clipID);}else{this.clipIDList=null;}a._$Sb(this._$Lb);};a.prototype.getClipIDList=function(){return this.clipIDList;};a.prototype._$Nr=function(aI,aH){aH._$IS[0]=false;aH._$Us=aG._$Z2(aI,this._$GS,aH._$IS,this._$Lb);if(Q._$Zs){}else{if(aH._$IS[0]){return;}}aH._$7s=aG._$br(aI,this._$GS,aH._$IS,this._$mS);};a.prototype._$2b=function(aH){};a.prototype.getDrawDataID=function(){return this._$gP;};a.prototype._$j2=function(aH){this._$gP=aH;};a.prototype.getOpacity=function(aH,aI){return aI._$7s;};a.prototype._$zS=function(aH,aI){return aI._$Us;};a.prototype.getTargetBaseDataID=function(){return this._$dr;};a.prototype._$gs=function(aH){this._$dr=aH;};a.prototype._$32=function(){return(this._$dr!=null&&(this._$dr!=n._$2o()));};a.prototype.getType=function(){};function aq(){if(j){return;}this._$NL=null;this._$3S=null;this._$aS=null;aq._$42++;}aq._$42=0;aq.prototype._$1b=function(){return this._$3S;};aq.prototype.getDrawDataList=function(){return this._$aS;};aq.prototype._$F0=function(aH){this._$NL=aH._$nP();this._$aS=aH._$nP();this._$3S=aH._$nP();};aq.prototype._$kr=function(aH){aH._$Zo(this._$3S);aH._$xo(this._$aS);this._$3S=null;this._$aS=null;};function v(){if(j){return;}aa.prototype.constructor.call(this);this._$zo=new x();}v.prototype=new aa();v.loadModel=function(aI){var aH=new v();aa._$62(aH,aI);return aH;};v.loadModel=function(aI){var aH=new v();aa._$62(aH,aI);return aH;};v._$to=function(){var aH=new v();return aH;};v._$er=function(aM){var aJ=new _$5("../_$_r/_$t0/_$Ri/_$_P._$d");if(aJ.exists()==false){throw new _$ls("_$t0 _$_ _$6 _$Ui :: "+aJ._$PL());}var aH=["../_$_r/_$t0/_$Ri/_$_P.512/_$CP._$1","../_$_r/_$t0/_$Ri/_$_P.512/_$vP._$1","../_$_r/_$t0/_$Ri/_$_P.512/_$EP._$1","../_$_r/_$t0/_$Ri/_$_P.512/_$pP._$1"];var aK=v.loadModel(aJ._$3b());for(var aI=0;aI=0){if(aK==aV+4&&p(aT,aV+1)=="f"&&p(aT,aV+2)=="p"&&p(aT,aV+3)=="s"){aP=true;}for(aJ=aK+1;aJ0){if(aP&&5=0){var aO=new t();if(G.startsWith(aT,aV,ao._$cs)){aO._$RP=t._$hs;aO._$4P=G.createString(aT,aV,aK-aV);}else{if(G.startsWith(aT,aV,ao._$ar)){aO._$4P=G.createString(aT,aV+7,aK-aV-7);if(G.startsWith(aT,aV+7,"ANCHOR_X")){aO._$RP=t._$xs;}else{if(G.startsWith(aT,aV+7,"ANCHOR_Y")){aO._$RP=t._$us;}else{if(G.startsWith(aT,aV+7,"SCALE_X")){aO._$RP=t._$qs;}else{if(G.startsWith(aT,aV+7,"SCALE_Y")){aO._$RP=t._$Ys;}else{if(G.startsWith(aT,aV+7,"X")){aO._$RP=t._$ws;}else{if(G.startsWith(aT,aV+7,"Y")){aO._$RP=t._$Ns;}}}}}}}else{aO._$RP=t._$Fr;aO._$4P=G.createString(aT,aV,aK-aV);}}aN.motions.push(aO);var aU=0;var aR=[];for(aJ=aK+1;aJ0){aR.push(aM);aU++;var aH=aI[0];if(aHaN._$yT){aN._$yT=aU;}}}}aN._$rr=((1000*aN._$yT)/aN._$D0)|0;return aN;};ao.prototype.getDurationMSec=function(){return this._$E?-1:this._$rr;};ao.prototype.getLoopDurationMSec=function(){return this._$rr;};ao.prototype.dump=function(){for(var aJ=0;aJ=aL?aL-1:aK)];aJ.setParamFloat(aT,aX);}else{if(t._$ws<=aV._$RP&&aV._$RP<=t._$Ys){}else{var aH=aJ.getParamIndex(aT);var a4=aJ.getModelContext();var aY=a4.getParamMax(aH);var aW=a4.getParamMin(aH);var aM=0.4;var aS=aM*(aY-aW);var aU=a4.getParamFloat(aH);var a2=aV._$I0[(aK>=aL?aL-1:aK)];var a1=aV._$I0[(aK+1>=aL?aL-1:aK+1)];var aI;if((a2aS)||(a2>a1&&a2-a1>aS)){aI=a2;}else{aI=a2+(a1-a2)*aR;}var aP=aU+(aI-aU)*aQ;aJ.setParamFloat(aT,aP);}}}if(aK>=this._$yT){if(this._$E){a3._$z2=aN;if(this.loopFadeIn){a3._$bs=aN;}}else{a3._$9L=true;}}this._$eP=aQ;};ao.prototype._$r0=function(){return this._$E;};ao.prototype._$aL=function(aH){this._$E=aH;};ao.prototype._$S0=function(){return this._$D0;};ao.prototype._$U0=function(aH){this._$D0=aH;};ao.prototype.isLoopFadeIn=function(){return this.loopFadeIn;};ao.prototype.setLoopFadeIn=function(aH){this.loopFadeIn=aH;};function aE(){this._$P=new Float32Array(100);this.size=0;}aE.prototype.clear=function(){this.size=0;};aE.prototype.add=function(aI){if(this._$P.length<=this.size){var aH=new Float32Array(this.size*2);P._$jT(this._$P,0,aH,0,this.size);this._$P=aH;}this._$P[this.size++]=aI;};aE.prototype._$BL=function(){var aH=new Float32Array(this.size);P._$jT(this._$P,0,aH,0,this.size);return aH;};function t(){this._$4P=null;this._$I0=null;this._$RP=null;}t._$Fr=0;t._$hs=1;t._$ws=100;t._$Ns=101;t._$xs=102;t._$us=103;t._$qs=104;t._$Ys=105;function E(){if(j){return;}c.prototype.constructor.call(this);this._$o=0;this._$A=0;this._$GS=null;this._$Eo=null;}E.prototype=new c();E._$gT=new Array();E.prototype._$zP=function(){this._$GS=new g();this._$GS._$zP();};E.prototype._$F0=function(aH){c.prototype._$F0.call(this,aH);this._$A=aH._$6L();this._$o=aH._$6L();this._$GS=aH._$nP();this._$Eo=aH._$nP();c.prototype.readV2_opacity.call(this,aH);};E.prototype.init=function(aH){var aI=new H(this);var aJ=(this._$o+1)*(this._$A+1);if(aI._$Cr!=null){aI._$Cr=null;}aI._$Cr=new Float32Array(aJ*2);if(aI._$hr!=null){aI._$hr=null;}if(this._$32()){aI._$hr=new Float32Array(aJ*2);}else{aI._$hr=null;}return aI;};E.prototype._$Nr=function(aJ,aI){var aK=aI;if(!this._$GS._$Ur(aJ)){return;}var aL=this._$VT();var aH=E._$gT;aH[0]=false;aG._$Vr(aJ,this._$GS,aH,aL,this._$Eo,aK._$Cr,0,2);aI._$Ib(aH[0]);this.interpolateOpacity(aJ,this._$GS,aI,aH);};E.prototype._$2b=function(aK,aJ){var aL=aJ;aL._$hS(true);if(!this._$32()){aL.setTotalOpacity(aL.getInterpolatedOpacity());}else{var aH=this.getTargetBaseDataID();if(aL._$8r==c._$ur){aL._$8r=aK.getBaseDataIndex(aH);}if(aL._$8r<0){if(Q._$so){q._$li("_$L _$0P _$G :: %s",aH);}aL._$hS(false);}else{var aN=aK.getBaseData(aL._$8r);var aI=aK._$q2(aL._$8r);if(aN!=null&&aI._$yo()){var aM=aI.getTotalScale();aL.setTotalScale_notForClient(aM);var aO=aI.getTotalOpacity();aL.setTotalOpacity(aO*aL.getInterpolatedOpacity());aN._$nb(aK,aI,aL._$Cr,aL._$hr,this._$VT(),0,2);aL._$hS(true);}else{aL._$hS(false);}}}};E.prototype._$nb=function(aL,aI,aH,aM,aO,aK,aJ){if(true){var aN=aI;var aP=(aN._$hr!=null)?aN._$hr:aN._$Cr;E.transformPoints_sdk2(aH,aM,aO,aK,aJ,aP,this._$o,this._$A);}else{this.transformPoints_sdk1(aL,aI,aH,aM,aO,aK,aJ);}};E.transformPoints_sdk2=function(a0,bc,a5,aP,aI,aR,aQ,aU){var aW=a5*aI;var aV;var bn,bm;var aT=0;var aS=0;var bl=0;var bk=0;var bf=0;var be=0;var aZ=false;for(var ba=aP;ba=1){var aK=aR[((0)+(aU)*a1)*2];var aJ=aR[((0)+(aU)*a1)*2+1];var aO=aT-2*bl+1*bf;var aN=aS-2*bk+1*be;var a3=aT+3*bf;var a2=aS+3*be;var a8=aT-2*bl+3*bf;var a6=aS-2*bk+3*be;var bj=0.5*(a4-(-2));var bi=0.5*(aX-(1));if(bj+bi<=1){bc[ba]=aO+(aK-aO)*bj+(a8-aO)*bi;bc[ba+1]=aN+(aJ-aN)*bj+(a6-aN)*bi;}else{bc[ba]=a3+(a8-a3)*(1-bj)+(aK-a3)*(1-bi);bc[ba+1]=a2+(a6-a2)*(1-bj)+(aJ-a2)*(1-bi);}}else{var aH=(a7|0);if(aH==aU){aH=aU-1;}var bj=0.5*(a4-(-2));var bi=a7-aH;var bb=aH/aU;var a9=(aH+1)/aU;var aK=aR[((0)+(aH)*a1)*2];var aJ=aR[((0)+(aH)*a1)*2+1];var a3=aR[((0)+(aH+1)*a1)*2];var a2=aR[((0)+(aH+1)*a1)*2+1];var aO=aT-2*bl+bb*bf;var aN=aS-2*bk+bb*be;var a8=aT-2*bl+a9*bf;var a6=aS-2*bk+a9*be;if(bj+bi<=1){bc[ba]=aO+(aK-aO)*bj+(a8-aO)*bi;bc[ba+1]=aN+(aJ-aN)*bj+(a6-aN)*bi;}else{bc[ba]=a3+(a8-a3)*(1-bj)+(aK-a3)*(1-bi);bc[ba+1]=a2+(a6-a2)*(1-bj)+(aJ-a2)*(1-bi);}}}}else{if(1<=a4){if(aX<=0){var a8=aR[((aQ)+(0)*a1)*2];var a6=aR[((aQ)+(0)*a1)*2+1];var a3=aT+3*bl;var a2=aS+3*bk;var aO=aT+1*bl-2*bf;var aN=aS+1*bk-2*be;var aK=aT+3*bl-2*bf;var aJ=aS+3*bk-2*be;var bj=0.5*(a4-(1));var bi=0.5*(aX-(-2));if(bj+bi<=1){bc[ba]=aO+(aK-aO)*bj+(a8-aO)*bi;bc[ba+1]=aN+(aJ-aN)*bj+(a6-aN)*bi;}else{bc[ba]=a3+(a8-a3)*(1-bj)+(aK-a3)*(1-bi);bc[ba+1]=a2+(a6-a2)*(1-bj)+(aJ-a2)*(1-bi);}}else{if(aX>=1){var aO=aR[((aQ)+(aU)*a1)*2];var aN=aR[((aQ)+(aU)*a1)*2+1];var aK=aT+3*bl+1*bf;var aJ=aS+3*bk+1*be;var a8=aT+1*bl+3*bf;var a6=aS+1*bk+3*be;var a3=aT+3*bl+3*bf;var a2=aS+3*bk+3*be;var bj=0.5*(a4-(1));var bi=0.5*(aX-(1));if(bj+bi<=1){bc[ba]=aO+(aK-aO)*bj+(a8-aO)*bi;bc[ba+1]=aN+(aJ-aN)*bj+(a6-aN)*bi;}else{bc[ba]=a3+(a8-a3)*(1-bj)+(aK-a3)*(1-bi);bc[ba+1]=a2+(a6-a2)*(1-bj)+(aJ-a2)*(1-bi);}}else{var aH=(a7|0);if(aH==aU){aH=aU-1;}var bj=0.5*(a4-(1));var bi=a7-aH;var bb=aH/aU;var a9=(aH+1)/aU;var aO=aR[((aQ)+(aH)*a1)*2];var aN=aR[((aQ)+(aH)*a1)*2+1];var a8=aR[((aQ)+(aH+1)*a1)*2];var a6=aR[((aQ)+(aH+1)*a1)*2+1];var aK=aT+3*bl+bb*bf;var aJ=aS+3*bk+bb*be;var a3=aT+3*bl+a9*bf;var a2=aS+3*bk+a9*be;if(bj+bi<=1){bc[ba]=aO+(aK-aO)*bj+(a8-aO)*bi;bc[ba+1]=aN+(aJ-aN)*bj+(a6-aN)*bi;}else{bc[ba]=a3+(a8-a3)*(1-bj)+(aK-a3)*(1-bi);bc[ba+1]=a2+(a6-a2)*(1-bj)+(aJ-a2)*(1-bi);}}}}else{if(aX<=0){var aY=(bd|0);if(aY==aQ){aY=aQ-1;}var bj=bd-aY;var bi=0.5*(aX-(-2));var bp=aY/aQ;var bo=(aY+1)/aQ;var a8=aR[((aY)+(0)*a1)*2];var a6=aR[((aY)+(0)*a1)*2+1];var a3=aR[((aY+1)+(0)*a1)*2];var a2=aR[((aY+1)+(0)*a1)*2+1];var aO=aT+bp*bl-2*bf;var aN=aS+bp*bk-2*be;var aK=aT+bo*bl-2*bf;var aJ=aS+bo*bk-2*be;if(bj+bi<=1){bc[ba]=aO+(aK-aO)*bj+(a8-aO)*bi;bc[ba+1]=aN+(aJ-aN)*bj+(a6-aN)*bi;}else{bc[ba]=a3+(a8-a3)*(1-bj)+(aK-a3)*(1-bi);bc[ba+1]=a2+(a6-a2)*(1-bj)+(aJ-a2)*(1-bi);}}else{if(aX>=1){var aY=(bd|0);if(aY==aQ){aY=aQ-1;}var bj=bd-aY;var bi=0.5*(aX-(1));var bp=aY/aQ;var bo=(aY+1)/aQ;var aO=aR[((aY)+(aU)*a1)*2];var aN=aR[((aY)+(aU)*a1)*2+1];var aK=aR[((aY+1)+(aU)*a1)*2];var aJ=aR[((aY+1)+(aU)*a1)*2+1];var a8=aT+bp*bl+3*bf;var a6=aS+bp*bk+3*be;var a3=aT+bo*bl+3*bf;var a2=aS+bo*bk+3*be;if(bj+bi<=1){bc[ba]=aO+(aK-aO)*bj+(a8-aO)*bi;bc[ba+1]=aN+(aJ-aN)*bj+(a6-aN)*bi;}else{bc[ba]=a3+(a8-a3)*(1-bj)+(aK-a3)*(1-bi);bc[ba+1]=a2+(a6-a2)*(1-bj)+(aJ-a2)*(1-bi);}}else{System.err.printf("_$li calc : %.4f , %.4f @@BDBoxGrid\n",a4,aX);}}}}}else{bc[ba]=aT+a4*bl+aX*bf;bc[ba+1]=aS+a4*bk+aX*be;}}else{bn=bd-(bd|0);bm=a7-(a7|0);aV=2*((bd|0)+((a7|0))*(aQ+1));if(bn+bm<1){bc[ba]=aR[aV]*(1-bn-bm)+aR[aV+2]*bn+aR[aV+2*(aQ+1)]*bm;bc[ba+1]=aR[aV+1]*(1-bn-bm)+aR[aV+3]*bn+aR[aV+2*(aQ+1)+1]*bm;}else{bc[ba]=aR[aV+2*(aQ+1)+2]*(bn-1+bm)+aR[aV+2*(aQ+1)]*(1-bn)+aR[aV+2]*(1-bm);bc[ba+1]=aR[aV+2*(aQ+1)+3]*(bn-1+bm)+aR[aV+2*(aQ+1)+1]*(1-bn)+aR[aV+3]*(1-bm);}}}};E.prototype.transformPoints_sdk1=function(aJ,aR,aL,a0,aU,aP,aZ){var aH=aR;var aO,aN;var aM=this._$o;var aQ=this._$A;var aI=aU*aZ;var aS,aY;var aV;var aX,aW;var aT=(aH._$hr!=null)?aH._$hr:aH._$Cr;for(var aK=aP;aK1){aO=1;}}if(aN<0){aN=0;}else{if(aN>1){aN=1;}}aO*=aM;aN*=aQ;aS=(aO|0);aY=(aN|0);if(aS>aM-1){aS=aM-1;}if(aY>aQ-1){aY=aQ-1;}aX=aO-aS;aW=aN-aY;aV=2*(aS+aY*(aM+1));}else{aO=aL[aK]*aM;aN=aL[aK+1]*aQ;aX=aO-(aO|0);aW=aN-(aN|0);aV=2*((aO|0)+(aN|0)*(aM+1));}if(aX+aW<1){a0[aK]=aT[aV]*(1-aX-aW)+aT[aV+2]*aX+aT[aV+2*(aM+1)]*aW;a0[aK+1]=aT[aV+1]*(1-aX-aW)+aT[aV+3]*aX+aT[aV+2*(aM+1)+1]*aW;}else{a0[aK]=aT[aV+2*(aM+1)+2]*(aX-1+aW)+aT[aV+2*(aM+1)]*(1-aX)+aT[aV+2]*(1-aW);a0[aK+1]=aT[aV+2*(aM+1)+3]*(aX-1+aW)+aT[aV+2*(aM+1)+1]*(1-aX)+aT[aV+3]*(1-aW);}}};E.prototype._$VT=function(){return(this._$o+1)*(this._$A+1);};E.prototype.getType=function(){return c._$_b;};function H(aH){B.prototype.constructor.call(this,aH);this._$8r=c._$ur;this._$Cr=null;this._$hr=null;}H.prototype=new B();function s(){if(j){return;}this.visible=true;this._$g0=false;this._$NL=null;this._$3S=null;this._$aS=null;s._$42++;}s._$42=0;s.prototype._$zP=function(){this._$3S=new Array();this._$aS=new Array();};s.prototype._$F0=function(aH){this._$g0=aH._$8L();this.visible=aH._$8L();this._$NL=aH._$nP();this._$3S=aH._$nP();this._$aS=aH._$nP();};s.prototype.init=function(aI){var aH=new aj(this);aH.setPartsOpacity(this.isVisible()?1:0);return aH;};s.prototype._$6o=function(aH){if(this._$3S==null){throw new Error("_$3S _$6 _$Wo@_$6o");}this._$3S.push(aH);};s.prototype._$3o=function(aH){if(this._$aS==null){throw new Error("_$aS _$6 _$Wo@_$3o");}this._$aS.push(aH);};s.prototype._$Zo=function(aH){this._$3S=aH;};s.prototype._$xo=function(aH){this._$aS=aH;};s.prototype.isVisible=function(){return this.visible;};s.prototype._$uL=function(){return this._$g0;};s.prototype._$KP=function(aH){this.visible=aH;};s.prototype._$ET=function(aH){this._$g0=aH;};s.prototype.getBaseData=function(){return this._$3S;};s.prototype.getDrawData=function(){return this._$aS;};s.prototype._$p2=function(){return this._$NL;};s.prototype._$ob=function(aH){this._$NL=aH;};s.prototype.getPartsID=function(){return this._$NL;};s.prototype._$MP=function(aH){this._$NL=aH;};function aj(aH){this._$VS=null;this._$e0=null;this._$e0=aH;}aj.prototype=new S();aj.prototype.getPartsOpacity=function(){return this._$VS;};aj.prototype.setPartsOpacity=function(aH){this._$VS=aH;};function ak(aH){if(j){return;}this.id=aH;}ak._$L7=function(){z._$27();n._$27();Z._$27();i._$27();};ak.prototype.toString=function(){return this.id;};function D(){}D.prototype._$F0=function(aH){};function an(){if(j){return;}this._$4S=null;}an.prototype._$1s=function(){return this._$4S;};an.prototype._$zP=function(){this._$4S=new Array();};an.prototype._$F0=function(aH){this._$4S=aH._$nP();};an.prototype._$Ks=function(aH){this._$4S.push(aH);};function au(aH,aI){this.canvas=aH;this.context=aI;this.viewport=new Array(0,0,aH.width,aH.height);this._$6r=1;this._$xP=0;this._$3r=1;this._$uP=0;this._$Qo=-1;this.cacheImages={};}au.tr=new am();au._$50=new am();au._$Ti=new Array(0,0);au._$Pi=new Array(0,0);au._$B=new Array(0,0);au.prototype._$lP=function(aI,aK,aJ,aH){this.viewport=new Array(aI,aK,aJ,aH);};au.prototype._$bL=function(){this.context.save();var aH=this.viewport;if(aH!=null){this.context.beginPath();this.context._$Li(aH[0],aH[1],aH[2],aH[3]);this.context.clip();}};au.prototype._$ei=function(){this.context.restore();};au.prototype.drawElements=function(bc,bm,aX,aJ,bA,aM,bl,bz){try{if(bA!=this._$Qo){this._$Qo=bA;this.context.globalAlpha=bA;}var a2=bm.length;var aP=bc.width;var a5=bc.height;var bE=this.context;var a7=this._$xP;var a6=this._$uP;var a1=this._$6r;var aZ=this._$3r;var bD=au.tr;var aI=au._$Ti;var aH=au._$Pi;var bu=au._$B;for(var by=0;by0.02){au.expandClip(aK,aJ,aV,aI,aO,aN,aH,aW,aS,aR);}else{au.clipWithTransform(aK,null,aM,aL,aU,aT,aQ,aP);}};au.expandClip=function(aV,bg,aK,a3,aJ,aI,be,ba,aZ,aX){var aP=be-aJ;var aO=ba-aI;var bi=aZ-aJ;var bh=aX-aI;var bj=aP*bh-aO*bi>0?aK:-aK;var aL=-aO;var aH=aP;var bc=aZ-be;var a8=aX-ba;var a7=-a8;var a6=bc;var aQ=Math.sqrt(bc*bc+a8*a8);var bf=-bh;var bb=bi;var a2=Math.sqrt(bi*bi+bh*bh);var bd=aJ-bj*aL/a3;var a9=aI-bj*aH/a3;var aY=be-bj*aL/a3;var aW=ba-bj*aH/a3;var a5=be-bj*a7/aQ;var a4=ba-bj*a6/aQ;var aS=aZ-bj*a7/aQ;var aR=aX-bj*a6/aQ;var aN=aJ+bj*bf/a2;var aM=aI+bj*bb/a2;var a1=aZ+bj*bf/a2;var a0=aX+bj*bb/a2;var aU=au._$50;var aT=bg._$P2(aU);if(aT==null){return false;}au.clipWithTransform(aV,aU,bd,a9,aY,aW,a5,a4,aS,aR,a1,a0,aN,aM);return true;};au.clipWithTransform=function(aH,aI,aS,aN,aQ,aK,aP,aJ){if(arguments.length<(1+3*2)){q._$li("err : @LDGL.clip()");return;}if(!(arguments[1] instanceof am)){q._$li("err : a[0] is _$6 LDTransform @LDGL.clip()");return;}var aM=au._$B;var aO=aI;var aR=arguments;aH.beginPath();if(aO){aO._$PS(aR[2],aR[3],aM);aH.moveTo(aM[0],aM[1]);for(var aL=4;aL1){return 1;}}return(0.5-0.5*Math.cos(aH*aC.PI_F));};function J(aH){if(j){return;}this._$ib=aH;}J._$fr=-1;J.prototype.toString=function(){return this._$ib;};function b(){if(j){return;}a.prototype.constructor.call(this);this._$LP=-1;this._$d0=0;this._$Yo=0;this._$JP=null;this._$5P=null;this._$BP=null;this._$Eo=null;this._$Qi=null;this._$6s=b._$ms;this.culling=true;this.gl_cacheImage=null;this.instanceNo=b._$42++;}b.prototype=new a();b._$42=0;b._$Os=30;b._$ms=0;b._$ns=1;b._$_s=2;b._$gT=new Array();b.prototype._$_S=function(aH){this._$LP=aH;};b.prototype.getTextureNo=function(){return this._$LP;};b.prototype._$ZL=function(){return this._$Qi;};b.prototype._$H2=function(){return this._$JP;};b.prototype.getNumPoints=function(){return this._$d0;};b.prototype.getType=function(){return a._$wb;};b.prototype._$B2=function(aL,aH,aO){var aM=aH;var aN=(aM._$hr!=null)?aM._$hr:aM._$Cr;var aK=aw._$do;switch(aK){default:case aw._$Ms:throw new Error("_$L _$ro ");case aw._$Qs:for(var aJ=this._$d0-1;aJ>=0;--aJ){var aI=aJ*aw._$No;aN[aI+4]=aO;}break;}};b.prototype._$zP=function(){this._$GS=new g();this._$GS._$zP();};b.prototype._$F0=function(aK){a.prototype._$F0.call(this,aK);this._$LP=aK._$6L();this._$d0=aK._$6L();this._$Yo=aK._$6L();var aH=aK._$nP();this._$BP=new Int16Array(this._$Yo*3);for(var aJ=this._$Yo*3-1;aJ>=0;--aJ){this._$BP[aJ]=aH[aJ];}this._$Eo=aK._$nP();this._$Qi=aK._$nP();if(aK.getFormatVersion()>=ay._$s7){this._$JP=aK._$6L();if(this._$JP!=0){if((this._$JP&1)!=0){var aI=aK._$6L();if(this._$5P==null){this._$5P=new Object();}this._$5P._$Hb=parseInt(aI);}if((this._$JP&b._$Os)!=0){this._$6s=(this._$JP&b._$Os)>>1;}else{this._$6s=b._$ms;}if((this._$JP&32)!=0){this.culling=false;}}}else{this._$JP=0;}};b.prototype.init=function(aL){var aN=new ag(this);var aI=this._$d0*aw._$No;var aH=this._$32();if(aN._$Cr!=null){aN._$Cr=null;}aN._$Cr=new Float32Array(aI);if(aN._$hr!=null){aN._$hr=null;}aN._$hr=aH?new Float32Array(aI):null;var aM=aw._$do;switch(aM){default:case aw._$Ms:if(aw._$Ls){for(var aJ=this._$d0-1;aJ>=0;--aJ){var aO=aJ<<1;this._$Qi[aO+1]=1-this._$Qi[aO+1];}}break;case aw._$Qs:for(var aJ=this._$d0-1;aJ>=0;--aJ){var aO=aJ<<1;var aK=aJ*aw._$No;var aQ=this._$Qi[aO];var aP=this._$Qi[aO+1];aN._$Cr[aK]=aQ;aN._$Cr[aK+1]=aP;aN._$Cr[aK+4]=0;if(aH){aN._$hr[aK]=aQ;aN._$hr[aK+1]=aP;aN._$hr[aK+4]=0;}}break;}return aN;};b.prototype._$Nr=function(aJ,aH){var aK=aH;if(!((this==aK._$GT()))){console.log("### assert!! ### ");}if(!this._$GS._$Ur(aJ)){return;}a.prototype._$Nr.call(this,aJ,aK);if(aK._$IS[0]){return;}var aI=b._$gT;aI[0]=false;aG._$Vr(aJ,this._$GS,aI,this._$d0,this._$Eo,aK._$Cr,aw._$i2,aw._$No);};b.prototype._$2b=function(aK,aI){try{if(!((this==aI._$GT()))){console.log("### assert!! ### ");}var aL=false;if(aI._$IS[0]){aL=true;}var aM=aI;if(!aL){a.prototype._$2b.call(this,aK);if(this._$32()){var aH=this.getTargetBaseDataID();if(aM._$8r==a._$ur){aM._$8r=aK.getBaseDataIndex(aH);}if(aM._$8r<0){if(Q._$so){q._$li("_$L _$0P _$G :: %s",aH);}}else{var aO=aK.getBaseData(aM._$8r);var aJ=aK._$q2(aM._$8r);if(aO!=null&&!aJ._$x2()){aO._$nb(aK,aJ,aM._$Cr,aM._$hr,this._$d0,aw._$i2,aw._$No);aM._$AT=true;}else{aM._$AT=false;}aM.baseOpacity=aJ.getTotalOpacity();}}}}catch(aN){throw aN;}};b.prototype.draw=function(aN,aK,aI){if(!((this==aI._$GT()))){console.log("### assert!! ### ");}if(aI._$IS[0]){return;}var aL=aI;var aJ=this._$LP;if(aJ<0){aJ=1;}var aH=this.getOpacity(aK,aL)*aI._$VS*aI.baseOpacity;var aM=(aL._$hr!=null)?aL._$hr:aL._$Cr;aN.setClipBufPre_clipContextForDraw(aI.clipBufPre_clipContext);aN._$WP(this.culling);aN._$Uo(aJ,3*this._$Yo,this._$BP,aM,this._$Qi,aH,this._$6s,aL);};b.prototype.dump=function(){console.log(" _$yi( %d ) , _$d0( %d ) , _$Yo( %d ) \n",this._$LP,this._$d0,this._$Yo);console.log(" _$Oi _$di = { ");for(var aJ=0;aJstartMotion() / start _$K _$3 (m%d)\n",aH,aL._$sr);}}if(aJ==null){return -1;}aL=new M();aL._$w0=aJ;this.motions.push(aL);var aN=aL._$sr;if(this._$eb){q._$Ji("MotionQueueManager[size:%2d]->startMotion() / new _$w0 (m%d)\n",aH,aN);}return aN;};V.prototype.updateParam=function(aJ){try{var aI=false;for(var aK=0;aKupdateParam() / _$T0 _$w0 (m%d)\n",this.motions.length-1,aL._$sr);}this.motions.splice(aK,1);aK--;}else{}}return aI;}catch(aM){q._$li(aM);return true;}};V.prototype.isFinished=function(aK){if(arguments.length>=1){for(var aI=0;aI0.9?Q.EXPAND_W:0;var a0=this.gl;if(this.gl==null){throw new Error("gl is null");}var a1=false;var aQ=1;var aP=1;var a3=1;var aZ=1;var aW=this._$C0*aP*aN;var a2=this._$tT*a3*aN;var a5=this._$WL*aZ*aN;var a7=this._$lT*aN;if(this.clipBufPre_clipContextMask!=null){a0.frontFace(a0.CCW);a0.useProgram(this.shaderProgram);this._$vS=T(a0,this._$vS,aU);this._$no=L(a0,this._$no,aL);a0.enableVertexAttribArray(this.a_position_Loc);a0.vertexAttribPointer(this.a_position_Loc,2,a0.FLOAT,false,0,0);this._$NT=T(a0,this._$NT,aV);a0.activeTexture(a0.TEXTURE1);a0.bindTexture(a0.TEXTURE_2D,this.textures[aS]);a0.uniform1i(this.s_texture0_Loc,1);a0.enableVertexAttribArray(this.a_texCoord_Loc);a0.vertexAttribPointer(this.a_texCoord_Loc,2,a0.FLOAT,false,0,0);a0.uniformMatrix4fv(this.u_matrix_Loc,false,this.getClipBufPre_clipContextMask().matrixForMask);var aY=this.getClipBufPre_clipContextMask().layoutChannelNo;var a4=this.getChannelFlagAsColor(aY);a0.uniform4f(this.u_channelFlag,a4.r,a4.g,a4.b,a4.a);var aI=this.getClipBufPre_clipContextMask().layoutBounds;a0.uniform4f(this.u_baseColor_Loc,aI.x*2-1,aI.y*2-1,aI._$EL()*2-1,aI._$5T()*2-1);a0.uniform1i(this.u_maskFlag_Loc,true);}else{a1=this.getClipBufPre_clipContextDraw()!=null;if(a1){a0.useProgram(this.shaderProgramOff);this._$vS=T(a0,this._$vS,aU);this._$no=L(a0,this._$no,aL);a0.enableVertexAttribArray(this.a_position_Loc_Off);a0.vertexAttribPointer(this.a_position_Loc_Off,2,a0.FLOAT,false,0,0);this._$NT=T(a0,this._$NT,aV);a0.activeTexture(a0.TEXTURE1);a0.bindTexture(a0.TEXTURE_2D,this.textures[aS]);a0.uniform1i(this.s_texture0_Loc_Off,1);a0.enableVertexAttribArray(this.a_texCoord_Loc_Off);a0.vertexAttribPointer(this.a_texCoord_Loc_Off,2,a0.FLOAT,false,0,0);a0.uniformMatrix4fv(this.u_clipMatrix_Loc_Off,false,this.getClipBufPre_clipContextDraw().matrixForDraw);a0.uniformMatrix4fv(this.u_matrix_Loc_Off,false,this.matrix4x4);a0.activeTexture(a0.TEXTURE2);a0.bindTexture(a0.TEXTURE_2D,Q.fTexture[this.glno]);a0.uniform1i(this.s_texture1_Loc_Off,2);var aY=this.getClipBufPre_clipContextDraw().layoutChannelNo;var a4=this.getChannelFlagAsColor(aY);a0.uniform4f(this.u_channelFlag_Loc_Off,a4.r,a4.g,a4.b,a4.a);a0.uniform4f(this.u_baseColor_Loc_Off,aW,a2,a5,a7);}else{a0.useProgram(this.shaderProgram);this._$vS=T(a0,this._$vS,aU);this._$no=L(a0,this._$no,aL);a0.enableVertexAttribArray(this.a_position_Loc);a0.vertexAttribPointer(this.a_position_Loc,2,a0.FLOAT,false,0,0);this._$NT=T(a0,this._$NT,aV);a0.activeTexture(a0.TEXTURE1);a0.bindTexture(a0.TEXTURE_2D,this.textures[aS]);a0.uniform1i(this.s_texture0_Loc,1);a0.enableVertexAttribArray(this.a_texCoord_Loc);a0.vertexAttribPointer(this.a_texCoord_Loc,2,a0.FLOAT,false,0,0);a0.uniformMatrix4fv(this.u_matrix_Loc,false,this.matrix4x4);a0.uniform4f(this.u_baseColor_Loc,aW,a2,a5,a7);a0.uniform1i(this.u_maskFlag_Loc,false);}}if(this.culling){this.gl.enable(a0.CULL_FACE);}else{this.gl.disable(a0.CULL_FACE);}this.gl.enable(a0.BLEND);var a6;var aX;var aR;var aK;if(this.clipBufPre_clipContextMask!=null){a6=a0.ONE;aX=a0.ONE_MINUS_SRC_ALPHA;aR=a0.ONE;aK=a0.ONE_MINUS_SRC_ALPHA;}else{switch(aM){case b._$ms:a6=a0.ONE;aX=a0.ONE_MINUS_SRC_ALPHA;aR=a0.ONE;aK=a0.ONE_MINUS_SRC_ALPHA;break;case b._$ns:a6=a0.ONE;aX=a0.ONE;aR=a0.ZERO;aK=a0.ONE;break;case b._$_s:a6=a0.DST_COLOR;aX=a0.ONE_MINUS_SRC_ALPHA;aR=a0.ZERO;aK=a0.ONE;break;}}a0.blendEquationSeparate(a0.FUNC_ADD,a0.FUNC_ADD);a0.blendFuncSeparate(a6,aX,aR,aK);if(this.anisotropyExt){a0.texParameteri(a0.TEXTURE_2D,this.anisotropyExt.TEXTURE_MAX_ANISOTROPY_EXT,this.maxAnisotropy);}var aJ=aL.length;a0.drawElements(a0.TRIANGLES,aJ,a0.UNSIGNED_SHORT,0);a0.bindTexture(a0.TEXTURE_2D,null);};function T(aJ,aH,aI){if(aH==null){aH=aJ.createBuffer();}aJ.bindBuffer(aJ.ARRAY_BUFFER,aH);aJ.bufferData(aJ.ARRAY_BUFFER,aI,aJ.DYNAMIC_DRAW);return aH;}function L(aJ,aH,aI){if(aH==null){aH=aJ.createBuffer();}aJ.bindBuffer(aJ.ELEMENT_ARRAY_BUFFER,aH);aJ.bufferData(aJ.ELEMENT_ARRAY_BUFFER,aI,aJ.DYNAMIC_DRAW);return aH;}C.prototype._$Rs=function(){throw new Error("_$Rs");};C.prototype._$Ds=function(aH){throw new Error("_$Ds");};C.prototype._$K2=function(){for(var aH=0;aH=48){var aL=ay._$9o(aN);if(aL!=null){aL._$F0(this);return aL;}else{return null;}}switch(aN){case 1:return this._$bT();case 10:var aM=this._$6L();return new I(aM,true);case 11:return new av(this._$mP(),this._$mP(),this._$mP(),this._$mP());case 12:return new av(this._$_T(),this._$_T(),this._$_T(),this._$_T());case 13:return new e(this._$mP(),this._$mP());case 14:return new e(this._$_T(),this._$_T());case 15:var aH=this._$3L();var aI=new Array(aH);for(var aJ=0;aJ>(7-this._$hL++))&1)==1;};K.prototype._$zT=function(){if(this._$hL!=0){this._$hL=0;}};function ai(){}ai.prototype._$wP=function(aM,aI,aK){for(var aL=0;aLMath.PI){aJ-=2*Math.PI;}return aJ;};aC._$9=function(aH){return Math.sin(aH);};aC.fcos=function(aH){return Math.cos(aH);};function aB(aH){if(j){return;}this._$e0=null;this._$IP=null;this._$Us=null;this._$7s=null;this._$IS=[false];this._$VS=null;this._$AT=true;this.baseOpacity=1;this.clipBufPre_clipContext=null;this._$e0=aH;}aB.prototype._$u2=function(){return this._$IS[0];};aB.prototype._$yo=function(){return this._$AT&&!this._$IS[0];};aB.prototype._$GT=function(){return this._$e0;};function r(){}r._$W2=0;r.SYSTEM_INFO=null;r.USER_AGENT=navigator.userAgent;r.isIPhone=function(){if(!r.SYSTEM_INFO){r.setup();}return r.SYSTEM_INFO._isIPhone;};r.isIOS=function(){if(!r.SYSTEM_INFO){r.setup();}return r.SYSTEM_INFO._isIPhone||r.SYSTEM_INFO._isIPad;};r.isAndroid=function(){if(!r.SYSTEM_INFO){r.setup();}return r.SYSTEM_INFO._isAndroid;};r.getOSVersion=function(){if(!r.SYSTEM_INFO){r.setup();}return r.SYSTEM_INFO.version;};r.getOS=function(){if(!r.SYSTEM_INFO){r.setup();}if(r.SYSTEM_INFO._isIPhone||r.SYSTEM_INFO._isIPad){return"iOS";}if(r.SYSTEM_INFO._isAndroid){return"Android";}else{return"_$Q0 OS";}};r.setup=function(){var aK=r.USER_AGENT;function aI(aO,aR){var aN=aO.substring(aR).split(/[ _,;\.]/);var aQ=0;for(var aM=0;aM<=2;aM++){if(isNaN(aN[aM])){break;}var aP=parseInt(aN[aM]);if(aP<0||aP>999){q._$li("err : "+aP+" @UtHtml5.setup()");aQ=0;break;}aQ+=aP*Math.pow(1000,(2-aM));}return aQ;}var aL;var aH;var aJ=r.SYSTEM_INFO={userAgent:aK};if((aL=aK.indexOf("iPhone OS "))>=0){aJ.os="iPhone";aJ._isIPhone=true;aJ.version=aI(aK,aL+"iPhone OS ".length);}else{if((aL=aK.indexOf("iPad"))>=0){aL=aK.indexOf("CPU OS");if(aL<0){q._$li(" err : "+aK+" @UtHtml5.setup()");return;}aJ.os="iPad";aJ._isIPad=true;aJ.version=aI(aK,aL+"CPU OS ".length);}else{if((aL=aK.indexOf("Android"))>=0){aJ.os="Android";aJ._isAndroid=true;aJ.version=aI(aK,aL+"Android ".length);}else{aJ.os="-";aJ.version=-1;}}}};window.UtSystem=P;window.UtDebug=q;window.LDTransform=am;window.LDGL=au;window.Live2D=Q;window.Live2DModelWebGL=l;window.Live2DModelJS=v;window.Live2DMotion=ao;window.MotionQueueManager=V;window.PhysicsHair=u;window.AMotion=ah;window.PartsDataID=i;window.DrawDataID=Z;window.BaseDataID=n;window.ParamID=z;Q.init();var j=false;})();
\ No newline at end of file
diff --git a/packages/live2d/src/libs/live2dcubismcore.min.js b/packages/live2d/src/libs/live2dcubismcore.min.js
new file mode 100644
index 0000000..036b654
--- /dev/null
+++ b/packages/live2d/src/libs/live2dcubismcore.min.js
@@ -0,0 +1,9 @@
+/**
+ * Live2D Cubism Core
+ * (C) 2019 Live2D Inc. All rights reserved.
+ *
+ * This file is licensed pursuant to the license agreement below.
+ * This file corresponds to the "Redistributable Code" in the agreement.
+ * https://www.live2d.com/eula/live2d-proprietary-software-license-agreement_en.html
+ */
+var Live2DCubismCore;!function(Live2DCubismCore){var _scriptDir,_csm=function(){function _csm(){}return _csm.getVersion=function(){return _em.ccall("csmGetVersion","number",[],[])},_csm.getLatestMocVersion=function(){return _em.ccall("csmGetLatestMocVersion","number",[],[])},_csm.getMocVersion=function(moc,mocSize){return _em.ccall("csmGetMocVersion","number",["number","number"],[moc,mocSize])},_csm.getLogFunction=function(){return _em.ccall("csmGetLogFunction","number",[],[])},_csm.getSizeofModel=function(moc){return _em.ccall("csmGetSizeofModel","number",["number"],[moc])},_csm.reviveMocInPlace=function(memory,mocSize){return _em.ccall("csmReviveMocInPlace","number",["number","number"],[memory,mocSize])},_csm.initializeModelInPlace=function(moc,memory,modelSize){return _em.ccall("csmInitializeModelInPlace","number",["number","number","number"],[moc,memory,modelSize])},_csm.hasMocConsistency=function(memory,mocSize){return _em.ccall("csmHasMocConsistency","number",["number","number"],[memory,mocSize])},_csm.getParameterCount=function(model){return _em.ccall("csmGetParameterCount","number",["number"],[model])},_csm.getParameterIds=function(model){return _em.ccall("csmGetParameterIds","number",["number"],[model])},_csm.getParameterMinimumValues=function(model){return _em.ccall("csmGetParameterMinimumValues","number",["number"],[model])},_csm.getParameterTypes=function(model){return _em.ccall("csmGetParameterTypes","number",["number"],[model])},_csm.getParameterMaximumValues=function(model){return _em.ccall("csmGetParameterMaximumValues","number",["number"],[model])},_csm.getParameterDefaultValues=function(model){return _em.ccall("csmGetParameterDefaultValues","number",["number"],[model])},_csm.getParameterValues=function(model){return _em.ccall("csmGetParameterValues","number",["number"],[model])},_csm.getParameterKeyCounts=function(model){return _em.ccall("csmGetParameterKeyCounts","number",["number"],[model])},_csm.getParameterKeyValues=function(model){return _em.ccall("csmGetParameterKeyValues","number",["number"],[model])},_csm.getPartCount=function(model){return _em.ccall("csmGetPartCount","number",["number"],[model])},_csm.getPartIds=function(model){return _em.ccall("csmGetPartIds","number",["number"],[model])},_csm.getPartOpacities=function(model){return _em.ccall("csmGetPartOpacities","number",["number"],[model])},_csm.getPartParentPartIndices=function(model){return _em.ccall("csmGetPartParentPartIndices","number",["number"],[model])},_csm.getDrawableCount=function(model){return _em.ccall("csmGetDrawableCount","number",["number"],[model])},_csm.getDrawableIds=function(model){return _em.ccall("csmGetDrawableIds","number",["number"],[model])},_csm.getDrawableConstantFlags=function(model){return _em.ccall("csmGetDrawableConstantFlags","number",["number"],[model])},_csm.getDrawableDynamicFlags=function(model){return _em.ccall("csmGetDrawableDynamicFlags","number",["number"],[model])},_csm.getDrawableTextureIndices=function(model){return _em.ccall("csmGetDrawableTextureIndices","number",["number"],[model])},_csm.getDrawableDrawOrders=function(model){return _em.ccall("csmGetDrawableDrawOrders","number",["number"],[model])},_csm.getDrawableRenderOrders=function(model){return _em.ccall("csmGetDrawableRenderOrders","number",["number"],[model])},_csm.getDrawableOpacities=function(model){return _em.ccall("csmGetDrawableOpacities","number",["number"],[model])},_csm.getDrawableMaskCounts=function(model){return _em.ccall("csmGetDrawableMaskCounts","number",["number"],[model])},_csm.getDrawableMasks=function(model){return _em.ccall("csmGetDrawableMasks","number",["number"],[model])},_csm.getDrawableVertexCounts=function(model){return _em.ccall("csmGetDrawableVertexCounts","number",["number"],[model])},_csm.getDrawableVertexPositions=function(model){return _em.ccall("csmGetDrawableVertexPositions","number",["number"],[model])},_csm.getDrawableVertexUvs=function(model){return _em.ccall("csmGetDrawableVertexUvs","number",["number"],[model])},_csm.getDrawableIndexCounts=function(model){return _em.ccall("csmGetDrawableIndexCounts","number",["number"],[model])},_csm.getDrawableIndices=function(model){return _em.ccall("csmGetDrawableIndices","number",["number"],[model])},_csm.getDrawableMultiplyColors=function(model){return _em.ccall("csmGetDrawableMultiplyColors","number",["number"],[model])},_csm.getDrawableScreenColors=function(model){return _em.ccall("csmGetDrawableScreenColors","number",["number"],[model])},_csm.getDrawableParentPartIndices=function(model){return _em.ccall("csmGetDrawableParentPartIndices","number",["number"],[model])},_csm.mallocMoc=function(mocSize){return _em.ccall("csmMallocMoc","number",["number"],[mocSize])},_csm.mallocModelAndInitialize=function(moc){return _em.ccall("csmMallocModelAndInitialize","number",["number"],[moc])},_csm.malloc=function(size){return _em.ccall("csmMalloc","number",["number"],[size])},_csm.setLogFunction=function(handler){_em.ccall("csmSetLogFunction",null,["number"],[handler])},_csm.updateModel=function(model){_em.ccall("csmUpdateModel",null,["number"],[model])},_csm.readCanvasInfo=function(model,outSizeInPixels,outOriginInPixels,outPixelsPerUnit){_em.ccall("csmReadCanvasInfo",null,["number","number","number","number"],[model,outSizeInPixels,outOriginInPixels,outPixelsPerUnit])},_csm.resetDrawableDynamicFlags=function(model){_em.ccall("csmResetDrawableDynamicFlags",null,["number"],[model])},_csm.free=function(memory){_em.ccall("csmFree",null,["number"],[memory])},_csm.initializeAmountOfMemory=function(size){_em.ccall("csmInitializeAmountOfMemory",null,["number"],[size])},_csm}(),Version=(Live2DCubismCore.AlignofMoc=64,Live2DCubismCore.AlignofModel=16,Live2DCubismCore.MocVersion_Unknown=0,Live2DCubismCore.MocVersion_30=1,Live2DCubismCore.MocVersion_33=2,Live2DCubismCore.MocVersion_40=3,Live2DCubismCore.MocVersion_42=4,Live2DCubismCore.MocVersion_50=5,Live2DCubismCore.ParameterType_Normal=0,Live2DCubismCore.ParameterType_BlendShape=1,function(){function Version(){}return Version.csmGetVersion=function(){return _csm.getVersion()},Version.csmGetLatestMocVersion=function(){return _csm.getLatestMocVersion()},Version.csmGetMocVersion=function(moc,mocBytes){return _csm.getMocVersion(moc._ptr,mocBytes.byteLength)},Version}()),Version=(Live2DCubismCore.Version=Version,function(){function Logging(){}return Logging.csmSetLogFunction=function(handler){Logging.logFunction=handler;handler=_em.addFunction(Logging.wrapLogFunction,"vi");_csm.setLogFunction(handler)},Logging.csmGetLogFunction=function(){return Logging.logFunction},Logging.wrapLogFunction=function(messagePtr){messagePtr=_em.UTF8ToString(messagePtr);Logging.logFunction(messagePtr)},Logging}()),Version=(Live2DCubismCore.Logging=Version,function(){function Moc(mocBytes){var memory=_csm.mallocMoc(mocBytes.byteLength);memory&&(new Uint8Array(_em.HEAPU8.buffer,memory,mocBytes.byteLength).set(new Uint8Array(mocBytes)),this._ptr=_csm.reviveMocInPlace(memory,mocBytes.byteLength),this._ptr||_csm.free(memory))}return Moc.prototype.hasMocConsistency=function(mocBytes){var memory=_csm.mallocMoc(mocBytes.byteLength);if(memory)return new Uint8Array(_em.HEAPU8.buffer,memory,mocBytes.byteLength).set(new Uint8Array(mocBytes)),mocBytes=_csm.hasMocConsistency(memory,mocBytes.byteLength),_csm.free(memory),mocBytes},Moc.fromArrayBuffer=function(buffer){return buffer&&(buffer=new Moc(buffer))._ptr?buffer:null},Moc.prototype._release=function(){_csm.free(this._ptr),this._ptr=0},Moc}()),Version=(Live2DCubismCore.Moc=Version,function(){function Model(moc){this._ptr=_csm.mallocModelAndInitialize(moc._ptr),this._ptr&&(this.parameters=new Parameters(this._ptr),this.parts=new Parts(this._ptr),this.drawables=new Drawables(this._ptr),this.canvasinfo=new CanvasInfo(this._ptr))}return Model.fromMoc=function(moc){moc=new Model(moc);return moc._ptr?moc:null},Model.prototype.update=function(){_csm.updateModel(this._ptr)},Model.prototype.release=function(){_csm.free(this._ptr),this._ptr=0},Model}()),CanvasInfo=(Live2DCubismCore.Model=Version,function(modelPtr){var _canvasSize_data,_canvasSize_dataPtr,_canvasSize_nDataBytes,_canvasOrigin_dataPtr,_canvasOrigin_nDataBytes,_canvasPPU_nDataBytes,_canvasPPU_dataPtr;modelPtr&&(_canvasSize_nDataBytes=(_canvasSize_data=new Float32Array(2)).length*_canvasSize_data.BYTES_PER_ELEMENT,_canvasSize_dataPtr=_csm.malloc(_canvasSize_nDataBytes),(_canvasSize_dataPtr=new Uint8Array(_em.HEAPU8.buffer,_canvasSize_dataPtr,_canvasSize_nDataBytes)).set(new Uint8Array(_canvasSize_data.buffer)),_canvasOrigin_nDataBytes=(_canvasSize_nDataBytes=new Float32Array(2)).length*_canvasSize_nDataBytes.BYTES_PER_ELEMENT,_canvasOrigin_dataPtr=_csm.malloc(_canvasOrigin_nDataBytes),(_canvasOrigin_dataPtr=new Uint8Array(_em.HEAPU8.buffer,_canvasOrigin_dataPtr,_canvasOrigin_nDataBytes)).set(new Uint8Array(_canvasSize_nDataBytes.buffer)),_canvasPPU_nDataBytes=(_canvasOrigin_nDataBytes=new Float32Array(1)).length*_canvasOrigin_nDataBytes.BYTES_PER_ELEMENT,_canvasPPU_dataPtr=_csm.malloc(_canvasPPU_nDataBytes),(_canvasPPU_dataPtr=new Uint8Array(_em.HEAPU8.buffer,_canvasPPU_dataPtr,_canvasPPU_nDataBytes)).set(new Uint8Array(_canvasOrigin_nDataBytes.buffer)),_csm.readCanvasInfo(modelPtr,_canvasSize_dataPtr.byteOffset,_canvasOrigin_dataPtr.byteOffset,_canvasPPU_dataPtr.byteOffset),_canvasSize_data=new Float32Array(_canvasSize_dataPtr.buffer,_canvasSize_dataPtr.byteOffset,_canvasSize_dataPtr.length),_canvasSize_nDataBytes=new Float32Array(_canvasOrigin_dataPtr.buffer,_canvasOrigin_dataPtr.byteOffset,_canvasOrigin_dataPtr.length),_canvasOrigin_nDataBytes=new Float32Array(_canvasPPU_dataPtr.buffer,_canvasPPU_dataPtr.byteOffset,_canvasPPU_dataPtr.length),this.CanvasWidth=_canvasSize_data[0],this.CanvasHeight=_canvasSize_data[1],this.CanvasOriginX=_canvasSize_nDataBytes[0],this.CanvasOriginY=_canvasSize_nDataBytes[1],this.PixelsPerUnit=_canvasOrigin_nDataBytes[0],_csm.free(_canvasSize_dataPtr.byteOffset),_csm.free(_canvasOrigin_dataPtr.byteOffset),_csm.free(_canvasPPU_dataPtr.byteOffset))}),Parameters=(Live2DCubismCore.CanvasInfo=CanvasInfo,function(modelPtr){this.count=_csm.getParameterCount(modelPtr),length=_csm.getParameterCount(modelPtr),this.ids=new Array(length);for(var length,length2,_ids=new Uint32Array(_em.HEAPU32.buffer,_csm.getParameterIds(modelPtr),length),i=0;i<_ids.length;i++)this.ids[i]=_em.UTF8ToString(_ids[i]);length=_csm.getParameterCount(modelPtr),this.minimumValues=new Float32Array(_em.HEAPF32.buffer,_csm.getParameterMinimumValues(modelPtr),length),length=_csm.getParameterCount(modelPtr),this.types=new Int32Array(_em.HEAP32.buffer,_csm.getParameterTypes(modelPtr),length),length=_csm.getParameterCount(modelPtr),this.maximumValues=new Float32Array(_em.HEAPF32.buffer,_csm.getParameterMaximumValues(modelPtr),length),length=_csm.getParameterCount(modelPtr),this.defaultValues=new Float32Array(_em.HEAPF32.buffer,_csm.getParameterDefaultValues(modelPtr),length),length=_csm.getParameterCount(modelPtr),this.values=new Float32Array(_em.HEAPF32.buffer,_csm.getParameterValues(modelPtr),length),length=_csm.getParameterCount(modelPtr),this.keyCounts=new Int32Array(_em.HEAP32.buffer,_csm.getParameterKeyCounts(modelPtr),length),length=_csm.getParameterCount(modelPtr),length2=new Int32Array(_em.HEAP32.buffer,_csm.getParameterKeyCounts(modelPtr),length),this.keyValues=new Array(length);for(var _keyValues=new Uint32Array(_em.HEAPU32.buffer,_csm.getParameterKeyValues(modelPtr),length),i=0;i<_keyValues.length;i++)this.keyValues[i]=new Float32Array(_em.HEAPF32.buffer,_keyValues[i],length2[i])}),Parts=(Live2DCubismCore.Parameters=Parameters,function(modelPtr){this.count=_csm.getPartCount(modelPtr),length=_csm.getPartCount(modelPtr),this.ids=new Array(length);for(var length,_ids=new Uint32Array(_em.HEAPU32.buffer,_csm.getPartIds(modelPtr),length),i=0;i<_ids.length;i++)this.ids[i]=_em.UTF8ToString(_ids[i]);length=_csm.getPartCount(modelPtr),this.opacities=new Float32Array(_em.HEAPF32.buffer,_csm.getPartOpacities(modelPtr),length),length=_csm.getPartCount(modelPtr),this.parentIndices=new Int32Array(_em.HEAP32.buffer,_csm.getPartParentPartIndices(modelPtr),length)}),Drawables=(Live2DCubismCore.Parts=Parts,function(){function Drawables(modelPtr){this._modelPtr=modelPtr;for(var length,length2=null,_ids=(this.count=_csm.getDrawableCount(modelPtr),length=_csm.getDrawableCount(modelPtr),this.ids=new Array(length),new Uint32Array(_em.HEAPU32.buffer,_csm.getDrawableIds(modelPtr),length)),i=0;i<_ids.length;i++)this.ids[i]=_em.UTF8ToString(_ids[i]);length=_csm.getDrawableCount(modelPtr),this.constantFlags=new Uint8Array(_em.HEAPU8.buffer,_csm.getDrawableConstantFlags(modelPtr),length),length=_csm.getDrawableCount(modelPtr),this.dynamicFlags=new Uint8Array(_em.HEAPU8.buffer,_csm.getDrawableDynamicFlags(modelPtr),length),length=_csm.getDrawableCount(modelPtr),this.textureIndices=new Int32Array(_em.HEAP32.buffer,_csm.getDrawableTextureIndices(modelPtr),length),length=_csm.getDrawableCount(modelPtr),this.drawOrders=new Int32Array(_em.HEAP32.buffer,_csm.getDrawableDrawOrders(modelPtr),length),length=_csm.getDrawableCount(modelPtr),this.renderOrders=new Int32Array(_em.HEAP32.buffer,_csm.getDrawableRenderOrders(modelPtr),length),length=_csm.getDrawableCount(modelPtr),this.opacities=new Float32Array(_em.HEAPF32.buffer,_csm.getDrawableOpacities(modelPtr),length),length=_csm.getDrawableCount(modelPtr),this.maskCounts=new Int32Array(_em.HEAP32.buffer,_csm.getDrawableMaskCounts(modelPtr),length),length=_csm.getDrawableCount(modelPtr),this.vertexCounts=new Int32Array(_em.HEAP32.buffer,_csm.getDrawableVertexCounts(modelPtr),length),length=_csm.getDrawableCount(modelPtr),this.indexCounts=new Int32Array(_em.HEAP32.buffer,_csm.getDrawableIndexCounts(modelPtr),length),length=_csm.getDrawableCount(modelPtr),this.multiplyColors=new Float32Array(_em.HEAPF32.buffer,_csm.getDrawableMultiplyColors(modelPtr),4*length),length=_csm.getDrawableCount(modelPtr),this.screenColors=new Float32Array(_em.HEAPF32.buffer,_csm.getDrawableScreenColors(modelPtr),4*length),length=_csm.getDrawableCount(modelPtr),this.parentPartIndices=new Int32Array(_em.HEAP32.buffer,_csm.getDrawableParentPartIndices(modelPtr),length),length=_csm.getDrawableCount(modelPtr),length2=new Int32Array(_em.HEAP32.buffer,_csm.getDrawableMaskCounts(modelPtr),length),this.masks=new Array(length);for(var _masks=new Uint32Array(_em.HEAPU32.buffer,_csm.getDrawableMasks(modelPtr),length),i=0;i<_masks.length;i++)this.masks[i]=new Int32Array(_em.HEAP32.buffer,_masks[i],length2[i]);length=_csm.getDrawableCount(modelPtr),length2=new Int32Array(_em.HEAP32.buffer,_csm.getDrawableVertexCounts(modelPtr),length),this.vertexPositions=new Array(length);for(var _vertexPositions=new Uint32Array(_em.HEAPU32.buffer,_csm.getDrawableVertexPositions(modelPtr),length),i=0;i<_vertexPositions.length;i++)this.vertexPositions[i]=new Float32Array(_em.HEAPF32.buffer,_vertexPositions[i],2*length2[i]);length=_csm.getDrawableCount(modelPtr),length2=new Int32Array(_em.HEAP32.buffer,_csm.getDrawableVertexCounts(modelPtr),length),this.vertexUvs=new Array(length);for(var _vertexUvs=new Uint32Array(_em.HEAPU32.buffer,_csm.getDrawableVertexUvs(modelPtr),length),i=0;i<_vertexUvs.length;i++)this.vertexUvs[i]=new Float32Array(_em.HEAPF32.buffer,_vertexUvs[i],2*length2[i]);length=_csm.getDrawableCount(modelPtr),length2=new Int32Array(_em.HEAP32.buffer,_csm.getDrawableIndexCounts(modelPtr),length),this.indices=new Array(length);for(var _indices=new Uint32Array(_em.HEAPU32.buffer,_csm.getDrawableIndices(modelPtr),length),i=0;i<_indices.length;i++)this.indices[i]=new Uint16Array(_em.HEAPU16.buffer,_indices[i],length2[i])}return Drawables.prototype.resetDynamicFlags=function(){_csm.resetDrawableDynamicFlags(this._modelPtr)},Drawables}()),Version=(Live2DCubismCore.Drawables=Drawables,function(){function Utils(){}return Utils.hasBlendAdditiveBit=function(bitfield){return 1==(1&bitfield)},Utils.hasBlendMultiplicativeBit=function(bitfield){return 2==(2&bitfield)},Utils.hasIsDoubleSidedBit=function(bitfield){return 4==(4&bitfield)},Utils.hasIsInvertedMaskBit=function(bitfield){return 8==(8&bitfield)},Utils.hasIsVisibleBit=function(bitfield){return 1==(1&bitfield)},Utils.hasVisibilityDidChangeBit=function(bitfield){return 2==(2&bitfield)},Utils.hasOpacityDidChangeBit=function(bitfield){return 4==(4&bitfield)},Utils.hasDrawOrderDidChangeBit=function(bitfield){return 8==(8&bitfield)},Utils.hasRenderOrderDidChangeBit=function(bitfield){return 16==(16&bitfield)},Utils.hasVertexPositionsDidChangeBit=function(bitfield){return 32==(32&bitfield)},Utils.hasBlendColorDidChangeBit=function(bitfield){return 64==(64&bitfield)},Utils}()),Version=(Live2DCubismCore.Utils=Version,function(){function Memory(){}return Memory.initializeAmountOfMemory=function(size){16777216>2]+(Ln<<5)|0)>>2],Pn=q[a+60>>2]+w(Wn,24)|0,Ln=(ko=q[Pn+8>>2])+-1|0,xo=(qo=q[Pn+4>>2])+-1|0,yo=uo=(Wn=q[q[a+152>>2]+(Wn<<2)>>2])+(ko<<3)|0,zo=vo=Wn+((to=w(qo,lo=ko+1|0))<<3)|0,Ao=wo=Wn+(ko+to<<3)|0,Io=q[Pn+12>>2],ro=x(0|qo),so=x(0|ko),a=0;Vn=u[4+(Pn=(oo=a<<3)+Mn|0)>>2],Rn=x(Vn*ro),Xn=u[Pn>>2],Qn=x(Xn*so),Pn=Vn>=x(1),Rn=!(Vn=x(1)|Xn>2],Bo=u[Wn+4>>2],Yn=x(ao-Bo),Co=u[4+yo>>2],Do=u[4+zo>>2],Zn=x(Co-Do),bo=x(x(Yn-Zn)*x(.5)),Eo=u[wo>>2],Fo=u[Wn>>2],_n=x(Eo-Fo),Go=u[uo>>2],Ho=u[vo>>2],$n=x(Go-Ho),co=x(x(_n-$n)*x(.5)),Zn=x(x(Zn+Yn)*x(.5)),$n=x(x($n+_n)*x(.5)),Jo=1,Yn=x(x(x(x(x(Bo+Co)+Do)+ao)*x(.25))-x(Yn*x(.5))),_n=x(x(x(x(x(Fo+Go)+Ho)+Eo)*x(.25))-x(_n*x(.5)))),Vnx(-2)^1|(Xnx(-2)^1)?(u[Nn+oo>>2]=x(Vn*co)+x(x(Xn*$n)+_n),Qn=x(Vn*bo),x(x(Xn*Zn)+Yn)):(Xn<=x(0)?Vn<=x(0)?(Un=x(x(Vn+x(2))*x(.5)),Tn=x(x(X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=Eh<<2)+q[a+156>>2]|0,u[(Dh=(Jh=Gh<<2)+mh|0)>>2]=u[Eh>>2]*u[(Hh=(Mh=Hh<<4)+mh|0)>>2],u[Dh+4>>2]=u[Eh+4>>2]*u[Hh+4>>2],u[Dh+8>>2]=u[Eh+8>>2]*u[Hh+8>>2],q[mh+((Gh|=3)<<2)>>2]=1065353216,a=Kh+q[a+160>>2]|0,Nh=u[a>>2],Ih=u[(Dh=Fh+Mh|0)>>2],u[(mh=Fh+Jh|0)>>2]=x(Nh+Ih)-x(Nh*Ih),Nh=u[a+4>>2],Ih=u[Dh+4>>2],u[mh+4>>2]=x(Nh+Ih)-x(Nh*Ih),Nh=u[a+8>>2],Ih=u[Dh+8>>2],u[mh+8>>2]=x(Nh+Ih)-x(Nh*Ih)),q[Fh+(Gh<<2)>>2]=1065353216)},n[3]=function(a,Sm,un,xn,yn){a|=0,Sm|=0,un|=0,xn|=0,yn|=0;var Dn,En,Fn,Hn,In,zn=0,zn=(x(0),x(0),x(0),x(0),x(0),x(0),x(0),x(0),(Sm=q[16+(q[a+308>>2]+(Sm<<5)|0)>>2])<<2),Bn=function(a){var El,Hl,Fl,Gl,Dl=x(0);L=Fl=L-16|0,j(a);a:if((El=2147483647&(Gl=b[0]))>>>0<=1061752794)Dl=x(1),El>>>0<964689920||(Dl=ba(+a));else if(El>>>0<=1081824209)Hl=+a,Dl=1075235812<=El>>>0?x(-ba(((0|Gl)<0?3.141592653589793:-3.141592653589793)+Hl)):aa((0|Gl)<=-1?1.5707963267948966+Hl:1.5707963267948966-Hl);else if(El>>>0<=1088565717)Dl=1085271520<=El>>>0?ba(+a+((0|Gl)<0?6.283185307179586:-6.283185307179586)):aa((0|Gl)<=-1?-4.71238898038469-+a:+a-4.71238898038469);else if(Dl=x(a-a),!(2139095040<=El>>>0))if((El=3&Da(a,8+Fl|0))>>>0<=2){switch(El-1|0){default:Dl=ba(v[8+Fl>>3]);break a;case 0:Dl=aa(-v[8+Fl>>3]);break a;case 1:}Dl=x(-ba(v[8+Fl>>3]))}else Dl=aa(v[8+Fl>>3]);return L=16+Fl|0,Dl}(An=x(x(x(u[4+(q[a+168>>2]+w(Sm,12)|0)>>2]+u[zn+q[a+284>>2]>>2])*x(3.1415927410125732))/x(180))),Cn=u[zn+q[a+272>>2]>>2],Gn=q[zn+q[a+292>>2]>>2],An=function(a){var Vk,Al,Cl,Bl=0;L=Al=L-16|0,j(a);a:if((Vk=2147483647&(Cl=b[0]))>>>0<=1061752794)Vk>>>0<964689920||(a=aa(+a));else if(Vk>>>0<=1081824209)Bl=+a,a=Vk>>>0<=1075235811?(0|Cl)<=-1?x(-ba(Bl+1.5707963267948966)):ba(Bl+-1.5707963267948966):aa(-(((0|Cl)<0?3.141592653589793:-3.141592653589793)+Bl));else if(Vk>>>0<=1088565717)Bl=+a,a=Vk>>>0<=1085271519?(0|Cl)<=-1?ba(Bl+4.71238898038469):x(-ba(Bl+-4.71238898038469)):aa(((0|Cl)<0?6.283185307179586:-6.283185307179586)+Bl);else if(2139095040<=Vk>>>0)a=x(a-a);else if((Vk=3&Da(a,8+Al|0))>>>0<=2){switch(Vk-1|0){default:a=aa(v[8+Al>>3]);break a;case 0:a=ba(v[8+Al>>3]);break a;case 1:}a=aa(-v[8+Al>>3])}else a=x(-ba(v[8+Al>>3]));return L=16+Al|0,a}(An);if((Sm=0)<(0|yn))for(Bn=x(Cn*Bn),En=x(Gn?-1:1),Hn=x(Bn*En),Dn=q[zn+q[a+288>>2]>>2]?x(-1):x(1),In=x(x(Cn*An)*Dn),Bn=x(Bn*Dn),Cn=x(x(Cn*x(-An))*En),An=u[zn+q[a+280>>2]>>2],En=u[zn+q[a+276>>2]>>2];zn=(a=Sm<<3)+xn|0,Dn=u[(a=a+un|0)>>2],Fn=u[a+4>>2],u[zn+4>>2]=An+x(x(In*Dn)+x(Hn*Fn)),u[zn>>2]=En+x(x(Bn*Dn)+x(Cn*Fn)),(0|yn)!=(0|(Sm=Sm+1|0)););},n[4]=function(a,mh){a|=0,mh|=0;var yh,zh,Ah,Bh,Ch,nh,oh=0,ph=0,qh=0,rh=x(0),sh=0,th=0,uh=x(0),vh=0,wh=0,xh=0;if(x(0),x(0),x(0),x(0),L=nh=L+-64|0,vh=q[a+320>>2],wh=q[a+316>>2],ph=q[a+308>>2],-1==(0|(sh=q[8+(qh=ph+(mh<<5)|0)>>2])))oh=q[qh+16>>2]<<2,q[(ph=mh<<2)+wh>>2]=q[oh+q[a+268>>2]>>2],q[ph+vh>>2]=q[oh+q[a+272>>2]>>2];else{oh=q[qh+16>>2]<<2,xh=q[oh+q[a+276>>2]>>2],q[24+nh>>2]=xh,oh=q[oh+q[a+280>>2]>>2],q[28+nh>>2]=oh,q[16+nh>>2]=0,zh=1==q[12+(th=ph+(sh<<5)|0)>>2]?x(-10):x(-.10000000149011612),u[20+nh>>2]=zh,q[60+nh>>2]=oh,q[56+nh>>2]=xh,n[q[th+24>>2]](a,sh,56+nh|0,48+nh|0,1),rh=x(1),ph=9;b:{for(;;){if(oh=ph,uh=x(rh*x(0)),u[32+nh>>2]=uh+u[56+nh>>2],yh=x(zh*rh),u[36+nh>>2]=yh+u[60+nh>>2],n[q[th+24>>2]](a,sh,32+nh|0,40+nh|0,1),Ah=x(u[44+nh>>2]-u[52+nh>>2]),u[44+nh>>2]=Ah,Bh=x(u[40+nh>>2]-u[48+nh>>2]),u[40+nh>>2]=Bh,Ah!=x(0)||Bh!=x(0)){ph=q[44+nh>>2],q[8+nh>>2]=q[40+nh>>2],q[12+nh>>2]=ph;break b}if(u[32+nh>>2]=u[56+nh>>2]-uh,u[36+nh>>2]=u[60+nh>>2]-yh,n[q[th+24>>2]](a,sh,32+nh|0,40+nh|0,1),uh=x(u[40+nh>>2]-u[48+nh>>2]),u[40+nh>>2]=uh,yh=x(u[44+nh>>2]-u[52+nh>>2]),(u[44+nh>>2]=yh)!=x(0)||uh!=x(0)){u[12+nh>>2]=-yh,u[8+nh>>2]=-uh;break b}if(ph=oh+-1|0,rh=x(rh*x(.10000000149011612)),!oh)break}Y(3,1311,0)}rh=function(a,ji){var ki=x(0);if((ki=x(Ba(u[4+a>>2],u[a>>2])-Ba(u[4+ji>>2],u[ji>>2])))x(3.1415927410125732))for(;(ki=x(ki+x(-6.2831854820251465)))>x(3.1415927410125732););return ki}(16+nh|0,8+nh|0),n[q[th+24>>2]](a,q[qh+8>>2],24+nh|0,24+nh|0,1),ph=q[qh+16>>2]<<2,q[ph+q[a+276>>2]>>2]=q[24+nh>>2],q[ph+q[a+280>>2]>>2]=q[28+nh>>2],oh=ph+q[a+284>>2]|0,u[oh>>2]=u[oh>>2]+x(x(rh*x(-180))/x(3.1415927410125732)),qh=q[qh+8>>2]<<2,u[(oh=mh<<2)+wh>>2]=u[ph+q[a+268>>2]>>2]*u[qh+wh>>2],ph=ph+q[a+272>>2]|0,rh=x(u[ph>>2]*u[qh+vh>>2]),u[oh+vh>>2]=rh,u[ph>>2]=rh}4<=r[q[a>>2]+4|0]&&(oh=mh<<2,qh=q[a+308>>2]+(mh<<5)|0,sh=q[qh+16>>2]<<2,ph=q[a+328>>2],mh=q[a+324>>2],-1==(0|(th=q[qh+8>>2]))?(th=q[a+296>>2],q[(qh=oh<<2)+mh>>2]=q[th+(sh<<=2)>>2],q[(vh=4|qh)+mh>>2]=q[(wh=4|sh)+th>>2],q[(xh=8|qh)+mh>>2]=q[th+(Ch=8|sh)>>2],q[mh+((oh|=3)<<2)>>2]=1065353216,a=q[a+300>>2],q[ph+qh>>2]=q[a+sh>>2],q[ph+vh>>2]=q[a+wh>>2],q[ph+xh>>2]=q[a+Ch>>2]):(sh=(wh=sh<<2)+q[a+296>>2]|0,u[(qh=(vh=oh<<2)+mh|0)>>2]=u[sh>>2]*u[(th=(xh=th<<4)+mh|0)>>2],u[qh+4>>2]=u[sh+4>>2]*u[th+4>>2],u[qh+8>>2]=u[sh+8>>2]*u[th+8>>2],q[mh+((oh|=3)<<2)>>2]=1065353216,a=wh+q[a+300>>2]|0,rh=u[a>>2],uh=u[(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>>2]-wn|0)>>>0?un:Sm),q[a+20>>2]=Sm+q[a+20>>2],0|un},n[11]=function(a,Il,Rm,Sm,Tm,Um){a|=0,Il=+Il,Rm|=0,Sm|=0,Tm|=0,Um|=0;var fn,qn,Zm,kn,Vm=0,Wm=0,Xm=0,Ym=0,_m=0,$m=0,an=0,bn=0,cn=0,dn=0,en=0,gn=0,hn=0,jn=0,mn=0;if(q[44+(L=Zm=L-560|0)>>2]=0,h(+Il),Vm=0|b[1],qn=4294967295>>0?0:1,kn=(0|Vm)<-1||(0|Vm)<=-1&&qn?(h(Il=-Il),Vm=0|b[1],b[0],jn=1,3840):2048&Tm?(jn=1,3843):(jn=1&Tm)?3846:3841,2146435072==(2146435072&Vm))_(a,32,Rm,$m=jn+3|0,-65537&Tm),Z(a,kn,jn),Sm=Um>>>5&1,Z(a,Il!=Il?Sm?3867:3871:Sm?3859:3863,3);else if(Il=function Ja(a,ic){var kc,lc,jc=0;if(h(+a),jc=0|b[1],kc=0|b[0],2047!=(0|(jc=(lc=jc)>>>20&2047))){if(!jc)return jc=ic,ic=0==a?0:(a=Ja(0x10000000000000000*a,ic),q[ic>>2]+-64|0),q[jc>>2]=ic,a;q[ic>>2]=jc+-1022,f(0,0|kc),f(1,-2146435073&lc|1071644672),a=+g()}return a}(Il,44+Zm|0),0!=(Il+=Il)&&(q[44+Zm>>2]=q[44+Zm>>2]+-1),fn=16+Zm|0,97==(0|(qn=32|Um))){if(en=(dn=32&Um)?9+kn|0:kn,!(11>>0)&&(Vm=12-Sm|0)){for(gn=8;gn*=16,Vm=Vm+-1|0;);Il=45==r[0|en]?-(gn+(-Il-gn)):Il+gn-gn}for((0|fn)==(0|(Vm=ga((Xm=(Vm=q[44+Zm>>2])>>31)^Vm+Xm,0,fn)))&&(o[15+Zm|0]=48,Vm=15+Zm|0),_m=2|jn,Xm=q[44+Zm>>2],o[0|(cn=Vm+-2|0)]=Um+15,o[Vm+-1|0]=(0|Xm)<0?45:43,Vm=8&Tm,Wm=16+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Zm>>>0>>0;);}else(0|Vm)==(0|Xm)&&(o[24+Zm|0]=48,Vm=Sm);if(Z(a,Vm,Xm-Vm|0),!((Wm=Wm+4|0)>>>0<=dn>>>0))break}Ym&&Z(a,3875,1);p:if(!((0|an)<1|cn>>>0<=Wm>>>0))for(;;){if(16+Zm>>>0<(Vm=ga(q[Wm>>2],0,Xm))>>>0)for(;o[0|(Vm=Vm+-1|0)]=48,16+Zm>>>0>>0;);if(Z(a,Vm,(0|an)<9?an:9),an=an+-9|0,cn>>>0<=(Wm=Wm+4|0)>>>0)break p;if(!(0<(0|an)))break}_(a,48,an+9|0,9,0)}else{q:if(!((0|an)<0))for(Um=en?cn:Wm+4|0,Sm=16+Zm|8,dn=16+Zm|9,Xm=Wm;;){if((0|dn)==(0|(Vm=ga(q[Xm>>2],0,dn)))&&(o[24+Zm|0]=48,Vm=Sm),(0|Wm)!=(0|Xm)){if(!(Vm>>>0<=16+Zm>>>0))for(;o[0|(Vm=Vm+-1|0)]=48,16+Zm>>>0>>0;);}else Z(a,Vm,1),Vm=Vm+1|0,(0|an)<1&&!_m||Z(a,3875,1);if(Z(a,bn=Vm,(0|(Vm=dn-Vm|0))<(0|an)?Vm:an),an=an-Vm|0,Um>>>0<=(Xm=Xm+4|0)>>>0)break q;if(!(-1<(0|an)))break}_(a,48,an+18|0,18,0),Z(a,hn,fn-hn|0)}}return _(a,32,Rm,$m,8192^Tm),L=560+Zm|0,0|((0|$m)<(0|Rm)?Rm:$m)},n[12]=function(a,Il){a|=0;var Am=Il|=0;Il=q[Il>>2]+15&-16,q[Am>>2]=Il+16,Am=a,a=function(a,Il,Jl,$l){var fm,cm,am=0,bm=0,dm=0,em=0;return L=cm=L-32|0,am=(em=am=2147483647&$l)-1006698496|0,bm=am=(fm=bm=dm=Jl)>>>0<0?am+1|0:am,am=em-1140785152|0,(0|(am=dm>>>0<0?am+1|0:am))==(0|bm)&fm>>>0>>0|bm>>>0>>0?(am=$l<<4|Jl>>>28,Jl=Jl<<4|Il>>>28,134217728==(0|(dm=Il&=268435455))&1<=a>>>0|134217728>>0?(am=am+1073741824|0,(a=Jl+1|0)>>>0<1&&(am=am+1|0),bm=a):(am=am-(((bm=Jl)>>>0<0)+-1073741824|0)|0,a|134217728^dm||((a=bm+(1&bm)|0)>>>0>>0&&(am=am+1|0),bm=a))):(!dm&2147418112==(0|em)?!(a|Il):2147418112==(0|em)&dm>>>0<0|em>>>0<2147418112)?(am=2146435072,1140785151==((bm=0)|em)&4294967295>>0|1140785151>>0||(dm=em>>>16)>>>(am=0)<15249||(function(a,Il,Jl,Am,Bm,Cm){var Jm,Km,Hm=0,Im=0;64&Cm?(Il=31&(Jl=Cm-64|0),Il=32<=(63&Jl)>>>0?(Jl=0,Bm>>>Il):(Jl=Bm>>>Il,((1<>>Il),Bm=Am=0):Cm&&(Im=Bm,Hm=31&(Km=64-Cm|0),Km=32<=(63&Km)>>>0?(Im=Am<>>32-Hm|Im<>>0?(Hm=0,Jl>>>Il):(Hm=Jl>>>Il,((1<>>Il),Il|=Km,Jl=Hm|Im,Hm=Am,Am=31&Cm,Am=32<=(63&Cm)>>>0?(Im=0,Bm>>>Am):(Im=Bm>>>Am,((1<>>Am),Bm=Im),q[a>>2]=Il,q[4+a>>2]=Jl,q[8+a>>2]=Am,q[12+a>>2]=Bm}(cm,a,Il,Jl,am=65535&$l|65536,15361-dm|0),function(a,Il,Jl,Am,Bm,Cm){var Fm,Dm,Em=0;64&Cm?(Am=Il,Il=31&(Bm=Cm+-64|0),32<=(63&Bm)>>>0?(Bm=Am<>>32-Il|Jl<>>0?(Em=Dm<>>32-Am|Bm<>>0?(Cm=0,Am>>>=Bm):(Cm=Am>>>Bm,Am=((1<>>Bm),Am|=Dm,Bm=Cm|Em,Cm=Il,Il=31&Fm,Il=32<=(63&Fm)>>>0?(Em=Cm<>>32-Il|Jl<>2]=Il,q[4+a>>2]=Jl,q[8+a>>2]=Am,q[12+a>>2]=Bm}(16+cm|0,a,Il,Jl,am,dm+-15233|0),Jl=q[4+cm>>2],a=q[8+cm>>2],am=q[12+cm>>2]<<4|a>>>28,bm=a<<4|Jl>>>28,134217728==(0|(Jl=a=268435455&Jl))&1<=(Il=q[cm>>2]|(0!=(q[16+cm>>2]|q[24+cm>>2])|0!=(q[20+cm>>2]|q[28+cm>>2])))>>>0|134217728>>0?((a=bm+1|0)>>>0<1&&(am=am+1|0),bm=a):Il|134217728^Jl||((a=bm+(1&bm)|0)>>>0>>0&&(am=am+1|0),bm=a))):(bm=Jl<<4|Il>>>28,am=524287&(am=$l<<4|Jl>>>28)|2146959360),L=32+cm|0,f(0,0|bm),f(1,-2147483648&$l|am),+g()}(q[Il>>2],q[Il+4>>2],q[Il+8>>2],q[Il+12>>2]),v[Am>>3]=a},n[13]=function(a){return 0},n[14]=function(a,Il,Am){Il|=0,Am|=0;var Om,Cm,Bm=0,Lm=0,Mm=0,Nm=0;for(L=Cm=L-32|0,Bm=q[28+(a|=0)>>2],q[16+Cm>>2]=Bm,Mm=q[a+20>>2],q[28+Cm>>2]=Am,q[24+Cm>>2]=Il,Mm=(q[20+Cm>>2]=Il=Mm-Bm|0)+Am|0,Nm=2,Il=16+Cm|0;;){a:{if((Lm=(Bm=0)|K(q[a+60>>2],0|Il,0|Nm,12+Cm|0))&&(q[2086]=Lm,Bm=-1),(0|(Bm=Bm?q[12+Cm>>2]=-1:q[12+Cm>>2]))==(0|Mm))Il=q[a+44>>2],q[a+28>>2]=Il,q[a+20>>2]=Il,q[a+16>>2]=Il+q[a+48>>2],a=Am;else{if(-1<(0|Bm))break a;q[a+28>>2]=0,q[a+16>>2]=0,q[a+20>>2]=0,q[a>>2]=32|q[a>>2],2!=((a=0)|Nm)&&(a=Am-q[Il+4>>2]|0)}return L=32+Cm|0,0|a}Lm=q[Il+4>>2],q[(Il=(Om=Lm>>>0>>0)?Il+8|0:Il)>>2]=(Lm=Bm-(Om?Lm:0)|0)+q[Il>>2],q[Il+4>>2]=q[Il+4>>2]-Lm,Mm=Mm-Bm|0,Nm=Nm-Om|0}},n[15]=function(a,Il,Am,Bm){return M=0},{d:function(){},e:function(){return q[1805]},f:function(){return 83886080},g:function(){return 5},h:function(a,vj){return vj|=0,L=vj=L-16|0,a=(a|=0)?sa(a)?(Y(4,2150,0),0):r[a+4|0]:(q[vj+4>>2]=1444,q[vj>>2]=2267,Y(4,1294,vj),0),L=vj+16|0,0|a},i:function(a,vj){var wj;return vj|=0,L=wj=L-48|0,a=(a|=0)?(a+63&-64)!=(0|a)?(q[36+wj>>2]=1522,q[32+wj>>2]=2284,Y(4,1294,32+wj|0),0):(vj+63&-64)==(0|vj)&&vj?function(a,Vk){var pl,Wk=0,Xk=0,Yk=0,Zk=0,_k=0,$k=0,al=0,bl=0,cl=0,dl=0,el=0,fl=0,gl=0,hl=0,il=0,jl=0,kl=0,ll=0,ml=0,nl=0,ol=0;L=_k=(pl=Xk=L)-704&-64;a:if(Vk>>>0<=1343)Y(4,1235,0);else if(sa(a))Y(4,1469,0);else if(Xk=r[0|(nl=a+4|0)]){if(!(6<=Xk>>>0)){(jl=1==(0|!r[a+5|0]))||(da(nl,1),X(a- -64|0,4,160)),ca(_k- -64|0,0,640),na(a,_k- -64|0),Xk=a+Vk|0,Vk=q[_k+64>>2];b:{c:{d:{if(5<=(il=r[a+4|0])>>>0){if(Vk>>>0>>0|Xk>>>0>>0)break c;if((Zk=Vk+256|0)>>>0>>0)break c;if(Zk>>>0<=Xk>>>0)break d;break c}if(Vk>>>0>>0|Xk>>>0>>0)break c;if((Zk=Vk+128|0)>>>0>>0|Xk>>>0>>0)break c}if(!((Yk=q[_k+68>>2])>>>0>>0|Xk>>>0>>0|Yk>>>0>>0||(Yk=Yk- -64|0)>>>0>>0|Xk>>>0>>0||(0|(dl=q[Vk>>2]))<0||(Zk=q[_k+72>>2])>>>0>>0|Xk>>>0>>0|Zk>>>0>>0||(Yk=(Wk=Zk)+(Zk=dl<<2)|0)>>>0>>0|Xk>>>0>>0||(al=q[_k+76>>2])>>>0>>0|Xk>>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