@novely/solid-renderer 0.41.1 → 0.42.0-next.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/index.jsx CHANGED
@@ -1,7 +1,8 @@
1
- // ../../node_modules/.pnpm/solid-js@1.8.21/node_modules/solid-js/dist/solid.js
1
+ // ../../node_modules/.pnpm/solid-js@1.9.3/node_modules/solid-js/dist/solid.js
2
2
  var sharedConfig = {
3
3
  context: void 0,
4
4
  registry: void 0,
5
+ effects: void 0,
5
6
  done: false,
6
7
  getContextId() {
7
8
  return getContextId(this.context.count);
@@ -26,6 +27,7 @@ function nextHydrateContext() {
26
27
  }
27
28
  var equalFn = (a, b) => a === b;
28
29
  var $PROXY = Symbol("solid-proxy");
30
+ var SUPPORTS_PROXY = typeof Proxy === "function";
29
31
  var $TRACK = Symbol("solid-track");
30
32
  var $DEVCOMP = Symbol("solid-dev-component");
31
33
  var signalOptions = {
@@ -197,12 +199,12 @@ function useContext(context) {
197
199
  }
198
200
  function children(fn) {
199
201
  const children2 = createMemo(fn);
200
- const memo2 = createMemo(() => resolveChildren(children2()));
201
- memo2.toArray = () => {
202
- const c = memo2();
202
+ const memo = createMemo(() => resolveChildren(children2()));
203
+ memo.toArray = () => {
204
+ const c = memo();
203
205
  return Array.isArray(c) ? c : c != null ? [c] : [];
204
206
  };
205
- return memo2;
207
+ return memo;
206
208
  }
207
209
  var SuspenseContext;
208
210
  function readSignal() {
@@ -491,13 +493,14 @@ function runUserEffects(queue) {
491
493
  sharedConfig.effects || (sharedConfig.effects = []);
492
494
  sharedConfig.effects.push(...queue.slice(0, userLength));
493
495
  return;
494
- } else if (sharedConfig.effects) {
495
- queue = [...sharedConfig.effects, ...queue];
496
- userLength += sharedConfig.effects.length;
497
- delete sharedConfig.effects;
498
496
  }
499
497
  setHydrateContext();
500
498
  }
499
+ if (sharedConfig.effects && (sharedConfig.done || !sharedConfig.count)) {
500
+ queue = [...sharedConfig.effects, ...queue];
501
+ userLength += sharedConfig.effects.length;
502
+ delete sharedConfig.effects;
503
+ }
501
504
  for (i = 0; i < userLength; i++) runTop(queue[i]);
502
505
  }
503
506
  function lookUpstream(node, ignore) {
@@ -543,11 +546,11 @@ function cleanNode(node) {
543
546
  }
544
547
  }
545
548
  }
549
+ if (node.tOwned) {
550
+ for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);
551
+ delete node.tOwned;
552
+ }
546
553
  if (Transition && Transition.running && node.pure) {
547
- if (node.tOwned) {
548
- for (i = node.tOwned.length - 1; i >= 0; i--) cleanNode(node.tOwned[i]);
549
- delete node.tOwned;
550
- }
551
554
  reset(node, true);
552
555
  } else if (node.owned) {
553
556
  for (i = node.owned.length - 1; i >= 0; i--) cleanNode(node.owned[i]);
@@ -772,7 +775,7 @@ function mergeProps(...sources) {
772
775
  proxy = proxy || !!s && $PROXY in s;
773
776
  sources[i] = typeof s === "function" ? (proxy = true, createMemo(s)) : s;
774
777
  }
775
- if (proxy) {
778
+ if (SUPPORTS_PROXY && proxy) {
776
779
  return new Proxy(
777
780
  {
778
781
  get(property) {
@@ -832,7 +835,7 @@ function mergeProps(...sources) {
832
835
  return target;
833
836
  }
834
837
  function splitProps(props, ...keys2) {
835
- if ($PROXY in props) {
838
+ if (SUPPORTS_PROXY && $PROXY in props) {
836
839
  const blocked = new Set(keys2.length > 1 ? keys2.flat() : keys2[0]);
837
840
  const res = keys2.map((k) => {
838
841
  return new Proxy(
@@ -970,7 +973,7 @@ function Match(props) {
970
973
  return props;
971
974
  }
972
975
 
973
- // ../../node_modules/.pnpm/solid-js@1.8.21/node_modules/solid-js/web/dist/web.js
976
+ // ../../node_modules/.pnpm/solid-js@1.9.3/node_modules/solid-js/web/dist/web.js
974
977
  var booleans = [
975
978
  "allowfullscreen",
976
979
  "async",
@@ -1135,14 +1138,14 @@ function render(code, element, init, options = {}) {
1135
1138
  element.textContent = "";
1136
1139
  };
1137
1140
  }
1138
- function template(html, isCE, isSVG) {
1141
+ function template(html, isImportNode, isSVG) {
1139
1142
  let node;
1140
1143
  const create = () => {
1141
1144
  const t = document.createElement("template");
1142
1145
  t.innerHTML = html;
1143
1146
  return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;
1144
1147
  };
1145
- const fn = isCE ? () => untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true);
1148
+ const fn = isImportNode ? () => untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true);
1146
1149
  fn.cloneNode = fn;
1147
1150
  return fn;
1148
1151
  }
@@ -1166,6 +1169,10 @@ function setAttributeNS(node, namespace, name, value) {
1166
1169
  if (value == null) node.removeAttributeNS(namespace, name);
1167
1170
  else node.setAttributeNS(namespace, name, value);
1168
1171
  }
1172
+ function setBoolAttribute(node, name, value) {
1173
+ if (isHydrating(node)) return;
1174
+ value ? node.setAttribute(name, "") : node.removeAttribute(name);
1175
+ }
1169
1176
  function className(node, value) {
1170
1177
  if (isHydrating(node)) return;
1171
1178
  if (value == null) node.removeAttribute("class");
@@ -1180,7 +1187,7 @@ function addEventListener2(node, name, handler, delegate) {
1180
1187
  } else if (Array.isArray(handler)) {
1181
1188
  const handlerFn = handler[0];
1182
1189
  node.addEventListener(name, handler[0] = (e) => handlerFn.call(node, handler[1], e));
1183
- } else node.addEventListener(name, handler);
1190
+ } else node.addEventListener(name, handler, typeof handler !== "function" && handler);
1184
1191
  }
1185
1192
  function classList(node, value, prev = {}) {
1186
1193
  const classKeys = Object.keys(value || {}), prevKeys = Object.keys(prev);
@@ -1244,7 +1251,7 @@ function assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = fals
1244
1251
  for (const prop in prevProps) {
1245
1252
  if (!(prop in props)) {
1246
1253
  if (prop === "children") continue;
1247
- prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef);
1254
+ prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef, props);
1248
1255
  }
1249
1256
  }
1250
1257
  for (const prop in props) {
@@ -1253,7 +1260,7 @@ function assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = fals
1253
1260
  continue;
1254
1261
  }
1255
1262
  const value = props[prop];
1256
- prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef);
1263
+ prevProps[prop] = assignProp(node, prop, value, prevProps[prop], isSVG, skipRef, props);
1257
1264
  }
1258
1265
  }
1259
1266
  function isHydrating(node) {
@@ -1267,7 +1274,7 @@ function toggleClassKey(node, key, value) {
1267
1274
  for (let i = 0, nameLen = classNames.length; i < nameLen; i++)
1268
1275
  node.classList.toggle(classNames[i], value);
1269
1276
  }
1270
- function assignProp(node, prop, value, prev, isSVG, skipRef) {
1277
+ function assignProp(node, prop, value, prev, isSVG, skipRef, props) {
1271
1278
  let isCE, isProp, isChildProp, propAlias, forceProp;
1272
1279
  if (prop === "style") return style(node, value, prev);
1273
1280
  if (prop === "classList") return classList(node, value, prev);
@@ -1276,8 +1283,8 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
1276
1283
  if (!skipRef) value(node);
1277
1284
  } else if (prop.slice(0, 3) === "on:") {
1278
1285
  const e = prop.slice(3);
1279
- prev && node.removeEventListener(e, prev);
1280
- value && node.addEventListener(e, value);
1286
+ prev && node.removeEventListener(e, prev, typeof prev !== "function" && prev);
1287
+ value && node.addEventListener(e, value, typeof value !== "function" && value);
1281
1288
  } else if (prop.slice(0, 10) === "oncapture:") {
1282
1289
  const e = prop.slice(10);
1283
1290
  prev && node.removeEventListener(e, prev, true);
@@ -1295,7 +1302,9 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
1295
1302
  }
1296
1303
  } else if (prop.slice(0, 5) === "attr:") {
1297
1304
  setAttribute(node, prop.slice(5), value);
1298
- } else if ((forceProp = prop.slice(0, 5) === "prop:") || (isChildProp = ChildProperties.has(prop)) || !isSVG && ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop))) || (isCE = node.nodeName.includes("-"))) {
1305
+ } else if (prop.slice(0, 5) === "bool:") {
1306
+ setBoolAttribute(node, prop.slice(5), value);
1307
+ } else if ((forceProp = prop.slice(0, 5) === "prop:") || (isChildProp = ChildProperties.has(prop)) || !isSVG && ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop))) || (isCE = node.nodeName.includes("-") || "is" in props)) {
1299
1308
  if (forceProp) {
1300
1309
  prop = prop.slice(5);
1301
1310
  isProp = true;
@@ -1314,30 +1323,51 @@ function eventHandler(e) {
1314
1323
  if (sharedConfig.registry && sharedConfig.events) {
1315
1324
  if (sharedConfig.events.find(([el, ev]) => ev === e)) return;
1316
1325
  }
1326
+ let node = e.target;
1317
1327
  const key = `$$${e.type}`;
1318
- let node = e.composedPath && e.composedPath()[0] || e.target;
1319
- if (e.target !== node) {
1320
- Object.defineProperty(e, "target", {
1321
- configurable: true,
1322
- value: node
1323
- });
1324
- }
1325
- Object.defineProperty(e, "currentTarget", {
1328
+ const oriTarget = e.target;
1329
+ const oriCurrentTarget = e.currentTarget;
1330
+ const retarget = (value) => Object.defineProperty(e, "target", {
1326
1331
  configurable: true,
1327
- get() {
1328
- return node || document;
1329
- }
1332
+ value
1330
1333
  });
1331
- if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;
1332
- while (node) {
1334
+ const handleNode = () => {
1333
1335
  const handler = node[key];
1334
1336
  if (handler && !node.disabled) {
1335
1337
  const data = node[`${key}Data`];
1336
1338
  data !== void 0 ? handler.call(node, data, e) : handler.call(node, e);
1337
1339
  if (e.cancelBubble) return;
1338
1340
  }
1339
- node = node._$host || node.parentNode || node.host;
1340
- }
1341
+ node.host && typeof node.host !== "string" && !node.host._$host && node.contains(e.target) && retarget(node.host);
1342
+ return true;
1343
+ };
1344
+ const walkUpTree = () => {
1345
+ while (handleNode() && (node = node._$host || node.parentNode || node.host)) ;
1346
+ };
1347
+ Object.defineProperty(e, "currentTarget", {
1348
+ configurable: true,
1349
+ get() {
1350
+ return node || document;
1351
+ }
1352
+ });
1353
+ if (sharedConfig.registry && !sharedConfig.done) sharedConfig.done = _$HY.done = true;
1354
+ if (e.composedPath) {
1355
+ const path = e.composedPath();
1356
+ retarget(path[0]);
1357
+ for (let i = 0; i < path.length - 2; i++) {
1358
+ node = path[i];
1359
+ if (!handleNode()) break;
1360
+ if (node._$host) {
1361
+ node = node._$host;
1362
+ walkUpTree();
1363
+ break;
1364
+ }
1365
+ if (node.parentNode === oriCurrentTarget) {
1366
+ break;
1367
+ }
1368
+ }
1369
+ } else walkUpTree();
1370
+ retarget(oriTarget);
1341
1371
  }
1342
1372
  function insertExpression(parent, value, current, marker, unwrapArray) {
1343
1373
  const hydrating = isHydrating(parent);
@@ -1515,13 +1545,13 @@ function Portal(props) {
1515
1545
  return marker;
1516
1546
  }
1517
1547
 
1518
- // ../../node_modules/.pnpm/nanostores@0.11.2/node_modules/nanostores/task/index.js
1548
+ // ../../node_modules/.pnpm/nanostores@0.11.3/node_modules/nanostores/task/index.js
1519
1549
  var tasks = 0;
1520
1550
  function cleanTasks() {
1521
1551
  tasks = 0;
1522
1552
  }
1523
1553
 
1524
- // ../../node_modules/.pnpm/nanostores@0.11.2/node_modules/nanostores/clean-stores/index.js
1554
+ // ../../node_modules/.pnpm/nanostores@0.11.3/node_modules/nanostores/clean-stores/index.js
1525
1555
  var clean = Symbol("clean");
1526
1556
  var cleanStores = (...stores) => {
1527
1557
  if (false) {
@@ -1538,7 +1568,7 @@ var cleanStores = (...stores) => {
1538
1568
  }
1539
1569
  };
1540
1570
 
1541
- // ../../node_modules/.pnpm/nanostores@0.11.2/node_modules/nanostores/atom/index.js
1571
+ // ../../node_modules/.pnpm/nanostores@0.11.3/node_modules/nanostores/atom/index.js
1542
1572
  var listenerQueue = [];
1543
1573
  var lqIndex = 0;
1544
1574
  var QUEUE_ITEMS_PER_LISTENER = 4;
@@ -1621,7 +1651,7 @@ var atom = (initialValue) => {
1621
1651
  return $atom;
1622
1652
  };
1623
1653
 
1624
- // ../../node_modules/.pnpm/nanostores@0.11.2/node_modules/nanostores/lifecycle/index.js
1654
+ // ../../node_modules/.pnpm/nanostores@0.11.3/node_modules/nanostores/lifecycle/index.js
1625
1655
  var MOUNT = 5;
1626
1656
  var UNMOUNT = 6;
1627
1657
  var REVERT_MUTATION = 10;
@@ -1691,7 +1721,7 @@ var onMount2 = ($store, initialize) => {
1691
1721
  });
1692
1722
  };
1693
1723
 
1694
- // ../../node_modules/.pnpm/nanostores@0.11.2/node_modules/nanostores/deep-map/path.js
1724
+ // ../../node_modules/.pnpm/nanostores@0.11.3/node_modules/nanostores/deep-map/path.js
1695
1725
  function getPath(obj, path) {
1696
1726
  let allKeys = getAllKeysFromPath(path);
1697
1727
  let res = obj;
@@ -1749,7 +1779,7 @@ function ensureKey(obj, key, nextKey) {
1749
1779
  }
1750
1780
  }
1751
1781
 
1752
- // ../../node_modules/.pnpm/nanostores@0.11.2/node_modules/nanostores/deep-map/index.js
1782
+ // ../../node_modules/.pnpm/nanostores@0.11.3/node_modules/nanostores/deep-map/index.js
1753
1783
  function deepMap(initial = {}) {
1754
1784
  let $deepMap = atom(initial);
1755
1785
  $deepMap.setKey = (key, value) => {
@@ -1762,82 +1792,6 @@ function deepMap(initial = {}) {
1762
1792
  return $deepMap;
1763
1793
  }
1764
1794
 
1765
- // ../../node_modules/.pnpm/dequal@2.0.3/node_modules/dequal/dist/index.mjs
1766
- var has = Object.prototype.hasOwnProperty;
1767
- function find(iter, tar, key) {
1768
- for (key of iter.keys()) {
1769
- if (dequal(key, tar)) return key;
1770
- }
1771
- }
1772
- function dequal(foo, bar) {
1773
- var ctor, len, tmp;
1774
- if (foo === bar) return true;
1775
- if (foo && bar && (ctor = foo.constructor) === bar.constructor) {
1776
- if (ctor === Date) return foo.getTime() === bar.getTime();
1777
- if (ctor === RegExp) return foo.toString() === bar.toString();
1778
- if (ctor === Array) {
1779
- if ((len = foo.length) === bar.length) {
1780
- while (len-- && dequal(foo[len], bar[len])) ;
1781
- }
1782
- return len === -1;
1783
- }
1784
- if (ctor === Set) {
1785
- if (foo.size !== bar.size) {
1786
- return false;
1787
- }
1788
- for (len of foo) {
1789
- tmp = len;
1790
- if (tmp && typeof tmp === "object") {
1791
- tmp = find(bar, tmp);
1792
- if (!tmp) return false;
1793
- }
1794
- if (!bar.has(tmp)) return false;
1795
- }
1796
- return true;
1797
- }
1798
- if (ctor === Map) {
1799
- if (foo.size !== bar.size) {
1800
- return false;
1801
- }
1802
- for (len of foo) {
1803
- tmp = len[0];
1804
- if (tmp && typeof tmp === "object") {
1805
- tmp = find(bar, tmp);
1806
- if (!tmp) return false;
1807
- }
1808
- if (!dequal(len[1], bar.get(tmp))) {
1809
- return false;
1810
- }
1811
- }
1812
- return true;
1813
- }
1814
- if (ctor === ArrayBuffer) {
1815
- foo = new Uint8Array(foo);
1816
- bar = new Uint8Array(bar);
1817
- } else if (ctor === DataView) {
1818
- if ((len = foo.byteLength) === bar.byteLength) {
1819
- while (len-- && foo.getInt8(len) === bar.getInt8(len)) ;
1820
- }
1821
- return len === -1;
1822
- }
1823
- if (ArrayBuffer.isView(foo)) {
1824
- if ((len = foo.byteLength) === bar.byteLength) {
1825
- while (len-- && foo[len] === bar[len]) ;
1826
- }
1827
- return len === -1;
1828
- }
1829
- if (!ctor || typeof foo === "object") {
1830
- len = 0;
1831
- for (ctor in foo) {
1832
- if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
1833
- if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
1834
- }
1835
- return Object.keys(bar).length === len;
1836
- }
1837
- }
1838
- return foo !== foo && bar !== bar;
1839
- }
1840
-
1841
1795
  // ../../node_modules/.pnpm/yocto-queue@1.1.1/node_modules/yocto-queue/index.js
1842
1796
  var Node = class {
1843
1797
  value;
@@ -1969,7 +1923,7 @@ function validateConcurrency(concurrency) {
1969
1923
  }
1970
1924
  }
1971
1925
 
1972
- // ../../node_modules/.pnpm/simple-web-audio@0.7.0_postcss@8.4.41/node_modules/simple-web-audio/dist/index.mjs
1926
+ // ../../node_modules/.pnpm/simple-web-audio@0.8.0_postcss@8.4.47/node_modules/simple-web-audio/dist/index.mjs
1973
1927
  var waitForInteraction = (() => {
1974
1928
  const { promise, resolve } = Promise.withResolvers();
1975
1929
  const onUserInteraction = () => {
@@ -2056,6 +2010,9 @@ var createMemo2 = () => {
2056
2010
  };
2057
2011
  var fetcherMemo = createMemo2();
2058
2012
  var decoderMemo = createMemo2();
2013
+ var onEndedOptions = {
2014
+ once: true
2015
+ };
2059
2016
  var createAudio = (options) => {
2060
2017
  let audioContext;
2061
2018
  let gainNode;
@@ -2236,6 +2193,10 @@ var createAudio = (options) => {
2236
2193
  if (state.destroyed) return;
2237
2194
  await fetchArrayBuffer();
2238
2195
  },
2196
+ onEnded: (callback) => {
2197
+ if (state.destroyed || !bufferSource) return;
2198
+ bufferSource.addEventListener("ended", callback, onEndedOptions);
2199
+ },
2239
2200
  get playing() {
2240
2201
  return state.playing;
2241
2202
  },
@@ -2273,19 +2234,6 @@ var prefetchAudio = (src) => {
2273
2234
  };
2274
2235
 
2275
2236
  // ../renderer-toolkit/dist/index.js
2276
- var memo = (input, cb) => {
2277
- const $memoized = atom(cb(input.get()));
2278
- const unsubscribe = input.subscribe((value) => {
2279
- const comparable = cb(value);
2280
- if (!dequal($memoized.get(), comparable)) {
2281
- $memoized.set(typeof comparable === "object" ? { ...comparable } : Array.isArray(comparable) ? [...comparable] : comparable);
2282
- }
2283
- });
2284
- onMount2($memoized, () => {
2285
- return unsubscribe;
2286
- });
2287
- return $memoized;
2288
- };
2289
2237
  var usePath = (atomValue, getPath2) => {
2290
2238
  const targets = /* @__PURE__ */ new Set();
2291
2239
  const path = [];
@@ -2437,9 +2385,9 @@ var createStartFunction = (fn) => {
2437
2385
  };
2438
2386
  };
2439
2387
  var TYPE_META_MAP = {
2440
- "music": 2,
2441
- "sound": 3,
2442
- "voice": 4
2388
+ music: 2,
2389
+ sound: 3,
2390
+ voice: 4
2443
2391
  };
2444
2392
  var createAudio2 = (storageData) => {
2445
2393
  const store = {
@@ -2601,25 +2549,6 @@ var createRootSetter = (getContext2) => {
2601
2549
  }
2602
2550
  };
2603
2551
  };
2604
- var vibrationPossible = /* @__PURE__ */ (() => {
2605
- let possible = false;
2606
- const onPointerDown = () => {
2607
- possible = true;
2608
- };
2609
- const isPossible = () => {
2610
- return possible;
2611
- };
2612
- document.addEventListener("pointerdown", onPointerDown, { once: true });
2613
- return isPossible;
2614
- })();
2615
- var vibrate = (pattern) => {
2616
- if (vibrationPossible() && "vibrate" in navigator) {
2617
- try {
2618
- navigator.vibrate(pattern);
2619
- } catch {
2620
- }
2621
- }
2622
- };
2623
2552
  var useBackground = (backgrounds, set) => {
2624
2553
  const mediaQueries = Object.keys(backgrounds).map((media) => matchMedia(media));
2625
2554
  const allMedia = mediaQueries.find(({ media }) => media === "all");
@@ -2648,6 +2577,25 @@ var useBackground = (backgrounds, set) => {
2648
2577
  }
2649
2578
  };
2650
2579
  };
2580
+ var vibrationPossible = /* @__PURE__ */ (() => {
2581
+ let possible = false;
2582
+ const onPointerDown = () => {
2583
+ possible = true;
2584
+ };
2585
+ const isPossible = () => {
2586
+ return possible;
2587
+ };
2588
+ document.addEventListener("pointerdown", onPointerDown, { once: true });
2589
+ return isPossible;
2590
+ })();
2591
+ var vibrate = (pattern) => {
2592
+ if (vibrationPossible() && "vibrate" in navigator) {
2593
+ try {
2594
+ navigator.vibrate(pattern);
2595
+ } catch {
2596
+ }
2597
+ }
2598
+ };
2651
2599
  var allEmpty = (target) => {
2652
2600
  if (typeof target === "string") {
2653
2601
  return target == "";
@@ -2677,28 +2625,25 @@ var handleBackgroundAction = ($contextState, background) => {
2677
2625
  const { dispose: dispose2 } = useBackground(background, (value) => {
2678
2626
  $contextState.mutate((s) => s.background.background, value);
2679
2627
  });
2680
- $contextState.mutate((s) => s.background.clear, () => dispose2);
2681
- };
2682
- var handleDialogAction = ($contextState, content, name, character, emotion, resolve) => {
2683
2628
  $contextState.mutate(
2684
- (s) => s.dialog,
2685
- {
2686
- content,
2687
- name,
2688
- miniature: {
2689
- character,
2690
- emotion
2691
- },
2692
- visible: true,
2693
- resolve
2694
- }
2629
+ (s) => s.background.clear,
2630
+ () => dispose2
2695
2631
  );
2696
2632
  };
2633
+ var handleDialogAction = ($contextState, content, name, character, emotion, resolve) => {
2634
+ $contextState.mutate((s) => s.dialog, {
2635
+ content,
2636
+ name,
2637
+ miniature: {
2638
+ character,
2639
+ emotion
2640
+ },
2641
+ visible: true,
2642
+ resolve
2643
+ });
2644
+ };
2697
2645
  var handleChoiceAction = ($contextState, label, choices, resolve) => {
2698
- $contextState.mutate(
2699
- (s) => s.choice,
2700
- { choices, label, resolve, visible: true }
2701
- );
2646
+ $contextState.mutate((s) => s.choice, { choices, label, resolve, visible: true });
2702
2647
  };
2703
2648
  var handleClearAction = ($rendererState, $contextState, options, context, keep, keepCharacters) => {
2704
2649
  $rendererState.mutate((s) => s.exitPromptShown, false);
@@ -2706,40 +2651,31 @@ var handleClearAction = ($rendererState, $contextState, options, context, keep,
2706
2651
  $contextState.mutate((s) => s.background.background, "#000");
2707
2652
  }
2708
2653
  if (!keep.has("choice")) {
2709
- $contextState.mutate(
2710
- (s) => s.choice,
2711
- {
2712
- choices: [],
2713
- visible: false,
2714
- label: ""
2715
- }
2716
- );
2654
+ $contextState.mutate((s) => s.choice, {
2655
+ choices: [],
2656
+ visible: false,
2657
+ label: ""
2658
+ });
2717
2659
  }
2718
2660
  const inputCleanup = $contextState.get().input.cleanup;
2719
2661
  if (inputCleanup) {
2720
2662
  inputCleanup();
2721
2663
  }
2722
2664
  if (!keep.has("input")) {
2723
- $contextState.mutate(
2724
- (s) => s.input,
2725
- {
2726
- element: null,
2727
- label: "",
2728
- visible: false,
2729
- error: ""
2730
- }
2731
- );
2665
+ $contextState.mutate((s) => s.input, {
2666
+ element: null,
2667
+ label: "",
2668
+ visible: false,
2669
+ error: ""
2670
+ });
2732
2671
  }
2733
2672
  if (!keep.has("dialog")) {
2734
- $contextState.mutate(
2735
- (s) => s.dialog,
2736
- {
2737
- visible: false,
2738
- content: "",
2739
- name: "",
2740
- miniature: {}
2741
- }
2742
- );
2673
+ $contextState.mutate((s) => s.dialog, {
2674
+ visible: false,
2675
+ content: "",
2676
+ name: "",
2677
+ miniature: {}
2678
+ });
2743
2679
  }
2744
2680
  if (!keep.has("text")) {
2745
2681
  $contextState.mutate((s) => s.text, { content: "" });
@@ -2747,13 +2683,10 @@ var handleClearAction = ($rendererState, $contextState, options, context, keep,
2747
2683
  const { characters, custom } = $contextState.get();
2748
2684
  for (const character of Object.keys(characters)) {
2749
2685
  if (!keepCharacters.has(character)) {
2750
- $contextState.mutate(
2751
- (s) => s.characters[character],
2752
- {
2753
- style: void 0,
2754
- visible: false
2755
- }
2756
- );
2686
+ $contextState.mutate((s) => s.characters[character], {
2687
+ style: void 0,
2688
+ visible: false
2689
+ });
2757
2690
  }
2758
2691
  }
2759
2692
  for (const [id, obj] of Object.entries(custom)) {
@@ -2765,14 +2698,11 @@ var handleClearAction = ($rendererState, $contextState, options, context, keep,
2765
2698
  };
2766
2699
  var handleCustomAction = ($contextState, fn) => {
2767
2700
  if (!$contextState.get().custom[fn.key]) {
2768
- $contextState.mutate(
2769
- (s) => s.custom[fn.key],
2770
- {
2771
- fn,
2772
- node: null,
2773
- clear: noop
2774
- }
2775
- );
2701
+ $contextState.mutate((s) => s.custom[fn.key], {
2702
+ fn,
2703
+ node: null,
2704
+ clear: noop
2705
+ });
2776
2706
  }
2777
2707
  return {
2778
2708
  setMountElement(node) {
@@ -2805,39 +2735,30 @@ var handleCustomAction = ($contextState, fn) => {
2805
2735
  var handleClearBlockingActions = ($contextState, preserve) => {
2806
2736
  const current = $contextState.get();
2807
2737
  if (preserve !== "choice" && !allEmpty(current.choice)) {
2808
- $contextState.mutate(
2809
- (s) => s.choice,
2810
- {
2811
- choices: [],
2812
- visible: false,
2813
- label: ""
2814
- }
2815
- );
2738
+ $contextState.mutate((s) => s.choice, {
2739
+ choices: [],
2740
+ visible: false,
2741
+ label: ""
2742
+ });
2816
2743
  }
2817
2744
  if (preserve !== "input" && !allEmpty(current.input)) {
2818
- $contextState.mutate(
2819
- (s) => s.input,
2820
- {
2821
- element: null,
2822
- label: "",
2823
- visible: false,
2824
- error: ""
2825
- }
2826
- );
2745
+ $contextState.mutate((s) => s.input, {
2746
+ element: null,
2747
+ label: "",
2748
+ visible: false,
2749
+ error: ""
2750
+ });
2827
2751
  }
2828
2752
  if (preserve !== "text" && !allEmpty(current.text)) {
2829
2753
  $contextState.mutate((s) => s.text, { content: "" });
2830
2754
  }
2831
2755
  if (preserve !== "dialog" && !allEmpty(current.dialog)) {
2832
- $contextState.mutate(
2833
- (s) => s.dialog,
2834
- {
2835
- visible: false,
2836
- content: "",
2837
- name: "",
2838
- miniature: {}
2839
- }
2840
- );
2756
+ $contextState.mutate((s) => s.dialog, {
2757
+ visible: false,
2758
+ content: "",
2759
+ name: "",
2760
+ miniature: {}
2761
+ });
2841
2762
  }
2842
2763
  };
2843
2764
  var handleTextAction = ($contextState, content, resolve) => {
@@ -2868,62 +2789,18 @@ var handleInputAction = ($contextState, options, context, label, onInput, setup,
2868
2789
  input.setAttribute("required", "true");
2869
2790
  input.setAttribute("autocomplete", "off");
2870
2791
  !context.meta.preview && input.addEventListener("input", onInputHandler);
2871
- $contextState.mutate(
2872
- (s) => s.input,
2873
- {
2874
- element: input,
2875
- label,
2876
- error: "",
2877
- visible: true,
2878
- cleanup: setup(input) || noop,
2879
- resolve
2880
- }
2881
- );
2792
+ $contextState.mutate((s) => s.input, {
2793
+ element: input,
2794
+ label,
2795
+ error: "",
2796
+ visible: true,
2797
+ cleanup: setup(input) || noop,
2798
+ resolve
2799
+ });
2882
2800
  !context.meta.preview && input.dispatchEvent(new InputEvent("input", { bubbles: true }));
2883
2801
  };
2884
2802
  var handleVibrateAction = vibrate;
2885
2803
 
2886
- // src/emitter.ts
2887
- var createEmitter = () => {
2888
- const listeners = /* @__PURE__ */ new Map();
2889
- return {
2890
- on(name, fn) {
2891
- const set = listeners.get(name);
2892
- if (!set) {
2893
- listeners.set(name, /* @__PURE__ */ new Set());
2894
- return this.on(name, fn);
2895
- }
2896
- set.add(fn);
2897
- },
2898
- once(name, fn) {
2899
- const listener = (params) => {
2900
- fn(params);
2901
- this.off(name, listener);
2902
- };
2903
- this.on(name, listener);
2904
- },
2905
- off(name, fn) {
2906
- const set = listeners.get(name);
2907
- if (set) {
2908
- set.delete(fn);
2909
- }
2910
- },
2911
- emit(name, params) {
2912
- const set = listeners.get(name);
2913
- if (set) {
2914
- set.forEach((fn) => fn(params));
2915
- }
2916
- }
2917
- };
2918
- };
2919
-
2920
- // src/context-state.ts
2921
- var { useContextState, removeContextState } = createContextStateRoot(() => {
2922
- return {
2923
- images: {}
2924
- };
2925
- });
2926
-
2927
2804
  // src/shared.ts
2928
2805
  var PRELOADED_IMAGE_MAP = /* @__PURE__ */ new Map();
2929
2806
  var PRELOADING_IMAGE_MAP = /* @__PURE__ */ new Map();
@@ -3073,6 +2950,11 @@ var from = (producer) => {
3073
2950
  onCleanup(producer.subscribe(set));
3074
2951
  return s;
3075
2952
  };
2953
+ var removeTagsFromHTML = (html) => {
2954
+ const container = document.createElement("div");
2955
+ container.innerHTML = html;
2956
+ return container.textContent || "";
2957
+ };
3076
2958
 
3077
2959
  // src/hooks/useMedia.ts
3078
2960
  var useMedia = (media) => {
@@ -3109,7 +2991,8 @@ var Provider = (props) => {
3109
2991
  hyperWide: useMedia("(max-aspect-ratio: 0.26)")
3110
2992
  },
3111
2993
  getContext: props.getContext,
3112
- removeContext: props.removeContext
2994
+ removeContext: props.removeContext,
2995
+ audio: props.audio
3113
2996
  };
3114
2997
  return createComponent(Context.Provider, {
3115
2998
  value,
@@ -3171,6 +3054,13 @@ var CustomScreen = (props) => {
3171
3054
  };
3172
3055
  delegateEvents(["click"]);
3173
3056
 
3057
+ // src/actions.ts
3058
+ var clickOutside = (node, handler) => {
3059
+ const handleClick = (event) => node && !node.contains(event.target) && !event.defaultPrevented && handler && handler();
3060
+ document.addEventListener("click", handleClick, true);
3061
+ onCleanup(() => document.removeEventListener("click", handleClick, true));
3062
+ };
3063
+
3174
3064
  // src/components/Character.tsx
3175
3065
  var Character = (props) => {
3176
3066
  const canvas = () => props.characters[props.character].canvas;
@@ -3179,101 +3069,94 @@ var Character = (props) => {
3179
3069
  };
3180
3070
 
3181
3071
  // src/components/ControlPanelButtons.tsx
3182
- var _tmpl$2 = /* @__PURE__ */ template(`<button role="menuitem" type="button" class="button control-panel__button"><span class="control-panel__button__content">`);
3183
- var _tmpl$22 = /* @__PURE__ */ template(`<button role="menuitem" type="button" class="button control-panel__button control-panel__button--auto-mode"><span class="control-panel__button__content">`);
3184
- var _tmpl$3 = /* @__PURE__ */ template(`<button role="menuitem" type="button" class="button control-panel__button">`);
3072
+ var _tmpl$2 = /* @__PURE__ */ template(`<button role="menuitem" type="button" class="button control-panel__button"><span class="control-panel__button__content"></span><svg class="control-panel__button__icon" width="24" height="24" viewBox="0 0 256 256"><use href="#novely-back-icon">`);
3073
+ var _tmpl$22 = /* @__PURE__ */ template(`<button role="menuitem" type="button" class="button control-panel__button" data-dialog-overview-button><span class="control-panel__button__content"></span><svg class="control-panel__button__icon" width="24" height="24" viewBox="0 0 256 256"><use href="#novely-book-open-icon">`);
3074
+ var _tmpl$3 = /* @__PURE__ */ template(`<button role="menuitem" type="button" class="button control-panel__button"><span class="control-panel__button__content"></span><svg class="control-panel__button__icon" width="24" height="24" viewBox="0 0 256 256"><use href="#novely-save-icon">`);
3075
+ var _tmpl$4 = /* @__PURE__ */ template(`<button role="menuitem" type="button" class="button control-panel__button control-panel__button--auto-mode"><span class="control-panel__button__content"></span><svg class="control-panel__button__icon" width="24" height="24" viewBox="0 0 256 256"><use>`);
3076
+ var _tmpl$5 = /* @__PURE__ */ template(`<button role="menuitem" type="button" class="button control-panel__button"><span class="control-panel__button__content"></span><svg class="control-panel__button__icon" width="24" height="24" viewBox="0 0 256 256"><use href="#novely-files-icon">`);
3077
+ var _tmpl$6 = /* @__PURE__ */ template(`<button role="menuitem" type="button" class="button control-panel__button"><span class="control-panel__button__content"></span><svg class="control-panel__button__icon" width="24" height="24" viewBox="0 0 256 256"><use href="#novely-x-icon">`);
3078
+ var _tmpl$7 = /* @__PURE__ */ template(`<button role="menuitem" type="button" class="button control-panel__button"><svg width="24" height="24" viewBox="0 0 256 256"><use href="#novely-x-icon">`);
3185
3079
  var ControlPanelButtons = (props) => {
3186
3080
  const data = useData();
3187
3081
  return [(() => {
3188
3082
  const _el$ = _tmpl$2(), _el$2 = _el$.firstChild;
3189
3083
  addEventListener2(_el$, "click", data.options.back, true);
3190
3084
  insert(_el$2, () => data.t("GoBack"));
3191
- insert(_el$, createComponent(Icon, {
3192
- "class": "control-panel__button__icon",
3193
- children: Icon.Back()
3194
- }), null);
3195
3085
  createRenderEffect(() => setAttribute(_el$, "title", data.t("GoBack")));
3196
3086
  return _el$;
3197
3087
  })(), (() => {
3198
- const _el$3 = _tmpl$2(), _el$4 = _el$3.firstChild;
3199
- _el$3.$$click = () => {
3200
- data.options.save("manual");
3201
- };
3202
- insert(_el$4, () => data.t("DoSave"));
3203
- insert(_el$3, createComponent(Icon, {
3204
- "class": "control-panel__button__icon",
3205
- children: Icon.Save()
3206
- }), null);
3207
- createRenderEffect(() => setAttribute(_el$3, "title", data.t("DoSave")));
3088
+ const _el$3 = _tmpl$22(), _el$4 = _el$3.firstChild;
3089
+ addEventListener2(_el$3, "click", props.openDialogOverview, true);
3090
+ insert(_el$4, () => data.t("DialogOverview"));
3091
+ createRenderEffect(() => setAttribute(_el$3, "title", data.t("DialogOverview")));
3208
3092
  return _el$3;
3209
3093
  })(), (() => {
3210
- const _el$5 = _tmpl$22(), _el$6 = _el$5.firstChild;
3094
+ const _el$5 = _tmpl$3(), _el$6 = _el$5.firstChild;
3211
3095
  _el$5.$$click = () => {
3212
- props.setAuto((prev) => !prev);
3096
+ data.options.save("manual");
3213
3097
  };
3214
- insert(_el$6, () => data.t(props.auto() ? "Stop" : "Auto"));
3215
- insert(_el$5, createComponent(Icon, {
3216
- "class": "control-panel__button__icon",
3217
- get children() {
3218
- return createMemo(() => !!props.auto())() ? createComponent(Icon.Stop, {}) : createComponent(Icon.Play, {});
3219
- }
3220
- }), null);
3221
- createRenderEffect(() => setAttribute(_el$5, "title", data.t(props.auto() ? "Stop" : "Auto")));
3098
+ insert(_el$6, () => data.t("DoSave"));
3099
+ createRenderEffect(() => setAttribute(_el$5, "title", data.t("DoSave")));
3222
3100
  return _el$5;
3223
3101
  })(), (() => {
3224
- const _el$7 = _tmpl$2(), _el$8 = _el$7.firstChild;
3102
+ const _el$7 = _tmpl$4(), _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling, _el$10 = _el$9.firstChild;
3225
3103
  _el$7.$$click = () => {
3104
+ props.setAuto((prev) => !prev);
3105
+ };
3106
+ insert(_el$8, () => data.t(props.auto() ? "Stop" : "Auto"));
3107
+ createRenderEffect((_p$) => {
3108
+ const _v$ = data.t(props.auto() ? "Stop" : "Auto"), _v$2 = props.auto() ? "#novely-stop-icon" : "#novely-play-icon";
3109
+ _v$ !== _p$._v$ && setAttribute(_el$7, "title", _p$._v$ = _v$);
3110
+ _v$2 !== _p$._v$2 && setAttribute(_el$10, "href", _p$._v$2 = _v$2);
3111
+ return _p$;
3112
+ }, {
3113
+ _v$: void 0,
3114
+ _v$2: void 0
3115
+ });
3116
+ return _el$7;
3117
+ })(), (() => {
3118
+ const _el$11 = _tmpl$5(), _el$12 = _el$11.firstChild;
3119
+ _el$11.$$click = () => {
3226
3120
  data.options.save("auto");
3227
3121
  data.options.exit(true);
3228
3122
  props.openSettings();
3229
3123
  };
3230
- insert(_el$8, () => data.t("Settings"));
3231
- insert(_el$7, createComponent(Icon, {
3232
- "class": "control-panel__button__icon",
3233
- children: Icon.Settings()
3234
- }), null);
3235
- createRenderEffect(() => setAttribute(_el$7, "title", data.t("Settings")));
3236
- return _el$7;
3124
+ insert(_el$12, () => data.t("Settings"));
3125
+ createRenderEffect(() => setAttribute(_el$11, "title", data.t("Settings")));
3126
+ return _el$11;
3237
3127
  })(), (() => {
3238
- const _el$9 = _tmpl$2(), _el$10 = _el$9.firstChild;
3239
- _el$9.$$click = () => {
3128
+ const _el$13 = _tmpl$6(), _el$14 = _el$13.firstChild;
3129
+ _el$13.$$click = () => {
3240
3130
  data.options.exit();
3241
3131
  };
3242
- insert(_el$10, () => data.t("Exit"));
3243
- insert(_el$9, createComponent(Icon, {
3244
- "class": "control-panel__button__icon",
3245
- children: Icon.Exit()
3246
- }), null);
3247
- createRenderEffect(() => setAttribute(_el$9, "title", data.t("Exit")));
3248
- return _el$9;
3132
+ insert(_el$14, () => data.t("Exit"));
3133
+ createRenderEffect(() => setAttribute(_el$13, "title", data.t("Exit")));
3134
+ return _el$13;
3249
3135
  })(), createComponent(Show, {
3250
3136
  get when() {
3251
3137
  return data.media.hyperWide();
3252
3138
  },
3253
3139
  get children() {
3254
- const _el$11 = _tmpl$3();
3255
- _el$11.$$click = () => {
3140
+ const _el$15 = _tmpl$7();
3141
+ _el$15.$$click = () => {
3256
3142
  props.closeDropdown();
3257
3143
  };
3258
- insert(_el$11, createComponent(Icon, {
3259
- children: Icon.Close()
3260
- }));
3261
- createRenderEffect(() => setAttribute(_el$11, "title", data.t("CloseMenu")));
3262
- return _el$11;
3144
+ createRenderEffect(() => setAttribute(_el$15, "title", data.t("CloseMenu")));
3145
+ return _el$15;
3263
3146
  }
3264
3147
  })];
3265
3148
  };
3266
3149
  delegateEvents(["click"]);
3267
3150
 
3268
3151
  // src/components/DialogName.tsx
3269
- var _tmpl$4 = /* @__PURE__ */ template(`<span class="action-dialog-name">`);
3152
+ var _tmpl$8 = /* @__PURE__ */ template(`<span class="action-dialog-name">`);
3270
3153
  var DialogName = (props) => {
3271
3154
  const data = useData();
3272
3155
  const color = () => {
3273
3156
  return props.character ? data.options.getCharacterColor(props.character) : "#000";
3274
3157
  };
3275
3158
  return (() => {
3276
- const _el$ = _tmpl$4();
3159
+ const _el$ = _tmpl$8();
3277
3160
  insert(_el$, () => props.name || " ");
3278
3161
  createRenderEffect((_p$) => {
3279
3162
  const _v$ = color(), _v$2 = props.character ? 1 : 0, _v$3 = props.character ? "visible" : "hidden";
@@ -3290,69 +3173,6 @@ var DialogName = (props) => {
3290
3173
  })();
3291
3174
  };
3292
3175
 
3293
- // src/components/Icon.tsx
3294
- var _tmpl$5 = /* @__PURE__ */ template(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5">`);
3295
- var _tmpl$23 = /* @__PURE__ */ template(`<svg><path d="m9.75 12 8.5-6.25v12.5L9.75 12ZM5.75 5.75v12.5"></svg>`, false, true);
3296
- var _tmpl$32 = /* @__PURE__ */ template(`<svg><path d="M6.75 19.25h10.5a2 2 0 0 0 2-2V9.828a2 2 0 0 0-.586-1.414l-3.078-3.078a2 2 0 0 0-1.414-.586H6.75a2 2 0 0 0-2 2v10.5a2 2 0 0 0 2 2Z"></svg>`, false, true);
3297
- var _tmpl$42 = /* @__PURE__ */ template(`<svg><path d="M8.75 19v-3.25a1 1 0 0 1 1-1h4.5a1 1 0 0 1 1 1V19M8.75 5v3.25"></svg>`, false, true);
3298
- var _tmpl$52 = /* @__PURE__ */ template(`<svg><path d="M13.12 5.613a1 1 0 0 0-.991-.863h-.258a1 1 0 0 0-.99.863l-.087.632c-.056.403-.354.724-.732.874a5.225 5.225 0 0 0-.167.07c-.373.163-.81.15-1.136-.095l-.308-.23a1 1 0 0 0-1.307.092l-.188.188a1 1 0 0 0-.092 1.307l.23.308c.244.325.258.763.095 1.136a5.225 5.225 0 0 0-.07.167c-.15.378-.47.676-.874.732l-.632.087a1 1 0 0 0-.863.99v.258a1 1 0 0 0 .863.99l.632.087c.403.056.724.354.874.732l.07.167c.163.373.15.81-.095 1.136l-.23.308a1 1 0 0 0 .092 1.307l.188.188a1 1 0 0 0 1.307.093l.308-.231c.325-.244.763-.258 1.136-.095a5.4 5.4 0 0 0 .167.07c.378.15.676.47.732.874l.087.632a1 1 0 0 0 .99.863h.258a1 1 0 0 0 .99-.863l.087-.632c.056-.403.354-.724.732-.874a5.12 5.12 0 0 0 .167-.07c.373-.163.81-.15 1.136.095l.308.23a1 1 0 0 0 1.307-.092l.188-.188a1 1 0 0 0 .093-1.307l-.231-.308c-.244-.325-.258-.763-.095-1.136l.07-.167c.15-.378.47-.676.874-.732l.632-.087a1 1 0 0 0 .863-.99v-.258a1 1 0 0 0-.863-.99l-.632-.087c-.403-.056-.724-.354-.874-.732a5.168 5.168 0 0 0-.07-.167c-.163-.373-.15-.81.095-1.136l.23-.308a1 1 0 0 0-.092-1.307l-.188-.188a1 1 0 0 0-1.307-.092l-.308.23c-.325.244-.763.258-1.136.095a5.185 5.185 0 0 0-.167-.07c-.378-.15-.676-.47-.732-.874l-.087-.632Z"></svg>`, false, true);
3299
- var _tmpl$6 = /* @__PURE__ */ template(`<svg><path d="M13.25 12a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0Z"></svg>`, false, true);
3300
- var _tmpl$7 = /* @__PURE__ */ template(`<svg><path d="m15.75 8.75 3.5 3.25-3.5 3.25M19 12h-8.25M15.25 4.75h-8.5a2 2 0 0 0-2 2v10.5a2 2 0 0 0 2 2h8.5"></svg>`, false, true);
3301
- var _tmpl$8 = /* @__PURE__ */ template(`<svg><path d="M4.75 5.75h14.5M4.75 18.25h14.5M4.75 12h14.5"></svg>`, false, true);
3302
- var _tmpl$9 = /* @__PURE__ */ template(`<svg><path d="m17.25 6.75-10.5 10.5M6.75 6.75l10.5 10.5"></svg>`, false, true);
3303
- var _tmpl$10 = /* @__PURE__ */ template(`<svg><path d="M4.75 6.75a2 2 0 0 1 2-2h10.5a2 2 0 0 1 2 2v10.5a2 2 0 0 1-2 2H6.75a2 2 0 0 1-2-2V6.75Z"></svg>`, false, true);
3304
- var _tmpl$11 = /* @__PURE__ */ template(`<svg><path d="m15.25 12-5.5-3.25v6.5l5.5-3.25Z"></svg>`, false, true);
3305
- var _tmpl$12 = /* @__PURE__ */ template(`<svg><rect width="12.5" height="12.5" x="5.75" y="5.75" rx="1"></svg>`, false, true);
3306
- var _tmpl$13 = /* @__PURE__ */ template(`<svg><path d="M11.25 19.25h-3.5a2 2 0 0 1-2-2V6.75a2 2 0 0 1 2-2H14L18.25 9v2.25M17 14.75v4.5M19.25 17h-4.5"></svg>`, false, true);
3307
- var _tmpl$14 = /* @__PURE__ */ template(`<svg><path d="M18 9.25h-4.25V5"></svg>`, false, true);
3308
- var _tmpl$15 = /* @__PURE__ */ template(`<svg><path d="M9.75 6.75h-3a2 2 0 0 0-2 2v8.5a2 2 0 0 0 2 2h6.5a2 2 0 0 0 2-2v-5m-5.5-5.5 5.5 5.5m-5.5-5.5v3.5a2 2 0 0 0 2 2h3.5m-3.5-7.5h2l5.5 5.5v5a2 2 0 0 1-2 2H15.5"></svg>`, false, true);
3309
- var _tmpl$16 = /* @__PURE__ */ template(`<svg><path d="M15.25 10.75 12 14.25l-3.25-3.5"></svg>`, false, true);
3310
- var _tmpl$17 = /* @__PURE__ */ template(`<svg><path d="M15.25 14.25 12 10.75l-3.25 3.5"></svg>`, false, true);
3311
- var Icon = (props) => {
3312
- return (() => {
3313
- const _el$ = _tmpl$5();
3314
- spread(_el$, props, true, true);
3315
- insert(_el$, () => props.children);
3316
- return _el$;
3317
- })();
3318
- };
3319
- Icon.Back = () => {
3320
- return _tmpl$23();
3321
- };
3322
- Icon.Save = () => {
3323
- return [_tmpl$32(), _tmpl$42()];
3324
- };
3325
- Icon.Settings = () => {
3326
- return [_tmpl$52(), _tmpl$6()];
3327
- };
3328
- Icon.Exit = () => {
3329
- return _tmpl$7();
3330
- };
3331
- Icon.Menu = () => {
3332
- return _tmpl$8();
3333
- };
3334
- Icon.Close = () => {
3335
- return _tmpl$9();
3336
- };
3337
- Icon.Play = () => {
3338
- return [_tmpl$10(), _tmpl$11()];
3339
- };
3340
- Icon.Stop = () => {
3341
- return _tmpl$12();
3342
- };
3343
- Icon.FilePlus = () => {
3344
- return [_tmpl$13(), _tmpl$14()];
3345
- };
3346
- Icon.Files = () => {
3347
- return _tmpl$15();
3348
- };
3349
- Icon.ChevronDown = () => {
3350
- return _tmpl$16();
3351
- };
3352
- Icon.ChevronUp = () => {
3353
- return _tmpl$17();
3354
- };
3355
-
3356
3176
  // ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
3357
3177
  function r(e) {
3358
3178
  var t, f, n = "";
@@ -3369,7 +3189,7 @@ function clsx() {
3369
3189
  }
3370
3190
 
3371
3191
  // src/components/Modal.tsx
3372
- var _tmpl$18 = /* @__PURE__ */ template(`<dialog>`);
3192
+ var _tmpl$9 = /* @__PURE__ */ template(`<dialog>`);
3373
3193
  var Modal = (props) => {
3374
3194
  const [it, rest] = splitProps(props, ["isOpen", "setIsOpen", "trapFocus", "isModal"]);
3375
3195
  let dialog;
@@ -3397,7 +3217,7 @@ var Modal = (props) => {
3397
3217
  dialog[it.isOpen() ? it.isModal ? "showModal" : "show" : "close"]();
3398
3218
  });
3399
3219
  return (() => {
3400
- const _el$ = _tmpl$18();
3220
+ const _el$ = _tmpl$9();
3401
3221
  const _ref$ = dialog;
3402
3222
  typeof _ref$ === "function" ? use(_ref$, _el$) : dialog = _el$;
3403
3223
  spread(_el$, mergeProps(rest, {
@@ -3409,7 +3229,7 @@ var Modal = (props) => {
3409
3229
  })();
3410
3230
  };
3411
3231
 
3412
- // ../../node_modules/.pnpm/@solid-primitives+transition-group@1.0.5_solid-js@1.8.21/node_modules/@solid-primitives/transition-group/dist/index.js
3232
+ // ../../node_modules/.pnpm/@solid-primitives+transition-group@1.0.5_solid-js@1.9.3/node_modules/@solid-primitives/transition-group/dist/index.js
3413
3233
  var noop2 = () => {
3414
3234
  };
3415
3235
  var noopTransition = (el, done) => done();
@@ -3477,10 +3297,10 @@ function createSwitchTransition(source, options) {
3477
3297
  return returned;
3478
3298
  }
3479
3299
 
3480
- // ../../node_modules/.pnpm/@solid-primitives+utils@6.2.3_solid-js@1.8.21/node_modules/@solid-primitives/utils/dist/chunk/R5675YMU.js
3300
+ // ../../node_modules/.pnpm/@solid-primitives+utils@6.2.3_solid-js@1.9.3/node_modules/@solid-primitives/utils/dist/chunk/R5675YMU.js
3481
3301
  var access = (v) => typeof v === "function" && !v.length ? v() : v;
3482
3302
 
3483
- // ../../node_modules/.pnpm/@solid-primitives+refs@1.0.8_solid-js@1.8.21/node_modules/@solid-primitives/refs/dist/index.js
3303
+ // ../../node_modules/.pnpm/@solid-primitives+refs@1.0.8_solid-js@1.9.3/node_modules/@solid-primitives/refs/dist/index.js
3484
3304
  var defaultElementPredicate = isServer ? (item) => item != null && typeof item === "object" && "t" in item : (item) => item instanceof Element;
3485
3305
  function getFirstChild(value, predicate) {
3486
3306
  if (predicate(value))
@@ -3501,7 +3321,7 @@ function resolveFirst(fn, predicate = defaultElementPredicate, serverPredicate =
3501
3321
  return createMemo(() => getFirstChild(children2(), isServer ? serverPredicate : predicate));
3502
3322
  }
3503
3323
 
3504
- // ../../node_modules/.pnpm/solid-transition-group@0.2.3_solid-js@1.8.21/node_modules/solid-transition-group/dist/index.js
3324
+ // ../../node_modules/.pnpm/solid-transition-group@0.2.3_solid-js@1.9.3/node_modules/solid-transition-group/dist/index.js
3505
3325
  function createClassnames(props) {
3506
3326
  return createMemo(() => {
3507
3327
  const name = props.name || "s";
@@ -3596,14 +3416,27 @@ var Transition2 = (props) => {
3596
3416
  );
3597
3417
  };
3598
3418
 
3419
+ // src/context-state.ts
3420
+ var { useContextState, removeContextState } = createContextStateRoot(() => {
3421
+ return {
3422
+ images: {},
3423
+ dialogOverviewShown: false
3424
+ };
3425
+ });
3426
+
3599
3427
  // src/components/Save.tsx
3600
- var _tmpl$19 = /* @__PURE__ */ template(`<div class="saves__list-item__overlay">`);
3601
- var _tmpl$24 = /* @__PURE__ */ template(`<iframe tabindex="-1" class="saves__list-item__iframe" src="about:blank">`);
3602
- var _tmpl$33 = /* @__PURE__ */ template(`<li class="saves__list-item"><div class="saves__list-item__load" role="button" tabindex="0"></div><div class="saves__list-item__description"><div></div><div></div></div><button type="reset" class="button saves__button-reset"><span>`);
3603
- var _tmpl$43 = /* @__PURE__ */ template(`<div class="saves__list-item__iframe">`);
3428
+ var _tmpl$10 = /* @__PURE__ */ template(`<div class="saves__list-item__overlay">`);
3429
+ var _tmpl$23 = /* @__PURE__ */ template(`<iframe tabindex="-1" class="saves__list-item__iframe" src="about:blank">`);
3430
+ var _tmpl$32 = /* @__PURE__ */ template(`<li class="saves__list-item"><div class="saves__list-item__load" role="button" tabindex="0"></div><div class="saves__list-item__description"><div></div><div></div></div><button type="reset" class="button saves__button-reset"><span>`);
3431
+ var _tmpl$42 = /* @__PURE__ */ template(`<div class="saves__list-item__iframe">`);
3604
3432
  var CURRENT_DATE = /* @__PURE__ */ new Date();
3605
3433
  var CURRENT_YEAR = CURRENT_DATE.getFullYear();
3606
3434
  var stylesheet = createRetrieved(getDocumentStyles);
3435
+ var style2 = createRetrieved(() => {
3436
+ const element = document.createElement("style");
3437
+ element.innerHTML = stylesheet();
3438
+ return element;
3439
+ });
3607
3440
  var Save = (props) => {
3608
3441
  const {
3609
3442
  t,
@@ -3651,7 +3484,9 @@ var Save = (props) => {
3651
3484
  contentDocument
3652
3485
  } = iframe();
3653
3486
  if (!contentDocument) return;
3654
- contentDocument.head.insertAdjacentHTML("beforeend", `<style>:root { font-size: 30%; background: black; cursor: pointer; } * { pointer-events: none; } *, *::before, *::after { animation-play-state: paused !important; }</style><style>${stylesheet()}</style>`);
3487
+ contentDocument.head.insertAdjacentHTML("beforeend", `<style>:root { font-size: 30%; background: black; cursor: pointer; } * { pointer-events: none; } *, *::before, *::after { animation-play-state: paused !important; }</style>`);
3488
+ const styleClone = contentDocument.importNode(style2(), true);
3489
+ contentDocument.head.appendChild(styleClone);
3655
3490
  context.root = contentDocument.body;
3656
3491
  setIframeLoaded(true);
3657
3492
  };
@@ -3699,7 +3534,7 @@ var Save = (props) => {
3699
3534
  clearTimeout(previewDoneTimeoutId);
3700
3535
  });
3701
3536
  return (() => {
3702
- const _el$ = _tmpl$33(), _el$2 = _el$.firstChild, _el$5 = _el$2.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$8 = _el$5.nextSibling, _el$9 = _el$8.firstChild;
3537
+ const _el$ = _tmpl$32(), _el$2 = _el$.firstChild, _el$5 = _el$2.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$8 = _el$5.nextSibling, _el$9 = _el$8.firstChild;
3703
3538
  setAttribute(_el$, "data-timestamp", timestamp);
3704
3539
  _el$2.$$keyup = (event) => {
3705
3540
  if (event.code === "Space") {
@@ -3720,7 +3555,7 @@ var Save = (props) => {
3720
3555
  return props.overlayShown;
3721
3556
  },
3722
3557
  get children() {
3723
- return _tmpl$19();
3558
+ return _tmpl$10();
3724
3559
  }
3725
3560
  });
3726
3561
  }
@@ -3730,11 +3565,11 @@ var Save = (props) => {
3730
3565
  return props.observed;
3731
3566
  },
3732
3567
  get fallback() {
3733
- return _tmpl$43();
3568
+ return _tmpl$42();
3734
3569
  },
3735
3570
  get children() {
3736
3571
  return [(() => {
3737
- const _el$4 = _tmpl$24();
3572
+ const _el$4 = _tmpl$23();
3738
3573
  _el$4.addEventListener("load", () => {
3739
3574
  onIframeLoaded();
3740
3575
  });
@@ -3908,19 +3743,9 @@ var TEXT_SPEED_MAP = {
3908
3743
  Fast: () => 60,
3909
3744
  Auto: void 0
3910
3745
  };
3911
- var svg = (children2) => {
3912
- return `<svg width="24" height="24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5">${children2}</svg>`;
3913
- };
3914
- var settingsIcons = {
3915
- language: svg('<circle cx="12" cy="12" r="7.25" /><path d="M15.25 12c0 4.5-2.007 7.25-3.25 7.25-1.243 0-3.25-2.75-3.25-7.25S10.757 4.75 12 4.75c1.243 0 3.25 2.75 3.25 7.25ZM5 12h14" />'),
3916
- typewriter_speed: svg('<path d="M4.75 17.25 8 6.75l3.25 10.5M6 14.25h4M19.25 14.5a2.75 2.75 0 1 1-5.5 0 2.75 2.75 0 0 1 5.5 0ZM19.25 11.75v5.5" />'),
3917
- music_volume: svg('<circle cx="7" cy="17" r="2.25" /><path d="M9.25 17V6.75a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2V14"/><circle cx="17" cy="14" r="2.25" />'),
3918
- sound_volume: svg('<path d="M15.75 10.75s.5.484.5 1.25-.5 1.25-.5 1.25M17.75 7.75s1.5 1.25 1.5 4.249c0 2.998-1.5 4.25-1.5 4.25M13.25 4.75l-4.75 4H5.75a1 1 0 0 0-1 1v4.5a1 1 0 0 0 1 1H8.5l4.75 4V4.75Z"/>'),
3919
- voice_volume: svg('<path d="M5.75 19.25v-.509a2 2 0 0 1 1.588-1.957l1.521-.32a1.752 1.752 0 0 0 1.391-1.714m8 4.5v-.509a2 2 0 0 0-1.588-1.957l-1.521-.32a1.751 1.751 0 0 1-1.391-1.714m-3.905-.467c-1.255-1.27-2.23-3.138-2.08-4.947C7.977 6.808 9.035 4.75 12 4.75c2.963 0 4.022 2.058 4.233 4.586.156 1.865-.706 3.792-2.017 5.062-1.234 1.197-3.161 1.109-4.37-.115Z"/>')
3920
- };
3921
3746
 
3922
3747
  // src/components/Typewriter.tsx
3923
- var _tmpl$20 = /* @__PURE__ */ template(`<span>`);
3748
+ var _tmpl$11 = /* @__PURE__ */ template(`<span>`);
3924
3749
  var PRM = matchMedia("(prefers-reduced-motion: reduce)");
3925
3750
  var createTypewriter = ({
3926
3751
  resolve
@@ -3960,7 +3785,7 @@ var createTypewriter = ({
3960
3785
  bypassed = false;
3961
3786
  });
3962
3787
  return (() => {
3963
- const _el$ = _tmpl$20();
3788
+ const _el$ = _tmpl$11();
3964
3789
  const _ref$ = node;
3965
3790
  typeof _ref$ === "function" ? use(_ref$, _el$) : node = _el$;
3966
3791
  spread(_el$, mergeProps(() => props.attributes), false, false);
@@ -3986,7 +3811,7 @@ var createTypewriter = ({
3986
3811
  };
3987
3812
 
3988
3813
  // src/components/Canvas.tsx
3989
- var _tmpl$21 = /* @__PURE__ */ template(`<canvas>`);
3814
+ var _tmpl$12 = /* @__PURE__ */ template(`<canvas>`);
3990
3815
  var Canvas = (props) => {
3991
3816
  const [local, rest] = splitProps(props, ["resize", "render"]);
3992
3817
  const [canvas, setCanvas] = createSignal();
@@ -4030,7 +3855,7 @@ var Canvas = (props) => {
4030
3855
  removeEventListener("resize", onResize);
4031
3856
  });
4032
3857
  return (() => {
4033
- const _el$ = _tmpl$21();
3858
+ const _el$ = _tmpl$12();
4034
3859
  use(setCanvas, _el$);
4035
3860
  spread(_el$, rest, false, false);
4036
3861
  return _el$;
@@ -4038,60 +3863,152 @@ var Canvas = (props) => {
4038
3863
  };
4039
3864
 
4040
3865
  // src/components/Select.tsx
4041
- var _tmpl$25 = /* @__PURE__ */ template(`<div class="select"><label class="select__label"><span class="select__label__icon"></span> </label><div class="select__select-container"><select>`);
3866
+ var _tmpl$13 = /* @__PURE__ */ template(`<div class="select"><label class="select__label"><span class="select__label__icon"><svg width="24" height="24" viewBox="0 0 256 256"><use></use></svg></span> </label><div class="select__select-container"><select></select><svg class="select__icon" width="24" height="24" viewBox="0 0 256 256"><use href="#novely-caret-down-icon">`);
4042
3867
  var Select = (props) => {
4043
3868
  const [local, rest] = splitProps(props, ["icon", "label"]);
4044
3869
  const id = createUniqueId();
4045
3870
  return (() => {
4046
- const _el$ = _tmpl$25(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling, _el$6 = _el$5.firstChild;
3871
+ const _el$ = _tmpl$13(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$3.nextSibling, _el$7 = _el$2.nextSibling, _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling;
4047
3872
  setAttribute(_el$2, "for", id);
4048
3873
  setAttribute(_el$3, "aria-hidden", true);
4049
3874
  insert(_el$2, () => local.label, null);
4050
- spread(_el$6, mergeProps(rest, {
3875
+ spread(_el$8, mergeProps(rest, {
4051
3876
  "class": "select__select",
4052
3877
  "id": id
4053
3878
  }), false, true);
4054
- insert(_el$6, () => props.children);
4055
- insert(_el$5, createComponent(Icon, {
4056
- "class": "select__icon",
4057
- "aria-hidden": true,
4058
- get children() {
4059
- return createComponent(Icon.ChevronDown, {});
4060
- }
4061
- }), null);
4062
- createRenderEffect(() => _el$3.innerHTML = local.icon);
3879
+ insert(_el$8, () => props.children);
3880
+ setAttribute(_el$9, "aria-hidden", true);
3881
+ createRenderEffect(() => setAttribute(_el$5, "href", local.icon));
4063
3882
  return _el$;
4064
3883
  })();
4065
3884
  };
4066
3885
 
4067
3886
  // src/components/Range.tsx
4068
- var _tmpl$26 = /* @__PURE__ */ template(`<div class="range"><label class="range__label"><span class="range__label__icon"></span> </label><input>`);
3887
+ var _tmpl$14 = /* @__PURE__ */ template(`<div class="range"><label class="range__label"><span class="range__label__icon"><svg width="24" height="24" viewBox="0 0 256 256"><use></use></svg></span> </label><input>`);
4069
3888
  var Range = (props) => {
4070
3889
  const [local, rest] = splitProps(props, ["icon", "label"]);
4071
3890
  const id = createUniqueId();
4072
3891
  return (() => {
4073
- const _el$ = _tmpl$26(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling;
3892
+ const _el$ = _tmpl$14(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$3.nextSibling, _el$7 = _el$2.nextSibling;
4074
3893
  setAttribute(_el$2, "for", id);
4075
3894
  setAttribute(_el$3, "aria-hidden", true);
4076
3895
  insert(_el$2, () => local.label, null);
4077
- spread(_el$5, mergeProps(rest, {
3896
+ spread(_el$7, mergeProps(rest, {
4078
3897
  "class": "range__range",
4079
3898
  "type": "range",
4080
3899
  "id": id
4081
3900
  }), false, false);
4082
- createRenderEffect(() => _el$3.innerHTML = local.icon);
3901
+ createRenderEffect(() => setAttribute(_el$5, "href", local.icon));
4083
3902
  return _el$;
4084
3903
  })();
4085
3904
  };
4086
3905
 
4087
- // src/actions.ts
4088
- var clickOutside = (node, handler) => {
4089
- const handleClick = (event) => node && !node.contains(event.target) && !event.defaultPrevented && handler && handler();
4090
- document.addEventListener("click", handleClick, true);
4091
- onCleanup(() => document.removeEventListener("click", handleClick, true));
3906
+ // src/components/DialogOverview.tsx
3907
+ var _tmpl$15 = /* @__PURE__ */ template(`<div class="dialog-overview__head"><span></span><button type="button" class="button">`);
3908
+ var _tmpl$24 = /* @__PURE__ */ template(`<div class="dialog-overview__body"><table class="dialog-overview__list">`);
3909
+ var _tmpl$33 = /* @__PURE__ */ template(`<button type="button" class="dialog-overview__button-audio-control"><svg fill="currentColor" width="24" height="24" viewBox="0 0 256 256"><use>`);
3910
+ var _tmpl$43 = /* @__PURE__ */ template(`<tr class="dialog-overview__list-item"><td class="dialog-overview__list-item__name"><span></span></td><td></td><td class="dialog-overview__list-item__text"><span>`);
3911
+ var DialogOverview = (props) => {
3912
+ const data = useData();
3913
+ const [scrollArea, setScrollArea] = createSignal();
3914
+ const [currentlyPlayingSource, setCurrentlyPlayingSource] = createSignal(null);
3915
+ const [currentlyPlaying, setCurrentlyPlaying] = createSignal(null);
3916
+ let playingId = 0;
3917
+ createEffect(() => {
3918
+ const current = currentlyPlaying();
3919
+ const scrollAreaElement = scrollArea();
3920
+ if (props.shown) {
3921
+ props.context.audio.voiceStop();
3922
+ if (scrollAreaElement) {
3923
+ Promise.resolve().then(() => {
3924
+ scrollAreaElement.lastElementChild?.scrollIntoView();
3925
+ });
3926
+ }
3927
+ } else {
3928
+ current?.stop();
3929
+ setCurrentlyPlaying(null);
3930
+ }
3931
+ });
3932
+ return createComponent(Modal, {
3933
+ "class": "dialog-overview",
3934
+ isModal: true,
3935
+ isOpen: () => props.shown,
3936
+ trapFocus: () => props.shown,
3937
+ get children() {
3938
+ return [(() => {
3939
+ const _el$ = _tmpl$15(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
3940
+ insert(_el$2, () => data.t("DialogOverview"));
3941
+ _el$3.$$click = () => {
3942
+ props.close();
3943
+ };
3944
+ insert(_el$3, () => data.t("Close"));
3945
+ return _el$;
3946
+ })(), (() => {
3947
+ const _el$4 = _tmpl$24(), _el$5 = _el$4.firstChild;
3948
+ use(setScrollArea, _el$5);
3949
+ insert(_el$5, createComponent(Show, {
3950
+ get when() {
3951
+ return props.shown;
3952
+ },
3953
+ keyed: true,
3954
+ get children() {
3955
+ return createComponent(For, {
3956
+ get each() {
3957
+ return data.options.getDialogOverview();
3958
+ },
3959
+ children: (entry) => (() => {
3960
+ const _el$6 = _tmpl$43(), _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, _el$9 = _el$7.nextSibling, _el$13 = _el$9.nextSibling, _el$14 = _el$13.firstChild;
3961
+ insert(_el$8, () => removeTagsFromHTML(entry.name));
3962
+ insert(_el$9, createComponent(Show, {
3963
+ get when() {
3964
+ return entry.voice;
3965
+ },
3966
+ get children() {
3967
+ const _el$10 = _tmpl$33(), _el$11 = _el$10.firstChild, _el$12 = _el$11.firstChild;
3968
+ _el$10.$$click = async () => {
3969
+ if (!entry.voice) return;
3970
+ const voice = props.audio.getAudio("voice", entry.voice);
3971
+ const source = currentlyPlayingSource();
3972
+ if (currentlyPlayingSource() === entry.voice) {
3973
+ await voice.stop();
3974
+ setCurrentlyPlaying(null);
3975
+ setCurrentlyPlayingSource("");
3976
+ } else {
3977
+ if (source) {
3978
+ const previous = props.audio.getAudio("voice", source);
3979
+ await previous.stop();
3980
+ }
3981
+ setCurrentlyPlaying(voice);
3982
+ setCurrentlyPlayingSource(entry.voice);
3983
+ await voice.reset();
3984
+ await voice.play();
3985
+ const currentPlayingId = ++playingId;
3986
+ voice.onEnded(() => {
3987
+ if (currentPlayingId === playingId) {
3988
+ setCurrentlyPlaying(null);
3989
+ setCurrentlyPlayingSource("");
3990
+ }
3991
+ });
3992
+ }
3993
+ };
3994
+ createRenderEffect(() => setAttribute(_el$12, "href", currentlyPlayingSource() === entry.voice ? "#novely-stop-icon" : "#novely-play-icon"));
3995
+ return _el$10;
3996
+ }
3997
+ }));
3998
+ insert(_el$14, () => removeTagsFromHTML(entry.text));
3999
+ return _el$6;
4000
+ })()
4001
+ });
4002
+ }
4003
+ }));
4004
+ return _el$4;
4005
+ })()];
4006
+ }
4007
+ });
4092
4008
  };
4009
+ delegateEvents(["click"]);
4093
4010
 
4094
- // ../../node_modules/.pnpm/@solid-primitives+destructure@0.1.17_solid-js@1.8.21/node_modules/@solid-primitives/destructure/dist/index.js
4011
+ // ../../node_modules/.pnpm/@solid-primitives+destructure@0.1.17_solid-js@1.9.3/node_modules/@solid-primitives/destructure/dist/index.js
4095
4012
  var isReactiveObject = (value) => typeof value === "object" && value !== null;
4096
4013
  function createProxyCache(obj, get) {
4097
4014
  return new Proxy(
@@ -4113,7 +4030,7 @@ function createProxyCache(obj, get) {
4113
4030
  }
4114
4031
  function destructure(source, options) {
4115
4032
  const config = options ?? {};
4116
- const memo2 = config.memo ?? typeof source === "function";
4033
+ const memo = config.memo ?? typeof source === "function";
4117
4034
  const getter = typeof source === "function" ? (key) => () => source()[key] : (key) => () => source[key];
4118
4035
  const obj = access(source);
4119
4036
  if (config.lazy) {
@@ -4121,30 +4038,30 @@ function destructure(source, options) {
4121
4038
  return createProxyCache(obj, (key) => {
4122
4039
  const calc = getter(key);
4123
4040
  if (config.deep && isReactiveObject(obj[key]))
4124
- return runWithOwner(owner, () => destructure(calc, { ...config, memo: memo2 }));
4125
- return memo2 ? runWithOwner(owner, () => createMemo(calc, void 0, options)) : calc;
4041
+ return runWithOwner(owner, () => destructure(calc, { ...config, memo }));
4042
+ return memo ? runWithOwner(owner, () => createMemo(calc, void 0, options)) : calc;
4126
4043
  });
4127
4044
  }
4128
4045
  const result = Array.isArray(obj) ? [] : {};
4129
4046
  for (const [key, value] of Object.entries(obj)) {
4130
4047
  const calc = getter(key);
4131
4048
  if (config.deep && isReactiveObject(value))
4132
- result[key] = destructure(calc, { ...config, memo: memo2 });
4049
+ result[key] = destructure(calc, { ...config, memo });
4133
4050
  else
4134
- result[key] = memo2 ? createMemo(calc, void 0, options) : calc;
4051
+ result[key] = memo ? createMemo(calc, void 0, options) : calc;
4135
4052
  }
4136
4053
  return result;
4137
4054
  }
4138
4055
 
4139
4056
  // src/screens/game.tsx
4140
- var _tmpl$27 = /* @__PURE__ */ template(`<div class="action-dialog-person">`);
4141
- var _tmpl$28 = /* @__PURE__ */ template(`<span class="dialog-label">`);
4057
+ var _tmpl$16 = /* @__PURE__ */ template(`<div class="action-dialog-person">`);
4058
+ var _tmpl$25 = /* @__PURE__ */ template(`<span class="dialog-label">`);
4142
4059
  var _tmpl$34 = /* @__PURE__ */ template(`<div class="choice-dialog__choices">`);
4143
4060
  var _tmpl$44 = /* @__PURE__ */ template(`<label for="novely-input" class="input-dialog__text input-dialog__label">`);
4144
- var _tmpl$53 = /* @__PURE__ */ template(`<span class="input-dialog__text input-dialog__error" aria-live="polite" aria-atomic="true">`);
4061
+ var _tmpl$52 = /* @__PURE__ */ template(`<span class="input-dialog__text input-dialog__error" aria-live="polite" aria-atomic="true">`);
4145
4062
  var _tmpl$62 = /* @__PURE__ */ template(`<button type="submit" class="button dialog-input__button">`);
4146
4063
  var _tmpl$72 = /* @__PURE__ */ template(`<div class="exit-dialog-buttons"><button type="button" class="button"></button><button type="button" class="button">`);
4147
- var _tmpl$82 = /* @__PURE__ */ template(`<button type="button" class="button control-panel__button">`);
4064
+ var _tmpl$82 = /* @__PURE__ */ template(`<button type="button" class="button control-panel__button"><svg width="24" height="24" viewBox="0 0 256 256"><use href="#novely-list-icon">`);
4148
4065
  var _tmpl$92 = /* @__PURE__ */ template(`<span class="control-panel-container-fix" aria-hidden="true">&#8203;`);
4149
4066
  var _tmpl$102 = /* @__PURE__ */ template(`<div class="control-panel-container-backdrop">`);
4150
4067
  var _tmpl$112 = /* @__PURE__ */ template(`<div class="control-panel"><div role="menubar" class="control-panel-container">`);
@@ -4152,6 +4069,9 @@ var _tmpl$122 = /* @__PURE__ */ template(`<div><div class="characters"></div><di
4152
4069
  var _tmpl$132 = /* @__PURE__ */ template(`<button type="button" class="button choice-dialog__choice"><span>`);
4153
4070
  var Game = (props) => {
4154
4071
  const data = useData();
4072
+ const {
4073
+ audio
4074
+ } = data;
4155
4075
  const {
4156
4076
  text,
4157
4077
  dialog,
@@ -4160,7 +4080,8 @@ var Game = (props) => {
4160
4080
  input,
4161
4081
  background,
4162
4082
  custom,
4163
- images
4083
+ images,
4084
+ dialogOverviewShown
4164
4085
  } = destructure(from(props.$contextState));
4165
4086
  const rendererState = from(data.$rendererState);
4166
4087
  const exitPromptShown = () => rendererState().exitPromptShown;
@@ -4283,7 +4204,7 @@ var Game = (props) => {
4283
4204
  return dialog().miniature.emotion;
4284
4205
  },
4285
4206
  get children() {
4286
- const _el$5 = _tmpl$27();
4207
+ const _el$5 = _tmpl$16();
4287
4208
  insert(_el$5, createComponent(Show, {
4288
4209
  get when() {
4289
4210
  return dialog().miniature.emotion;
@@ -4334,7 +4255,7 @@ var Game = (props) => {
4334
4255
  trapFocus: () => !props.isPreview && !exitPromptShown(),
4335
4256
  get children() {
4336
4257
  return [(() => {
4337
- const _el$7 = _tmpl$28();
4258
+ const _el$7 = _tmpl$25();
4338
4259
  insert(_el$7, () => choice().label || " ");
4339
4260
  createRenderEffect((_p$) => {
4340
4261
  const _v$ = Boolean(choice().label), _v$2 = !choice().label;
@@ -4406,7 +4327,7 @@ var Game = (props) => {
4406
4327
  insert(_el$9, () => input().label);
4407
4328
  return _el$9;
4408
4329
  })(), createMemo(() => input().element), (() => {
4409
- const _el$10 = _tmpl$53();
4330
+ const _el$10 = _tmpl$52();
4410
4331
  insert(_el$10, () => input().error);
4411
4332
  return _el$10;
4412
4333
  })(), (() => {
@@ -4425,7 +4346,7 @@ var Game = (props) => {
4425
4346
  trapFocus: () => !props.isPreview && exitPromptShown(),
4426
4347
  get children() {
4427
4348
  return [(() => {
4428
- const _el$12 = _tmpl$28();
4349
+ const _el$12 = _tmpl$25();
4429
4350
  insert(_el$12, () => data.t("ExitDialogWarning"));
4430
4351
  return _el$12;
4431
4352
  })(), (() => {
@@ -4492,11 +4413,6 @@ var Game = (props) => {
4492
4413
  setControlPanelMenuExpanded((prev) => !prev);
4493
4414
  };
4494
4415
  setAttribute(_el$19, "aria-controls", controlPanelMenuID);
4495
- insert(_el$19, createComponent(Icon, {
4496
- get children() {
4497
- return Icon.Menu();
4498
- }
4499
- }));
4500
4416
  createRenderEffect((_p$) => {
4501
4417
  const _v$3 = data.t("OpenMenu"), _v$4 = controlPanelMenuExpanded();
4502
4418
  _v$3 !== _p$._v$3 && setAttribute(_el$19, "title", _p$._v$3 = _v$3);
@@ -4535,6 +4451,9 @@ var Game = (props) => {
4535
4451
  closeDropdown: () => {
4536
4452
  setControlPanelMenuExpanded(false);
4537
4453
  },
4454
+ openDialogOverview: () => {
4455
+ props.$contextState.setKey("dialogOverviewShown", true);
4456
+ },
4538
4457
  auto,
4539
4458
  setAuto
4540
4459
  }));
@@ -4556,6 +4475,14 @@ var Game = (props) => {
4556
4475
  },
4557
4476
  children: (image) => image
4558
4477
  }));
4478
+ insert(_el$, createComponent(DialogOverview, {
4479
+ context,
4480
+ audio,
4481
+ get shown() {
4482
+ return Boolean(!props.isPreview && dialogOverviewShown());
4483
+ },
4484
+ close: () => props.$contextState.setKey("dialogOverviewShown", false)
4485
+ }), null);
4559
4486
  createRenderEffect((_p$) => {
4560
4487
  const _v$7 = `${props.className || ""} game`, _v$8 = !!props.isPreview, _v$9 = charactersCount(), _v$10 = !!dialog().visible, _v$11 = !dialog().visible, _v$12 = !(dialog().miniature.character && dialog().miniature.emotion), _v$13 = !dialog().content, _v$14 = !!props.isPreview, _v$15 = !!Boolean(text().content), _v$16 = !text().content;
4561
4488
  _v$7 !== _p$._v$7 && className(_el$, _p$._v$7 = _v$7);
@@ -4587,18 +4514,18 @@ var Game = (props) => {
4587
4514
  delegateEvents(["click", "keydown"]);
4588
4515
 
4589
4516
  // src/screens/loading.tsx
4590
- var _tmpl$29 = /* @__PURE__ */ template(`<div class="loading"><div class="loading__animation"><div></div><div></div><div></div><div>`);
4517
+ var _tmpl$17 = /* @__PURE__ */ template(`<div class="loading"><div class="loading__animation"><div></div><div></div><div></div><div>`);
4591
4518
  var Loading = (props) => {
4592
4519
  return (() => {
4593
- const _el$ = _tmpl$29();
4520
+ const _el$ = _tmpl$17();
4594
4521
  createRenderEffect(() => _el$.classList.toggle("overlay", !!props.overlay));
4595
4522
  return _el$;
4596
4523
  })();
4597
4524
  };
4598
4525
 
4599
4526
  // src/screens/mainmenu.tsx
4600
- var _tmpl$30 = /* @__PURE__ */ template(`<div class="main-menu"><div class="main-menu__controls"><button type="button" class="button main-menu__button"><span class="main-menu__button__text"></span></button><button type="button" class="button main-menu__button"><span class="main-menu__button__text"></span></button><button type="button" class="button main-menu__button"><span class="main-menu__button__text"></span></button><button type="button" class="button main-menu__button"><span class="main-menu__button__text">`);
4601
- var _tmpl$210 = /* @__PURE__ */ template(`<button>`);
4527
+ var _tmpl$18 = /* @__PURE__ */ template(`<div class="main-menu"><div class="main-menu__controls"><button type="button" class="button main-menu__button"><span class="main-menu__button__text"></span><svg width="24" height="24" viewBox="0 0 256 256"><use href="#novely-file-plus-icon"></use></svg></button><button type="button" class="button main-menu__button"><span class="main-menu__button__text"></span><svg width="24" height="24" viewBox="0 0 256 256"><use href="#novely-play-game-icon"></use></svg></button><button type="button" class="button main-menu__button"><span class="main-menu__button__text"></span><svg width="24" height="24" viewBox="0 0 256 256"><use href="#novely-files-icon"></use></svg></button><button type="button" class="button main-menu__button"><span class="main-menu__button__text"></span><svg width="24" height="24" viewBox="0 0 256 256"><use href="#novely-settings-icon">`);
4528
+ var _tmpl$26 = /* @__PURE__ */ template(`<button>`);
4602
4529
  var MainMenu = () => {
4603
4530
  const {
4604
4531
  t,
@@ -4614,35 +4541,23 @@ var MainMenu = () => {
4614
4541
  $rendererState.mutate((s) => s.screen, screen);
4615
4542
  });
4616
4543
  return (() => {
4617
- const _el$ = _tmpl$30(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$3.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$5.nextSibling, _el$8 = _el$7.firstChild, _el$9 = _el$7.nextSibling, _el$10 = _el$9.firstChild;
4544
+ const _el$ = _tmpl$18(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$3.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$5.nextSibling, _el$8 = _el$7.firstChild, _el$9 = _el$7.nextSibling, _el$10 = _el$9.firstChild;
4618
4545
  _el$3.$$click = () => {
4619
4546
  options.newGame();
4620
4547
  };
4621
4548
  insert(_el$4, () => t("NewGame"));
4622
- insert(_el$3, createComponent(Icon, {
4623
- children: Icon.FilePlus()
4624
- }), null);
4625
4549
  _el$5.$$click = () => {
4626
4550
  options.restore();
4627
4551
  };
4628
4552
  insert(_el$6, () => t("LoadSave"));
4629
- insert(_el$5, createComponent(Icon, {
4630
- children: Icon.Play()
4631
- }), null);
4632
4553
  _el$7.$$click = () => {
4633
4554
  goto("saves");
4634
4555
  };
4635
4556
  insert(_el$8, () => t("Saves"));
4636
- insert(_el$7, createComponent(Icon, {
4637
- children: Icon.Files()
4638
- }), null);
4639
4557
  _el$9.$$click = () => {
4640
4558
  goto("settings");
4641
4559
  };
4642
4560
  insert(_el$10, () => t("Settings"));
4643
- insert(_el$9, createComponent(Icon, {
4644
- children: Icon.Settings()
4645
- }), null);
4646
4561
  insert(_el$2, createComponent(Show, {
4647
4562
  get when() {
4648
4563
  return language();
@@ -4653,7 +4568,7 @@ var MainMenu = () => {
4653
4568
  return rendererStore().mainmenu;
4654
4569
  },
4655
4570
  children: (item) => (() => {
4656
- const _el$11 = _tmpl$210();
4571
+ const _el$11 = _tmpl$26();
4657
4572
  spread(_el$11, mergeProps(() => item(goto)), false, false);
4658
4573
  return _el$11;
4659
4574
  })()
@@ -4665,8 +4580,8 @@ var MainMenu = () => {
4665
4580
  delegateEvents(["click"]);
4666
4581
 
4667
4582
  // src/screens/saves.tsx
4668
- var _tmpl$31 = /* @__PURE__ */ template(`<ol class="saves__list">`);
4669
- var _tmpl$211 = /* @__PURE__ */ template(`<div class="saves"><div class="saves__controls"><button type="button" class="button saves__button"></button></div><div class="saves__list-container">`);
4583
+ var _tmpl$19 = /* @__PURE__ */ template(`<ol class="saves__list">`);
4584
+ var _tmpl$27 = /* @__PURE__ */ template(`<div class="saves"><div class="saves__controls"><button type="button" class="button saves__button"></button></div><div class="saves__list-container">`);
4670
4585
  var _tmpl$35 = /* @__PURE__ */ template(`<div class="saves__list saves__list--empty">`);
4671
4586
  var Saves = () => {
4672
4587
  const {
@@ -4734,7 +4649,7 @@ var Saves = () => {
4734
4649
  return !targets.every((item) => completed.includes(item));
4735
4650
  };
4736
4651
  return (() => {
4737
- const _el$ = _tmpl$211(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$2.nextSibling;
4652
+ const _el$ = _tmpl$27(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$2.nextSibling;
4738
4653
  _el$3.$$click = () => {
4739
4654
  $rendererState.setKey("screen", "mainmenu");
4740
4655
  };
@@ -4751,7 +4666,7 @@ var Saves = () => {
4751
4666
  })();
4752
4667
  },
4753
4668
  get children() {
4754
- const _el$5 = _tmpl$31();
4669
+ const _el$5 = _tmpl$19();
4755
4670
  use(setList, _el$5);
4756
4671
  insert(_el$5, createComponent(For, {
4757
4672
  get each() {
@@ -4782,8 +4697,8 @@ var Saves = () => {
4782
4697
  delegateEvents(["click"]);
4783
4698
 
4784
4699
  // src/screens/settings.tsx
4785
- var _tmpl$36 = /* @__PURE__ */ template(`<div class="root settings"><div class="settings__controls"><button type="button" class="button settings__button"></button><button type="button" class="button settings__button"></button></div><div class="settings__options"><div></div><div>`);
4786
- var _tmpl$212 = /* @__PURE__ */ template(`<option>`);
4700
+ var _tmpl$20 = /* @__PURE__ */ template(`<div class="root settings"><div class="settings__controls"><button type="button" class="button settings__button"></button><button type="button" class="button settings__button"></button></div><div class="settings__options"><div></div><div>`);
4701
+ var _tmpl$28 = /* @__PURE__ */ template(`<option>`);
4787
4702
  var Settings = (props) => {
4788
4703
  const {
4789
4704
  t,
@@ -4829,7 +4744,7 @@ var Settings = (props) => {
4829
4744
  return fn;
4830
4745
  };
4831
4746
  return (() => {
4832
- const _el$ = _tmpl$36(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
4747
+ const _el$ = _tmpl$20(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.nextSibling, _el$5 = _el$2.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
4833
4748
  _el$3.$$click = () => {
4834
4749
  $rendererState.setKey("screen", "mainmenu");
4835
4750
  };
@@ -4839,9 +4754,7 @@ var Settings = (props) => {
4839
4754
  };
4840
4755
  insert(_el$4, () => t("ToTheGame"));
4841
4756
  insert(_el$6, createComponent(Select, {
4842
- get icon() {
4843
- return props.icons.language;
4844
- },
4757
+ icon: "#novely-globe-icon",
4845
4758
  get label() {
4846
4759
  return t("Language");
4847
4760
  },
@@ -4852,7 +4765,7 @@ var Settings = (props) => {
4852
4765
  return options.languages;
4853
4766
  },
4854
4767
  children: (lang) => (() => {
4855
- const _el$8 = _tmpl$212();
4768
+ const _el$8 = _tmpl$28();
4856
4769
  _el$8.value = lang;
4857
4770
  insert(_el$8, () => options.getLanguageDisplayName(lang));
4858
4771
  createRenderEffect(() => _el$8.selected = lang === language());
@@ -4862,9 +4775,7 @@ var Settings = (props) => {
4862
4775
  }
4863
4776
  }), null);
4864
4777
  insert(_el$6, createComponent(Select, {
4865
- get icon() {
4866
- return props.icons.typewriter_speed;
4867
- },
4778
+ icon: "#novely-typewriter-speed-icon",
4868
4779
  get label() {
4869
4780
  return t("TextSpeed");
4870
4781
  },
@@ -4873,7 +4784,7 @@ var Settings = (props) => {
4873
4784
  return createComponent(For, {
4874
4785
  each: ["Slow", "Medium", "Fast", "Auto"],
4875
4786
  children: (speed) => (() => {
4876
- const _el$9 = _tmpl$212();
4787
+ const _el$9 = _tmpl$28();
4877
4788
  _el$9.value = speed;
4878
4789
  insert(_el$9, () => t("TextSpeed" + speed));
4879
4790
  createRenderEffect(() => _el$9.selected = speed === textSpeed());
@@ -4883,9 +4794,7 @@ var Settings = (props) => {
4883
4794
  }
4884
4795
  }), null);
4885
4796
  insert(_el$7, createComponent(Range, {
4886
- get icon() {
4887
- return props.icons.music_volume;
4888
- },
4797
+ icon: "#novely-music-volume-icon",
4889
4798
  get label() {
4890
4799
  return t("MusicVolume");
4891
4800
  },
@@ -4900,9 +4809,7 @@ var Settings = (props) => {
4900
4809
  }
4901
4810
  }), null);
4902
4811
  insert(_el$7, createComponent(Range, {
4903
- get icon() {
4904
- return props.icons.sound_volume;
4905
- },
4812
+ icon: "#novely-sound-volume-icon",
4906
4813
  get label() {
4907
4814
  return t("SoundVolume");
4908
4815
  },
@@ -4917,9 +4824,7 @@ var Settings = (props) => {
4917
4824
  }
4918
4825
  }), null);
4919
4826
  insert(_el$7, createComponent(Range, {
4920
- get icon() {
4921
- return props.icons.voice_volume;
4922
- },
4827
+ icon: "#novely-voice-volume-icon",
4923
4828
  get label() {
4924
4829
  return t("VoiceVolume");
4925
4830
  },
@@ -4940,7 +4845,7 @@ var Settings = (props) => {
4940
4845
  delegateEvents(["click"]);
4941
4846
 
4942
4847
  // src/components/Root.tsx
4943
- var _tmpl$37 = /* @__PURE__ */ template(`<div class="root">`);
4848
+ var _tmpl$21 = /* @__PURE__ */ template(`<div class="root">`);
4944
4849
  var createRootComponent = ({
4945
4850
  $rendererState,
4946
4851
  $contextState,
@@ -4952,12 +4857,14 @@ var createRootComponent = ({
4952
4857
  emitter,
4953
4858
  controls,
4954
4859
  skipTypewriterWhenGoingBack,
4955
- settingsIcons: settingsIcons2,
4956
- rendererContext
4860
+ rendererContext,
4861
+ audio
4957
4862
  }) => {
4958
4863
  const Root = () => {
4959
- const screen = from(memo($rendererState, (state) => state.screen));
4960
- const loadingShown = from(memo($rendererState, (state) => state.loadingShown));
4864
+ const {
4865
+ screen,
4866
+ loadingShown
4867
+ } = destructure(from($rendererState));
4961
4868
  createEffect(() => {
4962
4869
  const currentScreen = screen();
4963
4870
  if (fullscreen && document.fullscreenEnabled) {
@@ -4969,13 +4876,10 @@ var createRootComponent = ({
4969
4876
  });
4970
4877
  }
4971
4878
  }
4972
- if (currentScreen !== "game" && currentScreen !== "settings" && !loadingShown()) {
4973
- rendererContext.audio.destroy();
4974
- }
4975
4879
  emitter.emit("screen:change", currentScreen);
4976
4880
  });
4977
4881
  return (() => {
4978
- const _el$ = _tmpl$37();
4882
+ const _el$ = _tmpl$21();
4979
4883
  const _ref$ = setRoot;
4980
4884
  typeof _ref$ === "function" ? use(_ref$, _el$) : setRoot = _el$;
4981
4885
  insert(_el$, createComponent(Provider, {
@@ -4995,6 +4899,7 @@ var createRootComponent = ({
4995
4899
  get removeContext() {
4996
4900
  return renderer.removeContext;
4997
4901
  },
4902
+ audio,
4998
4903
  get children() {
4999
4904
  return [createComponent(Switch, {
5000
4905
  get children() {
@@ -5033,7 +4938,6 @@ var createRootComponent = ({
5033
4938
  },
5034
4939
  get children() {
5035
4940
  return createComponent(Settings, {
5036
- icons: settingsIcons2,
5037
4941
  showAudioSettings
5038
4942
  });
5039
4943
  }
@@ -5153,8 +5057,42 @@ var hideImage = (source, params = {}) => {
5153
5057
  return ["custom", handler];
5154
5058
  };
5155
5059
 
5060
+ // src/emitter.ts
5061
+ var createEmitter = () => {
5062
+ const listeners = /* @__PURE__ */ new Map();
5063
+ return {
5064
+ on(name, fn) {
5065
+ const set = listeners.get(name);
5066
+ if (!set) {
5067
+ listeners.set(name, /* @__PURE__ */ new Set());
5068
+ return this.on(name, fn);
5069
+ }
5070
+ set.add(fn);
5071
+ },
5072
+ once(name, fn) {
5073
+ const listener = (params) => {
5074
+ fn(params);
5075
+ this.off(name, listener);
5076
+ };
5077
+ this.on(name, listener);
5078
+ },
5079
+ off(name, fn) {
5080
+ const set = listeners.get(name);
5081
+ if (set) {
5082
+ set.delete(fn);
5083
+ }
5084
+ },
5085
+ emit(name, params) {
5086
+ const set = listeners.get(name);
5087
+ if (set) {
5088
+ set.forEach((fn) => fn(params));
5089
+ }
5090
+ }
5091
+ };
5092
+ };
5093
+
5156
5094
  // src/renderer.tsx
5157
- var _tmpl$38 = /* @__PURE__ */ template(`<canvas>`);
5095
+ var _tmpl$29 = /* @__PURE__ */ template(`<canvas>`);
5158
5096
  var {
5159
5097
  preloadAudioBlocking
5160
5098
  } = createAudioMisc();
@@ -5163,7 +5101,6 @@ var createSolidRenderer = ({
5163
5101
  controls = "outside",
5164
5102
  skipTypewriterWhenGoingBack = true,
5165
5103
  target = document.body,
5166
- settingsIcons: settingsIcons2 = settingsIcons,
5167
5104
  showAudioSettings = true
5168
5105
  } = {}) => {
5169
5106
  const emitter = createEmitter();
@@ -5185,10 +5122,10 @@ var createSolidRenderer = ({
5185
5122
  root,
5186
5123
  setRoot
5187
5124
  } = createRootSetter(() => renderer.getContext(options.mainContextKey));
5125
+ const audio = createAudio2(options.storageData);
5188
5126
  const cleanup = {};
5189
5127
  const renderer = {
5190
5128
  getContext: getContextCached((name) => {
5191
- const audio = createAudio2(options.storageData);
5192
5129
  const $contextState = useContextState(name);
5193
5130
  {
5194
5131
  const unsub = $contextState.listen((state, prev) => {
@@ -5214,7 +5151,7 @@ var createSolidRenderer = ({
5214
5151
  return chars[character];
5215
5152
  }
5216
5153
  const canvas = (() => {
5217
- const _el$ = _tmpl$38();
5154
+ const _el$ = _tmpl$29();
5218
5155
  setAttribute(_el$, "data-character", character);
5219
5156
  return _el$;
5220
5157
  })();
@@ -5257,10 +5194,10 @@ var createSolidRenderer = ({
5257
5194
  canvasDrawImages(canvas, canvasContext, stored);
5258
5195
  }
5259
5196
  },
5260
- append(className2, style2) {
5197
+ append(className2, style3) {
5261
5198
  clearTimeout($contextState.get().characters[character]?.hideTimeoutId);
5262
5199
  $contextState.mutate((s) => s.characters[character], {
5263
- style: style2,
5200
+ style: style3,
5264
5201
  visible: true
5265
5202
  });
5266
5203
  const {
@@ -5272,7 +5209,7 @@ var createSolidRenderer = ({
5272
5209
  element.className = className2;
5273
5210
  }
5274
5211
  },
5275
- remove(className2, style2, duration, restoring) {
5212
+ remove(className2, style3, duration, restoring) {
5276
5213
  return new Promise((resolve) => {
5277
5214
  const hide = () => {
5278
5215
  $contextState.mutate((s) => s.characters[character], (prev) => {
@@ -5297,7 +5234,7 @@ var createSolidRenderer = ({
5297
5234
  $contextState.mutate((s) => s.characters[character], (prev) => {
5298
5235
  return {
5299
5236
  ...prev,
5300
- style: style2,
5237
+ style: style3,
5301
5238
  hideTimeoutId: timeoutId
5302
5239
  };
5303
5240
  });
@@ -5399,12 +5336,12 @@ var createSolidRenderer = ({
5399
5336
  emitter,
5400
5337
  controls,
5401
5338
  skipTypewriterWhenGoingBack,
5402
- settingsIcons: settingsIcons2,
5403
5339
  showAudioSettings,
5404
5340
  rendererContext: renderer.getContext(options.mainContextKey),
5405
5341
  coreOptions: options,
5406
5342
  $rendererState,
5407
- $contextState: useContextState(options.mainContextKey)
5343
+ $contextState: useContextState(options.mainContextKey),
5344
+ audio
5408
5345
  });
5409
5346
  return render(() => createComponent(Root, {}), target);
5410
5347
  })