@integrity-labs/agt-cli 0.28.1232 → 0.28.1233
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/agt.js +6 -6
- package/dist/{chunk-BDXOVKWJ.js → chunk-4FLMCHQB.js} +2 -2
- package/dist/{chunk-QCBL7EBD.js → chunk-DQEUE2X2.js} +2 -2
- package/dist/{chunk-3CUCO6BU.js → chunk-HI4JD2K2.js} +3 -3
- package/dist/{chunk-LS27F6QF.js → chunk-VGEMWYW3.js} +5 -5
- package/dist/{chunk-XBADGTJP.js → chunk-XXIALNTU.js} +213 -1
- package/dist/chunk-XXIALNTU.js.map +1 -0
- package/dist/{claude-code-updater-R7QSZDGD.js → claude-code-updater-UTFTOX3B.js} +3 -3
- package/dist/{claude-pair-runtime-BH7XN36C.js → claude-pair-runtime-DI43DJ4P.js} +3 -3
- package/dist/lib/manager-worker.js +19 -19
- package/dist/mcp/direct-chat-channel.js +212 -0
- package/dist/mcp/index.js +212 -0
- package/dist/mcp/origami.js +212 -0
- package/dist/mcp/slack-channel.js +212 -0
- package/dist/mcp/telegram-channel.js +212 -0
- package/dist/{persistent-session-LQ4GJ264.js → persistent-session-S57KHU34.js} +4 -4
- package/dist/{responsiveness-probe-NN7XEPJM.js → responsiveness-probe-TFPKYDPB.js} +4 -4
- package/dist/{session-auth-dead-ESB735FG.js → session-auth-dead-EYJAWW46.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-XBADGTJP.js.map +0 -1
- /package/dist/{chunk-BDXOVKWJ.js.map → chunk-4FLMCHQB.js.map} +0 -0
- /package/dist/{chunk-QCBL7EBD.js.map → chunk-DQEUE2X2.js.map} +0 -0
- /package/dist/{chunk-3CUCO6BU.js.map → chunk-HI4JD2K2.js.map} +0 -0
- /package/dist/{chunk-LS27F6QF.js.map → chunk-VGEMWYW3.js.map} +0 -0
- /package/dist/{claude-code-updater-R7QSZDGD.js.map → claude-code-updater-UTFTOX3B.js.map} +0 -0
- /package/dist/{claude-pair-runtime-BH7XN36C.js.map → claude-pair-runtime-DI43DJ4P.js.map} +0 -0
- /package/dist/{persistent-session-LQ4GJ264.js.map → persistent-session-S57KHU34.js.map} +0 -0
- /package/dist/{responsiveness-probe-NN7XEPJM.js.map → responsiveness-probe-TFPKYDPB.js.map} +0 -0
- /package/dist/{session-auth-dead-ESB735FG.js.map → session-auth-dead-EYJAWW46.js.map} +0 -0
package/dist/mcp/index.js
CHANGED
|
@@ -25319,6 +25319,216 @@ var MARKUP_BRIDGE_SCRIPT = `<script>(function(){
|
|
|
25319
25319
|
});
|
|
25320
25320
|
})();</script>`;
|
|
25321
25321
|
|
|
25322
|
+
// ../core/dist/integrations/augmented-live/deck-phone-fit.js
|
|
25323
|
+
var DECK_PHONE_FILL_MAX_HEIGHT_PX = 500;
|
|
25324
|
+
var DECK_PHONE_FILL_MIN_WIDTH_PX = 560;
|
|
25325
|
+
var FIXER = String.raw`(function () {
|
|
25326
|
+
// ENG-8819: phone fit for Ninja Canvas slide decks, injected by the viewer shell so it
|
|
25327
|
+
// reaches decks that are already published. Acts only on a deck (a #stage holding
|
|
25328
|
+
// .slide elements); every other page is left alone.
|
|
25329
|
+
var stage = document.getElementById('stage');
|
|
25330
|
+
if (!stage || !stage.querySelector('.slide')) return;
|
|
25331
|
+
var root = document.documentElement;
|
|
25332
|
+
var css = document.createElement('style');
|
|
25333
|
+
css.id = 'agt-deck-phone-fit';
|
|
25334
|
+
css.textContent =
|
|
25335
|
+
// The stage is a flex item in deck mode. Without this it shrinks to the viewport
|
|
25336
|
+
// width before it is scaled, so a phone in landscape got a narrow, clipped slide.
|
|
25337
|
+
'html.deck-js #stage{flex-shrink:0}' +
|
|
25338
|
+
// Fill-width mode (short landscape screens): the slide is wider than tall enough
|
|
25339
|
+
// to fit, so let the page scroll vertically instead of letterboxing it.
|
|
25340
|
+
'html.deck-js.agt-fill,html.deck-js.agt-fill body{height:auto;min-height:100%;overflow-x:hidden;overflow-y:auto}' +
|
|
25341
|
+
'html.deck-js.agt-fill body{display:block}' +
|
|
25342
|
+
'html.deck-js.agt-fill #stage{transform:none!important;transform-origin:0 0}' +
|
|
25343
|
+
// Room to scroll the end of the page clear of the viewer chrome fixed along the
|
|
25344
|
+
// bottom edge (the HUD row in landscape; Download and the badge in portrait).
|
|
25345
|
+
'html.deck-js.agt-fill body{padding-bottom:76px}' +
|
|
25346
|
+
'html:not(.deck-js) body{padding-bottom:124px}' +
|
|
25347
|
+
// Portrait reads as a scrolling page, so the rotate prompt is not needed (and sat on
|
|
25348
|
+
// top of the viewer Download button).
|
|
25349
|
+
'html:not(.deck-js) #rotate-hint{display:none!important}';
|
|
25350
|
+
(document.head || root).appendChild(css);
|
|
25351
|
+
|
|
25352
|
+
// Shared with the shell's chrome CSS (deckPhoneChromeCss), so the slide only fills
|
|
25353
|
+
// the width where the shell has also moved Download and the badge out of its way.
|
|
25354
|
+
var PHONE_MAX_H = __AGT_MAX_H__, PHONE_MIN_W = __AGT_MIN_W__;
|
|
25355
|
+
var stageZoom0 = stage.style.zoom;
|
|
25356
|
+
var lastSlide = -1;
|
|
25357
|
+
|
|
25358
|
+
function activeIndex() {
|
|
25359
|
+
var s = stage.querySelectorAll('.slide');
|
|
25360
|
+
for (var i = 0; i < s.length; i++) if (s[i].classList.contains('is-active')) return i;
|
|
25361
|
+
return -1;
|
|
25362
|
+
}
|
|
25363
|
+
|
|
25364
|
+
function fitDeck() {
|
|
25365
|
+
var w = innerWidth, h = innerHeight;
|
|
25366
|
+
// The canvas is whatever the deck declares (1280x720 in the skeleton, but a deck
|
|
25367
|
+
// may set its own), read from layout: transform does not change offsetWidth.
|
|
25368
|
+
stage.style.zoom = stageZoom0;
|
|
25369
|
+
var cw = stage.offsetWidth || 1280, ch = stage.offsetHeight || 720;
|
|
25370
|
+
// Height binds when the window is wider than the canvas. On a phone in landscape
|
|
25371
|
+
// that left a third of the screen empty; fill the width and scroll instead.
|
|
25372
|
+
var fill = w / h > cw / ch && h <= PHONE_MAX_H && w >= PHONE_MIN_W;
|
|
25373
|
+
root.classList.toggle('agt-fill', fill);
|
|
25374
|
+
// Scale to the width the page actually lays out in. innerWidth includes a classic
|
|
25375
|
+
// (non-overlay) scrollbar, and fill mode always scrolls, so on a short desktop
|
|
25376
|
+
// window that would push the slide's right edge under overflow-x:hidden. Read after
|
|
25377
|
+
// the class is on, so the scrollbar it turns on is already taken out.
|
|
25378
|
+
if (fill) stage.style.zoom = (root.clientWidth || w) / cw;
|
|
25379
|
+
var a = activeIndex();
|
|
25380
|
+
if (fill && a !== lastSlide) scrollTo(0, 0);
|
|
25381
|
+
lastSlide = a;
|
|
25382
|
+
}
|
|
25383
|
+
|
|
25384
|
+
// Narrow (portrait) mode stacks the slides as a page, but a slide authored for
|
|
25385
|
+
// 1280px still carries blocks that do not fit 390px, and they were clipped at the
|
|
25386
|
+
// right edge. In order, least destructive first: a multi-column grid becomes one
|
|
25387
|
+
// column, unwrappable text wraps, and only what still overflows (a cover canvas,
|
|
25388
|
+
// a diagram drawn at a fixed size) is scaled down to fit.
|
|
25389
|
+
var MARK = 'data-agt-fit';
|
|
25390
|
+
// Every inline value the narrow pass overwrites is recorded first and put back on
|
|
25391
|
+
// undo. Clearing to '' instead would wipe a deck's own inline layout (a
|
|
25392
|
+
// style="grid-template-columns:..." slide) the first time the phone rotated.
|
|
25393
|
+
var touched = [];
|
|
25394
|
+
function put(el, prop, val, mark) {
|
|
25395
|
+
touched.push([el, prop, el.style[prop]]);
|
|
25396
|
+
el.style[prop] = val;
|
|
25397
|
+
// Never downgrade a 'zoom' mark (Obi Wan 9a6ba37489c2): a zoomed block that is also
|
|
25398
|
+
// a grid child getting 'col' would lose the closest('[data-agt-fit="zoom"]')
|
|
25399
|
+
// exclusion, and passes 3 and 4 could wrap or zoom inside it again (a double scale).
|
|
25400
|
+
if (el.getAttribute(MARK) !== 'zoom') el.setAttribute(MARK, mark);
|
|
25401
|
+
}
|
|
25402
|
+
function undoNarrow() {
|
|
25403
|
+
for (var i = touched.length - 1; i >= 0; i--) {
|
|
25404
|
+
touched[i][0].style[touched[i][1]] = touched[i][2];
|
|
25405
|
+
touched[i][0].removeAttribute(MARK);
|
|
25406
|
+
}
|
|
25407
|
+
touched = [];
|
|
25408
|
+
}
|
|
25409
|
+
function overflowing(el, limit) {
|
|
25410
|
+
var r = el.getBoundingClientRect();
|
|
25411
|
+
return r.width > 0 && r.right > limit + 1;
|
|
25412
|
+
}
|
|
25413
|
+
function fitNarrow() {
|
|
25414
|
+
undoNarrow();
|
|
25415
|
+
var slides = stage.querySelectorAll('.slide');
|
|
25416
|
+
for (var j = 0; j < slides.length; j++) {
|
|
25417
|
+
var sl = slides[j], limit = sl.getBoundingClientRect().right;
|
|
25418
|
+
var all = sl.querySelectorAll('*'), k, el, cs;
|
|
25419
|
+
var padR = parseFloat(getComputedStyle(sl).paddingRight) || 0;
|
|
25420
|
+
// A block drawn at a fixed width wider than the column (a cover canvas) is a
|
|
25421
|
+
// picture, not a layout: scale it whole first, and never reflow inside it.
|
|
25422
|
+
for (k = 0; k < all.length; k++) {
|
|
25423
|
+
el = all[k];
|
|
25424
|
+
if (el.closest('[' + MARK + '="zoom"]')) continue;
|
|
25425
|
+
cs = getComputedStyle(el);
|
|
25426
|
+
var fixedW = parseFloat(cs.width);
|
|
25427
|
+
var rr = el.getBoundingClientRect(), room = limit - padR - rr.left;
|
|
25428
|
+
if (/px$/.test(el.style.width || '') || (cs.display !== 'grid' && fixedW > room + 1 && room > 40 && el.children.length > 0 && overflowing(el, limit) && fixedW >= 600)) {
|
|
25429
|
+
if (!overflowing(el, limit) || room <= 40) continue;
|
|
25430
|
+
put(el, 'zoom', Math.max(0.2, room / rr.width), 'zoom');
|
|
25431
|
+
// The slide keeps its full-screen min-height; shrink it to the scaled
|
|
25432
|
+
// picture so there is no empty screen under it. Never below the picture.
|
|
25433
|
+
var sr = sl.getBoundingClientRect(), er = el.getBoundingClientRect();
|
|
25434
|
+
var need = Math.ceil(er.bottom - sr.top + (parseFloat(getComputedStyle(sl).paddingBottom) || 0));
|
|
25435
|
+
if (need > 80 && need < sr.height) put(sl, 'minHeight', need + 'px', 'slide');
|
|
25436
|
+
}
|
|
25437
|
+
}
|
|
25438
|
+
for (k = 0; k < all.length; k++) {
|
|
25439
|
+
el = all[k];
|
|
25440
|
+
if (el.closest('[' + MARK + '="zoom"]')) continue;
|
|
25441
|
+
cs = getComputedStyle(el);
|
|
25442
|
+
if ((cs.display === 'grid' || cs.display === 'inline-grid') && cs.gridTemplateColumns.split(' ').length > 1 &&
|
|
25443
|
+
(el.scrollWidth > el.clientWidth + 1 || overflowing(el, limit))) {
|
|
25444
|
+
// A cell whose content is absolutely positioned took its height from the
|
|
25445
|
+
// row it shared; keep that height, or its drawing collapses on itself.
|
|
25446
|
+
var keep = [];
|
|
25447
|
+
for (var q = 0; q < el.children.length; q++) {
|
|
25448
|
+
var ch = el.children[q], abs = false, ds = ch.querySelectorAll('*');
|
|
25449
|
+
for (var z = 0; z < ds.length && !abs; z++) abs = getComputedStyle(ds[z]).position === 'absolute';
|
|
25450
|
+
keep.push(abs ? ch.getBoundingClientRect().height : 0);
|
|
25451
|
+
}
|
|
25452
|
+
put(el, 'gridTemplateColumns', 'minmax(0,1fr)', 'reflow');
|
|
25453
|
+
for (q = 0; q < el.children.length; q++) {
|
|
25454
|
+
if (keep[q] > 0 && el.children[q].getBoundingClientRect().height < keep[q] - 1) {
|
|
25455
|
+
put(el.children[q], 'minHeight', Math.round(keep[q]) + 'px', 'keep');
|
|
25456
|
+
}
|
|
25457
|
+
}
|
|
25458
|
+
for (var c = 0; c < el.children.length; c++) {
|
|
25459
|
+
if (getComputedStyle(el.children[c]).gridColumnStart !== 'auto') put(el.children[c], 'gridColumn', 'auto', 'col');
|
|
25460
|
+
}
|
|
25461
|
+
} else if (cs.display.indexOf('flex') > -1 && cs.flexDirection.indexOf('row') === 0 && cs.flexWrap === 'nowrap' &&
|
|
25462
|
+
el.children.length > 1 && overflowing(el.lastElementChild || el, limit)) {
|
|
25463
|
+
put(el, 'flexWrap', 'wrap', 'wrap');
|
|
25464
|
+
}
|
|
25465
|
+
}
|
|
25466
|
+
for (k = 0; k < all.length; k++) {
|
|
25467
|
+
el = all[k];
|
|
25468
|
+
if (el.closest('[' + MARK + '="zoom"]')) continue;
|
|
25469
|
+
if (el.children.length === 0 && overflowing(el, limit) && getComputedStyle(el).whiteSpace.indexOf('nowrap') > -1) {
|
|
25470
|
+
put(el, 'whiteSpace', 'normal', 'text');
|
|
25471
|
+
}
|
|
25472
|
+
}
|
|
25473
|
+
for (k = 0; k < all.length; k++) {
|
|
25474
|
+
el = all[k];
|
|
25475
|
+
if (el.closest('[' + MARK + '="zoom"]')) continue;
|
|
25476
|
+
if (!overflowing(el, limit)) continue;
|
|
25477
|
+
var r = el.getBoundingClientRect(), avail = limit - padR - r.left;
|
|
25478
|
+
if (avail <= 40) continue;
|
|
25479
|
+
put(el, 'zoom', Math.max(0.2, avail / r.width), 'zoom');
|
|
25480
|
+
}
|
|
25481
|
+
}
|
|
25482
|
+
}
|
|
25483
|
+
|
|
25484
|
+
// Obi Wan 73a833f8f833: the narrow (stacked) layout depends on WIDTH only, but iOS
|
|
25485
|
+
// fires resize and visualViewport resize as its toolbars collapse during an ordinary
|
|
25486
|
+
// scroll, changing only the height. Re-running fitNarrow there would revert and
|
|
25487
|
+
// re-measure every slide mid-scroll and could make the page jump. So a narrow re-fit
|
|
25488
|
+
// runs only when the width changed, when leaving deck mode, or on load (content sizes).
|
|
25489
|
+
var narrowW = -1;
|
|
25490
|
+
function apply() {
|
|
25491
|
+
try {
|
|
25492
|
+
if (root.classList.contains('deck-js')) {
|
|
25493
|
+
narrowW = -1;
|
|
25494
|
+
undoNarrow();
|
|
25495
|
+
fitDeck();
|
|
25496
|
+
} else {
|
|
25497
|
+
root.classList.remove('agt-fill');
|
|
25498
|
+
stage.style.zoom = stageZoom0;
|
|
25499
|
+
var nw = root.clientWidth || innerWidth;
|
|
25500
|
+
if (nw === narrowW) return;
|
|
25501
|
+
fitNarrow();
|
|
25502
|
+
narrowW = nw;
|
|
25503
|
+
}
|
|
25504
|
+
} catch (e) {
|
|
25505
|
+
// Never break the deck over a fit problem, but leave a trace (and a hook for
|
|
25506
|
+
// tests) rather than swallowing it.
|
|
25507
|
+
window.__agtDeckFitError = String((e && e.message) || e);
|
|
25508
|
+
}
|
|
25509
|
+
}
|
|
25510
|
+
|
|
25511
|
+
var t = 0;
|
|
25512
|
+
function later() {
|
|
25513
|
+
apply();
|
|
25514
|
+
// iOS reports the new size a beat after resize/orientationchange fires.
|
|
25515
|
+
clearTimeout(t);
|
|
25516
|
+
t = setTimeout(apply, 250);
|
|
25517
|
+
if (window.requestAnimationFrame) requestAnimationFrame(apply);
|
|
25518
|
+
}
|
|
25519
|
+
addEventListener('resize', later);
|
|
25520
|
+
addEventListener('orientationchange', later);
|
|
25521
|
+
// Load can change content sizes (images) at the same width, so it always re-fits.
|
|
25522
|
+
addEventListener('load', function () { narrowW = -1; later(); });
|
|
25523
|
+
if (window.visualViewport) visualViewport.addEventListener('resize', later);
|
|
25524
|
+
// Slide changes: keep fill mode scrolled to the top of the new slide.
|
|
25525
|
+
try { new MutationObserver(function () { if (root.classList.contains('agt-fill')) fitDeck(); })
|
|
25526
|
+
.observe(stage, { subtree: true, attributes: true, attributeFilter: ['class'] }); } catch (e) {}
|
|
25527
|
+
later();
|
|
25528
|
+
})();`;
|
|
25529
|
+
var DECK_PHONE_FIT_SOURCE = FIXER.replace("__AGT_MAX_H__", String(DECK_PHONE_FILL_MAX_HEIGHT_PX)).replace("__AGT_MIN_W__", String(DECK_PHONE_FILL_MIN_WIDTH_PX));
|
|
25530
|
+
var DECK_PHONE_FIT_SCRIPT = '<script id="agt-deck-phone-fit-js">' + DECK_PHONE_FIT_SOURCE + "</script>";
|
|
25531
|
+
|
|
25322
25532
|
// ../core/dist/integrations/augmented-live/live-hosts.js
|
|
25323
25533
|
function linkOpenerScript(frameId) {
|
|
25324
25534
|
return 'function alOpenBar(u){var o=document.getElementById("al-open");if(o)o.parentNode.removeChild(o);var b=document.createElement("div");b.id="al-open";b.setAttribute("role","status");b.appendChild(document.createTextNode("Open link to "));var a=document.createElement("a");a.href=u.href;a.target="_blank";a.rel="noopener noreferrer";a.textContent=u.host;a.addEventListener("click",function(){setTimeout(function(){if(b.parentNode)b.parentNode.removeChild(b);},0);});b.appendChild(a);var x=document.createElement("button");x.type="button";x.setAttribute("aria-label","Dismiss");x.textContent="\xD7";x.addEventListener("click",function(){if(b.parentNode)b.parentNode.removeChild(b);});b.appendChild(x);document.body.appendChild(b);}window.addEventListener("message",function(e){var f=document.getElementById(' + JSON.stringify(frameId) + ');if(!f||e.source!==f.contentWindow||e.origin!=="null")return;var d=e.data;if(!d||d.type!=="al-open"||typeof d.url!=="string")return;var u;try{u=new URL(d.url);}catch(x){return;}if(u.protocol!=="https:"||u.username||u.password)return;var w=window.open(u.href,"_blank");if(w){try{w.opener=null;}catch(x){}}else{alOpenBar(u);}});';
|
|
@@ -25381,6 +25591,8 @@ var DOWNLOAD_MOBILE_MIN_HEIGHT_PX = 44;
|
|
|
25381
25591
|
var DECK_ATTRIBUTION_NARROW_BOTTOM_PX = DOWNLOAD_BOTTOM_PX + DOWNLOAD_MOBILE_MIN_HEIGHT_PX + DECK_CHROME_GAP_PX;
|
|
25382
25592
|
var VISIBILITY_BOTTOM_PX = DOWNLOAD_BOTTOM_PX + DOWNLOAD_MOBILE_MIN_HEIGHT_PX + DECK_CHROME_GAP_PX;
|
|
25383
25593
|
var DECK_ATTRIBUTION_NARROW_WITH_VISIBILITY_BOTTOM_PX = VISIBILITY_BOTTOM_PX + DOWNLOAD_MOBILE_MIN_HEIGHT_PX + DECK_CHROME_GAP_PX;
|
|
25594
|
+
var DECK_PRINT_BUTTON_W_PX = 72;
|
|
25595
|
+
var DECK_PHONE_DOWNLOAD_BESIDE_PRINT_LEFT_PX = 16 + DECK_PRINT_BUTTON_W_PX + DECK_CHROME_GAP_PX;
|
|
25384
25596
|
|
|
25385
25597
|
// ../core/dist/integrations/augmented-live/codec.js
|
|
25386
25598
|
var DEFAULT_CHUNK_BUDGET_BYTES = 180 * 1024;
|
package/dist/mcp/origami.js
CHANGED
|
@@ -39380,6 +39380,216 @@ var MARKUP_BRIDGE_SCRIPT = `<script>(function(){
|
|
|
39380
39380
|
});
|
|
39381
39381
|
})();</script>`;
|
|
39382
39382
|
|
|
39383
|
+
// ../core/dist/integrations/augmented-live/deck-phone-fit.js
|
|
39384
|
+
var DECK_PHONE_FILL_MAX_HEIGHT_PX = 500;
|
|
39385
|
+
var DECK_PHONE_FILL_MIN_WIDTH_PX = 560;
|
|
39386
|
+
var FIXER = String.raw`(function () {
|
|
39387
|
+
// ENG-8819: phone fit for Ninja Canvas slide decks, injected by the viewer shell so it
|
|
39388
|
+
// reaches decks that are already published. Acts only on a deck (a #stage holding
|
|
39389
|
+
// .slide elements); every other page is left alone.
|
|
39390
|
+
var stage = document.getElementById('stage');
|
|
39391
|
+
if (!stage || !stage.querySelector('.slide')) return;
|
|
39392
|
+
var root = document.documentElement;
|
|
39393
|
+
var css = document.createElement('style');
|
|
39394
|
+
css.id = 'agt-deck-phone-fit';
|
|
39395
|
+
css.textContent =
|
|
39396
|
+
// The stage is a flex item in deck mode. Without this it shrinks to the viewport
|
|
39397
|
+
// width before it is scaled, so a phone in landscape got a narrow, clipped slide.
|
|
39398
|
+
'html.deck-js #stage{flex-shrink:0}' +
|
|
39399
|
+
// Fill-width mode (short landscape screens): the slide is wider than tall enough
|
|
39400
|
+
// to fit, so let the page scroll vertically instead of letterboxing it.
|
|
39401
|
+
'html.deck-js.agt-fill,html.deck-js.agt-fill body{height:auto;min-height:100%;overflow-x:hidden;overflow-y:auto}' +
|
|
39402
|
+
'html.deck-js.agt-fill body{display:block}' +
|
|
39403
|
+
'html.deck-js.agt-fill #stage{transform:none!important;transform-origin:0 0}' +
|
|
39404
|
+
// Room to scroll the end of the page clear of the viewer chrome fixed along the
|
|
39405
|
+
// bottom edge (the HUD row in landscape; Download and the badge in portrait).
|
|
39406
|
+
'html.deck-js.agt-fill body{padding-bottom:76px}' +
|
|
39407
|
+
'html:not(.deck-js) body{padding-bottom:124px}' +
|
|
39408
|
+
// Portrait reads as a scrolling page, so the rotate prompt is not needed (and sat on
|
|
39409
|
+
// top of the viewer Download button).
|
|
39410
|
+
'html:not(.deck-js) #rotate-hint{display:none!important}';
|
|
39411
|
+
(document.head || root).appendChild(css);
|
|
39412
|
+
|
|
39413
|
+
// Shared with the shell's chrome CSS (deckPhoneChromeCss), so the slide only fills
|
|
39414
|
+
// the width where the shell has also moved Download and the badge out of its way.
|
|
39415
|
+
var PHONE_MAX_H = __AGT_MAX_H__, PHONE_MIN_W = __AGT_MIN_W__;
|
|
39416
|
+
var stageZoom0 = stage.style.zoom;
|
|
39417
|
+
var lastSlide = -1;
|
|
39418
|
+
|
|
39419
|
+
function activeIndex() {
|
|
39420
|
+
var s = stage.querySelectorAll('.slide');
|
|
39421
|
+
for (var i = 0; i < s.length; i++) if (s[i].classList.contains('is-active')) return i;
|
|
39422
|
+
return -1;
|
|
39423
|
+
}
|
|
39424
|
+
|
|
39425
|
+
function fitDeck() {
|
|
39426
|
+
var w = innerWidth, h = innerHeight;
|
|
39427
|
+
// The canvas is whatever the deck declares (1280x720 in the skeleton, but a deck
|
|
39428
|
+
// may set its own), read from layout: transform does not change offsetWidth.
|
|
39429
|
+
stage.style.zoom = stageZoom0;
|
|
39430
|
+
var cw = stage.offsetWidth || 1280, ch = stage.offsetHeight || 720;
|
|
39431
|
+
// Height binds when the window is wider than the canvas. On a phone in landscape
|
|
39432
|
+
// that left a third of the screen empty; fill the width and scroll instead.
|
|
39433
|
+
var fill = w / h > cw / ch && h <= PHONE_MAX_H && w >= PHONE_MIN_W;
|
|
39434
|
+
root.classList.toggle('agt-fill', fill);
|
|
39435
|
+
// Scale to the width the page actually lays out in. innerWidth includes a classic
|
|
39436
|
+
// (non-overlay) scrollbar, and fill mode always scrolls, so on a short desktop
|
|
39437
|
+
// window that would push the slide's right edge under overflow-x:hidden. Read after
|
|
39438
|
+
// the class is on, so the scrollbar it turns on is already taken out.
|
|
39439
|
+
if (fill) stage.style.zoom = (root.clientWidth || w) / cw;
|
|
39440
|
+
var a = activeIndex();
|
|
39441
|
+
if (fill && a !== lastSlide) scrollTo(0, 0);
|
|
39442
|
+
lastSlide = a;
|
|
39443
|
+
}
|
|
39444
|
+
|
|
39445
|
+
// Narrow (portrait) mode stacks the slides as a page, but a slide authored for
|
|
39446
|
+
// 1280px still carries blocks that do not fit 390px, and they were clipped at the
|
|
39447
|
+
// right edge. In order, least destructive first: a multi-column grid becomes one
|
|
39448
|
+
// column, unwrappable text wraps, and only what still overflows (a cover canvas,
|
|
39449
|
+
// a diagram drawn at a fixed size) is scaled down to fit.
|
|
39450
|
+
var MARK = 'data-agt-fit';
|
|
39451
|
+
// Every inline value the narrow pass overwrites is recorded first and put back on
|
|
39452
|
+
// undo. Clearing to '' instead would wipe a deck's own inline layout (a
|
|
39453
|
+
// style="grid-template-columns:..." slide) the first time the phone rotated.
|
|
39454
|
+
var touched = [];
|
|
39455
|
+
function put(el, prop, val, mark) {
|
|
39456
|
+
touched.push([el, prop, el.style[prop]]);
|
|
39457
|
+
el.style[prop] = val;
|
|
39458
|
+
// Never downgrade a 'zoom' mark (Obi Wan 9a6ba37489c2): a zoomed block that is also
|
|
39459
|
+
// a grid child getting 'col' would lose the closest('[data-agt-fit="zoom"]')
|
|
39460
|
+
// exclusion, and passes 3 and 4 could wrap or zoom inside it again (a double scale).
|
|
39461
|
+
if (el.getAttribute(MARK) !== 'zoom') el.setAttribute(MARK, mark);
|
|
39462
|
+
}
|
|
39463
|
+
function undoNarrow() {
|
|
39464
|
+
for (var i = touched.length - 1; i >= 0; i--) {
|
|
39465
|
+
touched[i][0].style[touched[i][1]] = touched[i][2];
|
|
39466
|
+
touched[i][0].removeAttribute(MARK);
|
|
39467
|
+
}
|
|
39468
|
+
touched = [];
|
|
39469
|
+
}
|
|
39470
|
+
function overflowing(el, limit) {
|
|
39471
|
+
var r = el.getBoundingClientRect();
|
|
39472
|
+
return r.width > 0 && r.right > limit + 1;
|
|
39473
|
+
}
|
|
39474
|
+
function fitNarrow() {
|
|
39475
|
+
undoNarrow();
|
|
39476
|
+
var slides = stage.querySelectorAll('.slide');
|
|
39477
|
+
for (var j = 0; j < slides.length; j++) {
|
|
39478
|
+
var sl = slides[j], limit = sl.getBoundingClientRect().right;
|
|
39479
|
+
var all = sl.querySelectorAll('*'), k, el, cs;
|
|
39480
|
+
var padR = parseFloat(getComputedStyle(sl).paddingRight) || 0;
|
|
39481
|
+
// A block drawn at a fixed width wider than the column (a cover canvas) is a
|
|
39482
|
+
// picture, not a layout: scale it whole first, and never reflow inside it.
|
|
39483
|
+
for (k = 0; k < all.length; k++) {
|
|
39484
|
+
el = all[k];
|
|
39485
|
+
if (el.closest('[' + MARK + '="zoom"]')) continue;
|
|
39486
|
+
cs = getComputedStyle(el);
|
|
39487
|
+
var fixedW = parseFloat(cs.width);
|
|
39488
|
+
var rr = el.getBoundingClientRect(), room = limit - padR - rr.left;
|
|
39489
|
+
if (/px$/.test(el.style.width || '') || (cs.display !== 'grid' && fixedW > room + 1 && room > 40 && el.children.length > 0 && overflowing(el, limit) && fixedW >= 600)) {
|
|
39490
|
+
if (!overflowing(el, limit) || room <= 40) continue;
|
|
39491
|
+
put(el, 'zoom', Math.max(0.2, room / rr.width), 'zoom');
|
|
39492
|
+
// The slide keeps its full-screen min-height; shrink it to the scaled
|
|
39493
|
+
// picture so there is no empty screen under it. Never below the picture.
|
|
39494
|
+
var sr = sl.getBoundingClientRect(), er = el.getBoundingClientRect();
|
|
39495
|
+
var need = Math.ceil(er.bottom - sr.top + (parseFloat(getComputedStyle(sl).paddingBottom) || 0));
|
|
39496
|
+
if (need > 80 && need < sr.height) put(sl, 'minHeight', need + 'px', 'slide');
|
|
39497
|
+
}
|
|
39498
|
+
}
|
|
39499
|
+
for (k = 0; k < all.length; k++) {
|
|
39500
|
+
el = all[k];
|
|
39501
|
+
if (el.closest('[' + MARK + '="zoom"]')) continue;
|
|
39502
|
+
cs = getComputedStyle(el);
|
|
39503
|
+
if ((cs.display === 'grid' || cs.display === 'inline-grid') && cs.gridTemplateColumns.split(' ').length > 1 &&
|
|
39504
|
+
(el.scrollWidth > el.clientWidth + 1 || overflowing(el, limit))) {
|
|
39505
|
+
// A cell whose content is absolutely positioned took its height from the
|
|
39506
|
+
// row it shared; keep that height, or its drawing collapses on itself.
|
|
39507
|
+
var keep = [];
|
|
39508
|
+
for (var q = 0; q < el.children.length; q++) {
|
|
39509
|
+
var ch = el.children[q], abs = false, ds = ch.querySelectorAll('*');
|
|
39510
|
+
for (var z = 0; z < ds.length && !abs; z++) abs = getComputedStyle(ds[z]).position === 'absolute';
|
|
39511
|
+
keep.push(abs ? ch.getBoundingClientRect().height : 0);
|
|
39512
|
+
}
|
|
39513
|
+
put(el, 'gridTemplateColumns', 'minmax(0,1fr)', 'reflow');
|
|
39514
|
+
for (q = 0; q < el.children.length; q++) {
|
|
39515
|
+
if (keep[q] > 0 && el.children[q].getBoundingClientRect().height < keep[q] - 1) {
|
|
39516
|
+
put(el.children[q], 'minHeight', Math.round(keep[q]) + 'px', 'keep');
|
|
39517
|
+
}
|
|
39518
|
+
}
|
|
39519
|
+
for (var c = 0; c < el.children.length; c++) {
|
|
39520
|
+
if (getComputedStyle(el.children[c]).gridColumnStart !== 'auto') put(el.children[c], 'gridColumn', 'auto', 'col');
|
|
39521
|
+
}
|
|
39522
|
+
} else if (cs.display.indexOf('flex') > -1 && cs.flexDirection.indexOf('row') === 0 && cs.flexWrap === 'nowrap' &&
|
|
39523
|
+
el.children.length > 1 && overflowing(el.lastElementChild || el, limit)) {
|
|
39524
|
+
put(el, 'flexWrap', 'wrap', 'wrap');
|
|
39525
|
+
}
|
|
39526
|
+
}
|
|
39527
|
+
for (k = 0; k < all.length; k++) {
|
|
39528
|
+
el = all[k];
|
|
39529
|
+
if (el.closest('[' + MARK + '="zoom"]')) continue;
|
|
39530
|
+
if (el.children.length === 0 && overflowing(el, limit) && getComputedStyle(el).whiteSpace.indexOf('nowrap') > -1) {
|
|
39531
|
+
put(el, 'whiteSpace', 'normal', 'text');
|
|
39532
|
+
}
|
|
39533
|
+
}
|
|
39534
|
+
for (k = 0; k < all.length; k++) {
|
|
39535
|
+
el = all[k];
|
|
39536
|
+
if (el.closest('[' + MARK + '="zoom"]')) continue;
|
|
39537
|
+
if (!overflowing(el, limit)) continue;
|
|
39538
|
+
var r = el.getBoundingClientRect(), avail = limit - padR - r.left;
|
|
39539
|
+
if (avail <= 40) continue;
|
|
39540
|
+
put(el, 'zoom', Math.max(0.2, avail / r.width), 'zoom');
|
|
39541
|
+
}
|
|
39542
|
+
}
|
|
39543
|
+
}
|
|
39544
|
+
|
|
39545
|
+
// Obi Wan 73a833f8f833: the narrow (stacked) layout depends on WIDTH only, but iOS
|
|
39546
|
+
// fires resize and visualViewport resize as its toolbars collapse during an ordinary
|
|
39547
|
+
// scroll, changing only the height. Re-running fitNarrow there would revert and
|
|
39548
|
+
// re-measure every slide mid-scroll and could make the page jump. So a narrow re-fit
|
|
39549
|
+
// runs only when the width changed, when leaving deck mode, or on load (content sizes).
|
|
39550
|
+
var narrowW = -1;
|
|
39551
|
+
function apply() {
|
|
39552
|
+
try {
|
|
39553
|
+
if (root.classList.contains('deck-js')) {
|
|
39554
|
+
narrowW = -1;
|
|
39555
|
+
undoNarrow();
|
|
39556
|
+
fitDeck();
|
|
39557
|
+
} else {
|
|
39558
|
+
root.classList.remove('agt-fill');
|
|
39559
|
+
stage.style.zoom = stageZoom0;
|
|
39560
|
+
var nw = root.clientWidth || innerWidth;
|
|
39561
|
+
if (nw === narrowW) return;
|
|
39562
|
+
fitNarrow();
|
|
39563
|
+
narrowW = nw;
|
|
39564
|
+
}
|
|
39565
|
+
} catch (e) {
|
|
39566
|
+
// Never break the deck over a fit problem, but leave a trace (and a hook for
|
|
39567
|
+
// tests) rather than swallowing it.
|
|
39568
|
+
window.__agtDeckFitError = String((e && e.message) || e);
|
|
39569
|
+
}
|
|
39570
|
+
}
|
|
39571
|
+
|
|
39572
|
+
var t = 0;
|
|
39573
|
+
function later() {
|
|
39574
|
+
apply();
|
|
39575
|
+
// iOS reports the new size a beat after resize/orientationchange fires.
|
|
39576
|
+
clearTimeout(t);
|
|
39577
|
+
t = setTimeout(apply, 250);
|
|
39578
|
+
if (window.requestAnimationFrame) requestAnimationFrame(apply);
|
|
39579
|
+
}
|
|
39580
|
+
addEventListener('resize', later);
|
|
39581
|
+
addEventListener('orientationchange', later);
|
|
39582
|
+
// Load can change content sizes (images) at the same width, so it always re-fits.
|
|
39583
|
+
addEventListener('load', function () { narrowW = -1; later(); });
|
|
39584
|
+
if (window.visualViewport) visualViewport.addEventListener('resize', later);
|
|
39585
|
+
// Slide changes: keep fill mode scrolled to the top of the new slide.
|
|
39586
|
+
try { new MutationObserver(function () { if (root.classList.contains('agt-fill')) fitDeck(); })
|
|
39587
|
+
.observe(stage, { subtree: true, attributes: true, attributeFilter: ['class'] }); } catch (e) {}
|
|
39588
|
+
later();
|
|
39589
|
+
})();`;
|
|
39590
|
+
var DECK_PHONE_FIT_SOURCE = FIXER.replace("__AGT_MAX_H__", String(DECK_PHONE_FILL_MAX_HEIGHT_PX)).replace("__AGT_MIN_W__", String(DECK_PHONE_FILL_MIN_WIDTH_PX));
|
|
39591
|
+
var DECK_PHONE_FIT_SCRIPT = '<script id="agt-deck-phone-fit-js">' + DECK_PHONE_FIT_SOURCE + "</script>";
|
|
39592
|
+
|
|
39383
39593
|
// ../core/dist/integrations/augmented-live/live-hosts.js
|
|
39384
39594
|
function linkOpenerScript(frameId) {
|
|
39385
39595
|
return 'function alOpenBar(u){var o=document.getElementById("al-open");if(o)o.parentNode.removeChild(o);var b=document.createElement("div");b.id="al-open";b.setAttribute("role","status");b.appendChild(document.createTextNode("Open link to "));var a=document.createElement("a");a.href=u.href;a.target="_blank";a.rel="noopener noreferrer";a.textContent=u.host;a.addEventListener("click",function(){setTimeout(function(){if(b.parentNode)b.parentNode.removeChild(b);},0);});b.appendChild(a);var x=document.createElement("button");x.type="button";x.setAttribute("aria-label","Dismiss");x.textContent="\xD7";x.addEventListener("click",function(){if(b.parentNode)b.parentNode.removeChild(b);});b.appendChild(x);document.body.appendChild(b);}window.addEventListener("message",function(e){var f=document.getElementById(' + JSON.stringify(frameId) + ');if(!f||e.source!==f.contentWindow||e.origin!=="null")return;var d=e.data;if(!d||d.type!=="al-open"||typeof d.url!=="string")return;var u;try{u=new URL(d.url);}catch(x){return;}if(u.protocol!=="https:"||u.username||u.password)return;var w=window.open(u.href,"_blank");if(w){try{w.opener=null;}catch(x){}}else{alOpenBar(u);}});';
|
|
@@ -39442,6 +39652,8 @@ var DOWNLOAD_MOBILE_MIN_HEIGHT_PX = 44;
|
|
|
39442
39652
|
var DECK_ATTRIBUTION_NARROW_BOTTOM_PX = DOWNLOAD_BOTTOM_PX + DOWNLOAD_MOBILE_MIN_HEIGHT_PX + DECK_CHROME_GAP_PX;
|
|
39443
39653
|
var VISIBILITY_BOTTOM_PX = DOWNLOAD_BOTTOM_PX + DOWNLOAD_MOBILE_MIN_HEIGHT_PX + DECK_CHROME_GAP_PX;
|
|
39444
39654
|
var DECK_ATTRIBUTION_NARROW_WITH_VISIBILITY_BOTTOM_PX = VISIBILITY_BOTTOM_PX + DOWNLOAD_MOBILE_MIN_HEIGHT_PX + DECK_CHROME_GAP_PX;
|
|
39655
|
+
var DECK_PRINT_BUTTON_W_PX = 72;
|
|
39656
|
+
var DECK_PHONE_DOWNLOAD_BESIDE_PRINT_LEFT_PX = 16 + DECK_PRINT_BUTTON_W_PX + DECK_CHROME_GAP_PX;
|
|
39445
39657
|
|
|
39446
39658
|
// ../core/dist/integrations/augmented-live/codec.js
|
|
39447
39659
|
var DEFAULT_CHUNK_BUDGET_BYTES = 180 * 1024;
|