@ezeep/ezeep-js 1.0.294 → 1.0.306

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.
Files changed (75) hide show
  1. package/dist/cjs/ezeep.cjs.js +1 -1
  2. package/dist/cjs/{ezp-auth_15.cjs.entry.js → ezp-auth_16.cjs.entry.js} +674 -110
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/collection/collection-manifest.json +1 -0
  5. package/dist/collection/components/ezp-file-name/ezp-file-name.css +98 -0
  6. package/dist/collection/components/ezp-file-name/ezp-file-name.js +411 -0
  7. package/dist/collection/components/ezp-icon/ezp-icon.js +1 -1
  8. package/dist/collection/components/ezp-icon-button/ezp-icon-button.js +1 -1
  9. package/dist/collection/components/ezp-input/ezp-input.js +1 -1
  10. package/dist/collection/components/ezp-label/ezp-label.js +39 -1
  11. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.css +31 -3
  12. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +243 -90
  13. package/dist/collection/components/ezp-printing/ezp-printing.js +20 -2
  14. package/dist/collection/components/ezp-select/ezp-select.js +1 -1
  15. package/dist/collection/components/ezp-status/ezp-status.js +2 -2
  16. package/dist/collection/components/ezp-stepper/ezp-stepper.js +1 -1
  17. package/dist/collection/components/ezp-text-button/ezp-text-button.js +1 -1
  18. package/dist/collection/components/ezp-upload/ezp-upload.css +26 -1
  19. package/dist/collection/components/ezp-upload/ezp-upload.js +14 -3
  20. package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +1 -1
  21. package/dist/collection/shared/storage.js +39 -9
  22. package/dist/collection/types/shared/types.d.ts +2 -0
  23. package/dist/collection/utils/printer.js +75 -1
  24. package/dist/collection/utils/utils.js +29 -0
  25. package/dist/components/auth.js +1 -1
  26. package/dist/components/ezp-file-name.d.ts +11 -0
  27. package/dist/components/ezp-file-name.js +1 -0
  28. package/dist/components/ezp-file-name2.js +1 -0
  29. package/dist/components/ezp-icon-button2.js +1 -1
  30. package/dist/components/ezp-icon2.js +1 -1
  31. package/dist/components/ezp-input2.js +1 -1
  32. package/dist/components/ezp-label2.js +1 -1
  33. package/dist/components/ezp-printer-selection2.js +1 -1
  34. package/dist/components/ezp-printing.js +1 -1
  35. package/dist/components/ezp-select2.js +1 -1
  36. package/dist/components/ezp-status2.js +1 -1
  37. package/dist/components/ezp-stepper2.js +1 -1
  38. package/dist/components/ezp-text-button2.js +1 -1
  39. package/dist/components/ezp-upload2.js +1 -1
  40. package/dist/components/ezp-user-menu2.js +1 -1
  41. package/dist/components/utils.js +1 -1
  42. package/dist/directives/proxies.ts +38 -4
  43. package/dist/esm/ezeep.js +1 -1
  44. package/dist/esm/{ezp-auth_15.entry.js → ezp-auth_16.entry.js} +674 -111
  45. package/dist/esm/loader.js +1 -1
  46. package/dist/esm-es5/ezeep.js +1 -1
  47. package/dist/esm-es5/{ezp-auth_15.entry.js → ezp-auth_16.entry.js} +2 -2
  48. package/dist/esm-es5/loader.js +1 -1
  49. package/dist/ezeep/ezeep.esm.js +1 -1
  50. package/dist/ezeep/p-646c1d42.entry.js +1 -0
  51. package/dist/ezeep/p-8e2d88a9.system.entry.js +7 -0
  52. package/dist/ezeep/p-DCznw2Ee.system.js +1 -1
  53. package/dist/ezeep/types/shared/types.d.ts +2 -0
  54. package/dist/types/components/ezp-file-name/ezp-file-name.d.ts +125 -0
  55. package/dist/types/components/ezp-label/ezp-label.d.ts +10 -0
  56. package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +48 -2
  57. package/dist/types/components/ezp-printing/ezp-printing.d.ts +9 -2
  58. package/dist/types/components/ezp-upload/ezp-upload.d.ts +4 -0
  59. package/dist/types/components.d.ts +82 -3
  60. package/dist/types/shared/storage.d.ts +18 -4
  61. package/dist/types/shared/types.d.ts +2 -0
  62. package/dist/types/utils/printer.d.ts +18 -0
  63. package/dist/types/utils/utils.d.ts +20 -1
  64. package/package.json +1 -1
  65. package/www/build/ezeep.esm.js +1 -1
  66. package/www/build/p-646c1d42.entry.js +1 -0
  67. package/www/build/p-70951744.js +1 -0
  68. package/www/build/p-8e2d88a9.system.entry.js +7 -0
  69. package/www/build/p-DCznw2Ee.system.js +1 -1
  70. package/www/index.html +1 -1
  71. package/dist/ezeep/p-3ab5a223.entry.js +0 -1
  72. package/dist/ezeep/p-fe700ca4.system.entry.js +0 -7
  73. package/www/build/p-3ab5a223.entry.js +0 -1
  74. package/www/build/p-65242d5e.js +0 -1
  75. package/www/build/p-fe700ca4.system.entry.js +0 -7
@@ -2765,6 +2765,35 @@ function subscribeToLanguageChange(component) {
2765
2765
  instance.on('languageChanged', rerender);
2766
2766
  return () => instance.off('languageChanged', rerender);
2767
2767
  }
