react-grab 0.0.30 → 0.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +9 -60
- package/dist/index.global.js +16 -29
- package/dist/index.js +9 -60
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var web = require('solid-js/web');
|
|
4
4
|
var solidJs = require('solid-js');
|
|
5
|
-
var modernScreenshot = require('modern-screenshot');
|
|
6
5
|
var bippy = require('bippy');
|
|
7
6
|
var source = require('bippy/dist/source');
|
|
8
7
|
var finder = require('@medv/finder');
|
|
@@ -1163,7 +1162,6 @@ var createElementBounds = (element) => {
|
|
|
1163
1162
|
|
|
1164
1163
|
// src/core.tsx
|
|
1165
1164
|
var PROGRESS_INDICATOR_DELAY_MS = 150;
|
|
1166
|
-
var QUICK_REPRESS_THRESHOLD_MS = 150;
|
|
1167
1165
|
var init = (rawOptions) => {
|
|
1168
1166
|
const options = {
|
|
1169
1167
|
enabled: true,
|
|
@@ -1190,14 +1188,12 @@ var init = (rawOptions) => {
|
|
|
1190
1188
|
const [isActivated, setIsActivated] = solidJs.createSignal(false);
|
|
1191
1189
|
const [showProgressIndicator, setShowProgressIndicator] = solidJs.createSignal(false);
|
|
1192
1190
|
const [didJustDrag, setDidJustDrag] = solidJs.createSignal(false);
|
|
1193
|
-
const [isModifierHeld, setIsModifierHeld] = solidJs.createSignal(false);
|
|
1194
1191
|
const [copyStartX, setCopyStartX] = solidJs.createSignal(OFFSCREEN_POSITION);
|
|
1195
1192
|
const [copyStartY, setCopyStartY] = solidJs.createSignal(OFFSCREEN_POSITION);
|
|
1196
1193
|
let holdTimerId = null;
|
|
1197
1194
|
let progressAnimationId = null;
|
|
1198
1195
|
let progressDelayTimerId = null;
|
|
1199
1196
|
let keydownSpamTimerId = null;
|
|
1200
|
-
let lastDeactivationTime = null;
|
|
1201
1197
|
const isRendererActive = solidJs.createMemo(() => isActivated() && !isCopying());
|
|
1202
1198
|
const hasValidMousePosition = solidJs.createMemo(() => mouseX() > OFFSCREEN_POSITION && mouseY() > OFFSCREEN_POSITION);
|
|
1203
1199
|
const isTargetKeyCombination = (event) => (event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "c";
|
|
@@ -1278,18 +1274,7 @@ ${context}
|
|
|
1278
1274
|
content,
|
|
1279
1275
|
computedStyles: extractRelevantComputedStyles(targetElement2)
|
|
1280
1276
|
}]);
|
|
1281
|
-
|
|
1282
|
-
try {
|
|
1283
|
-
const screenshotDataUrl = await modernScreenshot.domToPng(targetElement2);
|
|
1284
|
-
const response = await fetch(screenshotDataUrl);
|
|
1285
|
-
const pngBlob = await response.blob();
|
|
1286
|
-
const imagePngBlob = new Blob([pngBlob], {
|
|
1287
|
-
type: "image/png"
|
|
1288
|
-
});
|
|
1289
|
-
clipboardData.push(imagePngBlob);
|
|
1290
|
-
} catch {
|
|
1291
|
-
}
|
|
1292
|
-
await copyContent(clipboardData);
|
|
1277
|
+
await copyContent([plainTextContent, htmlContent]);
|
|
1293
1278
|
} catch {
|
|
1294
1279
|
}
|
|
1295
1280
|
showTemporarySuccessLabel(tagName ? `<${tagName}>` : "<element>", copyStartX(), copyStartY());
|
|
@@ -1309,20 +1294,7 @@ ${context}
|
|
|
1309
1294
|
computedStyles: extractRelevantComputedStyles(targetElements[index])
|
|
1310
1295
|
}));
|
|
1311
1296
|
const htmlContent = createStructuredClipboardHtmlBlob(structuredElements);
|
|
1312
|
-
|
|
1313
|
-
if (targetElements.length > 0) {
|
|
1314
|
-
try {
|
|
1315
|
-
const screenshotDataUrl = await modernScreenshot.domToPng(targetElements[0]);
|
|
1316
|
-
const response = await fetch(screenshotDataUrl);
|
|
1317
|
-
const pngBlob = await response.blob();
|
|
1318
|
-
const imagePngBlob = new Blob([pngBlob], {
|
|
1319
|
-
type: "image/png"
|
|
1320
|
-
});
|
|
1321
|
-
clipboardData.push(imagePngBlob);
|
|
1322
|
-
} catch {
|
|
1323
|
-
}
|
|
1324
|
-
}
|
|
1325
|
-
await copyContent(clipboardData);
|
|
1297
|
+
await copyContent([plainTextContent, htmlContent]);
|
|
1326
1298
|
} catch {
|
|
1327
1299
|
}
|
|
1328
1300
|
showTemporarySuccessLabel(`${targetElements.length} elements`, copyStartX(), copyStartY());
|
|
@@ -1437,12 +1409,9 @@ ${context}
|
|
|
1437
1409
|
setIsActivated(true);
|
|
1438
1410
|
document.body.style.cursor = "crosshair";
|
|
1439
1411
|
};
|
|
1440
|
-
const deactivateRenderer = (
|
|
1412
|
+
const deactivateRenderer = () => {
|
|
1441
1413
|
setIsHoldingKeys(false);
|
|
1442
1414
|
setIsActivated(false);
|
|
1443
|
-
if (shouldResetModifier) {
|
|
1444
|
-
setIsModifierHeld(false);
|
|
1445
|
-
}
|
|
1446
1415
|
document.body.style.cursor = "";
|
|
1447
1416
|
if (isDragging()) {
|
|
1448
1417
|
setIsDragging(false);
|
|
@@ -1451,38 +1420,23 @@ ${context}
|
|
|
1451
1420
|
if (holdTimerId) window.clearTimeout(holdTimerId);
|
|
1452
1421
|
if (keydownSpamTimerId) window.clearTimeout(keydownSpamTimerId);
|
|
1453
1422
|
stopProgressAnimation();
|
|
1454
|
-
lastDeactivationTime = Date.now();
|
|
1455
1423
|
};
|
|
1456
1424
|
const abortController = new AbortController();
|
|
1457
1425
|
const eventListenerSignal = abortController.signal;
|
|
1458
1426
|
window.addEventListener("keydown", (event) => {
|
|
1459
|
-
if (event.metaKey || event.ctrlKey) {
|
|
1460
|
-
setIsModifierHeld(true);
|
|
1461
|
-
}
|
|
1462
1427
|
if (event.key === "Escape" && isHoldingKeys()) {
|
|
1463
1428
|
deactivateRenderer();
|
|
1464
1429
|
return;
|
|
1465
1430
|
}
|
|
1466
1431
|
if (isKeyboardEventTriggeredByInput(event)) return;
|
|
1467
1432
|
if (isTargetKeyCombination(event)) {
|
|
1468
|
-
const wasRecentlyDeactivated = lastDeactivationTime !== null && Date.now() - lastDeactivationTime < QUICK_REPRESS_THRESHOLD_MS;
|
|
1469
1433
|
if (!isHoldingKeys()) {
|
|
1470
1434
|
setIsHoldingKeys(true);
|
|
1471
|
-
|
|
1435
|
+
startProgressAnimation();
|
|
1436
|
+
holdTimerId = window.setTimeout(() => {
|
|
1472
1437
|
activateRenderer();
|
|
1473
1438
|
options.onActivate?.();
|
|
1474
|
-
|
|
1475
|
-
if (element) {
|
|
1476
|
-
setLastGrabbedElement(element);
|
|
1477
|
-
void executeCopyOperation(mouseX(), mouseY(), () => copySingleElementToClipboard(element));
|
|
1478
|
-
}
|
|
1479
|
-
} else {
|
|
1480
|
-
startProgressAnimation();
|
|
1481
|
-
holdTimerId = window.setTimeout(() => {
|
|
1482
|
-
activateRenderer();
|
|
1483
|
-
options.onActivate?.();
|
|
1484
|
-
}, options.keyHoldDuration);
|
|
1485
|
-
}
|
|
1439
|
+
}, options.keyHoldDuration);
|
|
1486
1440
|
}
|
|
1487
1441
|
if (isActivated()) {
|
|
1488
1442
|
if (keydownSpamTimerId) window.clearTimeout(keydownSpamTimerId);
|
|
@@ -1495,16 +1449,11 @@ ${context}
|
|
|
1495
1449
|
signal: eventListenerSignal
|
|
1496
1450
|
});
|
|
1497
1451
|
window.addEventListener("keyup", (event) => {
|
|
1452
|
+
if (!isHoldingKeys() && !isActivated()) return;
|
|
1498
1453
|
const isReleasingModifier = !event.metaKey && !event.ctrlKey;
|
|
1499
1454
|
const isReleasingC = event.key.toLowerCase() === "c";
|
|
1500
|
-
if (isReleasingModifier) {
|
|
1501
|
-
|
|
1502
|
-
}
|
|
1503
|
-
if (!isHoldingKeys() && !isActivated()) return;
|
|
1504
|
-
if (isReleasingC) {
|
|
1505
|
-
deactivateRenderer(false);
|
|
1506
|
-
} else if (isReleasingModifier) {
|
|
1507
|
-
deactivateRenderer(true);
|
|
1455
|
+
if (isReleasingC || isReleasingModifier) {
|
|
1456
|
+
deactivateRenderer();
|
|
1508
1457
|
}
|
|
1509
1458
|
}, {
|
|
1510
1459
|
signal: eventListenerSignal,
|
package/dist/index.global.js
CHANGED
|
@@ -6,40 +6,27 @@ var ReactGrab=(function(exports){'use strict';/**
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
var Oo=(e,t)=>e===t;var ko=Symbol("solid-track"),pt={equals:Oo},Vn=Gn,ue=1,Xe=2,Yn={owned:null,cleanups:null,context:null,owner:null};var D=null,C=null,Me=null,U=null,Z=null,te=null,yt=0;function Ie(e,t){let n=U,r=D,o=e.length===0,s=t===void 0?r:t,a=o?Yn:{owned:null,cleanups:null,context:s?s.context:null,owner:s},i=o?e:()=>e(()=>ie(()=>Ne(a)));D=a,U=null;try{return Ce(i,!0)}finally{U=n,D=r;}}function I(e,t){t=t?Object.assign({},pt,t):pt;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),zn(n,o));return [qn.bind(n),r]}function ae(e,t,n){let r=zt(e,t,false,ue);Je(r);}function re(e,t,n){Vn=Mo;let r=zt(e,t,false,ue);(r.user=true),te?te.push(r):Je(r);}function Y(e,t,n){n=n?Object.assign({},pt,n):pt;let r=zt(e,t,true,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Je(r),qn.bind(r)}function ie(e){if(U===null)return e();let t=U;U=null;try{return Me?Me.untrack(e):e()}finally{U=t;}}function Ae(e,t,n){let r=Array.isArray(e),o;return a=>{let i;if(r){i=Array(e.length);for(let u=0;u<e.length;u++)i[u]=e[u]();}else i=e();let l=ie(()=>t(i,o,a));return o=i,l}}function Wn(e){re(()=>ie(e));}function fe(e){return D===null||(D.cleanups===null?D.cleanups=[e]:D.cleanups.push(e)),e}I(false);function qn(){let e=C;if(this.sources&&(this.state))if((this.state)===ue)Je(this);else {let t=Z;Z=null,Ce(()=>bt(this),false),Z=t;}if(U){let t=this.observers?this.observers.length:0;U.sources?(U.sources.push(this),U.sourceSlots.push(t)):(U.sources=[this],U.sourceSlots=[t]),this.observers?(this.observers.push(U),this.observerSlots.push(U.sources.length-1)):(this.observers=[U],this.observerSlots=[U.sources.length-1]);}return e&&C.sources.has(this)?this.tValue:this.value}function zn(e,t,n){let r=e.value;if(!e.comparator||!e.comparator(r,t)){e.value=t;e.observers&&e.observers.length&&Ce(()=>{for(let o=0;o<e.observers.length;o+=1){let s=e.observers[o],a=C&&C.running;a&&C.disposed.has(s)||((a?!s.tState:!s.state)&&(s.pure?Z.push(s):te.push(s),s.observers&&Xn(s)),a?s.tState=ue:s.state=ue);}if(Z.length>1e6)throw Z=[],new Error},false);}return t}function Je(e){if(!e.fn)return;Ne(e);let t=yt;Bn(e,e.value,t);}function Bn(e,t,n){let r,o=D,s=U;U=D=e;try{r=e.fn(t);}catch(a){return e.pure&&((e.state=ue,e.owned&&e.owned.forEach(Ne),e.owned=null)),e.updatedAt=n+1,Gt(a)}finally{U=s,D=o;}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?zn(e,r):e.value=r,e.updatedAt=n);}function zt(e,t,n,r=ue,o){let s={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:D,context:D?D.context:null,pure:n};if(D===null||D!==Yn&&(D.owned?D.owned.push(s):D.owned=[s]),Me);return s}function Ke(e){let t=C;if((e.state)===0)return;if((e.state)===Xe)return bt(e);if(e.suspense&&ie(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<yt);){(e.state)&&n.push(e);}for(let r=n.length-1;r>=0;r--){if(e=n[r],t);if((e.state)===ue)Je(e);else if((e.state)===Xe){let o=Z;Z=null,Ce(()=>bt(e,n[0]),false),Z=o;}}}function Ce(e,t){if(Z)return e();let n=false;t||(Z=[]),te?n=true:te=[],yt++;try{let r=e();return Po(n),r}catch(r){n||(te=null),Z=null,Gt(r);}}function Po(e){if(Z&&(Gn(Z),Z=null),e)return;let n=te;te=null,n.length&&Ce(()=>Vn(n),false);}function Gn(e){for(let t=0;t<e.length;t++)Ke(e[t]);}function Mo(e){let t,n=0;for(t=0;t<e.length;t++){let r=e[t];r.user?e[n++]=r:Ke(r);}for(t=0;t<n;t++)Ke(e[t]);}function bt(e,t){e.state=0;for(let r=0;r<e.sources.length;r+=1){let o=e.sources[r];if(o.sources){let s=o.state;s===ue?o!==t&&(!o.updatedAt||o.updatedAt<yt)&&Ke(o):s===Xe&&bt(o,t);}}}function Xn(e){for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(!r.state)&&(r.state=Xe,r.pure?Z.push(r):te.push(r),r.observers&&Xn(r));}}function Ne(e){let t;if(e.sources)for(;e.sources.length;){let n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){let s=o.pop(),a=n.observerSlots.pop();r<o.length&&(s.sourceSlots[a]=r,o[r]=s,n.observerSlots[r]=a);}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Ne(e.tOwned[t]);delete e.tOwned;}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Ne(e.owned[t]);e.owned=null;}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null;}e.state=0;}function Lo(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Gt(e,t=D){let r=Lo(e);throw r;}var Ho=Symbol("fallback");function Un(e){for(let t=0;t<e.length;t++)e[t]();}function Bo(e,t,n={}){let r=[],o=[],s=[],a=0,i=t.length>1?[]:null;return fe(()=>Un(s)),()=>{let l=e()||[],u=l.length,c,d;return l[ko],ie(()=>{let p,S,h,T,y,R,v,N,_;if(u===0)a!==0&&(Un(s),s=[],r=[],o=[],a=0,i&&(i=[])),n.fallback&&(r=[Ho],o[0]=Ie(O=>(s[0]=O,n.fallback())),a=1);else if(a===0){for(o=new Array(u),d=0;d<u;d++)r[d]=l[d],o[d]=Ie(g);a=u;}else {for(h=new Array(u),T=new Array(u),i&&(y=new Array(u)),R=0,v=Math.min(a,u);R<v&&r[R]===l[R];R++);for(v=a-1,N=u-1;v>=R&&N>=R&&r[v]===l[N];v--,N--)h[N]=o[v],T[N]=s[v],i&&(y[N]=i[v]);for(p=new Map,S=new Array(N+1),d=N;d>=R;d--)_=l[d],c=p.get(_),S[d]=c===void 0?-1:c,p.set(_,d);for(c=R;c<=v;c++)_=r[c],d=p.get(_),d!==void 0&&d!==-1?(h[d]=o[c],T[d]=s[c],i&&(y[d]=i[c]),d=S[d],p.set(_,d)):s[c]();for(d=R;d<u;d++)d in h?(o[d]=h[d],s[d]=T[d],i&&(i[d]=y[d],i[d](d))):o[d]=Ie(g);o=o.slice(0,a=u),r=l.slice(0);}return o});function g(p){if(s[d]=p,i){let[S,h]=I(d);return i[d]=h,t(l[d],S)}return t(l[d])}}}function P(e,t){return ie(()=>e(t||{}))}var Uo=e=>`Stale read from <${e}>.`;function wt(e){let t="fallback"in e&&{fallback:()=>e.fallback};return Y(Bo(()=>e.each,e.children,t||void 0))}function q(e){let t=e.keyed,n=Y(()=>e.when,void 0,void 0),r=t?n:Y(n,void 0,{equals:(o,s)=>!o==!s});return Y(()=>{let o=r();if(o){let s=e.children;return typeof s=="function"&&s.length>0?ie(()=>s(t?o:()=>{if(!ie(r))throw Uo("Show");return n()})):s}return e.fallback},void 0,void 0)}var He=e=>Y(()=>e());function Wo(e,t,n){let r=n.length,o=t.length,s=r,a=0,i=0,l=t[o-1].nextSibling,u=null;for(;a<o||i<s;){if(t[a]===n[i]){a++,i++;continue}for(;t[o-1]===n[s-1];)o--,s--;if(o===a){let c=s<r?i?n[i-1].nextSibling:n[s-i]:l;for(;i<s;)e.insertBefore(n[i++],c);}else if(s===i)for(;a<o;)(!u||!u.has(t[a]))&&t[a].remove(),a++;else if(t[a]===n[s-1]&&n[i]===t[o-1]){let c=t[--o].nextSibling;e.insertBefore(n[i++],t[a++].nextSibling),e.insertBefore(n[--s],c),t[o]=n[s];}else {if(!u){u=new Map;let d=i;for(;d<s;)u.set(n[d],d++);}let c=u.get(t[a]);if(c!=null)if(i<c&&c<s){let d=a,g=1,p;for(;++d<o&&d<s&&!((p=u.get(t[d]))==null||p!==c+g);)g++;if(g>c-i){let S=t[a];for(;i<c;)e.insertBefore(n[i++],S);}else e.replaceChild(n[i++],t[a++]);}else a++;else t[a++].remove();}}}function Jn(e,t,n,r={}){let o;return Ie(s=>{o=s,t===document?e():Te(t,e(),t.firstChild?null:void 0,n);},r.owner),()=>{o(),t.textContent="";}}function oe(e,t,n,r){let o,s=()=>{let i=document.createElement("template");return i.innerHTML=e,i.content.firstChild},a=()=>(o||(o=s())).cloneNode(true);return a.cloneNode=a,a}function qo(e,t,n){(e.removeAttribute(t));}function Ct(e,t,n){if(!t)return n?qo(e,"style"):t;let r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,s;for(s in n)t[s]==null&&r.removeProperty(s),delete n[s];for(s in t)o=t[s],o!==n[s]&&(r.setProperty(s,o),n[s]=o);return n}function be(e,t,n){n!=null?e.style.setProperty(t,n):e.style.removeProperty(t);}function _e(e,t,n){return ie(()=>e(t,n))}function Te(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return St(e,t,r,n);ae(o=>St(e,t(),o,n),r);}function St(e,t,n,r,o){for(;typeof n=="function";)n=n();if(t===n)return n;let a=typeof t,i=r!==void 0;if(e=i&&n[0]&&n[0].parentNode||e,a==="string"||a==="number"){if(a==="number"&&(t=t.toString(),t===n))return n;if(i){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=Le(e,n,r,l);}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t;}else if(t==null||a==="boolean"){n=Le(e,n,r);}else {if(a==="function")return ae(()=>{let l=t();for(;typeof l=="function";)l=l();n=St(e,l,n,r);}),()=>n;if(Array.isArray(t)){let l=[],u=n&&Array.isArray(n);if(Xt(l,t,n,o))return ae(()=>n=St(e,l,n,r,true)),()=>n;if(l.length===0){if(n=Le(e,n,r),i)return n}else u?n.length===0?Zn(e,l,r):Wo(e,n,l):(n&&Le(e),Zn(e,l));n=l;}else if(t.nodeType){if(Array.isArray(n)){if(i)return n=Le(e,n,r,t);Le(e,n,null,t);}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t;}}return n}function Xt(e,t,n,r){let o=false;for(let s=0,a=t.length;s<a;s++){let i=t[s],l=n&&n[e.length],u;if(!(i==null||i===true||i===false))if((u=typeof i)=="object"&&i.nodeType)e.push(i);else if(Array.isArray(i))o=Xt(e,i,l)||o;else if(u==="function")if(r){for(;typeof i=="function";)i=i();o=Xt(e,Array.isArray(i)?i:[i],Array.isArray(l)?l:[l])||o;}else e.push(i),o=true;else {let c=String(i);l&&l.nodeType===3&&l.data===c?e.push(l):e.push(document.createTextNode(c));}}return o}function Zn(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n);}function Le(e,t,n,r){if(n===void 0)return e.textContent="";let o=r||document.createTextNode("");if(t.length){let s=false;for(let a=t.length-1;a>=0;a--){let i=t[a];if(o!==i){let l=i.parentNode===e;!s&&!a?l?e.replaceChild(o,i):e.insertBefore(o,n):l&&i.remove();}else s=true;}}else e.insertBefore(o,n);return [o]}function zo(e,t){return e[13]=1,e[14]=t>>8,e[15]=t&255,e[16]=t>>8,e[17]=t&255,e}var ir=112,ar=72,lr=89,cr=115,Kt;function Go(){let e=new Int32Array(256);for(let t=0;t<256;t++){let n=t;for(let r=0;r<8;r++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n;}return e}function Xo(e){let t=-1;Kt||(Kt=Go());for(let n=0;n<e.length;n++)t=Kt[(t^e[n])&255]^t>>>8;return t^-1}function Ko(e){let t=e.length-1;for(let n=t;n>=4;n--)if(e[n-4]===9&&e[n-3]===ir&&e[n-2]===ar&&e[n-1]===lr&&e[n]===cr)return n-3;return 0}function Zo(e,t,n=false){let r=new Uint8Array(13);t*=39.3701,r[0]=ir,r[1]=ar,r[2]=lr,r[3]=cr,r[4]=t>>>24,r[5]=t>>>16,r[6]=t>>>8,r[7]=t&255,r[8]=r[4],r[9]=r[5],r[10]=r[6],r[11]=r[7],r[12]=1;let o=Xo(r),s=new Uint8Array(4);if(s[0]=o>>>24,s[1]=o>>>16,s[2]=o>>>8,s[3]=o&255,n){let a=Ko(e);return e.set(r,a),e.set(s,a+13),e}else {let a=new Uint8Array(4);a[0]=0,a[1]=0,a[2]=0,a[3]=9;let i=new Uint8Array(54);return i.set(e,0),i.set(a,33),i.set(r,37),i.set(s,50),i}}var Jo="AAlwSFlz",Qo="AAAJcEhZ",es="AAAACXBI";function ts(e){let t=e.indexOf(Jo);return t===-1&&(t=e.indexOf(Qo)),t===-1&&(t=e.indexOf(es)),t}var ur="[modern-screenshot]",Fe=typeof window<"u",ns=Fe&&"Worker"in window,rs=Fe&&"atob"in window,os=Fe&&"btoa"in window,Jt=Fe?window.navigator?.userAgent:"",fr=Jt.includes("Chrome"),Tt=Jt.includes("AppleWebKit")&&!fr,Qt=Jt.includes("Firefox"),ss=e=>e&&"__CONTEXT__"in e,is=e=>e.constructor.name==="CSSFontFaceRule",as=e=>e.constructor.name==="CSSImportRule",ye=e=>e.nodeType===1,nt=e=>typeof e.className=="object",dr=e=>e.tagName==="image",ls=e=>e.tagName==="use",Qe=e=>ye(e)&&typeof e.style<"u"&&!nt(e),cs=e=>e.nodeType===8,us=e=>e.nodeType===3,je=e=>e.tagName==="IMG",Et=e=>e.tagName==="VIDEO",fs=e=>e.tagName==="CANVAS",ds=e=>e.tagName==="TEXTAREA",ms=e=>e.tagName==="INPUT",gs=e=>e.tagName==="STYLE",hs=e=>e.tagName==="SCRIPT",ps=e=>e.tagName==="SELECT",bs=e=>e.tagName==="SLOT",ys=e=>e.tagName==="IFRAME",ws=(...e)=>console.warn(ur,...e);function Ss(e){let t=e?.createElement?.("canvas");return t&&(t.height=t.width=1),!!t&&"toDataURL"in t&&!!t.toDataURL("image/webp").includes("image/webp")}var Zt=e=>e.startsWith("data:");function mr(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(Fe&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!Fe)return e;let n=vt().implementation.createHTMLDocument(),r=n.createElement("base"),o=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(o),t&&(r.href=t),o.href=e,o.href}function vt(e){return (e&&ye(e)?e?.ownerDocument:e)??window.document}var xt="http://www.w3.org/2000/svg";function Cs(e,t,n){let r=vt(n).createElementNS(xt,"svg");return r.setAttributeNS(null,"width",e.toString()),r.setAttributeNS(null,"height",t.toString()),r.setAttributeNS(null,"viewBox",`0 0 ${e} ${t}`),r}function Ts(e,t){let n=new XMLSerializer().serializeToString(e);return t&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}function Es(e,t){return new Promise((n,r)=>{let o=new FileReader;o.onload=()=>n(o.result),o.onerror=()=>r(o.error),o.onabort=()=>r(new Error(`Failed read blob to ${t}`)),o.readAsDataURL(e);})}var vs=e=>Es(e,"dataUrl");function Be(e,t){let n=vt(t).createElement("img");return n.decoding="sync",n.loading="eager",n.src=e,n}function et(e,t){return new Promise(n=>{let{timeout:r,ownerDocument:o,onError:s,onWarn:a}=t??{},i=typeof e=="string"?Be(e,vt(o)):e,l=null,u=null;function c(){n(i),l&&clearTimeout(l),u?.();}if(r&&(l=setTimeout(c,r)),Et(i)){let d=i.currentSrc||i.src;if(!d)return i.poster?et(i.poster,t).then(n):c();if(i.readyState>=2)return c();let g=c,p=S=>{a?.("Failed video load",d,S),s?.(S),c();};u=()=>{i.removeEventListener("loadeddata",g),i.removeEventListener("error",p);},i.addEventListener("loadeddata",g,{once:true}),i.addEventListener("error",p,{once:true});}else {let d=dr(i)?i.href.baseVal:i.currentSrc||i.src;if(!d)return c();let g=async()=>{if(je(i)&&"decode"in i)try{await i.decode();}catch(S){a?.("Failed to decode image, trying to render anyway",i.dataset.originalSrc||d,S);}c();},p=S=>{a?.("Failed image load",i.dataset.originalSrc||d,S),c();};if(je(i)&&i.complete)return g();u=()=>{i.removeEventListener("load",g),i.removeEventListener("error",p);},i.addEventListener("load",g,{once:true}),i.addEventListener("error",p,{once:true});}})}async function xs(e,t){Qe(e)&&(je(e)||Et(e)?await et(e,t):await Promise.all(["img","video"].flatMap(n=>Array.from(e.querySelectorAll(n)).map(r=>et(r,t)))));}var gr=function(){let t=0,n=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return ()=>(t+=1,`u${n()}${t}`)}();function hr(e){return e?.split(",").map(t=>t.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}var er=0;function Rs(e){let t=`${ur}[#${er}]`;return er++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...n)=>e&&ws(...n)}}function Ns(e){return {cache:e?"no-cache":"force-cache"}}async function Rt(e,t){return ss(e)?e:As(e,{...t,autoDestruct:true})}async function As(e,t){let{scale:n=1,workerUrl:r,workerNumber:o=1}=t||{},s=!!t?.debug,a=t?.features??true,i=e.ownerDocument??(Fe?window.document:void 0),l=e.ownerDocument?.defaultView??(Fe?window:void 0),u=new Map,c={width:0,height:0,quality:1,type:"image/png",scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:s,fetch:{requestInit:Ns(t?.fetch?.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:false,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:o,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:false,...t,__CONTEXT__:true,log:Rs(s),node:e,ownerDocument:i,ownerWindow:l,dpi:n===1?null:96*n,svgStyleElement:pr(i),svgDefsElement:i?.createElementNS(xt,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:ns&&r&&o?o:0})].map(()=>{try{let p=new Worker(r);return p.onmessage=async S=>{let{url:h,result:T}=S.data;T?u.get(h)?.resolve?.(T):u.get(h)?.reject?.(new Error(`Error receiving message from worker: ${h}`));},p.onmessageerror=S=>{let{url:h}=S.data;u.get(h)?.reject?.(new Error(`Error receiving message from worker: ${h}`));},p}catch(p){return c.log.warn("Failed to new Worker",p),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[Ss(i)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:u,drawImageCount:0,tasks:[],features:a,isEnable:p=>p==="restoreScrollPosition"?typeof a=="boolean"?false:a[p]??false:typeof a=="boolean"?a:a[p]??true,shadowRoots:[]};c.log.time("wait until load"),await xs(e,{timeout:c.timeout,onWarn:c.log.warn}),c.log.timeEnd("wait until load");let{width:d,height:g}=_s(e,c);return c.width=d,c.height=g,c}function pr(e){if(!e)return;let t=e.createElement("style"),n=t.ownerDocument.createTextNode(`
|
|
10
|
-
.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
`);return t.appendChild(n),t}function _s(e,t){let{width:n,height:r}=t;if(ye(e)&&(!n||!r)){let o=e.getBoundingClientRect();n=n||o.width||Number(e.getAttribute("width"))||0,r=r||o.height||Number(e.getAttribute("height"))||0;}return {width:n,height:r}}async function Fs(e,t){let{log:n,timeout:r,drawImageCount:o,drawImageInterval:s}=t;n.time("image to canvas");let a=await et(e,{timeout:r,onWarn:t.log.warn}),{canvas:i,context2d:l}=Os(e.ownerDocument,t),u=()=>{try{l?.drawImage(a,0,0,i.width,i.height);}catch(c){t.log.warn("Failed to drawImage",c);}};if(u(),t.isEnable("fixSvgXmlDecode"))for(let c=0;c<o;c++)await new Promise(d=>{setTimeout(()=>{l?.clearRect(0,0,i.width,i.height),u(),d();},c+s);});return t.drawImageCount=0,n.timeEnd("image to canvas"),i}function Os(e,t){let{width:n,height:r,scale:o,backgroundColor:s,maximumCanvasSize:a}=t,i=e.createElement("canvas");i.width=Math.floor(n*o),i.height=Math.floor(r*o),i.style.width=`${n}px`,i.style.height=`${r}px`,a&&(i.width>a||i.height>a)&&(i.width>a&&i.height>a?i.width>i.height?(i.height*=a/i.width,i.width=a):(i.width*=a/i.height,i.height=a):i.width>a?(i.height*=a/i.width,i.width=a):(i.width*=a/i.height,i.height=a));let l=i.getContext("2d");return l&&s&&(l.fillStyle=s,l.fillRect(0,0,i.width,i.height)),{canvas:i,context2d:l}}function br(e,t){if(e.ownerDocument)try{let s=e.toDataURL();if(s!=="data:,")return Be(s,e.ownerDocument)}catch(s){t.log.warn("Failed to clone canvas",s);}let n=e.cloneNode(false),r=e.getContext("2d"),o=n.getContext("2d");try{return r&&o&&o.putImageData(r.getImageData(0,0,e.width,e.height),0,0),n}catch(s){t.log.warn("Failed to clone canvas",s);}return n}function ks(e,t){try{if(e?.contentDocument?.body)return en(e.contentDocument.body,t)}catch(n){t.log.warn("Failed to clone iframe",n);}return e.cloneNode(false)}function Is(e){let t=e.cloneNode(false);return e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),t.loading==="lazy"&&(t.loading="eager"),t}async function $s(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return Be(e.poster,e.ownerDocument);let n=e.cloneNode(false);n.crossOrigin="anonymous",e.currentSrc&&e.currentSrc!==e.src&&(n.src=e.currentSrc);let r=n.ownerDocument;if(r){let o=true;if(await et(n,{onError:()=>o=false,onWarn:t.log.warn}),!o)return e.poster?Be(e.poster,e.ownerDocument):n;n.currentTime=e.currentTime,await new Promise(a=>{n.addEventListener("seeked",a,{once:true});});let s=r.createElement("canvas");s.width=e.offsetWidth,s.height=e.offsetHeight;try{let a=s.getContext("2d");a&&a.drawImage(n,0,0,s.width,s.height);}catch(a){return t.log.warn("Failed to clone video",a),e.poster?Be(e.poster,e.ownerDocument):n}return br(s,t)}return n}function Ps(e,t){return fs(e)?br(e,t):ys(e)?ks(e,t):je(e)?Is(e):Et(e)?$s(e,t):e.cloneNode(false)}function Ds(e){let t=e.sandbox;if(!t){let{ownerDocument:n}=e;try{n&&(t=n.createElement("iframe"),t.id=`__SANDBOX__${gr()}`,t.width="0",t.height="0",t.style.visibility="hidden",t.style.position="fixed",n.body.appendChild(t),t.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',e.sandbox=t);}catch(r){e.log.warn("Failed to getSandBox",r);}}return t}var Ms=["width","height","-webkit-text-fill-color"],Ls=["stroke","fill"];function yr(e,t,n){let{defaultComputedStyles:r}=n,o=e.nodeName.toLowerCase(),s=nt(e)&&o!=="svg",a=s?Ls.map(h=>[h,e.getAttribute(h)]).filter(([,h])=>h!==null):[],i=[s&&"svg",o,a.map((h,T)=>`${h}=${T}`).join(","),t].filter(Boolean).join(":");if(r.has(i))return r.get(i);let u=Ds(n)?.contentWindow;if(!u)return new Map;let c=u?.document,d,g;s?(d=c.createElementNS(xt,"svg"),g=d.ownerDocument.createElementNS(d.namespaceURI,o),a.forEach(([h,T])=>{g.setAttributeNS(null,h,T);}),d.appendChild(g)):d=g=c.createElement(o),g.textContent=" ",c.body.appendChild(d);let p=u.getComputedStyle(g,t),S=new Map;for(let h=p.length,T=0;T<h;T++){let y=p.item(T);Ms.includes(y)||S.set(y,p.getPropertyValue(y));}return c.body.removeChild(d),r.set(i,S),S}function wr(e,t,n){let r=new Map,o=[],s=new Map;if(n)for(let i of n)a(i);else for(let i=e.length,l=0;l<i;l++){let u=e.item(l);a(u);}for(let i=o.length,l=0;l<i;l++)s.get(o[l])?.forEach((u,c)=>r.set(c,u));function a(i){let l=e.getPropertyValue(i),u=e.getPropertyPriority(i),c=i.lastIndexOf("-"),d=c>-1?i.substring(0,c):void 0;if(d){let g=s.get(d);g||(g=new Map,s.set(d,g)),g.set(i,[l,u]);}t.get(i)===l&&!u||(d?o.push(d):r.set(i,[l,u]));}return r}function Hs(e,t,n,r){let{ownerWindow:o,includeStyleProperties:s,currentParentNodeStyle:a}=r,i=t.style,l=o.getComputedStyle(e),u=yr(e,null,r);a?.forEach((d,g)=>{u.delete(g);});let c=wr(l,u,s);c.delete("transition-property"),c.delete("all"),c.delete("d"),c.delete("content"),n&&(c.delete("margin-top"),c.delete("margin-right"),c.delete("margin-bottom"),c.delete("margin-left"),c.delete("margin-block-start"),c.delete("margin-block-end"),c.delete("margin-inline-start"),c.delete("margin-inline-end"),c.set("box-sizing",["border-box",""])),c.get("background-clip")?.[0]==="text"&&t.classList.add("______background-clip--text"),fr&&(c.has("font-kerning")||c.set("font-kerning",["normal",""]),(c.get("overflow-x")?.[0]==="hidden"||c.get("overflow-y")?.[0]==="hidden")&&c.get("text-overflow")?.[0]==="ellipsis"&&e.scrollWidth===e.clientWidth&&c.set("text-overflow",["clip",""]));for(let d=i.length,g=0;g<d;g++)i.removeProperty(i.item(g));return c.forEach(([d,g],p)=>{i.setProperty(p,d,g);}),c}function Bs(e,t){(ds(e)||ms(e)||ps(e))&&t.setAttribute("value",e.value);}var js=[":before",":after"],Us=[":-webkit-scrollbar",":-webkit-scrollbar-button",":-webkit-scrollbar-thumb",":-webkit-scrollbar-track",":-webkit-scrollbar-track-piece",":-webkit-scrollbar-corner",":-webkit-resizer"];function Vs(e,t,n,r,o){let{ownerWindow:s,svgStyleElement:a,svgStyles:i,currentNodeStyle:l}=r;if(!a||!s)return;function u(c){let d=s.getComputedStyle(e,c),g=d.getPropertyValue("content");if(!g||g==="none")return;o?.(g),g=g.replace(/(')|(")|(counter\(.+\))/g,"");let p=[gr()],S=yr(e,c,r);l?.forEach((v,N)=>{S.delete(N);});let h=wr(d,S,r.includeStyleProperties);h.delete("content"),h.delete("-webkit-locale"),h.get("background-clip")?.[0]==="text"&&t.classList.add("______background-clip--text");let T=[`content: '${g}';`];if(h.forEach(([v,N],_)=>{T.push(`${_}: ${v}${N?" !important":""};`);}),T.length===1)return;try{t.className=[t.className,...p].join(" ");}catch(v){r.log.warn("Failed to copyPseudoClass",v);return}let y=T.join(`
|
|
15
|
-
`),R=i.get(y);R||(R=[],i.set(y,R)),R.push(`.${p[0]}:${c}`);}js.forEach(u),n&&Us.forEach(u);}var tr=new Set(["symbol"]);async function nr(e,t,n,r,o){if(ye(n)&&(gs(n)||hs(n))||r.filter&&!r.filter(n))return;tr.has(t.nodeName)||tr.has(n.nodeName)?r.currentParentNodeStyle=void 0:r.currentParentNodeStyle=r.currentNodeStyle;let s=await en(n,r,false,o);r.isEnable("restoreScrollPosition")&&Ys(e,s),t.appendChild(s);}async function rr(e,t,n,r){let o=e.firstChild;ye(e)&&e.shadowRoot&&(o=e.shadowRoot?.firstChild,n.shadowRoots.push(e.shadowRoot));for(let s=o;s;s=s.nextSibling)if(!cs(s))if(ye(s)&&bs(s)&&typeof s.assignedNodes=="function"){let a=s.assignedNodes();for(let i=0;i<a.length;i++)await nr(e,t,a[i],n,r);}else await nr(e,t,s,n,r);}function Ys(e,t){if(!Qe(e)||!Qe(t))return;let{scrollTop:n,scrollLeft:r}=e;if(!n&&!r)return;let{transform:o}=t.style,s=new DOMMatrix(o),{a,b:i,c:l,d:u}=s;s.a=1,s.b=0,s.c=0,s.d=1,s.translateSelf(-r,-n),s.a=a,s.b=i,s.c=l,s.d=u,t.style.transform=s.toString();}function Ws(e,t){let{backgroundColor:n,width:r,height:o,style:s}=t,a=e.style;if(n&&a.setProperty("background-color",n,"important"),r&&a.setProperty("width",`${r}px`,"important"),o&&a.setProperty("height",`${o}px`,"important"),s)for(let i in s)a[i]=s[i];}var qs=/^[\w-:]+$/;async function en(e,t,n=false,r){let{ownerDocument:o,ownerWindow:s,fontFamilies:a,onCloneEachNode:i}=t;if(o&&us(e))return r&&/\S/.test(e.data)&&r(e.data),o.createTextNode(e.data);if(o&&s&&ye(e)&&(Qe(e)||nt(e))){let u=await Ps(e,t);if(t.isEnable("removeAbnormalAttributes")){let h=u.getAttributeNames();for(let T=h.length,y=0;y<T;y++){let R=h[y];qs.test(R)||u.removeAttribute(R);}}let c=t.currentNodeStyle=Hs(e,u,n,t);n&&Ws(u,t);let d=false;if(t.isEnable("copyScrollbar")){let h=[c.get("overflow-x")?.[0],c.get("overflow-y")?.[0]];d=h.includes("scroll")||(h.includes("auto")||h.includes("overlay"))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth);}let g=c.get("text-transform")?.[0],p=hr(c.get("font-family")?.[0]),S=p?h=>{g==="uppercase"?h=h.toUpperCase():g==="lowercase"?h=h.toLowerCase():g==="capitalize"&&(h=h[0].toUpperCase()+h.substring(1)),p.forEach(T=>{let y=a.get(T);y||a.set(T,y=new Set),h.split("").forEach(R=>y.add(R));});}:void 0;return Vs(e,u,d,t,S),Bs(e,u),Et(e)||await rr(e,u,t,S),await i?.(u),u}let l=e.cloneNode(false);return await rr(e,l,t),await i?.(l),l}function zs(e){if(e.ownerDocument=void 0,e.ownerWindow=void 0,e.svgStyleElement=void 0,e.svgDefsElement=void 0,e.svgStyles.clear(),e.defaultComputedStyles.clear(),e.sandbox){try{e.sandbox.remove();}catch(t){e.log.warn("Failed to destroyContext",t);}e.sandbox=void 0;}e.workers=[],e.fontFamilies.clear(),e.fontCssTexts.clear(),e.requests.clear(),e.tasks=[],e.shadowRoots=[];}function Gs(e){let{url:t,timeout:n,responseType:r,...o}=e,s=new AbortController,a=n?setTimeout(()=>s.abort(),n):void 0;return fetch(t,{signal:s.signal,...o}).then(i=>{if(!i.ok)throw new Error("Failed fetch, not 2xx response",{cause:i});switch(r){case "arrayBuffer":return i.arrayBuffer();case "dataUrl":return i.blob().then(vs);case "text":default:return i.text()}}).finally(()=>clearTimeout(a))}function tt(e,t){let{url:n,requestType:r="text",responseType:o="text",imageDom:s}=t,a=n,{timeout:i,acceptOfImage:l,requests:u,fetchFn:c,fetch:{requestInit:d,bypassingCache:g,placeholderImage:p},font:S,workers:h,fontFamilies:T}=e;r==="image"&&(Tt||Qt)&&e.drawImageCount++;let y=u.get(n);if(!y){g&&g instanceof RegExp&&g.test(a)&&(a+=(/\?/.test(a)?"&":"?")+new Date().getTime());let R=r.startsWith("font")&&S&&S.minify,v=new Set;R&&r.split(";")[1].split(",").forEach(X=>{T.has(X)&&T.get(X).forEach(Q=>v.add(Q));});let N=R&&v.size,_={url:a,timeout:i,responseType:N?"arrayBuffer":o,headers:r==="image"?{accept:l}:void 0,...d};y={type:r,resolve:void 0,reject:void 0,response:null},y.response=(async()=>{if(c&&r==="image"){let O=await c(n);if(O)return O}return !Tt&&n.startsWith("http")&&h.length?new Promise((O,X)=>{h[u.size&h.length-1].postMessage({rawUrl:n,..._}),y.resolve=O,y.reject=X;}):Gs(_)})().catch(O=>{if(u.delete(n),r==="image"&&p)return e.log.warn("Failed to fetch image base64, trying to use placeholder image",a),typeof p=="string"?p:p(s);throw O}),u.set(n,y);}return y.response}async function Sr(e,t,n,r){if(!Cr(e))return e;for(let[o,s]of Xs(e,t))try{let a=await tt(n,{url:s,requestType:r?"image":"text",responseType:"dataUrl"});e=e.replace(Ks(o),`$1${a}$3`);}catch(a){n.log.warn("Failed to fetch css data url",o,a);}return e}function Cr(e){return /url\((['"]?)([^'"]+?)\1\)/.test(e)}var Tr=/url\((['"]?)([^'"]+?)\1\)/g;function Xs(e,t){let n=[];return e.replace(Tr,(r,o,s)=>(n.push([s,mr(s,t)]),r)),n.filter(([r])=>!Zt(r))}function Ks(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}var Zs=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];function Js(e,t){return Zs.map(n=>{let r=e.getPropertyValue(n);return !r||r==="none"?null:((Tt||Qt)&&t.drawImageCount++,Sr(r,null,t,true).then(o=>{!o||r===o||e.setProperty(n,o,e.getPropertyPriority(n));}))}).filter(Boolean)}function Qs(e,t){if(je(e)){let n=e.currentSrc||e.src;if(!Zt(n))return [tt(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(r=>{r&&(e.srcset="",e.dataset.originalSrc=n,e.src=r||"");})];(Tt||Qt)&&t.drawImageCount++;}else if(nt(e)&&!Zt(e.href.baseVal)){let n=e.href.baseVal;return [tt(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(r=>{r&&(e.dataset.originalSrc=n,e.href.baseVal=r||"");})]}return []}function ei(e,t){let{ownerDocument:n,svgDefsElement:r}=t,o=e.getAttribute("href")??e.getAttribute("xlink:href");if(!o)return [];let[s,a]=o.split("#");if(a){let i=`#${a}`,l=t.shadowRoots.reduce((u,c)=>u??c.querySelector(`svg ${i}`),n?.querySelector(`svg ${i}`));if(s&&e.setAttribute("href",i),r?.querySelector(i))return [];if(l)return r?.appendChild(l.cloneNode(true)),[];if(s)return [tt(t,{url:s,responseType:"text"}).then(u=>{r?.insertAdjacentHTML("beforeend",u);})]}return []}function Er(e,t){let{tasks:n}=t;ye(e)&&((je(e)||dr(e))&&n.push(...Qs(e,t)),ls(e)&&n.push(...ei(e,t))),Qe(e)&&n.push(...Js(e.style,t)),e.childNodes.forEach(r=>{Er(r,t);});}async function ti(e,t){let{ownerDocument:n,svgStyleElement:r,fontFamilies:o,fontCssTexts:s,tasks:a,font:i}=t;if(!(!n||!r||!o.size))if(i&&i.cssText){let l=sr(i.cssText,t);r.appendChild(n.createTextNode(`${l}
|
|
16
|
-
`));}else {let l=Array.from(n.styleSheets).filter(c=>{try{return "cssRules"in c&&!!c.cssRules.length}catch(d){return t.log.warn(`Error while reading CSS rules from ${c.href}`,d),false}});await Promise.all(l.flatMap(c=>Array.from(c.cssRules).map(async(d,g)=>{if(as(d)){let p=g+1,S=d.href,h="";try{h=await tt(t,{url:S,requestType:"text",responseType:"text"});}catch(y){t.log.warn(`Error fetch remote css import from ${S}`,y);}let T=h.replace(Tr,(y,R,v)=>y.replace(v,mr(v,S)));for(let y of ri(T))try{c.insertRule(y,y.startsWith("@import")?p+=1:c.cssRules.length);}catch(R){t.log.warn("Error inserting rule from remote css import",{rule:y,error:R});}}}))),l.flatMap(c=>Array.from(c.cssRules)).filter(c=>is(c)&&Cr(c.style.getPropertyValue("src"))&&hr(c.style.getPropertyValue("font-family"))?.some(d=>o.has(d))).forEach(c=>{let d=c,g=s.get(d.cssText);g?r.appendChild(n.createTextNode(`${g}
|
|
17
|
-
`)):a.push(Sr(d.cssText,d.parentStyleSheet?d.parentStyleSheet.href:null,t).then(p=>{p=sr(p,t),s.set(d.cssText,p),r.appendChild(n.createTextNode(`${p}
|
|
18
|
-
`));}));});}}var ni=/(\/\*[\s\S]*?\*\/)/g,or=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;function ri(e){if(e==null)return [];let t=[],n=e.replace(ni,"");for(;;){let s=or.exec(n);if(!s)break;t.push(s[0]);}n=n.replace(or,"");let r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let s=r.exec(n);if(s)o.lastIndex=r.lastIndex;else if(s=o.exec(n),s)r.lastIndex=o.lastIndex;else break;t.push(s[0]);}return t}var oi=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,si=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function sr(e,t){let{font:n}=t,r=n?n?.preferredFormat:void 0;return r?e.replace(si,o=>{for(;;){let[s,,a]=oi.exec(o)||[];if(!a)return "";if(a===r)return `src: ${s};`}}):e}async function ii(e,t){let n=await Rt(e,t);if(ye(n.node)&&nt(n.node))return n.node;let{ownerDocument:r,log:o,tasks:s,svgStyleElement:a,svgDefsElement:i,svgStyles:l,font:u,progress:c,autoDestruct:d,onCloneNode:g,onEmbedNode:p,onCreateForeignObjectSvg:S}=n;o.time("clone node");let h=await en(n.node,n,true);if(a&&r){let N="";l.forEach((_,O)=>{N+=`${_.join(`,
|
|
19
|
-
`)} {
|
|
20
|
-
${O}
|
|
21
|
-
}
|
|
22
|
-
`;}),a.appendChild(r.createTextNode(N));}o.timeEnd("clone node"),await g?.(h),u!==false&&ye(h)&&(o.time("embed web font"),await ti(h,n),o.timeEnd("embed web font")),o.time("embed node"),Er(h,n);let T=s.length,y=0,R=async()=>{for(;;){let N=s.pop();if(!N)break;try{await N;}catch(_){n.log.warn("Failed to run task",_);}c?.(++y,T);}};c?.(y,T),await Promise.all([...Array.from({length:4})].map(R)),o.timeEnd("embed node"),await p?.(h);let v=ai(h,n);return i&&v.insertBefore(i,v.children[0]),a&&v.insertBefore(a,v.children[0]),d&&zs(n),await S?.(v),v}function ai(e,t){let{width:n,height:r}=t,o=Cs(n,r,e.ownerDocument),s=o.ownerDocument.createElementNS(o.namespaceURI,"foreignObject");return s.setAttributeNS(null,"x","0%"),s.setAttributeNS(null,"y","0%"),s.setAttributeNS(null,"width","100%"),s.setAttributeNS(null,"height","100%"),s.append(e),o.appendChild(s),o}async function li(e,t){let n=await Rt(e,t),r=await ii(n),o=Ts(r,n.isEnable("removeControlCharacter"));n.autoDestruct||(n.svgStyleElement=pr(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(xt,"defs"),n.svgStyles.clear());let s=Be(o,r.ownerDocument);return await Fs(s,n)}async function ci(e,t){let n=await Rt(e,t),{log:r,quality:o,type:s,dpi:a}=n,i=await li(n);r.time("canvas to data url");let l=i.toDataURL(s,o);if(["image/png","image/jpeg"].includes(s)&&a&&rs&&os){let[u,c]=l.split(","),d=0,g=false;if(s==="image/png"){let v=ts(c);v>=0?(d=Math.ceil((v+28)/3)*4,g=true):d=33/3*4;}else s==="image/jpeg"&&(d=18/3*4);let p=c.substring(0,d),S=c.substring(d),h=window.atob(p),T=new Uint8Array(h.length);for(let v=0;v<T.length;v++)T[v]=h.charCodeAt(v);let y=s==="image/png"?Zo(T,a,g):zo(T,a),R=window.btoa(String.fromCharCode(...y));l=[u,",",R,S].join("");}return r.timeEnd("canvas to data url"),l}async function tn(e,t){return ci(await Rt(e,{...t,type:"image/png"}))}var ui=["input","textarea","select","searchbox","slider","spinbutton","menuitem","menuitemcheckbox","menuitemradio","option","radio","textbox"],fi=e=>!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-"),di=e=>Array.isArray(e),mi=(e,t=false)=>{let{composed:n,target:r}=e,o,s;if(r instanceof HTMLElement&&fi(r)&&n){let i=e.composedPath()[0];i instanceof HTMLElement&&(o=i.tagName,s=i.role);}else r instanceof HTMLElement&&(o=r.tagName,s=r.role);return di(t)?!!(o&&t&&t.some(a=>typeof o=="string"&&a.toLowerCase()===o.toLowerCase()||a===s)):!!(o&&t&&t)},vr=e=>mi(e,ui);var Ue="data-react-grab",xr=()=>{let e=document.querySelector(`[${Ue}]`);if(e){let s=e.shadowRoot?.querySelector(`[${Ue}]`);if(s instanceof HTMLDivElement&&e.shadowRoot)return s}let t=document.createElement("div");t.setAttribute(Ue,"true"),t.style.zIndex="2147483646",t.style.position="fixed",t.style.top="0",t.style.left="0";let n=t.attachShadow({mode:"open"}),r=document.createElement("div");return r.setAttribute(Ue,"true"),n.appendChild(r),(document.body??document.documentElement).appendChild(t),r};var ge=(e,t,n)=>e+(t-e)*n;var hi=oe("<div>"),Nt=e=>{let[t,n]=I(e.bounds.x),[r,o]=I(e.bounds.y),[s,a]=I(e.bounds.width),[i,l]=I(e.bounds.height),[u,c]=I(1),d=false,g=null,p=null,S=e.bounds,h=false,T=()=>e.lerpFactor!==void 0?e.lerpFactor:e.variant==="drag"?.7:.95,y=()=>{if(h)return;h=true;let N=()=>{let _=ge(t(),S.x,T()),O=ge(r(),S.y,T()),X=ge(s(),S.width,T()),Q=ge(i(),S.height,T());n(_),o(O),a(X),l(Q),Math.abs(_-S.x)<.5&&Math.abs(O-S.y)<.5&&Math.abs(X-S.width)<.5&&Math.abs(Q-S.height)<.5?(g=null,h=false):g=requestAnimationFrame(N);};g=requestAnimationFrame(N);};re(Ae(()=>e.bounds,N=>{if(S=N,!d){n(S.x),o(S.y),a(S.width),l(S.height),d=true;return}y();})),re(()=>{e.variant==="grabbed"&&e.createdAt&&(p=window.setTimeout(()=>{c(0);},1500));}),fe(()=>{g!==null&&(cancelAnimationFrame(g),g=null),p!==null&&(window.clearTimeout(p),p=null),h=false;});let R={position:"fixed","box-sizing":"border-box","pointer-events":e.variant==="drag"?"none":"auto","z-index":"2147483646"},v=()=>e.variant==="drag"?{border:"1px dashed rgba(210, 57, 192, 0.4)","background-color":"rgba(210, 57, 192, 0.05)","will-change":"transform, width, height",contain:"layout paint size",cursor:"crosshair"}:{border:"1px solid rgb(210, 57, 192)","background-color":"rgba(210, 57, 192, 0.2)",transition:e.variant==="grabbed"?"opacity 0.3s ease-out":void 0};return P(q,{get when(){return e.visible!==false},get children(){var N=hi();return ae(_=>Ct(N,{...R,...v(),top:`${r()}px`,left:`${t()}px`,width:`${s()}px`,height:`${i()}px`,"border-radius":e.bounds.borderRadius,transform:e.bounds.transform,opacity:u()},_)),N}})};var pi=oe('<span style="display:inline-block;width:8px;height:8px;border:1.5px solid rgb(210, 57, 192);border-top-color:transparent;border-radius:50%;margin-right:4px;vertical-align:middle">'),Rr=e=>{let t;return Wn(()=>{t&&t.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:600,easing:"linear",iterations:1/0});}),(()=>{var n=pi(),r=t;return typeof r=="function"?_e(r,n):t=n,ae(o=>Ct(n,{...e.style},o)),n})()};var At=(e,t,n,r)=>{let o=window.innerWidth,s=window.innerHeight,a=8,i=8,l=o-n-8,u=s-r-8,c=Math.max(a,Math.min(e,l)),d=Math.max(i,Math.min(t,u));return {left:c,top:d}};var bi=oe("<span style=display:inline-block;margin-right:4px;font-weight:600>\u2713"),yi=oe("<div style=margin-right:4px>Copied"),wi=oe(`<span style="font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;font-variant-numeric:tabular-nums">`),Si=oe("<div style=margin-left:4px>to clipboard"),Ci=oe(`<div style="position:fixed;padding:2px 6px;background-color:#fde7f7;color:#b21c8e;border:1px solid #f7c5ec;border-radius:4px;font-size:11px;font-weight:500;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;pointer-events:none;transition:opacity 0.2s ease-in-out;display:flex;align-items:center;max-width:calc(100vw - (16px + env(safe-area-inset-left) + env(safe-area-inset-right)));overflow:hidden;text-overflow:ellipsis;white-space:nowrap">`),nn=e=>{let[t,n]=I(0),[r,o]=I(0),s,a=e.x,i=e.y,l=e.x,u=e.y,c=null,d=false,g=()=>{a=ge(a,l,.3),i=ge(i,u,.3),o(R=>R+1),Math.abs(a-l)<.5&&Math.abs(i-u)<.5?c=null:c=requestAnimationFrame(g);},p=()=>{c===null&&(c=requestAnimationFrame(g));},S=()=>{if(l=e.x,u=e.y,!d){a=l,i=u,d=true,o(y=>y+1);return}p();};re(Ae(()=>e.visible,y=>{if(y!==false)requestAnimationFrame(()=>{n(1);});else {n(0);return}if(e.variant==="success"){let R=setTimeout(()=>{n(0);},1700);fe(()=>clearTimeout(R));}})),re(()=>{S();}),fe(()=>{c!==null&&(cancelAnimationFrame(c),c=null);});let h=()=>s?.getBoundingClientRect(),T=()=>{r();let y=h();if(!y)return {left:a,top:i};let R=window.innerWidth,v=window.innerHeight,N=[{left:Math.round(a)+14,top:Math.round(i)+14},{left:Math.round(a)-y.width-14,top:Math.round(i)+14},{left:Math.round(a)+14,top:Math.round(i)-y.height-14},{left:Math.round(a)-y.width-14,top:Math.round(i)-y.height-14}];for(let O of N){let X=O.left>=8&&O.left+y.width<=R-8,Q=O.top>=8&&O.top+y.height<=v-8;if(X&&Q)return O}let _=At(N[0].left,N[0].top,y.width,y.height);return _.left+=4,_.top+=4,_};return P(q,{get when(){return e.visible!==false},get children(){var y=Ci(),R=s;return typeof R=="function"?_e(R,y):s=y,Te(y,P(q,{get when(){return e.variant==="processing"},get children(){return P(Rr,{})}}),null),Te(y,P(q,{get when(){return e.variant==="success"},get children(){return bi()}}),null),Te(y,P(q,{get when(){return e.variant==="success"},get children(){return yi()}}),null),Te(y,P(q,{get when(){return e.variant==="processing"},children:"Grabbing\u2026"}),null),Te(y,P(q,{get when(){return e.variant!=="processing"},get children(){var v=wi();return Te(v,()=>e.text),v}}),null),Te(y,P(q,{get when(){return e.variant==="success"},get children(){return Si()}}),null),ae(v=>{var N=`${T().top}px`,_=`${T().left}px`,O=e.zIndex?.toString()??"2147483647",X=t();return N!==v.e&&be(y,"top",v.e=N),_!==v.t&&be(y,"left",v.t=_),O!==v.a&&be(y,"z-index",v.a=O),X!==v.o&&be(y,"opacity",v.o=X),v},{e:void 0,t:void 0,a:void 0,o:void 0}),y}})};var Ti=oe('<div style="position:fixed;z-index:2147483647;pointer-events:none;transition:opacity 0.1s ease-in-out"><div style="width:32px;height:2px;background-color:rgba(178, 28, 142, 0.2);border-radius:1px;overflow:hidden;position:relative"><div style="height:100%;background-color:#b21c8e;border-radius:1px;transition:width 0.05s cubic-bezier(0.165, 0.84, 0.44, 1)">'),Ei=e=>{let[t,n]=I(0);return re(Ae(()=>e,r=>{r!==false?requestAnimationFrame(()=>{n(1);}):n(0);})),t},Ar=e=>{let t=Ei(e.visible),n,r=()=>{let o=n?.getBoundingClientRect();if(!o)return {left:e.mouseX,top:e.mouseY};let s=window.innerHeight,a=e.mouseX-o.width/2,i=e.mouseY+14+o.height+8>s?e.mouseY-o.height-14:e.mouseY+14;return At(a,i,o.width,o.height)};return P(q,{get when(){return e.visible!==false},get children(){var o=Ti(),s=o.firstChild,a=s.firstChild,i=n;return typeof i=="function"?_e(i,o):n=o,ae(l=>{var u=`${r().top}px`,c=`${r().left}px`,d=t(),g=`${Math.min(100,Math.max(0,e.progress*100))}%`;return u!==l.e&&be(o,"top",l.e=u),c!==l.t&&be(o,"left",l.t=c),d!==l.a&&be(o,"opacity",l.a=d),g!==l.o&&be(a,"width",l.o=g),l},{e:void 0,t:void 0,a:void 0,o:void 0}),o}})};var vi=oe("<canvas style=position:fixed;top:0;left:0;pointer-events:none;z-index:2147483645>"),_r=e=>{let t,n=null,r=0,o=0,s=1,a=e.mouseX,i=e.mouseY,l=e.mouseX,u=e.mouseY,c=null,d=false,g=()=>{t&&(s=Math.max(window.devicePixelRatio||1,2),r=window.innerWidth,o=window.innerHeight,t.width=r*s,t.height=o*s,t.style.width=`${r}px`,t.style.height=`${o}px`,n=t.getContext("2d"),n&&n.scale(s,s));},p=()=>{n&&(n.clearRect(0,0,r,o),n.strokeStyle="rgba(210, 57, 192)",n.lineWidth=1,n.beginPath(),n.moveTo(a,0),n.lineTo(a,o),n.moveTo(0,i),n.lineTo(r,i),n.stroke());},S=()=>{a=ge(a,l,.3),i=ge(i,u,.3),p(),Math.abs(a-l)<.5&&Math.abs(i-u)<.5?c=null:c=requestAnimationFrame(S);},h=()=>{c===null&&(c=requestAnimationFrame(S));},T=()=>{if(l=e.mouseX,u=e.mouseY,!d){a=l,i=u,d=true,p();return}h();};return re(()=>{g(),p();let y=()=>{g(),p();};window.addEventListener("resize",y),fe(()=>{window.removeEventListener("resize",y),c!==null&&(cancelAnimationFrame(c),c=null);});}),re(()=>{T();}),P(q,{get when(){return e.visible!==false},get children(){var y=vi(),R=t;return typeof R=="function"?_e(R,y):t=y,y}})};var Fr=e=>[P(q,{get when(){return He(()=>!!e.selectionVisible)()&&e.selectionBounds},get children(){return P(Nt,{variant:"selection",get bounds(){return e.selectionBounds},get visible(){return e.selectionVisible}})}}),P(q,{get when(){return He(()=>e.crosshairVisible===true&&e.mouseX!==void 0)()&&e.mouseY!==void 0},get children(){return P(_r,{get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},visible:true})}}),P(q,{get when(){return He(()=>!!e.dragVisible)()&&e.dragBounds},get children(){return P(Nt,{variant:"drag",get bounds(){return e.dragBounds},get visible(){return e.dragVisible}})}}),P(wt,{get each(){return e.grabbedBoxes??[]},children:t=>P(Nt,{variant:"grabbed",get bounds(){return t.bounds},get createdAt(){return t.createdAt}})}),P(wt,{get each(){return e.successLabels??[]},children:t=>P(nn,{variant:"success",get text(){return t.text},get x(){return t.x},get y(){return t.y}})}),P(q,{get when(){return He(()=>!!(e.labelVisible&&e.labelVariant&&e.labelText&&e.labelX!==void 0))()&&e.labelY!==void 0},get children(){return P(nn,{get variant(){return e.labelVariant},get text(){return e.labelText},get x(){return e.labelX},get y(){return e.labelY},get visible(){return e.labelVisible},get zIndex(){return e.labelZIndex}})}}),P(q,{get when(){return He(()=>!!(e.progressVisible&&e.progress!==void 0&&e.mouseX!==void 0))()&&e.mouseY!==void 0},get children(){return P(Ar,{get progress(){return e.progress},get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},get visible(){return e.progressVisible}})}})];var Ir="0.5.14",ot=`bippy-${Ir}`,Or=Object.defineProperty,xi=Object.prototype.hasOwnProperty,rt=()=>{},$r=e=>{try{Function.prototype.toString.call(e).indexOf("^_^")>-1&&setTimeout(()=>{throw Error("React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build")});}catch{}},rn=(e=Ee())=>"getFiberRoots"in e,Pr=false,kr,Ot=(e=Ee())=>Pr?true:(typeof e.inject=="function"&&(kr=e.inject.toString()),!!kr?.includes("(injected)")),Ft=new Set,$e=new Set,Dr=e=>{let t=new Map,n=0,r={_instrumentationIsActive:false,_instrumentationSource:ot,checkDCE:$r,hasUnsupportedRendererAttached:false,inject(o){let s=++n;return t.set(s,o),$e.add(o),r._instrumentationIsActive||(r._instrumentationIsActive=true,Ft.forEach(a=>a())),s},on:rt,onCommitFiberRoot:rt,onCommitFiberUnmount:rt,onPostCommitFiberRoot:rt,renderers:t,supportsFiber:true,supportsFlight:true};try{Or(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__",{configurable:!0,enumerable:!0,get(){return r},set(a){if(a&&typeof a=="object"){let i=r.renderers;r=a,i.size>0&&(i.forEach((l,u)=>{$e.add(l),a.renderers.set(u,l);}),kt(e));}}});let o=window.hasOwnProperty,s=!1;Or(window,"hasOwnProperty",{configurable:!0,value:function(...a){try{if(!s&&a[0]==="__REACT_DEVTOOLS_GLOBAL_HOOK__")return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,s=!0,-0}catch{}return o.apply(this,a)},writable:!0});}catch{kt(e);}return r},kt=e=>{e&&Ft.add(e);try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=$r,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=ot,t._instrumentationIsActive=!1;let n=rn(t);if(n||(t.on=rt),t.renderers.size){t._instrumentationIsActive=!0,Ft.forEach(s=>s());return}let r=t.inject,o=Ot(t);o&&!n&&(Pr=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=s=>{let a=r(s);return $e.add(s),o&&t.renderers.set(a,s),t._instrumentationIsActive=!0,Ft.forEach(i=>i()),a};}(t.renderers.size||t._instrumentationIsActive||Ot())&&e?.();}catch{}},on=()=>xi.call(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__"),Ee=e=>on()?(kt(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):Dr(e),Mr=()=>!!(typeof window<"u"&&(window.document?.createElement||window.navigator?.product==="ReactNative")),sn=()=>{try{Mr()&&Ee();}catch{}};sn();var It=0,$t=1;var Pt=5;var Dt=11,an=13,Lr=14,Mt=15,ln=16;var cn=19;var Lt=26,Ht=27,un=28,fn=30;var dn=e=>{switch(e.tag){case Pt:case Lt:case Ht:return true;default:return typeof e.type=="string"}},st=e=>{switch(e.tag){case $t:case Dt:case It:case Lr:case Mt:return true;default:return false}};function Ve(e,t,n=false){return e&&t(e)instanceof Promise?gn(e,t,n):mn(e,t,n)}var mn=(e,t,n=false)=>{if(!e)return null;if(t(e)===true)return e;let r=n?e.return:e.child;for(;r;){let o=mn(r,t,n);if(o)return o;r=n?null:r.sibling;}return null},gn=async(e,t,n=false)=>{if(!e)return null;if(await t(e)===true)return e;let r=n?e.return:e.child;for(;r;){let o=await gn(r,t,n);if(o)return o;r=n?null:r.sibling;}return null};var hn=e=>{let t=e;return typeof t=="function"?t:typeof t=="object"&&t?hn(t.type||t.render):null},Ye=e=>{let t=e;if(typeof t=="string")return t;if(typeof t!="function"&&!(typeof t=="object"&&t))return null;let n=t.displayName||t.name||null;if(n)return n;let r=hn(t);return r&&(r.displayName||r.name)||null};var pn=e=>{let t=e.alternate;if(!t)return e;if(t.actualStartTime&&e.actualStartTime)return t.actualStartTime>e.actualStartTime?t:e;for(let n of Bt){let r=Ve(n.current,o=>{if(o===e)return true});if(r)return r}return e};var bn=e=>{let t=Ee(e.onActive);t._instrumentationSource=e.name??ot;let n=t.onCommitFiberRoot;if(e.onCommitFiberRoot){let s=(a,i,l)=>{n!==s&&(n?.(a,i,l),e.onCommitFiberRoot?.(a,i,l));};t.onCommitFiberRoot=s;}let r=t.onCommitFiberUnmount;if(e.onCommitFiberUnmount){let s=(a,i)=>{t.onCommitFiberUnmount===s&&(r?.(a,i),e.onCommitFiberUnmount?.(a,i));};t.onCommitFiberUnmount=s;}let o=t.onPostCommitFiberRoot;if(e.onPostCommitFiberRoot){let s=(a,i)=>{t.onPostCommitFiberRoot===s&&(o?.(a,i),e.onPostCommitFiberRoot?.(a,i));};t.onPostCommitFiberRoot=s;}return t},it=e=>{let t=Ee();for(let n of t.renderers.values())try{let r=n.findFiberByHostInstance?.(e);if(r)return r}catch{}if(typeof e=="object"&&e){if("_reactRootContainer"in e)return e._reactRootContainer?._internalRoot?.current?.child;for(let n in e)if(n.startsWith("__reactContainer$")||n.startsWith("__reactInternalInstance$")||n.startsWith("__reactFiber"))return e[n]||null}return null},Bt=new Set;var $i=Object.create,qr=Object.defineProperty,Pi=Object.getOwnPropertyDescriptor,Di=Object.getOwnPropertyNames,Mi=Object.getPrototypeOf,Li=Object.prototype.hasOwnProperty,Hi=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Bi=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=Di(t),s=0,a=o.length,i;s<a;s++)i=o[s],!Li.call(e,i)&&i!==n&&qr(e,i,{get:(l=>t[l]).bind(null,i),enumerable:!(r=Pi(t,i))||r.enumerable});return e},ji=(e,t,n)=>(n=e==null?{}:$i(Mi(e)),Bi(qr(n,"default",{value:e,enumerable:true}),e)),Ui=()=>{let e=Ee();for(let t of [...Array.from($e),...Array.from(e.renderers.values())]){let n=t.currentDispatcherRef;if(n&&typeof n=="object")return "H"in n?n.H:n.current}return null},Hr=e=>{for(let t of $e){let n=t.currentDispatcherRef;n&&typeof n=="object"&&("H"in n?n.H=e:n.current=e);}},ve=e=>`
|
|
23
|
-
in ${e}`,Vi=(e,t)=>{let n=ve(e);return t&&(n+=` (at ${t})`),n},yn=false,wn=(e,t)=>{if(!e||yn)return "";let n=Error.prepareStackTrace;Error.prepareStackTrace=void 0,yn=true;let r=Ui();Hr(null);let o=console.error,s=console.warn;console.error=()=>{},console.warn=()=>{};try{let l={DetermineComponentFrameRoot(){let g;try{if(t){let p=function(){throw Error()};if(Object.defineProperty(p.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(p,[]);}catch(S){g=S;}Reflect.construct(e,[],p);}else {try{p.call();}catch(S){g=S;}e.call(p.prototype);}}else {try{throw Error()}catch(S){g=S;}let p=e();p&&typeof p.catch=="function"&&p.catch(()=>{});}}catch(p){if(p instanceof Error&&g instanceof Error&&typeof p.stack=="string")return [p.stack,g.stack]}return [null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot",Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name")?.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});let[c,d]=l.DetermineComponentFrameRoot();if(c&&d){let g=c.split(`
|
|
24
|
-
`),p=d.split(`
|
|
25
|
-
`),S=0,h=0;for(;S<g.length&&!g[S].includes("DetermineComponentFrameRoot");)S++;for(;h<p.length&&!p[h].includes("DetermineComponentFrameRoot");)h++;if(S===g.length||h===p.length)for(S=g.length-1,h=p.length-1;S>=1&&h>=0&&g[S]!==p[h];)h--;for(;S>=1&&h>=0;S--,h--)if(g[S]!==p[h]){if(S!==1||h!==1)do if(S--,h--,h<0||g[S]!==p[h]){let T=`
|
|
26
|
-
${g[S].replace(" at new "," at ")}`,y=Ye(e);return y&&T.includes("<anonymous>")&&(T=T.replace("<anonymous>",y)),T}while(S>=1&&h>=0);break}}}finally{yn=false,Error.prepareStackTrace=n,Hr(r),console.error=o,console.warn=s;}let a=e?Ye(e):"";return a?ve(a):""},Yi=(e,t)=>{let n=e.tag,r="";switch(n){case un:r=ve("Activity");break;case $t:r=wn(e.type,true);break;case Dt:r=wn(e.type.render,false);break;case It:case Mt:r=wn(e.type,false);break;case Pt:case Lt:case Ht:r=ve(e.type);break;case ln:r=ve("Lazy");break;case an:r=e.child!==t&&t!==null?ve("Suspense Fallback"):ve("Suspense");break;case cn:r=ve("SuspenseList");break;case fn:r=ve("ViewTransition");break;default:return ""}return r},Wi=e=>{try{let t="",n=e,r=null;do{t+=Yi(n,r);let o=n._debugInfo;if(o&&Array.isArray(o))for(let s=o.length-1;s>=0;s--){let a=o[s];typeof a.name=="string"&&(t+=Vi(a.name,a.env));}r=n,n=n.return;}while(n);return t}catch(t){return t instanceof Error?`
|
|
9
|
+
var Mr=(e,t)=>e===t;var Pr=Symbol("solid-track"),rt={equals:Mr},yn=xn,le=1,Ye=2,wn={owned:null,cleanups:null,context:null,owner:null};var P=null,b=null,Ie=null,V=null,K=null,Q=null,it=0;function Ae(e,t){let n=V,r=P,o=e.length===0,i=t===void 0?r:t,s=o?wn:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>ie(()=>ve(s)));P=s,V=null;try{return ye(a,!0)}finally{V=n,P=r;}}function $(e,t){t=t?Object.assign({},rt,t):rt;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Cn(n,o));return [Tn.bind(n),r]}function se(e,t,n){let r=_t(e,t,false,le);ze(r);}function te(e,t,n){yn=jr;let r=_t(e,t,false,le);(r.user=true),Q?Q.push(r):ze(r);}function z(e,t,n){n=n?Object.assign({},rt,n):rt;let r=_t(e,t,true,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,ze(r),Tn.bind(r)}function ie(e){if(V===null)return e();let t=V;V=null;try{return Ie?Ie.untrack(e):e()}finally{V=t;}}function Ee(e,t,n){let r=Array.isArray(e),o;return s=>{let a;if(r){a=Array(e.length);for(let f=0;f<e.length;f++)a[f]=e[f]();}else a=e();let l=ie(()=>t(a,o,s));return o=a,l}}function Sn(e){te(()=>ie(e));}function ce(e){return P===null||(P.cleanups===null?P.cleanups=[e]:P.cleanups.push(e)),e}$(false);function Tn(){let e=b;if(this.sources&&(this.state))if((this.state)===le)ze(this);else {let t=K;K=null,ye(()=>ot(this),false),K=t;}if(V){let t=this.observers?this.observers.length:0;V.sources?(V.sources.push(this),V.sourceSlots.push(t)):(V.sources=[this],V.sourceSlots=[t]),this.observers?(this.observers.push(V),this.observerSlots.push(V.sources.length-1)):(this.observers=[V],this.observerSlots=[V.sources.length-1]);}return e&&b.sources.has(this)?this.tValue:this.value}function Cn(e,t,n){let r=e.value;if(!e.comparator||!e.comparator(r,t)){e.value=t;e.observers&&e.observers.length&&ye(()=>{for(let o=0;o<e.observers.length;o+=1){let i=e.observers[o],s=b&&b.running;s&&b.disposed.has(i)||((s?!i.tState:!i.state)&&(i.pure?K.push(i):Q.push(i),i.observers&&vn(i)),s?i.tState=le:i.state=le);}if(K.length>1e6)throw K=[],new Error},false);}return t}function ze(e){if(!e.fn)return;ve(e);let t=it;gn(e,e.value,t);}function gn(e,t,n){let r,o=P,i=V;V=P=e;try{r=e.fn(t);}catch(s){return e.pure&&((e.state=le,e.owned&&e.owned.forEach(ve),e.owned=null)),e.updatedAt=n+1,At(s)}finally{V=i,P=o;}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Cn(e,r):e.value=r,e.updatedAt=n);}function _t(e,t,n,r=le,o){let i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:P,context:P?P.context:null,pure:n};if(P===null||P!==wn&&(P.owned?P.owned.push(i):P.owned=[i]),Ie);return i}function Ge(e){let t=b;if((e.state)===0)return;if((e.state)===Ye)return ot(e);if(e.suspense&&ie(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<it);){(e.state)&&n.push(e);}for(let r=n.length-1;r>=0;r--){if(e=n[r],t);if((e.state)===le)ze(e);else if((e.state)===Ye){let o=K;K=null,ye(()=>ot(e,n[0]),false),K=o;}}}function ye(e,t){if(K)return e();let n=false;t||(K=[]),Q?n=true:Q=[],it++;try{let r=e();return Hr(n),r}catch(r){n||(Q=null),K=null,At(r);}}function Hr(e){if(K&&(xn(K),K=null),e)return;let n=Q;Q=null,n.length&&ye(()=>yn(n),false);}function xn(e){for(let t=0;t<e.length;t++)Ge(e[t]);}function jr(e){let t,n=0;for(t=0;t<e.length;t++){let r=e[t];r.user?e[n++]=r:Ge(r);}for(t=0;t<n;t++)Ge(e[t]);}function ot(e,t){e.state=0;for(let r=0;r<e.sources.length;r+=1){let o=e.sources[r];if(o.sources){let i=o.state;i===le?o!==t&&(!o.updatedAt||o.updatedAt<it)&&Ge(o):i===Ye&&ot(o,t);}}}function vn(e){for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(!r.state)&&(r.state=Ye,r.pure?K.push(r):Q.push(r),r.observers&&vn(r));}}function ve(e){let t;if(e.sources)for(;e.sources.length;){let n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){let i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s);}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)ve(e.tOwned[t]);delete e.tOwned;}if(e.owned){for(t=e.owned.length-1;t>=0;t--)ve(e.owned[t]);e.owned=null;}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null;}e.state=0;}function Vr(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function At(e,t=P){let r=Vr(e);throw r;}var Yr=Symbol("fallback");function bn(e){for(let t=0;t<e.length;t++)e[t]();}function Gr(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return ce(()=>bn(i)),()=>{let l=e()||[],f=l.length,d,g;return l[Pr],ie(()=>{let x,S,C,R,T,A,O,N,_;if(f===0)s!==0&&(bn(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[Yr],o[0]=Ae(L=>(i[0]=L,n.fallback())),s=1);else if(s===0){for(o=new Array(f),g=0;g<f;g++)r[g]=l[g],o[g]=Ae(p);s=f;}else {for(C=new Array(f),R=new Array(f),a&&(T=new Array(f)),A=0,O=Math.min(s,f);A<O&&r[A]===l[A];A++);for(O=s-1,N=f-1;O>=A&&N>=A&&r[O]===l[N];O--,N--)C[N]=o[O],R[N]=i[O],a&&(T[N]=a[O]);for(x=new Map,S=new Array(N+1),g=N;g>=A;g--)_=l[g],d=x.get(_),S[g]=d===void 0?-1:d,x.set(_,g);for(d=A;d<=O;d++)_=r[d],g=x.get(_),g!==void 0&&g!==-1?(C[g]=o[d],R[g]=i[d],a&&(T[g]=a[d]),g=S[g],x.set(_,g)):i[d]();for(g=A;g<f;g++)g in C?(o[g]=C[g],i[g]=R[g],a&&(a[g]=T[g],a[g](g))):o[g]=Ae(p);o=o.slice(0,s=f),r=l.slice(0);}return o});function p(x){if(i[g]=x,a){let[S,C]=$(g);return a[g]=C,t(l[g],S)}return t(l[g])}}}function k(e,t){return ie(()=>e(t||{}))}var zr=e=>`Stale read from <${e}>.`;function st(e){let t="fallback"in e&&{fallback:()=>e.fallback};return z(Gr(()=>e.each,e.children,t||void 0))}function q(e){let t=e.keyed,n=z(()=>e.when,void 0,void 0),r=t?n:z(n,void 0,{equals:(o,i)=>!o==!i});return z(()=>{let o=r();if(o){let i=e.children;return typeof i=="function"&&i.length>0?ie(()=>i(t?o:()=>{if(!ie(r))throw zr("Show");return n()})):i}return e.fallback},void 0,void 0)}var Pe=e=>z(()=>e());function Wr(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,f=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){let d=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],d);}else if(i===a)for(;s<o;)(!f||!f.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){let d=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],d),t[o]=n[i];}else {if(!f){f=new Map;let g=a;for(;g<i;)f.set(n[g],g++);}let d=f.get(t[s]);if(d!=null)if(a<d&&d<i){let g=s,p=1,x;for(;++g<o&&g<i&&!((x=f.get(t[g]))==null||x!==d+p);)p++;if(p>d-a){let S=t[s];for(;a<d;)e.insertBefore(n[a++],S);}else e.replaceChild(n[a++],t[s++]);}else s++;else t[s++].remove();}}}function On(e,t,n,r={}){let o;return Ae(i=>{o=i,t===document?e():we(t,e(),t.firstChild?null:void 0,n);},r.owner),()=>{o(),t.textContent="";}}function re(e,t,n,r){let o,i=()=>{let a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},s=()=>(o||(o=i())).cloneNode(true);return s.cloneNode=s,s}function Kr(e,t,n){(e.removeAttribute(t));}function lt(e,t,n){if(!t)return n?Kr(e,"style"):t;let r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function pe(e,t,n){n!=null?e.style.setProperty(t,n):e.style.removeProperty(t);}function Re(e,t,n){return ie(()=>e(t,n))}function we(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return at(e,t,r,n);se(o=>at(e,t(),o,n),r);}function at(e,t,n,r,o){for(;typeof n=="function";)n=n();if(t===n)return n;let s=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(s==="number"&&(t=t.toString(),t===n))return n;if(a){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=Me(e,n,r,l);}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t;}else if(t==null||s==="boolean"){n=Me(e,n,r);}else {if(s==="function")return se(()=>{let l=t();for(;typeof l=="function";)l=l();n=at(e,l,n,r);}),()=>n;if(Array.isArray(t)){let l=[],f=n&&Array.isArray(n);if(Ft(l,t,n,o))return se(()=>n=at(e,l,n,r,true)),()=>n;if(l.length===0){if(n=Me(e,n,r),a)return n}else f?n.length===0?Rn(e,l,r):Wr(e,n,l):(n&&Me(e),Rn(e,l));n=l;}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=Me(e,n,r,t);Me(e,n,null,t);}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t;}}return n}function Ft(e,t,n,r){let o=false;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[e.length],f;if(!(a==null||a===true||a===false))if((f=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=Ft(e,a,l)||o;else if(f==="function")if(r){for(;typeof a=="function";)a=a();o=Ft(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o;}else e.push(a),o=true;else {let d=String(a);l&&l.nodeType===3&&l.data===d?e.push(l):e.push(document.createTextNode(d));}}return o}function Rn(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n);}function Me(e,t,n,r){if(n===void 0)return e.textContent="";let o=r||document.createTextNode("");if(t.length){let i=false;for(let s=t.length-1;s>=0;s--){let a=t[s];if(o!==a){let l=a.parentNode===e;!i&&!s?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove();}else i=true;}}else e.insertBefore(o,n);return [o]}var Zr=["input","textarea","select","searchbox","slider","spinbutton","menuitem","menuitemcheckbox","menuitemradio","option","radio","textbox"],Jr=e=>!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-"),Qr=e=>Array.isArray(e),eo=(e,t=false)=>{let{composed:n,target:r}=e,o,i;if(r instanceof HTMLElement&&Jr(r)&&n){let a=e.composedPath()[0];a instanceof HTMLElement&&(o=a.tagName,i=a.role);}else r instanceof HTMLElement&&(o=r.tagName,i=r.role);return Qr(t)?!!(o&&t&&t.some(s=>typeof o=="string"&&s.toLowerCase()===o.toLowerCase()||s===i)):!!(o&&t&&t)},_n=e=>eo(e,Zr);var Le="data-react-grab",An=()=>{let e=document.querySelector(`[${Le}]`);if(e){let i=e.shadowRoot?.querySelector(`[${Le}]`);if(i instanceof HTMLDivElement&&e.shadowRoot)return i}let t=document.createElement("div");t.setAttribute(Le,"true"),t.style.zIndex="2147483646",t.style.position="fixed",t.style.top="0",t.style.left="0";let n=t.attachShadow({mode:"open"}),r=document.createElement("div");return r.setAttribute(Le,"true"),n.appendChild(r),(document.body??document.documentElement).appendChild(t),r};var fe=(e,t,n)=>e+(t-e)*n;var no=re("<div>"),ct=e=>{let[t,n]=$(e.bounds.x),[r,o]=$(e.bounds.y),[i,s]=$(e.bounds.width),[a,l]=$(e.bounds.height),[f,d]=$(1),g=false,p=null,x=null,S=e.bounds,C=false,R=()=>e.lerpFactor!==void 0?e.lerpFactor:e.variant==="drag"?.7:.95,T=()=>{if(C)return;C=true;let N=()=>{let _=fe(t(),S.x,R()),L=fe(r(),S.y,R()),ne=fe(i(),S.width,R()),oe=fe(a(),S.height,R());n(_),o(L),s(ne),l(oe),Math.abs(_-S.x)<.5&&Math.abs(L-S.y)<.5&&Math.abs(ne-S.width)<.5&&Math.abs(oe-S.height)<.5?(p=null,C=false):p=requestAnimationFrame(N);};p=requestAnimationFrame(N);};te(Ee(()=>e.bounds,N=>{if(S=N,!g){n(S.x),o(S.y),s(S.width),l(S.height),g=true;return}T();})),te(()=>{e.variant==="grabbed"&&e.createdAt&&(x=window.setTimeout(()=>{d(0);},1500));}),ce(()=>{p!==null&&(cancelAnimationFrame(p),p=null),x!==null&&(window.clearTimeout(x),x=null),C=false;});let A={position:"fixed","box-sizing":"border-box","pointer-events":e.variant==="drag"?"none":"auto","z-index":"2147483646"},O=()=>e.variant==="drag"?{border:"1px dashed rgba(210, 57, 192, 0.4)","background-color":"rgba(210, 57, 192, 0.05)","will-change":"transform, width, height",contain:"layout paint size",cursor:"crosshair"}:{border:"1px solid rgb(210, 57, 192)","background-color":"rgba(210, 57, 192, 0.2)",transition:e.variant==="grabbed"?"opacity 0.3s ease-out":void 0};return k(q,{get when(){return e.visible!==false},get children(){var N=no();return se(_=>lt(N,{...A,...O(),top:`${r()}px`,left:`${t()}px`,width:`${i()}px`,height:`${a()}px`,"border-radius":e.bounds.borderRadius,transform:e.bounds.transform,opacity:f()},_)),N}})};var ro=re('<span style="display:inline-block;width:8px;height:8px;border:1.5px solid rgb(210, 57, 192);border-top-color:transparent;border-radius:50%;margin-right:4px;vertical-align:middle">'),Fn=e=>{let t;return Sn(()=>{t&&t.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:600,easing:"linear",iterations:1/0});}),(()=>{var n=ro(),r=t;return typeof r=="function"?Re(r,n):t=n,se(o=>lt(n,{...e.style},o)),n})()};var ut=(e,t,n,r)=>{let o=window.innerWidth,i=window.innerHeight,s=8,a=8,l=o-n-8,f=i-r-8,d=Math.max(s,Math.min(e,l)),g=Math.max(a,Math.min(t,f));return {left:d,top:g}};var oo=re("<span style=display:inline-block;margin-right:4px;font-weight:600>\u2713"),io=re("<div style=margin-right:4px>Copied"),so=re(`<span style="font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;font-variant-numeric:tabular-nums">`),ao=re("<div style=margin-left:4px>to clipboard"),lo=re(`<div style="position:fixed;padding:2px 6px;background-color:#fde7f7;color:#b21c8e;border:1px solid #f7c5ec;border-radius:4px;font-size:11px;font-weight:500;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;pointer-events:none;transition:opacity 0.2s ease-in-out;display:flex;align-items:center;max-width:calc(100vw - (16px + env(safe-area-inset-left) + env(safe-area-inset-right)));overflow:hidden;text-overflow:ellipsis;white-space:nowrap">`),$t=e=>{let[t,n]=$(0),[r,o]=$(0),i,s=e.x,a=e.y,l=e.x,f=e.y,d=null,g=false,p=()=>{s=fe(s,l,.3),a=fe(a,f,.3),o(A=>A+1),Math.abs(s-l)<.5&&Math.abs(a-f)<.5?d=null:d=requestAnimationFrame(p);},x=()=>{d===null&&(d=requestAnimationFrame(p));},S=()=>{if(l=e.x,f=e.y,!g){s=l,a=f,g=true,o(T=>T+1);return}x();};te(Ee(()=>e.visible,T=>{if(T!==false)requestAnimationFrame(()=>{n(1);});else {n(0);return}if(e.variant==="success"){let A=setTimeout(()=>{n(0);},1700);ce(()=>clearTimeout(A));}})),te(()=>{S();}),ce(()=>{d!==null&&(cancelAnimationFrame(d),d=null);});let C=()=>i?.getBoundingClientRect(),R=()=>{r();let T=C();if(!T)return {left:s,top:a};let A=window.innerWidth,O=window.innerHeight,N=[{left:Math.round(s)+14,top:Math.round(a)+14},{left:Math.round(s)-T.width-14,top:Math.round(a)+14},{left:Math.round(s)+14,top:Math.round(a)-T.height-14},{left:Math.round(s)-T.width-14,top:Math.round(a)-T.height-14}];for(let L of N){let ne=L.left>=8&&L.left+T.width<=A-8,oe=L.top>=8&&L.top+T.height<=O-8;if(ne&&oe)return L}let _=ut(N[0].left,N[0].top,T.width,T.height);return _.left+=4,_.top+=4,_};return k(q,{get when(){return e.visible!==false},get children(){var T=lo(),A=i;return typeof A=="function"?Re(A,T):i=T,we(T,k(q,{get when(){return e.variant==="processing"},get children(){return k(Fn,{})}}),null),we(T,k(q,{get when(){return e.variant==="success"},get children(){return oo()}}),null),we(T,k(q,{get when(){return e.variant==="success"},get children(){return io()}}),null),we(T,k(q,{get when(){return e.variant==="processing"},children:"Grabbing\u2026"}),null),we(T,k(q,{get when(){return e.variant!=="processing"},get children(){var O=so();return we(O,()=>e.text),O}}),null),we(T,k(q,{get when(){return e.variant==="success"},get children(){return ao()}}),null),se(O=>{var N=`${R().top}px`,_=`${R().left}px`,L=e.zIndex?.toString()??"2147483647",ne=t();return N!==O.e&&pe(T,"top",O.e=N),_!==O.t&&pe(T,"left",O.t=_),L!==O.a&&pe(T,"z-index",O.a=L),ne!==O.o&&pe(T,"opacity",O.o=ne),O},{e:void 0,t:void 0,a:void 0,o:void 0}),T}})};var co=re('<div style="position:fixed;z-index:2147483647;pointer-events:none;transition:opacity 0.1s ease-in-out"><div style="width:32px;height:2px;background-color:rgba(178, 28, 142, 0.2);border-radius:1px;overflow:hidden;position:relative"><div style="height:100%;background-color:#b21c8e;border-radius:1px;transition:width 0.05s cubic-bezier(0.165, 0.84, 0.44, 1)">'),uo=e=>{let[t,n]=$(0);return te(Ee(()=>e,r=>{r!==false?requestAnimationFrame(()=>{n(1);}):n(0);})),t},kn=e=>{let t=uo(e.visible),n,r=()=>{let o=n?.getBoundingClientRect();if(!o)return {left:e.mouseX,top:e.mouseY};let i=window.innerHeight,s=e.mouseX-o.width/2,a=e.mouseY+14+o.height+8>i?e.mouseY-o.height-14:e.mouseY+14;return ut(s,a,o.width,o.height)};return k(q,{get when(){return e.visible!==false},get children(){var o=co(),i=o.firstChild,s=i.firstChild,a=n;return typeof a=="function"?Re(a,o):n=o,se(l=>{var f=`${r().top}px`,d=`${r().left}px`,g=t(),p=`${Math.min(100,Math.max(0,e.progress*100))}%`;return f!==l.e&&pe(o,"top",l.e=f),d!==l.t&&pe(o,"left",l.t=d),g!==l.a&&pe(o,"opacity",l.a=g),p!==l.o&&pe(s,"width",l.o=p),l},{e:void 0,t:void 0,a:void 0,o:void 0}),o}})};var fo=re("<canvas style=position:fixed;top:0;left:0;pointer-events:none;z-index:2147483645>"),In=e=>{let t,n=null,r=0,o=0,i=1,s=e.mouseX,a=e.mouseY,l=e.mouseX,f=e.mouseY,d=null,g=false,p=()=>{t&&(i=Math.max(window.devicePixelRatio||1,2),r=window.innerWidth,o=window.innerHeight,t.width=r*i,t.height=o*i,t.style.width=`${r}px`,t.style.height=`${o}px`,n=t.getContext("2d"),n&&n.scale(i,i));},x=()=>{n&&(n.clearRect(0,0,r,o),n.strokeStyle="rgba(210, 57, 192)",n.lineWidth=1,n.beginPath(),n.moveTo(s,0),n.lineTo(s,o),n.moveTo(0,a),n.lineTo(r,a),n.stroke());},S=()=>{s=fe(s,l,.3),a=fe(a,f,.3),x(),Math.abs(s-l)<.5&&Math.abs(a-f)<.5?d=null:d=requestAnimationFrame(S);},C=()=>{d===null&&(d=requestAnimationFrame(S));},R=()=>{if(l=e.mouseX,f=e.mouseY,!g){s=l,a=f,g=true,x();return}C();};return te(()=>{p(),x();let T=()=>{p(),x();};window.addEventListener("resize",T),ce(()=>{window.removeEventListener("resize",T),d!==null&&(cancelAnimationFrame(d),d=null);});}),te(()=>{R();}),k(q,{get when(){return e.visible!==false},get children(){var T=fo(),A=t;return typeof A=="function"?Re(A,T):t=T,T}})};var Mn=e=>[k(q,{get when(){return Pe(()=>!!e.selectionVisible)()&&e.selectionBounds},get children(){return k(ct,{variant:"selection",get bounds(){return e.selectionBounds},get visible(){return e.selectionVisible}})}}),k(q,{get when(){return Pe(()=>e.crosshairVisible===true&&e.mouseX!==void 0)()&&e.mouseY!==void 0},get children(){return k(In,{get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},visible:true})}}),k(q,{get when(){return Pe(()=>!!e.dragVisible)()&&e.dragBounds},get children(){return k(ct,{variant:"drag",get bounds(){return e.dragBounds},get visible(){return e.dragVisible}})}}),k(st,{get each(){return e.grabbedBoxes??[]},children:t=>k(ct,{variant:"grabbed",get bounds(){return t.bounds},get createdAt(){return t.createdAt}})}),k(st,{get each(){return e.successLabels??[]},children:t=>k($t,{variant:"success",get text(){return t.text},get x(){return t.x},get y(){return t.y}})}),k(q,{get when(){return Pe(()=>!!(e.labelVisible&&e.labelVariant&&e.labelText&&e.labelX!==void 0))()&&e.labelY!==void 0},get children(){return k($t,{get variant(){return e.labelVariant},get text(){return e.labelText},get x(){return e.labelX},get y(){return e.labelY},get visible(){return e.labelVisible},get zIndex(){return e.labelZIndex}})}}),k(q,{get when(){return Pe(()=>!!(e.progressVisible&&e.progress!==void 0&&e.mouseX!==void 0))()&&e.mouseY!==void 0},get children(){return k(kn,{get progress(){return e.progress},get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},get visible(){return e.progressVisible}})}})];var Dn="0.5.14",Xe=`bippy-${Dn}`,Pn=Object.defineProperty,mo=Object.prototype.hasOwnProperty,qe=()=>{},Hn=e=>{try{Function.prototype.toString.call(e).indexOf("^_^")>-1&&setTimeout(()=>{throw Error("React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build")});}catch{}},kt=(e=Se())=>"getFiberRoots"in e,Bn=false,Ln,mt=(e=Se())=>Bn?true:(typeof e.inject=="function"&&(Ln=e.inject.toString()),!!Ln?.includes("(injected)")),dt=new Set,Fe=new Set,jn=e=>{let t=new Map,n=0,r={_instrumentationIsActive:false,_instrumentationSource:Xe,checkDCE:Hn,hasUnsupportedRendererAttached:false,inject(o){let i=++n;return t.set(i,o),Fe.add(o),r._instrumentationIsActive||(r._instrumentationIsActive=true,dt.forEach(s=>s())),i},on:qe,onCommitFiberRoot:qe,onCommitFiberUnmount:qe,onPostCommitFiberRoot:qe,renderers:t,supportsFiber:true,supportsFlight:true};try{Pn(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__",{configurable:!0,enumerable:!0,get(){return r},set(s){if(s&&typeof s=="object"){let a=r.renderers;r=s,a.size>0&&(a.forEach((l,f)=>{Fe.add(l),s.renderers.set(f,l);}),ht(e));}}});let o=window.hasOwnProperty,i=!1;Pn(window,"hasOwnProperty",{configurable:!0,value:function(...s){try{if(!i&&s[0]==="__REACT_DEVTOOLS_GLOBAL_HOOK__")return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,i=!0,-0}catch{}return o.apply(this,s)},writable:!0});}catch{ht(e);}return r},ht=e=>{e&&dt.add(e);try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=Hn,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=Xe,t._instrumentationIsActive=!1;let n=kt(t);if(n||(t.on=qe),t.renderers.size){t._instrumentationIsActive=!0,dt.forEach(i=>i());return}let r=t.inject,o=mt(t);o&&!n&&(Bn=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=i=>{let s=r(i);return Fe.add(i),o&&t.renderers.set(s,i),t._instrumentationIsActive=!0,dt.forEach(a=>a()),s};}(t.renderers.size||t._instrumentationIsActive||mt())&&e?.();}catch{}},It=()=>mo.call(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__"),Se=e=>It()?(ht(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):jn(e),Vn=()=>!!(typeof window<"u"&&(window.document?.createElement||window.navigator?.product==="ReactNative")),Mt=()=>{try{Vn()&&Se();}catch{}};Mt();var gt=0,pt=1;var bt=5;var yt=11,Pt=13,Yn=14,wt=15,Lt=16;var Dt=19;var St=26,Tt=27,Ht=28,Bt=30;var jt=e=>{switch(e.tag){case bt:case St:case Tt:return true;default:return typeof e.type=="string"}},We=e=>{switch(e.tag){case pt:case yt:case gt:case Yn:case wt:return true;default:return false}};function De(e,t,n=false){return e&&t(e)instanceof Promise?Yt(e,t,n):Vt(e,t,n)}var Vt=(e,t,n=false)=>{if(!e)return null;if(t(e)===true)return e;let r=n?e.return:e.child;for(;r;){let o=Vt(r,t,n);if(o)return o;r=n?null:r.sibling;}return null},Yt=async(e,t,n=false)=>{if(!e)return null;if(await t(e)===true)return e;let r=n?e.return:e.child;for(;r;){let o=await Yt(r,t,n);if(o)return o;r=n?null:r.sibling;}return null};var Gt=e=>{let t=e;return typeof t=="function"?t:typeof t=="object"&&t?Gt(t.type||t.render):null},He=e=>{let t=e;if(typeof t=="string")return t;if(typeof t!="function"&&!(typeof t=="object"&&t))return null;let n=t.displayName||t.name||null;if(n)return n;let r=Gt(t);return r&&(r.displayName||r.name)||null};var Ut=e=>{let t=e.alternate;if(!t)return e;if(t.actualStartTime&&e.actualStartTime)return t.actualStartTime>e.actualStartTime?t:e;for(let n of Ct){let r=De(n.current,o=>{if(o===e)return true});if(r)return r}return e};var zt=e=>{let t=Se(e.onActive);t._instrumentationSource=e.name??Xe;let n=t.onCommitFiberRoot;if(e.onCommitFiberRoot){let i=(s,a,l)=>{n!==i&&(n?.(s,a,l),e.onCommitFiberRoot?.(s,a,l));};t.onCommitFiberRoot=i;}let r=t.onCommitFiberUnmount;if(e.onCommitFiberUnmount){let i=(s,a)=>{t.onCommitFiberUnmount===i&&(r?.(s,a),e.onCommitFiberUnmount?.(s,a));};t.onCommitFiberUnmount=i;}let o=t.onPostCommitFiberRoot;if(e.onPostCommitFiberRoot){let i=(s,a)=>{t.onPostCommitFiberRoot===i&&(o?.(s,a),e.onPostCommitFiberRoot?.(s,a));};t.onPostCommitFiberRoot=i;}return t},Ke=e=>{let t=Se();for(let n of t.renderers.values())try{let r=n.findFiberByHostInstance?.(e);if(r)return r}catch{}if(typeof e=="object"&&e){if("_reactRootContainer"in e)return e._reactRootContainer?._internalRoot?.current?.child;for(let n in e)if(n.startsWith("__reactContainer$")||n.startsWith("__reactInternalInstance$")||n.startsWith("__reactFiber"))return e[n]||null}return null},Ct=new Set;var Co=Object.create,Zn=Object.defineProperty,xo=Object.getOwnPropertyDescriptor,vo=Object.getOwnPropertyNames,Eo=Object.getPrototypeOf,Ro=Object.prototype.hasOwnProperty,Oo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),No=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=vo(t),i=0,s=o.length,a;i<s;i++)a=o[i],!Ro.call(e,a)&&a!==n&&Zn(e,a,{get:(l=>t[l]).bind(null,a),enumerable:!(r=xo(t,a))||r.enumerable});return e},_o=(e,t,n)=>(n=e==null?{}:Co(Eo(e)),No(Zn(n,"default",{value:e,enumerable:true}),e)),Ao=()=>{let e=Se();for(let t of [...Array.from(Fe),...Array.from(e.renderers.values())]){let n=t.currentDispatcherRef;if(n&&typeof n=="object")return "H"in n?n.H:n.current}return null},Gn=e=>{for(let t of Fe){let n=t.currentDispatcherRef;n&&typeof n=="object"&&("H"in n?n.H=e:n.current=e);}},Te=e=>`
|
|
10
|
+
in ${e}`,Fo=(e,t)=>{let n=Te(e);return t&&(n+=` (at ${t})`),n},qt=false,Xt=(e,t)=>{if(!e||qt)return "";let n=Error.prepareStackTrace;Error.prepareStackTrace=void 0,qt=true;let r=Ao();Gn(null);let o=console.error,i=console.warn;console.error=()=>{},console.warn=()=>{};try{let l={DetermineComponentFrameRoot(){let p;try{if(t){let x=function(){throw Error()};if(Object.defineProperty(x.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(x,[]);}catch(S){p=S;}Reflect.construct(e,[],x);}else {try{x.call();}catch(S){p=S;}e.call(x.prototype);}}else {try{throw Error()}catch(S){p=S;}let x=e();x&&typeof x.catch=="function"&&x.catch(()=>{});}}catch(x){if(x instanceof Error&&p instanceof Error&&typeof x.stack=="string")return [x.stack,p.stack]}return [null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot",Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name")?.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});let[d,g]=l.DetermineComponentFrameRoot();if(d&&g){let p=d.split(`
|
|
11
|
+
`),x=g.split(`
|
|
12
|
+
`),S=0,C=0;for(;S<p.length&&!p[S].includes("DetermineComponentFrameRoot");)S++;for(;C<x.length&&!x[C].includes("DetermineComponentFrameRoot");)C++;if(S===p.length||C===x.length)for(S=p.length-1,C=x.length-1;S>=1&&C>=0&&p[S]!==x[C];)C--;for(;S>=1&&C>=0;S--,C--)if(p[S]!==x[C]){if(S!==1||C!==1)do if(S--,C--,C<0||p[S]!==x[C]){let R=`
|
|
13
|
+
${p[S].replace(" at new "," at ")}`,T=He(e);return T&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",T)),R}while(S>=1&&C>=0);break}}}finally{qt=false,Error.prepareStackTrace=n,Gn(r),console.error=o,console.warn=i;}let s=e?He(e):"";return s?Te(s):""},$o=(e,t)=>{let n=e.tag,r="";switch(n){case Ht:r=Te("Activity");break;case pt:r=Xt(e.type,true);break;case yt:r=Xt(e.type.render,false);break;case gt:case wt:r=Xt(e.type,false);break;case bt:case St:case Tt:r=Te(e.type);break;case Lt:r=Te("Lazy");break;case Pt:r=e.child!==t&&t!==null?Te("Suspense Fallback"):Te("Suspense");break;case Dt:r=Te("SuspenseList");break;case Bt:r=Te("ViewTransition");break;default:return ""}return r},ko=e=>{try{let t="",n=e,r=null;do{t+=$o(n,r);let o=n._debugInfo;if(o&&Array.isArray(o))for(let i=o.length-1;i>=0;i--){let s=o[i];typeof s.name=="string"&&(t+=Fo(s.name,s.env));}r=n,n=n.return;}while(n);return t}catch(t){return t instanceof Error?`
|
|
27
14
|
Error generating stack: ${t.message}
|
|
28
|
-
${t.stack}`:""}},
|
|
15
|
+
${t.stack}`:""}},Io=e=>{let t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;let n=e;if(!n)return "";Error.prepareStackTrace=t,n.startsWith(`Error: react-stack-top-frame
|
|
29
16
|
`)&&(n=n.slice(29));let r=n.indexOf(`
|
|
30
17
|
`);if(r!==-1&&(n=n.slice(r+1)),r=Math.max(n.indexOf("react_stack_bottom_frame"),n.indexOf("react-stack-bottom-frame")),r!==-1&&(r=n.lastIndexOf(`
|
|
31
|
-
`,r)),r!==-1)n=n.slice(0,r);else return "";return n},
|
|
32
|
-
`),r=[];for(let o of n)if(/^\s*at\s+/.test(o)){let
|
|
33
|
-
`).filter(r=>!!r.match(
|
|
34
|
-
`).filter(r=>!r.match(
|
|
35
|
-
`),r;for(let s=n.length-1;s>=0&&!r;s--){let a=n[s].match(Zi);a&&(r=a[1]||a[2]);}if(!r)return null;let o=Zr.test(r);if(!(Ki.test(r)||o||r.startsWith("/"))){let s=e.split("/");s[s.length-1]=r,r=s.join("/");}return r},ta=e=>({file:e.file,mappings:(0, Kr.decode)(e.mappings),names:e.names,sourceRoot:e.sourceRoot,sources:e.sources,sourcesContent:e.sourcesContent,version:3}),na=e=>{let t=e.sections.map(({map:r,offset:o})=>({map:{...r,mappings:(0, Kr.decode)(r.mappings)},offset:o})),n=new Set;for(let r of t)for(let o of r.map.sources)n.add(o);return {file:e.file,mappings:[],names:[],sections:t,sourceRoot:void 0,sources:Array.from(n),sourcesContent:void 0,version:3}},Vr=e=>{if(!e)return false;let t=e.trim();if(!t)return false;let n=t.match(Zr);if(!n)return true;let r=n[0].toLowerCase();return r==="http:"||r==="https:"},ra=async(e,t=fetch)=>{if(!Vr(e))return null;let n;try{n=await(await t(e)).text();}catch{return null}if(!n)return null;let r=ea(e,n);if(!r||!Vr(r))return null;try{let o=await t(r),s=await o.json();return "sections"in s?na(s):ta(s)}catch{return null}},oa=async(e,t=true,n)=>{if(t&&at.has(e)){let s=at.get(e);if(s==null)return null;if(Ji(s)){let a=s.deref();if(a)return a;at.delete(e);}else return s}if(t&&jt.has(e))return jt.get(e);let r=ra(e,n);t&&jt.set(e,r);let o=await r;return t&&jt.delete(e),t&&(o===null?at.set(e,null):at.set(e,Jr?new WeakRef(o):o)),o},Yr=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,sa=["rsc://","file:///","webpack://","node:","turbopack://","metro://"],Wr="about://React/",ia=["<anonymous>","eval",""],aa=/\.(jsx|tsx|ts|js)$/,la=/(\.min|bundle|chunk|vendor|vendors|runtime|polyfill|polyfills)\.(js|mjs|cjs)$|(chunk|bundle|vendor|vendors|runtime|polyfill|polyfills|framework|app|main|index)[-_.][A-Za-z0-9_-]{4,}\.(js|mjs|cjs)$|[\da-f]{8,}\.(js|mjs|cjs)$|[-_.][\da-f]{20,}\.(js|mjs|cjs)$|\/dist\/|\/build\/|\/.next\/|\/out\/|\/node_modules\/|\.webpack\.|\.vite\.|\.turbopack\./i,ca=/^\?[\w~.\-]+(?:=[^&#]*)?(?:&[\w~.\-]+(?:=[^&#]*)?)*$/,ua=e=>e._debugStack instanceof Error&&typeof e._debugStack?.stack=="string",fa=e=>{let t=e._debugSource;return t?typeof t=="object"&&!!t&&"fileName"in t&&typeof t.fileName=="string"&&"lineNumber"in t&&typeof t.lineNumber=="number":false},da=async(e,t=true,n)=>{if(fa(e))return e._debugSource||null;let r=Qr(e);return eo(r,void 0,t,n)},Qr=e=>ua(e)?qi(e._debugStack.stack):Wi(e),ma=async(e,t=true,n)=>{let r=await eo(e,1,t,n);return !r||r.length===0?null:r[0]},eo=async(e,t=1,n=true,r)=>{let o=Gr(e,{slice:t??1}),s=[];for(let a of o){if(!a?.file)continue;let i=await oa(a.file,n,r);if(i&&typeof a.line=="number"&&typeof a.col=="number"){let l=Qi(i,a.line,a.col);if(l){s.push(l);continue}}s.push({fileName:a.file,lineNumber:a.line,columnNumber:a.col,functionName:a.function});}return s},We=e=>{if(!e||ia.includes(e))return "";let t=e;if(t.startsWith(Wr)){let r=t.slice(Wr.length),o=r.indexOf("/"),s=r.indexOf(":");t=o!==-1&&(s===-1||o<s)?r.slice(o+1):r;}for(let r of sa)if(t.startsWith(r)){t=t.slice(r.length),r==="file:///"&&(t=`/${t.replace(/^\/+/,"")}`);break}if(Yr.test(t)){let r=t.match(Yr);r&&(t=t.slice(r[0].length));}let n=t.indexOf("?");if(n!==-1){let r=t.slice(n);ca.test(r)&&(t=t.slice(0,n));}return t},Cn=e=>{let t=We(e);return !(!t||!aa.test(t)||la.test(t))},ga=async(e,t=true,n)=>{let r=Ve(e,a=>{if(st(a))return true},true);if(r){let a=await da(r,t,n);if(a?.fileName){let i=We(a.fileName);if(Cn(i))return {fileName:i,lineNumber:a.lineNumber,columnNumber:a.columnNumber,functionName:a.functionName}}}let o=Gr(Qr(e),{includeInElement:false}),s=null;for(;o.length;){let a=o.pop();if(!a||!a.raw||!a.file)continue;let i=await ma(a.raw,t,n);if(i)return {fileName:We(i.fileName),lineNumber:i.lineNumber,columnNumber:i.columnNumber,functionName:i.functionName};s={fileName:We(a.file),lineNumber:a.line,columnNumber:a.col,functionName:a.function};}return s},to=async(e,t=true,n)=>{let r=it(e);if(!r||!dn(r))return null;let o=pn(r);return o?ga(o,t,n):null};var ha=new Set(["role","name","aria-label","rel","href"]);function pa(e,t){let n=ha.has(e);n||=e.startsWith("data-")&<(e);let r=lt(t)&&t.length<100;return r||=t.startsWith("#")&<(t.slice(1)),n&&r}function ba(e){return lt(e)}function ya(e){return lt(e)}function wa(e){return true}function ro(e,t){if(e.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(e.tagName.toLowerCase()==="html")return "html";let n={root:document.body,idName:ba,className:ya,tagName:wa,attr:pa,timeoutMs:1e3,seedMinLength:3,optimizedMinLength:2,maxNumberOfPathChecks:1/0},r=new Date,o={...n,...t},s=va(o.root,n),a,i=0;for(let u of Sa(e,o,s)){if(new Date().getTime()-r.getTime()>o.timeoutMs||i>=o.maxNumberOfPathChecks){let d=Ta(e,s);if(!d)throw new Error(`Timeout: Can't find a unique selector after ${o.timeoutMs}ms`);return ct(d)}if(i++,vn(u,s)){a=u;break}}if(!a)throw new Error("Selector was not found.");let l=[...io(a,e,o,s,r)];return l.sort(Tn),l.length>0?ct(l[0]):ct(a)}function*Sa(e,t,n){let r=[],o=[],s=e,a=0;for(;s&&s!==n;){let i=Ca(s,t);for(let l of i)l.level=a;if(r.push(i),s=s.parentElement,a++,o.push(...so(r)),a>=t.seedMinLength){o.sort(Tn);for(let l of o)yield l;o=[];}}o.sort(Tn);for(let i of o)yield i;}function lt(e){if(/^[a-z\-]{3,}$/i.test(e)){let t=e.split(/-|[A-Z]/);for(let n of t)if(n.length<=2||/[^aeiou]{4,}/i.test(n))return false;return true}return false}function Ca(e,t){let n=[],r=e.getAttribute("id");r&&t.idName(r)&&n.push({name:"#"+CSS.escape(r),penalty:0});for(let a=0;a<e.classList.length;a++){let i=e.classList[a];t.className(i)&&n.push({name:"."+CSS.escape(i),penalty:1});}for(let a=0;a<e.attributes.length;a++){let i=e.attributes[a];t.attr(i.name,i.value)&&n.push({name:`[${CSS.escape(i.name)}="${CSS.escape(i.value)}"]`,penalty:2});}let o=e.tagName.toLowerCase();if(t.tagName(o)){n.push({name:o,penalty:5});let a=En(e,o);a!==void 0&&n.push({name:oo(o,a),penalty:10});}let s=En(e);return s!==void 0&&n.push({name:Ea(o,s),penalty:50}),n}function ct(e){let t=e[0],n=t.name;for(let r=1;r<e.length;r++){let o=e[r].level||0;t.level===o-1?n=`${e[r].name} > ${n}`:n=`${e[r].name} ${n}`,t=e[r];}return n}function no(e){return e.map(t=>t.penalty).reduce((t,n)=>t+n,0)}function Tn(e,t){return no(e)-no(t)}function En(e,t){let n=e.parentNode;if(!n)return;let r=n.firstChild;if(!r)return;let o=0;for(;r&&(r.nodeType===Node.ELEMENT_NODE&&(t===void 0||r.tagName.toLowerCase()===t)&&o++,r!==e);)r=r.nextSibling;return o}function Ta(e,t){let n=0,r=e,o=[];for(;r&&r!==t;){let s=r.tagName.toLowerCase(),a=En(r,s);if(a===void 0)return;o.push({name:oo(s,a),penalty:NaN,level:n}),r=r.parentElement,n++;}if(vn(o,t))return o}function Ea(e,t){return e==="html"?"html":`${e}:nth-child(${t})`}function oo(e,t){return e==="html"?"html":`${e}:nth-of-type(${t})`}function*so(e,t=[]){if(e.length>0)for(let n of e[0])yield*so(e.slice(1,e.length),t.concat(n));else yield t;}function va(e,t){return e.nodeType===Node.DOCUMENT_NODE?e:e===t.root?e.ownerDocument:e}function vn(e,t){let n=ct(e);switch(t.querySelectorAll(n).length){case 0:throw new Error(`Can't select any node with this selector: ${n}`);case 1:return true;default:return false}}function*io(e,t,n,r,o){if(e.length>2&&e.length>n.optimizedMinLength)for(let s=1;s<e.length-1;s++){if(new Date().getTime()-o.getTime()>n.timeoutMs)return;let i=[...e];i.splice(s,1),vn(i,r)&&r.querySelector(ct(i))===t&&(yield i,yield*io(i,t,n,r,o));}}bn({onCommitFiberRoot(e,t){Bt.add(t);}});var xa=e=>ro(e),xn=async e=>{let t=(m,f)=>m.length>f?`${m.substring(0,f)}...`:m,n=m=>!!(m.startsWith("_")||m.includes("Provider")&&m.includes("Context")),r=m=>{let f=it(m);if(!f)return null;let b=null;return Ve(f,E=>{if(st(E)){let F=Ye(E);if(F&&!n(F))return b=F,true}return false},true),b},o=async m=>{let f=await to(m);if(!f)return null;let b=We(f.fileName);return Cn(b)?`${b}:${f.lineNumber}:${f.columnNumber}`:null},s=new Set(["article","aside","footer","form","header","main","nav","section"]),a=m=>{let f=m.tagName.toLowerCase();if(s.has(f)||m.id)return true;if(m.className&&typeof m.className=="string"){let b=m.className.trim();if(b&&b.length>0)return true}return Array.from(m.attributes).some(b=>b.name.startsWith("data-"))},i=(m,f=10)=>{let b=[],E=m.parentElement,F=0;for(;E&&F<f&&E.tagName!=="BODY"&&!(a(E)&&(b.push(E),b.length>=3));)E=E.parentElement,F++;return b.reverse()},l=(m,f=false)=>{let b=m.tagName.toLowerCase(),E=[];if(m.id&&E.push(`id="${m.id}"`),m.className&&typeof m.className=="string"){let k=m.className.trim().split(/\s+/);if(k.length>0&&k[0]){let j=f?k.slice(0,3):k,B=t(j.join(" "),30);E.push(`class="${B}"`);}}let F=Array.from(m.attributes).filter(k=>k.name.startsWith("data-")),H=f?F.slice(0,1):F;for(let k of H)E.push(`${k.name}="${t(k.value,20)}"`);let M=m.getAttribute("aria-label");return M&&!f&&E.push(`aria-label="${t(M,20)}"`),E.length>0?`<${b} ${E.join(" ")}>`:`<${b}>`},u=m=>`</${m.tagName.toLowerCase()}>`,c=m=>{let f=(m.textContent||"").trim().replace(/\s+/g," ");return t(f,60)},d=m=>{if(m.id)return `#${m.id}`;if(m.className&&typeof m.className=="string"){let f=m.className.trim().split(/\s+/);if(f.length>0&&f[0])return `.${f[0]}`}return null},g=[],p=xa(e);g.push("Locate this element in the codebase:"),g.push(`- selector: ${p}`);let S=e.getBoundingClientRect();g.push(`- width: ${Math.round(S.width)}`),g.push(`- height: ${Math.round(S.height)}`),g.push("HTML snippet:"),g.push("```html");let h=i(e),T=h.map(m=>r(m)),y=r(e),R=await Promise.all(h.map(m=>o(m))),v=await o(e);for(let m=0;m<h.length;m++){let f=" ".repeat(m),b=T[m],E=R[m];b&&E&&(m===0||T[m-1]!==b)&&g.push(`${f}<${b} source="${E}">`),g.push(`${f}${l(h[m],true)}`);}let N=e.parentElement,_=-1;if(N){let m=Array.from(N.children);if(_=m.indexOf(e),_>0){let f=m[_-1];if(d(f)&&_<=2){let E=" ".repeat(h.length);g.push(`${E} ${l(f,true)}`),g.push(`${E} </${f.tagName.toLowerCase()}>`);}else if(_>0){let E=" ".repeat(h.length);g.push(`${E} ... (${_} element${_===1?"":"s"})`);}}}let O=" ".repeat(h.length),X=h.length>0?T[T.length-1]:null,Q=y&&v&&y!==X;Q&&g.push(`${O} <${y} used-at="${v}">`),g.push(`${O} <!-- IMPORTANT: selected element -->`);let le=c(e),xe=e.children.length,x=`${O}${Q?" ":" "}`;if(le&&xe===0&&le.length<40?g.push(`${x}${l(e)}${le}${u(e)}`):(g.push(`${x}${l(e)}`),le&&g.push(`${x} ${le}`),xe>0&&g.push(`${x} ... (${xe} element${xe===1?"":"s"})`),g.push(`${x}${u(e)}`)),Q&&g.push(`${O} </${y}>`),N&&_>=0){let m=Array.from(N.children),f=m.length-_-1;if(f>0){let b=m[_+1];d(b)&&f<=2?(g.push(`${O} ${l(b,true)}`),g.push(`${O} </${b.tagName.toLowerCase()}>`)):g.push(`${O} ... (${f} element${f===1?"":"s"})`);}}for(let m=h.length-1;m>=0;m--){let f=" ".repeat(m);g.push(`${f}${u(h[m])}`);let b=T[m],E=R[m];b&&E&&(m===h.length-1||T[m+1]!==b)&&g.push(`${f}</${b}>`);}return g.push("```"),g.join(`
|
|
36
|
-
`)};var
|
|
37
|
-
${
|
|
38
|
-
</selected_element>`,
|
|
18
|
+
`,r)),r!==-1)n=n.slice(0,r);else return "";return n},Mo=/(^|@)\S+:\d+/,Jn=/^\s*at .*(\S+:\d+|\(native\))/m,Po=/^(eval@)?(\[native code\])?$/;var Qn=(e,t)=>{if(t?.includeInElement!==false){let n=e.split(`
|
|
19
|
+
`),r=[];for(let o of n)if(/^\s*at\s+/.test(o)){let i=Un(o,void 0)[0];i&&r.push(i);}else if(/^\s*in\s+/.test(o)){let i=o.replace(/^\s*in\s+/,"").replace(/\s*\(at .*\)$/,"");r.push({function:i,raw:o});}else if(o.match(Mo)){let i=zn(o,void 0)[0];i&&r.push(i);}return Wt(r,t)}return e.match(Jn)?Un(e,t):zn(e,t)},er=e=>{if(!e.includes(":"))return [e,void 0,void 0];let t=/(.+?)(?::(\d+))?(?::(\d+))?$/,n=t.exec(e.replace(/[()]/g,""));return [n[1],n[2]||void 0,n[3]||void 0]},Wt=(e,t)=>t&&t.slice!=null?Array.isArray(t.slice)?e.slice(t.slice[0],t.slice[1]):e.slice(0,t.slice):e;var Un=(e,t)=>Wt(e.split(`
|
|
20
|
+
`).filter(r=>!!r.match(Jn)),t).map(r=>{let o=r;o.includes("(eval ")&&(o=o.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let i=o.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),s=i.match(/ (\(.+\)$)/);i=s?i.replace(s[0],""):i;let a=er(s?s[1]:i),l=s&&i||void 0,f=["eval","<anonymous>"].includes(a[0])?void 0:a[0];return {function:l,file:f,line:a[1]?+a[1]:void 0,col:a[2]?+a[2]:void 0,raw:o}});var zn=(e,t)=>Wt(e.split(`
|
|
21
|
+
`).filter(r=>!r.match(Po)),t).map(r=>{let o=r;if(o.includes(" > eval")&&(o=o.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!o.includes("@")&&!o.includes(":"))return {function:o};{let i=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,s=o.match(i),a=s&&s[1]?s[1]:void 0,l=er(o.replace(i,""));return {function:a,file:l[0],line:l[1]?+l[1]:void 0,col:l[2]?+l[2]:void 0,raw:o}}});var Lo=Oo((e,t)=>{(function(n,r){typeof e=="object"&&t!==void 0?r(e):typeof define=="function"&&define.amd?define(["exports"],r):(n=typeof globalThis<"u"?globalThis:n||self,r(n.sourcemapCodec={}));})(void 0,function(n){let r=44,o=59,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=new Uint8Array(64),a=new Uint8Array(128);for(let w=0;w<i.length;w++){let u=i.charCodeAt(w);s[w]=u,a[u]=w;}function l(w,u){let c=0,m=0,y=0;do{let D=w.next();y=a[D],c|=(y&31)<<m,m+=5;}while(y&32);let E=c&1;return c>>>=1,E&&(c=-2147483648|-c),u+c}function f(w,u,c){let m=u-c;m=m<0?-m<<1|1:m<<1;do{let y=m&31;m>>>=5,m>0&&(y|=32),w.write(s[y]);}while(m>0);return u}function d(w,u){return w.pos>=u?false:w.peek()!==r}let g=1024*16,p=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(w){return Buffer.from(w.buffer,w.byteOffset,w.byteLength).toString()}}:{decode(w){let u="";for(let c=0;c<w.length;c++)u+=String.fromCharCode(w[c]);return u}};class x{constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(g);}write(u){let{buffer:c}=this;c[this.pos++]=u,this.pos===g&&(this.out+=p.decode(c),this.pos=0);}flush(){let{buffer:u,out:c,pos:m}=this;return m>0?c+p.decode(u.subarray(0,m)):c}}class S{constructor(u){this.pos=0,this.buffer=u;}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(u){let{buffer:c,pos:m}=this,y=c.indexOf(u,m);return y===-1?c.length:y}}let C=[];function R(w){let{length:u}=w,c=new S(w),m=[],y=[],E=0;for(;c.pos<u;c.pos++){E=l(c,E);let D=l(c,0);if(!d(c,u)){let U=y.pop();U[2]=E,U[3]=D;continue}let I=l(c,0),M=l(c,0),B=M&1,H=B?[E,D,0,0,I,l(c,0)]:[E,D,0,0,I],Y=C;if(d(c,u)){Y=[];do{let U=l(c,0);Y.push(U);}while(d(c,u))}H.vars=Y,m.push(H),y.push(H);}return m}function T(w){let u=new x;for(let c=0;c<w.length;)c=A(w,c,u,[0]);return u.flush()}function A(w,u,c,m){let y=w[u],{0:E,1:D,2:I,3:M,4:B,vars:H}=y;u>0&&c.write(r),m[0]=f(c,E,m[0]),f(c,D,0),f(c,B,0);let Y=y.length===6?1:0;f(c,Y,0),y.length===6&&f(c,y[5],0);for(let U of H)f(c,U,0);for(u++;u<w.length;){let U=w[u],{0:F,1:j}=U;if(F>I||F===I&&j>=M)break;u=A(w,u,c,m);}return c.write(r),m[0]=f(c,I,m[0]),f(c,M,0),u}function O(w){let{length:u}=w,c=new S(w),m=[],y=[],E=0,D=0,I=0,M=0,B=0,H=0,Y=0,U=0;do{let F=c.indexOf(";"),j=0;for(;c.pos<F;c.pos++){if(j=l(c,j),!d(c,F)){let ee=y.pop();ee[2]=E,ee[3]=j;continue}let J=l(c,0),$e=J&1,Oe=J&2,xe=J&4,je=null,ke=C,me;if($e){let ee=l(c,D);I=l(c,D===ee?I:0),D=ee,me=[E,j,0,0,ee,I];}else me=[E,j,0,0];if(me.isScope=!!xe,Oe){let ee=M,he=B;M=l(c,M);let be=ee===M;B=l(c,be?B:0),H=l(c,be&&he===B?H:0),je=[M,B,H];}if(me.callsite=je,d(c,F)){ke=[];do{Y=E,U=j;let ee=l(c,0),he;if(ee<-1){he=[[l(c,0)]];for(let be=-1;be>ee;be--){let vt=Y;Y=l(c,Y),U=l(c,Y===vt?U:0);let tt=l(c,0);he.push([tt,Y,U]);}}else he=[[ee]];ke.push(he);}while(d(c,F))}me.bindings=ke,m.push(me),y.push(me);}E++,c.pos=F+1;}while(c.pos<u);return m}function N(w){if(w.length===0)return "";let u=new x;for(let c=0;c<w.length;)c=_(w,c,u,[0,0,0,0,0,0,0]);return u.flush()}function _(w,u,c,m){let y=w[u],{0:E,1:D,2:I,3:M,isScope:B,callsite:H,bindings:Y}=y;m[0]<E?(L(c,m[0],E),m[0]=E,m[1]=0):u>0&&c.write(r),m[1]=f(c,y[1],m[1]);let U=(y.length===6?1:0)|(H?2:0)|(B?4:0);if(f(c,U,0),y.length===6){let{4:F,5:j}=y;F!==m[2]&&(m[3]=0),m[2]=f(c,F,m[2]),m[3]=f(c,j,m[3]);}if(H){let{0:F,1:j,2:J}=y.callsite;F===m[4]?j!==m[5]&&(m[6]=0):(m[5]=0,m[6]=0),m[4]=f(c,F,m[4]),m[5]=f(c,j,m[5]),m[6]=f(c,J,m[6]);}if(Y)for(let F of Y){F.length>1&&f(c,-F.length,0);let j=F[0][0];f(c,j,0);let J=E,$e=D;for(let Oe=1;Oe<F.length;Oe++){let xe=F[Oe];J=f(c,xe[1],J),$e=f(c,xe[2],$e),f(c,xe[0],0);}}for(u++;u<w.length;){let F=w[u],{0:j,1:J}=F;if(j>I||j===I&&J>=M)break;u=_(w,u,c,m);}return m[0]<I?(L(c,m[0],I),m[0]=I,m[1]=0):c.write(r),m[1]=f(c,M,m[1]),u}function L(w,u,c){do w.write(o);while(++u<c)}function ne(w){let{length:u}=w,c=new S(w),m=[],y=0,E=0,D=0,I=0,M=0;do{let B=c.indexOf(";"),H=[],Y=true,U=0;for(y=0;c.pos<B;){let F;y=l(c,y),y<U&&(Y=false),U=y,d(c,B)?(E=l(c,E),D=l(c,D),I=l(c,I),d(c,B)?(M=l(c,M),F=[y,E,D,I,M]):F=[y,E,D,I]):F=[y],H.push(F),c.pos++;}Y||oe(H),m.push(H),c.pos=B+1;}while(c.pos<=u);return m}function oe(w){w.sort(ae);}function ae(w,u){return w[0]-u[0]}function Ce(w){let u=new x,c=0,m=0,y=0,E=0;for(let D=0;D<w.length;D++){let I=w[D];if(D>0&&u.write(o),I.length===0)continue;let M=0;for(let B=0;B<I.length;B++){let H=I[B];B>0&&u.write(r),M=f(u,H[0],M),H.length!==1&&(c=f(u,H[1],c),m=f(u,H[2],m),y=f(u,H[3],y),H.length!==4&&(E=f(u,H[4],E)));}}return u.flush()}n.decode=ne,n.decodeGeneratedRanges=O,n.decodeOriginalScopes=R,n.encode=Ce,n.encodeGeneratedRanges=N,n.encodeOriginalScopes=T,Object.defineProperty(n,"__esModule",{value:true});});}),tr=_o(Lo()),nr=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,Do=/^data:application\/json[^,]+base64,/,Ho=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/,rr=typeof WeakRef<"u",Ze=new Map,xt=new Map,Bo=e=>rr&&e instanceof WeakRef,qn=(e,t,n,r)=>{if(n<0||n>=e.length)return null;let o=e[n];if(!o||o.length===0)return null;let i=null;for(let d of o)if(d[0]<=r)i=d;else break;if(!i||i.length<4)return null;let[,s,a,l]=i;if(s===void 0||a===void 0||l===void 0)return null;let f=t[s];return f?{columnNumber:l,fileName:f,lineNumber:a+1}:null},jo=(e,t,n)=>{if(e.sections){let r=null;for(let s of e.sections)if(t>s.offset.line||t===s.offset.line&&n>=s.offset.column)r=s;else break;if(!r)return null;let o=t-r.offset.line,i=t===r.offset.line?n-r.offset.column:n;return qn(r.map.mappings,r.map.sources,o,i)}return qn(e.mappings,e.sources,t-1,n)},Vo=(e,t)=>{let n=t.split(`
|
|
22
|
+
`),r;for(let i=n.length-1;i>=0&&!r;i--){let s=n[i].match(Ho);s&&(r=s[1]||s[2]);}if(!r)return null;let o=nr.test(r);if(!(Do.test(r)||o||r.startsWith("/"))){let i=e.split("/");i[i.length-1]=r,r=i.join("/");}return r},Yo=e=>({file:e.file,mappings:(0, tr.decode)(e.mappings),names:e.names,sourceRoot:e.sourceRoot,sources:e.sources,sourcesContent:e.sourcesContent,version:3}),Go=e=>{let t=e.sections.map(({map:r,offset:o})=>({map:{...r,mappings:(0, tr.decode)(r.mappings)},offset:o})),n=new Set;for(let r of t)for(let o of r.map.sources)n.add(o);return {file:e.file,mappings:[],names:[],sections:t,sourceRoot:void 0,sources:Array.from(n),sourcesContent:void 0,version:3}},Xn=e=>{if(!e)return false;let t=e.trim();if(!t)return false;let n=t.match(nr);if(!n)return true;let r=n[0].toLowerCase();return r==="http:"||r==="https:"},Uo=async(e,t=fetch)=>{if(!Xn(e))return null;let n;try{n=await(await t(e)).text();}catch{return null}if(!n)return null;let r=Vo(e,n);if(!r||!Xn(r))return null;try{let o=await t(r),i=await o.json();return "sections"in i?Go(i):Yo(i)}catch{return null}},zo=async(e,t=true,n)=>{if(t&&Ze.has(e)){let i=Ze.get(e);if(i==null)return null;if(Bo(i)){let s=i.deref();if(s)return s;Ze.delete(e);}else return i}if(t&&xt.has(e))return xt.get(e);let r=Uo(e,n);t&&xt.set(e,r);let o=await r;return t&&xt.delete(e),t&&(o===null?Ze.set(e,null):Ze.set(e,rr?new WeakRef(o):o)),o},Wn=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,qo=["rsc://","file:///","webpack://","node:","turbopack://","metro://"],Kn="about://React/",Xo=["<anonymous>","eval",""],Wo=/\.(jsx|tsx|ts|js)$/,Ko=/(\.min|bundle|chunk|vendor|vendors|runtime|polyfill|polyfills)\.(js|mjs|cjs)$|(chunk|bundle|vendor|vendors|runtime|polyfill|polyfills|framework|app|main|index)[-_.][A-Za-z0-9_-]{4,}\.(js|mjs|cjs)$|[\da-f]{8,}\.(js|mjs|cjs)$|[-_.][\da-f]{20,}\.(js|mjs|cjs)$|\/dist\/|\/build\/|\/.next\/|\/out\/|\/node_modules\/|\.webpack\.|\.vite\.|\.turbopack\./i,Zo=/^\?[\w~.\-]+(?:=[^&#]*)?(?:&[\w~.\-]+(?:=[^&#]*)?)*$/,Jo=e=>e._debugStack instanceof Error&&typeof e._debugStack?.stack=="string",Qo=e=>{let t=e._debugSource;return t?typeof t=="object"&&!!t&&"fileName"in t&&typeof t.fileName=="string"&&"lineNumber"in t&&typeof t.lineNumber=="number":false},ei=async(e,t=true,n)=>{if(Qo(e))return e._debugSource||null;let r=or(e);return ir(r,void 0,t,n)},or=e=>Jo(e)?Io(e._debugStack.stack):ko(e),ti=async(e,t=true,n)=>{let r=await ir(e,1,t,n);return !r||r.length===0?null:r[0]},ir=async(e,t=1,n=true,r)=>{let o=Qn(e,{slice:t??1}),i=[];for(let s of o){if(!s?.file)continue;let a=await zo(s.file,n,r);if(a&&typeof s.line=="number"&&typeof s.col=="number"){let l=jo(a,s.line,s.col);if(l){i.push(l);continue}}i.push({fileName:s.file,lineNumber:s.line,columnNumber:s.col,functionName:s.function});}return i},Be=e=>{if(!e||Xo.includes(e))return "";let t=e;if(t.startsWith(Kn)){let r=t.slice(Kn.length),o=r.indexOf("/"),i=r.indexOf(":");t=o!==-1&&(i===-1||o<i)?r.slice(o+1):r;}for(let r of qo)if(t.startsWith(r)){t=t.slice(r.length),r==="file:///"&&(t=`/${t.replace(/^\/+/,"")}`);break}if(Wn.test(t)){let r=t.match(Wn);r&&(t=t.slice(r[0].length));}let n=t.indexOf("?");if(n!==-1){let r=t.slice(n);Zo.test(r)&&(t=t.slice(0,n));}return t},Kt=e=>{let t=Be(e);return !(!t||!Wo.test(t)||Ko.test(t))},ni=async(e,t=true,n)=>{let r=De(e,s=>{if(We(s))return true},true);if(r){let s=await ei(r,t,n);if(s?.fileName){let a=Be(s.fileName);if(Kt(a))return {fileName:a,lineNumber:s.lineNumber,columnNumber:s.columnNumber,functionName:s.functionName}}}let o=Qn(or(e),{includeInElement:false}),i=null;for(;o.length;){let s=o.pop();if(!s||!s.raw||!s.file)continue;let a=await ti(s.raw,t,n);if(a)return {fileName:Be(a.fileName),lineNumber:a.lineNumber,columnNumber:a.columnNumber,functionName:a.functionName};i={fileName:Be(s.file),lineNumber:s.line,columnNumber:s.col,functionName:s.function};}return i},sr=async(e,t=true,n)=>{let r=Ke(e);if(!r||!jt(r))return null;let o=Ut(r);return o?ni(o,t,n):null};var ri=new Set(["role","name","aria-label","rel","href"]);function oi(e,t){let n=ri.has(e);n||=e.startsWith("data-")&&Je(e);let r=Je(t)&&t.length<100;return r||=t.startsWith("#")&&Je(t.slice(1)),n&&r}function ii(e){return Je(e)}function si(e){return Je(e)}function ai(e){return true}function lr(e,t){if(e.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(e.tagName.toLowerCase()==="html")return "html";let n={root:document.body,idName:ii,className:si,tagName:ai,attr:oi,timeoutMs:1e3,seedMinLength:3,optimizedMinLength:2,maxNumberOfPathChecks:1/0},r=new Date,o={...n,...t},i=di(o.root,n),s,a=0;for(let f of li(e,o,i)){if(new Date().getTime()-r.getTime()>o.timeoutMs||a>=o.maxNumberOfPathChecks){let g=ui(e,i);if(!g)throw new Error(`Timeout: Can't find a unique selector after ${o.timeoutMs}ms`);return Qe(g)}if(a++,Qt(f,i)){s=f;break}}if(!s)throw new Error("Selector was not found.");let l=[...fr(s,e,o,i,r)];return l.sort(Zt),l.length>0?Qe(l[0]):Qe(s)}function*li(e,t,n){let r=[],o=[],i=e,s=0;for(;i&&i!==n;){let a=ci(i,t);for(let l of a)l.level=s;if(r.push(a),i=i.parentElement,s++,o.push(...ur(r)),s>=t.seedMinLength){o.sort(Zt);for(let l of o)yield l;o=[];}}o.sort(Zt);for(let a of o)yield a;}function Je(e){if(/^[a-z\-]{3,}$/i.test(e)){let t=e.split(/-|[A-Z]/);for(let n of t)if(n.length<=2||/[^aeiou]{4,}/i.test(n))return false;return true}return false}function ci(e,t){let n=[],r=e.getAttribute("id");r&&t.idName(r)&&n.push({name:"#"+CSS.escape(r),penalty:0});for(let s=0;s<e.classList.length;s++){let a=e.classList[s];t.className(a)&&n.push({name:"."+CSS.escape(a),penalty:1});}for(let s=0;s<e.attributes.length;s++){let a=e.attributes[s];t.attr(a.name,a.value)&&n.push({name:`[${CSS.escape(a.name)}="${CSS.escape(a.value)}"]`,penalty:2});}let o=e.tagName.toLowerCase();if(t.tagName(o)){n.push({name:o,penalty:5});let s=Jt(e,o);s!==void 0&&n.push({name:cr(o,s),penalty:10});}let i=Jt(e);return i!==void 0&&n.push({name:fi(o,i),penalty:50}),n}function Qe(e){let t=e[0],n=t.name;for(let r=1;r<e.length;r++){let o=e[r].level||0;t.level===o-1?n=`${e[r].name} > ${n}`:n=`${e[r].name} ${n}`,t=e[r];}return n}function ar(e){return e.map(t=>t.penalty).reduce((t,n)=>t+n,0)}function Zt(e,t){return ar(e)-ar(t)}function Jt(e,t){let n=e.parentNode;if(!n)return;let r=n.firstChild;if(!r)return;let o=0;for(;r&&(r.nodeType===Node.ELEMENT_NODE&&(t===void 0||r.tagName.toLowerCase()===t)&&o++,r!==e);)r=r.nextSibling;return o}function ui(e,t){let n=0,r=e,o=[];for(;r&&r!==t;){let i=r.tagName.toLowerCase(),s=Jt(r,i);if(s===void 0)return;o.push({name:cr(i,s),penalty:NaN,level:n}),r=r.parentElement,n++;}if(Qt(o,t))return o}function fi(e,t){return e==="html"?"html":`${e}:nth-child(${t})`}function cr(e,t){return e==="html"?"html":`${e}:nth-of-type(${t})`}function*ur(e,t=[]){if(e.length>0)for(let n of e[0])yield*ur(e.slice(1,e.length),t.concat(n));else yield t;}function di(e,t){return e.nodeType===Node.DOCUMENT_NODE?e:e===t.root?e.ownerDocument:e}function Qt(e,t){let n=Qe(e);switch(t.querySelectorAll(n).length){case 0:throw new Error(`Can't select any node with this selector: ${n}`);case 1:return true;default:return false}}function*fr(e,t,n,r,o){if(e.length>2&&e.length>n.optimizedMinLength)for(let i=1;i<e.length-1;i++){if(new Date().getTime()-o.getTime()>n.timeoutMs)return;let a=[...e];a.splice(i,1),Qt(a,r)&&r.querySelector(Qe(a))===t&&(yield a,yield*fr(a,t,n,r,o));}}zt({onCommitFiberRoot(e,t){Ct.add(t);}});var mi=e=>lr(e),en=async e=>{let t=(u,c)=>u.length>c?`${u.substring(0,c)}...`:u,n=u=>!!(u.startsWith("_")||u.includes("Provider")&&u.includes("Context")),r=u=>{let c=Ke(u);if(!c)return null;let m=null;return De(c,y=>{if(We(y)){let E=He(y);if(E&&!n(E))return m=E,true}return false},true),m},o=async u=>{let c=await sr(u);if(!c)return null;let m=Be(c.fileName);return Kt(m)?`${m}:${c.lineNumber}:${c.columnNumber}`:null},i=new Set(["article","aside","footer","form","header","main","nav","section"]),s=u=>{let c=u.tagName.toLowerCase();if(i.has(c)||u.id)return true;if(u.className&&typeof u.className=="string"){let m=u.className.trim();if(m&&m.length>0)return true}return Array.from(u.attributes).some(m=>m.name.startsWith("data-"))},a=(u,c=10)=>{let m=[],y=u.parentElement,E=0;for(;y&&E<c&&y.tagName!=="BODY"&&!(s(y)&&(m.push(y),m.length>=3));)y=y.parentElement,E++;return m.reverse()},l=(u,c=false)=>{let m=u.tagName.toLowerCase(),y=[];if(u.id&&y.push(`id="${u.id}"`),u.className&&typeof u.className=="string"){let M=u.className.trim().split(/\s+/);if(M.length>0&&M[0]){let B=c?M.slice(0,3):M,H=t(B.join(" "),30);y.push(`class="${H}"`);}}let E=Array.from(u.attributes).filter(M=>M.name.startsWith("data-")),D=c?E.slice(0,1):E;for(let M of D)y.push(`${M.name}="${t(M.value,20)}"`);let I=u.getAttribute("aria-label");return I&&!c&&y.push(`aria-label="${t(I,20)}"`),y.length>0?`<${m} ${y.join(" ")}>`:`<${m}>`},f=u=>`</${u.tagName.toLowerCase()}>`,d=u=>{let c=(u.textContent||"").trim().replace(/\s+/g," ");return t(c,60)},g=u=>{if(u.id)return `#${u.id}`;if(u.className&&typeof u.className=="string"){let c=u.className.trim().split(/\s+/);if(c.length>0&&c[0])return `.${c[0]}`}return null},p=[],x=mi(e);p.push("Locate this element in the codebase:"),p.push(`- selector: ${x}`);let S=e.getBoundingClientRect();p.push(`- width: ${Math.round(S.width)}`),p.push(`- height: ${Math.round(S.height)}`),p.push("HTML snippet:"),p.push("```html");let C=a(e),R=C.map(u=>r(u)),T=r(e),A=await Promise.all(C.map(u=>o(u))),O=await o(e);for(let u=0;u<C.length;u++){let c=" ".repeat(u),m=R[u],y=A[u];m&&y&&(u===0||R[u-1]!==m)&&p.push(`${c}<${m} source="${y}">`),p.push(`${c}${l(C[u],true)}`);}let N=e.parentElement,_=-1;if(N){let u=Array.from(N.children);if(_=u.indexOf(e),_>0){let c=u[_-1];if(g(c)&&_<=2){let y=" ".repeat(C.length);p.push(`${y} ${l(c,true)}`),p.push(`${y} </${c.tagName.toLowerCase()}>`);}else if(_>0){let y=" ".repeat(C.length);p.push(`${y} ... (${_} element${_===1?"":"s"})`);}}}let L=" ".repeat(C.length),ne=C.length>0?R[R.length-1]:null,oe=T&&O&&T!==ne;oe&&p.push(`${L} <${T} used-at="${O}">`),p.push(`${L} <!-- IMPORTANT: selected element -->`);let ae=d(e),Ce=e.children.length,w=`${L}${oe?" ":" "}`;if(ae&&Ce===0&&ae.length<40?p.push(`${w}${l(e)}${ae}${f(e)}`):(p.push(`${w}${l(e)}`),ae&&p.push(`${w} ${ae}`),Ce>0&&p.push(`${w} ... (${Ce} element${Ce===1?"":"s"})`),p.push(`${w}${f(e)}`)),oe&&p.push(`${L} </${T}>`),N&&_>=0){let u=Array.from(N.children),c=u.length-_-1;if(c>0){let m=u[_+1];g(m)&&c<=2?(p.push(`${L} ${l(m,true)}`),p.push(`${L} </${m.tagName.toLowerCase()}>`)):p.push(`${L} ... (${c} element${c===1?"":"s"})`);}}for(let u=C.length-1;u>=0;u--){let c=" ".repeat(u);p.push(`${c}${f(C[u])}`);let m=R[u],y=A[u];m&&y&&(u===C.length-1||R[u+1]!==m)&&p.push(`${c}</${m}>`);}return p.push("```"),p.join(`
|
|
23
|
+
`)};var hi=()=>document.hasFocus()?Promise.resolve():new Promise(e=>{let t=()=>{window.removeEventListener("focus",t),e();};window.addEventListener("focus",t),window.focus();}),tn=async e=>{await hi();try{if(Array.isArray(e)){if(!navigator?.clipboard?.write){for(let t of e)if(typeof t=="string"){let n=dr(t);if(!n)return n}return !0}return await navigator.clipboard.write([new ClipboardItem(Object.fromEntries(e.map(t=>t instanceof Blob?[t.type??"text/plain",t]:["text/plain",new Blob([t],{type:"text/plain"})])))]),!0}else {if(e instanceof Blob)return await navigator.clipboard.write([new ClipboardItem({[e.type]:e})]),!0;try{return await navigator.clipboard.writeText(String(e)),!0}catch{return dr(e)}}}catch{return false}},dr=e=>{if(!document.execCommand)return false;let t=document.createElement("textarea");t.value=String(e),t.style.clipPath="inset(50%)",t.ariaHidden="true",(document.body||document.documentElement).append(t);try{return t.select(),document.execCommand("copy")}finally{t.remove();}};var mr=(e,t=window.getComputedStyle(e))=>t.display!=="none"&&t.visibility!=="hidden"&&t.opacity!=="0";var et=e=>{if(e.closest(`[${Le}]`))return false;let t=window.getComputedStyle(e);return !(!mr(e,t)||t.pointerEvents==="none")};var nn=(e,t)=>{let n=document.elementsFromPoint(e,t);for(let r of n)if(et(r))return r;return null};var hr=(e,t,n)=>{let r=[],o=Array.from(document.querySelectorAll("*")),i=e.x,s=e.y,a=e.x+e.width,l=e.y+e.height;for(let f of o){if(!n){let C=(f.tagName||"").toUpperCase();if(C==="HTML"||C==="BODY")continue}if(!t(f))continue;let d=f.getBoundingClientRect(),g=d.left,p=d.top,x=d.left+d.width,S=d.top+d.height;if(n){let C=Math.max(i,g),R=Math.max(s,p),T=Math.min(a,x),A=Math.min(l,S),O=Math.max(0,T-C),N=Math.max(0,A-R),_=O*N,L=Math.max(0,d.width*d.height);L>0&&_/L>=.75&&r.push(f);}else g<a&&x>i&&p<l&&S>s&&r.push(f);}return r},gr=e=>e.filter(t=>!e.some(n=>n!==t&&n.contains(t))),pr=(e,t,n)=>{if(e.length<=1)return null;let r=t.x,o=t.y,i=t.x+t.width,s=t.y+t.height,a=e[0];for(;a;){let l=a.parentElement;if(!l)break;let f=l.getBoundingClientRect(),d=Math.max(r,f.left),g=Math.max(o,f.top),p=Math.min(i,f.left+f.width),x=Math.min(s,f.top+f.height),S=Math.max(0,p-d),C=Math.max(0,x-g),R=S*C,T=Math.max(0,f.width*f.height);if(!(T>0&&R/T>=.75))break;if(!n(l)){a=l;continue}if(e.every(N=>l.contains(N)))return l;a=l;}return null},br=(e,t)=>{let n=hr(e,t,true),r=gr(n),o=pr(r,e,t);return o?[o]:r},yr=(e,t)=>{let n=hr(e,t,false),r=gr(n),o=pr(r,e,t);return o?[o]:r};var rn=e=>{let t=e.getBoundingClientRect(),n=window.getComputedStyle(e);return {borderRadius:n.borderRadius||"0px",height:t.height,transform:n.transform||"none",width:t.width,x:t.left,y:t.top}};var gi=150,wr=e=>{let t={enabled:true,keyHoldDuration:300,...e};if(t.enabled!==false)return Ae(n=>{let[o,i]=$(false),[s,a]=$(-1e3),[l,f]=$(-1e3),[d,g]=$(false),[p,x]=$(-1e3),[S,C]=$(-1e3),[R,T]=$(false),[A,O]=$(null),[N,_]=$(null),[L,ne]=$(0),[oe,ae]=$([]),[Ce,w]=$([]),[u,c]=$(false),[m,y]=$(false),[E,D]=$(false),[I,M]=$(-1e3),[B,H]=$(-1e3),Y=null,U=null,F=null,j=null,J=z(()=>u()&&!R()),$e=z(()=>s()>-1e3&&l()>-1e3),Oe=h=>(h.metaKey||h.ctrlKey)&&h.key.toLowerCase()==="c",xe=h=>{let v=`grabbed-${Date.now()}-${Math.random()}`,G=Date.now(),W={id:v,bounds:h,createdAt:G},Z=oe();ae([...Z,W]),setTimeout(()=>{ae(ge=>ge.filter(Ve=>Ve.id!==v));},1700);},je=(h,v,G)=>{let W=`success-${Date.now()}-${Math.random()}`;w(Z=>[...Z,{id:W,text:h,x:v,y:G}]),setTimeout(()=>{w(Z=>Z.filter(ge=>ge.id!==W));},1700);},ke=h=>`<selected_element>
|
|
24
|
+
${h}
|
|
25
|
+
</selected_element>`,me=h=>{let v=window.getComputedStyle(h),G=h.getBoundingClientRect();return {width:`${Math.round(G.width)}px`,height:`${Math.round(G.height)}px`,paddingTop:v.paddingTop,paddingRight:v.paddingRight,paddingBottom:v.paddingBottom,paddingLeft:v.paddingLeft,background:v.background,opacity:v.opacity}},ee=h=>{let v={elements:h.map(Z=>({tagName:Z.tagName,content:Z.content,computedStyles:Z.computedStyles}))},W=`<div data-react-grab="${btoa(JSON.stringify(v))}"></div>`;return new Blob([W],{type:"text/html"})},he=h=>(h.tagName||"").toLowerCase(),be=async(h,v,G)=>{M(h),H(v),T(true),await G().finally(()=>{T(false);});},vt=async h=>{let v=he(h);xe(rn(h));try{let G=await en(h),W=ke(G),Z=ee([{tagName:v,content:G,computedStyles:me(h)}]);await tn([W,Z]);}catch{}je(v?`<${v}>`:"<element>",I(),B());},tt=async h=>{if(h.length!==0){for(let v of h)xe(rn(v));try{let v=await Promise.all(h.map(Ve=>en(Ve))),G=v.join(`
|
|
39
26
|
|
|
40
27
|
---
|
|
41
28
|
|
|
42
|
-
`),
|
|
29
|
+
`),W=ke(G),Z=v.map((Ve,fn)=>({tagName:he(h[fn]),content:Ve,computedStyles:me(h[fn])})),ge=ee(Z);await tn([W,ge]);}catch{}je(`${h.length} elements`,I(),B());}},Ne=z(()=>!J()||d()?null:nn(s(),l())),Sr=z(()=>{let h=Ne();if(!h)return;let v=h.getBoundingClientRect(),G=window.getComputedStyle(h);return {borderRadius:G.borderRadius||"0px",height:v.height,transform:G.transform||"none",width:v.width,x:v.left,y:v.top}}),nt=2,on=(h,v)=>({x:Math.abs(h-p()),y:Math.abs(v-S())}),sn=z(()=>{if(!d())return false;let h=on(s(),l());return h.x>nt||h.y>nt}),an=(h,v)=>{let G=Math.min(p(),h),W=Math.min(S(),v),Z=Math.abs(h-p()),ge=Math.abs(v-S());return {x:G,y:W,width:Z,height:ge}},Tr=z(()=>{if(!sn())return;let h=an(s(),l());return {borderRadius:"0px",height:h.height,transform:"none",width:h.width,x:h.x,y:h.y}}),Cr=z(()=>{let h=Ne();return h?`<${he(h)}>`:"<element>"}),ln=z(()=>R()?{x:I(),y:B()}:{x:s(),y:l()}),xr=z(()=>!!(Ne()&&Ne()===A()));te(Ee(()=>[Ne(),A()],([h,v])=>{v&&h&&v!==h&&O(null);}));let cn=z(()=>{let h=N();if(L(),h===null)return 0;let v=Date.now()-h;return Math.min(v/t.keyHoldDuration,1)}),vr=()=>{_(Date.now()),y(false),F=window.setTimeout(()=>{y(true),F=null;},gi);let h=()=>{if(N()===null)return;ne(G=>G+1),cn()<1&&(U=requestAnimationFrame(h));};h();},Et=()=>{U!==null&&(cancelAnimationFrame(U),U=null),F!==null&&(window.clearTimeout(F),F=null),_(null),y(false);},Er=()=>{Et(),c(true),document.body.style.cursor="crosshair";},Rt=()=>{i(false),c(false),document.body.style.cursor="",d()&&(g(false),document.body.style.userSelect=""),Y&&window.clearTimeout(Y),j&&window.clearTimeout(j),Et();},un=new AbortController,_e=un.signal;window.addEventListener("keydown",h=>{if(h.key==="Escape"&&o()){Rt();return}_n(h)||Oe(h)&&(o()||(i(true),vr(),Y=window.setTimeout(()=>{Er(),t.onActivate?.();},t.keyHoldDuration)),u()&&(j&&window.clearTimeout(j),j=window.setTimeout(()=>{Rt();},200)));},{signal:_e}),window.addEventListener("keyup",h=>{if(!o()&&!u())return;let v=!h.metaKey&&!h.ctrlKey;(h.key.toLowerCase()==="c"||v)&&Rt();},{signal:_e,capture:true}),window.addEventListener("mousemove",h=>{a(h.clientX),f(h.clientY);},{signal:_e}),window.addEventListener("mousedown",h=>{!J()||R()||(h.preventDefault(),g(true),x(h.clientX),C(h.clientY),document.body.style.userSelect="none");},{signal:_e}),window.addEventListener("mouseup",h=>{if(!d())return;let v=on(h.clientX,h.clientY),G=v.x>nt||v.y>nt;if(g(false),document.body.style.userSelect="",G){D(true);let W=an(h.clientX,h.clientY),Z=br(W,et);if(Z.length>0)be(h.clientX,h.clientY,()=>tt(Z));else {let ge=yr(W,et);ge.length>0&&be(h.clientX,h.clientY,()=>tt(ge));}}else {let W=nn(h.clientX,h.clientY);if(!W)return;O(W),be(h.clientX,h.clientY,()=>vt(W));}},{signal:_e}),window.addEventListener("click",h=>{E()&&(h.preventDefault(),h.stopPropagation(),D(false));},{signal:_e,capture:true}),document.addEventListener("visibilitychange",()=>{document.hidden&&ae([]);},{signal:_e}),ce(()=>{un.abort(),Y&&window.clearTimeout(Y),j&&window.clearTimeout(j),Et(),document.body.style.userSelect="",document.body.style.cursor="";});let Rr=An(),Or=z(()=>false),Nr=z(()=>J()&&sn()),_r=z(()=>R()?"processing":"hover"),Ar=z(()=>J()&&!d()&&(!!Ne()&&!xr()||!Ne())||R()),Fr=z(()=>o()&&m()&&$e()),$r=z(()=>J()&&!d());return On(()=>k(Mn,{get selectionVisible(){return Or()},get selectionBounds(){return Sr()},get dragVisible(){return Nr()},get dragBounds(){return Tr()},get grabbedBoxes(){return oe()},get successLabels(){return Ce()},get labelVariant(){return _r()},get labelText(){return Cr()},get labelX(){return ln().x},get labelY(){return ln().y},get labelVisible(){return Ar()},get progressVisible(){return Fr()},get progress(){return cn()},get mouseX(){return s()},get mouseY(){return l()},get crosshairVisible(){return $r()}}),Rr),n})};wr();/*! Bundled license information:
|
|
43
30
|
|
|
44
31
|
bippy/dist/rdt-hook-DAGphl8S.js:
|
|
45
32
|
(**
|
|
@@ -100,4 +87,4 @@ bippy/dist/source.js:
|
|
|
100
87
|
* This source code is licensed under the MIT license found in the
|
|
101
88
|
* LICENSE file in the root directory of this source tree.
|
|
102
89
|
*)
|
|
103
|
-
*/exports.init=
|
|
90
|
+
*/exports.init=wr;return exports;})({});
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { render, createComponent, memo, template, effect, style, insert, setStyleProperty, use } from 'solid-js/web';
|
|
2
2
|
import { createRoot, createSignal, createMemo, createEffect, on, onCleanup, Show, For, onMount } from 'solid-js';
|
|
3
|
-
import { domToPng } from 'modern-screenshot';
|
|
4
3
|
import { instrument, _fiberRoots, getFiberFromHostInstance, traverseFiber, isCompositeFiber, getDisplayName } from 'bippy';
|
|
5
4
|
import { getSourceFromHostInstance, normalizeFileName, isSourceFile } from 'bippy/dist/source';
|
|
6
5
|
import { finder } from '@medv/finder';
|
|
@@ -1161,7 +1160,6 @@ var createElementBounds = (element) => {
|
|
|
1161
1160
|
|
|
1162
1161
|
// src/core.tsx
|
|
1163
1162
|
var PROGRESS_INDICATOR_DELAY_MS = 150;
|
|
1164
|
-
var QUICK_REPRESS_THRESHOLD_MS = 150;
|
|
1165
1163
|
var init = (rawOptions) => {
|
|
1166
1164
|
const options = {
|
|
1167
1165
|
enabled: true,
|
|
@@ -1188,14 +1186,12 @@ var init = (rawOptions) => {
|
|
|
1188
1186
|
const [isActivated, setIsActivated] = createSignal(false);
|
|
1189
1187
|
const [showProgressIndicator, setShowProgressIndicator] = createSignal(false);
|
|
1190
1188
|
const [didJustDrag, setDidJustDrag] = createSignal(false);
|
|
1191
|
-
const [isModifierHeld, setIsModifierHeld] = createSignal(false);
|
|
1192
1189
|
const [copyStartX, setCopyStartX] = createSignal(OFFSCREEN_POSITION);
|
|
1193
1190
|
const [copyStartY, setCopyStartY] = createSignal(OFFSCREEN_POSITION);
|
|
1194
1191
|
let holdTimerId = null;
|
|
1195
1192
|
let progressAnimationId = null;
|
|
1196
1193
|
let progressDelayTimerId = null;
|
|
1197
1194
|
let keydownSpamTimerId = null;
|
|
1198
|
-
let lastDeactivationTime = null;
|
|
1199
1195
|
const isRendererActive = createMemo(() => isActivated() && !isCopying());
|
|
1200
1196
|
const hasValidMousePosition = createMemo(() => mouseX() > OFFSCREEN_POSITION && mouseY() > OFFSCREEN_POSITION);
|
|
1201
1197
|
const isTargetKeyCombination = (event) => (event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "c";
|
|
@@ -1276,18 +1272,7 @@ ${context}
|
|
|
1276
1272
|
content,
|
|
1277
1273
|
computedStyles: extractRelevantComputedStyles(targetElement2)
|
|
1278
1274
|
}]);
|
|
1279
|
-
|
|
1280
|
-
try {
|
|
1281
|
-
const screenshotDataUrl = await domToPng(targetElement2);
|
|
1282
|
-
const response = await fetch(screenshotDataUrl);
|
|
1283
|
-
const pngBlob = await response.blob();
|
|
1284
|
-
const imagePngBlob = new Blob([pngBlob], {
|
|
1285
|
-
type: "image/png"
|
|
1286
|
-
});
|
|
1287
|
-
clipboardData.push(imagePngBlob);
|
|
1288
|
-
} catch {
|
|
1289
|
-
}
|
|
1290
|
-
await copyContent(clipboardData);
|
|
1275
|
+
await copyContent([plainTextContent, htmlContent]);
|
|
1291
1276
|
} catch {
|
|
1292
1277
|
}
|
|
1293
1278
|
showTemporarySuccessLabel(tagName ? `<${tagName}>` : "<element>", copyStartX(), copyStartY());
|
|
@@ -1307,20 +1292,7 @@ ${context}
|
|
|
1307
1292
|
computedStyles: extractRelevantComputedStyles(targetElements[index])
|
|
1308
1293
|
}));
|
|
1309
1294
|
const htmlContent = createStructuredClipboardHtmlBlob(structuredElements);
|
|
1310
|
-
|
|
1311
|
-
if (targetElements.length > 0) {
|
|
1312
|
-
try {
|
|
1313
|
-
const screenshotDataUrl = await domToPng(targetElements[0]);
|
|
1314
|
-
const response = await fetch(screenshotDataUrl);
|
|
1315
|
-
const pngBlob = await response.blob();
|
|
1316
|
-
const imagePngBlob = new Blob([pngBlob], {
|
|
1317
|
-
type: "image/png"
|
|
1318
|
-
});
|
|
1319
|
-
clipboardData.push(imagePngBlob);
|
|
1320
|
-
} catch {
|
|
1321
|
-
}
|
|
1322
|
-
}
|
|
1323
|
-
await copyContent(clipboardData);
|
|
1295
|
+
await copyContent([plainTextContent, htmlContent]);
|
|
1324
1296
|
} catch {
|
|
1325
1297
|
}
|
|
1326
1298
|
showTemporarySuccessLabel(`${targetElements.length} elements`, copyStartX(), copyStartY());
|
|
@@ -1435,12 +1407,9 @@ ${context}
|
|
|
1435
1407
|
setIsActivated(true);
|
|
1436
1408
|
document.body.style.cursor = "crosshair";
|
|
1437
1409
|
};
|
|
1438
|
-
const deactivateRenderer = (
|
|
1410
|
+
const deactivateRenderer = () => {
|
|
1439
1411
|
setIsHoldingKeys(false);
|
|
1440
1412
|
setIsActivated(false);
|
|
1441
|
-
if (shouldResetModifier) {
|
|
1442
|
-
setIsModifierHeld(false);
|
|
1443
|
-
}
|
|
1444
1413
|
document.body.style.cursor = "";
|
|
1445
1414
|
if (isDragging()) {
|
|
1446
1415
|
setIsDragging(false);
|
|
@@ -1449,38 +1418,23 @@ ${context}
|
|
|
1449
1418
|
if (holdTimerId) window.clearTimeout(holdTimerId);
|
|
1450
1419
|
if (keydownSpamTimerId) window.clearTimeout(keydownSpamTimerId);
|
|
1451
1420
|
stopProgressAnimation();
|
|
1452
|
-
lastDeactivationTime = Date.now();
|
|
1453
1421
|
};
|
|
1454
1422
|
const abortController = new AbortController();
|
|
1455
1423
|
const eventListenerSignal = abortController.signal;
|
|
1456
1424
|
window.addEventListener("keydown", (event) => {
|
|
1457
|
-
if (event.metaKey || event.ctrlKey) {
|
|
1458
|
-
setIsModifierHeld(true);
|
|
1459
|
-
}
|
|
1460
1425
|
if (event.key === "Escape" && isHoldingKeys()) {
|
|
1461
1426
|
deactivateRenderer();
|
|
1462
1427
|
return;
|
|
1463
1428
|
}
|
|
1464
1429
|
if (isKeyboardEventTriggeredByInput(event)) return;
|
|
1465
1430
|
if (isTargetKeyCombination(event)) {
|
|
1466
|
-
const wasRecentlyDeactivated = lastDeactivationTime !== null && Date.now() - lastDeactivationTime < QUICK_REPRESS_THRESHOLD_MS;
|
|
1467
1431
|
if (!isHoldingKeys()) {
|
|
1468
1432
|
setIsHoldingKeys(true);
|
|
1469
|
-
|
|
1433
|
+
startProgressAnimation();
|
|
1434
|
+
holdTimerId = window.setTimeout(() => {
|
|
1470
1435
|
activateRenderer();
|
|
1471
1436
|
options.onActivate?.();
|
|
1472
|
-
|
|
1473
|
-
if (element) {
|
|
1474
|
-
setLastGrabbedElement(element);
|
|
1475
|
-
void executeCopyOperation(mouseX(), mouseY(), () => copySingleElementToClipboard(element));
|
|
1476
|
-
}
|
|
1477
|
-
} else {
|
|
1478
|
-
startProgressAnimation();
|
|
1479
|
-
holdTimerId = window.setTimeout(() => {
|
|
1480
|
-
activateRenderer();
|
|
1481
|
-
options.onActivate?.();
|
|
1482
|
-
}, options.keyHoldDuration);
|
|
1483
|
-
}
|
|
1437
|
+
}, options.keyHoldDuration);
|
|
1484
1438
|
}
|
|
1485
1439
|
if (isActivated()) {
|
|
1486
1440
|
if (keydownSpamTimerId) window.clearTimeout(keydownSpamTimerId);
|
|
@@ -1493,16 +1447,11 @@ ${context}
|
|
|
1493
1447
|
signal: eventListenerSignal
|
|
1494
1448
|
});
|
|
1495
1449
|
window.addEventListener("keyup", (event) => {
|
|
1450
|
+
if (!isHoldingKeys() && !isActivated()) return;
|
|
1496
1451
|
const isReleasingModifier = !event.metaKey && !event.ctrlKey;
|
|
1497
1452
|
const isReleasingC = event.key.toLowerCase() === "c";
|
|
1498
|
-
if (isReleasingModifier) {
|
|
1499
|
-
|
|
1500
|
-
}
|
|
1501
|
-
if (!isHoldingKeys() && !isActivated()) return;
|
|
1502
|
-
if (isReleasingC) {
|
|
1503
|
-
deactivateRenderer(false);
|
|
1504
|
-
} else if (isReleasingModifier) {
|
|
1505
|
-
deactivateRenderer(true);
|
|
1453
|
+
if (isReleasingC || isReleasingModifier) {
|
|
1454
|
+
deactivateRenderer();
|
|
1506
1455
|
}
|
|
1507
1456
|
}, {
|
|
1508
1457
|
signal: eventListenerSignal,
|