diff --git a/.github/workflows/ci-checks.yaml b/.github/workflows/ci-checks.yaml index d7add6dd..ea06e501 100644 --- a/.github/workflows/ci-checks.yaml +++ b/.github/workflows/ci-checks.yaml @@ -11,19 +11,14 @@ jobs: uses: actions/checkout@v2 - name: Install nightly toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - target: wasm32-unknown-unknown + uses: actions-rust-lang/setup-rust-toolchain@v1 - name: Run cargo check uses: actions-rs/cargo@v1 with: command: check args: --target=wasm32-unknown-unknown - + clippy: name: Lint (clippy) runs-on: ubuntu-latest @@ -32,11 +27,8 @@ jobs: uses: actions/checkout@v4 - name: Install nightly toolchain with clippy available - uses: actions-rs/toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v1 with: - profile: minimal - toolchain: nightly - override: true components: clippy - name: Run cargo clippy @@ -45,7 +37,7 @@ jobs: command: clippy args: --all-targets -- -D warnings - rustfmt: + fmt: name: Format runs-on: ubuntu-latest steps: @@ -53,32 +45,36 @@ jobs: uses: actions/checkout@v4 - name: Install nightly toolchain with rustfmt available - uses: actions-rs/toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v1 with: - profile: minimal - toolchain: nightly - override: true components: rustfmt + - name: Install node + uses: actions/setup-node@v3 + with: + node-version: "20.x" + + - name: Run npm install + uses: bahmutov/npm-install@v1 + - name: Run cargo fmt uses: actions-rs/cargo@v1 with: command: fmt args: --all -- --check - - test: - name: Run unit tests + + - name: Run prettier + run: npm run format:check + + unit-test: + name: Run rust unit tests runs-on: ubuntu-latest steps: - name: Checkout sources uses: actions/checkout@v2 - name: Install nightly toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true + uses: actions-rust-lang/setup-rust-toolchain@v1 - name: Run cargo test uses: actions-rs/cargo@v1 @@ -102,4 +98,44 @@ jobs: --skip looks::think::tests_debug::js_functions_match_declared_types --skip looks::think::tests_non_debug::js_functions_match_declared_types --skip js_functions - + + integration-test: + name: Run integration tests + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install nightly rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + + - name: Install wasm-bindgen-cli + uses: baptiste0928/cargo-install@v3 + with: + crate: wasm-bindgen-cli + + - name: Install cargo-outdir + uses: baptiste0928/cargo-install@v3 + with: + crate: cargo-outdir + + - name: Install node + uses: actions/setup-node@v6 + with: + node-version: "25.x" + cache: "npm" + + - name: Run npm install + uses: bahmutov/npm-install@v1 + + - name: Install binaryen + uses: bahmutov/npm-install@v1 + with: + install-command: npm i -g binaryen@nightly + cache-key-prefix: binaryen + + - name: Build + run: chmod +x build.sh && ./build.sh -Wpz + + - name: Run integration tests + run: npm run test diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ff2306ea..0af7fcd0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,7 +7,7 @@ jobs: name: Build WASM & website runs-on: ubuntu-latest env: - BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} permissions: contents: write steps: @@ -15,62 +15,56 @@ jobs: uses: actions/checkout@v4 - name: Install nightly toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - target: wasm32-unknown-unknown - - - name: Install wasm-bindgen - uses: actions-rs/cargo@v1 + uses: actions-rust-lang/setup-rust-toolchain@v1 + + - name: Install wasm-bindgen-cli + uses: baptiste0928/cargo-install@v3 with: - command: install - args: -f wasm-bindgen-cli - + crate: wasm-bindgen-cli + - name: Install cargo-outdir - uses: actions-rs/cargo@v1 + uses: baptiste0928/cargo-install@v3 with: - command: install - args: cargo-outdir + crate: cargo-outdir - - name: Install binaryen - run: sudo apt-get install binaryen - - name: Install node - uses: actions/setup-node@v3 + uses: actions/setup-node@v6 with: - node-version: "20.x" - + node-version: "25.x" + cache: "npm" + - name: Run npm install - run: | - npm install - npm i -g vite - npm i -g binaryen@nightly - + uses: bahmutov/npm-install@v1 + + - name: Install binaryen + uses: bahmutov/npm-install@v1 + with: + install-command: npm i -g binaryen@nightly + cache-key-prefix: binaryen + - name: Build env: VITE_HASH_HISTORY: true run: | chmod +x build.sh && ./build.sh -Wpz - vite build --base=/hyperquark/$BRANCH_NAME/ - + npx vite build --base=/hyperquark/$BRANCH_NAME/ + - name: Move files to tmp run: mv ./playground/dist /tmp/hq-dist - + - name: checkout gh-pages uses: actions/checkout@v4 with: ref: gh-pages - + - name: move file to gh-pages run: | rm -rf ./$BRANCH_NAME mv /tmp/hq-dist ./$BRANCH_NAME #mv ./main/* ./ - + - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v5 with: branch: gh-pages - push_options: '--force-with-lease' + push_options: "--force-with-lease" diff --git a/.gitignore b/.gitignore index 620490e8..d70c7dad 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,6 @@ /js/imports.ts /js/opcodes.js /node_modules/ -/package-lock.json /playground/dist/ /.vite/ /.vscode/ diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..dd449725 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +*.md diff --git a/README.md b/README.md index 150fb804..cca31900 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ HyperQuark compiles [Scratch](https://scratch.mit.edu) projects to [WebAssembly] ## Prerequisites -- [Rust](https://rust-lang.org) v1.65.0 or later +- [Rust](https://rust-lang.org) with a nightly toolchain - install via [rustup](https://rustup.rs) - the `wasm32-unknown-unknown` target (`rustup target add wasm32-unknown-unknown`) - wasm-bindgen-cli (`cargo install -f wasm-bindgen-cli`) - wasm-opt (install binaryen using whatever package manager you use) diff --git a/hq-test.project.json b/hq-test.project.json deleted file mode 100644 index 60c877dd..00000000 --- a/hq-test.project.json +++ /dev/null @@ -1 +0,0 @@ -{"targets":[{"isStage":true,"name":"Stage","variables":{"Li]%7ap~.rXkBAo4UoIe":["Global Var 1",6.7]},"lists":{},"broadcasts":{},"blocks":{"T+`U{ZSBO.-CS0QIDdig":{"opcode":"event_whenflagclicked","next":"?leT0]uqi9eyzfe/!Rq9","parent":null,"inputs":{},"fields":{},"shadow":false,"topLevel":true,"x":459,"y":59,"comment":"qJJ]K-$YaIHRe2Rt=7hI"},"?leT0]uqi9eyzfe/!Rq9":{"opcode":"looks_say","next":"LlGJ-?7HaZY:kc6m}e_W","parent":"T+`U{ZSBO.-CS0QIDdig","inputs":{"MESSAGE":[3,"/gZ@Vh!~TMo$;PRQ;WLl",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"/gZ@Vh!~TMo$;PRQ;WLl":{"opcode":"operator_add","next":null,"parent":"?leT0]uqi9eyzfe/!Rq9","inputs":{"NUM1":[1,[4,"4"]],"NUM2":[1,[4,"1"]]},"fields":{},"shadow":false,"topLevel":false},"LlGJ-?7HaZY:kc6m}e_W":{"opcode":"looks_think","next":"Ce?$v9Dp{B+;we4vQ*e/","parent":"?leT0]uqi9eyzfe/!Rq9","inputs":{"MESSAGE":[1,[10,"5"]]},"fields":{},"shadow":false,"topLevel":false},"Ce?$v9Dp{B+;we4vQ*e/":{"opcode":"looks_say","next":"qVjE`F=a50L=ocDzYw-n","parent":"LlGJ-?7HaZY:kc6m}e_W","inputs":{"MESSAGE":[3,"FU;Mq_*j2ul[=jag{$(2",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"FU;Mq_*j2ul[=jag{$(2":{"opcode":"operator_subtract","next":null,"parent":"Ce?$v9Dp{B+;we4vQ*e/","inputs":{"NUM1":[1,[4,"3"]],"NUM2":[1,[4,"1"]]},"fields":{},"shadow":false,"topLevel":false},"qVjE`F=a50L=ocDzYw-n":{"opcode":"looks_think","next":"E$rKW^hH@0cm]`#1M{XB","parent":"Ce?$v9Dp{B+;we4vQ*e/","inputs":{"MESSAGE":[1,[10,"2"]]},"fields":{},"shadow":false,"topLevel":false},"E$rKW^hH@0cm]`#1M{XB":{"opcode":"looks_say","next":"5H$:+a+%uD4:r+S!HHd^","parent":"qVjE`F=a50L=ocDzYw-n","inputs":{"MESSAGE":[3,"mVe`bf/e,7P)_EG^TQiq",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"mVe`bf/e,7P)_EG^TQiq":{"opcode":"operator_multiply","next":null,"parent":"E$rKW^hH@0cm]`#1M{XB","inputs":{"NUM1":[1,[4,"3"]],"NUM2":[1,[4,"4"]]},"fields":{},"shadow":false,"topLevel":false},"5H$:+a+%uD4:r+S!HHd^":{"opcode":"looks_think","next":"vTa=sZ,nD22l91ULx76U","parent":"E$rKW^hH@0cm]`#1M{XB","inputs":{"MESSAGE":[1,[10,"12"]]},"fields":{},"shadow":false,"topLevel":false},"vTa=sZ,nD22l91ULx76U":{"opcode":"looks_say","next":"Z(Vk}Qz,mm:dxdHW^^xY","parent":"5H$:+a+%uD4:r+S!HHd^","inputs":{"MESSAGE":[3,"MIqR5FM^g7~Iy2u#6G7G",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"MIqR5FM^g7~Iy2u#6G7G":{"opcode":"operator_divide","next":null,"parent":"vTa=sZ,nD22l91ULx76U","inputs":{"NUM1":[1,[4,"5"]],"NUM2":[1,[4,"2"]]},"fields":{},"shadow":false,"topLevel":false},"Z(Vk}Qz,mm:dxdHW^^xY":{"opcode":"looks_think","next":"2)tRX@uNnRg2ZHzeltXq","parent":"vTa=sZ,nD22l91ULx76U","inputs":{"MESSAGE":[1,[10,"2.5"]]},"fields":{},"shadow":false,"topLevel":false},"2)tRX@uNnRg2ZHzeltXq":{"opcode":"looks_say","next":"/sFg]bx*xcV@f-JeNP#d","parent":"Z(Vk}Qz,mm:dxdHW^^xY","inputs":{"MESSAGE":[3,"ZZJVTjqcBgtZIZf0807J",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"ZZJVTjqcBgtZIZf0807J":{"opcode":"operator_divide","next":null,"parent":"2)tRX@uNnRg2ZHzeltXq","inputs":{"NUM1":[1,[4,"6"]],"NUM2":[1,[4,"3"]]},"fields":{},"shadow":false,"topLevel":false},"/sFg]bx*xcV@f-JeNP#d":{"opcode":"looks_think","next":null,"parent":"2)tRX@uNnRg2ZHzeltXq","inputs":{"MESSAGE":[1,[10,"2"]]},"fields":{},"shadow":false,"topLevel":false},"35fcD$zFxzS)3RfQH*UZ":{"opcode":"event_whenflagclicked","next":"5nTw`Yk$$98}(-h:.FYg","parent":null,"inputs":{},"fields":{},"shadow":false,"topLevel":true,"x":48,"y":64,"comment":"r0KYt*J$TbBy@xmhmCat"},"5nTw`Yk$$98}(-h:.FYg":{"opcode":"looks_say","next":"hllHH%9J5gkHsO^!=zq-","parent":"35fcD$zFxzS)3RfQH*UZ","inputs":{"MESSAGE":[3,"/oYgv_:XySn-5X4Oa1`1",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"/oYgv_:XySn-5X4Oa1`1":{"opcode":"operator_mod","next":null,"parent":"5nTw`Yk$$98}(-h:.FYg","inputs":{"NUM1":[1,[4,"7"]],"NUM2":[1,[4,"4"]]},"fields":{},"shadow":false,"topLevel":false},"hllHH%9J5gkHsO^!=zq-":{"opcode":"looks_think","next":"O2Sq{bamNuDV7N4]!oPQ","parent":"5nTw`Yk$$98}(-h:.FYg","inputs":{"MESSAGE":[1,[10,"3"]]},"fields":{},"shadow":false,"topLevel":false},"O2Sq{bamNuDV7N4]!oPQ":{"opcode":"looks_say","next":"V_:J:q6trSR_BCO6`#G{","parent":"hllHH%9J5gkHsO^!=zq-","inputs":{"MESSAGE":[3,"!AVC7vETYw4G=e.RiX*m",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"!AVC7vETYw4G=e.RiX*m":{"opcode":"operator_mod","next":null,"parent":"O2Sq{bamNuDV7N4]!oPQ","inputs":{"NUM1":[1,[4,"-7"]],"NUM2":[1,[4,"4"]]},"fields":{},"shadow":false,"topLevel":false},"V_:J:q6trSR_BCO6`#G{":{"opcode":"looks_think","next":"2S!/:nwzSH7b3^4bZ]Eh","parent":"O2Sq{bamNuDV7N4]!oPQ","inputs":{"MESSAGE":[1,[10,"1"]]},"fields":{},"shadow":false,"topLevel":false},"2S!/:nwzSH7b3^4bZ]Eh":{"opcode":"looks_say","next":"Og$P@7HBoNu2[?#{SIT|","parent":"V_:J:q6trSR_BCO6`#G{","inputs":{"MESSAGE":[3,"05W:c^]=yq=c8,2TS5*i",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"05W:c^]=yq=c8,2TS5*i":{"opcode":"operator_mod","next":null,"parent":"2S!/:nwzSH7b3^4bZ]Eh","inputs":{"NUM1":[1,[4,"7"]],"NUM2":[1,[4,"-4"]]},"fields":{},"shadow":false,"topLevel":false},"Og$P@7HBoNu2[?#{SIT|":{"opcode":"looks_think","next":"rluNkj~9OpM^G.NTGJ~,","parent":"2S!/:nwzSH7b3^4bZ]Eh","inputs":{"MESSAGE":[1,[10,"-1"]]},"fields":{},"shadow":false,"topLevel":false},"rluNkj~9OpM^G.NTGJ~,":{"opcode":"looks_say","next":"}Yp,]NV91);7v^]xZ-V3","parent":"Og$P@7HBoNu2[?#{SIT|","inputs":{"MESSAGE":[3,"U:z@?vojF/vY[31nUYES",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"U:z@?vojF/vY[31nUYES":{"opcode":"operator_mod","next":null,"parent":"rluNkj~9OpM^G.NTGJ~,","inputs":{"NUM1":[1,[4,"-7"]],"NUM2":[1,[4,"-4"]]},"fields":{},"shadow":false,"topLevel":false},"}Yp,]NV91);7v^]xZ-V3":{"opcode":"looks_think","next":"Rx7JHq!7UoBb]j{r^Z;Q","parent":"rluNkj~9OpM^G.NTGJ~,","inputs":{"MESSAGE":[1,[10,"-3"]]},"fields":{},"shadow":false,"topLevel":false},"Rx7JHq!7UoBb]j{r^Z;Q":{"opcode":"looks_say","next":"DQE9m:9p=h/1,Pg1Zq5W","parent":"}Yp,]NV91);7v^]xZ-V3","inputs":{"MESSAGE":[3,"K%W*d~JPl@.W~LIUER{,",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"K%W*d~JPl@.W~LIUER{,":{"opcode":"operator_mod","next":null,"parent":"Rx7JHq!7UoBb]j{r^Z;Q","inputs":{"NUM1":[1,[4,"8.5"]],"NUM2":[1,[4,"3.4"]]},"fields":{},"shadow":false,"topLevel":false},"DQE9m:9p=h/1,Pg1Zq5W":{"opcode":"looks_think","next":"mn/mYPSru1?OoSkmAlHK","parent":"Rx7JHq!7UoBb]j{r^Z;Q","inputs":{"MESSAGE":[1,[10,"1.7000000000000002"]]},"fields":{},"shadow":false,"topLevel":false},"mn/mYPSru1?OoSkmAlHK":{"opcode":"looks_say","next":"88Y}.}G(QUIT@SzdlWtj","parent":"DQE9m:9p=h/1,Pg1Zq5W","inputs":{"MESSAGE":[3,"a;4gr*y5wuO%b9d0T-d-",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"a;4gr*y5wuO%b9d0T-d-":{"opcode":"operator_mod","next":null,"parent":"mn/mYPSru1?OoSkmAlHK","inputs":{"NUM1":[1,[4,"-8.5"]],"NUM2":[1,[4,"3.4"]]},"fields":{},"shadow":false,"topLevel":false},"88Y}.}G(QUIT@SzdlWtj":{"opcode":"looks_think","next":"t6v31,Hkv[n^.#y03los","parent":"mn/mYPSru1?OoSkmAlHK","inputs":{"MESSAGE":[1,[10,"1.6999999999999997"]]},"fields":{},"shadow":false,"topLevel":false},"t6v31,Hkv[n^.#y03los":{"opcode":"looks_say","next":"+D(GiAaJ-1wq9o.5(!31","parent":"88Y}.}G(QUIT@SzdlWtj","inputs":{"MESSAGE":[3,"kE*c(2CVc$z9E4pC8]%O",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"kE*c(2CVc$z9E4pC8]%O":{"opcode":"operator_mod","next":null,"parent":"t6v31,Hkv[n^.#y03los","inputs":{"NUM1":[1,[4,"8.5"]],"NUM2":[1,[4,"-3.4"]]},"fields":{},"shadow":false,"topLevel":false},"+D(GiAaJ-1wq9o.5(!31":{"opcode":"looks_think","next":"if$)Ss?gU$?Lpx!gw.-R","parent":"t6v31,Hkv[n^.#y03los","inputs":{"MESSAGE":[1,[10,"-1.6999999999999997"]]},"fields":{},"shadow":false,"topLevel":false},"if$)Ss?gU$?Lpx!gw.-R":{"opcode":"looks_say","next":"DCr,+gdXATqR8i(1fFWz","parent":"+D(GiAaJ-1wq9o.5(!31","inputs":{"MESSAGE":[3,"}+]sUEM%HC(~Tt6$lq-P",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"}+]sUEM%HC(~Tt6$lq-P":{"opcode":"operator_mod","next":null,"parent":"if$)Ss?gU$?Lpx!gw.-R","inputs":{"NUM1":[1,[4,"-8.5"]],"NUM2":[1,[4,"-3.4"]]},"fields":{},"shadow":false,"topLevel":false},"DCr,+gdXATqR8i(1fFWz":{"opcode":"looks_think","next":null,"parent":"if$)Ss?gU$?Lpx!gw.-R","inputs":{"MESSAGE":[1,[10,"-1.7000000000000002"]]},"fields":{},"shadow":false,"topLevel":false},"y^MXqo#Zt#Y|P{~A6{J_":{"opcode":"event_whenflagclicked","next":"U(R|h6F~^m,ZP1hD.!q|","parent":null,"inputs":{},"fields":{},"shadow":false,"topLevel":true,"x":48,"y":952,"comment":"Yzx#3i0P.R?l[;Q@W979"},"U(R|h6F~^m,ZP1hD.!q|":{"opcode":"looks_say","next":"G2Xa,Q{w=@h;E]A)JHZ;","parent":"y^MXqo#Zt#Y|P{~A6{J_","inputs":{"MESSAGE":[3,"@095Q|tY{TWPF*HS{y~l",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"@095Q|tY{TWPF*HS{y~l":{"opcode":"operator_round","next":null,"parent":"U(R|h6F~^m,ZP1hD.!q|","inputs":{"NUM":[1,[4,"5"]]},"fields":{},"shadow":false,"topLevel":false},"G2Xa,Q{w=@h;E]A)JHZ;":{"opcode":"looks_think","next":"~RG,c-1x?4]w8OV)^+7Z","parent":"U(R|h6F~^m,ZP1hD.!q|","inputs":{"MESSAGE":[1,[10,"5"]]},"fields":{},"shadow":false,"topLevel":false},"~RG,c-1x?4]w8OV)^+7Z":{"opcode":"looks_say","next":"H`[:AMiL39X8+%kU%xTi","parent":"G2Xa,Q{w=@h;E]A)JHZ;","inputs":{"MESSAGE":[3,"jxri9+Bx`efld3^OkMDK",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"jxri9+Bx`efld3^OkMDK":{"opcode":"operator_round","next":null,"parent":"~RG,c-1x?4]w8OV)^+7Z","inputs":{"NUM":[1,[4,"3.5"]]},"fields":{},"shadow":false,"topLevel":false},"H`[:AMiL39X8+%kU%xTi":{"opcode":"looks_think","next":"[;gs~z**95H)D9=Mhk^b","parent":"~RG,c-1x?4]w8OV)^+7Z","inputs":{"MESSAGE":[1,[10,"4"]]},"fields":{},"shadow":false,"topLevel":false},"[;gs~z**95H)D9=Mhk^b":{"opcode":"looks_say","next":"+tuQA{?#pCR+5kYE;juu","parent":"H`[:AMiL39X8+%kU%xTi","inputs":{"MESSAGE":[3,"p{..E(.hCT_Eqy=j+;`u",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"p{..E(.hCT_Eqy=j+;`u":{"opcode":"operator_round","next":null,"parent":"[;gs~z**95H)D9=Mhk^b","inputs":{"NUM":[1,[4,"8.4"]]},"fields":{},"shadow":false,"topLevel":false},"+tuQA{?#pCR+5kYE;juu":{"opcode":"looks_think","next":"/^4K)W~DH*CDClRrOjXl","parent":"[;gs~z**95H)D9=Mhk^b","inputs":{"MESSAGE":[1,[10,"8"]]},"fields":{},"shadow":false,"topLevel":false},"/^4K)W~DH*CDClRrOjXl":{"opcode":"looks_say","next":"o:tQ`7RT$v;,e!KQJ]nv","parent":"+tuQA{?#pCR+5kYE;juu","inputs":{"MESSAGE":[3,"fgZfz[v62:6Ev!j`53lU",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"fgZfz[v62:6Ev!j`53lU":{"opcode":"operator_round","next":null,"parent":"/^4K)W~DH*CDClRrOjXl","inputs":{"NUM":[1,[4,"-15.3"]]},"fields":{},"shadow":false,"topLevel":false},"o:tQ`7RT$v;,e!KQJ]nv":{"opcode":"looks_think","next":"r}z@!2d|zwN,3uRdwM{*","parent":"/^4K)W~DH*CDClRrOjXl","inputs":{"MESSAGE":[1,[10,"-15"]]},"fields":{},"shadow":false,"topLevel":false},"r}z@!2d|zwN,3uRdwM{*":{"opcode":"looks_say","next":"pD|meKZr#Gj.ig]Jn`K?","parent":"o:tQ`7RT$v;,e!KQJ]nv","inputs":{"MESSAGE":[3,"f.Gb#i=d6Fw[^nZajQgs",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"f.Gb#i=d6Fw[^nZajQgs":{"opcode":"operator_round","next":null,"parent":"r}z@!2d|zwN,3uRdwM{*","inputs":{"NUM":[1,[4,"-0.8"]]},"fields":{},"shadow":false,"topLevel":false},"pD|meKZr#Gj.ig]Jn`K?":{"opcode":"looks_think","next":null,"parent":"r}z@!2d|zwN,3uRdwM{*","inputs":{"MESSAGE":[1,[10,"-1"]]},"fields":{},"shadow":false,"topLevel":false},"yZ6w0xM@!gj)mqFq/I=v":{"opcode":"event_whenflagclicked","next":")$!!pJe*eh_aBat8aSA(","parent":null,"inputs":{},"fields":{},"shadow":false,"topLevel":true,"x":459,"y":1380,"comment":"emhJ^?B#5JNvP}wp@Tn8"},")$!!pJe*eh_aBat8aSA(":{"opcode":"control_if","next":"X.Rq=U*cJ:DSTWiPxaP;","parent":"yZ6w0xM@!gj)mqFq/I=v","inputs":{"CONDITION":[2,"c=wfYsQV={Uw{0$UgJ[;"],"SUBSTACK":[2,",Ap^Ht0`l8cNkvqvUNYB"]},"fields":{},"shadow":false,"topLevel":false},"c=wfYsQV={Uw{0$UgJ[;":{"opcode":"operator_equals","next":null,"parent":")$!!pJe*eh_aBat8aSA(","inputs":{"OPERAND1":[1,[10,"1"]],"OPERAND2":[1,[10,"1"]]},"fields":{},"shadow":false,"topLevel":false},"{A=Km4tc}_mSvtIzk!l@":{"opcode":"looks_say","next":null,"parent":"3{7Lg]pX,9+Y[ceM$88o","inputs":{"MESSAGE":[1,[10,"branch if"]]},"fields":{},"shadow":false,"topLevel":false},"X.Rq=U*cJ:DSTWiPxaP;":{"opcode":"looks_think","next":"F6*1?|jphRrC15:Y]-:}","parent":")$!!pJe*eh_aBat8aSA(","inputs":{"MESSAGE":[1,[10,"branch if"]]},"fields":{},"shadow":false,"topLevel":false},"F6*1?|jphRrC15:Y]-:}":{"opcode":"control_if_else","next":"zHY7lz*zbvrvzIC@xaZ3","parent":"X.Rq=U*cJ:DSTWiPxaP;","inputs":{"CONDITION":[2,"YDHE{9n8$t_ckN:#r7T2"],"SUBSTACK":[2,"0!xmr;pUe8op,_SNH,pz"],"SUBSTACK2":[2,"*Hfc=}~}@8I`:(`k#7~R"]},"fields":{},"shadow":false,"topLevel":false},"YDHE{9n8$t_ckN:#r7T2":{"opcode":"operator_equals","next":null,"parent":"F6*1?|jphRrC15:Y]-:}","inputs":{"OPERAND1":[1,[10,"2"]],"OPERAND2":[1,[10,"2"]]},"fields":{},"shadow":false,"topLevel":false},"IhJCfC,2`yM`WOlvaj0~":{"opcode":"looks_say","next":null,"parent":"CzB^H3l-+B]3gJ+,4*eY","inputs":{"MESSAGE":[1,[10,"branch if 2"]]},"fields":{},"shadow":false,"topLevel":false},"zHY7lz*zbvrvzIC@xaZ3":{"opcode":"looks_think","next":"~vfy/zgE:gH]Pm?)0gpO","parent":"F6*1?|jphRrC15:Y]-:}","inputs":{"MESSAGE":[1,[10,"branch if 2"]]},"fields":{},"shadow":false,"topLevel":false},"*Hfc=}~}@8I`:(`k#7~R":{"opcode":"looks_say","next":null,"parent":"F6*1?|jphRrC15:Y]-:}","inputs":{"MESSAGE":[1,[10,"branch else"]]},"fields":{},"shadow":false,"topLevel":false},"~vfy/zgE:gH]Pm?)0gpO":{"opcode":"control_if_else","next":"h1%%%baPJS,dQ]Yy2/m#","parent":"zHY7lz*zbvrvzIC@xaZ3","inputs":{"CONDITION":[2,"{e/q8V~Gx_N=}g9l0QCE"],"SUBSTACK":[2,"0^w_HF0z%+%stezFYjNJ"],"SUBSTACK2":[2,"fz@WhE`hy~P6{c2px7Ex"]},"fields":{},"shadow":false,"topLevel":false},"{e/q8V~Gx_N=}g9l0QCE":{"opcode":"operator_equals","next":null,"parent":"~vfy/zgE:gH]Pm?)0gpO","inputs":{"OPERAND1":[1,[10,"2"]],"OPERAND2":[1,[10,"3"]]},"fields":{},"shadow":false,"topLevel":false},"0^w_HF0z%+%stezFYjNJ":{"opcode":"looks_say","next":null,"parent":"~vfy/zgE:gH]Pm?)0gpO","inputs":{"MESSAGE":[1,[10,"branch if 3"]]},"fields":{},"shadow":false,"topLevel":false},"/|QMynr:!zk?MYYw$p0j":{"opcode":"looks_say","next":null,"parent":"46IUN*V~!)}hcKni)f{0","inputs":{"MESSAGE":[1,[10,"branch else 2"]]},"fields":{},"shadow":false,"topLevel":false},"h1%%%baPJS,dQ]Yy2/m#":{"opcode":"looks_think","next":null,"parent":"~vfy/zgE:gH]Pm?)0gpO","inputs":{"MESSAGE":[1,[10,"branch else 2"]]},"fields":{},"shadow":false,"topLevel":false},"fz@WhE`hy~P6{c2px7Ex":{"opcode":"looks_say","next":"46IUN*V~!)}hcKni)f{0","parent":"~vfy/zgE:gH]Pm?)0gpO","inputs":{"MESSAGE":[3,"iwXn5b+*I.PI1$Lk^/#v",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"46IUN*V~!)}hcKni)f{0":{"opcode":"looks_think","next":"/|QMynr:!zk?MYYw$p0j","parent":"fz@WhE`hy~P6{c2px7Ex","inputs":{"MESSAGE":[1,[10,"3 = 3"]]},"fields":{},"shadow":false,"topLevel":false},",Ap^Ht0`l8cNkvqvUNYB":{"opcode":"looks_say","next":"3{7Lg]pX,9+Y[ceM$88o","parent":")$!!pJe*eh_aBat8aSA(","inputs":{"MESSAGE":[3,"0M]6zC%MT.iF3C~w#pfx",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"3{7Lg]pX,9+Y[ceM$88o":{"opcode":"looks_think","next":"{A=Km4tc}_mSvtIzk!l@","parent":",Ap^Ht0`l8cNkvqvUNYB","inputs":{"MESSAGE":[1,[10,"0"]]},"fields":{},"shadow":false,"topLevel":false},"0M]6zC%MT.iF3C~w#pfx":{"opcode":"operator_length","next":null,"parent":",Ap^Ht0`l8cNkvqvUNYB","inputs":{"STRING":[1,[10,""]]},"fields":{},"shadow":false,"topLevel":false},"0!xmr;pUe8op,_SNH,pz":{"opcode":"looks_say","next":"CzB^H3l-+B]3gJ+,4*eY","parent":"F6*1?|jphRrC15:Y]-:}","inputs":{"MESSAGE":[3,"FQl3A~lh5iKHlqU7e/Re",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"CzB^H3l-+B]3gJ+,4*eY":{"opcode":"looks_think","next":"IhJCfC,2`yM`WOlvaj0~","parent":"0!xmr;pUe8op,_SNH,pz","inputs":{"MESSAGE":[1,[10,"true"]]},"fields":{},"shadow":false,"topLevel":false},"FQl3A~lh5iKHlqU7e/Re":{"opcode":"operator_contains","next":null,"parent":"0!xmr;pUe8op,_SNH,pz","inputs":{"STRING1":[1,[10,"apple"]],"STRING2":[1,[10,"A"]]},"fields":{},"shadow":false,"topLevel":false},"iwXn5b+*I.PI1$Lk^/#v":{"opcode":"operator_join","next":null,"parent":"fz@WhE`hy~P6{c2px7Ex","inputs":{"STRING1":[3,"xA2^d2(VAXX#ZW+|MZAT",[10,"apple "]],"STRING2":[1,[10," = 3"]]},"fields":{},"shadow":false,"topLevel":false},"xA2^d2(VAXX#ZW+|MZAT":{"opcode":"operator_add","next":null,"parent":"iwXn5b+*I.PI1$Lk^/#v","inputs":{"NUM1":[1,[4,"1"]],"NUM2":[1,[4,"2"]]},"fields":{},"shadow":false,"topLevel":false},"bGYY}Jz}AY?Uvt#b`NU.":{"opcode":"event_whenflagclicked","next":"e3qu`{Eg[n6ndV,Ls2fa","parent":null,"inputs":{},"fields":{},"shadow":false,"topLevel":true,"x":459,"y":660,"comment":"N_Dm~!1lwv1ubFWOF.:P"},"e3qu`{Eg[n6ndV,Ls2fa":{"opcode":"data_setvariableto","next":"oxR//|T))BRuinBv.8RY","parent":"bGYY}Jz}AY?Uvt#b`NU.","inputs":{"VALUE":[1,[10,"hello"]]},"fields":{"VARIABLE":["Global Var 1","Li]%7ap~.rXkBAo4UoIe"]},"shadow":false,"topLevel":false},"oxR//|T))BRuinBv.8RY":{"opcode":"looks_say","next":"Cr5b%.Pnw,Apm}E8G`O.","parent":"e3qu`{Eg[n6ndV,Ls2fa","inputs":{"MESSAGE":[3,[12,"Global Var 1","Li]%7ap~.rXkBAo4UoIe"],[10,""]]},"fields":{},"shadow":false,"topLevel":false},"Cr5b%.Pnw,Apm}E8G`O.":{"opcode":"looks_think","next":"5`F9-`^{i^@!P+a;[rc3","parent":"oxR//|T))BRuinBv.8RY","inputs":{"MESSAGE":[1,[10,"hello"]]},"fields":{},"shadow":false,"topLevel":false},"5`F9-`^{i^@!P+a;[rc3":{"opcode":"data_setvariableto","next":"QUoZ%SD;7sC$D{V8{*y5","parent":"Cr5b%.Pnw,Apm}E8G`O.","inputs":{"VALUE":[1,[10,"5"]]},"fields":{"VARIABLE":["Global Var 1","Li]%7ap~.rXkBAo4UoIe"]},"shadow":false,"topLevel":false},"QUoZ%SD;7sC$D{V8{*y5":{"opcode":"looks_say","next":"U%*:#yMzNkd+fpqdVU{{","parent":"5`F9-`^{i^@!P+a;[rc3","inputs":{"MESSAGE":[3,[12,"Global Var 1","Li]%7ap~.rXkBAo4UoIe"],[10,""]]},"fields":{},"shadow":false,"topLevel":false},"U%*:#yMzNkd+fpqdVU{{":{"opcode":"looks_think","next":"iIlJC-9vBSY[u7PE`(Th","parent":"QUoZ%SD;7sC$D{V8{*y5","inputs":{"MESSAGE":[1,[10,"5"]]},"fields":{},"shadow":false,"topLevel":false},"iIlJC-9vBSY[u7PE`(Th":{"opcode":"data_changevariableby","next":"E|8W6-yF+-g(9Mm6U68O","parent":"U%*:#yMzNkd+fpqdVU{{","inputs":{"VALUE":[1,[4,"3"]]},"fields":{"VARIABLE":["Global Var 1","Li]%7ap~.rXkBAo4UoIe"]},"shadow":false,"topLevel":false},"E|8W6-yF+-g(9Mm6U68O":{"opcode":"looks_say","next":"zKd77f}YHyuM[;2hfkXP","parent":"iIlJC-9vBSY[u7PE`(Th","inputs":{"MESSAGE":[3,[12,"Global Var 1","Li]%7ap~.rXkBAo4UoIe"],[10,""]]},"fields":{},"shadow":false,"topLevel":false},"zKd77f}YHyuM[;2hfkXP":{"opcode":"looks_think","next":"guZmhf)Dz~R.;Iv)=UPm","parent":"E|8W6-yF+-g(9Mm6U68O","inputs":{"MESSAGE":[1,[10,"8"]]},"fields":{},"shadow":false,"topLevel":false},"guZmhf)Dz~R.;Iv)=UPm":{"opcode":"data_changevariableby","next":"t^H%I{]GWwdfuq:wW]Np","parent":"zKd77f}YHyuM[;2hfkXP","inputs":{"VALUE":[1,[4,"-1.3"]]},"fields":{"VARIABLE":["Global Var 1","Li]%7ap~.rXkBAo4UoIe"]},"shadow":false,"topLevel":false},"t^H%I{]GWwdfuq:wW]Np":{"opcode":"looks_say","next":"sLV-4ghU-mloi-gHG|;(","parent":"guZmhf)Dz~R.;Iv)=UPm","inputs":{"MESSAGE":[3,[12,"Global Var 1","Li]%7ap~.rXkBAo4UoIe"],[10,""]]},"fields":{},"shadow":false,"topLevel":false},"sLV-4ghU-mloi-gHG|;(":{"opcode":"looks_think","next":null,"parent":"t^H%I{]GWwdfuq:wW]Np","inputs":{"MESSAGE":[1,[10,"6.7"]]},"fields":{},"shadow":false,"topLevel":false}},"comments":{"qJJ]K-$YaIHRe2Rt=7hI":{"blockId":"T+`U{ZSBO.-CS0QIDdig","x":653.3612196180554,"y":120.43423106084985,"width":200,"height":200,"minimized":true,"text":"hq-dbg"},"r0KYt*J$TbBy@xmhmCat":{"blockId":"35fcD$zFxzS)3RfQH*UZ","x":233.92154947916666,"y":121.77777777777776,"width":200,"height":200,"minimized":true,"text":"hq-dbg"},"Yzx#3i0P.R?l[;Q@W979":{"blockId":"y^MXqo#Zt#Y|P{~A6{J_","x":235.50260416666666,"y":1022.2222222222222,"width":200,"height":200,"minimized":true,"text":"hq-dbg"},"N_Dm~!1lwv1ubFWOF.:P":{"blockId":"bGYY}Jz}AY?Uvt#b`NU.","x":792.880805121528,"y":640.2400548696845,"width":200,"height":200,"minimized":true,"text":"hq-dbg"},":Dieu_wHnCR+-?9Z0DE=":{"blockId":"|mF$*1cCVtpn!ASr:8#f","x":756,"y":28,"width":200,"height":200,"minimized":true,"text":"hq-dbg"},"rZ3_B{qwutZfQ@+p~ty;":{"blockId":"+BU9~YXIg):.%iFnHIOY","x":756,"y":628,"width":200,"height":200,"minimized":true,"text":"hq-dbg"},"Z2iuff*|_P=B|gypDA..":{"blockId":"%ZfE%Oh1X~!C`H{L_lpc","x":197,"y":947,"width":200,"height":200,"minimized":true,"text":"hq-dbg"},"emhJ^?B#5JNvP}wp@Tn8":{"blockId":"yZ6w0xM@!gj)mqFq/I=v","x":636.03125,"y":1388,"width":200,"height":200,"minimized":true,"text":"hq-dbg"}},"currentCostume":0,"costumes":[{"name":"backdrop1","dataFormat":"svg","assetId":"cd21514d0531fdffb22204e0ec5ed84a","md5ext":"cd21514d0531fdffb22204e0ec5ed84a.svg","rotationCenterX":240,"rotationCenterY":180}],"sounds":[{"name":"pop","assetId":"83a9787d4cb6f3b7632b4ddfebf74367","dataFormat":"wav","format":"","rate":48000,"sampleCount":1123,"md5ext":"83a9787d4cb6f3b7632b4ddfebf74367.wav"}],"volume":100,"layerOrder":0,"tempo":60,"videoTransparency":50,"videoState":"on","textToSpeechLanguage":null},{"isStage":false,"name":"Sprite1","variables":{"KVrWdvq3SmYJl^Zwl_Yg":["Local Var 1",2.2],"h}uu)tclo-s|vyEe1J`D":["counter",-2]},"lists":{},"broadcasts":{},"blocks":{"`kq5ykM;LirojJVijo?R":{"opcode":"event_whenflagclicked","next":"~ZKW0QL1n{LFcGWRqwKH","parent":null,"inputs":{},"fields":{},"shadow":false,"topLevel":true,"x":27,"y":24},"~ZKW0QL1n{LFcGWRqwKH":{"opcode":"looks_say","next":"xJlQPv/MGj-l$9_JB=Dx","parent":"`kq5ykM;LirojJVijo?R","inputs":{"MESSAGE":[1,[10,"42"]]},"fields":{},"shadow":false,"topLevel":false},"xJlQPv/MGj-l$9_JB=Dx":{"opcode":"looks_think","next":null,"parent":"~ZKW0QL1n{LFcGWRqwKH","inputs":{"MESSAGE":[1,[10,"56"]]},"fields":{},"shadow":false,"topLevel":false},"|mF$*1cCVtpn!ASr:8#f":{"opcode":"event_whenflagclicked","next":"}zTF2L2@rV-WUvA(H5RA","parent":null,"inputs":{},"fields":{},"shadow":false,"topLevel":true,"x":580,"y":20,"comment":":Dieu_wHnCR+-?9Z0DE="},"}zTF2L2@rV-WUvA(H5RA":{"opcode":"looks_say","next":"fh~C;CKJV`b|TBf$*~d[","parent":"|mF$*1cCVtpn!ASr:8#f","inputs":{"MESSAGE":[3,"*8b/+u+OVBI3-*E*4P@S",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"*8b/+u+OVBI3-*E*4P@S":{"opcode":"operator_join","next":null,"parent":"}zTF2L2@rV-WUvA(H5RA","inputs":{"STRING1":[1,[10,"apple "]],"STRING2":[1,[10,"banana"]]},"fields":{},"shadow":false,"topLevel":false},"fh~C;CKJV`b|TBf$*~d[":{"opcode":"looks_think","next":"##v.i%S$R28]],p!=NY3","parent":"}zTF2L2@rV-WUvA(H5RA","inputs":{"MESSAGE":[1,[10,"apple banana"]]},"fields":{},"shadow":false,"topLevel":false},"##v.i%S$R28]],p!=NY3":{"opcode":"looks_say","next":"RuL{vqbTR5sYZ13n=7Vm","parent":"fh~C;CKJV`b|TBf$*~d[","inputs":{"MESSAGE":[3,"OCg7E-4E+RwEAe{4nVE=",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"OCg7E-4E+RwEAe{4nVE=":{"opcode":"operator_letter_of","next":null,"parent":"##v.i%S$R28]],p!=NY3","inputs":{"LETTER":[1,[6,"3"]],"STRING":[1,[10,"zebra"]]},"fields":{},"shadow":false,"topLevel":false},"RuL{vqbTR5sYZ13n=7Vm":{"opcode":"looks_think","next":"SM9Y~kHSU;#[aFZ!KvAt","parent":"##v.i%S$R28]],p!=NY3","inputs":{"MESSAGE":[1,[10,"b"]]},"fields":{},"shadow":false,"topLevel":false},"SM9Y~kHSU;#[aFZ!KvAt":{"opcode":"looks_say","next":"n!oow.-Aov*V$?QgOfih","parent":"RuL{vqbTR5sYZ13n=7Vm","inputs":{"MESSAGE":[3,"j-XE!~{v=V%-5.m#H|!y",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"j-XE!~{v=V%-5.m#H|!y":{"opcode":"operator_length","next":null,"parent":"SM9Y~kHSU;#[aFZ!KvAt","inputs":{"STRING":[1,[10,"antidisestablishmentarianism"]]},"fields":{},"shadow":false,"topLevel":false},"n!oow.-Aov*V$?QgOfih":{"opcode":"looks_think","next":"27DUa3zreh^/qt35!g4i","parent":"SM9Y~kHSU;#[aFZ!KvAt","inputs":{"MESSAGE":[1,[10,"28"]]},"fields":{},"shadow":false,"topLevel":false},"27DUa3zreh^/qt35!g4i":{"opcode":"looks_say","next":"@wfxSyo](1(n,f_it#n8","parent":"n!oow.-Aov*V$?QgOfih","inputs":{"MESSAGE":[3,"U=EG[#*m8W9q]vp{x7[*",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"U=EG[#*m8W9q]vp{x7[*":{"opcode":"operator_contains","next":null,"parent":"27DUa3zreh^/qt35!g4i","inputs":{"STRING1":[1,[10,"team"]],"STRING2":[1,[10,"me"]]},"fields":{},"shadow":false,"topLevel":false},"@wfxSyo](1(n,f_it#n8":{"opcode":"looks_think","next":"PjU`/,z?olYL7C4b=CC}","parent":"27DUa3zreh^/qt35!g4i","inputs":{"MESSAGE":[1,[10,"false"]]},"fields":{},"shadow":false,"topLevel":false},"PjU`/,z?olYL7C4b=CC}":{"opcode":"looks_say","next":"ujqpA1/h_r2M`5F^V3sl","parent":"@wfxSyo](1(n,f_it#n8","inputs":{"MESSAGE":[3,"!9=2}MZijp[DB2Rl/S0j",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"!9=2}MZijp[DB2Rl/S0j":{"opcode":"operator_contains","next":null,"parent":"PjU`/,z?olYL7C4b=CC}","inputs":{"STRING1":[1,[10,"happy"]],"STRING2":[1,[10,"app"]]},"fields":{},"shadow":false,"topLevel":false},"ujqpA1/h_r2M`5F^V3sl":{"opcode":"looks_think","next":null,"parent":"PjU`/,z?olYL7C4b=CC}","inputs":{"MESSAGE":[1,[10,"true"]]},"fields":{},"shadow":false,"topLevel":false},"+BU9~YXIg):.%iFnHIOY":{"opcode":"event_whenflagclicked","next":"oLcK;{;1u|c+eNRg6%vN","parent":null,"inputs":{},"fields":{},"shadow":false,"topLevel":true,"x":580,"y":620,"comment":"rZ3_B{qwutZfQ@+p~ty;"},"oLcK;{;1u|c+eNRg6%vN":{"opcode":"looks_say","next":"YHvNwB2PU9V~~Oob`]!N","parent":"+BU9~YXIg):.%iFnHIOY","inputs":{"MESSAGE":[3,"TL=dr4E^8e:x*^rRaBQZ",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"TL=dr4E^8e:x*^rRaBQZ":{"opcode":"operator_random","next":null,"parent":"oLcK;{;1u|c+eNRg6%vN","inputs":{"FROM":[1,[4,"1"]],"TO":[1,[4,"10"]]},"fields":{},"shadow":false,"topLevel":false},"YHvNwB2PU9V~~Oob`]!N":{"opcode":"looks_say","next":"0,+zJR_EjMoXiIvO_x54","parent":"oLcK;{;1u|c+eNRg6%vN","inputs":{"MESSAGE":[3,")W6KUf-I/JzGE[DY-{WF",[10,""]]},"fields":{},"shadow":false,"topLevel":false},")W6KUf-I/JzGE[DY-{WF":{"opcode":"operator_gt","next":null,"parent":"YHvNwB2PU9V~~Oob`]!N","inputs":{"OPERAND1":[1,[10,"21"]],"OPERAND2":[1,[10,"-5"]]},"fields":{},"shadow":false,"topLevel":false},"0,+zJR_EjMoXiIvO_x54":{"opcode":"looks_think","next":"~,kbO-ebe[0(A^cRm@PR","parent":"YHvNwB2PU9V~~Oob`]!N","inputs":{"MESSAGE":[1,[10,"true"]]},"fields":{},"shadow":false,"topLevel":false},"~,kbO-ebe[0(A^cRm@PR":{"opcode":"looks_say","next":"t10coo.6LW@wi!XThNo-","parent":"0,+zJR_EjMoXiIvO_x54","inputs":{"MESSAGE":[3,"ARKnpnCkzE]@3yAsBRd9",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"ARKnpnCkzE]@3yAsBRd9":{"opcode":"operator_lt","next":null,"parent":"~,kbO-ebe[0(A^cRm@PR","inputs":{"OPERAND1":[1,[10,"6"]],"OPERAND2":[1,[10,"jeff"]]},"fields":{},"shadow":false,"topLevel":false},"t10coo.6LW@wi!XThNo-":{"opcode":"looks_think","next":":g?*.l6ZT{yhTe`i(Wq}","parent":"~,kbO-ebe[0(A^cRm@PR","inputs":{"MESSAGE":[1,[10,"true"]]},"fields":{},"shadow":false,"topLevel":false},":g?*.l6ZT{yhTe`i(Wq}":{"opcode":"looks_say","next":"54=25|Li}hId~sxCb6=#","parent":"t10coo.6LW@wi!XThNo-","inputs":{"MESSAGE":[3,",AGDfDUg|}zH_i~VasZN",[10,""]]},"fields":{},"shadow":false,"topLevel":false},",AGDfDUg|}zH_i~VasZN":{"opcode":"operator_equals","next":null,"parent":":g?*.l6ZT{yhTe`i(Wq}","inputs":{"OPERAND1":[1,[10,"5"]],"OPERAND2":[1,[10,"8"]]},"fields":{},"shadow":false,"topLevel":false},"54=25|Li}hId~sxCb6=#":{"opcode":"looks_think","next":"o02`cO9K,i5Ig3q6XbjS","parent":":g?*.l6ZT{yhTe`i(Wq}","inputs":{"MESSAGE":[1,[10,"false"]]},"fields":{},"shadow":false,"topLevel":false},"o02`cO9K,i5Ig3q6XbjS":{"opcode":"looks_say","next":"{VJafttcc2|:{[Gq65:_","parent":"54=25|Li}hId~sxCb6=#","inputs":{"MESSAGE":[3,"DJN}p?uw~ZFEpm83k8or",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"DJN}p?uw~ZFEpm83k8or":{"opcode":"operator_equals","next":null,"parent":"o02`cO9K,i5Ig3q6XbjS","inputs":{"OPERAND1":[1,[10,"yes"]],"OPERAND2":[1,[10,"yes"]]},"fields":{},"shadow":false,"topLevel":false},"{VJafttcc2|:{[Gq65:_":{"opcode":"looks_think","next":"eY?O!d?662aS*}=P=Z[?","parent":"o02`cO9K,i5Ig3q6XbjS","inputs":{"MESSAGE":[1,[10,"true"]]},"fields":{},"shadow":false,"topLevel":false},"eY?O!d?662aS*}=P=Z[?":{"opcode":"looks_say","next":"@jh)c}vwLt.Tcn6wY+K:","parent":"{VJafttcc2|:{[Gq65:_","inputs":{"MESSAGE":[3,"i@fAs/-f2GJxInp-Z^#-",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"i@fAs/-f2GJxInp-Z^#-":{"opcode":"operator_equals","next":null,"parent":"eY?O!d?662aS*}=P=Z[?","inputs":{"OPERAND1":[1,[10,"equal"]],"OPERAND2":[1,[10,"eequal"]]},"fields":{},"shadow":false,"topLevel":false},"@jh)c}vwLt.Tcn6wY+K:":{"opcode":"looks_think","next":"5dzDXXZDK`PV2(%aT!QK","parent":"eY?O!d?662aS*}=P=Z[?","inputs":{"MESSAGE":[1,[10,"false"]]},"fields":{},"shadow":false,"topLevel":false},"5dzDXXZDK`PV2(%aT!QK":{"opcode":"looks_say","next":"/|Ju9P7ZMtdeIV.OvK*8","parent":"@jh)c}vwLt.Tcn6wY+K:","inputs":{"MESSAGE":[3,"ZyO6Q/b);e(xsgv-FwBe",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"ZyO6Q/b);e(xsgv-FwBe":{"opcode":"operator_and","next":null,"parent":"5dzDXXZDK`PV2(%aT!QK","inputs":{"OPERAND1":[2,"#{e=AaOaMhT37uA.-mCi"],"OPERAND2":[2,"fxs?d*0W,y[WSmoad)|6"]},"fields":{},"shadow":false,"topLevel":false},"#{e=AaOaMhT37uA.-mCi":{"opcode":"operator_gt","next":null,"parent":"ZyO6Q/b);e(xsgv-FwBe","inputs":{"OPERAND1":[1,[10,"1"]],"OPERAND2":[1,[10,"0"]]},"fields":{},"shadow":false,"topLevel":false},"fxs?d*0W,y[WSmoad)|6":{"opcode":"operator_lt","next":null,"parent":"ZyO6Q/b);e(xsgv-FwBe","inputs":{"OPERAND1":[1,[10,"-5"]],"OPERAND2":[1,[10,"6"]]},"fields":{},"shadow":false,"topLevel":false},"/|Ju9P7ZMtdeIV.OvK*8":{"opcode":"looks_think","next":"ylSLi~U:E6QXa7B+ngS|","parent":"5dzDXXZDK`PV2(%aT!QK","inputs":{"MESSAGE":[1,[10,"true"]]},"fields":{},"shadow":false,"topLevel":false},"ylSLi~U:E6QXa7B+ngS|":{"opcode":"looks_say","next":"1yrq.%c]w)hX/p,JgsMA","parent":"/|Ju9P7ZMtdeIV.OvK*8","inputs":{"MESSAGE":[3,"t5Q8:lH?IixphnZoqy.%",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"t5Q8:lH?IixphnZoqy.%":{"opcode":"operator_or","next":null,"parent":"ylSLi~U:E6QXa7B+ngS|","inputs":{"OPERAND1":[2,"{{WIBPGv.tTh!z.:~vam"],"OPERAND2":[2,"R!PCOJ)$,,xHCmwA/;$b"]},"fields":{},"shadow":false,"topLevel":false},"{{WIBPGv.tTh!z.:~vam":{"opcode":"operator_equals","next":null,"parent":"t5Q8:lH?IixphnZoqy.%","inputs":{"OPERAND1":[1,[10,"1"]],"OPERAND2":[1,[10,"0"]]},"fields":{},"shadow":false,"topLevel":false},"R!PCOJ)$,,xHCmwA/;$b":{"opcode":"operator_equals","next":null,"parent":"t5Q8:lH?IixphnZoqy.%","inputs":{"OPERAND1":[1,[10,"7.4"]],"OPERAND2":[1,[10,"7.4"]]},"fields":{},"shadow":false,"topLevel":false},"1yrq.%c]w)hX/p,JgsMA":{"opcode":"looks_think","next":"Dd6VT_^2xXj1HjFsvA(*","parent":"ylSLi~U:E6QXa7B+ngS|","inputs":{"MESSAGE":[1,[10,"true"]]},"fields":{},"shadow":false,"topLevel":false},"Dd6VT_^2xXj1HjFsvA(*":{"opcode":"looks_say","next":"nq:]?Kv#tqE+(]N3@(^d","parent":"1yrq.%c]w)hX/p,JgsMA","inputs":{"MESSAGE":[3,"eX/iYZ3}R=K.,,^yX4*t",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"eX/iYZ3}R=K.,,^yX4*t":{"opcode":"operator_not","next":null,"parent":"Dd6VT_^2xXj1HjFsvA(*","inputs":{"OPERAND":[2,"4wGQaW])`ba,],ZI9y0("]},"fields":{},"shadow":false,"topLevel":false},"4wGQaW])`ba,],ZI9y0(":{"opcode":"operator_equals","next":null,"parent":"eX/iYZ3}R=K.,,^yX4*t","inputs":{"OPERAND1":[1,[10,"1"]],"OPERAND2":[1,[10,"1"]]},"fields":{},"shadow":false,"topLevel":false},"nq:]?Kv#tqE+(]N3@(^d":{"opcode":"looks_think","next":null,"parent":"Dd6VT_^2xXj1HjFsvA(*","inputs":{"MESSAGE":[1,[10,"false"]]},"fields":{},"shadow":false,"topLevel":false},"%ZfE%Oh1X~!C`H{L_lpc":{"opcode":"event_whenflagclicked","next":"X=Jgnm1.x!M]6qZ9RS^a","parent":null,"inputs":{},"fields":{},"shadow":false,"topLevel":true,"x":20,"y":940,"comment":"Z2iuff*|_P=B|gypDA.."},"X=Jgnm1.x!M]6qZ9RS^a":{"opcode":"looks_say","next":"toq#UehnP9hXH3;[x~L`","parent":"%ZfE%Oh1X~!C`H{L_lpc","inputs":{"MESSAGE":[3,")X?D-1!V.6=W/T*eA8zN",[10,""]]},"fields":{},"shadow":false,"topLevel":false},")X?D-1!V.6=W/T*eA8zN":{"opcode":"operator_mathop","next":null,"parent":"X=Jgnm1.x!M]6qZ9RS^a","inputs":{"NUM":[1,[4,"-23"]]},"fields":{"OPERATOR":["abs",null]},"shadow":false,"topLevel":false},"toq#UehnP9hXH3;[x~L`":{"opcode":"looks_think","next":"C(OQgl2X@uU#vKVPm2;$","parent":"X=Jgnm1.x!M]6qZ9RS^a","inputs":{"MESSAGE":[1,[10,"23"]]},"fields":{},"shadow":false,"topLevel":false},"C(OQgl2X@uU#vKVPm2;$":{"opcode":"looks_say","next":"g22a=?{FN),!7{[Nu*#9","parent":"toq#UehnP9hXH3;[x~L`","inputs":{"MESSAGE":[3,"og_x=kqaL[#K5t^;ek,;",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"og_x=kqaL[#K5t^;ek,;":{"opcode":"operator_mathop","next":null,"parent":"C(OQgl2X@uU#vKVPm2;$","inputs":{"NUM":[1,[4,"-23.4"]]},"fields":{"OPERATOR":["floor",null]},"shadow":false,"topLevel":false},"g22a=?{FN),!7{[Nu*#9":{"opcode":"looks_think","next":"IA${efI(,OU@hoY$3I5N","parent":"C(OQgl2X@uU#vKVPm2;$","inputs":{"MESSAGE":[1,[10,"-24"]]},"fields":{},"shadow":false,"topLevel":false},"IA${efI(,OU@hoY$3I5N":{"opcode":"looks_say","next":"P./!TW#9d]rC9AG43N2^","parent":"g22a=?{FN),!7{[Nu*#9","inputs":{"MESSAGE":[3,"*f`syQ;7UUn@lCxyn./J",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"*f`syQ;7UUn@lCxyn./J":{"opcode":"operator_mathop","next":null,"parent":"IA${efI(,OU@hoY$3I5N","inputs":{"NUM":[1,[4,"10.36584"]]},"fields":{"OPERATOR":["ceiling",null]},"shadow":false,"topLevel":false},"P./!TW#9d]rC9AG43N2^":{"opcode":"looks_think","next":"7.oYnab4UIOAv{0!8@|Z","parent":"IA${efI(,OU@hoY$3I5N","inputs":{"MESSAGE":[1,[10,"11"]]},"fields":{},"shadow":false,"topLevel":false},"7.oYnab4UIOAv{0!8@|Z":{"opcode":"looks_say","next":"naN7l(adv:gSlA2zzV1A","parent":"P./!TW#9d]rC9AG43N2^","inputs":{"MESSAGE":[3,"n[Siv;eupNre[_fe;v=~",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"n[Siv;eupNre[_fe;v=~":{"opcode":"operator_mathop","next":null,"parent":"7.oYnab4UIOAv{0!8@|Z","inputs":{"NUM":[1,[4,"256"]]},"fields":{"OPERATOR":["sqrt",null]},"shadow":false,"topLevel":false},"naN7l(adv:gSlA2zzV1A":{"opcode":"looks_think","next":"M{gzJW.Snw~M9ZZr;G4b","parent":"7.oYnab4UIOAv{0!8@|Z","inputs":{"MESSAGE":[1,[10,"16"]]},"fields":{},"shadow":false,"topLevel":false},"M{gzJW.Snw~M9ZZr;G4b":{"opcode":"looks_say","next":"KKEmm#c`pB[s!vIP#ht@","parent":"naN7l(adv:gSlA2zzV1A","inputs":{"MESSAGE":[3,"o97b0]K3NA$5d_k2nA+-",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"o97b0]K3NA$5d_k2nA+-":{"opcode":"operator_mathop","next":null,"parent":"M{gzJW.Snw~M9ZZr;G4b","inputs":{"NUM":[1,[4,"54"]]},"fields":{"OPERATOR":["sin",null]},"shadow":false,"topLevel":false},"KKEmm#c`pB[s!vIP#ht@":{"opcode":"looks_think","next":"ox,h+_H)c^6Rb[akF9s^","parent":"M{gzJW.Snw~M9ZZr;G4b","inputs":{"MESSAGE":[1,[10,"0.8090169944"]]},"fields":{},"shadow":false,"topLevel":false},"ox,h+_H)c^6Rb[akF9s^":{"opcode":"looks_say","next":"U/8Hsxl85i#H.e6omJe4","parent":"KKEmm#c`pB[s!vIP#ht@","inputs":{"MESSAGE":[3,"Gnhyv-[^}yz_2O(z7w3L",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"Gnhyv-[^}yz_2O(z7w3L":{"opcode":"operator_mathop","next":null,"parent":"ox,h+_H)c^6Rb[akF9s^","inputs":{"NUM":[1,[4,"70"]]},"fields":{"OPERATOR":["cos",null]},"shadow":false,"topLevel":false},"U/8Hsxl85i#H.e6omJe4":{"opcode":"looks_think","next":"BKt6m]b/CyFEgWlPivq6","parent":"ox,h+_H)c^6Rb[akF9s^","inputs":{"MESSAGE":[1,[10,"0.3420201433"]]},"fields":{},"shadow":false,"topLevel":false},"BKt6m]b/CyFEgWlPivq6":{"opcode":"looks_say","next":"i|IVbL//R./jHlc?uR^@","parent":"U/8Hsxl85i#H.e6omJe4","inputs":{"MESSAGE":[3,"jEAf)FK(qt93!*D7t,TF",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"jEAf)FK(qt93!*D7t,TF":{"opcode":"operator_mathop","next":null,"parent":"BKt6m]b/CyFEgWlPivq6","inputs":{"NUM":[1,[4,"30"]]},"fields":{"OPERATOR":["tan",null]},"shadow":false,"topLevel":false},"i|IVbL//R./jHlc?uR^@":{"opcode":"looks_think","next":":dKBM+*)?s0M}9o;(o,5","parent":"BKt6m]b/CyFEgWlPivq6","inputs":{"MESSAGE":[1,[10,"0.5773502692"]]},"fields":{},"shadow":false,"topLevel":false},":dKBM+*)?s0M}9o;(o,5":{"opcode":"looks_say","next":":;lD78gzo6@1)0lLF*tg","parent":"i|IVbL//R./jHlc?uR^@","inputs":{"MESSAGE":[3,"dih51:LxA=fg,+h:+kDe",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"dih51:LxA=fg,+h:+kDe":{"opcode":"operator_mathop","next":null,"parent":":dKBM+*)?s0M}9o;(o,5","inputs":{"NUM":[1,[4,"0.83"]]},"fields":{"OPERATOR":["asin",null]},"shadow":false,"topLevel":false},":;lD78gzo6@1)0lLF*tg":{"opcode":"looks_think","next":",mV[3|nJs--n)X89c{1S","parent":":dKBM+*)?s0M}9o;(o,5","inputs":{"MESSAGE":[1,[10,"56.098738003133725"]]},"fields":{},"shadow":false,"topLevel":false},",mV[3|nJs--n)X89c{1S":{"opcode":"looks_say","next":"09deKOsSPk0jl`dCvnOV","parent":":;lD78gzo6@1)0lLF*tg","inputs":{"MESSAGE":[3,"5|K}3@tMVaO?8)HgW2,=",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"5|K}3@tMVaO?8)HgW2,=":{"opcode":"operator_mathop","next":null,"parent":",mV[3|nJs--n)X89c{1S","inputs":{"NUM":[1,[4,".5"]]},"fields":{"OPERATOR":["acos",null]},"shadow":false,"topLevel":false},"09deKOsSPk0jl`dCvnOV":{"opcode":"looks_think","next":"5`Y!#[,1^.s:xR`/x%I(","parent":",mV[3|nJs--n)X89c{1S","inputs":{"MESSAGE":[1,[10,"60.00000000000001"]]},"fields":{},"shadow":false,"topLevel":false},"5`Y!#[,1^.s:xR`/x%I(":{"opcode":"looks_say","next":"jJB=:J9tO]@y=.LTm|(Y","parent":"09deKOsSPk0jl`dCvnOV","inputs":{"MESSAGE":[3,"RTV7SRf/K7CXJO.3Wam`",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"RTV7SRf/K7CXJO.3Wam`":{"opcode":"operator_mathop","next":null,"parent":"5`Y!#[,1^.s:xR`/x%I(","inputs":{"NUM":[1,[4,"1"]]},"fields":{"OPERATOR":["atan",null]},"shadow":false,"topLevel":false},"jJB=:J9tO]@y=.LTm|(Y":{"opcode":"looks_think","next":"r14h$69:F99wg)P;Bg/^","parent":"5`Y!#[,1^.s:xR`/x%I(","inputs":{"MESSAGE":[1,[10,"45"]]},"fields":{},"shadow":false,"topLevel":false},"r14h$69:F99wg)P;Bg/^":{"opcode":"looks_say","next":"`i(A(Xas3@6sX}[:B$*w","parent":"jJB=:J9tO]@y=.LTm|(Y","inputs":{"MESSAGE":[3,":gQg`l%C+1Jc_?J=h9.w",[10,""]]},"fields":{},"shadow":false,"topLevel":false},":gQg`l%C+1Jc_?J=h9.w":{"opcode":"operator_mathop","next":null,"parent":"r14h$69:F99wg)P;Bg/^","inputs":{"NUM":[1,[4,"75"]]},"fields":{"OPERATOR":["ln",null]},"shadow":false,"topLevel":false},"`i(A(Xas3@6sX}[:B$*w":{"opcode":"looks_think","next":"EXPB1PR)b?cCUV;U*1*D","parent":"r14h$69:F99wg)P;Bg/^","inputs":{"MESSAGE":[1,[10,"4.31748811353631"]]},"fields":{},"shadow":false,"topLevel":false},"EXPB1PR)b?cCUV;U*1*D":{"opcode":"looks_say","next":"po5}UP}bNBXU{.bcAIw!","parent":"`i(A(Xas3@6sX}[:B$*w","inputs":{"MESSAGE":[3,"aGQQAJfUMNbV+w@xeoJM",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"aGQQAJfUMNbV+w@xeoJM":{"opcode":"operator_mathop","next":null,"parent":"EXPB1PR)b?cCUV;U*1*D","inputs":{"NUM":[1,[4,"5"]]},"fields":{"OPERATOR":["log",null]},"shadow":false,"topLevel":false},"po5}UP}bNBXU{.bcAIw!":{"opcode":"looks_think","next":"ENYHq(rMv`28?z05-fcy","parent":"EXPB1PR)b?cCUV;U*1*D","inputs":{"MESSAGE":[1,[10,"0.6989700043360187"]]},"fields":{},"shadow":false,"topLevel":false},"ENYHq(rMv`28?z05-fcy":{"opcode":"looks_say","next":"V)zKngeeKXOmHk#_NV$V","parent":"po5}UP}bNBXU{.bcAIw!","inputs":{"MESSAGE":[3,"N)AnsTD$PTQ^vL1b^B6(",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"N)AnsTD$PTQ^vL1b^B6(":{"opcode":"operator_mathop","next":null,"parent":"ENYHq(rMv`28?z05-fcy","inputs":{"NUM":[1,[4,"2"]]},"fields":{"OPERATOR":["e ^",null]},"shadow":false,"topLevel":false},"V)zKngeeKXOmHk#_NV$V":{"opcode":"looks_think","next":"VuIYLV*_Y|S7q@WB86-3","parent":"ENYHq(rMv`28?z05-fcy","inputs":{"MESSAGE":[1,[10,"7.38905609893065"]]},"fields":{},"shadow":false,"topLevel":false},"VuIYLV*_Y|S7q@WB86-3":{"opcode":"looks_say","next":"~~kSCe./=?n/$4LrvF+v","parent":"V)zKngeeKXOmHk#_NV$V","inputs":{"MESSAGE":[3,"(S=pruaRgx4E`$E8nX3p",[10,""]]},"fields":{},"shadow":false,"topLevel":false},"(S=pruaRgx4E`$E8nX3p":{"opcode":"operator_mathop","next":null,"parent":"VuIYLV*_Y|S7q@WB86-3","inputs":{"NUM":[1,[4,"-3"]]},"fields":{"OPERATOR":["10 ^",null]},"shadow":false,"topLevel":false},"~~kSCe./=?n/$4LrvF+v":{"opcode":"looks_think","next":null,"parent":"VuIYLV*_Y|S7q@WB86-3","inputs":{"MESSAGE":[1,[10,"0.001"]]},"fields":{},"shadow":false,"topLevel":false},"~#O~9bX9ds{HU]*nh,Ap":{"opcode":"event_whenflagclicked","next":"ufQxu^)fV@W?IuDBOw|k","parent":null,"inputs":{},"fields":{},"shadow":false,"topLevel":true,"x":1108,"y":547,"comment":",4k.:=opNO95fb-_U2Da"},"ufQxu^)fV@W?IuDBOw|k":{"opcode":"data_setvariableto","next":"P9+^#:D}ZSXlX=n55^d[","parent":"~#O~9bX9ds{HU]*nh,Ap","inputs":{"VALUE":[1,[10,"0"]]},"fields":{"VARIABLE":["counter","h}uu)tclo-s|vyEe1J`D"]},"shadow":false,"topLevel":false},"P9+^#:D}ZSXlX=n55^d[":{"opcode":"looks_say","next":"+!gZKhrH$!AT14PE%uIg","parent":"ufQxu^)fV@W?IuDBOw|k","inputs":{"MESSAGE":[3,[12,"counter","h}uu)tclo-s|vyEe1J`D"],[10,""]]},"fields":{},"shadow":false,"topLevel":false},"+!gZKhrH$!AT14PE%uIg":{"opcode":"looks_think","next":"/=P_YT^oyIzY,0%PxJHT","parent":"P9+^#:D}ZSXlX=n55^d[","inputs":{"MESSAGE":[1,[10,"0"]]},"fields":{},"shadow":false,"topLevel":false},"/=P_YT^oyIzY,0%PxJHT":{"opcode":"control_repeat","next":"Li[A:UgBTgGQF:_tH6wf","parent":"+!gZKhrH$!AT14PE%uIg","inputs":{"TIMES":[1,[6,"10"]],"SUBSTACK":[2,"gXWN//@gr[cvoH|?`7{3"]},"fields":{},"shadow":false,"topLevel":false},"gXWN//@gr[cvoH|?`7{3":{"opcode":"data_changevariableby","next":null,"parent":"/=P_YT^oyIzY,0%PxJHT","inputs":{"VALUE":[1,[4,"1"]]},"fields":{"VARIABLE":["counter","h}uu)tclo-s|vyEe1J`D"]},"shadow":false,"topLevel":false},"Li[A:UgBTgGQF:_tH6wf":{"opcode":"looks_say","next":"W4Pn%CbN%~mO!{%fsGq/","parent":"/=P_YT^oyIzY,0%PxJHT","inputs":{"MESSAGE":[3,[12,"counter","h}uu)tclo-s|vyEe1J`D"],[10,""]]},"fields":{},"shadow":false,"topLevel":false},"W4Pn%CbN%~mO!{%fsGq/":{"opcode":"looks_think","next":"VwxKs/h[QROzAkL]G.7-","parent":"Li[A:UgBTgGQF:_tH6wf","inputs":{"MESSAGE":[1,[10,"10"]]},"fields":{},"shadow":false,"topLevel":false},"VwxKs/h[QROzAkL]G.7-":{"opcode":"control_repeat_until","next":"z)WLE`HI!43*r..WcnCf","parent":"W4Pn%CbN%~mO!{%fsGq/","inputs":{"CONDITION":[2,"8)|t4*ApE={z}N!p0%Us"],"SUBSTACK":[2,"!U%^?;@/iOWqhs$7!d01"]},"fields":{},"shadow":false,"topLevel":false},"8)|t4*ApE={z}N!p0%Us":{"opcode":"operator_lt","next":null,"parent":"VwxKs/h[QROzAkL]G.7-","inputs":{"OPERAND1":[3,[12,"counter","h}uu)tclo-s|vyEe1J`D"],[10,""]],"OPERAND2":[1,[10,"-1"]]},"fields":{},"shadow":false,"topLevel":false},"!U%^?;@/iOWqhs$7!d01":{"opcode":"data_changevariableby","next":null,"parent":"VwxKs/h[QROzAkL]G.7-","inputs":{"VALUE":[1,[4,"-2"]]},"fields":{"VARIABLE":["counter","h}uu)tclo-s|vyEe1J`D"]},"shadow":false,"topLevel":false},"z)WLE`HI!43*r..WcnCf":{"opcode":"looks_say","next":"A=;_gFFGl|ZFL{3Fq;S2","parent":"VwxKs/h[QROzAkL]G.7-","inputs":{"MESSAGE":[3,[12,"counter","h}uu)tclo-s|vyEe1J`D"],[10,""]]},"fields":{},"shadow":false,"topLevel":false},"A=;_gFFGl|ZFL{3Fq;S2":{"opcode":"looks_think","next":null,"parent":"z)WLE`HI!43*r..WcnCf","inputs":{"MESSAGE":[1,[10,"-2"]]},"fields":{},"shadow":false,"topLevel":false},"bGYY}Jz}AY?Uvt#b`NU.":{"opcode":"event_whenflagclicked","next":"e3qu`{Eg[n6ndV,Ls2fa","parent":null,"inputs":{},"fields":{},"shadow":false,"topLevel":true,"x":20,"y":260,"comment":"N_Dm~!1lwv1ubFWOF.:P"},"e3qu`{Eg[n6ndV,Ls2fa":{"opcode":"data_setvariableto","next":"oxR//|T))BRuinBv.8RY","parent":"bGYY}Jz}AY?Uvt#b`NU.","inputs":{"VALUE":[1,[10,"world"]]},"fields":{"VARIABLE":["Local Var 1","KVrWdvq3SmYJl^Zwl_Yg"]},"shadow":false,"topLevel":false},"oxR//|T))BRuinBv.8RY":{"opcode":"looks_say","next":"Cr5b%.Pnw,Apm}E8G`O.","parent":"e3qu`{Eg[n6ndV,Ls2fa","inputs":{"MESSAGE":[3,[12,"Local Var 1","KVrWdvq3SmYJl^Zwl_Yg"],[10,""]]},"fields":{},"shadow":false,"topLevel":false},"Cr5b%.Pnw,Apm}E8G`O.":{"opcode":"looks_think","next":"5`F9-`^{i^@!P+a;[rc3","parent":"oxR//|T))BRuinBv.8RY","inputs":{"MESSAGE":[1,[10,"world"]]},"fields":{},"shadow":false,"topLevel":false},"5`F9-`^{i^@!P+a;[rc3":{"opcode":"data_setvariableto","next":"QUoZ%SD;7sC$D{V8{*y5","parent":"Cr5b%.Pnw,Apm}E8G`O.","inputs":{"VALUE":[1,[10,"-5"]]},"fields":{"VARIABLE":["Local Var 1","KVrWdvq3SmYJl^Zwl_Yg"]},"shadow":false,"topLevel":false},"QUoZ%SD;7sC$D{V8{*y5":{"opcode":"looks_say","next":"U%*:#yMzNkd+fpqdVU{{","parent":"5`F9-`^{i^@!P+a;[rc3","inputs":{"MESSAGE":[3,[12,"Local Var 1","KVrWdvq3SmYJl^Zwl_Yg"],[10,""]]},"fields":{},"shadow":false,"topLevel":false},"U%*:#yMzNkd+fpqdVU{{":{"opcode":"looks_think","next":"iIlJC-9vBSY[u7PE`(Th","parent":"QUoZ%SD;7sC$D{V8{*y5","inputs":{"MESSAGE":[1,[10,"-5"]]},"fields":{},"shadow":false,"topLevel":false},"iIlJC-9vBSY[u7PE`(Th":{"opcode":"data_changevariableby","next":"E|8W6-yF+-g(9Mm6U68O","parent":"U%*:#yMzNkd+fpqdVU{{","inputs":{"VALUE":[1,[4,"7.5"]]},"fields":{"VARIABLE":["Local Var 1","KVrWdvq3SmYJl^Zwl_Yg"]},"shadow":false,"topLevel":false},"E|8W6-yF+-g(9Mm6U68O":{"opcode":"looks_say","next":"zKd77f}YHyuM[;2hfkXP","parent":"iIlJC-9vBSY[u7PE`(Th","inputs":{"MESSAGE":[3,[12,"Local Var 1","KVrWdvq3SmYJl^Zwl_Yg"],[10,""]]},"fields":{},"shadow":false,"topLevel":false},"zKd77f}YHyuM[;2hfkXP":{"opcode":"looks_think","next":"guZmhf)Dz~R.;Iv)=UPm","parent":"E|8W6-yF+-g(9Mm6U68O","inputs":{"MESSAGE":[1,[10,"2.5"]]},"fields":{},"shadow":false,"topLevel":false},"guZmhf)Dz~R.;Iv)=UPm":{"opcode":"data_changevariableby","next":"t^H%I{]GWwdfuq:wW]Np","parent":"zKd77f}YHyuM[;2hfkXP","inputs":{"VALUE":[1,[4,"-0.3"]]},"fields":{"VARIABLE":["Local Var 1","KVrWdvq3SmYJl^Zwl_Yg"]},"shadow":false,"topLevel":false},"t^H%I{]GWwdfuq:wW]Np":{"opcode":"looks_say","next":"sLV-4ghU-mloi-gHG|;(","parent":"guZmhf)Dz~R.;Iv)=UPm","inputs":{"MESSAGE":[3,[12,"Local Var 1","KVrWdvq3SmYJl^Zwl_Yg"],[10,""]]},"fields":{},"shadow":false,"topLevel":false},"sLV-4ghU-mloi-gHG|;(":{"opcode":"looks_think","next":null,"parent":"t^H%I{]GWwdfuq:wW]Np","inputs":{"MESSAGE":[1,[10,"2.2"]]},"fields":{},"shadow":false,"topLevel":false},"1|XRbQy}F=A:ed-~GQX3":{"opcode":"event_whenflagclicked","next":"xCwO2ta!~%+b[l1Zh,]F","parent":null,"inputs":{},"fields":{},"shadow":false,"topLevel":true,"x":342,"y":2080},"xCwO2ta!~%+b[l1Zh,]F":{"opcode":"pen_setPenColorParamTo","next":"BcY=g}A_m~xyN,v8h,)P","parent":"1|XRbQy}F=A:ed-~GQX3","inputs":{"COLOR_PARAM":[1,"4JNst9/dD(V=k?#Eui`#"],"VALUE":[1,[4,"100"]]},"fields":{},"shadow":false,"topLevel":false},"4JNst9/dD(V=k?#Eui`#":{"opcode":"pen_menu_colorParam","next":null,"parent":"xCwO2ta!~%+b[l1Zh,]F","inputs":{},"fields":{"colorParam":["saturation",null]},"shadow":true,"topLevel":false},"BcY=g}A_m~xyN,v8h,)P":{"opcode":"pen_setPenColorParamTo","next":"hjY}mzGU]QwVdmS*@BWn","parent":"xCwO2ta!~%+b[l1Zh,]F","inputs":{"COLOR_PARAM":[1,"YErDkjEemsv{qc4f$k`p"],"VALUE":[1,[4,"100"]]},"fields":{},"shadow":false,"topLevel":false},"YErDkjEemsv{qc4f$k`p":{"opcode":"pen_menu_colorParam","next":null,"parent":"BcY=g}A_m~xyN,v8h,)P","inputs":{},"fields":{"colorParam":["brightness",null]},"shadow":true,"topLevel":false},"hjY}mzGU]QwVdmS*@BWn":{"opcode":"pen_setPenColorParamTo","next":"3G#-_{e}-^.GHQE)rQ2I","parent":"BcY=g}A_m~xyN,v8h,)P","inputs":{"COLOR_PARAM":[1,"iM3Y=20a$NMQH6^@EJCc"],"VALUE":[1,[4,"50"]]},"fields":{},"shadow":false,"topLevel":false},"iM3Y=20a$NMQH6^@EJCc":{"opcode":"pen_menu_colorParam","next":null,"parent":"hjY}mzGU]QwVdmS*@BWn","inputs":{},"fields":{"colorParam":["color",null]},"shadow":true,"topLevel":false},"3G#-_{e}-^.GHQE)rQ2I":{"opcode":"pen_setPenSizeTo","next":"GJ~UCy)xr]uYQ$tH9+sO","parent":"hjY}mzGU]QwVdmS*@BWn","inputs":{"SIZE":[1,[4,"100"]]},"fields":{},"shadow":false,"topLevel":false},"GJ~UCy)xr]uYQ$tH9+sO":{"opcode":"pen_penDown","next":"hn[EIXTic[{x=X)31^Uy","parent":"3G#-_{e}-^.GHQE)rQ2I","inputs":{},"fields":{},"shadow":false,"topLevel":false},"hn[EIXTic[{x=X)31^Uy":{"opcode":"motion_gotoxy","next":null,"parent":"GJ~UCy)xr]uYQ$tH9+sO","inputs":{"X":[1,[4,"50"]],"Y":[1,[4,"50"]]},"fields":{},"shadow":false,"topLevel":false}},"comments":{"N_Dm~!1lwv1ubFWOF.:P":{"blockId":"bGYY}Jz}AY?Uvt#b`NU.","x":230.45874276620373,"y":254.36364845893362,"width":200,"height":200,"minimized":true,"text":"hq-dbg"},":Dieu_wHnCR+-?9Z0DE=":{"blockId":"|mF$*1cCVtpn!ASr:8#f","x":756.6450014467592,"y":28.120616771556712,"width":200,"height":200,"minimized":true,"text":"hq-dbg"},"rZ3_B{qwutZfQ@+p~ty;":{"blockId":"+BU9~YXIg):.%iFnHIOY","x":756.9137957537615,"y":628.1129132028494,"width":200,"height":200,"minimized":true,"text":"hq-dbg"},"Z2iuff*|_P=B|gypDA..":{"blockId":"%ZfE%Oh1X~!C`H{L_lpc","x":197.0285726615651,"y":947.7044253519792,"width":200,"height":200,"minimized":true,"text":"hq-dbg"},",4k.:=opNO95fb-_U2Da":{"blockId":"~#O~9bX9ds{HU]*nh,Ap","x":1209.191822193287,"y":609.3938734266493,"width":200,"height":200,"minimized":true,"text":"hq-dbg"}},"currentCostume":0,"costumes":[{"name":"costume1","bitmapResolution":1,"dataFormat":"svg","assetId":"3339a2953a3bf62bb80e54ff575dbced","md5ext":"3339a2953a3bf62bb80e54ff575dbced.svg","rotationCenterX":0,"rotationCenterY":0}],"sounds":[{"name":"pop","assetId":"83a9787d4cb6f3b7632b4ddfebf74367","dataFormat":"wav","format":"","rate":48000,"sampleCount":1123,"md5ext":"83a9787d4cb6f3b7632b4ddfebf74367.wav"}],"volume":100,"layerOrder":1,"visible":true,"x":50,"y":50,"size":100,"direction":90,"draggable":false,"rotationStyle":"all around"}],"monitors":[{"id":"KVrWdvq3SmYJl^Zwl_Yg","mode":"default","opcode":"data_variable","params":{"VARIABLE":"Local Var 1"},"spriteName":"Sprite1","value":2.2,"width":0,"height":0,"x":5,"y":5,"visible":true,"sliderMin":0,"sliderMax":100,"isDiscrete":true},{"id":"Li]%7ap~.rXkBAo4UoIe","mode":"default","opcode":"data_variable","params":{"VARIABLE":"Global Var 1"},"spriteName":null,"value":6.7,"width":0,"height":0,"x":5,"y":32,"visible":true,"sliderMin":0,"sliderMax":100,"isDiscrete":true},{"id":"h}uu)tclo-s|vyEe1J`D","mode":"default","opcode":"data_variable","params":{"VARIABLE":"counter"},"spriteName":"Sprite1","value":-2,"width":0,"height":0,"x":5,"y":59,"visible":true,"sliderMin":0,"sliderMax":100,"isDiscrete":true}],"extensions":["pen"],"meta":{"semver":"3.0.0","vm":"2.1.14","agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"}} \ No newline at end of file diff --git a/js/cast/float2string.ts b/js/cast/float2string.ts index eeb19af5..a4b85a8a 100644 --- a/js/cast/float2string.ts +++ b/js/cast/float2string.ts @@ -1,3 +1,3 @@ export function float2string(s: number): string { - return s.toString(); -} \ No newline at end of file + return s.toString(); +} diff --git a/js/cast/int2string.ts b/js/cast/int2string.ts index b33b27e6..697921d3 100644 --- a/js/cast/int2string.ts +++ b/js/cast/int2string.ts @@ -1,3 +1,3 @@ export function int2string(s: number): string { - return s.toString(); -} \ No newline at end of file + return s.toString(); +} diff --git a/js/cast/string2float.ts b/js/cast/string2float.ts index 1bc9e404..1c42e182 100644 --- a/js/cast/string2float.ts +++ b/js/cast/string2float.ts @@ -1,3 +1,3 @@ export function string2float(s: string): number { - return parseFloat(s); -} \ No newline at end of file + return parseFloat(s); +} diff --git a/js/looks/say_debug_float.ts b/js/looks/say_debug_float.ts index 5c60d03b..262d89f4 100644 --- a/js/looks/say_debug_float.ts +++ b/js/looks/say_debug_float.ts @@ -1,5 +1,5 @@ import { target_names } from "../shared"; export function say_debug_float(data: number, target_idx: number): void { - console.log('%s says: %d', target_names()[target_idx], data); -} \ No newline at end of file + console.log("%s says: %d", target_names()[target_idx], data); +} diff --git a/js/looks/say_debug_int.ts b/js/looks/say_debug_int.ts index 7eb74e9c..8981ec47 100644 --- a/js/looks/say_debug_int.ts +++ b/js/looks/say_debug_int.ts @@ -1,5 +1,5 @@ import { target_names } from "../shared"; export function say_debug_int(data: number, target_idx: number): void { - console.log('%s says: %d', target_names()[target_idx], data); -} \ No newline at end of file + console.log("%s says: %d", target_names()[target_idx], data); +} diff --git a/js/looks/say_debug_string.ts b/js/looks/say_debug_string.ts index d0d2c5cb..8297312f 100644 --- a/js/looks/say_debug_string.ts +++ b/js/looks/say_debug_string.ts @@ -1,5 +1,5 @@ import { target_names } from "../shared"; export function say_debug_string(data: string, target_idx: number): void { - console.log('%s says: %s', target_names()[target_idx], data); -} \ No newline at end of file + console.log("%s says: %s", target_names()[target_idx], data); +} diff --git a/js/looks/say_float.ts b/js/looks/say_float.ts index f2e2eb82..2317eb34 100644 --- a/js/looks/say_float.ts +++ b/js/looks/say_float.ts @@ -2,4 +2,4 @@ import { update_bubble } from "../shared"; export function say_float(data: number, target_idx: number): void { update_bubble(target_idx, "say", data.toString()); -} \ No newline at end of file +} diff --git a/js/looks/say_int.ts b/js/looks/say_int.ts index 0eef4c79..acdc8385 100644 --- a/js/looks/say_int.ts +++ b/js/looks/say_int.ts @@ -2,4 +2,4 @@ import { update_bubble } from "../shared"; export function say_int(data: number, target_idx: number): void { update_bubble(target_idx, "say", data.toString()); -} \ No newline at end of file +} diff --git a/js/looks/say_string.ts b/js/looks/say_string.ts index f478b025..57df0589 100644 --- a/js/looks/say_string.ts +++ b/js/looks/say_string.ts @@ -2,4 +2,4 @@ import { update_bubble } from "../shared"; export function say_string(data: string, target_idx: number): void { update_bubble(target_idx, "say", data); -} \ No newline at end of file +} diff --git a/js/looks/setsizeto.ts b/js/looks/setsizeto.ts index 62681a5f..e16852af 100644 --- a/js/looks/setsizeto.ts +++ b/js/looks/setsizeto.ts @@ -1,5 +1,7 @@ -import { renderer, costumes, target_skins } from '../shared'; +import { renderer, costumes, target_skins } from "../shared"; export function setsizeto(size: number, target_index: number) { - renderer().getDrawable(target_skins()[target_index][1]).updateScale([size, size]); + renderer() + .getDrawable(target_skins()[target_index][1]) + .updateScale([size, size]); } diff --git a/js/looks/setvisible.ts b/js/looks/setvisible.ts index 977d5aa0..05e0f684 100644 --- a/js/looks/setvisible.ts +++ b/js/looks/setvisible.ts @@ -1,5 +1,7 @@ -import { renderer, costumes, target_skins } from '../shared'; +import { renderer, costumes, target_skins } from "../shared"; export function setvisible(visible: boolean, target_index: number) { - renderer().getDrawable(target_skins()[target_index][1]).updateVisible(visible); + renderer() + .getDrawable(target_skins()[target_index][1]) + .updateVisible(visible); } diff --git a/js/looks/switchcostumeto.ts b/js/looks/switchcostumeto.ts index 00bff36e..a85763f4 100644 --- a/js/looks/switchcostumeto.ts +++ b/js/looks/switchcostumeto.ts @@ -1,6 +1,6 @@ -import { renderer, costumes, target_skins } from '../shared'; +import { renderer, costumes, target_skins } from "../shared"; export function switchcostumeto(costume_num: number, target_index: number) { - const costume = costumes()[target_index][costume_num]; - renderer().getSkin(target_skins()[target_index][0]).setSVG(costume.data); -} \ No newline at end of file + const costume = costumes()[target_index][costume_num]; + renderer().getSkin(target_skins()[target_index][0]).setSVG(costume.data); +} diff --git a/js/looks/think_debug_float.ts b/js/looks/think_debug_float.ts index 2441325d..ffcee4aa 100644 --- a/js/looks/think_debug_float.ts +++ b/js/looks/think_debug_float.ts @@ -1,5 +1,5 @@ import { target_names } from "../shared"; export function think_debug_float(data: number, target_idx: number): void { - console.log('%s thinks: %d', target_names()[target_idx], data); -} \ No newline at end of file + console.log("%s thinks: %d", target_names()[target_idx], data); +} diff --git a/js/looks/think_debug_int.ts b/js/looks/think_debug_int.ts index f74487da..9e65a41d 100644 --- a/js/looks/think_debug_int.ts +++ b/js/looks/think_debug_int.ts @@ -1,5 +1,5 @@ import { target_names } from "../shared"; export function think_debug_int(data: number, target_idx: number): void { - console.log('%s thinks: %d', target_names()[target_idx], data); -} \ No newline at end of file + console.log("%s thinks: %d", target_names()[target_idx], data); +} diff --git a/js/looks/think_debug_string.ts b/js/looks/think_debug_string.ts index 44e54dc3..7b09f2cc 100644 --- a/js/looks/think_debug_string.ts +++ b/js/looks/think_debug_string.ts @@ -1,5 +1,5 @@ import { target_names } from "../shared"; export function think_debug_string(data: string, target_idx: number): void { - console.log('%s thinks: %s', target_names()[target_idx], data); -} \ No newline at end of file + console.log("%s thinks: %s", target_names()[target_idx], data); +} diff --git a/js/looks/think_float.ts b/js/looks/think_float.ts index 42a75f20..468b2bd5 100644 --- a/js/looks/think_float.ts +++ b/js/looks/think_float.ts @@ -2,4 +2,4 @@ import { update_bubble } from "../shared"; export function think_float(data: number, target_idx: number): void { update_bubble(target_idx, "think", data.toString()); -} \ No newline at end of file +} diff --git a/js/looks/think_int.ts b/js/looks/think_int.ts index 6ddfb219..a02946df 100644 --- a/js/looks/think_int.ts +++ b/js/looks/think_int.ts @@ -2,4 +2,4 @@ import { update_bubble } from "../shared"; export function think_int(data: number, target_idx: number): void { update_bubble(target_idx, "think", data.toString()); -} \ No newline at end of file +} diff --git a/js/looks/think_string.ts b/js/looks/think_string.ts index 08dd1dea..7a2109c4 100644 --- a/js/looks/think_string.ts +++ b/js/looks/think_string.ts @@ -2,4 +2,4 @@ import { update_bubble } from "../shared"; export function think_string(data: string, target_idx: number): void { update_bubble(target_idx, "think", data); -} \ No newline at end of file +} diff --git a/js/motion/gotoxy.ts b/js/motion/gotoxy.ts index c43800e0..35b2f61d 100644 --- a/js/motion/gotoxy.ts +++ b/js/motion/gotoxy.ts @@ -1,5 +1,7 @@ -import { renderer, target_skins } from '../shared'; +import { renderer, target_skins } from "../shared"; export function gotoxy(x: number, y: number, target_index: number) { - renderer().getDrawable(target_skins()[target_index][1]).updatePosition([x, y]); + renderer() + .getDrawable(target_skins()[target_index][1]) + .updatePosition([x, y]); } diff --git a/js/motion/pointindirection.ts b/js/motion/pointindirection.ts index f0364228..300da193 100644 --- a/js/motion/pointindirection.ts +++ b/js/motion/pointindirection.ts @@ -1,5 +1,7 @@ -import { renderer, target_skins } from '../shared'; +import { renderer, target_skins } from "../shared"; export function pointindirection(target_index: number, direction: number) { - renderer().getDrawable(target_skins()[target_index][1]).updateDirection(direction); + renderer() + .getDrawable(target_skins()[target_index][1]) + .updateDirection(direction); } diff --git a/js/operator/acos.ts b/js/operator/acos.ts index b5414d52..3ae7dfe6 100644 --- a/js/operator/acos.ts +++ b/js/operator/acos.ts @@ -1,3 +1,3 @@ export function acos(n: number): number { return Math.acos(n); -} \ No newline at end of file +} diff --git a/js/operator/asin.ts b/js/operator/asin.ts index 50d7a145..daf6a02a 100644 --- a/js/operator/asin.ts +++ b/js/operator/asin.ts @@ -1,3 +1,3 @@ export function asin(n: number): number { return Math.asin(n); -} \ No newline at end of file +} diff --git a/js/operator/atan.ts b/js/operator/atan.ts index 2e7b80b0..9ac11def 100644 --- a/js/operator/atan.ts +++ b/js/operator/atan.ts @@ -1,3 +1,3 @@ export function atan(n: number): number { return Math.atan(n); -} \ No newline at end of file +} diff --git a/js/operator/contains.ts b/js/operator/contains.ts index ca81e300..59761335 100644 --- a/js/operator/contains.ts +++ b/js/operator/contains.ts @@ -1,3 +1,3 @@ export function contains(left: string, right: string): boolean { - return left.toLowerCase().includes(right.toLowerCase()); -} \ No newline at end of file + return left.toLowerCase().includes(right.toLowerCase()); +} diff --git a/js/operator/cos.ts b/js/operator/cos.ts index d08b0d7d..44142921 100644 --- a/js/operator/cos.ts +++ b/js/operator/cos.ts @@ -1,3 +1,3 @@ export function cos(theta: number): number { - return Math.cos(theta); -} \ No newline at end of file + return Math.cos(theta); +} diff --git a/js/operator/eq_string.ts b/js/operator/eq_string.ts index d273ef36..5e76f472 100644 --- a/js/operator/eq_string.ts +++ b/js/operator/eq_string.ts @@ -1,3 +1,3 @@ export function eq_string(left: string, right: string): boolean { - return left.toLowerCase() === right.toLowerCase(); -} \ No newline at end of file + return left.toLowerCase() === right.toLowerCase(); +} diff --git a/js/operator/exp.ts b/js/operator/exp.ts index 0ff41274..f8fe304c 100644 --- a/js/operator/exp.ts +++ b/js/operator/exp.ts @@ -1,3 +1,3 @@ export function exp(n: number): number { return Math.exp(n); -} \ No newline at end of file +} diff --git a/js/operator/gt_string.ts b/js/operator/gt_string.ts index 9d590b72..23301d67 100644 --- a/js/operator/gt_string.ts +++ b/js/operator/gt_string.ts @@ -1,3 +1,3 @@ export function gt_string(left: string, right: string): boolean { - return left.toLowerCase() > right.toLowerCase(); -} \ No newline at end of file + return left.toLowerCase() > right.toLowerCase(); +} diff --git a/js/operator/log.ts b/js/operator/log.ts index fc9bff01..002f431b 100644 --- a/js/operator/log.ts +++ b/js/operator/log.ts @@ -1,3 +1,3 @@ export function log(n: number): number { return Math.log(n); -} \ No newline at end of file +} diff --git a/js/operator/lt_string.ts b/js/operator/lt_string.ts index 6bfb6781..0d843d43 100644 --- a/js/operator/lt_string.ts +++ b/js/operator/lt_string.ts @@ -1,3 +1,3 @@ export function lt_string(left: string, right: string): boolean { - return left.toLowerCase() < right.toLowerCase(); -} \ No newline at end of file + return left.toLowerCase() < right.toLowerCase(); +} diff --git a/js/operator/random.ts b/js/operator/random.ts index 9121b8bb..fec97b8c 100644 --- a/js/operator/random.ts +++ b/js/operator/random.ts @@ -1,3 +1,3 @@ export function random(): number { - return Math.random(); + return Math.random(); } diff --git a/js/operator/sin.ts b/js/operator/sin.ts index 7badb315..8dd6d498 100644 --- a/js/operator/sin.ts +++ b/js/operator/sin.ts @@ -1,3 +1,3 @@ export function sin(theta: number): number { return Math.sin(theta); -} \ No newline at end of file +} diff --git a/js/pen/clear.ts b/js/pen/clear.ts index a86d5106..325e0198 100644 --- a/js/pen/clear.ts +++ b/js/pen/clear.ts @@ -1,5 +1,5 @@ -import { renderer, pen_skin } from '../shared'; +import { renderer, pen_skin } from "../shared"; export function clear() { - renderer().penClear(pen_skin()); + renderer().penClear(pen_skin()); } diff --git a/js/pen/line.ts b/js/pen/line.ts index bf18e536..bc16516f 100644 --- a/js/pen/line.ts +++ b/js/pen/line.ts @@ -1,25 +1,25 @@ import { renderer, pen_skin } from "../shared"; export function line( - radius: number, - x1: number, - y1: number, - x2: number, - y2: number, - r: number, - g: number, - b: number, - a: number + radius: number, + x1: number, + y1: number, + x2: number, + y2: number, + r: number, + g: number, + b: number, + a: number, ) { - renderer().penLine( - pen_skin(), - { - diameter: radius, - color4f: [r, g, b, a], - }, - x1, - y1, - x2, - y2 - ); + renderer().penLine( + pen_skin(), + { + diameter: radius, + color4f: [r, g, b, a], + }, + x1, + y1, + x2, + y2, + ); } diff --git a/js/pen/point.ts b/js/pen/point.ts index 9e2a91e1..0ddd92da 100644 --- a/js/pen/point.ts +++ b/js/pen/point.ts @@ -1,13 +1,21 @@ -import { renderer, target_skins, pen_skin } from '../shared'; +import { renderer, target_skins, pen_skin } from "../shared"; -export function point(radius: number, x: number, y: number, r: number, g: number, b: number, a: number) { +export function point( + radius: number, + x: number, + y: number, + r: number, + g: number, + b: number, + a: number, +) { renderer().penPoint( pen_skin(), - { - diameter: radius, // awkward variable naming moment - color4f: [r, g, b, a], - }, - x, - y + { + diameter: radius, // awkward variable naming moment + color4f: [r, g, b, a], + }, + x, + y, ); } diff --git a/js/sensing/dayssince2000.ts b/js/sensing/dayssince2000.ts index 8bede028..be878ea0 100644 --- a/js/sensing/dayssince2000.ts +++ b/js/sensing/dayssince2000.ts @@ -1,10 +1,10 @@ export function dayssince2000(): number { - // https://github.com/scratchfoundation/scratch-vm/blob/f10ab17bf351939153d9d0a17c577b5ba7b3c908/src/blocks/scratch3_sensing.js#L252 - const msPerDay = 24 * 60 * 60 * 1000; - const start = new Date(2000, 0, 1); // Months are 0-indexed. - const today = new Date(); - const dstAdjust = today.getTimezoneOffset() - start.getTimezoneOffset(); - let mSecsSinceStart = today.valueOf() - start.valueOf(); - mSecsSinceStart += ((today.getTimezoneOffset() - dstAdjust) * 60 * 1000); - return mSecsSinceStart / msPerDay; - } \ No newline at end of file + // https://github.com/scratchfoundation/scratch-vm/blob/f10ab17bf351939153d9d0a17c577b5ba7b3c908/src/blocks/scratch3_sensing.js#L252 + const msPerDay = 24 * 60 * 60 * 1000; + const start = new Date(2000, 0, 1); // Months are 0-indexed. + const today = new Date(); + const dstAdjust = today.getTimezoneOffset() - start.getTimezoneOffset(); + let mSecsSinceStart = today.valueOf() - start.valueOf(); + mSecsSinceStart += (today.getTimezoneOffset() - dstAdjust) * 60 * 1000; + return mSecsSinceStart / msPerDay; +} diff --git a/js/shared.ts b/js/shared.ts index a5e4aa56..0780d6ff 100644 --- a/js/shared.ts +++ b/js/shared.ts @@ -7,9 +7,9 @@ let _target_skins: Array<[number, number]>; let _costumes: Array>; type Costume = { - data: string, - dataFormat: string, -} + data: string; + dataFormat: string; +}; export function setup( target_names: Array, @@ -66,7 +66,7 @@ export function costumes(): Array> { export function update_bubble( target_index: number, verb: "say" | "think", - text: string + text: string, ) { check_setup(); if (!_target_bubbles[target_index]) { @@ -75,14 +75,14 @@ export function update_bubble( "sprite", verb, text, - false + false, ); } else { _renderer.updateTextSkin( _target_bubbles[target_index][0], verb, text, - false + false, ); } } diff --git a/js/wasm-js-string/concat.ts b/js/wasm-js-string/concat.ts index 03fdaa47..7abc6746 100644 --- a/js/wasm-js-string/concat.ts +++ b/js/wasm-js-string/concat.ts @@ -1,3 +1,3 @@ export function concat(left: string, right: string): string { - return left.concat(right); -} \ No newline at end of file + return left.concat(right); +} diff --git a/js/wasm-js-string/length.ts b/js/wasm-js-string/length.ts index 74a21af4..b86d71bc 100644 --- a/js/wasm-js-string/length.ts +++ b/js/wasm-js-string/length.ts @@ -1,3 +1,3 @@ export function length(string: string): number { - return string.length; -} \ No newline at end of file + return string.length; +} diff --git a/js/wasm-js-string/substring.ts b/js/wasm-js-string/substring.ts index 4527e982..d4e2e750 100644 --- a/js/wasm-js-string/substring.ts +++ b/js/wasm-js-string/substring.ts @@ -1,3 +1,3 @@ export function substring(string: string, start: number, end: number): string { - return string.substring(start, end); -} \ No newline at end of file + return string.substring(start, end); +} diff --git a/opcodes.mjs b/opcodes.mjs index ad8ec0d9..fe046a78 100644 --- a/opcodes.mjs +++ b/opcodes.mjs @@ -1,5 +1,14 @@ -import { readFile, writeFile } from 'node:fs/promises'; +import { readFile, writeFile } from "node:fs/promises"; -let blocksRs = (await readFile('./src/ir/blocks.rs', 'utf8')); -const opcodes = [...new Set(blocksRs.match(/BlockOpcode::[a-zA-Z_0-9]+? (?==>)/g).map(op => op.replace('BlockOpcode::', '').trim()))].sort() -await writeFile('/tmp/hq-build/js/opcodes.js', `export const opcodes = ${JSON.stringify(opcodes)};`); +let blocksRs = await readFile("./src/ir/blocks.rs", "utf8"); +const opcodes = [ + ...new Set( + blocksRs + .match(/BlockOpcode::[a-zA-Z_0-9]+? (?==>)/g) + .map((op) => op.replace("BlockOpcode::", "").trim()), + ), +].sort(); +await writeFile( + "/tmp/hq-build/js/opcodes.js", + `export const opcodes = ${JSON.stringify(opcodes)};`, +); diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..85487b71 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,8598 @@ +{ + "name": "hyperquark", + "version": "0.0.6", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "hyperquark", + "version": "0.0.6", + "dependencies": { + "@scratch/scratch-vm": "^12.3.0", + "binaryen": "github:pufferfish101007/binaryen.js#non-nullable-table", + "pinia": "2.1.3", + "scratch-parser": "5.1.1", + "scratch-render": "github:hyperquark/scratch-render#develop", + "scratch-sb1-converter": "2.0.228", + "vite-plugin-wasm": "3.5.0", + "vue": "3.5.21", + "vue-router": "4.5.1", + "wasm-feature-detect": "1.8.0" + }, + "devDependencies": { + "@vitejs/plugin-vue": "6.0.1", + "prettier": "^3.7.4", + "vite": "7.3.0", + "vite-plugin-node-polyfills": "0.24.0", + "vitest": "^4.0.16" + } + }, + "node_modules/@asamuzakjp/css-color": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-3.2.0.tgz", + "integrity": "sha512-K1A6z8tS3XsmCMM86xoWdn7Fkdn9m6RSVtocUrJYIwZnFVkng/PvkEoWtOWmP+Scc6saYWHWZYbndEEXxl24jw==", + "license": "MIT", + "dependencies": { + "@csstools/css-calc": "^2.1.3", + "@csstools/css-color-parser": "^3.0.9", + "@csstools/css-parser-algorithms": "^3.0.4", + "@csstools/css-tokenizer": "^3.0.3", + "lru-cache": "^10.4.3" + } + }, + "node_modules/@asamuzakjp/css-color/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "license": "ISC" + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz", + "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.5.tgz", + "integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.5" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.28.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.4.tgz", + "integrity": "sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.5.tgz", + "integrity": "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.27.1", + "@babel/helper-validator-identifier": "^7.28.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@csstools/color-helpers": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-5.1.0.tgz", + "integrity": "sha512-S11EXWJyy0Mz5SYvRmY8nJYTFFd1LCNV+7cXyAgQtOOuzb4EsgfqDufL+9esx72/eLhsRdGZwaldu/h+E4t4BA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT-0", + "engines": { + "node": ">=18" + } + }, + "node_modules/@csstools/css-calc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-2.1.4.tgz", + "integrity": "sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-color-parser": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-3.1.0.tgz", + "integrity": "sha512-nbtKwh3a6xNVIp/VRuXV64yTKnb1IjTAEEh3irzS+HkKjAOYLTGNb9pmVNntZ8iVBHcWDA2Dof0QtPgFI1BaTA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "dependencies": { + "@csstools/color-helpers": "^5.1.0", + "@csstools/css-calc": "^2.1.4" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-parser-algorithms": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.5.tgz", + "integrity": "sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-tokenizer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.4.tgz", + "integrity": "sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "peer": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.2.tgz", + "integrity": "sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.2.tgz", + "integrity": "sha512-DVNI8jlPa7Ujbr1yjU2PfUSRtAUZPG9I1RwW4F4xFB1Imiu2on0ADiI/c3td+KmDtVKNbi+nffGDQMfcIMkwIA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.2.tgz", + "integrity": "sha512-pvz8ZZ7ot/RBphf8fv60ljmaoydPU12VuXHImtAs0XhLLw+EXBi2BLe3OYSBslR4rryHvweW5gmkKFwTiFy6KA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.2.tgz", + "integrity": "sha512-z8Ank4Byh4TJJOh4wpz8g2vDy75zFL0TlZlkUkEwYXuPSgX8yzep596n6mT7905kA9uHZsf/o2OJZubl2l3M7A==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.2.tgz", + "integrity": "sha512-davCD2Zc80nzDVRwXTcQP/28fiJbcOwvdolL0sOiOsbwBa72kegmVU0Wrh1MYrbuCL98Omp5dVhQFWRKR2ZAlg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.2.tgz", + "integrity": "sha512-ZxtijOmlQCBWGwbVmwOF/UCzuGIbUkqB1faQRf5akQmxRJ1ujusWsb3CVfk/9iZKr2L5SMU5wPBi1UWbvL+VQA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.2.tgz", + "integrity": "sha512-lS/9CN+rgqQ9czogxlMcBMGd+l8Q3Nj1MFQwBZJyoEKI50XGxwuzznYdwcav6lpOGv5BqaZXqvBSiB/kJ5op+g==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.2.tgz", + "integrity": "sha512-tAfqtNYb4YgPnJlEFu4c212HYjQWSO/w/h/lQaBK7RbwGIkBOuNKQI9tqWzx7Wtp7bTPaGC6MJvWI608P3wXYA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.2.tgz", + "integrity": "sha512-vWfq4GaIMP9AIe4yj1ZUW18RDhx6EPQKjwe7n8BbIecFtCQG4CfHGaHuh7fdfq+y3LIA2vGS/o9ZBGVxIDi9hw==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.2.tgz", + "integrity": "sha512-hYxN8pr66NsCCiRFkHUAsxylNOcAQaxSSkHMMjcpx0si13t1LHFphxJZUiGwojB1a/Hd5OiPIqDdXONia6bhTw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.2.tgz", + "integrity": "sha512-MJt5BRRSScPDwG2hLelYhAAKh9imjHK5+NE/tvnRLbIqUWa+0E9N4WNMjmp/kXXPHZGqPLxggwVhz7QP8CTR8w==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.2.tgz", + "integrity": "sha512-lugyF1atnAT463aO6KPshVCJK5NgRnU4yb3FUumyVz+cGvZbontBgzeGFO1nF+dPueHD367a2ZXe1NtUkAjOtg==", + "cpu": [ + "loong64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.2.tgz", + "integrity": "sha512-nlP2I6ArEBewvJ2gjrrkESEZkB5mIoaTswuqNFRv/WYd+ATtUpe9Y09RnJvgvdag7he0OWgEZWhviS1OTOKixw==", + "cpu": [ + "mips64el" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.2.tgz", + "integrity": "sha512-C92gnpey7tUQONqg1n6dKVbx3vphKtTHJaNG2Ok9lGwbZil6DrfyecMsp9CrmXGQJmZ7iiVXvvZH6Ml5hL6XdQ==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.2.tgz", + "integrity": "sha512-B5BOmojNtUyN8AXlK0QJyvjEZkWwy/FKvakkTDCziX95AowLZKR6aCDhG7LeF7uMCXEJqwa8Bejz5LTPYm8AvA==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.2.tgz", + "integrity": "sha512-p4bm9+wsPwup5Z8f4EpfN63qNagQ47Ua2znaqGH6bqLlmJ4bx97Y9JdqxgGZ6Y8xVTixUnEkoKSHcpRlDnNr5w==", + "cpu": [ + "s390x" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.2.tgz", + "integrity": "sha512-uwp2Tip5aPmH+NRUwTcfLb+W32WXjpFejTIOWZFw/v7/KnpCDKG66u4DLcurQpiYTiYwQ9B7KOeMJvLCu/OvbA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.2.tgz", + "integrity": "sha512-Kj6DiBlwXrPsCRDeRvGAUb/LNrBASrfqAIok+xB0LxK8CHqxZ037viF13ugfsIpePH93mX7xfJp97cyDuTZ3cw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.2.tgz", + "integrity": "sha512-HwGDZ0VLVBY3Y+Nw0JexZy9o/nUAWq9MlV7cahpaXKW6TOzfVno3y3/M8Ga8u8Yr7GldLOov27xiCnqRZf0tCA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.2.tgz", + "integrity": "sha512-DNIHH2BPQ5551A7oSHD0CKbwIA/Ox7+78/AWkbS5QoRzaqlev2uFayfSxq68EkonB+IKjiuxBFoV8ESJy8bOHA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.2.tgz", + "integrity": "sha512-/it7w9Nb7+0KFIzjalNJVR5bOzA9Vay+yIPLVHfIQYG/j+j9VTH84aNB8ExGKPU4AzfaEvN9/V4HV+F+vo8OEg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.2.tgz", + "integrity": "sha512-LRBbCmiU51IXfeXk59csuX/aSaToeG7w48nMwA6049Y4J4+VbWALAuXcs+qcD04rHDuSCSRKdmY63sruDS5qag==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.2.tgz", + "integrity": "sha512-kMtx1yqJHTmqaqHPAzKCAkDaKsffmXkPHThSfRwZGyuqyIeBvf08KSsYXl+abf5HDAPMJIPnbBfXvP2ZC2TfHg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.2.tgz", + "integrity": "sha512-Yaf78O/B3Kkh+nKABUF++bvJv5Ijoy9AN1ww904rOXZFLWVc5OLOfL56W+C8F9xn5JQZa3UX6m+IktJnIb1Jjg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.2.tgz", + "integrity": "sha512-Iuws0kxo4yusk7sw70Xa2E2imZU5HoixzxfGCdxwBdhiDgt9vX9VUCBhqcwY7/uh//78A1hMkkROMJq9l27oLQ==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.2.tgz", + "integrity": "sha512-sRdU18mcKf7F+YgheI/zGf5alZatMUTKj/jNS6l744f9u3WFu4v7twcUI9vu4mknF4Y9aDlblIie0IM+5xxaqQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "license": "MIT", + "optional": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", + "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", + "license": "MIT", + "optional": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "license": "MIT", + "optional": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-beta.29", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.29.tgz", + "integrity": "sha512-NIJgOsMjbxAXvoGq/X0gD7VPMQ8j9g0BiDaNjVNVjvl+iKXxL3Jre0v31RmBYeLEmkbj2s02v8vFTbUXi5XS2Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/plugin-inject": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@rollup/plugin-inject/-/plugin-inject-5.0.5.tgz", + "integrity": "sha512-2+DEJbNBoPROPkgTDNe8/1YXWcqxbN5DTjASVIOx8HS+pITXushyNiBV56RB08zuptzz8gT3YfkqriTBVycepg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.3" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.2.0.tgz", + "integrity": "sha512-qWJ2ZTbmumwiLFomfzTyt5Kng4hwPi9rwCYN4SHb6eaRU1KNO4ccxINHr/VhH4GgPlt1XfSTLX2LBTme8ne4Zw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.46.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.46.4.tgz", + "integrity": "sha512-B2wfzCJ+ps/OBzRjeds7DlJumCU3rXMxJJS1vzURyj7+KBHGONm7c9q1TfdBl4vCuNMkDvARn3PBl2wZzuR5mw==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.46.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.46.4.tgz", + "integrity": "sha512-FGJYXvYdn8Bs6lAlBZYT5n+4x0ciEp4cmttsvKAZc/c8/JiPaQK8u0c/86vKX8lA7OY/+37lIQSe0YoAImvBAA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.46.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.46.4.tgz", + "integrity": "sha512-/9qwE/BM7ATw/W/OFEMTm3dmywbJyLQb4f4v5nmOjgYxPIGpw7HaxRi6LnD4Pjn/q7k55FGeHe1/OD02w63apA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.46.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.46.4.tgz", + "integrity": "sha512-QkWfNbeRuzFnv2d0aPlrzcA3Ebq2mE8kX/5Pl7VdRShbPBjSnom7dbT8E3Jmhxo2RL784hyqGvR5KHavCJQciw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.46.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.46.4.tgz", + "integrity": "sha512-+ToyOMYnSfV8D+ckxO6NthPln/PDNp1P6INcNypfZ7muLmEvPKXqduUiD8DlJpMMT8LxHcE5W0dK9kXfJke9Zw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.46.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.46.4.tgz", + "integrity": "sha512-cGT6ey/W+sje6zywbLiqmkfkO210FgRz7tepWAzzEVgQU8Hn91JJmQWNqs55IuglG8sJdzk7XfNgmGRtcYlo1w==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.46.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.46.4.tgz", + "integrity": "sha512-9fhTJyOb275w5RofPSl8lpr4jFowd+H4oQKJ9XTYzD1JWgxdZKE8bA6d4npuiMemkecQOcigX01FNZNCYnQBdA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.46.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.46.4.tgz", + "integrity": "sha512-+6kCIM5Zjvz2HwPl/udgVs07tPMIp1VU2Y0c72ezjOvSvEfAIWsUgpcSDvnC7g9NrjYR6X9bZT92mZZ90TfvXw==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.46.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.46.4.tgz", + "integrity": "sha512-SWuXdnsayCZL4lXoo6jn0yyAj7TTjWE4NwDVt9s7cmu6poMhtiras5c8h6Ih6Y0Zk6Z+8t/mLumvpdSPTWub2Q==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.46.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.46.4.tgz", + "integrity": "sha512-vDknMDqtMhrrroa5kyX6tuC0aRZZlQ+ipDfbXd2YGz5HeV2t8HOl/FDAd2ynhs7Ki5VooWiiZcCtxiZ4IjqZwQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loongarch64-gnu": { + "version": "4.46.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.46.4.tgz", + "integrity": "sha512-mCBkjRZWhvjtl/x+Bd4fQkWZT8canStKDxGrHlBiTnZmJnWygGcvBylzLVCZXka4dco5ymkWhZlLwKCGFF4ivw==", + "cpu": [ + "loong64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.46.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.46.4.tgz", + "integrity": "sha512-YMdz2phOTFF+Z66dQfGf0gmeDSi5DJzY5bpZyeg9CPBkV9QDzJ1yFRlmi/j7WWRf3hYIWrOaJj5jsfwgc8GTHQ==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.46.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.46.4.tgz", + "integrity": "sha512-r0WKLSfFAK8ucG024v2yiLSJMedoWvk8yWqfNICX28NHDGeu3F/wBf8KG6mclghx4FsLePxJr/9N8rIj1PtCnw==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.46.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.46.4.tgz", + "integrity": "sha512-IaizpPP2UQU3MNyPH1u0Xxbm73D+4OupL0bjo4Hm0496e2wg3zuvoAIhubkD1NGy9fXILEExPQy87mweujEatA==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.46.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.46.4.tgz", + "integrity": "sha512-aCM29orANR0a8wk896p6UEgIfupReupnmISz6SUwMIwTGaTI8MuKdE0OD2LvEg8ondDyZdMvnaN3bW4nFbATPA==", + "cpu": [ + "s390x" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.46.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.46.4.tgz", + "integrity": "sha512-0Xj1vZE3cbr/wda8d/m+UeuSL+TDpuozzdD4QaSzu/xSOMK0Su5RhIkF7KVHFQsobemUNHPLEcYllL7ZTCP/Cg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.46.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.46.4.tgz", + "integrity": "sha512-kM/orjpolfA5yxsx84kI6bnK47AAZuWxglGKcNmokw2yy9i5eHY5UAjcX45jemTJnfHAWo3/hOoRqEeeTdL5hw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.46.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.46.4.tgz", + "integrity": "sha512-cNLH4psMEsWKILW0isbpQA2OvjXLbKvnkcJFmqAptPQbtLrobiapBJVj6RoIvg6UXVp5w0wnIfd/Q56cNpF+Ew==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.46.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.46.4.tgz", + "integrity": "sha512-OiEa5lRhiANpv4SfwYVgQ3opYWi/QmPDC5ve21m8G9pf6ZO+aX1g2EEF1/IFaM1xPSP7mK0msTRXlPs6mIagkg==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.46.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.46.4.tgz", + "integrity": "sha512-IKL9mewGZ5UuuX4NQlwOmxPyqielvkAPUS2s1cl6yWjjQvyN3h5JTdVFGD5Jr5xMjRC8setOfGQDVgX8V+dkjg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@scratch/scratch-render": { + "version": "12.3.0", + "resolved": "https://registry.npmjs.org/@scratch/scratch-render/-/scratch-render-12.3.0.tgz", + "integrity": "sha512-KAN/Pmy4ZfYuLt/I9Rg9V80crct518YRMV8MP5nghGK6nGupx4Fl9XXKcSGZyBC3erIJbzkotsValZ1HxQR/Yw==", + "license": "AGPL-3.0-only", + "dependencies": { + "@scratch/scratch-svg-renderer": "12.3.0", + "grapheme-breaker": "0.3.2", + "hull.js": "0.2.10", + "ify-loader": "1.1.0", + "linebreak": "0.3.0", + "raw-loader": "0.5.1", + "tslog": "4.10.2", + "twgl.js": "4.24.0" + }, + "peerDependencies": { + "scratch-render-fonts": "^1.0.0" + } + }, + "node_modules/@scratch/scratch-svg-renderer": { + "version": "12.3.0", + "resolved": "https://registry.npmjs.org/@scratch/scratch-svg-renderer/-/scratch-svg-renderer-12.3.0.tgz", + "integrity": "sha512-8yxaUYzDAy4/pk8NgIM5KVuvwv+Rzfy8Fd2SQ47PhG8DQMfzW9M0JqPW9AnZMAJOfP8lEQkmSMGRSQtOARETlA==", + "license": "AGPL-3.0-only", + "dependencies": { + "base64-js": "1.5.1", + "base64-loader": "1.0.0", + "css-tree": "1.1.3", + "fastestsmallesttextencoderdecoder": "1.0.22", + "isomorphic-dompurify": "2.26.0", + "transformation-matrix": "1.15.3", + "tslog": "4.10.2" + }, + "peerDependencies": { + "scratch-render-fonts": "^1.0.0" + } + }, + "node_modules/@scratch/scratch-vm": { + "version": "12.3.0", + "resolved": "https://registry.npmjs.org/@scratch/scratch-vm/-/scratch-vm-12.3.0.tgz", + "integrity": "sha512-zOqessaWDq77u3rTz30d9OJkQV6goeRV+ZhGDMJlMuolACEMz7qbBsX6Pl+p5+MIkJlVKNAmQ4O7erzc99ZjHg==", + "license": "AGPL-3.0-only", + "dependencies": { + "@scratch/scratch-render": "12.3.0", + "@scratch/scratch-svg-renderer": "12.3.0", + "@vernier/godirect": "1.8.3", + "arraybuffer-loader": "1.0.8", + "atob": "2.1.2", + "btoa": "1.2.1", + "canvas-toBlob": "1.0.0", + "decode-html": "2.0.0", + "diff-match-patch": "1.0.5", + "format-message": "6.2.4", + "htmlparser2": "3.10.1", + "immutable": "3.8.2", + "jszip": "3.10.1", + "scratch-audio": "2.0.268", + "scratch-parser": "6.0.0", + "scratch-sb1-converter": "2.0.279", + "scratch-storage": "5.0.10", + "scratch-translate-extension-languages": "1.0.7", + "text-encoding": "0.7.0", + "tslog": "4.10.2", + "uuid": "8.3.2", + "web-worker": "1.3.0" + } + }, + "node_modules/@scratch/scratch-vm/node_modules/jszip": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", + "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", + "license": "(MIT OR GPL-3.0-or-later)", + "dependencies": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "setimmediate": "^1.0.5" + } + }, + "node_modules/@scratch/scratch-vm/node_modules/lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "license": "MIT", + "dependencies": { + "immediate": "~3.0.5" + } + }, + "node_modules/@scratch/scratch-vm/node_modules/scratch-parser": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/scratch-parser/-/scratch-parser-6.0.0.tgz", + "integrity": "sha512-LXcKxJIupqBtXSe2+SXkQxwdMWg4JCdZfoSdPYj1ZtV/UhejyUYju6ptYUrr98RsLFT5UyCmmUaev8gA1SNvhQ==", + "license": "AGPL-3.0-only", + "dependencies": { + "ajv": "^6.3.0", + "jszip": "^3.1.5", + "pify": "^4.0.1" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/@scratch/scratch-vm/node_modules/scratch-sb1-converter": { + "version": "2.0.279", + "resolved": "https://registry.npmjs.org/scratch-sb1-converter/-/scratch-sb1-converter-2.0.279.tgz", + "integrity": "sha512-C0yN1Ete4GukNBVvnRkJNW2fjV0l+N2qaTDM6Xmoo5nCvtw0GoWdKs7AB7OtKSVA1a7GDSvssArwqoP/Lp8Bww==", + "license": "AGPL-3.0-only", + "dependencies": { + "js-md5": "^0.7.3", + "minilog": "^3.1.0", + "text-encoding": "^0.7.0" + } + }, + "node_modules/@standard-schema/spec": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@turbowarp/ancient-hull.js": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/@turbowarp/ancient-hull.js/-/ancient-hull.js-0.2.13.tgz", + "integrity": "sha512-lpVDr18qRjOLWcPtw9H+nlFhY7hbdgQlLU1b6nJfEn2pMYRnOEtzFXZbprG5JgmUCIzGx/H9WPajbkjRdvUC+Q==", + "license": "BSD" + }, + "node_modules/@turbowarp/nanolog": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@turbowarp/nanolog/-/nanolog-0.2.0.tgz", + "integrity": "sha512-texcM9oxfEsADVlVDR5UhLkYclPKsV9mytJh+9pHHonNcUrxRVGF6FkJTzWO/Hl5NafU1crSdw737nqKE3atSA==", + "license": "MIT" + }, + "node_modules/@turbowarp/scratch-svg-renderer": { + "version": "1.0.202505311824", + "resolved": "https://registry.npmjs.org/@turbowarp/scratch-svg-renderer/-/scratch-svg-renderer-1.0.202505311824.tgz", + "integrity": "sha512-EaKVqIuEwrr4SzQGOVyr8GBE+DGzUbbn38qiV6DMWFzb++/HgWl1qdlKA/j+mOK+GDwYydMFP0FuWYvWBkt6sA==", + "license": "MPL-2.0", + "dependencies": { + "@turbowarp/nanolog": "^0.2.0", + "base64-js": "1.2.1", + "base64-loader": "1.0.0", + "dompurify": "^2.5.6", + "transformation-matrix": "1.15.0" + }, + "peerDependencies": { + "scratch-render-fonts": "github:TurboWarp/scratch-render-fonts#master" + } + }, + "node_modules/@turbowarp/scratch-svg-renderer/node_modules/base64-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.1.tgz", + "integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw==", + "license": "MIT" + }, + "node_modules/@turbowarp/scratch-svg-renderer/node_modules/dompurify": { + "version": "2.5.8", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.5.8.tgz", + "integrity": "sha512-o1vSNgrmYMQObbSSvF/1brBYEQPHhV1+gsmrusO7/GXtp1T9rCS8cXFqVxK/9crT1jA6Ccv+5MTSjBNqr7Sovw==", + "license": "(MPL-2.0 OR Apache-2.0)" + }, + "node_modules/@turbowarp/scratch-svg-renderer/node_modules/transformation-matrix": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/transformation-matrix/-/transformation-matrix-1.15.0.tgz", + "integrity": "sha512-808EqPQbmUD6/IMpWUXLOZcblCHf9xaiB+un0RYNNE9+6VRjoiw6Be8R32tZ0ips1PX/15tlnA2Ev4UUgg827Q==", + "license": "MIT" + }, + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" + } + }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "license": "MIT" + }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", + "license": "MIT", + "optional": true + }, + "node_modules/@vernier/godirect": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@vernier/godirect/-/godirect-1.8.3.tgz", + "integrity": "sha512-poS0LZ3jAjH36gIAI0aNBBdsGGbmt11VFbLO+eGDJ/JDSPtMu1iUStvOi0UM/ZH6Jyh34SjVd8Cnxu/Wmcb8iQ==", + "license": "BSD-3-Clause" + }, + "node_modules/@vitejs/plugin-vue": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-6.0.1.tgz", + "integrity": "sha512-+MaE752hU0wfPFJEUAIxqw18+20euHHdxVtMvbFcOEpjEyfqXH/5DCoTHiVJ0J29EhTJdoTkjEv5YBKU9dnoTw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rolldown/pluginutils": "1.0.0-beta.29" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0", + "vue": "^3.2.25" + } + }, + "node_modules/@vitest/expect": { + "version": "4.0.16", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-4.0.16.tgz", + "integrity": "sha512-eshqULT2It7McaJkQGLkPjPjNph+uevROGuIMJdG3V+0BSR2w9u6J9Lwu+E8cK5TETlfou8GRijhafIMhXsimA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.0.0", + "@types/chai": "^5.2.2", + "@vitest/spy": "4.0.16", + "@vitest/utils": "4.0.16", + "chai": "^6.2.1", + "tinyrainbow": "^3.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "4.0.16", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-4.0.16.tgz", + "integrity": "sha512-yb6k4AZxJTB+q9ycAvsoxGn+j/po0UaPgajllBgt1PzoMAAmJGYFdDk0uCcRcxb3BrME34I6u8gHZTQlkqSZpg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "4.0.16", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.21" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^6.0.0 || ^7.0.0-0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/mocker/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/@vitest/pretty-format": { + "version": "4.0.16", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-4.0.16.tgz", + "integrity": "sha512-eNCYNsSty9xJKi/UdVD8Ou16alu7AYiS2fCPRs0b1OdhJiV89buAXQLpTbe+X8V9L6qrs9CqyvU7OaAopJYPsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^3.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "4.0.16", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-4.0.16.tgz", + "integrity": "sha512-VWEDm5Wv9xEo80ctjORcTQRJ539EGPB3Pb9ApvVRAY1U/WkHXmmYISqU5E79uCwcW7xYUV38gwZD+RV755fu3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "4.0.16", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "4.0.16", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-4.0.16.tgz", + "integrity": "sha512-sf6NcrYhYBsSYefxnry+DR8n3UV4xWZwWxYbCJUt2YdvtqzSPR7VfGrY0zsv090DAbjFZsi7ZaMi1KnSRyK1XA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "4.0.16", + "magic-string": "^0.30.21", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "4.0.16", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-4.0.16.tgz", + "integrity": "sha512-4jIOWjKP0ZUaEmJm00E0cOBLU+5WE0BpeNr3XN6TEF05ltro6NJqHWxXD0kA8/Zc8Nh23AT8WQxwNG+WeROupw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "4.0.16", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-4.0.16.tgz", + "integrity": "sha512-h8z9yYhV3e1LEfaQ3zdypIrnAg/9hguReGZoS7Gl0aBG5xgA410zBqECqmaF/+RkTggRsfnzc1XaAHA6bmUufA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "4.0.16", + "tinyrainbow": "^3.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.5.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.21.tgz", + "integrity": "sha512-8i+LZ0vf6ZgII5Z9XmUvrCyEzocvWT+TeR2VBUVlzIH6Tyv57E20mPZ1bCS+tbejgUgmjrEh7q/0F0bibskAmw==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.28.3", + "@vue/shared": "3.5.21", + "entities": "^4.5.0", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.1" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.21.tgz", + "integrity": "sha512-jNtbu/u97wiyEBJlJ9kmdw7tAr5Vy0Aj5CgQmo+6pxWNQhXZDPsRr1UWPN4v3Zf82s2H3kF51IbzZ4jMWAgPlQ==", + "license": "MIT", + "dependencies": { + "@vue/compiler-core": "3.5.21", + "@vue/shared": "3.5.21" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.5.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.21.tgz", + "integrity": "sha512-SXlyk6I5eUGBd2v8Ie7tF6ADHE9kCR6mBEuPyH1nUZ0h6Xx6nZI29i12sJKQmzbDyr2tUHMhhTt51Z6blbkTTQ==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.28.3", + "@vue/compiler-core": "3.5.21", + "@vue/compiler-dom": "3.5.21", + "@vue/compiler-ssr": "3.5.21", + "@vue/shared": "3.5.21", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.18", + "postcss": "^8.5.6", + "source-map-js": "^1.2.1" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.5.21", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.21.tgz", + "integrity": "sha512-vKQ5olH5edFZdf5ZrlEgSO1j1DMA4u23TVK5XR1uMhvwnYvVdDF0nHXJUblL/GvzlShQbjhZZ2uvYmDlAbgo9w==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.21", + "@vue/shared": "3.5.21" + } + }, + "node_modules/@vue/devtools-api": { + "version": "6.6.4", + "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.6.4.tgz", + "integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==", + "license": "MIT" + }, + "node_modules/@vue/reactivity": { + "version": "3.5.21", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.21.tgz", + "integrity": "sha512-3ah7sa+Cwr9iiYEERt9JfZKPw4A2UlbY8RbbnH2mGCE8NwHkhmlZt2VsH0oDA3P08X3jJd29ohBDtX+TbD9AsA==", + "license": "MIT", + "dependencies": { + "@vue/shared": "3.5.21" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.5.21", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.5.21.tgz", + "integrity": "sha512-+DplQlRS4MXfIf9gfD1BOJpk5RSyGgGXD/R+cumhe8jdjUcq/qlxDawQlSI8hCKupBlvM+3eS1se5xW+SuNAwA==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.21", + "@vue/shared": "3.5.21" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.5.21", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.5.21.tgz", + "integrity": "sha512-3M2DZsOFwM5qI15wrMmNF5RJe1+ARijt2HM3TbzBbPSuBHOQpoidE+Pa+XEaVN+czbHf81ETRoG1ltztP2em8w==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.21", + "@vue/runtime-core": "3.5.21", + "@vue/shared": "3.5.21", + "csstype": "^3.1.3" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.5.21", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.5.21.tgz", + "integrity": "sha512-qr8AqgD3DJPJcGvLcJKQo2tAc8OnXRcfxhOJCPF+fcfn5bBGz7VCcO7t+qETOPxpWK1mgysXvVT/j+xWaHeMWA==", + "license": "MIT", + "dependencies": { + "@vue/compiler-ssr": "3.5.21", + "@vue/shared": "3.5.21" + }, + "peerDependencies": { + "vue": "3.5.21" + } + }, + "node_modules/@vue/shared": { + "version": "3.5.21", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.21.tgz", + "integrity": "sha512-+2k1EQpnYuVuu3N7atWyG3/xoFWIVJZq4Mz8XNOdScFI0etES75fbny/oU4lKWk/577P1zmg0ioYvpGEDZ3DLw==", + "license": "MIT" + }, + "node_modules/@webassemblyjs/ast": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz", + "integrity": "sha512-C6wW5L+b7ogSDVqymbkkvuW9kruN//YisMED04xzeBBqjHa2FYnmvOlS6Xj68xWQRgWvI9cIglsjFowH/RJyEA==", + "license": "MIT", + "dependencies": { + "@webassemblyjs/helper-module-context": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/wast-parser": "1.9.0" + } + }, + "node_modules/@webassemblyjs/floating-point-hex-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.9.0.tgz", + "integrity": "sha512-TG5qcFsS8QB4g4MhrxK5TqfdNe7Ey/7YL/xN+36rRjl/BlGE/NcBvJcqsRgCP6Z92mRE+7N50pRIi8SmKUbcQA==", + "license": "MIT" + }, + "node_modules/@webassemblyjs/helper-api-error": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.9.0.tgz", + "integrity": "sha512-NcMLjoFMXpsASZFxJ5h2HZRcEhDkvnNFOAKneP5RbKRzaWJN36NC4jqQHKwStIhGXu5mUWlUUk7ygdtrO8lbmw==", + "license": "MIT" + }, + "node_modules/@webassemblyjs/helper-buffer": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.9.0.tgz", + "integrity": "sha512-qZol43oqhq6yBPx7YM3m9Bv7WMV9Eevj6kMi6InKOuZxhw+q9hOkvq5e/PpKSiLfyetpaBnogSbNCfBwyB00CA==", + "license": "MIT" + }, + "node_modules/@webassemblyjs/helper-code-frame": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.9.0.tgz", + "integrity": "sha512-ERCYdJBkD9Vu4vtjUYe8LZruWuNIToYq/ME22igL+2vj2dQ2OOujIZr3MEFvfEaqKoVqpsFKAGsRdBSBjrIvZA==", + "license": "MIT", + "dependencies": { + "@webassemblyjs/wast-printer": "1.9.0" + } + }, + "node_modules/@webassemblyjs/helper-fsm": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.9.0.tgz", + "integrity": "sha512-OPRowhGbshCb5PxJ8LocpdX9Kl0uB4XsAjl6jH/dWKlk/mzsANvhwbiULsaiqT5GZGT9qinTICdj6PLuM5gslw==", + "license": "ISC" + }, + "node_modules/@webassemblyjs/helper-module-context": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.9.0.tgz", + "integrity": "sha512-MJCW8iGC08tMk2enck1aPW+BE5Cw8/7ph/VGZxwyvGbJwjktKkDK7vy7gAmMDx88D7mhDTCNKAW5tED+gZ0W8g==", + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.9.0" + } + }, + "node_modules/@webassemblyjs/helper-wasm-bytecode": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.9.0.tgz", + "integrity": "sha512-R7FStIzyNcd7xKxCZH5lE0Bqy+hGTwS3LJjuv1ZVxd9O7eHCedSdrId/hMOd20I+v8wDXEn+bjfKDLzTepoaUw==", + "license": "MIT" + }, + "node_modules/@webassemblyjs/helper-wasm-section": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.9.0.tgz", + "integrity": "sha512-XnMB8l3ek4tvrKUUku+IVaXNHz2YsJyOOmz+MMkZvh8h1uSJpSen6vYnw3IoQ7WwEuAhL8Efjms1ZWjqh2agvw==", + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0" + } + }, + "node_modules/@webassemblyjs/ieee754": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.9.0.tgz", + "integrity": "sha512-dcX8JuYU/gvymzIHc9DgxTzUUTLexWwt8uCTWP3otys596io0L5aW02Gb1RjYpx2+0Jus1h4ZFqjla7umFniTg==", + "license": "MIT", + "dependencies": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "node_modules/@webassemblyjs/leb128": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.9.0.tgz", + "integrity": "sha512-ENVzM5VwV1ojs9jam6vPys97B/S65YQtv/aanqnU7D8aSoHFX8GyhGg0CMfyKNIHBuAVjy3tlzd5QMMINa7wpw==", + "license": "MIT", + "dependencies": { + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/utf8": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.9.0.tgz", + "integrity": "sha512-GZbQlWtopBTP0u7cHrEx+73yZKrQoBMpwkGEIqlacljhXCkVM1kMQge/Mf+csMJAjEdSwhOyLAS0AoR3AG5P8w==", + "license": "MIT" + }, + "node_modules/@webassemblyjs/wasm-edit": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.9.0.tgz", + "integrity": "sha512-FgHzBm80uwz5M8WKnMTn6j/sVbqilPdQXTWraSjBwFXSYGirpkSWE2R9Qvz9tNiTKQvoKILpCuTjBKzOIm0nxw==", + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/helper-wasm-section": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0", + "@webassemblyjs/wasm-opt": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0", + "@webassemblyjs/wast-printer": "1.9.0" + } + }, + "node_modules/@webassemblyjs/wasm-gen": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.9.0.tgz", + "integrity": "sha512-cPE3o44YzOOHvlsb4+E9qSqjc9Qf9Na1OO/BHFy4OI91XDE14MjFN4lTMezzaIWdPqHnsTodGGNP+iRSYfGkjA==", + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/ieee754": "1.9.0", + "@webassemblyjs/leb128": "1.9.0", + "@webassemblyjs/utf8": "1.9.0" + } + }, + "node_modules/@webassemblyjs/wasm-opt": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.9.0.tgz", + "integrity": "sha512-Qkjgm6Anhm+OMbIL0iokO7meajkzQD71ioelnfPEj6r4eOFuqm4YC3VBPqXjFyyNwowzbMD+hizmprP/Fwkl2A==", + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0" + } + }, + "node_modules/@webassemblyjs/wasm-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.9.0.tgz", + "integrity": "sha512-9+wkMowR2AmdSWQzsPEjFU7njh8HTO5MqO8vjwEHuM+AMHioNqSBONRdr0NQQ3dVQrzp0s8lTcYqzUdb7YgELA==", + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-api-error": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/ieee754": "1.9.0", + "@webassemblyjs/leb128": "1.9.0", + "@webassemblyjs/utf8": "1.9.0" + } + }, + "node_modules/@webassemblyjs/wast-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.9.0.tgz", + "integrity": "sha512-qsqSAP3QQ3LyZjNC/0jBJ/ToSxfYJ8kYyuiGvtn/8MK89VrNEfwj7BPQzJVHi0jGTRK2dGdJ5PRqhtjzoww+bw==", + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/floating-point-hex-parser": "1.9.0", + "@webassemblyjs/helper-api-error": "1.9.0", + "@webassemblyjs/helper-code-frame": "1.9.0", + "@webassemblyjs/helper-fsm": "1.9.0", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/wast-printer": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.9.0.tgz", + "integrity": "sha512-2J0nE95rHXHyQ24cWjMKJ1tqB/ds8z/cyeOZxJhcb+rW+SQASVjuznUSmdz5GpVJTzU8JkhYut0D3siFDD6wsA==", + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/wast-parser": "1.9.0", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "license": "BSD-3-Clause" + }, + "node_modules/@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "license": "Apache-2.0" + }, + "node_modules/acorn": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", + "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/ajv": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.3.0.tgz", + "integrity": "sha512-6TQywaGYtRub2fqHkSXfVANlhfja2nbF33wCCHnt3aQstOrtd9jsQGiRUTIOlkEqcxpzRd2akfnqvBBPmLxs8g==", + "license": "MIT", + "peer": true, + "dependencies": { + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, + "node_modules/ajv-errors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", + "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", + "license": "MIT", + "peerDependencies": { + "ajv": ">=5.0.0" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "license": "ISC", + "optional": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/anymatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "license": "ISC" + }, + "node_modules/arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arraybuffer-loader": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/arraybuffer-loader/-/arraybuffer-loader-1.0.8.tgz", + "integrity": "sha512-CwUVCcxCgcgZUu2w741OV6Xj1tvRVQebq22RCyGXiLgJOJ4e4M/59EPYdtK2MLfIN28t1TDvuh2ojstNq3Kh5g==", + "license": "MIT", + "dependencies": { + "loader-utils": "^1.1.0" + }, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "license": "MIT", + "dependencies": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "node_modules/asn1.js/node_modules/bn.js": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", + "license": "MIT" + }, + "node_modules/assert": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-2.1.0.tgz", + "integrity": "sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "is-nan": "^1.3.2", + "object-is": "^1.1.5", + "object.assign": "^4.1.4", + "util": "^0.12.5" + } + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/async-each": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.6.tgz", + "integrity": "sha512-c646jH1avxr+aVpndVMeAfYw7wAa6idufrlN3LPA4PmKS0QEGp6PIC9nwz0WQkkvBGAMEki3pFdtxaF39J9vvg==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "license": "MIT", + "optional": true + }, + "node_modules/atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "license": "(MIT OR Apache-2.0)", + "bin": { + "atob": "bin/atob.js" + }, + "engines": { + "node": ">= 4.5.0" + } + }, + "node_modules/audio-context": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/audio-context/-/audio-context-1.0.3.tgz", + "integrity": "sha512-RH3/rM74f2ITlohhjgC7oYZVS97wtv/SEjXLCzEinnrIPIDxc39m2aFc6wmdkM0NYRKo1DMleYPMAIbnTRW0eA==", + "deprecated": "Depends on Web-Audio-API implementation. Use either web-audio-api, web-audio-js or web-audio-engine package.", + "license": "MIT" + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "license": "MIT" + }, + "node_modules/base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "license": "MIT", + "dependencies": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", + "license": "MIT", + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/base64-loader": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/base64-loader/-/base64-loader-1.0.0.tgz", + "integrity": "sha512-p32+F8dg+ANGx7s8QsZS74ZPHfIycmC2yZcoerzFgbersIYWitPbbF39G6SBx3gyvzyLH5nt1ooocxr0IHuWKA==", + "license": "MIT" + }, + "node_modules/big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/binaryen": { + "version": "123.0.0", + "resolved": "git+ssh://git@github.com/pufferfish101007/binaryen.js.git#b215a5522db739dfc033114133b581d5f8015d25", + "license": "Apache-2.0", + "bin": { + "wasm-as": "bin/wasm-as", + "wasm-ctor-eval": "bin/wasm-ctor-eval", + "wasm-dis": "bin/wasm-dis", + "wasm-merge": "bin/wasm-merge", + "wasm-metadce": "bin/wasm-metadce", + "wasm-opt": "bin/wasm-opt", + "wasm-reduce": "bin/wasm-reduce", + "wasm-shell": "bin/wasm-shell", + "wasm2js": "bin/wasm2js" + } + }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "node_modules/bl": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz", + "integrity": "sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==", + "license": "MIT", + "dependencies": { + "readable-stream": "^2.3.5", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "license": "MIT" + }, + "node_modules/bn.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.2.tgz", + "integrity": "sha512-v2YAxEmKaBLahNwE1mjp4WON6huMNeuDvagFZW+ASCuA/ku0bXR9hSMw0XpiqMoA3+rmnyck/tPRSFQkoC9Cuw==", + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "license": "MIT", + "dependencies": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/braces/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "license": "MIT", + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/braces/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/brfs": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/brfs/-/brfs-1.6.1.tgz", + "integrity": "sha512-OfZpABRQQf+Xsmju8XE9bDjs+uU4vLREGolP7bDgcpsI17QREyZ4Bl+2KLxxx1kCgA0fAIhKQBaBYh+PEcCqYQ==", + "license": "MIT", + "dependencies": { + "quote-stream": "^1.0.1", + "resolve": "^1.1.5", + "static-module": "^2.2.0", + "through2": "^2.0.0" + }, + "bin": { + "brfs": "bin/cmd.js" + } + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", + "license": "MIT" + }, + "node_modules/browser-resolve": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-2.0.0.tgz", + "integrity": "sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve": "^1.17.0" + } + }, + "node_modules/browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "license": "MIT", + "dependencies": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "license": "MIT", + "dependencies": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "node_modules/browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "license": "MIT", + "dependencies": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/browserify-rsa": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.1.tgz", + "integrity": "sha512-YBjSAiTqM04ZVei6sXighu679a3SqWORA3qZTEqZImnlkDIFtKc6pNutpjyZ8RJTjQtuYfeetkxM11GwoYXMIQ==", + "license": "MIT", + "dependencies": { + "bn.js": "^5.2.1", + "randombytes": "^2.1.0", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/browserify-rsa/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/browserify-sign": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.3.tgz", + "integrity": "sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw==", + "license": "ISC", + "dependencies": { + "bn.js": "^5.2.1", + "browserify-rsa": "^4.1.0", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.5", + "hash-base": "~3.0", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.7", + "readable-stream": "^2.3.8", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/browserify-sign/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "license": "MIT", + "dependencies": { + "pako": "~1.0.5" + } + }, + "node_modules/btoa": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/btoa/-/btoa-1.2.1.tgz", + "integrity": "sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g==", + "license": "(MIT OR Apache-2.0)", + "bin": { + "btoa": "bin/btoa.js" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-equal": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-0.0.1.tgz", + "integrity": "sha512-RgSV6InVQ9ODPdLWJ5UAqBqJBOg370Nz6ZQtRzpt6nUjc8v0St97uJ4PYC6NztqIScrAXafKM3mZPMygSe1ggA==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "license": "MIT" + }, + "node_modules/buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", + "license": "MIT" + }, + "node_modules/builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==", + "license": "MIT" + }, + "node_modules/cacache": { + "version": "12.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", + "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", + "license": "ISC", + "dependencies": { + "bluebird": "^3.5.5", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.4", + "graceful-fs": "^4.1.15", + "infer-owner": "^1.0.3", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.3", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", + "y18n": "^4.0.0" + } + }, + "node_modules/cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "license": "MIT", + "dependencies": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/canvas-toBlob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/canvas-toBlob/-/canvas-toBlob-1.0.0.tgz", + "integrity": "sha512-oU5bawygt/Nef9F+C49eTFmzXzz6yKdGqn6J1wn/LZQF5ulnnZVm0KIZzik85I6tjCbZFH6aa47j4bU2tkHxRw==", + "license": "MIT" + }, + "node_modules/chai": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.1.tgz", + "integrity": "sha512-p4Z49OGG5W/WBCPSS/dH3jQ73kD6tiMmUM+bckNK6Jr5JHMG3k9bg/BvKR8lKmtVBKmOiuVaV2ws8s9oSbwysg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "license": "MIT", + "optional": true, + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chokidar/node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", + "optional": true, + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chokidar/node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", + "optional": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chokidar/node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/chokidar/node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "license": "ISC" + }, + "node_modules/chrome-trace-event": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", + "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==", + "license": "MIT", + "engines": { + "node": ">=6.0" + } + }, + "node_modules/cipher-base": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.6.tgz", + "integrity": "sha512-3Ek9H3X6pj5TgenXYtNWdaBon1tgYCaebd+XPg0keyjEbEfkD4KkmAxkQ/i1vYvxdcT5nscLBfq9VJRmCBcFSw==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.4", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/cipher-base/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "license": "MIT", + "dependencies": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "license": "MIT", + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/is-descriptor": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "license": "MIT", + "dependencies": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw==", + "license": "MIT", + "dependencies": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/colors": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", + "integrity": "sha512-OsSVtHK8Ir8r3+Fxw/b4jS1ZLPXkV6ZxDRJQzeD7qo0SqMXWrHDM71DgYzPMHY8SFJ0Ao+nNU2p1MmwdzKqPrw==", + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/commander": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.1.0.tgz", + "integrity": "sha512-J2wnb6TKniXNOtoHS8TSrG9IOQluPrsmyAJ8oCUJOBmv+uLBCyPYAZkD2jFvw2DCzIXNnISIM01NIvr35TkBMQ==", + "engines": { + "node": ">= 0.6.x" + } + }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "license": "MIT" + }, + "node_modules/component-emitter": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz", + "integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "license": "MIT" + }, + "node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "engines": [ + "node >= 0.8" + ], + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/console-browserify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", + "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==" + }, + "node_modules/constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ==", + "license": "MIT" + }, + "node_modules/copy-concurrently": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", + "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "dependencies": { + "aproba": "^1.1.1", + "fs-write-stream-atomic": "^1.0.8", + "iferr": "^0.1.5", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.0" + } + }, + "node_modules/copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/core-js": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.3.0.tgz", + "integrity": "sha512-N41UFUZNqoTSGUSyL7kiStAkH31Hxq197A4Gp9MxTZfAd52pXod7VM7kWiRP0J0YpQDeaE4SLsb+2OGgtgvUEw==", + "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", + "license": "MIT" + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "license": "MIT" + }, + "node_modules/create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "license": "MIT", + "dependencies": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + } + }, + "node_modules/create-ecdh/node_modules/bn.js": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", + "license": "MIT" + }, + "node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "license": "MIT", + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "node_modules/create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "license": "MIT", + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-fetch": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.1.0.tgz", + "integrity": "sha512-uKm5PU+MHTootlWEY+mZ4vvXoCn4fLQxT9dSc1sXVMSFkINTJVN8cAQROpwcKm8bJ/c7rgZVIBWzH5T78sNZZw==", + "license": "MIT", + "dependencies": { + "node-fetch": "^2.7.0" + } + }, + "node_modules/crypto-browserify": { + "version": "3.12.1", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.1.tgz", + "integrity": "sha512-r4ESw/IlusD17lgQi1O20Fa3qNnsckR126TdUuBgAu7GBYSIPvdNyONd3Zrxh0xCwA4+6w/TDArBPsMvhur+KQ==", + "license": "MIT", + "dependencies": { + "browserify-cipher": "^1.0.1", + "browserify-sign": "^4.2.3", + "create-ecdh": "^4.0.4", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "diffie-hellman": "^5.0.3", + "hash-base": "~3.0.4", + "inherits": "^2.0.4", + "pbkdf2": "^3.1.2", + "public-encrypt": "^4.0.3", + "randombytes": "^2.1.0", + "randomfill": "^1.0.4" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/css-tree": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", + "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", + "license": "MIT", + "dependencies": { + "mdn-data": "2.0.14", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/cssstyle": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.6.0.tgz", + "integrity": "sha512-2z+rWdzbbSZv6/rhtvzvqeZQHrBaqgogqt85sqFNbabZOuFbCVFb8kPeEtZjiKkbrm395irpNKiYeFeLiQnFPg==", + "license": "MIT", + "dependencies": { + "@asamuzakjp/css-color": "^3.2.0", + "rrweb-cssom": "^0.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "license": "MIT" + }, + "node_modules/cyclist": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.2.tgz", + "integrity": "sha512-0sVXIohTfLqVIW3kb/0n6IiWF3Ifj5nm2XaSrLq2DI6fKIGa2fYAZdk917rUneaeLVpYfFcyXE2ft0fe3remsA==", + "license": "MIT" + }, + "node_modules/data-urls": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", + "license": "MIT", + "dependencies": { + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decimal.js": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz", + "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", + "license": "MIT" + }, + "node_modules/decode-html": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/decode-html/-/decode-html-2.0.0.tgz", + "integrity": "sha512-lVJ+EBozhAXA2nSQG+xAgcD0P5K3uejnIIvM09uoQfS8AALkQ+HhHcEUvKovXi0EIpIZWjm0y8X7ULjaJpgY9w==", + "license": "MIT" + }, + "node_modules/decode-uri-component": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", + "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", + "license": "MIT", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "license": "MIT" + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "license": "MIT", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "license": "MIT", + "dependencies": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/des.js": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz", + "integrity": "sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "node_modules/diff-match-patch": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/diff-match-patch/-/diff-match-patch-1.0.5.tgz", + "integrity": "sha512-IayShXAgj/QMXgB0IWmKx+rOPuGMhqm5w6jvFxmVenXKIzRqTAAsbBPT3kWQeGANj3jGgvcvv4yK6SxqYmikgw==", + "license": "Apache-2.0" + }, + "node_modules/diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "license": "MIT", + "dependencies": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "node_modules/diffie-hellman/node_modules/bn.js": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", + "license": "MIT" + }, + "node_modules/dom-serializer": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", + "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", + "license": "MIT", + "dependencies": { + "domelementtype": "^2.0.1", + "entities": "^2.0.0" + } + }, + "node_modules/dom-serializer/node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "license": "BSD-2-Clause" + }, + "node_modules/dom-serializer/node_modules/entities": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", + "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", + "license": "BSD-2-Clause", + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/domain-browser": { + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-4.22.0.tgz", + "integrity": "sha512-IGBwjF7tNk3cwypFNH/7bfzBcgSCbaMOD3GsaY1AU/JRrnHnYgEM0+9kQt52iZxjNsjBtJYtao146V+f8jFZNw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://bevry.me/fund" + } + }, + "node_modules/domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==", + "license": "BSD-2-Clause" + }, + "node_modules/domhandler": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", + "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", + "license": "BSD-2-Clause", + "dependencies": { + "domelementtype": "1" + } + }, + "node_modules/dompurify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.3.1.tgz", + "integrity": "sha512-qkdCKzLNtrgPFP1Vo+98FRzJnBRGe4ffyCea9IwHB1fyxPOeNTHpLKYGd4Uk9xvNoH0ZoOjwZxNptyMwqrId1Q==", + "license": "(MPL-2.0 OR Apache-2.0)", + "optionalDependencies": { + "@types/trusted-types": "^2.0.7" + } + }, + "node_modules/domutils": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", + "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", + "license": "BSD-2-Clause", + "dependencies": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/duplexer2": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==", + "license": "BSD-3-Clause", + "dependencies": { + "readable-stream": "^2.0.2" + } + }, + "node_modules/duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "node_modules/elliptic": { + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz", + "integrity": "sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==", + "license": "MIT", + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", + "license": "MIT" + }, + "node_modules/emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/end-of-stream/node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/enhanced-resolve": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz", + "integrity": "sha512-Nv9m36S/vxpsI+Hc4/ZGRs0n9mXqSWGGq49zxb/cJfPAQMbUtttJAlNPS4AQzaBdw/pKskw5bMbekT/Y7W/Wlg==", + "dependencies": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.5.0", + "tapable": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/enhanced-resolve/node_modules/memory-fs": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", + "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", + "license": "MIT", + "dependencies": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + }, + "engines": { + "node": ">=4.3.0 <5.0.0 || >=5.10" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/errno": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", + "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "license": "MIT", + "dependencies": { + "prr": "~1.0.1" + }, + "bin": { + "errno": "cli.js" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-module-lexer": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", + "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", + "dev": true, + "license": "MIT" + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es6-promise": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.0.2.tgz", + "integrity": "sha512-CUD62/uqeE0L+EJeypOKuFfM56CFaH4vo+++J76bff0NkeQ2bBmWVCTNxL2hj9HeCYPkof6Gqea0BSeK17gBzA==", + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.2.tgz", + "integrity": "sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==", + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.2", + "@esbuild/android-arm": "0.27.2", + "@esbuild/android-arm64": "0.27.2", + "@esbuild/android-x64": "0.27.2", + "@esbuild/darwin-arm64": "0.27.2", + "@esbuild/darwin-x64": "0.27.2", + "@esbuild/freebsd-arm64": "0.27.2", + "@esbuild/freebsd-x64": "0.27.2", + "@esbuild/linux-arm": "0.27.2", + "@esbuild/linux-arm64": "0.27.2", + "@esbuild/linux-ia32": "0.27.2", + "@esbuild/linux-loong64": "0.27.2", + "@esbuild/linux-mips64el": "0.27.2", + "@esbuild/linux-ppc64": "0.27.2", + "@esbuild/linux-riscv64": "0.27.2", + "@esbuild/linux-s390x": "0.27.2", + "@esbuild/linux-x64": "0.27.2", + "@esbuild/netbsd-arm64": "0.27.2", + "@esbuild/netbsd-x64": "0.27.2", + "@esbuild/openbsd-arm64": "0.27.2", + "@esbuild/openbsd-x64": "0.27.2", + "@esbuild/openharmony-arm64": "0.27.2", + "@esbuild/sunos-x64": "0.27.2", + "@esbuild/win32-arm64": "0.27.2", + "@esbuild/win32-ia32": "0.27.2", + "@esbuild/win32-x64": "0.27.2" + } + }, + "node_modules/escodegen": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.9.1.tgz", + "integrity": "sha512-6hTjO1NAWkHnDk3OqQ4YrCuwwmGHL9S3nPlzBOUG/R44rda3wLNrfvQ5fkSGjyhHFKM7ALPKcKGrwvCLe0lC7Q==", + "license": "BSD-2-Clause", + "dependencies": { + "esprima": "^3.1.3", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=4.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/esprima": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha512-AWwVMNxwhN8+NIPQzAQZCm7RkLC4RbM3B1OobMuyp3i+w73X57KCKaVIxaRZb+DYCojq7rspo+fmuQfAboyhFg==", + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT" + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "license": "MIT", + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "license": "MIT", + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==", + "license": "MIT", + "dependencies": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/expand-brackets/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "license": "MIT", + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "license": "MIT", + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/is-descriptor": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "license": "MIT", + "dependencies": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/expand-brackets/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/expect-type": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz", + "integrity": "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", + "license": "MIT", + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "license": "MIT", + "dependencies": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", + "license": "MIT", + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "license": "MIT", + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/falafel": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/falafel/-/falafel-2.2.5.tgz", + "integrity": "sha512-HuC1qF9iTnHDnML9YZAdCDQwT0yKl/U55K4XSUXqGAA2GLoafFgWRqdAbhWJxXaYD4pyoVxAJ8wH670jMpI9DQ==", + "license": "MIT", + "dependencies": { + "acorn": "^7.1.1", + "isarray": "^2.0.1" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/falafel/node_modules/acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/falafel/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "license": "MIT" + }, + "node_modules/fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha512-fueX787WZKCV0Is4/T2cyAdM4+x1S3MXXOAhavE1ys/W42SHAPacLTQhucja22QBYrfGw50M2sRiXPtTGv9Ymw==", + "license": "MIT" + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "license": "MIT" + }, + "node_modules/fastestsmallesttextencoderdecoder": { + "version": "1.0.22", + "resolved": "https://registry.npmjs.org/fastestsmallesttextencoderdecoder/-/fastestsmallesttextencoderdecoder-1.0.22.tgz", + "integrity": "sha512-Pb8d48e+oIuY4MaM64Cd7OW1gt4nxCHs7/ddPPZ/Ic3sg8yVGM7O9wDvZ7us6ScaUupzM+pfBolwtYhN1IxBIw==", + "license": "CC0-1.0" + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/figgy-pudding": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", + "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", + "deprecated": "This module is no longer supported.", + "license": "ISC" + }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "license": "MIT", + "optional": true + }, + "node_modules/fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==", + "license": "MIT", + "dependencies": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fill-range/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "license": "MIT", + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fill-range/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "license": "MIT", + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/find-cache-dir/node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "license": "MIT", + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/find-cache-dir/node_modules/locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "license": "MIT", + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/find-cache-dir/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-cache-dir/node_modules/p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "license": "MIT", + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/find-cache-dir/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/find-cache-dir/node_modules/pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "license": "MIT", + "dependencies": { + "find-up": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/findup": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/findup/-/findup-0.1.5.tgz", + "integrity": "sha512-Udxo3C9A6alt2GZ2MNsgnIvX7De0V3VGxeP/x98NSVgSlizcDHdmJza61LI7zJy4OEtSiJyE72s0/+tBl5/ZxA==", + "dependencies": { + "colors": "~0.6.0-1", + "commander": "~2.1.0" + }, + "bin": { + "findup": "bin/findup.js" + }, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/flush-write-stream": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" + } + }, + "node_modules/for-each": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/format-message": { + "version": "6.2.4", + "resolved": "https://registry.npmjs.org/format-message/-/format-message-6.2.4.tgz", + "integrity": "sha512-/24zYeSRy2ZlEO2OIctm7jOHvMpoWf+uhqFCaqqyZKi1C229zAAy2E5vF4lSSaMH0a2kewPrOzq6xN4Yy7cQrw==", + "license": "MIT", + "dependencies": { + "format-message-formats": "^6.2.4", + "format-message-interpret": "^6.2.4", + "format-message-parse": "^6.2.4", + "lookup-closest-locale": "^6.2.0" + } + }, + "node_modules/format-message-formats": { + "version": "6.2.4", + "resolved": "https://registry.npmjs.org/format-message-formats/-/format-message-formats-6.2.4.tgz", + "integrity": "sha512-smT/fAqBLqusWfWCKRAx6QBDAAbmYznWsIyTyk66COmvwt2Byiqd7SJe2ma9a5oV0kwRaOJpN/F4lr4YK/n6qQ==", + "license": "MIT" + }, + "node_modules/format-message-interpret": { + "version": "6.2.4", + "resolved": "https://registry.npmjs.org/format-message-interpret/-/format-message-interpret-6.2.4.tgz", + "integrity": "sha512-dRvz9mXhITApyOtfuFEb/XqvCe1u6RMkQW49UJHXS8w2S8cAHCqq5LNDFK+QK6XVzcofROycLb/k1uybTAKt2w==", + "license": "MIT", + "dependencies": { + "format-message-formats": "^6.2.4", + "lookup-closest-locale": "^6.2.0" + } + }, + "node_modules/format-message-parse": { + "version": "6.2.4", + "resolved": "https://registry.npmjs.org/format-message-parse/-/format-message-parse-6.2.4.tgz", + "integrity": "sha512-k7WqXkEzgXkW4wkHdS6Cv2Ou0rIFtiDelZjgoe1saW4p7FT7zS8OeAUpAekhormqzpeecR97e4vBft1zMsfFOQ==", + "license": "MIT" + }, + "node_modules/fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA==", + "license": "MIT", + "dependencies": { + "map-cache": "^0.2.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, + "node_modules/from2-array": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/from2-array/-/from2-array-0.0.4.tgz", + "integrity": "sha512-0G0cAp7sYLobH7ALsr835x98PU/YeVF7wlwxdWbCUaea7wsa7lJfKZUAo6p2YZGZ8F94luCuqHZS3JtFER6uPg==", + "license": "MIT", + "dependencies": { + "from2": "^2.0.3" + } + }, + "node_modules/fs-write-stream-atomic": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", + "integrity": "sha512-gehEzmPn2nAwr39eay+x3X34Ra+M2QlVUTLhkXPjWdeO8RF9kszk116avgBJM3ZyNHgHXBNx+VmPaFC36k0PzA==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "dependencies": { + "graceful-fs": "^4.1.2", + "iferr": "^0.1.5", + "imurmurhash": "^0.1.4", + "readable-stream": "1 || 2" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "license": "ISC", + "optional": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" + }, + "node_modules/grapheme-breaker": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/grapheme-breaker/-/grapheme-breaker-0.3.2.tgz", + "integrity": "sha512-mB6rwkw1Z7z4z2RkFFTd/+q6Ug1gnCgjKAervAKgBeNI1mSr8E5EUWoYzFNOZsLHFArLfpk+O8X8qXC7uvuawQ==", + "license": "MIT", + "dependencies": { + "brfs": "^1.2.0", + "unicode-trie": "^0.3.1" + } + }, + "node_modules/has": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", + "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw==", + "license": "MIT", + "dependencies": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==", + "license": "MIT", + "dependencies": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values/node_modules/kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw==", + "license": "MIT", + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/hash-base": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.5.tgz", + "integrity": "sha512-vXm0l45VbcHEVlTCzs8M+s0VeYsB2lnlAaThoLKGXr3bE/VWDOelNUnycUPEhKEaXARL2TEFjBOyUiM6+55KBg==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.4", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/hash-base/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "license": "MIT", + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/html-encoding-sniffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", + "license": "MIT", + "dependencies": { + "whatwg-encoding": "^3.1.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/htmlparser2": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", + "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", + "license": "MIT", + "dependencies": { + "domelementtype": "^1.3.1", + "domhandler": "^2.3.0", + "domutils": "^1.5.1", + "entities": "^1.1.1", + "inherits": "^2.0.1", + "readable-stream": "^3.1.1" + } + }, + "node_modules/htmlparser2/node_modules/entities": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", + "license": "BSD-2-Clause" + }, + "node_modules/htmlparser2/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==", + "license": "MIT" + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/hull.js": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/hull.js/-/hull.js-0.2.10.tgz", + "integrity": "sha512-UO3W30HxhWgeSpNKCdXt00xkwjRTGmhQaoZNP8ll509Nl+DP9juXE3wRGizihuop08FSB4xtAWIbWSe+RxEoog==", + "deprecated": "This package is unmaintained and vulnerable. Do not use it.", + "license": "BSD" + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/iferr": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", + "integrity": "sha512-DUNFN5j7Tln0D+TxzloUjKB+CtVu6myn0JEFak6dG18mNt9YkQ6lzGCdafwofISZ1lLF3xRHJ98VKy9ynkcFaA==", + "license": "MIT" + }, + "node_modules/ify-loader": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ify-loader/-/ify-loader-1.1.0.tgz", + "integrity": "sha512-EiyC45FRIs+z4g98+jBzuYCfoM6TKG9p7Ek5YZUeM7rucNucaMZIseRj/5Q3I4ypkZXyC2wnU1RcYrVmshe2xw==", + "license": "MIT", + "dependencies": { + "bl": "^1.0.0", + "findup": "^0.1.5", + "from2-array": "0.0.4", + "map-limit": "0.0.1", + "multipipe": "^0.3.0", + "read-package-json": "^2.0.2", + "resolve": "^1.1.6" + } + }, + "node_modules/immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==", + "license": "MIT" + }, + "node_modules/immutable": { + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-3.8.2.tgz", + "integrity": "sha512-15gZoQ38eYjEjxkorfbcgBKBL6R7T459OuK+CpcWt7O3KF4uPCx2tD0uFETlUDIyo+1789crbMhTvQBSR5yBMg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "license": "ISC" + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/is-accessor-descriptor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.1.tgz", + "integrity": "sha512-YBUanLI8Yoihw923YeFUS5fs0fF2f5TSFTNiYAAzhhDscDa3lEqYuz1pDOEP5KvX94I9ey3vsqjJcLVFVU+3QA==", + "license": "MIT", + "dependencies": { + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-arguments": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.2.0.tgz", + "integrity": "sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "license": "MIT", + "optional": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "license": "MIT" + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-descriptor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.1.tgz", + "integrity": "sha512-bc4NlCDiCr28U4aEsQ3Qs2491gVq4V8G7MQyws968ImqjKuYtTJXrl7Vq7jsN7Ly/C3xj5KWFrY7sHNeDkAzXw==", + "license": "MIT", + "dependencies": { + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-descriptor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.3.tgz", + "integrity": "sha512-JCNNGbwWZEVaSPtS45mdtrneRWJFp07LLmykxeFV5F6oBvNF8vHSfJuJgoT472pSfk+Mf8VnlrspaFBHWM8JAw==", + "license": "MIT", + "dependencies": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "license": "MIT", + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-generator-function": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz", + "integrity": "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "get-proto": "^1.0.0", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "license": "MIT", + "optional": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-nan": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz", + "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==", + "license": "MIT", + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "license": "MIT", + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "license": "MIT", + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "license": "MIT" + }, + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "license": "MIT", + "dependencies": { + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "license": "MIT" + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isomorphic-dompurify": { + "version": "2.26.0", + "resolved": "https://registry.npmjs.org/isomorphic-dompurify/-/isomorphic-dompurify-2.26.0.tgz", + "integrity": "sha512-nZmoK4wKdzPs5USq4JHBiimjdKSVAOm2T1KyDoadtMPNXYHxiENd19ou4iU/V4juFM6LVgYQnpxCYmxqNP4Obw==", + "license": "MIT", + "dependencies": { + "dompurify": "^3.2.6", + "jsdom": "^26.1.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/isomorphic-timers-promises": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/isomorphic-timers-promises/-/isomorphic-timers-promises-1.0.1.tgz", + "integrity": "sha512-u4sej9B1LPSxTGKB/HiuzvEQnXH0ECYkSVQU39koSwmFAxhlEAFl9RdTvLv4TOTQUgBS5O3O5fwUxk6byBZ+IQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/js-md5": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/js-md5/-/js-md5-0.7.3.tgz", + "integrity": "sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ==", + "license": "MIT" + }, + "node_modules/jsdom": { + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-26.1.0.tgz", + "integrity": "sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg==", + "license": "MIT", + "dependencies": { + "cssstyle": "^4.2.1", + "data-urls": "^5.0.0", + "decimal.js": "^10.5.0", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.6", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.16", + "parse5": "^7.2.1", + "rrweb-cssom": "^0.8.0", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^5.1.1", + "w3c-xmlserializer": "^5.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.1.1", + "ws": "^8.18.0", + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "canvas": "^3.0.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha512-4JD/Ivzg7PoW8NzdrBSr3UFwC9mHgvI7Z6z3QGBsSHgKaRTUDmyZAAKJo2UbG1kUVfS9WS8bi36N49U1xw43DA==", + "license": "MIT" + }, + "node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "license": "MIT", + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/jszip": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.1.5.tgz", + "integrity": "sha512-5W8NUaFRFRqTOL7ZDDrx5qWHJyBXy6velVudIzQUSoqAAYqzSh2Z7/m0Rf1QbmQJccegD0r+YZxBjzqoBiEeJQ==", + "license": "(MIT OR GPL-3.0)", + "dependencies": { + "core-js": "~2.3.0", + "es6-promise": "~3.0.2", + "lie": "~3.1.0", + "pako": "~1.0.2", + "readable-stream": "~2.0.6" + } + }, + "node_modules/jszip/node_modules/process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha512-yN0WQmuCX63LP/TMvAg31nvT6m4vDqJEiiv2CAZqWOGNWutc9DfDk1NPYYmKUFmaVM2UwDowH4u5AHWYP/jxKw==", + "license": "MIT" + }, + "node_modules/jszip/node_modules/readable-stream": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "integrity": "sha512-TXcFfb63BQe1+ySzsHZI/5v1aJPCShfqvWJ64ayNImXMsN1Cd0YGk/wm8KB7/OeessgPc9QvS9Zou8QTkFzsLw==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~0.10.x", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/jszip/node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==", + "license": "MIT" + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", + "license": "MIT", + "dependencies": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lie": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz", + "integrity": "sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==", + "license": "MIT", + "dependencies": { + "immediate": "~3.0.5" + } + }, + "node_modules/linebreak": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/linebreak/-/linebreak-0.3.0.tgz", + "integrity": "sha512-zt8pzlM3oq4moDN8U5mP1SbZ44yKV6dXCu44Ez6iTXmxUl8/jRFWeho2SDqL5YDBv0TBKPgU/XGovZwnXAKlOQ==", + "license": "MIT", + "dependencies": { + "base64-js": "0.0.8", + "brfs": "^1.3.0", + "unicode-trie": "^0.3.0" + } + }, + "node_modules/linebreak/node_modules/base64-js": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-0.0.8.tgz", + "integrity": "sha512-3XSA2cR/h/73EzlXXdU6YNycmYI7+kicTxks4eJg2g39biHR84slg2+des+p7iHYhbRg/udIS4TD53WabcOUkw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/loader-runner": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", + "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==", + "license": "MIT", + "engines": { + "node": ">=4.3.0 <5.0.0 || >=5.10" + } + }, + "node_modules/loader-utils": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", + "license": "MIT", + "dependencies": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lookup-closest-locale": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/lookup-closest-locale/-/lookup-closest-locale-6.2.0.tgz", + "integrity": "sha512-/c2kL+Vnp1jnV6K6RpDTHK3dgg0Tu2VVp+elEiJpjfS1UyY7AjOYHohRug6wT0OpoX2qFgNORndE9RqesfVxWQ==", + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "license": "MIT", + "dependencies": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/map-limit": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/map-limit/-/map-limit-0.0.1.tgz", + "integrity": "sha512-pJpcfLPnIF/Sk3taPW21G/RQsEEirGaFpCW3oXRwH9dnFHPHNGjNyvh++rdmC2fNqEaTw2MhYJraoJWAHx8kEg==", + "license": "MIT", + "dependencies": { + "once": "~1.3.0" + } + }, + "node_modules/map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w==", + "license": "MIT", + "dependencies": { + "object-visit": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "license": "MIT", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/mdn-data": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", + "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", + "license": "CC0-1.0" + }, + "node_modules/memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", + "integrity": "sha512-cda4JKCxReDXFXRqOHPQscuIYg1PvxbE2S2GP45rnwfEK+vZaXC8C1OFvdHIbgw0DLzowXGVoxLaAmlgRy14GQ==", + "license": "MIT", + "dependencies": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + }, + "node_modules/merge-source-map": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.0.4.tgz", + "integrity": "sha512-PGSmS0kfnTnMJCzJ16BLLCEe6oeYCamKFFdQKshi4BmM6FUwipjVOcBFGxqtQtirtAG4iZvHlqST9CpZKqlRjA==", + "license": "MIT", + "dependencies": { + "source-map": "^0.5.6" + } + }, + "node_modules/merge-source-map/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/microee": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/microee/-/microee-0.0.6.tgz", + "integrity": "sha512-/LdL3jiBWDJ3oQIRLgRhfeCZNE3patM1LiwCC124+/HHn10sI/G2OAyiMfTNzH5oYWoZBk0tRZADAUOv+0Wt0A==", + "license": "BSD" + }, + "node_modules/micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "license": "MIT", + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "license": "MIT", + "dependencies": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "bin": { + "miller-rabin": "bin/miller-rabin" + } + }, + "node_modules/miller-rabin/node_modules/bn.js": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", + "license": "MIT" + }, + "node_modules/minilog": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/minilog/-/minilog-3.1.0.tgz", + "integrity": "sha512-Xfm4jWjWzSAduvEWtuZX/8TMkxfJlCfH7XvikCZe3ptojYTBq1eoEs3rh9/3LNLOckUP86m+8l8+Iw5NU/pBww==", + "license": "MIT", + "dependencies": { + "microee": "0.0.6" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "license": "ISC" + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", + "license": "MIT" + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mississippi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", + "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", + "license": "BSD-2-Clause", + "dependencies": { + "concat-stream": "^1.5.0", + "duplexify": "^3.4.2", + "end-of-stream": "^1.1.0", + "flush-write-stream": "^1.0.0", + "from2": "^2.1.0", + "parallel-transform": "^1.1.0", + "pump": "^3.0.0", + "pumpify": "^1.3.3", + "stream-each": "^1.1.0", + "through2": "^2.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "license": "MIT", + "dependencies": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/move-concurrently": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", + "integrity": "sha512-hdrFxZOycD/g6A6SoI2bB5NA/5NEqD0569+S47WZhPvm46sD50ZHdYaFmnua5lndde9rCHGjmfK7Z8BuCt/PcQ==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "dependencies": { + "aproba": "^1.1.1", + "copy-concurrently": "^1.0.0", + "fs-write-stream-atomic": "^1.0.8", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.3" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/multipipe": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.3.1.tgz", + "integrity": "sha512-ZUcepNdMeKBRn/ksm2XTxFnhBaqnBJSZNqwajmiem6b7Rp3fNAAq+twYn3kqw9YMY7HJuc7I7OObX9cMgB1ANg==", + "license": "MIT", + "dependencies": { + "duplexer2": "^0.1.2" + } + }, + "node_modules/nan": { + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.24.0.tgz", + "integrity": "sha512-Vpf9qnVW1RaDkoNKFUvfxqAbtI8ncb8OJlqZ9wwpXzWPEsvsB1nvdUi6oYrHIkQ1Y/tMDnr1h4nczS0VB9Xykg==", + "license": "MIT", + "optional": true + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "license": "MIT", + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "license": "MIT" + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-fetch/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" + }, + "node_modules/node-fetch/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" + }, + "node_modules/node-fetch/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/node-libs-browser": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", + "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", + "license": "MIT", + "dependencies": { + "assert": "^1.1.1", + "browserify-zlib": "^0.2.0", + "buffer": "^4.3.0", + "console-browserify": "^1.1.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "^3.11.0", + "domain-browser": "^1.1.1", + "events": "^3.0.0", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "0.0.1", + "process": "^0.11.10", + "punycode": "^1.2.4", + "querystring-es3": "^0.2.0", + "readable-stream": "^2.3.3", + "stream-browserify": "^2.0.1", + "stream-http": "^2.7.2", + "string_decoder": "^1.0.0", + "timers-browserify": "^2.0.4", + "tty-browserify": "0.0.0", + "url": "^0.11.0", + "util": "^0.11.0", + "vm-browserify": "^1.0.1" + } + }, + "node_modules/node-libs-browser/node_modules/assert": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.1.tgz", + "integrity": "sha512-zzw1uCAgLbsKwBfFc8CX78DDg+xZeBksSO3vwVIDDN5i94eOrPsSSyiVhmsSABFDM/OcpE2aagCat9dnWQLG1A==", + "license": "MIT", + "dependencies": { + "object.assign": "^4.1.4", + "util": "^0.10.4" + } + }, + "node_modules/node-libs-browser/node_modules/assert/node_modules/util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", + "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "license": "MIT", + "dependencies": { + "inherits": "2.0.3" + } + }, + "node_modules/node-libs-browser/node_modules/buffer": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", + "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", + "license": "MIT", + "dependencies": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "node_modules/node-libs-browser/node_modules/domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "license": "MIT", + "engines": { + "node": ">=0.4", + "npm": ">=1.2" + } + }, + "node_modules/node-libs-browser/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", + "license": "ISC" + }, + "node_modules/node-libs-browser/node_modules/path-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", + "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", + "license": "MIT" + }, + "node_modules/node-libs-browser/node_modules/punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", + "license": "MIT" + }, + "node_modules/node-libs-browser/node_modules/stream-browserify": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", + "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", + "license": "MIT", + "dependencies": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + } + }, + "node_modules/node-libs-browser/node_modules/stream-http": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", + "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", + "license": "MIT", + "dependencies": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "node_modules/node-libs-browser/node_modules/tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha512-JVa5ijo+j/sOoHGjw0sxw734b1LhBkQ3bvUGNdxnVXDCX81Yx7TFgnZygxrIIWn23hbfTaMYLwRmAxFyDuFmIw==", + "license": "MIT" + }, + "node_modules/node-libs-browser/node_modules/util": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", + "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", + "license": "MIT", + "dependencies": { + "inherits": "2.0.3" + } + }, + "node_modules/node-stdlib-browser": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-stdlib-browser/-/node-stdlib-browser-1.3.1.tgz", + "integrity": "sha512-X75ZN8DCLftGM5iKwoYLA3rjnrAEs97MkzvSd4q2746Tgpg8b8XWiBGiBG4ZpgcAqBgtgPHTiAc8ZMCvZuikDw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assert": "^2.0.0", + "browser-resolve": "^2.0.0", + "browserify-zlib": "^0.2.0", + "buffer": "^5.7.1", + "console-browserify": "^1.1.0", + "constants-browserify": "^1.0.0", + "create-require": "^1.1.1", + "crypto-browserify": "^3.12.1", + "domain-browser": "4.22.0", + "events": "^3.0.0", + "https-browserify": "^1.0.0", + "isomorphic-timers-promises": "^1.0.1", + "os-browserify": "^0.3.0", + "path-browserify": "^1.0.1", + "pkg-dir": "^5.0.0", + "process": "^0.11.10", + "punycode": "^1.4.1", + "querystring-es3": "^0.2.1", + "readable-stream": "^3.6.0", + "stream-browserify": "^3.0.0", + "stream-http": "^3.2.0", + "string_decoder": "^1.0.0", + "timers-browserify": "^2.0.4", + "tty-browserify": "0.0.1", + "url": "^0.11.4", + "util": "^0.12.4", + "vm-browserify": "^1.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-stdlib-browser/node_modules/punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-stdlib-browser/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/normalize-package-data/node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "license": "ISC" + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nwsapi": { + "version": "2.2.23", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.23.tgz", + "integrity": "sha512-7wfH4sLbt4M0gCDzGE6vzQBo0bfTKjU7Sfpqy/7gs1qBfYz2vEJH6vXcBKpO3+6Yu1telwd0t9HpyOoLEQQbIQ==", + "license": "MIT" + }, + "node_modules/object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ==", + "license": "MIT", + "dependencies": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "license": "MIT", + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/is-descriptor": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "license": "MIT", + "dependencies": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object-copy/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "license": "MIT", + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-is": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", + "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA==", + "license": "MIT", + "dependencies": { + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object.assign": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==", + "license": "MIT", + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/obug": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.1.tgz", + "integrity": "sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==", + "dev": true, + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT" + }, + "node_modules/once": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "integrity": "sha512-6vaNInhu+CHxtONf3zw3vq4SP2DOQhjBvIa3rNcG0+P7eKWlYH6Peu7rHizSloRU2EwMz6GraLieis9Ac9+p1w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "license": "MIT", + "dependencies": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==", + "license": "MIT" + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "license": "(MIT AND Zlib)" + }, + "node_modules/parallel-transform": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", + "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", + "license": "MIT", + "dependencies": { + "cyclist": "^1.0.1", + "inherits": "^2.0.3", + "readable-stream": "^2.1.5" + } + }, + "node_modules/parse-asn1": { + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.7.tgz", + "integrity": "sha512-CTM5kuWR3sx9IFamcl5ErfPl6ea/N8IYwiJ+vpeB2g+1iknv7zBl5uPwbMbRVznRVbrNY6lGuDoE5b30grmbqg==", + "license": "ISC", + "dependencies": { + "asn1.js": "^4.10.1", + "browserify-aes": "^1.2.0", + "evp_bytestokey": "^1.0.3", + "hash-base": "~3.0", + "pbkdf2": "^3.1.2", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/parse-asn1/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "license": "MIT", + "dependencies": { + "entities": "^6.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5/node_modules/entities": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha512-ALzNPpyNq9AqXMBjeymIjFDAkAFH06mHJH/cSBHAgU0s4vfpBn6b2nf8tiRLvagKD8RbTpq2FKTBg7cl9l3c7Q==", + "license": "MIT", + "optional": true + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "license": "MIT" + }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/pbkdf2": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.3.tgz", + "integrity": "sha512-wfRLBZ0feWRhCIkoMB6ete7czJcnNnqRpcoWQBLqatqXXmelSRqfdDK4F3u9T2s2cXas/hQJcryI/4lAL+XTlA==", + "license": "MIT", + "dependencies": { + "create-hash": "~1.1.3", + "create-hmac": "^1.1.7", + "ripemd160": "=2.0.1", + "safe-buffer": "^5.2.1", + "sha.js": "^2.4.11", + "to-buffer": "^1.2.0" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/pbkdf2/node_modules/create-hash": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.3.tgz", + "integrity": "sha512-snRpch/kwQhcdlnZKYanNF1m0RDlrCdSKQaH87w1FCFPVPNCQ/Il9QJKAX2jVBZddRdaHBMC+zXa9Gw9tmkNUA==", + "license": "MIT", + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "sha.js": "^2.4.0" + } + }, + "node_modules/pbkdf2/node_modules/hash-base": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-2.0.2.tgz", + "integrity": "sha512-0TROgQ1/SxE6KmxWSvXHvRj90/Xo1JvZShofnYF+f6ZsGtR4eES7WfrQzPalmyagfKZCXpVnitiRebZulWsbiw==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.1" + } + }, + "node_modules/pbkdf2/node_modules/ripemd160": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.1.tgz", + "integrity": "sha512-J7f4wutN8mdbV08MJnXibYpCOPHR+yzy+iQ/AsjMv2j8cLavQ8VGagDFUwwTAdF8FmRKVeNpbTTEwNHCW1g94w==", + "license": "MIT", + "dependencies": { + "hash-base": "^2.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/pbkdf2/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/pinia": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/pinia/-/pinia-2.1.3.tgz", + "integrity": "sha512-XNA/z/ye4P5rU1pieVmh0g/hSuDO98/a5UC8oSP0DNdvt6YtetJNHTrXwpwsQuflkGT34qKxAEcp7lSxXNjf/A==", + "license": "MIT", + "dependencies": { + "@vue/devtools-api": "^6.5.0", + "vue-demi": ">=0.14.5" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "@vue/composition-api": "^1.4.0", + "typescript": ">=4.4.4", + "vue": "^2.6.14 || ^3.3.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/pkg-dir": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz", + "integrity": "sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^5.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/postcss": { + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", + "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.7.4.tgz", + "integrity": "sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "license": "MIT" + }, + "node_modules/promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", + "license": "ISC" + }, + "node_modules/prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==", + "license": "MIT" + }, + "node_modules/public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "license": "MIT", + "dependencies": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/public-encrypt/node_modules/bn.js": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.2.tgz", + "integrity": "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw==", + "license": "MIT" + }, + "node_modules/pump": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz", + "integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "license": "MIT", + "dependencies": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + } + }, + "node_modules/pumpify/node_modules/pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA==", + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/quote-stream": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/quote-stream/-/quote-stream-1.0.2.tgz", + "integrity": "sha512-kKr2uQ2AokadPjvTyKJQad9xELbZwYzWlNfI3Uz2j/ib5u6H9lDP7fUUR//rMycd0gv4Z5P1qXMfXR8YpIxrjQ==", + "license": "MIT", + "dependencies": { + "buffer-equal": "0.0.1", + "minimist": "^1.1.3", + "through2": "^2.0.0" + }, + "bin": { + "quote-stream": "bin/cmd.js" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "license": "MIT", + "dependencies": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "node_modules/raw-loader": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-0.5.1.tgz", + "integrity": "sha512-sf7oGoLuaYAScB4VGr0tzetsYlS8EJH6qnTCfQ/WVEa89hALQ4RQfCKt5xCyPQKPDUbVUAIP1QsxAwfAjlDp7Q==" + }, + "node_modules/read-package-json": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.2.tgz", + "integrity": "sha512-D1KmuLQr6ZSJS0tW8hf3WGpRlwszJOXZ3E8Yd/DNRaM5d+1wVRZdHlpGBLAuovjr28LbWvjpWkBHMxpRGGjzNA==", + "deprecated": "This package is no longer supported. Please use @npmcli/package-json instead.", + "license": "ISC", + "dependencies": { + "glob": "^7.1.1", + "json-parse-even-better-errors": "^2.3.0", + "normalize-package-data": "^2.0.0", + "npm-normalize-package-bin": "^1.0.0" + } + }, + "node_modules/read-package-json/node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "license": "MIT" + }, + "node_modules/read-package-json/node_modules/npm-normalize-package-bin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", + "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", + "license": "ISC" + }, + "node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "license": "MIT", + "optional": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/readdirp/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "license": "MIT", + "dependencies": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw==", + "license": "ISC", + "optional": true + }, + "node_modules/repeat-element": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", + "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", + "license": "MIT", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/resolve": { + "version": "1.22.10", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", + "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg==", + "deprecated": "https://github.com/lydell/resolve-url#deprecated", + "license": "MIT" + }, + "node_modules/ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "license": "MIT", + "engines": { + "node": ">=0.12" + } + }, + "node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "license": "MIT", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/rollup": { + "version": "4.46.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.46.4.tgz", + "integrity": "sha512-YbxoxvoqNg9zAmw4+vzh1FkGAiZRK+LhnSrbSrSXMdZYsRPDWoshcSd/pldKRO6lWzv/e9TiJAVQyirYIeSIPQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "@types/estree": "1.0.8" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.46.4", + "@rollup/rollup-android-arm64": "4.46.4", + "@rollup/rollup-darwin-arm64": "4.46.4", + "@rollup/rollup-darwin-x64": "4.46.4", + "@rollup/rollup-freebsd-arm64": "4.46.4", + "@rollup/rollup-freebsd-x64": "4.46.4", + "@rollup/rollup-linux-arm-gnueabihf": "4.46.4", + "@rollup/rollup-linux-arm-musleabihf": "4.46.4", + "@rollup/rollup-linux-arm64-gnu": "4.46.4", + "@rollup/rollup-linux-arm64-musl": "4.46.4", + "@rollup/rollup-linux-loongarch64-gnu": "4.46.4", + "@rollup/rollup-linux-ppc64-gnu": "4.46.4", + "@rollup/rollup-linux-riscv64-gnu": "4.46.4", + "@rollup/rollup-linux-riscv64-musl": "4.46.4", + "@rollup/rollup-linux-s390x-gnu": "4.46.4", + "@rollup/rollup-linux-x64-gnu": "4.46.4", + "@rollup/rollup-linux-x64-musl": "4.46.4", + "@rollup/rollup-win32-arm64-msvc": "4.46.4", + "@rollup/rollup-win32-ia32-msvc": "4.46.4", + "@rollup/rollup-win32-x64-msvc": "4.46.4", + "fsevents": "~2.3.2" + } + }, + "node_modules/rrweb-cssom": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz", + "integrity": "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==", + "license": "MIT" + }, + "node_modules/run-queue": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", + "integrity": "sha512-ntymy489o0/QQplUDnpYAYUsO50K9SBrIVaKCWDOJzYJts0f9WH9RFJkyagebkw5+y1oi00R7ynNW/d12GBumg==", + "license": "ISC", + "dependencies": { + "aproba": "^1.1.1" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==", + "license": "MIT", + "dependencies": { + "ret": "~0.1.10" + } + }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "license": "ISC", + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" + } + }, + "node_modules/schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "license": "MIT", + "dependencies": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/schema-utils/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "license": "MIT", + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/schema-utils/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "license": "MIT", + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/schema-utils/node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, + "node_modules/schema-utils/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "license": "MIT" + }, + "node_modules/scratch-audio": { + "version": "2.0.268", + "resolved": "https://registry.npmjs.org/scratch-audio/-/scratch-audio-2.0.268.tgz", + "integrity": "sha512-arkmLfsA7IxSniSWfTQWImYE0yTZQIGUg4i+phFb5mk3D95XXHSd/9nVzIzD9lzfQntnm4Gd9VY7S8qYuGINxQ==", + "license": "AGPL-3.0-only", + "dependencies": { + "audio-context": "^1.0.1", + "minilog": "^3.0.1", + "startaudiocontext": "^1.2.1" + } + }, + "node_modules/scratch-parser": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/scratch-parser/-/scratch-parser-5.1.1.tgz", + "integrity": "sha512-Kh1ddyNDgnzaVQrEaA5L4hYeSoqrXBXDMb1xKycrauFZNcOcbcBpE1X6bE2mA5fK6B0Dd+yuaRyKpMHJYlC69g==", + "license": "BSD-3-Clause", + "dependencies": { + "ajv": "6.3.0", + "jszip": "3.1.5", + "pify": "4.0.1" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/scratch-render": { + "version": "0.1.0", + "resolved": "git+ssh://git@github.com/hyperquark/scratch-render.git#fad8e76232eb9b18d63d9786492f02581ab1d7fc", + "license": "MPL-2.0", + "dependencies": { + "@turbowarp/ancient-hull.js": "^0.2.13", + "@turbowarp/nanolog": "^0.2.0", + "@turbowarp/scratch-svg-renderer": "^1.0.0-202312242305-12c360b", + "grapheme-breaker": "0.3.2", + "ify-loader": "1.0.4", + "linebreak": "0.3.0", + "raw-loader": "^0.5.1", + "scratch-storage": "^1.0.0", + "twgl.js": "4.4.0" + } + }, + "node_modules/scratch-render-fonts": { + "version": "1.0.0", + "resolved": "git+ssh://git@github.com/TurboWarp/scratch-render-fonts.git#7b6768fc6dfef6b343a06f992587b74807043961", + "peer": true, + "dependencies": { + "base64-loader": "1.0.0" + } + }, + "node_modules/scratch-render/node_modules/base64-js": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", + "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", + "license": "MIT" + }, + "node_modules/scratch-render/node_modules/ify-loader": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/ify-loader/-/ify-loader-1.0.4.tgz", + "integrity": "sha512-fzWOWwsTZH3c2GPNJy1dndN5lk+oyXGPbg9YrHv/UwC/SmlxNEUAst6evF1H9ySGbezgBA42YGLSr1WzAwgx9w==", + "license": "MIT", + "dependencies": { + "bl": "^1.0.0", + "findup": "^0.1.5", + "from2-array": "0.0.4", + "map-limit": "0.0.1", + "multipipe": "^0.3.0", + "read-package-json": "^2.0.2", + "resolve": "^1.1.6" + } + }, + "node_modules/scratch-render/node_modules/scratch-storage": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/scratch-storage/-/scratch-storage-1.3.6.tgz", + "integrity": "sha512-L/7z7SB7cGANsgjyiE+qZNaPEqFHK1yPbNomizkgN3WHGcKRogLvmheR57kOxHNpQzodUTbG+pVVH6fR2ZY1Sg==", + "license": "BSD-3-Clause", + "dependencies": { + "arraybuffer-loader": "^1.0.3", + "base64-js": "1.3.0", + "fastestsmallesttextencoderdecoder": "^1.0.7", + "js-md5": "0.7.3", + "minilog": "3.1.0", + "worker-loader": "^2.0.0" + } + }, + "node_modules/scratch-render/node_modules/twgl.js": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/twgl.js/-/twgl.js-4.4.0.tgz", + "integrity": "sha512-W+uFP2DyK2dNhE38PcpituNi8CBm+YO5gY6o/IWEILT7NNDTT1wo3YcMmydwiCfUbnT7tz+EcjV7KlZLgE1PlQ==", + "license": "MIT" + }, + "node_modules/scratch-sb1-converter": { + "version": "2.0.228", + "resolved": "https://registry.npmjs.org/scratch-sb1-converter/-/scratch-sb1-converter-2.0.228.tgz", + "integrity": "sha512-/XjJgvcVweBp+cFbgpUz1ctLMXZ17fVLQOioXGmHIoO4OyGi8hEhigQAEUZ3wpyQwvAsSWNRvx1qpO3hCQNDUQ==", + "license": "AGPL-3.0-only", + "dependencies": { + "js-md5": "^0.7.3", + "minilog": "^3.1.0", + "text-encoding": "^0.7.0" + } + }, + "node_modules/scratch-storage": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/scratch-storage/-/scratch-storage-5.0.10.tgz", + "integrity": "sha512-qtBjqFRYWqpnD+pPanVMadPielmNLZH4zCSuz/cnzKFY1RPJXjigMMP8vgm/XvM4zn01tUyl4z/OliWRB9hxbw==", + "license": "AGPL-3.0-only", + "dependencies": { + "@babel/runtime": "^7.21.0", + "arraybuffer-loader": "^1.0.3", + "base64-js": "^1.3.0", + "buffer": "6.0.3", + "cross-fetch": "^4.1.0", + "fastestsmallesttextencoderdecoder": "^1.0.7", + "js-md5": "^0.7.3", + "minilog": "^3.1.0" + } + }, + "node_modules/scratch-storage/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/scratch-translate-extension-languages": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/scratch-translate-extension-languages/-/scratch-translate-extension-languages-1.0.7.tgz", + "integrity": "sha512-6+bQU9iVYv23T8J0SjpV6MTugm0y8myh/4DPgu1BGfccysdkaWzu3MkNGQyQRUlbqAiW9wM7ctfv3USPEkzTgg==", + "license": "BSD-3-Clause" + }, + "node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/serialize-javascript": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", + "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "license": "MIT", + "dependencies": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/set-value/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "license": "MIT", + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/set-value/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "license": "MIT" + }, + "node_modules/sha.js": { + "version": "2.4.12", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.12.tgz", + "integrity": "sha512-8LzC5+bvI45BjpfXU8V5fdU2mfeKiQe1D1gIMn7XUlF3OTUrpdJpPPH4EMAnF0DsHHdSZqCdSss5qCmJKuiO3w==", + "license": "(MIT AND BSD-3-Clause)", + "dependencies": { + "inherits": "^2.0.4", + "safe-buffer": "^5.2.1", + "to-buffer": "^1.2.0" + }, + "bin": { + "sha.js": "bin.js" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/sha.js/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/shallow-copy": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz", + "integrity": "sha512-b6i4ZpVuUxB9h5gfCxPiusKYkqTMOjEbBs4wMaFbkfia4yFv92UKZ6Df8WXcKbn08JNL/abvg3FnMAOfakDvUw==", + "license": "MIT" + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, + "node_modules/snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "license": "MIT", + "dependencies": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "license": "MIT", + "dependencies": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==", + "license": "MIT", + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "license": "MIT", + "dependencies": { + "kind-of": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-util/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "license": "MIT", + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/snapdragon/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "license": "MIT", + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "license": "MIT", + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/is-descriptor": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "license": "MIT", + "dependencies": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/snapdragon/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/snapdragon/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-list-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", + "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", + "license": "MIT" + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated", + "license": "MIT", + "dependencies": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/source-map-url": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", + "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", + "deprecated": "See https://github.com/lydell/source-map-url#deprecated", + "license": "MIT" + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "license": "Apache-2.0", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "license": "CC-BY-3.0" + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.22", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.22.tgz", + "integrity": "sha512-4PRT4nh1EImPbt2jASOKHX7PB7I+e4IWNLvkKFDxNhJlfjbYlleYQh285Z/3mPTHSAK/AvdMmw5BNNuYH8ShgQ==", + "license": "CC0-1.0" + }, + "node_modules/split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "license": "MIT", + "dependencies": { + "extend-shallow": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ssri": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.2.tgz", + "integrity": "sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q==", + "license": "ISC", + "dependencies": { + "figgy-pudding": "^3.5.1" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/startaudiocontext": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/startaudiocontext/-/startaudiocontext-1.2.1.tgz", + "integrity": "sha512-ooOQhOAoCwzMIRwWd9j7xF8kAMo1Wv7Zfw+q6dWDW5gxJUKx15HJXWDg89GMDqfdle9xsqPv+uioneX+bI643g==", + "license": "MIT" + }, + "node_modules/static-eval": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.1.1.tgz", + "integrity": "sha512-MgWpQ/ZjGieSVB3eOJVs4OA2LT/q1vx98KPCTTQPzq/aLr0YUXTsgryTXr4SLfR0ZfUUCiedM9n/ABeDIyy4mA==", + "license": "MIT", + "dependencies": { + "escodegen": "^2.1.0" + } + }, + "node_modules/static-eval/node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "license": "BSD-2-Clause", + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/static-eval/node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/static-eval/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g==", + "license": "MIT", + "dependencies": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==", + "license": "MIT", + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/is-descriptor": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.7.tgz", + "integrity": "sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==", + "license": "MIT", + "dependencies": { + "is-accessor-descriptor": "^1.0.1", + "is-data-descriptor": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/static-module": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/static-module/-/static-module-2.2.5.tgz", + "integrity": "sha512-D8vv82E/Kpmz3TXHKG8PPsCPg+RAX6cbCOyvjM6x04qZtQ47EtJFVwRsdov3n5d6/6ynrOY9XB4JkaZwB2xoRQ==", + "license": "MIT", + "dependencies": { + "concat-stream": "~1.6.0", + "convert-source-map": "^1.5.1", + "duplexer2": "~0.1.4", + "escodegen": "~1.9.0", + "falafel": "^2.1.0", + "has": "^1.0.1", + "magic-string": "^0.22.4", + "merge-source-map": "1.0.4", + "object-inspect": "~1.4.0", + "quote-stream": "~1.0.2", + "readable-stream": "~2.3.3", + "shallow-copy": "~0.0.1", + "static-eval": "^2.0.0", + "through2": "~2.0.3" + } + }, + "node_modules/static-module/node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "license": "MIT" + }, + "node_modules/static-module/node_modules/magic-string": { + "version": "0.22.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", + "integrity": "sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w==", + "license": "MIT", + "dependencies": { + "vlq": "^0.2.2" + } + }, + "node_modules/static-module/node_modules/object-inspect": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.4.1.tgz", + "integrity": "sha512-wqdhLpfCUbEsoEwl3FXwGyv8ief1k/1aUdIPCqVnupM6e8l63BEJdiF/0swtn04/8p05tG/T0FrpTlfwvljOdw==", + "license": "MIT" + }, + "node_modules/std-env": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz", + "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==", + "dev": true, + "license": "MIT" + }, + "node_modules/stream-browserify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", + "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "~2.0.4", + "readable-stream": "^3.5.0" + } + }, + "node_modules/stream-browserify/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/stream-each": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", + "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "stream-shift": "^1.0.0" + } + }, + "node_modules/stream-http": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.2.0.tgz", + "integrity": "sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A==", + "dev": true, + "license": "MIT", + "dependencies": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "xtend": "^4.0.2" + } + }, + "node_modules/stream-http/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/stream-shift": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz", + "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==", + "license": "MIT" + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "license": "MIT" + }, + "node_modules/tapable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", + "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/terser": { + "version": "5.44.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.44.1.tgz", + "integrity": "sha512-t/R3R/n0MSwnnazuPpPNVO60LX0SKL45pyl9YlvxIdkH0Of7D5qM2EVe+yASRIlY5pZ73nclYJfNANGWPwFDZw==", + "license": "BSD-2-Clause", + "optional": true, + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.15.0", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/terser-webpack-plugin": { + "version": "1.4.6", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.6.tgz", + "integrity": "sha512-2lBVf/VMVIddjSn3GqbT90GvIJ/eYXJkt8cTzU7NbjKqK8fwv18Ftr4PlbF46b/e88743iZFL5Dtr/rC4hjIeA==", + "license": "MIT", + "dependencies": { + "cacache": "^12.0.2", + "find-cache-dir": "^2.1.0", + "is-wsl": "^1.1.0", + "schema-utils": "^1.0.0", + "serialize-javascript": "^4.0.0", + "source-map": "^0.6.1", + "terser": "^4.1.2", + "webpack-sources": "^1.4.0", + "worker-farm": "^1.7.0" + }, + "engines": { + "node": ">= 6.9.0" + }, + "peerDependencies": { + "webpack": "^4.0.0" + } + }, + "node_modules/terser-webpack-plugin/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "license": "MIT" + }, + "node_modules/terser-webpack-plugin/node_modules/terser": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.1.tgz", + "integrity": "sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==", + "license": "BSD-2-Clause", + "dependencies": { + "commander": "^2.20.0", + "source-map": "~0.6.1", + "source-map-support": "~0.5.12" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/terser/node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "license": "MIT", + "optional": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/terser/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "license": "MIT", + "optional": true + }, + "node_modules/text-encoding": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/text-encoding/-/text-encoding-0.7.0.tgz", + "integrity": "sha512-oJQ3f1hrOnbRLOcwKz0Liq2IcrvDeZRHXhd9RgLrsT+DjWY/nty1Hi7v3dtkaEYbPYe0mUoOfzRrMwfXXwgPUA==", + "deprecated": "no longer maintained", + "license": "(Unlicense OR Apache-2.0)" + }, + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "license": "MIT", + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/timers-browserify": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", + "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", + "license": "MIT", + "dependencies": { + "setimmediate": "^1.0.4" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/tiny-inflate": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-inflate/-/tiny-inflate-1.0.3.tgz", + "integrity": "sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==", + "license": "MIT" + }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.0.2.tgz", + "integrity": "sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyrainbow": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.0.3.tgz", + "integrity": "sha512-PSkbLUoxOFRzJYjjxHJt9xro7D+iilgMX/C9lawzVuYiIdcihh9DXmVibBe8lmcFrRi/VzlPjBxbN7rH24q8/Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tldts": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.86.tgz", + "integrity": "sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==", + "license": "MIT", + "dependencies": { + "tldts-core": "^6.1.86" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.86.tgz", + "integrity": "sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==", + "license": "MIT" + }, + "node_modules/to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha512-okFlQcoGTi4LQBG/PgSYblw9VOyptsz2KJZqc6qtgGdes8VktzUQkj4BI2blit072iS8VODNcMA+tvnS9dnuMA==", + "license": "MIT" + }, + "node_modules/to-buffer": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.2.1.tgz", + "integrity": "sha512-tB82LpAIWjhLYbqjx3X4zEeHN6M8CiuOEy2JY8SEQVdYRe3CCHOFaqrBW1doLDrfpWhplcW7BL+bO3/6S3pcDQ==", + "license": "MIT", + "dependencies": { + "isarray": "^2.0.5", + "safe-buffer": "^5.2.1", + "typed-array-buffer": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/to-buffer/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "license": "MIT" + }, + "node_modules/to-buffer/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg==", + "license": "MIT", + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-object-path/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "license": "MIT", + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "license": "MIT", + "dependencies": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==", + "license": "MIT", + "dependencies": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tough-cookie": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz", + "integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==", + "license": "BSD-3-Clause", + "dependencies": { + "tldts": "^6.1.32" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/tr46": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.1.tgz", + "integrity": "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==", + "license": "MIT", + "dependencies": { + "punycode": "^2.3.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/transformation-matrix": { + "version": "1.15.3", + "resolved": "https://registry.npmjs.org/transformation-matrix/-/transformation-matrix-1.15.3.tgz", + "integrity": "sha512-ThJH58GNFKhCw3gIoOtwf3tNwuYjbyEeiGdeq4mNMYWdJctnI896KUqn6PVt7jmNVepqa1bcKQtnMB1HtjsDMA==", + "license": "MIT" + }, + "node_modules/tslog": { + "version": "4.10.2", + "resolved": "https://registry.npmjs.org/tslog/-/tslog-4.10.2.tgz", + "integrity": "sha512-XuELoRpMR+sq8fuWwX7P0bcj+PRNiicOKDEb3fGNURhxWVyykCi9BNq7c4uVz7h7P0sj8qgBsr5SWS6yBClq3g==", + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/fullstack-build/tslog?sponsor=1" + } + }, + "node_modules/tty-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", + "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", + "dev": true, + "license": "MIT" + }, + "node_modules/twgl.js": { + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/twgl.js/-/twgl.js-4.24.0.tgz", + "integrity": "sha512-JGVTxuV9dqaBmajXyvuZIlhCHrTbIaoNjQvtdoLHyK74OtbmNwZUj6rfdp+pz9htitI/tVxiVQ2nuw+KmD29vg==", + "license": "MIT" + }, + "node_modules/type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", + "license": "MIT", + "dependencies": { + "prelude-ls": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", + "license": "MIT" + }, + "node_modules/unicode-trie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/unicode-trie/-/unicode-trie-0.3.1.tgz", + "integrity": "sha512-WgVuO0M2jDl7hVfbPgXv2LUrD81HM0bQj/bvLGiw6fJ4Zo8nNFnDrA0/hU2Te/wz6pjxCm5cxJwtLjo2eyV51Q==", + "license": "MIT", + "dependencies": { + "pako": "^0.2.5", + "tiny-inflate": "^1.0.0" + } + }, + "node_modules/unicode-trie/node_modules/pako": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA==", + "license": "MIT" + }, + "node_modules/union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "license": "MIT", + "dependencies": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/union-value/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "license": "ISC", + "dependencies": { + "unique-slug": "^2.0.0" + } + }, + "node_modules/unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4" + } + }, + "node_modules/unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==", + "license": "MIT", + "dependencies": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q==", + "license": "MIT", + "dependencies": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-value/node_modules/isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==", + "license": "MIT", + "dependencies": { + "isarray": "1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/upath": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=4", + "yarn": "*" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg==", + "deprecated": "Please see https://github.com/lydell/urix#deprecated", + "license": "MIT" + }, + "node_modules/url": { + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.4.tgz", + "integrity": "sha512-oCwdVC7mTuWiPyjLUz/COz5TLk6wgp0RCsN+wHZ2Ekneac9w8uuV0njcbbie2ME+Vs+d6duwmYuR3HgQXs1fOg==", + "license": "MIT", + "dependencies": { + "punycode": "^1.4.1", + "qs": "^6.12.3" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/url/node_modules/punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", + "license": "MIT" + }, + "node_modules/use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/util": { + "version": "0.12.5", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", + "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "is-typed-array": "^1.1.3", + "which-typed-array": "^1.1.2" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "license": "Apache-2.0", + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/vite": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.0.tgz", + "integrity": "sha512-dZwN5L1VlUBewiP6H9s2+B3e3Jg96D0vzN+Ry73sOefebhYr9f94wwkMNN/9ouoU8pV1BqA1d1zGk8928cx0rg==", + "license": "MIT", + "peer": true, + "dependencies": { + "esbuild": "^0.27.0", + "fdir": "^6.5.0", + "picomatch": "^4.0.3", + "postcss": "^8.5.6", + "rollup": "^4.43.0", + "tinyglobby": "^0.2.15" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "lightningcss": "^1.21.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vite-plugin-node-polyfills": { + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/vite-plugin-node-polyfills/-/vite-plugin-node-polyfills-0.24.0.tgz", + "integrity": "sha512-GA9QKLH+vIM8NPaGA+o2t8PDfFUl32J8rUp1zQfMKVJQiNkOX4unE51tR6ppl6iKw5yOrDAdSH7r/UIFLCVhLw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/plugin-inject": "^5.0.5", + "node-stdlib-browser": "^1.2.0" + }, + "funding": { + "url": "https://github.com/sponsors/davidmyersdev" + }, + "peerDependencies": { + "vite": "^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" + } + }, + "node_modules/vite-plugin-wasm": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/vite-plugin-wasm/-/vite-plugin-wasm-3.5.0.tgz", + "integrity": "sha512-X5VWgCnqiQEGb+omhlBVsvTfxikKtoOgAzQ95+BZ8gQ+VfMHIjSHr0wyvXFQCa0eKQ0fKyaL0kWcEnYqBac4lQ==", + "license": "MIT", + "peerDependencies": { + "vite": "^2 || ^3 || ^4 || ^5 || ^6 || ^7" + } + }, + "node_modules/vitest": { + "version": "4.0.16", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-4.0.16.tgz", + "integrity": "sha512-E4t7DJ9pESL6E3I8nFjPa4xGUd3PmiWDLsDztS2qXSJWfHtbQnwAWylaBvSNY48I3vr8PTqIZlyK8TE3V3CA4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "4.0.16", + "@vitest/mocker": "4.0.16", + "@vitest/pretty-format": "4.0.16", + "@vitest/runner": "4.0.16", + "@vitest/snapshot": "4.0.16", + "@vitest/spy": "4.0.16", + "@vitest/utils": "4.0.16", + "es-module-lexer": "^1.7.0", + "expect-type": "^1.2.2", + "magic-string": "^0.30.21", + "obug": "^2.1.1", + "pathe": "^2.0.3", + "picomatch": "^4.0.3", + "std-env": "^3.10.0", + "tinybench": "^2.9.0", + "tinyexec": "^1.0.2", + "tinyglobby": "^0.2.15", + "tinyrainbow": "^3.0.3", + "vite": "^6.0.0 || ^7.0.0", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@opentelemetry/api": "^1.9.0", + "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", + "@vitest/browser-playwright": "4.0.16", + "@vitest/browser-preview": "4.0.16", + "@vitest/browser-webdriverio": "4.0.16", + "@vitest/ui": "4.0.16", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser-playwright": { + "optional": true + }, + "@vitest/browser-preview": { + "optional": true + }, + "@vitest/browser-webdriverio": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/vlq": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", + "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", + "license": "MIT" + }, + "node_modules/vm-browserify": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", + "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", + "license": "MIT" + }, + "node_modules/vue": { + "version": "3.5.21", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.21.tgz", + "integrity": "sha512-xxf9rum9KtOdwdRkiApWL+9hZEMWE90FHh8yS1+KJAiWYh+iGWV1FquPjoO9VUHQ+VIhsCXNNyZ5Sf4++RVZBA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@vue/compiler-dom": "3.5.21", + "@vue/compiler-sfc": "3.5.21", + "@vue/runtime-dom": "3.5.21", + "@vue/server-renderer": "3.5.21", + "@vue/shared": "3.5.21" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/vue-demi": { + "version": "0.14.10", + "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.10.tgz", + "integrity": "sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==", + "hasInstallScript": true, + "license": "MIT", + "bin": { + "vue-demi-fix": "bin/vue-demi-fix.js", + "vue-demi-switch": "bin/vue-demi-switch.js" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^3.0.0-0 || ^2.6.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } + }, + "node_modules/vue-router": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.5.1.tgz", + "integrity": "sha512-ogAF3P97NPm8fJsE4by9dwSYtDwXIY1nFY9T6DyQnGHd1E2Da94w9JIolpe42LJGIl0DwOHBi8TcRPlPGwbTtw==", + "license": "MIT", + "dependencies": { + "@vue/devtools-api": "^6.6.4" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "vue": "^3.2.0" + } + }, + "node_modules/w3c-xmlserializer": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", + "license": "MIT", + "dependencies": { + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/wasm-feature-detect": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/wasm-feature-detect/-/wasm-feature-detect-1.8.0.tgz", + "integrity": "sha512-zksaLKM2fVlnB5jQQDqKXXwYHLQUVH9es+5TOOHwGOVJOCeRBCiPjwSg+3tN2AdTCzjgli4jijCH290kXb/zWQ==", + "license": "Apache-2.0" + }, + "node_modules/watchpack": { + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz", + "integrity": "sha512-9P3MWk6SrKjHsGkLT2KHXdQ/9SNkyoJbabxnKOoJepsvJjJG8uYTR3yTPxPQvNDI3w4Nz1xnE0TLHK4RIVe/MQ==", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.2", + "neo-async": "^2.5.0" + }, + "optionalDependencies": { + "chokidar": "^3.4.1", + "watchpack-chokidar2": "^2.0.1" + } + }, + "node_modules/watchpack-chokidar2": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/watchpack-chokidar2/-/watchpack-chokidar2-2.0.1.tgz", + "integrity": "sha512-nCFfBIPKr5Sh61s4LPpy1Wtfi0HE8isJ3d2Yb5/Ppw2P2B/3eVSEBjKfN0fmHJSK14+31KwMKmcrzs2GM4P0Ww==", + "license": "MIT", + "optional": true, + "dependencies": { + "chokidar": "^2.1.8" + } + }, + "node_modules/watchpack-chokidar2/node_modules/anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "license": "ISC", + "optional": true, + "dependencies": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + } + }, + "node_modules/watchpack-chokidar2/node_modules/anymatch/node_modules/normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==", + "license": "MIT", + "optional": true, + "dependencies": { + "remove-trailing-separator": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack-chokidar2/node_modules/binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack-chokidar2/node_modules/chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "license": "MIT", + "optional": true, + "dependencies": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + }, + "optionalDependencies": { + "fsevents": "^1.2.7" + } + }, + "node_modules/watchpack-chokidar2/node_modules/fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "deprecated": "Upgrade to fsevents v2 to mitigate potential security issues", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "dependencies": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + }, + "engines": { + "node": ">= 4.0" + } + }, + "node_modules/watchpack-chokidar2/node_modules/glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA==", + "license": "ISC", + "optional": true, + "dependencies": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + } + }, + "node_modules/watchpack-chokidar2/node_modules/glob-parent/node_modules/is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw==", + "license": "MIT", + "optional": true, + "dependencies": { + "is-extglob": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack-chokidar2/node_modules/is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha512-9fRVlXc0uCxEDj1nQzaWONSpbTfx0FmJfzHF7pwlI8DkWGoHBBea4Pg5Ky0ojwwxQmnSifgbKkI06Qv0Ljgj+Q==", + "license": "MIT", + "optional": true, + "dependencies": { + "binary-extensions": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack-chokidar2/node_modules/readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/web-worker": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/web-worker/-/web-worker-1.3.0.tgz", + "integrity": "sha512-BSR9wyRsy/KOValMgd5kMyr3JzpdeoR9KVId8u5GVlTTAtNChlsE4yTxeY7zMdNSyOmoKBv8NH2qeRY9Tg+IaA==", + "license": "Apache-2.0" + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/webpack": { + "version": "4.47.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.47.0.tgz", + "integrity": "sha512-td7fYwgLSrky3fI1EuU5cneU4+pbH6GgOfuKNS1tNPcfdGinGELAqsb/BP4nnvZyKSG2i/xFGU7+n2PvZA8HJQ==", + "license": "MIT", + "dependencies": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-module-context": "1.9.0", + "@webassemblyjs/wasm-edit": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0", + "acorn": "^6.4.1", + "ajv": "^6.10.2", + "ajv-keywords": "^3.4.1", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^4.5.0", + "eslint-scope": "^4.0.3", + "json-parse-better-errors": "^1.0.2", + "loader-runner": "^2.4.0", + "loader-utils": "^1.2.3", + "memory-fs": "^0.4.1", + "micromatch": "^3.1.10", + "mkdirp": "^0.5.3", + "neo-async": "^2.6.1", + "node-libs-browser": "^2.2.1", + "schema-utils": "^1.0.0", + "tapable": "^1.1.3", + "terser-webpack-plugin": "^1.4.3", + "watchpack": "^1.7.4", + "webpack-sources": "^1.4.1" + }, + "bin": { + "webpack": "bin/webpack.js" + }, + "engines": { + "node": ">=6.11.5" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + }, + "webpack-command": { + "optional": true + } + } + }, + "node_modules/webpack-sources": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", + "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", + "license": "MIT", + "dependencies": { + "source-list-map": "^2.0.0", + "source-map": "~0.6.1" + } + }, + "node_modules/webpack/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "license": "MIT", + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/webpack/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "license": "MIT", + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/webpack/node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, + "node_modules/webpack/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "license": "MIT" + }, + "node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "license": "MIT", + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-url": { + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.2.0.tgz", + "integrity": "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==", + "license": "MIT", + "dependencies": { + "tr46": "^5.1.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.19", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz", + "integrity": "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==", + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/worker-farm": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz", + "integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==", + "license": "MIT", + "dependencies": { + "errno": "~0.1.7" + } + }, + "node_modules/worker-loader": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/worker-loader/-/worker-loader-2.0.0.tgz", + "integrity": "sha512-tnvNp4K3KQOpfRnD20m8xltE3eWh89Ye+5oj7wXEEHKac1P4oZ6p9oTj8/8ExqoSBnk9nu5Pr4nKfQ1hn2APJw==", + "license": "MIT", + "dependencies": { + "loader-utils": "^1.0.0", + "schema-utils": "^0.4.0" + }, + "engines": { + "node": ">= 6.9.0 || >= 8.9.0" + }, + "peerDependencies": { + "webpack": "^3.0.0 || ^4.0.0-alpha.0 || ^4.0.0" + } + }, + "node_modules/worker-loader/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "license": "MIT", + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/worker-loader/node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "license": "MIT", + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/worker-loader/node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, + "node_modules/worker-loader/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "license": "MIT" + }, + "node_modules/worker-loader/node_modules/schema-utils": { + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz", + "integrity": "sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==", + "license": "MIT", + "dependencies": { + "ajv": "^6.1.0", + "ajv-keywords": "^3.1.0" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/ws": { + "version": "8.18.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", + "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xml-name-validator": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", + "license": "Apache-2.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "license": "MIT" + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "license": "ISC" + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "license": "ISC" + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/package.json b/package.json index be93e825..52186772 100644 --- a/package.json +++ b/package.json @@ -5,12 +5,17 @@ "scripts": { "watch": "vite build --watch & vite preview &", "build": "vite build", - "preview": "vite preview" + "preview": "vite preview", + "test": "vitest", + "format:check": "prettier -c .", + "format:write": "prettier -w ." }, "dependencies": { + "@scratch/scratch-vm": "^12.3.0", "binaryen": "github:pufferfish101007/binaryen.js#non-nullable-table", "pinia": "2.1.3", "scratch-parser": "5.1.1", + "scratch-render": "github:hyperquark/scratch-render#develop", "scratch-sb1-converter": "2.0.228", "vite-plugin-wasm": "3.5.0", "vue": "3.5.21", @@ -19,7 +24,9 @@ }, "devDependencies": { "@vitejs/plugin-vue": "6.0.1", - "vite": "6.3.5", - "vite-plugin-node-polyfills": "0.24.0" + "prettier": "^3.7.4", + "vite": "7.3.0", + "vite-plugin-node-polyfills": "0.24.0", + "vitest": "^4.0.16" } } diff --git a/playground/App.vue b/playground/App.vue index c1d80239..841fd90a 100644 --- a/playground/App.vue +++ b/playground/App.vue @@ -1,6 +1,6 @@ to link to font-family - * // injected into the document: no effect. - * @param {string} svgString The string representation of the svg to modify - * @param {object} [customFontFaces] Object mapping custom font families to @font-face statements. - * @return {string} The svg with any needed fonts inlined - */ -const inlineSvgFonts = function (svgString, customFontFaces = {}) { - // Make it clear that this function only operates on strings. - // If we don't explicitly throw this here, the function silently fails. - if (typeof svgString !== 'string') { - throw new Error('SVG to be inlined is not a string'); - } - - const FONTS = {}; - if (customFontFaces && typeof customFontFaces === 'object') { - // The fonts in the document will be XML escaped - for (const [families, style] of Object.entries(customFontFaces)) { - FONTS[xmlEscape(families)] = style; - } - } - try { - // We already know these don't need to be XML escaped - Object.assign(FONTS, getFonts()); - } catch (e) { - // getFonts fails in tests because it uses some webpack tricks. This is safe to ignore. - } - - // Collect fonts that need injection. - const fontsNeeded = new Set(); - const fontRegex = /font-family="([^"]*)"/g; - let matches = fontRegex.exec(svgString); - while (matches) { - fontsNeeded.add(matches[1]); - matches = fontRegex.exec(svgString); - } - if (fontsNeeded.size > 0) { - let str = ''; - svgString = svgString.replace(/]*>/, `$&${str}`); - return svgString; - } - return svgString; -}; - -module.exports = inlineSvgFonts; - - -/***/ }), - -/***/ "./node_modules/scratch-svg-renderer/src/index.js": -/*!********************************************************!*\ - !*** ./node_modules/scratch-svg-renderer/src/index.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -const SVGRenderer = __webpack_require__(/*! ./svg-renderer */ "./node_modules/scratch-svg-renderer/src/svg-renderer.js"); -const BitmapAdapter = __webpack_require__(/*! ./bitmap-adapter */ "./node_modules/scratch-svg-renderer/src/bitmap-adapter.js"); -const inlineSvgFonts = __webpack_require__(/*! ./font-inliner */ "./node_modules/scratch-svg-renderer/src/font-inliner.js"); -const loadSvgString = __webpack_require__(/*! ./load-svg-string */ "./node_modules/scratch-svg-renderer/src/load-svg-string.js"); -const sanitizeSvg = __webpack_require__(/*! ./sanitize-svg */ "./node_modules/scratch-svg-renderer/src/sanitize-svg.js"); -const serializeSvgToString = __webpack_require__(/*! ./serialize-svg-to-string */ "./node_modules/scratch-svg-renderer/src/serialize-svg-to-string.js"); -const SvgElement = __webpack_require__(/*! ./svg-element */ "./node_modules/scratch-svg-renderer/src/svg-element.js"); -const convertFonts = __webpack_require__(/*! ./font-converter */ "./node_modules/scratch-svg-renderer/src/font-converter.js"); -// /** -// * Export for NPM & Node.js -// * @type {RenderWebGL} -// */ -module.exports = { - BitmapAdapter: BitmapAdapter, - convertFonts: convertFonts, - inlineSvgFonts: inlineSvgFonts, - loadSvgString: loadSvgString, - sanitizeSvg: sanitizeSvg, - serializeSvgToString: serializeSvgToString, - SvgElement: SvgElement, - SVGRenderer: SVGRenderer -}; - - -/***/ }), - -/***/ "./node_modules/scratch-svg-renderer/src/load-svg-string.js": -/*!******************************************************************!*\ - !*** ./node_modules/scratch-svg-renderer/src/load-svg-string.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -const DOMPurify = __webpack_require__(/*! dompurify */ "./node_modules/dompurify/dist/purify.js"); -const SvgElement = __webpack_require__(/*! ./svg-element */ "./node_modules/scratch-svg-renderer/src/svg-element.js"); -const convertFonts = __webpack_require__(/*! ./font-converter */ "./node_modules/scratch-svg-renderer/src/font-converter.js"); -const fixupSvgString = __webpack_require__(/*! ./fixup-svg-string */ "./node_modules/scratch-svg-renderer/src/fixup-svg-string.js"); -const transformStrokeWidths = __webpack_require__(/*! ./transform-applier */ "./node_modules/scratch-svg-renderer/src/transform-applier.js"); - -/** - * @param {SVGElement} svgTag the tag to search within - * @param {string} [tagName] svg tag to search for (or collect all elements if not given) - * @return {Array} a list of elements with the given tagname - */ -const collectElements = (svgTag, tagName) => { - const elts = []; - const collectElementsInner = domElement => { - if ((domElement.localName === tagName || typeof tagName === 'undefined') && domElement.getAttribute) { - elts.push(domElement); - } - for (let i = 0; i < domElement.childNodes.length; i++) { - collectElementsInner(domElement.childNodes[i]); - } - }; - collectElementsInner(svgTag); - return elts; -}; - -/** - * Fix SVGs to comply with SVG spec. Scratch 2 defaults to x2 = 0 when x2 is missing, but - * SVG defaults to x2 = 1 when missing. - * @param {SVGSVGElement} svgTag the SVG tag to apply the transformation to - */ -const transformGradients = svgTag => { - const linearGradientElements = collectElements(svgTag, 'linearGradient'); - - // For each gradient element, supply x2 if necessary. - for (const gradientElement of linearGradientElements) { - if (!gradientElement.getAttribute('x2')) { - gradientElement.setAttribute('x2', '0'); - } - } -}; - -/** - * Fix SVGs to match appearance in Scratch 2, which used nearest neighbor scaling for bitmaps - * within SVGs. - * @param {SVGSVGElement} svgTag the SVG tag to apply the transformation to - */ -const transformImages = svgTag => { - const imageElements = collectElements(svgTag, 'image'); - - // For each image element, set image rendering to pixelated - const pixelatedImages = 'image-rendering: optimizespeed; image-rendering: pixelated;'; - for (const elt of imageElements) { - if (elt.getAttribute('style')) { - elt.setAttribute('style', - `${pixelatedImages} ${elt.getAttribute('style')}`); - } else { - elt.setAttribute('style', pixelatedImages); - } - } -}; - -/** - * Transforms an SVG's text elements for Scratch 2.0 quirks. - * These quirks include: - * 1. `x` and `y` properties are removed/ignored. - * 2. Alignment is set to `text-before-edge`. - * 3. Line-breaks are converted to explicit elements. - * 4. Any required fonts are injected. - * @param {SVGSVGElement} svgTag the SVG tag to apply the transformation to - */ -const transformText = svgTag => { - // Collect all text elements into a list. - const textElements = []; - const collectText = domElement => { - if (domElement.localName === 'text') { - textElements.push(domElement); - } - for (let i = 0; i < domElement.childNodes.length; i++) { - collectText(domElement.childNodes[i]); - } - }; - collectText(svgTag); - convertFonts(svgTag); - // For each text element, apply quirks. - for (const textElement of textElements) { - // Remove x and y attributes - they are not used in Scratch. - textElement.removeAttribute('x'); - textElement.removeAttribute('y'); - // Set text-before-edge alignment: - // Scratch renders all text like this. - textElement.setAttribute('alignment-baseline', 'text-before-edge'); - textElement.setAttribute('xml:space', 'preserve'); - // If there's no font size provided, provide one. - if (!textElement.getAttribute('font-size')) { - textElement.setAttribute('font-size', '18'); - } - let text = textElement.textContent; - - // Fix line breaks in text, which are not natively supported by SVG. - // Only fix if text does not have child tspans. - // @todo this will not work for font sizes with units such as em, percent - // However, text made in scratch 2 should only ever export size 22 font. - const fontSize = parseFloat(textElement.getAttribute('font-size')); - const tx = 2; - let ty = 0; - let spacing = 1.2; - // Try to match the position and spacing of Scratch 2.0's fonts. - // Different fonts seem to use different line spacing. - // Scratch 2 always uses alignment-baseline=text-before-edge - // However, most SVG readers don't support this attribute - // or don't support it alongside use of tspan, so the translations - // here are to make up for that. - if (textElement.getAttribute('font-family') === 'Handwriting') { - spacing = 2; - ty = -11 * fontSize / 22; - } else if (textElement.getAttribute('font-family') === 'Scratch') { - spacing = 0.89; - ty = -3 * fontSize / 22; - } else if (textElement.getAttribute('font-family') === 'Curly') { - spacing = 1.38; - ty = -6 * fontSize / 22; - } else if (textElement.getAttribute('font-family') === 'Marker') { - spacing = 1.45; - ty = -6 * fontSize / 22; - } else if (textElement.getAttribute('font-family') === 'Sans Serif') { - spacing = 1.13; - ty = -3 * fontSize / 22; - } else if (textElement.getAttribute('font-family') === 'Serif') { - spacing = 1.25; - ty = -4 * fontSize / 22; - } - - if (textElement.transform.baseVal.numberOfItems === 0) { - const transform = svgTag.createSVGTransform(); - textElement.transform.baseVal.appendItem(transform); - } - - // Right multiply matrix by a translation of (tx, ty) - const mtx = textElement.transform.baseVal.getItem(0).matrix; - mtx.e += (mtx.a * tx) + (mtx.c * ty); - mtx.f += (mtx.b * tx) + (mtx.d * ty); - - if (text && textElement.childElementCount === 0) { - textElement.textContent = ''; - const lines = text.split('\n'); - text = ''; - for (const line of lines) { - const tspanNode = SvgElement.create('tspan'); - tspanNode.setAttribute('x', '0'); - tspanNode.setAttribute('style', 'white-space: pre'); - tspanNode.setAttribute('dy', `${spacing}em`); - tspanNode.textContent = line ? line : ' '; - textElement.appendChild(tspanNode); - } - } - } -}; - -/** - * Find the largest stroke width in the svg. If a shape has no - * `stroke` property, it has a stroke-width of 0. If it has a `stroke`, - * it is by default a stroke-width of 1. - * This is used to enlarge the computed bounding box, which doesn't take - * stroke width into account. - * @param {SVGSVGElement} rootNode The root SVG node to traverse. - * @return {number} The largest stroke width in the SVG. - */ -const findLargestStrokeWidth = rootNode => { - let largestStrokeWidth = 0; - const collectStrokeWidths = domElement => { - if (domElement.getAttribute) { - if (domElement.getAttribute('stroke')) { - largestStrokeWidth = Math.max(largestStrokeWidth, 1); - } - if (domElement.getAttribute('stroke-width')) { - largestStrokeWidth = Math.max( - largestStrokeWidth, - Number(domElement.getAttribute('stroke-width')) || 0 - ); - } - } - for (let i = 0; i < domElement.childNodes.length; i++) { - collectStrokeWidths(domElement.childNodes[i]); - } - }; - collectStrokeWidths(rootNode); - return largestStrokeWidth; -}; - -/** - * Transform the measurements of the SVG. - * In Scratch 2.0, SVGs are drawn without respect to the width, - * height, and viewBox attribute on the tag. The exporter - * does output these properties - but they appear to be incorrect often. - * To address the incorrect measurements, we append the DOM to the - * document, and then use SVG's native `getBBox` to find the real - * drawn dimensions. This ensures things drawn in negative dimensions, - * outside the given viewBox, etc., are all eventually drawn to the canvas. - * I tried to do this several other ways: stripping the width/height/viewBox - * attributes and then drawing (Firefox won't draw anything), - * or inflating them and then measuring a canvas. But this seems to be - * a natural and performant way. - * @param {SVGSVGElement} svgTag the SVG tag to apply the transformation to - */ -const transformMeasurements = svgTag => { - // Append the SVG dom to the document. - // This allows us to use `getBBox` on the page, - // which returns the full bounding-box of all drawn SVG - // elements, similar to how Scratch 2.0 did measurement. - const svgSpot = document.createElement('span'); - // Since we're adding user-provided SVG to document.body, - // sanitizing is required. This should not affect bounding box calculation. - // outerHTML is attribute of Element (and not HTMLElement), so use it instead of - // calling serializer or toString() - // NOTE: svgTag remains untouched! - const rawValue = svgTag.outerHTML; - const sanitizedValue = DOMPurify.sanitize(rawValue, { - // Use SVG profile (no HTML elements) - USE_PROFILES: {svg: true}, - // Remove some tags that Scratch does not use. - FORBID_TAGS: ['a', 'audio', 'canvas', 'video'], - // Allow data URI in image tags (e.g. SVGs converted from bitmap) - ADD_DATA_URI_TAGS: ['image'] - }); - let bbox; - try { - // Insert sanitized value. - svgSpot.innerHTML = sanitizedValue; - document.body.appendChild(svgSpot); - // Take the bounding box. We have to get elements via svgSpot - // because we added it via innerHTML. - bbox = svgSpot.children[0].getBBox(); - } finally { - // Always destroy the element, even if, for example, getBBox throws. - document.body.removeChild(svgSpot); - } - - // Enlarge the bbox from the largest found stroke width - // This may have false-positives, but at least the bbox will always - // contain the full graphic including strokes. - // If the width or height is zero however, don't enlarge since - // they won't have a stroke width that needs to be enlarged. - let halfStrokeWidth; - if (bbox.width === 0 || bbox.height === 0) { - halfStrokeWidth = 0; - } else { - halfStrokeWidth = findLargestStrokeWidth(svgTag) / 2; - } - const width = bbox.width + (halfStrokeWidth * 2); - const height = bbox.height + (halfStrokeWidth * 2); - const x = bbox.x - halfStrokeWidth; - const y = bbox.y - halfStrokeWidth; - - // Set the correct measurements on the SVG tag - svgTag.setAttribute('width', width); - svgTag.setAttribute('height', height); - svgTag.setAttribute('viewBox', - `${x} ${y} ${width} ${height}`); -}; - -/** - * Find all instances of a URL-referenced `stroke` in the svg. In 2.0, all gradient strokes - * have a round `stroke-linejoin` and `stroke-linecap`... for some reason. - * @param {SVGSVGElement} svgTag the SVG tag to apply the transformation to - */ -const setGradientStrokeRoundedness = svgTag => { - const elements = collectElements(svgTag); - - for (const elt of elements) { - if (!elt.style) continue; - const stroke = elt.style.stroke || elt.getAttribute('stroke'); - if (stroke && stroke.match(/^url\(#.*\)$/)) { - elt.style['stroke-linejoin'] = 'round'; - elt.style['stroke-linecap'] = 'round'; - } - } -}; - -/** - * In-place, convert passed SVG to something consistent that will be rendered the way we want them to be. - * @param {SVGSvgElement} svgTag root SVG node to operate upon - * @param {boolean} [fromVersion2] True if we should perform conversion from version 2 to version 3 svg. - */ -const normalizeSvg = (svgTag, fromVersion2) => { - if (fromVersion2) { - // Fix gradients. Scratch 2 exports no x2 when x2 = 0, but - // SVG default is that x2 is 1. This must be done before - // transformStrokeWidths since transformStrokeWidths affects - // gradients. - transformGradients(svgTag); - } - transformStrokeWidths(svgTag, window); - transformImages(svgTag); - if (fromVersion2) { - // Transform all text elements. - transformText(svgTag); - // Transform measurements. - transformMeasurements(svgTag); - // Fix stroke roundedness. - setGradientStrokeRoundedness(svgTag); - } else if (!svgTag.getAttribute('viewBox')) { - // Renderer expects a view box. - transformMeasurements(svgTag); - } else if (!svgTag.getAttribute('width') || !svgTag.getAttribute('height')) { - svgTag.setAttribute('width', svgTag.viewBox.baseVal.width); - svgTag.setAttribute('height', svgTag.viewBox.baseVal.height); - } -}; - -/** - * Load an SVG string and normalize it. All the steps before drawing/measuring. - * Currently, this will normalize stroke widths (see transform-applier.js) and render all embedded images pixelated. - * The returned SVG will be guaranteed to always have a `width`, `height` and `viewBox`. - * In addition, if the `fromVersion2` parameter is `true`, several "quirks-mode" transformations will be applied which - * mimic Scratch 2.0's SVG rendering. - * @param {!string} svgString String of SVG data to draw in quirks-mode. - * @param {boolean} [fromVersion2] True if we should perform conversion from version 2 to version 3 svg. - * @return {SVGSVGElement} The normalized SVG element. - */ -const loadSvgString = (svgString, fromVersion2) => { - // Parse string into SVG XML. - const parser = new DOMParser(); - svgString = fixupSvgString(svgString); - const svgDom = parser.parseFromString(svgString, 'text/xml'); - if (svgDom.childNodes.length < 1 || - svgDom.documentElement.localName !== 'svg') { - throw new Error('Document does not appear to be SVG.'); - } - const svgTag = svgDom.documentElement; - normalizeSvg(svgTag, fromVersion2); - return svgTag; -}; - -module.exports = loadSvgString; - - -/***/ }), - -/***/ "./node_modules/scratch-svg-renderer/src/sanitize-svg.js": -/*!***************************************************************!*\ - !*** ./node_modules/scratch-svg-renderer/src/sanitize-svg.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @fileOverview Sanitize the content of an SVG aggressively, to make it as safe - * as possible - */ -const fixupSvgString = __webpack_require__(/*! ./fixup-svg-string */ "./node_modules/scratch-svg-renderer/src/fixup-svg-string.js"); -const {generate, parse, walk} = __webpack_require__(/*! css-tree */ "./node_modules/css-tree/lib/index.js"); -const DOMPurify = __webpack_require__(/*! dompurify */ "./node_modules/dompurify/dist/purify.js"); - -const sanitizeSvg = {}; - -DOMPurify.addHook( - 'beforeSanitizeAttributes', - currentNode => { - - if (currentNode && currentNode.href && currentNode.href.baseVal) { - const href = currentNode.href.baseVal.replace(/\s/g, ''); - // "data:" and "#" are valid hrefs - if ((href.slice(0, 5) !== 'data:') && (href.slice(0, 1) !== '#')) { - - if (currentNode.attributes.getNamedItem('xlink:href')) { - currentNode.attributes.removeNamedItem('xlink:href'); - delete currentNode['xlink:href']; - } - if (currentNode.attributes.getNamedItem('href')) { - currentNode.attributes.removeNamedItem('href'); - delete currentNode.href; - } - } - } - return currentNode; - } -); - -DOMPurify.addHook( - 'uponSanitizeElement', - (node, data) => { - if (data.tagName === 'style') { - const ast = parse(node.textContent); - let isModified = false; - // Remove any @import rules as it could leak HTTP requests - walk(ast, (astNode, item, list) => { - if (astNode.type === 'Atrule' && astNode.name === 'import') { - list.remove(item); - isModified = true; - } - }); - if (isModified) { - node.textContent = generate(ast); - } - } - } -); - -// Use JS implemented TextDecoder and TextEncoder if it is not provided by the -// browser. -let _TextDecoder; -let _TextEncoder; -if (typeof TextDecoder === 'undefined' || typeof TextEncoder === 'undefined') { - // Wait to require the text encoding polyfill until we know it's needed. - // eslint-disable-next-line global-require - const encoding = __webpack_require__(/*! fastestsmallesttextencoderdecoder */ "./node_modules/fastestsmallesttextencoderdecoder/EncoderDecoderTogether.min.js"); - _TextDecoder = encoding.TextDecoder; - _TextEncoder = encoding.TextEncoder; -} else { - _TextDecoder = TextDecoder; - _TextEncoder = TextEncoder; -} - -/** - * Load an SVG Uint8Array of bytes and "sanitize" it - * @param {!Uint8Array} rawData unsanitized SVG daata - * @return {Uint8Array} sanitized SVG data - */ -sanitizeSvg.sanitizeByteStream = function (rawData) { - const decoder = new _TextDecoder(); - const encoder = new _TextEncoder(); - const sanitizedText = sanitizeSvg.sanitizeSvgText(decoder.decode(rawData)); - return encoder.encode(sanitizedText); -}; - -// TW: Don't remove extra metadata tag: -// Using literal HTML comments tokens will cause this script to be very hard to inline in -// a - // - // Has one line before it which is invalid according to GLSL ES 3.00 - // - - var lineOffset = 0; - - if (spaceRE.test(shaderSource)) { - lineOffset = 1; - shaderSource = shaderSource.replace(spaceRE, ''); - } // Load the shader source - - - gl.shaderSource(shader, shaderSource); // Compile the shader - - gl.compileShader(shader); // Check the compile status - - var compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS); - - if (!compiled) { - // Something went wrong during compilation; get the error - var lastError = gl.getShaderInfoLog(shader); - errFn(addLineNumbers(shaderSource, lineOffset) + "\n*** Error compiling shader: " + lastError); - gl.deleteShader(shader); - return null; - } - - return shader; -} -/** - * @typedef {Object} ProgramOptions - * @property {function(string)} [errorCallback] callback for errors - * @property {Object.} [attribLocations] a attribute name to location map - * @property {(module:twgl.BufferInfo|Object.|string[])} [transformFeedbackVaryings] If passed - * a BufferInfo will use the attribs names inside. If passed an object of AttribInfos will use the names from that object. Otherwise - * you can pass an array of names. - * @property {number} [transformFeedbackMode] the mode to pass `gl.transformFeedbackVaryings`. Defaults to `SEPARATE_ATTRIBS`. - * @memberOf module:twgl - */ - -/** - * Gets the program options based on all these optional arguments - * @param {module:twgl.ProgramOptions|string[]} [opt_attribs] Options for the program or an array of attribs names. Locations will be assigned by index if not passed in - * @param {number[]} [opt_locations] The locations for the. A parallel array to opt_attribs letting you assign locations. - * @param {module:twgl.ErrorCallback} [opt_errorCallback] callback for errors. By default it just prints an error to the console - * on error. If you want something else pass an callback. It's passed an error message. - * @return {module:twgl.ProgramOptions} an instance of ProgramOptions based on the arguments pased on - */ - - -function getProgramOptions(opt_attribs, opt_locations, opt_errorCallback) { - var transformFeedbackVaryings; - - if (typeof opt_locations === 'function') { - opt_errorCallback = opt_locations; - opt_locations = undefined; - } - - if (typeof opt_attribs === 'function') { - opt_errorCallback = opt_attribs; - opt_attribs = undefined; - } else if (opt_attribs && !Array.isArray(opt_attribs)) { - // If we have an errorCallback we can just return this object - // Otherwise we need to construct one with default errorCallback - if (opt_attribs.errorCallback) { - return opt_attribs; - } - - var opt = opt_attribs; - opt_errorCallback = opt.errorCallback; - opt_attribs = opt.attribLocations; - transformFeedbackVaryings = opt.transformFeedbackVaryings; - } - - var options = { - errorCallback: opt_errorCallback || error, - transformFeedbackVaryings: transformFeedbackVaryings - }; - - if (opt_attribs) { - var attribLocations = {}; - - if (Array.isArray(opt_attribs)) { - opt_attribs.forEach(function (attrib, ndx) { - attribLocations[attrib] = opt_locations ? opt_locations[ndx] : ndx; - }); - } else { - attribLocations = opt_attribs; - } - - options.attribLocations = attribLocations; - } - - return options; -} - -var defaultShaderType = ["VERTEX_SHADER", "FRAGMENT_SHADER"]; - -function getShaderTypeFromScriptType(scriptType) { - if (scriptType.indexOf("frag") >= 0) { - return gl.FRAGMENT_SHADER; - } else if (scriptType.indexOf("vert") >= 0) { - return gl.VERTEX_SHADER; - } - - return undefined; -} - -function deleteShaders(gl, shaders) { - shaders.forEach(function (shader) { - gl.deleteShader(shader); - }); -} -/** - * Creates a program, attaches (and/or compiles) shaders, binds attrib locations, links the - * program and calls useProgram. - * - * NOTE: There are 4 signatures for this function - * - * twgl.createProgram(gl, [vs, fs], options); - * twgl.createProgram(gl, [vs, fs], opt_errFunc); - * twgl.createProgram(gl, [vs, fs], opt_attribs, opt_errFunc); - * twgl.createProgram(gl, [vs, fs], opt_attribs, opt_locations, opt_errFunc); - * - * @param {WebGLShader[]|string[]} shaders The shaders to attach, or element ids for their source, or strings that contain their source - * @param {module:twgl.ProgramOptions|string[]} [opt_attribs] Options for the program or an array of attribs names. Locations will be assigned by index if not passed in - * @param {number[]} [opt_locations] The locations for the. A parallel array to opt_attribs letting you assign locations. - * @param {module:twgl.ErrorCallback} [opt_errorCallback] callback for errors. By default it just prints an error to the console - * on error. If you want something else pass an callback. It's passed an error message. - * @return {WebGLProgram?} the created program or null if error. - * @memberOf module:twgl/programs - */ - - -function createProgram(gl, shaders, opt_attribs, opt_locations, opt_errorCallback) { - var progOptions = getProgramOptions(opt_attribs, opt_locations, opt_errorCallback); - var realShaders = []; - var newShaders = []; - - for (var ndx = 0; ndx < shaders.length; ++ndx) { - var shader = shaders[ndx]; - - if (typeof shader === 'string') { - var elem = getElementById(shader); - var src = elem ? elem.text : shader; - var type = gl[defaultShaderType[ndx]]; - - if (elem && elem.type) { - type = getShaderTypeFromScriptType(elem.type) || type; - } - - shader = loadShader(gl, src, type, progOptions.errorCallback); - newShaders.push(shader); - } - - if (helper.isShader(gl, shader)) { - realShaders.push(shader); - } - } - - if (realShaders.length !== shaders.length) { - progOptions.errorCallback("not enough shaders for program"); - deleteShaders(gl, newShaders); - return null; - } - - var program = gl.createProgram(); - realShaders.forEach(function (shader) { - gl.attachShader(program, shader); - }); - - if (progOptions.attribLocations) { - Object.keys(progOptions.attribLocations).forEach(function (attrib) { - gl.bindAttribLocation(program, progOptions.attribLocations[attrib], attrib); - }); - } - - var varyings = progOptions.transformFeedbackVaryings; - - if (varyings) { - if (varyings.attribs) { - varyings = varyings.attribs; - } - - if (!Array.isArray(varyings)) { - varyings = Object.keys(varyings); - } - - gl.transformFeedbackVaryings(program, varyings, progOptions.transformFeedbackMode || gl.SEPARATE_ATTRIBS); - } - - gl.linkProgram(program); // Check the link status - - var linked = gl.getProgramParameter(program, gl.LINK_STATUS); - - if (!linked) { - // something went wrong with the link - var lastError = gl.getProgramInfoLog(program); - progOptions.errorCallback("Error in program linking:" + lastError); - gl.deleteProgram(program); - deleteShaders(gl, newShaders); - return null; - } - - return program; -} -/** - * Loads a shader from a script tag. - * @param {WebGLRenderingContext} gl The WebGLRenderingContext to use. - * @param {string} scriptId The id of the script tag. - * @param {number} [opt_shaderType] The type of shader. If not passed in it will - * be derived from the type of the script tag. - * @param {module:twgl.ErrorCallback} [opt_errorCallback] callback for errors. - * @return {WebGLShader?} The created shader or null if error. - */ - - -function createShaderFromScript(gl, scriptId, opt_shaderType, opt_errorCallback) { - var shaderSource = ""; - var shaderScript = getElementById(scriptId); - - if (!shaderScript) { - throw "*** Error: unknown script element" + scriptId; - } - - shaderSource = shaderScript.text; - var shaderType = opt_shaderType || getShaderTypeFromScriptType(shaderScript.type); - - if (!shaderType) { - throw "*** Error: unknown shader type"; - } - - return loadShader(gl, shaderSource, shaderType, opt_errorCallback); -} -/** - * Creates a program from 2 script tags. - * - * NOTE: There are 4 signatures for this function - * - * twgl.createProgramFromScripts(gl, [vs, fs], opt_options); - * twgl.createProgramFromScripts(gl, [vs, fs], opt_errFunc); - * twgl.createProgramFromScripts(gl, [vs, fs], opt_attribs, opt_errFunc); - * twgl.createProgramFromScripts(gl, [vs, fs], opt_attribs, opt_locations, opt_errFunc); - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext - * to use. - * @param {string[]} shaderScriptIds Array of ids of the script - * tags for the shaders. The first is assumed to be the - * vertex shader, the second the fragment shader. - * @param {string[]} [opt_attribs] An array of attribs names. Locations will be assigned by index if not passed in - * @param {number[]} [opt_locations] The locations for the. A parallel array to opt_attribs letting you assign locations. - * @param {module:twgl.ErrorCallback} opt_errorCallback callback for errors. By default it just prints an error to the console - * on error. If you want something else pass an callback. It's passed an error message. - * @return {WebGLProgram} The created program. - * @memberOf module:twgl/programs - */ - - -function createProgramFromScripts(gl, shaderScriptIds, opt_attribs, opt_locations, opt_errorCallback) { - var progOptions = getProgramOptions(opt_attribs, opt_locations, opt_errorCallback); - var shaders = []; - - for (var ii = 0; ii < shaderScriptIds.length; ++ii) { - var shader = createShaderFromScript(gl, shaderScriptIds[ii], gl[defaultShaderType[ii]], progOptions.errorCallback); - - if (!shader) { - return null; - } - - shaders.push(shader); - } - - return createProgram(gl, shaders, progOptions); -} -/** - * Creates a program from 2 sources. - * - * NOTE: There are 4 signatures for this function - * - * twgl.createProgramFromSource(gl, [vs, fs], opt_options); - * twgl.createProgramFromSource(gl, [vs, fs], opt_errFunc); - * twgl.createProgramFromSource(gl, [vs, fs], opt_attribs, opt_errFunc); - * twgl.createProgramFromSource(gl, [vs, fs], opt_attribs, opt_locations, opt_errFunc); - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext - * to use. - * @param {string[]} shaderSources Array of sources for the - * shaders. The first is assumed to be the vertex shader, - * the second the fragment shader. - * @param {string[]} [opt_attribs] An array of attribs names. Locations will be assigned by index if not passed in - * @param {number[]} [opt_locations] The locations for the. A parallel array to opt_attribs letting you assign locations. - * @param {module:twgl.ErrorCallback} opt_errorCallback callback for errors. By default it just prints an error to the console - * on error. If you want something else pass an callback. It's passed an error message. - * @return {WebGLProgram} The created program. - * @memberOf module:twgl/programs - */ - - -function createProgramFromSources(gl, shaderSources, opt_attribs, opt_locations, opt_errorCallback) { - var progOptions = getProgramOptions(opt_attribs, opt_locations, opt_errorCallback); - var shaders = []; - - for (var ii = 0; ii < shaderSources.length; ++ii) { - var shader = loadShader(gl, shaderSources[ii], gl[defaultShaderType[ii]], progOptions.errorCallback); - - if (!shader) { - return null; - } - - shaders.push(shader); - } - - return createProgram(gl, shaders, progOptions); -} -/** - * Returns true if attribute/uniform is a reserved/built in - * - * It makes no sense to me why GL returns these because it's - * illegal to call `gl.getUniformLocation` and `gl.getAttribLocation` - * with names that start with `gl_` (and `webgl_` in WebGL) - * - * I can only assume they are there because they might count - * when computing the number of uniforms/attributes used when you want to - * know if you are near the limit. That doesn't really make sense - * to me but the fact that these get returned are in the spec. - * - * @param {WebGLActiveInfo} info As returned from `gl.getActiveUniform` or - * `gl.getActiveAttrib`. - * @return {bool} true if it's reserved - */ - - -function isBuiltIn(info) { - var name = info.name; - return name.startsWith("gl_") || name.startsWith("webgl_"); -} -/** - * Creates setter functions for all uniforms of a shader - * program. - * - * @see {@link module:twgl.setUniforms} - * - * @param {WebGLProgram} program the program to create setters for. - * @returns {Object.} an object with a setter by name for each uniform - * @memberOf module:twgl/programs - */ - - -function createUniformSetters(gl, program) { - var textureUnit = 0; - /** - * Creates a setter for a uniform of the given program with it's - * location embedded in the setter. - * @param {WebGLProgram} program - * @param {WebGLUniformInfo} uniformInfo - * @returns {function} the created setter. - */ - - function createUniformSetter(program, uniformInfo) { - var location = gl.getUniformLocation(program, uniformInfo.name); - var isArray = uniformInfo.size > 1 && uniformInfo.name.substr(-3) === "[0]"; - var type = uniformInfo.type; - var typeInfo = typeMap[type]; - - if (!typeInfo) { - throw "unknown type: 0x" + type.toString(16); // we should never get here. - } - - var setter; - - if (typeInfo.bindPoint) { - // it's a sampler - var unit = textureUnit; - textureUnit += uniformInfo.size; - - if (isArray) { - setter = typeInfo.arraySetter(gl, type, unit, location, uniformInfo.size); - } else { - setter = typeInfo.setter(gl, type, unit, location, uniformInfo.size); - } - } else { - if (typeInfo.arraySetter && isArray) { - setter = typeInfo.arraySetter(gl, location); - } else { - setter = typeInfo.setter(gl, location); - } - } - - setter.location = location; - return setter; - } - - var uniformSetters = {}; - var numUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS); - - for (var ii = 0; ii < numUniforms; ++ii) { - var uniformInfo = gl.getActiveUniform(program, ii); - - if (isBuiltIn(uniformInfo)) { - continue; - } - - var name = uniformInfo.name; // remove the array suffix. - - if (name.substr(-3) === "[0]") { - name = name.substr(0, name.length - 3); - } - - var setter = createUniformSetter(program, uniformInfo); - uniformSetters[name] = setter; - } - - return uniformSetters; -} -/** - * @typedef {Object} TransformFeedbackInfo - * @property {number} index index of transform feedback - * @property {number} type GL type - * @property {number} size 1 - 4 - * @memberOf module:twgl - */ - -/** - * Create TransformFeedbackInfo for passing to bind/unbindTransformFeedbackInfo. - * @param {WebGLRenderingContext} gl The WebGLRenderingContext to use. - * @param {WebGLProgram} program an existing WebGLProgram. - * @return {Object} - * @memberOf module:twgl - */ - - -function createTransformFeedbackInfo(gl, program) { - var info = {}; - var numVaryings = gl.getProgramParameter(program, gl.TRANSFORM_FEEDBACK_VARYINGS); - - for (var ii = 0; ii < numVaryings; ++ii) { - var varying = gl.getTransformFeedbackVarying(program, ii); - info[varying.name] = { - index: ii, - type: varying.type, - size: varying.size - }; - } - - return info; -} -/** - * Binds buffers for transform feedback. - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext to use. - * @param {(module:twgl.ProgramInfo|Object)} transformFeedbackInfo A ProgramInfo or TransformFeedbackInfo. - * @param {(module:twgl.BufferInfo|Object)} [bufferInfo] A BufferInfo or set of AttribInfos. - * @memberOf module:twgl - */ - - -function bindTransformFeedbackInfo(gl, transformFeedbackInfo, bufferInfo) { - if (transformFeedbackInfo.transformFeedbackInfo) { - transformFeedbackInfo = transformFeedbackInfo.transformFeedbackInfo; - } - - if (bufferInfo.attribs) { - bufferInfo = bufferInfo.attribs; - } - - for (var name in bufferInfo) { - var varying = transformFeedbackInfo[name]; - - if (varying) { - var buf = bufferInfo[name]; - - if (buf.offset) { - gl.bindBufferRange(gl.TRANSFORM_FEEDBACK_BUFFER, varying.index, buf.buffer, buf.offset, buf.size); - } else { - gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, varying.index, buf.buffer); - } - } - } -} -/** - * Unbinds buffers afetr transform feedback. - * - * Buffers can not be bound to 2 bind points so if you try to bind a buffer used - * in a transform feedback as an ARRAY_BUFFER for an attribute it will fail. - * - * This function unbinds all buffers that were bound with {@link module:twgl.bindTransformFeedbackInfo}. - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext to use. - * @param {(module:twgl.ProgramInfo|Object)} transformFeedbackInfo A ProgramInfo or TransformFeedbackInfo. - * @param {(module:twgl.BufferInfo|Object)} [bufferInfo] A BufferInfo or set of AttribInfos. - */ - - -function unbindTransformFeedbackInfo(gl, transformFeedbackInfo, bufferInfo) { - if (transformFeedbackInfo.transformFeedbackInfo) { - transformFeedbackInfo = transformFeedbackInfo.transformFeedbackInfo; - } - - if (bufferInfo.attribs) { - bufferInfo = bufferInfo.attribs; - } - - for (var name in bufferInfo) { - var varying = transformFeedbackInfo[name]; - - if (varying) { - gl.bindBufferBase(gl.TRANSFORM_FEEDBACK_BUFFER, varying.index, null); - } - } -} -/** - * Creates a transform feedback and sets the buffers - * @param {WebGLRenderingContext} gl The WebGLRenderingContext to use. - * @param {module:twgl.ProgramInfo} programInfo A ProgramInfo as returned from {@link module:twgl.createProgramInfo} - * @param {(module:twgl.BufferInfo|Object)} [bufferInfo] A BufferInfo or set of AttribInfos. - * @return {WebGLTransformFeedback} the created transform feedback - * @memberOf module:twgl - */ - - -function createTransformFeedback(gl, programInfo, bufferInfo) { - var tf = gl.createTransformFeedback(); - gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, tf); - gl.useProgram(programInfo.program); - bindTransformFeedbackInfo(gl, programInfo, bufferInfo); - gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, null); // This is only needed because of a bug in Chrome 56. Will remove - // when chrome fixes it. - - unbindTransformFeedbackInfo(gl, programInfo, bufferInfo); - return tf; -} -/** - * @typedef {Object} UniformData - * @property {number} type The WebGL type enum for this uniform - * @property {number} size The number of elements for this uniform - * @property {number} blockNdx The block index this uniform appears in - * @property {number} offset The byte offset in the block for this uniform's value - * @memberOf module:twgl - */ - -/** - * The specification for one UniformBlockObject - * - * @typedef {Object} BlockSpec - * @property {number} index The index of the block. - * @property {number} size The size in bytes needed for the block - * @property {number[]} uniformIndices The indices of the uniforms used by the block. These indices - * correspond to entries in a UniformData array in the {@link module:twgl.UniformBlockSpec}. - * @property {bool} usedByVertexShader Self explanitory - * @property {bool} usedByFragmentShader Self explanitory - * @property {bool} used Self explanitory - * @memberOf module:twgl - */ - -/** - * A `UniformBlockSpec` represents the data needed to create and bind - * UniformBlockObjects for a given program - * - * @typedef {Object} UniformBlockSpec - * @property {Object. blockSpecs The BlockSpec for each block by block name - * @property {UniformData[]} uniformData An array of data for each uniform by uniform index. - * @memberOf module:twgl - */ - -/** - * Creates a UniformBlockSpec for the given program. - * - * A UniformBlockSpec represents the data needed to create and bind - * UniformBlockObjects - * - * @param {WebGL2RenderingContext} gl A WebGL2 Rendering Context - * @param {WebGLProgram} program A WebGLProgram for a successfully linked program - * @return {module:twgl.UniformBlockSpec} The created UniformBlockSpec - * @memberOf module:twgl/programs - */ - - -function createUniformBlockSpecFromProgram(gl, program) { - var numUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS); - var uniformData = []; - var uniformIndices = []; - - for (var ii = 0; ii < numUniforms; ++ii) { - uniformIndices.push(ii); - uniformData.push({}); - var uniformInfo = gl.getActiveUniform(program, ii); - - if (isBuiltIn(uniformInfo)) { - break; - } // REMOVE [0]? - - - uniformData[ii].name = uniformInfo.name; - } - - [["UNIFORM_TYPE", "type"], ["UNIFORM_SIZE", "size"], // num elements - ["UNIFORM_BLOCK_INDEX", "blockNdx"], ["UNIFORM_OFFSET", "offset"]].forEach(function (pair) { - var pname = pair[0]; - var key = pair[1]; - gl.getActiveUniforms(program, uniformIndices, gl[pname]).forEach(function (value, ndx) { - uniformData[ndx][key] = value; - }); - }); - var blockSpecs = {}; - var numUniformBlocks = gl.getProgramParameter(program, gl.ACTIVE_UNIFORM_BLOCKS); - - for (var _ii = 0; _ii < numUniformBlocks; ++_ii) { - var name = gl.getActiveUniformBlockName(program, _ii); - var blockSpec = { - index: _ii, - usedByVertexShader: gl.getActiveUniformBlockParameter(program, _ii, gl.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER), - usedByFragmentShader: gl.getActiveUniformBlockParameter(program, _ii, gl.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER), - size: gl.getActiveUniformBlockParameter(program, _ii, gl.UNIFORM_BLOCK_DATA_SIZE), - uniformIndices: gl.getActiveUniformBlockParameter(program, _ii, gl.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES) - }; - blockSpec.used = blockSpec.usedByVertexSahder || blockSpec.usedByFragmentShader; - blockSpecs[name] = blockSpec; - } - - return { - blockSpecs: blockSpecs, - uniformData: uniformData - }; -} - -var arraySuffixRE = /\[\d+\]\.$/; // better way to check? - -/** - * Represents a UniformBlockObject including an ArrayBuffer with all the uniform values - * and a corresponding WebGLBuffer to hold those values on the GPU - * - * @typedef {Object} UniformBlockInfo - * @property {string} name The name of the block - * @property {ArrayBuffer} array The array buffer that contains the uniform values - * @property {Float32Array} asFloat A float view on the array buffer. This is useful - * inspecting the contents of the buffer in the debugger. - * @property {WebGLBuffer} buffer A WebGL buffer that will hold a copy of the uniform values for rendering. - * @property {number} [offset] offset into buffer - * @property {Object.} uniforms A uniform name to ArrayBufferView map. - * each Uniform has a correctly typed `ArrayBufferView` into array at the correct offset - * and length of that uniform. So for example a float uniform would have a 1 float `Float32Array` - * view. A single mat4 would have a 16 element `Float32Array` view. An ivec2 would have an - * `Int32Array` view, etc. - * @memberOf module:twgl - */ - -/** - * Creates a `UniformBlockInfo` for the specified block - * - * Note: **If the blockName matches no existing blocks a warning is printed to the console and a dummy - * `UniformBlockInfo` is returned**. This is because when debugging GLSL - * it is common to comment out large portions of a shader or for example set - * the final output to a constant. When that happens blocks get optimized out. - * If this function did not create dummy blocks your code would crash when debugging. - * - * @param {WebGL2RenderingContext} gl A WebGL2RenderingContext - * @param {WebGLProgram} program A WebGLProgram - * @param {module:twgl.UniformBlockSpec} uinformBlockSpec. A UniformBlockSpec as returned - * from {@link module:twgl.createUniformBlockSpecFromProgram}. - * @param {string} blockName The name of the block. - * @return {module:twgl.UniformBlockInfo} The created UniformBlockInfo - * @memberOf module:twgl/programs - */ - -function createUniformBlockInfoFromProgram(gl, program, uniformBlockSpec, blockName) { - var blockSpecs = uniformBlockSpec.blockSpecs; - var uniformData = uniformBlockSpec.uniformData; - var blockSpec = blockSpecs[blockName]; - - if (!blockSpec) { - warn("no uniform block object named:", blockName); - return { - name: blockName, - uniforms: {} - }; - } - - var array = new ArrayBuffer(blockSpec.size); - var buffer = gl.createBuffer(); - var uniformBufferIndex = blockSpec.index; - gl.bindBuffer(gl.UNIFORM_BUFFER, buffer); - gl.uniformBlockBinding(program, blockSpec.index, uniformBufferIndex); - var prefix = blockName + "."; - - if (arraySuffixRE.test(prefix)) { - prefix = prefix.replace(arraySuffixRE, "."); - } - - var uniforms = {}; - blockSpec.uniformIndices.forEach(function (uniformNdx) { - var data = uniformData[uniformNdx]; - var typeInfo = typeMap[data.type]; - var Type = typeInfo.Type; - var length = data.size * typeInfo.size; - var name = data.name; - - if (name.substr(0, prefix.length) === prefix) { - name = name.substr(prefix.length); - } - - uniforms[name] = new Type(array, data.offset, length / Type.BYTES_PER_ELEMENT); - }); - return { - name: blockName, - array: array, - asFloat: new Float32Array(array), - // for debugging - buffer: buffer, - uniforms: uniforms - }; -} -/** - * Creates a `UniformBlockInfo` for the specified block - * - * Note: **If the blockName matches no existing blocks a warning is printed to the console and a dummy - * `UniformBlockInfo` is returned**. This is because when debugging GLSL - * it is common to comment out large portions of a shader or for example set - * the final output to a constant. When that happens blocks get optimized out. - * If this function did not create dummy blocks your code would crash when debugging. - * - * @param {WebGL2RenderingContext} gl A WebGL2RenderingContext - * @param {module:twgl.ProgramInfo} programInfo a `ProgramInfo` - * as returned from {@link module:twgl.createProgramInfo} - * @param {string} blockName The name of the block. - * @return {module:twgl.UniformBlockInfo} The created UniformBlockInfo - * @memberOf module:twgl/programs - */ - - -function createUniformBlockInfo(gl, programInfo, blockName) { - return createUniformBlockInfoFromProgram(gl, programInfo.program, programInfo.uniformBlockSpec, blockName); -} -/** - * Binds a unform block to the matching uniform block point. - * Matches by blocks by name so blocks must have the same name not just the same - * structure. - * - * If you have changed any values and you upload the valus into the corresponding WebGLBuffer - * call {@link module:twgl.setUniformBlock} instead. - * - * @param {WebGL2RenderingContext} gl A WebGL 2 rendering context. - * @param {(module:twgl.ProgramInfo|module:twgl.UniformBlockSpec)} programInfo a `ProgramInfo` - * as returned from {@link module:twgl.createProgramInfo} or or `UniformBlockSpec` as - * returned from {@link module:twgl.createUniformBlockSpecFromProgram}. - * @param {module:twgl.UniformBlockInfo} uniformBlockInfo a `UniformBlockInfo` as returned from - * {@link module:twgl.createUniformBlockInfo}. - * @return {bool} true if buffer was bound. If the programInfo has no block with the same block name - * no buffer is bound. - * @memberOf module:twgl/programs - */ - - -function bindUniformBlock(gl, programInfo, uniformBlockInfo) { - var uniformBlockSpec = programInfo.uniformBlockSpec || programInfo; - var blockSpec = uniformBlockSpec.blockSpecs[uniformBlockInfo.name]; - - if (blockSpec) { - var bufferBindIndex = blockSpec.index; - gl.bindBufferRange(gl.UNIFORM_BUFFER, bufferBindIndex, uniformBlockInfo.buffer, uniformBlockInfo.offset || 0, uniformBlockInfo.array.byteLength); - return true; - } - - return false; -} -/** - * Uploads the current uniform values to the corresponding WebGLBuffer - * and binds that buffer to the program's corresponding bind point for the uniform block object. - * - * If you haven't changed any values and you only need to bind the uniform block object - * call {@link module:twgl.bindUniformBlock} instead. - * - * @param {WebGL2RenderingContext} gl A WebGL 2 rendering context. - * @param {(module:twgl.ProgramInfo|module:twgl.UniformBlockSpec)} programInfo a `ProgramInfo` - * as returned from {@link module:twgl.createProgramInfo} or or `UniformBlockSpec` as - * returned from {@link module:twgl.createUniformBlockSpecFromProgram}. - * @param {module:twgl.UniformBlockInfo} uniformBlockInfo a `UniformBlockInfo` as returned from - * {@link module:twgl.createUniformBlockInfo}. - * @memberOf module:twgl/programs - */ - - -function setUniformBlock(gl, programInfo, uniformBlockInfo) { - if (bindUniformBlock(gl, programInfo, uniformBlockInfo)) { - gl.bufferData(gl.UNIFORM_BUFFER, uniformBlockInfo.array, gl.DYNAMIC_DRAW); - } -} -/** - * Sets values of a uniform block object - * - * @param {module:twgl.UniformBlockInfo} uniformBlockInfo A UniformBlockInfo as returned by {@link module:twgl.createUniformBlockInfo}. - * @param {Object.} values A uniform name to value map where the value is correct for the given - * type of uniform. So for example given a block like - * - * uniform SomeBlock { - * float someFloat; - * vec2 someVec2; - * vec3 someVec3Array[2]; - * int someInt; - * } - * - * You can set the values of the uniform block with - * - * twgl.setBlockUniforms(someBlockInfo, { - * someFloat: 12.3, - * someVec2: [1, 2], - * someVec3Array: [1, 2, 3, 4, 5, 6], - * someInt: 5, - * } - * - * Arrays can be JavaScript arrays or typed arrays - * - * Any name that doesn't match will be ignored - * @memberOf module:twgl/programs - */ - - -function setBlockUniforms(uniformBlockInfo, values) { - var uniforms = uniformBlockInfo.uniforms; - - for (var name in values) { - var array = uniforms[name]; - - if (array) { - var value = values[name]; - - if (value.length) { - array.set(value); - } else { - array[0] = value; - } - } - } -} -/** - * Set uniforms and binds related textures. - * - * example: - * - * const programInfo = createProgramInfo( - * gl, ["some-vs", "some-fs"]); - * - * const tex1 = gl.createTexture(); - * const tex2 = gl.createTexture(); - * - * ... assume we setup the textures with data ... - * - * const uniforms = { - * u_someSampler: tex1, - * u_someOtherSampler: tex2, - * u_someColor: [1,0,0,1], - * u_somePosition: [0,1,1], - * u_someMatrix: [ - * 1,0,0,0, - * 0,1,0,0, - * 0,0,1,0, - * 0,0,0,0, - * ], - * }; - * - * gl.useProgram(program); - * - * This will automatically bind the textures AND set the - * uniforms. - * - * twgl.setUniforms(programInfo, uniforms); - * - * For the example above it is equivalent to - * - * var texUnit = 0; - * gl.activeTexture(gl.TEXTURE0 + texUnit); - * gl.bindTexture(gl.TEXTURE_2D, tex1); - * gl.uniform1i(u_someSamplerLocation, texUnit++); - * gl.activeTexture(gl.TEXTURE0 + texUnit); - * gl.bindTexture(gl.TEXTURE_2D, tex2); - * gl.uniform1i(u_someSamplerLocation, texUnit++); - * gl.uniform4fv(u_someColorLocation, [1, 0, 0, 1]); - * gl.uniform3fv(u_somePositionLocation, [0, 1, 1]); - * gl.uniformMatrix4fv(u_someMatrix, false, [ - * 1,0,0,0, - * 0,1,0,0, - * 0,0,1,0, - * 0,0,0,0, - * ]); - * - * Note it is perfectly reasonable to call `setUniforms` multiple times. For example - * - * const uniforms = { - * u_someSampler: tex1, - * u_someOtherSampler: tex2, - * }; - * - * const moreUniforms { - * u_someColor: [1,0,0,1], - * u_somePosition: [0,1,1], - * u_someMatrix: [ - * 1,0,0,0, - * 0,1,0,0, - * 0,0,1,0, - * 0,0,0,0, - * ], - * }; - * - * twgl.setUniforms(programInfo, uniforms); - * twgl.setUniforms(programInfo, moreUniforms); - * - * You can also add WebGLSamplers to uniform samplers as in - * - * const uniforms = { - * u_someSampler: { - * texture: someWebGLTexture, - * sampler: someWebGLSampler, - * }, - * }; - * - * In which case both the sampler and texture will be bound to the - * same unit. - * - * @param {(module:twgl.ProgramInfo|Object.)} setters a `ProgramInfo` as returned from `createProgramInfo` or the setters returned from - * `createUniformSetters`. - * @param {Object.} values an object with values for the - * uniforms. - * You can pass multiple objects by putting them in an array or by calling with more arguments.For example - * - * const sharedUniforms = { - * u_fogNear: 10, - * u_projection: ... - * ... - * }; - * - * const localUniforms = { - * u_world: ... - * u_diffuseColor: ... - * }; - * - * twgl.setUniforms(programInfo, sharedUniforms, localUniforms); - * - * // is the same as - * - * twgl.setUniforms(programInfo, [sharedUniforms, localUniforms]); - * - * // is the same as - * - * twgl.setUniforms(programInfo, sharedUniforms); - * twgl.setUniforms(programInfo, localUniforms}; - * - * @memberOf module:twgl/programs - */ - - -function setUniforms(setters, values) { - // eslint-disable-line - var actualSetters = setters.uniformSetters || setters; - var numArgs = arguments.length; - - for (var andx = 1; andx < numArgs; ++andx) { - var vals = arguments[andx]; - - if (Array.isArray(vals)) { - var numValues = vals.length; - - for (var ii = 0; ii < numValues; ++ii) { - setUniforms(actualSetters, vals[ii]); - } - } else { - for (var name in vals) { - var setter = actualSetters[name]; - - if (setter) { - setter(vals[name]); - } - } - } - } -} -/** - * Creates setter functions for all attributes of a shader - * program. You can pass this to {@link module:twgl.setBuffersAndAttributes} to set all your buffers and attributes. - * - * @see {@link module:twgl.setAttributes} for example - * @param {WebGLProgram} program the program to create setters for. - * @return {Object.} an object with a setter for each attribute by name. - * @memberOf module:twgl/programs - */ - - -function createAttributeSetters(gl, program) { - var attribSetters = {}; - var numAttribs = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES); - - for (var ii = 0; ii < numAttribs; ++ii) { - var attribInfo = gl.getActiveAttrib(program, ii); - - if (isBuiltIn(attribInfo)) { - continue; - } - - var index = gl.getAttribLocation(program, attribInfo.name); - var typeInfo = attrTypeMap[attribInfo.type]; - var setter = typeInfo.setter(gl, index, typeInfo); - setter.location = index; - attribSetters[attribInfo.name] = setter; - } - - return attribSetters; -} -/** - * Sets attributes and binds buffers (deprecated... use {@link module:twgl.setBuffersAndAttributes}) - * - * Example: - * - * const program = createProgramFromScripts( - * gl, ["some-vs", "some-fs"); - * - * const attribSetters = createAttributeSetters(program); - * - * const positionBuffer = gl.createBuffer(); - * const texcoordBuffer = gl.createBuffer(); - * - * const attribs = { - * a_position: {buffer: positionBuffer, numComponents: 3}, - * a_texcoord: {buffer: texcoordBuffer, numComponents: 2}, - * }; - * - * gl.useProgram(program); - * - * This will automatically bind the buffers AND set the - * attributes. - * - * setAttributes(attribSetters, attribs); - * - * Properties of attribs. For each attrib you can add - * properties: - * - * * type: the type of data in the buffer. Default = gl.FLOAT - * * normalize: whether or not to normalize the data. Default = false - * * stride: the stride. Default = 0 - * * offset: offset into the buffer. Default = 0 - * * divisor: the divisor for instances. Default = undefined - * - * For example if you had 3 value float positions, 2 value - * float texcoord and 4 value uint8 colors you'd setup your - * attribs like this - * - * const attribs = { - * a_position: {buffer: positionBuffer, numComponents: 3}, - * a_texcoord: {buffer: texcoordBuffer, numComponents: 2}, - * a_color: { - * buffer: colorBuffer, - * numComponents: 4, - * type: gl.UNSIGNED_BYTE, - * normalize: true, - * }, - * }; - * - * @param {Object.} setters Attribute setters as returned from createAttributeSetters - * @param {Object.} buffers AttribInfos mapped by attribute name. - * @memberOf module:twgl/programs - * @deprecated use {@link module:twgl.setBuffersAndAttributes} - */ - - -function setAttributes(setters, buffers) { - for (var name in buffers) { - var setter = setters[name]; - - if (setter) { - setter(buffers[name]); - } - } -} -/** - * Sets attributes and buffers including the `ELEMENT_ARRAY_BUFFER` if appropriate - * - * Example: - * - * const programInfo = createProgramInfo( - * gl, ["some-vs", "some-fs"); - * - * const arrays = { - * position: { numComponents: 3, data: [0, 0, 0, 10, 0, 0, 0, 10, 0, 10, 10, 0], }, - * texcoord: { numComponents: 2, data: [0, 0, 0, 1, 1, 0, 1, 1], }, - * }; - * - * const bufferInfo = createBufferInfoFromArrays(gl, arrays); - * - * gl.useProgram(programInfo.program); - * - * This will automatically bind the buffers AND set the - * attributes. - * - * setBuffersAndAttributes(gl, programInfo, bufferInfo); - * - * For the example above it is equivilent to - * - * gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer); - * gl.enableVertexAttribArray(a_positionLocation); - * gl.vertexAttribPointer(a_positionLocation, 3, gl.FLOAT, false, 0, 0); - * gl.bindBuffer(gl.ARRAY_BUFFER, texcoordBuffer); - * gl.enableVertexAttribArray(a_texcoordLocation); - * gl.vertexAttribPointer(a_texcoordLocation, 4, gl.FLOAT, false, 0, 0); - * - * @param {WebGLRenderingContext} gl A WebGLRenderingContext. - * @param {(module:twgl.ProgramInfo|Object.)} setters A `ProgramInfo` as returned from {@link module:twgl.createProgrmaInfo} or Attribute setters as returned from {@link module:twgl.createAttributeSetters} - * @param {(module:twgl.BufferInfo|module:twgl.vertexArrayInfo)} buffers a `BufferInfo` as returned from {@link module:twgl.createBufferInfoFromArrays}. - * or a `VertexArrayInfo` as returned from {@link module:twgl.createVertexArrayInfo} - * @memberOf module:twgl/programs - */ - - -function setBuffersAndAttributes(gl, programInfo, buffers) { - if (buffers.vertexArrayObject) { - gl.bindVertexArray(buffers.vertexArrayObject); - } else { - setAttributes(programInfo.attribSetters || programInfo, buffers.attribs); - - if (buffers.indices) { - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffers.indices); - } - } -} -/** - * @typedef {Object} ProgramInfo - * @property {WebGLProgram} program A shader program - * @property {Object} uniformSetters object of setters as returned from createUniformSetters, - * @property {Object} attribSetters object of setters as returned from createAttribSetters, - * @propetty {module:twgl.UniformBlockSpec} [uniformBlockSpace] a uniform block spec for making UniformBlockInfos with createUniformBlockInfo etc.. - * @property {Object} [transformFeedbackInfo] info for transform feedbacks - * @memberOf module:twgl - */ - -/** - * Creates a ProgramInfo from an existing program. - * - * A ProgramInfo contains - * - * programInfo = { - * program: WebGLProgram, - * uniformSetters: object of setters as returned from createUniformSetters, - * attribSetters: object of setters as returned from createAttribSetters, - * } - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext - * to use. - * @param {WebGLProgram} program an existing WebGLProgram. - * @return {module:twgl.ProgramInfo} The created ProgramInfo. - * @memberOf module:twgl/programs - */ - - -function createProgramInfoFromProgram(gl, program) { - var uniformSetters = createUniformSetters(gl, program); - var attribSetters = createAttributeSetters(gl, program); - var programInfo = { - program: program, - uniformSetters: uniformSetters, - attribSetters: attribSetters - }; - - if (utils.isWebGL2(gl)) { - programInfo.uniformBlockSpec = createUniformBlockSpecFromProgram(gl, program); - programInfo.transformFeedbackInfo = createTransformFeedbackInfo(gl, program); - } - - return programInfo; -} -/** - * Creates a ProgramInfo from 2 sources. - * - * A ProgramInfo contains - * - * programInfo = { - * program: WebGLProgram, - * uniformSetters: object of setters as returned from createUniformSetters, - * attribSetters: object of setters as returned from createAttribSetters, - * } - * - * NOTE: There are 4 signatures for this function - * - * twgl.createProgramInfo(gl, [vs, fs], options); - * twgl.createProgramInfo(gl, [vs, fs], opt_errFunc); - * twgl.createProgramInfo(gl, [vs, fs], opt_attribs, opt_errFunc); - * twgl.createProgramInfo(gl, [vs, fs], opt_attribs, opt_locations, opt_errFunc); - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext - * to use. - * @param {string[]} shaderSources Array of sources for the - * shaders or ids. The first is assumed to be the vertex shader, - * the second the fragment shader. - * @param {module:twgl.ProgramOptions|string[]} [opt_attribs] Options for the program or an array of attribs names. Locations will be assigned by index if not passed in - * @param {number[]} [opt_locations] The locations for the attributes. A parallel array to opt_attribs letting you assign locations. - * @param {module:twgl.ErrorCallback} opt_errorCallback callback for errors. By default it just prints an error to the console - * on error. If you want something else pass an callback. It's passed an error message. - * @return {module:twgl.ProgramInfo?} The created ProgramInfo or null if it failed to link or compile - * @memberOf module:twgl/programs - */ - - -function createProgramInfo(gl, shaderSources, opt_attribs, opt_locations, opt_errorCallback) { - var progOptions = getProgramOptions(opt_attribs, opt_locations, opt_errorCallback); - var good = true; - shaderSources = shaderSources.map(function (source) { - // Lets assume if there is no \n it's an id - if (source.indexOf("\n") < 0) { - var script = getElementById(source); - - if (!script) { - progOptions.errorCallback("no element with id: " + source); - good = false; - } else { - source = script.text; - } - } - - return source; - }); - - if (!good) { - return null; - } - - var program = createProgramFromSources(gl, shaderSources, progOptions); - - if (!program) { - return null; - } - - return createProgramInfoFromProgram(gl, program); -} - -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -exports.axisRotate = axisRotate; -exports.axisRotation = axisRotation; -exports.copy = copy; -exports.frustum = frustum; -exports.getAxis = getAxis; -exports.getTranslation = getTranslation; -exports.identity = identity; -exports.inverse = inverse; -exports.lookAt = lookAt; -exports.multiply = multiply; -exports.negate = negate; -exports.ortho = ortho; -exports.perspective = perspective; -exports.rotateX = rotateX; -exports.rotateY = rotateY; -exports.rotateZ = rotateZ; -exports.rotationX = rotationX; -exports.rotationY = rotationY; -exports.rotationZ = rotationZ; -exports.scale = scale; -exports.scaling = scaling; -exports.setAxis = setAxis; -exports.setDefaultType = setDefaultType; -exports.setTranslation = setTranslation; -exports.transformDirection = transformDirection; -exports.transformNormal = transformNormal; -exports.transformPoint = transformPoint; -exports.translate = translate; -exports.translation = translation; -exports.transpose = transpose; - -var v3 = _interopRequireWildcard(__webpack_require__(3)); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -/* - * Copyright 2015, Gregg Tavares. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Gregg Tavares. nor the names of his - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * 4x4 Matrix math math functions. - * - * Almost all functions take an optional `dst` argument. If it is not passed in the - * functions will create a new matrix. In other words you can do this - * - * const mat = m4.translation([1, 2, 3]); // Creates a new translation matrix - * - * or - * - * const mat = m4.create(); - * m4.translation([1, 2, 3], mat); // Puts translation matrix in mat. - * - * The first style is often easier but depending on where it's used it generates garbage where - * as there is almost never allocation with the second style. - * - * It is always save to pass any matrix as the destination. So for example - * - * const mat = m4.identity(); - * const trans = m4.translation([1, 2, 3]); - * m4.multiply(mat, trans, mat); // Multiplies mat * trans and puts result in mat. - * - * @module twgl/m4 - */ -var MatType = Float32Array; -var tempV3a = v3.create(); -var tempV3b = v3.create(); -var tempV3c = v3.create(); -/** - * A JavaScript array with 16 values or a Float32Array with 16 values. - * When created by the library will create the default type which is `Float32Array` - * but can be set by calling {@link module:twgl/m4.setDefaultType}. - * @typedef {(number[]|Float32Array)} Mat4 - * @memberOf module:twgl/m4 - */ - -/** - * Sets the type this library creates for a Mat4 - * @param {constructor} ctor the constructor for the type. Either `Float32Array` or `Array` - * @return {constructor} previous constructor for Mat4 - */ - -function setDefaultType(ctor) { - var oldType = MatType; - MatType = ctor; - return oldType; -} -/** - * Negates a matrix. - * @param {module:twgl/m4.Mat4} m The matrix. - * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. - * @return {module:twgl/m4.Mat4} -m. - * @memberOf module:twgl/m4 - */ - - -function negate(m, dst) { - dst = dst || new MatType(16); - dst[0] = -m[0]; - dst[1] = -m[1]; - dst[2] = -m[2]; - dst[3] = -m[3]; - dst[4] = -m[4]; - dst[5] = -m[5]; - dst[6] = -m[6]; - dst[7] = -m[7]; - dst[8] = -m[8]; - dst[9] = -m[9]; - dst[10] = -m[10]; - dst[11] = -m[11]; - dst[12] = -m[12]; - dst[13] = -m[13]; - dst[14] = -m[14]; - dst[15] = -m[15]; - return dst; -} -/** - * Copies a matrix. - * @param {module:twgl/m4.Mat4} m The matrix. - * @param {module:twgl/m4.Mat4} [dst] The matrix. - * @return {module:twgl/m4.Mat4} A copy of m. - * @memberOf module:twgl/m4 - */ - - -function copy(m, dst) { - dst = dst || new MatType(16); - dst[0] = m[0]; - dst[1] = m[1]; - dst[2] = m[2]; - dst[3] = m[3]; - dst[4] = m[4]; - dst[5] = m[5]; - dst[6] = m[6]; - dst[7] = m[7]; - dst[8] = m[8]; - dst[9] = m[9]; - dst[10] = m[10]; - dst[11] = m[11]; - dst[12] = m[12]; - dst[13] = m[13]; - dst[14] = m[14]; - dst[15] = m[15]; - return dst; -} -/** - * Creates an n-by-n identity matrix. - * - * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. - * @return {module:twgl/m4.Mat4} An n-by-n identity matrix. - * @memberOf module:twgl/m4 - */ - - -function identity(dst) { - dst = dst || new MatType(16); - dst[0] = 1; - dst[1] = 0; - dst[2] = 0; - dst[3] = 0; - dst[4] = 0; - dst[5] = 1; - dst[6] = 0; - dst[7] = 0; - dst[8] = 0; - dst[9] = 0; - dst[10] = 1; - dst[11] = 0; - dst[12] = 0; - dst[13] = 0; - dst[14] = 0; - dst[15] = 1; - return dst; -} -/** - * Takes the transpose of a matrix. - * @param {module:twgl/m4.Mat4} m The matrix. - * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. - * @return {module:twgl/m4.Mat4} The transpose of m. - * @memberOf module:twgl/m4 - */ - - -function transpose(m, dst) { - dst = dst || new MatType(16); - - if (dst === m) { - var t; - t = m[1]; - m[1] = m[4]; - m[4] = t; - t = m[2]; - m[2] = m[8]; - m[8] = t; - t = m[3]; - m[3] = m[12]; - m[12] = t; - t = m[6]; - m[6] = m[9]; - m[9] = t; - t = m[7]; - m[7] = m[13]; - m[13] = t; - t = m[11]; - m[11] = m[14]; - m[14] = t; - return dst; - } - - var m00 = m[0 * 4 + 0]; - var m01 = m[0 * 4 + 1]; - var m02 = m[0 * 4 + 2]; - var m03 = m[0 * 4 + 3]; - var m10 = m[1 * 4 + 0]; - var m11 = m[1 * 4 + 1]; - var m12 = m[1 * 4 + 2]; - var m13 = m[1 * 4 + 3]; - var m20 = m[2 * 4 + 0]; - var m21 = m[2 * 4 + 1]; - var m22 = m[2 * 4 + 2]; - var m23 = m[2 * 4 + 3]; - var m30 = m[3 * 4 + 0]; - var m31 = m[3 * 4 + 1]; - var m32 = m[3 * 4 + 2]; - var m33 = m[3 * 4 + 3]; - dst[0] = m00; - dst[1] = m10; - dst[2] = m20; - dst[3] = m30; - dst[4] = m01; - dst[5] = m11; - dst[6] = m21; - dst[7] = m31; - dst[8] = m02; - dst[9] = m12; - dst[10] = m22; - dst[11] = m32; - dst[12] = m03; - dst[13] = m13; - dst[14] = m23; - dst[15] = m33; - return dst; -} -/** - * Computes the inverse of a 4-by-4 matrix. - * @param {module:twgl/m4.Mat4} m The matrix. - * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. - * @return {module:twgl/m4.Mat4} The inverse of m. - * @memberOf module:twgl/m4 - */ - - -function inverse(m, dst) { - dst = dst || new MatType(16); - var m00 = m[0 * 4 + 0]; - var m01 = m[0 * 4 + 1]; - var m02 = m[0 * 4 + 2]; - var m03 = m[0 * 4 + 3]; - var m10 = m[1 * 4 + 0]; - var m11 = m[1 * 4 + 1]; - var m12 = m[1 * 4 + 2]; - var m13 = m[1 * 4 + 3]; - var m20 = m[2 * 4 + 0]; - var m21 = m[2 * 4 + 1]; - var m22 = m[2 * 4 + 2]; - var m23 = m[2 * 4 + 3]; - var m30 = m[3 * 4 + 0]; - var m31 = m[3 * 4 + 1]; - var m32 = m[3 * 4 + 2]; - var m33 = m[3 * 4 + 3]; - var tmp_0 = m22 * m33; - var tmp_1 = m32 * m23; - var tmp_2 = m12 * m33; - var tmp_3 = m32 * m13; - var tmp_4 = m12 * m23; - var tmp_5 = m22 * m13; - var tmp_6 = m02 * m33; - var tmp_7 = m32 * m03; - var tmp_8 = m02 * m23; - var tmp_9 = m22 * m03; - var tmp_10 = m02 * m13; - var tmp_11 = m12 * m03; - var tmp_12 = m20 * m31; - var tmp_13 = m30 * m21; - var tmp_14 = m10 * m31; - var tmp_15 = m30 * m11; - var tmp_16 = m10 * m21; - var tmp_17 = m20 * m11; - var tmp_18 = m00 * m31; - var tmp_19 = m30 * m01; - var tmp_20 = m00 * m21; - var tmp_21 = m20 * m01; - var tmp_22 = m00 * m11; - var tmp_23 = m10 * m01; - var t0 = tmp_0 * m11 + tmp_3 * m21 + tmp_4 * m31 - (tmp_1 * m11 + tmp_2 * m21 + tmp_5 * m31); - var t1 = tmp_1 * m01 + tmp_6 * m21 + tmp_9 * m31 - (tmp_0 * m01 + tmp_7 * m21 + tmp_8 * m31); - var t2 = tmp_2 * m01 + tmp_7 * m11 + tmp_10 * m31 - (tmp_3 * m01 + tmp_6 * m11 + tmp_11 * m31); - var t3 = tmp_5 * m01 + tmp_8 * m11 + tmp_11 * m21 - (tmp_4 * m01 + tmp_9 * m11 + tmp_10 * m21); - var d = 1.0 / (m00 * t0 + m10 * t1 + m20 * t2 + m30 * t3); - dst[0] = d * t0; - dst[1] = d * t1; - dst[2] = d * t2; - dst[3] = d * t3; - dst[4] = d * (tmp_1 * m10 + tmp_2 * m20 + tmp_5 * m30 - (tmp_0 * m10 + tmp_3 * m20 + tmp_4 * m30)); - dst[5] = d * (tmp_0 * m00 + tmp_7 * m20 + tmp_8 * m30 - (tmp_1 * m00 + tmp_6 * m20 + tmp_9 * m30)); - dst[6] = d * (tmp_3 * m00 + tmp_6 * m10 + tmp_11 * m30 - (tmp_2 * m00 + tmp_7 * m10 + tmp_10 * m30)); - dst[7] = d * (tmp_4 * m00 + tmp_9 * m10 + tmp_10 * m20 - (tmp_5 * m00 + tmp_8 * m10 + tmp_11 * m20)); - dst[8] = d * (tmp_12 * m13 + tmp_15 * m23 + tmp_16 * m33 - (tmp_13 * m13 + tmp_14 * m23 + tmp_17 * m33)); - dst[9] = d * (tmp_13 * m03 + tmp_18 * m23 + tmp_21 * m33 - (tmp_12 * m03 + tmp_19 * m23 + tmp_20 * m33)); - dst[10] = d * (tmp_14 * m03 + tmp_19 * m13 + tmp_22 * m33 - (tmp_15 * m03 + tmp_18 * m13 + tmp_23 * m33)); - dst[11] = d * (tmp_17 * m03 + tmp_20 * m13 + tmp_23 * m23 - (tmp_16 * m03 + tmp_21 * m13 + tmp_22 * m23)); - dst[12] = d * (tmp_14 * m22 + tmp_17 * m32 + tmp_13 * m12 - (tmp_16 * m32 + tmp_12 * m12 + tmp_15 * m22)); - dst[13] = d * (tmp_20 * m32 + tmp_12 * m02 + tmp_19 * m22 - (tmp_18 * m22 + tmp_21 * m32 + tmp_13 * m02)); - dst[14] = d * (tmp_18 * m12 + tmp_23 * m32 + tmp_15 * m02 - (tmp_22 * m32 + tmp_14 * m02 + tmp_19 * m12)); - dst[15] = d * (tmp_22 * m22 + tmp_16 * m02 + tmp_21 * m12 - (tmp_20 * m12 + tmp_23 * m22 + tmp_17 * m02)); - return dst; -} -/** - * Multiplies two 4-by-4 matrices with a on the left and b on the right - * @param {module:twgl/m4.Mat4} a The matrix on the left. - * @param {module:twgl/m4.Mat4} b The matrix on the right. - * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. - * @return {module:twgl/m4.Mat4} The matrix product of a and b. - * @memberOf module:twgl/m4 - */ - - -function multiply(a, b, dst) { - dst = dst || new MatType(16); - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - var a10 = a[4 + 0]; - var a11 = a[4 + 1]; - var a12 = a[4 + 2]; - var a13 = a[4 + 3]; - var a20 = a[8 + 0]; - var a21 = a[8 + 1]; - var a22 = a[8 + 2]; - var a23 = a[8 + 3]; - var a30 = a[12 + 0]; - var a31 = a[12 + 1]; - var a32 = a[12 + 2]; - var a33 = a[12 + 3]; - var b00 = b[0]; - var b01 = b[1]; - var b02 = b[2]; - var b03 = b[3]; - var b10 = b[4 + 0]; - var b11 = b[4 + 1]; - var b12 = b[4 + 2]; - var b13 = b[4 + 3]; - var b20 = b[8 + 0]; - var b21 = b[8 + 1]; - var b22 = b[8 + 2]; - var b23 = b[8 + 3]; - var b30 = b[12 + 0]; - var b31 = b[12 + 1]; - var b32 = b[12 + 2]; - var b33 = b[12 + 3]; - dst[0] = a00 * b00 + a10 * b01 + a20 * b02 + a30 * b03; - dst[1] = a01 * b00 + a11 * b01 + a21 * b02 + a31 * b03; - dst[2] = a02 * b00 + a12 * b01 + a22 * b02 + a32 * b03; - dst[3] = a03 * b00 + a13 * b01 + a23 * b02 + a33 * b03; - dst[4] = a00 * b10 + a10 * b11 + a20 * b12 + a30 * b13; - dst[5] = a01 * b10 + a11 * b11 + a21 * b12 + a31 * b13; - dst[6] = a02 * b10 + a12 * b11 + a22 * b12 + a32 * b13; - dst[7] = a03 * b10 + a13 * b11 + a23 * b12 + a33 * b13; - dst[8] = a00 * b20 + a10 * b21 + a20 * b22 + a30 * b23; - dst[9] = a01 * b20 + a11 * b21 + a21 * b22 + a31 * b23; - dst[10] = a02 * b20 + a12 * b21 + a22 * b22 + a32 * b23; - dst[11] = a03 * b20 + a13 * b21 + a23 * b22 + a33 * b23; - dst[12] = a00 * b30 + a10 * b31 + a20 * b32 + a30 * b33; - dst[13] = a01 * b30 + a11 * b31 + a21 * b32 + a31 * b33; - dst[14] = a02 * b30 + a12 * b31 + a22 * b32 + a32 * b33; - dst[15] = a03 * b30 + a13 * b31 + a23 * b32 + a33 * b33; - return dst; -} -/** - * Sets the translation component of a 4-by-4 matrix to the given - * vector. - * @param {module:twgl/m4.Mat4} a The matrix. - * @param {Vec3} v The vector. - * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. - * @return {module:twgl/m4.Mat4} a once modified. - * @memberOf module:twgl/m4 - */ - - -function setTranslation(a, v, dst) { - dst = dst || identity(); - - if (a !== dst) { - dst[0] = a[0]; - dst[1] = a[1]; - dst[2] = a[2]; - dst[3] = a[3]; - dst[4] = a[4]; - dst[5] = a[5]; - dst[6] = a[6]; - dst[7] = a[7]; - dst[8] = a[8]; - dst[9] = a[9]; - dst[10] = a[10]; - dst[11] = a[11]; - } - - dst[12] = v[0]; - dst[13] = v[1]; - dst[14] = v[2]; - dst[15] = 1; - return dst; -} -/** - * Returns the translation component of a 4-by-4 matrix as a vector with 3 - * entries. - * @param {module:twgl/m4.Mat4} m The matrix. - * @param {Vec3} [dst] vector.. - * @return {Vec3} The translation component of m. - * @memberOf module:twgl/m4 - */ - - -function getTranslation(m, dst) { - dst = dst || v3.create(); - dst[0] = m[12]; - dst[1] = m[13]; - dst[2] = m[14]; - return dst; -} -/** - * Returns an axis of a 4x4 matrix as a vector with 3 entries - * @param {module:twgl/m4.Mat4} m The matrix. - * @param {number} axis The axis 0 = x, 1 = y, 2 = z; - * @return {Vec3} [dst] vector. - * @return {Vec3} The axis component of m. - * @memberOf module:twgl/m4 - */ - - -function getAxis(m, axis, dst) { - dst = dst || v3.create(); - var off = axis * 4; - dst[0] = m[off + 0]; - dst[1] = m[off + 1]; - dst[2] = m[off + 2]; - return dst; -} -/** - * Sets an axis of a 4x4 matrix as a vector with 3 entries - * @param {Vec3} v the axis vector - * @param {number} axis The axis 0 = x, 1 = y, 2 = z; - * @param {module:twgl/m4.Mat4} [dst] The matrix to set. If none a new one is created - * @return {module:twgl/m4.Mat4} dst - * @memberOf module:twgl/m4 - */ - - -function setAxis(a, v, axis, dst) { - if (dst !== a) { - dst = copy(a, dst); - } - - var off = axis * 4; - dst[off + 0] = v[0]; - dst[off + 1] = v[1]; - dst[off + 2] = v[2]; - return dst; -} -/** - * Computes a 4-by-4 perspective transformation matrix given the angular height - * of the frustum, the aspect ratio, and the near and far clipping planes. The - * arguments define a frustum extending in the negative z direction. The given - * angle is the vertical angle of the frustum, and the horizontal angle is - * determined to produce the given aspect ratio. The arguments near and far are - * the distances to the near and far clipping planes. Note that near and far - * are not z coordinates, but rather they are distances along the negative - * z-axis. The matrix generated sends the viewing frustum to the unit box. - * We assume a unit box extending from -1 to 1 in the x and y dimensions and - * from 0 to 1 in the z dimension. - * @param {number} fieldOfViewYInRadians The camera angle from top to bottom (in radians). - * @param {number} aspect The aspect ratio width / height. - * @param {number} zNear The depth (negative z coordinate) - * of the near clipping plane. - * @param {number} zFar The depth (negative z coordinate) - * of the far clipping plane. - * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. - * @return {module:twgl/m4.Mat4} The perspective matrix. - * @memberOf module:twgl/m4 - */ - - -function perspective(fieldOfViewYInRadians, aspect, zNear, zFar, dst) { - dst = dst || new MatType(16); - var f = Math.tan(Math.PI * 0.5 - 0.5 * fieldOfViewYInRadians); - var rangeInv = 1.0 / (zNear - zFar); - dst[0] = f / aspect; - dst[1] = 0; - dst[2] = 0; - dst[3] = 0; - dst[4] = 0; - dst[5] = f; - dst[6] = 0; - dst[7] = 0; - dst[8] = 0; - dst[9] = 0; - dst[10] = (zNear + zFar) * rangeInv; - dst[11] = -1; - dst[12] = 0; - dst[13] = 0; - dst[14] = zNear * zFar * rangeInv * 2; - dst[15] = 0; - return dst; -} -/** - * Computes a 4-by-4 othogonal transformation matrix given the left, right, - * bottom, and top dimensions of the near clipping plane as well as the - * near and far clipping plane distances. - * @param {number} left Left side of the near clipping plane viewport. - * @param {number} right Right side of the near clipping plane viewport. - * @param {number} top Top of the near clipping plane viewport. - * @param {number} bottom Bottom of the near clipping plane viewport. - * @param {number} near The depth (negative z coordinate) - * of the near clipping plane. - * @param {number} far The depth (negative z coordinate) - * of the far clipping plane. - * @param {module:twgl/m4.Mat4} [dst] Output matrix. - * @return {module:twgl/m4.Mat4} The perspective matrix. - * @memberOf module:twgl/m4 - */ - - -function ortho(left, right, bottom, top, near, far, dst) { - dst = dst || new MatType(16); - dst[0] = 2 / (right - left); - dst[1] = 0; - dst[2] = 0; - dst[3] = 0; - dst[4] = 0; - dst[5] = 2 / (top - bottom); - dst[6] = 0; - dst[7] = 0; - dst[8] = 0; - dst[9] = 0; - dst[10] = 2 / (near - far); - dst[11] = 0; - dst[12] = (right + left) / (left - right); - dst[13] = (top + bottom) / (bottom - top); - dst[14] = (far + near) / (near - far); - dst[15] = 1; - return dst; -} -/** - * Computes a 4-by-4 perspective transformation matrix given the left, right, - * top, bottom, near and far clipping planes. The arguments define a frustum - * extending in the negative z direction. The arguments near and far are the - * distances to the near and far clipping planes. Note that near and far are not - * z coordinates, but rather they are distances along the negative z-axis. The - * matrix generated sends the viewing frustum to the unit box. We assume a unit - * box extending from -1 to 1 in the x and y dimensions and from 0 to 1 in the z - * dimension. - * @param {number} left The x coordinate of the left plane of the box. - * @param {number} right The x coordinate of the right plane of the box. - * @param {number} bottom The y coordinate of the bottom plane of the box. - * @param {number} top The y coordinate of the right plane of the box. - * @param {number} near The negative z coordinate of the near plane of the box. - * @param {number} far The negative z coordinate of the far plane of the box. - * @param {module:twgl/m4.Mat4} [dst] Output matrix. - * @return {module:twgl/m4.Mat4} The perspective projection matrix. - * @memberOf module:twgl/m4 - */ - - -function frustum(left, right, bottom, top, near, far, dst) { - dst = dst || new MatType(16); - var dx = right - left; - var dy = top - bottom; - var dz = near - far; - dst[0] = 2 * near / dx; - dst[1] = 0; - dst[2] = 0; - dst[3] = 0; - dst[4] = 0; - dst[5] = 2 * near / dy; - dst[6] = 0; - dst[7] = 0; - dst[8] = (left + right) / dx; - dst[9] = (top + bottom) / dy; - dst[10] = far / dz; - dst[11] = -1; - dst[12] = 0; - dst[13] = 0; - dst[14] = near * far / dz; - dst[15] = 0; - return dst; -} -/** - * Computes a 4-by-4 look-at transformation. - * - * This is a matrix which positions the camera itself. If you want - * a view matrix (a matrix which moves things in front of the camera) - * take the inverse of this. - * - * @param {Vec3} eye The position of the eye. - * @param {Vec3} target The position meant to be viewed. - * @param {Vec3} up A vector pointing up. - * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. - * @return {module:twgl/m4.Mat4} The look-at matrix. - * @memberOf module:twgl/m4 - */ - - -function lookAt(eye, target, up, dst) { - dst = dst || new MatType(16); - var xAxis = tempV3a; - var yAxis = tempV3b; - var zAxis = tempV3c; - v3.normalize(v3.subtract(eye, target, zAxis), zAxis); - v3.normalize(v3.cross(up, zAxis, xAxis), xAxis); - v3.normalize(v3.cross(zAxis, xAxis, yAxis), yAxis); - dst[0] = xAxis[0]; - dst[1] = xAxis[1]; - dst[2] = xAxis[2]; - dst[3] = 0; - dst[4] = yAxis[0]; - dst[5] = yAxis[1]; - dst[6] = yAxis[2]; - dst[7] = 0; - dst[8] = zAxis[0]; - dst[9] = zAxis[1]; - dst[10] = zAxis[2]; - dst[11] = 0; - dst[12] = eye[0]; - dst[13] = eye[1]; - dst[14] = eye[2]; - dst[15] = 1; - return dst; -} -/** - * Creates a 4-by-4 matrix which translates by the given vector v. - * @param {Vec3} v The vector by - * which to translate. - * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. - * @return {module:twgl/m4.Mat4} The translation matrix. - * @memberOf module:twgl/m4 - */ - - -function translation(v, dst) { - dst = dst || new MatType(16); - dst[0] = 1; - dst[1] = 0; - dst[2] = 0; - dst[3] = 0; - dst[4] = 0; - dst[5] = 1; - dst[6] = 0; - dst[7] = 0; - dst[8] = 0; - dst[9] = 0; - dst[10] = 1; - dst[11] = 0; - dst[12] = v[0]; - dst[13] = v[1]; - dst[14] = v[2]; - dst[15] = 1; - return dst; -} -/** - * Modifies the given 4-by-4 matrix by translation by the given vector v. - * @param {module:twgl/m4.Mat4} m The matrix. - * @param {Vec3} v The vector by - * which to translate. - * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. - * @return {module:twgl/m4.Mat4} m once modified. - * @memberOf module:twgl/m4 - */ - - -function translate(m, v, dst) { - dst = dst || new MatType(16); - var v0 = v[0]; - var v1 = v[1]; - var v2 = v[2]; - var m00 = m[0]; - var m01 = m[1]; - var m02 = m[2]; - var m03 = m[3]; - var m10 = m[1 * 4 + 0]; - var m11 = m[1 * 4 + 1]; - var m12 = m[1 * 4 + 2]; - var m13 = m[1 * 4 + 3]; - var m20 = m[2 * 4 + 0]; - var m21 = m[2 * 4 + 1]; - var m22 = m[2 * 4 + 2]; - var m23 = m[2 * 4 + 3]; - var m30 = m[3 * 4 + 0]; - var m31 = m[3 * 4 + 1]; - var m32 = m[3 * 4 + 2]; - var m33 = m[3 * 4 + 3]; - - if (m !== dst) { - dst[0] = m00; - dst[1] = m01; - dst[2] = m02; - dst[3] = m03; - dst[4] = m10; - dst[5] = m11; - dst[6] = m12; - dst[7] = m13; - dst[8] = m20; - dst[9] = m21; - dst[10] = m22; - dst[11] = m23; - } - - dst[12] = m00 * v0 + m10 * v1 + m20 * v2 + m30; - dst[13] = m01 * v0 + m11 * v1 + m21 * v2 + m31; - dst[14] = m02 * v0 + m12 * v1 + m22 * v2 + m32; - dst[15] = m03 * v0 + m13 * v1 + m23 * v2 + m33; - return dst; -} -/** - * Creates a 4-by-4 matrix which rotates around the x-axis by the given angle. - * @param {number} angleInRadians The angle by which to rotate (in radians). - * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. - * @return {module:twgl/m4.Mat4} The rotation matrix. - * @memberOf module:twgl/m4 - */ - - -function rotationX(angleInRadians, dst) { - dst = dst || new MatType(16); - var c = Math.cos(angleInRadians); - var s = Math.sin(angleInRadians); - dst[0] = 1; - dst[1] = 0; - dst[2] = 0; - dst[3] = 0; - dst[4] = 0; - dst[5] = c; - dst[6] = s; - dst[7] = 0; - dst[8] = 0; - dst[9] = -s; - dst[10] = c; - dst[11] = 0; - dst[12] = 0; - dst[13] = 0; - dst[14] = 0; - dst[15] = 1; - return dst; -} -/** - * Modifies the given 4-by-4 matrix by a rotation around the x-axis by the given - * angle. - * @param {module:twgl/m4.Mat4} m The matrix. - * @param {number} angleInRadians The angle by which to rotate (in radians). - * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. - * @return {module:twgl/m4.Mat4} m once modified. - * @memberOf module:twgl/m4 - */ - - -function rotateX(m, angleInRadians, dst) { - dst = dst || new MatType(16); - var m10 = m[4]; - var m11 = m[5]; - var m12 = m[6]; - var m13 = m[7]; - var m20 = m[8]; - var m21 = m[9]; - var m22 = m[10]; - var m23 = m[11]; - var c = Math.cos(angleInRadians); - var s = Math.sin(angleInRadians); - dst[4] = c * m10 + s * m20; - dst[5] = c * m11 + s * m21; - dst[6] = c * m12 + s * m22; - dst[7] = c * m13 + s * m23; - dst[8] = c * m20 - s * m10; - dst[9] = c * m21 - s * m11; - dst[10] = c * m22 - s * m12; - dst[11] = c * m23 - s * m13; - - if (m !== dst) { - dst[0] = m[0]; - dst[1] = m[1]; - dst[2] = m[2]; - dst[3] = m[3]; - dst[12] = m[12]; - dst[13] = m[13]; - dst[14] = m[14]; - dst[15] = m[15]; - } - - return dst; -} -/** - * Creates a 4-by-4 matrix which rotates around the y-axis by the given angle. - * @param {number} angleInRadians The angle by which to rotate (in radians). - * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. - * @return {module:twgl/m4.Mat4} The rotation matrix. - * @memberOf module:twgl/m4 - */ - - -function rotationY(angleInRadians, dst) { - dst = dst || new MatType(16); - var c = Math.cos(angleInRadians); - var s = Math.sin(angleInRadians); - dst[0] = c; - dst[1] = 0; - dst[2] = -s; - dst[3] = 0; - dst[4] = 0; - dst[5] = 1; - dst[6] = 0; - dst[7] = 0; - dst[8] = s; - dst[9] = 0; - dst[10] = c; - dst[11] = 0; - dst[12] = 0; - dst[13] = 0; - dst[14] = 0; - dst[15] = 1; - return dst; -} -/** - * Modifies the given 4-by-4 matrix by a rotation around the y-axis by the given - * angle. - * @param {module:twgl/m4.Mat4} m The matrix. - * @param {number} angleInRadians The angle by which to rotate (in radians). - * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. - * @return {module:twgl/m4.Mat4} m once modified. - * @memberOf module:twgl/m4 - */ - - -function rotateY(m, angleInRadians, dst) { - dst = dst || new MatType(16); - var m00 = m[0 * 4 + 0]; - var m01 = m[0 * 4 + 1]; - var m02 = m[0 * 4 + 2]; - var m03 = m[0 * 4 + 3]; - var m20 = m[2 * 4 + 0]; - var m21 = m[2 * 4 + 1]; - var m22 = m[2 * 4 + 2]; - var m23 = m[2 * 4 + 3]; - var c = Math.cos(angleInRadians); - var s = Math.sin(angleInRadians); - dst[0] = c * m00 - s * m20; - dst[1] = c * m01 - s * m21; - dst[2] = c * m02 - s * m22; - dst[3] = c * m03 - s * m23; - dst[8] = c * m20 + s * m00; - dst[9] = c * m21 + s * m01; - dst[10] = c * m22 + s * m02; - dst[11] = c * m23 + s * m03; - - if (m !== dst) { - dst[4] = m[4]; - dst[5] = m[5]; - dst[6] = m[6]; - dst[7] = m[7]; - dst[12] = m[12]; - dst[13] = m[13]; - dst[14] = m[14]; - dst[15] = m[15]; - } - - return dst; -} -/** - * Creates a 4-by-4 matrix which rotates around the z-axis by the given angle. - * @param {number} angleInRadians The angle by which to rotate (in radians). - * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. - * @return {module:twgl/m4.Mat4} The rotation matrix. - * @memberOf module:twgl/m4 - */ - - -function rotationZ(angleInRadians, dst) { - dst = dst || new MatType(16); - var c = Math.cos(angleInRadians); - var s = Math.sin(angleInRadians); - dst[0] = c; - dst[1] = s; - dst[2] = 0; - dst[3] = 0; - dst[4] = -s; - dst[5] = c; - dst[6] = 0; - dst[7] = 0; - dst[8] = 0; - dst[9] = 0; - dst[10] = 1; - dst[11] = 0; - dst[12] = 0; - dst[13] = 0; - dst[14] = 0; - dst[15] = 1; - return dst; -} -/** - * Modifies the given 4-by-4 matrix by a rotation around the z-axis by the given - * angle. - * @param {module:twgl/m4.Mat4} m The matrix. - * @param {number} angleInRadians The angle by which to rotate (in radians). - * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. - * @return {module:twgl/m4.Mat4} m once modified. - * @memberOf module:twgl/m4 - */ - - -function rotateZ(m, angleInRadians, dst) { - dst = dst || new MatType(16); - var m00 = m[0 * 4 + 0]; - var m01 = m[0 * 4 + 1]; - var m02 = m[0 * 4 + 2]; - var m03 = m[0 * 4 + 3]; - var m10 = m[1 * 4 + 0]; - var m11 = m[1 * 4 + 1]; - var m12 = m[1 * 4 + 2]; - var m13 = m[1 * 4 + 3]; - var c = Math.cos(angleInRadians); - var s = Math.sin(angleInRadians); - dst[0] = c * m00 + s * m10; - dst[1] = c * m01 + s * m11; - dst[2] = c * m02 + s * m12; - dst[3] = c * m03 + s * m13; - dst[4] = c * m10 - s * m00; - dst[5] = c * m11 - s * m01; - dst[6] = c * m12 - s * m02; - dst[7] = c * m13 - s * m03; - - if (m !== dst) { - dst[8] = m[8]; - dst[9] = m[9]; - dst[10] = m[10]; - dst[11] = m[11]; - dst[12] = m[12]; - dst[13] = m[13]; - dst[14] = m[14]; - dst[15] = m[15]; - } - - return dst; -} -/** - * Creates a 4-by-4 matrix which rotates around the given axis by the given - * angle. - * @param {Vec3} axis The axis - * about which to rotate. - * @param {number} angleInRadians The angle by which to rotate (in radians). - * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. - * @return {module:twgl/m4.Mat4} A matrix which rotates angle radians - * around the axis. - * @memberOf module:twgl/m4 - */ - - -function axisRotation(axis, angleInRadians, dst) { - dst = dst || new MatType(16); - var x = axis[0]; - var y = axis[1]; - var z = axis[2]; - var n = Math.sqrt(x * x + y * y + z * z); - x /= n; - y /= n; - z /= n; - var xx = x * x; - var yy = y * y; - var zz = z * z; - var c = Math.cos(angleInRadians); - var s = Math.sin(angleInRadians); - var oneMinusCosine = 1 - c; - dst[0] = xx + (1 - xx) * c; - dst[1] = x * y * oneMinusCosine + z * s; - dst[2] = x * z * oneMinusCosine - y * s; - dst[3] = 0; - dst[4] = x * y * oneMinusCosine - z * s; - dst[5] = yy + (1 - yy) * c; - dst[6] = y * z * oneMinusCosine + x * s; - dst[7] = 0; - dst[8] = x * z * oneMinusCosine + y * s; - dst[9] = y * z * oneMinusCosine - x * s; - dst[10] = zz + (1 - zz) * c; - dst[11] = 0; - dst[12] = 0; - dst[13] = 0; - dst[14] = 0; - dst[15] = 1; - return dst; -} -/** - * Modifies the given 4-by-4 matrix by rotation around the given axis by the - * given angle. - * @param {module:twgl/m4.Mat4} m The matrix. - * @param {Vec3} axis The axis - * about which to rotate. - * @param {number} angleInRadians The angle by which to rotate (in radians). - * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. - * @return {module:twgl/m4.Mat4} m once modified. - * @memberOf module:twgl/m4 - */ - - -function axisRotate(m, axis, angleInRadians, dst) { - dst = dst || new MatType(16); - var x = axis[0]; - var y = axis[1]; - var z = axis[2]; - var n = Math.sqrt(x * x + y * y + z * z); - x /= n; - y /= n; - z /= n; - var xx = x * x; - var yy = y * y; - var zz = z * z; - var c = Math.cos(angleInRadians); - var s = Math.sin(angleInRadians); - var oneMinusCosine = 1 - c; - var r00 = xx + (1 - xx) * c; - var r01 = x * y * oneMinusCosine + z * s; - var r02 = x * z * oneMinusCosine - y * s; - var r10 = x * y * oneMinusCosine - z * s; - var r11 = yy + (1 - yy) * c; - var r12 = y * z * oneMinusCosine + x * s; - var r20 = x * z * oneMinusCosine + y * s; - var r21 = y * z * oneMinusCosine - x * s; - var r22 = zz + (1 - zz) * c; - var m00 = m[0]; - var m01 = m[1]; - var m02 = m[2]; - var m03 = m[3]; - var m10 = m[4]; - var m11 = m[5]; - var m12 = m[6]; - var m13 = m[7]; - var m20 = m[8]; - var m21 = m[9]; - var m22 = m[10]; - var m23 = m[11]; - dst[0] = r00 * m00 + r01 * m10 + r02 * m20; - dst[1] = r00 * m01 + r01 * m11 + r02 * m21; - dst[2] = r00 * m02 + r01 * m12 + r02 * m22; - dst[3] = r00 * m03 + r01 * m13 + r02 * m23; - dst[4] = r10 * m00 + r11 * m10 + r12 * m20; - dst[5] = r10 * m01 + r11 * m11 + r12 * m21; - dst[6] = r10 * m02 + r11 * m12 + r12 * m22; - dst[7] = r10 * m03 + r11 * m13 + r12 * m23; - dst[8] = r20 * m00 + r21 * m10 + r22 * m20; - dst[9] = r20 * m01 + r21 * m11 + r22 * m21; - dst[10] = r20 * m02 + r21 * m12 + r22 * m22; - dst[11] = r20 * m03 + r21 * m13 + r22 * m23; - - if (m !== dst) { - dst[12] = m[12]; - dst[13] = m[13]; - dst[14] = m[14]; - dst[15] = m[15]; - } - - return dst; -} -/** - * Creates a 4-by-4 matrix which scales in each dimension by an amount given by - * the corresponding entry in the given vector; assumes the vector has three - * entries. - * @param {Vec3} v A vector of - * three entries specifying the factor by which to scale in each dimension. - * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. - * @return {module:twgl/m4.Mat4} The scaling matrix. - * @memberOf module:twgl/m4 - */ - - -function scaling(v, dst) { - dst = dst || new MatType(16); - dst[0] = v[0]; - dst[1] = 0; - dst[2] = 0; - dst[3] = 0; - dst[4] = 0; - dst[5] = v[1]; - dst[6] = 0; - dst[7] = 0; - dst[8] = 0; - dst[9] = 0; - dst[10] = v[2]; - dst[11] = 0; - dst[12] = 0; - dst[13] = 0; - dst[14] = 0; - dst[15] = 1; - return dst; -} -/** - * Modifies the given 4-by-4 matrix, scaling in each dimension by an amount - * given by the corresponding entry in the given vector; assumes the vector has - * three entries. - * @param {module:twgl/m4.Mat4} m The matrix to be modified. - * @param {Vec3} v A vector of three entries specifying the - * factor by which to scale in each dimension. - * @param {module:twgl/m4.Mat4} [dst] matrix to hold result. If none new one is created.. - * @return {module:twgl/m4.Mat4} m once modified. - * @memberOf module:twgl/m4 - */ - - -function scale(m, v, dst) { - dst = dst || new MatType(16); - var v0 = v[0]; - var v1 = v[1]; - var v2 = v[2]; - dst[0] = v0 * m[0 * 4 + 0]; - dst[1] = v0 * m[0 * 4 + 1]; - dst[2] = v0 * m[0 * 4 + 2]; - dst[3] = v0 * m[0 * 4 + 3]; - dst[4] = v1 * m[1 * 4 + 0]; - dst[5] = v1 * m[1 * 4 + 1]; - dst[6] = v1 * m[1 * 4 + 2]; - dst[7] = v1 * m[1 * 4 + 3]; - dst[8] = v2 * m[2 * 4 + 0]; - dst[9] = v2 * m[2 * 4 + 1]; - dst[10] = v2 * m[2 * 4 + 2]; - dst[11] = v2 * m[2 * 4 + 3]; - - if (m !== dst) { - dst[12] = m[12]; - dst[13] = m[13]; - dst[14] = m[14]; - dst[15] = m[15]; - } - - return dst; -} -/** - * Takes a 4-by-4 matrix and a vector with 3 entries, - * interprets the vector as a point, transforms that point by the matrix, and - * returns the result as a vector with 3 entries. - * @param {module:twgl/m4.Mat4} m The matrix. - * @param {Vec3} v The point. - * @param {Vec3} dst optional vec3 to store result - * @return {Vec3} dst or new vec3 if not provided - * @memberOf module:twgl/m4 - */ - - -function transformPoint(m, v, dst) { - dst = dst || v3.create(); - var v0 = v[0]; - var v1 = v[1]; - var v2 = v[2]; - var d = v0 * m[0 * 4 + 3] + v1 * m[1 * 4 + 3] + v2 * m[2 * 4 + 3] + m[3 * 4 + 3]; - dst[0] = (v0 * m[0 * 4 + 0] + v1 * m[1 * 4 + 0] + v2 * m[2 * 4 + 0] + m[3 * 4 + 0]) / d; - dst[1] = (v0 * m[0 * 4 + 1] + v1 * m[1 * 4 + 1] + v2 * m[2 * 4 + 1] + m[3 * 4 + 1]) / d; - dst[2] = (v0 * m[0 * 4 + 2] + v1 * m[1 * 4 + 2] + v2 * m[2 * 4 + 2] + m[3 * 4 + 2]) / d; - return dst; -} -/** - * Takes a 4-by-4 matrix and a vector with 3 entries, interprets the vector as a - * direction, transforms that direction by the matrix, and returns the result; - * assumes the transformation of 3-dimensional space represented by the matrix - * is parallel-preserving, i.e. any combination of rotation, scaling and - * translation, but not a perspective distortion. Returns a vector with 3 - * entries. - * @param {module:twgl/m4.Mat4} m The matrix. - * @param {Vec3} v The direction. - * @param {Vec3} dst optional Vec3 to store result - * @return {Vec3} dst or new Vec3 if not provided - * @memberOf module:twgl/m4 - */ - - -function transformDirection(m, v, dst) { - dst = dst || v3.create(); - var v0 = v[0]; - var v1 = v[1]; - var v2 = v[2]; - dst[0] = v0 * m[0 * 4 + 0] + v1 * m[1 * 4 + 0] + v2 * m[2 * 4 + 0]; - dst[1] = v0 * m[0 * 4 + 1] + v1 * m[1 * 4 + 1] + v2 * m[2 * 4 + 1]; - dst[2] = v0 * m[0 * 4 + 2] + v1 * m[1 * 4 + 2] + v2 * m[2 * 4 + 2]; - return dst; -} -/** - * Takes a 4-by-4 matrix m and a vector v with 3 entries, interprets the vector - * as a normal to a surface, and computes a vector which is normal upon - * transforming that surface by the matrix. The effect of this function is the - * same as transforming v (as a direction) by the inverse-transpose of m. This - * function assumes the transformation of 3-dimensional space represented by the - * matrix is parallel-preserving, i.e. any combination of rotation, scaling and - * translation, but not a perspective distortion. Returns a vector with 3 - * entries. - * @param {module:twgl/m4.Mat4} m The matrix. - * @param {Vec3} v The normal. - * @param {Vec3} [dst] The direction. - * @return {Vec3} The transformed direction. - * @memberOf module:twgl/m4 - */ - - -function transformNormal(m, v, dst) { - dst = dst || v3.create(); - var mi = inverse(m); - var v0 = v[0]; - var v1 = v[1]; - var v2 = v[2]; - dst[0] = v0 * mi[0 * 4 + 0] + v1 * mi[0 * 4 + 1] + v2 * mi[0 * 4 + 2]; - dst[1] = v0 * mi[1 * 4 + 0] + v1 * mi[1 * 4 + 1] + v2 * mi[1 * 4 + 2]; - dst[2] = v0 * mi[2 * 4 + 0] + v1 * mi[2 * 4 + 1] + v2 * mi[2 * 4 + 2]; - return dst; -} - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -exports.createAttribsFromArrays = createAttribsFromArrays; -exports.createBuffersFromArrays = createBuffersFromArrays; -exports.createBufferFromArray = createBufferFromArray; -exports.createBufferFromTypedArray = createBufferFromTypedArray; -exports.createBufferInfoFromArrays = createBufferInfoFromArrays; -exports.setAttribInfoBufferFromArray = setAttribInfoBufferFromArray; -exports.setAttributePrefix = setAttributePrefix; -exports.setAttributeDefaults_ = setDefaults; -exports.getNumComponents_ = getNumComponents; -exports.getArray_ = getArray; - -var typedArrays = _interopRequireWildcard(__webpack_require__(1)); - -var helper = _interopRequireWildcard(__webpack_require__(0)); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -/* - * Copyright 2015, Gregg Tavares. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Gregg Tavares. nor the names of his - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * Low level attribute and buffer related functions - * - * You should generally not need to use these functions. They are provided - * for those cases where you're doing something out of the ordinary - * and you need lower level access. - * - * For backward compatibily they are available at both `twgl.attributes` and `twgl` - * itself - * - * See {@link module:twgl} for core functions - * - * @module twgl/attributes - */ -// make sure we don't see a global gl -var gl = undefined; // eslint-disable-line - -var defaults = { - attribPrefix: "" -}; -/** - * Sets the default attrib prefix - * - * When writing shaders I prefer to name attributes with `a_`, uniforms with `u_` and varyings with `v_` - * as it makes it clear where they came from. But, when building geometry I prefer using unprefixed names. - * - * In otherwords I'll create arrays of geometry like this - * - * var arrays = { - * position: ... - * normal: ... - * texcoord: ... - * }; - * - * But need those mapped to attributes and my attributes start with `a_`. - * - * @deprecated see {@link module:twgl.setDefaults} - * @param {string} prefix prefix for attribs - * @memberOf module:twgl/attributes - */ - -function setAttributePrefix(prefix) { - defaults.attribPrefix = prefix; -} - -function setDefaults(newDefaults) { - helper.copyExistingProperties(newDefaults, defaults); -} - -function setBufferFromTypedArray(gl, type, buffer, array, drawType) { - gl.bindBuffer(type, buffer); - gl.bufferData(type, array, drawType || gl.STATIC_DRAW); -} -/** - * Given typed array creates a WebGLBuffer and copies the typed array - * into it. - * - * @param {WebGLRenderingContext} gl A WebGLRenderingContext - * @param {ArrayBuffer|SharedArrayBuffer|ArrayBufferView|WebGLBuffer} typedArray the typed array. Note: If a WebGLBuffer is passed in it will just be returned. No action will be taken - * @param {number} [type] the GL bind type for the buffer. Default = `gl.ARRAY_BUFFER`. - * @param {number} [drawType] the GL draw type for the buffer. Default = 'gl.STATIC_DRAW`. - * @return {WebGLBuffer} the created WebGLBuffer - * @memberOf module:twgl/attributes - */ - - -function createBufferFromTypedArray(gl, typedArray, type, drawType) { - if (helper.isBuffer(gl, typedArray)) { - return typedArray; - } - - type = type || gl.ARRAY_BUFFER; - var buffer = gl.createBuffer(); - setBufferFromTypedArray(gl, type, buffer, typedArray, drawType); - return buffer; -} - -function isIndices(name) { - return name === "indices"; -} // This is really just a guess. Though I can't really imagine using -// anything else? Maybe for some compression? - - -function getNormalizationForTypedArray(typedArray) { - if (typedArray instanceof Int8Array) { - return true; - } // eslint-disable-line - - - if (typedArray instanceof Uint8Array) { - return true; - } // eslint-disable-line - - - return false; -} // This is really just a guess. Though I can't really imagine using -// anything else? Maybe for some compression? - - -function getNormalizationForTypedArrayType(typedArrayType) { - if (typedArrayType === Int8Array) { - return true; - } // eslint-disable-line - - - if (typedArrayType === Uint8Array) { - return true; - } // eslint-disable-line - - - return false; -} - -function getArray(array) { - return array.length ? array : array.data; -} - -var texcoordRE = /coord|texture/i; -var colorRE = /color|colour/i; - -function guessNumComponentsFromName(name, length) { - var numComponents; - - if (texcoordRE.test(name)) { - numComponents = 2; - } else if (colorRE.test(name)) { - numComponents = 4; - } else { - numComponents = 3; // position, normals, indices ... - } - - if (length % numComponents > 0) { - throw "Can not guess numComponents for attribute '" + name + "'. Tried " + numComponents + " but " + length + " values is not evenly divisible by " + numComponents + ". You should specify it."; - } - - return numComponents; -} - -function getNumComponents(array, arrayName) { - return array.numComponents || array.size || guessNumComponentsFromName(arrayName, getArray(array).length); -} - -function makeTypedArray(array, name) { - if (typedArrays.isArrayBuffer(array)) { - return array; - } - - if (typedArrays.isArrayBuffer(array.data)) { - return array.data; - } - - if (Array.isArray(array)) { - array = { - data: array - }; - } - - var Type = array.type; - - if (!Type) { - if (isIndices(name)) { - Type = Uint16Array; - } else { - Type = Float32Array; - } - } - - return new Type(array.data); -} -/** - * The info for an attribute. This is effectively just the arguments to `gl.vertexAttribPointer` plus the WebGLBuffer - * for the attribute. - * - * @typedef {Object} AttribInfo - * @property {number} [numComponents] the number of components for this attribute. - * @property {number} [size] synonym for `numComponents`. - * @property {number} [type] the type of the attribute (eg. `gl.FLOAT`, `gl.UNSIGNED_BYTE`, etc...) Default = `gl.FLOAT` - * @property {boolean} [normalize] whether or not to normalize the data. Default = false - * @property {number} [offset] offset into buffer in bytes. Default = 0 - * @property {number} [stride] the stride in bytes per element. Default = 0 - * @property {number} [divisor] the divisor in instances. Default = undefined. Note: undefined = don't call gl.vertexAttribDivisor - * where as anything else = do call it with this value - * @property {WebGLBuffer} buffer the buffer that contains the data for this attribute - * @property {number} [drawType] the draw type passed to gl.bufferData. Default = gl.STATIC_DRAW - * @memberOf module:twgl - */ - -/** - * Use this type of array spec when TWGL can't guess the type or number of compoments of an array - * @typedef {Object} FullArraySpec - * @property {(number|number[]|ArrayBufferView)} data The data of the array. A number alone becomes the number of elements of type. - * @property {number} [numComponents] number of components for `vertexAttribPointer`. Default is based on the name of the array. - * If `coord` is in the name assumes `numComponents = 2`. - * If `color` is in the name assumes `numComponents = 4`. - * otherwise assumes `numComponents = 3` - * @property {constructor} type The type. This is only used if `data` is a JavaScript array. It is the constructor for the typedarray. (eg. `Uint8Array`). - * For example if you want colors in a `Uint8Array` you might have a `FullArraySpec` like `{ type: Uint8Array, data: [255,0,255,255, ...], }`. - * @property {number} [size] synonym for `numComponents`. - * @property {boolean} [normalize] normalize for `vertexAttribPointer`. Default is true if type is `Int8Array` or `Uint8Array` otherwise false. - * @property {number} [stride] stride for `vertexAttribPointer`. Default = 0 - * @property {number} [offset] offset for `vertexAttribPointer`. Default = 0 - * @property {number} [divisor] divisor for `vertexAttribDivisor`. Default = undefined. Note: undefined = don't call gl.vertexAttribDivisor - * where as anything else = do call it with this value - * @property {string} [attrib] name of attribute this array maps to. Defaults to same name as array prefixed by the default attribPrefix. - * @property {string} [name] synonym for `attrib`. - * @property {string} [attribName] synonym for `attrib`. - * @memberOf module:twgl - */ - -/** - * An individual array in {@link module:twgl.Arrays} - * - * When passed to {@link module:twgl.createBufferInfoFromArrays} if an ArraySpec is `number[]` or `ArrayBufferView` - * the types will be guessed based on the name. `indices` will be `Uint16Array`, everything else will - * be `Float32Array`. If an ArraySpec is a number it's the number of floats for an empty (zeroed) buffer. - * - * @typedef {(number|number[]|ArrayBufferView|module:twgl.FullArraySpec)} ArraySpec - * @memberOf module:twgl - */ - -/** - * This is a JavaScript object of arrays by name. The names should match your shader's attributes. If your - * attributes have a common prefix you can specify it by calling {@link module:twgl.setAttributePrefix}. - * - * Bare JavaScript Arrays - * - * var arrays = { - * position: [-1, 1, 0], - * normal: [0, 1, 0], - * ... - * } - * - * Bare TypedArrays - * - * var arrays = { - * position: new Float32Array([-1, 1, 0]), - * color: new Uint8Array([255, 128, 64, 255]), - * ... - * } - * - * * Will guess at `numComponents` if not specified based on name. - * - * If `coord` is in the name assumes `numComponents = 2` - * - * If `color` is in the name assumes `numComponents = 4` - * - * otherwise assumes `numComponents = 3` - * - * Objects with various fields. See {@link module:twgl.FullArraySpec}. - * - * var arrays = { - * position: { numComponents: 3, data: [0, 0, 0, 10, 0, 0, 0, 10, 0, 10, 10, 0], }, - * texcoord: { numComponents: 2, data: [0, 0, 0, 1, 1, 0, 1, 1], }, - * normal: { numComponents: 3, data: [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1], }, - * indices: { numComponents: 3, data: [0, 1, 2, 1, 2, 3], }, - * }; - * - * @typedef {Object.} Arrays - * @memberOf module:twgl - */ - -/** - * Creates a set of attribute data and WebGLBuffers from set of arrays - * - * Given - * - * var arrays = { - * position: { numComponents: 3, data: [0, 0, 0, 10, 0, 0, 0, 10, 0, 10, 10, 0], }, - * texcoord: { numComponents: 2, data: [0, 0, 0, 1, 1, 0, 1, 1], }, - * normal: { numComponents: 3, data: [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1], }, - * color: { numComponents: 4, data: [255, 255, 255, 255, 255, 0, 0, 255, 0, 0, 255, 255], type: Uint8Array, }, - * indices: { numComponents: 3, data: [0, 1, 2, 1, 2, 3], }, - * }; - * - * returns something like - * - * var attribs = { - * position: { numComponents: 3, type: gl.FLOAT, normalize: false, buffer: WebGLBuffer, }, - * texcoord: { numComponents: 2, type: gl.FLOAT, normalize: false, buffer: WebGLBuffer, }, - * normal: { numComponents: 3, type: gl.FLOAT, normalize: false, buffer: WebGLBuffer, }, - * color: { numComponents: 4, type: gl.UNSIGNED_BYTE, normalize: true, buffer: WebGLBuffer, }, - * }; - * - * notes: - * - * * Arrays can take various forms - * - * Bare JavaScript Arrays - * - * var arrays = { - * position: [-1, 1, 0], - * normal: [0, 1, 0], - * ... - * } - * - * Bare TypedArrays - * - * var arrays = { - * position: new Float32Array([-1, 1, 0]), - * color: new Uint8Array([255, 128, 64, 255]), - * ... - * } - * - * * Will guess at `numComponents` if not specified based on name. - * - * If `coord` is in the name assumes `numComponents = 2` - * - * If `color` is in the name assumes `numComponents = 4` - * - * otherwise assumes `numComponents = 3` - * - * @param {WebGLRenderingContext} gl The webgl rendering context. - * @param {module:twgl.Arrays} arrays The arrays - * @return {Object.} the attribs - * @memberOf module:twgl/attributes - */ - - -function createAttribsFromArrays(gl, arrays) { - var attribs = {}; - Object.keys(arrays).forEach(function (arrayName) { - if (!isIndices(arrayName)) { - var array = arrays[arrayName]; - var attribName = array.attrib || array.name || array.attribName || defaults.attribPrefix + arrayName; - var buffer; - var type; - var normalization; - var numComponents; - var numValues; - - if (typeof array === "number" || typeof array.data === "number") { - numValues = array.data || array; - var arrayType = array.type || Float32Array; - var numBytes = numValues * arrayType.BYTES_PER_ELEMENT; - type = typedArrays.getGLTypeForTypedArrayType(arrayType); - normalization = array.normalize !== undefined ? array.normalize : getNormalizationForTypedArrayType(arrayType); - numComponents = array.numComponents || array.size || guessNumComponentsFromName(arrayName, numValues); - buffer = gl.createBuffer(); - gl.bindBuffer(gl.ARRAY_BUFFER, buffer); - gl.bufferData(gl.ARRAY_BUFFER, numBytes, array.drawType || gl.STATIC_DRAW); - } else { - var typedArray = makeTypedArray(array, arrayName); - buffer = createBufferFromTypedArray(gl, typedArray, undefined, array.drawType); - type = typedArrays.getGLTypeForTypedArray(typedArray); - normalization = array.normalize !== undefined ? array.normalize : getNormalizationForTypedArray(typedArray); - numComponents = getNumComponents(array, arrayName); - numValues = typedArray.length; - } - - attribs[attribName] = { - buffer: buffer, - numComponents: numComponents, - type: type, - normalize: normalization, - stride: array.stride || 0, - offset: array.offset || 0, - divisor: array.divisor === undefined ? undefined : array.divisor, - drawType: array.drawType - }; - } - }); - gl.bindBuffer(gl.ARRAY_BUFFER, null); - return attribs; -} -/** - * Sets the contents of a buffer attached to an attribInfo - * - * This is helper function to dynamically update a buffer. - * - * Let's say you make a bufferInfo - * - * var arrays = { - * position: new Float32Array([0, 0, 0, 10, 0, 0, 0, 10, 0, 10, 10, 0]), - * texcoord: new Float32Array([0, 0, 0, 1, 1, 0, 1, 1]), - * normal: new Float32Array([0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1]), - * indices: new Uint16Array([0, 1, 2, 1, 2, 3]), - * }; - * var bufferInfo = twgl.createBufferInfoFromArrays(gl, arrays); - * - * And you want to dynamically upate the positions. You could do this - * - * // assuming arrays.position has already been updated with new data. - * twgl.setAttribInfoBufferFromArray(gl, bufferInfo.attribs.position, arrays.position); - * - * @param {WebGLRenderingContext} gl - * @param {AttribInfo} attribInfo The attribInfo who's buffer contents to set. NOTE: If you have an attribute prefix - * the name of the attribute will include the prefix. - * @param {ArraySpec} array Note: it is arguably ineffient to pass in anything but a typed array because anything - * else will have to be converted to a typed array before it can be used by WebGL. During init time that - * inefficiency is usually not important but if you're updating data dynamically best to be efficient. - * @param {number} [offset] an optional offset into the buffer. This is only an offset into the WebGL buffer - * not the array. To pass in an offset into the array itself use a typed array and create an `ArrayBufferView` - * for the portion of the array you want to use. - * - * var someArray = new Float32Array(1000); // an array with 1000 floats - * var someSubArray = new Float32Array(someArray.buffer, offsetInBytes, sizeInUnits); // a view into someArray - * - * Now you can pass `someSubArray` into setAttribInfoBufferFromArray` - * @memberOf module:twgl/attributes - */ - - -function setAttribInfoBufferFromArray(gl, attribInfo, array, offset) { - array = makeTypedArray(array); - - if (offset !== undefined) { - gl.bindBuffer(gl.ARRAY_BUFFER, attribInfo.buffer); - gl.bufferSubData(gl.ARRAY_BUFFER, offset, array); - } else { - setBufferFromTypedArray(gl, gl.ARRAY_BUFFER, attribInfo.buffer, array, attribInfo.drawType); - } -} - -function getBytesPerValueForGLType(gl, type) { - if (type === gl.BYTE) return 1; // eslint-disable-line - - if (type === gl.UNSIGNED_BYTE) return 1; // eslint-disable-line - - if (type === gl.SHORT) return 2; // eslint-disable-line - - if (type === gl.UNSIGNED_SHORT) return 2; // eslint-disable-line - - if (type === gl.INT) return 4; // eslint-disable-line - - if (type === gl.UNSIGNED_INT) return 4; // eslint-disable-line - - if (type === gl.FLOAT) return 4; // eslint-disable-line - - return 0; -} -/** - * tries to get the number of elements from a set of arrays. - */ - - -var positionKeys = ['position', 'positions', 'a_position']; - -function getNumElementsFromNonIndexedArrays(arrays) { - var key; - - for (var _ii = 0; _ii < positionKeys.length; ++_ii) { - key = positionKeys[_ii]; - - if (key in arrays) { - break; - } - } - - if (ii === positionKeys.length) { - key = Object.keys(arrays)[0]; - } - - var array = arrays[key]; - var length = getArray(array).length; - var numComponents = getNumComponents(array, key); - var numElements = length / numComponents; - - if (length % numComponents > 0) { - throw "numComponents " + numComponents + " not correct for length " + length; - } - - return numElements; -} - -function getNumElementsFromAttributes(gl, attribs) { - var key; - var ii; - - for (ii = 0; ii < positionKeys.length; ++ii) { - key = positionKeys[ii]; - - if (key in attribs) { - break; - } - - key = defaults.attribPrefix + key; - - if (key in attribs) { - break; - } - } - - if (ii === positionKeys.length) { - key = Object.keys(attribs)[0]; - } - - var attrib = attribs[key]; - gl.bindBuffer(gl.ARRAY_BUFFER, attrib.buffer); - var numBytes = gl.getBufferParameter(gl.ARRAY_BUFFER, gl.BUFFER_SIZE); - gl.bindBuffer(gl.ARRAY_BUFFER, null); - var bytesPerValue = getBytesPerValueForGLType(gl, attrib.type); - var totalElements = numBytes / bytesPerValue; - var numComponents = attrib.numComponents || attrib.size; // TODO: check stride - - var numElements = totalElements / numComponents; - - if (numElements % 1 !== 0) { - throw "numComponents " + numComponents + " not correct for length " + length; - } - - return numElements; -} -/** - * @typedef {Object} BufferInfo - * @property {number} numElements The number of elements to pass to `gl.drawArrays` or `gl.drawElements`. - * @property {number} [elementType] The type of indices `UNSIGNED_BYTE`, `UNSIGNED_SHORT` etc.. - * @property {WebGLBuffer} [indices] The indices `ELEMENT_ARRAY_BUFFER` if any indices exist. - * @property {Object.} [attribs] The attribs approriate to call `setAttributes` - * @memberOf module:twgl - */ - -/** - * Creates a BufferInfo from an object of arrays. - * - * This can be passed to {@link module:twgl.setBuffersAndAttributes} and to - * {@link module:twgl:drawBufferInfo}. - * - * Given an object like - * - * var arrays = { - * position: { numComponents: 3, data: [0, 0, 0, 10, 0, 0, 0, 10, 0, 10, 10, 0], }, - * texcoord: { numComponents: 2, data: [0, 0, 0, 1, 1, 0, 1, 1], }, - * normal: { numComponents: 3, data: [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1], }, - * indices: { numComponents: 3, data: [0, 1, 2, 1, 2, 3], }, - * }; - * - * Creates an BufferInfo like this - * - * bufferInfo = { - * numElements: 4, // or whatever the number of elements is - * indices: WebGLBuffer, // this property will not exist if there are no indices - * attribs: { - * a_position: { buffer: WebGLBuffer, numComponents: 3, }, - * a_normal: { buffer: WebGLBuffer, numComponents: 3, }, - * a_texcoord: { buffer: WebGLBuffer, numComponents: 2, }, - * }, - * }; - * - * The properties of arrays can be JavaScript arrays in which case the number of components - * will be guessed. - * - * var arrays = { - * position: [0, 0, 0, 10, 0, 0, 0, 10, 0, 10, 10, 0], - * texcoord: [0, 0, 0, 1, 1, 0, 1, 1], - * normal: [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1], - * indices: [0, 1, 2, 1, 2, 3], - * }; - * - * They can also by TypedArrays - * - * var arrays = { - * position: new Float32Array([0, 0, 0, 10, 0, 0, 0, 10, 0, 10, 10, 0]), - * texcoord: new Float32Array([0, 0, 0, 1, 1, 0, 1, 1]), - * normal: new Float32Array([0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1]), - * indices: new Uint16Array([0, 1, 2, 1, 2, 3]), - * }; - * - * Or augmentedTypedArrays - * - * var positions = createAugmentedTypedArray(3, 4); - * var texcoords = createAugmentedTypedArray(2, 4); - * var normals = createAugmentedTypedArray(3, 4); - * var indices = createAugmentedTypedArray(3, 2, Uint16Array); - * - * positions.push([0, 0, 0, 10, 0, 0, 0, 10, 0, 10, 10, 0]); - * texcoords.push([0, 0, 0, 1, 1, 0, 1, 1]); - * normals.push([0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1]); - * indices.push([0, 1, 2, 1, 2, 3]); - * - * var arrays = { - * position: positions, - * texcoord: texcoords, - * normal: normals, - * indices: indices, - * }; - * - * For the last example it is equivalent to - * - * var bufferInfo = { - * attribs: { - * a_position: { numComponents: 3, buffer: gl.createBuffer(), }, - * a_texcoods: { numComponents: 2, buffer: gl.createBuffer(), }, - * a_normals: { numComponents: 3, buffer: gl.createBuffer(), }, - * }, - * indices: gl.createBuffer(), - * numElements: 6, - * }; - * - * gl.bindBuffer(gl.ARRAY_BUFFER, bufferInfo.attribs.a_position.buffer); - * gl.bufferData(gl.ARRAY_BUFFER, arrays.position, gl.STATIC_DRAW); - * gl.bindBuffer(gl.ARRAY_BUFFER, bufferInfo.attribs.a_texcoord.buffer); - * gl.bufferData(gl.ARRAY_BUFFER, arrays.texcoord, gl.STATIC_DRAW); - * gl.bindBuffer(gl.ARRAY_BUFFER, bufferInfo.attribs.a_normal.buffer); - * gl.bufferData(gl.ARRAY_BUFFER, arrays.normal, gl.STATIC_DRAW); - * gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, bufferInfo.indices); - * gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, arrays.indices, gl.STATIC_DRAW); - * - * @param {WebGLRenderingContext} gl A WebGLRenderingContext - * @param {module:twgl.Arrays} arrays Your data - * @return {module:twgl.BufferInfo} A BufferInfo - * @memberOf module:twgl/attributes - */ - - -function createBufferInfoFromArrays(gl, arrays) { - var bufferInfo = { - attribs: createAttribsFromArrays(gl, arrays) - }; - var indices = arrays.indices; - - if (indices) { - var newIndices = makeTypedArray(indices, "indices"); - bufferInfo.indices = createBufferFromTypedArray(gl, newIndices, gl.ELEMENT_ARRAY_BUFFER); - bufferInfo.numElements = newIndices.length; - bufferInfo.elementType = typedArrays.getGLTypeForTypedArray(newIndices); - } else { - bufferInfo.numElements = getNumElementsFromAttributes(gl, bufferInfo.attribs); - } - - return bufferInfo; -} -/** - * Creates a buffer from an array, typed array, or array spec - * - * Given something like this - * - * [1, 2, 3], - * - * or - * - * new Uint16Array([1,2,3]); - * - * or - * - * { - * data: [1, 2, 3], - * type: Uint8Array, - * } - * - * returns a WebGLBuffer that constains the given data. - * - * @param {WebGLRenderingContext} gl A WebGLRenderingContext. - * @param {module:twgl.ArraySpec} array an array, typed array, or array spec. - * @param {string} arrayName name of array. Used to guess the type if type can not be dervied other wise. - * @return {WebGLBuffer} a WebGLBuffer containing the data in array. - * @memberOf module:twgl/attributes - */ - - -function createBufferFromArray(gl, array, arrayName) { - var type = arrayName === "indices" ? gl.ELEMENT_ARRAY_BUFFER : gl.ARRAY_BUFFER; - var typedArray = makeTypedArray(array, arrayName); - return createBufferFromTypedArray(gl, typedArray, type); -} -/** - * Creates buffers from arrays or typed arrays - * - * Given something like this - * - * var arrays = { - * positions: [1, 2, 3], - * normals: [0, 0, 1], - * } - * - * returns something like - * - * buffers = { - * positions: WebGLBuffer, - * normals: WebGLBuffer, - * } - * - * If the buffer is named 'indices' it will be made an ELEMENT_ARRAY_BUFFER. - * - * @param {WebGLRenderingContext} gl A WebGLRenderingContext. - * @param {module:twgl.Arrays} arrays - * @return {Object} returns an object with one WebGLBuffer per array - * @memberOf module:twgl/attributes - */ - - -function createBuffersFromArrays(gl, arrays) { - var buffers = {}; - Object.keys(arrays).forEach(function (key) { - buffers[key] = createBufferFromArray(gl, arrays[key], key); - }); // Ugh! - - if (arrays.indices) { - buffers.numElements = arrays.indices.length; - buffers.elementType = typedArrays.getGLTypeForTypedArray(makeTypedArray(arrays.indices), 'indices'); - } else { - buffers.numElements = getNumElementsFromNonIndexedArrays(arrays); - } - - return buffers; -} - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -exports.setTextureDefaults_ = setDefaults; -exports.createSampler = createSampler; -exports.createSamplers = createSamplers; -exports.setSamplerParameters = setSamplerParameters; -exports.createTexture = createTexture; -exports.setEmptyTexture = setEmptyTexture; -exports.setTextureFromArray = setTextureFromArray; -exports.loadTextureFromUrl = loadTextureFromUrl; -exports.setTextureFromElement = setTextureFromElement; -exports.setTextureFilteringForSize = setTextureFilteringForSize; -exports.setTextureParameters = setTextureParameters; -exports.setDefaultTextureColor = setDefaultTextureColor; -exports.createTextures = createTextures; -exports.resizeTexture = resizeTexture; -exports.getNumComponentsForFormat = getNumComponentsForFormat; -exports.getBytesPerElementForInternalFormat = getBytesPerElementForInternalFormat; - -var utils = _interopRequireWildcard(__webpack_require__(4)); - -var typedArrays = _interopRequireWildcard(__webpack_require__(1)); - -var helper = _interopRequireWildcard(__webpack_require__(0)); - -var _globalObject = _interopRequireDefault(__webpack_require__(2)); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -/* - * Copyright 2015, Gregg Tavares. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Gregg Tavares. nor the names of his - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * Low level texture related functions - * - * You should generally not need to use these functions. They are provided - * for those cases where you're doing something out of the ordinary - * and you need lower level access. - * - * For backward compatibily they are available at both `twgl.textures` and `twgl` - * itself - * - * See {@link module:twgl} for core functions - * - * @module twgl/textures - */ -// make sure we don't see a global gl -var gl = undefined; // eslint-disable-line - -var defaults = { - textureColor: new Uint8Array([128, 192, 255, 255]), - textureOptions: {}, - crossOrigin: undefined -}; -var isArrayBuffer = typedArrays.isArrayBuffer; // Should we make this on demand? - -var ctx = _globalObject.default.document && _globalObject.default.document.createElement ? _globalObject.default.document.createElement("canvas").getContext("2d") : null; // NOTE: Chrome supports 2D canvas in a Worker (behind flag as of v64 but -// not only does Firefox NOT support it but Firefox freezes immediately -// if you try to create one instead of just returning null and continuing. -// : (global.OffscreenCanvas && (new global.OffscreenCanvas(1, 1)).getContext("2d")); // OffscreenCanvas may not support 2d -// NOTE: We can maybe remove some of the need for the 2d canvas. In WebGL2 -// we can use the various unpack settings. Otherwise we could try using -// the ability of an imagebitmap to be cut. Unfortunately cutting an imagebitmap -// is async and the current TWGL code expects a non-Async result though that -// might not be a problem. ImageBitmap though is not available in Edge or Safari -// as of 2018-01-02 - -/* PixelFormat */ - -var ALPHA = 0x1906; -var RGB = 0x1907; -var RGBA = 0x1908; -var LUMINANCE = 0x1909; -var LUMINANCE_ALPHA = 0x190A; -var DEPTH_COMPONENT = 0x1902; -var DEPTH_STENCIL = 0x84F9; -/* TextureWrapMode */ - -var REPEAT = 0x2901; // eslint-disable-line - -var MIRRORED_REPEAT = 0x8370; // eslint-disable-line - -/* TextureMagFilter */ - -var NEAREST = 0x2600; // eslint-disable-line - -/* TextureMinFilter */ - -var NEAREST_MIPMAP_NEAREST = 0x2700; // eslint-disable-line - -var LINEAR_MIPMAP_NEAREST = 0x2701; // eslint-disable-line - -var NEAREST_MIPMAP_LINEAR = 0x2702; // eslint-disable-line - -var LINEAR_MIPMAP_LINEAR = 0x2703; // eslint-disable-line - -var R8 = 0x8229; -var R8_SNORM = 0x8F94; -var R16F = 0x822D; -var R32F = 0x822E; -var R8UI = 0x8232; -var R8I = 0x8231; -var RG16UI = 0x823A; -var RG16I = 0x8239; -var RG32UI = 0x823C; -var RG32I = 0x823B; -var RG8 = 0x822B; -var RG8_SNORM = 0x8F95; -var RG16F = 0x822F; -var RG32F = 0x8230; -var RG8UI = 0x8238; -var RG8I = 0x8237; -var R16UI = 0x8234; -var R16I = 0x8233; -var R32UI = 0x8236; -var R32I = 0x8235; -var RGB8 = 0x8051; -var SRGB8 = 0x8C41; -var RGB565 = 0x8D62; -var RGB8_SNORM = 0x8F96; -var R11F_G11F_B10F = 0x8C3A; -var RGB9_E5 = 0x8C3D; -var RGB16F = 0x881B; -var RGB32F = 0x8815; -var RGB8UI = 0x8D7D; -var RGB8I = 0x8D8F; -var RGB16UI = 0x8D77; -var RGB16I = 0x8D89; -var RGB32UI = 0x8D71; -var RGB32I = 0x8D83; -var RGBA8 = 0x8058; -var SRGB8_ALPHA8 = 0x8C43; -var RGBA8_SNORM = 0x8F97; -var RGB5_A1 = 0x8057; -var RGBA4 = 0x8056; -var RGB10_A2 = 0x8059; -var RGBA16F = 0x881A; -var RGBA32F = 0x8814; -var RGBA8UI = 0x8D7C; -var RGBA8I = 0x8D8E; -var RGB10_A2UI = 0x906F; -var RGBA16UI = 0x8D76; -var RGBA16I = 0x8D88; -var RGBA32I = 0x8D82; -var RGBA32UI = 0x8D70; -var DEPTH_COMPONENT16 = 0x81A5; -var DEPTH_COMPONENT24 = 0x81A6; -var DEPTH_COMPONENT32F = 0x8CAC; -var DEPTH32F_STENCIL8 = 0x8CAD; -var DEPTH24_STENCIL8 = 0x88F0; -/* DataType */ - -var BYTE = 0x1400; -var UNSIGNED_BYTE = 0x1401; -var SHORT = 0x1402; -var UNSIGNED_SHORT = 0x1403; -var INT = 0x1404; -var UNSIGNED_INT = 0x1405; -var FLOAT = 0x1406; -var UNSIGNED_SHORT_4_4_4_4 = 0x8033; -var UNSIGNED_SHORT_5_5_5_1 = 0x8034; -var UNSIGNED_SHORT_5_6_5 = 0x8363; -var HALF_FLOAT = 0x140B; -var HALF_FLOAT_OES = 0x8D61; // Thanks Khronos for making this different >:( - -var UNSIGNED_INT_2_10_10_10_REV = 0x8368; -var UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B; -var UNSIGNED_INT_5_9_9_9_REV = 0x8C3E; -var FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD; -var UNSIGNED_INT_24_8 = 0x84FA; -var RG = 0x8227; -var RG_INTEGER = 0x8228; -var RED = 0x1903; -var RED_INTEGER = 0x8D94; -var RGB_INTEGER = 0x8D98; -var RGBA_INTEGER = 0x8D99; -var formatInfo = {}; -{ - // NOTE: this is named `numColorComponents` vs `numComponents` so we can let Uglify mangle - // the name. - var f = formatInfo; - f[ALPHA] = { - numColorComponents: 1 - }; - f[LUMINANCE] = { - numColorComponents: 1 - }; - f[LUMINANCE_ALPHA] = { - numColorComponents: 2 - }; - f[RGB] = { - numColorComponents: 3 - }; - f[RGBA] = { - numColorComponents: 4 - }; - f[RED] = { - numColorComponents: 1 - }; - f[RED_INTEGER] = { - numColorComponents: 1 - }; - f[RG] = { - numColorComponents: 2 - }; - f[RG_INTEGER] = { - numColorComponents: 2 - }; - f[RGB] = { - numColorComponents: 3 - }; - f[RGB_INTEGER] = { - numColorComponents: 3 - }; - f[RGBA] = { - numColorComponents: 4 - }; - f[RGBA_INTEGER] = { - numColorComponents: 4 - }; - f[DEPTH_COMPONENT] = { - numColorComponents: 1 - }; - f[DEPTH_STENCIL] = { - numColorComponents: 2 - }; -} -var textureInternalFormatInfo = {}; -{ - // NOTE: these properties need unique names so we can let Uglify mangle the name. - var t = textureInternalFormatInfo; // unsized formats - - t[ALPHA] = { - textureFormat: ALPHA, - colorRenderable: true, - textureFilterable: true, - bytesPerElement: [1, 2, 2, 4], - type: [UNSIGNED_BYTE, HALF_FLOAT, HALF_FLOAT_OES, FLOAT] - }; - t[LUMINANCE] = { - textureFormat: LUMINANCE, - colorRenderable: true, - textureFilterable: true, - bytesPerElement: [1, 2, 2, 4], - type: [UNSIGNED_BYTE, HALF_FLOAT, HALF_FLOAT_OES, FLOAT] - }; - t[LUMINANCE_ALPHA] = { - textureFormat: LUMINANCE_ALPHA, - colorRenderable: true, - textureFilterable: true, - bytesPerElement: [2, 4, 4, 8], - type: [UNSIGNED_BYTE, HALF_FLOAT, HALF_FLOAT_OES, FLOAT] - }; - t[RGB] = { - textureFormat: RGB, - colorRenderable: true, - textureFilterable: true, - bytesPerElement: [3, 6, 6, 12, 2], - type: [UNSIGNED_BYTE, HALF_FLOAT, HALF_FLOAT_OES, FLOAT, UNSIGNED_SHORT_5_6_5] - }; - t[RGBA] = { - textureFormat: RGBA, - colorRenderable: true, - textureFilterable: true, - bytesPerElement: [4, 8, 8, 16, 2, 2], - type: [UNSIGNED_BYTE, HALF_FLOAT, HALF_FLOAT_OES, FLOAT, UNSIGNED_SHORT_4_4_4_4, UNSIGNED_SHORT_5_5_5_1] - }; // sized formats - - t[R8] = { - textureFormat: RED, - colorRenderable: true, - textureFilterable: true, - bytesPerElement: 1, - type: UNSIGNED_BYTE - }; - t[R8_SNORM] = { - textureFormat: RED, - colorRenderable: false, - textureFilterable: true, - bytesPerElement: 1, - type: BYTE - }; - t[R16F] = { - textureFormat: RED, - colorRenderable: false, - textureFilterable: true, - bytesPerElement: [4, 2], - type: [FLOAT, HALF_FLOAT] - }; - t[R32F] = { - textureFormat: RED, - colorRenderable: false, - textureFilterable: false, - bytesPerElement: 4, - type: FLOAT - }; - t[R8UI] = { - textureFormat: RED_INTEGER, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: 1, - type: UNSIGNED_BYTE - }; - t[R8I] = { - textureFormat: RED_INTEGER, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: 1, - type: BYTE - }; - t[R16UI] = { - textureFormat: RED_INTEGER, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: 2, - type: UNSIGNED_SHORT - }; - t[R16I] = { - textureFormat: RED_INTEGER, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: 2, - type: SHORT - }; - t[R32UI] = { - textureFormat: RED_INTEGER, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: 4, - type: UNSIGNED_INT - }; - t[R32I] = { - textureFormat: RED_INTEGER, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: 4, - type: INT - }; - t[RG8] = { - textureFormat: RG, - colorRenderable: true, - textureFilterable: true, - bytesPerElement: 2, - type: UNSIGNED_BYTE - }; - t[RG8_SNORM] = { - textureFormat: RG, - colorRenderable: false, - textureFilterable: true, - bytesPerElement: 2, - type: BYTE - }; - t[RG16F] = { - textureFormat: RG, - colorRenderable: false, - textureFilterable: true, - bytesPerElement: [8, 4], - type: [FLOAT, HALF_FLOAT] - }; - t[RG32F] = { - textureFormat: RG, - colorRenderable: false, - textureFilterable: false, - bytesPerElement: 8, - type: FLOAT - }; - t[RG8UI] = { - textureFormat: RG_INTEGER, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: 2, - type: UNSIGNED_BYTE - }; - t[RG8I] = { - textureFormat: RG_INTEGER, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: 2, - type: BYTE - }; - t[RG16UI] = { - textureFormat: RG_INTEGER, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: 4, - type: UNSIGNED_SHORT - }; - t[RG16I] = { - textureFormat: RG_INTEGER, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: 4, - type: SHORT - }; - t[RG32UI] = { - textureFormat: RG_INTEGER, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: 8, - type: UNSIGNED_INT - }; - t[RG32I] = { - textureFormat: RG_INTEGER, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: 8, - type: INT - }; - t[RGB8] = { - textureFormat: RGB, - colorRenderable: true, - textureFilterable: true, - bytesPerElement: 3, - type: UNSIGNED_BYTE - }; - t[SRGB8] = { - textureFormat: RGB, - colorRenderable: false, - textureFilterable: true, - bytesPerElement: 3, - type: UNSIGNED_BYTE - }; - t[RGB565] = { - textureFormat: RGB, - colorRenderable: true, - textureFilterable: true, - bytesPerElement: [3, 2], - type: [UNSIGNED_BYTE, UNSIGNED_SHORT_5_6_5] - }; - t[RGB8_SNORM] = { - textureFormat: RGB, - colorRenderable: false, - textureFilterable: true, - bytesPerElement: 3, - type: BYTE - }; - t[R11F_G11F_B10F] = { - textureFormat: RGB, - colorRenderable: false, - textureFilterable: true, - bytesPerElement: [12, 6, 4], - type: [FLOAT, HALF_FLOAT, UNSIGNED_INT_10F_11F_11F_REV] - }; - t[RGB9_E5] = { - textureFormat: RGB, - colorRenderable: false, - textureFilterable: true, - bytesPerElement: [12, 6, 4], - type: [FLOAT, HALF_FLOAT, UNSIGNED_INT_5_9_9_9_REV] - }; - t[RGB16F] = { - textureFormat: RGB, - colorRenderable: false, - textureFilterable: true, - bytesPerElement: [12, 6], - type: [FLOAT, HALF_FLOAT] - }; - t[RGB32F] = { - textureFormat: RGB, - colorRenderable: false, - textureFilterable: false, - bytesPerElement: 12, - type: FLOAT - }; - t[RGB8UI] = { - textureFormat: RGB_INTEGER, - colorRenderable: false, - textureFilterable: false, - bytesPerElement: 3, - type: UNSIGNED_BYTE - }; - t[RGB8I] = { - textureFormat: RGB_INTEGER, - colorRenderable: false, - textureFilterable: false, - bytesPerElement: 3, - type: BYTE - }; - t[RGB16UI] = { - textureFormat: RGB_INTEGER, - colorRenderable: false, - textureFilterable: false, - bytesPerElement: 6, - type: UNSIGNED_SHORT - }; - t[RGB16I] = { - textureFormat: RGB_INTEGER, - colorRenderable: false, - textureFilterable: false, - bytesPerElement: 6, - type: SHORT - }; - t[RGB32UI] = { - textureFormat: RGB_INTEGER, - colorRenderable: false, - textureFilterable: false, - bytesPerElement: 12, - type: UNSIGNED_INT - }; - t[RGB32I] = { - textureFormat: RGB_INTEGER, - colorRenderable: false, - textureFilterable: false, - bytesPerElement: 12, - type: INT - }; - t[RGBA8] = { - textureFormat: RGBA, - colorRenderable: true, - textureFilterable: true, - bytesPerElement: 4, - type: UNSIGNED_BYTE - }; - t[SRGB8_ALPHA8] = { - textureFormat: RGBA, - colorRenderable: true, - textureFilterable: true, - bytesPerElement: 4, - type: UNSIGNED_BYTE - }; - t[RGBA8_SNORM] = { - textureFormat: RGBA, - colorRenderable: false, - textureFilterable: true, - bytesPerElement: 4, - type: BYTE - }; - t[RGB5_A1] = { - textureFormat: RGBA, - colorRenderable: true, - textureFilterable: true, - bytesPerElement: [4, 2, 4], - type: [UNSIGNED_BYTE, UNSIGNED_SHORT_5_5_5_1, UNSIGNED_INT_2_10_10_10_REV] - }; - t[RGBA4] = { - textureFormat: RGBA, - colorRenderable: true, - textureFilterable: true, - bytesPerElement: [4, 2], - type: [UNSIGNED_BYTE, UNSIGNED_SHORT_4_4_4_4] - }; - t[RGB10_A2] = { - textureFormat: RGBA, - colorRenderable: true, - textureFilterable: true, - bytesPerElement: 4, - type: UNSIGNED_INT_2_10_10_10_REV - }; - t[RGBA16F] = { - textureFormat: RGBA, - colorRenderable: false, - textureFilterable: true, - bytesPerElement: [16, 8], - type: [FLOAT, HALF_FLOAT] - }; - t[RGBA32F] = { - textureFormat: RGBA, - colorRenderable: false, - textureFilterable: false, - bytesPerElement: 16, - type: FLOAT - }; - t[RGBA8UI] = { - textureFormat: RGBA_INTEGER, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: 4, - type: UNSIGNED_BYTE - }; - t[RGBA8I] = { - textureFormat: RGBA_INTEGER, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: 4, - type: BYTE - }; - t[RGB10_A2UI] = { - textureFormat: RGBA_INTEGER, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: 4, - type: UNSIGNED_INT_2_10_10_10_REV - }; - t[RGBA16UI] = { - textureFormat: RGBA_INTEGER, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: 8, - type: UNSIGNED_SHORT - }; - t[RGBA16I] = { - textureFormat: RGBA_INTEGER, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: 8, - type: SHORT - }; - t[RGBA32I] = { - textureFormat: RGBA_INTEGER, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: 16, - type: INT - }; - t[RGBA32UI] = { - textureFormat: RGBA_INTEGER, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: 16, - type: UNSIGNED_INT - }; // Sized Internal - - t[DEPTH_COMPONENT16] = { - textureFormat: DEPTH_COMPONENT, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: [2, 4], - type: [UNSIGNED_SHORT, UNSIGNED_INT] - }; - t[DEPTH_COMPONENT24] = { - textureFormat: DEPTH_COMPONENT, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: 4, - type: UNSIGNED_INT - }; - t[DEPTH_COMPONENT32F] = { - textureFormat: DEPTH_COMPONENT, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: 4, - type: FLOAT - }; - t[DEPTH24_STENCIL8] = { - textureFormat: DEPTH_STENCIL, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: 4, - type: UNSIGNED_INT_24_8 - }; - t[DEPTH32F_STENCIL8] = { - textureFormat: DEPTH_STENCIL, - colorRenderable: true, - textureFilterable: false, - bytesPerElement: 4, - type: FLOAT_32_UNSIGNED_INT_24_8_REV - }; - Object.keys(t).forEach(function (internalFormat) { - var info = t[internalFormat]; - info.bytesPerElementMap = {}; - - if (Array.isArray(info.bytesPerElement)) { - info.bytesPerElement.forEach(function (bytesPerElement, ndx) { - var type = info.type[ndx]; - info.bytesPerElementMap[type] = bytesPerElement; - }); - } else { - var type = info.type; - info.bytesPerElementMap[type] = info.bytesPerElement; - } - }); -} -/** - * Gets the number of bytes per element for a given internalFormat / type - * @param {number} internalFormat The internalFormat parameter from texImage2D etc.. - * @param {number} type The type parameter for texImage2D etc.. - * @return {number} the number of bytes per element for the given internalFormat, type combo - * @memberOf module:twgl/textures - */ - -function getBytesPerElementForInternalFormat(internalFormat, type) { - var info = textureInternalFormatInfo[internalFormat]; - - if (!info) { - throw "unknown internal format"; - } - - var bytesPerElement = info.bytesPerElementMap[type]; - - if (bytesPerElement === undefined) { - throw "unknown internal format"; - } - - return bytesPerElement; -} -/** - * Gets the format for a given internalFormat - * - * @param {number} internalFormat The internal format - * @return {{format:number, type:number}} the corresponding format and type - */ - - -function getFormatAndTypeForInternalFormat(internalFormat) { - var info = textureInternalFormatInfo[internalFormat]; - - if (!info) { - throw "unknown internal format"; - } - - return { - format: info.textureFormat, - type: Array.isArray(info.type) ? info.type[0] : info.type - }; -} -/** - * Returns true if value is power of 2 - * @param {number} value number to check. - * @return true if value is power of 2 - */ - - -function isPowerOf2(value) { - return (value & value - 1) === 0; -} -/** - * Gets whether or not we can generate mips for the given format - * @param {number} internalFormat The internalFormat parameter from texImage2D etc.. - * @param {number} type The type parameter for texImage2D etc.. - * @return {boolean} true if we can generate mips - */ - - -function canGenerateMipmap(gl, width, height, internalFormat -/*, type */ -) { - if (!utils.isWebGL2(gl)) { - return isPowerOf2(width) && isPowerOf2(height); - } - - var info = textureInternalFormatInfo[internalFormat]; - - if (!info) { - throw "unknown internal format"; - } - - return info.colorRenderable && info.textureFilterable; -} -/** - * Gets whether or not we can generate mips for the given format - * @param {number} internalFormat The internalFormat parameter from texImage2D etc.. - * @param {number} type The type parameter for texImage2D etc.. - * @return {boolean} true if we can generate mips - */ - - -function canFilter(internalFormat -/*, type */ -) { - var info = textureInternalFormatInfo[internalFormat]; - - if (!info) { - throw "unknown internal format"; - } - - return info.textureFilterable; -} -/** - * Gets the number of compontents for a given image format. - * @param {number} format the format. - * @return {number} the number of components for the format. - * @memberOf module:twgl/textures - */ - - -function getNumComponentsForFormat(format) { - var info = formatInfo[format]; - - if (!info) { - throw "unknown format: " + format; - } - - return info.numColorComponents; -} -/** - * Gets the texture type for a given array type. - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - * @return {number} the gl texture type - */ - - -function getTextureTypeForArrayType(gl, src, defaultType) { - if (isArrayBuffer(src)) { - return typedArrays.getGLTypeForTypedArray(src); - } - - return defaultType || gl.UNSIGNED_BYTE; -} - -function guessDimensions(gl, target, width, height, numElements) { - if (numElements % 1 !== 0) { - throw "can't guess dimensions"; - } - - if (!width && !height) { - var size = Math.sqrt(numElements / (target === gl.TEXTURE_CUBE_MAP ? 6 : 1)); - - if (size % 1 === 0) { - width = size; - height = size; - } else { - width = numElements; - height = 1; - } - } else if (!height) { - height = numElements / width; - - if (height % 1) { - throw "can't guess dimensions"; - } - } else if (!width) { - width = numElements / height; - - if (width % 1) { - throw "can't guess dimensions"; - } - } - - return { - width: width, - height: height - }; -} -/** - * Sets the default texture color. - * - * The default texture color is used when loading textures from - * urls. Because the URL will be loaded async we'd like to be - * able to use the texture immediately. By putting a 1x1 pixel - * color in the texture we can start using the texture before - * the URL has loaded. - * - * @param {number[]} color Array of 4 values in the range 0 to 1 - * @deprecated see {@link module:twgl.setDefaults} - * @memberOf module:twgl/textures - */ - - -function setDefaultTextureColor(color) { - defaults.textureColor = new Uint8Array([color[0] * 255, color[1] * 255, color[2] * 255, color[3] * 255]); -} - -function setDefaults(newDefaults) { - helper.copyExistingProperties(newDefaults, defaults); - - if (newDefaults.textureColor) { - setDefaultTextureColor(newDefaults.textureColor); - } -} -/** - * A function to generate the source for a texture. - * @callback TextureFunc - * @param {WebGLRenderingContext} gl A WebGLRenderingContext - * @param {module:twgl.TextureOptions} options the texture options - * @return {*} Returns any of the things documentented for `src` for {@link module:twgl.TextureOptions}. - * @memberOf module:twgl - */ - -/** - * Texture options passed to most texture functions. Each function will use whatever options - * are appropriate for its needs. This lets you pass the same options to all functions. - * - * Note: A `TexImageSource` is defined in the WebGL spec as a `HTMLImageElement`, `HTMLVideoElement`, - * `HTMLCanvasElement`, `ImageBitmap`, or `ImageData`. - * - * @typedef {Object} TextureOptions - * @property {number} [target] the type of texture `gl.TEXTURE_2D` or `gl.TEXTURE_CUBE_MAP`. Defaults to `gl.TEXTURE_2D`. - * @property {number} [level] the mip level to affect. Defaults to 0. Note, if set auto will be considered false unless explicitly set to true. - * @property {number} [width] the width of the texture. Only used if src is an array or typed array or null. - * @property {number} [height] the height of a texture. Only used if src is an array or typed array or null. - * @property {number} [depth] the depth of a texture. Only used if src is an array or type array or null and target is `TEXTURE_3D` . - * @property {number} [min] the min filter setting (eg. `gl.LINEAR`). Defaults to `gl.NEAREST_MIPMAP_LINEAR` - * or if texture is not a power of 2 on both dimensions then defaults to `gl.LINEAR`. - * @property {number} [mag] the mag filter setting (eg. `gl.LINEAR`). Defaults to `gl.LINEAR` - * @property {number} [minMag] both the min and mag filter settings. - * @property {number} [internalFormat] internal format for texture. Defaults to `gl.RGBA` - * @property {number} [format] format for texture. Defaults to `gl.RGBA`. - * @property {number} [type] type for texture. Defaults to `gl.UNSIGNED_BYTE` unless `src` is ArrayBufferView. If `src` - * is ArrayBufferView defaults to type that matches ArrayBufferView type. - * @property {number} [wrap] Texture wrapping for both S and T (and R if TEXTURE_3D or WebGLSampler). Defaults to `gl.REPEAT` for 2D unless src is WebGL1 and src not npot and `gl.CLAMP_TO_EDGE` for cube - * @property {number} [wrapS] Texture wrapping for S. Defaults to `gl.REPEAT` and `gl.CLAMP_TO_EDGE` for cube. If set takes precedence over `wrap`. - * @property {number} [wrapT] Texture wrapping for T. Defaults to `gl.REPEAT` and `gl.CLAMP_TO_EDGE` for cube. If set takes precedence over `wrap`. - * @property {number} [wrapR] Texture wrapping for R. Defaults to `gl.REPEAT` and `gl.CLAMP_TO_EDGE` for cube. If set takes precedence over `wrap`. - * @property {number} [minLod] TEXTURE_MIN_LOD setting - * @property {number} [maxLod] TEXTURE_MAX_LOD setting - * @property {number} [baseLevel] TEXTURE_BASE_LEVEL setting - * @property {number} [maxLevel] TEXTURE_MAX_LEVEL setting - * @property {number} [unpackAlignment] The `gl.UNPACK_ALIGNMENT` used when uploading an array. Defaults to 1. - * @property {number} [premultiplyAlpha] Whether or not to premultiply alpha. Defaults to whatever the current setting is. - * This lets you set it once before calling `twgl.createTexture` or `twgl.createTextures` and only override - * the current setting for specific textures. - * @property {number} [flipY] Whether or not to flip the texture vertically on upload. Defaults to whatever the current setting is. - * This lets you set it once before calling `twgl.createTexture` or `twgl.createTextures` and only override - * the current setting for specific textures. - * @property {number} [colorspaceConversion] Whether or not to let the browser do colorspace conversion of the texture on upload. Defaults to whatever the current setting is. - * This lets you set it once before calling `twgl.createTexture` or `twgl.createTextures` and only override - * the current setting for specific textures. - * @property {(number[]|ArrayBufferView)} color color used as temporary 1x1 pixel color for textures loaded async when src is a string. - * If it's a JavaScript array assumes color is 0 to 1 like most GL colors as in `[1, 0, 0, 1] = red=1, green=0, blue=0, alpha=0`. - * Defaults to `[0.5, 0.75, 1, 1]`. See {@link module:twgl.setDefaultTextureColor}. If `false` texture is set. Can be used to re-load a texture - * @property {boolean} [auto] If `undefined` or `true`, in WebGL1, texture filtering is set automatically for non-power of 2 images and - * mips are generated for power of 2 images. In WebGL2 mips are generated if they can be. Note: if `level` is set above - * then then `auto` is assumed to be `false` unless explicity set to `true`. - * @property {number[]} [cubeFaceOrder] The order that cube faces are pulled out of an img or set of images. The default is - * - * [gl.TEXTURE_CUBE_MAP_POSITIVE_X, - * gl.TEXTURE_CUBE_MAP_NEGATIVE_X, - * gl.TEXTURE_CUBE_MAP_POSITIVE_Y, - * gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, - * gl.TEXTURE_CUBE_MAP_POSITIVE_Z, - * gl.TEXTURE_CUBE_MAP_NEGATIVE_Z] - * - * @property {(number[]|ArrayBufferView|TexImageSource|TexImageSource[]|string|string[]|module:twgl.TextureFunc)} [src] source for texture - * - * If `string` then it's assumed to be a URL to an image. The image will be downloaded async. A usable - * 1x1 pixel texture will be returned immediatley. The texture will be updated once the image has downloaded. - * If `target` is `gl.TEXTURE_CUBE_MAP` will attempt to divide image into 6 square pieces. 1x6, 6x1, 3x2, 2x3. - * The pieces will be uploaded in `cubeFaceOrder` - * - * If `string[]` or `TexImageSource[]` and target is `gl.TEXTURE_CUBE_MAP` then it must have 6 entries, one for each face of a cube map. - * - * If `string[]` or `TexImageSource[]` and target is `gl.TEXTURE_2D_ARRAY` then eact entry is a slice of the a 2d array texture - * and will be scaled to the specified width and height OR to the size of the first image that loads. - * - * If `TexImageSource` then it wil be used immediately to create the contents of the texture. Examples `HTMLImageElement`, - * `HTMLCanvasElement`, `HTMLVideoElement`. - * - * If `number[]` or `ArrayBufferView` it's assumed to be data for a texture. If `width` or `height` is - * not specified it is guessed as follows. First the number of elements is computed by `src.length / numComponents` - * where `numComponents` is derived from `format`. If `target` is `gl.TEXTURE_CUBE_MAP` then `numElements` is divided - * by 6. Then - * - * * If neither `width` nor `height` are specified and `sqrt(numElements)` is an integer then width and height - * are set to `sqrt(numElements)`. Otherwise `width = numElements` and `height = 1`. - * - * * If only one of `width` or `height` is specified then the other equals `numElements / specifiedDimension`. - * - * If `number[]` will be converted to `type`. - * - * If `src` is a function it will be called with a `WebGLRenderingContext` and these options. - * Whatever it returns is subject to these rules. So it can return a string url, an `HTMLElement` - * an array etc... - * - * If `src` is undefined then an empty texture will be created of size `width` by `height`. - * - * @property {string} [crossOrigin] What to set the crossOrigin property of images when they are downloaded. - * default: undefined. Also see {@link module:twgl.setDefaults}. - * - * @memberOf module:twgl - */ -// NOTE: While querying GL is considered slow it's not remotely as slow -// as uploading a texture. On top of that you're unlikely to call this in -// a perf critical loop. Even if upload a texture every frame that's unlikely -// to be more than 1 or 2 textures a frame. In other words, the benefits of -// making the API easy to use outweigh any supposed perf benefits -// -// Also note I get that having one global of these is bad practice. -// As long as it's used correctly it means no garbage which probably -// doesn't matter when dealing with textures but old habits die hard. - - -var lastPackState = {}; -/** - * Saves any packing state that will be set based on the options. - * @param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set. - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - */ - -function savePackState(gl, options) { - if (options.colorspaceConversion !== undefined) { - lastPackState.colorspaceConversion = gl.getParameter(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL); - gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, options.colorspaceConversion); - } - - if (options.premultiplyAlpha !== undefined) { - lastPackState.premultiplyAlpha = gl.getParameter(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL); - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, options.premultiplyAlpha); - } - - if (options.flipY !== undefined) { - lastPackState.flipY = gl.getParameter(gl.UNPACK_FLIP_Y_WEBGL); - gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, options.flipY); - } -} -/** - * Restores any packing state that was set based on the options. - * @param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set. - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - */ - - -function restorePackState(gl, options) { - if (options.colorspaceConversion !== undefined) { - gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, lastPackState.colorspaceConversion); - } - - if (options.premultiplyAlpha !== undefined) { - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, lastPackState.premultiplyAlpha); - } - - if (options.flipY !== undefined) { - gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, lastPackState.flipY); - } -} -/** - * Saves state related to data size - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - */ - - -function saveSkipState(gl) { - lastPackState.unpackAlignment = gl.getParameter(gl.UNPACK_ALIGNMENT); - - if (utils.isWebGL2(gl)) { - lastPackState.unpackRowLength = gl.getParameter(gl.UNPACK_ROW_LENGTH); - lastPackState.unpackImageHeight = gl.getParameter(gl.UNPACK_IMAGE_HEIGHT); - lastPackState.unpackSkipPixels = gl.getParameter(gl.UNPACK_SKIP_PIXELS); - lastPackState.unpackSkipRows = gl.getParameter(gl.UNPACK_SKIP_ROWS); - lastPackState.unpackSkipImages = gl.getParameter(gl.UNPACK_SKIP_IMAGES); - } -} -/** - * Restores state related to data size - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - */ - - -function restoreSkipState(gl) { - gl.pixelStorei(gl.UNPACK_ALIGNMENT, lastPackState.unpackAlignment); - - if (utils.isWebGL2(gl)) { - gl.pixelStorei(gl.UNPACK_ROW_LENGTH, lastPackState.unpackRowLength); - gl.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, lastPackState.unpackImageHeight); - gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, lastPackState.unpackSkipPixels); - gl.pixelStorei(gl.UNPACK_SKIP_ROWS, lastPackState.unpackSkipRows); - gl.pixelStorei(gl.UNPACK_SKIP_IMAGES, lastPackState.unpackSkipImages); - } -} -/** - * Sets the parameters of a texture or sampler - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - * @param {number|WebGLSampler} target texture target or sampler - * @param {function()} parameteriFn texParamteri or samplerParameteri fn - * @param {WebGLTexture} tex the WebGLTexture to set parameters for - * @param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set. - * This is often the same options you passed in when you created the texture. - */ - - -function setTextureSamplerParameters(gl, target, parameteriFn, options) { - if (options.minMag) { - parameteriFn.call(gl, target, gl.TEXTURE_MIN_FILTER, options.minMag); - parameteriFn.call(gl, target, gl.TEXTURE_MAG_FILTER, options.minMag); - } - - if (options.min) { - parameteriFn.call(gl, target, gl.TEXTURE_MIN_FILTER, options.min); - } - - if (options.mag) { - parameteriFn.call(gl, target, gl.TEXTURE_MAG_FILTER, options.mag); - } - - if (options.wrap) { - parameteriFn.call(gl, target, gl.TEXTURE_WRAP_S, options.wrap); - parameteriFn.call(gl, target, gl.TEXTURE_WRAP_T, options.wrap); - - if (target === gl.TEXTURE_3D || helper.isSampler(gl, target)) { - parameteriFn.call(gl, target, gl.TEXTURE_WRAP_R, options.wrap); - } - } - - if (options.wrapR) { - parameteriFn.call(gl, target, gl.TEXTURE_WRAP_R, options.wrapR); - } - - if (options.wrapS) { - parameteriFn.call(gl, target, gl.TEXTURE_WRAP_S, options.wrapS); - } - - if (options.wrapT) { - parameteriFn.call(gl, target, gl.TEXTURE_WRAP_T, options.wrapT); - } - - if (options.minLod) { - parameteriFn.call(gl, target, gl.TEXTURE_MIN_LOD, options.minLod); - } - - if (options.maxLod) { - parameteriFn.call(gl, target, gl.TEXTURE_MAX_LOD, options.maxLod); - } - - if (options.baseLevel) { - parameteriFn.call(gl, target, gl.TEXTURE_BASE_LEVEL, options.baseLevel); - } - - if (options.maxLevel) { - parameteriFn.call(gl, target, gl.TEXTURE_MAX_LEVEL, options.maxLevel); - } -} -/** - * Sets the texture parameters of a texture. - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - * @param {WebGLTexture} tex the WebGLTexture to set parameters for - * @param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set. - * This is often the same options you passed in when you created the texture. - * @memberOf module:twgl/textures - */ - - -function setTextureParameters(gl, tex, options) { - var target = options.target || gl.TEXTURE_2D; - gl.bindTexture(target, tex); - setTextureSamplerParameters(gl, target, gl.texParameteri, options); -} -/** - * Sets the sampler parameters of a sampler. - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - * @param {WebGLSampler} sampler the WebGLSampler to set parameters for - * @param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set. - * @memberOf module:twgl/textures - */ - - -function setSamplerParameters(gl, sampler, options) { - setTextureSamplerParameters(gl, sampler, gl.samplerParameteri, options); -} -/** - * Creates a new sampler object and sets parameters. - * - * Example: - * - * const sampler = twgl.createSampler(gl, { - * minMag: gl.NEAREST, // sets both TEXTURE_MIN_FILTER and TEXTURE_MAG_FILTER - * wrap: gl.CLAMP_TO_NEAREST, // sets both TEXTURE_WRAP_S and TEXTURE_WRAP_T and TEXTURE_WRAP_R - * }); - * - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - * @param {Object.} options A object of TextureOptions one per sampler. - * @return {Object.} the created samplers by name - */ - - -function createSampler(gl, options) { - var sampler = gl.createSampler(); - setSamplerParameters(gl, sampler, options); - return sampler; -} -/** - * Creates a multiple sampler objects and sets parameters on each. - * - * Example: - * - * const samplers = twgl.createSamplers(gl, { - * nearest: { - * minMag: gl.NEAREST, - * }, - * nearestClampS: { - * minMag: gl.NEAREST, - * wrapS: gl.CLAMP_TO_NEAREST, - * }, - * linear: { - * minMag: gl.LINEAR, - * }, - * nearestClamp: { - * minMag: gl.NEAREST, - * wrap: gl.CLAMP_TO_EDGE, - * }, - * linearClamp: { - * minMag: gl.LINEAR, - * wrap: gl.CLAMP_TO_EDGE, - * }, - * linearClampT: { - * minMag: gl.LINEAR, - * wrapT: gl.CLAMP_TO_EDGE, - * }, - * }); - * - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - * @param {module:twgl.TextureOptions} [options] A TextureOptions object with whatever parameters you want set on the sampler - */ - - -function createSamplers(gl, samplerOptions) { - var samplers = {}; - Object.keys(samplerOptions).forEach(function (name) { - samplers[name] = createSampler(gl, samplerOptions[name]); - }); - return samplers; -} -/** - * Makes a 1x1 pixel - * If no color is passed in uses the default color which can be set by calling `setDefaultTextureColor`. - * @param {(number[]|ArrayBufferView)} [color] The color using 0-1 values - * @return {Uint8Array} Unit8Array with color. - */ - - -function make1Pixel(color) { - color = color || defaults.textureColor; - - if (isArrayBuffer(color)) { - return color; - } - - return new Uint8Array([color[0] * 255, color[1] * 255, color[2] * 255, color[3] * 255]); -} -/** - * Sets filtering or generates mips for texture based on width or height - * If width or height is not passed in uses `options.width` and//or `options.height` - * - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - * @param {WebGLTexture} tex the WebGLTexture to set parameters for - * @param {module:twgl.TextureOptions} [options] A TextureOptions object with whatever parameters you want set. - * This is often the same options you passed in when you created the texture. - * @param {number} [width] width of texture - * @param {number} [height] height of texture - * @param {number} [internalFormat] The internalFormat parameter from texImage2D etc.. - * @param {number} [type] The type parameter for texImage2D etc.. - * @memberOf module:twgl/textures - */ - - -function setTextureFilteringForSize(gl, tex, options, width, height, internalFormat, type) { - options = options || defaults.textureOptions; - internalFormat = internalFormat || gl.RGBA; - type = type || gl.UNSIGNED_BYTE; - var target = options.target || gl.TEXTURE_2D; - width = width || options.width; - height = height || options.height; - gl.bindTexture(target, tex); - - if (canGenerateMipmap(gl, width, height, internalFormat, type)) { - gl.generateMipmap(target); - } else { - var filtering = canFilter(internalFormat, type) ? gl.LINEAR : gl.NEAREST; - gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, filtering); - gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, filtering); - gl.texParameteri(target, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(target, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - } -} - -function shouldAutomaticallySetTextureFilteringForSize(options) { - return options.auto === true || options.auto === undefined && options.level === undefined; -} -/** - * Gets an array of cubemap face enums - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - * @param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set. - * This is often the same options you passed in when you created the texture. - * @return {number[]} cubemap face enums - */ - - -function getCubeFaceOrder(gl, options) { - options = options || {}; - return options.cubeFaceOrder || [gl.TEXTURE_CUBE_MAP_POSITIVE_X, gl.TEXTURE_CUBE_MAP_NEGATIVE_X, gl.TEXTURE_CUBE_MAP_POSITIVE_Y, gl.TEXTURE_CUBE_MAP_NEGATIVE_Y, gl.TEXTURE_CUBE_MAP_POSITIVE_Z, gl.TEXTURE_CUBE_MAP_NEGATIVE_Z]; -} -/** - * @typedef {Object} FaceInfo - * @property {number} face gl enum for texImage2D - * @property {number} ndx face index (0 - 5) into source data - * @ignore - */ - -/** - * Gets an array of FaceInfos - * There's a bug in some NVidia drivers that will crash the driver if - * `gl.TEXTURE_CUBE_MAP_POSITIVE_X` is not uploaded first. So, we take - * the user's desired order from his faces to WebGL and make sure we - * do the faces in WebGL order - * - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - * @param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set. - * @return {FaceInfo[]} cubemap face infos. Arguably the `face` property of each element is redundent but - * it's needed internally to sort the array of `ndx` properties by `face`. - */ - - -function getCubeFacesWithNdx(gl, options) { - var faces = getCubeFaceOrder(gl, options); // work around bug in NVidia drivers. We have to upload the first face first else the driver crashes :( - - var facesWithNdx = faces.map(function (face, ndx) { - return { - face: face, - ndx: ndx - }; - }); - facesWithNdx.sort(function (a, b) { - return a.face - b.face; - }); - return facesWithNdx; -} -/** - * Set a texture from the contents of an element. Will also set - * texture filtering or generate mips based on the dimensions of the element - * unless `options.auto === false`. If `target === gl.TEXTURE_CUBE_MAP` will - * attempt to slice image into 1x6, 2x3, 3x2, or 6x1 images, one for each face. - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - * @param {WebGLTexture} tex the WebGLTexture to set parameters for - * @param {HTMLElement} element a canvas, img, or video element. - * @param {module:twgl.TextureOptions} [options] A TextureOptions object with whatever parameters you want set. - * This is often the same options you passed in when you created the texture. - * @memberOf module:twgl/textures - * @kind function - */ - - -function setTextureFromElement(gl, tex, element, options) { - options = options || defaults.textureOptions; - var target = options.target || gl.TEXTURE_2D; - var level = options.level || 0; - var width = element.width; - var height = element.height; - var internalFormat = options.internalFormat || options.format || gl.RGBA; - var formatType = getFormatAndTypeForInternalFormat(internalFormat); - var format = options.format || formatType.format; - var type = options.type || formatType.type; - savePackState(gl, options); - gl.bindTexture(target, tex); - - if (target === gl.TEXTURE_CUBE_MAP) { - // guess the parts - var imgWidth = element.width; - var imgHeight = element.height; - var size; - var slices; - - if (imgWidth / 6 === imgHeight) { - // It's 6x1 - size = imgHeight; - slices = [0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0]; - } else if (imgHeight / 6 === imgWidth) { - // It's 1x6 - size = imgWidth; - slices = [0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5]; - } else if (imgWidth / 3 === imgHeight / 2) { - // It's 3x2 - size = imgWidth / 3; - slices = [0, 0, 1, 0, 2, 0, 0, 1, 1, 1, 2, 1]; - } else if (imgWidth / 2 === imgHeight / 3) { - // It's 2x3 - size = imgWidth / 2; - slices = [0, 0, 1, 0, 0, 1, 1, 1, 0, 2, 1, 2]; - } else { - throw "can't figure out cube map from element: " + (element.src ? element.src : element.nodeName); - } - - if (ctx) { - ctx.canvas.width = size; - ctx.canvas.height = size; - width = size; - height = size; - getCubeFacesWithNdx(gl, options).forEach(function (f) { - var xOffset = slices[f.ndx * 2 + 0] * size; - var yOffset = slices[f.ndx * 2 + 1] * size; - ctx.drawImage(element, xOffset, yOffset, size, size, 0, 0, size, size); - gl.texImage2D(f.face, level, internalFormat, format, type, ctx.canvas); - }); // Free up the canvas memory - - ctx.canvas.width = 1; - ctx.canvas.height = 1; - } else if (_globalObject.default.createImageBitmap) { - // NOTE: It seems like we should prefer ImageBitmap because unlike canvas it's - // note lossy? (alpha is not premultiplied? although I'm not sure what - width = size; - height = size; - getCubeFacesWithNdx(gl, options).forEach(function (f) { - var xOffset = slices[f.ndx * 2 + 0] * size; - var yOffset = slices[f.ndx * 2 + 1] * size; // We can't easily use a default texture color here as it would have to match - // the type across all faces where as with a 2D one there's only one face - // so we're replacing everything all at once. It also has to be the correct size. - // On the other hand we need all faces to be the same size so as one face loads - // the rest match else the texture will be unrenderable. - - gl.texImage2D(f.face, level, internalFormat, size, size, 0, format, type, null); - - _globalObject.default.createImageBitmap(element, xOffset, yOffset, size, size, { - premultiplyAlpha: 'none', - colorSpaceConversion: 'none' - }).then(function (imageBitmap) { - savePackState(gl, options); - gl.bindTexture(target, tex); - gl.texImage2D(f.face, level, internalFormat, format, type, imageBitmap); - restorePackState(gl, options); - - if (shouldAutomaticallySetTextureFilteringForSize(options)) { - setTextureFilteringForSize(gl, tex, options, width, height, internalFormat, type); - } - }); - }); - } - } else if (target === gl.TEXTURE_3D || target === gl.TEXTURE_2D_ARRAY) { - var smallest = Math.min(element.width, element.height); - var largest = Math.max(element.width, element.height); - var depth = largest / smallest; - - if (depth % 1 !== 0) { - throw "can not compute 3D dimensions of element"; - } - - var xMult = element.width === largest ? 1 : 0; - var yMult = element.height === largest ? 1 : 0; - saveSkipState(gl); - gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1); - gl.pixelStorei(gl.UNPACK_ROW_LENGTH, element.width); - gl.pixelStorei(gl.UNPACK_IMAGE_HEIGHT, 0); - gl.pixelStorei(gl.UNPACK_SKIP_IMAGES, 0); - gl.texImage3D(target, level, internalFormat, smallest, smallest, smallest, 0, format, type, null); - - for (var d = 0; d < depth; ++d) { - var srcX = d * smallest * xMult; - var srcY = d * smallest * yMult; - gl.pixelStorei(gl.UNPACK_SKIP_PIXELS, srcX); - gl.pixelStorei(gl.UNPACK_SKIP_ROWS, srcY); - gl.texSubImage3D(target, level, 0, 0, d, smallest, smallest, 1, format, type, element); - } - - restoreSkipState(gl); - } else { - gl.texImage2D(target, level, internalFormat, format, type, element); - } - - restorePackState(gl, options); - - if (shouldAutomaticallySetTextureFilteringForSize(options)) { - setTextureFilteringForSize(gl, tex, options, width, height, internalFormat, type); - } - - setTextureParameters(gl, tex, options); -} - -function noop() {} -/** - * Loads an image - * @param {string} url url to image - * @param {string} crossOrigin - * @param {function(err, img)} [callback] a callback that's passed an error and the image. The error will be non-null - * if there was an error - * @return {HTMLImageElement} the image being loaded. - */ - - -function loadImage(url, crossOrigin, callback) { - callback = callback || noop; - var img; - - if (_globalObject.default.Image) { - img = new _globalObject.default.Image(); - crossOrigin = crossOrigin !== undefined ? crossOrigin : defaults.crossOrigin; - - if (crossOrigin !== undefined) { - img.crossOrigin = crossOrigin; - } - - var clearEventHandlers = function clearEventHandlers() { - img.removeEventListener('error', onError); // eslint-disable-line - - img.removeEventListener('load', onLoad); // eslint-disable-line - - img = null; - }; - - var onError = function onError() { - var msg = "couldn't load image: " + url; - helper.error(msg); - callback(msg, img); - clearEventHandlers(); - }; - - var onLoad = function onLoad() { - callback(null, img); - clearEventHandlers(); - }; - - img.addEventListener('error', onError); - img.addEventListener('load', onLoad); - img.src = url; - return img; - } else if (_globalObject.default.ImageBitmap) { - var err; - var bm; - - var cb = function cb() { - callback(err, bm); - }; - - var options = {}; - - if (crossOrigin) { - options.mode = 'cors'; // TODO: not sure how to translate image.crossOrigin - } - - fetch(url, options).then(function (response) { - if (!response.ok) { - throw response; - } - - return response.blob(); - }).then(function (blob) { - return _globalObject.default.createImageBitmap(blob, { - premultiplyAlpha: 'none', - colorSpaceConversion: 'none' - }); - }).then(function (bitmap) { - // not sure if this works. We don't want - // to catch the user's error. So, call - // the callback in a timeout so we're - // not in this scope inside the promise. - bm = bitmap; - setTimeout(cb); - }).catch(function (e) { - err = e; - setTimeout(cb); - }); - img = null; - } - - return img; -} -/** - * check if object is a TexImageSource - * - * @param {Object} obj Object to test - * @return {boolean} true if object is a TexImageSource - */ - - -function isTexImageSource(obj) { - return _globalObject.default.ImageBitmap && obj instanceof _globalObject.default.ImageBitmap || _globalObject.default.ImageData && obj instanceof _globalObject.default.ImageData || _globalObject.default.HTMLElement && obj instanceof _globalObject.default.HTMLElement; -} -/** - * if obj is an TexImageSource then just - * uses it otherwise if obj is a string - * then load it first. - * - * @param {string|TexImageSource} obj - * @param {string} crossOrigin - * @param {function(err, img)} [callback] a callback that's passed an error and the image. The error will be non-null - * if there was an error - */ - - -function loadAndUseImage(obj, crossOrigin, callback) { - if (isTexImageSource(obj)) { - setTimeout(function () { - callback(null, obj); - }); - return obj; - } - - return loadImage(obj, crossOrigin, callback); -} -/** - * Sets a texture to a 1x1 pixel color. If `options.color === false` is nothing happens. If it's not set - * the default texture color is used which can be set by calling `setDefaultTextureColor`. - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - * @param {WebGLTexture} tex the WebGLTexture to set parameters for - * @param {module:twgl.TextureOptions} [options] A TextureOptions object with whatever parameters you want set. - * This is often the same options you passed in when you created the texture. - * @memberOf module:twgl/textures - */ - - -function setTextureTo1PixelColor(gl, tex, options) { - options = options || defaults.textureOptions; - var target = options.target || gl.TEXTURE_2D; - gl.bindTexture(target, tex); - - if (options.color === false) { - return; - } // Assume it's a URL - // Put 1x1 pixels in texture. That makes it renderable immediately regardless of filtering. - - - var color = make1Pixel(options.color); - - if (target === gl.TEXTURE_CUBE_MAP) { - for (var ii = 0; ii < 6; ++ii) { - gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + ii, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, color); - } - } else if (target === gl.TEXTURE_3D || target === gl.TEXTURE_2D_ARRAY) { - gl.texImage3D(target, 0, gl.RGBA, 1, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, color); - } else { - gl.texImage2D(target, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, color); - } -} -/** - * The src image(s) used to create a texture. - * - * When you call {@link module:twgl.createTexture} or {@link module:twgl.createTextures} - * you can pass in urls for images to load into the textures. If it's a single url - * then this will be a single HTMLImageElement. If it's an array of urls used for a cubemap - * this will be a corresponding array of images for the cubemap. - * - * @typedef {HTMLImageElement|HTMLImageElement[]} TextureSrc - * @memberOf module:twgl - */ - -/** - * A callback for when an image finished downloading and been uploaded into a texture - * @callback TextureReadyCallback - * @param {*} err If truthy there was an error. - * @param {WebGLTexture} texture the texture. - * @param {module:twgl.TextureSrc} souce image(s) used to as the src for the texture - * @memberOf module:twgl - */ - -/** - * A callback for when all images have finished downloading and been uploaded into their respective textures - * @callback TexturesReadyCallback - * @param {*} err If truthy there was an error. - * @param {Object.} textures the created textures by name. Same as returned by {@link module:twgl.createTextures}. - * @param {Object.} sources the image(s) used for the texture by name. - * @memberOf module:twgl - */ - -/** - * A callback for when an image finished downloading and been uploaded into a texture - * @callback CubemapReadyCallback - * @param {*} err If truthy there was an error. - * @param {WebGLTexture} tex the texture. - * @param {HTMLImageElement[]} imgs the images for each face. - * @memberOf module:twgl - */ - -/** - * A callback for when an image finished downloading and been uploaded into a texture - * @callback ThreeDReadyCallback - * @param {*} err If truthy there was an error. - * @param {WebGLTexture} tex the texture. - * @param {HTMLImageElement[]} imgs the images for each slice. - * @memberOf module:twgl - */ - -/** - * Loads a texture from an image from a Url as specified in `options.src` - * If `options.color !== false` will set the texture to a 1x1 pixel color so that the texture is - * immediately useable. It will be updated with the contents of the image once the image has finished - * downloading. Filtering options will be set as approriate for image unless `options.auto === false`. - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - * @param {WebGLTexture} tex the WebGLTexture to set parameters for - * @param {module:twgl.TextureOptions} [options] A TextureOptions object with whatever parameters you want set. - * @param {module:twgl.TextureReadyCallback} [callback] A function to be called when the image has finished loading. err will - * be non null if there was an error. - * @return {HTMLImageElement} the image being downloaded. - * @memberOf module:twgl/textures - */ - - -function loadTextureFromUrl(gl, tex, options, callback) { - callback = callback || noop; - options = options || defaults.textureOptions; - setTextureTo1PixelColor(gl, tex, options); // Because it's async we need to copy the options. - - options = Object.assign({}, options); - var img = loadAndUseImage(options.src, options.crossOrigin, function (err, img) { - if (err) { - callback(err, tex, img); - } else { - setTextureFromElement(gl, tex, img, options); - callback(null, tex, img); - } - }); - return img; -} -/** - * Loads a cubemap from 6 urls or TexImageSources as specified in `options.src`. Will set the cubemap to a 1x1 pixel color - * so that it is usable immediately unless `option.color === false`. - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - * @param {WebGLTexture} tex the WebGLTexture to set parameters for - * @param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set. - * @param {module:twgl.CubemapReadyCallback} [callback] A function to be called when all the images have finished loading. err will - * be non null if there was an error. - * @memberOf module:twgl/textures - */ - - -function loadCubemapFromUrls(gl, tex, options, callback) { - callback = callback || noop; - var urls = options.src; - - if (urls.length !== 6) { - throw "there must be 6 urls for a cubemap"; - } - - var level = options.level || 0; - var internalFormat = options.internalFormat || options.format || gl.RGBA; - var formatType = getFormatAndTypeForInternalFormat(internalFormat); - var format = options.format || formatType.format; - var type = options.type || gl.UNSIGNED_BYTE; - var target = options.target || gl.TEXTURE_2D; - - if (target !== gl.TEXTURE_CUBE_MAP) { - throw "target must be TEXTURE_CUBE_MAP"; - } - - setTextureTo1PixelColor(gl, tex, options); // Because it's async we need to copy the options. - - options = Object.assign({}, options); - var numToLoad = 6; - var errors = []; - var faces = getCubeFaceOrder(gl, options); - var imgs; // eslint-disable-line - - function uploadImg(faceTarget) { - return function (err, img) { - --numToLoad; - - if (err) { - errors.push(err); - } else { - if (img.width !== img.height) { - errors.push("cubemap face img is not a square: " + img.src); - } else { - savePackState(gl, options); - gl.bindTexture(target, tex); // So assuming this is the first image we now have one face that's img sized - // and 5 faces that are 1x1 pixel so size the other faces - - if (numToLoad === 5) { - // use the default order - getCubeFaceOrder(gl).forEach(function (otherTarget) { - // Should we re-use the same face or a color? - gl.texImage2D(otherTarget, level, internalFormat, format, type, img); - }); - } else { - gl.texImage2D(faceTarget, level, internalFormat, format, type, img); - } - - restorePackState(gl, options); - - if (shouldAutomaticallySetTextureFilteringForSize(options)) { - gl.generateMipmap(target); - } - } - } - - if (numToLoad === 0) { - callback(errors.length ? errors : undefined, tex, imgs); - } - }; - } - - imgs = urls.map(function (url, ndx) { - return loadAndUseImage(url, options.crossOrigin, uploadImg(faces[ndx])); - }); -} -/** - * Loads a 2d array or 3d texture from urls OR TexImageSources as specified in `options.src`. - * Will set the texture to a 1x1 pixel color - * so that it is usable immediately unless `option.color === false`. - * - * If the width and height is not specified the width and height of the first - * image loaded will be used. Note that since images are loaded async - * which image downloads first is unknown. - * - * If an image is not the same size as the width and height it will be scaled - * to that width and height. - * - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - * @param {WebGLTexture} tex the WebGLTexture to set parameters for - * @param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set. - * @param {module:twgl.ThreeDReadyCallback} [callback] A function to be called when all the images have finished loading. err will - * be non null if there was an error. - * @memberOf module:twgl/textures - */ - - -function loadSlicesFromUrls(gl, tex, options, callback) { - callback = callback || noop; - var urls = options.src; - var internalFormat = options.internalFormat || options.format || gl.RGBA; - var formatType = getFormatAndTypeForInternalFormat(internalFormat); - var format = options.format || formatType.format; - var type = options.type || gl.UNSIGNED_BYTE; - var target = options.target || gl.TEXTURE_2D_ARRAY; - - if (target !== gl.TEXTURE_3D && target !== gl.TEXTURE_2D_ARRAY) { - throw "target must be TEXTURE_3D or TEXTURE_2D_ARRAY"; - } - - setTextureTo1PixelColor(gl, tex, options); // Because it's async we need to copy the options. - - options = Object.assign({}, options); - var numToLoad = urls.length; - var errors = []; - var imgs; // eslint-disable-line - - var level = options.level || 0; - var width = options.width; - var height = options.height; - var depth = urls.length; - var firstImage = true; - - function uploadImg(slice) { - return function (err, img) { - --numToLoad; - - if (err) { - errors.push(err); - } else { - savePackState(gl, options); - gl.bindTexture(target, tex); - - if (firstImage) { - firstImage = false; - width = options.width || img.width; - height = options.height || img.height; - gl.texImage3D(target, level, internalFormat, width, height, depth, 0, format, type, null); // put it in every slice otherwise some slices will be 0,0,0,0 - - for (var s = 0; s < depth; ++s) { - gl.texSubImage3D(target, level, 0, 0, s, width, height, 1, format, type, img); - } - } else { - var src = img; - - if (img.width !== width || img.height !== height) { - // Size the image to fix - src = ctx.canvas; - ctx.canvas.width = width; - ctx.canvas.height = height; - ctx.drawImage(img, 0, 0, width, height); - } - - gl.texSubImage3D(target, level, 0, 0, slice, width, height, 1, format, type, src); // free the canvas memory - - if (src === ctx.canvas) { - ctx.canvas.width = 0; - ctx.canvas.height = 0; - } - } - - restorePackState(gl, options); - - if (shouldAutomaticallySetTextureFilteringForSize(options)) { - gl.generateMipmap(target); - } - } - - if (numToLoad === 0) { - callback(errors.length ? errors : undefined, tex, imgs); - } - }; - } - - imgs = urls.map(function (url, ndx) { - return loadAndUseImage(url, options.crossOrigin, uploadImg(ndx)); - }); -} -/** - * Sets a texture from an array or typed array. If the width or height is not provided will attempt to - * guess the size. See {@link module:twgl.TextureOptions}. - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - * @param {WebGLTexture} tex the WebGLTexture to set parameters for - * @param {(number[]|ArrayBufferView)} src An array or typed arry with texture data. - * @param {module:twgl.TextureOptions} [options] A TextureOptions object with whatever parameters you want set. - * This is often the same options you passed in when you created the texture. - * @memberOf module:twgl/textures - */ - - -function setTextureFromArray(gl, tex, src, options) { - options = options || defaults.textureOptions; - var target = options.target || gl.TEXTURE_2D; - gl.bindTexture(target, tex); - var width = options.width; - var height = options.height; - var depth = options.depth; - var level = options.level || 0; - var internalFormat = options.internalFormat || options.format || gl.RGBA; - var formatType = getFormatAndTypeForInternalFormat(internalFormat); - var format = options.format || formatType.format; - var type = options.type || getTextureTypeForArrayType(gl, src, formatType.type); - - if (!isArrayBuffer(src)) { - var Type = typedArrays.getTypedArrayTypeForGLType(type); - src = new Type(src); - } else if (src instanceof Uint8ClampedArray) { - src = new Uint8Array(src.buffer); - } - - var bytesPerElement = getBytesPerElementForInternalFormat(internalFormat, type); - var numElements = src.byteLength / bytesPerElement; // TODO: check UNPACK_ALIGNMENT? - - if (numElements % 1) { - throw "length wrong size for format: " + utils.glEnumToString(gl, format); - } - - var dimensions; - - if (target === gl.TEXTURE_3D) { - if (!width && !height && !depth) { - var size = Math.cbrt(numElements); - - if (size % 1 !== 0) { - throw "can't guess cube size of array of numElements: " + numElements; - } - - width = size; - height = size; - depth = size; - } else if (width && (!height || !depth)) { - dimensions = guessDimensions(gl, target, height, depth, numElements / width); - height = dimensions.width; - depth = dimensions.height; - } else if (height && (!width || !depth)) { - dimensions = guessDimensions(gl, target, width, depth, numElements / height); - width = dimensions.width; - depth = dimensions.height; - } else { - dimensions = guessDimensions(gl, target, width, height, numElements / depth); - width = dimensions.width; - height = dimensions.height; - } - } else { - dimensions = guessDimensions(gl, target, width, height, numElements); - width = dimensions.width; - height = dimensions.height; - } - - saveSkipState(gl); - gl.pixelStorei(gl.UNPACK_ALIGNMENT, options.unpackAlignment || 1); - savePackState(gl, options); - - if (target === gl.TEXTURE_CUBE_MAP) { - var elementsPerElement = bytesPerElement / src.BYTES_PER_ELEMENT; - var faceSize = numElements / 6 * elementsPerElement; - getCubeFacesWithNdx(gl, options).forEach(function (f) { - var offset = faceSize * f.ndx; - var data = src.subarray(offset, offset + faceSize); - gl.texImage2D(f.face, level, internalFormat, width, height, 0, format, type, data); - }); - } else if (target === gl.TEXTURE_3D) { - gl.texImage3D(target, level, internalFormat, width, height, depth, 0, format, type, src); - } else { - gl.texImage2D(target, level, internalFormat, width, height, 0, format, type, src); - } - - restorePackState(gl, options); - restoreSkipState(gl); - return { - width: width, - height: height, - depth: depth, - type: type - }; -} -/** - * Sets a texture with no contents of a certain size. In other words calls `gl.texImage2D` with `null`. - * You must set `options.width` and `options.height`. - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - * @param {WebGLTexture} tex the WebGLTexture to set parameters for - * @param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set. - * @memberOf module:twgl/textures - */ - - -function setEmptyTexture(gl, tex, options) { - var target = options.target || gl.TEXTURE_2D; - gl.bindTexture(target, tex); - var level = options.level || 0; - var internalFormat = options.internalFormat || options.format || gl.RGBA; - var formatType = getFormatAndTypeForInternalFormat(internalFormat); - var format = options.format || formatType.format; - var type = options.type || formatType.type; - savePackState(gl, options); - - if (target === gl.TEXTURE_CUBE_MAP) { - for (var ii = 0; ii < 6; ++ii) { - gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + ii, level, internalFormat, options.width, options.height, 0, format, type, null); - } - } else if (target === gl.TEXTURE_3D) { - gl.texImage3D(target, level, internalFormat, options.width, options.height, options.depth, 0, format, type, null); - } else { - gl.texImage2D(target, level, internalFormat, options.width, options.height, 0, format, type, null); - } - - restorePackState(gl, options); -} -/** - * Creates a texture based on the options passed in. - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - * @param {module:twgl.TextureOptions} [options] A TextureOptions object with whatever parameters you want set. - * @param {module:twgl.TextureReadyCallback} [callback] A callback called when an image has been downloaded and uploaded to the texture. - * @return {WebGLTexture} the created texture. - * @memberOf module:twgl/textures - */ - - -function createTexture(gl, options, callback) { - callback = callback || noop; - options = options || defaults.textureOptions; - var tex = gl.createTexture(); - var target = options.target || gl.TEXTURE_2D; - var width = options.width || 1; - var height = options.height || 1; - var internalFormat = options.internalFormat || gl.RGBA; - var formatType = getFormatAndTypeForInternalFormat(internalFormat); - var type = options.type || formatType.type; - gl.bindTexture(target, tex); - - if (target === gl.TEXTURE_CUBE_MAP) { - // this should have been the default for CUBEMAPS :( - gl.texParameteri(target, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(target, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - } - - var src = options.src; - - if (src) { - if (typeof src === "function") { - src = src(gl, options); - } - - if (typeof src === "string") { - loadTextureFromUrl(gl, tex, options, callback); - } else if (isArrayBuffer(src) || Array.isArray(src) && (typeof src[0] === 'number' || Array.isArray(src[0]) || isArrayBuffer(src[0]))) { - var dimensions = setTextureFromArray(gl, tex, src, options); - width = dimensions.width; - height = dimensions.height; - type = dimensions.type; - } else if (Array.isArray(src) && (typeof src[0] === 'string' || isTexImageSource(src[0]))) { - if (target === gl.TEXTURE_CUBE_MAP) { - loadCubemapFromUrls(gl, tex, options, callback); - } else { - loadSlicesFromUrls(gl, tex, options, callback); - } - } else if (isTexImageSource(src)) { - setTextureFromElement(gl, tex, src, options); - width = src.width; - height = src.height; - } else { - throw "unsupported src type"; - } - } else { - setEmptyTexture(gl, tex, options); - } - - if (shouldAutomaticallySetTextureFilteringForSize(options)) { - setTextureFilteringForSize(gl, tex, options, width, height, internalFormat, type); - } - - setTextureParameters(gl, tex, options); - return tex; -} -/** - * Resizes a texture based on the options passed in. - * - * Note: This is not a generic resize anything function. - * It's mostly used by {@link module:twgl.resizeFramebufferInfo} - * It will use `options.src` if it exists to try to determine a `type` - * otherwise it will assume `gl.UNSIGNED_BYTE`. No data is provided - * for the texture. Texture parameters will be set accordingly - * - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - * @param {WebGLTexture} tex the texture to resize - * @param {module:twgl.TextureOptions} options A TextureOptions object with whatever parameters you want set. - * @param {number} [width] the new width. If not passed in will use `options.width` - * @param {number} [height] the new height. If not passed in will use `options.height` - * @memberOf module:twgl/textures - */ - - -function resizeTexture(gl, tex, options, width, height) { - width = width || options.width; - height = height || options.height; - var target = options.target || gl.TEXTURE_2D; - gl.bindTexture(target, tex); - var level = options.level || 0; - var internalFormat = options.internalFormat || options.format || gl.RGBA; - var formatType = getFormatAndTypeForInternalFormat(internalFormat); - var format = options.format || formatType.format; - var type; - var src = options.src; - - if (!src) { - type = options.type || formatType.type; - } else if (isArrayBuffer(src) || Array.isArray(src) && typeof src[0] === 'number') { - type = options.type || getTextureTypeForArrayType(gl, src, formatType.type); - } else { - type = options.type || formatType.type; - } - - if (target === gl.TEXTURE_CUBE_MAP) { - for (var ii = 0; ii < 6; ++ii) { - gl.texImage2D(gl.TEXTURE_CUBE_MAP_POSITIVE_X + ii, level, internalFormat, width, height, 0, format, type, null); - } - } else { - gl.texImage2D(target, level, internalFormat, width, height, 0, format, type, null); - } -} -/** - * Check if a src is an async request. - * if src is a string we're going to download an image - * if src is an array of strings we're going to download cubemap images - * @param {*} src The src from a TextureOptions - * @returns {bool} true if src is async. - */ - - -function isAsyncSrc(src) { - return typeof src === 'string' || Array.isArray(src) && typeof src[0] === 'string'; -} -/** - * Creates a bunch of textures based on the passed in options. - * - * Example: - * - * const textures = twgl.createTextures(gl, { - * // a power of 2 image - * hftIcon: { src: "images/hft-icon-16.png", mag: gl.NEAREST }, - * // a non-power of 2 image - * clover: { src: "images/clover.jpg" }, - * // From a canvas - * fromCanvas: { src: ctx.canvas }, - * // A cubemap from 6 images - * yokohama: { - * target: gl.TEXTURE_CUBE_MAP, - * src: [ - * 'images/yokohama/posx.jpg', - * 'images/yokohama/negx.jpg', - * 'images/yokohama/posy.jpg', - * 'images/yokohama/negy.jpg', - * 'images/yokohama/posz.jpg', - * 'images/yokohama/negz.jpg', - * ], - * }, - * // A cubemap from 1 image (can be 1x6, 2x3, 3x2, 6x1) - * goldengate: { - * target: gl.TEXTURE_CUBE_MAP, - * src: 'images/goldengate.jpg', - * }, - * // A 2x2 pixel texture from a JavaScript array - * checker: { - * mag: gl.NEAREST, - * min: gl.LINEAR, - * src: [ - * 255,255,255,255, - * 192,192,192,255, - * 192,192,192,255, - * 255,255,255,255, - * ], - * }, - * // a 1x2 pixel texture from a typed array. - * stripe: { - * mag: gl.NEAREST, - * min: gl.LINEAR, - * format: gl.LUMINANCE, - * src: new Uint8Array([ - * 255, - * 128, - * 255, - * 128, - * 255, - * 128, - * 255, - * 128, - * ]), - * width: 1, - * }, - * }); - * - * Now - * - * * `textures.hftIcon` will be a 2d texture - * * `textures.clover` will be a 2d texture - * * `textures.fromCanvas` will be a 2d texture - * * `textures.yohohama` will be a cubemap texture - * * `textures.goldengate` will be a cubemap texture - * * `textures.checker` will be a 2d texture - * * `textures.stripe` will be a 2d texture - * - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - * @param {Object.} options A object of TextureOptions one per texture. - * @param {module:twgl.TexturesReadyCallback} [callback] A callback called when all textures have been downloaded. - * @return {Object.} the created textures by name - * @memberOf module:twgl/textures - */ - - -function createTextures(gl, textureOptions, callback) { - callback = callback || noop; - var numDownloading = 0; - var errors = []; - var textures = {}; - var images = {}; - - function callCallbackIfReady() { - if (numDownloading === 0) { - setTimeout(function () { - callback(errors.length ? errors : undefined, textures, images); - }, 0); - } - } - - Object.keys(textureOptions).forEach(function (name) { - var options = textureOptions[name]; - var onLoadFn; - - if (isAsyncSrc(options.src)) { - onLoadFn = function onLoadFn(err, tex, img) { - images[name] = img; - --numDownloading; - - if (err) { - errors.push(err); - } - - callCallbackIfReady(); - }; - - ++numDownloading; - } - - textures[name] = createTexture(gl, options, onLoadFn); - }); // queue the callback if there are no images to download. - // We do this because if your code is structured to wait for - // images to download but then you comment out all the async - // images your code would break. - - callCallbackIfReady(); - return textures; -} // Using quotes prevents Uglify from changing the names. -// No speed diff AFAICT. - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -var _exportNames = { - m4: true, - v3: true, - primitives: true -}; -exports.primitives = exports.v3 = exports.m4 = void 0; - -var m4 = _interopRequireWildcard(__webpack_require__(6)); - -exports.m4 = m4; - -var v3 = _interopRequireWildcard(__webpack_require__(3)); - -exports.v3 = v3; - -var primitives = _interopRequireWildcard(__webpack_require__(10)); - -exports.primitives = primitives; - -var _twgl = __webpack_require__(11); - -Object.keys(_twgl).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - exports[key] = _twgl[key]; -}); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -exports.create3DFVertices = create3DFVertices; -exports.createAugmentedTypedArray = createAugmentedTypedArray; -exports.createCubeVertices = createCubeVertices; -exports.createPlaneVertices = createPlaneVertices; -exports.createSphereVertices = createSphereVertices; -exports.createTruncatedConeVertices = createTruncatedConeVertices; -exports.createXYQuadVertices = createXYQuadVertices; -exports.createCresentVertices = createCresentVertices; -exports.createCylinderVertices = createCylinderVertices; -exports.createTorusVertices = createTorusVertices; -exports.createDiscVertices = createDiscVertices; -exports.deindexVertices = deindexVertices; -exports.flattenNormals = flattenNormals; -exports.makeRandomVertexColors = makeRandomVertexColors; -exports.reorientDirections = reorientDirections; -exports.reorientNormals = reorientNormals; -exports.reorientPositions = reorientPositions; -exports.reorientVertices = reorientVertices; -exports.concatVertices = concatVertices; -exports.duplicateVertices = duplicateVertices; -exports.createDiscBuffers = exports.createDiscBufferInfo = exports.createTorusBuffers = exports.createTorusBufferInfo = exports.createCylinderBuffers = exports.createCylinderBufferInfo = exports.createCresentBuffers = exports.createCresentBufferInfo = exports.createXYQuadBuffers = exports.createXYQuadBufferInfo = exports.createTruncatedConeBuffers = exports.createTruncatedConeBufferInfo = exports.createSphereBuffers = exports.createSphereBufferInfo = exports.createPlaneBuffers = exports.createPlaneBufferInfo = exports.createCubeBuffers = exports.createCubeBufferInfo = exports.create3DFBuffers = exports.create3DFBufferInfo = void 0; - -var attributes = _interopRequireWildcard(__webpack_require__(7)); - -var helper = _interopRequireWildcard(__webpack_require__(0)); - -var typedArrays = _interopRequireWildcard(__webpack_require__(1)); - -var m4 = _interopRequireWildcard(__webpack_require__(6)); - -var v3 = _interopRequireWildcard(__webpack_require__(3)); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -/* - * Copyright 2015, Gregg Tavares. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Gregg Tavares. nor the names of his - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * Various functions to make simple primitives - * - * note: Most primitive functions come in 3 styles - * - * * `createSomeShapeBufferInfo` - * - * These functions are almost always the functions you want to call. They - * create vertices then make WebGLBuffers and create {@link module:twgl.AttribInfo}s - * returing a {@link module:twgl.BufferInfo} you can pass to {@link module:twgl.setBuffersAndAttributes} - * and {@link module:twgl.drawBufferInfo} etc... - * - * * `createSomeShapeBuffers` - * - * These create WebGLBuffers and put your data in them but nothing else. - * It's a shortcut to doing it yourself if you don't want to use - * the higher level functions. - * - * * `createSomeShapeVertices` - * - * These just create vertices, no buffers. This allows you to manipulate the vertices - * or add more data before generating a {@link module:twgl.BufferInfo}. Once you're finished - * manipulating the vertices call {@link module:twgl.createBufferInfoFromArrays}. - * - * example: - * - * const arrays = twgl.primitives.createPlaneArrays(1); - * twgl.primitives.reorientVertices(arrays, m4.rotationX(Math.PI * 0.5)); - * const bufferInfo = twgl.createBufferInfoFromArrays(gl, arrays); - * - * @module twgl/primitives - */ -var getArray = attributes.getArray_; // eslint-disable-line - -var getNumComponents = attributes.getNumComponents_; // eslint-disable-line - -/** - * Add `push` to a typed array. It just keeps a 'cursor' - * and allows use to `push` values into the array so we - * don't have to manually compute offsets - * @param {TypedArray} typedArray TypedArray to augment - * @param {number} numComponents number of components. - */ - -function augmentTypedArray(typedArray, numComponents) { - var cursor = 0; - - typedArray.push = function () { - for (var ii = 0; ii < arguments.length; ++ii) { - var value = arguments[ii]; - - if (value instanceof Array || typedArrays.isArrayBuffer(value)) { - for (var jj = 0; jj < value.length; ++jj) { - typedArray[cursor++] = value[jj]; - } - } else { - typedArray[cursor++] = value; - } - } - }; - - typedArray.reset = function (opt_index) { - cursor = opt_index || 0; - }; - - typedArray.numComponents = numComponents; - Object.defineProperty(typedArray, 'numElements', { - get: function get() { - return this.length / this.numComponents | 0; - } - }); - return typedArray; -} -/** - * creates a typed array with a `push` function attached - * so that you can easily *push* values. - * - * `push` can take multiple arguments. If an argument is an array each element - * of the array will be added to the typed array. - * - * Example: - * - * const array = createAugmentedTypedArray(3, 2); // creates a Float32Array with 6 values - * array.push(1, 2, 3); - * array.push([4, 5, 6]); - * // array now contains [1, 2, 3, 4, 5, 6] - * - * Also has `numComponents` and `numElements` properties. - * - * @param {number} numComponents number of components - * @param {number} numElements number of elements. The total size of the array will be `numComponents * numElements`. - * @param {constructor} opt_type A constructor for the type. Default = `Float32Array`. - * @return {ArrayBufferView} A typed array. - * @memberOf module:twgl/primitives - */ - - -function createAugmentedTypedArray(numComponents, numElements, opt_type) { - var Type = opt_type || Float32Array; - return augmentTypedArray(new Type(numComponents * numElements), numComponents); -} - -function allButIndices(name) { - return name !== "indices"; -} -/** - * Given indexed vertices creates a new set of vertices unindexed by expanding the indexed vertices. - * @param {Object.} vertices The indexed vertices to deindex - * @return {Object.} The deindexed vertices - * @memberOf module:twgl/primitives - */ - - -function deindexVertices(vertices) { - var indices = vertices.indices; - var newVertices = {}; - var numElements = indices.length; - - function expandToUnindexed(channel) { - var srcBuffer = vertices[channel]; - var numComponents = srcBuffer.numComponents; - var dstBuffer = createAugmentedTypedArray(numComponents, numElements, srcBuffer.constructor); - - for (var ii = 0; ii < numElements; ++ii) { - var ndx = indices[ii]; - var offset = ndx * numComponents; - - for (var jj = 0; jj < numComponents; ++jj) { - dstBuffer.push(srcBuffer[offset + jj]); - } - } - - newVertices[channel] = dstBuffer; - } - - Object.keys(vertices).filter(allButIndices).forEach(expandToUnindexed); - return newVertices; -} -/** - * flattens the normals of deindexed vertices in place. - * @param {Object.} vertices The deindexed vertices who's normals to flatten - * @return {Object.} The flattened vertices (same as was passed in) - * @memberOf module:twgl/primitives - */ - - -function flattenNormals(vertices) { - if (vertices.indices) { - throw "can't flatten normals of indexed vertices. deindex them first"; - } - - var normals = vertices.normal; - var numNormals = normals.length; - - for (var ii = 0; ii < numNormals; ii += 9) { - // pull out the 3 normals for this triangle - var nax = normals[ii + 0]; - var nay = normals[ii + 1]; - var naz = normals[ii + 2]; - var nbx = normals[ii + 3]; - var nby = normals[ii + 4]; - var nbz = normals[ii + 5]; - var ncx = normals[ii + 6]; - var ncy = normals[ii + 7]; - var ncz = normals[ii + 8]; // add them - - var nx = nax + nbx + ncx; - var ny = nay + nby + ncy; - var nz = naz + nbz + ncz; // normalize them - - var length = Math.sqrt(nx * nx + ny * ny + nz * nz); - nx /= length; - ny /= length; - nz /= length; // copy them back in - - normals[ii + 0] = nx; - normals[ii + 1] = ny; - normals[ii + 2] = nz; - normals[ii + 3] = nx; - normals[ii + 4] = ny; - normals[ii + 5] = nz; - normals[ii + 6] = nx; - normals[ii + 7] = ny; - normals[ii + 8] = nz; - } - - return vertices; -} - -function applyFuncToV3Array(array, matrix, fn) { - var len = array.length; - var tmp = new Float32Array(3); - - for (var ii = 0; ii < len; ii += 3) { - fn(matrix, [array[ii], array[ii + 1], array[ii + 2]], tmp); - array[ii] = tmp[0]; - array[ii + 1] = tmp[1]; - array[ii + 2] = tmp[2]; - } -} - -function transformNormal(mi, v, dst) { - dst = dst || v3.create(); - var v0 = v[0]; - var v1 = v[1]; - var v2 = v[2]; - dst[0] = v0 * mi[0 * 4 + 0] + v1 * mi[0 * 4 + 1] + v2 * mi[0 * 4 + 2]; - dst[1] = v0 * mi[1 * 4 + 0] + v1 * mi[1 * 4 + 1] + v2 * mi[1 * 4 + 2]; - dst[2] = v0 * mi[2 * 4 + 0] + v1 * mi[2 * 4 + 1] + v2 * mi[2 * 4 + 2]; - return dst; -} -/** - * Reorients directions by the given matrix.. - * @param {number[]|TypedArray} array The array. Assumes value floats per element. - * @param {Matrix} matrix A matrix to multiply by. - * @return {number[]|TypedArray} the same array that was passed in - * @memberOf module:twgl/primitives - */ - - -function reorientDirections(array, matrix) { - applyFuncToV3Array(array, matrix, m4.transformDirection); - return array; -} -/** - * Reorients normals by the inverse-transpose of the given - * matrix.. - * @param {number[]|TypedArray} array The array. Assumes value floats per element. - * @param {Matrix} matrix A matrix to multiply by. - * @return {number[]|TypedArray} the same array that was passed in - * @memberOf module:twgl/primitives - */ - - -function reorientNormals(array, matrix) { - applyFuncToV3Array(array, m4.inverse(matrix), transformNormal); - return array; -} -/** - * Reorients positions by the given matrix. In other words, it - * multiplies each vertex by the given matrix. - * @param {number[]|TypedArray} array The array. Assumes value floats per element. - * @param {Matrix} matrix A matrix to multiply by. - * @return {number[]|TypedArray} the same array that was passed in - * @memberOf module:twgl/primitives - */ - - -function reorientPositions(array, matrix) { - applyFuncToV3Array(array, matrix, m4.transformPoint); - return array; -} -/** - * Reorients arrays by the given matrix. Assumes arrays have - * names that contains 'pos' could be reoriented as positions, - * 'binorm' or 'tan' as directions, and 'norm' as normals. - * - * @param {Object.} arrays The vertices to reorient - * @param {Matrix} matrix matrix to reorient by. - * @return {Object.} same arrays that were passed in. - * @memberOf module:twgl/primitives - */ - - -function reorientVertices(arrays, matrix) { - Object.keys(arrays).forEach(function (name) { - var array = arrays[name]; - - if (name.indexOf("pos") >= 0) { - reorientPositions(array, matrix); - } else if (name.indexOf("tan") >= 0 || name.indexOf("binorm") >= 0) { - reorientDirections(array, matrix); - } else if (name.indexOf("norm") >= 0) { - reorientNormals(array, matrix); - } - }); - return arrays; -} -/** - * Creates XY quad BufferInfo - * - * The default with no parameters will return a 2x2 quad with values from -1 to +1. - * If you want a unit quad with that goes from 0 to 1 you'd call it with - * - * twgl.primitives.createXYQuadBufferInfo(gl, 1, 0.5, 0.5); - * - * If you want a unit quad centered above 0,0 you'd call it with - * - * twgl.primitives.createXYQuadBufferInfo(gl, 1, 0, 0.5); - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext. - * @param {number} [size] the size across the quad. Defaults to 2 which means vertices will go from -1 to +1 - * @param {number} [xOffset] the amount to offset the quad in X - * @param {number} [yOffset] the amount to offset the quad in Y - * @return {Object.} the created XY Quad BufferInfo - * @memberOf module:twgl/primitives - * @function createXYQuadBufferInfo - */ - -/** - * Creates XY quad Buffers - * - * The default with no parameters will return a 2x2 quad with values from -1 to +1. - * If you want a unit quad with that goes from 0 to 1 you'd call it with - * - * twgl.primitives.createXYQuadBufferInfo(gl, 1, 0.5, 0.5); - * - * If you want a unit quad centered above 0,0 you'd call it with - * - * twgl.primitives.createXYQuadBufferInfo(gl, 1, 0, 0.5); - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext. - * @param {number} [size] the size across the quad. Defaults to 2 which means vertices will go from -1 to +1 - * @param {number} [xOffset] the amount to offset the quad in X - * @param {number} [yOffset] the amount to offset the quad in Y - * @return {module:twgl.BufferInfo} the created XY Quad buffers - * @memberOf module:twgl/primitives - * @function createXYQuadBuffers - */ - -/** - * Creates XY quad vertices - * - * The default with no parameters will return a 2x2 quad with values from -1 to +1. - * If you want a unit quad with that goes from 0 to 1 you'd call it with - * - * twgl.primitives.createXYQuadVertices(1, 0.5, 0.5); - * - * If you want a unit quad centered above 0,0 you'd call it with - * - * twgl.primitives.createXYQuadVertices(1, 0, 0.5); - * - * @param {number} [size] the size across the quad. Defaults to 2 which means vertices will go from -1 to +1 - * @param {number} [xOffset] the amount to offset the quad in X - * @param {number} [yOffset] the amount to offset the quad in Y - * @return {Object. the created XY Quad vertices - * @memberOf module:twgl/primitives - */ - - -function createXYQuadVertices(size, xOffset, yOffset) { - size = size || 2; - xOffset = xOffset || 0; - yOffset = yOffset || 0; - size *= 0.5; - return { - position: { - numComponents: 2, - data: [xOffset + -1 * size, yOffset + -1 * size, xOffset + 1 * size, yOffset + -1 * size, xOffset + -1 * size, yOffset + 1 * size, xOffset + 1 * size, yOffset + 1 * size] - }, - normal: [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1], - texcoord: [0, 0, 1, 0, 0, 1, 1, 1], - indices: [0, 1, 2, 2, 1, 3] - }; -} -/** - * Creates XZ plane BufferInfo. - * - * The created plane has position, normal, and texcoord data - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext. - * @param {number} [width] Width of the plane. Default = 1 - * @param {number} [depth] Depth of the plane. Default = 1 - * @param {number} [subdivisionsWidth] Number of steps across the plane. Default = 1 - * @param {number} [subdivisionsDepth] Number of steps down the plane. Default = 1 - * @param {Matrix4} [matrix] A matrix by which to multiply all the vertices. - * @return {@module:twgl.BufferInfo} The created plane BufferInfo. - * @memberOf module:twgl/primitives - * @function createPlaneBufferInfo - */ - -/** - * Creates XZ plane buffers. - * - * The created plane has position, normal, and texcoord data - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext. - * @param {number} [width] Width of the plane. Default = 1 - * @param {number} [depth] Depth of the plane. Default = 1 - * @param {number} [subdivisionsWidth] Number of steps across the plane. Default = 1 - * @param {number} [subdivisionsDepth] Number of steps down the plane. Default = 1 - * @param {Matrix4} [matrix] A matrix by which to multiply all the vertices. - * @return {Object.} The created plane buffers. - * @memberOf module:twgl/primitives - * @function createPlaneBuffers - */ - -/** - * Creates XZ plane vertices. - * - * The created plane has position, normal, and texcoord data - * - * @param {number} [width] Width of the plane. Default = 1 - * @param {number} [depth] Depth of the plane. Default = 1 - * @param {number} [subdivisionsWidth] Number of steps across the plane. Default = 1 - * @param {number} [subdivisionsDepth] Number of steps down the plane. Default = 1 - * @param {Matrix4} [matrix] A matrix by which to multiply all the vertices. - * @return {Object.} The created plane vertices. - * @memberOf module:twgl/primitives - */ - - -function createPlaneVertices(width, depth, subdivisionsWidth, subdivisionsDepth, matrix) { - width = width || 1; - depth = depth || 1; - subdivisionsWidth = subdivisionsWidth || 1; - subdivisionsDepth = subdivisionsDepth || 1; - matrix = matrix || m4.identity(); - var numVertices = (subdivisionsWidth + 1) * (subdivisionsDepth + 1); - var positions = createAugmentedTypedArray(3, numVertices); - var normals = createAugmentedTypedArray(3, numVertices); - var texcoords = createAugmentedTypedArray(2, numVertices); - - for (var z = 0; z <= subdivisionsDepth; z++) { - for (var x = 0; x <= subdivisionsWidth; x++) { - var u = x / subdivisionsWidth; - var v = z / subdivisionsDepth; - positions.push(width * u - width * 0.5, 0, depth * v - depth * 0.5); - normals.push(0, 1, 0); - texcoords.push(u, v); - } - } - - var numVertsAcross = subdivisionsWidth + 1; - var indices = createAugmentedTypedArray(3, subdivisionsWidth * subdivisionsDepth * 2, Uint16Array); - - for (var _z = 0; _z < subdivisionsDepth; _z++) { - // eslint-disable-line - for (var _x = 0; _x < subdivisionsWidth; _x++) { - // eslint-disable-line - // Make triangle 1 of quad. - indices.push((_z + 0) * numVertsAcross + _x, (_z + 1) * numVertsAcross + _x, (_z + 0) * numVertsAcross + _x + 1); // Make triangle 2 of quad. - - indices.push((_z + 1) * numVertsAcross + _x, (_z + 1) * numVertsAcross + _x + 1, (_z + 0) * numVertsAcross + _x + 1); - } - } - - var arrays = reorientVertices({ - position: positions, - normal: normals, - texcoord: texcoords, - indices: indices - }, matrix); - return arrays; -} -/** - * Creates sphere BufferInfo. - * - * The created sphere has position, normal, and texcoord data - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext. - * @param {number} radius radius of the sphere. - * @param {number} subdivisionsAxis number of steps around the sphere. - * @param {number} subdivisionsHeight number of vertically on the sphere. - * @param {number} [opt_startLatitudeInRadians] where to start the - * top of the sphere. Default = 0. - * @param {number} [opt_endLatitudeInRadians] Where to end the - * bottom of the sphere. Default = Math.PI. - * @param {number} [opt_startLongitudeInRadians] where to start - * wrapping the sphere. Default = 0. - * @param {number} [opt_endLongitudeInRadians] where to end - * wrapping the sphere. Default = 2 * Math.PI. - * @return {module:twgl.BufferInfo} The created sphere BufferInfo. - * @memberOf module:twgl/primitives - * @function createSphereBufferInfo - */ - -/** - * Creates sphere buffers. - * - * The created sphere has position, normal, and texcoord data - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext. - * @param {number} radius radius of the sphere. - * @param {number} subdivisionsAxis number of steps around the sphere. - * @param {number} subdivisionsHeight number of vertically on the sphere. - * @param {number} [opt_startLatitudeInRadians] where to start the - * top of the sphere. Default = 0. - * @param {number} [opt_endLatitudeInRadians] Where to end the - * bottom of the sphere. Default = Math.PI. - * @param {number} [opt_startLongitudeInRadians] where to start - * wrapping the sphere. Default = 0. - * @param {number} [opt_endLongitudeInRadians] where to end - * wrapping the sphere. Default = 2 * Math.PI. - * @return {Object.} The created sphere buffers. - * @memberOf module:twgl/primitives - * @function createSphereBuffers - */ - -/** - * Creates sphere vertices. - * - * The created sphere has position, normal, and texcoord data - * - * @param {number} radius radius of the sphere. - * @param {number} subdivisionsAxis number of steps around the sphere. - * @param {number} subdivisionsHeight number of vertically on the sphere. - * @param {number} [opt_startLatitudeInRadians] where to start the - * top of the sphere. Default = 0. - * @param {number} [opt_endLatitudeInRadians] Where to end the - * bottom of the sphere. Default = Math.PI. - * @param {number} [opt_startLongitudeInRadians] where to start - * wrapping the sphere. Default = 0. - * @param {number} [opt_endLongitudeInRadians] where to end - * wrapping the sphere. Default = 2 * Math.PI. - * @return {Object.} The created sphere vertices. - * @memberOf module:twgl/primitives - */ - - -function createSphereVertices(radius, subdivisionsAxis, subdivisionsHeight, opt_startLatitudeInRadians, opt_endLatitudeInRadians, opt_startLongitudeInRadians, opt_endLongitudeInRadians) { - if (subdivisionsAxis <= 0 || subdivisionsHeight <= 0) { - throw Error('subdivisionAxis and subdivisionHeight must be > 0'); - } - - opt_startLatitudeInRadians = opt_startLatitudeInRadians || 0; - opt_endLatitudeInRadians = opt_endLatitudeInRadians || Math.PI; - opt_startLongitudeInRadians = opt_startLongitudeInRadians || 0; - opt_endLongitudeInRadians = opt_endLongitudeInRadians || Math.PI * 2; - var latRange = opt_endLatitudeInRadians - opt_startLatitudeInRadians; - var longRange = opt_endLongitudeInRadians - opt_startLongitudeInRadians; // We are going to generate our sphere by iterating through its - // spherical coordinates and generating 2 triangles for each quad on a - // ring of the sphere. - - var numVertices = (subdivisionsAxis + 1) * (subdivisionsHeight + 1); - var positions = createAugmentedTypedArray(3, numVertices); - var normals = createAugmentedTypedArray(3, numVertices); - var texcoords = createAugmentedTypedArray(2, numVertices); // Generate the individual vertices in our vertex buffer. - - for (var y = 0; y <= subdivisionsHeight; y++) { - for (var x = 0; x <= subdivisionsAxis; x++) { - // Generate a vertex based on its spherical coordinates - var u = x / subdivisionsAxis; - var v = y / subdivisionsHeight; - var theta = longRange * u; - var phi = latRange * v; - var sinTheta = Math.sin(theta); - var cosTheta = Math.cos(theta); - var sinPhi = Math.sin(phi); - var cosPhi = Math.cos(phi); - var ux = cosTheta * sinPhi; - var uy = cosPhi; - var uz = sinTheta * sinPhi; - positions.push(radius * ux, radius * uy, radius * uz); - normals.push(ux, uy, uz); - texcoords.push(1 - u, v); - } - } - - var numVertsAround = subdivisionsAxis + 1; - var indices = createAugmentedTypedArray(3, subdivisionsAxis * subdivisionsHeight * 2, Uint16Array); - - for (var _x2 = 0; _x2 < subdivisionsAxis; _x2++) { - // eslint-disable-line - for (var _y = 0; _y < subdivisionsHeight; _y++) { - // eslint-disable-line - // Make triangle 1 of quad. - indices.push((_y + 0) * numVertsAround + _x2, (_y + 0) * numVertsAround + _x2 + 1, (_y + 1) * numVertsAround + _x2); // Make triangle 2 of quad. - - indices.push((_y + 1) * numVertsAround + _x2, (_y + 0) * numVertsAround + _x2 + 1, (_y + 1) * numVertsAround + _x2 + 1); - } - } - - return { - position: positions, - normal: normals, - texcoord: texcoords, - indices: indices - }; -} -/** - * Array of the indices of corners of each face of a cube. - * @type {Array.} - */ - - -var CUBE_FACE_INDICES = [[3, 7, 5, 1], // right -[6, 2, 0, 4], // left -[6, 7, 3, 2], // ?? -[0, 1, 5, 4], // ?? -[7, 6, 4, 5], // front -[2, 3, 1, 0]]; -/** - * Creates a BufferInfo for a cube. - * - * The cube is created around the origin. (-size / 2, size / 2). - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext. - * @param {number} [size] width, height and depth of the cube. - * @return {module:twgl.BufferInfo} The created BufferInfo. - * @memberOf module:twgl/primitives - * @function createCubeBufferInfo - */ - -/** - * Creates the buffers and indices for a cube. - * - * The cube is created around the origin. (-size / 2, size / 2). - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext. - * @param {number} [size] width, height and depth of the cube. - * @return {Object.} The created buffers. - * @memberOf module:twgl/primitives - * @function createCubeBuffers - */ - -/** - * Creates the vertices and indices for a cube. - * - * The cube is created around the origin. (-size / 2, size / 2). - * - * @param {number} [size] width, height and depth of the cube. - * @return {Object.} The created vertices. - * @memberOf module:twgl/primitives - */ - -function createCubeVertices(size) { - size = size || 1; - var k = size / 2; - var cornerVertices = [[-k, -k, -k], [+k, -k, -k], [-k, +k, -k], [+k, +k, -k], [-k, -k, +k], [+k, -k, +k], [-k, +k, +k], [+k, +k, +k]]; - var faceNormals = [[+1, +0, +0], [-1, +0, +0], [+0, +1, +0], [+0, -1, +0], [+0, +0, +1], [+0, +0, -1]]; - var uvCoords = [[1, 0], [0, 0], [0, 1], [1, 1]]; - var numVertices = 6 * 4; - var positions = createAugmentedTypedArray(3, numVertices); - var normals = createAugmentedTypedArray(3, numVertices); - var texcoords = createAugmentedTypedArray(2, numVertices); - var indices = createAugmentedTypedArray(3, 6 * 2, Uint16Array); - - for (var f = 0; f < 6; ++f) { - var faceIndices = CUBE_FACE_INDICES[f]; - - for (var v = 0; v < 4; ++v) { - var position = cornerVertices[faceIndices[v]]; - var normal = faceNormals[f]; - var uv = uvCoords[v]; // Each face needs all four vertices because the normals and texture - // coordinates are not all the same. - - positions.push(position); - normals.push(normal); - texcoords.push(uv); - } // Two triangles make a square face. - - - var offset = 4 * f; - indices.push(offset + 0, offset + 1, offset + 2); - indices.push(offset + 0, offset + 2, offset + 3); - } - - return { - position: positions, - normal: normals, - texcoord: texcoords, - indices: indices - }; -} -/** - * Creates a BufferInfo for a truncated cone, which is like a cylinder - * except that it has different top and bottom radii. A truncated cone - * can also be used to create cylinders and regular cones. The - * truncated cone will be created centered about the origin, with the - * y axis as its vertical axis. - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext. - * @param {number} bottomRadius Bottom radius of truncated cone. - * @param {number} topRadius Top radius of truncated cone. - * @param {number} height Height of truncated cone. - * @param {number} radialSubdivisions The number of subdivisions around the - * truncated cone. - * @param {number} verticalSubdivisions The number of subdivisions down the - * truncated cone. - * @param {boolean} [opt_topCap] Create top cap. Default = true. - * @param {boolean} [opt_bottomCap] Create bottom cap. Default = true. - * @return {module:twgl.BufferInfo} The created cone BufferInfo. - * @memberOf module:twgl/primitives - * @function createTruncatedConeBufferInfo - */ - -/** - * Creates buffers for a truncated cone, which is like a cylinder - * except that it has different top and bottom radii. A truncated cone - * can also be used to create cylinders and regular cones. The - * truncated cone will be created centered about the origin, with the - * y axis as its vertical axis. - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext. - * @param {number} bottomRadius Bottom radius of truncated cone. - * @param {number} topRadius Top radius of truncated cone. - * @param {number} height Height of truncated cone. - * @param {number} radialSubdivisions The number of subdivisions around the - * truncated cone. - * @param {number} verticalSubdivisions The number of subdivisions down the - * truncated cone. - * @param {boolean} [opt_topCap] Create top cap. Default = true. - * @param {boolean} [opt_bottomCap] Create bottom cap. Default = true. - * @return {Object.} The created cone buffers. - * @memberOf module:twgl/primitives - * @function createTruncatedConeBuffers - */ - -/** - * Creates vertices for a truncated cone, which is like a cylinder - * except that it has different top and bottom radii. A truncated cone - * can also be used to create cylinders and regular cones. The - * truncated cone will be created centered about the origin, with the - * y axis as its vertical axis. . - * - * @param {number} bottomRadius Bottom radius of truncated cone. - * @param {number} topRadius Top radius of truncated cone. - * @param {number} height Height of truncated cone. - * @param {number} radialSubdivisions The number of subdivisions around the - * truncated cone. - * @param {number} verticalSubdivisions The number of subdivisions down the - * truncated cone. - * @param {boolean} [opt_topCap] Create top cap. Default = true. - * @param {boolean} [opt_bottomCap] Create bottom cap. Default = true. - * @return {Object.} The created cone vertices. - * @memberOf module:twgl/primitives - */ - - -function createTruncatedConeVertices(bottomRadius, topRadius, height, radialSubdivisions, verticalSubdivisions, opt_topCap, opt_bottomCap) { - if (radialSubdivisions < 3) { - throw Error('radialSubdivisions must be 3 or greater'); - } - - if (verticalSubdivisions < 1) { - throw Error('verticalSubdivisions must be 1 or greater'); - } - - var topCap = opt_topCap === undefined ? true : opt_topCap; - var bottomCap = opt_bottomCap === undefined ? true : opt_bottomCap; - var extra = (topCap ? 2 : 0) + (bottomCap ? 2 : 0); - var numVertices = (radialSubdivisions + 1) * (verticalSubdivisions + 1 + extra); - var positions = createAugmentedTypedArray(3, numVertices); - var normals = createAugmentedTypedArray(3, numVertices); - var texcoords = createAugmentedTypedArray(2, numVertices); - var indices = createAugmentedTypedArray(3, radialSubdivisions * (verticalSubdivisions + extra) * 2, Uint16Array); - var vertsAroundEdge = radialSubdivisions + 1; // The slant of the cone is constant across its surface - - var slant = Math.atan2(bottomRadius - topRadius, height); - var cosSlant = Math.cos(slant); - var sinSlant = Math.sin(slant); - var start = topCap ? -2 : 0; - var end = verticalSubdivisions + (bottomCap ? 2 : 0); - - for (var yy = start; yy <= end; ++yy) { - var v = yy / verticalSubdivisions; - var y = height * v; - var ringRadius = void 0; - - if (yy < 0) { - y = 0; - v = 1; - ringRadius = bottomRadius; - } else if (yy > verticalSubdivisions) { - y = height; - v = 1; - ringRadius = topRadius; - } else { - ringRadius = bottomRadius + (topRadius - bottomRadius) * (yy / verticalSubdivisions); - } - - if (yy === -2 || yy === verticalSubdivisions + 2) { - ringRadius = 0; - v = 0; - } - - y -= height / 2; - - for (var ii = 0; ii < vertsAroundEdge; ++ii) { - var sin = Math.sin(ii * Math.PI * 2 / radialSubdivisions); - var cos = Math.cos(ii * Math.PI * 2 / radialSubdivisions); - positions.push(sin * ringRadius, y, cos * ringRadius); - normals.push(yy < 0 || yy > verticalSubdivisions ? 0 : sin * cosSlant, yy < 0 ? -1 : yy > verticalSubdivisions ? 1 : sinSlant, yy < 0 || yy > verticalSubdivisions ? 0 : cos * cosSlant); - texcoords.push(ii / radialSubdivisions, 1 - v); - } - } - - for (var _yy = 0; _yy < verticalSubdivisions + extra; ++_yy) { - // eslint-disable-line - for (var _ii = 0; _ii < radialSubdivisions; ++_ii) { - // eslint-disable-line - indices.push(vertsAroundEdge * (_yy + 0) + 0 + _ii, vertsAroundEdge * (_yy + 0) + 1 + _ii, vertsAroundEdge * (_yy + 1) + 1 + _ii); - indices.push(vertsAroundEdge * (_yy + 0) + 0 + _ii, vertsAroundEdge * (_yy + 1) + 1 + _ii, vertsAroundEdge * (_yy + 1) + 0 + _ii); - } - } - - return { - position: positions, - normal: normals, - texcoord: texcoords, - indices: indices - }; -} -/** - * Expands RLE data - * @param {number[]} rleData data in format of run-length, x, y, z, run-length, x, y, z - * @param {number[]} [padding] value to add each entry with. - * @return {number[]} the expanded rleData - */ - - -function expandRLEData(rleData, padding) { - padding = padding || []; - var data = []; - - for (var ii = 0; ii < rleData.length; ii += 4) { - var runLength = rleData[ii]; - var element = rleData.slice(ii + 1, ii + 4); - element.push.apply(element, padding); - - for (var jj = 0; jj < runLength; ++jj) { - data.push.apply(data, element); - } - } - - return data; -} -/** - * Creates 3D 'F' BufferInfo. - * An 'F' is useful because you can easily tell which way it is oriented. - * The created 'F' has position, normal, texcoord, and color buffers. - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext. - * @return {module:twgl.BufferInfo} The created BufferInfo. - * @memberOf module:twgl/primitives - * @function create3DFBufferInfo - */ - -/** - * Creates 3D 'F' buffers. - * An 'F' is useful because you can easily tell which way it is oriented. - * The created 'F' has position, normal, texcoord, and color buffers. - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext. - * @return {Object.} The created buffers. - * @memberOf module:twgl/primitives - * @function create3DFBuffers - */ - -/** - * Creates 3D 'F' vertices. - * An 'F' is useful because you can easily tell which way it is oriented. - * The created 'F' has position, normal, texcoord, and color arrays. - * - * @return {Object.} The created vertices. - * @memberOf module:twgl/primitives - */ - - -function create3DFVertices() { - var positions = [// left column front - 0, 0, 0, 0, 150, 0, 30, 0, 0, 0, 150, 0, 30, 150, 0, 30, 0, 0, // top rung front - 30, 0, 0, 30, 30, 0, 100, 0, 0, 30, 30, 0, 100, 30, 0, 100, 0, 0, // middle rung front - 30, 60, 0, 30, 90, 0, 67, 60, 0, 30, 90, 0, 67, 90, 0, 67, 60, 0, // left column back - 0, 0, 30, 30, 0, 30, 0, 150, 30, 0, 150, 30, 30, 0, 30, 30, 150, 30, // top rung back - 30, 0, 30, 100, 0, 30, 30, 30, 30, 30, 30, 30, 100, 0, 30, 100, 30, 30, // middle rung back - 30, 60, 30, 67, 60, 30, 30, 90, 30, 30, 90, 30, 67, 60, 30, 67, 90, 30, // top - 0, 0, 0, 100, 0, 0, 100, 0, 30, 0, 0, 0, 100, 0, 30, 0, 0, 30, // top rung front - 100, 0, 0, 100, 30, 0, 100, 30, 30, 100, 0, 0, 100, 30, 30, 100, 0, 30, // under top rung - 30, 30, 0, 30, 30, 30, 100, 30, 30, 30, 30, 0, 100, 30, 30, 100, 30, 0, // between top rung and middle - 30, 30, 0, 30, 60, 30, 30, 30, 30, 30, 30, 0, 30, 60, 0, 30, 60, 30, // top of middle rung - 30, 60, 0, 67, 60, 30, 30, 60, 30, 30, 60, 0, 67, 60, 0, 67, 60, 30, // front of middle rung - 67, 60, 0, 67, 90, 30, 67, 60, 30, 67, 60, 0, 67, 90, 0, 67, 90, 30, // bottom of middle rung. - 30, 90, 0, 30, 90, 30, 67, 90, 30, 30, 90, 0, 67, 90, 30, 67, 90, 0, // front of bottom - 30, 90, 0, 30, 150, 30, 30, 90, 30, 30, 90, 0, 30, 150, 0, 30, 150, 30, // bottom - 0, 150, 0, 0, 150, 30, 30, 150, 30, 0, 150, 0, 30, 150, 30, 30, 150, 0, // left side - 0, 0, 0, 0, 0, 30, 0, 150, 30, 0, 0, 0, 0, 150, 30, 0, 150, 0]; - var texcoords = [// left column front - 0.22, 0.19, 0.22, 0.79, 0.34, 0.19, 0.22, 0.79, 0.34, 0.79, 0.34, 0.19, // top rung front - 0.34, 0.19, 0.34, 0.31, 0.62, 0.19, 0.34, 0.31, 0.62, 0.31, 0.62, 0.19, // middle rung front - 0.34, 0.43, 0.34, 0.55, 0.49, 0.43, 0.34, 0.55, 0.49, 0.55, 0.49, 0.43, // left column back - 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, // top rung back - 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, // middle rung back - 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, // top - 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, // top rung front - 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, // under top rung - 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, // between top rung and middle - 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, // top of middle rung - 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, // front of middle rung - 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, // bottom of middle rung. - 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, // front of bottom - 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, // bottom - 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, // left side - 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0]; - var normals = expandRLEData([// left column front - // top rung front - // middle rung front - 18, 0, 0, 1, // left column back - // top rung back - // middle rung back - 18, 0, 0, -1, // top - 6, 0, 1, 0, // top rung front - 6, 1, 0, 0, // under top rung - 6, 0, -1, 0, // between top rung and middle - 6, 1, 0, 0, // top of middle rung - 6, 0, 1, 0, // front of middle rung - 6, 1, 0, 0, // bottom of middle rung. - 6, 0, -1, 0, // front of bottom - 6, 1, 0, 0, // bottom - 6, 0, -1, 0, // left side - 6, -1, 0, 0]); - var colors = expandRLEData([// left column front - // top rung front - // middle rung front - 18, 200, 70, 120, // left column back - // top rung back - // middle rung back - 18, 80, 70, 200, // top - 6, 70, 200, 210, // top rung front - 6, 200, 200, 70, // under top rung - 6, 210, 100, 70, // between top rung and middle - 6, 210, 160, 70, // top of middle rung - 6, 70, 180, 210, // front of middle rung - 6, 100, 70, 210, // bottom of middle rung. - 6, 76, 210, 100, // front of bottom - 6, 140, 210, 80, // bottom - 6, 90, 130, 110, // left side - 6, 160, 160, 220], [255]); - var numVerts = positions.length / 3; - var arrays = { - position: createAugmentedTypedArray(3, numVerts), - texcoord: createAugmentedTypedArray(2, numVerts), - normal: createAugmentedTypedArray(3, numVerts), - color: createAugmentedTypedArray(4, numVerts, Uint8Array), - indices: createAugmentedTypedArray(3, numVerts / 3, Uint16Array) - }; - arrays.position.push(positions); - arrays.texcoord.push(texcoords); - arrays.normal.push(normals); - arrays.color.push(colors); - - for (var ii = 0; ii < numVerts; ++ii) { - arrays.indices.push(ii); - } - - return arrays; -} -/** - * Creates cresent BufferInfo. - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext. - * @param {number} verticalRadius The vertical radius of the cresent. - * @param {number} outerRadius The outer radius of the cresent. - * @param {number} innerRadius The inner radius of the cresent. - * @param {number} thickness The thickness of the cresent. - * @param {number} subdivisionsDown number of steps around the cresent. - * @param {number} subdivisionsThick number of vertically on the cresent. - * @param {number} [startOffset] Where to start arc. Default 0. - * @param {number} [endOffset] Where to end arg. Default 1. - * @return {module:twgl.BufferInfo} The created BufferInfo. - * @memberOf module:twgl/primitives - * @function createCresentBufferInfo - */ - -/** - * Creates cresent buffers. - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext. - * @param {number} verticalRadius The vertical radius of the cresent. - * @param {number} outerRadius The outer radius of the cresent. - * @param {number} innerRadius The inner radius of the cresent. - * @param {number} thickness The thickness of the cresent. - * @param {number} subdivisionsDown number of steps around the cresent. - * @param {number} subdivisionsThick number of vertically on the cresent. - * @param {number} [startOffset] Where to start arc. Default 0. - * @param {number} [endOffset] Where to end arg. Default 1. - * @return {Object.} The created buffers. - * @memberOf module:twgl/primitives - * @function createCresentBuffers - */ - -/** - * Creates cresent vertices. - * - * @param {number} verticalRadius The vertical radius of the cresent. - * @param {number} outerRadius The outer radius of the cresent. - * @param {number} innerRadius The inner radius of the cresent. - * @param {number} thickness The thickness of the cresent. - * @param {number} subdivisionsDown number of steps around the cresent. - * @param {number} subdivisionsThick number of vertically on the cresent. - * @param {number} [startOffset] Where to start arc. Default 0. - * @param {number} [endOffset] Where to end arg. Default 1. - * @return {Object.} The created vertices. - * @memberOf module:twgl/primitives - */ - - -function createCresentVertices(verticalRadius, outerRadius, innerRadius, thickness, subdivisionsDown, startOffset, endOffset) { - if (subdivisionsDown <= 0) { - throw Error('subdivisionDown must be > 0'); - } - - startOffset = startOffset || 0; - endOffset = endOffset || 1; - var subdivisionsThick = 2; - var offsetRange = endOffset - startOffset; - var numVertices = (subdivisionsDown + 1) * 2 * (2 + subdivisionsThick); - var positions = createAugmentedTypedArray(3, numVertices); - var normals = createAugmentedTypedArray(3, numVertices); - var texcoords = createAugmentedTypedArray(2, numVertices); - - function lerp(a, b, s) { - return a + (b - a) * s; - } - - function createArc(arcRadius, x, normalMult, normalAdd, uMult, uAdd) { - for (var z = 0; z <= subdivisionsDown; z++) { - var uBack = x / (subdivisionsThick - 1); - var v = z / subdivisionsDown; - var xBack = (uBack - 0.5) * 2; - var angle = (startOffset + v * offsetRange) * Math.PI; - var s = Math.sin(angle); - var c = Math.cos(angle); - var radius = lerp(verticalRadius, arcRadius, s); - var px = xBack * thickness; - var py = c * verticalRadius; - var pz = s * radius; - positions.push(px, py, pz); - var n = v3.add(v3.multiply([0, s, c], normalMult), normalAdd); - normals.push(n); - texcoords.push(uBack * uMult + uAdd, v); - } - } // Generate the individual vertices in our vertex buffer. - - - for (var x = 0; x < subdivisionsThick; x++) { - var uBack = (x / (subdivisionsThick - 1) - 0.5) * 2; - createArc(outerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0); - createArc(outerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 0); - createArc(innerRadius, x, [1, 1, 1], [0, 0, 0], 1, 0); - createArc(innerRadius, x, [0, 0, 0], [uBack, 0, 0], 0, 1); - } // Do outer surface. - - - var indices = createAugmentedTypedArray(3, subdivisionsDown * 2 * (2 + subdivisionsThick), Uint16Array); - - function createSurface(leftArcOffset, rightArcOffset) { - for (var z = 0; z < subdivisionsDown; ++z) { - // Make triangle 1 of quad. - indices.push(leftArcOffset + z + 0, leftArcOffset + z + 1, rightArcOffset + z + 0); // Make triangle 2 of quad. - - indices.push(leftArcOffset + z + 1, rightArcOffset + z + 1, rightArcOffset + z + 0); - } - } - - var numVerticesDown = subdivisionsDown + 1; // front - - createSurface(numVerticesDown * 0, numVerticesDown * 4); // right - - createSurface(numVerticesDown * 5, numVerticesDown * 7); // back - - createSurface(numVerticesDown * 6, numVerticesDown * 2); // left - - createSurface(numVerticesDown * 3, numVerticesDown * 1); - return { - position: positions, - normal: normals, - texcoord: texcoords, - indices: indices - }; -} -/** - * Creates cylinder BufferInfo. The cylinder will be created around the origin - * along the y-axis. - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext. - * @param {number} radius Radius of cylinder. - * @param {number} height Height of cylinder. - * @param {number} radialSubdivisions The number of subdivisions around the cylinder. - * @param {number} verticalSubdivisions The number of subdivisions down the cylinder. - * @param {boolean} [topCap] Create top cap. Default = true. - * @param {boolean} [bottomCap] Create bottom cap. Default = true. - * @return {module:twgl.BufferInfo} The created BufferInfo. - * @memberOf module:twgl/primitives - * @function createCylinderBufferInfo - */ - -/** - * Creates cylinder buffers. The cylinder will be created around the origin - * along the y-axis. - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext. - * @param {number} radius Radius of cylinder. - * @param {number} height Height of cylinder. - * @param {number} radialSubdivisions The number of subdivisions around the cylinder. - * @param {number} verticalSubdivisions The number of subdivisions down the cylinder. - * @param {boolean} [topCap] Create top cap. Default = true. - * @param {boolean} [bottomCap] Create bottom cap. Default = true. - * @return {Object.} The created buffers. - * @memberOf module:twgl/primitives - * @function createCylinderBuffers - */ - -/** - * Creates cylinder vertices. The cylinder will be created around the origin - * along the y-axis. - * - * @param {number} radius Radius of cylinder. - * @param {number} height Height of cylinder. - * @param {number} radialSubdivisions The number of subdivisions around the cylinder. - * @param {number} verticalSubdivisions The number of subdivisions down the cylinder. - * @param {boolean} [topCap] Create top cap. Default = true. - * @param {boolean} [bottomCap] Create bottom cap. Default = true. - * @return {Object.} The created vertices. - * @memberOf module:twgl/primitives - */ - - -function createCylinderVertices(radius, height, radialSubdivisions, verticalSubdivisions, topCap, bottomCap) { - return createTruncatedConeVertices(radius, radius, height, radialSubdivisions, verticalSubdivisions, topCap, bottomCap); -} -/** - * Creates BufferInfo for a torus - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext. - * @param {number} radius radius of center of torus circle. - * @param {number} thickness radius of torus ring. - * @param {number} radialSubdivisions The number of subdivisions around the torus. - * @param {number} bodySubdivisions The number of subdivisions around the body torus. - * @param {boolean} [startAngle] start angle in radians. Default = 0. - * @param {boolean} [endAngle] end angle in radians. Default = Math.PI * 2. - * @return {module:twgl.BufferInfo} The created BufferInfo. - * @memberOf module:twgl/primitives - * @function createTorusBufferInfo - */ - -/** - * Creates buffers for a torus - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext. - * @param {number} radius radius of center of torus circle. - * @param {number} thickness radius of torus ring. - * @param {number} radialSubdivisions The number of subdivisions around the torus. - * @param {number} bodySubdivisions The number of subdivisions around the body torus. - * @param {boolean} [startAngle] start angle in radians. Default = 0. - * @param {boolean} [endAngle] end angle in radians. Default = Math.PI * 2. - * @return {Object.} The created buffers. - * @memberOf module:twgl/primitives - * @function createTorusBuffers - */ - -/** - * Creates vertices for a torus - * - * @param {number} radius radius of center of torus circle. - * @param {number} thickness radius of torus ring. - * @param {number} radialSubdivisions The number of subdivisions around the torus. - * @param {number} bodySubdivisions The number of subdivisions around the body torus. - * @param {boolean} [startAngle] start angle in radians. Default = 0. - * @param {boolean} [endAngle] end angle in radians. Default = Math.PI * 2. - * @return {Object.} The created vertices. - * @memberOf module:twgl/primitives - */ - - -function createTorusVertices(radius, thickness, radialSubdivisions, bodySubdivisions, startAngle, endAngle) { - if (radialSubdivisions < 3) { - throw Error('radialSubdivisions must be 3 or greater'); - } - - if (bodySubdivisions < 3) { - throw Error('verticalSubdivisions must be 3 or greater'); - } - - startAngle = startAngle || 0; - endAngle = endAngle || Math.PI * 2; - var range = endAngle - startAngle; - var radialParts = radialSubdivisions + 1; - var bodyParts = bodySubdivisions + 1; - var numVertices = radialParts * bodyParts; - var positions = createAugmentedTypedArray(3, numVertices); - var normals = createAugmentedTypedArray(3, numVertices); - var texcoords = createAugmentedTypedArray(2, numVertices); - var indices = createAugmentedTypedArray(3, radialSubdivisions * bodySubdivisions * 2, Uint16Array); - - for (var slice = 0; slice < bodyParts; ++slice) { - var v = slice / bodySubdivisions; - var sliceAngle = v * Math.PI * 2; - var sliceSin = Math.sin(sliceAngle); - var ringRadius = radius + sliceSin * thickness; - var ny = Math.cos(sliceAngle); - var y = ny * thickness; - - for (var ring = 0; ring < radialParts; ++ring) { - var u = ring / radialSubdivisions; - var ringAngle = startAngle + u * range; - var xSin = Math.sin(ringAngle); - var zCos = Math.cos(ringAngle); - var x = xSin * ringRadius; - var z = zCos * ringRadius; - var nx = xSin * sliceSin; - var nz = zCos * sliceSin; - positions.push(x, y, z); - normals.push(nx, ny, nz); - texcoords.push(u, 1 - v); - } - } - - for (var _slice = 0; _slice < bodySubdivisions; ++_slice) { - // eslint-disable-line - for (var _ring = 0; _ring < radialSubdivisions; ++_ring) { - // eslint-disable-line - var nextRingIndex = 1 + _ring; - var nextSliceIndex = 1 + _slice; - indices.push(radialParts * _slice + _ring, radialParts * nextSliceIndex + _ring, radialParts * _slice + nextRingIndex); - indices.push(radialParts * nextSliceIndex + _ring, radialParts * nextSliceIndex + nextRingIndex, radialParts * _slice + nextRingIndex); - } - } - - return { - position: positions, - normal: normals, - texcoord: texcoords, - indices: indices - }; -} -/** - * Creates a disc BufferInfo. The disc will be in the xz plane, centered at - * the origin. When creating, at least 3 divisions, or pie - * pieces, need to be specified, otherwise the triangles making - * up the disc will be degenerate. You can also specify the - * number of radial pieces `stacks`. A value of 1 for - * stacks will give you a simple disc of pie pieces. If you - * want to create an annulus you can set `innerRadius` to a - * value > 0. Finally, `stackPower` allows you to have the widths - * increase or decrease as you move away from the center. This - * is particularly useful when using the disc as a ground plane - * with a fixed camera such that you don't need the resolution - * of small triangles near the perimeter. For example, a value - * of 2 will produce stacks whose ouside radius increases with - * the square of the stack index. A value of 1 will give uniform - * stacks. - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext. - * @param {number} radius Radius of the ground plane. - * @param {number} divisions Number of triangles in the ground plane (at least 3). - * @param {number} [stacks] Number of radial divisions (default=1). - * @param {number} [innerRadius] Default 0. - * @param {number} [stackPower] Power to raise stack size to for decreasing width. - * @return {module:twgl.BufferInfo} The created BufferInfo. - * @memberOf module:twgl/primitives - * @function createDiscBufferInfo - */ - -/** - * Creates disc buffers. The disc will be in the xz plane, centered at - * the origin. When creating, at least 3 divisions, or pie - * pieces, need to be specified, otherwise the triangles making - * up the disc will be degenerate. You can also specify the - * number of radial pieces `stacks`. A value of 1 for - * stacks will give you a simple disc of pie pieces. If you - * want to create an annulus you can set `innerRadius` to a - * value > 0. Finally, `stackPower` allows you to have the widths - * increase or decrease as you move away from the center. This - * is particularly useful when using the disc as a ground plane - * with a fixed camera such that you don't need the resolution - * of small triangles near the perimeter. For example, a value - * of 2 will produce stacks whose ouside radius increases with - * the square of the stack index. A value of 1 will give uniform - * stacks. - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext. - * @param {number} radius Radius of the ground plane. - * @param {number} divisions Number of triangles in the ground plane (at least 3). - * @param {number} [stacks] Number of radial divisions (default=1). - * @param {number} [innerRadius] Default 0. - * @param {number} [stackPower] Power to raise stack size to for decreasing width. - * @return {Object.} The created buffers. - * @memberOf module:twgl/primitives - * @function createDiscBuffers - */ - -/** - * Creates disc vertices. The disc will be in the xz plane, centered at - * the origin. When creating, at least 3 divisions, or pie - * pieces, need to be specified, otherwise the triangles making - * up the disc will be degenerate. You can also specify the - * number of radial pieces `stacks`. A value of 1 for - * stacks will give you a simple disc of pie pieces. If you - * want to create an annulus you can set `innerRadius` to a - * value > 0. Finally, `stackPower` allows you to have the widths - * increase or decrease as you move away from the center. This - * is particularly useful when using the disc as a ground plane - * with a fixed camera such that you don't need the resolution - * of small triangles near the perimeter. For example, a value - * of 2 will produce stacks whose ouside radius increases with - * the square of the stack index. A value of 1 will give uniform - * stacks. - * - * @param {number} radius Radius of the ground plane. - * @param {number} divisions Number of triangles in the ground plane (at least 3). - * @param {number} [stacks] Number of radial divisions (default=1). - * @param {number} [innerRadius] Default 0. - * @param {number} [stackPower] Power to raise stack size to for decreasing width. - * @return {Object.} The created vertices. - * @memberOf module:twgl/primitives - */ - - -function createDiscVertices(radius, divisions, stacks, innerRadius, stackPower) { - if (divisions < 3) { - throw Error('divisions must be at least 3'); - } - - stacks = stacks ? stacks : 1; - stackPower = stackPower ? stackPower : 1; - innerRadius = innerRadius ? innerRadius : 0; // Note: We don't share the center vertex because that would - // mess up texture coordinates. - - var numVertices = (divisions + 1) * (stacks + 1); - var positions = createAugmentedTypedArray(3, numVertices); - var normals = createAugmentedTypedArray(3, numVertices); - var texcoords = createAugmentedTypedArray(2, numVertices); - var indices = createAugmentedTypedArray(3, stacks * divisions * 2, Uint16Array); - var firstIndex = 0; - var radiusSpan = radius - innerRadius; - var pointsPerStack = divisions + 1; // Build the disk one stack at a time. - - for (var stack = 0; stack <= stacks; ++stack) { - var stackRadius = innerRadius + radiusSpan * Math.pow(stack / stacks, stackPower); - - for (var i = 0; i <= divisions; ++i) { - var theta = 2.0 * Math.PI * i / divisions; - var x = stackRadius * Math.cos(theta); - var z = stackRadius * Math.sin(theta); - positions.push(x, 0, z); - normals.push(0, 1, 0); - texcoords.push(1 - i / divisions, stack / stacks); - - if (stack > 0 && i !== divisions) { - // a, b, c and d are the indices of the vertices of a quad. unless - // the current stack is the one closest to the center, in which case - // the vertices a and b connect to the center vertex. - var a = firstIndex + (i + 1); - var b = firstIndex + i; - var c = firstIndex + i - pointsPerStack; - var d = firstIndex + (i + 1) - pointsPerStack; // Make a quad of the vertices a, b, c, d. - - indices.push(a, b, c); - indices.push(a, c, d); - } - } - - firstIndex += divisions + 1; - } - - return { - position: positions, - normal: normals, - texcoord: texcoords, - indices: indices - }; -} -/** - * creates a random integer between 0 and range - 1 inclusive. - * @param {number} range - * @return {number} random value between 0 and range - 1 inclusive. - */ - - -function randInt(range) { - return Math.random() * range | 0; -} -/** - * Used to supply random colors - * @callback RandomColorFunc - * @param {number} ndx index of triangle/quad if unindexed or index of vertex if indexed - * @param {number} channel 0 = red, 1 = green, 2 = blue, 3 = alpha - * @return {number} a number from 0 to 255 - * @memberOf module:twgl/primitives - */ - -/** - * @typedef {Object} RandomVerticesOptions - * @property {number} [vertsPerColor] Defaults to 3 for non-indexed vertices - * @property {module:twgl/primitives.RandomColorFunc} [rand] A function to generate random numbers - * @memberOf module:twgl/primitives - */ - -/** - * Creates an augmentedTypedArray of random vertex colors. - * If the vertices are indexed (have an indices array) then will - * just make random colors. Otherwise assumes they are triangles - * and makes one random color for every 3 vertices. - * @param {Object.} vertices Vertices as returned from one of the createXXXVertices functions. - * @param {module:twgl/primitives.RandomVerticesOptions} [options] options. - * @return {Object.} same vertices as passed in with `color` added. - * @memberOf module:twgl/primitives - */ - - -function makeRandomVertexColors(vertices, options) { - options = options || {}; - var numElements = vertices.position.numElements; - var vcolors = createAugmentedTypedArray(4, numElements, Uint8Array); - - var rand = options.rand || function (ndx, channel) { - return channel < 3 ? randInt(256) : 255; - }; - - vertices.color = vcolors; - - if (vertices.indices) { - // just make random colors if index - for (var ii = 0; ii < numElements; ++ii) { - vcolors.push(rand(ii, 0), rand(ii, 1), rand(ii, 2), rand(ii, 3)); - } - } else { - // make random colors per triangle - var numVertsPerColor = options.vertsPerColor || 3; - var numSets = numElements / numVertsPerColor; - - for (var _ii2 = 0; _ii2 < numSets; ++_ii2) { - // eslint-disable-line - var color = [rand(_ii2, 0), rand(_ii2, 1), rand(_ii2, 2), rand(_ii2, 3)]; - - for (var jj = 0; jj < numVertsPerColor; ++jj) { - vcolors.push(color); - } - } - } - - return vertices; -} -/** - * creates a function that calls fn to create vertices and then - * creates a buffers for them - */ - - -function createBufferFunc(fn) { - return function (gl) { - var arrays = fn.apply(this, Array.prototype.slice.call(arguments, 1)); - return attributes.createBuffersFromArrays(gl, arrays); - }; -} -/** - * creates a function that calls fn to create vertices and then - * creates a bufferInfo object for them - */ - - -function createBufferInfoFunc(fn) { - return function (gl) { - var arrays = fn.apply(null, Array.prototype.slice.call(arguments, 1)); - return attributes.createBufferInfoFromArrays(gl, arrays); - }; -} - -var arraySpecPropertyNames = ["numComponents", "size", "type", "normalize", "stride", "offset", "attrib", "name", "attribName"]; -/** - * Copy elements from one array to another - * - * @param {Array|TypedArray} src source array - * @param {Array|TypedArray} dst dest array - * @param {number} dstNdx index in dest to copy src - * @param {number} [offset] offset to add to copied values - */ - -function copyElements(src, dst, dstNdx, offset) { - offset = offset || 0; - var length = src.length; - - for (var ii = 0; ii < length; ++ii) { - dst[dstNdx + ii] = src[ii] + offset; - } -} -/** - * Creates an array of the same time - * - * @param {(number[]|ArrayBufferView|module:twgl.FullArraySpec)} srcArray array who's type to copy - * @param {number} length size of new array - * @return {(number[]|ArrayBufferView|module:twgl.FullArraySpec)} array with same type as srcArray - */ - - -function createArrayOfSameType(srcArray, length) { - var arraySrc = getArray(srcArray); - var newArray = new arraySrc.constructor(length); - var newArraySpec = newArray; // If it appears to have been augmented make new one augemented - - if (arraySrc.numComponents && arraySrc.numElements) { - augmentTypedArray(newArray, arraySrc.numComponents); - } // If it was a fullspec make new one a fullspec - - - if (srcArray.data) { - newArraySpec = { - data: newArray - }; - helper.copyNamedProperties(arraySpecPropertyNames, srcArray, newArraySpec); - } - - return newArraySpec; -} -/** - * Concatinates sets of vertices - * - * Assumes the vertices match in composition. For example - * if one set of vertices has positions, normals, and indices - * all sets of vertices must have positions, normals, and indices - * and of the same type. - * - * Example: - * - * const cubeVertices = twgl.primtiives.createCubeVertices(2); - * const sphereVertices = twgl.primitives.createSphereVertices(1, 10, 10); - * // move the sphere 2 units up - * twgl.primitives.reorientVertices( - * sphereVertices, twgl.m4.translation([0, 2, 0])); - * // merge the sphere with the cube - * const cubeSphereVertices = twgl.primitives.concatVertices( - * [cubeVertices, sphereVertices]); - * // turn them into WebGL buffers and attrib data - * const bufferInfo = twgl.createBufferInfoFromArrays(gl, cubeSphereVertices); - * - * @param {module:twgl.Arrays[]} arrays Array of arrays of vertices - * @return {module:twgl.Arrays} The concatinated vertices. - * @memberOf module:twgl/primitives - */ - - -function concatVertices(arrayOfArrays) { - var names = {}; - var baseName; // get names of all arrays. - // and numElements for each set of vertices - - var _loop = function _loop(ii) { - var arrays = arrayOfArrays[ii]; - Object.keys(arrays).forEach(function (name) { - // eslint-disable-line - if (!names[name]) { - names[name] = []; - } - - if (!baseName && name !== 'indices') { - baseName = name; - } - - var arrayInfo = arrays[name]; - var numComponents = getNumComponents(arrayInfo, name); - var array = getArray(arrayInfo); - var numElements = array.length / numComponents; - names[name].push(numElements); - }); - }; - - for (var ii = 0; ii < arrayOfArrays.length; ++ii) { - _loop(ii); - } // compute length of combined array - // and return one for reference - - - function getLengthOfCombinedArrays(name) { - var length = 0; - var arraySpec; - - for (var ii = 0; ii < arrayOfArrays.length; ++ii) { - var arrays = arrayOfArrays[ii]; - var arrayInfo = arrays[name]; - var array = getArray(arrayInfo); - length += array.length; - - if (!arraySpec || arrayInfo.data) { - arraySpec = arrayInfo; - } - } - - return { - length: length, - spec: arraySpec - }; - } - - function copyArraysToNewArray(name, base, newArray) { - var baseIndex = 0; - var offset = 0; - - for (var ii = 0; ii < arrayOfArrays.length; ++ii) { - var arrays = arrayOfArrays[ii]; - var arrayInfo = arrays[name]; - var array = getArray(arrayInfo); - - if (name === 'indices') { - copyElements(array, newArray, offset, baseIndex); - baseIndex += base[ii]; - } else { - copyElements(array, newArray, offset); - } - - offset += array.length; - } - } - - var base = names[baseName]; - var newArrays = {}; - Object.keys(names).forEach(function (name) { - var info = getLengthOfCombinedArrays(name); - var newArraySpec = createArrayOfSameType(info.spec, info.length); - copyArraysToNewArray(name, base, getArray(newArraySpec)); - newArrays[name] = newArraySpec; - }); - return newArrays; -} -/** - * Creates a duplicate set of vertices - * - * This is useful for calling reorientVertices when you - * also want to keep the original available - * - * @param {module:twgl.Arrays} arrays of vertices - * @return {module:twgl.Arrays} The dupilicated vertices. - * @memberOf module:twgl/primitives - */ - - -function duplicateVertices(arrays) { - var newArrays = {}; - Object.keys(arrays).forEach(function (name) { - var arraySpec = arrays[name]; - var srcArray = getArray(arraySpec); - var newArraySpec = createArrayOfSameType(arraySpec, srcArray.length); - copyElements(srcArray, getArray(newArraySpec), 0); - newArrays[name] = newArraySpec; - }); - return newArrays; -} - -var create3DFBufferInfo = createBufferInfoFunc(create3DFVertices); -exports.create3DFBufferInfo = create3DFBufferInfo; -var create3DFBuffers = createBufferFunc(create3DFVertices); -exports.create3DFBuffers = create3DFBuffers; -var createCubeBufferInfo = createBufferInfoFunc(createCubeVertices); -exports.createCubeBufferInfo = createCubeBufferInfo; -var createCubeBuffers = createBufferFunc(createCubeVertices); -exports.createCubeBuffers = createCubeBuffers; -var createPlaneBufferInfo = createBufferInfoFunc(createPlaneVertices); -exports.createPlaneBufferInfo = createPlaneBufferInfo; -var createPlaneBuffers = createBufferFunc(createPlaneVertices); -exports.createPlaneBuffers = createPlaneBuffers; -var createSphereBufferInfo = createBufferInfoFunc(createSphereVertices); -exports.createSphereBufferInfo = createSphereBufferInfo; -var createSphereBuffers = createBufferFunc(createSphereVertices); -exports.createSphereBuffers = createSphereBuffers; -var createTruncatedConeBufferInfo = createBufferInfoFunc(createTruncatedConeVertices); -exports.createTruncatedConeBufferInfo = createTruncatedConeBufferInfo; -var createTruncatedConeBuffers = createBufferFunc(createTruncatedConeVertices); -exports.createTruncatedConeBuffers = createTruncatedConeBuffers; -var createXYQuadBufferInfo = createBufferInfoFunc(createXYQuadVertices); -exports.createXYQuadBufferInfo = createXYQuadBufferInfo; -var createXYQuadBuffers = createBufferFunc(createXYQuadVertices); -exports.createXYQuadBuffers = createXYQuadBuffers; -var createCresentBufferInfo = createBufferInfoFunc(createCresentVertices); -exports.createCresentBufferInfo = createCresentBufferInfo; -var createCresentBuffers = createBufferFunc(createCresentVertices); -exports.createCresentBuffers = createCresentBuffers; -var createCylinderBufferInfo = createBufferInfoFunc(createCylinderVertices); -exports.createCylinderBufferInfo = createCylinderBufferInfo; -var createCylinderBuffers = createBufferFunc(createCylinderVertices); -exports.createCylinderBuffers = createCylinderBuffers; -var createTorusBufferInfo = createBufferInfoFunc(createTorusVertices); -exports.createTorusBufferInfo = createTorusBufferInfo; -var createTorusBuffers = createBufferFunc(createTorusVertices); -exports.createTorusBuffers = createTorusBuffers; -var createDiscBufferInfo = createBufferInfoFunc(createDiscVertices); -exports.createDiscBufferInfo = createDiscBufferInfo; -var createDiscBuffers = createBufferFunc(createDiscVertices); -exports.createDiscBuffers = createDiscBuffers; - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -var _exportNames = { - addExtensionsToContext: true, - getContext: true, - getWebGLContext: true, - resizeCanvasToDisplaySize: true, - setDefaults: true -}; -exports.addExtensionsToContext = addExtensionsToContext; -exports.getContext = getContext; -exports.getWebGLContext = getWebGLContext; -exports.resizeCanvasToDisplaySize = resizeCanvasToDisplaySize; -exports.setDefaults = setDefaults; - -var attributes = _interopRequireWildcard(__webpack_require__(7)); - -Object.keys(attributes).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - exports[key] = attributes[key]; -}); - -var textures = _interopRequireWildcard(__webpack_require__(8)); - -Object.keys(textures).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - exports[key] = textures[key]; -}); - -var helper = _interopRequireWildcard(__webpack_require__(0)); - -var utils = _interopRequireWildcard(__webpack_require__(4)); - -Object.keys(utils).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - exports[key] = utils[key]; -}); - -var _draw = __webpack_require__(12); - -Object.keys(_draw).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - exports[key] = _draw[key]; -}); - -var _framebuffers = __webpack_require__(13); - -Object.keys(_framebuffers).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - exports[key] = _framebuffers[key]; -}); - -var _programs = __webpack_require__(5); - -Object.keys(_programs).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - exports[key] = _programs[key]; -}); - -var _typedarrays = __webpack_require__(1); - -Object.keys(_typedarrays).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - exports[key] = _typedarrays[key]; -}); - -var _vertexArrays = __webpack_require__(14); - -Object.keys(_vertexArrays).forEach(function (key) { - if (key === "default" || key === "__esModule") return; - if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; - exports[key] = _vertexArrays[key]; -}); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -/* - * Copyright 2015, Gregg Tavares. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Gregg Tavares. nor the names of his - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * The main TWGL module. - * - * For most use cases you shouldn't need anything outside this module. - * Exceptions between the stuff added to twgl-full (v3, m4, primitives) - * - * @module twgl - * @borrows module:twgl/attributes.setAttribInfoBufferFromArray as setAttribInfoBufferFromArray - * @borrows module:twgl/attributes.createBufferInfoFromArrays as createBufferInfoFromArrays - * @borrows module:twgl/attributes.createVertexArrayInfo as createVertexArrayInfo - * @borrows module:twgl/draw.drawBufferInfo as drawBufferInfo - * @borrows module:twgl/draw.drawObjectList as drawObjectList - * @borrows module:twgl/framebuffers.createFramebufferInfo as createFramebufferInfo - * @borrows module:twgl/framebuffers.resizeFramebufferInfo as resizeFramebufferInfo - * @borrows module:twgl/framebuffers.bindFramebufferInfo as bindFramebufferInfo - * @borrows module:twgl/programs.createProgramInfo as createProgramInfo - * @borrows module:twgl/programs.createUniformBlockInfo as createUniformBlockInfo - * @borrows module:twgl/programs.bindUniformBlock as bindUniformBlock - * @borrows module:twgl/programs.setUniformBlock as setUniformBlock - * @borrows module:twgl/programs.setBlockUniforms as setBlockUniforms - * @borrows module:twgl/programs.setUniforms as setUniforms - * @borrows module:twgl/programs.setBuffersAndAttributes as setBuffersAndAttributes - * @borrows module:twgl/textures.setTextureFromArray as setTextureFromArray - * @borrows module:twgl/textures.createTexture as createTexture - * @borrows module:twgl/textures.resizeTexture as resizeTexture - * @borrows module:twgl/textures.createTextures as createTextures - */ -// make sure we don't see a global gl -var gl = undefined; // eslint-disable-line - -var defaults = { - addExtensionsToContext: true -}; -/** - * Various default settings for twgl. - * - * Note: You can call this any number of times. Example: - * - * twgl.setDefaults({ textureColor: [1, 0, 0, 1] }); - * twgl.setDefaults({ attribPrefix: 'a_' }); - * - * is equivalent to - * - * twgl.setDefaults({ - * textureColor: [1, 0, 0, 1], - * attribPrefix: 'a_', - * }); - * - * @typedef {Object} Defaults - * @property {string} attribPrefix The prefix to stick on attributes - * - * When writing shaders I prefer to name attributes with `a_`, uniforms with `u_` and varyings with `v_` - * as it makes it clear where they came from. But, when building geometry I prefer using unprefixed names. - * - * In otherwords I'll create arrays of geometry like this - * - * const arrays = { - * position: ... - * normal: ... - * texcoord: ... - * }; - * - * But need those mapped to attributes and my attributes start with `a_`. - * - * Default: `""` - * - * @property {number[]} textureColor Array of 4 values in the range 0 to 1 - * - * The default texture color is used when loading textures from - * urls. Because the URL will be loaded async we'd like to be - * able to use the texture immediately. By putting a 1x1 pixel - * color in the texture we can start using the texture before - * the URL has loaded. - * - * Default: `[0.5, 0.75, 1, 1]` - * - * @property {string} crossOrigin - * - * If not undefined sets the crossOrigin attribute on images - * that twgl creates when downloading images for textures. - * - * Also see {@link module:twgl.TextureOptions}. - * - * @property {bool} addExtensionsToContext - * - * If true, then, when twgl will try to add any supported WebGL extensions - * directly to the context under their normal GL names. For example - * if ANGLE_instances_arrays exists then twgl would enable it, - * add the functions `vertexAttribDivisor`, `drawArraysInstanced`, - * `drawElementsInstanced`, and the constant `VERTEX_ATTRIB_ARRAY_DIVISOR` - * to the `WebGLRenderingContext`. - * - * @memberOf module:twgl - */ - -/** - * Sets various defaults for twgl. - * - * In the interest of terseness which is kind of the point - * of twgl I've integrated a few of the older functions here - * - * @param {module:twgl.Defaults} newDefaults The default settings. - * @memberOf module:twgl - */ - -function setDefaults(newDefaults) { - helper.copyExistingProperties(newDefaults, defaults); - attributes.setAttributeDefaults_(newDefaults); // eslint-disable-line - - textures.setTextureDefaults_(newDefaults); // eslint-disable-line -} - -var prefixRE = /^(.*?)_/; - -function addExtensionToContext(gl, extensionName) { - utils.glEnumToString(gl, 0); - var ext = gl.getExtension(extensionName); - - if (ext) { - var enums = {}; - var fnSuffix = prefixRE.exec(extensionName)[1]; - var enumSuffix = '_' + fnSuffix; - - for (var key in ext) { - var value = ext[key]; - var isFunc = typeof value === 'function'; - var suffix = isFunc ? fnSuffix : enumSuffix; - var name = key; // examples of where this is not true are WEBGL_compressed_texture_s3tc - // and WEBGL_compressed_texture_pvrtc - - if (key.endsWith(suffix)) { - name = key.substring(0, key.length - suffix.length); - } - - if (gl[name] !== undefined) { - if (!isFunc && gl[name] !== value) { - helper.warn(name, gl[name], value, key); - } - } else { - if (isFunc) { - gl[name] = function (origFn) { - return function () { - return origFn.apply(ext, arguments); - }; - }(value); - } else { - gl[name] = value; - enums[name] = value; - } - } - } // pass the modified enums to glEnumToString - - - enums.constructor = { - name: ext.constructor.name - }; - utils.glEnumToString(enums, 0); - } - - return ext; -} -/* - * If you're wondering why the code doesn't just iterate - * over all extensions using `gl.getExtensions` is that it's possible - * some future extension is incompatible with this code. Rather than - * have thing suddenly break it seems better to manually add to this - * list. - * - */ - - -var supportedExtensions = ['ANGLE_instanced_arrays', 'EXT_blend_minmax', 'EXT_color_buffer_float', 'EXT_color_buffer_half_float', 'EXT_disjoint_timer_query', 'EXT_disjoint_timer_query_webgl2', 'EXT_frag_depth', 'EXT_sRGB', 'EXT_shader_texture_lod', 'EXT_texture_filter_anisotropic', 'OES_element_index_uint', 'OES_standard_derivatives', 'OES_texture_float', 'OES_texture_float_linear', 'OES_texture_half_float', 'OES_texture_half_float_linear', 'OES_vertex_array_object', 'WEBGL_color_buffer_float', 'WEBGL_compressed_texture_atc', 'WEBGL_compressed_texture_etc1', 'WEBGL_compressed_texture_pvrtc', 'WEBGL_compressed_texture_s3tc', 'WEBGL_compressed_texture_s3tc_srgb', 'WEBGL_depth_texture', 'WEBGL_draw_buffers']; -/** - * Attempts to enable all of the following extensions - * and add their functions and constants to the - * `WebGLRenderingContext` using their normal non-extension like names. - * - * ANGLE_instanced_arrays - * EXT_blend_minmax - * EXT_color_buffer_float - * EXT_color_buffer_half_float - * EXT_disjoint_timer_query - * EXT_disjoint_timer_query_webgl2 - * EXT_frag_depth - * EXT_sRGB - * EXT_shader_texture_lod - * EXT_texture_filter_anisotropic - * OES_element_index_uint - * OES_standard_derivatives - * OES_texture_float - * OES_texture_float_linear - * OES_texture_half_float - * OES_texture_half_float_linear - * OES_vertex_array_object - * WEBGL_color_buffer_float - * WEBGL_compressed_texture_atc - * WEBGL_compressed_texture_etc1 - * WEBGL_compressed_texture_pvrtc - * WEBGL_compressed_texture_s3tc - * WEBGL_compressed_texture_s3tc_srgb - * WEBGL_depth_texture - * WEBGL_draw_buffers - * - * For example if `ANGLE_instanced_arrays` exists then the functions - * `drawArraysInstanced`, `drawElementsInstanced`, `vertexAttribDivisor` - * and the constant `VERTEX_ATTRIB_ARRAY_DIVISOR` are added to the - * `WebGLRenderingContext`. - * - * Note that if you want to know if the extension exists you should - * probably call `gl.getExtension` for each extension. Alternatively - * you can check for the existance of the functions or constants that - * are expected to be added. For example - * - * if (gl.drawBuffers) { - * // Either WEBGL_draw_buffers was enabled OR you're running in WebGL2 - * .... - * - * @param {WebGLRenderingContext} gl A WebGLRenderingContext - * @memberOf module:twgl - */ - -function addExtensionsToContext(gl) { - for (var ii = 0; ii < supportedExtensions.length; ++ii) { - addExtensionToContext(gl, supportedExtensions[ii]); - } -} -/** - * Creates a webgl context. - * @param {HTMLCanvasElement} canvas The canvas tag to get - * context from. If one is not passed in one will be - * created. - * @return {WebGLRenderingContext} The created context. - */ - - -function create3DContext(canvas, opt_attribs) { - var names = ["webgl", "experimental-webgl"]; - var context = null; - - for (var ii = 0; ii < names.length; ++ii) { - context = canvas.getContext(names[ii], opt_attribs); - - if (context) { - if (defaults.addExtensionsToContext) { - addExtensionsToContext(context); - } - - break; - } - } - - return context; -} -/** - * Gets a WebGL1 context. - * - * Note: Will attempt to enable Vertex Array Objects - * and add WebGL2 entry points. (unless you first set defaults with - * `twgl.setDefaults({enableVertexArrayObjects: false})`; - * - * @param {HTMLCanvasElement} canvas a canvas element. - * @param {WebGLContextCreationAttirbutes} [opt_attribs] optional webgl context creation attributes - * @memberOf module:twgl - */ - - -function getWebGLContext(canvas, opt_attribs) { - var gl = create3DContext(canvas, opt_attribs); - return gl; -} -/** - * Creates a webgl context. - * - * Will return a WebGL2 context if possible. - * - * You can check if it's WebGL2 with - * - * twgl.isWebGL2(gl); - * - * @param {HTMLCanvasElement} canvas The canvas tag to get - * context from. If one is not passed in one will be - * created. - * @return {WebGLRenderingContext} The created context. - */ - - -function createContext(canvas, opt_attribs) { - var names = ["webgl2", "webgl", "experimental-webgl"]; - var context = null; - - for (var ii = 0; ii < names.length; ++ii) { - context = canvas.getContext(names[ii], opt_attribs); - - if (context) { - if (defaults.addExtensionsToContext) { - addExtensionsToContext(context); - } - - break; - } - } - - return context; -} -/** - * Gets a WebGL context. Will create a WebGL2 context if possible. - * - * You can check if it's WebGL2 with - * - * function isWebGL2(gl) { - * return gl.getParameter(gl.VERSION).indexOf("WebGL 2.0 ") == 0; - * } - * - * Note: For a WebGL1 context will attempt to enable Vertex Array Objects - * and add WebGL2 entry points. (unless you first set defaults with - * `twgl.setDefaults({enableVertexArrayObjects: false})`; - * - * @param {HTMLCanvasElement} canvas a canvas element. - * @param {WebGLContextCreationAttirbutes} [opt_attribs] optional webgl context creation attributes - * @return {WebGLRenderingContext} The created context. - * @memberOf module:twgl - */ - - -function getContext(canvas, opt_attribs) { - var gl = createContext(canvas, opt_attribs); - return gl; -} -/** - * Resize a canvas to match the size it's displayed. - * @param {HTMLCanvasElement} canvas The canvas to resize. - * @param {number} [multiplier] So you can pass in `window.devicePixelRatio` or other scale value if you want to. - * @return {boolean} true if the canvas was resized. - * @memberOf module:twgl - */ - - -function resizeCanvasToDisplaySize(canvas, multiplier) { - multiplier = multiplier || 1; - multiplier = Math.max(0, multiplier); - var width = canvas.clientWidth * multiplier | 0; - var height = canvas.clientHeight * multiplier | 0; - - if (canvas.width !== width || canvas.height !== height) { - canvas.width = width; - canvas.height = height; - return true; - } - - return false; -} - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -exports.drawBufferInfo = drawBufferInfo; -exports.drawObjectList = drawObjectList; - -var programs = _interopRequireWildcard(__webpack_require__(5)); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -/* - * Copyright 2015, Gregg Tavares. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Gregg Tavares. nor the names of his - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * Drawing related functions - * - * For backward compatibily they are available at both `twgl.draw` and `twgl` - * itself - * - * See {@link module:twgl} for core functions - * - * @module twgl/draw - */ - -/** - * Calls `gl.drawElements` or `gl.drawArrays`, whichever is appropriate - * - * normally you'd call `gl.drawElements` or `gl.drawArrays` yourself - * but calling this means if you switch from indexed data to non-indexed - * data you don't have to remember to update your draw call. - * - * @param {WebGLRenderingContext} gl A WebGLRenderingContext - * @param {(module:twgl.BufferInfo|module:twgl.VertexArrayInfo)} bufferInfo A BufferInfo as returned from {@link module:twgl.createBufferInfoFromArrays} or - * a VertexArrayInfo as returned from {@link module:twgl.createVertexArrayInfo} - * @param {enum} [type] eg (gl.TRIANGLES, gl.LINES, gl.POINTS, gl.TRIANGLE_STRIP, ...). Defaults to `gl.TRIANGLES` - * @param {number} [count] An optional count. Defaults to bufferInfo.numElements - * @param {number} [offset] An optional offset. Defaults to 0. - * @param {number} [instanceCount] An optional instanceCount. if set then `drawArraysInstanced` or `drawElementsInstanced` will be called - * @memberOf module:twgl/draw - */ -function drawBufferInfo(gl, bufferInfo, type, count, offset, instanceCount) { - type = type === undefined ? gl.TRIANGLES : type; - var indices = bufferInfo.indices; - var elementType = bufferInfo.elementType; - var numElements = count === undefined ? bufferInfo.numElements : count; - offset = offset === undefined ? 0 : offset; - - if (elementType || indices) { - if (instanceCount !== undefined) { - gl.drawElementsInstanced(type, numElements, elementType === undefined ? gl.UNSIGNED_SHORT : bufferInfo.elementType, offset, instanceCount); - } else { - gl.drawElements(type, numElements, elementType === undefined ? gl.UNSIGNED_SHORT : bufferInfo.elementType, offset); - } - } else { - if (instanceCount !== undefined) { - gl.drawArraysInstanced(type, offset, numElements, instanceCount); - } else { - gl.drawArrays(type, offset, numElements); - } - } -} -/** - * A DrawObject is useful for putting objects in to an array and passing them to {@link module:twgl.drawObjectList}. - * - * You need either a `BufferInfo` or a `VertexArrayInfo`. - * - * @typedef {Object} DrawObject - * @property {boolean} [active] whether or not to draw. Default = `true` (must be `false` to be not true). In otherwords `undefined` = `true` - * @property {number} [type] type to draw eg. `gl.TRIANGLES`, `gl.LINES`, etc... - * @property {module:twgl.ProgramInfo} programInfo A ProgramInfo as returned from {@link module:twgl.createProgramInfo} - * @property {module:twgl.BufferInfo} [bufferInfo] A BufferInfo as returned from {@link module:twgl.createBufferInfoFromArrays} - * @property {module:twgl.VertexArrayInfo} [vertexArrayInfo] A VertexArrayInfo as returned from {@link module:twgl.createVertexArrayInfo} - * @property {Object} uniforms The values for the uniforms. - * You can pass multiple objects by putting them in an array. For example - * - * var sharedUniforms = { - * u_fogNear: 10, - * u_projection: ... - * ... - * }; - * - * var localUniforms = { - * u_world: ... - * u_diffuseColor: ... - * }; - * - * var drawObj = { - * ... - * uniforms: [sharedUniforms, localUniforms], - * }; - * - * @property {number} [offset] the offset to pass to `gl.drawArrays` or `gl.drawElements`. Defaults to 0. - * @property {number} [count] the count to pass to `gl.drawArrays` or `gl.drawElemnts`. Defaults to bufferInfo.numElements. - * @property {number} [instanceCount] the number of instances. Defaults to undefined. - * @memberOf module:twgl - */ - -/** - * Draws a list of objects - * @param {DrawObject[]} objectsToDraw an array of objects to draw. - * @memberOf module:twgl/draw - */ - - -function drawObjectList(gl, objectsToDraw) { - var lastUsedProgramInfo = null; - var lastUsedBufferInfo = null; - objectsToDraw.forEach(function (object) { - if (object.active === false) { - return; - } - - var programInfo = object.programInfo; - var bufferInfo = object.vertexArrayInfo || object.bufferInfo; - var bindBuffers = false; - var type = object.type === undefined ? gl.TRIANGLES : object.type; - - if (programInfo !== lastUsedProgramInfo) { - lastUsedProgramInfo = programInfo; - gl.useProgram(programInfo.program); // We have to rebind buffers when changing programs because we - // only bind buffers the program uses. So if 2 programs use the same - // bufferInfo but the 1st one uses only positions the when the - // we switch to the 2nd one some of the attributes will not be on. - - bindBuffers = true; - } // Setup all the needed attributes. - - - if (bindBuffers || bufferInfo !== lastUsedBufferInfo) { - if (lastUsedBufferInfo && lastUsedBufferInfo.vertexArrayObject && !bufferInfo.vertexArrayObject) { - gl.bindVertexArray(null); - } - - lastUsedBufferInfo = bufferInfo; - programs.setBuffersAndAttributes(gl, programInfo, bufferInfo); - } // Set the uniforms. - - - programs.setUniforms(programInfo, object.uniforms); // Draw - - drawBufferInfo(gl, bufferInfo, type, object.count, object.offset, object.instanceCount); - }); - - if (lastUsedBufferInfo.vertexArrayObject) { - gl.bindVertexArray(null); - } -} - -/***/ }), -/* 13 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -exports.bindFramebufferInfo = bindFramebufferInfo; -exports.createFramebufferInfo = createFramebufferInfo; -exports.resizeFramebufferInfo = resizeFramebufferInfo; - -var textures = _interopRequireWildcard(__webpack_require__(8)); - -var helper = _interopRequireWildcard(__webpack_require__(0)); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -/* - * Copyright 2015, Gregg Tavares. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Gregg Tavares. nor the names of his - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * Framebuffer related functions - * - * For backward compatibily they are available at both `twgl.framebuffer` and `twgl` - * itself - * - * See {@link module:twgl} for core functions - * - * @module twgl/framebuffers - */ -// make sure we don't see a global gl -var gl = undefined; // eslint-disable-line - -var UNSIGNED_BYTE = 0x1401; -/* PixelFormat */ - -var DEPTH_COMPONENT = 0x1902; -var RGBA = 0x1908; -/* Framebuffer Object. */ - -var RGBA4 = 0x8056; -var RGB5_A1 = 0x8057; -var RGB565 = 0x8D62; -var DEPTH_COMPONENT16 = 0x81A5; -var STENCIL_INDEX = 0x1901; -var STENCIL_INDEX8 = 0x8D48; -var DEPTH_STENCIL = 0x84F9; -var COLOR_ATTACHMENT0 = 0x8CE0; -var DEPTH_ATTACHMENT = 0x8D00; -var STENCIL_ATTACHMENT = 0x8D20; -var DEPTH_STENCIL_ATTACHMENT = 0x821A; -/* TextureWrapMode */ - -var REPEAT = 0x2901; // eslint-disable-line - -var CLAMP_TO_EDGE = 0x812F; -var MIRRORED_REPEAT = 0x8370; // eslint-disable-line - -/* TextureMagFilter */ - -var NEAREST = 0x2600; // eslint-disable-line - -var LINEAR = 0x2601; -/* TextureMinFilter */ - -var NEAREST_MIPMAP_NEAREST = 0x2700; // eslint-disable-line - -var LINEAR_MIPMAP_NEAREST = 0x2701; // eslint-disable-line - -var NEAREST_MIPMAP_LINEAR = 0x2702; // eslint-disable-line - -var LINEAR_MIPMAP_LINEAR = 0x2703; // eslint-disable-line - -/** - * The options for a framebuffer attachment. - * - * Note: For a `format` that is a texture include all the texture - * options from {@link module:twgl.TextureOptions} for example - * `min`, `mag`, `clamp`, etc... Note that unlike {@link module:twgl.TextureOptions} - * `auto` defaults to `false` for attachment textures but `min` and `mag` default - * to `gl.LINEAR` and `wrap` defaults to `CLAMP_TO_EDGE` - * - * @typedef {Object} AttachmentOptions - * @property {number} [attach] The attachment point. Defaults - * to `gl.COLOR_ATTACTMENT0 + ndx` unless type is a depth or stencil type - * then it's gl.DEPTH_ATTACHMENT or `gl.DEPTH_STENCIL_ATTACHMENT` depending - * on the format or attachment type. - * @property {number} [format] The format. If one of `gl.RGBA4`, - * `gl.RGB565`, `gl.RGB5_A1`, `gl.DEPTH_COMPONENT16`, - * `gl.STENCIL_INDEX8` or `gl.DEPTH_STENCIL` then will create a - * renderbuffer. Otherwise will create a texture. Default = `gl.RGBA` - * @property {number} [type] The type. Used for texture. Default = `gl.UNSIGNED_BYTE`. - * @property {number} [target] The texture target for `gl.framebufferTexture2D`. - * Defaults to `gl.TEXTURE_2D`. Set to appropriate face for cube maps. - * @property {number} [level] level for `gl.framebufferTexture2D`. Defaults to 0. - * @property {WebGLObject} [attachment] An existing renderbuffer or texture. - * If provided will attach this Object. This allows you to share - * attachemnts across framebuffers. - * @memberOf module:twgl - */ - -var defaultAttachments = [{ - format: RGBA, - type: UNSIGNED_BYTE, - min: LINEAR, - wrap: CLAMP_TO_EDGE -}, { - format: DEPTH_STENCIL -}]; -var attachmentsByFormat = {}; -attachmentsByFormat[DEPTH_STENCIL] = DEPTH_STENCIL_ATTACHMENT; -attachmentsByFormat[STENCIL_INDEX] = STENCIL_ATTACHMENT; -attachmentsByFormat[STENCIL_INDEX8] = STENCIL_ATTACHMENT; -attachmentsByFormat[DEPTH_COMPONENT] = DEPTH_ATTACHMENT; -attachmentsByFormat[DEPTH_COMPONENT16] = DEPTH_ATTACHMENT; - -function getAttachmentPointForFormat(format) { - return attachmentsByFormat[format]; -} - -var renderbufferFormats = {}; -renderbufferFormats[RGBA4] = true; -renderbufferFormats[RGB5_A1] = true; -renderbufferFormats[RGB565] = true; -renderbufferFormats[DEPTH_STENCIL] = true; -renderbufferFormats[DEPTH_COMPONENT16] = true; -renderbufferFormats[STENCIL_INDEX] = true; -renderbufferFormats[STENCIL_INDEX8] = true; - -function isRenderbufferFormat(format) { - return renderbufferFormats[format]; -} -/** - * @typedef {Object} FramebufferInfo - * @property {WebGLFramebuffer} framebuffer The WebGLFramebuffer for this framebufferInfo - * @property {WebGLObject[]} attachments The created attachments in the same order as passed in to {@link module:twgl.createFramebufferInfo}. - * @memberOf module:twgl - */ - -/** - * Creates a framebuffer and attachments. - * - * This returns a {@link module:twgl.FramebufferInfo} because it needs to return the attachments as well as the framebuffer. - * - * The simplest usage - * - * // create an RGBA/UNSIGNED_BYTE texture and DEPTH_STENCIL renderbuffer - * const fbi = twgl.createFramebufferInfo(gl); - * - * More complex usage - * - * // create an RGB565 renderbuffer and a STENCIL_INDEX8 renderbuffer - * const attachments = [ - * { format: RGB565, mag: NEAREST }, - * { format: STENCIL_INDEX8 }, - * ] - * const fbi = twgl.createFramebufferInfo(gl, attachments); - * - * Passing in a specific size - * - * const width = 256; - * const height = 256; - * const fbi = twgl.createFramebufferInfo(gl, attachments, width, height); - * - * **Note!!** It is up to you to check if the framebuffer is renderable by calling `gl.checkFramebufferStatus`. - * [WebGL only guarantees 3 combinations of attachments work](https://www.khronos.org/registry/webgl/specs/latest/1.0/#6.6). - * - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - * @param {module:twgl.AttachmentOptions[]} [attachments] which attachments to create. If not provided the default is a framebuffer with an - * `RGBA`, `UNSIGNED_BYTE` texture `COLOR_ATTACHMENT0` and a `DEPTH_STENCIL` renderbuffer `DEPTH_STENCIL_ATTACHMENT`. - * @param {number} [width] the width for the attachments. Default = size of drawingBuffer - * @param {number} [height] the height for the attachments. Defautt = size of drawingBuffer - * @return {module:twgl.FramebufferInfo} the framebuffer and attachments. - * @memberOf module:twgl/framebuffers - */ - - -function createFramebufferInfo(gl, attachments, width, height) { - var target = gl.FRAMEBUFFER; - var fb = gl.createFramebuffer(); - gl.bindFramebuffer(target, fb); - width = width || gl.drawingBufferWidth; - height = height || gl.drawingBufferHeight; - attachments = attachments || defaultAttachments; - var colorAttachmentCount = 0; - var framebufferInfo = { - framebuffer: fb, - attachments: [], - width: width, - height: height - }; - attachments.forEach(function (attachmentOptions) { - var attachment = attachmentOptions.attachment; - var format = attachmentOptions.format; - var attachmentPoint = getAttachmentPointForFormat(format); - - if (!attachmentPoint) { - attachmentPoint = COLOR_ATTACHMENT0 + colorAttachmentCount++; - } - - if (!attachment) { - if (isRenderbufferFormat(format)) { - attachment = gl.createRenderbuffer(); - gl.bindRenderbuffer(gl.RENDERBUFFER, attachment); - gl.renderbufferStorage(gl.RENDERBUFFER, format, width, height); - } else { - var textureOptions = Object.assign({}, attachmentOptions); - textureOptions.width = width; - textureOptions.height = height; - - if (textureOptions.auto === undefined) { - textureOptions.auto = false; - textureOptions.min = textureOptions.min || textureOptions.minMag || gl.LINEAR; - textureOptions.mag = textureOptions.mag || textureOptions.minMag || gl.LINEAR; - textureOptions.wrapS = textureOptions.wrapS || textureOptions.wrap || gl.CLAMP_TO_EDGE; - textureOptions.wrapT = textureOptions.wrapT || textureOptions.wrap || gl.CLAMP_TO_EDGE; - } - - attachment = textures.createTexture(gl, textureOptions); - } - } - - if (helper.isRenderbuffer(gl, attachment)) { - gl.framebufferRenderbuffer(target, attachmentPoint, gl.RENDERBUFFER, attachment); - } else if (helper.isTexture(gl, attachment)) { - gl.framebufferTexture2D(target, attachmentPoint, attachmentOptions.texTarget || gl.TEXTURE_2D, attachment, attachmentOptions.level || 0); - } else { - throw "unknown attachment type"; - } - - framebufferInfo.attachments.push(attachment); - }); - return framebufferInfo; -} -/** - * Resizes the attachments of a framebuffer. - * - * You need to pass in the same `attachments` as you passed in {@link module:twgl.createFramebufferInfo} - * because TWGL has no idea the format/type of each attachment. - * - * The simplest usage - * - * // create an RGBA/UNSIGNED_BYTE texture and DEPTH_STENCIL renderbuffer - * const fbi = twgl.createFramebufferInfo(gl); - * - * ... - * - * function render() { - * if (twgl.resizeCanvasToDisplaySize(gl.canvas)) { - * // resize the attachments - * twgl.resizeFramebufferInfo(gl, fbi); - * } - * - * More complex usage - * - * // create an RGB565 renderbuffer and a STENCIL_INDEX8 renderbuffer - * const attachments = [ - * { format: RGB565, mag: NEAREST }, - * { format: STENCIL_INDEX8 }, - * ] - * const fbi = twgl.createFramebufferInfo(gl, attachments); - * - * ... - * - * function render() { - * if (twgl.resizeCanvasToDisplaySize(gl.canvas)) { - * // resize the attachments to match - * twgl.resizeFramebufferInfo(gl, fbi, attachments); - * } - * - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - * @param {module:twgl.FramebufferInfo} framebufferInfo a framebufferInfo as returned from {@link module:twgl.createFramebufferInfo}. - * @param {module:twgl.AttachmentOptions[]} [attachments] the same attachments options as passed to {@link module:twgl.createFramebufferInfo}. - * @param {number} [width] the width for the attachments. Default = size of drawingBuffer - * @param {number} [height] the height for the attachments. Defautt = size of drawingBuffer - * @memberOf module:twgl/framebuffers - */ - - -function resizeFramebufferInfo(gl, framebufferInfo, attachments, width, height) { - width = width || gl.drawingBufferWidth; - height = height || gl.drawingBufferHeight; - framebufferInfo.width = width; - framebufferInfo.height = height; - attachments = attachments || defaultAttachments; - attachments.forEach(function (attachmentOptions, ndx) { - var attachment = framebufferInfo.attachments[ndx]; - var format = attachmentOptions.format; - - if (helper.isRenderbuffer(gl, attachment)) { - gl.bindRenderbuffer(gl.RENDERBUFFER, attachment); - gl.renderbufferStorage(gl.RENDERBUFFER, format, width, height); - } else if (helper.isTexture(gl, attachment)) { - textures.resizeTexture(gl, attachment, attachmentOptions, width, height); - } else { - throw "unknown attachment type"; - } - }); -} -/** - * Binds a framebuffer - * - * This function pretty much soley exists because I spent hours - * trying to figure out why something I wrote wasn't working only - * to realize I forget to set the viewport dimensions. - * My hope is this function will fix that. - * - * It is effectively the same as - * - * gl.bindFramebuffer(gl.FRAMEBUFFER, someFramebufferInfo.framebuffer); - * gl.viewport(0, 0, someFramebufferInfo.width, someFramebufferInfo.height); - * - * @param {WebGLRenderingContext} gl the WebGLRenderingContext - * @param {module:twgl.FramebufferInfo} [framebufferInfo] a framebufferInfo as returned from {@link module:twgl.createFramebufferInfo}. - * If not passed will bind the canvas. - * @param {number} [target] The target. If not passed `gl.FRAMEBUFFER` will be used. - * @memberOf module:twgl/framebuffers - */ - - -function bindFramebufferInfo(gl, framebufferInfo, target) { - target = target || gl.FRAMEBUFFER; - - if (framebufferInfo) { - gl.bindFramebuffer(target, framebufferInfo.framebuffer); - gl.viewport(0, 0, framebufferInfo.width, framebufferInfo.height); - } else { - gl.bindFramebuffer(target, null); - gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); - } -} - -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; -exports.createVertexArrayInfo = createVertexArrayInfo; -exports.createVAOAndSetAttributes = createVAOAndSetAttributes; -exports.createVAOFromBufferInfo = createVAOFromBufferInfo; - -var programs = _interopRequireWildcard(__webpack_require__(5)); - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } - -/* - * Copyright 2015, Gregg Tavares. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Gregg Tavares. nor the names of his - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * vertex array object related functions - * - * You should generally not need to use these functions. They are provided - * for those cases where you're doing something out of the ordinary - * and you need lower level access. - * - * For backward compatibily they are available at both `twgl.attributes` and `twgl` - * itself - * - * See {@link module:twgl} for core functions - * - * @module twgl/vertexArrays - */ - -/** - * @typedef {Object} VertexArrayInfo - * @property {number} numElements The number of elements to pass to `gl.drawArrays` or `gl.drawElements`. - * @property {number} [elementType] The type of indices `UNSIGNED_BYTE`, `UNSIGNED_SHORT` etc.. - * @property {WebGLVertexArrayObject} [vertexArrayObject] a vertex array object - * @memberOf module:twgl - */ - -/** - * Creates a VertexArrayInfo from a BufferInfo and one or more ProgramInfos - * - * This can be passed to {@link module:twgl.setBuffersAndAttributes} and to - * {@link module:twgl:drawBufferInfo}. - * - * > **IMPORTANT:** Vertex Array Objects are **not** a direct analog for a BufferInfo. Vertex Array Objects - * assign buffers to specific attributes at creation time. That means they can only be used with programs - * who's attributes use the same attribute locations for the same purposes. - * - * > Bind your attribute locations by passing an array of attribute names to {@link module:twgl.createProgramInfo} - * or use WebGL 2's GLSL ES 3's `layout(location = )` to make sure locations match. - * - * also - * - * > **IMPORTANT:** After calling twgl.setBuffersAndAttribute with a BufferInfo that uses a Vertex Array Object - * that Vertex Array Object will be bound. That means **ANY MANIPULATION OF ELEMENT_ARRAY_BUFFER or ATTRIBUTES** - * will affect the Vertex Array Object state. - * - * > Call `gl.bindVertexArray(null)` to get back manipulating the global attributes and ELEMENT_ARRAY_BUFFER. - * - * @param {WebGLRenderingContext} gl A WebGLRenderingContext - * @param {module:twgl.ProgramInfo|module:twgl.ProgramInfo[]} programInfo a programInfo or array of programInfos - * @param {module:twgl.BufferInfo} bufferInfo BufferInfo as returned from createBufferInfoFromArrays etc... - * - * You need to make sure every attribute that will be used is bound. So for example assume shader 1 - * uses attributes A, B, C and shader 2 uses attributes A, B, D. If you only pass in the programInfo - * for shader 1 then only attributes A, B, and C will have their attributes set because TWGL doesn't - * now attribute D's location. - * - * So, you can pass in both shader 1 and shader 2's programInfo - * - * @return {module:twgl.VertexArrayInfo} The created VertexArrayInfo - * - * @memberOf module:twgl/vertexArrays - */ -function createVertexArrayInfo(gl, programInfos, bufferInfo) { - var vao = gl.createVertexArray(); - gl.bindVertexArray(vao); - - if (!programInfos.length) { - programInfos = [programInfos]; - } - - programInfos.forEach(function (programInfo) { - programs.setBuffersAndAttributes(gl, programInfo, bufferInfo); - }); - gl.bindVertexArray(null); - return { - numElements: bufferInfo.numElements, - elementType: bufferInfo.elementType, - vertexArrayObject: vao - }; -} -/** - * Creates a vertex array object and then sets the attributes on it - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext to use. - * @param {Object.} setters Attribute setters as returned from createAttributeSetters - * @param {Object.} attribs AttribInfos mapped by attribute name. - * @param {WebGLBuffer} [indices] an optional ELEMENT_ARRAY_BUFFER of indices - * @memberOf module:twgl/vertexArrays - */ - - -function createVAOAndSetAttributes(gl, setters, attribs, indices) { - var vao = gl.createVertexArray(); - gl.bindVertexArray(vao); - programs.setAttributes(setters, attribs); - - if (indices) { - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indices); - } // We unbind this because otherwise any change to ELEMENT_ARRAY_BUFFER - // like when creating buffers for other stuff will mess up this VAO's binding - - - gl.bindVertexArray(null); - return vao; -} -/** - * Creates a vertex array object and then sets the attributes - * on it - * - * @param {WebGLRenderingContext} gl The WebGLRenderingContext - * to use. - * @param {Object.| module:twgl.ProgramInfo} programInfo as returned from createProgramInfo or Attribute setters as returned from createAttributeSetters - * @param {module:twgl.BufferInfo} bufferInfo BufferInfo as returned from createBufferInfoFromArrays etc... - * @param {WebGLBuffer} [indices] an optional ELEMENT_ARRAY_BUFFER of indices - * @memberOf module:twgl/vertexArrays - */ - - -function createVAOFromBufferInfo(gl, programInfo, bufferInfo) { - return createVAOAndSetAttributes(gl, programInfo.attribSetters || programInfo, bufferInfo.attribs, bufferInfo.indices); -} - -/***/ }) -/******/ ]); -}); - -/***/ }), - -/***/ "./node_modules/unicode-trie/index.js": -/*!********************************************!*\ - !*** ./node_modules/unicode-trie/index.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -// Generated by CoffeeScript 1.7.1 -var UnicodeTrie, inflate; - -inflate = __webpack_require__(/*! tiny-inflate */ "./node_modules/tiny-inflate/index.js"); - -UnicodeTrie = (function() { - var DATA_BLOCK_LENGTH, DATA_GRANULARITY, DATA_MASK, INDEX_1_OFFSET, INDEX_2_BLOCK_LENGTH, INDEX_2_BMP_LENGTH, INDEX_2_MASK, INDEX_SHIFT, LSCP_INDEX_2_LENGTH, LSCP_INDEX_2_OFFSET, OMITTED_BMP_INDEX_1_LENGTH, SHIFT_1, SHIFT_1_2, SHIFT_2, UTF8_2B_INDEX_2_LENGTH, UTF8_2B_INDEX_2_OFFSET; - - SHIFT_1 = 6 + 5; - - SHIFT_2 = 5; - - SHIFT_1_2 = SHIFT_1 - SHIFT_2; - - OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> SHIFT_1; - - INDEX_2_BLOCK_LENGTH = 1 << SHIFT_1_2; - - INDEX_2_MASK = INDEX_2_BLOCK_LENGTH - 1; - - INDEX_SHIFT = 2; - - DATA_BLOCK_LENGTH = 1 << SHIFT_2; - - DATA_MASK = DATA_BLOCK_LENGTH - 1; - - LSCP_INDEX_2_OFFSET = 0x10000 >> SHIFT_2; - - LSCP_INDEX_2_LENGTH = 0x400 >> SHIFT_2; - - INDEX_2_BMP_LENGTH = LSCP_INDEX_2_OFFSET + LSCP_INDEX_2_LENGTH; - - UTF8_2B_INDEX_2_OFFSET = INDEX_2_BMP_LENGTH; - - UTF8_2B_INDEX_2_LENGTH = 0x800 >> 6; - - INDEX_1_OFFSET = UTF8_2B_INDEX_2_OFFSET + UTF8_2B_INDEX_2_LENGTH; - - DATA_GRANULARITY = 1 << INDEX_SHIFT; - - function UnicodeTrie(data) { - var isBuffer, uncompressedLength, view; - isBuffer = typeof data.readUInt32BE === 'function' && typeof data.slice === 'function'; - if (isBuffer || data instanceof Uint8Array) { - if (isBuffer) { - this.highStart = data.readUInt32BE(0); - this.errorValue = data.readUInt32BE(4); - uncompressedLength = data.readUInt32BE(8); - data = data.slice(12); - } else { - view = new DataView(data.buffer); - this.highStart = view.getUint32(0); - this.errorValue = view.getUint32(4); - uncompressedLength = view.getUint32(8); - data = data.subarray(12); - } - data = inflate(data, new Uint8Array(uncompressedLength)); - data = inflate(data, new Uint8Array(uncompressedLength)); - this.data = new Uint32Array(data.buffer); - } else { - this.data = data.data, this.highStart = data.highStart, this.errorValue = data.errorValue; - } - } - - UnicodeTrie.prototype.get = function(codePoint) { - var index; - if (codePoint < 0 || codePoint > 0x10ffff) { - return this.errorValue; - } - if (codePoint < 0xd800 || (codePoint > 0xdbff && codePoint <= 0xffff)) { - index = (this.data[codePoint >> SHIFT_2] << INDEX_SHIFT) + (codePoint & DATA_MASK); - return this.data[index]; - } - if (codePoint <= 0xffff) { - index = (this.data[LSCP_INDEX_2_OFFSET + ((codePoint - 0xd800) >> SHIFT_2)] << INDEX_SHIFT) + (codePoint & DATA_MASK); - return this.data[index]; - } - if (codePoint < this.highStart) { - index = this.data[(INDEX_1_OFFSET - OMITTED_BMP_INDEX_1_LENGTH) + (codePoint >> SHIFT_1)]; - index = this.data[index + ((codePoint >> SHIFT_2) & INDEX_2_MASK)]; - index = (index << INDEX_SHIFT) + (codePoint & DATA_MASK); - return this.data[index]; - } - return this.data[this.data.length - DATA_GRANULARITY]; - }; - - return UnicodeTrie; - -})(); - -module.exports = UnicodeTrie; - - -/***/ }), - -/***/ "./node_modules/webpack/buildin/global.js": -/*!***********************************!*\ - !*** (webpack)/buildin/global.js ***! - \***********************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || new Function("return this")(); -} catch (e) { - // This works if the window reference is available - if (typeof window === "object") g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; - - -/***/ }), - -/***/ "./src/BitmapSkin.js": -/*!***************************!*\ - !*** ./src/BitmapSkin.js ***! - \***************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var twgl = __webpack_require__(/*! twgl.js */ "./node_modules/twgl.js/dist/4.x/twgl-full.js"); - -var Skin = __webpack_require__(/*! ./Skin */ "./src/Skin.js"); - -var BitmapSkin = function (_Skin) { - _inherits(BitmapSkin, _Skin); - - /** - * Create a new Bitmap Skin. - * @extends Skin - * @param {!int} id - The ID for this Skin. - * @param {!RenderWebGL} renderer - The renderer which will use this skin. - */ - function BitmapSkin(id, renderer) { - _classCallCheck(this, BitmapSkin); - - /** @type {!int} */ - var _this = _possibleConstructorReturn(this, (BitmapSkin.__proto__ || Object.getPrototypeOf(BitmapSkin)).call(this, id, renderer)); - - _this._costumeResolution = 1; - - /** @type {Array} */ - _this._textureSize = [0, 0]; - return _this; - } - - /** - * Dispose of this object. Do not use it after calling this method. - */ - - - _createClass(BitmapSkin, [{ - key: 'dispose', - value: function dispose() { - if (this._texture) { - this._renderer.gl.deleteTexture(this._texture); - this._texture = null; - } - _get(BitmapSkin.prototype.__proto__ || Object.getPrototypeOf(BitmapSkin.prototype), 'dispose', this).call(this); - } - - /** - * @return {Array} the "native" size, in texels, of this skin. - */ - - }, { - key: 'getTexture', - - - /** - * @param {Array} scale - The scaling factors to be used. - * @return {WebGLTexture} The GL texture representation of this skin when drawing at the given scale. - */ - // eslint-disable-next-line no-unused-vars - value: function getTexture(scale) { - return this._texture || _get(BitmapSkin.prototype.__proto__ || Object.getPrototypeOf(BitmapSkin.prototype), 'getTexture', this).call(this); - } - - /** - * Set the contents of this skin to a snapshot of the provided bitmap data. - * @param {ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} bitmapData - new contents for this skin. - * @param {int} [costumeResolution=1] - The resolution to use for this bitmap. - * @param {Array} [rotationCenter] - Optional rotation center for the bitmap. If not supplied, it will be - * calculated from the bounding box - * @fires Skin.event:WasAltered - */ - - }, { - key: 'setBitmap', - value: function setBitmap(bitmapData, costumeResolution, rotationCenter) { - if (!bitmapData.width || !bitmapData.height) { - _get(BitmapSkin.prototype.__proto__ || Object.getPrototypeOf(BitmapSkin.prototype), 'setEmptyImageData', this).call(this); - return; - } - var gl = this._renderer.gl; - - // TW: We want to use as-is because reading ImageData wastes memory. - // However, vanilla LLK/scratch-vm will reuse any canvas that we get here for other costumes, - // which will cause bugs when Silhouette lazily reads the canvas data. - // TurboWarp/scratch-vm does not reuse canvases and will set canvas.reusable = false. - var textureData = bitmapData; - if (bitmapData instanceof HTMLCanvasElement && bitmapData.reusable !== false) { - var context = bitmapData.getContext('2d'); - textureData = context.getImageData(0, 0, bitmapData.width, bitmapData.height); - } - - if (this._texture === null) { - var textureOptions = { - auto: false, - wrap: gl.CLAMP_TO_EDGE - }; - - this._texture = twgl.createTexture(gl, textureOptions); - } - - this._setTexture(textureData); - - // Do these last in case any of the above throws an exception - this._costumeResolution = costumeResolution || 2; - this._textureSize = BitmapSkin._getBitmapSize(bitmapData); - - if (typeof rotationCenter === 'undefined') rotationCenter = this.calculateRotationCenter(); - this._rotationCenter[0] = rotationCenter[0]; - this._rotationCenter[1] = rotationCenter[1]; - - this.emitWasAltered(); - } - - /** - * @param {ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} bitmapData - bitmap data to inspect. - * @returns {Array} the width and height of the bitmap data, in pixels. - * @private - */ - - }, { - key: 'size', - get: function get() { - return [this._textureSize[0] / this._costumeResolution, this._textureSize[1] / this._costumeResolution]; - } - }], [{ - key: '_getBitmapSize', - value: function _getBitmapSize(bitmapData) { - if (bitmapData instanceof HTMLImageElement) { - return [bitmapData.naturalWidth || bitmapData.width, bitmapData.naturalHeight || bitmapData.height]; - } - - if (bitmapData instanceof HTMLVideoElement) { - return [bitmapData.videoWidth || bitmapData.width, bitmapData.videoHeight || bitmapData.height]; - } - - // ImageData or HTMLCanvasElement - return [bitmapData.width, bitmapData.height]; - } - }]); - - return BitmapSkin; -}(Skin); - -module.exports = BitmapSkin; - -/***/ }), - -/***/ "./src/Drawable.js": -/*!*************************!*\ - !*** ./src/Drawable.js ***! - \*************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var twgl = __webpack_require__(/*! twgl.js */ "./node_modules/twgl.js/dist/4.x/twgl-full.js"); - -var Rectangle = __webpack_require__(/*! ./Rectangle */ "./src/Rectangle.js"); -var RenderConstants = __webpack_require__(/*! ./RenderConstants */ "./src/RenderConstants.js"); -var ShaderManager = __webpack_require__(/*! ./ShaderManager */ "./src/ShaderManager.js"); -var EffectTransform = __webpack_require__(/*! ./EffectTransform */ "./src/EffectTransform.js"); -var log = __webpack_require__(/*! ./util/log */ "./src/util/log.js"); - -/** - * An internal workspace for calculating texture locations from world vectors - * this is REUSED for memory conservation reasons - * @type {twgl.v3} - */ -var __isTouchingPosition = twgl.v3.create(); -var FLOATING_POINT_ERROR_ALLOWANCE = 1e-6; - -/** - * Convert a scratch space location into a texture space float. Uses the - * internal __isTouchingPosition as a return value, so this should be copied - * if you ever need to get two local positions and store both. Requires that - * the drawable inverseMatrix is up to date. - * - * @param {Drawable} drawable The drawable to get the inverse matrix and uniforms from - * @param {twgl.v3} vec [x,y] scratch space vector - * @return {twgl.v3} [x,y] texture space float vector - transformed by effects and matrix - */ -var getLocalPosition = function getLocalPosition(drawable, vec) { - // Transfrom from world coordinates to Drawable coordinates. - var localPosition = __isTouchingPosition; - var v0 = vec[0]; - var v1 = vec[1]; - var m = drawable._inverseMatrix; - // var v2 = v[2]; - var d = v0 * m[3] + v1 * m[7] + m[15]; - // The RenderWebGL quad flips the texture's X axis. So rendered bottom - // left is 1, 0 and the top right is 0, 1. Flip the X axis so - // localPosition matches that transformation. - localPosition[0] = 0.5 - (v0 * m[0] + v1 * m[4] + m[12]) / d; - localPosition[1] = (v0 * m[1] + v1 * m[5] + m[13]) / d + 0.5; - // Fix floating point issues near 0. Filed https://github.com/LLK/scratch-render/issues/688 that - // they're happening in the first place. - // TODO: Check if this can be removed after render pull 479 is merged - if (Math.abs(localPosition[0]) < FLOATING_POINT_ERROR_ALLOWANCE) localPosition[0] = 0; - if (Math.abs(localPosition[1]) < FLOATING_POINT_ERROR_ALLOWANCE) localPosition[1] = 0; - // Apply texture effect transform if the localPosition is within the drawable's space, - // and any effects are currently active. - if (drawable.enabledEffects !== 0 && localPosition[0] >= 0 && localPosition[0] < 1 && localPosition[1] >= 0 && localPosition[1] < 1) { - - EffectTransform.transformPoint(drawable, localPosition, localPosition); - } - return localPosition; -}; - -var Drawable = function () { - /** - * An object which can be drawn by the renderer. - * @todo double-buffer all rendering state (position, skin, effects, etc.) - * @param {!int} id - This Drawable's unique ID. - * @param {!RenderWebGL} renderer - The renderer that created this Drawable - * @constructor - */ - function Drawable(id, renderer) { - _classCallCheck(this, Drawable); - - /** @type {!int} */ - this._id = id; - this._renderer = renderer; - - /** - * The uniforms to be used by the vertex and pixel shaders. - * Some of these are used by other parts of the renderer as well. - * @type {Object.} - * @private - */ - this._uniforms = { - /** - * The model matrix, to concat with projection at draw time. - * @type {module:twgl/m4.Mat4} - */ - u_modelMatrix: twgl.m4.identity(), - - /** - * The color to use in the silhouette draw mode. - * @type {Array} - */ - u_silhouetteColor: Drawable.color4fFromID(this._id) - }; - - // Effect values are uniforms too - var numEffects = ShaderManager.EFFECTS.length; - for (var index = 0; index < numEffects; ++index) { - var effectName = ShaderManager.EFFECTS[index]; - var effectInfo = ShaderManager.EFFECT_INFO[effectName]; - var converter = effectInfo.converter; - this._uniforms[effectInfo.uniformName] = converter(0); - } - - this._position = twgl.v3.create(0, 0); - this._scale = twgl.v3.create(100, 100); - this._direction = 90; - this._transformDirty = true; - this._rotationMatrix = twgl.m4.identity(); - this._rotationTransformDirty = true; - this._rotationAdjusted = twgl.v3.create(); - this._rotationCenterDirty = true; - this._skinScale = twgl.v3.create(0, 0, 0); - this._skinScaleDirty = true; - this._inverseMatrix = twgl.m4.identity(); - this._inverseTransformDirty = true; - this._visible = true; - - /** A bitmask identifying which effects are currently in use. - * @readonly - * @type {int} */ - this.enabledEffects = 0; - - /** @todo move convex hull functionality, maybe bounds functionality overall, to Skin classes */ - this._convexHullPoints = null; - this._convexHullDirty = true; - - // The precise bounding box will be from the transformed convex hull points, - // so initialize the array of transformed hull points in setConvexHullPoints. - // Initializing it once per convex hull recalculation avoids unnecessary creation of twgl.v3 objects. - this._transformedHullPoints = null; - this._transformedHullDirty = true; - - this._skinWasAltered = this._skinWasAltered.bind(this); - - this.isTouching = this._isTouchingNever; - - this._highQuality = false; - } - - _createClass(Drawable, [{ - key: 'setHighQuality', - value: function setHighQuality(highQuality) { - this._highQuality = highQuality; - } - - /** - * Dispose of this Drawable. Do not use it after calling this method. - */ - - }, { - key: 'dispose', - value: function dispose() { - // Use the setter: disconnect events - this.skin = null; - } - - /** - * Mark this Drawable's transform as dirty. - * It will be recalculated next time it's needed. - */ - - }, { - key: 'setTransformDirty', - value: function setTransformDirty() { - this._transformDirty = true; - this._inverseTransformDirty = true; - this._transformedHullDirty = true; - } - - /** - * @returns {number} The ID for this Drawable. - */ - - }, { - key: 'getUniforms', - - - /** - * @returns {object.} the shader uniforms to be used when rendering this Drawable. - */ - value: function getUniforms() { - if (this._transformDirty) { - this._calculateTransform(); - } - return this._uniforms; - } - - /** - * @returns {boolean} whether this Drawable is visible. - */ - - }, { - key: 'getVisible', - value: function getVisible() { - return this._visible; - } - - /** - * Update the position if it is different. Marks the transform as dirty. - * @param {Array.} position A new position. - */ - - }, { - key: 'updatePosition', - value: function updatePosition(position) { - if (this._position[0] !== position[0] || this._position[1] !== position[1]) { - if (this._highQuality) { - this._position[0] = position[0]; - this._position[1] = position[1]; - } else { - this._position[0] = Math.round(position[0]); - this._position[1] = Math.round(position[1]); - } - this._renderer.dirty = true; - this.setTransformDirty(); - } - } - - /** - * Update the direction if it is different. Marks the transform as dirty. - * @param {number} direction A new direction. - */ - - }, { - key: 'updateDirection', - value: function updateDirection(direction) { - if (this._direction !== direction) { - this._direction = direction; - this._renderer.dirty = true; - this._rotationTransformDirty = true; - this.setTransformDirty(); - } - } - - /** - * Update the scale if it is different. Marks the transform as dirty. - * @param {Array.} scale A new scale. - */ - - }, { - key: 'updateScale', - value: function updateScale(scale) { - if (this._scale[0] !== scale[0] || this._scale[1] !== scale[1]) { - this._scale[0] = scale[0]; - this._scale[1] = scale[1]; - this._renderer.dirty = true; - this._rotationCenterDirty = true; - this._skinScaleDirty = true; - this.setTransformDirty(); - } - } - - /** - * Update visibility if it is different. Marks the convex hull as dirty. - * @param {boolean} visible A new visibility state. - */ - - }, { - key: 'updateVisible', - value: function updateVisible(visible) { - if (this._visible !== visible) { - this._visible = visible; - this._renderer.dirty = true; - this.setConvexHullDirty(); - } - } - - /** - * Update an effect. Marks the convex hull as dirty if the effect changes shape. - * @param {string} effectName The name of the effect. - * @param {number} rawValue A new effect value. - */ - - }, { - key: 'updateEffect', - value: function updateEffect(effectName, rawValue) { - this._renderer.dirty = true; - var effectInfo = ShaderManager.EFFECT_INFO[effectName]; - if (rawValue) { - this.enabledEffects |= effectInfo.mask; - } else { - this.enabledEffects &= ~effectInfo.mask; - } - var converter = effectInfo.converter; - this._uniforms[effectInfo.uniformName] = converter(rawValue); - if (effectInfo.shapeChanges) { - this.setConvexHullDirty(); - } - } - - /** - * Update the position, direction, scale, or effect properties of this Drawable. - * @deprecated Use specific update* methods instead. - * @param {object.} properties The new property values to set. - */ - - }, { - key: 'updateProperties', - value: function updateProperties(properties) { - if ('position' in properties) { - this.updatePosition(properties.position); - } - if ('direction' in properties) { - this.updateDirection(properties.direction); - } - if ('scale' in properties) { - this.updateScale(properties.scale); - } - if ('visible' in properties) { - this.updateVisible(properties.visible); - } - var numEffects = ShaderManager.EFFECTS.length; - for (var index = 0; index < numEffects; ++index) { - var effectName = ShaderManager.EFFECTS[index]; - if (effectName in properties) { - this.updateEffect(effectName, properties[effectName]); - } - } - } - - /** - * Calculate the transform to use when rendering this Drawable. - * @private - */ - - }, { - key: '_calculateTransform', - value: function _calculateTransform() { - if (this._rotationTransformDirty) { - var rotation = (270 - this._direction) * Math.PI / 180; - - // Calling rotationZ sets the destination matrix to a rotation - // around the Z axis setting matrix components 0, 1, 4 and 5 with - // cosine and sine values of the rotation. - // twgl.m4.rotationZ(rotation, this._rotationMatrix); - - // twgl assumes the last value set to the matrix was anything. - // Drawable knows, it was another rotationZ matrix, so we can skip - // assigning the values that will never change. - var c = Math.cos(rotation); - var s = Math.sin(rotation); - this._rotationMatrix[0] = c; - this._rotationMatrix[1] = s; - // this._rotationMatrix[2] = 0; - // this._rotationMatrix[3] = 0; - this._rotationMatrix[4] = -s; - this._rotationMatrix[5] = c; - // this._rotationMatrix[6] = 0; - // this._rotationMatrix[7] = 0; - // this._rotationMatrix[8] = 0; - // this._rotationMatrix[9] = 0; - // this._rotationMatrix[10] = 1; - // this._rotationMatrix[11] = 0; - // this._rotationMatrix[12] = 0; - // this._rotationMatrix[13] = 0; - // this._rotationMatrix[14] = 0; - // this._rotationMatrix[15] = 1; - - this._rotationTransformDirty = false; - } - - // Adjust rotation center relative to the skin. - if (this._rotationCenterDirty && this.skin !== null) { - // twgl version of the following in function work. - // let rotationAdjusted = twgl.v3.subtract( - // this.skin.rotationCenter, - // twgl.v3.divScalar(this.skin.size, 2, this._rotationAdjusted), - // this._rotationAdjusted - // ); - // rotationAdjusted = twgl.v3.multiply( - // rotationAdjusted, this._scale, rotationAdjusted - // ); - // rotationAdjusted = twgl.v3.divScalar( - // rotationAdjusted, 100, rotationAdjusted - // ); - // rotationAdjusted[1] *= -1; // Y flipped to Scratch coordinate. - // rotationAdjusted[2] = 0; // Z coordinate is 0. - - // Locally assign rotationCenter and skinSize to keep from having - // the Skin getter properties called twice while locally assigning - // their components for readability. - var rotationCenter = this.skin.rotationCenter; - var skinSize = this.skin.size; - var center0 = rotationCenter[0]; - var center1 = rotationCenter[1]; - var skinSize0 = skinSize[0]; - var skinSize1 = skinSize[1]; - var _scale = this._scale[0]; - var _scale2 = this._scale[1]; - - var rotationAdjusted = this._rotationAdjusted; - rotationAdjusted[0] = (center0 - skinSize0 / 2) * _scale / 100; - rotationAdjusted[1] = (center1 - skinSize1 / 2) * _scale2 / 100 * -1; - // rotationAdjusted[2] = 0; - - this._rotationCenterDirty = false; - } - - if (this._skinScaleDirty && this.skin !== null) { - // twgl version of the following in function work. - // const scaledSize = twgl.v3.divScalar( - // twgl.v3.multiply(this.skin.size, this._scale), - // 100 - // ); - // // was NaN because the vectors have only 2 components. - // scaledSize[2] = 0; - - // Locally assign skinSize to keep from having the Skin getter - // properties called twice. - var _skinSize = this.skin.size; - var scaledSize = this._skinScale; - scaledSize[0] = _skinSize[0] * this._scale[0] / 100; - scaledSize[1] = _skinSize[1] * this._scale[1] / 100; - // scaledSize[2] = 0; - - this._skinScaleDirty = false; - } - - var modelMatrix = this._uniforms.u_modelMatrix; - - // twgl version of the following in function work. - // twgl.m4.identity(modelMatrix); - // twgl.m4.translate(modelMatrix, this._position, modelMatrix); - // twgl.m4.multiply(modelMatrix, this._rotationMatrix, modelMatrix); - // twgl.m4.translate(modelMatrix, this._rotationAdjusted, modelMatrix); - // twgl.m4.scale(modelMatrix, scaledSize, modelMatrix); - - // Drawable configures a 3D matrix for drawing in WebGL, but most values - // will never be set because the inputs are on the X and Y position axis - // and the Z rotation axis. Drawable can bring the work inside - // _calculateTransform and greatly reduce the ammount of math and array - // assignments needed. - - var scale0 = this._skinScale[0]; - var scale1 = this._skinScale[1]; - var rotation00 = this._rotationMatrix[0]; - var rotation01 = this._rotationMatrix[1]; - var rotation10 = this._rotationMatrix[4]; - var rotation11 = this._rotationMatrix[5]; - var adjusted0 = this._rotationAdjusted[0]; - var adjusted1 = this._rotationAdjusted[1]; - var position0 = this._position[0]; - var position1 = this._position[1]; - - // Commented assignments show what the values are when the matrix was - // instantiated. Those values will never change so they do not need to - // be reassigned. - modelMatrix[0] = scale0 * rotation00; - modelMatrix[1] = scale0 * rotation01; - // modelMatrix[2] = 0; - // modelMatrix[3] = 0; - modelMatrix[4] = scale1 * rotation10; - modelMatrix[5] = scale1 * rotation11; - // modelMatrix[6] = 0; - // modelMatrix[7] = 0; - // modelMatrix[8] = 0; - // modelMatrix[9] = 0; - // modelMatrix[10] = 1; - // modelMatrix[11] = 0; - modelMatrix[12] = rotation00 * adjusted0 + rotation10 * adjusted1 + position0; - modelMatrix[13] = rotation01 * adjusted0 + rotation11 * adjusted1 + position1; - // modelMatrix[14] = 0; - // modelMatrix[15] = 1; - - this._transformDirty = false; - } - - /** - * Whether the Drawable needs convex hull points provided by the renderer. - * @return {boolean} True when no convex hull known, or it's dirty. - */ - - }, { - key: 'needsConvexHullPoints', - value: function needsConvexHullPoints() { - return !this._convexHullPoints || this._convexHullDirty || this._convexHullPoints.length === 0; - } - - /** - * Set the convex hull to be dirty. - * Do this whenever the Drawable's shape has possibly changed. - */ - - }, { - key: 'setConvexHullDirty', - value: function setConvexHullDirty() { - this._convexHullDirty = true; - } - - /** - * Set the convex hull points for the Drawable. - * @param {Array>} points Convex hull points, as [[x, y], ...] - */ - - }, { - key: 'setConvexHullPoints', - value: function setConvexHullPoints(points) { - this._convexHullPoints = points; - this._convexHullDirty = false; - - // Re-create the "transformed hull points" array. - // We only do this when the hull points change to avoid unnecessary allocations and GC. - this._transformedHullPoints = []; - for (var i = 0; i < points.length; i++) { - this._transformedHullPoints.push(twgl.v3.create()); - } - this._transformedHullDirty = true; - } - - /** - * @function - * @name isTouching - * Check if the world position touches the skin. - * The caller is responsible for ensuring this drawable's inverse matrix & its skin's silhouette are up-to-date. - * @see updateCPURenderAttributes - * @param {twgl.v3} vec World coordinate vector. - * @return {boolean} True if the world position touches the skin. - */ - - // `updateCPURenderAttributes` sets this Drawable instance's `isTouching` method - // to one of the following three functions: - // If this drawable has no skin, set it to `_isTouchingNever`. - // Otherwise, if this drawable uses nearest-neighbor scaling at its current scale, set it to `_isTouchingNearest`. - // Otherwise, set it to `_isTouchingLinear`. - // This allows several checks to be moved from the `isTouching` function to `updateCPURenderAttributes`. - - // eslint-disable-next-line no-unused-vars - - }, { - key: '_isTouchingNever', - value: function _isTouchingNever(vec) { - return false; - } - }, { - key: '_isTouchingNearest', - value: function _isTouchingNearest(vec) { - return this.skin.isTouchingNearest(getLocalPosition(this, vec)); - } - }, { - key: '_isTouchingLinear', - value: function _isTouchingLinear(vec) { - return this.skin.isTouchingLinear(getLocalPosition(this, vec)); - } - - /** - * Get the precise bounds for a Drawable. - * This function applies the transform matrix to the known convex hull, - * and then finds the minimum box along the axes. - * Before calling this, ensure the renderer has updated convex hull points. - * @param {?Rectangle} result optional destination for bounds calculation - * @return {!Rectangle} Bounds for a tight box around the Drawable. - */ - - }, { - key: 'getBounds', - value: function getBounds(result) { - if (this.needsConvexHullPoints()) { - throw new Error('Needs updated convex hull points before bounds calculation.'); - } - if (this._transformDirty) { - this._calculateTransform(); - } - var transformedHullPoints = this._getTransformedHullPoints(); - // Search through transformed points to generate box on axes. - result = result || new Rectangle(); - result.initFromPointsAABB(transformedHullPoints); - return result; - } - - /** - * Get the precise bounds for the upper 8px slice of the Drawable. - * Used for calculating where to position a text bubble. - * Before calling this, ensure the renderer has updated convex hull points. - * @param {?Rectangle} result optional destination for bounds calculation - * @return {!Rectangle} Bounds for a tight box around a slice of the Drawable. - */ - - }, { - key: 'getBoundsForBubble', - value: function getBoundsForBubble(result) { - if (this.needsConvexHullPoints()) { - throw new Error('Needs updated convex hull points before bubble bounds calculation.'); - } - if (this._transformDirty) { - this._calculateTransform(); - } - var slice = 8; // px, how tall the top slice to measure should be. - var transformedHullPoints = this._getTransformedHullPoints(); - var maxY = Math.max.apply(null, transformedHullPoints.map(function (p) { - return p[1]; - })); - var filteredHullPoints = transformedHullPoints.filter(function (p) { - return p[1] > maxY - slice; - }); - // Search through filtered points to generate box on axes. - result = result || new Rectangle(); - result.initFromPointsAABB(filteredHullPoints); - return result; - } - - /** - * Get the rough axis-aligned bounding box for the Drawable. - * Calculated by transforming the skin's bounds. - * Note that this is less precise than the box returned by `getBounds`, - * which is tightly snapped to account for a Drawable's transparent regions. - * `getAABB` returns a much less accurate bounding box, but will be much - * faster to calculate so may be desired for quick checks/optimizations. - * @param {?Rectangle} result optional destination for bounds calculation - * @return {!Rectangle} Rough axis-aligned bounding box for Drawable. - */ - - }, { - key: 'getAABB', - value: function getAABB(result) { - if (this._transformDirty) { - this._calculateTransform(); - } - var tm = this._uniforms.u_modelMatrix; - result = result || new Rectangle(); - result.initFromModelMatrix(tm); - return result; - } - - /** - * Return the best Drawable bounds possible without performing graphics queries. - * I.e., returns the tight bounding box when the convex hull points are already - * known, but otherwise return the rough AABB of the Drawable. - * @param {?Rectangle} result optional destination for bounds calculation - * @return {!Rectangle} Bounds for the Drawable. - */ - - }, { - key: 'getFastBounds', - value: function getFastBounds(result) { - if (!this.needsConvexHullPoints()) { - return this.getBounds(result); - } - return this.getAABB(result); - } - - /** - * Transform all the convex hull points by the current Drawable's - * transform. This allows us to skip recalculating the convex hull - * for many Drawable updates, including translation, rotation, scaling. - * @return {!Array.} Array of glPoints which are Array - * @private - */ - - }, { - key: '_getTransformedHullPoints', - value: function _getTransformedHullPoints() { - if (!this._transformedHullDirty) { - return this._transformedHullPoints; - } - - var projection = twgl.m4.ortho(-1, 1, -1, 1, -1, 1); - var skinSize = this.skin.size; - var halfXPixel = 1 / skinSize[0] / 2; - var halfYPixel = 1 / skinSize[1] / 2; - var tm = twgl.m4.multiply(this._uniforms.u_modelMatrix, projection); - for (var i = 0; i < this._convexHullPoints.length; i++) { - var point = this._convexHullPoints[i]; - var dstPoint = this._transformedHullPoints[i]; - - dstPoint[0] = 0.5 + -point[0] / skinSize[0] - halfXPixel; - dstPoint[1] = point[1] / skinSize[1] - 0.5 + halfYPixel; - twgl.m4.transformPoint(tm, dstPoint, dstPoint); - } - - this._transformedHullDirty = false; - - return this._transformedHullPoints; - } - - /** - * Update the transform matrix and calculate it's inverse for collision - * and local texture position purposes. - */ - - }, { - key: 'updateMatrix', - value: function updateMatrix() { - if (this._transformDirty) { - this._calculateTransform(); - } - // Get the inverse of the model matrix or update it. - if (this._inverseTransformDirty) { - var inverse = this._inverseMatrix; - twgl.m4.copy(this._uniforms.u_modelMatrix, inverse); - // The normal matrix uses a z scaling of 0 causing model[10] to be - // 0. Getting a 4x4 inverse is impossible without a scaling in x, y, - // and z. - inverse[10] = 1; - twgl.m4.inverse(inverse, inverse); - this._inverseTransformDirty = false; - } - } - - /** - * Update everything necessary to render this drawable on the CPU. - */ - - }, { - key: 'updateCPURenderAttributes', - value: function updateCPURenderAttributes() { - this.updateMatrix(); - // CPU rendering always occurs at the "native" size, so no need to scale up this._scale - if (this.skin) { - this.skin.updateSilhouette(this._scale); - - if (this.skin.useNearest(this._scale, this)) { - this.isTouching = this._isTouchingNearest; - } else { - this.isTouching = this._isTouchingLinear; - } - } else { - log.warn('Could not find skin for drawable with id: ' + this._id); - - this.isTouching = this._isTouchingNever; - } - } - - /** - * Respond to an internal change in the current Skin. - */ - - }, { - key: '_skinWasAltered', - value: function _skinWasAltered() { - this._renderer.dirty = true; - this._rotationCenterDirty = true; - this._skinScaleDirty = true; - this.setConvexHullDirty(); - this.setTransformDirty(); - } - - /** - * Calculate a color to represent the given ID number. At least one component of - * the resulting color will be non-zero if the ID is not RenderConstants.ID_NONE. - * @param {int} id The ID to convert. - * @returns {Array} An array of [r,g,b,a], each component in the range [0,1]. - */ - - }, { - key: 'id', - get: function get() { - return this._id; - } - - /** - * @returns {Skin} the current skin for this Drawable. - */ - - }, { - key: 'skin', - get: function get() { - return this._skin; - } - - /** - * @param {Skin} newSkin - A new Skin for this Drawable. - */ - , - set: function set(newSkin) { - if (this._skin !== newSkin) { - this._skin = newSkin; - this._skinWasAltered(); - } - } - - /** - * @returns {Array} the current scaling percentages applied to this Drawable. [100,100] is normal size. - */ - - }, { - key: 'scale', - get: function get() { - return [this._scale[0], this._scale[1]]; - } - }], [{ - key: 'color4fFromID', - value: function color4fFromID(id) { - id -= RenderConstants.ID_NONE; - var r = (id >> 0 & 255) / 255.0; - var g = (id >> 8 & 255) / 255.0; - var b = (id >> 16 & 255) / 255.0; - return [r, g, b, 1.0]; - } - - /** - * Calculate the ID number represented by the given color. If all components of - * the color are zero, the result will be RenderConstants.ID_NONE; otherwise the result - * will be a valid ID. - * @param {int} r The red value of the color, in the range [0,255]. - * @param {int} g The green value of the color, in the range [0,255]. - * @param {int} b The blue value of the color, in the range [0,255]. - * @returns {int} The ID represented by that color. - */ - - }, { - key: 'color3bToID', - value: function color3bToID(r, g, b) { - var id = void 0; - id = (r & 255) << 0; - id |= (g & 255) << 8; - id |= (b & 255) << 16; - return id + RenderConstants.ID_NONE; - } - - /** - * Sample a color from a drawable's texture. - * The caller is responsible for ensuring this drawable's inverse matrix & its skin's silhouette are up-to-date. - * @see updateCPURenderAttributes - * @param {twgl.v3} vec The scratch space [x,y] vector - * @param {Drawable} drawable The drawable to sample the texture from - * @param {Uint8ClampedArray} dst The "color4b" representation of the texture at point. - * @param {number} [effectMask] A bitmask for which effects to use. Optional. - * @returns {Uint8ClampedArray} The dst object filled with the color4b - */ - - }, { - key: 'sampleColor4b', - value: function sampleColor4b(vec, drawable, dst, effectMask) { - var localPosition = getLocalPosition(drawable, vec); - if (localPosition[0] < 0 || localPosition[1] < 0 || localPosition[0] > 1 || localPosition[1] > 1) { - dst[0] = 0; - dst[1] = 0; - dst[2] = 0; - dst[3] = 0; - return dst; - } - - var textColor = - // commenting out to only use nearest for now - // drawable.skin.useNearest(drawable._scale, drawable) ? - drawable.skin._silhouette.colorAtNearest(localPosition, dst); - // : drawable.skin._silhouette.colorAtLinear(localPosition, dst); - - if (drawable.enabledEffects === 0) return textColor; - return EffectTransform.transformColor(drawable, textColor, effectMask); - } - }]); - - return Drawable; -}(); - -module.exports = Drawable; - -/***/ }), - -/***/ "./src/EffectTransform.js": -/*!********************************!*\ - !*** ./src/EffectTransform.js ***! - \********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/** - * @fileoverview - * A utility to transform a texture coordinate to another texture coordinate - * representing how the shaders apply effects. - */ - -var twgl = __webpack_require__(/*! twgl.js */ "./node_modules/twgl.js/dist/4.x/twgl-full.js"); - -var _require = __webpack_require__(/*! ./util/color-conversions */ "./src/util/color-conversions.js"), - rgbToHsv = _require.rgbToHsv, - hsvToRgb = _require.hsvToRgb; - -var ShaderManager = __webpack_require__(/*! ./ShaderManager */ "./src/ShaderManager.js"); - -/** - * A texture coordinate is between 0 and 1. 0.5 is the center position. - * @const {number} - */ -var CENTER_X = 0.5; - -/** - * A texture coordinate is between 0 and 1. 0.5 is the center position. - * @const {number} - */ -var CENTER_Y = 0.5; - -/** - * Reused memory location for storing an HSV color value. - * @type {Array} - */ -var __hsv = [0, 0, 0]; - -var EffectTransform = function () { - function EffectTransform() { - _classCallCheck(this, EffectTransform); - } - - _createClass(EffectTransform, null, [{ - key: 'transformColor', - - - /** - * Transform a color in-place given the drawable's effect uniforms. Will apply - * Ghost and Color and Brightness effects. - * @param {Drawable} drawable The drawable to get uniforms from. - * @param {Uint8ClampedArray} inOutColor The color to transform. - * @param {number} [effectMask] A bitmask for which effects to use. Optional. - * @returns {Uint8ClampedArray} dst filled with the transformed color - */ - value: function transformColor(drawable, inOutColor, effectMask) { - // If the color is fully transparent, don't bother attempting any transformations. - if (inOutColor[3] === 0) { - return inOutColor; - } - - var effects = drawable.enabledEffects; - if (typeof effectMask === 'number') effects &= effectMask; - var uniforms = drawable.getUniforms(); - - var enableColor = (effects & ShaderManager.EFFECT_INFO.color.mask) !== 0; - var enableBrightness = (effects & ShaderManager.EFFECT_INFO.brightness.mask) !== 0; - - if (enableColor || enableBrightness) { - // gl_FragColor.rgb /= gl_FragColor.a + epsilon; - // Here, we're dividing by the (previously pre-multiplied) alpha to ensure HSV is properly calculated - // for partially transparent pixels. - // epsilon is present in the shader because dividing by 0 (fully transparent pixels) messes up calculations. - // We're doing this with a Uint8ClampedArray here, so dividing by 0 just gives 255. We're later multiplying - // by 0 again, so it won't affect results. - var alpha = inOutColor[3] / 255; - inOutColor[0] /= alpha; - inOutColor[1] /= alpha; - inOutColor[2] /= alpha; - - if (enableColor) { - // vec3 hsv = convertRGB2HSV(gl_FragColor.xyz); - var hsv = rgbToHsv(inOutColor, __hsv); - - // this code forces grayscale values to be slightly saturated - // so that some slight change of hue will be visible - // const float minLightness = 0.11 / 2.0; - var minV = 0.11 / 2.0; - // const float minSaturation = 0.09; - var minS = 0.09; - // if (hsv.z < minLightness) hsv = vec3(0.0, 1.0, minLightness); - if (hsv[2] < minV) { - hsv[0] = 0; - hsv[1] = 1; - hsv[2] = minV; - // else if (hsv.y < minSaturation) hsv = vec3(0.0, minSaturation, hsv.z); - } else if (hsv[1] < minS) { - hsv[0] = 0; - hsv[1] = minS; - } - - // hsv.x = mod(hsv.x + u_color, 1.0); - // if (hsv.x < 0.0) hsv.x += 1.0; - hsv[0] = uniforms.u_color + hsv[0] + 1; - - // gl_FragColor.rgb = convertHSV2RGB(hsl); - hsvToRgb(hsv, inOutColor); - } - - if (enableBrightness) { - var brightness = uniforms.u_brightness * 255; - // gl_FragColor.rgb = clamp(gl_FragColor.rgb + vec3(u_brightness), vec3(0), vec3(1)); - // We don't need to clamp because the Uint8ClampedArray does that for us - inOutColor[0] += brightness; - inOutColor[1] += brightness; - inOutColor[2] += brightness; - } - - // gl_FragColor.rgb *= gl_FragColor.a + epsilon; - // Now we're doing the reverse, premultiplying by the alpha once again. - inOutColor[0] *= alpha; - inOutColor[1] *= alpha; - inOutColor[2] *= alpha; - } - - if ((effects & ShaderManager.EFFECT_INFO.ghost.mask) !== 0) { - // gl_FragColor *= u_ghost - inOutColor[0] *= uniforms.u_ghost; - inOutColor[1] *= uniforms.u_ghost; - inOutColor[2] *= uniforms.u_ghost; - inOutColor[3] *= uniforms.u_ghost; - } - - return inOutColor; - } - - /** - * Transform a texture coordinate to one that would be select after applying shader effects. - * @param {Drawable} drawable The drawable whose effects to emulate. - * @param {twgl.v3} vec The texture coordinate to transform. - * @param {twgl.v3} dst A place to store the output coordinate. - * @return {twgl.v3} dst - The coordinate after being transform by effects. - */ - - }, { - key: 'transformPoint', - value: function transformPoint(drawable, vec, dst) { - twgl.v3.copy(vec, dst); - - var effects = drawable.enabledEffects; - var uniforms = drawable.getUniforms(); - if ((effects & ShaderManager.EFFECT_INFO.mosaic.mask) !== 0) { - // texcoord0 = fract(u_mosaic * texcoord0); - dst[0] = uniforms.u_mosaic * dst[0] % 1; - dst[1] = uniforms.u_mosaic * dst[1] % 1; - } - if ((effects & ShaderManager.EFFECT_INFO.pixelate.mask) !== 0) { - var skinUniforms = drawable.skin.getUniforms(); - // vec2 pixelTexelSize = u_skinSize / u_pixelate; - var texelX = skinUniforms.u_skinSize[0] / uniforms.u_pixelate; - var texelY = skinUniforms.u_skinSize[1] / uniforms.u_pixelate; - // texcoord0 = (floor(texcoord0 * pixelTexelSize) + kCenter) / - // pixelTexelSize; - dst[0] = (Math.floor(dst[0] * texelX) + CENTER_X) / texelX; - dst[1] = (Math.floor(dst[1] * texelY) + CENTER_Y) / texelY; - } - if ((effects & ShaderManager.EFFECT_INFO.whirl.mask) !== 0) { - // const float kRadius = 0.5; - var RADIUS = 0.5; - // vec2 offset = texcoord0 - kCenter; - var offsetX = dst[0] - CENTER_X; - var offsetY = dst[1] - CENTER_Y; - // float offsetMagnitude = length(offset); - var offsetMagnitude = Math.sqrt(Math.pow(offsetX, 2) + Math.pow(offsetY, 2)); - // float whirlFactor = max(1.0 - (offsetMagnitude / kRadius), 0.0); - var whirlFactor = Math.max(1.0 - offsetMagnitude / RADIUS, 0.0); - // float whirlActual = u_whirl * whirlFactor * whirlFactor; - var whirlActual = uniforms.u_whirl * whirlFactor * whirlFactor; - // float sinWhirl = sin(whirlActual); - var sinWhirl = Math.sin(whirlActual); - // float cosWhirl = cos(whirlActual); - var cosWhirl = Math.cos(whirlActual); - // mat2 rotationMatrix = mat2( - // cosWhirl, -sinWhirl, - // sinWhirl, cosWhirl - // ); - var rot1 = cosWhirl; - var rot2 = -sinWhirl; - var rot3 = sinWhirl; - var rot4 = cosWhirl; - - // texcoord0 = rotationMatrix * offset + kCenter; - dst[0] = rot1 * offsetX + rot3 * offsetY + CENTER_X; - dst[1] = rot2 * offsetX + rot4 * offsetY + CENTER_Y; - } - if ((effects & ShaderManager.EFFECT_INFO.fisheye.mask) !== 0) { - // vec2 vec = (texcoord0 - kCenter) / kCenter; - var vX = (dst[0] - CENTER_X) / CENTER_X; - var vY = (dst[1] - CENTER_Y) / CENTER_Y; - // float vecLength = length(vec); - var vLength = Math.sqrt(vX * vX + vY * vY); - // float r = pow(min(vecLength, 1.0), u_fisheye) * max(1.0, vecLength); - var r = Math.pow(Math.min(vLength, 1), uniforms.u_fisheye) * Math.max(1, vLength); - // vec2 unit = vec / vecLength; - var unitX = vX / vLength; - var unitY = vY / vLength; - // texcoord0 = kCenter + r * unit * kCenter; - dst[0] = CENTER_X + r * unitX * CENTER_X; - dst[1] = CENTER_Y + r * unitY * CENTER_Y; - } - - return dst; - } - }]); - - return EffectTransform; -}(); - -module.exports = EffectTransform; - -/***/ }), - -/***/ "./src/PenSkin.js": -/*!************************!*\ - !*** ./src/PenSkin.js ***! - \************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var twgl = __webpack_require__(/*! twgl.js */ "./node_modules/twgl.js/dist/4.x/twgl-full.js"); - -var RenderConstants = __webpack_require__(/*! ./RenderConstants */ "./src/RenderConstants.js"); -var Skin = __webpack_require__(/*! ./Skin */ "./src/Skin.js"); - -var ShaderManager = __webpack_require__(/*! ./ShaderManager */ "./src/ShaderManager.js"); - -/** - * Attributes to use when drawing with the pen - * @typedef {object} PenSkin#PenAttributes - * @property {number} [diameter] - The size (diameter) of the pen. - * @property {Array} [color4f] - The pen color as an array of [r,g,b,a], each component in the range [0,1]. - */ - -/** - * The pen attributes to use when unspecified. - * @type {PenSkin#PenAttributes} - * @memberof PenSkin - * @private - * @const - */ -var DefaultPenAttributes = { - color4f: [0, 0, 1, 1], - diameter: 1 -}; - -/** - * Reused memory location for storing a premultiplied pen color. - * @type {FloatArray} - */ -var __premultipliedColor = [0, 0, 0, 0]; - -var PEN_BUFFER_SIZE_LARGER = 65520; -var PEN_BUFFER_SIZE_SMALLER = 32760; - -var PenSkin = function (_Skin) { - _inherits(PenSkin, _Skin); - - /** - * Create a Skin which implements a Scratch pen layer. - * @param {int} id - The unique ID for this Skin. - * @param {RenderWebGL} renderer - The renderer which will use this Skin. - * @extends Skin - * @listens RenderWebGL#event:NativeSizeChanged - */ - function PenSkin(id, renderer) { - _classCallCheck(this, PenSkin); - - /** @type {Array} */ - var _this = _possibleConstructorReturn(this, (PenSkin.__proto__ || Object.getPrototypeOf(PenSkin)).call(this, id, renderer)); - - _this._size = null; - - /** @type {WebGLFramebuffer} */ - _this._framebuffer = null; - - /** @type {boolean} */ - _this._silhouetteDirty = false; - - /** @type {Uint8Array} */ - _this._silhouettePixels = null; - - /** @type {ImageData} */ - _this._silhouetteImageData = null; - - /** @type {object} */ - _this._lineOnBufferDrawRegionId = { - enter: function enter() { - return _this._enterDrawLineOnBuffer(); - }, - exit: function exit() { - return _this._exitDrawLineOnBuffer(); - } - }; - - /** @type {object} */ - _this._usePenBufferDrawRegionId = { - enter: function enter() { - return _this._enterUsePenBuffer(); - }, - exit: function exit() { - return _this._exitUsePenBuffer(); - } - }; - - // tw: renderQuality attribute - _this.renderQuality = 1; - - // tw: keep track of native size - _this._nativeSize = renderer.getNativeSize(); - - // tw: create the extra data structures needed to buffer pen - _this._resetAttributeIndexes(); - _this.a_lineColor = new Float32Array(PEN_BUFFER_SIZE_LARGER); - _this.a_lineThicknessAndLength = new Float32Array(PEN_BUFFER_SIZE_SMALLER); - _this.a_penPoints = new Float32Array(PEN_BUFFER_SIZE_LARGER); - _this.a_position = new Float32Array(PEN_BUFFER_SIZE_SMALLER); - for (var i = 0; i < _this.a_position.length; i += 12) { - _this.a_position[i + 0] = 1; - _this.a_position[i + 1] = 0; - _this.a_position[i + 2] = 0; - _this.a_position[i + 3] = 0; - _this.a_position[i + 4] = 1; - _this.a_position[i + 5] = 1; - _this.a_position[i + 6] = 1; - _this.a_position[i + 7] = 1; - _this.a_position[i + 8] = 0; - _this.a_position[i + 9] = 0; - _this.a_position[i + 10] = 0; - _this.a_position[i + 11] = 1; - } - /** @type {twgl.BufferInfo} */ - _this._lineBufferInfo = twgl.createBufferInfoFromArrays(_this._renderer.gl, { - a_position: { - numComponents: 2, - data: _this.a_position - }, - a_lineColor: { - numComponents: 4, - drawType: _this._renderer.gl.STREAM_DRAW, - data: _this.a_lineColor - }, - a_lineThicknessAndLength: { - numComponents: 2, - drawType: _this._renderer.gl.STREAM_DRAW, - data: _this.a_lineThicknessAndLength - }, - a_penPoints: { - numComponents: 4, - drawType: _this._renderer.gl.STREAM_DRAW, - data: _this.a_penPoints - } - }); - - var NO_EFFECTS = 0; - /** @type {twgl.ProgramInfo} */ - _this._lineShader = _this._renderer._shaderManager.getShader(ShaderManager.DRAW_MODE.line, NO_EFFECTS); - - // tw: draw region used to preserve texture when resizing - _this._drawTextureShader = _this._renderer._shaderManager.getShader(ShaderManager.DRAW_MODE.default, NO_EFFECTS); - /** @type {object} */ - _this._drawTextureRegionId = { - enter: function enter() { - return _this._enterDrawTexture(); - }, - exit: function exit() { - return _this._exitDrawTexture(); - } - }; - - _this.onNativeSizeChanged = _this.onNativeSizeChanged.bind(_this); - _this._renderer.on(RenderConstants.Events.NativeSizeChanged, _this.onNativeSizeChanged); - - _this._setCanvasSize(renderer.getNativeSize()); - return _this; - } - - /** - * Dispose of this object. Do not use it after calling this method. - */ - - - _createClass(PenSkin, [{ - key: 'dispose', - value: function dispose() { - this._renderer.removeListener(RenderConstants.Events.NativeSizeChanged, this.onNativeSizeChanged); - this._renderer.gl.deleteTexture(this._texture); - this._texture = null; - _get(PenSkin.prototype.__proto__ || Object.getPrototypeOf(PenSkin.prototype), 'dispose', this).call(this); - } - - /** - * @return {Array} the "native" size, in texels, of this skin. [width, height] - */ - - }, { - key: 'useNearest', - value: function useNearest(scale) { - // Use nearest-neighbor interpolation when scaling up the pen skin-- this matches Scratch 2.0. - // When scaling it down, use linear interpolation to avoid giving pen lines a "dashed" appearance. - return Math.max(scale[0], scale[1]) >= 100; - } - - /** - * @param {Array} scale The X and Y scaling factors to be used, as percentages of this skin's "native" size. - * @return {WebGLTexture} The GL texture representation of this skin when drawing at the given size. - */ - // eslint-disable-next-line no-unused-vars - - }, { - key: 'getTexture', - value: function getTexture(scale) { - return this._texture; - } - - /** - * Clear the pen layer. - */ - - }, { - key: 'clear', - value: function clear() { - this._renderer.enterDrawRegion(this._usePenBufferDrawRegionId); - - /* Reset framebuffer to transparent black */ - var gl = this._renderer.gl; - gl.clearColor(0, 0, 0, 0); - gl.clear(gl.COLOR_BUFFER_BIT); - - this._silhouetteDirty = true; - } - - /** - * Draw a point on the pen layer. - * @param {PenAttributes} penAttributes - how the point should be drawn. - * @param {number} x - the X coordinate of the point to draw. - * @param {number} y - the Y coordinate of the point to draw. - */ - - }, { - key: 'drawPoint', - value: function drawPoint(penAttributes, x, y) { - this.drawLine(penAttributes, x, y, x, y); - } - - /** - * Draw a line on the pen layer. - * @param {PenAttributes} penAttributes - how the line should be drawn. - * @param {number} x0 - the X coordinate of the beginning of the line. - * @param {number} y0 - the Y coordinate of the beginning of the line. - * @param {number} x1 - the X coordinate of the end of the line. - * @param {number} y1 - the Y coordinate of the end of the line. - */ - - }, { - key: 'drawLine', - value: function drawLine(penAttributes, x0, y0, x1, y1) { - // For compatibility with Scratch 2.0, offset pen lines of width 1 and 3 so they're pixel-aligned. - // See https://github.com/LLK/scratch-render/pull/314 - var diameter = penAttributes.diameter || DefaultPenAttributes.diameter; - var offset = diameter === 1 || diameter === 3 ? 0.5 : 0; - - this._drawLineOnBuffer(penAttributes, x0 + offset, y0 + offset, x1 + offset, y1 + offset); - - this._silhouetteDirty = true; - } - - /** - * Prepare to draw lines in the _lineOnBufferDrawRegionId region. - */ - - }, { - key: '_enterDrawLineOnBuffer', - value: function _enterDrawLineOnBuffer() { - // tw: reset attributes when starting pen drawing - this._resetAttributeIndexes(); - var gl = this._renderer.gl; - - twgl.bindFramebufferInfo(gl, this._framebuffer); - - gl.viewport(0, 0, this._size[0], this._size[1]); - - var currentShader = this._lineShader; - gl.useProgram(currentShader.program); - twgl.setBuffersAndAttributes(gl, currentShader, this._lineBufferInfo); - - var uniforms = { - u_skin: this._texture, - u_stageSize: this._size - }; - - twgl.setUniforms(currentShader, uniforms); - } - - /** - * Return to a base state from _lineOnBufferDrawRegionId. - */ - - }, { - key: '_exitDrawLineOnBuffer', - value: function _exitDrawLineOnBuffer() { - // tw: flush when exiting pen rendering - if (this.a_lineColorIndex) { - this._flushLines(); - } - - var gl = this._renderer.gl; - - twgl.bindFramebufferInfo(gl, null); - } - - /** - * Prepare to do things with this PenSkin's framebuffer - */ - - }, { - key: '_enterUsePenBuffer', - value: function _enterUsePenBuffer() { - twgl.bindFramebufferInfo(this._renderer.gl, this._framebuffer); - } - - /** - * Return to a base state - */ - - }, { - key: '_exitUsePenBuffer', - value: function _exitUsePenBuffer() { - twgl.bindFramebufferInfo(this._renderer.gl, null); - } - - // tw: draw region used to preserve texture when resizing - - }, { - key: '_enterDrawTexture', - value: function _enterDrawTexture() { - this._enterUsePenBuffer(); - var gl = this._renderer.gl; - gl.viewport(0, 0, this._size[0], this._size[1]); - gl.useProgram(this._drawTextureShader.program); - twgl.setBuffersAndAttributes(gl, this._drawTextureShader, this._renderer._bufferInfo); - } - }, { - key: '_exitDrawTexture', - value: function _exitDrawTexture() { - this._exitUsePenBuffer(); - } - }, { - key: '_drawPenTexture', - value: function _drawPenTexture(texture) { - this._renderer.enterDrawRegion(this._drawTextureRegionId); - var gl = this._renderer.gl; - var width = this._size[0]; - var height = this._size[1]; - - var uniforms = { - u_skin: texture, - u_projectionMatrix: twgl.m4.ortho(width / 2, width / -2, height / -2, height / 2, -1, 1, twgl.m4.identity()), - u_modelMatrix: twgl.m4.scaling(twgl.v3.create(width, height, 0), twgl.m4.identity()) - }; - - twgl.setTextureParameters(gl, texture, { - // Always use NEAREST because this most closely matches Scratch behavior - minMag: gl.NEAREST - }); - twgl.setUniforms(this._drawTextureShader, uniforms); - twgl.drawBufferInfo(gl, this._renderer._bufferInfo, gl.TRIANGLES); - } - - /** - * Draw a line on the framebuffer. - * Note that the point coordinates are in the following coordinate space: - * +y is down, (0, 0) is the center, and the coords range from (-width / 2, -height / 2) to (height / 2, width / 2). - * @param {PenAttributes} penAttributes - how the line should be drawn. - * @param {number} x0 - the X coordinate of the beginning of the line. - * @param {number} y0 - the Y coordinate of the beginning of the line. - * @param {number} x1 - the X coordinate of the end of the line. - * @param {number} y1 - the Y coordinate of the end of the line. - */ - - }, { - key: '_drawLineOnBuffer', - value: function _drawLineOnBuffer(penAttributes, x0, y0, x1, y1) { - this._renderer.enterDrawRegion(this._lineOnBufferDrawRegionId); - - // tw: flush if this line would overflow buffers - // For some reason, looking up the size of a_lineColor with .length is very slow in some browsers. - // We see measurable performance improvements by comparing to a constant instead. - if (this.a_lineColorIndex + 24 > PEN_BUFFER_SIZE_LARGER) { - this._flushLines(); - } - - // Premultiply pen color by pen transparency - var penColor = penAttributes.color4f || DefaultPenAttributes.color4f; - __premultipliedColor[0] = penColor[0] * penColor[3]; - __premultipliedColor[1] = penColor[1] * penColor[3]; - __premultipliedColor[2] = penColor[2] * penColor[3]; - __premultipliedColor[3] = penColor[3]; - - // tw: apply renderQuality - x0 *= this.renderQuality; - y0 *= this.renderQuality; - x1 *= this.renderQuality; - y1 *= this.renderQuality; - - // Fun fact: Doing this calculation in the shader has the potential to overflow the floating-point range. - // 'mediump' precision is only required to have a range up to 2^14 (16384), so any lines longer than 2^7 (128) - // can overflow that, because you're squaring the operands, and they could end up as "infinity". - // Even GLSL's `length` function won't save us here: - // https://asawicki.info/news_1596_watch_out_for_reduced_precision_normalizelength_in_opengl_es - var lineDiffX = x1 - x0; - var lineDiffY = y1 - y0; - var lineLength = Math.sqrt(lineDiffX * lineDiffX + lineDiffY * lineDiffY); - - // tw: apply renderQuality - var lineThickness = (penAttributes.diameter || DefaultPenAttributes.diameter) * this.renderQuality; - // tw: write pen draws to buffers where they will be flushed later - for (var i = 0; i < 6; i++) { - this.a_lineColor[this.a_lineColorIndex] = __premultipliedColor[0]; - this.a_lineColorIndex++; - this.a_lineColor[this.a_lineColorIndex] = __premultipliedColor[1]; - this.a_lineColorIndex++; - this.a_lineColor[this.a_lineColorIndex] = __premultipliedColor[2]; - this.a_lineColorIndex++; - this.a_lineColor[this.a_lineColorIndex] = __premultipliedColor[3]; - this.a_lineColorIndex++; - - this.a_lineThicknessAndLength[this.a_lineThicknessAndLengthIndex] = lineThickness; - this.a_lineThicknessAndLengthIndex++; - - this.a_lineThicknessAndLength[this.a_lineThicknessAndLengthIndex] = lineLength; - this.a_lineThicknessAndLengthIndex++; - - this.a_penPoints[this.a_penPointsIndex] = x0; - this.a_penPointsIndex++; - this.a_penPoints[this.a_penPointsIndex] = -y0; - this.a_penPointsIndex++; - this.a_penPoints[this.a_penPointsIndex] = lineDiffX; - this.a_penPointsIndex++; - this.a_penPoints[this.a_penPointsIndex] = -lineDiffY; - this.a_penPointsIndex++; - } - } - - // tw: resets indexes in the pen drawing buffers - - }, { - key: '_resetAttributeIndexes', - value: function _resetAttributeIndexes() { - this.a_lineColorIndex = 0; - this.a_lineThicknessAndLengthIndex = 0; - this.a_penPointsIndex = 0; - } - - // tw: flushes buffered pen lines to the GPU - - }, { - key: '_flushLines', - value: function _flushLines() { - var gl = this._renderer.gl; - - var currentShader = this._lineShader; - - // If only a small amount of data needs to be uploaded, only upload part of the data. - // todo: need to see if this helps and fine tune this number - if (this.a_lineColorIndex < 1000) { - twgl.setAttribInfoBufferFromArray(gl, this._lineBufferInfo.attribs.a_lineColor, new Float32Array(this.a_lineColor.buffer, 0, this.a_lineColorIndex), 0); - twgl.setAttribInfoBufferFromArray(gl, this._lineBufferInfo.attribs.a_penPoints, new Float32Array(this.a_penPoints.buffer, 0, this.a_penPointsIndex), 0); - twgl.setAttribInfoBufferFromArray(gl, this._lineBufferInfo.attribs.a_lineThicknessAndLength, new Float32Array(this.a_lineThicknessAndLength.buffer, 0, this.a_lineThicknessAndLengthIndex), 0); - } else { - twgl.setAttribInfoBufferFromArray(gl, this._lineBufferInfo.attribs.a_lineColor, this.a_lineColor); - twgl.setAttribInfoBufferFromArray(gl, this._lineBufferInfo.attribs.a_penPoints, this.a_penPoints); - twgl.setAttribInfoBufferFromArray(gl, this._lineBufferInfo.attribs.a_lineThicknessAndLength, this.a_lineThicknessAndLength); - } - // todo: if we skip twgl and do all this buffer stuff ourselves, we can skip some unneeded gl calls - twgl.setBuffersAndAttributes(gl, currentShader, this._lineBufferInfo); - - twgl.drawBufferInfo(gl, this._lineBufferInfo, gl.TRIANGLES, this.a_lineThicknessAndLengthIndex / 2); - - this._resetAttributeIndexes(); - - this._silhouetteDirty = true; - } - - /** - * React to a change in the renderer's native size. - * @param {object} event - The change event. - */ - - }, { - key: 'onNativeSizeChanged', - value: function onNativeSizeChanged(event) { - // tw: keep track of native size - this._nativeSize = event.newSize; - this._setCanvasSize([event.newSize[0] * this.renderQuality, event.newSize[1] * this.renderQuality]); - this.emitWasAltered(); - } - - /** - * Set the size of the pen canvas. - * @param {Array} canvasSize - the new width and height for the canvas. - * @private - */ - - }, { - key: '_setCanvasSize', - value: function _setCanvasSize(canvasSize) { - var _canvasSize = _slicedToArray(canvasSize, 2), - width = _canvasSize[0], - height = _canvasSize[1]; - - // tw: do not resize if new size === old size - - - if (this._size && this._size[0] === width && this._size[1] === height) { - return; - } - - this._size = canvasSize; - // tw: use native size for Drawable positioning logic - this._rotationCenter[0] = this._nativeSize[0] / 2; - this._rotationCenter[1] = this._nativeSize[1] / 2; - - var gl = this._renderer.gl; - - // tw: store current texture to redraw it later - var oldTexture = this._texture; - - this._texture = twgl.createTexture(gl, { - mag: gl.NEAREST, - min: gl.NEAREST, - wrap: gl.CLAMP_TO_EDGE, - width: width, - height: height - }); - - var attachments = [{ - format: gl.RGBA, - attachment: this._texture - }]; - - if (this._framebuffer) { - // tw: resize framebuffer info doesn't work here, so always make a new framebuffer - // twgl.resizeFramebufferInfo(gl, this._framebuffer, attachments, width, height); - this._framebuffer = twgl.createFramebufferInfo(gl, attachments, width, height); - } else { - this._framebuffer = twgl.createFramebufferInfo(gl, attachments, width, height); - } - - gl.clearColor(0, 0, 0, 0); - gl.clear(gl.COLOR_BUFFER_BIT); - - // tw: preserve old texture when resizing - if (oldTexture) { - this._drawPenTexture(oldTexture); - } - - this._silhouettePixels = new Uint8Array(Math.floor(width * height * 4)); - this._silhouetteImageData = new ImageData(width, height); - - this._silhouetteDirty = true; - } - - // tw: sets the "quality" of the pen skin - - }, { - key: 'setRenderQuality', - value: function setRenderQuality(quality) { - if (this.renderQuality === quality) { - return; - } - this.renderQuality = quality; - this._setCanvasSize([Math.round(this._nativeSize[0] * quality), Math.round(this._nativeSize[1] * quality)]); - } - - /** - * If there have been pen operations that have dirtied the canvas, update - * now before someone wants to use our silhouette. - */ - - }, { - key: 'updateSilhouette', - value: function updateSilhouette() { - if (this._silhouetteDirty) { - this._renderer.enterDrawRegion(this._usePenBufferDrawRegionId); - // Sample the framebuffer's pixels into the silhouette instance - var gl = this._renderer.gl; - gl.readPixels(0, 0, this._size[0], this._size[1], gl.RGBA, gl.UNSIGNED_BYTE, this._silhouettePixels); - - this._silhouetteImageData.data.set(this._silhouettePixels); - this._silhouette.update(this._silhouetteImageData, true /* isPremultiplied */); - - this._silhouetteDirty = false; - } - } - }, { - key: 'size', - get: function get() { - // tw: use native size for Drawable positioning logic - return this._nativeSize; - } - }]); - - return PenSkin; -}(Skin); - -module.exports = PenSkin; - -/***/ }), - -/***/ "./src/Rectangle.js": -/*!**************************!*\ - !*** ./src/Rectangle.js ***! - \**************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var Rectangle = function () { - /** - * A utility for creating and comparing axis-aligned rectangles. - * Rectangles are always initialized to the "largest possible rectangle"; - * use one of the init* methods below to set up a particular rectangle. - * @constructor - */ - function Rectangle() { - _classCallCheck(this, Rectangle); - - this.left = -Infinity; - this.right = Infinity; - this.bottom = -Infinity; - this.top = Infinity; - } - - /** - * Initialize a Rectangle from given Scratch-coordinate bounds. - * @param {number} left Left bound of the rectangle. - * @param {number} right Right bound of the rectangle. - * @param {number} bottom Bottom bound of the rectangle. - * @param {number} top Top bound of the rectangle. - */ - - - _createClass(Rectangle, [{ - key: "initFromBounds", - value: function initFromBounds(left, right, bottom, top) { - this.left = left; - this.right = right; - this.bottom = bottom; - this.top = top; - } - - /** - * Initialize a Rectangle to the minimum AABB around a set of points. - * @param {Array>} points Array of [x, y] points. - */ - - }, { - key: "initFromPointsAABB", - value: function initFromPointsAABB(points) { - this.left = Infinity; - this.right = -Infinity; - this.top = -Infinity; - this.bottom = Infinity; - - for (var i = 0; i < points.length; i++) { - var x = points[i][0]; - var y = points[i][1]; - if (x < this.left) { - this.left = x; - } - if (x > this.right) { - this.right = x; - } - if (y > this.top) { - this.top = y; - } - if (y < this.bottom) { - this.bottom = y; - } - } - } - - /** - * Initialize a Rectangle to a 1 unit square centered at 0 x 0 transformed - * by a model matrix. - * @param {Array.} m A 4x4 matrix to transform the rectangle by. - * @tutorial Rectangle-AABB-Matrix - */ - - }, { - key: "initFromModelMatrix", - value: function initFromModelMatrix(m) { - // In 2D space, we will soon use the 2x2 "top left" scale and rotation - // submatrix, while we store and the 1x2 "top right" that position - // vector. - var m30 = m[3 * 4 + 0]; - var m31 = m[3 * 4 + 1]; - - // "Transform" a (0.5, 0.5) vector by the scale and rotation matrix but - // sum the absolute of each component instead of use the signed values. - var x = Math.abs(0.5 * m[0 * 4 + 0]) + Math.abs(0.5 * m[1 * 4 + 0]); - var y = Math.abs(0.5 * m[0 * 4 + 1]) + Math.abs(0.5 * m[1 * 4 + 1]); - - // And adding them to the position components initializes our Rectangle. - this.left = -x + m30; - this.right = x + m30; - this.top = y + m31; - this.bottom = -y + m31; - } - - /** - * Determine if this Rectangle intersects some other. - * Note that this is a comparison assuming the Rectangle was - * initialized with Scratch-space bounds or points. - * @param {!Rectangle} other Rectangle to check if intersecting. - * @return {boolean} True if this Rectangle intersects other. - */ - - }, { - key: "intersects", - value: function intersects(other) { - return this.left <= other.right && other.left <= this.right && this.top >= other.bottom && other.top >= this.bottom; - } - - /** - * Determine if this Rectangle fully contains some other. - * Note that this is a comparison assuming the Rectangle was - * initialized with Scratch-space bounds or points. - * @param {!Rectangle} other Rectangle to check if fully contained. - * @return {boolean} True if this Rectangle fully contains other. - */ - - }, { - key: "contains", - value: function contains(other) { - return other.left > this.left && other.right < this.right && other.top < this.top && other.bottom > this.bottom; - } - - /** - * Clamp a Rectangle to bounds. - * @param {number} left Left clamp. - * @param {number} right Right clamp. - * @param {number} bottom Bottom clamp. - * @param {number} top Top clamp. - */ - - }, { - key: "clamp", - value: function clamp(left, right, bottom, top) { - this.left = Math.max(this.left, left); - this.right = Math.min(this.right, right); - this.bottom = Math.max(this.bottom, bottom); - this.top = Math.min(this.top, top); - - this.left = Math.min(this.left, right); - this.right = Math.max(this.right, left); - this.bottom = Math.min(this.bottom, top); - this.top = Math.max(this.top, bottom); - } - - /** - * Push out the Rectangle to integer bounds. - */ - - }, { - key: "snapToInt", - value: function snapToInt() { - this.left = Math.floor(this.left); - this.right = Math.ceil(this.right); - this.bottom = Math.floor(this.bottom); - this.top = Math.ceil(this.top); - } - - /** - * Compute the intersection of two bounding Rectangles. - * Could be an impossible box if they don't intersect. - * @param {Rectangle} a One rectangle - * @param {Rectangle} b Other rectangle - * @param {?Rectangle} result A resulting storage rectangle (safe to pass - * a or b if you want to overwrite one) - * @returns {Rectangle} resulting rectangle - */ - - }, { - key: "width", - - - /** - * Width of the Rectangle. - * @return {number} Width of rectangle. - */ - get: function get() { - return Math.abs(this.left - this.right); - } - - /** - * Height of the Rectangle. - * @return {number} Height of rectangle. - */ - - }, { - key: "height", - get: function get() { - return Math.abs(this.top - this.bottom); - } - }], [{ - key: "intersect", - value: function intersect(a, b) { - var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Rectangle(); - - result.left = Math.max(a.left, b.left); - result.right = Math.min(a.right, b.right); - result.top = Math.min(a.top, b.top); - result.bottom = Math.max(a.bottom, b.bottom); - - return result; - } - - /** - * Compute the union of two bounding Rectangles. - * @param {Rectangle} a One rectangle - * @param {Rectangle} b Other rectangle - * @param {?Rectangle} result A resulting storage rectangle (safe to pass - * a or b if you want to overwrite one) - * @returns {Rectangle} resulting rectangle - */ - - }, { - key: "union", - value: function union(a, b) { - var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Rectangle(); - - result.left = Math.min(a.left, b.left); - result.right = Math.max(a.right, b.right); - // Scratch Space - +y is up - result.top = Math.max(a.top, b.top); - result.bottom = Math.min(a.bottom, b.bottom); - return result; - } - }]); - - return Rectangle; -}(); - -module.exports = Rectangle; - -/***/ }), - -/***/ "./src/RenderConstants.js": -/*!********************************!*\ - !*** ./src/RenderConstants.js ***! - \********************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** @module RenderConstants */ - -/** - * Various constants meant for use throughout the renderer. - * @enum - */ -module.exports = { - /** - * The ID value to use for "no item" or when an object has been disposed. - * @const {int} - */ - ID_NONE: -1, - - /** - * @enum {string} - */ - Events: { - /** - * Event emitted when the high quality render option changes. - */ - UseHighQualityRenderChanged: 'UseHighQualityRenderChanged', - - /** - * Event emitted when the private skin access option changes. - */ - AllowPrivateSkinAccessChanged: 'AllowPrivateSkinAccessChanged', - - /** - * NativeSizeChanged event - * - * @event RenderWebGL#event:NativeSizeChanged - * @type {object} - * @property {Array} newSize - the new size of the renderer - */ - NativeSizeChanged: 'NativeSizeChanged' - } -}; - -/***/ }), - -/***/ "./src/RenderWebGL.js": -/*!****************************!*\ - !*** ./src/RenderWebGL.js ***! - \****************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var EventEmitter = __webpack_require__(/*! events */ "./node_modules/events/events.js"); - -var hull = __webpack_require__(/*! hull.js */ "./node_modules/hull.js/src/hull.js"); -var twgl = __webpack_require__(/*! twgl.js */ "./node_modules/twgl.js/dist/4.x/twgl-full.js"); - -var Skin = __webpack_require__(/*! ./Skin */ "./src/Skin.js"); -var BitmapSkin = __webpack_require__(/*! ./BitmapSkin */ "./src/BitmapSkin.js"); -var Drawable = __webpack_require__(/*! ./Drawable */ "./src/Drawable.js"); -var Rectangle = __webpack_require__(/*! ./Rectangle */ "./src/Rectangle.js"); -var PenSkin = __webpack_require__(/*! ./PenSkin */ "./src/PenSkin.js"); -var RenderConstants = __webpack_require__(/*! ./RenderConstants */ "./src/RenderConstants.js"); -var ShaderManager = __webpack_require__(/*! ./ShaderManager */ "./src/ShaderManager.js"); -var SVGSkin = __webpack_require__(/*! ./SVGSkin */ "./src/SVGSkin.js"); -var TextBubbleSkin = __webpack_require__(/*! ./TextBubbleSkin */ "./src/TextBubbleSkin.js"); -var EffectTransform = __webpack_require__(/*! ./EffectTransform */ "./src/EffectTransform.js"); -var CanvasMeasurementProvider = __webpack_require__(/*! ./util/canvas-measurement-provider */ "./src/util/canvas-measurement-provider.js"); -var log = __webpack_require__(/*! ./util/log */ "./src/util/log.js"); - -var __isTouchingDrawablesPoint = twgl.v3.create(); -var __candidatesBounds = new Rectangle(); -var __fenceBounds = new Rectangle(); -var __touchingColor = new Uint8ClampedArray(4); -var __blendColor = new Uint8ClampedArray(4); - -// More pixels than this and we give up to the GPU and take the cost of readPixels -// Width * Height * Number of drawables at location -var __cpuTouchingColorPixelCount = 4e4; - -/** - * @callback RenderWebGL#idFilterFunc - * @param {int} drawableID The ID to filter. - * @return {bool} True if the ID passes the filter, otherwise false. - */ - -/** - * Maximum touch size for a picking check. - * @todo Figure out a reasonable max size. Maybe this should be configurable? - * @type {Array} - * @memberof RenderWebGL - */ -var MAX_TOUCH_SIZE = [3, 3]; - -/** - * Passed to the uniforms for mask in touching color - */ -var MASK_TOUCHING_COLOR_TOLERANCE = 2; - -/** - * Maximum number of pixels in either dimension of "extracted drawable" data - * @type {int} - */ -var MAX_EXTRACTED_DRAWABLE_DIMENSION = 2048; - -/** - * Determines if the mask color is "close enough" (only test the 6 top bits for - * each color). These bit masks are what scratch 2 used to use, so we do the same. - * @param {Uint8Array} a A color3b or color4b value. - * @param {Uint8Array} b A color3b or color4b value. - * @returns {boolean} If the colors match within the parameters. - */ -var maskMatches = function maskMatches(a, b) { - return ( - // has some non-alpha component to test against - a[3] > 0 && (a[0] & 252) === (b[0] & 252) && (a[1] & 252) === (b[1] & 252) && (a[2] & 252) === (b[2] & 252) - ); -}; - -/** - * Determines if the given color is "close enough" (only test the 5 top bits for - * red and green, 4 bits for blue). These bit masks are what scratch 2 used to use, - * so we do the same. - * @param {Uint8Array} a A color3b or color4b value. - * @param {Uint8Array} b A color3b or color4b value / or a larger array when used with offsets - * @param {number} offset An offset into the `b` array, which lets you use a larger array to test - * multiple values at the same time. - * @returns {boolean} If the colors match within the parameters. - */ -var colorMatches = function colorMatches(a, b, offset) { - return (a[0] & 248) === (b[offset + 0] & 248) && (a[1] & 248) === (b[offset + 1] & 248) && (a[2] & 240) === (b[offset + 2] & 240); -}; - -/** - * Sprite Fencing - The number of pixels a sprite is required to leave remaining - * onscreen around the edge of the staging area. - * @type {number} - */ -var FENCE_WIDTH = 15; - -// Loading text wrapper takes a while because of some of its dependencies, so only do so when needed. -var _TextWrapper = void 0; -var lazilyLoadTextWrapper = function lazilyLoadTextWrapper() { - if (!_TextWrapper) { - // eslint-disable-next-line global-require - _TextWrapper = __webpack_require__(/*! ./util/text-wrapper */ "./src/util/text-wrapper.js"); - } - return _TextWrapper; -}; - -var _stylesheet = void 0; -var loadStyles = function loadStyles() { - if (!_stylesheet) { - _stylesheet = document.createElement('style'); - // eslint-disable-next-line global-require - _stylesheet.textContent = __webpack_require__(/*! raw-loader!./renderer.css */ "./node_modules/raw-loader/index.js!./src/renderer.css"); - _stylesheet.className = 'scratch-render-styles'; - document.head.appendChild(_stylesheet); - } -}; - -var RenderWebGL = function (_EventEmitter) { - _inherits(RenderWebGL, _EventEmitter); - - _createClass(RenderWebGL, null, [{ - key: 'isSupported', - - /** - * Check if this environment appears to support this renderer before attempting to create an instance. - * Catching an exception from the constructor is also a valid way to test for (lack of) support. - * @param {canvas} [optCanvas] - An optional canvas to use for the test. Otherwise a temporary canvas will be used. - * @returns {boolean} - True if this environment appears to support this renderer, false otherwise. - */ - value: function isSupported(optCanvas) { - try { - optCanvas = optCanvas || document.createElement('canvas'); - var options = { alpha: false, stencil: true, antialias: false }; - return !!(optCanvas.getContext('webgl', options) || optCanvas.getContext('experimental-webgl', options) || optCanvas.getContext('webgl2', options)); - } catch (e) { - return false; - } - } - - /** - * Ask TWGL to create a rendering context with the attributes used by this renderer. - * @param {canvas} canvas - attach the context to this canvas. - * @returns {WebGLRenderingContext} - a TWGL rendering context (backed by either WebGL 1.0 or 2.0). - * @private - */ - - }, { - key: '_getContext', - value: function _getContext(canvas) { - var contextAttribs = { - alpha: false, - stencil: true, - antialias: false, - powerPreference: RenderWebGL.powerPreference - }; - // getWebGLContext = try WebGL 1.0 only - // getContext = try WebGL 2.0 and if that doesn't work, try WebGL 1.0 - // getWebGLContext || getContext = try WebGL 1.0 and if that doesn't work, try WebGL 2.0 - return twgl.getWebGLContext(canvas, contextAttribs) || twgl.getContext(canvas, contextAttribs); - } - - /** - * Create a renderer for drawing Scratch sprites to a canvas using WebGL. - * Coordinates will default to Scratch 2.0 values if unspecified. - * The stage's "native" size will be calculated from the these coordinates. - * For example, the defaults result in a native size of 480x360. - * Queries such as "touching color?" will always execute at the native size. - * @see RenderWebGL#setStageSize - * @see RenderWebGL#resize - * @param {canvas} canvas The canvas to draw onto. - * @param {int} [xLeft=-240] The x-coordinate of the left edge. - * @param {int} [xRight=240] The x-coordinate of the right edge. - * @param {int} [yBottom=-180] The y-coordinate of the bottom edge. - * @param {int} [yTop=180] The y-coordinate of the top edge. - * @constructor - * @listens RenderWebGL#event:NativeSizeChanged - */ - - }]); - - function RenderWebGL(canvas, xLeft, xRight, yBottom, yTop) { - _classCallCheck(this, RenderWebGL); - - /** @type {WebGLRenderingContext} */ - var _this = _possibleConstructorReturn(this, (RenderWebGL.__proto__ || Object.getPrototypeOf(RenderWebGL)).call(this)); - - var gl = _this._gl = RenderWebGL._getContext(canvas); - if (!gl) { - throw new Error('Could not get WebGL context: this browser or environment may not support WebGL.'); - } - - /** @type {RenderWebGL.UseGpuModes} */ - _this._useGpuMode = RenderWebGL.UseGpuModes.Automatic; - - /** @type {Drawable[]} */ - _this._allDrawables = []; - - /** @type {Skin[]} */ - _this._allSkins = []; - - /** @type {Array} */ - _this._drawList = []; - - // A list of layer group names in the order they should appear - // from furthest back to furthest in front. - /** @type {Array} */ - _this._groupOrdering = []; - - /** - * @typedef LayerGroup - * @property {int} groupIndex The relative position of this layer group in the group ordering - * @property {int} drawListOffset The absolute position of this layer group in the draw list - * This number gets updated as drawables get added to or deleted from the draw list. - */ - - // Map of group name to layer group - /** @type {Object.} */ - _this._layerGroups = {}; - - /** @type {int} */ - _this._nextDrawableId = RenderConstants.ID_NONE + 1; - - /** @type {int} */ - _this._nextSkinId = RenderConstants.ID_NONE + 1; - - /** @type {module:twgl/m4.Mat4} */ - _this._projection = twgl.m4.identity(); - - /** @type {ShaderManager} */ - _this._shaderManager = new ShaderManager(gl); - - /** @type {any} */ - _this._regionId = null; - - /** @type {function} */ - _this._exitRegion = null; - - /** @type {object} */ - _this._backgroundDrawRegionId = { - enter: function enter() { - return _this._enterDrawBackground(); - }, - exit: function exit() { - return _this._exitDrawBackground(); - } - }; - - /** @type {Array.} */ - _this._snapshotCallbacks = []; - - /** @type {Array} */ - // Don't set this directly-- use setBackgroundColor so it stays in sync with _backgroundColor3b - _this._backgroundColor4f = [0, 0, 0, 1]; - - /** @type {Uint8ClampedArray} */ - // Don't set this directly-- use setBackgroundColor so it stays in sync with _backgroundColor4f - _this._backgroundColor3b = new Uint8ClampedArray(3); - - // tw: track id of pen skin - _this._penSkinId = null; - - _this.useHighQualityRender = false; - - _this.offscreenTouching = false; - - _this.dirty = true; - - /** - * Element that contains all overlays. - * @type {HTMLElement} - */ - _this.overlayContainer = document.createElement('div'); - _this.overlayContainer.className = 'scratch-render-overlays'; - - /** - * @type {Array<{container: HTMLElement; userElement: HTMLElement; mode: string;}>} - */ - _this._overlays = []; - - loadStyles(); - - _this._createGeometry(); - - _this.on(RenderConstants.Events.NativeSizeChanged, _this.onNativeSizeChanged); - - _this.setBackgroundColor(1, 1, 1); - _this.setStageSize(xLeft || -240, xRight || 240, yBottom || -180, yTop || 180); - _this.resize(_this._nativeSize[0], _this._nativeSize[1]); - - gl.disable(gl.DEPTH_TEST); - /** @todo disable when no partial transparency? */ - gl.enable(gl.BLEND); - gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); - - /** - * Whether projects should be able to access the contents of private skins such as webcams. - * If set to false, routines such as isTouchingColor will ignore private skins. - * Private skins will still be rendered on the canvas regardless of this setting. - * This is set to true by default for compatibility with vanilla Scratch. - * @type {boolean} - */ - _this.allowPrivateSkinAccess = true; - - /** - * Suggested maximum texture size in texels. This is not a hard limit. - * Defualt value is same as Scratch's SVGSkin max. - * @type {number} - */ - _this.maxTextureDimension = 2048; - - /** - * Custom fonts, used by SVGs. Maps font families to their @font-face statement. - * Do not modify directly -- use {@link setCustomFonts}. - * @type {Record} - */ - _this.customFonts = {}; - - /** - * \ No newline at end of file +} + diff --git a/playground/components/ProjectFileInput.vue b/playground/components/ProjectFileInput.vue index 71249983..8338fb64 100644 --- a/playground/components/ProjectFileInput.vue +++ b/playground/components/ProjectFileInput.vue @@ -1,48 +1,54 @@ \ No newline at end of file + console.log(res, json, zip); + fileStore.json = json; + fileStore.title = file.name.replace(/\..+?$/, ""); + fileStore.zip = zip; + router.push({ name: "projectFilePlayer" }); +} + diff --git a/playground/components/ProjectIdPlayer.vue b/playground/components/ProjectIdPlayer.vue index 7913fa93..66ba4504 100644 --- a/playground/components/ProjectIdPlayer.vue +++ b/playground/components/ProjectIdPlayer.vue @@ -1,48 +1,61 @@ \ No newline at end of file +details { + margin-top: 1rem; + font-size: 12px; +} + diff --git a/playground/components/ProjectInput.vue b/playground/components/ProjectInput.vue index f1842141..4d5d9d2e 100644 --- a/playground/components/ProjectInput.vue +++ b/playground/components/ProjectInput.vue @@ -1,61 +1,81 @@ diff --git a/playground/components/ProjectPlayer.vue b/playground/components/ProjectPlayer.vue index dbbb9ecf..36a31cd3 100644 --- a/playground/components/ProjectPlayer.vue +++ b/playground/components/ProjectPlayer.vue @@ -1,60 +1,86 @@ @@ -182,10 +216,10 @@ div.instructions { overflow: auto; min-width: 0; - &>h2 { + & > h2 { font-weight: bold; } white-space: pre-wrap; } - \ No newline at end of file + diff --git a/playground/index.html b/playground/index.html index 16712dc4..4a1f08b9 100644 --- a/playground/index.html +++ b/playground/index.html @@ -1,15 +1,24 @@ - + - - - - - + + + + + HyperQuark diff --git a/playground/lib/imports.js b/playground/lib/imports.js index d7e41d8b..f5902a6f 100644 --- a/playground/lib/imports.js +++ b/playground/lib/imports.js @@ -1 +1 @@ -export { imports } from '../../js/imports.ts'; \ No newline at end of file +export { imports } from "../../js/imports.ts"; diff --git a/playground/lib/project-loader.js b/playground/lib/project-loader.js index 2cbfd711..544f60a1 100644 --- a/playground/lib/project-loader.js +++ b/playground/lib/project-loader.js @@ -1,13 +1,13 @@ -import { Buffer } from 'node:buffer'; -import validate from 'scratch-parser'; -import { SB1File, ValidationError } from 'scratch-sb1-converter'; +import { Buffer } from "node:buffer"; +import validate from "scratch-parser"; +import { SB1File, ValidationError } from "scratch-sb1-converter"; // adapted from https://github.com/scratchfoundation/scratch-vm/blob/6cfea59e7aaff880a1c4e709b2adc14d0113ecab/src/virtual-machine.js#L320 /** * @param {ArrayBuffer|String} input */ export const unpackProject = (input) => { - if (typeof input !== 'string') { + if (typeof input !== "string") { input = Buffer.from(input); } return new Promise((resolve, reject) => { @@ -17,24 +17,43 @@ export const unpackProject = (input) => { if (error) return reject(error); resolve(res); }); - }).catch(error => { - try { - const sb1 = new SB1File(input); - const json = sb1.json; - json.projectVersion = 2; - return Promise.resolve([json, sb1.zip]); - } catch (sb1Error) { - if (sb1Error instanceof ValidationError) { + }) + .catch((error) => { + try { + const sb1 = new SB1File(input); + const json = sb1.json; + json.projectVersion = 2; + return Promise.resolve([json, sb1.zip]); + } catch (sb1Error) { + if (sb1Error instanceof ValidationError) { // The input does not validate as a Scratch 1 file. - } else { + } else { // The project appears to be a Scratch 1 file but it // could not be successfully translated into a Scratch 2 // project. return Promise.reject(sb1Error); + } } - } - // Throw original error since the input does not appear to be - // an SB1File. - return Promise.reject(error); - }); -}; \ No newline at end of file + // Throw original error since the input does not appear to be + // an SB1File. + return Promise.reject(error); + }) + .then(async ([json, zip]) => { + if (json.projectVersion === 3) { + return [json, zip]; + } + if (json.projectVersion === 2) { + const { default: ScratchVM } = await import("@scratch/scratch-vm"); + // const scratchVm = + // typeof window === "object" + // ? await import("@scratch/scratch-vm/dist/web/scratch-vm.js") + // : await import("@scratch/scratch-vm/dist/node/scratch-vm.js"); + const VM = new ScratchVM(); + await VM.deserializeProject(json, zip); + VM.runtime.handleProjectLoaded(); + const sb3Json = JSON.parse(VM.toJSON()); + return [sb3Json, zip]; + } + throw "Unable to verify Scratch Project version"; + }); +}; diff --git a/playground/lib/project-runner.js b/playground/lib/project-runner.js index 15a2624b..9fc6f994 100644 --- a/playground/lib/project-runner.js +++ b/playground/lib/project-runner.js @@ -7,7 +7,8 @@ import { renderer as get_renderer, } from "../../js/shared.ts"; // This does not work in vite dev mode! Only works in build mode. -const scratch_render = await import("../assets/renderer.js"); +const scratch_render = + await import("scratch-render/dist/web/scratch-render.js"); const RenderWebGL = scratch_render.default; const debugModeStore = useDebugModeStore(); @@ -36,11 +37,11 @@ function setup(canvas, project_json, assets, target_names) { createSkin(renderer, type, layer, ...params); const costumes = project_json.targets.map((target, index) => - target.costumes.map(({ md5ext }) => assets[md5ext]) + target.costumes.map(({ md5ext }) => assets[md5ext]), ); const costumeNameMap = project_json.targets.map((target) => - Object.fromEntries(target.costumes.map(({ name }, index) => [name, index])) + Object.fromEntries(target.costumes.map(({ name }, index) => [name, index])), ); // @ts-ignore @@ -60,7 +61,7 @@ function setup(canvas, project_json, assets, target_names) { costume.dataFormat, "sprite", costume.data, - [realCostume.rotationCenterX, realCostume.rotationCenterY] + [realCostume.rotationCenterX, realCostume.rotationCenterY], ); const drawable = renderer.getDrawable(drawableId); @@ -91,11 +92,11 @@ export default async ( } = { framerate: 30, turbo: false, - } + }, ) => { if (debugModeStore.debug) window.open( - URL.createObjectURL(new Blob([wasm_bytes], { type: "application/wasm" })) + URL.createObjectURL(new Blob([wasm_bytes], { type: "application/wasm" })), ); const framerate_wait = Math.round(1000 / framerate); console.log("framerate_wait: %i", framerate_wait); @@ -203,7 +204,7 @@ export default async ( } catch (error) { console.info( "synthetic error to expose wasm module to devtools:", - error + error, ); } flag_clicked(); @@ -211,7 +212,7 @@ export default async ( console.log("green_flag()"); let thisTickStartTime; $outertickloop: while (true) { - console.log('fps: %i', 1000 / (Date.now() - thisTickStartTime)); + console.log("fps: %i", 1000 / (Date.now() - thisTickStartTime)); thisTickStartTime = Date.now(); renderer.draw(); // @ts-ignore @@ -233,10 +234,10 @@ export default async ( if (framerate_wait > 0) { console.log( "sleeping for %i ms", - framerate_wait - (Date.now() - thisTickStartTime) + framerate_wait - (Date.now() - thisTickStartTime), ); await sleep( - Math.max(0, framerate_wait - (Date.now() - thisTickStartTime)) + Math.max(0, framerate_wait - (Date.now() - thisTickStartTime)), ); } else { console.log("waiting animation frame"); diff --git a/playground/lib/settings.js b/playground/lib/settings.js index fd15fb65..6c722db9 100644 --- a/playground/lib/settings.js +++ b/playground/lib/settings.js @@ -1,91 +1,107 @@ -import * as hyperquarkExports from '../../js/no-compiler/hyperquark.js'; -import { WasmFlags, WasmFeature, all_wasm_features, wasm_feature_detect_name } from '../../js/no-compiler/hyperquark.js'; -import * as WasmFeatureDetect from 'wasm-feature-detect'; +import * as hyperquarkExports from "../../js/no-compiler/hyperquark.js"; +import { + WasmFlags, + WasmFeature, + all_wasm_features, + wasm_feature_detect_name, +} from "../../js/no-compiler/hyperquark.js"; +import * as WasmFeatureDetect from "wasm-feature-detect"; export { WasmFlags }; -console.log(WasmFeature) -window.hyperquarkExports = hyperquarkExports; +console.log(WasmFeature); +if (typeof window !== "undefined") window.hyperquarkExports = hyperquarkExports; export const supportedWasmFeatures = await getSupportedWasmFeatures(); -export const defaultSettings = new WasmFlags(Array.from(supportedWasmFeatures, (feat) => WasmFeature[feat])); +export const defaultSettings = new WasmFlags( + Array.from(supportedWasmFeatures, (feat) => WasmFeature[feat]), +); const defaultSettingsObj = defaultSettings.to_js(); -window.defaultSettings = defaultSettings; +if (typeof window !== "undefined") window.defaultSettings = defaultSettings; function settingsInfoFromType(type) { - if (type === "boolean") { - return { - type: "checkbox" - } - } else if (type in hyperquarkExports) { - return { - type: "radio", - options: Object.keys(hyperquarkExports[type]).filter(key => typeof key === 'string' && !/\d+/.test(key)), - enum_obj: hyperquarkExports[type], - } - } else { - return null; - } + if (type === "boolean") { + return { + type: "checkbox", + }; + } else if (type in hyperquarkExports) { + return { + type: "radio", + options: Object.keys(hyperquarkExports[type]).filter( + (key) => typeof key === "string" && !/\d+/.test(key), + ), + enum_obj: hyperquarkExports[type], + }; + } else { + return null; + } } -export const settingsInfo = Object.fromEntries(Object.entries(Object.getOwnPropertyDescriptors(WasmFlags.prototype)) - .filter(([_, descriptor]) => typeof descriptor.get === 'function') +export const settingsInfo = Object.fromEntries( + Object.entries(Object.getOwnPropertyDescriptors(WasmFlags.prototype)) + .filter(([_, descriptor]) => typeof descriptor.get === "function") .map(([key, _]) => key) - .map(key => { - let flag_info = WasmFlags.flag_info(key); - return [key, { - flag_info, - ...settingsInfoFromType(flag_info.ty) - }] - })); + .map((key) => { + let flag_info = WasmFlags.flag_info(key); + return [ + key, + { + flag_info, + ...settingsInfoFromType(flag_info.ty), + }, + ]; + }), +); /** * @returns {WasmFlags} */ export function getSettings() { - let store = localStorage["settings"]; - try { - return WasmFlags.from_js({ ...defaultSettingsObj, ...JSON.parse(store) }); - } catch { - return defaultSettings; - } + let store = localStorage["settings"]; + try { + return WasmFlags.from_js({ ...defaultSettingsObj, ...JSON.parse(store) }); + } catch { + return defaultSettings; + } } /** - * @param {WasmFlags} settings + * @param {WasmFlags} settings */ export function saveSettings(settings) { - console.log(settings.to_js()) - localStorage['settings'] = JSON.stringify(settings.to_js()); + console.log(settings.to_js()); + localStorage["settings"] = JSON.stringify(settings.to_js()); } /** * @returns {Set} */ export async function getSupportedWasmFeatures() { - const featureSet = new Set(); - for (const feature of all_wasm_features()) { - if (await WasmFeatureDetect[wasm_feature_detect_name(feature)]()) { - featureSet.add(WasmFeature[feature]); - } + const featureSet = new Set(); + for (const feature of all_wasm_features()) { + if (await WasmFeatureDetect[wasm_feature_detect_name(feature)]()) { + featureSet.add(WasmFeature[feature]); } - return featureSet; + } + return featureSet; } -console.log(await getSupportedWasmFeatures()) +console.log(await getSupportedWasmFeatures()); /** * @returns {Set} */ export function getUsedWasmFeatures() { - const settings = getSettings().to_js(); - console.log(settings) - const featureSet = new Set(); - for (const [id, info] of Object.entries(settingsInfo)) { - const theseFeatures = info.flag_info.wasm_features(settings[id])?.map?.((num) => WasmFeature[num]); - for (const feature of theseFeatures || []) { - featureSet.add(feature); - } + const settings = getSettings().to_js(); + console.log(settings); + const featureSet = new Set(); + for (const [id, info] of Object.entries(settingsInfo)) { + const theseFeatures = info.flag_info + .wasm_features(settings[id]) + ?.map?.((num) => WasmFeature[num]); + for (const feature of theseFeatures || []) { + featureSet.add(feature); } - return featureSet; -} \ No newline at end of file + } + return featureSet; +} diff --git a/playground/main.js b/playground/main.js index eb9a2fc6..907733ea 100644 --- a/playground/main.js +++ b/playground/main.js @@ -1,15 +1,14 @@ -import './assets/main.css' +import "./assets/main.css"; -import { createApp } from 'vue' -import { createPinia } from 'pinia' +import { createApp } from "vue"; +import { createPinia } from "pinia"; -import App from './App.vue' -import router from './router' +import App from "./App.vue"; +import router from "./router"; -const app = createApp(App) +const app = createApp(App); -app.use(createPinia()) -app.use(router) - -app.mount('#app') +app.use(createPinia()); +app.use(router); +app.mount("#app"); diff --git a/playground/router/index.js b/playground/router/index.js index 21c6f9bb..6f4dfb92 100644 --- a/playground/router/index.js +++ b/playground/router/index.js @@ -1,10 +1,13 @@ -import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'; -import { h, ref, onMounted } from 'vue'; -import Loading from '../components/Loading.vue'; +import { + createRouter, + createWebHistory, + createWebHashHistory, +} from "vue-router"; +import { h, ref, onMounted } from "vue"; +import Loading from "../components/Loading.vue"; let componentCache = Object.setPrototypeOf({}, null); - const view = (name) => ({ setup() { let component = componentCache[name]; @@ -16,54 +19,58 @@ const view = (name) => ({ componentCache[name] = component; }); } - return () => loading.value ? h(Loading) : h(component); - } + return () => (loading.value ? h(Loading) : h(component)); + }, }); const router = createRouter({ - history: (import.meta.env.VITE_HASH_HISTORY ? createWebHashHistory : createWebHistory)(import.meta.env.BASE_URL), + history: (import.meta.env.VITE_HASH_HISTORY + ? createWebHashHistory + : createWebHistory)(import.meta.env.BASE_URL), routes: [ { - path: '/', - name: 'home', - component: view('HomeView'), + path: "/", + name: "home", + component: view("HomeView"), }, { - path: '/projects/:id(\\d+)', - name: 'projectIdPlayer', - component: view('ProjectIdView'), + path: "/projects/:id(\\d+)", + name: "projectIdPlayer", + component: view("ProjectIdView"), props: true, }, { - path: '/projects/file', - name: 'projectFilePlayer', - component: view('ProjectFileView'), + path: "/projects/file", + name: "projectFilePlayer", + component: view("ProjectFileView"), }, { - path: '/projects/test', - name: 'testProjectPlayer', - component: view('TestProject'), + path: "/projects/test", + name: "testProjectPlayer", + component: view("TestProject"), }, { - path: '/about', - name: 'about', - component: view('AboutView'), + path: "/about", + name: "about", + component: view("AboutView"), }, { - path: '/settings', - name: 'settings', - component: view('Settings'), + path: "/settings", + name: "settings", + component: view("Settings"), }, { - path: '/:_(.*)*', - name: '404', - component: view('404'), - } - ] + path: "/:_(.*)*", + name: "404", + component: view("404"), + }, + ], }); router.afterEach((to, from) => { - document.getElementById('canonical-rel').setAttribute('href', `https://hyperquark.edgecompute.app${to.path}`); -}) + document + .getElementById("canonical-rel") + .setAttribute("href", `https://hyperquark.edgecompute.app${to.path}`); +}); export default router; diff --git a/playground/stores/debug.js b/playground/stores/debug.js index a0e4076a..5a56a9bf 100644 --- a/playground/stores/debug.js +++ b/playground/stores/debug.js @@ -1,18 +1,21 @@ -import { ref } from 'vue' -import { defineStore } from 'pinia' +import { ref } from "vue"; +import { defineStore } from "pinia"; -export const useDebugModeStore = defineStore('debugMode', () => { - const debug = ref(typeof new URLSearchParams(window.location.search).get('debug') === 'string'); - const toggleDebug = () => { - debug.value = !debug.value; - if (!erudaEnabled && debug.value) { - eruda.init(); - } +export const useDebugModeStore = defineStore("debugMode", () => { + const debug = ref( + typeof new URLSearchParams(window.location.search).get("debug") === + "string", + ); + const toggleDebug = () => { + debug.value = !debug.value; + if (!erudaEnabled && debug.value) { + eruda.init(); } - let erudaEnabled = false; - if (debug.value) { - eruda.init(); - erudaEnabled = true; - } - return { debug, toggleDebug }; -}) + }; + let erudaEnabled = false; + if (debug.value) { + eruda.init(); + erudaEnabled = true; + } + return { debug, toggleDebug }; +}); diff --git a/playground/stores/projectfile.js b/playground/stores/projectfile.js index 8af82966..0e2e185e 100644 --- a/playground/stores/projectfile.js +++ b/playground/stores/projectfile.js @@ -1,11 +1,11 @@ -import { ref } from 'vue' -import { defineStore } from 'pinia' +import { ref } from "vue"; +import { defineStore } from "pinia"; -export const useProjectFileStore = defineStore('projectFile', () => { +export const useProjectFileStore = defineStore("projectFile", () => { const json = ref(null); const assets = ref([]); - const title = ref('untitled'); - const author = ref('unknown'); + const title = ref("untitled"); + const author = ref("unknown"); return { json, assets, title, author }; -}) +}); diff --git a/playground/views/404.vue b/playground/views/404.vue index 5df9b38c..89418d02 100644 --- a/playground/views/404.vue +++ b/playground/views/404.vue @@ -1,12 +1,11 @@ - + - \ No newline at end of file diff --git a/playground/views/AboutView.vue b/playground/views/AboutView.vue index f3aa8a61..e966df0c 100644 --- a/playground/views/AboutView.vue +++ b/playground/views/AboutView.vue @@ -5,12 +5,14 @@

- HyperQuark compiles Scratch projects to WebAssembly in an attempt to make - them faster. - It was created by pufferfish101007 and was written in Rust mainly, with the exception of this website which uses Vue. - The source code is available on Github. + HyperQuark compiles Scratch projects to + WebAssembly in an attempt to make + them faster. It was created by + pufferfish101007 and + was written in Rust mainly, with the + exception of this website which uses + Vue. The source code is available + on Github.

diff --git a/playground/views/HomeView.vue b/playground/views/HomeView.vue index 6792f7b6..b3ef21c1 100644 --- a/playground/views/HomeView.vue +++ b/playground/views/HomeView.vue @@ -1,5 +1,5 @@ @@ -87,35 +95,35 @@ ul { } li.block-category-looks { - color: #9966FF; + color: #9966ff; } li.block-category-operator { - color: #59C059; + color: #59c059; } li.block-category-motion { - color: #4C97FF; + color: #4c97ff; } li.block-category-control { - color: #FFAB19; + color: #ffab19; } li.block-category-pen { - color: #0fBD8C; + color: #0fbd8c; } li.block-category-data { - color: #FF8C1A; + color: #ff8c1a; } li.block-category-sensing { - color: #5CB1D6; + color: #5cb1d6; } li.block-category-procedures, li.block-category-argument { - color: #FF6680; + color: #ff6680; } - \ No newline at end of file + diff --git a/playground/views/ProjectFileView.vue b/playground/views/ProjectFileView.vue index e2466938..61c20fa5 100644 --- a/playground/views/ProjectFileView.vue +++ b/playground/views/ProjectFileView.vue @@ -5,26 +5,32 @@ \ No newline at end of file +let err = (e) => (error.value = e); + diff --git a/playground/views/ProjectIdView.vue b/playground/views/ProjectIdView.vue index 50d2045f..4f990517 100644 --- a/playground/views/ProjectIdView.vue +++ b/playground/views/ProjectIdView.vue @@ -8,8 +8,8 @@ \ No newline at end of file +import ProjectIdPlayer from "../components/ProjectIdPlayer.vue"; +import Loading from "../components/Loading.vue"; + +const props = defineProps(["id"]); + diff --git a/playground/views/Settings.vue b/playground/views/Settings.vue index 9f6a0ee2..b5d66bbe 100644 --- a/playground/views/Settings.vue +++ b/playground/views/Settings.vue @@ -1,127 +1,151 @@ \ No newline at end of file + diff --git a/playground/views/TestProject.vue b/playground/views/TestProject.vue deleted file mode 100644 index 4ffe5fe6..00000000 --- a/playground/views/TestProject.vue +++ /dev/null @@ -1,14 +0,0 @@ - - - \ No newline at end of file diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 271800cb..a6c72348 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,3 @@ [toolchain] -channel = "nightly" \ No newline at end of file +channel = "nightly-2025-12-16" +targets = [ "wasm32-unknown-unknown" ] \ No newline at end of file diff --git a/src/ir/blocks.rs b/src/ir/blocks.rs index 4504d8e1..9a5b4371 100644 --- a/src/ir/blocks.rs +++ b/src/ir/blocks.rs @@ -249,16 +249,22 @@ pub fn inputs( .into_iter() .map(|name| -> HQResult> { let input = match block_info.inputs.get((*name).into()) { - Some(input) => input, - None => { - if name.starts_with("CONDITION") { - &Input::NoShadow( - 0, - Some(BlockArrayOrId::Array(BlockArray::NumberOrAngle(6, 0.0))), - ) - } else { - hq_bad_proj!("missing input {}", name) - } + Some(noshadow @ Input::NoShadow(_, Some(_))) => noshadow, + Some(shadow @ Input::Shadow(_, Some(_), _)) => shadow, + None | Some(Input::NoShadow(_, None) | Input::Shadow(_, None, _)) => { + // revert to a sensible default + &Input::NoShadow( + 0, + Some(BlockArrayOrId::Array(BlockArray::NumberOrAngle(6, 0.0))), + ) + // if name.starts_with("CONDITION") { + // &Input::NoShadow( + // 0, + // Some(BlockArrayOrId::Array(BlockArray::NumberOrAngle(6, 0.0))), + // ) + // } else { + // hq_bad_proj!("missing input {}", name) + // } } }; #[expect( @@ -297,22 +303,14 @@ pub enum ProcArgType { StringNumber, } -impl ProcArgType { - fn default_block(self) -> Vec { - vec![match self { - Self::Boolean => IrOpcode::hq_integer(HqIntegerFields(0)), - Self::StringNumber => IrOpcode::hq_text(HqTextFields("".into())), - }] - } -} - fn procedure_argument( - arg_type: ProcArgType, + _arg_type: ProcArgType, block_info: &BlockInfo, context: &StepContext, ) -> HQResult> { let Some(proc_context) = context.proc_context.clone() else { - return Ok(arg_type.default_block()); + // this is always the default, regardless of type + return Ok(vec![IrOpcode::hq_integer(HqIntegerFields(0))]); }; let sb3::VarVal::String(arg_name) = block_info .fields @@ -328,7 +326,7 @@ fn procedure_argument( .iter() .position(|name| name == arg_name) else { - return Ok(arg_type.default_block()); + return Ok(vec![IrOpcode::hq_integer(HqIntegerFields(0))]); }; let arg_vars_cell = proc_context.arg_vars(); let arg_vars = arg_vars_cell.try_borrow()?; @@ -1397,6 +1395,8 @@ fn from_special_block( IrOpcode::hq_float(HqFloatFields(*value)) } } + // string + 10 => IrOpcode::hq_text(HqTextFields(value.to_string().into_boxed_str())), _ => hq_bad_proj!("bad project json (block array of type ({}, f64))", ty), }, // a string input should really be a colour or a string, but often numbers diff --git a/src/ir/project.rs b/src/ir/project.rs index bb28ceed..19c8c901 100644 --- a/src/ir/project.rs +++ b/src/ir/project.rs @@ -3,7 +3,7 @@ use super::variable::{TargetVars, variables_from_target}; use super::{Step, Target, Thread}; use crate::instructions::{DataSetvariabletoFields, DataVariableFields, IrOpcode}; use crate::ir::target::IrCostume; -use crate::ir::{PartialStep, RcVar, Type as IrType, used_vars}; +use crate::ir::{PartialStep, RcVar, Type as IrType}; use crate::prelude::*; use crate::sb3::Sb3Project; use crate::wasm::WasmFlags; @@ -120,7 +120,7 @@ impl IrProject { .iter() .cloned() .unzip(); - crate::log("all threads + targets created"); + // crate::log("all threads + targets created"); let threads = threads_vec.into_iter().flatten().collect::>(); *project .threads @@ -131,8 +131,7 @@ impl IrProject { .try_borrow_mut() .map_err(|_| make_hq_bug!("couldn't mutably borrow cell"))? = targets.into_iter().collect(); - let global_vars = used_vars(project.global_variables()); - crate::log!("global_vars: {global_vars:?}"); + // crate::log!("global_vars: {global_vars:?}"); for target in project.targets().try_borrow()?.values() { fixup_proc_types(target)?; } diff --git a/src/optimisation/ssa.rs b/src/optimisation/ssa.rs index 6dc44297..376163b2 100644 --- a/src/optimisation/ssa.rs +++ b/src/optimisation/ssa.rs @@ -104,7 +104,7 @@ use core::convert::identity; use core::hash::{Hash, Hasher}; use core::marker::PhantomData; use core::mem; -use petgraph::dot::Dot; +// use petgraph::dot::Dot; use petgraph::graph::{EdgeIndex, NodeIndex}; use petgraph::visit::EdgeRef; @@ -955,11 +955,11 @@ fn visit_node( changed_vars: &mut BTreeSet, stop_at: NodeIndex, ) -> HQResult<()> { - crate::log!("node index: {node:?}"); + // crate::log!("node index: {node:?}"); if let Some(Some((vars, type_stack))) = graph.graph().try_borrow()?.node_weight(node) { - crate::log!("vars: {vars:?}"); + // crate::log!("vars: {vars:?}"); let reduced_stack = evaluate_type_stack(type_stack)?; - crate::log!("stack: {type_stack:?}\nreduced stack: {reduced_stack:?}"); + // crate::log!("stack: {type_stack:?}\nreduced stack: {reduced_stack:?}"); hq_assert_eq!( vars.len(), reduced_stack.len(), @@ -1005,16 +1005,16 @@ where loop { let mut changed_vars: BTreeSet = BTreeSet::new(); for graph in graphs.clone() { - crate::log!( - "{:?}exit node: {:?}", - Dot::with_config( - &*graph.graph().borrow(), - &[ - //DotConfig::NodeIndexLabel - ] - ), - *graph.exit_node().borrow() - ); + // crate::log!( + // "{:?}exit node: {:?}", + // Dot::with_config( + // &*graph.graph().borrow(), + // &[ + // //DotConfig::NodeIndexLabel + // ] + // ), + // *graph.exit_node().borrow() + // ); hq_assert!( { let inner_graph = graph.graph().try_borrow()?; @@ -1062,7 +1062,7 @@ pub fn optimise_variables(project: &Rc) -> HQResult { // crate::log!("graphs num: {}", graphs.len()); iterate_graphs(&graphs.values().copied())?; for step in maybe_graphs.keys() { - crate::log!("inserting casts for step {}", step.id()); + // crate::log!("inserting casts for step {}", step.id()); insert_casts(&mut *step.opcodes_mut()?)?; } Ok(SSAToken(PhantomData)) diff --git a/src/sb3.rs b/src/sb3.rs index 8bbc7392..5ccfad84 100644 --- a/src/sb3.rs +++ b/src/sb3.rs @@ -348,6 +348,7 @@ pub struct Sound { pub data_format: Box, // TODO: enumerate pub rate: f64, pub sample_count: f64, + pub format: Option>, // this seems to be present sometimes, as an empty string } /// The (default) value of a variable @@ -384,7 +385,9 @@ pub struct Target { pub current_costume: u32, pub costumes: Vec, pub sounds: Vec, + #[serde(default)] pub layer_order: i32, + #[serde(default)] pub volume: f64, #[serde(default)] pub tempo: f64, @@ -432,8 +435,8 @@ pub enum Monitor { opcode: Box, params: BTreeMap, Box>, sprite_name: Option>, - width: f64, - height: f64, + width: Option, + height: Option, x: f64, y: f64, visible: bool, @@ -448,8 +451,8 @@ pub enum Monitor { params: BTreeMap, Box>, sprite_name: Option>, value: VarVal, - width: f64, - height: f64, + width: Option, + height: Option, x: f64, y: f64, visible: bool, @@ -490,9 +493,10 @@ impl TryFrom<&str> for Sb3Project { err.column() ), Category::Data => hq_bad_proj!( - "Invalid project.json at project.json:{}:{}", + "Invalid project.json at project.json:{}:{}. Actual errror: {}", err.line(), - err.column() + err.column(), + err ), Category::Eof => hq_bad_proj!( "Unexpected end of file at project.json:{}:{}", @@ -504,113 +508,3 @@ impl TryFrom<&str> for Sb3Project { } } } -/* -#[cfg(test)] -pub mod tests { - use super::*; - - pub fn test_project_id(id: &str) -> String { - use std::time::{SystemTime, UNIX_EPOCH}; - println!("https://api.scratch.mit.edu/projects/{:}/", id); - let token_val = serde_json::from_str::( - &reqwest::blocking::get(format!("https://api.scratch.mit.edu/projects/{:}/", id)) - .unwrap() - .text() - .unwrap(), - ) - .unwrap()["project_token"] - .clone(); - let token = token_val.as_str().unwrap(); - println!("{:}", token); - println!( - "https://projects.scratch.mit.edu/{:}/?token={:}&nocache={:}", - id, - token, - SystemTime::now() - .duration_since(UNIX_EPOCH) - .unwrap_or_default() - .as_millis() - ); - - //dbg!(&resp); - reqwest::blocking::get(format!( - "https://projects.scratch.mit.edu/{:}/?token={:}", - id, token - )) - .unwrap() - .text() - .unwrap() - //let j: Sb3Project = serde_json::from_str(&resp[..]).unwrap(); - //j - } - - #[test] - fn paper_minecraft() { - let resp = self::test_project_id("10128407"); - let j: Sb3Project = resp.try_into().unwrap(); - dbg!(j); - /*let k: Value = serde_json::from_str(&resp).unwrap(); - for (it, t) in j.targets.iter().enumerate() { - for (i, b) in &t.blocks { - if let Some(bi) = &b.block_info() { - if bi.opcode == super::BlockOpcode::other { - if let Value::Object(o) = &k { - if let Value::Array(a) = &o["targets"] { - if let Value::Object(o2) = &a[it] { - if let Value::Object(o3) = &o2["blocks"] { - if let Value::Object(o4) = &o3[i] { - println!("{}", o4["opcode"]); - } - } - } - } - } - } - } - } - }*/ - } - - #[test] - fn level_eaten() { - let resp = self::test_project_id("704676520"); - let j: Sb3Project = resp.try_into().unwrap(); - dbg!(j); - /*let k: Value = serde_json::from_str(&resp).unwrap(); - for (it, t) in j.targets.iter().enumerate() { - for (i, b) in &t.blocks { - if let Some(bi) = &b.block_info() { - if bi.opcode == super::BlockOpcode::other { - if let Value::Object(o) = &k { - if let Value::Array(a) = &o["targets"] { - if let Value::Object(o2) = &a[it] { - if let Value::Object(o3) = &o2["blocks"] { - if let Value::Object(o4) = &o3[i] { - println!("{}", o4["opcode"]); - } - } - } - } - } - } - } - } - }*/ - } - - #[test] - fn hq_test_project() { - let resp = self::test_project_id("771449498"); - dbg!(&resp); - let j: Sb3Project = resp.try_into().unwrap(); - dbg!(j); - } - - #[test] - fn default_project() { - let resp = self::test_project_id("510186917"); - let j: Sb3Project = resp.try_into().unwrap(); - dbg!(j); - } -} -*/ diff --git a/src/wasm/flags.rs b/src/wasm/flags.rs index 95f5e03c..2c179bc4 100644 --- a/src/wasm/flags.rs +++ b/src/wasm/flags.rs @@ -186,7 +186,7 @@ impl WasmFlags { #[wasm_bindgen(constructor)] #[must_use] pub fn new(wasm_features: Vec) -> Self { - crate::log(format!("{wasm_features:?}").as_str()); + // crate::log(format!("{wasm_features:?}").as_str()); Self { wasm_opt: WasmOpt::On, string_type: if wasm_features.contains(&WasmFeature::JSStringBuiltins) { diff --git a/src/wasm/project.rs b/src/wasm/project.rs index f4aa31a6..352535d5 100644 --- a/src/wasm/project.rs +++ b/src/wasm/project.rs @@ -182,11 +182,11 @@ impl WasmProject { .clone() .finish(&mut tables, &mut exports); - crate::log!( - "imported func count: {}, static func count: {}", - self.imported_func_count()?, - self.static_func_count()? - ); + // crate::log!( + // "imported func count: {}, static func count: {}", + // self.imported_func_count()?, + // self.static_func_count()? + // ); exports.export("memory", ExportKind::Memory, 0); exports.export( diff --git a/test/fixtures/execute/README.md b/test/fixtures/execute/README.md new file mode 100644 index 00000000..25391964 --- /dev/null +++ b/test/fixtures/execute/README.md @@ -0,0 +1,30 @@ + +Tests in this folder are run in hyperquark by test/integration/execute.js. The tests can SAY test messages that map to tap methods. Read integration/execute.js for more. + +A note about fair use from turbowarp/scratch-vm, from which this directory is derived: + +Tests whose names start with `tw-` are added by TurboWarp. Some of these tests are based on real projects from the scratch.mit.edu website, in which case their filename contains the original project ID and additional credits are within the project's scripts. We believe our use of these projects is fair use as the projects have been sufficiently modified and stripped down such that the project found here bears not even a slight resemblance to the original project. + + +## License + +This program is based on [turbowarp/scratch-vm](https://github.com/scratchfoundation/scratch-vm), which is under this license: + +This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + +This program is based on [scratchfoundation/scratch-vm](https://github.com/scratchfoundation/scratch-vm), which is under this license: + +``` +Copyright (c) 2016, Massachusetts Institute of Technology +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +``` diff --git a/test/fixtures/execute/broadcast-wait-arg-change.sb2 b/test/fixtures/execute/broadcast-wait-arg-change.sb2 new file mode 100644 index 00000000..73e8d8f9 Binary files /dev/null and b/test/fixtures/execute/broadcast-wait-arg-change.sb2 differ diff --git a/test/fixtures/execute/control-if-false-then-else.sb2 b/test/fixtures/execute/control-if-false-then-else.sb2 new file mode 100644 index 00000000..798d30b3 Binary files /dev/null and b/test/fixtures/execute/control-if-false-then-else.sb2 differ diff --git a/test/fixtures/execute/control-if-false-then.sb2 b/test/fixtures/execute/control-if-false-then.sb2 new file mode 100644 index 00000000..03aed37e Binary files /dev/null and b/test/fixtures/execute/control-if-false-then.sb2 differ diff --git a/test/fixtures/execute/control-if-true-then-else.sb2 b/test/fixtures/execute/control-if-true-then-else.sb2 new file mode 100644 index 00000000..b375985d Binary files /dev/null and b/test/fixtures/execute/control-if-true-then-else.sb2 differ diff --git a/test/fixtures/execute/control-if-true-then.sb2 b/test/fixtures/execute/control-if-true-then.sb2 new file mode 100644 index 00000000..ed80d824 Binary files /dev/null and b/test/fixtures/execute/control-if-true-then.sb2 differ diff --git a/test/fixtures/execute/control-stop-all-leaks.sb2 b/test/fixtures/execute/control-stop-all-leaks.sb2 new file mode 100644 index 00000000..fb0ea115 Binary files /dev/null and b/test/fixtures/execute/control-stop-all-leaks.sb2 differ diff --git a/test/fixtures/execute/data-operators-global.sb2 b/test/fixtures/execute/data-operators-global.sb2 new file mode 100644 index 00000000..037399bc Binary files /dev/null and b/test/fixtures/execute/data-operators-global.sb2 differ diff --git a/test/fixtures/execute/data-operators-local.sb2 b/test/fixtures/execute/data-operators-local.sb2 new file mode 100644 index 00000000..b1c4660e Binary files /dev/null and b/test/fixtures/execute/data-operators-local.sb2 differ diff --git a/test/fixtures/execute/data-reporter-contents-global.sb2 b/test/fixtures/execute/data-reporter-contents-global.sb2 new file mode 100644 index 00000000..e5b89e83 Binary files /dev/null and b/test/fixtures/execute/data-reporter-contents-global.sb2 differ diff --git a/test/fixtures/execute/data-reporter-contents-local.sb2 b/test/fixtures/execute/data-reporter-contents-local.sb2 new file mode 100644 index 00000000..8280dea0 Binary files /dev/null and b/test/fixtures/execute/data-reporter-contents-local.sb2 differ diff --git a/test/fixtures/execute/event-broadcast-and-wait-can-continue-same-tick.sb2 b/test/fixtures/execute/event-broadcast-and-wait-can-continue-same-tick.sb2 new file mode 100644 index 00000000..3e3e3c85 Binary files /dev/null and b/test/fixtures/execute/event-broadcast-and-wait-can-continue-same-tick.sb2 differ diff --git a/test/fixtures/execute/event-when-green-flag.sb2 b/test/fixtures/execute/event-when-green-flag.sb2 new file mode 100644 index 00000000..396c1708 Binary files /dev/null and b/test/fixtures/execute/event-when-green-flag.sb2 differ diff --git a/test/fixtures/execute/events-broadcast-and-wait-yields-a-tick.sb2 b/test/fixtures/execute/events-broadcast-and-wait-yields-a-tick.sb2 new file mode 100644 index 00000000..9decd2cc Binary files /dev/null and b/test/fixtures/execute/events-broadcast-and-wait-yields-a-tick.sb2 differ diff --git a/test/fixtures/execute/hat-thread-execution.sb2 b/test/fixtures/execute/hat-thread-execution.sb2 new file mode 100644 index 00000000..6338f33a Binary files /dev/null and b/test/fixtures/execute/hat-thread-execution.sb2 differ diff --git a/test/fixtures/execute/monitors-stage-name.sb2 b/test/fixtures/execute/monitors-stage-name.sb2 new file mode 100644 index 00000000..6c1af6c0 Binary files /dev/null and b/test/fixtures/execute/monitors-stage-name.sb2 differ diff --git a/test/fixtures/execute/operators-not-blank.sb2 b/test/fixtures/execute/operators-not-blank.sb2 new file mode 100644 index 00000000..ed80d824 Binary files /dev/null and b/test/fixtures/execute/operators-not-blank.sb2 differ diff --git a/test/fixtures/execute/order-changes-back-2-broadcast-wait.sb2 b/test/fixtures/execute/order-changes-back-2-broadcast-wait.sb2 new file mode 100644 index 00000000..29551965 Binary files /dev/null and b/test/fixtures/execute/order-changes-back-2-broadcast-wait.sb2 differ diff --git a/test/fixtures/execute/order-changes-backwards-2-broadcast-and-wait-repeat-message.sb2 b/test/fixtures/execute/order-changes-backwards-2-broadcast-and-wait-repeat-message.sb2 new file mode 100644 index 00000000..97d0673e Binary files /dev/null and b/test/fixtures/execute/order-changes-backwards-2-broadcast-and-wait-repeat-message.sb2 differ diff --git a/test/fixtures/execute/order-changes-backwards-2-broadcast-and-wait.sb2 b/test/fixtures/execute/order-changes-backwards-2-broadcast-and-wait.sb2 new file mode 100644 index 00000000..18e86331 Binary files /dev/null and b/test/fixtures/execute/order-changes-backwards-2-broadcast-and-wait.sb2 differ diff --git a/test/fixtures/execute/order-changes-backwards-2-broadcast-no-wait.sb2 b/test/fixtures/execute/order-changes-backwards-2-broadcast-no-wait.sb2 new file mode 100644 index 00000000..07d3c466 Binary files /dev/null and b/test/fixtures/execute/order-changes-backwards-2-broadcast-no-wait.sb2 differ diff --git a/test/fixtures/execute/order-changes-backwards-2-broadcast-wait.sb2 b/test/fixtures/execute/order-changes-backwards-2-broadcast-wait.sb2 new file mode 100644 index 00000000..aa51b024 Binary files /dev/null and b/test/fixtures/execute/order-changes-backwards-2-broadcast-wait.sb2 differ diff --git a/test/fixtures/execute/order-changes-backwards-2-continuous.sb2 b/test/fixtures/execute/order-changes-backwards-2-continuous.sb2 new file mode 100644 index 00000000..7b55e54f Binary files /dev/null and b/test/fixtures/execute/order-changes-backwards-2-continuous.sb2 differ diff --git a/test/fixtures/execute/order-changes-backwards-2-threads-broadcast-wait.sb2 b/test/fixtures/execute/order-changes-backwards-2-threads-broadcast-wait.sb2 new file mode 100644 index 00000000..0eefe5a6 Binary files /dev/null and b/test/fixtures/execute/order-changes-backwards-2-threads-broadcast-wait.sb2 differ diff --git a/test/fixtures/execute/order-changes-forewards-2-broadcast-wait.sb2 b/test/fixtures/execute/order-changes-forewards-2-broadcast-wait.sb2 new file mode 100644 index 00000000..fcdcdcea Binary files /dev/null and b/test/fixtures/execute/order-changes-forewards-2-broadcast-wait.sb2 differ diff --git a/test/fixtures/execute/order-changes-front-2-broadcast-wait.sb2 b/test/fixtures/execute/order-changes-front-2-broadcast-wait.sb2 new file mode 100644 index 00000000..2471815b Binary files /dev/null and b/test/fixtures/execute/order-changes-front-2-broadcast-wait.sb2 differ diff --git a/test/fixtures/execute/order-clones-backwards-2-broadcast-wait.sb2 b/test/fixtures/execute/order-clones-backwards-2-broadcast-wait.sb2 new file mode 100644 index 00000000..5fe5c44c Binary files /dev/null and b/test/fixtures/execute/order-clones-backwards-2-broadcast-wait.sb2 differ diff --git a/test/fixtures/execute/order-clones-backwards-broadcast-wait.sb2 b/test/fixtures/execute/order-clones-backwards-broadcast-wait.sb2 new file mode 100644 index 00000000..fcd84e0d Binary files /dev/null and b/test/fixtures/execute/order-clones-backwards-broadcast-wait.sb2 differ diff --git a/test/fixtures/execute/order-clones-static-2.sb2 b/test/fixtures/execute/order-clones-static-2.sb2 new file mode 100644 index 00000000..2c0d9f05 Binary files /dev/null and b/test/fixtures/execute/order-clones-static-2.sb2 differ diff --git a/test/fixtures/execute/order-immobile-stage.sb2 b/test/fixtures/execute/order-immobile-stage.sb2 new file mode 100644 index 00000000..caa67e10 Binary files /dev/null and b/test/fixtures/execute/order-immobile-stage.sb2 differ diff --git a/test/fixtures/execute/order-library-reverse.sb2 b/test/fixtures/execute/order-library-reverse.sb2 new file mode 100644 index 00000000..a48b8606 Binary files /dev/null and b/test/fixtures/execute/order-library-reverse.sb2 differ diff --git a/test/fixtures/execute/order-library-reverse.sb3 b/test/fixtures/execute/order-library-reverse.sb3 new file mode 100644 index 00000000..f818a47f Binary files /dev/null and b/test/fixtures/execute/order-library-reverse.sb3 differ diff --git a/test/fixtures/execute/order-library.sb2 b/test/fixtures/execute/order-library.sb2 new file mode 100644 index 00000000..b8d34080 Binary files /dev/null and b/test/fixtures/execute/order-library.sb2 differ diff --git a/test/fixtures/execute/order-library.sb3 b/test/fixtures/execute/order-library.sb3 new file mode 100644 index 00000000..f3c6dbc4 Binary files /dev/null and b/test/fixtures/execute/order-library.sb3 differ diff --git a/test/fixtures/execute/procedures-boolean-reporter-bug.sb2 b/test/fixtures/execute/procedures-boolean-reporter-bug.sb2 new file mode 100644 index 00000000..fd8ef4af Binary files /dev/null and b/test/fixtures/execute/procedures-boolean-reporter-bug.sb2 differ diff --git a/test/fixtures/execute/procedures-nested-missing-boolean-param.sb2 b/test/fixtures/execute/procedures-nested-missing-boolean-param.sb2 new file mode 100644 index 00000000..71019316 Binary files /dev/null and b/test/fixtures/execute/procedures-nested-missing-boolean-param.sb2 differ diff --git a/test/fixtures/execute/procedures-nested-missing-no-param.sb2 b/test/fixtures/execute/procedures-nested-missing-no-param.sb2 new file mode 100644 index 00000000..af6916e5 Binary files /dev/null and b/test/fixtures/execute/procedures-nested-missing-no-param.sb2 differ diff --git a/test/fixtures/execute/procedures-nested-missing-number-param.sb2 b/test/fixtures/execute/procedures-nested-missing-number-param.sb2 new file mode 100644 index 00000000..c306518f Binary files /dev/null and b/test/fixtures/execute/procedures-nested-missing-number-param.sb2 differ diff --git a/test/fixtures/execute/procedures-nested-missing-string-param.sb2 b/test/fixtures/execute/procedures-nested-missing-string-param.sb2 new file mode 100644 index 00000000..04363c5b Binary files /dev/null and b/test/fixtures/execute/procedures-nested-missing-string-param.sb2 differ diff --git a/test/fixtures/execute/procedures-number-number-boolean.sb2 b/test/fixtures/execute/procedures-number-number-boolean.sb2 new file mode 100644 index 00000000..18664d00 Binary files /dev/null and b/test/fixtures/execute/procedures-number-number-boolean.sb2 differ diff --git a/test/fixtures/execute/procedures-param-outside-boolean.sb2 b/test/fixtures/execute/procedures-param-outside-boolean.sb2 new file mode 100644 index 00000000..c96ce324 Binary files /dev/null and b/test/fixtures/execute/procedures-param-outside-boolean.sb2 differ diff --git a/test/fixtures/execute/procedures-param-outside-number.sb2 b/test/fixtures/execute/procedures-param-outside-number.sb2 new file mode 100644 index 00000000..ee2f9e21 Binary files /dev/null and b/test/fixtures/execute/procedures-param-outside-number.sb2 differ diff --git a/test/fixtures/execute/procedures-param-outside-string.sb2 b/test/fixtures/execute/procedures-param-outside-string.sb2 new file mode 100644 index 00000000..102c92e2 Binary files /dev/null and b/test/fixtures/execute/procedures-param-outside-string.sb2 differ diff --git a/test/fixtures/execute/procedures-recursive-default-boolean.sb2 b/test/fixtures/execute/procedures-recursive-default-boolean.sb2 new file mode 100644 index 00000000..b2873d2e Binary files /dev/null and b/test/fixtures/execute/procedures-recursive-default-boolean.sb2 differ diff --git a/test/fixtures/execute/procedures-recursive-default-number.sb2 b/test/fixtures/execute/procedures-recursive-default-number.sb2 new file mode 100644 index 00000000..cb726348 Binary files /dev/null and b/test/fixtures/execute/procedures-recursive-default-number.sb2 differ diff --git a/test/fixtures/execute/procedures-recursive-default-string.sb2 b/test/fixtures/execute/procedures-recursive-default-string.sb2 new file mode 100644 index 00000000..bc1b4a99 Binary files /dev/null and b/test/fixtures/execute/procedures-recursive-default-string.sb2 differ diff --git a/test/fixtures/execute/sensing-get-attribute-of-stage-alt-name.sb2 b/test/fixtures/execute/sensing-get-attribute-of-stage-alt-name.sb2 new file mode 100644 index 00000000..c4bddcbd Binary files /dev/null and b/test/fixtures/execute/sensing-get-attribute-of-stage-alt-name.sb2 differ diff --git a/test/fixtures/execute/sprite-number-name.sb2 b/test/fixtures/execute/sprite-number-name.sb2 new file mode 100644 index 00000000..ec72d2e0 Binary files /dev/null and b/test/fixtures/execute/sprite-number-name.sb2 differ diff --git a/test/fixtures/execute/tw-NaN.sb3 b/test/fixtures/execute/tw-NaN.sb3 new file mode 100644 index 00000000..411b0c66 Binary files /dev/null and b/test/fixtures/execute/tw-NaN.sb3 differ diff --git a/test/fixtures/execute/tw-add-can-return-nan.sb3 b/test/fixtures/execute/tw-add-can-return-nan.sb3 new file mode 100644 index 00000000..04b089e7 Binary files /dev/null and b/test/fixtures/execute/tw-add-can-return-nan.sb3 differ diff --git a/test/fixtures/execute/tw-all-at-once.sb3 b/test/fixtures/execute/tw-all-at-once.sb3 new file mode 100644 index 00000000..741e8605 Binary files /dev/null and b/test/fixtures/execute/tw-all-at-once.sb3 differ diff --git a/test/fixtures/execute/tw-analyze-yields-due-to-direct-recursion.sb3 b/test/fixtures/execute/tw-analyze-yields-due-to-direct-recursion.sb3 new file mode 100644 index 00000000..136864b4 Binary files /dev/null and b/test/fixtures/execute/tw-analyze-yields-due-to-direct-recursion.sb3 differ diff --git a/test/fixtures/execute/tw-automatic-variable-creation-literal-null-id.sb3 b/test/fixtures/execute/tw-automatic-variable-creation-literal-null-id.sb3 new file mode 100644 index 00000000..57a7c005 Binary files /dev/null and b/test/fixtures/execute/tw-automatic-variable-creation-literal-null-id.sb3 differ diff --git a/test/fixtures/execute/tw-block-with-null-for-variable-id.sb3 b/test/fixtures/execute/tw-block-with-null-for-variable-id.sb3 new file mode 100644 index 00000000..68b151ee Binary files /dev/null and b/test/fixtures/execute/tw-block-with-null-for-variable-id.sb3 differ diff --git a/test/fixtures/execute/tw-boolean-arguments-are-not-cast.sb3 b/test/fixtures/execute/tw-boolean-arguments-are-not-cast.sb3 new file mode 100644 index 00000000..ba78ae21 Binary files /dev/null and b/test/fixtures/execute/tw-boolean-arguments-are-not-cast.sb3 differ diff --git a/test/fixtures/execute/tw-broadcast-id-and-name-desync.sb3 b/test/fixtures/execute/tw-broadcast-id-and-name-desync.sb3 new file mode 100644 index 00000000..7af93aed Binary files /dev/null and b/test/fixtures/execute/tw-broadcast-id-and-name-desync.sb3 differ diff --git a/test/fixtures/execute/tw-change-size-does-not-use-rounded-size.sb3 b/test/fixtures/execute/tw-change-size-does-not-use-rounded-size.sb3 new file mode 100644 index 00000000..dfffe493 Binary files /dev/null and b/test/fixtures/execute/tw-change-size-does-not-use-rounded-size.sb3 differ diff --git a/test/fixtures/execute/tw-color-input-returns-hex.sb3 b/test/fixtures/execute/tw-color-input-returns-hex.sb3 new file mode 100644 index 00000000..a57a9837 Binary files /dev/null and b/test/fixtures/execute/tw-color-input-returns-hex.sb3 differ diff --git a/test/fixtures/execute/tw-comparison-matrix-inline.sb3 b/test/fixtures/execute/tw-comparison-matrix-inline.sb3 new file mode 100644 index 00000000..6be9e532 Binary files /dev/null and b/test/fixtures/execute/tw-comparison-matrix-inline.sb3 differ diff --git a/test/fixtures/execute/tw-comparison-matrix-runtime.sb3 b/test/fixtures/execute/tw-comparison-matrix-runtime.sb3 new file mode 100644 index 00000000..5d77c0ee Binary files /dev/null and b/test/fixtures/execute/tw-comparison-matrix-runtime.sb3 differ diff --git a/test/fixtures/execute/tw-compatibility-layer-type-barrier.sb3 b/test/fixtures/execute/tw-compatibility-layer-type-barrier.sb3 new file mode 100644 index 00000000..635f80d5 Binary files /dev/null and b/test/fixtures/execute/tw-compatibility-layer-type-barrier.sb3 differ diff --git a/test/fixtures/execute/tw-coordinate-precision.sb3 b/test/fixtures/execute/tw-coordinate-precision.sb3 new file mode 100644 index 00000000..832c327c Binary files /dev/null and b/test/fixtures/execute/tw-coordinate-precision.sb3 differ diff --git a/test/fixtures/execute/tw-counter.sb3 b/test/fixtures/execute/tw-counter.sb3 new file mode 100644 index 00000000..93e8d4fa Binary files /dev/null and b/test/fixtures/execute/tw-counter.sb3 differ diff --git a/test/fixtures/execute/tw-custom-report-repeat.sb3 b/test/fixtures/execute/tw-custom-report-repeat.sb3 new file mode 100644 index 00000000..e80dcafc Binary files /dev/null and b/test/fixtures/execute/tw-custom-report-repeat.sb3 differ diff --git a/test/fixtures/execute/tw-exit-state-accounts-for-yields-in-procedures.sb3 b/test/fixtures/execute/tw-exit-state-accounts-for-yields-in-procedures.sb3 new file mode 100644 index 00000000..6d194449 Binary files /dev/null and b/test/fixtures/execute/tw-exit-state-accounts-for-yields-in-procedures.sb3 differ diff --git a/test/fixtures/execute/tw-forkphorus-515-boolean-number-comparison.sb3 b/test/fixtures/execute/tw-forkphorus-515-boolean-number-comparison.sb3 new file mode 100644 index 00000000..bce51b73 Binary files /dev/null and b/test/fixtures/execute/tw-forkphorus-515-boolean-number-comparison.sb3 differ diff --git a/test/fixtures/execute/tw-forkphorus-515-non-finite-direction.sb3 b/test/fixtures/execute/tw-forkphorus-515-non-finite-direction.sb3 new file mode 100644 index 00000000..32885353 Binary files /dev/null and b/test/fixtures/execute/tw-forkphorus-515-non-finite-direction.sb3 differ diff --git a/test/fixtures/execute/tw-forkphorus-515-random-with-invalid-number-with-period.sb3 b/test/fixtures/execute/tw-forkphorus-515-random-with-invalid-number-with-period.sb3 new file mode 100644 index 00000000..8112222c Binary files /dev/null and b/test/fixtures/execute/tw-forkphorus-515-random-with-invalid-number-with-period.sb3 differ diff --git a/test/fixtures/execute/tw-forkphorus-515-variable-id-name-desync-name-fallback.sb3 b/test/fixtures/execute/tw-forkphorus-515-variable-id-name-desync-name-fallback.sb3 new file mode 100644 index 00000000..eafa4984 Binary files /dev/null and b/test/fixtures/execute/tw-forkphorus-515-variable-id-name-desync-name-fallback.sb3 differ diff --git a/test/fixtures/execute/tw-forkphorus-515-wait-zero-seconds-in-warp-mode.sb3 b/test/fixtures/execute/tw-forkphorus-515-wait-zero-seconds-in-warp-mode.sb3 new file mode 100644 index 00000000..9280c85f Binary files /dev/null and b/test/fixtures/execute/tw-forkphorus-515-wait-zero-seconds-in-warp-mode.sb3 differ diff --git a/test/fixtures/execute/tw-gh-201-stop-script-does-not-reevaluate-arguments.sb3 b/test/fixtures/execute/tw-gh-201-stop-script-does-not-reevaluate-arguments.sb3 new file mode 100644 index 00000000..9e8b051d Binary files /dev/null and b/test/fixtures/execute/tw-gh-201-stop-script-does-not-reevaluate-arguments.sb3 differ diff --git a/test/fixtures/execute/tw-gh-249-quicksort.sb3 b/test/fixtures/execute/tw-gh-249-quicksort.sb3 new file mode 100644 index 00000000..ff393d2a Binary files /dev/null and b/test/fixtures/execute/tw-gh-249-quicksort.sb3 differ diff --git a/test/fixtures/execute/tw-list-any.sb3 b/test/fixtures/execute/tw-list-any.sb3 new file mode 100644 index 00000000..37be9b18 Binary files /dev/null and b/test/fixtures/execute/tw-list-any.sb3 differ diff --git a/test/fixtures/execute/tw-loop-condition-optimization-gh-276.sb3 b/test/fixtures/execute/tw-loop-condition-optimization-gh-276.sb3 new file mode 100644 index 00000000..48099303 Binary files /dev/null and b/test/fixtures/execute/tw-loop-condition-optimization-gh-276.sb3 differ diff --git a/test/fixtures/execute/tw-non-warp-loop-condition-analysis.sb3 b/test/fixtures/execute/tw-non-warp-loop-condition-analysis.sb3 new file mode 100644 index 00000000..59c1cfcf Binary files /dev/null and b/test/fixtures/execute/tw-non-warp-loop-condition-analysis.sb3 differ diff --git a/test/fixtures/execute/tw-obsolete-blocks.sb3 b/test/fixtures/execute/tw-obsolete-blocks.sb3 new file mode 100644 index 00000000..e5eefd8b Binary files /dev/null and b/test/fixtures/execute/tw-obsolete-blocks.sb3 differ diff --git a/test/fixtures/execute/tw-one-divide-negative-zero.sb3 b/test/fixtures/execute/tw-one-divide-negative-zero.sb3 new file mode 100644 index 00000000..7bddcd86 Binary files /dev/null and b/test/fixtures/execute/tw-one-divide-negative-zero.sb3 differ diff --git a/test/fixtures/execute/tw-preciseProjectTimer-drift-453118719.sb3 b/test/fixtures/execute/tw-preciseProjectTimer-drift-453118719.sb3 new file mode 100644 index 00000000..c886ef4c Binary files /dev/null and b/test/fixtures/execute/tw-preciseProjectTimer-drift-453118719.sb3 differ diff --git a/test/fixtures/execute/tw-prefers-first-occurence-of-procedure-387608267.sb3 b/test/fixtures/execute/tw-prefers-first-occurence-of-procedure-387608267.sb3 new file mode 100644 index 00000000..6d653a27 Binary files /dev/null and b/test/fixtures/execute/tw-prefers-first-occurence-of-procedure-387608267.sb3 differ diff --git a/test/fixtures/execute/tw-procedure-arguments-with-same-name.sb3 b/test/fixtures/execute/tw-procedure-arguments-with-same-name.sb3 new file mode 100644 index 00000000..069a58cc Binary files /dev/null and b/test/fixtures/execute/tw-procedure-arguments-with-same-name.sb3 differ diff --git a/test/fixtures/execute/tw-procedure-call-resets-variable-input-types-430811055.sb3 b/test/fixtures/execute/tw-procedure-call-resets-variable-input-types-430811055.sb3 new file mode 100644 index 00000000..75603361 Binary files /dev/null and b/test/fixtures/execute/tw-procedure-call-resets-variable-input-types-430811055.sb3 differ diff --git a/test/fixtures/execute/tw-procedure-prototype-exists-but-not-definition-549160843.sb3 b/test/fixtures/execute/tw-procedure-prototype-exists-but-not-definition-549160843.sb3 new file mode 100644 index 00000000..0513a480 Binary files /dev/null and b/test/fixtures/execute/tw-procedure-prototype-exists-but-not-definition-549160843.sb3 differ diff --git a/test/fixtures/execute/tw-procedure-return-non-existant.sb3 b/test/fixtures/execute/tw-procedure-return-non-existant.sb3 new file mode 100644 index 00000000..0804d7a1 Binary files /dev/null and b/test/fixtures/execute/tw-procedure-return-non-existant.sb3 differ diff --git a/test/fixtures/execute/tw-procedure-return-non-existent.sb3 b/test/fixtures/execute/tw-procedure-return-non-existent.sb3 new file mode 100644 index 00000000..4c3e2e43 Binary files /dev/null and b/test/fixtures/execute/tw-procedure-return-non-existent.sb3 differ diff --git a/test/fixtures/execute/tw-procedure-return-recursion.sb3 b/test/fixtures/execute/tw-procedure-return-recursion.sb3 new file mode 100644 index 00000000..9f46c91b Binary files /dev/null and b/test/fixtures/execute/tw-procedure-return-recursion.sb3 differ diff --git a/test/fixtures/execute/tw-procedure-return-simple.sb3 b/test/fixtures/execute/tw-procedure-return-simple.sb3 new file mode 100644 index 00000000..1714cc0e Binary files /dev/null and b/test/fixtures/execute/tw-procedure-return-simple.sb3 differ diff --git a/test/fixtures/execute/tw-procedure-return-stops-scripts.sb3 b/test/fixtures/execute/tw-procedure-return-stops-scripts.sb3 new file mode 100644 index 00000000..0acdda88 Binary files /dev/null and b/test/fixtures/execute/tw-procedure-return-stops-scripts.sb3 differ diff --git a/test/fixtures/execute/tw-procedure-return-warp.sb3 b/test/fixtures/execute/tw-procedure-return-warp.sb3 new file mode 100644 index 00000000..90437304 Binary files /dev/null and b/test/fixtures/execute/tw-procedure-return-warp.sb3 differ diff --git a/test/fixtures/execute/tw-promise-loop-double-yield-kouzeru.sb3 b/test/fixtures/execute/tw-promise-loop-double-yield-kouzeru.sb3 new file mode 100644 index 00000000..f42e7705 Binary files /dev/null and b/test/fixtures/execute/tw-promise-loop-double-yield-kouzeru.sb3 differ diff --git a/test/fixtures/execute/tw-repeat-analysis-doesnt-reanalyze.sb3 b/test/fixtures/execute/tw-repeat-analysis-doesnt-reanalyze.sb3 new file mode 100644 index 00000000..12d51fb7 Binary files /dev/null and b/test/fixtures/execute/tw-repeat-analysis-doesnt-reanalyze.sb3 differ diff --git a/test/fixtures/execute/tw-repeat-procedure-reporter-infinite-analyzer-loop.sb3 b/test/fixtures/execute/tw-repeat-procedure-reporter-infinite-analyzer-loop.sb3 new file mode 100644 index 00000000..1d91e7bc Binary files /dev/null and b/test/fixtures/execute/tw-repeat-procedure-reporter-infinite-analyzer-loop.sb3 differ diff --git a/test/fixtures/execute/tw-restart-broadcast-threads.sb3 b/test/fixtures/execute/tw-restart-broadcast-threads.sb3 new file mode 100644 index 00000000..ceae92dd Binary files /dev/null and b/test/fixtures/execute/tw-restart-broadcast-threads.sb3 differ diff --git a/test/fixtures/execute/tw-rotate-by-decimal-without-leading-zero.sb3 b/test/fixtures/execute/tw-rotate-by-decimal-without-leading-zero.sb3 new file mode 100644 index 00000000..4b8c5e14 Binary files /dev/null and b/test/fixtures/execute/tw-rotate-by-decimal-without-leading-zero.sb3 differ diff --git a/test/fixtures/execute/tw-safe-procedure-argument-casting.sb3 b/test/fixtures/execute/tw-safe-procedure-argument-casting.sb3 new file mode 100644 index 00000000..16139265 Binary files /dev/null and b/test/fixtures/execute/tw-safe-procedure-argument-casting.sb3 differ diff --git a/test/fixtures/execute/tw-self-restarting-script-keeps-running-until-yield.sb3 b/test/fixtures/execute/tw-self-restarting-script-keeps-running-until-yield.sb3 new file mode 100644 index 00000000..ee8c6188 Binary files /dev/null and b/test/fixtures/execute/tw-self-restarting-script-keeps-running-until-yield.sb3 differ diff --git a/test/fixtures/execute/tw-sensing-of.sb3 b/test/fixtures/execute/tw-sensing-of.sb3 new file mode 100644 index 00000000..8e15af26 Binary files /dev/null and b/test/fixtures/execute/tw-sensing-of.sb3 differ diff --git a/test/fixtures/execute/tw-simple-string-operations.sb3 b/test/fixtures/execute/tw-simple-string-operations.sb3 new file mode 100644 index 00000000..0687b08a Binary files /dev/null and b/test/fixtures/execute/tw-simple-string-operations.sb3 differ diff --git a/test/fixtures/execute/tw-sound-menu-avoids-number-literal-if-name-conflict.sb3 b/test/fixtures/execute/tw-sound-menu-avoids-number-literal-if-name-conflict.sb3 new file mode 100644 index 00000000..ce978f19 Binary files /dev/null and b/test/fixtures/execute/tw-sound-menu-avoids-number-literal-if-name-conflict.sb3 differ diff --git a/test/fixtures/execute/tw-stage-cannot-move-layers.sb3 b/test/fixtures/execute/tw-stage-cannot-move-layers.sb3 new file mode 100644 index 00000000..67c2552a Binary files /dev/null and b/test/fixtures/execute/tw-stage-cannot-move-layers.sb3 differ diff --git a/test/fixtures/execute/tw-state-analysis-understands-stop-this-script.sb3 b/test/fixtures/execute/tw-state-analysis-understands-stop-this-script.sb3 new file mode 100644 index 00000000..735f45d7 Binary files /dev/null and b/test/fixtures/execute/tw-state-analysis-understands-stop-this-script.sb3 differ diff --git a/test/fixtures/execute/tw-subtract-can-return-nan.sb3 b/test/fixtures/execute/tw-subtract-can-return-nan.sb3 new file mode 100644 index 00000000..161f27be Binary files /dev/null and b/test/fixtures/execute/tw-subtract-can-return-nan.sb3 differ diff --git a/test/fixtures/execute/tw-tab-equals-zero.sb3 b/test/fixtures/execute/tw-tab-equals-zero.sb3 new file mode 100644 index 00000000..0a637603 Binary files /dev/null and b/test/fixtures/execute/tw-tab-equals-zero.sb3 differ diff --git a/test/fixtures/execute/tw-tangent.sb3 b/test/fixtures/execute/tw-tangent.sb3 new file mode 100644 index 00000000..3936fabe Binary files /dev/null and b/test/fixtures/execute/tw-tangent.sb3 differ diff --git a/test/fixtures/execute/tw-unsafe-equals.sb3 b/test/fixtures/execute/tw-unsafe-equals.sb3 new file mode 100644 index 00000000..62d6794c Binary files /dev/null and b/test/fixtures/execute/tw-unsafe-equals.sb3 differ diff --git a/test/fixtures/execute/tw-wait-until-condition-gh-277.sb3 b/test/fixtures/execute/tw-wait-until-condition-gh-277.sb3 new file mode 100644 index 00000000..a170d42f Binary files /dev/null and b/test/fixtures/execute/tw-wait-until-condition-gh-277.sb3 differ diff --git a/test/fixtures/execute/tw-warp-loop-condition-analysis.sb3 b/test/fixtures/execute/tw-warp-loop-condition-analysis.sb3 new file mode 100644 index 00000000..12685752 Binary files /dev/null and b/test/fixtures/execute/tw-warp-loop-condition-analysis.sb3 differ diff --git a/test/fixtures/execute/tw-warp-repeat-until-timer-greater-than.sb3 b/test/fixtures/execute/tw-warp-repeat-until-timer-greater-than.sb3 new file mode 100644 index 00000000..77ef3f28 Binary files /dev/null and b/test/fixtures/execute/tw-warp-repeat-until-timer-greater-than.sb3 differ diff --git a/test/fixtures/execute/tw-when-backdrop-switches-to-next-backdrop.sb3 b/test/fixtures/execute/tw-when-backdrop-switches-to-next-backdrop.sb3 new file mode 100644 index 00000000..71640df8 Binary files /dev/null and b/test/fixtures/execute/tw-when-backdrop-switches-to-next-backdrop.sb3 differ diff --git a/test/fixtures/execute/tw-when-backdrop-switches-to-switch-backdrop-to.sb3 b/test/fixtures/execute/tw-when-backdrop-switches-to-switch-backdrop-to.sb3 new file mode 100644 index 00000000..e28ab9d5 Binary files /dev/null and b/test/fixtures/execute/tw-when-backdrop-switches-to-switch-backdrop-to.sb3 differ diff --git a/test/fixtures/execute/tw-zombie-cube-escape-284516654.sb3 b/test/fixtures/execute/tw-zombie-cube-escape-284516654.sb3 new file mode 100644 index 00000000..ad333484 Binary files /dev/null and b/test/fixtures/execute/tw-zombie-cube-escape-284516654.sb3 differ diff --git a/test/integration/turbowarp-integration-execute.test.mjs b/test/integration/turbowarp-integration-execute.test.mjs new file mode 100644 index 00000000..531dae74 --- /dev/null +++ b/test/integration/turbowarp-integration-execute.test.mjs @@ -0,0 +1,212 @@ +/** + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +/** + * Adapted from https://github.com/TurboWarp/scratch-vm/blob/develop/test/integration/execute.js + */ + +const fs = require("node:fs"); +import path from "node:path"; + +import { describe, test } from "vitest"; + +import { imports } from "../../js/imports.ts"; +import { unpackProject } from "../../playground/lib/project-loader.js"; +import { sb3_to_wasm, WasmFlags } from "../../js/compiler/hyperquark.js"; +import { defaultSettings } from "../../playground/lib/settings.js"; + +/** + * @fileoverview Transform each sb2 in test/fixtures/execute into a test. + * + * Test execution of a group of scratch blocks by SAYing if a test did "pass", + * or did "fail". Two keywords can be set at the beginning of a SAY messaage + * to indicate a test primitive. + * + * - "pass MESSAGE" will report a passing test with MESSAGE. + * - "fail MESSAGE" will report a failing test with MESSAGE. + * + * A good strategy to follow is to SAY "pass" or "fail" depending on expected + * scratch results in conditions, event scripts, or what is best for testing + * the target block or group of blocks. + */ + +// this is adapted from playground/lib/project-runner.js to work in node +// todo: adapt so we can just import it? +function runProject({ wasm_bytes, settings, reportVmResult, timeoutFailure }) { + const framerate_wait = Math.round(1000 / 30); + + const builtins = [...(settings["js-string-builtins"] ? ["js-string"] : [])]; + + try { + if ( + !WebAssembly.validate(wasm_bytes, { + builtins, + }) + ) { + throw Error(); + } + } catch { + try { + new WebAssembly.Module(wasm_bytes); + throw new Error("invalid WASM module"); + } catch (e) { + throw new Error("invalid WASM module: " + e.message); + } + } + function sleep(ms) { + return new Promise((resolve) => { + setTimeout(resolve, ms); + }); + } + function waitAnimationFrame() { + return new Promise((resolve) => { + setTimeout(resolve, 1); + }); + } + imports.looks.say_string = reportVmResult; + return WebAssembly.instantiate(wasm_bytes, imports, { + builtins, + importedStringConstants: "", + }).then(async ({ instance }) => { + const { + flag_clicked, + tick, + memory, + threads_count, + requests_refresh, + threads, + noop, + } = instance.exports; + flag_clicked(); + + let start_time = Date.now(); + let thisTickStartTime; + $outertickloop: while (true) { + if (Date.now() - start_time > 5000) { + return timeoutFailure(); + } + thisTickStartTime = Date.now(); + // renderer.draw(); + $innertickloop: do { + tick(); + if (threads_count.value === 0) { + break $outertickloop; + } + } while ( + Date.now() - thisTickStartTime < framerate_wait * 0.8 && + requests_refresh.value === 0 + ); + requests_refresh.value = 0; + if (framerate_wait > 0) { + await sleep( + Math.max(0, framerate_wait - (Date.now() - thisTickStartTime)), + ); + } else { + await waitAnimationFrame(); + } + } + return; + }); +} + +const executeDir = path.resolve(__dirname, "../fixtures/execute"); + +// Find files which end in ".sb", ".sb2", or ".sb3" +const fileFilter = /\.sb[23]?$/i; + +describe("Integration tests", () => { + const files = fs + .readdirSync(executeDir) + .filter((uri) => fileFilter.test(uri)) + // ignore tests that crash the runner, for now + .filter( + (uri) => + !["tw-comparison-matrix-inline.sb3", "tw-unsafe-equals.sb3"].includes( + uri, + ), + ); + for (const uri of files) { + test.sequential(`${uri} (default flags)`, async () => { + let plannedCount = 0; + let testCount = 0; + let didEnd = false; + const testResults = { passes: [], failures: [] }; + const reporters = { + comment(message) { + console.log(`[${uri}]`, message); + }, + pass(reason) { + testCount++; + testResults.passes.push(reason); + console.log(`[${uri}] pass:`, reason); + }, + fail(reason) { + testCount++; + testResults.failures.push(reason); + console.log(`[${uri}] fail:`, reason); + }, + plan(count) { + plannedCount = Number(count); + console.log(`[${uri}] planned ${plannedCount} tests`); + }, + end() { + didEnd = true; + console.log(`[${uri}] test ended`); + }, + }; + + const reportVmResult = (text) => { + const command = text.split(/\s+/, 1)[0].toLowerCase(); + if (reporters[command]) { + return reporters[command](text.substring(command.length).trim()); + } + + // Default to a comment with the full text if we didn't match + // any command prefix + return reporters.comment(text); + }; + + const projectBuffer = Buffer.from( + fs.readFileSync(path.join(executeDir, uri)), + ); + + const [project_json, _] = await unpackProject(projectBuffer); + // console.log(JSON.stringify(project_json, null, 2)) + const project_wasm = sb3_to_wasm( + JSON.stringify(project_json, null, 2), + WasmFlags.from_js(defaultSettings.to_js()), + ); + + // todo: run wasm-opt if specified in flags? + + // Run the project and once all threads are complete check the results. + await runProject({ + wasm_bytes: project_wasm.wasm_bytes, + target_names: project_wasm.target_names, + settings: defaultSettings, + reportVmResult, + timeoutFailure: () => { + throw new Error(`Timeout waiting for threads to complete: ${uri}`); + }, + }); + + // Verify test end was called + if (!didEnd) { + throw new Error(`Test did not call "end"`); + } + + // If a plan was specified, verify we ran the planned number of tests + if (plannedCount > 0 && testCount !== plannedCount) { + throw new Error(`Expected ${plannedCount} tests, but ran ${testCount}`); + } + + // All failures should be reported + if (testResults.failures.length > 0) { + throw new Error(`Test failures: ${testResults.failures.join(", ")}`); + } + }); + } +}); diff --git a/vite.config.js b/vite.config.js index 887f4f54..efaba197 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,14 +1,14 @@ -import { fileURLToPath, URL } from 'node:url' +import { fileURLToPath, URL } from "node:url"; -import { defineConfig } from 'vite' +import { defineConfig } from "vite"; import wasm from "vite-plugin-wasm"; -import vue from '@vitejs/plugin-vue' -import { nodePolyfills } from 'vite-plugin-node-polyfills' +import vue from "@vitejs/plugin-vue"; +import { nodePolyfills } from "vite-plugin-node-polyfills"; // https://vitejs.dev/config/ export default defineConfig({ - root: './playground', - base: '/hyperquark/', + root: "./playground", + base: "/hyperquark/", plugins: [ wasm(), vue(), @@ -20,10 +20,15 @@ export default defineConfig({ ], resolve: { alias: { - '@': fileURLToPath(new URL('./playground', import.meta.url)) - } + "@": fileURLToPath(new URL("./playground", import.meta.url)), + }, }, build: { - target: 'esnext', - } -}) + target: "esnext", + }, + test: { + root: ".", + plugins: [wasm()], + pool: "forks", + }, +});