2768
+ /** Index of the first child of a scroll container that is at least half in
2769
+ * view, or -1 when it has none. Lists use it to open the topmost visible row's
2770
+ * tooltip downwards, as nothing in the list is left above that row to cover.
2771
+ * A row showing only a sliver doesn't count: the row below it is the one the
2772
+ * user reads first, and that one should open downwards. */
2773
+ function firstVisibleChild(container) {
2774
+ const top = container.getBoundingClientRect().top;
2775
+ return Array.from(container.children).findIndex((child) => {
2776
+ const rect = child.getBoundingClientRect();
2777
+ return (rect.top + rect.bottom) / 2 > top;
2778
+ });
2779
+ }
2780
+ /**
2781
+ * Side a tooltip should open on, given where it was asked to open and the room
2782
+ * there is. The requested side wins whenever the bubble fits there; otherwise
2783
+ * it flips to the other side if that fits, or if that simply has more room.
2784
+ * All values are in the same (screen) pixels.
2785
+ */
2786
+ function pickTooltipSide(requested, row, needed, visible) {
2787
+ const above = row.top - visible.top;
2788
+ const below = visible.bottom - row.bottom;
2789
+ const room = { top: above, bottom: below };
2790
+ const other = requested === 'top' ? 'bottom' : 'top';
2791
+ if (room[requested] >= needed)
2792
+ return requested;
2793
+ if (room[other] >= needed || room[other] > room[requested])
2794
+ return other;
2795
+ return requested;
2796
+ }
2768
2797
  function encodeFormData(data) {
2769
2798
  return Object.keys(data)
2770
2799
  .map((key) => encodeURIComponent(key) + '=' + encodeURIComponent(data[key]))
@@ -2882,8 +2911,10 @@ const KEY = {
2882
2911
  accessToken: 'access_token',
2883
2912
  refreshToken: 'refreshToken',
2884
2913
  isAuthorized: 'isAuthorized',
2914
+ /** Legacy single-printer settings blob, read once to seed `printerSettings`. */
2885
2915
  properties: 'properties',
2886
2916
  printer: 'printer',
2917
+ printerSettings: 'printerSettings',
2887
2918
  };
2888
2919
  function getJSON(key) {
2889
2920
  const raw = localStorage.getItem(key);
@@ -2914,32 +2945,60 @@ const storage = {
2914
2945
  hasIsAuthorized() {
2915
2946
  return localStorage.getItem(KEY.isAuthorized) !== null;
2916
2947
  },
2917
- getProperties() {
2918
- return getJSON(KEY.properties);
2948
+ /**
2949
+ * Settings the user last printed with on `printerId`, or null if that printer
2950
+ * has none yet. Kept per printer so switching printers never carries another
2951
+ * printer's paper size or tray over to one that may not have it.
2952
+ */
2953
+ getPrinterSettings(printerId) {
2954
+ var _a;
2955
+ return (_a = readPrinterSettings()[printerId]) !== null && _a !== void 0 ? _a : null;
2919
2956
  },
2920
- setProperties(properties) {
2921
- localStorage.setItem(KEY.properties, JSON.stringify(properties));
2957
+ setPrinterSettings(printerId, properties) {
2958
+ const all = readPrinterSettings();
2959
+ all[printerId] = properties;
2960
+ localStorage.setItem(KEY.printerSettings, JSON.stringify(all));
2922
2961
  },
2962
+ /** The printer used for the last print, preselected when the dialog reopens. */
2923
2963
  getPrinter() {
2924
2964
  return getJSON(KEY.printer);
2925
2965
  },
2926
2966
  setPrinter(printer) {
2927
2967
  localStorage.setItem(KEY.printer, JSON.stringify(printer));
2928
2968
  },
2929
- /** Remove everything tied to the current session (used on logout). */
2969
+ /**
2970
+ * Remove everything tied to the current session (used on logout).
2971
+ *
2972
+ * Print settings and the last printer deliberately survive: they belong to
2973
+ * this browser profile rather than to the session, and are validated against
2974
+ * the signed-in user's printers on the next load (an unknown printer resets
2975
+ * the selection), so the next user never inherits a selection they can't use.
2976
+ */
2930
2977
  clearSession() {
2931
- localStorage.removeItem(KEY.properties);
2932
2978
  localStorage.removeItem(KEY.refreshToken);
2933
2979
  localStorage.removeItem(KEY.accessToken);
2934
- localStorage.removeItem(KEY.printer);
2935
2980
  localStorage.removeItem(KEY.isAuthorized);
2936
2981
  },
2937
- /** Remove just the saved printer + its properties (used when the saved printer is gone). */
2982
+ /** Forget which printer was last used (when it is gone from the user's list).
2983
+ * Its settings stay put, ready in case that printer comes back. */
2938
2984
  clearSavedPrinter() {
2939
2985
  localStorage.removeItem(KEY.printer);
2940
- localStorage.removeItem(KEY.properties);
2941
2986
  },
2942
2987
  };
2988
+ /**
2989
+ * Read the per-printer settings map, seeding it once from the pre-upgrade
2990
+ * single-printer blob so a user who already printed keeps those settings.
2991
+ */
2992
+ function readPrinterSettings() {
2993
+ const stored = getJSON(KEY.printerSettings);
2994
+ if (stored)
2995
+ return stored;
2996
+ const legacy = getJSON(KEY.properties);
2997
+ const legacyPrinter = getJSON(KEY.printer);
2998
+ if (legacy && (legacyPrinter === null || legacyPrinter === void 0 ? void 0 : legacyPrinter.id))
2999
+ return { [legacyPrinter.id]: legacy };
3000
+ return {};
3001
+ }
2943
3002
 
2944
3003
  class EzpAuthorizationService {
2945
3004
  constructor(redirectURI, clientID) {
@@ -3355,6 +3414,260 @@ const EzpDialog = class {
3355
3414
  };
3356
3415
  EzpDialog.style = ezpDialogCss();
3357
3416
 
3417
+ const ezpFileNameCss = () => `@charset "UTF-8";:host{display:block;min-width:0}#trigger{-ms-flex-align:baseline;align-items:baseline;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;border-radius:4px;color:inherit;cursor:pointer;display:-ms-flexbox;display:flex;font-family:inherit;margin:0;max-width:100%;min-width:0;outline-color:var(--ezp-theme-solid);outline-offset:2px;padding:0;text-align:left}.head{-ms-flex:0 1 auto;flex:0 1 auto;min-width:0}.tail{-ms-flex:0 0 auto;flex:0 0 auto}:host(:not(.expanded)) .head,:host(:not(.expanded)) .tail{--ezp-label-whiteSpace:pre}:host(.expanded) .head{--ezp-label-whiteSpace:pre-wrap}:host(.expanded) #trigger{word-break:break-all}#tooltip{background:var(--ezp-core-surface-tertiary);border-radius:8px;-webkit-box-shadow:0 0 0 1px var(--ezp-core-outline), 0 16px 40px -16px var(--ezp-core-backdrop);box-shadow:0 0 0 1px var(--ezp-core-outline), 0 16px 40px -16px var(--ezp-core-backdrop);color:var(--ezp-core-foreground-primary);font-size:12px;font-weight:500;left:0;line-height:18px;padding:var(--ezp-spacing-2) var(--ezp-spacing-3);pointer-events:auto;position:absolute;right:0;word-break:break-all;z-index:10}:host(.place-top) #tooltip{bottom:calc(100% + var(--ezp-spacing-2))}:host(.place-bottom) #tooltip{top:calc(100% + var(--ezp-spacing-2))}`;
3418
+
3419
+ /**
3420
+ * Characters kept at the end of a truncated name. Uploads often differ only in
3421
+ * a suffix like `_DE.pdf`, which a plain end-ellipsis would be the first thing
3422
+ * to hide, so that tail is held back and the middle gives way instead.
3423
+ */
3424
+ const TAIL_LENGTH = 8;
3425
+ /** Hovering across a list shouldn't flash a tooltip over every row in passing. */
3426
+ const OPEN_DELAY_MS = 300;
3427
+ /** Grace period for crossing the gap between the name and the bubble, so the
3428
+ * tooltip can be hovered rather than vanishing on the way (WCAG 1.4.13). */
3429
+ const CLOSE_DELAY_MS = 200;
3430
+ const EzpFileName = class {
3431
+ constructor(hostRef) {
3432
+ index.registerInstance(this, hostRef);
3433
+ /** Invalidates an in-flight open when the pointer leaves. */
3434
+ this.openGeneration = 0;
3435
+ /** Everything the open tooltip listens to for scrolling, to detach on close. */
3436
+ this.scrollTargets = [];
3437
+ /**
3438
+ *
3439
+ * Properties
3440
+ *
3441
+ */
3442
+ /** The full file name. Always present in the DOM, so screen readers and
3443
+ * copy-paste get it in full however it is truncated on screen. */
3444
+ this.name = '';
3445
+ /** Type scale of the rendered name, passed through to `ezp-label`. */
3446
+ this.level = 'secondary';
3447
+ /** Font weight of the rendered name, passed through to `ezp-label`. */
3448
+ this.weight = 'soft';
3449
+ /** Side the tooltip opens on. Consumers point it away from the edge their
3450
+ * row sits against — `bottom` for the first row of a list, `top` below it. */
3451
+ this.placement = 'top';
3452
+ /** What the tooltip is placed against.
3453
+ *
3454
+ * `container`: the nearest positioned ancestor, by CSS alone. The consumer
3455
+ * makes the row that ancestor, and the bubble opens at the row's edge.
3456
+ *
3457
+ * `parent`: the row the name sits in, measured when the tooltip opens — the
3458
+ * closest ancestor marked `data-tooltip-row`, or else the name's parent
3459
+ * element. For rows inside a scroll container, which would clip a bubble
3460
+ * anchored to the row. The consumer puts the positioned ancestor outside the
3461
+ * scroller instead, and the bubble spans that ancestor but lines up with
3462
+ * the row. */
3463
+ this.anchor = 'container';
3464
+ /**
3465
+ *
3466
+ * States
3467
+ *
3468
+ */
3469
+ /** Set by tapping the name: shows it in full, wrapped over several lines.
3470
+ * This is the touch counterpart of the tooltip, which needs a pointer. */
3471
+ this.expanded = false;
3472
+ this.tooltipOpen = false;
3473
+ this.openTooltip = () => {
3474
+ if (!this.hasHover || this.expanded)
3475
+ return;
3476
+ clearTimeout(this.openTimeout);
3477
+ const generation = ++this.openGeneration;
3478
+ this.openTimeout = setTimeout(async () => {
3479
+ const clipped = await this.isClipped();
3480
+ // Measuring yields, and the pointer may have moved on in the meantime —
3481
+ // opening now would leave a tooltip behind with nothing to dismiss it.
3482
+ if (clipped && generation === this.openGeneration)
3483
+ this.tooltipOpen = true;
3484
+ }, OPEN_DELAY_MS);
3485
+ };
3486
+ this.closeTooltip = () => {
3487
+ this.openGeneration++;
3488
+ clearTimeout(this.openTimeout);
3489
+ clearTimeout(this.closeTimeout);
3490
+ this.tooltipOpen = false;
3491
+ };
3492
+ /** Leaves the tooltip up briefly so the pointer can reach it. */
3493
+ this.scheduleClose = () => {
3494
+ clearTimeout(this.openTimeout);
3495
+ clearTimeout(this.closeTimeout);
3496
+ this.closeTimeout = setTimeout(this.closeTooltip, CLOSE_DELAY_MS);
3497
+ };
3498
+ this.cancelScheduledClose = () => {
3499
+ clearTimeout(this.closeTimeout);
3500
+ };
3501
+ this.toggleExpanded = () => {
3502
+ this.expanded = !this.expanded;
3503
+ // The full name is on screen now; a tooltip repeating it is just in the way.
3504
+ if (this.expanded)
3505
+ this.closeTooltip();
3506
+ };
3507
+ }
3508
+ /**
3509
+ *
3510
+ * Lifecycle methods
3511
+ *
3512
+ */
3513
+ disconnectedCallback() {
3514
+ // Closing also drops the listeners. A node that is moved comes back with
3515
+ // its tooltip shut, rather than open with nothing left to close it.
3516
+ this.closeTooltip();
3517
+ this.stopWatchingScroll();
3518
+ }
3519
+ componentDidRender() {
3520
+ if (this.tooltipOpen && this.anchor === 'parent')
3521
+ this.placeTooltip();
3522
+ }
3523
+ /**
3524
+ *
3525
+ * Watchers
3526
+ *
3527
+ */
3528
+ /** A measured bubble stays where it was put, so once the row scrolls away
3529
+ * under it, it would point at the wrong name. Closing it is the honest fix. */
3530
+ watchTooltipOpen(open) {
3531
+ if (open && this.anchor === 'parent')
3532
+ this.watchScroll();
3533
+ else
3534
+ this.stopWatchingScroll();
3535
+ }
3536
+ /**
3537
+ *
3538
+ * Listeners
3539
+ *
3540
+ */
3541
+ /**
3542
+ * Escape dismisses the tooltip, and only the tooltip.
3543
+ *
3544
+ * Listening globally catches the key however the tooltip was opened,
3545
+ * including by hover, when nothing here has focus. It has to run in the
3546
+ * capture phase: stopping propagation on the way back up happens after every
3547
+ * ancestor has already seen the key, so a host app that closes its dialog on
3548
+ * Escape would close it as the tooltip was dismissed.
3549
+ *
3550
+ * `window` rather than `document`, because dialog libraries capture on the
3551
+ * document themselves — Radix's `DismissableLayer` does — and register before
3552
+ * a component mounted inside them, so they would still see the key first.
3553
+ * Capture runs window before document, so this transient layer consumes the
3554
+ * key first, and only while it is actually open.
3555
+ */
3556
+ handleKeyDown(event) {
3557
+ if (event.key === 'Escape' && this.tooltipOpen) {
3558
+ event.stopPropagation();
3559
+ this.closeTooltip();
3560
+ }
3561
+ }
3562
+ /**
3563
+ *
3564
+ * Private methods
3565
+ *
3566
+ */
3567
+ /** Tooltips need a pointer; touch devices get the tap-to-expand path instead.
3568
+ * Tapping fires a synthetic `mouseenter` in most mobile browsers, so without
3569
+ * this check a tooltip would open on every tap. */
3570
+ get hasHover() {
3571
+ var _a, _b;
3572
+ return (_b = (_a = window.matchMedia) === null || _a === void 0 ? void 0 : _a.call(window, '(hover: hover)').matches) !== null && _b !== void 0 ? _b : false;
3573
+ }
3574
+ /** Whether anything is actually hidden. A name that fits needs no tooltip —
3575
+ * repeating text the reader can already see is just noise in the way. */
3576
+ async isClipped() {
3577
+ var _a, _b;
3578
+ const head = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.head');
3579
+ if (!head)
3580
+ return false;
3581
+ await ((_b = head.componentOnReady) === null || _b === void 0 ? void 0 : _b.call(head));
3582
+ return head.isTruncated();
3583
+ }
3584
+ /** Lines the bubble up with the row the name sits in. Its containing block
3585
+ * is somewhere further out, so `top: 0` shows where that block starts, and
3586
+ * the offset is taken from there. Measurements are in screen pixels, which
3587
+ * differ from CSS pixels when a host scales the dialog with a transform, so
3588
+ * the offset is converted back before it is applied.
3589
+ *
3590
+ * `placement` is a preference here: a row near the edge of whatever clips
3591
+ * the bubble may not have room on that side, so it opens on the other. */
3592
+ placeTooltip() {
3593
+ var _a, _b;
3594
+ const tooltip = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#tooltip');
3595
+ const row = (_b = this.host.closest('[data-tooltip-row]')) !== null && _b !== void 0 ? _b : this.host.parentElement;
3596
+ if (!tooltip || !row)
3597
+ return;
3598
+ tooltip.style.bottom = 'auto';
3599
+ tooltip.style.top = '0px';
3600
+ const bubble = tooltip.getBoundingClientRect();
3601
+ const scale = tooltip.offsetHeight > 0 ? bubble.height / tooltip.offsetHeight : 1;
3602
+ const rowRect = row.getBoundingClientRect();
3603
+ const gap = (parseFloat(getComputedStyle(tooltip).getPropertyValue('--ezp-spacing-2')) || 6) * scale;
3604
+ const side = pickTooltipSide(this.placement, rowRect, bubble.height + gap, this.visibleArea(tooltip));
3605
+ const top = side === 'top' ? rowRect.top - gap - bubble.height : rowRect.bottom + gap;
3606
+ tooltip.style.top = `${(top - bubble.top) / (scale || 1)}px`;
3607
+ }
3608
+ /** The part of the screen the bubble can show in: the viewport, narrowed by
3609
+ * every ancestor of its containing block that clips overflow — the host's
3610
+ * scrolling body, say. The scroller the rows sit in isn't among them, as the
3611
+ * bubble is anchored beyond it. */
3612
+ visibleArea(tooltip) {
3613
+ var _a;
3614
+ let top = 0;
3615
+ let bottom = window.innerHeight;
3616
+ let node = tooltip.offsetParent;
3617
+ while (node) {
3618
+ if (getComputedStyle(node).overflowY !== 'visible') {
3619
+ const rect = node.getBoundingClientRect();
3620
+ top = Math.max(top, rect.top);
3621
+ bottom = Math.min(bottom, rect.bottom);
3622
+ }
3623
+ node = (_a = node.parentElement) !== null && _a !== void 0 ? _a : (node.getRootNode().host || null);
3624
+ }
3625
+ return { top, bottom };
3626
+ }
3627
+ /** Scroll events don't bubble, so every ancestor is listened to directly —
3628
+ * across shadow roots, since the scroll container is usually the consumer's.
3629
+ * A window resize re-wraps the bubble just the same, so it closes it too. */
3630
+ watchScroll() {
3631
+ this.stopWatchingScroll();
3632
+ const targets = [window];
3633
+ let node = this.host.parentNode;
3634
+ while (node) {
3635
+ if (node.nodeType === Node.ELEMENT_NODE)
3636
+ targets.push(node);
3637
+ node = node instanceof ShadowRoot ? node.host : node.parentNode;
3638
+ }
3639
+ targets.forEach((target) => target.addEventListener('scroll', this.closeTooltip, { passive: true }));
3640
+ window.addEventListener('resize', this.closeTooltip, { passive: true });
3641
+ this.scrollTargets = targets;
3642
+ }
3643
+ stopWatchingScroll() {
3644
+ this.scrollTargets.forEach((target) => target.removeEventListener('scroll', this.closeTooltip));
3645
+ this.scrollTargets = [];
3646
+ window.removeEventListener('resize', this.closeTooltip);
3647
+ }
3648
+ /**
3649
+ *
3650
+ * Render method
3651
+ *
3652
+ */
3653
+ render() {
3654
+ // Splitting is a rendering device only: `head` holds everything but the last
3655
+ // few characters and is the part CSS is allowed to clip, so the two labels
3656
+ // together still spell out the whole name.
3657
+ const split = !this.expanded && this.name.length > TAIL_LENGTH;
3658
+ const head = split ? this.name.slice(0, -TAIL_LENGTH) : this.name;
3659
+ const tail = split ? this.name.slice(-TAIL_LENGTH) : '';
3660
+ return (index.h(index.Host, { key: '6fa83e22c07a31d2a56df34f2f12edf20e1eba15', class: { expanded: this.expanded, [`place-${this.placement}`]: true } }, index.h("button", { key: '07c2f0afc897be0ef1bd1622a486d7ff7ec73953', type: "button", id: "trigger", "aria-label": this.name, "aria-expanded": this.expanded ? 'true' : 'false', onClick: this.toggleExpanded, onMouseEnter: this.openTooltip, onMouseLeave: this.scheduleClose, onFocus: this.openTooltip, onBlur: this.closeTooltip }, index.h("ezp-label", { key: '7a8711a0ac21e2b7bf84a40492b0b193dd3dd29f', class: "head", ellipsis: split, level: this.level, weight: this.weight, text: head }), split && index.h("ezp-label", { key: 'be08c7a34cff7db6e5328627de26ff272415e27d', class: "tail", level: this.level, weight: this.weight, text: tail })), this.tooltipOpen && (index.h("div", { key: 'fe79f1aeced27b5ebf68e8a6cd3fcdd26e19c5eb', id: "tooltip", "aria-hidden": "true", onMouseEnter: this.cancelScheduledClose, onMouseLeave: this.closeTooltip }, this.name))));
3661
+ }
3662
+ get host() { return index.getElement(this); }
3663
+ static get watchers() { return {
3664
+ "tooltipOpen": [{
3665
+ "watchTooltipOpen": 0
3666
+ }]
3667
+ }; }
3668
+ };
3669
+ EzpFileName.style = ezpFileNameCss();
3670
+
3358
3671
  const ezpIconCss = () => `:host{-ms-flex-line-pack:center;align-content:center;background:var(--ezp-icon-background, transparent);border-radius:var(--ezp-icon-borderRadius, 0);display:grid;grid-template:var(--ezp-icon-gridTemplate)/var(--ezp-icon-gridTemplate);height:var(--ezp-icon-height, var(--ezp-icon-size));-ms-flex-pack:center;justify-content:center;padding:var(--ezp-icon-padding, 0);width:var(--ezp-icon-width, var(--ezp-icon-size))}:host(.framed){--ezp-icon-background:var(--ezp-core-shade-primary);--ezp-icon-borderRadius:50%;--ezp-icon-padding:var(--ezp-icon-frame)}:host(.normal){--ezp-icon-size:18px;--ezp-icon-gridTemplate:24px;--ezp-icon-frame:var(--ezp-spacing-3)}:host(.large){--ezp-icon-size:36px;--ezp-icon-gridTemplate:48px;--ezp-icon-frame:var(--ezp-spacing-4)}:host(.huge){--ezp-icon-size:54px;--ezp-icon-gridTemplate:72px;--ezp-icon-frame:var(--ezp-spacing-5)}svg{display:block;fill:var(--ezp-icon-fill, currentColor);height:100%;width:100%}`;
3359
3672
 
3360
3673
  const EzpIcon = class {
@@ -3389,7 +3702,7 @@ const EzpIcon = class {
3389
3702
  return (
3390
3703
  // Decorative: icons here always sit next to a label or live-region text,
3391
3704
  // so hide them from the accessibility tree to avoid double announcements.
3392
- index.h(index.Host, { key: 'e1b22ece00f1260a34561c8d1efd44c2d5f37c73', class: `${this.size} ${this.framed ? 'framed' : ''}`, "aria-hidden": "true" }, index.h("div", { key: '0734d4b5fdc363303d69b7e5dc138f8caeaa316c', id: "glyph", innerHTML: this.glyph })));
3705
+ index.h(index.Host, { key: 'f1a45d38b75ccf4e0c5e6200d9d04c7e5766bfbc', class: `${this.size} ${this.framed ? 'framed' : ''}`, "aria-hidden": "true" }, index.h("div", { key: '70f6963181d31089fefb662079e1e075540d2fe7', id: "glyph", innerHTML: this.glyph })));
3393
3706
  }
3394
3707
  static get assetsDirs() { return ["assets"]; }
3395
3708
  };
@@ -3431,7 +3744,7 @@ const EzpIconButton = class {
3431
3744
  // Icon-only control: derive an accessible name from the icon so screen
3432
3745
  // readers announce something meaningful (e.g. "menu", "printer").
3433
3746
  const label = this.icon.replace(/[-_]/g, ' ');
3434
- return (index.h(index.Host, { key: '7d3d43ec31503ff7ecc87e9f498ee5b2d09d5d96', class: `${this.level}` }, index.h(TagType, Object.assign({ key: 'b7d5c646bb66ebff92d661574c647f8a2773a908', id: "button", "aria-label": label }, attributes), index.h("ezp-icon", { key: 'bc4c322b7c9389a8aaa27feac7084ae9e1befaa4', name: this.icon }))));
3747
+ return (index.h(index.Host, { key: 'd67a43c2b91eaa4fa79dd8559824f3ffc23757b2', class: `${this.level}` }, index.h(TagType, Object.assign({ key: '3b11b4e0c40c8f900496ae03a4eee11f0980cd80', id: "button", "aria-label": label }, attributes), index.h("ezp-icon", { key: '14a35e8f779628197f7dd89219792d7809990631', name: this.icon }))));
3435
3748
  }
3436
3749
  };
3437
3750
  EzpIconButton.style = ezpIconButtonCss();
@@ -3486,7 +3799,7 @@ const EzpInput = class {
3486
3799
  }
3487
3800
  render() {
3488
3801
  const hasIcon = !!this.icon;
3489
- return (index.h(index.Host, { key: '47a8f8b4f1dd6a8cb2b67ffc21e8770e555a52e3', class: { focused: this.focused, 'has-icon': hasIcon }, onClick: this.setFocus }, hasIcon ? index.h("ezp-icon", { id: "icon", name: this.icon }) : null, index.h("ezp-label", { key: '7d9401d2ab927cb52cd2fcfbdcf8790c5a6d0228', id: "label", noWrap: true, level: "secondary", text: this.label }), index.h("input", { key: 'f0422183a1677ba90e8fe74d6ccf3abdaeb3d645', id: "input", type: this.type, value: this.value, placeholder: this.placeholder, "aria-label": this.label, onInput: (event) => this.handleChange(event), ref: (input) => (this.input = input), onFocus: this.handleFocus, onBlur: this.handleBlur }), this.suffix ? index.h("ezp-label", { id: "suffix", level: "secondary", text: this.suffix }) : null));
3802
+ return (index.h(index.Host, { key: 'f36f5811ba4e86b0aa3f53be916220136a1d2443', class: { focused: this.focused, 'has-icon': hasIcon }, onClick: this.setFocus }, hasIcon ? index.h("ezp-icon", { id: "icon", name: this.icon }) : null, index.h("ezp-label", { key: '88f93411e1463b23ca4ae88d278a69df5038509d', id: "label", noWrap: true, level: "secondary", text: this.label }), index.h("input", { key: 'b23ba3c8fea465a559e9c6d7b3da50152b412a1c', id: "input", type: this.type, value: this.value, placeholder: this.placeholder, "aria-label": this.label, onInput: (event) => this.handleChange(event), ref: (input) => (this.input = input), onFocus: this.handleFocus, onBlur: this.handleBlur }), this.suffix ? index.h("ezp-label", { id: "suffix", level: "secondary", text: this.suffix }) : null));
3490
3803
  }
3491
3804
  };
3492
3805
  EzpInput.style = ezpInputCss();
@@ -3512,14 +3825,31 @@ const EzpLabel = class {
3512
3825
  /** Description... */
3513
3826
  this.weight = 'soft';
3514
3827
  }
3828
+ /**
3829
+ *
3830
+ * Public methods
3831
+ *
3832
+ */
3833
+ /** Whether the text is currently clipped — `ellipsis` only bites when the
3834
+ * text outgrows the space it was given, which callers cannot tell from the
3835
+ * props alone. Lets a caller offer the full text only when it is needed. */
3836
+ async isTruncated() {
3837
+ var _a;
3838
+ const text = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#text');
3839
+ if (!text)
3840
+ return false;
3841
+ // A pixel of slack: sub-pixel layout rounds scrollWidth up on its own.
3842
+ return text.scrollWidth > text.clientWidth + 1;
3843
+ }
3515
3844
  /**
3516
3845
  *
3517
3846
  * Render method
3518
3847
  *
3519
3848
  */
3520
3849
  render() {
3521
- return (index.h(index.Host, { key: '941746aaf861bd3ffe8dc65c1c5dbc52866be923', class: `${this.level} ${this.weight} ${this.ellipsis ? 'ellipsis' : ''} ${this.noWrap ? 'no-wrap' : ''}` }, index.h("div", { key: '36ee30f53e0209f569129ce1c1ca8e1ccf5d0803', id: "text" }, this.text)));
3850
+ return (index.h(index.Host, { key: '42139679511e711132912a1f762d345951fd1774', class: `${this.level} ${this.weight} ${this.ellipsis ? 'ellipsis' : ''} ${this.noWrap ? 'no-wrap' : ''}` }, index.h("div", { key: '5e54e8142d274cacb375cce8d5ef52ccdeaeec84', id: "text" }, this.text)));
3522
3851
  }
3852
+ get host() { return index.getElement(this); }
3523
3853
  };
3524
3854
  EzpLabel.style = ezpLabelCss();
3525
3855
 
@@ -38097,6 +38427,8 @@ const userStore = createStore({
38097
38427
  appearance: '',
38098
38428
  });
38099
38429
 
38430
+ /** Duplex modes the dialog offers: none, long edge, short edge. */
38431
+ const DUPLEX_MODES = [1, 2, 3];
38100
38432
  /**
38101
38433
  * Derive the default print properties for a printer from its configuration.
38102
38434
  *
@@ -38139,6 +38471,78 @@ function applyPrinterDefaults(config, properties) {
38139
38471
  delete properties.PageRanges;
38140
38472
  return properties;
38141
38473
  }
38474
+ /**
38475
+ * Carry the settings the user last printed with on this printer over the
38476
+ * printer's own defaults, dropping anything the printer can no longer do.
38477
+ *
38478
+ * Capabilities change between sessions — a printer loses a tray, an admin
38479
+ * swaps the paper formats — and a stale value would otherwise be sent to the
38480
+ * API or shown as a selection that isn't in the list. Each field is therefore
38481
+ * only restored if the current config still offers it; everything else stays
38482
+ * on the default `applyPrinterDefaults` just put in place. Copies and page
38483
+ * ranges are never part of `saved`, so they are never restored.
38484
+ */
38485
+ function applySavedProperties(config, saved, properties) {
38486
+ var _a, _b, _c, _d, _e;
38487
+ applyPrinterDefaults(config, properties);
38488
+ if (!saved)
38489
+ return properties;
38490
+ if (config.ColorSupported && typeof saved.color === 'boolean') {
38491
+ properties.color = saved.color;
38492
+ }
38493
+ if (config.DuplexSupported && DUPLEX_MODES.includes(Number(saved.duplexmode))) {
38494
+ properties.duplex = true;
38495
+ properties.duplexmode = Number(saved.duplexmode);
38496
+ }
38497
+ const paper = (_a = config.PaperFormats) === null || _a === void 0 ? void 0 : _a.find((format) => format.Id === Number(saved.paperid));
38498
+ if (paper) {
38499
+ properties.paper = paper.Name;
38500
+ properties.paperid = paper.Id;
38501
+ // Only meaningful for the custom format, which carries its own dimensions.
38502
+ if (paper.Id === PAPER_ID) {
38503
+ properties.paperwidth = saved.paperwidth;
38504
+ properties.paperlength = saved.paperlength;
38505
+ }
38506
+ }
38507
+ // Orientations are offered as 1-based positions in `OrientationsSupported`.
38508
+ const orientation = Number(saved.orientation);
38509
+ if (orientation >= 1 && orientation <= ((_c = (_b = config.OrientationsSupported) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0)) {
38510
+ properties.orientation = orientation;
38511
+ }
38512
+ if (typeof saved.resolution === 'string' && ((_d = config.Resolutions) === null || _d === void 0 ? void 0 : _d.includes(saved.resolution))) {
38513
+ properties.resolution = saved.resolution;
38514
+ }
38515
+ if (hasTrays(config)) {
38516
+ const tray = (_e = config.Trays) === null || _e === void 0 ? void 0 : _e.find((option) => (option === null || option === void 0 ? void 0 : option.Index) === Number(saved.defaultSource));
38517
+ if (tray) {
38518
+ properties.trayname = tray.Name;
38519
+ properties.defaultSource = tray.Index;
38520
+ }
38521
+ }
38522
+ return properties;
38523
+ }
38524
+ /**
38525
+ * The slice of the current selection worth remembering for next time: what the
38526
+ * print dialog offers per printer, minus copies and page ranges, which belong
38527
+ * to the one document being printed rather than to the printer.
38528
+ */
38529
+ function pickRememberedProperties(properties) {
38530
+ const { color, duplex, duplexmode, paper, paperid, paperwidth, paperlength } = properties;
38531
+ const { orientation, resolution, trayname, defaultSource } = properties;
38532
+ return {
38533
+ color,
38534
+ duplex,
38535
+ duplexmode,
38536
+ paper,
38537
+ paperid,
38538
+ paperwidth,
38539
+ paperlength,
38540
+ orientation,
38541
+ resolution,
38542
+ trayname,
38543
+ defaultSource,
38544
+ };
38545
+ }
38142
38546
  /** Does this printer config report an explicit "no usable trays" state? */
38143
38547
  function hasNoTrays(config) {
38144
38548
  return !!config.Trays && config.Trays.length >= 0 && config.Trays[0] == null;
@@ -38236,12 +38640,13 @@ async function uploadAndPrintFile(ctx, file, hooks = {}) {
38236
38640
  }
38237
38641
  }
38238
38642
 
38239
- const ezpPrinterSelectionCss = () => `:host{--ezp-status-border-radius:16px;background:var(--ezp-printerSelection-background, var(--ezp-core-backdrop));-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;inset:var(--ezp-printerSelection-inset, 0);overflow-y:auto;padding:var(--ezp-printerSelection-padding, var(--ezp-spacing-5));position:var(--ezp-printerSelection-position, fixed);z-index:1}:host(.seamless){--ezp-printerSelection-background:transparent;--ezp-printerSelection-box-background:transparent;--ezp-printerSelection-box-boxShadow:none;--ezp-printerSelection-box-margin:0;--ezp-printerSelection-box-padding:0;--ezp-printerSelection-inset:auto;--ezp-printerSelection-padding:0;--ezp-printerSelection-position:static;--ezp-printerSelection-width:100%}#box{background:var(--ezp-printerSelection-box-background, var(--ezp-core-surface-tertiary));border-radius:16px;-webkit-box-shadow:var(--ezp-printerSelection-box-boxShadow, 0 0 0 1px var(--ezp-core-outline), 0 24px 60px -20px var(--ezp-core-backdrop));box-shadow:var(--ezp-printerSelection-box-boxShadow, 0 0 0 1px var(--ezp-core-outline), 0 24px 60px -20px var(--ezp-core-backdrop));color:var(--ezp-core-foreground-primary);margin:var(--ezp-printerSelection-box-margin, auto);padding:var(--ezp-printerSelection-box-padding, 0);position:relative;width:var(--ezp-printerSelection-width, 384px)}#header{-ms-flex-align:center;align-items:center;border-bottom:1px solid var(--ezp-core-outline);color:var(--ezp-core-foreground-primary);display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-3);-ms-flex-pack:justify;justify-content:space-between;padding:var(--ezp-spacing-4);position:relative;z-index:3}#title{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-3);min-width:0}#title ezp-label{--ezp-label-fontSize:20px;--ezp-label-lineHeight:26px}#files-badge{background:var(--ezp-theme-translucent);border-radius:999px;color:var(--ezp-theme-solid);font-size:12px;font-weight:600;line-height:1;padding:5px 10px;white-space:nowrap}#header-actions{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-2)}#body{background:var(--ezp-printerSelection-body-background, var(--ezp-core-surface-tertiary));display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-3);padding:var(--ezp-spacing-4)}#files-card{background:var(--ezp-core-surface-secondary);border-radius:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-2);padding:var(--ezp-spacing-3) var(--ezp-spacing-4)}.file-row{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-3);min-width:0}.file-row ezp-label{--ezp-label-minWidth:0}.file-row-icon{--ezp-icon-size:18px;--ezp-icon-gridTemplate:18px;color:var(--ezp-theme-solid);-ms-flex-negative:0;flex-shrink:0}#printer-caption{color:var(--ezp-core-foreground-secondary);letter-spacing:0.08em;padding:0 var(--ezp-spacing-1);text-transform:uppercase}#printer-card{border-radius:12px;-webkit-box-shadow:inset 0 0 0 1px var(--ezp-core-outline);box-shadow:inset 0 0 0 1px var(--ezp-core-outline);position:relative}#printer{--ezp-select-label-display:none;--ezp-select-toggle-gridTemplateAreas:'icon value accessory';--ezp-select-toggle-gridTemplateRows:auto;--ezp-select-value-textAlign:left}#print{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-theme-solid);border:0;border-radius:8px;color:var(--ezp-white-100);cursor:pointer;display:-ms-flexbox;display:flex;font-family:inherit;gap:var(--ezp-spacing-3);-ms-flex-pack:center;justify-content:center;margin:0;outline:none;padding:13px var(--ezp-spacing-4);-webkit-transition:opacity var(--ezp-duration-2) var(--ezp-easing-out-quart);transition:opacity var(--ezp-duration-2) var(--ezp-easing-out-quart);width:100%}#print ezp-icon{--ezp-icon-size:20px;--ezp-icon-gridTemplate:20px}@media (hover: hover){#print:not(:disabled):hover{opacity:0.9}#print:not(:disabled):active{opacity:0.8}}#print:disabled{background:var(--ezp-core-shade-primary);color:var(--ezp-core-foreground-tertiary);cursor:default}#options{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}#options>*{-webkit-box-shadow:inset 0 -1px 0 0 var(--ezp-core-outline);box-shadow:inset 0 -1px 0 0 var(--ezp-core-outline)}#options>*:last-child{-webkit-box-shadow:none;box-shadow:none}#footer{background:var(--ezp-printerSelection-body-background, var(--ezp-core-surface-tertiary));border-radius:0 0 16px 16px;border-top:1px solid var(--ezp-core-outline);bottom:0;display:grid;gap:var(--ezp-spacing-3);grid-template-columns:1fr 1.4fr;padding:var(--ezp-spacing-4);position:-webkit-sticky;position:sticky;z-index:3}#cancel{--ezp-textButton-background-active:var(--ezp-core-shade-secondary);--ezp-textButton-background-hover:var(--ezp-core-shade-primary);--ezp-textButton-background-init:transparent;--ezp-textButton-borderRadius:8px;--ezp-textButton-boxShadow:inset 0 0 0 1px var(--ezp-core-outline);--ezp-textButton-color-init:var(--ezp-core-foreground-primary);--ezp-textButton-padding:13px var(--ezp-spacing-3)}`;
38643
+ const ezpPrinterSelectionCss = () => `:host{--ezp-status-border-radius:16px;background:var(--ezp-printerSelection-background, var(--ezp-core-backdrop));-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;inset:var(--ezp-printerSelection-inset, 0);overflow-y:auto;padding:var(--ezp-printerSelection-padding, var(--ezp-spacing-5));position:var(--ezp-printerSelection-position, fixed);z-index:1}:host(.seamless){--ezp-printerSelection-background:transparent;--ezp-printerSelection-box-background:transparent;--ezp-printerSelection-box-boxShadow:none;--ezp-printerSelection-box-margin:0;--ezp-printerSelection-box-padding:0;--ezp-printerSelection-inset:auto;--ezp-printerSelection-padding:0;--ezp-printerSelection-position:static;--ezp-printerSelection-width:100%}#box{background:var(--ezp-printerSelection-box-background, var(--ezp-core-surface-tertiary));border-radius:16px;-webkit-box-shadow:var(--ezp-printerSelection-box-boxShadow, 0 0 0 1px var(--ezp-core-outline), 0 24px 60px -20px var(--ezp-core-backdrop));box-shadow:var(--ezp-printerSelection-box-boxShadow, 0 0 0 1px var(--ezp-core-outline), 0 24px 60px -20px var(--ezp-core-backdrop));color:var(--ezp-core-foreground-primary);margin:var(--ezp-printerSelection-box-margin, auto);padding:var(--ezp-printerSelection-box-padding, 0);position:relative;width:var(--ezp-printerSelection-width, 384px)}#header{-ms-flex-align:center;align-items:center;border-bottom:1px solid var(--ezp-core-outline);color:var(--ezp-core-foreground-primary);display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-3);-ms-flex-pack:justify;justify-content:space-between;padding:var(--ezp-spacing-4);position:relative;z-index:3}#title{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-3);min-width:0}#title ezp-label{--ezp-label-fontSize:20px;--ezp-label-lineHeight:26px}#files-badge{background:var(--ezp-theme-translucent);border-radius:999px;color:var(--ezp-theme-solid);font-size:12px;font-weight:600;line-height:1;padding:5px 10px;white-space:nowrap}#header-actions{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--ezp-spacing-2)}#body{background:var(--ezp-printerSelection-body-background, var(--ezp-core-surface-tertiary));display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-3);padding:var(--ezp-spacing-4)}#files-card{background:var(--ezp-core-surface-secondary);border-radius:12px;padding:var(--ezp-spacing-3) var(--ezp-spacing-4)}#files{position:relative}#files-list{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-2);margin:calc(-1 * 4px);max-height:var(--ezp-printerSelection-filesList-maxHeight, calc(4.5 * 20px + 4 * var(--ezp-spacing-2)));overflow-x:hidden;overflow-y:auto;padding:4px;scrollbar-width:thin}.file-row{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;gap:var(--ezp-spacing-3);min-height:20px;min-width:0}.file-row ezp-file-name{-ms-flex:0 1 auto;flex:0 1 auto}.file-row-icon{--ezp-icon-size:18px;--ezp-icon-gridTemplate:18px;color:var(--ezp-theme-solid);-ms-flex-negative:0;flex-shrink:0}#printer-caption{color:var(--ezp-core-foreground-secondary);letter-spacing:0.08em;padding:0 var(--ezp-spacing-1);text-transform:uppercase}#printer-card{border-radius:12px;-webkit-box-shadow:inset 0 0 0 1px var(--ezp-core-outline);box-shadow:inset 0 0 0 1px var(--ezp-core-outline);position:relative}#printer{--ezp-select-label-display:none;--ezp-select-toggle-gridTemplateAreas:'icon value accessory';--ezp-select-toggle-gridTemplateRows:auto;--ezp-select-value-textAlign:left}#print{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-theme-solid);border:0;border-radius:8px;color:var(--ezp-white-100);cursor:pointer;display:-ms-flexbox;display:flex;font-family:inherit;gap:var(--ezp-spacing-3);-ms-flex-pack:center;justify-content:center;margin:0;outline:none;padding:13px var(--ezp-spacing-4);-webkit-transition:opacity var(--ezp-duration-2) var(--ezp-easing-out-quart);transition:opacity var(--ezp-duration-2) var(--ezp-easing-out-quart);width:100%}#print ezp-icon{--ezp-icon-size:20px;--ezp-icon-gridTemplate:20px}@media (hover: hover){#print:not(:disabled):hover{opacity:0.9}#print:not(:disabled):active{opacity:0.8}}#print:disabled{background:var(--ezp-core-shade-primary);color:var(--ezp-core-foreground-tertiary);cursor:default}#options{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}#options>*{-webkit-box-shadow:inset 0 -1px 0 0 var(--ezp-core-outline);box-shadow:inset 0 -1px 0 0 var(--ezp-core-outline)}#options>*:last-child{-webkit-box-shadow:none;box-shadow:none}#footer{background:var(--ezp-printerSelection-body-background, var(--ezp-core-surface-tertiary));border-radius:0 0 16px 16px;border-top:1px solid var(--ezp-core-outline);bottom:0;display:grid;gap:var(--ezp-spacing-3);grid-template-columns:1fr 1.4fr;padding:var(--ezp-spacing-4);position:-webkit-sticky;position:sticky;z-index:3}#cancel{--ezp-textButton-background-active:var(--ezp-core-shade-secondary);--ezp-textButton-background-hover:var(--ezp-core-shade-primary);--ezp-textButton-background-init:transparent;--ezp-textButton-borderRadius:8px;--ezp-textButton-boxShadow:inset 0 0 0 1px var(--ezp-core-outline);--ezp-textButton-color-init:var(--ezp-core-foreground-primary);--ezp-textButton-padding:13px var(--ezp-spacing-3)}`;
38240
38644
 
38241
38645
  const EzpPrinterSelection = class {
38242
38646
  constructor(hostRef) {
38243
38647
  index.registerInstance(this, hostRef);
38244
38648
  this.printCancel = index.createEvent(this, "printCancel", 7);
38649
+ this.printDismiss = index.createEvent(this, "printDismiss", 7);
38245
38650
  this.printSubmit = index.createEvent(this, "printSubmit", 7);
38246
38651
  this.logout = index.createEvent(this, "logout", 7);
38247
38652
  this.fileExtension = '';
@@ -38289,6 +38694,13 @@ const EzpPrinterSelection = class {
38289
38694
  this.hubDriverError = false;
38290
38695
  this.userMenuOpen = false;
38291
38696
  this.printStopped = false;
38697
+ /** First row of the file list that is at least partly in view. Its tooltip
38698
+ * opens downwards, as there is no list left above it to cover. */
38699
+ this.firstVisibleFile = 0;
38700
+ /** Starts empty so the dialog can still render if the list never arrives. */
38701
+ this.printers = [];
38702
+ /** Starts empty so the dialog renders even if the list never loads. */
38703
+ this.selectedPrinter = { id: '', location: '', name: '', is_queue: false };
38292
38704
  this.selectedPrinterConfig = {
38293
38705
  Default: {
38294
38706
  Color: '',
@@ -38321,6 +38733,8 @@ const EzpPrinterSelection = class {
38321
38733
  trayname: '',
38322
38734
  PageRanges: '',
38323
38735
  };
38736
+ /** True while a printer's capabilities are being fetched. */
38737
+ this.loadingPrinterConfig = false;
38324
38738
  this.currentFileIndex = 0;
38325
38739
  this.totalFiles = 0;
38326
38740
  this.failedFiles = [];
@@ -38337,7 +38751,7 @@ const EzpPrinterSelection = class {
38337
38751
  this.successfulFiles = [];
38338
38752
  this.partialSuccess = false;
38339
38753
  this.hubDriverError = false;
38340
- this.printCancel.emit();
38754
+ this.printDismiss.emit();
38341
38755
  };
38342
38756
  /** Poll `validate` callback: maps a job status to component state, returns `true` to stop polling. */
38343
38757
  this.validateData = (data) => {
@@ -38511,13 +38925,18 @@ const EzpPrinterSelection = class {
38511
38925
  if (hubTimeout)
38512
38926
  clearTimeout(hubTimeout);
38513
38927
  }
38514
- storage.setProperties(this.selectedProperties);
38515
- storage.setPrinter(this.selectedPrinter);
38928
+ this.rememberSelection();
38516
38929
  this.printStopped = false;
38517
38930
  };
38518
38931
  this.handleUserMenu = () => {
38519
38932
  this.userMenuOpen = true;
38520
38933
  };
38934
+ this.handleFilesScroll = (event) => {
38935
+ const first = firstVisibleChild(event.currentTarget);
38936
+ // Scroll fires every frame; only a change of row is worth a render.
38937
+ if (first >= 0 && first !== this.firstVisibleFile)
38938
+ this.firstVisibleFile = first;
38939
+ };
38521
38940
  this.validateFileType = async (name) => {
38522
38941
  var _a;
38523
38942
  const extension = (_a = name.split('.').pop()) !== null && _a !== void 0 ? _a : '';
@@ -38605,24 +39024,45 @@ const EzpPrinterSelection = class {
38605
39024
  break;
38606
39025
  }
38607
39026
  }
38608
- /** Print needs a printer, no job in flight and a valid page range. */
39027
+ /** Print needs a printer with its capabilities in hand, no job in flight and
39028
+ * a valid page range. The config matters: between picking a printer and its
39029
+ * properties arriving, the selection is set but the properties still hold
39030
+ * blank defaults, and printing then saves those as that printer's settings. */
38609
39031
  get printDisabled() {
38610
- return this.selectedPrinter.id === '' || this.printProcessing || this.pageRangeInvalid;
39032
+ return (this.selectedPrinter.id === '' ||
39033
+ this.loadingPrinterConfig ||
39034
+ this.printProcessing ||
39035
+ this.pageRangeInvalid);
39036
+ }
39037
+ /** Keep this printer and its settings for the next print. Stored per printer,
39038
+ * so each one keeps its own and no setting follows the user to a printer
39039
+ * that cannot do it. */
39040
+ rememberSelection() {
39041
+ if (!this.selectedPrinter.id)
39042
+ return;
39043
+ storage.setPrinterSettings(this.selectedPrinter.id, pickRememberedProperties(this.selectedProperties));
39044
+ storage.setPrinter(this.selectedPrinter);
38611
39045
  }
38612
- getPropertiesFromLocalStorage() {
38613
- const savedProperties = storage.getProperties();
38614
- if (savedProperties) {
38615
- this.selectedProperties = savedProperties;
38616
- }
39046
+ /**
39047
+ * Decide which printer the dialog opens on: the one last printed to, or the
39048
+ * user's only printer when there is nothing to choose between. Its settings
39049
+ * follow once its config is in, since they can only be validated against the
39050
+ * printer's capabilities.
39051
+ */
39052
+ selectInitialPrinter() {
39053
+ var _a, _b;
38617
39054
  const savedPrinter = storage.getPrinter();
38618
- if (savedPrinter) {
38619
- if (this.printers.some((printer) => printer.id === savedPrinter.id)) {
38620
- this.selectedPrinter = savedPrinter;
38621
- }
38622
- else {
38623
- this.selectedPrinter = { id: '', location: '', name: '', is_queue: false };
38624
- storage.clearSavedPrinter();
38625
- }
39055
+ const savedIsAvailable = (_a = this.printers) === null || _a === void 0 ? void 0 : _a.some((printer) => printer.id === (savedPrinter === null || savedPrinter === void 0 ? void 0 : savedPrinter.id));
39056
+ // A printer the user no longer has must not stay preselected.
39057
+ if (savedPrinter && !savedIsAvailable)
39058
+ storage.clearSavedPrinter();
39059
+ if (savedPrinter && savedIsAvailable) {
39060
+ this.selectedPrinter = savedPrinter;
39061
+ }
39062
+ else if (((_b = this.printers) === null || _b === void 0 ? void 0 : _b.length) === 1) {
39063
+ // Nothing to pick between: opening a dropdown with one entry in it is
39064
+ // busywork, so start on it.
39065
+ this.selectedPrinter = this.printers[0];
38626
39066
  }
38627
39067
  else {
38628
39068
  this.selectedPrinter = { id: '', location: '', name: '', is_queue: false };
@@ -38641,17 +39081,22 @@ const EzpPrinterSelection = class {
38641
39081
  }
38642
39082
  async setSelectedProperties(eventDetails) {
38643
39083
  switch (eventDetails.type) {
38644
- case 'printer':
38645
- this.selectedPrinter.id = eventDetails.id;
38646
- this.selectedPrinter.name = eventDetails.title;
38647
- this.selectedPrinter.is_queue = eventDetails.is_queue;
38648
- await this.printService
38649
- .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
38650
- .then((data) => {
38651
- this.selectedPrinterConfig = Object.assign(Object.assign({}, this.selectedPrinterConfig), data[0]);
38652
- applyPrinterDefaults(this.selectedPrinterConfig, this.selectedProperties);
38653
- });
39084
+ case 'printer': {
39085
+ const picked = this.printers.find((printer) => printer.id === eventDetails.id);
39086
+ this.selectedPrinter = picked !== null && picked !== void 0 ? picked : {
39087
+ id: eventDetails.id,
39088
+ name: eventDetails.title,
39089
+ location: '',
39090
+ is_queue: eventDetails.is_queue,
39091
+ };
39092
+ // Same guard as the initial load. Without it a failed fetch left the
39093
+ // printer selected while the config still described the *previous*
39094
+ // one: Print stayed enabled, the job went out with settings nothing
39095
+ // had checked against this printer, and those settings were then
39096
+ // saved under its id and restored on later opens.
39097
+ await this.loadSelectedPrinterConfig();
38654
39098
  break;
39099
+ }
38655
39100
  case 'color':
38656
39101
  this.selectedProperties.color =
38657
39102
  eventDetails.title == instance.t('printer_selection.color_color') ? true : false;
@@ -38716,6 +39161,55 @@ const EzpPrinterSelection = class {
38716
39161
  onJobId: (jobId) => (printStore.state.jobID = jobId),
38717
39162
  });
38718
39163
  }
39164
+ /**
39165
+ * What a dropdown should show: the current selection — restored from the last
39166
+ * print, or just made by the user — and otherwise the printer's own default.
39167
+ *
39168
+ * The fallbacks matter because a config may describe its default only by name
39169
+ * (`Default.Duplex`, `Default.Paper`, `Default.Tray`) without flagging the
39170
+ * matching entry, which is all these dropdowns had to go on before settings
39171
+ * were remembered.
39172
+ */
39173
+ duplexPreSelection() {
39174
+ var _a;
39175
+ if (!this.selectedPrinter.id)
39176
+ return null;
39177
+ const mode = Number(this.selectedProperties.duplexmode);
39178
+ if (mode)
39179
+ return mode;
39180
+ switch ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Duplex) {
39181
+ case 'duplex_simplex':
39182
+ return instance.t('printer_selection.duplex_none');
39183
+ case 'duplex_vertical':
39184
+ return instance.t('printer_selection.duplex_long');
39185
+ case 'duplex_horizontal':
39186
+ return instance.t('printer_selection.duplex_short');
39187
+ default:
39188
+ return null;
39189
+ }
39190
+ }
39191
+ paperPreSelection() {
39192
+ var _a, _b;
39193
+ if (!this.selectedPrinter.id)
39194
+ return null;
39195
+ if (this.selectedProperties.paper)
39196
+ return this.selectedProperties.paper;
39197
+ const name = (_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Paper;
39198
+ return name && ((_b = this.selectedPrinterConfig.PaperFormats) === null || _b === void 0 ? void 0 : _b.some((el) => el.Name.includes(name)))
39199
+ ? name
39200
+ : null;
39201
+ }
39202
+ trayPreSelection() {
39203
+ var _a, _b;
39204
+ if (!this.selectedPrinter.id)
39205
+ return null;
39206
+ if (this.selectedProperties.trayname)
39207
+ return this.selectedProperties.trayname;
39208
+ const name = (_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Tray;
39209
+ return name && ((_b = this.selectedPrinterConfig.Trays) === null || _b === void 0 ? void 0 : _b.some((el) => el === null || el === void 0 ? void 0 : el.Name.includes(name)))
39210
+ ? name
39211
+ : null;
39212
+ }
38719
39213
  setDefaultPaperFormat() {
38720
39214
  var _a, _b, _c, _d, _e;
38721
39215
  let format;
@@ -38784,46 +39278,105 @@ const EzpPrinterSelection = class {
38784
39278
  this.unsubscribeLanguage = subscribeToLanguageChange(this);
38785
39279
  this.printService = new EzpPrintService(this.redirectURI, this.clientID);
38786
39280
  this.printService.registerFetchInterceptor();
38787
- await this.getUserInfo();
38788
- await this.printService
38789
- .getPrinterList(authStore.state.accessToken)
38790
- .then((printers) => {
38791
- this.printers = printers;
38792
- if (!(this.printers.length > 0)) {
39281
+ try {
39282
+ // A missing display name must not stop the user from printing.
39283
+ await this.getUserInfo().catch(() => undefined);
39284
+ let printersLoaded = false;
39285
+ try {
39286
+ const printers = await this.printService.getPrinterList(authStore.state.accessToken);
39287
+ // A failed request still resolves: the API answers with a `{code,
39288
+ // message}` body, which would survive `?? []` and break on `.some`.
39289
+ if (!Array.isArray(printers))
39290
+ throw new Error('Unexpected printer list payload');
39291
+ this.printers = printers;
39292
+ printersLoaded = true;
39293
+ }
39294
+ catch (_a) {
39295
+ this.printers = [];
39296
+ }
39297
+ if (!printersLoaded) {
39298
+ // Nothing is known about this user's printers, so the saved printer is
39299
+ // left untouched: treating it as gone would clear it from storage and
39300
+ // lose the settings that are only reachable through it.
38793
39301
  this.noPrinters = true;
38794
39302
  }
38795
- });
38796
- this.getPropertiesFromLocalStorage();
38797
- // if printer is stored from previous print, get the config to enable property selection
38798
- if (this.selectedPrinter.id != '') {
38799
- await this.printService
38800
- .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
38801
- .then((data) => {
38802
- this.selectedPrinterConfig = data[0];
38803
- applyPrinterDefaults(this.selectedPrinterConfig, this.selectedProperties);
38804
- });
39303
+ else {
39304
+ if (this.printers.length === 0) {
39305
+ this.noPrinters = true;
39306
+ }
39307
+ this.selectInitialPrinter();
39308
+ // A printer carried over from a previous print, or the only one the
39309
+ // user has, needs its config before its properties can be offered.
39310
+ if (this.selectedPrinter.id != '') {
39311
+ await this.loadSelectedPrinterConfig();
39312
+ }
39313
+ }
39314
+ let supportedExtensionsLoaded = false;
39315
+ try {
39316
+ const response = await (await this.printService.getConfig(authStore.state.accessToken)).json();
39317
+ printStore.state.supportedFileExtensions = response.System.FILEEXT;
39318
+ supportedExtensionsLoaded = true;
39319
+ }
39320
+ catch (_b) {
39321
+ // Handled below: without the list, nothing can be validated against it.
39322
+ }
39323
+ try {
39324
+ await this.printService
39325
+ .getAllPrinterProperties(authStore.state.accessToken)
39326
+ .then((printerConfig) => {
39327
+ this.printerConfig = printerConfig;
39328
+ });
39329
+ }
39330
+ catch (_c) {
39331
+ // Only used to describe other printers; the dialog works without it.
39332
+ }
39333
+ // Skipped when the list never arrived: every file would compare as
39334
+ // unsupported and the user would be told their document cannot be
39335
+ // printed when nothing is actually wrong with it.
39336
+ if (supportedExtensionsLoaded && this.files && this.files.length > 0) {
39337
+ // Validate all files
39338
+ const validationPromises = this.files.map((file) => this.validateFileType(file.name));
39339
+ const validationResults = await Promise.all(validationPromises);
39340
+ const allValid = validationResults.every((valid) => valid);
39341
+ this.notSupported = !allValid;
39342
+ }
39343
+ }
39344
+ finally {
39345
+ // Whatever failed above, the dialog has to become usable: the loading
39346
+ // status carries no close button, so throwing out of here would strand
39347
+ // the user on "Loading My Printers…" with no way back.
39348
+ this.loading = false;
39349
+ }
39350
+ }
39351
+ /**
39352
+ * Fetch the selected printer's capabilities and restore its saved settings.
39353
+ *
39354
+ * A failure drops the selection rather than keeping a printer the dialog
39355
+ * cannot describe: the options would stay disabled while Print stayed
39356
+ * enabled, so the job would go out with properties nothing has verified.
39357
+ * With no selection the user picks from the list, which fetches again.
39358
+ */
39359
+ async loadSelectedPrinterConfig() {
39360
+ this.loadingPrinterConfig = true;
39361
+ try {
39362
+ const data = await this.printService.getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id);
39363
+ // An empty list or an error body leaves nothing to configure from.
39364
+ const config = data === null || data === void 0 ? void 0 : data[0];
39365
+ if (!config)
39366
+ throw new Error('No properties returned for the selected printer');
39367
+ this.selectedPrinterConfig = config;
39368
+ applySavedProperties(config, storage.getPrinterSettings(this.selectedPrinter.id), this.selectedProperties);
39369
+ this.setPaperid();
38805
39370
  if (this.selectedProperties.paper === '') {
38806
39371
  this.setDefaultPaperFormat();
38807
39372
  }
38808
39373
  }
38809
- await (await this.printService.getConfig(authStore.state.accessToken))
38810
- .json()
38811
- .then((response) => {
38812
- printStore.state.supportedFileExtensions = response.System.FILEEXT;
38813
- });
38814
- await this.printService
38815
- .getAllPrinterProperties(authStore.state.accessToken)
38816
- .then((printerConfig) => {
38817
- this.printerConfig = printerConfig;
38818
- });
38819
- if (this.files && this.files.length > 0) {
38820
- // Validate all files
38821
- const validationPromises = this.files.map((file) => this.validateFileType(file.name));
38822
- const validationResults = await Promise.all(validationPromises);
38823
- const allValid = validationResults.every((valid) => valid);
38824
- this.notSupported = !allValid;
39374
+ catch (_a) {
39375
+ this.selectedPrinter = { id: '', location: '', name: '', is_queue: false };
39376
+ }
39377
+ finally {
39378
+ this.loadingPrinterConfig = false;
38825
39379
  }
38826
- this.loading = false;
38827
39380
  }
38828
39381
  disconnectedCallback() {
38829
39382
  var _a;
@@ -38909,14 +39462,14 @@ const EzpPrinterSelection = class {
38909
39462
  return null;
38910
39463
  }
38911
39464
  render() {
38912
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
39465
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
38913
39466
  const fileNames = this.files && this.files.length > 0
38914
39467
  ? this.files.map((file) => file.name)
38915
39468
  : this.filename
38916
39469
  ? [this.filename]
38917
39470
  : [];
38918
39471
  const fileCount = fileNames.length;
38919
- return this.loading ? (index.h("ezp-status", { processing: true, description: instance.t('printer_selection.loading'), instance: "loading" })) : (index.h(index.Host, { class: { seamless: this.seamless } }, index.h("div", { id: "box", "data-backdrop-surface": true }, !this.printStopped && this.renderStatus(), !this.hideheader && (index.h("div", { id: "header" }, index.h("div", { id: "title" }, index.h("ezp-label", { weight: "heavy", text: instance.t('printer_selection.print') }), !this.notSupported && fileCount > 0 && (index.h("span", { id: "files-badge" }, instance.t('printer_selection.file_count', { count: fileCount })))), index.h("div", { id: "header-actions" }, !this.hidemenu && (index.h("ezp-icon-button", { level: "tertiary", icon: "menu", id: "toggle-menu", type: "button", onClick: this.handleUserMenu })), index.h("ezp-icon-button", { level: "tertiary", icon: "close", id: "close", type: "button", onClick: this.handleCancel })))), index.h("div", { id: "body" }, !this.notSupported && fileNames.length > 0 && (index.h("div", { id: "files-card" }, fileNames.map((name, index$1) => (index.h("div", { class: "file-row", key: index$1 }, index.h("ezp-icon", { name: "file", class: "file-row-icon" }), index.h("ezp-label", { ellipsis: true, text: name })))))), index.h("ezp-label", { id: "printer-caption", level: "tertiary", weight: "heavy", text: instance.t('printer_selection.printer') }), index.h("div", { id: "printer-card" }, index.h("ezp-select", { id: "printer", label: instance.t('printer_selection.printer'), icon: "printer", placeholder: this.printers.length > 0
39472
+ return this.loading ? (index.h("ezp-status", { processing: true, description: instance.t('printer_selection.loading'), instance: "loading" })) : (index.h(index.Host, { class: { seamless: this.seamless } }, index.h("div", { id: "box", "data-backdrop-surface": true }, !this.printStopped && this.renderStatus(), !this.hideheader && (index.h("div", { id: "header" }, index.h("div", { id: "title" }, index.h("ezp-label", { weight: "heavy", text: instance.t('printer_selection.print') }), !this.notSupported && fileCount > 0 && (index.h("span", { id: "files-badge" }, instance.t('printer_selection.file_count', { count: fileCount })))), index.h("div", { id: "header-actions" }, !this.hidemenu && (index.h("ezp-icon-button", { level: "tertiary", icon: "menu", id: "toggle-menu", type: "button", onClick: this.handleUserMenu })), index.h("ezp-icon-button", { level: "tertiary", icon: "close", id: "close", type: "button", onClick: this.handleCancel })))), index.h("div", { id: "body" }, !this.notSupported && fileNames.length > 0 && (index.h("div", { id: "files-card" }, index.h("div", { id: "files" }, index.h("div", { id: "files-list", onScroll: this.handleFilesScroll }, fileNames.map((name, index$1) => (index.h("div", { class: "file-row", key: index$1 }, index.h("ezp-icon", { name: "file", class: "file-row-icon" }), index.h("ezp-file-name", { name: name, anchor: "parent", placement: index$1 === this.firstVisibleFile ? 'bottom' : 'top' })))))))), index.h("ezp-label", { id: "printer-caption", level: "tertiary", weight: "heavy", text: instance.t('printer_selection.printer') }), index.h("div", { id: "printer-card" }, index.h("ezp-select", { id: "printer", label: instance.t('printer_selection.printer'), icon: "printer", placeholder: this.printers.length > 0
38920
39473
  ? instance.t('printer_selection.select_printer')
38921
39474
  : instance.t('printer_selection.no_printers'), toggleFlow: "vertical", optionFlow: "vertical", options: this.printers.map((printer) => ({
38922
39475
  id: printer.id,
@@ -38929,43 +39482,34 @@ const EzpPrinterSelection = class {
38929
39482
  title: option.title,
38930
39483
  meta: '',
38931
39484
  type: 'color',
38932
- })), preSelected: this.selectedPrinter.id && ((_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Color) == 'color'
38933
- ? instance.t('printer_selection.color_color')
38934
- : instance.t('printer_selection.color_grayscale'), disabled: !this.selectedPrinterConfig.ColorSupported }), index.h("ezp-select", { label: instance.t('printer_selection.duplex'), placeholder: instance.t('printer_selection.select_duplex'), toggleFlow: "horizontal", options: (_c = this.duplexOptions) === null || _c === void 0 ? void 0 : _c.map((option) => ({
39485
+ })), preSelected: this.selectedPrinter.id
39486
+ ? this.selectedProperties.color
39487
+ ? instance.t('printer_selection.color_color')
39488
+ : instance.t('printer_selection.color_grayscale')
39489
+ : null, disabled: !this.selectedPrinterConfig.ColorSupported }), index.h("ezp-select", { label: instance.t('printer_selection.duplex'), placeholder: instance.t('printer_selection.select_duplex'), toggleFlow: "horizontal", options: (_b = this.duplexOptions) === null || _b === void 0 ? void 0 : _b.map((option) => ({
38935
39490
  id: option.id,
38936
39491
  title: option.title,
38937
39492
  meta: '',
38938
39493
  type: 'duplex',
38939
- })), preSelected: this.selectedPrinter.id &&
38940
- ((_d = this.selectedPrinterConfig.Default) === null || _d === void 0 ? void 0 : _d.Duplex) == 'duplex_simplex'
38941
- ? instance.t('printer_selection.duplex_none')
38942
- : ((_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Duplex) == 'duplex_vertical'
38943
- ? instance.t('printer_selection.duplex_long')
38944
- : ((_f = this.selectedPrinterConfig.Default) === null || _f === void 0 ? void 0 : _f.Duplex) == 'duplex_horizontal'
38945
- ? instance.t('printer_selection.duplex_short')
38946
- : null, disabled: !this.selectedPrinterConfig.DuplexSupported }), index.h("ezp-select", { label: instance.t('printer_selection.size'), placeholder: instance.t('printer_selection.select_size'), toggleFlow: "horizontal", optionFlow: "horizontal", options: this.selectedPrinterConfig.PaperFormats &&
39494
+ })), preSelected: this.duplexPreSelection(), disabled: !this.selectedPrinterConfig.DuplexSupported }), index.h("ezp-select", { label: instance.t('printer_selection.size'), placeholder: instance.t('printer_selection.select_size'), toggleFlow: "horizontal", optionFlow: "horizontal", options: this.selectedPrinterConfig.PaperFormats &&
38947
39495
  this.selectedPrinterConfig.PaperFormats.map((format) => ({
38948
39496
  id: format.Id,
38949
39497
  title: format.Name,
38950
39498
  meta: `${format.XRes} x ${format.YRes}`,
38951
39499
  type: 'format',
38952
- })), preSelected: this.selectedPrinter.id &&
38953
- ((_g = this.selectedPrinterConfig.PaperFormats) === null || _g === void 0 ? void 0 : _g.find((el) => { var _a; return el.Name.includes((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Paper); }))
38954
- ? (_h = this.selectedPrinterConfig.Default) === null || _h === void 0 ? void 0 : _h.Paper
38955
- : null, disabled: !(((_k = (_j = this.selectedPrinterConfig.PaperFormats) === null || _j === void 0 ? void 0 : _j.length) !== null && _k !== void 0 ? _k : 0) > 0) }), this.paperid == PAPER_ID ? (index.h(index.Fragment, null, index.h("ezp-input", { suffix: "mm", value: this.selectedProperties.paperwidth, eventType: "width", type: "number", label: instance.t('printer_selection.width') }), index.h("ezp-input", { suffix: "mm", value: this.selectedProperties.paperlength, eventType: "length", type: "number", label: instance.t('printer_selection.length') }))) : null, index.h("ezp-select", { label: instance.t('printer_selection.orientation'), placeholder: instance.t('printer_selection.select_orientation'), toggleFlow: "horizontal", options: (_l = this.selectedPrinterConfig.OrientationsSupported) === null || _l === void 0 ? void 0 : _l.map((orientation, index) => ({
39500
+ })), preSelected: this.paperPreSelection(), disabled: !(((_d = (_c = this.selectedPrinterConfig.PaperFormats) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) > 0) }), this.paperid == PAPER_ID ? (index.h(index.Fragment, null, index.h("ezp-input", { suffix: "mm", value: this.selectedProperties.paperwidth, eventType: "width", type: "number", label: instance.t('printer_selection.width') }), index.h("ezp-input", { suffix: "mm", value: this.selectedProperties.paperlength, eventType: "length", type: "number", label: instance.t('printer_selection.length') }))) : null, index.h("ezp-select", { label: instance.t('printer_selection.orientation'), placeholder: instance.t('printer_selection.select_orientation'), toggleFlow: "horizontal", options: (_e = this.selectedPrinterConfig.OrientationsSupported) === null || _e === void 0 ? void 0 : _e.map((orientation, index) => ({
38956
39501
  id: index + 1,
38957
39502
  title: instance.t(`printer_selection.orientation_${orientation}`),
38958
39503
  meta: '',
38959
39504
  type: 'orientation',
38960
- })), preSelected: this.selectedPrinter.id ? this.selectedProperties.orientation : null, disabled: !(((_o = (_m = this.selectedPrinterConfig.OrientationsSupported) === null || _m === void 0 ? void 0 : _m.length) !== null && _o !== void 0 ? _o : 0) > 0) }), index.h("ezp-select", { label: instance.t('printer_selection.quality'), placeholder: instance.t('printer_selection.select_quality'), toggleFlow: "horizontal", options: (_p = this.selectedPrinterConfig.Resolutions) === null || _p === void 0 ? void 0 : _p.map((option, index) => ({
39505
+ })), preSelected: this.selectedPrinter.id ? this.selectedProperties.orientation : null, disabled: !(((_g = (_f = this.selectedPrinterConfig.OrientationsSupported) === null || _f === void 0 ? void 0 : _f.length) !== null && _g !== void 0 ? _g : 0) > 0) }), index.h("ezp-select", { label: instance.t('printer_selection.quality'), placeholder: instance.t('printer_selection.select_quality'), toggleFlow: "horizontal", options: (_h = this.selectedPrinterConfig.Resolutions) === null || _h === void 0 ? void 0 : _h.map((option, index) => ({
38961
39506
  id: index,
38962
39507
  title: option,
38963
39508
  meta: '',
38964
39509
  type: 'quality',
38965
- })), preSelected: this.selectedPrinter.id &&
38966
- ((_q = this.selectedPrinterConfig.Resolutions) === null || _q === void 0 ? void 0 : _q.includes((_r = this.selectedPrinterConfig.Default) === null || _r === void 0 ? void 0 : _r.Resolution))
38967
- ? (_s = this.selectedPrinterConfig.Default) === null || _s === void 0 ? void 0 : _s.Resolution
38968
- : null, disabled: !(((_u = (_t = this.selectedPrinterConfig.Resolutions) === null || _t === void 0 ? void 0 : _t.length) !== null && _u !== void 0 ? _u : 0) > 0) }), this.selectedPrinterConfig.Trays &&
39510
+ })), preSelected: this.selectedPrinter.id
39511
+ ? this.selectedProperties.resolution || null
39512
+ : null, disabled: !(((_k = (_j = this.selectedPrinterConfig.Resolutions) === null || _j === void 0 ? void 0 : _j.length) !== null && _k !== void 0 ? _k : 0) > 0) }), this.selectedPrinterConfig.Trays &&
38969
39513
  this.selectedPrinterConfig.Trays.length >= 1 &&
38970
39514
  this.selectedPrinterConfig.Trays[0] != null ? (index.h("ezp-select", { label: instance.t('printer_selection.trays'), placeholder: instance.t('printer_selection.select_trays'), toggleFlow: "horizontal", optionFlow: "horizontal", options: this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 1
38971
39515
  ? this.selectedPrinterConfig.Trays.map((trays) => ({
@@ -38974,10 +39518,7 @@ const EzpPrinterSelection = class {
38974
39518
  meta: '',
38975
39519
  type: 'tray',
38976
39520
  }))
38977
- : undefined, preSelected: this.selectedPrinter.id &&
38978
- ((_v = this.selectedPrinterConfig.Trays) === null || _v === void 0 ? void 0 : _v.find((el) => { var _a; return el.Name.includes((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Tray); }))
38979
- ? (_w = this.selectedPrinterConfig.Default) === null || _w === void 0 ? void 0 : _w.Tray
38980
- : null })) : null, index.h("ezp-input", { suffix: "", placeholder: "1-2,4-5,8", value: this.selectedProperties.PageRanges, eventType: "paper_ranges", type: "text", label: instance.t('printer_selection.page_ranges') }))), index.h("div", { id: "footer" }, index.h("ezp-text-button", { type: "button", level: "secondary", onClick: this.handleCancel, label: instance.t('button_actions.cancel'), class: "action", id: "cancel" }), index.h("button", { id: "print", type: "button", disabled: this.printDisabled, onClick: this.handlePrint, ref: (button) => (this.printButton = button) }, index.h("ezp-icon", { name: "printer" }), index.h("ezp-label", { weight: "heavy", text: instance.t('printer_selection.print') }))), !this.hidemenu && index.h("ezp-user-menu", { open: this.userMenuOpen, name: this.userName }))));
39521
+ : undefined, preSelected: this.trayPreSelection() })) : null, index.h("ezp-input", { suffix: "", placeholder: "1-2,4-5,8", value: this.selectedProperties.PageRanges, eventType: "paper_ranges", type: "text", label: instance.t('printer_selection.page_ranges') }))), index.h("div", { id: "footer" }, index.h("ezp-text-button", { type: "button", level: "secondary", onClick: this.handleCancel, label: instance.t('button_actions.cancel'), class: "action", id: "cancel" }), index.h("button", { id: "print", type: "button", disabled: this.printDisabled, onClick: this.handlePrint, ref: (button) => (this.printButton = button) }, index.h("ezp-icon", { name: "printer" }), index.h("ezp-label", { weight: "heavy", text: instance.t('printer_selection.print') }))), !this.hidemenu && index.h("ezp-user-menu", { open: this.userMenuOpen, name: this.userName }))));
38981
39522
  }
38982
39523
  };
38983
39524
  EzpPrinterSelection.style = ezpPrinterSelectionCss();
@@ -39060,6 +39601,18 @@ const EzpPrinting = class {
39060
39601
  document.dispatchEvent(printCancelEvent);
39061
39602
  this.printFinished.emit();
39062
39603
  }
39604
+ /** Cancel or close on the print options card. With an upload step to go
39605
+ * back to, only the card closes: the files picked there stay picked, and
39606
+ * removing them is the upload card's "Clear files". Without one there is
39607
+ * nothing left to show, so it ends the flow like `printCancel`. */
39608
+ listenPrintDismiss() {
39609
+ if (this.trigger === 'file') {
39610
+ this.printOpen = false;
39611
+ }
39612
+ else {
39613
+ this.listenPrintCancel();
39614
+ }
39615
+ }
39063
39616
  /** Description... */
39064
39617
  listenPrintSubmit() {
39065
39618
  this.printOpen = false;
@@ -39327,7 +39880,7 @@ const EzpPrinting = class {
39327
39880
  *
39328
39881
  */
39329
39882
  render() {
39330
- return (index.h(index.Host, { key: '5aa98ade8a71777d5032a3ccfb70d52f9d71f259', class: `${userStore.state.theme} ${userStore.state.appearance === 'system'
39883
+ return (index.h(index.Host, { key: '1b33fdafac04c08cdd11412202a537f66131caef', class: `${userStore.state.theme} ${userStore.state.appearance === 'system'
39331
39884
  ? this.systemAppearance
39332
39885
  : userStore.state.appearance} ${this.seamless ? 'seamless' : ''}` }, this.trigger === 'custom' ? (index.h("slot", null)) : this.trigger === 'file' ? (index.h("ezp-upload", null)) : (this.trigger === 'button' && (index.h("ezp-icon-button", { id: "print-trigger", icon: "printer", slot: "trigger", type: "button", onClick: () => this.open() }))), this.authOpen ? (index.h("ezp-auth", { clientID: this.clientid, redirectURI: this.redirecturi, hidelogin: this.hidelogin, trigger: this.trigger, code: this.code })) : this.printOpen ? (index.h("ezp-printer-selection", { clientID: this.clientid, redirectURI: this.redirecturi, filename: this.filename, fileurl: this.fileurl, filetype: this.filetype, fileid: this.fileid, files: this.files, hidemenu: this.hidemenu, hideheader: this.hideheader, seamless: this.seamless })) : this.noDocumentOpen ? (index.h("ezp-dialog", { heading: instance.t('no_document_dialog.heading'), description: instance.t('no_document_dialog.description'), action: instance.t('no_document_dialog.action'), iconName: "question-mark", instance: "no-document-selected" })) : null));
39333
39886
  }
@@ -39563,7 +40116,7 @@ const EzpSelect = class {
39563
40116
  this.disabled ? 'disabled' : '',
39564
40117
  ];
39565
40118
  const labelLevel = this.toggleFlow === 'horizontal' ? 'secondary' : 'tertiary';
39566
- return (index.h(index.Host, { key: '89aa6ffebb4083fd8ea1ca90c4ab3b197498fd68', class: hostClasses.join(' ') }, index.h("div", { key: '895a0c53f37d7255034643b33b9b4efcc95072e8', id: "wrap" }, index.h("div", { key: '8339822b01a064a9bc03e8ea9a65e8de55339640', id: "toggle", role: "combobox", "aria-haspopup": "listbox", "aria-controls": "list", "aria-expanded": this.expanded ? 'true' : 'false', "aria-label": this.label, "aria-disabled": this.disabled ? 'true' : 'false', tabindex: this.disabled ? -1 : 0, ref: (el) => (this.toggleEl = el), onClick: () => !this.disabled && this.toggle(), onKeyDown: this.handleToggleKeydown }, this.icon ? index.h("ezp-icon", { id: "icon", name: this.icon }) : null, index.h("ezp-label", { key: '3ba6751cd4c366193ef304ed967cd644e8a04aa2', id: "label", noWrap: true, level: labelLevel, text: this.label }), index.h("ezp-label", { key: 'd0dd648a1ebe6bfb0dd21e0d24da486c21d34d61', id: "value", ellipsis: true, text: ((_a = this.selected) === null || _a === void 0 ? void 0 : _a.title) !== '' ? (_b = this.selected) === null || _b === void 0 ? void 0 : _b.title : this.placeholder }), index.h("ezp-icon", { key: '11f05e149e4f3c443bf6b261617ea36c794a657c', id: "accessory", name: "expand" })), index.h("div", { key: '794d83d79e75f5c85d156fc05bf7c0815ed12780', id: "list", role: "listbox", "aria-label": this.label, ref: (element) => (this.list = element) }, (_c = this.options) === null || _c === void 0 ? void 0 : _c.map((option) => {
40119
+ return (index.h(index.Host, { key: '7dd328df209e8906917c97b8002bdcd9e2fafa0b', class: hostClasses.join(' ') }, index.h("div", { key: '522bbbfea1ef111af7bd7317cc6054138eca020d', id: "wrap" }, index.h("div", { key: 'd1c2c06a33f629d589e2247342467ebbd7283d1b', id: "toggle", role: "combobox", "aria-haspopup": "listbox", "aria-controls": "list", "aria-expanded": this.expanded ? 'true' : 'false', "aria-label": this.label, "aria-disabled": this.disabled ? 'true' : 'false', tabindex: this.disabled ? -1 : 0, ref: (el) => (this.toggleEl = el), onClick: () => !this.disabled && this.toggle(), onKeyDown: this.handleToggleKeydown }, this.icon ? index.h("ezp-icon", { id: "icon", name: this.icon }) : null, index.h("ezp-label", { key: 'c60d6dd802424b2502d1b9c9066732ef02909779', id: "label", noWrap: true, level: labelLevel, text: this.label }), index.h("ezp-label", { key: 'c92c91c848aec5b6ff386f32beb41bdaf4407613', id: "value", ellipsis: true, text: ((_a = this.selected) === null || _a === void 0 ? void 0 : _a.title) !== '' ? (_b = this.selected) === null || _b === void 0 ? void 0 : _b.title : this.placeholder }), index.h("ezp-icon", { key: '7c653c97c7da8471e7db51c1ba04718842a9991b', id: "accessory", name: "expand" })), index.h("div", { key: '5c1aeeb45f4cbf1c4e26653312d6cc0a7e7084ce', id: "list", role: "listbox", "aria-label": this.label, ref: (element) => (this.list = element) }, (_c = this.options) === null || _c === void 0 ? void 0 : _c.map((option) => {
39567
40120
  var _a, _b;
39568
40121
  if (option.title !== '') {
39569
40122
  return (index.h("div", { class: `option ${option.id === ((_a = this.selected) === null || _a === void 0 ? void 0 : _a.id) ? 'is-selected' : ''} ${option.meta !== '' ? 'has-meta' : ''} `, role: "option", "aria-selected": option.id === ((_b = this.selected) === null || _b === void 0 ? void 0 : _b.id) ? 'true' : 'false', tabindex: this.expanded ? 0 : -1, onClick: () => this.select(option.id), onKeyDown: (event) => this.handleOptionKeydown(event, option.id) }, index.h("ezp-icon", { name: "checkmark", class: "indicator" }), index.h("div", { class: "details" }, index.h("ezp-label", { class: "title", ellipsis: true, text: option.title }), option.meta !== '' ? (index.h("ezp-label", { level: "tertiary", class: "meta", text: option.meta, ellipsis: true })) : null)));
@@ -39633,9 +40186,9 @@ const EzpStatus = class {
39633
40186
  return (
39634
40187
  // Live region so screen readers announce status changes (loading,
39635
40188
  // processing, success, error) as they render.
39636
- index.h(index.Host, { key: '57292e782da34ffd4ccde20684cd7e5d4b07d857', role: "status", "aria-live": "polite" }, index.h("div", { key: 'f4cac1f4e6624efaac038b26dd592ef8c96769a1', id: "box" }, this.processing ? (index.h("svg", { id: "indicator", viewBox: "0 0 42 42", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, index.h("circle", { id: "track", cx: "21", cy: "21", r: "18" }), index.h("circle", { id: "value", cx: "21", cy: "21", r: "18" }))) : this.icon ? (index.h("div", { id: "icon" }, index.h("div", { id: "icon-inner" }, index.h("ezp-icon", { name: this.icon })))) : null, index.h("ezp-label", { key: '6d6747ac139503337ee1ef5c5d9da0c2b8447846', id: "description", weight: "heavy", text: this.description }), this.subtext && (index.h("ezp-label", { key: '75557ddfdb8a08cd4536550444937adb462c2ec5', id: "subtext", level: "secondary", text: this.subtext })), (this.cancel || this.close || this.retry) && (index.h("div", { key: '5615011e1e597a18643d6b7b11007b56d4eee4ad', id: "footer" }, this.cancel && (index.h("ezp-text-button", { key: 'a451aa22649c64745667ae1434690a86ed680a30', class: "action secondary", level: "secondary", onClick: this.handleCancel, label: typeof this.cancel === 'string'
40189
+ index.h(index.Host, { key: 'db32e5667bf9438a6d3d80807519ad2c158549ff', role: "status", "aria-live": "polite" }, index.h("div", { key: '815ecfbd3b272f206764ca852b8d865d7bc3cb8d', id: "box" }, this.processing ? (index.h("svg", { id: "indicator", viewBox: "0 0 42 42", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, index.h("circle", { id: "track", cx: "21", cy: "21", r: "18" }), index.h("circle", { id: "value", cx: "21", cy: "21", r: "18" }))) : this.icon ? (index.h("div", { id: "icon" }, index.h("div", { id: "icon-inner" }, index.h("ezp-icon", { name: this.icon })))) : null, index.h("ezp-label", { key: '385d4fbbd7ed1b7a4aa2334d6d2145c2f5207508', id: "description", weight: "heavy", text: this.description }), this.subtext && (index.h("ezp-label", { key: 'c6a243dd4ddc428f3e34021430d6b935f0a9e1a6', id: "subtext", level: "secondary", text: this.subtext })), (this.cancel || this.close || this.retry) && (index.h("div", { key: '0dfc5f86b6366b3631ac74c15e9d467a884feb52', id: "footer" }, this.cancel && (index.h("ezp-text-button", { key: 'a89289163ac7d630d35e887deead462c6dc29af4', class: "action secondary", level: "secondary", onClick: this.handleCancel, label: typeof this.cancel === 'string'
39637
40190
  ? this.cancel
39638
- : instance.t('button_actions.cancel') })), this.close && (index.h("ezp-text-button", { key: 'a3ea31d096ab7514102fb2c8000a5059c833a96b', class: `action ${this.retry ? 'secondary' : 'primary'}`, level: this.retry ? 'secondary' : 'primary', onClick: this.handleClose, label: typeof this.close === 'string' ? this.close : instance.t('button_actions.close') })), this.retry && (index.h("ezp-text-button", { key: '154c3547c46066e80207f3c479788b068cf6a84d', class: "action primary", level: "primary", onClick: this.handleRetry, label: typeof this.retry === 'string' ? this.retry : instance.t('button_actions.retry') })))))));
40191
+ : instance.t('button_actions.cancel') })), this.close && (index.h("ezp-text-button", { key: 'd2e3814f2a81ce03f4e0f4bbcf7cc734ade37aa9', class: `action ${this.retry ? 'secondary' : 'primary'}`, level: this.retry ? 'secondary' : 'primary', onClick: this.handleClose, label: typeof this.close === 'string' ? this.close : instance.t('button_actions.close') })), this.retry && (index.h("ezp-text-button", { key: '6e53e77afc6c3954435b08c6daaa65dd829ce9ad', class: "action primary", level: "primary", onClick: this.handleRetry, label: typeof this.retry === 'string' ? this.retry : instance.t('button_actions.retry') })))))));
39639
40192
  }
39640
40193
  };
39641
40194
  EzpStatus.style = ezpStatusCss();
@@ -39772,7 +40325,7 @@ const EzpStepper = class {
39772
40325
  *
39773
40326
  */
39774
40327
  render() {
39775
- return (index.h(index.Host, { key: 'cdb3aa8969719def6546f35fac5aa35b47c1f94b', class: `${this.focused ? 'focused' : ''} ${this.icon ? 'has-icon' : ''}` }, index.h("div", { key: '4b0edee6d156edc6e8f79eb0639be4203b12fc5b', id: "toggle", onClick: this.setFocus }), this.icon ? index.h("ezp-icon", { id: "icon", name: this.icon }) : null, index.h("ezp-label", { key: '4fb1d96f12933ee37c05afafee8f313d77a06e9e', id: "label", noWrap: true, text: this.label }), index.h("div", { key: '3be9bb50e25876cecf351632e002bc37474a12df', class: "buttons" }, index.h("button", { key: '77fdb0f15d4b54a820a7c4329b2f49ac2bef832e', class: "button", type: "button", "aria-label": `Decrease ${this.label}`, disabled: !this.canDecrease, onClick: this.handleDecrease }, index.h("ezp-icon", { key: '76cc4d8fefdb61a9ad66aa63fe36414093207ef5', name: "minus" })), index.h("input", { key: 'fab279a99fb1803fc8095c881f6d43233a12de6b', id: "input", type: "number", ref: (input) => (this.input = input), min: this.min.toString(), max: this.max !== undefined ? this.max.toString() : undefined, value: this.value.toString(), "aria-label": this.label, onInput: this.handleInput, onKeyDown: this.handleKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur }), index.h("button", { key: 'fa0ad31ae7a0481d4ca173211ae2796a6ef5e805', class: "button", type: "button", "aria-label": `Increase ${this.label}`, disabled: !this.canIncrease, onClick: this.handleIncrease }, index.h("ezp-icon", { key: '98bb7417e464e4d5704d8f5d4f969a11d0c70fcf', name: "plus" })))));
40328
+ return (index.h(index.Host, { key: 'cbf3ded61537359ed280a204bb71240d0a34473a', class: `${this.focused ? 'focused' : ''} ${this.icon ? 'has-icon' : ''}` }, index.h("div", { key: '1c7a265f60d06dbea4a80e19ecdaa4a10aed694c', id: "toggle", onClick: this.setFocus }), this.icon ? index.h("ezp-icon", { id: "icon", name: this.icon }) : null, index.h("ezp-label", { key: '9fd0e1128480dd9b288cb266542fd4e6b83ceebd', id: "label", noWrap: true, text: this.label }), index.h("div", { key: '975fc0539e76750d7457c71d40f228cb5ebcaad8', class: "buttons" }, index.h("button", { key: 'db01d05fdcbc4eda2810751ace0194d9a1ec9eb7', class: "button", type: "button", "aria-label": `Decrease ${this.label}`, disabled: !this.canDecrease, onClick: this.handleDecrease }, index.h("ezp-icon", { key: '7d938efa8426caf292403e94e3565d20dc40d121', name: "minus" })), index.h("input", { key: 'dbff518a5d1f28b3b23d597947c250bef71fd68a', id: "input", type: "number", ref: (input) => (this.input = input), min: this.min.toString(), max: this.max !== undefined ? this.max.toString() : undefined, value: this.value.toString(), "aria-label": this.label, onInput: this.handleInput, onKeyDown: this.handleKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur }), index.h("button", { key: 'b3001bb27f94f65fce51d3a69d7713e5da9ccdcc', class: "button", type: "button", "aria-label": `Increase ${this.label}`, disabled: !this.canIncrease, onClick: this.handleIncrease }, index.h("ezp-icon", { key: '534bb499fa2ced2591ccbc137186e59d22aa2f5f', name: "plus" })))));
39776
40329
  }
39777
40330
  static get watchers() { return {
39778
40331
  "value": [{
@@ -39829,12 +40382,12 @@ const EzpTextButton = class {
39829
40382
  href: this.href,
39830
40383
  target: this.blank ? '_blank' : '_self',
39831
40384
  };
39832
- return (index.h(index.Host, { key: '24c7d7fe23395513fccfc8fc94fbc552a1763148', class: `${this.level}` }, index.h(TagType, Object.assign({ key: 'eded3e128d17f4b5bf5a29b01e51f4a2ba1d6d74', id: "button", "aria-label": this.label }, attributes), index.h("ezp-label", { key: '4974381f385143ac4828f74c580ef280357e85ac', id: "label", weight: "heavy", text: this.label, level: this.small ? 'tertiary' : 'secondary' }))));
40385
+ return (index.h(index.Host, { key: '31c3726d82b340fad817eec01f597b58702ff292', class: `${this.level}` }, index.h(TagType, Object.assign({ key: '5e26c8e81ab49575b1a29c309f7792a2286ee455', id: "button", "aria-label": this.label }, attributes), index.h("ezp-label", { key: 'b21b121c9da908b6cba286a528f8e6772c179a36', id: "label", weight: "heavy", text: this.label, level: this.small ? 'tertiary' : 'secondary' }))));
39833
40386
  }
39834
40387
  };
39835
40388
  EzpTextButton.style = ezpTextButtonCss();
39836
40389
 
39837
- const ezpUploadCss = () => `@charset "UTF-8";:host{-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--ezp-core-foreground-primary);display:block;height:var(--ezp-upload-height, auto);width:var(--ezp-upload-width, auto)}*,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}#form{display:block;height:100%}#input{-webkit-appearance:none;-moz-appearance:none;appearance:none;height:0;opacity:0;pointer-events:none;position:absolute;width:0}#modal{background:var(--ezp-core-surface-tertiary);border-radius:16px;-webkit-box-shadow:0 0 0 1px var(--ezp-core-outline), 0 24px 60px -20px var(--ezp-core-backdrop);box-shadow:0 0 0 1px var(--ezp-core-outline), 0 24px 60px -20px var(--ezp-core-backdrop);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;overflow:hidden}:host(.dragging) #modal *{pointer-events:none}#body-frame{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-direction:column;flex-direction:column;min-height:0;position:relative}#body{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-direction:column;flex-direction:column;min-height:0;overflow-y:auto;padding:var(--ezp-spacing-4);scrollbar-width:thin}#dropzone{-ms-flex-align:center;align-items:center;background:var(--ezp-theme-translucent);border:1.5px dashed var(--ezp-theme-solid);border-radius:12px;-webkit-box-shadow:var(--ezp-upload-dropzone-boxShadow, none);box-shadow:var(--ezp-upload-dropzone-boxShadow, none);display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-4);-ms-flex-pack:center;justify-content:center;min-height:160px;padding:var(--ezp-spacing-6) var(--ezp-spacing-4);text-align:center;-webkit-transition:-webkit-box-shadow var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:-webkit-box-shadow var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:box-shadow var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:box-shadow var(--ezp-duration-3) var(--ezp-easing-out-quart), -webkit-box-shadow var(--ezp-duration-3) var(--ezp-easing-out-quart)}:host(.dragging){--ezp-upload-dropzone-boxShadow:0 0 0 4px var(--ezp-theme-translucent)}:host(:not(.dragging)) #dropzone-title,:host(.dragging) #dropzone-prompt{display:none}#drop-overlay{-ms-flex-align:center;align-items:center;background:-webkit-gradient(linear, left top, left bottom, from(var(--ezp-theme-translucent)), to(var(--ezp-theme-translucent))), var(--ezp-core-surface-tertiary);background:linear-gradient(var(--ezp-theme-translucent), var(--ezp-theme-translucent)), var(--ezp-core-surface-tertiary);border:1.5px dashed var(--ezp-theme-solid);border-radius:12px;-webkit-box-shadow:0 0 0 4px var(--ezp-theme-translucent);box-shadow:0 0 0 4px var(--ezp-theme-translucent);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-4);inset:var(--ezp-spacing-4);-ms-flex-pack:center;justify-content:center;pointer-events:none;position:absolute;text-align:center;z-index:1}#dropzone-icon{--ezp-icon-size:32px;--ezp-icon-gridTemplate:32px;color:var(--ezp-theme-solid)}#dropzone-prompt{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-3)}#choose{--ezp-textButton-borderRadius:8px;--ezp-textButton-padding:13px var(--ezp-spacing-5)}#drag-hint{color:var(--ezp-core-foreground-primary)}#formats{color:var(--ezp-core-foreground-secondary)}#files{border:1px solid var(--ezp-core-outline);border-radius:12px;overflow:hidden}.file{-ms-flex-align:center;align-items:center;display:grid;gap:var(--ezp-spacing-3);grid-template-columns:auto minmax(0, 1fr) auto;padding:var(--ezp-spacing-3) var(--ezp-spacing-4)}.file+.file{border-top:1px solid var(--ezp-core-outline)}.file-type{background:var(--ezp-theme-translucent);border-radius:6px;color:var(--ezp-theme-solid);font-size:11px;font-weight:600;letter-spacing:0.02em;line-height:1;overflow:hidden;padding:8px 6px;text-align:center;text-overflow:ellipsis;white-space:nowrap;width:56px}.file-details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-2);min-width:0}.file-size{color:var(--ezp-core-foreground-secondary)}.file-remove{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;border-radius:6px;color:var(--ezp-core-foreground-tertiary);cursor:pointer;display:-ms-flexbox;display:flex;height:28px;-ms-flex-pack:center;justify-content:center;padding:0;-webkit-transition:color var(--ezp-duration-2) var(--ezp-easing-out-quart);transition:color var(--ezp-duration-2) var(--ezp-easing-out-quart);width:28px}.file-remove ezp-icon{--ezp-icon-size:16px;--ezp-icon-gridTemplate:16px}@media (hover: hover){.file-remove:hover{color:var(--ezp-core-foreground-primary)}}#add-more{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-upload-addMore-background, transparent);border:0;border-top:1px solid var(--ezp-core-outline);color:var(--ezp-theme-solid);cursor:pointer;display:-ms-flexbox;display:flex;font-family:inherit;gap:4px;-ms-flex-pack:center;justify-content:center;padding:var(--ezp-spacing-3);-webkit-transition:background-color var(--ezp-duration-2) var(--ezp-easing-out-quart);transition:background-color var(--ezp-duration-2) var(--ezp-easing-out-quart);width:100%}#add-more ezp-icon{--ezp-icon-size:18px;--ezp-icon-gridTemplate:18px}@media (hover: hover){#add-more:hover{--ezp-upload-addMore-background:var(--ezp-core-shade-primary)}}#footer{border-top:1px solid var(--ezp-core-outline);display:grid;gap:var(--ezp-spacing-3);grid-template-columns:1fr 1.4fr;padding:var(--ezp-spacing-4)}.action{--ezp-textButton-borderRadius:8px;--ezp-textButton-padding:13px var(--ezp-spacing-3);--ezp-textButton-whiteSpace:normal;text-align:center}#clear{--ezp-textButton-background-active:var(--ezp-core-shade-secondary);--ezp-textButton-background-hover:var(--ezp-core-shade-primary);--ezp-textButton-background-init:transparent;--ezp-textButton-boxShadow:inset 0 0 0 1px var(--ezp-core-outline);--ezp-textButton-color-init:var(--ezp-core-foreground-primary)}`;
40390
+ const ezpUploadCss = () => `@charset "UTF-8";:host{-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--ezp-core-foreground-primary);display:block;height:var(--ezp-upload-height, auto);width:var(--ezp-upload-width, auto)}*,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}#form{display:block;height:100%}#input{-webkit-appearance:none;-moz-appearance:none;appearance:none;height:0;opacity:0;pointer-events:none;position:absolute;width:0}#modal{background:var(--ezp-core-surface-tertiary);border-radius:16px;-webkit-box-shadow:0 0 0 1px var(--ezp-core-outline), 0 24px 60px -20px var(--ezp-core-backdrop);box-shadow:0 0 0 1px var(--ezp-core-outline), 0 24px 60px -20px var(--ezp-core-backdrop);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;overflow:hidden}:host(.dragging) #modal *{pointer-events:none}#body-frame{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-direction:column;flex-direction:column;min-height:0;position:relative}#body{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-direction:column;flex-direction:column;min-height:0;overflow-y:auto;padding:var(--ezp-spacing-4);scrollbar-width:thin}#dropzone{-ms-flex-align:center;align-items:center;background:var(--ezp-theme-translucent);border:1.5px dashed var(--ezp-theme-solid);border-radius:12px;-webkit-box-shadow:var(--ezp-upload-dropzone-boxShadow, none);box-shadow:var(--ezp-upload-dropzone-boxShadow, none);display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-4);-ms-flex-pack:center;justify-content:center;min-height:160px;padding:var(--ezp-spacing-6) var(--ezp-spacing-4);text-align:center;-webkit-transition:-webkit-box-shadow var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:-webkit-box-shadow var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:box-shadow var(--ezp-duration-3) var(--ezp-easing-out-quart);transition:box-shadow var(--ezp-duration-3) var(--ezp-easing-out-quart), -webkit-box-shadow var(--ezp-duration-3) var(--ezp-easing-out-quart)}:host(.dragging){--ezp-upload-dropzone-boxShadow:0 0 0 4px var(--ezp-theme-translucent)}:host(:not(.dragging)) #dropzone-title,:host(.dragging) #dropzone-prompt{display:none}#drop-overlay{-ms-flex-align:center;align-items:center;background:-webkit-gradient(linear, left top, left bottom, from(var(--ezp-theme-translucent)), to(var(--ezp-theme-translucent))), var(--ezp-core-surface-tertiary);background:linear-gradient(var(--ezp-theme-translucent), var(--ezp-theme-translucent)), var(--ezp-core-surface-tertiary);border:1.5px dashed var(--ezp-theme-solid);border-radius:12px;-webkit-box-shadow:0 0 0 4px var(--ezp-theme-translucent);box-shadow:0 0 0 4px var(--ezp-theme-translucent);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-4);inset:var(--ezp-spacing-4);-ms-flex-pack:center;justify-content:center;pointer-events:none;position:absolute;text-align:center;z-index:1}#dropzone-icon{--ezp-icon-size:32px;--ezp-icon-gridTemplate:32px;color:var(--ezp-theme-solid)}#dropzone-prompt{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-3)}#choose{--ezp-textButton-borderRadius:8px;--ezp-textButton-padding:13px var(--ezp-spacing-5)}#drag-hint{color:var(--ezp-core-foreground-primary)}#formats{color:var(--ezp-core-foreground-secondary)}#files{border:1px solid var(--ezp-core-outline);border-radius:12px;position:relative}#file-list{border-radius:11px 11px 0 0;max-height:var(--ezp-upload-fileList-maxHeight, calc(4.5 * calc(28px + 2 * var(--ezp-spacing-3)) + 4px));overflow-x:hidden;overflow-y:auto;scrollbar-width:thin}.file{-ms-flex-align:center;align-items:center;display:grid;gap:var(--ezp-spacing-3);grid-template-columns:auto minmax(0, 1fr) auto;min-height:calc(28px + 2 * var(--ezp-spacing-3));padding:var(--ezp-spacing-3) var(--ezp-spacing-4)}.file+.file{border-top:1px solid var(--ezp-core-outline)}.file-type{background:var(--ezp-theme-translucent);border-radius:6px;color:var(--ezp-theme-solid);font-size:11px;font-weight:600;letter-spacing:0.02em;line-height:1;overflow:hidden;padding:8px 6px;text-align:center;text-overflow:ellipsis;white-space:nowrap;width:56px}.file-details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-2);min-width:0}.file-size{color:var(--ezp-core-foreground-secondary)}.file-remove{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;border-radius:6px;color:var(--ezp-core-foreground-tertiary);cursor:pointer;display:-ms-flexbox;display:flex;height:28px;-ms-flex-pack:center;justify-content:center;padding:0;-webkit-transition:color var(--ezp-duration-2) var(--ezp-easing-out-quart);transition:color var(--ezp-duration-2) var(--ezp-easing-out-quart);width:28px}.file-remove ezp-icon{--ezp-icon-size:16px;--ezp-icon-gridTemplate:16px}@media (hover: hover){.file-remove:hover{color:var(--ezp-core-foreground-primary)}}#add-more{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-upload-addMore-background, transparent);border:0;border-radius:0 0 11px 11px;border-top:1px solid var(--ezp-core-outline);color:var(--ezp-theme-solid);cursor:pointer;display:-ms-flexbox;display:flex;font-family:inherit;gap:4px;-ms-flex-pack:center;justify-content:center;padding:var(--ezp-spacing-3);-webkit-transition:background-color var(--ezp-duration-2) var(--ezp-easing-out-quart);transition:background-color var(--ezp-duration-2) var(--ezp-easing-out-quart);width:100%}#add-more ezp-icon{--ezp-icon-size:18px;--ezp-icon-gridTemplate:18px}@media (hover: hover){#add-more:hover{--ezp-upload-addMore-background:var(--ezp-core-shade-primary)}}#footer{border-top:1px solid var(--ezp-core-outline);display:grid;gap:var(--ezp-spacing-3);grid-template-columns:1fr 1.4fr;padding:var(--ezp-spacing-4)}.action{--ezp-textButton-borderRadius:8px;--ezp-textButton-padding:13px var(--ezp-spacing-3);--ezp-textButton-whiteSpace:normal;text-align:center}#clear{--ezp-textButton-background-active:var(--ezp-core-shade-secondary);--ezp-textButton-background-hover:var(--ezp-core-shade-primary);--ezp-textButton-background-init:transparent;--ezp-textButton-boxShadow:inset 0 0 0 1px var(--ezp-core-outline);--ezp-textButton-color-init:var(--ezp-core-foreground-primary)}`;
39838
40391
 
39839
40392
  /** File formats advertised to the user as supported for printing. */
39840
40393
  const SUPPORTED_FORMATS = ['PDF', 'DOCX', 'PNG', 'JPG', 'XLSX'];
@@ -39851,6 +40404,9 @@ const EzpUpload = class {
39851
40404
  */
39852
40405
  this.selectedFiles = [];
39853
40406
  this.dragging = false;
40407
+ /** First row of the file list that is at least partly in view. Its tooltip
40408
+ * opens downwards, as there is no list left above it to cover. */
40409
+ this.firstVisibleFile = 0;
39854
40410
  /**
39855
40411
  *
39856
40412
  * Listeners
@@ -39906,6 +40462,12 @@ const EzpUpload = class {
39906
40462
  // `printCancel` listener resets the form and the selection.
39907
40463
  this.printCancel.emit();
39908
40464
  };
40465
+ this.handleFilesScroll = (event) => {
40466
+ const first = firstVisibleChild(event.currentTarget);
40467
+ // Scroll fires every frame; only a change of row is worth a render.
40468
+ if (first >= 0 && first !== this.firstVisibleFile)
40469
+ this.firstVisibleFile = first;
40470
+ };
39909
40471
  this.handleContinue = () => {
39910
40472
  if (this.selectedFiles.length === 0)
39911
40473
  return;
@@ -39958,6 +40520,7 @@ const EzpUpload = class {
39958
40520
  var _a;
39959
40521
  (_a = this.form) === null || _a === void 0 ? void 0 : _a.reset();
39960
40522
  this.selectedFiles = [];
40523
+ this.firstVisibleFile = 0;
39961
40524
  this.resetDrag();
39962
40525
  }
39963
40526
  fileKey(file) {
@@ -39991,7 +40554,7 @@ const EzpUpload = class {
39991
40554
  */
39992
40555
  render() {
39993
40556
  const hasFiles = this.selectedFiles.length > 0;
39994
- return (index.h(index.Host, { key: '4230fcbee5d8a20d79c05035a1783f16696a66fa', class: { dragging: this.dragging } }, index.h("form", { key: '5dcae80d94508ebe05e3dc8df463b0a1b79563ff', id: "form", ref: (form) => (this.form = form) }, index.h("input", { key: '480307c4fdbe7a39ba3872bce7cf905888f7946b', type: "file", name: "input", id: "input", multiple: true, "aria-label": instance.t('upload.choose_files'), ref: (input) => (this.input = input), onInput: this.handleInput }), index.h("div", { key: '95a58113221f2337323f0b6df3d58e459fdece2c', id: "modal" }, index.h("div", { key: '876b5ebe74d685b2ec7196df3deb8a9fd5437305', id: "body-frame" }, index.h("div", { key: '15465aeb4e939ce26b09d1a1c4f9b9b5d8901762', id: "body" }, !hasFiles && (index.h("div", { key: '912e27683e12d3d8ca999b4c3dbe1f528677aafd', id: "dropzone" }, index.h("ezp-icon", { key: '8cb1edf6b5c14a7815e52f7bc91d674047045e57', id: "dropzone-icon", name: "cloud-upload" }), index.h("ezp-label", { key: '678ea4205fbe81d3621dc205303533eb8c12ce23', id: "dropzone-title", level: "primary", weight: "heavy", text: instance.t('upload.dropzone_title') }), index.h("div", { key: '0fcd25bb9f12c1cd0c056d88cf94a20946b44f2a', id: "dropzone-prompt" }, index.h("ezp-text-button", { key: '5cc5ff7a98f87ae1eb2db4009435b926924be2e9', id: "choose", type: "button", onClick: this.openPicker, label: instance.t('upload.choose_files') }), index.h("ezp-label", { key: 'b64fe2cadd1639c5ef0b10da0084d420abd8232f', id: "drag-hint", level: "secondary", weight: "strong", text: instance.t('upload.drag_hint') }), index.h("ezp-label", { key: '5bf5178e691d35a58e988bacff656bd790f4c6ea', id: "formats", level: "tertiary", text: SUPPORTED_FORMATS.join(', ') })))), hasFiles && (index.h("div", { key: '289ce054d8987ba1d2a5c6481171dce341dd1e5c', id: "files" }, this.selectedFiles.map((file, index$1) => (index.h("div", { key: this.fileKey(file), class: "file" }, index.h("span", { class: "file-type", "aria-hidden": "true" }, this.fileType(file.name)), index.h("div", { class: "file-details" }, index.h("ezp-label", { class: "file-name", ellipsis: true, weight: "heavy", text: file.name }), index.h("ezp-label", { class: "file-size", level: "tertiary", text: this.formatSize(file.size) })), index.h("button", { type: "button", class: "file-remove", "aria-label": instance.t('upload.remove_file'), onClick: (event) => this.removeFile(event, index$1) }, index.h("ezp-icon", { name: "close" }))))), index.h("button", { key: 'd0b397071945aadecde0a92b9a9e36a40a612197', type: "button", id: "add-more", onClick: this.openPicker }, index.h("ezp-icon", { key: 'cd89350e28759f3d2b4553367ff6c6f4eaf07dfc', name: "plus" }), index.h("ezp-label", { key: '0f959da4e971ad6520563d892afb086b1a3df5a4', level: "secondary", weight: "heavy", text: instance.t('upload.add_more') }))))), hasFiles && this.dragging && (index.h("div", { key: 'd767d3dc25ce56b85dd0b3dcacf88a6fa4e420e1', id: "drop-overlay", "aria-hidden": "true" }, index.h("ezp-icon", { key: 'fefa5a29b5bd2df98b5d9fedfce2e6800418544f', id: "dropzone-icon", name: "cloud-upload" }), index.h("ezp-label", { key: '7ef3bba07de86ecefa094617f6262f47875db36a', level: "primary", weight: "heavy", text: instance.t('upload.dropzone_title') })))), index.h("div", { key: 'd7b1f67053bd4e0eef8d271eb7c3e547d4d40af3', id: "footer" }, index.h("ezp-text-button", { key: 'c0195d9ba0012a5297254eae8d60dc90337eb7a1', id: "clear", type: "button", level: "secondary", disabled: !hasFiles, onClick: this.handleCancel, label: instance.t('upload.remove_files'), class: "action" }), index.h("ezp-text-button", { key: '154a5770c232fadd7befd1af09c26cbe5d143f36', id: "continue", type: "button", disabled: !hasFiles, onClick: this.handleContinue, label: instance.t('upload.continue'), class: "action" }))))));
40557
+ return (index.h(index.Host, { key: '647c38e3dd42274be594a2fd5eb668943cd37256', class: { dragging: this.dragging } }, index.h("form", { key: 'a0af9e0bb32e8460b0b86bd897913a1c434747a8', id: "form", ref: (form) => (this.form = form) }, index.h("input", { key: 'd687034216a6e03a484fdd4462a7e2817675237c', type: "file", name: "input", id: "input", multiple: true, "aria-label": instance.t('upload.choose_files'), ref: (input) => (this.input = input), onInput: this.handleInput }), index.h("div", { key: '82a76ba0258746bc552afc03c500a563c698e821', id: "modal" }, index.h("div", { key: 'a6113ba410cf3985ad64fa9300cf4e9ef2182e4f', id: "body-frame" }, index.h("div", { key: 'd9af36800ce744146c43a7e99f289413e13b9ae3', id: "body" }, !hasFiles && (index.h("div", { key: 'df98d670f9c0498597f414158108c38265b59b90', id: "dropzone" }, index.h("ezp-icon", { key: '0202221de58ae709f5823501cfce1bc9d1087136', id: "dropzone-icon", name: "cloud-upload" }), index.h("ezp-label", { key: '9cbb60bc48f9e74af2c613d8c83a973e984ce824', id: "dropzone-title", level: "primary", weight: "heavy", text: instance.t('upload.dropzone_title') }), index.h("div", { key: 'ccaef599519bf24af543f4727fb4c1a62338b9df', id: "dropzone-prompt" }, index.h("ezp-text-button", { key: 'f084bb66ff63e9448cb6e7aea1782d8d2c9914b3', id: "choose", type: "button", onClick: this.openPicker, label: instance.t('upload.choose_files') }), index.h("ezp-label", { key: 'f5e7bd5219637c13cc0f9ad97ab42a14d35aa601', id: "drag-hint", level: "secondary", weight: "strong", text: instance.t('upload.drag_hint') }), index.h("ezp-label", { key: 'd5334e1e3aaaaaf9a7abb4be38a27226f73a162a', id: "formats", level: "tertiary", text: SUPPORTED_FORMATS.join(', ') })))), hasFiles && (index.h("div", { key: '9eaec0f2ddb0f2ca4679e4a314afb2b42c211a17', id: "files" }, index.h("div", { key: 'bc990a270c2432c8237b75eebc9d4881a6bb856e', id: "file-list", onScroll: this.handleFilesScroll }, this.selectedFiles.map((file, index$1) => (index.h("div", { key: this.fileKey(file), class: "file", "data-tooltip-row": true }, index.h("span", { class: "file-type", "aria-hidden": "true" }, this.fileType(file.name)), index.h("div", { class: "file-details" }, index.h("ezp-file-name", { class: "file-name", weight: "heavy", name: file.name, anchor: "parent", placement: index$1 === this.firstVisibleFile ? 'bottom' : 'top' }), index.h("ezp-label", { class: "file-size", level: "tertiary", text: this.formatSize(file.size) })), index.h("button", { type: "button", class: "file-remove", "aria-label": instance.t('upload.remove_file'), onClick: (event) => this.removeFile(event, index$1) }, index.h("ezp-icon", { name: "close" })))))), index.h("button", { key: 'd22584a56b417545260c5b8c2210a6c62b59426e', type: "button", id: "add-more", onClick: this.openPicker }, index.h("ezp-icon", { key: '1313f4255c6a58e58d04b0188153ec815ce6b938', name: "plus" }), index.h("ezp-label", { key: 'deadcecb7b733c33a3990802a4ebf6b84726b48e', level: "secondary", weight: "heavy", text: instance.t('upload.add_more') }))))), hasFiles && this.dragging && (index.h("div", { key: '20bf6c68fd28c8de0b63b88aad24f1ab63d25ac3', id: "drop-overlay", "aria-hidden": "true" }, index.h("ezp-icon", { key: '135896652629a8eba574c21af1af20ba6722ad5d', id: "dropzone-icon", name: "cloud-upload" }), index.h("ezp-label", { key: '03921a166561ce06af4fce3abcd1f812738844f5', level: "primary", weight: "heavy", text: instance.t('upload.dropzone_title') })))), index.h("div", { key: '2d1e16e9e8ca950e1e968ca12939a245f7618adc', id: "footer" }, index.h("ezp-text-button", { key: '6a776b09c068982932225a4903df003e8a89b20a', id: "clear", type: "button", level: "secondary", disabled: !hasFiles, onClick: this.handleCancel, label: instance.t('upload.remove_files'), class: "action" }), index.h("ezp-text-button", { key: 'ca872a7d7834191001faef1140dbd344566ed79d', id: "continue", type: "button", disabled: !hasFiles, onClick: this.handleContinue, label: instance.t('upload.continue'), class: "action" }))))));
39995
40558
  }
39996
40559
  };
39997
40560
  EzpUpload.style = ezpUploadCss();
@@ -40081,7 +40644,7 @@ const EzpUserMenu = class {
40081
40644
  *
40082
40645
  */
40083
40646
  render() {
40084
- return (index.h(index.Host, { key: '3d13f203651146743cf8ac7754764e37d5cead30', class: this.open ? 'is-open' : '' }, index.h("div", { key: '28c08e6068d25a96d385553491edfcec25e516d3', id: "header" }, index.h("ezp-label", { key: '45881a8cff5d1efbbae133cd13206120c2ae17da', ellipsis: true, id: "name", weight: "heavy", text: this.name }), index.h("ezp-icon-button", { key: '92205d9008c0d3a68989ea8bca24c481b1542716', id: "close", level: "tertiary", icon: "close", onClick: this.handleClose })), index.h("div", { key: '4ef631425b38ed208f5e55446525c45943e6dfee', id: "links" }, this.links.map((link) => (index.h("a", { class: "link", href: link.href, target: "_blank", rel: "noopener noreferrer" }, index.h("ezp-icon", { class: "link__icon", name: link.icon }), index.h("ezp-label", { text: link.title })))), index.h("a", { key: '85e8603a60e7150458e31cc20bbaa99a0f024636', class: "link", onClick: this.logOut }, index.h("ezp-icon", { key: 'c96a13aeb65e645e7180c469d9168550d6bfaee2', class: "link__icon", name: "logout" }), index.h("ezp-label", { key: '1aa825d659ffedd8318016540716c88a27f4f75b', text: instance.t('user_menu.logout') }))), index.h("div", { key: 'c7d2c25bebb2601c34215766b2e85359834e16f7', id: "theme" }, index.h("ezp-label", { key: 'e39f708172868841fd5d043dc6d8466a4db71405', class: "caption", text: `${instance.t('user_menu.theme')}:`, weight: "heavy" }), index.h("div", { key: '26dc2c26d4408c0cb03d0e2fbd4954744eb2ada4', id: "swatches" }, this.themes.map((theme) => (index.h("button", { class: `swatch swatch--${theme} ${theme === userStore.state.theme ? 'selected' : ''}`, onClick: () => this.handleTheme(theme) }, index.h("span", { class: "dot" })))))), index.h("div", { key: 'ed62f9a441fd9eb464699c8cfdc277148b471bf8', id: "appearance" }, index.h("ezp-label", { key: '6b21204284c739cc00d79caca622f892d44a6889', class: "caption", text: `${instance.t('user_menu.appearance')}:`, weight: "heavy" }), index.h("div", { key: 'fcd9dcf68b857b6b22b7617dd999c7137ab04c9e', id: "tabs" }, this.appearances.map((appearance) => (index.h("button", { class: `tab ${appearance.name === userStore.state.appearance ? 'selected' : ''}`, onClick: () => this.handleAppearance(appearance.name) }, index.h("ezp-icon", { name: appearance.name }), index.h("ezp-label", { text: appearance.title, level: "tertiary", weight: "strong" }))))))));
40647
+ return (index.h(index.Host, { key: 'a6967dc3eb3b13630dbf652681c6c5c1f769f584', class: this.open ? 'is-open' : '' }, index.h("div", { key: '5cbf232927f4b26c1c05b01a6025b5f33fe3bfaa', id: "header" }, index.h("ezp-label", { key: '83987303c029d9d01f42d5d817edaf6c72629513', ellipsis: true, id: "name", weight: "heavy", text: this.name }), index.h("ezp-icon-button", { key: '45a64f18578adf35aeb824e393a359368e32e35a', id: "close", level: "tertiary", icon: "close", onClick: this.handleClose })), index.h("div", { key: '8bd44e5b32662baad24ee9a39abca4e772b0ef4b', id: "links" }, this.links.map((link) => (index.h("a", { class: "link", href: link.href, target: "_blank", rel: "noopener noreferrer" }, index.h("ezp-icon", { class: "link__icon", name: link.icon }), index.h("ezp-label", { text: link.title })))), index.h("a", { key: '64f041741f7760f85dd5090d0c9feebd7dec3289', class: "link", onClick: this.logOut }, index.h("ezp-icon", { key: 'bd0beefa519acb37328d9c3fd33c4286ff7e1ddc', class: "link__icon", name: "logout" }), index.h("ezp-label", { key: 'a37c8e9ffc43d0d89fe4d5dadf1dde5e36155074', text: instance.t('user_menu.logout') }))), index.h("div", { key: 'ad74827637906199b94f61d5f617fcaa9044c553', id: "theme" }, index.h("ezp-label", { key: 'c420ad169436c96acd4add9951e02f2d6fd43240', class: "caption", text: `${instance.t('user_menu.theme')}:`, weight: "heavy" }), index.h("div", { key: '04d383554f2cdfd6b7864c3e23295e2bc6f244b8', id: "swatches" }, this.themes.map((theme) => (index.h("button", { class: `swatch swatch--${theme} ${theme === userStore.state.theme ? 'selected' : ''}`, onClick: () => this.handleTheme(theme) }, index.h("span", { class: "dot" })))))), index.h("div", { key: '4e40758f22b322cbcd3d26054c6c4801c555430a', id: "appearance" }, index.h("ezp-label", { key: '3034f9eaa028ce4928c8bf2c36dc223b98eba45d', class: "caption", text: `${instance.t('user_menu.appearance')}:`, weight: "heavy" }), index.h("div", { key: 'dfa6a115e24db557891295f3a8e1ab1cfa4332f0', id: "tabs" }, this.appearances.map((appearance) => (index.h("button", { class: `tab ${appearance.name === userStore.state.appearance ? 'selected' : ''}`, onClick: () => this.handleAppearance(appearance.name) }, index.h("ezp-icon", { name: appearance.name }), index.h("ezp-label", { text: appearance.title, level: "tertiary", weight: "strong" }))))))));
40085
40648
  }
40086
40649
  get component() { return index.getElement(this); }
40087
40650
  static get watchers() { return {
@@ -40095,6 +40658,7 @@ EzpUserMenu.style = ezpUserMenuCss();
40095
40658
  exports.ezp_auth = EzpAuth;
40096
40659
  exports.ezp_backdrop = EzpBackdrop;
40097
40660
  exports.ezp_dialog = EzpDialog;
40661
+ exports.ezp_file_name = EzpFileName;
40098
40662
  exports.ezp_icon = EzpIcon;
40099
40663
  exports.ezp_icon_button = EzpIconButton;
40100
40664
  exports.ezp_input = EzpInput;