@react-native/debugger-frontend
Version:
Debugger frontend for React Native based on Chrome DevTools
226 lines (225 loc) • 114 kB
JavaScript
import*as e from"../../../core/common/common.js";import*as t from"../../../core/i18n/i18n.js";import*as a from"../../../core/sdk/sdk.js";import*as r from"../../../ui/components/buttons/buttons.js";import*as o from"../../../ui/components/chrome_link/chrome_link.js";import*as i from"../../../ui/components/expandable_list/expandable_list.js";import*as n from"../../../ui/components/icon_button/icon_button.js";import*as s from"../../../ui/components/legacy_wrapper/legacy_wrapper.js";import*as l from"../../../ui/components/render_coordinator/render_coordinator.js";import*as c from"../../../ui/components/report_view/report_view.js";import*as d from"../../../ui/components/tree_outline/tree_outline.js";import*as h from"../../../ui/legacy/components/utils/utils.js";import*as u from"../../../ui/lit-html/lit-html.js";import*as m from"../../../ui/visual_logging/visual_logging.js";import*as g from"../../../ui/components/data_grid/data_grid.js";import*as p from"../../../core/platform/platform.js";import*as b from"../../../core/root/root.js";import*as w from"../../../models/bindings/bindings.js";import*as f from"../../../models/workspace/workspace.js";import*as v from"../../network/forward/forward.js";import*as k from"../../../third_party/csp_evaluator/csp_evaluator.js";import*as y from"../../../ui/components/adorners/adorners.js";import*as S from"../../../core/host/host.js";import*as T from"../../../ui/components/input/input.js";import*as R from"../../../ui/legacy/legacy.js";const $={notMainFrame:"Navigation happened in a frame other than the main frame.",backForwardCacheDisabled:"Back/forward cache is disabled by flags. Visit chrome://flags/#back-forward-cache to enable it locally on this device.",relatedActiveContentsExist:"The page was opened using '`window.open()`' and another tab has a reference to it, or the page opened a window.",HTTPStatusNotOK:"Only pages with a status code of 2XX can be cached.",schemeNotHTTPOrHTTPS:"Only pages whose URL scheme is HTTP / HTTPS can be cached.",loading:"The page did not finish loading before navigating away.",wasGrantedMediaAccess:"Pages that have granted access to record video or audio are not currently eligible for back/forward cache.",HTTPMethodNotGET:"Only pages loaded via a GET request are eligible for back/forward cache.",subframeIsNavigating:"An iframe on the page started a navigation that did not complete.",timeout:"The page exceeded the maximum time in back/forward cache and was expired.",cacheLimit:"The page was evicted from the cache to allow another page to be cached.",JavaScriptExecution:"Chrome detected an attempt to execute JavaScript while in the cache.",rendererProcessKilled:"The renderer process for the page in back/forward cache was killed.",rendererProcessCrashed:"The renderer process for the page in back/forward cache crashed.",grantedMediaStreamAccess:"Pages that have granted media stream access are not currently eligible for back/forward cache.",cacheFlushed:"The cache was intentionally cleared.",serviceWorkerVersionActivation:"The page was evicted from back/forward cache due to a service worker activation.",sessionRestored:"Chrome restarted and cleared the back/forward cache entries.",serviceWorkerPostMessage:"A service worker attempted to send the page in back/forward cache a `MessageEvent`.",enteredBackForwardCacheBeforeServiceWorkerHostAdded:"A service worker was activated while the page was in back/forward cache.",serviceWorkerClaim:"The page was claimed by a service worker while it is in back/forward cache.",haveInnerContents:"Pages that have certain kinds of embedded content (e.g. PDFs) are not currently eligible for back/forward cache.",timeoutPuttingInCache:"The page timed out entering back/forward cache (likely due to long-running pagehide handlers).",backForwardCacheDisabledByLowMemory:"Back/forward cache is disabled due to insufficient memory.",backForwardCacheDisabledByCommandLine:"Back/forward cache is disabled by the command line.",networkRequestDatapipeDrainedAsBytesConsumer:"Pages that have inflight fetch() or XHR are not currently eligible for back/forward cache.",networkRequestRedirected:"The page was evicted from back/forward cache because an active network request involved a redirect.",networkRequestTimeout:"The page was evicted from the cache because a network connection was open too long. Chrome limits the amount of time that a page may receive data while cached.",networkExceedsBufferLimit:"The page was evicted from the cache because an active network connection received too much data. Chrome limits the amount of data that a page may receive while cached.",navigationCancelledWhileRestoring:"Navigation was cancelled before the page could be restored from back/forward cache.",backForwardCacheDisabledForPrerender:"Back/forward cache is disabled for prerenderer.",userAgentOverrideDiffers:"Browser has changed the user agent override header.",foregroundCacheLimit:"The page was evicted from the cache to allow another page to be cached.",backForwardCacheDisabledForDelegate:"Back/forward cache is not supported by delegate.",unloadHandlerExistsInMainFrame:"The page has an unload handler in the main frame.",unloadHandlerExistsInSubFrame:"The page has an unload handler in a sub frame.",serviceWorkerUnregistration:"ServiceWorker was unregistered while a page was in back/forward cache.",noResponseHead:"Pages that do not have a valid response head cannot enter back/forward cache.",cacheControlNoStore:"Pages with cache-control:no-store header cannot enter back/forward cache.",ineligibleAPI:"Ineligible APIs were used.",internalError:"Internal error.",webSocket:"Pages with WebSocket cannot enter back/forward cache.",webTransport:"Pages with WebTransport cannot enter back/forward cache.",webRTC:"Pages with WebRTC cannot enter back/forward cache.",mainResourceHasCacheControlNoStore:"Pages whose main resource has cache-control:no-store cannot enter back/forward cache.",mainResourceHasCacheControlNoCache:"Pages whose main resource has cache-control:no-cache cannot enter back/forward cache.",subresourceHasCacheControlNoStore:"Pages whose subresource has cache-control:no-store cannot enter back/forward cache.",subresourceHasCacheControlNoCache:"Pages whose subresource has cache-control:no-cache cannot enter back/forward cache.",containsPlugins:"Pages containing plugins are not currently eligible for back/forward cache.",documentLoaded:"The document did not finish loading before navigating away.",dedicatedWorkerOrWorklet:"Pages that use a dedicated worker or worklet are not currently eligible for back/forward cache.",outstandingNetworkRequestOthers:"Pages with an in-flight network request are not currently eligible for back/forward cache.",outstandingIndexedDBTransaction:"Page with ongoing indexed DB transactions are not currently eligible for back/forward cache.",requestedNotificationsPermission:"Pages that have requested notifications permissions are not currently eligible for back/forward cache.",requestedMIDIPermission:"Pages that have requested MIDI permissions are not currently eligible for back/forward cache.",requestedAudioCapturePermission:"Pages that have requested audio capture permissions are not currently eligible for back/forward cache.",requestedVideoCapturePermission:"Pages that have requested video capture permissions are not currently eligible for back/forward cache.",requestedBackForwardCacheBlockedSensors:"Pages that have requested sensor permissions are not currently eligible for back/forward cache.",requestedBackgroundWorkPermission:"Pages that have requested background sync or fetch permissions are not currently eligible for back/forward cache.",broadcastChannel:"The page cannot be cached because it has a BroadcastChannel instance with registered listeners.",indexedDBConnection:"Pages that have an open IndexedDB connection are not currently eligible for back/forward cache.",webXR:"Pages that use WebXR are not currently eligible for back/forward cache.",sharedWorker:"Pages that use SharedWorker are not currently eligible for back/forward cache.",webLocks:"Pages that use WebLocks are not currently eligible for back/forward cache.",webHID:"Pages that use WebHID are not currently eligible for back/forward cache.",webShare:"Pages that use WebShare are not currently eligible for back/forwad cache.",requestedStorageAccessGrant:"Pages that have requested storage access are not currently eligible for back/forward cache.",webNfc:"Pages that use WebNfc are not currently eligible for back/forwad cache.",outstandingNetworkRequestFetch:"Pages with an in-flight fetch network request are not currently eligible for back/forward cache.",outstandingNetworkRequestXHR:"Pages with an in-flight XHR network request are not currently eligible for back/forward cache.",appBanner:"Pages that requested an AppBanner are not currently eligible for back/forward cache.",printing:"Pages that show Printing UI are not currently eligible for back/forward cache.",webDatabase:"Pages that use WebDatabase are not currently eligible for back/forward cache.",pictureInPicture:"Pages that use Picture-in-Picture are not currently eligible for back/forward cache.",speechRecognizer:"Pages that use SpeechRecognizer are not currently eligible for back/forward cache.",idleManager:"Pages that use IdleManager are not currently eligible for back/forward cache.",paymentManager:"Pages that use PaymentManager are not currently eligible for back/forward cache.",speechSynthesis:"Pages that use SpeechSynthesis are not currently eligible for back/forward cache.",keyboardLock:"Pages that use Keyboard lock are not currently eligible for back/forward cache.",webOTPService:"Pages that use WebOTPService are not currently eligible for bfcache.",outstandingNetworkRequestDirectSocket:"Pages with an in-flight network request are not currently eligible for back/forward cache.",injectedJavascript:"Pages that `JavaScript` is injected into by extensions are not currently eligible for back/forward cache.",injectedStyleSheet:"Pages that a `StyleSheet` is injected into by extensions are not currently eligible for back/forward cache.",contentSecurityHandler:"Pages that use SecurityHandler are not eligible for back/forward cache.",contentWebAuthenticationAPI:"Pages that use WebAuthetication API are not eligible for back/forward cache.",contentFileChooser:"Pages that use FileChooser API are not eligible for back/forward cache.",contentSerial:"Pages that use Serial API are not eligible for back/forward cache.",contentFileSystemAccess:"Pages that use File System Access API are not eligible for back/forward cache.",contentMediaDevicesDispatcherHost:"Pages that use Media Device Dispatcher are not eligible for back/forward cache.",contentWebBluetooth:"Pages that use WebBluetooth API are not eligible for back/forward cache.",contentWebUSB:"Pages that use WebUSB API are not eligible for back/forward cache.",contentMediaSession:"Pages that use MediaSession API and set a playback state are not eligible for back/forward cache.",contentMediaSessionService:"Pages that use MediaSession API and set action handlers are not eligible for back/forward cache.",contentMediaPlay:"A media player was playing upon navigating away.",contentScreenReader:"Back/forward cache is disabled due to screen reader.",embedderPopupBlockerTabHelper:"Popup blocker was present upon navigating away.",embedderSafeBrowsingTriggeredPopupBlocker:"Safe Browsing considered this page to be abusive and blocked popup.",embedderSafeBrowsingThreatDetails:"Safe Browsing details were shown upon navigating away.",embedderAppBannerManager:"App Banner was present upon navigating away.",embedderDomDistillerViewerSource:"DOM Distiller Viewer was present upon navigating away.",embedderDomDistillerSelfDeletingRequestDelegate:"DOM distillation was in progress upon navigating away.",embedderOomInterventionTabHelper:"Out-Of-Memory Intervention bar was present upon navigating away.",embedderOfflinePage:"The offline page was shown upon navigating away.",embedderChromePasswordManagerClientBindCredentialManager:"Chrome Password Manager was present upon navigating away.",embedderPermissionRequestManager:"There were permission requests upon navigating away.",embedderModalDialog:"Modal dialog such as form resubmission or http password dialog was shown for the page upon navigating away.",embedderExtensions:"Back/forward cache is disabled due to extensions.",embedderExtensionMessaging:"Back/forward cache is disabled due to extensions using messaging API.",embedderExtensionMessagingForOpenPort:"Extensions with long-lived connection should close the connection before entering back/forward cache.",embedderExtensionSentMessageToCachedFrame:"Extensions with long-lived connection attempted to send messages to frames in back/forward cache.",errorDocument:"Back/forward cache is disabled due to a document error.",fencedFramesEmbedder:"Pages using FencedFrames cannot be stored in bfcache.",keepaliveRequest:"Back/forward cache is disabled due to a keepalive request.",jsNetworkRequestReceivedCacheControlNoStoreResource:"Back/forward cache is disabled because some JavaScript network request received resource with `Cache-Control: no-store` header.",indexedDBEvent:"Back/forward cache is disabled due to an IndexedDB event.",cookieDisabled:"Back/forward cache is disabled because cookies are disabled on a page that uses `Cache-Control: no-store`.",webRTCSticky:"Back/forward cache is disabled because WebRTC has been used.",webTransportSticky:"Back/forward cache is disabled because WebTransport has been used.",webSocketSticky:"Back/forward cache is disabled because WebSocket has been used."},x=t.i18n.registerUIStrings("panels/application/components/BackForwardCacheStrings.ts",$),N=t.i18n.getLazilyComputedLocalizedString.bind(void 0,x),C={NotPrimaryMainFrame:{name:N($.notMainFrame)},BackForwardCacheDisabled:{name:N($.backForwardCacheDisabled)},RelatedActiveContentsExist:{name:N($.relatedActiveContentsExist)},HTTPStatusNotOK:{name:N($.HTTPStatusNotOK)},SchemeNotHTTPOrHTTPS:{name:N($.schemeNotHTTPOrHTTPS)},Loading:{name:N($.loading)},WasGrantedMediaAccess:{name:N($.wasGrantedMediaAccess)},HTTPMethodNotGET:{name:N($.HTTPMethodNotGET)},SubframeIsNavigating:{name:N($.subframeIsNavigating)},Timeout:{name:N($.timeout)},CacheLimit:{name:N($.cacheLimit)},JavaScriptExecution:{name:N($.JavaScriptExecution)},RendererProcessKilled:{name:N($.rendererProcessKilled)},RendererProcessCrashed:{name:N($.rendererProcessCrashed)},GrantedMediaStreamAccess:{name:N($.grantedMediaStreamAccess)},CacheFlushed:{name:N($.cacheFlushed)},ServiceWorkerVersionActivation:{name:N($.serviceWorkerVersionActivation)},SessionRestored:{name:N($.sessionRestored)},ServiceWorkerPostMessage:{name:N($.serviceWorkerPostMessage)},EnteredBackForwardCacheBeforeServiceWorkerHostAdded:{name:N($.enteredBackForwardCacheBeforeServiceWorkerHostAdded)},ServiceWorkerClaim:{name:N($.serviceWorkerClaim)},HaveInnerContents:{name:N($.haveInnerContents)},TimeoutPuttingInCache:{name:N($.timeoutPuttingInCache)},BackForwardCacheDisabledByLowMemory:{name:N($.backForwardCacheDisabledByLowMemory)},BackForwardCacheDisabledByCommandLine:{name:N($.backForwardCacheDisabledByCommandLine)},NetworkRequestDatapipeDrainedAsBytesConsumer:{name:N($.networkRequestDatapipeDrainedAsBytesConsumer)},NetworkRequestRedirected:{name:N($.networkRequestRedirected)},NetworkRequestTimeout:{name:N($.networkRequestTimeout)},NetworkExceedsBufferLimit:{name:N($.networkExceedsBufferLimit)},NavigationCancelledWhileRestoring:{name:N($.navigationCancelledWhileRestoring)},BackForwardCacheDisabledForPrerender:{name:N($.backForwardCacheDisabledForPrerender)},UserAgentOverrideDiffers:{name:N($.userAgentOverrideDiffers)},ForegroundCacheLimit:{name:N($.foregroundCacheLimit)},BackForwardCacheDisabledForDelegate:{name:N($.backForwardCacheDisabledForDelegate)},UnloadHandlerExistsInMainFrame:{name:N($.unloadHandlerExistsInMainFrame)},UnloadHandlerExistsInSubFrame:{name:N($.unloadHandlerExistsInSubFrame)},ServiceWorkerUnregistration:{name:N($.serviceWorkerUnregistration)},NoResponseHead:{name:N($.noResponseHead)},CacheControlNoStore:{name:N($.cacheControlNoStore)},CacheControlNoStoreCookieModified:{name:N($.cacheControlNoStore)},CacheControlNoStoreHTTPOnlyCookieModified:{name:N($.cacheControlNoStore)},DisableForRenderFrameHostCalled:{name:N($.ineligibleAPI)},BlocklistedFeatures:{name:N($.ineligibleAPI)},SchedulerTrackedFeatureUsed:{name:N($.ineligibleAPI)},DomainNotAllowed:{name:N($.internalError)},ConflictingBrowsingInstance:{name:N($.internalError)},NotMostRecentNavigationEntry:{name:N($.internalError)},IgnoreEventAndEvict:{name:N($.internalError)},BrowsingInstanceNotSwapped:{name:N($.internalError)},ActivationNavigationsDisallowedForBug1234857:{name:N($.internalError)},Unknown:{name:N($.internalError)},RenderFrameHostReused_SameSite:{name:N($.internalError)},RenderFrameHostReused_CrossSite:{name:N($.internalError)},WebSocket:{name:N($.webSocket)},WebTransport:{name:N($.webTransport)},WebRTC:{name:N($.webRTC)},MainResourceHasCacheControlNoStore:{name:N($.mainResourceHasCacheControlNoStore)},MainResourceHasCacheControlNoCache:{name:N($.mainResourceHasCacheControlNoCache)},SubresourceHasCacheControlNoStore:{name:N($.subresourceHasCacheControlNoStore)},SubresourceHasCacheControlNoCache:{name:N($.subresourceHasCacheControlNoCache)},ContainsPlugins:{name:N($.containsPlugins)},DocumentLoaded:{name:N($.documentLoaded)},DedicatedWorkerOrWorklet:{name:N($.dedicatedWorkerOrWorklet)},OutstandingNetworkRequestOthers:{name:N($.outstandingNetworkRequestOthers)},OutstandingIndexedDBTransaction:{name:N($.outstandingIndexedDBTransaction)},RequestedNotificationsPermission:{name:N($.requestedNotificationsPermission)},RequestedMIDIPermission:{name:N($.requestedMIDIPermission)},RequestedAudioCapturePermission:{name:N($.requestedAudioCapturePermission)},RequestedVideoCapturePermission:{name:N($.requestedVideoCapturePermission)},RequestedBackForwardCacheBlockedSensors:{name:N($.requestedBackForwardCacheBlockedSensors)},RequestedBackgroundWorkPermission:{name:N($.requestedBackgroundWorkPermission)},BroadcastChannel:{name:N($.broadcastChannel)},IndexedDBConnection:{name:N($.indexedDBConnection)},WebXR:{name:N($.webXR)},SharedWorker:{name:N($.sharedWorker)},WebLocks:{name:N($.webLocks)},WebHID:{name:N($.webHID)},WebShare:{name:N($.webShare)},RequestedStorageAccessGrant:{name:N($.requestedStorageAccessGrant)},WebNfc:{name:N($.webNfc)},OutstandingNetworkRequestFetch:{name:N($.outstandingNetworkRequestFetch)},OutstandingNetworkRequestXHR:{name:N($.outstandingNetworkRequestXHR)},AppBanner:{name:N($.appBanner)},Printing:{name:N($.printing)},WebDatabase:{name:N($.webDatabase)},PictureInPicture:{name:N($.pictureInPicture)},SpeechRecognizer:{name:N($.speechRecognizer)},IdleManager:{name:N($.idleManager)},PaymentManager:{name:N($.paymentManager)},SpeechSynthesis:{name:N($.speechSynthesis)},KeyboardLock:{name:N($.keyboardLock)},WebOTPService:{name:N($.webOTPService)},OutstandingNetworkRequestDirectSocket:{name:N($.outstandingNetworkRequestDirectSocket)},InjectedJavascript:{name:N($.injectedJavascript)},InjectedStyleSheet:{name:N($.injectedStyleSheet)},Dummy:{name:N($.internalError)},ContentSecurityHandler:{name:N($.contentSecurityHandler)},ContentWebAuthenticationAPI:{name:N($.contentWebAuthenticationAPI)},ContentFileChooser:{name:N($.contentFileChooser)},ContentSerial:{name:N($.contentSerial)},ContentFileSystemAccess:{name:N($.contentFileSystemAccess)},ContentMediaDevicesDispatcherHost:{name:N($.contentMediaDevicesDispatcherHost)},ContentWebBluetooth:{name:N($.contentWebBluetooth)},ContentWebUSB:{name:N($.contentWebUSB)},ContentMediaSession:{name:N($.contentMediaSession)},ContentMediaSessionService:{name:N($.contentMediaSessionService)},ContentMediaPlay:{name:N($.contentMediaPlay)},ContentScreenReader:{name:N($.contentScreenReader)},EmbedderPopupBlockerTabHelper:{name:N($.embedderPopupBlockerTabHelper)},EmbedderSafeBrowsingTriggeredPopupBlocker:{name:N($.embedderSafeBrowsingTriggeredPopupBlocker)},EmbedderSafeBrowsingThreatDetails:{name:N($.embedderSafeBrowsingThreatDetails)},EmbedderAppBannerManager:{name:N($.embedderAppBannerManager)},EmbedderDomDistillerViewerSource:{name:N($.embedderDomDistillerViewerSource)},EmbedderDomDistillerSelfDeletingRequestDelegate:{name:N($.embedderDomDistillerSelfDeletingRequestDelegate)},EmbedderOomInterventionTabHelper:{name:N($.embedderOomInterventionTabHelper)},EmbedderOfflinePage:{name:N($.embedderOfflinePage)},EmbedderChromePasswordManagerClientBindCredentialManager:{name:N($.embedderChromePasswordManagerClientBindCredentialManager)},EmbedderPermissionRequestManager:{name:N($.embedderPermissionRequestManager)},EmbedderModalDialog:{name:N($.embedderModalDialog)},EmbedderExtensions:{name:N($.embedderExtensions)},EmbedderExtensionMessaging:{name:N($.embedderExtensionMessaging)},EmbedderExtensionMessagingForOpenPort:{name:N($.embedderExtensionMessagingForOpenPort)},EmbedderExtensionSentMessageToCachedFrame:{name:N($.embedderExtensionSentMessageToCachedFrame)},ErrorDocument:{name:N($.errorDocument)},FencedFramesEmbedder:{name:N($.fencedFramesEmbedder)},KeepaliveRequest:{name:N($.keepaliveRequest)},JsNetworkRequestReceivedCacheControlNoStoreResource:{name:N($.jsNetworkRequestReceivedCacheControlNoStoreResource)},IndexedDBEvent:{name:N($.indexedDBEvent)},CookieDisabled:{name:N($.cookieDisabled)},WebRTCSticky:{name:N($.webRTCSticky)},WebTransportSticky:{name:N($.webTransportSticky)},WebSocketSticky:{name:N($.webSocketSticky)},HTTPAuthRequired:{name:t.i18n.lockedLazyString("HTTPAuthRequired")},CookieFlushed:{name:t.i18n.lockedLazyString("CookieFlushed")},SmartCard:{name:t.i18n.lockedLazyString("SmartCard")},LiveMediaStreamTrack:{name:t.i18n.lockedLazyString("LiveMediaStreamTrack")},UnloadHandler:{name:t.i18n.lockedLazyString("UnloadHandler")},ParserAborted:{name:t.i18n.lockedLazyString("ParserAborted")},BroadcastChannelOnMessage:{name:t.i18n.lockedLazyString("BroadcastChannelOnMessage")},RequestedByWebViewClient:{name:t.i18n.lockedLazyString("RequestedByWebViewClient")},WebViewSettingsChanged:{name:t.i18n.lockedLazyString("WebViewSettingsChanged")},WebViewJavaScriptObjectChanged:{name:t.i18n.lockedLazyString("WebViewJavaScriptObjectChanged")},WebViewMessageListenerInjected:{name:t.i18n.lockedLazyString("WebViewMessageListenerInjected")},WebViewSafeBrowsingAllowlistChanged:{name:t.i18n.lockedLazyString("WebViewSafeBrowsingAllowlistChanged")},WebViewDocumentStartJavascriptChanged:{name:t.i18n.lockedLazyString("WebViewDocumentStartJavascriptChanged")}},I=new CSSStyleSheet;I.replaceSync(".inline-icon{vertical-align:sub}.gray-text{color:var(--sys-color-token-subtle);margin:0 0 5px 56px;display:flex;flex-direction:row;align-items:center;flex:auto;overflow-wrap:break-word;overflow:hidden}.details-list{margin-left:56px;grid-column-start:span 2}.help-outline-icon{margin:0 2px}.circled-exclamation-icon{margin-right:10px;flex-shrink:0}.status{margin-right:11px;flex-shrink:0}.report-line{grid-column-start:span 2;display:flex;align-items:center;margin:0 30px;line-height:26px}.report-key{color:var(--sys-color-token-subtle);min-width:auto;overflow-wrap:break-word;align-self:start}.report-value{padding:0 6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.link,\n.devtools-link{color:var(--sys-color-primary);text-decoration:underline;cursor:pointer;outline-offset:2px}.tree-outline li .selection{margin-left:-5px}@media (forced-colors: active){.link,\n .devtools-link{color:linktext;text-decoration-color:linktext}}\n/*# sourceURL=backForwardCacheView.css */\n");const P={mainFrame:"Main Frame",backForwardCacheTitle:"Back/forward cache",unavailable:"unavailable",url:"URL:",unknown:"Unknown Status",normalNavigation:"Not served from back/forward cache: to trigger back/forward cache, use Chrome's back/forward buttons, or use the test button below to automatically navigate away and back.",restoredFromBFCache:"Successfully served from back/forward cache.",pageSupportNeeded:"Actionable",pageSupportNeededExplanation:"These reasons are actionable i.e. they can be cleaned up to make the page eligible for back/forward cache.",circumstantial:"Not Actionable",circumstantialExplanation:"These reasons are not actionable i.e. caching was prevented by something outside of the direct control of the page.",supportPending:"Pending Support",runTest:"Test back/forward cache",runningTest:"Running test",learnMore:"Learn more: back/forward cache eligibility",neverUseUnload:"Learn more: Never use unload handler",supportPendingExplanation:"Chrome support for these reasons is pending i.e. they will not prevent the page from being eligible for back/forward cache in a future version of Chrome.",blockingExtensionId:"Extension id: ",framesTitle:"Frames",issuesInSingleFrame:"{n, plural, =1 {# issue found in 1 frame.} other {# issues found in 1 frame.}}",issuesInMultipleFrames:"{n, plural, =1 {# issue found in {m} frames.} other {# issues found in {m} frames.}}",framesPerIssue:"{n, plural, =1 {# frame} other {# frames}}",blankURLTitle:"Blank URL [{PH1}]",filesPerIssue:"{n, plural, =1 {# file} other {# files}}"},D=t.i18n.registerUIStrings("panels/application/components/BackForwardCacheView.ts",P),B=t.i18n.getLocalizedString.bind(void 0,D),M=l.RenderCoordinator.RenderCoordinator.instance();class V extends s.LegacyWrapper.WrappableComponent{static litTagName=u.literal`devtools-resources-back-forward-cache-view`;#e=this.attachShadow({mode:"open"});#t="Result";#a=0;#r=0;constructor(){super(),this.#o()?.addEventListener(a.ResourceTreeModel.Events.PrimaryPageChanged,this.render,this),this.#o()?.addEventListener(a.ResourceTreeModel.Events.BackForwardCacheDetailsUpdated,this.render,this)}#o(){const e=a.TargetManager.TargetManager.instance().primaryPageTarget();return e?.model(a.ResourceTreeModel.ResourceTreeModel)||null}#i(){return this.#o()?.mainFrame||null}connectedCallback(){this.parentElement?.classList.add("overflow-auto"),this.#e.adoptedStyleSheets=[I]}async render(){await M.write("BackForwardCacheView render",(()=>{u.render(u.html`
<${c.ReportView.Report.litTagName} .data=${{reportTitle:B(P.backForwardCacheTitle)}} jslog=${m.pane("back-forward-cache")}>
${this.#n()}
</${c.ReportView.Report.litTagName}>
`,this.#e,{host:this})}))}#s(){a.TargetManager.TargetManager.instance().removeModelListener(a.ResourceTreeModel.ResourceTreeModel,a.ResourceTreeModel.Events.FrameNavigated,this.#s,this),this.#t="Result",this.render()}async#l(){a.TargetManager.TargetManager.instance().removeModelListener(a.ResourceTreeModel.ResourceTreeModel,a.ResourceTreeModel.Events.FrameNavigated,this.#l,this),await this.#c(50)}async#c(e){const t=a.TargetManager.TargetManager.instance().primaryPageTarget(),r=t?.model(a.ResourceTreeModel.ResourceTreeModel),o=await(r?.navigationHistory());r&&o&&(o.currentIndex===this.#r?window.setTimeout(this.#c.bind(this,2*e),e):(a.TargetManager.TargetManager.instance().addModelListener(a.ResourceTreeModel.ResourceTreeModel,a.ResourceTreeModel.Events.FrameNavigated,this.#s,this),r.navigateToHistoryEntry(o.entries[o.currentIndex-1])))}async#d(){const e=a.TargetManager.TargetManager.instance().primaryPageTarget(),t=e?.model(a.ResourceTreeModel.ResourceTreeModel),r=await(t?.navigationHistory());t&&r&&(this.#r=r.currentIndex,this.#t="Running",this.render(),a.TargetManager.TargetManager.instance().addModelListener(a.ResourceTreeModel.ResourceTreeModel,a.ResourceTreeModel.Events.FrameNavigated,this.#l,this),t.navigate("chrome://terms"))}#n(){const t=this.#i();if(!t)return u.html`
<${c.ReportView.ReportKey.litTagName}>
${B(P.mainFrame)}
</${c.ReportView.ReportKey.litTagName}>
<${c.ReportView.ReportValue.litTagName}>
${B(P.unavailable)}
</${c.ReportView.ReportValue.litTagName}>
`;const a="Running"===this.#t,o=e.ParsedURL.schemeIs(t.url,"devtools:");return u.html`
${this.#h(t.backForwardCacheDetails.restoredFromCache)}
<div class="report-line">
<div class="report-key">
${B(P.url)}
</div>
<div class="report-value" title=${t.url}>
${t.url}
</div>
</div>
${this.#u(t.backForwardCacheDetails.explanationsTree)}
<${c.ReportView.ReportSection.litTagName}>
<${r.Button.Button.litTagName}
aria-label=${B(P.runTest)}
.disabled=${a||o}
.spinner=${a}
.variant=${"primary"}
@click=${this.#d}
jslog=${m.action("back-forward-cache.run-test").track({click:!0})}>
${a?u.html`
${B(P.runningTest)}`:`\n ${B(P.runTest)}\n `}
</${r.Button.Button.litTagName}>
</${c.ReportView.ReportSection.litTagName}>
<${c.ReportView.ReportSectionDivider.litTagName}>
</${c.ReportView.ReportSectionDivider.litTagName}>
${this.#m(t.backForwardCacheDetails.explanations,t.backForwardCacheDetails.explanationsTree)}
<${c.ReportView.ReportSection.litTagName}>
<x-link href="https://web.dev/bfcache/" class="link"
jslog=${m.action("learn-more.eligibility").track({click:!0})}>
${B(P.learnMore)}
</x-link>
</${c.ReportView.ReportSection.litTagName}>
`}#u(e){if(!e||0===e.explanations.length&&0===e.children.length)return u.nothing;const t=this.#g(e,{blankCount:1});t.node.treeNodeData.iconName="frame";let a="";a=1===t.frameCount?B(P.issuesInSingleFrame,{n:t.issueCount}):B(P.issuesInMultipleFrames,{n:t.issueCount,m:t.frameCount});const r={treeNodeData:{text:a},id:"root",children:()=>Promise.resolve([t.node])};return u.html`
<div class="report-line"
jslog=${m.section("frames")}>
<div class="report-key">
${B(P.framesTitle)}
</div>
<div class="report-value">
<${d.TreeOutline.TreeOutline.litTagName} .data=${{tree:[r],defaultRenderer:function(e){return u.html`
<div class="text-ellipsis">
${e.treeNodeData.iconName?u.html`
<${n.Icon.Icon.litTagName} class="inline-icon" style="margin-bottom: -3px;" .data=${{iconName:e.treeNodeData.iconName,color:"var(--icon-default)",width:"20px",height:"20px"}}>
</${n.Icon.Icon.litTagName}>
`:u.nothing}
${e.treeNodeData.text}
</div>
`},compact:!0}}>
</${d.TreeOutline.TreeOutline.litTagName}>
</div>
</div>
`}#g(e,t){let a=1,r=0;const o=[];let i="";e.url.length?i=e.url:(i=B(P.blankURLTitle,{PH1:t.blankCount}),t.blankCount+=1);for(const t of e.explanations){const e={treeNodeData:{text:t.reason},id:String(this.#a++)};r+=1,o.push(e)}for(const i of e.children){const e=this.#g(i,t);e.issueCount>0&&(o.push(e.node),r+=e.issueCount,a+=e.frameCount)}let n={treeNodeData:{text:`(${r}) ${i}`},id:String(this.#a++)};return o.length?(n={...n,children:()=>Promise.resolve(o)},n.treeNodeData.iconName="iframe"):e.url.length||(t.blankCount-=1),{node:n,frameCount:a,issueCount:r}}#h(e){switch(e){case!0:return u.html`
<${c.ReportView.ReportSection.litTagName}>
<div class="status">
<${n.Icon.Icon.litTagName} class="inline-icon" .data=${{iconName:"check-circle",color:"var(--icon-checkmark-green)",width:"20px",height:"20px"}}>
</${n.Icon.Icon.litTagName}>
</div>
${B(P.restoredFromBFCache)}
</${c.ReportView.ReportSection.litTagName}>
`;case!1:return u.html`
<${c.ReportView.ReportSection.litTagName}>
<div class="status">
<${n.Icon.Icon.litTagName} class="inline-icon" .data=${{iconName:"clear",color:"var(--icon-default)",width:"20px",height:"20px"}}>
</${n.Icon.Icon.litTagName}>
</div>
${B(P.normalNavigation)}
</${c.ReportView.ReportSection.litTagName}>
`}return u.html`
<${c.ReportView.ReportSection.litTagName}>
${B(P.unknown)}
</${c.ReportView.ReportSection.litTagName}>
`}#p(e,t,a){let r=e.url;0===r.length&&(r=B(P.blankURLTitle,{PH1:t.blankCount}),t.blankCount+=1),e.explanations.forEach((e=>{let t=a.get(e.reason);void 0===t?(t=[r],a.set(e.reason,t)):t.push(r)})),e.children.map((e=>{this.#p(e,t,a)}))}#m(e,t){if(0===e.length)return u.nothing;const a=e.filter((e=>"PageSupportNeeded"===e.type)),r=e.filter((e=>"SupportPending"===e.type)),o=e.filter((e=>"Circumstantial"===e.type)),i=new Map;return t&&this.#p(t,{blankCount:1},i),u.html`
${this.#b(B(P.pageSupportNeeded),B(P.pageSupportNeededExplanation),a,i)}
${this.#b(B(P.supportPending),B(P.supportPendingExplanation),r,i)}
${this.#b(B(P.circumstantial),B(P.circumstantialExplanation),o,i)}
`}#b(e,t,a,r){return u.html`
${a.length>0?u.html`
<${c.ReportView.ReportSectionHeader.litTagName}>
${e}
<div class="help-outline-icon">
<${n.Icon.Icon.litTagName} class="inline-icon" .data=${{iconName:"help",color:"var(--icon-default)",width:"16px",height:"16px"}} title=${t}>
</${n.Icon.Icon.litTagName}>
</div>
</${c.ReportView.ReportSectionHeader.litTagName}>
${a.map((e=>this.#w(e,r.get(e.reason))))}
`:u.nothing}
`}#f(e){if("EmbedderExtensionSentMessageToCachedFrame"===e.reason&&e.context){const t="chrome://extensions/?id="+e.context;return u.html`${B(P.blockingExtensionId)}
<${o.ChromeLink.ChromeLink.litTagName} .href=${t}>${e.context}</${o.ChromeLink.ChromeLink.litTagName}>`}return u.nothing}#v(e){if(void 0===e||0===e.length)return u.nothing;const t=[u.html`<div>${B(P.framesPerIssue,{n:e.length})}</div>`];return t.push(...e.map((e=>u.html`<div class="text-ellipsis" title=${e}
jslog=${m.treeItem()}>${e}</div>`))),u.html`
<div class="details-list"
jslog=${m.tree("frames-per-issue")}>
<${i.ExpandableList.ExpandableList.litTagName} .data=${{rows:t,title:B(P.framesPerIssue,{n:e.length})}}
jslog=${m.treeItem()}></${i.ExpandableList.ExpandableList.litTagName}>
</div>
`}#k(e){return"UnloadHandlerExistsInMainFrame"===e.reason||"UnloadHandlerExistsInSubFrame"===e.reason?u.html`
<x-link href="https://web.dev/bfcache/#never-use-the-unload-event" class="link"
jslog=${m.action("learn-more.never-use-unload").track({click:!0})}>
${B(P.neverUseUnload)}
</x-link>`:u.nothing}#y(e){if(void 0===e||0===e.length)return u.nothing;const t=new h.Linkifier.Linkifier(50),a=[u.html`<div>${B(P.filesPerIssue,{n:e.length})}</div>`];return a.push(...e.map((e=>u.html`${t.linkifyScriptLocation(null,null,e.url,e.lineNumber,{columnNumber:e.columnNumber,showColumnNumber:!0,inlineFrameIndex:0})}`))),u.html`
<div class="details-list">
<${i.ExpandableList.ExpandableList.litTagName} .data=${{rows:a}}></${i.ExpandableList.ExpandableList.litTagName}>
</div>
`}#w(e,t){return u.html`
<${c.ReportView.ReportSection.litTagName}>
${e.reason in C?u.html`
<div class="circled-exclamation-icon">
<${n.Icon.Icon.litTagName} class="inline-icon" .data=${{iconName:"warning",color:"var(--icon-warning)",width:"16px",height:"16px"}}>
</${n.Icon.Icon.litTagName}>
</div>
<div>
${C[e.reason].name()}
${this.#k(e)}
${this.#f(e)}
</div>`:u.nothing}
</${c.ReportView.ReportSection.litTagName}>
<div class="gray-text">
${e.reason}
</div>
${this.#y(e.details)}
${this.#v(t)}
`}}customElements.define("devtools-resources-back-forward-cache-view",V);var F=Object.freeze({__proto__:null,BackForwardCacheView:V});const E=new CSSStyleSheet;E.replaceSync("devtools-data-grid-controller{border:1px solid var(--sys-color-divider);margin-top:0}.link,\n.devtools-link{color:var(--sys-color-primary);text-decoration:underline;cursor:pointer;outline-offset:2px}@media (forced-colors: active){.link,\n .devtools-link{color:linktext;text-decoration-color:linktext}}\n/*# sourceURL=bounceTrackingMitigationsView.css */\n");const L={bounceTrackingMitigationsTitle:"Bounce tracking mitigations",forceRun:"Force run",runningMitigations:"Running",stateDeletedFor:"State was deleted for the following sites:",checkingPotentialTrackers:"Checking for potential bounce tracking sites.",learnMore:"Learn more: Bounce Tracking Mitigations",noPotentialBounceTrackersIdentified:"State was not cleared for any potential bounce tracking sites. Either none were identified or third-party cookies are not blocked.",featureDisabled:'Bounce tracking mitigations are disabled. To enable them, set the flag at {PH1} to "Enabled With Deletion".',featureFlag:"Bounce Tracking Mitigations Feature Flag"},A=t.i18n.registerUIStrings("panels/application/components/BounceTrackingMitigationsView.ts",L),H=t.i18n.getLocalizedString.bind(void 0,A);class O extends s.LegacyWrapper.WrappableComponent{static litTagName=u.literal`devtools-bounce-tracking-mitigations-view`;#e=this.attachShadow({mode:"open"});#S=[];#t="Result";#T=!1;#R=!1;connectedCallback(){this.#e.adoptedStyleSheets=[E],this.#$()}async#$(){u.render(u.html`
<${c.ReportView.Report.litTagName} .data=${{reportTitle:H(L.bounceTrackingMitigationsTitle)}}
jslog=${m.pane("bounce-tracking-mitigations")}>
${await this.#n()}
</${c.ReportView.Report.litTagName}>
`,this.#e,{host:this})}async#n(){if(this.#T||await this.#x(),"Disabled"===this.#t){const e=new o.ChromeLink.ChromeLink;return e.href="chrome://flags/#bounce-tracking-mitigations",e.textContent=H(L.featureFlag),u.html`
<${c.ReportView.ReportSection.litTagName}>
${t.i18n.getFormatLocalizedString(A,L.featureDisabled,{PH1:e})}
</${c.ReportView.ReportSection.litTagName}>
`}return u.html`
<${c.ReportView.ReportSection.litTagName}>
${this.#N()}
</${c.ReportView.ReportSection.litTagName}>
${this.#C()}
<${c.ReportView.ReportSectionDivider.litTagName}>
</${c.ReportView.ReportSectionDivider.litTagName}>
<${c.ReportView.ReportSection.litTagName}>
<x-link href="https://privacycg.github.io/nav-tracking-mitigations/#bounce-tracking-mitigations" class="link"
jslog=${m.link("learn-more").track({click:!0})}>
${H(L.learnMore)}
</x-link>
</${c.ReportView.ReportSection.litTagName}>
`}#N(){const e="Running"===this.#t;return u.html`
<${r.Button.Button.litTagName}
aria-label=${H(L.forceRun)}
.disabled=${e}
.spinner=${e}
.variant=${"primary"}
@click=${this.#I}
jslog=${m.action("force-run").track({click:!0})}>
${e?u.html`
${H(L.runningMitigations)}`:`\n ${H(L.forceRun)}\n `}
</${r.Button.Button.litTagName}>
`}#C(){if(!this.#R)return u.html``;if(0===this.#S.length)return u.html`
<${c.ReportView.ReportSection.litTagName}>
${"Running"===this.#t?u.html`
${H(L.checkingPotentialTrackers)}`:`\n ${H(L.noPotentialBounceTrackersIdentified)}\n `}
</${c.ReportView.ReportSection.litTagName}>
`;const e={columns:[{id:"sites",title:H(L.stateDeletedFor),widthWeighting:10,hideable:!1,visible:!0,sortable:!0}],rows:this.#P(),initialSort:{columnId:"sites",direction:"ASC"}};return u.html`
<${c.ReportView.ReportSection.litTagName}>
<${g.DataGridController.DataGridController.litTagName} .data=${e}>
</${g.DataGridController.DataGridController.litTagName}>
</${c.ReportView.ReportSection.litTagName}>
`}async#I(){const e=a.TargetManager.TargetManager.instance().primaryPageTarget();if(!e)return;this.#R=!0,this.#t="Running",this.#$();const t=await e.storageAgent().invoke_runBounceTrackingMitigations();this.#S=[],t.deletedSites.forEach((e=>{this.#S.push(e)})),this.#D()}#D(){this.#t="Result",this.#$()}#P(){return this.#S.map((e=>({cells:[{columnId:"sites",value:e}]})))}async#x(){this.#T=!0;const e=a.TargetManager.TargetManager.instance().primaryPageTarget();e&&((await e.systemInfo().invoke_getFeatureState({featureState:"DIPS"})).featureEnabled||(this.#t="Disabled"))}}customElements.define("devtools-bounce-tracking-mitigations-view",O);var W=Object.freeze({__proto__:null,i18nString:H,BounceTrackingMitigationsView:O});const U=new CSSStyleSheet;U.replaceSync(":host{overflow:auto;height:100%}.reporting-container{height:100%;display:flex;flex-direction:column}.reporting-header{font-size:15px;background-color:var(--sys-color-surface2);padding:1px 4px}.reporting-placeholder{flex-grow:1;display:flex;align-items:center;justify-content:center;font-size:13px;color:var(--sys-color-token-subtle);min-width:min-content;text-align:center}devtools-data-grid-controller{border:1px solid var(--sys-color-divider)}.inline-icon{vertical-align:text-bottom}\n/*# sourceURL=reportingApiGrid.css */\n");const q={noEndpointsToDisplay:"No endpoints to display"},j=t.i18n.registerUIStrings("panels/application/components/EndpointsGrid.ts",q),z=t.i18n.getLocalizedString.bind(void 0,j),{render:_,html:G}=u;class K extends HTMLElement{static litTagName=u.literal`devtools-resources-endpoints-grid`;#e=this.attachShadow({mode:"open"});#B=new Map;connectedCallback(){this.#e.adoptedStyleSheets=[U],this.#$()}set data(e){this.#B=e.endpoints,this.#$()}#$(){const e={columns:[{id:"origin",title:t.i18n.lockedString("Origin"),widthWeighting:30,hideable:!1,visible:!0},{id:"name",title:t.i18n.lockedString("Name"),widthWeighting:20,hideable:!1,visible:!0},{id:"url",title:t.i18n.lockedString("URL"),widthWeighting:30,hideable:!1,visible:!0}],rows:this.#M()};_(G`
<div class="reporting-container" jslog=${m.section("endpoints")}>
<div class="reporting-header">${t.i18n.lockedString("Endpoints")}</div>
${this.#B.size>0?G`
<${g.DataGridController.DataGridController.litTagName} .data=${e}>
</${g.DataGridController.DataGridController.litTagName}>
`:G`
<div class="reporting-placeholder">
<div>${z(q.noEndpointsToDisplay)}</div>
</div>
`}
</div>
`,this.#e,{host:this})}#M(){return Array.from(this.#B).map((([e,t])=>t.map((t=>({cells:[{columnId:"origin",value:e},{columnId:"name",value:t.groupName},{columnId:"url",value:t.url}]}))))).flat()}}customElements.define("devtools-resources-endpoints-grid",K);var J=Object.freeze({__proto__:null,i18nString:z,EndpointsGrid:K});const X=new CSSStyleSheet;X.replaceSync('.text-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}button ~ .text-ellipsis{padding-left:2px}.link,\n.devtools-link{color:var(--sys-color-primary);text-decoration:underline;cursor:pointer;outline-offset:2px;padding:0}button.link{border:none;background:none;font-family:inherit;font-size:inherit;height:16px}button.link:has(devtools-icon){margin-top:5px}devtools-button.help-button{top:4px;position:relative}button.text-link{padding-left:2px;height:26px}.inline-button{padding-left:1ex}.inline-comment{padding-left:1ex;white-space:pre-line}.inline-comment::before{content:"("}.inline-comment::after{content:")"}.inline-name{color:var(--sys-color-token-subtle);padding-right:4px;user-select:none;white-space:pre-line}.inline-items{display:flex}.span-cols{grid-column-start:span 2;margin:0 0 8px 30px;line-height:28px}.without-min-width{min-width:auto}.bold{font-weight:bold}.link:not(button):has(devtools-icon){vertical-align:baseline;margin-inline-start:3px}.inline-icon{margin-bottom:-5px;width:18px;height:18px;vertical-align:baseline}@media (forced-colors: active){.link,\n .devtools-link{color:linktext;text-decoration-color:linktext}}\n/*# sourceURL=frameDetailsReportView.css */\n');const Y=new CSSStyleSheet;Y.replaceSync(":host .badge-error{--override-adorner-text-color:var(--sys-color-error-bright);--override-adorner-border-color:var(--sys-color-error-bright)}:host .badge-success{--override-adorner-text-color:var(--sys-color-tertiary);--override-adorner-border-color:var(--sys-color-tertiary)}:host .badge-secondary{--override-adorner-text-color:var(--sys-color-token-subtle);--override-adorner-border-color:var(--sys-color-token-subtle)}:host{font-family:var(--source-code-font-family)}\n/*# sourceURL=badge.css */\n");const Q=new CSSStyleSheet;Q.replaceSync(".content{display:grid;grid-template-columns:min-content 1fr}.key{color:var(--sys-color-token-subtle);padding:0 6px;text-align:right;white-space:pre}.value{color:var(--sys-color-token-subtle);margin-inline-start:0;padding:0 6px}.error-text{color:var(--sys-color-error-bright);font-weight:bold}\n/*# sourceURL=originTrialTokenRows.css */\n");const Z=new CSSStyleSheet;Z.replaceSync(".status-badge{border-radius:4px;padding:4px;background:var(--sys-color-neutral-container);& > devtools-icon{vertical-align:sub}}\n/*# sourceURL=originTrialTreeView.css */\n");const ee={origin:"Origin",trialName:"Trial Name",expiryTime:"Expiry Time",usageRestriction:"Usage Restriction",isThirdParty:"Third Party",matchSubDomains:"Subdomain Matching",rawTokenText:"Raw Token",status:"Token Status",token:"Token",tokens:"{PH1} tokens",noTrialTokens:"No trial tokens"},te=t.i18n.registerUIStrings("panels/application/components/OriginTrialTreeView.ts",ee),ae=t.i18n.getLocalizedString.bind(void 0,te);class re extends HTMLElement{static litTagName=u.literal`devtools-resources-origin-trial-tree-view-badge`;#e=this.attachShadow({mode:"open"});#V=new y.Adorner.Adorner;set data(e){this.#$(e)}connectedCallback(){this.#e.adoptedStyleSheets=[Y]}#$(e){const t=document.createElement("span");t.textContent=e.badgeContent,this.#V.data={name:"badge",content:t},this.#V.classList.add(`badge-${e.style}`),u.render(u.html`
${this.#V}
`,this.#e,{host:this})}}function oe(e){return{treeNodeData:e,id:"OriginTrialTreeNode#"+e.trialName,children:async()=>e.tokensWithStatus.length>1?e.tokensWithStatus.map(ie):se(e.tokensWithStatus[0]),renderer:e=>{const t=e.treeNodeData,a=u.html`
<${re.litTagName} .data=${{badgeContent:ae(ee.tokens,{PH1:t.tokensWithStatus.length}),style:"secondary"}}></${re.litTagName}>
`;return u.html`
${t.trialName}
<${re.litTagName} .data=${{badgeContent:t.status,style:"Enabled"===t.status?"success":"error"}}></${re.litTagName}>
${t.tokensWithStatus.length>1?a:u.nothing}
`}}}function ie(e){return{treeNodeData:e.status,id:"TokenNode#"+e.rawTokenText,children:async()=>se(e),renderer:(e,t)=>{const a=e.treeNodeData,r=u.html`
<${re.litTagName} .data=${{badgeContent:a,style:"Success"===a?"success":"error"}}></${re.litTagName}>
`;return u.html`${ae(ee.token)} ${t.isExpanded?u.nothing:r}`}}}function ne(e){return u.html`
<${ce.litTagName} .data=${{node:e}}>
</${ce.litTagName}>
`}function se(e){return[{treeNodeData:e,id:"TokenDetailsNode#"+e.rawTokenText,renderer:ne},(t=e.rawTokenText,{treeNodeData:ae(ee.rawTokenText),id:"TokenRawTextContainerNode#"+t,children:async()=>[{treeNodeData:t,id:"TokenRawTextNode#"+t,renderer:e=>{const t=e.treeNodeData;return u.html`
<div style="overflow-wrap: break-word;">
${t}
</div>
`}}]})];var t}function le(e){return u.html`${String(e.treeNodeData)}`}customElements.define("devtools-resources-origin-trial-tree-view-badge",re);class ce extends HTMLElement{static litTagName=u.literal`devtools-resources-origin-trial-token-rows`;#e=this.attachShadow({mode:"open"});#F=null;#E=[];#L=new Intl.DateTimeFormat(t.DevToolsLocale.DevToolsLocale.instance().locale,{dateStyle:"long",timeStyle:"long"});set data(e){this.#F=e.node.treeNodeData,this.#A()}connectedCallback(){this.#e.adoptedStyleSheets=[Q],this.#$()}#H=(e,t)=>u.html`
<div class=${u.Directives.ifDefined(t?"error-text":void 0)}>
${e}
</div>`;#A(){this.#F?.parsedToken&&(this.#E=[{name:ae(ee.origin),value:this.#H(this.#F.parsedToken.origin,"WrongOrigin"===this.#F.status)},{name:ae(ee.expiryTime),value:this.#H(this.#L.format(1e3*this.#F.parsedToken.expiryTime),"Expired"===this.#F.status)},{name:ae(ee.usageRestriction),value:this.#H(this.#F.parsedToken.usageRestriction)},{name:ae(ee.isThirdParty),value:this.#H(this.#F.parsedToken.isThirdParty.toString())},{name:ae(ee.matchSubDomains),value:this.#H(this.#F.parsedToken.matchSubDomains.toString())}],"UnknownTrial"===this.#F.status&&(this.#E=[{name:ae(ee.trialName),value:this.#H(this.#F.parsedToken.trialName)},...this.#E]))}#$(){if(!this.#F)return;const e=[{name:ae(ee.status),value:u.html`
<${re.litTagName} .data=${{badgeContent:this.#F.status,style:"Success"===this.#F.status?"success":"error"}}></${re.litTagName}>`},...this.#E].map((e=>u.html`
<div class="key">${e.name}</div>
<div class="value">${e.value}</div>
`));u.render(u.html`
<div class="content">
${e}
</div>
`,this.#e,{host:this})}}customElements.define("devtools-resources-origin-trial-token-rows",ce);class de extends HTMLElement{static litTagName=u.literal`devtools-resources-origin-trial-tree-view`;#e=this.attachShadow({mode:"open"});set data(e){this.#$(e.trials)}connectedCallback(){this.#e.adoptedStyleSheets=[Z]}#$(e){e.length?u.render(u.html`
<${d.TreeOutline.TreeOutline.litTagName} .data=${{tree:e.map(oe),defaultRenderer:le}}>
</${d.TreeOutline.TreeOutline.litTagName}>
`,this.#e,{host:this}):u.render(u.html`
<span class="status-badge">
<${n.Icon.Icon.litTagName}
.data=${{iconName:"clear",color:"var(--icon-default)",width:"16px",height:"16px"}}
>
</${n.Icon.Icon.litTagName}>
<span>${ae(ee.noTrialTokens)}</span>
</span>`,this.#e,{host:this})}}customElements.define("devtools-resources-origin-trial-tree-view",de);var he=Object.freeze({__proto__:null,Badge:re,OriginTrialTokenRows:ce,OriginTrialTreeView:de});const ue=new CSSStyleSheet;ue.replaceSync(":host{display:contents}.text-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.link,\n.devtools-link{color:var(--sys-color-primary);text-decoration:underline;cursor:pointer;outline-offset:2px}button.link{border:none;background:none;font-family:inherit;