@orbit-software/sdk 1.10.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/esm/Overlay.d.ts +2 -0
- package/dist/esm/app/helpers.d.ts +2 -0
- package/dist/esm/app/ui/assets/IconBack.d.ts +1 -0
- package/dist/esm/app/ui/assets/IconClosePlain.d.ts +3 -0
- package/dist/esm/app/ui/components/AvatarProgress.d.ts +13 -0
- package/dist/esm/app/ui/components/ClosableModal.d.ts +11 -0
- package/dist/esm/app/ui/components/IconBalance.d.ts +3 -0
- package/dist/esm/app/ui/components/InputSwitch.d.ts +9 -0
- package/dist/esm/app/ui/components/Inventory/Inventory.d.ts +2 -0
- package/dist/esm/app/ui/components/Inventory/context.d.ts +10 -0
- package/dist/esm/app/ui/components/XsButton.d.ts +6 -0
- package/dist/esm/app/ui/hooks/useAnimateNumber.d.ts +1 -0
- package/dist/esm/app/utils.d.ts +2 -0
- package/dist/esm/boolean-D78EXBUO.mjs +1986 -0
- package/dist/esm/bootstrap.d.ts +1 -0
- package/dist/esm/features/profile/assets/IconAd.d.ts +1 -0
- package/dist/esm/features/profile/assets/IconAddCircle.d.ts +1 -0
- package/dist/esm/features/profile/assets/IconCurrencyStar.d.ts +3 -0
- package/dist/esm/features/profile/assets/IconDrag.d.ts +2 -0
- package/dist/esm/features/profile/assets/IconEdit.d.ts +2 -0
- package/dist/esm/features/profile/assets/IconGame.d.ts +2 -0
- package/dist/esm/features/profile/assets/IconNoSign.d.ts +1 -0
- package/dist/esm/features/profile/assets/IconProfile.d.ts +1 -0
- package/dist/esm/features/profile/assets/moneyTongue.json.d.ts +3 -0
- package/dist/esm/features/profile/assets/newspaper.json.d.ts +3 -0
- package/dist/esm/features/profile/assets/profileBgGradients.d.ts +6 -0
- package/dist/esm/features/profile/components/Avatars.d.ts +8 -0
- package/dist/esm/features/profile/components/BalanceConfetti.d.ts +6 -0
- package/dist/esm/features/profile/components/BuyMenu.d.ts +8 -0
- package/dist/esm/features/profile/components/CircleParticles.d.ts +10 -0
- package/dist/esm/features/profile/components/FormattedXP.d.ts +8 -0
- package/dist/esm/features/profile/components/LevelInfoModal.d.ts +9 -0
- package/dist/esm/features/profile/components/ModalContainer.d.ts +6 -0
- package/dist/esm/features/profile/components/OverlayProfile.d.ts +8 -0
- package/dist/esm/features/profile/components/Profile.d.ts +3 -0
- package/dist/esm/features/profile/components/PurchaseConfirm.d.ts +9 -0
- package/dist/esm/features/profile/components/Ribbon.d.ts +6 -0
- package/dist/esm/features/profile/components/StarParticles.d.ts +10 -0
- package/dist/esm/features/profile/components/TaskCard.d.ts +21 -0
- package/dist/esm/features/profile/components/XpProgress.d.ts +14 -0
- package/dist/esm/features/profile/hooks/useAnimatedProfile.d.ts +5 -0
- package/dist/esm/gaussian-splat-compression-CzzkTP3L.mjs +1632 -0
- package/dist/esm/hooks/useForceRerender.d.ts +1 -0
- package/dist/esm/hooks/useMiniApp.d.ts +3 -0
- package/dist/esm/howler-Mh6LB0k5.mjs +572 -0
- package/dist/esm/i18n/index.d.ts +2 -0
- package/dist/esm/i18n/locales/translations/en.json.d.ts +213 -0
- package/dist/esm/i18n/locales/translations/ru.json.d.ts +210 -0
- package/dist/esm/launcherSrc/App.d.ts +2 -0
- package/dist/esm/launcherSrc/api/client.d.ts +3 -0
- package/dist/esm/launcherSrc/api/types.d.ts +181 -0
- package/dist/esm/launcherSrc/api/userApi.d.ts +22 -0
- package/dist/esm/launcherSrc/app/components/DebugConsole.d.ts +2 -0
- package/dist/esm/launcherSrc/app/contexts/SnackbarContext.d.ts +18 -0
- package/dist/esm/launcherSrc/app/helpers.d.ts +5 -0
- package/dist/esm/launcherSrc/app/hooks/forceRerender.d.ts +1 -0
- package/dist/esm/launcherSrc/app/hooks/useMainButtonControl.d.ts +7 -0
- package/dist/esm/launcherSrc/app/hooks/useMiniApp.d.ts +3 -0
- package/dist/esm/launcherSrc/app/hooks.d.ts +11 -0
- package/dist/esm/launcherSrc/app/store.d.ts +19 -0
- package/dist/esm/launcherSrc/app/ui/assets/IconBack.d.ts +1 -0
- package/dist/esm/launcherSrc/app/ui/assets/IconCheck.d.ts +2 -0
- package/dist/esm/launcherSrc/app/ui/assets/IconCheckThin.d.ts +2 -0
- package/dist/esm/launcherSrc/app/ui/assets/IconCross.d.ts +2 -0
- package/dist/esm/launcherSrc/app/ui/assets/IconSearch.d.ts +2 -0
- package/dist/esm/launcherSrc/app/ui/components/AvatarProgress.d.ts +13 -0
- package/dist/esm/launcherSrc/app/ui/components/ClosableModal.d.ts +10 -0
- package/dist/esm/launcherSrc/app/ui/components/FormattedXP.d.ts +8 -0
- package/dist/esm/launcherSrc/app/ui/components/IconBalance.d.ts +3 -0
- package/dist/esm/launcherSrc/app/ui/components/InputSwitch.d.ts +9 -0
- package/dist/esm/launcherSrc/app/ui/components/Twemoji.d.ts +8 -0
- package/dist/esm/launcherSrc/app/ui/components/UICell.d.ts +16 -0
- package/dist/esm/launcherSrc/app/ui/components/UIDateInput.d.ts +21 -0
- package/dist/esm/launcherSrc/app/ui/components/UIDivider.d.ts +4 -0
- package/dist/esm/launcherSrc/app/ui/components/UIEmoji.d.ts +8 -0
- package/dist/esm/launcherSrc/app/ui/components/UIHero.d.ts +10 -0
- package/dist/esm/launcherSrc/app/ui/components/UISection.d.ts +9 -0
- package/dist/esm/launcherSrc/app/ui/components/UITextarea.d.ts +7 -0
- package/dist/esm/launcherSrc/app/ui/components/XpProgress.d.ts +13 -0
- package/dist/esm/launcherSrc/app/ui/components/XsButton.d.ts +6 -0
- package/dist/esm/launcherSrc/app/ui/hooks/useAnimateNumber.d.ts +1 -0
- package/dist/esm/launcherSrc/app/utils.d.ts +13 -0
- package/dist/esm/launcherSrc/assets/Icon28Edit.d.ts +2 -0
- package/dist/esm/launcherSrc/assets/Icon28Game.d.ts +1 -0
- package/dist/esm/launcherSrc/assets/Icon28Link.d.ts +1 -0
- package/dist/esm/launcherSrc/features/admin/components/Admin.d.ts +3 -0
- package/dist/esm/launcherSrc/features/admin/components/OverlayControl.d.ts +2 -0
- package/dist/esm/launcherSrc/features/games/assets/IconFilter.d.ts +1 -0
- package/dist/esm/launcherSrc/features/games/assets/IconPlayers.d.ts +2 -0
- package/dist/esm/launcherSrc/features/games/assets/IconQuestion.d.ts +2 -0
- package/dist/esm/launcherSrc/features/games/assets/IconQuestionCircle.d.ts +2 -0
- package/dist/esm/launcherSrc/features/games/assets/IconStar.d.ts +4 -0
- package/dist/esm/launcherSrc/features/games/assets/IconThumbsDownFilled.d.ts +2 -0
- package/dist/esm/launcherSrc/features/games/assets/IconThumbsDownOutlined.d.ts +2 -0
- package/dist/esm/launcherSrc/features/games/assets/IconThumbsUpFilled.d.ts +2 -0
- package/dist/esm/launcherSrc/features/games/assets/IconThumbsUpOutlined.d.ts +2 -0
- package/dist/esm/launcherSrc/features/games/components/GameItem.d.ts +10 -0
- package/dist/esm/launcherSrc/features/games/components/GamePage/GamePage.d.ts +6 -0
- package/dist/esm/launcherSrc/features/games/components/GamePage/GameReview.d.ts +10 -0
- package/dist/esm/launcherSrc/features/games/components/GamePage/GameReviews.d.ts +9 -0
- package/dist/esm/launcherSrc/features/games/components/Games.d.ts +3 -0
- package/dist/esm/launcherSrc/features/games/components/ResetStorageButton.d.ts +3 -0
- package/dist/esm/launcherSrc/features/games/components/ReviewModal.d.ts +10 -0
- package/dist/esm/launcherSrc/features/games/hooks/useGamesData.d.ts +13 -0
- package/dist/esm/launcherSrc/features/games/redux/gamesSlice.d.ts +34 -0
- package/dist/esm/launcherSrc/features/games/service/gamesService.d.ts +3 -0
- package/dist/esm/launcherSrc/features/leaderboard/components/Rating.d.ts +1 -0
- package/dist/esm/launcherSrc/features/leaderboard/components/RatingCard/RatingCard.d.ts +10 -0
- package/dist/esm/launcherSrc/features/leaderboard/components/RatingInfo/RatingInfo.d.ts +1 -0
- package/dist/esm/launcherSrc/features/leaderboard/components/RatingLevel/IconWreaths.d.ts +3 -0
- package/dist/esm/launcherSrc/features/leaderboard/components/RatingLevel/RatingLevel.d.ts +6 -0
- package/dist/esm/launcherSrc/features/leaderboard/components/RatingLevel/lock.d.ts +3 -0
- package/dist/esm/launcherSrc/features/leaderboard/hooks/useLeaderboardData.d.ts +10 -0
- package/dist/esm/launcherSrc/features/leaderboard/index.d.ts +1 -0
- package/dist/esm/launcherSrc/features/leaderboard/redux/leaderboardSlice.d.ts +18 -0
- package/dist/esm/launcherSrc/features/leaderboard/services/leaderboardService.d.ts +2 -0
- package/dist/esm/launcherSrc/features/navigation/assets/IconGame.d.ts +1 -0
- package/dist/esm/launcherSrc/features/navigation/assets/IconProfile.d.ts +1 -0
- package/dist/esm/launcherSrc/features/navigation/assets/IconSmile.d.ts +2 -0
- package/dist/esm/launcherSrc/features/navigation/components/FloatingProfile.d.ts +2 -0
- package/dist/esm/launcherSrc/features/navigation/components/IconWithCounter.d.ts +7 -0
- package/dist/esm/launcherSrc/features/navigation/redux/navigationSlice.d.ts +15 -0
- package/dist/esm/launcherSrc/features/navigation/redux/tabsSlice.d.ts +12 -0
- package/dist/esm/launcherSrc/features/profile/assets/IconAd.d.ts +1 -0
- package/dist/esm/launcherSrc/features/profile/assets/IconAddCircle.d.ts +1 -0
- package/dist/esm/launcherSrc/features/profile/assets/IconChevronRight.d.ts +2 -0
- package/dist/esm/launcherSrc/features/profile/assets/IconColorPicker.d.ts +1 -0
- package/dist/esm/launcherSrc/features/profile/assets/IconCurrencyStar.d.ts +3 -0
- package/dist/esm/launcherSrc/features/profile/assets/IconGlobe.d.ts +2 -0
- package/dist/esm/launcherSrc/features/profile/assets/IconLock.d.ts +2 -0
- package/dist/esm/launcherSrc/features/profile/assets/IconNoSign.d.ts +1 -0
- package/dist/esm/launcherSrc/features/profile/assets/IconSignature.d.ts +5 -0
- package/dist/esm/launcherSrc/features/profile/assets/profileBgGradients.d.ts +50 -0
- package/dist/esm/launcherSrc/features/profile/components/AdsFree/BuyAdsFreeButton.d.ts +3 -0
- package/dist/esm/launcherSrc/features/profile/components/AdsFree/PurchaseAdsFree.d.ts +9 -0
- package/dist/esm/launcherSrc/features/profile/components/Avatars/AvatarCreation.d.ts +2 -0
- package/dist/esm/launcherSrc/features/profile/components/Avatars/Avatars.d.ts +11 -0
- package/dist/esm/launcherSrc/features/profile/components/Avatars/EditAvatarButton.d.ts +1 -0
- package/dist/esm/launcherSrc/features/profile/components/Balance/ProfileBalance.d.ts +6 -0
- package/dist/esm/launcherSrc/features/profile/components/Balance/TopUpModal/BuyMenu.d.ts +8 -0
- package/dist/esm/launcherSrc/features/profile/components/Balance/TopUpModal/BuyOption.d.ts +10 -0
- package/dist/esm/launcherSrc/features/profile/components/Balance/TopUpModal/Ribbon.d.ts +6 -0
- package/dist/esm/launcherSrc/features/profile/components/BoxOpeningModal.d.ts +3 -0
- package/dist/esm/launcherSrc/features/profile/components/DailyModal.d.ts +3 -0
- package/dist/esm/launcherSrc/features/profile/components/FIllProfile/FIllBirthdate.d.ts +3 -0
- package/dist/esm/launcherSrc/features/profile/components/FIllProfile/FillCountry.d.ts +3 -0
- package/dist/esm/launcherSrc/features/profile/components/FIllProfile/FillEmail.d.ts +3 -0
- package/dist/esm/launcherSrc/features/profile/components/FIllProfile/FillProfile.d.ts +3 -0
- package/dist/esm/launcherSrc/features/profile/components/FIllProfile/FillProfileLayout.d.ts +4 -0
- package/dist/esm/launcherSrc/features/profile/components/LevelInfoModal.d.ts +9 -0
- package/dist/esm/launcherSrc/features/profile/components/Profile.d.ts +3 -0
- package/dist/esm/launcherSrc/features/profile/components/ProfileGames.d.ts +6 -0
- package/dist/esm/launcherSrc/features/profile/components/ProfileInventory.d.ts +2 -0
- package/dist/esm/launcherSrc/features/profile/components/ProfileLeaderboard.d.ts +6 -0
- package/dist/esm/launcherSrc/features/profile/components/ProfileReviews.d.ts +6 -0
- package/dist/esm/launcherSrc/features/profile/components/ProfileTrophies.d.ts +2 -0
- package/dist/esm/launcherSrc/features/profile/components/Tasks/TaskCard.d.ts +24 -0
- package/dist/esm/launcherSrc/features/profile/components/Tasks/Tasks.d.ts +2 -0
- package/dist/esm/launcherSrc/features/profile/components/particles/BalanceConfetti.d.ts +6 -0
- package/dist/esm/launcherSrc/features/profile/components/particles/CircleParticles.d.ts +10 -0
- package/dist/esm/launcherSrc/features/profile/components/particles/ConfettiParticles.d.ts +10 -0
- package/dist/esm/launcherSrc/features/profile/components/particles/StarParticles.d.ts +10 -0
- package/dist/esm/launcherSrc/features/profile/contexts/BoxOpeningContext.d.ts +12 -0
- package/dist/esm/launcherSrc/features/profile/data/countries.d.ts +10 -0
- package/dist/esm/launcherSrc/features/profile/hooks/useProfileData.d.ts +26 -0
- package/dist/esm/launcherSrc/features/profile/redux/profileSlice.d.ts +131 -0
- package/dist/esm/launcherSrc/features/profile/redux/shopSlice.d.ts +18 -0
- package/dist/esm/launcherSrc/features/profile/services/buyMenuService.d.ts +1 -0
- package/dist/esm/launcherSrc/features/profile/services/profileService.d.ts +12 -0
- package/dist/esm/launcherSrc/features/profile/services/shopService.d.ts +2 -0
- package/dist/esm/launcherSrc/i18n/index.d.ts +2 -0
- package/dist/esm/launcherSrc/index.d.ts +0 -0
- package/dist/esm/launcherSrc/setupTests.d.ts +0 -0
- package/dist/esm/launcherSrc/utils/openTelegramLinkFixed.d.ts +1 -0
- package/dist/esm/navmesh-BbINhDrO.mjs +1336 -0
- package/dist/esm/opentype-PR7hcvG5.mjs +4286 -0
- package/dist/esm/physics-B9pWoHiG.mjs +4375 -0
- package/dist/esm/process-DGf1Bnd3.mjs +2274 -0
- package/dist/esm/sdk-4y_oRGP7.mjs +76474 -0
- package/dist/esm/sdk.d.ts +130 -0
- package/dist/esm/sdk.mjs +9 -0
- package/dist/esm/sdk.umd.js +8382 -0
- package/dist/esm/stores/profileStore.d.ts +16 -0
- package/dist/esm/ui-C32u2WA-.mjs +2678 -0
- package/dist/esm/utils/global.d.ts +1 -0
- package/dist/umd/sdk.umd.js +8382 -0
- package/dist/umd_react/sdk_react.umd.js +8562 -0
- package/index.html +13 -0
- package/package.json +96 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useForceRerender: () => () => void;
|
|
@@ -0,0 +1,572 @@
|
|
|
1
|
+
import { c as b, g as M } from "./sdk-4y_oRGP7.mjs";
|
|
2
|
+
function R(y, v) {
|
|
3
|
+
for (var d = 0; d < v.length; d++) {
|
|
4
|
+
const f = v[d];
|
|
5
|
+
if (typeof f != "string" && !Array.isArray(f)) {
|
|
6
|
+
for (const c in f)
|
|
7
|
+
if (c !== "default" && !(c in y)) {
|
|
8
|
+
const p = Object.getOwnPropertyDescriptor(f, c);
|
|
9
|
+
p && Object.defineProperty(y, c, p.get ? p : {
|
|
10
|
+
enumerable: !0,
|
|
11
|
+
get: () => f[c]
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return Object.freeze(Object.defineProperty(y, Symbol.toStringTag, { value: "Module" }));
|
|
17
|
+
}
|
|
18
|
+
var x = {};
|
|
19
|
+
/*! howler.js v2.2.3 | (c) 2013-2020, James Simpson of GoldFire Studios | MIT License | howlerjs.com */
|
|
20
|
+
var B;
|
|
21
|
+
function H() {
|
|
22
|
+
return B || (B = 1, function(y) {
|
|
23
|
+
(function() {
|
|
24
|
+
var v = function() {
|
|
25
|
+
this.init();
|
|
26
|
+
};
|
|
27
|
+
v.prototype = { init: function() {
|
|
28
|
+
var e = this || d;
|
|
29
|
+
return e._counter = 1e3, e._html5AudioPool = [], e.html5PoolSize = 10, e._codecs = {}, e._howls = [], e._muted = !1, e._volume = 1, e._canPlayEvent = "canplaythrough", e._navigator = typeof window < "u" && window.navigator ? window.navigator : null, e.masterGain = null, e.noAudio = !1, e.usingWebAudio = !0, e.autoSuspend = !0, e.ctx = null, e.autoUnlock = !0, e._setup(), e;
|
|
30
|
+
}, volume: function(e) {
|
|
31
|
+
var n = this || d;
|
|
32
|
+
if (e = parseFloat(e), n.ctx || A(), e !== void 0 && e >= 0 && e <= 1) {
|
|
33
|
+
if (n._volume = e, n._muted) return n;
|
|
34
|
+
n.usingWebAudio && n.masterGain.gain.setValueAtTime(e, d.ctx.currentTime);
|
|
35
|
+
for (var o = 0; o < n._howls.length; o++) if (!n._howls[o]._webAudio) for (var t = n._howls[o]._getSoundIds(), r = 0; r < t.length; r++) {
|
|
36
|
+
var u = n._howls[o]._soundById(t[r]);
|
|
37
|
+
u && u._node && (u._node.volume = u._volume * e);
|
|
38
|
+
}
|
|
39
|
+
return n;
|
|
40
|
+
}
|
|
41
|
+
return n._volume;
|
|
42
|
+
}, mute: function(e) {
|
|
43
|
+
var n = this || d;
|
|
44
|
+
n.ctx || A(), n._muted = e, n.usingWebAudio && n.masterGain.gain.setValueAtTime(e ? 0 : n._volume, d.ctx.currentTime);
|
|
45
|
+
for (var o = 0; o < n._howls.length; o++) if (!n._howls[o]._webAudio) for (var t = n._howls[o]._getSoundIds(), r = 0; r < t.length; r++) {
|
|
46
|
+
var u = n._howls[o]._soundById(t[r]);
|
|
47
|
+
u && u._node && (u._node.muted = !!e || u._muted);
|
|
48
|
+
}
|
|
49
|
+
return n;
|
|
50
|
+
}, stop: function() {
|
|
51
|
+
for (var e = this || d, n = 0; n < e._howls.length; n++) e._howls[n].stop();
|
|
52
|
+
return e;
|
|
53
|
+
}, unload: function() {
|
|
54
|
+
for (var e = this || d, n = e._howls.length - 1; n >= 0; n--) e._howls[n].unload();
|
|
55
|
+
return e.usingWebAudio && e.ctx && e.ctx.close !== void 0 && (e.ctx.close(), e.ctx = null, A()), e;
|
|
56
|
+
}, codecs: function(e) {
|
|
57
|
+
return (this || d)._codecs[e.replace(/^x-/, "")];
|
|
58
|
+
}, _setup: function() {
|
|
59
|
+
var e = this || d;
|
|
60
|
+
if (e.state = e.ctx && e.ctx.state || "suspended", e._autoSuspend(), !e.usingWebAudio) if (typeof Audio < "u") try {
|
|
61
|
+
var n = new Audio();
|
|
62
|
+
n.oncanplaythrough === void 0 && (e._canPlayEvent = "canplay");
|
|
63
|
+
} catch {
|
|
64
|
+
e.noAudio = !0;
|
|
65
|
+
}
|
|
66
|
+
else e.noAudio = !0;
|
|
67
|
+
try {
|
|
68
|
+
var n = new Audio();
|
|
69
|
+
n.muted && (e.noAudio = !0);
|
|
70
|
+
} catch {
|
|
71
|
+
}
|
|
72
|
+
return e.noAudio || e._setupCodecs(), e;
|
|
73
|
+
}, _setupCodecs: function() {
|
|
74
|
+
var e = this || d, n = null;
|
|
75
|
+
try {
|
|
76
|
+
n = typeof Audio < "u" ? new Audio() : null;
|
|
77
|
+
} catch {
|
|
78
|
+
return e;
|
|
79
|
+
}
|
|
80
|
+
if (!n || typeof n.canPlayType != "function") return e;
|
|
81
|
+
var o = n.canPlayType("audio/mpeg;").replace(/^no$/, ""), t = e._navigator ? e._navigator.userAgent : "", r = t.match(/OPR\/([0-6].)/g), u = r && parseInt(r[0].split("/")[1], 10) < 33, a = t.indexOf("Safari") !== -1 && t.indexOf("Chrome") === -1, i = t.match(/Version\/(.*?) /), _ = a && i && parseInt(i[1], 10) < 15;
|
|
82
|
+
return e._codecs = { mp3: !(u || !o && !n.canPlayType("audio/mp3;").replace(/^no$/, "")), mpeg: !!o, opus: !!n.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/, ""), ogg: !!n.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ""), oga: !!n.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ""), wav: !!(n.canPlayType('audio/wav; codecs="1"') || n.canPlayType("audio/wav")).replace(/^no$/, ""), aac: !!n.canPlayType("audio/aac;").replace(/^no$/, ""), caf: !!n.canPlayType("audio/x-caf;").replace(/^no$/, ""), m4a: !!(n.canPlayType("audio/x-m4a;") || n.canPlayType("audio/m4a;") || n.canPlayType("audio/aac;")).replace(/^no$/, ""), m4b: !!(n.canPlayType("audio/x-m4b;") || n.canPlayType("audio/m4b;") || n.canPlayType("audio/aac;")).replace(/^no$/, ""), mp4: !!(n.canPlayType("audio/x-mp4;") || n.canPlayType("audio/mp4;") || n.canPlayType("audio/aac;")).replace(/^no$/, ""), weba: !(_ || !n.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, "")), webm: !(_ || !n.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, "")), dolby: !!n.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/, ""), flac: !!(n.canPlayType("audio/x-flac;") || n.canPlayType("audio/flac;")).replace(/^no$/, "") }, e;
|
|
83
|
+
}, _unlockAudio: function() {
|
|
84
|
+
var e = this || d;
|
|
85
|
+
if (!e._audioUnlocked && e.ctx) {
|
|
86
|
+
e._audioUnlocked = !1, e.autoUnlock = !1, e._mobileUnloaded || e.ctx.sampleRate === 44100 || (e._mobileUnloaded = !0, e.unload()), e._scratchBuffer = e.ctx.createBuffer(1, 1, 22050);
|
|
87
|
+
var n = function(o) {
|
|
88
|
+
for (; e._html5AudioPool.length < e.html5PoolSize; ) try {
|
|
89
|
+
var t = new Audio();
|
|
90
|
+
t._unlocked = !0, e._releaseHtml5Audio(t);
|
|
91
|
+
} catch {
|
|
92
|
+
e.noAudio = !0;
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
for (var r = 0; r < e._howls.length; r++) if (!e._howls[r]._webAudio) for (var u = e._howls[r]._getSoundIds(), a = 0; a < u.length; a++) {
|
|
96
|
+
var i = e._howls[r]._soundById(u[a]);
|
|
97
|
+
i && i._node && !i._node._unlocked && (i._node._unlocked = !0, i._node.load());
|
|
98
|
+
}
|
|
99
|
+
e._autoResume();
|
|
100
|
+
var _ = e.ctx.createBufferSource();
|
|
101
|
+
_.buffer = e._scratchBuffer, _.connect(e.ctx.destination), _.start === void 0 ? _.noteOn(0) : _.start(0), typeof e.ctx.resume == "function" && e.ctx.resume(), _.onended = function() {
|
|
102
|
+
_.disconnect(0), e._audioUnlocked = !0, document.removeEventListener("touchstart", n, !0), document.removeEventListener("touchend", n, !0), document.removeEventListener("click", n, !0), document.removeEventListener("keydown", n, !0);
|
|
103
|
+
for (var l = 0; l < e._howls.length; l++) e._howls[l]._emit("unlock");
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
return document.addEventListener("touchstart", n, !0), document.addEventListener("touchend", n, !0), document.addEventListener("click", n, !0), document.addEventListener("keydown", n, !0), e;
|
|
107
|
+
}
|
|
108
|
+
}, _obtainHtml5Audio: function() {
|
|
109
|
+
var e = this || d;
|
|
110
|
+
if (e._html5AudioPool.length) return e._html5AudioPool.pop();
|
|
111
|
+
var n = new Audio().play();
|
|
112
|
+
return n && typeof Promise < "u" && (n instanceof Promise || typeof n.then == "function") && n.catch(function() {
|
|
113
|
+
console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.");
|
|
114
|
+
}), new Audio();
|
|
115
|
+
}, _releaseHtml5Audio: function(e) {
|
|
116
|
+
var n = this || d;
|
|
117
|
+
return e._unlocked && n._html5AudioPool.push(e), n;
|
|
118
|
+
}, _autoSuspend: function() {
|
|
119
|
+
var e = this;
|
|
120
|
+
if (e.autoSuspend && e.ctx && e.ctx.suspend !== void 0 && d.usingWebAudio) {
|
|
121
|
+
for (var n = 0; n < e._howls.length; n++) if (e._howls[n]._webAudio) {
|
|
122
|
+
for (var o = 0; o < e._howls[n]._sounds.length; o++) if (!e._howls[n]._sounds[o]._paused) return e;
|
|
123
|
+
}
|
|
124
|
+
return e._suspendTimer && clearTimeout(e._suspendTimer), e._suspendTimer = setTimeout(function() {
|
|
125
|
+
if (e.autoSuspend) {
|
|
126
|
+
e._suspendTimer = null, e.state = "suspending";
|
|
127
|
+
var t = function() {
|
|
128
|
+
e.state = "suspended", e._resumeAfterSuspend && (delete e._resumeAfterSuspend, e._autoResume());
|
|
129
|
+
};
|
|
130
|
+
e.ctx.suspend().then(t, t);
|
|
131
|
+
}
|
|
132
|
+
}, 3e4), e;
|
|
133
|
+
}
|
|
134
|
+
}, _autoResume: function() {
|
|
135
|
+
var e = this;
|
|
136
|
+
if (e.ctx && e.ctx.resume !== void 0 && d.usingWebAudio) return e.state === "running" && e.ctx.state !== "interrupted" && e._suspendTimer ? (clearTimeout(e._suspendTimer), e._suspendTimer = null) : e.state === "suspended" || e.state === "running" && e.ctx.state === "interrupted" ? (e.ctx.resume().then(function() {
|
|
137
|
+
e.state = "running";
|
|
138
|
+
for (var n = 0; n < e._howls.length; n++) e._howls[n]._emit("resume");
|
|
139
|
+
}), e._suspendTimer && (clearTimeout(e._suspendTimer), e._suspendTimer = null)) : e.state === "suspending" && (e._resumeAfterSuspend = !0), e;
|
|
140
|
+
} };
|
|
141
|
+
var d = new v(), f = function(e) {
|
|
142
|
+
var n = this;
|
|
143
|
+
if (!e.src || e.src.length === 0) return void console.error("An array of source files must be passed with any new Howl.");
|
|
144
|
+
n.init(e);
|
|
145
|
+
};
|
|
146
|
+
f.prototype = { init: function(e) {
|
|
147
|
+
var n = this;
|
|
148
|
+
return d.ctx || A(), n._autoplay = e.autoplay || !1, n._format = typeof e.format != "string" ? e.format : [e.format], n._html5 = e.html5 || !1, n._muted = e.mute || !1, n._loop = e.loop || !1, n._pool = e.pool || 5, n._preload = typeof e.preload != "boolean" && e.preload !== "metadata" || e.preload, n._rate = e.rate || 1, n._sprite = e.sprite || {}, n._src = typeof e.src != "string" ? e.src : [e.src], n._volume = e.volume !== void 0 ? e.volume : 1, n._xhr = { method: e.xhr && e.xhr.method ? e.xhr.method : "GET", headers: e.xhr && e.xhr.headers ? e.xhr.headers : null, withCredentials: !(!e.xhr || !e.xhr.withCredentials) && e.xhr.withCredentials }, n._duration = 0, n._state = "unloaded", n._sounds = [], n._endTimers = {}, n._queue = [], n._playLock = !1, n._onend = e.onend ? [{ fn: e.onend }] : [], n._onfade = e.onfade ? [{ fn: e.onfade }] : [], n._onload = e.onload ? [{ fn: e.onload }] : [], n._onloaderror = e.onloaderror ? [{ fn: e.onloaderror }] : [], n._onplayerror = e.onplayerror ? [{ fn: e.onplayerror }] : [], n._onpause = e.onpause ? [{ fn: e.onpause }] : [], n._onplay = e.onplay ? [{ fn: e.onplay }] : [], n._onstop = e.onstop ? [{ fn: e.onstop }] : [], n._onmute = e.onmute ? [{ fn: e.onmute }] : [], n._onvolume = e.onvolume ? [{ fn: e.onvolume }] : [], n._onrate = e.onrate ? [{ fn: e.onrate }] : [], n._onseek = e.onseek ? [{ fn: e.onseek }] : [], n._onunlock = e.onunlock ? [{ fn: e.onunlock }] : [], n._onresume = [], n._webAudio = d.usingWebAudio && !n._html5, d.ctx !== void 0 && d.ctx && d.autoUnlock && d._unlockAudio(), d._howls.push(n), n._autoplay && n._queue.push({ event: "play", action: function() {
|
|
149
|
+
n.play();
|
|
150
|
+
} }), n._preload && n._preload !== "none" && n.load(), n;
|
|
151
|
+
}, load: function() {
|
|
152
|
+
var e = this, n = null;
|
|
153
|
+
if (d.noAudio) return void e._emit("loaderror", null, "No audio support.");
|
|
154
|
+
typeof e._src == "string" && (e._src = [e._src]);
|
|
155
|
+
for (var o = 0; o < e._src.length; o++) {
|
|
156
|
+
var t, r;
|
|
157
|
+
if (e._format && e._format[o]) t = e._format[o];
|
|
158
|
+
else {
|
|
159
|
+
if (typeof (r = e._src[o]) != "string") {
|
|
160
|
+
e._emit("loaderror", null, "Non-string found in selected audio sources - ignoring.");
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
t = /^data:audio\/([^;,]+);/i.exec(r), t || (t = /\.([^.]+)$/.exec(r.split("?", 1)[0])), t && (t = t[1].toLowerCase());
|
|
164
|
+
}
|
|
165
|
+
if (t || console.warn('No file extension was found. Consider using the "format" property or specify an extension.'), t && d.codecs(t)) {
|
|
166
|
+
n = e._src[o];
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return n ? (e._src = n, e._state = "loading", window.location.protocol === "https:" && n.slice(0, 5) === "http:" && (e._html5 = !0, e._webAudio = !1), new c(e), e._webAudio && F(e), e) : void e._emit("loaderror", null, "No codec support for selected audio sources.");
|
|
171
|
+
}, play: function(e, n) {
|
|
172
|
+
var o = this, t = null;
|
|
173
|
+
if (typeof e == "number") t = e, e = null;
|
|
174
|
+
else {
|
|
175
|
+
if (typeof e == "string" && o._state === "loaded" && !o._sprite[e]) return null;
|
|
176
|
+
if (e === void 0 && (e = "__default", !o._playLock)) {
|
|
177
|
+
for (var r = 0, u = 0; u < o._sounds.length; u++) o._sounds[u]._paused && !o._sounds[u]._ended && (r++, t = o._sounds[u]._id);
|
|
178
|
+
r === 1 ? e = null : t = null;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
var a = t ? o._soundById(t) : o._inactiveSound();
|
|
182
|
+
if (!a) return null;
|
|
183
|
+
if (t && !e && (e = a._sprite || "__default"), o._state !== "loaded") {
|
|
184
|
+
a._sprite = e, a._ended = !1;
|
|
185
|
+
var i = a._id;
|
|
186
|
+
return o._queue.push({ event: "play", action: function() {
|
|
187
|
+
o.play(i);
|
|
188
|
+
} }), i;
|
|
189
|
+
}
|
|
190
|
+
if (t && !a._paused) return n || o._loadQueue("play"), a._id;
|
|
191
|
+
o._webAudio && d._autoResume();
|
|
192
|
+
var _ = Math.max(0, a._seek > 0 ? a._seek : o._sprite[e][0] / 1e3), l = Math.max(0, (o._sprite[e][0] + o._sprite[e][1]) / 1e3 - _), m = 1e3 * l / Math.abs(a._rate), h = o._sprite[e][0] / 1e3, w = (o._sprite[e][0] + o._sprite[e][1]) / 1e3;
|
|
193
|
+
a._sprite = e, a._ended = !1;
|
|
194
|
+
var T = function() {
|
|
195
|
+
a._paused = !1, a._seek = _, a._start = h, a._stop = w, a._loop = !(!a._loop && !o._sprite[e][2]);
|
|
196
|
+
};
|
|
197
|
+
if (_ >= w) return void o._ended(a);
|
|
198
|
+
var s = a._node;
|
|
199
|
+
if (o._webAudio) {
|
|
200
|
+
var I = function() {
|
|
201
|
+
o._playLock = !1, T(), o._refreshBuffer(a);
|
|
202
|
+
var g = a._muted || o._muted ? 0 : a._volume;
|
|
203
|
+
s.gain.setValueAtTime(g, d.ctx.currentTime), a._playStart = d.ctx.currentTime, s.bufferSource.start === void 0 ? a._loop ? s.bufferSource.noteGrainOn(0, _, 86400) : s.bufferSource.noteGrainOn(0, _, l) : a._loop ? s.bufferSource.start(0, _, 86400) : s.bufferSource.start(0, _, l), m !== 1 / 0 && (o._endTimers[a._id] = setTimeout(o._ended.bind(o, a), m)), n || setTimeout(function() {
|
|
204
|
+
o._emit("play", a._id), o._loadQueue();
|
|
205
|
+
}, 0);
|
|
206
|
+
};
|
|
207
|
+
d.state === "running" && d.ctx.state !== "interrupted" ? I() : (o._playLock = !0, o.once("resume", I), o._clearTimer(a._id));
|
|
208
|
+
} else {
|
|
209
|
+
var P = function() {
|
|
210
|
+
s.currentTime = _, s.muted = a._muted || o._muted || d._muted || s.muted, s.volume = a._volume * d.volume(), s.playbackRate = a._rate;
|
|
211
|
+
try {
|
|
212
|
+
var g = s.play();
|
|
213
|
+
if (g && typeof Promise < "u" && (g instanceof Promise || typeof g.then == "function") ? (o._playLock = !0, T(), g.then(function() {
|
|
214
|
+
o._playLock = !1, s._unlocked = !0, n ? o._loadQueue() : o._emit("play", a._id);
|
|
215
|
+
}).catch(function() {
|
|
216
|
+
o._playLock = !1, o._emit("playerror", a._id, "Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."), a._ended = !0, a._paused = !0;
|
|
217
|
+
})) : n || (o._playLock = !1, T(), o._emit("play", a._id)), s.playbackRate = a._rate, s.paused) return void o._emit("playerror", a._id, "Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");
|
|
218
|
+
e !== "__default" || a._loop ? o._endTimers[a._id] = setTimeout(o._ended.bind(o, a), m) : (o._endTimers[a._id] = function() {
|
|
219
|
+
o._ended(a), s.removeEventListener("ended", o._endTimers[a._id], !1);
|
|
220
|
+
}, s.addEventListener("ended", o._endTimers[a._id], !1));
|
|
221
|
+
} catch (G) {
|
|
222
|
+
o._emit("playerror", a._id, G);
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
s.src === "data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA" && (s.src = o._src, s.load());
|
|
226
|
+
var C = window && window.ejecta || !s.readyState && d._navigator.isCocoonJS;
|
|
227
|
+
if (s.readyState >= 3 || C) P();
|
|
228
|
+
else {
|
|
229
|
+
o._playLock = !0, o._state = "loading";
|
|
230
|
+
var L = function() {
|
|
231
|
+
o._state = "loaded", P(), s.removeEventListener(d._canPlayEvent, L, !1);
|
|
232
|
+
};
|
|
233
|
+
s.addEventListener(d._canPlayEvent, L, !1), o._clearTimer(a._id);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return a._id;
|
|
237
|
+
}, pause: function(e) {
|
|
238
|
+
var n = this;
|
|
239
|
+
if (n._state !== "loaded" || n._playLock) return n._queue.push({ event: "pause", action: function() {
|
|
240
|
+
n.pause(e);
|
|
241
|
+
} }), n;
|
|
242
|
+
for (var o = n._getSoundIds(e), t = 0; t < o.length; t++) {
|
|
243
|
+
n._clearTimer(o[t]);
|
|
244
|
+
var r = n._soundById(o[t]);
|
|
245
|
+
if (r && !r._paused && (r._seek = n.seek(o[t]), r._rateSeek = 0, r._paused = !0, n._stopFade(o[t]), r._node)) if (n._webAudio) {
|
|
246
|
+
if (!r._node.bufferSource) continue;
|
|
247
|
+
r._node.bufferSource.stop === void 0 ? r._node.bufferSource.noteOff(0) : r._node.bufferSource.stop(0), n._cleanBuffer(r._node);
|
|
248
|
+
} else isNaN(r._node.duration) && r._node.duration !== 1 / 0 || r._node.pause();
|
|
249
|
+
arguments[1] || n._emit("pause", r ? r._id : null);
|
|
250
|
+
}
|
|
251
|
+
return n;
|
|
252
|
+
}, stop: function(e, n) {
|
|
253
|
+
var o = this;
|
|
254
|
+
if (o._state !== "loaded" || o._playLock) return o._queue.push({ event: "stop", action: function() {
|
|
255
|
+
o.stop(e);
|
|
256
|
+
} }), o;
|
|
257
|
+
for (var t = o._getSoundIds(e), r = 0; r < t.length; r++) {
|
|
258
|
+
o._clearTimer(t[r]);
|
|
259
|
+
var u = o._soundById(t[r]);
|
|
260
|
+
u && (u._seek = u._start || 0, u._rateSeek = 0, u._paused = !0, u._ended = !0, o._stopFade(t[r]), u._node && (o._webAudio ? u._node.bufferSource && (u._node.bufferSource.stop === void 0 ? u._node.bufferSource.noteOff(0) : u._node.bufferSource.stop(0), o._cleanBuffer(u._node)) : isNaN(u._node.duration) && u._node.duration !== 1 / 0 || (u._node.currentTime = u._start || 0, u._node.pause(), u._node.duration === 1 / 0 && o._clearSound(u._node))), n || o._emit("stop", u._id));
|
|
261
|
+
}
|
|
262
|
+
return o;
|
|
263
|
+
}, mute: function(e, n) {
|
|
264
|
+
var o = this;
|
|
265
|
+
if (o._state !== "loaded" || o._playLock) return o._queue.push({ event: "mute", action: function() {
|
|
266
|
+
o.mute(e, n);
|
|
267
|
+
} }), o;
|
|
268
|
+
if (n === void 0) {
|
|
269
|
+
if (typeof e != "boolean") return o._muted;
|
|
270
|
+
o._muted = e;
|
|
271
|
+
}
|
|
272
|
+
for (var t = o._getSoundIds(n), r = 0; r < t.length; r++) {
|
|
273
|
+
var u = o._soundById(t[r]);
|
|
274
|
+
u && (u._muted = e, u._interval && o._stopFade(u._id), o._webAudio && u._node ? u._node.gain.setValueAtTime(e ? 0 : u._volume, d.ctx.currentTime) : u._node && (u._node.muted = !!d._muted || e), o._emit("mute", u._id));
|
|
275
|
+
}
|
|
276
|
+
return o;
|
|
277
|
+
}, volume: function() {
|
|
278
|
+
var e, n, o = this, t = arguments;
|
|
279
|
+
if (t.length === 0) return o._volume;
|
|
280
|
+
t.length === 1 || t.length === 2 && t[1] === void 0 ? o._getSoundIds().indexOf(t[0]) >= 0 ? n = parseInt(t[0], 10) : e = parseFloat(t[0]) : t.length >= 2 && (e = parseFloat(t[0]), n = parseInt(t[1], 10));
|
|
281
|
+
var r;
|
|
282
|
+
if (!(e !== void 0 && e >= 0 && e <= 1)) return r = n ? o._soundById(n) : o._sounds[0], r ? r._volume : 0;
|
|
283
|
+
if (o._state !== "loaded" || o._playLock) return o._queue.push({ event: "volume", action: function() {
|
|
284
|
+
o.volume.apply(o, t);
|
|
285
|
+
} }), o;
|
|
286
|
+
n === void 0 && (o._volume = e), n = o._getSoundIds(n);
|
|
287
|
+
for (var u = 0; u < n.length; u++) (r = o._soundById(n[u])) && (r._volume = e, t[2] || o._stopFade(n[u]), o._webAudio && r._node && !r._muted ? r._node.gain.setValueAtTime(e, d.ctx.currentTime) : r._node && !r._muted && (r._node.volume = e * d.volume()), o._emit("volume", r._id));
|
|
288
|
+
return o;
|
|
289
|
+
}, fade: function(e, n, o, t) {
|
|
290
|
+
var r = this;
|
|
291
|
+
if (r._state !== "loaded" || r._playLock) return r._queue.push({ event: "fade", action: function() {
|
|
292
|
+
r.fade(e, n, o, t);
|
|
293
|
+
} }), r;
|
|
294
|
+
e = Math.min(Math.max(0, parseFloat(e)), 1), n = Math.min(Math.max(0, parseFloat(n)), 1), o = parseFloat(o), r.volume(e, t);
|
|
295
|
+
for (var u = r._getSoundIds(t), a = 0; a < u.length; a++) {
|
|
296
|
+
var i = r._soundById(u[a]);
|
|
297
|
+
if (i) {
|
|
298
|
+
if (t || r._stopFade(u[a]), r._webAudio && !i._muted) {
|
|
299
|
+
var _ = d.ctx.currentTime, l = _ + o / 1e3;
|
|
300
|
+
i._volume = e, i._node.gain.setValueAtTime(e, _), i._node.gain.linearRampToValueAtTime(n, l);
|
|
301
|
+
}
|
|
302
|
+
r._startFadeInterval(i, e, n, o, u[a], t === void 0);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
return r;
|
|
306
|
+
}, _startFadeInterval: function(e, n, o, t, r, u) {
|
|
307
|
+
var a = this, i = n, _ = o - n, l = Math.abs(_ / 0.01), m = Math.max(4, l > 0 ? t / l : t), h = Date.now();
|
|
308
|
+
e._fadeTo = o, e._interval = setInterval(function() {
|
|
309
|
+
var w = (Date.now() - h) / t;
|
|
310
|
+
h = Date.now(), i += _ * w, i = Math.round(100 * i) / 100, i = _ < 0 ? Math.max(o, i) : Math.min(o, i), a._webAudio ? e._volume = i : a.volume(i, e._id, !0), u && (a._volume = i), (o < n && i <= o || o > n && i >= o) && (clearInterval(e._interval), e._interval = null, e._fadeTo = null, a.volume(o, e._id), a._emit("fade", e._id));
|
|
311
|
+
}, m);
|
|
312
|
+
}, _stopFade: function(e) {
|
|
313
|
+
var n = this, o = n._soundById(e);
|
|
314
|
+
return o && o._interval && (n._webAudio && o._node.gain.cancelScheduledValues(d.ctx.currentTime), clearInterval(o._interval), o._interval = null, n.volume(o._fadeTo, e), o._fadeTo = null, n._emit("fade", e)), n;
|
|
315
|
+
}, loop: function() {
|
|
316
|
+
var e, n, o, t = this, r = arguments;
|
|
317
|
+
if (r.length === 0) return t._loop;
|
|
318
|
+
if (r.length === 1) {
|
|
319
|
+
if (typeof r[0] != "boolean") return !!(o = t._soundById(parseInt(r[0], 10))) && o._loop;
|
|
320
|
+
e = r[0], t._loop = e;
|
|
321
|
+
} else r.length === 2 && (e = r[0], n = parseInt(r[1], 10));
|
|
322
|
+
for (var u = t._getSoundIds(n), a = 0; a < u.length; a++) (o = t._soundById(u[a])) && (o._loop = e, t._webAudio && o._node && o._node.bufferSource && (o._node.bufferSource.loop = e, e && (o._node.bufferSource.loopStart = o._start || 0, o._node.bufferSource.loopEnd = o._stop, t.playing(u[a]) && (t.pause(u[a], !0), t.play(u[a], !0)))));
|
|
323
|
+
return t;
|
|
324
|
+
}, rate: function() {
|
|
325
|
+
var e, n, o = this, t = arguments;
|
|
326
|
+
if (t.length === 0) n = o._sounds[0]._id;
|
|
327
|
+
else if (t.length === 1) {
|
|
328
|
+
var r = o._getSoundIds(), u = r.indexOf(t[0]);
|
|
329
|
+
u >= 0 ? n = parseInt(t[0], 10) : e = parseFloat(t[0]);
|
|
330
|
+
} else t.length === 2 && (e = parseFloat(t[0]), n = parseInt(t[1], 10));
|
|
331
|
+
var a;
|
|
332
|
+
if (typeof e != "number") return a = o._soundById(n), a ? a._rate : o._rate;
|
|
333
|
+
if (o._state !== "loaded" || o._playLock) return o._queue.push({ event: "rate", action: function() {
|
|
334
|
+
o.rate.apply(o, t);
|
|
335
|
+
} }), o;
|
|
336
|
+
n === void 0 && (o._rate = e), n = o._getSoundIds(n);
|
|
337
|
+
for (var i = 0; i < n.length; i++) if (a = o._soundById(n[i])) {
|
|
338
|
+
o.playing(n[i]) && (a._rateSeek = o.seek(n[i]), a._playStart = o._webAudio ? d.ctx.currentTime : a._playStart), a._rate = e, o._webAudio && a._node && a._node.bufferSource ? a._node.bufferSource.playbackRate.setValueAtTime(e, d.ctx.currentTime) : a._node && (a._node.playbackRate = e);
|
|
339
|
+
var _ = o.seek(n[i]), l = (o._sprite[a._sprite][0] + o._sprite[a._sprite][1]) / 1e3 - _, m = 1e3 * l / Math.abs(a._rate);
|
|
340
|
+
!o._endTimers[n[i]] && a._paused || (o._clearTimer(n[i]), o._endTimers[n[i]] = setTimeout(o._ended.bind(o, a), m)), o._emit("rate", a._id);
|
|
341
|
+
}
|
|
342
|
+
return o;
|
|
343
|
+
}, seek: function() {
|
|
344
|
+
var e, n, o = this, t = arguments;
|
|
345
|
+
if (t.length === 0) o._sounds.length && (n = o._sounds[0]._id);
|
|
346
|
+
else if (t.length === 1) {
|
|
347
|
+
var r = o._getSoundIds(), u = r.indexOf(t[0]);
|
|
348
|
+
u >= 0 ? n = parseInt(t[0], 10) : o._sounds.length && (n = o._sounds[0]._id, e = parseFloat(t[0]));
|
|
349
|
+
} else t.length === 2 && (e = parseFloat(t[0]), n = parseInt(t[1], 10));
|
|
350
|
+
if (n === void 0) return 0;
|
|
351
|
+
if (typeof e == "number" && (o._state !== "loaded" || o._playLock)) return o._queue.push({ event: "seek", action: function() {
|
|
352
|
+
o.seek.apply(o, t);
|
|
353
|
+
} }), o;
|
|
354
|
+
var a = o._soundById(n);
|
|
355
|
+
if (a) {
|
|
356
|
+
if (!(typeof e == "number" && e >= 0)) {
|
|
357
|
+
if (o._webAudio) {
|
|
358
|
+
var i = o.playing(n) ? d.ctx.currentTime - a._playStart : 0, _ = a._rateSeek ? a._rateSeek - a._seek : 0;
|
|
359
|
+
return a._seek + (_ + i * Math.abs(a._rate));
|
|
360
|
+
}
|
|
361
|
+
return a._node.currentTime;
|
|
362
|
+
}
|
|
363
|
+
var l = o.playing(n);
|
|
364
|
+
l && o.pause(n, !0), a._seek = e, a._ended = !1, o._clearTimer(n), o._webAudio || !a._node || isNaN(a._node.duration) || (a._node.currentTime = e);
|
|
365
|
+
var m = function() {
|
|
366
|
+
l && o.play(n, !0), o._emit("seek", n);
|
|
367
|
+
};
|
|
368
|
+
if (l && !o._webAudio) {
|
|
369
|
+
var h = function() {
|
|
370
|
+
o._playLock ? setTimeout(h, 0) : m();
|
|
371
|
+
};
|
|
372
|
+
setTimeout(h, 0);
|
|
373
|
+
} else m();
|
|
374
|
+
}
|
|
375
|
+
return o;
|
|
376
|
+
}, playing: function(e) {
|
|
377
|
+
var n = this;
|
|
378
|
+
if (typeof e == "number") {
|
|
379
|
+
var o = n._soundById(e);
|
|
380
|
+
return !!o && !o._paused;
|
|
381
|
+
}
|
|
382
|
+
for (var t = 0; t < n._sounds.length; t++) if (!n._sounds[t]._paused) return !0;
|
|
383
|
+
return !1;
|
|
384
|
+
}, duration: function(e) {
|
|
385
|
+
var n = this, o = n._duration, t = n._soundById(e);
|
|
386
|
+
return t && (o = n._sprite[t._sprite][1] / 1e3), o;
|
|
387
|
+
}, state: function() {
|
|
388
|
+
return this._state;
|
|
389
|
+
}, unload: function() {
|
|
390
|
+
for (var e = this, n = e._sounds, o = 0; o < n.length; o++) n[o]._paused || e.stop(n[o]._id), e._webAudio || (e._clearSound(n[o]._node), n[o]._node.removeEventListener("error", n[o]._errorFn, !1), n[o]._node.removeEventListener(d._canPlayEvent, n[o]._loadFn, !1), n[o]._node.removeEventListener("ended", n[o]._endFn, !1), d._releaseHtml5Audio(n[o]._node)), delete n[o]._node, e._clearTimer(n[o]._id);
|
|
391
|
+
var t = d._howls.indexOf(e);
|
|
392
|
+
t >= 0 && d._howls.splice(t, 1);
|
|
393
|
+
var r = !0;
|
|
394
|
+
for (o = 0; o < d._howls.length; o++) if (d._howls[o]._src === e._src || e._src.indexOf(d._howls[o]._src) >= 0) {
|
|
395
|
+
r = !1;
|
|
396
|
+
break;
|
|
397
|
+
}
|
|
398
|
+
return r && delete p[e._src], d.noAudio = !1, e._state = "unloaded", e._sounds = [], e = null, null;
|
|
399
|
+
}, on: function(e, n, o, t) {
|
|
400
|
+
var r = this, u = r["_on" + e];
|
|
401
|
+
return typeof n == "function" && u.push(t ? { id: o, fn: n, once: t } : { id: o, fn: n }), r;
|
|
402
|
+
}, off: function(e, n, o) {
|
|
403
|
+
var t = this, r = t["_on" + e], u = 0;
|
|
404
|
+
if (typeof n == "number" && (o = n, n = null), n || o) for (u = 0; u < r.length; u++) {
|
|
405
|
+
var a = o === r[u].id;
|
|
406
|
+
if (n === r[u].fn && a || !n && a) {
|
|
407
|
+
r.splice(u, 1);
|
|
408
|
+
break;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
else if (e) t["_on" + e] = [];
|
|
412
|
+
else {
|
|
413
|
+
var i = Object.keys(t);
|
|
414
|
+
for (u = 0; u < i.length; u++) i[u].indexOf("_on") === 0 && Array.isArray(t[i[u]]) && (t[i[u]] = []);
|
|
415
|
+
}
|
|
416
|
+
return t;
|
|
417
|
+
}, once: function(e, n, o) {
|
|
418
|
+
var t = this;
|
|
419
|
+
return t.on(e, n, o, 1), t;
|
|
420
|
+
}, _emit: function(e, n, o) {
|
|
421
|
+
for (var t = this, r = t["_on" + e], u = r.length - 1; u >= 0; u--) r[u].id && r[u].id !== n && e !== "load" || (setTimeout((function(a) {
|
|
422
|
+
a.call(this, n, o);
|
|
423
|
+
}).bind(t, r[u].fn), 0), r[u].once && t.off(e, r[u].fn, r[u].id));
|
|
424
|
+
return t._loadQueue(e), t;
|
|
425
|
+
}, _loadQueue: function(e) {
|
|
426
|
+
var n = this;
|
|
427
|
+
if (n._queue.length > 0) {
|
|
428
|
+
var o = n._queue[0];
|
|
429
|
+
o.event === e && (n._queue.shift(), n._loadQueue()), e || o.action();
|
|
430
|
+
}
|
|
431
|
+
return n;
|
|
432
|
+
}, _ended: function(e) {
|
|
433
|
+
var n = this, o = e._sprite;
|
|
434
|
+
if (!n._webAudio && e._node && !e._node.paused && !e._node.ended && e._node.currentTime < e._stop) return setTimeout(n._ended.bind(n, e), 100), n;
|
|
435
|
+
var t = !(!e._loop && !n._sprite[o][2]);
|
|
436
|
+
if (n._emit("end", e._id), !n._webAudio && t && n.stop(e._id, !0).play(e._id), n._webAudio && t) {
|
|
437
|
+
n._emit("play", e._id), e._seek = e._start || 0, e._rateSeek = 0, e._playStart = d.ctx.currentTime;
|
|
438
|
+
var r = 1e3 * (e._stop - e._start) / Math.abs(e._rate);
|
|
439
|
+
n._endTimers[e._id] = setTimeout(n._ended.bind(n, e), r);
|
|
440
|
+
}
|
|
441
|
+
return n._webAudio && !t && (e._paused = !0, e._ended = !0, e._seek = e._start || 0, e._rateSeek = 0, n._clearTimer(e._id), n._cleanBuffer(e._node), d._autoSuspend()), n._webAudio || t || n.stop(e._id, !0), n;
|
|
442
|
+
}, _clearTimer: function(e) {
|
|
443
|
+
var n = this;
|
|
444
|
+
if (n._endTimers[e]) {
|
|
445
|
+
if (typeof n._endTimers[e] != "function") clearTimeout(n._endTimers[e]);
|
|
446
|
+
else {
|
|
447
|
+
var o = n._soundById(e);
|
|
448
|
+
o && o._node && o._node.removeEventListener("ended", n._endTimers[e], !1);
|
|
449
|
+
}
|
|
450
|
+
delete n._endTimers[e];
|
|
451
|
+
}
|
|
452
|
+
return n;
|
|
453
|
+
}, _soundById: function(e) {
|
|
454
|
+
for (var n = this, o = 0; o < n._sounds.length; o++) if (e === n._sounds[o]._id) return n._sounds[o];
|
|
455
|
+
return null;
|
|
456
|
+
}, _inactiveSound: function() {
|
|
457
|
+
var e = this;
|
|
458
|
+
e._drain();
|
|
459
|
+
for (var n = 0; n < e._sounds.length; n++) if (e._sounds[n]._ended) return e._sounds[n].reset();
|
|
460
|
+
return new c(e);
|
|
461
|
+
}, _drain: function() {
|
|
462
|
+
var e = this, n = e._pool, o = 0, t = 0;
|
|
463
|
+
if (!(e._sounds.length < n)) {
|
|
464
|
+
for (t = 0; t < e._sounds.length; t++) e._sounds[t]._ended && o++;
|
|
465
|
+
for (t = e._sounds.length - 1; t >= 0; t--) {
|
|
466
|
+
if (o <= n) return;
|
|
467
|
+
e._sounds[t]._ended && (e._webAudio && e._sounds[t]._node && e._sounds[t]._node.disconnect(0), e._sounds.splice(t, 1), o--);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}, _getSoundIds: function(e) {
|
|
471
|
+
var n = this;
|
|
472
|
+
if (e === void 0) {
|
|
473
|
+
for (var o = [], t = 0; t < n._sounds.length; t++) o.push(n._sounds[t]._id);
|
|
474
|
+
return o;
|
|
475
|
+
}
|
|
476
|
+
return [e];
|
|
477
|
+
}, _refreshBuffer: function(e) {
|
|
478
|
+
var n = this;
|
|
479
|
+
return e._node.bufferSource = d.ctx.createBufferSource(), e._node.bufferSource.buffer = p[n._src], e._panner ? e._node.bufferSource.connect(e._panner) : e._node.bufferSource.connect(e._node), e._node.bufferSource.loop = e._loop, e._loop && (e._node.bufferSource.loopStart = e._start || 0, e._node.bufferSource.loopEnd = e._stop || 0), e._node.bufferSource.playbackRate.setValueAtTime(e._rate, d.ctx.currentTime), n;
|
|
480
|
+
}, _cleanBuffer: function(e) {
|
|
481
|
+
var n = this, o = d._navigator && d._navigator.vendor.indexOf("Apple") >= 0;
|
|
482
|
+
if (d._scratchBuffer && e.bufferSource && (e.bufferSource.onended = null, e.bufferSource.disconnect(0), o)) try {
|
|
483
|
+
e.bufferSource.buffer = d._scratchBuffer;
|
|
484
|
+
} catch {
|
|
485
|
+
}
|
|
486
|
+
return e.bufferSource = null, n;
|
|
487
|
+
}, _clearSound: function(e) {
|
|
488
|
+
/MSIE |Trident\//.test(d._navigator && d._navigator.userAgent) || (e.src = "data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA");
|
|
489
|
+
} };
|
|
490
|
+
var c = function(e) {
|
|
491
|
+
this._parent = e, this.init();
|
|
492
|
+
};
|
|
493
|
+
c.prototype = { init: function() {
|
|
494
|
+
var e = this, n = e._parent;
|
|
495
|
+
return e._muted = n._muted, e._loop = n._loop, e._volume = n._volume, e._rate = n._rate, e._seek = 0, e._paused = !0, e._ended = !0, e._sprite = "__default", e._id = ++d._counter, n._sounds.push(e), e.create(), e;
|
|
496
|
+
}, create: function() {
|
|
497
|
+
var e = this, n = e._parent, o = d._muted || e._muted || e._parent._muted ? 0 : e._volume;
|
|
498
|
+
return n._webAudio ? (e._node = d.ctx.createGain === void 0 ? d.ctx.createGainNode() : d.ctx.createGain(), e._node.gain.setValueAtTime(o, d.ctx.currentTime), e._node.paused = !0, e._node.connect(d.masterGain)) : d.noAudio || (e._node = d._obtainHtml5Audio(), e._errorFn = e._errorListener.bind(e), e._node.addEventListener("error", e._errorFn, !1), e._loadFn = e._loadListener.bind(e), e._node.addEventListener(d._canPlayEvent, e._loadFn, !1), e._endFn = e._endListener.bind(e), e._node.addEventListener("ended", e._endFn, !1), e._node.src = n._src, e._node.preload = n._preload === !0 ? "auto" : n._preload, e._node.volume = o * d.volume(), e._node.load()), e;
|
|
499
|
+
}, reset: function() {
|
|
500
|
+
var e = this, n = e._parent;
|
|
501
|
+
return e._muted = n._muted, e._loop = n._loop, e._volume = n._volume, e._rate = n._rate, e._seek = 0, e._rateSeek = 0, e._paused = !0, e._ended = !0, e._sprite = "__default", e._id = ++d._counter, e;
|
|
502
|
+
}, _errorListener: function() {
|
|
503
|
+
var e = this;
|
|
504
|
+
e._parent._emit("loaderror", e._id, e._node.error ? e._node.error.code : 0), e._node.removeEventListener("error", e._errorFn, !1);
|
|
505
|
+
}, _loadListener: function() {
|
|
506
|
+
var e = this, n = e._parent;
|
|
507
|
+
n._duration = Math.ceil(10 * e._node.duration) / 10, Object.keys(n._sprite).length === 0 && (n._sprite = { __default: [0, 1e3 * n._duration] }), n._state !== "loaded" && (n._state = "loaded", n._emit("load"), n._loadQueue()), e._node.removeEventListener(d._canPlayEvent, e._loadFn, !1);
|
|
508
|
+
}, _endListener: function() {
|
|
509
|
+
var e = this, n = e._parent;
|
|
510
|
+
n._duration === 1 / 0 && (n._duration = Math.ceil(10 * e._node.duration) / 10, n._sprite.__default[1] === 1 / 0 && (n._sprite.__default[1] = 1e3 * n._duration), n._ended(e)), e._node.removeEventListener("ended", e._endFn, !1);
|
|
511
|
+
} };
|
|
512
|
+
var p = {}, F = function(e) {
|
|
513
|
+
var n = e._src;
|
|
514
|
+
if (p[n]) return e._duration = p[n].duration, void S(e);
|
|
515
|
+
if (/^data:[^;]+;base64,/.test(n)) {
|
|
516
|
+
for (var o = atob(n.split(",")[1]), t = new Uint8Array(o.length), r = 0; r < o.length; ++r) t[r] = o.charCodeAt(r);
|
|
517
|
+
k(t.buffer, e);
|
|
518
|
+
} else {
|
|
519
|
+
var u = new XMLHttpRequest();
|
|
520
|
+
u.open(e._xhr.method, n, !0), u.withCredentials = e._xhr.withCredentials, u.responseType = "arraybuffer", e._xhr.headers && Object.keys(e._xhr.headers).forEach(function(a) {
|
|
521
|
+
u.setRequestHeader(a, e._xhr.headers[a]);
|
|
522
|
+
}), u.onload = function() {
|
|
523
|
+
var a = (u.status + "")[0];
|
|
524
|
+
if (a !== "0" && a !== "2" && a !== "3") return void e._emit("loaderror", null, "Failed loading audio file with status: " + u.status + ".");
|
|
525
|
+
k(u.response, e);
|
|
526
|
+
}, u.onerror = function() {
|
|
527
|
+
e._webAudio && (e._html5 = !0, e._webAudio = !1, e._sounds = [], delete p[n], e.load());
|
|
528
|
+
}, O(u);
|
|
529
|
+
}
|
|
530
|
+
}, O = function(e) {
|
|
531
|
+
try {
|
|
532
|
+
e.send();
|
|
533
|
+
} catch {
|
|
534
|
+
e.onerror();
|
|
535
|
+
}
|
|
536
|
+
}, k = function(e, n) {
|
|
537
|
+
var o = function() {
|
|
538
|
+
n._emit("loaderror", null, "Decoding audio data failed.");
|
|
539
|
+
}, t = function(r) {
|
|
540
|
+
r && n._sounds.length > 0 ? (p[n._src] = r, S(n, r)) : o();
|
|
541
|
+
};
|
|
542
|
+
typeof Promise < "u" && d.ctx.decodeAudioData.length === 1 ? d.ctx.decodeAudioData(e).then(t).catch(o) : d.ctx.decodeAudioData(e, t, o);
|
|
543
|
+
}, S = function(e, n) {
|
|
544
|
+
n && !e._duration && (e._duration = n.duration), Object.keys(e._sprite).length === 0 && (e._sprite = { __default: [0, 1e3 * e._duration] }), e._state !== "loaded" && (e._state = "loaded", e._emit("load"), e._loadQueue());
|
|
545
|
+
}, A = function() {
|
|
546
|
+
if (d.usingWebAudio) {
|
|
547
|
+
try {
|
|
548
|
+
typeof AudioContext < "u" ? d.ctx = new AudioContext() : typeof webkitAudioContext < "u" ? d.ctx = new webkitAudioContext() : d.usingWebAudio = !1;
|
|
549
|
+
} catch {
|
|
550
|
+
d.usingWebAudio = !1;
|
|
551
|
+
}
|
|
552
|
+
d.ctx || (d.usingWebAudio = !1);
|
|
553
|
+
var e = /iP(hone|od|ad)/.test(d._navigator && d._navigator.platform), n = d._navigator && d._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/), o = n ? parseInt(n[1], 10) : null;
|
|
554
|
+
if (e && o && o < 9) {
|
|
555
|
+
var t = /safari/.test(d._navigator && d._navigator.userAgent.toLowerCase());
|
|
556
|
+
d._navigator && !t && (d.usingWebAudio = !1);
|
|
557
|
+
}
|
|
558
|
+
d.usingWebAudio && (d.masterGain = d.ctx.createGain === void 0 ? d.ctx.createGainNode() : d.ctx.createGain(), d.masterGain.gain.setValueAtTime(d._muted ? 0 : d._volume, d.ctx.currentTime), d.masterGain.connect(d.ctx.destination)), d._setup();
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
y.Howler = d, y.Howl = f, typeof b < "u" ? (b.HowlerGlobal = v, b.Howler = d, b.Howl = f, b.Sound = c) : typeof window < "u" && (window.HowlerGlobal = v, window.Howler = d, window.Howl = f, window.Sound = c);
|
|
562
|
+
})();
|
|
563
|
+
}(x)), x;
|
|
564
|
+
}
|
|
565
|
+
var E = H();
|
|
566
|
+
const $ = /* @__PURE__ */ M(E), V = /* @__PURE__ */ R({
|
|
567
|
+
__proto__: null,
|
|
568
|
+
default: $
|
|
569
|
+
}, [E]);
|
|
570
|
+
export {
|
|
571
|
+
V as h
|
|
572
|
+
};
|