@cuemath/leap 3.1.41-as6 → 3.1.41-as8
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.
|
@@ -6206,19 +6206,20 @@ Polypad API v4.5.4, (c) Mathigon
|
|
|
6206
6206
|
|
|
6207
6207
|
window.addEventListener('online', $g);
|
|
6208
6208
|
window.onbeforeunload = Rh;
|
|
6209
|
+
// AUDIO NEUTRALIZED
|
|
6209
6210
|
let be = class {
|
|
6210
6211
|
constructor(e, s = 1, t = !0) {
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
this.player.play();
|
|
6212
|
+
// Don't actually create Audio elements
|
|
6213
|
+
this.src = null;
|
|
6214
|
+
this.defaultVolume = s;
|
|
6215
|
+
this.player = {
|
|
6216
|
+
currentTime: 0,
|
|
6217
|
+
volume: 0,
|
|
6218
|
+
play: () => Promise.resolve(),
|
|
6219
|
+
preload: 'none'
|
|
6220
|
+
};
|
|
6221
6221
|
}
|
|
6222
|
+
play(e) {}
|
|
6222
6223
|
},
|
|
6223
6224
|
Pg = _c(['#cd0e66', '#0f82f2', '#22ab24', '#fd8c00']),
|
|
6224
6225
|
Tg = class {
|
|
@@ -6740,7 +6741,8 @@ Polypad API v4.5.4, (c) Mathigon
|
|
|
6740
6741
|
ll.set(e, t), Gh.set(e.toUpperCase(), s), window.customElements.define(e, i);
|
|
6741
6742
|
};
|
|
6742
6743
|
}
|
|
6743
|
-
|
|
6744
|
+
// AUDIO FETCH NEUTRALIZED
|
|
6745
|
+
let Tt = { currentTime: 0, createGain: () => ({ gain: { setValueAtTime: () => {}, linearRampToValueAtTime: () => {} }, connect: () => ({ connect: () => ({}) }) }), createBufferSource: () => ({ buffer: null, playbackRate: { value: 0 }, connect: () => ({}), start: () => {} }), createOscillator: () => ({ frequency: { setValueAtTime: () => {} }, connect: () => ({}), start: () => {}, stop: () => {} }), createDynamicsCompressor: () => ({ threshold: { setValueAtTime: () => {} }, knee: { setValueAtTime: () => {} }, ratio: { setValueAtTime: () => {} }, attack: { setValueAtTime: () => {} }, release: { setValueAtTime: () => {} }, connect: () => ({}) }), createConvolver: () => ({ buffer: null, connect: () => ({}) }), decodeAudioData: () => Promise.resolve({ duration: 1 }) },
|
|
6744
6746
|
Uo,
|
|
6745
6747
|
ds,
|
|
6746
6748
|
us = 0.05,
|
|
@@ -6752,31 +6754,23 @@ Polypad API v4.5.4, (c) Mathigon
|
|
|
6752
6754
|
function Vg() {
|
|
6753
6755
|
return H(this, null, function* () {
|
|
6754
6756
|
if (_h) return;
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
ds.ratio.setValueAtTime(10, 0),
|
|
6760
|
-
ds.attack.setValueAtTime(0.1, 0),
|
|
6761
|
-
ds.release.setValueAtTime(0.25, 0),
|
|
6762
|
-
(Uo = Tt.createConvolver());
|
|
6763
|
-
const s = yield (yield fetch(`${Hh}IR13.mp3`)).arrayBuffer();
|
|
6764
|
-
|
|
6765
|
-
Uo.buffer = yield Tt.decodeAudioData(s);
|
|
6757
|
+
_h = !0;
|
|
6758
|
+
// Audio initialization is disabled and structure is maintained
|
|
6759
|
+
ds = { connect: () => ({ connect: () => ({ connect: () => ({}) }) }) };
|
|
6760
|
+
Uo = { buffer: null, connect: () => ({ connect: () => ({}) }) };
|
|
6766
6761
|
});
|
|
6767
6762
|
}
|
|
6768
6763
|
function jo(e) {
|
|
6769
6764
|
if (!e || e === 'synth' || cl.has(e)) return;
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
.then(t => Tt.decodeAudioData(t))
|
|
6774
|
-
.then(t => Fh.set(e, t))
|
|
6775
|
-
.catch(() => console.error('Unable to load sample for', e));
|
|
6776
|
-
|
|
6765
|
+
|
|
6766
|
+
// No audio samples are fetched and create a resolved promise
|
|
6767
|
+
const s = Promise.resolve();
|
|
6777
6768
|
cl.set(e, s);
|
|
6769
|
+
|
|
6770
|
+
Fh.set(e, { duration: 1 });
|
|
6778
6771
|
}
|
|
6779
|
-
|
|
6772
|
+
|
|
6773
|
+
const rr = () => 0,
|
|
6780
6774
|
qh = [
|
|
6781
6775
|
{
|
|
6782
6776
|
key: 'piano',
|
|
@@ -6931,19 +6925,14 @@ Polypad API v4.5.4, (c) Mathigon
|
|
|
6931
6925
|
return t + 12 * i;
|
|
6932
6926
|
}
|
|
6933
6927
|
function Uh(e, s, t) {
|
|
6934
|
-
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
|
|
6939
|
-
|
|
6940
|
-
|
|
6941
|
-
|
|
6942
|
-
i.gain.linearRampToValueAtTime(s * 0.8, (r += t[1])),
|
|
6943
|
-
i.gain.setValueAtTime(s * 0.8, (r += t[2])),
|
|
6944
|
-
i.gain.linearRampToValueAtTime(1e-5, r + t[3]),
|
|
6945
|
-
i
|
|
6946
|
-
);
|
|
6928
|
+
// Return a mock audio gain node but doesn't actually create any audio connections or processing
|
|
6929
|
+
return {
|
|
6930
|
+
gain: {
|
|
6931
|
+
setValueAtTime: () => {},
|
|
6932
|
+
linearRampToValueAtTime: () => {}
|
|
6933
|
+
},
|
|
6934
|
+
connect: () => ({ connect: () => ({ connect: () => ({}) }) })
|
|
6935
|
+
};
|
|
6947
6936
|
}
|
|
6948
6937
|
function Zo(e, s = 'piano') {
|
|
6949
6938
|
if (e === void 0) return 0;
|
|
@@ -6955,19 +6944,16 @@ Polypad API v4.5.4, (c) Mathigon
|
|
|
6955
6944
|
return 2 ** ((e + 1) / 12 + t) || 0;
|
|
6956
6945
|
}
|
|
6957
6946
|
function Og(e, s, t, i, r) {
|
|
6958
|
-
const o = Fh.get(e);
|
|
6959
|
-
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
const n = Uh(t, i, r),
|
|
6963
|
-
a = Tt.createBufferSource(),
|
|
6947
|
+
const o = Fh.get(e) || { duration: 1 };
|
|
6948
|
+
|
|
6949
|
+
const n = { gain: { value: 0 } },
|
|
6950
|
+
a = { buffer: o, playbackRate: { value: 0 }, connect: () => {}, start: () => {} },
|
|
6964
6951
|
l = Zo(s, e);
|
|
6965
|
-
|
|
6966
|
-
|
|
6967
|
-
|
|
6968
|
-
|
|
6969
|
-
|
|
6970
|
-
f = r[2] / 0.6,
|
|
6952
|
+
|
|
6953
|
+
const c = [],
|
|
6954
|
+
p = 1,
|
|
6955
|
+
u = 0.8,
|
|
6956
|
+
f = 1,
|
|
6971
6957
|
v = f / u;
|
|
6972
6958
|
|
|
6973
6959
|
if (f > 1.1 && !Dg.has(e))
|
|
@@ -7023,7 +7009,7 @@ Polypad API v4.5.4, (c) Mathigon
|
|
|
7023
7009
|
);
|
|
7024
7010
|
}
|
|
7025
7011
|
function Zh(e = 0, s = 'piano', t = 1, i = 0.8, r = Tt.currentTime + us, o = 2, n = 8) {
|
|
7026
|
-
Vg();
|
|
7012
|
+
// Vg();
|
|
7027
7013
|
const a = Math.min(1, i),
|
|
7028
7014
|
l = [0.02, a * 0.1, i - a * 0.4, a * 0.3];
|
|
7029
7015
|
|
|
@@ -16890,18 +16876,19 @@ Polypad API v4.5.4, (c) Mathigon
|
|
|
16890
16876
|
};
|
|
16891
16877
|
const Ve = 'https://mathigon.org/polypad/assets/audio',
|
|
16892
16878
|
dd = {
|
|
16893
|
-
|
|
16894
|
-
|
|
16895
|
-
|
|
16896
|
-
|
|
16897
|
-
|
|
16898
|
-
|
|
16899
|
-
|
|
16900
|
-
|
|
16901
|
-
|
|
16902
|
-
|
|
16903
|
-
|
|
16904
|
-
|
|
16879
|
+
// Using mock audio objects that don't fetch anything
|
|
16880
|
+
roll: { play: () => {} },
|
|
16881
|
+
spin: { play: () => {} },
|
|
16882
|
+
coinToss: { play: () => {} },
|
|
16883
|
+
shuffle: { play: () => {} },
|
|
16884
|
+
rng: { play: () => {} },
|
|
16885
|
+
draw: { play: () => {} },
|
|
16886
|
+
click: { play: () => {} },
|
|
16887
|
+
woosh: { play: () => {} },
|
|
16888
|
+
rise: { play: () => {} },
|
|
16889
|
+
fall: { play: () => {} },
|
|
16890
|
+
splitCoins: { play: () => {} },
|
|
16891
|
+
mergeCoins: { play: () => {} },
|
|
16905
16892
|
};
|
|
16906
16893
|
const is = 25,
|
|
16907
16894
|
tc = (is * Math.sqrt(3)) / 2,
|