mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-01 06:22:44 -08:00
initial commit
This commit is contained in:
9602
vendor/yomitan/lib/dexie.js
vendored
Normal file
9602
vendor/yomitan/lib/dexie.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
7
vendor/yomitan/lib/dexie.js.map
vendored
Normal file
7
vendor/yomitan/lib/dexie.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
6316
vendor/yomitan/lib/handlebars.js
vendored
Normal file
6316
vendor/yomitan/lib/handlebars.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
vendor/yomitan/lib/handlebars.js.map
vendored
Normal file
7
vendor/yomitan/lib/handlebars.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
641
vendor/yomitan/lib/hangul-js.js
vendored
Normal file
641
vendor/yomitan/lib/hangul-js.js
vendored
Normal file
@@ -0,0 +1,641 @@
|
||||
// @ts-nocheck
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
|
||||
// node_modules/hangul-js/hangul.js
|
||||
var require_hangul = __commonJS({
|
||||
"node_modules/hangul-js/hangul.js"(exports, module) {
|
||||
(function() {
|
||||
"use strict";
|
||||
var CHO = [
|
||||
"\u3131",
|
||||
"\u3132",
|
||||
"\u3134",
|
||||
"\u3137",
|
||||
"\u3138",
|
||||
"\u3139",
|
||||
"\u3141",
|
||||
"\u3142",
|
||||
"\u3143",
|
||||
"\u3145",
|
||||
"\u3146",
|
||||
"\u3147",
|
||||
"\u3148",
|
||||
"\u3149",
|
||||
"\u314A",
|
||||
"\u314B",
|
||||
"\u314C",
|
||||
"\u314D",
|
||||
"\u314E"
|
||||
], JUNG = [
|
||||
"\u314F",
|
||||
"\u3150",
|
||||
"\u3151",
|
||||
"\u3152",
|
||||
"\u3153",
|
||||
"\u3154",
|
||||
"\u3155",
|
||||
"\u3156",
|
||||
"\u3157",
|
||||
["\u3157", "\u314F"],
|
||||
["\u3157", "\u3150"],
|
||||
["\u3157", "\u3163"],
|
||||
"\u315B",
|
||||
"\u315C",
|
||||
["\u315C", "\u3153"],
|
||||
["\u315C", "\u3154"],
|
||||
["\u315C", "\u3163"],
|
||||
"\u3160",
|
||||
"\u3161",
|
||||
["\u3161", "\u3163"],
|
||||
"\u3163"
|
||||
], JONG = [
|
||||
"",
|
||||
"\u3131",
|
||||
"\u3132",
|
||||
["\u3131", "\u3145"],
|
||||
"\u3134",
|
||||
["\u3134", "\u3148"],
|
||||
["\u3134", "\u314E"],
|
||||
"\u3137",
|
||||
"\u3139",
|
||||
["\u3139", "\u3131"],
|
||||
["\u3139", "\u3141"],
|
||||
["\u3139", "\u3142"],
|
||||
["\u3139", "\u3145"],
|
||||
["\u3139", "\u314C"],
|
||||
["\u3139", "\u314D"],
|
||||
["\u3139", "\u314E"],
|
||||
"\u3141",
|
||||
"\u3142",
|
||||
["\u3142", "\u3145"],
|
||||
"\u3145",
|
||||
"\u3146",
|
||||
"\u3147",
|
||||
"\u3148",
|
||||
"\u314A",
|
||||
"\u314B",
|
||||
"\u314C",
|
||||
"\u314D",
|
||||
"\u314E"
|
||||
], HANGUL_OFFSET = 44032, CONSONANTS = [
|
||||
"\u3131",
|
||||
"\u3132",
|
||||
"\u3133",
|
||||
"\u3134",
|
||||
"\u3135",
|
||||
"\u3136",
|
||||
"\u3137",
|
||||
"\u3138",
|
||||
"\u3139",
|
||||
"\u313A",
|
||||
"\u313B",
|
||||
"\u313C",
|
||||
"\u313D",
|
||||
"\u313E",
|
||||
"\u313F",
|
||||
"\u3140",
|
||||
"\u3141",
|
||||
"\u3142",
|
||||
"\u3143",
|
||||
"\u3144",
|
||||
"\u3145",
|
||||
"\u3146",
|
||||
"\u3147",
|
||||
"\u3148",
|
||||
"\u3149",
|
||||
"\u314A",
|
||||
"\u314B",
|
||||
"\u314C",
|
||||
"\u314D",
|
||||
"\u314E"
|
||||
], COMPLETE_CHO = [
|
||||
"\u3131",
|
||||
"\u3132",
|
||||
"\u3134",
|
||||
"\u3137",
|
||||
"\u3138",
|
||||
"\u3139",
|
||||
"\u3141",
|
||||
"\u3142",
|
||||
"\u3143",
|
||||
"\u3145",
|
||||
"\u3146",
|
||||
"\u3147",
|
||||
"\u3148",
|
||||
"\u3149",
|
||||
"\u314A",
|
||||
"\u314B",
|
||||
"\u314C",
|
||||
"\u314D",
|
||||
"\u314E"
|
||||
], COMPLETE_JUNG = [
|
||||
"\u314F",
|
||||
"\u3150",
|
||||
"\u3151",
|
||||
"\u3152",
|
||||
"\u3153",
|
||||
"\u3154",
|
||||
"\u3155",
|
||||
"\u3156",
|
||||
"\u3157",
|
||||
"\u3158",
|
||||
"\u3159",
|
||||
"\u315A",
|
||||
"\u315B",
|
||||
"\u315C",
|
||||
"\u315D",
|
||||
"\u315E",
|
||||
"\u315F",
|
||||
"\u3160",
|
||||
"\u3161",
|
||||
"\u3162",
|
||||
"\u3163"
|
||||
], COMPLETE_JONG = [
|
||||
"",
|
||||
"\u3131",
|
||||
"\u3132",
|
||||
"\u3133",
|
||||
"\u3134",
|
||||
"\u3135",
|
||||
"\u3136",
|
||||
"\u3137",
|
||||
"\u3139",
|
||||
"\u313A",
|
||||
"\u313B",
|
||||
"\u313C",
|
||||
"\u313D",
|
||||
"\u313E",
|
||||
"\u313F",
|
||||
"\u3140",
|
||||
"\u3141",
|
||||
"\u3142",
|
||||
"\u3144",
|
||||
"\u3145",
|
||||
"\u3146",
|
||||
"\u3147",
|
||||
"\u3148",
|
||||
"\u314A",
|
||||
"\u314B",
|
||||
"\u314C",
|
||||
"\u314D",
|
||||
"\u314E"
|
||||
], COMPLEX_CONSONANTS = [
|
||||
["\u3131", "\u3145", "\u3133"],
|
||||
["\u3134", "\u3148", "\u3135"],
|
||||
["\u3134", "\u314E", "\u3136"],
|
||||
["\u3139", "\u3131", "\u313A"],
|
||||
["\u3139", "\u3141", "\u313B"],
|
||||
["\u3139", "\u3142", "\u313C"],
|
||||
["\u3139", "\u3145", "\u313D"],
|
||||
["\u3139", "\u314C", "\u313E"],
|
||||
["\u3139", "\u314D", "\u313F"],
|
||||
["\u3139", "\u314E", "\u3140"],
|
||||
["\u3142", "\u3145", "\u3144"]
|
||||
], COMPLEX_VOWELS = [
|
||||
["\u3157", "\u314F", "\u3158"],
|
||||
["\u3157", "\u3150", "\u3159"],
|
||||
["\u3157", "\u3163", "\u315A"],
|
||||
["\u315C", "\u3153", "\u315D"],
|
||||
["\u315C", "\u3154", "\u315E"],
|
||||
["\u315C", "\u3163", "\u315F"],
|
||||
["\u3161", "\u3163", "\u3162"]
|
||||
], CONSONANTS_HASH, CHO_HASH, JUNG_HASH, JONG_HASH, COMPLEX_CONSONANTS_HASH, COMPLEX_VOWELS_HASH;
|
||||
function _makeHash(array) {
|
||||
var length = array.length, hash = { 0: 0 };
|
||||
for (var i = 0; i < length; i++) {
|
||||
if (array[i])
|
||||
hash[array[i].charCodeAt(0)] = i;
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
CONSONANTS_HASH = _makeHash(CONSONANTS);
|
||||
CHO_HASH = _makeHash(COMPLETE_CHO);
|
||||
JUNG_HASH = _makeHash(COMPLETE_JUNG);
|
||||
JONG_HASH = _makeHash(COMPLETE_JONG);
|
||||
function _makeComplexHash(array) {
|
||||
var length = array.length, hash = {}, code1, code2;
|
||||
for (var i = 0; i < length; i++) {
|
||||
code1 = array[i][0].charCodeAt(0);
|
||||
code2 = array[i][1].charCodeAt(0);
|
||||
if (typeof hash[code1] === "undefined") {
|
||||
hash[code1] = {};
|
||||
}
|
||||
hash[code1][code2] = array[i][2].charCodeAt(0);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
COMPLEX_CONSONANTS_HASH = _makeComplexHash(COMPLEX_CONSONANTS);
|
||||
COMPLEX_VOWELS_HASH = _makeComplexHash(COMPLEX_VOWELS);
|
||||
function _isConsonant(c) {
|
||||
return typeof CONSONANTS_HASH[c] !== "undefined";
|
||||
}
|
||||
function _isCho(c) {
|
||||
return typeof CHO_HASH[c] !== "undefined";
|
||||
}
|
||||
function _isJung(c) {
|
||||
return typeof JUNG_HASH[c] !== "undefined";
|
||||
}
|
||||
function _isJong(c) {
|
||||
return typeof JONG_HASH[c] !== "undefined";
|
||||
}
|
||||
function _isHangul(c) {
|
||||
return 44032 <= c && c <= 55203;
|
||||
}
|
||||
function _isJungJoinable(a, b) {
|
||||
return COMPLEX_VOWELS_HASH[a] && COMPLEX_VOWELS_HASH[a][b] ? COMPLEX_VOWELS_HASH[a][b] : false;
|
||||
}
|
||||
function _isJongJoinable(a, b) {
|
||||
return COMPLEX_CONSONANTS_HASH[a] && COMPLEX_CONSONANTS_HASH[a][b] ? COMPLEX_CONSONANTS_HASH[a][b] : false;
|
||||
}
|
||||
var disassemble = function(string, grouped) {
|
||||
if (string === null) {
|
||||
throw new Error("Arguments cannot be null");
|
||||
}
|
||||
if (typeof string === "object") {
|
||||
string = string.join("");
|
||||
}
|
||||
var result = [], length = string.length, cho, jung, jong, code, r;
|
||||
for (var i = 0; i < length; i++) {
|
||||
var temp = [];
|
||||
code = string.charCodeAt(i);
|
||||
if (_isHangul(code)) {
|
||||
code -= HANGUL_OFFSET;
|
||||
jong = code % 28;
|
||||
jung = (code - jong) / 28 % 21;
|
||||
cho = parseInt((code - jong) / 28 / 21);
|
||||
temp.push(CHO[cho]);
|
||||
if (typeof JUNG[jung] === "object") {
|
||||
temp = temp.concat(JUNG[jung]);
|
||||
} else {
|
||||
temp.push(JUNG[jung]);
|
||||
}
|
||||
if (jong > 0) {
|
||||
if (typeof JONG[jong] === "object") {
|
||||
temp = temp.concat(JONG[jong]);
|
||||
} else {
|
||||
temp.push(JONG[jong]);
|
||||
}
|
||||
}
|
||||
} else if (_isConsonant(code)) {
|
||||
if (_isCho(code)) {
|
||||
r = CHO[CHO_HASH[code]];
|
||||
} else {
|
||||
r = JONG[JONG_HASH[code]];
|
||||
}
|
||||
if (typeof r === "string") {
|
||||
temp.push(r);
|
||||
} else {
|
||||
temp = temp.concat(r);
|
||||
}
|
||||
} else if (_isJung(code)) {
|
||||
r = JUNG[JUNG_HASH[code]];
|
||||
if (typeof r === "string") {
|
||||
temp.push(r);
|
||||
} else {
|
||||
temp = temp.concat(r);
|
||||
}
|
||||
} else {
|
||||
temp.push(string.charAt(i));
|
||||
}
|
||||
if (grouped) result.push(temp);
|
||||
else result = result.concat(temp);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
var disassembleToString = function(str) {
|
||||
if (typeof str !== "string") {
|
||||
return "";
|
||||
}
|
||||
str = disassemble(str);
|
||||
return str.join("");
|
||||
};
|
||||
var assemble = function(array) {
|
||||
if (typeof array === "string") {
|
||||
array = disassemble(array);
|
||||
}
|
||||
var result = [], length = array.length, code, stage = 0, complete_index = -1, previous_code, jong_joined = false;
|
||||
function _makeHangul(index) {
|
||||
var code2, cho, jung1, jung2, jong1 = 0, jong2, hangul2 = "";
|
||||
jong_joined = false;
|
||||
if (complete_index + 1 > index) {
|
||||
return;
|
||||
}
|
||||
for (var step = 1; ; step++) {
|
||||
if (step === 1) {
|
||||
cho = array[complete_index + step].charCodeAt(0);
|
||||
if (_isJung(cho)) {
|
||||
if (complete_index + step + 1 <= index && _isJung(jung1 = array[complete_index + step + 1].charCodeAt(0))) {
|
||||
result.push(String.fromCharCode(_isJungJoinable(cho, jung1)));
|
||||
complete_index = index;
|
||||
return;
|
||||
} else {
|
||||
result.push(array[complete_index + step]);
|
||||
complete_index = index;
|
||||
return;
|
||||
}
|
||||
} else if (!_isCho(cho)) {
|
||||
result.push(array[complete_index + step]);
|
||||
complete_index = index;
|
||||
return;
|
||||
}
|
||||
hangul2 = array[complete_index + step];
|
||||
} else if (step === 2) {
|
||||
jung1 = array[complete_index + step].charCodeAt(0);
|
||||
if (_isCho(jung1)) {
|
||||
cho = _isJongJoinable(cho, jung1);
|
||||
hangul2 = String.fromCharCode(cho);
|
||||
result.push(hangul2);
|
||||
complete_index = index;
|
||||
return;
|
||||
} else {
|
||||
hangul2 = String.fromCharCode((CHO_HASH[cho] * 21 + JUNG_HASH[jung1]) * 28 + HANGUL_OFFSET);
|
||||
}
|
||||
} else if (step === 3) {
|
||||
jung2 = array[complete_index + step].charCodeAt(0);
|
||||
if (_isJungJoinable(jung1, jung2)) {
|
||||
jung1 = _isJungJoinable(jung1, jung2);
|
||||
} else {
|
||||
jong1 = jung2;
|
||||
}
|
||||
hangul2 = String.fromCharCode((CHO_HASH[cho] * 21 + JUNG_HASH[jung1]) * 28 + JONG_HASH[jong1] + HANGUL_OFFSET);
|
||||
} else if (step === 4) {
|
||||
jong2 = array[complete_index + step].charCodeAt(0);
|
||||
if (_isJongJoinable(jong1, jong2)) {
|
||||
jong1 = _isJongJoinable(jong1, jong2);
|
||||
} else {
|
||||
jong1 = jong2;
|
||||
}
|
||||
hangul2 = String.fromCharCode((CHO_HASH[cho] * 21 + JUNG_HASH[jung1]) * 28 + JONG_HASH[jong1] + HANGUL_OFFSET);
|
||||
} else if (step === 5) {
|
||||
jong2 = array[complete_index + step].charCodeAt(0);
|
||||
jong1 = _isJongJoinable(jong1, jong2);
|
||||
hangul2 = String.fromCharCode((CHO_HASH[cho] * 21 + JUNG_HASH[jung1]) * 28 + JONG_HASH[jong1] + HANGUL_OFFSET);
|
||||
}
|
||||
if (complete_index + step >= index) {
|
||||
result.push(hangul2);
|
||||
complete_index = index;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < length; i++) {
|
||||
code = array[i].charCodeAt(0);
|
||||
if (!_isCho(code) && !_isJung(code) && !_isJong(code)) {
|
||||
_makeHangul(i - 1);
|
||||
_makeHangul(i);
|
||||
stage = 0;
|
||||
continue;
|
||||
}
|
||||
if (stage === 0) {
|
||||
if (_isCho(code)) {
|
||||
stage = 1;
|
||||
} else if (_isJung(code)) {
|
||||
stage = 4;
|
||||
}
|
||||
} else if (stage == 1) {
|
||||
if (_isJung(code)) {
|
||||
stage = 2;
|
||||
} else {
|
||||
if (_isJongJoinable(previous_code, code)) {
|
||||
stage = 5;
|
||||
} else {
|
||||
_makeHangul(i - 1);
|
||||
}
|
||||
}
|
||||
} else if (stage == 2) {
|
||||
if (_isJong(code)) {
|
||||
stage = 3;
|
||||
} else if (_isJung(code)) {
|
||||
if (_isJungJoinable(previous_code, code)) {
|
||||
} else {
|
||||
_makeHangul(i - 1);
|
||||
stage = 4;
|
||||
}
|
||||
} else {
|
||||
_makeHangul(i - 1);
|
||||
stage = 1;
|
||||
}
|
||||
} else if (stage == 3) {
|
||||
if (_isJong(code)) {
|
||||
if (!jong_joined && _isJongJoinable(previous_code, code)) {
|
||||
jong_joined = true;
|
||||
} else {
|
||||
_makeHangul(i - 1);
|
||||
stage = 1;
|
||||
}
|
||||
} else if (_isCho(code)) {
|
||||
_makeHangul(i - 1);
|
||||
stage = 1;
|
||||
} else if (_isJung(code)) {
|
||||
_makeHangul(i - 2);
|
||||
stage = 2;
|
||||
}
|
||||
} else if (stage == 4) {
|
||||
if (_isJung(code)) {
|
||||
if (_isJungJoinable(previous_code, code)) {
|
||||
_makeHangul(i);
|
||||
stage = 0;
|
||||
} else {
|
||||
_makeHangul(i - 1);
|
||||
}
|
||||
} else {
|
||||
_makeHangul(i - 1);
|
||||
stage = 1;
|
||||
}
|
||||
} else if (stage == 5) {
|
||||
if (_isJung(code)) {
|
||||
_makeHangul(i - 2);
|
||||
stage = 2;
|
||||
} else {
|
||||
_makeHangul(i - 1);
|
||||
stage = 1;
|
||||
}
|
||||
}
|
||||
previous_code = code;
|
||||
}
|
||||
_makeHangul(i - 1);
|
||||
return result.join("");
|
||||
};
|
||||
var search = function(a, b) {
|
||||
var ad = disassemble(a).join(""), bd = disassemble(b).join("");
|
||||
return ad.indexOf(bd);
|
||||
};
|
||||
var rangeSearch = function(haystack, needle) {
|
||||
var hex = disassemble(haystack).join(""), nex = disassemble(needle).join(""), grouped = disassemble(haystack, true), re = new RegExp(nex, "gi"), indices = [], result;
|
||||
if (!needle.length) return [];
|
||||
while (result = re.exec(hex)) {
|
||||
indices.push(result.index);
|
||||
}
|
||||
function findStart(index) {
|
||||
for (var i = 0, length = 0; i < grouped.length; ++i) {
|
||||
length += grouped[i].length;
|
||||
if (index < length) return i;
|
||||
}
|
||||
}
|
||||
function findEnd(index) {
|
||||
for (var i = 0, length = 0; i < grouped.length; ++i) {
|
||||
length += grouped[i].length;
|
||||
if (index + nex.length <= length) return i;
|
||||
}
|
||||
}
|
||||
return indices.map(function(i) {
|
||||
return [findStart(i), findEnd(i)];
|
||||
});
|
||||
};
|
||||
function Searcher(string) {
|
||||
this.string = string;
|
||||
this.disassembled = disassemble(string).join("");
|
||||
}
|
||||
Searcher.prototype.search = function(string) {
|
||||
return disassemble(string).join("").indexOf(this.disassembled);
|
||||
};
|
||||
var endsWithConsonant = function(string) {
|
||||
if (typeof string === "object") {
|
||||
string = string.join("");
|
||||
}
|
||||
var code = string.charCodeAt(string.length - 1);
|
||||
if (_isHangul(code)) {
|
||||
code -= HANGUL_OFFSET;
|
||||
var jong = code % 28;
|
||||
if (jong > 0) {
|
||||
return true;
|
||||
}
|
||||
} else if (_isConsonant(code)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
var endsWith = function(string, target) {
|
||||
return disassemble(string).pop() === target;
|
||||
};
|
||||
var hangul = {
|
||||
disassemble,
|
||||
d: disassemble,
|
||||
// alias for disassemble
|
||||
disassembleToString,
|
||||
ds: disassembleToString,
|
||||
// alias for disassembleToString
|
||||
assemble,
|
||||
a: assemble,
|
||||
// alias for assemble
|
||||
search,
|
||||
rangeSearch,
|
||||
Searcher,
|
||||
endsWithConsonant,
|
||||
endsWith,
|
||||
isHangul: function(c) {
|
||||
if (typeof c === "string")
|
||||
c = c.charCodeAt(0);
|
||||
return _isHangul(c);
|
||||
},
|
||||
isComplete: function(c) {
|
||||
if (typeof c === "string")
|
||||
c = c.charCodeAt(0);
|
||||
return _isHangul(c);
|
||||
},
|
||||
isConsonant: function(c) {
|
||||
if (typeof c === "string")
|
||||
c = c.charCodeAt(0);
|
||||
return _isConsonant(c);
|
||||
},
|
||||
isVowel: function(c) {
|
||||
if (typeof c === "string")
|
||||
c = c.charCodeAt(0);
|
||||
return _isJung(c);
|
||||
},
|
||||
isCho: function(c) {
|
||||
if (typeof c === "string")
|
||||
c = c.charCodeAt(0);
|
||||
return _isCho(c);
|
||||
},
|
||||
isJong: function(c) {
|
||||
if (typeof c === "string")
|
||||
c = c.charCodeAt(0);
|
||||
return _isJong(c);
|
||||
},
|
||||
isHangulAll: function(str) {
|
||||
if (typeof str !== "string") return false;
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
if (!_isHangul(str.charCodeAt(i))) return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
isCompleteAll: function(str) {
|
||||
if (typeof str !== "string") return false;
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
if (!_isHangul(str.charCodeAt(i))) return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
isConsonantAll: function(str) {
|
||||
if (typeof str !== "string") return false;
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
if (!_isConsonant(str.charCodeAt(i))) return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
isVowelAll: function(str) {
|
||||
if (typeof str !== "string") return false;
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
if (!_isJung(str.charCodeAt(i))) return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
isChoAll: function(str) {
|
||||
if (typeof str !== "string") return false;
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
if (!_isCho(str.charCodeAt(i))) return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
isJongAll: function(str) {
|
||||
if (typeof str !== "string") return false;
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
if (!_isJong(str.charCodeAt(i))) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
if (typeof define == "function" && define.amd) {
|
||||
define(function() {
|
||||
return hangul;
|
||||
});
|
||||
} else if (typeof module !== "undefined") {
|
||||
module.exports = hangul;
|
||||
} else {
|
||||
window.Hangul = hangul;
|
||||
}
|
||||
})();
|
||||
}
|
||||
});
|
||||
|
||||
// dev/lib/hangul-js.js
|
||||
var Hangul = __toESM(require_hangul(), 1);
|
||||
export {
|
||||
Hangul
|
||||
};
|
||||
//# sourceMappingURL=hangul-js.js.map
|
||||
7
vendor/yomitan/lib/hangul-js.js.map
vendored
Normal file
7
vendor/yomitan/lib/hangul-js.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
13367
vendor/yomitan/lib/kanji-processor.js
vendored
Normal file
13367
vendor/yomitan/lib/kanji-processor.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
7
vendor/yomitan/lib/kanji-processor.js.map
vendored
Normal file
7
vendor/yomitan/lib/kanji-processor.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
11301
vendor/yomitan/lib/linkedom.js
vendored
Normal file
11301
vendor/yomitan/lib/linkedom.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
vendor/yomitan/lib/linkedom.js.map
vendored
Normal file
7
vendor/yomitan/lib/linkedom.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
8071
vendor/yomitan/lib/parse5.js
vendored
Normal file
8071
vendor/yomitan/lib/parse5.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
vendor/yomitan/lib/parse5.js.map
vendored
Normal file
7
vendor/yomitan/lib/parse5.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
585
vendor/yomitan/lib/resvg-wasm.js
vendored
Normal file
585
vendor/yomitan/lib/resvg-wasm.js
vendored
Normal file
@@ -0,0 +1,585 @@
|
||||
// @ts-nocheck
|
||||
|
||||
// node_modules/@resvg/resvg-wasm/index.mjs
|
||||
var wasm;
|
||||
var heap = new Array(128).fill(void 0);
|
||||
heap.push(void 0, null, true, false);
|
||||
var heap_next = heap.length;
|
||||
function addHeapObject(obj) {
|
||||
if (heap_next === heap.length)
|
||||
heap.push(heap.length + 1);
|
||||
const idx = heap_next;
|
||||
heap_next = heap[idx];
|
||||
heap[idx] = obj;
|
||||
return idx;
|
||||
}
|
||||
function getObject(idx) {
|
||||
return heap[idx];
|
||||
}
|
||||
function dropObject(idx) {
|
||||
if (idx < 132)
|
||||
return;
|
||||
heap[idx] = heap_next;
|
||||
heap_next = idx;
|
||||
}
|
||||
function takeObject(idx) {
|
||||
const ret = getObject(idx);
|
||||
dropObject(idx);
|
||||
return ret;
|
||||
}
|
||||
var WASM_VECTOR_LEN = 0;
|
||||
var cachedUint8Memory0 = null;
|
||||
function getUint8Memory0() {
|
||||
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
||||
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
||||
}
|
||||
return cachedUint8Memory0;
|
||||
}
|
||||
var cachedTextEncoder = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : { encode: () => {
|
||||
throw Error("TextEncoder not available");
|
||||
} };
|
||||
var encodeString = typeof cachedTextEncoder.encodeInto === "function" ? function(arg, view) {
|
||||
return cachedTextEncoder.encodeInto(arg, view);
|
||||
} : function(arg, view) {
|
||||
const buf = cachedTextEncoder.encode(arg);
|
||||
view.set(buf);
|
||||
return {
|
||||
read: arg.length,
|
||||
written: buf.length
|
||||
};
|
||||
};
|
||||
function passStringToWasm0(arg, malloc, realloc) {
|
||||
if (realloc === void 0) {
|
||||
const buf = cachedTextEncoder.encode(arg);
|
||||
const ptr2 = malloc(buf.length, 1) >>> 0;
|
||||
getUint8Memory0().subarray(ptr2, ptr2 + buf.length).set(buf);
|
||||
WASM_VECTOR_LEN = buf.length;
|
||||
return ptr2;
|
||||
}
|
||||
let len = arg.length;
|
||||
let ptr = malloc(len, 1) >>> 0;
|
||||
const mem = getUint8Memory0();
|
||||
let offset = 0;
|
||||
for (; offset < len; offset++) {
|
||||
const code = arg.charCodeAt(offset);
|
||||
if (code > 127)
|
||||
break;
|
||||
mem[ptr + offset] = code;
|
||||
}
|
||||
if (offset !== len) {
|
||||
if (offset !== 0) {
|
||||
arg = arg.slice(offset);
|
||||
}
|
||||
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
||||
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
||||
const ret = encodeString(arg, view);
|
||||
offset += ret.written;
|
||||
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
||||
}
|
||||
WASM_VECTOR_LEN = offset;
|
||||
return ptr;
|
||||
}
|
||||
function isLikeNone(x) {
|
||||
return x === void 0 || x === null;
|
||||
}
|
||||
var cachedInt32Memory0 = null;
|
||||
function getInt32Memory0() {
|
||||
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
||||
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
||||
}
|
||||
return cachedInt32Memory0;
|
||||
}
|
||||
var cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
||||
throw Error("TextDecoder not available");
|
||||
} };
|
||||
if (typeof TextDecoder !== "undefined") {
|
||||
cachedTextDecoder.decode();
|
||||
}
|
||||
function getStringFromWasm0(ptr, len) {
|
||||
ptr = ptr >>> 0;
|
||||
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
||||
}
|
||||
function _assertClass(instance, klass) {
|
||||
if (!(instance instanceof klass)) {
|
||||
throw new Error(`expected instance of ${klass.name}`);
|
||||
}
|
||||
return instance.ptr;
|
||||
}
|
||||
function handleError(f, args) {
|
||||
try {
|
||||
return f.apply(this, args);
|
||||
} catch (e) {
|
||||
wasm.__wbindgen_exn_store(addHeapObject(e));
|
||||
}
|
||||
}
|
||||
var BBoxFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
||||
}, unregister: () => {
|
||||
} } : new FinalizationRegistry((ptr) => wasm.__wbg_bbox_free(ptr >>> 0));
|
||||
var BBox = class _BBox {
|
||||
static __wrap(ptr) {
|
||||
ptr = ptr >>> 0;
|
||||
const obj = Object.create(_BBox.prototype);
|
||||
obj.__wbg_ptr = ptr;
|
||||
BBoxFinalization.register(obj, obj.__wbg_ptr, obj);
|
||||
return obj;
|
||||
}
|
||||
__destroy_into_raw() {
|
||||
const ptr = this.__wbg_ptr;
|
||||
this.__wbg_ptr = 0;
|
||||
BBoxFinalization.unregister(this);
|
||||
return ptr;
|
||||
}
|
||||
free() {
|
||||
const ptr = this.__destroy_into_raw();
|
||||
wasm.__wbg_bbox_free(ptr);
|
||||
}
|
||||
/**
|
||||
* @returns {number}
|
||||
*/
|
||||
get x() {
|
||||
const ret = wasm.__wbg_get_bbox_x(this.__wbg_ptr);
|
||||
return ret;
|
||||
}
|
||||
/**
|
||||
* @param {number} arg0
|
||||
*/
|
||||
set x(arg0) {
|
||||
wasm.__wbg_set_bbox_x(this.__wbg_ptr, arg0);
|
||||
}
|
||||
/**
|
||||
* @returns {number}
|
||||
*/
|
||||
get y() {
|
||||
const ret = wasm.__wbg_get_bbox_y(this.__wbg_ptr);
|
||||
return ret;
|
||||
}
|
||||
/**
|
||||
* @param {number} arg0
|
||||
*/
|
||||
set y(arg0) {
|
||||
wasm.__wbg_set_bbox_y(this.__wbg_ptr, arg0);
|
||||
}
|
||||
/**
|
||||
* @returns {number}
|
||||
*/
|
||||
get width() {
|
||||
const ret = wasm.__wbg_get_bbox_width(this.__wbg_ptr);
|
||||
return ret;
|
||||
}
|
||||
/**
|
||||
* @param {number} arg0
|
||||
*/
|
||||
set width(arg0) {
|
||||
wasm.__wbg_set_bbox_width(this.__wbg_ptr, arg0);
|
||||
}
|
||||
/**
|
||||
* @returns {number}
|
||||
*/
|
||||
get height() {
|
||||
const ret = wasm.__wbg_get_bbox_height(this.__wbg_ptr);
|
||||
return ret;
|
||||
}
|
||||
/**
|
||||
* @param {number} arg0
|
||||
*/
|
||||
set height(arg0) {
|
||||
wasm.__wbg_set_bbox_height(this.__wbg_ptr, arg0);
|
||||
}
|
||||
};
|
||||
var RenderedImageFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
||||
}, unregister: () => {
|
||||
} } : new FinalizationRegistry((ptr) => wasm.__wbg_renderedimage_free(ptr >>> 0));
|
||||
var RenderedImage = class _RenderedImage {
|
||||
static __wrap(ptr) {
|
||||
ptr = ptr >>> 0;
|
||||
const obj = Object.create(_RenderedImage.prototype);
|
||||
obj.__wbg_ptr = ptr;
|
||||
RenderedImageFinalization.register(obj, obj.__wbg_ptr, obj);
|
||||
return obj;
|
||||
}
|
||||
__destroy_into_raw() {
|
||||
const ptr = this.__wbg_ptr;
|
||||
this.__wbg_ptr = 0;
|
||||
RenderedImageFinalization.unregister(this);
|
||||
return ptr;
|
||||
}
|
||||
free() {
|
||||
const ptr = this.__destroy_into_raw();
|
||||
wasm.__wbg_renderedimage_free(ptr);
|
||||
}
|
||||
/**
|
||||
* Get the PNG width
|
||||
* @returns {number}
|
||||
*/
|
||||
get width() {
|
||||
const ret = wasm.renderedimage_width(this.__wbg_ptr);
|
||||
return ret >>> 0;
|
||||
}
|
||||
/**
|
||||
* Get the PNG height
|
||||
* @returns {number}
|
||||
*/
|
||||
get height() {
|
||||
const ret = wasm.renderedimage_height(this.__wbg_ptr);
|
||||
return ret >>> 0;
|
||||
}
|
||||
/**
|
||||
* Write the image data to Uint8Array
|
||||
* @returns {Uint8Array}
|
||||
*/
|
||||
asPng() {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.renderedimage_asPng(retptr, this.__wbg_ptr);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Get the RGBA pixels of the image
|
||||
* @returns {Uint8Array}
|
||||
*/
|
||||
get pixels() {
|
||||
const ret = wasm.renderedimage_pixels(this.__wbg_ptr);
|
||||
return takeObject(ret);
|
||||
}
|
||||
};
|
||||
var ResvgFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
||||
}, unregister: () => {
|
||||
} } : new FinalizationRegistry((ptr) => wasm.__wbg_resvg_free(ptr >>> 0));
|
||||
var Resvg = class {
|
||||
__destroy_into_raw() {
|
||||
const ptr = this.__wbg_ptr;
|
||||
this.__wbg_ptr = 0;
|
||||
ResvgFinalization.unregister(this);
|
||||
return ptr;
|
||||
}
|
||||
free() {
|
||||
const ptr = this.__destroy_into_raw();
|
||||
wasm.__wbg_resvg_free(ptr);
|
||||
}
|
||||
/**
|
||||
* @param {Uint8Array | string} svg
|
||||
* @param {string | undefined} [options]
|
||||
* @param {Array<any> | undefined} [custom_font_buffers]
|
||||
*/
|
||||
constructor(svg, options, custom_font_buffers) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
var ptr0 = isLikeNone(options) ? 0 : passStringToWasm0(options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
var len0 = WASM_VECTOR_LEN;
|
||||
wasm.resvg_new(retptr, addHeapObject(svg), ptr0, len0, isLikeNone(custom_font_buffers) ? 0 : addHeapObject(custom_font_buffers));
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
this.__wbg_ptr = r0 >>> 0;
|
||||
return this;
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Get the SVG width
|
||||
* @returns {number}
|
||||
*/
|
||||
get width() {
|
||||
const ret = wasm.resvg_width(this.__wbg_ptr);
|
||||
return ret;
|
||||
}
|
||||
/**
|
||||
* Get the SVG height
|
||||
* @returns {number}
|
||||
*/
|
||||
get height() {
|
||||
const ret = wasm.resvg_height(this.__wbg_ptr);
|
||||
return ret;
|
||||
}
|
||||
/**
|
||||
* Renders an SVG in Wasm
|
||||
* @returns {RenderedImage}
|
||||
*/
|
||||
render() {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.resvg_render(retptr, this.__wbg_ptr);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return RenderedImage.__wrap(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Output usvg-simplified SVG string
|
||||
* @returns {string}
|
||||
*/
|
||||
toString() {
|
||||
let deferred1_0;
|
||||
let deferred1_1;
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.resvg_toString(retptr, this.__wbg_ptr);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
deferred1_0 = r0;
|
||||
deferred1_1 = r1;
|
||||
return getStringFromWasm0(r0, r1);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Calculate a maximum bounding box of all visible elements in this SVG.
|
||||
*
|
||||
* Note: path bounding box are approx values.
|
||||
* @returns {BBox | undefined}
|
||||
*/
|
||||
innerBBox() {
|
||||
const ret = wasm.resvg_innerBBox(this.__wbg_ptr);
|
||||
return ret === 0 ? void 0 : BBox.__wrap(ret);
|
||||
}
|
||||
/**
|
||||
* Calculate a maximum bounding box of all visible elements in this SVG.
|
||||
* This will first apply transform.
|
||||
* Similar to `SVGGraphicsElement.getBBox()` DOM API.
|
||||
* @returns {BBox | undefined}
|
||||
*/
|
||||
getBBox() {
|
||||
const ret = wasm.resvg_getBBox(this.__wbg_ptr);
|
||||
return ret === 0 ? void 0 : BBox.__wrap(ret);
|
||||
}
|
||||
/**
|
||||
* Use a given `BBox` to crop the svg. Currently this method simply changes
|
||||
* the viewbox/size of the svg and do not move the elements for simplicity
|
||||
* @param {BBox} bbox
|
||||
*/
|
||||
cropByBBox(bbox) {
|
||||
_assertClass(bbox, BBox);
|
||||
wasm.resvg_cropByBBox(this.__wbg_ptr, bbox.__wbg_ptr);
|
||||
}
|
||||
/**
|
||||
* @returns {Array<any>}
|
||||
*/
|
||||
imagesToResolve() {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
wasm.resvg_imagesToResolve(retptr, this.__wbg_ptr);
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
||||
if (r2) {
|
||||
throw takeObject(r1);
|
||||
}
|
||||
return takeObject(r0);
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {string} href
|
||||
* @param {Uint8Array} buffer
|
||||
*/
|
||||
resolveImage(href, buffer) {
|
||||
try {
|
||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
||||
const ptr0 = passStringToWasm0(href, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
const len0 = WASM_VECTOR_LEN;
|
||||
wasm.resvg_resolveImage(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(buffer));
|
||||
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
||||
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
||||
if (r1) {
|
||||
throw takeObject(r0);
|
||||
}
|
||||
} finally {
|
||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
||||
}
|
||||
}
|
||||
};
|
||||
async function __wbg_load(module, imports) {
|
||||
if (typeof Response === "function" && module instanceof Response) {
|
||||
if (typeof WebAssembly.instantiateStreaming === "function") {
|
||||
try {
|
||||
return await WebAssembly.instantiateStreaming(module, imports);
|
||||
} catch (e) {
|
||||
if (module.headers.get("Content-Type") != "application/wasm") {
|
||||
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
const bytes = await module.arrayBuffer();
|
||||
return await WebAssembly.instantiate(bytes, imports);
|
||||
} else {
|
||||
const instance = await WebAssembly.instantiate(module, imports);
|
||||
if (instance instanceof WebAssembly.Instance) {
|
||||
return { instance, module };
|
||||
} else {
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
}
|
||||
function __wbg_get_imports() {
|
||||
const imports = {};
|
||||
imports.wbg = {};
|
||||
imports.wbg.__wbg_new_28c511d9baebfa89 = function(arg0, arg1) {
|
||||
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbindgen_memory = function() {
|
||||
const ret = wasm.memory;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_buffer_12d079cc21e14bdb = function(arg0) {
|
||||
const ret = getObject(arg0).buffer;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb = function(arg0, arg1, arg2) {
|
||||
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
||||
takeObject(arg0);
|
||||
};
|
||||
imports.wbg.__wbg_new_63b92bc8671ed464 = function(arg0) {
|
||||
const ret = new Uint8Array(getObject(arg0));
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_values_839f3396d5aac002 = function(arg0) {
|
||||
const ret = getObject(arg0).values();
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_next_196c84450b364254 = function() {
|
||||
return handleError(function(arg0) {
|
||||
const ret = getObject(arg0).next();
|
||||
return addHeapObject(ret);
|
||||
}, arguments);
|
||||
};
|
||||
imports.wbg.__wbg_done_298b57d23c0fc80c = function(arg0) {
|
||||
const ret = getObject(arg0).done;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_value_d93c65011f51a456 = function(arg0) {
|
||||
const ret = getObject(arg0).value;
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_instanceof_Uint8Array_2b3bbecd033d19f6 = function(arg0) {
|
||||
let result;
|
||||
try {
|
||||
result = getObject(arg0) instanceof Uint8Array;
|
||||
} catch (_) {
|
||||
result = false;
|
||||
}
|
||||
const ret = result;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
||||
const obj = getObject(arg1);
|
||||
const ret = typeof obj === "string" ? obj : void 0;
|
||||
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||
var len1 = WASM_VECTOR_LEN;
|
||||
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
||||
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
||||
};
|
||||
imports.wbg.__wbg_new_16b304a2cfa7ff4a = function() {
|
||||
const ret = new Array();
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
||||
const ret = getStringFromWasm0(arg0, arg1);
|
||||
return addHeapObject(ret);
|
||||
};
|
||||
imports.wbg.__wbg_push_a5b05aedc7234f9f = function(arg0, arg1) {
|
||||
const ret = getObject(arg0).push(getObject(arg1));
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_length_c20a40f15020d68a = function(arg0) {
|
||||
const ret = getObject(arg0).length;
|
||||
return ret;
|
||||
};
|
||||
imports.wbg.__wbg_set_a47bac70306a19a7 = function(arg0, arg1, arg2) {
|
||||
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
||||
};
|
||||
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
||||
throw new Error(getStringFromWasm0(arg0, arg1));
|
||||
};
|
||||
return imports;
|
||||
}
|
||||
function __wbg_init_memory(imports, maybe_memory) {
|
||||
}
|
||||
function __wbg_finalize_init(instance, module) {
|
||||
wasm = instance.exports;
|
||||
__wbg_init.__wbindgen_wasm_module = module;
|
||||
cachedInt32Memory0 = null;
|
||||
cachedUint8Memory0 = null;
|
||||
return wasm;
|
||||
}
|
||||
async function __wbg_init(input) {
|
||||
if (wasm !== void 0)
|
||||
return wasm;
|
||||
if (typeof input === "undefined") {
|
||||
input = new URL("index_bg.wasm", void 0);
|
||||
}
|
||||
const imports = __wbg_get_imports();
|
||||
if (typeof input === "string" || typeof Request === "function" && input instanceof Request || typeof URL === "function" && input instanceof URL) {
|
||||
input = fetch(input);
|
||||
}
|
||||
__wbg_init_memory(imports);
|
||||
const { instance, module } = await __wbg_load(await input, imports);
|
||||
return __wbg_finalize_init(instance, module);
|
||||
}
|
||||
var dist_default = __wbg_init;
|
||||
var initialized = false;
|
||||
var initWasm = async (module_or_path) => {
|
||||
if (initialized) {
|
||||
throw new Error("Already initialized. The `initWasm()` function can be used only once.");
|
||||
}
|
||||
await dist_default(await module_or_path);
|
||||
initialized = true;
|
||||
};
|
||||
var Resvg2 = class extends Resvg {
|
||||
/**
|
||||
* @param {Uint8Array | string} svg
|
||||
* @param {ResvgRenderOptions | undefined} options
|
||||
*/
|
||||
constructor(svg, options) {
|
||||
if (!initialized)
|
||||
throw new Error("Wasm has not been initialized. Call `initWasm()` function.");
|
||||
const font = options?.font;
|
||||
if (!!font && isCustomFontsOptions(font)) {
|
||||
const serializableOptions = {
|
||||
...options,
|
||||
font: {
|
||||
...font,
|
||||
fontBuffers: void 0
|
||||
}
|
||||
};
|
||||
super(svg, JSON.stringify(serializableOptions), font.fontBuffers);
|
||||
} else {
|
||||
super(svg, JSON.stringify(options));
|
||||
}
|
||||
}
|
||||
};
|
||||
function isCustomFontsOptions(value) {
|
||||
return Object.prototype.hasOwnProperty.call(value, "fontBuffers");
|
||||
}
|
||||
export {
|
||||
Resvg2 as Resvg,
|
||||
initWasm
|
||||
};
|
||||
//# sourceMappingURL=resvg-wasm.js.map
|
||||
7
vendor/yomitan/lib/resvg-wasm.js.map
vendored
Normal file
7
vendor/yomitan/lib/resvg-wasm.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
vendor/yomitan/lib/resvg.wasm
vendored
Normal file
BIN
vendor/yomitan/lib/resvg.wasm
vendored
Normal file
Binary file not shown.
60
vendor/yomitan/lib/ucs2length.js
vendored
Normal file
60
vendor/yomitan/lib/ucs2length.js
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
// @ts-nocheck
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
|
||||
// node_modules/ajv/dist/runtime/ucs2length.js
|
||||
var require_ucs2length = __commonJS({
|
||||
"node_modules/ajv/dist/runtime/ucs2length.js"(exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function ucs2length3(str) {
|
||||
const len = str.length;
|
||||
let length = 0;
|
||||
let pos = 0;
|
||||
let value;
|
||||
while (pos < len) {
|
||||
length++;
|
||||
value = str.charCodeAt(pos++);
|
||||
if (value >= 55296 && value <= 56319 && pos < len) {
|
||||
value = str.charCodeAt(pos);
|
||||
if ((value & 64512) === 56320)
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
return length;
|
||||
}
|
||||
exports.default = ucs2length3;
|
||||
ucs2length3.code = 'require("ajv/dist/runtime/ucs2length").default';
|
||||
}
|
||||
});
|
||||
|
||||
// dev/lib/ucs2length.js
|
||||
var import_ucs2length = __toESM(require_ucs2length(), 1);
|
||||
var ucs2length2 = import_ucs2length.default.default;
|
||||
export {
|
||||
ucs2length2 as ucs2length
|
||||
};
|
||||
//# sourceMappingURL=ucs2length.js.map
|
||||
7
vendor/yomitan/lib/ucs2length.js.map
vendored
Normal file
7
vendor/yomitan/lib/ucs2length.js.map
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../node_modules/ajv/lib/runtime/ucs2length.ts", "../../dev/lib/ucs2length.js"],
|
||||
"sourcesContent": ["// https://mathiasbynens.be/notes/javascript-encoding\n// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode\nexport default function ucs2length(str: string): number {\n const len = str.length\n let length = 0\n let pos = 0\n let value: number\n while (pos < len) {\n length++\n value = str.charCodeAt(pos++)\n if (value >= 0xd800 && value <= 0xdbff && pos < len) {\n // high surrogate, and there is a next character\n value = str.charCodeAt(pos)\n if ((value & 0xfc00) === 0xdc00) pos++ // low surrogate\n }\n }\n return length\n}\n\nucs2length.code = 'require(\"ajv/dist/runtime/ucs2length\").default'\n", "/*\n * Copyright (C) 2023-2025 Yomitan Authors\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <https://www.gnu.org/licenses/>.\n */\n\nimport ucs2length from 'ajv/dist/runtime/ucs2length.js';\n\nconst ucs2length2 = ucs2length.default;\n\nexport {ucs2length2 as ucs2length};\n"],
|
||||
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,aAAwBA,YAAW,KAAW;AAC5C,YAAM,MAAM,IAAI;AAChB,UAAI,SAAS;AACb,UAAI,MAAM;AACV,UAAI;AACJ,aAAO,MAAM,KAAK;AAChB;AACA,gBAAQ,IAAI,WAAW,KAAK;AAC5B,YAAI,SAAS,SAAU,SAAS,SAAU,MAAM,KAAK;AAEnD,kBAAQ,IAAI,WAAW,GAAG;AAC1B,eAAK,QAAQ,WAAY;AAAQ;QACnC;MACF;AACA,aAAO;IACT;AAfA,YAAA,UAAAA;AAiBA,IAAAA,YAAW,OAAO;;;;;ACFlB,wBAAuB;AAEvB,IAAM,cAAc,kBAAAC,QAAW;",
|
||||
"names": ["ucs2length", "ucs2length"]
|
||||
}
|
||||
5
vendor/yomitan/lib/validate-schemas.js
vendored
Normal file
5
vendor/yomitan/lib/validate-schemas.js
vendored
Normal file
File diff suppressed because one or more lines are too long
6457
vendor/yomitan/lib/z-worker.js
vendored
Normal file
6457
vendor/yomitan/lib/z-worker.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
7
vendor/yomitan/lib/z-worker.js.map
vendored
Normal file
7
vendor/yomitan/lib/z-worker.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
4233
vendor/yomitan/lib/zip.js
vendored
Normal file
4233
vendor/yomitan/lib/zip.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
vendor/yomitan/lib/zip.js.map
vendored
Normal file
7
vendor/yomitan/lib/zip.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user