@yuneta/gobj-ui 7.32.9 → 7.32.11

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.
@@ -234,6 +234,33 @@ function focus_trap_panel() {
234
234
  let top = top_trap();
235
235
  return top ? top.$panel : null;
236
236
  }
237
+ // src/node_tree_model.js
238
+ /************************************************************
239
+ * NAVIGATION MODES — the three ways a tree can show the way in.
240
+ *
241
+ * "stack" — one chrome strip per ancestor. Whatever each
242
+ * node declared, painted at every level.
243
+ * "back" — only the tip's parent, and only as a "← parent".
244
+ * "path" — no strips at all: the trail as ONE breadcrumb
245
+ * line, drawn by the root.
246
+ *
247
+ * A mode is a FILTER over what the app declared, applied when the
248
+ * renders are asked for — never a rewrite of the declared
249
+ * projections. That is what makes going back to "stack" free and
250
+ * exact: an app that declares `vertical` chrome gets `vertical`
251
+ * back, not the tabs a canonical "stack" shape would have imposed.
252
+ *
253
+ * The index projection is NEVER touched: how a node shows its own
254
+ * children when it IS the page is not a statement about depth.
255
+ ************************************************************/
256
+ var NAV_MODES = [
257
+ "stack",
258
+ "back",
259
+ "path"
260
+ ];
261
+ function is_nav_mode(mode) {
262
+ return NAV_MODES.indexOf(mode) >= 0;
263
+ }
237
264
  // src/shell_show_on.js
238
265
  /***********************************************************************
239
266
  * shell_show_on.js
@@ -1273,7 +1300,7 @@ function secondary_nav_renders(item, layout) {
1273
1300
  /***************************************************************
1274
1301
  * Constants
1275
1302
  ***************************************************************/
1276
- var GCLASS_NAME$23 = "C_YUI_SHELL";
1303
+ var GCLASS_NAME$24 = "C_YUI_SHELL";
1277
1304
  var __live_shells__ = [];
1278
1305
  var __retiring_shell__ = null;
1279
1306
  var __dead_entries__ = /* @__PURE__ */ new Set();
