diff --git a/components/onesearch/onesearch.tsx b/components/onesearch/onesearch.tsx
index 54374dd..41cd290 100644
--- a/components/onesearch/onesearch.tsx
+++ b/components/onesearch/onesearch.tsx
@@ -12,7 +12,7 @@ import { settingsAtom } from "lib/state/settings";
import PlainText from "./plainText";
import { sendError } from "lib/telemetering/sendError";
import { handleNLUResult } from "./handleNLUResult";
-import * as ort from 'onnxruntime-web';
+import * as ort from "onnxruntime-web";
import { useAtom, useAtomValue } from "jotai";
import i18next from "i18next";
import { useTranslation } from "react-i18next";
@@ -100,16 +100,15 @@ export default function OneSearch() {
const embeddingDict = getEmbeddingLayer(arrBuf);
setEmbeddingLayer(embeddingDict);
- await loadModel("/models/NLU.onnx");
+ await loadModel("/models/NLU.onnx");
// if (!modelLoaded) {
// console.error("NLU model was not correctly loaded.")
// }
})();
-
}, []);
async function loadModel(modelPath: string) {
- ort.env.wasm.wasmPaths = "/onnx/"
+ ort.env.wasm.wasmPaths = "/onnx/";
const session = await ort.InferenceSession.create(modelPath);
setNLUsession(session);
}
diff --git a/i18n/ar.json b/i18n/ar.json
index 73409e3..dabc2b4 100755
--- a/i18n/ar.json
+++ b/i18n/ar.json
@@ -1,10 +1,10 @@
{
- "search": {
- "placeholder": "ابحث أو اكتب عنوان URL"
- },
- "about": {
- "license": {
- "view": "← عرض"
- }
- }
+ "search": {
+ "placeholder": "ابحث أو اكتب عنوان URL"
+ },
+ "about": {
+ "license": {
+ "view": "← عرض"
+ }
+ }
}
diff --git a/i18n/en.json b/i18n/en.json
index d45c24a..2206878 100755
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -1,39 +1,39 @@
{
- "404": {
- "title": "Page not found"
- },
- "search": {
- "placeholder": "Search or type a URL",
- "engine-aria": "Switch search engine",
- "engine": {
- "google": "Google",
- "baidu": "Baidu",
- "bing": "Bing",
- "duckduckgo": "DuckDuckGo",
- "yandex": "Yandex",
- "yahoo": "Yahoo",
- "ecosia": "Ecosia"
- },
- "search-help-text": "Search {engine}"
- },
- "notfound": {
- "title": "page not found",
- "desc": "Please check if there is a typo in the URL.
If SparkHome brought you to this page,
please contact us."
- },
- "tools": {
- "base64": {
- "title": "Base64 tools - LuminaraUtils",
- "decode": "Decode",
- "encode": "Encode",
- "result": "Result: ",
- "copy": "Copy",
- "copied": "Copied"
- }
- },
- "about": {
- "title": "About sparkast",
- "license": {
- "view": "→ view"
- }
- }
+ "404": {
+ "title": "Page not found"
+ },
+ "search": {
+ "placeholder": "Search or type a URL",
+ "engine-aria": "Switch search engine",
+ "engine": {
+ "google": "Google",
+ "baidu": "Baidu",
+ "bing": "Bing",
+ "duckduckgo": "DuckDuckGo",
+ "yandex": "Yandex",
+ "yahoo": "Yahoo",
+ "ecosia": "Ecosia"
+ },
+ "search-help-text": "Search {engine}"
+ },
+ "notfound": {
+ "title": "page not found",
+ "desc": "Please check if there is a typo in the URL.
If SparkHome brought you to this page,
please contact us."
+ },
+ "tools": {
+ "base64": {
+ "title": "Base64 tools - LuminaraUtils",
+ "decode": "Decode",
+ "encode": "Encode",
+ "result": "Result: ",
+ "copy": "Copy",
+ "copied": "Copied"
+ }
+ },
+ "about": {
+ "title": "About sparkast",
+ "license": {
+ "view": "→ view"
+ }
+ }
}
diff --git a/i18n/ja.json b/i18n/ja.json
index 999c95e..6d61f3a 100644
--- a/i18n/ja.json
+++ b/i18n/ja.json
@@ -1,14 +1,14 @@
{
- "search": {
- "engine-aria": "検索エンジンを切り替える",
- "engine": {
- "google": "Google"
- },
- "placeholder": "検索またはURLを入力"
- },
- "about": {
- "license": {
- "view": "→ 見る"
- }
- }
+ "search": {
+ "engine-aria": "検索エンジンを切り替える",
+ "engine": {
+ "google": "Google"
+ },
+ "placeholder": "検索またはURLを入力"
+ },
+ "about": {
+ "license": {
+ "view": "→ 見る"
+ }
+ }
}
diff --git a/i18n/zh.json b/i18n/zh.json
index e22ab60..19c32d7 100644
--- a/i18n/zh.json
+++ b/i18n/zh.json
@@ -1,39 +1,39 @@
{
- "404": {
- "title": "页面未找到"
- },
- "search": {
- "placeholder": "搜索或输入网址",
- "engine-aria": "切换搜索引擎",
- "engine": {
- "google": "谷歌",
- "baidu": "百度",
- "bing": "必应",
- "duckduckgo": "DuckDuckGo",
- "yandex": "Yandex",
- "yahoo": "雅虎",
- "ecosia": "Ecosia"
- },
- "search-help-text": "用 {engine} 搜索"
- },
- "tools": {
- "base64": {
- "title": "Base64 工具",
- "decode": "解码",
- "encode": "编码",
- "result": "结果: ",
- "copy": "复制",
- "copied": "已复制"
- }
- },
- "notfound": {
- "desc": "请检查网址是否出错。
如果你从星火主页跳转到这里,
请 联系我们",
- "title": "网页不存在"
- },
- "about": {
- "title": "关于 sparkast",
- "license": {
- "view": "→ 查看"
- }
- }
+ "404": {
+ "title": "页面未找到"
+ },
+ "search": {
+ "placeholder": "搜索或输入网址",
+ "engine-aria": "切换搜索引擎",
+ "engine": {
+ "google": "谷歌",
+ "baidu": "百度",
+ "bing": "必应",
+ "duckduckgo": "DuckDuckGo",
+ "yandex": "Yandex",
+ "yahoo": "雅虎",
+ "ecosia": "Ecosia"
+ },
+ "search-help-text": "用 {engine} 搜索"
+ },
+ "tools": {
+ "base64": {
+ "title": "Base64 工具",
+ "decode": "解码",
+ "encode": "编码",
+ "result": "结果: ",
+ "copy": "复制",
+ "copied": "已复制"
+ }
+ },
+ "notfound": {
+ "desc": "请检查网址是否出错。
如果你从星火主页跳转到这里,
请 联系我们",
+ "title": "网页不存在"
+ },
+ "about": {
+ "title": "关于 sparkast",
+ "license": {
+ "view": "→ 查看"
+ }
+ }
}
diff --git a/package.json b/package.json
index cfd09a0..0bc707e 100644
--- a/package.json
+++ b/package.json
@@ -1,64 +1,64 @@
{
- "name": "sparkhome",
- "private": false,
- "version": "5.8.1",
- "type": "module",
- "scripts": {
- "dev": "bun server.ts",
- "build": "bun license-gen && tsc -b && vite build",
- "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
- "preview": "NODE_ENV=production bun server.ts",
- "license-gen": "bunx generate-license-file --input package.json --output lib/license.txt --overwrite",
- "format": "prettier --write ."
- },
- "dependencies": {
- "@iconify/react": "^5.0.1",
- "@nextui-org/react": "^2.4.2",
- "@types/bun": "^1.1.6",
- "@types/express": "^4.17.21",
- "@types/tr46": "^5.0.0",
- "@xenova/transformers": "^2.17.2",
- "cac": "^6.7.14",
- "chalk": "^5.3.0",
- "express": "^4.19.2",
- "fflate": "^0.8.2",
- "framer-motion": "^11.2.12",
- "generate-license-file": "^3.5.1",
- "i18next": "^23.11.5",
- "i18next-browser-languagedetector": "^8.0.0",
- "i18next-icu": "^2.3.0",
- "jest": "^29.7.0",
- "jotai": "^2.8.3",
- "node-nlp": "^4.27.0",
- "onnxruntime-web": "^1.20.0-dev.20240925-a47254eaef",
- "react": "^18.3.1",
- "react-dom": "^18.3.1",
- "react-i18next": "^14.1.2",
- "react-router": "^6.23.1",
- "react-router-dom": "^6.23.1",
- "tr46": "^5.0.0",
- "valid-url": "^1.0.9",
- "validate-color": "^2.2.4",
- "vite-express": "^0.17.0"
- },
- "devDependencies": {
- "@types/react": "^18.3.3",
- "@types/react-dom": "^18.3.0",
- "@types/valid-url": "^1.0.7",
- "@typescript-eslint/eslint-plugin": "^7.13.1",
- "@typescript-eslint/parser": "^7.13.1",
- "@vitejs/plugin-react-swc": "^3.5.0",
- "autoprefixer": "^10.4.19",
- "eslint": "^8.57.0",
- "eslint-plugin-react-hooks": "^4.6.2",
- "eslint-plugin-react-refresh": "^0.4.7",
- "postcss": "^8.4.38",
- "prettier": "^3.3.3",
- "tailwindcss": "^3.4.4",
- "typescript": "^5.2.2",
- "vite": "^5.3.1",
- "vite-plugin-chunk-split": "^0.5.0",
- "vite-plugin-pages": "^0.32.2",
- "vite-tsconfig-paths": "^4.3.2"
- }
+ "name": "sparkhome",
+ "private": false,
+ "version": "5.8.1",
+ "type": "module",
+ "scripts": {
+ "dev": "bun server.ts",
+ "build": "bun license-gen && tsc -b && vite build",
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
+ "preview": "NODE_ENV=production bun server.ts",
+ "license-gen": "bunx generate-license-file --input package.json --output lib/license.txt --overwrite",
+ "format": "prettier --write ."
+ },
+ "dependencies": {
+ "@iconify/react": "^5.0.1",
+ "@nextui-org/react": "^2.4.2",
+ "@types/bun": "^1.1.6",
+ "@types/express": "^4.17.21",
+ "@types/tr46": "^5.0.0",
+ "@xenova/transformers": "^2.17.2",
+ "cac": "^6.7.14",
+ "chalk": "^5.3.0",
+ "express": "^4.19.2",
+ "fflate": "^0.8.2",
+ "framer-motion": "^11.2.12",
+ "generate-license-file": "^3.5.1",
+ "i18next": "^23.11.5",
+ "i18next-browser-languagedetector": "^8.0.0",
+ "i18next-icu": "^2.3.0",
+ "jest": "^29.7.0",
+ "jotai": "^2.8.3",
+ "node-nlp": "^4.27.0",
+ "onnxruntime-web": "^1.20.0-dev.20240925-a47254eaef",
+ "react": "^18.3.1",
+ "react-dom": "^18.3.1",
+ "react-i18next": "^14.1.2",
+ "react-router": "^6.23.1",
+ "react-router-dom": "^6.23.1",
+ "tr46": "^5.0.0",
+ "valid-url": "^1.0.9",
+ "validate-color": "^2.2.4",
+ "vite-express": "^0.17.0"
+ },
+ "devDependencies": {
+ "@types/react": "^18.3.3",
+ "@types/react-dom": "^18.3.0",
+ "@types/valid-url": "^1.0.7",
+ "@typescript-eslint/eslint-plugin": "^7.13.1",
+ "@typescript-eslint/parser": "^7.13.1",
+ "@vitejs/plugin-react-swc": "^3.5.0",
+ "autoprefixer": "^10.4.19",
+ "eslint": "^8.57.0",
+ "eslint-plugin-react-hooks": "^4.6.2",
+ "eslint-plugin-react-refresh": "^0.4.7",
+ "postcss": "^8.4.38",
+ "prettier": "^3.3.3",
+ "tailwindcss": "^3.4.4",
+ "typescript": "^5.2.2",
+ "vite": "^5.3.1",
+ "vite-plugin-chunk-split": "^0.5.0",
+ "vite-plugin-pages": "^0.32.2",
+ "vite-tsconfig-paths": "^4.3.2"
+ }
}
diff --git a/pages/about/index.tsx b/pages/about/index.tsx
index fb2c009..b533e15 100644
--- a/pages/about/index.tsx
+++ b/pages/about/index.tsx
@@ -15,7 +15,10 @@ export default function AboutPage() {
sparkast
Made with ♥️ by - + alikia2x from Luminara Studio @@ -40,7 +43,7 @@ export default function AboutPage() { className="relative px-2 py-1 text-sm font-bold rounded-md text-nowrap underline bg-green-600 text-white" > - {t('about.license.view')} + {t("about.license.view")}
diff --git a/public/models/NLU_meta.json b/public/models/NLU_meta.json index b2394b3..2a5487d 100644 --- a/public/models/NLU_meta.json +++ b/public/models/NLU_meta.json @@ -1 +1,13 @@ -{"idx_to_class": {"0": "weather", "1": "base64", "2": "url-encode", "3": "html-encode", "4": "ai.command", "5": "knowledge", "6": "ai.question", "7": "datetime"}, "threshold": 1.7} \ No newline at end of file +{ + "idx_to_class": { + "0": "weather", + "1": "base64", + "2": "url-encode", + "3": "html-encode", + "4": "ai.command", + "5": "knowledge", + "6": "ai.question", + "7": "datetime" + }, + "threshold": 1.7 +} diff --git a/public/onnx/ort-wasm-simd-threaded.jsep.mjs b/public/onnx/ort-wasm-simd-threaded.jsep.mjs index a1943b3..1c86586 100644 --- a/public/onnx/ort-wasm-simd-threaded.jsep.mjs +++ b/public/onnx/ort-wasm-simd-threaded.jsep.mjs @@ -1,129 +1,2746 @@ - var ortWasmThreaded = (() => { - var _scriptName = import.meta.url; - - return ( -async function(moduleArg = {}) { - var moduleRtn; + var _scriptName = import.meta.url; -function e(){l.buffer!=q.buffer&&t();return q}function w(){l.buffer!=q.buffer&&t();return ba}function ca(){l.buffer!=q.buffer&&t();return da}function ea(){l.buffer!=q.buffer&&t();return fa}function z(){l.buffer!=q.buffer&&t();return ha}function A(){l.buffer!=q.buffer&&t();return ia}function ja(){l.buffer!=q.buffer&&t();return ka}function la(){l.buffer!=q.buffer&&t();return ma} -var B=Object.assign({},moduleArg),na,oa,pa=new Promise((a,b)=>{na=a;oa=b}),qa="object"==typeof window,C="function"==typeof importScripts,D="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,E=C&&"em-pthread"==self.name;if(D){const {createRequire:a}=await import("module");var require=a(import.meta.url),ra=require("worker_threads");global.Worker=ra.Worker;E=(C=!ra.mc)&&"em-pthread"==ra.workerData}"use strict"; -B.mountExternalData=(a,b)=>{a.startsWith("./")&&(a=a.substring(2));(B.Fb||(B.Fb=new Map)).set(a,b)};B.unmountExternalData=()=>{delete B.Fb};var SharedArrayBuffer=globalThis.SharedArrayBuffer??(new WebAssembly.Memory({initial:0,maximum:0,shared:!0})).buffer.constructor;"use strict"; -let ta=()=>{const a=(c,d,f)=>(...g)=>{const k=F,m=d?.();g=c(...g);const p=d?.();m!==p&&(c=p,f(m),d=f=null);return F!=k?sa():g},b=c=>async(...d)=>{try{if(B.Eb)throw Error("Session already started");const f=B.Eb={cc:d[0],errors:[]},g=await c(...d);if(B.Eb!==f)throw Error("Session mismatch");B.Mb?.flush();const k=f.errors;if(0>>0],z=Gc[a];0===v||10===v?((1===a?ra:I)(sc(z,0)),z.length=0):z.push(v)}f+=q}u()[d>>>2>>>0]=f;return 0}var Hc=[31,29,31,30,31,30,31,31,30,31,30,31],Ic=[31,28,31,30,31,30,31,31,30,31,30,31];function Jc(a){var b=Array(tc(a)+1);uc(a,b,0,b.length);return b}var Kc=(a,b)=>{aa().set(a,b>>>0)}; -function Pb(a,b,c,d){function f(e,p,t){for(e="number"==typeof e?e.toString():e||"";e.lengthXb?-1:0
J-e.getDate())p-=J-e.getDate()+1,e.setDate(1),11>t?e.setMonth(t+1):(e.setMonth(0),e.setFullYear(e.getFullYear()+1));else{e.setDate(e.getDate()+p);break}}t=new Date(e.getFullYear()+1,0,4);p=q(new Date(e.getFullYear(), -0,4));t=q(t);return 0>=k(p,e)?0>=k(t,e)?e.getFullYear()+1:e.getFullYear():e.getFullYear()-1}a>>>=0;b>>>=0;c>>>=0;d>>>=0;var v=u()[d+40>>>2>>>0];d={gb:r()[d>>>2>>>0],fb:r()[d+4>>>2>>>0],Va:r()[d+8>>>2>>>0],Ya:r()[d+12>>>2>>>0],Wa:r()[d+16>>>2>>>0],Ta:r()[d+20>>>2>>>0],Qa:r()[d+24>>>2>>>0],Sa:r()[d+28>>>2>>>0],ob:r()[d+32>>>2>>>0],eb:r()[d+36>>>2>>>0],hb:v?Q(v):""};c=Q(c);v={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y", -"%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var z in v)c=c.replace(new RegExp(z,"g"),v[z]);var Yb="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),Zb="January February March April May June July August September October November December".split(" ");v={"%a":e=>Yb[e.Qa].substring(0,3), -"%A":e=>Yb[e.Qa],"%b":e=>Zb[e.Wa].substring(0,3),"%B":e=>Zb[e.Wa],"%C":e=>h((e.Ta+1900)/100|0,2),"%d":e=>h(e.Ya,2),"%e":e=>f(e.Ya,2," "),"%g":e=>y(e).toString().substring(2),"%G":y,"%H":e=>h(e.Va,2),"%I":e=>{e=e.Va;0==e?e=12:12 {for(var p=0,t=0;t<=e.Wa-1;p+=(X(e.Ta+1900)?Hc:Ic)[t++]);return h(e.Ya+p,3)},"%m":e=>h(e.Wa+1,2),"%M":e=>h(e.fb,2),"%n":()=>"\n","%p":e=>0<=e.Va&&12>e.Va?"AM":"PM","%S":e=>h(e.gb,2),"%t":()=>"\t","%u":e=>e.Qa||7,"%U":e=>h(Math.floor((e.Sa+ -7-e.Qa)/7),2),"%V":e=>{var p=Math.floor((e.Sa+7-(e.Qa+6)%7)/7);2>=(e.Qa+371-e.Sa-2)%7&&p++;if(p)53==p&&(t=(e.Qa+371-e.Sa)%7,4==t||3==t&&X(e.Ta)||(p=1));else{p=52;var t=(e.Qa+7-e.Sa-1)%7;(4==t||5==t&&X(e.Ta%400-1))&&p++}return h(p,2)},"%w":e=>e.Qa,"%W":e=>h(Math.floor((e.Sa+7-(e.Qa+6)%7)/7),2),"%y":e=>(e.Ta+1900).toString().substring(2),"%Y":e=>e.Ta+1900,"%z":e=>{e=e.eb;var p=0<=e;e=Math.abs(e)/60;return(p?"+":"-")+String("0000"+(e/60*100+e%60)).slice(-4)},"%Z":e=>e.hb,"%%":()=>"%"};c=c.replace(/%%/g, -"\x00\x00");for(z in v)c.includes(z)&&(c=c.replace(new RegExp(z,"g"),v[z](d)));c=c.replace(/\0\0/g,"%");z=Jc(c);if(z.length>b)return 0;Kc(z,a);return z.length-1}function Qb(a,b,c,d){return Pb(a>>>0,b>>>0,c>>>0,d>>>0)}C||fc(); -var xc=[Ob,dc,qc,Wa,Xa,Ya,Za,$a,ab,bb,cb,db,eb,fb,gb,hb,sb,tb,Hb,Ib,Kb,Lb,Mb,Nb],Sa,Z=function(){function a(c,d){Z=c.exports;Z=Lc();ec.push(Z.Ea);mc=Z.Fa;Ha.unshift(Z.$);Ea=d;Ka();return Z}var b=va();O++;if(w.instantiateWasm)try{return w.instantiateWasm(b,a)}catch(c){I(`Module.instantiateWasm callback failed with error: ${c}`),x(c)}Na||=w.locateFile?Ma("ort-wasm-simd-threaded.wasm")?"ort-wasm-simd-threaded.wasm":w.locateFile?w.locateFile("ort-wasm-simd-threaded.wasm",F):F+"ort-wasm-simd-threaded.wasm": -(new URL("ort-wasm-simd-threaded.wasm",import.meta.url)).href;Ra(b,function(c){a(c.instance,c.module)}).catch(x);return{}}();w._OrtInit=(a,b)=>(w._OrtInit=Z.aa)(a,b);w._OrtGetLastError=(a,b)=>(w._OrtGetLastError=Z.ba)(a,b);w._OrtCreateSessionOptions=(a,b,c,d,f,h,k,q,y,v)=>(w._OrtCreateSessionOptions=Z.ca)(a,b,c,d,f,h,k,q,y,v);w._OrtAppendExecutionProvider=(a,b)=>(w._OrtAppendExecutionProvider=Z.da)(a,b);w._OrtAddFreeDimensionOverride=(a,b,c)=>(w._OrtAddFreeDimensionOverride=Z.ea)(a,b,c); -w._OrtAddSessionConfigEntry=(a,b,c)=>(w._OrtAddSessionConfigEntry=Z.fa)(a,b,c);w._OrtReleaseSessionOptions=a=>(w._OrtReleaseSessionOptions=Z.ga)(a);w._OrtCreateSession=(a,b,c)=>(w._OrtCreateSession=Z.ha)(a,b,c);w._OrtReleaseSession=a=>(w._OrtReleaseSession=Z.ia)(a);w._OrtGetInputOutputCount=(a,b,c)=>(w._OrtGetInputOutputCount=Z.ja)(a,b,c);w._OrtGetInputName=(a,b)=>(w._OrtGetInputName=Z.ka)(a,b);w._OrtGetOutputName=(a,b)=>(w._OrtGetOutputName=Z.la)(a,b);w._OrtFree=a=>(w._OrtFree=Z.ma)(a); -w._OrtCreateTensor=(a,b,c,d,f,h)=>(w._OrtCreateTensor=Z.na)(a,b,c,d,f,h);w._OrtGetTensorData=(a,b,c,d,f)=>(w._OrtGetTensorData=Z.oa)(a,b,c,d,f);w._OrtReleaseTensor=a=>(w._OrtReleaseTensor=Z.pa)(a);w._OrtCreateRunOptions=(a,b,c,d)=>(w._OrtCreateRunOptions=Z.qa)(a,b,c,d);w._OrtAddRunConfigEntry=(a,b,c)=>(w._OrtAddRunConfigEntry=Z.ra)(a,b,c);w._OrtReleaseRunOptions=a=>(w._OrtReleaseRunOptions=Z.sa)(a);w._OrtCreateBinding=a=>(w._OrtCreateBinding=Z.ta)(a); -w._OrtBindInput=(a,b,c)=>(w._OrtBindInput=Z.ua)(a,b,c);w._OrtBindOutput=(a,b,c,d)=>(w._OrtBindOutput=Z.va)(a,b,c,d);w._OrtClearBoundOutputs=a=>(w._OrtClearBoundOutputs=Z.wa)(a);w._OrtReleaseBinding=a=>(w._OrtReleaseBinding=Z.xa)(a);w._OrtRunWithBinding=(a,b,c,d,f)=>(w._OrtRunWithBinding=Z.ya)(a,b,c,d,f);w._OrtRun=(a,b,c,d,f,h,k,q)=>(w._OrtRun=Z.za)(a,b,c,d,f,h,k,q);w._OrtEndProfiling=a=>(w._OrtEndProfiling=Z.Aa)(a);var K=()=>(K=Z.Ba)();w._malloc=a=>(w._malloc=Z.Ca)(a);w._free=a=>(w._free=Z.Da)(a); -var wa=(a,b,c,d,f,h)=>(wa=Z.Ga)(a,b,c,d,f,h),Da=()=>(Da=Z.Ha)(),bc=(a,b,c,d,f)=>(bc=Z.Ia)(a,b,c,d,f),hc=a=>(hc=Z.Ja)(a),Ba=a=>(Ba=Z.Ka)(a),vc=()=>(vc=Z.La)(),kc=(a,b)=>(kc=Z.Ma)(a,b),cc=a=>(cc=Z.Na)(a),ac=a=>(ac=Z.Oa)(a),$b=()=>($b=Z.Pa)();w.___start_em_js=834344;w.___stop_em_js=834405; -function Lc(){var a=Z;a=Object.assign({},a);var b=d=>()=>d()>>>0,c=d=>f=>d(f)>>>0;a.Ba=b(a.Ba);a.Ca=c(a.Ca);a.emscripten_main_runtime_thread_id=b(a.emscripten_main_runtime_thread_id);a.Oa=c(a.Oa);a.Pa=b(a.Pa);return a}w.stackSave=()=>$b();w.stackRestore=a=>cc(a);w.stackAlloc=a=>ac(a);w.UTF8ToString=Q;w.stringToUTF8=W;w.lengthBytesUTF8=tc;var Mc;P=function Nc(){Mc||Oc();Mc||(P=Nc)}; -function Oc(){0 { + ha = a; + x = b; + }), + ja = "object" == typeof window, + A = "function" == typeof importScripts, + B = + "object" == typeof process && + "object" == typeof process.versions && + "string" == typeof process.versions.node, + C = A && "em-pthread" == self.name; + if (B) { + const { createRequire: a } = await import("module"); + var require = a(import.meta.url), + D = require("worker_threads"); + global.Worker = D.Worker; + C = (A = !D.lb) && "em-pthread" == D.workerData; + } + ("use strict"); + w.mountExternalData = (a, b) => { + a.startsWith("./") && (a = a.substring(2)); + (w.Ua || (w.Ua = new Map())).set(a, b); + }; + w.unmountExternalData = () => { + delete w.Ua; + }; + var SharedArrayBuffer = + globalThis.SharedArrayBuffer ?? + new WebAssembly.Memory({ initial: 0, maximum: 0, shared: !0 }).buffer.constructor, + ka = Object.assign({}, w), + la = "./this.program", + E = (a, b) => { + throw b; + }, + F = "", + ma, + G, + H; + if (B) { + var fs = require("fs"), + na = require("path"); + F = require("url").fileURLToPath(new URL("./", import.meta.url)); + ma = (a, b) => { + a = oa(a) ? new URL(a) : na.normalize(a); + return fs.readFileSync(a, b ? void 0 : "utf8"); + }; + H = (a) => { + a = ma(a, !0); + a.buffer || (a = new Uint8Array(a)); + return a; + }; + G = (a, b, c, d = !0) => { + a = oa(a) ? new URL(a) : na.normalize(a); + fs.readFile(a, d ? void 0 : "utf8", (f, h) => { + f ? c(f) : b(d ? h.buffer : h); + }); + }; + !w.thisProgram && 1 < process.argv.length && (la = process.argv[1].replace(/\\/g, "/")); + process.argv.slice(2); + E = (a, b) => { + process.exitCode = a; + throw b; + }; + } else if (ja || A) + A + ? (F = self.location.href) + : "undefined" != typeof document && + document.currentScript && + (F = document.currentScript.src), + _scriptName && (F = _scriptName), + F.startsWith("blob:") + ? (F = "") + : (F = F.substr(0, F.replace(/[?#].*/, "").lastIndexOf("/") + 1)), + B || + ((ma = (a) => { + var b = new XMLHttpRequest(); + b.open("GET", a, !1); + b.send(null); + return b.responseText; + }), + A && + (H = (a) => { + var b = new XMLHttpRequest(); + b.open("GET", a, !1); + b.responseType = "arraybuffer"; + b.send(null); + return new Uint8Array(b.response); + }), + (G = (a, b, c) => { + var d = new XMLHttpRequest(); + d.open("GET", a, !0); + d.responseType = "arraybuffer"; + d.onload = () => { + 200 == d.status || (0 == d.status && d.response) ? b(d.response) : c(); + }; + d.onerror = c; + d.send(null); + })); + B && + "undefined" == typeof performance && + (global.performance = require("perf_hooks").performance); + var pa = console.log.bind(console), + qa = console.error.bind(console); + B && + ((pa = (...a) => fs.writeSync(1, a.join(" ") + "\n")), + (qa = (...a) => fs.writeSync(2, a.join(" ") + "\n"))); + var ra = pa, + I = qa; + Object.assign(w, ka); + ka = null; + if (C) { + var sa; + if (B) { + var ta = D.parentPort; + ta.on("message", (b) => onmessage({ data: b })); + Object.assign(globalThis, { + self: global, + importScripts: () => {}, + postMessage: (b) => ta.postMessage(b), + performance: global.performance || { now: Date.now } + }); + } + var ua = !1; + I = function (...b) { + b = b.join(" "); + B ? fs.writeSync(2, b + "\n") : console.error(b); + }; + self.alert = function (...b) { + postMessage({ Za: "alert", text: b.join(" "), nb: K() }); + }; + w.instantiateWasm = (b, c) => + new Promise((d) => { + sa = (f) => { + f = new WebAssembly.Instance(f, va()); + c(f); + d(); + }; + }); + self.onunhandledrejection = (b) => { + throw b.reason || b; + }; + function a(b) { + try { + var c = b.data, + d = c.cmd; + if ("load" === d) { + let f = []; + self.onmessage = (h) => f.push(h); + self.startWorker = () => { + postMessage({ cmd: "loaded" }); + for (let h of f) a(h); + self.onmessage = a; + }; + for (const h of c.handlers) + if (!w[h] || w[h].proxy) + (w[h] = (...k) => { + postMessage({ Za: "callHandler", kb: h, args: k }); + }), + "print" == h && (ra = w[h]), + "printErr" == h && (I = w[h]); + g = c.wasmMemory; + m(); + sa(c.wasmModule); + } else if ("run" === d) { + wa(c.pthread_ptr, 0, 0, 1, 0, 0); + xa(c.pthread_ptr); + ya(); + za(); + ua ||= !0; + try { + Aa(c.start_routine, c.arg); + } catch (f) { + if ("unwind" != f) throw f; + } + } else + "cancel" === d + ? K() && Ba(-1) + : "setimmediate" !== c.target && + ("checkMailbox" === d + ? ua && Ca() + : d && (I(`worker: received unknown command ${d}`), I(c))); + } catch (f) { + throw (Da(), f); + } + } + self.onmessage = a; + } + var L; + w.wasmBinary && (L = w.wasmBinary); + var g, + Ea, + Fa = !1, + M, + l, + ba, + ca, + da, + N, + fa; + function m() { + var a = g.buffer; + w.HEAP8 = l = new Int8Array(a); + w.HEAP16 = new Int16Array(a); + w.HEAPU8 = ba = new Uint8Array(a); + w.HEAPU16 = new Uint16Array(a); + w.HEAP32 = ca = new Int32Array(a); + w.HEAPU32 = da = new Uint32Array(a); + w.HEAPF32 = new Float32Array(a); + w.HEAPF64 = fa = new Float64Array(a); + w.HEAP64 = N = new BigInt64Array(a); + w.HEAPU64 = new BigUint64Array(a); + } + if (!C) { + g = new WebAssembly.Memory({ initial: 256, maximum: 65536, shared: !0 }); + if (!(g.buffer instanceof SharedArrayBuffer)) + throw ( + (I( + "requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag" + ), + B && + I( + "(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and/or recent version)" + ), + Error("bad memory")) + ); + m(); + } + var Ga = [], + Ha = [], + Ia = [], + O = 0, + Ja = null, + P = null; + function Ka() { + O--; + if (0 == O && (null !== Ja && (clearInterval(Ja), (Ja = null)), P)) { + var a = P; + P = null; + a(); + } + } + function La(a) { + a = "Aborted(" + a + ")"; + I(a); + Fa = !0; + M = 1; + a = new WebAssembly.RuntimeError(a + ". Build with -sASSERTIONS for more info."); + x(a); + throw a; + } + var Ma = (a) => a.startsWith("data:application/octet-stream;base64,"), + oa = (a) => a.startsWith("file://"), + Na; + function Oa(a) { + if (a == Na && L) return new Uint8Array(L); + if (H) return H(a); + throw "both async and sync fetching of the wasm failed"; + } + function Pa(a) { + if (!L && (ja || A)) { + if ("function" == typeof fetch && !oa(a)) + return fetch(a, { credentials: "same-origin" }) + .then((b) => { + if (!b.ok) throw `failed to load wasm binary file at '${a}'`; + return b.arrayBuffer(); + }) + .catch(() => Oa(a)); + if (G) + return new Promise((b, c) => { + G(a, (d) => b(new Uint8Array(d)), c); + }); + } + return Promise.resolve().then(() => Oa(a)); + } + function Qa(a, b, c) { + return Pa(a) + .then((d) => WebAssembly.instantiate(d, b)) + .then(c, (d) => { + I(`failed to asynchronously prepare wasm: ${d}`); + La(d); + }); + } + function Ra(a, b) { + var c = Na; + return L || + "function" != typeof WebAssembly.instantiateStreaming || + Ma(c) || + oa(c) || + B || + "function" != typeof fetch + ? Qa(c, a, b) + : fetch(c, { credentials: "same-origin" }).then((d) => + WebAssembly.instantiateStreaming(d, a).then(b, function (f) { + I(`wasm streaming compile failed: ${f}`); + I("falling back to ArrayBuffer instantiation"); + return Qa(c, a, b); + }) + ); + } + function va() { + Sa = { + j: Ta, + b: Ua, + E: Va, + g: Wa, + V: Xa, + A: Ya, + C: Za, + W: $a, + T: ab, + L: bb, + S: cb, + o: db, + B: eb, + y: fb, + U: gb, + z: hb, + _: ib, + Z: jb, + P: kb, + w: lb, + F: mb, + k: nb, + O: xa, + Y: ob, + I: pb, + J: qb, + K: rb, + G: sb, + H: tb, + v: ub, + q: vb, + l: wb, + p: xb, + e: yb, + X: zb, + x: Ab, + d: Bb, + f: Cb, + i: Db, + u: Eb, + t: Fb, + s: Gb, + Q: Hb, + R: Ib, + D: Jb, + h: Kb, + n: Lb, + M: Mb, + m: Nb, + a: g, + r: Ob, + N: Pb, + c: Qb + }; + return { a: Sa }; + } + var Rb = { + 833604: (a, b, c, d, f) => { + if ("undefined" == typeof w || !w.Ua) return 1; + a = Q(a >>> 0); + a.startsWith("./") && (a = a.substring(2)); + a = w.Ua.get(a); + if (!a) return 2; + b >>>= 0; + c >>>= 0; + d >>>= 0; + if (b + c > a.byteLength) return 3; + try { + const h = a.subarray(b, b + c); + switch (f) { + case 0: + n().set(h, d >>> 0); + break; + case 1: + w.mb(d, h); + break; + default: + return 4; + } + return 0; + } catch { + return 4; + } + }, + 834287: () => "undefined" !== typeof wasmOffsetConverter + }; + function Ta() { + return "undefined" !== typeof wasmOffsetConverter; + } + function Sb(a) { + this.name = "ExitStatus"; + this.message = `Program terminated with exit(${a})`; + this.status = a; + } + var Tb = (a) => { + a.terminate(); + a.onmessage = () => {}; + }, + Wb = (a) => { + 0 == R.length && (Ub(), Vb(R[0])); + var b = R.pop(); + if (!b) return 6; + S.push(b); + T[a.Ra] = b; + b.Ra = a.Ra; + var c = { cmd: "run", start_routine: a.cb, arg: a.ab, pthread_ptr: a.Ra }; + B && b.unref(); + b.postMessage(c, a.ib); + return 0; + }, + U = 0, + V = (a, b, ...c) => { + for ( + var d = 2 * c.length, f = $b(), h = ac(8 * d), k = h >>> 3, q = 0; + q < c.length; + q++ + ) { + var y = c[q]; + "bigint" == typeof y + ? ((N[k + 2 * q] = 1n), (N[k + 2 * q + 1] = y)) + : ((N[k + 2 * q] = 0n), (ea()[(k + 2 * q + 1) >>> 0] = y)); + } + a = bc(a, 0, d, h, b); + cc(f); + return a; + }; + function Ob(a) { + if (C) return V(0, 1, a); + M = a; + if (!(0 < U)) { + for (var b of S) Tb(b); + for (b of R) Tb(b); + R = []; + S = []; + T = []; + Fa = !0; + } + E(a, new Sb(a)); + } + function dc(a) { + if (C) return V(1, 0, a); + Jb(a); + } + var Jb = (a) => { + M = a; + if (C) throw (dc(a), "unwind"); + Ob(a); + }, + R = [], + S = [], + ec = [], + T = {}; + function fc() { + for (var a = w.numThreads - 1; a--; ) Ub(); + Ga.unshift(() => { + O++; + gc(() => Ka()); + }); + } + var ic = (a) => { + var b = a.Ra; + delete T[b]; + R.push(a); + S.splice(S.indexOf(a), 1); + a.Ra = 0; + hc(b); + }; + function za() { + ec.forEach((a) => a()); + } + var Vb = (a) => + new Promise((b) => { + a.onmessage = (h) => { + h = h.data; + var k = h.cmd; + if (h.targetThread && h.targetThread != K()) { + var q = T[h.targetThread]; + q + ? q.postMessage(h, h.transferList) + : I( + `Internal error! Worker sent a message "${k}" to target pthread ${h.targetThread}, but that thread no longer exists!` + ); + } else if ("checkMailbox" === k) Ca(); + else if ("spawnThread" === k) Wb(h); + else if ("cleanupThread" === k) ic(T[h.thread]); + else if ("killThread" === k) + (h = h.thread), + (k = T[h]), + delete T[h], + Tb(k), + hc(h), + S.splice(S.indexOf(k), 1), + (k.Ra = 0); + else if ("cancelThread" === k) T[h.thread].postMessage({ cmd: "cancel" }); + else if ("loaded" === k) (a.loaded = !0), B && !a.Ra && a.unref(), b(a); + else if ("alert" === k) alert(`Thread ${h.threadId}: ${h.text}`); + else if ("setimmediate" === h.target) a.postMessage(h); + else if ("callHandler" === k) w[h.handler](...h.args); + else k && I(`worker sent an unknown command ${k}`); + }; + a.onerror = (h) => { + I(`${"worker sent an error!"} ${h.filename}:${h.lineno}: ${h.message}`); + throw h; + }; + B && + (a.on("message", (h) => a.onmessage({ data: h })), + a.on("error", (h) => a.onerror(h))); + var c = [], + d = [], + f; + for (f of d) w.hasOwnProperty(f) && c.push(f); + a.postMessage({ cmd: "load", handlers: c, wasmMemory: g, wasmModule: Ea }); + }); + function gc(a) { + C ? a() : Promise.all(R.map(Vb)).then(a); + } + function Ub() { + var a = new Worker(new URL(import.meta.url), { + type: "module", + workerData: "em-pthread", + name: "em-pthread" + }); + R.push(a); + } + var jc = (a) => { + for (; 0 < a.length; ) a.shift()(w); + }, + ya = () => { + var a = K(), + b = u()[((a + 52) >>> 2) >>> 0]; + a = u()[((a + 56) >>> 2) >>> 0]; + kc(b, b - a); + cc(b); + }, + lc = [], + mc, + Aa = (a, b) => { + U = 0; + var c = lc[a]; + c || (a >= lc.length && (lc.length = a + 1), (lc[a] = c = mc.get(a))); + a = c(b); + 0 < U ? (M = a) : Ba(a); + }; + class nc { + constructor(a) { + this.Xa = a - 24; + } + } + var oc = 0, + pc = 0; + function Ua(a, b, c) { + a >>>= 0; + var d = new nc(a); + b >>>= 0; + c >>>= 0; + u()[((d.Xa + 16) >>> 2) >>> 0] = 0; + u()[((d.Xa + 4) >>> 2) >>> 0] = b; + u()[((d.Xa + 8) >>> 2) >>> 0] = c; + oc = a; + pc++; + throw oc; + } + function qc(a, b, c, d) { + return C ? V(2, 1, a, b, c, d) : Va(a, b, c, d); + } + function Va(a, b, c, d) { + a >>>= 0; + b >>>= 0; + c >>>= 0; + d >>>= 0; + if ("undefined" == typeof SharedArrayBuffer) + return ( + I( + "Current environment does not support SharedArrayBuffer, pthreads are not available!" + ), + 6 + ); + var f = []; + if (C && 0 === f.length) return qc(a, b, c, d); + a = { cb: c, Ra: a, ab: d, ib: f }; + return C ? ((a.Za = "spawnThread"), postMessage(a, f), 0) : Wb(a); + } + var rc = "undefined" != typeof TextDecoder ? new TextDecoder("utf8") : void 0, + sc = (a, b, c) => { + b >>>= 0; + var d = b + c; + for (c = b; a[c] && !(c >= d); ) ++c; + if (16 < c - b && a.buffer && rc) + return rc.decode( + a.buffer instanceof SharedArrayBuffer ? a.slice(b, c) : a.subarray(b, c) + ); + for (d = ""; b < c; ) { + var f = a[b++]; + if (f & 128) { + var h = a[b++] & 63; + if (192 == (f & 224)) d += String.fromCharCode(((f & 31) << 6) | h); + else { + var k = a[b++] & 63; + f = + 224 == (f & 240) + ? ((f & 15) << 12) | (h << 6) | k + : ((f & 7) << 18) | (h << 12) | (k << 6) | (a[b++] & 63); + 65536 > f + ? (d += String.fromCharCode(f)) + : ((f -= 65536), + (d += String.fromCharCode( + 55296 | (f >> 10), + 56320 | (f & 1023) + ))); + } + } else d += String.fromCharCode(f); + } + return d; + }, + Q = (a, b) => ((a >>>= 0) ? sc(n(), a, b) : ""); + function Wa(a, b, c) { + return C ? V(3, 1, a, b, c) : 0; + } + function Xa(a, b) { + if (C) return V(4, 1, a, b); + } + var tc = (a) => { + for (var b = 0, c = 0; c < a.length; ++c) { + var d = a.charCodeAt(c); + 127 >= d + ? b++ + : 2047 >= d + ? (b += 2) + : 55296 <= d && 57343 >= d + ? ((b += 4), ++c) + : (b += 3); + } + return b; + }, + uc = (a, b, c, d) => { + c >>>= 0; + if (!(0 < d)) return 0; + var f = c; + d = c + d - 1; + for (var h = 0; h < a.length; ++h) { + var k = a.charCodeAt(h); + if (55296 <= k && 57343 >= k) { + var q = a.charCodeAt(++h); + k = (65536 + ((k & 1023) << 10)) | (q & 1023); + } + if (127 >= k) { + if (c >= d) break; + b[c++ >>> 0] = k; + } else { + if (2047 >= k) { + if (c + 1 >= d) break; + b[c++ >>> 0] = 192 | (k >> 6); + } else { + if (65535 >= k) { + if (c + 2 >= d) break; + b[c++ >>> 0] = 224 | (k >> 12); + } else { + if (c + 3 >= d) break; + b[c++ >>> 0] = 240 | (k >> 18); + b[c++ >>> 0] = 128 | ((k >> 12) & 63); + } + b[c++ >>> 0] = 128 | ((k >> 6) & 63); + } + b[c++ >>> 0] = 128 | (k & 63); + } + } + b[c >>> 0] = 0; + return c - f; + }, + W = (a, b, c) => uc(a, n(), b, c); + function Ya(a, b) { + if (C) return V(5, 1, a, b); + } + function Za(a, b, c) { + if (C) return V(6, 1, a, b, c); + } + function $a(a, b, c) { + return C ? V(7, 1, a, b, c) : 0; + } + function ab(a, b) { + if (C) return V(8, 1, a, b); + } + function bb(a, b, c) { + if (C) return V(9, 1, a, b, c); + } + function cb(a, b, c, d) { + if (C) return V(10, 1, a, b, c, d); + } + function db(a, b, c, d) { + if (C) return V(11, 1, a, b, c, d); + } + function eb(a, b, c, d) { + if (C) return V(12, 1, a, b, c, d); + } + function fb(a) { + if (C) return V(13, 1, a); + } + function gb(a, b) { + if (C) return V(14, 1, a, b); + } + function hb(a, b, c) { + if (C) return V(15, 1, a, b, c); + } + var ib = () => { + La(""); + }, + jb = () => 1; + function kb(a) { + wa(a >>> 0, !A, 1, !ja, 131072, !1); + za(); + } + function xa(a) { + a >>>= 0; + "function" === typeof Atomics.jb && + (Atomics.jb(r(), a >>> 2, a).value.then(Ca), + (a += 128), + Atomics.store(r(), a >>> 2, 1)); + } + var Ca = () => { + var a = K(); + if (a && (xa(a), (a = vc), !Fa)) + try { + if ((a(), !(0 < U))) + try { + C ? Ba(M) : Jb(M); + } catch (b) { + b instanceof Sb || "unwind" == b || E(1, b); + } + } catch (b) { + b instanceof Sb || "unwind" == b || E(1, b); + } + }; + function lb(a, b) { + a >>>= 0; + a == b >>> 0 + ? setTimeout(Ca) + : C + ? postMessage({ targetThread: a, cmd: "checkMailbox" }) + : (a = T[a]) && a.postMessage({ cmd: "checkMailbox" }); + } + var wc = []; + function mb(a, b, c, d, f) { + b >>>= 0; + d /= 2; + wc.length = d; + c = (f >>> 0) >>> 3; + for (f = 0; f < d; f++) + wc[f] = N[c + 2 * f] ? N[c + 2 * f + 1] : ea()[(c + 2 * f + 1) >>> 0]; + return (b ? Rb[b] : xc[a])(...wc); + } + function nb(a) { + a >>>= 0; + C ? postMessage({ cmd: "cleanupThread", thread: a }) : ic(T[a]); + } + function ob(a) { + B && T[a >>> 0].ref(); + } + function pb(a, b) { + a = -9007199254740992 > a || 9007199254740992 < a ? NaN : Number(a); + b >>>= 0; + a = new Date(1e3 * a); + r()[(b >>> 2) >>> 0] = a.getUTCSeconds(); + r()[((b + 4) >>> 2) >>> 0] = a.getUTCMinutes(); + r()[((b + 8) >>> 2) >>> 0] = a.getUTCHours(); + r()[((b + 12) >>> 2) >>> 0] = a.getUTCDate(); + r()[((b + 16) >>> 2) >>> 0] = a.getUTCMonth(); + r()[((b + 20) >>> 2) >>> 0] = a.getUTCFullYear() - 1900; + r()[((b + 24) >>> 2) >>> 0] = a.getUTCDay(); + a = ((a.getTime() - Date.UTC(a.getUTCFullYear(), 0, 1, 0, 0, 0, 0)) / 864e5) | 0; + r()[((b + 28) >>> 2) >>> 0] = a; + } + var X = (a) => 0 === a % 4 && (0 !== a % 100 || 0 === a % 400), + yc = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335], + zc = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334]; + function qb(a, b) { + a = -9007199254740992 > a || 9007199254740992 < a ? NaN : Number(a); + b >>>= 0; + a = new Date(1e3 * a); + r()[(b >>> 2) >>> 0] = a.getSeconds(); + r()[((b + 4) >>> 2) >>> 0] = a.getMinutes(); + r()[((b + 8) >>> 2) >>> 0] = a.getHours(); + r()[((b + 12) >>> 2) >>> 0] = a.getDate(); + r()[((b + 16) >>> 2) >>> 0] = a.getMonth(); + r()[((b + 20) >>> 2) >>> 0] = a.getFullYear() - 1900; + r()[((b + 24) >>> 2) >>> 0] = a.getDay(); + var c = ((X(a.getFullYear()) ? yc : zc)[a.getMonth()] + a.getDate() - 1) | 0; + r()[((b + 28) >>> 2) >>> 0] = c; + r()[((b + 36) >>> 2) >>> 0] = -(60 * a.getTimezoneOffset()); + c = new Date(a.getFullYear(), 6, 1).getTimezoneOffset(); + var d = new Date(a.getFullYear(), 0, 1).getTimezoneOffset(); + a = (c != d && a.getTimezoneOffset() == Math.min(d, c)) | 0; + r()[((b + 32) >>> 2) >>> 0] = a; + } + function rb(a) { + a >>>= 0; + var b = new Date( + r()[((a + 20) >>> 2) >>> 0] + 1900, + r()[((a + 16) >>> 2) >>> 0], + r()[((a + 12) >>> 2) >>> 0], + r()[((a + 8) >>> 2) >>> 0], + r()[((a + 4) >>> 2) >>> 0], + r()[(a >>> 2) >>> 0], + 0 + ), + c = r()[((a + 32) >>> 2) >>> 0], + d = b.getTimezoneOffset(), + f = new Date(b.getFullYear(), 6, 1).getTimezoneOffset(), + h = new Date(b.getFullYear(), 0, 1).getTimezoneOffset(), + k = Math.min(h, f); + 0 > c + ? (r()[((a + 32) >>> 2) >>> 0] = Number(f != h && k == d)) + : 0 < c != (k == d) && + ((f = Math.max(h, f)), b.setTime(b.getTime() + 6e4 * ((0 < c ? k : f) - d))); + r()[((a + 24) >>> 2) >>> 0] = b.getDay(); + c = ((X(b.getFullYear()) ? yc : zc)[b.getMonth()] + b.getDate() - 1) | 0; + r()[((a + 28) >>> 2) >>> 0] = c; + r()[(a >>> 2) >>> 0] = b.getSeconds(); + r()[((a + 4) >>> 2) >>> 0] = b.getMinutes(); + r()[((a + 8) >>> 2) >>> 0] = b.getHours(); + r()[((a + 12) >>> 2) >>> 0] = b.getDate(); + r()[((a + 16) >>> 2) >>> 0] = b.getMonth(); + r()[((a + 20) >>> 2) >>> 0] = b.getYear(); + a = b.getTime(); + return BigInt(isNaN(a) ? -1 : a / 1e3); + } + function sb(a, b, c, d, f, h, k) { + return C ? V(16, 1, a, b, c, d, f, h, k) : -52; + } + function tb(a, b, c, d, f, h) { + if (C) return V(17, 1, a, b, c, d, f, h); + } + function ub(a, b, c, d) { + a >>>= 0; + b >>>= 0; + c >>>= 0; + d >>>= 0; + var f = new Date().getFullYear(), + h = new Date(f, 0, 1), + k = new Date(f, 6, 1); + f = h.getTimezoneOffset(); + var q = k.getTimezoneOffset(), + y = Math.max(f, q); + u()[(a >>> 2) >>> 0] = 60 * y; + r()[(b >>> 2) >>> 0] = Number(f != q); + a = (v) => + v.toLocaleTimeString(void 0, { hour12: !1, timeZoneName: "short" }).split(" ")[1]; + h = a(h); + k = a(k); + q < f ? (W(h, c, 17), W(k, d, 17)) : (W(h, d, 17), W(k, c, 17)); + } + var Ac = []; + function vb(a, b, c) { + a >>>= 0; + b >>>= 0; + c >>>= 0; + Ac.length = 0; + for (var d; (d = n()[b++ >>> 0]); ) { + var f = 105 != d; + f &= 112 != d; + c += f && c % 8 ? 4 : 0; + Ac.push( + 112 == d + ? u()[(c >>> 2) >>> 0] + : 106 == d + ? N[c >>> 3] + : 105 == d + ? r()[(c >>> 2) >>> 0] + : ea()[(c >>> 3) >>> 0] + ); + c += f ? 8 : 4; + } + return Rb[a](...Ac); + } + var wb = () => {}, + xb = () => Date.now(); + function yb(a, b) { + return I(Q(a >>> 0, b >>> 0)); + } + var zb = () => { + U += 1; + throw "unwind"; + }; + function Ab() { + return 4294901760; + } + var Bb; + Bb = () => performance.timeOrigin + performance.now(); + var Cb = () => (B ? require("os").cpus().length : navigator.hardwareConcurrency); + function Db() { + La("Cannot use emscripten_pc_get_function without -sUSE_OFFSET_CONVERTER"); + return 0; + } + function Eb(a) { + a >>>= 0; + var b = n().length; + if (a <= b || 4294901760 < a) return !1; + for (var c = 1; 4 >= c; c *= 2) { + var d = b * (1 + 0.2 / c); + d = Math.min(d, a + 100663296); + var f = Math; + d = Math.max(a, d); + a: { + f = + (f.min.call(f, 4294901760, d + ((65536 - (d % 65536)) % 65536)) - + g.buffer.byteLength + + 65535) / + 65536; + try { + g.grow(f); + m(); + var h = 1; + break a; + } catch (k) {} + h = void 0; + } + if (h) return !0; + } + return !1; + } + var Bc = () => { + La( + "Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER" + ); + return 0; + }, + Y = {}, + Cc = (a) => { + a.forEach((b) => { + var c = Bc(); + c && (Y[c] = b); + }); + }; + function Fb() { + var a = Error().stack.toString().split("\n"); + "Error" == a[0] && a.shift(); + Cc(a); + Y.$a = Bc(); + Y.bb = a; + return Y.$a; + } + function Gb(a, b, c) { + a >>>= 0; + b >>>= 0; + if (Y.$a == a) var d = Y.bb; + else (d = Error().stack.toString().split("\n")), "Error" == d[0] && d.shift(), Cc(d); + for (var f = 3; d[f] && Bc() != a; ) ++f; + for (a = 0; a < c && d[a + f]; ++a) r()[((b + 4 * a) >>> 2) >>> 0] = Bc(); + return a; + } + var Dc = {}, + Fc = () => { + if (!Ec) { + var a = { + USER: "web_user", + LOGNAME: "web_user", + PATH: "/", + PWD: "/", + HOME: "/home/web_user", + LANG: + ( + ("object" == typeof navigator && + navigator.languages && + navigator.languages[0]) || + "C" + ).replace("-", "_") + ".UTF-8", + _: la || "./this.program" + }, + b; + for (b in Dc) void 0 === Dc[b] ? delete a[b] : (a[b] = Dc[b]); + var c = []; + for (b in a) c.push(`${b}=${a[b]}`); + Ec = c; + } + return Ec; + }, + Ec; + function Hb(a, b) { + if (C) return V(18, 1, a, b); + a >>>= 0; + b >>>= 0; + var c = 0; + Fc().forEach((d, f) => { + var h = b + c; + f = u()[((a + 4 * f) >>> 2) >>> 0] = h; + for (h = 0; h < d.length; ++h) aa()[f++ >>> 0] = d.charCodeAt(h); + aa()[f >>> 0] = 0; + c += d.length + 1; + }); + return 0; + } + function Ib(a, b) { + if (C) return V(19, 1, a, b); + a >>>= 0; + b >>>= 0; + var c = Fc(); + u()[(a >>> 2) >>> 0] = c.length; + var d = 0; + c.forEach((f) => (d += f.length + 1)); + u()[(b >>> 2) >>> 0] = d; + return 0; + } + function Kb(a) { + return C ? V(20, 1, a) : 52; + } + function Lb(a, b, c, d) { + return C ? V(21, 1, a, b, c, d) : 52; + } + function Mb(a, b, c, d) { + return C ? V(22, 1, a, b, c, d) : 70; + } + var Gc = [null, [], []]; + function Nb(a, b, c, d) { + if (C) return V(23, 1, a, b, c, d); + b >>>= 0; + c >>>= 0; + d >>>= 0; + for (var f = 0, h = 0; h < c; h++) { + var k = u()[(b >>> 2) >>> 0], + q = u()[((b + 4) >>> 2) >>> 0]; + b += 8; + for (var y = 0; y < q; y++) { + var v = n()[(k + y) >>> 0], + z = Gc[a]; + 0 === v || 10 === v + ? ((1 === a ? ra : I)(sc(z, 0)), (z.length = 0)) + : z.push(v); + } + f += q; + } + u()[(d >>> 2) >>> 0] = f; + return 0; + } + var Hc = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], + Ic = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; + function Jc(a) { + var b = Array(tc(a) + 1); + uc(a, b, 0, b.length); + return b; + } + var Kc = (a, b) => { + aa().set(a, b >>> 0); + }; + function Pb(a, b, c, d) { + function f(e, p, t) { + for (e = "number" == typeof e ? e.toString() : e || ""; e.length < p; ) + e = t[0] + e; + return e; + } + function h(e, p) { + return f(e, p, "0"); + } + function k(e, p) { + function t(Xb) { + return 0 > Xb ? -1 : 0 < Xb ? 1 : 0; + } + var J; + 0 === (J = t(e.getFullYear() - p.getFullYear())) && + 0 === (J = t(e.getMonth() - p.getMonth())) && + (J = t(e.getDate() - p.getDate())); + return J; + } + function q(e) { + switch (e.getDay()) { + case 0: + return new Date(e.getFullYear() - 1, 11, 29); + case 1: + return e; + case 2: + return new Date(e.getFullYear(), 0, 3); + case 3: + return new Date(e.getFullYear(), 0, 2); + case 4: + return new Date(e.getFullYear(), 0, 1); + case 5: + return new Date(e.getFullYear() - 1, 11, 31); + case 6: + return new Date(e.getFullYear() - 1, 11, 30); + } + } + function y(e) { + var p = e.Sa; + for (e = new Date(new Date(e.Ta + 1900, 0, 1).getTime()); 0 < p; ) { + var t = e.getMonth(), + J = (X(e.getFullYear()) ? Hc : Ic)[t]; + if (p > J - e.getDate()) + (p -= J - e.getDate() + 1), + e.setDate(1), + 11 > t + ? e.setMonth(t + 1) + : (e.setMonth(0), e.setFullYear(e.getFullYear() + 1)); + else { + e.setDate(e.getDate() + p); + break; + } + } + t = new Date(e.getFullYear() + 1, 0, 4); + p = q(new Date(e.getFullYear(), 0, 4)); + t = q(t); + return 0 >= k(p, e) + ? 0 >= k(t, e) + ? e.getFullYear() + 1 + : e.getFullYear() + : e.getFullYear() - 1; + } + a >>>= 0; + b >>>= 0; + c >>>= 0; + d >>>= 0; + var v = u()[((d + 40) >>> 2) >>> 0]; + d = { + gb: r()[(d >>> 2) >>> 0], + fb: r()[((d + 4) >>> 2) >>> 0], + Va: r()[((d + 8) >>> 2) >>> 0], + Ya: r()[((d + 12) >>> 2) >>> 0], + Wa: r()[((d + 16) >>> 2) >>> 0], + Ta: r()[((d + 20) >>> 2) >>> 0], + Qa: r()[((d + 24) >>> 2) >>> 0], + Sa: r()[((d + 28) >>> 2) >>> 0], + ob: r()[((d + 32) >>> 2) >>> 0], + eb: r()[((d + 36) >>> 2) >>> 0], + hb: v ? Q(v) : "" + }; + c = Q(c); + v = { + "%c": "%a %b %d %H:%M:%S %Y", + "%D": "%m/%d/%y", + "%F": "%Y-%m-%d", + "%h": "%b", + "%r": "%I:%M:%S %p", + "%R": "%H:%M", + "%T": "%H:%M:%S", + "%x": "%m/%d/%y", + "%X": "%H:%M:%S", + "%Ec": "%c", + "%EC": "%C", + "%Ex": "%m/%d/%y", + "%EX": "%H:%M:%S", + "%Ey": "%y", + "%EY": "%Y", + "%Od": "%d", + "%Oe": "%e", + "%OH": "%H", + "%OI": "%I", + "%Om": "%m", + "%OM": "%M", + "%OS": "%S", + "%Ou": "%u", + "%OU": "%U", + "%OV": "%V", + "%Ow": "%w", + "%OW": "%W", + "%Oy": "%y" + }; + for (var z in v) c = c.replace(new RegExp(z, "g"), v[z]); + var Yb = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), + Zb = + "January February March April May June July August September October November December".split( + " " + ); + v = { + "%a": (e) => Yb[e.Qa].substring(0, 3), + "%A": (e) => Yb[e.Qa], + "%b": (e) => Zb[e.Wa].substring(0, 3), + "%B": (e) => Zb[e.Wa], + "%C": (e) => h(((e.Ta + 1900) / 100) | 0, 2), + "%d": (e) => h(e.Ya, 2), + "%e": (e) => f(e.Ya, 2, " "), + "%g": (e) => y(e).toString().substring(2), + "%G": y, + "%H": (e) => h(e.Va, 2), + "%I": (e) => { + e = e.Va; + 0 == e ? (e = 12) : 12 < e && (e -= 12); + return h(e, 2); + }, + "%j": (e) => { + for (var p = 0, t = 0; t <= e.Wa - 1; p += (X(e.Ta + 1900) ? Hc : Ic)[t++]); + return h(e.Ya + p, 3); + }, + "%m": (e) => h(e.Wa + 1, 2), + "%M": (e) => h(e.fb, 2), + "%n": () => "\n", + "%p": (e) => (0 <= e.Va && 12 > e.Va ? "AM" : "PM"), + "%S": (e) => h(e.gb, 2), + "%t": () => "\t", + "%u": (e) => e.Qa || 7, + "%U": (e) => h(Math.floor((e.Sa + 7 - e.Qa) / 7), 2), + "%V": (e) => { + var p = Math.floor((e.Sa + 7 - ((e.Qa + 6) % 7)) / 7); + 2 >= (e.Qa + 371 - e.Sa - 2) % 7 && p++; + if (p) + 53 == p && + ((t = (e.Qa + 371 - e.Sa) % 7), + 4 == t || (3 == t && X(e.Ta)) || (p = 1)); + else { + p = 52; + var t = (e.Qa + 7 - e.Sa - 1) % 7; + (4 == t || (5 == t && X((e.Ta % 400) - 1))) && p++; + } + return h(p, 2); + }, + "%w": (e) => e.Qa, + "%W": (e) => h(Math.floor((e.Sa + 7 - ((e.Qa + 6) % 7)) / 7), 2), + "%y": (e) => (e.Ta + 1900).toString().substring(2), + "%Y": (e) => e.Ta + 1900, + "%z": (e) => { + e = e.eb; + var p = 0 <= e; + e = Math.abs(e) / 60; + return (p ? "+" : "-") + String("0000" + ((e / 60) * 100 + (e % 60))).slice(-4); + }, + "%Z": (e) => e.hb, + "%%": () => "%" + }; + c = c.replace(/%%/g, "\x00\x00"); + for (z in v) c.includes(z) && (c = c.replace(new RegExp(z, "g"), v[z](d))); + c = c.replace(/\0\0/g, "%"); + z = Jc(c); + if (z.length > b) return 0; + Kc(z, a); + return z.length - 1; + } + function Qb(a, b, c, d) { + return Pb(a >>> 0, b >>> 0, c >>> 0, d >>> 0); + } + C || fc(); + var xc = [ + Ob, + dc, + qc, + Wa, + Xa, + Ya, + Za, + $a, + ab, + bb, + cb, + db, + eb, + fb, + gb, + hb, + sb, + tb, + Hb, + Ib, + Kb, + Lb, + Mb, + Nb + ], + Sa, + Z = (function () { + function a(c, d) { + Z = c.exports; + Z = Lc(); + ec.push(Z.Ea); + mc = Z.Fa; + Ha.unshift(Z.$); + Ea = d; + Ka(); + return Z; + } + var b = va(); + O++; + if (w.instantiateWasm) + try { + return w.instantiateWasm(b, a); + } catch (c) { + I(`Module.instantiateWasm callback failed with error: ${c}`), x(c); + } + Na ||= w.locateFile + ? Ma("ort-wasm-simd-threaded.wasm") + ? "ort-wasm-simd-threaded.wasm" + : w.locateFile + ? w.locateFile("ort-wasm-simd-threaded.wasm", F) + : F + "ort-wasm-simd-threaded.wasm" + : new URL("ort-wasm-simd-threaded.wasm", import.meta.url).href; + Ra(b, function (c) { + a(c.instance, c.module); + }).catch(x); + return {}; + })(); + w._OrtInit = (a, b) => (w._OrtInit = Z.aa)(a, b); + w._OrtGetLastError = (a, b) => (w._OrtGetLastError = Z.ba)(a, b); + w._OrtCreateSessionOptions = (a, b, c, d, f, h, k, q, y, v) => + (w._OrtCreateSessionOptions = Z.ca)(a, b, c, d, f, h, k, q, y, v); + w._OrtAppendExecutionProvider = (a, b) => (w._OrtAppendExecutionProvider = Z.da)(a, b); + w._OrtAddFreeDimensionOverride = (a, b, c) => + (w._OrtAddFreeDimensionOverride = Z.ea)(a, b, c); + w._OrtAddSessionConfigEntry = (a, b, c) => (w._OrtAddSessionConfigEntry = Z.fa)(a, b, c); + w._OrtReleaseSessionOptions = (a) => (w._OrtReleaseSessionOptions = Z.ga)(a); + w._OrtCreateSession = (a, b, c) => (w._OrtCreateSession = Z.ha)(a, b, c); + w._OrtReleaseSession = (a) => (w._OrtReleaseSession = Z.ia)(a); + w._OrtGetInputOutputCount = (a, b, c) => (w._OrtGetInputOutputCount = Z.ja)(a, b, c); + w._OrtGetInputName = (a, b) => (w._OrtGetInputName = Z.ka)(a, b); + w._OrtGetOutputName = (a, b) => (w._OrtGetOutputName = Z.la)(a, b); + w._OrtFree = (a) => (w._OrtFree = Z.ma)(a); + w._OrtCreateTensor = (a, b, c, d, f, h) => (w._OrtCreateTensor = Z.na)(a, b, c, d, f, h); + w._OrtGetTensorData = (a, b, c, d, f) => (w._OrtGetTensorData = Z.oa)(a, b, c, d, f); + w._OrtReleaseTensor = (a) => (w._OrtReleaseTensor = Z.pa)(a); + w._OrtCreateRunOptions = (a, b, c, d) => (w._OrtCreateRunOptions = Z.qa)(a, b, c, d); + w._OrtAddRunConfigEntry = (a, b, c) => (w._OrtAddRunConfigEntry = Z.ra)(a, b, c); + w._OrtReleaseRunOptions = (a) => (w._OrtReleaseRunOptions = Z.sa)(a); + w._OrtCreateBinding = (a) => (w._OrtCreateBinding = Z.ta)(a); + w._OrtBindInput = (a, b, c) => (w._OrtBindInput = Z.ua)(a, b, c); + w._OrtBindOutput = (a, b, c, d) => (w._OrtBindOutput = Z.va)(a, b, c, d); + w._OrtClearBoundOutputs = (a) => (w._OrtClearBoundOutputs = Z.wa)(a); + w._OrtReleaseBinding = (a) => (w._OrtReleaseBinding = Z.xa)(a); + w._OrtRunWithBinding = (a, b, c, d, f) => (w._OrtRunWithBinding = Z.ya)(a, b, c, d, f); + w._OrtRun = (a, b, c, d, f, h, k, q) => (w._OrtRun = Z.za)(a, b, c, d, f, h, k, q); + w._OrtEndProfiling = (a) => (w._OrtEndProfiling = Z.Aa)(a); + var K = () => (K = Z.Ba)(); + w._malloc = (a) => (w._malloc = Z.Ca)(a); + w._free = (a) => (w._free = Z.Da)(a); + var wa = (a, b, c, d, f, h) => (wa = Z.Ga)(a, b, c, d, f, h), + Da = () => (Da = Z.Ha)(), + bc = (a, b, c, d, f) => (bc = Z.Ia)(a, b, c, d, f), + hc = (a) => (hc = Z.Ja)(a), + Ba = (a) => (Ba = Z.Ka)(a), + vc = () => (vc = Z.La)(), + kc = (a, b) => (kc = Z.Ma)(a, b), + cc = (a) => (cc = Z.Na)(a), + ac = (a) => (ac = Z.Oa)(a), + $b = () => ($b = Z.Pa)(); + w.___start_em_js = 834344; + w.___stop_em_js = 834405; + function Lc() { + var a = Z; + a = Object.assign({}, a); + var b = (d) => () => d() >>> 0, + c = (d) => (f) => d(f) >>> 0; + a.Ba = b(a.Ba); + a.Ca = c(a.Ca); + a.emscripten_main_runtime_thread_id = b(a.emscripten_main_runtime_thread_id); + a.Oa = c(a.Oa); + a.Pa = b(a.Pa); + return a; + } + w.stackSave = () => $b(); + w.stackRestore = (a) => cc(a); + w.stackAlloc = (a) => ac(a); + w.UTF8ToString = Q; + w.stringToUTF8 = W; + w.lengthBytesUTF8 = tc; + var Mc; + P = function Nc() { + Mc || Oc(); + Mc || (P = Nc); + }; + function Oc() { + 0 < O || + (C + ? (ha(w), C || jc(Ha), startWorker(w)) + : (jc(Ga), + 0 < O || + Mc || + ((Mc = !0), + (w.calledRun = !0), + Fa || (C || jc(Ha), ha(w), C || jc(Ia))))); + } + Oc(); + moduleRtn = ia; - return moduleRtn; -} -); + return moduleRtn; + }; })(); export default ortWasmThreaded; -var isPthread = globalThis.self?.name === 'em-pthread'; -var isNode = typeof globalThis.process?.versions?.node == 'string'; -if (isNode) isPthread = (await import('worker_threads')).workerData === 'em-pthread'; +var isPthread = globalThis.self?.name === "em-pthread"; +var isNode = typeof globalThis.process?.versions?.node == "string"; +if (isNode) isPthread = (await import("worker_threads")).workerData === "em-pthread"; // When running as a pthread, construct a new instance on startup isPthread && ortWasmThreaded(); diff --git a/test/validIP.test.ts b/test/validIP.test.ts index c9ad381..be099fc 100644 --- a/test/validIP.test.ts +++ b/test/validIP.test.ts @@ -1,59 +1,59 @@ import { describe, expect, test } from "bun:test"; -import { isValidIPv4, } from "../lib/url/validLink"; +import { isValidIPv4 } from "../lib/url/validLink"; describe("Check if a string is a valid IPv4", () => { test("Invalid IPv4 addresses - Missing part", () => { expect(isValidIPv4("192.168.1")).toBe(false); expect(isValidIPv4("1")).toBe(false); }); - + test("Invalid IPv4 addresses - Contains non-digit characters", () => { expect(isValidIPv4("192.168.1.a")).toBe(false); expect(isValidIPv4("192.168.1.1a")).toBe(false); expect(isValidIPv4("192.168.1.1.1")).toBe(false); }); - + test("Invalid IPv4 addresses - Contains empty parts", () => { expect(isValidIPv4("192.168.1.")).toBe(false); expect(isValidIPv4("192..168.1")).toBe(false); }); - + test("Invalid IPv4 addresses - Contains negative numbers", () => { expect(isValidIPv4("192.168.-1.1")).toBe(false); }); - + test("Invalid IPv4 addresses - Contains out-of-range numbers", () => { expect(isValidIPv4("192.168.256.1")).toBe(false); expect(isValidIPv4("192.168.1.256")).toBe(false); }); - + test("Invalid IPv4 addresses - Contains multiple dots", () => { expect(isValidIPv4("192.168..1.1")).toBe(false); expect(isValidIPv4("192.168.1..1")).toBe(false); }); - + test("Invalid IPv4 addresses - Empty string", () => { expect(isValidIPv4("")).toBe(false); }); - + test("Invalid IPv4 addresses - Contains special characters", () => { expect(isValidIPv4("192.168.1.1!")).toBe(false); expect(isValidIPv4("192.168.1.1 ")).toBe(false); expect(isValidIPv4("192.168.1.1\t")).toBe(false); }); - + test("Invalid IPv4 addresses - Contains non-ASCII characters", () => { expect(isValidIPv4("192.168.1.1©")).toBe(false); }); - + test("Invalid IPv4 addresses - Contains newline character", () => { expect(isValidIPv4("192.168.1.1\n")).toBe(false); }); - + test("Invalid IPv4 addresses - Contains multiple IP addresses", () => { expect(isValidIPv4("192.168.1.1 192.168.1.2")).toBe(false); }); - + test("Invalid IPv4 addresses - Contains IPv6 address", () => { expect(isValidIPv4("2001:0db8:85a3:0000:0000:8a2e:0370:7334")).toBe(false); }); @@ -61,19 +61,19 @@ describe("Check if a string is a valid IPv4", () => { test("Valid IPv4 addresses - Standard IP", () => { expect(isValidIPv4("192.168.1.1")).toBe(true); }); - + test("Valid IPv4 addresses - All zeros", () => { expect(isValidIPv4("0.0.0.0")).toBe(true); }); - + test("Valid IPv4 addresses - Maximum value", () => { expect(isValidIPv4("255.255.255.255")).toBe(true); }); - + test("Valid IPv4 addresses - Leading zero but valid", () => { expect(isValidIPv4("192.000.001.001")).toBe(true); }); - + test("Valid IPv4 addresses - Single digit parts", () => { expect(isValidIPv4("1.2.3.4")).toBe(true); });