@memlab/lens 1.0.3 → 2.0.0
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.js +28 -19
- package/dist/memlens.lib.bundle.js +106 -90
- package/dist/memlens.lib.bundle.min.js +1 -1
- package/dist/memlens.run.bundle.js +146 -135
- package/dist/memlens.run.bundle.min.js +1 -1
- package/package.json +2 -2
|
@@ -23,4 +23,4 @@
|
|
|
23
23
|
* SOFTWARE.
|
|
24
24
|
*
|
|
25
25
|
*/
|
|
26
|
-
(()=>{"use strict";var e={23:function(e,t,n){var i,s=this&&this.__classPrivateFieldSet||function(e,t,n,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,n):s?s.value=n:t.set(e,n),n},o=this&&this.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DOMVisualizationExtension=void 0,r(n(150));const l=r(n(271)),a=n(860);class c extends a.BasicExtension{constructor(e){super(e),i.set(this,void 0),s(this,i,new l.default,"f")}afterScan(e){var t;const n=this.scanner;if(n.isDevMode()){const e=n.getDetachedDOMInfo();null===(t=o(this,i,"f"))||void 0===t||t.repaint(e)}}cleanup(){o(this,i,"f")&&"function"==typeof o(this,i,"f").cleanup&&o(this,i,"f").cleanup(),s(this,i,null,"f")}}t.DOMVisualizationExtension=c,i=new WeakMap},54:function(e,t,n){var i,s,o,r,l,a,c,u,d,f,h,p,v=this&&this.__classPrivateFieldSet||function(e,t,n,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,n):s?s.value=n:t.set(e,n),n},m=this&&this.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.DOMObserver=void 0;const y=n(313),g=n(498),b=(0,y.isWeakAPINative)(),w=void 0!==window.MutationObserver;t.DOMObserver=class{constructor(){i.add(this),s.set(this,void 0),o.set(this,void 0),r.set(this,void 0),l.set(this,void 0),a.set(this,void 0),c.set(this,void 0),u.set(this,void 0),v(this,s,0,"f"),v(this,o,0,"f"),v(this,l,[],"f"),v(this,a,new WeakSet,"f"),v(this,u,[],"f"),this.startMonitoring()}register(e){m(this,u,"f").push(e)}startMonitoring(){if(!b||!w)return;if(null!=m(this,r,"f"))return;v(this,r,new MutationObserver((e=>{let t=[];const n=e=>{if(null==e)return;if(e.nodeType!=Node.ELEMENT_NODE)return;const n=e;if(!(0,g.isVisualizerElement)(n)){const e=m(this,i,"m",p).call(this,n);t=[...t,...e]}};e.forEach((e=>{e.addedNodes.forEach(n),e.removedNodes.forEach(n)})),m(this,u,"f").forEach((e=>e(t)))})),"f");const e=()=>{var t;document.body?null===(t=m(this,r,"f"))||void 0===t||t.observe(document.body,{childList:!0,subtree:!0}):setTimeout(e,0)};e(),v(this,c,window.setInterval((()=>{m(this,i,"m",d).call(this)}),3e3),"f")}stopMonitoring(){null!=m(this,r,"f")&&(m(this,r,"f").disconnect(),v(this,r,null,"f")),null!=m(this,c,"f")&&(window.clearInterval(m(this,c,"f")),v(this,c,null,"f"))}getDOMElements(){return[...m(this,l,"f")]}getStats(){try{v(this,s,m(this,i,"m",f).call(this),"f"),v(this,o,m(this,i,"m",h).call(this),"f")}catch(e){}return{elements:m(this,s,"f"),detachedElements:m(this,o,"f")}}},s=new WeakMap,o=new WeakMap,r=new WeakMap,l=new WeakMap,a=new WeakMap,c=new WeakMap,u=new WeakMap,i=new WeakSet,d=function(){const e=[],t=new Set;for(const n of m(this,l,"f")){const i=n.deref();null==i||t.has(i)||(e.push(n),t.add(i))}v(this,l,e,"f")},f=function(){var e,t;return v(this,s,null!==(t=null===(e=null===document||void 0===document?void 0:document.getElementsByTagName("*"))||void 0===e?void 0:e.length)&&void 0!==t?t:0,"f")},h=function(){let e=0;for(const t of m(this,l,"f")){const n=t.deref();n&&!1===n.isConnected&&++e}return v(this,o,e,"f")},p=function(e){const t=[e],n=new Set,i=[];for(;t.length>0;){const e=t.pop();if(null==e||n.has(e))continue;if((null==e?void 0:e.nodeType)!==Node.ELEMENT_NODE)continue;const s=e;if((0,g.isVisualizerElement)(s))continue;if(n.add(s),!m(this,a,"f").has(s)){const e=new WeakRef(s);m(this,l,"f").push(e),m(this,a,"f").add(s),i.push(e)}const o=s.childNodes;for(let e=0;e<o.length;++e)t.push(o[e])}return i}},150:function(e,t,n){var i,s,o,r,l,a,c,u,d=this&&this.__classPrivateFieldSet||function(e,t,n,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,n):s?s.value=n:t.set(e,n),n},f=this&&this.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0});const h=n(498);t.default=class{constructor(){i.add(this),s.set(this,void 0),d(this,s,null,"f")}cleanup(){f(this,i,"m",u).call(this)}repaint(e){f(this,i,"m",u).call(this),f(this,i,"m",o).call(this,e)}},s=new WeakMap,i=new WeakSet,o=function(e){if(!f(this,s,"f")){const e=f(this,i,"m",l).call(this);d(this,s,e,"f")}f(this,i,"m",c).call(this,e)},r=function(e){document.body&&document.body.appendChild(e)},l=function(){const e=(0,h.createVisualizerElement)("canvas");return e.id="overlayCanvas",f(this,i,"m",r).call(this,e),e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.pointerEvents="none",e.style.zIndex="99999",e.width=window.innerWidth,e.height=window.innerHeight,e},a=function(e){const{boundingRect:t}=e;return JSON.stringify({boundingRect:t})},c=function(e){const t=f(this,s,"f");if(!t)return;const n=t.getContext("2d");if(null==n)return;n.strokeStyle="rgba(75, 192, 192, 0.8)",n.lineWidth=2,n.fillStyle="rgba(75, 192, 192, 0.05)",n.font="11px Inter, system-ui, -apple-system, sans-serif";const o=new Set;e.forEach((e=>{var t;const s=e.boundingRect;if(null==s)return;const r=f(this,i,"m",a).call(this,e);if(o.has(r))return;o.add(r),n.fillRect(s.left,s.top,s.width,s.height),n.strokeRect(s.left,s.top,s.width,s.height);const l=null===(t=e.componentStack)||void 0===t?void 0:t[0];if(l){const t=e.element.deref(),i=null==t?void 0:t.detachedElementId,o=`${l}${i?` (${i})`:""}`;n.fillStyle="rgba(74, 131, 224, 1)",n.fillText(o,s.left+5,s.top+15),n.fillStyle="rgba(75, 192, 192, 0.05)"}}))},u=function(){var e;const t=f(this,s,"f");if(t){const n=t.getContext("2d");null==n||n.clearRect(0,0,t.width,t.height),null===(e=t.parentNode)||void 0===e||e.removeChild(t)}d(this,s,null,"f")}},271:function(e,t,n){var i,s,o,r,l,a,c,u,d,f,h,p,v,m,y,g,b,w,M=this&&this.__classPrivateFieldSet||function(e,t,n,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,n):s?s.value=n:t.set(e,n),n},k=this&&this.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},E=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const _=E(n(150)),C=n(368),O=n(341),S=n(701),T=n(476),W=n(498);class x extends _.default{constructor(){super(),i.add(this),s.set(this,void 0),o.set(this,void 0),r.set(this,void 0),l.set(this,void 0),a.set(this,void 0),c.set(this,void 0),u.set(this,[]),M(this,c,{value:!1},"f"),M(this,o,(0,C.createOverlayDiv)(),"f"),(0,W.tryToAttachOverlay)(k(this,o,"f")),M(this,r,(0,O.createControlWidget)(k(this,o,"f"),k(this,c,"f"),(e=>{k(this,u,"f").push(e)})),"f"),(0,W.tryToAttachOverlay)(k(this,r,"f")),M(this,s,new Map,"f"),M(this,a,k(this,i,"m",f).call(this),"f"),M(this,l,new Set,"f"),k(this,i,"m",d).call(this)}repaint(e){k(this,o,"f").remove(),k(this,i,"m",y).call(this,e),k(this,i,"m",b).call(this,e),k(this,i,"m",w).call(this),(0,W.tryToAttachOverlay)(k(this,o,"f"))}cleanup(){k(this,o,"f")&&k(this,o,"f").remove(),k(this,r,"f")&&k(this,r,"f").remove(),k(this,s,"f").clear(),k(this,l,"f").clear(),M(this,u,[],"f"),super.cleanup()}}t.default=x,s=new WeakMap,o=new WeakMap,r=new WeakMap,l=new WeakMap,a=new WeakMap,c=new WeakMap,u=new WeakMap,i=new WeakSet,d=function(){document.addEventListener("keydown",(e=>{"d"!==e.key&&"D"!==e.key||null!=k(this,a,"f").selectedElementId&&k(this,l,"f").add(k(this,a,"f").selectedElementId)}))},f=function(){const e={detachedDOMElementsCount:0,totalDOMElementsCount:(0,T.getDOMElementCount)(),selectedElementId:null,selectedReactComponentStack:[],pinnedElementId:null,setPinnedElementId:t=>{var n,s;if(e.pinnedElementId==t)return;const o=k(this,i,"m",h).call(this,e.pinnedElementId);null===(n=null==o?void 0:o.__unpinned)||void 0===n||n.call(o);const r=k(this,i,"m",h).call(this,t);null===(s=null==r?void 0:r.__pinned)||void 0===s||s.call(r),e.pinnedElementId=t}};return e},h=function(e){if(null==e)return null;const t=k(this,s,"f").get(e);return null==t?null:t.visualizerElementRef.deref()},p=function(e){const t=new Set;for(const n of e){const e=n.element.deref();if(null==e)continue;const i=e.detachedElementId;null!=i&&t.add(i)}return t},v=function(e,t){const n=k(this,s,"f").get(e);if(null==n)return;const i=new Set;let o=n.elementInfo.element.deref();for(;o&&!o.isConnected;){const e=o.detachedElementId,n=parseInt(e,10);if(i.has(n))break;i.add(n);const r=k(this,s,"f").get(n);if(null==r)break;const l=r.visualizerElementRef.deref();if(null==l)break;t(l),o=o.parentElement}},m=function(e){var t;const n=k(this,s,"f").get(e);if(k(this,s,"f").delete(e),null==n)return;const i=n.visualizerElementRef.deref();null!=i&&(null===(t=null==i?void 0:i.__cleanup)||void 0===t||t.call(i),i.remove())},y=function(e){for(const[e,t]of k(this,s,"f").entries())null!=e&&null==t.elementInfo.element.deref()&&k(this,i,"m",m).call(this,e);const t=k(this,i,"m",p).call(this,e);for(const[e]of k(this,s,"f").entries())null!=e&&(t.has(e)&&!k(this,l,"f").has(e)||k(this,i,"m",m).call(this,e))},g=function(e){var t;const n=e.element.deref();if(null==n)return 0;const i=n.detachedElementId;if(null==i)return 0;const s=null!==(t=e.boundingRect)&&void 0!==t?t:{width:50,height:50};let o=9999;return o+=parseInt(i,10),o+=Math.floor(1e7/(s.width*s.height)),o},b=function(e){for(const t of e){const e=t.element.deref();if(null==e)continue;const n=e.detachedElementId;if(null==n)continue;if(k(this,l,"f").has(n))continue;if(k(this,s,"f").has(n))continue;if(null==e)continue;if(e.isConnected)continue;const r=k(this,i,"m",g).call(this,t),c=(0,S.createOverlayRectangle)(n,t,k(this,o,"f"),(e=>{k(this,a,"f").selectedElementId=e,k(this,i,"m",w).call(this),null!=e&&k(this,i,"m",v).call(this,e,(e=>{var t;null===(t=null==e?void 0:e.__selected)||void 0===t||t.call(e)}))}),(e=>{k(this,a,"f").selectedElementId===e&&(k(this,a,"f").selectedElementId=null,k(this,i,"m",w).call(this)),null!=e&&k(this,i,"m",v).call(this,e,(e=>{var t;null===(t=null==e?void 0:e.__unselected)||void 0===t||t.call(e)}))}),(e=>{k(this,a,"f").pinnedElementId===e?k(this,a,"f").setPinnedElementId(null):k(this,a,"f").setPinnedElementId(e),k(this,i,"m",w).call(this)}),r);if(null==c||null==c.deref())return null;const u={elementInfo:t,visualizerElementRef:c};k(this,s,"f").set(n,u)}},w=function(){var e,t,n;const i=k(this,a,"f");null!=i.pinnedElementId&&(i.selectedElementId=i.pinnedElementId),i.detachedDOMElementsCount=k(this,s,"f").size,i.totalDOMElementsCount=(0,T.getDOMElementCount)();const o=null===(t=k(this,s,"f").get(null!==(e=i.selectedElementId)&&void 0!==e?e:-1))||void 0===t?void 0:t.elementInfo;i.selectedReactComponentStack=null!==(n=null==o?void 0:o.componentStack)&&void 0!==n?n:[];for(const e of k(this,u,"f"))e(Object.assign({},k(this,a,"f")))}},282:function(e,t,n){var i,s,o,r,l,a,c,u,d,f,h,p,v,m,y,g,b,w,M,k,E,_,C,O,S=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),T=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),W=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&S(t,e,n);return T(t,e),t},x=this&&this.__classPrivateFieldSet||function(e,t,n,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,n):s?s.value=n:t.set(e,n),n},I=this&&this.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},R=this&&this.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]])}return n},N=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const P=W(n(476)),F=N(n(302)),D=n(737),L=n(54),j=n(346),z=n(953);class H{constructor(e={}){var t,n,g,b;i.add(this),s.set(this,void 0),o.set(this,void 0),r.set(this,void 0),l.set(this,void 0),a.set(this,void 0),c.set(this,void 0),u.set(this,void 0),d.set(this,void 0),f.set(this,void 0),h.set(this,void 0),p.set(this,void 0),v.set(this,void 0),m.set(this,void 0),y.set(this,void 0),x(this,s,[],"f"),x(this,o,!1,"f"),x(this,l,new WeakMap,"f"),x(this,a,new WeakMap,"f"),x(this,c,[],"f"),x(this,m,e.trackEventListenerLeaks?z.EventListenerTracker.getInstance():null,"f"),x(this,r,null,"f"),x(this,y,!1,"f"),x(this,u,new F.default,"f"),x(this,d,null!==(t=e.isDevMode)&&void 0!==t&&t,"f"),x(this,f,null!==(n=e.subscribers)&&void 0!==n?n:[],"f"),x(this,h,null!==(g=e.extensions)&&void 0!==g?g:[],"f"),x(this,p,null!==(b=e.scanIntervalMs)&&void 0!==b?b:j.config.performance.scanIntervalMs,"f")}subscribe(e){return I(this,f,"f").push(e),()=>this.unsubscribe(e)}unsubscribe(e){x(this,f,I(this,f,"f").filter((t=>t!==e)),"f")}registerExtension(e){return I(this,h,"f").push(e),()=>this.unregisterExtension(e)}unregisterExtension(e){x(this,h,I(this,h,"f").filter((t=>t!==e)),"f")}start(){I(this,y,"f")?console.warn("[Memory] ReactMemoryScan has been disposed and cannot be started again"):(x(this,o,!0,"f"),x(this,r,setInterval(I(this,i,"m",k).bind(this),I(this,p,"f")),"f"),j.config.features.enableMutationObserver&&(null==I(this,v,"f")&&x(this,v,new L.DOMObserver,"f"),I(this,v,"f").startMonitoring()),console.log("[Memory] Tracking React and DOM memory..."))}pause(){x(this,o,!1,"f")}stop(){x(this,o,!1,"f"),null!==I(this,r,"f")&&(clearInterval(I(this,r,"f")),x(this,r,null,"f")),x(this,s,[],"f"),x(this,c,[],"f"),I(this,v,"f")&&(I(this,v,"f").stopMonitoring(),x(this,v,null,"f")),x(this,l,new WeakMap,"f"),x(this,a,new WeakMap,"f"),console.log("[Memory] ReactMemoryScan stopped")}dispose(){this.stop(),x(this,f,[],"f");for(const e of I(this,h,"f"))e&&"function"==typeof e.cleanup&&e.cleanup();x(this,h,[],"f"),I(this,m,"f")&&(I(this,m,"f").destroy(),x(this,m,null,"f")),x(this,y,!0,"f"),console.log("[Memory] ReactMemoryScan disposed")}recordBoundingRectangles(e){for(const t of e){const e=t.deref();if(null==e||I(this,l,"f").has(e))continue;const n=P.getBoundingClientRect(e);null!=n&&I(this,l,"f").set(e,n)}}getDetachedDOMInfo(){var e;const t=[];for(const n of I(this,s,"f")){const i=n.deref();if(null==i||i.isConnected)continue;const s=i;if(null==s.detachedElementId){const e=H.nextElementId++;s.detachedElementIdStr=`memory-id-${e}@`,s.detachedElementId=e}const o=null!==(e=I(this,a,"f").get(i))&&void 0!==e?e:[];t.push({element:n,boundingRect:I(this,l,"f").get(i),componentStack:o})}return t}isDevMode(){return I(this,d,"f")}getCachedComponentName(e){var t;const n="<Unknown>",i=e.deref();if(null==i)return n;const s=I(this,a,"f").get(i);return null==s?n:null!==(t=s[0])&&void 0!==t?t:n}updateFiberNodes(e){const t=new WeakSet;for(const e of I(this,c,"f")){const n=e.deref();null!=n&&t.add(n)}const n=new WeakSet;for(const t of e){const e=t.deref();null!=e&&n.add(e)}const s=[],o=[];for(const e of I(this,c,"f")){const t=e.deref();null!=t&&(n.has(t)?(o.push(e),null==t.return&&s.push(e)):s.push(e))}for(const n of e){const e=n.deref();null!=e&&(t.has(e)||o.push(n))}return x(this,c,o,"f"),I(this,i,"m",g).call(this,"known fibers: ",I(this,c,"f").length),I(this,i,"m",g).call(this,"leaked fibers: ",s.length),s}packLeakedFibers(e){const t=[];for(const n of e)t.push(new B(n));return t}scan(){const e=Date.now();I(this,i,"m",C).call(this);const t=I(this,s,"f"),n=I(this,i,"m",_).call(this);I(this,i,"m",E).call(this,n),this.recordBoundingRectangles(n),P.updateWeakRefList(t,n);const o=I(this,u,"f").scan(t,I(this,a,"f")),r=this.updateFiberNodes(o.fiberNodes);o.leakedFibers=r,o.eventListenerLeaks=I(this,i,"m",O).call(this),window.leakedFibers=this.packLeakedFibers(r);const l=Date.now();return I(this,i,"m",g).call(this,`scan took ${l-e}ms`),o}}t.default=H,s=new WeakMap,o=new WeakMap,r=new WeakMap,l=new WeakMap,a=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap,f=new WeakMap,h=new WeakMap,p=new WeakMap,v=new WeakMap,m=new WeakMap,y=new WeakMap,i=new WeakSet,g=function(...e){I(this,d,"f")&&j.config.features.enableConsoleLogs&&P.consoleLog(...e)},b=function(e){for(const t of I(this,f,"f"))t(e);const t=e.end-e.start;I(this,i,"m",g).call(this,"duration: ",`${t} ms`);const{scanner:n,leakedFibers:s,fiberNodes:o}=e,r=R(e,["scanner","leakedFibers","fiberNodes"]);I(this,i,"m",g).call(this,r)},w=function(){for(const e of I(this,h,"f"))null==e||e.beforeScan()},M=function(e){for(const t of I(this,h,"f"))null==t||t.afterScan(e)},k=function(){if(!I(this,o,"f"))return;I(this,i,"m",w).call(this);const e=performance.now(),t=this.scan(),n=performance.now(),s=Object.assign(Object.assign({},t),{start:e,end:n,scanner:this});I(this,i,"m",b).call(this,s),I(this,i,"m",M).call(this,s)},E=function(e){for(const t of e){const e=t.deref();if(null==e||I(this,a,"f").has(e))continue;const n=(0,D.getFiberNodeFromElement)(e);null!=n&&I(this,a,"f").set(e,(0,D.getReactComponentStack)(n))}},_=function(){return null==I(this,v,"f")?P.getDOMElements():[...P.getDOMElements(),...I(this,v,"f").getDOMElements()]},C=function(){null!=(null===window||void 0===window?void 0:window.gc)&&window.gc()},O=function(){var e;if(null==I(this,m,"f"))return[];const t=I(this,m,"f").scan(this.getCachedComponentName.bind(this)),n=[];for(const[i,s]of t.entries()){const t=new Map;for(const n of s){const i=null!==(e=t.get(n.type))&&void 0!==e?e:0;t.set(n.type,i+1)}for(const[e,s]of t.entries())n.push({type:e,componentName:i,count:s})}return n},H.nextElementId=0;class B{constructor(e){this.leakedFiber=e}}},302:function(e,t,n){var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(t,n);s&&!("get"in s?!t.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,s)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const r=o(n(476)),l=n(737),a=n(847);t.default=class{scan(e,t){var n;const i=new Set,s=new Set,o=new Map,c=new Map,u=new Set,d=new Set,f=[];let h=0,p=0;function v(e){(0,l.traverseFiber)(e,(e=>{if(d.has(e))return!0;d.add(e);const t=(0,l.getDisplayNameOfFiberNode)(e);return null!=t&&(0,a.isValidComponentName)(t)?(s.add(t),r.addCountbyKey(o,t,1),!0):void 0}),!0)}for(const s of e){const e=s.deref();if(null==e)continue;if(++h,!e.isConnected){if(t.has(e)){const i=(null!==(n=t.get(e))&&void 0!==n?n:[])[0];e.__component_name=i,r.addCountbyKey(c,i,1)}++p}const o=(0,l.getFiberNodeFromElement)(e);if(null==o)continue;v(o);const a=(0,l.getTopMostFiberWithChild)(o);null!=a&&(i.has(a)||(i.add(a),(0,l.traverseFiber)(a,(e=>{if(u.has(e))return!0;u.add(e),f.push(new WeakRef(e)),v(e)}),!1)))}return u.clear(),d.clear(),i.clear(),{components:s,componentToFiberNodeCount:o,totalElements:h,totalDetachedElements:p,detachedComponentToFiberNodeCount:c,fiberNodes:f,leakedFibers:[]}}}},313:(e,t)=>{var n,i,s;Object.defineProperty(t,"__esModule",{value:!0}),t.WeakMapPlus=t.isWeakAPINative=t.isWeakRefNative=t.isWeakSetNative=t.isWeakMapNative=t.getNativeWeakRefOrFallback=t.getNativeWeakRef=t.getNativeWeakSetOrFallback=t.getNativeWeakSet=t.getNativeWeakMapOrFallback=t.getNativeWeakMap=t.WeakMapNoOp=t.WeakSetNoOp=t.WeakRefNoOp=void 0;const o="undefined"!=typeof window?window:self,r=null!==(n=o.WeakMap)&&void 0!==n?n:null,l=y(),a=null!==(i=o.WeakSet)&&void 0!==i?i:null,c=g(),u=null!==(s=o.WeakRef)&&void 0!==s?s:null,d=b(),f=l&&c&&d;class h{constructor(e){}deref(){}}t.WeakRefNoOp=h;class p{constructor(e){}add(e){return this}delete(e){return!1}has(e){return!1}}t.WeakSetNoOp=p;class v{constructor(e){}delete(e){return!1}get(e){}has(e){return!1}set(e,t){return this}}function m(e){return"function"==typeof e.replace?e.replace(/\n/g," ").replace(/\s+/g," "):null}function y(){return null!==r&&"function"==typeof r.toString&&"function WeakMap() { [native code] }"===m(r.toString())}function g(){return null!==a&&"function"==typeof a.toString&&"function WeakSet() { [native code] }"===m(a.toString())}function b(){return null!==u&&"function"==typeof u.toString&&"function WeakRef() { [native code] }"===m(u.toString())}t.WeakMapNoOp=v,t.getNativeWeakMap=function(){return l?r:null},t.getNativeWeakMapOrFallback=function(){return l&&r?r:v},t.getNativeWeakSet=function(){return c?a:null},t.getNativeWeakSetOrFallback=function(){return c&&a?a:p},t.getNativeWeakRef=function(){return d?u:null},t.getNativeWeakRefOrFallback=function(){return d&&u?u:h},t.isWeakMapNative=y,t.isWeakSetNative=g,t.isWeakRefNative=b,t.isWeakAPINative=function(){return f};class w{constructor(e={}){this.strongMap=null,this.noopMap=!1,this.entriesMap=new Map,this.keyToId=new WeakMap;const{fallback:t="strong",cleanupMs:n=1e3}=e;this.isWeak=f,this.fallbackMode=t,this.isWeak?this.cleanupInterval=setInterval((()=>this.cleanup()),n):("strong"===t?this.strongMap=new Map:"noop"===t&&(this.noopMap=!0),this.cleanupInterval=-1)}getOrCreateId(e){let t=this.keyToId.get(e);return t||(t=Symbol(),this.keyToId.set(e,t)),t}set(e,t){var n;if(!this.isWeak)return this.noopMap||null===(n=this.strongMap)||void 0===n||n.set(e,t),this;const i=this.getOrCreateId(e);return this.entriesMap.set(i,{ref:new WeakRef(e),value:t}),this}get(e){var t,n;if(!this.isWeak){if(this.noopMap)return;return null===(t=this.strongMap)||void 0===t?void 0:t.get(e)}const i=this.keyToId.get(e);if(!i)return;const s=this.entriesMap.get(i);return(null===(n=null==s?void 0:s.ref)||void 0===n?void 0:n.deref())?null==s?void 0:s.value:void 0}has(e){var t,n;if(!this.isWeak)return!this.noopMap&&null!==(n=null===(t=this.strongMap)||void 0===t?void 0:t.has(e))&&void 0!==n&&n;const i=this.keyToId.get(e);if(!i)return!1;const s=this.entriesMap.get(i);return!(!s||!s.ref.deref())}delete(e){var t,n;if(!this.isWeak)return!this.noopMap&&null!==(n=null===(t=this.strongMap)||void 0===t?void 0:t.delete(e))&&void 0!==n&&n;const i=this.keyToId.get(e);return!!i&&(this.keyToId.delete(e),this.entriesMap.delete(i))}*liveEntries(){for(const[,e]of this.entriesMap){const t=e.ref.deref();t&&(yield[t,e.value])}}entries(){var e,t;return this.isWeak?this.liveEntries():this.noopMap?[][Symbol.iterator]():null!==(t=null===(e=this.strongMap)||void 0===e?void 0:e.entries())&&void 0!==t?t:[][Symbol.iterator]()}keys(){return function*(e){for(const[t]of e.entries())yield t}(this)}values(){return function*(e){for(const[,t]of e.entries())yield t}(this)}[Symbol.iterator](){return this.entries()}get size(){var e,t;if(!this.isWeak)return this.noopMap?0:null!==(t=null===(e=this.strongMap)||void 0===e?void 0:e.size)&&void 0!==t?t:0;let n=0;for(const e of this.liveEntries())n++;return n}getFallbackMode(){return this.fallbackMode}cleanup(){if(this.isWeak)for(const[e,t]of this.entriesMap)t.ref.deref()||this.entriesMap.delete(e)}destroy(){this.isWeak&&clearInterval(this.cleanupInterval)}}t.WeakMapPlus=w},341:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createControlWidget=void 0;const i=n(498),s=n(775),o=n(946),r=n(904);t.createControlWidget=function(e,t,n){const l=(0,i.createVisualizerElement)("div");l.style.position="fixed",l.style.top="50px",l.style.right="50px",l.style.width="400px",l.style.background="rgba(0, 0, 0, 0.7)",l.style.border="none",l.style.borderRadius="8px",l.style.boxShadow="0 4px 8px rgba(0, 0, 0, 0.3)",l.style.zIndex="999999999",l.style.display="flex",l.style.flexDirection="column",l.style.textShadow="none",l.style.boxSizing="border-box",l.style.font="9px Inter, system-ui, -apple-system, sans-serif",l.id="memory-visualization-control-widget";const a=(0,i.createVisualizerElement)("div");a.style.display="flex",a.style.alignItems="center",a.style.justifyContent="flex-start",a.style.padding="0 8px",a.style.height="36px",l.appendChild(a);const c=(0,r.createComponentStackPanel)(n);l.appendChild(c),function(e){let t=!1,n=0,i=0;e.addEventListener("mousedown",(s=>{s.target.closest("#memory-visualization-control-widget > div:first-child")&&(t=!0,n=s.clientX-e.offsetLeft,i=s.clientY-e.offsetTop,e.style.cursor="move")})),document.addEventListener("mousemove",(s=>{t&&(e.style.left=s.clientX-n+"px",e.style.top=s.clientY-i+"px",e.style.right="")})),document.addEventListener("mouseup",(()=>{t=!1,e.style.cursor="default"}))}(l);const u=(0,o.createToggleButton)(e,t);a.appendChild(u);const d=(0,s.createStatusText)(n);return a.appendChild(d),l}},346:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.config=t.featureFlags=t.performanceConfig=void 0,t.performanceConfig={scanIntervalMs:1e3,maxComponentStackDepth:100,memoryMeasurementIntervalMs:5e3},t.featureFlags={enableMutationObserver:!0,enableMemoryTracking:!0,enableComponentStack:!0,enableConsoleLogs:null===window||void 0===window?void 0:window.TEST_MEMORY_SCAN},t.config={performance:t.performanceConfig,features:t.featureFlags}},368:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createOverlayDiv=void 0;const i=n(498);t.createOverlayDiv=function(){const e=(0,i.createVisualizerElement)("div");return e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.id="memory-visualization-overlay",e}},476:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setRunInSession=t.hasRunInSession=t.consoleLog=t.getBoundingClientRect=t.updateWeakRefList=t.addCountbyKey=t.isMinifiedName=t.getMeaningfulName=t.getDOMElementCount=t.getDOMElements=void 0;const i=n(498);function s(e){return!(e.length>=5)&&(e.length<=3||!/[^a-zA-Z0-9$_]/.test(e)&&!/^[A-Z][a-z]+([A-Z][a-z]*)*$|^[a-z]+([A-Z][a-z]*)*$/.test(e))}t.getDOMElements=function(){const e=Array.from(document.querySelectorAll("*")),t=[];for(const n of e)(0,i.isVisualizerElement)(n)||t.push(new WeakRef(n));return t},t.getDOMElementCount=function(){const e=Array.from(document.querySelectorAll("*"));let t=0;for(const n of e)(0,i.isVisualizerElement)(n)||++t;return t},t.getMeaningfulName=function(e){return null==e||s(e)?null:e},t.isMinifiedName=s,t.addCountbyKey=function(e,t,n){var i;e.set(t,(null!==(i=e.get(t))&&void 0!==i?i:0)+n)},t.updateWeakRefList=function(e,t){!function(e){const t=[];for(const n of e)null!=n.deref()&&t.push(n);for(;e.length>0;)e.pop();for(const n of t)e.push(n)}(e);const n=function(e){const t=new Set;for(const n of e)t.add(n.deref());return t}(e);for(const i of t){const t=i.deref();null==t||n.has(t)||(n.add(t),e.push(new WeakRef(t)))}return e},t.getBoundingClientRect=function(e){if(null==e)return null;if("function"!=typeof e.getBoundingClientRect)return null;let t=null;try{t=e.getBoundingClientRect()}catch(e){}if(null==t)return null;const n=window.scrollY,i=window.scrollX,s={};return s.bottom=t.bottom,s.height=t.height,s.left=t.left,s.right=t.right,s.top=t.top,s.width=t.width,s.x=t.x,s.y=t.y,s.scrollLeft=i,s.scrollTop=n,s};const o=console,r=o.log;t.consoleLog=function(...e){r.apply(o,e)};const l="memory_lens_session";function a(){try{const e="__memory_lens_session_test__";return sessionStorage.setItem(e,"1"),sessionStorage.removeItem(e),!0}catch(e){return!1}}t.hasRunInSession=function(){if(!a())return!1;try{return"true"===sessionStorage.getItem(l)}catch(e){return!1}},t.setRunInSession=function(){if(a())try{sessionStorage.setItem(l,"true")}catch(e){}}},498:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=t.removeAllListeners=t.addTrackedListener=t.tryToAttachOverlay=t.createVisualizerElement=t.isVisualizerElement=void 0;const n="data-visualizer";t.isVisualizerElement=function(e){return"true"===e.getAttribute(n)},t.createVisualizerElement=function(e){const t=document.createElement(e);return function(e){e.setAttribute(n,"true"),e.setAttribute("data-visualcompletion","ignore")}(t),t},t.tryToAttachOverlay=function(e){document.body&&document.body.appendChild(e)};const i=new WeakMap;t.addTrackedListener=function(e,t,n,s){var o;const r=e.deref();r&&(r.addEventListener(t,n,s),i.has(r)||i.set(r,[]),null===(o=i.get(r))||void 0===o||o.push({type:t,cb:n,options:s}))},t.removeAllListeners=function(e){const t=e.deref();if(!t)return;const n=i.get(t);if(n){for(const{type:e,cb:i,options:s}of n)t.removeEventListener(e,i,s);i.delete(t)}},t.debounce=function(e,t){let n=null;return(...i)=>{n&&clearTimeout(n),n=setTimeout((()=>{e(...i)}),t)}}},701:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createOverlayRectangle=void 0;const i=n(979),s=n(498),o=""+(Math.pow(2,30)-1),r=i.IntersectionObserverManager.getInstance(),l=function(){const e=(0,s.createVisualizerElement)("div");return e.style.color="white",e.style.background="rgba(75, 192, 192, 0.8)",e.style.textShadow="none",e.style.font="9px Inter, system-ui, -apple-system, sans-serif",e.style.padding="2px 6px",e.style.borderRadius="2px",e.style.whiteSpace="nowrap",e.style.position="absolute",e.style.bottom="100%",e.style.left="0",e.style.marginBottom="2px",e.style.display="none",e.style.zIndex=o,e}();function a(e,t){const n=e.deref();if(null==n)return;const{pinned:i,selected:s}=t;i?(n.style.border="1px solid rgba(255, 215, 0, 0.9)",n.style.background="rgba(255, 215, 0, 0.08)"):s?(n.style.border="1px solid rgba(75, 192, 192, 0.8)",n.style.background="rgba(75, 192, 192, 0.02)"):(n.style.border="1px dotted rgba(75, 192, 192, 0.8)",n.style.background="")}t.createOverlayRectangle=function(e,t,n,i,o,c,u){var d,f;const h=t.boundingRect;if(!h)return null;const p=(0,s.createVisualizerElement)("div");p.style.position="absolute",p.style.width=`${h.width}px`,p.style.height=`${h.height}px`,p.style.top=`${h.top+h.scrollTop}px`,p.style.left=`${h.left+h.scrollLeft}px`,p.style.border="1px dotted rgba(75, 192, 192, 0.8)",p.style.borderRadius="1px",p.style.zIndex=u.toString();const v=null!==(f=(null!==(d=t.componentStack)&&void 0!==d?d:[])[0])&&void 0!==f?f:"";let m=!1,y=!1;const g=new WeakRef(p);return(0,s.addTrackedListener)(g,"mouseover",(()=>{var t;const n=`memory-id-${e}@`;l.remove(),null===(t=g.deref())||void 0===t||t.appendChild(l),l.textContent=`${v} (${n})`,l.style.display="inline-block",i(e)})),(0,s.addTrackedListener)(g,"mouseout",(()=>{l.style.display="none",l.remove(),o(e)})),(0,s.addTrackedListener)(g,"click",(()=>{c(e)})),p.__selected=()=>{y=!0,a(g,{selected:y,pinned:m})},p.__unselected=()=>{y=!1,a(g,{selected:y,pinned:m})},p.__pinned=()=>{m=!0,a(g,{selected:y,pinned:m})},p.__unpinned=()=>{m=!1,a(g,{selected:y,pinned:m})},r.observe(g,(e=>{e.isIntersecting?p.style.visibility="visible":p.style.visibility="hidden"})),p.__cleanup=()=>{const e=g.deref();null!=e&&((0,s.removeAllListeners)(g),r.unobserve(g),e.__cleanup=null,e.__selected=null,e.__unselected=null,e.__pinned=null,e.__unpinned=null)},n.appendChild(p),g}},737:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extractReactComponentName=t.isFunctionalComponent=t.getDisplayNameOfFiberNode=t.getReactComponentStack=t.getFiberNodeFromElement=t.traverseFiber=t.getTopMostFiberWithChild=t.getTopMostHostFiber=t.getNearestHostFiber=t.isHostFiber=t.MutationMask=t.Visibility=t.Snapshot=t.Ref=t.ContentReset=t.ChildDeletion=t.Cloned=t.Update=t.Hydrating=t.DidCapture=t.Placement=t.PerformedWork=t.DEPRECATED_ASYNC_MODE_SYMBOL_STRING=t.CONCURRENT_MODE_SYMBOL_STRING=t.CONCURRENT_MODE_NUMBER=t.HostRoot=t.OffscreenComponent=t.LegacyHiddenComponent=t.Fragment=t.HostText=t.DehydratedSuspenseComponent=t.HostSingletonTag=t.HostHoistableTag=t.HostComponentTag=t.SimpleMemoComponentTag=t.MemoComponentTag=t.ForwardRefTag=t.OffscreenComponentTag=t.SuspenseComponentTag=t.ContextConsumerTag=t.FunctionComponentTag=t.ClassComponentTag=void 0;const i=n(476),s=n(847);t.ClassComponentTag=1,t.FunctionComponentTag=0,t.ContextConsumerTag=9,t.SuspenseComponentTag=13,t.OffscreenComponentTag=22,t.ForwardRefTag=11,t.MemoComponentTag=14,t.SimpleMemoComponentTag=15,t.HostComponentTag=5,t.HostHoistableTag=26,t.HostSingletonTag=27,t.DehydratedSuspenseComponent=18,t.HostText=6,t.Fragment=7,t.LegacyHiddenComponent=23,t.OffscreenComponent=22,t.HostRoot=3,t.CONCURRENT_MODE_NUMBER=60111,t.CONCURRENT_MODE_SYMBOL_STRING="Symbol(react.concurrent_mode)",t.DEPRECATED_ASYNC_MODE_SYMBOL_STRING="Symbol(react.async_mode)",t.PerformedWork=1,t.Placement=2,t.DidCapture=128,t.Hydrating=4096,t.Update=4,t.Cloned=8,t.ChildDeletion=16,t.ContentReset=32,t.Ref=512,t.Snapshot=1024,t.Visibility=8192,t.MutationMask=t.Placement|t.Update|t.ChildDeletion|t.ContentReset|t.Hydrating|t.Visibility|t.Snapshot,t.isHostFiber=e=>e.tag===t.HostComponentTag||e.tag===t.HostHoistableTag||e.tag===t.HostSingletonTag||"string"==typeof e.type,t.getNearestHostFiber=e=>{let n=(0,t.traverseFiber)(e,t.isHostFiber);return n||(n=(0,t.traverseFiber)(e,t.isHostFiber,!0)),n},t.getTopMostHostFiber=e=>{let n=null;return(0,t.traverseFiber)(e,(function(e){(0,t.isHostFiber)(e)&&(n=e)}),!0),n},t.getTopMostFiberWithChild=e=>{let n=null;return(0,t.traverseFiber)(e,(function(e){null!=e.child&&(n=e)}),!0),n},t.traverseFiber=(e,n,i=!1)=>{if(!e)return null;if(!0===n(e))return e;let s=i?e.return:e.child;for(;s;){const e=(0,t.traverseFiber)(s,n,i);if(e)return e;s=i?null:s.sibling}return null};const o=["__reactFiber$","__reactInternalInstance$","_reactRootContainer"],r=Object.getOwnPropertyNames.bind(Object);function l(e){var t,n,o,r;const l=null!==(t=e.type)&&void 0!==t?t:e.elementType;let c=null!==(n=null==l?void 0:l.displayName)&&void 0!==n?n:null==l?void 0:l.name;if(null==c)if(null==l?void 0:l.render){const e=null==l?void 0:l.render;c=null!==(o=null==e?void 0:e.displayName)&&void 0!==o?o:null==e?void 0:e.name}else(null==l?void 0:l.type)&&(c=null!==(r=l.type.displayName)&&void 0!==r?r:l.type.name);c||"function"!=typeof l||(c=l.name);const u=(0,i.getMeaningfulName)(a(c));return(0,s.isValidComponentName)(u)?u:null}function a(e){if("string"!=typeof e)return null;if(!e.includes("[")||!e.includes("]"))return e;const t=e.indexOf("["),n=e.indexOf("]");if(t>n)return e;const i=e.substring(t+1,n);return i.startsWith("from ")?i.substring(5):i}t.getFiberNodeFromElement=function(e){for(const t of o){const n=r(e).find((e=>e.startsWith(t)));if(n)return e[n]}return null},t.getReactComponentStack=function(e){const t=[],n=new Set;let i=e;for(;i&&!n.has(i);){n.add(i);const e=l(i);e&&t.push(e),i=i.return}return t},t.getDisplayNameOfFiberNode=l,t.isFunctionalComponent=function(e){return"function"==typeof(null==e?void 0:e.elementType)},t.extractReactComponentName=a},775:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createStatusText=void 0;const i=n(498);function s(e){if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(2))+" "+["B","KB","MB","GB"][t]}t.createStatusText=function(e){const t=(0,i.createVisualizerElement)("div");return t.style.marginLeft="10px",t.style.color="white",t.style.fontSize="10px",t.style.fontFamily="Inter, system-ui, sans-serif",t.style.overflow="hidden",t.style.whiteSpace="nowrap",t.style.textOverflow="ellipsis",t.textContent="",e((e=>{var n,i,o,r;const l=window.performance,a=null==l?void 0:l.memory,c=null!==(n=null==a?void 0:a.usedJSHeapSize)&&void 0!==n?n:0,u=null!==(i=null==a?void 0:a.totalJSHeapSize)&&void 0!==i?i:0,d=null!==(o=e.totalDOMElementsCount)&&void 0!==o?o:0,f=null!==(r=e.detachedDOMElementsCount)&&void 0!==r?r:0;t.textContent=`DOM: ${d} total, ${f} detached | Heap: ${s(c)} / ${s(u)}`})),t}},847:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isValidComponentName=void 0;const n=new Set;t.isValidComponentName=function(e){return null!=e&&!n.has(e)}},860:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BasicExtension=void 0,t.BasicExtension=class{constructor(e){this.scanner=e}beforeScan(){}afterScan(e){}}},904:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createComponentStackPanel=void 0;const i=n(498);t.createComponentStackPanel=function(e){const t=(0,i.createVisualizerElement)("div");t.style.width="100%",t.style.maxHeight="80vh",t.style.background="rgba(0, 0, 0, 0.5)",t.style.borderTop="1px solid rgba(255, 255, 255, 0.1)",t.style.display="none",t.style.flexDirection="column",t.style.padding="8px",t.style.boxSizing="border-box",t.style.borderRadius="8px",t.style.overflowY="scroll",t.style.overflowX="hidden",t.style.textShadow="none",t.style.font="9px Inter, system-ui, -apple-system, sans-serif",t.style.color="white",t.id="memory-visualization-component-stack-panel";let n=!1;return t.addEventListener("mouseenter",(()=>{n=!0})),t.addEventListener("mouseleave",(()=>{n=!1})),e((0,i.debounce)((e=>{var s;if(n)return;if(t.innerHTML="",null==e.selectedElementId||!(null===(s=e.selectedReactComponentStack)||void 0===s?void 0:s.length))return void(t.style.display="none");t.style.display="flex";const o=(0,i.createVisualizerElement)("div");o.textContent="Component Stack:",o.style.fontWeight="bold",o.style.marginBottom="8px",t.appendChild(o);let r=0;e.selectedReactComponentStack.forEach((e=>{const n=(0,i.createVisualizerElement)("div");n.style.marginBottom="4px",n.textContent=e,t.appendChild(n),++r})),0===r&&o.remove()}),1)),t}},933:function(e,t,n){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const s=i(n(282)),o=n(23),r=n(476);if(!(0,r.hasRunInSession)()){const e=new s.default({isDevMode:!0}),t=new o.DOMVisualizationExtension(e);e.registerExtension(t),e.start(),(0,r.setRunInSession)()}},946:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createToggleButton=void 0;const i=n(498);t.createToggleButton=function(e,t){const n=(0,i.createVisualizerElement)("div");n.style.width="40px",n.style.height="24px",n.style.borderRadius="9999px",n.style.backgroundColor="#34C759",n.style.cursor="pointer",n.style.position="relative",n.style.transition="background-color 0.3s ease";const s=(0,i.createVisualizerElement)("div");return s.style.width="18px",s.style.height="18px",s.style.backgroundColor="white",s.style.borderRadius="50%",s.style.position="absolute",s.style.top="3px",s.style.left="3px",s.style.transition="left 0.25s ease",n.appendChild(s),n.addEventListener("click",(()=>{t.value=!t.value,t.value?(e.style.display="none",e.style.pointerEvents="none",e.style.userSelect="none",s.style.left="19px",n.style.backgroundColor="#FF3B30"):(e.style.display="block",e.style.pointerEvents="auto",e.style.userSelect="auto",s.style.left="3px",n.style.backgroundColor="#34C759")})),n}},953:function(e,t,n){var i,s,o,r,l,a,c,u=this&&this.__classPrivateFieldSet||function(e,t,n,i,s){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?s.call(e,n):s?s.value=n:t.set(e,n),n},d=this&&this.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.EventListenerTracker=void 0;const f=n(737),h=n(313);class p{constructor(){i.add(this),s.set(this,void 0),o.set(this,void 0),r.set(this,void 0),l.set(this,void 0),u(this,s,new h.WeakMapPlus({fallback:"noop",cleanupMs:100}),"f"),u(this,o,new Map,"f"),u(this,r,EventTarget.prototype.addEventListener,"f"),u(this,l,EventTarget.prototype.removeEventListener,"f"),d(this,i,"m",a).call(this)}static getInstance(){return p.instance||(p.instance=new p),p.instance}addListener(e,t,n,i){e.addEventListener(t,n,i)}removeListener(e,t,n,i){e.removeEventListener(t,n,i)}scan(e){const t=new Map;for(const[n,i]of d(this,s,"f").entries())if(n instanceof Element&&!n.isConnected)for(const s of i){if(!s.cb.deref())continue;const i=e(new WeakRef(n));t.has(i)||t.set(i,[]);const o=t.get(i);let r=null==o?void 0:o.find((e=>e.type===s.type));r||(r={type:s.type,count:0,entries:[]},null==o||o.push(r)),r.count++,r.entries.push(new WeakRef(s))}return u(this,o,t,"f"),t}getDetachedListeners(){return d(this,o,"f")}destroy(){d(this,i,"m",c).call(this),d(this,s,"f").destroy(),d(this,o,"f").clear(),p.instance=null}}t.EventListenerTracker=p,s=new WeakMap,o=new WeakMap,r=new WeakMap,l=new WeakMap,i=new WeakSet,a=function(){const e=this;EventTarget.prototype.addEventListener=function(t,n,i){var o;if(d(e,r,"f").call(this,t,n,i),this instanceof Element){const r=(0,f.getFiberNodeFromElement)(this),l={type:t,cb:new WeakRef(n),options:i,fiber:r?new WeakRef(r):void 0},a=null!==(o=d(e,s,"f").get(this))&&void 0!==o?o:[];a.push(l),d(e,s,"f").set(this,a)}},EventTarget.prototype.removeEventListener=function(t,n,i){if(d(e,l,"f").call(this,t,n,i),this instanceof Element){const o=d(e,s,"f").get(this);if(o){const r=o.findIndex((e=>e.type===t&&e.cb.deref()===n&&e.options===i));-1!==r&&o.splice(r,1),0===o.length?d(e,s,"f").delete(this):d(e,s,"f").set(this,o)}}}},c=function(){EventTarget.prototype.addEventListener=d(this,r,"f"),EventTarget.prototype.removeEventListener=d(this,l,"f")},p.instance=null},979:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IntersectionObserverManager=void 0;class n{constructor(){this.observedElements=new Map,this.observer=new IntersectionObserver((e=>{e.forEach((e=>{const t=e.target,n=this.observedElements.get(t);n&&n(e)}))}),{threshold:0,rootMargin:"50px"})}static getInstance(){return n.instance||(n.instance=new n),n.instance}observe(e,t){const n=e.deref();null!=n&&(this.observedElements.set(n,t),this.observer.observe(n))}unobserve(e){const t=e.deref();null!=t&&(this.observedElements.delete(t),this.observer.unobserve(t))}}t.IntersectionObserverManager=n}},t={};!function n(i){var s=t[i];if(void 0!==s)return s.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}(933)})();
|
|
26
|
+
(()=>{"use strict";var e={23(e,t,n){var s,i=this&&this.__classPrivateFieldSet||function(e,t,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(e,n):i?i.value=n:t.set(e,n),n},o=this&&this.__classPrivateFieldGet||function(e,t,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(e):s?s.value:t.get(e)},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DOMVisualizationExtension=void 0,r(n(150));const l=r(n(271)),a=n(860);class c extends a.BasicExtension{constructor(e){super(e),s.set(this,void 0),i(this,s,new l.default,"f")}afterScan(e){var t;const n=this.scanner;if(n.isDevMode()){const e=n.getDetachedDOMInfo();null===(t=o(this,s,"f"))||void 0===t||t.repaint(e)}}cleanup(){o(this,s,"f")&&"function"==typeof o(this,s,"f").cleanup&&o(this,s,"f").cleanup(),i(this,s,null,"f")}}t.DOMVisualizationExtension=c,s=new WeakMap},54(e,t,n){var s,i,o,r,l,a,c,u,d,f,h,p,v=this&&this.__classPrivateFieldSet||function(e,t,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(e,n):i?i.value=n:t.set(e,n),n},m=this&&this.__classPrivateFieldGet||function(e,t,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(e):s?s.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.DOMObserver=void 0;const y=n(313),g=n(498),w=(0,y.isWeakAPINative)(),b=void 0!==window.MutationObserver;t.DOMObserver=class{constructor(){s.add(this),i.set(this,void 0),o.set(this,void 0),r.set(this,void 0),l.set(this,void 0),a.set(this,void 0),c.set(this,void 0),u.set(this,void 0),v(this,i,0,"f"),v(this,o,0,"f"),v(this,l,[],"f"),v(this,a,new WeakSet,"f"),v(this,u,[],"f"),this.startMonitoring()}register(e){m(this,u,"f").push(e)}startMonitoring(){if(!w||!b)return;if(null!=m(this,r,"f"))return;v(this,r,new MutationObserver(e=>{let t=[];const n=e=>{if(null==e)return;if(e.nodeType!=Node.ELEMENT_NODE)return;const n=e;if(!(0,g.isVisualizerElement)(n)){const e=m(this,s,"m",p).call(this,n);t=[...t,...e]}};e.forEach(e=>{e.addedNodes.forEach(n),e.removedNodes.forEach(n)}),m(this,u,"f").forEach(e=>e(t))}),"f");const e=()=>{var t;document.body?null===(t=m(this,r,"f"))||void 0===t||t.observe(document.body,{childList:!0,subtree:!0}):setTimeout(e,0)};e(),v(this,c,window.setInterval(()=>{m(this,s,"m",d).call(this)},3e3),"f")}stopMonitoring(){null!=m(this,r,"f")&&(m(this,r,"f").disconnect(),v(this,r,null,"f")),null!=m(this,c,"f")&&(window.clearInterval(m(this,c,"f")),v(this,c,null,"f"))}getDOMElements(){return[...m(this,l,"f")]}getStats(){try{v(this,i,m(this,s,"m",f).call(this),"f"),v(this,o,m(this,s,"m",h).call(this),"f")}catch(e){}return{elements:m(this,i,"f"),detachedElements:m(this,o,"f")}}},i=new WeakMap,o=new WeakMap,r=new WeakMap,l=new WeakMap,a=new WeakMap,c=new WeakMap,u=new WeakMap,s=new WeakSet,d=function(){const e=[],t=new Set;for(const n of m(this,l,"f")){const s=n.deref();null==s||t.has(s)||(e.push(n),t.add(s))}v(this,l,e,"f")},f=function(){var e,t;return v(this,i,null!==(t=null===(e=null===document||void 0===document?void 0:document.getElementsByTagName("*"))||void 0===e?void 0:e.length)&&void 0!==t?t:0,"f")},h=function(){let e=0;for(const t of m(this,l,"f")){const n=t.deref();n&&!1===n.isConnected&&++e}return v(this,o,e,"f")},p=function(e){const t=[e],n=new Set,s=[];for(;t.length>0;){const e=t.pop();if(null==e||n.has(e))continue;if((null==e?void 0:e.nodeType)!==Node.ELEMENT_NODE)continue;const i=e;if((0,g.isVisualizerElement)(i))continue;if(n.add(i),!m(this,a,"f").has(i)){const e=new WeakRef(i);m(this,l,"f").push(e),m(this,a,"f").add(i),s.push(e)}const o=i.childNodes;for(let e=0;e<o.length;++e)t.push(o[e])}return s}},150(e,t,n){var s,i,o,r,l,a,c,u,d=this&&this.__classPrivateFieldSet||function(e,t,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(e,n):i?i.value=n:t.set(e,n),n},f=this&&this.__classPrivateFieldGet||function(e,t,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(e):s?s.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0});const h=n(498);i=new WeakMap,s=new WeakSet,o=function(e){if(!f(this,i,"f")){const e=f(this,s,"m",l).call(this);d(this,i,e,"f")}f(this,s,"m",c).call(this,e)},r=function(e){document.body&&document.body.appendChild(e)},l=function(){const e=(0,h.createVisualizerElement)("canvas");return e.id="overlayCanvas",f(this,s,"m",r).call(this,e),e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.pointerEvents="none",e.style.zIndex="99999",e.width=window.innerWidth,e.height=window.innerHeight,e},a=function(e){const{boundingRect:t}=e;return JSON.stringify({boundingRect:t})},c=function(e){const t=f(this,i,"f");if(!t)return;const n=t.getContext("2d");if(null==n)return;n.strokeStyle="rgba(75, 192, 192, 0.8)",n.lineWidth=2,n.fillStyle="rgba(75, 192, 192, 0.05)",n.font="11px Inter, system-ui, -apple-system, sans-serif";const o=new Set;e.forEach(e=>{var t;const i=e.boundingRect;if(null==i)return;const r=f(this,s,"m",a).call(this,e);if(o.has(r))return;o.add(r),n.fillRect(i.left,i.top,i.width,i.height),n.strokeRect(i.left,i.top,i.width,i.height);const l=null===(t=e.componentStack)||void 0===t?void 0:t[0];if(l){const t=e.element.deref(),s=null==t?void 0:t.detachedElementId,o=`${l}${s?` (${s})`:""}`;n.fillStyle="rgba(74, 131, 224, 1)",n.fillText(o,i.left+5,i.top+15),n.fillStyle="rgba(75, 192, 192, 0.05)"}})},u=function(){var e;const t=f(this,i,"f");if(t){const n=t.getContext("2d");null==n||n.clearRect(0,0,t.width,t.height),null===(e=t.parentNode)||void 0===e||e.removeChild(t)}d(this,i,null,"f")},t.default=class{constructor(){s.add(this),i.set(this,void 0),d(this,i,null,"f")}cleanup(){f(this,s,"m",u).call(this)}repaint(e){f(this,s,"m",u).call(this),f(this,s,"m",o).call(this,e)}}},271(e,t,n){var s,i,o,r,l,a,c,u,d,f,h,p,v,m,y,g,w,b,M=this&&this.__classPrivateFieldSet||function(e,t,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(e,n):i?i.value=n:t.set(e,n),n},E=this&&this.__classPrivateFieldGet||function(e,t,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(e):s?s.value:t.get(e)},k=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const _=k(n(150)),C=n(368),O=n(341),S=n(701),T=n(476),x=n(498);class W extends _.default{constructor(){super(),s.add(this),i.set(this,void 0),o.set(this,void 0),r.set(this,void 0),l.set(this,void 0),a.set(this,void 0),c.set(this,void 0),u.set(this,[]),M(this,c,{value:!1},"f"),M(this,o,(0,C.createOverlayDiv)(),"f"),(0,x.tryToAttachOverlay)(E(this,o,"f")),M(this,r,(0,O.createControlWidget)(E(this,o,"f"),E(this,c,"f"),e=>{E(this,u,"f").push(e)}),"f"),(0,x.tryToAttachOverlay)(E(this,r,"f")),M(this,i,new Map,"f"),M(this,a,E(this,s,"m",f).call(this),"f"),M(this,l,new Set,"f"),E(this,s,"m",d).call(this)}repaint(e){E(this,o,"f").remove(),E(this,s,"m",y).call(this,e),E(this,s,"m",w).call(this,e),E(this,s,"m",b).call(this),(0,x.tryToAttachOverlay)(E(this,o,"f"))}cleanup(){E(this,o,"f")&&E(this,o,"f").remove(),E(this,r,"f")&&E(this,r,"f").remove(),E(this,i,"f").clear(),E(this,l,"f").clear(),M(this,u,[],"f"),super.cleanup()}}i=new WeakMap,o=new WeakMap,r=new WeakMap,l=new WeakMap,a=new WeakMap,c=new WeakMap,u=new WeakMap,s=new WeakSet,d=function(){document.addEventListener("keydown",e=>{"d"!==e.key&&"D"!==e.key||null!=E(this,a,"f").selectedElementId&&E(this,l,"f").add(E(this,a,"f").selectedElementId)})},f=function(){const e={detachedDOMElementsCount:0,totalDOMElementsCount:(0,T.getDOMElementCount)(),selectedElementId:null,selectedReactComponentStack:[],pinnedElementId:null,setPinnedElementId:t=>{var n,i;if(e.pinnedElementId==t)return;const o=E(this,s,"m",h).call(this,e.pinnedElementId);null===(n=null==o?void 0:o.__unpinned)||void 0===n||n.call(o);const r=E(this,s,"m",h).call(this,t);null===(i=null==r?void 0:r.__pinned)||void 0===i||i.call(r),e.pinnedElementId=t}};return e},h=function(e){if(null==e)return null;const t=E(this,i,"f").get(e);return null==t?null:t.visualizerElementRef.deref()},p=function(e){const t=new Set;for(const n of e){const e=n.element.deref();if(null==e)continue;const s=e.detachedElementId;null!=s&&t.add(s)}return t},v=function(e,t){const n=E(this,i,"f").get(e);if(null==n)return;const s=new Set;let o=n.elementInfo.element.deref();for(;o&&!o.isConnected;){const e=o.detachedElementId,n=parseInt(e,10);if(s.has(n))break;s.add(n);const r=E(this,i,"f").get(n);if(null==r)break;const l=r.visualizerElementRef.deref();if(null==l)break;t(l),o=o.parentElement}},m=function(e){var t;const n=E(this,i,"f").get(e);if(E(this,i,"f").delete(e),null==n)return;const s=n.visualizerElementRef.deref();null!=s&&(null===(t=null==s?void 0:s.__cleanup)||void 0===t||t.call(s),s.remove())},y=function(e){for(const[e,t]of E(this,i,"f").entries())null!=e&&null==t.elementInfo.element.deref()&&E(this,s,"m",m).call(this,e);const t=E(this,s,"m",p).call(this,e);for(const[e]of E(this,i,"f").entries())null!=e&&(t.has(e)&&!E(this,l,"f").has(e)||E(this,s,"m",m).call(this,e))},g=function(e){var t;const n=e.element.deref();if(null==n)return 0;const s=n.detachedElementId;if(null==s)return 0;const i=null!==(t=e.boundingRect)&&void 0!==t?t:{width:50,height:50};let o=9999;return o+=parseInt(s,10),o+=Math.floor(1e7/(i.width*i.height)),o},w=function(e){for(const t of e){const e=t.element.deref();if(null==e)continue;const n=e.detachedElementId;if(null==n)continue;if(E(this,l,"f").has(n))continue;if(E(this,i,"f").has(n))continue;if(null==e)continue;if(e.isConnected)continue;const r=E(this,s,"m",g).call(this,t),c=(0,S.createOverlayRectangle)(n,t,E(this,o,"f"),e=>{E(this,a,"f").selectedElementId=e,E(this,s,"m",b).call(this),null!=e&&E(this,s,"m",v).call(this,e,e=>{var t;null===(t=null==e?void 0:e.__selected)||void 0===t||t.call(e)})},e=>{E(this,a,"f").selectedElementId===e&&(E(this,a,"f").selectedElementId=null,E(this,s,"m",b).call(this)),null!=e&&E(this,s,"m",v).call(this,e,e=>{var t;null===(t=null==e?void 0:e.__unselected)||void 0===t||t.call(e)})},e=>{E(this,a,"f").pinnedElementId===e?E(this,a,"f").setPinnedElementId(null):E(this,a,"f").setPinnedElementId(e),E(this,s,"m",b).call(this)},r);if(null==c||null==c.deref())return null;const u={elementInfo:t,visualizerElementRef:c};E(this,i,"f").set(n,u)}},b=function(){var e,t,n;const s=E(this,a,"f");null!=s.pinnedElementId&&(s.selectedElementId=s.pinnedElementId),s.detachedDOMElementsCount=E(this,i,"f").size,s.totalDOMElementsCount=(0,T.getDOMElementCount)();const o=null===(t=E(this,i,"f").get(null!==(e=s.selectedElementId)&&void 0!==e?e:-1))||void 0===t?void 0:t.elementInfo;s.selectedReactComponentStack=null!==(n=null==o?void 0:o.componentStack)&&void 0!==n?n:[];for(const e of E(this,u,"f"))e(Object.assign({},E(this,a,"f")))},t.default=W},282(e,t,n){var s,i,o,r,l,a,c,u,d,f,h,p,v,m,y,g,w,b,M,E,k,_,C,O,S,T=this&&this.__createBinding||(Object.create?function(e,t,n,s){void 0===s&&(s=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,s,i)}:function(e,t,n,s){void 0===s&&(s=n),e[s]=t[n]}),x=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),W=this&&this.__importStar||(s=function(e){return s=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},s(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=s(e),i=0;i<n.length;i++)"default"!==n[i]&&T(t,e,n[i]);return x(t,e),t}),I=this&&this.__classPrivateFieldSet||function(e,t,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(e,n):i?i.value=n:t.set(e,n),n},R=this&&this.__classPrivateFieldGet||function(e,t,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(e):s?s.value:t.get(e)},P=this&&this.__rest||function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(s=Object.getOwnPropertySymbols(e);i<s.length;i++)t.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(n[s[i]]=e[s[i]])}return n},N=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const F=W(n(476)),D=N(n(302)),j=n(737),L=n(54),z=n(346),H=n(953);class B{constructor(e={}){var t,n,s,w;i.add(this),o.set(this,void 0),r.set(this,void 0),l.set(this,void 0),a.set(this,void 0),c.set(this,void 0),u.set(this,void 0),d.set(this,void 0),f.set(this,void 0),h.set(this,void 0),p.set(this,void 0),v.set(this,void 0),m.set(this,void 0),y.set(this,void 0),g.set(this,void 0),I(this,o,[],"f"),I(this,r,!1,"f"),I(this,a,new WeakMap,"f"),I(this,c,new WeakMap,"f"),I(this,u,[],"f"),I(this,y,e.trackEventListenerLeaks?H.EventListenerTracker.getInstance():null,"f"),I(this,l,null,"f"),I(this,g,!1,"f"),I(this,d,new D.default,"f"),I(this,f,null!==(t=e.isDevMode)&&void 0!==t&&t,"f"),I(this,h,null!==(n=e.subscribers)&&void 0!==n?n:[],"f"),I(this,p,null!==(s=e.extensions)&&void 0!==s?s:[],"f"),I(this,v,null!==(w=e.scanIntervalMs)&&void 0!==w?w:z.config.performance.scanIntervalMs,"f")}subscribe(e){return R(this,h,"f").push(e),()=>this.unsubscribe(e)}unsubscribe(e){I(this,h,R(this,h,"f").filter(t=>t!==e),"f")}registerExtension(e){return R(this,p,"f").push(e),()=>this.unregisterExtension(e)}unregisterExtension(e){I(this,p,R(this,p,"f").filter(t=>t!==e),"f")}start(){R(this,g,"f")?console.warn("[Memory] ReactMemoryScan has been disposed and cannot be started again"):(I(this,r,!0,"f"),I(this,l,setInterval(R(this,i,"m",k).bind(this),R(this,v,"f")),"f"),z.config.features.enableMutationObserver&&(null==R(this,m,"f")&&I(this,m,new L.DOMObserver,"f"),R(this,m,"f").startMonitoring()),console.log("[Memory] Tracking React and DOM memory..."))}pause(){I(this,r,!1,"f")}stop(){I(this,r,!1,"f"),null!==R(this,l,"f")&&(clearInterval(R(this,l,"f")),I(this,l,null,"f")),I(this,o,[],"f"),I(this,u,[],"f"),R(this,m,"f")&&(R(this,m,"f").stopMonitoring(),I(this,m,null,"f")),I(this,a,new WeakMap,"f"),I(this,c,new WeakMap,"f"),console.log("[Memory] ReactMemoryScan stopped")}dispose(){this.stop(),I(this,h,[],"f");for(const e of R(this,p,"f"))e&&"function"==typeof e.cleanup&&e.cleanup();I(this,p,[],"f"),R(this,y,"f")&&(R(this,y,"f").destroy(),I(this,y,null,"f")),I(this,g,!0,"f"),console.log("[Memory] ReactMemoryScan disposed")}recordBoundingRectangles(e){for(const t of e){const e=t.deref();if(null==e||R(this,a,"f").has(e))continue;const n=F.getBoundingClientRect(e);null!=n&&R(this,a,"f").set(e,n)}}getDetachedDOMInfo(){var e;const t=[];for(const n of R(this,o,"f")){const s=n.deref();if(null==s||s.isConnected)continue;const i=s;if(null==i.detachedElementId){const e=B.nextElementId++;i.detachedElementIdStr=`memory-id-${e}@`,i.detachedElementId=e}const o=null!==(e=R(this,c,"f").get(s))&&void 0!==e?e:[];t.push({element:n,boundingRect:R(this,a,"f").get(s),componentStack:o})}return t}isDevMode(){return R(this,f,"f")}getCachedComponentName(e){var t;const n="<Unknown>",s=e.deref();if(null==s)return n;const i=R(this,c,"f").get(s);return null==i?n:null!==(t=i[0])&&void 0!==t?t:n}updateFiberNodes(e){const t=new WeakSet;for(const e of R(this,u,"f")){const n=e.deref();null!=n&&t.add(n)}const n=new WeakSet;for(const t of e){const e=t.deref();null!=e&&n.add(e)}const s=[],o=[];for(const e of R(this,u,"f")){const t=e.deref();null!=t&&(n.has(t)?(o.push(e),null==t.return&&s.push(e)):s.push(e))}for(const n of e){const e=n.deref();null!=e&&(t.has(e)||o.push(n))}return I(this,u,o,"f"),R(this,i,"m",w).call(this,"known fibers: ",R(this,u,"f").length),R(this,i,"m",w).call(this,"leaked fibers: ",s.length),s}packLeakedFibers(e){const t=[];for(const n of e)t.push(new V(n));return t}scan(){const e=Date.now();R(this,i,"m",O).call(this);const t=R(this,o,"f"),n=R(this,i,"m",C).call(this);R(this,i,"m",_).call(this,n),this.recordBoundingRectangles(n),F.updateWeakRefList(t,n);const s=R(this,d,"f").scan(t,R(this,c,"f")),r=this.updateFiberNodes(s.fiberNodes);s.leakedFibers=r,s.eventListenerLeaks=R(this,i,"m",S).call(this),window.leakedFibers=this.packLeakedFibers(r);const l=Date.now();return R(this,i,"m",w).call(this,`scan took ${l-e}ms`),s}}o=new WeakMap,r=new WeakMap,l=new WeakMap,a=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakMap,f=new WeakMap,h=new WeakMap,p=new WeakMap,v=new WeakMap,m=new WeakMap,y=new WeakMap,g=new WeakMap,i=new WeakSet,w=function(...e){R(this,f,"f")&&z.config.features.enableConsoleLogs&&F.consoleLog(...e)},b=function(e){for(const t of R(this,h,"f"))t(e);const t=e.end-e.start;R(this,i,"m",w).call(this,"duration: ",`${t} ms`);const{scanner:n,leakedFibers:s,fiberNodes:o}=e,r=P(e,["scanner","leakedFibers","fiberNodes"]);R(this,i,"m",w).call(this,r)},M=function(){for(const e of R(this,p,"f"))null==e||e.beforeScan()},E=function(e){for(const t of R(this,p,"f"))null==t||t.afterScan(e)},k=function(){if(!R(this,r,"f"))return;R(this,i,"m",M).call(this);const e=performance.now(),t=this.scan(),n=performance.now(),s=Object.assign(Object.assign({},t),{start:e,end:n,scanner:this});R(this,i,"m",b).call(this,s),R(this,i,"m",E).call(this,s)},_=function(e){for(const t of e){const e=t.deref();if(null==e||R(this,c,"f").has(e))continue;const n=(0,j.getFiberNodeFromElement)(e);null!=n&&R(this,c,"f").set(e,(0,j.getReactComponentStack)(n))}},C=function(){return null==R(this,m,"f")?F.getDOMElements():[...F.getDOMElements(),...R(this,m,"f").getDOMElements()]},O=function(){null!=(null===window||void 0===window?void 0:window.gc)&&window.gc()},S=function(){var e;if(null==R(this,y,"f"))return[];const t=R(this,y,"f").scan(this.getCachedComponentName.bind(this)),n=[];for(const[s,i]of t.entries()){const t=new Map;for(const n of i){const s=null!==(e=t.get(n.type))&&void 0!==e?e:0;t.set(n.type,s+1)}for(const[e,i]of t.entries())n.push({type:e,componentName:s,count:i})}return n},B.nextElementId=0,t.default=B;class V{constructor(e){this.leakedFiber=e}}},302(e,t,n){var s,i=this&&this.__createBinding||(Object.create?function(e,t,n,s){void 0===s&&(s=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,s,i)}:function(e,t,n,s){void 0===s&&(s=n),e[s]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||(s=function(e){return s=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},s(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=s(e),r=0;r<n.length;r++)"default"!==n[r]&&i(t,e,n[r]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0});const l=r(n(476)),a=n(737),c=n(847);t.default=class{scan(e,t){var n;const s=new Set,i=new Set,o=new Map,r=new Map,u=new Set,d=new Set,f=[];let h=0,p=0;function v(e){(0,a.traverseFiber)(e,e=>{if(d.has(e))return!0;d.add(e);const t=(0,a.getDisplayNameOfFiberNode)(e);return null!=t&&(0,c.isValidComponentName)(t)?(i.add(t),l.addCountbyKey(o,t,1),!0):void 0},!0)}for(const i of e){const e=i.deref();if(null==e)continue;if(++h,!e.isConnected){if(t.has(e)){const s=(null!==(n=t.get(e))&&void 0!==n?n:[])[0];e.__component_name=s,l.addCountbyKey(r,s,1)}++p}const o=(0,a.getFiberNodeFromElement)(e);if(null==o)continue;v(o);const c=(0,a.getTopMostFiberWithChild)(o);null!=c&&(s.has(c)||(s.add(c),(0,a.traverseFiber)(c,e=>{if(u.has(e))return!0;u.add(e),f.push(new WeakRef(e)),v(e)},!1)))}return u.clear(),d.clear(),s.clear(),{components:i,componentToFiberNodeCount:o,totalElements:h,totalDetachedElements:p,detachedComponentToFiberNodeCount:r,fiberNodes:f,leakedFibers:[]}}}},313(e,t){var n,s,i;Object.defineProperty(t,"__esModule",{value:!0}),t.WeakMapPlus=t.WeakMapNoOp=t.WeakSetNoOp=t.WeakRefNoOp=void 0,t.getNativeWeakMap=function(){return l?r:null},t.getNativeWeakMapOrFallback=function(){return l&&r?r:v},t.getNativeWeakSet=function(){return c?a:null},t.getNativeWeakSetOrFallback=function(){return c&&a?a:p},t.getNativeWeakRef=function(){return d?u:null},t.getNativeWeakRefOrFallback=function(){return d&&u?u:h},t.isWeakMapNative=y,t.isWeakSetNative=g,t.isWeakRefNative=w,t.isWeakAPINative=function(){return f};const o="undefined"!=typeof window?window:self,r=null!==(n=o.WeakMap)&&void 0!==n?n:null,l=y(),a=null!==(s=o.WeakSet)&&void 0!==s?s:null,c=g(),u=null!==(i=o.WeakRef)&&void 0!==i?i:null,d=w(),f=l&&c&&d;class h{constructor(e){}deref(){}}t.WeakRefNoOp=h;class p{constructor(e){}add(e){return this}delete(e){return!1}has(e){return!1}}t.WeakSetNoOp=p;class v{constructor(e){}delete(e){return!1}get(e){}has(e){return!1}set(e,t){return this}}function m(e){return"function"==typeof e.replace?e.replace(/\n/g," ").replace(/\s+/g," "):null}function y(){return null!==r&&"function"==typeof r.toString&&"function WeakMap() { [native code] }"===m(r.toString())}function g(){return null!==a&&"function"==typeof a.toString&&"function WeakSet() { [native code] }"===m(a.toString())}function w(){return null!==u&&"function"==typeof u.toString&&"function WeakRef() { [native code] }"===m(u.toString())}t.WeakMapNoOp=v;class b{constructor(e={}){this.strongMap=null,this.noopMap=!1,this.entriesMap=new Map,this.keyToId=new WeakMap;const{fallback:t="strong",cleanupMs:n=1e3}=e;this.isWeak=f,this.fallbackMode=t,this.isWeak?this.cleanupInterval=setInterval(()=>this.cleanup(),n):("strong"===t?this.strongMap=new Map:"noop"===t&&(this.noopMap=!0),this.cleanupInterval=-1)}getOrCreateId(e){let t=this.keyToId.get(e);return t||(t=Symbol(),this.keyToId.set(e,t)),t}set(e,t){var n;if(!this.isWeak)return this.noopMap||null===(n=this.strongMap)||void 0===n||n.set(e,t),this;const s=this.getOrCreateId(e);return this.entriesMap.set(s,{ref:new WeakRef(e),value:t}),this}get(e){var t,n;if(!this.isWeak){if(this.noopMap)return;return null===(t=this.strongMap)||void 0===t?void 0:t.get(e)}const s=this.keyToId.get(e);if(!s)return;const i=this.entriesMap.get(s);return(null===(n=null==i?void 0:i.ref)||void 0===n?void 0:n.deref())?null==i?void 0:i.value:void 0}has(e){var t,n;if(!this.isWeak)return!this.noopMap&&null!==(n=null===(t=this.strongMap)||void 0===t?void 0:t.has(e))&&void 0!==n&&n;const s=this.keyToId.get(e);if(!s)return!1;const i=this.entriesMap.get(s);return!(!i||!i.ref.deref())}delete(e){var t,n;if(!this.isWeak)return!this.noopMap&&null!==(n=null===(t=this.strongMap)||void 0===t?void 0:t.delete(e))&&void 0!==n&&n;const s=this.keyToId.get(e);return!!s&&(this.keyToId.delete(e),this.entriesMap.delete(s))}*liveEntries(){for(const[,e]of this.entriesMap){const t=e.ref.deref();t&&(yield[t,e.value])}}entries(){var e,t;return this.isWeak?this.liveEntries():this.noopMap?[][Symbol.iterator]():null!==(t=null===(e=this.strongMap)||void 0===e?void 0:e.entries())&&void 0!==t?t:[][Symbol.iterator]()}keys(){return function*(e){for(const[t]of e.entries())yield t}(this)}values(){return function*(e){for(const[,t]of e.entries())yield t}(this)}[Symbol.iterator](){return this.entries()}get size(){var e,t;if(!this.isWeak)return this.noopMap?0:null!==(t=null===(e=this.strongMap)||void 0===e?void 0:e.size)&&void 0!==t?t:0;let n=0;for(const e of this.liveEntries())n++;return n}getFallbackMode(){return this.fallbackMode}cleanup(){if(this.isWeak)for(const[e,t]of this.entriesMap)t.ref.deref()||this.entriesMap.delete(e)}destroy(){this.isWeak&&clearInterval(this.cleanupInterval)}}t.WeakMapPlus=b},341(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.createControlWidget=function(e,t,n){const l=(0,s.createVisualizerElement)("div");l.style.position="fixed",l.style.top="50px",l.style.right="50px",l.style.width="400px",l.style.background="rgba(0, 0, 0, 0.7)",l.style.border="none",l.style.borderRadius="8px",l.style.boxShadow="0 4px 8px rgba(0, 0, 0, 0.3)",l.style.zIndex="999999999",l.style.display="flex",l.style.flexDirection="column",l.style.textShadow="none",l.style.boxSizing="border-box",l.style.font="9px Inter, system-ui, -apple-system, sans-serif",l.id="memory-visualization-control-widget";const a=(0,s.createVisualizerElement)("div");a.style.display="flex",a.style.alignItems="center",a.style.justifyContent="flex-start",a.style.padding="0 8px",a.style.height="36px",l.appendChild(a);const c=(0,r.createComponentStackPanel)(n);l.appendChild(c),function(e){let t=!1,n=0,s=0;e.addEventListener("mousedown",i=>{i.target.closest("#memory-visualization-control-widget > div:first-child")&&(t=!0,n=i.clientX-e.offsetLeft,s=i.clientY-e.offsetTop,e.style.cursor="move")}),document.addEventListener("mousemove",i=>{t&&(e.style.left=i.clientX-n+"px",e.style.top=i.clientY-s+"px",e.style.right="")}),document.addEventListener("mouseup",()=>{t=!1,e.style.cursor="default"})}(l);const u=(0,o.createToggleButton)(e,t);a.appendChild(u);const d=(0,i.createStatusText)(n);return a.appendChild(d),l};const s=n(498),i=n(775),o=n(946),r=n(904)},346(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.config=t.featureFlags=t.performanceConfig=void 0,t.performanceConfig={scanIntervalMs:1e3,maxComponentStackDepth:100,memoryMeasurementIntervalMs:5e3},t.featureFlags={enableMutationObserver:!0,enableMemoryTracking:!0,enableComponentStack:!0,enableConsoleLogs:null===window||void 0===window?void 0:window.TEST_MEMORY_SCAN},t.config={performance:t.performanceConfig,features:t.featureFlags}},368(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.createOverlayDiv=function(){const e=(0,s.createVisualizerElement)("div");return e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.id="memory-visualization-overlay",e};const s=n(498)},476(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getDOMElements=function(){const e=Array.from(document.querySelectorAll("*")),t=[];for(const n of e)(0,s.isVisualizerElement)(n)||t.push(new WeakRef(n));return t},t.getDOMElementCount=function(){const e=Array.from(document.querySelectorAll("*"));let t=0;for(const n of e)(0,s.isVisualizerElement)(n)||++t;return t},t.getMeaningfulName=function(e){return null==e||i(e)?null:e},t.isMinifiedName=i,t.addCountbyKey=function(e,t,n){var s;e.set(t,(null!==(s=e.get(t))&&void 0!==s?s:0)+n)},t.updateWeakRefList=function(e,t){!function(e){const t=[];for(const n of e)null!=n.deref()&&t.push(n);for(;e.length>0;)e.pop();for(const n of t)e.push(n)}(e);const n=function(e){const t=new Set;for(const n of e)t.add(n.deref());return t}(e);for(const s of t){const t=s.deref();null==t||n.has(t)||(n.add(t),e.push(new WeakRef(t)))}return e},t.getBoundingClientRect=function(e){if(null==e)return null;if("function"!=typeof e.getBoundingClientRect)return null;let t=null;try{t=e.getBoundingClientRect()}catch(e){}if(null==t)return null;const n=window.scrollY,s=window.scrollX,i={};return i.bottom=t.bottom,i.height=t.height,i.left=t.left,i.right=t.right,i.top=t.top,i.width=t.width,i.x=t.x,i.y=t.y,i.scrollLeft=s,i.scrollTop=n,i},t.consoleLog=function(...e){r.apply(o,e)},t.hasRunInSession=function(){if(!a())return!1;try{return"true"===sessionStorage.getItem(l)}catch(e){return!1}},t.setRunInSession=function(){if(a())try{sessionStorage.setItem(l,"true")}catch(e){}};const s=n(498);function i(e){return!(e.length>=5)&&(e.length<=3||!/[^a-zA-Z0-9$_]/.test(e)&&!/^[A-Z][a-z]+([A-Z][a-z]*)*$|^[a-z]+([A-Z][a-z]*)*$/.test(e))}const o=console,r=o.log,l="memory_lens_session";function a(){try{const e="__memory_lens_session_test__";return sessionStorage.setItem(e,"1"),sessionStorage.removeItem(e),!0}catch(e){return!1}}},498(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isVisualizerElement=function(e){return"true"===e.getAttribute(n)},t.createVisualizerElement=function(e){const t=document.createElement(e);return function(e){e.setAttribute(n,"true"),e.setAttribute("data-visualcompletion","ignore")}(t),t},t.tryToAttachOverlay=function(e){document.body&&document.body.appendChild(e)},t.addTrackedListener=function(e,t,n,i){var o;const r=e.deref();r&&(r.addEventListener(t,n,i),s.has(r)||s.set(r,[]),null===(o=s.get(r))||void 0===o||o.push({type:t,cb:n,options:i}))},t.removeAllListeners=function(e){const t=e.deref();if(!t)return;const n=s.get(t);if(n){for(const{type:e,cb:s,options:i}of n)t.removeEventListener(e,s,i);s.delete(t)}},t.debounce=function(e,t){let n=null;return(...s)=>{n&&clearTimeout(n),n=setTimeout(()=>{e(...s)},t)}};const n="data-visualizer",s=new WeakMap},701(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.createOverlayRectangle=function(e,t,n,s,o,c,u){var d,f;const h=t.boundingRect;if(!h)return null;const p=(0,i.createVisualizerElement)("div");p.style.position="absolute",p.style.width=`${h.width}px`,p.style.height=`${h.height}px`,p.style.top=`${h.top+h.scrollTop}px`,p.style.left=`${h.left+h.scrollLeft}px`,p.style.border="1px dotted rgba(75, 192, 192, 0.8)",p.style.borderRadius="1px",p.style.zIndex=u.toString();const v=null!==(f=(null!==(d=t.componentStack)&&void 0!==d?d:[])[0])&&void 0!==f?f:"";let m=!1,y=!1;const g=new WeakRef(p);return(0,i.addTrackedListener)(g,"mouseover",()=>{var t;const n=`memory-id-${e}@`;l.remove(),null===(t=g.deref())||void 0===t||t.appendChild(l),l.textContent=`${v} (${n})`,l.style.display="inline-block",s(e)}),(0,i.addTrackedListener)(g,"mouseout",()=>{l.style.display="none",l.remove(),o(e)}),(0,i.addTrackedListener)(g,"click",()=>{c(e)}),p.__selected=()=>{y=!0,a(g,{selected:y,pinned:m})},p.__unselected=()=>{y=!1,a(g,{selected:y,pinned:m})},p.__pinned=()=>{m=!0,a(g,{selected:y,pinned:m})},p.__unpinned=()=>{m=!1,a(g,{selected:y,pinned:m})},r.observe(g,e=>{e.isIntersecting?p.style.visibility="visible":p.style.visibility="hidden"}),p.__cleanup=()=>{const e=g.deref();null!=e&&((0,i.removeAllListeners)(g),r.unobserve(g),e.__cleanup=null,e.__selected=null,e.__unselected=null,e.__pinned=null,e.__unpinned=null)},n.appendChild(p),g};const s=n(979),i=n(498),o=""+(Math.pow(2,30)-1),r=s.IntersectionObserverManager.getInstance(),l=function(){const e=(0,i.createVisualizerElement)("div");return e.style.color="white",e.style.background="rgba(75, 192, 192, 0.8)",e.style.textShadow="none",e.style.font="9px Inter, system-ui, -apple-system, sans-serif",e.style.padding="2px 6px",e.style.borderRadius="2px",e.style.whiteSpace="nowrap",e.style.position="absolute",e.style.bottom="100%",e.style.left="0",e.style.marginBottom="2px",e.style.display="none",e.style.zIndex=o,e}();function a(e,t){const n=e.deref();if(null==n)return;const{pinned:s,selected:i}=t;s?(n.style.border="1px solid rgba(255, 215, 0, 0.9)",n.style.background="rgba(255, 215, 0, 0.08)"):i?(n.style.border="1px solid rgba(75, 192, 192, 0.8)",n.style.background="rgba(75, 192, 192, 0.02)"):(n.style.border="1px dotted rgba(75, 192, 192, 0.8)",n.style.background="")}},737(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.traverseFiber=t.getTopMostFiberWithChild=t.getTopMostHostFiber=t.getNearestHostFiber=t.isHostFiber=t.MutationMask=t.Visibility=t.Snapshot=t.Ref=t.ContentReset=t.ChildDeletion=t.Cloned=t.Update=t.Hydrating=t.DidCapture=t.Placement=t.PerformedWork=t.DEPRECATED_ASYNC_MODE_SYMBOL_STRING=t.CONCURRENT_MODE_SYMBOL_STRING=t.CONCURRENT_MODE_NUMBER=t.HostRoot=t.OffscreenComponent=t.LegacyHiddenComponent=t.Fragment=t.HostText=t.DehydratedSuspenseComponent=t.HostSingletonTag=t.HostHoistableTag=t.HostComponentTag=t.SimpleMemoComponentTag=t.MemoComponentTag=t.ForwardRefTag=t.OffscreenComponentTag=t.SuspenseComponentTag=t.ContextConsumerTag=t.FunctionComponentTag=t.ClassComponentTag=void 0,t.getFiberNodeFromElement=function(e){for(const t of o){const n=r(e).find(e=>e.startsWith(t));if(n)return e[n]}return null},t.getReactComponentStack=function(e){const t=[],n=new Set;let s=e;for(;s&&!n.has(s);){n.add(s);const e=l(s);e&&t.push(e),s=s.return}return t},t.getDisplayNameOfFiberNode=l,t.isFunctionalComponent=function(e){return"function"==typeof(null==e?void 0:e.elementType)},t.extractReactComponentName=a;const s=n(476),i=n(847);t.ClassComponentTag=1,t.FunctionComponentTag=0,t.ContextConsumerTag=9,t.SuspenseComponentTag=13,t.OffscreenComponentTag=22,t.ForwardRefTag=11,t.MemoComponentTag=14,t.SimpleMemoComponentTag=15,t.HostComponentTag=5,t.HostHoistableTag=26,t.HostSingletonTag=27,t.DehydratedSuspenseComponent=18,t.HostText=6,t.Fragment=7,t.LegacyHiddenComponent=23,t.OffscreenComponent=22,t.HostRoot=3,t.CONCURRENT_MODE_NUMBER=60111,t.CONCURRENT_MODE_SYMBOL_STRING="Symbol(react.concurrent_mode)",t.DEPRECATED_ASYNC_MODE_SYMBOL_STRING="Symbol(react.async_mode)",t.PerformedWork=1,t.Placement=2,t.DidCapture=128,t.Hydrating=4096,t.Update=4,t.Cloned=8,t.ChildDeletion=16,t.ContentReset=32,t.Ref=512,t.Snapshot=1024,t.Visibility=8192,t.MutationMask=t.Placement|t.Update|t.ChildDeletion|t.ContentReset|t.Hydrating|t.Visibility|t.Snapshot,t.isHostFiber=e=>e.tag===t.HostComponentTag||e.tag===t.HostHoistableTag||e.tag===t.HostSingletonTag||"string"==typeof e.type,t.getNearestHostFiber=e=>{let n=(0,t.traverseFiber)(e,t.isHostFiber);return n||(n=(0,t.traverseFiber)(e,t.isHostFiber,!0)),n},t.getTopMostHostFiber=e=>{let n=null;return(0,t.traverseFiber)(e,function(e){(0,t.isHostFiber)(e)&&(n=e)},!0),n},t.getTopMostFiberWithChild=e=>{let n=null;return(0,t.traverseFiber)(e,function(e){null!=e.child&&(n=e)},!0),n},t.traverseFiber=(e,n,s=!1)=>{if(!e)return null;if(!0===n(e))return e;let i=s?e.return:e.child;for(;i;){const e=(0,t.traverseFiber)(i,n,s);if(e)return e;i=s?null:i.sibling}return null};const o=["__reactFiber$","__reactInternalInstance$","_reactRootContainer"],r=Object.getOwnPropertyNames.bind(Object);function l(e){var t,n,o,r;const l=null!==(t=e.type)&&void 0!==t?t:e.elementType;let c=null!==(n=null==l?void 0:l.displayName)&&void 0!==n?n:null==l?void 0:l.name;if(null==c)if(null==l?void 0:l.render){const e=null==l?void 0:l.render;c=null!==(o=null==e?void 0:e.displayName)&&void 0!==o?o:null==e?void 0:e.name}else(null==l?void 0:l.type)&&(c=null!==(r=l.type.displayName)&&void 0!==r?r:l.type.name);c||"function"!=typeof l||(c=l.name);const u=(0,s.getMeaningfulName)(a(c));return(0,i.isValidComponentName)(u)?u:null}function a(e){if("string"!=typeof e)return null;if(!e.includes("[")||!e.includes("]"))return e;const t=e.indexOf("["),n=e.indexOf("]");if(t>n)return e;const s=e.substring(t+1,n);return s.startsWith("from ")?s.substring(5):s}},775(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.createStatusText=function(e){const t=(0,s.createVisualizerElement)("div");return t.style.marginLeft="10px",t.style.color="white",t.style.fontSize="10px",t.style.fontFamily="Inter, system-ui, sans-serif",t.style.overflow="hidden",t.style.whiteSpace="nowrap",t.style.textOverflow="ellipsis",t.textContent="",e(e=>{var n,s,o,r;const l=window.performance,a=null==l?void 0:l.memory,c=null!==(n=null==a?void 0:a.usedJSHeapSize)&&void 0!==n?n:0,u=null!==(s=null==a?void 0:a.totalJSHeapSize)&&void 0!==s?s:0,d=null!==(o=e.totalDOMElementsCount)&&void 0!==o?o:0,f=null!==(r=e.detachedDOMElementsCount)&&void 0!==r?r:0;t.textContent=`DOM: ${d} total, ${f} detached | Heap: ${i(c)} / ${i(u)}`}),t};const s=n(498);function i(e){if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(2))+" "+["B","KB","MB","GB"][t]}},847(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isValidComponentName=function(e){return null!=e&&!n.has(e)};const n=new Set},860(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.BasicExtension=void 0,t.BasicExtension=class{constructor(e){this.scanner=e}beforeScan(){}afterScan(e){}}},904(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.createComponentStackPanel=function(e){const t=(0,s.createVisualizerElement)("div");t.style.width="100%",t.style.maxHeight="80vh",t.style.background="rgba(0, 0, 0, 0.5)",t.style.borderTop="1px solid rgba(255, 255, 255, 0.1)",t.style.display="none",t.style.flexDirection="column",t.style.padding="8px",t.style.boxSizing="border-box",t.style.borderRadius="8px",t.style.overflowY="scroll",t.style.overflowX="hidden",t.style.textShadow="none",t.style.font="9px Inter, system-ui, -apple-system, sans-serif",t.style.color="white",t.id="memory-visualization-component-stack-panel";let n=!1;return t.addEventListener("mouseenter",()=>{n=!0}),t.addEventListener("mouseleave",()=>{n=!1}),e((0,s.debounce)(e=>{var i;if(n)return;if(t.innerHTML="",null==e.selectedElementId||!(null===(i=e.selectedReactComponentStack)||void 0===i?void 0:i.length))return void(t.style.display="none");t.style.display="flex";const o=(0,s.createVisualizerElement)("div");o.textContent="Component Stack:",o.style.fontWeight="bold",o.style.marginBottom="8px",t.appendChild(o);let r=0;e.selectedReactComponentStack.forEach(e=>{const n=(0,s.createVisualizerElement)("div");n.style.marginBottom="4px",n.textContent=e,t.appendChild(n),++r}),0===r&&o.remove()},1)),t};const s=n(498)},933(e,t,n){var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=s(n(282)),o=n(23),r=n(476);if(!(0,r.hasRunInSession)()){const e=new i.default({isDevMode:!0}),t=new o.DOMVisualizationExtension(e);e.registerExtension(t),e.start(),(0,r.setRunInSession)()}},946(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.createToggleButton=function(e,t){const n=(0,s.createVisualizerElement)("div");n.style.width="40px",n.style.height="24px",n.style.borderRadius="9999px",n.style.backgroundColor="#34C759",n.style.cursor="pointer",n.style.position="relative",n.style.transition="background-color 0.3s ease";const i=(0,s.createVisualizerElement)("div");return i.style.width="18px",i.style.height="18px",i.style.backgroundColor="white",i.style.borderRadius="50%",i.style.position="absolute",i.style.top="3px",i.style.left="3px",i.style.transition="left 0.25s ease",n.appendChild(i),n.addEventListener("click",()=>{t.value=!t.value,t.value?(e.style.display="none",e.style.pointerEvents="none",e.style.userSelect="none",i.style.left="19px",n.style.backgroundColor="#FF3B30"):(e.style.display="block",e.style.pointerEvents="auto",e.style.userSelect="auto",i.style.left="3px",n.style.backgroundColor="#34C759")}),n};const s=n(498)},953(e,t,n){var s,i,o,r,l,a,c,u=this&&this.__classPrivateFieldSet||function(e,t,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(e,n):i?i.value=n:t.set(e,n),n},d=this&&this.__classPrivateFieldGet||function(e,t,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(e):s?s.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.EventListenerTracker=void 0;const f=n(737),h=n(313);class p{constructor(){s.add(this),i.set(this,void 0),o.set(this,void 0),r.set(this,void 0),l.set(this,void 0),u(this,i,new h.WeakMapPlus({fallback:"noop",cleanupMs:100}),"f"),u(this,o,new Map,"f"),u(this,r,EventTarget.prototype.addEventListener,"f"),u(this,l,EventTarget.prototype.removeEventListener,"f"),d(this,s,"m",a).call(this)}static getInstance(){return p.instance||(p.instance=new p),p.instance}addListener(e,t,n,s){e.addEventListener(t,n,s)}removeListener(e,t,n,s){e.removeEventListener(t,n,s)}scan(e){const t=new Map;for(const[n,s]of d(this,i,"f").entries())if(n instanceof Element&&!n.isConnected)for(const i of s){if(!i.cb.deref())continue;const s=e(new WeakRef(n));t.has(s)||t.set(s,[]);const o=t.get(s);let r=null==o?void 0:o.find(e=>e.type===i.type);r||(r={type:i.type,count:0,entries:[]},null==o||o.push(r)),r.count++,r.entries.push(new WeakRef(i))}return u(this,o,t,"f"),t}getDetachedListeners(){return d(this,o,"f")}destroy(){d(this,s,"m",c).call(this),d(this,i,"f").destroy(),d(this,o,"f").clear(),p.instance=null}}t.EventListenerTracker=p,i=new WeakMap,o=new WeakMap,r=new WeakMap,l=new WeakMap,s=new WeakSet,a=function(){const e=this;EventTarget.prototype.addEventListener=function(t,n,s){var o;if(d(e,r,"f").call(this,t,n,s),this instanceof Element){const r=(0,f.getFiberNodeFromElement)(this),l={type:t,cb:new WeakRef(n),options:s,fiber:r?new WeakRef(r):void 0},a=null!==(o=d(e,i,"f").get(this))&&void 0!==o?o:[];a.push(l),d(e,i,"f").set(this,a)}},EventTarget.prototype.removeEventListener=function(t,n,s){if(d(e,l,"f").call(this,t,n,s),this instanceof Element){const o=d(e,i,"f").get(this);if(o){const r=o.findIndex(e=>e.type===t&&e.cb.deref()===n&&e.options===s);-1!==r&&o.splice(r,1),0===o.length?d(e,i,"f").delete(this):d(e,i,"f").set(this,o)}}}},c=function(){EventTarget.prototype.addEventListener=d(this,r,"f"),EventTarget.prototype.removeEventListener=d(this,l,"f")},p.instance=null},979(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.IntersectionObserverManager=void 0;class n{constructor(){this.observedElements=new Map,this.observer=new IntersectionObserver(e=>{e.forEach(e=>{const t=e.target,n=this.observedElements.get(t);n&&n(e)})},{threshold:0,rootMargin:"50px"})}static getInstance(){return n.instance||(n.instance=new n),n.instance}observe(e,t){const n=e.deref();null!=n&&(this.observedElements.set(n,t),this.observer.observe(n))}unobserve(e){const t=e.deref();null!=t&&(this.observedElements.delete(t),this.observer.unobserve(t))}}t.IntersectionObserverManager=n}},t={};!function n(s){var i=t[s];if(void 0!==i)return i.exports;var o=t[s]={exports:{}};return e[s].call(o.exports,o,o.exports,n),o.exports}(933)})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memlab/lens",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "MemLens is a tool for inspecting memory leaks in browser",
|
|
6
6
|
"author": "Liang Gong <lgong@meta.com>",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@types/react-reconciler": "^0.28.8",
|
|
32
32
|
"react-reconciler": "^0.31.0",
|
|
33
33
|
"ts-loader": "^9.5.1",
|
|
34
|
-
"typescript": "^5.
|
|
34
|
+
"typescript": "^5.9.3",
|
|
35
35
|
"webpack": "^5.97.1",
|
|
36
36
|
"webpack-cli": "^5.1.4"
|
|
37
37
|
},
|