@@ -1300,7 +1327,7 @@ var LAYER_DEFS = [
1300
1327
  /***************************************************************
1301
1328
  * Attrs
1302
1329
  ***************************************************************/
1303
- var attrs_table$23 = [
1330
+ var attrs_table$24 = [
1304
1331
  SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
1305
1332
  SDATA(data_type_t.DTP_JSON, "config", 0, null, "Shell declarative config (zones, menu, stages, toolbar)"),
1306
1333
  SDATA(data_type_t.DTP_STRING, "default_route", 0, "", "Fallback route if hash is empty"),
@@ -1311,7 +1338,7 @@ var attrs_table$23 = [
1311
1338
  SDATA(data_type_t.DTP_POINTER, "$container", 0, null, "Root HTMLElement of the shell"),
1312
1339
  SDATA_END()
1313
1340
  ];
1314
- var PRIVATE_DATA$23 = {
1341
+ var PRIVATE_DATA$24 = {
1315
1342
  zones: {},
1316
1343
  layers: {},
1317
1344
  window_layer: null,
@@ -1354,14 +1381,14 @@ var PRIVATE_DATA$23 = {
1354
1381
  connected: null,
1355
1382
  active_dropdown: null
1356
1383
  };
1357
- var __gclass__$23 = null;
1384
+ var __gclass__$24 = null;
1358
1385
  /******************************
1359
1386
  * Framework Methods
1360
1387
  ******************************/
1361
1388
  /***************************************************************
1362
1389
  * Framework Method: Create
1363
1390
  ***************************************************************/
1364
- function mt_create$23(gobj) {
1391
+ function mt_create$24(gobj) {
1365
1392
  const subscriber = gobj_read_pointer_attr(gobj, "subscriber");
1366
1393
  if (subscriber) gobj_subscribe_event(gobj, null, {}, subscriber);
1367
1394
  __live_shells__.push(gobj);
@@ -1371,7 +1398,7 @@ function mt_create$23(gobj) {
1371
1398
  /***************************************************************
1372
1399
  * Framework Method: Start
1373
1400
  ***************************************************************/
1374
- function mt_start$22(gobj) {
1401
+ function mt_start$23(gobj) {
1375
1402
  let config = gobj_read_attr(gobj, "config") || {};
1376
1403
  let priv = gobj.priv;
1377
1404
  if (!validate_config(config)) {
@@ -1515,7 +1542,7 @@ function mt_start$22(gobj) {
1515
1542
  /***************************************************************
1516
1543
  * Framework Method: Stop
1517
1544
  ***************************************************************/
1518
- function mt_stop$21(gobj) {
1545
+ function mt_stop$22(gobj) {
1519
1546
  let priv = gobj.priv;
1520
1547
  if (!priv) return 0;
1521
1548
  retire_overlays(gobj);
@@ -1579,7 +1606,7 @@ function mt_stop$21(gobj) {
1579
1606
  /***************************************************************
1580
1607
  * Framework Method: Destroy
1581
1608
  ***************************************************************/
1582
- function mt_destroy$23(gobj) {
1609
+ function mt_destroy$24(gobj) {
1583
1610
  retire_overlays(gobj);
1584
1611
  close_toolbar_dropdown(gobj);
1585
1612
  let live_idx = __live_shells__.indexOf(gobj);
@@ -3705,22 +3732,26 @@ function ac_nav_item_close(gobj, event, kw, src) {
3705
3732
  * EV_ICONS_CHANGED). So they reach only the subscribers that
3706
3733
  * declare them. Every other event of the shell goes out as before.
3707
3734
  ***************************************************************/
3708
- var OPTIONAL_EVENTS = /* @__PURE__ */ new Set(["EV_CONNECTION_STATE", "EV_ICONS_CHANGED"]);
3735
+ var OPTIONAL_EVENTS = /* @__PURE__ */ new Set([
3736
+ "EV_CONNECTION_STATE",
3737
+ "EV_ICONS_CHANGED",
3738
+ "EV_NAV_MODE_CHANGED"
3739
+ ]);
3709
3740
  function mt_publication_pre_filter(gobj, subs, event, kw) {
3710
3741
  if (!OPTIONAL_EVENTS.has(event)) return 1;
3711
3742
  let subscriber = subs && subs.subscriber;
3712
3743
  if (!subscriber || !gobj_has_event(subscriber, event, 0)) return 0;
3713
3744
  return 1;
3714
3745
  }
3715
- var gmt$23 = {
3716
- mt_create: mt_create$23,
3717
- mt_start: mt_start$22,
3718
- mt_stop: mt_stop$21,
3719
- mt_destroy: mt_destroy$23,
3746
+ var gmt$24 = {
3747
+ mt_create: mt_create$24,
3748
+ mt_start: mt_start$23,
3749
+ mt_stop: mt_stop$22,
3750
+ mt_destroy: mt_destroy$24,
3720
3751
  mt_publication_pre_filter
3721
3752
  };
3722
- function create_gclass$23(gclass_name) {
3723
- if (__gclass__$23) {
3753
+ function create_gclass$24(gclass_name) {
3754
+ if (__gclass__$24) {
3724
3755
  log_error(`GClass ALREADY created: ${gclass_name}`);
3725
3756
  return -1;
3726
3757
  }
@@ -3760,15 +3791,16 @@ function create_gclass$23(gclass_name) {
3760
3791
  ["EV_ROUTE_REQUESTED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
3761
3792
  ["EV_ROUTE_CHANGED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
3762
3793
  ["EV_LANGUAGE_CHANGED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
3794
+ ["EV_NAV_MODE_CHANGED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
3763
3795
  ["EV_ICONS_CHANGED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
3764
3796
  ["EV_CONNECTION_STATE", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS]
3765
3797
  ];
3766
- __gclass__$23 = gclass_create(gclass_name, event_types, states, gmt$23, 0, attrs_table$23, PRIVATE_DATA$23, 0, 0, 0, gclass_flag_t.gcflag_no_check_output_events);
3767
- if (!__gclass__$23) return -1;
3798
+ __gclass__$24 = gclass_create(gclass_name, event_types, states, gmt$24, 0, attrs_table$24, PRIVATE_DATA$24, 0, 0, 0, gclass_flag_t.gcflag_no_check_output_events);
3799
+ if (!__gclass__$24) return -1;
3768
3800
  return 0;
3769
3801
  }
3770
3802
  function register_c_yui_shell() {
3771
- return create_gclass$23(GCLASS_NAME$23);
3803
+ return create_gclass$24(GCLASS_NAME$24);
3772
3804
  }
3773
3805
  /***************************************************************
3774
3806
  * Public helpers — exported alongside register_c_yui_shell().
@@ -3888,7 +3920,7 @@ function yui_shell_previous_route(shell_gobj) {
3888
3920
  function yui_shell_of(gobj) {
3889
3921
  let g = gobj;
3890
3922
  while (g) {
3891
- if (gobj_gclass_name(g) === GCLASS_NAME$23) return g;
3923
+ if (gobj_gclass_name(g) === GCLASS_NAME$24) return g;
3892
3924
  g = gobj_parent(g);
3893
3925
  }
3894
3926
  return __live_shells__.length > 0 ? __live_shells__[__live_shells__.length - 1] : null;
@@ -4189,6 +4221,55 @@ function yui_shell_translate(shell_gobj, $el) {
4189
4221
  refresh_language($el, priv.translator);
4190
4222
  }
4191
4223
  /************************************************************
4224
+ * The app switched the language: re-translate the whole document (every
4225
+ * node carrying data-i18n / data-i18n-title / data-i18n-aria-label) and
4226
+ * PUBLISH the fact, so the views that build DOM imperatively — Tabulator
4227
+ * headers and paginators, composed titles, row counters — can re-render
4228
+ * what no attribute can reach.
4229
+ *
4230
+ * The app remains the owner of the locales: it switches its i18next and
4231
+ * calls this. The shell only fans the fact out.
4232
+ ************************************************************/
4233
+ function yui_shell_language_changed(shell_gobj) {
4234
+ if (!shell_gobj || !is_gobj(shell_gobj)) return;
4235
+ let priv = shell_gobj.priv;
4236
+ if (priv && typeof priv.translator === "function") refresh_language(document.body, priv.translator);
4237
+ gobj_publish_event(shell_gobj, "EV_LANGUAGE_CHANGED", {});
4238
+ }
4239
+ /************************************************************
4240
+ * How the trees of nodes show the way in: the reader's choice
4241
+ * for the whole app, one of NAV_MODES (C_YUI_NODE):
4242
+ *
4243
+ * "stack" a strip of tabs per level, stacked (the default)
4244
+ * "back" one "back to parent" link
4245
+ * "path" a breadcrumb
4246
+ *
4247
+ * Kept in this browser (localStorage), like the theme and the
4248
+ * language. Every C_YUI_NODE root that has no `nav_mode` of its
4249
+ * own reads it, and follows a change: yui_shell_set_nav_mode()
4250
+ * publishes EV_NAV_MODE_CHANGED. Up to gobj-ui 7.32.10 each app
4251
+ * kept its own (gui_agent one for the app, yunovatios one per
4252
+ * tree) and handed it to its trees.
4253
+ ************************************************************/
4254
+ var NAV_MODE_KEY = "yui_nav_mode";
4255
+ function yui_shell_nav_mode(shell_gobj) {
4256
+ let mode = kw_get_local_storage_value(NAV_MODE_KEY, NAV_MODES[0], false);
4257
+ return is_nav_mode(mode) ? mode : NAV_MODES[0];
4258
+ }
4259
+ function yui_shell_set_nav_mode(shell_gobj, mode) {
4260
+ if (!shell_gobj || !is_gobj(shell_gobj)) {
4261
+ log_error(`yui_shell_set_nav_mode(): no shell`);
4262
+ return -1;
4263
+ }
4264
+ if (!is_nav_mode(mode)) {
4265
+ log_error(`yui_shell_set_nav_mode(): unknown nav_mode '${mode}' — expected one of ${NAV_MODES.join("|")}`);
4266
+ return -1;
4267
+ }
4268
+ if (kw_set_local_storage_value(NAV_MODE_KEY, mode) < 0) return -1;
4269
+ gobj_publish_event(shell_gobj, "EV_NAV_MODE_CHANGED", { nav_mode: mode });
4270
+ return 0;
4271
+ }
4272
+ /************************************************************
4192
4273
  * The user icons changed (lib_icons.js: yui_icons_set_user,
4193
4274
  * yui_icons_put_user, yui_icons_remove_user): PUBLISH it, so
4194
4275
  * the views that decided at render time whether a name is an
@@ -5058,7 +5139,7 @@ function yui_shell_confirm_yesnocancel(shell, message, opts) {
5058
5139
  /***************************************************************
5059
5140
  * Constants
5060
5141
  ***************************************************************/
5061
- var GCLASS_NAME$22 = "C_YUI_WINDOW";
5142
+ var GCLASS_NAME$23 = "C_YUI_WINDOW";
5062
5143
  var WC_MIN = "<svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><rect x=\"3\" y=\"11\" width=\"10\" height=\"1.6\" rx=\"0.8\" fill=\"currentColor\"/></svg>";
5063
5144
  var WC_MAX = "<svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><rect x=\"3.3\" y=\"3.3\" width=\"9.4\" height=\"9.4\" rx=\"1.6\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\"/></svg>";
5064
5145
  var WC_RESTORE = "<svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><rect x=\"5.2\" y=\"3\" width=\"7.8\" height=\"7.8\" rx=\"1.3\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\"/><rect x=\"3\" y=\"5.2\" width=\"7.8\" height=\"7.8\" rx=\"1.3\" fill=\"var(--bulma-scheme-main)\" stroke=\"currentColor\" stroke-width=\"1.4\"/></svg>";
@@ -5071,7 +5152,7 @@ var __title_seq__ = 0;
5071
5152
  /***************************************************************
5072
5153
  * Data
5073
5154
  ***************************************************************/
5074
- var attrs_table$22 = [
5155
+ var attrs_table$23 = [
5075
5156
  SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
5076
5157
  SDATA(data_type_t.DTP_POINTER, "$parent", 0, null, "$container will be appended to $parent if not null, else to the window layer of the shell (document.body while there is none), following the shell when it is destroyed or another is built"),
5077
5158
  SDATA(data_type_t.DTP_INTEGER, "x", 0, "300", "X position"),
@@ -5109,7 +5190,7 @@ var attrs_table$22 = [
5109
5190
  SDATA(data_type_t.DTP_POINTER, "win_resize_handler", 0, null, "Internal: native window 'resize' listener"),
5110
5191
  SDATA_END()
5111
5192
  ];
5112
- var PRIVATE_DATA$22 = {
5193
+ var PRIVATE_DATA$23 = {
5113
5194
  prevSize: 0,
5114
5195
  placed_by_shell: false,
5115
5196
  back_shell: null,
@@ -5118,14 +5199,14 @@ var PRIVATE_DATA$22 = {
5118
5199
  release_focus: null,
5119
5200
  escape_order: 0
5120
5201
  };
5121
- var __gclass__$22 = null;
5202
+ var __gclass__$23 = null;
5122
5203
  /******************************
5123
5204
  * Framework Methods
5124
5205
  ******************************/
5125
5206
  /***************************************************************
5126
5207
  * Framework Method: Create
5127
5208
  ***************************************************************/
5128
- function mt_create$22(gobj) {
5209
+ function mt_create$23(gobj) {
5129
5210
  const subscriber = gobj_read_pointer_attr(gobj, "subscriber");
5130
5211
  if (subscriber) gobj_subscribe_event(gobj, null, {}, subscriber);
5131
5212
  let window_id = "window-" + clean_name(gobj_short_name(gobj));
@@ -5188,7 +5269,7 @@ function mt_create$22(gobj) {
5188
5269
  * it could not be seen, and the next Tab gave it back to the
5189
5270
  * overlay; it opens under it now, and is there when it goes.
5190
5271
  ***************************************************************/
5191
- function mt_start$21(gobj) {
5272
+ function mt_start$22(gobj) {
5192
5273
  let priv = gobj.priv;
5193
5274
  let $container = gobj_read_attr(gobj, "$container");
5194
5275
  if (!$container) {
@@ -5207,7 +5288,7 @@ function mt_start$21(gobj) {
5207
5288
  /***************************************************************
5208
5289
  * Framework Method: Destroy
5209
5290
  ***************************************************************/
5210
- function mt_destroy$22(gobj) {
5291
+ function mt_destroy$23(gobj) {
5211
5292
  let priv = gobj.priv;
5212
5293
  give_focus_back(gobj);
5213
5294
  yui_shell_unwatch_changes(gobj);
@@ -5490,7 +5571,7 @@ function resolve_manager(gobj) {
5490
5571
  if (typeof m === "string") {
5491
5572
  let name = m;
5492
5573
  m = gobj_find_service(name, false) || null;
5493
- if (!m) log_warning(`${GCLASS_NAME$22}: window manager '${name}' not found: no dock, no minimize`);
5574
+ if (!m) log_warning(`${GCLASS_NAME$23}: window manager '${name}' not found: no dock, no minimize`);
5494
5575
  gobj_write_attr(gobj, "manager", m);
5495
5576
  }
5496
5577
  return m;
@@ -6267,16 +6348,16 @@ function ac_shell_changed$2(gobj, event, kw, src) {
6267
6348
  /***************************
6268
6349
  * FSM
6269
6350
  ***************************/
6270
- var gmt$22 = {
6271
- mt_create: mt_create$22,
6272
- mt_start: mt_start$21,
6273
- mt_destroy: mt_destroy$22
6351
+ var gmt$23 = {
6352
+ mt_create: mt_create$23,
6353
+ mt_start: mt_start$22,
6354
+ mt_destroy: mt_destroy$23
6274
6355
  };
6275
6356
  /***************************************************************
6276
6357
  * Create the GClass
6277
6358
  ***************************************************************/
6278
- function create_gclass$22(gclass_name) {
6279
- if (__gclass__$22) {
6359
+ function create_gclass$23(gclass_name) {
6360
+ if (__gclass__$23) {
6280
6361
  log_error(`GClass ALREADY created: ${gclass_name}`);
6281
6362
  return -1;
6282
6363
  }
@@ -6317,15 +6398,15 @@ function create_gclass$22(gclass_name) {
6317
6398
  ["EV_CLOSE_WINDOW", 0],
6318
6399
  ["EV_SHELL_CHANGED", 0]
6319
6400
  ];
6320
- __gclass__$22 = gclass_create(gclass_name, event_types, states, gmt$22, 0, attrs_table$22, PRIVATE_DATA$22, 0, 0, 0, 0);
6321
- if (!__gclass__$22) return -1;
6401
+ __gclass__$23 = gclass_create(gclass_name, event_types, states, gmt$23, 0, attrs_table$23, PRIVATE_DATA$23, 0, 0, 0, 0);
6402
+ if (!__gclass__$23) return -1;
6322
6403
  return 0;
6323
6404
  }
6324
6405
  /***************************************************************
6325
6406
  * Register GClass
6326
6407
  ***************************************************************/
6327
6408
  function register_c_yui_window() {
6328
- return create_gclass$22(GCLASS_NAME$22);
6409
+ return create_gclass$23(GCLASS_NAME$23);
6329
6410
  }
6330
6411
  // src/c_yui_window_manager.js
6331
6412
  /***********************************************************************
@@ -6371,14 +6452,14 @@ function register_c_yui_window() {
6371
6452
  /***************************************************************
6372
6453
  * Constants
6373
6454
  ***************************************************************/
6374
- var GCLASS_NAME$21 = "C_YUI_WINDOW_MANAGER";
6455
+ var GCLASS_NAME$22 = "C_YUI_WINDOW_MANAGER";
6375
6456
  var DOCK_Z = 1e6;
6376
6457
  var WC_X = "<svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><path d=\"M4.5 4.5 L11.5 11.5 M11.5 4.5 L4.5 11.5\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/></svg>";
6377
6458
  var __chip_seq__ = 0;
6378
6459
  /***************************************************************
6379
6460
  * Data
6380
6461
  ***************************************************************/
6381
- var attrs_table$21 = [
6462
+ var attrs_table$22 = [
6382
6463
  SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
6383
6464
  SDATA(data_type_t.DTP_STRING, "dock_mode", 0, "floating", "floating | inline | responsive (floating on wide screens, inline on narrow)"),
6384
6465
  SDATA(data_type_t.DTP_STRING, "dock_corner", 0, "bottom-left", "Floating placement: top-left | top-right | bottom-left | bottom-right"),
@@ -6388,20 +6469,20 @@ var attrs_table$21 = [
6388
6469
  SDATA(data_type_t.DTP_POINTER, "$container", 0, null, "Internal: the dock element"),
6389
6470
  SDATA_END()
6390
6471
  ];
6391
- var PRIVATE_DATA$21 = {
6472
+ var PRIVATE_DATA$22 = {
6392
6473
  windows: null,
6393
6474
  mql: null,
6394
6475
  mql_handler: null,
6395
6476
  lang_shell: null
6396
6477
  };
6397
- var __gclass__$21 = null;
6478
+ var __gclass__$22 = null;
6398
6479
  /******************************
6399
6480
  * Framework Methods
6400
6481
  ******************************/
6401
6482
  /***************************************************************
6402
6483
  * Framework Method: Create
6403
6484
  ***************************************************************/
6404
- function mt_create$21(gobj) {
6485
+ function mt_create$22(gobj) {
6405
6486
  let priv = gobj.priv;
6406
6487
  priv.windows = [];
6407
6488
  if ((gobj_read_attr(gobj, "dock_mode") || "floating") === "responsive") {
@@ -6421,7 +6502,7 @@ function mt_create$21(gobj) {
6421
6502
  /***************************************************************
6422
6503
  * Framework Method: Destroy
6423
6504
  ***************************************************************/
6424
- function mt_destroy$21(gobj) {
6505
+ function mt_destroy$22(gobj) {
6425
6506
  let priv = gobj.priv;
6426
6507
  yui_shell_unwatch_changes(gobj);
6427
6508
  if (priv.lang_shell) {
@@ -6972,7 +7053,7 @@ function ac_shell_changed$1(gobj, event, kw, src) {
6972
7053
  * language the window was opened in (a reader took the
6973
7054
  * aria-labelledby, which changed; the tooltip did not).
6974
7055
  ************************************************************/
6975
- function ac_language_changed$13(gobj, event, kw, src) {
7056
+ function ac_language_changed$14(gobj, event, kw, src) {
6976
7057
  let priv = gobj.priv;
6977
7058
  for (let entry of priv.windows) {
6978
7059
  if (!entry.title_prefix || !entry.$chip) continue;
@@ -6990,19 +7071,19 @@ function ac_language_changed$13(gobj, event, kw, src) {
6990
7071
  /***************************
6991
7072
  * FSM
6992
7073
  ***************************/
6993
- var gmt$21 = {
6994
- mt_create: mt_create$21,
6995
- mt_destroy: mt_destroy$21
7074
+ var gmt$22 = {
7075
+ mt_create: mt_create$22,
7076
+ mt_destroy: mt_destroy$22
6996
7077
  };
6997
7078
  /***************************************************************
6998
7079
  * Create the GClass
6999
7080
  ***************************************************************/
7000
- function create_gclass$21(gclass_name) {
7001
- if (__gclass__$21) {
7081
+ function create_gclass$22(gclass_name) {
7082
+ if (__gclass__$22) {
7002
7083
  log_error(`GClass ALREADY created: ${gclass_name}`);
7003
7084
  return -1;
7004
7085
  }
7005
- __gclass__$21 = gclass_create(gclass_name, [
7086
+ __gclass__$22 = gclass_create(gclass_name, [
7006
7087
  ["EV_REGISTER_WINDOW", 0],
7007
7088
  ["EV_UNREGISTER_WINDOW", 0],
7008
7089
  ["EV_MINIMIZE_WINDOW", 0],
@@ -7043,18 +7124,18 @@ function create_gclass$21(gclass_name) {
7043
7124
  ],
7044
7125
  [
7045
7126
  "EV_LANGUAGE_CHANGED",
7046
- ac_language_changed$13,
7127
+ ac_language_changed$14,
7047
7128
  null
7048
7129
  ]
7049
- ]]], gmt$21, 0, attrs_table$21, PRIVATE_DATA$21, 0, 0, 0, 0);
7050
- if (!__gclass__$21) return -1;
7130
+ ]]], gmt$22, 0, attrs_table$22, PRIVATE_DATA$22, 0, 0, 0, 0);
7131
+ if (!__gclass__$22) return -1;
7051
7132
  return 0;
7052
7133
  }
7053
7134
  /***************************************************************
7054
7135
  * Register GClass
7055
7136
  ***************************************************************/
7056
7137
  function register_c_yui_window_manager() {
7057
- return create_gclass$21(GCLASS_NAME$21);
7138
+ return create_gclass$22(GCLASS_NAME$22);
7058
7139
  }
7059
7140
  // src/yui_build_stamp.js
7060
7141
  /***********************************************************************
@@ -7234,11 +7315,11 @@ function build_page_url(loc) {
7234
7315
  /***************************************************************
7235
7316
  * Constants
7236
7317
  ***************************************************************/
7237
- var GCLASS_NAME$20 = "C_YUI_UPDATE_WATCH";
7318
+ var GCLASS_NAME$21 = "C_YUI_UPDATE_WATCH";
7238
7319
  /***************************************************************
7239
7320
  * Data
7240
7321
  ***************************************************************/
7241
- var attrs_table$20 = [
7322
+ var attrs_table$21 = [
7242
7323
  SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
7243
7324
  SDATA(data_type_t.DTP_INTEGER, "min_interval_ms", 0, "60000", "Minimum time between two checks, except a forced one"),
7244
7325
  SDATA(data_type_t.DTP_INTEGER, "period_ms", 0, "3600000", "Periodic check, for a screen that never gets the focus back; 0 = off (user-approved exception to No polling)"),
@@ -7247,7 +7328,7 @@ var attrs_table$20 = [
7247
7328
  SDATA(data_type_t.DTP_POINTER, "$parent", 0, null, "Where the bar mounts (default: the shell's notification layer, document.body while there is none)"),
7248
7329
  SDATA_END()
7249
7330
  ];
7250
- var PRIVATE_DATA$20 = {
7331
+ var PRIVATE_DATA$21 = {
7251
7332
  running: null,
7252
7333
  deployed: null,
7253
7334
  dismissed: "",
@@ -7259,7 +7340,7 @@ var PRIVATE_DATA$20 = {
7259
7340
  lang_shell: null,
7260
7341
  dom_handlers: null
7261
7342
  };
7262
- var __gclass__$20 = null;
7343
+ var __gclass__$21 = null;
7263
7344
  var __live_watches__ = [];
7264
7345
  /******************************
7265
7346
  * Framework Methods
@@ -7267,7 +7348,7 @@ var __live_watches__ = [];
7267
7348
  /***************************************************************
7268
7349
  * Framework Method: Create
7269
7350
  ***************************************************************/
7270
- function mt_create$20(gobj) {
7351
+ function mt_create$21(gobj) {
7271
7352
  let priv = gobj.priv;
7272
7353
  priv.running = running_build(typeof document !== "undefined" ? document : null);
7273
7354
  priv.dom_handlers = [];
@@ -7281,7 +7362,7 @@ function mt_create$20(gobj) {
7281
7362
  /***************************************************************
7282
7363
  * Framework Method: Start
7283
7364
  ***************************************************************/
7284
- function mt_start$20(gobj) {
7365
+ function mt_start$21(gobj) {
7285
7366
  let priv = gobj.priv;
7286
7367
  gobj_start(priv.gobj_timer);
7287
7368
  if (!priv.running) {
@@ -7308,7 +7389,7 @@ function mt_start$20(gobj) {
7308
7389
  /***************************************************************
7309
7390
  * Framework Method: Stop
7310
7391
  ***************************************************************/
7311
- function mt_stop$20(gobj) {
7392
+ function mt_stop$21(gobj) {
7312
7393
  let priv = gobj.priv;
7313
7394
  for (let [target, type, fn] of priv.dom_handlers) target.removeEventListener(type, fn);
7314
7395
  priv.dom_handlers = [];
@@ -7318,7 +7399,7 @@ function mt_stop$20(gobj) {
7318
7399
  /***************************************************************
7319
7400
  * Framework Method: Destroy
7320
7401
  ***************************************************************/
7321
- function mt_destroy$20(gobj) {
7402
+ function mt_destroy$21(gobj) {
7322
7403
  let priv = gobj.priv;
7323
7404
  let idx = __live_watches__.indexOf(gobj);
7324
7405
  if (idx >= 0) __live_watches__.splice(idx, 1);
@@ -7612,7 +7693,7 @@ function ac_shell_changed(gobj, event, kw, src) {
7612
7693
  * the shell's container, where the app's refresh does not
7613
7694
  * reach.
7614
7695
  ************************************************************/
7615
- function ac_language_changed$12(gobj, event, kw, src) {
7696
+ function ac_language_changed$13(gobj, event, kw, src) {
7616
7697
  let priv = gobj.priv;
7617
7698
  if (priv.$bar) refresh_language(priv.$bar, t);
7618
7699
  return 0;
@@ -7620,17 +7701,17 @@ function ac_language_changed$12(gobj, event, kw, src) {
7620
7701
  /***************************
7621
7702
  * FSM
7622
7703
  ***************************/
7623
- var gmt$20 = {
7624
- mt_create: mt_create$20,
7625
- mt_start: mt_start$20,
7626
- mt_stop: mt_stop$20,
7627
- mt_destroy: mt_destroy$20
7704
+ var gmt$21 = {
7705
+ mt_create: mt_create$21,
7706
+ mt_start: mt_start$21,
7707
+ mt_stop: mt_stop$21,
7708
+ mt_destroy: mt_destroy$21
7628
7709
  };
7629
7710
  /***************************************************************
7630
7711
  * Create the GClass
7631
7712
  ***************************************************************/
7632
- function create_gclass$20(gclass_name) {
7633
- if (__gclass__$20) {
7713
+ function create_gclass$21(gclass_name) {
7714
+ if (__gclass__$21) {
7634
7715
  log_error(`GClass ALREADY created: ${gclass_name}`);
7635
7716
  return -1;
7636
7717
  }
@@ -7662,7 +7743,7 @@ function create_gclass$20(gclass_name) {
7662
7743
  ],
7663
7744
  [
7664
7745
  "EV_LANGUAGE_CHANGED",
7665
- ac_language_changed$12,
7746
+ ac_language_changed$13,
7666
7747
  null
7667
7748
  ]
7668
7749
  ]], ["ST_STALE", [
@@ -7708,7 +7789,7 @@ function create_gclass$20(gclass_name) {
7708
7789
  ],
7709
7790
  [
7710
7791
  "EV_LANGUAGE_CHANGED",
7711
- ac_language_changed$12,
7792
+ ac_language_changed$13,
7712
7793
  null
7713
7794
  ]
7714
7795
  ]]];
@@ -7725,15 +7806,15 @@ function create_gclass$20(gclass_name) {
7725
7806
  ["EV_NEW_BUILD", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
7726
7807
  ["EV_BUILD_CURRENT", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS]
7727
7808
  ];
7728
- __gclass__$20 = gclass_create(gclass_name, event_types, states, gmt$20, 0, attrs_table$20, PRIVATE_DATA$20, 0, 0, 0, 0);
7729
- if (!__gclass__$20) return -1;
7809
+ __gclass__$21 = gclass_create(gclass_name, event_types, states, gmt$21, 0, attrs_table$21, PRIVATE_DATA$21, 0, 0, 0, 0);
7810
+ if (!__gclass__$21) return -1;
7730
7811
  return 0;
7731
7812
  }
7732
7813
  /***************************************************************
7733
7814
  * Register GClass
7734
7815
  ***************************************************************/
7735
7816
  function register_c_yui_update_watch() {
7736
- return create_gclass$20(GCLASS_NAME$20);
7817
+ return create_gclass$21(GCLASS_NAME$21);
7737
7818
  }
7738
7819
  /***************************************************************
7739
7820
  * The app switched its language (call it AFTER switching the
@@ -7834,11 +7915,11 @@ function pager_back_action(stack, back_on_root) {
7834
7915
  /***************************************************************
7835
7916
  * Constants
7836
7917
  ***************************************************************/
7837
- var GCLASS_NAME$19 = "C_YUI_PAGER";
7918
+ var GCLASS_NAME$20 = "C_YUI_PAGER";
7838
7919
  /***************************************************************
7839
7920
  * Data
7840
7921
  ***************************************************************/
7841
- var attrs_table$19 = [
7922
+ var attrs_table$20 = [
7842
7923
  SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
7843
7924
  SDATA(data_type_t.DTP_STRING, "root_title", 0, "", "Title shown on the root page"),
7844
7925
  SDATA(data_type_t.DTP_BOOLEAN, "back_on_root", 0, true, "On the root page the back affordance emits EV_PAGER_EXIT"),
@@ -7846,15 +7927,15 @@ var attrs_table$19 = [
7846
7927
  SDATA(data_type_t.DTP_POINTER, "$container", 0, null, "HTMLElement root, mounted by the parent"),
7847
7928
  SDATA_END()
7848
7929
  ];
7849
- var PRIVATE_DATA$19 = { stack: null };
7850
- var __gclass__$19 = null;
7930
+ var PRIVATE_DATA$20 = { stack: null };
7931
+ var __gclass__$20 = null;
7851
7932
  /******************************
7852
7933
  * Framework Methods
7853
7934
  ******************************/
7854
7935
  /***************************************************************
7855
7936
  * Framework Method: Create
7856
7937
  ***************************************************************/
7857
- function mt_create$19(gobj) {
7938
+ function mt_create$20(gobj) {
7858
7939
  let priv = gobj.priv;
7859
7940
  priv.stack = [];
7860
7941
  build_ui$17(gobj);
@@ -7865,17 +7946,17 @@ function mt_create$19(gobj) {
7865
7946
  /***************************************************************
7866
7947
  * Framework Method: Start
7867
7948
  ***************************************************************/
7868
- function mt_start$19(gobj) {}
7949
+ function mt_start$20(gobj) {}
7869
7950
  /***************************************************************
7870
7951
  * Framework Method: Stop
7871
7952
  ***************************************************************/
7872
- function mt_stop$19(gobj) {
7953
+ function mt_stop$20(gobj) {
7873
7954
  gobj_stop_children(gobj);
7874
7955
  }
7875
7956
  /***************************************************************
7876
7957
  * Framework Method: Destroy
7877
7958
  ***************************************************************/
7878
- function mt_destroy$19(gobj) {
7959
+ function mt_destroy$20(gobj) {
7879
7960
  destroy_ui$12(gobj);
7880
7961
  }
7881
7962
  /***************************
@@ -8039,7 +8120,7 @@ function ac_push_page(gobj, event, kw, src) {
8039
8120
  let priv = gobj.priv;
8040
8121
  let resolved = resolve_panel$1(kw.content);
8041
8122
  if (!resolved.$el) {
8042
- log_error(`${GCLASS_NAME$19}: EV_PUSH_PAGE without content`);
8123
+ log_error(`${GCLASS_NAME$20}: EV_PUSH_PAGE without content`);
8043
8124
  return -1;
8044
8125
  }
8045
8126
  let $body = gobj_read_attr(gobj, "$container").querySelector(".yui-pager-body");
@@ -8092,7 +8173,7 @@ function ac_replace_page(gobj, event, kw, src) {
8092
8173
  let priv = gobj.priv;
8093
8174
  let resolved = resolve_panel$1(kw.content);
8094
8175
  if (!resolved.$el) {
8095
- log_error(`${GCLASS_NAME$19}: EV_REPLACE_PAGE without content`);
8176
+ log_error(`${GCLASS_NAME$20}: EV_REPLACE_PAGE without content`);
8096
8177
  return -1;
8097
8178
  }
8098
8179
  let $body = gobj_read_attr(gobj, "$container").querySelector(".yui-pager-body");
@@ -8159,17 +8240,17 @@ function ac_resize$5(gobj, event, kw, src) {
8159
8240
  /***************************
8160
8241
  * FSM
8161
8242
  ***************************/
8162
- var gmt$19 = {
8163
- mt_create: mt_create$19,
8164
- mt_start: mt_start$19,
8165
- mt_stop: mt_stop$19,
8166
- mt_destroy: mt_destroy$19
8243
+ var gmt$20 = {
8244
+ mt_create: mt_create$20,
8245
+ mt_start: mt_start$20,
8246
+ mt_stop: mt_stop$20,
8247
+ mt_destroy: mt_destroy$20
8167
8248
  };
8168
8249
  /***************************************************************
8169
8250
  * Create the GClass
8170
8251
  ***************************************************************/
8171
- function create_gclass$19(gclass_name) {
8172
- if (__gclass__$19) {
8252
+ function create_gclass$20(gclass_name) {
8253
+ if (__gclass__$20) {
8173
8254
  log_error(`GClass ALREADY created: ${gclass_name}`);
8174
8255
  return -1;
8175
8256
  }
@@ -8234,15 +8315,15 @@ function create_gclass$19(gclass_name) {
8234
8315
  ["EV_PAGE_DISCARD", event_flag_t.EVF_OUTPUT_EVENT],
8235
8316
  ["EV_PAGER_EXIT", event_flag_t.EVF_OUTPUT_EVENT]
8236
8317
  ];
8237
- __gclass__$19 = gclass_create(gclass_name, event_types, states, gmt$19, 0, attrs_table$19, PRIVATE_DATA$19, 0, 0, 0, 0);
8238
- if (!__gclass__$19) return -1;
8318
+ __gclass__$20 = gclass_create(gclass_name, event_types, states, gmt$20, 0, attrs_table$20, PRIVATE_DATA$20, 0, 0, 0, 0);
8319
+ if (!__gclass__$20) return -1;
8239
8320
  return 0;
8240
8321
  }
8241
8322
  /***************************************************************
8242
8323
  * Register GClass
8243
8324
  ***************************************************************/
8244
8325
  function register_c_yui_pager() {
8245
- return create_gclass$19(GCLASS_NAME$19);
8326
+ return create_gclass$20(GCLASS_NAME$20);
8246
8327
  }
8247
8328
  // src/wizard_helpers.js
8248
8329
  /***********************************************************************
@@ -8361,11 +8442,11 @@ function wizard_should_validate(linear, has_gobj) {
8361
8442
  /***************************************************************
8362
8443
  * Constants
8363
8444
  ***************************************************************/
8364
- var GCLASS_NAME$18 = "C_YUI_WIZARD";
8445
+ var GCLASS_NAME$19 = "C_YUI_WIZARD";
8365
8446
  /***************************************************************
8366
8447
  * Data
8367
8448
  ***************************************************************/
8368
- var attrs_table$18 = [
8449
+ var attrs_table$19 = [
8369
8450
  SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
8370
8451
  SDATA(data_type_t.DTP_STRING, "confirm_label", 0, "confirm", "i18n key of the last-step primary button"),
8371
8452
  SDATA(data_type_t.DTP_STRING, "next_label", 0, "next", "i18n key of the primary button (not last step)"),
@@ -8375,20 +8456,20 @@ var attrs_table$18 = [
8375
8456
  SDATA(data_type_t.DTP_POINTER, "$container", 0, null, "HTMLElement root, mounted by the parent"),
8376
8457
  SDATA_END()
8377
8458
  ];
8378
- var PRIVATE_DATA$18 = {
8459
+ var PRIVATE_DATA$19 = {
8379
8460
  steps: null,
8380
8461
  idx: 0,
8381
8462
  acc: null,
8382
8463
  awaiting: false
8383
8464
  };
8384
- var __gclass__$18 = null;
8465
+ var __gclass__$19 = null;
8385
8466
  /******************************
8386
8467
  * Framework Methods
8387
8468
  ******************************/
8388
8469
  /***************************************************************
8389
8470
  * Framework Method: Create
8390
8471
  ***************************************************************/
8391
- function mt_create$18(gobj) {
8472
+ function mt_create$19(gobj) {
8392
8473
  let priv = gobj.priv;
8393
8474
  priv.steps = [];
8394
8475
  priv.idx = 0;
@@ -8402,17 +8483,17 @@ function mt_create$18(gobj) {
8402
8483
  /***************************************************************
8403
8484
  * Framework Method: Start
8404
8485
  ***************************************************************/
8405
- function mt_start$18(gobj) {}
8486
+ function mt_start$19(gobj) {}
8406
8487
  /***************************************************************
8407
8488
  * Framework Method: Stop
8408
8489
  ***************************************************************/
8409
- function mt_stop$18(gobj) {
8490
+ function mt_stop$19(gobj) {
8410
8491
  gobj_stop_children(gobj);
8411
8492
  }
8412
8493
  /***************************************************************
8413
8494
  * Framework Method: Destroy
8414
8495
  ***************************************************************/
8415
- function mt_destroy$18(gobj) {
8496
+ function mt_destroy$19(gobj) {
8416
8497
  destroy_ui$11(gobj);
8417
8498
  }
8418
8499
  /***************************
@@ -8633,7 +8714,7 @@ function ac_set_steps(gobj, event, kw, src) {
8633
8714
  let priv = gobj.priv;
8634
8715
  let steps_in = kw && kw.steps || [];
8635
8716
  if (steps_in.length === 0) {
8636
- log_error(`${GCLASS_NAME$18}: EV_SET_STEPS with no steps`);
8717
+ log_error(`${GCLASS_NAME$19}: EV_SET_STEPS with no steps`);
8637
8718
  return -1;
8638
8719
  }
8639
8720
  let $body = gobj_read_attr(gobj, "$container").querySelector(".yui-wizard-body");
@@ -8643,7 +8724,7 @@ function ac_set_steps(gobj, event, kw, src) {
8643
8724
  let st = steps_in[i];
8644
8725
  let resolved = resolve_panel(st.content);
8645
8726
  if (!resolved.$el) {
8646
- log_error(`${GCLASS_NAME$18}: step '${st.id}' has no content`);
8727
+ log_error(`${GCLASS_NAME$19}: step '${st.id}' has no content`);
8647
8728
  return -1;
8648
8729
  }
8649
8730
  resolved.$el.classList.add("is-hidden");
@@ -8777,17 +8858,17 @@ function ac_resize$4(gobj, event, kw, src) {
8777
8858
  /***************************
8778
8859
  * FSM
8779
8860
  ***************************/
8780
- var gmt$18 = {
8781
- mt_create: mt_create$18,
8782
- mt_start: mt_start$18,
8783
- mt_stop: mt_stop$18,
8784
- mt_destroy: mt_destroy$18
8861
+ var gmt$19 = {
8862
+ mt_create: mt_create$19,
8863
+ mt_start: mt_start$19,
8864
+ mt_stop: mt_stop$19,
8865
+ mt_destroy: mt_destroy$19
8785
8866
  };
8786
8867
  /***************************************************************
8787
8868
  * Create the GClass
8788
8869
  ***************************************************************/
8789
- function create_gclass$18(gclass_name) {
8790
- if (__gclass__$18) {
8870
+ function create_gclass$19(gclass_name) {
8871
+ if (__gclass__$19) {
8791
8872
  log_error(`GClass ALREADY created: ${gclass_name}`);
8792
8873
  return -1;
8793
8874
  }
@@ -8865,15 +8946,15 @@ function create_gclass$18(gclass_name) {
8865
8946
  ["EV_WIZARD_CANCEL", event_flag_t.EVF_OUTPUT_EVENT],
8866
8947
  ["EV_STEP_VALIDATE", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS]
8867
8948
  ];
8868
- __gclass__$18 = gclass_create(gclass_name, event_types, states, gmt$18, 0, attrs_table$18, PRIVATE_DATA$18, 0, 0, 0, 0);
8869
- if (!__gclass__$18) return -1;
8949
+ __gclass__$19 = gclass_create(gclass_name, event_types, states, gmt$19, 0, attrs_table$19, PRIVATE_DATA$19, 0, 0, 0, 0);
8950
+ if (!__gclass__$19) return -1;
8870
8951
  return 0;
8871
8952
  }
8872
8953
  /***************************************************************
8873
8954
  * Register GClass
8874
8955
  ***************************************************************/
8875
8956
  function register_c_yui_wizard() {
8876
- return create_gclass$18(GCLASS_NAME$18);
8957
+ return create_gclass$19(GCLASS_NAME$19);
8877
8958
  }
8878
8959
  // src/yui_tabulator_i18n.js
8879
8960
  /***********************************************************************
@@ -11749,11 +11830,11 @@ function name_json_editor_menu($editor) {
11749
11830
  /***************************************************************
11750
11831
  * Constants
11751
11832
  ***************************************************************/
11752
- var GCLASS_NAME$17 = "C_YUI_FORM";
11833
+ var GCLASS_NAME$18 = "C_YUI_FORM";
11753
11834
  /***************************************************************
11754
11835
  * Data
11755
11836
  ***************************************************************/
11756
- var attrs_table$17 = [
11837
+ var attrs_table$18 = [
11757
11838
  SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of publishing messages"),
11758
11839
  SDATA(data_type_t.DTP_POINTER, "$parent", 0, null, "$container will be appended to $parent if not null, else do it manually"),
11759
11840
  SDATA(data_type_t.DTP_POINTER, "template", 0, "<div>You must supply a template for form</div>", "Template for form, object -> TEMPLATE, array -> DESC"),
@@ -11784,7 +11865,7 @@ var attrs_table$17 = [
11784
11865
  SDATA(data_type_t.DTP_BOOLEAN, "edited", 0, false, "The reader changed the form (typed, cleared, pasted) since it was loaded, saved or undone: what closing it would lose. A field the record lacks, filled with its default, is a change of the form (`changes`) and not of the reader"),
11785
11866
  SDATA_END()
11786
11867
  ];
11787
- var PRIVATE_DATA$17 = {
11868
+ var PRIVATE_DATA$18 = {
11788
11869
  loading_rows: 0,
11789
11870
  tables: null,
11790
11871
  table_seq: 0,
@@ -11793,14 +11874,14 @@ var PRIVATE_DATA$17 = {
11793
11874
  change_seq: 0,
11794
11875
  cell_edit: null
11795
11876
  };
11796
- var __gclass__$17 = null;
11877
+ var __gclass__$18 = null;
11797
11878
  /***************************
11798
11879
  * Framework Methods
11799
11880
  ***************************/
11800
11881
  /************************************************************
11801
11882
  * Framework Method create
11802
11883
  ************************************************************/
11803
- function mt_create$17(gobj) {
11884
+ function mt_create$18(gobj) {
11804
11885
  let subscriber = gobj_read_pointer_attr(gobj, "subscriber");
11805
11886
  if (!subscriber) subscriber = gobj_parent(gobj);
11806
11887
  gobj_subscribe_event(gobj, null, {}, subscriber);
@@ -11828,14 +11909,14 @@ function mt_writing$2(gobj, path) {
11828
11909
  * In this point, all children
11829
11910
  * and subscriptions are already deleted.
11830
11911
  ************************************************************/
11831
- function mt_destroy$17(gobj) {
11912
+ function mt_destroy$18(gobj) {
11832
11913
  yui_asset_release(gobj_read_attr(gobj, "$container"));
11833
11914
  destroy_ui$10(gobj);
11834
11915
  }
11835
11916
  /************************************************************
11836
11917
  * Framework Method start
11837
11918
  ************************************************************/
11838
- function mt_start$17(gobj) {
11919
+ function mt_start$18(gobj) {
11839
11920
  let priv = gobj.priv;
11840
11921
  let shell = yui_shell_of(gobj);
11841
11922
  if (shell) {
@@ -11848,7 +11929,7 @@ function mt_start$17(gobj) {
11848
11929
  /************************************************************
11849
11930
  * Framework Method stop
11850
11931
  ************************************************************/
11851
- function mt_stop$17(gobj) {
11932
+ function mt_stop$18(gobj) {
11852
11933
  let priv = gobj.priv;
11853
11934
  if (priv.lang_shell && !gobj_is_destroying(priv.lang_shell)) gobj_unsubscribe_event(priv.lang_shell, "EV_LANGUAGE_CHANGED", {}, gobj);
11854
11935
  priv.lang_shell = null;
@@ -14816,7 +14897,7 @@ function ac_name_json_editors(gobj, event, kw, src) {
14816
14897
  * in the old language until it draws it again, so each is told to
14817
14898
  * (a new onRenderMenu), and the render names it again.
14818
14899
  ************************************************************/
14819
- function ac_language_changed$11(gobj, event, kw, src) {
14900
+ function ac_language_changed$12(gobj, event, kw, src) {
14820
14901
  let $container = gobj_read_attr(gobj, "$container");
14821
14902
  if (!$container) return 0;
14822
14903
  for (let $editor of $container.querySelectorAll(".jsoneditor")) {
@@ -14886,19 +14967,19 @@ function cmd_get_picked_files(gobj, cmd, kw, src) {
14886
14967
  data: files
14887
14968
  };
14888
14969
  }
14889
- var gmt$17 = {
14890
- mt_create: mt_create$17,
14970
+ var gmt$18 = {
14971
+ mt_create: mt_create$18,
14891
14972
  mt_writing: mt_writing$2,
14892
- mt_start: mt_start$17,
14893
- mt_stop: mt_stop$17,
14894
- mt_destroy: mt_destroy$17,
14973
+ mt_start: mt_start$18,
14974
+ mt_stop: mt_stop$18,
14975
+ mt_destroy: mt_destroy$18,
14895
14976
  mt_command_parser: mt_command_parser$2
14896
14977
  };
14897
14978
  /***************************************************************
14898
14979
  * Create the GClass
14899
14980
  ***************************************************************/
14900
- function create_gclass$17(gclass_name) {
14901
- if (__gclass__$17) {
14981
+ function create_gclass$18(gclass_name) {
14982
+ if (__gclass__$18) {
14902
14983
  log_error(`GClass ALREADY created: ${gclass_name}`);
14903
14984
  return -1;
14904
14985
  }
@@ -15005,7 +15086,7 @@ function create_gclass$17(gclass_name) {
15005
15086
  ],
15006
15087
  [
15007
15088
  "EV_LANGUAGE_CHANGED",
15008
- ac_language_changed$11,
15089
+ ac_language_changed$12,
15009
15090
  null
15010
15091
  ]
15011
15092
  ]]];
@@ -15032,16 +15113,16 @@ function create_gclass$17(gclass_name) {
15032
15113
  ["EV_NAME_JSON_EDITORS", 0],
15033
15114
  ["EV_LANGUAGE_CHANGED", 0]
15034
15115
  ];
15035
- __gclass__$17 = gclass_create(gclass_name, event_types, states, gmt$17, 0, attrs_table$17, PRIVATE_DATA$17, 0, 0, 0, 0);
15036
- if (!__gclass__$17) return -1;
15116
+ __gclass__$18 = gclass_create(gclass_name, event_types, states, gmt$18, 0, attrs_table$18, PRIVATE_DATA$18, 0, 0, 0, 0);
15117
+ if (!__gclass__$18) return -1;
15037
15118
  return 0;
15038
15119
  }
15039
15120
  /***************************************************************
15040
15121
  * Register GClass
15041
15122
  ***************************************************************/
15042
15123
  function register_c_yui_form() {
15043
- if (gclass_find_by_name(GCLASS_NAME$17, false)) return 0;
15044
- return create_gclass$17(GCLASS_NAME$17);
15124
+ if (gclass_find_by_name(GCLASS_NAME$18, false)) return 0;
15125
+ return create_gclass$18(GCLASS_NAME$18);
15045
15126
  }
15046
15127
  // src/lib_maplibre.js
15047
15128
  /***********************************************************************
@@ -15284,12 +15365,12 @@ function yui_maplibre_relocalize(map, t) {
15284
15365
  /***************************************************************
15285
15366
  * Constants
15286
15367
  ***************************************************************/
15287
- var GCLASS_NAME$16 = "C_YUI_MAP";
15368
+ var GCLASS_NAME$17 = "C_YUI_MAP";
15288
15369
  var GESTURE_HINT_MS = 2e3;
15289
15370
  /***************************************************************
15290
15371
  * Data
15291
15372
  ***************************************************************/
15292
- var attrs_table$16 = [
15373
+ var attrs_table$17 = [
15293
15374
  SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
15294
15375
  SDATA(data_type_t.DTP_JSON, "devices", "[]", null, "List of devices"),
15295
15376
  SDATA(data_type_t.DTP_JSON, "map_settings", 0, {
@@ -15310,7 +15391,7 @@ var attrs_table$16 = [
15310
15391
  SDATA(data_type_t.DTP_INTEGER, "timeout_idle", 0, 5, "Idle timeout in seconds"),
15311
15392
  SDATA_END()
15312
15393
  ];
15313
- var PRIVATE_DATA$16 = {
15394
+ var PRIVATE_DATA$17 = {
15314
15395
  xmap: null,
15315
15396
  gesture_hint_timer: null,
15316
15397
  geojson: null,
@@ -15320,21 +15401,21 @@ var PRIVATE_DATA$16 = {
15320
15401
  markers: {},
15321
15402
  draggedFeature: null
15322
15403
  };
15323
- var __gclass__$16 = null;
15404
+ var __gclass__$17 = null;
15324
15405
  /******************************
15325
15406
  * Framework Methods
15326
15407
  ******************************/
15327
15408
  /***************************************************************
15328
15409
  * Framework Method: Create
15329
15410
  ***************************************************************/
15330
- function mt_create$16(gobj) {
15411
+ function mt_create$17(gobj) {
15331
15412
  let priv = gobj.priv;
15332
15413
  let subscriber = gobj_read_pointer_attr(gobj, "subscriber");
15333
15414
  if (!subscriber) subscriber = gobj_parent(gobj);
15334
15415
  gobj_subscribe_event(gobj, null, {}, subscriber);
15335
15416
  let map_settings = json_deep_copy(gobj_read_attr(gobj, "map_settings"));
15336
15417
  let $map = gobj_read_attr(gobj, "$map");
15337
- if ($map) $map.classList.add(GCLASS_NAME$16);
15418
+ if ($map) $map.classList.add(GCLASS_NAME$17);
15338
15419
  Object.assign(map_settings, {
15339
15420
  container: $map,
15340
15421
  cooperativeGestures: true,
@@ -15399,7 +15480,7 @@ function mt_create$16(gobj) {
15399
15480
  * rewritten in place, and the map's locale with them so a
15400
15481
  * control or a popup built later is right too.
15401
15482
  ***************************************************************/
15402
- function ac_language_changed$10(gobj, event, kw, src) {
15483
+ function ac_language_changed$11(gobj, event, kw, src) {
15403
15484
  let priv = gobj.priv;
15404
15485
  if (priv.xmap) yui_maplibre_relocalize(priv.xmap, t);
15405
15486
  return 0;
@@ -15413,7 +15494,7 @@ function ac_language_changed$10(gobj, event, kw, src) {
15413
15494
  * in OUR dom -- cannot touch any of it. The shell says when the
15414
15495
  * language changed and this view rewrites those strings.
15415
15496
  ***************************************************************/
15416
- function mt_start$16(gobj) {
15497
+ function mt_start$17(gobj) {
15417
15498
  let shell = yui_shell_of(gobj);
15418
15499
  if (shell) gobj_subscribe_event(shell, "EV_LANGUAGE_CHANGED", {}, gobj);
15419
15500
  return 0;
@@ -15421,7 +15502,7 @@ function mt_start$16(gobj) {
15421
15502
  /***************************************************************
15422
15503
  * Framework Method: Stop
15423
15504
  ***************************************************************/
15424
- function mt_stop$16(gobj) {
15505
+ function mt_stop$17(gobj) {
15425
15506
  let shell = yui_shell_of(gobj);
15426
15507
  if (shell) gobj_unsubscribe_event(shell, "EV_LANGUAGE_CHANGED", {}, gobj);
15427
15508
  retire_marker_windows(gobj);
@@ -15442,7 +15523,7 @@ function retire_marker_windows(gobj) {
15442
15523
  /***************************************************************
15443
15524
  * Framework Method: Destroy
15444
15525
  ***************************************************************/
15445
- function mt_destroy$16(gobj) {
15526
+ function mt_destroy$17(gobj) {
15446
15527
  let priv = gobj.priv;
15447
15528
  if (priv.gesture_hint_timer) {
15448
15529
  clearTimeout(priv.gesture_hint_timer);
@@ -15940,21 +16021,21 @@ function ac_hide$10(gobj, event, kw, src) {
15940
16021
  /***************************
15941
16022
  * FSM
15942
16023
  ***************************/
15943
- var gmt$16 = {
15944
- mt_create: mt_create$16,
15945
- mt_start: mt_start$16,
15946
- mt_stop: mt_stop$16,
15947
- mt_destroy: mt_destroy$16
16024
+ var gmt$17 = {
16025
+ mt_create: mt_create$17,
16026
+ mt_start: mt_start$17,
16027
+ mt_stop: mt_stop$17,
16028
+ mt_destroy: mt_destroy$17
15948
16029
  };
15949
16030
  /***************************************************************
15950
16031
  * Create the GClass
15951
16032
  ***************************************************************/
15952
- function create_gclass$16(gclass_name) {
15953
- if (__gclass__$16) {
16033
+ function create_gclass$17(gclass_name) {
16034
+ if (__gclass__$17) {
15954
16035
  log_error(`GClass ALREADY created: ${gclass_name}`);
15955
16036
  return -1;
15956
16037
  }
15957
- __gclass__$16 = gclass_create(gclass_name, [
16038
+ __gclass__$17 = gclass_create(gclass_name, [
15958
16039
  ["EV_LANGUAGE_CHANGED", 0],
15959
16040
  ["EV_EDIT_MAP", 0],
15960
16041
  ["EV_CONTROL_MAP", 0],
@@ -15967,7 +16048,7 @@ function create_gclass$16(gclass_name) {
15967
16048
  ], [["ST_IDLE", [
15968
16049
  [
15969
16050
  "EV_LANGUAGE_CHANGED",
15970
- ac_language_changed$10,
16051
+ ac_language_changed$11,
15971
16052
  null
15972
16053
  ],
15973
16054
  [
@@ -16010,15 +16091,15 @@ function create_gclass$16(gclass_name) {
16010
16091
  ac_hide$10,
16011
16092
  null
16012
16093
  ]
16013
- ]]], gmt$16, 0, attrs_table$16, PRIVATE_DATA$16, 0, 0, 0, 0);
16014
- if (!__gclass__$16) return -1;
16094
+ ]]], gmt$17, 0, attrs_table$17, PRIVATE_DATA$17, 0, 0, 0, 0);
16095
+ if (!__gclass__$17) return -1;
16015
16096
  return 0;
16016
16097
  }
16017
16098
  /***************************************************************
16018
16099
  * Register GClass
16019
16100
  ***************************************************************/
16020
16101
  function register_c_yui_map() {
16021
- return create_gclass$16(GCLASS_NAME$16);
16102
+ return create_gclass$17(GCLASS_NAME$17);
16022
16103
  }
16023
16104
  // src/yui_uplot_ink.js
16024
16105
  /***********************************************************************
@@ -16282,11 +16363,11 @@ function yui_uplot_fmt_date(get_locale) {
16282
16363
  /***************************************************************
16283
16364
  * Constants
16284
16365
  ***************************************************************/
16285
- var GCLASS_NAME$15 = "C_YUI_UPLOT";
16366
+ var GCLASS_NAME$16 = "C_YUI_UPLOT";
16286
16367
  /***************************************************************
16287
16368
  * Data
16288
16369
  ***************************************************************/
16289
- var attrs_table$15 = [
16370
+ var attrs_table$16 = [
16290
16371
  SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
16291
16372
  SDATA(data_type_t.DTP_STRING, "title", 0, "", "Chart title"),
16292
16373
  SDATA(data_type_t.DTP_INTEGER, "width", 0, 800, "Chart width"),
@@ -16304,18 +16385,18 @@ var attrs_table$15 = [
16304
16385
  SDATA(data_type_t.DTP_INTEGER, "timeout_idle", 0, 5, "Idle timeout (seconds)"),
16305
16386
  SDATA_END()
16306
16387
  ];
16307
- var PRIVATE_DATA$15 = {
16388
+ var PRIVATE_DATA$16 = {
16308
16389
  theme_observer: null,
16309
16390
  lang_shell: null
16310
16391
  };
16311
- var __gclass__$15 = null;
16392
+ var __gclass__$16 = null;
16312
16393
  /******************************
16313
16394
  * Framework Methods
16314
16395
  ******************************/
16315
16396
  /***************************************************************
16316
16397
  * Framework Method: Create
16317
16398
  ***************************************************************/
16318
- function mt_create$15(gobj) {
16399
+ function mt_create$16(gobj) {
16319
16400
  build_ui$14(gobj);
16320
16401
  gobj.priv.theme_observer = yui_watch_theme(gobj);
16321
16402
  let subscriber = gobj_read_pointer_attr(gobj, "subscriber");
@@ -16325,7 +16406,7 @@ function mt_create$15(gobj) {
16325
16406
  /***************************************************************
16326
16407
  * Framework Method: Start
16327
16408
  ***************************************************************/
16328
- function mt_start$15(gobj) {
16409
+ function mt_start$16(gobj) {
16329
16410
  let priv = gobj.priv;
16330
16411
  let shell = yui_shell_of(gobj);
16331
16412
  if (shell) {
@@ -16336,7 +16417,7 @@ function mt_start$15(gobj) {
16336
16417
  /***************************************************************
16337
16418
  * Framework Method: Stop
16338
16419
  ***************************************************************/
16339
- function mt_stop$15(gobj) {
16420
+ function mt_stop$16(gobj) {
16340
16421
  let priv = gobj.priv;
16341
16422
  if (priv.lang_shell && !gobj_is_destroying(priv.lang_shell)) gobj_unsubscribe_event(priv.lang_shell, "EV_LANGUAGE_CHANGED", {}, gobj);
16342
16423
  priv.lang_shell = null;
@@ -16344,7 +16425,7 @@ function mt_stop$15(gobj) {
16344
16425
  /***************************************************************
16345
16426
  * Framework Method: Destroy
16346
16427
  ***************************************************************/
16347
- function mt_destroy$15(gobj) {
16428
+ function mt_destroy$16(gobj) {
16348
16429
  if (gobj.priv.theme_observer) {
16349
16430
  gobj.priv.theme_observer.disconnect();
16350
16431
  gobj.priv.theme_observer = null;
@@ -16505,7 +16586,7 @@ function ac_theme$4(gobj, event, kw, src) {
16505
16586
  * reading of the legend ask for it when they are written,
16506
16587
  * so they are written again.
16507
16588
  ******************************************************/
16508
- function ac_language_changed$9(gobj, event, kw, src) {
16589
+ function ac_language_changed$10(gobj, event, kw, src) {
16509
16590
  let uplot = gobj_read_attr(gobj, "uplot");
16510
16591
  if (!uplot) return 0;
16511
16592
  try {
@@ -16545,21 +16626,21 @@ function ac_clear$1(gobj, event, kw, src) {
16545
16626
  /***************************
16546
16627
  * FSM
16547
16628
  ***************************/
16548
- var gmt$15 = {
16549
- mt_create: mt_create$15,
16550
- mt_start: mt_start$15,
16551
- mt_stop: mt_stop$15,
16552
- mt_destroy: mt_destroy$15
16629
+ var gmt$16 = {
16630
+ mt_create: mt_create$16,
16631
+ mt_start: mt_start$16,
16632
+ mt_stop: mt_stop$16,
16633
+ mt_destroy: mt_destroy$16
16553
16634
  };
16554
16635
  /***************************************************************
16555
16636
  * Create the GClass
16556
16637
  ***************************************************************/
16557
- function create_gclass$15(gclass_name) {
16558
- if (__gclass__$15) {
16638
+ function create_gclass$16(gclass_name) {
16639
+ if (__gclass__$16) {
16559
16640
  log_error(`GClass ALREADY created: ${gclass_name}`);
16560
16641
  return -1;
16561
16642
  }
16562
- __gclass__$15 = gclass_create(gclass_name, [
16643
+ __gclass__$16 = gclass_create(gclass_name, [
16563
16644
  ["EV_LOAD_DATA", 0],
16564
16645
  ["EV_ADD_SERIE", 0],
16565
16646
  ["EV_DEL_SERIE", 0],
@@ -16594,18 +16675,18 @@ function create_gclass$15(gclass_name) {
16594
16675
  ],
16595
16676
  [
16596
16677
  "EV_LANGUAGE_CHANGED",
16597
- ac_language_changed$9,
16678
+ ac_language_changed$10,
16598
16679
  null
16599
16680
  ]
16600
- ]]], gmt$15, 0, attrs_table$15, PRIVATE_DATA$15, 0, 0, 0, 0);
16601
- if (!__gclass__$15) return -1;
16681
+ ]]], gmt$16, 0, attrs_table$16, PRIVATE_DATA$16, 0, 0, 0, 0);
16682
+ if (!__gclass__$16) return -1;
16602
16683
  return 0;
16603
16684
  }
16604
16685
  /***************************************************************
16605
16686
  * Register GClass
16606
16687
  ***************************************************************/
16607
16688
  function register_c_yui_uplot() {
16608
- return create_gclass$15(GCLASS_NAME$15);
16689
+ return create_gclass$16(GCLASS_NAME$16);
16609
16690
  }
16610
16691
  // src/yui_toolbar.js
16611
16692
  function yui_toolbar(attrs = {}, items = []) {
@@ -44551,7 +44632,7 @@ function keep_canvas_tab_order(gobj, graph, name_key) {
44551
44632
  /***************************************************************
44552
44633
  * Constants
44553
44634
  ***************************************************************/
44554
- var GCLASS_NAME$14 = "C_YUI_JSON_GRAPH";
44635
+ var GCLASS_NAME$15 = "C_YUI_JSON_GRAPH";
44555
44636
  var FOLD_SWALLOWED_EVENTS$1 = [
44556
44637
  "pointerdown",
44557
44638
  "pointerup",
@@ -44616,7 +44697,7 @@ function layout_label(key) {
44616
44697
  /***************************************************************
44617
44698
  * Data
44618
44699
  ***************************************************************/
44619
- var attrs_table$14 = [
44700
+ var attrs_table$15 = [
44620
44701
  SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
44621
44702
  SDATA(data_type_t.DTP_STRING, "path", 0, "", "Root path label"),
44622
44703
  SDATA(data_type_t.DTP_JSON, "json_data", 0, null, "JSON data to visualize"),
@@ -44627,7 +44708,7 @@ var attrs_table$14 = [
44627
44708
  SDATA(data_type_t.DTP_INTEGER, "minimap_min_nodes", 0, 10, "Show the minimap from this many cards on (0 = never), as the treedb graph does"),
44628
44709
  SDATA_END()
44629
44710
  ];
44630
- var PRIVATE_DATA$14 = {
44711
+ var PRIVATE_DATA$15 = {
44631
44712
  canvas_id: "",
44632
44713
  graph: null,
44633
44714
  node_counter: 0,
@@ -44658,7 +44739,7 @@ var PRIVATE_DATA$14 = {
44658
44739
  lit_edge_id: "",
44659
44740
  cards: null
44660
44741
  };
44661
- var __gclass__$14 = null;
44742
+ var __gclass__$15 = null;
44662
44743
  var __layout_registered__$1 = false;
44663
44744
  /***************************************************************
44664
44745
  * Type colours, ONE EXPLICIT PALETTE PER THEME and not a
@@ -44763,7 +44844,7 @@ function type_color(type, dark) {
44763
44844
  /***************************************************************
44764
44845
  * Framework Method: Create
44765
44846
  ***************************************************************/
44766
- function mt_create$14(gobj) {
44847
+ function mt_create$15(gobj) {
44767
44848
  let priv = gobj.priv;
44768
44849
  priv.collapsed = /* @__PURE__ */ new Set();
44769
44850
  priv.reserved = /* @__PURE__ */ new Map();
@@ -44786,18 +44867,18 @@ function mt_create$14(gobj) {
44786
44867
  /***************************************************************
44787
44868
  * Framework Method: Start
44788
44869
  ***************************************************************/
44789
- function mt_start$14(gobj) {
44870
+ function mt_start$15(gobj) {
44790
44871
  build_graph$4(gobj);
44791
44872
  load_json(gobj);
44792
44873
  }
44793
44874
  /***************************************************************
44794
44875
  * Framework Method: Stop
44795
44876
  ***************************************************************/
44796
- function mt_stop$14(gobj) {}
44877
+ function mt_stop$15(gobj) {}
44797
44878
  /***************************************************************
44798
44879
  * Framework Method: Destroy
44799
44880
  ***************************************************************/
44800
- function mt_destroy$14(gobj) {
44881
+ function mt_destroy$15(gobj) {
44801
44882
  if (gobj.priv.find_timer) {
44802
44883
  clearTimeout(gobj.priv.find_timer);
44803
44884
  gobj.priv.find_timer = null;
@@ -46338,17 +46419,17 @@ function ac_hide$9(gobj, event, kw, src) {
46338
46419
  /***************************
46339
46420
  * FSM
46340
46421
  ***************************/
46341
- var gmt$14 = {
46342
- mt_create: mt_create$14,
46343
- mt_start: mt_start$14,
46344
- mt_stop: mt_stop$14,
46345
- mt_destroy: mt_destroy$14
46422
+ var gmt$15 = {
46423
+ mt_create: mt_create$15,
46424
+ mt_start: mt_start$15,
46425
+ mt_stop: mt_stop$15,
46426
+ mt_destroy: mt_destroy$15
46346
46427
  };
46347
46428
  /***************************************************************
46348
46429
  * Create the GClass
46349
46430
  ***************************************************************/
46350
- function create_gclass$14(gclass_name) {
46351
- if (__gclass__$14) {
46431
+ function create_gclass$15(gclass_name) {
46432
+ if (__gclass__$15) {
46352
46433
  log_error(`GClass ALREADY created: ${gclass_name}`);
46353
46434
  return -1;
46354
46435
  }
@@ -46477,16 +46558,16 @@ function create_gclass$14(gclass_name) {
46477
46558
  ["EV_HIDE", 0],
46478
46559
  ["EV_JSON_ITEM_CLICKED", event_flag_t.EVF_OUTPUT_EVENT]
46479
46560
  ];
46480
- __gclass__$14 = gclass_create(gclass_name, event_types, states, gmt$14, 0, attrs_table$14, PRIVATE_DATA$14, 0, 0, 0, 0);
46481
- if (!__gclass__$14) return -1;
46561
+ __gclass__$15 = gclass_create(gclass_name, event_types, states, gmt$15, 0, attrs_table$15, PRIVATE_DATA$15, 0, 0, 0, 0);
46562
+ if (!__gclass__$15) return -1;
46482
46563
  return 0;
46483
46564
  }
46484
46565
  /***************************************************************
46485
46566
  * Register GClass
46486
46567
  ***************************************************************/
46487
46568
  function register_c_yui_json_graph() {
46488
- if (gclass_find_by_name(GCLASS_NAME$14, false)) return 0;
46489
- return create_gclass$14(GCLASS_NAME$14);
46569
+ if (gclass_find_by_name(GCLASS_NAME$15, false)) return 0;
46570
+ return create_gclass$15(GCLASS_NAME$15);
46490
46571
  }
46491
46572
  // src/c_yui_json.js
46492
46573
  /***********************************************************************
@@ -46550,7 +46631,7 @@ function register_c_yui_json_graph() {
46550
46631
  /***************************************************************
46551
46632
  * Constants
46552
46633
  ***************************************************************/
46553
- var GCLASS_NAME$13 = "C_YUI_JSON";
46634
+ var GCLASS_NAME$14 = "C_YUI_JSON";
46554
46635
  var MAX_RENDER_ROWS = 5e3;
46555
46636
  var MAX_TEXT_CHARS = 2e6;
46556
46637
  var MAX_LABEL_CHARS = 40;
@@ -46575,7 +46656,7 @@ var VIEW_MODE_STORAGE_KEY = "yui_json_view_mode";
46575
46656
  /***************************************************************
46576
46657
  * Data
46577
46658
  ***************************************************************/
46578
- var attrs_table$13 = [
46659
+ var attrs_table$14 = [
46579
46660
  SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
46580
46661
  SDATA(data_type_t.DTP_STRING, "title", 0, "", "Optional header title (i18n key)"),
46581
46662
  SDATA(data_type_t.DTP_JSON, "json_data", 0, null, "Initial JSON to render (usually already collapsed)"),
@@ -46583,7 +46664,7 @@ var attrs_table$13 = [
46583
46664
  SDATA(data_type_t.DTP_POINTER, "$container", 0, null, "HTMLElement root, mounted by the parent"),
46584
46665
  SDATA_END()
46585
46666
  ];
46586
- var PRIVATE_DATA$13 = {
46667
+ var PRIVATE_DATA$14 = {
46587
46668
  root: null,
46588
46669
  expanded: null,
46589
46670
  pending: null,
@@ -46601,14 +46682,14 @@ var PRIVATE_DATA$13 = {
46601
46682
  $mode_btns: null,
46602
46683
  lang_shell: null
46603
46684
  };
46604
- var __gclass__$13 = null;
46685
+ var __gclass__$14 = null;
46605
46686
  /******************************
46606
46687
  * Framework Methods
46607
46688
  ******************************/
46608
46689
  /***************************************************************
46609
46690
  * Framework Method: Create
46610
46691
  ***************************************************************/
46611
- function mt_create$13(gobj) {
46692
+ function mt_create$14(gobj) {
46612
46693
  let priv = gobj.priv;
46613
46694
  priv.expanded = /* @__PURE__ */ new Set();
46614
46695
  priv.pending = /* @__PURE__ */ new Set();
@@ -46626,7 +46707,7 @@ function mt_create$13(gobj) {
46626
46707
  /***************************************************************
46627
46708
  * Framework Method: Start
46628
46709
  ***************************************************************/
46629
- function mt_start$13(gobj) {
46710
+ function mt_start$14(gobj) {
46630
46711
  let priv = gobj.priv;
46631
46712
  if (priv.root !== null) gobj_change_state(gobj, "ST_READY");
46632
46713
  let shell = yui_shell_of(gobj);
@@ -46639,7 +46720,7 @@ function mt_start$13(gobj) {
46639
46720
  /***************************************************************
46640
46721
  * Framework Method: Stop
46641
46722
  ***************************************************************/
46642
- function mt_stop$13(gobj) {
46723
+ function mt_stop$14(gobj) {
46643
46724
  let priv = gobj.priv;
46644
46725
  if (priv.lang_shell && !gobj_is_destroying(priv.lang_shell)) gobj_unsubscribe_event(priv.lang_shell, "EV_LANGUAGE_CHANGED", {}, gobj);
46645
46726
  priv.lang_shell = null;
@@ -46648,7 +46729,7 @@ function mt_stop$13(gobj) {
46648
46729
  /***************************************************************
46649
46730
  * Framework Method: Destroy
46650
46731
  ***************************************************************/
46651
- function mt_destroy$13(gobj) {
46732
+ function mt_destroy$14(gobj) {
46652
46733
  destroy_ui$7(gobj);
46653
46734
  }
46654
46735
  /***************************
@@ -46705,6 +46786,8 @@ function build_ui$12(gobj) {
46705
46786
  priv.$search_ctl = $container.querySelector(".JSON_SEARCH_CONTROL");
46706
46787
  priv.$expand_btn = $container.querySelector(".EV_EXPAND_ALL");
46707
46788
  priv.$collapse_btn = $container.querySelector(".EV_COLLAPSE_ALL");
46789
+ priv.$collapse_level_btn = $container.querySelector(".EV_COLLAPSE_LEVEL");
46790
+ priv.$expand_level_btn = $container.querySelector(".EV_EXPAND_LEVEL");
46708
46791
  priv.$graph = $container.querySelector(".JSON_GRAPH");
46709
46792
  priv.$mode_btns = /* @__PURE__ */ new Map();
46710
46793
  VIEWS$1.forEach(function(v) {
@@ -46731,6 +46814,8 @@ function destroy_ui$7(gobj) {
46731
46814
  priv.$search_ctl = null;
46732
46815
  priv.$expand_btn = null;
46733
46816
  priv.$collapse_btn = null;
46817
+ priv.$collapse_level_btn = null;
46818
+ priv.$expand_level_btn = null;
46734
46819
  priv.$mode_btns = null;
46735
46820
  }
46736
46821
  /************************************************************
@@ -46778,7 +46863,7 @@ function make_toolbar$4(gobj) {
46778
46863
  [yui_toolbar_icon("yi-magnifying-glass")]
46779
46864
  ]]
46780
46865
  ]);
46781
- left_items.push(icon_button$1(gobj, "yi-angles-down", "EV_EXPAND_ALL", "expand loaded"), icon_button$1(gobj, "yi-angles-up", "EV_COLLAPSE_ALL", "collapse all"));
46866
+ left_items.push(icon_button$1(gobj, "yi-angles-down", "EV_EXPAND_ALL", "expand loaded"), icon_button$1(gobj, "yi-angles-up", "EV_COLLAPSE_ALL", "collapse all"), icon_button$1(gobj, "yi-square-minus", "EV_COLLAPSE_LEVEL", "collapse one level"), icon_button$1(gobj, "yi-square-plus", "EV_EXPAND_LEVEL", "expand one level"));
46782
46867
  attach_clear($search_control, $search_input);
46783
46868
  left_items.push($search_control);
46784
46869
  let right_items = [view_mode_switch$1(gobj), icon_button$1(gobj, "yi-copy", "EV_COPY_ALL", "copy json")];
@@ -46936,7 +47021,9 @@ function apply_view_mode$1(gobj) {
46936
47021
  [
46937
47022
  priv.$search_ctl,
46938
47023
  priv.$expand_btn,
46939
- priv.$collapse_btn
47024
+ priv.$collapse_btn,
47025
+ priv.$collapse_level_btn,
47026
+ priv.$expand_level_btn
46940
47027
  ].forEach(function($el) {
46941
47028
  if ($el) $el.classList.toggle("is-hidden", mode !== "tree");
46942
47029
  });
@@ -47054,7 +47141,7 @@ function render_text(gobj) {
47054
47141
  return;
47055
47142
  }
47056
47143
  let dump = json_text_dump(priv.root, MAX_TEXT_CHARS);
47057
- if (dump.error) log_error(`${GCLASS_NAME$13}: cannot dump the document as text: ${dump.error}`);
47144
+ if (dump.error) log_error(`${GCLASS_NAME$14}: cannot dump the document as text: ${dump.error}`);
47058
47145
  let $pre = createElement2([
47059
47146
  "pre",
47060
47147
  { class: "JSON_TEXT_BODY" },
@@ -47407,6 +47494,70 @@ function collect_loaded_paths(value, segments, out) {
47407
47494
  });
47408
47495
  }
47409
47496
  }
47497
+ /************************************************************
47498
+ * The entries of a container, as [key, value] pairs: the keys
47499
+ * of an object, the indexes of an array (as strings, the way
47500
+ * a path spells them). None for anything else.
47501
+ ************************************************************/
47502
+ function entries_of(value) {
47503
+ let type = json_type(value);
47504
+ if (type === "object") return Object.entries(value);
47505
+ if (type === "array") return value.map((v, i) => [String(i), v]);
47506
+ return [];
47507
+ }
47508
+ /************************************************************
47509
+ * Is it a container the tree can open in place: an object or
47510
+ * an array that is loaded (not a `__collapsed__` sentinel,
47511
+ * which opens through the backend).
47512
+ ************************************************************/
47513
+ function is_open_able(value) {
47514
+ if (is_collapsed(value)) return false;
47515
+ let type = json_type(value);
47516
+ return type === "object" || type === "array";
47517
+ }
47518
+ /************************************************************
47519
+ * The shallowest level that has a loaded container still
47520
+ * closed, -1 when every loaded container is open. A level is
47521
+ * the depth of a row: 0 for an entry of the root.
47522
+ ************************************************************/
47523
+ function first_closed_level(priv, value, segments) {
47524
+ let level = -1;
47525
+ for (let [k, v] of entries_of(value)) {
47526
+ if (!is_open_able(v)) continue;
47527
+ let child = segments.concat(k);
47528
+ let found = priv.expanded.has(seg_join(child)) ? first_closed_level(priv, v, child) : child.length - 1;
47529
+ if (found >= 0 && (level < 0 || found < level)) level = found;
47530
+ }
47531
+ return level;
47532
+ }
47533
+ /************************************************************
47534
+ * The deepest level with a container open in sight (all its
47535
+ * parents open too), -1 when none is. Only what the reader
47536
+ * sees counts: an open container under a closed one is not
47537
+ * on screen, and folding it would change nothing they see.
47538
+ ************************************************************/
47539
+ function deepest_open_level(priv, value, segments) {
47540
+ let level = -1;
47541
+ for (let [k, v] of entries_of(value)) {
47542
+ if (!is_open_able(v)) continue;
47543
+ let child = segments.concat(k);
47544
+ if (!priv.expanded.has(seg_join(child))) continue;
47545
+ level = Math.max(level, child.length - 1, deepest_open_level(priv, v, child));
47546
+ }
47547
+ return level;
47548
+ }
47549
+ /************************************************************
47550
+ * Open every loaded container of the levels up to `level`.
47551
+ ************************************************************/
47552
+ function open_levels_up_to(priv, value, segments, level) {
47553
+ for (let [k, v] of entries_of(value)) {
47554
+ if (!is_open_able(v)) continue;
47555
+ let child = segments.concat(k);
47556
+ if (child.length - 1 > level) continue;
47557
+ priv.expanded.add(seg_join(child));
47558
+ open_levels_up_to(priv, v, child, level);
47559
+ }
47560
+ }
47410
47561
  /***************************
47411
47562
  * Actions
47412
47563
  ***************************/
@@ -47462,8 +47613,8 @@ function ac_subtree_error(gobj, event, kw, src) {
47462
47613
  error,
47463
47614
  is_key
47464
47615
  });
47465
- if (kw.by_design) log_warning(`${GCLASS_NAME$13}: subtree not loaded at '${path}': ${error}`);
47466
- else log_error(`${GCLASS_NAME$13}: subtree load failed at '${path}': ${error}`);
47616
+ if (kw.by_design) log_warning(`${GCLASS_NAME$14}: subtree not loaded at '${path}': ${error}`);
47617
+ else log_error(`${GCLASS_NAME$14}: subtree load failed at '${path}': ${error}`);
47467
47618
  render_view$1(gobj);
47468
47619
  return 0;
47469
47620
  }
@@ -47531,6 +47682,36 @@ function ac_collapse_all$1(gobj, event, kw, src) {
47531
47682
  return 0;
47532
47683
  }
47533
47684
  /************************************************************
47685
+ * EV_EXPAND_LEVEL — open the next level: every loaded
47686
+ * container of the shallowest level that still has one closed.
47687
+ * The levels above it are all open already, so the tree shows
47688
+ * one level more. A `__collapsed__` sentinel is not opened: it
47689
+ * asks the backend, as with "expand loaded".
47690
+ ************************************************************/
47691
+ function ac_expand_level(gobj, event, kw, src) {
47692
+ let priv = gobj.priv;
47693
+ if (priv.root === null || priv.root === void 0) return 0;
47694
+ let level = first_closed_level(priv, priv.root, []);
47695
+ if (level < 0) return 0;
47696
+ open_levels_up_to(priv, priv.root, [], level);
47697
+ render_view$1(gobj);
47698
+ return 0;
47699
+ }
47700
+ /************************************************************
47701
+ * EV_COLLAPSE_LEVEL — fold the deepest level open in sight:
47702
+ * every container open at that level or under it is closed,
47703
+ * so the tree shows one level less.
47704
+ ************************************************************/
47705
+ function ac_collapse_level(gobj, event, kw, src) {
47706
+ let priv = gobj.priv;
47707
+ if (priv.root === null || priv.root === void 0) return 0;
47708
+ let level = deepest_open_level(priv, priv.root, []);
47709
+ if (level < 0) return 0;
47710
+ for (let path of Array.from(priv.expanded)) if (seg_split(path).length - 1 >= level) priv.expanded.delete(path);
47711
+ render_view$1(gobj);
47712
+ return 0;
47713
+ }
47714
+ /************************************************************
47534
47715
  * EV_COPY_ALL — copy the working document to the clipboard
47535
47716
  ************************************************************/
47536
47717
  function ac_copy_all$1(gobj, event, kw, src) {
@@ -47538,14 +47719,14 @@ function ac_copy_all$1(gobj, event, kw, src) {
47538
47719
  if (priv.root === null || priv.root === void 0) return 0;
47539
47720
  let dump = json_text_dump(priv.root, 0);
47540
47721
  if (dump.error) {
47541
- log_error(`${GCLASS_NAME$13}: cannot copy the document: ${dump.error}`);
47722
+ log_error(`${GCLASS_NAME$14}: cannot copy the document: ${dump.error}`);
47542
47723
  return -1;
47543
47724
  }
47544
47725
  let text = dump.text;
47545
47726
  if (navigator.clipboard && navigator.clipboard.writeText) navigator.clipboard.writeText(text).catch(function(e) {
47546
- log_error(`${GCLASS_NAME$13}: clipboard write failed: ${e}`);
47727
+ log_error(`${GCLASS_NAME$14}: clipboard write failed: ${e}`);
47547
47728
  });
47548
- else log_error(`${GCLASS_NAME$13}: clipboard API unavailable`);
47729
+ else log_error(`${GCLASS_NAME$14}: clipboard API unavailable`);
47549
47730
  return 0;
47550
47731
  }
47551
47732
  /************************************************************
@@ -47561,7 +47742,7 @@ function ac_set_view_mode$1(gobj, event, kw, src) {
47561
47742
  let mode = kw.mode;
47562
47743
  if (mode === void 0 || mode === null || mode === "") mode = VIEWS$1[(VIEWS$1.findIndex((v) => v.mode === current_view_mode$1(gobj)) + 1) % VIEWS$1.length].mode;
47563
47744
  else if (!VIEWS$1.some((v) => v.mode === mode)) {
47564
- log_error(`${GCLASS_NAME$13}: unknown view_mode '${mode}'`);
47745
+ log_error(`${GCLASS_NAME$14}: unknown view_mode '${mode}'`);
47565
47746
  return -1;
47566
47747
  }
47567
47748
  if (mode === current_view_mode$1(gobj)) return 0;
@@ -47599,7 +47780,7 @@ function ac_json_item_clicked(gobj, event, kw, src) {
47599
47780
  * and loading the graph again would throw away the reader's
47600
47781
  * camera for nothing.
47601
47782
  ************************************************************/
47602
- function ac_language_changed$8(gobj, event, kw, src) {
47783
+ function ac_language_changed$9(gobj, event, kw, src) {
47603
47784
  let priv = gobj.priv;
47604
47785
  let $container = gobj_read_attr(gobj, "$container");
47605
47786
  if ($container) {
@@ -47633,17 +47814,17 @@ function ac_refresh$5(gobj, event, kw, src) {
47633
47814
  /***************************
47634
47815
  * FSM
47635
47816
  ***************************/
47636
- var gmt$13 = {
47637
- mt_create: mt_create$13,
47638
- mt_start: mt_start$13,
47639
- mt_stop: mt_stop$13,
47640
- mt_destroy: mt_destroy$13
47817
+ var gmt$14 = {
47818
+ mt_create: mt_create$14,
47819
+ mt_start: mt_start$14,
47820
+ mt_stop: mt_stop$14,
47821
+ mt_destroy: mt_destroy$14
47641
47822
  };
47642
47823
  /***************************************************************
47643
47824
  * Create the GClass
47644
47825
  ***************************************************************/
47645
- function create_gclass$13(gclass_name) {
47646
- if (__gclass__$13) {
47826
+ function create_gclass$14(gclass_name) {
47827
+ if (__gclass__$14) {
47647
47828
  log_error(`GClass ALREADY created: ${gclass_name}`);
47648
47829
  return -1;
47649
47830
  }
@@ -47660,7 +47841,7 @@ function create_gclass$13(gclass_name) {
47660
47841
  ],
47661
47842
  [
47662
47843
  "EV_LANGUAGE_CHANGED",
47663
- ac_language_changed$8,
47844
+ ac_language_changed$9,
47664
47845
  null
47665
47846
  ],
47666
47847
  [
@@ -47724,6 +47905,16 @@ function create_gclass$13(gclass_name) {
47724
47905
  ac_collapse_all$1,
47725
47906
  null
47726
47907
  ],
47908
+ [
47909
+ "EV_EXPAND_LEVEL",
47910
+ ac_expand_level,
47911
+ null
47912
+ ],
47913
+ [
47914
+ "EV_COLLAPSE_LEVEL",
47915
+ ac_collapse_level,
47916
+ null
47917
+ ],
47727
47918
  [
47728
47919
  "EV_COPY_ALL",
47729
47920
  ac_copy_all$1,
@@ -47736,7 +47927,7 @@ function create_gclass$13(gclass_name) {
47736
47927
  ],
47737
47928
  [
47738
47929
  "EV_LANGUAGE_CHANGED",
47739
- ac_language_changed$8,
47930
+ ac_language_changed$9,
47740
47931
  null
47741
47932
  ],
47742
47933
  [
@@ -47764,6 +47955,8 @@ function create_gclass$13(gclass_name) {
47764
47955
  ["EV_SEARCH", 0],
47765
47956
  ["EV_EXPAND_ALL", 0],
47766
47957
  ["EV_COLLAPSE_ALL", 0],
47958
+ ["EV_EXPAND_LEVEL", 0],
47959
+ ["EV_COLLAPSE_LEVEL", 0],
47767
47960
  ["EV_COPY_ALL", 0],
47768
47961
  ["EV_SET_VIEW_MODE", 0],
47769
47962
  ["EV_JSON_ITEM_CLICKED", 0],
@@ -47773,17 +47966,17 @@ function create_gclass$13(gclass_name) {
47773
47966
  ["EV_HIDE", 0],
47774
47967
  ["EV_EXPAND_PATH", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS]
47775
47968
  ];
47776
- __gclass__$13 = gclass_create(gclass_name, event_types, states, gmt$13, 0, attrs_table$13, PRIVATE_DATA$13, 0, 0, 0, 0);
47777
- if (!__gclass__$13) return -1;
47969
+ __gclass__$14 = gclass_create(gclass_name, event_types, states, gmt$14, 0, attrs_table$14, PRIVATE_DATA$14, 0, 0, 0, 0);
47970
+ if (!__gclass__$14) return -1;
47778
47971
  return 0;
47779
47972
  }
47780
47973
  /***************************************************************
47781
47974
  * Register GClass
47782
47975
  ***************************************************************/
47783
47976
  function register_c_yui_json() {
47784
- if (gclass_find_by_name(GCLASS_NAME$13, false)) return 0;
47977
+ if (gclass_find_by_name(GCLASS_NAME$14, false)) return 0;
47785
47978
  if (!gclass_find_by_name("C_YUI_JSON_GRAPH", false)) register_c_yui_json_graph();
47786
- return create_gclass$13(GCLASS_NAME$13);
47979
+ return create_gclass$14(GCLASS_NAME$14);
47787
47980
  }
47788
47981
  // src/c_yui_json_pad.js
47789
47982
  /***********************************************************************
@@ -47867,7 +48060,7 @@ function register_c_yui_json() {
47867
48060
  /***************************************************************
47868
48061
  * Constants
47869
48062
  ***************************************************************/
47870
- var GCLASS_NAME$12 = "C_YUI_JSON_PAD";
48063
+ var GCLASS_NAME$13 = "C_YUI_JSON_PAD";
47871
48064
  var PANES = ["a", "b"];
47872
48065
  var MODE_OF_STATE = {
47873
48066
  ST_SINGLE: "single",
@@ -47903,26 +48096,26 @@ var KIND_TAG = {
47903
48096
  /***************************************************************
47904
48097
  * Data
47905
48098
  ***************************************************************/
47906
- var attrs_table$12 = [
48099
+ var attrs_table$13 = [
47907
48100
  SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
47908
48101
  SDATA(data_type_t.DTP_STRING, "storage_key", 0, "yui_json_pad", "localStorage key the two texts and the layout are kept under. Empty: nothing is kept"),
47909
48102
  SDATA(data_type_t.DTP_POINTER, "$container", 0, null, "HTMLElement root, mounted by the host"),
47910
48103
  SDATA_END()
47911
48104
  ];
47912
- var PRIVATE_DATA$12 = {
48105
+ var PRIVATE_DATA$13 = {
47913
48106
  panes: null,
47914
48107
  $compare: null,
47915
48108
  $notice: null,
47916
48109
  $diff: null
47917
48110
  };
47918
- var __gclass__$12 = null;
48111
+ var __gclass__$13 = null;
47919
48112
  /******************************
47920
48113
  * Framework Methods
47921
48114
  ******************************/
47922
48115
  /***************************************************************
47923
48116
  * Framework Method: Create
47924
48117
  ***************************************************************/
47925
- function mt_create$12(gobj) {
48118
+ function mt_create$13(gobj) {
47926
48119
  let priv = gobj.priv;
47927
48120
  let subscriber = gobj_read_pointer_attr(gobj, "subscriber");
47928
48121
  if (!subscriber) subscriber = gobj_parent(gobj);
@@ -47942,7 +48135,7 @@ function mt_create$12(gobj) {
47942
48135
  /***************************************************************
47943
48136
  * Framework Method: Start
47944
48137
  ***************************************************************/
47945
- function mt_start$12(gobj) {
48138
+ function mt_start$13(gobj) {
47946
48139
  let priv = gobj.priv;
47947
48140
  for (const id of PANES) if (priv.panes[id].gobj_json) gobj_start(priv.panes[id].gobj_json);
47948
48141
  restore_state(gobj);
@@ -47951,7 +48144,7 @@ function mt_start$12(gobj) {
47951
48144
  /***************************************************************
47952
48145
  * Framework Method: Stop
47953
48146
  ***************************************************************/
47954
- function mt_stop$12(gobj) {
48147
+ function mt_stop$13(gobj) {
47955
48148
  let priv = gobj.priv;
47956
48149
  save_state(gobj);
47957
48150
  for (const id of PANES) {
@@ -47962,7 +48155,7 @@ function mt_stop$12(gobj) {
47962
48155
  /***************************************************************
47963
48156
  * Framework Method: Destroy
47964
48157
  ***************************************************************/
47965
- function mt_destroy$12(gobj) {}
48158
+ function mt_destroy$13(gobj) {}
47966
48159
  /***************************
47967
48160
  * Local Methods
47968
48161
  ***************************/
@@ -48529,21 +48722,21 @@ function ac_expand_path$1(gobj, event, kw, src) {
48529
48722
  /***************************************************************
48530
48723
  * FSM
48531
48724
  ***************************************************************/
48532
- var gmt$12 = {
48533
- mt_create: mt_create$12,
48534
- mt_start: mt_start$12,
48535
- mt_stop: mt_stop$12,
48536
- mt_destroy: mt_destroy$12
48725
+ var gmt$13 = {
48726
+ mt_create: mt_create$13,
48727
+ mt_start: mt_start$13,
48728
+ mt_stop: mt_stop$13,
48729
+ mt_destroy: mt_destroy$13
48537
48730
  };
48538
48731
  /***************************************************************
48539
48732
  * Create the GClass
48540
48733
  ***************************************************************/
48541
- function create_gclass$12(gclass_name) {
48542
- if (__gclass__$12) {
48734
+ function create_gclass$13(gclass_name) {
48735
+ if (__gclass__$13) {
48543
48736
  log_error(`GClass ALREADY created: ${gclass_name}`);
48544
48737
  return -1;
48545
48738
  }
48546
- __gclass__$12 = gclass_create(gclass_name, [
48739
+ __gclass__$13 = gclass_create(gclass_name, [
48547
48740
  ["EV_PASTE", 0],
48548
48741
  ["EV_VIEW", 0],
48549
48742
  ["EV_CLEAR", 0],
@@ -48653,8 +48846,8 @@ function create_gclass$12(gclass_name) {
48653
48846
  null
48654
48847
  ]
48655
48848
  ]]
48656
- ], gmt$12, 0, attrs_table$12, PRIVATE_DATA$12, 0, 0, 0, 0);
48657
- if (!__gclass__$12) return -1;
48849
+ ], gmt$13, 0, attrs_table$13, PRIVATE_DATA$13, 0, 0, 0, 0);
48850
+ if (!__gclass__$13) return -1;
48658
48851
  return 0;
48659
48852
  }
48660
48853
  /***************************************************************
@@ -48662,7 +48855,7 @@ function create_gclass$12(gclass_name) {
48662
48855
  ***************************************************************/
48663
48856
  function register_c_yui_json_pad() {
48664
48857
  if (!gclass_find_by_name("C_YUI_JSON", false)) register_c_yui_json();
48665
- return create_gclass$12(GCLASS_NAME$12);
48858
+ return create_gclass$13(GCLASS_NAME$13);
48666
48859
  }
48667
48860
  // src/gclass_view_model.js
48668
48861
  /***********************************************************************
@@ -49419,7 +49612,7 @@ function own_trace_levels(rows, scope) {
49419
49612
  /***************************************************************
49420
49613
  * Constants
49421
49614
  ***************************************************************/
49422
- var GCLASS_NAME$11 = "C_YUI_FSM_GRAPH";
49615
+ var GCLASS_NAME$12 = "C_YUI_FSM_GRAPH";
49423
49616
  var LAYOUTS$1 = {
49424
49617
  "dagre-lr": { g6_layout: {
49425
49618
  type: "antv-dagre",
@@ -49447,7 +49640,7 @@ var MIN_READABLE_ZOOM$1 = .5;
49447
49640
  /***************************************************************
49448
49641
  * Data
49449
49642
  ***************************************************************/
49450
- var attrs_table$11 = [
49643
+ var attrs_table$12 = [
49451
49644
  SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
49452
49645
  SDATA(data_type_t.DTP_JSON, "fsm", 0, null, "The `fsm` block of a gclass view model: {entry_state, states, rows, published, unreachable}"),
49453
49646
  SDATA(data_type_t.DTP_STRING, "current_state", 0, "", "State of the instance the host is showing, lit in the graph"),
@@ -49457,7 +49650,7 @@ var attrs_table$11 = [
49457
49650
  SDATA(data_type_t.DTP_STRING, "layout", 0, DEFAULT_LAYOUT, "Layout key (see LAYOUTS)"),
49458
49651
  SDATA_END()
49459
49652
  ];
49460
- var PRIVATE_DATA$11 = {
49653
+ var PRIVATE_DATA$12 = {
49461
49654
  graph: null,
49462
49655
  theme: null,
49463
49656
  theme_observer: null,
@@ -49465,14 +49658,14 @@ var PRIVATE_DATA$11 = {
49465
49658
  _resize_raf: 0,
49466
49659
  $layout_select: null
49467
49660
  };
49468
- var __gclass__$11 = null;
49661
+ var __gclass__$12 = null;
49469
49662
  /******************************
49470
49663
  * Framework Methods
49471
49664
  ******************************/
49472
49665
  /***************************************************************
49473
49666
  * Framework Method: Create
49474
49667
  ***************************************************************/
49475
- function mt_create$11(gobj) {
49668
+ function mt_create$12(gobj) {
49476
49669
  let priv = gobj.priv;
49477
49670
  if (!gobj_read_str_attr(gobj, "canvas_id")) gobj_write_attr(gobj, "canvas_id", "fsm_graph_" + clean_name(gobj_name(gobj)));
49478
49671
  priv.theme = yui_theme_now();
@@ -49484,7 +49677,7 @@ function mt_create$11(gobj) {
49484
49677
  /***************************************************************
49485
49678
  * Framework Method: Start
49486
49679
  ***************************************************************/
49487
- function mt_start$11(gobj) {
49680
+ function mt_start$12(gobj) {
49488
49681
  build_graph$3(gobj);
49489
49682
  load_fsm(gobj);
49490
49683
  gobj.priv.theme_observer = yui_watch_theme(function() {
@@ -49494,7 +49687,7 @@ function mt_start$11(gobj) {
49494
49687
  /***************************************************************
49495
49688
  * Framework Method: Stop
49496
49689
  ***************************************************************/
49497
- function mt_stop$11(gobj) {
49690
+ function mt_stop$12(gobj) {
49498
49691
  let priv = gobj.priv;
49499
49692
  if (priv.theme_observer) {
49500
49693
  try {
@@ -49524,7 +49717,7 @@ function mt_stop$11(gobj) {
49524
49717
  /***************************************************************
49525
49718
  * Framework Method: Destroy
49526
49719
  ***************************************************************/
49527
- function mt_destroy$11(gobj) {
49720
+ function mt_destroy$12(gobj) {
49528
49721
  destroy_ui$6(gobj);
49529
49722
  }
49530
49723
  /***************************
@@ -49898,7 +50091,7 @@ function camera(gobj, what, fn) {
49898
50091
  ************************************************************/
49899
50092
  function ac_set_fsm(gobj, event, kw, src) {
49900
50093
  if (kw.fsm === void 0) {
49901
- log_error(`${GCLASS_NAME$11}: EV_SET_FSM without an fsm`);
50094
+ log_error(`${GCLASS_NAME$12}: EV_SET_FSM without an fsm`);
49902
50095
  return -1;
49903
50096
  }
49904
50097
  gobj_write_attr(gobj, "fsm", kw.fsm);
@@ -49913,7 +50106,7 @@ function ac_change_layout$1(gobj, event, kw, src) {
49913
50106
  let priv = gobj.priv;
49914
50107
  let key = kw.layout;
49915
50108
  if (!LAYOUTS$1[key]) {
49916
- log_error(`${GCLASS_NAME$11}: unknown layout '${key}'`);
50109
+ log_error(`${GCLASS_NAME$12}: unknown layout '${key}'`);
49917
50110
  return -1;
49918
50111
  }
49919
50112
  gobj_write_attr(gobj, "layout", key);
@@ -49970,7 +50163,7 @@ function ac_theme_changed(gobj, event, kw, src) {
49970
50163
  * inside an innerHTML string, where refresh_language()
49971
50164
  * cannot reach.
49972
50165
  ************************************************************/
49973
- function ac_language_changed$7(gobj, event, kw, src) {
50166
+ function ac_language_changed$8(gobj, event, kw, src) {
49974
50167
  let $container = gobj_read_attr(gobj, "$container");
49975
50168
  if ($container) refresh_language($container, t);
49976
50169
  load_fsm(gobj);
@@ -50008,21 +50201,21 @@ function ac_hide$7(gobj, event, kw, src) {
50008
50201
  /***************************
50009
50202
  * FSM
50010
50203
  ***************************/
50011
- var gmt$11 = {
50012
- mt_create: mt_create$11,
50013
- mt_start: mt_start$11,
50014
- mt_stop: mt_stop$11,
50015
- mt_destroy: mt_destroy$11
50204
+ var gmt$12 = {
50205
+ mt_create: mt_create$12,
50206
+ mt_start: mt_start$12,
50207
+ mt_stop: mt_stop$12,
50208
+ mt_destroy: mt_destroy$12
50016
50209
  };
50017
50210
  /***************************************************************
50018
50211
  * Create the GClass
50019
50212
  ***************************************************************/
50020
- function create_gclass$11(gclass_name) {
50021
- if (__gclass__$11) {
50213
+ function create_gclass$12(gclass_name) {
50214
+ if (__gclass__$12) {
50022
50215
  log_error(`GClass ALREADY created: ${gclass_name}`);
50023
50216
  return -1;
50024
50217
  }
50025
- __gclass__$11 = gclass_create(gclass_name, [
50218
+ __gclass__$12 = gclass_create(gclass_name, [
50026
50219
  ["EV_SET_FSM", 0],
50027
50220
  ["EV_CHANGE_LAYOUT", 0],
50028
50221
  ["EV_ZOOM_IN", 0],
@@ -50077,7 +50270,7 @@ function create_gclass$11(gclass_name) {
50077
50270
  ],
50078
50271
  [
50079
50272
  "EV_LANGUAGE_CHANGED",
50080
- ac_language_changed$7,
50273
+ ac_language_changed$8,
50081
50274
  null
50082
50275
  ],
50083
50276
  [
@@ -50090,16 +50283,16 @@ function create_gclass$11(gclass_name) {
50090
50283
  ac_hide$7,
50091
50284
  null
50092
50285
  ]
50093
- ]]], gmt$11, 0, attrs_table$11, PRIVATE_DATA$11, 0, 0, 0, 0);
50094
- if (!__gclass__$11) return -1;
50286
+ ]]], gmt$12, 0, attrs_table$12, PRIVATE_DATA$12, 0, 0, 0, 0);
50287
+ if (!__gclass__$12) return -1;
50095
50288
  return 0;
50096
50289
  }
50097
50290
  /***************************************************************
50098
50291
  * Register GClass
50099
50292
  ***************************************************************/
50100
50293
  function register_c_yui_fsm_graph() {
50101
- if (gclass_find_by_name(GCLASS_NAME$11, false)) return 0;
50102
- return create_gclass$11(GCLASS_NAME$11);
50294
+ if (gclass_find_by_name(GCLASS_NAME$12, false)) return 0;
50295
+ return create_gclass$12(GCLASS_NAME$12);
50103
50296
  }
50104
50297
  // src/yui_clipboard.js
50105
50298
  /***********************************************************************
@@ -50282,7 +50475,7 @@ function yui_button_mark_done($button, label) {
50282
50475
  /***************************************************************
50283
50476
  * Constants
50284
50477
  ***************************************************************/
50285
- var GCLASS_NAME$10 = "C_YUI_GCLASS";
50478
+ var GCLASS_NAME$11 = "C_YUI_GCLASS";
50286
50479
  var VIEWS = [{
50287
50480
  mode: "zones",
50288
50481
  icon: "yi-table",
@@ -50328,7 +50521,7 @@ var ROWS_CAP = 20;
50328
50521
  /***************************************************************
50329
50522
  * Data
50330
50523
  ***************************************************************/
50331
- var attrs_table$10 = [
50524
+ var attrs_table$11 = [
50332
50525
  SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
50333
50526
  SDATA(data_type_t.DTP_JSON, "description", 0, null, "The gclass description, as `view-gclass` answers it or `describe_local_gclass()` builds it"),
50334
50527
  SDATA(data_type_t.DTP_STRING, "gclass_name", 0, "", "Name to head the view with when the description carries none"),
@@ -50339,7 +50532,7 @@ var attrs_table$10 = [
50339
50532
  SDATA(data_type_t.DTP_POINTER, "$container", 0, null, "HTMLElement root, mounted by the parent"),
50340
50533
  SDATA_END()
50341
50534
  ];
50342
- var PRIVATE_DATA$10 = {
50535
+ var PRIVATE_DATA$11 = {
50343
50536
  model: null,
50344
50537
  search: "",
50345
50538
  collapsed: null,
@@ -50353,14 +50546,14 @@ var PRIVATE_DATA$10 = {
50353
50546
  $mode_btns: null,
50354
50547
  lang_shell: null
50355
50548
  };
50356
- var __gclass__$10 = null;
50549
+ var __gclass__$11 = null;
50357
50550
  /******************************
50358
50551
  * Framework Methods
50359
50552
  ******************************/
50360
50553
  /***************************************************************
50361
50554
  * Framework Method: Create
50362
50555
  ***************************************************************/
50363
- function mt_create$10(gobj) {
50556
+ function mt_create$11(gobj) {
50364
50557
  let priv = gobj.priv;
50365
50558
  priv.collapsed = /* @__PURE__ */ new Set();
50366
50559
  priv.expanded = /* @__PURE__ */ new Set();
@@ -50376,7 +50569,7 @@ function mt_create$10(gobj) {
50376
50569
  /***************************************************************
50377
50570
  * Framework Method: Start
50378
50571
  ***************************************************************/
50379
- function mt_start$10(gobj) {
50572
+ function mt_start$11(gobj) {
50380
50573
  let priv = gobj.priv;
50381
50574
  let shell = yui_shell_of(gobj);
50382
50575
  if (shell) {
@@ -50388,7 +50581,7 @@ function mt_start$10(gobj) {
50388
50581
  /***************************************************************
50389
50582
  * Framework Method: Stop
50390
50583
  ***************************************************************/
50391
- function mt_stop$10(gobj) {
50584
+ function mt_stop$11(gobj) {
50392
50585
  let priv = gobj.priv;
50393
50586
  if (priv.lang_shell && !gobj_is_destroying(priv.lang_shell)) gobj_unsubscribe_event(priv.lang_shell, "EV_LANGUAGE_CHANGED", {}, gobj);
50394
50587
  priv.lang_shell = null;
@@ -50397,7 +50590,7 @@ function mt_stop$10(gobj) {
50397
50590
  /***************************************************************
50398
50591
  * Framework Method: Destroy
50399
50592
  ***************************************************************/
50400
- function mt_destroy$10(gobj) {
50593
+ function mt_destroy$11(gobj) {
50401
50594
  destroy_ui$5(gobj);
50402
50595
  }
50403
50596
  /***************************
@@ -50859,7 +51052,7 @@ function build_zone(gobj, zone) {
50859
51052
  body = build_machine(gobj, model.fsm);
50860
51053
  break;
50861
51054
  default:
50862
- log_error(`${GCLASS_NAME$10}: unknown zone '${zone.id}'`);
51055
+ log_error(`${GCLASS_NAME$11}: unknown zone '${zone.id}'`);
50863
51056
  return null;
50864
51057
  }
50865
51058
  let collapsed = priv.collapsed.has(zone.id);
@@ -51803,7 +51996,7 @@ function ac_set_description(gobj, event, kw, src) {
51803
51996
  let priv = gobj.priv;
51804
51997
  let description = kw.description;
51805
51998
  if (description === void 0) {
51806
- log_error(`${GCLASS_NAME$10}: EV_SET_DESCRIPTION without a description`);
51999
+ log_error(`${GCLASS_NAME$11}: EV_SET_DESCRIPTION without a description`);
51807
52000
  return -1;
51808
52001
  }
51809
52002
  gobj_write_attr(gobj, "description", description === null ? null : json_deep_copy(description));
@@ -51818,7 +52011,7 @@ function ac_set_description(gobj, event, kw, src) {
51818
52011
  function ac_set_view_mode(gobj, event, kw, src) {
51819
52012
  let mode = kw.mode;
51820
52013
  if (!VIEWS.some((v) => v.mode === mode)) {
51821
- log_error(`${GCLASS_NAME$10}: unknown view_mode '${mode}'`);
52014
+ log_error(`${GCLASS_NAME$11}: unknown view_mode '${mode}'`);
51822
52015
  return -1;
51823
52016
  }
51824
52017
  if (mode === current_view_mode(gobj)) return 0;
@@ -51834,7 +52027,7 @@ function ac_toggle_zone(gobj, event, kw, src) {
51834
52027
  let priv = gobj.priv;
51835
52028
  let zone = kw.zone;
51836
52029
  if (!ZONES.some((z) => z.id === zone)) {
51837
- log_error(`${GCLASS_NAME$10}: unknown zone '${zone}'`);
52030
+ log_error(`${GCLASS_NAME$11}: unknown zone '${zone}'`);
51838
52031
  return -1;
51839
52032
  }
51840
52033
  let collapsed = !priv.collapsed.has(zone);
@@ -51842,7 +52035,7 @@ function ac_toggle_zone(gobj, event, kw, src) {
51842
52035
  else priv.collapsed.delete(zone);
51843
52036
  let $zone = priv.$zones ? priv.$zones.querySelector(`.GCLASS_ZONE[data-zone="${zone}"]`) : null;
51844
52037
  if (!$zone) {
51845
- log_error(`${GCLASS_NAME$10}: zone '${zone}' is not drawn`);
52038
+ log_error(`${GCLASS_NAME$11}: zone '${zone}' is not drawn`);
51846
52039
  return -1;
51847
52040
  }
51848
52041
  $zone.classList.toggle("is-collapsed", collapsed);
@@ -51865,7 +52058,7 @@ function ac_set_machine_view(gobj, event, kw, src) {
51865
52058
  let priv = gobj.priv;
51866
52059
  let mode = kw.mode;
51867
52060
  if (!MACHINE_VIEWS.some((v) => v.mode === mode)) {
51868
- log_error(`${GCLASS_NAME$10}: unknown machine view '${mode}'`);
52061
+ log_error(`${GCLASS_NAME$11}: unknown machine view '${mode}'`);
51869
52062
  return -1;
51870
52063
  }
51871
52064
  if (mode === priv.machine_view) return 0;
@@ -51902,7 +52095,7 @@ function ac_copy_all(gobj, event, kw, src) {
51902
52095
  function ac_show_all(gobj, event, kw, src) {
51903
52096
  let priv = gobj.priv;
51904
52097
  if (!ZONES.some((z) => z.id === kw.zone)) {
51905
- log_error(`${GCLASS_NAME$10}: show all of no zone '${kw.zone}'`);
52098
+ log_error(`${GCLASS_NAME$11}: show all of no zone '${kw.zone}'`);
51906
52099
  return -1;
51907
52100
  }
51908
52101
  priv.expanded.add(kw.zone);
@@ -51926,7 +52119,7 @@ function ac_set_traces(gobj, event, kw, src) {
51926
52119
  ************************************************************/
51927
52120
  function ac_gclass_trace_toggled(gobj, event, kw, src) {
51928
52121
  if (!kw || !kw.level) {
51929
- log_error(`${GCLASS_NAME$10}: a gclass trace set of no level`);
52122
+ log_error(`${GCLASS_NAME$11}: a gclass trace set of no level`);
51930
52123
  return -1;
51931
52124
  }
51932
52125
  return ask_gclass_trace(gobj, [kw.level], !!kw.set);
@@ -51939,7 +52132,7 @@ function ac_gclass_traces_cleared(gobj, event, kw, src) {
51939
52132
  let traces = gobj_read_attr(gobj, "traces");
51940
52133
  let levels = own_trace_levels(trace_rows({ gobj_trace_level: [] }, traces && traces.info), "gclass");
51941
52134
  if (!levels.length) {
51942
- log_error(`${GCLASS_NAME$10}: no gclass trace to remove`);
52135
+ log_error(`${GCLASS_NAME$11}: no gclass trace to remove`);
51943
52136
  return -1;
51944
52137
  }
51945
52138
  return ask_gclass_trace(gobj, levels, false);
@@ -51948,7 +52141,7 @@ function ask_gclass_trace(gobj, levels, set) {
51948
52141
  let priv = gobj.priv;
51949
52142
  let traces = gobj_read_attr(gobj, "traces");
51950
52143
  if (!traces || typeof traces !== "object") {
51951
- log_error(`${GCLASS_NAME$10}: a gclass trace set, and no host that can set it`);
52144
+ log_error(`${GCLASS_NAME$11}: a gclass trace set, and no host that can set it`);
51952
52145
  return -1;
51953
52146
  }
51954
52147
  gobj_write_attr(gobj, "traces", {
@@ -51988,7 +52181,7 @@ function refresh_zone(gobj, zone_id) {
51988
52181
  * is. Re-rendering is the only way both end up in the same
51989
52182
  * language.
51990
52183
  ************************************************************/
51991
- function ac_language_changed$6(gobj, event, kw, src) {
52184
+ function ac_language_changed$7(gobj, event, kw, src) {
51992
52185
  let priv = gobj.priv;
51993
52186
  let $container = gobj_read_attr(gobj, "$container");
51994
52187
  if ($container) {
@@ -52023,17 +52216,17 @@ function ac_hide$6(gobj, event, kw, src) {
52023
52216
  /***************************
52024
52217
  * FSM
52025
52218
  ***************************/
52026
- var gmt$10 = {
52027
- mt_create: mt_create$10,
52028
- mt_start: mt_start$10,
52029
- mt_stop: mt_stop$10,
52030
- mt_destroy: mt_destroy$10
52219
+ var gmt$11 = {
52220
+ mt_create: mt_create$11,
52221
+ mt_start: mt_start$11,
52222
+ mt_stop: mt_stop$11,
52223
+ mt_destroy: mt_destroy$11
52031
52224
  };
52032
52225
  /***************************************************************
52033
52226
  * Create the GClass
52034
52227
  ***************************************************************/
52035
- function create_gclass$10(gclass_name) {
52036
- if (__gclass__$10) {
52228
+ function create_gclass$11(gclass_name) {
52229
+ if (__gclass__$11) {
52037
52230
  log_error(`GClass ALREADY created: ${gclass_name}`);
52038
52231
  return -1;
52039
52232
  }
@@ -52070,7 +52263,7 @@ function create_gclass$10(gclass_name) {
52070
52263
  ],
52071
52264
  [
52072
52265
  "EV_LANGUAGE_CHANGED",
52073
- ac_language_changed$6,
52266
+ ac_language_changed$7,
52074
52267
  null
52075
52268
  ],
52076
52269
  [
@@ -52126,17 +52319,17 @@ function create_gclass$10(gclass_name) {
52126
52319
  ["EV_GCLASS_TRACES_CLEARED", 0],
52127
52320
  ["EV_SET_GCLASS_TRACE", event_flag_t.EVF_OUTPUT_EVENT]
52128
52321
  ];
52129
- __gclass__$10 = gclass_create(gclass_name, event_types, states, gmt$10, 0, attrs_table$10, PRIVATE_DATA$10, 0, 0, 0, 0);
52130
- if (!__gclass__$10) return -1;
52322
+ __gclass__$11 = gclass_create(gclass_name, event_types, states, gmt$11, 0, attrs_table$11, PRIVATE_DATA$11, 0, 0, 0, 0);
52323
+ if (!__gclass__$11) return -1;
52131
52324
  return 0;
52132
52325
  }
52133
52326
  /***************************************************************
52134
52327
  * Register GClass
52135
52328
  ***************************************************************/
52136
52329
  function register_c_yui_gclass() {
52137
- if (gclass_find_by_name(GCLASS_NAME$10, false)) return 0;
52330
+ if (gclass_find_by_name(GCLASS_NAME$11, false)) return 0;
52138
52331
  if (!gclass_find_by_name("C_YUI_FSM_GRAPH", false)) register_c_yui_fsm_graph();
52139
- return create_gclass$10(GCLASS_NAME$10);
52332
+ return create_gclass$11(GCLASS_NAME$11);
52140
52333
  }
52141
52334
  // src/gclass_describe.js
52142
52335
  /***********************************************************************
@@ -52603,11 +52796,11 @@ function is_mobile$3() {
52603
52796
  /***************************************************************
52604
52797
  * Constants
52605
52798
  ***************************************************************/
52606
- var GCLASS_NAME$9 = "C_YUI_GOBJ_TREE_JS";
52799
+ var GCLASS_NAME$10 = "C_YUI_GOBJ_TREE_JS";
52607
52800
  /***************************************************************
52608
52801
  * Data
52609
52802
  ***************************************************************/
52610
- var attrs_table$9 = [
52803
+ var attrs_table$10 = [
52611
52804
  SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
52612
52805
  SDATA(data_type_t.DTP_POINTER, "$container", 0, null, "Container element"),
52613
52806
  SDATA(data_type_t.DTP_STRING, "canvas_id", 0, "", "Canvas ID"),
@@ -52747,7 +52940,7 @@ function load_view_state(gobj) {
52747
52940
  let state = kw_get_local_storage_value(view_store_key(gobj), null, false);
52748
52941
  return state && typeof state === "object" ? state : null;
52749
52942
  }
52750
- var PRIVATE_DATA$9 = {
52943
+ var PRIVATE_DATA$10 = {
52751
52944
  canvas_id: "",
52752
52945
  graph: null,
52753
52946
  node_counter: 0,
@@ -52788,7 +52981,7 @@ var PRIVATE_DATA$9 = {
52788
52981
  viewer_awaits_set: 0,
52789
52982
  view_refused: false
52790
52983
  };
52791
- var __gclass__$9 = null;
52984
+ var __gclass__$10 = null;
52792
52985
  var __layout_registered__ = false;
52793
52986
  /***************************************************************
52794
52987
  * Node colours by role.
@@ -53056,7 +53249,7 @@ function get_layout_cfg(layout_key) {
53056
53249
  /***************************************************************
53057
53250
  * Framework Method: Create
53058
53251
  ***************************************************************/
53059
- function mt_create$9(gobj) {
53252
+ function mt_create$10(gobj) {
53060
53253
  let priv = gobj.priv;
53061
53254
  priv.canvas_id = "gobj-tree-canvas-" + clean_name(gobj_name(gobj));
53062
53255
  gobj_write_str_attr(gobj, "canvas_id", priv.canvas_id);
@@ -53080,7 +53273,7 @@ function mt_create$9(gobj) {
53080
53273
  /***************************************************************
53081
53274
  * Framework Method: Start
53082
53275
  ***************************************************************/
53083
- function mt_start$9(gobj) {
53276
+ function mt_start$10(gobj) {
53084
53277
  restore_view_shape(gobj);
53085
53278
  let shell = yui_shell_of(gobj);
53086
53279
  if (shell) gobj_subscribe_event(shell, "EV_LANGUAGE_CHANGED", {}, gobj);
@@ -53090,7 +53283,7 @@ function mt_start$9(gobj) {
53090
53283
  /***************************************************************
53091
53284
  * Framework Method: Stop
53092
53285
  ***************************************************************/
53093
- function mt_stop$9(gobj) {
53286
+ function mt_stop$10(gobj) {
53094
53287
  let priv = gobj.priv;
53095
53288
  let shell = yui_shell_of(gobj);
53096
53289
  if (shell) gobj_unsubscribe_event(shell, "EV_LANGUAGE_CHANGED", {}, gobj);
@@ -53100,7 +53293,7 @@ function mt_stop$9(gobj) {
53100
53293
  /***************************************************************
53101
53294
  * Framework Method: Destroy
53102
53295
  ***************************************************************/
53103
- function mt_destroy$9(gobj) {
53296
+ function mt_destroy$10(gobj) {
53104
53297
  let priv = gobj.priv;
53105
53298
  if (priv.theme_observer) {
53106
53299
  priv.theme_observer.disconnect();
@@ -55446,7 +55639,7 @@ function ac_open_yuno_traces(gobj, event, kw, src) {
55446
55639
  * A rebuild, not a re-translation: the words live inside the
55447
55640
  * innerHTML of G6 nodes, where refresh_language() cannot go.
55448
55641
  ************************************************************/
55449
- function ac_language_changed$5(gobj, event, kw, src) {
55642
+ function ac_language_changed$6(gobj, event, kw, src) {
55450
55643
  let $container = gobj_read_attr(gobj, "$container");
55451
55644
  if ($container) refresh_language($container, t);
55452
55645
  hide_popover(gobj);
@@ -55457,17 +55650,17 @@ function ac_language_changed$5(gobj, event, kw, src) {
55457
55650
  /***************************
55458
55651
  * FSM
55459
55652
  ***************************/
55460
- var gmt$9 = {
55461
- mt_create: mt_create$9,
55462
- mt_start: mt_start$9,
55463
- mt_stop: mt_stop$9,
55464
- mt_destroy: mt_destroy$9
55653
+ var gmt$10 = {
55654
+ mt_create: mt_create$10,
55655
+ mt_start: mt_start$10,
55656
+ mt_stop: mt_stop$10,
55657
+ mt_destroy: mt_destroy$10
55465
55658
  };
55466
55659
  /***************************************************************
55467
55660
  * Create the GClass
55468
55661
  ***************************************************************/
55469
- function create_gclass$9(gclass_name) {
55470
- if (__gclass__$9) {
55662
+ function create_gclass$10(gclass_name) {
55663
+ if (__gclass__$10) {
55471
55664
  log_error(`GClass ALREADY created: ${gclass_name}`);
55472
55665
  return -1;
55473
55666
  }
@@ -55569,7 +55762,7 @@ function create_gclass$9(gclass_name) {
55569
55762
  ],
55570
55763
  [
55571
55764
  "EV_LANGUAGE_CHANGED",
55572
- ac_language_changed$5,
55765
+ ac_language_changed$6,
55573
55766
  null
55574
55767
  ],
55575
55768
  [
@@ -55641,15 +55834,15 @@ function create_gclass$9(gclass_name) {
55641
55834
  ["EV_SET_TRACE_LEVEL", event_flag_t.EVF_OUTPUT_EVENT],
55642
55835
  ["EV_GCLASS_WANTED", event_flag_t.EVF_OUTPUT_EVENT]
55643
55836
  ];
55644
- __gclass__$9 = gclass_create(gclass_name, event_types, states, gmt$9, 0, attrs_table$9, PRIVATE_DATA$9, 0, 0, 0, 0);
55645
- if (!__gclass__$9) return -1;
55837
+ __gclass__$10 = gclass_create(gclass_name, event_types, states, gmt$10, 0, attrs_table$10, PRIVATE_DATA$10, 0, 0, 0, 0);
55838
+ if (!__gclass__$10) return -1;
55646
55839
  return 0;
55647
55840
  }
55648
55841
  /***************************************************************
55649
55842
  * Register GClass
55650
55843
  ***************************************************************/
55651
55844
  function register_c_yui_gobj_tree_js() {
55652
- return create_gclass$9(GCLASS_NAME$9);
55845
+ return create_gclass$10(GCLASS_NAME$10);
55653
55846
  }
55654
55847
  // src/c_yui_service_view.js
55655
55848
  /***********************************************************************
@@ -55717,13 +55910,13 @@ function register_c_yui_gobj_tree_js() {
55717
55910
  /***************************************************************
55718
55911
  * Constants
55719
55912
  ***************************************************************/
55720
- var GCLASS_NAME$8 = "C_YUI_SERVICE_VIEW";
55913
+ var GCLASS_NAME$9 = "C_YUI_SERVICE_VIEW";
55721
55914
  var DEFAULT_TRANSPORT_SERVICE = "__remote_service__";
55722
55915
  var DEFAULT_TRANSPORT_ATTR = "gobj_remote_yuno";
55723
55916
  /***************************************************************
55724
55917
  * Data
55725
55918
  ***************************************************************/
55726
- var attrs_table$8 = [
55919
+ var attrs_table$9 = [
55727
55920
  SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
55728
55921
  SDATA(data_type_t.DTP_STRING, "view_gclass", 0, "", "GClass of the hosted view (must be registered)"),
55729
55922
  SDATA(data_type_t.DTP_STRING, "service_name", 0, "", "Service name of the hosted view — UNIQUE per mount"),
@@ -55733,8 +55926,8 @@ var attrs_table$8 = [
55733
55926
  SDATA(data_type_t.DTP_POINTER, "$container", 0, null, "Root HTMLElement"),
55734
55927
  SDATA_END()
55735
55928
  ];
55736
- var PRIVATE_DATA$8 = { view: null };
55737
- var __gclass__$8 = null;
55929
+ var PRIVATE_DATA$9 = { view: null };
55930
+ var __gclass__$9 = null;
55738
55931
  /***************************
55739
55932
  * Public helper
55740
55933
  ***************************/
@@ -55760,7 +55953,7 @@ var __gclass__$8 = null;
55760
55953
  ************************************************************/
55761
55954
  function yui_mount_service_view(host, spec) {
55762
55955
  if (!host || !is_gobj(host) || !spec) {
55763
- log_error(`${GCLASS_NAME$8}: yui_mount_service_view without host or spec`);
55956
+ log_error(`${GCLASS_NAME$9}: yui_mount_service_view without host or spec`);
55764
55957
  return null;
55765
55958
  }
55766
55959
  const gclass = spec.gclass;
@@ -55822,7 +56015,7 @@ function expose_view_container(host, view) {
55822
56015
  /***************************************************************
55823
56016
  * Framework Method: Create
55824
56017
  ***************************************************************/
55825
- function mt_create$8(gobj) {
56018
+ function mt_create$9(gobj) {
55826
56019
  let priv = gobj.priv;
55827
56020
  let subscriber = gobj_read_pointer_attr(gobj, "subscriber");
55828
56021
  if (!subscriber) subscriber = gobj_parent(gobj);
@@ -55842,14 +56035,14 @@ function mt_create$8(gobj) {
55842
56035
  * The view starts HERE and not in mt_create, so its first
55843
56036
  * request goes out when the host shows it.
55844
56037
  ***************************************************************/
55845
- function mt_start$8(gobj) {
56038
+ function mt_start$9(gobj) {
55846
56039
  const view = gobj.priv.view;
55847
56040
  if (view && !gobj_is_running(view)) gobj_start(view);
55848
56041
  }
55849
56042
  /***************************************************************
55850
56043
  * Framework Method: Stop
55851
56044
  ***************************************************************/
55852
- function mt_stop$8(gobj) {
56045
+ function mt_stop$9(gobj) {
55853
56046
  const view = gobj.priv.view;
55854
56047
  if (view && gobj_is_running(view)) gobj_stop(view);
55855
56048
  }
@@ -55860,7 +56053,7 @@ function mt_stop$8(gobj) {
55860
56053
  * gobj_destroy cascades onto it — and deregisters its name. Do
55861
56054
  * NOT destroy it again here.
55862
56055
  ***************************************************************/
55863
- function mt_destroy$8(gobj) {
56056
+ function mt_destroy$9(gobj) {
55864
56057
  let priv = gobj.priv;
55865
56058
  priv.view = null;
55866
56059
  const $c = gobj_read_attr(gobj, "$container");
@@ -55882,26 +56075,26 @@ function ac_view_shown(gobj, event, kw, src) {
55882
56075
  /***************************
55883
56076
  * FSM
55884
56077
  ***************************/
55885
- var gmt$8 = {
55886
- mt_create: mt_create$8,
55887
- mt_start: mt_start$8,
55888
- mt_stop: mt_stop$8,
55889
- mt_destroy: mt_destroy$8
56078
+ var gmt$9 = {
56079
+ mt_create: mt_create$9,
56080
+ mt_start: mt_start$9,
56081
+ mt_stop: mt_stop$9,
56082
+ mt_destroy: mt_destroy$9
55890
56083
  };
55891
- function create_gclass$8(gclass_name) {
55892
- if (__gclass__$8) {
56084
+ function create_gclass$9(gclass_name) {
56085
+ if (__gclass__$9) {
55893
56086
  log_error(`GClass ALREADY created: ${gclass_name}`);
55894
56087
  return -1;
55895
56088
  }
55896
- __gclass__$8 = gclass_create(gclass_name, [["EV_VIEW_SHOWN", 0]], [["ST_IDLE", [[
56089
+ __gclass__$9 = gclass_create(gclass_name, [["EV_VIEW_SHOWN", 0]], [["ST_IDLE", [[
55897
56090
  "EV_VIEW_SHOWN",
55898
56091
  ac_view_shown,
55899
56092
  null
55900
- ]]]], gmt$8, 0, attrs_table$8, PRIVATE_DATA$8, 0, 0, 0, 0);
55901
- return __gclass__$8 ? 0 : -1;
56093
+ ]]]], gmt$9, 0, attrs_table$9, PRIVATE_DATA$9, 0, 0, 0, 0);
56094
+ return __gclass__$9 ? 0 : -1;
55902
56095
  }
55903
56096
  function register_c_yui_service_view() {
55904
- return create_gclass$8(GCLASS_NAME$8);
56097
+ return create_gclass$9(GCLASS_NAME$9);
55905
56098
  }
55906
56099
  // src/nav_cards_helpers.js
55907
56100
  /***********************************************************************
@@ -56095,7 +56288,7 @@ function cards_grid_descriptor(items, show_label, badge_of) {
56095
56288
  /***************************************************************
56096
56289
  * Constants
56097
56290
  ***************************************************************/
56098
- var GCLASS_NAME$7 = "C_YUI_NAV";
56291
+ var GCLASS_NAME$8 = "C_YUI_NAV";
56099
56292
  var SUPPORTED_LAYOUTS = [
56100
56293
  "vertical",
56101
56294
  "icon-bar",
@@ -56113,7 +56306,7 @@ function is_decorative(it) {
56113
56306
  /***************************************************************
56114
56307
  * Attrs
56115
56308
  ***************************************************************/
56116
- var attrs_table$7 = [
56309
+ var attrs_table$8 = [
56117
56310
  SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
56118
56311
  SDATA(data_type_t.DTP_STRING, "menu_id", 0, "", "Id of the menu this nav renders"),
56119
56312
  SDATA(data_type_t.DTP_STRING, "nav_label", 0, "", "i18n key of the label for aria/heading; falls back to 'navigation'"),
@@ -56132,18 +56325,18 @@ var attrs_table$7 = [
56132
56325
  SDATA_END()
56133
56326
  ];
56134
56327
  var __nav_aria_seq__ = 0;
56135
- var PRIVATE_DATA$7 = {
56328
+ var PRIVATE_DATA$8 = {
56136
56329
  click_handler: null,
56137
56330
  key_handler: null
56138
56331
  };
56139
- var __gclass__$7 = null;
56332
+ var __gclass__$8 = null;
56140
56333
  /******************************
56141
56334
  * Framework Methods
56142
56335
  ******************************/
56143
56336
  /***************************************************************
56144
56337
  * Framework Method: Create
56145
56338
  ***************************************************************/
56146
- function mt_create$7(gobj) {
56339
+ function mt_create$8(gobj) {
56147
56340
  let subscriber = gobj_read_pointer_attr(gobj, "subscriber");
56148
56341
  if (!subscriber) subscriber = gobj_parent(gobj);
56149
56342
  gobj_subscribe_event(gobj, null, {}, subscriber);
@@ -56152,7 +56345,7 @@ function mt_create$7(gobj) {
56152
56345
  /***************************************************************
56153
56346
  * Framework Method: Start
56154
56347
  ***************************************************************/
56155
- function mt_start$7(gobj) {
56348
+ function mt_start$8(gobj) {
56156
56349
  let shell = gobj_read_attr(gobj, "shell");
56157
56350
  if (shell) try {
56158
56351
  gobj_subscribe_event(shell, "EV_ROUTE_CHANGED", {}, gobj);
@@ -56163,11 +56356,11 @@ function mt_start$7(gobj) {
56163
56356
  /***************************************************************
56164
56357
  * Framework Method: Stop
56165
56358
  ***************************************************************/
56166
- function mt_stop$7(gobj) {}
56359
+ function mt_stop$8(gobj) {}
56167
56360
  /***************************************************************
56168
56361
  * Framework Method: Destroy
56169
56362
  ***************************************************************/
56170
- function mt_destroy$7(gobj) {
56363
+ function mt_destroy$8(gobj) {
56171
56364
  let $c = gobj_read_attr(gobj, "$container");
56172
56365
  let priv = gobj.priv;
56173
56366
  if ($c && priv && priv.click_handler) $c.removeEventListener("click", priv.click_handler);
@@ -56941,14 +57134,14 @@ function ac_route_changed(gobj, event, kw, src) {
56941
57134
  /***************************************************************
56942
57135
  * FSM
56943
57136
  ***************************************************************/
56944
- var gmt$7 = {
56945
- mt_create: mt_create$7,
56946
- mt_start: mt_start$7,
56947
- mt_stop: mt_stop$7,
56948
- mt_destroy: mt_destroy$7
57137
+ var gmt$8 = {
57138
+ mt_create: mt_create$8,
57139
+ mt_start: mt_start$8,
57140
+ mt_stop: mt_stop$8,
57141
+ mt_destroy: mt_destroy$8
56949
57142
  };
56950
- function create_gclass$7(gclass_name) {
56951
- if (__gclass__$7) {
57143
+ function create_gclass$8(gclass_name) {
57144
+ if (__gclass__$8) {
56952
57145
  log_error(`GClass ALREADY created: ${gclass_name}`);
56953
57146
  return -1;
56954
57147
  }
@@ -56977,11 +57170,503 @@ function create_gclass$7(gclass_name) {
56977
57170
  ["EV_NAV_ITEM_CLOSE", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT],
56978
57171
  ["EV_DRAWER_CLOSE_REQUESTED", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_PUBLIC_EVENT]
56979
57172
  ];
56980
- __gclass__$7 = gclass_create(gclass_name, event_types, states, gmt$7, 0, attrs_table$7, PRIVATE_DATA$7, 0, 0, 0, 0);
56981
- if (!__gclass__$7) return -1;
57173
+ __gclass__$8 = gclass_create(gclass_name, event_types, states, gmt$8, 0, attrs_table$8, PRIVATE_DATA$8, 0, 0, 0, 0);
57174
+ if (!__gclass__$8) return -1;
56982
57175
  return 0;
56983
57176
  }
56984
57177
  function register_c_yui_nav() {
57178
+ return create_gclass$8(GCLASS_NAME$8);
57179
+ }
57180
+ // src/yui_preferences.js
57181
+ /***********************************************************************
57182
+ * yui_preferences.js
57183
+ *
57184
+ * The Preferences page of an app: what the READER chose for this
57185
+ * browser. Every app shows at least the same three rows, in one
57186
+ * box headed "Appearance":
57187
+ *
57188
+ * Theme light theme | dark theme
57189
+ * Language the app's languages, each in its own words
57190
+ * Navigation stacked strips | back to parent | breadcrumb
57191
+ *
57192
+ * Two ways to use it:
57193
+ *
57194
+ * - C_YUI_PREFERENCES, a whole page: a view the shell mounts at
57195
+ * /preferences. It draws the three rows, then the boxes the app
57196
+ * adds (the `sections` of the setup).
57197
+ * - The parts, for an app whose page has fields of its own with
57198
+ * actions of its own: yui_pref_header(), yui_pref_field(),
57199
+ * yui_pref_segment() and yui_pref_appearance_fields(). The host
57200
+ * declares EV_SET_THEME, EV_SET_LANGUAGE and EV_SET_NAV_MODE
57201
+ * ({value}) and hands them to yui_pref_apply().
57202
+ *
57203
+ * The theme and the language are the APP's: it says once, at start
57204
+ * up, how to read them and how to change them, with
57205
+ * yui_preferences_setup(). The navigation is the shell's
57206
+ * (yui_shell_nav_mode / yui_shell_set_nav_mode): every C_YUI_NODE
57207
+ * tree with no mode of its own follows it, and an app with no tree
57208
+ * keeps the choice for the day it has one.
57209
+ *
57210
+ * A language is SHOWN and NAMED in its own words ("Español", with
57211
+ * its `lang`): a reader looking for their language finds it in the
57212
+ * language they read, and an app of ten languages needs no key per
57213
+ * language name.
57214
+ *
57215
+ * Copyright (c) 2026, ArtGins.
57216
+ * All Rights Reserved.
57217
+ ***********************************************************************/
57218
+ /***************************************************************
57219
+ * Constants
57220
+ ***************************************************************/
57221
+ var YUI_PREFERENCES_I18N_KEYS = [
57222
+ "light theme",
57223
+ "dark theme",
57224
+ "stacked strips",
57225
+ "back to parent",
57226
+ "breadcrumb"
57227
+ ];
57228
+ var THEMES = [{
57229
+ value: "light",
57230
+ key: "light theme",
57231
+ icon: "yi-sun"
57232
+ }, {
57233
+ value: "dark",
57234
+ key: "dark theme",
57235
+ icon: "yi-moon"
57236
+ }];
57237
+ var NAV_MODE_OPTIONS = [
57238
+ {
57239
+ value: "stack",
57240
+ key: "stacked strips",
57241
+ icon: "yi-layer-group"
57242
+ },
57243
+ {
57244
+ value: "back",
57245
+ key: "back to parent",
57246
+ icon: "yi-arrow-left"
57247
+ },
57248
+ {
57249
+ value: "path",
57250
+ key: "breadcrumb",
57251
+ icon: "yi-route"
57252
+ }
57253
+ ];
57254
+ var __setup__ = null;
57255
+ /***************************
57256
+ * Setup
57257
+ ***************************/
57258
+ /***************************************************************
57259
+ * How this app reads and changes its theme and its language, and
57260
+ * the boxes it adds to the page. Called once, at start up, before
57261
+ * the page is shown:
57262
+ *
57263
+ * yui_preferences_setup({
57264
+ * current_theme: () => "dark",
57265
+ * set_theme: (value) => {...},
57266
+ * languages: [{value: "en", text: "English"},
57267
+ * {value: "es", text: "Español"}],
57268
+ * current_language: () => "es",
57269
+ * set_language: (value) => {...}, // the app's i18next
57270
+ * sections: (gobj) => [...], // optional: boxes
57271
+ * });
57272
+ *
57273
+ * set_language() switches the app's i18next; the shell is told after
57274
+ * it (yui_shell_language_changed), so the app does not do it twice.
57275
+ ***************************************************************/
57276
+ function yui_preferences_setup(opts) {
57277
+ let o = opts || {};
57278
+ for (let name of [
57279
+ "current_theme",
57280
+ "set_theme",
57281
+ "current_language",
57282
+ "set_language"
57283
+ ]) if (typeof o[name] !== "function") {
57284
+ log_error(`yui_preferences_setup(): '${name}' must be a function`);
57285
+ return -1;
57286
+ }
57287
+ if (!Array.isArray(o.languages) || o.languages.length === 0) {
57288
+ log_error(`yui_preferences_setup(): 'languages' must list the app's languages`);
57289
+ return -1;
57290
+ }
57291
+ if (o.sections !== void 0 && typeof o.sections !== "function") {
57292
+ log_error(`yui_preferences_setup(): 'sections' must be a function`);
57293
+ return -1;
57294
+ }
57295
+ __setup__ = o;
57296
+ return 0;
57297
+ }
57298
+ function setup_of(who) {
57299
+ if (!__setup__) log_error(`${who}: no yui_preferences_setup() — the app must call it at start up`);
57300
+ return __setup__;
57301
+ }
57302
+ /***************************
57303
+ * Parts of the page
57304
+ ***************************/
57305
+ /***************************************************************
57306
+ * The title of the page and the name of its first box.
57307
+ ***************************************************************/
57308
+ function yui_pref_header() {
57309
+ return [
57310
+ "div",
57311
+ {
57312
+ class: "PREF_HEADER",
57313
+ style: "margin-bottom:0.5rem;"
57314
+ },
57315
+ [[
57316
+ "h1",
57317
+ {
57318
+ class: "PREF_TITLE title is-3 has-text-link",
57319
+ style: "margin-bottom:0.25rem;",
57320
+ i18n: "preferences"
57321
+ },
57322
+ "preferences"
57323
+ ], [
57324
+ "p",
57325
+ {
57326
+ class: "PREF_SUBTITLE subtitle is-6 has-text-grey",
57327
+ style: "margin-bottom:1rem;",
57328
+ i18n: "appearance"
57329
+ },
57330
+ "appearance"
57331
+ ]]
57332
+ ];
57333
+ }
57334
+ /***************************************************************
57335
+ * A box of fields, as wide as the page reads well.
57336
+ ***************************************************************/
57337
+ function yui_pref_box(fields, extra_class) {
57338
+ return [
57339
+ "div",
57340
+ {
57341
+ class: `PREF_BOX box ${extra_class || ""}`,
57342
+ style: "max-width:540px;"
57343
+ },
57344
+ fields
57345
+ ];
57346
+ }
57347
+ /***************************************************************
57348
+ * One field: its label over its control.
57349
+ ***************************************************************/
57350
+ function yui_pref_field(label_key, control, extra_class) {
57351
+ return [
57352
+ "div",
57353
+ {
57354
+ class: `PREF_FIELD field ${extra_class || ""}`,
57355
+ style: "margin-bottom:1.25rem;"
57356
+ },
57357
+ [[
57358
+ "label",
57359
+ {
57360
+ class: "PREF_LABEL label",
57361
+ i18n: label_key
57362
+ },
57363
+ label_key
57364
+ ], [
57365
+ "div",
57366
+ { class: "PREF_CONTROL control" },
57367
+ [control]
57368
+ ]]
57369
+ ];
57370
+ }
57371
+ /***************************************************************
57372
+ * A segmented choice: one button per option, the current one
57373
+ * marked (`is-primary is-selected`). An option is
57374
+ *
57375
+ * {value, key, icon} the label and the name are the key
57376
+ * {value, text, lang} the label and the name are the text,
57377
+ * which is data (a language's own name)
57378
+ *
57379
+ * A click sends `event_name` {value} to `gobj`: the click is an OS
57380
+ * notification, the change is an action of the host.
57381
+ ***************************************************************/
57382
+ function yui_pref_segment(gobj, event_name, options, current, extra_class) {
57383
+ let buttons = options.map(function(opt) {
57384
+ let active = opt.value === current;
57385
+ let cls = "PREF_SEGMENT_ITEM button" + (active ? " is-primary is-selected" : "");
57386
+ let kids = [];
57387
+ if (opt.icon) kids.push([
57388
+ "span",
57389
+ { class: "icon" },
57390
+ [yui_toolbar_icon(opt.icon)]
57391
+ ]);
57392
+ let attrs = {
57393
+ type: "button",
57394
+ class: cls,
57395
+ "aria-pressed": active ? "true" : "false"
57396
+ };
57397
+ if (opt.key) {
57398
+ kids.push([
57399
+ "span",
57400
+ {
57401
+ class: "PREF_SEGMENT_TEXT",
57402
+ i18n: opt.key
57403
+ },
57404
+ opt.key
57405
+ ]);
57406
+ attrs.title = t(opt.key);
57407
+ attrs["data-i18n-title"] = opt.key;
57408
+ attrs["aria-label"] = t(opt.key);
57409
+ attrs["data-i18n-aria-label"] = opt.key;
57410
+ } else {
57411
+ kids.push([
57412
+ "span",
57413
+ {
57414
+ class: "PREF_SEGMENT_TEXT",
57415
+ lang: opt.lang || opt.value
57416
+ },
57417
+ text_node(opt.text)
57418
+ ]);
57419
+ attrs.title = opt.text;
57420
+ attrs["aria-label"] = opt.text;
57421
+ attrs.lang = opt.lang || opt.value;
57422
+ }
57423
+ return [
57424
+ "button",
57425
+ attrs,
57426
+ kids,
57427
+ { click: function() {
57428
+ gobj_send_event(gobj, event_name, { value: opt.value }, gobj);
57429
+ } }
57430
+ ];
57431
+ });
57432
+ return [
57433
+ "div",
57434
+ { class: `PREF_SEGMENT buttons has-addons ${extra_class || ""}` },
57435
+ buttons
57436
+ ];
57437
+ }
57438
+ /***************************************************************
57439
+ * The three rows every app shows: theme, language, navigation.
57440
+ * Their clicks send EV_SET_THEME / EV_SET_LANGUAGE /
57441
+ * EV_SET_NAV_MODE {value} to `gobj`.
57442
+ ***************************************************************/
57443
+ function yui_pref_appearance_fields(gobj) {
57444
+ let setup = setup_of("yui_pref_appearance_fields()");
57445
+ if (!setup) return [];
57446
+ let shell = yui_shell_of(gobj);
57447
+ let languages = setup.languages.map((l) => ({
57448
+ value: l.value,
57449
+ text: l.text,
57450
+ lang: l.value
57451
+ }));
57452
+ return [
57453
+ yui_pref_field("theme", yui_pref_segment(gobj, "EV_SET_THEME", THEMES, setup.current_theme(), "PREF_THEME"), "PREF_THEME_FIELD"),
57454
+ yui_pref_field("language", yui_pref_segment(gobj, "EV_SET_LANGUAGE", languages, setup.current_language(), "PREF_LANGUAGE"), "PREF_LANGUAGE_FIELD"),
57455
+ yui_pref_field("navigation", yui_pref_segment(gobj, "EV_SET_NAV_MODE", NAV_MODE_OPTIONS, shell ? yui_shell_nav_mode(shell) : "stack", "PREF_NAVIGATION"), "PREF_NAVIGATION_FIELD")
57456
+ ];
57457
+ }
57458
+ /***************************************************************
57459
+ * The extra boxes of the app (its `sections`), or none.
57460
+ ***************************************************************/
57461
+ function yui_pref_sections(gobj) {
57462
+ let setup = setup_of("yui_pref_sections()");
57463
+ if (!setup || !setup.sections) return [];
57464
+ let boxes = setup.sections(gobj);
57465
+ return Array.isArray(boxes) ? boxes : [];
57466
+ }
57467
+ /***************************
57468
+ * Applying a choice
57469
+ ***************************/
57470
+ /***************************************************************
57471
+ * Apply one of the three choices: EV_SET_THEME, EV_SET_LANGUAGE
57472
+ * or EV_SET_NAV_MODE, with its {value}. The host calls it from
57473
+ * its action and draws its page again: which option is marked is
57474
+ * markup, which no refresh_language() moves.
57475
+ ***************************************************************/
57476
+ function yui_pref_apply(gobj, event, kw) {
57477
+ let setup = setup_of("yui_pref_apply()");
57478
+ if (!setup) return -1;
57479
+ let value = kw && kw.value || "";
57480
+ let shell = yui_shell_of(gobj);
57481
+ switch (event) {
57482
+ case "EV_SET_THEME":
57483
+ setup.set_theme(value);
57484
+ return 0;
57485
+ case "EV_SET_LANGUAGE":
57486
+ setup.set_language(value);
57487
+ if (shell) yui_shell_language_changed(shell);
57488
+ else refresh_language(document.body, t);
57489
+ return 0;
57490
+ case "EV_SET_NAV_MODE":
57491
+ if (!shell) {
57492
+ log_error(`yui_pref_apply(): no shell, the navigation cannot change`);
57493
+ return -1;
57494
+ }
57495
+ return yui_shell_set_nav_mode(shell, value);
57496
+ default:
57497
+ log_error(`yui_pref_apply(): '${event}' is not a preference`);
57498
+ return -1;
57499
+ }
57500
+ }
57501
+ // src/c_yui_preferences.js
57502
+ /***********************************************************************
57503
+ * c_yui_preferences.js
57504
+ * C_YUI_PREFERENCES GClass.
57505
+ *
57506
+ * The Preferences page of an app, whole: a view the shell
57507
+ * mounts at /preferences (a route target of the app config).
57508
+ *
57509
+ * "/preferences": {"target": {"gclass": "C_YUI_PREFERENCES"}}
57510
+ *
57511
+ * It draws the three rows every app shows -- theme, language,
57512
+ * navigation (yui_preferences.js) -- and then the boxes the
57513
+ * app adds in its yui_preferences_setup(). A press applies at
57514
+ * once and is kept in this browser; the page is drawn again
57515
+ * to mark the new choice, and when the language changes from
57516
+ * elsewhere (the toolbar), because which option is marked is
57517
+ * markup.
57518
+ *
57519
+ * An app whose page has fields with actions of its own keeps
57520
+ * its own view and draws the same rows with the parts of
57521
+ * yui_preferences.js.
57522
+ *
57523
+ * Copyright (c) 2026, ArtGins.
57524
+ * All Rights Reserved.
57525
+ ***********************************************************************/
57526
+ /***************************************************************
57527
+ * Constants
57528
+ ***************************************************************/
57529
+ var GCLASS_NAME$7 = "C_YUI_PREFERENCES";
57530
+ /***************************************************************
57531
+ * Data
57532
+ ***************************************************************/
57533
+ var attrs_table$7 = [
57534
+ SDATA(data_type_t.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
57535
+ SDATA(data_type_t.DTP_POINTER, "$container", 0, null, "Root HTMLElement (shell view contract)"),
57536
+ SDATA_END()
57537
+ ];
57538
+ var PRIVATE_DATA$7 = { shell: null };
57539
+ var __gclass__$7 = null;
57540
+ /******************************
57541
+ * Framework Methods
57542
+ ******************************/
57543
+ /***************************************************************
57544
+ * Framework Method: Create
57545
+ ***************************************************************/
57546
+ function mt_create$7(gobj) {
57547
+ let $container = createElement2([
57548
+ "div",
57549
+ { class: "C_YUI_PREFERENCES PREF_PAGE p-4" },
57550
+ []
57551
+ ]);
57552
+ gobj_write_attr(gobj, "$container", $container);
57553
+ let subscriber = gobj_read_pointer_attr(gobj, "subscriber");
57554
+ if (!subscriber) subscriber = gobj_parent(gobj);
57555
+ gobj_subscribe_event(gobj, null, {}, subscriber);
57556
+ }
57557
+ /***************************************************************
57558
+ * Framework Method: Start
57559
+ ***************************************************************/
57560
+ function mt_start$7(gobj) {
57561
+ let priv = gobj.priv;
57562
+ priv.shell = yui_shell_of(gobj);
57563
+ if (priv.shell) gobj_subscribe_event(priv.shell, "EV_LANGUAGE_CHANGED", {}, gobj);
57564
+ render$1(gobj);
57565
+ }
57566
+ /***************************************************************
57567
+ * Framework Method: Stop
57568
+ ***************************************************************/
57569
+ function mt_stop$7(gobj) {
57570
+ let priv = gobj.priv;
57571
+ if (priv.shell) {
57572
+ gobj_unsubscribe_event(priv.shell, "EV_LANGUAGE_CHANGED", {}, gobj);
57573
+ priv.shell = null;
57574
+ }
57575
+ }
57576
+ /***************************************************************
57577
+ * Framework Method: Destroy
57578
+ ***************************************************************/
57579
+ function mt_destroy$7(gobj) {
57580
+ let $container = gobj_read_attr(gobj, "$container");
57581
+ if ($container && $container.parentNode) $container.parentNode.removeChild($container);
57582
+ gobj_write_attr(gobj, "$container", null);
57583
+ }
57584
+ /***************************
57585
+ * Local Methods
57586
+ ***************************/
57587
+ /***************************************************************
57588
+ * Draw the page: the header, the box of the three rows, the
57589
+ * boxes of the app.
57590
+ ***************************************************************/
57591
+ function render$1(gobj) {
57592
+ let $container = gobj_read_attr(gobj, "$container");
57593
+ if (!$container) return;
57594
+ $container.replaceChildren();
57595
+ $container.appendChild(createElement2(yui_pref_header()));
57596
+ $container.appendChild(createElement2(yui_pref_box(yui_pref_appearance_fields(gobj), "PREF_APPEARANCE")));
57597
+ for (let box of yui_pref_sections(gobj)) $container.appendChild(box && box.nodeType ? box : createElement2(box));
57598
+ refresh_language($container, t);
57599
+ }
57600
+ /***************************
57601
+ * Actions
57602
+ ***************************/
57603
+ /***************************************************************
57604
+ * EV_SET_THEME / EV_SET_LANGUAGE / EV_SET_NAV_MODE {value}:
57605
+ * a press on one of the three rows.
57606
+ ***************************************************************/
57607
+ function ac_set_preference(gobj, event, kw, src) {
57608
+ let ret = yui_pref_apply(gobj, event, kw);
57609
+ render$1(gobj);
57610
+ return ret;
57611
+ }
57612
+ /***************************************************************
57613
+ * The language changed somewhere else (the toolbar).
57614
+ ***************************************************************/
57615
+ function ac_language_changed$5(gobj, event, kw, src) {
57616
+ render$1(gobj);
57617
+ return 0;
57618
+ }
57619
+ /***************************************************************
57620
+ * FSM
57621
+ ***************************************************************/
57622
+ var gmt$7 = {
57623
+ mt_create: mt_create$7,
57624
+ mt_start: mt_start$7,
57625
+ mt_stop: mt_stop$7,
57626
+ mt_destroy: mt_destroy$7
57627
+ };
57628
+ /***************************************************************
57629
+ * Create the GClass
57630
+ ***************************************************************/
57631
+ function create_gclass$7(gclass_name) {
57632
+ if (__gclass__$7) {
57633
+ log_error(`GClass ALREADY created: ${gclass_name}`);
57634
+ return -1;
57635
+ }
57636
+ __gclass__$7 = gclass_create(gclass_name, [
57637
+ ["EV_SET_THEME", 0],
57638
+ ["EV_SET_LANGUAGE", 0],
57639
+ ["EV_SET_NAV_MODE", 0],
57640
+ ["EV_LANGUAGE_CHANGED", 0]
57641
+ ], [["ST_IDLE", [
57642
+ [
57643
+ "EV_SET_THEME",
57644
+ ac_set_preference,
57645
+ null
57646
+ ],
57647
+ [
57648
+ "EV_SET_LANGUAGE",
57649
+ ac_set_preference,
57650
+ null
57651
+ ],
57652
+ [
57653
+ "EV_SET_NAV_MODE",
57654
+ ac_set_preference,
57655
+ null
57656
+ ],
57657
+ [
57658
+ "EV_LANGUAGE_CHANGED",
57659
+ ac_language_changed$5,
57660
+ null
57661
+ ]
57662
+ ]]], gmt$7, 0, attrs_table$7, PRIVATE_DATA$7, 0, 0, 0, 0);
57663
+ if (!__gclass__$7) return -1;
57664
+ return 0;
57665
+ }
57666
+ /***************************************************************
57667
+ * Register GClass
57668
+ ***************************************************************/
57669
+ function register_c_yui_preferences() {
56985
57670
  return create_gclass$7(GCLASS_NAME$7);
56986
57671
  }
56987
57672
  // src/shell_route_map.js
@@ -89717,6 +90402,6 @@ function setup_json_pad(self) {
89717
90402
  gobj_start_tree(win);
89718
90403
  return win;
89719
90404
  }
89720
- export { EditControl, ICONS_TOPIC, MarkerControl, USER_ICON_PREFIX, YUI_FILE_ACCEPT, YUI_PERIODS, YUI_PERIODS_DEFAULT, YUI_ROLLING, addClasses, apply_dev_traces, attach_clear, build_dev_panel, dev_window_was_open, disableElements, enableElements, epoch_to_local_input, epoch_to_ms, expose_view_container, fmt_date_time, fmt_epoch, getStrokeColor, infer_period, info_traffic, inject_svg_icons, is_current_period, iso_week, local_input_to_epoch, ms_to_epoch, period_bounds, period_bounds_epoch, period_label, period_name, period_shift, period_spec, period_start, refresh_clear, register_c_g6_nodes_tree, register_c_yui_form, register_c_yui_fsm_graph, register_c_yui_gclass, register_c_yui_gobj_tree_js, register_c_yui_json, register_c_yui_json_graph, register_c_yui_json_pad, register_c_yui_map, register_c_yui_nav, register_c_yui_pager, register_c_yui_period, register_c_yui_schema_editor, register_c_yui_service_view, register_c_yui_shell, register_c_yui_treedb_graph, register_c_yui_treedb_schema, register_c_yui_treedb_topic_with_form, register_c_yui_treedb_topics, register_c_yui_update_watch, register_c_yui_uplot, register_c_yui_window, register_c_yui_window_manager, register_c_yui_wizard, removeChildElements, removeClasses, rolling_bounds, safe_locale, set_active_state, set_cancel_state, set_pressed_state, set_submit_state, setup_dev, setup_frontend_view, setup_json_pad, toggleClasses, yui_array_buffer_to_base64, yui_asset_element, yui_asset_id, yui_asset_ids, yui_asset_missing, yui_asset_src, yui_file_control, yui_file_id_label, yui_file_read, yui_file_sha256, yui_file_size_label, yui_files_manifest, yui_icon_is_defined, yui_icons_list, yui_icons_put_user, yui_icons_remove_user, yui_icons_set_user, yui_is_dark, yui_mount_service_view, yui_shell_close_drawer, yui_shell_close_dropdown, yui_shell_confirm_danger, yui_shell_confirm_ok, yui_shell_confirm_yesno, yui_shell_confirm_yesnocancel, yui_shell_escape_order, yui_shell_navigate, yui_shell_open_drawer, yui_shell_overlay_dismissed, yui_shell_pop_escape, yui_shell_push_escape, yui_shell_refresh_avatars, yui_shell_register_event_handler, yui_shell_register_overlay, yui_shell_set_avatar_provider, yui_shell_set_connection_state, yui_shell_set_nav_item_badge, yui_shell_set_sub_routes, yui_shell_set_toolbar_item_badge, yui_shell_set_toolbar_item_icon, yui_shell_set_translator, yui_shell_show_error, yui_shell_show_info, yui_shell_show_modal, yui_shell_show_route_map, yui_shell_show_warning, yui_shell_toggle_drawer, yui_shell_unpark_route, yui_svg_icon_element, yui_svg_sanitize, yui_theme_now, yui_toolbar, yui_update_watch_language_changed, yui_user_icon_class, yui_watch_theme };
90405
+ export { EditControl, ICONS_TOPIC, MarkerControl, USER_ICON_PREFIX, YUI_FILE_ACCEPT, YUI_PERIODS, YUI_PERIODS_DEFAULT, YUI_PREFERENCES_I18N_KEYS, YUI_ROLLING, addClasses, apply_dev_traces, attach_clear, build_dev_panel, dev_window_was_open, disableElements, enableElements, epoch_to_local_input, epoch_to_ms, expose_view_container, fmt_date_time, fmt_epoch, getStrokeColor, infer_period, info_traffic, inject_svg_icons, is_current_period, iso_week, local_input_to_epoch, ms_to_epoch, period_bounds, period_bounds_epoch, period_label, period_name, period_shift, period_spec, period_start, refresh_clear, register_c_g6_nodes_tree, register_c_yui_form, register_c_yui_fsm_graph, register_c_yui_gclass, register_c_yui_gobj_tree_js, register_c_yui_json, register_c_yui_json_graph, register_c_yui_json_pad, register_c_yui_map, register_c_yui_nav, register_c_yui_pager, register_c_yui_period, register_c_yui_preferences, register_c_yui_schema_editor, register_c_yui_service_view, register_c_yui_shell, register_c_yui_treedb_graph, register_c_yui_treedb_schema, register_c_yui_treedb_topic_with_form, register_c_yui_treedb_topics, register_c_yui_update_watch, register_c_yui_uplot, register_c_yui_window, register_c_yui_window_manager, register_c_yui_wizard, removeChildElements, removeClasses, rolling_bounds, safe_locale, set_active_state, set_cancel_state, set_pressed_state, set_submit_state, setup_dev, setup_frontend_view, setup_json_pad, toggleClasses, yui_array_buffer_to_base64, yui_asset_element, yui_asset_id, yui_asset_ids, yui_asset_missing, yui_asset_src, yui_file_control, yui_file_id_label, yui_file_read, yui_file_sha256, yui_file_size_label, yui_files_manifest, yui_icon_is_defined, yui_icons_list, yui_icons_put_user, yui_icons_remove_user, yui_icons_set_user, yui_is_dark, yui_mount_service_view, yui_pref_appearance_fields, yui_pref_apply, yui_pref_box, yui_pref_field, yui_pref_header, yui_pref_sections, yui_pref_segment, yui_preferences_setup, yui_shell_close_drawer, yui_shell_close_dropdown, yui_shell_confirm_danger, yui_shell_confirm_ok, yui_shell_confirm_yesno, yui_shell_confirm_yesnocancel, yui_shell_escape_order, yui_shell_nav_mode, yui_shell_navigate, yui_shell_open_drawer, yui_shell_overlay_dismissed, yui_shell_pop_escape, yui_shell_push_escape, yui_shell_refresh_avatars, yui_shell_register_event_handler, yui_shell_register_overlay, yui_shell_set_avatar_provider, yui_shell_set_connection_state, yui_shell_set_nav_item_badge, yui_shell_set_nav_mode, yui_shell_set_sub_routes, yui_shell_set_toolbar_item_badge, yui_shell_set_toolbar_item_icon, yui_shell_set_translator, yui_shell_show_error, yui_shell_show_info, yui_shell_show_modal, yui_shell_show_route_map, yui_shell_show_warning, yui_shell_toggle_drawer, yui_shell_unpark_route, yui_svg_icon_element, yui_svg_sanitize, yui_theme_now, yui_toolbar, yui_update_watch_language_changed, yui_user_icon_class, yui_watch_theme };
89721
90406
 
89722
90407
  //# sourceMappingURL=gobj-ui.es.js.map