@beff/aula-cli 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/{aula-voice-tts-ZLENVCTL.js → aula-voice-tts-HPJAJO2Q.js} +2 -2
- package/dist/src/aula.js +5 -3
- package/dist/src/{chunk-S4R2YV4Q.js → chunk-3RB5T3CC.js} +10 -10
- package/dist/src/{chunk-6MTKOBV3.js → chunk-4N4NUMKP.js} +1 -1
- package/dist/src/{chunk-LONUONDL.js → chunk-4PZYWKO5.js} +1 -1
- package/dist/src/{chunk-I7YBTEZQ.js → chunk-5ABPFV55.js} +2 -2
- package/dist/src/{chunk-Z6BPR7P2.js → chunk-5TUGYMFH.js} +3 -3
- package/dist/src/{chunk-Y2QUSCIS.js → chunk-5XVICDLW.js} +7 -5
- package/dist/src/{chunk-MBGQSHJQ.js → chunk-DFXG2P7A.js} +6 -3
- package/dist/src/{chunk-ADPNDDVR.js → chunk-F4XRXW6M.js} +1 -1
- package/dist/src/{chunk-L3D2SCGY.js → chunk-JWBPHDVP.js} +1 -1
- package/dist/src/{chunk-HNX33Z2H.js → chunk-KCGXC2RV.js} +1 -1
- package/dist/src/{chunk-CDCQV6LH.js → chunk-VX7UVLQW.js} +1 -0
- package/dist/src/{chunk-4ISJCROX.js → chunk-XCPBFMEA.js} +2 -2
- package/dist/src/{chunk-XND4JY6N.js → chunk-Y56UHOZ2.js} +13670 -11331
- package/dist/src/cli.js +11 -11
- package/dist/src/commands-BUM4AG3N.js +34 -0
- package/dist/src/generated/aula.core5.wasm +0 -0
- package/dist/src/generated/aula.core6.wasm +0 -0
- package/dist/src/generated/aula.core7.wasm +0 -0
- package/dist/src/generated/aula.js +13393 -11218
- package/dist/src/generated/interfaces/aula-engine-types.d.ts +1 -0
- package/dist/src/problems-2IXR6RUV.js +18 -0
- package/dist/src/project-36YBXKCD.js +16 -0
- package/dist/src/render-child.js +3 -3
- package/dist/src/{run-UMTKLDLV.js → run-YLF62D3C.js} +13 -13
- package/dist/src/{server-UOGVZC42.js → server-ALRN2C2W.js} +8 -8
- package/dist/src/{site-VE7QMIQT.js → site-A2I4P4GX.js} +7 -7
- package/dist/src/{tex-mathjax-BPTK3PIV.js → tex-mathjax-7AXKQRBZ.js} +1 -1
- package/dist/web/app/assets/56cf58c4/aula-method.js +2 -0
- package/dist/web/app/assets/56cf58c4/aula.js +1 -0
- package/dist/web/app/assets/{99347f41 → 56cf58c4}/build-worker.js +1 -1
- package/dist/web/app/assets/{99347f41 → 56cf58c4}/index.js +3 -2
- package/dist/web/app/assets/__vite-browser-external-BHESVS8k.js +1 -0
- package/dist/web/app/assets/aula-voice-worker-CJpoa9h-.js +1 -0
- package/dist/web/app/assets/{aula.core5-DyTpnTeu.wasm → aula.core5-CQ2oHbtB.wasm} +0 -0
- package/dist/web/app/assets/{index-BL7_U8KF.css → index-qn44kZJM.css} +1 -1
- package/dist/web/{site/assets/protocol-SzfRuFqZ.js → app/assets/protocol-C3Pseh4g.js} +3 -3
- package/dist/web/app/assets/src-DTLT9Lbm.js +6 -0
- package/dist/web/{site/assets/tex-mathjax-DI8t3K0d.js → app/assets/tex-mathjax-8QilZX4j.js} +1 -1
- package/dist/web/app/index.html +4 -4
- package/dist/web/site/assets/82624cbe/aula-method.js +2 -0
- package/dist/web/site/assets/82624cbe/aula.js +1 -0
- package/dist/web/site/assets/{0b93700f → 82624cbe}/build-worker.js +1 -1
- package/dist/web/site/assets/{0b93700f → 82624cbe}/index.js +3 -2
- package/dist/web/site/assets/__vite-browser-external-DQubyTsZ.js +1 -0
- package/dist/web/site/assets/aula-voice-worker-BRrzyFz3.js +1 -0
- package/dist/web/site/assets/{aula.core5-DyTpnTeu.wasm → aula.core5-CQ2oHbtB.wasm} +0 -0
- package/dist/web/site/assets/{index-BL7_U8KF.css → index-qn44kZJM.css} +1 -1
- package/dist/web/{app/assets/protocol-6Ef0OiUV.js → site/assets/protocol-BOv1ch3F.js} +3 -3
- package/dist/web/site/assets/src-DpS3WA7l.js +6 -0
- package/dist/web/{app/assets/tex-mathjax-CIEEjyeS.js → site/assets/tex-mathjax-CVHS5J80.js} +1 -1
- package/dist/web/site/index.html +4 -4
- package/package.json +1 -1
- package/dist/src/commands-5ZNEAKAX.js +0 -34
- package/dist/src/problems-FB2KGUXJ.js +0 -18
- package/dist/src/project-2QUGAEKA.js +0 -16
- package/dist/web/app/assets/99347f41/aula-method.js +0 -2
- package/dist/web/app/assets/99347f41/aula.js +0 -1
- package/dist/web/app/assets/__vite-browser-external-BUQWWIRp.js +0 -1
- package/dist/web/app/assets/aula-voice-worker-BOAoj3G4.js +0 -1
- package/dist/web/app/assets/src-BnqGFItZ.js +0 -6
- package/dist/web/site/assets/0b93700f/aula-method.js +0 -2
- package/dist/web/site/assets/0b93700f/aula.js +0 -1
- package/dist/web/site/assets/__vite-browser-external-dZqIvDN7.js +0 -1
- package/dist/web/site/assets/aula-voice-worker-prRokwBn.js +0 -1
- package/dist/web/site/assets/src-BPmV8WO9.js +0 -6
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
printDiagnostics
|
|
3
|
+
} from "./chunk-5TUGYMFH.js";
|
|
4
|
+
import "./chunk-5XVICDLW.js";
|
|
5
|
+
import "./chunk-JWBPHDVP.js";
|
|
6
|
+
import "./chunk-KCGXC2RV.js";
|
|
7
|
+
import "./chunk-5ABPFV55.js";
|
|
8
|
+
import {
|
|
9
|
+
diagnosticsOf
|
|
10
|
+
} from "./chunk-DFXG2P7A.js";
|
|
11
|
+
import "./chunk-XCPBFMEA.js";
|
|
12
|
+
import "./chunk-Y56UHOZ2.js";
|
|
13
|
+
import "./chunk-VX7UVLQW.js";
|
|
14
|
+
import "./chunk-CZ7CSFO4.js";
|
|
15
|
+
export {
|
|
16
|
+
diagnosticsOf,
|
|
17
|
+
printDiagnostics
|
|
18
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
exists,
|
|
3
|
+
host,
|
|
4
|
+
loadProject
|
|
5
|
+
} from "./chunk-4PZYWKO5.js";
|
|
6
|
+
import "./chunk-5ABPFV55.js";
|
|
7
|
+
import "./chunk-DFXG2P7A.js";
|
|
8
|
+
import "./chunk-XCPBFMEA.js";
|
|
9
|
+
import "./chunk-Y56UHOZ2.js";
|
|
10
|
+
import "./chunk-VX7UVLQW.js";
|
|
11
|
+
import "./chunk-CZ7CSFO4.js";
|
|
12
|
+
export {
|
|
13
|
+
exists,
|
|
14
|
+
host,
|
|
15
|
+
loadProject
|
|
16
|
+
};
|
package/dist/src/render-child.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
VIDEO
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-F4XRXW6M.js";
|
|
4
|
+
import "./chunk-4N4NUMKP.js";
|
|
5
|
+
import "./chunk-VX7UVLQW.js";
|
|
6
6
|
import "./chunk-CZ7CSFO4.js";
|
|
7
7
|
|
|
8
8
|
// src/render-child.ts
|
|
@@ -5,22 +5,22 @@ import {
|
|
|
5
5
|
preview,
|
|
6
6
|
script,
|
|
7
7
|
timeline
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-3RB5T3CC.js";
|
|
9
9
|
import "./chunk-THQ5Y74K.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-F4XRXW6M.js";
|
|
11
|
+
import "./chunk-4N4NUMKP.js";
|
|
12
|
+
import "./chunk-5TUGYMFH.js";
|
|
13
|
+
import "./chunk-5XVICDLW.js";
|
|
14
|
+
import "./chunk-JWBPHDVP.js";
|
|
15
|
+
import "./chunk-KCGXC2RV.js";
|
|
16
|
+
import "./chunk-4PZYWKO5.js";
|
|
17
|
+
import "./chunk-5ABPFV55.js";
|
|
18
18
|
import {
|
|
19
19
|
wrongArgument
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-DFXG2P7A.js";
|
|
21
|
+
import "./chunk-XCPBFMEA.js";
|
|
22
|
+
import "./chunk-Y56UHOZ2.js";
|
|
23
|
+
import "./chunk-VX7UVLQW.js";
|
|
24
24
|
import "./chunk-CZ7CSFO4.js";
|
|
25
25
|
|
|
26
26
|
// src/run.ts
|
|
@@ -5,23 +5,23 @@ import {
|
|
|
5
5
|
createNodeBundler,
|
|
6
6
|
nodeTree
|
|
7
7
|
} from "./chunk-THQ5Y74K.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-JWBPHDVP.js";
|
|
9
9
|
import {
|
|
10
10
|
SERVER_WEIGHTS_PATH
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-KCGXC2RV.js";
|
|
12
12
|
import {
|
|
13
13
|
exists
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-4PZYWKO5.js";
|
|
15
|
+
import "./chunk-5ABPFV55.js";
|
|
16
16
|
import {
|
|
17
17
|
bundleWorkspace
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-DFXG2P7A.js";
|
|
19
|
+
import "./chunk-XCPBFMEA.js";
|
|
20
|
+
import "./chunk-Y56UHOZ2.js";
|
|
21
21
|
import {
|
|
22
22
|
AulaError,
|
|
23
23
|
fault
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-VX7UVLQW.js";
|
|
25
25
|
import "./chunk-CZ7CSFO4.js";
|
|
26
26
|
|
|
27
27
|
// src/web/server.ts
|
|
@@ -8,24 +8,24 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
loadBuiltProjects,
|
|
10
10
|
workspaceHost
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-5XVICDLW.js";
|
|
12
|
+
import "./chunk-JWBPHDVP.js";
|
|
13
13
|
import {
|
|
14
14
|
AULA_VOICE_WEIGHTS
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-KCGXC2RV.js";
|
|
16
16
|
import {
|
|
17
17
|
Problems,
|
|
18
18
|
bundleWorkspace,
|
|
19
19
|
projectModules,
|
|
20
20
|
wrongArgument
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-DFXG2P7A.js";
|
|
22
|
+
import "./chunk-XCPBFMEA.js";
|
|
23
23
|
import {
|
|
24
24
|
v8Frames
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-Y56UHOZ2.js";
|
|
26
26
|
import {
|
|
27
27
|
fault
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-VX7UVLQW.js";
|
|
29
29
|
import "./chunk-CZ7CSFO4.js";
|
|
30
30
|
|
|
31
31
|
// src/site.ts
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{f as e}from"../src-DTLT9Lbm.js";import"./aula.js";var t=e=>JSON.stringify(e);function n(e){return!/\s/.test(e)&&!e.includes(`://`)&&/[/.]/.test(e)}function r(e,t){if(t.length!==1||t.raw.length!==1)throw Error(`${e}: a \${…} is not allowed in this tag`);let n=t[0]??``;if(n.includes(`
|
|
2
|
+
`))throw Error(`${e}: the text must be one line`);return n}function i(e,r,i){let a=[],o=(t,n,r=e.place)=>{a.push({code:t,message:n,...r===void 0?{}:{at:r}})};i.mechanism.trim()===``&&o(`method-no-mechanism`,`the paragraph has no mechanism: name the one mechanism that the viewer must understand`);for(let e of i.sources)n(e)&&!r.exists(e)&&o(`method-missing-source`,`${t(e)}: this path is not a file: correct the path or add the file`);return a}function a(t){let n=r(`paragraph`,t);return({sources:t},r)=>e({mechanism:n,sources:t},(e,a)=>[...i(e,a,{mechanism:n,sources:t}),...r?.(e,a)??[]])}export{a as paragraph};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{c as defineChapter,l as defineProject,u as embed,y as loadEngine,o as m,f as paragraph,p as pronounce,m as say,h as show}from"../src-DTLT9Lbm.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,t}from"../rolldown-runtime-BLXQ4ufn.js";import{a as n,d as r,f as i,g as a,h as o,i as s,l as c,n as l,o as u,p as d,u as f}from"../protocol-6Ef0OiUV.js";import{S as p,g as m,v as h,y as g}from"../src-BnqGFItZ.js";var _=44,v=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,y=new Uint8Array(64),b=new Uint8Array(128);for(let e=0;e<v.length;e++){let t=v.charCodeAt(e);y[e]=t,b[t]=e}function x(e){let t=0,n=0,r=0;do r=b[e.next()],t|=(r&31)<<n,n+=5;while(r&32);return t}function S(e){return e&1?-0x80000000|-(e>>>1):e>>>1}function C(e,t){return e.pos>=t?!1:e.peek()!==_}var ee=class{constructor(e){this.pos=0,this.buffer=e}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(e){let{buffer:t,pos:n}=this,r=t.indexOf(e,n);return r===-1?t.length:r}};function te(e){let{length:t}=e,n=new ee(e),r=[],i=0,a=0,o=0,s=0,c=0;do{let e=n.indexOf(`;`),t=[],l=!0,u=0;for(i=0;n.pos<e;){let r;i+=S(x(n)),i<u&&(l=!1),u=i,C(n,e)?(a+=S(x(n)),o+=S(x(n)),s+=S(x(n)),C(n,e)?(c+=S(x(n)),r=[i,a,o,s,c]):r=[i,a,o,s]):r=[i],t.push(r),n.pos++}l||w(t),r.push(t),n.pos=e+1}while(n.pos<=t);return r}function w(e){e.sort(T)}function T(e,t){return e[0]-t[0]}var E=e(t(((e,t,n)=>{var r;(function(n,i){typeof e==`object`&&t!==void 0?t.exports=i():typeof r==`function`&&r.amd?r(i):(n=typeof globalThis<`u`?globalThis:n||self,n.resolveURI=i())})(n,(function(){let e=/^[\w+.-]+:\/\//,t=/^([\w+.-]+:)\/\/([^@/#?]*@)?(\[[^\]]+\]|[^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,n=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function r(t){return e.test(t)}function i(e){return e.startsWith(`//`)}function a(e){return e.startsWith(`/`)}function o(e){return e.startsWith(`file:`)}function s(e){return/^[.?#]/.test(e)}function c(e){let n=t.exec(e);return u(n[1],n[2]||``,n[3],n[4]||``,n[5]||`/`,n[6]||``,n[7]||``)}function l(e){let t=n.exec(e),r=t[2];return u(`file:`,``,t[1]||``,``,a(r)?r:`/`+r,t[3]||``,t[4]||``)}function u(e,t,n,r,i,a,o){return{scheme:e,user:t,host:n,port:r,path:i,query:a,hash:o,type:7}}function d(e){if(i(e)){let t=c(`http:`+e);return t.scheme=``,t.type=6,t}if(a(e)){let t=c(`http://foo.com`+e);return t.scheme=``,t.host=``,t.type=5,t}if(o(e))return l(e);if(r(e))return c(e);let t=c(`http://foo.com/`+e);return t.scheme=``,t.host=``,t.type=e?e.startsWith(`?`)?3:e.startsWith(`#`)?2:4:1,t}function f(e){if(e.endsWith(`/..`))return e;let t=e.lastIndexOf(`/`);return e.slice(0,t+1)}function p(e,t){m(t,t.type),e.path=e.path===`/`?t.path:f(t.path)+e.path}function m(e,t){let n=t<=4,r=e.path.split(`/`),i=1,a=0,o=!1;for(let e=1;e<r.length;e++){let t=r[e];t?(o=!1,t!==`.`&&(t===`..`?a?(o=!0,a--,i--):n&&(r[i++]=t):(r[i++]=t,a++))):o=!0}let s=``;for(let e=1;e<i;e++)s+=`/`+r[e];(!s||o&&!s.endsWith(`/..`))&&(s+=`/`),e.path=s}function h(e,t){if(!e&&!t)return``;let n=d(e),r=n.type;if(t&&r!==7){let e=d(t),i=e.type;switch(r){case 1:n.hash=e.hash;case 2:n.query=e.query;case 3:case 4:p(n,e);case 5:n.user=e.user,n.host=e.host,n.port=e.port;case 6:n.scheme=e.scheme}i>r&&(r=i)}m(n,r);let i=n.query+n.hash;switch(r){case 2:case 3:return i;case 4:{let r=n.path.slice(1);return r?s(t||e)&&!s(r)?`./`+r+i:r+i:i||`.`}case 5:return n.path+i;default:return n.scheme+`//`+n.user+n.host+n.port+n.path+i}}return h}))}))(),1);function D(e){if(!e)return``;let t=e.lastIndexOf(`/`);return e.slice(0,t+1)}function O(e,t){let n=D(e),r=t?t+`/`:``;return e=>(0,E.default)(r+(e||``),n)}var k=0,ne=1,re=2,ie=3,A=4;function j(e,t){let n=M(e,0);if(n===e.length)return e;t||(e=e.slice());for(let r=n;r<e.length;r=M(e,r+1))e[r]=P(e[r],t);return e}function M(e,t){for(let n=t;n<e.length;n++)if(!N(e[n]))return n;return e.length}function N(e){for(let t=1;t<e.length;t++)if(e[t][k]<e[t-1][k])return!1;return!0}function P(e,t){return t||(e=e.slice()),e.sort(F)}function F(e,t){return e[k]-t[k]}var I=!1;function L(e,t,n,r){for(;n<=r;){let i=n+(r-n>>1),a=e[i][k]-t;if(a===0)return I=!0,i;a<0?n=i+1:r=i-1}return I=!1,n-1}function R(e,t,n){for(let r=n+1;r<e.length&&e[r][k]===t;n=r++);return n}function z(e,t,n){for(let r=n-1;r>=0&&e[r][k]===t;n=r--);return n}function B(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function V(e,t,n,r){let{lastKey:i,lastNeedle:a,lastIndex:o}=n,s=0,c=e.length-1;if(r===i){if(t===a)return I=o!==-1&&e[o][k]===t,o;t>=a?s=o===-1?0:o:c=o}return n.lastKey=r,n.lastNeedle=t,n.lastIndex=L(e,t,s,c)}function H(e){return typeof e==`string`?JSON.parse(e):e}var U="`line` must be greater than 0 (lines start at line 1)",W="`column` must be greater than or equal to 0 (columns start at column 0)",ae=class{constructor(e,t){let n=typeof e==`string`;if(!n&&e._decodedMemo)return e;let r=H(e),{version:i,file:a,names:o,sourceRoot:s,sources:c,sourcesContent:l}=r;this.version=i,this.file=a,this.names=o||[],this.sourceRoot=s,this.sources=c,this.sourcesContent=l,this.ignoreList=r.ignoreList||r.x_google_ignoreList||void 0;let u=O(t,s);this.resolvedSources=c.map(u);let{mappings:d}=r;if(typeof d==`string`)this._encoded=d,this._decoded=void 0;else if(Array.isArray(d))this._encoded=void 0,this._decoded=j(d,n);else if(r.sections)throw Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`);else throw Error(`invalid source map: ${JSON.stringify(r)}`);this._decodedMemo=B(),this._bySources=void 0,this._bySourceMemos=void 0}};function G(e){return e}function K(e){var t;return(t=G(e))._decoded||(t._decoded=te(G(e)._encoded))}function q(e,t){let{line:n,column:r,bias:i}=t;if(n--,n<0)throw Error(U);if(r<0)throw Error(W);let a=K(e);if(n>=a.length)return J(null,null,null,null);let o=a[n],s=oe(o,G(e)._decodedMemo,n,r,i||1);if(s===-1)return J(null,null,null,null);let c=o[s];if(c.length===1)return J(null,null,null,null);let{names:l,resolvedSources:u}=e;return J(u[c[ne]],c[re]+1,c[ie],c.length===5?l[c[A]]:null)}function J(e,t,n,r){return{source:e,line:t,column:n,name:r}}function oe(e,t,n,r,i){let a=V(e,r,t,n);return I?a=(i===-1?R:z)(e,r,a):i===-1&&a++,a===-1||a===e.length?-1:a}var Y=new Map;function se(e,t,n){Y.set(e,{map:new ae(t),prefix:n})}function ce(e,t,n){let r=Y.get(e);if(!r)return{file:e,line:t,column:n};let i=q(r.map,{line:t,column:n-1});return i.source===null||i.line===null||i.column===null?{file:e,line:t,column:n}:{file:i.source.startsWith(r.prefix)?i.source.slice(r.prefix.length):i.source,line:i.line,column:i.column+1}}var X=a(ce);function le(e){let t=0,r=new Map;e.then(e=>{e.addEventListener(`message`,t=>{let i=t.data;if(i.kind===`error`)throw e.close(),new n(`the narrator stopped: ${i.message}`,i.stack);let a=r.get(i.id);r.delete(i.id),a?.(i)}),e.start()});let i=async(n,i)=>{let a=await e;return new Promise(e=>{let o=t++;r.set(o,e),a.postMessage({id:o,kind:n,words:i})})};return{speak:async e=>{let t=await i(`speak`,e);if(t.kind!==`speech`)throw Error(`the narrator answered ${t.kind} to a speech`);return{samples:t.samples,sampleRate:t.sampleRate,words:t.words}},time:async e=>{let t=await i(`time`,e);if(t.kind!==`timing`)throw Error(`the narrator answered ${t.kind} to a clock`);return{samples:t.samples,sampleRate:t.sampleRate,words:t.words}}}}function ue(e){let t=0,n=0,a=!1,u=new Map,d=n=>{let r=r=>{let i=t++,{promise:a,resolve:o}=Promise.withResolvers();return u.set(i,o),e.post({kind:`files`,id:i,tree:n,question:r},[]),a};return{bundle:async()=>{let e=await r({kind:`bundle`});if(e.kind!==`bundle`)throw Error(`the page answered ${e.kind} to a question of the bundle`);return e.result},name:async()=>{let e=await r({kind:`name`});if(e.kind!==`name`)throw Error(`the page answered ${e.kind} to a question of the name`);return e.name},read:async e=>{let t=await r({kind:`read`,path:e});if(t.kind!==`read`)throw Error(`the page answered ${t.kind} to a read of ${e}`);return t.text},bytes:async e=>{let t=await r({kind:`bytes`,path:e});if(t.kind!==`bytes`)throw Error(`the page answered ${t.kind} to a read of the bytes of ${e}`);return t.bytes},list:async e=>{let t=await r({kind:`list`,folder:e});if(t.kind!==`list`)throw Error(`the page answered ${t.kind} to a list of ${e}`);return t.names}}},p=async()=>{let t=d(n++),o=new Map,s=new Set,c=e=>{let t=o.get(e);return t===void 0&&s.add(e),t?{size:t.length,read:()=>t}:void 0},[l]=await Promise.all([t.bundle(),g().then(async()=>{await h(),e.post({kind:`stage`,stage:`engine`},[])})]),u;if(l!==null){if(l._tag===`Left`)return e.post({kind:`stage`,stage:`project`},[]),l;u=await f(l.right,i(X,c),e.modules,e.player)}else{let n=await t.name();if(n===null)return e.post({kind:`stage`,stage:`project`},[]),{_tag:`Right`,right:[]};let a={name:()=>Promise.resolve(n),read:t.read,list:t.list},o=await e.bundler();u=await r(a,i(X,c),e.modules,o,e.player)}if(e.post({kind:`stage`,stage:`project`},[]),u._tag===`Left`)return u;a||(a=!0,e.post({kind:`narrator`},[]));let p=async e=>{for(;;){s.clear();let n=e(),r=[...s].filter(e=>!o.has(e));if(r.length===0)return n;await Promise.all(r.map(async e=>o.set(e,await t.bytes(e))))}};return{_tag:`Right`,right:u.right.map(e=>{let t=new Set;return{...e,readScript:async()=>(await m(),p(()=>e.script())),readChapter:async n=>{t.has(n)||(await m(),await p(()=>e.walk?.(n)),t.add(n))}}})}},_=Promise.withResolvers(),v=o(c.create({voice:le(_.promise),workspace:{projects:p}})),y=[],b=(t,{chapters:n,...r})=>{let i=[],a=[],o=[];n.forEach((e,t)=>{let n=y[t];if(e===n)return;if(!e){i.push([t,void 0]);return}let r=n?.cues.map(e=>e.samples)??[];if(e.animation!==n?.animation){let{animation:n,cues:a,...o}=e,c=a.map(e=>{let t=e.samples?r.indexOf(e.samples):-1;return t===-1?null:t}),l=a.map(({at:e,length:t},n)=>({at:e,length:t,keep:c[n]??null}));i.push([t,{...o,lottie:s(n),cues:l}]),r=c.map(e=>e===null?void 0:r[e])}e.cues.forEach((e,n)=>{if(!e.samples||e.samples===r[n])return;let i=e.samples.slice();o.push(i.buffer),a.push({chapter:t,cue:n,samples:i})})}),y=n;let c={building:r.building,timeline:r.timeline,duration:r.duration,errors:l(r.errors)};e.post({kind:`state`,watch:t,state:c,count:n.length,drawings:i,sounds:a},o)};return t=>{switch(t.kind){case`list`:v.build.list().then(n=>{let r=n._tag===`Left`?{_tag:`Left`,left:l(n.left)}:n;e.post({kind:`listed`,id:t.id,videos:r},[])});return;case`watch`:y=[],v.build.watch(t.name,{changed:e=>{b(t.watch,e)}});return;case`seek`:v.build.seek(t.name,t.place);return;case`halt`:v.halt();return;case`refresh`:v.refresh(t.place);return;case`files`:{let e=u.get(t.id);u.delete(t.id),e?.(t.answer);return}case`narrator`:_.resolve(t.port);return}}}var Z=(e,t=[])=>{self.postMessage(e,{transfer:t})},Q=e=>{let t=u(e,X);Z({kind:`error`,message:t.message,stack:t.stack.map(e=>` ${e}`).join(`
|
|
1
|
+
import{r as e,t}from"../rolldown-runtime-BLXQ4ufn.js";import{a as n,d as r,f as i,g as a,h as o,i as s,l as c,n as l,o as u,p as d,u as f}from"../protocol-C3Pseh4g.js";import{S as p,g as m,v as h,y as g}from"../src-DTLT9Lbm.js";var _=44,v=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,y=new Uint8Array(64),b=new Uint8Array(128);for(let e=0;e<v.length;e++){let t=v.charCodeAt(e);y[e]=t,b[t]=e}function x(e){let t=0,n=0,r=0;do r=b[e.next()],t|=(r&31)<<n,n+=5;while(r&32);return t}function S(e){return e&1?-0x80000000|-(e>>>1):e>>>1}function C(e,t){return e.pos>=t?!1:e.peek()!==_}var ee=class{constructor(e){this.pos=0,this.buffer=e}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(e){let{buffer:t,pos:n}=this,r=t.indexOf(e,n);return r===-1?t.length:r}};function te(e){let{length:t}=e,n=new ee(e),r=[],i=0,a=0,o=0,s=0,c=0;do{let e=n.indexOf(`;`),t=[],l=!0,u=0;for(i=0;n.pos<e;){let r;i+=S(x(n)),i<u&&(l=!1),u=i,C(n,e)?(a+=S(x(n)),o+=S(x(n)),s+=S(x(n)),C(n,e)?(c+=S(x(n)),r=[i,a,o,s,c]):r=[i,a,o,s]):r=[i],t.push(r),n.pos++}l||w(t),r.push(t),n.pos=e+1}while(n.pos<=t);return r}function w(e){e.sort(T)}function T(e,t){return e[0]-t[0]}var E=e(t(((e,t,n)=>{var r;(function(n,i){typeof e==`object`&&t!==void 0?t.exports=i():typeof r==`function`&&r.amd?r(i):(n=typeof globalThis<`u`?globalThis:n||self,n.resolveURI=i())})(n,(function(){let e=/^[\w+.-]+:\/\//,t=/^([\w+.-]+:)\/\/([^@/#?]*@)?(\[[^\]]+\]|[^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,n=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;function r(t){return e.test(t)}function i(e){return e.startsWith(`//`)}function a(e){return e.startsWith(`/`)}function o(e){return e.startsWith(`file:`)}function s(e){return/^[.?#]/.test(e)}function c(e){let n=t.exec(e);return u(n[1],n[2]||``,n[3],n[4]||``,n[5]||`/`,n[6]||``,n[7]||``)}function l(e){let t=n.exec(e),r=t[2];return u(`file:`,``,t[1]||``,``,a(r)?r:`/`+r,t[3]||``,t[4]||``)}function u(e,t,n,r,i,a,o){return{scheme:e,user:t,host:n,port:r,path:i,query:a,hash:o,type:7}}function d(e){if(i(e)){let t=c(`http:`+e);return t.scheme=``,t.type=6,t}if(a(e)){let t=c(`http://foo.com`+e);return t.scheme=``,t.host=``,t.type=5,t}if(o(e))return l(e);if(r(e))return c(e);let t=c(`http://foo.com/`+e);return t.scheme=``,t.host=``,t.type=e?e.startsWith(`?`)?3:e.startsWith(`#`)?2:4:1,t}function f(e){if(e.endsWith(`/..`))return e;let t=e.lastIndexOf(`/`);return e.slice(0,t+1)}function p(e,t){m(t,t.type),e.path=e.path===`/`?t.path:f(t.path)+e.path}function m(e,t){let n=t<=4,r=e.path.split(`/`),i=1,a=0,o=!1;for(let e=1;e<r.length;e++){let t=r[e];t?(o=!1,t!==`.`&&(t===`..`?a?(o=!0,a--,i--):n&&(r[i++]=t):(r[i++]=t,a++))):o=!0}let s=``;for(let e=1;e<i;e++)s+=`/`+r[e];(!s||o&&!s.endsWith(`/..`))&&(s+=`/`),e.path=s}function h(e,t){if(!e&&!t)return``;let n=d(e),r=n.type;if(t&&r!==7){let e=d(t),i=e.type;switch(r){case 1:n.hash=e.hash;case 2:n.query=e.query;case 3:case 4:p(n,e);case 5:n.user=e.user,n.host=e.host,n.port=e.port;case 6:n.scheme=e.scheme}i>r&&(r=i)}m(n,r);let i=n.query+n.hash;switch(r){case 2:case 3:return i;case 4:{let r=n.path.slice(1);return r?s(t||e)&&!s(r)?`./`+r+i:r+i:i||`.`}case 5:return n.path+i;default:return n.scheme+`//`+n.user+n.host+n.port+n.path+i}}return h}))}))(),1);function D(e){if(!e)return``;let t=e.lastIndexOf(`/`);return e.slice(0,t+1)}function O(e,t){let n=D(e),r=t?t+`/`:``;return e=>(0,E.default)(r+(e||``),n)}var k=0,ne=1,re=2,ie=3,A=4;function j(e,t){let n=M(e,0);if(n===e.length)return e;t||(e=e.slice());for(let r=n;r<e.length;r=M(e,r+1))e[r]=P(e[r],t);return e}function M(e,t){for(let n=t;n<e.length;n++)if(!N(e[n]))return n;return e.length}function N(e){for(let t=1;t<e.length;t++)if(e[t][k]<e[t-1][k])return!1;return!0}function P(e,t){return t||(e=e.slice()),e.sort(F)}function F(e,t){return e[k]-t[k]}var I=!1;function L(e,t,n,r){for(;n<=r;){let i=n+(r-n>>1),a=e[i][k]-t;if(a===0)return I=!0,i;a<0?n=i+1:r=i-1}return I=!1,n-1}function R(e,t,n){for(let r=n+1;r<e.length&&e[r][k]===t;n=r++);return n}function z(e,t,n){for(let r=n-1;r>=0&&e[r][k]===t;n=r--);return n}function B(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function V(e,t,n,r){let{lastKey:i,lastNeedle:a,lastIndex:o}=n,s=0,c=e.length-1;if(r===i){if(t===a)return I=o!==-1&&e[o][k]===t,o;t>=a?s=o===-1?0:o:c=o}return n.lastKey=r,n.lastNeedle=t,n.lastIndex=L(e,t,s,c)}function H(e){return typeof e==`string`?JSON.parse(e):e}var U="`line` must be greater than 0 (lines start at line 1)",W="`column` must be greater than or equal to 0 (columns start at column 0)",ae=class{constructor(e,t){let n=typeof e==`string`;if(!n&&e._decodedMemo)return e;let r=H(e),{version:i,file:a,names:o,sourceRoot:s,sources:c,sourcesContent:l}=r;this.version=i,this.file=a,this.names=o||[],this.sourceRoot=s,this.sources=c,this.sourcesContent=l,this.ignoreList=r.ignoreList||r.x_google_ignoreList||void 0;let u=O(t,s);this.resolvedSources=c.map(u);let{mappings:d}=r;if(typeof d==`string`)this._encoded=d,this._decoded=void 0;else if(Array.isArray(d))this._encoded=void 0,this._decoded=j(d,n);else if(r.sections)throw Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`);else throw Error(`invalid source map: ${JSON.stringify(r)}`);this._decodedMemo=B(),this._bySources=void 0,this._bySourceMemos=void 0}};function G(e){return e}function K(e){var t;return(t=G(e))._decoded||(t._decoded=te(G(e)._encoded))}function q(e,t){let{line:n,column:r,bias:i}=t;if(n--,n<0)throw Error(U);if(r<0)throw Error(W);let a=K(e);if(n>=a.length)return J(null,null,null,null);let o=a[n],s=oe(o,G(e)._decodedMemo,n,r,i||1);if(s===-1)return J(null,null,null,null);let c=o[s];if(c.length===1)return J(null,null,null,null);let{names:l,resolvedSources:u}=e;return J(u[c[ne]],c[re]+1,c[ie],c.length===5?l[c[A]]:null)}function J(e,t,n,r){return{source:e,line:t,column:n,name:r}}function oe(e,t,n,r,i){let a=V(e,r,t,n);return I?a=(i===-1?R:z)(e,r,a):i===-1&&a++,a===-1||a===e.length?-1:a}var Y=new Map;function se(e,t,n){Y.set(e,{map:new ae(t),prefix:n})}function ce(e,t,n){let r=Y.get(e);if(!r)return{file:e,line:t,column:n};let i=q(r.map,{line:t,column:n-1});return i.source===null||i.line===null||i.column===null?{file:e,line:t,column:n}:{file:i.source.startsWith(r.prefix)?i.source.slice(r.prefix.length):i.source,line:i.line,column:i.column+1}}var X=a(ce);function le(e){let t=0,r=new Map;e.then(e=>{e.addEventListener(`message`,t=>{let i=t.data;if(i.kind===`error`)throw e.close(),new n(`the narrator stopped: ${i.message}`,i.stack);let a=r.get(i.id);r.delete(i.id),a?.(i)}),e.start()});let i=async(n,i)=>{let a=await e;return new Promise(e=>{let o=t++;r.set(o,e),a.postMessage({id:o,kind:n,words:i})})};return{speak:async e=>{let t=await i(`speak`,e);if(t.kind!==`speech`)throw Error(`the narrator answered ${t.kind} to a speech`);return{samples:t.samples,sampleRate:t.sampleRate,words:t.words}},time:async e=>{let t=await i(`time`,e);if(t.kind!==`timing`)throw Error(`the narrator answered ${t.kind} to a clock`);return{samples:t.samples,sampleRate:t.sampleRate,words:t.words}}}}function ue(e){let t=0,n=0,a=!1,u=new Map,d=n=>{let r=r=>{let i=t++,{promise:a,resolve:o}=Promise.withResolvers();return u.set(i,o),e.post({kind:`files`,id:i,tree:n,question:r},[]),a};return{bundle:async()=>{let e=await r({kind:`bundle`});if(e.kind!==`bundle`)throw Error(`the page answered ${e.kind} to a question of the bundle`);return e.result},name:async()=>{let e=await r({kind:`name`});if(e.kind!==`name`)throw Error(`the page answered ${e.kind} to a question of the name`);return e.name},read:async e=>{let t=await r({kind:`read`,path:e});if(t.kind!==`read`)throw Error(`the page answered ${t.kind} to a read of ${e}`);return t.text},bytes:async e=>{let t=await r({kind:`bytes`,path:e});if(t.kind!==`bytes`)throw Error(`the page answered ${t.kind} to a read of the bytes of ${e}`);return t.bytes},list:async e=>{let t=await r({kind:`list`,folder:e});if(t.kind!==`list`)throw Error(`the page answered ${t.kind} to a list of ${e}`);return t.names}}},p=async()=>{let t=d(n++),o=new Map,s=new Set,c=e=>{let t=o.get(e);return t===void 0&&s.add(e),t?{size:t.length,read:()=>t}:void 0},[l]=await Promise.all([t.bundle(),g().then(async()=>{await h(),e.post({kind:`stage`,stage:`engine`},[])})]),u;if(l!==null){if(l._tag===`Left`)return e.post({kind:`stage`,stage:`project`},[]),l;u=await f(l.right,i(X,c),e.modules,e.player)}else{let n=await t.name();if(n===null)return e.post({kind:`stage`,stage:`project`},[]),{_tag:`Right`,right:[]};let a={name:()=>Promise.resolve(n),read:t.read,list:t.list},o=await e.bundler();u=await r(a,i(X,c),e.modules,o,e.player)}if(e.post({kind:`stage`,stage:`project`},[]),u._tag===`Left`)return u;a||(a=!0,e.post({kind:`narrator`},[]));let p=async e=>{for(;;){s.clear();let n=e(),r=[...s].filter(e=>!o.has(e));if(r.length===0)return n;await Promise.all(r.map(async e=>o.set(e,await t.bytes(e))))}};return{_tag:`Right`,right:u.right.map(e=>{let t=new Set;return{...e,readScript:async()=>(await m(),p(()=>e.script())),readChapter:async n=>{t.has(n)||(await m(),await p(()=>e.walk?.(n)),t.add(n))}}})}},_=Promise.withResolvers(),v=o(c.create({voice:le(_.promise),workspace:{projects:p}})),y=[],b=(t,{chapters:n,...r})=>{let i=[],a=[],o=[];n.forEach((e,t)=>{let n=y[t];if(e===n)return;if(!e){i.push([t,void 0]);return}let r=n?.cues.map(e=>e.samples)??[];if(e.animation!==n?.animation){let{animation:n,cues:a,...o}=e,c=a.map(e=>{let t=e.samples?r.indexOf(e.samples):-1;return t===-1?null:t}),l=a.map(({at:e,length:t},n)=>({at:e,length:t,keep:c[n]??null}));i.push([t,{...o,lottie:s(n),cues:l}]),r=c.map(e=>e===null?void 0:r[e])}e.cues.forEach((e,n)=>{if(!e.samples||e.samples===r[n])return;let i=e.samples.slice();o.push(i.buffer),a.push({chapter:t,cue:n,samples:i})})}),y=n;let c={building:r.building,timeline:r.timeline,duration:r.duration,errors:l(r.errors)};e.post({kind:`state`,watch:t,state:c,count:n.length,drawings:i,sounds:a},o)};return t=>{switch(t.kind){case`list`:v.build.list().then(n=>{let r=n._tag===`Left`?{_tag:`Left`,left:l(n.left)}:n;e.post({kind:`listed`,id:t.id,videos:r},[])});return;case`watch`:y=[],v.build.watch(t.name,{changed:e=>{b(t.watch,e)}});return;case`seek`:v.build.seek(t.name,t.place);return;case`halt`:v.halt();return;case`refresh`:v.refresh(t.place);return;case`files`:{let e=u.get(t.id);u.delete(t.id),e?.(t.answer);return}case`narrator`:_.resolve(t.port);return}}}var Z=(e,t=[])=>{self.postMessage(e,{transfer:t})},Q=e=>{let t=u(e,X);Z({kind:`error`,message:t.message,stack:t.stack.map(e=>` ${e}`).join(`
|
|
2
2
|
`)})};self.addEventListener(`error`,e=>{e.preventDefault(),Q(e.error??Error(e.message))}),self.addEventListener(`unhandledrejection`,e=>{e.preventDefault(),Q(e.reason)});var de={"@beff/aula":new URL(`./aula.js`,import.meta.url).href,"@beff/aula-method":new URL(`./aula-method.js`,import.meta.url).href},fe={load:async({code:e,map:t})=>{let n=URL.createObjectURL(new Blob([e],{type:`text/javascript`}));return se(n,t,d),{url:n,exports:await import(n)}}},$=null;function pe(){return $??=(async()=>{let t=performance.now(),[n,r]=await Promise.all([p(()=>import(`../browser-sNTR4ahh.js`).then(t=>e(t.default,1)),[]),p(()=>import(`../esbuild-D6hmBtXM.js`),[])]);return await n.initialize({wasmURL:r.default,worker:!1}),console.log(`aula: esbuild loaded in ${((performance.now()-t)/1e3).toFixed(1)} s`),n})(),$}var me=ue({post:Z,bundler:pe,modules:fe,player:de});self.addEventListener(`message`,e=>{me(e.data)});
|