mol_plot_all 1.2.524 → 1.2.526

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/node.mjs CHANGED
@@ -1,18 +1,5 @@
1
1
  "use strict";
2
2
  var exports = void 0;
3
- "use strict"
4
-
5
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
6
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
7
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
8
- else for (var i = decorators.length - 1; i >= 0; i--) if ((d = decorators[i])) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
9
- return c > 3 && r && Object.defineProperty(target, key, r), r;
10
- };
11
-
12
- var $ = ( typeof module === 'object' ) ? ( module['export'+'s'] = globalThis ) : globalThis
13
- $.$$ = $
14
-
15
- ;
16
3
 
17
4
  var $node = $node || {}
18
5
  void function( module ) { var exports = module.exports = this; function require( id ) { return $node[ id.replace( /^.\// , "../" ) ] };
@@ -27,6 +14,19 @@ module.exports = $;
27
14
  ;
28
15
 
29
16
  $node[ "../mam.ts" ] = $node[ "../mam.ts" ] = module.exports }.call( {} , {} )
17
+ ;
18
+ "use strict"
19
+
20
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
21
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
22
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
23
+ else for (var i = decorators.length - 1; i >= 0; i--) if ((d = decorators[i])) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
24
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
25
+ };
26
+
27
+ var $ = ( typeof module === 'object' ) ? ( module['export'+'s'] = globalThis ) : globalThis
28
+ $.$$ = $
29
+
30
30
  ;
31
31
  "use strict";
32
32
  var $;
@@ -200,1864 +200,1685 @@ var $;
200
200
  ;
201
201
  "use strict";
202
202
  var $;
203
- (function ($) {
204
- class $mol_after_tick extends $mol_object2 {
205
- task;
206
- promise;
207
- cancelled = false;
208
- constructor(task) {
209
- super();
210
- this.task = task;
211
- this.promise = Promise.resolve().then(() => {
212
- if (this.cancelled)
213
- return;
214
- task();
203
+ (function ($_1) {
204
+ let $$;
205
+ (function ($$) {
206
+ let $;
207
+ })($$ = $_1.$$ || ($_1.$$ = {}));
208
+ $_1.$mol_object_field = Symbol('$mol_object_field');
209
+ class $mol_object extends $mol_object2 {
210
+ static make(config) {
211
+ return super.create(obj => {
212
+ for (let key in config)
213
+ obj[key] = config[key];
215
214
  });
216
215
  }
217
- destructor() {
218
- this.cancelled = true;
219
- }
220
216
  }
221
- $.$mol_after_tick = $mol_after_tick;
217
+ $_1.$mol_object = $mol_object;
222
218
  })($ || ($ = {}));
223
- //mol/after/tick/tick.ts
219
+ //mol/object/object.ts
224
220
  ;
225
221
  "use strict";
226
222
  var $;
227
223
  (function ($) {
224
+ class $mol_window extends $mol_object {
225
+ static size() {
226
+ return {
227
+ width: 1024,
228
+ height: 768,
229
+ };
230
+ }
231
+ }
232
+ $.$mol_window = $mol_window;
228
233
  })($ || ($ = {}));
229
- //mol/dom/context/context.ts
234
+ //mol/window/window.node.ts
230
235
  ;
231
236
  "use strict";
232
- //node/node.ts
237
+ var $;
238
+ (function ($) {
239
+ let $mol_wire_cursor;
240
+ (function ($mol_wire_cursor) {
241
+ $mol_wire_cursor[$mol_wire_cursor["stale"] = -1] = "stale";
242
+ $mol_wire_cursor[$mol_wire_cursor["doubt"] = -2] = "doubt";
243
+ $mol_wire_cursor[$mol_wire_cursor["fresh"] = -3] = "fresh";
244
+ $mol_wire_cursor[$mol_wire_cursor["final"] = -4] = "final";
245
+ })($mol_wire_cursor = $.$mol_wire_cursor || ($.$mol_wire_cursor = {}));
246
+ })($ || ($ = {}));
247
+ //mol/wire/cursor/cursor.ts
233
248
  ;
234
249
  "use strict";
235
- var $node = new Proxy({ require }, {
236
- get(target, name, wrapper) {
237
- if (target[name])
238
- return target[name];
239
- const mod = target.require('module');
240
- if (mod.builtinModules.indexOf(name) >= 0)
241
- return target.require(name);
242
- if (name[0] === '.')
243
- return target.require(name);
244
- const path = target.require('path');
245
- const fs = target.require('fs');
246
- let dir = path.resolve('.');
247
- const suffix = `./node_modules/${name}`;
248
- const $$ = $;
249
- while (!fs.existsSync(path.join(dir, suffix))) {
250
- const parent = path.resolve(dir, '..');
251
- if (parent === dir) {
252
- $$.$mol_exec('.', 'npm', 'install', '--omit=dev', name);
253
- try {
254
- $$.$mol_exec('.', 'npm', 'install', '--omit=dev', '@types/' + name);
255
- }
256
- catch { }
257
- break;
250
+ var $;
251
+ (function ($) {
252
+ class $mol_wire_pub extends Object {
253
+ data = [];
254
+ static get [Symbol.species]() {
255
+ return Array;
256
+ }
257
+ sub_from = 0;
258
+ get sub_list() {
259
+ const res = [];
260
+ for (let i = this.sub_from; i < this.data.length; i += 2) {
261
+ res.push(this.data[i]);
258
262
  }
259
- else {
260
- dir = parent;
263
+ return res;
264
+ }
265
+ get sub_empty() {
266
+ return this.sub_from === this.data.length;
267
+ }
268
+ sub_on(sub, pub_pos) {
269
+ const pos = this.data.length;
270
+ this.data.push(sub, pub_pos);
271
+ return pos;
272
+ }
273
+ sub_off(sub_pos) {
274
+ if (!(sub_pos < this.data.length)) {
275
+ $mol_fail(new Error(`Wrong pos ${sub_pos}`));
276
+ }
277
+ const end = this.data.length - 2;
278
+ if (sub_pos !== end) {
279
+ this.peer_move(end, sub_pos);
261
280
  }
281
+ this.data.pop();
282
+ this.data.pop();
283
+ if (this.data.length === this.sub_from)
284
+ this.reap();
262
285
  }
263
- return target.require(name);
264
- },
265
- set(target, name, value) {
266
- target[name] = value;
267
- return true;
268
- },
269
- });
270
- require = (req => Object.assign(function require(name) {
271
- return $node[name];
272
- }, req))(require);
273
- //node/node.node.ts
286
+ reap() { }
287
+ promote() {
288
+ $mol_wire_auto()?.track_next(this);
289
+ }
290
+ fresh() { }
291
+ complete() { }
292
+ emit(quant = $mol_wire_cursor.stale) {
293
+ for (let i = this.sub_from; i < this.data.length; i += 2) {
294
+ ;
295
+ this.data[i].absorb(quant);
296
+ }
297
+ }
298
+ peer_move(from_pos, to_pos) {
299
+ const peer = this.data[from_pos];
300
+ const self_pos = this.data[from_pos + 1];
301
+ this.data[to_pos] = peer;
302
+ this.data[to_pos + 1] = self_pos;
303
+ peer.peer_repos(self_pos, to_pos);
304
+ }
305
+ peer_repos(peer_pos, self_pos) {
306
+ this.data[peer_pos + 1] = self_pos;
307
+ }
308
+ }
309
+ $.$mol_wire_pub = $mol_wire_pub;
310
+ })($ || ($ = {}));
311
+ //mol/wire/pub/pub.ts
312
+ ;
313
+ "use strict";
314
+ //mol/wire/sub/sub.ts
274
315
  ;
275
316
  "use strict";
276
317
  var $;
277
318
  (function ($) {
278
- function $mol_log3_area_lazy(event) {
279
- const self = this;
280
- const stack = self.$mol_log3_stack;
281
- const deep = stack.length;
282
- let logged = false;
283
- stack.push(() => {
284
- logged = true;
285
- self.$mol_log3_area.call(self, event);
286
- });
287
- return () => {
288
- if (logged)
289
- self.console.groupEnd();
290
- if (stack.length > deep)
291
- stack.length = deep;
292
- };
319
+ let auto = null;
320
+ function $mol_wire_auto(next = auto) {
321
+ return auto = next;
293
322
  }
294
- $.$mol_log3_area_lazy = $mol_log3_area_lazy;
295
- $.$mol_log3_stack = [];
323
+ $.$mol_wire_auto = $mol_wire_auto;
324
+ $.$mol_wire_affected = [];
296
325
  })($ || ($ = {}));
297
- //mol/log3/log3.ts
326
+ //mol/wire/wire.ts
298
327
  ;
299
328
  "use strict";
300
329
  var $;
301
330
  (function ($) {
302
- $.$mol_tree_convert = Symbol('$mol_tree_convert');
303
- class $mol_tree extends $mol_object2 {
304
- type;
305
- data;
306
- sub;
307
- baseUri;
308
- row;
309
- col;
310
- length;
311
- constructor(config = {}) {
312
- super();
313
- this.type = config.type || '';
314
- if (config.value !== undefined) {
315
- var sub = $mol_tree.values(config.value);
316
- if (config.type || sub.length > 1) {
317
- this.sub = [...sub, ...(config.sub || [])];
318
- this.data = config.data || '';
319
- }
320
- else {
321
- this.data = sub[0].data;
322
- this.sub = config.sub || [];
323
- }
331
+ $['devtoolsFormatters'] = $['devtoolsFormatters'] || [];
332
+ function $mol_dev_format_register(config) {
333
+ $['devtoolsFormatters'].push(config);
334
+ }
335
+ $.$mol_dev_format_register = $mol_dev_format_register;
336
+ $.$mol_dev_format_head = Symbol('$mol_dev_format_head');
337
+ $.$mol_dev_format_body = Symbol('$mol_dev_format_body');
338
+ $mol_dev_format_register({
339
+ header: (val, config = false) => {
340
+ if (config)
341
+ return null;
342
+ if (!val)
343
+ return null;
344
+ if ($.$mol_dev_format_head in val) {
345
+ return val[$.$mol_dev_format_head]();
324
346
  }
325
- else {
326
- this.data = config.data || '';
327
- this.sub = config.sub || [];
347
+ if (typeof val === 'function') {
348
+ return $mol_dev_format_native(val);
328
349
  }
329
- this.baseUri = config.baseUri || '';
330
- this.row = config.row || 0;
331
- this.col = config.col || 0;
332
- this.length = config.length || 0;
333
- }
334
- static values(str, baseUri) {
335
- return str.split('\n').map((data, index) => new $mol_tree({
336
- data: data,
337
- baseUri: baseUri,
338
- row: index + 1,
339
- length: data.length,
340
- }));
341
- }
342
- clone(config = {}) {
343
- return new $mol_tree({
344
- type: ('type' in config) ? config.type : this.type,
345
- data: ('data' in config) ? config.data : this.data,
346
- sub: ('sub' in config) ? config.sub : this.sub,
347
- baseUri: ('baseUri' in config) ? config.baseUri : this.baseUri,
348
- row: ('row' in config) ? config.row : this.row,
349
- col: ('col' in config) ? config.col : this.col,
350
- length: ('length' in config) ? config.length : this.length,
351
- value: config.value
352
- });
353
- }
354
- make(config) {
355
- return new $mol_tree({
356
- baseUri: this.baseUri,
357
- row: this.row,
358
- col: this.col,
359
- length: this.length,
360
- ...config,
361
- });
362
- }
363
- make_data(value, sub) {
364
- return this.make({ value, sub });
350
+ return null;
351
+ },
352
+ hasBody: val => val[$.$mol_dev_format_body],
353
+ body: val => val[$.$mol_dev_format_body](),
354
+ });
355
+ function $mol_dev_format_native(obj) {
356
+ if (typeof obj === 'undefined')
357
+ return $.$mol_dev_format_shade('undefined');
358
+ if (typeof obj !== 'object' && typeof obj !== 'function')
359
+ return obj;
360
+ return [
361
+ 'object',
362
+ {
363
+ object: obj,
364
+ config: true,
365
+ },
366
+ ];
367
+ }
368
+ $.$mol_dev_format_native = $mol_dev_format_native;
369
+ function $mol_dev_format_auto(obj) {
370
+ if (obj == null)
371
+ return $.$mol_dev_format_shade(String(obj));
372
+ if (typeof obj === 'object' && $.$mol_dev_format_head in obj) {
373
+ return obj[$.$mol_dev_format_head]();
365
374
  }
366
- make_struct(type, sub) {
367
- return this.make({ type, sub });
375
+ return [
376
+ 'object',
377
+ {
378
+ object: obj,
379
+ config: false,
380
+ },
381
+ ];
382
+ }
383
+ $.$mol_dev_format_auto = $mol_dev_format_auto;
384
+ function $mol_dev_format_element(element, style, ...content) {
385
+ const styles = [];
386
+ for (let key in style)
387
+ styles.push(`${key} : ${style[key]}`);
388
+ return [
389
+ element,
390
+ {
391
+ style: styles.join(' ; '),
392
+ },
393
+ ...content,
394
+ ];
395
+ }
396
+ $.$mol_dev_format_element = $mol_dev_format_element;
397
+ function $mol_dev_format_span(style, ...content) {
398
+ return $mol_dev_format_element('span', {
399
+ 'vertical-align': '8%',
400
+ ...style,
401
+ }, ...content);
402
+ }
403
+ $.$mol_dev_format_span = $mol_dev_format_span;
404
+ $.$mol_dev_format_div = $mol_dev_format_element.bind(null, 'div');
405
+ $.$mol_dev_format_ol = $mol_dev_format_element.bind(null, 'ol');
406
+ $.$mol_dev_format_li = $mol_dev_format_element.bind(null, 'li');
407
+ $.$mol_dev_format_table = $mol_dev_format_element.bind(null, 'table');
408
+ $.$mol_dev_format_tr = $mol_dev_format_element.bind(null, 'tr');
409
+ $.$mol_dev_format_td = $mol_dev_format_element.bind(null, 'td');
410
+ $.$mol_dev_format_accent = $mol_dev_format_span.bind(null, {
411
+ 'color': 'magenta',
412
+ });
413
+ $.$mol_dev_format_strong = $mol_dev_format_span.bind(null, {
414
+ 'font-weight': 'bold',
415
+ });
416
+ $.$mol_dev_format_string = $mol_dev_format_span.bind(null, {
417
+ 'color': 'green',
418
+ });
419
+ $.$mol_dev_format_shade = $mol_dev_format_span.bind(null, {
420
+ 'color': 'gray',
421
+ });
422
+ $.$mol_dev_format_indent = $.$mol_dev_format_div.bind(null, {
423
+ 'margin-left': '13px'
424
+ });
425
+ })($ || ($ = {}));
426
+ //mol/dev/format/format.ts
427
+ ;
428
+ "use strict";
429
+ var $;
430
+ (function ($) {
431
+ class $mol_wire_pub_sub extends $mol_wire_pub {
432
+ pub_from = 0;
433
+ cursor = $mol_wire_cursor.stale;
434
+ get pub_list() {
435
+ const res = [];
436
+ const max = this.cursor >= 0 ? this.cursor : this.sub_from;
437
+ for (let i = this.pub_from; i < max; i += 2) {
438
+ if (this.data[i])
439
+ res.push(this.data[i]);
440
+ }
441
+ return res;
368
442
  }
369
- static fromString(str, baseUri) {
370
- var root = new $mol_tree({ baseUri: baseUri });
371
- var stack = [root];
372
- var row = 0;
373
- var prefix = str.replace(/^\n?(\t*)[\s\S]*/, '$1');
374
- var lines = str.replace(new RegExp('^\\t{0,' + prefix.length + '}', 'mg'), '').split('\n');
375
- lines.forEach(line => {
376
- ++row;
377
- var chunks = /^(\t*)((?:[^\n\t\\ ]+ *)*)(\\[^\n]*)?(.*?)(?:$|\n)/m.exec(line);
378
- if (!chunks || chunks[4])
379
- return this.$.$mol_fail(new Error(`Syntax error at ${baseUri}:${row}\n${line}`));
380
- var indent = chunks[1];
381
- var path = chunks[2];
382
- var data = chunks[3];
383
- var deep = indent.length;
384
- var types = path ? path.replace(/ $/, '').split(/ +/) : [];
385
- if (stack.length <= deep)
386
- return this.$.$mol_fail(new Error(`Too many tabs at ${baseUri}:${row}\n${line}`));
387
- stack.length = deep + 1;
388
- var parent = stack[deep];
389
- let col = deep;
390
- types.forEach(type => {
391
- if (!type)
392
- return this.$.$mol_fail(new Error(`Unexpected space symbol ${baseUri}:${row}\n${line}`));
393
- var next = new $mol_tree({ type, baseUri, row, col, length: type.length });
394
- const parent_sub = parent.sub;
395
- parent_sub.push(next);
396
- parent = next;
397
- col += type.length + 1;
398
- });
399
- if (data) {
400
- var next = new $mol_tree({ data: data.substring(1), baseUri, row, col, length: data.length });
401
- const parent_sub = parent.sub;
402
- parent_sub.push(next);
403
- parent = next;
404
- }
405
- stack.push(parent);
406
- });
407
- return root;
443
+ track_on() {
444
+ this.cursor = this.pub_from;
445
+ const sub = $mol_wire_auto();
446
+ $mol_wire_auto(this);
447
+ return sub;
408
448
  }
409
- static fromJSON(json, baseUri = '') {
410
- switch (true) {
411
- case typeof json === 'boolean':
412
- case typeof json === 'number':
413
- case json === null:
414
- return new $mol_tree({
415
- type: String(json),
416
- baseUri: baseUri
417
- });
418
- case typeof json === 'string':
419
- return new $mol_tree({
420
- value: json,
421
- baseUri: baseUri
422
- });
423
- case Array.isArray(json):
424
- return new $mol_tree({
425
- type: "/",
426
- sub: json.map(json => $mol_tree.fromJSON(json, baseUri))
427
- });
428
- case json instanceof Date:
429
- return new $mol_tree({
430
- value: json.toISOString(),
431
- baseUri: baseUri
432
- });
433
- default:
434
- if (typeof json[$.$mol_tree_convert] === 'function') {
435
- return json[$.$mol_tree_convert]();
436
- }
437
- if (typeof json.toJSON === 'function') {
438
- return $mol_tree.fromJSON(json.toJSON());
439
- }
440
- if (json instanceof Error) {
441
- const { name, message, stack } = json;
442
- json = { ...json, name, message, stack };
443
- }
444
- var sub = [];
445
- for (var key in json) {
446
- if (json[key] === undefined)
447
- continue;
448
- const subsub = $mol_tree.fromJSON(json[key], baseUri);
449
- if (/^[^\n\t\\ ]+$/.test(key)) {
450
- var child = new $mol_tree({
451
- type: key,
452
- baseUri: baseUri,
453
- sub: [subsub],
454
- });
455
- }
456
- else {
457
- var child = new $mol_tree({
458
- value: key,
459
- baseUri: baseUri,
460
- sub: [subsub],
461
- });
462
- }
463
- sub.push(child);
464
- }
465
- return new $mol_tree({
466
- type: "*",
467
- sub: sub,
468
- baseUri: baseUri
469
- });
449
+ promote() {
450
+ if (this.cursor >= this.pub_from) {
451
+ $mol_fail(new Error('Circular subscription'));
470
452
  }
453
+ super.promote();
471
454
  }
472
- get uri() {
473
- return this.baseUri + '#' + this.row + ':' + this.col;
474
- }
475
- toString(prefix = '') {
476
- var output = '';
477
- if (this.type.length) {
478
- if (!prefix.length) {
479
- prefix = "\t";
455
+ track_next(pub) {
456
+ if (this.cursor < 0)
457
+ $mol_fail(new Error('Promo to non begun sub'));
458
+ if (this.cursor < this.sub_from) {
459
+ const next = this.data[this.cursor];
460
+ if (pub === undefined)
461
+ return next ?? null;
462
+ if (next === pub) {
463
+ this.cursor += 2;
464
+ return next;
480
465
  }
481
- output += this.type;
482
- if (this.sub.length == 1) {
483
- return output + ' ' + this.sub[0].toString(prefix);
466
+ if (next) {
467
+ if (this.sub_from < this.data.length) {
468
+ this.peer_move(this.sub_from, this.data.length);
469
+ }
470
+ this.peer_move(this.cursor, this.sub_from);
471
+ this.sub_from += 2;
484
472
  }
485
- output += "\n";
486
- }
487
- else if (this.data.length || prefix.length) {
488
- output += "\\" + this.data + "\n";
489
- }
490
- for (var child of this.sub) {
491
- output += prefix;
492
- output += child.toString(prefix + "\t");
493
473
  }
494
- return output;
495
- }
496
- toJSON() {
497
- if (!this.type)
498
- return this.value;
499
- if (this.type === 'true')
500
- return true;
501
- if (this.type === 'false')
502
- return false;
503
- if (this.type === 'null')
504
- return null;
505
- if (this.type === '*') {
506
- var obj = {};
507
- for (var child of this.sub) {
508
- if (child.type === '-')
509
- continue;
510
- var key = child.type || child.clone({ sub: child.sub.slice(0, child.sub.length - 1) }).value;
511
- var val = child.sub[child.sub.length - 1].toJSON();
512
- if (val !== undefined)
513
- obj[key] = val;
474
+ else {
475
+ if (pub === undefined)
476
+ return null;
477
+ if (this.sub_from < this.data.length) {
478
+ this.peer_move(this.sub_from, this.data.length);
514
479
  }
515
- return obj;
516
- }
517
- if (this.type === '/') {
518
- var res = [];
519
- this.sub.forEach(child => {
520
- if (child.type === '-')
521
- return;
522
- var val = child.toJSON();
523
- if (val !== undefined)
524
- res.push(val);
525
- });
526
- return res;
527
- }
528
- if (this.type === 'time') {
529
- return new Date(this.value);
530
- }
531
- const numb = Number(this.type);
532
- if (!Number.isNaN(numb) || this.type === 'NaN')
533
- return numb;
534
- throw new Error(`Unknown type (${this.type}) at ${this.uri}`);
535
- }
536
- get value() {
537
- var values = [];
538
- for (var child of this.sub) {
539
- if (child.type)
540
- continue;
541
- values.push(child.value);
480
+ this.sub_from += 2;
542
481
  }
543
- return this.data + values.join("\n");
482
+ this.data[this.cursor] = pub;
483
+ this.data[this.cursor + 1] = pub.sub_on(this, this.cursor);
484
+ this.cursor += 2;
485
+ return pub;
544
486
  }
545
- insert(value, ...path) {
546
- if (path.length === 0)
547
- return value;
548
- const type = path[0];
549
- if (typeof type === 'string') {
550
- let replaced = false;
551
- const sub = this.sub.map((item, index) => {
552
- if (item.type !== type)
553
- return item;
554
- replaced = true;
555
- return item.insert(value, ...path.slice(1));
556
- });
557
- if (!replaced)
558
- sub.push(new $mol_tree({ type }).insert(value, ...path.slice(1)));
559
- return this.clone({ sub });
560
- }
561
- else if (typeof type === 'number') {
562
- const sub = this.sub.slice();
563
- sub[type] = (sub[type] || new $mol_tree).insert(value, ...path.slice(1));
564
- return this.clone({ sub });
565
- }
566
- else {
567
- return this.clone({ sub: ((this.sub.length === 0) ? [new $mol_tree()] : this.sub).map(item => item.insert(value, ...path.slice(1))) });
487
+ track_off(sub) {
488
+ $mol_wire_auto(sub);
489
+ if (this.cursor < 0) {
490
+ $mol_fail(new Error('End of non begun sub'));
568
491
  }
569
- }
570
- select(...path) {
571
- var next = [this];
572
- for (var type of path) {
573
- if (!next.length)
574
- break;
575
- var prev = next;
576
- next = [];
577
- for (var item of prev) {
578
- switch (typeof (type)) {
579
- case 'string':
580
- for (var child of item.sub) {
581
- if (!type || (child.type == type)) {
582
- next.push(child);
583
- }
584
- }
585
- break;
586
- case 'number':
587
- if (type < item.sub.length)
588
- next.push(item.sub[type]);
589
- break;
590
- default: next.push(...item.sub);
591
- }
592
- }
492
+ for (let cursor = this.pub_from; cursor < this.cursor; cursor += 2) {
493
+ const pub = this.data[cursor];
494
+ pub.fresh();
593
495
  }
594
- return new $mol_tree({ sub: next });
595
- }
596
- filter(path, value) {
597
- var sub = this.sub.filter(function (item) {
598
- var found = item.select(...path);
599
- if (value == null) {
600
- return Boolean(found.sub.length);
601
- }
602
- else {
603
- return found.sub.some(child => child.value == value);
604
- }
605
- });
606
- return new $mol_tree({ sub: sub });
607
- }
608
- transform(visit, stack = []) {
609
- const sub_stack = [this, ...stack];
610
- return visit(sub_stack, () => this.sub.map(node => node.transform(visit, sub_stack)).filter(n => n));
496
+ this.cursor = $mol_wire_cursor.fresh;
611
497
  }
612
- hack(context) {
613
- const sub = [].concat(...this.sub.map(child => {
614
- const handle = context[child.type] || context[''];
615
- if (!handle)
616
- $mol_fail(child.error('Handler not defined'));
617
- return handle(child, context);
618
- }));
619
- return this.clone({ sub });
498
+ pub_off(sub_pos) {
499
+ this.data[sub_pos] = undefined;
500
+ this.data[sub_pos + 1] = undefined;
620
501
  }
621
- error(message) {
622
- return new Error(`${message}:\n${this} ${this.baseUri}:${this.row}:${this.col}`);
502
+ destructor() {
503
+ for (let cursor = this.data.length - 2; cursor >= this.sub_from; cursor -= 2) {
504
+ const sub = this.data[cursor];
505
+ const pos = this.data[cursor + 1];
506
+ sub.pub_off(pos);
507
+ this.data.pop();
508
+ this.data.pop();
509
+ }
510
+ this.cursor = this.pub_from;
511
+ this.track_cut();
512
+ this.cursor = $mol_wire_cursor.final;
623
513
  }
624
- }
625
- $.$mol_tree = $mol_tree;
626
- })($ || ($ = {}));
627
- //mol/tree/tree.ts
628
- ;
629
- "use strict";
630
- var $;
631
- (function ($) {
632
- class $mol_term_color {
633
- static reset = this.ansi(0, 0);
634
- static bold = this.ansi(1, 22);
635
- static italic = this.ansi(3, 23);
636
- static underline = this.ansi(4, 24);
637
- static inverse = this.ansi(7, 27);
638
- static hidden = this.ansi(8, 28);
639
- static strike = this.ansi(9, 29);
640
- static gray = this.ansi(90, 39);
641
- static red = this.ansi(91, 39);
642
- static green = this.ansi(92, 39);
643
- static yellow = this.ansi(93, 39);
644
- static blue = this.ansi(94, 39);
645
- static magenta = this.ansi(95, 39);
646
- static cyan = this.ansi(96, 39);
647
- static Gray = (str) => this.inverse(this.gray(str));
648
- static Red = (str) => this.inverse(this.red(str));
649
- static Green = (str) => this.inverse(this.green(str));
650
- static Yellow = (str) => this.inverse(this.yellow(str));
651
- static Blue = (str) => this.inverse(this.blue(str));
652
- static Magenta = (str) => this.inverse(this.magenta(str));
653
- static Cyan = (str) => this.inverse(this.cyan(str));
654
- static ansi(open, close) {
655
- if (typeof process === 'undefined')
656
- return String;
657
- if (!process.stdout.isTTY)
658
- return String;
659
- const prefix = `\x1b[${open}m`;
660
- const postfix = `\x1b[${close}m`;
661
- const suffix_regexp = new RegExp(postfix.replace('[', '\\['), 'g');
662
- return function colorer(str) {
663
- str = String(str);
664
- if (str === '')
665
- return str;
666
- const suffix = str.replace(suffix_regexp, prefix);
667
- return prefix + suffix + postfix;
668
- };
514
+ track_cut() {
515
+ if (this.cursor < this.pub_from) {
516
+ $mol_fail(new Error('Cut of non begun sub'));
517
+ }
518
+ let tail = 0;
519
+ for (let cursor = this.cursor; cursor < this.sub_from; cursor += 2) {
520
+ const pub = this.data[cursor];
521
+ pub?.sub_off(this.data[cursor + 1]);
522
+ if (this.sub_from < this.data.length) {
523
+ this.peer_move(this.data.length - 2, cursor);
524
+ this.data.pop();
525
+ this.data.pop();
526
+ }
527
+ else {
528
+ ++tail;
529
+ }
530
+ }
531
+ for (; tail; --tail) {
532
+ this.data.pop();
533
+ this.data.pop();
534
+ }
535
+ this.sub_from = this.cursor;
536
+ }
537
+ complete() { }
538
+ complete_pubs() {
539
+ const limit = this.cursor < 0 ? this.sub_from : this.cursor;
540
+ for (let cursor = this.pub_from; cursor < limit; cursor += 2) {
541
+ const pub = this.data[cursor];
542
+ pub?.complete();
543
+ }
544
+ }
545
+ absorb(quant = $mol_wire_cursor.stale) {
546
+ if (this.cursor === $mol_wire_cursor.final)
547
+ return;
548
+ if (this.cursor >= quant)
549
+ return;
550
+ this.cursor = quant;
551
+ this.emit($mol_wire_cursor.doubt);
552
+ }
553
+ [$mol_dev_format_head]() {
554
+ return $mol_dev_format_native(this);
555
+ }
556
+ get pub_empty() {
557
+ return this.sub_from === this.pub_from;
669
558
  }
670
559
  }
671
- $.$mol_term_color = $mol_term_color;
672
- })($ || ($ = {}));
673
- //mol/term/color/color.ts
674
- ;
675
- "use strict";
676
- var $;
677
- (function ($) {
678
- function $mol_log3_node_make(level, output, type, color) {
679
- return function $mol_log3_logger(event) {
680
- if (!event.time)
681
- event = { time: new Date().toISOString(), ...event };
682
- const tree = this.$mol_tree.fromJSON(event).clone({ type });
683
- let str = color(tree.toString());
684
- this.console[level](str);
685
- const self = this;
686
- return () => self.console.groupEnd();
687
- };
688
- }
689
- $.$mol_log3_node_make = $mol_log3_node_make;
690
- $.$mol_log3_come = $mol_log3_node_make('info', 'stdout', 'come', $mol_term_color.blue);
691
- $.$mol_log3_done = $mol_log3_node_make('info', 'stdout', 'done', $mol_term_color.green);
692
- $.$mol_log3_fail = $mol_log3_node_make('error', 'stderr', 'fail', $mol_term_color.red);
693
- $.$mol_log3_warn = $mol_log3_node_make('warn', 'stderr', 'warn', $mol_term_color.yellow);
694
- $.$mol_log3_rise = $mol_log3_node_make('log', 'stdout', 'rise', $mol_term_color.magenta);
695
- $.$mol_log3_area = $mol_log3_node_make('log', 'stdout', 'area', $mol_term_color.cyan);
696
- })($ || ($ = {}));
697
- //mol/log3/log3.node.ts
698
- ;
699
- "use strict";
700
- var $;
701
- (function ($) {
702
- function $mol_env() {
703
- return {};
704
- }
705
- $.$mol_env = $mol_env;
706
- })($ || ($ = {}));
707
- //mol/env/env.ts
708
- ;
709
- "use strict";
710
- var $;
711
- (function ($) {
712
- $.$mol_env = function $mol_env() {
713
- return this.process.env;
714
- };
560
+ $.$mol_wire_pub_sub = $mol_wire_pub_sub;
715
561
  })($ || ($ = {}));
716
- //mol/env/env.node.ts
562
+ //mol/wire/pub/sub/sub.ts
717
563
  ;
718
564
  "use strict";
719
565
  var $;
720
566
  (function ($) {
721
- function $mol_exec(dir, command, ...args) {
722
- let [app, ...args0] = command.split(' ');
723
- args = [...args0, ...args];
724
- this.$mol_log3_come({
725
- place: '$mol_exec',
726
- dir: $node.path.relative('', dir),
727
- message: 'Run',
728
- command: `${app} ${args.join(' ')}`,
729
- });
730
- var res = $node['child_process'].spawnSync(app, args, {
731
- cwd: $node.path.resolve(dir),
732
- shell: true,
733
- env: this.$mol_env(),
734
- });
735
- if (res.status || res.error)
736
- return $mol_fail(res.error || new Error(res.stderr.toString()));
737
- if (!res.stdout)
738
- res.stdout = Buffer.from([]);
739
- return res;
567
+ class $mol_after_timeout extends $mol_object2 {
568
+ delay;
569
+ task;
570
+ id;
571
+ constructor(delay, task) {
572
+ super();
573
+ this.delay = delay;
574
+ this.task = task;
575
+ this.id = setTimeout(task, delay);
576
+ }
577
+ destructor() {
578
+ clearTimeout(this.id);
579
+ }
740
580
  }
741
- $.$mol_exec = $mol_exec;
742
- })($ || ($ = {}));
743
- //mol/exec/exec.node.ts
744
- ;
745
- "use strict";
746
- var $;
747
- (function ($) {
748
- $.$mol_dom_context = new $node.jsdom.JSDOM('', { url: 'https://localhost/' }).window;
581
+ $.$mol_after_timeout = $mol_after_timeout;
749
582
  })($ || ($ = {}));
750
- //mol/dom/context/context.node.ts
583
+ //mol/after/timeout/timeout.ts
751
584
  ;
752
585
  "use strict";
753
586
  var $;
754
587
  (function ($) {
755
- let all = [];
756
- let el = null;
757
- let timer = null;
758
- function $mol_style_attach(id, text) {
759
- all.push(`/* ${id} */\n\n${text}`);
760
- if (timer)
761
- return el;
762
- const doc = $mol_dom_context.document;
763
- if (!doc)
764
- return null;
765
- el = doc.createElement('style');
766
- el.id = `$mol_style_attach`;
767
- doc.head.appendChild(el);
768
- timer = new $mol_after_tick(() => {
769
- el.innerHTML = '\n' + all.join('\n\n');
770
- all = [];
771
- el = null;
772
- timer = null;
773
- });
774
- return el;
588
+ class $mol_after_frame extends $mol_after_timeout {
589
+ task;
590
+ constructor(task) {
591
+ super(16, task);
592
+ this.task = task;
593
+ }
775
594
  }
776
- $.$mol_style_attach = $mol_style_attach;
595
+ $.$mol_after_frame = $mol_after_frame;
777
596
  })($ || ($ = {}));
778
- //mol/style/attach/attach.ts
597
+ //mol/after/frame/frame.node.ts
779
598
  ;
780
599
  "use strict";
781
600
  var $;
782
601
  (function ($) {
783
- class $mol_decor {
784
- value;
785
- constructor(value) {
786
- this.value = value;
602
+ const handled = new WeakSet();
603
+ class $mol_wire_fiber extends $mol_wire_pub_sub {
604
+ task;
605
+ host;
606
+ static warm = true;
607
+ static planning = new Set();
608
+ static reaping = new Set();
609
+ static plan_task = null;
610
+ static plan() {
611
+ if (this.plan_task)
612
+ return;
613
+ this.plan_task = new $mol_after_frame(() => {
614
+ try {
615
+ this.sync();
616
+ }
617
+ finally {
618
+ $mol_wire_fiber.plan_task = null;
619
+ }
620
+ });
787
621
  }
788
- prefix() { return ''; }
789
- valueOf() { return this.value; }
790
- postfix() { return ''; }
791
- toString() {
792
- return `${this.prefix()}${this.valueOf()}${this.postfix()}`;
622
+ static sync() {
623
+ while (this.planning.size) {
624
+ for (const fiber of this.planning) {
625
+ this.planning.delete(fiber);
626
+ if (fiber.cursor >= 0)
627
+ continue;
628
+ if (fiber.cursor === $mol_wire_cursor.final)
629
+ continue;
630
+ fiber.fresh();
631
+ }
632
+ }
633
+ while (this.reaping.size) {
634
+ const fibers = this.reaping;
635
+ this.reaping = new Set;
636
+ for (const fiber of fibers) {
637
+ if (!fiber.sub_empty)
638
+ continue;
639
+ fiber.destructor();
640
+ }
641
+ }
793
642
  }
794
- }
795
- $.$mol_decor = $mol_decor;
796
- })($ || ($ = {}));
797
- //mol/decor/decor.ts
798
- ;
799
- "use strict";
800
- var $;
801
- (function ($) {
802
- class $mol_style_unit extends $mol_decor {
803
- literal;
804
- constructor(value, literal) {
805
- super(value);
806
- this.literal = literal;
643
+ cache = undefined;
644
+ get args() {
645
+ return this.data.slice(0, this.pub_from);
807
646
  }
808
- postfix() {
809
- return this.literal;
647
+ result() {
648
+ if (this.cache instanceof Promise)
649
+ return;
650
+ if (this.cache instanceof Error)
651
+ return;
652
+ return this.cache;
653
+ }
654
+ field() {
655
+ return this.task.name + '()';
656
+ }
657
+ constructor(id, task, host, args) {
658
+ super();
659
+ this.task = task;
660
+ this.host = host;
661
+ if (args)
662
+ this.data.push(...args);
663
+ this.pub_from = this.sub_from = args?.length ?? 0;
664
+ this[Symbol.toStringTag] = id;
665
+ }
666
+ plan() {
667
+ $mol_wire_fiber.planning.add(this);
668
+ $mol_wire_fiber.plan();
669
+ }
670
+ reap() {
671
+ $mol_wire_fiber.reaping.add(this);
672
+ $mol_wire_fiber.plan();
673
+ }
674
+ toString() {
675
+ return this[Symbol.toStringTag];
810
676
  }
811
- static per(value) { return new $mol_style_unit(value, '%'); }
812
- static px(value) { return new $mol_style_unit(value, 'px'); }
813
- static mm(value) { return new $mol_style_unit(value, 'mm'); }
814
- static cm(value) { return new $mol_style_unit(value, 'cm'); }
815
- static Q(value) { return new $mol_style_unit(value, 'Q'); }
816
- static in(value) { return new $mol_style_unit(value, 'in'); }
817
- static pc(value) { return new $mol_style_unit(value, 'pc'); }
818
- static pt(value) { return new $mol_style_unit(value, 'pt'); }
819
- static cap(value) { return new $mol_style_unit(value, 'cap'); }
820
- static ch(value) { return new $mol_style_unit(value, 'ch'); }
821
- static em(value) { return new $mol_style_unit(value, 'em'); }
822
- static rem(value) { return new $mol_style_unit(value, 'rem'); }
823
- static ex(value) { return new $mol_style_unit(value, 'ex'); }
824
- static ic(value) { return new $mol_style_unit(value, 'ic'); }
825
- static lh(value) { return new $mol_style_unit(value, 'lh'); }
826
- static rlh(value) { return new $mol_style_unit(value, 'rlh'); }
827
- static vh(value) { return new $mol_style_unit(value, 'vh'); }
828
- static vw(value) { return new $mol_style_unit(value, 'vw'); }
829
- static vi(value) { return new $mol_style_unit(value, 'vi'); }
830
- static vb(value) { return new $mol_style_unit(value, 'vb'); }
831
- static vmin(value) { return new $mol_style_unit(value, 'vmin'); }
832
- static vmax(value) { return new $mol_style_unit(value, 'vmax'); }
833
- static deg(value) { return new $mol_style_unit(value, 'deg'); }
834
- static rad(value) { return new $mol_style_unit(value, 'rad'); }
835
- static grad(value) { return new $mol_style_unit(value, 'grad'); }
836
- static turn(value) { return new $mol_style_unit(value, 'turn'); }
837
- static s(value) { return new $mol_style_unit(value, 's'); }
838
- static ms(value) { return new $mol_style_unit(value, 'ms'); }
839
- }
840
- $.$mol_style_unit = $mol_style_unit;
841
- })($ || ($ = {}));
842
- //mol/style/unit/unit.ts
843
- ;
844
- "use strict";
845
- var $;
846
- (function ($) {
847
- const { per } = $mol_style_unit;
848
- class $mol_style_func extends $mol_decor {
849
- name;
850
- constructor(name, value) {
851
- super(value);
852
- this.name = name;
677
+ toJSON() {
678
+ return this[Symbol.toStringTag];
853
679
  }
854
- prefix() { return this.name + '('; }
855
- postfix() { return ')'; }
856
- static calc(value) {
857
- return new $mol_style_func('calc', value);
680
+ [$mol_dev_format_head]() {
681
+ const cursor = {
682
+ [$mol_wire_cursor.stale]: '🔴',
683
+ [$mol_wire_cursor.doubt]: '🟡',
684
+ [$mol_wire_cursor.fresh]: '🟢',
685
+ [$mol_wire_cursor.final]: '🔵',
686
+ }[this.cursor] ?? this.cursor.toString();
687
+ return $mol_dev_format_div({}, $mol_dev_format_native(this), $mol_dev_format_shade(cursor + ' '), $mol_dev_format_auto(this.cache));
858
688
  }
859
- static vary(name) {
860
- return new $mol_style_func('var', name);
689
+ get $() {
690
+ return (this.host ?? this.task)['$'];
861
691
  }
862
- static url(href) {
863
- return new $mol_style_func('url', JSON.stringify(href));
692
+ emit(quant = $mol_wire_cursor.stale) {
693
+ if (this.sub_empty)
694
+ this.plan();
695
+ else
696
+ super.emit(quant);
864
697
  }
865
- static hsla(hue, saturation, lightness, alpha) {
866
- return new $mol_style_func('hsla', [hue, per(saturation), per(lightness), alpha]);
698
+ fresh() {
699
+ if (this.cursor === $mol_wire_cursor.fresh)
700
+ return;
701
+ if (this.cursor === $mol_wire_cursor.final)
702
+ return;
703
+ check: if (this.cursor === $mol_wire_cursor.doubt) {
704
+ for (let i = this.pub_from; i < this.sub_from; i += 2) {
705
+ ;
706
+ this.data[i]?.fresh();
707
+ if (this.cursor !== $mol_wire_cursor.doubt)
708
+ break check;
709
+ }
710
+ this.cursor = $mol_wire_cursor.fresh;
711
+ return;
712
+ }
713
+ const bu = this.track_on();
714
+ let result;
715
+ try {
716
+ switch (this.pub_from) {
717
+ case 0:
718
+ result = this.task.call(this.host);
719
+ break;
720
+ case 1:
721
+ result = this.task.call(this.host, this.data[0]);
722
+ break;
723
+ default:
724
+ result = this.task.call(this.host, ...this.args);
725
+ break;
726
+ }
727
+ if (result instanceof Promise) {
728
+ const put = (res) => {
729
+ if (this.cache === result)
730
+ this.put(res);
731
+ return res;
732
+ };
733
+ result = Object.assign(result.then(put, put), {
734
+ destructor: result['destructor'] ?? (() => { })
735
+ });
736
+ handled.add(result);
737
+ }
738
+ }
739
+ catch (error) {
740
+ if (error instanceof Error || error instanceof Promise) {
741
+ result = error;
742
+ }
743
+ else {
744
+ result = new Error(String(error), { cause: error });
745
+ }
746
+ if (result instanceof Promise && !handled.has(result)) {
747
+ result = Object.assign(result.finally(() => {
748
+ if (this.cache === result)
749
+ this.absorb();
750
+ }), {
751
+ destructor: result['destructor'] ?? (() => { })
752
+ });
753
+ handled.add(result);
754
+ }
755
+ }
756
+ if (!(result instanceof Promise)) {
757
+ this.track_cut();
758
+ }
759
+ this.track_off(bu);
760
+ this.put(result);
867
761
  }
868
- static clamp(min, mid, max) {
869
- return new $mol_style_func('clamp', [min, mid, max]);
762
+ refresh() {
763
+ this.cursor = $mol_wire_cursor.stale;
764
+ this.fresh();
870
765
  }
871
- static rgba(red, green, blue, alpha) {
872
- return new $mol_style_func('rgba', [red, green, blue, alpha]);
766
+ sync() {
767
+ if (!$mol_wire_fiber.warm) {
768
+ return this.result();
769
+ }
770
+ this.promote();
771
+ this.fresh();
772
+ if (this.cache instanceof Error) {
773
+ return $mol_fail_hidden(this.cache);
774
+ }
775
+ if (this.cache instanceof Promise) {
776
+ return $mol_fail_hidden(this.cache);
777
+ }
778
+ return this.cache;
873
779
  }
874
- static scale(zoom) {
875
- return new $mol_style_func('scale', [zoom]);
780
+ async async() {
781
+ while (true) {
782
+ this.fresh();
783
+ if (this.cache instanceof Error) {
784
+ $mol_fail_hidden(this.cache);
785
+ }
786
+ if (!(this.cache instanceof Promise))
787
+ return this.cache;
788
+ await this.cache;
789
+ if (this.cursor === $mol_wire_cursor.final) {
790
+ await new Promise(() => { });
791
+ }
792
+ }
876
793
  }
877
794
  }
878
- $.$mol_style_func = $mol_style_func;
879
- })($ || ($ = {}));
880
- //mol/style/func/func.ts
881
- ;
882
- "use strict";
883
- var $;
884
- (function ($) {
885
- $mol_style_attach("mol/theme/theme.css", ":root {\n\t--mol_theme_hue: 210deg;\n\t--mol_theme_luma: -1;\n\t--mol_theme_satur: 1;\n\t--mol_theme_image: none;\n}\n\n[mol_theme] {\n\tcolor: var(--mol_theme_text);\n\tfill: var(--mol_theme_text);\n}\n:where([mol_theme]) {\n\tbackground-color: var(--mol_theme_back);\n}\n\t\n:root, [mol_theme] {\n\t--mol_theme_back: hsl( var(--mol_theme_hue), calc( var(--mol_theme_satur) * 20% ), calc( 55% + 45% * var(--mol_theme_luma) ) );\n\t--mol_theme_text: hsl( var(--mol_theme_hue), 0%, calc( 40% - 40% * var(--mol_theme_luma) ) );\n\t--mol_theme_field: hsl( var(--mol_theme_hue), calc( var(--mol_theme_satur) * 50% ), calc( 54% + 46% * var(--mol_theme_luma) ), .25 );\n\t\n\t--mol_theme_card: hsl( var(--mol_theme_hue), calc( var(--mol_theme_satur) * 50% ), calc( 55% + 35% * var(--mol_theme_luma) ), .25 );\n\t--mol_theme_hover: hsl( var(--mol_theme_hue), 0%, 50%, .1 );\n\t--mol_theme_line: hsl( var(--mol_theme_hue), 0%, 50%, .2 );\n\t--mol_theme_shade: hsl( var(--mol_theme_hue), 0%, 50%, 1 );\n\t\n\t--mol_theme_control: hsl( var(--mol_theme_hue), 50%, calc( 50% - 10% * var(--mol_theme_luma) ) );\n\t--mol_theme_current: hsl( calc( var(--mol_theme_hue) - 90deg ), 50%, calc( 50% - 10% * var(--mol_theme_luma) ) );\n\t--mol_theme_special: hsl( calc( var(--mol_theme_hue) + 90deg ), 50%, calc( 50% - 10% * var(--mol_theme_luma) ) );\n\t--mol_theme_focus: hsl( calc( var(--mol_theme_hue) + 180deg ), 100%, calc( 55% - 10% * var(--mol_theme_luma) ) );\n\t\n}\n\n[mol_theme=\"$mol_theme_light\"] {\n\t--mol_theme_luma: 1;\n\t--mol_theme_image: none;\n}\n\n[mol_theme=\"$mol_theme_dark\"] {\n\t--mol_theme_luma: -1;\n\t--mol_theme_image: invert(1) hue-rotate( 180deg );\n}\n\n[mol_theme=\"$mol_theme_base\"] {\n\t--mol_theme_luma: -2;\n\t--mol_theme_back: hsl( var(--mol_theme_hue), 50%, 40% );\n\t--mol_theme_hover: hsl( var(--mol_theme_hue), 60%, 30% );\n\t--mol_theme_current: hsl( var(--mol_theme_hue), 100%, 20% );\n}\n\n[mol_theme=\"$mol_theme_current\"] {\n\tbackground-color: var(--mol_theme_back);\n\t--mol_theme_back: hsl( calc( var(--mol_theme_hue) - 90deg ), 50%, calc( 50% + 30% * var(--mol_theme_luma) ) );\n}\n\n[mol_theme=\"$mol_theme_special\"] {\n\t--mol_theme_card: hsl( calc( var(--mol_theme_hue) + 90deg ), 50%, calc( 55% + 35% * var(--mol_theme_luma) ), .25 );\n}\n\n[mol_theme=\"$mol_theme_accent\"] {\n\tbackground-color: var(--mol_theme_back);\n\t--mol_theme_luma: -2;\n\t--mol_theme_back: hsl( calc( var(--mol_theme_hue) + 180deg ), 90%, 50% );\n\t--mol_theme_hover: hsl( calc( var(--mol_theme_hue) + 180deg ), 80%, 35% );\n}\n\n[mol_theme=\"$mol_theme_accent\"] [mol_theme=\"$mol_theme_accent\"] {\n\t--mol_theme_back: black;\n}\n");
886
- })($ || ($ = {}));
887
- //mol/theme/-css/theme.css.ts
888
- ;
889
- "use strict";
890
- var $;
891
- (function ($) {
892
- const { vary } = $mol_style_func;
893
- $.$mol_theme = {
894
- back: vary('--mol_theme_back'),
895
- hover: vary('--mol_theme_hover'),
896
- card: vary('--mol_theme_card'),
897
- current: vary('--mol_theme_current'),
898
- special: vary('--mol_theme_special'),
899
- text: vary('--mol_theme_text'),
900
- control: vary('--mol_theme_control'),
901
- shade: vary('--mol_theme_shade'),
902
- line: vary('--mol_theme_line'),
903
- focus: vary('--mol_theme_focus'),
904
- field: vary('--mol_theme_field'),
905
- image: vary('--mol_theme_image'),
906
- };
907
- })($ || ($ = {}));
908
- //mol/theme/theme.ts
909
- ;
910
- "use strict";
911
- var $;
912
- (function ($) {
913
- $mol_style_attach("mol/gap/gap.css", ":root {\n\t--mol_gap_block: .75rem;\n\t--mol_gap_text: .5rem .75rem;\n\t--mol_gap_round: .25rem;\n\t--mol_gap_space: .25rem;\n\t--mol_gap_blur: .5rem;\n}\n");
795
+ $.$mol_wire_fiber = $mol_wire_fiber;
914
796
  })($ || ($ = {}));
915
- //mol/gap/-css/gap.css.ts
797
+ //mol/wire/fiber/fiber.ts
916
798
  ;
917
799
  "use strict";
918
800
  var $;
919
801
  (function ($) {
920
- const { vary } = $mol_style_func;
921
- $.$mol_gap = {
922
- block: vary('--mol_gap_block'),
923
- text: vary('--mol_gap_text'),
924
- round: vary('--mol_gap_round'),
925
- space: vary('--mol_gap_space'),
926
- blur: vary('--mol_gap_blur'),
927
- };
928
- })($ || ($ = {}));
929
- //mol/gap/gap.ts
930
- ;
931
- "use strict";
932
- var $;
933
- (function ($_1) {
934
- let $$;
935
- (function ($$) {
936
- let $;
937
- })($$ = $_1.$$ || ($_1.$$ = {}));
938
- $_1.$mol_object_field = Symbol('$mol_object_field');
939
- class $mol_object extends $mol_object2 {
940
- static make(config) {
941
- return super.create(obj => {
942
- for (let key in config)
943
- obj[key] = config[key];
944
- });
802
+ const named = new WeakSet();
803
+ function $mol_func_name(func) {
804
+ let name = func.name;
805
+ if (name?.length > 1)
806
+ return name;
807
+ if (named.has(func))
808
+ return name;
809
+ for (let key in this) {
810
+ try {
811
+ if (this[key] !== func)
812
+ continue;
813
+ name = key;
814
+ Object.defineProperty(func, 'name', { value: name });
815
+ break;
816
+ }
817
+ catch { }
945
818
  }
819
+ named.add(func);
820
+ return name;
946
821
  }
947
- $_1.$mol_object = $mol_object;
822
+ $.$mol_func_name = $mol_func_name;
823
+ function $mol_func_name_from(target, source) {
824
+ Object.defineProperty(target, 'name', { value: source.name });
825
+ return target;
826
+ }
827
+ $.$mol_func_name_from = $mol_func_name_from;
948
828
  })($ || ($ = {}));
949
- //mol/object/object.ts
829
+ //mol/func/name/name.ts
950
830
  ;
951
831
  "use strict";
952
832
  var $;
953
833
  (function ($) {
954
- class $mol_window extends $mol_object {
955
- static size() {
956
- return {
957
- width: 1024,
958
- height: 768,
959
- };
834
+ function $mol_guid(length = 8, exists = () => false) {
835
+ for (;;) {
836
+ let id = Math.random().toString(36).substring(2, length + 2).toUpperCase();
837
+ if (exists(id))
838
+ continue;
839
+ return id;
960
840
  }
961
841
  }
962
- $.$mol_window = $mol_window;
842
+ $.$mol_guid = $mol_guid;
963
843
  })($ || ($ = {}));
964
- //mol/window/window.node.ts
844
+ //mol/guid/guid.ts
965
845
  ;
966
846
  "use strict";
967
847
  var $;
968
848
  (function ($) {
969
- let $mol_wire_cursor;
970
- (function ($mol_wire_cursor) {
971
- $mol_wire_cursor[$mol_wire_cursor["stale"] = -1] = "stale";
972
- $mol_wire_cursor[$mol_wire_cursor["doubt"] = -2] = "doubt";
973
- $mol_wire_cursor[$mol_wire_cursor["fresh"] = -3] = "fresh";
974
- $mol_wire_cursor[$mol_wire_cursor["final"] = -4] = "final";
975
- })($mol_wire_cursor = $.$mol_wire_cursor || ($.$mol_wire_cursor = {}));
849
+ $.$mol_key_store = new WeakMap();
850
+ function $mol_key(value) {
851
+ if (!value)
852
+ return JSON.stringify(value);
853
+ if (typeof value !== 'object' && typeof value !== 'function')
854
+ return JSON.stringify(value);
855
+ return JSON.stringify(value, (field, value) => {
856
+ if (!value)
857
+ return value;
858
+ if (typeof value !== 'object' && typeof value !== 'function')
859
+ return value;
860
+ if (Array.isArray(value))
861
+ return value;
862
+ const proto = Reflect.getPrototypeOf(value);
863
+ if (!proto)
864
+ return value;
865
+ if (Reflect.getPrototypeOf(proto) === null)
866
+ return value;
867
+ if ('toJSON' in value)
868
+ return value;
869
+ if (value instanceof RegExp)
870
+ return value.toString();
871
+ let key = $.$mol_key_store.get(value);
872
+ if (key)
873
+ return key;
874
+ key = $mol_guid();
875
+ $.$mol_key_store.set(value, key);
876
+ return key;
877
+ });
878
+ }
879
+ $.$mol_key = $mol_key;
976
880
  })($ || ($ = {}));
977
- //mol/wire/cursor/cursor.ts
881
+ //mol/key/key.ts
978
882
  ;
979
883
  "use strict";
980
884
  var $;
981
885
  (function ($) {
982
- class $mol_wire_pub extends Object {
983
- data = [];
984
- static get [Symbol.species]() {
985
- return Array;
886
+ $.$mol_compare_deep_cache = new WeakMap();
887
+ function $mol_compare_deep(left, right) {
888
+ if (Object.is(left, right))
889
+ return true;
890
+ if (left === null)
891
+ return false;
892
+ if (right === null)
893
+ return false;
894
+ if (typeof left !== 'object')
895
+ return false;
896
+ if (typeof right !== 'object')
897
+ return false;
898
+ const left_proto = Reflect.getPrototypeOf(left);
899
+ const right_proto = Reflect.getPrototypeOf(right);
900
+ if (left_proto !== right_proto)
901
+ return false;
902
+ if (left instanceof Boolean)
903
+ return Object.is(left.valueOf(), right['valueOf']());
904
+ if (left instanceof Number)
905
+ return Object.is(left.valueOf(), right['valueOf']());
906
+ if (left instanceof String)
907
+ return Object.is(left.valueOf(), right['valueOf']());
908
+ if (left instanceof Date)
909
+ return Object.is(left.valueOf(), right['valueOf']());
910
+ if (left instanceof RegExp)
911
+ return left.source === right['source'] && left.flags === right['flags'];
912
+ if (left instanceof Error)
913
+ return left.message === right['message'] && left.stack === right['stack'];
914
+ let left_cache = $.$mol_compare_deep_cache.get(left);
915
+ if (left_cache) {
916
+ const right_cache = left_cache.get(right);
917
+ if (typeof right_cache === 'boolean')
918
+ return right_cache;
986
919
  }
987
- sub_from = 0;
988
- get sub_list() {
989
- const res = [];
990
- for (let i = this.sub_from; i < this.data.length; i += 2) {
991
- res.push(this.data[i]);
992
- }
993
- return res;
920
+ else {
921
+ left_cache = new WeakMap([[right, true]]);
922
+ $.$mol_compare_deep_cache.set(left, left_cache);
994
923
  }
995
- get sub_empty() {
996
- return this.sub_from === this.data.length;
924
+ let result;
925
+ try {
926
+ if (left_proto && !Reflect.getPrototypeOf(left_proto))
927
+ result = compare_pojo(left, right);
928
+ else if (Array.isArray(left))
929
+ result = compare_array(left, right);
930
+ else if (left instanceof Set)
931
+ result = compare_set(left, right);
932
+ else if (left instanceof Map)
933
+ result = compare_map(left, right);
934
+ else if (ArrayBuffer.isView(left))
935
+ result = compare_buffer(left, right);
936
+ else if (Symbol.toPrimitive in left)
937
+ result = compare_primitive(left, right);
938
+ else
939
+ result = false;
997
940
  }
998
- sub_on(sub, pub_pos) {
999
- const pos = this.data.length;
1000
- this.data.push(sub, pub_pos);
1001
- return pos;
941
+ finally {
942
+ left_cache.set(right, result);
1002
943
  }
1003
- sub_off(sub_pos) {
1004
- if (!(sub_pos < this.data.length)) {
1005
- $mol_fail(new Error(`Wrong pos ${sub_pos}`));
1006
- }
1007
- const end = this.data.length - 2;
1008
- if (sub_pos !== end) {
1009
- this.peer_move(end, sub_pos);
1010
- }
1011
- this.data.pop();
1012
- this.data.pop();
1013
- if (this.data.length === this.sub_from)
1014
- this.reap();
944
+ return result;
945
+ }
946
+ $.$mol_compare_deep = $mol_compare_deep;
947
+ function compare_array(left, right) {
948
+ const len = left.length;
949
+ if (len !== right.length)
950
+ return false;
951
+ for (let i = 0; i < len; ++i) {
952
+ if (!$mol_compare_deep(left[i], right[i]))
953
+ return false;
1015
954
  }
1016
- reap() { }
1017
- promote() {
1018
- $mol_wire_auto()?.track_next(this);
955
+ return true;
956
+ }
957
+ function compare_buffer(left, right) {
958
+ const len = left.byteLength;
959
+ if (len !== right.byteLength)
960
+ return false;
961
+ for (let i = 0; i < len; ++i) {
962
+ if (left[i] !== right[i])
963
+ return false;
1019
964
  }
1020
- fresh() { }
1021
- complete() { }
1022
- emit(quant = $mol_wire_cursor.stale) {
1023
- for (let i = this.sub_from; i < this.data.length; i += 2) {
1024
- ;
1025
- this.data[i].absorb(quant);
1026
- }
965
+ return true;
966
+ }
967
+ function compare_iterator(left, right) {
968
+ while (true) {
969
+ const left_next = left.next();
970
+ const right_next = right.next();
971
+ if (left_next.done !== right_next.done)
972
+ return false;
973
+ if (left_next.done)
974
+ break;
975
+ if (!$mol_compare_deep(left_next.value, right_next.value))
976
+ return false;
1027
977
  }
1028
- peer_move(from_pos, to_pos) {
1029
- const peer = this.data[from_pos];
1030
- const self_pos = this.data[from_pos + 1];
1031
- this.data[to_pos] = peer;
1032
- this.data[to_pos + 1] = self_pos;
1033
- peer.peer_repos(self_pos, to_pos);
978
+ return true;
979
+ }
980
+ function compare_set(left, right) {
981
+ if (left.size !== right.size)
982
+ return false;
983
+ return compare_iterator(left.values(), right.values());
984
+ }
985
+ function compare_map(left, right) {
986
+ if (left.size !== right.size)
987
+ return false;
988
+ return compare_iterator(left.keys(), right.keys())
989
+ && compare_iterator(left.values(), right.values());
990
+ }
991
+ function compare_pojo(left, right) {
992
+ const left_keys = Object.getOwnPropertyNames(left);
993
+ const right_keys = Object.getOwnPropertyNames(right);
994
+ if (left_keys.length !== right_keys.length)
995
+ return false;
996
+ for (let key of left_keys) {
997
+ if (!$mol_compare_deep(left[key], Reflect.get(right, key)))
998
+ return false;
999
+ }
1000
+ return true;
1001
+ }
1002
+ function compare_primitive(left, right) {
1003
+ return Object.is(left[Symbol.toPrimitive]('default'), right[Symbol.toPrimitive]('default'));
1004
+ }
1005
+ })($ || ($ = {}));
1006
+ //mol/compare/deep/deep.ts
1007
+ ;
1008
+ "use strict";
1009
+ var $;
1010
+ (function ($) {
1011
+ class $mol_wire_task extends $mol_wire_fiber {
1012
+ static getter(task) {
1013
+ return function $mol_wire_task_get(host, args) {
1014
+ const sub = $mol_wire_auto();
1015
+ const existen = sub?.track_next();
1016
+ reuse: if (existen) {
1017
+ if (!(existen instanceof $mol_wire_task))
1018
+ break reuse;
1019
+ if (existen.host !== host)
1020
+ break reuse;
1021
+ if (existen.task !== task)
1022
+ break reuse;
1023
+ if (!$mol_compare_deep(existen.args, args))
1024
+ break reuse;
1025
+ return existen;
1026
+ }
1027
+ return new $mol_wire_task(`${host?.[Symbol.toStringTag] ?? host}.${task.name}(#)`, task, host, args);
1028
+ };
1029
+ }
1030
+ complete() {
1031
+ if (this.cache instanceof Promise)
1032
+ return;
1033
+ this.destructor();
1034
+ }
1035
+ put(next) {
1036
+ const prev = this.cache;
1037
+ this.cache = next;
1038
+ if (next instanceof Promise) {
1039
+ this.cursor = $mol_wire_cursor.fresh;
1040
+ if (next !== prev)
1041
+ this.emit();
1042
+ return next;
1043
+ }
1044
+ this.cursor = $mol_wire_cursor.final;
1045
+ if (this.sub_empty)
1046
+ this.destructor();
1047
+ else if (next !== prev)
1048
+ this.emit();
1049
+ return next;
1034
1050
  }
1035
- peer_repos(peer_pos, self_pos) {
1036
- this.data[peer_pos + 1] = self_pos;
1051
+ }
1052
+ $.$mol_wire_task = $mol_wire_task;
1053
+ })($ || ($ = {}));
1054
+ //mol/wire/task/task.ts
1055
+ ;
1056
+ "use strict";
1057
+ var $;
1058
+ (function ($) {
1059
+ function $mol_wire_method(host, field, descr) {
1060
+ if (!descr)
1061
+ descr = Reflect.getOwnPropertyDescriptor(host, field);
1062
+ const orig = descr?.value ?? host[field];
1063
+ const sup = Reflect.getPrototypeOf(host);
1064
+ if (typeof sup[field] === 'function') {
1065
+ Object.defineProperty(orig, 'name', { value: sup[field].name });
1037
1066
  }
1067
+ const temp = $mol_wire_task.getter(orig);
1068
+ const value = function (...args) {
1069
+ const fiber = temp(this ?? null, args);
1070
+ return fiber.sync();
1071
+ };
1072
+ Object.defineProperty(value, 'name', { value: orig.name + ' ' });
1073
+ Object.assign(value, { orig });
1074
+ const descr2 = { ...descr, value };
1075
+ Reflect.defineProperty(host, field, descr2);
1076
+ return descr2;
1038
1077
  }
1039
- $.$mol_wire_pub = $mol_wire_pub;
1078
+ $.$mol_wire_method = $mol_wire_method;
1040
1079
  })($ || ($ = {}));
1041
- //mol/wire/pub/pub.ts
1080
+ //mol/wire/method/method.ts
1042
1081
  ;
1043
1082
  "use strict";
1044
- //mol/wire/sub/sub.ts
1083
+ //mol/type/tail/tail.ts
1084
+ ;
1085
+ "use strict";
1086
+ //mol/type/foot/foot.ts
1045
1087
  ;
1046
1088
  "use strict";
1047
1089
  var $;
1048
1090
  (function ($) {
1049
- let auto = null;
1050
- function $mol_wire_auto(next = auto) {
1051
- return auto = next;
1091
+ const catched = new WeakMap();
1092
+ function $mol_fail_catch(error) {
1093
+ if (typeof error !== 'object')
1094
+ return false;
1095
+ if (error instanceof Promise)
1096
+ $mol_fail_hidden(error);
1097
+ if (catched.get(error))
1098
+ return false;
1099
+ catched.set(error, true);
1100
+ return true;
1052
1101
  }
1053
- $.$mol_wire_auto = $mol_wire_auto;
1054
- $.$mol_wire_affected = [];
1102
+ $.$mol_fail_catch = $mol_fail_catch;
1055
1103
  })($ || ($ = {}));
1056
- //mol/wire/wire.ts
1104
+ //mol/fail/catch/catch.ts
1057
1105
  ;
1058
1106
  "use strict";
1059
1107
  var $;
1060
1108
  (function ($) {
1061
- $['devtoolsFormatters'] = $['devtoolsFormatters'] || [];
1062
- function $mol_dev_format_register(config) {
1063
- $['devtoolsFormatters'].push(config);
1064
- }
1065
- $.$mol_dev_format_register = $mol_dev_format_register;
1066
- $.$mol_dev_format_head = Symbol('$mol_dev_format_head');
1067
- $.$mol_dev_format_body = Symbol('$mol_dev_format_body');
1068
- $mol_dev_format_register({
1069
- header: (val, config = false) => {
1070
- if (config)
1071
- return null;
1072
- if (!val)
1073
- return null;
1074
- if ($.$mol_dev_format_head in val) {
1075
- return val[$.$mol_dev_format_head]();
1076
- }
1077
- if (typeof val === 'function') {
1078
- return $mol_dev_format_native(val);
1079
- }
1080
- return null;
1081
- },
1082
- hasBody: val => val[$.$mol_dev_format_body],
1083
- body: val => val[$.$mol_dev_format_body](),
1084
- });
1085
- function $mol_dev_format_native(obj) {
1086
- if (typeof obj === 'undefined')
1087
- return $.$mol_dev_format_shade('undefined');
1088
- if (typeof obj !== 'object' && typeof obj !== 'function')
1089
- return obj;
1090
- return [
1091
- 'object',
1092
- {
1093
- object: obj,
1094
- config: true,
1095
- },
1096
- ];
1097
- }
1098
- $.$mol_dev_format_native = $mol_dev_format_native;
1099
- function $mol_dev_format_auto(obj) {
1100
- if (obj == null)
1101
- return $.$mol_dev_format_shade(String(obj));
1102
- if (typeof obj === 'object' && $.$mol_dev_format_head in obj) {
1103
- return obj[$.$mol_dev_format_head]();
1104
- }
1105
- return [
1106
- 'object',
1107
- {
1108
- object: obj,
1109
- config: false,
1110
- },
1111
- ];
1112
- }
1113
- $.$mol_dev_format_auto = $mol_dev_format_auto;
1114
- function $mol_dev_format_element(element, style, ...content) {
1115
- const styles = [];
1116
- for (let key in style)
1117
- styles.push(`${key} : ${style[key]}`);
1118
- return [
1119
- element,
1120
- {
1121
- style: styles.join(' ; '),
1122
- },
1123
- ...content,
1124
- ];
1125
- }
1126
- $.$mol_dev_format_element = $mol_dev_format_element;
1127
- function $mol_dev_format_span(style, ...content) {
1128
- return $mol_dev_format_element('span', {
1129
- 'vertical-align': '8%',
1130
- ...style,
1131
- }, ...content);
1109
+ function $mol_fail_log(error) {
1110
+ if (error instanceof Promise)
1111
+ return false;
1112
+ if (!$mol_fail_catch(error))
1113
+ return false;
1114
+ console.error(error);
1115
+ return true;
1132
1116
  }
1133
- $.$mol_dev_format_span = $mol_dev_format_span;
1134
- $.$mol_dev_format_div = $mol_dev_format_element.bind(null, 'div');
1135
- $.$mol_dev_format_ol = $mol_dev_format_element.bind(null, 'ol');
1136
- $.$mol_dev_format_li = $mol_dev_format_element.bind(null, 'li');
1137
- $.$mol_dev_format_table = $mol_dev_format_element.bind(null, 'table');
1138
- $.$mol_dev_format_tr = $mol_dev_format_element.bind(null, 'tr');
1139
- $.$mol_dev_format_td = $mol_dev_format_element.bind(null, 'td');
1140
- $.$mol_dev_format_accent = $mol_dev_format_span.bind(null, {
1141
- 'color': 'magenta',
1142
- });
1143
- $.$mol_dev_format_strong = $mol_dev_format_span.bind(null, {
1144
- 'font-weight': 'bold',
1145
- });
1146
- $.$mol_dev_format_string = $mol_dev_format_span.bind(null, {
1147
- 'color': 'green',
1148
- });
1149
- $.$mol_dev_format_shade = $mol_dev_format_span.bind(null, {
1150
- 'color': 'gray',
1151
- });
1152
- $.$mol_dev_format_indent = $.$mol_dev_format_div.bind(null, {
1153
- 'margin-left': '13px'
1154
- });
1117
+ $.$mol_fail_log = $mol_fail_log;
1155
1118
  })($ || ($ = {}));
1156
- //mol/dev/format/format.ts
1119
+ //mol/fail/log/log.ts
1157
1120
  ;
1158
1121
  "use strict";
1159
1122
  var $;
1160
1123
  (function ($) {
1161
- class $mol_wire_pub_sub extends $mol_wire_pub {
1162
- pub_from = 0;
1163
- cursor = $mol_wire_cursor.stale;
1164
- get pub_list() {
1165
- const res = [];
1166
- const max = this.cursor >= 0 ? this.cursor : this.sub_from;
1167
- for (let i = this.pub_from; i < max; i += 2) {
1168
- if (this.data[i])
1169
- res.push(this.data[i]);
1170
- }
1171
- return res;
1172
- }
1173
- track_on() {
1174
- this.cursor = this.pub_from;
1175
- const sub = $mol_wire_auto();
1176
- $mol_wire_auto(this);
1177
- return sub;
1124
+ class $mol_wire_atom extends $mol_wire_fiber {
1125
+ static solo(host, task) {
1126
+ const field = task.name + '()';
1127
+ const existen = Object.getOwnPropertyDescriptor(host ?? task, field)?.value;
1128
+ if (existen)
1129
+ return existen;
1130
+ const prefix = host?.[Symbol.toStringTag] ?? (host instanceof Function ? $$.$mol_func_name(host) : host);
1131
+ const key = `${prefix}.${field}`;
1132
+ const fiber = new $mol_wire_atom(key, task, host, []);
1133
+ (host ?? task)[field] = fiber;
1134
+ return fiber;
1178
1135
  }
1179
- promote() {
1180
- if (this.cursor >= this.pub_from) {
1181
- $mol_fail(new Error('Circular subscription'));
1136
+ static plex(host, task, key) {
1137
+ const field = task.name + '()';
1138
+ let dict = Object.getOwnPropertyDescriptor(host ?? task, field)?.value;
1139
+ const prefix = host?.[Symbol.toStringTag] ?? (host instanceof Function ? $$.$mol_func_name(host) : host);
1140
+ const id = `${prefix}.${task.name}(${$mol_key(key)})`;
1141
+ if (dict) {
1142
+ const existen = dict.get(id);
1143
+ if (existen)
1144
+ return existen;
1182
1145
  }
1183
- super.promote();
1146
+ else {
1147
+ dict = (host ?? task)[field] = new Map();
1148
+ }
1149
+ const fiber = new $mol_wire_atom(id, task, host, [key]);
1150
+ dict.set(id, fiber);
1151
+ return fiber;
1184
1152
  }
1185
- track_next(pub) {
1186
- if (this.cursor < 0)
1187
- $mol_fail(new Error('Promo to non begun sub'));
1188
- if (this.cursor < this.sub_from) {
1189
- const next = this.data[this.cursor];
1190
- if (pub === undefined)
1191
- return next ?? null;
1192
- if (next === pub) {
1193
- this.cursor += 2;
1194
- return next;
1195
- }
1196
- if (next) {
1197
- if (this.sub_from < this.data.length) {
1198
- this.peer_move(this.sub_from, this.data.length);
1199
- }
1200
- this.peer_move(this.cursor, this.sub_from);
1201
- this.sub_from += 2;
1153
+ static watching = new Set();
1154
+ static watcher = null;
1155
+ static watch() {
1156
+ $mol_wire_atom.watcher = new $mol_after_frame($mol_wire_atom.watch);
1157
+ for (const atom of $mol_wire_atom.watching) {
1158
+ if (atom.cursor === $mol_wire_cursor.final) {
1159
+ $mol_wire_atom.watching.delete(atom);
1202
1160
  }
1203
- }
1204
- else {
1205
- if (pub === undefined)
1206
- return null;
1207
- if (this.sub_from < this.data.length) {
1208
- this.peer_move(this.sub_from, this.data.length);
1161
+ else {
1162
+ atom.cursor = $mol_wire_cursor.stale;
1163
+ atom.fresh();
1209
1164
  }
1210
- this.sub_from += 2;
1211
1165
  }
1212
- this.data[this.cursor] = pub;
1213
- this.data[this.cursor + 1] = pub.sub_on(this, this.cursor);
1214
- this.cursor += 2;
1215
- return pub;
1216
1166
  }
1217
- track_off(sub) {
1218
- $mol_wire_auto(sub);
1219
- if (this.cursor < 0) {
1220
- $mol_fail(new Error('End of non begun sub'));
1221
- }
1222
- for (let cursor = this.pub_from; cursor < this.cursor; cursor += 2) {
1223
- const pub = this.data[cursor];
1224
- pub.fresh();
1167
+ watch() {
1168
+ if (!$mol_wire_atom.watcher) {
1169
+ $mol_wire_atom.watcher = new $mol_after_frame($mol_wire_atom.watch);
1225
1170
  }
1226
- this.cursor = $mol_wire_cursor.fresh;
1171
+ $mol_wire_atom.watching.add(this);
1227
1172
  }
1228
- pub_off(sub_pos) {
1229
- this.data[sub_pos] = undefined;
1230
- this.data[sub_pos + 1] = undefined;
1173
+ resync(args) {
1174
+ return this.put(this.task.call(this.host, ...args));
1231
1175
  }
1232
- destructor() {
1233
- for (let cursor = this.data.length - 2; cursor >= this.sub_from; cursor -= 2) {
1234
- const sub = this.data[cursor];
1235
- const pos = this.data[cursor + 1];
1236
- sub.pub_off(pos);
1237
- this.data.pop();
1238
- this.data.pop();
1239
- }
1240
- this.cursor = this.pub_from;
1241
- this.track_cut();
1242
- this.cursor = $mol_wire_cursor.final;
1176
+ once() {
1177
+ return this.sync();
1243
1178
  }
1244
- track_cut() {
1245
- if (this.cursor < this.pub_from) {
1246
- $mol_fail(new Error('Cut of non begun sub'));
1247
- }
1248
- let tail = 0;
1249
- for (let cursor = this.cursor; cursor < this.sub_from; cursor += 2) {
1250
- const pub = this.data[cursor];
1251
- pub?.sub_off(this.data[cursor + 1]);
1252
- if (this.sub_from < this.data.length) {
1253
- this.peer_move(this.data.length - 2, cursor);
1254
- this.data.pop();
1255
- this.data.pop();
1179
+ channel() {
1180
+ return Object.assign((next) => {
1181
+ if (next !== undefined)
1182
+ return this.resync([...this.args, next]);
1183
+ if (!$mol_wire_fiber.warm)
1184
+ return this.result();
1185
+ if ($mol_wire_auto() instanceof $mol_wire_task) {
1186
+ return this.once();
1256
1187
  }
1257
1188
  else {
1258
- ++tail;
1189
+ return this.sync();
1259
1190
  }
1191
+ }, { atom: this });
1192
+ }
1193
+ destructor() {
1194
+ super.destructor();
1195
+ const prev = this.cache;
1196
+ if ($mol_owning_check(this, prev)) {
1197
+ prev.destructor();
1260
1198
  }
1261
- for (; tail; --tail) {
1262
- this.data.pop();
1263
- this.data.pop();
1199
+ if (this.pub_from === 0) {
1200
+ ;
1201
+ (this.host ?? this.task)[this.field()] = null;
1264
1202
  }
1265
- this.sub_from = this.cursor;
1266
- }
1267
- complete() { }
1268
- complete_pubs() {
1269
- const limit = this.cursor < 0 ? this.sub_from : this.cursor;
1270
- for (let cursor = this.pub_from; cursor < limit; cursor += 2) {
1271
- const pub = this.data[cursor];
1272
- pub?.complete();
1203
+ else {
1204
+ ;
1205
+ (this.host ?? this.task)[this.field()].delete(this[Symbol.toStringTag]);
1273
1206
  }
1274
1207
  }
1275
- absorb(quant = $mol_wire_cursor.stale) {
1276
- if (this.cursor === $mol_wire_cursor.final)
1277
- return;
1278
- if (this.cursor >= quant)
1279
- return;
1280
- this.cursor = quant;
1281
- this.emit($mol_wire_cursor.doubt);
1282
- }
1283
- [$mol_dev_format_head]() {
1284
- return $mol_dev_format_native(this);
1285
- }
1286
- get pub_empty() {
1287
- return this.sub_from === this.pub_from;
1208
+ put(next) {
1209
+ const prev = this.cache;
1210
+ update: if (next !== prev) {
1211
+ try {
1212
+ if ($mol_compare_deep(prev, next))
1213
+ break update;
1214
+ }
1215
+ catch (error) {
1216
+ $mol_fail_log(error);
1217
+ }
1218
+ if ($mol_owning_check(this, prev)) {
1219
+ prev.destructor();
1220
+ }
1221
+ if ($mol_owning_catch(this, next)) {
1222
+ try {
1223
+ next[Symbol.toStringTag] = this[Symbol.toStringTag];
1224
+ }
1225
+ catch {
1226
+ Object.defineProperty(next, Symbol.toStringTag, { value: this[Symbol.toStringTag] });
1227
+ }
1228
+ }
1229
+ if (!this.sub_empty)
1230
+ this.emit();
1231
+ }
1232
+ this.cache = next;
1233
+ this.cursor = $mol_wire_cursor.fresh;
1234
+ if (next instanceof Promise)
1235
+ return next;
1236
+ this.complete_pubs();
1237
+ return next;
1288
1238
  }
1289
1239
  }
1290
- $.$mol_wire_pub_sub = $mol_wire_pub_sub;
1240
+ __decorate([
1241
+ $mol_wire_method
1242
+ ], $mol_wire_atom.prototype, "resync", null);
1243
+ __decorate([
1244
+ $mol_wire_method
1245
+ ], $mol_wire_atom.prototype, "once", null);
1246
+ $.$mol_wire_atom = $mol_wire_atom;
1291
1247
  })($ || ($ = {}));
1292
- //mol/wire/pub/sub/sub.ts
1248
+ //mol/wire/atom/atom.ts
1293
1249
  ;
1294
1250
  "use strict";
1295
1251
  var $;
1296
1252
  (function ($) {
1297
- class $mol_after_timeout extends $mol_object2 {
1298
- delay;
1299
- task;
1300
- id;
1301
- constructor(delay, task) {
1302
- super();
1303
- this.delay = delay;
1304
- this.task = task;
1305
- this.id = setTimeout(task, delay);
1253
+ function $mol_wire_solo(host, field, descr) {
1254
+ if (!descr)
1255
+ descr = Reflect.getOwnPropertyDescriptor(host, field);
1256
+ const orig = descr?.value ?? host[field];
1257
+ const sup = Reflect.getPrototypeOf(host);
1258
+ if (typeof sup[field] === 'function') {
1259
+ Object.defineProperty(orig, 'name', { value: sup[field].name });
1306
1260
  }
1307
- destructor() {
1308
- clearTimeout(this.id);
1261
+ const descr2 = {
1262
+ ...descr,
1263
+ value: function (...args) {
1264
+ let atom = $mol_wire_atom.solo(this, orig);
1265
+ if ((args.length === 0) || (args[0] === undefined)) {
1266
+ if (!$mol_wire_fiber.warm)
1267
+ return atom.result();
1268
+ if ($mol_wire_auto() instanceof $mol_wire_task) {
1269
+ return atom.once();
1270
+ }
1271
+ else {
1272
+ return atom.sync();
1273
+ }
1274
+ }
1275
+ return atom.resync(args);
1276
+ }
1277
+ };
1278
+ Reflect.defineProperty(descr2.value, 'name', { value: orig.name + ' ' });
1279
+ Object.assign(descr2.value, { orig });
1280
+ Reflect.defineProperty(host, field, descr2);
1281
+ return descr2;
1282
+ }
1283
+ $.$mol_wire_solo = $mol_wire_solo;
1284
+ })($ || ($ = {}));
1285
+ //mol/wire/solo/solo.ts
1286
+ ;
1287
+ "use strict";
1288
+ var $;
1289
+ (function ($) {
1290
+ function $mol_wire_plex(host, field, descr) {
1291
+ if (!descr)
1292
+ descr = Reflect.getOwnPropertyDescriptor(host, field);
1293
+ const orig = descr?.value ?? host[field];
1294
+ const sup = Reflect.getPrototypeOf(host);
1295
+ if (typeof sup[field] === 'function') {
1296
+ Object.defineProperty(orig, 'name', { value: sup[field].name });
1309
1297
  }
1298
+ const descr2 = {
1299
+ ...descr,
1300
+ value: function (...args) {
1301
+ let atom = $mol_wire_atom.plex(this, orig, args[0]);
1302
+ if ((args.length === 1) || (args[1] === undefined)) {
1303
+ if (!$mol_wire_fiber.warm)
1304
+ return atom.result();
1305
+ if ($mol_wire_auto() instanceof $mol_wire_task) {
1306
+ return atom.once();
1307
+ }
1308
+ else {
1309
+ return atom.sync();
1310
+ }
1311
+ }
1312
+ return atom.resync(args);
1313
+ }
1314
+ };
1315
+ Reflect.defineProperty(descr2.value, 'name', { value: orig.name + ' ' });
1316
+ Object.assign(descr2.value, { orig });
1317
+ Reflect.defineProperty(host, field, descr2);
1318
+ return descr2;
1310
1319
  }
1311
- $.$mol_after_timeout = $mol_after_timeout;
1320
+ $.$mol_wire_plex = $mol_wire_plex;
1312
1321
  })($ || ($ = {}));
1313
- //mol/after/timeout/timeout.ts
1322
+ //mol/wire/plex/plex.ts
1323
+ ;
1324
+ "use strict";
1325
+ var $;
1326
+ (function ($) {
1327
+ $.$mol_mem = $mol_wire_solo;
1328
+ $.$mol_mem_key = $mol_wire_plex;
1329
+ })($ || ($ = {}));
1330
+ //mol/mem/mem.ts
1331
+ ;
1332
+ "use strict";
1333
+ var $;
1334
+ (function ($) {
1335
+ })($ || ($ = {}));
1336
+ //mol/dom/context/context.ts
1337
+ ;
1338
+ "use strict";
1339
+ //node/node.ts
1340
+ ;
1341
+ "use strict";
1342
+ var $node = new Proxy({ require }, {
1343
+ get(target, name, wrapper) {
1344
+ if (target[name])
1345
+ return target[name];
1346
+ const mod = target.require('module');
1347
+ if (mod.builtinModules.indexOf(name) >= 0)
1348
+ return target.require(name);
1349
+ if (name[0] === '.')
1350
+ return target.require(name);
1351
+ const path = target.require('path');
1352
+ const fs = target.require('fs');
1353
+ let dir = path.resolve('.');
1354
+ const suffix = `./node_modules/${name}`;
1355
+ const $$ = $;
1356
+ while (!fs.existsSync(path.join(dir, suffix))) {
1357
+ const parent = path.resolve(dir, '..');
1358
+ if (parent === dir) {
1359
+ $$.$mol_exec('.', 'npm', 'install', '--omit=dev', name);
1360
+ try {
1361
+ $$.$mol_exec('.', 'npm', 'install', '--omit=dev', '@types/' + name);
1362
+ }
1363
+ catch { }
1364
+ break;
1365
+ }
1366
+ else {
1367
+ dir = parent;
1368
+ }
1369
+ }
1370
+ return target.require(name);
1371
+ },
1372
+ set(target, name, value) {
1373
+ target[name] = value;
1374
+ return true;
1375
+ },
1376
+ });
1377
+ require = (req => Object.assign(function require(name) {
1378
+ return $node[name];
1379
+ }, req))(require);
1380
+ //node/node.node.ts
1314
1381
  ;
1315
1382
  "use strict";
1316
1383
  var $;
1317
1384
  (function ($) {
1318
- class $mol_after_frame extends $mol_after_timeout {
1319
- task;
1320
- constructor(task) {
1321
- super(16, task);
1322
- this.task = task;
1323
- }
1385
+ function $mol_log3_area_lazy(event) {
1386
+ const self = this;
1387
+ const stack = self.$mol_log3_stack;
1388
+ const deep = stack.length;
1389
+ let logged = false;
1390
+ stack.push(() => {
1391
+ logged = true;
1392
+ self.$mol_log3_area.call(self, event);
1393
+ });
1394
+ return () => {
1395
+ if (logged)
1396
+ self.console.groupEnd();
1397
+ if (stack.length > deep)
1398
+ stack.length = deep;
1399
+ };
1324
1400
  }
1325
- $.$mol_after_frame = $mol_after_frame;
1401
+ $.$mol_log3_area_lazy = $mol_log3_area_lazy;
1402
+ $.$mol_log3_stack = [];
1326
1403
  })($ || ($ = {}));
1327
- //mol/after/frame/frame.node.ts
1404
+ //mol/log3/log3.ts
1328
1405
  ;
1329
1406
  "use strict";
1330
1407
  var $;
1331
1408
  (function ($) {
1332
- const handled = new WeakSet();
1333
- class $mol_wire_fiber extends $mol_wire_pub_sub {
1334
- task;
1335
- host;
1336
- static warm = true;
1337
- static planning = new Set();
1338
- static reaping = new Set();
1339
- static plan_task = null;
1340
- static plan() {
1341
- if (this.plan_task)
1342
- return;
1343
- this.plan_task = new $mol_after_frame(() => {
1344
- try {
1345
- this.sync();
1346
- }
1347
- finally {
1348
- $mol_wire_fiber.plan_task = null;
1409
+ $.$mol_tree_convert = Symbol('$mol_tree_convert');
1410
+ class $mol_tree extends $mol_object2 {
1411
+ type;
1412
+ data;
1413
+ sub;
1414
+ baseUri;
1415
+ row;
1416
+ col;
1417
+ length;
1418
+ constructor(config = {}) {
1419
+ super();
1420
+ this.type = config.type || '';
1421
+ if (config.value !== undefined) {
1422
+ var sub = $mol_tree.values(config.value);
1423
+ if (config.type || sub.length > 1) {
1424
+ this.sub = [...sub, ...(config.sub || [])];
1425
+ this.data = config.data || '';
1349
1426
  }
1350
- });
1351
- }
1352
- static sync() {
1353
- while (this.planning.size) {
1354
- for (const fiber of this.planning) {
1355
- this.planning.delete(fiber);
1356
- if (fiber.cursor >= 0)
1357
- continue;
1358
- if (fiber.cursor === $mol_wire_cursor.final)
1359
- continue;
1360
- fiber.fresh();
1427
+ else {
1428
+ this.data = sub[0].data;
1429
+ this.sub = config.sub || [];
1361
1430
  }
1362
1431
  }
1363
- while (this.reaping.size) {
1364
- const fibers = this.reaping;
1365
- this.reaping = new Set;
1366
- for (const fiber of fibers) {
1367
- if (!fiber.sub_empty)
1368
- continue;
1369
- fiber.destructor();
1370
- }
1432
+ else {
1433
+ this.data = config.data || '';
1434
+ this.sub = config.sub || [];
1371
1435
  }
1436
+ this.baseUri = config.baseUri || '';
1437
+ this.row = config.row || 0;
1438
+ this.col = config.col || 0;
1439
+ this.length = config.length || 0;
1372
1440
  }
1373
- cache = undefined;
1374
- get args() {
1375
- return this.data.slice(0, this.pub_from);
1376
- }
1377
- result() {
1378
- if (this.cache instanceof Promise)
1379
- return;
1380
- if (this.cache instanceof Error)
1381
- return;
1382
- return this.cache;
1383
- }
1384
- field() {
1385
- return this.task.name + '()';
1386
- }
1387
- constructor(id, task, host, args) {
1388
- super();
1389
- this.task = task;
1390
- this.host = host;
1391
- if (args)
1392
- this.data.push(...args);
1393
- this.pub_from = this.sub_from = args?.length ?? 0;
1394
- this[Symbol.toStringTag] = id;
1395
- }
1396
- plan() {
1397
- $mol_wire_fiber.planning.add(this);
1398
- $mol_wire_fiber.plan();
1399
- }
1400
- reap() {
1401
- $mol_wire_fiber.reaping.add(this);
1402
- $mol_wire_fiber.plan();
1403
- }
1404
- toString() {
1405
- return this[Symbol.toStringTag];
1441
+ static values(str, baseUri) {
1442
+ return str.split('\n').map((data, index) => new $mol_tree({
1443
+ data: data,
1444
+ baseUri: baseUri,
1445
+ row: index + 1,
1446
+ length: data.length,
1447
+ }));
1406
1448
  }
1407
- toJSON() {
1408
- return this[Symbol.toStringTag];
1449
+ clone(config = {}) {
1450
+ return new $mol_tree({
1451
+ type: ('type' in config) ? config.type : this.type,
1452
+ data: ('data' in config) ? config.data : this.data,
1453
+ sub: ('sub' in config) ? config.sub : this.sub,
1454
+ baseUri: ('baseUri' in config) ? config.baseUri : this.baseUri,
1455
+ row: ('row' in config) ? config.row : this.row,
1456
+ col: ('col' in config) ? config.col : this.col,
1457
+ length: ('length' in config) ? config.length : this.length,
1458
+ value: config.value
1459
+ });
1409
1460
  }
1410
- [$mol_dev_format_head]() {
1411
- const cursor = {
1412
- [$mol_wire_cursor.stale]: '🔴',
1413
- [$mol_wire_cursor.doubt]: '🟡',
1414
- [$mol_wire_cursor.fresh]: '🟢',
1415
- [$mol_wire_cursor.final]: '🔵',
1416
- }[this.cursor] ?? this.cursor.toString();
1417
- return $mol_dev_format_div({}, $mol_dev_format_native(this), $mol_dev_format_shade(cursor + ' '), $mol_dev_format_auto(this.cache));
1461
+ make(config) {
1462
+ return new $mol_tree({
1463
+ baseUri: this.baseUri,
1464
+ row: this.row,
1465
+ col: this.col,
1466
+ length: this.length,
1467
+ ...config,
1468
+ });
1418
1469
  }
1419
- get $() {
1420
- return (this.host ?? this.task)['$'];
1470
+ make_data(value, sub) {
1471
+ return this.make({ value, sub });
1421
1472
  }
1422
- emit(quant = $mol_wire_cursor.stale) {
1423
- if (this.sub_empty)
1424
- this.plan();
1425
- else
1426
- super.emit(quant);
1473
+ make_struct(type, sub) {
1474
+ return this.make({ type, sub });
1427
1475
  }
1428
- fresh() {
1429
- if (this.cursor === $mol_wire_cursor.fresh)
1430
- return;
1431
- if (this.cursor === $mol_wire_cursor.final)
1432
- return;
1433
- check: if (this.cursor === $mol_wire_cursor.doubt) {
1434
- for (let i = this.pub_from; i < this.sub_from; i += 2) {
1435
- ;
1436
- this.data[i]?.fresh();
1437
- if (this.cursor !== $mol_wire_cursor.doubt)
1438
- break check;
1439
- }
1440
- this.cursor = $mol_wire_cursor.fresh;
1441
- return;
1442
- }
1443
- const bu = this.track_on();
1444
- let result;
1445
- try {
1446
- switch (this.pub_from) {
1447
- case 0:
1448
- result = this.task.call(this.host);
1449
- break;
1450
- case 1:
1451
- result = this.task.call(this.host, this.data[0]);
1452
- break;
1453
- default:
1454
- result = this.task.call(this.host, ...this.args);
1455
- break;
1476
+ static fromString(str, baseUri) {
1477
+ var root = new $mol_tree({ baseUri: baseUri });
1478
+ var stack = [root];
1479
+ var row = 0;
1480
+ var prefix = str.replace(/^\n?(\t*)[\s\S]*/, '$1');
1481
+ var lines = str.replace(new RegExp('^\\t{0,' + prefix.length + '}', 'mg'), '').split('\n');
1482
+ lines.forEach(line => {
1483
+ ++row;
1484
+ var chunks = /^(\t*)((?:[^\n\t\\ ]+ *)*)(\\[^\n]*)?(.*?)(?:$|\n)/m.exec(line);
1485
+ if (!chunks || chunks[4])
1486
+ return this.$.$mol_fail(new Error(`Syntax error at ${baseUri}:${row}\n${line}`));
1487
+ var indent = chunks[1];
1488
+ var path = chunks[2];
1489
+ var data = chunks[3];
1490
+ var deep = indent.length;
1491
+ var types = path ? path.replace(/ $/, '').split(/ +/) : [];
1492
+ if (stack.length <= deep)
1493
+ return this.$.$mol_fail(new Error(`Too many tabs at ${baseUri}:${row}\n${line}`));
1494
+ stack.length = deep + 1;
1495
+ var parent = stack[deep];
1496
+ let col = deep;
1497
+ types.forEach(type => {
1498
+ if (!type)
1499
+ return this.$.$mol_fail(new Error(`Unexpected space symbol ${baseUri}:${row}\n${line}`));
1500
+ var next = new $mol_tree({ type, baseUri, row, col, length: type.length });
1501
+ const parent_sub = parent.sub;
1502
+ parent_sub.push(next);
1503
+ parent = next;
1504
+ col += type.length + 1;
1505
+ });
1506
+ if (data) {
1507
+ var next = new $mol_tree({ data: data.substring(1), baseUri, row, col, length: data.length });
1508
+ const parent_sub = parent.sub;
1509
+ parent_sub.push(next);
1510
+ parent = next;
1456
1511
  }
1457
- if (result instanceof Promise) {
1458
- const put = (res) => {
1459
- if (this.cache === result)
1460
- this.put(res);
1461
- return res;
1462
- };
1463
- result = Object.assign(result.then(put, put), {
1464
- destructor: result['destructor'] ?? (() => { })
1512
+ stack.push(parent);
1513
+ });
1514
+ return root;
1515
+ }
1516
+ static fromJSON(json, baseUri = '') {
1517
+ switch (true) {
1518
+ case typeof json === 'boolean':
1519
+ case typeof json === 'number':
1520
+ case json === null:
1521
+ return new $mol_tree({
1522
+ type: String(json),
1523
+ baseUri: baseUri
1524
+ });
1525
+ case typeof json === 'string':
1526
+ return new $mol_tree({
1527
+ value: json,
1528
+ baseUri: baseUri
1465
1529
  });
1466
- handled.add(result);
1467
- }
1468
- }
1469
- catch (error) {
1470
- if (error instanceof Error || error instanceof Promise) {
1471
- result = error;
1472
- }
1473
- else {
1474
- result = new Error(String(error), { cause: error });
1475
- }
1476
- if (result instanceof Promise && !handled.has(result)) {
1477
- result = Object.assign(result.finally(() => {
1478
- if (this.cache === result)
1479
- this.absorb();
1480
- }), {
1481
- destructor: result['destructor'] ?? (() => { })
1530
+ case Array.isArray(json):
1531
+ return new $mol_tree({
1532
+ type: "/",
1533
+ sub: json.map(json => $mol_tree.fromJSON(json, baseUri))
1534
+ });
1535
+ case json instanceof Date:
1536
+ return new $mol_tree({
1537
+ value: json.toISOString(),
1538
+ baseUri: baseUri
1539
+ });
1540
+ default:
1541
+ if (typeof json[$.$mol_tree_convert] === 'function') {
1542
+ return json[$.$mol_tree_convert]();
1543
+ }
1544
+ if (typeof json.toJSON === 'function') {
1545
+ return $mol_tree.fromJSON(json.toJSON());
1546
+ }
1547
+ if (json instanceof Error) {
1548
+ const { name, message, stack } = json;
1549
+ json = { ...json, name, message, stack };
1550
+ }
1551
+ var sub = [];
1552
+ for (var key in json) {
1553
+ if (json[key] === undefined)
1554
+ continue;
1555
+ const subsub = $mol_tree.fromJSON(json[key], baseUri);
1556
+ if (/^[^\n\t\\ ]+$/.test(key)) {
1557
+ var child = new $mol_tree({
1558
+ type: key,
1559
+ baseUri: baseUri,
1560
+ sub: [subsub],
1561
+ });
1562
+ }
1563
+ else {
1564
+ var child = new $mol_tree({
1565
+ value: key,
1566
+ baseUri: baseUri,
1567
+ sub: [subsub],
1568
+ });
1569
+ }
1570
+ sub.push(child);
1571
+ }
1572
+ return new $mol_tree({
1573
+ type: "*",
1574
+ sub: sub,
1575
+ baseUri: baseUri
1482
1576
  });
1483
- handled.add(result);
1484
- }
1485
- }
1486
- if (!(result instanceof Promise)) {
1487
- this.track_cut();
1488
1577
  }
1489
- this.track_off(bu);
1490
- this.put(result);
1491
- }
1492
- refresh() {
1493
- this.cursor = $mol_wire_cursor.stale;
1494
- this.fresh();
1495
1578
  }
1496
- sync() {
1497
- if (!$mol_wire_fiber.warm) {
1498
- return this.result();
1499
- }
1500
- this.promote();
1501
- this.fresh();
1502
- if (this.cache instanceof Error) {
1503
- return $mol_fail_hidden(this.cache);
1504
- }
1505
- if (this.cache instanceof Promise) {
1506
- return $mol_fail_hidden(this.cache);
1507
- }
1508
- return this.cache;
1579
+ get uri() {
1580
+ return this.baseUri + '#' + this.row + ':' + this.col;
1509
1581
  }
1510
- async async() {
1511
- while (true) {
1512
- this.fresh();
1513
- if (this.cache instanceof Error) {
1514
- $mol_fail_hidden(this.cache);
1582
+ toString(prefix = '') {
1583
+ var output = '';
1584
+ if (this.type.length) {
1585
+ if (!prefix.length) {
1586
+ prefix = "\t";
1515
1587
  }
1516
- if (!(this.cache instanceof Promise))
1517
- return this.cache;
1518
- await this.cache;
1519
- if (this.cursor === $mol_wire_cursor.final) {
1520
- await new Promise(() => { });
1588
+ output += this.type;
1589
+ if (this.sub.length == 1) {
1590
+ return output + ' ' + this.sub[0].toString(prefix);
1521
1591
  }
1592
+ output += "\n";
1522
1593
  }
1523
- }
1524
- }
1525
- $.$mol_wire_fiber = $mol_wire_fiber;
1526
- })($ || ($ = {}));
1527
- //mol/wire/fiber/fiber.ts
1528
- ;
1529
- "use strict";
1530
- var $;
1531
- (function ($) {
1532
- const named = new WeakSet();
1533
- function $mol_func_name(func) {
1534
- let name = func.name;
1535
- if (name?.length > 1)
1536
- return name;
1537
- if (named.has(func))
1538
- return name;
1539
- for (let key in this) {
1540
- try {
1541
- if (this[key] !== func)
1542
- continue;
1543
- name = key;
1544
- Object.defineProperty(func, 'name', { value: name });
1545
- break;
1594
+ else if (this.data.length || prefix.length) {
1595
+ output += "\\" + this.data + "\n";
1546
1596
  }
1547
- catch { }
1548
- }
1549
- named.add(func);
1550
- return name;
1551
- }
1552
- $.$mol_func_name = $mol_func_name;
1553
- function $mol_func_name_from(target, source) {
1554
- Object.defineProperty(target, 'name', { value: source.name });
1555
- return target;
1556
- }
1557
- $.$mol_func_name_from = $mol_func_name_from;
1558
- })($ || ($ = {}));
1559
- //mol/func/name/name.ts
1560
- ;
1561
- "use strict";
1562
- var $;
1563
- (function ($) {
1564
- function $mol_guid(length = 8, exists = () => false) {
1565
- for (;;) {
1566
- let id = Math.random().toString(36).substring(2, length + 2).toUpperCase();
1567
- if (exists(id))
1568
- continue;
1569
- return id;
1597
+ for (var child of this.sub) {
1598
+ output += prefix;
1599
+ output += child.toString(prefix + "\t");
1600
+ }
1601
+ return output;
1570
1602
  }
1571
- }
1572
- $.$mol_guid = $mol_guid;
1573
- })($ || ($ = {}));
1574
- //mol/guid/guid.ts
1575
- ;
1576
- "use strict";
1577
- var $;
1578
- (function ($) {
1579
- $.$mol_key_store = new WeakMap();
1580
- function $mol_key(value) {
1581
- if (!value)
1582
- return JSON.stringify(value);
1583
- if (typeof value !== 'object' && typeof value !== 'function')
1584
- return JSON.stringify(value);
1585
- return JSON.stringify(value, (field, value) => {
1586
- if (!value)
1587
- return value;
1588
- if (typeof value !== 'object' && typeof value !== 'function')
1589
- return value;
1590
- if (Array.isArray(value))
1591
- return value;
1592
- const proto = Reflect.getPrototypeOf(value);
1593
- if (!proto)
1594
- return value;
1595
- if (Reflect.getPrototypeOf(proto) === null)
1596
- return value;
1597
- if ('toJSON' in value)
1598
- return value;
1599
- if (value instanceof RegExp)
1600
- return value.toString();
1601
- let key = $.$mol_key_store.get(value);
1602
- if (key)
1603
- return key;
1604
- key = $mol_guid();
1605
- $.$mol_key_store.set(value, key);
1606
- return key;
1607
- });
1608
- }
1609
- $.$mol_key = $mol_key;
1610
- })($ || ($ = {}));
1611
- //mol/key/key.ts
1612
- ;
1613
- "use strict";
1614
- var $;
1615
- (function ($) {
1616
- $.$mol_compare_deep_cache = new WeakMap();
1617
- function $mol_compare_deep(left, right) {
1618
- if (Object.is(left, right))
1619
- return true;
1620
- if (left === null)
1621
- return false;
1622
- if (right === null)
1623
- return false;
1624
- if (typeof left !== 'object')
1625
- return false;
1626
- if (typeof right !== 'object')
1627
- return false;
1628
- const left_proto = Reflect.getPrototypeOf(left);
1629
- const right_proto = Reflect.getPrototypeOf(right);
1630
- if (left_proto !== right_proto)
1631
- return false;
1632
- if (left instanceof Boolean)
1633
- return Object.is(left.valueOf(), right['valueOf']());
1634
- if (left instanceof Number)
1635
- return Object.is(left.valueOf(), right['valueOf']());
1636
- if (left instanceof String)
1637
- return Object.is(left.valueOf(), right['valueOf']());
1638
- if (left instanceof Date)
1639
- return Object.is(left.valueOf(), right['valueOf']());
1640
- if (left instanceof RegExp)
1641
- return left.source === right['source'] && left.flags === right['flags'];
1642
- if (left instanceof Error)
1643
- return left.message === right['message'] && left.stack === right['stack'];
1644
- let left_cache = $.$mol_compare_deep_cache.get(left);
1645
- if (left_cache) {
1646
- const right_cache = left_cache.get(right);
1647
- if (typeof right_cache === 'boolean')
1648
- return right_cache;
1603
+ toJSON() {
1604
+ if (!this.type)
1605
+ return this.value;
1606
+ if (this.type === 'true')
1607
+ return true;
1608
+ if (this.type === 'false')
1609
+ return false;
1610
+ if (this.type === 'null')
1611
+ return null;
1612
+ if (this.type === '*') {
1613
+ var obj = {};
1614
+ for (var child of this.sub) {
1615
+ if (child.type === '-')
1616
+ continue;
1617
+ var key = child.type || child.clone({ sub: child.sub.slice(0, child.sub.length - 1) }).value;
1618
+ var val = child.sub[child.sub.length - 1].toJSON();
1619
+ if (val !== undefined)
1620
+ obj[key] = val;
1621
+ }
1622
+ return obj;
1623
+ }
1624
+ if (this.type === '/') {
1625
+ var res = [];
1626
+ this.sub.forEach(child => {
1627
+ if (child.type === '-')
1628
+ return;
1629
+ var val = child.toJSON();
1630
+ if (val !== undefined)
1631
+ res.push(val);
1632
+ });
1633
+ return res;
1634
+ }
1635
+ if (this.type === 'time') {
1636
+ return new Date(this.value);
1637
+ }
1638
+ const numb = Number(this.type);
1639
+ if (!Number.isNaN(numb) || this.type === 'NaN')
1640
+ return numb;
1641
+ throw new Error(`Unknown type (${this.type}) at ${this.uri}`);
1649
1642
  }
1650
- else {
1651
- left_cache = new WeakMap([[right, true]]);
1652
- $.$mol_compare_deep_cache.set(left, left_cache);
1643
+ get value() {
1644
+ var values = [];
1645
+ for (var child of this.sub) {
1646
+ if (child.type)
1647
+ continue;
1648
+ values.push(child.value);
1649
+ }
1650
+ return this.data + values.join("\n");
1653
1651
  }
1654
- let result;
1655
- try {
1656
- if (left_proto && !Reflect.getPrototypeOf(left_proto))
1657
- result = compare_pojo(left, right);
1658
- else if (Array.isArray(left))
1659
- result = compare_array(left, right);
1660
- else if (left instanceof Set)
1661
- result = compare_set(left, right);
1662
- else if (left instanceof Map)
1663
- result = compare_map(left, right);
1664
- else if (ArrayBuffer.isView(left))
1665
- result = compare_buffer(left, right);
1666
- else if (Symbol.toPrimitive in left)
1667
- result = compare_primitive(left, right);
1668
- else
1669
- result = false;
1652
+ insert(value, ...path) {
1653
+ if (path.length === 0)
1654
+ return value;
1655
+ const type = path[0];
1656
+ if (typeof type === 'string') {
1657
+ let replaced = false;
1658
+ const sub = this.sub.map((item, index) => {
1659
+ if (item.type !== type)
1660
+ return item;
1661
+ replaced = true;
1662
+ return item.insert(value, ...path.slice(1));
1663
+ });
1664
+ if (!replaced)
1665
+ sub.push(new $mol_tree({ type }).insert(value, ...path.slice(1)));
1666
+ return this.clone({ sub });
1667
+ }
1668
+ else if (typeof type === 'number') {
1669
+ const sub = this.sub.slice();
1670
+ sub[type] = (sub[type] || new $mol_tree).insert(value, ...path.slice(1));
1671
+ return this.clone({ sub });
1672
+ }
1673
+ else {
1674
+ return this.clone({ sub: ((this.sub.length === 0) ? [new $mol_tree()] : this.sub).map(item => item.insert(value, ...path.slice(1))) });
1675
+ }
1670
1676
  }
1671
- finally {
1672
- left_cache.set(right, result);
1677
+ select(...path) {
1678
+ var next = [this];
1679
+ for (var type of path) {
1680
+ if (!next.length)
1681
+ break;
1682
+ var prev = next;
1683
+ next = [];
1684
+ for (var item of prev) {
1685
+ switch (typeof (type)) {
1686
+ case 'string':
1687
+ for (var child of item.sub) {
1688
+ if (!type || (child.type == type)) {
1689
+ next.push(child);
1690
+ }
1691
+ }
1692
+ break;
1693
+ case 'number':
1694
+ if (type < item.sub.length)
1695
+ next.push(item.sub[type]);
1696
+ break;
1697
+ default: next.push(...item.sub);
1698
+ }
1699
+ }
1700
+ }
1701
+ return new $mol_tree({ sub: next });
1673
1702
  }
1674
- return result;
1675
- }
1676
- $.$mol_compare_deep = $mol_compare_deep;
1677
- function compare_array(left, right) {
1678
- const len = left.length;
1679
- if (len !== right.length)
1680
- return false;
1681
- for (let i = 0; i < len; ++i) {
1682
- if (!$mol_compare_deep(left[i], right[i]))
1683
- return false;
1703
+ filter(path, value) {
1704
+ var sub = this.sub.filter(function (item) {
1705
+ var found = item.select(...path);
1706
+ if (value == null) {
1707
+ return Boolean(found.sub.length);
1708
+ }
1709
+ else {
1710
+ return found.sub.some(child => child.value == value);
1711
+ }
1712
+ });
1713
+ return new $mol_tree({ sub: sub });
1684
1714
  }
1685
- return true;
1686
- }
1687
- function compare_buffer(left, right) {
1688
- const len = left.byteLength;
1689
- if (len !== right.byteLength)
1690
- return false;
1691
- for (let i = 0; i < len; ++i) {
1692
- if (left[i] !== right[i])
1693
- return false;
1715
+ transform(visit, stack = []) {
1716
+ const sub_stack = [this, ...stack];
1717
+ return visit(sub_stack, () => this.sub.map(node => node.transform(visit, sub_stack)).filter(n => n));
1694
1718
  }
1695
- return true;
1696
- }
1697
- function compare_iterator(left, right) {
1698
- while (true) {
1699
- const left_next = left.next();
1700
- const right_next = right.next();
1701
- if (left_next.done !== right_next.done)
1702
- return false;
1703
- if (left_next.done)
1704
- break;
1705
- if (!$mol_compare_deep(left_next.value, right_next.value))
1706
- return false;
1719
+ hack(context) {
1720
+ const sub = [].concat(...this.sub.map(child => {
1721
+ const handle = context[child.type] || context[''];
1722
+ if (!handle)
1723
+ $mol_fail(child.error('Handler not defined'));
1724
+ return handle(child, context);
1725
+ }));
1726
+ return this.clone({ sub });
1707
1727
  }
1708
- return true;
1709
- }
1710
- function compare_set(left, right) {
1711
- if (left.size !== right.size)
1712
- return false;
1713
- return compare_iterator(left.values(), right.values());
1714
- }
1715
- function compare_map(left, right) {
1716
- if (left.size !== right.size)
1717
- return false;
1718
- return compare_iterator(left.keys(), right.keys())
1719
- && compare_iterator(left.values(), right.values());
1720
- }
1721
- function compare_pojo(left, right) {
1722
- const left_keys = Object.getOwnPropertyNames(left);
1723
- const right_keys = Object.getOwnPropertyNames(right);
1724
- if (left_keys.length !== right_keys.length)
1725
- return false;
1726
- for (let key of left_keys) {
1727
- if (!$mol_compare_deep(left[key], Reflect.get(right, key)))
1728
- return false;
1728
+ error(message) {
1729
+ return new Error(`${message}:\n${this} ${this.baseUri}:${this.row}:${this.col}`);
1729
1730
  }
1730
- return true;
1731
- }
1732
- function compare_primitive(left, right) {
1733
- return Object.is(left[Symbol.toPrimitive]('default'), right[Symbol.toPrimitive]('default'));
1734
1731
  }
1732
+ $.$mol_tree = $mol_tree;
1735
1733
  })($ || ($ = {}));
1736
- //mol/compare/deep/deep.ts
1734
+ //mol/tree/tree.ts
1737
1735
  ;
1738
1736
  "use strict";
1739
1737
  var $;
1740
1738
  (function ($) {
1741
- class $mol_wire_task extends $mol_wire_fiber {
1742
- static getter(task) {
1743
- return function $mol_wire_task_get(host, args) {
1744
- const sub = $mol_wire_auto();
1745
- const existen = sub?.track_next();
1746
- reuse: if (existen) {
1747
- if (!(existen instanceof $mol_wire_task))
1748
- break reuse;
1749
- if (existen.host !== host)
1750
- break reuse;
1751
- if (existen.task !== task)
1752
- break reuse;
1753
- if (!$mol_compare_deep(existen.args, args))
1754
- break reuse;
1755
- return existen;
1756
- }
1757
- return new $mol_wire_task(`${host?.[Symbol.toStringTag] ?? host}.${task.name}(#)`, task, host, args);
1758
- };
1759
- }
1760
- complete() {
1761
- if (this.cache instanceof Promise)
1762
- return;
1763
- this.destructor();
1764
- }
1765
- put(next) {
1766
- const prev = this.cache;
1767
- this.cache = next;
1768
- if (next instanceof Promise) {
1769
- this.cursor = $mol_wire_cursor.fresh;
1770
- if (next !== prev)
1771
- this.emit();
1772
- return next;
1773
- }
1774
- this.cursor = $mol_wire_cursor.final;
1775
- if (this.sub_empty)
1776
- this.destructor();
1777
- else if (next !== prev)
1778
- this.emit();
1779
- return next;
1739
+ class $mol_term_color {
1740
+ static reset = this.ansi(0, 0);
1741
+ static bold = this.ansi(1, 22);
1742
+ static italic = this.ansi(3, 23);
1743
+ static underline = this.ansi(4, 24);
1744
+ static inverse = this.ansi(7, 27);
1745
+ static hidden = this.ansi(8, 28);
1746
+ static strike = this.ansi(9, 29);
1747
+ static gray = this.ansi(90, 39);
1748
+ static red = this.ansi(91, 39);
1749
+ static green = this.ansi(92, 39);
1750
+ static yellow = this.ansi(93, 39);
1751
+ static blue = this.ansi(94, 39);
1752
+ static magenta = this.ansi(95, 39);
1753
+ static cyan = this.ansi(96, 39);
1754
+ static Gray = (str) => this.inverse(this.gray(str));
1755
+ static Red = (str) => this.inverse(this.red(str));
1756
+ static Green = (str) => this.inverse(this.green(str));
1757
+ static Yellow = (str) => this.inverse(this.yellow(str));
1758
+ static Blue = (str) => this.inverse(this.blue(str));
1759
+ static Magenta = (str) => this.inverse(this.magenta(str));
1760
+ static Cyan = (str) => this.inverse(this.cyan(str));
1761
+ static ansi(open, close) {
1762
+ if (typeof process === 'undefined')
1763
+ return String;
1764
+ if (!process.stdout.isTTY)
1765
+ return String;
1766
+ const prefix = `\x1b[${open}m`;
1767
+ const postfix = `\x1b[${close}m`;
1768
+ const suffix_regexp = new RegExp(postfix.replace('[', '\\['), 'g');
1769
+ return function colorer(str) {
1770
+ str = String(str);
1771
+ if (str === '')
1772
+ return str;
1773
+ const suffix = str.replace(suffix_regexp, prefix);
1774
+ return prefix + suffix + postfix;
1775
+ };
1780
1776
  }
1781
1777
  }
1782
- $.$mol_wire_task = $mol_wire_task;
1778
+ $.$mol_term_color = $mol_term_color;
1783
1779
  })($ || ($ = {}));
1784
- //mol/wire/task/task.ts
1780
+ //mol/term/color/color.ts
1785
1781
  ;
1786
1782
  "use strict";
1787
1783
  var $;
1788
1784
  (function ($) {
1789
- function $mol_wire_method(host, field, descr) {
1790
- if (!descr)
1791
- descr = Reflect.getOwnPropertyDescriptor(host, field);
1792
- const orig = descr?.value ?? host[field];
1793
- const sup = Reflect.getPrototypeOf(host);
1794
- if (typeof sup[field] === 'function') {
1795
- Object.defineProperty(orig, 'name', { value: sup[field].name });
1796
- }
1797
- const temp = $mol_wire_task.getter(orig);
1798
- const value = function (...args) {
1799
- const fiber = temp(this ?? null, args);
1800
- return fiber.sync();
1785
+ function $mol_log3_node_make(level, output, type, color) {
1786
+ return function $mol_log3_logger(event) {
1787
+ if (!event.time)
1788
+ event = { time: new Date().toISOString(), ...event };
1789
+ const tree = this.$mol_tree.fromJSON(event).clone({ type });
1790
+ let str = color(tree.toString());
1791
+ this.console[level](str);
1792
+ const self = this;
1793
+ return () => self.console.groupEnd();
1801
1794
  };
1802
- Object.defineProperty(value, 'name', { value: orig.name + ' ' });
1803
- Object.assign(value, { orig });
1804
- const descr2 = { ...descr, value };
1805
- Reflect.defineProperty(host, field, descr2);
1806
- return descr2;
1807
- }
1808
- $.$mol_wire_method = $mol_wire_method;
1809
- })($ || ($ = {}));
1810
- //mol/wire/method/method.ts
1811
- ;
1812
- "use strict";
1813
- //mol/type/tail/tail.ts
1814
- ;
1815
- "use strict";
1816
- //mol/type/foot/foot.ts
1817
- ;
1818
- "use strict";
1819
- var $;
1820
- (function ($) {
1821
- const catched = new WeakMap();
1822
- function $mol_fail_catch(error) {
1823
- if (typeof error !== 'object')
1824
- return false;
1825
- if (error instanceof Promise)
1826
- $mol_fail_hidden(error);
1827
- if (catched.get(error))
1828
- return false;
1829
- catched.set(error, true);
1830
- return true;
1831
1795
  }
1832
- $.$mol_fail_catch = $mol_fail_catch;
1796
+ $.$mol_log3_node_make = $mol_log3_node_make;
1797
+ $.$mol_log3_come = $mol_log3_node_make('info', 'stdout', 'come', $mol_term_color.blue);
1798
+ $.$mol_log3_done = $mol_log3_node_make('info', 'stdout', 'done', $mol_term_color.green);
1799
+ $.$mol_log3_fail = $mol_log3_node_make('error', 'stderr', 'fail', $mol_term_color.red);
1800
+ $.$mol_log3_warn = $mol_log3_node_make('warn', 'stderr', 'warn', $mol_term_color.yellow);
1801
+ $.$mol_log3_rise = $mol_log3_node_make('log', 'stdout', 'rise', $mol_term_color.magenta);
1802
+ $.$mol_log3_area = $mol_log3_node_make('log', 'stdout', 'area', $mol_term_color.cyan);
1833
1803
  })($ || ($ = {}));
1834
- //mol/fail/catch/catch.ts
1804
+ //mol/log3/log3.node.ts
1835
1805
  ;
1836
1806
  "use strict";
1837
1807
  var $;
1838
1808
  (function ($) {
1839
- function $mol_fail_log(error) {
1840
- if (error instanceof Promise)
1841
- return false;
1842
- if (!$mol_fail_catch(error))
1843
- return false;
1844
- console.error(error);
1845
- return true;
1809
+ function $mol_env() {
1810
+ return {};
1846
1811
  }
1847
- $.$mol_fail_log = $mol_fail_log;
1812
+ $.$mol_env = $mol_env;
1848
1813
  })($ || ($ = {}));
1849
- //mol/fail/log/log.ts
1814
+ //mol/env/env.ts
1850
1815
  ;
1851
1816
  "use strict";
1852
1817
  var $;
1853
1818
  (function ($) {
1854
- class $mol_wire_atom extends $mol_wire_fiber {
1855
- static solo(host, task) {
1856
- const field = task.name + '()';
1857
- const existen = Object.getOwnPropertyDescriptor(host ?? task, field)?.value;
1858
- if (existen)
1859
- return existen;
1860
- const prefix = host?.[Symbol.toStringTag] ?? (host instanceof Function ? $$.$mol_func_name(host) : host);
1861
- const key = `${prefix}.${field}`;
1862
- const fiber = new $mol_wire_atom(key, task, host, []);
1863
- (host ?? task)[field] = fiber;
1864
- return fiber;
1865
- }
1866
- static plex(host, task, key) {
1867
- const field = task.name + '()';
1868
- let dict = Object.getOwnPropertyDescriptor(host ?? task, field)?.value;
1869
- const prefix = host?.[Symbol.toStringTag] ?? (host instanceof Function ? $$.$mol_func_name(host) : host);
1870
- const id = `${prefix}.${task.name}(${$mol_key(key)})`;
1871
- if (dict) {
1872
- const existen = dict.get(id);
1873
- if (existen)
1874
- return existen;
1875
- }
1876
- else {
1877
- dict = (host ?? task)[field] = new Map();
1878
- }
1879
- const fiber = new $mol_wire_atom(id, task, host, [key]);
1880
- dict.set(id, fiber);
1881
- return fiber;
1882
- }
1883
- static watching = new Set();
1884
- static watcher = null;
1885
- static watch() {
1886
- $mol_wire_atom.watcher = new $mol_after_frame($mol_wire_atom.watch);
1887
- for (const atom of $mol_wire_atom.watching) {
1888
- if (atom.cursor === $mol_wire_cursor.final) {
1889
- $mol_wire_atom.watching.delete(atom);
1890
- }
1891
- else {
1892
- atom.cursor = $mol_wire_cursor.stale;
1893
- atom.fresh();
1894
- }
1895
- }
1896
- }
1897
- watch() {
1898
- if (!$mol_wire_atom.watcher) {
1899
- $mol_wire_atom.watcher = new $mol_after_frame($mol_wire_atom.watch);
1900
- }
1901
- $mol_wire_atom.watching.add(this);
1902
- }
1903
- resync(args) {
1904
- return this.put(this.task.call(this.host, ...args));
1905
- }
1906
- once() {
1907
- return this.sync();
1908
- }
1909
- channel() {
1910
- return Object.assign((next) => {
1911
- if (next !== undefined)
1912
- return this.resync([...this.args, next]);
1913
- if (!$mol_wire_fiber.warm)
1914
- return this.result();
1915
- if ($mol_wire_auto() instanceof $mol_wire_task) {
1916
- return this.once();
1917
- }
1918
- else {
1919
- return this.sync();
1920
- }
1921
- }, { atom: this });
1922
- }
1923
- destructor() {
1924
- super.destructor();
1925
- const prev = this.cache;
1926
- if ($mol_owning_check(this, prev)) {
1927
- prev.destructor();
1928
- }
1929
- if (this.pub_from === 0) {
1930
- ;
1931
- (this.host ?? this.task)[this.field()] = null;
1932
- }
1933
- else {
1934
- ;
1935
- (this.host ?? this.task)[this.field()].delete(this[Symbol.toStringTag]);
1936
- }
1937
- }
1938
- put(next) {
1939
- const prev = this.cache;
1940
- update: if (next !== prev) {
1941
- try {
1942
- if ($mol_compare_deep(prev, next))
1943
- break update;
1944
- }
1945
- catch (error) {
1946
- $mol_fail_log(error);
1947
- }
1948
- if ($mol_owning_check(this, prev)) {
1949
- prev.destructor();
1950
- }
1951
- if ($mol_owning_catch(this, next)) {
1952
- try {
1953
- next[Symbol.toStringTag] = this[Symbol.toStringTag];
1954
- }
1955
- catch {
1956
- Object.defineProperty(next, Symbol.toStringTag, { value: this[Symbol.toStringTag] });
1957
- }
1958
- }
1959
- if (!this.sub_empty)
1960
- this.emit();
1961
- }
1962
- this.cache = next;
1963
- this.cursor = $mol_wire_cursor.fresh;
1964
- if (next instanceof Promise)
1965
- return next;
1966
- this.complete_pubs();
1967
- return next;
1968
- }
1969
- }
1970
- __decorate([
1971
- $mol_wire_method
1972
- ], $mol_wire_atom.prototype, "resync", null);
1973
- __decorate([
1974
- $mol_wire_method
1975
- ], $mol_wire_atom.prototype, "once", null);
1976
- $.$mol_wire_atom = $mol_wire_atom;
1819
+ $.$mol_env = function $mol_env() {
1820
+ return this.process.env;
1821
+ };
1977
1822
  })($ || ($ = {}));
1978
- //mol/wire/atom/atom.ts
1823
+ //mol/env/env.node.ts
1979
1824
  ;
1980
1825
  "use strict";
1981
1826
  var $;
1982
1827
  (function ($) {
1983
- function $mol_wire_solo(host, field, descr) {
1984
- if (!descr)
1985
- descr = Reflect.getOwnPropertyDescriptor(host, field);
1986
- const orig = descr?.value ?? host[field];
1987
- const sup = Reflect.getPrototypeOf(host);
1988
- if (typeof sup[field] === 'function') {
1989
- Object.defineProperty(orig, 'name', { value: sup[field].name });
1990
- }
1991
- const descr2 = {
1992
- ...descr,
1993
- value: function (...args) {
1994
- let atom = $mol_wire_atom.solo(this, orig);
1995
- if ((args.length === 0) || (args[0] === undefined)) {
1996
- if (!$mol_wire_fiber.warm)
1997
- return atom.result();
1998
- if ($mol_wire_auto() instanceof $mol_wire_task) {
1999
- return atom.once();
2000
- }
2001
- else {
2002
- return atom.sync();
2003
- }
2004
- }
2005
- return atom.resync(args);
2006
- }
2007
- };
2008
- Reflect.defineProperty(descr2.value, 'name', { value: orig.name + ' ' });
2009
- Object.assign(descr2.value, { orig });
2010
- Reflect.defineProperty(host, field, descr2);
2011
- return descr2;
1828
+ function $mol_exec(dir, command, ...args) {
1829
+ let [app, ...args0] = command.split(' ');
1830
+ args = [...args0, ...args];
1831
+ this.$mol_log3_come({
1832
+ place: '$mol_exec',
1833
+ dir: $node.path.relative('', dir),
1834
+ message: 'Run',
1835
+ command: `${app} ${args.join(' ')}`,
1836
+ });
1837
+ var res = $node['child_process'].spawnSync(app, args, {
1838
+ cwd: $node.path.resolve(dir),
1839
+ shell: true,
1840
+ env: this.$mol_env(),
1841
+ });
1842
+ if (res.status || res.error)
1843
+ return $mol_fail(res.error || new Error(res.stderr.toString()));
1844
+ if (!res.stdout)
1845
+ res.stdout = Buffer.from([]);
1846
+ return res;
2012
1847
  }
2013
- $.$mol_wire_solo = $mol_wire_solo;
1848
+ $.$mol_exec = $mol_exec;
2014
1849
  })($ || ($ = {}));
2015
- //mol/wire/solo/solo.ts
1850
+ //mol/exec/exec.node.ts
2016
1851
  ;
2017
1852
  "use strict";
2018
1853
  var $;
2019
1854
  (function ($) {
2020
- function $mol_wire_plex(host, field, descr) {
2021
- if (!descr)
2022
- descr = Reflect.getOwnPropertyDescriptor(host, field);
2023
- const orig = descr?.value ?? host[field];
2024
- const sup = Reflect.getPrototypeOf(host);
2025
- if (typeof sup[field] === 'function') {
2026
- Object.defineProperty(orig, 'name', { value: sup[field].name });
2027
- }
2028
- const descr2 = {
2029
- ...descr,
2030
- value: function (...args) {
2031
- let atom = $mol_wire_atom.plex(this, orig, args[0]);
2032
- if ((args.length === 1) || (args[1] === undefined)) {
2033
- if (!$mol_wire_fiber.warm)
2034
- return atom.result();
2035
- if ($mol_wire_auto() instanceof $mol_wire_task) {
2036
- return atom.once();
2037
- }
2038
- else {
2039
- return atom.sync();
2040
- }
2041
- }
2042
- return atom.resync(args);
2043
- }
2044
- };
2045
- Reflect.defineProperty(descr2.value, 'name', { value: orig.name + ' ' });
2046
- Object.assign(descr2.value, { orig });
2047
- Reflect.defineProperty(host, field, descr2);
2048
- return descr2;
2049
- }
2050
- $.$mol_wire_plex = $mol_wire_plex;
1855
+ $.$mol_dom_context = new $node.jsdom.JSDOM('', { url: 'https://localhost/' }).window;
2051
1856
  })($ || ($ = {}));
2052
- //mol/wire/plex/plex.ts
1857
+ //mol/dom/context/context.node.ts
2053
1858
  ;
2054
1859
  "use strict";
2055
1860
  var $;
2056
1861
  (function ($) {
2057
- $.$mol_mem = $mol_wire_solo;
2058
- $.$mol_mem_key = $mol_wire_plex;
1862
+ class $mol_after_tick extends $mol_object2 {
1863
+ task;
1864
+ promise;
1865
+ cancelled = false;
1866
+ constructor(task) {
1867
+ super();
1868
+ this.task = task;
1869
+ this.promise = Promise.resolve().then(() => {
1870
+ if (this.cancelled)
1871
+ return;
1872
+ task();
1873
+ });
1874
+ }
1875
+ destructor() {
1876
+ this.cancelled = true;
1877
+ }
1878
+ }
1879
+ $.$mol_after_tick = $mol_after_tick;
2059
1880
  })($ || ($ = {}));
2060
- //mol/mem/mem.ts
1881
+ //mol/after/tick/tick.ts
2061
1882
  ;
2062
1883
  "use strict";
2063
1884
  var $;
@@ -2381,9 +2202,181 @@ var $;
2381
2202
  "use strict";
2382
2203
  var $;
2383
2204
  (function ($) {
2384
- $mol_style_attach("mol/view/view/view.css", "[mol_view] {\n\ttransition-property: height, width, min-height, min-width, max-width, max-height, transform;\n\ttransition-duration: .2s;\n\ttransition-timing-function: ease-out;\n\t-webkit-appearance: none;\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\tflex-shrink: 0;\n\tcontain: style;\n\tscrollbar-color: var(--mol_theme_line) transparent;\n\tscrollbar-width: thin;\n}\t\n\n[mol_view]::selection {\n\tbackground: var(--mol_theme_line);\n}\t\n\n[mol_view]::-webkit-scrollbar {\n\twidth: .25rem;\n\theight: .25rem;\n}\n\n[mol_view]::-webkit-scrollbar-corner {\n\tbackground-color: var(--mol_theme_line);\n}\n\n[mol_view]::-webkit-scrollbar-track {\n\tbackground-color: transparent;\n}\n\n[mol_view]::-webkit-scrollbar-thumb {\n\tbackground-color: var(--mol_theme_line);\n\tborder-radius: var(--mol_gap_round);\n}\n\n[mol_view] > * {\n\tword-break: inherit;\n}\n\n[mol_view_root] {\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 100%;\n\theight: 100%;\n\tbox-sizing: border-box;\n\tfont-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\n\tfont-size: 1rem;\n\tline-height: 1.5rem;\n\tbackground: var(--mol_theme_back);\n\tcolor: var(--mol_theme_text);\n\tcontain: unset; /** Fixes bg ignoring when applied to body on Chrome */\n\ttab-size: 4;\n}\n\n[mol_view][mol_view_error]:not([mol_view_error=\"Promise\"]) {\n\tbackground-image: repeating-linear-gradient(\n\t\t-45deg,\n\t\t#f92323,\n\t\t#f92323 .5rem,\n\t\t#ff3d3d .5rem,\n\t\t#ff3d3d 1.5rem\n\t);\n\tcolor: black;\n\talign-items: center;\n justify-content: center;\n}\n\n@keyframes mol_view_wait_move {\n\tfrom {\n\t\tbackground-position: 0 0;\n\t}\n\tto {\n\t\tbackground-position: 200vmax 0;\n\t}\n}\n\n@keyframes mol_view_wait_show {\n\tto {\n\t\tbackground-image: repeating-linear-gradient(\n\t\t\t45deg,\n\t\t\thsla( 0 , 0% , 50% , .5 ) 0% ,\n\t\t\thsla( 0 , 0% , 50% , 0 ) 5% ,\n\t\t\thsla( 0 , 0% , 50% , 0 ) 45% ,\n\t\t\thsla( 0 , 0% , 50% , .5 ) 50% ,\n\t\t\thsla( 0 , 0% , 50% , 0 ) 55% ,\n\t\t\thsla( 0 , 0% , 50% , 0 ) 95% ,\n\t\t\thsla( 0 , 0% , 50% , .5 ) 100%\n\t\t);\n\t\tbackground-size: 200vmax 200vmax;\n\t}\n}\n\n[mol_view][mol_view_error=\"Promise\"] {\n\tanimation: mol_view_wait_show .5s .5s linear forwards , mol_view_wait_move 1s linear infinite;\n\topacity: .75;\n}\n");
2205
+ let all = [];
2206
+ let el = null;
2207
+ let timer = null;
2208
+ function $mol_style_attach(id, text) {
2209
+ all.push(`/* ${id} */\n\n${text}`);
2210
+ if (timer)
2211
+ return el;
2212
+ const doc = $mol_dom_context.document;
2213
+ if (!doc)
2214
+ return null;
2215
+ el = doc.createElement('style');
2216
+ el.id = `$mol_style_attach`;
2217
+ doc.head.appendChild(el);
2218
+ timer = new $mol_after_tick(() => {
2219
+ el.innerHTML = '\n' + all.join('\n\n');
2220
+ all = [];
2221
+ el = null;
2222
+ timer = null;
2223
+ });
2224
+ return el;
2225
+ }
2226
+ $.$mol_style_attach = $mol_style_attach;
2385
2227
  })($ || ($ = {}));
2386
- //mol/view/view/-css/view.css.ts
2228
+ //mol/style/attach/attach.ts
2229
+ ;
2230
+ "use strict";
2231
+ var $;
2232
+ (function ($) {
2233
+ class $mol_decor {
2234
+ value;
2235
+ constructor(value) {
2236
+ this.value = value;
2237
+ }
2238
+ prefix() { return ''; }
2239
+ valueOf() { return this.value; }
2240
+ postfix() { return ''; }
2241
+ toString() {
2242
+ return `${this.prefix()}${this.valueOf()}${this.postfix()}`;
2243
+ }
2244
+ }
2245
+ $.$mol_decor = $mol_decor;
2246
+ })($ || ($ = {}));
2247
+ //mol/decor/decor.ts
2248
+ ;
2249
+ "use strict";
2250
+ var $;
2251
+ (function ($) {
2252
+ class $mol_style_unit extends $mol_decor {
2253
+ literal;
2254
+ constructor(value, literal) {
2255
+ super(value);
2256
+ this.literal = literal;
2257
+ }
2258
+ postfix() {
2259
+ return this.literal;
2260
+ }
2261
+ static per(value) { return new $mol_style_unit(value, '%'); }
2262
+ static px(value) { return new $mol_style_unit(value, 'px'); }
2263
+ static mm(value) { return new $mol_style_unit(value, 'mm'); }
2264
+ static cm(value) { return new $mol_style_unit(value, 'cm'); }
2265
+ static Q(value) { return new $mol_style_unit(value, 'Q'); }
2266
+ static in(value) { return new $mol_style_unit(value, 'in'); }
2267
+ static pc(value) { return new $mol_style_unit(value, 'pc'); }
2268
+ static pt(value) { return new $mol_style_unit(value, 'pt'); }
2269
+ static cap(value) { return new $mol_style_unit(value, 'cap'); }
2270
+ static ch(value) { return new $mol_style_unit(value, 'ch'); }
2271
+ static em(value) { return new $mol_style_unit(value, 'em'); }
2272
+ static rem(value) { return new $mol_style_unit(value, 'rem'); }
2273
+ static ex(value) { return new $mol_style_unit(value, 'ex'); }
2274
+ static ic(value) { return new $mol_style_unit(value, 'ic'); }
2275
+ static lh(value) { return new $mol_style_unit(value, 'lh'); }
2276
+ static rlh(value) { return new $mol_style_unit(value, 'rlh'); }
2277
+ static vh(value) { return new $mol_style_unit(value, 'vh'); }
2278
+ static vw(value) { return new $mol_style_unit(value, 'vw'); }
2279
+ static vi(value) { return new $mol_style_unit(value, 'vi'); }
2280
+ static vb(value) { return new $mol_style_unit(value, 'vb'); }
2281
+ static vmin(value) { return new $mol_style_unit(value, 'vmin'); }
2282
+ static vmax(value) { return new $mol_style_unit(value, 'vmax'); }
2283
+ static deg(value) { return new $mol_style_unit(value, 'deg'); }
2284
+ static rad(value) { return new $mol_style_unit(value, 'rad'); }
2285
+ static grad(value) { return new $mol_style_unit(value, 'grad'); }
2286
+ static turn(value) { return new $mol_style_unit(value, 'turn'); }
2287
+ static s(value) { return new $mol_style_unit(value, 's'); }
2288
+ static ms(value) { return new $mol_style_unit(value, 'ms'); }
2289
+ }
2290
+ $.$mol_style_unit = $mol_style_unit;
2291
+ })($ || ($ = {}));
2292
+ //mol/style/unit/unit.ts
2293
+ ;
2294
+ "use strict";
2295
+ var $;
2296
+ (function ($) {
2297
+ const { per } = $mol_style_unit;
2298
+ class $mol_style_func extends $mol_decor {
2299
+ name;
2300
+ constructor(name, value) {
2301
+ super(value);
2302
+ this.name = name;
2303
+ }
2304
+ prefix() { return this.name + '('; }
2305
+ postfix() { return ')'; }
2306
+ static calc(value) {
2307
+ return new $mol_style_func('calc', value);
2308
+ }
2309
+ static vary(name) {
2310
+ return new $mol_style_func('var', name);
2311
+ }
2312
+ static url(href) {
2313
+ return new $mol_style_func('url', JSON.stringify(href));
2314
+ }
2315
+ static hsla(hue, saturation, lightness, alpha) {
2316
+ return new $mol_style_func('hsla', [hue, per(saturation), per(lightness), alpha]);
2317
+ }
2318
+ static clamp(min, mid, max) {
2319
+ return new $mol_style_func('clamp', [min, mid, max]);
2320
+ }
2321
+ static rgba(red, green, blue, alpha) {
2322
+ return new $mol_style_func('rgba', [red, green, blue, alpha]);
2323
+ }
2324
+ static scale(zoom) {
2325
+ return new $mol_style_func('scale', [zoom]);
2326
+ }
2327
+ }
2328
+ $.$mol_style_func = $mol_style_func;
2329
+ })($ || ($ = {}));
2330
+ //mol/style/func/func.ts
2331
+ ;
2332
+ "use strict";
2333
+ var $;
2334
+ (function ($) {
2335
+ const { vary } = $mol_style_func;
2336
+ $.$mol_theme = {
2337
+ back: vary('--mol_theme_back'),
2338
+ hover: vary('--mol_theme_hover'),
2339
+ card: vary('--mol_theme_card'),
2340
+ current: vary('--mol_theme_current'),
2341
+ special: vary('--mol_theme_special'),
2342
+ text: vary('--mol_theme_text'),
2343
+ control: vary('--mol_theme_control'),
2344
+ shade: vary('--mol_theme_shade'),
2345
+ line: vary('--mol_theme_line'),
2346
+ focus: vary('--mol_theme_focus'),
2347
+ field: vary('--mol_theme_field'),
2348
+ image: vary('--mol_theme_image'),
2349
+ };
2350
+ })($ || ($ = {}));
2351
+ //mol/theme/theme.ts
2352
+ ;
2353
+ "use strict";
2354
+ var $;
2355
+ (function ($) {
2356
+ $mol_style_attach("mol/theme/theme.css", ":root {\n\t--mol_theme_hue: 210deg;\n\t--mol_theme_luma: -1;\n\t--mol_theme_satur: 1;\n\t--mol_theme_image: none;\n}\n\n[mol_theme] {\n\tcolor: var(--mol_theme_text);\n\tfill: var(--mol_theme_text);\n}\n:where([mol_theme]) {\n\tbackground-color: var(--mol_theme_back);\n}\n\t\n:root, [mol_theme] {\n\t--mol_theme_back: hsl( var(--mol_theme_hue), calc( var(--mol_theme_satur) * 20% ), calc( 55% + 45% * var(--mol_theme_luma) ) );\n\t--mol_theme_text: hsl( var(--mol_theme_hue), 0%, calc( 40% - 40% * var(--mol_theme_luma) ) );\n\t--mol_theme_field: hsl( var(--mol_theme_hue), calc( var(--mol_theme_satur) * 50% ), calc( 54% + 46% * var(--mol_theme_luma) ), .25 );\n\t\n\t--mol_theme_card: hsl( var(--mol_theme_hue), calc( var(--mol_theme_satur) * 50% ), calc( 55% + 35% * var(--mol_theme_luma) ), .25 );\n\t--mol_theme_hover: hsl( var(--mol_theme_hue), 0%, 50%, .1 );\n\t--mol_theme_line: hsl( var(--mol_theme_hue), 0%, 50%, .2 );\n\t--mol_theme_shade: hsl( var(--mol_theme_hue), 0%, 50%, 1 );\n\t\n\t--mol_theme_control: hsl( var(--mol_theme_hue), 50%, calc( 50% - 10% * var(--mol_theme_luma) ) );\n\t--mol_theme_current: hsl( calc( var(--mol_theme_hue) - 90deg ), 50%, calc( 50% - 10% * var(--mol_theme_luma) ) );\n\t--mol_theme_special: hsl( calc( var(--mol_theme_hue) + 90deg ), 50%, calc( 50% - 10% * var(--mol_theme_luma) ) );\n\t--mol_theme_focus: hsl( calc( var(--mol_theme_hue) + 180deg ), 100%, calc( 55% - 10% * var(--mol_theme_luma) ) );\n\t\n}\n\n[mol_theme=\"$mol_theme_light\"] {\n\t--mol_theme_luma: 1;\n\t--mol_theme_image: none;\n}\n\n[mol_theme=\"$mol_theme_dark\"] {\n\t--mol_theme_luma: -1;\n\t--mol_theme_image: invert(1) hue-rotate( 180deg );\n}\n\n[mol_theme=\"$mol_theme_base\"] {\n\t--mol_theme_luma: -2;\n\t--mol_theme_back: hsl( var(--mol_theme_hue), 50%, 40% );\n\t--mol_theme_hover: hsl( var(--mol_theme_hue), 60%, 30% );\n\t--mol_theme_current: hsl( var(--mol_theme_hue), 100%, 20% );\n}\n\n[mol_theme=\"$mol_theme_current\"] {\n\tbackground-color: var(--mol_theme_back);\n\t--mol_theme_back: hsl( calc( var(--mol_theme_hue) - 90deg ), 50%, calc( 50% + 30% * var(--mol_theme_luma) ) );\n}\n\n[mol_theme=\"$mol_theme_special\"] {\n\t--mol_theme_card: hsl( calc( var(--mol_theme_hue) + 90deg ), 50%, calc( 55% + 35% * var(--mol_theme_luma) ), .25 );\n}\n\n[mol_theme=\"$mol_theme_accent\"] {\n\tbackground-color: var(--mol_theme_back);\n\t--mol_theme_luma: -2;\n\t--mol_theme_back: hsl( calc( var(--mol_theme_hue) + 180deg ), 90%, 50% );\n\t--mol_theme_hover: hsl( calc( var(--mol_theme_hue) + 180deg ), 80%, 35% );\n}\n\n[mol_theme=\"$mol_theme_accent\"] [mol_theme=\"$mol_theme_accent\"] {\n\t--mol_theme_back: black;\n}\n");
2357
+ })($ || ($ = {}));
2358
+ //mol/theme/-css/theme.css.ts
2359
+ ;
2360
+ "use strict";
2361
+ var $;
2362
+ (function ($) {
2363
+ const { vary } = $mol_style_func;
2364
+ $.$mol_gap = {
2365
+ block: vary('--mol_gap_block'),
2366
+ text: vary('--mol_gap_text'),
2367
+ round: vary('--mol_gap_round'),
2368
+ space: vary('--mol_gap_space'),
2369
+ blur: vary('--mol_gap_blur'),
2370
+ };
2371
+ })($ || ($ = {}));
2372
+ //mol/gap/gap.ts
2373
+ ;
2374
+ "use strict";
2375
+ var $;
2376
+ (function ($) {
2377
+ $mol_style_attach("mol/gap/gap.css", ":root {\n\t--mol_gap_block: .75rem;\n\t--mol_gap_text: .5rem .75rem;\n\t--mol_gap_round: .25rem;\n\t--mol_gap_space: .25rem;\n\t--mol_gap_blur: .5rem;\n}\n");
2378
+ })($ || ($ = {}));
2379
+ //mol/gap/-css/gap.css.ts
2387
2380
  ;
2388
2381
  "use strict";
2389
2382
  var $;
@@ -2772,13 +2765,50 @@ var $;
2772
2765
  ], $mol_view, "Root", null);
2773
2766
  __decorate([
2774
2767
  $mol_mem
2775
- ], $mol_view, "autobind", null);
2776
- __decorate([
2777
- $mol_memo.method
2778
- ], $mol_view, "view_classes", null);
2779
- $.$mol_view = $mol_view;
2768
+ ], $mol_view, "autobind", null);
2769
+ __decorate([
2770
+ $mol_memo.method
2771
+ ], $mol_view, "view_classes", null);
2772
+ $.$mol_view = $mol_view;
2773
+ })($ || ($ = {}));
2774
+ //mol/view/view/view.ts
2775
+ ;
2776
+ "use strict";
2777
+ var $;
2778
+ (function ($) {
2779
+ $mol_style_attach("mol/view/view/view.css", "[mol_view] {\n\ttransition-property: height, width, min-height, min-width, max-width, max-height, transform;\n\ttransition-duration: .2s;\n\ttransition-timing-function: ease-out;\n\t-webkit-appearance: none;\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\tflex-shrink: 0;\n\tcontain: style;\n\tscrollbar-color: var(--mol_theme_line) transparent;\n\tscrollbar-width: thin;\n}\t\n\n[mol_view]::selection {\n\tbackground: var(--mol_theme_line);\n}\t\n\n[mol_view]::-webkit-scrollbar {\n\twidth: .25rem;\n\theight: .25rem;\n}\n\n[mol_view]::-webkit-scrollbar-corner {\n\tbackground-color: var(--mol_theme_line);\n}\n\n[mol_view]::-webkit-scrollbar-track {\n\tbackground-color: transparent;\n}\n\n[mol_view]::-webkit-scrollbar-thumb {\n\tbackground-color: var(--mol_theme_line);\n\tborder-radius: var(--mol_gap_round);\n}\n\n[mol_view] > * {\n\tword-break: inherit;\n}\n\n[mol_view_root] {\n\tmargin: 0;\n\tpadding: 0;\n\twidth: 100%;\n\theight: 100%;\n\tbox-sizing: border-box;\n\tfont-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\n\tfont-size: 1rem;\n\tline-height: 1.5rem;\n\tbackground: var(--mol_theme_back);\n\tcolor: var(--mol_theme_text);\n\tcontain: unset; /** Fixes bg ignoring when applied to body on Chrome */\n\ttab-size: 4;\n}\n\n[mol_view][mol_view_error]:not([mol_view_error=\"Promise\"]) {\n\tbackground-image: repeating-linear-gradient(\n\t\t-45deg,\n\t\t#f92323,\n\t\t#f92323 .5rem,\n\t\t#ff3d3d .5rem,\n\t\t#ff3d3d 1.5rem\n\t);\n\tcolor: black;\n\talign-items: center;\n justify-content: center;\n}\n\n@keyframes mol_view_wait_move {\n\tfrom {\n\t\tbackground-position: 0 0;\n\t}\n\tto {\n\t\tbackground-position: 200vmax 0;\n\t}\n}\n\n@keyframes mol_view_wait_show {\n\tto {\n\t\tbackground-image: repeating-linear-gradient(\n\t\t\t45deg,\n\t\t\thsla( 0 , 0% , 50% , .5 ) 0% ,\n\t\t\thsla( 0 , 0% , 50% , 0 ) 5% ,\n\t\t\thsla( 0 , 0% , 50% , 0 ) 45% ,\n\t\t\thsla( 0 , 0% , 50% , .5 ) 50% ,\n\t\t\thsla( 0 , 0% , 50% , 0 ) 55% ,\n\t\t\thsla( 0 , 0% , 50% , 0 ) 95% ,\n\t\t\thsla( 0 , 0% , 50% , .5 ) 100%\n\t\t);\n\t\tbackground-size: 200vmax 200vmax;\n\t}\n}\n\n[mol_view][mol_view_error=\"Promise\"] {\n\tanimation: mol_view_wait_show .5s .5s linear forwards , mol_view_wait_move 1s linear infinite;\n\topacity: .75;\n}\n");
2780
+ })($ || ($ = {}));
2781
+ //mol/view/view/-css/view.css.ts
2782
+ ;
2783
+ "use strict";
2784
+ var $;
2785
+ (function ($) {
2786
+ class $mol_plugin extends $mol_view {
2787
+ dom_node(next) {
2788
+ const node = next || $mol_owning_get(this).host.dom_node();
2789
+ $mol_dom_render_attributes(node, this.attr_static());
2790
+ const events = $mol_wire_async(this.event());
2791
+ for (let event_name in events) {
2792
+ node.addEventListener(event_name, events[event_name], { passive: false });
2793
+ }
2794
+ return node;
2795
+ }
2796
+ attr_static() {
2797
+ return {};
2798
+ }
2799
+ event() {
2800
+ return {};
2801
+ }
2802
+ render() {
2803
+ this.dom_node_actual();
2804
+ }
2805
+ }
2806
+ __decorate([
2807
+ $mol_mem
2808
+ ], $mol_plugin.prototype, "dom_node", null);
2809
+ $.$mol_plugin = $mol_plugin;
2780
2810
  })($ || ($ = {}));
2781
- //mol/view/view/view.ts
2811
+ //mol/plugin/plugin.ts
2782
2812
  ;
2783
2813
  "use strict";
2784
2814
  var $;
@@ -2833,36 +2863,6 @@ var $;
2833
2863
  ;
2834
2864
  "use strict";
2835
2865
  var $;
2836
- (function ($) {
2837
- class $mol_plugin extends $mol_view {
2838
- dom_node(next) {
2839
- const node = next || $mol_owning_get(this).host.dom_node();
2840
- $mol_dom_render_attributes(node, this.attr_static());
2841
- const events = $mol_wire_async(this.event());
2842
- for (let event_name in events) {
2843
- node.addEventListener(event_name, events[event_name], { passive: false });
2844
- }
2845
- return node;
2846
- }
2847
- attr_static() {
2848
- return {};
2849
- }
2850
- event() {
2851
- return {};
2852
- }
2853
- render() {
2854
- this.dom_node_actual();
2855
- }
2856
- }
2857
- __decorate([
2858
- $mol_mem
2859
- ], $mol_plugin.prototype, "dom_node", null);
2860
- $.$mol_plugin = $mol_plugin;
2861
- })($ || ($ = {}));
2862
- //mol/plugin/plugin.ts
2863
- ;
2864
- "use strict";
2865
- var $;
2866
2866
  (function ($) {
2867
2867
  var $$;
2868
2868
  (function ($$) {
@@ -3276,13 +3276,6 @@ var $;
3276
3276
  ;
3277
3277
  "use strict";
3278
3278
  var $;
3279
- (function ($) {
3280
- $mol_style_attach("mol/plot/graph/graph.view.css", "[mol_plot_graph] {\n\tstroke: currentColor;\n}\n\n[mol_plot_graph_sample] {\n\tborder-width: 0;\n\tborder-style: solid;\n}\n\n[mol_plot_graph_type=\"dashed\"] {\n\tstroke-dasharray: 4 4;\n\tborder-style: dashed;\n}\n");
3281
- })($ || ($ = {}));
3282
- //mol/plot/graph/-css/graph.view.css.ts
3283
- ;
3284
- "use strict";
3285
- var $;
3286
3279
  (function ($) {
3287
3280
  var $$;
3288
3281
  (function ($$) {
@@ -3356,6 +3349,13 @@ var $;
3356
3349
  ;
3357
3350
  "use strict";
3358
3351
  var $;
3352
+ (function ($) {
3353
+ $mol_style_attach("mol/plot/graph/graph.view.css", "[mol_plot_graph] {\n\tstroke: currentColor;\n}\n\n[mol_plot_graph_sample] {\n\tborder-width: 0;\n\tborder-style: solid;\n}\n\n[mol_plot_graph_type=\"dashed\"] {\n\tstroke-dasharray: 4 4;\n\tborder-style: dashed;\n}\n");
3354
+ })($ || ($ = {}));
3355
+ //mol/plot/graph/-css/graph.view.css.ts
3356
+ ;
3357
+ "use strict";
3358
+ var $;
3359
3359
  (function ($) {
3360
3360
  class $mol_touch extends $mol_plugin {
3361
3361
  start_zoom(val) {
@@ -4185,13 +4185,6 @@ var $;
4185
4185
  ;
4186
4186
  "use strict";
4187
4187
  var $;
4188
- (function ($) {
4189
- $mol_style_attach("mol/plot/pane/pane.view.css", "[mol_plot_pane] {\n\tcolor: var(--mol_theme_control);\n\tflex: 1 1 auto;\n\talign-self: stretch;\n\tstroke-width: 2px;\n\tuser-select: none;\n}\n");
4190
- })($ || ($ = {}));
4191
- //mol/plot/pane/-css/pane.view.css.ts
4192
- ;
4193
- "use strict";
4194
- var $;
4195
4188
  (function ($) {
4196
4189
  var $$;
4197
4190
  (function ($$) {
@@ -4394,6 +4387,13 @@ var $;
4394
4387
  ;
4395
4388
  "use strict";
4396
4389
  var $;
4390
+ (function ($) {
4391
+ $mol_style_attach("mol/plot/pane/pane.view.css", "[mol_plot_pane] {\n\tcolor: var(--mol_theme_control);\n\tflex: 1 1 auto;\n\talign-self: stretch;\n\tstroke-width: 2px;\n\tuser-select: none;\n}\n");
4392
+ })($ || ($ = {}));
4393
+ //mol/plot/pane/-css/pane.view.css.ts
4394
+ ;
4395
+ "use strict";
4396
+ var $;
4397
4397
  (function ($) {
4398
4398
  class $mol_plot_line extends $mol_plot_graph {
4399
4399
  threshold() {
@@ -4438,13 +4438,6 @@ var $;
4438
4438
  ;
4439
4439
  "use strict";
4440
4440
  var $;
4441
- (function ($) {
4442
- $mol_style_attach("mol/plot/line/line.view.css", "[mol_plot_line] {\n\tfill: none;\n\tstroke-linejoin: round;\n}\n\n[mol_plot_line_sample] {\n\theight: 0;\n\tleft: 0;\n\tright: 0;\n\tbottom: 0;\n\tborder-width: 2px 0 0;\n\tposition: absolute;\n\ttop: .75em;\n\ttransform: translateY(-50%);\n}\n");
4443
- })($ || ($ = {}));
4444
- //mol/plot/line/-css/line.view.css.ts
4445
- ;
4446
- "use strict";
4447
- var $;
4448
4441
  (function ($) {
4449
4442
  var $$;
4450
4443
  (function ($$) {
@@ -4504,6 +4497,13 @@ var $;
4504
4497
  ;
4505
4498
  "use strict";
4506
4499
  var $;
4500
+ (function ($) {
4501
+ $mol_style_attach("mol/plot/line/line.view.css", "[mol_plot_line] {\n\tfill: none;\n\tstroke-linejoin: round;\n}\n\n[mol_plot_line_sample] {\n\theight: 0;\n\tleft: 0;\n\tright: 0;\n\tbottom: 0;\n\tborder-width: 2px 0 0;\n\tposition: absolute;\n\ttop: .75em;\n\ttransform: translateY(-50%);\n}\n");
4502
+ })($ || ($ = {}));
4503
+ //mol/plot/line/-css/line.view.css.ts
4504
+ ;
4505
+ "use strict";
4506
+ var $;
4507
4507
  (function ($) {
4508
4508
  class $mol_plot_group extends $mol_plot_graph {
4509
4509
  sub() {
@@ -4687,13 +4687,6 @@ var $;
4687
4687
  ;
4688
4688
  "use strict";
4689
4689
  var $;
4690
- (function ($) {
4691
- $mol_style_attach("mol/plot/dot/dot.view.css", "[mol_plot_dot] {\n\tstroke-linecap: round;\n\tfill: none;\n}\n\n[mol_plot_dot_sample] {\n\twidth: .5rem;\n\theight: .5rem;\n\tborder-radius: 1rem;\n\tbackground: currentColor;\n\tposition: absolute;\n\ttop: .75em;\n\tleft: 50%;\n\ttransform: translate(-50%, -50%);\n}\n");
4692
- })($ || ($ = {}));
4693
- //mol/plot/dot/-css/dot.view.css.ts
4694
- ;
4695
- "use strict";
4696
- var $;
4697
4690
  (function ($) {
4698
4691
  var $$;
4699
4692
  (function ($$) {
@@ -4779,6 +4772,13 @@ var $;
4779
4772
  ;
4780
4773
  "use strict";
4781
4774
  var $;
4775
+ (function ($) {
4776
+ $mol_style_attach("mol/plot/dot/dot.view.css", "[mol_plot_dot] {\n\tstroke-linecap: round;\n\tfill: none;\n}\n\n[mol_plot_dot_sample] {\n\twidth: .5rem;\n\theight: .5rem;\n\tborder-radius: 1rem;\n\tbackground: currentColor;\n\tposition: absolute;\n\ttop: .75em;\n\tleft: 50%;\n\ttransform: translate(-50%, -50%);\n}\n");
4777
+ })($ || ($ = {}));
4778
+ //mol/plot/dot/-css/dot.view.css.ts
4779
+ ;
4780
+ "use strict";
4781
+ var $;
4782
4782
  (function ($) {
4783
4783
  class $mol_plot_map_heat extends $mol_plot_group {
4784
4784
  series_z() {
@@ -4844,13 +4844,6 @@ var $;
4844
4844
  ;
4845
4845
  "use strict";
4846
4846
  var $;
4847
- (function ($) {
4848
- $mol_style_attach("mol/plot/map/heat/heat.view.css", "[mol_plot_map_heat_level_curve] {\n\tstroke-linecap: square;\n\tfill: none;\n}\n");
4849
- })($ || ($ = {}));
4850
- //mol/plot/map/heat/-css/heat.view.css.ts
4851
- ;
4852
- "use strict";
4853
- var $;
4854
4847
  (function ($) {
4855
4848
  var $$;
4856
4849
  (function ($$) {
@@ -4914,6 +4907,13 @@ var $;
4914
4907
  ;
4915
4908
  "use strict";
4916
4909
  var $;
4910
+ (function ($) {
4911
+ $mol_style_attach("mol/plot/map/heat/heat.view.css", "[mol_plot_map_heat_level_curve] {\n\tstroke-linecap: square;\n\tfill: none;\n}\n");
4912
+ })($ || ($ = {}));
4913
+ //mol/plot/map/heat/-css/heat.view.css.ts
4914
+ ;
4915
+ "use strict";
4916
+ var $;
4917
4917
  (function ($) {
4918
4918
  class $mol_plot_bar extends $mol_plot_graph {
4919
4919
  style() {
@@ -4957,13 +4957,6 @@ var $;
4957
4957
  ;
4958
4958
  "use strict";
4959
4959
  var $;
4960
- (function ($) {
4961
- $mol_style_attach("mol/plot/bar/bar.view.css", "[mol_plot_bar] {\n\tstroke-linecap: butt;\n\tstroke-width: 1rem;\n}\n\n[mol_plot_bar_sample] {\n\tbackground: currentColor;\n\tposition: absolute;\n\ttop:0;\n\tbottom: 0;\n\tleft: 0;\n\tright: 0;\n}\n");
4962
- })($ || ($ = {}));
4963
- //mol/plot/bar/-css/bar.view.css.ts
4964
- ;
4965
- "use strict";
4966
- var $;
4967
4960
  (function ($) {
4968
4961
  var $$;
4969
4962
  (function ($$) {
@@ -5046,6 +5039,13 @@ var $;
5046
5039
  ;
5047
5040
  "use strict";
5048
5041
  var $;
5042
+ (function ($) {
5043
+ $mol_style_attach("mol/plot/bar/bar.view.css", "[mol_plot_bar] {\n\tstroke-linecap: butt;\n\tstroke-width: 1rem;\n}\n\n[mol_plot_bar_sample] {\n\tbackground: currentColor;\n\tposition: absolute;\n\ttop:0;\n\tbottom: 0;\n\tleft: 0;\n\tright: 0;\n}\n");
5044
+ })($ || ($ = {}));
5045
+ //mol/plot/bar/-css/bar.view.css.ts
5046
+ ;
5047
+ "use strict";
5048
+ var $;
5049
5049
  (function ($) {
5050
5050
  class $mol_plot_fill extends $mol_plot_line {
5051
5051
  threshold() {
@@ -5058,13 +5058,6 @@ var $;
5058
5058
  ;
5059
5059
  "use strict";
5060
5060
  var $;
5061
- (function ($) {
5062
- $mol_style_attach("mol/plot/fill/fill.view.css", "[mol_plot_fill] {\n\tstroke: none;\n\tstroke-width: 0;\n\topacity: .1;\n\tfill: currentColor;\n\tpointer-events: none;\n}\n\n[mol_plot_fill_sample] {\n\topacity: .1;\n\tbackground: currentColor;\n\tposition: absolute;\n\tbottom: 0;\n\ttop: .75em;\n\tleft: 0;\n\tright: 0;\n}\n");
5063
- })($ || ($ = {}));
5064
- //mol/plot/fill/-css/fill.view.css.ts
5065
- ;
5066
- "use strict";
5067
- var $;
5068
5061
  (function ($) {
5069
5062
  var $$;
5070
5063
  (function ($$) {
@@ -5091,6 +5084,13 @@ var $;
5091
5084
  ;
5092
5085
  "use strict";
5093
5086
  var $;
5087
+ (function ($) {
5088
+ $mol_style_attach("mol/plot/fill/fill.view.css", "[mol_plot_fill] {\n\tstroke: none;\n\tstroke-width: 0;\n\topacity: .1;\n\tfill: currentColor;\n\tpointer-events: none;\n}\n\n[mol_plot_fill_sample] {\n\topacity: .1;\n\tbackground: currentColor;\n\tposition: absolute;\n\tbottom: 0;\n\ttop: .75em;\n\tleft: 0;\n\tright: 0;\n}\n");
5089
+ })($ || ($ = {}));
5090
+ //mol/plot/fill/-css/fill.view.css.ts
5091
+ ;
5092
+ "use strict";
5093
+ var $;
5094
5094
  (function ($) {
5095
5095
  class $mol_svg_text extends $mol_svg {
5096
5096
  dom_name() {
@@ -5131,13 +5131,6 @@ var $;
5131
5131
  ;
5132
5132
  "use strict";
5133
5133
  var $;
5134
- (function ($) {
5135
- $mol_style_attach("mol/svg/text/text.view.css", "[mol_svg_text] {\n\tfill: currentColor;\n\tstroke: none;\n}\n");
5136
- })($ || ($ = {}));
5137
- //mol/svg/text/-css/text.view.css.ts
5138
- ;
5139
- "use strict";
5140
- var $;
5141
5134
  (function ($) {
5142
5135
  var $$;
5143
5136
  (function ($$) {
@@ -5156,6 +5149,13 @@ var $;
5156
5149
  ;
5157
5150
  "use strict";
5158
5151
  var $;
5152
+ (function ($) {
5153
+ $mol_style_attach("mol/svg/text/text.view.css", "[mol_svg_text] {\n\tfill: currentColor;\n\tstroke: none;\n}\n");
5154
+ })($ || ($ = {}));
5155
+ //mol/svg/text/-css/text.view.css.ts
5156
+ ;
5157
+ "use strict";
5158
+ var $;
5159
5159
  (function ($) {
5160
5160
  class $mol_svg_rect extends $mol_svg {
5161
5161
  dom_name() {
@@ -5308,13 +5308,6 @@ var $;
5308
5308
  ;
5309
5309
  "use strict";
5310
5310
  var $;
5311
- (function ($) {
5312
- $mol_style_attach("mol/svg/text/box/box.view.css", "[mol_svg_text_box_back] {\n\tstroke: none;\n\tfill: var(--mol_theme_back);\n}\n");
5313
- })($ || ($ = {}));
5314
- //mol/svg/text/box/-css/box.view.css.ts
5315
- ;
5316
- "use strict";
5317
- var $;
5318
5311
  (function ($) {
5319
5312
  var $$;
5320
5313
  (function ($$) {
@@ -5347,6 +5340,13 @@ var $;
5347
5340
  ;
5348
5341
  "use strict";
5349
5342
  var $;
5343
+ (function ($) {
5344
+ $mol_style_attach("mol/svg/text/box/box.view.css", "[mol_svg_text_box_back] {\n\tstroke: none;\n\tfill: var(--mol_theme_back);\n}\n");
5345
+ })($ || ($ = {}));
5346
+ //mol/svg/text/box/-css/box.view.css.ts
5347
+ ;
5348
+ "use strict";
5349
+ var $;
5350
5350
  (function ($) {
5351
5351
  class $mol_plot_ruler extends $mol_plot_graph {
5352
5352
  step() {
@@ -5506,13 +5506,6 @@ var $;
5506
5506
  ;
5507
5507
  "use strict";
5508
5508
  var $;
5509
- (function ($) {
5510
- $mol_style_attach("mol/plot/ruler/ruler.view.css", "[mol_plot_ruler_curve] {\n\tcolor: var(--mol_theme_line);\n\tstroke-width: 1px;\n\tstroke: currentColor;\n}\n\n[mol_plot_ruler_label] {\n\tcolor: var(--mol_theme_text);\n}\n\n[mol_plot_ruler_title] {\n\tcolor: var(--mol_theme_shade);\n\tbackground-color: var(--mol_theme_back);\n}\n\n[mol_plot_ruler_background] {\n\tstroke: none;\n\tfill: var(--mol_theme_back);\n\topacity: 0.8;\n}\n");
5511
- })($ || ($ = {}));
5512
- //mol/plot/ruler/-css/ruler.view.css.ts
5513
- ;
5514
- "use strict";
5515
- var $;
5516
5509
  (function ($) {
5517
5510
  var $$;
5518
5511
  (function ($$) {
@@ -5597,6 +5590,13 @@ var $;
5597
5590
  ;
5598
5591
  "use strict";
5599
5592
  var $;
5593
+ (function ($) {
5594
+ $mol_style_attach("mol/plot/ruler/ruler.view.css", "[mol_plot_ruler_curve] {\n\tcolor: var(--mol_theme_line);\n\tstroke-width: 1px;\n\tstroke: currentColor;\n}\n\n[mol_plot_ruler_label] {\n\tcolor: var(--mol_theme_text);\n}\n\n[mol_plot_ruler_title] {\n\tcolor: var(--mol_theme_shade);\n\tbackground-color: var(--mol_theme_back);\n}\n\n[mol_plot_ruler_background] {\n\tstroke: none;\n\tfill: var(--mol_theme_back);\n\topacity: 0.8;\n}\n");
5595
+ })($ || ($ = {}));
5596
+ //mol/plot/ruler/-css/ruler.view.css.ts
5597
+ ;
5598
+ "use strict";
5599
+ var $;
5600
5600
  (function ($) {
5601
5601
  class $mol_plot_ruler_vert extends $mol_plot_ruler {
5602
5602
  title_align() {
@@ -5624,13 +5624,6 @@ var $;
5624
5624
  ;
5625
5625
  "use strict";
5626
5626
  var $;
5627
- (function ($) {
5628
- $mol_style_attach("mol/plot/ruler/vert/vert.view.css", "[mol_plot_ruler_vert_label] {\n\ttransform: translateY( 4px );\n}\n");
5629
- })($ || ($ = {}));
5630
- //mol/plot/ruler/vert/-css/vert.view.css.ts
5631
- ;
5632
- "use strict";
5633
- var $;
5634
5627
  (function ($) {
5635
5628
  var $$;
5636
5629
  (function ($$) {
@@ -5673,6 +5666,13 @@ var $;
5673
5666
  ;
5674
5667
  "use strict";
5675
5668
  var $;
5669
+ (function ($) {
5670
+ $mol_style_attach("mol/plot/ruler/vert/vert.view.css", "[mol_plot_ruler_vert_label] {\n\ttransform: translateY( 4px );\n}\n");
5671
+ })($ || ($ = {}));
5672
+ //mol/plot/ruler/vert/-css/vert.view.css.ts
5673
+ ;
5674
+ "use strict";
5675
+ var $;
5676
5676
  (function ($) {
5677
5677
  class $mol_plot_ruler_hor extends $mol_plot_ruler {
5678
5678
  title_align() {
@@ -5700,13 +5700,6 @@ var $;
5700
5700
  ;
5701
5701
  "use strict";
5702
5702
  var $;
5703
- (function ($) {
5704
- $mol_style_attach("mol/plot/ruler/hor/hor.view.css", "[mol_plot_ruler_hor_label] {\n\ttransform: translateY( -4px );\n}\n\n[mol_plot_ruler_hor_title] {\n\ttransform: translateY( -4px );\n}\n");
5705
- })($ || ($ = {}));
5706
- //mol/plot/ruler/hor/-css/hor.view.css.ts
5707
- ;
5708
- "use strict";
5709
- var $;
5710
5703
  (function ($) {
5711
5704
  var $$;
5712
5705
  (function ($$) {
@@ -5755,6 +5748,13 @@ var $;
5755
5748
  ;
5756
5749
  "use strict";
5757
5750
  var $;
5751
+ (function ($) {
5752
+ $mol_style_attach("mol/plot/ruler/hor/hor.view.css", "[mol_plot_ruler_hor_label] {\n\ttransform: translateY( -4px );\n}\n\n[mol_plot_ruler_hor_title] {\n\ttransform: translateY( -4px );\n}\n");
5753
+ })($ || ($ = {}));
5754
+ //mol/plot/ruler/hor/-css/hor.view.css.ts
5755
+ ;
5756
+ "use strict";
5757
+ var $;
5758
5758
  (function ($) {
5759
5759
  class $mol_plot_mark_cross extends $mol_plot_graph {
5760
5760
  labels() {
@@ -5853,13 +5853,6 @@ var $;
5853
5853
  ;
5854
5854
  "use strict";
5855
5855
  var $;
5856
- (function ($) {
5857
- $mol_style_attach("mol/plot/mark/cross/cross.view.css", "[mol_plot_mark_cross_curve] {\n\tcolor: var(--mol_theme_focus);\n\tstroke-width: 1px;\n\tstroke: currentColor;\n\tpointer-events: none;\n}\n\n[mol_plot_mark_cross_label_x], [mol_plot_mark_cross_label_y] {\n\tcolor: var(--mol_theme_focus);\n\tfont-weight: bold;\n\tpointer-events: none;\n}\n\n[mol_plot_mark_cross_label_y] {\n\ttransform: translateY( 4px );\n}\n");
5858
- })($ || ($ = {}));
5859
- //mol/plot/mark/cross/-css/cross.view.css.ts
5860
- ;
5861
- "use strict";
5862
- var $;
5863
5856
  (function ($) {
5864
5857
  var $$;
5865
5858
  (function ($$) {
@@ -5947,6 +5940,13 @@ var $;
5947
5940
  ;
5948
5941
  "use strict";
5949
5942
  var $;
5943
+ (function ($) {
5944
+ $mol_style_attach("mol/plot/mark/cross/cross.view.css", "[mol_plot_mark_cross_curve] {\n\tcolor: var(--mol_theme_focus);\n\tstroke-width: 1px;\n\tstroke: currentColor;\n\tpointer-events: none;\n}\n\n[mol_plot_mark_cross_label_x], [mol_plot_mark_cross_label_y] {\n\tcolor: var(--mol_theme_focus);\n\tfont-weight: bold;\n\tpointer-events: none;\n}\n\n[mol_plot_mark_cross_label_y] {\n\ttransform: translateY( 4px );\n}\n");
5945
+ })($ || ($ = {}));
5946
+ //mol/plot/mark/cross/-css/cross.view.css.ts
5947
+ ;
5948
+ "use strict";
5949
+ var $;
5950
5950
  (function ($) {
5951
5951
  class $mol_plot_mark_hor extends $mol_plot_ruler_hor {
5952
5952
  labels() {
@@ -5959,13 +5959,6 @@ var $;
5959
5959
  ;
5960
5960
  "use strict";
5961
5961
  var $;
5962
- (function ($) {
5963
- $mol_style_attach("mol/plot/mark/hor/hor.view.css", "[mol_plot_mark_hor_curve] {\n\tcolor: var(--mol_theme_line);\n\tstroke-width: .1%;\n\tstroke: currentColor;\n\tpointer-events: none;\n}\n\n[mol_plot_mark_hor_label] {\n\tcolor: var(--mol_theme_text);\n\ttransform: translateY( -4px );\n}\n\n[mol_plot_mark_hor_title] {\n\tcolor: var(--mol_theme_shade);\n\ttransform: translateY( -4px );\n}\n");
5964
- })($ || ($ = {}));
5965
- //mol/plot/mark/hor/-css/hor.view.css.ts
5966
- ;
5967
- "use strict";
5968
- var $;
5969
5962
  (function ($) {
5970
5963
  var $$;
5971
5964
  (function ($$) {
@@ -6056,5 +6049,12 @@ var $;
6056
6049
  })($ || ($ = {}));
6057
6050
  //mol/plot/mark/hor/hor.view.ts
6058
6051
  ;
6052
+ "use strict";
6053
+ var $;
6054
+ (function ($) {
6055
+ $mol_style_attach("mol/plot/mark/hor/hor.view.css", "[mol_plot_mark_hor_curve] {\n\tcolor: var(--mol_theme_line);\n\tstroke-width: .1%;\n\tstroke: currentColor;\n\tpointer-events: none;\n}\n\n[mol_plot_mark_hor_label] {\n\tcolor: var(--mol_theme_text);\n\ttransform: translateY( -4px );\n}\n\n[mol_plot_mark_hor_title] {\n\tcolor: var(--mol_theme_shade);\n\ttransform: translateY( -4px );\n}\n");
6056
+ })($ || ($ = {}));
6057
+ //mol/plot/mark/hor/-css/hor.view.css.ts
6058
+ ;
6059
6059
  export default $
6060
6060
  //# sourceMappingURL=node.mjs.map