@novely/solid-renderer 0.41.1 → 0.42.0-next.1

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.1/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.1/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 = {
@@ -2472,6 +2420,7 @@ var createAudio2 = (storageData) => {
2472
2420
  resource.pause();
2473
2421
  },
2474
2422
  play(loop) {
2423
+ resource.volume = getVolume(method);
2475
2424
  resource.loop = loop;
2476
2425
  resource.play();
2477
2426
  },
@@ -2484,6 +2433,7 @@ var createAudio2 = (storageData) => {
2484
2433
  this.start();
2485
2434
  this.voiceStop();
2486
2435
  const resource = store.voice = getAudio("voice", source);
2436
+ resource.volume = getVolume("voice");
2487
2437
  resource.play();
2488
2438
  },
2489
2439
  voiceStop() {
@@ -2524,9 +2474,14 @@ var createAudio2 = (storageData) => {
2524
2474
  };
2525
2475
  const clear = (keepAudio) => {
2526
2476
  context.voiceStop();
2527
- const musics = Object.entries(store.music).filter(([name]) => !keepAudio.music.has(name)).map(([_, a]) => a);
2528
- const sounds = Object.entries(store.sound).filter(([name]) => !keepAudio.sounds.has(name)).map(([_, a]) => a);
2529
- for (const music of [...musics, ...sounds]) {
2477
+ const entries2 = [
2478
+ [store.music, keepAudio.music],
2479
+ [store.sound, keepAudio.sounds]
2480
+ ];
2481
+ const clearEntries = entries2.flatMap(([incoming, keep]) => {
2482
+ return Object.entries(incoming).filter(([name]) => !keep.has(name)).map(([_, a]) => a);
2483
+ });
2484
+ for (const music of clearEntries) {
2530
2485
  if (!music) continue;
2531
2486
  music.stop();
2532
2487
  }
@@ -2601,25 +2556,6 @@ var createRootSetter = (getContext2) => {
2601
2556
  }
2602
2557
  };
2603
2558
  };
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
2559
  var useBackground = (backgrounds, set) => {
2624
2560
  const mediaQueries = Object.keys(backgrounds).map((media) => matchMedia(media));
2625
2561
  const allMedia = mediaQueries.find(({ media }) => media === "all");
@@ -2648,6 +2584,25 @@ var useBackground = (backgrounds, set) => {
2648
2584
  }
2649
2585
  };
2650
2586
  };
2587
+ var vibrationPossible = /* @__PURE__ */ (() => {
2588
+ let possible = false;
2589
+ const onPointerDown = () => {
2590
+ possible = true;
2591
+ };
2592
+ const isPossible = () => {
2593
+ return possible;
2594
+ };
2595
+ document.addEventListener("pointerdown", onPointerDown, { once: true });
2596
+ return isPossible;
2597
+ })();
2598
+ var vibrate = (pattern) => {
2599
+ if (vibrationPossible() && "vibrate" in navigator) {
2600
+ try {
2601
+ navigator.vibrate(pattern);
2602
+ } catch {
2603
+ }
2604
+ }
2605
+ };
2651
2606
  var allEmpty = (target) => {
2652
2607
  if (typeof target === "string") {
2653
2608
  return target == "";
@@ -2677,28 +2632,25 @@ var handleBackgroundAction = ($contextState, background) => {
2677
2632
  const { dispose: dispose2 } = useBackground(background, (value) => {
2678
2633
  $contextState.mutate((s) => s.background.background, value);
2679
2634
  });
2680
- $contextState.mutate((s) => s.background.clear, () => dispose2);
2681
- };
2682
- var handleDialogAction = ($contextState, content, name, character, emotion, resolve) => {
2683
2635
  $contextState.mutate(
2684
- (s) => s.dialog,
2685
- {
2686
- content,
2687
- name,
2688
- miniature: {
2689
- character,
2690
- emotion
2691
- },
2692
- visible: true,
2693
- resolve
2694
- }
2636
+ (s) => s.background.clear,
2637
+ () => dispose2
2695
2638
  );
2696
2639
  };
2640
+ var handleDialogAction = ($contextState, content, name, character, emotion, resolve) => {
2641
+ $contextState.mutate((s) => s.dialog, {
2642
+ content,
2643
+ name,
2644
+ miniature: {
2645
+ character,
2646
+ emotion
2647
+ },
2648
+ visible: true,
2649
+ resolve
2650
+ });
2651
+ };
2697
2652
  var handleChoiceAction = ($contextState, label, choices, resolve) => {
2698
- $contextState.mutate(
2699
- (s) => s.choice,
2700
- { choices, label, resolve, visible: true }
2701
- );
2653
+ $contextState.mutate((s) => s.choice, { choices, label, resolve, visible: true });
2702
2654
  };
2703
2655
  var handleClearAction = ($rendererState, $contextState, options, context, keep, keepCharacters) => {
2704
2656
  $rendererState.mutate((s) => s.exitPromptShown, false);
@@ -2706,40 +2658,31 @@ var handleClearAction = ($rendererState, $contextState, options, context, keep,
2706
2658
  $contextState.mutate((s) => s.background.background, "#000");
2707
2659
  }
2708
2660
  if (!keep.has("choice")) {
2709
- $contextState.mutate(
2710
- (s) => s.choice,
2711
- {
2712
- choices: [],
2713
- visible: false,
2714
- label: ""
2715
- }
2716
- );
2661
+ $contextState.mutate((s) => s.choice, {
2662
+ choices: [],
2663
+ visible: false,
2664
+ label: ""
2665
+ });
2717
2666
  }
2718
2667
  const inputCleanup = $contextState.get().input.cleanup;
2719
2668
  if (inputCleanup) {
2720
2669
  inputCleanup();
2721
2670
  }
2722
2671
  if (!keep.has("input")) {
2723
- $contextState.mutate(
2724
- (s) => s.input,
2725
- {
2726
- element: null,
2727
- label: "",
2728
- visible: false,
2729
- error: ""
2730
- }
2731
- );
2672
+ $contextState.mutate((s) => s.input, {
2673
+ element: null,
2674
+ label: "",
2675
+ visible: false,
2676
+ error: ""
2677
+ });
2732
2678
  }
2733
2679
  if (!keep.has("dialog")) {
2734
- $contextState.mutate(
2735
- (s) => s.dialog,
2736
- {
2737
- visible: false,
2738
- content: "",
2739
- name: "",
2740
- miniature: {}
2741
- }
2742
- );
2680
+ $contextState.mutate((s) => s.dialog, {
2681
+ visible: false,
2682
+ content: "",
2683
+ name: "",
2684
+ miniature: {}
2685
+ });
2743
2686
  }
2744
2687
  if (!keep.has("text")) {
2745
2688
  $contextState.mutate((s) => s.text, { content: "" });
@@ -2747,13 +2690,10 @@ var handleClearAction = ($rendererState, $contextState, options, context, keep,
2747
2690
  const { characters, custom } = $contextState.get();
2748
2691
  for (const character of Object.keys(characters)) {
2749
2692
  if (!keepCharacters.has(character)) {
2750
- $contextState.mutate(
2751
- (s) => s.characters[character],
2752
- {
2753
- style: void 0,
2754
- visible: false
2755
- }
2756
- );
2693
+ $contextState.mutate((s) => s.characters[character], {
2694
+ style: void 0,
2695
+ visible: false
2696
+ });
2757
2697
  }
2758
2698
  }
2759
2699
  for (const [id, obj] of Object.entries(custom)) {
@@ -2765,14 +2705,11 @@ var handleClearAction = ($rendererState, $contextState, options, context, keep,
2765
2705
  };
2766
2706
  var handleCustomAction = ($contextState, fn) => {
2767
2707
  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
- );
2708
+ $contextState.mutate((s) => s.custom[fn.key], {
2709
+ fn,
2710
+ node: null,
2711
+ clear: noop
2712
+ });
2776
2713
  }
2777
2714
  return {
2778
2715
  setMountElement(node) {
@@ -2805,39 +2742,30 @@ var handleCustomAction = ($contextState, fn) => {
2805
2742
  var handleClearBlockingActions = ($contextState, preserve) => {
2806
2743
  const current = $contextState.get();
2807
2744
  if (preserve !== "choice" && !allEmpty(current.choice)) {
2808
- $contextState.mutate(
2809
- (s) => s.choice,
2810
- {
2811
- choices: [],
2812
- visible: false,
2813
- label: ""
2814
- }
2815
- );
2745
+ $contextState.mutate((s) => s.choice, {
2746
+ choices: [],
2747
+ visible: false,
2748
+ label: ""
2749
+ });
2816
2750
  }
2817
2751
  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
- );
2752
+ $contextState.mutate((s) => s.input, {
2753
+ element: null,
2754
+ label: "",
2755
+ visible: false,
2756
+ error: ""
2757
+ });
2827
2758
  }
2828
2759
  if (preserve !== "text" && !allEmpty(current.text)) {
2829
2760
  $contextState.mutate((s) => s.text, { content: "" });
2830
2761
  }
2831
2762
  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
- );
2763
+ $contextState.mutate((s) => s.dialog, {
2764
+ visible: false,
2765
+ content: "",
2766
+ name: "",
2767
+ miniature: {}
2768
+ });
2841
2769
  }
2842
2770
  };
2843
2771
  var handleTextAction = ($contextState, content, resolve) => {
@@ -2868,62 +2796,18 @@ var handleInputAction = ($contextState, options, context, label, onInput, setup,
2868
2796
  input.setAttribute("required", "true");
2869
2797
  input.setAttribute("autocomplete", "off");
2870
2798
  !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
- );
2799
+ $contextState.mutate((s) => s.input, {
2800
+ element: input,
2801
+ label,
2802
+ error: "",
2803
+ visible: true,
2804
+ cleanup: setup(input) || noop,
2805
+ resolve
2806
+ });
2882
2807
  !context.meta.preview && input.dispatchEvent(new InputEvent("input", { bubbles: true }));
2883
2808
  };
2884
2809
  var handleVibrateAction = vibrate;
2885
2810
 
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
2811
  // src/shared.ts
2928
2812
  var PRELOADED_IMAGE_MAP = /* @__PURE__ */ new Map();
2929
2813
  var PRELOADING_IMAGE_MAP = /* @__PURE__ */ new Map();
@@ -3073,6 +2957,11 @@ var from = (producer) => {
3073
2957
  onCleanup(producer.subscribe(set));
3074
2958
  return s;
3075
2959
  };
2960
+ var removeTagsFromHTML = (html) => {
2961
+ const container = document.createElement("div");
2962
+ container.innerHTML = html;
2963
+ return container.textContent || "";
2964
+ };
3076
2965
 
3077
2966
  // src/hooks/useMedia.ts
3078
2967
  var useMedia = (media) => {
@@ -3109,7 +2998,8 @@ var Provider = (props) => {
3109
2998
  hyperWide: useMedia("(max-aspect-ratio: 0.26)")
3110
2999
  },
3111
3000
  getContext: props.getContext,
3112
- removeContext: props.removeContext
3001
+ removeContext: props.removeContext,
3002
+ audio: props.audio
3113
3003
  };
3114
3004
  return createComponent(Context.Provider, {
3115
3005
  value,
@@ -3171,6 +3061,13 @@ var CustomScreen = (props) => {
3171
3061
  };
3172
3062
  delegateEvents(["click"]);
3173
3063
 
3064
+ // src/actions.ts
3065
+ var clickOutside = (node, handler) => {
3066
+ const handleClick = (event) => node && !node.contains(event.target) && !event.defaultPrevented && handler && handler();
3067
+ document.addEventListener("click", handleClick, true);
3068
+ onCleanup(() => document.removeEventListener("click", handleClick, true));
3069
+ };
3070
+
3174
3071
  // src/components/Character.tsx
3175
3072
  var Character = (props) => {
3176
3073
  const canvas = () => props.characters[props.character].canvas;
@@ -3179,102 +3076,102 @@ var Character = (props) => {
3179
3076
  };
3180
3077
 
3181
3078
  // 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">`);
3079
+ 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">`);
3080
+ 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">`);
3081
+ 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">`);
3082
+ 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>`);
3083
+ 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">`);
3084
+ 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">`);
3085
+ 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
3086
  var ControlPanelButtons = (props) => {
3186
3087
  const data = useData();
3187
3088
  return [(() => {
3188
3089
  const _el$ = _tmpl$2(), _el$2 = _el$.firstChild;
3189
3090
  addEventListener2(_el$, "click", data.options.back, true);
3190
3091
  insert(_el$2, () => data.t("GoBack"));
3191
- insert(_el$, createComponent(Icon, {
3192
- "class": "control-panel__button__icon",
3193
- children: Icon.Back()
3194
- }), null);
3195
3092
  createRenderEffect(() => setAttribute(_el$, "title", data.t("GoBack")));
3196
3093
  return _el$;
3197
3094
  })(), (() => {
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")));
3095
+ const _el$3 = _tmpl$22(), _el$4 = _el$3.firstChild;
3096
+ addEventListener2(_el$3, "click", props.openDialogOverview, true);
3097
+ insert(_el$4, () => data.t("DialogOverview"));
3098
+ createRenderEffect(() => setAttribute(_el$3, "title", data.t("DialogOverview")));
3208
3099
  return _el$3;
3209
3100
  })(), (() => {
3210
- const _el$5 = _tmpl$22(), _el$6 = _el$5.firstChild;
3101
+ const _el$5 = _tmpl$3(), _el$6 = _el$5.firstChild;
3211
3102
  _el$5.$$click = () => {
3212
- props.setAuto((prev) => !prev);
3103
+ data.options.save("manual");
3213
3104
  };
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")));
3105
+ insert(_el$6, () => data.t("DoSave"));
3106
+ createRenderEffect(() => setAttribute(_el$5, "title", data.t("DoSave")));
3222
3107
  return _el$5;
3223
3108
  })(), (() => {
3224
- const _el$7 = _tmpl$2(), _el$8 = _el$7.firstChild;
3109
+ const _el$7 = _tmpl$4(), _el$8 = _el$7.firstChild, _el$9 = _el$8.nextSibling, _el$10 = _el$9.firstChild;
3225
3110
  _el$7.$$click = () => {
3111
+ props.setAuto((prev) => !prev);
3112
+ };
3113
+ insert(_el$8, () => data.t(props.auto() ? "Stop" : "Auto"));
3114
+ createRenderEffect((_p$) => {
3115
+ const _v$ = data.t(props.auto() ? "Stop" : "Auto"), _v$2 = props.auto() ? "#novely-stop-icon" : "#novely-play-icon";
3116
+ _v$ !== _p$._v$ && setAttribute(_el$7, "title", _p$._v$ = _v$);
3117
+ _v$2 !== _p$._v$2 && setAttribute(_el$10, "href", _p$._v$2 = _v$2);
3118
+ return _p$;
3119
+ }, {
3120
+ _v$: void 0,
3121
+ _v$2: void 0
3122
+ });
3123
+ return _el$7;
3124
+ })(), (() => {
3125
+ const _el$11 = _tmpl$5(), _el$12 = _el$11.firstChild;
3126
+ _el$11.$$click = () => {
3226
3127
  data.options.save("auto");
3227
3128
  data.options.exit(true);
3228
3129
  props.openSettings();
3229
3130
  };
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;
3131
+ insert(_el$12, () => data.t("Settings"));
3132
+ createRenderEffect(() => setAttribute(_el$11, "title", data.t("Settings")));
3133
+ return _el$11;
3237
3134
  })(), (() => {
3238
- const _el$9 = _tmpl$2(), _el$10 = _el$9.firstChild;
3239
- _el$9.$$click = () => {
3135
+ const _el$13 = _tmpl$6(), _el$14 = _el$13.firstChild;
3136
+ _el$13.$$click = () => {
3240
3137
  data.options.exit();
3241
3138
  };
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;
3139
+ insert(_el$14, () => data.t("Exit"));
3140
+ createRenderEffect(() => setAttribute(_el$13, "title", data.t("Exit")));
3141
+ return _el$13;
3249
3142
  })(), createComponent(Show, {
3250
3143
  get when() {
3251
3144
  return data.media.hyperWide();
3252
3145
  },
3253
3146
  get children() {
3254
- const _el$11 = _tmpl$3();
3255
- _el$11.$$click = () => {
3147
+ const _el$15 = _tmpl$7();
3148
+ _el$15.$$click = () => {
3256
3149
  props.closeDropdown();
3257
3150
  };
3258
- insert(_el$11, createComponent(Icon, {
3259
- children: Icon.Close()
3260
- }));
3261
- createRenderEffect(() => setAttribute(_el$11, "title", data.t("CloseMenu")));
3262
- return _el$11;
3151
+ createRenderEffect(() => setAttribute(_el$15, "title", data.t("CloseMenu")));
3152
+ return _el$15;
3263
3153
  }
3264
3154
  })];
3265
3155
  };
3266
3156
  delegateEvents(["click"]);
3267
3157
 
3268
3158
  // src/components/DialogName.tsx
3269
- var _tmpl$4 = /* @__PURE__ */ template(`<span class="action-dialog-name">`);
3159
+ var _tmpl$8 = /* @__PURE__ */ template(`<div class="action-dialog-name"><span>`);
3160
+ var _tmpl$23 = /* @__PURE__ */ template(`<span class="action-dialog-mood-separator">&#10022;`);
3270
3161
  var DialogName = (props) => {
3271
3162
  const data = useData();
3272
3163
  const color = () => {
3273
3164
  return props.character ? data.options.getCharacterColor(props.character) : "#000";
3274
3165
  };
3275
3166
  return (() => {
3276
- const _el$ = _tmpl$4();
3277
- insert(_el$, () => props.name || " ");
3167
+ const _el$ = _tmpl$8(), _el$2 = _el$.firstChild;
3168
+ insert(_el$2, () => props.name || " ");
3169
+ insert(_el$, createComponent(Show, {
3170
+ get when() {
3171
+ return props.mood;
3172
+ },
3173
+ children: (mood) => [" ", _tmpl$23(), " ", createMemo(mood)]
3174
+ }), null);
3278
3175
  createRenderEffect((_p$) => {
3279
3176
  const _v$ = color(), _v$2 = props.character ? 1 : 0, _v$3 = props.character ? "visible" : "hidden";
3280
3177
  _v$ !== _p$._v$ && ((_p$._v$ = _v$) != null ? _el$.style.setProperty("color", _v$) : _el$.style.removeProperty("color"));
@@ -3290,69 +3187,6 @@ var DialogName = (props) => {
3290
3187
  })();
3291
3188
  };
3292
3189
 
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
3190
  // ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
3357
3191
  function r(e) {
3358
3192
  var t, f, n = "";
@@ -3369,7 +3203,7 @@ function clsx() {
3369
3203
  }
3370
3204
 
3371
3205
  // src/components/Modal.tsx
3372
- var _tmpl$18 = /* @__PURE__ */ template(`<dialog>`);
3206
+ var _tmpl$9 = /* @__PURE__ */ template(`<dialog>`);
3373
3207
  var Modal = (props) => {
3374
3208
  const [it, rest] = splitProps(props, ["isOpen", "setIsOpen", "trapFocus", "isModal"]);
3375
3209
  let dialog;
@@ -3397,7 +3231,7 @@ var Modal = (props) => {
3397
3231
  dialog[it.isOpen() ? it.isModal ? "showModal" : "show" : "close"]();
3398
3232
  });
3399
3233
  return (() => {
3400
- const _el$ = _tmpl$18();
3234
+ const _el$ = _tmpl$9();
3401
3235
  const _ref$ = dialog;
3402
3236
  typeof _ref$ === "function" ? use(_ref$, _el$) : dialog = _el$;
3403
3237
  spread(_el$, mergeProps(rest, {
@@ -3409,7 +3243,7 @@ var Modal = (props) => {
3409
3243
  })();
3410
3244
  };
3411
3245
 
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
3246
+ // ../../node_modules/.pnpm/@solid-primitives+transition-group@1.0.5_solid-js@1.9.1/node_modules/@solid-primitives/transition-group/dist/index.js
3413
3247
  var noop2 = () => {
3414
3248
  };
3415
3249
  var noopTransition = (el, done) => done();
@@ -3477,10 +3311,10 @@ function createSwitchTransition(source, options) {
3477
3311
  return returned;
3478
3312
  }
3479
3313
 
3480
- // ../../node_modules/.pnpm/@solid-primitives+utils@6.2.3_solid-js@1.8.21/node_modules/@solid-primitives/utils/dist/chunk/R5675YMU.js
3314
+ // ../../node_modules/.pnpm/@solid-primitives+utils@6.2.3_solid-js@1.9.1/node_modules/@solid-primitives/utils/dist/chunk/R5675YMU.js
3481
3315
  var access = (v) => typeof v === "function" && !v.length ? v() : v;
3482
3316
 
3483
- // ../../node_modules/.pnpm/@solid-primitives+refs@1.0.8_solid-js@1.8.21/node_modules/@solid-primitives/refs/dist/index.js
3317
+ // ../../node_modules/.pnpm/@solid-primitives+refs@1.0.8_solid-js@1.9.1/node_modules/@solid-primitives/refs/dist/index.js
3484
3318
  var defaultElementPredicate = isServer ? (item) => item != null && typeof item === "object" && "t" in item : (item) => item instanceof Element;
3485
3319
  function getFirstChild(value, predicate) {
3486
3320
  if (predicate(value))
@@ -3501,7 +3335,7 @@ function resolveFirst(fn, predicate = defaultElementPredicate, serverPredicate =
3501
3335
  return createMemo(() => getFirstChild(children2(), isServer ? serverPredicate : predicate));
3502
3336
  }
3503
3337
 
3504
- // ../../node_modules/.pnpm/solid-transition-group@0.2.3_solid-js@1.8.21/node_modules/solid-transition-group/dist/index.js
3338
+ // ../../node_modules/.pnpm/solid-transition-group@0.2.3_solid-js@1.9.1/node_modules/solid-transition-group/dist/index.js
3505
3339
  function createClassnames(props) {
3506
3340
  return createMemo(() => {
3507
3341
  const name = props.name || "s";
@@ -3596,14 +3430,28 @@ var Transition2 = (props) => {
3596
3430
  );
3597
3431
  };
3598
3432
 
3433
+ // src/context-state.ts
3434
+ var { useContextState, removeContextState } = createContextStateRoot(() => {
3435
+ return {
3436
+ images: {},
3437
+ dialogOverviewShown: false,
3438
+ mood: ""
3439
+ };
3440
+ });
3441
+
3599
3442
  // src/components/Save.tsx
3600
- var _tmpl$19 = /* @__PURE__ */ template(`<div class="saves__list-item__overlay">`);
3443
+ var _tmpl$10 = /* @__PURE__ */ template(`<div class="saves__list-item__overlay">`);
3601
3444
  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">`);
3445
+ 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>`);
3446
+ var _tmpl$42 = /* @__PURE__ */ template(`<div class="saves__list-item__iframe">`);
3604
3447
  var CURRENT_DATE = /* @__PURE__ */ new Date();
3605
3448
  var CURRENT_YEAR = CURRENT_DATE.getFullYear();
3606
3449
  var stylesheet = createRetrieved(getDocumentStyles);
3450
+ var style2 = createRetrieved(() => {
3451
+ const element = document.createElement("style");
3452
+ element.innerHTML = stylesheet();
3453
+ return element;
3454
+ });
3607
3455
  var Save = (props) => {
3608
3456
  const {
3609
3457
  t,
@@ -3651,7 +3499,9 @@ var Save = (props) => {
3651
3499
  contentDocument
3652
3500
  } = iframe();
3653
3501
  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>`);
3502
+ contentDocument.head.insertAdjacentHTML("beforeend", `<style>:root { font-size: 30%; background: black; cursor: pointer; } * { pointer-events: none; } *, *::before, *::after { animation-play-state: paused !important; }</style>`);
3503
+ const styleClone = contentDocument.importNode(style2(), true);
3504
+ contentDocument.head.appendChild(styleClone);
3655
3505
  context.root = contentDocument.body;
3656
3506
  setIframeLoaded(true);
3657
3507
  };
@@ -3699,7 +3549,7 @@ var Save = (props) => {
3699
3549
  clearTimeout(previewDoneTimeoutId);
3700
3550
  });
3701
3551
  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;
3552
+ 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
3553
  setAttribute(_el$, "data-timestamp", timestamp);
3704
3554
  _el$2.$$keyup = (event) => {
3705
3555
  if (event.code === "Space") {
@@ -3720,7 +3570,7 @@ var Save = (props) => {
3720
3570
  return props.overlayShown;
3721
3571
  },
3722
3572
  get children() {
3723
- return _tmpl$19();
3573
+ return _tmpl$10();
3724
3574
  }
3725
3575
  });
3726
3576
  }
@@ -3730,7 +3580,7 @@ var Save = (props) => {
3730
3580
  return props.observed;
3731
3581
  },
3732
3582
  get fallback() {
3733
- return _tmpl$43();
3583
+ return _tmpl$42();
3734
3584
  },
3735
3585
  get children() {
3736
3586
  return [(() => {
@@ -3908,19 +3758,9 @@ var TEXT_SPEED_MAP = {
3908
3758
  Fast: () => 60,
3909
3759
  Auto: void 0
3910
3760
  };
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
3761
 
3922
3762
  // src/components/Typewriter.tsx
3923
- var _tmpl$20 = /* @__PURE__ */ template(`<span>`);
3763
+ var _tmpl$11 = /* @__PURE__ */ template(`<span>`);
3924
3764
  var PRM = matchMedia("(prefers-reduced-motion: reduce)");
3925
3765
  var createTypewriter = ({
3926
3766
  resolve
@@ -3960,7 +3800,7 @@ var createTypewriter = ({
3960
3800
  bypassed = false;
3961
3801
  });
3962
3802
  return (() => {
3963
- const _el$ = _tmpl$20();
3803
+ const _el$ = _tmpl$11();
3964
3804
  const _ref$ = node;
3965
3805
  typeof _ref$ === "function" ? use(_ref$, _el$) : node = _el$;
3966
3806
  spread(_el$, mergeProps(() => props.attributes), false, false);
@@ -3986,7 +3826,7 @@ var createTypewriter = ({
3986
3826
  };
3987
3827
 
3988
3828
  // src/components/Canvas.tsx
3989
- var _tmpl$21 = /* @__PURE__ */ template(`<canvas>`);
3829
+ var _tmpl$12 = /* @__PURE__ */ template(`<canvas>`);
3990
3830
  var Canvas = (props) => {
3991
3831
  const [local, rest] = splitProps(props, ["resize", "render"]);
3992
3832
  const [canvas, setCanvas] = createSignal();
@@ -4030,7 +3870,7 @@ var Canvas = (props) => {
4030
3870
  removeEventListener("resize", onResize);
4031
3871
  });
4032
3872
  return (() => {
4033
- const _el$ = _tmpl$21();
3873
+ const _el$ = _tmpl$12();
4034
3874
  use(setCanvas, _el$);
4035
3875
  spread(_el$, rest, false, false);
4036
3876
  return _el$;
@@ -4038,60 +3878,152 @@ var Canvas = (props) => {
4038
3878
  };
4039
3879
 
4040
3880
  // 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>`);
3881
+ 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
3882
  var Select = (props) => {
4043
3883
  const [local, rest] = splitProps(props, ["icon", "label"]);
4044
3884
  const id = createUniqueId();
4045
3885
  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;
3886
+ 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
3887
  setAttribute(_el$2, "for", id);
4048
3888
  setAttribute(_el$3, "aria-hidden", true);
4049
3889
  insert(_el$2, () => local.label, null);
4050
- spread(_el$6, mergeProps(rest, {
3890
+ spread(_el$8, mergeProps(rest, {
4051
3891
  "class": "select__select",
4052
3892
  "id": id
4053
3893
  }), 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);
3894
+ insert(_el$8, () => props.children);
3895
+ setAttribute(_el$9, "aria-hidden", true);
3896
+ createRenderEffect(() => setAttribute(_el$5, "href", local.icon));
4063
3897
  return _el$;
4064
3898
  })();
4065
3899
  };
4066
3900
 
4067
3901
  // 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>`);
3902
+ 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
3903
  var Range = (props) => {
4070
3904
  const [local, rest] = splitProps(props, ["icon", "label"]);
4071
3905
  const id = createUniqueId();
4072
3906
  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;
3907
+ 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
3908
  setAttribute(_el$2, "for", id);
4075
3909
  setAttribute(_el$3, "aria-hidden", true);
4076
3910
  insert(_el$2, () => local.label, null);
4077
- spread(_el$5, mergeProps(rest, {
3911
+ spread(_el$7, mergeProps(rest, {
4078
3912
  "class": "range__range",
4079
3913
  "type": "range",
4080
3914
  "id": id
4081
3915
  }), false, false);
4082
- createRenderEffect(() => _el$3.innerHTML = local.icon);
3916
+ createRenderEffect(() => setAttribute(_el$5, "href", local.icon));
4083
3917
  return _el$;
4084
3918
  })();
4085
3919
  };
4086
3920
 
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));
3921
+ // src/components/DialogOverview.tsx
3922
+ var _tmpl$15 = /* @__PURE__ */ template(`<div class="dialog-overview__head"><span></span><button type="button" class="button">`);
3923
+ var _tmpl$25 = /* @__PURE__ */ template(`<div class="dialog-overview__body"><table class="dialog-overview__list">`);
3924
+ 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>`);
3925
+ 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>`);
3926
+ var DialogOverview = (props) => {
3927
+ const data = useData();
3928
+ const [scrollArea, setScrollArea] = createSignal();
3929
+ const [currentlyPlayingSource, setCurrentlyPlayingSource] = createSignal(null);
3930
+ const [currentlyPlaying, setCurrentlyPlaying] = createSignal(null);
3931
+ let playingId = 0;
3932
+ createEffect(() => {
3933
+ const current = currentlyPlaying();
3934
+ const scrollAreaElement = scrollArea();
3935
+ if (props.shown) {
3936
+ props.context.audio.voiceStop();
3937
+ if (scrollAreaElement) {
3938
+ Promise.resolve().then(() => {
3939
+ scrollAreaElement.lastElementChild?.scrollIntoView();
3940
+ });
3941
+ }
3942
+ } else {
3943
+ current?.stop();
3944
+ setCurrentlyPlaying(null);
3945
+ }
3946
+ });
3947
+ return createComponent(Modal, {
3948
+ "class": "dialog-overview",
3949
+ isModal: true,
3950
+ isOpen: () => props.shown,
3951
+ trapFocus: () => props.shown,
3952
+ get children() {
3953
+ return [(() => {
3954
+ const _el$ = _tmpl$15(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
3955
+ insert(_el$2, () => data.t("DialogOverview"));
3956
+ _el$3.$$click = () => {
3957
+ props.close();
3958
+ };
3959
+ insert(_el$3, () => data.t("Close"));
3960
+ return _el$;
3961
+ })(), (() => {
3962
+ const _el$4 = _tmpl$25(), _el$5 = _el$4.firstChild;
3963
+ use(setScrollArea, _el$5);
3964
+ insert(_el$5, createComponent(Show, {
3965
+ get when() {
3966
+ return props.shown;
3967
+ },
3968
+ keyed: true,
3969
+ get children() {
3970
+ return createComponent(For, {
3971
+ get each() {
3972
+ return data.options.getDialogOverview();
3973
+ },
3974
+ children: (entry) => (() => {
3975
+ 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;
3976
+ insert(_el$8, () => removeTagsFromHTML(entry.name));
3977
+ insert(_el$9, createComponent(Show, {
3978
+ get when() {
3979
+ return entry.voice;
3980
+ },
3981
+ get children() {
3982
+ const _el$10 = _tmpl$33(), _el$11 = _el$10.firstChild, _el$12 = _el$11.firstChild;
3983
+ _el$10.$$click = async () => {
3984
+ if (!entry.voice) return;
3985
+ const voice = props.audio.getAudio("voice", entry.voice);
3986
+ const source = currentlyPlayingSource();
3987
+ if (currentlyPlayingSource() === entry.voice) {
3988
+ await voice.stop();
3989
+ setCurrentlyPlaying(null);
3990
+ setCurrentlyPlayingSource("");
3991
+ } else {
3992
+ if (source) {
3993
+ const previous = props.audio.getAudio("voice", source);
3994
+ await previous.stop();
3995
+ }
3996
+ setCurrentlyPlaying(voice);
3997
+ setCurrentlyPlayingSource(entry.voice);
3998
+ await voice.reset();
3999
+ await voice.play();
4000
+ const currentPlayingId = ++playingId;
4001
+ voice.onEnded(() => {
4002
+ if (currentPlayingId === playingId) {
4003
+ setCurrentlyPlaying(null);
4004
+ setCurrentlyPlayingSource("");
4005
+ }
4006
+ });
4007
+ }
4008
+ };
4009
+ createRenderEffect(() => setAttribute(_el$12, "href", currentlyPlayingSource() === entry.voice ? "#novely-stop-icon" : "#novely-play-icon"));
4010
+ return _el$10;
4011
+ }
4012
+ }));
4013
+ insert(_el$14, () => removeTagsFromHTML(entry.text));
4014
+ return _el$6;
4015
+ })()
4016
+ });
4017
+ }
4018
+ }));
4019
+ return _el$4;
4020
+ })()];
4021
+ }
4022
+ });
4092
4023
  };
4024
+ delegateEvents(["click"]);
4093
4025
 
4094
- // ../../node_modules/.pnpm/@solid-primitives+destructure@0.1.17_solid-js@1.8.21/node_modules/@solid-primitives/destructure/dist/index.js
4026
+ // ../../node_modules/.pnpm/@solid-primitives+destructure@0.1.17_solid-js@1.9.1/node_modules/@solid-primitives/destructure/dist/index.js
4095
4027
  var isReactiveObject = (value) => typeof value === "object" && value !== null;
4096
4028
  function createProxyCache(obj, get) {
4097
4029
  return new Proxy(
@@ -4113,7 +4045,7 @@ function createProxyCache(obj, get) {
4113
4045
  }
4114
4046
  function destructure(source, options) {
4115
4047
  const config = options ?? {};
4116
- const memo2 = config.memo ?? typeof source === "function";
4048
+ const memo = config.memo ?? typeof source === "function";
4117
4049
  const getter = typeof source === "function" ? (key) => () => source()[key] : (key) => () => source[key];
4118
4050
  const obj = access(source);
4119
4051
  if (config.lazy) {
@@ -4121,30 +4053,30 @@ function destructure(source, options) {
4121
4053
  return createProxyCache(obj, (key) => {
4122
4054
  const calc = getter(key);
4123
4055
  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;
4056
+ return runWithOwner(owner, () => destructure(calc, { ...config, memo }));
4057
+ return memo ? runWithOwner(owner, () => createMemo(calc, void 0, options)) : calc;
4126
4058
  });
4127
4059
  }
4128
4060
  const result = Array.isArray(obj) ? [] : {};
4129
4061
  for (const [key, value] of Object.entries(obj)) {
4130
4062
  const calc = getter(key);
4131
4063
  if (config.deep && isReactiveObject(value))
4132
- result[key] = destructure(calc, { ...config, memo: memo2 });
4064
+ result[key] = destructure(calc, { ...config, memo });
4133
4065
  else
4134
- result[key] = memo2 ? createMemo(calc, void 0, options) : calc;
4066
+ result[key] = memo ? createMemo(calc, void 0, options) : calc;
4135
4067
  }
4136
4068
  return result;
4137
4069
  }
4138
4070
 
4139
4071
  // 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">`);
4072
+ var _tmpl$16 = /* @__PURE__ */ template(`<div class="action-dialog-person">`);
4073
+ var _tmpl$26 = /* @__PURE__ */ template(`<span class="dialog-label">`);
4142
4074
  var _tmpl$34 = /* @__PURE__ */ template(`<div class="choice-dialog__choices">`);
4143
4075
  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">`);
4076
+ var _tmpl$52 = /* @__PURE__ */ template(`<span class="input-dialog__text input-dialog__error" aria-live="polite" aria-atomic="true">`);
4145
4077
  var _tmpl$62 = /* @__PURE__ */ template(`<button type="submit" class="button dialog-input__button">`);
4146
4078
  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">`);
4079
+ 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
4080
  var _tmpl$92 = /* @__PURE__ */ template(`<span class="control-panel-container-fix" aria-hidden="true">&#8203;`);
4149
4081
  var _tmpl$102 = /* @__PURE__ */ template(`<div class="control-panel-container-backdrop">`);
4150
4082
  var _tmpl$112 = /* @__PURE__ */ template(`<div class="control-panel"><div role="menubar" class="control-panel-container">`);
@@ -4152,6 +4084,9 @@ var _tmpl$122 = /* @__PURE__ */ template(`<div><div class="characters"></div><di
4152
4084
  var _tmpl$132 = /* @__PURE__ */ template(`<button type="button" class="button choice-dialog__choice"><span>`);
4153
4085
  var Game = (props) => {
4154
4086
  const data = useData();
4087
+ const {
4088
+ audio
4089
+ } = data;
4155
4090
  const {
4156
4091
  text,
4157
4092
  dialog,
@@ -4160,7 +4095,9 @@ var Game = (props) => {
4160
4095
  input,
4161
4096
  background,
4162
4097
  custom,
4163
- images
4098
+ images,
4099
+ dialogOverviewShown,
4100
+ mood
4164
4101
  } = destructure(from(props.$contextState));
4165
4102
  const rendererState = from(data.$rendererState);
4166
4103
  const exitPromptShown = () => rendererState().exitPromptShown;
@@ -4273,6 +4210,9 @@ var Game = (props) => {
4273
4210
  },
4274
4211
  get name() {
4275
4212
  return dialog().name;
4213
+ },
4214
+ get mood() {
4215
+ return mood();
4276
4216
  }
4277
4217
  }), _el$4);
4278
4218
  addEventListener2(_el$4, "keydown", onKey(DialogWriter.clear, " "), true);
@@ -4283,7 +4223,7 @@ var Game = (props) => {
4283
4223
  return dialog().miniature.emotion;
4284
4224
  },
4285
4225
  get children() {
4286
- const _el$5 = _tmpl$27();
4226
+ const _el$5 = _tmpl$16();
4287
4227
  insert(_el$5, createComponent(Show, {
4288
4228
  get when() {
4289
4229
  return dialog().miniature.emotion;
@@ -4334,7 +4274,7 @@ var Game = (props) => {
4334
4274
  trapFocus: () => !props.isPreview && !exitPromptShown(),
4335
4275
  get children() {
4336
4276
  return [(() => {
4337
- const _el$7 = _tmpl$28();
4277
+ const _el$7 = _tmpl$26();
4338
4278
  insert(_el$7, () => choice().label || " ");
4339
4279
  createRenderEffect((_p$) => {
4340
4280
  const _v$ = Boolean(choice().label), _v$2 = !choice().label;
@@ -4406,7 +4346,7 @@ var Game = (props) => {
4406
4346
  insert(_el$9, () => input().label);
4407
4347
  return _el$9;
4408
4348
  })(), createMemo(() => input().element), (() => {
4409
- const _el$10 = _tmpl$53();
4349
+ const _el$10 = _tmpl$52();
4410
4350
  insert(_el$10, () => input().error);
4411
4351
  return _el$10;
4412
4352
  })(), (() => {
@@ -4425,7 +4365,7 @@ var Game = (props) => {
4425
4365
  trapFocus: () => !props.isPreview && exitPromptShown(),
4426
4366
  get children() {
4427
4367
  return [(() => {
4428
- const _el$12 = _tmpl$28();
4368
+ const _el$12 = _tmpl$26();
4429
4369
  insert(_el$12, () => data.t("ExitDialogWarning"));
4430
4370
  return _el$12;
4431
4371
  })(), (() => {
@@ -4492,11 +4432,6 @@ var Game = (props) => {
4492
4432
  setControlPanelMenuExpanded((prev) => !prev);
4493
4433
  };
4494
4434
  setAttribute(_el$19, "aria-controls", controlPanelMenuID);
4495
- insert(_el$19, createComponent(Icon, {
4496
- get children() {
4497
- return Icon.Menu();
4498
- }
4499
- }));
4500
4435
  createRenderEffect((_p$) => {
4501
4436
  const _v$3 = data.t("OpenMenu"), _v$4 = controlPanelMenuExpanded();
4502
4437
  _v$3 !== _p$._v$3 && setAttribute(_el$19, "title", _p$._v$3 = _v$3);
@@ -4535,6 +4470,9 @@ var Game = (props) => {
4535
4470
  closeDropdown: () => {
4536
4471
  setControlPanelMenuExpanded(false);
4537
4472
  },
4473
+ openDialogOverview: () => {
4474
+ props.$contextState.setKey("dialogOverviewShown", true);
4475
+ },
4538
4476
  auto,
4539
4477
  setAuto
4540
4478
  }));
@@ -4556,6 +4494,14 @@ var Game = (props) => {
4556
4494
  },
4557
4495
  children: (image) => image
4558
4496
  }));
4497
+ insert(_el$, createComponent(DialogOverview, {
4498
+ context,
4499
+ audio,
4500
+ get shown() {
4501
+ return Boolean(!props.isPreview && dialogOverviewShown());
4502
+ },
4503
+ close: () => props.$contextState.setKey("dialogOverviewShown", false)
4504
+ }), null);
4559
4505
  createRenderEffect((_p$) => {
4560
4506
  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
4507
  _v$7 !== _p$._v$7 && className(_el$, _p$._v$7 = _v$7);
@@ -4587,18 +4533,18 @@ var Game = (props) => {
4587
4533
  delegateEvents(["click", "keydown"]);
4588
4534
 
4589
4535
  // src/screens/loading.tsx
4590
- var _tmpl$29 = /* @__PURE__ */ template(`<div class="loading"><div class="loading__animation"><div></div><div></div><div></div><div>`);
4536
+ var _tmpl$17 = /* @__PURE__ */ template(`<div class="loading"><div class="loading__animation"><div></div><div></div><div></div><div>`);
4591
4537
  var Loading = (props) => {
4592
4538
  return (() => {
4593
- const _el$ = _tmpl$29();
4539
+ const _el$ = _tmpl$17();
4594
4540
  createRenderEffect(() => _el$.classList.toggle("overlay", !!props.overlay));
4595
4541
  return _el$;
4596
4542
  })();
4597
4543
  };
4598
4544
 
4599
4545
  // 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>`);
4546
+ 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">`);
4547
+ var _tmpl$27 = /* @__PURE__ */ template(`<button>`);
4602
4548
  var MainMenu = () => {
4603
4549
  const {
4604
4550
  t,
@@ -4614,35 +4560,23 @@ var MainMenu = () => {
4614
4560
  $rendererState.mutate((s) => s.screen, screen);
4615
4561
  });
4616
4562
  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;
4563
+ 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
4564
  _el$3.$$click = () => {
4619
4565
  options.newGame();
4620
4566
  };
4621
4567
  insert(_el$4, () => t("NewGame"));
4622
- insert(_el$3, createComponent(Icon, {
4623
- children: Icon.FilePlus()
4624
- }), null);
4625
4568
  _el$5.$$click = () => {
4626
4569
  options.restore();
4627
4570
  };
4628
4571
  insert(_el$6, () => t("LoadSave"));
4629
- insert(_el$5, createComponent(Icon, {
4630
- children: Icon.Play()
4631
- }), null);
4632
4572
  _el$7.$$click = () => {
4633
4573
  goto("saves");
4634
4574
  };
4635
4575
  insert(_el$8, () => t("Saves"));
4636
- insert(_el$7, createComponent(Icon, {
4637
- children: Icon.Files()
4638
- }), null);
4639
4576
  _el$9.$$click = () => {
4640
4577
  goto("settings");
4641
4578
  };
4642
4579
  insert(_el$10, () => t("Settings"));
4643
- insert(_el$9, createComponent(Icon, {
4644
- children: Icon.Settings()
4645
- }), null);
4646
4580
  insert(_el$2, createComponent(Show, {
4647
4581
  get when() {
4648
4582
  return language();
@@ -4653,7 +4587,7 @@ var MainMenu = () => {
4653
4587
  return rendererStore().mainmenu;
4654
4588
  },
4655
4589
  children: (item) => (() => {
4656
- const _el$11 = _tmpl$210();
4590
+ const _el$11 = _tmpl$27();
4657
4591
  spread(_el$11, mergeProps(() => item(goto)), false, false);
4658
4592
  return _el$11;
4659
4593
  })()
@@ -4665,8 +4599,8 @@ var MainMenu = () => {
4665
4599
  delegateEvents(["click"]);
4666
4600
 
4667
4601
  // 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">`);
4602
+ var _tmpl$19 = /* @__PURE__ */ template(`<ol class="saves__list">`);
4603
+ var _tmpl$28 = /* @__PURE__ */ template(`<div class="saves"><div class="saves__controls"><button type="button" class="button saves__button"></button></div><div class="saves__list-container">`);
4670
4604
  var _tmpl$35 = /* @__PURE__ */ template(`<div class="saves__list saves__list--empty">`);
4671
4605
  var Saves = () => {
4672
4606
  const {
@@ -4734,7 +4668,7 @@ var Saves = () => {
4734
4668
  return !targets.every((item) => completed.includes(item));
4735
4669
  };
4736
4670
  return (() => {
4737
- const _el$ = _tmpl$211(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$2.nextSibling;
4671
+ const _el$ = _tmpl$28(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$2.nextSibling;
4738
4672
  _el$3.$$click = () => {
4739
4673
  $rendererState.setKey("screen", "mainmenu");
4740
4674
  };
@@ -4751,7 +4685,7 @@ var Saves = () => {
4751
4685
  })();
4752
4686
  },
4753
4687
  get children() {
4754
- const _el$5 = _tmpl$31();
4688
+ const _el$5 = _tmpl$19();
4755
4689
  use(setList, _el$5);
4756
4690
  insert(_el$5, createComponent(For, {
4757
4691
  get each() {
@@ -4782,8 +4716,8 @@ var Saves = () => {
4782
4716
  delegateEvents(["click"]);
4783
4717
 
4784
4718
  // 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>`);
4719
+ 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>`);
4720
+ var _tmpl$29 = /* @__PURE__ */ template(`<option>`);
4787
4721
  var Settings = (props) => {
4788
4722
  const {
4789
4723
  t,
@@ -4829,7 +4763,7 @@ var Settings = (props) => {
4829
4763
  return fn;
4830
4764
  };
4831
4765
  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;
4766
+ 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
4767
  _el$3.$$click = () => {
4834
4768
  $rendererState.setKey("screen", "mainmenu");
4835
4769
  };
@@ -4839,9 +4773,7 @@ var Settings = (props) => {
4839
4773
  };
4840
4774
  insert(_el$4, () => t("ToTheGame"));
4841
4775
  insert(_el$6, createComponent(Select, {
4842
- get icon() {
4843
- return props.icons.language;
4844
- },
4776
+ icon: "#novely-globe-icon",
4845
4777
  get label() {
4846
4778
  return t("Language");
4847
4779
  },
@@ -4852,7 +4784,7 @@ var Settings = (props) => {
4852
4784
  return options.languages;
4853
4785
  },
4854
4786
  children: (lang) => (() => {
4855
- const _el$8 = _tmpl$212();
4787
+ const _el$8 = _tmpl$29();
4856
4788
  _el$8.value = lang;
4857
4789
  insert(_el$8, () => options.getLanguageDisplayName(lang));
4858
4790
  createRenderEffect(() => _el$8.selected = lang === language());
@@ -4862,9 +4794,7 @@ var Settings = (props) => {
4862
4794
  }
4863
4795
  }), null);
4864
4796
  insert(_el$6, createComponent(Select, {
4865
- get icon() {
4866
- return props.icons.typewriter_speed;
4867
- },
4797
+ icon: "#novely-typewriter-speed-icon",
4868
4798
  get label() {
4869
4799
  return t("TextSpeed");
4870
4800
  },
@@ -4873,7 +4803,7 @@ var Settings = (props) => {
4873
4803
  return createComponent(For, {
4874
4804
  each: ["Slow", "Medium", "Fast", "Auto"],
4875
4805
  children: (speed) => (() => {
4876
- const _el$9 = _tmpl$212();
4806
+ const _el$9 = _tmpl$29();
4877
4807
  _el$9.value = speed;
4878
4808
  insert(_el$9, () => t("TextSpeed" + speed));
4879
4809
  createRenderEffect(() => _el$9.selected = speed === textSpeed());
@@ -4883,9 +4813,7 @@ var Settings = (props) => {
4883
4813
  }
4884
4814
  }), null);
4885
4815
  insert(_el$7, createComponent(Range, {
4886
- get icon() {
4887
- return props.icons.music_volume;
4888
- },
4816
+ icon: "#novely-music-volume-icon",
4889
4817
  get label() {
4890
4818
  return t("MusicVolume");
4891
4819
  },
@@ -4900,9 +4828,7 @@ var Settings = (props) => {
4900
4828
  }
4901
4829
  }), null);
4902
4830
  insert(_el$7, createComponent(Range, {
4903
- get icon() {
4904
- return props.icons.sound_volume;
4905
- },
4831
+ icon: "#novely-sound-volume-icon",
4906
4832
  get label() {
4907
4833
  return t("SoundVolume");
4908
4834
  },
@@ -4917,9 +4843,7 @@ var Settings = (props) => {
4917
4843
  }
4918
4844
  }), null);
4919
4845
  insert(_el$7, createComponent(Range, {
4920
- get icon() {
4921
- return props.icons.voice_volume;
4922
- },
4846
+ icon: "#novely-voice-volume-icon",
4923
4847
  get label() {
4924
4848
  return t("VoiceVolume");
4925
4849
  },
@@ -4940,7 +4864,7 @@ var Settings = (props) => {
4940
4864
  delegateEvents(["click"]);
4941
4865
 
4942
4866
  // src/components/Root.tsx
4943
- var _tmpl$37 = /* @__PURE__ */ template(`<div class="root">`);
4867
+ var _tmpl$21 = /* @__PURE__ */ template(`<div class="root">`);
4944
4868
  var createRootComponent = ({
4945
4869
  $rendererState,
4946
4870
  $contextState,
@@ -4952,12 +4876,14 @@ var createRootComponent = ({
4952
4876
  emitter,
4953
4877
  controls,
4954
4878
  skipTypewriterWhenGoingBack,
4955
- settingsIcons: settingsIcons2,
4956
- rendererContext
4879
+ rendererContext,
4880
+ audio
4957
4881
  }) => {
4958
4882
  const Root = () => {
4959
- const screen = from(memo($rendererState, (state) => state.screen));
4960
- const loadingShown = from(memo($rendererState, (state) => state.loadingShown));
4883
+ const {
4884
+ screen,
4885
+ loadingShown
4886
+ } = destructure(from($rendererState));
4961
4887
  createEffect(() => {
4962
4888
  const currentScreen = screen();
4963
4889
  if (fullscreen && document.fullscreenEnabled) {
@@ -4969,13 +4895,10 @@ var createRootComponent = ({
4969
4895
  });
4970
4896
  }
4971
4897
  }
4972
- if (currentScreen !== "game" && currentScreen !== "settings" && !loadingShown()) {
4973
- rendererContext.audio.destroy();
4974
- }
4975
4898
  emitter.emit("screen:change", currentScreen);
4976
4899
  });
4977
4900
  return (() => {
4978
- const _el$ = _tmpl$37();
4901
+ const _el$ = _tmpl$21();
4979
4902
  const _ref$ = setRoot;
4980
4903
  typeof _ref$ === "function" ? use(_ref$, _el$) : setRoot = _el$;
4981
4904
  insert(_el$, createComponent(Provider, {
@@ -4995,6 +4918,7 @@ var createRootComponent = ({
4995
4918
  get removeContext() {
4996
4919
  return renderer.removeContext;
4997
4920
  },
4921
+ audio,
4998
4922
  get children() {
4999
4923
  return [createComponent(Switch, {
5000
4924
  get children() {
@@ -5033,7 +4957,6 @@ var createRootComponent = ({
5033
4957
  },
5034
4958
  get children() {
5035
4959
  return createComponent(Settings, {
5036
- icons: settingsIcons2,
5037
4960
  showAudioSettings
5038
4961
  });
5039
4962
  }
@@ -5153,8 +5076,59 @@ var hideImage = (source, params = {}) => {
5153
5076
  return ["custom", handler];
5154
5077
  };
5155
5078
 
5079
+ // src/custom-actions/mood.ts
5080
+ var SET_MOOD = Symbol();
5081
+ var setMood = (mood) => {
5082
+ const handler = ({ contextKey, clear }) => {
5083
+ const ctx = useContextState(contextKey);
5084
+ if (mood === "''" || mood === '""') ctx.setKey("mood", "");
5085
+ else ctx.setKey("mood", mood);
5086
+ clear(() => {
5087
+ ctx.setKey("mood", "");
5088
+ });
5089
+ };
5090
+ handler.id = SET_MOOD;
5091
+ handler.key = "set-mood";
5092
+ handler.callOnlyLatest = true;
5093
+ return ["custom", handler];
5094
+ };
5095
+
5096
+ // src/emitter.ts
5097
+ var createEmitter = () => {
5098
+ const listeners = /* @__PURE__ */ new Map();
5099
+ return {
5100
+ on(name, fn) {
5101
+ const set = listeners.get(name);
5102
+ if (!set) {
5103
+ listeners.set(name, /* @__PURE__ */ new Set());
5104
+ return this.on(name, fn);
5105
+ }
5106
+ set.add(fn);
5107
+ },
5108
+ once(name, fn) {
5109
+ const listener = (params) => {
5110
+ fn(params);
5111
+ this.off(name, listener);
5112
+ };
5113
+ this.on(name, listener);
5114
+ },
5115
+ off(name, fn) {
5116
+ const set = listeners.get(name);
5117
+ if (set) {
5118
+ set.delete(fn);
5119
+ }
5120
+ },
5121
+ emit(name, params) {
5122
+ const set = listeners.get(name);
5123
+ if (set) {
5124
+ set.forEach((fn) => fn(params));
5125
+ }
5126
+ }
5127
+ };
5128
+ };
5129
+
5156
5130
  // src/renderer.tsx
5157
- var _tmpl$38 = /* @__PURE__ */ template(`<canvas>`);
5131
+ var _tmpl$30 = /* @__PURE__ */ template(`<canvas>`);
5158
5132
  var {
5159
5133
  preloadAudioBlocking
5160
5134
  } = createAudioMisc();
@@ -5163,7 +5137,6 @@ var createSolidRenderer = ({
5163
5137
  controls = "outside",
5164
5138
  skipTypewriterWhenGoingBack = true,
5165
5139
  target = document.body,
5166
- settingsIcons: settingsIcons2 = settingsIcons,
5167
5140
  showAudioSettings = true
5168
5141
  } = {}) => {
5169
5142
  const emitter = createEmitter();
@@ -5185,10 +5158,10 @@ var createSolidRenderer = ({
5185
5158
  root,
5186
5159
  setRoot
5187
5160
  } = createRootSetter(() => renderer.getContext(options.mainContextKey));
5161
+ const audio = createAudio2(options.storageData);
5188
5162
  const cleanup = {};
5189
5163
  const renderer = {
5190
5164
  getContext: getContextCached((name) => {
5191
- const audio = createAudio2(options.storageData);
5192
5165
  const $contextState = useContextState(name);
5193
5166
  {
5194
5167
  const unsub = $contextState.listen((state, prev) => {
@@ -5214,7 +5187,7 @@ var createSolidRenderer = ({
5214
5187
  return chars[character];
5215
5188
  }
5216
5189
  const canvas = (() => {
5217
- const _el$ = _tmpl$38();
5190
+ const _el$ = _tmpl$30();
5218
5191
  setAttribute(_el$, "data-character", character);
5219
5192
  return _el$;
5220
5193
  })();
@@ -5257,10 +5230,10 @@ var createSolidRenderer = ({
5257
5230
  canvasDrawImages(canvas, canvasContext, stored);
5258
5231
  }
5259
5232
  },
5260
- append(className2, style2) {
5233
+ append(className2, style3) {
5261
5234
  clearTimeout($contextState.get().characters[character]?.hideTimeoutId);
5262
5235
  $contextState.mutate((s) => s.characters[character], {
5263
- style: style2,
5236
+ style: style3,
5264
5237
  visible: true
5265
5238
  });
5266
5239
  const {
@@ -5272,7 +5245,7 @@ var createSolidRenderer = ({
5272
5245
  element.className = className2;
5273
5246
  }
5274
5247
  },
5275
- remove(className2, style2, duration, restoring) {
5248
+ remove(className2, style3, duration, restoring) {
5276
5249
  return new Promise((resolve) => {
5277
5250
  const hide = () => {
5278
5251
  $contextState.mutate((s) => s.characters[character], (prev) => {
@@ -5297,7 +5270,7 @@ var createSolidRenderer = ({
5297
5270
  $contextState.mutate((s) => s.characters[character], (prev) => {
5298
5271
  return {
5299
5272
  ...prev,
5300
- style: style2,
5273
+ style: style3,
5301
5274
  hideTimeoutId: timeoutId
5302
5275
  };
5303
5276
  });
@@ -5399,12 +5372,12 @@ var createSolidRenderer = ({
5399
5372
  emitter,
5400
5373
  controls,
5401
5374
  skipTypewriterWhenGoingBack,
5402
- settingsIcons: settingsIcons2,
5403
5375
  showAudioSettings,
5404
5376
  rendererContext: renderer.getContext(options.mainContextKey),
5405
5377
  coreOptions: options,
5406
5378
  $rendererState,
5407
- $contextState: useContextState(options.mainContextKey)
5379
+ $contextState: useContextState(options.mainContextKey),
5380
+ audio
5408
5381
  });
5409
5382
  return render(() => createComponent(Root, {}), target);
5410
5383
  })
@@ -5421,7 +5394,8 @@ var createSolidRenderer = ({
5421
5394
  },
5422
5395
  actions: {
5423
5396
  showImage,
5424
- hideImage
5397
+ hideImage,
5398
+ setMood
5425
5399
  }
5426
5400
  };
5427
5401
  return renderer;