diff --git a/public/core/i18n/locales/en-US.json b/public/core/i18n/locales/en-US.json index fa622901b..dff7254d4 100644 --- a/public/core/i18n/locales/en-US.json +++ b/public/core/i18n/locales/en-US.json @@ -1 +1 @@ -{"core/common/ResourceType.ts | cspviolationreport":{"message":"CSPViolationReport"},"core/common/ResourceType.ts | css":{"message":"CSS"},"core/common/ResourceType.ts | doc":{"message":"Doc"},"core/common/ResourceType.ts | document":{"message":"Document"},"core/common/ResourceType.ts | eventsource":{"message":"EventSource"},"core/common/ResourceType.ts | fetch":{"message":"Fetch"},"core/common/ResourceType.ts | fetchAndXHR":{"message":"Fetch and XHR"},"core/common/ResourceType.ts | font":{"message":"Font"},"core/common/ResourceType.ts | image":{"message":"Image"},"core/common/ResourceType.ts | img":{"message":"Img"},"core/common/ResourceType.ts | javascript":{"message":"JavaScript"},"core/common/ResourceType.ts | js":{"message":"JS"},"core/common/ResourceType.ts | manifest":{"message":"Manifest"},"core/common/ResourceType.ts | media":{"message":"Media"},"core/common/ResourceType.ts | other":{"message":"Other"},"core/common/ResourceType.ts | ping":{"message":"Ping"},"core/common/ResourceType.ts | preflight":{"message":"Preflight"},"core/common/ResourceType.ts | script":{"message":"Script"},"core/common/ResourceType.ts | signedexchange":{"message":"SignedExchange"},"core/common/ResourceType.ts | stylesheet":{"message":"Stylesheet"},"core/common/ResourceType.ts | texttrack":{"message":"TextTrack"},"core/common/ResourceType.ts | wasm":{"message":"Wasm"},"core/common/ResourceType.ts | webassembly":{"message":"WebAssembly"},"core/common/ResourceType.ts | webbundle":{"message":"WebBundle"},"core/common/ResourceType.ts | websocket":{"message":"WebSocket"},"core/common/ResourceType.ts | webtransport":{"message":"WebTransport"},"core/common/ResourceType.ts | ws":{"message":"WS"},"core/common/Revealer.ts | applicationPanel":{"message":"Application panel"},"core/common/Revealer.ts | changesDrawer":{"message":"Changes drawer"},"core/common/Revealer.ts | developerResourcesPanel":{"message":"Developer Resources panel"},"core/common/Revealer.ts | elementsPanel":{"message":"Elements panel"},"core/common/Revealer.ts | issuesView":{"message":"Issues view"},"core/common/Revealer.ts | memoryInspectorPanel":{"message":"Memory inspector panel"},"core/common/Revealer.ts | networkPanel":{"message":"Network panel"},"core/common/Revealer.ts | sourcesPanel":{"message":"Sources panel"},"core/common/Revealer.ts | stylesSidebar":{"message":"styles sidebar"},"core/common/SettingRegistration.ts | adorner":{"message":"Adorner"},"core/common/SettingRegistration.ts | appearance":{"message":"Appearance"},"core/common/SettingRegistration.ts | console":{"message":"Console"},"core/common/SettingRegistration.ts | debugger":{"message":"Debugger"},"core/common/SettingRegistration.ts | elements":{"message":"Elements"},"core/common/SettingRegistration.ts | extension":{"message":"Extension"},"core/common/SettingRegistration.ts | global":{"message":"Global"},"core/common/SettingRegistration.ts | grid":{"message":"Grid"},"core/common/SettingRegistration.ts | memory":{"message":"Memory"},"core/common/SettingRegistration.ts | mobile":{"message":"Mobile"},"core/common/SettingRegistration.ts | network":{"message":"Network"},"core/common/SettingRegistration.ts | performance":{"message":"Performance"},"core/common/SettingRegistration.ts | persistence":{"message":"Persistence"},"core/common/SettingRegistration.ts | rendering":{"message":"Rendering"},"core/common/SettingRegistration.ts | sources":{"message":"Sources"},"core/common/SettingRegistration.ts | sync":{"message":"Sync"},"core/host/InspectorFrontendHost.ts | devtoolsS":{"message":"DevTools - {PH1}"},"core/host/ResourceLoader.ts | cacheError":{"message":"Cache error"},"core/host/ResourceLoader.ts | certificateError":{"message":"Certificate error"},"core/host/ResourceLoader.ts | certificateManagerError":{"message":"Certificate manager error"},"core/host/ResourceLoader.ts | connectionError":{"message":"Connection error"},"core/host/ResourceLoader.ts | decodingDataUrlFailed":{"message":"Decoding Data URL failed"},"core/host/ResourceLoader.ts | dnsResolverError":{"message":"DNS resolver error"},"core/host/ResourceLoader.ts | ftpError":{"message":"FTP error"},"core/host/ResourceLoader.ts | httpError":{"message":"HTTP error"},"core/host/ResourceLoader.ts | httpErrorStatusCodeSS":{"message":"HTTP error: status code {PH1}, {PH2}"},"core/host/ResourceLoader.ts | invalidUrl":{"message":"Invalid URL"},"core/host/ResourceLoader.ts | signedExchangeError":{"message":"Signed Exchange error"},"core/host/ResourceLoader.ts | systemError":{"message":"System error"},"core/host/ResourceLoader.ts | unknownError":{"message":"Unknown error"},"core/i18n/time-utilities.ts | fdays":{"message":"{PH1} days"},"core/i18n/time-utilities.ts | fhrs":{"message":"{PH1} hrs"},"core/i18n/time-utilities.ts | fmin":{"message":"{PH1} min"},"core/i18n/time-utilities.ts | fmms":{"message":"{PH1} μs"},"core/i18n/time-utilities.ts | fms":{"message":"{PH1} ms"},"core/i18n/time-utilities.ts | fs":{"message":"{PH1} s"},"core/sdk/ChildTargetManager.ts | main":{"message":"Main"},"core/sdk/CompilerSourceMappingContentProvider.ts | couldNotLoadContentForSS":{"message":"Could not load content for {PH1} ({PH2})"},"core/sdk/ConsoleModel.ts | bfcacheNavigation":{"message":"Navigation to {PH1} was restored from back/forward cache (see https://web.dev/bfcache/)"},"core/sdk/ConsoleModel.ts | failedToSaveToTempVariable":{"message":"Failed to save to temp variable."},"core/sdk/ConsoleModel.ts | navigatedToS":{"message":"Navigated to {PH1}"},"core/sdk/ConsoleModel.ts | profileSFinished":{"message":"Profile ''{PH1}'' finished."},"core/sdk/ConsoleModel.ts | profileSStarted":{"message":"Profile ''{PH1}'' started."},"core/sdk/CPUProfilerModel.ts | profileD":{"message":"Profile {PH1}"},"core/sdk/CSSStyleSheetHeader.ts | couldNotFindTheOriginalStyle":{"message":"Could not find the original style sheet."},"core/sdk/CSSStyleSheetHeader.ts | thereWasAnErrorRetrievingThe":{"message":"There was an error retrieving the source styles."},"core/sdk/DebuggerModel.ts | block":{"message":"Block"},"core/sdk/DebuggerModel.ts | catchBlock":{"message":"Catch block"},"core/sdk/DebuggerModel.ts | closure":{"message":"Closure"},"core/sdk/DebuggerModel.ts | expression":{"message":"Expression"},"core/sdk/DebuggerModel.ts | global":{"message":"Global"},"core/sdk/DebuggerModel.ts | local":{"message":"Local"},"core/sdk/DebuggerModel.ts | module":{"message":"Module"},"core/sdk/DebuggerModel.ts | script":{"message":"Script"},"core/sdk/DebuggerModel.ts | withBlock":{"message":"With block"},"core/sdk/NetworkManager.ts | fastG":{"message":"Fast 3G"},"core/sdk/NetworkManager.ts | noContentForPreflight":{"message":"No content available for preflight request"},"core/sdk/NetworkManager.ts | noContentForRedirect":{"message":"No content available because this request was redirected"},"core/sdk/NetworkManager.ts | noContentForWebSocket":{"message":"Content for WebSockets is currently not supported"},"core/sdk/NetworkManager.ts | noThrottling":{"message":"No throttling"},"core/sdk/NetworkManager.ts | offline":{"message":"Offline"},"core/sdk/NetworkManager.ts | requestWasBlockedByDevtoolsS":{"message":"Request was blocked by DevTools: \"{PH1}\""},"core/sdk/NetworkManager.ts | sFailedLoadingSS":{"message":"{PH1} failed loading: {PH2} \"{PH3}\"."},"core/sdk/NetworkManager.ts | sFinishedLoadingSS":{"message":"{PH1} finished loading: {PH2} \"{PH3}\"."},"core/sdk/NetworkManager.ts | slowG":{"message":"Slow 3G"},"core/sdk/NetworkRequest.ts | anUnknownErrorWasEncounteredWhenTrying":{"message":"An unknown error was encountered when trying to store this cookie."},"core/sdk/NetworkRequest.ts | binary":{"message":"(binary)"},"core/sdk/NetworkRequest.ts | blockedReasonInvalidDomain":{"message":"This attempt to set a cookie via a Set-Cookie header was blocked because its Domain attribute was invalid with regards to the current host url."},"core/sdk/NetworkRequest.ts | blockedReasonInvalidPrefix":{"message":"This attempt to set a cookie via a Set-Cookie header was blocked because it used the \"__Secure-\" or \"__Host-\" prefix in its name and broke the additional rules applied to cookies with these prefixes as defined in https://tools.ietf.org/html/draft-west-cookie-prefixes-05."},"core/sdk/NetworkRequest.ts | blockedReasonOverwriteSecure":{"message":"This attempt to set a cookie via a Set-Cookie header was blocked because it was not sent over a secure connection and would have overwritten a cookie with the Secure attribute."},"core/sdk/NetworkRequest.ts | blockedReasonSameSiteNoneInsecure":{"message":"This attempt to set a cookie via a Set-Cookie header was blocked because it had the \"SameSite=None\" attribute but did not have the \"Secure\" attribute, which is required in order to use \"SameSite=None\"."},"core/sdk/NetworkRequest.ts | blockedReasonSameSiteStrictLax":{"message":"This attempt to set a cookie via a Set-Cookie header was blocked because it had the \"{PH1}\" attribute but came from a cross-site response which was not the response to a top-level navigation."},"core/sdk/NetworkRequest.ts | blockedReasonSameSiteUnspecifiedTreatedAsLax":{"message":"This Set-Cookie header didn't specify a \"SameSite\" attribute and was defaulted to \"SameSite=Lax,\" and was blocked because it came from a cross-site response which was not the response to a top-level navigation. The Set-Cookie had to have been set with \"SameSite=None\" to enable cross-site usage."},"core/sdk/NetworkRequest.ts | blockedReasonSecureOnly":{"message":"This attempt to set a cookie via a Set-Cookie header was blocked because it had the \"Secure\" attribute but was not received over a secure connection."},"core/sdk/NetworkRequest.ts | domainMismatch":{"message":"This cookie was blocked because neither did the request URL's domain exactly match the cookie's domain, nor was the request URL's domain a subdomain of the cookie's Domain attribute value."},"core/sdk/NetworkRequest.ts | exemptionReasonCorsOptIn":{"message":"This cookie is allowed by CORS opt-in. Learn more: goo.gle/cors"},"core/sdk/NetworkRequest.ts | exemptionReasonEnterprisePolicy":{"message":"This cookie is allowed by Chrome Enterprise policy. Learn more: goo.gle/ce-3pc"},"core/sdk/NetworkRequest.ts | exemptionReasonStorageAccessAPI":{"message":"This cookie is allowed by the Storage Access API. Learn more: goo.gle/saa"},"core/sdk/NetworkRequest.ts | exemptionReasonTopLevelStorageAccessAPI":{"message":"This cookie is allowed by the top-level Storage Access API. Learn more: goo.gle/saa-top"},"core/sdk/NetworkRequest.ts | exemptionReasonTPCDDeprecationTrial":{"message":"This cookie is allowed by third-party cookie phaseout deprecation trial."},"core/sdk/NetworkRequest.ts | exemptionReasonTPCDHeuristics":{"message":"This cookie is allowed by third-party cookie phaseout heuristics. Learn more: goo.gle/hbe"},"core/sdk/NetworkRequest.ts | exemptionReasonTPCDMetadata":{"message":"This cookie is allowed by a third-party cookie deprecation trial grace period. Learn more: goo.gle/ps-dt."},"core/sdk/NetworkRequest.ts | exemptionReasonUserSetting":{"message":"This cookie is allowed by user preference."},"core/sdk/NetworkRequest.ts | nameValuePairExceedsMaxSize":{"message":"This cookie was blocked because it was too large. The combined size of the name and value must be less than or equal to 4096 characters."},"core/sdk/NetworkRequest.ts | notOnPath":{"message":"This cookie was blocked because its path was not an exact match for or a superdirectory of the request url's path."},"core/sdk/NetworkRequest.ts | samePartyFromCrossPartyContext":{"message":"This cookie was blocked because it had the \"SameParty\" attribute but the request was cross-party. The request was considered cross-party because the domain of the resource's URL and the domains of the resource's enclosing frames/documents are neither owners nor members in the same First-Party Set."},"core/sdk/NetworkRequest.ts | sameSiteLax":{"message":"This cookie was blocked because it had the \"SameSite=Lax\" attribute and the request was made from a different site and was not initiated by a top-level navigation."},"core/sdk/NetworkRequest.ts | sameSiteNoneInsecure":{"message":"This cookie was blocked because it had the \"SameSite=None\" attribute but was not marked \"Secure\". Cookies without SameSite restrictions must be marked \"Secure\" and sent over a secure connection."},"core/sdk/NetworkRequest.ts | sameSiteStrict":{"message":"This cookie was blocked because it had the \"SameSite=Strict\" attribute and the request was made from a different site. This includes top-level navigation requests initiated by other sites."},"core/sdk/NetworkRequest.ts | sameSiteUnspecifiedTreatedAsLax":{"message":"This cookie didn't specify a \"SameSite\" attribute when it was stored and was defaulted to \"SameSite=Lax,\" and was blocked because the request was made from a different site and was not initiated by a top-level navigation. The cookie had to have been set with \"SameSite=None\" to enable cross-site usage."},"core/sdk/NetworkRequest.ts | schemefulSameSiteLax":{"message":"This cookie was blocked because it had the \"SameSite=Lax\" attribute but the request was cross-site and was not initiated by a top-level navigation. This request is considered cross-site because the URL has a different scheme than the current site."},"core/sdk/NetworkRequest.ts | schemefulSameSiteStrict":{"message":"This cookie was blocked because it had the \"SameSite=Strict\" attribute but the request was cross-site. This includes top-level navigation requests initiated by other sites. This request is considered cross-site because the URL has a different scheme than the current site."},"core/sdk/NetworkRequest.ts | schemefulSameSiteUnspecifiedTreatedAsLax":{"message":"This cookie didn't specify a \"SameSite\" attribute when it was stored, was defaulted to \"SameSite=Lax\", and was blocked because the request was cross-site and was not initiated by a top-level navigation. This request is considered cross-site because the URL has a different scheme than the current site."},"core/sdk/NetworkRequest.ts | secureOnly":{"message":"This cookie was blocked because it had the \"Secure\" attribute and the connection was not secure."},"core/sdk/NetworkRequest.ts | setcookieHeaderIsIgnoredIn":{"message":"Set-Cookie header is ignored in response from url: {PH1}. The combined size of the name and value must be less than or equal to 4096 characters."},"core/sdk/NetworkRequest.ts | theSchemeOfThisConnectionIsNot":{"message":"The scheme of this connection is not allowed to store cookies."},"core/sdk/NetworkRequest.ts | thirdPartyPhaseout":{"message":"This cookie was blocked due to third-party cookie phaseout. Learn more in the Issues tab."},"core/sdk/NetworkRequest.ts | thisSetcookieDidntSpecifyASamesite":{"message":"This Set-Cookie header didn't specify a \"SameSite\" attribute, was defaulted to \"SameSite=Lax\", and was blocked because it came from a cross-site response which was not the response to a top-level navigation. This response is considered cross-site because the URL has a different scheme than the current site."},"core/sdk/NetworkRequest.ts | thisSetcookieHadADisallowedCharacter":{"message":"This Set-Cookie header contained a disallowed character (a forbidden ASCII control character, or the tab character if it appears in the middle of the cookie name, value, an attribute name, or an attribute value)."},"core/sdk/NetworkRequest.ts | thisSetcookieHadInvalidSyntax":{"message":"This Set-Cookie header had invalid syntax."},"core/sdk/NetworkRequest.ts | thisSetcookieWasBlockedBecauseItHadTheSameparty":{"message":"This attempt to set a cookie via a Set-Cookie header was blocked because it had the \"SameParty\" attribute but the request was cross-party. The request was considered cross-party because the domain of the resource's URL and the domains of the resource's enclosing frames/documents are neither owners nor members in the same First-Party Set."},"core/sdk/NetworkRequest.ts | thisSetcookieWasBlockedBecauseItHadTheSamepartyAttribute":{"message":"This attempt to set a cookie via a Set-Cookie header was blocked because it had the \"SameParty\" attribute but also had other conflicting attributes. Chrome requires cookies that use the \"SameParty\" attribute to also have the \"Secure\" attribute, and to not be restricted to \"SameSite=Strict\"."},"core/sdk/NetworkRequest.ts | thisSetcookieWasBlockedBecauseItHadTheSamesiteStrictLax":{"message":"This attempt to set a cookie via a Set-Cookie header was blocked because it had the \"{PH1}\" attribute but came from a cross-site response which was not the response to a top-level navigation. This response is considered cross-site because the URL has a different scheme than the current site."},"core/sdk/NetworkRequest.ts | thisSetcookieWasBlockedBecauseTheNameValuePairExceedsMaxSize":{"message":"This attempt to set a cookie via a Set-Cookie header was blocked because the cookie was too large. The combined size of the name and value must be less than or equal to 4096 characters."},"core/sdk/NetworkRequest.ts | thisSetcookieWasBlockedDueThirdPartyPhaseout":{"message":"Setting this cookie was blocked due to third-party cookie phaseout. Learn more in the Issues tab."},"core/sdk/NetworkRequest.ts | thisSetcookieWasBlockedDueToUser":{"message":"This attempt to set a cookie via a Set-Cookie header was blocked due to user preferences."},"core/sdk/NetworkRequest.ts | unknownError":{"message":"An unknown error was encountered when trying to send this cookie."},"core/sdk/NetworkRequest.ts | userPreferences":{"message":"This cookie was blocked due to user preferences."},"core/sdk/OverlayModel.ts | pausedInDebugger":{"message":"Paused in debugger"},"core/sdk/PageResourceLoader.ts | loadCanceledDueToReloadOf":{"message":"Load canceled due to reload of inspected page"},"core/sdk/Script.ts | scriptRemovedOrDeleted":{"message":"Script removed or deleted."},"core/sdk/Script.ts | unableToFetchScriptSource":{"message":"Unable to fetch script source."},"core/sdk/sdk-meta.ts | achromatopsia":{"message":"Achromatopsia (no color)"},"core/sdk/sdk-meta.ts | blurredVision":{"message":"Blurred vision"},"core/sdk/sdk-meta.ts | captureAsyncStackTraces":{"message":"Capture async stack traces"},"core/sdk/sdk-meta.ts | customFormatters":{"message":"Custom formatters"},"core/sdk/sdk-meta.ts | deuteranopia":{"message":"Deuteranopia (no green)"},"core/sdk/sdk-meta.ts | disableAsyncStackTraces":{"message":"Disable async stack traces"},"core/sdk/sdk-meta.ts | disableAvifFormat":{"message":"Disable AVIF format"},"core/sdk/sdk-meta.ts | disableCache":{"message":"Disable cache (while DevTools is open)"},"core/sdk/sdk-meta.ts | disableJavascript":{"message":"Disable JavaScript"},"core/sdk/sdk-meta.ts | disableLocalFonts":{"message":"Disable local fonts"},"core/sdk/sdk-meta.ts | disableNetworkRequestBlocking":{"message":"Disable network request blocking"},"core/sdk/sdk-meta.ts | disableWebpFormat":{"message":"Disable WebP format"},"core/sdk/sdk-meta.ts | doNotCaptureAsyncStackTraces":{"message":"Do not capture async stack traces"},"core/sdk/sdk-meta.ts | doNotEmulateAFocusedPage":{"message":"Do not emulate a focused page"},"core/sdk/sdk-meta.ts | doNotEmulateAnyVisionDeficiency":{"message":"Do not emulate any vision deficiency"},"core/sdk/sdk-meta.ts | doNotEmulateCss":{"message":"Do not emulate CSS {PH1}"},"core/sdk/sdk-meta.ts | doNotEmulateCssMediaType":{"message":"Do not emulate CSS media type"},"core/sdk/sdk-meta.ts | doNotExtendGridLines":{"message":"Do not extend grid lines"},"core/sdk/sdk-meta.ts | doNotHighlightAdFrames":{"message":"Do not highlight ad frames"},"core/sdk/sdk-meta.ts | doNotPauseOnExceptions":{"message":"Do not pause on exceptions"},"core/sdk/sdk-meta.ts | doNotPreserveLogUponNavigation":{"message":"Do not preserve log upon navigation"},"core/sdk/sdk-meta.ts | doNotShowGridNamedAreas":{"message":"Do not show grid named areas"},"core/sdk/sdk-meta.ts | doNotShowGridTrackSizes":{"message":"Do not show grid track sizes"},"core/sdk/sdk-meta.ts | doNotShowRulersOnHover":{"message":"Do not show rulers on hover"},"core/sdk/sdk-meta.ts | emulateAchromatopsia":{"message":"Emulate achromatopsia (no color)"},"core/sdk/sdk-meta.ts | emulateAFocusedPage":{"message":"Emulate a focused page"},"core/sdk/sdk-meta.ts | emulateAutoDarkMode":{"message":"Emulate auto dark mode"},"core/sdk/sdk-meta.ts | emulateBlurredVision":{"message":"Emulate blurred vision"},"core/sdk/sdk-meta.ts | emulateCss":{"message":"Emulate CSS {PH1}"},"core/sdk/sdk-meta.ts | emulateCssMediaFeature":{"message":"Emulate CSS media feature {PH1}"},"core/sdk/sdk-meta.ts | emulateCssMediaType":{"message":"Emulate CSS media type"},"core/sdk/sdk-meta.ts | emulateCssPrintMediaType":{"message":"Emulate CSS print media type"},"core/sdk/sdk-meta.ts | emulateCssScreenMediaType":{"message":"Emulate CSS screen media type"},"core/sdk/sdk-meta.ts | emulateDeuteranopia":{"message":"Emulate deuteranopia (no green)"},"core/sdk/sdk-meta.ts | emulateProtanopia":{"message":"Emulate protanopia (no red)"},"core/sdk/sdk-meta.ts | emulateReducedContrast":{"message":"Emulate reduced contrast"},"core/sdk/sdk-meta.ts | emulateTritanopia":{"message":"Emulate tritanopia (no blue)"},"core/sdk/sdk-meta.ts | emulateVisionDeficiencies":{"message":"Emulate vision deficiencies"},"core/sdk/sdk-meta.ts | enableAvifFormat":{"message":"Enable AVIF format"},"core/sdk/sdk-meta.ts | enableCache":{"message":"Enable cache"},"core/sdk/sdk-meta.ts | enableJavascript":{"message":"Enable JavaScript"},"core/sdk/sdk-meta.ts | enableLocalFonts":{"message":"Enable local fonts"},"core/sdk/sdk-meta.ts | enableNetworkRequestBlocking":{"message":"Enable network request blocking"},"core/sdk/sdk-meta.ts | enableRemoteFileLoading":{"message":"Allow DevTools to load resources, such as source maps, from remote file paths. Disabled by default for security reasons."},"core/sdk/sdk-meta.ts | enableWebpFormat":{"message":"Enable WebP format"},"core/sdk/sdk-meta.ts | extendGridLines":{"message":"Extend grid lines"},"core/sdk/sdk-meta.ts | hideCoreWebVitalsOverlay":{"message":"Hide Core Web Vitals overlay"},"core/sdk/sdk-meta.ts | hideFramesPerSecondFpsMeter":{"message":"Hide frames per second (FPS) meter"},"core/sdk/sdk-meta.ts | hideLayerBorders":{"message":"Hide layer borders"},"core/sdk/sdk-meta.ts | hideLayoutShiftRegions":{"message":"Hide layout shift regions"},"core/sdk/sdk-meta.ts | hideLineLabels":{"message":"Hide line labels"},"core/sdk/sdk-meta.ts | hidePaintFlashingRectangles":{"message":"Hide paint flashing rectangles"},"core/sdk/sdk-meta.ts | hideScrollPerformanceBottlenecks":{"message":"Hide scroll performance bottlenecks"},"core/sdk/sdk-meta.ts | highlightAdFrames":{"message":"Highlight ad frames"},"core/sdk/sdk-meta.ts | networkRequestBlocking":{"message":"Network request blocking"},"core/sdk/sdk-meta.ts | noEmulation":{"message":"No emulation"},"core/sdk/sdk-meta.ts | pauseOnExceptions":{"message":"Pause on exceptions"},"core/sdk/sdk-meta.ts | preserveLogUponNavigation":{"message":"Preserve log upon navigation"},"core/sdk/sdk-meta.ts | print":{"message":"print"},"core/sdk/sdk-meta.ts | protanopia":{"message":"Protanopia (no red)"},"core/sdk/sdk-meta.ts | query":{"message":"query"},"core/sdk/sdk-meta.ts | reducedContrast":{"message":"Reduced contrast"},"core/sdk/sdk-meta.ts | screen":{"message":"screen"},"core/sdk/sdk-meta.ts | showAreaNames":{"message":"Show area names"},"core/sdk/sdk-meta.ts | showCoreWebVitalsOverlay":{"message":"Show Core Web Vitals overlay"},"core/sdk/sdk-meta.ts | showFramesPerSecondFpsMeter":{"message":"Show frames per second (FPS) meter"},"core/sdk/sdk-meta.ts | showGridNamedAreas":{"message":"Show grid named areas"},"core/sdk/sdk-meta.ts | showGridTrackSizes":{"message":"Show grid track sizes"},"core/sdk/sdk-meta.ts | showLayerBorders":{"message":"Show layer borders"},"core/sdk/sdk-meta.ts | showLayoutShiftRegions":{"message":"Show layout shift regions"},"core/sdk/sdk-meta.ts | showLineLabels":{"message":"Show line labels"},"core/sdk/sdk-meta.ts | showLineNames":{"message":"Show line names"},"core/sdk/sdk-meta.ts | showLineNumbers":{"message":"Show line numbers"},"core/sdk/sdk-meta.ts | showPaintFlashingRectangles":{"message":"Show paint flashing rectangles"},"core/sdk/sdk-meta.ts | showRulersOnHover":{"message":"Show rulers on hover"},"core/sdk/sdk-meta.ts | showScrollPerformanceBottlenecks":{"message":"Show scroll performance bottlenecks"},"core/sdk/sdk-meta.ts | showTrackSizes":{"message":"Show track sizes"},"core/sdk/sdk-meta.ts | tritanopia":{"message":"Tritanopia (no blue)"},"core/sdk/ServerTiming.ts | deprecatedSyntaxFoundPleaseUse":{"message":"Deprecated syntax found. Please use: ;dur=;desc="},"core/sdk/ServerTiming.ts | duplicateParameterSIgnored":{"message":"Duplicate parameter \"{PH1}\" ignored."},"core/sdk/ServerTiming.ts | extraneousTrailingCharacters":{"message":"Extraneous trailing characters."},"core/sdk/ServerTiming.ts | noValueFoundForParameterS":{"message":"No value found for parameter \"{PH1}\"."},"core/sdk/ServerTiming.ts | unableToParseSValueS":{"message":"Unable to parse \"{PH1}\" value \"{PH2}\"."},"core/sdk/ServerTiming.ts | unrecognizedParameterS":{"message":"Unrecognized parameter \"{PH1}\"."},"core/sdk/ServiceWorkerCacheModel.ts | serviceworkercacheagentError":{"message":"ServiceWorkerCacheAgent error deleting cache entry {PH1} in cache: {PH2}"},"core/sdk/ServiceWorkerManager.ts | activated":{"message":"activated"},"core/sdk/ServiceWorkerManager.ts | activating":{"message":"activating"},"core/sdk/ServiceWorkerManager.ts | installed":{"message":"installed"},"core/sdk/ServiceWorkerManager.ts | installing":{"message":"installing"},"core/sdk/ServiceWorkerManager.ts | new":{"message":"new"},"core/sdk/ServiceWorkerManager.ts | redundant":{"message":"redundant"},"core/sdk/ServiceWorkerManager.ts | running":{"message":"running"},"core/sdk/ServiceWorkerManager.ts | sSS":{"message":"{PH1} #{PH2} ({PH3})"},"core/sdk/ServiceWorkerManager.ts | starting":{"message":"starting"},"core/sdk/ServiceWorkerManager.ts | stopped":{"message":"stopped"},"core/sdk/ServiceWorkerManager.ts | stopping":{"message":"stopping"},"entrypoints/inspector_main/inspector_main-meta.ts | autoOpenDevTools":{"message":"Auto-open DevTools for popups"},"entrypoints/inspector_main/inspector_main-meta.ts | blockAds":{"message":"Block ads on this site"},"entrypoints/inspector_main/inspector_main-meta.ts | colorVisionDeficiency":{"message":"color vision deficiency"},"entrypoints/inspector_main/inspector_main-meta.ts | cssMediaFeature":{"message":"CSS media feature"},"entrypoints/inspector_main/inspector_main-meta.ts | cssMediaType":{"message":"CSS media type"},"entrypoints/inspector_main/inspector_main-meta.ts | disablePaused":{"message":"Disable paused state overlay"},"entrypoints/inspector_main/inspector_main-meta.ts | doNotAutoOpen":{"message":"Do not auto-open DevTools for popups"},"entrypoints/inspector_main/inspector_main-meta.ts | forceAdBlocking":{"message":"Force ad blocking on this site"},"entrypoints/inspector_main/inspector_main-meta.ts | fps":{"message":"fps"},"entrypoints/inspector_main/inspector_main-meta.ts | hardReloadPage":{"message":"Hard reload page"},"entrypoints/inspector_main/inspector_main-meta.ts | layout":{"message":"layout"},"entrypoints/inspector_main/inspector_main-meta.ts | paint":{"message":"paint"},"entrypoints/inspector_main/inspector_main-meta.ts | reloadPage":{"message":"Reload page"},"entrypoints/inspector_main/inspector_main-meta.ts | rendering":{"message":"Rendering"},"entrypoints/inspector_main/inspector_main-meta.ts | showAds":{"message":"Show ads on this site, if allowed"},"entrypoints/inspector_main/inspector_main-meta.ts | showRendering":{"message":"Show Rendering"},"entrypoints/inspector_main/inspector_main-meta.ts | toggleCssPrefersColorSchemeMedia":{"message":"Toggle CSS media feature prefers-color-scheme"},"entrypoints/inspector_main/inspector_main-meta.ts | visionDeficiency":{"message":"vision deficiency"},"entrypoints/inspector_main/InspectorMain.ts | javascriptIsDisabled":{"message":"JavaScript is disabled"},"entrypoints/inspector_main/InspectorMain.ts | main":{"message":"Main"},"entrypoints/inspector_main/InspectorMain.ts | openDedicatedTools":{"message":"Open dedicated DevTools for Node.js"},"entrypoints/inspector_main/InspectorMain.ts | tab":{"message":"Tab"},"entrypoints/inspector_main/OutermostTargetSelector.ts | targetNotSelected":{"message":"Page: Not selected"},"entrypoints/inspector_main/OutermostTargetSelector.ts | targetS":{"message":"Page: {PH1}"},"entrypoints/inspector_main/RenderingOptions.ts | coreWebVitals":{"message":"Core Web Vitals"},"entrypoints/inspector_main/RenderingOptions.ts | disableAvifImageFormat":{"message":"Disable AVIF image format"},"entrypoints/inspector_main/RenderingOptions.ts | disableLocalFonts":{"message":"Disable local fonts"},"entrypoints/inspector_main/RenderingOptions.ts | disablesLocalSourcesInFontface":{"message":"Disables local() sources in @font-face rules. Requires a page reload to apply."},"entrypoints/inspector_main/RenderingOptions.ts | disableWebpImageFormat":{"message":"Disable WebP image format"},"entrypoints/inspector_main/RenderingOptions.ts | emulateAFocusedPage":{"message":"Emulate a focused page"},"entrypoints/inspector_main/RenderingOptions.ts | emulateAutoDarkMode":{"message":"Enable automatic dark mode"},"entrypoints/inspector_main/RenderingOptions.ts | emulatesAFocusedPage":{"message":"Keep page focused. Commonly used for debugging disappearing elements."},"entrypoints/inspector_main/RenderingOptions.ts | emulatesAutoDarkMode":{"message":"Enables automatic dark mode and sets prefers-color-scheme to dark."},"entrypoints/inspector_main/RenderingOptions.ts | forcesCssColorgamutMediaFeature":{"message":"Forces CSS color-gamut media feature"},"entrypoints/inspector_main/RenderingOptions.ts | forcesCssForcedColors":{"message":"Forces CSS forced-colors media feature"},"entrypoints/inspector_main/RenderingOptions.ts | forcesCssPreferscolorschemeMedia":{"message":"Forces CSS prefers-color-scheme media feature"},"entrypoints/inspector_main/RenderingOptions.ts | forcesCssPreferscontrastMedia":{"message":"Forces CSS prefers-contrast media feature"},"entrypoints/inspector_main/RenderingOptions.ts | forcesCssPrefersreduceddataMedia":{"message":"Forces CSS prefers-reduced-data media feature"},"entrypoints/inspector_main/RenderingOptions.ts | forcesCssPrefersreducedmotion":{"message":"Forces CSS prefers-reduced-motion media feature"},"entrypoints/inspector_main/RenderingOptions.ts | forcesCssPrefersreducedtransparencyMedia":{"message":"Forces CSS prefers-reduced-transparency media feature"},"entrypoints/inspector_main/RenderingOptions.ts | forcesMediaTypeForTestingPrint":{"message":"Forces media type for testing print and screen styles"},"entrypoints/inspector_main/RenderingOptions.ts | forcesVisionDeficiencyEmulation":{"message":"Forces vision deficiency emulation"},"entrypoints/inspector_main/RenderingOptions.ts | frameRenderingStats":{"message":"Frame Rendering Stats"},"entrypoints/inspector_main/RenderingOptions.ts | highlightAdFrames":{"message":"Highlight ad frames"},"entrypoints/inspector_main/RenderingOptions.ts | highlightsAreasOfThePageBlueThat":{"message":"Highlights areas of the page (blue) that were shifted. May not be suitable for people prone to photosensitive epilepsy."},"entrypoints/inspector_main/RenderingOptions.ts | highlightsAreasOfThePageGreen":{"message":"Highlights areas of the page (green) that need to be repainted. May not be suitable for people prone to photosensitive epilepsy."},"entrypoints/inspector_main/RenderingOptions.ts | highlightsElementsTealThatCan":{"message":"Highlights elements (teal) that can slow down scrolling, including touch & wheel event handlers and other main-thread scrolling situations."},"entrypoints/inspector_main/RenderingOptions.ts | highlightsFramesRedDetectedToBe":{"message":"Highlights frames (red) detected to be ads."},"entrypoints/inspector_main/RenderingOptions.ts | layerBorders":{"message":"Layer borders"},"entrypoints/inspector_main/RenderingOptions.ts | layoutShiftRegions":{"message":"Layout Shift Regions"},"entrypoints/inspector_main/RenderingOptions.ts | paintFlashing":{"message":"Paint flashing"},"entrypoints/inspector_main/RenderingOptions.ts | plotsFrameThroughputDropped":{"message":"Plots frame throughput, dropped frames distribution, and GPU memory."},"entrypoints/inspector_main/RenderingOptions.ts | requiresAPageReloadToApplyAnd":{"message":"Requires a page reload to apply and disables caching for image requests."},"entrypoints/inspector_main/RenderingOptions.ts | scrollingPerformanceIssues":{"message":"Scrolling performance issues"},"entrypoints/inspector_main/RenderingOptions.ts | showsAnOverlayWithCoreWebVitals":{"message":"Shows an overlay with Core Web Vitals."},"entrypoints/inspector_main/RenderingOptions.ts | showsLayerBordersOrangeoliveAnd":{"message":"Shows layer borders (orange/olive) and tiles (cyan)."},"entrypoints/js_app/js_app.ts | main":{"message":"Main"},"entrypoints/js_app/js_app.ts | networkTitle":{"message":"Scripts"},"entrypoints/js_app/js_app.ts | showNode":{"message":"Show Scripts"},"entrypoints/main/main-meta.ts | auto":{"message":"auto"},"entrypoints/main/main-meta.ts | bottom":{"message":"Bottom"},"entrypoints/main/main-meta.ts | browserLanguage":{"message":"Browser UI language"},"entrypoints/main/main-meta.ts | cancelSearch":{"message":"Cancel search"},"entrypoints/main/main-meta.ts | darkCapital":{"message":"Dark"},"entrypoints/main/main-meta.ts | darkLower":{"message":"dark"},"entrypoints/main/main-meta.ts | devtoolsDefault":{"message":"DevTools (Default)"},"entrypoints/main/main-meta.ts | dockToBottom":{"message":"Dock to bottom"},"entrypoints/main/main-meta.ts | dockToLeft":{"message":"Dock to left"},"entrypoints/main/main-meta.ts | dockToRight":{"message":"Dock to right"},"entrypoints/main/main-meta.ts | enableCtrlShortcutToSwitchPanels":{"message":"Enable Ctrl + 1-9 shortcut to switch panels"},"entrypoints/main/main-meta.ts | enableShortcutToSwitchPanels":{"message":"Enable ⌘ + 1-9 shortcut to switch panels"},"entrypoints/main/main-meta.ts | enableSync":{"message":"Enable settings sync"},"entrypoints/main/main-meta.ts | findNextResult":{"message":"Find next result"},"entrypoints/main/main-meta.ts | findPreviousResult":{"message":"Find previous result"},"entrypoints/main/main-meta.ts | focusDebuggee":{"message":"Focus page"},"entrypoints/main/main-meta.ts | horizontal":{"message":"horizontal"},"entrypoints/main/main-meta.ts | language":{"message":"Language:"},"entrypoints/main/main-meta.ts | left":{"message":"Left"},"entrypoints/main/main-meta.ts | lightCapital":{"message":"Light"},"entrypoints/main/main-meta.ts | lightLower":{"message":"light"},"entrypoints/main/main-meta.ts | nextPanel":{"message":"Next panel"},"entrypoints/main/main-meta.ts | panelLayout":{"message":"Panel layout:"},"entrypoints/main/main-meta.ts | previousPanel":{"message":"Previous panel"},"entrypoints/main/main-meta.ts | reloadDevtools":{"message":"Reload DevTools"},"entrypoints/main/main-meta.ts | resetZoomLevel":{"message":"Reset zoom level"},"entrypoints/main/main-meta.ts | restoreLastDockPosition":{"message":"Restore last dock position"},"entrypoints/main/main-meta.ts | right":{"message":"Right"},"entrypoints/main/main-meta.ts | searchAsYouTypeCommand":{"message":"Enable search as you type"},"entrypoints/main/main-meta.ts | searchAsYouTypeSetting":{"message":"Search as you type"},"entrypoints/main/main-meta.ts | searchInPanel":{"message":"Search in panel"},"entrypoints/main/main-meta.ts | searchOnEnterCommand":{"message":"Disable search as you type (press Enter to search)"},"entrypoints/main/main-meta.ts | switchToDarkTheme":{"message":"Switch to dark theme"},"entrypoints/main/main-meta.ts | switchToLightTheme":{"message":"Switch to light theme"},"entrypoints/main/main-meta.ts | switchToSystemPreferredColor":{"message":"Switch to system preferred color theme"},"entrypoints/main/main-meta.ts | systemPreference":{"message":"System preference"},"entrypoints/main/main-meta.ts | theme":{"message":"Theme:"},"entrypoints/main/main-meta.ts | toggleDrawer":{"message":"Toggle drawer"},"entrypoints/main/main-meta.ts | undocked":{"message":"Undocked"},"entrypoints/main/main-meta.ts | undockIntoSeparateWindow":{"message":"Undock into separate window"},"entrypoints/main/main-meta.ts | useAutomaticPanelLayout":{"message":"Use automatic panel layout"},"entrypoints/main/main-meta.ts | useHorizontalPanelLayout":{"message":"Use horizontal panel layout"},"entrypoints/main/main-meta.ts | useVerticalPanelLayout":{"message":"Use vertical panel layout"},"entrypoints/main/main-meta.ts | vertical":{"message":"vertical"},"entrypoints/main/main-meta.ts | zoomIn":{"message":"Zoom in"},"entrypoints/main/main-meta.ts | zoomOut":{"message":"Zoom out"},"entrypoints/main/MainImpl.ts | customizeAndControlDevtools":{"message":"Customize and control DevTools"},"entrypoints/main/MainImpl.ts | dockSide":{"message":"Dock side"},"entrypoints/main/MainImpl.ts | dockSideNaviation":{"message":"Use left and right arrow keys to navigate the options"},"entrypoints/main/MainImpl.ts | dockToBottom":{"message":"Dock to bottom"},"entrypoints/main/MainImpl.ts | dockToLeft":{"message":"Dock to left"},"entrypoints/main/MainImpl.ts | dockToRight":{"message":"Dock to right"},"entrypoints/main/MainImpl.ts | focusDebuggee":{"message":"Focus page"},"entrypoints/main/MainImpl.ts | help":{"message":"Help"},"entrypoints/main/MainImpl.ts | hideConsoleDrawer":{"message":"Hide console drawer"},"entrypoints/main/MainImpl.ts | moreTools":{"message":"More tools"},"entrypoints/main/MainImpl.ts | placementOfDevtoolsRelativeToThe":{"message":"Placement of DevTools relative to the page. ({PH1} to restore last position)"},"entrypoints/main/MainImpl.ts | showConsoleDrawer":{"message":"Show console drawer"},"entrypoints/main/MainImpl.ts | undockIntoSeparateWindow":{"message":"Undock into separate window"},"entrypoints/node_app/node_app.ts | connection":{"message":"Connection"},"entrypoints/node_app/node_app.ts | networkTitle":{"message":"Node"},"entrypoints/node_app/node_app.ts | node":{"message":"node"},"entrypoints/node_app/node_app.ts | showConnection":{"message":"Show Connection"},"entrypoints/node_app/node_app.ts | showNode":{"message":"Show Node"},"entrypoints/node_app/NodeConnectionsPanel.ts | addConnection":{"message":"Add connection"},"entrypoints/node_app/NodeConnectionsPanel.ts | networkAddressEgLocalhost":{"message":"Network address (e.g. localhost:9229)"},"entrypoints/node_app/NodeConnectionsPanel.ts | noConnectionsSpecified":{"message":"No connections specified"},"entrypoints/node_app/NodeConnectionsPanel.ts | nodejsDebuggingGuide":{"message":"Node.js debugging guide"},"entrypoints/node_app/NodeConnectionsPanel.ts | specifyNetworkEndpointAnd":{"message":"Specify network endpoint and DevTools will connect to it automatically. Read {PH1} to learn more."},"entrypoints/node_app/NodeMain.ts | main":{"message":"Main"},"entrypoints/node_app/NodeMain.ts | nodejsS":{"message":"Node.js: {PH1}"},"entrypoints/worker_app/WorkerMain.ts | main":{"message":"Main"},"generated/Deprecation.ts | AuthorizationCoveredByWildcard":{"message":"Authorization will not be covered by the wildcard symbol (*) in CORS Access-Control-Allow-Headers handling."},"generated/Deprecation.ts | CanRequestURLHTTPContainingNewline":{"message":"Resource requests whose URLs contained both removed whitespace \\(n|r|t) characters and less-than characters (<) are blocked. Please remove newlines and encode less-than characters from places like element attribute values in order to load these resources."},"generated/Deprecation.ts | ChromeLoadTimesConnectionInfo":{"message":"chrome.loadTimes() is deprecated, instead use standardized API: Navigation Timing 2."},"generated/Deprecation.ts | ChromeLoadTimesFirstPaintAfterLoadTime":{"message":"chrome.loadTimes() is deprecated, instead use standardized API: Paint Timing."},"generated/Deprecation.ts | ChromeLoadTimesWasAlternateProtocolAvailable":{"message":"chrome.loadTimes() is deprecated, instead use standardized API: nextHopProtocol in Navigation Timing 2."},"generated/Deprecation.ts | CookieWithTruncatingChar":{"message":"Cookies containing a \\(0|r|n) character will be rejected instead of truncated."},"generated/Deprecation.ts | CrossOriginAccessBasedOnDocumentDomain":{"message":"Relaxing the same-origin policy by setting document.domain is deprecated, and will be disabled by default. This deprecation warning is for a cross-origin access that was enabled by setting document.domain."},"generated/Deprecation.ts | CrossOriginWindowAlert":{"message":"Triggering window.alert from cross origin iframes has been deprecated and will be removed in the future."},"generated/Deprecation.ts | CrossOriginWindowConfirm":{"message":"Triggering window.confirm from cross origin iframes has been deprecated and will be removed in the future."},"generated/Deprecation.ts | CSSCustomStateDeprecatedSyntax":{"message":":--customstatename is deprecated. Please use the :state(customstatename) syntax instead."},"generated/Deprecation.ts | CSSSelectorInternalMediaControlsOverlayCastButton":{"message":"The disableRemotePlayback attribute should be used in order to disable the default Cast integration instead of using -internal-media-controls-overlay-cast-button selector."},"generated/Deprecation.ts | CSSValueAppearanceNonStandard":{"message":"CSS appearance values inner-spin-button, media-slider, media-sliderthumb, media-volume-slider, media-volume-sliderthumb, push-button, searchfield-cancel-button, slider-horizontal, sliderthumb-horizontal, sliderthumb-vertical, square-button are not standardized and will be removed."},"generated/Deprecation.ts | CSSValueAppearanceSliderVertical":{"message":"CSS appearance value slider-vertical is not standardized and will be removed."},"generated/Deprecation.ts | DataUrlInSvgUse":{"message":"Support for data: URLs in SVGUseElement is deprecated and it will be removed in the future."},"generated/Deprecation.ts | DocumentDomainSettingWithoutOriginAgentClusterHeader":{"message":"Relaxing the same-origin policy by setting document.domain is deprecated, and will be disabled by default. To continue using this feature, please opt-out of origin-keyed agent clusters by sending an Origin-Agent-Cluster: ?0 header along with the HTTP response for the document and frames. See https://developer.chrome.com/blog/immutable-document-domain/ for more details."},"generated/Deprecation.ts | DOMMutationEvents":{"message":"DOM Mutation Events, including DOMSubtreeModified, DOMNodeInserted, DOMNodeRemoved, DOMNodeRemovedFromDocument, DOMNodeInsertedIntoDocument, and DOMCharacterDataModified are deprecated (https://w3c.github.io/uievents/#legacy-event-types) and will be removed. Please use MutationObserver instead."},"generated/Deprecation.ts | GeolocationInsecureOrigin":{"message":"getCurrentPosition() and watchPosition() no longer work on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gle/chrome-insecure-origins for more details."},"generated/Deprecation.ts | GeolocationInsecureOriginDeprecatedNotRemoved":{"message":"getCurrentPosition() and watchPosition() are deprecated on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gle/chrome-insecure-origins for more details."},"generated/Deprecation.ts | GetUserMediaInsecureOrigin":{"message":"getUserMedia() no longer works on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gle/chrome-insecure-origins for more details."},"generated/Deprecation.ts | HostCandidateAttributeGetter":{"message":"RTCPeerConnectionIceErrorEvent.hostCandidate is deprecated. Please use RTCPeerConnectionIceErrorEvent.address or RTCPeerConnectionIceErrorEvent.port instead."},"generated/Deprecation.ts | IdentityInCanMakePaymentEvent":{"message":"The merchant origin and arbitrary data from the canmakepayment service worker event are deprecated and will be removed: topOrigin, paymentRequestOrigin, methodData, modifiers."},"generated/Deprecation.ts | InsecurePrivateNetworkSubresourceRequest":{"message":"The website requested a subresource from a network that it could only access because of its users' privileged network position. These requests expose non-public devices and servers to the internet, increasing the risk of a cross-site request forgery (CSRF) attack, and/or information leakage. To mitigate these risks, Chrome deprecates requests to non-public subresources when initiated from non-secure contexts, and will start blocking them."},"generated/Deprecation.ts | InterestGroupDailyUpdateUrl":{"message":"The dailyUpdateUrl field of InterestGroups passed to joinAdInterestGroup() has been renamed to updateUrl, to more accurately reflect its behavior."},"generated/Deprecation.ts | LocalCSSFileExtensionRejected":{"message":"CSS cannot be loaded from file: URLs unless they end in a .css file extension."},"generated/Deprecation.ts | MediaSourceAbortRemove":{"message":"Using SourceBuffer.abort() to abort remove()'s asynchronous range removal is deprecated due to specification change. Support will be removed in the future. You should listen to the updateend event instead. abort() is intended to only abort an asynchronous media append or reset parser state."},"generated/Deprecation.ts | MediaSourceDurationTruncatingBuffered":{"message":"Setting MediaSource.duration below the highest presentation timestamp of any buffered coded frames is deprecated due to specification change. Support for implicit removal of truncated buffered media will be removed in the future. You should instead perform explicit remove(newDuration, oldDuration) on all sourceBuffers, where newDuration < oldDuration."},"generated/Deprecation.ts | NoSysexWebMIDIWithoutPermission":{"message":"Web MIDI will ask a permission to use even if the sysex is not specified in the MIDIOptions."},"generated/Deprecation.ts | NotificationInsecureOrigin":{"message":"The Notification API may no longer be used from insecure origins. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gle/chrome-insecure-origins for more details."},"generated/Deprecation.ts | NotificationPermissionRequestedIframe":{"message":"Permission for the Notification API may no longer be requested from a cross-origin iframe. You should consider requesting permission from a top-level frame or opening a new window instead."},"generated/Deprecation.ts | ObsoleteCreateImageBitmapImageOrientationNone":{"message":"Option imageOrientation: 'none' in createImageBitmap is deprecated. Please use createImageBitmap with option {imageOrientation: 'from-image'} instead."},"generated/Deprecation.ts | ObsoleteWebRtcCipherSuite":{"message":"Your partner is negotiating an obsolete (D)TLS version. Please check with your partner to have this fixed."},"generated/Deprecation.ts | OverflowVisibleOnReplacedElement":{"message":"Specifying overflow: visible on img, video and canvas tags may cause them to produce visual content outside of the element bounds. See https://github.com/WICG/shared-element-transitions/blob/main/debugging_overflow_on_images.md."},"generated/Deprecation.ts | PaymentInstruments":{"message":"paymentManager.instruments is deprecated. Please use just-in-time install for payment handlers instead."},"generated/Deprecation.ts | PaymentRequestCSPViolation":{"message":"Your PaymentRequest call bypassed Content-Security-Policy (CSP) connect-src directive. This bypass is deprecated. Please add the payment method identifier from the PaymentRequest API (in supportedMethods field) to your CSP connect-src directive."},"generated/Deprecation.ts | PersistentQuotaType":{"message":"StorageType.persistent is deprecated. Please use standardized navigator.storage instead."},"generated/Deprecation.ts | PictureSourceSrc":{"message":" with a parent is invalid and therefore ignored. Please use instead."},"generated/Deprecation.ts | PrefixedCancelAnimationFrame":{"message":"webkitCancelAnimationFrame is vendor-specific. Please use the standard cancelAnimationFrame instead."},"generated/Deprecation.ts | PrefixedRequestAnimationFrame":{"message":"webkitRequestAnimationFrame is vendor-specific. Please use the standard requestAnimationFrame instead."},"generated/Deprecation.ts | PrefixedVideoDisplayingFullscreen":{"message":"HTMLVideoElement.webkitDisplayingFullscreen is deprecated. Please use Document.fullscreenElement instead."},"generated/Deprecation.ts | PrefixedVideoEnterFullscreen":{"message":"HTMLVideoElement.webkitEnterFullscreen() is deprecated. Please use Element.requestFullscreen() instead."},"generated/Deprecation.ts | PrefixedVideoEnterFullScreen":{"message":"HTMLVideoElement.webkitEnterFullScreen() is deprecated. Please use Element.requestFullscreen() instead."},"generated/Deprecation.ts | PrefixedVideoExitFullscreen":{"message":"HTMLVideoElement.webkitExitFullscreen() is deprecated. Please use Document.exitFullscreen() instead."},"generated/Deprecation.ts | PrefixedVideoExitFullScreen":{"message":"HTMLVideoElement.webkitExitFullScreen() is deprecated. Please use Document.exitFullscreen() instead."},"generated/Deprecation.ts | PrefixedVideoSupportsFullscreen":{"message":"HTMLVideoElement.webkitSupportsFullscreen is deprecated. Please use Document.fullscreenEnabled instead."},"generated/Deprecation.ts | PrivacySandboxExtensionsAPI":{"message":"We're deprecating the API chrome.privacy.websites.privacySandboxEnabled, though it will remain active for backward compatibility until release M113. Instead, please use chrome.privacy.websites.topicsEnabled, chrome.privacy.websites.fledgeEnabled and chrome.privacy.websites.adMeasurementEnabled. See https://developer.chrome.com/docs/extensions/reference/privacy/#property-websites-privacySandboxEnabled."},"generated/Deprecation.ts | RangeExpand":{"message":"Range.expand() is deprecated. Please use Selection.modify() instead."},"generated/Deprecation.ts | RequestedSubresourceWithEmbeddedCredentials":{"message":"Subresource requests whose URLs contain embedded credentials (e.g. https://user:pass@host/) are blocked."},"generated/Deprecation.ts | RTCConstraintEnableDtlsSrtpFalse":{"message":"The constraint DtlsSrtpKeyAgreement is removed. You have specified a false value for this constraint, which is interpreted as an attempt to use the removed SDES key negotiation method. This functionality is removed; use a service that supports DTLS key negotiation instead."},"generated/Deprecation.ts | RTCConstraintEnableDtlsSrtpTrue":{"message":"The constraint DtlsSrtpKeyAgreement is removed. You have specified a true value for this constraint, which had no effect, but you can remove this constraint for tidiness."},"generated/Deprecation.ts | RTCPeerConnectionGetStatsLegacyNonCompliant":{"message":"The callback-based getStats() is deprecated and will be removed. Use the spec-compliant getStats() instead."},"generated/Deprecation.ts | RtcpMuxPolicyNegotiate":{"message":"The rtcpMuxPolicy option is deprecated and will be removed."},"generated/Deprecation.ts | SharedArrayBufferConstructedWithoutIsolation":{"message":"SharedArrayBuffer will require cross-origin isolation. See https://developer.chrome.com/blog/enabling-shared-array-buffer/ for more details."},"generated/Deprecation.ts | TextToSpeech_DisallowedByAutoplay":{"message":"speechSynthesis.speak() without user activation is deprecated and will be removed."},"generated/Deprecation.ts | UnloadHandler":{"message":"Unload event listeners are deprecated and will be removed."},"generated/Deprecation.ts | V8SharedArrayBufferConstructedInExtensionWithoutIsolation":{"message":"Extensions should opt into cross-origin isolation to continue using SharedArrayBuffer. See https://developer.chrome.com/docs/extensions/mv3/cross-origin-isolation/."},"generated/Deprecation.ts | WebSQL":{"message":"Web SQL is deprecated. Please use SQLite WebAssembly or Indexed Database"},"generated/Deprecation.ts | WindowPlacementPermissionDescriptorUsed":{"message":"The permission descriptor window-placement is deprecated. Use window-management instead. For more help, check https://bit.ly/window-placement-rename."},"generated/Deprecation.ts | WindowPlacementPermissionPolicyParsed":{"message":"The permission policy window-placement is deprecated. Use window-management instead. For more help, check https://bit.ly/window-placement-rename."},"generated/Deprecation.ts | XHRJSONEncodingDetection":{"message":"UTF-16 is not supported by response json in XMLHttpRequest"},"generated/Deprecation.ts | XMLHttpRequestSynchronousInNonWorkerOutsideBeforeUnload":{"message":"Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/."},"generated/Deprecation.ts | XRSupportsSession":{"message":"supportsSession() is deprecated. Please use isSessionSupported() and check the resolved boolean value instead."},"models/bindings/ContentProviderBasedProject.ts | unknownErrorLoadingFile":{"message":"Unknown error loading file"},"models/bindings/DebuggerLanguagePlugins.ts | debugSymbolsIncomplete":{"message":"The debug information for function {PH1} is incomplete"},"models/bindings/DebuggerLanguagePlugins.ts | errorInDebuggerLanguagePlugin":{"message":"Error in debugger language plugin: {PH1}"},"models/bindings/DebuggerLanguagePlugins.ts | failedToLoadDebugSymbolsFor":{"message":"[{PH1}] Failed to load debug symbols for {PH2} ({PH3})"},"models/bindings/DebuggerLanguagePlugins.ts | failedToLoadDebugSymbolsForFunction":{"message":"No debug information for function \"{PH1}\""},"models/bindings/DebuggerLanguagePlugins.ts | loadedDebugSymbolsForButDidnt":{"message":"[{PH1}] Loaded debug symbols for {PH2}, but didn't find any source files"},"models/bindings/DebuggerLanguagePlugins.ts | loadedDebugSymbolsForFound":{"message":"[{PH1}] Loaded debug symbols for {PH2}, found {PH3} source file(s)"},"models/bindings/DebuggerLanguagePlugins.ts | loadingDebugSymbolsFor":{"message":"[{PH1}] Loading debug symbols for {PH2}..."},"models/bindings/DebuggerLanguagePlugins.ts | loadingDebugSymbolsForVia":{"message":"[{PH1}] Loading debug symbols for {PH2} (via {PH3})..."},"models/bindings/IgnoreListManager.ts | addAllContentScriptsToIgnoreList":{"message":"Add all extension scripts to ignore list"},"models/bindings/IgnoreListManager.ts | addAllThirdPartyScriptsToIgnoreList":{"message":"Add all third-party scripts to ignore list"},"models/bindings/IgnoreListManager.ts | addDirectoryToIgnoreList":{"message":"Add directory to ignore list"},"models/bindings/IgnoreListManager.ts | addScriptToIgnoreList":{"message":"Add script to ignore list"},"models/bindings/IgnoreListManager.ts | removeFromIgnoreList":{"message":"Remove from ignore list"},"models/bindings/ResourceScriptMapping.ts | liveEditCompileFailed":{"message":"LiveEdit compile failed: {PH1}"},"models/bindings/ResourceScriptMapping.ts | liveEditFailed":{"message":"LiveEdit failed: {PH1}"},"models/emulation/DeviceModeModel.ts | devicePixelRatioMustBeANumberOr":{"message":"Device pixel ratio must be a number or blank."},"models/emulation/DeviceModeModel.ts | devicePixelRatioMustBeGreater":{"message":"Device pixel ratio must be greater than or equal to {PH1}."},"models/emulation/DeviceModeModel.ts | devicePixelRatioMustBeLessThanOr":{"message":"Device pixel ratio must be less than or equal to {PH1}."},"models/emulation/DeviceModeModel.ts | heightCannotBeEmpty":{"message":"Height cannot be empty."},"models/emulation/DeviceModeModel.ts | heightMustBeANumber":{"message":"Height must be a number."},"models/emulation/DeviceModeModel.ts | heightMustBeGreaterThanOrEqualTo":{"message":"Height must be greater than or equal to {PH1}."},"models/emulation/DeviceModeModel.ts | heightMustBeLessThanOrEqualToS":{"message":"Height must be less than or equal to {PH1}."},"models/emulation/DeviceModeModel.ts | widthCannotBeEmpty":{"message":"Width cannot be empty."},"models/emulation/DeviceModeModel.ts | widthMustBeANumber":{"message":"Width must be a number."},"models/emulation/DeviceModeModel.ts | widthMustBeGreaterThanOrEqualToS":{"message":"Width must be greater than or equal to {PH1}."},"models/emulation/DeviceModeModel.ts | widthMustBeLessThanOrEqualToS":{"message":"Width must be less than or equal to {PH1}."},"models/emulation/EmulatedDevices.ts | laptopWithHiDPIScreen":{"message":"Laptop with HiDPI screen"},"models/emulation/EmulatedDevices.ts | laptopWithMDPIScreen":{"message":"Laptop with MDPI screen"},"models/emulation/EmulatedDevices.ts | laptopWithTouch":{"message":"Laptop with touch"},"models/har/Writer.ts | collectingContent":{"message":"Collecting content…"},"models/har/Writer.ts | writingFile":{"message":"Writing file…"},"models/issues_manager/BounceTrackingIssue.ts | bounceTrackingMitigations":{"message":"Bounce tracking mitigations"},"models/issues_manager/ClientHintIssue.ts | clientHintsInfrastructure":{"message":"Client Hints Infrastructure"},"models/issues_manager/ContentSecurityPolicyIssue.ts | contentSecurityPolicyEval":{"message":"Content Security Policy - Eval"},"models/issues_manager/ContentSecurityPolicyIssue.ts | contentSecurityPolicyInlineCode":{"message":"Content Security Policy - Inline Code"},"models/issues_manager/ContentSecurityPolicyIssue.ts | contentSecurityPolicySource":{"message":"Content Security Policy - Source Allowlists"},"models/issues_manager/ContentSecurityPolicyIssue.ts | trustedTypesFixViolations":{"message":"Trusted Types - Fix violations"},"models/issues_manager/ContentSecurityPolicyIssue.ts | trustedTypesPolicyViolation":{"message":"Trusted Types - Policy violation"},"models/issues_manager/CookieDeprecationMetadataIssue.ts | thirdPartyPhaseoutExplained":{"message":"Prepare for phasing out third-party cookies"},"models/issues_manager/CookieIssue.ts | anInsecure":{"message":"an insecure"},"models/issues_manager/CookieIssue.ts | aSecure":{"message":"a secure"},"models/issues_manager/CookieIssue.ts | fileCrosSiteRedirectBug":{"message":"File a bug"},"models/issues_manager/CookieIssue.ts | firstPartySetsExplained":{"message":"First-Party Sets and the SameParty attribute"},"models/issues_manager/CookieIssue.ts | howSchemefulSamesiteWorks":{"message":"How Schemeful Same-Site Works"},"models/issues_manager/CookieIssue.ts | samesiteCookiesExplained":{"message":"SameSite cookies explained"},"models/issues_manager/CookieIssue.ts | thirdPartyPhaseoutExplained":{"message":"Prepare for phasing out third-party cookies"},"models/issues_manager/CorsIssue.ts | CORS":{"message":"Cross-Origin Resource Sharing (CORS)"},"models/issues_manager/CorsIssue.ts | corsPrivateNetworkAccess":{"message":"Private Network Access"},"models/issues_manager/CrossOriginEmbedderPolicyIssue.ts | coopAndCoep":{"message":"COOP and COEP"},"models/issues_manager/CrossOriginEmbedderPolicyIssue.ts | samesiteAndSameorigin":{"message":"Same-Site and Same-Origin"},"models/issues_manager/DeprecationIssue.ts | feature":{"message":"Check the feature status page for more details."},"models/issues_manager/DeprecationIssue.ts | milestone":{"message":"This change will go into effect with milestone {milestone}."},"models/issues_manager/DeprecationIssue.ts | title":{"message":"Deprecated feature used"},"models/issues_manager/FederatedAuthRequestIssue.ts | fedCm":{"message":"Federated Credential Management API"},"models/issues_manager/FederatedAuthUserInfoRequestIssue.ts | fedCmUserInfo":{"message":"Federated Credential Management User Info API"},"models/issues_manager/GenericIssue.ts | autocompleteAttributePageTitle":{"message":"HTML attribute: autocomplete"},"models/issues_manager/GenericIssue.ts | corbExplainerPageTitle":{"message":"CORB explainer"},"models/issues_manager/GenericIssue.ts | crossOriginPortalPostMessage":{"message":"Portals - Same-origin communication channels"},"models/issues_manager/GenericIssue.ts | howDoesAutofillWorkPageTitle":{"message":"How does autofill work?"},"models/issues_manager/GenericIssue.ts | inputFormElementPageTitle":{"message":"The form input element"},"models/issues_manager/GenericIssue.ts | labelFormlementsPageTitle":{"message":"The label elements"},"models/issues_manager/HeavyAdIssue.ts | handlingHeavyAdInterventions":{"message":"Handling Heavy Ad Interventions"},"models/issues_manager/Issue.ts | breakingChangeIssue":{"message":"A breaking change issue: the page may stop working in an upcoming version of Chrome"},"models/issues_manager/Issue.ts | breakingChanges":{"message":"Breaking Changes"},"models/issues_manager/Issue.ts | improvementIssue":{"message":"An improvement issue: there is an opportunity to improve the page"},"models/issues_manager/Issue.ts | improvements":{"message":"Improvements"},"models/issues_manager/Issue.ts | pageErrorIssue":{"message":"A page error issue: the page is not working correctly"},"models/issues_manager/Issue.ts | pageErrors":{"message":"Page Errors"},"models/issues_manager/LowTextContrastIssue.ts | colorAndContrastAccessibility":{"message":"Color and contrast accessibility"},"models/issues_manager/MixedContentIssue.ts | preventingMixedContent":{"message":"Preventing mixed content"},"models/issues_manager/QuirksModeIssue.ts | documentCompatibilityMode":{"message":"Document compatibility mode"},"models/issues_manager/SharedArrayBufferIssue.ts | enablingSharedArrayBuffer":{"message":"Enabling SharedArrayBuffer"},"models/logs/logs-meta.ts | clear":{"message":"clear"},"models/logs/logs-meta.ts | doNotPreserveLogOnPageReload":{"message":"Do not preserve log on page reload / navigation"},"models/logs/logs-meta.ts | preserve":{"message":"preserve"},"models/logs/logs-meta.ts | preserveLog":{"message":"Preserve log"},"models/logs/logs-meta.ts | preserveLogOnPageReload":{"message":"Preserve log on page reload / navigation"},"models/logs/logs-meta.ts | recordNetworkLog":{"message":"Record network log"},"models/logs/logs-meta.ts | reset":{"message":"reset"},"models/logs/NetworkLog.ts | anonymous":{"message":""},"models/persistence/EditFileSystemView.ts | add":{"message":"Add"},"models/persistence/EditFileSystemView.ts | enterAPath":{"message":"Enter a path"},"models/persistence/EditFileSystemView.ts | enterAUniquePath":{"message":"Enter a unique path"},"models/persistence/EditFileSystemView.ts | excludedFolders":{"message":"Excluded folders"},"models/persistence/EditFileSystemView.ts | folderPath":{"message":"Folder path"},"models/persistence/EditFileSystemView.ts | none":{"message":"None"},"models/persistence/EditFileSystemView.ts | sViaDevtools":{"message":"{PH1} (via .devtools)"},"models/persistence/IsolatedFileSystem.ts | blobCouldNotBeLoaded":{"message":"Blob could not be loaded."},"models/persistence/IsolatedFileSystem.ts | cantReadFileSS":{"message":"Can't read file: {PH1}: {PH2}"},"models/persistence/IsolatedFileSystem.ts | fileSystemErrorS":{"message":"File system error: {PH1}"},"models/persistence/IsolatedFileSystem.ts | linkedToS":{"message":"Linked to {PH1}"},"models/persistence/IsolatedFileSystem.ts | unknownErrorReadingFileS":{"message":"Unknown error reading file: {PH1}"},"models/persistence/IsolatedFileSystemManager.ts | unableToAddFilesystemS":{"message":"Unable to add filesystem: {PH1}"},"models/persistence/persistence-meta.ts | disableOverrideNetworkRequests":{"message":"Disable override network requests"},"models/persistence/persistence-meta.ts | enableLocalOverrides":{"message":"Enable Local Overrides"},"models/persistence/persistence-meta.ts | enableOverrideNetworkRequests":{"message":"Enable override network requests"},"models/persistence/persistence-meta.ts | interception":{"message":"interception"},"models/persistence/persistence-meta.ts | network":{"message":"network"},"models/persistence/persistence-meta.ts | override":{"message":"override"},"models/persistence/persistence-meta.ts | request":{"message":"request"},"models/persistence/persistence-meta.ts | rewrite":{"message":"rewrite"},"models/persistence/persistence-meta.ts | showWorkspace":{"message":"Show Workspace settings"},"models/persistence/persistence-meta.ts | workspace":{"message":"Workspace"},"models/persistence/PersistenceActions.ts | openInContainingFolder":{"message":"Open in containing folder"},"models/persistence/PersistenceActions.ts | overrideContent":{"message":"Override content"},"models/persistence/PersistenceActions.ts | overrideSourceMappedFileExplanation":{"message":"‘{PH1}’ is a source mapped file and cannot be overridden."},"models/persistence/PersistenceActions.ts | overrideSourceMappedFileWarning":{"message":"Override ‘{PH1}’ instead?"},"models/persistence/PersistenceActions.ts | saveAs":{"message":"Save as..."},"models/persistence/PersistenceActions.ts | saveImage":{"message":"Save image"},"models/persistence/PersistenceActions.ts | showOverrides":{"message":"Show all overrides"},"models/persistence/PersistenceUtils.ts | linkedToS":{"message":"Linked to {PH1}"},"models/persistence/PersistenceUtils.ts | linkedToSourceMapS":{"message":"Linked to source map: {PH1}"},"models/persistence/PlatformFileSystem.ts | unableToReadFilesWithThis":{"message":"PlatformFileSystem cannot read files."},"models/persistence/WorkspaceSettingsTab.ts | addFolder":{"message":"Add folder…"},"models/persistence/WorkspaceSettingsTab.ts | folderExcludePattern":{"message":"Folder exclude pattern"},"models/persistence/WorkspaceSettingsTab.ts | mappingsAreInferredAutomatically":{"message":"Mappings are inferred automatically."},"models/persistence/WorkspaceSettingsTab.ts | remove":{"message":"Remove"},"models/persistence/WorkspaceSettingsTab.ts | workspace":{"message":"Workspace"},"models/timeline_model/TimelineJSProfile.ts | threadS":{"message":"Thread {PH1}"},"models/timeline_model/TimelineModel.ts | dedicatedWorker":{"message":"Dedicated Worker"},"models/timeline_model/TimelineModel.ts | threadS":{"message":"Thread {PH1}"},"models/timeline_model/TimelineModel.ts | workerS":{"message":"Worker — {PH1}"},"models/timeline_model/TimelineModel.ts | workerSS":{"message":"Worker: {PH1} — {PH2}"},"models/workspace/UISourceCode.ts | index":{"message":"(index)"},"models/workspace/UISourceCode.ts | thisFileWasChangedExternally":{"message":"This file was changed externally. Would you like to reload it?"},"panels/accessibility/accessibility-meta.ts | accessibility":{"message":"Accessibility"},"panels/accessibility/accessibility-meta.ts | shoAccessibility":{"message":"Show Accessibility"},"panels/accessibility/AccessibilityNodeView.ts | accessibilityNodeNotExposed":{"message":"Accessibility node not exposed"},"panels/accessibility/AccessibilityNodeView.ts | ancestorChildrenAreAll":{"message":"Ancestor's children are all presentational: "},"panels/accessibility/AccessibilityNodeView.ts | computedProperties":{"message":"Computed Properties"},"panels/accessibility/AccessibilityNodeView.ts | elementHasEmptyAltText":{"message":"Element has empty alt text."},"panels/accessibility/AccessibilityNodeView.ts | elementHasPlaceholder":{"message":"Element has {PH1}."},"panels/accessibility/AccessibilityNodeView.ts | elementIsHiddenBy":{"message":"Element is hidden by active modal dialog: "},"panels/accessibility/AccessibilityNodeView.ts | elementIsHiddenByChildTree":{"message":"Element is hidden by child tree: "},"panels/accessibility/AccessibilityNodeView.ts | elementIsInAnInertSubTree":{"message":"Element is in an inert subtree from "},"panels/accessibility/AccessibilityNodeView.ts | elementIsInert":{"message":"Element is inert."},"panels/accessibility/AccessibilityNodeView.ts | elementIsNotRendered":{"message":"Element is not rendered."},"panels/accessibility/AccessibilityNodeView.ts | elementIsNotVisible":{"message":"Element is not visible."},"panels/accessibility/AccessibilityNodeView.ts | elementIsPlaceholder":{"message":"Element is {PH1}."},"panels/accessibility/AccessibilityNodeView.ts | elementIsPresentational":{"message":"Element is presentational."},"panels/accessibility/AccessibilityNodeView.ts | elementNotInteresting":{"message":"Element not interesting for accessibility."},"panels/accessibility/AccessibilityNodeView.ts | elementsInheritsPresentational":{"message":"Element inherits presentational role from "},"panels/accessibility/AccessibilityNodeView.ts | invalidSource":{"message":"Invalid source."},"panels/accessibility/AccessibilityNodeView.ts | labelFor":{"message":"Label for "},"panels/accessibility/AccessibilityNodeView.ts | noAccessibilityNode":{"message":"No accessibility node"},"panels/accessibility/AccessibilityNodeView.ts | noNodeWithThisId":{"message":"No node with this ID."},"panels/accessibility/AccessibilityNodeView.ts | noTextContent":{"message":"No text content."},"panels/accessibility/AccessibilityNodeView.ts | notSpecified":{"message":"Not specified"},"panels/accessibility/AccessibilityNodeView.ts | partOfLabelElement":{"message":"Part of label element: "},"panels/accessibility/AccessibilityNodeView.ts | placeholderIsPlaceholderOnAncestor":{"message":"{PH1} is {PH2} on ancestor: "},"panels/accessibility/AccessibilityStrings.ts | activeDescendant":{"message":"Active descendant"},"panels/accessibility/AccessibilityStrings.ts | aHumanreadableVersionOfTheValue":{"message":"A human-readable version of the value of a range widget (where necessary)."},"panels/accessibility/AccessibilityStrings.ts | atomicLiveRegions":{"message":"Atomic (live regions)"},"panels/accessibility/AccessibilityStrings.ts | busyLiveRegions":{"message":"Busy (live regions)"},"panels/accessibility/AccessibilityStrings.ts | canSetValue":{"message":"Can set value"},"panels/accessibility/AccessibilityStrings.ts | checked":{"message":"Checked"},"panels/accessibility/AccessibilityStrings.ts | contents":{"message":"Contents"},"panels/accessibility/AccessibilityStrings.ts | controls":{"message":"Controls"},"panels/accessibility/AccessibilityStrings.ts | describedBy":{"message":"Described by"},"panels/accessibility/AccessibilityStrings.ts | description":{"message":"Description"},"panels/accessibility/AccessibilityStrings.ts | disabled":{"message":"Disabled"},"panels/accessibility/AccessibilityStrings.ts | editable":{"message":"Editable"},"panels/accessibility/AccessibilityStrings.ts | elementOrElementsWhichFormThe":{"message":"Element or elements which form the description of this element."},"panels/accessibility/AccessibilityStrings.ts | elementOrElementsWhichMayFormThe":{"message":"Element or elements which may form the name of this element."},"panels/accessibility/AccessibilityStrings.ts | elementOrElementsWhichShouldBe":{"message":"Element or elements which should be considered descendants of this element, despite not being descendants in the DOM."},"panels/accessibility/AccessibilityStrings.ts | elementOrElementsWhoseContentOr":{"message":"Element or elements whose content or presence is/are controlled by this widget."},"panels/accessibility/AccessibilityStrings.ts | elementToWhichTheUserMayChooseTo":{"message":"Element to which the user may choose to navigate after this one, instead of the next element in the DOM order."},"panels/accessibility/AccessibilityStrings.ts | expanded":{"message":"Expanded"},"panels/accessibility/AccessibilityStrings.ts | focusable":{"message":"Focusable"},"panels/accessibility/AccessibilityStrings.ts | focused":{"message":"Focused"},"panels/accessibility/AccessibilityStrings.ts | forARangeWidgetTheMaximumAllowed":{"message":"For a range widget, the maximum allowed value."},"panels/accessibility/AccessibilityStrings.ts | forARangeWidgetTheMinimumAllowed":{"message":"For a range widget, the minimum allowed value."},"panels/accessibility/AccessibilityStrings.ts | fromAttribute":{"message":"From attribute"},"panels/accessibility/AccessibilityStrings.ts | fromCaption":{"message":"From caption"},"panels/accessibility/AccessibilityStrings.ts | fromDescription":{"message":"From description"},"panels/accessibility/AccessibilityStrings.ts | fromLabel":{"message":"From label"},"panels/accessibility/AccessibilityStrings.ts | fromLabelFor":{"message":"From label (for= attribute)"},"panels/accessibility/AccessibilityStrings.ts | fromLabelWrapped":{"message":"From label (wrapped)"},"panels/accessibility/AccessibilityStrings.ts | fromLegend":{"message":"From legend"},"panels/accessibility/AccessibilityStrings.ts | fromNativeHtml":{"message":"From native HTML"},"panels/accessibility/AccessibilityStrings.ts | fromPlaceholderAttribute":{"message":"From placeholder attribute"},"panels/accessibility/AccessibilityStrings.ts | fromRubyAnnotation":{"message":"From ruby annotation"},"panels/accessibility/AccessibilityStrings.ts | fromStyle":{"message":"From style"},"panels/accessibility/AccessibilityStrings.ts | fromTitle":{"message":"From title"},"panels/accessibility/AccessibilityStrings.ts | hasAutocomplete":{"message":"Has autocomplete"},"panels/accessibility/AccessibilityStrings.ts | hasPopup":{"message":"Has popup"},"panels/accessibility/AccessibilityStrings.ts | help":{"message":"Help"},"panels/accessibility/AccessibilityStrings.ts | ifAndHowThisElementCanBeEdited":{"message":"If and how this element can be edited."},"panels/accessibility/AccessibilityStrings.ts | ifThisElementMayReceiveLive":{"message":"If this element may receive live updates, whether the entire live region should be presented to the user on changes, or only changed nodes."},"panels/accessibility/AccessibilityStrings.ts | ifThisElementMayReceiveLiveUpdates":{"message":"If this element may receive live updates, what type of updates should trigger a notification."},"panels/accessibility/AccessibilityStrings.ts | ifThisElementMayReceiveLiveUpdatesThe":{"message":"If this element may receive live updates, the root element of the containing live region."},"panels/accessibility/AccessibilityStrings.ts | ifTrueThisElementCanReceiveFocus":{"message":"If true, this element can receive focus."},"panels/accessibility/AccessibilityStrings.ts | ifTrueThisElementCurrentlyCannot":{"message":"If true, this element currently cannot be interacted with."},"panels/accessibility/AccessibilityStrings.ts | ifTrueThisElementCurrentlyHas":{"message":"If true, this element currently has focus."},"panels/accessibility/AccessibilityStrings.ts | ifTrueThisElementMayBeInteracted":{"message":"If true, this element may be interacted with, but its value cannot be changed."},"panels/accessibility/AccessibilityStrings.ts | ifTrueThisElementsUserentered":{"message":"If true, this element's user-entered value does not conform to validation requirement."},"panels/accessibility/AccessibilityStrings.ts | implicit":{"message":"Implicit"},"panels/accessibility/AccessibilityStrings.ts | implicitValue":{"message":"Implicit value."},"panels/accessibility/AccessibilityStrings.ts | indicatesThePurposeOfThisElement":{"message":"Indicates the purpose of this element, such as a user interface idiom for a widget, or structural role within a document."},"panels/accessibility/AccessibilityStrings.ts | invalidUserEntry":{"message":"Invalid user entry"},"panels/accessibility/AccessibilityStrings.ts | labeledBy":{"message":"Labeled by"},"panels/accessibility/AccessibilityStrings.ts | level":{"message":"Level"},"panels/accessibility/AccessibilityStrings.ts | liveRegion":{"message":"Live region"},"panels/accessibility/AccessibilityStrings.ts | liveRegionRoot":{"message":"Live region root"},"panels/accessibility/AccessibilityStrings.ts | maximumValue":{"message":"Maximum value"},"panels/accessibility/AccessibilityStrings.ts | minimumValue":{"message":"Minimum value"},"panels/accessibility/AccessibilityStrings.ts | multiline":{"message":"Multi-line"},"panels/accessibility/AccessibilityStrings.ts | multiselectable":{"message":"Multi-selectable"},"panels/accessibility/AccessibilityStrings.ts | orientation":{"message":"Orientation"},"panels/accessibility/AccessibilityStrings.ts | pressed":{"message":"Pressed"},"panels/accessibility/AccessibilityStrings.ts | readonlyString":{"message":"Read-only"},"panels/accessibility/AccessibilityStrings.ts | relatedElement":{"message":"Related element"},"panels/accessibility/AccessibilityStrings.ts | relevantLiveRegions":{"message":"Relevant (live regions)"},"panels/accessibility/AccessibilityStrings.ts | requiredString":{"message":"Required"},"panels/accessibility/AccessibilityStrings.ts | role":{"message":"Role"},"panels/accessibility/AccessibilityStrings.ts | selectedString":{"message":"Selected"},"panels/accessibility/AccessibilityStrings.ts | theAccessibleDescriptionForThis":{"message":"The accessible description for this element."},"panels/accessibility/AccessibilityStrings.ts | theComputedHelpTextForThis":{"message":"The computed help text for this element."},"panels/accessibility/AccessibilityStrings.ts | theComputedNameOfThisElement":{"message":"The computed name of this element."},"panels/accessibility/AccessibilityStrings.ts | theDescendantOfThisElementWhich":{"message":"The descendant of this element which is active; i.e. the element to which focus should be delegated."},"panels/accessibility/AccessibilityStrings.ts | theHierarchicalLevelOfThis":{"message":"The hierarchical level of this element."},"panels/accessibility/AccessibilityStrings.ts | theValueOfThisElementThisMayBe":{"message":"The value of this element; this may be user-provided or developer-provided, depending on the element."},"panels/accessibility/AccessibilityStrings.ts | value":{"message":"Value"},"panels/accessibility/AccessibilityStrings.ts | valueDescription":{"message":"Value description"},"panels/accessibility/AccessibilityStrings.ts | valueFromAttribute":{"message":"Value from attribute."},"panels/accessibility/AccessibilityStrings.ts | valueFromDescriptionElement":{"message":"Value from description element."},"panels/accessibility/AccessibilityStrings.ts | valueFromElementContents":{"message":"Value from element contents."},"panels/accessibility/AccessibilityStrings.ts | valueFromFigcaptionElement":{"message":"Value from figcaption element."},"panels/accessibility/AccessibilityStrings.ts | valueFromLabelElement":{"message":"Value from label element."},"panels/accessibility/AccessibilityStrings.ts | valueFromLabelElementWithFor":{"message":"Value from label element with for= attribute."},"panels/accessibility/AccessibilityStrings.ts | valueFromLabelElementWrapped":{"message":"Value from a wrapping label element."},"panels/accessibility/AccessibilityStrings.ts | valueFromLegendElement":{"message":"Value from legend element."},"panels/accessibility/AccessibilityStrings.ts | valueFromNativeHtmlRuby":{"message":"Value from plain HTML ruby annotation."},"panels/accessibility/AccessibilityStrings.ts | valueFromNativeHtmlUnknownSource":{"message":"Value from native HTML (unknown source)."},"panels/accessibility/AccessibilityStrings.ts | valueFromPlaceholderAttribute":{"message":"Value from placeholder attribute."},"panels/accessibility/AccessibilityStrings.ts | valueFromRelatedElement":{"message":"Value from related element."},"panels/accessibility/AccessibilityStrings.ts | valueFromStyle":{"message":"Value from style."},"panels/accessibility/AccessibilityStrings.ts | valueFromTableCaption":{"message":"Value from table caption."},"panels/accessibility/AccessibilityStrings.ts | valueFromTitleAttribute":{"message":"Value from title attribute."},"panels/accessibility/AccessibilityStrings.ts | whetherAndWhatPriorityOfLive":{"message":"Whether and what priority of live updates may be expected for this element."},"panels/accessibility/AccessibilityStrings.ts | whetherAndWhatTypeOfAutocomplete":{"message":"Whether and what type of autocomplete suggestions are currently provided by this element."},"panels/accessibility/AccessibilityStrings.ts | whetherAUserMaySelectMoreThanOne":{"message":"Whether a user may select more than one option from this widget."},"panels/accessibility/AccessibilityStrings.ts | whetherTheOptionRepresentedBy":{"message":"Whether the option represented by this element is currently selected."},"panels/accessibility/AccessibilityStrings.ts | whetherTheValueOfThisElementCan":{"message":"Whether the value of this element can be set."},"panels/accessibility/AccessibilityStrings.ts | whetherThisCheckboxRadioButtonOr":{"message":"Whether this checkbox, radio button or tree item is checked, unchecked, or mixed (e.g. has both checked and un-checked children)."},"panels/accessibility/AccessibilityStrings.ts | whetherThisElementHasCausedSome":{"message":"Whether this element has caused some kind of pop-up (such as a menu) to appear."},"panels/accessibility/AccessibilityStrings.ts | whetherThisElementIsARequired":{"message":"Whether this element is a required field in a form."},"panels/accessibility/AccessibilityStrings.ts | whetherThisElementOrAnother":{"message":"Whether this element, or another grouping element it controls, is expanded."},"panels/accessibility/AccessibilityStrings.ts | whetherThisElementOrItsSubtree":{"message":"Whether this element or its subtree are currently being updated (and thus may be in an inconsistent state)."},"panels/accessibility/AccessibilityStrings.ts | whetherThisLinearElements":{"message":"Whether this linear element's orientation is horizontal or vertical."},"panels/accessibility/AccessibilityStrings.ts | whetherThisTextBoxMayHaveMore":{"message":"Whether this text box may have more than one line."},"panels/accessibility/AccessibilityStrings.ts | whetherThisToggleButtonIs":{"message":"Whether this toggle button is currently in a pressed state."},"panels/accessibility/ARIAAttributesView.ts | ariaAttributes":{"message":"ARIA Attributes"},"panels/accessibility/ARIAAttributesView.ts | noAriaAttributes":{"message":"No ARIA attributes"},"panels/accessibility/AXBreadcrumbsPane.ts | accessibilityTree":{"message":"Accessibility Tree"},"panels/accessibility/AXBreadcrumbsPane.ts | fullTreeExperimentDescription":{"message":"The accessibility tree moved to the top right corner of the DOM tree."},"panels/accessibility/AXBreadcrumbsPane.ts | fullTreeExperimentName":{"message":"Enable full-page accessibility tree"},"panels/accessibility/AXBreadcrumbsPane.ts | ignored":{"message":"Ignored"},"panels/accessibility/AXBreadcrumbsPane.ts | reloadRequired":{"message":"Reload required before the change takes effect."},"panels/accessibility/AXBreadcrumbsPane.ts | scrollIntoView":{"message":"Scroll into view"},"panels/accessibility/SourceOrderView.ts | noSourceOrderInformation":{"message":"No source order information available"},"panels/accessibility/SourceOrderView.ts | showSourceOrder":{"message":"Show source order"},"panels/accessibility/SourceOrderView.ts | sourceOrderViewer":{"message":"Source Order Viewer"},"panels/accessibility/SourceOrderView.ts | thereMayBeADelayInDisplaying":{"message":"There may be a delay in displaying source order for elements with many children"},"panels/animation/animation-meta.ts | animations":{"message":"Animations"},"panels/animation/animation-meta.ts | showAnimations":{"message":"Show Animations"},"panels/animation/AnimationTimeline.ts | animationPreviews":{"message":"Animation previews"},"panels/animation/AnimationTimeline.ts | animationPreviewS":{"message":"Animation Preview {PH1}"},"panels/animation/AnimationTimeline.ts | clearAll":{"message":"Clear all"},"panels/animation/AnimationTimeline.ts | pause":{"message":"Pause"},"panels/animation/AnimationTimeline.ts | pauseAll":{"message":"Pause all"},"panels/animation/AnimationTimeline.ts | pauseTimeline":{"message":"Pause timeline"},"panels/animation/AnimationTimeline.ts | playbackRatePlaceholder":{"message":"{PH1}%"},"panels/animation/AnimationTimeline.ts | playbackRates":{"message":"Playback rates"},"panels/animation/AnimationTimeline.ts | playTimeline":{"message":"Play timeline"},"panels/animation/AnimationTimeline.ts | replayTimeline":{"message":"Replay timeline"},"panels/animation/AnimationTimeline.ts | resumeAll":{"message":"Resume all"},"panels/animation/AnimationTimeline.ts | selectAnEffectAboveToInspectAnd":{"message":"Select an effect above to inspect and modify."},"panels/animation/AnimationTimeline.ts | setSpeedToS":{"message":"Set speed to {PH1}"},"panels/animation/AnimationTimeline.ts | waitingForAnimations":{"message":"Waiting for animations..."},"panels/animation/AnimationUI.ts | animationEndpointSlider":{"message":"Animation Endpoint slider"},"panels/animation/AnimationUI.ts | animationKeyframeSlider":{"message":"Animation Keyframe slider"},"panels/animation/AnimationUI.ts | sSlider":{"message":"{PH1} slider"},"panels/application/application-meta.ts | application":{"message":"Application"},"panels/application/application-meta.ts | clearSiteData":{"message":"Clear site data"},"panels/application/application-meta.ts | clearSiteDataIncludingThirdparty":{"message":"Clear site data (including third-party cookies)"},"panels/application/application-meta.ts | pwa":{"message":"pwa"},"panels/application/application-meta.ts | showApplication":{"message":"Show Application"},"panels/application/application-meta.ts | startRecordingEvents":{"message":"Start recording events"},"panels/application/application-meta.ts | stopRecordingEvents":{"message":"Stop recording events"},"panels/application/ApplicationPanelSidebar.ts | application":{"message":"Application"},"panels/application/ApplicationPanelSidebar.ts | applicationSidebarPanel":{"message":"Application panel sidebar"},"panels/application/ApplicationPanelSidebar.ts | appManifest":{"message":"App Manifest"},"panels/application/ApplicationPanelSidebar.ts | backgroundServices":{"message":"Background services"},"panels/application/ApplicationPanelSidebar.ts | beforeInvokeAlert":{"message":"{PH1}: Invoke to scroll to this section in manifest"},"panels/application/ApplicationPanelSidebar.ts | clear":{"message":"Clear"},"panels/application/ApplicationPanelSidebar.ts | cookies":{"message":"Cookies"},"panels/application/ApplicationPanelSidebar.ts | cookiesUsedByFramesFromS":{"message":"Cookies used by frames from {PH1}"},"panels/application/ApplicationPanelSidebar.ts | documentNotAvailable":{"message":"Document not available"},"panels/application/ApplicationPanelSidebar.ts | frames":{"message":"Frames"},"panels/application/ApplicationPanelSidebar.ts | indexeddb":{"message":"IndexedDB"},"panels/application/ApplicationPanelSidebar.ts | keyPathS":{"message":"Key path: {PH1}"},"panels/application/ApplicationPanelSidebar.ts | localFiles":{"message":"Local Files"},"panels/application/ApplicationPanelSidebar.ts | localStorage":{"message":"Local storage"},"panels/application/ApplicationPanelSidebar.ts | manifest":{"message":"Manifest"},"panels/application/ApplicationPanelSidebar.ts | noManifestDetected":{"message":"No manifest detected"},"panels/application/ApplicationPanelSidebar.ts | onInvokeAlert":{"message":"Scrolled to {PH1}"},"panels/application/ApplicationPanelSidebar.ts | onInvokeManifestAlert":{"message":"Manifest: Invoke to scroll to the top of manifest"},"panels/application/ApplicationPanelSidebar.ts | openedWindows":{"message":"Opened Windows"},"panels/application/ApplicationPanelSidebar.ts | refreshIndexeddb":{"message":"Refresh IndexedDB"},"panels/application/ApplicationPanelSidebar.ts | sessionStorage":{"message":"Session storage"},"panels/application/ApplicationPanelSidebar.ts | storage":{"message":"Storage"},"panels/application/ApplicationPanelSidebar.ts | theContentOfThisDocumentHasBeen":{"message":"The content of this document has been generated dynamically via 'document.write()'."},"panels/application/ApplicationPanelSidebar.ts | thirdPartyPhaseout":{"message":"Cookies from {PH1} may have been blocked due to third-party cookie phaseout."},"panels/application/ApplicationPanelSidebar.ts | versionS":{"message":"Version: {PH1}"},"panels/application/ApplicationPanelSidebar.ts | versionSEmpty":{"message":"Version: {PH1} (empty)"},"panels/application/ApplicationPanelSidebar.ts | webWorkers":{"message":"Web Workers"},"panels/application/ApplicationPanelSidebar.ts | windowWithoutTitle":{"message":"Window without title"},"panels/application/ApplicationPanelSidebar.ts | worker":{"message":"worker"},"panels/application/AppManifestView.ts | actualHeightSpxOfSSDoesNotMatch":{"message":"Actual height ({PH1}px) of {PH2} {PH3} does not match specified height ({PH4}px)"},"panels/application/AppManifestView.ts | actualSizeSspxOfSSDoesNotMatch":{"message":"Actual size ({PH1}×{PH2})px of {PH3} {PH4} does not match specified size ({PH5}×{PH6}px)"},"panels/application/AppManifestView.ts | actualWidthSpxOfSSDoesNotMatch":{"message":"Actual width ({PH1}px) of {PH2} {PH3} does not match specified width ({PH4}px)"},"panels/application/AppManifestView.ts | appIdExplainer":{"message":"This is used by the browser to know whether the manifest should be updating an existing application, or whether it refers to a new web app that can be installed."},"panels/application/AppManifestView.ts | appIdNote":{"message":"{PH1} {PH2} is not specified in the manifest, {PH3} is used instead. To specify an App ID that matches the current identity, set the {PH4} field to {PH5} {PH6}."},"panels/application/AppManifestView.ts | aUrlInTheManifestContainsA":{"message":"A URL in the manifest contains a username, password, or port"},"panels/application/AppManifestView.ts | avoidPurposeAnyAndMaskable":{"message":"Declaring an icon with 'purpose' of 'any maskable' is discouraged. It is likely to look incorrect on some platforms due to too much or too little padding."},"panels/application/AppManifestView.ts | backgroundColor":{"message":"Background color"},"panels/application/AppManifestView.ts | computedAppId":{"message":"Computed App ID"},"panels/application/AppManifestView.ts | copiedToClipboard":{"message":"Copied suggested ID {PH1} to clipboard"},"panels/application/AppManifestView.ts | copyToClipboard":{"message":"Copy suggested ID to clipboard"},"panels/application/AppManifestView.ts | couldNotCheckServiceWorker":{"message":"Could not check service worker without a 'start_url' field in the manifest"},"panels/application/AppManifestView.ts | couldNotDownloadARequiredIcon":{"message":"Could not download a required icon from the manifest"},"panels/application/AppManifestView.ts | customizePwaTitleBar":{"message":"Customize the window controls overlay of your PWA's title bar"},"panels/application/AppManifestView.ts | darkBackgroundColor":{"message":"Dark background color"},"panels/application/AppManifestView.ts | darkThemeColor":{"message":"Dark theme color"},"panels/application/AppManifestView.ts | description":{"message":"Description"},"panels/application/AppManifestView.ts | descriptionMayBeTruncated":{"message":"Description may be truncated."},"panels/application/AppManifestView.ts | display":{"message":"Display"},"panels/application/AppManifestView.ts | documentationOnMaskableIcons":{"message":"documentation on maskable icons"},"panels/application/AppManifestView.ts | downloadedIconWasEmptyOr":{"message":"Downloaded icon was empty or corrupted"},"panels/application/AppManifestView.ts | errorsAndWarnings":{"message":"Errors and warnings"},"panels/application/AppManifestView.ts | formFactor":{"message":"Form factor"},"panels/application/AppManifestView.ts | icon":{"message":"Icon"},"panels/application/AppManifestView.ts | icons":{"message":"Icons"},"panels/application/AppManifestView.ts | identity":{"message":"Identity"},"panels/application/AppManifestView.ts | imageFromS":{"message":"Image from {PH1}"},"panels/application/AppManifestView.ts | installability":{"message":"Installability"},"panels/application/AppManifestView.ts | label":{"message":"Label"},"panels/application/AppManifestView.ts | learnMore":{"message":"Learn more"},"panels/application/AppManifestView.ts | manifestContainsDisplayoverride":{"message":"Manifest contains 'display_override' field, and the first supported display mode must be one of 'standalone', 'fullscreen', or 'minimal-ui'"},"panels/application/AppManifestView.ts | manifestCouldNotBeFetchedIsEmpty":{"message":"Manifest could not be fetched, is empty, or could not be parsed"},"panels/application/AppManifestView.ts | manifestDisplayPropertyMustBeOne":{"message":"Manifest 'display' property must be one of 'standalone', 'fullscreen', or 'minimal-ui'"},"panels/application/AppManifestView.ts | manifestDoesNotContainANameOr":{"message":"Manifest does not contain a 'name' or 'short_name' field"},"panels/application/AppManifestView.ts | manifestDoesNotContainASuitable":{"message":"Manifest does not contain a suitable icon—PNG, SVG, or WebP format of at least {PH1}px is required, the 'sizes' attribute must be set, and the 'purpose' attribute, if set, must include 'any'."},"panels/application/AppManifestView.ts | manifestSpecifies":{"message":"Manifest specifies 'prefer_related_applications: true'"},"panels/application/AppManifestView.ts | manifestStartUrlIsNotValid":{"message":"Manifest 'start_url' is not valid"},"panels/application/AppManifestView.ts | name":{"message":"Name"},"panels/application/AppManifestView.ts | needHelpReadOurS":{"message":"Need help? Read the {PH1}."},"panels/application/AppManifestView.ts | newNoteUrl":{"message":"New note URL"},"panels/application/AppManifestView.ts | noPlayStoreIdProvided":{"message":"No Play store ID provided"},"panels/application/AppManifestView.ts | noScreenshotsForRicherPWAInstallOnDesktop":{"message":"Richer PWA Install UI won’t be available on desktop. Please add at least one screenshot with the form_factor set to wide."},"panels/application/AppManifestView.ts | noScreenshotsForRicherPWAInstallOnMobile":{"message":"Richer PWA Install UI won’t be available on mobile. Please add at least one screenshot for which form_factor is not set or set to a value other than wide."},"panels/application/AppManifestView.ts | noSuppliedIconIsAtLeastSpxSquare":{"message":"No supplied icon is at least {PH1} pixels square in PNG, SVG, or WebP format, with the purpose attribute unset or set to 'any'."},"panels/application/AppManifestView.ts | note":{"message":"Note:"},"panels/application/AppManifestView.ts | orientation":{"message":"Orientation"},"panels/application/AppManifestView.ts | pageDoesNotWorkOffline":{"message":"Page does not work offline"},"panels/application/AppManifestView.ts | pageDoesNotWorkOfflineThePage":{"message":"Page does not work offline. Starting in Chrome 93, the installability criteria are changing, and this site will not be installable. See {PH1} for more information."},"panels/application/AppManifestView.ts | pageHasNoManifestLinkUrl":{"message":"Page has no manifest URL"},"panels/application/AppManifestView.ts | pageIsLoadedInAnIncognitoWindow":{"message":"Page is loaded in an incognito window"},"panels/application/AppManifestView.ts | pageIsNotLoadedInTheMainFrame":{"message":"Page is not loaded in the main frame"},"panels/application/AppManifestView.ts | pageIsNotServedFromASecureOrigin":{"message":"Page is not served from a secure origin"},"panels/application/AppManifestView.ts | platform":{"message":"Platform"},"panels/application/AppManifestView.ts | preferrelatedapplicationsIsOnly":{"message":"'prefer_related_applications' is only supported on Chrome Beta and Stable channels on Android."},"panels/application/AppManifestView.ts | presentation":{"message":"Presentation"},"panels/application/AppManifestView.ts | protocolHandlers":{"message":"Protocol Handlers"},"panels/application/AppManifestView.ts | screenshot":{"message":"Screenshot"},"panels/application/AppManifestView.ts | screenshotPixelSize":{"message":"Screenshot {url} should specify a pixel size [width]x[height] instead of any as first size."},"panels/application/AppManifestView.ts | screenshotS":{"message":"Screenshot #{PH1}"},"panels/application/AppManifestView.ts | screenshotsMustHaveSameAspectRatio":{"message":"All screenshots with the same form_factor must have the same aspect ratio as the first screenshot with that form_factor. Some screenshots will be ignored."},"panels/application/AppManifestView.ts | selectWindowControlsOverlayEmulationOs":{"message":"Emulate the Window Controls Overlay on"},"panels/application/AppManifestView.ts | shortcutS":{"message":"Shortcut #{PH1}"},"panels/application/AppManifestView.ts | shortcutsMayBeNotAvailable":{"message":"The maximum number of shortcuts is platform dependent. Some shortcuts may be not available."},"panels/application/AppManifestView.ts | shortcutSShouldIncludeAXPixel":{"message":"Shortcut #{PH1} should include a 96×96 pixel icon"},"panels/application/AppManifestView.ts | shortName":{"message":"Short name"},"panels/application/AppManifestView.ts | showOnlyTheMinimumSafeAreaFor":{"message":"Show only the minimum safe area for maskable icons"},"panels/application/AppManifestView.ts | sSDoesNotSpecifyItsSizeInThe":{"message":"{PH1} {PH2} does not specify its size in the manifest"},"panels/application/AppManifestView.ts | sSFailedToLoad":{"message":"{PH1} {PH2} failed to load"},"panels/application/AppManifestView.ts | sSHeightDoesNotComplyWithRatioRequirement":{"message":"{PH1} {PH2} height can't be more than 2.3 times as long as the width"},"panels/application/AppManifestView.ts | sSrcIsNotSet":{"message":"{PH1} 'src' is not set"},"panels/application/AppManifestView.ts | sSShouldHaveSquareIcon":{"message":"Most operating systems require square icons. Please include at least one square icon in the array."},"panels/application/AppManifestView.ts | sSShouldSpecifyItsSizeAs":{"message":"{PH1} {PH2} should specify its size as [width]x[height]"},"panels/application/AppManifestView.ts | sSSizeShouldBeAtLeast320":{"message":"{PH1} {PH2} size should be at least 320×320"},"panels/application/AppManifestView.ts | sSSizeShouldBeAtMost3840":{"message":"{PH1} {PH2} size should be at most 3840×3840"},"panels/application/AppManifestView.ts | sSWidthDoesNotComplyWithRatioRequirement":{"message":"{PH1} {PH2} width can't be more than 2.3 times as long as the height"},"panels/application/AppManifestView.ts | startUrl":{"message":"Start URL"},"panels/application/AppManifestView.ts | sUrlSFailedToParse":{"message":"{PH1} URL ''{PH2}'' failed to parse"},"panels/application/AppManifestView.ts | theAppIsAlreadyInstalled":{"message":"The app is already installed"},"panels/application/AppManifestView.ts | themeColor":{"message":"Theme color"},"panels/application/AppManifestView.ts | thePlayStoreAppUrlAndPlayStoreId":{"message":"The Play Store app URL and Play Store ID do not match"},"panels/application/AppManifestView.ts | theSpecifiedApplicationPlatform":{"message":"The specified application platform is not supported on Android"},"panels/application/AppManifestView.ts | tooManyScreenshotsForDesktop":{"message":"No more than 8 screenshots will be displayed on desktop. The rest will be ignored."},"panels/application/AppManifestView.ts | tooManyScreenshotsForMobile":{"message":"No more than 5 screenshots will be displayed on mobile. The rest will be ignored."},"panels/application/AppManifestView.ts | url":{"message":"URL"},"panels/application/AppManifestView.ts | wcoFound":{"message":"Chrome has successfully found the {PH1} value for the {PH2} field in the {PH3}."},"panels/application/AppManifestView.ts | wcoNeedHelpReadMore":{"message":"Need help? Read {PH1}."},"panels/application/AppManifestView.ts | wcoNotFound":{"message":"Define {PH1} in the manifest to use the Window Controls Overlay API and customize your app's title bar."},"panels/application/AppManifestView.ts | windowControlsOverlay":{"message":"Window Controls Overlay"},"panels/application/BackForwardCacheTreeElement.ts | backForwardCache":{"message":"Back/forward cache"},"panels/application/BackgroundServiceView.ts | backgroundFetch":{"message":"Background fetch"},"panels/application/BackgroundServiceView.ts | backgroundServices":{"message":"Background services"},"panels/application/BackgroundServiceView.ts | backgroundSync":{"message":"Background sync"},"panels/application/BackgroundServiceView.ts | clear":{"message":"Clear"},"panels/application/BackgroundServiceView.ts | clickTheRecordButtonSOrHitSTo":{"message":"Click the record button {PH1} or hit {PH2} to start recording."},"panels/application/BackgroundServiceView.ts | devtoolsWillRecordAllSActivity":{"message":"DevTools will record all {PH1} activity for up to 3 days, even when closed."},"panels/application/BackgroundServiceView.ts | empty":{"message":"empty"},"panels/application/BackgroundServiceView.ts | event":{"message":"Event"},"panels/application/BackgroundServiceView.ts | instanceId":{"message":"Instance ID"},"panels/application/BackgroundServiceView.ts | learnMore":{"message":"Learn more"},"panels/application/BackgroundServiceView.ts | noMetadataForThisEvent":{"message":"No metadata for this event"},"panels/application/BackgroundServiceView.ts | notifications":{"message":"Notifications"},"panels/application/BackgroundServiceView.ts | origin":{"message":"Origin"},"panels/application/BackgroundServiceView.ts | paymentHandler":{"message":"Payment handler"},"panels/application/BackgroundServiceView.ts | periodicBackgroundSync":{"message":"Periodic background sync"},"panels/application/BackgroundServiceView.ts | pushMessaging":{"message":"Push messaging"},"panels/application/BackgroundServiceView.ts | recordingSActivity":{"message":"Recording {PH1} activity..."},"panels/application/BackgroundServiceView.ts | saveEvents":{"message":"Save events"},"panels/application/BackgroundServiceView.ts | selectAnEntryToViewMetadata":{"message":"Select an entry to view metadata"},"panels/application/BackgroundServiceView.ts | showEventsForOtherStorageKeys":{"message":"Show events from other storage partitions"},"panels/application/BackgroundServiceView.ts | showEventsFromOtherDomains":{"message":"Show events from other domains"},"panels/application/BackgroundServiceView.ts | startRecordingEvents":{"message":"Start recording events"},"panels/application/BackgroundServiceView.ts | stopRecordingEvents":{"message":"Stop recording events"},"panels/application/BackgroundServiceView.ts | storageKey":{"message":"Storage Key"},"panels/application/BackgroundServiceView.ts | swScope":{"message":"Service Worker Scope"},"panels/application/BackgroundServiceView.ts | timestamp":{"message":"Timestamp"},"panels/application/BounceTrackingMitigationsTreeElement.ts | bounceTrackingMitigations":{"message":"Bounce tracking mitigations"},"panels/application/components/BackForwardCacheStrings.ts | appBanner":{"message":"Pages that requested an AppBanner are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | backForwardCacheDisabled":{"message":"Back/forward cache is disabled by flags. Visit chrome://flags/#back-forward-cache to enable it locally on this device."},"panels/application/components/BackForwardCacheStrings.ts | backForwardCacheDisabledByCommandLine":{"message":"Back/forward cache is disabled by the command line."},"panels/application/components/BackForwardCacheStrings.ts | backForwardCacheDisabledByLowMemory":{"message":"Back/forward cache is disabled due to insufficient memory."},"panels/application/components/BackForwardCacheStrings.ts | backForwardCacheDisabledForDelegate":{"message":"Back/forward cache is not supported by delegate."},"panels/application/components/BackForwardCacheStrings.ts | backForwardCacheDisabledForPrerender":{"message":"Back/forward cache is disabled for prerenderer."},"panels/application/components/BackForwardCacheStrings.ts | broadcastChannel":{"message":"The page cannot be cached because it has a BroadcastChannel instance with registered listeners."},"panels/application/components/BackForwardCacheStrings.ts | BroadcastChannelOnMessage":{"message":"Undefined"},"panels/application/components/BackForwardCacheStrings.ts | cacheControlNoStore":{"message":"Pages with cache-control:no-store header cannot enter back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | cacheFlushed":{"message":"The cache was intentionally cleared."},"panels/application/components/BackForwardCacheStrings.ts | cacheLimit":{"message":"The page was evicted from the cache to allow another page to be cached."},"panels/application/components/BackForwardCacheStrings.ts | containsPlugins":{"message":"Pages containing plugins are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | contentFileChooser":{"message":"Pages that use FileChooser API are not eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | contentFileSystemAccess":{"message":"Pages that use File System Access API are not eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | contentMediaDevicesDispatcherHost":{"message":"Pages that use Media Device Dispatcher are not eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | contentMediaPlay":{"message":"A media player was playing upon navigating away."},"panels/application/components/BackForwardCacheStrings.ts | contentMediaSession":{"message":"Pages that use MediaSession API and set a playback state are not eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | contentMediaSessionService":{"message":"Pages that use MediaSession API and set action handlers are not eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | contentScreenReader":{"message":"Back/forward cache is disabled due to screen reader."},"panels/application/components/BackForwardCacheStrings.ts | contentSecurityHandler":{"message":"Pages that use SecurityHandler are not eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | contentSerial":{"message":"Pages that use Serial API are not eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | contentWebAuthenticationAPI":{"message":"Pages that use WebAuthetication API are not eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | contentWebBluetooth":{"message":"Pages that use WebBluetooth API are not eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | contentWebUSB":{"message":"Pages that use WebUSB API are not eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | cookieDisabled":{"message":"Back/forward cache is disabled because cookies are disabled on a page that uses Cache-Control: no-store."},"panels/application/components/BackForwardCacheStrings.ts | CookieFlushed":{"message":"Undefined"},"panels/application/components/BackForwardCacheStrings.ts | dedicatedWorkerOrWorklet":{"message":"Pages that use a dedicated worker or worklet are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | documentLoaded":{"message":"The document did not finish loading before navigating away."},"panels/application/components/BackForwardCacheStrings.ts | embedderAppBannerManager":{"message":"App Banner was present upon navigating away."},"panels/application/components/BackForwardCacheStrings.ts | embedderChromePasswordManagerClientBindCredentialManager":{"message":"Chrome Password Manager was present upon navigating away."},"panels/application/components/BackForwardCacheStrings.ts | embedderDomDistillerSelfDeletingRequestDelegate":{"message":"DOM distillation was in progress upon navigating away."},"panels/application/components/BackForwardCacheStrings.ts | embedderDomDistillerViewerSource":{"message":"DOM Distiller Viewer was present upon navigating away."},"panels/application/components/BackForwardCacheStrings.ts | embedderExtensionMessaging":{"message":"Back/forward cache is disabled due to extensions using messaging API."},"panels/application/components/BackForwardCacheStrings.ts | embedderExtensionMessagingForOpenPort":{"message":"Extensions with long-lived connection should close the connection before entering back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | embedderExtensions":{"message":"Back/forward cache is disabled due to extensions."},"panels/application/components/BackForwardCacheStrings.ts | embedderExtensionSentMessageToCachedFrame":{"message":"Extensions with long-lived connection attempted to send messages to frames in back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | embedderModalDialog":{"message":"Modal dialog such as form resubmission or http password dialog was shown for the page upon navigating away."},"panels/application/components/BackForwardCacheStrings.ts | embedderOfflinePage":{"message":"The offline page was shown upon navigating away."},"panels/application/components/BackForwardCacheStrings.ts | embedderOomInterventionTabHelper":{"message":"Out-Of-Memory Intervention bar was present upon navigating away."},"panels/application/components/BackForwardCacheStrings.ts | embedderPermissionRequestManager":{"message":"There were permission requests upon navigating away."},"panels/application/components/BackForwardCacheStrings.ts | embedderPopupBlockerTabHelper":{"message":"Popup blocker was present upon navigating away."},"panels/application/components/BackForwardCacheStrings.ts | embedderSafeBrowsingThreatDetails":{"message":"Safe Browsing details were shown upon navigating away."},"panels/application/components/BackForwardCacheStrings.ts | embedderSafeBrowsingTriggeredPopupBlocker":{"message":"Safe Browsing considered this page to be abusive and blocked popup."},"panels/application/components/BackForwardCacheStrings.ts | enteredBackForwardCacheBeforeServiceWorkerHostAdded":{"message":"A service worker was activated while the page was in back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | errorDocument":{"message":"Back/forward cache is disabled due to a document error."},"panels/application/components/BackForwardCacheStrings.ts | fencedFramesEmbedder":{"message":"Pages using FencedFrames cannot be stored in bfcache."},"panels/application/components/BackForwardCacheStrings.ts | foregroundCacheLimit":{"message":"The page was evicted from the cache to allow another page to be cached."},"panels/application/components/BackForwardCacheStrings.ts | grantedMediaStreamAccess":{"message":"Pages that have granted media stream access are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | haveInnerContents":{"message":"Pages that use portals are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | HTTPAuthRequired":{"message":"Undefined"},"panels/application/components/BackForwardCacheStrings.ts | HTTPMethodNotGET":{"message":"Only pages loaded via a GET request are eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | HTTPStatusNotOK":{"message":"Only pages with a status code of 2XX can be cached."},"panels/application/components/BackForwardCacheStrings.ts | idleManager":{"message":"Pages that use IdleManager are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | indexedDBConnection":{"message":"Pages that have an open IndexedDB connection are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | indexedDBEvent":{"message":"Back/forward cache is disabled due to an IndexedDB event."},"panels/application/components/BackForwardCacheStrings.ts | ineligibleAPI":{"message":"Ineligible APIs were used."},"panels/application/components/BackForwardCacheStrings.ts | injectedJavascript":{"message":"Pages that JavaScript is injected into by extensions are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | injectedStyleSheet":{"message":"Pages that a StyleSheet is injected into by extensions are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | internalError":{"message":"Internal error."},"panels/application/components/BackForwardCacheStrings.ts | JavaScriptExecution":{"message":"Chrome detected an attempt to execute JavaScript while in the cache."},"panels/application/components/BackForwardCacheStrings.ts | jsNetworkRequestReceivedCacheControlNoStoreResource":{"message":"Back/forward cache is disabled because some JavaScript network request received resource with Cache-Control: no-store header."},"panels/application/components/BackForwardCacheStrings.ts | keepaliveRequest":{"message":"Back/forward cache is disabled due to a keepalive request."},"panels/application/components/BackForwardCacheStrings.ts | keyboardLock":{"message":"Pages that use Keyboard lock are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | LiveMediaStreamTrack":{"message":"Undefined"},"panels/application/components/BackForwardCacheStrings.ts | loading":{"message":"The page did not finish loading before navigating away."},"panels/application/components/BackForwardCacheStrings.ts | mainResourceHasCacheControlNoCache":{"message":"Pages whose main resource has cache-control:no-cache cannot enter back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | mainResourceHasCacheControlNoStore":{"message":"Pages whose main resource has cache-control:no-store cannot enter back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | navigationCancelledWhileRestoring":{"message":"Navigation was cancelled before the page could be restored from back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | networkExceedsBufferLimit":{"message":"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."},"panels/application/components/BackForwardCacheStrings.ts | networkRequestDatapipeDrainedAsBytesConsumer":{"message":"Pages that have inflight fetch() or XHR are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | networkRequestRedirected":{"message":"The page was evicted from back/forward cache because an active network request involved a redirect."},"panels/application/components/BackForwardCacheStrings.ts | networkRequestTimeout":{"message":"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."},"panels/application/components/BackForwardCacheStrings.ts | noResponseHead":{"message":"Pages that do not have a valid response head cannot enter back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | notMainFrame":{"message":"Navigation happened in a frame other than the main frame."},"panels/application/components/BackForwardCacheStrings.ts | outstandingIndexedDBTransaction":{"message":"Page with ongoing indexed DB transactions are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | outstandingNetworkRequestDirectSocket":{"message":"Pages with an in-flight network request are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | outstandingNetworkRequestFetch":{"message":"Pages with an in-flight fetch network request are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | outstandingNetworkRequestOthers":{"message":"Pages with an in-flight network request are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | outstandingNetworkRequestXHR":{"message":"Pages with an in-flight XHR network request are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | ParserAborted":{"message":"Undefined"},"panels/application/components/BackForwardCacheStrings.ts | paymentManager":{"message":"Pages that use PaymentManager are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | pictureInPicture":{"message":"Pages that use Picture-in-Picture are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | portal":{"message":"Pages that use portals are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | printing":{"message":"Pages that show Printing UI are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | relatedActiveContentsExist":{"message":"The page was opened using 'window.open()' and another tab has a reference to it, or the page opened a window."},"panels/application/components/BackForwardCacheStrings.ts | rendererProcessCrashed":{"message":"The renderer process for the page in back/forward cache crashed."},"panels/application/components/BackForwardCacheStrings.ts | rendererProcessKilled":{"message":"The renderer process for the page in back/forward cache was killed."},"panels/application/components/BackForwardCacheStrings.ts | requestedAudioCapturePermission":{"message":"Pages that have requested audio capture permissions are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | requestedBackForwardCacheBlockedSensors":{"message":"Pages that have requested sensor permissions are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | requestedBackgroundWorkPermission":{"message":"Pages that have requested background sync or fetch permissions are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | requestedMIDIPermission":{"message":"Pages that have requested MIDI permissions are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | requestedNotificationsPermission":{"message":"Pages that have requested notifications permissions are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | requestedStorageAccessGrant":{"message":"Pages that have requested storage access are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | requestedVideoCapturePermission":{"message":"Pages that have requested video capture permissions are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | schemeNotHTTPOrHTTPS":{"message":"Only pages whose URL scheme is HTTP / HTTPS can be cached."},"panels/application/components/BackForwardCacheStrings.ts | serviceWorkerClaim":{"message":"The page was claimed by a service worker while it is in back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | serviceWorkerPostMessage":{"message":"A service worker attempted to send the page in back/forward cache a MessageEvent."},"panels/application/components/BackForwardCacheStrings.ts | serviceWorkerUnregistration":{"message":"ServiceWorker was unregistered while a page was in back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | serviceWorkerVersionActivation":{"message":"The page was evicted from back/forward cache due to a service worker activation."},"panels/application/components/BackForwardCacheStrings.ts | sessionRestored":{"message":"Chrome restarted and cleared the back/forward cache entries."},"panels/application/components/BackForwardCacheStrings.ts | sharedWorker":{"message":"Pages that use SharedWorker are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | SmartCard":{"message":"Undefined"},"panels/application/components/BackForwardCacheStrings.ts | speechRecognizer":{"message":"Pages that use SpeechRecognizer are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | speechSynthesis":{"message":"Pages that use SpeechSynthesis are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | subframeIsNavigating":{"message":"An iframe on the page started a navigation that did not complete."},"panels/application/components/BackForwardCacheStrings.ts | subresourceHasCacheControlNoCache":{"message":"Pages whose subresource has cache-control:no-cache cannot enter back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | subresourceHasCacheControlNoStore":{"message":"Pages whose subresource has cache-control:no-store cannot enter back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | timeout":{"message":"The page exceeded the maximum time in back/forward cache and was expired."},"panels/application/components/BackForwardCacheStrings.ts | timeoutPuttingInCache":{"message":"The page timed out entering back/forward cache (likely due to long-running pagehide handlers)."},"panels/application/components/BackForwardCacheStrings.ts | UnloadHandler":{"message":"Undefined"},"panels/application/components/BackForwardCacheStrings.ts | unloadHandlerExistsInMainFrame":{"message":"The page has an unload handler in the main frame."},"panels/application/components/BackForwardCacheStrings.ts | unloadHandlerExistsInSubFrame":{"message":"The page has an unload handler in a sub frame."},"panels/application/components/BackForwardCacheStrings.ts | userAgentOverrideDiffers":{"message":"Browser has changed the user agent override header."},"panels/application/components/BackForwardCacheStrings.ts | wasGrantedMediaAccess":{"message":"Pages that have granted access to record video or audio are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | webDatabase":{"message":"Pages that use WebDatabase are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | webHID":{"message":"Pages that use WebHID are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | webLocks":{"message":"Pages that use WebLocks are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | webNfc":{"message":"Pages that use WebNfc are not currently eligible for back/forwad cache."},"panels/application/components/BackForwardCacheStrings.ts | webOTPService":{"message":"Pages that use WebOTPService are not currently eligible for bfcache."},"panels/application/components/BackForwardCacheStrings.ts | webRTC":{"message":"Pages with WebRTC cannot enter back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | webRTCSticky":{"message":"Back/forward cache is disabled because WebRTC has been used."},"panels/application/components/BackForwardCacheStrings.ts | webShare":{"message":"Pages that use WebShare are not currently eligible for back/forwad cache."},"panels/application/components/BackForwardCacheStrings.ts | webSocket":{"message":"Pages with WebSocket cannot enter back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | webSocketSticky":{"message":"Back/forward cache is disabled because WebSocket has been used."},"panels/application/components/BackForwardCacheStrings.ts | webTransport":{"message":"Pages with WebTransport cannot enter back/forward cache."},"panels/application/components/BackForwardCacheStrings.ts | webTransportSticky":{"message":"Back/forward cache is disabled because WebTransport has been used."},"panels/application/components/BackForwardCacheStrings.ts | webXR":{"message":"Pages that use WebXR are not currently eligible for back/forward cache."},"panels/application/components/BackForwardCacheView.ts | backForwardCacheTitle":{"message":"Back/forward cache"},"panels/application/components/BackForwardCacheView.ts | blankURLTitle":{"message":"Blank URL [{PH1}]"},"panels/application/components/BackForwardCacheView.ts | blockingExtensionId":{"message":"Extension id: "},"panels/application/components/BackForwardCacheView.ts | circumstantial":{"message":"Not Actionable"},"panels/application/components/BackForwardCacheView.ts | circumstantialExplanation":{"message":"These reasons are not actionable i.e. caching was prevented by something outside of the direct control of the page."},"panels/application/components/BackForwardCacheView.ts | filesPerIssue":{"message":"{n, plural, =1 {# file} other {# files}}"},"panels/application/components/BackForwardCacheView.ts | framesPerIssue":{"message":"{n, plural, =1 {# frame} other {# frames}}"},"panels/application/components/BackForwardCacheView.ts | framesTitle":{"message":"Frames"},"panels/application/components/BackForwardCacheView.ts | issuesInMultipleFrames":{"message":"{n, plural, =1 {# issue found in {m} frames.} other {# issues found in {m} frames.}}"},"panels/application/components/BackForwardCacheView.ts | issuesInSingleFrame":{"message":"{n, plural, =1 {# issue found in 1 frame.} other {# issues found in 1 frame.}}"},"panels/application/components/BackForwardCacheView.ts | learnMore":{"message":"Learn more: back/forward cache eligibility"},"panels/application/components/BackForwardCacheView.ts | mainFrame":{"message":"Main Frame"},"panels/application/components/BackForwardCacheView.ts | neverUseUnload":{"message":"Learn more: Never use unload handler"},"panels/application/components/BackForwardCacheView.ts | normalNavigation":{"message":"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."},"panels/application/components/BackForwardCacheView.ts | pageSupportNeeded":{"message":"Actionable"},"panels/application/components/BackForwardCacheView.ts | pageSupportNeededExplanation":{"message":"These reasons are actionable i.e. they can be cleaned up to make the page eligible for back/forward cache."},"panels/application/components/BackForwardCacheView.ts | restoredFromBFCache":{"message":"Successfully served from back/forward cache."},"panels/application/components/BackForwardCacheView.ts | runningTest":{"message":"Running test"},"panels/application/components/BackForwardCacheView.ts | runTest":{"message":"Test back/forward cache"},"panels/application/components/BackForwardCacheView.ts | supportPending":{"message":"Pending Support"},"panels/application/components/BackForwardCacheView.ts | supportPendingExplanation":{"message":"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."},"panels/application/components/BackForwardCacheView.ts | unavailable":{"message":"unavailable"},"panels/application/components/BackForwardCacheView.ts | unknown":{"message":"Unknown Status"},"panels/application/components/BackForwardCacheView.ts | url":{"message":"URL:"},"panels/application/components/BounceTrackingMitigationsView.ts | bounceTrackingMitigationsTitle":{"message":"Bounce tracking mitigations"},"panels/application/components/BounceTrackingMitigationsView.ts | checkingPotentialTrackers":{"message":"Checking for potential bounce tracking sites."},"panels/application/components/BounceTrackingMitigationsView.ts | featureDisabled":{"message":"Bounce tracking mitigations are disabled. To enable them, set the flag at {PH1} to \"Enabled With Deletion\"."},"panels/application/components/BounceTrackingMitigationsView.ts | featureFlag":{"message":"Bounce Tracking Mitigations Feature Flag"},"panels/application/components/BounceTrackingMitigationsView.ts | forceRun":{"message":"Force run"},"panels/application/components/BounceTrackingMitigationsView.ts | learnMore":{"message":"Learn more: Bounce Tracking Mitigations"},"panels/application/components/BounceTrackingMitigationsView.ts | noPotentialBounceTrackersIdentified":{"message":"State was not cleared for any potential bounce tracking sites. Either none were identified or third-party cookies are not blocked."},"panels/application/components/BounceTrackingMitigationsView.ts | runningMitigations":{"message":"Running"},"panels/application/components/BounceTrackingMitigationsView.ts | stateDeletedFor":{"message":"State was deleted for the following sites:"},"panels/application/components/EndpointsGrid.ts | noEndpointsToDisplay":{"message":"No endpoints to display"},"panels/application/components/FrameDetailsView.ts | additionalInformation":{"message":"Additional Information"},"panels/application/components/FrameDetailsView.ts | adStatus":{"message":"Ad Status"},"panels/application/components/FrameDetailsView.ts | aFrameAncestorIsAnInsecure":{"message":"A frame ancestor is an insecure context"},"panels/application/components/FrameDetailsView.ts | apiAvailability":{"message":"API availability"},"panels/application/components/FrameDetailsView.ts | availabilityOfCertainApisDepends":{"message":"Availability of certain APIs depends on the document being cross-origin isolated."},"panels/application/components/FrameDetailsView.ts | available":{"message":"available"},"panels/application/components/FrameDetailsView.ts | availableNotTransferable":{"message":"available, not transferable"},"panels/application/components/FrameDetailsView.ts | availableTransferable":{"message":"available, transferable"},"panels/application/components/FrameDetailsView.ts | child":{"message":"child"},"panels/application/components/FrameDetailsView.ts | childDescription":{"message":"This frame has been identified as a child frame of an ad"},"panels/application/components/FrameDetailsView.ts | clickToRevealInElementsPanel":{"message":"Click to reveal in Elements panel"},"panels/application/components/FrameDetailsView.ts | clickToRevealInNetworkPanel":{"message":"Click to reveal in Network panel"},"panels/application/components/FrameDetailsView.ts | clickToRevealInNetworkPanelMight":{"message":"Click to reveal in Network panel (might require page reload)"},"panels/application/components/FrameDetailsView.ts | clickToRevealInSourcesPanel":{"message":"Click to reveal in Sources panel"},"panels/application/components/FrameDetailsView.ts | contentSecurityPolicy":{"message":"Content Security Policy (CSP)"},"panels/application/components/FrameDetailsView.ts | createdByAdScriptExplanation":{"message":"There was an ad script in the (async) stack when this frame was created. Examining the creation stack trace of this frame might provide more insight."},"panels/application/components/FrameDetailsView.ts | creationStackTrace":{"message":"Frame Creation Stack Trace"},"panels/application/components/FrameDetailsView.ts | creationStackTraceExplanation":{"message":"This frame was created programmatically. The stack trace shows where this happened."},"panels/application/components/FrameDetailsView.ts | creatorAdScript":{"message":"Creator Ad Script"},"panels/application/components/FrameDetailsView.ts | crossoriginIsolated":{"message":"Cross-Origin Isolated"},"panels/application/components/FrameDetailsView.ts | document":{"message":"Document"},"panels/application/components/FrameDetailsView.ts | frameId":{"message":"Frame ID"},"panels/application/components/FrameDetailsView.ts | learnMore":{"message":"Learn more"},"panels/application/components/FrameDetailsView.ts | localhostIsAlwaysASecureContext":{"message":"Localhost is always a secure context"},"panels/application/components/FrameDetailsView.ts | matchedBlockingRuleExplanation":{"message":"This frame is considered an ad frame because its current (or previous) main document is an ad resource."},"panels/application/components/FrameDetailsView.ts | measureMemory":{"message":"Measure Memory"},"panels/application/components/FrameDetailsView.ts | no":{"message":"No"},"panels/application/components/FrameDetailsView.ts | none":{"message":"None"},"panels/application/components/FrameDetailsView.ts | origin":{"message":"Origin"},"panels/application/components/FrameDetailsView.ts | originTrialsExplanation":{"message":"Origin trials give you access to a new or experimental feature."},"panels/application/components/FrameDetailsView.ts | ownerElement":{"message":"Owner Element"},"panels/application/components/FrameDetailsView.ts | parentIsAdExplanation":{"message":"This frame is considered an ad frame because its parent frame is an ad frame."},"panels/application/components/FrameDetailsView.ts | reportingTo":{"message":"reporting to"},"panels/application/components/FrameDetailsView.ts | requiresCrossoriginIsolated":{"message":"requires cross-origin isolated context"},"panels/application/components/FrameDetailsView.ts | root":{"message":"root"},"panels/application/components/FrameDetailsView.ts | rootDescription":{"message":"This frame has been identified as the root frame of an ad"},"panels/application/components/FrameDetailsView.ts | secureContext":{"message":"Secure Context"},"panels/application/components/FrameDetailsView.ts | securityIsolation":{"message":"Security & Isolation"},"panels/application/components/FrameDetailsView.ts | sharedarraybufferConstructorIs":{"message":"SharedArrayBuffer constructor is available and SABs can be transferred via postMessage"},"panels/application/components/FrameDetailsView.ts | sharedarraybufferConstructorIsAvailable":{"message":"SharedArrayBuffer constructor is available but SABs cannot be transferred via postMessage"},"panels/application/components/FrameDetailsView.ts | theFramesSchemeIsInsecure":{"message":"The frame's scheme is insecure"},"panels/application/components/FrameDetailsView.ts | thePerformanceAPI":{"message":"The performance.measureUserAgentSpecificMemory() API is available"},"panels/application/components/FrameDetailsView.ts | thePerformancemeasureuseragentspecificmemory":{"message":"The performance.measureUserAgentSpecificMemory() API is not available"},"panels/application/components/FrameDetailsView.ts | thisAdditionalDebugging":{"message":"This additional (debugging) information is shown because the 'Protocol Monitor' experiment is enabled."},"panels/application/components/FrameDetailsView.ts | transferRequiresCrossoriginIsolatedPermission":{"message":"SharedArrayBuffer transfer requires enabling the permission policy:"},"panels/application/components/FrameDetailsView.ts | unavailable":{"message":"unavailable"},"panels/application/components/FrameDetailsView.ts | unreachableUrl":{"message":"Unreachable URL"},"panels/application/components/FrameDetailsView.ts | url":{"message":"URL"},"panels/application/components/FrameDetailsView.ts | willRequireCrossoriginIsolated":{"message":"⚠️ will require cross-origin isolated context in the future"},"panels/application/components/FrameDetailsView.ts | yes":{"message":"Yes"},"panels/application/components/InterestGroupAccessGrid.ts | allInterestGroupStorageEvents":{"message":"All interest group storage events."},"panels/application/components/InterestGroupAccessGrid.ts | eventTime":{"message":"Event Time"},"panels/application/components/InterestGroupAccessGrid.ts | eventType":{"message":"Access Type"},"panels/application/components/InterestGroupAccessGrid.ts | groupName":{"message":"Name"},"panels/application/components/InterestGroupAccessGrid.ts | groupOwner":{"message":"Owner"},"panels/application/components/InterestGroupAccessGrid.ts | noEvents":{"message":"No interest group events recorded."},"panels/application/components/OriginTrialTreeView.ts | expiryTime":{"message":"Expiry Time"},"panels/application/components/OriginTrialTreeView.ts | isThirdParty":{"message":"Third Party"},"panels/application/components/OriginTrialTreeView.ts | matchSubDomains":{"message":"Subdomain Matching"},"panels/application/components/OriginTrialTreeView.ts | noTrialTokens":{"message":"No trial tokens"},"panels/application/components/OriginTrialTreeView.ts | origin":{"message":"Origin"},"panels/application/components/OriginTrialTreeView.ts | rawTokenText":{"message":"Raw Token"},"panels/application/components/OriginTrialTreeView.ts | status":{"message":"Token Status"},"panels/application/components/OriginTrialTreeView.ts | token":{"message":"Token"},"panels/application/components/OriginTrialTreeView.ts | tokens":{"message":"{PH1} tokens"},"panels/application/components/OriginTrialTreeView.ts | trialName":{"message":"Trial Name"},"panels/application/components/OriginTrialTreeView.ts | usageRestriction":{"message":"Usage Restriction"},"panels/application/components/PermissionsPolicySection.ts | allowedFeatures":{"message":"Allowed Features"},"panels/application/components/PermissionsPolicySection.ts | clickToShowHeader":{"message":"Click to reveal the request whose \"Permissions-Policy\" HTTP header disables this feature."},"panels/application/components/PermissionsPolicySection.ts | clickToShowIframe":{"message":"Click to reveal the top-most iframe which does not allow this feature in the elements panel."},"panels/application/components/PermissionsPolicySection.ts | disabledByFencedFrame":{"message":"disabled inside a fencedframe"},"panels/application/components/PermissionsPolicySection.ts | disabledByHeader":{"message":"disabled by \"Permissions-Policy\" header"},"panels/application/components/PermissionsPolicySection.ts | disabledByIframe":{"message":"missing in iframe \"allow\" attribute"},"panels/application/components/PermissionsPolicySection.ts | disabledFeatures":{"message":"Disabled Features"},"panels/application/components/PermissionsPolicySection.ts | hideDetails":{"message":"Hide details"},"panels/application/components/PermissionsPolicySection.ts | showDetails":{"message":"Show details"},"panels/application/components/ProtocolHandlersView.ts | dropdownLabel":{"message":"Select protocol handler"},"panels/application/components/ProtocolHandlersView.ts | manifest":{"message":"manifest"},"panels/application/components/ProtocolHandlersView.ts | needHelpReadOur":{"message":"Need help? Read {PH1}."},"panels/application/components/ProtocolHandlersView.ts | protocolDetected":{"message":"Found valid protocol handler registration in the {PH1}. With the app installed, test the registered protocols."},"panels/application/components/ProtocolHandlersView.ts | protocolHandlerRegistrations":{"message":"URL protocol handler registration for PWAs"},"panels/application/components/ProtocolHandlersView.ts | protocolNotDetected":{"message":"Define protocol handlers in the {PH1} to register your app as a handler for custom protocols when your app is installed."},"panels/application/components/ProtocolHandlersView.ts | testProtocol":{"message":"Test protocol"},"panels/application/components/ProtocolHandlersView.ts | textboxLabel":{"message":"Query parameter or endpoint for protocol handler"},"panels/application/components/ProtocolHandlersView.ts | textboxPlaceholder":{"message":"Enter URL"},"panels/application/components/ReportsGrid.ts | destination":{"message":"Destination"},"panels/application/components/ReportsGrid.ts | generatedAt":{"message":"Generated at"},"panels/application/components/ReportsGrid.ts | noReportsToDisplay":{"message":"No reports to display"},"panels/application/components/ReportsGrid.ts | status":{"message":"Status"},"panels/application/components/SharedStorageAccessGrid.ts | allSharedStorageEvents":{"message":"All shared storage events for this page."},"panels/application/components/SharedStorageAccessGrid.ts | eventParams":{"message":"Optional Event Params"},"panels/application/components/SharedStorageAccessGrid.ts | eventTime":{"message":"Event Time"},"panels/application/components/SharedStorageAccessGrid.ts | eventType":{"message":"Access Type"},"panels/application/components/SharedStorageAccessGrid.ts | mainFrameId":{"message":"Main Frame ID"},"panels/application/components/SharedStorageAccessGrid.ts | noEvents":{"message":"No shared storage events recorded."},"panels/application/components/SharedStorageAccessGrid.ts | ownerOrigin":{"message":"Owner Origin"},"panels/application/components/SharedStorageAccessGrid.ts | sharedStorage":{"message":"Shared storage"},"panels/application/components/SharedStorageMetadataView.ts | budgetExplanation":{"message":"Remaining data leakage allowed within a 24-hour period for this origin in bits of entropy"},"panels/application/components/SharedStorageMetadataView.ts | creation":{"message":"Creation Time"},"panels/application/components/SharedStorageMetadataView.ts | entropyBudget":{"message":"Entropy Budget for Fenced Frames"},"panels/application/components/SharedStorageMetadataView.ts | notYetCreated":{"message":"Not yet created"},"panels/application/components/SharedStorageMetadataView.ts | numBytesUsed":{"message":"Number of Bytes Used"},"panels/application/components/SharedStorageMetadataView.ts | numEntries":{"message":"Number of Entries"},"panels/application/components/SharedStorageMetadataView.ts | resetBudget":{"message":"Reset Budget"},"panels/application/components/SharedStorageMetadataView.ts | sharedStorage":{"message":"Shared storage"},"panels/application/components/StackTrace.ts | cannotRenderStackTrace":{"message":"Cannot render stack trace"},"panels/application/components/StackTrace.ts | creationStackTrace":{"message":"Frame Creation Stack Trace"},"panels/application/components/StackTrace.ts | showLess":{"message":"Show less"},"panels/application/components/StackTrace.ts | showSMoreFrames":{"message":"{n, plural, =1 {Show # more frame} other {Show # more frames}}"},"panels/application/components/StorageMetadataView.ts | bucketName":{"message":"Bucket name"},"panels/application/components/StorageMetadataView.ts | confirmBucketDeletion":{"message":"Delete the \"{PH1}\" bucket?"},"panels/application/components/StorageMetadataView.ts | defaultBucket":{"message":"Default bucket"},"panels/application/components/StorageMetadataView.ts | deleteBucket":{"message":"Delete bucket"},"panels/application/components/StorageMetadataView.ts | durability":{"message":"Durability"},"panels/application/components/StorageMetadataView.ts | expiration":{"message":"Expiration"},"panels/application/components/StorageMetadataView.ts | isOpaque":{"message":"Is opaque"},"panels/application/components/StorageMetadataView.ts | isThirdParty":{"message":"Is third-party"},"panels/application/components/StorageMetadataView.ts | loading":{"message":"Loading…"},"panels/application/components/StorageMetadataView.ts | no":{"message":"No"},"panels/application/components/StorageMetadataView.ts | none":{"message":"None"},"panels/application/components/StorageMetadataView.ts | opaque":{"message":"(opaque)"},"panels/application/components/StorageMetadataView.ts | origin":{"message":"Origin"},"panels/application/components/StorageMetadataView.ts | persistent":{"message":"Is persistent"},"panels/application/components/StorageMetadataView.ts | quota":{"message":"Quota"},"panels/application/components/StorageMetadataView.ts | topLevelSite":{"message":"Top-level site"},"panels/application/components/StorageMetadataView.ts | yes":{"message":"Yes"},"panels/application/components/StorageMetadataView.ts | yesBecauseAncestorChainHasCrossSite":{"message":"Yes, because the ancestry chain contains a third-party origin"},"panels/application/components/StorageMetadataView.ts | yesBecauseKeyIsOpaque":{"message":"Yes, because the storage key is opaque"},"panels/application/components/StorageMetadataView.ts | yesBecauseOriginNotInTopLevelSite":{"message":"Yes, because the origin is outside of the top-level site"},"panels/application/components/StorageMetadataView.ts | yesBecauseTopLevelIsOpaque":{"message":"Yes, because the top-level site is opaque"},"panels/application/components/TrustTokensView.ts | allStoredTrustTokensAvailableIn":{"message":"All stored private state tokens available in this browser instance."},"panels/application/components/TrustTokensView.ts | deleteTrustTokens":{"message":"Delete all stored private state tokens issued by {PH1}."},"panels/application/components/TrustTokensView.ts | issuer":{"message":"Issuer"},"panels/application/components/TrustTokensView.ts | noTrustTokensStored":{"message":"No private state tokens are currently stored."},"panels/application/components/TrustTokensView.ts | storedTokenCount":{"message":"Stored token count"},"panels/application/components/TrustTokensView.ts | trustTokens":{"message":"Private state tokens"},"panels/application/CookieItemsView.ts | clearAllCookies":{"message":"Clear all cookies"},"panels/application/CookieItemsView.ts | clearFilteredCookies":{"message":"Clear filtered cookies"},"panels/application/CookieItemsView.ts | cookies":{"message":"Cookies"},"panels/application/CookieItemsView.ts | numberOfCookiesShownInTableS":{"message":"Number of cookies shown in table: {PH1}"},"panels/application/CookieItemsView.ts | onlyShowCookiesWhichHaveAn":{"message":"Only show cookies that have an associated issue"},"panels/application/CookieItemsView.ts | onlyShowCookiesWithAnIssue":{"message":"Only show cookies with an issue"},"panels/application/CookieItemsView.ts | selectACookieToPreviewItsValue":{"message":"Select a cookie to preview its value"},"panels/application/CookieItemsView.ts | showUrlDecoded":{"message":"Show URL-decoded"},"panels/application/DOMStorageItemsView.ts | domStorage":{"message":"DOM Storage"},"panels/application/DOMStorageItemsView.ts | domStorageItemDeleted":{"message":"The storage item was deleted."},"panels/application/DOMStorageItemsView.ts | domStorageItems":{"message":"DOM Storage Items"},"panels/application/DOMStorageItemsView.ts | domStorageItemsCleared":{"message":"DOM Storage Items cleared"},"panels/application/DOMStorageItemsView.ts | domStorageNumberEntries":{"message":"Number of entries shown in table: {PH1}"},"panels/application/DOMStorageItemsView.ts | key":{"message":"Key"},"panels/application/DOMStorageItemsView.ts | selectAValueToPreview":{"message":"Select a value to preview"},"panels/application/DOMStorageItemsView.ts | value":{"message":"Value"},"panels/application/IndexedDBViews.ts | clearObjectStore":{"message":"Clear object store"},"panels/application/IndexedDBViews.ts | collapse":{"message":"Collapse"},"panels/application/IndexedDBViews.ts | dataMayBeStale":{"message":"Data may be stale"},"panels/application/IndexedDBViews.ts | deleteDatabase":{"message":"Delete database"},"panels/application/IndexedDBViews.ts | deleteSelected":{"message":"Delete selected"},"panels/application/IndexedDBViews.ts | expandRecursively":{"message":"Expand Recursively"},"panels/application/IndexedDBViews.ts | idb":{"message":"IDB"},"panels/application/IndexedDBViews.ts | indexedDb":{"message":"Indexed DB"},"panels/application/IndexedDBViews.ts | keyGeneratorValueS":{"message":"Key generator value: {PH1}"},"panels/application/IndexedDBViews.ts | keyPath":{"message":"Key path: "},"panels/application/IndexedDBViews.ts | keyString":{"message":"Key"},"panels/application/IndexedDBViews.ts | objectStores":{"message":"Object stores"},"panels/application/IndexedDBViews.ts | pleaseConfirmDeleteOfSDatabase":{"message":"Please confirm delete of \"{PH1}\" database."},"panels/application/IndexedDBViews.ts | primaryKey":{"message":"Primary key"},"panels/application/IndexedDBViews.ts | refresh":{"message":"Refresh"},"panels/application/IndexedDBViews.ts | refreshDatabase":{"message":"Refresh database"},"panels/application/IndexedDBViews.ts | showNextPage":{"message":"Show next page"},"panels/application/IndexedDBViews.ts | showPreviousPage":{"message":"Show previous page"},"panels/application/IndexedDBViews.ts | someEntriesMayHaveBeenModified":{"message":"Some entries may have been modified"},"panels/application/IndexedDBViews.ts | startFromKey":{"message":"Start from key"},"panels/application/IndexedDBViews.ts | totalEntriesS":{"message":"Total entries: {PH1}"},"panels/application/IndexedDBViews.ts | valueString":{"message":"Value"},"panels/application/IndexedDBViews.ts | version":{"message":"Version"},"panels/application/InterestGroupStorageView.ts | clickToDisplayBody":{"message":"Click on any interest group event to display the group's current state"},"panels/application/InterestGroupStorageView.ts | noDataAvailable":{"message":"No details available for the selected interest group. The browser may have left the group."},"panels/application/InterestGroupTreeElement.ts | interestGroups":{"message":"Interest groups"},"panels/application/OpenedWindowDetailsView.ts | accessToOpener":{"message":"Access to opener"},"panels/application/OpenedWindowDetailsView.ts | clickToRevealInElementsPanel":{"message":"Click to reveal in Elements panel"},"panels/application/OpenedWindowDetailsView.ts | closed":{"message":"closed"},"panels/application/OpenedWindowDetailsView.ts | crossoriginEmbedderPolicy":{"message":"Cross-Origin Embedder Policy"},"panels/application/OpenedWindowDetailsView.ts | document":{"message":"Document"},"panels/application/OpenedWindowDetailsView.ts | no":{"message":"No"},"panels/application/OpenedWindowDetailsView.ts | openerFrame":{"message":"Opener Frame"},"panels/application/OpenedWindowDetailsView.ts | reportingTo":{"message":"reporting to"},"panels/application/OpenedWindowDetailsView.ts | security":{"message":"Security"},"panels/application/OpenedWindowDetailsView.ts | securityIsolation":{"message":"Security & Isolation"},"panels/application/OpenedWindowDetailsView.ts | showsWhetherTheOpenedWindowIs":{"message":"Shows whether the opened window is able to access its opener and vice versa"},"panels/application/OpenedWindowDetailsView.ts | type":{"message":"Type"},"panels/application/OpenedWindowDetailsView.ts | unknown":{"message":"Unknown"},"panels/application/OpenedWindowDetailsView.ts | url":{"message":"URL"},"panels/application/OpenedWindowDetailsView.ts | webWorker":{"message":"Web Worker"},"panels/application/OpenedWindowDetailsView.ts | windowWithoutTitle":{"message":"Window without title"},"panels/application/OpenedWindowDetailsView.ts | worker":{"message":"worker"},"panels/application/OpenedWindowDetailsView.ts | yes":{"message":"Yes"},"panels/application/preloading/components/MismatchedPreloadingGrid.ts | action":{"message":"Action"},"panels/application/preloading/components/MismatchedPreloadingGrid.ts | status":{"message":"Status"},"panels/application/preloading/components/MismatchedPreloadingGrid.ts | statusFailure":{"message":"Failure"},"panels/application/preloading/components/MismatchedPreloadingGrid.ts | statusNotTriggered":{"message":"Not triggered"},"panels/application/preloading/components/MismatchedPreloadingGrid.ts | statusPending":{"message":"Pending"},"panels/application/preloading/components/MismatchedPreloadingGrid.ts | statusReady":{"message":"Ready"},"panels/application/preloading/components/MismatchedPreloadingGrid.ts | statusRunning":{"message":"Running"},"panels/application/preloading/components/MismatchedPreloadingGrid.ts | statusSuccess":{"message":"Success"},"panels/application/preloading/components/MismatchedPreloadingGrid.ts | url":{"message":"URL"},"panels/application/preloading/components/PreloadingDetailsReportView.ts | buttonClickToInspect":{"message":"Click to inspect prerendered page"},"panels/application/preloading/components/PreloadingDetailsReportView.ts | buttonClickToRevealRuleSet":{"message":"Click to reveal rule set"},"panels/application/preloading/components/PreloadingDetailsReportView.ts | buttonInspect":{"message":"Inspect"},"panels/application/preloading/components/PreloadingDetailsReportView.ts | detailedStatusFailure":{"message":"Speculative load failed."},"panels/application/preloading/components/PreloadingDetailsReportView.ts | detailedStatusNotTriggered":{"message":"Speculative load attempt is not yet triggered."},"panels/application/preloading/components/PreloadingDetailsReportView.ts | detailedStatusPending":{"message":"Speculative load attempt is eligible but pending."},"panels/application/preloading/components/PreloadingDetailsReportView.ts | detailedStatusReady":{"message":"Speculative load finished and the result is ready for the next navigation."},"panels/application/preloading/components/PreloadingDetailsReportView.ts | detailedStatusRunning":{"message":"Speculative load is running."},"panels/application/preloading/components/PreloadingDetailsReportView.ts | detailedStatusSuccess":{"message":"Speculative load finished and used for a navigation."},"panels/application/preloading/components/PreloadingDetailsReportView.ts | detailsAction":{"message":"Action"},"panels/application/preloading/components/PreloadingDetailsReportView.ts | detailsDetailedInformation":{"message":"Detailed information"},"panels/application/preloading/components/PreloadingDetailsReportView.ts | detailsFailureReason":{"message":"Failure reason"},"panels/application/preloading/components/PreloadingDetailsReportView.ts | detailsRuleSet":{"message":"Rule set"},"panels/application/preloading/components/PreloadingDetailsReportView.ts | detailsStatus":{"message":"Status"},"panels/application/preloading/components/PreloadingDetailsReportView.ts | selectAnElementForMoreDetails":{"message":"Select an element for more details"},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | descriptionDisabledByBatterySaver":{"message":"Speculative loading is disabled because of the operating system's Battery Saver mode."},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | descriptionDisabledByDataSaver":{"message":"Speculative loading is disabled because of the operating system's Data Saver mode."},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | descriptionDisabledByHoldbackPrefetchSpeculationRules":{"message":"Prefetch is forced-enabled because DevTools is open. When DevTools is closed, prefetch will be disabled because this browser session is part of a holdback group used for performance comparisons."},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | descriptionDisabledByHoldbackPrerenderSpeculationRules":{"message":"Prerendering is forced-enabled because DevTools is open. When DevTools is closed, prerendering will be disabled because this browser session is part of a holdback group used for performance comparisons."},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | descriptionDisabledByPreference":{"message":"Speculative loading is disabled because of user settings or an extension. Go to {PH1} to update your preference. Go to {PH2} to disable any extension that blocks speculative loading."},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | extensionsSettings":{"message":"Extensions settings"},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | footerLearnMore":{"message":"Learn more"},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | headerDisabledByBatterySaver":{"message":"Battery Saver"},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | headerDisabledByDataSaver":{"message":"Data Saver"},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | headerDisabledByHoldbackPrefetchSpeculationRules":{"message":"Prefetch was disabled, but is force-enabled now"},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | headerDisabledByHoldbackPrerenderSpeculationRules":{"message":"Prerendering was disabled, but is force-enabled now"},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | headerDisabledByPreference":{"message":"User settings or extensions"},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | infobarPreloadingIsDisabled":{"message":"Speculative loading is disabled"},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | infobarPreloadingIsForceEnabled":{"message":"Speculative loading is force-enabled"},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | preloadingPagesSettings":{"message":"Preload pages settings"},"panels/application/preloading/components/PreloadingDisabledInfobar.ts | titleReasonsPreventingPreloading":{"message":"Reasons preventing speculative loading"},"panels/application/preloading/components/PreloadingGrid.ts | action":{"message":"Action"},"panels/application/preloading/components/PreloadingGrid.ts | ruleSet":{"message":"Rule set"},"panels/application/preloading/components/PreloadingGrid.ts | status":{"message":"Status"},"panels/application/preloading/components/PreloadingMismatchedHeadersGrid.ts | activationNavigationValue":{"message":"Value in activation navigation"},"panels/application/preloading/components/PreloadingMismatchedHeadersGrid.ts | headerName":{"message":"Header name"},"panels/application/preloading/components/PreloadingMismatchedHeadersGrid.ts | initialNavigationValue":{"message":"Value in initial navigation"},"panels/application/preloading/components/PreloadingMismatchedHeadersGrid.ts | missing":{"message":"(missing)"},"panels/application/preloading/components/PreloadingString.ts | PrefetchEvictedAfterCandidateRemoved":{"message":"The prefetch was discarded because no speculation rule in the initating page triggers a prefetch for this URL anymore."},"panels/application/preloading/components/PreloadingString.ts | PrefetchEvictedForNewerPrefetch":{"message":"The prefetch was discarded because the initiating page has too many prefetches ongoing, and this was one of the oldest."},"panels/application/preloading/components/PreloadingString.ts | PrefetchFailedIneligibleRedirect":{"message":"The prefetch was redirected, but the redirect URL is not eligible for prefetch."},"panels/application/preloading/components/PreloadingString.ts | PrefetchFailedInvalidRedirect":{"message":"The prefetch was redirected, but there was a problem with the redirect."},"panels/application/preloading/components/PreloadingString.ts | PrefetchFailedMIMENotSupported":{"message":"The prefetch failed because the response's Content-Type header was not supported."},"panels/application/preloading/components/PreloadingString.ts | PrefetchFailedNetError":{"message":"The prefetch failed because of a network error."},"panels/application/preloading/components/PreloadingString.ts | PrefetchFailedNon2XX":{"message":"The prefetch failed because of a non-2xx HTTP response status code."},"panels/application/preloading/components/PreloadingString.ts | PrefetchFailedPerPageLimitExceeded":{"message":"The prefetch was not performed because the initiating page already has too many prefetches ongoing."},"panels/application/preloading/components/PreloadingString.ts | PrefetchIneligibleRetryAfter":{"message":"A previous prefetch to the origin got a HTTP 503 response with an Retry-After header that has not elapsed yet."},"panels/application/preloading/components/PreloadingString.ts | PrefetchIsPrivacyDecoy":{"message":"The URL was not eligible to be prefetched because there was a registered service worker or cross-site cookies for that origin, but the prefetch was put on the network anyways and not used, to disguise that the user had some kind of previous relationship with the origin."},"panels/application/preloading/components/PreloadingString.ts | PrefetchIsStale":{"message":"Too much time elapsed between the prefetch and usage, so the prefetch was discarded."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotEligibleBatterySaverEnabled":{"message":"The prefetch was not performed because the Battery Saver setting was enabled."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotEligibleBrowserContextOffTheRecord":{"message":"The prefetch was not performed because the browser is in Incognito or Guest mode."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotEligibleDataSaverEnabled":{"message":"The prefetch was not performed because the operating system is in Data Saver mode."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotEligibleExistingProxy":{"message":"The URL is not eligible to be prefetched, because in the default network context it is configured to use a proxy server."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotEligibleHostIsNonUnique":{"message":"The URL was not eligible to be prefetched because its host was not unique (e.g., a non publicly routable IP address or a hostname which is not registry-controlled), but the prefetch was required to be proxied."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotEligibleNonDefaultStoragePartition":{"message":"The URL was not eligible to be prefetched because it uses a non-default storage partition."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotEligiblePreloadingDisabled":{"message":"The prefetch was not performed because speculative loading was disabled."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotEligibleSameSiteCrossOriginPrefetchRequiredProxy":{"message":"The URL was not eligible to be prefetched because the default network context cannot be configured to use the prefetch proxy for a same-site cross-origin prefetch request."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotEligibleSchemeIsNotHttps":{"message":"The URL was not eligible to be prefetched because its scheme was not https:."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotEligibleUserHasCookies":{"message":"The URL was not eligible to be prefetched because it was cross-site, but the user had cookies for that origin."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotEligibleUserHasServiceWorker":{"message":"The URL was not eligible to be prefetched because there was a registered service worker for that origin, which is currently not supported."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotUsedCookiesChanged":{"message":"The prefetch was not used because it was a cross-site prefetch, and cookies were added for that URL while the prefetch was ongoing, so the prefetched response is now out-of-date."},"panels/application/preloading/components/PreloadingString.ts | PrefetchNotUsedProbeFailed":{"message":"The prefetch was blocked by your Internet Service Provider or network administrator."},"panels/application/preloading/components/PreloadingString.ts | PrefetchProxyNotAvailable":{"message":"A network error was encountered when trying to set up a connection to the prefetching proxy."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusActivatedDuringMainFrameNavigation":{"message":"Prerendered page activated during initiating page's main frame navigation."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusActivatedWithAuxiliaryBrowsingContexts":{"message":"The prerender was not used because during activation time, there were other windows with an active opener reference to the initiating page, which is currently not supported."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusActivationFramePolicyNotCompatible":{"message":"The prerender was not used because the sandboxing flags or permissions policy of the initiating page was not compatible with those of the prerendering page."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusActivationNavigationParameterMismatch":{"message":"The prerender was not used because during activation time, different navigation parameters (e.g., HTTP headers) were calculated than during the original prerendering navigation request."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusActivationUrlHasEffectiveUrl":{"message":"The prerender was not used because during activation time, navigation has an effective URL that is different from its normal URL. (For example, the New Tab Page, or hosted apps.)"},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusAudioOutputDeviceRequested":{"message":"The prerendered page requested audio output, which is currently not supported."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusBatterySaverEnabled":{"message":"The prerender was not performed because the user requested that the browser use less battery."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusBlockedByClient":{"message":"Some resource load was blocked."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusClientCertRequested":{"message":"The prerendering navigation required a HTTP client certificate."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusCrossSiteNavigationInInitialNavigation":{"message":"The prerendering navigation failed because it targeted a cross-site URL."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusCrossSiteNavigationInMainFrameNavigation":{"message":"The prerendered page navigated to a cross-site URL."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusCrossSiteRedirectInInitialNavigation":{"message":"The prerendering navigation failed because the prerendered URL redirected to a cross-site URL."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusCrossSiteRedirectInMainFrameNavigation":{"message":"The prerendered page navigated to a URL which redirected to a cross-site URL."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusDataSaverEnabled":{"message":"The prerender was not performed because the user requested that the browser use less data."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusDownload":{"message":"The prerendered page attempted to initiate a download, which is currently not supported."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusHasEffectiveUrl":{"message":"The initiating page cannot perform prerendering, because it has an effective URL that is different from its normal URL. (For example, the New Tab Page, or hosted apps.)"},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusInvalidSchemeNavigation":{"message":"The URL was not eligible to be prerendered because its scheme was not http: or https:."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusInvalidSchemeRedirect":{"message":"The prerendering navigation failed because it redirected to a URL whose scheme was not http: or https:."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusLoginAuthRequested":{"message":"The prerendering navigation required HTTP authentication, which is currently not supported."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusLowEndDevice":{"message":"The prerender was not performed because this device does not have enough total system memory to support prerendering."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusMainFrameNavigation":{"message":"The prerendered page navigated itself to another URL, which is currently not supported."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusMaxNumOfRunningEagerPrerendersExceeded":{"message":"The prerender whose eagerness is \"eager\" was not performed because the initiating page already has too many prerenders ongoing. Remove other speculation rules with \"eager\" to enable further prerendering."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusMaxNumOfRunningEmbedderPrerendersExceeded":{"message":"The browser-triggered prerender was not performed because the initiating page already has too many prerenders ongoing."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusMaxNumOfRunningNonEagerPrerendersExceeded":{"message":"The old non-eager prerender (with a \"moderate\" or \"conservative\" eagerness and triggered by hovering or clicking links) was automatically canceled due to starting a new non-eager prerender. It can be retriggered by interacting with the link again."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusMemoryLimitExceeded":{"message":"The prerender was not performed because the browser exceeded the prerendering memory limit."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusMemoryPressureAfterTriggered":{"message":"The prerendered page was unloaded because the browser came under critical memory pressure."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusMemoryPressureOnTrigger":{"message":"The prerender was not performed because the browser was under critical memory pressure."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusMixedContent":{"message":"The prerendered page contained mixed content."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusMojoBinderPolicy":{"message":"The prerendered page used a forbidden JavaScript API that is currently not supported. (Internal Mojo interface: {PH1})"},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusNavigationBadHttpStatus":{"message":"The prerendering navigation failed because of a non-2xx HTTP response status code."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusNavigationRequestBlockedByCsp":{"message":"The prerendering navigation was blocked by a Content Security Policy."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusNavigationRequestNetworkError":{"message":"The prerendering navigation encountered a network error."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusPreloadingDisabled":{"message":"The prerender was not performed because the user disabled preloading in their browser settings."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusPrerenderingDisabledByDevTools":{"message":"The prerender was not performed because DevTools has been used to disable prerendering."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusPrerenderingUrlHasEffectiveUrl":{"message":"The prerendering navigation failed because it has an effective URL that is different from its normal URL. (For example, the New Tab Page, or hosted apps.)"},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusPrimaryMainFrameRendererProcessCrashed":{"message":"The initiating page crashed."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusPrimaryMainFrameRendererProcessKilled":{"message":"The initiating page was killed."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusRedirectedPrerenderingUrlHasEffectiveUrl":{"message":"The prerendering navigation failed because it redirected to an effective URL that is different from its normal URL. (For example, the New Tab Page, or hosted apps.)"},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusRendererProcessCrashed":{"message":"The prerendered page crashed."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusRendererProcessKilled":{"message":"The prerendered page was killed."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusSameSiteCrossOriginNavigationNotOptInInInitialNavigation":{"message":"The prerendering navigation failed because it was to a cross-origin same-site URL, but the destination response did not include the appropriate Supports-Loading-Mode header."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusSameSiteCrossOriginNavigationNotOptInInMainFrameNavigation":{"message":"The prerendered page navigated to a cross-origin same-site URL, but the destination response did not include the appropriate Supports-Loading-Mode header."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusSameSiteCrossOriginRedirectNotOptInInInitialNavigation":{"message":"The prerendering navigation failed because the prerendered URL redirected to a cross-origin same-site URL, but the destination response did not include the appropriate Supports-Loading-Mode header."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusSameSiteCrossOriginRedirectNotOptInInMainFrameNavigation":{"message":"The prerendered page navigated to a URL which redirected to a cross-origin same-site URL, but the destination response did not include the appropriate Supports-Loading-Mode header."},"panels/application/preloading/components/PreloadingString.ts | prerenderFinalStatusSpeculationRuleRemoved":{"message":"The prerendered page was unloaded because the initiating page removed the corresponding prerender rule from `;\n const extensions = [CodeMirror.html.html()];\n const state = CodeMirror.EditorState.create({doc, extensions});\n for (const name of ['bar', 'baz']) {\n const from = doc.indexOf(name);\n const to = from + name.length;\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/html', from),\n {from, to},\n `did not correct highlight '${name}'`,\n );\n }\n });\n\n it('correctly returns highlight range for variables in inline event handlers', () => {\n const doc = `\n`;\n const extensions = [CodeMirror.html.html()];\n const state = CodeMirror.EditorState.create({doc, extensions});\n for (const name of ['foo', 'bar', 'baz']) {\n const from = doc.indexOf(name);\n const to = from + name.length;\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/html', from),\n {from, to},\n `did not correct highlight '${name}'`,\n );\n }\n });\n });\n\n describe('in TSX files', () => {\n it('correctly returns highlight range for field accesses', () => {\n const doc = `function foo(obj: any): number {\n return obj.x + obj.y;\n}`;\n const extensions = [CodeMirror.javascript.tsxLanguage];\n const state = CodeMirror.EditorState.create({doc, extensions});\n for (const name of ['x', 'y']) {\n const pos = doc.lastIndexOf(name);\n const from = pos - 4;\n const to = pos + name.length;\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/typescript-jsx', pos),\n {from, to},\n `did not correct highlight '${name}'`,\n );\n }\n });\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"DebuggerPlugin.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/sources/DebuggerPlugin.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAG7B,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAE7C,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,SAAS,MAAM,uCAAuC,CAAC;AACnE,OAAO,KAAK,SAAS,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAC,YAAY,EAAE,uBAAuB,EAAC,MAAM,qCAAqC,CAAC;AAC1F,OAAO,EAAC,0BAA0B,EAAC,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAC,mBAAmB,EAAE,eAAe,EAAC,MAAM,iCAAiC,CAAC;AACrF,OAAO,KAAK,UAAU,MAAM,sDAAsD,CAAC;AACnF,OAAO,KAAK,UAAU,MAAM,gDAAgD,CAAC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,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Platform from '../../core/platform/platform.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport * as Protocol from '../../generated/protocol.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as TextUtils from '../../models/text_utils/text_utils.js';\nimport * as Workspace from '../../models/workspace/workspace.js';\nimport {createTarget, describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport {describeWithMockConnection} from '../../testing/MockConnection.js';\nimport {MockProtocolBackend, parseScopeChain} from '../../testing/MockScopeChain.js';\nimport * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';\nimport * as TextEditor from '../../ui/components/text_editor/text_editor.js';\n\nimport * as Sources from './sources.js';\n\ndescribeWithMockConnection('Inline variable view scope helpers', () => {\n const URL = 'file:///tmp/example.js' as Platform.DevToolsPath.UrlString;\n let target: SDK.Target.Target;\n let backend: MockProtocolBackend;\n\n beforeEach(() => {\n const workspace = Workspace.Workspace.WorkspaceImpl.instance();\n const targetManager = SDK.TargetManager.TargetManager.instance();\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance({\n forceNew: true,\n resourceMapping,\n targetManager,\n });\n Bindings.IgnoreListManager.IgnoreListManager.instance({forceNew: true, debuggerWorkspaceBinding});\n target = createTarget();\n backend = new MockProtocolBackend();\n });\n\n async function toOffsetWithSourceMap(\n sourceMap: SDK.SourceMap.SourceMap|undefined, location: SDK.DebuggerModel.Location|null) {\n if (!location || !sourceMap) {\n return null;\n }\n const entry = sourceMap.findEntry(location.lineNumber, location.columnNumber);\n if (!entry || !entry.sourceURL) {\n return null;\n }\n const content = sourceMap.embeddedContentByURL(entry.sourceURL);\n if (!content) {\n return null;\n }\n const text = new TextUtils.Text.Text(content);\n return text.offsetFromPosition(entry.sourceLineNumber, entry.sourceColumnNumber);\n }\n\n async function toOffset(source: string|null, location: SDK.DebuggerModel.Location|null) {\n if (!location || !source) {\n return null;\n }\n const text = new TextUtils.Text.Text(source);\n return text.offsetFromPosition(location.lineNumber, location.columnNumber);\n }\n\n it('can resolve single scope mappings with source map', async () => {\n const sourceMapUrl = 'file:///tmp/example.js.min.map';\n // This example was minified with terser v5.7.0 with following command.\n // 'terser index.js -m --toplevel -o example.min.js --source-map \"url=example.min.js.map,includeSources\"'\n const source = `function o(o,n){console.log(o,n)}o(1,2);\\n//# sourceMappingURL=${sourceMapUrl}`;\n const scopes = ' { }';\n\n // The original scopes below have to match with how the source map translates the scope, so it\n // does not align perfectly with the source language scopes. In principle, this test could only\n // assert that the tests are approximately correct; currently, we assert an exact match.\n const originalSource = 'function unminified(par1, par2) {\\n console.log(par1, par2);\\n}\\nunminified(1, 2);\\n';\n const originalScopes = ' { \\n \\n }';\n const expectedOffsets = parseScopeChain(originalScopes);\n\n const sourceMapContent = {\n 'version': 3,\n 'names': ['unminified', 'par1', 'par2', 'console', 'log'],\n 'sources': ['index.js'],\n 'sourcesContent': [originalSource],\n 'mappings': 'AAAA,SAASA,EAAWC,EAAMC,GACxBC,QAAQC,IAAIH,EAAMC,EACpB,CACAF,EAAW,EAAG',\n };\n const sourceMapJson = JSON.stringify(sourceMapContent);\n\n const scopeObject = backend.createSimpleRemoteObject([{name: 'o', value: 42}, {name: 'n', value: 1}]);\n const callFrame = await backend.createCallFrame(\n target, {url: URL, content: source}, scopes, {url: sourceMapUrl, content: sourceMapJson}, [scopeObject]);\n\n // Get source map for mapping locations to 'editor' offsets.\n const sourceMap = await callFrame.debuggerModel.sourceMapManager().sourceMapForClientPromise(callFrame.script);\n\n const scopeMappings =\n await Sources.DebuggerPlugin.computeScopeMappings(callFrame, l => toOffsetWithSourceMap(sourceMap, l));\n\n const text = new TextUtils.Text.Text(originalSource);\n assert.strictEqual(scopeMappings.length, 1);\n assert.strictEqual(\n scopeMappings[0].scopeStart,\n text.offsetFromPosition(expectedOffsets[0].startLine, expectedOffsets[0].startColumn));\n assert.strictEqual(\n scopeMappings[0].scopeEnd, text.offsetFromPosition(expectedOffsets[0].endLine, expectedOffsets[0].endColumn));\n assert.strictEqual(scopeMappings[0].variableMap.get('par1')?.value, 42);\n assert.strictEqual(scopeMappings[0].variableMap.get('par2')?.value, 1);\n });\n\n it('can resolve nested scope mappings with source map', async () => {\n const sourceMapUrl = 'file:///tmp/example.js.min.map';\n // This example was minified with terser v5.7.0 with following command.\n // 'terser index.js -m --toplevel -o example.min.js --source-map \"url=example.min.js.map,includeSources\"'\n const source =\n `function o(o){const n=console.log.bind(console);for(let c=0;c} ';\n\n const originalSource =\n 'function f(n) {\\n const c = console.log.bind(console);\\n for (let i = 0; i < n; i++) c(i);\\n}\\nf(10);\\n';\n const originalScopes =\n ' { \\n \\n < >\\n }';\n const expectedOffsets = parseScopeChain(originalScopes);\n\n const sourceMapContent = {\n 'version': 3,\n 'names': ['f', 'n', 'c', 'console', 'log', 'bind', 'i'],\n 'sources': ['index.js'],\n 'sourcesContent': [originalSource],\n 'mappings':\n 'AAAA,SAASA,EAAEC,GACT,MAAMC,EAAIC,QAAQC,IAAIC,KAAKF,SAC3B,IAAK,IAAIG,EAAI,EAAGA,EAAIL,EAAGK,IAAKJ,EAAEI,EAChC,CACAN,EAAE',\n };\n const sourceMapJson = JSON.stringify(sourceMapContent);\n\n const functionScopeObject = backend.createSimpleRemoteObject([{name: 'o', value: 10}, {name: 'n', value: 1234}]);\n const forScopeObject = backend.createSimpleRemoteObject([{name: 'c', value: 5}]);\n\n const callFrame = await backend.createCallFrame(\n target, {url: URL, content: source}, scopes, {url: sourceMapUrl, content: sourceMapJson},\n [forScopeObject, functionScopeObject]);\n\n // Get source map for mapping locations to 'editor' offsets.\n const sourceMap = await callFrame.debuggerModel.sourceMapManager().sourceMapForClientPromise(callFrame.script);\n\n const scopeMappings =\n await Sources.DebuggerPlugin.computeScopeMappings(callFrame, l => toOffsetWithSourceMap(sourceMap, l));\n\n const text = new TextUtils.Text.Text(originalSource);\n assert.strictEqual(scopeMappings.length, 2);\n assert.strictEqual(\n scopeMappings[0].scopeStart,\n text.offsetFromPosition(expectedOffsets[0].startLine, expectedOffsets[0].startColumn));\n assert.strictEqual(\n scopeMappings[0].scopeEnd, text.offsetFromPosition(expectedOffsets[0].endLine, expectedOffsets[0].endColumn));\n assert.strictEqual(scopeMappings[0].variableMap.get('i')?.value, 5);\n assert.strictEqual(scopeMappings[0].variableMap.size, 1);\n assert.strictEqual(\n scopeMappings[1].scopeStart,\n text.offsetFromPosition(expectedOffsets[1].startLine, expectedOffsets[1].startColumn));\n assert.strictEqual(\n scopeMappings[1].scopeEnd, text.offsetFromPosition(expectedOffsets[1].endLine, expectedOffsets[1].endColumn));\n assert.strictEqual(scopeMappings[1].variableMap.get('n')?.value, 10);\n assert.strictEqual(scopeMappings[1].variableMap.get('c')?.value, 1234);\n assert.strictEqual(scopeMappings[1].variableMap.size, 2);\n });\n\n it('can resolve simple scope mappings', async () => {\n const source = 'function f(a) { debugger } f(1)';\n const scopes = ' { }';\n const expectedOffsets = parseScopeChain(scopes);\n\n const functionScopeObject = backend.createSimpleRemoteObject([{name: 'a', value: 1}]);\n\n const callFrame =\n await backend.createCallFrame(target, {url: URL, content: source}, scopes, null, [functionScopeObject]);\n\n const scopeMappings = await Sources.DebuggerPlugin.computeScopeMappings(callFrame, l => toOffset(source, l));\n\n assert.strictEqual(scopeMappings.length, 1);\n assert.strictEqual(scopeMappings[0].scopeStart, expectedOffsets[0].startColumn);\n assert.strictEqual(scopeMappings[0].scopeEnd, expectedOffsets[0].endColumn);\n assert.strictEqual(scopeMappings[0].variableMap.get('a')?.value, 1);\n assert.strictEqual(scopeMappings[0].variableMap.size, 1);\n });\n\n it('can resolve nested scope mappings for block with no variables', async () => {\n const source = 'function f() { let a = 1; { debugger } } f()';\n const scopes = ' { < > }';\n const expectedOffsets = parseScopeChain(scopes);\n\n const functionScopeObject = backend.createSimpleRemoteObject([{name: 'a', value: 1}]);\n const blockScopeObject = backend.createSimpleRemoteObject([]);\n\n const callFrame = await backend.createCallFrame(\n target, {url: URL, content: source}, scopes, null, [blockScopeObject, functionScopeObject]);\n\n const scopeMappings = await Sources.DebuggerPlugin.computeScopeMappings(callFrame, l => toOffset(source, l));\n\n assert.strictEqual(scopeMappings.length, 2);\n assert.strictEqual(scopeMappings[0].scopeStart, expectedOffsets[0].startColumn);\n assert.strictEqual(scopeMappings[0].scopeEnd, expectedOffsets[0].endColumn);\n assert.strictEqual(scopeMappings[0].variableMap.size, 0);\n assert.strictEqual(scopeMappings[1].scopeStart, expectedOffsets[1].startColumn);\n assert.strictEqual(scopeMappings[1].scopeEnd, expectedOffsets[1].endColumn);\n assert.strictEqual(scopeMappings[1].variableMap.get('a')?.value, 1);\n assert.strictEqual(scopeMappings[1].variableMap.size, 1);\n });\n\n it('can resolve nested scope mappings for function with no variables', async () => {\n const source = 'function f() { console.log(\"Hi\"); { let a = 1; debugger } } f()';\n const scopes = ' { < > }';\n const expectedOffsets = parseScopeChain(scopes);\n\n const functionScopeObject = backend.createSimpleRemoteObject([]);\n const blockScopeObject = backend.createSimpleRemoteObject([{name: 'a', value: 1}]);\n\n const callFrame = await backend.createCallFrame(\n target, {url: URL, content: source}, scopes, null, [blockScopeObject, functionScopeObject]);\n\n const scopeMappings = await Sources.DebuggerPlugin.computeScopeMappings(callFrame, l => toOffset(source, l));\n\n assert.strictEqual(scopeMappings.length, 2);\n assert.strictEqual(scopeMappings[0].scopeStart, expectedOffsets[0].startColumn);\n assert.strictEqual(scopeMappings[0].scopeEnd, expectedOffsets[0].endColumn);\n assert.strictEqual(scopeMappings[0].variableMap.size, 1);\n assert.strictEqual(scopeMappings[0].variableMap.get('a')?.value, 1);\n assert.strictEqual(scopeMappings[1].scopeStart, expectedOffsets[1].startColumn);\n assert.strictEqual(scopeMappings[1].scopeEnd, expectedOffsets[1].endColumn);\n assert.strictEqual(scopeMappings[1].variableMap.size, 0);\n });\n});\n\nfunction makeState(doc: string, extensions: CodeMirror.Extension = []) {\n return CodeMirror.EditorState.create({\n doc,\n extensions: [\n extensions,\n TextEditor.Config.baseConfiguration(doc),\n TextEditor.Config.autocompletion.instance(),\n ],\n });\n}\n\ndescribeWithEnvironment('Inline variable view parser', () => {\n it('parses simple identifier', () => {\n const state = makeState('c', CodeMirror.javascript.javascriptLanguage);\n const variables = Sources.DebuggerPlugin.getVariableNamesByLine(state, 0, 1, 1);\n assert.deepEqual(variables, [{line: 0, from: 0, id: 'c'}]);\n });\n\n it('parses simple function', () => {\n const code = `function f(o) {\n let a = 1;\n debugger;\n }`;\n const state = makeState(code, CodeMirror.javascript.javascriptLanguage);\n const variables = Sources.DebuggerPlugin.getVariableNamesByLine(state, 10, code.length, code.indexOf('debugger'));\n assert.deepEqual(variables, [{line: 0, from: 11, id: 'o'}, {line: 1, from: 26, id: 'a'}]);\n });\n\n it('parses patterns', () => {\n const code = `function f(o) {\n let {x: a, y: [b, c]} = {x: o, y: [1, 2]};\n console.log(a + b + c);\n debugger;\n }`;\n const state = makeState(code, CodeMirror.javascript.javascriptLanguage);\n const variables = Sources.DebuggerPlugin.getVariableNamesByLine(state, 10, code.length, code.indexOf('debugger'));\n assert.deepEqual(variables, [\n {line: 0, from: 11, id: 'o'},\n {line: 1, from: 30, id: 'a'},\n {line: 1, from: 37, id: 'b'},\n {line: 1, from: 40, id: 'c'},\n {line: 1, from: 50, id: 'o'},\n {line: 2, from: 71, id: 'console'},\n {line: 2, from: 83, id: 'a'},\n {line: 2, from: 87, id: 'b'},\n {line: 2, from: 91, id: 'c'},\n ]);\n });\n\n it('parses function with nested block', () => {\n const code = `function f(o) {\n let a = 1;\n {\n let a = 2;\n debugger;\n }\n }`;\n const state = makeState(code, CodeMirror.javascript.javascriptLanguage);\n const variables = Sources.DebuggerPlugin.getVariableNamesByLine(state, 10, code.length, code.indexOf('debugger'));\n assert.deepEqual(\n variables, [{line: 0, from: 11, id: 'o'}, {line: 1, from: 26, id: 'a'}, {line: 3, from: 53, id: 'a'}]);\n });\n\n it('parses function variable, ignores shadowing let in sibling block', () => {\n const code = `function f(o) {\n let a = 1;\n {\n let a = 2;\n console.log(a);\n }\n debugger;\n }`;\n const state = makeState(code, CodeMirror.javascript.javascriptLanguage);\n const variables = Sources.DebuggerPlugin.getVariableNamesByLine(state, 10, code.length, code.indexOf('debugger'));\n assert.deepEqual(\n variables, [{line: 0, from: 11, id: 'o'}, {line: 1, from: 26, id: 'a'}, {line: 4, from: 68, id: 'console'}]);\n });\n\n it('parses function variable, ignores shadowing const in sibling block', () => {\n const code = `function f(o) {\n let a = 1;\n {\n const a = 2;\n console.log(a);\n }\n debugger;\n }`;\n const state = makeState(code, CodeMirror.javascript.javascriptLanguage);\n const variables = Sources.DebuggerPlugin.getVariableNamesByLine(state, 10, code.length, code.indexOf('debugger'));\n assert.deepEqual(\n variables, [{line: 0, from: 11, id: 'o'}, {line: 1, from: 26, id: 'a'}, {line: 4, from: 70, id: 'console'}]);\n });\n\n it('parses function variable, ignores shadowing typed const in sibling block', () => {\n const code = `function f(o) {\n let a: number = 1;\n {\n const a: number = 2;\n console.log(a);\n }\n debugger;\n }`;\n const state = makeState(code, CodeMirror.javascript.javascriptLanguage);\n const variables = Sources.DebuggerPlugin.getVariableNamesByLine(state, 10, code.length, code.indexOf('debugger'));\n assert.deepEqual(\n variables, [{line: 0, from: 11, id: 'o'}, {line: 1, from: 26, id: 'a'}, {line: 4, from: 86, id: 'console'}]);\n });\n\n it('parses function variable, reports all vars', () => {\n const code = `function f(o) {\n var a = 1;\n {\n var a = 2;\n console.log(a);\n }\n debugger;\n }`;\n const state = makeState(code, CodeMirror.javascript.javascriptLanguage);\n const variables = Sources.DebuggerPlugin.getVariableNamesByLine(state, 10, code.length, code.indexOf('debugger'));\n assert.deepEqual(variables, [\n {line: 0, from: 11, id: 'o'},\n {line: 1, from: 26, id: 'a'},\n {line: 3, from: 53, id: 'a'},\n {line: 4, from: 68, id: 'console'},\n {line: 4, from: 80, id: 'a'},\n ]);\n });\n\n it('parses function variable, handles shadowing in doubly nested scopes', () => {\n const code = `function f() {\n let a = 1;\n let b = 2;\n let c = 3;\n {\n let b;\n {\n const c = 4;\n b = 5;\n console.log(c);\n }\n console.log(c);\n }\n debugger;\n }`;\n const state = makeState(code, CodeMirror.javascript.javascriptLanguage);\n const variables = Sources.DebuggerPlugin.getVariableNamesByLine(state, 10, code.length, code.indexOf('debugger'));\n assert.deepEqual(variables, [\n {line: 1, from: 25, id: 'a'},\n {line: 2, from: 42, id: 'b'},\n {line: 3, from: 59, id: 'c'},\n {line: 9, from: 149, id: 'console'},\n {line: 11, from: 183, id: 'console'},\n {line: 11, from: 195, id: 'c'},\n ]);\n });\n\n it('parses function variable, handles shadowing with object pattern', () => {\n const code = `function f() {\n let a = 1;\n {\n let {x: b, y: a} = {x: 1, y: 2};\n console.log(a + b);\n }\n console.log(a);\n debugger;\n }`;\n const state = makeState(code, CodeMirror.javascript.javascriptLanguage);\n const variables = Sources.DebuggerPlugin.getVariableNamesByLine(state, 10, code.length, code.indexOf('debugger'));\n assert.deepEqual(variables, [\n {line: 1, from: 25, id: 'a'},\n {line: 4, from: 89, id: 'console'},\n {line: 6, from: 123, id: 'console'},\n {line: 6, from: 135, id: 'a'},\n ]);\n });\n\n it('parses function variable, handles shadowing with array pattern', () => {\n const code = `function f() {\n let a = 1;\n {\n const [b, a] = [1, 2];\n console.log(a + b);\n }\n console.log(a);\n debugger;\n }`;\n const state = makeState(code, CodeMirror.javascript.javascriptLanguage);\n const variables = Sources.DebuggerPlugin.getVariableNamesByLine(state, 10, code.length, code.indexOf('debugger'));\n assert.deepEqual(variables, [\n {line: 1, from: 25, id: 'a'},\n {line: 4, from: 79, id: 'console'},\n {line: 6, from: 113, id: 'console'},\n {line: 6, from: 125, id: 'a'},\n ]);\n });\n});\n\ndescribeWithEnvironment('Inline variable view scope value resolution', () => {\n it('resolves single variable in single scope', () => {\n const value42 = {type: Protocol.Runtime.RemoteObjectType.Number, value: 42} as SDK.RemoteObject.RemoteObject;\n const scopeMappings = [{scopeStart: 0, scopeEnd: 10, variableMap: new Map([['a', value42]])}];\n const variableNames = [{line: 3, from: 5, id: 'a'}];\n const valuesByLine = Sources.DebuggerPlugin.getVariableValuesByLine(scopeMappings, variableNames);\n\n assert.strictEqual(valuesByLine?.size, 1);\n assert.strictEqual(valuesByLine?.get(3)?.size, 1);\n assert.strictEqual(valuesByLine?.get(3)?.get('a')?.value, 42);\n });\n\n it('resolves shadowed variables', () => {\n const value1 = {type: Protocol.Runtime.RemoteObjectType.Number, value: 1} as SDK.RemoteObject.RemoteObject;\n const value2 = {type: Protocol.Runtime.RemoteObjectType.Number, value: 2} as SDK.RemoteObject.RemoteObject;\n const scopeMappings = [\n {scopeStart: 10, scopeEnd: 20, variableMap: new Map([['a', value1]])},\n {scopeStart: 0, scopeEnd: 30, variableMap: new Map([['a', value2]])},\n ];\n const variableNames = [\n {line: 0, from: 5, id: 'a'}, // Falls into the outer scope.\n {line: 10, from: 15, id: 'a'}, // Inner scope.\n {line: 20, from: 25, id: 'a'}, // Outer scope.\n {line: 30, from: 35, id: 'a'}, // Outside of any scope.\n ];\n const valuesByLine = Sources.DebuggerPlugin.getVariableValuesByLine(scopeMappings, variableNames);\n\n assert.strictEqual(valuesByLine?.size, 3);\n assert.strictEqual(valuesByLine?.get(0)?.size, 1);\n assert.strictEqual(valuesByLine?.get(0)?.get('a')?.value, 2);\n assert.strictEqual(valuesByLine?.get(10)?.size, 1);\n assert.strictEqual(valuesByLine?.get(10)?.get('a')?.value, 1);\n assert.strictEqual(valuesByLine?.get(20)?.size, 1);\n assert.strictEqual(valuesByLine?.get(20)?.get('a')?.value, 2);\n });\n\n it('resolves multiple variables on the same line', () => {\n const value1 = {type: Protocol.Runtime.RemoteObjectType.Number, value: 1} as SDK.RemoteObject.RemoteObject;\n const value2 = {type: Protocol.Runtime.RemoteObjectType.Number, value: 2} as SDK.RemoteObject.RemoteObject;\n const scopeMappings = [{scopeStart: 10, scopeEnd: 20, variableMap: new Map([['a', value1], ['b', value2]])}];\n const variableNames = [\n {line: 10, from: 11, id: 'a'},\n {line: 10, from: 13, id: 'b'},\n {line: 10, from: 15, id: 'a'},\n ];\n const valuesByLine = Sources.DebuggerPlugin.getVariableValuesByLine(scopeMappings, variableNames);\n\n assert.strictEqual(valuesByLine?.size, 1);\n assert.strictEqual(valuesByLine?.get(10)?.size, 2);\n assert.strictEqual(valuesByLine?.get(10)?.get('a')?.value, 1);\n assert.strictEqual(valuesByLine?.get(10)?.get('b')?.value, 2);\n });\n});\n\ndescribe('DebuggerPlugin', () => {\n describe('computeExecutionDecorations', () => {\n const {computeExecutionDecorations} = Sources.DebuggerPlugin;\n const extensions = [CodeMirror.javascript.javascript()];\n\n it('correctly returns no decorations when line is outside of the document', () => {\n const doc = 'console.log(\"Hello World!\");';\n const state = CodeMirror.EditorState.create({doc, extensions});\n const decorations = computeExecutionDecorations(state, 1, 0);\n assert.strictEqual(decorations.size, 0, 'Expected to have no decorations');\n });\n\n it('correctly returns line and token decorations', () => {\n const doc = 'function foo() {\\n debugger;\\n }';\n const state = CodeMirror.EditorState.create({doc, extensions});\n const decorations = computeExecutionDecorations(state, 1, 2);\n assert.strictEqual(decorations.size, 2, 'Expected to have execution line and token decoration');\n });\n\n it('correctly returns line and token decorations even for long documents', () => {\n const doc = 'console.log(\"Hello World!\");\\n'.repeat(10_000);\n const state = CodeMirror.EditorState.create({doc, extensions});\n const decorations = computeExecutionDecorations(state, 9_998, 0);\n assert.strictEqual(decorations.size, 2, 'Expected to have execution line and token decoration');\n });\n\n it('correctly returns line decorations for documents that don\\'t have syntax highlighting', () => {\n const doc = `\n\n`;\n const state = CodeMirror.EditorState.create({doc});\n const decorations = computeExecutionDecorations(state, 1, 0);\n assert.strictEqual(decorations.size, 1, 'Expected to have execution line decoration');\n });\n });\n\n describe('computePopoverHighlightRange', () => {\n const {computePopoverHighlightRange} = Sources.DebuggerPlugin;\n\n it('correctly returns highlight range depending on cursor position and selection', () => {\n const doc = 'Hello World!';\n const selection = CodeMirror.EditorSelection.create([\n CodeMirror.EditorSelection.range(2, 5),\n ]);\n const state = CodeMirror.EditorState.create({doc, selection});\n assert.isNull(computePopoverHighlightRange(state, 'text/plain', 0));\n assert.deepInclude(computePopoverHighlightRange(state, 'text/plain', 2), {from: 2, to: 5});\n assert.deepInclude(computePopoverHighlightRange(state, 'text/plain', 5), {from: 2, to: 5});\n assert.isNull(computePopoverHighlightRange(state, 'text/plain', 10));\n assert.isNull(computePopoverHighlightRange(state, 'text/plain', doc.length - 1));\n });\n\n describe('in JavaScript files', () => {\n const extensions = [CodeMirror.javascript.javascript()];\n\n it('correctly returns highlight range for member assignments', () => {\n const doc = 'obj.foo = 42;';\n const state = CodeMirror.EditorState.create({doc, extensions});\n\n assert.deepInclude(computePopoverHighlightRange(state, 'text/javascript', 0), {from: 0, to: 3});\n assert.deepInclude(computePopoverHighlightRange(state, 'text/javascript', 4), {from: 0, to: 7});\n });\n\n it('correctly returns highlight range for member assignments involving `this`', () => {\n const doc = 'this.x = bar;';\n const state = CodeMirror.EditorState.create({doc, extensions});\n\n assert.deepInclude(computePopoverHighlightRange(state, 'text/javascript', 0), {from: 0, to: 4});\n assert.deepInclude(computePopoverHighlightRange(state, 'text/javascript', 5), {from: 0, to: 6});\n });\n\n it('correctly reports function calls as potentially side-effecting', () => {\n const doc = 'getRandomCoffee().name';\n const state = CodeMirror.EditorState.create({doc, extensions});\n\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('getRandomCoffee')),\n {containsSideEffects: false},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.lastIndexOf('.')),\n {containsSideEffects: true},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('name')),\n {containsSideEffects: true},\n );\n });\n\n it('correctly reports method calls as potentially side-effecting', () => {\n const doc = 'utils.getRandomCoffee().name';\n const state = CodeMirror.EditorState.create({doc, extensions});\n\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('utils')),\n {containsSideEffects: false},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('getRandomCoffee')),\n {containsSideEffects: false},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.lastIndexOf('.')),\n {containsSideEffects: true},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('name')),\n {containsSideEffects: true},\n );\n });\n\n it('correctly reports function calls in property accesses as potentially side-effecting', () => {\n const doc = 'bar[foo()]';\n const state = CodeMirror.EditorState.create({doc, extensions});\n\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('bar')),\n {containsSideEffects: false, from: 0, to: 'bar'.length},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('[')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf(']')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n });\n\n it('correct reports postfix increments in property accesses as potentially side-effecting', () => {\n const doc = 'a[i++]';\n const state = CodeMirror.EditorState.create({doc, extensions});\n\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('[')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf(']')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n });\n\n it('correctly reports postfix decrements in property accesses as potentially side-effecting', () => {\n const doc = 'a[i--]';\n const state = CodeMirror.EditorState.create({doc, extensions});\n\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('[')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf(']')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n });\n\n it('correctly reports prefix increments in property accesses as potentially side-effecting', () => {\n const doc = 'array[++index]';\n const state = CodeMirror.EditorState.create({doc, extensions});\n\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('[')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf(']')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n });\n\n it('correctly reports prefix decrements in property accesses as potentially side-effecting', () => {\n const doc = 'array[--index]';\n const state = CodeMirror.EditorState.create({doc, extensions});\n\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('[')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf(']')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n });\n\n it('correctly reports assignment expressions in property accesses as potentially side-effecting', () => {\n const doc = 'array[index *= 5]';\n const state = CodeMirror.EditorState.create({doc, extensions});\n\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf('[')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', doc.indexOf(']')),\n {containsSideEffects: true, from: 0, to: doc.length},\n );\n });\n\n it('correctly reports potential side-effects within a larger script', () => {\n const doc = `var a = new Array();\nvar i = 0;\na[i++];\na[i--];\na[++i];\na[--i];\na[i *= 5];\na[foo()];`;\n const state = CodeMirror.EditorState.create({doc, extensions});\n\n for (let offset = 0; (offset = doc.indexOf('a[', offset) + 1) !== 0;) {\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/javascript', offset),\n {containsSideEffects: true},\n );\n }\n });\n });\n\n describe('in HTML files', () => {\n it('correctly returns highlight range for variables in inline `;\n const extensions = [CodeMirror.html.html()];\n const state = CodeMirror.EditorState.create({doc, extensions});\n for (const name of ['bar', 'baz']) {\n const from = doc.indexOf(name);\n const to = from + name.length;\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/html', from),\n {from, to},\n `did not correct highlight '${name}'`,\n );\n }\n });\n\n it('correctly returns highlight range for variables in inline event handlers', () => {\n const doc = `\n`;\n const extensions = [CodeMirror.html.html()];\n const state = CodeMirror.EditorState.create({doc, extensions});\n for (const name of ['foo', 'bar', 'baz']) {\n const from = doc.indexOf(name);\n const to = from + name.length;\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/html', from),\n {from, to},\n `did not correct highlight '${name}'`,\n );\n }\n });\n });\n\n describe('in TSX files', () => {\n it('correctly returns highlight range for field accesses', () => {\n const doc = `function foo(obj: any): number {\n return obj.x + obj.y;\n}`;\n const extensions = [CodeMirror.javascript.tsxLanguage];\n const state = CodeMirror.EditorState.create({doc, extensions});\n for (const name of ['x', 'y']) {\n const pos = doc.lastIndexOf(name);\n const from = pos - 4;\n const to = pos + name.length;\n assert.deepInclude(\n computePopoverHighlightRange(state, 'text/typescript-jsx', pos),\n {from, to},\n `did not correct highlight '${name}'`,\n );\n }\n });\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/Breadcrumbs.test.js b/public/panels/timeline/Breadcrumbs.test.js index 4282579aa..61f10a332 100644 --- a/public/panels/timeline/Breadcrumbs.test.js +++ b/public/panels/timeline/Breadcrumbs.test.js @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import * as TraceEngine from '../../models/trace/trace.js'; +import * as TraceBounds from '../../services/trace_bounds/trace_bounds.js'; import * as TimelineComponents from './components/components.js'; describe('Timeline breadcrumbs', () => { it('can create breadcrumbs', () => { @@ -71,7 +72,7 @@ describe('Timeline breadcrumbs', () => { }; assert.deepEqual(TimelineComponents.Breadcrumbs.flattenBreadcrumbs(initialBreadcrumb), [initialBreadcrumb, breadcrumb1, breadcrumb2]); assert.deepEqual(crumbs.lastBreadcrumb, breadcrumb2); - crumbs.makeBreadcrumbActive(breadcrumb1); + crumbs.setLastBreadcrumb(breadcrumb1); breadcrumb1.child = null; assert.deepEqual(TimelineComponents.Breadcrumbs.flattenBreadcrumbs(initialBreadcrumb), [initialBreadcrumb, breadcrumb1]); assert.deepEqual(crumbs.lastBreadcrumb, breadcrumb1); @@ -126,5 +127,46 @@ describe('Timeline breadcrumbs', () => { assert.deepEqual(TimelineComponents.Breadcrumbs.flattenBreadcrumbs(initialBreadcrumb), [initialBreadcrumb, breadcrumb1, breadcrumb2]); assert.deepEqual(crumbs.lastBreadcrumb, breadcrumb2); }); + it('correctly sets the last breadrumb and trace bound window when a new initial breadcrumb is provided', () => { + const initialTraceWindow = { + min: TraceEngine.Types.Timing.MicroSeconds(1000), + max: TraceEngine.Types.Timing.MicroSeconds(10000), + range: TraceEngine.Types.Timing.MicroSeconds(9000), + }; + const crumbs = new TimelineComponents.Breadcrumbs.Breadcrumbs(initialTraceWindow); + const traceWindow1 = { + min: TraceEngine.Types.Timing.MicroSeconds(1000), + max: TraceEngine.Types.Timing.MicroSeconds(9000), + range: TraceEngine.Types.Timing.MicroSeconds(8000), + }; + const traceWindow2 = { + min: TraceEngine.Types.Timing.MicroSeconds(3000), + max: TraceEngine.Types.Timing.MicroSeconds(9000), + range: TraceEngine.Types.Timing.MicroSeconds(6000), + }; + const breadcrumb2 = { + window: traceWindow2, + child: null, + }; + const breadcrumb1 = { + window: traceWindow1, + child: breadcrumb2, + }; + const initialBreadcrumb = { + window: initialTraceWindow, + child: breadcrumb1, + }; + crumbs.setInitialBreadcrumbFromLoadedAnnotations(initialBreadcrumb); + assert.deepEqual(TimelineComponents.Breadcrumbs.flattenBreadcrumbs(initialBreadcrumb), [initialBreadcrumb, breadcrumb1, breadcrumb2]); + assert.deepEqual(crumbs.lastBreadcrumb, breadcrumb2); + // Make sure the trace bounds were correctly set to the last breadcrumb bounds + assert.deepEqual(TraceBounds.TraceBounds.BoundsManager.instance().state()?.micro.minimapTraceBounds.min, 3000); + assert.deepEqual(TraceBounds.TraceBounds.BoundsManager.instance().state()?.micro.minimapTraceBounds.max, 9000); + assert.deepEqual(TraceBounds.TraceBounds.BoundsManager.instance().state()?.micro.minimapTraceBounds.range, 6000); + // Make sure the TimelineVisibleWindow was correctly set to the last breadcrumb bounds + assert.deepEqual(TraceBounds.TraceBounds.BoundsManager.instance().state()?.micro.timelineTraceWindow.min, 3000); + assert.deepEqual(TraceBounds.TraceBounds.BoundsManager.instance().state()?.micro.timelineTraceWindow.max, 9000); + assert.deepEqual(TraceBounds.TraceBounds.BoundsManager.instance().state()?.micro.timelineTraceWindow.range, 6000); + }); }); //# sourceMappingURL=Breadcrumbs.test.js.map \ No newline at end of file diff --git a/public/panels/timeline/Breadcrumbs.test.js.map b/public/panels/timeline/Breadcrumbs.test.js.map index 869db6bee..a9097800f 100644 --- a/public/panels/timeline/Breadcrumbs.test.js.map +++ b/public/panels/timeline/Breadcrumbs.test.js.map @@ -1 +1 @@ -{"version":3,"file":"Breadcrumbs.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/Breadcrumbs.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAE3D,OAAO,KAAK,kBAAkB,MAAM,4BAA4B,CAAC;AAEjE,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;QAChC,MAAM,kBAAkB,GAAqD;YAC3E,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;YAC7C,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;YAC9C,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;SAChD,CAAC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F,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACzB,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAEzB,MAAM,WAAW,GAA8C;YAC7D,MAAM,EAAE,YAAY;YACpB,KAAK,EAAE,IAAI;SACZ,CAAC;QAEF,MAAM,WAAW,GAA8C;YAC7D,MAAM,EAAE,YAAY;YACpB,KAAK,EAAE,WAAW;SACnB,CAAC;QAEF,MAAM,iBAAiB,GAA8C;YACnE,MAAM,EAAE,kBAAkB;YAC1B,KAAK,EAAE,WAAW;SACnB,CAAC;QAEF,MAAM,CAAC,SAAS,CACZ,kBAAkB,CAAC,WAAW,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,EACpE,CAAC,iBAAiB,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;QACnD,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as TraceEngine from '../../models/trace/trace.js';\n\nimport * as TimelineComponents from './components/components.js';\n\ndescribe('Timeline breadcrumbs', () => {\n it('can create breadcrumbs', () => {\n const initialTraceWindow: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(1),\n max: TraceEngine.Types.Timing.MicroSeconds(10),\n range: TraceEngine.Types.Timing.MicroSeconds(9),\n };\n\n const crumbs = new TimelineComponents.Breadcrumbs.Breadcrumbs(initialTraceWindow);\n\n const traceWindow1: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(3),\n max: TraceEngine.Types.Timing.MicroSeconds(9),\n range: TraceEngine.Types.Timing.MicroSeconds(6),\n };\n\n const traceWindow2: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(4),\n max: TraceEngine.Types.Timing.MicroSeconds(6),\n range: TraceEngine.Types.Timing.MicroSeconds(2),\n };\n\n crumbs.add(traceWindow1);\n crumbs.add(traceWindow2);\n\n const breadcrumb2: TimelineComponents.Breadcrumbs.Breadcrumb = {\n window: traceWindow2,\n child: null,\n };\n\n const breadcrumb1: TimelineComponents.Breadcrumbs.Breadcrumb = {\n window: traceWindow1,\n child: breadcrumb2,\n };\n\n const initialBreadcrumb: TimelineComponents.Breadcrumbs.Breadcrumb = {\n window: initialTraceWindow,\n child: breadcrumb1,\n };\n\n assert.deepEqual(\n TimelineComponents.Breadcrumbs.flattenBreadcrumbs(initialBreadcrumb),\n [initialBreadcrumb, breadcrumb1, breadcrumb2]);\n\n assert.deepEqual(crumbs.lastBreadcrumb, breadcrumb2);\n });\n\n it('can remove breadcrumbs', () => {\n const initialTraceWindow: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(1),\n max: TraceEngine.Types.Timing.MicroSeconds(10),\n range: TraceEngine.Types.Timing.MicroSeconds(9),\n };\n\n const crumbs = new TimelineComponents.Breadcrumbs.Breadcrumbs(initialTraceWindow);\n\n const traceWindow1: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(3),\n max: TraceEngine.Types.Timing.MicroSeconds(9),\n range: TraceEngine.Types.Timing.MicroSeconds(6),\n };\n\n const traceWindow2: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(4),\n max: TraceEngine.Types.Timing.MicroSeconds(6),\n range: TraceEngine.Types.Timing.MicroSeconds(2),\n };\n\n crumbs.add(traceWindow1);\n crumbs.add(traceWindow2);\n\n const breadcrumb2: TimelineComponents.Breadcrumbs.Breadcrumb = {\n window: traceWindow2,\n child: null,\n };\n\n const breadcrumb1: TimelineComponents.Breadcrumbs.Breadcrumb = {\n window: traceWindow1,\n child: breadcrumb2,\n };\n\n const initialBreadcrumb: TimelineComponents.Breadcrumbs.Breadcrumb = {\n window: initialTraceWindow,\n child: breadcrumb1,\n };\n\n assert.deepEqual(\n TimelineComponents.Breadcrumbs.flattenBreadcrumbs(initialBreadcrumb),\n [initialBreadcrumb, breadcrumb1, breadcrumb2]);\n assert.deepEqual(crumbs.lastBreadcrumb, breadcrumb2);\n crumbs.makeBreadcrumbActive(breadcrumb1);\n\n breadcrumb1.child = null;\n\n assert.deepEqual(\n TimelineComponents.Breadcrumbs.flattenBreadcrumbs(initialBreadcrumb), [initialBreadcrumb, breadcrumb1]);\n assert.deepEqual(crumbs.lastBreadcrumb, breadcrumb1);\n });\n\n it('can not create a breadcrumb equal to the parent breadcrumb', () => {\n assert.throws(() => {\n const initialTraceWindow: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(1),\n max: TraceEngine.Types.Timing.MicroSeconds(10),\n range: TraceEngine.Types.Timing.MicroSeconds(9),\n };\n\n const crumbs = new TimelineComponents.Breadcrumbs.Breadcrumbs(initialTraceWindow);\n\n const traceWindow1: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(1),\n max: TraceEngine.Types.Timing.MicroSeconds(10),\n range: TraceEngine.Types.Timing.MicroSeconds(9),\n };\n\n crumbs.add(traceWindow1);\n }, 'Can not add a breadcrumb that is equal to or is outside of the parent breadcrumb TimeWindow');\n });\n\n it('can create breadcrumbs with equal start or end as the parent breadcrumb', () => {\n const initialTraceWindow: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(1),\n max: TraceEngine.Types.Timing.MicroSeconds(10),\n range: TraceEngine.Types.Timing.MicroSeconds(9),\n };\n\n const crumbs = new TimelineComponents.Breadcrumbs.Breadcrumbs(initialTraceWindow);\n\n const traceWindow1: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(1),\n max: TraceEngine.Types.Timing.MicroSeconds(9),\n range: TraceEngine.Types.Timing.MicroSeconds(8),\n };\n\n const traceWindow2: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(3),\n max: TraceEngine.Types.Timing.MicroSeconds(9),\n range: TraceEngine.Types.Timing.MicroSeconds(6),\n };\n\n crumbs.add(traceWindow1);\n crumbs.add(traceWindow2);\n\n const breadcrumb2: TimelineComponents.Breadcrumbs.Breadcrumb = {\n window: traceWindow2,\n child: null,\n };\n\n const breadcrumb1: TimelineComponents.Breadcrumbs.Breadcrumb = {\n window: traceWindow1,\n child: breadcrumb2,\n };\n\n const initialBreadcrumb: TimelineComponents.Breadcrumbs.Breadcrumb = {\n window: initialTraceWindow,\n child: breadcrumb1,\n };\n\n assert.deepEqual(\n TimelineComponents.Breadcrumbs.flattenBreadcrumbs(initialBreadcrumb),\n [initialBreadcrumb, breadcrumb1, breadcrumb2]);\n assert.deepEqual(crumbs.lastBreadcrumb, breadcrumb2);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"Breadcrumbs.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/Breadcrumbs.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAE3E,OAAO,KAAK,kBAAkB,MAAM,4BAA4B,CAAC;AAEjE,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;QAChC,MAAM,kBAAkB,GAAqD;YAC3E,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;YAC7C,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,YAA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KAAK,EAAE,EAAE,KAAK,CAAC,kBAAkB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC/G,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,KAAK,CAAC,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAEjH,sFAAsF;QACtF,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,KAAK,CAAC,mBAAmB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAChH,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,KAAK,CAAC,mBAAmB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAChH,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,KAAK,CAAC,mBAAmB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACpH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as TraceEngine from '../../models/trace/trace.js';\nimport * as TraceBounds from '../../services/trace_bounds/trace_bounds.js';\n\nimport * as TimelineComponents from './components/components.js';\n\ndescribe('Timeline breadcrumbs', () => {\n it('can create breadcrumbs', () => {\n const initialTraceWindow: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(1),\n max: TraceEngine.Types.Timing.MicroSeconds(10),\n range: TraceEngine.Types.Timing.MicroSeconds(9),\n };\n\n const crumbs = new TimelineComponents.Breadcrumbs.Breadcrumbs(initialTraceWindow);\n\n const traceWindow1: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(3),\n max: TraceEngine.Types.Timing.MicroSeconds(9),\n range: TraceEngine.Types.Timing.MicroSeconds(6),\n };\n\n const traceWindow2: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(4),\n max: TraceEngine.Types.Timing.MicroSeconds(6),\n range: TraceEngine.Types.Timing.MicroSeconds(2),\n };\n\n crumbs.add(traceWindow1);\n crumbs.add(traceWindow2);\n\n const breadcrumb2: TraceEngine.Types.File.Breadcrumb = {\n window: traceWindow2,\n child: null,\n };\n\n const breadcrumb1: TraceEngine.Types.File.Breadcrumb = {\n window: traceWindow1,\n child: breadcrumb2,\n };\n\n const initialBreadcrumb: TraceEngine.Types.File.Breadcrumb = {\n window: initialTraceWindow,\n child: breadcrumb1,\n };\n\n assert.deepEqual(\n TimelineComponents.Breadcrumbs.flattenBreadcrumbs(initialBreadcrumb),\n [initialBreadcrumb, breadcrumb1, breadcrumb2]);\n\n assert.deepEqual(crumbs.lastBreadcrumb, breadcrumb2);\n });\n\n it('can remove breadcrumbs', () => {\n const initialTraceWindow: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(1),\n max: TraceEngine.Types.Timing.MicroSeconds(10),\n range: TraceEngine.Types.Timing.MicroSeconds(9),\n };\n\n const crumbs = new TimelineComponents.Breadcrumbs.Breadcrumbs(initialTraceWindow);\n\n const traceWindow1: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(3),\n max: TraceEngine.Types.Timing.MicroSeconds(9),\n range: TraceEngine.Types.Timing.MicroSeconds(6),\n };\n\n const traceWindow2: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(4),\n max: TraceEngine.Types.Timing.MicroSeconds(6),\n range: TraceEngine.Types.Timing.MicroSeconds(2),\n };\n\n crumbs.add(traceWindow1);\n crumbs.add(traceWindow2);\n\n const breadcrumb2: TraceEngine.Types.File.Breadcrumb = {\n window: traceWindow2,\n child: null,\n };\n\n const breadcrumb1: TraceEngine.Types.File.Breadcrumb = {\n window: traceWindow1,\n child: breadcrumb2,\n };\n\n const initialBreadcrumb: TraceEngine.Types.File.Breadcrumb = {\n window: initialTraceWindow,\n child: breadcrumb1,\n };\n\n assert.deepEqual(\n TimelineComponents.Breadcrumbs.flattenBreadcrumbs(initialBreadcrumb),\n [initialBreadcrumb, breadcrumb1, breadcrumb2]);\n assert.deepEqual(crumbs.lastBreadcrumb, breadcrumb2);\n crumbs.setLastBreadcrumb(breadcrumb1);\n\n breadcrumb1.child = null;\n\n assert.deepEqual(\n TimelineComponents.Breadcrumbs.flattenBreadcrumbs(initialBreadcrumb), [initialBreadcrumb, breadcrumb1]);\n assert.deepEqual(crumbs.lastBreadcrumb, breadcrumb1);\n });\n\n it('can not create a breadcrumb equal to the parent breadcrumb', () => {\n assert.throws(() => {\n const initialTraceWindow: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(1),\n max: TraceEngine.Types.Timing.MicroSeconds(10),\n range: TraceEngine.Types.Timing.MicroSeconds(9),\n };\n\n const crumbs = new TimelineComponents.Breadcrumbs.Breadcrumbs(initialTraceWindow);\n\n const traceWindow1: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(1),\n max: TraceEngine.Types.Timing.MicroSeconds(10),\n range: TraceEngine.Types.Timing.MicroSeconds(9),\n };\n\n crumbs.add(traceWindow1);\n }, 'Can not add a breadcrumb that is equal to or is outside of the parent breadcrumb TimeWindow');\n });\n\n it('can create breadcrumbs with equal start or end as the parent breadcrumb', () => {\n const initialTraceWindow: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(1),\n max: TraceEngine.Types.Timing.MicroSeconds(10),\n range: TraceEngine.Types.Timing.MicroSeconds(9),\n };\n\n const crumbs = new TimelineComponents.Breadcrumbs.Breadcrumbs(initialTraceWindow);\n\n const traceWindow1: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(1),\n max: TraceEngine.Types.Timing.MicroSeconds(9),\n range: TraceEngine.Types.Timing.MicroSeconds(8),\n };\n\n const traceWindow2: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(3),\n max: TraceEngine.Types.Timing.MicroSeconds(9),\n range: TraceEngine.Types.Timing.MicroSeconds(6),\n };\n\n crumbs.add(traceWindow1);\n crumbs.add(traceWindow2);\n\n const breadcrumb2: TraceEngine.Types.File.Breadcrumb = {\n window: traceWindow2,\n child: null,\n };\n\n const breadcrumb1: TraceEngine.Types.File.Breadcrumb = {\n window: traceWindow1,\n child: breadcrumb2,\n };\n\n const initialBreadcrumb: TraceEngine.Types.File.Breadcrumb = {\n window: initialTraceWindow,\n child: breadcrumb1,\n };\n\n assert.deepEqual(\n TimelineComponents.Breadcrumbs.flattenBreadcrumbs(initialBreadcrumb),\n [initialBreadcrumb, breadcrumb1, breadcrumb2]);\n assert.deepEqual(crumbs.lastBreadcrumb, breadcrumb2);\n });\n\n it('correctly sets the last breadrumb and trace bound window when a new initial breadcrumb is provided', () => {\n const initialTraceWindow: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(1000),\n max: TraceEngine.Types.Timing.MicroSeconds(10000),\n range: TraceEngine.Types.Timing.MicroSeconds(9000),\n };\n\n const crumbs = new TimelineComponents.Breadcrumbs.Breadcrumbs(initialTraceWindow);\n\n const traceWindow1: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(1000),\n max: TraceEngine.Types.Timing.MicroSeconds(9000),\n range: TraceEngine.Types.Timing.MicroSeconds(8000),\n };\n\n const traceWindow2: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(3000),\n max: TraceEngine.Types.Timing.MicroSeconds(9000),\n range: TraceEngine.Types.Timing.MicroSeconds(6000),\n };\n\n const breadcrumb2: TraceEngine.Types.File.Breadcrumb = {\n window: traceWindow2,\n child: null,\n };\n\n const breadcrumb1: TraceEngine.Types.File.Breadcrumb = {\n window: traceWindow1,\n child: breadcrumb2,\n };\n\n const initialBreadcrumb: TraceEngine.Types.File.Breadcrumb = {\n window: initialTraceWindow,\n child: breadcrumb1,\n };\n\n crumbs.setInitialBreadcrumbFromLoadedAnnotations(initialBreadcrumb);\n\n assert.deepEqual(\n TimelineComponents.Breadcrumbs.flattenBreadcrumbs(initialBreadcrumb),\n [initialBreadcrumb, breadcrumb1, breadcrumb2]);\n assert.deepEqual(crumbs.lastBreadcrumb, breadcrumb2);\n\n // Make sure the trace bounds were correctly set to the last breadcrumb bounds\n assert.deepEqual(TraceBounds.TraceBounds.BoundsManager.instance().state()?.micro.minimapTraceBounds.min, 3000);\n assert.deepEqual(TraceBounds.TraceBounds.BoundsManager.instance().state()?.micro.minimapTraceBounds.max, 9000);\n assert.deepEqual(TraceBounds.TraceBounds.BoundsManager.instance().state()?.micro.minimapTraceBounds.range, 6000);\n\n // Make sure the TimelineVisibleWindow was correctly set to the last breadcrumb bounds\n assert.deepEqual(TraceBounds.TraceBounds.BoundsManager.instance().state()?.micro.timelineTraceWindow.min, 3000);\n assert.deepEqual(TraceBounds.TraceBounds.BoundsManager.instance().state()?.micro.timelineTraceWindow.max, 9000);\n assert.deepEqual(TraceBounds.TraceBounds.BoundsManager.instance().state()?.micro.timelineTraceWindow.range, 6000);\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/InteractionsTrackAppender.js b/public/panels/timeline/InteractionsTrackAppender.js index 83cae79f3..3af7785b1 100644 --- a/public/panels/timeline/InteractionsTrackAppender.js +++ b/public/panels/timeline/InteractionsTrackAppender.js @@ -83,7 +83,7 @@ export class InteractionsTrackAppender { type: "CANDY" /* PerfUI.FlameChart.FlameChartDecorationType.CANDY */, startAtTime: TraceEngine.Handlers.ModelHandlers.UserInteractions.LONG_INTERACTION_THRESHOLD, // Interaction events have whiskers, so we do not want to candy stripe - // the entire duration. The box represents processing time, so we only + // the entire duration. The box represents processing duration, so we only // candystripe up to the end of processing. endAtTime: entry.processingEnd, }, { diff --git a/public/panels/timeline/InteractionsTrackAppender.js.map b/public/panels/timeline/InteractionsTrackAppender.js.map index 723d07429..22592c157 100644 --- a/public/panels/timeline/InteractionsTrackAppender.js.map +++ b/public/panels/timeline/InteractionsTrackAppender.js.map @@ -1 +1 @@ -{"version":3,"file":"InteractionsTrackAppender.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/InteractionsTrackAppender.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,+CAA+C,CAAC;AAExE,OAAO,EAAC,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAQvF,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,YAAY,EAAE,cAAc;CAC7B,CAAC;AAEF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,8CAA8C,EAAE,SAAS,CAAC,CAAC;AACpG,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAEtE,MAAM,OAAO,yBAAyB;IAC3B,YAAY,GAAsB,cAAc,CAAC;IAE1D,eAAe,CAAyB;IACxC,qBAAqB,CAA8B;IACnD,gBAAgB,CAAsD;IAEtE,YACI,oBAAiD,EAAE,eAA0D,EAC7G,cAAsC;QACxC,IAAI,CAAC,qBAAqB,GAAG,oBAA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aAAa,CAAC;QAC9C,CAAC;QACD,OAAO,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAC/D,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,KAAmD;QAC/D,IAAI,WAAW,CAAC,KAAK,CAAC,WAAW,CAAC,2BAA2B,CAAC,KAAK,CAAC,EAAE,CAAC;YACrE,OAAO,wBAAwB,CAAC,KAAK,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,KAAK,CAAC,IAAI,CAAC;IACpB,CAAC;IAED;;;OAGG;IACH,oBAAoB,CAAC,KAAmD;QACtE,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACxC,OAAO,EAAC,KAAK,EAAE,aAAa,EAAE,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,EAAC,CAAC;IAC7D,CAAC;CACF;AAED;;;IAGI;AACJ,MAAM,UAAU,wBAAwB,CAAC,KAA6D;IACpG,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAClG,kEAAkE;IAClE,sEAAsE;IACtE,8CAA8C;IAC9C,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QACzB,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,IAAI,QAAQ,KAAK,UAAU,EAAE,CAAC;QAC5B,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC;AACpB,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\nimport type * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as TraceEngine from '../../models/trace/trace.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\n\nimport {buildGroupStyle, buildTrackHeader, getFormattedTime} from './AppenderUtils.js';\nimport {\n type CompatibilityTracksAppender,\n type HighlightedEntryInfo,\n type TrackAppender,\n type TrackAppenderName,\n} from './CompatibilityTracksAppender.js';\n\nconst UIStrings = {\n /**\n *@description Text in Timeline Flame Chart Data Provider of the Performance panel\n */\n interactions: 'Interactions',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/InteractionsTrackAppender.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class InteractionsTrackAppender implements TrackAppender {\n readonly appenderName: TrackAppenderName = 'Interactions';\n\n #colorGenerator: Common.Color.Generator;\n #compatibilityBuilder: CompatibilityTracksAppender;\n #traceParsedData: Readonly;\n\n constructor(\n compatibilityBuilder: CompatibilityTracksAppender, traceParsedData: TraceEngine.Handlers.Types.TraceParseData,\n colorGenerator: Common.Color.Generator) {\n this.#compatibilityBuilder = compatibilityBuilder;\n this.#colorGenerator = colorGenerator;\n this.#traceParsedData = traceParsedData;\n }\n\n /**\n * Appends into the flame chart data the data corresponding to the\n * interactions track.\n * @param trackStartLevel the horizontal level of the flame chart events where\n * the track's events will start being appended.\n * @param expanded wether the track should be rendered expanded.\n * @returns the first available level to append more data after having\n * appended the track's events.\n */\n appendTrackAtLevel(trackStartLevel: number, expanded?: boolean): number {\n if (this.#traceParsedData.UserInteractions.interactionEvents.length === 0) {\n return trackStartLevel;\n }\n this.#appendTrackHeaderAtLevel(trackStartLevel, expanded);\n return this.#appendInteractionsAtLevel(trackStartLevel);\n }\n\n /**\n * Adds into the flame chart data the header corresponding to the\n * interactions track. A header is added in the shape of a group in the\n * flame chart data. A group has a predefined style and a reference\n * to the definition of the legacy track (which should be removed\n * in the future).\n * @param currentLevel the flame chart level at which the header is\n * appended.\n */\n #appendTrackHeaderAtLevel(currentLevel: number, expanded?: boolean): void {\n const trackIsCollapsible = this.#traceParsedData.UserInteractions.interactionEvents.length > 0;\n const style = buildGroupStyle({shareHeaderLine: false, collapsible: trackIsCollapsible});\n const group =\n buildTrackHeader(currentLevel, i18nString(UIStrings.interactions), style, /* selectable= */ true, expanded);\n this.#compatibilityBuilder.registerTrackForGroup(group, this);\n }\n\n /**\n * Adds into the flame chart data the trace events dispatched by the\n * performance.measure API. These events are taken from the UserInteractions\n * handler.\n * @param currentLevel the flame chart level from which interactions will\n * be appended.\n * @returns the next level after the last occupied by the appended\n * interactions (the first available level to append more data).\n */\n #appendInteractionsAtLevel(trackStartLevel: number): number {\n const {interactionEventsWithNoNesting, interactionsOverThreshold} = this.#traceParsedData.UserInteractions;\n\n const addCandyStripeToLongInteraction =\n (event: TraceEngine.Types.TraceEvents.SyntheticInteractionPair, index: number): void => {\n // Each interaction that we drew that is over the INP threshold needs to be\n // candy-striped.\n const overThreshold = interactionsOverThreshold.has(event);\n if (!overThreshold) {\n return;\n }\n if (index !== undefined) {\n this.#addCandyStripeAndWarningForLongInteraction(event, index);\n }\n };\n // Render all top level interactions (see UserInteractionsHandler for an explanation on the nesting) onto the track.\n const newLevel = this.#compatibilityBuilder.appendEventsAtLevel(\n interactionEventsWithNoNesting, trackStartLevel, this, addCandyStripeToLongInteraction);\n\n return newLevel;\n }\n\n #addCandyStripeAndWarningForLongInteraction(\n entry: TraceEngine.Types.TraceEvents.SyntheticInteractionPair, eventIndex: number): void {\n const decorationsForEvent =\n this.#compatibilityBuilder.getFlameChartTimelineData().entryDecorations[eventIndex] || [];\n decorationsForEvent.push(\n {\n type: PerfUI.FlameChart.FlameChartDecorationType.CANDY,\n startAtTime: TraceEngine.Handlers.ModelHandlers.UserInteractions.LONG_INTERACTION_THRESHOLD,\n // Interaction events have whiskers, so we do not want to candy stripe\n // the entire duration. The box represents processing time, so we only\n // candystripe up to the end of processing.\n endAtTime: entry.processingEnd,\n },\n {\n type: PerfUI.FlameChart.FlameChartDecorationType.WARNING_TRIANGLE,\n customEndTime: entry.processingEnd,\n });\n this.#compatibilityBuilder.getFlameChartTimelineData().entryDecorations[eventIndex] = decorationsForEvent;\n }\n\n /*\n ------------------------------------------------------------------------------------\n The following methods are invoked by the flame chart renderer to query features about\n events on rendering.\n ------------------------------------------------------------------------------------\n */\n\n /**\n * Gets the color an event added by this appender should be rendered with.\n */\n colorForEvent(event: TraceEngine.Types.TraceEvents.TraceEventData): string {\n let idForColorGeneration = this.titleForEvent(event);\n if (TraceEngine.Types.TraceEvents.isSyntheticInteractionEvent(event)) {\n // Append the ID so that we vary the colours, ensuring that two events of\n // the same type are coloured differently.\n idForColorGeneration += event.interactionId;\n }\n return this.#colorGenerator.colorForID(idForColorGeneration);\n }\n\n /**\n * Gets the title an event added by this appender should be rendered with.\n */\n titleForEvent(event: TraceEngine.Types.TraceEvents.TraceEventData): string {\n if (TraceEngine.Types.TraceEvents.isSyntheticInteractionEvent(event)) {\n return titleForInteractionEvent(event);\n }\n return event.name;\n }\n\n /**\n * Returns the info shown when an event added by this appender\n * is hovered in the timeline.\n */\n highlightedEntryInfo(event: TraceEngine.Types.TraceEvents.TraceEventData): HighlightedEntryInfo {\n const title = this.titleForEvent(event);\n return {title, formattedTime: getFormattedTime(event.dur)};\n }\n}\n\n/**\n * Return the title to use for a given interaction event.\n * Exported so the title in the DetailsView can re-use the same logic\n **/\nexport function titleForInteractionEvent(event: TraceEngine.Types.TraceEvents.SyntheticInteractionPair): string {\n const category = TraceEngine.Handlers.ModelHandlers.UserInteractions.categoryOfInteraction(event);\n // Because we hide nested interactions, we do not want to show the\n // specific type of the interaction that was not hidden, so instead we\n // show just the category of that interaction.\n if (category === 'OTHER') {\n return 'Other';\n }\n if (category === 'KEYBOARD') {\n return 'Keyboard';\n }\n if (category === 'POINTER') {\n return 'Pointer';\n }\n return event.type;\n}\n"]} \ No newline at end of file +{"version":3,"file":"InteractionsTrackAppender.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/InteractionsTrackAppender.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,IAAI,MAA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I;AACJ,MAAM,UAAU,wBAAwB,CAAC,KAA6D;IACpG,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAClG,kEAAkE;IAClE,sEAAsE;IACtE,8CAA8C;IAC9C,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QACzB,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,IAAI,QAAQ,KAAK,UAAU,EAAE,CAAC;QAC5B,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC;AACpB,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\nimport type * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as TraceEngine from '../../models/trace/trace.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\n\nimport {buildGroupStyle, buildTrackHeader, getFormattedTime} from './AppenderUtils.js';\nimport {\n type CompatibilityTracksAppender,\n type HighlightedEntryInfo,\n type TrackAppender,\n type TrackAppenderName,\n} from './CompatibilityTracksAppender.js';\n\nconst UIStrings = {\n /**\n *@description Text in Timeline Flame Chart Data Provider of the Performance panel\n */\n interactions: 'Interactions',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/InteractionsTrackAppender.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class InteractionsTrackAppender implements TrackAppender {\n readonly appenderName: TrackAppenderName = 'Interactions';\n\n #colorGenerator: Common.Color.Generator;\n #compatibilityBuilder: CompatibilityTracksAppender;\n #traceParsedData: Readonly;\n\n constructor(\n compatibilityBuilder: CompatibilityTracksAppender, traceParsedData: TraceEngine.Handlers.Types.TraceParseData,\n colorGenerator: Common.Color.Generator) {\n this.#compatibilityBuilder = compatibilityBuilder;\n this.#colorGenerator = colorGenerator;\n this.#traceParsedData = traceParsedData;\n }\n\n /**\n * Appends into the flame chart data the data corresponding to the\n * interactions track.\n * @param trackStartLevel the horizontal level of the flame chart events where\n * the track's events will start being appended.\n * @param expanded wether the track should be rendered expanded.\n * @returns the first available level to append more data after having\n * appended the track's events.\n */\n appendTrackAtLevel(trackStartLevel: number, expanded?: boolean): number {\n if (this.#traceParsedData.UserInteractions.interactionEvents.length === 0) {\n return trackStartLevel;\n }\n this.#appendTrackHeaderAtLevel(trackStartLevel, expanded);\n return this.#appendInteractionsAtLevel(trackStartLevel);\n }\n\n /**\n * Adds into the flame chart data the header corresponding to the\n * interactions track. A header is added in the shape of a group in the\n * flame chart data. A group has a predefined style and a reference\n * to the definition of the legacy track (which should be removed\n * in the future).\n * @param currentLevel the flame chart level at which the header is\n * appended.\n */\n #appendTrackHeaderAtLevel(currentLevel: number, expanded?: boolean): void {\n const trackIsCollapsible = this.#traceParsedData.UserInteractions.interactionEvents.length > 0;\n const style = buildGroupStyle({shareHeaderLine: false, collapsible: trackIsCollapsible});\n const group =\n buildTrackHeader(currentLevel, i18nString(UIStrings.interactions), style, /* selectable= */ true, expanded);\n this.#compatibilityBuilder.registerTrackForGroup(group, this);\n }\n\n /**\n * Adds into the flame chart data the trace events dispatched by the\n * performance.measure API. These events are taken from the UserInteractions\n * handler.\n * @param currentLevel the flame chart level from which interactions will\n * be appended.\n * @returns the next level after the last occupied by the appended\n * interactions (the first available level to append more data).\n */\n #appendInteractionsAtLevel(trackStartLevel: number): number {\n const {interactionEventsWithNoNesting, interactionsOverThreshold} = this.#traceParsedData.UserInteractions;\n\n const addCandyStripeToLongInteraction =\n (event: TraceEngine.Types.TraceEvents.SyntheticInteractionPair, index: number): void => {\n // Each interaction that we drew that is over the INP threshold needs to be\n // candy-striped.\n const overThreshold = interactionsOverThreshold.has(event);\n if (!overThreshold) {\n return;\n }\n if (index !== undefined) {\n this.#addCandyStripeAndWarningForLongInteraction(event, index);\n }\n };\n // Render all top level interactions (see UserInteractionsHandler for an explanation on the nesting) onto the track.\n const newLevel = this.#compatibilityBuilder.appendEventsAtLevel(\n interactionEventsWithNoNesting, trackStartLevel, this, addCandyStripeToLongInteraction);\n\n return newLevel;\n }\n\n #addCandyStripeAndWarningForLongInteraction(\n entry: TraceEngine.Types.TraceEvents.SyntheticInteractionPair, eventIndex: number): void {\n const decorationsForEvent =\n this.#compatibilityBuilder.getFlameChartTimelineData().entryDecorations[eventIndex] || [];\n decorationsForEvent.push(\n {\n type: PerfUI.FlameChart.FlameChartDecorationType.CANDY,\n startAtTime: TraceEngine.Handlers.ModelHandlers.UserInteractions.LONG_INTERACTION_THRESHOLD,\n // Interaction events have whiskers, so we do not want to candy stripe\n // the entire duration. The box represents processing duration, so we only\n // candystripe up to the end of processing.\n endAtTime: entry.processingEnd,\n },\n {\n type: PerfUI.FlameChart.FlameChartDecorationType.WARNING_TRIANGLE,\n customEndTime: entry.processingEnd,\n });\n this.#compatibilityBuilder.getFlameChartTimelineData().entryDecorations[eventIndex] = decorationsForEvent;\n }\n\n /*\n ------------------------------------------------------------------------------------\n The following methods are invoked by the flame chart renderer to query features about\n events on rendering.\n ------------------------------------------------------------------------------------\n */\n\n /**\n * Gets the color an event added by this appender should be rendered with.\n */\n colorForEvent(event: TraceEngine.Types.TraceEvents.TraceEventData): string {\n let idForColorGeneration = this.titleForEvent(event);\n if (TraceEngine.Types.TraceEvents.isSyntheticInteractionEvent(event)) {\n // Append the ID so that we vary the colours, ensuring that two events of\n // the same type are coloured differently.\n idForColorGeneration += event.interactionId;\n }\n return this.#colorGenerator.colorForID(idForColorGeneration);\n }\n\n /**\n * Gets the title an event added by this appender should be rendered with.\n */\n titleForEvent(event: TraceEngine.Types.TraceEvents.TraceEventData): string {\n if (TraceEngine.Types.TraceEvents.isSyntheticInteractionEvent(event)) {\n return titleForInteractionEvent(event);\n }\n return event.name;\n }\n\n /**\n * Returns the info shown when an event added by this appender\n * is hovered in the timeline.\n */\n highlightedEntryInfo(event: TraceEngine.Types.TraceEvents.TraceEventData): HighlightedEntryInfo {\n const title = this.titleForEvent(event);\n return {title, formattedTime: getFormattedTime(event.dur)};\n }\n}\n\n/**\n * Return the title to use for a given interaction event.\n * Exported so the title in the DetailsView can re-use the same logic\n **/\nexport function titleForInteractionEvent(event: TraceEngine.Types.TraceEvents.SyntheticInteractionPair): string {\n const category = TraceEngine.Handlers.ModelHandlers.UserInteractions.categoryOfInteraction(event);\n // Because we hide nested interactions, we do not want to show the\n // specific type of the interaction that was not hidden, so instead we\n // show just the category of that interaction.\n if (category === 'OTHER') {\n return 'Other';\n }\n if (category === 'KEYBOARD') {\n return 'Keyboard';\n }\n if (category === 'POINTER') {\n return 'Pointer';\n }\n return event.type;\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/ThreadAppender.js b/public/panels/timeline/ThreadAppender.js index b5fa82e9d..4846f435f 100644 --- a/public/panels/timeline/ThreadAppender.js +++ b/public/panels/timeline/ThreadAppender.js @@ -8,6 +8,7 @@ import * as Root from '../../core/root/root.js'; import * as SDK from '../../core/sdk/sdk.js'; import * as Bindings from '../../models/bindings/bindings.js'; import * as TraceEngine from '../../models/trace/trace.js'; +import * as AnnotationsManager from '../../services/annotations_manager/annotations_manager.js'; import * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js'; import { addDecorationToEvent, buildGroupStyle, buildTrackHeader, getFormattedTime, } from './AppenderUtils.js'; import { getCategoryStyles, getEventStyle } from './EventUICategory.js'; @@ -390,7 +391,10 @@ export class ThreadAppender { * listed is done before appending. */ #appendNodesAtLevel(nodes, startingLevel, parentIsIgnoredListed = false) { - const invisibleEntries = TraceEngine.EntriesFilter.EntriesFilter.maybeInstance()?.invisibleEntries() ?? []; + const invisibleEntries = AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance() + ?.getEntriesFilter() + .invisibleEntries() ?? + []; let maxDepthInTree = startingLevel; for (const node of nodes) { let nextLevel = startingLevel; @@ -435,7 +439,7 @@ export class ThreadAppender { } #addDecorationsToEntry(entry, index) { const flameChartData = this.#compatibilityBuilder.getFlameChartTimelineData(); - if (TraceEngine.EntriesFilter.EntriesFilter.maybeInstance()?.isEntryModified(entry)) { + if (AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance()?.getEntriesFilter().isEntryModified(entry)) { addDecorationToEvent(flameChartData, index, { type: "HIDDEN_DESCENDANTS_ARROW" /* PerfUI.FlameChart.FlameChartDecorationType.HIDDEN_DESCENDANTS_ARROW */ }); } const warnings = this.#traceParsedData.Warnings.perEvent.get(entry); diff --git a/public/panels/timeline/ThreadAppender.js.map b/public/panels/timeline/ThreadAppender.js.map index 9923a369f..0fea5669b 100644 --- a/public/panels/timeline/ThreadAppender.js.map +++ b/public/panels/timeline/ThreadAppender.js.map @@ -1 +1 @@ -{"version":3,"file":"ThreadAppender.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/ThreadAppender.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAC7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,+CAA+C,CAAC;AAExE,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAO5B,OAAO,EAAC,iBAAiB,EAAE,aAAa,EAAC,MAAM,sBAAsB,CAAC;AAEtE,M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AAC,CAAC,CAAC,CAAC,GAAG,SAAS,MAAM,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;YAClG,KAAK,IAAI,MAAM,GAAG,KAAK,KAAK,GAAG,CAAC;QAClC,CAAC;QACD,OAAO,EAAC,KAAK,EAAE,aAAa,EAAE,gBAAgB,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAC,CAAC;IAC7E,CAAC;CACF","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\nimport * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as Root from '../../core/root/root.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as TraceEngine from '../../models/trace/trace.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\n\nimport {\n addDecorationToEvent,\n buildGroupStyle,\n buildTrackHeader,\n getFormattedTime,\n} from './AppenderUtils.js';\nimport {\n type CompatibilityTracksAppender,\n type HighlightedEntryInfo,\n type TrackAppender,\n type TrackAppenderName,\n} from './CompatibilityTracksAppender.js';\nimport {getCategoryStyles, getEventStyle} from './EventUICategory.js';\n\nconst UIStrings = {\n /**\n *@description Text shown for an entry in the flame chart that is ignored because it matches\n * a predefined ignore list.\n */\n onIgnoreList: 'On ignore list',\n /**\n * @description Refers to the \"Main frame\", meaning the top level frame. See https://www.w3.org/TR/html401/present/frames.html\n * @example{example.com} PH1\n */\n mainS: 'Main — {PH1}',\n /**\n * @description Refers to the main thread of execution of a program. See https://developer.mozilla.org/en-US/docs/Glossary/Main_thread\n */\n main: 'Main',\n /**\n * @description Refers to any frame in the page. See https://www.w3.org/TR/html401/present/frames.html\n * @example {https://example.com} PH1\n */\n frameS: 'Frame — {PH1}',\n /**\n *@description A web worker in the page. See https://developer.mozilla.org/en-US/docs/Web/API/Worker\n *@example {https://google.com} PH1\n */\n workerS: '`Worker` — {PH1}',\n /**\n *@description A web worker in the page. See https://developer.mozilla.org/en-US/docs/Web/API/Worker\n *@example {FormatterWorker} PH1\n *@example {https://google.com} PH2\n */\n workerSS: '`Worker`: {PH1} — {PH2}',\n /**\n *@description Label for a web worker exclusively allocated for a purpose.\n */\n dedicatedWorker: 'Dedicated `Worker`',\n /**\n *@description Text for the name of anonymous functions\n */\n anonymous: '(anonymous)',\n /**\n *@description A generic name given for a thread running in the browser (sequence of programmed instructions).\n * The placeholder is an enumeration given to the thread.\n *@example {1} PH1\n */\n threadS: 'Thread {PH1}',\n /**\n *@description Rasterization in computer graphics.\n */\n raster: 'Raster',\n /**\n *@description Threads used for background tasks.\n */\n threadPool: 'Thread Pool',\n /**\n *@description Name for a thread that rasterizes graphics in a website.\n *@example {2} PH1\n */\n rasterizerThreadS: 'Rasterizer Thread {PH1}',\n /**\n *@description Text in Timeline Flame Chart Data Provider of the Performance panel\n *@example {2} PH1\n */\n threadPoolThreadS: 'Thread Pool Worker {PH1}',\n /**\n *@description Title of a bidder auction worklet with known URL in the timeline flame chart of the Performance panel\n *@example {https://google.com} PH1\n */\n bidderWorkletS: 'Bidder Worklet — {PH1}',\n /**\n *@description Title of a bidder auction worklet in the timeline flame chart of the Performance panel with an unknown URL\n */\n bidderWorklet: 'Bidder Worklet',\n\n /**\n *@description Title of a seller auction worklet in the timeline flame chart of the Performance panel with an unknown URL\n */\n sellerWorklet: 'Seller Worklet',\n\n /**\n *@description Title of an auction worklet in the timeline flame chart of the Performance panel with an unknown URL\n */\n unknownWorklet: 'Auction Worklet',\n\n /**\n *@description Title of control thread of a service process for an auction worklet in the timeline flame chart of the Performance panel with an unknown URL\n */\n workletService: 'Auction Worklet Service',\n\n /**\n *@description Title of a seller auction worklet with known URL in the timeline flame chart of the Performance panel\n *@example {https://google.com} PH1\n */\n sellerWorkletS: 'Seller Worklet — {PH1}',\n\n /**\n *@description Title of an auction worklet with known URL in the timeline flame chart of the Performance panel\n *@example {https://google.com} PH1\n */\n unknownWorkletS: 'Auction Worklet — {PH1}',\n\n /**\n *@description Title of control thread of a service process for an auction worklet with known URL in the timeline flame chart of the Performance panel\n * @example {https://google.com} PH1\n */\n workletServiceS: 'Auction Worklet Service — {PH1}',\n /**\n *@description Text used to show an EventDispatch event which has a type associated with it\n *@example {click} PH1\n */\n eventDispatchS: 'Event: {PH1}',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/ThreadAppender.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\n// This appender is only triggered when the Renderer handler is run. At\n// the moment this only happens in the basic component server example.\n// In the future, once this appender fully supports the behaviour of the\n// old engine's thread/sync tracks we can always run it by enabling the\n// Renderer and Samples handler by default.\nexport class ThreadAppender implements TrackAppender {\n readonly appenderName: TrackAppenderName = 'Thread';\n\n #colorGenerator: Common.Color.Generator;\n #compatibilityBuilder: CompatibilityTracksAppender;\n #traceParsedData: TraceEngine.Handlers.Types.TraceParseData;\n\n #entries: TraceEngine.Types.TraceEvents.TraceEventData[] = [];\n #tree: TraceEngine.Helpers.TreeHelpers.TraceEntryTree;\n #processId: TraceEngine.Types.TraceEvents.ProcessID;\n #threadId: TraceEngine.Types.TraceEvents.ThreadID;\n #threadDefaultName: string;\n #expanded = false;\n #headerAppended: boolean = false;\n readonly threadType: TraceEngine.Handlers.Threads.ThreadType = TraceEngine.Handlers.Threads.ThreadType.MAIN_THREAD;\n readonly isOnMainFrame: boolean;\n #ignoreListingEnabled = Root.Runtime.experiments.isEnabled('ignore-list-js-frames-on-timeline');\n #showAllEventsEnabled = Root.Runtime.experiments.isEnabled('timeline-show-all-events');\n #url: string = '';\n #headerNestingLevel: number|null = null;\n constructor(\n compatibilityBuilder: CompatibilityTracksAppender, traceParsedData: TraceEngine.Handlers.Types.TraceParseData,\n processId: TraceEngine.Types.TraceEvents.ProcessID, threadId: TraceEngine.Types.TraceEvents.ThreadID,\n threadName: string|null, type: TraceEngine.Handlers.Threads.ThreadType) {\n this.#compatibilityBuilder = compatibilityBuilder;\n // TODO(crbug.com/1456706):\n // The values for this color generator have been taken from the old\n // engine to keep the colors the same after the migration. This\n // generator is used here to create colors for js frames (profile\n // calls) in the flamechart by hashing the script's url. We might\n // need to reconsider this generator when migrating to GM3 colors.\n this.#colorGenerator =\n new Common.Color.Generator({min: 30, max: 330, count: undefined}, {min: 50, max: 80, count: 3}, 85);\n // Add a default color for call frames with no url.\n this.#colorGenerator.setColorForID('', '#f2ecdc');\n this.#traceParsedData = traceParsedData;\n this.#processId = processId;\n this.#threadId = threadId;\n\n // When loading a CPU profile, only CPU data will be available, thus\n // we get the data from the SamplesHandler.\n const entries = type === TraceEngine.Handlers.Threads.ThreadType.CPU_PROFILE ?\n this.#traceParsedData.Samples?.profilesInProcess.get(processId)?.get(threadId)?.profileCalls :\n this.#traceParsedData.Renderer?.processes.get(processId)?.threads?.get(threadId)?.entries;\n const tree = type === TraceEngine.Handlers.Threads.ThreadType.CPU_PROFILE ?\n this.#traceParsedData.Samples?.profilesInProcess.get(processId)?.get(threadId)?.profileTree :\n this.#traceParsedData.Renderer?.processes.get(processId)?.threads?.get(threadId)?.tree;\n if (!entries || !tree) {\n throw new Error(`Could not find data for thread with id ${threadId} in process with id ${processId}`);\n }\n this.#entries = entries;\n this.#tree = tree;\n this.#threadDefaultName = threadName || i18nString(UIStrings.threadS, {PH1: threadId});\n this.isOnMainFrame = Boolean(this.#traceParsedData.Renderer?.processes.get(processId)?.isOnMainFrame);\n this.threadType = type;\n // AuctionWorklets are threads, so we re-use this appender rather than\n // duplicate it, but we change the name because we want to render these\n // lower down than other threads.\n if (this.#traceParsedData.AuctionWorklets.worklets.has(processId)) {\n this.appenderName = 'Thread_AuctionWorklet';\n }\n this.#url = this.#traceParsedData.Renderer?.processes.get(this.#processId)?.url || '';\n }\n\n processId(): TraceEngine.Types.TraceEvents.ProcessID {\n return this.#processId;\n }\n\n threadId(): TraceEngine.Types.TraceEvents.ThreadID {\n return this.#threadId;\n }\n\n /**\n * Appends into the flame chart data the data corresponding to the\n * this thread.\n * @param trackStartLevel the horizontal level of the flame chart events where\n * the track's events will start being appended.\n * @param expanded wether the track should be rendered expanded.\n * @returns the first available level to append more data after having\n * appended the track's events.\n */\n appendTrackAtLevel(trackStartLevel: number, expanded: boolean = false): number {\n if (this.#entries.length === 0) {\n return trackStartLevel;\n }\n this.#expanded = expanded;\n return this.#appendTreeAtLevel(trackStartLevel);\n }\n\n setHeaderNestingLevel(level: number): void {\n this.#headerNestingLevel = level;\n }\n /**\n * Track header is appended only if there are events visible on it.\n * Otherwise we don't append any track. So, instead of preemptively\n * appending a track before appending its events, we only do so once\n * we have detected that the track contains an event that is visible.\n */\n #ensureTrackHeaderAppended(trackStartLevel: number): void {\n if (this.#headerAppended) {\n return;\n }\n if (this.threadType === TraceEngine.Handlers.Threads.ThreadType.RASTERIZER ||\n this.threadType === TraceEngine.Handlers.Threads.ThreadType.THREAD_POOL) {\n this.#appendGroupedTrackHeaderAndTitle(trackStartLevel, this.threadType);\n } else {\n this.#appendTrackHeaderAtLevel(trackStartLevel);\n }\n this.#headerAppended = true;\n }\n\n setHeaderAppended(headerAppended: boolean): void {\n this.#headerAppended = headerAppended;\n }\n\n headerAppended(): boolean {\n return this.#headerAppended;\n }\n\n /**\n * Adds into the flame chart data the header corresponding to this\n * thread. A header is added in the shape of a group in the flame\n * chart data. A group has a predefined style and a reference to the\n * definition of the legacy track (which should be removed in the\n * future).\n * @param currentLevel the flame chart level at which the header is\n * appended.\n */\n #appendTrackHeaderAtLevel(currentLevel: number): void {\n const trackIsCollapsible = this.#entries.length > 0;\n const style = buildGroupStyle({shareHeaderLine: false, collapsible: trackIsCollapsible});\n if (this.#headerNestingLevel !== null) {\n style.nestingLevel = this.#headerNestingLevel;\n }\n const group = buildTrackHeader(\n currentLevel, this.trackName(), style, /* selectable= */ true, this.#expanded, /* track= */ null,\n /* showStackContextMenu= */ true);\n this.#compatibilityBuilder.registerTrackForGroup(group, this);\n }\n /**\n * Raster threads are rendered under a single header in the\n * flamechart. However, each thread has a unique title which needs to\n * be added to the flamechart data.\n */\n #appendGroupedTrackHeaderAndTitle(\n trackStartLevel: number,\n threadType: TraceEngine.Handlers.Threads.ThreadType.RASTERIZER|\n TraceEngine.Handlers.Threads.ThreadType.THREAD_POOL): void {\n const currentTrackCount = this.#compatibilityBuilder.getCurrentTrackCountForThreadType(threadType);\n if (currentTrackCount === 0) {\n const trackIsCollapsible = this.#entries.length > 0;\n const headerStyle = buildGroupStyle({shareHeaderLine: false, collapsible: trackIsCollapsible});\n const headerGroup =\n buildTrackHeader(trackStartLevel, this.trackName(), headerStyle, /* selectable= */ false, this.#expanded);\n this.#compatibilityBuilder.getFlameChartTimelineData().groups.push(headerGroup);\n }\n\n // Nesting is set to 1 because the track is appended inside the\n // header for all raster threads.\n const titleStyle = buildGroupStyle({padding: 2, nestingLevel: 1, collapsible: false});\n const rasterizerTitle = this.threadType === TraceEngine.Handlers.Threads.ThreadType.RASTERIZER ?\n i18nString(UIStrings.rasterizerThreadS, {PH1: currentTrackCount + 1}) :\n i18nString(UIStrings.threadPoolThreadS, {PH1: currentTrackCount + 1});\n const titleGroup =\n buildTrackHeader(trackStartLevel, rasterizerTitle, titleStyle, /* selectable= */ true, this.#expanded);\n this.#compatibilityBuilder.registerTrackForGroup(titleGroup, this);\n }\n\n trackName(): string {\n let threadTypeLabel: string|null = null;\n switch (this.threadType) {\n case TraceEngine.Handlers.Threads.ThreadType.MAIN_THREAD:\n threadTypeLabel = this.isOnMainFrame ? i18nString(UIStrings.mainS, {PH1: this.#url}) :\n i18nString(UIStrings.frameS, {PH1: this.#url});\n break;\n case TraceEngine.Handlers.Threads.ThreadType.CPU_PROFILE:\n threadTypeLabel = i18nString(UIStrings.main);\n break;\n case TraceEngine.Handlers.Threads.ThreadType.WORKER:\n threadTypeLabel = this.#buildNameForWorker();\n break;\n case TraceEngine.Handlers.Threads.ThreadType.RASTERIZER:\n threadTypeLabel = i18nString(UIStrings.raster);\n break;\n case TraceEngine.Handlers.Threads.ThreadType.THREAD_POOL:\n threadTypeLabel = i18nString(UIStrings.threadPool);\n break;\n case TraceEngine.Handlers.Threads.ThreadType.OTHER:\n break;\n case TraceEngine.Handlers.Threads.ThreadType.AUCTION_WORKLET:\n threadTypeLabel = this.#buildNameForAuctionWorklet();\n break;\n default:\n return Platform.assertNever(this.threadType, `Unknown thread type: ${this.threadType}`);\n }\n let suffix = '';\n if (this.#traceParsedData.Meta.traceIsGeneric) {\n suffix = suffix + ` (${this.threadId()})`;\n }\n return (threadTypeLabel || this.#threadDefaultName) + suffix;\n }\n\n getUrl(): string {\n return this.#url;\n }\n\n #buildNameForAuctionWorklet(): string {\n const workletMetadataEvent = this.#traceParsedData.AuctionWorklets.worklets.get(this.#processId);\n // We should always have this event - if we do not, we were instantiated with invalid data.\n if (!workletMetadataEvent) {\n return i18nString(UIStrings.unknownWorklet);\n }\n\n // Host could be empty - in which case we do not want to add it.\n const host = workletMetadataEvent.host ? `https://${workletMetadataEvent.host}` : '';\n const shouldAddHost = host.length > 0;\n\n // For each Auction Worklet in a page there are two threads we care about on the same process.\n // 1. The \"Worklet Service\" which is a generic helper service. This thread\n // is always named \"auction_worklet.CrUtilityMain\".\n //\n // 2. The \"Seller/Bidder\" service. This thread is always named\n // \"AuctionV8HelperThread\". The AuctionWorkets handler does the job of\n // figuring this out for us - the metadata event it provides for each\n // worklet process will have a `type` already set.\n //\n // Therefore, for this given thread, which we know is part of\n // an AuctionWorklet process, we need to figure out if this thread is the\n // generic service, or a seller/bidder worklet.\n //\n // Note that the worklet could also have the \"unknown\" type - this is not\n // expected but implemented to prevent trace event changes causing DevTools\n // to break with unknown worklet types.\n const isUtilityThread = workletMetadataEvent.args.data.utilityThread.tid === this.#threadId;\n const isBidderOrSeller = workletMetadataEvent.args.data.v8HelperThread.tid === this.#threadId;\n\n if (isUtilityThread) {\n return shouldAddHost ? i18nString(UIStrings.workletServiceS, {PH1: host}) : i18nString(UIStrings.workletService);\n }\n\n if (isBidderOrSeller) {\n switch (workletMetadataEvent.type) {\n case TraceEngine.Types.TraceEvents.AuctionWorkletType.SELLER:\n return shouldAddHost ? i18nString(UIStrings.sellerWorkletS, {PH1: host}) :\n i18nString(UIStrings.sellerWorklet);\n case TraceEngine.Types.TraceEvents.AuctionWorkletType.BIDDER:\n return shouldAddHost ? i18nString(UIStrings.bidderWorkletS, {PH1: host}) :\n i18nString(UIStrings.bidderWorklet);\n case TraceEngine.Types.TraceEvents.AuctionWorkletType.UNKNOWN:\n return shouldAddHost ? i18nString(UIStrings.unknownWorkletS, {PH1: host}) :\n i18nString(UIStrings.unknownWorklet);\n default:\n Platform.assertNever(\n workletMetadataEvent.type, `Unexpected Auction Worklet Type ${workletMetadataEvent.type}`);\n }\n }\n // We should never reach here, but just in case!\n return shouldAddHost ? i18nString(UIStrings.unknownWorkletS, {PH1: host}) : i18nString(UIStrings.unknownWorklet);\n }\n\n #buildNameForWorker(): string {\n const url = this.#traceParsedData.Renderer?.processes.get(this.#processId)?.url || '';\n const workerId = this.#traceParsedData.Workers.workerIdByThread.get(this.#threadId);\n const workerURL = workerId ? this.#traceParsedData.Workers.workerURLById.get(workerId) : url;\n // Try to create a name using the worker url if present. If not, use a generic label.\n let workerName =\n workerURL ? i18nString(UIStrings.workerS, {PH1: workerURL}) : i18nString(UIStrings.dedicatedWorker);\n const workerTarget = workerId !== undefined && SDK.TargetManager.TargetManager.instance().targetById(workerId);\n if (workerTarget) {\n // Get the worker name from the target, which corresponds to the name\n // assigned to the worker when it was constructed.\n workerName = i18nString(UIStrings.workerSS, {PH1: workerTarget.name(), PH2: url});\n }\n return workerName;\n }\n\n /**\n * Adds into the flame chart data the entries of this thread, which\n * includes trace events and JS calls.\n * @param currentLevel the flame chart level from which entries will\n * be appended.\n * @returns the next level after the last occupied by the appended\n * entries (the first available level to append more data).\n */\n #appendTreeAtLevel(trackStartLevel: number): number {\n // We can not used the tree maxDepth in the tree from the\n // RendererHandler because ignore listing and visibility of events\n // alter the final depth of the flame chart.\n return this.#appendNodesAtLevel(this.#tree.roots, trackStartLevel);\n }\n\n /**\n * Traverses the trees formed by the provided nodes in breadth first\n * fashion and appends each node's entry on each iteration. As each\n * entry is handled, a check for the its visibility or if it's ignore\n * listed is done before appending.\n */\n #appendNodesAtLevel(\n nodes: Iterable, startingLevel: number,\n parentIsIgnoredListed: boolean = false): number {\n const invisibleEntries = TraceEngine.EntriesFilter.EntriesFilter.maybeInstance()?.invisibleEntries() ?? [];\n let maxDepthInTree = startingLevel;\n for (const node of nodes) {\n let nextLevel = startingLevel;\n const entry = node.entry;\n const entryIsIgnoreListed = this.isIgnoreListedEntry(entry);\n // Events' visibility is determined from their predefined styles,\n // which is something that's not available in the engine data.\n // Thus it needs to be checked in the appenders, but preemptively\n // checking if there are visible events and returning early if not\n // is potentially expensive since, in theory, we would be adding\n // another traversal to the entries array (which could grow\n // large). To avoid the extra cost we add the check in the\n // traversal we already need to append events.\n const entryIsVisible = !invisibleEntries.includes(entry) &&\n (this.#compatibilityBuilder.entryIsVisibleInTimeline(entry) || this.#showAllEventsEnabled);\n // For ignore listing support, these two conditions need to be met\n // to not append a profile call to the flame chart:\n // 1. It is ignore listed\n // 2. It is NOT the bottom-most call in an ignore listed stack (a\n // set of chained profile calls that belong to ignore listed\n // URLs).\n // This means that all of the ignore listed calls are ignored (not\n // appended), except if it is the bottom call of an ignored stack.\n // This is becaue to represent ignore listed stack frames, we add\n // a flame chart entry with the length and position of the bottom\n // frame, which is distictively marked to denote an ignored listed\n // stack.\n const skipEventDueToIgnoreListing = entryIsIgnoreListed && parentIsIgnoredListed;\n if (entryIsVisible && !skipEventDueToIgnoreListing) {\n this.#appendEntryAtLevel(entry, startingLevel);\n nextLevel++;\n }\n\n const depthInChildTree = this.#appendNodesAtLevel(node.children, nextLevel, entryIsIgnoreListed);\n maxDepthInTree = Math.max(depthInChildTree, maxDepthInTree);\n }\n return maxDepthInTree;\n }\n\n #appendEntryAtLevel(entry: TraceEngine.Types.TraceEvents.TraceEventData, level: number): void {\n this.#ensureTrackHeaderAppended(level);\n const index = this.#compatibilityBuilder.appendEventAtLevel(entry, level, this);\n this.#addDecorationsToEntry(entry, index);\n }\n\n #addDecorationsToEntry(entry: TraceEngine.Types.TraceEvents.TraceEventData, index: number): void {\n const flameChartData = this.#compatibilityBuilder.getFlameChartTimelineData();\n if (TraceEngine.EntriesFilter.EntriesFilter.maybeInstance()?.isEntryModified(entry)) {\n addDecorationToEvent(\n flameChartData, index, {type: PerfUI.FlameChart.FlameChartDecorationType.HIDDEN_DESCENDANTS_ARROW});\n }\n const warnings = this.#traceParsedData.Warnings.perEvent.get(entry);\n if (!warnings) {\n return;\n }\n addDecorationToEvent(flameChartData, index, {type: PerfUI.FlameChart.FlameChartDecorationType.WARNING_TRIANGLE});\n if (!warnings.includes('LONG_TASK')) {\n return;\n }\n addDecorationToEvent(flameChartData, index, {\n type: PerfUI.FlameChart.FlameChartDecorationType.CANDY,\n startAtTime: TraceEngine.Handlers.ModelHandlers.Warnings.LONG_MAIN_THREAD_TASK_THRESHOLD,\n });\n }\n\n isIgnoreListedEntry(entry: TraceEngine.Types.TraceEvents.TraceEventData): boolean {\n if (!this.#ignoreListingEnabled) {\n return false;\n }\n\n if (!TraceEngine.Types.TraceEvents.isProfileCall(entry)) {\n return false;\n }\n const url = entry.callFrame.url as Platform.DevToolsPath.UrlString;\n return url && this.isIgnoreListedURL(url);\n }\n\n private isIgnoreListedURL(url: Platform.DevToolsPath.UrlString): boolean {\n return Bindings.IgnoreListManager.IgnoreListManager.instance().isUserIgnoreListedURL(url);\n }\n\n /*\n ------------------------------------------------------------------------------------\n The following methods are invoked by the flame chart renderer to query features about\n events on rendering.\n ------------------------------------------------------------------------------------\n */\n\n /**\n * Gets the color an event added by this appender should be rendered with.\n */\n colorForEvent(event: TraceEngine.Types.TraceEvents.TraceEventData): string {\n if (this.#traceParsedData.Meta.traceIsGeneric) {\n return event.name ? `hsl(${Platform.StringUtilities.hashCode(event.name) % 300 + 30}, 40%, 70%)` : '#ccc';\n }\n\n if (TraceEngine.Types.TraceEvents.isProfileCall(event)) {\n if (event.callFrame.functionName === '(idle)') {\n return getCategoryStyles().idle.getComputedColorValue();\n }\n if (event.callFrame.scriptId === '0') {\n // If we can not match this frame to a script, return the\n // generic \"scripting\" color.\n return getCategoryStyles().scripting.getComputedColorValue();\n }\n // Otherwise, return a color created based on its URL.\n return this.#colorGenerator.colorForID(event.callFrame.url);\n }\n const defaultColor =\n getEventStyle(event.name as TraceEngine.Types.TraceEvents.KnownEventName)?.category.getComputedColorValue();\n return defaultColor || getCategoryStyles().other.getComputedColorValue();\n }\n\n /**\n * Gets the title an event added by this appender should be rendered with.\n */\n titleForEvent(entry: TraceEngine.Types.TraceEvents.TraceEventData): string {\n if (this.isIgnoreListedEntry(entry)) {\n return i18nString(UIStrings.onIgnoreList);\n }\n\n // If the event is a profile call, we need to look up its name based on its\n // ProfileNode in the CPUProfile for the trace we are working with.\n if (TraceEngine.Types.TraceEvents.isProfileCall(entry)) {\n // In the future traceParsedData.Samples will always be defined, but this\n // is not the case until the sync tracks migration is fully shipped,\n // hence this extra check.\n if (this.#traceParsedData.Samples) {\n const potentialCallName =\n TraceEngine.Handlers.ModelHandlers.Samples.getProfileCallFunctionName(this.#traceParsedData.Samples, entry);\n // We need this extra check because the call name could be the empty\n // string. If it is, we want to fallback to the \"(anonymous)\" text.\n if (potentialCallName) {\n return potentialCallName;\n }\n }\n\n return entry.callFrame.functionName || i18nString(UIStrings.anonymous);\n }\n\n if (TraceEngine.Types.TraceEvents.isTraceEventDispatch(entry)) {\n // EventDispatch represent user actions such as clicks, so in this case\n // rather than show the event title (which is always just \"Event\"), we\n // add the type (\"click\") to help the user understand the event.\n return i18nString(UIStrings.eventDispatchS, {PH1: entry.args.data.type});\n }\n\n const defaultName = getEventStyle(entry.name as TraceEngine.Types.TraceEvents.KnownEventName)?.title;\n return defaultName || entry.name;\n }\n\n /**\n * Returns the info shown when an event added by this appender\n * is hovered in the timeline.\n */\n highlightedEntryInfo(event: TraceEngine.Types.TraceEvents.SyntheticTraceEntry): HighlightedEntryInfo {\n let title = this.titleForEvent(event);\n if (TraceEngine.Types.TraceEvents.isTraceEventParseHTML(event)) {\n const startLine = event.args['beginData']['startLine'];\n const endLine = event.args['endData'] && event.args['endData']['endLine'];\n const eventURL = event.args['beginData']['url'] as Platform.DevToolsPath.UrlString;\n const url = Bindings.ResourceUtils.displayNameForURL(eventURL);\n const range = (endLine !== -1 || endLine === startLine) ? `${startLine}...${endLine}` : startLine;\n title += ` - ${url} [${range}]`;\n }\n return {title, formattedTime: getFormattedTime(event.dur, event.selfTime)};\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"ThreadAppender.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/ThreadAppender.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAC7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,kBAAkB,MAAM,2DAA2D,CAAC;AAChG,OAAO,KAAK,MAAM,MAAM,+CAA+C,CAAC;AAExE,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAO5B,OAAO,EAAC,iBAAiB,EAAE,aAAa,EAAC,MAAM,sBAAsB,CAAC;AAEtE,MAAM,SAAS,GAAG;IAChB;;;OAGG;IACH,YAAY,EAAE,gBAAgB;I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CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,MAAM,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;YAClG,KAAK,IAAI,MAAM,GAAG,KAAK,KAAK,GAAG,CAAC;QAClC,CAAC;QACD,OAAO,EAAC,KAAK,EAAE,aAAa,EAAE,gBAAgB,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAC,CAAC;IAC7E,CAAC;CACF","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\nimport * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as Root from '../../core/root/root.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as TraceEngine from '../../models/trace/trace.js';\nimport * as AnnotationsManager from '../../services/annotations_manager/annotations_manager.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\n\nimport {\n addDecorationToEvent,\n buildGroupStyle,\n buildTrackHeader,\n getFormattedTime,\n} from './AppenderUtils.js';\nimport {\n type CompatibilityTracksAppender,\n type HighlightedEntryInfo,\n type TrackAppender,\n type TrackAppenderName,\n} from './CompatibilityTracksAppender.js';\nimport {getCategoryStyles, getEventStyle} from './EventUICategory.js';\n\nconst UIStrings = {\n /**\n *@description Text shown for an entry in the flame chart that is ignored because it matches\n * a predefined ignore list.\n */\n onIgnoreList: 'On ignore list',\n /**\n * @description Refers to the \"Main frame\", meaning the top level frame. See https://www.w3.org/TR/html401/present/frames.html\n * @example{example.com} PH1\n */\n mainS: 'Main — {PH1}',\n /**\n * @description Refers to the main thread of execution of a program. See https://developer.mozilla.org/en-US/docs/Glossary/Main_thread\n */\n main: 'Main',\n /**\n * @description Refers to any frame in the page. See https://www.w3.org/TR/html401/present/frames.html\n * @example {https://example.com} PH1\n */\n frameS: 'Frame — {PH1}',\n /**\n *@description A web worker in the page. See https://developer.mozilla.org/en-US/docs/Web/API/Worker\n *@example {https://google.com} PH1\n */\n workerS: '`Worker` — {PH1}',\n /**\n *@description A web worker in the page. See https://developer.mozilla.org/en-US/docs/Web/API/Worker\n *@example {FormatterWorker} PH1\n *@example {https://google.com} PH2\n */\n workerSS: '`Worker`: {PH1} — {PH2}',\n /**\n *@description Label for a web worker exclusively allocated for a purpose.\n */\n dedicatedWorker: 'Dedicated `Worker`',\n /**\n *@description Text for the name of anonymous functions\n */\n anonymous: '(anonymous)',\n /**\n *@description A generic name given for a thread running in the browser (sequence of programmed instructions).\n * The placeholder is an enumeration given to the thread.\n *@example {1} PH1\n */\n threadS: 'Thread {PH1}',\n /**\n *@description Rasterization in computer graphics.\n */\n raster: 'Raster',\n /**\n *@description Threads used for background tasks.\n */\n threadPool: 'Thread Pool',\n /**\n *@description Name for a thread that rasterizes graphics in a website.\n *@example {2} PH1\n */\n rasterizerThreadS: 'Rasterizer Thread {PH1}',\n /**\n *@description Text in Timeline Flame Chart Data Provider of the Performance panel\n *@example {2} PH1\n */\n threadPoolThreadS: 'Thread Pool Worker {PH1}',\n /**\n *@description Title of a bidder auction worklet with known URL in the timeline flame chart of the Performance panel\n *@example {https://google.com} PH1\n */\n bidderWorkletS: 'Bidder Worklet — {PH1}',\n /**\n *@description Title of a bidder auction worklet in the timeline flame chart of the Performance panel with an unknown URL\n */\n bidderWorklet: 'Bidder Worklet',\n\n /**\n *@description Title of a seller auction worklet in the timeline flame chart of the Performance panel with an unknown URL\n */\n sellerWorklet: 'Seller Worklet',\n\n /**\n *@description Title of an auction worklet in the timeline flame chart of the Performance panel with an unknown URL\n */\n unknownWorklet: 'Auction Worklet',\n\n /**\n *@description Title of control thread of a service process for an auction worklet in the timeline flame chart of the Performance panel with an unknown URL\n */\n workletService: 'Auction Worklet Service',\n\n /**\n *@description Title of a seller auction worklet with known URL in the timeline flame chart of the Performance panel\n *@example {https://google.com} PH1\n */\n sellerWorkletS: 'Seller Worklet — {PH1}',\n\n /**\n *@description Title of an auction worklet with known URL in the timeline flame chart of the Performance panel\n *@example {https://google.com} PH1\n */\n unknownWorkletS: 'Auction Worklet — {PH1}',\n\n /**\n *@description Title of control thread of a service process for an auction worklet with known URL in the timeline flame chart of the Performance panel\n * @example {https://google.com} PH1\n */\n workletServiceS: 'Auction Worklet Service — {PH1}',\n /**\n *@description Text used to show an EventDispatch event which has a type associated with it\n *@example {click} PH1\n */\n eventDispatchS: 'Event: {PH1}',\n};\n\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/ThreadAppender.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\n// This appender is only triggered when the Renderer handler is run. At\n// the moment this only happens in the basic component server example.\n// In the future, once this appender fully supports the behaviour of the\n// old engine's thread/sync tracks we can always run it by enabling the\n// Renderer and Samples handler by default.\nexport class ThreadAppender implements TrackAppender {\n readonly appenderName: TrackAppenderName = 'Thread';\n\n #colorGenerator: Common.Color.Generator;\n #compatibilityBuilder: CompatibilityTracksAppender;\n #traceParsedData: TraceEngine.Handlers.Types.TraceParseData;\n\n #entries: TraceEngine.Types.TraceEvents.TraceEventData[] = [];\n #tree: TraceEngine.Helpers.TreeHelpers.TraceEntryTree;\n #processId: TraceEngine.Types.TraceEvents.ProcessID;\n #threadId: TraceEngine.Types.TraceEvents.ThreadID;\n #threadDefaultName: string;\n #expanded = false;\n #headerAppended: boolean = false;\n readonly threadType: TraceEngine.Handlers.Threads.ThreadType = TraceEngine.Handlers.Threads.ThreadType.MAIN_THREAD;\n readonly isOnMainFrame: boolean;\n #ignoreListingEnabled = Root.Runtime.experiments.isEnabled('ignore-list-js-frames-on-timeline');\n #showAllEventsEnabled = Root.Runtime.experiments.isEnabled('timeline-show-all-events');\n #url: string = '';\n #headerNestingLevel: number|null = null;\n constructor(\n compatibilityBuilder: CompatibilityTracksAppender, traceParsedData: TraceEngine.Handlers.Types.TraceParseData,\n processId: TraceEngine.Types.TraceEvents.ProcessID, threadId: TraceEngine.Types.TraceEvents.ThreadID,\n threadName: string|null, type: TraceEngine.Handlers.Threads.ThreadType) {\n this.#compatibilityBuilder = compatibilityBuilder;\n // TODO(crbug.com/1456706):\n // The values for this color generator have been taken from the old\n // engine to keep the colors the same after the migration. This\n // generator is used here to create colors for js frames (profile\n // calls) in the flamechart by hashing the script's url. We might\n // need to reconsider this generator when migrating to GM3 colors.\n this.#colorGenerator =\n new Common.Color.Generator({min: 30, max: 330, count: undefined}, {min: 50, max: 80, count: 3}, 85);\n // Add a default color for call frames with no url.\n this.#colorGenerator.setColorForID('', '#f2ecdc');\n this.#traceParsedData = traceParsedData;\n this.#processId = processId;\n this.#threadId = threadId;\n\n // When loading a CPU profile, only CPU data will be available, thus\n // we get the data from the SamplesHandler.\n const entries = type === TraceEngine.Handlers.Threads.ThreadType.CPU_PROFILE ?\n this.#traceParsedData.Samples?.profilesInProcess.get(processId)?.get(threadId)?.profileCalls :\n this.#traceParsedData.Renderer?.processes.get(processId)?.threads?.get(threadId)?.entries;\n const tree = type === TraceEngine.Handlers.Threads.ThreadType.CPU_PROFILE ?\n this.#traceParsedData.Samples?.profilesInProcess.get(processId)?.get(threadId)?.profileTree :\n this.#traceParsedData.Renderer?.processes.get(processId)?.threads?.get(threadId)?.tree;\n if (!entries || !tree) {\n throw new Error(`Could not find data for thread with id ${threadId} in process with id ${processId}`);\n }\n this.#entries = entries;\n this.#tree = tree;\n this.#threadDefaultName = threadName || i18nString(UIStrings.threadS, {PH1: threadId});\n this.isOnMainFrame = Boolean(this.#traceParsedData.Renderer?.processes.get(processId)?.isOnMainFrame);\n this.threadType = type;\n // AuctionWorklets are threads, so we re-use this appender rather than\n // duplicate it, but we change the name because we want to render these\n // lower down than other threads.\n if (this.#traceParsedData.AuctionWorklets.worklets.has(processId)) {\n this.appenderName = 'Thread_AuctionWorklet';\n }\n this.#url = this.#traceParsedData.Renderer?.processes.get(this.#processId)?.url || '';\n }\n\n processId(): TraceEngine.Types.TraceEvents.ProcessID {\n return this.#processId;\n }\n\n threadId(): TraceEngine.Types.TraceEvents.ThreadID {\n return this.#threadId;\n }\n\n /**\n * Appends into the flame chart data the data corresponding to the\n * this thread.\n * @param trackStartLevel the horizontal level of the flame chart events where\n * the track's events will start being appended.\n * @param expanded wether the track should be rendered expanded.\n * @returns the first available level to append more data after having\n * appended the track's events.\n */\n appendTrackAtLevel(trackStartLevel: number, expanded: boolean = false): number {\n if (this.#entries.length === 0) {\n return trackStartLevel;\n }\n this.#expanded = expanded;\n return this.#appendTreeAtLevel(trackStartLevel);\n }\n\n setHeaderNestingLevel(level: number): void {\n this.#headerNestingLevel = level;\n }\n /**\n * Track header is appended only if there are events visible on it.\n * Otherwise we don't append any track. So, instead of preemptively\n * appending a track before appending its events, we only do so once\n * we have detected that the track contains an event that is visible.\n */\n #ensureTrackHeaderAppended(trackStartLevel: number): void {\n if (this.#headerAppended) {\n return;\n }\n if (this.threadType === TraceEngine.Handlers.Threads.ThreadType.RASTERIZER ||\n this.threadType === TraceEngine.Handlers.Threads.ThreadType.THREAD_POOL) {\n this.#appendGroupedTrackHeaderAndTitle(trackStartLevel, this.threadType);\n } else {\n this.#appendTrackHeaderAtLevel(trackStartLevel);\n }\n this.#headerAppended = true;\n }\n\n setHeaderAppended(headerAppended: boolean): void {\n this.#headerAppended = headerAppended;\n }\n\n headerAppended(): boolean {\n return this.#headerAppended;\n }\n\n /**\n * Adds into the flame chart data the header corresponding to this\n * thread. A header is added in the shape of a group in the flame\n * chart data. A group has a predefined style and a reference to the\n * definition of the legacy track (which should be removed in the\n * future).\n * @param currentLevel the flame chart level at which the header is\n * appended.\n */\n #appendTrackHeaderAtLevel(currentLevel: number): void {\n const trackIsCollapsible = this.#entries.length > 0;\n const style = buildGroupStyle({shareHeaderLine: false, collapsible: trackIsCollapsible});\n if (this.#headerNestingLevel !== null) {\n style.nestingLevel = this.#headerNestingLevel;\n }\n const group = buildTrackHeader(\n currentLevel, this.trackName(), style, /* selectable= */ true, this.#expanded, /* track= */ null,\n /* showStackContextMenu= */ true);\n this.#compatibilityBuilder.registerTrackForGroup(group, this);\n }\n /**\n * Raster threads are rendered under a single header in the\n * flamechart. However, each thread has a unique title which needs to\n * be added to the flamechart data.\n */\n #appendGroupedTrackHeaderAndTitle(\n trackStartLevel: number,\n threadType: TraceEngine.Handlers.Threads.ThreadType.RASTERIZER|\n TraceEngine.Handlers.Threads.ThreadType.THREAD_POOL): void {\n const currentTrackCount = this.#compatibilityBuilder.getCurrentTrackCountForThreadType(threadType);\n if (currentTrackCount === 0) {\n const trackIsCollapsible = this.#entries.length > 0;\n const headerStyle = buildGroupStyle({shareHeaderLine: false, collapsible: trackIsCollapsible});\n const headerGroup =\n buildTrackHeader(trackStartLevel, this.trackName(), headerStyle, /* selectable= */ false, this.#expanded);\n this.#compatibilityBuilder.getFlameChartTimelineData().groups.push(headerGroup);\n }\n\n // Nesting is set to 1 because the track is appended inside the\n // header for all raster threads.\n const titleStyle = buildGroupStyle({padding: 2, nestingLevel: 1, collapsible: false});\n const rasterizerTitle = this.threadType === TraceEngine.Handlers.Threads.ThreadType.RASTERIZER ?\n i18nString(UIStrings.rasterizerThreadS, {PH1: currentTrackCount + 1}) :\n i18nString(UIStrings.threadPoolThreadS, {PH1: currentTrackCount + 1});\n const titleGroup =\n buildTrackHeader(trackStartLevel, rasterizerTitle, titleStyle, /* selectable= */ true, this.#expanded);\n this.#compatibilityBuilder.registerTrackForGroup(titleGroup, this);\n }\n\n trackName(): string {\n let threadTypeLabel: string|null = null;\n switch (this.threadType) {\n case TraceEngine.Handlers.Threads.ThreadType.MAIN_THREAD:\n threadTypeLabel = this.isOnMainFrame ? i18nString(UIStrings.mainS, {PH1: this.#url}) :\n i18nString(UIStrings.frameS, {PH1: this.#url});\n break;\n case TraceEngine.Handlers.Threads.ThreadType.CPU_PROFILE:\n threadTypeLabel = i18nString(UIStrings.main);\n break;\n case TraceEngine.Handlers.Threads.ThreadType.WORKER:\n threadTypeLabel = this.#buildNameForWorker();\n break;\n case TraceEngine.Handlers.Threads.ThreadType.RASTERIZER:\n threadTypeLabel = i18nString(UIStrings.raster);\n break;\n case TraceEngine.Handlers.Threads.ThreadType.THREAD_POOL:\n threadTypeLabel = i18nString(UIStrings.threadPool);\n break;\n case TraceEngine.Handlers.Threads.ThreadType.OTHER:\n break;\n case TraceEngine.Handlers.Threads.ThreadType.AUCTION_WORKLET:\n threadTypeLabel = this.#buildNameForAuctionWorklet();\n break;\n default:\n return Platform.assertNever(this.threadType, `Unknown thread type: ${this.threadType}`);\n }\n let suffix = '';\n if (this.#traceParsedData.Meta.traceIsGeneric) {\n suffix = suffix + ` (${this.threadId()})`;\n }\n return (threadTypeLabel || this.#threadDefaultName) + suffix;\n }\n\n getUrl(): string {\n return this.#url;\n }\n\n #buildNameForAuctionWorklet(): string {\n const workletMetadataEvent = this.#traceParsedData.AuctionWorklets.worklets.get(this.#processId);\n // We should always have this event - if we do not, we were instantiated with invalid data.\n if (!workletMetadataEvent) {\n return i18nString(UIStrings.unknownWorklet);\n }\n\n // Host could be empty - in which case we do not want to add it.\n const host = workletMetadataEvent.host ? `https://${workletMetadataEvent.host}` : '';\n const shouldAddHost = host.length > 0;\n\n // For each Auction Worklet in a page there are two threads we care about on the same process.\n // 1. The \"Worklet Service\" which is a generic helper service. This thread\n // is always named \"auction_worklet.CrUtilityMain\".\n //\n // 2. The \"Seller/Bidder\" service. This thread is always named\n // \"AuctionV8HelperThread\". The AuctionWorkets handler does the job of\n // figuring this out for us - the metadata event it provides for each\n // worklet process will have a `type` already set.\n //\n // Therefore, for this given thread, which we know is part of\n // an AuctionWorklet process, we need to figure out if this thread is the\n // generic service, or a seller/bidder worklet.\n //\n // Note that the worklet could also have the \"unknown\" type - this is not\n // expected but implemented to prevent trace event changes causing DevTools\n // to break with unknown worklet types.\n const isUtilityThread = workletMetadataEvent.args.data.utilityThread.tid === this.#threadId;\n const isBidderOrSeller = workletMetadataEvent.args.data.v8HelperThread.tid === this.#threadId;\n\n if (isUtilityThread) {\n return shouldAddHost ? i18nString(UIStrings.workletServiceS, {PH1: host}) : i18nString(UIStrings.workletService);\n }\n\n if (isBidderOrSeller) {\n switch (workletMetadataEvent.type) {\n case TraceEngine.Types.TraceEvents.AuctionWorkletType.SELLER:\n return shouldAddHost ? i18nString(UIStrings.sellerWorkletS, {PH1: host}) :\n i18nString(UIStrings.sellerWorklet);\n case TraceEngine.Types.TraceEvents.AuctionWorkletType.BIDDER:\n return shouldAddHost ? i18nString(UIStrings.bidderWorkletS, {PH1: host}) :\n i18nString(UIStrings.bidderWorklet);\n case TraceEngine.Types.TraceEvents.AuctionWorkletType.UNKNOWN:\n return shouldAddHost ? i18nString(UIStrings.unknownWorkletS, {PH1: host}) :\n i18nString(UIStrings.unknownWorklet);\n default:\n Platform.assertNever(\n workletMetadataEvent.type, `Unexpected Auction Worklet Type ${workletMetadataEvent.type}`);\n }\n }\n // We should never reach here, but just in case!\n return shouldAddHost ? i18nString(UIStrings.unknownWorkletS, {PH1: host}) : i18nString(UIStrings.unknownWorklet);\n }\n\n #buildNameForWorker(): string {\n const url = this.#traceParsedData.Renderer?.processes.get(this.#processId)?.url || '';\n const workerId = this.#traceParsedData.Workers.workerIdByThread.get(this.#threadId);\n const workerURL = workerId ? this.#traceParsedData.Workers.workerURLById.get(workerId) : url;\n // Try to create a name using the worker url if present. If not, use a generic label.\n let workerName =\n workerURL ? i18nString(UIStrings.workerS, {PH1: workerURL}) : i18nString(UIStrings.dedicatedWorker);\n const workerTarget = workerId !== undefined && SDK.TargetManager.TargetManager.instance().targetById(workerId);\n if (workerTarget) {\n // Get the worker name from the target, which corresponds to the name\n // assigned to the worker when it was constructed.\n workerName = i18nString(UIStrings.workerSS, {PH1: workerTarget.name(), PH2: url});\n }\n return workerName;\n }\n\n /**\n * Adds into the flame chart data the entries of this thread, which\n * includes trace events and JS calls.\n * @param currentLevel the flame chart level from which entries will\n * be appended.\n * @returns the next level after the last occupied by the appended\n * entries (the first available level to append more data).\n */\n #appendTreeAtLevel(trackStartLevel: number): number {\n // We can not used the tree maxDepth in the tree from the\n // RendererHandler because ignore listing and visibility of events\n // alter the final depth of the flame chart.\n return this.#appendNodesAtLevel(this.#tree.roots, trackStartLevel);\n }\n\n /**\n * Traverses the trees formed by the provided nodes in breadth first\n * fashion and appends each node's entry on each iteration. As each\n * entry is handled, a check for the its visibility or if it's ignore\n * listed is done before appending.\n */\n #appendNodesAtLevel(\n nodes: Iterable, startingLevel: number,\n parentIsIgnoredListed: boolean = false): number {\n const invisibleEntries = AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance()\n ?.getEntriesFilter()\n .invisibleEntries() ??\n [];\n let maxDepthInTree = startingLevel;\n for (const node of nodes) {\n let nextLevel = startingLevel;\n const entry = node.entry;\n const entryIsIgnoreListed = this.isIgnoreListedEntry(entry);\n // Events' visibility is determined from their predefined styles,\n // which is something that's not available in the engine data.\n // Thus it needs to be checked in the appenders, but preemptively\n // checking if there are visible events and returning early if not\n // is potentially expensive since, in theory, we would be adding\n // another traversal to the entries array (which could grow\n // large). To avoid the extra cost we add the check in the\n // traversal we already need to append events.\n const entryIsVisible = !invisibleEntries.includes(entry) &&\n (this.#compatibilityBuilder.entryIsVisibleInTimeline(entry) || this.#showAllEventsEnabled);\n // For ignore listing support, these two conditions need to be met\n // to not append a profile call to the flame chart:\n // 1. It is ignore listed\n // 2. It is NOT the bottom-most call in an ignore listed stack (a\n // set of chained profile calls that belong to ignore listed\n // URLs).\n // This means that all of the ignore listed calls are ignored (not\n // appended), except if it is the bottom call of an ignored stack.\n // This is becaue to represent ignore listed stack frames, we add\n // a flame chart entry with the length and position of the bottom\n // frame, which is distictively marked to denote an ignored listed\n // stack.\n const skipEventDueToIgnoreListing = entryIsIgnoreListed && parentIsIgnoredListed;\n if (entryIsVisible && !skipEventDueToIgnoreListing) {\n this.#appendEntryAtLevel(entry, startingLevel);\n nextLevel++;\n }\n\n const depthInChildTree = this.#appendNodesAtLevel(node.children, nextLevel, entryIsIgnoreListed);\n maxDepthInTree = Math.max(depthInChildTree, maxDepthInTree);\n }\n return maxDepthInTree;\n }\n\n #appendEntryAtLevel(entry: TraceEngine.Types.TraceEvents.TraceEventData, level: number): void {\n this.#ensureTrackHeaderAppended(level);\n const index = this.#compatibilityBuilder.appendEventAtLevel(entry, level, this);\n this.#addDecorationsToEntry(entry, index);\n }\n\n #addDecorationsToEntry(entry: TraceEngine.Types.TraceEvents.TraceEventData, index: number): void {\n const flameChartData = this.#compatibilityBuilder.getFlameChartTimelineData();\n if (AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance()?.getEntriesFilter().isEntryModified(\n entry)) {\n addDecorationToEvent(\n flameChartData, index, {type: PerfUI.FlameChart.FlameChartDecorationType.HIDDEN_DESCENDANTS_ARROW});\n }\n const warnings = this.#traceParsedData.Warnings.perEvent.get(entry);\n if (!warnings) {\n return;\n }\n addDecorationToEvent(flameChartData, index, {type: PerfUI.FlameChart.FlameChartDecorationType.WARNING_TRIANGLE});\n if (!warnings.includes('LONG_TASK')) {\n return;\n }\n addDecorationToEvent(flameChartData, index, {\n type: PerfUI.FlameChart.FlameChartDecorationType.CANDY,\n startAtTime: TraceEngine.Handlers.ModelHandlers.Warnings.LONG_MAIN_THREAD_TASK_THRESHOLD,\n });\n }\n\n isIgnoreListedEntry(entry: TraceEngine.Types.TraceEvents.TraceEventData): boolean {\n if (!this.#ignoreListingEnabled) {\n return false;\n }\n\n if (!TraceEngine.Types.TraceEvents.isProfileCall(entry)) {\n return false;\n }\n const url = entry.callFrame.url as Platform.DevToolsPath.UrlString;\n return url && this.isIgnoreListedURL(url);\n }\n\n private isIgnoreListedURL(url: Platform.DevToolsPath.UrlString): boolean {\n return Bindings.IgnoreListManager.IgnoreListManager.instance().isUserIgnoreListedURL(url);\n }\n\n /*\n ------------------------------------------------------------------------------------\n The following methods are invoked by the flame chart renderer to query features about\n events on rendering.\n ------------------------------------------------------------------------------------\n */\n\n /**\n * Gets the color an event added by this appender should be rendered with.\n */\n colorForEvent(event: TraceEngine.Types.TraceEvents.TraceEventData): string {\n if (this.#traceParsedData.Meta.traceIsGeneric) {\n return event.name ? `hsl(${Platform.StringUtilities.hashCode(event.name) % 300 + 30}, 40%, 70%)` : '#ccc';\n }\n\n if (TraceEngine.Types.TraceEvents.isProfileCall(event)) {\n if (event.callFrame.functionName === '(idle)') {\n return getCategoryStyles().idle.getComputedColorValue();\n }\n if (event.callFrame.scriptId === '0') {\n // If we can not match this frame to a script, return the\n // generic \"scripting\" color.\n return getCategoryStyles().scripting.getComputedColorValue();\n }\n // Otherwise, return a color created based on its URL.\n return this.#colorGenerator.colorForID(event.callFrame.url);\n }\n const defaultColor =\n getEventStyle(event.name as TraceEngine.Types.TraceEvents.KnownEventName)?.category.getComputedColorValue();\n return defaultColor || getCategoryStyles().other.getComputedColorValue();\n }\n\n /**\n * Gets the title an event added by this appender should be rendered with.\n */\n titleForEvent(entry: TraceEngine.Types.TraceEvents.TraceEventData): string {\n if (this.isIgnoreListedEntry(entry)) {\n return i18nString(UIStrings.onIgnoreList);\n }\n\n // If the event is a profile call, we need to look up its name based on its\n // ProfileNode in the CPUProfile for the trace we are working with.\n if (TraceEngine.Types.TraceEvents.isProfileCall(entry)) {\n // In the future traceParsedData.Samples will always be defined, but this\n // is not the case until the sync tracks migration is fully shipped,\n // hence this extra check.\n if (this.#traceParsedData.Samples) {\n const potentialCallName =\n TraceEngine.Handlers.ModelHandlers.Samples.getProfileCallFunctionName(this.#traceParsedData.Samples, entry);\n // We need this extra check because the call name could be the empty\n // string. If it is, we want to fallback to the \"(anonymous)\" text.\n if (potentialCallName) {\n return potentialCallName;\n }\n }\n\n return entry.callFrame.functionName || i18nString(UIStrings.anonymous);\n }\n\n if (TraceEngine.Types.TraceEvents.isTraceEventDispatch(entry)) {\n // EventDispatch represent user actions such as clicks, so in this case\n // rather than show the event title (which is always just \"Event\"), we\n // add the type (\"click\") to help the user understand the event.\n return i18nString(UIStrings.eventDispatchS, {PH1: entry.args.data.type});\n }\n\n const defaultName = getEventStyle(entry.name as TraceEngine.Types.TraceEvents.KnownEventName)?.title;\n return defaultName || entry.name;\n }\n\n /**\n * Returns the info shown when an event added by this appender\n * is hovered in the timeline.\n */\n highlightedEntryInfo(event: TraceEngine.Types.TraceEvents.SyntheticTraceEntry): HighlightedEntryInfo {\n let title = this.titleForEvent(event);\n if (TraceEngine.Types.TraceEvents.isTraceEventParseHTML(event)) {\n const startLine = event.args['beginData']['startLine'];\n const endLine = event.args['endData'] && event.args['endData']['endLine'];\n const eventURL = event.args['beginData']['url'] as Platform.DevToolsPath.UrlString;\n const url = Bindings.ResourceUtils.displayNameForURL(eventURL);\n const range = (endLine !== -1 || endLine === startLine) ? `${startLine}...${endLine}` : startLine;\n title += ` - ${url} [${range}]`;\n }\n return {title, formattedTime: getFormattedTime(event.dur, event.selfTime)};\n }\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/TimelineFlameChartDataProvider.js b/public/panels/timeline/TimelineFlameChartDataProvider.js index d41121e77..958966011 100644 --- a/public/panels/timeline/TimelineFlameChartDataProvider.js +++ b/public/panels/timeline/TimelineFlameChartDataProvider.js @@ -34,6 +34,7 @@ import * as Root from '../../core/root/root.js'; import * as Bindings from '../../models/bindings/bindings.js'; import * as TimelineModel from '../../models/timeline_model/timeline_model.js'; import * as TraceEngine from '../../models/trace/trace.js'; +import * as AnnotationsManager from '../../services/annotations_manager/annotations_manager.js'; import * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js'; import * as UI from '../../ui/legacy/legacy.js'; import * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js'; @@ -189,11 +190,13 @@ export class TimelineFlameChartDataProvider extends Common.ObjectWrapper.ObjectW } modifyTree(node, action) { const entry = this.entryData[node]; - TraceEngine.EntriesFilter.EntriesFilter.maybeInstance()?.applyFilterAction({ type: action, entry }); + AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance()?.getEntriesFilter().applyFilterAction({ type: action, entry }); } findPossibleContextMenuActions(node) { const entry = this.entryData[node]; - return TraceEngine.EntriesFilter.EntriesFilter.maybeInstance()?.findPossibleActions(entry); + return AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance() + ?.getEntriesFilter() + .findPossibleActions(entry); } buildGroupStyle(extra) { const defaultGroupStyle = { @@ -833,7 +836,9 @@ export class TimelineFlameChartDataProvider extends Common.ObjectWrapper.ObjectW delegatesFocus: undefined, }); const entry = this.entryData[entryIndex]; - const hiddenEntriesAmount = TraceEngine.EntriesFilter.EntriesFilter.maybeInstance()?.findHiddenDescendantsAmount(entry); + const hiddenEntriesAmount = AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance() + ?.getEntriesFilter() + .findHiddenDescendantsAmount(entry); if (!hiddenEntriesAmount) { return null; } @@ -1042,7 +1047,7 @@ export class TimelineFlameChartDataProvider extends Common.ObjectWrapper.ObjectW context.fillStyle = ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-cdt-base-container'); let desiredBoxStartX = timeToPixel(entry.processingStart); const desiredBoxEndX = timeToPixel(entry.processingEnd); - // If the entry has no processing time, ensure the box is 1px wide so at least it is visible. + // If the entry has no processing duration, ensure the box is 1px wide so at least it is visible. if (entry.processingEnd - entry.processingStart === 0) { desiredBoxStartX -= 1; } @@ -1187,7 +1192,7 @@ export class TimelineFlameChartDataProvider extends Common.ObjectWrapper.ObjectW // Try revealing the entry and getting the index again. if (this.entryData.indexOf(selection.object) === -1 && TimelineSelection.isTraceEventSelection(selection.object)) { if (this.timelineDataInternal?.selectedGroup) { - TraceEngine.EntriesFilter.EntriesFilter.maybeInstance()?.revealEntry(selection.object); + AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance()?.getEntriesFilter().revealEntry(selection.object); this.timelineData(true); } } @@ -1260,8 +1265,14 @@ export class TimelineFlameChartDataProvider extends Common.ObjectWrapper.ObjectW // Reset to clear any previous arrows from the last event. this.timelineDataInternal.resetFlowData(); this.lastInitiatorEntry = entryIndex; - const hiddenEvents = TraceEngine.EntriesFilter.EntriesFilter.maybeInstance()?.invisibleEntries() ?? []; - const modifiedEntries = TraceEngine.EntriesFilter.EntriesFilter.maybeInstance()?.modifiedEntries() ?? []; + const hiddenEvents = AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance() + ?.getEntriesFilter() + .invisibleEntries() ?? + []; + const modifiedEntries = AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance() + ?.getEntriesFilter() + .modifiedEntries() ?? + []; const initiatorsData = initiatorsDataToDraw(this.traceEngineData, event, hiddenEvents, modifiedEntries); // This means there is no change for arrows. if (previousInitiatorsDataLength === 0 && initiatorsData.length === 0) { diff --git a/public/panels/timeline/TimelineFlameChartDataProvider.js.map b/public/panels/timeline/TimelineFlameChartDataProvider.js.map index 06e9bc1ea..561f579b1 100644 --- a/public/panels/timeline/TimelineFlameChartDataProvider.js.map +++ b/public/panels/timeline/TimelineFlameChartDataProvider.js.map @@ -1 +1 @@ -{"version":3,"file":"TimelineFlameChartDataProvider.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineFlameChartDataProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,aAAa,MAAM,+CAA+C,CAAC;AAC/E,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,+CAA+C,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAChD,OAAO,KAAK,YAAY,MAAM,gDAAgD,CAAC;AAE/E,OAAO,EAAC,aAAa,EAAC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AAI,IAAI,cAAc,KAAK,IAAI,EAAE,CAAC;gBACnD,SAAS;YACX,CAAC;YACD,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,IAAI,CAAC;gBAC5C,cAAc;gBACd,UAAU;gBACV,iBAAiB,EAAE,YAAY,CAAC,iBAAiB;gBACjD,aAAa,EAAE,YAAY,CAAC,aAAa;aAC1C,CAAC,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,CAAC,UAAkB;QAC7B,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;YACnB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAC7C,IAAI,SAAS,kDAA4B,EAAE,CAAC;YAC1C,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAiD,CAAC;QACpF,CAAC;QACD,IAAI,SAAS,kCAAoB,EAAE,CAAC;YAClC,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAA6B,CAAC;QAChE,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,oBAAoB,CAAC,aAAyD;QAC5E,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAED,kCAAkC;IAClC,6DAA6D;IAC7D,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACrC,CAAC;CACF;AAED,MAAM,CAAC,MAAM,6BAA6B,GAAG,KAAK,CAAC","sourcesContent":["/*\n * Copyright (C) 2014 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as Root from '../../core/root/root.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as TimelineModel from '../../models/timeline_model/timeline_model.js';\nimport * as TraceEngine from '../../models/trace/trace.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js';\n\nimport {ActiveFilters} from './ActiveFilters.js';\nimport {CompatibilityTracksAppender, type TrackAppenderName} from './CompatibilityTracksAppender.js';\nimport * as Components from './components/components.js';\nimport {type TimelineCategory} from './EventUICategory.js';\nimport {initiatorsDataToDraw} from './Initiators.js';\nimport {type PerformanceModel} from './PerformanceModel.js';\nimport {ThreadAppender} from './ThreadAppender.js';\nimport timelineFlamechartPopoverStyles from './timelineFlamechartPopover.css.js';\nimport {FlameChartStyle, Selection} from './TimelineFlameChartView.js';\nimport {TimelineSelection} from './TimelineSelection.js';\nimport {TimelineUIUtils} from './TimelineUIUtils.js';\n\nconst UIStrings = {\n /**\n *@description Text in Timeline Flame Chart Data Provider of the Performance panel\n */\n onIgnoreList: 'On ignore list',\n /**\n * @description Text in Timeline Flame Chart Data Provider of the Performance panel *\n * @example{example.com} PH1\n */\n mainS: 'Main — {PH1}',\n /**\n * @description Text that refers to the main target\n */\n main: 'Main',\n /**\n * @description Text in Timeline Flame Chart Data Provider of the Performance panel * @example {https://example.com} PH1\n */\n frameS: 'Frame — {PH1}',\n /**\n *@description Text in Timeline Flame Chart Data Provider of the Performance panel\n */\n subframe: 'Subframe',\n /**\n *@description Text in Timeline Flame Chart Data Provider of the Performance panel\n */\n raster: 'Raster',\n /**\n *@description Text in Timeline Flame Chart Data Provider of the Performance panel\n *@example {2} PH1\n */\n rasterizerThreadS: 'Rasterizer Thread {PH1}',\n /**\n *@description Text in Timeline Flame Chart Data Provider of the Performance panel\n */\n thread: 'Thread',\n /**\n *@description Text for rendering frames\n */\n frames: 'Frames',\n /**\n * @description Text in the Performance panel to show how long was spent in a particular part of the code.\n * The first placeholder is the total time taken for this node and all children, the second is the self time\n * (time taken in this node, without children included).\n *@example {10ms} PH1\n *@example {10ms} PH2\n */\n sSelfS: '{PH1} (self {PH2})',\n /**\n *@description Text in Timeline Flame Chart Data Provider of the Performance panel\n */\n idleFrame: 'Idle Frame',\n /**\n *@description Text in Timeline Frame Chart Data Provider of the Performance panel\n */\n droppedFrame: 'Dropped Frame',\n /**\n *@description Text in Timeline Frame Chart Data Provider of the Performance panel\n */\n partiallyPresentedFrame: 'Partially Presented Frame',\n /**\n *@description Text for a rendering frame\n */\n frame: 'Frame',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/TimelineFlameChartDataProvider.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\n// at the moment there are two types defined for trace events: traceeventdata and\n// SDK.TracingModel.Event. This is only for compatibility between the legacy system\n// and the new system proposed in go/rpp-flamechart-arch. In the future, once all\n// tracks have been migrated to the new system, all entries will be of the\n// TraceEventData type.\nexport type TimelineFlameChartEntry =\n (TraceEngine.Legacy.Event|TraceEngine.Handlers.ModelHandlers.Frames.TimelineFrame|\n TraceEngine.Types.TraceEvents.TraceEventData);\nexport class TimelineFlameChartDataProvider extends Common.ObjectWrapper.ObjectWrapper implements\n PerfUI.FlameChart.FlameChartDataProvider {\n private droppedFramePatternCanvas: HTMLCanvasElement;\n private partialFramePatternCanvas: HTMLCanvasElement;\n private timelineDataInternal: PerfUI.FlameChart.FlameChartTimelineData|null;\n private currentLevel: number;\n\n // The Performance and the Timeline models are expected to be\n // deprecated in favor of using traceEngineData (new RPP engine) only\n // as part of the work in crbug.com/1386091. For this reason they\n // have the \"legacy\" prefix on their name.\n private legacyPerformanceModel: PerformanceModel|null;\n private compatibilityTracksAppender: CompatibilityTracksAppender|null;\n private legacyTimelineModel: TimelineModel.TimelineModel.TimelineModelImpl|null;\n private traceEngineData: TraceEngine.Handlers.Types.TraceParseData|null;\n private isCpuProfile = false;\n /**\n * Raster threads are tracked and enumerated with this property. This is also\n * used to group all raster threads together in the same track, instead of\n * rendering a track for thread.\n */\n #rasterCount: number = 0;\n\n private minimumBoundaryInternal: number;\n private timeSpan: number;\n private readonly headerLevel1: PerfUI.FlameChart.GroupStyle;\n private readonly headerLevel2: PerfUI.FlameChart.GroupStyle;\n private readonly staticHeader: PerfUI.FlameChart.GroupStyle;\n private framesHeader: PerfUI.FlameChart.GroupStyle;\n private readonly screenshotsHeader: PerfUI.FlameChart.GroupStyle;\n private entryData!: TimelineFlameChartEntry[];\n private entryTypeByLevel!: EntryType[];\n private screenshotImageCache!: Map;\n private entryIndexToTitle!: string[];\n private asyncColorByCategory!: Map;\n private lastInitiatorEntry!: number;\n private entryParent!: TraceEngine.Legacy.Event[];\n private lastSelection?: Selection;\n private colorForEvent?: ((arg0: TraceEngine.Legacy.Event) => string);\n #eventToDisallowRoot = new WeakMap();\n #font: string;\n #eventIndexByEvent: WeakMap = new WeakMap();\n\n constructor() {\n super();\n this.reset();\n this.#font = `${PerfUI.Font.DEFAULT_FONT_SIZE} ${PerfUI.Font.getFontFamilyForCanvas()}`;\n this.droppedFramePatternCanvas = document.createElement('canvas');\n this.partialFramePatternCanvas = document.createElement('canvas');\n this.preparePatternCanvas();\n this.timelineDataInternal = null;\n this.currentLevel = 0;\n this.legacyPerformanceModel = null;\n this.legacyTimelineModel = null;\n this.compatibilityTracksAppender = null;\n this.traceEngineData = null;\n this.minimumBoundaryInternal = 0;\n this.timeSpan = 0;\n\n this.headerLevel1 = this.buildGroupStyle({shareHeaderLine: false});\n this.headerLevel2 = this.buildGroupStyle({padding: 2, nestingLevel: 1, collapsible: false});\n this.staticHeader = this.buildGroupStyle({collapsible: false});\n this.framesHeader = this.buildGroupStyle({useFirstLineForOverview: true});\n this.screenshotsHeader =\n this.buildGroupStyle({useFirstLineForOverview: true, nestingLevel: 1, collapsible: false, itemsHeight: 150});\n\n ThemeSupport.ThemeSupport.instance().addEventListener(ThemeSupport.ThemeChangeEvent.eventName, () => {\n const headers = [\n this.headerLevel1,\n this.headerLevel2,\n this.staticHeader,\n this.framesHeader,\n this.screenshotsHeader,\n ];\n for (const header of headers) {\n header.color = ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-on-surface');\n header.backgroundColor =\n ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-cdt-base-container');\n }\n });\n }\n\n modifyTree(node: number, action: TraceEngine.EntriesFilter.FilterAction): void {\n const entry = this.entryData[node] as TraceEngine.Types.TraceEvents.SyntheticTraceEntry;\n TraceEngine.EntriesFilter.EntriesFilter.maybeInstance()?.applyFilterAction({type: action, entry});\n }\n\n findPossibleContextMenuActions(node: number): TraceEngine.EntriesFilter.PossibleFilterActions|void {\n const entry = this.entryData[node] as TraceEngine.Types.TraceEvents.SyntheticTraceEntry;\n return TraceEngine.EntriesFilter.EntriesFilter.maybeInstance()?.findPossibleActions(entry);\n }\n\n private buildGroupStyle(extra: Object): PerfUI.FlameChart.GroupStyle {\n const defaultGroupStyle = {\n padding: 4,\n height: 17,\n collapsible: true,\n color: ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-on-surface'),\n backgroundColor: ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-cdt-base-container'),\n nestingLevel: 0,\n shareHeaderLine: true,\n };\n return Object.assign(defaultGroupStyle, extra);\n }\n\n setModel(\n performanceModel: PerformanceModel|null, newTraceEngineData: TraceEngine.Handlers.Types.TraceParseData|null,\n isCpuProfile = false): void {\n this.reset();\n this.legacyPerformanceModel = performanceModel;\n this.legacyTimelineModel = performanceModel && performanceModel.timelineModel();\n this.traceEngineData = newTraceEngineData;\n\n this.isCpuProfile = isCpuProfile;\n if (newTraceEngineData) {\n const {traceBounds} = newTraceEngineData.Meta;\n const minTime = TraceEngine.Helpers.Timing.microSecondsToMilliseconds(traceBounds.min);\n const maxTime = TraceEngine.Helpers.Timing.microSecondsToMilliseconds(traceBounds.max);\n this.minimumBoundaryInternal = minTime;\n this.timeSpan = minTime === maxTime ? 1000 : maxTime - this.minimumBoundaryInternal;\n }\n }\n\n /**\n * Instances and caches a CompatibilityTracksAppender using the\n * internal flame chart data and the trace parsed data coming from the\n * trace engine.\n * The model data must have been set to the data provider instance before\n * attempting to instance the CompatibilityTracksAppender.\n */\n compatibilityTracksAppenderInstance(forceNew = false): CompatibilityTracksAppender {\n if (!this.compatibilityTracksAppender || forceNew) {\n if (!this.traceEngineData || !this.legacyTimelineModel) {\n throw new Error(\n 'Attempted to instantiate a CompatibilityTracksAppender without having set the trace parse data first.');\n }\n this.timelineDataInternal = this.#instantiateTimelineData();\n this.compatibilityTracksAppender = new CompatibilityTracksAppender(\n this.timelineDataInternal, this.traceEngineData, this.entryData, this.entryTypeByLevel,\n this.legacyTimelineModel);\n }\n return this.compatibilityTracksAppender;\n }\n\n /**\n * Returns the instance of the timeline flame chart data, without\n * adding data to it. In case the timeline data hasn't been instanced\n * creates a new instance and returns it.\n */\n #instantiateTimelineData(): PerfUI.FlameChart.FlameChartTimelineData {\n if (!this.timelineDataInternal) {\n this.timelineDataInternal = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n }\n return this.timelineDataInternal;\n }\n\n /**\n * Builds the flame chart data using the track appenders\n */\n buildFromTrackAppenders(options?: {filterThreadsByName?: string, expandedTracks?: Set}): void {\n if (!this.compatibilityTracksAppender) {\n return;\n }\n const appenders = this.compatibilityTracksAppender.allVisibleTrackAppenders();\n for (const appender of appenders) {\n const skipThreadAppenderByName =\n appender instanceof ThreadAppender && !appender.trackName().includes(options?.filterThreadsByName || '');\n if (skipThreadAppenderByName) {\n continue;\n }\n const expanded = Boolean(options?.expandedTracks?.has(appender.appenderName));\n this.currentLevel = appender.appendTrackAtLevel(this.currentLevel, expanded);\n }\n }\n\n groupTrack(group: PerfUI.FlameChart.Group): TimelineModel.TimelineModel.Track|null {\n return group.track || null;\n }\n\n groupTreeEvents(group: PerfUI.FlameChart.Group): TraceEngine.Types.TraceEvents.TraceEventData[]|null {\n return this.compatibilityTracksAppender?.groupEventsForTreeView(group) ?? null;\n }\n\n mainFrameNavigationStartEvents(): readonly TraceEngine.Types.TraceEvents.TraceEventNavigationStart[] {\n if (!this.traceEngineData) {\n return [];\n }\n return this.traceEngineData.Meta.mainFrameNavigations;\n }\n\n entryTitle(entryIndex: number): string|null {\n const entryType = this.entryType(entryIndex);\n if (entryType === EntryType.Event) {\n const event = (this.entryData[entryIndex] as TraceEngine.Legacy.Event);\n if (event.phase === TraceEngine.Types.TraceEvents.Phase.ASYNC_STEP_INTO ||\n event.phase === TraceEngine.Types.TraceEvents.Phase.ASYNC_STEP_PAST) {\n return event.name + ':' + event.args['step'];\n }\n if (this.#eventToDisallowRoot.get(event)) {\n return i18nString(UIStrings.onIgnoreList);\n }\n return TimelineUIUtils.eventTitle(event);\n }\n if (entryType === EntryType.Screenshot) {\n return '';\n }\n if (entryType === EntryType.TrackAppender) {\n const timelineData = (this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData);\n const eventLevel = timelineData.entryLevels[entryIndex];\n const event = (this.entryData[entryIndex] as TraceEngine.Types.TraceEvents.TraceEventData);\n return this.compatibilityTracksAppender?.titleForEvent(event, eventLevel) || null;\n }\n let title: Common.UIString.LocalizedString|string = this.entryIndexToTitle[entryIndex];\n if (!title) {\n title = `Unexpected entryIndex ${entryIndex}`;\n console.error(title);\n }\n return title;\n }\n\n textColor(index: number): string {\n const event = this.entryData[index];\n if (!TimelineFlameChartDataProvider.isEntryRegularEvent(event)) {\n return FlameChartStyle.textColor;\n }\n return this.isIgnoreListedEvent(event) ? '#888' : FlameChartStyle.textColor;\n }\n\n entryFont(_index: number): string|null {\n return this.#font;\n }\n\n // resetCompatibilityTracksAppender boolean set to false does not recreate the thread appenders\n reset(resetCompatibilityTracksAppender: boolean = true): void {\n this.currentLevel = 0;\n this.entryData = [];\n this.entryParent = [];\n this.entryTypeByLevel = [];\n this.entryIndexToTitle = [];\n this.asyncColorByCategory = new Map();\n this.screenshotImageCache = new Map();\n this.#eventIndexByEvent = new Map();\n this.#eventToDisallowRoot = new WeakMap();\n if (resetCompatibilityTracksAppender) {\n this.compatibilityTracksAppender = null;\n this.timelineDataInternal = null;\n } else if (!resetCompatibilityTracksAppender && this.timelineDataInternal) {\n this.compatibilityTracksAppender?.setFlameChartDataAndEntryData(\n this.timelineDataInternal, this.entryData, this.entryTypeByLevel);\n this.compatibilityTracksAppender?.threadAppenders().forEach(\n threadAppender => threadAppender.setHeaderAppended(false));\n }\n }\n\n maxStackDepth(): number {\n return this.currentLevel;\n }\n\n /**\n * Builds the flame chart data using the tracks appender (which use\n * the new trace engine) and the legacy code paths present in this\n * file. The result built data is cached and returned.\n */\n timelineData(rebuild: boolean = false): PerfUI.FlameChart.FlameChartTimelineData {\n if (this.timelineDataInternal && this.timelineDataInternal.entryLevels.length !== 0 && !rebuild) {\n // The flame chart data is built already, so return the cached\n // data.\n return this.timelineDataInternal;\n }\n\n this.timelineDataInternal = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n if (!this.legacyTimelineModel) {\n return this.timelineDataInternal;\n }\n\n if (rebuild) {\n this.reset(/* resetCompatibilityTracksAppender= */ false);\n }\n\n this.currentLevel = 0;\n\n if (this.traceEngineData) {\n this.compatibilityTracksAppender = this.compatibilityTracksAppenderInstance();\n if (this.traceEngineData.Meta.traceIsGeneric) {\n this.#processGenericTrace();\n } else {\n this.processInspectorTrace();\n }\n }\n\n return this.timelineDataInternal;\n }\n\n #processGenericTrace(): void {\n if (!this.compatibilityTracksAppender) {\n return;\n }\n\n const appendersByProcess = this.compatibilityTracksAppender.allThreadAppendersByProcess();\n\n for (const [pid, threadAppenders] of appendersByProcess) {\n const processGroupStyle = this.buildGroupStyle({shareHeaderLine: false});\n const processName = this.traceEngineData?.Meta.processNames.get(pid)?.args.name || 'Process';\n this.appendHeader(`${processName} (${pid})`, processGroupStyle, true, false);\n for (const appender of threadAppenders) {\n appender.setHeaderNestingLevel(1);\n this.currentLevel = appender.appendTrackAtLevel(this.currentLevel);\n }\n }\n }\n\n private processInspectorTrace(): void {\n if (!this.isCpuProfile) {\n this.appendFrames();\n }\n\n const weight = (track: {type?: string, forMainFrame?: boolean, appenderName?: TrackAppenderName}): number => {\n if (track.appenderName !== undefined) {\n switch (track.appenderName) {\n case 'Animations':\n return 0;\n case 'Timings':\n return 1;\n case 'Interactions':\n return 2;\n case 'LayoutShifts':\n return 3;\n case 'GPU':\n return 8;\n case 'Thread':\n return 4;\n case 'Thread_AuctionWorklet':\n return 10;\n default:\n return -1;\n }\n }\n\n switch (track.type) {\n case TimelineModel.TimelineModel.TrackType.MainThread:\n return track.forMainFrame ? 5 : 6;\n case TimelineModel.TimelineModel.TrackType.Worker:\n return 7;\n case TimelineModel.TimelineModel.TrackType.Raster:\n return 9;\n case TimelineModel.TimelineModel.TrackType.Other:\n return 11;\n default:\n return -1;\n }\n };\n\n if (!this.legacyTimelineModel) {\n return;\n }\n const allTrackAppenders =\n this.compatibilityTracksAppender ? this.compatibilityTracksAppender.allVisibleTrackAppenders() : [];\n\n allTrackAppenders.sort((a, b) => weight(a) - weight(b));\n\n for (const appender of allTrackAppenders) {\n if (!this.traceEngineData) {\n continue;\n }\n\n this.currentLevel = appender.appendTrackAtLevel(this.currentLevel);\n\n // If there is not a selected group, we want to default to selecting the\n // main thread track. Therefore in this check we look to see if the\n // current appender is a ThreadAppender and represnets the Main Thread.\n // If it is, we mark the group as selected.\n if (this.timelineDataInternal && !this.timelineDataInternal.selectedGroup) {\n if (appender instanceof ThreadAppender &&\n (appender.threadType === TraceEngine.Handlers.Threads.ThreadType.MAIN_THREAD ||\n appender.threadType === TraceEngine.Handlers.Threads.ThreadType.CPU_PROFILE)) {\n const group = this.compatibilityTracksAppender?.groupForAppender(appender);\n if (group) {\n this.timelineDataInternal.selectedGroup = group;\n }\n }\n }\n }\n if (this.timelineDataInternal && this.timelineDataInternal.selectedGroup) {\n this.timelineDataInternal.selectedGroup.expanded = true;\n }\n }\n\n #addDecorationToEvent(eventIndex: number, decoration: PerfUI.FlameChart.FlameChartDecoration): void {\n if (!this.timelineDataInternal) {\n return;\n }\n const decorationsForEvent = this.timelineDataInternal.entryDecorations[eventIndex] || [];\n decorationsForEvent.push(decoration);\n this.timelineDataInternal.entryDecorations[eventIndex] = decorationsForEvent;\n }\n\n /**\n * Appends a track in the flame chart using the legacy system.\n * @param track the legacy track to be rendered.\n * @param expanded if the track is expanded.\n */\n appendLegacyTrackData(track: TimelineModel.TimelineModel.Track, expanded?: boolean): void {\n this.#instantiateTimelineData();\n const eventEntryType = EntryType.Event;\n switch (track.type) {\n case TimelineModel.TimelineModel.TrackType.MainThread: {\n if (track.forMainFrame) {\n const group = this.appendSyncEvents(\n track, track.events,\n track.url ? i18nString(UIStrings.mainS, {PH1: track.url}) : i18nString(UIStrings.main), this.headerLevel1,\n eventEntryType, true /* selectable */, expanded);\n if (group && this.timelineDataInternal) {\n this.timelineDataInternal.selectedGroup = group;\n }\n } else {\n this.appendSyncEvents(\n track, track.events,\n track.url ? i18nString(UIStrings.frameS, {PH1: track.url}) : i18nString(UIStrings.subframe),\n this.headerLevel1, eventEntryType, true /* selectable */, expanded);\n }\n break;\n }\n\n case TimelineModel.TimelineModel.TrackType.Worker: {\n this.appendSyncEvents(\n track, track.events, track.name, this.headerLevel1, eventEntryType, true /* selectable */, expanded);\n break;\n }\n\n case TimelineModel.TimelineModel.TrackType.Raster: {\n if (!this.#rasterCount) {\n this.appendHeader(i18nString(UIStrings.raster), this.headerLevel1, false /* selectable */, expanded);\n }\n ++this.#rasterCount;\n this.appendSyncEvents(\n track, track.events, i18nString(UIStrings.rasterizerThreadS, {PH1: this.#rasterCount}), this.headerLevel2,\n eventEntryType, true /* selectable */, expanded);\n break;\n }\n\n case TimelineModel.TimelineModel.TrackType.Other: {\n this.appendSyncEvents(\n track, track.events, track.name || i18nString(UIStrings.thread), this.headerLevel1, eventEntryType,\n true /* selectable */, expanded);\n this.appendAsyncEventsGroup(\n track, track.name, track.asyncEvents, this.headerLevel1, eventEntryType, true /* selectable */, expanded);\n break;\n }\n }\n }\n minimumBoundary(): number {\n return this.minimumBoundaryInternal;\n }\n\n totalTime(): number {\n return this.timeSpan;\n }\n\n /**\n * Narrows an entry of type TimelineFlameChartEntry to the 2 types of\n * simple trace events (legacy and new engine definitions).\n */\n static isEntryRegularEvent(entry: TimelineFlameChartEntry):\n entry is(TraceEngine.Types.TraceEvents.TraceEventData|TraceEngine.Legacy.Event) {\n return 'name' in entry;\n }\n\n search(startTime: number, endTime: number, filter: TimelineModel.TimelineModelFilter.TimelineModelFilter): number[] {\n const result = [];\n this.timelineData();\n for (let i = 0; i < this.entryData.length; ++i) {\n const entry = this.entryData[i];\n if (!TimelineFlameChartDataProvider.isEntryRegularEvent(entry)) {\n continue;\n }\n if (!entry) {\n continue;\n }\n\n // Until all the tracks are powered by the new engine, we need to\n // consider that these entries could be either new engine or legacy\n // engine.\n const entryStartTime = TraceEngine.Legacy.eventIsFromNewEngine(entry) ?\n TraceEngine.Helpers.Timing.eventTimingsMilliSeconds(entry).startTime :\n entry.startTime;\n const entryEndTime = TraceEngine.Legacy.eventIsFromNewEngine(entry) ?\n TraceEngine.Helpers.Timing.eventTimingsMilliSeconds(entry).endTime :\n entry.endTime;\n\n if (entryStartTime > endTime) {\n continue;\n }\n if ((entryEndTime || entryStartTime) < startTime) {\n continue;\n }\n if (filter.accept(entry, this.traceEngineData || undefined)) {\n result.push(i);\n }\n }\n result.sort((a, b) => {\n let firstEvent: TimelineFlameChartEntry|null = this.entryData[a];\n let secondEvent: TimelineFlameChartEntry|null = this.entryData[b];\n if (!TimelineFlameChartDataProvider.isEntryRegularEvent(firstEvent) ||\n !TimelineFlameChartDataProvider.isEntryRegularEvent(secondEvent)) {\n return 0;\n }\n firstEvent = firstEvent instanceof TraceEngine.Legacy.Event ?\n firstEvent :\n (this.compatibilityTracksAppender?.getLegacyEvent(firstEvent) || null);\n secondEvent = secondEvent instanceof TraceEngine.Legacy.Event ?\n secondEvent :\n (this.compatibilityTracksAppender?.getLegacyEvent(secondEvent) || null);\n if (!firstEvent || !secondEvent) {\n return 0;\n }\n return TraceEngine.Legacy.Event.compareStartTime(firstEvent, secondEvent);\n });\n return result;\n }\n\n private appendSyncEvents(\n track: TimelineModel.TimelineModel.Track|null, events: TraceEngine.Legacy.Event[], title: string|null,\n style: PerfUI.FlameChart.GroupStyle|null, entryType: EntryType, selectable: boolean,\n expanded?: boolean): PerfUI.FlameChart.Group|null {\n if (!events.length) {\n return null;\n }\n if (!this.legacyPerformanceModel || !this.legacyTimelineModel) {\n return null;\n }\n const openEvents = [];\n const ignoreListingEnabled = Root.Runtime.experiments.isEnabled('ignore-list-js-frames-on-timeline');\n let maxStackDepth = 0;\n let group: PerfUI.FlameChart.Group|null = null;\n if (track && track.type === TimelineModel.TimelineModel.TrackType.MainThread) {\n group = this.appendHeader((title as string), (style as PerfUI.FlameChart.GroupStyle), selectable, expanded);\n group.track = track;\n }\n for (let i = 0; i < events.length; ++i) {\n const event = events[i];\n const {duration: eventDuration} = TraceEngine.Legacy.timesForEventInMilliseconds(event);\n // TODO(crbug.com/1386091) this check should happen at the model level.\n // Skip Layout Shifts and TTI events when dealing with the main thread.\n if (this.legacyPerformanceModel) {\n const isInteractiveTime = this.legacyPerformanceModel.timelineModel().isInteractiveTimeEvent(event);\n const isLayoutShift = this.legacyPerformanceModel.timelineModel().isLayoutShiftEvent(event);\n const skippableEvent = isInteractiveTime || isLayoutShift;\n\n if (track && track.type === TimelineModel.TimelineModel.TrackType.MainThread && skippableEvent) {\n continue;\n }\n }\n\n if (!TraceEngine.Types.TraceEvents.isFlowPhase(event.phase)) {\n if (!event.endTime && event.phase !== TraceEngine.Types.TraceEvents.Phase.INSTANT) {\n continue;\n }\n if (TraceEngine.Types.TraceEvents.isAsyncPhase(event.phase)) {\n continue;\n }\n if (!ActiveFilters.instance().isVisible(event)) {\n continue;\n }\n }\n // Handle events belonging to a stack. E.g. A call stack in the main thread flame chart.\n while (openEvents.length &&\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // @ts-expect-error\n ((openEvents[openEvents.length - 1] as TraceEngine.Legacy.Event).endTime) <= event.startTime) {\n openEvents.pop();\n }\n this.#eventToDisallowRoot.set(event, false);\n if (ignoreListingEnabled && this.isIgnoreListedEvent(event)) {\n const parent = openEvents[openEvents.length - 1];\n if (parent && this.#eventToDisallowRoot.get(parent)) {\n continue;\n }\n this.#eventToDisallowRoot.set(event, true);\n }\n if (!group && title) {\n group = this.appendHeader(title, (style as PerfUI.FlameChart.GroupStyle), selectable, expanded);\n if (selectable) {\n group.track = track;\n }\n }\n\n const level = this.currentLevel + openEvents.length;\n const index = this.appendEvent(event, level);\n if (openEvents.length) {\n this.entryParent[index] = (openEvents[openEvents.length - 1] as TraceEngine.Legacy.Event);\n }\n\n const trackIsMainThreadMainFrame =\n Boolean(track?.forMainFrame && track?.type === TimelineModel.TimelineModel.TrackType.MainThread);\n // If we are dealing with the Main Thread, find any long tasks and add\n // the candy striping to them. Doing it here avoids having to do another\n // pass through the events at a later point.\n if (trackIsMainThreadMainFrame && event.name === TimelineModel.TimelineModel.RecordType.Task &&\n TraceEngine.Helpers.Timing.millisecondsToMicroseconds(eventDuration) >\n TraceEngine.Handlers.ModelHandlers.Warnings.LONG_MAIN_THREAD_TASK_THRESHOLD) {\n this.#addDecorationToEvent(index, {\n type: PerfUI.FlameChart.FlameChartDecorationType.CANDY,\n startAtTime: TraceEngine.Handlers.ModelHandlers.Warnings.LONG_MAIN_THREAD_TASK_THRESHOLD,\n });\n }\n maxStackDepth = Math.max(maxStackDepth, openEvents.length + 1);\n if (event.endTime) {\n openEvents.push(event);\n }\n }\n this.entryTypeByLevel.length = this.currentLevel + maxStackDepth;\n this.entryTypeByLevel.fill(entryType, this.currentLevel);\n this.currentLevel += maxStackDepth;\n return group;\n }\n\n isIgnoreListedEvent(event: TraceEngine.Legacy.CompatibleTraceEvent): boolean {\n if (TraceEngine.Legacy.eventIsFromNewEngine(event) && TraceEngine.Types.TraceEvents.isProfileCall(event)) {\n return this.isIgnoreListedURL(event.callFrame.url as Platform.DevToolsPath.UrlString);\n }\n return false;\n }\n\n private isIgnoreListedURL(url: Platform.DevToolsPath.UrlString): boolean {\n return Bindings.IgnoreListManager.IgnoreListManager.instance().isUserIgnoreListedURL(url);\n }\n\n private appendAsyncEventsGroup(\n track: TimelineModel.TimelineModel.Track|null, title: string|null, events: TraceEngine.Legacy.AsyncEvent[],\n style: PerfUI.FlameChart.GroupStyle|null, entryType: EntryType, selectable: boolean,\n expanded?: boolean): PerfUI.FlameChart.Group|null {\n if (!events.length) {\n return null;\n }\n const lastUsedTimeByLevel: number[] = [];\n let group: PerfUI.FlameChart.Group|null = null;\n for (let i = 0; i < events.length; ++i) {\n const asyncEvent = events[i];\n if (!this.legacyPerformanceModel || !ActiveFilters.instance().isVisible(asyncEvent)) {\n continue;\n }\n if (!group && title) {\n group = this.appendHeader(title, (style as PerfUI.FlameChart.GroupStyle), selectable, expanded);\n if (selectable) {\n group.track = track;\n }\n }\n const startTime = asyncEvent.startTime;\n let level;\n for (level = 0; level < lastUsedTimeByLevel.length && lastUsedTimeByLevel[level] > startTime; ++level) {\n }\n this.appendAsyncEvent(asyncEvent, this.currentLevel + level);\n lastUsedTimeByLevel[level] = (asyncEvent.endTime as number);\n }\n this.entryTypeByLevel.length = this.currentLevel + lastUsedTimeByLevel.length;\n this.entryTypeByLevel.fill(entryType, this.currentLevel);\n this.currentLevel += lastUsedTimeByLevel.length;\n return group;\n }\n\n getEntryTypeForLevel(level: number): EntryType {\n return this.entryTypeByLevel[level];\n }\n\n private appendFrames(): void {\n if (!this.legacyPerformanceModel || !this.timelineDataInternal || !this.legacyTimelineModel ||\n !this.traceEngineData) {\n return;\n }\n\n // TODO: Long term we want to move both the Frames track and the screenshots\n // track into the TrackAppender system. However right now the frames track\n // expects data in a different form to how the new engine parses frame\n // information. Therefore we have migrated the screenshots to use the new\n // data model in place without creating a new TrackAppender. When we can\n // migrate the frames track to the new appender system, we can migrate the\n // screnshots then as well.\n const filmStrip = TraceEngine.Extras.FilmStrip.fromTraceData(this.traceEngineData);\n const hasScreenshots = filmStrip.frames.length > 0;\n\n this.framesHeader.collapsible = hasScreenshots;\n const expanded = Root.Runtime.Runtime.queryParam('flamechart-force-expand') === 'frames';\n\n this.appendHeader(i18nString(UIStrings.frames), this.framesHeader, false /* selectable */, expanded);\n\n this.entryTypeByLevel[this.currentLevel] = EntryType.Frame;\n for (const frame of this.traceEngineData.Frames.frames) {\n this.#appendNewEngineFrame(frame);\n }\n ++this.currentLevel;\n\n if (!hasScreenshots) {\n return;\n }\n this.#appendScreenshots(filmStrip);\n }\n\n #appendScreenshots(filmStrip: TraceEngine.Extras.FilmStrip.Data): void {\n if (!this.timelineDataInternal || !this.legacyTimelineModel) {\n return;\n }\n this.appendHeader('', this.screenshotsHeader, false /* selectable */);\n this.entryTypeByLevel[this.currentLevel] = EntryType.Screenshot;\n let prevTimestamp: TraceEngine.Types.Timing.MilliSeconds|undefined = undefined;\n\n for (const filmStripFrame of filmStrip.frames) {\n const screenshotTimeInMilliSeconds =\n TraceEngine.Helpers.Timing.microSecondsToMilliseconds(filmStripFrame.screenshotEvent.ts);\n this.entryData.push(filmStripFrame.screenshotEvent);\n (this.timelineDataInternal.entryLevels as number[]).push(this.currentLevel);\n (this.timelineDataInternal.entryStartTimes as number[]).push(screenshotTimeInMilliSeconds);\n if (prevTimestamp) {\n (this.timelineDataInternal.entryTotalTimes as number[]).push(screenshotTimeInMilliSeconds - prevTimestamp);\n }\n prevTimestamp = screenshotTimeInMilliSeconds;\n }\n if (filmStrip.frames.length && prevTimestamp !== undefined) {\n // Set the total time of the final screenshot so it takes up the remainder of the trace.\n (this.timelineDataInternal.entryTotalTimes as number[])\n .push(this.legacyTimelineModel.maximumRecordTime() - prevTimestamp);\n }\n ++this.currentLevel;\n }\n\n private entryType(entryIndex: number): EntryType {\n return this.entryTypeByLevel[(this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData)\n .entryLevels[entryIndex]];\n }\n\n prepareHighlightedEntryInfo(entryIndex: number): Element|null {\n let time = '';\n let title;\n let warningElements: Element[] = [];\n let nameSpanTimelineInfoTime = 'timeline-info-time';\n\n const additionalContent: HTMLElement[] = [];\n\n const entryType = this.entryType(entryIndex);\n if (entryType === EntryType.TrackAppender) {\n if (!this.compatibilityTracksAppender) {\n return null;\n }\n const event = (this.entryData[entryIndex] as TraceEngine.Types.TraceEvents.TraceEventData);\n const timelineData = (this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData);\n const eventLevel = timelineData.entryLevels[entryIndex];\n const highlightedEntryInfo = this.compatibilityTracksAppender.highlightedEntryInfo(event, eventLevel);\n title = highlightedEntryInfo.title;\n time = highlightedEntryInfo.formattedTime;\n warningElements = highlightedEntryInfo.warningElements || warningElements;\n if (TraceEngine.Types.TraceEvents.isSyntheticInteractionEvent(event)) {\n const breakdown = new Components.InteractionBreakdown.InteractionBreakdown();\n breakdown.entry = event;\n additionalContent.push(breakdown);\n }\n } else if (entryType === EntryType.Event) {\n const event = (this.entryData[entryIndex] as TraceEngine.Legacy.Event);\n const totalTime = event.duration;\n const selfTime = event.selfTime;\n const eps = 1e-6;\n if (typeof totalTime === 'number') {\n time = Math.abs(totalTime - selfTime) > eps && selfTime > eps ?\n i18nString(UIStrings.sSelfS, {\n PH1: i18n.TimeUtilities.millisToString(totalTime, true),\n PH2: i18n.TimeUtilities.millisToString(selfTime, true),\n }) :\n i18n.TimeUtilities.millisToString(totalTime, true);\n }\n title = this.entryTitle(entryIndex);\n\n } else if (entryType === EntryType.Frame) {\n const frame = (this.entryData[entryIndex] as TraceEngine.Handlers.ModelHandlers.Frames.TimelineFrame);\n time = i18n.TimeUtilities.preciseMillisToString(\n TraceEngine.Helpers.Timing.microSecondsToMilliseconds(frame.duration), 1);\n\n if (frame.idle) {\n title = i18nString(UIStrings.idleFrame);\n } else if (frame.dropped) {\n if (frame.isPartial) {\n title = i18nString(UIStrings.partiallyPresentedFrame);\n } else {\n title = i18nString(UIStrings.droppedFrame);\n }\n nameSpanTimelineInfoTime = 'timeline-info-warning';\n } else {\n title = i18nString(UIStrings.frame);\n }\n } else {\n return null;\n }\n\n const element = document.createElement('div');\n const root = UI.Utils.createShadowRootWithCoreStyles(element, {\n cssFile: [timelineFlamechartPopoverStyles],\n delegatesFocus: undefined,\n });\n const contents = root.createChild('div', 'timeline-flamechart-popover');\n contents.createChild('span', nameSpanTimelineInfoTime).textContent = time;\n contents.createChild('span', 'timeline-info-title').textContent = title;\n if (warningElements) {\n for (const warningElement of warningElements) {\n warningElement.classList.add('timeline-info-warning');\n contents.appendChild(warningElement);\n }\n }\n for (const elem of additionalContent) {\n contents.appendChild(elem);\n }\n return element;\n }\n\n prepareHighlightedHiddenEntriesArrowInfo(entryIndex: number): Element|null {\n const element = document.createElement('div');\n const root = UI.Utils.createShadowRootWithCoreStyles(element, {\n cssFile: [timelineFlamechartPopoverStyles],\n delegatesFocus: undefined,\n });\n\n const entry = this.entryData[entryIndex] as TraceEngine.Types.TraceEvents.SyntheticTraceEntry;\n const hiddenEntriesAmount =\n TraceEngine.EntriesFilter.EntriesFilter.maybeInstance()?.findHiddenDescendantsAmount(entry);\n\n if (!hiddenEntriesAmount) {\n return null;\n }\n const contents = root.createChild('div', 'timeline-flamechart-popover');\n contents.createChild('span', 'timeline-info-title').textContent = hiddenEntriesAmount + ' hidden';\n\n return element;\n }\n\n entryColor(entryIndex: number): string {\n function patchColorAndCache(cache: Map, key: KEY, lookupColor: (arg0: KEY) => string): string {\n let color = cache.get(key);\n if (color) {\n return color;\n }\n const parsedColor = lookupColor(key);\n if (!parsedColor) {\n throw new Error('Could not parse color from entry');\n }\n color = parsedColor;\n cache.set(key, color);\n return (color);\n }\n\n if (!this.legacyPerformanceModel || !this.legacyTimelineModel) {\n return '';\n }\n\n const entryType = this.entryType(entryIndex);\n if (entryType === EntryType.Event) {\n const event = (this.entryData[entryIndex] as TraceEngine.Legacy.Event);\n if (this.legacyTimelineModel.isGenericTrace()) {\n return this.genericTraceEventColor(event);\n }\n if (this.legacyPerformanceModel.timelineModel().isMarkerEvent(event)) {\n return TimelineUIUtils.markerStyleForEvent(event).color;\n }\n if (!TraceEngine.Types.TraceEvents.isAsyncPhase(event.phase) && this.colorForEvent) {\n return this.colorForEvent(event);\n }\n const category = TimelineUIUtils.eventStyle(event).category;\n return patchColorAndCache(this.asyncColorByCategory, category, () => category.getComputedColorValue());\n }\n if (entryType === EntryType.Frame) {\n return 'white';\n }\n if (entryType === EntryType.TrackAppender) {\n const timelineData = (this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData);\n const eventLevel = timelineData.entryLevels[entryIndex];\n const event = (this.entryData[entryIndex] as TraceEngine.Types.TraceEvents.TraceEventData);\n return this.compatibilityTracksAppender?.colorForEvent(event, eventLevel) || '';\n }\n return '';\n }\n\n private genericTraceEventColor(event: TraceEngine.Legacy.Event): string {\n const key = event.categoriesString || event.name;\n return key ? `hsl(${Platform.StringUtilities.hashCode(key) % 300 + 30}, 40%, 70%)` : '#ccc';\n }\n\n private preparePatternCanvas(): void {\n // Set the candy stripe pattern to 17px so it repeats well.\n const size = 17;\n this.droppedFramePatternCanvas.width = size;\n this.droppedFramePatternCanvas.height = size;\n\n this.partialFramePatternCanvas.width = size;\n this.partialFramePatternCanvas.height = size;\n\n const ctx = this.droppedFramePatternCanvas.getContext('2d');\n if (ctx) {\n // Make a dense solid-line pattern.\n ctx.translate(size * 0.5, size * 0.5);\n ctx.rotate(Math.PI * 0.25);\n ctx.translate(-size * 0.5, -size * 0.5);\n\n ctx.fillStyle = 'rgb(255, 255, 255)';\n for (let x = -size; x < size * 2; x += 3) {\n ctx.fillRect(x, -size, 1, size * 3);\n }\n }\n\n const ctx2 = this.partialFramePatternCanvas.getContext('2d');\n if (ctx2) {\n // Make a sparse dashed-line pattern.\n ctx2.strokeStyle = 'rgb(255, 255, 255)';\n ctx2.lineWidth = 2;\n ctx2.beginPath();\n ctx2.moveTo(17, 0);\n ctx2.lineTo(10, 7);\n ctx2.moveTo(8, 9);\n ctx2.lineTo(2, 15);\n ctx2.stroke();\n }\n }\n\n private drawFrame(\n entryIndex: number, context: CanvasRenderingContext2D, text: string|null, barX: number, barY: number,\n barWidth: number, barHeight: number): void {\n const hPadding = 1;\n const frame = (this.entryData[entryIndex] as TraceEngine.Handlers.ModelHandlers.Frames.TimelineFrame);\n barX += hPadding;\n barWidth -= 2 * hPadding;\n if (frame.idle) {\n context.fillStyle = 'white';\n } else if (frame.dropped) {\n if (frame.isPartial) {\n // For partially presented frame boxes, paint a yellow background with\n // a sparse white dashed-line pattern overlay.\n context.fillStyle = '#f0e442';\n context.fillRect(barX, barY, barWidth, barHeight);\n\n const overlay = context.createPattern(this.partialFramePatternCanvas, 'repeat');\n context.fillStyle = overlay || context.fillStyle;\n } else {\n // For dropped frame boxes, paint a red background with a dense white\n // solid-line pattern overlay.\n context.fillStyle = '#f08080';\n context.fillRect(barX, barY, barWidth, barHeight);\n\n const overlay = context.createPattern(this.droppedFramePatternCanvas, 'repeat');\n context.fillStyle = overlay || context.fillStyle;\n }\n } else {\n context.fillStyle = '#d7f0d1';\n }\n context.fillRect(barX, barY, barWidth, barHeight);\n\n const frameDurationText = i18n.TimeUtilities.preciseMillisToString(\n TraceEngine.Helpers.Timing.microSecondsToMilliseconds(frame.duration), 1);\n const textWidth = context.measureText(frameDurationText).width;\n if (textWidth <= barWidth) {\n context.fillStyle = this.textColor(entryIndex);\n context.fillText(frameDurationText, barX + (barWidth - textWidth) / 2, barY + barHeight - 4);\n }\n }\n\n private async drawScreenshot(\n entryIndex: number, context: CanvasRenderingContext2D, barX: number, barY: number, barWidth: number,\n barHeight: number): Promise {\n const screenshot = (this.entryData[entryIndex] as TraceEngine.Types.TraceEvents.SyntheticScreenshot);\n if (!this.screenshotImageCache.has(screenshot)) {\n this.screenshotImageCache.set(screenshot, null);\n const data = screenshot.args.dataUri;\n const image = await UI.UIUtils.loadImage(data);\n this.screenshotImageCache.set(screenshot, image);\n this.dispatchEventToListeners(Events.DataChanged);\n return;\n }\n\n const image = this.screenshotImageCache.get(screenshot);\n if (!image) {\n return;\n }\n const imageX = barX + 1;\n const imageY = barY + 1;\n const imageHeight = barHeight - 2;\n const scale = imageHeight / image.naturalHeight;\n const imageWidth = Math.floor(image.naturalWidth * scale);\n context.save();\n context.beginPath();\n context.rect(barX, barY, barWidth, barHeight);\n context.clip();\n context.drawImage(image, imageX, imageY, imageWidth, imageHeight);\n context.strokeStyle = '#ccc';\n context.strokeRect(imageX - 0.5, imageY - 0.5, Math.min(barWidth - 1, imageWidth + 1), imageHeight);\n context.restore();\n }\n\n decorateEntry(\n entryIndex: number, context: CanvasRenderingContext2D, text: string|null, barX: number, barY: number,\n barWidth: number, barHeight: number, unclippedBarX: number, timeToPixelRatio: number): boolean {\n const entryType = this.entryType(entryIndex);\n\n if (entryType === EntryType.Frame) {\n this.drawFrame(entryIndex, context, text, barX, barY, barWidth, barHeight);\n return true;\n }\n\n if (entryType === EntryType.Screenshot) {\n void this.drawScreenshot(entryIndex, context, barX, barY, barWidth, barHeight);\n return true;\n }\n\n if (entryType === EntryType.TrackAppender) {\n const entry = this.entryData[entryIndex] as TraceEngine.Types.TraceEvents.TraceEventData;\n if (TraceEngine.Types.TraceEvents.isSyntheticInteractionEvent(entry)) {\n this.#drawInteractionEventWithWhiskers(\n context, entryIndex, text, entry, barX, barY, unclippedBarX, barWidth, barHeight, timeToPixelRatio);\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Draws the left and right whiskers around an interaction in the timeline.\n * @param context - the canvas that will be drawn onto\n * @param entryIndex\n * @param entryTitle - the title of the entry\n * @param entry - the entry itself\n * @param barX - the starting X pixel position of the bar representing this event. This is clipped: if the bar is off the left side of the screen, this value will be 0\n * @param barY - the starting Y pixel position of the bar representing this event.\n * @param unclippedBarXStartPixel - the starting X pixel position of the bar representing this event, not clipped. This means if the bar is off the left of the screen this will be a negative number.\n * @param barWidth - the width of the full bar in pixels\n * @param barHeight - the height of the full bar in pixels\n * @param timeToPixelRatio - the ratio required to convert a millisecond time to a pixel value.\n **/\n #drawInteractionEventWithWhiskers(\n context: CanvasRenderingContext2D, entryIndex: number, entryTitle: string|null,\n entry: TraceEngine.Types.TraceEvents.SyntheticInteractionPair, barX: number, barY: number,\n unclippedBarXStartPixel: number, barWidth: number, barHeight: number, timeToPixelRatio: number): void {\n /**\n * An interaction is drawn with whiskers as so:\n * |----------[=======]-------------|\n * => The left whisker is the event's start time (event.ts)\n * => The box start is the event's processingStart time\n * => The box end is the event's processingEnd time\n * => The right whisker is the event's end time (event.ts + event.dur)\n *\n * When we draw the event in the InteractionsAppender, we draw a huge box\n * that spans the entire of the above. So here we need to draw over the\n * rectangle that is outside of {processingStart, processingEnd} and\n * replace it with the whiskers.\n * TODO(crbug.com/1495248): rework how we draw whiskers to avoid this inefficiency\n */\n\n const beginTime = TraceEngine.Helpers.Timing.microSecondsToMilliseconds(entry.ts);\n const entireBarEndXPixel = barX + barWidth;\n\n function timeToPixel(time: TraceEngine.Types.Timing.MicroSeconds): number {\n const timeMilli = TraceEngine.Helpers.Timing.microSecondsToMilliseconds(time);\n return Math.floor(unclippedBarXStartPixel + (timeMilli - beginTime) * timeToPixelRatio);\n }\n\n context.save();\n\n // Clear portions of initial rect to prepare for the ticks.\n context.fillStyle = ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-cdt-base-container');\n let desiredBoxStartX = timeToPixel(entry.processingStart);\n const desiredBoxEndX = timeToPixel(entry.processingEnd);\n\n // If the entry has no processing time, ensure the box is 1px wide so at least it is visible.\n if (entry.processingEnd - entry.processingStart === 0) {\n desiredBoxStartX -= 1;\n }\n\n context.fillRect(barX, barY - 0.5, desiredBoxStartX - barX, barHeight);\n context.fillRect(desiredBoxEndX, barY - 0.5, entireBarEndXPixel - desiredBoxEndX, barHeight);\n\n // Draws left and right whiskers\n function drawTick(begin: number, end: number, y: number): void {\n const tickHeightPx = 6;\n context.moveTo(begin, y - tickHeightPx / 2);\n context.lineTo(begin, y + tickHeightPx / 2);\n context.moveTo(begin, y);\n context.lineTo(end, y);\n }\n\n // The left whisker starts at the enty timestamp, and continues until the start of the box (processingStart).\n const leftWhiskerX = timeToPixel(entry.ts);\n // The right whisker ends at (entry.ts + entry.dur). We draw the line from the end of the box (processingEnd).\n const rightWhiskerX = timeToPixel(TraceEngine.Types.Timing.MicroSeconds(entry.ts + entry.dur));\n context.beginPath();\n context.lineWidth = 1;\n context.strokeStyle = '#ccc';\n const lineY = Math.floor(barY + barHeight / 2) + 0.5;\n const leftTick = leftWhiskerX + 0.5;\n const rightTick = rightWhiskerX - 0.5;\n drawTick(leftTick, desiredBoxStartX, lineY);\n drawTick(rightTick, desiredBoxEndX, lineY);\n context.stroke();\n\n if (entryTitle) {\n // BarX will be set to 0 if the start of the box if off the screen to the\n // left. If this happens, the desiredBoxStartX will be negative. In that\n // case, we fallback to the BarX. This ensures that even if the box\n // starts off-screen, we draw the text at the first visible on screen\n // pixels, so the user can still see the event's title.\n const textStartX = desiredBoxStartX > 0 ? desiredBoxStartX : barX;\n context.font = this.#font;\n const textWidth = UI.UIUtils.measureTextWidth(context, entryTitle);\n\n // These numbers are duplicated from FlameChart.ts.\n const textPadding = 5;\n const textBaseline = 5;\n\n // Only draw the text if it can fit in the amount of box that is visible.\n if (textWidth <= desiredBoxEndX - textStartX + textPadding) {\n context.fillStyle = this.textColor(entryIndex);\n context.fillText(entryTitle, textStartX + textPadding, barY + barHeight - textBaseline);\n }\n }\n context.restore();\n }\n\n forceDecoration(entryIndex: number): boolean {\n const entryType = this.entryType(entryIndex);\n if (entryType === EntryType.Frame) {\n return true;\n }\n if (entryType === EntryType.Screenshot) {\n return true;\n }\n\n if (entryType === EntryType.Event) {\n // TODO: this entryType can no longer exist as all tracks are now\n // migrated to appenders. This can be removed as part of the old engine\n // removal.\n return false;\n }\n const event = (this.entryData[entryIndex] as TraceEngine.Types.TraceEvents.TraceEventData);\n\n if (TraceEngine.Types.TraceEvents.isSyntheticInteractionEvent(event)) {\n // We draw interactions with whiskers, which are done via the\n // decorateEntry() method, hence we always want to force these to be\n // decorated.\n return true;\n }\n return Boolean(this.traceEngineData?.Warnings.perEvent.get(event));\n }\n\n private appendHeader(title: string, style: PerfUI.FlameChart.GroupStyle, selectable: boolean, expanded?: boolean):\n PerfUI.FlameChart.Group {\n const group =\n ({startLevel: this.currentLevel, name: title, style: style, selectable: selectable, expanded} as\n PerfUI.FlameChart.Group);\n (this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData).groups.push(group);\n return group;\n }\n\n private appendEvent(event: TraceEngine.Legacy.Event, level: number): number {\n const index = this.entryData.length;\n this.entryData.push(event);\n const timelineData = (this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData);\n timelineData.entryLevels[index] = level;\n timelineData.entryTotalTimes[index] = event.duration || InstantEventVisibleDurationMs;\n timelineData.entryStartTimes[index] = event.startTime;\n return index;\n }\n\n private appendAsyncEvent(asyncEvent: TraceEngine.Legacy.AsyncEvent, level: number): void {\n const steps = asyncEvent.steps;\n // If we have past steps, put the end event for each range rather than start one.\n const eventOffset =\n steps.length > 1 && steps[1].phase === TraceEngine.Types.TraceEvents.Phase.ASYNC_STEP_PAST ? 1 : 0;\n for (let i = 0; i < steps.length - 1; ++i) {\n const index = this.entryData.length;\n this.entryData.push(steps[i + eventOffset]);\n const startTime = steps[i].startTime;\n const timelineData = (this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData);\n timelineData.entryLevels[index] = level;\n timelineData.entryTotalTimes[index] = steps[i + 1].startTime - startTime;\n timelineData.entryStartTimes[index] = startTime;\n }\n }\n\n #appendNewEngineFrame(frame: TraceEngine.Handlers.ModelHandlers.Frames.TimelineFrame): void {\n const index = this.entryData.length;\n this.entryData.push(frame);\n const durationMilliseconds = TraceEngine.Helpers.Timing.microSecondsToMilliseconds(frame.duration);\n this.entryIndexToTitle[index] = i18n.TimeUtilities.millisToString(durationMilliseconds, true);\n if (!this.timelineDataInternal) {\n return;\n }\n this.timelineDataInternal.entryLevels[index] = this.currentLevel;\n this.timelineDataInternal.entryTotalTimes[index] = durationMilliseconds;\n this.timelineDataInternal.entryStartTimes[index] =\n TraceEngine.Helpers.Timing.microSecondsToMilliseconds(frame.startTime);\n }\n\n createSelection(entryIndex: number): TimelineSelection|null {\n const entryType = this.entryType(entryIndex);\n let timelineSelection: TimelineSelection|null = null;\n const entry = this.entryData[entryIndex];\n if (entry && TimelineFlameChartDataProvider.isEntryRegularEvent(entry)) {\n timelineSelection = TimelineSelection.fromTraceEvent(entry);\n } else if (entryType === EntryType.Frame) {\n timelineSelection = TimelineSelection.fromFrame(\n (this.entryData[entryIndex] as TraceEngine.Handlers.ModelHandlers.Frames.TimelineFrame));\n }\n if (timelineSelection) {\n this.lastSelection = new Selection(timelineSelection, entryIndex);\n }\n return timelineSelection;\n }\n\n formatValue(value: number, precision?: number): string {\n return i18n.TimeUtilities.preciseMillisToString(value, precision);\n }\n\n canJumpToEntry(_entryIndex: number): boolean {\n return false;\n }\n\n entryIndexForSelection(selection: TimelineSelection|null): number {\n if (!selection || TimelineSelection.isRangeSelection(selection.object) ||\n TimelineSelection.isSyntheticNetworkRequestDetailsEventSelection(selection.object)) {\n return -1;\n }\n\n if (this.lastSelection && this.lastSelection.timelineSelection.object === selection.object) {\n return this.lastSelection.entryIndex;\n }\n\n // If the index is -1 and the selection is a TraceEvent, it might be\n // the case that this Entry is hidden by the Context Menu action.\n // Try revealing the entry and getting the index again.\n if (this.entryData.indexOf(selection.object) === -1 && TimelineSelection.isTraceEventSelection(selection.object)) {\n if (this.timelineDataInternal?.selectedGroup) {\n TraceEngine.EntriesFilter.EntriesFilter.maybeInstance()?.revealEntry(\n selection.object as TraceEngine.Types.TraceEvents.SyntheticTraceEntry);\n this.timelineData(true);\n }\n }\n\n const index = this.entryData.indexOf(selection.object);\n if (index !== -1) {\n this.lastSelection = new Selection(selection, index);\n }\n return index;\n }\n\n getIndexForEvent(targetEvent: TraceEngine.Types.TraceEvents.TraceEventData): number|null {\n // Gets the index for the given event by walking through the array of entryData.\n // This may seem inefficient - but we have seen that by building up large\n // maps keyed by trace events that this has a significant impact on the\n // performance of the panel.\n // Therefore, we strike a middle ground: look up the event the first time,\n // but then cache the result.\n const fromCache = this.#eventIndexByEvent.get(targetEvent);\n if (fromCache) {\n return fromCache;\n }\n const index = this.entryData.indexOf(targetEvent);\n const result = index > -1 ? index : null;\n this.#eventIndexByEvent.set(targetEvent, result);\n return result;\n }\n\n /**\n * Build the data for initiators and initiated entries.\n * @param entryIndex\n * @returns if we should re-render the flame chart (canvas)\n */\n buildFlowForInitiator(entryIndex: number): boolean {\n if (this.lastInitiatorEntry === entryIndex) {\n return false;\n }\n if (!this.traceEngineData) {\n return false;\n }\n if (!this.timelineDataInternal) {\n return false;\n }\n if (!this.compatibilityTracksAppender) {\n return false;\n }\n\n // Remove all previously assigned decorations indicating that the flow event entries are hidden\n const previousInitiatorsDataLength = this.timelineDataInternal.initiatorsData.length;\n // |entryIndex| equals -1 means there is no entry selected, just clear the\n // initiator cache if there is any previous arrow and return true to\n // re-render.\n if (entryIndex === -1) {\n this.lastInitiatorEntry = entryIndex;\n if (previousInitiatorsDataLength === 0) {\n // This means there is no arrow before, so we don't need to re-render.\n return false;\n }\n // Reset to clear any previous arrows from the last event.\n this.timelineDataInternal.resetFlowData();\n return true;\n }\n\n const entryType = this.entryType(entryIndex);\n if (entryType !== EntryType.TrackAppender) {\n return false;\n }\n const event = this.entryData[entryIndex] as TraceEngine.Types.TraceEvents.TraceEventData;\n if (!TraceEngine.Legacy.eventIsFromNewEngine(event)) {\n // TODO: as part of the old engine removal, we need to redefine the Event\n // type to teach the code that only new engine events can be selected by\n // the user.\n return false;\n }\n // Reset to clear any previous arrows from the last event.\n this.timelineDataInternal.resetFlowData();\n this.lastInitiatorEntry = entryIndex;\n\n const hiddenEvents: TraceEngine.Types.TraceEvents.TraceEventData[] =\n TraceEngine.EntriesFilter.EntriesFilter.maybeInstance()?.invisibleEntries() ?? [];\n const modifiedEntries: TraceEngine.Types.TraceEvents.TraceEventData[] =\n TraceEngine.EntriesFilter.EntriesFilter.maybeInstance()?.modifiedEntries() ?? [];\n\n const initiatorsData = initiatorsDataToDraw(\n this.traceEngineData,\n event,\n hiddenEvents,\n modifiedEntries,\n );\n // This means there is no change for arrows.\n if (previousInitiatorsDataLength === 0 && initiatorsData.length === 0) {\n return false;\n }\n for (const intiatorData of initiatorsData) {\n const eventIndex = this.getIndexForEvent(intiatorData.event);\n const initiatorIndex = this.getIndexForEvent(intiatorData.initiator);\n if (eventIndex === null || initiatorIndex === null) {\n continue;\n }\n this.timelineDataInternal.initiatorsData.push({\n initiatorIndex,\n eventIndex,\n isInitiatorHidden: intiatorData.isInitiatorHidden,\n isEntryHidden: intiatorData.isEntryHidden,\n });\n }\n return true;\n }\n\n eventByIndex(entryIndex: number): TraceEngine.Legacy.CompatibleTraceEvent|null {\n if (entryIndex < 0) {\n return null;\n }\n const entryType = this.entryType(entryIndex);\n if (entryType === EntryType.TrackAppender) {\n return this.entryData[entryIndex] as TraceEngine.Types.TraceEvents.TraceEventData;\n }\n if (entryType === EntryType.Event) {\n return this.entryData[entryIndex] as TraceEngine.Legacy.Event;\n }\n return null;\n }\n\n setEventColorMapping(colorForEvent: (arg0: TraceEngine.Legacy.Event) => string): void {\n this.colorForEvent = colorForEvent;\n }\n\n // Included only for layout tests.\n // TODO(crbug.com/1386091): Fix/port layout tests and remove.\n get performanceModel(): PerformanceModel|null {\n return this.legacyPerformanceModel;\n }\n}\n\nexport const InstantEventVisibleDurationMs = 0.001;\n\nexport const enum Events {\n DataChanged = 'DataChanged',\n}\n\nexport type EventTypes = {\n [Events.DataChanged]: void,\n};\n\n// an entry is a trace event, they are classified into \"entry types\"\n// because some events are rendered differently. For example, screenshot\n// events are rendered as images. Checks for entry types allow to have\n// different styles, names, etc. for events that look differently.\n// In the future we won't have this checks: instead we will forward\n// the event to the corresponding \"track appender\" and it will determine\n// how the event shall be rendered.\nexport const enum EntryType {\n Frame = 'Frame',\n Event = 'Event',\n TrackAppender = 'TrackAppender',\n Screenshot = 'Screenshot',\n}\n"]} \ No newline at end of file +{"version":3,"file":"TimelineFlameChartDataProvider.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineFlameChartDataProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,mCAAm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AC5E,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAED,kCAAkC;IAClC,6DAA6D;IAC7D,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACrC,CAAC;CACF;AAED,MAAM,CAAC,MAAM,6BAA6B,GAAG,KAAK,CAAC","sourcesContent":["/*\n * Copyright (C) 2014 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as Root from '../../core/root/root.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as TimelineModel from '../../models/timeline_model/timeline_model.js';\nimport * as TraceEngine from '../../models/trace/trace.js';\nimport * as AnnotationsManager from '../../services/annotations_manager/annotations_manager.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js';\n\nimport {ActiveFilters} from './ActiveFilters.js';\nimport {CompatibilityTracksAppender, type TrackAppenderName} from './CompatibilityTracksAppender.js';\nimport * as Components from './components/components.js';\nimport {type TimelineCategory} from './EventUICategory.js';\nimport {initiatorsDataToDraw} from './Initiators.js';\nimport {type PerformanceModel} from './PerformanceModel.js';\nimport {ThreadAppender} from './ThreadAppender.js';\nimport timelineFlamechartPopoverStyles from './timelineFlamechartPopover.css.js';\nimport {FlameChartStyle, Selection} from './TimelineFlameChartView.js';\nimport {TimelineSelection} from './TimelineSelection.js';\nimport {TimelineUIUtils} from './TimelineUIUtils.js';\n\nconst UIStrings = {\n /**\n *@description Text in Timeline Flame Chart Data Provider of the Performance panel\n */\n onIgnoreList: 'On ignore list',\n /**\n * @description Text in Timeline Flame Chart Data Provider of the Performance panel *\n * @example{example.com} PH1\n */\n mainS: 'Main — {PH1}',\n /**\n * @description Text that refers to the main target\n */\n main: 'Main',\n /**\n * @description Text in Timeline Flame Chart Data Provider of the Performance panel * @example {https://example.com} PH1\n */\n frameS: 'Frame — {PH1}',\n /**\n *@description Text in Timeline Flame Chart Data Provider of the Performance panel\n */\n subframe: 'Subframe',\n /**\n *@description Text in Timeline Flame Chart Data Provider of the Performance panel\n */\n raster: 'Raster',\n /**\n *@description Text in Timeline Flame Chart Data Provider of the Performance panel\n *@example {2} PH1\n */\n rasterizerThreadS: 'Rasterizer Thread {PH1}',\n /**\n *@description Text in Timeline Flame Chart Data Provider of the Performance panel\n */\n thread: 'Thread',\n /**\n *@description Text for rendering frames\n */\n frames: 'Frames',\n /**\n * @description Text in the Performance panel to show how long was spent in a particular part of the code.\n * The first placeholder is the total time taken for this node and all children, the second is the self time\n * (time taken in this node, without children included).\n *@example {10ms} PH1\n *@example {10ms} PH2\n */\n sSelfS: '{PH1} (self {PH2})',\n /**\n *@description Text in Timeline Flame Chart Data Provider of the Performance panel\n */\n idleFrame: 'Idle Frame',\n /**\n *@description Text in Timeline Frame Chart Data Provider of the Performance panel\n */\n droppedFrame: 'Dropped Frame',\n /**\n *@description Text in Timeline Frame Chart Data Provider of the Performance panel\n */\n partiallyPresentedFrame: 'Partially Presented Frame',\n /**\n *@description Text for a rendering frame\n */\n frame: 'Frame',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/TimelineFlameChartDataProvider.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\n// at the moment there are two types defined for trace events: traceeventdata and\n// SDK.TracingModel.Event. This is only for compatibility between the legacy system\n// and the new system proposed in go/rpp-flamechart-arch. In the future, once all\n// tracks have been migrated to the new system, all entries will be of the\n// TraceEventData type.\nexport type TimelineFlameChartEntry =\n (TraceEngine.Legacy.Event|TraceEngine.Handlers.ModelHandlers.Frames.TimelineFrame|\n TraceEngine.Types.TraceEvents.TraceEventData);\nexport class TimelineFlameChartDataProvider extends Common.ObjectWrapper.ObjectWrapper implements\n PerfUI.FlameChart.FlameChartDataProvider {\n private droppedFramePatternCanvas: HTMLCanvasElement;\n private partialFramePatternCanvas: HTMLCanvasElement;\n private timelineDataInternal: PerfUI.FlameChart.FlameChartTimelineData|null;\n private currentLevel: number;\n\n // The Performance and the Timeline models are expected to be\n // deprecated in favor of using traceEngineData (new RPP engine) only\n // as part of the work in crbug.com/1386091. For this reason they\n // have the \"legacy\" prefix on their name.\n private legacyPerformanceModel: PerformanceModel|null;\n private compatibilityTracksAppender: CompatibilityTracksAppender|null;\n private legacyTimelineModel: TimelineModel.TimelineModel.TimelineModelImpl|null;\n private traceEngineData: TraceEngine.Handlers.Types.TraceParseData|null;\n private isCpuProfile = false;\n /**\n * Raster threads are tracked and enumerated with this property. This is also\n * used to group all raster threads together in the same track, instead of\n * rendering a track for thread.\n */\n #rasterCount: number = 0;\n\n private minimumBoundaryInternal: number;\n private timeSpan: number;\n private readonly headerLevel1: PerfUI.FlameChart.GroupStyle;\n private readonly headerLevel2: PerfUI.FlameChart.GroupStyle;\n private readonly staticHeader: PerfUI.FlameChart.GroupStyle;\n private framesHeader: PerfUI.FlameChart.GroupStyle;\n private readonly screenshotsHeader: PerfUI.FlameChart.GroupStyle;\n private entryData!: TimelineFlameChartEntry[];\n private entryTypeByLevel!: EntryType[];\n private screenshotImageCache!: Map;\n private entryIndexToTitle!: string[];\n private asyncColorByCategory!: Map;\n private lastInitiatorEntry!: number;\n private entryParent!: TraceEngine.Legacy.Event[];\n private lastSelection?: Selection;\n private colorForEvent?: ((arg0: TraceEngine.Legacy.Event) => string);\n #eventToDisallowRoot = new WeakMap();\n #font: string;\n #eventIndexByEvent: WeakMap = new WeakMap();\n\n constructor() {\n super();\n this.reset();\n this.#font = `${PerfUI.Font.DEFAULT_FONT_SIZE} ${PerfUI.Font.getFontFamilyForCanvas()}`;\n this.droppedFramePatternCanvas = document.createElement('canvas');\n this.partialFramePatternCanvas = document.createElement('canvas');\n this.preparePatternCanvas();\n this.timelineDataInternal = null;\n this.currentLevel = 0;\n this.legacyPerformanceModel = null;\n this.legacyTimelineModel = null;\n this.compatibilityTracksAppender = null;\n this.traceEngineData = null;\n this.minimumBoundaryInternal = 0;\n this.timeSpan = 0;\n\n this.headerLevel1 = this.buildGroupStyle({shareHeaderLine: false});\n this.headerLevel2 = this.buildGroupStyle({padding: 2, nestingLevel: 1, collapsible: false});\n this.staticHeader = this.buildGroupStyle({collapsible: false});\n this.framesHeader = this.buildGroupStyle({useFirstLineForOverview: true});\n this.screenshotsHeader =\n this.buildGroupStyle({useFirstLineForOverview: true, nestingLevel: 1, collapsible: false, itemsHeight: 150});\n\n ThemeSupport.ThemeSupport.instance().addEventListener(ThemeSupport.ThemeChangeEvent.eventName, () => {\n const headers = [\n this.headerLevel1,\n this.headerLevel2,\n this.staticHeader,\n this.framesHeader,\n this.screenshotsHeader,\n ];\n for (const header of headers) {\n header.color = ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-on-surface');\n header.backgroundColor =\n ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-cdt-base-container');\n }\n });\n }\n\n modifyTree(node: number, action: TraceEngine.EntriesFilter.FilterAction): void {\n const entry = this.entryData[node] as TraceEngine.Types.TraceEvents.SyntheticTraceEntry;\n\n AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance()?.getEntriesFilter().applyFilterAction(\n {type: action, entry});\n }\n\n findPossibleContextMenuActions(node: number): TraceEngine.EntriesFilter.PossibleFilterActions|void {\n const entry = this.entryData[node] as TraceEngine.Types.TraceEvents.SyntheticTraceEntry;\n return AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance()\n ?.getEntriesFilter()\n .findPossibleActions(entry);\n }\n\n private buildGroupStyle(extra: Object): PerfUI.FlameChart.GroupStyle {\n const defaultGroupStyle = {\n padding: 4,\n height: 17,\n collapsible: true,\n color: ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-on-surface'),\n backgroundColor: ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-cdt-base-container'),\n nestingLevel: 0,\n shareHeaderLine: true,\n };\n return Object.assign(defaultGroupStyle, extra);\n }\n\n setModel(\n performanceModel: PerformanceModel|null, newTraceEngineData: TraceEngine.Handlers.Types.TraceParseData|null,\n isCpuProfile = false): void {\n this.reset();\n this.legacyPerformanceModel = performanceModel;\n this.legacyTimelineModel = performanceModel && performanceModel.timelineModel();\n this.traceEngineData = newTraceEngineData;\n\n this.isCpuProfile = isCpuProfile;\n if (newTraceEngineData) {\n const {traceBounds} = newTraceEngineData.Meta;\n const minTime = TraceEngine.Helpers.Timing.microSecondsToMilliseconds(traceBounds.min);\n const maxTime = TraceEngine.Helpers.Timing.microSecondsToMilliseconds(traceBounds.max);\n this.minimumBoundaryInternal = minTime;\n this.timeSpan = minTime === maxTime ? 1000 : maxTime - this.minimumBoundaryInternal;\n }\n }\n\n /**\n * Instances and caches a CompatibilityTracksAppender using the\n * internal flame chart data and the trace parsed data coming from the\n * trace engine.\n * The model data must have been set to the data provider instance before\n * attempting to instance the CompatibilityTracksAppender.\n */\n compatibilityTracksAppenderInstance(forceNew = false): CompatibilityTracksAppender {\n if (!this.compatibilityTracksAppender || forceNew) {\n if (!this.traceEngineData || !this.legacyTimelineModel) {\n throw new Error(\n 'Attempted to instantiate a CompatibilityTracksAppender without having set the trace parse data first.');\n }\n this.timelineDataInternal = this.#instantiateTimelineData();\n this.compatibilityTracksAppender = new CompatibilityTracksAppender(\n this.timelineDataInternal, this.traceEngineData, this.entryData, this.entryTypeByLevel,\n this.legacyTimelineModel);\n }\n return this.compatibilityTracksAppender;\n }\n\n /**\n * Returns the instance of the timeline flame chart data, without\n * adding data to it. In case the timeline data hasn't been instanced\n * creates a new instance and returns it.\n */\n #instantiateTimelineData(): PerfUI.FlameChart.FlameChartTimelineData {\n if (!this.timelineDataInternal) {\n this.timelineDataInternal = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n }\n return this.timelineDataInternal;\n }\n\n /**\n * Builds the flame chart data using the track appenders\n */\n buildFromTrackAppenders(options?: {filterThreadsByName?: string, expandedTracks?: Set}): void {\n if (!this.compatibilityTracksAppender) {\n return;\n }\n const appenders = this.compatibilityTracksAppender.allVisibleTrackAppenders();\n for (const appender of appenders) {\n const skipThreadAppenderByName =\n appender instanceof ThreadAppender && !appender.trackName().includes(options?.filterThreadsByName || '');\n if (skipThreadAppenderByName) {\n continue;\n }\n const expanded = Boolean(options?.expandedTracks?.has(appender.appenderName));\n this.currentLevel = appender.appendTrackAtLevel(this.currentLevel, expanded);\n }\n }\n\n groupTrack(group: PerfUI.FlameChart.Group): TimelineModel.TimelineModel.Track|null {\n return group.track || null;\n }\n\n groupTreeEvents(group: PerfUI.FlameChart.Group): TraceEngine.Types.TraceEvents.TraceEventData[]|null {\n return this.compatibilityTracksAppender?.groupEventsForTreeView(group) ?? null;\n }\n\n mainFrameNavigationStartEvents(): readonly TraceEngine.Types.TraceEvents.TraceEventNavigationStart[] {\n if (!this.traceEngineData) {\n return [];\n }\n return this.traceEngineData.Meta.mainFrameNavigations;\n }\n\n entryTitle(entryIndex: number): string|null {\n const entryType = this.entryType(entryIndex);\n if (entryType === EntryType.Event) {\n const event = (this.entryData[entryIndex] as TraceEngine.Legacy.Event);\n if (event.phase === TraceEngine.Types.TraceEvents.Phase.ASYNC_STEP_INTO ||\n event.phase === TraceEngine.Types.TraceEvents.Phase.ASYNC_STEP_PAST) {\n return event.name + ':' + event.args['step'];\n }\n if (this.#eventToDisallowRoot.get(event)) {\n return i18nString(UIStrings.onIgnoreList);\n }\n return TimelineUIUtils.eventTitle(event);\n }\n if (entryType === EntryType.Screenshot) {\n return '';\n }\n if (entryType === EntryType.TrackAppender) {\n const timelineData = (this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData);\n const eventLevel = timelineData.entryLevels[entryIndex];\n const event = (this.entryData[entryIndex] as TraceEngine.Types.TraceEvents.TraceEventData);\n return this.compatibilityTracksAppender?.titleForEvent(event, eventLevel) || null;\n }\n let title: Common.UIString.LocalizedString|string = this.entryIndexToTitle[entryIndex];\n if (!title) {\n title = `Unexpected entryIndex ${entryIndex}`;\n console.error(title);\n }\n return title;\n }\n\n textColor(index: number): string {\n const event = this.entryData[index];\n if (!TimelineFlameChartDataProvider.isEntryRegularEvent(event)) {\n return FlameChartStyle.textColor;\n }\n return this.isIgnoreListedEvent(event) ? '#888' : FlameChartStyle.textColor;\n }\n\n entryFont(_index: number): string|null {\n return this.#font;\n }\n\n // resetCompatibilityTracksAppender boolean set to false does not recreate the thread appenders\n reset(resetCompatibilityTracksAppender: boolean = true): void {\n this.currentLevel = 0;\n this.entryData = [];\n this.entryParent = [];\n this.entryTypeByLevel = [];\n this.entryIndexToTitle = [];\n this.asyncColorByCategory = new Map();\n this.screenshotImageCache = new Map();\n this.#eventIndexByEvent = new Map();\n this.#eventToDisallowRoot = new WeakMap();\n if (resetCompatibilityTracksAppender) {\n this.compatibilityTracksAppender = null;\n this.timelineDataInternal = null;\n } else if (!resetCompatibilityTracksAppender && this.timelineDataInternal) {\n this.compatibilityTracksAppender?.setFlameChartDataAndEntryData(\n this.timelineDataInternal, this.entryData, this.entryTypeByLevel);\n this.compatibilityTracksAppender?.threadAppenders().forEach(\n threadAppender => threadAppender.setHeaderAppended(false));\n }\n }\n\n maxStackDepth(): number {\n return this.currentLevel;\n }\n\n /**\n * Builds the flame chart data using the tracks appender (which use\n * the new trace engine) and the legacy code paths present in this\n * file. The result built data is cached and returned.\n */\n timelineData(rebuild: boolean = false): PerfUI.FlameChart.FlameChartTimelineData {\n if (this.timelineDataInternal && this.timelineDataInternal.entryLevels.length !== 0 && !rebuild) {\n // The flame chart data is built already, so return the cached\n // data.\n return this.timelineDataInternal;\n }\n\n this.timelineDataInternal = PerfUI.FlameChart.FlameChartTimelineData.createEmpty();\n if (!this.legacyTimelineModel) {\n return this.timelineDataInternal;\n }\n\n if (rebuild) {\n this.reset(/* resetCompatibilityTracksAppender= */ false);\n }\n\n this.currentLevel = 0;\n\n if (this.traceEngineData) {\n this.compatibilityTracksAppender = this.compatibilityTracksAppenderInstance();\n if (this.traceEngineData.Meta.traceIsGeneric) {\n this.#processGenericTrace();\n } else {\n this.processInspectorTrace();\n }\n }\n\n return this.timelineDataInternal;\n }\n\n #processGenericTrace(): void {\n if (!this.compatibilityTracksAppender) {\n return;\n }\n\n const appendersByProcess = this.compatibilityTracksAppender.allThreadAppendersByProcess();\n\n for (const [pid, threadAppenders] of appendersByProcess) {\n const processGroupStyle = this.buildGroupStyle({shareHeaderLine: false});\n const processName = this.traceEngineData?.Meta.processNames.get(pid)?.args.name || 'Process';\n this.appendHeader(`${processName} (${pid})`, processGroupStyle, true, false);\n for (const appender of threadAppenders) {\n appender.setHeaderNestingLevel(1);\n this.currentLevel = appender.appendTrackAtLevel(this.currentLevel);\n }\n }\n }\n\n private processInspectorTrace(): void {\n if (!this.isCpuProfile) {\n this.appendFrames();\n }\n\n const weight = (track: {type?: string, forMainFrame?: boolean, appenderName?: TrackAppenderName}): number => {\n if (track.appenderName !== undefined) {\n switch (track.appenderName) {\n case 'Animations':\n return 0;\n case 'Timings':\n return 1;\n case 'Interactions':\n return 2;\n case 'LayoutShifts':\n return 3;\n case 'GPU':\n return 8;\n case 'Thread':\n return 4;\n case 'Thread_AuctionWorklet':\n return 10;\n default:\n return -1;\n }\n }\n\n switch (track.type) {\n case TimelineModel.TimelineModel.TrackType.MainThread:\n return track.forMainFrame ? 5 : 6;\n case TimelineModel.TimelineModel.TrackType.Worker:\n return 7;\n case TimelineModel.TimelineModel.TrackType.Raster:\n return 9;\n case TimelineModel.TimelineModel.TrackType.Other:\n return 11;\n default:\n return -1;\n }\n };\n\n if (!this.legacyTimelineModel) {\n return;\n }\n const allTrackAppenders =\n this.compatibilityTracksAppender ? this.compatibilityTracksAppender.allVisibleTrackAppenders() : [];\n\n allTrackAppenders.sort((a, b) => weight(a) - weight(b));\n\n for (const appender of allTrackAppenders) {\n if (!this.traceEngineData) {\n continue;\n }\n\n this.currentLevel = appender.appendTrackAtLevel(this.currentLevel);\n\n // If there is not a selected group, we want to default to selecting the\n // main thread track. Therefore in this check we look to see if the\n // current appender is a ThreadAppender and represnets the Main Thread.\n // If it is, we mark the group as selected.\n if (this.timelineDataInternal && !this.timelineDataInternal.selectedGroup) {\n if (appender instanceof ThreadAppender &&\n (appender.threadType === TraceEngine.Handlers.Threads.ThreadType.MAIN_THREAD ||\n appender.threadType === TraceEngine.Handlers.Threads.ThreadType.CPU_PROFILE)) {\n const group = this.compatibilityTracksAppender?.groupForAppender(appender);\n if (group) {\n this.timelineDataInternal.selectedGroup = group;\n }\n }\n }\n }\n if (this.timelineDataInternal && this.timelineDataInternal.selectedGroup) {\n this.timelineDataInternal.selectedGroup.expanded = true;\n }\n }\n\n #addDecorationToEvent(eventIndex: number, decoration: PerfUI.FlameChart.FlameChartDecoration): void {\n if (!this.timelineDataInternal) {\n return;\n }\n const decorationsForEvent = this.timelineDataInternal.entryDecorations[eventIndex] || [];\n decorationsForEvent.push(decoration);\n this.timelineDataInternal.entryDecorations[eventIndex] = decorationsForEvent;\n }\n\n /**\n * Appends a track in the flame chart using the legacy system.\n * @param track the legacy track to be rendered.\n * @param expanded if the track is expanded.\n */\n appendLegacyTrackData(track: TimelineModel.TimelineModel.Track, expanded?: boolean): void {\n this.#instantiateTimelineData();\n const eventEntryType = EntryType.Event;\n switch (track.type) {\n case TimelineModel.TimelineModel.TrackType.MainThread: {\n if (track.forMainFrame) {\n const group = this.appendSyncEvents(\n track, track.events,\n track.url ? i18nString(UIStrings.mainS, {PH1: track.url}) : i18nString(UIStrings.main), this.headerLevel1,\n eventEntryType, true /* selectable */, expanded);\n if (group && this.timelineDataInternal) {\n this.timelineDataInternal.selectedGroup = group;\n }\n } else {\n this.appendSyncEvents(\n track, track.events,\n track.url ? i18nString(UIStrings.frameS, {PH1: track.url}) : i18nString(UIStrings.subframe),\n this.headerLevel1, eventEntryType, true /* selectable */, expanded);\n }\n break;\n }\n\n case TimelineModel.TimelineModel.TrackType.Worker: {\n this.appendSyncEvents(\n track, track.events, track.name, this.headerLevel1, eventEntryType, true /* selectable */, expanded);\n break;\n }\n\n case TimelineModel.TimelineModel.TrackType.Raster: {\n if (!this.#rasterCount) {\n this.appendHeader(i18nString(UIStrings.raster), this.headerLevel1, false /* selectable */, expanded);\n }\n ++this.#rasterCount;\n this.appendSyncEvents(\n track, track.events, i18nString(UIStrings.rasterizerThreadS, {PH1: this.#rasterCount}), this.headerLevel2,\n eventEntryType, true /* selectable */, expanded);\n break;\n }\n\n case TimelineModel.TimelineModel.TrackType.Other: {\n this.appendSyncEvents(\n track, track.events, track.name || i18nString(UIStrings.thread), this.headerLevel1, eventEntryType,\n true /* selectable */, expanded);\n this.appendAsyncEventsGroup(\n track, track.name, track.asyncEvents, this.headerLevel1, eventEntryType, true /* selectable */, expanded);\n break;\n }\n }\n }\n minimumBoundary(): number {\n return this.minimumBoundaryInternal;\n }\n\n totalTime(): number {\n return this.timeSpan;\n }\n\n /**\n * Narrows an entry of type TimelineFlameChartEntry to the 2 types of\n * simple trace events (legacy and new engine definitions).\n */\n static isEntryRegularEvent(entry: TimelineFlameChartEntry):\n entry is(TraceEngine.Types.TraceEvents.TraceEventData|TraceEngine.Legacy.Event) {\n return 'name' in entry;\n }\n\n search(startTime: number, endTime: number, filter: TimelineModel.TimelineModelFilter.TimelineModelFilter): number[] {\n const result = [];\n this.timelineData();\n for (let i = 0; i < this.entryData.length; ++i) {\n const entry = this.entryData[i];\n if (!TimelineFlameChartDataProvider.isEntryRegularEvent(entry)) {\n continue;\n }\n if (!entry) {\n continue;\n }\n\n // Until all the tracks are powered by the new engine, we need to\n // consider that these entries could be either new engine or legacy\n // engine.\n const entryStartTime = TraceEngine.Legacy.eventIsFromNewEngine(entry) ?\n TraceEngine.Helpers.Timing.eventTimingsMilliSeconds(entry).startTime :\n entry.startTime;\n const entryEndTime = TraceEngine.Legacy.eventIsFromNewEngine(entry) ?\n TraceEngine.Helpers.Timing.eventTimingsMilliSeconds(entry).endTime :\n entry.endTime;\n\n if (entryStartTime > endTime) {\n continue;\n }\n if ((entryEndTime || entryStartTime) < startTime) {\n continue;\n }\n if (filter.accept(entry, this.traceEngineData || undefined)) {\n result.push(i);\n }\n }\n result.sort((a, b) => {\n let firstEvent: TimelineFlameChartEntry|null = this.entryData[a];\n let secondEvent: TimelineFlameChartEntry|null = this.entryData[b];\n if (!TimelineFlameChartDataProvider.isEntryRegularEvent(firstEvent) ||\n !TimelineFlameChartDataProvider.isEntryRegularEvent(secondEvent)) {\n return 0;\n }\n firstEvent = firstEvent instanceof TraceEngine.Legacy.Event ?\n firstEvent :\n (this.compatibilityTracksAppender?.getLegacyEvent(firstEvent) || null);\n secondEvent = secondEvent instanceof TraceEngine.Legacy.Event ?\n secondEvent :\n (this.compatibilityTracksAppender?.getLegacyEvent(secondEvent) || null);\n if (!firstEvent || !secondEvent) {\n return 0;\n }\n return TraceEngine.Legacy.Event.compareStartTime(firstEvent, secondEvent);\n });\n return result;\n }\n\n private appendSyncEvents(\n track: TimelineModel.TimelineModel.Track|null, events: TraceEngine.Legacy.Event[], title: string|null,\n style: PerfUI.FlameChart.GroupStyle|null, entryType: EntryType, selectable: boolean,\n expanded?: boolean): PerfUI.FlameChart.Group|null {\n if (!events.length) {\n return null;\n }\n if (!this.legacyPerformanceModel || !this.legacyTimelineModel) {\n return null;\n }\n const openEvents = [];\n const ignoreListingEnabled = Root.Runtime.experiments.isEnabled('ignore-list-js-frames-on-timeline');\n let maxStackDepth = 0;\n let group: PerfUI.FlameChart.Group|null = null;\n if (track && track.type === TimelineModel.TimelineModel.TrackType.MainThread) {\n group = this.appendHeader((title as string), (style as PerfUI.FlameChart.GroupStyle), selectable, expanded);\n group.track = track;\n }\n for (let i = 0; i < events.length; ++i) {\n const event = events[i];\n const {duration: eventDuration} = TraceEngine.Legacy.timesForEventInMilliseconds(event);\n // TODO(crbug.com/1386091) this check should happen at the model level.\n // Skip Layout Shifts and TTI events when dealing with the main thread.\n if (this.legacyPerformanceModel) {\n const isInteractiveTime = this.legacyPerformanceModel.timelineModel().isInteractiveTimeEvent(event);\n const isLayoutShift = this.legacyPerformanceModel.timelineModel().isLayoutShiftEvent(event);\n const skippableEvent = isInteractiveTime || isLayoutShift;\n\n if (track && track.type === TimelineModel.TimelineModel.TrackType.MainThread && skippableEvent) {\n continue;\n }\n }\n\n if (!TraceEngine.Types.TraceEvents.isFlowPhase(event.phase)) {\n if (!event.endTime && event.phase !== TraceEngine.Types.TraceEvents.Phase.INSTANT) {\n continue;\n }\n if (TraceEngine.Types.TraceEvents.isAsyncPhase(event.phase)) {\n continue;\n }\n if (!ActiveFilters.instance().isVisible(event)) {\n continue;\n }\n }\n // Handle events belonging to a stack. E.g. A call stack in the main thread flame chart.\n while (openEvents.length &&\n // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration\n // @ts-expect-error\n ((openEvents[openEvents.length - 1] as TraceEngine.Legacy.Event).endTime) <= event.startTime) {\n openEvents.pop();\n }\n this.#eventToDisallowRoot.set(event, false);\n if (ignoreListingEnabled && this.isIgnoreListedEvent(event)) {\n const parent = openEvents[openEvents.length - 1];\n if (parent && this.#eventToDisallowRoot.get(parent)) {\n continue;\n }\n this.#eventToDisallowRoot.set(event, true);\n }\n if (!group && title) {\n group = this.appendHeader(title, (style as PerfUI.FlameChart.GroupStyle), selectable, expanded);\n if (selectable) {\n group.track = track;\n }\n }\n\n const level = this.currentLevel + openEvents.length;\n const index = this.appendEvent(event, level);\n if (openEvents.length) {\n this.entryParent[index] = (openEvents[openEvents.length - 1] as TraceEngine.Legacy.Event);\n }\n\n const trackIsMainThreadMainFrame =\n Boolean(track?.forMainFrame && track?.type === TimelineModel.TimelineModel.TrackType.MainThread);\n // If we are dealing with the Main Thread, find any long tasks and add\n // the candy striping to them. Doing it here avoids having to do another\n // pass through the events at a later point.\n if (trackIsMainThreadMainFrame && event.name === TimelineModel.TimelineModel.RecordType.Task &&\n TraceEngine.Helpers.Timing.millisecondsToMicroseconds(eventDuration) >\n TraceEngine.Handlers.ModelHandlers.Warnings.LONG_MAIN_THREAD_TASK_THRESHOLD) {\n this.#addDecorationToEvent(index, {\n type: PerfUI.FlameChart.FlameChartDecorationType.CANDY,\n startAtTime: TraceEngine.Handlers.ModelHandlers.Warnings.LONG_MAIN_THREAD_TASK_THRESHOLD,\n });\n }\n maxStackDepth = Math.max(maxStackDepth, openEvents.length + 1);\n if (event.endTime) {\n openEvents.push(event);\n }\n }\n this.entryTypeByLevel.length = this.currentLevel + maxStackDepth;\n this.entryTypeByLevel.fill(entryType, this.currentLevel);\n this.currentLevel += maxStackDepth;\n return group;\n }\n\n isIgnoreListedEvent(event: TraceEngine.Legacy.CompatibleTraceEvent): boolean {\n if (TraceEngine.Legacy.eventIsFromNewEngine(event) && TraceEngine.Types.TraceEvents.isProfileCall(event)) {\n return this.isIgnoreListedURL(event.callFrame.url as Platform.DevToolsPath.UrlString);\n }\n return false;\n }\n\n private isIgnoreListedURL(url: Platform.DevToolsPath.UrlString): boolean {\n return Bindings.IgnoreListManager.IgnoreListManager.instance().isUserIgnoreListedURL(url);\n }\n\n private appendAsyncEventsGroup(\n track: TimelineModel.TimelineModel.Track|null, title: string|null, events: TraceEngine.Legacy.AsyncEvent[],\n style: PerfUI.FlameChart.GroupStyle|null, entryType: EntryType, selectable: boolean,\n expanded?: boolean): PerfUI.FlameChart.Group|null {\n if (!events.length) {\n return null;\n }\n const lastUsedTimeByLevel: number[] = [];\n let group: PerfUI.FlameChart.Group|null = null;\n for (let i = 0; i < events.length; ++i) {\n const asyncEvent = events[i];\n if (!this.legacyPerformanceModel || !ActiveFilters.instance().isVisible(asyncEvent)) {\n continue;\n }\n if (!group && title) {\n group = this.appendHeader(title, (style as PerfUI.FlameChart.GroupStyle), selectable, expanded);\n if (selectable) {\n group.track = track;\n }\n }\n const startTime = asyncEvent.startTime;\n let level;\n for (level = 0; level < lastUsedTimeByLevel.length && lastUsedTimeByLevel[level] > startTime; ++level) {\n }\n this.appendAsyncEvent(asyncEvent, this.currentLevel + level);\n lastUsedTimeByLevel[level] = (asyncEvent.endTime as number);\n }\n this.entryTypeByLevel.length = this.currentLevel + lastUsedTimeByLevel.length;\n this.entryTypeByLevel.fill(entryType, this.currentLevel);\n this.currentLevel += lastUsedTimeByLevel.length;\n return group;\n }\n\n getEntryTypeForLevel(level: number): EntryType {\n return this.entryTypeByLevel[level];\n }\n\n private appendFrames(): void {\n if (!this.legacyPerformanceModel || !this.timelineDataInternal || !this.legacyTimelineModel ||\n !this.traceEngineData) {\n return;\n }\n\n // TODO: Long term we want to move both the Frames track and the screenshots\n // track into the TrackAppender system. However right now the frames track\n // expects data in a different form to how the new engine parses frame\n // information. Therefore we have migrated the screenshots to use the new\n // data model in place without creating a new TrackAppender. When we can\n // migrate the frames track to the new appender system, we can migrate the\n // screnshots then as well.\n const filmStrip = TraceEngine.Extras.FilmStrip.fromTraceData(this.traceEngineData);\n const hasScreenshots = filmStrip.frames.length > 0;\n\n this.framesHeader.collapsible = hasScreenshots;\n const expanded = Root.Runtime.Runtime.queryParam('flamechart-force-expand') === 'frames';\n\n this.appendHeader(i18nString(UIStrings.frames), this.framesHeader, false /* selectable */, expanded);\n\n this.entryTypeByLevel[this.currentLevel] = EntryType.Frame;\n for (const frame of this.traceEngineData.Frames.frames) {\n this.#appendNewEngineFrame(frame);\n }\n ++this.currentLevel;\n\n if (!hasScreenshots) {\n return;\n }\n this.#appendScreenshots(filmStrip);\n }\n\n #appendScreenshots(filmStrip: TraceEngine.Extras.FilmStrip.Data): void {\n if (!this.timelineDataInternal || !this.legacyTimelineModel) {\n return;\n }\n this.appendHeader('', this.screenshotsHeader, false /* selectable */);\n this.entryTypeByLevel[this.currentLevel] = EntryType.Screenshot;\n let prevTimestamp: TraceEngine.Types.Timing.MilliSeconds|undefined = undefined;\n\n for (const filmStripFrame of filmStrip.frames) {\n const screenshotTimeInMilliSeconds =\n TraceEngine.Helpers.Timing.microSecondsToMilliseconds(filmStripFrame.screenshotEvent.ts);\n this.entryData.push(filmStripFrame.screenshotEvent);\n (this.timelineDataInternal.entryLevels as number[]).push(this.currentLevel);\n (this.timelineDataInternal.entryStartTimes as number[]).push(screenshotTimeInMilliSeconds);\n if (prevTimestamp) {\n (this.timelineDataInternal.entryTotalTimes as number[]).push(screenshotTimeInMilliSeconds - prevTimestamp);\n }\n prevTimestamp = screenshotTimeInMilliSeconds;\n }\n if (filmStrip.frames.length && prevTimestamp !== undefined) {\n // Set the total time of the final screenshot so it takes up the remainder of the trace.\n (this.timelineDataInternal.entryTotalTimes as number[])\n .push(this.legacyTimelineModel.maximumRecordTime() - prevTimestamp);\n }\n ++this.currentLevel;\n }\n\n private entryType(entryIndex: number): EntryType {\n return this.entryTypeByLevel[(this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData)\n .entryLevels[entryIndex]];\n }\n\n prepareHighlightedEntryInfo(entryIndex: number): Element|null {\n let time = '';\n let title;\n let warningElements: Element[] = [];\n let nameSpanTimelineInfoTime = 'timeline-info-time';\n\n const additionalContent: HTMLElement[] = [];\n\n const entryType = this.entryType(entryIndex);\n if (entryType === EntryType.TrackAppender) {\n if (!this.compatibilityTracksAppender) {\n return null;\n }\n const event = (this.entryData[entryIndex] as TraceEngine.Types.TraceEvents.TraceEventData);\n const timelineData = (this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData);\n const eventLevel = timelineData.entryLevels[entryIndex];\n const highlightedEntryInfo = this.compatibilityTracksAppender.highlightedEntryInfo(event, eventLevel);\n title = highlightedEntryInfo.title;\n time = highlightedEntryInfo.formattedTime;\n warningElements = highlightedEntryInfo.warningElements || warningElements;\n if (TraceEngine.Types.TraceEvents.isSyntheticInteractionEvent(event)) {\n const breakdown = new Components.InteractionBreakdown.InteractionBreakdown();\n breakdown.entry = event;\n additionalContent.push(breakdown);\n }\n } else if (entryType === EntryType.Event) {\n const event = (this.entryData[entryIndex] as TraceEngine.Legacy.Event);\n const totalTime = event.duration;\n const selfTime = event.selfTime;\n const eps = 1e-6;\n if (typeof totalTime === 'number') {\n time = Math.abs(totalTime - selfTime) > eps && selfTime > eps ?\n i18nString(UIStrings.sSelfS, {\n PH1: i18n.TimeUtilities.millisToString(totalTime, true),\n PH2: i18n.TimeUtilities.millisToString(selfTime, true),\n }) :\n i18n.TimeUtilities.millisToString(totalTime, true);\n }\n title = this.entryTitle(entryIndex);\n\n } else if (entryType === EntryType.Frame) {\n const frame = (this.entryData[entryIndex] as TraceEngine.Handlers.ModelHandlers.Frames.TimelineFrame);\n time = i18n.TimeUtilities.preciseMillisToString(\n TraceEngine.Helpers.Timing.microSecondsToMilliseconds(frame.duration), 1);\n\n if (frame.idle) {\n title = i18nString(UIStrings.idleFrame);\n } else if (frame.dropped) {\n if (frame.isPartial) {\n title = i18nString(UIStrings.partiallyPresentedFrame);\n } else {\n title = i18nString(UIStrings.droppedFrame);\n }\n nameSpanTimelineInfoTime = 'timeline-info-warning';\n } else {\n title = i18nString(UIStrings.frame);\n }\n } else {\n return null;\n }\n\n const element = document.createElement('div');\n const root = UI.Utils.createShadowRootWithCoreStyles(element, {\n cssFile: [timelineFlamechartPopoverStyles],\n delegatesFocus: undefined,\n });\n const contents = root.createChild('div', 'timeline-flamechart-popover');\n contents.createChild('span', nameSpanTimelineInfoTime).textContent = time;\n contents.createChild('span', 'timeline-info-title').textContent = title;\n if (warningElements) {\n for (const warningElement of warningElements) {\n warningElement.classList.add('timeline-info-warning');\n contents.appendChild(warningElement);\n }\n }\n for (const elem of additionalContent) {\n contents.appendChild(elem);\n }\n return element;\n }\n\n prepareHighlightedHiddenEntriesArrowInfo(entryIndex: number): Element|null {\n const element = document.createElement('div');\n const root = UI.Utils.createShadowRootWithCoreStyles(element, {\n cssFile: [timelineFlamechartPopoverStyles],\n delegatesFocus: undefined,\n });\n\n const entry = this.entryData[entryIndex] as TraceEngine.Types.TraceEvents.SyntheticTraceEntry;\n const hiddenEntriesAmount = AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance()\n ?.getEntriesFilter()\n .findHiddenDescendantsAmount(entry);\n\n if (!hiddenEntriesAmount) {\n return null;\n }\n const contents = root.createChild('div', 'timeline-flamechart-popover');\n contents.createChild('span', 'timeline-info-title').textContent = hiddenEntriesAmount + ' hidden';\n\n return element;\n }\n\n entryColor(entryIndex: number): string {\n function patchColorAndCache(cache: Map, key: KEY, lookupColor: (arg0: KEY) => string): string {\n let color = cache.get(key);\n if (color) {\n return color;\n }\n const parsedColor = lookupColor(key);\n if (!parsedColor) {\n throw new Error('Could not parse color from entry');\n }\n color = parsedColor;\n cache.set(key, color);\n return (color);\n }\n\n if (!this.legacyPerformanceModel || !this.legacyTimelineModel) {\n return '';\n }\n\n const entryType = this.entryType(entryIndex);\n if (entryType === EntryType.Event) {\n const event = (this.entryData[entryIndex] as TraceEngine.Legacy.Event);\n if (this.legacyTimelineModel.isGenericTrace()) {\n return this.genericTraceEventColor(event);\n }\n if (this.legacyPerformanceModel.timelineModel().isMarkerEvent(event)) {\n return TimelineUIUtils.markerStyleForEvent(event).color;\n }\n if (!TraceEngine.Types.TraceEvents.isAsyncPhase(event.phase) && this.colorForEvent) {\n return this.colorForEvent(event);\n }\n const category = TimelineUIUtils.eventStyle(event).category;\n return patchColorAndCache(this.asyncColorByCategory, category, () => category.getComputedColorValue());\n }\n if (entryType === EntryType.Frame) {\n return 'white';\n }\n if (entryType === EntryType.TrackAppender) {\n const timelineData = (this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData);\n const eventLevel = timelineData.entryLevels[entryIndex];\n const event = (this.entryData[entryIndex] as TraceEngine.Types.TraceEvents.TraceEventData);\n return this.compatibilityTracksAppender?.colorForEvent(event, eventLevel) || '';\n }\n return '';\n }\n\n private genericTraceEventColor(event: TraceEngine.Legacy.Event): string {\n const key = event.categoriesString || event.name;\n return key ? `hsl(${Platform.StringUtilities.hashCode(key) % 300 + 30}, 40%, 70%)` : '#ccc';\n }\n\n private preparePatternCanvas(): void {\n // Set the candy stripe pattern to 17px so it repeats well.\n const size = 17;\n this.droppedFramePatternCanvas.width = size;\n this.droppedFramePatternCanvas.height = size;\n\n this.partialFramePatternCanvas.width = size;\n this.partialFramePatternCanvas.height = size;\n\n const ctx = this.droppedFramePatternCanvas.getContext('2d');\n if (ctx) {\n // Make a dense solid-line pattern.\n ctx.translate(size * 0.5, size * 0.5);\n ctx.rotate(Math.PI * 0.25);\n ctx.translate(-size * 0.5, -size * 0.5);\n\n ctx.fillStyle = 'rgb(255, 255, 255)';\n for (let x = -size; x < size * 2; x += 3) {\n ctx.fillRect(x, -size, 1, size * 3);\n }\n }\n\n const ctx2 = this.partialFramePatternCanvas.getContext('2d');\n if (ctx2) {\n // Make a sparse dashed-line pattern.\n ctx2.strokeStyle = 'rgb(255, 255, 255)';\n ctx2.lineWidth = 2;\n ctx2.beginPath();\n ctx2.moveTo(17, 0);\n ctx2.lineTo(10, 7);\n ctx2.moveTo(8, 9);\n ctx2.lineTo(2, 15);\n ctx2.stroke();\n }\n }\n\n private drawFrame(\n entryIndex: number, context: CanvasRenderingContext2D, text: string|null, barX: number, barY: number,\n barWidth: number, barHeight: number): void {\n const hPadding = 1;\n const frame = (this.entryData[entryIndex] as TraceEngine.Handlers.ModelHandlers.Frames.TimelineFrame);\n barX += hPadding;\n barWidth -= 2 * hPadding;\n if (frame.idle) {\n context.fillStyle = 'white';\n } else if (frame.dropped) {\n if (frame.isPartial) {\n // For partially presented frame boxes, paint a yellow background with\n // a sparse white dashed-line pattern overlay.\n context.fillStyle = '#f0e442';\n context.fillRect(barX, barY, barWidth, barHeight);\n\n const overlay = context.createPattern(this.partialFramePatternCanvas, 'repeat');\n context.fillStyle = overlay || context.fillStyle;\n } else {\n // For dropped frame boxes, paint a red background with a dense white\n // solid-line pattern overlay.\n context.fillStyle = '#f08080';\n context.fillRect(barX, barY, barWidth, barHeight);\n\n const overlay = context.createPattern(this.droppedFramePatternCanvas, 'repeat');\n context.fillStyle = overlay || context.fillStyle;\n }\n } else {\n context.fillStyle = '#d7f0d1';\n }\n context.fillRect(barX, barY, barWidth, barHeight);\n\n const frameDurationText = i18n.TimeUtilities.preciseMillisToString(\n TraceEngine.Helpers.Timing.microSecondsToMilliseconds(frame.duration), 1);\n const textWidth = context.measureText(frameDurationText).width;\n if (textWidth <= barWidth) {\n context.fillStyle = this.textColor(entryIndex);\n context.fillText(frameDurationText, barX + (barWidth - textWidth) / 2, barY + barHeight - 4);\n }\n }\n\n private async drawScreenshot(\n entryIndex: number, context: CanvasRenderingContext2D, barX: number, barY: number, barWidth: number,\n barHeight: number): Promise {\n const screenshot = (this.entryData[entryIndex] as TraceEngine.Types.TraceEvents.SyntheticScreenshot);\n if (!this.screenshotImageCache.has(screenshot)) {\n this.screenshotImageCache.set(screenshot, null);\n const data = screenshot.args.dataUri;\n const image = await UI.UIUtils.loadImage(data);\n this.screenshotImageCache.set(screenshot, image);\n this.dispatchEventToListeners(Events.DataChanged);\n return;\n }\n\n const image = this.screenshotImageCache.get(screenshot);\n if (!image) {\n return;\n }\n const imageX = barX + 1;\n const imageY = barY + 1;\n const imageHeight = barHeight - 2;\n const scale = imageHeight / image.naturalHeight;\n const imageWidth = Math.floor(image.naturalWidth * scale);\n context.save();\n context.beginPath();\n context.rect(barX, barY, barWidth, barHeight);\n context.clip();\n context.drawImage(image, imageX, imageY, imageWidth, imageHeight);\n context.strokeStyle = '#ccc';\n context.strokeRect(imageX - 0.5, imageY - 0.5, Math.min(barWidth - 1, imageWidth + 1), imageHeight);\n context.restore();\n }\n\n decorateEntry(\n entryIndex: number, context: CanvasRenderingContext2D, text: string|null, barX: number, barY: number,\n barWidth: number, barHeight: number, unclippedBarX: number, timeToPixelRatio: number): boolean {\n const entryType = this.entryType(entryIndex);\n\n if (entryType === EntryType.Frame) {\n this.drawFrame(entryIndex, context, text, barX, barY, barWidth, barHeight);\n return true;\n }\n\n if (entryType === EntryType.Screenshot) {\n void this.drawScreenshot(entryIndex, context, barX, barY, barWidth, barHeight);\n return true;\n }\n\n if (entryType === EntryType.TrackAppender) {\n const entry = this.entryData[entryIndex] as TraceEngine.Types.TraceEvents.TraceEventData;\n if (TraceEngine.Types.TraceEvents.isSyntheticInteractionEvent(entry)) {\n this.#drawInteractionEventWithWhiskers(\n context, entryIndex, text, entry, barX, barY, unclippedBarX, barWidth, barHeight, timeToPixelRatio);\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Draws the left and right whiskers around an interaction in the timeline.\n * @param context - the canvas that will be drawn onto\n * @param entryIndex\n * @param entryTitle - the title of the entry\n * @param entry - the entry itself\n * @param barX - the starting X pixel position of the bar representing this event. This is clipped: if the bar is off the left side of the screen, this value will be 0\n * @param barY - the starting Y pixel position of the bar representing this event.\n * @param unclippedBarXStartPixel - the starting X pixel position of the bar representing this event, not clipped. This means if the bar is off the left of the screen this will be a negative number.\n * @param barWidth - the width of the full bar in pixels\n * @param barHeight - the height of the full bar in pixels\n * @param timeToPixelRatio - the ratio required to convert a millisecond time to a pixel value.\n **/\n #drawInteractionEventWithWhiskers(\n context: CanvasRenderingContext2D, entryIndex: number, entryTitle: string|null,\n entry: TraceEngine.Types.TraceEvents.SyntheticInteractionPair, barX: number, barY: number,\n unclippedBarXStartPixel: number, barWidth: number, barHeight: number, timeToPixelRatio: number): void {\n /**\n * An interaction is drawn with whiskers as so:\n * |----------[=======]-------------|\n * => The left whisker is the event's start time (event.ts)\n * => The box start is the event's processingStart time\n * => The box end is the event's processingEnd time\n * => The right whisker is the event's end time (event.ts + event.dur)\n *\n * When we draw the event in the InteractionsAppender, we draw a huge box\n * that spans the entire of the above. So here we need to draw over the\n * rectangle that is outside of {processingStart, processingEnd} and\n * replace it with the whiskers.\n * TODO(crbug.com/1495248): rework how we draw whiskers to avoid this inefficiency\n */\n\n const beginTime = TraceEngine.Helpers.Timing.microSecondsToMilliseconds(entry.ts);\n const entireBarEndXPixel = barX + barWidth;\n\n function timeToPixel(time: TraceEngine.Types.Timing.MicroSeconds): number {\n const timeMilli = TraceEngine.Helpers.Timing.microSecondsToMilliseconds(time);\n return Math.floor(unclippedBarXStartPixel + (timeMilli - beginTime) * timeToPixelRatio);\n }\n\n context.save();\n\n // Clear portions of initial rect to prepare for the ticks.\n context.fillStyle = ThemeSupport.ThemeSupport.instance().getComputedValue('--sys-color-cdt-base-container');\n let desiredBoxStartX = timeToPixel(entry.processingStart);\n const desiredBoxEndX = timeToPixel(entry.processingEnd);\n\n // If the entry has no processing duration, ensure the box is 1px wide so at least it is visible.\n if (entry.processingEnd - entry.processingStart === 0) {\n desiredBoxStartX -= 1;\n }\n\n context.fillRect(barX, barY - 0.5, desiredBoxStartX - barX, barHeight);\n context.fillRect(desiredBoxEndX, barY - 0.5, entireBarEndXPixel - desiredBoxEndX, barHeight);\n\n // Draws left and right whiskers\n function drawTick(begin: number, end: number, y: number): void {\n const tickHeightPx = 6;\n context.moveTo(begin, y - tickHeightPx / 2);\n context.lineTo(begin, y + tickHeightPx / 2);\n context.moveTo(begin, y);\n context.lineTo(end, y);\n }\n\n // The left whisker starts at the enty timestamp, and continues until the start of the box (processingStart).\n const leftWhiskerX = timeToPixel(entry.ts);\n // The right whisker ends at (entry.ts + entry.dur). We draw the line from the end of the box (processingEnd).\n const rightWhiskerX = timeToPixel(TraceEngine.Types.Timing.MicroSeconds(entry.ts + entry.dur));\n context.beginPath();\n context.lineWidth = 1;\n context.strokeStyle = '#ccc';\n const lineY = Math.floor(barY + barHeight / 2) + 0.5;\n const leftTick = leftWhiskerX + 0.5;\n const rightTick = rightWhiskerX - 0.5;\n drawTick(leftTick, desiredBoxStartX, lineY);\n drawTick(rightTick, desiredBoxEndX, lineY);\n context.stroke();\n\n if (entryTitle) {\n // BarX will be set to 0 if the start of the box if off the screen to the\n // left. If this happens, the desiredBoxStartX will be negative. In that\n // case, we fallback to the BarX. This ensures that even if the box\n // starts off-screen, we draw the text at the first visible on screen\n // pixels, so the user can still see the event's title.\n const textStartX = desiredBoxStartX > 0 ? desiredBoxStartX : barX;\n context.font = this.#font;\n const textWidth = UI.UIUtils.measureTextWidth(context, entryTitle);\n\n // These numbers are duplicated from FlameChart.ts.\n const textPadding = 5;\n const textBaseline = 5;\n\n // Only draw the text if it can fit in the amount of box that is visible.\n if (textWidth <= desiredBoxEndX - textStartX + textPadding) {\n context.fillStyle = this.textColor(entryIndex);\n context.fillText(entryTitle, textStartX + textPadding, barY + barHeight - textBaseline);\n }\n }\n context.restore();\n }\n\n forceDecoration(entryIndex: number): boolean {\n const entryType = this.entryType(entryIndex);\n if (entryType === EntryType.Frame) {\n return true;\n }\n if (entryType === EntryType.Screenshot) {\n return true;\n }\n\n if (entryType === EntryType.Event) {\n // TODO: this entryType can no longer exist as all tracks are now\n // migrated to appenders. This can be removed as part of the old engine\n // removal.\n return false;\n }\n const event = (this.entryData[entryIndex] as TraceEngine.Types.TraceEvents.TraceEventData);\n\n if (TraceEngine.Types.TraceEvents.isSyntheticInteractionEvent(event)) {\n // We draw interactions with whiskers, which are done via the\n // decorateEntry() method, hence we always want to force these to be\n // decorated.\n return true;\n }\n return Boolean(this.traceEngineData?.Warnings.perEvent.get(event));\n }\n\n private appendHeader(title: string, style: PerfUI.FlameChart.GroupStyle, selectable: boolean, expanded?: boolean):\n PerfUI.FlameChart.Group {\n const group =\n ({startLevel: this.currentLevel, name: title, style: style, selectable: selectable, expanded} as\n PerfUI.FlameChart.Group);\n (this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData).groups.push(group);\n return group;\n }\n\n private appendEvent(event: TraceEngine.Legacy.Event, level: number): number {\n const index = this.entryData.length;\n this.entryData.push(event);\n const timelineData = (this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData);\n timelineData.entryLevels[index] = level;\n timelineData.entryTotalTimes[index] = event.duration || InstantEventVisibleDurationMs;\n timelineData.entryStartTimes[index] = event.startTime;\n return index;\n }\n\n private appendAsyncEvent(asyncEvent: TraceEngine.Legacy.AsyncEvent, level: number): void {\n const steps = asyncEvent.steps;\n // If we have past steps, put the end event for each range rather than start one.\n const eventOffset =\n steps.length > 1 && steps[1].phase === TraceEngine.Types.TraceEvents.Phase.ASYNC_STEP_PAST ? 1 : 0;\n for (let i = 0; i < steps.length - 1; ++i) {\n const index = this.entryData.length;\n this.entryData.push(steps[i + eventOffset]);\n const startTime = steps[i].startTime;\n const timelineData = (this.timelineDataInternal as PerfUI.FlameChart.FlameChartTimelineData);\n timelineData.entryLevels[index] = level;\n timelineData.entryTotalTimes[index] = steps[i + 1].startTime - startTime;\n timelineData.entryStartTimes[index] = startTime;\n }\n }\n\n #appendNewEngineFrame(frame: TraceEngine.Handlers.ModelHandlers.Frames.TimelineFrame): void {\n const index = this.entryData.length;\n this.entryData.push(frame);\n const durationMilliseconds = TraceEngine.Helpers.Timing.microSecondsToMilliseconds(frame.duration);\n this.entryIndexToTitle[index] = i18n.TimeUtilities.millisToString(durationMilliseconds, true);\n if (!this.timelineDataInternal) {\n return;\n }\n this.timelineDataInternal.entryLevels[index] = this.currentLevel;\n this.timelineDataInternal.entryTotalTimes[index] = durationMilliseconds;\n this.timelineDataInternal.entryStartTimes[index] =\n TraceEngine.Helpers.Timing.microSecondsToMilliseconds(frame.startTime);\n }\n\n createSelection(entryIndex: number): TimelineSelection|null {\n const entryType = this.entryType(entryIndex);\n let timelineSelection: TimelineSelection|null = null;\n const entry = this.entryData[entryIndex];\n if (entry && TimelineFlameChartDataProvider.isEntryRegularEvent(entry)) {\n timelineSelection = TimelineSelection.fromTraceEvent(entry);\n } else if (entryType === EntryType.Frame) {\n timelineSelection = TimelineSelection.fromFrame(\n (this.entryData[entryIndex] as TraceEngine.Handlers.ModelHandlers.Frames.TimelineFrame));\n }\n if (timelineSelection) {\n this.lastSelection = new Selection(timelineSelection, entryIndex);\n }\n return timelineSelection;\n }\n\n formatValue(value: number, precision?: number): string {\n return i18n.TimeUtilities.preciseMillisToString(value, precision);\n }\n\n canJumpToEntry(_entryIndex: number): boolean {\n return false;\n }\n\n entryIndexForSelection(selection: TimelineSelection|null): number {\n if (!selection || TimelineSelection.isRangeSelection(selection.object) ||\n TimelineSelection.isSyntheticNetworkRequestDetailsEventSelection(selection.object)) {\n return -1;\n }\n\n if (this.lastSelection && this.lastSelection.timelineSelection.object === selection.object) {\n return this.lastSelection.entryIndex;\n }\n\n // If the index is -1 and the selection is a TraceEvent, it might be\n // the case that this Entry is hidden by the Context Menu action.\n // Try revealing the entry and getting the index again.\n if (this.entryData.indexOf(selection.object) === -1 && TimelineSelection.isTraceEventSelection(selection.object)) {\n if (this.timelineDataInternal?.selectedGroup) {\n AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance()?.getEntriesFilter().revealEntry(\n selection.object as TraceEngine.Types.TraceEvents.SyntheticTraceEntry);\n this.timelineData(true);\n }\n }\n\n const index = this.entryData.indexOf(selection.object);\n if (index !== -1) {\n this.lastSelection = new Selection(selection, index);\n }\n return index;\n }\n\n getIndexForEvent(targetEvent: TraceEngine.Types.TraceEvents.TraceEventData): number|null {\n // Gets the index for the given event by walking through the array of entryData.\n // This may seem inefficient - but we have seen that by building up large\n // maps keyed by trace events that this has a significant impact on the\n // performance of the panel.\n // Therefore, we strike a middle ground: look up the event the first time,\n // but then cache the result.\n const fromCache = this.#eventIndexByEvent.get(targetEvent);\n if (fromCache) {\n return fromCache;\n }\n const index = this.entryData.indexOf(targetEvent);\n const result = index > -1 ? index : null;\n this.#eventIndexByEvent.set(targetEvent, result);\n return result;\n }\n\n /**\n * Build the data for initiators and initiated entries.\n * @param entryIndex\n * @returns if we should re-render the flame chart (canvas)\n */\n buildFlowForInitiator(entryIndex: number): boolean {\n if (this.lastInitiatorEntry === entryIndex) {\n return false;\n }\n if (!this.traceEngineData) {\n return false;\n }\n if (!this.timelineDataInternal) {\n return false;\n }\n if (!this.compatibilityTracksAppender) {\n return false;\n }\n\n // Remove all previously assigned decorations indicating that the flow event entries are hidden\n const previousInitiatorsDataLength = this.timelineDataInternal.initiatorsData.length;\n // |entryIndex| equals -1 means there is no entry selected, just clear the\n // initiator cache if there is any previous arrow and return true to\n // re-render.\n if (entryIndex === -1) {\n this.lastInitiatorEntry = entryIndex;\n if (previousInitiatorsDataLength === 0) {\n // This means there is no arrow before, so we don't need to re-render.\n return false;\n }\n // Reset to clear any previous arrows from the last event.\n this.timelineDataInternal.resetFlowData();\n return true;\n }\n\n const entryType = this.entryType(entryIndex);\n if (entryType !== EntryType.TrackAppender) {\n return false;\n }\n const event = this.entryData[entryIndex] as TraceEngine.Types.TraceEvents.TraceEventData;\n if (!TraceEngine.Legacy.eventIsFromNewEngine(event)) {\n // TODO: as part of the old engine removal, we need to redefine the Event\n // type to teach the code that only new engine events can be selected by\n // the user.\n return false;\n }\n // Reset to clear any previous arrows from the last event.\n this.timelineDataInternal.resetFlowData();\n this.lastInitiatorEntry = entryIndex;\n\n const hiddenEvents: TraceEngine.Types.TraceEvents.TraceEventData[] =\n AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance()\n ?.getEntriesFilter()\n .invisibleEntries() ??\n [];\n const modifiedEntries: TraceEngine.Types.TraceEvents.TraceEventData[] =\n AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance()\n ?.getEntriesFilter()\n .modifiedEntries() ??\n [];\n\n const initiatorsData = initiatorsDataToDraw(\n this.traceEngineData,\n event,\n hiddenEvents,\n modifiedEntries,\n );\n // This means there is no change for arrows.\n if (previousInitiatorsDataLength === 0 && initiatorsData.length === 0) {\n return false;\n }\n for (const intiatorData of initiatorsData) {\n const eventIndex = this.getIndexForEvent(intiatorData.event);\n const initiatorIndex = this.getIndexForEvent(intiatorData.initiator);\n if (eventIndex === null || initiatorIndex === null) {\n continue;\n }\n this.timelineDataInternal.initiatorsData.push({\n initiatorIndex,\n eventIndex,\n isInitiatorHidden: intiatorData.isInitiatorHidden,\n isEntryHidden: intiatorData.isEntryHidden,\n });\n }\n return true;\n }\n\n eventByIndex(entryIndex: number): TraceEngine.Legacy.CompatibleTraceEvent|null {\n if (entryIndex < 0) {\n return null;\n }\n const entryType = this.entryType(entryIndex);\n if (entryType === EntryType.TrackAppender) {\n return this.entryData[entryIndex] as TraceEngine.Types.TraceEvents.TraceEventData;\n }\n if (entryType === EntryType.Event) {\n return this.entryData[entryIndex] as TraceEngine.Legacy.Event;\n }\n return null;\n }\n\n setEventColorMapping(colorForEvent: (arg0: TraceEngine.Legacy.Event) => string): void {\n this.colorForEvent = colorForEvent;\n }\n\n // Included only for layout tests.\n // TODO(crbug.com/1386091): Fix/port layout tests and remove.\n get performanceModel(): PerformanceModel|null {\n return this.legacyPerformanceModel;\n }\n}\n\nexport const InstantEventVisibleDurationMs = 0.001;\n\nexport const enum Events {\n DataChanged = 'DataChanged',\n}\n\nexport type EventTypes = {\n [Events.DataChanged]: void,\n};\n\n// an entry is a trace event, they are classified into \"entry types\"\n// because some events are rendered differently. For example, screenshot\n// events are rendered as images. Checks for entry types allow to have\n// different styles, names, etc. for events that look differently.\n// In the future we won't have this checks: instead we will forward\n// the event to the corresponding \"track appender\" and it will determine\n// how the event shall be rendered.\nexport const enum EntryType {\n Frame = 'Frame',\n Event = 'Event',\n TrackAppender = 'TrackAppender',\n Screenshot = 'Screenshot',\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/TimelineFlameChartView.test.js b/public/panels/timeline/TimelineFlameChartView.test.js index ee52079de..5e613f334 100644 --- a/public/panels/timeline/TimelineFlameChartView.test.js +++ b/public/panels/timeline/TimelineFlameChartView.test.js @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import * as TraceEngine from '../../models/trace/trace.js'; +import * as AnnotationsManager from '../../services/annotations_manager/annotations_manager.js'; +import * as TraceBounds from '../../services/trace_bounds/trace_bounds.js'; import { describeWithEnvironment } from '../../testing/EnvironmentHelpers.js'; import { TraceLoader } from '../../testing/TraceLoader.js'; import * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js'; @@ -18,6 +20,12 @@ class MockViewDelegate { highlightEvent(_event) { } } +const baseTraceWindow = { + min: TraceEngine.Types.Timing.MicroSeconds(0), + max: TraceEngine.Types.Timing.MicroSeconds(10_000), + range: TraceEngine.Types.Timing.MicroSeconds(10_000), +}; +const boundsManager = TraceBounds.TraceBounds.BoundsManager.instance({ forceNew: true }).resetWithNewBounds(baseTraceWindow); describeWithEnvironment('TimelineFlameChartView', function () { it('Can search for events by name in the timeline', async function () { const { traceParsedData, performanceModel } = await TraceLoader.allModels(this, 'lcp-images.json.gz'); @@ -75,7 +83,10 @@ describeWithEnvironment('TimelineFlameChartView', function () { const mockViewDelegate = new MockViewDelegate(); const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate); flameChartView.setModel(performanceModel, traceParsedData); - TraceEngine.EntriesFilter.EntriesFilter.maybeInstance({ entryToNodeMap: traceParsedData.Renderer.entryToNode }); + AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance({ + entryToNodeMap: traceParsedData.Renderer.entryToNode, + wholeTraceBounds: boundsManager.state()?.micro.entireTraceBounds, + }); // Find the main track to later collapse entries of const mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => { return group.name === 'Main — http://localhost:8080/'; @@ -111,7 +122,10 @@ describeWithEnvironment('TimelineFlameChartView', function () { const mockViewDelegate = new MockViewDelegate(); const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate); flameChartView.setModel(performanceModel, traceParsedData); - TraceEngine.EntriesFilter.EntriesFilter.maybeInstance({ entryToNodeMap: traceParsedData.Renderer.entryToNode }); + AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance({ + entryToNodeMap: traceParsedData.Renderer.entryToNode, + wholeTraceBounds: boundsManager.state()?.micro.entireTraceBounds, + }); // Find the main track to later collapse entries of const mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => { return group.name === 'Main — http://localhost:8080/'; @@ -149,7 +163,10 @@ describeWithEnvironment('TimelineFlameChartView', function () { const mockViewDelegate = new MockViewDelegate(); const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate); flameChartView.setModel(performanceModel, traceParsedData); - TraceEngine.EntriesFilter.EntriesFilter.maybeInstance({ entryToNodeMap: traceParsedData.Renderer.entryToNode }); + AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance({ + entryToNodeMap: traceParsedData.Renderer.entryToNode, + wholeTraceBounds: boundsManager.state()?.micro.entireTraceBounds, + }); // Find the main track to later collapse entries of let mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => { return group.name === 'Main — http://localhost:8080/'; @@ -199,7 +216,10 @@ describeWithEnvironment('TimelineFlameChartView', function () { const mockViewDelegate = new MockViewDelegate(); flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate); flameChartView.setModel(performanceModel, traceParsedData); - TraceEngine.EntriesFilter.EntriesFilter.maybeInstance({ entryToNodeMap: traceParsedData.Renderer.entryToNode }); + AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance({ + entryToNodeMap: traceParsedData.Renderer.entryToNode, + wholeTraceBounds: boundsManager.state()?.micro.entireTraceBounds, + }); // Find the Main track to later collapse entries of const mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => { return group.name === 'Main — http://127.0.0.1:8080/'; @@ -208,7 +228,7 @@ describeWithEnvironment('TimelineFlameChartView', function () { throw new Error('Could not find main track'); } }); - it('When an entry has no children, correctly show only Hide as a possible Context Menu action', async function () { + it('When an entry has no children, correctly make only Hide Entry enabled in the Context Menu action', async function () { /** Part of this stack looks roughly like so (with some events omitted): * =============== foo =============== * =============== foo =============== @@ -231,11 +251,41 @@ describeWithEnvironment('TimelineFlameChartView', function () { flameChartView.getMainFlameChart().highlightEntry(iDOfNodeWithNoChildren); // The mouse event passed to the Context Menu is used to indicate where the menu should appear. Since we don't need it to actually appear for this test, pass an empty event. flameChartView.getMainFlameChart().onContextMenu(new Event('')); - assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 2); - assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(0)?.buildDescriptor().label, 'Hide function'); - assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(1)?.buildDescriptor().label, 'Reset trace'); + assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 5); + // Hide function enabled + assert.strictEqual(flameChartView.getMainFlameChart() + .getContextMenu() + ?.defaultSection() + .items.at(0) + ?.buildDescriptor() + .enabled, true); + // Rest of the actions disabled + assert.strictEqual(flameChartView.getMainFlameChart() + .getContextMenu() + ?.defaultSection() + .items.at(1) + ?.buildDescriptor() + .enabled, false); + assert.strictEqual(flameChartView.getMainFlameChart() + .getContextMenu() + ?.defaultSection() + .items.at(2) + ?.buildDescriptor() + .enabled, false); + assert.strictEqual(flameChartView.getMainFlameChart() + .getContextMenu() + ?.defaultSection() + .items.at(3) + ?.buildDescriptor() + .enabled, false); + assert.strictEqual(flameChartView.getMainFlameChart() + .getContextMenu() + ?.defaultSection() + .items.at(4) + ?.buildDescriptor() + .enabled, false); }); - it('When an entry has children, correctly show only Hide and Hide Children as possible Context Menu actions', async function () { + it('When an entry has children, correctly make only Hide Entry and Hide Children enabled in the Context Menu action', async function () { /** Part of this stack looks roughly like so (with some events omitted): * =============== foo =============== * =============== foo =============== @@ -259,12 +309,42 @@ describeWithEnvironment('TimelineFlameChartView', function () { flameChartView.getMainFlameChart().highlightEntry(iDOfNodeWithNoChildren); // The mouse event passed to the Context Menu is used to indicate where the menu should appear. Since we don't need it to actually appear for this test, pass an empty event. flameChartView.getMainFlameChart().onContextMenu(new Event('')); - assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 3); - assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(0)?.buildDescriptor().label, 'Hide function'); - assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(1)?.buildDescriptor().label, 'Hide children'); - assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(2)?.buildDescriptor().label, 'Reset trace'); + assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 5); + // Hide function enabled + assert.strictEqual(flameChartView.getMainFlameChart() + .getContextMenu() + ?.defaultSection() + .items.at(0) + ?.buildDescriptor() + .enabled, true); + // Hide children enabled + assert.strictEqual(flameChartView.getMainFlameChart() + .getContextMenu() + ?.defaultSection() + .items.at(1) + ?.buildDescriptor() + .enabled, true); + // Rest of the actions disabled + assert.strictEqual(flameChartView.getMainFlameChart() + .getContextMenu() + ?.defaultSection() + .items.at(2) + ?.buildDescriptor() + .enabled, false); + assert.strictEqual(flameChartView.getMainFlameChart() + .getContextMenu() + ?.defaultSection() + .items.at(3) + ?.buildDescriptor() + .enabled, false); + assert.strictEqual(flameChartView.getMainFlameChart() + .getContextMenu() + ?.defaultSection() + .items.at(4) + ?.buildDescriptor() + .enabled, false); }); - it('When an entry has repeating children, correctly show only Hide, Hide Children and Hide repeating children as possible Context Menu actions', async function () { + it('When an entry has repeating children, correctly make only Hide Entry, Hide Children and Hide repeating children enabled in the Context Menu action', async function () { /** Part of this stack looks roughly like so (with some events omitted): * =============== foo =============== * =============== foo =============== @@ -287,13 +367,43 @@ describeWithEnvironment('TimelineFlameChartView', function () { flameChartView.getMainFlameChart().highlightEntry(iDOfNodeWithNoChildren); // The mouse event passed to the Context Menu is used to indicate where the menu should appear. Since we don't need it to actually appear for this test, pass an empty event. flameChartView.getMainFlameChart().onContextMenu(new Event('')); - assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 4); - assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(0)?.buildDescriptor().label, 'Hide function'); - assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(1)?.buildDescriptor().label, 'Hide children'); - assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(2)?.buildDescriptor().label, 'Hide repeating children'); - assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(3)?.buildDescriptor().label, 'Reset trace'); + assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 5); + // Hide function enabled + assert.strictEqual(flameChartView.getMainFlameChart() + .getContextMenu() + ?.defaultSection() + .items.at(0) + ?.buildDescriptor() + .enabled, true); + // Hide children enabled + assert.strictEqual(flameChartView.getMainFlameChart() + .getContextMenu() + ?.defaultSection() + .items.at(1) + ?.buildDescriptor() + .enabled, true); + // Hide repeating children enabled + assert.strictEqual(flameChartView.getMainFlameChart() + .getContextMenu() + ?.defaultSection() + .items.at(2) + ?.buildDescriptor() + .enabled, true); + // Rest of the actions disabled + assert.strictEqual(flameChartView.getMainFlameChart() + .getContextMenu() + ?.defaultSection() + .items.at(3) + ?.buildDescriptor() + .enabled, false); + assert.strictEqual(flameChartView.getMainFlameChart() + .getContextMenu() + ?.defaultSection() + .items.at(4) + ?.buildDescriptor() + .enabled, false); }); - it('When an entry does not have a parent and has children, correctly show only Hide Children as a possible Context Menu action', async function () { + it('When an entry has no parent and has children, correctly make only Hide Children enabled in the Context Menu action', async function () { /** Part of this stack looks roughly like so (with some events omitted): * =============== Task ============== <-- ID=62 * =============== foo =============== @@ -317,9 +427,39 @@ describeWithEnvironment('TimelineFlameChartView', function () { flameChartView.getMainFlameChart().highlightEntry(iDOfNodeWithNoChildren); // The mouse event passed to the Context Menu is used to indicate where the menu should appear. Since we don't need it to actually appear for this test, pass an empty event. flameChartView.getMainFlameChart().onContextMenu(new Event('')); - assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 2); - assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(0)?.buildDescriptor().label, 'Hide children'); - assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(1)?.buildDescriptor().label, 'Reset trace'); + // Hide function disabled + assert.strictEqual(flameChartView.getMainFlameChart() + .getContextMenu() + ?.defaultSection() + .items.at(0) + ?.buildDescriptor() + .enabled, false); + // Hide children enabled + assert.strictEqual(flameChartView.getMainFlameChart() + .getContextMenu() + ?.defaultSection() + .items.at(1) + ?.buildDescriptor() + .enabled, true); + // Rest of the actions disabled + assert.strictEqual(flameChartView.getMainFlameChart() + .getContextMenu() + ?.defaultSection() + .items.at(2) + ?.buildDescriptor() + .enabled, false); + assert.strictEqual(flameChartView.getMainFlameChart() + .getContextMenu() + ?.defaultSection() + .items.at(3) + ?.buildDescriptor() + .enabled, false); + assert.strictEqual(flameChartView.getMainFlameChart() + .getContextMenu() + ?.defaultSection() + .items.at(4) + ?.buildDescriptor() + .enabled, false); }); it('Reset Trace Context Menu action is disabled before some action has been applied', async function () { /** Part of this stack looks roughly like so (with some events omitted): @@ -343,15 +483,15 @@ describeWithEnvironment('TimelineFlameChartView', function () { flameChartView.getMainFlameChart().highlightEntry(iDOfNode); // The mouse event passed to the Context Menu is used to indicate where the menu should appear. Since we don't need it to actually appear for this test, pass an empty event. flameChartView.getMainFlameChart().onContextMenu(new Event('')); - assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 2); - assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(1)?.buildDescriptor().label, 'Reset trace'); + assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 5); + assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(4)?.buildDescriptor().label, 'Reset trace'); // Check that Reset Trace is disabled - assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(1)?.buildDescriptor().enabled, false); + assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(4)?.buildDescriptor().enabled, false); flameChartView.getMainFlameChart().modifyTree("MERGE_FUNCTION" /* TraceEngine.EntriesFilter.FilterAction.MERGE_FUNCTION */, iDOfNode); flameChartView.getMainFlameChart().highlightEntry(iDOfNode); flameChartView.getMainFlameChart().onContextMenu(new Event('')); // Check that Reset Trace is enabled - assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(1)?.buildDescriptor().enabled, true); + assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(4)?.buildDescriptor().enabled, true); }); }); }); diff --git a/public/panels/timeline/TimelineFlameChartView.test.js.map b/public/panels/timeline/TimelineFlameChartView.test.js.map index 149b8368f..fea750028 100644 --- a/public/panels/timeline/TimelineFlameChartView.test.js.map +++ b/public/panels/timeline/TimelineFlameChartView.test.js.map @@ -1 +1 @@ -{"version":3,"file":"TimelineFlameChartView.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineFlameChartView.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAC,uBAAuB,EAAC,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,+CAA+C,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEhD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,MAAM,EAAC,MAAM,EAAC,GAAG,IAAI,CAAC;AAEtB,MAAM,gBAAgB;IACpB,SAAS,GAAsD,IAAI,CAAC;IACpE,MAAM,CAAC,SAA4D;QACjE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IACD,iBAAiB,CAAC,OAA4D,EAAE,KAAa;IAC7F,CAAC;IACD,cAAc,CAAC,MAAqC;IACpD,CAAC;CACF;AAED,uBAAuB,CAAC,wBAAwB,EAAE;IAChD,EAAE,CAAC,+CAA+C,EAAE,KAAK;QACvD,MAAM,EAAC,eAAe,EAAE,gBAAgB,EAAC,GAAG,MAAM,WAAW,CAAC,SAAS,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;QACpG,+DAA+D;QAC/D,gEAAgE;QAChE,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAC;QAEhD,MAAM,cAAc,GAAG,IAAI,QAAQ,CAAC,sBAAsB,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;QACpG,MAAM,cAAc,GAAG,IAAI,EAAE,CAAC,cAAc,CAAC,cAAc,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;QAClF,cAAc,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;QACjD,cAAc,CAAC,QA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,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YAC1G,MAAM,CAAC,WAAW,CACd,cAAc,CAAC,iBAAiB,EAAE,CAAC,cAAc,EAAE,EAAE,cAAc,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,KAAK,EAC1G,aAAa,CAAC,CAAC;YACnB,qCAAqC;YACrC,MAAM,CAAC,WAAW,CACd,cAAc,CAAC,iBAAiB,EAAE,CAAC,cAAc,EAAE,EAAE,cAAc,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,OAAO,EAC5G,KAAK,CAAC,CAAC;YAEX,cAAc,CAAC,iBAAiB,EAAE,CAAC,UAAU,+EAAwD,QAAQ,CAAC,CAAC;YAC/G,cAAc,CAAC,iBAAiB,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;YAC5D,cAAc,CAAC,iBAAiB,EAAE,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;YAEhE,oCAAoC;YACpC,MAAM,CAAC,WAAW,CACd,cAAc,CAAC,iBAAiB,EAAE,CAAC,cAAc,EAAE,EAAE,cAAc,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,OAAO,EAC5G,IAAI,CAAC,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as TraceEngine from '../../models/trace/trace.js';\nimport {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../testing/TraceLoader.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as UI from '../../ui/legacy/legacy.js';\n\nimport * as Timeline from './timeline.js';\n\nconst {assert} = chai;\n\nclass MockViewDelegate implements Timeline.TimelinePanel.TimelineModeViewDelegate {\n selection: Timeline.TimelineSelection.TimelineSelection|null = null;\n select(selection: Timeline.TimelineSelection.TimelineSelection|null): void {\n this.selection = selection;\n }\n selectEntryAtTime(_events: TraceEngine.Types.TraceEvents.TraceEventData[]|null, _time: number): void {\n }\n highlightEvent(_event: TraceEngine.Legacy.Event|null): void {\n }\n}\n\ndescribeWithEnvironment('TimelineFlameChartView', function() {\n it('Can search for events by name in the timeline', async function() {\n const {traceParsedData, performanceModel} = await TraceLoader.allModels(this, 'lcp-images.json.gz');\n // The timeline flamechart view will invoke the `select` method\n // of this delegate every time an event has matched on a search.\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n const searchableView = new UI.SearchableView.SearchableView(flameChartView, null);\n flameChartView.setSearchableView(searchableView);\n flameChartView.setModel(performanceModel, traceParsedData);\n\n const searchQuery = 'Paint';\n const searchConfig =\n new UI.SearchableView.SearchConfig(/* query */ searchQuery, /* caseSensitive */ false, /* isRegex */ false);\n flameChartView.performSearch(searchConfig, true);\n\n assert.strictEqual(flameChartView.getSearchResults()?.length, 17);\n assertSelectionName('PrePaint');\n\n flameChartView.jumpToNextSearchResult();\n assertSelectionName('Paint');\n\n flameChartView.jumpToNextSearchResult();\n assertSelectionName('Paint');\n\n flameChartView.jumpToPreviousSearchResult();\n assertSelectionName('Paint');\n flameChartView.jumpToPreviousSearchResult();\n assertSelectionName('PrePaint');\n\n function assertSelectionName(name: string) {\n const selection = mockViewDelegate.selection;\n if (!selection || !Timeline.TimelineSelection.TimelineSelection.isTraceEventSelection(selection.object)) {\n throw new Error('Selection is not present or not a Trace Event');\n }\n const object = selection.object;\n assert.strictEqual(object.name, name);\n }\n });\n\n // This test is still failing after bumping up the timeout to 20 seconds. So\n // skip it while we work on a fix for the trace load speed.\n it.skip('[crbug.com/1492405] Shows the network track correctly', async function() {\n const {traceParsedData, performanceModel} = await TraceLoader.allModels(this, 'load-simple.json.gz');\n // The timeline flamechart view will invoke the `select` method\n // of this delegate every time an event has matched on a search.\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(performanceModel, traceParsedData);\n\n assert.isTrue(flameChartView.isNetworkTrackShownForTests());\n });\n\n it('Does not show the network track when there is no network request', async function() {\n const {traceParsedData, performanceModel} = await TraceLoader.allModels(this, 'basic.json.gz');\n // The timeline flamechart view will invoke the `select` method\n // of this delegate every time an event has matched on a search.\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(performanceModel, traceParsedData);\n\n assert.isFalse(flameChartView.isNetworkTrackShownForTests());\n });\n\n it('Adds Hidden Descendants Arrow as a decoration when a Context Menu action is applied on a node', async function() {\n const {traceParsedData, performanceModel} = await TraceLoader.allModels(this, 'load-simple.json.gz');\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(performanceModel, traceParsedData);\n TraceEngine.EntriesFilter.EntriesFilter.maybeInstance({entryToNodeMap: traceParsedData.Renderer.entryToNode});\n\n // Find the main track to later collapse entries of\n const mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => {\n return group.name === 'Main — http://localhost:8080/';\n });\n if (!mainTrack) {\n throw new Error('Could not find main track');\n }\n\n // Find the first node that has children to collapse and is visible in the timeline\n const nodeOfGroup = flameChartView.getMainDataProvider().groupTreeEvents(mainTrack);\n const firstNodeWithChildren = nodeOfGroup?.find(node => {\n const childrenAmount =\n traceParsedData.Renderer.entryToNode.get(node as TraceEngine.Types.TraceEvents.SyntheticTraceEntry)\n ?.children.length;\n if (!childrenAmount) {\n return false;\n }\n return childrenAmount > 0 && node.cat === 'devtools.timeline';\n });\n const node = traceParsedData.Renderer.entryToNode.get(\n firstNodeWithChildren as TraceEngine.Types.TraceEvents.SyntheticTraceEntry);\n if (!node) {\n throw new Error('Could not find a visible node with children');\n }\n\n // Apply COLLAPSE_FUNCTION action to the node. This action will hide all the children of the passed node and add HIDDEN_DESCENDANTS_ARROW decoration to it.\n flameChartView.getMainFlameChart().modifyTree(TraceEngine.EntriesFilter.FilterAction.COLLAPSE_FUNCTION, node?.id);\n\n const decorationsForEntry = flameChartView.getMainFlameChart().timelineData()?.entryDecorations[node?.id];\n assert.deepEqual(decorationsForEntry, [\n {\n type: PerfUI.FlameChart.FlameChartDecorationType.HIDDEN_DESCENDANTS_ARROW,\n },\n ]);\n });\n\n it('Adds Hidden Descendants Arrow as a decoration when a Context Menu action is applied on a selected node with a key shorcut event',\n async function() {\n const {traceParsedData, performanceModel} = await TraceLoader.allModels(this, 'load-simple.json.gz');\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(performanceModel, traceParsedData);\n TraceEngine.EntriesFilter.EntriesFilter.maybeInstance({entryToNodeMap: traceParsedData.Renderer.entryToNode});\n\n // Find the main track to later collapse entries of\n const mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => {\n return group.name === 'Main — http://localhost:8080/';\n });\n if (!mainTrack) {\n throw new Error('Could not find main track');\n }\n\n // Find the first node that has children to collapse and is visible in the timeline\n const nodeOfGroup = flameChartView.getMainDataProvider().groupTreeEvents(mainTrack);\n const firstNodeWithChildren = nodeOfGroup?.find(node => {\n const childrenAmount =\n traceParsedData.Renderer.entryToNode.get(node as TraceEngine.Types.TraceEvents.SyntheticTraceEntry)\n ?.children.length;\n if (!childrenAmount) {\n return false;\n }\n return childrenAmount > 0 && node.cat === 'devtools.timeline';\n });\n const node = traceParsedData.Renderer.entryToNode.get(\n firstNodeWithChildren as TraceEngine.Types.TraceEvents.SyntheticTraceEntry);\n if (!node) {\n throw new Error('Could not find a visible node with children');\n }\n\n flameChartView.getMainFlameChart().setSelectedEntry(node?.id);\n\n // Dispatch a shortcut keydown event that applies 'Hide Children' Context menu action\n const event = new KeyboardEvent('keydown', {code: 'KeyC'});\n flameChartView.getMainFlameChart().getCanvas().dispatchEvent(event);\n\n const decorationsForEntry = flameChartView.getMainFlameChart().timelineData()?.entryDecorations[node?.id];\n assert.deepEqual(decorationsForEntry, [\n {\n type: PerfUI.FlameChart.FlameChartDecorationType.HIDDEN_DESCENDANTS_ARROW,\n },\n ]);\n });\n\n it('Removes Hidden Descendants Arrow as a decoration when Reset Children action is applied on a node',\n async function() {\n const {traceParsedData, performanceModel} = await TraceLoader.allModels(this, 'load-simple.json.gz');\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(performanceModel, traceParsedData);\n TraceEngine.EntriesFilter.EntriesFilter.maybeInstance({entryToNodeMap: traceParsedData.Renderer.entryToNode});\n\n // Find the main track to later collapse entries of\n let mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => {\n return group.name === 'Main — http://localhost:8080/';\n });\n if (!mainTrack) {\n throw new Error('Could not find main track');\n }\n\n // Find the first node that has children to collapse and is visible in the timeline\n const nodeOfGroup = flameChartView.getMainDataProvider().groupTreeEvents(mainTrack);\n const firstNodeWithChildren = nodeOfGroup?.find(node => {\n const childrenAmount =\n traceParsedData.Renderer.entryToNode.get(node as TraceEngine.Types.TraceEvents.SyntheticTraceEntry)\n ?.children.length;\n if (!childrenAmount) {\n return false;\n }\n return childrenAmount > 0 && node.cat === 'devtools.timeline';\n });\n const node = traceParsedData.Renderer.entryToNode.get(\n firstNodeWithChildren as TraceEngine.Types.TraceEvents.SyntheticTraceEntry);\n if (!node) {\n throw new Error('Could not find a visible node with children');\n }\n\n // Apply COLLAPSE_FUNCTION Context Menu action to the node.\n // This action will hide all the children of the passed node and add HIDDEN_DESCENDANTS_ARROW decoration to it.\n flameChartView.getMainFlameChart().modifyTree(\n TraceEngine.EntriesFilter.FilterAction.COLLAPSE_FUNCTION, node?.id);\n\n let decorationsForEntry = flameChartView.getMainFlameChart().timelineData()?.entryDecorations[node?.id];\n assert.deepEqual(decorationsForEntry, [\n {\n type: PerfUI.FlameChart.FlameChartDecorationType.HIDDEN_DESCENDANTS_ARROW,\n },\n ]);\n\n mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => {\n return group.name === 'Main — http://localhost:8080/';\n });\n if (!mainTrack) {\n throw new Error('Could not find main track');\n }\n // Apply a RESET_CHILDREN action that will reveal all of the hidden children of the passed node and remove HIDDEN_DESCENDANTS_ARROW decoration from it.\n flameChartView.getMainFlameChart().modifyTree(TraceEngine.EntriesFilter.FilterAction.RESET_CHILDREN, node?.id);\n\n // No decorations should exist on the node\n decorationsForEntry = flameChartView.getMainFlameChart().timelineData()?.entryDecorations[node?.id];\n assert.isUndefined(decorationsForEntry);\n });\n\n describe('Context Menu Actions', function() {\n let flameChartView: Timeline.TimelineFlameChartView.TimelineFlameChartView;\n\n this.beforeEach(async () => {\n const {traceParsedData, performanceModel} = await TraceLoader.allModels(this, 'recursive-blocking-js.json.gz');\n const mockViewDelegate = new MockViewDelegate();\n\n flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(performanceModel, traceParsedData);\n TraceEngine.EntriesFilter.EntriesFilter.maybeInstance({entryToNodeMap: traceParsedData.Renderer.entryToNode});\n\n // Find the Main track to later collapse entries of\n const mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => {\n return group.name === 'Main — http://127.0.0.1:8080/';\n });\n if (!mainTrack) {\n throw new Error('Could not find main track');\n }\n });\n\n it('When an entry has no children, correctly show only Hide as a possible Context Menu action', async function() {\n /** Part of this stack looks roughly like so (with some events omitted):\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * == now == == updateCounters == <-- ID=245\n *\n * In this test we want to test that the Context Menu option available\n * for an entry with no children and a parent is to hide given entry only.\n * Since there are no children to hide, we don't want to show 'hide children' option.\n *\n * To chieve that, we will dispatch the context menu on the 'updateCounters' function that does not have children.\n * The ID of 'updateCounters' is 245.\n **/\n\n const iDOfNodeWithNoChildren = 245;\n // Highlight the node to make the Context Menu dispatch on this node\n flameChartView.getMainFlameChart().highlightEntry(iDOfNodeWithNoChildren);\n\n // The mouse event passed to the Context Menu is used to indicate where the menu should appear. Since we don't need it to actually appear for this test, pass an empty event.\n flameChartView.getMainFlameChart().onContextMenu(new Event(''));\n\n assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 2);\n assert.strictEqual(\n flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(0)?.buildDescriptor().label,\n 'Hide function');\n assert.strictEqual(\n flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(1)?.buildDescriptor().label,\n 'Reset trace');\n });\n\n it('When an entry has children, correctly show only Hide and Hide Children as possible Context Menu actions',\n async function() {\n /** Part of this stack looks roughly like so (with some events omitted):\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * ===== wait ===== ===== wait ===== <-- ID=204\n * = now = = now = = now = = now =\n *\n * In this test we want to test that the Context Menu option available\n * for an entry with children and a parent is to hide given entry, and hide children only.\n * Since there are no repeating children to hide, we don't want to show 'hide repeating children' option.\n *\n * To chieve that, we will dispatch the context menu on the 'wait' function that has only non-repeating children.\n * The ID of the first 'wait' is 204.\n **/\n\n const iDOfNodeWithNoChildren = 204;\n // Highlight the node to make the Context Menu dispatch on this node\n flameChartView.getMainFlameChart().highlightEntry(iDOfNodeWithNoChildren);\n\n // The mouse event passed to the Context Menu is used to indicate where the menu should appear. Since we don't need it to actually appear for this test, pass an empty event.\n flameChartView.getMainFlameChart().onContextMenu(new Event(''));\n\n assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 3);\n assert.strictEqual(\n flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(0)?.buildDescriptor().label,\n 'Hide function');\n assert.strictEqual(\n flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(1)?.buildDescriptor().label,\n 'Hide children');\n assert.strictEqual(\n flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(2)?.buildDescriptor().label,\n 'Reset trace');\n });\n\n it('When an entry has repeating children, correctly show only Hide, Hide Children and Hide repeating children as possible Context Menu actions',\n async function() {\n /** Part of this stack looks roughly like so (with some events omitted):\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo =============== <-- ID=200\n * =============== foo ===============\n * =============== foo ===============\n * ===== wait ===== ===== wait =====\n * = now = = now = = now = = now =\n *\n * In this test we want to test that the Context Menu option available\n * for an entry with children repeating children and a parent is to hide given entry, hide children and hide repeating children.\n *\n * To chieve that, we will dispatch the context menu on the 'foo' function that has child 'foo' calls.\n * The ID of the a matching 'foo' is 200.\n **/\n\n const iDOfNodeWithNoChildren = 200;\n // Highlight the node to make the Context Menu dispatch on this node\n flameChartView.getMainFlameChart().highlightEntry(iDOfNodeWithNoChildren);\n\n // The mouse event passed to the Context Menu is used to indicate where the menu should appear. Since we don't need it to actually appear for this test, pass an empty event.\n flameChartView.getMainFlameChart().onContextMenu(new Event(''));\n\n assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 4);\n assert.strictEqual(\n flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(0)?.buildDescriptor().label,\n 'Hide function');\n assert.strictEqual(\n flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(1)?.buildDescriptor().label,\n 'Hide children');\n assert.strictEqual(\n flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(2)?.buildDescriptor().label,\n 'Hide repeating children');\n assert.strictEqual(\n flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(3)?.buildDescriptor().label,\n 'Reset trace');\n });\n\n it('When an entry does not have a parent and has children, correctly show only Hide Children as a possible Context Menu action',\n async function() {\n /** Part of this stack looks roughly like so (with some events omitted):\n * =============== Task ============== <-- ID=62\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * ===== wait ===== ===== wait =====\n * = now = = now = = now = = now =\n *\n * In this test we want to test that the Context Menu option available for an entry with no parent is only to hide children.\n * If an entry has no parent, we don't want to show an option to hide the entry since when an entry is hidden,\n * it is indicated by adding a decoration to the parent and if there is no parent, there is no way to show it is hidden.\n *\n * To chieve that, we will dispatch the context menu on the 'Task' function that is on the top of the stack and has no parent.\n * The ID of the a matching 'Task' is 62.\n **/\n\n const iDOfNodeWithNoChildren = 62;\n // Highlight the node to make the Context Menu dispatch on this node\n flameChartView.getMainFlameChart().highlightEntry(iDOfNodeWithNoChildren);\n\n // The mouse event passed to the Context Menu is used to indicate where the menu should appear. Since we don't need it to actually appear for this test, pass an empty event.\n flameChartView.getMainFlameChart().onContextMenu(new Event(''));\n\n assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 2);\n assert.strictEqual(\n flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(0)?.buildDescriptor().label,\n 'Hide children');\n assert.strictEqual(\n flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(1)?.buildDescriptor().label,\n 'Reset trace');\n });\n\n it('Reset Trace Context Menu action is disabled before some action has been applied', async function() {\n /** Part of this stack looks roughly like so (with some events omitted):\n * =============== Task ============== <-- ID=62\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * ===== wait ===== ===== wait =====\n * = now = = now = = now = = now =\n *\n * In this test we want to test that the Reset Trace Context Menu option is disabled by default and enabled after some action has been applied.\n *\n * To chieve that, we will first check if Reset Trace is disabled and then dispatch a Context Menu action on \"Task\" entry and then check if Reset Trace is enabled.\n * The ID of the a matching 'Task' is 62.\n **/\n\n const iDOfNode = 62;\n // Highlight the node to make the Context Menu dispatch on this node\n flameChartView.getMainFlameChart().highlightEntry(iDOfNode);\n\n // The mouse event passed to the Context Menu is used to indicate where the menu should appear. Since we don't need it to actually appear for this test, pass an empty event.\n flameChartView.getMainFlameChart().onContextMenu(new Event(''));\n\n assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 2);\n assert.strictEqual(\n flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(1)?.buildDescriptor().label,\n 'Reset trace');\n // Check that Reset Trace is disabled\n assert.strictEqual(\n flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(1)?.buildDescriptor().enabled,\n false);\n\n flameChartView.getMainFlameChart().modifyTree(TraceEngine.EntriesFilter.FilterAction.MERGE_FUNCTION, iDOfNode);\n flameChartView.getMainFlameChart().highlightEntry(iDOfNode);\n flameChartView.getMainFlameChart().onContextMenu(new Event(''));\n\n // Check that Reset Trace is enabled\n assert.strictEqual(\n flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(1)?.buildDescriptor().enabled,\n true);\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"TimelineFlameChartView.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineFlameChartView.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,kBAAkB,MAAM,2DAA2D,CAAC;AAChG,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAC3E,OAAO,EAAC,uBAAuB,EAAC,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA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AiB,EAAE,CAAC,cAAc,EAAE,EAAE,cAAc,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YAC1G,MAAM,CAAC,WAAW,CACd,cAAc,CAAC,iBAAiB,EAAE,CAAC,cAAc,EAAE,EAAE,cAAc,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,KAAK,EAC1G,aAAa,CAAC,CAAC;YACnB,qCAAqC;YACrC,MAAM,CAAC,WAAW,CACd,cAAc,CAAC,iBAAiB,EAAE,CAAC,cAAc,EAAE,EAAE,cAAc,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,OAAO,EAC5G,KAAK,CAAC,CAAC;YAEX,cAAc,CAAC,iBAAiB,EAAE,CAAC,UAAU,+EAAwD,QAAQ,CAAC,CAAC;YAC/G,cAAc,CAAC,iBAAiB,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;YAC5D,cAAc,CAAC,iBAAiB,EAAE,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;YAEhE,oCAAoC;YACpC,MAAM,CAAC,WAAW,CACd,cAAc,CAAC,iBAAiB,EAAE,CAAC,cAAc,EAAE,EAAE,cAAc,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,OAAO,EAC5G,IAAI,CAAC,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as TraceEngine from '../../models/trace/trace.js';\nimport * as AnnotationsManager from '../../services/annotations_manager/annotations_manager.js';\nimport * as TraceBounds from '../../services/trace_bounds/trace_bounds.js';\nimport {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../testing/TraceLoader.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as UI from '../../ui/legacy/legacy.js';\n\nimport * as Timeline from './timeline.js';\n\nconst {assert} = chai;\n\nclass MockViewDelegate implements Timeline.TimelinePanel.TimelineModeViewDelegate {\n selection: Timeline.TimelineSelection.TimelineSelection|null = null;\n select(selection: Timeline.TimelineSelection.TimelineSelection|null): void {\n this.selection = selection;\n }\n selectEntryAtTime(_events: TraceEngine.Types.TraceEvents.TraceEventData[]|null, _time: number): void {\n }\n highlightEvent(_event: TraceEngine.Legacy.Event|null): void {\n }\n}\n\nconst baseTraceWindow: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(0),\n max: TraceEngine.Types.Timing.MicroSeconds(10_000),\n range: TraceEngine.Types.Timing.MicroSeconds(10_000),\n};\nconst boundsManager =\n TraceBounds.TraceBounds.BoundsManager.instance({forceNew: true}).resetWithNewBounds(baseTraceWindow);\n\ndescribeWithEnvironment('TimelineFlameChartView', function() {\n it('Can search for events by name in the timeline', async function() {\n const {traceParsedData, performanceModel} = await TraceLoader.allModels(this, 'lcp-images.json.gz');\n // The timeline flamechart view will invoke the `select` method\n // of this delegate every time an event has matched on a search.\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n const searchableView = new UI.SearchableView.SearchableView(flameChartView, null);\n flameChartView.setSearchableView(searchableView);\n flameChartView.setModel(performanceModel, traceParsedData);\n\n const searchQuery = 'Paint';\n const searchConfig =\n new UI.SearchableView.SearchConfig(/* query */ searchQuery, /* caseSensitive */ false, /* isRegex */ false);\n flameChartView.performSearch(searchConfig, true);\n\n assert.strictEqual(flameChartView.getSearchResults()?.length, 17);\n assertSelectionName('PrePaint');\n\n flameChartView.jumpToNextSearchResult();\n assertSelectionName('Paint');\n\n flameChartView.jumpToNextSearchResult();\n assertSelectionName('Paint');\n\n flameChartView.jumpToPreviousSearchResult();\n assertSelectionName('Paint');\n flameChartView.jumpToPreviousSearchResult();\n assertSelectionName('PrePaint');\n\n function assertSelectionName(name: string) {\n const selection = mockViewDelegate.selection;\n if (!selection || !Timeline.TimelineSelection.TimelineSelection.isTraceEventSelection(selection.object)) {\n throw new Error('Selection is not present or not a Trace Event');\n }\n const object = selection.object;\n assert.strictEqual(object.name, name);\n }\n });\n\n // This test is still failing after bumping up the timeout to 20 seconds. So\n // skip it while we work on a fix for the trace load speed.\n it.skip('[crbug.com/1492405] Shows the network track correctly', async function() {\n const {traceParsedData, performanceModel} = await TraceLoader.allModels(this, 'load-simple.json.gz');\n // The timeline flamechart view will invoke the `select` method\n // of this delegate every time an event has matched on a search.\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(performanceModel, traceParsedData);\n\n assert.isTrue(flameChartView.isNetworkTrackShownForTests());\n });\n\n it('Does not show the network track when there is no network request', async function() {\n const {traceParsedData, performanceModel} = await TraceLoader.allModels(this, 'basic.json.gz');\n // The timeline flamechart view will invoke the `select` method\n // of this delegate every time an event has matched on a search.\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(performanceModel, traceParsedData);\n\n assert.isFalse(flameChartView.isNetworkTrackShownForTests());\n });\n\n it('Adds Hidden Descendants Arrow as a decoration when a Context Menu action is applied on a node', async function() {\n const {traceParsedData, performanceModel} = await TraceLoader.allModels(this, 'load-simple.json.gz');\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(performanceModel, traceParsedData);\n AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance({\n entryToNodeMap: traceParsedData.Renderer.entryToNode,\n wholeTraceBounds: boundsManager.state()?.micro.entireTraceBounds,\n });\n\n // Find the main track to later collapse entries of\n const mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => {\n return group.name === 'Main — http://localhost:8080/';\n });\n if (!mainTrack) {\n throw new Error('Could not find main track');\n }\n\n // Find the first node that has children to collapse and is visible in the timeline\n const nodeOfGroup = flameChartView.getMainDataProvider().groupTreeEvents(mainTrack);\n const firstNodeWithChildren = nodeOfGroup?.find(node => {\n const childrenAmount =\n traceParsedData.Renderer.entryToNode.get(node as TraceEngine.Types.TraceEvents.SyntheticTraceEntry)\n ?.children.length;\n if (!childrenAmount) {\n return false;\n }\n return childrenAmount > 0 && node.cat === 'devtools.timeline';\n });\n const node = traceParsedData.Renderer.entryToNode.get(\n firstNodeWithChildren as TraceEngine.Types.TraceEvents.SyntheticTraceEntry);\n if (!node) {\n throw new Error('Could not find a visible node with children');\n }\n\n // Apply COLLAPSE_FUNCTION action to the node. This action will hide all the children of the passed node and add HIDDEN_DESCENDANTS_ARROW decoration to it.\n flameChartView.getMainFlameChart().modifyTree(TraceEngine.EntriesFilter.FilterAction.COLLAPSE_FUNCTION, node?.id);\n\n const decorationsForEntry = flameChartView.getMainFlameChart().timelineData()?.entryDecorations[node?.id];\n assert.deepEqual(decorationsForEntry, [\n {\n type: PerfUI.FlameChart.FlameChartDecorationType.HIDDEN_DESCENDANTS_ARROW,\n },\n ]);\n });\n\n it('Adds Hidden Descendants Arrow as a decoration when a Context Menu action is applied on a selected node with a key shorcut event',\n async function() {\n const {traceParsedData, performanceModel} = await TraceLoader.allModels(this, 'load-simple.json.gz');\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(performanceModel, traceParsedData);\n AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance({\n entryToNodeMap: traceParsedData.Renderer.entryToNode,\n wholeTraceBounds: boundsManager.state()?.micro.entireTraceBounds,\n });\n\n // Find the main track to later collapse entries of\n const mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => {\n return group.name === 'Main — http://localhost:8080/';\n });\n if (!mainTrack) {\n throw new Error('Could not find main track');\n }\n\n // Find the first node that has children to collapse and is visible in the timeline\n const nodeOfGroup = flameChartView.getMainDataProvider().groupTreeEvents(mainTrack);\n const firstNodeWithChildren = nodeOfGroup?.find(node => {\n const childrenAmount =\n traceParsedData.Renderer.entryToNode.get(node as TraceEngine.Types.TraceEvents.SyntheticTraceEntry)\n ?.children.length;\n if (!childrenAmount) {\n return false;\n }\n return childrenAmount > 0 && node.cat === 'devtools.timeline';\n });\n const node = traceParsedData.Renderer.entryToNode.get(\n firstNodeWithChildren as TraceEngine.Types.TraceEvents.SyntheticTraceEntry);\n if (!node) {\n throw new Error('Could not find a visible node with children');\n }\n\n flameChartView.getMainFlameChart().setSelectedEntry(node?.id);\n\n // Dispatch a shortcut keydown event that applies 'Hide Children' Context menu action\n const event = new KeyboardEvent('keydown', {code: 'KeyC'});\n flameChartView.getMainFlameChart().getCanvas().dispatchEvent(event);\n\n const decorationsForEntry = flameChartView.getMainFlameChart().timelineData()?.entryDecorations[node?.id];\n assert.deepEqual(decorationsForEntry, [\n {\n type: PerfUI.FlameChart.FlameChartDecorationType.HIDDEN_DESCENDANTS_ARROW,\n },\n ]);\n });\n\n it('Removes Hidden Descendants Arrow as a decoration when Reset Children action is applied on a node',\n async function() {\n const {traceParsedData, performanceModel} = await TraceLoader.allModels(this, 'load-simple.json.gz');\n const mockViewDelegate = new MockViewDelegate();\n\n const flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(performanceModel, traceParsedData);\n AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance({\n entryToNodeMap: traceParsedData.Renderer.entryToNode,\n wholeTraceBounds: boundsManager.state()?.micro.entireTraceBounds,\n });\n\n // Find the main track to later collapse entries of\n let mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => {\n return group.name === 'Main — http://localhost:8080/';\n });\n if (!mainTrack) {\n throw new Error('Could not find main track');\n }\n\n // Find the first node that has children to collapse and is visible in the timeline\n const nodeOfGroup = flameChartView.getMainDataProvider().groupTreeEvents(mainTrack);\n const firstNodeWithChildren = nodeOfGroup?.find(node => {\n const childrenAmount =\n traceParsedData.Renderer.entryToNode.get(node as TraceEngine.Types.TraceEvents.SyntheticTraceEntry)\n ?.children.length;\n if (!childrenAmount) {\n return false;\n }\n return childrenAmount > 0 && node.cat === 'devtools.timeline';\n });\n const node = traceParsedData.Renderer.entryToNode.get(\n firstNodeWithChildren as TraceEngine.Types.TraceEvents.SyntheticTraceEntry);\n if (!node) {\n throw new Error('Could not find a visible node with children');\n }\n\n // Apply COLLAPSE_FUNCTION Context Menu action to the node.\n // This action will hide all the children of the passed node and add HIDDEN_DESCENDANTS_ARROW decoration to it.\n flameChartView.getMainFlameChart().modifyTree(\n TraceEngine.EntriesFilter.FilterAction.COLLAPSE_FUNCTION, node?.id);\n\n let decorationsForEntry = flameChartView.getMainFlameChart().timelineData()?.entryDecorations[node?.id];\n assert.deepEqual(decorationsForEntry, [\n {\n type: PerfUI.FlameChart.FlameChartDecorationType.HIDDEN_DESCENDANTS_ARROW,\n },\n ]);\n\n mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => {\n return group.name === 'Main — http://localhost:8080/';\n });\n if (!mainTrack) {\n throw new Error('Could not find main track');\n }\n // Apply a RESET_CHILDREN action that will reveal all of the hidden children of the passed node and remove HIDDEN_DESCENDANTS_ARROW decoration from it.\n flameChartView.getMainFlameChart().modifyTree(TraceEngine.EntriesFilter.FilterAction.RESET_CHILDREN, node?.id);\n\n // No decorations should exist on the node\n decorationsForEntry = flameChartView.getMainFlameChart().timelineData()?.entryDecorations[node?.id];\n assert.isUndefined(decorationsForEntry);\n });\n\n describe('Context Menu Actions', function() {\n let flameChartView: Timeline.TimelineFlameChartView.TimelineFlameChartView;\n\n this.beforeEach(async () => {\n const {traceParsedData, performanceModel} = await TraceLoader.allModels(this, 'recursive-blocking-js.json.gz');\n const mockViewDelegate = new MockViewDelegate();\n\n flameChartView = new Timeline.TimelineFlameChartView.TimelineFlameChartView(mockViewDelegate);\n flameChartView.setModel(performanceModel, traceParsedData);\n AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance({\n entryToNodeMap: traceParsedData.Renderer.entryToNode,\n wholeTraceBounds: boundsManager.state()?.micro.entireTraceBounds,\n });\n\n // Find the Main track to later collapse entries of\n const mainTrack = flameChartView.getMainFlameChart().timelineData()?.groups.find(group => {\n return group.name === 'Main — http://127.0.0.1:8080/';\n });\n if (!mainTrack) {\n throw new Error('Could not find main track');\n }\n });\n\n it('When an entry has no children, correctly make only Hide Entry enabled in the Context Menu action',\n async function() {\n /** Part of this stack looks roughly like so (with some events omitted):\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * == now == == updateCounters == <-- ID=245\n *\n * In this test we want to test that the Context Menu option available\n * for an entry with no children and a parent is to hide given entry only.\n * Since there are no children to hide, we don't want to show 'hide children' option.\n *\n * To chieve that, we will dispatch the context menu on the 'updateCounters' function that does not have children.\n * The ID of 'updateCounters' is 245.\n **/\n\n const iDOfNodeWithNoChildren = 245;\n // Highlight the node to make the Context Menu dispatch on this node\n flameChartView.getMainFlameChart().highlightEntry(iDOfNodeWithNoChildren);\n\n // The mouse event passed to the Context Menu is used to indicate where the menu should appear. Since we don't need it to actually appear for this test, pass an empty event.\n flameChartView.getMainFlameChart().onContextMenu(new Event(''));\n\n assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 5);\n // Hide function enabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(0)\n ?.buildDescriptor()\n .enabled,\n true);\n // Rest of the actions disabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(1)\n ?.buildDescriptor()\n .enabled,\n false);\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(2)\n ?.buildDescriptor()\n .enabled,\n false);\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(3)\n ?.buildDescriptor()\n .enabled,\n false);\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(4)\n ?.buildDescriptor()\n .enabled,\n false);\n });\n\n it('When an entry has children, correctly make only Hide Entry and Hide Children enabled in the Context Menu action',\n async function() {\n /** Part of this stack looks roughly like so (with some events omitted):\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * ===== wait ===== ===== wait ===== <-- ID=204\n * = now = = now = = now = = now =\n *\n * In this test we want to test that the Context Menu option available\n * for an entry with children and a parent is to hide given entry, and hide children only.\n * Since there are no repeating children to hide, we don't want to show 'hide repeating children' option.\n *\n * To chieve that, we will dispatch the context menu on the 'wait' function that has only non-repeating children.\n * The ID of the first 'wait' is 204.\n **/\n\n const iDOfNodeWithNoChildren = 204;\n // Highlight the node to make the Context Menu dispatch on this node\n flameChartView.getMainFlameChart().highlightEntry(iDOfNodeWithNoChildren);\n\n // The mouse event passed to the Context Menu is used to indicate where the menu should appear. Since we don't need it to actually appear for this test, pass an empty event.\n flameChartView.getMainFlameChart().onContextMenu(new Event(''));\n\n assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 5);\n // Hide function enabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(0)\n ?.buildDescriptor()\n .enabled,\n true);\n // Hide children enabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(1)\n ?.buildDescriptor()\n .enabled,\n true);\n // Rest of the actions disabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(2)\n ?.buildDescriptor()\n .enabled,\n false);\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(3)\n ?.buildDescriptor()\n .enabled,\n false);\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(4)\n ?.buildDescriptor()\n .enabled,\n false);\n });\n\n it('When an entry has repeating children, correctly make only Hide Entry, Hide Children and Hide repeating children enabled in the Context Menu action',\n async function() {\n /** Part of this stack looks roughly like so (with some events omitted):\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo =============== <-- ID=200\n * =============== foo ===============\n * =============== foo ===============\n * ===== wait ===== ===== wait =====\n * = now = = now = = now = = now =\n *\n * In this test we want to test that the Context Menu option available\n * for an entry with children repeating children and a parent is to hide given entry, hide children and hide repeating children.\n *\n * To chieve that, we will dispatch the context menu on the 'foo' function that has child 'foo' calls.\n * The ID of the a matching 'foo' is 200.\n **/\n\n const iDOfNodeWithNoChildren = 200;\n // Highlight the node to make the Context Menu dispatch on this node\n flameChartView.getMainFlameChart().highlightEntry(iDOfNodeWithNoChildren);\n\n // The mouse event passed to the Context Menu is used to indicate where the menu should appear. Since we don't need it to actually appear for this test, pass an empty event.\n flameChartView.getMainFlameChart().onContextMenu(new Event(''));\n\n assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 5);\n // Hide function enabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(0)\n ?.buildDescriptor()\n .enabled,\n true);\n // Hide children enabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(1)\n ?.buildDescriptor()\n .enabled,\n true);\n // Hide repeating children enabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(2)\n ?.buildDescriptor()\n .enabled,\n true);\n // Rest of the actions disabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(3)\n ?.buildDescriptor()\n .enabled,\n false);\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(4)\n ?.buildDescriptor()\n .enabled,\n false);\n });\n\n it('When an entry has no parent and has children, correctly make only Hide Children enabled in the Context Menu action',\n async function() {\n /** Part of this stack looks roughly like so (with some events omitted):\n * =============== Task ============== <-- ID=62\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * ===== wait ===== ===== wait =====\n * = now = = now = = now = = now =\n *\n * In this test we want to test that the Context Menu option available for an entry with no parent is only to hide children.\n * If an entry has no parent, we don't want to show an option to hide the entry since when an entry is hidden,\n * it is indicated by adding a decoration to the parent and if there is no parent, there is no way to show it is hidden.\n *\n * To chieve that, we will dispatch the context menu on the 'Task' function that is on the top of the stack and has no parent.\n * The ID of the a matching 'Task' is 62.\n **/\n\n const iDOfNodeWithNoChildren = 62;\n // Highlight the node to make the Context Menu dispatch on this node\n flameChartView.getMainFlameChart().highlightEntry(iDOfNodeWithNoChildren);\n\n // The mouse event passed to the Context Menu is used to indicate where the menu should appear. Since we don't need it to actually appear for this test, pass an empty event.\n flameChartView.getMainFlameChart().onContextMenu(new Event(''));\n\n // Hide function disabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(0)\n ?.buildDescriptor()\n .enabled,\n false);\n // Hide children enabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(1)\n ?.buildDescriptor()\n .enabled,\n true);\n // Rest of the actions disabled\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(2)\n ?.buildDescriptor()\n .enabled,\n false);\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(3)\n ?.buildDescriptor()\n .enabled,\n false);\n assert.strictEqual(\n flameChartView.getMainFlameChart()\n .getContextMenu()\n ?.defaultSection()\n .items.at(4)\n ?.buildDescriptor()\n .enabled,\n false);\n });\n\n it('Reset Trace Context Menu action is disabled before some action has been applied', async function() {\n /** Part of this stack looks roughly like so (with some events omitted):\n * =============== Task ============== <-- ID=62\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * =============== foo ===============\n * ===== wait ===== ===== wait =====\n * = now = = now = = now = = now =\n *\n * In this test we want to test that the Reset Trace Context Menu option is disabled by default and enabled after some action has been applied.\n *\n * To chieve that, we will first check if Reset Trace is disabled and then dispatch a Context Menu action on \"Task\" entry and then check if Reset Trace is enabled.\n * The ID of the a matching 'Task' is 62.\n **/\n\n const iDOfNode = 62;\n // Highlight the node to make the Context Menu dispatch on this node\n flameChartView.getMainFlameChart().highlightEntry(iDOfNode);\n\n // The mouse event passed to the Context Menu is used to indicate where the menu should appear. Since we don't need it to actually appear for this test, pass an empty event.\n flameChartView.getMainFlameChart().onContextMenu(new Event(''));\n\n assert.strictEqual(flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.length, 5);\n assert.strictEqual(\n flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(4)?.buildDescriptor().label,\n 'Reset trace');\n // Check that Reset Trace is disabled\n assert.strictEqual(\n flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(4)?.buildDescriptor().enabled,\n false);\n\n flameChartView.getMainFlameChart().modifyTree(TraceEngine.EntriesFilter.FilterAction.MERGE_FUNCTION, iDOfNode);\n flameChartView.getMainFlameChart().highlightEntry(iDOfNode);\n flameChartView.getMainFlameChart().onContextMenu(new Event(''));\n\n // Check that Reset Trace is enabled\n assert.strictEqual(\n flameChartView.getMainFlameChart().getContextMenu()?.defaultSection().items.at(4)?.buildDescriptor().enabled,\n true);\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/TimelineMiniMap.js b/public/panels/timeline/TimelineMiniMap.js index 0b4b4220c..50eddbfff 100644 --- a/public/panels/timeline/TimelineMiniMap.js +++ b/public/panels/timeline/TimelineMiniMap.js @@ -3,6 +3,7 @@ // found in the LICENSE file. import * as Common from '../../core/common/common.js'; import * as TraceEngine from '../../models/trace/trace.js'; +import * as AnnotationsManager from '../../services/annotations_manager/annotations_manager.js'; import * as TraceBounds from '../../services/trace_bounds/trace_bounds.js'; import * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js'; import * as UI from '../../ui/legacy/legacy.js'; @@ -87,16 +88,17 @@ export class TimelineMiniMap extends Common.ObjectWrapper.eventMixin(UI.Widget.V endTime: TraceEngine.Types.Timing.MilliSeconds(Math.min(endTime, bounds.max)), }; const newVisibleTraceWindow = TraceEngine.Helpers.Timing.traceWindowFromMilliSeconds(breadcrumbTimes.startTime, breadcrumbTimes.endTime); - // When you create a breadcrumb, both the minimap bounds and the visible - // window get set to that breadcrumb's window. - TraceBounds.TraceBounds.BoundsManager.instance().setMiniMapBounds(newVisibleTraceWindow); - TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(newVisibleTraceWindow); if (this.breadcrumbs === null) { - this.breadcrumbs = new TimelineComponents.Breadcrumbs.Breadcrumbs(newVisibleTraceWindow); + this.breadcrumbs = + AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance()?.getTimelineBreadcrumbs() ?? null; } else { this.breadcrumbs.add(newVisibleTraceWindow); } + if (!this.breadcrumbs) { + console.warn('AnnotationsManager has not been created, therefore Breadcrumbs can not be added'); + return; + } this.#breadcrumbsUI.data = { breadcrumb: this.breadcrumbs.initialBreadcrumb, }; @@ -105,17 +107,13 @@ export class TimelineMiniMap extends Common.ObjectWrapper.eventMixin(UI.Widget.V // Note this is slightly confusing: when the user clicks on a breadcrumb, // we do not remove it, but we do remove all of its children, and make it // the new active breadcrumb. - const visibleTimesMilli = TraceEngine.Helpers.Timing.traceWindowMilliSeconds(breadcrumb.window); if (this.breadcrumbs) { - this.breadcrumbs.makeBreadcrumbActive(breadcrumb); + this.breadcrumbs.setLastBreadcrumb(breadcrumb); // Only the initial breadcrumb is passed in because breadcrumbs are stored in a linked list and breadcrumbsUI component iterates through them this.#breadcrumbsUI.data = { breadcrumb: this.breadcrumbs.initialBreadcrumb, }; } - const newVisibleTraceWindow = TraceEngine.Helpers.Timing.traceWindowFromMilliSeconds(visibleTimesMilli.min, visibleTimesMilli.max); - TraceBounds.TraceBounds.BoundsManager.instance().setMiniMapBounds(newVisibleTraceWindow); - TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(newVisibleTraceWindow); } wasShown() { super.wasShown(); diff --git a/public/panels/timeline/TimelineMiniMap.js.map b/public/panels/timeline/TimelineMiniMap.js.map index 8ea80ac6f..efed38585 100644 --- a/public/panels/timeline/TimelineMiniMap.js.map +++ b/public/panels/timeline/TimelineMiniMap.js.map @@ -1 +1 @@ -{"version":3,"file":"TimelineMiniMap.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineMiniMap.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAC3E,OAAO,KAAK,MAAM,MAAM,+CAA+C,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEhD,OAAO,KAAK,kBAAkB,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAEL,gCAAgC,EAChC,2BAA2B,EAC3B,4BAA4B,EAC5B,mCAAmC,EACnC,yBAAy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C,CAAC,CAAC;QAC5E,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC;YAClC,MAAM,SAAS,GAAG,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;YACnF,IAAI,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;gBAC5B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,yBAAyB,CAAC,SAAS,CAAC,CAAC,CAAC;YAChE,CAAC;QACH,CAAC;QACD,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;YAC7B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,2BAA2B,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;QAC7E,CAAC;QACD,IAAI,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC5D,IAAI,CAAC,kBAAkB,CAAC,kBAAkB,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC;IAC7E,CAAC;IAED,oBAAoB;QAClB,uDAAuD;QACvD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,MAAM,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC;QAC7E,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,OAAO;QACT,CAAC;QACD,IAAI,CAAC,aAAa,CACd,EAAC,SAAS,EAAE,WAAW,CAAC,KAAK,CAAC,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,iBAAiB,CAAC,GAAG,EAAC,CAAC,CAAC;IAC9G,CAAC;CACF","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport * as TraceEngine from '../../models/trace/trace.js';\nimport * as TraceBounds from '../../services/trace_bounds/trace_bounds.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as UI from '../../ui/legacy/legacy.js';\n\nimport * as TimelineComponents from './components/components.js';\nimport {\n type TimelineEventOverview,\n TimelineEventOverviewCPUActivity,\n TimelineEventOverviewMemory,\n TimelineEventOverviewNetwork,\n TimelineEventOverviewResponsiveness,\n TimelineFilmStripOverview,\n} from './TimelineEventOverview.js';\nimport miniMapStyles from './timelineMiniMap.css.js';\nimport {TimelineUIUtils} from './TimelineUIUtils.js';\n\nexport interface OverviewData {\n traceParsedData: TraceEngine.Handlers.Types.TraceParseData;\n isCpuProfile?: boolean;\n settings: {\n showScreenshots: boolean,\n showMemory: boolean,\n };\n}\n\n/**\n * This component wraps the generic PerfUI Overview component and configures it\n * specifically for the Performance Panel, including injecting the CSS we use\n * to customise how the components render within the Performance Panel.\n *\n * It is also responsible for listening to events from the OverviewPane to\n * update the visible trace window, and when this happens it will update the\n * TraceBounds service with the new values.\n */\nexport class TimelineMiniMap extends\n Common.ObjectWrapper.eventMixin(UI.Widget.VBox) {\n breadcrumbsActivated: boolean = false;\n #overviewComponent = new PerfUI.TimelineOverviewPane.TimelineOverviewPane('timeline');\n #controls: TimelineEventOverview[] = [];\n breadcrumbs: TimelineComponents.Breadcrumbs.Breadcrumbs|null = null;\n #breadcrumbsUI: TimelineComponents.BreadcrumbsUI.BreadcrumbsUI;\n #data: OverviewData|null = null;\n\n #onTraceBoundsChangeBound = this.#onTraceBoundsChange.bind(this);\n\n constructor() {\n super();\n this.element.classList.add('timeline-minimap');\n this.#breadcrumbsUI = new TimelineComponents.BreadcrumbsUI.BreadcrumbsUI();\n\n this.#overviewComponent.show(this.element);\n\n this.#overviewComponent.addEventListener(PerfUI.TimelineOverviewPane.Events.OverviewPaneWindowChanged, event => {\n this.#onOverviewPanelWindowChanged(event);\n });\n this.#activateBreadcrumbs();\n\n TraceBounds.TraceBounds.onChange(this.#onTraceBoundsChangeBound);\n }\n\n #onOverviewPanelWindowChanged(\n event: Common.EventTarget.EventTargetEvent): void {\n const traceData = this.#data?.traceParsedData;\n if (!traceData) {\n return;\n }\n\n const traceBoundsState = TraceBounds.TraceBounds.BoundsManager.instance().state();\n if (!traceBoundsState) {\n return;\n }\n\n const left = (event.data.startTime > 0) ? event.data.startTime : traceBoundsState.milli.entireTraceBounds.min;\n const right =\n Number.isFinite(event.data.endTime) ? event.data.endTime : traceBoundsState.milli.entireTraceBounds.max;\n\n TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(\n TraceEngine.Helpers.Timing.traceWindowFromMilliSeconds(\n TraceEngine.Types.Timing.MilliSeconds(left),\n TraceEngine.Types.Timing.MilliSeconds(right),\n ),\n {\n shouldAnimate: true,\n },\n );\n }\n\n #onTraceBoundsChange(event: TraceBounds.TraceBounds.StateChangedEvent): void {\n if (event.updateType === 'RESET' || event.updateType === 'VISIBLE_WINDOW') {\n this.#overviewComponent.setWindowTimes(\n event.state.milli.timelineTraceWindow.min, event.state.milli.timelineTraceWindow.max);\n }\n if (event.updateType === 'RESET' || event.updateType === 'MINIMAP_BOUNDS') {\n this.#overviewComponent.setBounds(\n event.state.milli.minimapTraceBounds.min, event.state.milli.minimapTraceBounds.max);\n }\n }\n\n #activateBreadcrumbs(): void {\n this.breadcrumbsActivated = true;\n this.element.prepend(this.#breadcrumbsUI);\n this.#overviewComponent.addEventListener(PerfUI.TimelineOverviewPane.Events.OverviewPaneBreadcrumbAdded, event => {\n this.addBreadcrumb(event.data);\n });\n\n this.#breadcrumbsUI.addEventListener(TimelineComponents.BreadcrumbsUI.BreadcrumbRemovedEvent.eventName, event => {\n const breadcrumb = (event as TimelineComponents.BreadcrumbsUI.BreadcrumbRemovedEvent).breadcrumb;\n this.#removeBreadcrumb(breadcrumb);\n });\n this.#overviewComponent.enableCreateBreadcrumbsButton();\n }\n\n addBreadcrumb({startTime, endTime}: PerfUI.TimelineOverviewPane.OverviewPaneBreadcrumbAddedEvent): void {\n // The OverviewPane can emit 0 and Infinity as numbers for the range; in\n // this case we change them to be the min and max values of the minimap\n // bounds.\n const traceBoundsState = TraceBounds.TraceBounds.BoundsManager.instance().state();\n if (!traceBoundsState) {\n return;\n }\n const bounds = traceBoundsState.milli.minimapTraceBounds;\n\n const breadcrumbTimes = {\n startTime: TraceEngine.Types.Timing.MilliSeconds(Math.max(startTime, bounds.min)),\n endTime: TraceEngine.Types.Timing.MilliSeconds(Math.min(endTime, bounds.max)),\n };\n\n const newVisibleTraceWindow =\n TraceEngine.Helpers.Timing.traceWindowFromMilliSeconds(breadcrumbTimes.startTime, breadcrumbTimes.endTime);\n\n // When you create a breadcrumb, both the minimap bounds and the visible\n // window get set to that breadcrumb's window.\n TraceBounds.TraceBounds.BoundsManager.instance().setMiniMapBounds(\n newVisibleTraceWindow,\n );\n TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(\n newVisibleTraceWindow,\n );\n\n if (this.breadcrumbs === null) {\n this.breadcrumbs = new TimelineComponents.Breadcrumbs.Breadcrumbs(newVisibleTraceWindow);\n } else {\n this.breadcrumbs.add(newVisibleTraceWindow);\n }\n\n this.#breadcrumbsUI.data = {\n breadcrumb: this.breadcrumbs.initialBreadcrumb,\n };\n }\n\n #removeBreadcrumb(breadcrumb: TimelineComponents.Breadcrumbs.Breadcrumb): void {\n // Note this is slightly confusing: when the user clicks on a breadcrumb,\n // we do not remove it, but we do remove all of its children, and make it\n // the new active breadcrumb.\n const visibleTimesMilli = TraceEngine.Helpers.Timing.traceWindowMilliSeconds(breadcrumb.window);\n if (this.breadcrumbs) {\n this.breadcrumbs.makeBreadcrumbActive(breadcrumb);\n // Only the initial breadcrumb is passed in because breadcrumbs are stored in a linked list and breadcrumbsUI component iterates through them\n this.#breadcrumbsUI.data = {\n breadcrumb: this.breadcrumbs.initialBreadcrumb,\n };\n }\n const newVisibleTraceWindow = TraceEngine.Helpers.Timing.traceWindowFromMilliSeconds(\n visibleTimesMilli.min,\n visibleTimesMilli.max,\n );\n\n TraceBounds.TraceBounds.BoundsManager.instance().setMiniMapBounds(\n newVisibleTraceWindow,\n );\n TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(\n newVisibleTraceWindow,\n );\n }\n\n override wasShown(): void {\n super.wasShown();\n this.registerCSSFiles([miniMapStyles]);\n }\n\n reset(): void {\n this.#data = null;\n this.#overviewComponent.reset();\n }\n\n #setMarkers(traceParsedData: TraceEngine.Handlers.Types.TraceParseData): void {\n const markers = new Map();\n\n const {Meta, PageLoadMetrics} = traceParsedData;\n\n // Add markers for navigation start times.\n const navStartEvents = Meta.mainFrameNavigations;\n const minTimeInMilliseconds = TraceEngine.Helpers.Timing.microSecondsToMilliseconds(Meta.traceBounds.min);\n\n for (const event of navStartEvents) {\n const {startTime} = TraceEngine.Legacy.timesForEventInMilliseconds(event);\n markers.set(startTime, TimelineUIUtils.createEventDivider(event, minTimeInMilliseconds));\n }\n\n // Now add markers for the page load events\n for (const event of PageLoadMetrics.allMarkerEvents) {\n const {startTime} = TraceEngine.Legacy.timesForEventInMilliseconds(event);\n markers.set(startTime, TimelineUIUtils.createEventDivider(event, minTimeInMilliseconds));\n }\n\n this.#overviewComponent.setMarkers(markers);\n }\n\n #setNavigationStartEvents(traceParsedData: TraceEngine.Handlers.Types.TraceParseData): void {\n this.#overviewComponent.setNavStartTimes(traceParsedData.Meta.mainFrameNavigations);\n }\n\n getControls(): TimelineEventOverview[] {\n return this.#controls;\n }\n\n setData(data: OverviewData): void {\n if (this.#data?.traceParsedData === data.traceParsedData) {\n return;\n }\n this.#data = data;\n this.#controls = [];\n\n this.#setMarkers(data.traceParsedData);\n this.#setNavigationStartEvents(data.traceParsedData);\n this.#controls.push(new TimelineEventOverviewResponsiveness(data.traceParsedData));\n this.#controls.push(new TimelineEventOverviewCPUActivity(data.traceParsedData));\n\n this.#controls.push(new TimelineEventOverviewNetwork(data.traceParsedData));\n if (data.settings.showScreenshots) {\n const filmStrip = TraceEngine.Extras.FilmStrip.fromTraceData(data.traceParsedData);\n if (filmStrip.frames.length) {\n this.#controls.push(new TimelineFilmStripOverview(filmStrip));\n }\n }\n if (data.settings.showMemory) {\n this.#controls.push(new TimelineEventOverviewMemory(data.traceParsedData));\n }\n this.#overviewComponent.setOverviewControls(this.#controls);\n this.#overviewComponent.showingScreenshots = data.settings.showScreenshots;\n }\n\n addInitialBreadcrumb(): void {\n // Create first breadcrumb from the initial full window\n this.breadcrumbs = null;\n const traceBounds = TraceBounds.TraceBounds.BoundsManager.instance().state();\n if (!traceBounds) {\n return;\n }\n this.addBreadcrumb(\n {startTime: traceBounds.milli.entireTraceBounds.min, endTime: traceBounds.milli.entireTraceBounds.max});\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"TimelineMiniMap.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineMiniMap.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,kBAAkB,MAAM,2DAA2D,CAAC;AAChG,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAC3E,OAAO,KAAK,MAAM,MAAM,+CAA+C,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEhD,OAAO,KAAK,kBAAkB,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAEL,gCAAgC,EAChC,2BAA2B,EAC3B,4BAA4B,EAC5B,mCAAmC,EACnC,yBAAyB,GAC1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,aAAa,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAWrD;;;;;;;;GAQG;AACH,MAAM,OAAO,eAAgB,SACzB,MAAM,CAAC,aAAa,CAAC,UAAU,CAAgE,EAAE,CAAC,MAA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W,GAAG,IAAI,CAAC;QACxB,MAAM,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC;QAC7E,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,OAAO;QACT,CAAC;QACD,IAAI,CAAC,aAAa,CACd,EAAC,SAAS,EAAE,WAAW,CAAC,KAAK,CAAC,iBAAiB,CAAC,GAAG,EAAE,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,iBAAiB,CAAC,GAAG,EAAC,CAAC,CAAC;IAC9G,CAAC;CACF","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport * as TraceEngine from '../../models/trace/trace.js';\nimport * as AnnotationsManager from '../../services/annotations_manager/annotations_manager.js';\nimport * as TraceBounds from '../../services/trace_bounds/trace_bounds.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as UI from '../../ui/legacy/legacy.js';\n\nimport * as TimelineComponents from './components/components.js';\nimport {\n type TimelineEventOverview,\n TimelineEventOverviewCPUActivity,\n TimelineEventOverviewMemory,\n TimelineEventOverviewNetwork,\n TimelineEventOverviewResponsiveness,\n TimelineFilmStripOverview,\n} from './TimelineEventOverview.js';\nimport miniMapStyles from './timelineMiniMap.css.js';\nimport {TimelineUIUtils} from './TimelineUIUtils.js';\n\nexport interface OverviewData {\n traceParsedData: TraceEngine.Handlers.Types.TraceParseData;\n isCpuProfile?: boolean;\n settings: {\n showScreenshots: boolean,\n showMemory: boolean,\n };\n}\n\n/**\n * This component wraps the generic PerfUI Overview component and configures it\n * specifically for the Performance Panel, including injecting the CSS we use\n * to customise how the components render within the Performance Panel.\n *\n * It is also responsible for listening to events from the OverviewPane to\n * update the visible trace window, and when this happens it will update the\n * TraceBounds service with the new values.\n */\nexport class TimelineMiniMap extends\n Common.ObjectWrapper.eventMixin(UI.Widget.VBox) {\n breadcrumbsActivated: boolean = false;\n #overviewComponent = new PerfUI.TimelineOverviewPane.TimelineOverviewPane('timeline');\n #controls: TimelineEventOverview[] = [];\n breadcrumbs: TimelineComponents.Breadcrumbs.Breadcrumbs|null = null;\n #breadcrumbsUI: TimelineComponents.BreadcrumbsUI.BreadcrumbsUI;\n #data: OverviewData|null = null;\n\n #onTraceBoundsChangeBound = this.#onTraceBoundsChange.bind(this);\n\n constructor() {\n super();\n this.element.classList.add('timeline-minimap');\n this.#breadcrumbsUI = new TimelineComponents.BreadcrumbsUI.BreadcrumbsUI();\n\n this.#overviewComponent.show(this.element);\n\n this.#overviewComponent.addEventListener(PerfUI.TimelineOverviewPane.Events.OverviewPaneWindowChanged, event => {\n this.#onOverviewPanelWindowChanged(event);\n });\n this.#activateBreadcrumbs();\n\n TraceBounds.TraceBounds.onChange(this.#onTraceBoundsChangeBound);\n }\n\n #onOverviewPanelWindowChanged(\n event: Common.EventTarget.EventTargetEvent): void {\n const traceData = this.#data?.traceParsedData;\n if (!traceData) {\n return;\n }\n\n const traceBoundsState = TraceBounds.TraceBounds.BoundsManager.instance().state();\n if (!traceBoundsState) {\n return;\n }\n\n const left = (event.data.startTime > 0) ? event.data.startTime : traceBoundsState.milli.entireTraceBounds.min;\n const right =\n Number.isFinite(event.data.endTime) ? event.data.endTime : traceBoundsState.milli.entireTraceBounds.max;\n\n TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(\n TraceEngine.Helpers.Timing.traceWindowFromMilliSeconds(\n TraceEngine.Types.Timing.MilliSeconds(left),\n TraceEngine.Types.Timing.MilliSeconds(right),\n ),\n {\n shouldAnimate: true,\n },\n );\n }\n\n #onTraceBoundsChange(event: TraceBounds.TraceBounds.StateChangedEvent): void {\n if (event.updateType === 'RESET' || event.updateType === 'VISIBLE_WINDOW') {\n this.#overviewComponent.setWindowTimes(\n event.state.milli.timelineTraceWindow.min, event.state.milli.timelineTraceWindow.max);\n }\n if (event.updateType === 'RESET' || event.updateType === 'MINIMAP_BOUNDS') {\n this.#overviewComponent.setBounds(\n event.state.milli.minimapTraceBounds.min, event.state.milli.minimapTraceBounds.max);\n }\n }\n\n #activateBreadcrumbs(): void {\n this.breadcrumbsActivated = true;\n this.element.prepend(this.#breadcrumbsUI);\n this.#overviewComponent.addEventListener(PerfUI.TimelineOverviewPane.Events.OverviewPaneBreadcrumbAdded, event => {\n this.addBreadcrumb(event.data);\n });\n\n this.#breadcrumbsUI.addEventListener(TimelineComponents.BreadcrumbsUI.BreadcrumbRemovedEvent.eventName, event => {\n const breadcrumb = (event as TimelineComponents.BreadcrumbsUI.BreadcrumbRemovedEvent).breadcrumb;\n this.#removeBreadcrumb(breadcrumb);\n });\n this.#overviewComponent.enableCreateBreadcrumbsButton();\n }\n\n addBreadcrumb({startTime, endTime}: PerfUI.TimelineOverviewPane.OverviewPaneBreadcrumbAddedEvent): void {\n // The OverviewPane can emit 0 and Infinity as numbers for the range; in\n // this case we change them to be the min and max values of the minimap\n // bounds.\n const traceBoundsState = TraceBounds.TraceBounds.BoundsManager.instance().state();\n if (!traceBoundsState) {\n return;\n }\n const bounds = traceBoundsState.milli.minimapTraceBounds;\n\n const breadcrumbTimes = {\n startTime: TraceEngine.Types.Timing.MilliSeconds(Math.max(startTime, bounds.min)),\n endTime: TraceEngine.Types.Timing.MilliSeconds(Math.min(endTime, bounds.max)),\n };\n\n const newVisibleTraceWindow =\n TraceEngine.Helpers.Timing.traceWindowFromMilliSeconds(breadcrumbTimes.startTime, breadcrumbTimes.endTime);\n\n if (this.breadcrumbs === null) {\n this.breadcrumbs =\n AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance()?.getTimelineBreadcrumbs() ?? null;\n } else {\n this.breadcrumbs.add(newVisibleTraceWindow);\n }\n\n if (!this.breadcrumbs) {\n console.warn('AnnotationsManager has not been created, therefore Breadcrumbs can not be added');\n return;\n }\n\n this.#breadcrumbsUI.data = {\n breadcrumb: this.breadcrumbs.initialBreadcrumb,\n };\n }\n\n #removeBreadcrumb(breadcrumb: TraceEngine.Types.File.Breadcrumb): void {\n // Note this is slightly confusing: when the user clicks on a breadcrumb,\n // we do not remove it, but we do remove all of its children, and make it\n // the new active breadcrumb.\n if (this.breadcrumbs) {\n this.breadcrumbs.setLastBreadcrumb(breadcrumb);\n // Only the initial breadcrumb is passed in because breadcrumbs are stored in a linked list and breadcrumbsUI component iterates through them\n this.#breadcrumbsUI.data = {\n breadcrumb: this.breadcrumbs.initialBreadcrumb,\n };\n }\n }\n\n override wasShown(): void {\n super.wasShown();\n this.registerCSSFiles([miniMapStyles]);\n }\n\n reset(): void {\n this.#data = null;\n this.#overviewComponent.reset();\n }\n\n #setMarkers(traceParsedData: TraceEngine.Handlers.Types.TraceParseData): void {\n const markers = new Map();\n\n const {Meta, PageLoadMetrics} = traceParsedData;\n\n // Add markers for navigation start times.\n const navStartEvents = Meta.mainFrameNavigations;\n const minTimeInMilliseconds = TraceEngine.Helpers.Timing.microSecondsToMilliseconds(Meta.traceBounds.min);\n\n for (const event of navStartEvents) {\n const {startTime} = TraceEngine.Legacy.timesForEventInMilliseconds(event);\n markers.set(startTime, TimelineUIUtils.createEventDivider(event, minTimeInMilliseconds));\n }\n\n // Now add markers for the page load events\n for (const event of PageLoadMetrics.allMarkerEvents) {\n const {startTime} = TraceEngine.Legacy.timesForEventInMilliseconds(event);\n markers.set(startTime, TimelineUIUtils.createEventDivider(event, minTimeInMilliseconds));\n }\n\n this.#overviewComponent.setMarkers(markers);\n }\n\n #setNavigationStartEvents(traceParsedData: TraceEngine.Handlers.Types.TraceParseData): void {\n this.#overviewComponent.setNavStartTimes(traceParsedData.Meta.mainFrameNavigations);\n }\n\n getControls(): TimelineEventOverview[] {\n return this.#controls;\n }\n\n setData(data: OverviewData): void {\n if (this.#data?.traceParsedData === data.traceParsedData) {\n return;\n }\n this.#data = data;\n this.#controls = [];\n\n this.#setMarkers(data.traceParsedData);\n this.#setNavigationStartEvents(data.traceParsedData);\n this.#controls.push(new TimelineEventOverviewResponsiveness(data.traceParsedData));\n this.#controls.push(new TimelineEventOverviewCPUActivity(data.traceParsedData));\n\n this.#controls.push(new TimelineEventOverviewNetwork(data.traceParsedData));\n if (data.settings.showScreenshots) {\n const filmStrip = TraceEngine.Extras.FilmStrip.fromTraceData(data.traceParsedData);\n if (filmStrip.frames.length) {\n this.#controls.push(new TimelineFilmStripOverview(filmStrip));\n }\n }\n if (data.settings.showMemory) {\n this.#controls.push(new TimelineEventOverviewMemory(data.traceParsedData));\n }\n this.#overviewComponent.setOverviewControls(this.#controls);\n this.#overviewComponent.showingScreenshots = data.settings.showScreenshots;\n }\n\n addInitialBreadcrumb(): void {\n // Create first breadcrumb from the initial full window\n this.breadcrumbs = null;\n const traceBounds = TraceBounds.TraceBounds.BoundsManager.instance().state();\n if (!traceBounds) {\n return;\n }\n this.addBreadcrumb(\n {startTime: traceBounds.milli.entireTraceBounds.min, endTime: traceBounds.milli.entireTraceBounds.max});\n }\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/TimelineMiniMap.test.js b/public/panels/timeline/TimelineMiniMap.test.js index 08cea1275..9e7de91c1 100644 --- a/public/panels/timeline/TimelineMiniMap.test.js +++ b/public/panels/timeline/TimelineMiniMap.test.js @@ -1,6 +1,7 @@ // Copyright 2023 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import * as AnnotationsManager from '../../services/annotations_manager/annotations_manager.js'; import * as TraceBounds from '../../services/trace_bounds/trace_bounds.js'; import { raf, renderElementIntoDOM } from '../../testing/DOMHelpers.js'; import { describeWithEnvironment } from '../../testing/EnvironmentHelpers.js'; @@ -54,7 +55,8 @@ describeWithEnvironment('TimelineMiniMap', function () { }); it('creates the first breadcrumb', async function () { const traceParsedData = await TraceLoader.traceEngine(this, 'web-dev.json.gz'); - TraceBounds.TraceBounds.BoundsManager.instance().resetWithNewBounds(traceParsedData.Meta.traceBounds); + const boundsManager = TraceBounds.TraceBounds.BoundsManager.instance().resetWithNewBounds(traceParsedData.Meta.traceBounds); + AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance({ entryToNodeMap: new Map(), wholeTraceBounds: boundsManager.state()?.micro.entireTraceBounds }); const container = document.createElement('div'); renderElementIntoDOM(container); const minimap = new Timeline.TimelineMiniMap.TimelineMiniMap(); diff --git a/public/panels/timeline/TimelineMiniMap.test.js.map b/public/panels/timeline/TimelineMiniMap.test.js.map index d0feb3a51..74672a48a 100644 --- a/public/panels/timeline/TimelineMiniMap.test.js.map +++ b/public/panels/timeline/TimelineMiniMap.test.js.map @@ -1 +1 @@ -{"version":3,"file":"TimelineMiniMap.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineMiniMap.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAC3E,OAAO,EAAC,GAAG,EAAE,oBAAoB,EAAC,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAC,uBAAuB,EAAC,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,kBAAkB,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,uBAAuB,CAAC,iBAAiB,EAAE;IACzC,EAAE,CAAC,iEAAiE,EAAE,KAAK;QACzE,MAAM,eAAe,GAAG,MAAM,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAE/E,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAChD,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAEhC,MAAM,OAAO,GAAG,IAAI,QAAQ,CAAC,eAAe,CAAC,eAAe,EAAE,CAAC;QAC/D,OAAO,CAAC,UAAU,EAAE,CAAC;QACrB,OAAO,CAAC,IAA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,yDAAyD,CAAC,CAAC;QAC7E,CAAC;QAED,MAAM,CAAC,WAAW,CACd,kBAAkB,CAAC,WAAW,CAAC,kBAAkB,CAAC,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACxG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC,iBAAiB,EAAE,EAAC,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC;IACnH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as TraceBounds from '../../services/trace_bounds/trace_bounds.js';\nimport {raf, renderElementIntoDOM} from '../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../testing/TraceLoader.js';\n\nimport * as TimelineComponents from './components/components.js';\nimport * as Timeline from './timeline.js';\n\ndescribeWithEnvironment('TimelineMiniMap', function() {\n it('always shows the responsiveness, CPU activity and network panel', async function() {\n const traceParsedData = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n\n const container = document.createElement('div');\n renderElementIntoDOM(container);\n\n const minimap = new Timeline.TimelineMiniMap.TimelineMiniMap();\n minimap.markAsRoot();\n minimap.show(container);\n\n minimap.setData({\n traceParsedData,\n settings: {\n showMemory: false,\n showScreenshots: false,\n },\n });\n\n await raf();\n assert.isDefined(container.querySelector('#timeline-overview-responsiveness'));\n assert.isDefined(container.querySelector('#timeline-overview-cpu-activity'));\n assert.isDefined(container.querySelector('#timeline-overview-network'));\n assert.isNull(container.querySelector('#timeline-overview-filmstrip'));\n assert.isNull(container.querySelector('#timeline-overview-memory'));\n minimap.detach();\n });\n\n it('will show the other panels if they are set to visible', async function() {\n const traceParsedData = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n\n const container = document.createElement('div');\n renderElementIntoDOM(container);\n\n const minimap = new Timeline.TimelineMiniMap.TimelineMiniMap();\n minimap.markAsRoot();\n minimap.show(container);\n\n minimap.setData({\n traceParsedData,\n settings: {\n showMemory: true,\n showScreenshots: true,\n },\n });\n\n await raf();\n assert.isDefined(container.querySelector('#timeline-overview-responsiveness'));\n assert.isDefined(container.querySelector('#timeline-overview-cpu-activity'));\n assert.isDefined(container.querySelector('#timeline-overview-network'));\n assert.isDefined(container.querySelector('#timeline-overview-filmstrip'));\n assert.isDefined(container.querySelector('#timeline-overview-memory'));\n minimap.detach();\n });\n\n it('creates the first breadcrumb', async function() {\n const traceParsedData = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n\n TraceBounds.TraceBounds.BoundsManager.instance().resetWithNewBounds(traceParsedData.Meta.traceBounds);\n\n const container = document.createElement('div');\n renderElementIntoDOM(container);\n\n const minimap = new Timeline.TimelineMiniMap.TimelineMiniMap();\n minimap.markAsRoot();\n minimap.show(container);\n\n minimap.setData({\n traceParsedData,\n settings: {\n showMemory: true,\n showScreenshots: true,\n },\n });\n minimap.addInitialBreadcrumb();\n\n await raf();\n\n if (!minimap.breadcrumbs) {\n throw new Error('The MiniMap unexpectedly did not create any breadcrumbs');\n }\n\n assert.strictEqual(\n TimelineComponents.Breadcrumbs.flattenBreadcrumbs(minimap.breadcrumbs.initialBreadcrumb).length, 1);\n assert.deepEqual(minimap.breadcrumbs.initialBreadcrumb, {window: traceParsedData.Meta.traceBounds, child: null});\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"TimelineMiniMap.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineMiniMap.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,kBAAkB,MAAM,2DAA2D,CAAC;AAChG,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAC3E,OAAO,EAAC,GAAG,E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ent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as AnnotationsManager from '../../services/annotations_manager/annotations_manager.js';\nimport * as TraceBounds from '../../services/trace_bounds/trace_bounds.js';\nimport {raf, renderElementIntoDOM} from '../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../testing/TraceLoader.js';\n\nimport * as TimelineComponents from './components/components.js';\nimport * as Timeline from './timeline.js';\n\ndescribeWithEnvironment('TimelineMiniMap', function() {\n it('always shows the responsiveness, CPU activity and network panel', async function() {\n const traceParsedData = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n\n const container = document.createElement('div');\n renderElementIntoDOM(container);\n\n const minimap = new Timeline.TimelineMiniMap.TimelineMiniMap();\n minimap.markAsRoot();\n minimap.show(container);\n\n minimap.setData({\n traceParsedData,\n settings: {\n showMemory: false,\n showScreenshots: false,\n },\n });\n\n await raf();\n assert.isDefined(container.querySelector('#timeline-overview-responsiveness'));\n assert.isDefined(container.querySelector('#timeline-overview-cpu-activity'));\n assert.isDefined(container.querySelector('#timeline-overview-network'));\n assert.isNull(container.querySelector('#timeline-overview-filmstrip'));\n assert.isNull(container.querySelector('#timeline-overview-memory'));\n minimap.detach();\n });\n\n it('will show the other panels if they are set to visible', async function() {\n const traceParsedData = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n\n const container = document.createElement('div');\n renderElementIntoDOM(container);\n\n const minimap = new Timeline.TimelineMiniMap.TimelineMiniMap();\n minimap.markAsRoot();\n minimap.show(container);\n\n minimap.setData({\n traceParsedData,\n settings: {\n showMemory: true,\n showScreenshots: true,\n },\n });\n\n await raf();\n assert.isDefined(container.querySelector('#timeline-overview-responsiveness'));\n assert.isDefined(container.querySelector('#timeline-overview-cpu-activity'));\n assert.isDefined(container.querySelector('#timeline-overview-network'));\n assert.isDefined(container.querySelector('#timeline-overview-filmstrip'));\n assert.isDefined(container.querySelector('#timeline-overview-memory'));\n minimap.detach();\n });\n\n it('creates the first breadcrumb', async function() {\n const traceParsedData = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n\n const boundsManager =\n TraceBounds.TraceBounds.BoundsManager.instance().resetWithNewBounds(traceParsedData.Meta.traceBounds);\n AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance(\n {entryToNodeMap: new Map(), wholeTraceBounds: boundsManager.state()?.micro.entireTraceBounds});\n\n const container = document.createElement('div');\n renderElementIntoDOM(container);\n\n const minimap = new Timeline.TimelineMiniMap.TimelineMiniMap();\n minimap.markAsRoot();\n minimap.show(container);\n\n minimap.setData({\n traceParsedData,\n settings: {\n showMemory: true,\n showScreenshots: true,\n },\n });\n minimap.addInitialBreadcrumb();\n\n await raf();\n\n if (!minimap.breadcrumbs) {\n throw new Error('The MiniMap unexpectedly did not create any breadcrumbs');\n }\n\n assert.strictEqual(\n TimelineComponents.Breadcrumbs.flattenBreadcrumbs(minimap.breadcrumbs.initialBreadcrumb).length, 1);\n assert.deepEqual(minimap.breadcrumbs.initialBreadcrumb, {window: traceParsedData.Meta.traceBounds, child: null});\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/TimelinePanel.d.ts b/public/panels/timeline/TimelinePanel.d.ts index dd8110078..21b0fd934 100644 --- a/public/panels/timeline/TimelinePanel.d.ts +++ b/public/panels/timeline/TimelinePanel.d.ts @@ -94,7 +94,7 @@ export declare class TimelinePanel extends UI.Panel.Panel implements Client, Tim private clear; private reset; applyFilters(_perfModel: PerformanceModel | null, exclusiveFilter?: TimelineModel.TimelineModelFilter.TimelineModelFilter | null): void; - setModel(model: PerformanceModel | null, exclusiveFilter?: TimelineModel.TimelineModelFilter.TimelineModelFilter | null, traceEngineIndex?: number): void; + setModel(model: PerformanceModel | null, exclusiveFilter?: TimelineModel.TimelineModelFilter.TimelineModelFilter | null, traceEngineIndex?: number, metadata?: TraceEngine.Types.File.MetaData | null): void; private recordingStarted; recordingProgress(usage: number): void; private showLandingPage; diff --git a/public/panels/timeline/TimelinePanel.js b/public/panels/timeline/TimelinePanel.js index 4962b97f6..64068f216 100644 --- a/public/panels/timeline/TimelinePanel.js +++ b/public/panels/timeline/TimelinePanel.js @@ -590,7 +590,12 @@ export class TimelinePanel extends UI.Panel.Panel { this.timelinePane.element.appendChild(this.fileSelectorElement); } contextMenu(event) { - const contextMenu = new UI.ContextMenu.ContextMenu(event); + // Do not show this Context menu on FlameChart entries because we have a different context menu for FlameChart entries + const mouseEvent = event; + if (this.flameChart.getMainFlameChart().coordinatesToEntryIndex(mouseEvent.offsetX, mouseEvent.offsetY) !== -1) { + return; + } + const contextMenu = new UI.ContextMenu.ContextMenu(event, { useSoftMenu: true }); contextMenu.appendItemsAtLocation('timelineMenu'); void contextMenu.show(); } @@ -607,7 +612,7 @@ export class TimelinePanel extends UI.Panel.Panel { // Save annotations into the metadata if annotations the experiment is on if (Root.Runtime.experiments.isEnabled("save-and-load-trace-with-annotations" /* Root.Runtime.ExperimentName.SAVE_AND_LOAD_TRACE_WITH_ANNOTATIONS */) && metadata) { - metadata.annotations = AnnotationsManager.AnnotationsManager.AnnotationsManager.instance().getAnnotations(); + metadata.annotations = AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance()?.getAnnotations(); } if (!traceEvents) { return; @@ -1045,7 +1050,7 @@ export class TimelinePanel extends UI.Panel.Panel { // http/tests/devtools/tracing/timeline-misc/timeline-range-stats.js this.#applyActiveFilters(false, exclusiveFilter); } - setModel(model, exclusiveFilter = null, traceEngineIndex = -1) { + setModel(model, exclusiveFilter = null, traceEngineIndex = -1, metadata = null) { this.performanceModel = model; this.#traceEngineActiveTraceIndex = traceEngineIndex; const traceParsedData = this.#traceEngineModel.traceParsedData(this.#traceEngineActiveTraceIndex); @@ -1056,9 +1061,20 @@ export class TimelinePanel extends UI.Panel.Panel { // rendering. if (traceParsedData) { TraceBounds.TraceBounds.BoundsManager.instance().resetWithNewBounds(traceParsedData.Meta.traceBounds); - // Since we have a single instance to EntriesFilter, combine both SyntheticEvent to Node maps + // Since we have a single instance to AnnotationsManager, combine both SyntheticEvent to Node maps const samplesAndRendererEventsEntryToNodeMap = new Map([...traceParsedData.Samples.entryToNode, ...traceParsedData.Renderer.entryToNode]); - TraceEngine.EntriesFilter.EntriesFilter.maybeInstance({ entryToNodeMap: samplesAndRendererEventsEntryToNodeMap }); + // If the annotations experiment is on and there are some annotations saved, apply the annotations from the file. + // We create AnnotationsManager regardless of the experiment because the EntriesFilterer initiated in the AnnotationsManager + // needs to work even if the experiment is off. + const traceBounds = TraceBounds.TraceBounds.BoundsManager.instance().state(); + AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance({ + entryToNodeMap: samplesAndRendererEventsEntryToNodeMap, + wholeTraceBounds: traceBounds?.micro.entireTraceBounds, + }); + if (Root.Runtime.experiments.isEnabled("save-and-load-trace-with-annotations" /* Root.Runtime.ExperimentName.SAVE_AND_LOAD_TRACE_WITH_ANNOTATIONS */) && + metadata?.annotations) { + AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance()?.applyAnnotations(metadata?.annotations); + } this.#applyActiveFilters(traceParsedData.Meta.traceIsGeneric, exclusiveFilter); } if (model) { @@ -1234,7 +1250,6 @@ export class TimelinePanel extends UI.Panel.Panel { this.clear(); return; } - // TODO(b.corp.google.com/issues/313757110): Apply annotations from the file if they exist in the metadata. if (!this.performanceModel) { this.performanceModel = new PerformanceModel(); } @@ -1253,7 +1268,7 @@ export class TimelinePanel extends UI.Panel.Panel { // so we know that the active index will be the size of the model because // the newest trace will be automatically set to active. this.#traceEngineActiveTraceIndex = this.#traceEngineModel.size() - 1; - this.setModel(this.performanceModel, exclusiveFilter, this.#traceEngineActiveTraceIndex); + this.setModel(this.performanceModel, exclusiveFilter, this.#traceEngineActiveTraceIndex, metadata); if (this.statusPane) { this.statusPane.remove(); } diff --git a/public/panels/timeline/TimelinePanel.js.map b/public/panels/timeline/TimelinePanel.js.map index 85ce4b9c7..f8b43311a 100644 --- a/public/panels/timeline/TimelinePanel.js.map +++ b/public/panels/timeline/TimelinePanel.js.map @@ -1 +1 @@ -{"version":3,"file":"TimelinePanel.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelinePanel.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAG7C,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,SAAS,MAAM,qCAAqC,CAAC;AACjE,OAAO,KAAK,kBAAkB,MAAM,2DAA2D,CAAC;AAChG,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAC3E,OAAO,KAAK,QAAQ,MAAM,0CAA0C,CAAC;AACrE,OAAO,KAAK,aAAa,MAAM,sDAAsD,CAAC;AACtF,OAAO,KAAK,MAAM,MAAM,+CAA+C,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAChD,OAAO,KAAK,aAAa,MAAM,2CAA2C,CAAC;AAC3E,OAAO,KAAK,gBAAgB,MAAM,2CAA2C,CAAC;AAE9E,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAC,sBAAsB,EAAC,MAAM,gBAAgB,CAAC;AACtD,OAAO,0BAA0B,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAs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,CAAC;YACd,KAAK,yBAAyB;gBAC5B,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC1B,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/*\n * Copyright (C) 2012 Google Inc. All rights reserved.\n * Copyright (C) 2012 Intel Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as Host from '../../core/host/host.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as Root from '../../core/root/root.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport type * as Protocol from '../../generated/protocol.js';\nimport type * as TimelineModel from '../../models/timeline_model/timeline_model.js';\nimport * as TraceEngine from '../../models/trace/trace.js';\nimport * as Workspace from '../../models/workspace/workspace.js';\nimport * as AnnotationsManager from '../../services/annotations_manager/annotations_manager.js';\nimport * as TraceBounds from '../../services/trace_bounds/trace_bounds.js';\nimport * as Adorners from '../../ui/components/adorners/adorners.js';\nimport * as PanelFeedback from '../../ui/components/panel_feedback/panel_feedback.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\nimport * as MobileThrottling from '../mobile_throttling/mobile_throttling.js';\n\nimport {ActiveFilters} from './ActiveFilters.js';\nimport {TraceLoadEvent} from './BenchmarkEvents.js';\nimport {SHOULD_SHOW_EASTER_EGG} from './EasterEgg.js';\nimport historyToolbarButtonStyles from './historyToolbarButton.css.js';\nimport {IsolateSelector} from './IsolateSelector.js';\nimport {PerformanceModel} from './PerformanceModel.js';\nimport {cpuprofileJsonGenerator, traceJsonGenerator} from './SaveFileFormatter.js';\nimport {NodeNamesUpdated, SourceMapsResolver} from './SourceMapsResolver.js';\nimport {type Client, TimelineController} from './TimelineController.js';\nimport {TimelineFlameChartView} from './TimelineFlameChartView.js';\nimport {TimelineHistoryManager} from './TimelineHistoryManager.js';\nimport {TimelineLoader} from './TimelineLoader.js';\nimport {TimelineMiniMap} from './TimelineMiniMap.js';\nimport timelinePanelStyles from './timelinePanel.css.js';\nimport {TimelineSelection} from './TimelineSelection.js';\nimport timelineStatusDialogStyles from './timelineStatusDialog.css.js';\nimport {TimelineUIUtils} from './TimelineUIUtils.js';\nimport {UIDevtoolsController} from './UIDevtoolsController.js';\nimport {UIDevtoolsUtils} from './UIDevtoolsUtils.js';\n\nconst UIStrings = {\n /**\n *@description Text that appears when user drag and drop something (for example, a file) in Timeline Panel of the Performance panel\n */\n dropTimelineFileOrUrlHere: 'Drop timeline file or URL here',\n /**\n *@description Title of disable capture jsprofile setting in timeline panel of the performance panel\n */\n disableJavascriptSamples: 'Disable JavaScript samples',\n /**\n *@description Title of capture layers and pictures setting in timeline panel of the performance panel\n */\n enableAdvancedPaint: 'Enable advanced paint instrumentation (slow)',\n /**\n *@description Title of show screenshots setting in timeline panel of the performance panel\n */\n screenshots: 'Screenshots',\n /**\n *@description Text for the memory of the page\n */\n memory: 'Memory',\n /**\n *@description Text to clear content\n */\n clear: 'Clear',\n /**\n *@description A label for a button that fixes something.\n */\n fixMe: 'Fix me',\n /**\n *@description Tooltip text that appears when hovering over the largeicon load button\n */\n loadProfile: 'Load profile…',\n /**\n *@description Tooltip text that appears when hovering over the largeicon download button\n */\n saveProfile: 'Save profile…',\n /**\n *@description Text to take screenshots\n */\n captureScreenshots: 'Capture screenshots',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n showMemoryTimeline: 'Show memory timeline',\n /**\n *@description Tooltip text that appears when hovering over the largeicon settings gear in show settings pane setting in timeline panel of the performance panel\n */\n captureSettings: 'Capture settings',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n disablesJavascriptSampling: 'Disables JavaScript sampling, reduces overhead when running against mobile devices',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n capturesAdvancedPaint: 'Captures advanced paint instrumentation, introduces significant performance overhead',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n network: 'Network:',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n cpu: 'CPU:',\n /**\n *@description Title of the 'Network conditions' tool in the bottom drawer\n */\n networkConditions: 'Network conditions',\n /**\n *@description Text in Timeline Panel of the Performance panel\n *@example {wrong format} PH1\n *@example {ERROR_FILE_NOT_FOUND} PH2\n */\n failedToSaveTimelineSS: 'Failed to save timeline: {PH1} ({PH2})',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n CpuThrottlingIsEnabled: '- CPU throttling is enabled',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n NetworkThrottlingIsEnabled: '- Network throttling is enabled',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n HardwareConcurrencyIsEnabled: '- Hardware concurrency override is enabled',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n SignificantOverheadDueToPaint: '- Significant overhead due to paint instrumentation',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n JavascriptSamplingIsDisabled: '- JavaScript sampling is disabled',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n stoppingTimeline: 'Stopping timeline…',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n received: 'Received',\n /**\n *@description Text to close something\n */\n close: 'Close',\n /**\n *@description Text to download the raw trace files after an error\n */\n downloadAfterError: 'Download raw trace events',\n /**\n *@description Status text to indicate the recording has failed in the Performance panel\n */\n recordingFailed: 'Recording failed',\n /**\n * @description Text to indicate the progress of a profile. Informs the user that we are currently\n * creating a peformance profile.\n */\n profiling: 'Profiling…',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n bufferUsage: 'Buffer usage',\n /**\n *@description Text for an option to learn more about something\n */\n learnmore: 'Learn more',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n wasd: 'WASD',\n /**\n *@description Text in Timeline Panel of the Performance panel\n *@example {record} PH1\n *@example {Ctrl + R} PH2\n */\n clickTheRecordButtonSOrHitSTo: 'Click the record button {PH1} or hit {PH2} to start a new recording.',\n /**\n * @description Text in Timeline Panel of the Performance panel\n * @example {reload button} PH1\n * @example {Ctrl + R} PH2\n */\n clickTheReloadButtonSOrHitSTo: 'Click the reload button {PH1} or hit {PH2} to record the page load.',\n /**\n *@description Text in Timeline Panel of the Performance panel\n *@example {Ctrl + U} PH1\n *@example {Learn more} PH2\n */\n afterRecordingSelectAnAreaOf:\n 'After recording, select an area of interest in the overview by dragging. Then, zoom and pan the timeline with the mousewheel or {PH1} keys. {PH2}',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n loadingProfile: 'Loading profile…',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n processingProfile: 'Processing profile…',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n initializingProfiler: 'Initializing profiler…',\n /**\n *@description Text for the status of something\n */\n status: 'Status',\n /**\n *@description Text that refers to the time\n */\n time: 'Time',\n /**\n *@description Text for the description of something\n */\n description: 'Description',\n /**\n *@description Text of an item that stops the running task\n */\n stop: 'Stop',\n /**\n *@description Time text content in Timeline Panel of the Performance panel\n *@example {2.12} PH1\n */\n ssec: '{PH1} sec',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/TimelinePanel.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nlet timelinePanelInstance: TimelinePanel;\nlet isNode: boolean;\n\nexport class TimelinePanel extends UI.Panel.Panel implements Client, TimelineModeViewDelegate {\n private readonly dropTarget: UI.DropTarget.DropTarget;\n private readonly recordingOptionUIControls: UI.Toolbar.ToolbarItem[];\n private state: State;\n private recordingPageReload: boolean;\n private readonly millisecondsToRecordAfterLoadEvent: number;\n private readonly toggleRecordAction: UI.ActionRegistration.Action;\n private readonly recordReloadAction: UI.ActionRegistration.Action;\n readonly #historyManager: TimelineHistoryManager;\n private performanceModel: PerformanceModel|null;\n private disableCaptureJSProfileSetting: Common.Settings.Setting;\n private readonly captureLayersAndPicturesSetting: Common.Settings.Setting;\n private showScreenshotsSetting: Common.Settings.Setting;\n private showMemorySetting: Common.Settings.Setting;\n private readonly panelToolbar: UI.Toolbar.Toolbar;\n private readonly panelRightToolbar: UI.Toolbar.Toolbar;\n private readonly timelinePane: UI.Widget.VBox;\n readonly #minimapComponent = new TimelineMiniMap();\n private readonly statusPaneContainer: HTMLElement;\n private readonly flameChart: TimelineFlameChartView;\n private readonly searchableViewInternal: UI.SearchableView.SearchableView;\n private showSettingsPaneButton!: UI.Toolbar.ToolbarSettingToggle;\n private showSettingsPaneSetting!: Common.Settings.Setting;\n private settingsPane!: UI.Widget.Widget;\n private controller!: TimelineController|null;\n private cpuProfiler!: SDK.CPUProfilerModel.CPUProfilerModel|null;\n private clearButton!: UI.Toolbar.ToolbarButton;\n private fixMeButton: UI.Toolbar.ToolbarButton;\n private fixMeButtonAdded = false;\n private loadButton!: UI.Toolbar.ToolbarButton;\n private saveButton!: UI.Toolbar.ToolbarButton;\n private statusPane!: StatusPane|null;\n private landingPage!: UI.Widget.Widget;\n private loader?: TimelineLoader;\n private showScreenshotsToolbarCheckbox?: UI.Toolbar.ToolbarItem;\n private showMemoryToolbarCheckbox?: UI.Toolbar.ToolbarItem;\n private networkThrottlingSelect?: UI.Toolbar.ToolbarComboBox;\n private cpuThrottlingSelect?: UI.Toolbar.ToolbarComboBox;\n private fileSelectorElement?: HTMLInputElement;\n private selection?: TimelineSelection|null;\n private traceLoadStart!: TraceEngine.Types.Timing.MilliSeconds|null;\n private primaryPageTargetPromiseCallback = (_target: SDK.Target.Target): void => {};\n // Note: this is technically unused, but we need it to define the promiseCallback function above.\n private primaryPageTargetPromise = new Promise(res => {\n this.primaryPageTargetPromiseCallback = res;\n });\n\n #traceEngineModel: TraceEngine.TraceModel.Model;\n // Tracks the index of the trace that the user is currently viewing.\n #traceEngineActiveTraceIndex = -1;\n #sourceMapsResolver: SourceMapsResolver|null = null;\n #onSourceMapsNodeNamesResolvedBound = this.#onSourceMapsNodeNamesResolved.bind(this);\n readonly #onChartPlayableStateChangeBound: (event: Common.EventTarget.EventTargetEvent) => void;\n constructor() {\n super('timeline');\n const adornerContent = document.createElement('span');\n adornerContent.innerHTML = `
💫
`;\n const adorner = new Adorners.Adorner.Adorner();\n adorner.classList.add('fix-perf-icon');\n adorner.data = {\n name: i18nString(UIStrings.fixMe),\n content: adornerContent,\n };\n this.fixMeButton = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.fixMe), adorner);\n this.fixMeButton.addEventListener(UI.Toolbar.ToolbarButton.Events.Click, () => this.onFixMe());\n const config = TraceEngine.Types.Configuration.DEFAULT;\n config.experiments.timelineShowAllEvents = Root.Runtime.experiments.isEnabled('timeline-show-all-events');\n config.experiments.timelineV8RuntimeCallStats =\n Root.Runtime.experiments.isEnabled('timeline-v8-runtime-call-stats');\n this.#traceEngineModel = TraceEngine.TraceModel.Model.createWithAllHandlers(config);\n\n this.element.addEventListener('contextmenu', this.contextMenu.bind(this), false);\n this.dropTarget = new UI.DropTarget.DropTarget(\n this.element, [UI.DropTarget.Type.File, UI.DropTarget.Type.URI],\n i18nString(UIStrings.dropTimelineFileOrUrlHere), this.handleDrop.bind(this));\n\n this.recordingOptionUIControls = [];\n this.state = State.Idle;\n this.recordingPageReload = false;\n this.millisecondsToRecordAfterLoadEvent = 5000;\n this.toggleRecordAction = UI.ActionRegistry.ActionRegistry.instance().getAction('timeline.toggle-recording');\n this.recordReloadAction = UI.ActionRegistry.ActionRegistry.instance().getAction('timeline.record-reload');\n\n this.#historyManager = new TimelineHistoryManager(this.#minimapComponent);\n\n this.performanceModel = null;\n this.traceLoadStart = null;\n\n this.disableCaptureJSProfileSetting =\n Common.Settings.Settings.instance().createSetting('timeline-disable-js-sampling', false);\n this.disableCaptureJSProfileSetting.setTitle(i18nString(UIStrings.disableJavascriptSamples));\n this.captureLayersAndPicturesSetting =\n Common.Settings.Settings.instance().createSetting('timeline-capture-layers-and-pictures', false);\n this.captureLayersAndPicturesSetting.setTitle(i18nString(UIStrings.enableAdvancedPaint));\n\n this.showScreenshotsSetting =\n Common.Settings.Settings.instance().createSetting('timeline-show-screenshots', isNode ? false : true);\n this.showScreenshotsSetting.setTitle(i18nString(UIStrings.screenshots));\n this.showScreenshotsSetting.addChangeListener(this.updateOverviewControls, this);\n\n this.showMemorySetting = Common.Settings.Settings.instance().createSetting('timeline-show-memory', false);\n this.showMemorySetting.setTitle(i18nString(UIStrings.memory));\n this.showMemorySetting.addChangeListener(this.onModeChanged, this);\n\n const timelineToolbarContainer = this.element.createChild('div', 'timeline-toolbar-container');\n timelineToolbarContainer.setAttribute('jslog', `${VisualLogging.toolbar()}`);\n this.panelToolbar = new UI.Toolbar.Toolbar('timeline-main-toolbar', timelineToolbarContainer);\n this.panelToolbar.makeWrappable(true);\n this.panelRightToolbar = new UI.Toolbar.Toolbar('', timelineToolbarContainer);\n if (!isNode) {\n this.createSettingsPane();\n this.updateShowSettingsToolbarButton();\n }\n this.timelinePane = new UI.Widget.VBox();\n this.timelinePane.show(this.element);\n const topPaneElement = this.timelinePane.element.createChild('div', 'hbox');\n topPaneElement.id = 'timeline-overview-panel';\n\n this.#minimapComponent.show(topPaneElement);\n\n this.statusPaneContainer = this.timelinePane.element.createChild('div', 'status-pane-container fill');\n\n this.createFileSelector();\n\n SDK.TargetManager.TargetManager.instance().addModelListener(\n SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.Load, this.loadEventFired, this);\n\n this.flameChart = new TimelineFlameChartView(this);\n this.#onChartPlayableStateChangeBound = this.#onChartPlayableStateChange.bind(this);\n\n this.flameChart.getMainFlameChart().addEventListener(\n PerfUI.FlameChart.Events.ChartPlayableStateChange, this.#onChartPlayableStateChangeBound, this);\n\n this.searchableViewInternal = new UI.SearchableView.SearchableView(this.flameChart, null);\n this.searchableViewInternal.setMinimumSize(0, 100);\n this.searchableViewInternal.element.classList.add('searchable-view');\n this.searchableViewInternal.show(this.timelinePane.element);\n this.flameChart.show(this.searchableViewInternal.element);\n this.flameChart.setSearchableView(this.searchableViewInternal);\n this.searchableViewInternal.hideWidget();\n\n this.onModeChanged();\n this.populateToolbar();\n this.showLandingPage();\n this.updateTimelineControls();\n\n SDK.TargetManager.TargetManager.instance().addEventListener(\n SDK.TargetManager.Events.SuspendStateChanged, this.onSuspendStateChanged, this);\n if (Root.Runtime.experiments.isEnabled('timeline-as-console-profile-result-panel')) {\n const profilerModels = SDK.TargetManager.TargetManager.instance().models(SDK.CPUProfilerModel.CPUProfilerModel);\n for (const model of profilerModels) {\n for (const message of model.registeredConsoleProfileMessages) {\n this.consoleProfileFinished(message);\n }\n }\n SDK.TargetManager.TargetManager.instance().observeModels(\n SDK.CPUProfilerModel.CPUProfilerModel,\n {\n modelAdded: (model: SDK.CPUProfilerModel.CPUProfilerModel) => {\n model.addEventListener(\n SDK.CPUProfilerModel.Events.ConsoleProfileFinished, event => this.consoleProfileFinished(event.data));\n },\n modelRemoved: (_model: SDK.CPUProfilerModel.CPUProfilerModel) => {\n\n },\n },\n );\n }\n SDK.TargetManager.TargetManager.instance().observeTargets({\n targetAdded: (target: SDK.Target.Target) => {\n if (target !== SDK.TargetManager.TargetManager.instance().primaryPageTarget()) {\n return;\n }\n this.primaryPageTargetPromiseCallback(target);\n },\n targetRemoved: (_: SDK.Target.Target) => {},\n });\n }\n\n static instance(opts: {\n forceNew: boolean|null,\n isNode: boolean,\n }|undefined = {forceNew: null, isNode: false}): TimelinePanel {\n const {forceNew, isNode: isNodeMode} = opts;\n isNode = isNodeMode;\n\n if (!timelinePanelInstance || forceNew) {\n timelinePanelInstance = new TimelinePanel();\n }\n\n return timelinePanelInstance;\n }\n\n override searchableView(): UI.SearchableView.SearchableView|null {\n return this.searchableViewInternal;\n }\n\n override wasShown(): void {\n super.wasShown();\n UI.Context.Context.instance().setFlavor(TimelinePanel, this);\n this.registerCSSFiles([timelinePanelStyles]);\n // Record the performance tool load time.\n Host.userMetrics.panelLoaded('timeline', 'DevTools.Launch.Timeline');\n }\n\n override willHide(): void {\n UI.Context.Context.instance().setFlavor(TimelinePanel, null);\n this.#historyManager.cancelIfShowing();\n }\n\n loadFromEvents(events: TraceEngine.TracingManager.EventPayload[]): void {\n if (this.state !== State.Idle) {\n return;\n }\n this.prepareToLoadTimeline();\n this.loader = TimelineLoader.loadFromEvents(events, this);\n }\n\n getFlameChart(): TimelineFlameChartView {\n return this.flameChart;\n }\n\n getMinimap(): TimelineMiniMap {\n return this.#minimapComponent;\n }\n\n #onChartPlayableStateChange(event: Common.EventTarget.EventTargetEvent): void {\n if (event.data) {\n const dateObj = new Date();\n const month = dateObj.getUTCMonth() + 1;\n const day = dateObj.getUTCDate();\n const isAprilFools = (month === 4 && (day === 1 || day === 2)); // Show only on April fools and the next day\n if (isAprilFools && !this.fixMeButtonAdded && SHOULD_SHOW_EASTER_EGG) {\n this.fixMeButtonAdded = true;\n this.panelToolbar.appendToolbarItem(this.fixMeButton);\n }\n } else {\n this.fixMeButtonAdded = false;\n this.panelToolbar.removeToolbarItem(this.fixMeButton);\n }\n }\n\n private loadFromCpuProfile(profile: Protocol.Profiler.Profile|null, title?: string): void {\n if (this.state !== State.Idle) {\n return;\n }\n this.prepareToLoadTimeline();\n this.loader = TimelineLoader.loadFromCpuProfile(profile, this, title);\n }\n\n private setState(state: State): void {\n this.state = state;\n this.updateTimelineControls();\n }\n\n private createSettingCheckbox(setting: Common.Settings.Setting, tooltip: string): UI.Toolbar.ToolbarItem {\n const checkboxItem = new UI.Toolbar.ToolbarSettingCheckbox(setting, tooltip);\n this.recordingOptionUIControls.push(checkboxItem);\n return checkboxItem;\n }\n\n private populateToolbar(): void {\n // Record\n this.panelToolbar.appendToolbarItem(UI.Toolbar.Toolbar.createActionButton(this.toggleRecordAction));\n this.panelToolbar.appendToolbarItem(UI.Toolbar.Toolbar.createActionButton(this.recordReloadAction));\n this.clearButton = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.clear), 'clear');\n this.clearButton.addEventListener(UI.Toolbar.ToolbarButton.Events.Click, () => this.onClearButton());\n this.panelToolbar.appendToolbarItem(this.clearButton);\n\n // Load / Save\n this.loadButton = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.loadProfile), 'import');\n this.loadButton.addEventListener(UI.Toolbar.ToolbarButton.Events.Click, () => {\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.PerfPanelTraceImported);\n this.selectFileToLoad();\n });\n this.saveButton = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.saveProfile), 'download');\n this.saveButton.addEventListener(UI.Toolbar.ToolbarButton.Events.Click, _event => {\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.PerfPanelTraceExported);\n void this.saveToFile();\n });\n this.panelToolbar.appendSeparator();\n this.panelToolbar.appendToolbarItem(this.loadButton);\n this.panelToolbar.appendToolbarItem(this.saveButton);\n\n // History\n this.panelToolbar.appendSeparator();\n this.panelToolbar.appendToolbarItem(this.#historyManager.button());\n this.panelToolbar.registerCSSFiles([historyToolbarButtonStyles]);\n this.panelToolbar.appendSeparator();\n\n // View\n this.panelToolbar.appendSeparator();\n if (!isNode) {\n this.showScreenshotsToolbarCheckbox =\n this.createSettingCheckbox(this.showScreenshotsSetting, i18nString(UIStrings.captureScreenshots));\n this.panelToolbar.appendToolbarItem(this.showScreenshotsToolbarCheckbox);\n }\n\n this.showMemoryToolbarCheckbox =\n this.createSettingCheckbox(this.showMemorySetting, i18nString(UIStrings.showMemoryTimeline));\n this.panelToolbar.appendToolbarItem(this.showMemoryToolbarCheckbox);\n\n // GC\n this.panelToolbar.appendToolbarItem(UI.Toolbar.Toolbar.createActionButtonForId('components.collect-garbage'));\n\n // Isolate selector\n const isolateSelector = new IsolateSelector();\n if (isNode) {\n this.panelToolbar.appendSeparator();\n this.panelToolbar.appendToolbarItem(isolateSelector);\n }\n\n // Settings\n if (!isNode) {\n this.panelRightToolbar.appendSeparator();\n this.panelRightToolbar.appendToolbarItem(this.showSettingsPaneButton);\n }\n }\n\n private createSettingsPane(): void {\n this.showSettingsPaneSetting =\n Common.Settings.Settings.instance().createSetting('timeline-show-settings-toolbar', false);\n this.showSettingsPaneButton = new UI.Toolbar.ToolbarSettingToggle(\n this.showSettingsPaneSetting, 'gear', i18nString(UIStrings.captureSettings), 'gear-filled');\n SDK.NetworkManager.MultitargetNetworkManager.instance().addEventListener(\n SDK.NetworkManager.MultitargetNetworkManager.Events.ConditionsChanged, this.updateShowSettingsToolbarButton,\n this);\n SDK.CPUThrottlingManager.CPUThrottlingManager.instance().addEventListener(\n SDK.CPUThrottlingManager.Events.RateChanged, this.updateShowSettingsToolbarButton, this);\n SDK.CPUThrottlingManager.CPUThrottlingManager.instance().addEventListener(\n SDK.CPUThrottlingManager.Events.HardwareConcurrencyChanged, this.updateShowSettingsToolbarButton, this);\n this.disableCaptureJSProfileSetting.addChangeListener(this.updateShowSettingsToolbarButton, this);\n this.captureLayersAndPicturesSetting.addChangeListener(this.updateShowSettingsToolbarButton, this);\n\n this.settingsPane = new UI.Widget.HBox();\n this.settingsPane.element.classList.add('timeline-settings-pane');\n this.settingsPane.show(this.element);\n\n const captureToolbar = new UI.Toolbar.Toolbar('', this.settingsPane.element);\n captureToolbar.element.classList.add('flex-auto');\n captureToolbar.makeVertical();\n captureToolbar.appendToolbarItem(this.createSettingCheckbox(\n this.disableCaptureJSProfileSetting, i18nString(UIStrings.disablesJavascriptSampling)));\n captureToolbar.appendToolbarItem(\n this.createSettingCheckbox(this.captureLayersAndPicturesSetting, i18nString(UIStrings.capturesAdvancedPaint)));\n\n const throttlingPane = new UI.Widget.VBox();\n throttlingPane.element.classList.add('flex-auto');\n throttlingPane.show(this.settingsPane.element);\n\n const cpuThrottlingToolbar = new UI.Toolbar.Toolbar('', throttlingPane.element);\n cpuThrottlingToolbar.appendText(i18nString(UIStrings.cpu));\n this.cpuThrottlingSelect = MobileThrottling.ThrottlingManager.throttlingManager().createCPUThrottlingSelector();\n cpuThrottlingToolbar.appendToolbarItem(this.cpuThrottlingSelect);\n\n const networkThrottlingToolbar = new UI.Toolbar.Toolbar('', throttlingPane.element);\n networkThrottlingToolbar.appendText(i18nString(UIStrings.network));\n this.networkThrottlingSelect = this.createNetworkConditionsSelect();\n networkThrottlingToolbar.appendToolbarItem(this.networkThrottlingSelect);\n\n const hardwareConcurrencyPane = new UI.Widget.VBox();\n hardwareConcurrencyPane.element.classList.add('flex-auto');\n hardwareConcurrencyPane.show(this.settingsPane.element);\n\n const {toggle, input, reset, warning} =\n MobileThrottling.ThrottlingManager.throttlingManager().createHardwareConcurrencySelector();\n const concurrencyThrottlingToolbar = new UI.Toolbar.Toolbar('', hardwareConcurrencyPane.element);\n concurrencyThrottlingToolbar.registerCSSFiles([timelinePanelStyles]);\n input.element.classList.add('timeline-concurrency-input');\n concurrencyThrottlingToolbar.appendToolbarItem(toggle);\n concurrencyThrottlingToolbar.appendToolbarItem(input);\n concurrencyThrottlingToolbar.appendToolbarItem(reset);\n concurrencyThrottlingToolbar.appendToolbarItem(warning);\n\n this.showSettingsPaneSetting.addChangeListener(this.updateSettingsPaneVisibility.bind(this));\n this.updateSettingsPaneVisibility();\n }\n\n private createNetworkConditionsSelect(): UI.Toolbar.ToolbarComboBox {\n const toolbarItem = new UI.Toolbar.ToolbarComboBox(null, i18nString(UIStrings.networkConditions));\n toolbarItem.setMaxWidth(140);\n MobileThrottling.ThrottlingManager.throttlingManager().decorateSelectWithNetworkThrottling(\n toolbarItem.selectElement());\n return toolbarItem;\n }\n\n private prepareToLoadTimeline(): void {\n console.assert(this.state === State.Idle);\n this.setState(State.Loading);\n if (this.performanceModel) {\n this.performanceModel = null;\n }\n }\n\n private createFileSelector(): void {\n if (this.fileSelectorElement) {\n this.fileSelectorElement.remove();\n }\n this.fileSelectorElement = UI.UIUtils.createFileSelectorElement(this.loadFromFile.bind(this));\n this.timelinePane.element.appendChild(this.fileSelectorElement);\n }\n\n private contextMenu(event: Event): void {\n const contextMenu = new UI.ContextMenu.ContextMenu(event);\n contextMenu.appendItemsAtLocation('timelineMenu');\n void contextMenu.show();\n }\n\n async saveToFile(): Promise {\n if (this.state !== State.Idle) {\n return;\n }\n const performanceModel = this.performanceModel;\n if (!performanceModel) {\n return;\n }\n\n const traceEvents = this.#traceEngineModel.traceEvents(this.#traceEngineActiveTraceIndex);\n const metadata = this.#traceEngineModel.metadata(this.#traceEngineActiveTraceIndex);\n // Save annotations into the metadata if annotations the experiment is on\n if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.SAVE_AND_LOAD_TRACE_WITH_ANNOTATIONS) &&\n metadata) {\n metadata.annotations = AnnotationsManager.AnnotationsManager.AnnotationsManager.instance().getAnnotations();\n }\n if (!traceEvents) {\n return;\n }\n\n const traceStart = Platform.DateUtilities.toISO8601Compact(new Date());\n let fileName: Platform.DevToolsPath.RawPathString;\n if (metadata?.dataOrigin === TraceEngine.Types.File.DataOrigin.CPUProfile) {\n fileName = `CPU-${traceStart}.cpuprofile` as Platform.DevToolsPath.RawPathString;\n } else {\n fileName = `Trace-${traceStart}.json` as Platform.DevToolsPath.RawPathString;\n }\n\n try {\n // TODO(crbug.com/1456818): Extract this logic and add more tests.\n let traceAsString;\n if (metadata?.dataOrigin === TraceEngine.Types.File.DataOrigin.CPUProfile) {\n const profileEvent = traceEvents.find(e => e.name === 'CpuProfile');\n if (!profileEvent || !profileEvent.args?.data) {\n return;\n }\n const profileEventData = profileEvent.args?.data;\n if (profileEventData.hasOwnProperty('cpuProfile')) {\n // TODO(crbug.com/1456799): Currently use a hack way because we can't differentiate\n // cpuprofile from trace events when loading a file.\n // The loader will directly add the fake trace created from CpuProfile to the tracingModel.\n // And there is where the old saving logic saves the cpuprofile.\n // This will be solved when the CPUProfileHandler is done. Then we can directly get it\n // from the new traceEngine\n const profile = (profileEventData as {cpuProfile: Protocol.Profiler.Profile}).cpuProfile;\n traceAsString = cpuprofileJsonGenerator(profile as Protocol.Profiler.Profile);\n }\n } else {\n const formattedTraceIter = traceJsonGenerator(traceEvents, metadata);\n traceAsString = Array.from(formattedTraceIter).join('');\n }\n if (!traceAsString) {\n throw new Error('Trace content empty');\n }\n await Workspace.FileManager.FileManager.instance().save(fileName, traceAsString, true /* forceSaveAs */);\n Workspace.FileManager.FileManager.instance().close(fileName);\n } catch (error) {\n console.error(error.stack);\n if (error.name === 'AbortError') {\n // The user cancelled the action, so this is not an error we need to report.\n return;\n }\n Common.Console.Console.instance().error(\n i18nString(UIStrings.failedToSaveTimelineSS, {PH1: error.message, PH2: error.name}));\n }\n }\n\n async showHistory(): Promise {\n const recordingData = await this.#historyManager.showHistoryDropDown();\n if (recordingData && recordingData.traceParseDataIndex !== this.#traceEngineActiveTraceIndex) {\n this.setModel(recordingData.legacyModel, /* exclusiveFilter= */ null, recordingData.traceParseDataIndex);\n }\n }\n\n navigateHistory(direction: number): boolean {\n const recordingData = this.#historyManager.navigate(direction);\n if (recordingData && recordingData.traceParseDataIndex !== this.#traceEngineActiveTraceIndex) {\n this.setModel(recordingData.legacyModel, /* exclusiveFilter= */ null, recordingData.traceParseDataIndex);\n }\n return true;\n }\n\n selectFileToLoad(): void {\n if (this.fileSelectorElement) {\n this.fileSelectorElement.click();\n }\n }\n\n async loadFromFile(file: File): Promise {\n if (this.state !== State.Idle) {\n return;\n }\n this.prepareToLoadTimeline();\n this.loader = await TimelineLoader.loadFromFile(file, this);\n this.createFileSelector();\n }\n\n async loadFromURL(url: Platform.DevToolsPath.UrlString): Promise {\n if (this.state !== State.Idle) {\n return;\n }\n this.prepareToLoadTimeline();\n this.loader = await TimelineLoader.loadFromURL(url, this);\n }\n\n private updateOverviewControls(): void {\n const traceParsedData = this.#traceEngineModel.traceParsedData(this.#traceEngineActiveTraceIndex);\n const isCpuProfile = this.#traceEngineModel.metadata(this.#traceEngineActiveTraceIndex)?.dataOrigin ===\n TraceEngine.Types.File.DataOrigin.CPUProfile;\n if (!traceParsedData) {\n return;\n }\n\n this.#minimapComponent.setData({\n traceParsedData,\n isCpuProfile,\n settings: {\n showScreenshots: this.showScreenshotsSetting.get(),\n showMemory: this.showMemorySetting.get(),\n },\n });\n }\n\n private onModeChanged(): void {\n this.updateOverviewControls();\n this.doResize();\n this.select(null);\n }\n\n private updateSettingsPaneVisibility(): void {\n if (isNode) {\n return;\n }\n if (this.showSettingsPaneSetting.get()) {\n this.settingsPane.showWidget();\n } else {\n this.settingsPane.hideWidget();\n }\n }\n\n private updateShowSettingsToolbarButton(): void {\n const messages: string[] = [];\n if (SDK.CPUThrottlingManager.CPUThrottlingManager.instance().cpuThrottlingRate() !== 1) {\n messages.push(i18nString(UIStrings.CpuThrottlingIsEnabled));\n }\n if (MobileThrottling.ThrottlingManager.throttlingManager().hardwareConcurrencyOverrideEnabled) {\n messages.push(i18nString(UIStrings.HardwareConcurrencyIsEnabled));\n }\n if (SDK.NetworkManager.MultitargetNetworkManager.instance().isThrottling()) {\n messages.push(i18nString(UIStrings.NetworkThrottlingIsEnabled));\n }\n if (this.captureLayersAndPicturesSetting.get()) {\n messages.push(i18nString(UIStrings.SignificantOverheadDueToPaint));\n }\n if (this.disableCaptureJSProfileSetting.get()) {\n messages.push(i18nString(UIStrings.JavascriptSamplingIsDisabled));\n }\n\n this.showSettingsPaneButton.setDefaultWithRedColor(messages.length > 0);\n this.showSettingsPaneButton.setToggleWithRedColor(messages.length > 0);\n\n if (messages.length) {\n const tooltipElement = document.createElement('div');\n messages.forEach(message => {\n tooltipElement.createChild('div').textContent = message;\n });\n this.showSettingsPaneButton.setTitle(tooltipElement.textContent || '');\n } else {\n this.showSettingsPaneButton.setTitle(i18nString(UIStrings.captureSettings));\n }\n }\n\n private setUIControlsEnabled(enabled: boolean): void {\n this.recordingOptionUIControls.forEach(control => control.setEnabled(enabled));\n }\n\n async #evaluateInspectedURL(): Promise {\n if (!this.controller) {\n return Platform.DevToolsPath.EmptyUrlString;\n }\n\n // target.inspectedURL is reliably populated, however it lacks any url #hash\n const inspectedURL = this.controller.primaryPageTarget.inspectedURL();\n\n // We'll use the navigationHistory to acquire the current URL including hash\n const resourceTreeModel = this.controller.primaryPageTarget.model(SDK.ResourceTreeModel.ResourceTreeModel);\n const navHistory = resourceTreeModel && await resourceTreeModel.navigationHistory();\n if (!resourceTreeModel || !navHistory) {\n return inspectedURL;\n }\n\n const {currentIndex, entries} = navHistory;\n const navigationEntry = entries[currentIndex];\n return navigationEntry.url as Platform.DevToolsPath.UrlString;\n }\n\n async #navigateToAboutBlank(): Promise {\n const aboutBlankNavigationComplete = new Promise(async (resolve, reject) => {\n if (!this.controller) {\n reject('Could not find TimelineController');\n return;\n }\n const target = this.controller.primaryPageTarget;\n const resourceModel = target.model(SDK.ResourceTreeModel.ResourceTreeModel);\n if (!resourceModel) {\n reject('Could not load resourceModel');\n return;\n }\n\n // To clear out the page and any state from prior test runs, we\n // navigate to about:blank before initiating the trace recording.\n // Once we have navigated to about:blank, we start recording and\n // then navigate to the original page URL, to ensure we profile the\n // page load.\n function waitForAboutBlank(event: Common.EventTarget.EventTargetEvent):\n void {\n if (event.data.url === 'about:blank') {\n resolve();\n } else {\n reject(`Unexpected navigation to ${event.data.url}`);\n }\n resourceModel?.removeEventListener(SDK.ResourceTreeModel.Events.FrameNavigated, waitForAboutBlank);\n }\n resourceModel.addEventListener(SDK.ResourceTreeModel.Events.FrameNavigated, waitForAboutBlank);\n await resourceModel.navigate('about:blank' as Platform.DevToolsPath.UrlString);\n });\n await aboutBlankNavigationComplete;\n }\n\n async #startCPUProfilingRecording(): Promise {\n try {\n this.cpuProfiler = UI.Context.Context.instance().flavor(SDK.CPUProfilerModel.CPUProfilerModel);\n if (!this.cpuProfiler) {\n // If there is no isolate selected, we will profile the first isolate that devtools connects to.\n // If we profile all target, but this will cause some bugs like time for the function is calculated wrong,\n // because the profiles will be concated and sorted together, so the total time will be amplified.\n // Multiple targets problem might happen when you inspect multiple node servers on different port at same time,\n // or when you let DevTools listen to both locolhost:9229 & 127.0.0.1:9229.\n const firstNodeTarget =\n SDK.TargetManager.TargetManager.instance().targets().find(target => target.type() === SDK.Target.Type.Node);\n if (!firstNodeTarget) {\n throw new Error('Could not load any Node target.');\n }\n if (firstNodeTarget) {\n this.cpuProfiler = firstNodeTarget.model(SDK.CPUProfilerModel.CPUProfilerModel);\n }\n }\n\n this.setUIControlsEnabled(false);\n this.hideLandingPage();\n if (!this.cpuProfiler) {\n throw new Error('No Node target is found.');\n }\n await SDK.TargetManager.TargetManager.instance().suspendAllTargets('performance-timeline');\n await this.cpuProfiler.startRecording();\n\n this.recordingStarted();\n } catch (e) {\n await this.recordingFailed(e.message);\n }\n }\n\n async #startTraceRecording(): Promise {\n try {\n // We record against the root target, but also need to use the\n // primaryPageTarget to inspect the current URL. For more info, see the\n // JSDoc comment on the TimelineController constructor.\n const rootTarget = SDK.TargetManager.TargetManager.instance().rootTarget();\n const primaryPageTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();\n\n if (!primaryPageTarget) {\n throw new Error('Could not load primary page target.');\n }\n if (!rootTarget) {\n throw new Error('Could not load root target.');\n }\n\n if (UIDevtoolsUtils.isUiDevTools()) {\n this.controller = new UIDevtoolsController(rootTarget, primaryPageTarget, this);\n } else {\n this.controller = new TimelineController(rootTarget, primaryPageTarget, this);\n }\n this.setUIControlsEnabled(false);\n this.hideLandingPage();\n if (!this.controller) {\n throw new Error('Could not create Timeline controller');\n }\n\n const urlToTrace = await this.#evaluateInspectedURL();\n // If we are doing \"Reload & record\", we first navigate the page to\n // about:blank. This is to ensure any data on the timeline from any\n // previous performance recording is lost, avoiding the problem where a\n // timeline will show data & screenshots from a previous page load that\n // was not relevant.\n if (this.recordingPageReload) {\n await this.#navigateToAboutBlank();\n }\n const recordingOptions = {\n enableJSSampling: !this.disableCaptureJSProfileSetting.get(),\n capturePictures: this.captureLayersAndPicturesSetting.get(),\n captureFilmStrip: this.showScreenshotsSetting.get(),\n };\n // Order is important here: we tell the controller to start recording, which enables tracing.\n const response = await this.controller.startRecording(recordingOptions);\n if (response.getError()) {\n throw new Error(response.getError());\n }\n // Once we get here, we know tracing is active.\n // This is when, if the user has hit \"Reload & Record\" that we now need to navigate to the original URL.\n // If the user has just hit \"record\", we don't do any navigating.\n const recordingConfig = this.recordingPageReload ? {navigateToUrl: urlToTrace} : undefined;\n this.recordingStarted(recordingConfig);\n } catch (e) {\n await this.recordingFailed(e.message);\n }\n }\n\n private async startRecording(): Promise {\n console.assert(!this.statusPane, 'Status pane is already opened.');\n this.setState(State.StartPending);\n this.showRecordingStarted();\n\n if (isNode) {\n await this.#startCPUProfilingRecording();\n } else {\n await this.#startTraceRecording();\n }\n }\n\n private async stopRecording(): Promise {\n if (this.statusPane) {\n this.statusPane.finish();\n this.statusPane.updateStatus(i18nString(UIStrings.stoppingTimeline));\n this.statusPane.updateProgressBar(i18nString(UIStrings.received), 0);\n }\n this.setState(State.StopPending);\n if (this.controller) {\n this.performanceModel = this.controller.getPerformanceModel();\n await this.controller.stopRecording();\n this.setUIControlsEnabled(true);\n await this.controller.dispose();\n this.controller = null;\n return;\n }\n if (this.cpuProfiler) {\n const profile = await this.cpuProfiler.stopRecording();\n this.setState(State.Idle);\n this.loadFromCpuProfile(profile);\n\n this.setUIControlsEnabled(true);\n this.cpuProfiler = null;\n\n await SDK.TargetManager.TargetManager.instance().resumeAllTargets();\n }\n }\n\n private async recordingFailed(error: string, rawEvents?: TraceEngine.Types.TraceEvents.TraceEventData[]):\n Promise {\n if (this.statusPane) {\n this.statusPane.remove();\n }\n this.statusPane = new StatusPane(\n {\n description: error,\n buttonText: i18nString(UIStrings.close),\n buttonDisabled: false,\n showProgress: undefined,\n showTimer: undefined,\n },\n // When recording failed, we should load null to go back to the landing page.\n async () => {\n this.statusPane?.remove();\n await this.loadingComplete(\n /* no collectedEvents */[],\n /* tracingModel= */ null,\n /* exclusiveFilter= */ null,\n /* isCpuProfile= */ false,\n /* recordingStartTime= */ null,\n /* metadata= */ null);\n });\n this.statusPane.showPane(this.statusPaneContainer);\n this.statusPane.updateStatus(i18nString(UIStrings.recordingFailed));\n\n if (rawEvents) {\n this.statusPane.enableDownloadOfEvents(rawEvents);\n }\n\n this.setState(State.RecordingFailed);\n this.performanceModel = null;\n this.traceLoadStart = null;\n this.setUIControlsEnabled(true);\n if (this.controller) {\n await this.controller.dispose();\n this.controller = null;\n }\n // Ensure we resume all targets, otherwise DevTools remains unresponsive in the event of an error.\n void SDK.TargetManager.TargetManager.instance().resumeAllTargets();\n }\n\n private onSuspendStateChanged(): void {\n this.updateTimelineControls();\n }\n\n private consoleProfileFinished(data: SDK.CPUProfilerModel.ProfileFinishedData): void {\n this.loadFromCpuProfile(data.cpuProfile, data.title);\n void UI.InspectorView.InspectorView.instance().showPanel('timeline');\n }\n\n private updateTimelineControls(): void {\n this.toggleRecordAction.setToggled(this.state === State.Recording);\n this.toggleRecordAction.setEnabled(this.state === State.Recording || this.state === State.Idle);\n this.recordReloadAction.setEnabled(isNode ? false : this.state === State.Idle);\n this.#historyManager.setEnabled(this.state === State.Idle);\n this.clearButton.setEnabled(this.state === State.Idle);\n this.panelToolbar.setEnabled(this.state !== State.Loading);\n this.panelRightToolbar.setEnabled(this.state !== State.Loading);\n this.dropTarget.setEnabled(this.state === State.Idle);\n this.loadButton.setEnabled(this.state === State.Idle);\n this.saveButton.setEnabled(this.state === State.Idle && Boolean(this.performanceModel));\n }\n\n async toggleRecording(): Promise {\n if (this.state === State.Idle) {\n this.recordingPageReload = false;\n await this.startRecording();\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.TimelineStarted);\n } else if (this.state === State.Recording) {\n await this.stopRecording();\n }\n }\n\n recordReload(): void {\n if (this.state !== State.Idle) {\n return;\n }\n this.recordingPageReload = true;\n void this.startRecording();\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.TimelinePageReloadStarted);\n }\n\n private onClearButton(): void {\n this.#historyManager.clear();\n this.clear();\n }\n\n private onFixMe(): void {\n if (!this.performanceModel) {\n return;\n }\n this.flameChart.fixMe();\n }\n\n private clear(): void {\n if (this.statusPane) {\n this.statusPane.remove();\n }\n this.showLandingPage();\n this.reset();\n }\n\n private reset(): void {\n PerfUI.LineLevelProfile.Performance.instance().reset();\n if (this.#sourceMapsResolver) {\n this.#sourceMapsResolver.removeEventListener(\n NodeNamesUpdated.eventName, this.#onSourceMapsNodeNamesResolvedBound);\n this.#sourceMapsResolver.uninstall();\n this.#sourceMapsResolver = null;\n }\n this.setModel(null);\n }\n\n #applyActiveFilters(\n traceIsGeneric: boolean,\n exclusiveFilter: TimelineModel.TimelineModelFilter.TimelineModelFilter|null = null): void {\n if (traceIsGeneric || Root.Runtime.experiments.isEnabled('timeline-show-all-events')) {\n return;\n }\n\n const newActiveFilters = exclusiveFilter ? [exclusiveFilter] : [\n TimelineUIUtils.visibleEventsFilter(),\n ];\n\n ActiveFilters.instance().setFilters(newActiveFilters);\n }\n\n applyFilters(\n _perfModel: PerformanceModel|null,\n exclusiveFilter: TimelineModel.TimelineModelFilter.TimelineModelFilter|null = null): void {\n // TODO: this method is maintained purely for a set of layout tests that\n // use it. Once these tests have been replaced or migrated into DevTools\n // unit tests, we can remove this applyFilters() method.\n // http/tests/devtools/a11y-axe-core/performance/performance-pane-a11y-test.js\n // http/tests/devtools/a11y-axe-core/performance/performance_event_log_a11y_test.js\n // http/tests/devtools/tracing/category-filter.js\n // http/tests/devtools/tracing/timeline-js/timeline-open-function-call.js\n // http/tests/devtools/tracing/timeline-misc/timeline-filtering-self-time.js\n // http/tests/devtools/tracing/timeline-misc/timeline-filtering.js\n // http/tests/devtools/tracing/timeline-misc/timeline-range-stats.js\n this.#applyActiveFilters(false, exclusiveFilter);\n }\n\n setModel(\n model: PerformanceModel|null, exclusiveFilter: TimelineModel.TimelineModelFilter.TimelineModelFilter|null = null,\n traceEngineIndex: number = -1): void {\n this.performanceModel = model;\n this.#traceEngineActiveTraceIndex = traceEngineIndex;\n const traceParsedData = this.#traceEngineModel.traceParsedData(this.#traceEngineActiveTraceIndex);\n const isCpuProfile = this.#traceEngineModel.metadata(this.#traceEngineActiveTraceIndex)?.dataOrigin ===\n TraceEngine.Types.File.DataOrigin.CPUProfile;\n\n this.#minimapComponent.reset();\n // Order is important: the bounds must be set before we initiate any UI\n // rendering.\n if (traceParsedData) {\n TraceBounds.TraceBounds.BoundsManager.instance().resetWithNewBounds(\n traceParsedData.Meta.traceBounds,\n );\n\n // Since we have a single instance to EntriesFilter, combine both SyntheticEvent to Node maps\n const samplesAndRendererEventsEntryToNodeMap =\n new Map([...traceParsedData.Samples.entryToNode, ...traceParsedData.Renderer.entryToNode]);\n TraceEngine.EntriesFilter.EntriesFilter.maybeInstance({entryToNodeMap: samplesAndRendererEventsEntryToNodeMap});\n\n this.#applyActiveFilters(traceParsedData.Meta.traceIsGeneric, exclusiveFilter);\n }\n if (model) {\n this.searchableViewInternal.showWidget();\n } else {\n this.searchableViewInternal.hideWidget();\n this.fixMeButtonAdded = false;\n this.panelToolbar.removeToolbarItem(this.fixMeButton);\n }\n this.flameChart.setModel(model, traceParsedData, isCpuProfile);\n this.flameChart.setSelection(null);\n\n // Set up line level profiling with CPU profiles, if we found any.\n PerfUI.LineLevelProfile.Performance.instance().reset();\n if (traceParsedData && traceParsedData.Samples.profilesInProcess.size) {\n const primaryPageTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();\n // Gather up all CPU Profiles we found when parsing this trace.\n const cpuProfiles =\n Array.from(traceParsedData.Samples.profilesInProcess).flatMap(([_processId, threadsInProcess]) => {\n const profiles = Array.from(threadsInProcess.values()).map(profileData => profileData.parsedProfile);\n return profiles;\n });\n for (const profile of cpuProfiles) {\n PerfUI.LineLevelProfile.Performance.instance().appendCPUProfile(profile, primaryPageTarget);\n }\n }\n\n this.updateOverviewControls();\n if (this.flameChart) {\n this.flameChart.resizeToPreferredHeights();\n }\n\n // Set the initial zoom and if we are using breadcrumbs, create the initial breadcrum.\n // We expect traceParsedData to always exist, this check is to keep TS happy.\n if (traceParsedData) {\n if (this.#minimapComponent.breadcrumbsActivated) {\n this.#minimapComponent.addInitialBreadcrumb();\n }\n\n // To calculate the activity we might want to zoom in, we find the last\n // main thread. Or we find the CPU Profile thread, for e.g. Node traces.\n const mainThreadTypes = [\n TraceEngine.Handlers.Threads.ThreadType.MAIN_THREAD,\n TraceEngine.Handlers.Threads.ThreadType.CPU_PROFILE,\n ];\n const lastMainThread = TraceEngine.Handlers.Threads.threadsInTrace(traceParsedData)\n .filter(data => mainThreadTypes.includes(data.type))\n .at(-1);\n if (lastMainThread) {\n const zoomedInBounds = TraceEngine.Extras.MainThreadActivity.calculateWindow(\n traceParsedData.Meta.traceBounds, lastMainThread.entries);\n\n TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(zoomedInBounds);\n }\n }\n this.updateTimelineControls();\n }\n\n private recordingStarted(config?: {navigateToUrl: Platform.DevToolsPath.UrlString}): void {\n if (config && this.recordingPageReload && this.controller) {\n // If the user hit \"Reload & record\", by this point we have:\n // 1. Navigated to about:blank\n // 2. Initiated tracing.\n // We therefore now should navigate back to the original URL that the user wants to profile.\n const resourceModel = this.controller?.primaryPageTarget.model(SDK.ResourceTreeModel.ResourceTreeModel);\n if (!resourceModel) {\n void this.recordingFailed('Could not navigate to original URL');\n return;\n }\n // We don't need to await this because we are purposefully showing UI\n // progress as the page loads & tracing is underway.\n void resourceModel.navigate(config.navigateToUrl);\n }\n\n this.reset();\n this.setState(State.Recording);\n this.showRecordingStarted();\n if (this.statusPane) {\n this.statusPane.enableAndFocusButton();\n this.statusPane.updateStatus(i18nString(UIStrings.profiling));\n this.statusPane.updateProgressBar(i18nString(UIStrings.bufferUsage), 0);\n this.statusPane.startTimer();\n }\n this.hideLandingPage();\n }\n\n recordingProgress(usage: number): void {\n if (this.statusPane) {\n this.statusPane.updateProgressBar(i18nString(UIStrings.bufferUsage), usage * 100);\n }\n }\n\n private showLandingPage(): void {\n this.updateSettingsPaneVisibility();\n if (this.landingPage) {\n this.landingPage.show(this.statusPaneContainer);\n return;\n }\n\n function encloseWithTag(tagName: string, contents: string): HTMLElement {\n const e = document.createElement(tagName);\n e.textContent = contents;\n return e;\n }\n\n const learnMoreNode = UI.XLink.XLink.create(\n 'https://developer.chrome.com/docs/devtools/evaluate-performance/', i18nString(UIStrings.learnmore), undefined,\n undefined, 'learn-more');\n\n const recordKey = encloseWithTag(\n 'b',\n UI.ShortcutRegistry.ShortcutRegistry.instance().shortcutsForAction('timeline.toggle-recording')[0].title());\n const reloadKey = encloseWithTag(\n 'b', UI.ShortcutRegistry.ShortcutRegistry.instance().shortcutsForAction('timeline.record-reload')[0].title());\n const navigateNode = encloseWithTag('b', i18nString(UIStrings.wasd));\n\n this.landingPage = new UI.Widget.VBox();\n this.landingPage.contentElement.classList.add('timeline-landing-page', 'fill');\n const centered = this.landingPage.contentElement.createChild('div');\n\n const recordButton = UI.UIUtils.createInlineButton(UI.Toolbar.Toolbar.createActionButton(this.toggleRecordAction));\n const reloadButton =\n UI.UIUtils.createInlineButton(UI.Toolbar.Toolbar.createActionButtonForId('timeline.record-reload'));\n\n centered.createChild('p').appendChild(i18n.i18n.getFormatLocalizedString(\n str_, UIStrings.clickTheRecordButtonSOrHitSTo, {PH1: recordButton, PH2: recordKey}));\n\n centered.createChild('p').appendChild(i18n.i18n.getFormatLocalizedString(\n str_, UIStrings.clickTheReloadButtonSOrHitSTo, {PH1: reloadButton, PH2: reloadKey}));\n\n centered.createChild('p').appendChild(i18n.i18n.getFormatLocalizedString(\n str_, UIStrings.afterRecordingSelectAnAreaOf, {PH1: navigateNode, PH2: learnMoreNode}));\n\n if (isNode) {\n const previewSection = new PanelFeedback.PanelFeedback.PanelFeedback();\n previewSection.data = {\n feedbackUrl: 'https://crbug.com/1354548' as Platform.DevToolsPath.UrlString,\n quickStartUrl: 'https://goo.gle/js-profiler-deprecation' as Platform.DevToolsPath.UrlString,\n quickStartLinkText: i18nString(UIStrings.learnmore),\n };\n centered.appendChild(previewSection);\n const feedbackButton = new PanelFeedback.FeedbackButton.FeedbackButton();\n feedbackButton.data = {\n feedbackUrl: 'https://crbug.com/1354548' as Platform.DevToolsPath.UrlString,\n };\n centered.appendChild(feedbackButton);\n }\n\n this.landingPage.show(this.statusPaneContainer);\n }\n\n private hideLandingPage(): void {\n this.landingPage.detach();\n\n // Hide pane settings in trace view to conserve UI space, but preserve underlying setting.\n this.showSettingsPaneButton?.setToggled(false);\n this.settingsPane?.hideWidget();\n }\n\n async loadingStarted(): Promise {\n this.hideLandingPage();\n\n if (this.statusPane) {\n this.statusPane.remove();\n }\n this.statusPane = new StatusPane(\n {\n showProgress: true,\n showTimer: undefined,\n buttonDisabled: undefined,\n buttonText: undefined,\n description: undefined,\n },\n () => this.cancelLoading());\n this.statusPane.showPane(this.statusPaneContainer);\n this.statusPane.updateStatus(i18nString(UIStrings.loadingProfile));\n // FIXME: make loading from backend cancelable as well.\n if (!this.loader) {\n this.statusPane.finish();\n }\n this.traceLoadStart = TraceEngine.Types.Timing.MilliSeconds(performance.now());\n await this.loadingProgress(0);\n }\n\n async loadingProgress(progress?: number): Promise {\n if (typeof progress === 'number' && this.statusPane) {\n this.statusPane.updateProgressBar(i18nString(UIStrings.received), progress * 100);\n }\n }\n\n async processingStarted(): Promise {\n if (this.statusPane) {\n this.statusPane.updateStatus(i18nString(UIStrings.processingProfile));\n }\n }\n\n #onSourceMapsNodeNamesResolved(): void {\n this.flameChart.updateColorMapper();\n }\n\n async loadingComplete(\n collectedEvents: TraceEngine.Types.TraceEvents.TraceEventData[],\n tracingModel: TraceEngine.Legacy.TracingModel|null,\n exclusiveFilter: TimelineModel.TimelineModelFilter.TimelineModelFilter|null = null, isCpuProfile: boolean,\n recordingStartTime: number|null, metadata: TraceEngine.Types.File.MetaData|null): Promise {\n this.#traceEngineModel.resetProcessor();\n SourceMapsResolver.clearResolvedNodeNames();\n\n delete this.loader;\n\n // If the user just recorded this trace via the record UI, the state will\n // be StopPending. Whereas if it was an existing trace they loaded via a\n // file, it will be State.Loading. This means we can tell the recording is\n // fresh by checking the state value.\n const recordingIsFresh = this.state === State.StopPending;\n\n this.setState(State.Idle);\n\n if (!tracingModel) {\n this.clear();\n return;\n }\n\n // TODO(b.corp.google.com/issues/313757110): Apply annotations from the file if they exist in the metadata.\n\n if (!this.performanceModel) {\n this.performanceModel = new PerformanceModel();\n }\n\n metadata = metadata ?\n metadata :\n await TraceEngine.Extras.Metadata.forNewRecording(isCpuProfile, recordingStartTime ?? undefined);\n try {\n // Run the new engine in parallel with the parsing done in the performanceModel\n await Promise.all([\n // Calling setTracingModel now and setModel so much later, leads to several problems due to addEventListener order being unexpected\n // TODO(paulirish): Resolve this, or just wait for the death of tracingModel. :)\n this.performanceModel.setTracingModel(tracingModel, recordingIsFresh),\n this.#executeNewTraceEngine(collectedEvents, recordingIsFresh, metadata),\n ]);\n\n // This code path is only executed when a new trace is recorded/imported,\n // so we know that the active index will be the size of the model because\n // the newest trace will be automatically set to active.\n this.#traceEngineActiveTraceIndex = this.#traceEngineModel.size() - 1;\n\n this.setModel(this.performanceModel, exclusiveFilter, this.#traceEngineActiveTraceIndex);\n\n if (this.statusPane) {\n this.statusPane.remove();\n }\n this.statusPane = null;\n\n const traceData = this.#traceEngineModel.traceParsedData(this.#traceEngineActiveTraceIndex);\n if (!traceData) {\n throw new Error(`Could not get trace data at index ${this.#traceEngineActiveTraceIndex}`);\n }\n\n // Set up SourceMapsResolver to ensure we resolve any function names in\n // profile calls.\n this.#sourceMapsResolver = new SourceMapsResolver(traceData);\n this.#sourceMapsResolver.addEventListener(NodeNamesUpdated.eventName, this.#onSourceMapsNodeNamesResolvedBound);\n await this.#sourceMapsResolver.install();\n\n // We store the Performance Model and the index of the active trace.\n // However we also pass in the full trace data because we use it to build\n // the preview overview thumbnail of the trace that gets shown in the UI.\n this.#historyManager.addRecording({\n data: {\n legacyModel: this.performanceModel,\n traceParseDataIndex: this.#traceEngineActiveTraceIndex,\n },\n filmStripForPreview: TraceEngine.Extras.FilmStrip.fromTraceData(traceData),\n traceParsedData: traceData,\n startTime: recordingStartTime ?? null,\n });\n } catch (error) {\n // Try to get the raw events: if we errored during the parsing stage, it\n // is useful to get access to the raw events to download the trace. This\n // allows us to debug crashes!\n // Because we don't know where the error came from, we wrap it in a\n // try-catch to protect against the tracing model erroring.\n let rawEvents: TraceEngine.Types.TraceEvents.TraceEventData[]|undefined = undefined;\n try {\n rawEvents = tracingModel.allRawEvents() as unknown as TraceEngine.Types.TraceEvents.TraceEventData[];\n } catch {\n }\n\n void this.recordingFailed(error.message, rawEvents);\n console.error(error);\n } finally {\n this.recordTraceLoadMetric();\n }\n }\n\n recordTraceLoadMetric(): void {\n if (!this.traceLoadStart) {\n return;\n }\n const start = this.traceLoadStart;\n // Right *now* is the end of trace parsing and model building, but the flamechart rendering\n // isn't complete yet. To capture that we'll do a rAF+setTimeout to give the most accurate timestamp\n // for the first paint of the flamechart\n requestAnimationFrame(() => {\n setTimeout(() => {\n const end = TraceEngine.Types.Timing.MilliSeconds(performance.now());\n const measure = performance.measure('TraceLoad', {start, end});\n const duration = TraceEngine.Types.Timing.MilliSeconds(measure.duration);\n this.element.dispatchEvent(new TraceLoadEvent(duration));\n Host.userMetrics.performanceTraceLoad(measure);\n }, 0);\n });\n }\n\n async #executeNewTraceEngine(\n collectedEvents: TraceEngine.Types.TraceEvents.TraceEventData[], isFreshRecording: boolean,\n metadata: TraceEngine.Types.File.MetaData): Promise {\n return this.#traceEngineModel.parse(\n collectedEvents,\n {\n metadata,\n isFreshRecording,\n },\n );\n }\n\n loadingCompleteForTest(): void {\n // Not implemented, added only for allowing the TimelineTestRunner\n // to be in sync when a trace load is finished.\n }\n private showRecordingStarted(): void {\n if (this.statusPane) {\n this.statusPane.remove();\n }\n this.statusPane = new StatusPane(\n {\n showTimer: true,\n showProgress: true,\n buttonDisabled: true,\n description: undefined,\n buttonText: undefined,\n },\n () => this.stopRecording());\n this.statusPane.showPane(this.statusPaneContainer);\n this.statusPane.updateStatus(i18nString(UIStrings.initializingProfiler));\n }\n\n private cancelLoading(): void {\n if (this.loader) {\n void this.loader.cancel();\n }\n }\n\n private async loadEventFired(\n event: Common.EventTarget\n .EventTargetEvent<{resourceTreeModel: SDK.ResourceTreeModel.ResourceTreeModel, loadTime: number}>):\n Promise {\n if (this.state !== State.Recording || !this.recordingPageReload || !this.controller ||\n this.controller.primaryPageTarget !== event.data.resourceTreeModel.target()) {\n return;\n }\n const controller = this.controller;\n await new Promise(r => window.setTimeout(r, this.millisecondsToRecordAfterLoadEvent));\n\n // Check if we're still in the same recording session.\n if (controller !== this.controller || this.state !== State.Recording) {\n return;\n }\n void this.stopRecording();\n }\n\n private frameForSelection(selection: TimelineSelection): TraceEngine.Handlers.ModelHandlers.Frames.TimelineFrame\n |null {\n if (TimelineSelection.isFrameObject(selection.object)) {\n return selection.object;\n }\n if (TimelineSelection.isRangeSelection(selection.object) ||\n TimelineSelection.isSyntheticNetworkRequestDetailsEventSelection(selection.object)) {\n return null;\n }\n if (TimelineSelection.isTraceEventSelection(selection.object)) {\n if (!this.performanceModel) {\n return null;\n }\n const traceData = this.#traceEngineModel.traceParsedData(this.#traceEngineActiveTraceIndex);\n if (!traceData) {\n return null;\n }\n // If the user has selected a time range, the frame we want is the last\n // frame in that time window, hence why the window we look for is the\n // endTime to the endTime.\n const endTimeMicro = TraceEngine.Helpers.Timing.millisecondsToMicroseconds(selection.endTime);\n const lastFrameInSelection = TraceEngine.Handlers.ModelHandlers.Frames\n .framesWithinWindow(\n traceData.Frames.frames,\n endTimeMicro,\n endTimeMicro,\n )\n .at(0);\n return lastFrameInSelection || null;\n }\n console.assert(false, 'Should never be reached');\n return null;\n }\n\n jumpToFrame(offset: number): true|undefined {\n const currentFrame = this.selection && this.frameForSelection(this.selection);\n if (!currentFrame) {\n return;\n }\n const traceData = this.#traceEngineModel.traceParsedData(this.#traceEngineActiveTraceIndex);\n if (!traceData) {\n return;\n }\n let index = traceData.Frames.frames.indexOf(currentFrame);\n console.assert(index >= 0, 'Can\\'t find current frame in the frame list');\n index = Platform.NumberUtilities.clamp(index + offset, 0, traceData.Frames.frames.length - 1);\n const frame = traceData.Frames.frames[index];\n this.#revealTimeRange(\n TraceEngine.Helpers.Timing.microSecondsToMilliseconds(frame.startTime),\n TraceEngine.Helpers.Timing.microSecondsToMilliseconds(frame.endTime));\n this.select(TimelineSelection.fromFrame(frame));\n return true;\n }\n\n select(selection: TimelineSelection|null): void {\n this.selection = selection;\n this.flameChart.setSelection(selection);\n }\n\n selectEntryAtTime(events: TraceEngine.Types.TraceEvents.TraceEventData[]|null, time: number): void {\n if (!events) {\n return;\n }\n\n if (events.length === 0) {\n this.select(null);\n return;\n }\n\n // Find best match, then backtrack to the first visible entry.\n for (let index = Platform.ArrayUtilities.upperBound(events, time, (time, event) => time - event.ts) - 1; index >= 0;\n --index) {\n const event = events[index];\n const {endTime} = TraceEngine.Helpers.Timing.eventTimingsMilliSeconds(event);\n if (TraceEngine.Legacy.TracingModel.isTopLevelEvent(event) && endTime < time) {\n break;\n }\n if (ActiveFilters.instance().isVisible(event) && endTime >= time) {\n this.select(TimelineSelection.fromTraceEvent(event));\n return;\n }\n }\n this.select(null);\n }\n\n highlightEvent(event: TraceEngine.Legacy.Event|null): void {\n this.flameChart.highlightEvent(event);\n }\n\n #revealTimeRange(startTime: TraceEngine.Types.Timing.MilliSeconds, endTime: TraceEngine.Types.Timing.MilliSeconds):\n void {\n const traceBoundsState = TraceBounds.TraceBounds.BoundsManager.instance().state();\n if (!traceBoundsState) {\n return;\n }\n const traceWindow = traceBoundsState.milli.timelineTraceWindow;\n\n let offset = 0;\n if (traceWindow.max < endTime) {\n offset = endTime - traceWindow.max;\n } else if (traceWindow.min > startTime) {\n offset = startTime - traceWindow.min;\n }\n TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(\n TraceEngine.Helpers.Timing.traceWindowFromMilliSeconds(\n TraceEngine.Types.Timing.MilliSeconds(traceWindow.min + offset),\n TraceEngine.Types.Timing.MilliSeconds(traceWindow.max + offset),\n ),\n {\n shouldAnimate: true,\n },\n );\n }\n\n private handleDrop(dataTransfer: DataTransfer): void {\n const items = dataTransfer.items;\n if (!items.length) {\n return;\n }\n const item = items[0];\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.PerfPanelTraceImported);\n if (item.kind === 'string') {\n const url = dataTransfer.getData('text/uri-list') as Platform.DevToolsPath.UrlString;\n if (new Common.ParsedURL.ParsedURL(url).isValid) {\n void this.loadFromURL(url);\n }\n } else if (item.kind === 'file') {\n const file = items[0].getAsFile();\n if (!file) {\n return;\n }\n void this.loadFromFile(file);\n }\n }\n}\n\nexport const enum State {\n Idle = 'Idle',\n StartPending = 'StartPending',\n Recording = 'Recording',\n StopPending = 'StopPending',\n Loading = 'Loading',\n RecordingFailed = 'RecordingFailed',\n}\n\n// Define row and header height, should be in sync with styles for timeline graphs.\nexport const rowHeight = 18;\n\nexport const headerHeight = 20;\nexport interface TimelineModeViewDelegate {\n select(selection: TimelineSelection|null): void;\n selectEntryAtTime(events: TraceEngine.Types.TraceEvents.TraceEventData[]|null, time: number): void;\n highlightEvent(event: TraceEngine.Legacy.CompatibleTraceEvent|null): void;\n}\n\nexport class StatusPane extends UI.Widget.VBox {\n private status: HTMLElement;\n private time: Element|undefined;\n private progressLabel!: Element;\n private progressBar!: Element;\n private readonly description: HTMLElement|undefined;\n private button: HTMLButtonElement;\n private downloadTraceButton: HTMLButtonElement;\n private startTime!: number;\n private timeUpdateTimer?: number;\n #rawEvents?: TraceEngine.Types.TraceEvents.TraceEventData[];\n\n constructor(\n options: {\n showTimer?: boolean,\n showProgress?: boolean,\n description?: string,\n buttonText?: string,\n buttonDisabled?: boolean,\n },\n buttonCallback: () => (Promise| void)) {\n super(true);\n\n this.contentElement.classList.add('timeline-status-dialog');\n\n const statusLine = this.contentElement.createChild('div', 'status-dialog-line status');\n statusLine.createChild('div', 'label').textContent = i18nString(UIStrings.status);\n this.status = statusLine.createChild('div', 'content');\n UI.ARIAUtils.markAsStatus(this.status);\n\n if (options.showTimer) {\n const timeLine = this.contentElement.createChild('div', 'status-dialog-line time');\n timeLine.createChild('div', 'label').textContent = i18nString(UIStrings.time);\n this.time = timeLine.createChild('div', 'content');\n }\n\n if (options.showProgress) {\n const progressLine = this.contentElement.createChild('div', 'status-dialog-line progress');\n this.progressLabel = progressLine.createChild('div', 'label');\n this.progressBar = progressLine.createChild('div', 'indicator-container').createChild('div', 'indicator');\n UI.ARIAUtils.markAsProgressBar(this.progressBar);\n }\n\n if (typeof options.description === 'string') {\n const descriptionLine = this.contentElement.createChild('div', 'status-dialog-line description');\n descriptionLine.createChild('div', 'label').textContent = i18nString(UIStrings.description);\n this.description = descriptionLine.createChild('div', 'content');\n this.description.innerText = options.description;\n }\n\n const buttonContainer = this.contentElement.createChild('div', 'stop-button');\n this.downloadTraceButton = UI.UIUtils.createTextButton(i18nString(UIStrings.downloadAfterError), () => {\n void this.#downloadRawTraceAfterError();\n }, {jslogContext: 'timeline.download-after-error'});\n\n this.downloadTraceButton.disabled = true;\n this.downloadTraceButton.style.visibility = 'hidden';\n\n const buttonText = options.buttonText || i18nString(UIStrings.stop);\n this.button = UI.UIUtils.createTextButton(buttonText, buttonCallback, {\n jslogContext: 'timeline.stop-recording',\n primary: true,\n });\n // Profiling can't be stopped during initialization.\n this.button.disabled = !options.buttonDisabled === false;\n\n buttonContainer.append(this.downloadTraceButton);\n buttonContainer.append(this.button);\n }\n\n finish(): void {\n this.stopTimer();\n this.button.disabled = true;\n }\n\n async #downloadRawTraceAfterError(): Promise {\n if (!this.#rawEvents || this.#rawEvents.length === 0) {\n return;\n }\n const traceStart = Platform.DateUtilities.toISO8601Compact(new Date());\n const fileName = `Trace-Load-Error-${traceStart}.json` as Platform.DevToolsPath.RawPathString;\n const formattedTraceIter = traceJsonGenerator(this.#rawEvents, {});\n const traceAsString = Array.from(formattedTraceIter).join('');\n await Workspace.FileManager.FileManager.instance().save(fileName, traceAsString, true /* forceSaveAs */);\n Workspace.FileManager.FileManager.instance().close(fileName);\n }\n\n enableDownloadOfEvents(rawEvents: TraceEngine.Types.TraceEvents.TraceEventData[]): void {\n this.#rawEvents = rawEvents;\n this.downloadTraceButton.disabled = false;\n this.downloadTraceButton.style.visibility = 'visible';\n }\n\n remove(): void {\n if (this.element.parentNode) {\n (this.element.parentNode as HTMLElement).classList.remove('tinted');\n this.arrangeDialog((this.element.parentNode as HTMLElement));\n }\n this.stopTimer();\n this.element.remove();\n }\n\n showPane(parent: Element): void {\n this.arrangeDialog(parent);\n this.show(parent);\n parent.classList.add('tinted');\n }\n\n enableAndFocusButton(): void {\n this.button.disabled = false;\n this.button.focus();\n }\n\n updateStatus(text: string): void {\n this.status.textContent = text;\n }\n\n updateProgressBar(activity: string, percent: number): void {\n this.progressLabel.textContent = activity;\n (this.progressBar as HTMLElement).style.width = percent.toFixed(1) + '%';\n UI.ARIAUtils.setValueNow(this.progressBar, percent);\n this.updateTimer();\n }\n\n startTimer(): void {\n this.startTime = Date.now();\n this.timeUpdateTimer = window.setInterval(this.updateTimer.bind(this, false), 1000);\n this.updateTimer();\n }\n\n private stopTimer(): void {\n if (!this.timeUpdateTimer) {\n return;\n }\n clearInterval(this.timeUpdateTimer);\n this.updateTimer(true);\n delete this.timeUpdateTimer;\n }\n\n private updateTimer(precise?: boolean): void {\n this.arrangeDialog((this.element.parentNode as HTMLElement));\n if (!this.timeUpdateTimer || !this.time) {\n return;\n }\n const elapsed = (Date.now() - this.startTime) / 1000;\n this.time.textContent = i18nString(UIStrings.ssec, {PH1: elapsed.toFixed(precise ? 1 : 0)});\n }\n\n private arrangeDialog(parent: Element): void {\n const isSmallDialog = parent.clientWidth < 325;\n this.element.classList.toggle('small-dialog', isSmallDialog);\n this.contentElement.classList.toggle('small-dialog', isSmallDialog);\n }\n override wasShown(): void {\n super.wasShown();\n this.registerCSSFiles([timelineStatusDialogStyles]);\n }\n}\n\nlet loadTimelineHandlerInstance: LoadTimelineHandler;\n\nexport class LoadTimelineHandler implements Common.QueryParamHandler.QueryParamHandler {\n static instance(opts: {\n forceNew: boolean|null,\n } = {forceNew: null}): LoadTimelineHandler {\n const {forceNew} = opts;\n if (!loadTimelineHandlerInstance || forceNew) {\n loadTimelineHandlerInstance = new LoadTimelineHandler();\n }\n\n return loadTimelineHandlerInstance;\n }\n\n handleQueryParam(value: string): void {\n void UI.ViewManager.ViewManager.instance().showView('timeline').then(async () => {\n await TimelinePanel.instance().loadFromURL(window.decodeURIComponent(value) as Platform.DevToolsPath.UrlString);\n });\n }\n}\n\nexport class ActionDelegate implements UI.ActionRegistration.ActionDelegate {\n handleAction(context: UI.Context.Context, actionId: string): boolean {\n const panel = context.flavor(TimelinePanel);\n if (panel === null) {\n return false;\n }\n switch (actionId) {\n case 'timeline.toggle-recording':\n void panel.toggleRecording();\n return true;\n case 'timeline.record-reload':\n panel.recordReload();\n return true;\n case 'timeline.save-to-file':\n void panel.saveToFile();\n return true;\n case 'timeline.load-from-file':\n panel.selectFileToLoad();\n return true;\n case 'timeline.jump-to-previous-frame':\n panel.jumpToFrame(-1);\n return true;\n case 'timeline.jump-to-next-frame':\n panel.jumpToFrame(1);\n return true;\n case 'timeline.show-history':\n void panel.showHistory();\n return true;\n case 'timeline.previous-recording':\n panel.navigateHistory(1);\n return true;\n case 'timeline.next-recording':\n panel.navigateHistory(-1);\n return true;\n }\n return false;\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"TimelinePanel.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelinePanel.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAG7C,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,SAAS,MAAM,qCAAqC,CAAC;AACjE,OAAO,KAAK,kBAAkB,MAAM,2DAA2D,CAAC;AAChG,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAC3E,OAAO,KAAK,QAAQ,MAAM,0CAA0C,CAAC;AACrE,OAAO,KAAK,aAAa,MAAM,sDAAsD,CAAC;AACtF,OAAO,KAAK,MAAM,MAAM,+CAA+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;IACf,CAAC;CACF","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/*\n * Copyright (C) 2012 Google Inc. All rights reserved.\n * Copyright (C) 2012 Intel Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as Host from '../../core/host/host.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as Root from '../../core/root/root.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport type * as Protocol from '../../generated/protocol.js';\nimport type * as TimelineModel from '../../models/timeline_model/timeline_model.js';\nimport * as TraceEngine from '../../models/trace/trace.js';\nimport * as Workspace from '../../models/workspace/workspace.js';\nimport * as AnnotationsManager from '../../services/annotations_manager/annotations_manager.js';\nimport * as TraceBounds from '../../services/trace_bounds/trace_bounds.js';\nimport * as Adorners from '../../ui/components/adorners/adorners.js';\nimport * as PanelFeedback from '../../ui/components/panel_feedback/panel_feedback.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as VisualLogging from '../../ui/visual_logging/visual_logging.js';\nimport * as MobileThrottling from '../mobile_throttling/mobile_throttling.js';\n\nimport {ActiveFilters} from './ActiveFilters.js';\nimport {TraceLoadEvent} from './BenchmarkEvents.js';\nimport {SHOULD_SHOW_EASTER_EGG} from './EasterEgg.js';\nimport historyToolbarButtonStyles from './historyToolbarButton.css.js';\nimport {IsolateSelector} from './IsolateSelector.js';\nimport {PerformanceModel} from './PerformanceModel.js';\nimport {cpuprofileJsonGenerator, traceJsonGenerator} from './SaveFileFormatter.js';\nimport {NodeNamesUpdated, SourceMapsResolver} from './SourceMapsResolver.js';\nimport {type Client, TimelineController} from './TimelineController.js';\nimport {TimelineFlameChartView} from './TimelineFlameChartView.js';\nimport {TimelineHistoryManager} from './TimelineHistoryManager.js';\nimport {TimelineLoader} from './TimelineLoader.js';\nimport {TimelineMiniMap} from './TimelineMiniMap.js';\nimport timelinePanelStyles from './timelinePanel.css.js';\nimport {TimelineSelection} from './TimelineSelection.js';\nimport timelineStatusDialogStyles from './timelineStatusDialog.css.js';\nimport {TimelineUIUtils} from './TimelineUIUtils.js';\nimport {UIDevtoolsController} from './UIDevtoolsController.js';\nimport {UIDevtoolsUtils} from './UIDevtoolsUtils.js';\n\nconst UIStrings = {\n /**\n *@description Text that appears when user drag and drop something (for example, a file) in Timeline Panel of the Performance panel\n */\n dropTimelineFileOrUrlHere: 'Drop timeline file or URL here',\n /**\n *@description Title of disable capture jsprofile setting in timeline panel of the performance panel\n */\n disableJavascriptSamples: 'Disable JavaScript samples',\n /**\n *@description Title of capture layers and pictures setting in timeline panel of the performance panel\n */\n enableAdvancedPaint: 'Enable advanced paint instrumentation (slow)',\n /**\n *@description Title of show screenshots setting in timeline panel of the performance panel\n */\n screenshots: 'Screenshots',\n /**\n *@description Text for the memory of the page\n */\n memory: 'Memory',\n /**\n *@description Text to clear content\n */\n clear: 'Clear',\n /**\n *@description A label for a button that fixes something.\n */\n fixMe: 'Fix me',\n /**\n *@description Tooltip text that appears when hovering over the largeicon load button\n */\n loadProfile: 'Load profile…',\n /**\n *@description Tooltip text that appears when hovering over the largeicon download button\n */\n saveProfile: 'Save profile…',\n /**\n *@description Text to take screenshots\n */\n captureScreenshots: 'Capture screenshots',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n showMemoryTimeline: 'Show memory timeline',\n /**\n *@description Tooltip text that appears when hovering over the largeicon settings gear in show settings pane setting in timeline panel of the performance panel\n */\n captureSettings: 'Capture settings',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n disablesJavascriptSampling: 'Disables JavaScript sampling, reduces overhead when running against mobile devices',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n capturesAdvancedPaint: 'Captures advanced paint instrumentation, introduces significant performance overhead',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n network: 'Network:',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n cpu: 'CPU:',\n /**\n *@description Title of the 'Network conditions' tool in the bottom drawer\n */\n networkConditions: 'Network conditions',\n /**\n *@description Text in Timeline Panel of the Performance panel\n *@example {wrong format} PH1\n *@example {ERROR_FILE_NOT_FOUND} PH2\n */\n failedToSaveTimelineSS: 'Failed to save timeline: {PH1} ({PH2})',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n CpuThrottlingIsEnabled: '- CPU throttling is enabled',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n NetworkThrottlingIsEnabled: '- Network throttling is enabled',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n HardwareConcurrencyIsEnabled: '- Hardware concurrency override is enabled',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n SignificantOverheadDueToPaint: '- Significant overhead due to paint instrumentation',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n JavascriptSamplingIsDisabled: '- JavaScript sampling is disabled',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n stoppingTimeline: 'Stopping timeline…',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n received: 'Received',\n /**\n *@description Text to close something\n */\n close: 'Close',\n /**\n *@description Text to download the raw trace files after an error\n */\n downloadAfterError: 'Download raw trace events',\n /**\n *@description Status text to indicate the recording has failed in the Performance panel\n */\n recordingFailed: 'Recording failed',\n /**\n * @description Text to indicate the progress of a profile. Informs the user that we are currently\n * creating a peformance profile.\n */\n profiling: 'Profiling…',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n bufferUsage: 'Buffer usage',\n /**\n *@description Text for an option to learn more about something\n */\n learnmore: 'Learn more',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n wasd: 'WASD',\n /**\n *@description Text in Timeline Panel of the Performance panel\n *@example {record} PH1\n *@example {Ctrl + R} PH2\n */\n clickTheRecordButtonSOrHitSTo: 'Click the record button {PH1} or hit {PH2} to start a new recording.',\n /**\n * @description Text in Timeline Panel of the Performance panel\n * @example {reload button} PH1\n * @example {Ctrl + R} PH2\n */\n clickTheReloadButtonSOrHitSTo: 'Click the reload button {PH1} or hit {PH2} to record the page load.',\n /**\n *@description Text in Timeline Panel of the Performance panel\n *@example {Ctrl + U} PH1\n *@example {Learn more} PH2\n */\n afterRecordingSelectAnAreaOf:\n 'After recording, select an area of interest in the overview by dragging. Then, zoom and pan the timeline with the mousewheel or {PH1} keys. {PH2}',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n loadingProfile: 'Loading profile…',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n processingProfile: 'Processing profile…',\n /**\n *@description Text in Timeline Panel of the Performance panel\n */\n initializingProfiler: 'Initializing profiler…',\n /**\n *@description Text for the status of something\n */\n status: 'Status',\n /**\n *@description Text that refers to the time\n */\n time: 'Time',\n /**\n *@description Text for the description of something\n */\n description: 'Description',\n /**\n *@description Text of an item that stops the running task\n */\n stop: 'Stop',\n /**\n *@description Time text content in Timeline Panel of the Performance panel\n *@example {2.12} PH1\n */\n ssec: '{PH1} sec',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/TimelinePanel.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nlet timelinePanelInstance: TimelinePanel;\nlet isNode: boolean;\n\nexport class TimelinePanel extends UI.Panel.Panel implements Client, TimelineModeViewDelegate {\n private readonly dropTarget: UI.DropTarget.DropTarget;\n private readonly recordingOptionUIControls: UI.Toolbar.ToolbarItem[];\n private state: State;\n private recordingPageReload: boolean;\n private readonly millisecondsToRecordAfterLoadEvent: number;\n private readonly toggleRecordAction: UI.ActionRegistration.Action;\n private readonly recordReloadAction: UI.ActionRegistration.Action;\n readonly #historyManager: TimelineHistoryManager;\n private performanceModel: PerformanceModel|null;\n private disableCaptureJSProfileSetting: Common.Settings.Setting;\n private readonly captureLayersAndPicturesSetting: Common.Settings.Setting;\n private showScreenshotsSetting: Common.Settings.Setting;\n private showMemorySetting: Common.Settings.Setting;\n private readonly panelToolbar: UI.Toolbar.Toolbar;\n private readonly panelRightToolbar: UI.Toolbar.Toolbar;\n private readonly timelinePane: UI.Widget.VBox;\n readonly #minimapComponent = new TimelineMiniMap();\n private readonly statusPaneContainer: HTMLElement;\n private readonly flameChart: TimelineFlameChartView;\n private readonly searchableViewInternal: UI.SearchableView.SearchableView;\n private showSettingsPaneButton!: UI.Toolbar.ToolbarSettingToggle;\n private showSettingsPaneSetting!: Common.Settings.Setting;\n private settingsPane!: UI.Widget.Widget;\n private controller!: TimelineController|null;\n private cpuProfiler!: SDK.CPUProfilerModel.CPUProfilerModel|null;\n private clearButton!: UI.Toolbar.ToolbarButton;\n private fixMeButton: UI.Toolbar.ToolbarButton;\n private fixMeButtonAdded = false;\n private loadButton!: UI.Toolbar.ToolbarButton;\n private saveButton!: UI.Toolbar.ToolbarButton;\n private statusPane!: StatusPane|null;\n private landingPage!: UI.Widget.Widget;\n private loader?: TimelineLoader;\n private showScreenshotsToolbarCheckbox?: UI.Toolbar.ToolbarItem;\n private showMemoryToolbarCheckbox?: UI.Toolbar.ToolbarItem;\n private networkThrottlingSelect?: UI.Toolbar.ToolbarComboBox;\n private cpuThrottlingSelect?: UI.Toolbar.ToolbarComboBox;\n private fileSelectorElement?: HTMLInputElement;\n private selection?: TimelineSelection|null;\n private traceLoadStart!: TraceEngine.Types.Timing.MilliSeconds|null;\n private primaryPageTargetPromiseCallback = (_target: SDK.Target.Target): void => {};\n // Note: this is technically unused, but we need it to define the promiseCallback function above.\n private primaryPageTargetPromise = new Promise(res => {\n this.primaryPageTargetPromiseCallback = res;\n });\n\n #traceEngineModel: TraceEngine.TraceModel.Model;\n // Tracks the index of the trace that the user is currently viewing.\n #traceEngineActiveTraceIndex = -1;\n #sourceMapsResolver: SourceMapsResolver|null = null;\n #onSourceMapsNodeNamesResolvedBound = this.#onSourceMapsNodeNamesResolved.bind(this);\n readonly #onChartPlayableStateChangeBound: (event: Common.EventTarget.EventTargetEvent) => void;\n constructor() {\n super('timeline');\n const adornerContent = document.createElement('span');\n adornerContent.innerHTML = `
💫
`;\n const adorner = new Adorners.Adorner.Adorner();\n adorner.classList.add('fix-perf-icon');\n adorner.data = {\n name: i18nString(UIStrings.fixMe),\n content: adornerContent,\n };\n this.fixMeButton = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.fixMe), adorner);\n this.fixMeButton.addEventListener(UI.Toolbar.ToolbarButton.Events.Click, () => this.onFixMe());\n const config = TraceEngine.Types.Configuration.DEFAULT;\n config.experiments.timelineShowAllEvents = Root.Runtime.experiments.isEnabled('timeline-show-all-events');\n config.experiments.timelineV8RuntimeCallStats =\n Root.Runtime.experiments.isEnabled('timeline-v8-runtime-call-stats');\n this.#traceEngineModel = TraceEngine.TraceModel.Model.createWithAllHandlers(config);\n\n this.element.addEventListener('contextmenu', this.contextMenu.bind(this), false);\n this.dropTarget = new UI.DropTarget.DropTarget(\n this.element, [UI.DropTarget.Type.File, UI.DropTarget.Type.URI],\n i18nString(UIStrings.dropTimelineFileOrUrlHere), this.handleDrop.bind(this));\n\n this.recordingOptionUIControls = [];\n this.state = State.Idle;\n this.recordingPageReload = false;\n this.millisecondsToRecordAfterLoadEvent = 5000;\n this.toggleRecordAction = UI.ActionRegistry.ActionRegistry.instance().getAction('timeline.toggle-recording');\n this.recordReloadAction = UI.ActionRegistry.ActionRegistry.instance().getAction('timeline.record-reload');\n\n this.#historyManager = new TimelineHistoryManager(this.#minimapComponent);\n\n this.performanceModel = null;\n this.traceLoadStart = null;\n\n this.disableCaptureJSProfileSetting =\n Common.Settings.Settings.instance().createSetting('timeline-disable-js-sampling', false);\n this.disableCaptureJSProfileSetting.setTitle(i18nString(UIStrings.disableJavascriptSamples));\n this.captureLayersAndPicturesSetting =\n Common.Settings.Settings.instance().createSetting('timeline-capture-layers-and-pictures', false);\n this.captureLayersAndPicturesSetting.setTitle(i18nString(UIStrings.enableAdvancedPaint));\n\n this.showScreenshotsSetting =\n Common.Settings.Settings.instance().createSetting('timeline-show-screenshots', isNode ? false : true);\n this.showScreenshotsSetting.setTitle(i18nString(UIStrings.screenshots));\n this.showScreenshotsSetting.addChangeListener(this.updateOverviewControls, this);\n\n this.showMemorySetting = Common.Settings.Settings.instance().createSetting('timeline-show-memory', false);\n this.showMemorySetting.setTitle(i18nString(UIStrings.memory));\n this.showMemorySetting.addChangeListener(this.onModeChanged, this);\n\n const timelineToolbarContainer = this.element.createChild('div', 'timeline-toolbar-container');\n timelineToolbarContainer.setAttribute('jslog', `${VisualLogging.toolbar()}`);\n this.panelToolbar = new UI.Toolbar.Toolbar('timeline-main-toolbar', timelineToolbarContainer);\n this.panelToolbar.makeWrappable(true);\n this.panelRightToolbar = new UI.Toolbar.Toolbar('', timelineToolbarContainer);\n if (!isNode) {\n this.createSettingsPane();\n this.updateShowSettingsToolbarButton();\n }\n this.timelinePane = new UI.Widget.VBox();\n this.timelinePane.show(this.element);\n const topPaneElement = this.timelinePane.element.createChild('div', 'hbox');\n topPaneElement.id = 'timeline-overview-panel';\n\n this.#minimapComponent.show(topPaneElement);\n\n this.statusPaneContainer = this.timelinePane.element.createChild('div', 'status-pane-container fill');\n\n this.createFileSelector();\n\n SDK.TargetManager.TargetManager.instance().addModelListener(\n SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.Load, this.loadEventFired, this);\n\n this.flameChart = new TimelineFlameChartView(this);\n this.#onChartPlayableStateChangeBound = this.#onChartPlayableStateChange.bind(this);\n\n this.flameChart.getMainFlameChart().addEventListener(\n PerfUI.FlameChart.Events.ChartPlayableStateChange, this.#onChartPlayableStateChangeBound, this);\n\n this.searchableViewInternal = new UI.SearchableView.SearchableView(this.flameChart, null);\n this.searchableViewInternal.setMinimumSize(0, 100);\n this.searchableViewInternal.element.classList.add('searchable-view');\n this.searchableViewInternal.show(this.timelinePane.element);\n this.flameChart.show(this.searchableViewInternal.element);\n this.flameChart.setSearchableView(this.searchableViewInternal);\n this.searchableViewInternal.hideWidget();\n\n this.onModeChanged();\n this.populateToolbar();\n this.showLandingPage();\n this.updateTimelineControls();\n\n SDK.TargetManager.TargetManager.instance().addEventListener(\n SDK.TargetManager.Events.SuspendStateChanged, this.onSuspendStateChanged, this);\n if (Root.Runtime.experiments.isEnabled('timeline-as-console-profile-result-panel')) {\n const profilerModels = SDK.TargetManager.TargetManager.instance().models(SDK.CPUProfilerModel.CPUProfilerModel);\n for (const model of profilerModels) {\n for (const message of model.registeredConsoleProfileMessages) {\n this.consoleProfileFinished(message);\n }\n }\n SDK.TargetManager.TargetManager.instance().observeModels(\n SDK.CPUProfilerModel.CPUProfilerModel,\n {\n modelAdded: (model: SDK.CPUProfilerModel.CPUProfilerModel) => {\n model.addEventListener(\n SDK.CPUProfilerModel.Events.ConsoleProfileFinished, event => this.consoleProfileFinished(event.data));\n },\n modelRemoved: (_model: SDK.CPUProfilerModel.CPUProfilerModel) => {\n\n },\n },\n );\n }\n SDK.TargetManager.TargetManager.instance().observeTargets({\n targetAdded: (target: SDK.Target.Target) => {\n if (target !== SDK.TargetManager.TargetManager.instance().primaryPageTarget()) {\n return;\n }\n this.primaryPageTargetPromiseCallback(target);\n },\n targetRemoved: (_: SDK.Target.Target) => {},\n });\n }\n\n static instance(opts: {\n forceNew: boolean|null,\n isNode: boolean,\n }|undefined = {forceNew: null, isNode: false}): TimelinePanel {\n const {forceNew, isNode: isNodeMode} = opts;\n isNode = isNodeMode;\n\n if (!timelinePanelInstance || forceNew) {\n timelinePanelInstance = new TimelinePanel();\n }\n\n return timelinePanelInstance;\n }\n\n override searchableView(): UI.SearchableView.SearchableView|null {\n return this.searchableViewInternal;\n }\n\n override wasShown(): void {\n super.wasShown();\n UI.Context.Context.instance().setFlavor(TimelinePanel, this);\n this.registerCSSFiles([timelinePanelStyles]);\n // Record the performance tool load time.\n Host.userMetrics.panelLoaded('timeline', 'DevTools.Launch.Timeline');\n }\n\n override willHide(): void {\n UI.Context.Context.instance().setFlavor(TimelinePanel, null);\n this.#historyManager.cancelIfShowing();\n }\n\n loadFromEvents(events: TraceEngine.TracingManager.EventPayload[]): void {\n if (this.state !== State.Idle) {\n return;\n }\n this.prepareToLoadTimeline();\n this.loader = TimelineLoader.loadFromEvents(events, this);\n }\n\n getFlameChart(): TimelineFlameChartView {\n return this.flameChart;\n }\n\n getMinimap(): TimelineMiniMap {\n return this.#minimapComponent;\n }\n\n #onChartPlayableStateChange(event: Common.EventTarget.EventTargetEvent): void {\n if (event.data) {\n const dateObj = new Date();\n const month = dateObj.getUTCMonth() + 1;\n const day = dateObj.getUTCDate();\n const isAprilFools = (month === 4 && (day === 1 || day === 2)); // Show only on April fools and the next day\n if (isAprilFools && !this.fixMeButtonAdded && SHOULD_SHOW_EASTER_EGG) {\n this.fixMeButtonAdded = true;\n this.panelToolbar.appendToolbarItem(this.fixMeButton);\n }\n } else {\n this.fixMeButtonAdded = false;\n this.panelToolbar.removeToolbarItem(this.fixMeButton);\n }\n }\n\n private loadFromCpuProfile(profile: Protocol.Profiler.Profile|null, title?: string): void {\n if (this.state !== State.Idle) {\n return;\n }\n this.prepareToLoadTimeline();\n this.loader = TimelineLoader.loadFromCpuProfile(profile, this, title);\n }\n\n private setState(state: State): void {\n this.state = state;\n this.updateTimelineControls();\n }\n\n private createSettingCheckbox(setting: Common.Settings.Setting, tooltip: string): UI.Toolbar.ToolbarItem {\n const checkboxItem = new UI.Toolbar.ToolbarSettingCheckbox(setting, tooltip);\n this.recordingOptionUIControls.push(checkboxItem);\n return checkboxItem;\n }\n\n private populateToolbar(): void {\n // Record\n this.panelToolbar.appendToolbarItem(UI.Toolbar.Toolbar.createActionButton(this.toggleRecordAction));\n this.panelToolbar.appendToolbarItem(UI.Toolbar.Toolbar.createActionButton(this.recordReloadAction));\n this.clearButton = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.clear), 'clear');\n this.clearButton.addEventListener(UI.Toolbar.ToolbarButton.Events.Click, () => this.onClearButton());\n this.panelToolbar.appendToolbarItem(this.clearButton);\n\n // Load / Save\n this.loadButton = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.loadProfile), 'import');\n this.loadButton.addEventListener(UI.Toolbar.ToolbarButton.Events.Click, () => {\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.PerfPanelTraceImported);\n this.selectFileToLoad();\n });\n this.saveButton = new UI.Toolbar.ToolbarButton(i18nString(UIStrings.saveProfile), 'download');\n this.saveButton.addEventListener(UI.Toolbar.ToolbarButton.Events.Click, _event => {\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.PerfPanelTraceExported);\n void this.saveToFile();\n });\n this.panelToolbar.appendSeparator();\n this.panelToolbar.appendToolbarItem(this.loadButton);\n this.panelToolbar.appendToolbarItem(this.saveButton);\n\n // History\n this.panelToolbar.appendSeparator();\n this.panelToolbar.appendToolbarItem(this.#historyManager.button());\n this.panelToolbar.registerCSSFiles([historyToolbarButtonStyles]);\n this.panelToolbar.appendSeparator();\n\n // View\n this.panelToolbar.appendSeparator();\n if (!isNode) {\n this.showScreenshotsToolbarCheckbox =\n this.createSettingCheckbox(this.showScreenshotsSetting, i18nString(UIStrings.captureScreenshots));\n this.panelToolbar.appendToolbarItem(this.showScreenshotsToolbarCheckbox);\n }\n\n this.showMemoryToolbarCheckbox =\n this.createSettingCheckbox(this.showMemorySetting, i18nString(UIStrings.showMemoryTimeline));\n this.panelToolbar.appendToolbarItem(this.showMemoryToolbarCheckbox);\n\n // GC\n this.panelToolbar.appendToolbarItem(UI.Toolbar.Toolbar.createActionButtonForId('components.collect-garbage'));\n\n // Isolate selector\n const isolateSelector = new IsolateSelector();\n if (isNode) {\n this.panelToolbar.appendSeparator();\n this.panelToolbar.appendToolbarItem(isolateSelector);\n }\n\n // Settings\n if (!isNode) {\n this.panelRightToolbar.appendSeparator();\n this.panelRightToolbar.appendToolbarItem(this.showSettingsPaneButton);\n }\n }\n\n private createSettingsPane(): void {\n this.showSettingsPaneSetting =\n Common.Settings.Settings.instance().createSetting('timeline-show-settings-toolbar', false);\n this.showSettingsPaneButton = new UI.Toolbar.ToolbarSettingToggle(\n this.showSettingsPaneSetting, 'gear', i18nString(UIStrings.captureSettings), 'gear-filled');\n SDK.NetworkManager.MultitargetNetworkManager.instance().addEventListener(\n SDK.NetworkManager.MultitargetNetworkManager.Events.ConditionsChanged, this.updateShowSettingsToolbarButton,\n this);\n SDK.CPUThrottlingManager.CPUThrottlingManager.instance().addEventListener(\n SDK.CPUThrottlingManager.Events.RateChanged, this.updateShowSettingsToolbarButton, this);\n SDK.CPUThrottlingManager.CPUThrottlingManager.instance().addEventListener(\n SDK.CPUThrottlingManager.Events.HardwareConcurrencyChanged, this.updateShowSettingsToolbarButton, this);\n this.disableCaptureJSProfileSetting.addChangeListener(this.updateShowSettingsToolbarButton, this);\n this.captureLayersAndPicturesSetting.addChangeListener(this.updateShowSettingsToolbarButton, this);\n\n this.settingsPane = new UI.Widget.HBox();\n this.settingsPane.element.classList.add('timeline-settings-pane');\n this.settingsPane.show(this.element);\n\n const captureToolbar = new UI.Toolbar.Toolbar('', this.settingsPane.element);\n captureToolbar.element.classList.add('flex-auto');\n captureToolbar.makeVertical();\n captureToolbar.appendToolbarItem(this.createSettingCheckbox(\n this.disableCaptureJSProfileSetting, i18nString(UIStrings.disablesJavascriptSampling)));\n captureToolbar.appendToolbarItem(\n this.createSettingCheckbox(this.captureLayersAndPicturesSetting, i18nString(UIStrings.capturesAdvancedPaint)));\n\n const throttlingPane = new UI.Widget.VBox();\n throttlingPane.element.classList.add('flex-auto');\n throttlingPane.show(this.settingsPane.element);\n\n const cpuThrottlingToolbar = new UI.Toolbar.Toolbar('', throttlingPane.element);\n cpuThrottlingToolbar.appendText(i18nString(UIStrings.cpu));\n this.cpuThrottlingSelect = MobileThrottling.ThrottlingManager.throttlingManager().createCPUThrottlingSelector();\n cpuThrottlingToolbar.appendToolbarItem(this.cpuThrottlingSelect);\n\n const networkThrottlingToolbar = new UI.Toolbar.Toolbar('', throttlingPane.element);\n networkThrottlingToolbar.appendText(i18nString(UIStrings.network));\n this.networkThrottlingSelect = this.createNetworkConditionsSelect();\n networkThrottlingToolbar.appendToolbarItem(this.networkThrottlingSelect);\n\n const hardwareConcurrencyPane = new UI.Widget.VBox();\n hardwareConcurrencyPane.element.classList.add('flex-auto');\n hardwareConcurrencyPane.show(this.settingsPane.element);\n\n const {toggle, input, reset, warning} =\n MobileThrottling.ThrottlingManager.throttlingManager().createHardwareConcurrencySelector();\n const concurrencyThrottlingToolbar = new UI.Toolbar.Toolbar('', hardwareConcurrencyPane.element);\n concurrencyThrottlingToolbar.registerCSSFiles([timelinePanelStyles]);\n input.element.classList.add('timeline-concurrency-input');\n concurrencyThrottlingToolbar.appendToolbarItem(toggle);\n concurrencyThrottlingToolbar.appendToolbarItem(input);\n concurrencyThrottlingToolbar.appendToolbarItem(reset);\n concurrencyThrottlingToolbar.appendToolbarItem(warning);\n\n this.showSettingsPaneSetting.addChangeListener(this.updateSettingsPaneVisibility.bind(this));\n this.updateSettingsPaneVisibility();\n }\n\n private createNetworkConditionsSelect(): UI.Toolbar.ToolbarComboBox {\n const toolbarItem = new UI.Toolbar.ToolbarComboBox(null, i18nString(UIStrings.networkConditions));\n toolbarItem.setMaxWidth(140);\n MobileThrottling.ThrottlingManager.throttlingManager().decorateSelectWithNetworkThrottling(\n toolbarItem.selectElement());\n return toolbarItem;\n }\n\n private prepareToLoadTimeline(): void {\n console.assert(this.state === State.Idle);\n this.setState(State.Loading);\n if (this.performanceModel) {\n this.performanceModel = null;\n }\n }\n\n private createFileSelector(): void {\n if (this.fileSelectorElement) {\n this.fileSelectorElement.remove();\n }\n this.fileSelectorElement = UI.UIUtils.createFileSelectorElement(this.loadFromFile.bind(this));\n this.timelinePane.element.appendChild(this.fileSelectorElement);\n }\n\n private contextMenu(event: Event): void {\n // Do not show this Context menu on FlameChart entries because we have a different context menu for FlameChart entries\n const mouseEvent = (event as MouseEvent);\n if (this.flameChart.getMainFlameChart().coordinatesToEntryIndex(mouseEvent.offsetX, mouseEvent.offsetY) !== -1) {\n return;\n }\n const contextMenu = new UI.ContextMenu.ContextMenu(event, {useSoftMenu: true});\n contextMenu.appendItemsAtLocation('timelineMenu');\n void contextMenu.show();\n }\n\n async saveToFile(): Promise {\n if (this.state !== State.Idle) {\n return;\n }\n const performanceModel = this.performanceModel;\n if (!performanceModel) {\n return;\n }\n\n const traceEvents = this.#traceEngineModel.traceEvents(this.#traceEngineActiveTraceIndex);\n const metadata = this.#traceEngineModel.metadata(this.#traceEngineActiveTraceIndex);\n // Save annotations into the metadata if annotations the experiment is on\n if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.SAVE_AND_LOAD_TRACE_WITH_ANNOTATIONS) &&\n metadata) {\n metadata.annotations = AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance()?.getAnnotations();\n }\n if (!traceEvents) {\n return;\n }\n\n const traceStart = Platform.DateUtilities.toISO8601Compact(new Date());\n let fileName: Platform.DevToolsPath.RawPathString;\n if (metadata?.dataOrigin === TraceEngine.Types.File.DataOrigin.CPUProfile) {\n fileName = `CPU-${traceStart}.cpuprofile` as Platform.DevToolsPath.RawPathString;\n } else {\n fileName = `Trace-${traceStart}.json` as Platform.DevToolsPath.RawPathString;\n }\n\n try {\n // TODO(crbug.com/1456818): Extract this logic and add more tests.\n let traceAsString;\n if (metadata?.dataOrigin === TraceEngine.Types.File.DataOrigin.CPUProfile) {\n const profileEvent = traceEvents.find(e => e.name === 'CpuProfile');\n if (!profileEvent || !profileEvent.args?.data) {\n return;\n }\n const profileEventData = profileEvent.args?.data;\n if (profileEventData.hasOwnProperty('cpuProfile')) {\n // TODO(crbug.com/1456799): Currently use a hack way because we can't differentiate\n // cpuprofile from trace events when loading a file.\n // The loader will directly add the fake trace created from CpuProfile to the tracingModel.\n // And there is where the old saving logic saves the cpuprofile.\n // This will be solved when the CPUProfileHandler is done. Then we can directly get it\n // from the new traceEngine\n const profile = (profileEventData as {cpuProfile: Protocol.Profiler.Profile}).cpuProfile;\n traceAsString = cpuprofileJsonGenerator(profile as Protocol.Profiler.Profile);\n }\n } else {\n const formattedTraceIter = traceJsonGenerator(traceEvents, metadata);\n traceAsString = Array.from(formattedTraceIter).join('');\n }\n if (!traceAsString) {\n throw new Error('Trace content empty');\n }\n await Workspace.FileManager.FileManager.instance().save(fileName, traceAsString, true /* forceSaveAs */);\n Workspace.FileManager.FileManager.instance().close(fileName);\n } catch (error) {\n console.error(error.stack);\n if (error.name === 'AbortError') {\n // The user cancelled the action, so this is not an error we need to report.\n return;\n }\n Common.Console.Console.instance().error(\n i18nString(UIStrings.failedToSaveTimelineSS, {PH1: error.message, PH2: error.name}));\n }\n }\n\n async showHistory(): Promise {\n const recordingData = await this.#historyManager.showHistoryDropDown();\n if (recordingData && recordingData.traceParseDataIndex !== this.#traceEngineActiveTraceIndex) {\n this.setModel(recordingData.legacyModel, /* exclusiveFilter= */ null, recordingData.traceParseDataIndex);\n }\n }\n\n navigateHistory(direction: number): boolean {\n const recordingData = this.#historyManager.navigate(direction);\n if (recordingData && recordingData.traceParseDataIndex !== this.#traceEngineActiveTraceIndex) {\n this.setModel(recordingData.legacyModel, /* exclusiveFilter= */ null, recordingData.traceParseDataIndex);\n }\n return true;\n }\n\n selectFileToLoad(): void {\n if (this.fileSelectorElement) {\n this.fileSelectorElement.click();\n }\n }\n\n async loadFromFile(file: File): Promise {\n if (this.state !== State.Idle) {\n return;\n }\n this.prepareToLoadTimeline();\n this.loader = await TimelineLoader.loadFromFile(file, this);\n this.createFileSelector();\n }\n\n async loadFromURL(url: Platform.DevToolsPath.UrlString): Promise {\n if (this.state !== State.Idle) {\n return;\n }\n this.prepareToLoadTimeline();\n this.loader = await TimelineLoader.loadFromURL(url, this);\n }\n\n private updateOverviewControls(): void {\n const traceParsedData = this.#traceEngineModel.traceParsedData(this.#traceEngineActiveTraceIndex);\n const isCpuProfile = this.#traceEngineModel.metadata(this.#traceEngineActiveTraceIndex)?.dataOrigin ===\n TraceEngine.Types.File.DataOrigin.CPUProfile;\n if (!traceParsedData) {\n return;\n }\n\n this.#minimapComponent.setData({\n traceParsedData,\n isCpuProfile,\n settings: {\n showScreenshots: this.showScreenshotsSetting.get(),\n showMemory: this.showMemorySetting.get(),\n },\n });\n }\n\n private onModeChanged(): void {\n this.updateOverviewControls();\n this.doResize();\n this.select(null);\n }\n\n private updateSettingsPaneVisibility(): void {\n if (isNode) {\n return;\n }\n if (this.showSettingsPaneSetting.get()) {\n this.settingsPane.showWidget();\n } else {\n this.settingsPane.hideWidget();\n }\n }\n\n private updateShowSettingsToolbarButton(): void {\n const messages: string[] = [];\n if (SDK.CPUThrottlingManager.CPUThrottlingManager.instance().cpuThrottlingRate() !== 1) {\n messages.push(i18nString(UIStrings.CpuThrottlingIsEnabled));\n }\n if (MobileThrottling.ThrottlingManager.throttlingManager().hardwareConcurrencyOverrideEnabled) {\n messages.push(i18nString(UIStrings.HardwareConcurrencyIsEnabled));\n }\n if (SDK.NetworkManager.MultitargetNetworkManager.instance().isThrottling()) {\n messages.push(i18nString(UIStrings.NetworkThrottlingIsEnabled));\n }\n if (this.captureLayersAndPicturesSetting.get()) {\n messages.push(i18nString(UIStrings.SignificantOverheadDueToPaint));\n }\n if (this.disableCaptureJSProfileSetting.get()) {\n messages.push(i18nString(UIStrings.JavascriptSamplingIsDisabled));\n }\n\n this.showSettingsPaneButton.setDefaultWithRedColor(messages.length > 0);\n this.showSettingsPaneButton.setToggleWithRedColor(messages.length > 0);\n\n if (messages.length) {\n const tooltipElement = document.createElement('div');\n messages.forEach(message => {\n tooltipElement.createChild('div').textContent = message;\n });\n this.showSettingsPaneButton.setTitle(tooltipElement.textContent || '');\n } else {\n this.showSettingsPaneButton.setTitle(i18nString(UIStrings.captureSettings));\n }\n }\n\n private setUIControlsEnabled(enabled: boolean): void {\n this.recordingOptionUIControls.forEach(control => control.setEnabled(enabled));\n }\n\n async #evaluateInspectedURL(): Promise {\n if (!this.controller) {\n return Platform.DevToolsPath.EmptyUrlString;\n }\n\n // target.inspectedURL is reliably populated, however it lacks any url #hash\n const inspectedURL = this.controller.primaryPageTarget.inspectedURL();\n\n // We'll use the navigationHistory to acquire the current URL including hash\n const resourceTreeModel = this.controller.primaryPageTarget.model(SDK.ResourceTreeModel.ResourceTreeModel);\n const navHistory = resourceTreeModel && await resourceTreeModel.navigationHistory();\n if (!resourceTreeModel || !navHistory) {\n return inspectedURL;\n }\n\n const {currentIndex, entries} = navHistory;\n const navigationEntry = entries[currentIndex];\n return navigationEntry.url as Platform.DevToolsPath.UrlString;\n }\n\n async #navigateToAboutBlank(): Promise {\n const aboutBlankNavigationComplete = new Promise(async (resolve, reject) => {\n if (!this.controller) {\n reject('Could not find TimelineController');\n return;\n }\n const target = this.controller.primaryPageTarget;\n const resourceModel = target.model(SDK.ResourceTreeModel.ResourceTreeModel);\n if (!resourceModel) {\n reject('Could not load resourceModel');\n return;\n }\n\n // To clear out the page and any state from prior test runs, we\n // navigate to about:blank before initiating the trace recording.\n // Once we have navigated to about:blank, we start recording and\n // then navigate to the original page URL, to ensure we profile the\n // page load.\n function waitForAboutBlank(event: Common.EventTarget.EventTargetEvent):\n void {\n if (event.data.url === 'about:blank') {\n resolve();\n } else {\n reject(`Unexpected navigation to ${event.data.url}`);\n }\n resourceModel?.removeEventListener(SDK.ResourceTreeModel.Events.FrameNavigated, waitForAboutBlank);\n }\n resourceModel.addEventListener(SDK.ResourceTreeModel.Events.FrameNavigated, waitForAboutBlank);\n await resourceModel.navigate('about:blank' as Platform.DevToolsPath.UrlString);\n });\n await aboutBlankNavigationComplete;\n }\n\n async #startCPUProfilingRecording(): Promise {\n try {\n this.cpuProfiler = UI.Context.Context.instance().flavor(SDK.CPUProfilerModel.CPUProfilerModel);\n if (!this.cpuProfiler) {\n // If there is no isolate selected, we will profile the first isolate that devtools connects to.\n // If we profile all target, but this will cause some bugs like time for the function is calculated wrong,\n // because the profiles will be concated and sorted together, so the total time will be amplified.\n // Multiple targets problem might happen when you inspect multiple node servers on different port at same time,\n // or when you let DevTools listen to both locolhost:9229 & 127.0.0.1:9229.\n const firstNodeTarget =\n SDK.TargetManager.TargetManager.instance().targets().find(target => target.type() === SDK.Target.Type.Node);\n if (!firstNodeTarget) {\n throw new Error('Could not load any Node target.');\n }\n if (firstNodeTarget) {\n this.cpuProfiler = firstNodeTarget.model(SDK.CPUProfilerModel.CPUProfilerModel);\n }\n }\n\n this.setUIControlsEnabled(false);\n this.hideLandingPage();\n if (!this.cpuProfiler) {\n throw new Error('No Node target is found.');\n }\n await SDK.TargetManager.TargetManager.instance().suspendAllTargets('performance-timeline');\n await this.cpuProfiler.startRecording();\n\n this.recordingStarted();\n } catch (e) {\n await this.recordingFailed(e.message);\n }\n }\n\n async #startTraceRecording(): Promise {\n try {\n // We record against the root target, but also need to use the\n // primaryPageTarget to inspect the current URL. For more info, see the\n // JSDoc comment on the TimelineController constructor.\n const rootTarget = SDK.TargetManager.TargetManager.instance().rootTarget();\n const primaryPageTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();\n\n if (!primaryPageTarget) {\n throw new Error('Could not load primary page target.');\n }\n if (!rootTarget) {\n throw new Error('Could not load root target.');\n }\n\n if (UIDevtoolsUtils.isUiDevTools()) {\n this.controller = new UIDevtoolsController(rootTarget, primaryPageTarget, this);\n } else {\n this.controller = new TimelineController(rootTarget, primaryPageTarget, this);\n }\n this.setUIControlsEnabled(false);\n this.hideLandingPage();\n if (!this.controller) {\n throw new Error('Could not create Timeline controller');\n }\n\n const urlToTrace = await this.#evaluateInspectedURL();\n // If we are doing \"Reload & record\", we first navigate the page to\n // about:blank. This is to ensure any data on the timeline from any\n // previous performance recording is lost, avoiding the problem where a\n // timeline will show data & screenshots from a previous page load that\n // was not relevant.\n if (this.recordingPageReload) {\n await this.#navigateToAboutBlank();\n }\n const recordingOptions = {\n enableJSSampling: !this.disableCaptureJSProfileSetting.get(),\n capturePictures: this.captureLayersAndPicturesSetting.get(),\n captureFilmStrip: this.showScreenshotsSetting.get(),\n };\n // Order is important here: we tell the controller to start recording, which enables tracing.\n const response = await this.controller.startRecording(recordingOptions);\n if (response.getError()) {\n throw new Error(response.getError());\n }\n // Once we get here, we know tracing is active.\n // This is when, if the user has hit \"Reload & Record\" that we now need to navigate to the original URL.\n // If the user has just hit \"record\", we don't do any navigating.\n const recordingConfig = this.recordingPageReload ? {navigateToUrl: urlToTrace} : undefined;\n this.recordingStarted(recordingConfig);\n } catch (e) {\n await this.recordingFailed(e.message);\n }\n }\n\n private async startRecording(): Promise {\n console.assert(!this.statusPane, 'Status pane is already opened.');\n this.setState(State.StartPending);\n this.showRecordingStarted();\n\n if (isNode) {\n await this.#startCPUProfilingRecording();\n } else {\n await this.#startTraceRecording();\n }\n }\n\n private async stopRecording(): Promise {\n if (this.statusPane) {\n this.statusPane.finish();\n this.statusPane.updateStatus(i18nString(UIStrings.stoppingTimeline));\n this.statusPane.updateProgressBar(i18nString(UIStrings.received), 0);\n }\n this.setState(State.StopPending);\n if (this.controller) {\n this.performanceModel = this.controller.getPerformanceModel();\n await this.controller.stopRecording();\n this.setUIControlsEnabled(true);\n await this.controller.dispose();\n this.controller = null;\n return;\n }\n if (this.cpuProfiler) {\n const profile = await this.cpuProfiler.stopRecording();\n this.setState(State.Idle);\n this.loadFromCpuProfile(profile);\n\n this.setUIControlsEnabled(true);\n this.cpuProfiler = null;\n\n await SDK.TargetManager.TargetManager.instance().resumeAllTargets();\n }\n }\n\n private async recordingFailed(error: string, rawEvents?: TraceEngine.Types.TraceEvents.TraceEventData[]):\n Promise {\n if (this.statusPane) {\n this.statusPane.remove();\n }\n this.statusPane = new StatusPane(\n {\n description: error,\n buttonText: i18nString(UIStrings.close),\n buttonDisabled: false,\n showProgress: undefined,\n showTimer: undefined,\n },\n // When recording failed, we should load null to go back to the landing page.\n async () => {\n this.statusPane?.remove();\n await this.loadingComplete(\n /* no collectedEvents */[],\n /* tracingModel= */ null,\n /* exclusiveFilter= */ null,\n /* isCpuProfile= */ false,\n /* recordingStartTime= */ null,\n /* metadata= */ null);\n });\n this.statusPane.showPane(this.statusPaneContainer);\n this.statusPane.updateStatus(i18nString(UIStrings.recordingFailed));\n\n if (rawEvents) {\n this.statusPane.enableDownloadOfEvents(rawEvents);\n }\n\n this.setState(State.RecordingFailed);\n this.performanceModel = null;\n this.traceLoadStart = null;\n this.setUIControlsEnabled(true);\n if (this.controller) {\n await this.controller.dispose();\n this.controller = null;\n }\n // Ensure we resume all targets, otherwise DevTools remains unresponsive in the event of an error.\n void SDK.TargetManager.TargetManager.instance().resumeAllTargets();\n }\n\n private onSuspendStateChanged(): void {\n this.updateTimelineControls();\n }\n\n private consoleProfileFinished(data: SDK.CPUProfilerModel.ProfileFinishedData): void {\n this.loadFromCpuProfile(data.cpuProfile, data.title);\n void UI.InspectorView.InspectorView.instance().showPanel('timeline');\n }\n\n private updateTimelineControls(): void {\n this.toggleRecordAction.setToggled(this.state === State.Recording);\n this.toggleRecordAction.setEnabled(this.state === State.Recording || this.state === State.Idle);\n this.recordReloadAction.setEnabled(isNode ? false : this.state === State.Idle);\n this.#historyManager.setEnabled(this.state === State.Idle);\n this.clearButton.setEnabled(this.state === State.Idle);\n this.panelToolbar.setEnabled(this.state !== State.Loading);\n this.panelRightToolbar.setEnabled(this.state !== State.Loading);\n this.dropTarget.setEnabled(this.state === State.Idle);\n this.loadButton.setEnabled(this.state === State.Idle);\n this.saveButton.setEnabled(this.state === State.Idle && Boolean(this.performanceModel));\n }\n\n async toggleRecording(): Promise {\n if (this.state === State.Idle) {\n this.recordingPageReload = false;\n await this.startRecording();\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.TimelineStarted);\n } else if (this.state === State.Recording) {\n await this.stopRecording();\n }\n }\n\n recordReload(): void {\n if (this.state !== State.Idle) {\n return;\n }\n this.recordingPageReload = true;\n void this.startRecording();\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.TimelinePageReloadStarted);\n }\n\n private onClearButton(): void {\n this.#historyManager.clear();\n this.clear();\n }\n\n private onFixMe(): void {\n if (!this.performanceModel) {\n return;\n }\n this.flameChart.fixMe();\n }\n\n private clear(): void {\n if (this.statusPane) {\n this.statusPane.remove();\n }\n this.showLandingPage();\n this.reset();\n }\n\n private reset(): void {\n PerfUI.LineLevelProfile.Performance.instance().reset();\n if (this.#sourceMapsResolver) {\n this.#sourceMapsResolver.removeEventListener(\n NodeNamesUpdated.eventName, this.#onSourceMapsNodeNamesResolvedBound);\n this.#sourceMapsResolver.uninstall();\n this.#sourceMapsResolver = null;\n }\n this.setModel(null);\n }\n\n #applyActiveFilters(\n traceIsGeneric: boolean,\n exclusiveFilter: TimelineModel.TimelineModelFilter.TimelineModelFilter|null = null): void {\n if (traceIsGeneric || Root.Runtime.experiments.isEnabled('timeline-show-all-events')) {\n return;\n }\n\n const newActiveFilters = exclusiveFilter ? [exclusiveFilter] : [\n TimelineUIUtils.visibleEventsFilter(),\n ];\n\n ActiveFilters.instance().setFilters(newActiveFilters);\n }\n\n applyFilters(\n _perfModel: PerformanceModel|null,\n exclusiveFilter: TimelineModel.TimelineModelFilter.TimelineModelFilter|null = null): void {\n // TODO: this method is maintained purely for a set of layout tests that\n // use it. Once these tests have been replaced or migrated into DevTools\n // unit tests, we can remove this applyFilters() method.\n // http/tests/devtools/a11y-axe-core/performance/performance-pane-a11y-test.js\n // http/tests/devtools/a11y-axe-core/performance/performance_event_log_a11y_test.js\n // http/tests/devtools/tracing/category-filter.js\n // http/tests/devtools/tracing/timeline-js/timeline-open-function-call.js\n // http/tests/devtools/tracing/timeline-misc/timeline-filtering-self-time.js\n // http/tests/devtools/tracing/timeline-misc/timeline-filtering.js\n // http/tests/devtools/tracing/timeline-misc/timeline-range-stats.js\n this.#applyActiveFilters(false, exclusiveFilter);\n }\n\n setModel(\n model: PerformanceModel|null, exclusiveFilter: TimelineModel.TimelineModelFilter.TimelineModelFilter|null = null,\n traceEngineIndex: number = -1, metadata: TraceEngine.Types.File.MetaData|null = null): void {\n this.performanceModel = model;\n this.#traceEngineActiveTraceIndex = traceEngineIndex;\n const traceParsedData = this.#traceEngineModel.traceParsedData(this.#traceEngineActiveTraceIndex);\n const isCpuProfile = this.#traceEngineModel.metadata(this.#traceEngineActiveTraceIndex)?.dataOrigin ===\n TraceEngine.Types.File.DataOrigin.CPUProfile;\n\n this.#minimapComponent.reset();\n // Order is important: the bounds must be set before we initiate any UI\n // rendering.\n if (traceParsedData) {\n TraceBounds.TraceBounds.BoundsManager.instance().resetWithNewBounds(\n traceParsedData.Meta.traceBounds,\n );\n\n // Since we have a single instance to AnnotationsManager, combine both SyntheticEvent to Node maps\n const samplesAndRendererEventsEntryToNodeMap =\n new Map([...traceParsedData.Samples.entryToNode, ...traceParsedData.Renderer.entryToNode]);\n // If the annotations experiment is on and there are some annotations saved, apply the annotations from the file.\n // We create AnnotationsManager regardless of the experiment because the EntriesFilterer initiated in the AnnotationsManager\n // needs to work even if the experiment is off.\n const traceBounds = TraceBounds.TraceBounds.BoundsManager.instance().state();\n AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance({\n entryToNodeMap: samplesAndRendererEventsEntryToNodeMap,\n wholeTraceBounds: traceBounds?.micro.entireTraceBounds,\n });\n if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.SAVE_AND_LOAD_TRACE_WITH_ANNOTATIONS) &&\n metadata?.annotations) {\n AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance()?.applyAnnotations(\n metadata?.annotations);\n }\n\n this.#applyActiveFilters(traceParsedData.Meta.traceIsGeneric, exclusiveFilter);\n }\n if (model) {\n this.searchableViewInternal.showWidget();\n } else {\n this.searchableViewInternal.hideWidget();\n this.fixMeButtonAdded = false;\n this.panelToolbar.removeToolbarItem(this.fixMeButton);\n }\n this.flameChart.setModel(model, traceParsedData, isCpuProfile);\n this.flameChart.setSelection(null);\n\n // Set up line level profiling with CPU profiles, if we found any.\n PerfUI.LineLevelProfile.Performance.instance().reset();\n if (traceParsedData && traceParsedData.Samples.profilesInProcess.size) {\n const primaryPageTarget = SDK.TargetManager.TargetManager.instance().primaryPageTarget();\n // Gather up all CPU Profiles we found when parsing this trace.\n const cpuProfiles =\n Array.from(traceParsedData.Samples.profilesInProcess).flatMap(([_processId, threadsInProcess]) => {\n const profiles = Array.from(threadsInProcess.values()).map(profileData => profileData.parsedProfile);\n return profiles;\n });\n for (const profile of cpuProfiles) {\n PerfUI.LineLevelProfile.Performance.instance().appendCPUProfile(profile, primaryPageTarget);\n }\n }\n\n this.updateOverviewControls();\n if (this.flameChart) {\n this.flameChart.resizeToPreferredHeights();\n }\n\n // Set the initial zoom and if we are using breadcrumbs, create the initial breadcrum.\n // We expect traceParsedData to always exist, this check is to keep TS happy.\n if (traceParsedData) {\n if (this.#minimapComponent.breadcrumbsActivated) {\n this.#minimapComponent.addInitialBreadcrumb();\n }\n\n // To calculate the activity we might want to zoom in, we find the last\n // main thread. Or we find the CPU Profile thread, for e.g. Node traces.\n const mainThreadTypes = [\n TraceEngine.Handlers.Threads.ThreadType.MAIN_THREAD,\n TraceEngine.Handlers.Threads.ThreadType.CPU_PROFILE,\n ];\n const lastMainThread = TraceEngine.Handlers.Threads.threadsInTrace(traceParsedData)\n .filter(data => mainThreadTypes.includes(data.type))\n .at(-1);\n if (lastMainThread) {\n const zoomedInBounds = TraceEngine.Extras.MainThreadActivity.calculateWindow(\n traceParsedData.Meta.traceBounds, lastMainThread.entries);\n\n TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(zoomedInBounds);\n }\n }\n this.updateTimelineControls();\n }\n\n private recordingStarted(config?: {navigateToUrl: Platform.DevToolsPath.UrlString}): void {\n if (config && this.recordingPageReload && this.controller) {\n // If the user hit \"Reload & record\", by this point we have:\n // 1. Navigated to about:blank\n // 2. Initiated tracing.\n // We therefore now should navigate back to the original URL that the user wants to profile.\n const resourceModel = this.controller?.primaryPageTarget.model(SDK.ResourceTreeModel.ResourceTreeModel);\n if (!resourceModel) {\n void this.recordingFailed('Could not navigate to original URL');\n return;\n }\n // We don't need to await this because we are purposefully showing UI\n // progress as the page loads & tracing is underway.\n void resourceModel.navigate(config.navigateToUrl);\n }\n\n this.reset();\n this.setState(State.Recording);\n this.showRecordingStarted();\n if (this.statusPane) {\n this.statusPane.enableAndFocusButton();\n this.statusPane.updateStatus(i18nString(UIStrings.profiling));\n this.statusPane.updateProgressBar(i18nString(UIStrings.bufferUsage), 0);\n this.statusPane.startTimer();\n }\n this.hideLandingPage();\n }\n\n recordingProgress(usage: number): void {\n if (this.statusPane) {\n this.statusPane.updateProgressBar(i18nString(UIStrings.bufferUsage), usage * 100);\n }\n }\n\n private showLandingPage(): void {\n this.updateSettingsPaneVisibility();\n if (this.landingPage) {\n this.landingPage.show(this.statusPaneContainer);\n return;\n }\n\n function encloseWithTag(tagName: string, contents: string): HTMLElement {\n const e = document.createElement(tagName);\n e.textContent = contents;\n return e;\n }\n\n const learnMoreNode = UI.XLink.XLink.create(\n 'https://developer.chrome.com/docs/devtools/evaluate-performance/', i18nString(UIStrings.learnmore), undefined,\n undefined, 'learn-more');\n\n const recordKey = encloseWithTag(\n 'b',\n UI.ShortcutRegistry.ShortcutRegistry.instance().shortcutsForAction('timeline.toggle-recording')[0].title());\n const reloadKey = encloseWithTag(\n 'b', UI.ShortcutRegistry.ShortcutRegistry.instance().shortcutsForAction('timeline.record-reload')[0].title());\n const navigateNode = encloseWithTag('b', i18nString(UIStrings.wasd));\n\n this.landingPage = new UI.Widget.VBox();\n this.landingPage.contentElement.classList.add('timeline-landing-page', 'fill');\n const centered = this.landingPage.contentElement.createChild('div');\n\n const recordButton = UI.UIUtils.createInlineButton(UI.Toolbar.Toolbar.createActionButton(this.toggleRecordAction));\n const reloadButton =\n UI.UIUtils.createInlineButton(UI.Toolbar.Toolbar.createActionButtonForId('timeline.record-reload'));\n\n centered.createChild('p').appendChild(i18n.i18n.getFormatLocalizedString(\n str_, UIStrings.clickTheRecordButtonSOrHitSTo, {PH1: recordButton, PH2: recordKey}));\n\n centered.createChild('p').appendChild(i18n.i18n.getFormatLocalizedString(\n str_, UIStrings.clickTheReloadButtonSOrHitSTo, {PH1: reloadButton, PH2: reloadKey}));\n\n centered.createChild('p').appendChild(i18n.i18n.getFormatLocalizedString(\n str_, UIStrings.afterRecordingSelectAnAreaOf, {PH1: navigateNode, PH2: learnMoreNode}));\n\n if (isNode) {\n const previewSection = new PanelFeedback.PanelFeedback.PanelFeedback();\n previewSection.data = {\n feedbackUrl: 'https://crbug.com/1354548' as Platform.DevToolsPath.UrlString,\n quickStartUrl: 'https://goo.gle/js-profiler-deprecation' as Platform.DevToolsPath.UrlString,\n quickStartLinkText: i18nString(UIStrings.learnmore),\n };\n centered.appendChild(previewSection);\n const feedbackButton = new PanelFeedback.FeedbackButton.FeedbackButton();\n feedbackButton.data = {\n feedbackUrl: 'https://crbug.com/1354548' as Platform.DevToolsPath.UrlString,\n };\n centered.appendChild(feedbackButton);\n }\n\n this.landingPage.show(this.statusPaneContainer);\n }\n\n private hideLandingPage(): void {\n this.landingPage.detach();\n\n // Hide pane settings in trace view to conserve UI space, but preserve underlying setting.\n this.showSettingsPaneButton?.setToggled(false);\n this.settingsPane?.hideWidget();\n }\n\n async loadingStarted(): Promise {\n this.hideLandingPage();\n\n if (this.statusPane) {\n this.statusPane.remove();\n }\n this.statusPane = new StatusPane(\n {\n showProgress: true,\n showTimer: undefined,\n buttonDisabled: undefined,\n buttonText: undefined,\n description: undefined,\n },\n () => this.cancelLoading());\n this.statusPane.showPane(this.statusPaneContainer);\n this.statusPane.updateStatus(i18nString(UIStrings.loadingProfile));\n // FIXME: make loading from backend cancelable as well.\n if (!this.loader) {\n this.statusPane.finish();\n }\n this.traceLoadStart = TraceEngine.Types.Timing.MilliSeconds(performance.now());\n await this.loadingProgress(0);\n }\n\n async loadingProgress(progress?: number): Promise {\n if (typeof progress === 'number' && this.statusPane) {\n this.statusPane.updateProgressBar(i18nString(UIStrings.received), progress * 100);\n }\n }\n\n async processingStarted(): Promise {\n if (this.statusPane) {\n this.statusPane.updateStatus(i18nString(UIStrings.processingProfile));\n }\n }\n\n #onSourceMapsNodeNamesResolved(): void {\n this.flameChart.updateColorMapper();\n }\n\n async loadingComplete(\n collectedEvents: TraceEngine.Types.TraceEvents.TraceEventData[],\n tracingModel: TraceEngine.Legacy.TracingModel|null,\n exclusiveFilter: TimelineModel.TimelineModelFilter.TimelineModelFilter|null = null, isCpuProfile: boolean,\n recordingStartTime: number|null, metadata: TraceEngine.Types.File.MetaData|null): Promise {\n this.#traceEngineModel.resetProcessor();\n SourceMapsResolver.clearResolvedNodeNames();\n\n delete this.loader;\n\n // If the user just recorded this trace via the record UI, the state will\n // be StopPending. Whereas if it was an existing trace they loaded via a\n // file, it will be State.Loading. This means we can tell the recording is\n // fresh by checking the state value.\n const recordingIsFresh = this.state === State.StopPending;\n\n this.setState(State.Idle);\n\n if (!tracingModel) {\n this.clear();\n return;\n }\n\n if (!this.performanceModel) {\n this.performanceModel = new PerformanceModel();\n }\n\n metadata = metadata ?\n metadata :\n await TraceEngine.Extras.Metadata.forNewRecording(isCpuProfile, recordingStartTime ?? undefined);\n try {\n // Run the new engine in parallel with the parsing done in the performanceModel\n await Promise.all([\n // Calling setTracingModel now and setModel so much later, leads to several problems due to addEventListener order being unexpected\n // TODO(paulirish): Resolve this, or just wait for the death of tracingModel. :)\n this.performanceModel.setTracingModel(tracingModel, recordingIsFresh),\n this.#executeNewTraceEngine(collectedEvents, recordingIsFresh, metadata),\n ]);\n\n // This code path is only executed when a new trace is recorded/imported,\n // so we know that the active index will be the size of the model because\n // the newest trace will be automatically set to active.\n this.#traceEngineActiveTraceIndex = this.#traceEngineModel.size() - 1;\n\n this.setModel(this.performanceModel, exclusiveFilter, this.#traceEngineActiveTraceIndex, metadata);\n\n if (this.statusPane) {\n this.statusPane.remove();\n }\n this.statusPane = null;\n\n const traceData = this.#traceEngineModel.traceParsedData(this.#traceEngineActiveTraceIndex);\n if (!traceData) {\n throw new Error(`Could not get trace data at index ${this.#traceEngineActiveTraceIndex}`);\n }\n\n // Set up SourceMapsResolver to ensure we resolve any function names in\n // profile calls.\n this.#sourceMapsResolver = new SourceMapsResolver(traceData);\n this.#sourceMapsResolver.addEventListener(NodeNamesUpdated.eventName, this.#onSourceMapsNodeNamesResolvedBound);\n await this.#sourceMapsResolver.install();\n\n // We store the Performance Model and the index of the active trace.\n // However we also pass in the full trace data because we use it to build\n // the preview overview thumbnail of the trace that gets shown in the UI.\n this.#historyManager.addRecording({\n data: {\n legacyModel: this.performanceModel,\n traceParseDataIndex: this.#traceEngineActiveTraceIndex,\n },\n filmStripForPreview: TraceEngine.Extras.FilmStrip.fromTraceData(traceData),\n traceParsedData: traceData,\n startTime: recordingStartTime ?? null,\n });\n } catch (error) {\n // Try to get the raw events: if we errored during the parsing stage, it\n // is useful to get access to the raw events to download the trace. This\n // allows us to debug crashes!\n // Because we don't know where the error came from, we wrap it in a\n // try-catch to protect against the tracing model erroring.\n let rawEvents: TraceEngine.Types.TraceEvents.TraceEventData[]|undefined = undefined;\n try {\n rawEvents = tracingModel.allRawEvents() as unknown as TraceEngine.Types.TraceEvents.TraceEventData[];\n } catch {\n }\n\n void this.recordingFailed(error.message, rawEvents);\n console.error(error);\n } finally {\n this.recordTraceLoadMetric();\n }\n }\n\n recordTraceLoadMetric(): void {\n if (!this.traceLoadStart) {\n return;\n }\n const start = this.traceLoadStart;\n // Right *now* is the end of trace parsing and model building, but the flamechart rendering\n // isn't complete yet. To capture that we'll do a rAF+setTimeout to give the most accurate timestamp\n // for the first paint of the flamechart\n requestAnimationFrame(() => {\n setTimeout(() => {\n const end = TraceEngine.Types.Timing.MilliSeconds(performance.now());\n const measure = performance.measure('TraceLoad', {start, end});\n const duration = TraceEngine.Types.Timing.MilliSeconds(measure.duration);\n this.element.dispatchEvent(new TraceLoadEvent(duration));\n Host.userMetrics.performanceTraceLoad(measure);\n }, 0);\n });\n }\n\n async #executeNewTraceEngine(\n collectedEvents: TraceEngine.Types.TraceEvents.TraceEventData[], isFreshRecording: boolean,\n metadata: TraceEngine.Types.File.MetaData): Promise {\n return this.#traceEngineModel.parse(\n collectedEvents,\n {\n metadata,\n isFreshRecording,\n },\n );\n }\n\n loadingCompleteForTest(): void {\n // Not implemented, added only for allowing the TimelineTestRunner\n // to be in sync when a trace load is finished.\n }\n private showRecordingStarted(): void {\n if (this.statusPane) {\n this.statusPane.remove();\n }\n this.statusPane = new StatusPane(\n {\n showTimer: true,\n showProgress: true,\n buttonDisabled: true,\n description: undefined,\n buttonText: undefined,\n },\n () => this.stopRecording());\n this.statusPane.showPane(this.statusPaneContainer);\n this.statusPane.updateStatus(i18nString(UIStrings.initializingProfiler));\n }\n\n private cancelLoading(): void {\n if (this.loader) {\n void this.loader.cancel();\n }\n }\n\n private async loadEventFired(\n event: Common.EventTarget\n .EventTargetEvent<{resourceTreeModel: SDK.ResourceTreeModel.ResourceTreeModel, loadTime: number}>):\n Promise {\n if (this.state !== State.Recording || !this.recordingPageReload || !this.controller ||\n this.controller.primaryPageTarget !== event.data.resourceTreeModel.target()) {\n return;\n }\n const controller = this.controller;\n await new Promise(r => window.setTimeout(r, this.millisecondsToRecordAfterLoadEvent));\n\n // Check if we're still in the same recording session.\n if (controller !== this.controller || this.state !== State.Recording) {\n return;\n }\n void this.stopRecording();\n }\n\n private frameForSelection(selection: TimelineSelection): TraceEngine.Handlers.ModelHandlers.Frames.TimelineFrame\n |null {\n if (TimelineSelection.isFrameObject(selection.object)) {\n return selection.object;\n }\n if (TimelineSelection.isRangeSelection(selection.object) ||\n TimelineSelection.isSyntheticNetworkRequestDetailsEventSelection(selection.object)) {\n return null;\n }\n if (TimelineSelection.isTraceEventSelection(selection.object)) {\n if (!this.performanceModel) {\n return null;\n }\n const traceData = this.#traceEngineModel.traceParsedData(this.#traceEngineActiveTraceIndex);\n if (!traceData) {\n return null;\n }\n // If the user has selected a time range, the frame we want is the last\n // frame in that time window, hence why the window we look for is the\n // endTime to the endTime.\n const endTimeMicro = TraceEngine.Helpers.Timing.millisecondsToMicroseconds(selection.endTime);\n const lastFrameInSelection = TraceEngine.Handlers.ModelHandlers.Frames\n .framesWithinWindow(\n traceData.Frames.frames,\n endTimeMicro,\n endTimeMicro,\n )\n .at(0);\n return lastFrameInSelection || null;\n }\n console.assert(false, 'Should never be reached');\n return null;\n }\n\n jumpToFrame(offset: number): true|undefined {\n const currentFrame = this.selection && this.frameForSelection(this.selection);\n if (!currentFrame) {\n return;\n }\n const traceData = this.#traceEngineModel.traceParsedData(this.#traceEngineActiveTraceIndex);\n if (!traceData) {\n return;\n }\n let index = traceData.Frames.frames.indexOf(currentFrame);\n console.assert(index >= 0, 'Can\\'t find current frame in the frame list');\n index = Platform.NumberUtilities.clamp(index + offset, 0, traceData.Frames.frames.length - 1);\n const frame = traceData.Frames.frames[index];\n this.#revealTimeRange(\n TraceEngine.Helpers.Timing.microSecondsToMilliseconds(frame.startTime),\n TraceEngine.Helpers.Timing.microSecondsToMilliseconds(frame.endTime));\n this.select(TimelineSelection.fromFrame(frame));\n return true;\n }\n\n select(selection: TimelineSelection|null): void {\n this.selection = selection;\n this.flameChart.setSelection(selection);\n }\n\n selectEntryAtTime(events: TraceEngine.Types.TraceEvents.TraceEventData[]|null, time: number): void {\n if (!events) {\n return;\n }\n\n if (events.length === 0) {\n this.select(null);\n return;\n }\n\n // Find best match, then backtrack to the first visible entry.\n for (let index = Platform.ArrayUtilities.upperBound(events, time, (time, event) => time - event.ts) - 1; index >= 0;\n --index) {\n const event = events[index];\n const {endTime} = TraceEngine.Helpers.Timing.eventTimingsMilliSeconds(event);\n if (TraceEngine.Legacy.TracingModel.isTopLevelEvent(event) && endTime < time) {\n break;\n }\n if (ActiveFilters.instance().isVisible(event) && endTime >= time) {\n this.select(TimelineSelection.fromTraceEvent(event));\n return;\n }\n }\n this.select(null);\n }\n\n highlightEvent(event: TraceEngine.Legacy.Event|null): void {\n this.flameChart.highlightEvent(event);\n }\n\n #revealTimeRange(startTime: TraceEngine.Types.Timing.MilliSeconds, endTime: TraceEngine.Types.Timing.MilliSeconds):\n void {\n const traceBoundsState = TraceBounds.TraceBounds.BoundsManager.instance().state();\n if (!traceBoundsState) {\n return;\n }\n const traceWindow = traceBoundsState.milli.timelineTraceWindow;\n\n let offset = 0;\n if (traceWindow.max < endTime) {\n offset = endTime - traceWindow.max;\n } else if (traceWindow.min > startTime) {\n offset = startTime - traceWindow.min;\n }\n TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(\n TraceEngine.Helpers.Timing.traceWindowFromMilliSeconds(\n TraceEngine.Types.Timing.MilliSeconds(traceWindow.min + offset),\n TraceEngine.Types.Timing.MilliSeconds(traceWindow.max + offset),\n ),\n {\n shouldAnimate: true,\n },\n );\n }\n\n private handleDrop(dataTransfer: DataTransfer): void {\n const items = dataTransfer.items;\n if (!items.length) {\n return;\n }\n const item = items[0];\n Host.userMetrics.actionTaken(Host.UserMetrics.Action.PerfPanelTraceImported);\n if (item.kind === 'string') {\n const url = dataTransfer.getData('text/uri-list') as Platform.DevToolsPath.UrlString;\n if (new Common.ParsedURL.ParsedURL(url).isValid) {\n void this.loadFromURL(url);\n }\n } else if (item.kind === 'file') {\n const file = items[0].getAsFile();\n if (!file) {\n return;\n }\n void this.loadFromFile(file);\n }\n }\n}\n\nexport const enum State {\n Idle = 'Idle',\n StartPending = 'StartPending',\n Recording = 'Recording',\n StopPending = 'StopPending',\n Loading = 'Loading',\n RecordingFailed = 'RecordingFailed',\n}\n\n// Define row and header height, should be in sync with styles for timeline graphs.\nexport const rowHeight = 18;\n\nexport const headerHeight = 20;\nexport interface TimelineModeViewDelegate {\n select(selection: TimelineSelection|null): void;\n selectEntryAtTime(events: TraceEngine.Types.TraceEvents.TraceEventData[]|null, time: number): void;\n highlightEvent(event: TraceEngine.Legacy.CompatibleTraceEvent|null): void;\n}\n\nexport class StatusPane extends UI.Widget.VBox {\n private status: HTMLElement;\n private time: Element|undefined;\n private progressLabel!: Element;\n private progressBar!: Element;\n private readonly description: HTMLElement|undefined;\n private button: HTMLButtonElement;\n private downloadTraceButton: HTMLButtonElement;\n private startTime!: number;\n private timeUpdateTimer?: number;\n #rawEvents?: TraceEngine.Types.TraceEvents.TraceEventData[];\n\n constructor(\n options: {\n showTimer?: boolean,\n showProgress?: boolean,\n description?: string,\n buttonText?: string,\n buttonDisabled?: boolean,\n },\n buttonCallback: () => (Promise| void)) {\n super(true);\n\n this.contentElement.classList.add('timeline-status-dialog');\n\n const statusLine = this.contentElement.createChild('div', 'status-dialog-line status');\n statusLine.createChild('div', 'label').textContent = i18nString(UIStrings.status);\n this.status = statusLine.createChild('div', 'content');\n UI.ARIAUtils.markAsStatus(this.status);\n\n if (options.showTimer) {\n const timeLine = this.contentElement.createChild('div', 'status-dialog-line time');\n timeLine.createChild('div', 'label').textContent = i18nString(UIStrings.time);\n this.time = timeLine.createChild('div', 'content');\n }\n\n if (options.showProgress) {\n const progressLine = this.contentElement.createChild('div', 'status-dialog-line progress');\n this.progressLabel = progressLine.createChild('div', 'label');\n this.progressBar = progressLine.createChild('div', 'indicator-container').createChild('div', 'indicator');\n UI.ARIAUtils.markAsProgressBar(this.progressBar);\n }\n\n if (typeof options.description === 'string') {\n const descriptionLine = this.contentElement.createChild('div', 'status-dialog-line description');\n descriptionLine.createChild('div', 'label').textContent = i18nString(UIStrings.description);\n this.description = descriptionLine.createChild('div', 'content');\n this.description.innerText = options.description;\n }\n\n const buttonContainer = this.contentElement.createChild('div', 'stop-button');\n this.downloadTraceButton = UI.UIUtils.createTextButton(i18nString(UIStrings.downloadAfterError), () => {\n void this.#downloadRawTraceAfterError();\n }, {jslogContext: 'timeline.download-after-error'});\n\n this.downloadTraceButton.disabled = true;\n this.downloadTraceButton.style.visibility = 'hidden';\n\n const buttonText = options.buttonText || i18nString(UIStrings.stop);\n this.button = UI.UIUtils.createTextButton(buttonText, buttonCallback, {\n jslogContext: 'timeline.stop-recording',\n primary: true,\n });\n // Profiling can't be stopped during initialization.\n this.button.disabled = !options.buttonDisabled === false;\n\n buttonContainer.append(this.downloadTraceButton);\n buttonContainer.append(this.button);\n }\n\n finish(): void {\n this.stopTimer();\n this.button.disabled = true;\n }\n\n async #downloadRawTraceAfterError(): Promise {\n if (!this.#rawEvents || this.#rawEvents.length === 0) {\n return;\n }\n const traceStart = Platform.DateUtilities.toISO8601Compact(new Date());\n const fileName = `Trace-Load-Error-${traceStart}.json` as Platform.DevToolsPath.RawPathString;\n const formattedTraceIter = traceJsonGenerator(this.#rawEvents, {});\n const traceAsString = Array.from(formattedTraceIter).join('');\n await Workspace.FileManager.FileManager.instance().save(fileName, traceAsString, true /* forceSaveAs */);\n Workspace.FileManager.FileManager.instance().close(fileName);\n }\n\n enableDownloadOfEvents(rawEvents: TraceEngine.Types.TraceEvents.TraceEventData[]): void {\n this.#rawEvents = rawEvents;\n this.downloadTraceButton.disabled = false;\n this.downloadTraceButton.style.visibility = 'visible';\n }\n\n remove(): void {\n if (this.element.parentNode) {\n (this.element.parentNode as HTMLElement).classList.remove('tinted');\n this.arrangeDialog((this.element.parentNode as HTMLElement));\n }\n this.stopTimer();\n this.element.remove();\n }\n\n showPane(parent: Element): void {\n this.arrangeDialog(parent);\n this.show(parent);\n parent.classList.add('tinted');\n }\n\n enableAndFocusButton(): void {\n this.button.disabled = false;\n this.button.focus();\n }\n\n updateStatus(text: string): void {\n this.status.textContent = text;\n }\n\n updateProgressBar(activity: string, percent: number): void {\n this.progressLabel.textContent = activity;\n (this.progressBar as HTMLElement).style.width = percent.toFixed(1) + '%';\n UI.ARIAUtils.setValueNow(this.progressBar, percent);\n this.updateTimer();\n }\n\n startTimer(): void {\n this.startTime = Date.now();\n this.timeUpdateTimer = window.setInterval(this.updateTimer.bind(this, false), 1000);\n this.updateTimer();\n }\n\n private stopTimer(): void {\n if (!this.timeUpdateTimer) {\n return;\n }\n clearInterval(this.timeUpdateTimer);\n this.updateTimer(true);\n delete this.timeUpdateTimer;\n }\n\n private updateTimer(precise?: boolean): void {\n this.arrangeDialog((this.element.parentNode as HTMLElement));\n if (!this.timeUpdateTimer || !this.time) {\n return;\n }\n const elapsed = (Date.now() - this.startTime) / 1000;\n this.time.textContent = i18nString(UIStrings.ssec, {PH1: elapsed.toFixed(precise ? 1 : 0)});\n }\n\n private arrangeDialog(parent: Element): void {\n const isSmallDialog = parent.clientWidth < 325;\n this.element.classList.toggle('small-dialog', isSmallDialog);\n this.contentElement.classList.toggle('small-dialog', isSmallDialog);\n }\n override wasShown(): void {\n super.wasShown();\n this.registerCSSFiles([timelineStatusDialogStyles]);\n }\n}\n\nlet loadTimelineHandlerInstance: LoadTimelineHandler;\n\nexport class LoadTimelineHandler implements Common.QueryParamHandler.QueryParamHandler {\n static instance(opts: {\n forceNew: boolean|null,\n } = {forceNew: null}): LoadTimelineHandler {\n const {forceNew} = opts;\n if (!loadTimelineHandlerInstance || forceNew) {\n loadTimelineHandlerInstance = new LoadTimelineHandler();\n }\n\n return loadTimelineHandlerInstance;\n }\n\n handleQueryParam(value: string): void {\n void UI.ViewManager.ViewManager.instance().showView('timeline').then(async () => {\n await TimelinePanel.instance().loadFromURL(window.decodeURIComponent(value) as Platform.DevToolsPath.UrlString);\n });\n }\n}\n\nexport class ActionDelegate implements UI.ActionRegistration.ActionDelegate {\n handleAction(context: UI.Context.Context, actionId: string): boolean {\n const panel = context.flavor(TimelinePanel);\n if (panel === null) {\n return false;\n }\n switch (actionId) {\n case 'timeline.toggle-recording':\n void panel.toggleRecording();\n return true;\n case 'timeline.record-reload':\n panel.recordReload();\n return true;\n case 'timeline.save-to-file':\n void panel.saveToFile();\n return true;\n case 'timeline.load-from-file':\n panel.selectFileToLoad();\n return true;\n case 'timeline.jump-to-previous-frame':\n panel.jumpToFrame(-1);\n return true;\n case 'timeline.jump-to-next-frame':\n panel.jumpToFrame(1);\n return true;\n case 'timeline.show-history':\n void panel.showHistory();\n return true;\n case 'timeline.previous-recording':\n panel.navigateHistory(1);\n return true;\n case 'timeline.next-recording':\n panel.navigateHistory(-1);\n return true;\n }\n return false;\n }\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/TimelineUIUtils.js b/public/panels/timeline/TimelineUIUtils.js index bf461b8d4..dc9ae85c0 100644 --- a/public/panels/timeline/TimelineUIUtils.js +++ b/public/panels/timeline/TimelineUIUtils.js @@ -38,6 +38,7 @@ import * as SDK from '../../core/sdk/sdk.js'; import * as Bindings from '../../models/bindings/bindings.js'; import * as TimelineModel from '../../models/timeline_model/timeline_model.js'; import * as TraceEngine from '../../models/trace/trace.js'; +import * as AnnotationsManager from '../../services/annotations_manager/annotations_manager.js'; import * as TraceBounds from '../../services/trace_bounds/trace_bounds.js'; import * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js'; // eslint-disable-next-line rulesdir/es_modules_import @@ -75,9 +76,9 @@ const UIStrings = { */ inputDelay: 'Input delay', /** - *@description Text shown next to the interaction event's thread processing time in the detail view. + *@description Text shown next to the interaction event's thread processing duration in the detail view. */ - processingTime: 'Processing time', + processingDuration: 'Processing duration', /** *@description Text shown next to the interaction event's presentation delay time in the detail view. */ @@ -1396,7 +1397,7 @@ export class TimelineUIUtils { const presentationDelay = TraceEngine.Helpers.Timing.formatMicrosecondsTime(payload.presentationDelay); contentHelper.appendTextRow(i18nString(UIStrings.interactionID), payload.interactionId); contentHelper.appendTextRow(i18nString(UIStrings.inputDelay), inputDelay); - contentHelper.appendTextRow(i18nString(UIStrings.processingTime), mainThreadTime); + contentHelper.appendTextRow(i18nString(UIStrings.processingDuration), mainThreadTime); contentHelper.appendTextRow(i18nString(UIStrings.presentationDelay), presentationDelay); } break; @@ -1730,7 +1731,7 @@ export class TimelineUIUtils { const isEntryOutsideBreadcrumb = traceBoundsState.micro.minimapTraceBounds.min > entry.ts + (entry.dur || 0) || traceBoundsState.micro.minimapTraceBounds.max < entry.ts; // Check if it is in the hidden array - const isEntryHidden = TraceEngine.EntriesFilter.EntriesFilter.maybeInstance()?.inEntryInvisible(entry); + const isEntryHidden = AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance()?.getEntriesFilter().inEntryInvisible(entry); if (!isEntryOutsideBreadcrumb) { link.classList.add('devtools-link'); UI.ARIAUtils.markAsLink(link); diff --git a/public/panels/timeline/TimelineUIUtils.js.map b/public/panels/timeline/TimelineUIUtils.js.map index c92a6a759..8cdf64f2d 100644 --- a/public/panels/timeline/TimelineUIUtils.js.map +++ b/public/panels/timeline/TimelineUIUtils.js.map @@ -1 +1 @@ -{"version":3,"file":"TimelineUIUtils.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineUIUtils.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA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,CAAC,WAAW,CAAC,KAAK,EAAE,yDAAyD,CAAC,CAAC;QACpG,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,mBAAmB,CAAC,8BAA8B,CACzF,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,iBAAiB,EAAE,EAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;QACvE,iBAAiB,CAAC,WAAW,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAC3D,CAAC;CACF;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAU7E;;;;;IAKI;AACJ,MAAM,UAAU,uDAAuD,CACnE,KAAmD,EACnD,eAA+D;IACjE,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,MAAM,EAAC,SAAS,EAAC,GAAG,WAAW,CAAC,MAAM,CAAC,2BAA2B,CAAC,KAAK,CAAC,CAAC;QAC1E,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,4CAA4C,CAChF,KAAK,EACL,eAAe,CAAC,IAAI,CAAC,WAAW,EAChC,eAAe,CAAC,IAAI,CAAC,yBAAyB,EAC9C,eAAe,CAAC,IAAI,CAAC,oBAAoB,CAC5C,CAAC;IACF,OAAO,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAC;AACrE,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/*\n * Copyright (C) 2013 Google Inc. All rights reserved.\n * Copyright (C) 2012 Intel Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport type * as Protocol from '../../generated/protocol.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as TimelineModel from '../../models/timeline_model/timeline_model.js';\nimport * as TraceEngine from '../../models/trace/trace.js';\nimport * as TraceBounds from '../../services/trace_bounds/trace_bounds.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\n// eslint-disable-next-line rulesdir/es_modules_import\nimport imagePreviewStyles from '../../ui/legacy/components/utils/imagePreview.css.js';\nimport * as LegacyComponents from '../../ui/legacy/components/utils/utils.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js';\n\nimport {CLSRect} from './CLSLinkifier.js';\nimport * as TimelineComponents from './components/components.js';\nimport {\n type CategoryPalette,\n getCategoryStyles,\n getEventStyle,\n maybeInitSylesMap,\n type TimelineCategory,\n TimelineRecordStyle,\n visibleTypes,\n} from './EventUICategory.js';\nimport {titleForInteractionEvent} from './InteractionsTrackAppender.js';\nimport {SourceMapsResolver} from './SourceMapsResolver.js';\nimport {TimelinePanel} from './TimelinePanel.js';\nimport {TimelineSelection} from './TimelineSelection.js';\n\nconst UIStrings = {\n /**\n *@description Text that only contain a placeholder\n *@example {100ms (at 200ms)} PH1\n */\n emptyPlaceholder: '{PH1}', // eslint-disable-line rulesdir/l10n_no_locked_or_placeholder_only_phrase\n /**\n *@description Text that refers to updated priority of network request\n */\n initialPriority: 'Initial Priority',\n /**\n *@description Text for timestamps of items\n */\n timestamp: 'Timestamp',\n /**\n *@description Text shown next to the interaction event's ID in the detail view.\n */\n interactionID: 'ID',\n /**\n *@description Text shown next to the interaction event's input delay time in the detail view.\n */\n inputDelay: 'Input delay',\n /**\n *@description Text shown next to the interaction event's thread processing time in the detail view.\n */\n processingTime: 'Processing time',\n /**\n *@description Text shown next to the interaction event's presentation delay time in the detail view.\n */\n presentationDelay: 'Presentation delay',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n compile: 'Compile',\n /**\n *@description Text to parse something\n */\n parse: 'Parse',\n /**\n *@description Text with two placeholders separated by a colon\n *@example {Node removed} PH1\n *@example {div#id1} PH2\n */\n sS: '{PH1}: {PH2}',\n /**\n *@description Details text in Timeline UIUtils of the Performance panel\n *@example {30 MB} PH1\n */\n sCollected: '{PH1} collected',\n /**\n *@description Details text in Timeline UIUtils of the Performance panel\n *@example {https://example.com} PH1\n *@example {2} PH2\n *@example {4} PH3\n */\n sSs: '{PH1} [{PH2}…{PH3}]',\n /**\n *@description Details text in Timeline UIUtils of the Performance panel\n *@example {https://example.com} PH1\n *@example {2} PH2\n */\n sSSquareBrackets: '{PH1} [{PH2}…]',\n /**\n *@description Text that is usually a hyperlink to more documentation\n */\n learnMore: 'Learn more',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n compilationCacheStatus: 'Compilation cache status',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n compilationCacheSize: 'Compilation cache size',\n /**\n *@description Text in Timeline UIUtils of the Performance panel. \"Compilation\n * cache\" refers to the code cache described at\n * https://v8.dev/blog/code-caching-for-devs . This label is followed by the\n * type of code cache data used, either \"normal\" or \"full\" as described in the\n * linked article.\n */\n compilationCacheKind: 'Compilation cache kind',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n scriptLoadedFromCache: 'script loaded from cache',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n failedToLoadScriptFromCache: 'failed to load script from cache',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n scriptNotEligible: 'script not eligible',\n /**\n *@description Text for the total time of something\n */\n totalTime: 'Total Time',\n /**\n *@description Time of a single activity, as opposed to the total time\n */\n selfTime: 'Self Time',\n /**\n *@description Label in the summary view in the Performance panel for a number which indicates how much managed memory has been reclaimed by performing Garbage Collection\n */\n collected: 'Collected',\n /**\n *@description Text for a programming function\n */\n function: 'Function',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n timerId: 'Timer ID',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n timeout: 'Timeout',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n repeats: 'Repeats',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n callbackId: 'Callback ID',\n /**\n *@description Text that refers to the network request method\n */\n requestMethod: 'Request Method',\n /**\n *@description Text to show the priority of an item\n */\n priority: 'Priority',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n encodedData: 'Encoded Data',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n decodedBody: 'Decoded Body',\n /**\n *@description Text for a module, the programming concept\n */\n module: 'Module',\n /**\n *@description Label for a group of JavaScript files\n */\n script: 'Script',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n streamed: 'Streamed',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n eagerCompile: 'Compiling all functions eagerly',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n url: 'Url',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n producedCacheSize: 'Produced Cache Size',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n consumedCacheSize: 'Consumed Cache Size',\n /**\n *@description Title for a group of cities\n */\n location: 'Location',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n *@example {2} PH1\n *@example {2} PH2\n */\n sSCurlyBrackets: '({PH1}, {PH2})',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n dimensions: 'Dimensions',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n *@example {2} PH1\n *@example {2} PH2\n */\n sSDimensions: '{PH1} × {PH2}',\n /**\n *@description Related node label in Timeline UIUtils of the Performance panel\n */\n layerRoot: 'Layer Root',\n /**\n *@description Related node label in Timeline UIUtils of the Performance panel\n */\n ownerElement: 'Owner Element',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n imageUrl: 'Image URL',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n stylesheetUrl: 'Stylesheet URL',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n elementsAffected: 'Elements Affected',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n nodesThatNeedLayout: 'Nodes That Need Layout',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n *@example {2} PH1\n *@example {10} PH2\n */\n sOfS: '{PH1} of {PH2}',\n /**\n *@description Related node label in Timeline UIUtils of the Performance panel\n */\n layoutRoot: 'Layout root',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n message: 'Message',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n callbackFunction: 'Callback Function',\n /**\n *@description The current state of an item\n */\n state: 'State',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n range: 'Range',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n allottedTime: 'Allotted Time',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n invokedByTimeout: 'Invoked by Timeout',\n /**\n *@description Text that refers to some types\n */\n type: 'Type',\n /**\n *@description Text for the size of something\n */\n size: 'Size',\n /**\n *@description Text for the details of something\n */\n details: 'Details',\n /**\n *@description Title in Timeline for Cumulative Layout Shifts\n */\n cumulativeLayoutShifts: 'Cumulative Layout Shifts',\n /**\n *@description Text for the link to the evolved CLS website\n */\n evolvedClsLink: 'evolved',\n /**\n *@description Warning in Timeline that CLS can cause a poor user experience. It contains a link to inform developers about the recent changes to how CLS is measured. The new CLS metric is said to have evolved from the previous version.\n *@example {Link to web.dev/metrics} PH1\n *@example {Link to web.dev/evolving-cls which will always have the text 'evolved'} PH2\n */\n sCLSInformation: '{PH1} can result in poor user experiences. It has recently {PH2}.',\n /**\n *@description Text to indicate an item is a warning\n */\n warning: 'Warning',\n /**\n *@description Title for the Timeline CLS Score\n */\n score: 'Score',\n /**\n *@description Text in Timeline for the cumulative CLS score\n */\n cumulativeScore: 'Cumulative Score',\n /**\n *@description Text in Timeline for the current CLS score\n */\n currentClusterScore: 'Current Cluster Score',\n /**\n *@description Text in Timeline for the current CLS cluster\n */\n currentClusterId: 'Current Cluster ID',\n /**\n *@description Text in Timeline for whether input happened recently\n */\n hadRecentInput: 'Had recent input',\n /**\n *@description Text in Timeline indicating that input has happened recently\n */\n yes: 'Yes',\n /**\n *@description Text in Timeline indicating that input has not happened recently\n */\n no: 'No',\n /**\n *@description Label for Cumulative Layout records, indicating where they moved from\n */\n movedFrom: 'Moved from',\n /**\n *@description Label for Cumulative Layout records, indicating where they moved to\n */\n movedTo: 'Moved to',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n relatedNode: 'Related Node',\n /**\n *@description Text for previewing items\n */\n preview: 'Preview',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n aggregatedTime: 'Aggregated Time',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n networkRequest: 'Network request',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n loadFromCache: 'load from cache',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n networkTransfer: 'network transfer',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n *@example {1ms} PH1\n *@example {network transfer} PH2\n *@example {1ms} PH3\n */\n SSSResourceLoading: ' ({PH1} {PH2} + {PH3} resource loading)',\n /**\n *@description Text for the duration of something\n */\n duration: 'Duration',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n mimeType: 'Mime Type',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n FromMemoryCache: ' (from memory cache)',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n FromCache: ' (from cache)',\n /**\n *@description Label for a network request indicating that it was a HTTP2 server push instead of a regular network request, in the Performance panel\n */\n FromPush: ' (from push)',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n FromServiceWorker: ' (from `service worker`)',\n /**\n *@description Text for the stack trace of the initiator of something. The Initiator is the event or factor that directly triggered or precipitated a subsequent action.\n */\n initiatorStackTrace: 'Initiator Stack Trace',\n /**\n *@description Text for the event initiated by another one\n */\n initiatedBy: 'Initiated by',\n /**\n *@description Text for the event that is an initiator for another one\n */\n initiatorFor: 'Initiator for',\n /**\n *@description Call site stack label in Timeline UIUtils of the Performance panel\n */\n timerInstalled: 'Timer Installed',\n /**\n *@description Call site stack label in Timeline UIUtils of the Performance panel\n */\n animationFrameRequested: 'Animation Frame Requested',\n /**\n *@description Call site stack label in Timeline UIUtils of the Performance panel\n */\n idleCallbackRequested: 'Idle Callback Requested',\n /**\n *@description Stack label in Timeline UIUtils of the Performance panel\n */\n recalculationForced: 'Recalculation Forced',\n /**\n *@description Call site stack label in Timeline UIUtils of the Performance panel\n */\n firstLayoutInvalidation: 'First Layout Invalidation',\n /**\n *@description Stack label in Timeline UIUtils of the Performance panel\n */\n layoutForced: 'Layout Forced',\n /**\n *@description Text for the execution stack trace\n */\n stackTrace: 'Stack Trace',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n invalidations: 'Invalidations',\n /**\n * @description Text in Timeline UIUtils of the Performance panel. Phrase is followed by a number of milliseconds.\n * Some events or tasks might have been only started, but have not ended yet. Such events or tasks are considered\n * \"pending\".\n */\n pendingFor: 'Pending for',\n /**\n *@description Noun label for a stack trace which indicates the first time some condition was invalidated.\n */\n firstInvalidated: 'First Invalidated',\n /**\n *@description Title of the paint profiler, old name of the performance pane\n */\n paintProfiler: 'Paint Profiler',\n /**\n *@description Text in Timeline Flame Chart View of the Performance panel\n *@example {Frame} PH1\n *@example {10ms} PH2\n */\n sAtS: '{PH1} at {PH2}',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n *@example {blink.console} PH1\n */\n sSelf: '{PH1} (self)',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n *@example {blink.console} PH1\n */\n sChildren: '{PH1} (children)',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n timeSpentInRendering: 'Time spent in rendering',\n /**\n *@description Text for a rendering frame\n */\n frame: 'Frame',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n *@example {10ms} PH1\n *@example {10ms} PH2\n */\n sAtSParentheses: '{PH1} (at {PH2})',\n /**\n *@description Text of a DOM element in Timeline UIUtils of the Performance panel\n */\n UnknownNode: '[ unknown node ]',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n *@example {node} PH1\n *@example {app.js} PH2\n */\n invalidationWithCallFrame: '{PH1} at {PH2}',\n /**\n *@description Text indicating that something is outside of the Performace Panel Timeline Minimap range\n */\n outsideBreadcrumbRange: '(outside of the breadcrumb range)',\n /**\n *@description Text indicating that something is hidden from the Performace Panel Timeline\n */\n entryIsHidden: '(entry is hidden)',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/TimelineUIUtils.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nlet eventDispatchDesciptors: EventDispatchTypeDescriptor[];\n\nlet colorGenerator: Common.Color.Generator;\n\nconst requestPreviewElements = new WeakMap();\n\ntype LinkifyLocationOptions = {\n scriptId: Protocol.Runtime.ScriptId|null,\n url: string,\n lineNumber: number,\n columnNumber?: number,\n isFreshRecording?: boolean, target: SDK.Target.Target|null, linkifier: LegacyComponents.Linkifier.Linkifier,\n};\n\nexport class TimelineUIUtils {\n\n static frameDisplayName(frame: Protocol.Runtime.CallFrame): string {\n if (!TimelineModel.TimelineJSProfile.TimelineJSProfileProcessor.isNativeRuntimeFrame(frame)) {\n return UI.UIUtils.beautifyFunctionName(frame.functionName);\n }\n const nativeGroup = TimelineModel.TimelineJSProfile.TimelineJSProfileProcessor.nativeGroup(frame.functionName);\n switch (nativeGroup) {\n case TimelineModel.TimelineJSProfile.TimelineJSProfileProcessor.NativeGroups.Compile:\n return i18nString(UIStrings.compile);\n case TimelineModel.TimelineJSProfile.TimelineJSProfileProcessor.NativeGroups.Parse:\n return i18nString(UIStrings.parse);\n }\n return frame.functionName;\n }\n\n static testContentMatching(\n traceEvent: TraceEngine.Legacy.CompatibleTraceEvent, regExp: RegExp,\n traceParsedData?: TraceEngine.Handlers.Types.TraceParseData): boolean {\n const title = TimelineUIUtils.eventStyle(traceEvent).title;\n const tokens = [title];\n\n if (TraceEngine.Legacy.eventIsFromNewEngine(traceEvent) &&\n TraceEngine.Types.TraceEvents.isProfileCall(traceEvent)) {\n // In the future this case will not be possible - wherever we call this\n // function we will be able to pass in the data from the new engine. But\n // currently this is called in a variety of places including from the\n // legacy model which does not have a reference to the new engine's data.\n // So if we are missing the data, we just fallback to the name from the\n // callFrame.\n if (!traceParsedData || !traceParsedData.Samples) {\n tokens.push(traceEvent.callFrame.functionName);\n } else {\n tokens.push(\n TraceEngine.Handlers.ModelHandlers.Samples.getProfileCallFunctionName(traceParsedData.Samples, traceEvent));\n }\n }\n const url = TimelineModel.TimelineModel.EventOnTimelineData.forEvent(traceEvent).url;\n if (url) {\n tokens.push(url);\n }\n // This works for both legacy and new engine events.\n appendObjectProperties(traceEvent.args, 2);\n const result = tokens.join('|').match(regExp);\n return result ? result.length > 0 : false;\n\n interface ContentObject {\n [x: string]: number|string|ContentObject;\n }\n function appendObjectProperties(object: ContentObject, depth: number): void {\n if (!depth) {\n return;\n }\n for (const key in object) {\n const value = object[key];\n if (typeof value === 'string') {\n tokens.push(value);\n } else if (typeof value === 'number') {\n tokens.push(String(value));\n } else if (typeof value === 'object' && value !== null) {\n appendObjectProperties(value, depth - 1);\n }\n }\n }\n }\n\n static eventStyle(event: TraceEngine.Legacy.CompatibleTraceEvent): TimelineRecordStyle {\n const eventStyles = maybeInitSylesMap();\n if (TraceEngine.Legacy.eventHasCategory(event, TimelineModel.TimelineModel.TimelineModelImpl.Category.Console) ||\n TraceEngine.Legacy.eventHasCategory(event, TimelineModel.TimelineModel.TimelineModelImpl.Category.UserTiming)) {\n return new TimelineRecordStyle(event.name, getCategoryStyles()['scripting']);\n }\n\n if (TraceEngine.Legacy.eventIsFromNewEngine(event)) {\n if (TraceEngine.Types.TraceEvents.isProfileCall(event)) {\n if (event.callFrame.functionName === '(idle)') {\n return new TimelineRecordStyle(event.name, getCategoryStyles().idle);\n }\n }\n const defaultStyles = new TimelineRecordStyle(event.name, getCategoryStyles().other);\n return getEventStyle(event.name as TraceEngine.Types.TraceEvents.KnownEventName) || defaultStyles;\n }\n\n let result = eventStyles[event.name as TraceEngine.Types.TraceEvents.KnownEventName];\n // If there's no defined RecordStyle for this event, define as other & hidden.\n if (!result) {\n result = new TimelineRecordStyle(event.name, getCategoryStyles()['other'], true);\n eventStyles[event.name as TraceEngine.Types.TraceEvents.KnownEventName] = result;\n }\n return result;\n }\n\n static eventColor(event: TraceEngine.Legacy.CompatibleTraceEvent): string {\n if (TraceEngine.Legacy.eventIsFromNewEngine(event) && TraceEngine.Types.TraceEvents.isProfileCall(event)) {\n const frame = event.callFrame;\n if (TimelineUIUtils.isUserFrame(frame)) {\n return TimelineUIUtils.colorForId(frame.url);\n }\n }\n let parsedColor = TimelineUIUtils.eventStyle(event).category.getComputedColorValue();\n // This event is considered idle time but still rendered as a scripting event here\n // to connect the StreamingCompileScriptParsing events it belongs to.\n if (event.name === TimelineModel.TimelineModel.RecordType.StreamingCompileScriptWaiting) {\n parsedColor = getCategoryStyles().scripting.getComputedColorValue();\n if (!parsedColor) {\n throw new Error('Unable to parse color from getCategoryStyles().scripting.color');\n }\n }\n return parsedColor;\n }\n\n static eventTitle(event: TraceEngine.Legacy.CompatibleTraceEvent): string {\n // Profile call events do not have a args.data property, thus, we\n // need to check for profile calls in the beginning of this\n // function.\n if (TraceEngine.Legacy.eventIsFromNewEngine(event) && TraceEngine.Types.TraceEvents.isProfileCall(event)) {\n const maybeResolvedName = SourceMapsResolver.resolvedNodeNameForEntry(event);\n const displayName = maybeResolvedName || TimelineUIUtils.frameDisplayName(event.callFrame);\n return displayName;\n }\n const recordType = TimelineModel.TimelineModel.RecordType;\n const eventData = event.args['data'];\n\n if (event.name === 'EventTiming') {\n let payload: TraceEngine.Types.TraceEvents.TraceEventData|null = null;\n if (event instanceof TraceEngine.Legacy.PayloadEvent) {\n payload = event.rawPayload();\n } else if (TraceEngine.Legacy.eventIsFromNewEngine(event)) {\n payload = event;\n }\n\n if (payload && TraceEngine.Types.TraceEvents.isSyntheticInteractionEvent(payload)) {\n return titleForInteractionEvent(payload);\n }\n }\n const title = TimelineUIUtils.eventStyle(event).title;\n if (TraceEngine.Legacy.eventHasCategory(event, TimelineModel.TimelineModel.TimelineModelImpl.Category.Console)) {\n return title;\n }\n if (event.name === recordType.TimeStamp) {\n return i18nString(UIStrings.sS, {PH1: title, PH2: eventData['message']});\n }\n if (event.name === recordType.Animation && eventData && eventData['name']) {\n return i18nString(UIStrings.sS, {PH1: title, PH2: eventData['name']});\n }\n if (event.name === recordType.EventDispatch && eventData && eventData['type']) {\n return i18nString(UIStrings.sS, {PH1: title, PH2: eventData['type']});\n }\n return title;\n }\n\n static isUserFrame(frame: Protocol.Runtime.CallFrame): boolean {\n return frame.scriptId !== '0' && !(frame.url && frame.url.startsWith('native '));\n }\n\n static syntheticNetworkRequestCategory(request: TraceEngine.Types.TraceEvents.SyntheticNetworkRequest):\n NetworkCategory {\n switch (request.args.data.mimeType) {\n case 'text/html':\n return NetworkCategory.HTML;\n case 'application/javascript':\n case 'application/x-javascript':\n case 'text/javascript':\n return NetworkCategory.Script;\n case 'text/css':\n return NetworkCategory.Style;\n case 'audio/ogg':\n case 'image/gif':\n case 'image/jpeg':\n case 'image/png':\n case 'image/svg+xml':\n case 'image/webp':\n case 'image/x-icon':\n case 'font/opentype':\n case 'font/woff2':\n case 'font/ttf':\n case 'application/font-woff':\n return NetworkCategory.Media;\n default:\n return NetworkCategory.Other;\n }\n }\n\n static networkCategoryColor(category: NetworkCategory): string {\n let cssVarName = '--app-color-system';\n switch (category) {\n case NetworkCategory.HTML:\n cssVarName = '--app-color-loading';\n break;\n case NetworkCategory.Script:\n cssVarName = '--app-color-scripting';\n break;\n case NetworkCategory.Style:\n cssVarName = '--app-color-rendering';\n break;\n case NetworkCategory.Media:\n cssVarName = '--app-color-painting';\n break;\n default:\n cssVarName = '--app-color-system';\n break;\n }\n return ThemeSupport.ThemeSupport.instance().getComputedValue(cssVarName);\n }\n\n static async buildDetailsTextForTraceEvent(event: TraceEngine.Legacy.Event|\n TraceEngine.Types.TraceEvents.TraceEventData): Promise {\n const recordType = TimelineModel.TimelineModel.RecordType;\n let detailsText;\n const eventData = event.args['data'];\n switch (event.name) {\n case recordType.GCEvent:\n case recordType.MajorGC:\n case recordType.MinorGC: {\n const delta = event.args['usedHeapSizeBefore'] - event.args['usedHeapSizeAfter'];\n detailsText = i18nString(UIStrings.sCollected, {PH1: Platform.NumberUtilities.bytesToString(delta)});\n break;\n }\n case recordType.FunctionCall:\n if (eventData && eventData['url'] && eventData['lineNumber'] !== undefined &&\n eventData['columnNumber'] !== undefined) {\n detailsText = eventData.url + ':' + (eventData.lineNumber + 1) + ':' + (eventData.columnNumber + 1);\n }\n break;\n case recordType.JSRoot:\n case recordType.JSFrame:\n case recordType.JSIdleFrame:\n case recordType.JSSystemFrame:\n detailsText = TimelineUIUtils.frameDisplayName(eventData);\n break;\n case recordType.EventDispatch:\n detailsText = eventData ? eventData['type'] : null;\n break;\n case recordType.Paint: {\n const width = TimelineUIUtils.quadWidth(eventData.clip);\n const height = TimelineUIUtils.quadHeight(eventData.clip);\n if (width && height) {\n detailsText = i18nString(UIStrings.sSDimensions, {PH1: width, PH2: height});\n }\n break;\n }\n case recordType.ParseHTML: {\n const startLine = event.args['beginData']['startLine'];\n const endLine = event.args['endData'] && event.args['endData']['endLine'];\n const url = Bindings.ResourceUtils.displayNameForURL(event.args['beginData']['url']);\n if (endLine >= 0) {\n detailsText = i18nString(UIStrings.sSs, {PH1: url, PH2: startLine + 1, PH3: endLine + 1});\n } else {\n detailsText = i18nString(UIStrings.sSSquareBrackets, {PH1: url, PH2: startLine + 1});\n }\n break;\n }\n case recordType.CompileModule:\n case recordType.CacheModule:\n detailsText = Bindings.ResourceUtils.displayNameForURL(event.args['fileName']);\n break;\n case recordType.CompileScript:\n case recordType.CacheScript:\n case recordType.EvaluateScript: {\n const url = eventData && eventData['url'];\n if (url) {\n detailsText = Bindings.ResourceUtils.displayNameForURL(url) + ':' + (eventData['lineNumber'] + 1);\n }\n break;\n }\n case recordType.WasmCompiledModule:\n case recordType.WasmModuleCacheHit: {\n const url = event.args['url'];\n if (url) {\n detailsText = Bindings.ResourceUtils.displayNameForURL(url);\n }\n break;\n }\n\n case recordType.StreamingCompileScript:\n case recordType.BackgroundDeserialize:\n case recordType.XHRReadyStateChange:\n case recordType.XHRLoad: {\n const url = eventData['url'];\n if (url) {\n detailsText = Bindings.ResourceUtils.displayNameForURL(url);\n }\n break;\n }\n case recordType.TimeStamp:\n detailsText = eventData['message'];\n break;\n\n case recordType.WebSocketCreate:\n case recordType.WebSocketSendHandshakeRequest:\n case recordType.WebSocketReceiveHandshakeResponse:\n case recordType.WebSocketDestroy:\n case recordType.ResourceWillSendRequest:\n case recordType.ResourceSendRequest:\n case recordType.ResourceReceivedData:\n case recordType.ResourceReceiveResponse:\n case recordType.ResourceFinish:\n case recordType.PaintImage:\n case recordType.DecodeImage:\n case recordType.ResizeImage:\n case recordType.DecodeLazyPixelRef: {\n const url = TimelineModel.TimelineModel.EventOnTimelineData.forEvent(event).url;\n if (url) {\n detailsText = Bindings.ResourceUtils.displayNameForURL(url);\n }\n break;\n }\n\n case recordType.EmbedderCallback:\n detailsText = eventData['callbackName'];\n break;\n\n case recordType.Animation:\n detailsText = eventData && eventData['name'];\n break;\n\n case recordType.AsyncTask:\n detailsText = eventData ? eventData['name'] : null;\n break;\n\n default:\n if (TraceEngine.Legacy.eventHasCategory(\n event, TimelineModel.TimelineModel.TimelineModelImpl.Category.Console)) {\n detailsText = null;\n } else {\n detailsText = await linkifyTopCallFrameAsText();\n }\n break;\n }\n\n return detailsText;\n\n async function linkifyTopCallFrameAsText(): Promise {\n const frame = TimelineModel.TimelineModel.EventOnTimelineData.forEvent(event).topFrame();\n if (!frame) {\n return null;\n }\n\n return frame.url + ':' + (frame.lineNumber + 1) + ':' + (frame.columnNumber + 1);\n }\n }\n\n static async buildDetailsNodeForTraceEvent(\n event: TraceEngine.Legacy.CompatibleTraceEvent, target: SDK.Target.Target|null,\n linkifier: LegacyComponents.Linkifier.Linkifier, isFreshRecording = false): Promise {\n const recordType = TimelineModel.TimelineModel.RecordType;\n let details: HTMLElement|HTMLSpanElement|(Element | null)|Text|null = null;\n let detailsText;\n const eventData = event.args['data'];\n switch (event.name) {\n case recordType.GCEvent:\n case recordType.MajorGC:\n case recordType.MinorGC:\n case recordType.EventDispatch:\n case recordType.Paint:\n case recordType.Animation:\n case recordType.EmbedderCallback:\n case recordType.ParseHTML:\n case recordType.WasmStreamFromResponseCallback:\n case recordType.WasmCompiledModule:\n case recordType.WasmModuleCacheHit:\n case recordType.WasmCachedModule:\n case recordType.WasmModuleCacheInvalid:\n case recordType.WebSocketCreate:\n case recordType.WebSocketSendHandshakeRequest:\n case recordType.WebSocketReceiveHandshakeResponse:\n case recordType.WebSocketDestroy: {\n detailsText = await TimelineUIUtils.buildDetailsTextForTraceEvent(event);\n break;\n }\n\n case recordType.PaintImage:\n case recordType.DecodeImage:\n case recordType.ResizeImage:\n case recordType.DecodeLazyPixelRef:\n case recordType.XHRReadyStateChange:\n case recordType.XHRLoad:\n case recordType.ResourceWillSendRequest:\n case recordType.ResourceSendRequest:\n case recordType.ResourceReceivedData:\n case recordType.ResourceReceiveResponse:\n case recordType.ResourceFinish: {\n const url = TimelineModel.TimelineModel.EventOnTimelineData.forEvent(event).url;\n if (url) {\n const options = {\n tabStop: true,\n showColumnNumber: false,\n inlineFrameIndex: 0,\n };\n details = LegacyComponents.Linkifier.Linkifier.linkifyURL(url, options);\n }\n break;\n }\n\n case recordType.JSRoot:\n case recordType.FunctionCall:\n case recordType.JSIdleFrame:\n case recordType.JSSystemFrame:\n case recordType.JSFrame: {\n details = document.createElement('span');\n UI.UIUtils.createTextChild(details, TimelineUIUtils.frameDisplayName(eventData));\n const location = this.linkifyLocation({\n scriptId: eventData['scriptId'],\n url: eventData['url'],\n lineNumber: eventData['lineNumber'],\n columnNumber: eventData['columnNumber'],\n target,\n isFreshRecording,\n linkifier,\n });\n if (location) {\n UI.UIUtils.createTextChild(details, ' @ ');\n details.appendChild(location);\n }\n break;\n }\n\n case recordType.CompileModule:\n case recordType.CacheModule: {\n details = this.linkifyLocation({\n scriptId: null,\n url: event.args['fileName'],\n lineNumber: 0,\n columnNumber: 0,\n target,\n isFreshRecording,\n linkifier,\n });\n break;\n }\n\n case recordType.CompileScript:\n case recordType.CacheScript:\n case recordType.EvaluateScript: {\n const url = eventData['url'];\n if (url) {\n details = this.linkifyLocation({\n scriptId: null,\n url,\n lineNumber: eventData['lineNumber'],\n columnNumber: 0,\n target,\n isFreshRecording,\n linkifier,\n });\n }\n break;\n }\n\n case recordType.BackgroundDeserialize:\n case recordType.StreamingCompileScript: {\n const url = eventData['url'];\n if (url) {\n details = this.linkifyLocation(\n {scriptId: null, url, lineNumber: 0, columnNumber: 0, target, isFreshRecording, linkifier});\n }\n break;\n }\n case TraceEngine.Types.TraceEvents.KnownEventName.ProfileCall: {\n details = document.createElement('span');\n // This check is only added for convenience with the type checker.\n if (!TraceEngine.Legacy.eventIsFromNewEngine(event) || !TraceEngine.Types.TraceEvents.isProfileCall(event)) {\n break;\n }\n const maybeResolvedName = SourceMapsResolver.resolvedNodeNameForEntry(event);\n const functionName = maybeResolvedName || TimelineUIUtils.frameDisplayName(event.callFrame);\n UI.UIUtils.createTextChild(details, functionName);\n const location = this.linkifyLocation({\n scriptId: event.callFrame['scriptId'],\n url: event.callFrame['url'],\n lineNumber: event.callFrame['lineNumber'],\n columnNumber: event.callFrame['columnNumber'],\n target,\n isFreshRecording,\n linkifier,\n });\n if (location) {\n UI.UIUtils.createTextChild(details, ' @ ');\n details.appendChild(location);\n }\n break;\n }\n\n default: {\n if (TraceEngine.Legacy.eventHasCategory(\n event, TimelineModel.TimelineModel.TimelineModelImpl.Category.Console)) {\n detailsText = null;\n } else {\n details = TraceEngine.Legacy.eventIsFromNewEngine(event) ?\n this.linkifyTopCallFrame(event, target, linkifier, isFreshRecording) :\n null;\n }\n break;\n }\n }\n\n if (!details && detailsText) {\n details = document.createTextNode(detailsText);\n }\n return details;\n }\n\n static linkifyLocation(linkifyOptions: LinkifyLocationOptions): Element|null {\n const {scriptId, url, lineNumber, columnNumber, isFreshRecording, linkifier, target} = linkifyOptions;\n const options = {\n lineNumber,\n columnNumber,\n showColumnNumber: true,\n inlineFrameIndex: 0,\n className: 'timeline-details',\n tabStop: true,\n };\n if (isFreshRecording) {\n return linkifier.linkifyScriptLocation(\n target, scriptId, url as Platform.DevToolsPath.UrlString, lineNumber, options);\n }\n return LegacyComponents.Linkifier.Linkifier.linkifyURL(url as Platform.DevToolsPath.UrlString, options);\n }\n\n static linkifyTopCallFrame(\n event: TraceEngine.Types.TraceEvents.TraceEventData, target: SDK.Target.Target|null,\n linkifier: LegacyComponents.Linkifier.Linkifier, isFreshRecording = false): Element|null {\n const frame = TimelineModel.TimelineProfileTree.eventStackFrame(event);\n if (!frame) {\n return null;\n }\n const options = {\n className: 'timeline-details',\n tabStop: true,\n inlineFrameIndex: 0,\n showColumnNumber: true,\n columnNumber: frame.columnNumber,\n lineNumber: frame.lineNumber,\n };\n if (isFreshRecording) {\n return linkifier.maybeLinkifyConsoleCallFrame(target, frame, {showColumnNumber: true, inlineFrameIndex: 0});\n }\n return LegacyComponents.Linkifier.Linkifier.linkifyURL(frame.url as Platform.DevToolsPath.UrlString, options);\n }\n\n static buildDetailsNodeForPerformanceEvent(event: TraceEngine.Legacy.Event|\n TraceEngine.Types.TraceEvents.TraceEventData): Element {\n let link = 'https://web.dev/user-centric-performance-metrics/';\n let name = 'page performance metrics';\n const recordType = TimelineModel.TimelineModel.RecordType;\n switch (event.name) {\n case recordType.MarkLCPCandidate:\n link = 'https://web.dev/lcp/';\n name = 'largest contentful paint';\n break;\n case recordType.MarkFCP:\n link = 'https://web.dev/first-contentful-paint/';\n name = 'first contentful paint';\n break;\n default:\n break;\n }\n\n return UI.Fragment.html`
${\n UI.XLink.XLink.create(\n link, i18nString(UIStrings.learnMore), undefined, undefined, 'learn-more')} about ${name}.
`;\n }\n\n static buildConsumeCacheDetails(\n eventData: {\n consumedCacheSize?: number,\n cacheRejected?: boolean,\n cacheKind?: string,\n },\n contentHelper: TimelineDetailsContentHelper): void {\n if (typeof eventData.consumedCacheSize === 'number') {\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheStatus), i18nString(UIStrings.scriptLoadedFromCache));\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheSize),\n Platform.NumberUtilities.bytesToString(eventData.consumedCacheSize));\n const cacheKind = eventData.cacheKind;\n if (cacheKind) {\n contentHelper.appendTextRow(i18nString(UIStrings.compilationCacheKind), cacheKind);\n }\n } else if ('cacheRejected' in eventData && eventData['cacheRejected']) {\n // Version mismatch or similar.\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheStatus), i18nString(UIStrings.failedToLoadScriptFromCache));\n } else {\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheStatus), i18nString(UIStrings.scriptNotEligible));\n }\n }\n\n static async buildTraceEventDetails(\n event: TraceEngine.Legacy.CompatibleTraceEvent,\n model: TimelineModel.TimelineModel.TimelineModelImpl,\n linkifier: LegacyComponents.Linkifier.Linkifier,\n detailed: boolean,\n // TODO(crbug.com/1430809): the order of these arguments is slightly\n // awkward because to change them is to cause a lot of layout tests to be\n // updated. We should rewrite those tests as unit tests in this codebase,\n // and then we can more easily change this method.\n traceParseData: TraceEngine.Handlers.Types.TraceParseData|null = null,\n ): Promise {\n const maybeTarget = model.targetByEvent(event);\n const {duration, selfTime} = TraceEngine.Legacy.timesForEventInMilliseconds(event);\n let relatedNodesMap: (Map|null)|null = null;\n if (maybeTarget) {\n const target = (maybeTarget as SDK.Target.Target);\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n if (typeof event[previewElementSymbol] === 'undefined') {\n let previewElement: (Element|null)|null = null;\n const url = TimelineModel.TimelineModel.EventOnTimelineData.forEvent(event).url;\n if (url) {\n previewElement = await LegacyComponents.ImagePreview.ImagePreview.build(target, url, false, {\n imageAltText: LegacyComponents.ImagePreview.ImagePreview.defaultAltTextForImageURL(url),\n precomputedFeatures: undefined,\n });\n } else if (\n traceParseData && TraceEngine.Legacy.eventIsFromNewEngine(event) &&\n TraceEngine.Types.TraceEvents.isTraceEventPaint(event)) {\n previewElement = await TimelineUIUtils.buildPicturePreviewContent(traceParseData, event, target);\n }\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n event[previewElementSymbol] = previewElement;\n }\n\n const nodeIdsToResolve = new Set();\n const timelineData = TimelineModel.TimelineModel.EventOnTimelineData.forEvent(event);\n if (timelineData.backendNodeIds) {\n for (let i = 0; i < timelineData.backendNodeIds.length; ++i) {\n nodeIdsToResolve.add(timelineData.backendNodeIds[i]);\n }\n }\n if (nodeIdsToResolve.size) {\n const domModel = target.model(SDK.DOMModel.DOMModel);\n if (domModel) {\n relatedNodesMap = await domModel.pushNodesByBackendIdsToFrontend(nodeIdsToResolve);\n }\n }\n if (traceParseData && TraceEngine.Legacy.eventIsFromNewEngine(event) &&\n TraceEngine.Types.TraceEvents.isSyntheticLayoutShift(event)) {\n relatedNodesMap = await TraceEngine.Extras.FetchNodes.extractRelatedDOMNodesFromEvent(traceParseData, event);\n }\n }\n\n const recordTypes = TimelineModel.TimelineModel.RecordType;\n\n if (event.name === recordTypes.LayoutShift) {\n // Ensure that there are no pie charts or extended info for layout shifts.\n detailed = false;\n }\n\n // This message may vary per event.name;\n let relatedNodeLabel;\n\n const contentHelper = new TimelineDetailsContentHelper(model.targetByEvent(event), linkifier);\n\n const defaultColorForEvent = TraceEngine.Legacy.eventIsFromNewEngine(event) ?\n getEventStyle(event.name as TraceEngine.Types.TraceEvents.KnownEventName)?.category.getComputedColorValue() :\n TimelineUIUtils.eventStyle(event).category.getComputedColorValue();\n const color = model.isMarkerEvent(event) ? TimelineUIUtils.markerStyleForEvent(event).color : defaultColorForEvent;\n\n contentHelper.addSection(TimelineUIUtils.eventTitle(event), color);\n\n const eventData = event.args['data'];\n const timelineData = TimelineModel.TimelineModel.EventOnTimelineData.forEvent(event);\n const initiator = TraceEngine.Legacy.eventIsFromNewEngine(event) ?\n traceParseData?.Initiators.eventToInitiator.get(event) ?? null :\n null;\n const initiatorFor = TraceEngine.Legacy.eventIsFromNewEngine(event) ?\n traceParseData?.Initiators.initiatorToEvents.get(event) ?? null :\n null;\n\n let url: Platform.DevToolsPath.UrlString|null = null;\n\n if (TraceEngine.Legacy.eventIsFromNewEngine(event) && traceParseData) {\n const warnings = TimelineComponents.DetailsView.buildWarningElementsForEvent(event, traceParseData);\n for (const warning of warnings) {\n contentHelper.appendElementRow(i18nString(UIStrings.warning), warning, true);\n }\n }\n if (detailed && !Number.isNaN(duration || 0)) {\n contentHelper.appendTextRow(\n i18nString(UIStrings.totalTime), i18n.TimeUtilities.millisToString(duration || 0, true));\n contentHelper.appendTextRow(i18nString(UIStrings.selfTime), i18n.TimeUtilities.millisToString(selfTime, true));\n }\n\n if (traceParseData?.Meta.traceIsGeneric) {\n for (const key in event.args) {\n try {\n contentHelper.appendTextRow(key, JSON.stringify(event.args[key]));\n } catch (e) {\n contentHelper.appendTextRow(key, `<${typeof event.args[key]}>`);\n }\n }\n return contentHelper.fragment;\n }\n\n if (TraceEngine.Legacy.eventIsFromNewEngine(event) && TraceEngine.Types.TraceEvents.isTraceEventV8Compile(event)) {\n url = event.args.data?.url as Platform.DevToolsPath.UrlString;\n if (url) {\n const lineNumber = event.args?.data?.lineNumber || 0;\n const columnNumber = event.args?.data?.columnNumber;\n contentHelper.appendLocationRow(i18nString(UIStrings.script), url, lineNumber, columnNumber);\n }\n const isEager = Boolean(event.args.data?.eager);\n if (isEager) {\n contentHelper.appendTextRow(i18nString(UIStrings.eagerCompile), true);\n }\n\n const isStreamed = Boolean(event.args.data?.streamed);\n contentHelper.appendTextRow(\n i18nString(UIStrings.streamed),\n isStreamed + (isStreamed ? '' : `: ${event.args.data?.notStreamedReason || ''}`));\n TimelineUIUtils.buildConsumeCacheDetails(eventData, contentHelper);\n }\n\n switch (event.name) {\n case recordTypes.GCEvent:\n case recordTypes.MajorGC:\n case recordTypes.MinorGC: {\n const delta = event.args['usedHeapSizeBefore'] - event.args['usedHeapSizeAfter'];\n contentHelper.appendTextRow(i18nString(UIStrings.collected), Platform.NumberUtilities.bytesToString(delta));\n break;\n }\n\n case recordTypes.JSRoot:\n case recordTypes.JSFrame:\n case TraceEngine.Types.TraceEvents.KnownEventName.ProfileCall:\n case recordTypes.JSIdleFrame:\n case recordTypes.JSSystemFrame:\n case recordTypes.FunctionCall: {\n const detailsNode = await TimelineUIUtils.buildDetailsNodeForTraceEvent(\n event, model.targetByEvent(event), linkifier, model.isFreshRecording());\n if (detailsNode) {\n contentHelper.appendElementRow(i18nString(UIStrings.function), detailsNode);\n }\n break;\n }\n\n case recordTypes.TimerFire:\n case recordTypes.TimerInstall:\n case recordTypes.TimerRemove: {\n contentHelper.appendTextRow(i18nString(UIStrings.timerId), eventData['timerId']);\n if (event.name === recordTypes.TimerInstall) {\n contentHelper.appendTextRow(\n i18nString(UIStrings.timeout), i18n.TimeUtilities.millisToString(eventData['timeout']));\n contentHelper.appendTextRow(i18nString(UIStrings.repeats), !eventData['singleShot']);\n }\n break;\n }\n\n case recordTypes.FireAnimationFrame: {\n contentHelper.appendTextRow(i18nString(UIStrings.callbackId), eventData['id']);\n break;\n }\n\n case recordTypes.CompileModule: {\n contentHelper.appendLocationRow(i18nString(UIStrings.module), event.args['fileName'], 0);\n break;\n }\n case recordTypes.CompileScript: {\n // This case is handled above\n break;\n }\n\n case recordTypes.CacheModule: {\n url = eventData && eventData['url'] as Platform.DevToolsPath.UrlString;\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheSize),\n Platform.NumberUtilities.bytesToString(eventData['producedCacheSize']));\n break;\n }\n\n case recordTypes.CacheScript: {\n url = eventData && eventData['url'] as Platform.DevToolsPath.UrlString;\n if (url) {\n contentHelper.appendLocationRow(\n i18nString(UIStrings.script), url, eventData['lineNumber'], eventData['columnNumber']);\n }\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheSize),\n Platform.NumberUtilities.bytesToString(eventData['producedCacheSize']));\n break;\n }\n\n case recordTypes.EvaluateScript: {\n url = eventData && eventData['url'] as Platform.DevToolsPath.UrlString;\n if (url) {\n contentHelper.appendLocationRow(\n i18nString(UIStrings.script), url, eventData['lineNumber'], eventData['columnNumber']);\n }\n break;\n }\n\n case recordTypes.WasmStreamFromResponseCallback:\n case recordTypes.WasmCompiledModule:\n case recordTypes.WasmCachedModule:\n case recordTypes.WasmModuleCacheHit:\n case recordTypes.WasmModuleCacheInvalid: {\n if (eventData) {\n url = event.args['url'] as Platform.DevToolsPath.UrlString;\n if (url) {\n contentHelper.appendTextRow(i18nString(UIStrings.url), url);\n }\n const producedCachedSize = event.args['producedCachedSize'];\n if (producedCachedSize) {\n contentHelper.appendTextRow(i18nString(UIStrings.producedCacheSize), producedCachedSize);\n }\n const consumedCachedSize = event.args['consumedCachedSize'];\n if (consumedCachedSize) {\n contentHelper.appendTextRow(i18nString(UIStrings.consumedCacheSize), consumedCachedSize);\n }\n }\n break;\n }\n\n // @ts-ignore Fall-through intended.\n case recordTypes.Paint: {\n const clip = eventData['clip'];\n contentHelper.appendTextRow(\n i18nString(UIStrings.location), i18nString(UIStrings.sSCurlyBrackets, {PH1: clip[0], PH2: clip[1]}));\n const clipWidth = TimelineUIUtils.quadWidth(clip);\n const clipHeight = TimelineUIUtils.quadHeight(clip);\n contentHelper.appendTextRow(\n i18nString(UIStrings.dimensions), i18nString(UIStrings.sSDimensions, {PH1: clipWidth, PH2: clipHeight}));\n }\n\n case recordTypes.PaintSetup:\n case recordTypes.Rasterize:\n case recordTypes.ScrollLayer: {\n relatedNodeLabel = i18nString(UIStrings.layerRoot);\n break;\n }\n\n case recordTypes.PaintImage:\n case recordTypes.DecodeLazyPixelRef:\n case recordTypes.DecodeImage:\n case recordTypes.ResizeImage:\n case recordTypes.DrawLazyPixelRef: {\n relatedNodeLabel = i18nString(UIStrings.ownerElement);\n url = timelineData.url;\n if (url) {\n const options = {\n tabStop: true,\n showColumnNumber: false,\n inlineFrameIndex: 0,\n };\n contentHelper.appendElementRow(\n i18nString(UIStrings.imageUrl), LegacyComponents.Linkifier.Linkifier.linkifyURL(url, options));\n }\n break;\n }\n\n case recordTypes.ParseAuthorStyleSheet: {\n url = eventData['styleSheetUrl'] as Platform.DevToolsPath.UrlString;\n if (url) {\n const options = {\n tabStop: true,\n showColumnNumber: false,\n inlineFrameIndex: 0,\n };\n contentHelper.appendElementRow(\n i18nString(UIStrings.stylesheetUrl), LegacyComponents.Linkifier.Linkifier.linkifyURL(url, options));\n }\n break;\n }\n\n case recordTypes.UpdateLayoutTree: // We don't want to see default details.\n case recordTypes.RecalculateStyles: {\n contentHelper.appendTextRow(i18nString(UIStrings.elementsAffected), event.args['elementCount']);\n break;\n }\n\n case recordTypes.Layout: {\n const beginData = event.args['beginData'];\n contentHelper.appendTextRow(\n i18nString(UIStrings.nodesThatNeedLayout),\n i18nString(UIStrings.sOfS, {PH1: beginData['dirtyObjects'], PH2: beginData['totalObjects']}));\n relatedNodeLabel = i18nString(UIStrings.layoutRoot);\n break;\n }\n\n case recordTypes.ConsoleTime: {\n contentHelper.appendTextRow(i18nString(UIStrings.message), event.name);\n break;\n }\n\n case recordTypes.WebSocketCreate:\n case recordTypes.WebSocketSendHandshakeRequest:\n case recordTypes.WebSocketReceiveHandshakeResponse:\n case recordTypes.WebSocketDestroy: {\n // The events will be from tthe new engine; as we remove the old engine we can remove these checks.\n if (TraceEngine.Legacy.eventIsFromNewEngine(event) &&\n TraceEngine.Types.TraceEvents.isWebSocketTraceEvent(event) && traceParseData) {\n const rows = TimelineComponents.DetailsView.buildRowsForWebSocketEvent(event, traceParseData);\n for (const {key, value} of rows) {\n contentHelper.appendTextRow(key, value);\n }\n }\n break;\n }\n\n case recordTypes.EmbedderCallback: {\n contentHelper.appendTextRow(i18nString(UIStrings.callbackFunction), eventData['callbackName']);\n break;\n }\n\n case recordTypes.Animation: {\n if (TraceEngine.Legacy.phaseForEvent(event) === TraceEngine.Types.TraceEvents.Phase.ASYNC_NESTABLE_INSTANT) {\n contentHelper.appendTextRow(i18nString(UIStrings.state), eventData['state']);\n }\n break;\n }\n\n case recordTypes.ParseHTML: {\n const beginData = event.args['beginData'];\n const startLine = beginData['startLine'] - 1;\n const endLine = event.args['endData'] ? event.args['endData']['endLine'] - 1 : undefined;\n url = beginData['url'];\n if (url) {\n contentHelper.appendLocationRange(i18nString(UIStrings.range), url, startLine, endLine);\n }\n break;\n }\n\n // @ts-ignore Fall-through intended.\n case recordTypes.FireIdleCallback: {\n contentHelper.appendTextRow(\n i18nString(UIStrings.allottedTime), i18n.TimeUtilities.millisToString(eventData['allottedMilliseconds']));\n contentHelper.appendTextRow(i18nString(UIStrings.invokedByTimeout), eventData['timedOut']);\n }\n\n case recordTypes.RequestIdleCallback:\n case recordTypes.CancelIdleCallback: {\n contentHelper.appendTextRow(i18nString(UIStrings.callbackId), eventData['id']);\n break;\n }\n\n case recordTypes.EventDispatch: {\n contentHelper.appendTextRow(i18nString(UIStrings.type), eventData['type']);\n break;\n }\n\n // @ts-ignore Fall-through intended.\n case recordTypes.MarkLCPCandidate: {\n contentHelper.appendTextRow(i18nString(UIStrings.type), String(eventData['type']));\n contentHelper.appendTextRow(i18nString(UIStrings.size), String(eventData['size']));\n }\n\n case recordTypes.MarkFirstPaint:\n case recordTypes.MarkFCP:\n case recordTypes.MarkLoad:\n case recordTypes.MarkDOMContent: {\n // Because the TimingsTrack has been migrated to the new engine, we\n // know that this conditonal will be true, but it is here to satisfy\n // TypeScript. That is also why there is no else branch for this -\n // there is no way in which timings here can be the legacy\n // SDKTraceEvent class.\n if (traceParseData && TraceEngine.Legacy.eventIsFromNewEngine(event)) {\n const adjustedEventTimeStamp = timeStampForEventAdjustedForClosestNavigationIfPossible(\n event,\n traceParseData,\n );\n\n contentHelper.appendTextRow(\n i18nString(UIStrings.timestamp), i18n.TimeUtilities.preciseMillisToString(adjustedEventTimeStamp, 1));\n contentHelper.appendElementRow(\n i18nString(UIStrings.details), TimelineUIUtils.buildDetailsNodeForPerformanceEvent(event));\n }\n\n break;\n }\n\n case recordTypes.EventTiming: {\n const detailsNode = await TimelineUIUtils.buildDetailsNodeForTraceEvent(\n event, model.targetByEvent(event), linkifier, model.isFreshRecording());\n if (detailsNode) {\n contentHelper.appendElementRow(i18nString(UIStrings.details), detailsNode);\n }\n let payload: TraceEngine.Types.TraceEvents.TraceEventData|null = null;\n if (TraceEngine.Legacy.eventIsFromNewEngine(event)) {\n payload = event;\n } else if (TraceEngine.Legacy.eventHasPayload(event)) {\n payload = event.rawPayload();\n }\n\n if (payload && TraceEngine.Types.TraceEvents.isSyntheticInteractionEvent(payload)) {\n const inputDelay = TraceEngine.Helpers.Timing.formatMicrosecondsTime(payload.inputDelay);\n const mainThreadTime = TraceEngine.Helpers.Timing.formatMicrosecondsTime(payload.mainThreadHandling);\n const presentationDelay = TraceEngine.Helpers.Timing.formatMicrosecondsTime(payload.presentationDelay);\n contentHelper.appendTextRow(i18nString(UIStrings.interactionID), payload.interactionId);\n contentHelper.appendTextRow(i18nString(UIStrings.inputDelay), inputDelay);\n contentHelper.appendTextRow(i18nString(UIStrings.processingTime), mainThreadTime);\n contentHelper.appendTextRow(i18nString(UIStrings.presentationDelay), presentationDelay);\n }\n break;\n }\n\n case recordTypes.LayoutShift: {\n if (!TraceEngine.Legacy.eventIsFromNewEngine(event) ||\n !TraceEngine.Types.TraceEvents.isSyntheticLayoutShift(event)) {\n console.error('Unexpected type for LayoutShift event');\n break;\n }\n const layoutShift = event as TraceEngine.Types.TraceEvents.SyntheticLayoutShift;\n const layoutShiftEventData = layoutShift.args.data;\n const warning = document.createElement('span');\n const clsLink = UI.XLink.XLink.create(\n 'https://web.dev/cls/', i18nString(UIStrings.cumulativeLayoutShifts), undefined, undefined,\n 'cumulative-layout-shifts');\n const evolvedClsLink = UI.XLink.XLink.create(\n 'https://web.dev/evolving-cls/', i18nString(UIStrings.evolvedClsLink), undefined, undefined, 'evolved-cls');\n\n warning.appendChild(\n i18n.i18n.getFormatLocalizedString(str_, UIStrings.sCLSInformation, {PH1: clsLink, PH2: evolvedClsLink}));\n contentHelper.appendElementRow(i18nString(UIStrings.warning), warning, true);\n if (!layoutShiftEventData) {\n break;\n }\n contentHelper.appendTextRow(i18nString(UIStrings.score), layoutShiftEventData['score'].toPrecision(4));\n contentHelper.appendTextRow(\n i18nString(UIStrings.cumulativeScore), layoutShiftEventData['cumulative_score'].toPrecision(4));\n contentHelper.appendTextRow(\n i18nString(UIStrings.currentClusterId), layoutShift.parsedData.sessionWindowData.id);\n contentHelper.appendTextRow(\n i18nString(UIStrings.currentClusterScore),\n layoutShift.parsedData.sessionWindowData.cumulativeWindowScore.toPrecision(4));\n contentHelper.appendTextRow(\n i18nString(UIStrings.hadRecentInput),\n eventData['had_recent_input'] ? i18nString(UIStrings.yes) : i18nString(UIStrings.no));\n\n for (const impactedNode of eventData['impacted_nodes']) {\n const oldRect = new CLSRect(impactedNode['old_rect']);\n const newRect = new CLSRect(impactedNode['new_rect']);\n\n const linkedOldRect = await Common.Linkifier.Linkifier.linkify(oldRect);\n const linkedNewRect = await Common.Linkifier.Linkifier.linkify(newRect);\n\n contentHelper.appendElementRow(i18nString(UIStrings.movedFrom), linkedOldRect);\n contentHelper.appendElementRow(i18nString(UIStrings.movedTo), linkedNewRect);\n }\n\n break;\n }\n\n default: {\n const detailsNode = await TimelineUIUtils.buildDetailsNodeForTraceEvent(\n event, model.targetByEvent(event), linkifier, model.isFreshRecording());\n if (detailsNode) {\n contentHelper.appendElementRow(i18nString(UIStrings.details), detailsNode);\n }\n break;\n }\n }\n const relatedNodes = relatedNodesMap?.values() || [];\n for (const relatedNode of relatedNodes) {\n if (relatedNode) {\n const nodeSpan = await Common.Linkifier.Linkifier.linkify(relatedNode);\n contentHelper.appendElementRow(relatedNodeLabel || i18nString(UIStrings.relatedNode), nodeSpan);\n }\n }\n\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n if (event[previewElementSymbol]) {\n contentHelper.addSection(i18nString(UIStrings.preview));\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n contentHelper.appendElementRow('', event[previewElementSymbol]);\n }\n\n if (TraceEngine.Legacy.eventIsFromNewEngine(event) && traceParseData) {\n const stackTrace = TraceEngine.Helpers.Trace.stackTraceForEvent(event);\n if (initiator || initiatorFor || stackTrace || traceParseData?.Invalidations.invalidationsForEvent.get(event)) {\n await TimelineUIUtils.generateCauses(event, contentHelper, traceParseData);\n }\n }\n\n const stats: {\n [x: string]: number,\n } = {};\n const showPieChart =\n detailed && traceParseData && TimelineUIUtils.aggregatedStatsForTraceEvent(stats, traceParseData, event);\n if (showPieChart) {\n contentHelper.addSection(i18nString(UIStrings.aggregatedTime));\n const pieChart = TimelineUIUtils.generatePieChart(stats, TimelineUIUtils.eventStyle(event).category, selfTime);\n contentHelper.appendElementRow('', pieChart);\n }\n\n return contentHelper.fragment;\n }\n\n static statsForTimeRange(events: TraceEngine.Legacy.CompatibleTraceEvent[], startTime: number, endTime: number): {\n [x: string]: number,\n } {\n if (!events.length) {\n return {'idle': endTime - startTime};\n }\n\n buildRangeStatsCacheIfNeeded(events);\n const aggregatedStats = subtractStats(aggregatedStatsAtTime(endTime), aggregatedStatsAtTime(startTime));\n const aggregatedTotal = Object.values(aggregatedStats).reduce((a, b) => a + b, 0);\n aggregatedStats['idle'] = Math.max(0, endTime - startTime - aggregatedTotal);\n return aggregatedStats;\n\n function aggregatedStatsAtTime(time: number): {\n [x: string]: number,\n } {\n const stats: {\n [x: string]: number,\n } = {};\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n const cache = events[categoryBreakdownCacheSymbol];\n for (const category in cache) {\n const categoryCache = cache[category];\n const index =\n Platform.ArrayUtilities.upperBound(categoryCache.time, time, Platform.ArrayUtilities.DEFAULT_COMPARATOR);\n let value;\n if (index === 0) {\n value = 0;\n } else if (index === categoryCache.time.length) {\n value = categoryCache.value[categoryCache.value.length - 1];\n } else {\n const t0 = categoryCache.time[index - 1];\n const t1 = categoryCache.time[index];\n const v0 = categoryCache.value[index - 1];\n const v1 = categoryCache.value[index];\n value = v0 + (v1 - v0) * (time - t0) / (t1 - t0);\n }\n stats[category] = value;\n }\n return stats;\n }\n\n function subtractStats(\n a: {\n [x: string]: number,\n },\n b: {\n [x: string]: number,\n }): {\n [x: string]: number,\n } {\n const result = Object.assign({}, a);\n for (const key in b) {\n result[key] -= b[key];\n }\n return result;\n }\n\n function buildRangeStatsCacheIfNeeded(events: TraceEngine.Legacy.CompatibleTraceEvent[]): void {\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n if (events[categoryBreakdownCacheSymbol]) {\n return;\n }\n\n // aggeregatedStats is a map by categories. For each category there's an array\n // containing sorted time points which records accumulated value of the category.\n const aggregatedStats: {\n [x: string]: {\n time: number[],\n value: number[],\n },\n } = {};\n const categoryStack: string[] = [];\n let lastTime = 0;\n TimelineModel.TimelineModel.TimelineModelImpl.forEachEvent(events, onStartEvent, onEndEvent);\n\n function updateCategory(category: string, time: number): void {\n let statsArrays: {\n time: number[],\n value: number[],\n } = aggregatedStats[category];\n if (!statsArrays) {\n statsArrays = {time: [], value: []};\n aggregatedStats[category] = statsArrays;\n }\n if (statsArrays.time.length && statsArrays.time[statsArrays.time.length - 1] === time || lastTime > time) {\n return;\n }\n const lastValue = statsArrays.value.length > 0 ? statsArrays.value[statsArrays.value.length - 1] : 0;\n statsArrays.value.push(lastValue + time - lastTime);\n statsArrays.time.push(time);\n }\n\n function categoryChange(from: string|null, to: string|null, time: number): void {\n if (from) {\n updateCategory(from, time);\n }\n lastTime = time;\n if (to) {\n updateCategory(to, time);\n }\n }\n\n function onStartEvent(e: TraceEngine.Legacy.CompatibleTraceEvent): void {\n const {startTime} = TraceEngine.Legacy.timesForEventInMilliseconds(e);\n const category = getEventStyle(e.name as TraceEngine.Types.TraceEvents.KnownEventName)?.category.name ||\n getCategoryStyles().other.name;\n const parentCategory = categoryStack.length ? categoryStack[categoryStack.length - 1] : null;\n if (category !== parentCategory) {\n categoryChange(parentCategory || null, category, startTime);\n }\n categoryStack.push(category);\n }\n\n function onEndEvent(e: TraceEngine.Legacy.CompatibleTraceEvent): void {\n const {endTime} = TraceEngine.Legacy.timesForEventInMilliseconds(e);\n const category = categoryStack.pop();\n const parentCategory = categoryStack.length ? categoryStack[categoryStack.length - 1] : null;\n if (category !== parentCategory) {\n categoryChange(category || null, parentCategory || null, endTime || 0);\n }\n }\n\n const obj = (events as Object);\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n obj[categoryBreakdownCacheSymbol] = aggregatedStats;\n }\n }\n\n static async buildSyntheticNetworkRequestDetails(\n event: TraceEngine.Types.TraceEvents.SyntheticNetworkRequest,\n model: TimelineModel.TimelineModel.TimelineModelImpl,\n linkifier: LegacyComponents.Linkifier.Linkifier): Promise {\n const maybeTarget = model.targetByEvent(event);\n const contentHelper = new TimelineDetailsContentHelper(maybeTarget, linkifier);\n\n const category = TimelineUIUtils.syntheticNetworkRequestCategory(event);\n const color = TimelineUIUtils.networkCategoryColor(category);\n contentHelper.addSection(i18nString(UIStrings.networkRequest), color);\n\n const options = {\n tabStop: true,\n showColumnNumber: false,\n inlineFrameIndex: 0,\n };\n contentHelper.appendElementRow(\n i18n.i18n.lockedString('URL'),\n LegacyComponents.Linkifier.Linkifier.linkifyURL(\n event.args.data.url as Platform.DevToolsPath.UrlString, options));\n\n // The time from queueing the request until resource processing is finished.\n const fullDuration = event.dur;\n if (isFinite(fullDuration)) {\n let textRow = TraceEngine.Helpers.Timing.formatMicrosecondsTime(fullDuration);\n // The time from queueing the request until the download is finished. This\n // corresponds to the total time reported for the request in the network tab.\n const networkDuration = event.args.data.syntheticData.finishTime - event.ts;\n // The time it takes to make the resource available to the renderer process.\n const processingDuration = event.ts + event.dur - event.args.data.syntheticData.finishTime;\n if (isFinite(networkDuration) && isFinite(processingDuration)) {\n const networkDurationStr =\n TraceEngine.Helpers.Timing.formatMicrosecondsTime(networkDuration as TraceEngine.Types.Timing.MicroSeconds);\n const processingDurationStr = TraceEngine.Helpers.Timing.formatMicrosecondsTime(\n processingDuration as TraceEngine.Types.Timing.MicroSeconds);\n const cached = event.args.data.syntheticData.isMemoryCached || event.args.data.syntheticData.isDiskCached;\n const cacheOrNetworkLabel =\n cached ? i18nString(UIStrings.loadFromCache) : i18nString(UIStrings.networkTransfer);\n textRow += i18nString(\n UIStrings.SSSResourceLoading,\n {PH1: networkDurationStr, PH2: cacheOrNetworkLabel, PH3: processingDurationStr});\n }\n contentHelper.appendTextRow(i18nString(UIStrings.duration), textRow);\n }\n\n if (event.args.data.requestMethod) {\n contentHelper.appendTextRow(i18nString(UIStrings.requestMethod), event.args.data.requestMethod);\n }\n\n if (event.args.data.initialPriority) {\n const initialPriority = PerfUI.NetworkPriorities.uiLabelForNetworkPriority(\n event.args.data.initialPriority as Protocol.Network.ResourcePriority);\n contentHelper.appendTextRow(i18nString(UIStrings.initialPriority), initialPriority);\n }\n\n const priority = PerfUI.NetworkPriorities.uiLabelForNetworkPriority(\n event.args.data.priority as Protocol.Network.ResourcePriority);\n\n contentHelper.appendTextRow(i18nString(UIStrings.priority), priority);\n\n if (event.args.data.mimeType) {\n contentHelper.appendTextRow(i18nString(UIStrings.mimeType), event.args.data.mimeType);\n }\n let lengthText = '';\n if (event.args.data.syntheticData.isMemoryCached) {\n lengthText += i18nString(UIStrings.FromMemoryCache);\n } else if (event.args.data.syntheticData.isDiskCached) {\n lengthText += i18nString(UIStrings.FromCache);\n } else if (event.args.data.timing?.pushStart) {\n lengthText += i18nString(UIStrings.FromPush);\n }\n if (event.args.data.fromServiceWorker) {\n lengthText += i18nString(UIStrings.FromServiceWorker);\n }\n if (event.args.data.encodedDataLength || !lengthText) {\n lengthText = `${Platform.NumberUtilities.bytesToString(event.args.data.encodedDataLength)}${lengthText}`;\n }\n contentHelper.appendTextRow(i18nString(UIStrings.encodedData), lengthText);\n if (event.args.data.decodedBodyLength) {\n contentHelper.appendTextRow(\n i18nString(UIStrings.decodedBody), Platform.NumberUtilities.bytesToString(event.args.data.decodedBodyLength));\n }\n const title = i18nString(UIStrings.initiatedBy);\n\n const topFrame = TimelineModel.TimelineModel.EventOnTimelineData.forEvent(event).topFrame();\n if (topFrame) {\n const link = linkifier.maybeLinkifyConsoleCallFrame(\n maybeTarget, topFrame, {tabStop: true, inlineFrameIndex: 0, showColumnNumber: true});\n if (link) {\n contentHelper.appendElementRow(title, link);\n }\n }\n\n if (!requestPreviewElements.get(event) && event.args.data.url && maybeTarget) {\n const previewElement =\n (await LegacyComponents.ImagePreview.ImagePreview.build(\n maybeTarget, event.args.data.url as Platform.DevToolsPath.UrlString, false, {\n imageAltText: LegacyComponents.ImagePreview.ImagePreview.defaultAltTextForImageURL(\n event.args.data.url as Platform.DevToolsPath.UrlString),\n precomputedFeatures: undefined,\n }) as HTMLImageElement);\n\n requestPreviewElements.set(event, previewElement);\n }\n\n const requestPreviewElement = requestPreviewElements.get(event);\n if (requestPreviewElement) {\n contentHelper.appendElementRow(i18nString(UIStrings.preview), requestPreviewElement);\n }\n return contentHelper.fragment;\n }\n\n static stackTraceFromCallFrames(callFrames: Protocol.Runtime.CallFrame[]|\n TraceEngine.Types.TraceEvents.TraceEventCallFrame[]): Protocol.Runtime.StackTrace {\n return {callFrames: callFrames} as Protocol.Runtime.StackTrace;\n }\n\n private static async generateCauses(\n event: TraceEngine.Types.TraceEvents.TraceEventData, contentHelper: TimelineDetailsContentHelper,\n traceParseData: TraceEngine.Handlers.Types.TraceParseData): Promise {\n const {startTime} = TraceEngine.Legacy.timesForEventInMilliseconds(event);\n let initiatorStackLabel = i18nString(UIStrings.initiatorStackTrace);\n let stackLabel = i18nString(UIStrings.stackTrace);\n\n switch (event.name) {\n case TraceEngine.Types.TraceEvents.KnownEventName.TimerFire:\n initiatorStackLabel = i18nString(UIStrings.timerInstalled);\n break;\n case TraceEngine.Types.TraceEvents.KnownEventName.FireAnimationFrame:\n initiatorStackLabel = i18nString(UIStrings.animationFrameRequested);\n break;\n case TraceEngine.Types.TraceEvents.KnownEventName.FireIdleCallback:\n initiatorStackLabel = i18nString(UIStrings.idleCallbackRequested);\n break;\n case TraceEngine.Types.TraceEvents.KnownEventName.UpdateLayoutTree:\n case TraceEngine.Types.TraceEvents.KnownEventName.RecalculateStyles:\n initiatorStackLabel = i18nString(UIStrings.firstInvalidated);\n stackLabel = i18nString(UIStrings.recalculationForced);\n break;\n case TraceEngine.Types.TraceEvents.KnownEventName.Layout:\n initiatorStackLabel = i18nString(UIStrings.firstLayoutInvalidation);\n stackLabel = i18nString(UIStrings.layoutForced);\n break;\n }\n\n const stackTrace = TraceEngine.Helpers.Trace.stackTraceForEvent(event);\n if (stackTrace && stackTrace.length) {\n contentHelper.addSection(stackLabel);\n contentHelper.createChildStackTraceElement(TimelineUIUtils.stackTraceFromCallFrames(stackTrace));\n }\n\n const initiator = traceParseData.Initiators.eventToInitiator.get(event);\n const initiatorFor = traceParseData.Initiators.initiatorToEvents.get(event);\n const invalidations = traceParseData.Invalidations.invalidationsForEvent.get(event);\n\n if (initiator) {\n // If we have an initiator for the event, we can show its stack trace, a link to reveal the initiator,\n // and the time since the initiator (Pending For).\n const stackTrace = TraceEngine.Helpers.Trace.stackTraceForEvent(initiator);\n if (stackTrace) {\n contentHelper.addSection(initiatorStackLabel);\n contentHelper.createChildStackTraceElement(TimelineUIUtils.stackTraceFromCallFrames(stackTrace.map(frame => {\n return {\n ...frame,\n scriptId: String(frame.scriptId) as Protocol.Runtime.ScriptId,\n };\n })));\n }\n\n const link = this.createEntryLink(initiator);\n contentHelper.appendElementRow(i18nString(UIStrings.initiatedBy), link);\n\n const {startTime: initiatorStartTime} = TraceEngine.Legacy.timesForEventInMilliseconds(initiator);\n const delay = startTime - initiatorStartTime;\n contentHelper.appendTextRow(i18nString(UIStrings.pendingFor), i18n.TimeUtilities.preciseMillisToString(delay, 1));\n }\n\n if (initiatorFor) {\n // If the event is an initiator for some entries, add links to reveal them.\n const links = document.createElement('div');\n initiatorFor.map((initiator, i) => {\n links.appendChild(this.createEntryLink(initiator));\n // Add space between each link if it's not last\n if (i < initiatorFor.length - 1) {\n links.append(' ');\n }\n });\n contentHelper.appendElementRow(UIStrings.initiatorFor, links);\n }\n\n if (invalidations && invalidations.length) {\n contentHelper.addSection(i18nString(UIStrings.invalidations));\n await TimelineUIUtils.generateInvalidationsList(invalidations, contentHelper);\n }\n }\n\n private static createEntryLink(entry: TraceEngine.Types.TraceEvents.TraceEventData): HTMLElement {\n const link = document.createElement('span');\n\n const traceBoundsState = TraceBounds.TraceBounds.BoundsManager.instance().state();\n if (!traceBoundsState) {\n return link;\n }\n\n // Check is the entry is outside of the current breadcrumb. If it is, don't create a link to navigate to it because there is no way to navigate outside breadcrumb without removing it. Instead, just display the name and \"outside breadcrumb\" text\n // Consider entry outside breadcrumb only if it is fully outside. If a part of it is visible, we can still select it.\n const isEntryOutsideBreadcrumb = traceBoundsState.micro.minimapTraceBounds.min > entry.ts + (entry.dur || 0) ||\n traceBoundsState.micro.minimapTraceBounds.max < entry.ts;\n\n // Check if it is in the hidden array\n const isEntryHidden = TraceEngine.EntriesFilter.EntriesFilter.maybeInstance()?.inEntryInvisible(entry);\n\n if (!isEntryOutsideBreadcrumb) {\n link.classList.add('devtools-link');\n UI.ARIAUtils.markAsLink(link);\n link.tabIndex = 0;\n link.addEventListener('click', () => {\n TimelinePanel.instance().select(TimelineSelection.fromTraceEvent((entry)));\n });\n\n link.addEventListener('keydown', event => {\n if (event.key === 'Enter') {\n TimelinePanel.instance().select(TimelineSelection.fromTraceEvent((entry)));\n event.consume(true);\n }\n });\n }\n\n if (isEntryHidden) {\n link.textContent = this.eventTitle(entry) + ' ' + i18nString(UIStrings.entryIsHidden);\n } else if (isEntryOutsideBreadcrumb) {\n link.textContent = this.eventTitle(entry) + ' ' + i18nString(UIStrings.outsideBreadcrumbRange);\n } else {\n link.textContent = this.eventTitle(entry);\n }\n\n return link;\n }\n\n private static async generateInvalidationsList(\n invalidations: TraceEngine.Types.TraceEvents.SyntheticInvalidation[],\n contentHelper: TimelineDetailsContentHelper): Promise {\n const {groupedByReason, backendNodeIds} = TimelineComponents.DetailsView.generateInvalidationsList(invalidations);\n\n let relatedNodesMap: Map|null = null;\n const target = SDK.TargetManager.TargetManager.instance().primaryPageTarget();\n const domModel = target?.model(SDK.DOMModel.DOMModel);\n if (domModel) {\n relatedNodesMap = await domModel.pushNodesByBackendIdsToFrontend(backendNodeIds);\n }\n\n Object.keys(groupedByReason).forEach(reason => {\n TimelineUIUtils.generateInvalidationsForReason(reason, groupedByReason[reason], relatedNodesMap, contentHelper);\n });\n }\n\n private static generateInvalidationsForReason(\n reason: string, invalidations: TraceEngine.Types.TraceEvents.SyntheticInvalidation[],\n relatedNodesMap: Map|null, contentHelper: TimelineDetailsContentHelper): void {\n function createLinkForInvalidationNode(invalidation: TraceEngine.Types.TraceEvents.SyntheticInvalidation):\n HTMLSpanElement {\n const node = (invalidation.nodeId && relatedNodesMap) ? relatedNodesMap.get(invalidation.nodeId) : null;\n if (node) {\n const nodeSpan = document.createElement('span');\n void Common.Linkifier.Linkifier.linkify(node).then(link => nodeSpan.appendChild(link));\n return nodeSpan;\n }\n if (invalidation.nodeName) {\n const nodeSpan = document.createElement('span');\n nodeSpan.textContent = invalidation.nodeName;\n return nodeSpan;\n }\n const nodeSpan = document.createElement('span');\n UI.UIUtils.createTextChild(nodeSpan, i18nString(UIStrings.UnknownNode));\n return nodeSpan;\n }\n\n const generatedItems = new Set();\n\n for (const invalidation of invalidations) {\n const stackTrace = TraceEngine.Helpers.Trace.stackTraceForEvent(invalidation);\n let scriptLink: HTMLElement|null = null;\n const callFrame = stackTrace?.at(0);\n if (callFrame) {\n scriptLink = contentHelper.linkifier()?.maybeLinkifyScriptLocation(\n SDK.TargetManager.TargetManager.instance().rootTarget(),\n callFrame.scriptId as Protocol.Runtime.ScriptId,\n callFrame.url as Platform.DevToolsPath.UrlString,\n callFrame.lineNumber,\n ) ||\n null;\n }\n\n const niceNodeLink = createLinkForInvalidationNode(invalidation);\n\n const text = scriptLink ?\n i18n.i18n.getFormatLocalizedString(\n str_, UIStrings.invalidationWithCallFrame, {PH1: niceNodeLink, PH2: scriptLink}) as HTMLElement :\n niceNodeLink;\n\n // Sometimes we can get different Invalidation events which cause\n // the same text for the same element for the same reason to be\n // generated. Rather than show the user duplicates, if we have\n // generated text that looks identical to this before, we will\n // bail.\n const generatedText: string = (typeof text === 'string' ? text : text.innerText);\n if (generatedItems.has(generatedText)) {\n continue;\n }\n\n generatedItems.add(generatedText);\n contentHelper.appendElementRow(reason, text);\n }\n }\n\n private static aggregatedStatsForTraceEvent(\n total: {\n [x: string]: number,\n },\n traceParseData: TraceEngine.Handlers.Types.TraceParseData,\n event: TraceEngine.Legacy.CompatibleTraceEvent): boolean {\n const events = traceParseData.Renderer?.allTraceEntries || [];\n const {startTime, endTime} = TraceEngine.Legacy.timesForEventInMilliseconds(event);\n function eventComparator(startTime: number, e: TraceEngine.Types.TraceEvents.TraceEventData): number {\n const {startTime: eventStartTime} = TraceEngine.Legacy.timesForEventInMilliseconds(e);\n return startTime - eventStartTime;\n }\n\n const index = Platform.ArrayUtilities.binaryIndexOf(events, startTime, eventComparator);\n // Not a main thread event?\n if (index < 0) {\n return false;\n }\n let hasChildren = false;\n if (endTime) {\n for (let i = index; i < events.length; i++) {\n const nextEvent = events[i];\n const {startTime: nextEventStartTime, selfTime: nextEventSelfTime} =\n TraceEngine.Legacy.timesForEventInMilliseconds(nextEvent);\n if (nextEventStartTime >= endTime) {\n break;\n }\n if (!nextEvent.selfTime) {\n continue;\n }\n if (TraceEngine.Legacy.threadIDForEvent(nextEvent) !== TraceEngine.Legacy.threadIDForEvent(event)) {\n continue;\n }\n if (i > index) {\n hasChildren = true;\n }\n const categoryName = TimelineUIUtils.eventStyle(nextEvent).category.name;\n total[categoryName] = (total[categoryName] || 0) + nextEventSelfTime;\n }\n }\n if (TraceEngine.Types.TraceEvents.isAsyncPhase(TraceEngine.Legacy.phaseForEvent(event))) {\n if (endTime) {\n let aggregatedTotal = 0;\n for (const categoryName in total) {\n aggregatedTotal += total[categoryName];\n }\n total['idle'] = Math.max(0, endTime - startTime - aggregatedTotal);\n }\n return false;\n }\n return hasChildren;\n }\n\n static async buildPicturePreviewContent(\n traceData: TraceEngine.Handlers.Types.TraceParseData, event: TraceEngine.Types.TraceEvents.TraceEventPaint,\n target: SDK.Target.Target): Promise {\n const snapshotEvent = traceData.LayerTree.paintsToSnapshots.get(event);\n if (!snapshotEvent) {\n return null;\n }\n\n const paintProfilerModel = target.model(SDK.PaintProfiler.PaintProfilerModel);\n if (!paintProfilerModel) {\n return null;\n }\n const snapshot = await paintProfilerModel.loadSnapshot(snapshotEvent.args.snapshot.skp64);\n if (!snapshot) {\n return null;\n }\n\n const snapshotWithRect = {\n snapshot,\n rect: snapshotEvent.args.snapshot.params?.layer_rect,\n };\n\n if (!snapshotWithRect) {\n return null;\n }\n const imageURLPromise = snapshotWithRect.snapshot.replay();\n snapshotWithRect.snapshot.release();\n const imageURL = await imageURLPromise as Platform.DevToolsPath.UrlString;\n if (!imageURL) {\n return null;\n }\n const stylesContainer = document.createElement('div');\n const shadowRoot = stylesContainer.attachShadow({mode: 'open'});\n shadowRoot.adoptedStyleSheets = [imagePreviewStyles];\n const container = shadowRoot.createChild('div') as HTMLDivElement;\n container.classList.add('image-preview-container', 'vbox', 'link');\n const img = (container.createChild('img') as HTMLImageElement);\n img.src = imageURL;\n img.alt = LegacyComponents.ImagePreview.ImagePreview.defaultAltTextForImageURL(imageURL);\n const paintProfilerButton = container.createChild('a');\n paintProfilerButton.textContent = i18nString(UIStrings.paintProfiler);\n UI.ARIAUtils.markAsLink(container);\n container.tabIndex = 0;\n container.addEventListener(\n 'click', () => TimelinePanel.instance().select(TimelineSelection.fromTraceEvent(event)), false);\n container.addEventListener('keydown', keyEvent => {\n if (keyEvent.key === 'Enter') {\n TimelinePanel.instance().select(TimelineSelection.fromTraceEvent(event));\n keyEvent.consume(true);\n }\n });\n return stylesContainer;\n }\n\n static createEventDivider(event: TraceEngine.Legacy.CompatibleTraceEvent, zeroTime: number): Element {\n const eventDivider = document.createElement('div');\n eventDivider.classList.add('resources-event-divider');\n const {startTime: eventStartTime} = TraceEngine.Legacy.timesForEventInMilliseconds(event);\n\n const startTime = i18n.TimeUtilities.millisToString(eventStartTime - zeroTime);\n UI.Tooltip.Tooltip.install(\n eventDivider, i18nString(UIStrings.sAtS, {PH1: TimelineUIUtils.eventTitle(event), PH2: startTime}));\n const style = TimelineUIUtils.markerStyleForEvent(event);\n if (style.tall) {\n eventDivider.style.backgroundColor = style.color;\n }\n return eventDivider;\n }\n\n static visibleEventsFilter(): TimelineModel.TimelineModelFilter.TimelineModelFilter {\n return new TimelineModel.TimelineModelFilter.TimelineVisibleEventsFilter(visibleTypes());\n }\n\n // Included only for layout tests.\n // TODO(crbug.com/1386091): Fix/port layout tests and remove.\n static categories(): CategoryPalette {\n return getCategoryStyles();\n }\n\n static generatePieChart(\n aggregatedStats: {\n [x: string]: number,\n },\n selfCategory?: TimelineCategory, selfTime?: number): Element {\n let total = 0;\n for (const categoryName in aggregatedStats) {\n total += aggregatedStats[categoryName];\n }\n\n const element = document.createElement('div');\n element.classList.add('timeline-details-view-pie-chart-wrapper');\n element.classList.add('hbox');\n\n const pieChart = new PerfUI.PieChart.PieChart();\n const slices: {\n value: number,\n color: string,\n title: string,\n }[] = [];\n\n function appendLegendRow(name: string, title: string, value: number, color: string): void {\n if (!value) {\n return;\n }\n slices.push({value, color, title});\n }\n\n // In case of self time, first add self, then children of the same category.\n if (selfCategory) {\n if (selfTime) {\n appendLegendRow(\n selfCategory.name, i18nString(UIStrings.sSelf, {PH1: selfCategory.title}), selfTime,\n selfCategory.getCSSValue());\n }\n // Children of the same category.\n const categoryTime = aggregatedStats[selfCategory.name];\n const value = categoryTime - (selfTime || 0);\n if (value > 0) {\n appendLegendRow(\n selfCategory.name, i18nString(UIStrings.sChildren, {PH1: selfCategory.title}), value,\n selfCategory.getCSSValue());\n }\n }\n\n // Add other categories.\n for (const categoryName in getCategoryStyles()) {\n const category = getCategoryStyles()[categoryName as keyof CategoryPalette];\n if (categoryName === selfCategory?.name) {\n // Do not add an entry for this event's self category because 2\n // entries for it where added just before this for loop (for\n // self and children times).\n continue;\n }\n appendLegendRow(category.name, category.title, aggregatedStats[category.name], category.getCSSValue());\n }\n\n pieChart.data = {\n chartName: i18nString(UIStrings.timeSpentInRendering),\n size: 110,\n formatter: (value: number) => i18n.TimeUtilities.preciseMillisToString(value),\n showLegend: true,\n total,\n slices,\n };\n const pieChartContainer = element.createChild('div', 'vbox');\n pieChartContainer.appendChild(pieChart);\n\n return element;\n }\n\n static generateDetailsContentForFrame(\n frame: TraceEngine.Handlers.ModelHandlers.Frames.TimelineFrame, filmStrip: TraceEngine.Extras.FilmStrip.Data|null,\n filmStripFrame: TraceEngine.Extras.FilmStrip.Frame|null): DocumentFragment {\n const contentHelper = new TimelineDetailsContentHelper(null, null);\n contentHelper.addSection(i18nString(UIStrings.frame));\n\n const duration = TimelineUIUtils.frameDuration(frame);\n contentHelper.appendElementRow(i18nString(UIStrings.duration), duration);\n if (filmStrip && filmStripFrame) {\n const filmStripPreview = document.createElement('div');\n filmStripPreview.classList.add('timeline-filmstrip-preview');\n void UI.UIUtils.loadImage(filmStripFrame.screenshotEvent.args.dataUri)\n .then(image => image && filmStripPreview.appendChild(image));\n contentHelper.appendElementRow('', filmStripPreview);\n filmStripPreview.addEventListener('click', frameClicked.bind(null, filmStrip, filmStripFrame), false);\n }\n\n function frameClicked(\n filmStrip: TraceEngine.Extras.FilmStrip.Data, filmStripFrame: TraceEngine.Extras.FilmStrip.Frame): void {\n PerfUI.FilmStripView.Dialog.fromFilmStrip(filmStrip, filmStripFrame.index);\n }\n\n return contentHelper.fragment;\n }\n\n static frameDuration(frame: TraceEngine.Handlers.ModelHandlers.Frames.TimelineFrame): Element {\n const offsetMilli = TraceEngine.Helpers.Timing.microSecondsToMilliseconds(frame.startTimeOffset);\n const durationMilli = TraceEngine.Helpers.Timing.microSecondsToMilliseconds(\n TraceEngine.Types.Timing.MicroSeconds(frame.endTime - frame.startTime));\n\n const durationText = i18nString(UIStrings.sAtSParentheses, {\n PH1: i18n.TimeUtilities.millisToString(durationMilli, true),\n PH2: i18n.TimeUtilities.millisToString(offsetMilli, true),\n });\n return i18n.i18n.getFormatLocalizedString(str_, UIStrings.emptyPlaceholder, {PH1: durationText});\n }\n\n static quadWidth(quad: number[]): number {\n return Math.round(Math.sqrt(Math.pow(quad[0] - quad[2], 2) + Math.pow(quad[1] - quad[3], 2)));\n }\n\n static quadHeight(quad: number[]): number {\n return Math.round(Math.sqrt(Math.pow(quad[0] - quad[6], 2) + Math.pow(quad[1] - quad[7], 2)));\n }\n\n static eventDispatchDesciptors(): EventDispatchTypeDescriptor[] {\n if (eventDispatchDesciptors) {\n return eventDispatchDesciptors;\n }\n const lightOrange = 'hsl(40,100%,80%)';\n const orange = 'hsl(40,100%,50%)';\n const green = 'hsl(90,100%,40%)';\n const purple = 'hsl(256,100%,75%)';\n eventDispatchDesciptors = [\n new EventDispatchTypeDescriptor(\n 1, lightOrange, ['mousemove', 'mouseenter', 'mouseleave', 'mouseout', 'mouseover']),\n new EventDispatchTypeDescriptor(\n 1, lightOrange, ['pointerover', 'pointerout', 'pointerenter', 'pointerleave', 'pointermove']),\n new EventDispatchTypeDescriptor(2, green, ['wheel']),\n new EventDispatchTypeDescriptor(3, orange, ['click', 'mousedown', 'mouseup']),\n new EventDispatchTypeDescriptor(3, orange, ['touchstart', 'touchend', 'touchmove', 'touchcancel']),\n new EventDispatchTypeDescriptor(\n 3, orange, ['pointerdown', 'pointerup', 'pointercancel', 'gotpointercapture', 'lostpointercapture']),\n new EventDispatchTypeDescriptor(3, purple, ['keydown', 'keyup', 'keypress']),\n ];\n return eventDispatchDesciptors;\n }\n\n static markerShortTitle(event: TraceEngine.Legacy.Event): string|null {\n const recordTypes = TimelineModel.TimelineModel.RecordType;\n switch (event.name) {\n case recordTypes.MarkDOMContent:\n return i18n.i18n.lockedString('DCL');\n case recordTypes.MarkLoad:\n return i18n.i18n.lockedString('L');\n case recordTypes.MarkFirstPaint:\n return i18n.i18n.lockedString('FP');\n case recordTypes.MarkFCP:\n return i18n.i18n.lockedString('FCP');\n case recordTypes.MarkLCPCandidate:\n return i18n.i18n.lockedString('LCP');\n }\n return null;\n }\n\n static markerStyleForEvent(event: TraceEngine.Legacy.Event|\n TraceEngine.Types.TraceEvents.TraceEventData): TimelineMarkerStyle {\n const tallMarkerDashStyle = [6, 4];\n const title = TimelineUIUtils.eventTitle(event);\n const recordTypes = TimelineModel.TimelineModel.RecordType;\n\n if (event.name !== recordTypes.NavigationStart &&\n (TraceEngine.Legacy.eventHasCategory(event, TimelineModel.TimelineModel.TimelineModelImpl.Category.Console) ||\n TraceEngine.Legacy.eventHasCategory(\n event, TimelineModel.TimelineModel.TimelineModelImpl.Category.UserTiming))) {\n return {\n title: title,\n dashStyle: tallMarkerDashStyle,\n lineWidth: 0.5,\n color: TraceEngine.Legacy.eventHasCategory(\n event, TimelineModel.TimelineModel.TimelineModelImpl.Category.UserTiming) ?\n 'purple' :\n 'orange',\n tall: false,\n lowPriority: false,\n };\n }\n let tall = false;\n let color = 'grey';\n switch (event.name) {\n case recordTypes.NavigationStart:\n color = '#FF9800';\n tall = true;\n break;\n case recordTypes.FrameStartedLoading:\n color = 'green';\n tall = true;\n break;\n case recordTypes.MarkDOMContent:\n color = '#0867CB';\n tall = true;\n break;\n case recordTypes.MarkLoad:\n color = '#B31412';\n tall = true;\n break;\n case recordTypes.MarkFirstPaint:\n color = '#228847';\n tall = true;\n break;\n case recordTypes.MarkFCP:\n color = '#1A6937';\n tall = true;\n break;\n case recordTypes.MarkLCPCandidate:\n color = '#1A3422';\n tall = true;\n break;\n case recordTypes.TimeStamp:\n color = 'orange';\n break;\n }\n return {\n title: title,\n dashStyle: tallMarkerDashStyle,\n lineWidth: 0.5,\n color: color,\n tall: tall,\n lowPriority: false,\n };\n }\n\n static colorForId(id: string): string {\n if (!colorGenerator) {\n colorGenerator =\n new Common.Color.Generator({min: 30, max: 330, count: undefined}, {min: 50, max: 80, count: 3}, 85);\n colorGenerator.setColorForID('', '#f2ecdc');\n }\n return colorGenerator.colorForID(id);\n }\n\n static displayNameForFrame(frame: TimelineModel.TimelineModel.PageFrame, trimAt: number = 30): string {\n const url = frame.url;\n if (!trimAt) {\n trimAt = 30;\n }\n return Common.ParsedURL.schemeIs(url, 'about:') ? `\"${Platform.StringUtilities.trimMiddle(frame.name, trimAt)}\"` :\n frame.url.trimEnd(trimAt);\n }\n}\n\nexport const enum NetworkCategory {\n HTML = 'HTML',\n Script = 'Script',\n Style = 'Style',\n Media = 'Media',\n Other = 'Other',\n}\n\nexport const aggregatedStatsKey = Symbol('aggregatedStats');\n\nexport const previewElementSymbol = Symbol('previewElement');\n\nexport class EventDispatchTypeDescriptor {\n priority: number;\n color: string;\n eventTypes: string[];\n\n constructor(priority: number, color: string, eventTypes: string[]) {\n this.priority = priority;\n this.color = color;\n this.eventTypes = eventTypes;\n }\n}\n\nexport class TimelineDetailsContentHelper {\n fragment: DocumentFragment;\n private linkifierInternal: LegacyComponents.Linkifier.Linkifier|null;\n private target: SDK.Target.Target|null;\n element: HTMLDivElement;\n private tableElement: HTMLElement;\n\n constructor(target: SDK.Target.Target|null, linkifier: LegacyComponents.Linkifier.Linkifier|null) {\n this.fragment = document.createDocumentFragment();\n\n this.linkifierInternal = linkifier;\n this.target = target;\n\n this.element = document.createElement('div');\n this.element.classList.add('timeline-details-view-block');\n this.tableElement = this.element.createChild('div', 'vbox timeline-details-chip-body');\n this.fragment.appendChild(this.element);\n }\n\n addSection(title: string, swatchColor?: string): void {\n if (!this.tableElement.hasChildNodes()) {\n this.element.removeChildren();\n } else {\n this.element = document.createElement('div');\n this.element.classList.add('timeline-details-view-block');\n this.fragment.appendChild(this.element);\n }\n\n if (title) {\n const titleElement = this.element.createChild('div', 'timeline-details-chip-title');\n if (swatchColor) {\n titleElement.createChild('div').style.backgroundColor = swatchColor;\n }\n UI.UIUtils.createTextChild(titleElement, title);\n }\n\n this.tableElement = this.element.createChild('div', 'vbox timeline-details-chip-body');\n this.fragment.appendChild(this.element);\n }\n\n linkifier(): LegacyComponents.Linkifier.Linkifier|null {\n return this.linkifierInternal;\n }\n\n appendTextRow(title: string, value: string|number|boolean): void {\n const rowElement = this.tableElement.createChild('div', 'timeline-details-view-row');\n rowElement.createChild('div', 'timeline-details-view-row-title').textContent = title;\n rowElement.createChild('div', 'timeline-details-view-row-value').textContent = value.toString();\n }\n\n appendElementRow(title: string, content: string|Node, isWarning?: boolean, isStacked?: boolean): void {\n const rowElement = this.tableElement.createChild('div', 'timeline-details-view-row');\n rowElement.setAttribute('data-row-title', title);\n if (isWarning) {\n rowElement.classList.add('timeline-details-warning');\n }\n if (isStacked) {\n rowElement.classList.add('timeline-details-stack-values');\n }\n const titleElement = rowElement.createChild('div', 'timeline-details-view-row-title');\n titleElement.textContent = title;\n const valueElement = rowElement.createChild('div', 'timeline-details-view-row-value');\n if (content instanceof Node) {\n valueElement.appendChild(content);\n } else {\n UI.UIUtils.createTextChild(valueElement, content || '');\n }\n }\n\n appendLocationRow(title: string, url: string, startLine: number, startColumn?: number): void {\n if (!this.linkifierInternal) {\n return;\n }\n\n const options = {\n tabStop: true,\n columnNumber: startColumn,\n showColumnNumber: true,\n inlineFrameIndex: 0,\n };\n const link = this.linkifierInternal.maybeLinkifyScriptLocation(\n this.target, null, url as Platform.DevToolsPath.UrlString, startLine, options);\n if (!link) {\n return;\n }\n this.appendElementRow(title, link);\n }\n\n appendLocationRange(title: string, url: Platform.DevToolsPath.UrlString, startLine: number, endLine?: number): void {\n if (!this.linkifierInternal || !this.target) {\n return;\n }\n const locationContent = document.createElement('span');\n const link = this.linkifierInternal.maybeLinkifyScriptLocation(\n this.target, null, url, startLine, {tabStop: true, inlineFrameIndex: 0});\n if (!link) {\n return;\n }\n locationContent.appendChild(link);\n UI.UIUtils.createTextChild(\n locationContent, Platform.StringUtilities.sprintf(' [%s…%s]', startLine + 1, (endLine || 0) + 1 || ''));\n this.appendElementRow(title, locationContent);\n }\n\n createChildStackTraceElement(stackTrace: Protocol.Runtime.StackTrace): void {\n if (!this.linkifierInternal) {\n return;\n }\n\n const stackTraceElement =\n this.tableElement.createChild('div', 'timeline-details-view-row timeline-details-stack-values');\n const callFrameContents = LegacyComponents.JSPresentationUtils.buildStackTracePreviewContents(\n this.target, this.linkifierInternal, {stackTrace, tabStops: true});\n stackTraceElement.appendChild(callFrameContents.element);\n }\n}\n\nexport const categoryBreakdownCacheSymbol = Symbol('categoryBreakdownCache');\nexport interface TimelineMarkerStyle {\n title: string;\n color: string;\n lineWidth: number;\n dashStyle: number[];\n tall: boolean;\n lowPriority: boolean;\n}\n\n/**\n * Given a particular event, this method can adjust its timestamp by\n * substracting the timestamp of the previous navigation. This helps in cases\n * where the user has navigated multiple times in the trace, so that we can show\n * the LCP (for example) relative to the last navigation.\n **/\nexport function timeStampForEventAdjustedForClosestNavigationIfPossible(\n event: TraceEngine.Types.TraceEvents.TraceEventData,\n traceParsedData: TraceEngine.Handlers.Types.TraceParseData|null): TraceEngine.Types.Timing.MilliSeconds {\n if (!traceParsedData) {\n const {startTime} = TraceEngine.Legacy.timesForEventInMilliseconds(event);\n return startTime;\n }\n\n const time = TraceEngine.Helpers.Timing.timeStampForEventAdjustedByClosestNavigation(\n event,\n traceParsedData.Meta.traceBounds,\n traceParsedData.Meta.navigationsByNavigationId,\n traceParsedData.Meta.navigationsByFrameId,\n );\n return TraceEngine.Helpers.Timing.microSecondsToMilliseconds(time);\n}\n"]} \ No newline at end of file +{"version":3,"file":"TimelineUIUtils.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineUIUtils.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AACtD,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAE7C,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,aAAa,MA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vE,iBAAiB,CAAC,WAAW,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAC3D,CAAC;CACF;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAU7E;;;;;IAKI;AACJ,MAAM,UAAU,uDAAuD,CACnE,KAAmD,EACnD,eAA+D;IACjE,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,MAAM,EAAC,SAAS,EAAC,GAAG,WAAW,CAAC,MAAM,CAAC,2BAA2B,CAAC,KAAK,CAAC,CAAC;QAC1E,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,4CAA4C,CAChF,KAAK,EACL,eAAe,CAAC,IAAI,CAAC,WAAW,EAChC,eAAe,CAAC,IAAI,CAAC,yBAAyB,EAC9C,eAAe,CAAC,IAAI,CAAC,oBAAoB,CAC5C,CAAC;IACF,OAAO,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAC;AACrE,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/*\n * Copyright (C) 2013 Google Inc. All rights reserved.\n * Copyright (C) 2012 Intel Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport * as Common from '../../core/common/common.js';\nimport * as i18n from '../../core/i18n/i18n.js';\nimport * as Platform from '../../core/platform/platform.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport type * as Protocol from '../../generated/protocol.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as TimelineModel from '../../models/timeline_model/timeline_model.js';\nimport * as TraceEngine from '../../models/trace/trace.js';\nimport * as AnnotationsManager from '../../services/annotations_manager/annotations_manager.js';\nimport * as TraceBounds from '../../services/trace_bounds/trace_bounds.js';\nimport * as PerfUI from '../../ui/legacy/components/perf_ui/perf_ui.js';\n// eslint-disable-next-line rulesdir/es_modules_import\nimport imagePreviewStyles from '../../ui/legacy/components/utils/imagePreview.css.js';\nimport * as LegacyComponents from '../../ui/legacy/components/utils/utils.js';\nimport * as UI from '../../ui/legacy/legacy.js';\nimport * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js';\n\nimport {CLSRect} from './CLSLinkifier.js';\nimport * as TimelineComponents from './components/components.js';\nimport {\n type CategoryPalette,\n getCategoryStyles,\n getEventStyle,\n maybeInitSylesMap,\n type TimelineCategory,\n TimelineRecordStyle,\n visibleTypes,\n} from './EventUICategory.js';\nimport {titleForInteractionEvent} from './InteractionsTrackAppender.js';\nimport {SourceMapsResolver} from './SourceMapsResolver.js';\nimport {TimelinePanel} from './TimelinePanel.js';\nimport {TimelineSelection} from './TimelineSelection.js';\n\nconst UIStrings = {\n /**\n *@description Text that only contain a placeholder\n *@example {100ms (at 200ms)} PH1\n */\n emptyPlaceholder: '{PH1}', // eslint-disable-line rulesdir/l10n_no_locked_or_placeholder_only_phrase\n /**\n *@description Text that refers to updated priority of network request\n */\n initialPriority: 'Initial Priority',\n /**\n *@description Text for timestamps of items\n */\n timestamp: 'Timestamp',\n /**\n *@description Text shown next to the interaction event's ID in the detail view.\n */\n interactionID: 'ID',\n /**\n *@description Text shown next to the interaction event's input delay time in the detail view.\n */\n inputDelay: 'Input delay',\n /**\n *@description Text shown next to the interaction event's thread processing duration in the detail view.\n */\n processingDuration: 'Processing duration',\n /**\n *@description Text shown next to the interaction event's presentation delay time in the detail view.\n */\n presentationDelay: 'Presentation delay',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n compile: 'Compile',\n /**\n *@description Text to parse something\n */\n parse: 'Parse',\n /**\n *@description Text with two placeholders separated by a colon\n *@example {Node removed} PH1\n *@example {div#id1} PH2\n */\n sS: '{PH1}: {PH2}',\n /**\n *@description Details text in Timeline UIUtils of the Performance panel\n *@example {30 MB} PH1\n */\n sCollected: '{PH1} collected',\n /**\n *@description Details text in Timeline UIUtils of the Performance panel\n *@example {https://example.com} PH1\n *@example {2} PH2\n *@example {4} PH3\n */\n sSs: '{PH1} [{PH2}…{PH3}]',\n /**\n *@description Details text in Timeline UIUtils of the Performance panel\n *@example {https://example.com} PH1\n *@example {2} PH2\n */\n sSSquareBrackets: '{PH1} [{PH2}…]',\n /**\n *@description Text that is usually a hyperlink to more documentation\n */\n learnMore: 'Learn more',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n compilationCacheStatus: 'Compilation cache status',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n compilationCacheSize: 'Compilation cache size',\n /**\n *@description Text in Timeline UIUtils of the Performance panel. \"Compilation\n * cache\" refers to the code cache described at\n * https://v8.dev/blog/code-caching-for-devs . This label is followed by the\n * type of code cache data used, either \"normal\" or \"full\" as described in the\n * linked article.\n */\n compilationCacheKind: 'Compilation cache kind',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n scriptLoadedFromCache: 'script loaded from cache',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n failedToLoadScriptFromCache: 'failed to load script from cache',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n scriptNotEligible: 'script not eligible',\n /**\n *@description Text for the total time of something\n */\n totalTime: 'Total Time',\n /**\n *@description Time of a single activity, as opposed to the total time\n */\n selfTime: 'Self Time',\n /**\n *@description Label in the summary view in the Performance panel for a number which indicates how much managed memory has been reclaimed by performing Garbage Collection\n */\n collected: 'Collected',\n /**\n *@description Text for a programming function\n */\n function: 'Function',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n timerId: 'Timer ID',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n timeout: 'Timeout',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n repeats: 'Repeats',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n callbackId: 'Callback ID',\n /**\n *@description Text that refers to the network request method\n */\n requestMethod: 'Request Method',\n /**\n *@description Text to show the priority of an item\n */\n priority: 'Priority',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n encodedData: 'Encoded Data',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n decodedBody: 'Decoded Body',\n /**\n *@description Text for a module, the programming concept\n */\n module: 'Module',\n /**\n *@description Label for a group of JavaScript files\n */\n script: 'Script',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n streamed: 'Streamed',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n eagerCompile: 'Compiling all functions eagerly',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n url: 'Url',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n producedCacheSize: 'Produced Cache Size',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n consumedCacheSize: 'Consumed Cache Size',\n /**\n *@description Title for a group of cities\n */\n location: 'Location',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n *@example {2} PH1\n *@example {2} PH2\n */\n sSCurlyBrackets: '({PH1}, {PH2})',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n dimensions: 'Dimensions',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n *@example {2} PH1\n *@example {2} PH2\n */\n sSDimensions: '{PH1} × {PH2}',\n /**\n *@description Related node label in Timeline UIUtils of the Performance panel\n */\n layerRoot: 'Layer Root',\n /**\n *@description Related node label in Timeline UIUtils of the Performance panel\n */\n ownerElement: 'Owner Element',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n imageUrl: 'Image URL',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n stylesheetUrl: 'Stylesheet URL',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n elementsAffected: 'Elements Affected',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n nodesThatNeedLayout: 'Nodes That Need Layout',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n *@example {2} PH1\n *@example {10} PH2\n */\n sOfS: '{PH1} of {PH2}',\n /**\n *@description Related node label in Timeline UIUtils of the Performance panel\n */\n layoutRoot: 'Layout root',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n message: 'Message',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n callbackFunction: 'Callback Function',\n /**\n *@description The current state of an item\n */\n state: 'State',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n range: 'Range',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n allottedTime: 'Allotted Time',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n invokedByTimeout: 'Invoked by Timeout',\n /**\n *@description Text that refers to some types\n */\n type: 'Type',\n /**\n *@description Text for the size of something\n */\n size: 'Size',\n /**\n *@description Text for the details of something\n */\n details: 'Details',\n /**\n *@description Title in Timeline for Cumulative Layout Shifts\n */\n cumulativeLayoutShifts: 'Cumulative Layout Shifts',\n /**\n *@description Text for the link to the evolved CLS website\n */\n evolvedClsLink: 'evolved',\n /**\n *@description Warning in Timeline that CLS can cause a poor user experience. It contains a link to inform developers about the recent changes to how CLS is measured. The new CLS metric is said to have evolved from the previous version.\n *@example {Link to web.dev/metrics} PH1\n *@example {Link to web.dev/evolving-cls which will always have the text 'evolved'} PH2\n */\n sCLSInformation: '{PH1} can result in poor user experiences. It has recently {PH2}.',\n /**\n *@description Text to indicate an item is a warning\n */\n warning: 'Warning',\n /**\n *@description Title for the Timeline CLS Score\n */\n score: 'Score',\n /**\n *@description Text in Timeline for the cumulative CLS score\n */\n cumulativeScore: 'Cumulative Score',\n /**\n *@description Text in Timeline for the current CLS score\n */\n currentClusterScore: 'Current Cluster Score',\n /**\n *@description Text in Timeline for the current CLS cluster\n */\n currentClusterId: 'Current Cluster ID',\n /**\n *@description Text in Timeline for whether input happened recently\n */\n hadRecentInput: 'Had recent input',\n /**\n *@description Text in Timeline indicating that input has happened recently\n */\n yes: 'Yes',\n /**\n *@description Text in Timeline indicating that input has not happened recently\n */\n no: 'No',\n /**\n *@description Label for Cumulative Layout records, indicating where they moved from\n */\n movedFrom: 'Moved from',\n /**\n *@description Label for Cumulative Layout records, indicating where they moved to\n */\n movedTo: 'Moved to',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n relatedNode: 'Related Node',\n /**\n *@description Text for previewing items\n */\n preview: 'Preview',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n aggregatedTime: 'Aggregated Time',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n networkRequest: 'Network request',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n loadFromCache: 'load from cache',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n networkTransfer: 'network transfer',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n *@example {1ms} PH1\n *@example {network transfer} PH2\n *@example {1ms} PH3\n */\n SSSResourceLoading: ' ({PH1} {PH2} + {PH3} resource loading)',\n /**\n *@description Text for the duration of something\n */\n duration: 'Duration',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n mimeType: 'Mime Type',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n FromMemoryCache: ' (from memory cache)',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n FromCache: ' (from cache)',\n /**\n *@description Label for a network request indicating that it was a HTTP2 server push instead of a regular network request, in the Performance panel\n */\n FromPush: ' (from push)',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n FromServiceWorker: ' (from `service worker`)',\n /**\n *@description Text for the stack trace of the initiator of something. The Initiator is the event or factor that directly triggered or precipitated a subsequent action.\n */\n initiatorStackTrace: 'Initiator Stack Trace',\n /**\n *@description Text for the event initiated by another one\n */\n initiatedBy: 'Initiated by',\n /**\n *@description Text for the event that is an initiator for another one\n */\n initiatorFor: 'Initiator for',\n /**\n *@description Call site stack label in Timeline UIUtils of the Performance panel\n */\n timerInstalled: 'Timer Installed',\n /**\n *@description Call site stack label in Timeline UIUtils of the Performance panel\n */\n animationFrameRequested: 'Animation Frame Requested',\n /**\n *@description Call site stack label in Timeline UIUtils of the Performance panel\n */\n idleCallbackRequested: 'Idle Callback Requested',\n /**\n *@description Stack label in Timeline UIUtils of the Performance panel\n */\n recalculationForced: 'Recalculation Forced',\n /**\n *@description Call site stack label in Timeline UIUtils of the Performance panel\n */\n firstLayoutInvalidation: 'First Layout Invalidation',\n /**\n *@description Stack label in Timeline UIUtils of the Performance panel\n */\n layoutForced: 'Layout Forced',\n /**\n *@description Text for the execution stack trace\n */\n stackTrace: 'Stack Trace',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n invalidations: 'Invalidations',\n /**\n * @description Text in Timeline UIUtils of the Performance panel. Phrase is followed by a number of milliseconds.\n * Some events or tasks might have been only started, but have not ended yet. Such events or tasks are considered\n * \"pending\".\n */\n pendingFor: 'Pending for',\n /**\n *@description Noun label for a stack trace which indicates the first time some condition was invalidated.\n */\n firstInvalidated: 'First Invalidated',\n /**\n *@description Title of the paint profiler, old name of the performance pane\n */\n paintProfiler: 'Paint Profiler',\n /**\n *@description Text in Timeline Flame Chart View of the Performance panel\n *@example {Frame} PH1\n *@example {10ms} PH2\n */\n sAtS: '{PH1} at {PH2}',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n *@example {blink.console} PH1\n */\n sSelf: '{PH1} (self)',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n *@example {blink.console} PH1\n */\n sChildren: '{PH1} (children)',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n */\n timeSpentInRendering: 'Time spent in rendering',\n /**\n *@description Text for a rendering frame\n */\n frame: 'Frame',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n *@example {10ms} PH1\n *@example {10ms} PH2\n */\n sAtSParentheses: '{PH1} (at {PH2})',\n /**\n *@description Text of a DOM element in Timeline UIUtils of the Performance panel\n */\n UnknownNode: '[ unknown node ]',\n /**\n *@description Text in Timeline UIUtils of the Performance panel\n *@example {node} PH1\n *@example {app.js} PH2\n */\n invalidationWithCallFrame: '{PH1} at {PH2}',\n /**\n *@description Text indicating that something is outside of the Performace Panel Timeline Minimap range\n */\n outsideBreadcrumbRange: '(outside of the breadcrumb range)',\n /**\n *@description Text indicating that something is hidden from the Performace Panel Timeline\n */\n entryIsHidden: '(entry is hidden)',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/TimelineUIUtils.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nlet eventDispatchDesciptors: EventDispatchTypeDescriptor[];\n\nlet colorGenerator: Common.Color.Generator;\n\nconst requestPreviewElements = new WeakMap();\n\ntype LinkifyLocationOptions = {\n scriptId: Protocol.Runtime.ScriptId|null,\n url: string,\n lineNumber: number,\n columnNumber?: number,\n isFreshRecording?: boolean, target: SDK.Target.Target|null, linkifier: LegacyComponents.Linkifier.Linkifier,\n};\n\nexport class TimelineUIUtils {\n static frameDisplayName(frame: Protocol.Runtime.CallFrame): string {\n if (!TimelineModel.TimelineJSProfile.TimelineJSProfileProcessor.isNativeRuntimeFrame(frame)) {\n return UI.UIUtils.beautifyFunctionName(frame.functionName);\n }\n const nativeGroup = TimelineModel.TimelineJSProfile.TimelineJSProfileProcessor.nativeGroup(frame.functionName);\n switch (nativeGroup) {\n case TimelineModel.TimelineJSProfile.TimelineJSProfileProcessor.NativeGroups.Compile:\n return i18nString(UIStrings.compile);\n case TimelineModel.TimelineJSProfile.TimelineJSProfileProcessor.NativeGroups.Parse:\n return i18nString(UIStrings.parse);\n }\n return frame.functionName;\n }\n\n static testContentMatching(\n traceEvent: TraceEngine.Legacy.CompatibleTraceEvent, regExp: RegExp,\n traceParsedData?: TraceEngine.Handlers.Types.TraceParseData): boolean {\n const title = TimelineUIUtils.eventStyle(traceEvent).title;\n const tokens = [title];\n\n if (TraceEngine.Legacy.eventIsFromNewEngine(traceEvent) &&\n TraceEngine.Types.TraceEvents.isProfileCall(traceEvent)) {\n // In the future this case will not be possible - wherever we call this\n // function we will be able to pass in the data from the new engine. But\n // currently this is called in a variety of places including from the\n // legacy model which does not have a reference to the new engine's data.\n // So if we are missing the data, we just fallback to the name from the\n // callFrame.\n if (!traceParsedData || !traceParsedData.Samples) {\n tokens.push(traceEvent.callFrame.functionName);\n } else {\n tokens.push(\n TraceEngine.Handlers.ModelHandlers.Samples.getProfileCallFunctionName(traceParsedData.Samples, traceEvent));\n }\n }\n const url = TimelineModel.TimelineModel.EventOnTimelineData.forEvent(traceEvent).url;\n if (url) {\n tokens.push(url);\n }\n // This works for both legacy and new engine events.\n appendObjectProperties(traceEvent.args, 2);\n const result = tokens.join('|').match(regExp);\n return result ? result.length > 0 : false;\n\n interface ContentObject {\n [x: string]: number|string|ContentObject;\n }\n function appendObjectProperties(object: ContentObject, depth: number): void {\n if (!depth) {\n return;\n }\n for (const key in object) {\n const value = object[key];\n if (typeof value === 'string') {\n tokens.push(value);\n } else if (typeof value === 'number') {\n tokens.push(String(value));\n } else if (typeof value === 'object' && value !== null) {\n appendObjectProperties(value, depth - 1);\n }\n }\n }\n }\n\n static eventStyle(event: TraceEngine.Legacy.CompatibleTraceEvent): TimelineRecordStyle {\n const eventStyles = maybeInitSylesMap();\n if (TraceEngine.Legacy.eventHasCategory(event, TimelineModel.TimelineModel.TimelineModelImpl.Category.Console) ||\n TraceEngine.Legacy.eventHasCategory(event, TimelineModel.TimelineModel.TimelineModelImpl.Category.UserTiming)) {\n return new TimelineRecordStyle(event.name, getCategoryStyles()['scripting']);\n }\n\n if (TraceEngine.Legacy.eventIsFromNewEngine(event)) {\n if (TraceEngine.Types.TraceEvents.isProfileCall(event)) {\n if (event.callFrame.functionName === '(idle)') {\n return new TimelineRecordStyle(event.name, getCategoryStyles().idle);\n }\n }\n const defaultStyles = new TimelineRecordStyle(event.name, getCategoryStyles().other);\n return getEventStyle(event.name as TraceEngine.Types.TraceEvents.KnownEventName) || defaultStyles;\n }\n\n let result = eventStyles[event.name as TraceEngine.Types.TraceEvents.KnownEventName];\n // If there's no defined RecordStyle for this event, define as other & hidden.\n if (!result) {\n result = new TimelineRecordStyle(event.name, getCategoryStyles()['other'], true);\n eventStyles[event.name as TraceEngine.Types.TraceEvents.KnownEventName] = result;\n }\n return result;\n }\n\n static eventColor(event: TraceEngine.Legacy.CompatibleTraceEvent): string {\n if (TraceEngine.Legacy.eventIsFromNewEngine(event) && TraceEngine.Types.TraceEvents.isProfileCall(event)) {\n const frame = event.callFrame;\n if (TimelineUIUtils.isUserFrame(frame)) {\n return TimelineUIUtils.colorForId(frame.url);\n }\n }\n let parsedColor = TimelineUIUtils.eventStyle(event).category.getComputedColorValue();\n // This event is considered idle time but still rendered as a scripting event here\n // to connect the StreamingCompileScriptParsing events it belongs to.\n if (event.name === TimelineModel.TimelineModel.RecordType.StreamingCompileScriptWaiting) {\n parsedColor = getCategoryStyles().scripting.getComputedColorValue();\n if (!parsedColor) {\n throw new Error('Unable to parse color from getCategoryStyles().scripting.color');\n }\n }\n return parsedColor;\n }\n\n static eventTitle(event: TraceEngine.Legacy.CompatibleTraceEvent): string {\n // Profile call events do not have a args.data property, thus, we\n // need to check for profile calls in the beginning of this\n // function.\n if (TraceEngine.Legacy.eventIsFromNewEngine(event) && TraceEngine.Types.TraceEvents.isProfileCall(event)) {\n const maybeResolvedName = SourceMapsResolver.resolvedNodeNameForEntry(event);\n const displayName = maybeResolvedName || TimelineUIUtils.frameDisplayName(event.callFrame);\n return displayName;\n }\n const recordType = TimelineModel.TimelineModel.RecordType;\n const eventData = event.args['data'];\n\n if (event.name === 'EventTiming') {\n let payload: TraceEngine.Types.TraceEvents.TraceEventData|null = null;\n if (event instanceof TraceEngine.Legacy.PayloadEvent) {\n payload = event.rawPayload();\n } else if (TraceEngine.Legacy.eventIsFromNewEngine(event)) {\n payload = event;\n }\n\n if (payload && TraceEngine.Types.TraceEvents.isSyntheticInteractionEvent(payload)) {\n return titleForInteractionEvent(payload);\n }\n }\n const title = TimelineUIUtils.eventStyle(event).title;\n if (TraceEngine.Legacy.eventHasCategory(event, TimelineModel.TimelineModel.TimelineModelImpl.Category.Console)) {\n return title;\n }\n if (event.name === recordType.TimeStamp) {\n return i18nString(UIStrings.sS, {PH1: title, PH2: eventData['message']});\n }\n if (event.name === recordType.Animation && eventData && eventData['name']) {\n return i18nString(UIStrings.sS, {PH1: title, PH2: eventData['name']});\n }\n if (event.name === recordType.EventDispatch && eventData && eventData['type']) {\n return i18nString(UIStrings.sS, {PH1: title, PH2: eventData['type']});\n }\n return title;\n }\n\n static isUserFrame(frame: Protocol.Runtime.CallFrame): boolean {\n return frame.scriptId !== '0' && !(frame.url && frame.url.startsWith('native '));\n }\n\n static syntheticNetworkRequestCategory(request: TraceEngine.Types.TraceEvents.SyntheticNetworkRequest):\n NetworkCategory {\n switch (request.args.data.mimeType) {\n case 'text/html':\n return NetworkCategory.HTML;\n case 'application/javascript':\n case 'application/x-javascript':\n case 'text/javascript':\n return NetworkCategory.Script;\n case 'text/css':\n return NetworkCategory.Style;\n case 'audio/ogg':\n case 'image/gif':\n case 'image/jpeg':\n case 'image/png':\n case 'image/svg+xml':\n case 'image/webp':\n case 'image/x-icon':\n case 'font/opentype':\n case 'font/woff2':\n case 'font/ttf':\n case 'application/font-woff':\n return NetworkCategory.Media;\n default:\n return NetworkCategory.Other;\n }\n }\n\n static networkCategoryColor(category: NetworkCategory): string {\n let cssVarName = '--app-color-system';\n switch (category) {\n case NetworkCategory.HTML:\n cssVarName = '--app-color-loading';\n break;\n case NetworkCategory.Script:\n cssVarName = '--app-color-scripting';\n break;\n case NetworkCategory.Style:\n cssVarName = '--app-color-rendering';\n break;\n case NetworkCategory.Media:\n cssVarName = '--app-color-painting';\n break;\n default:\n cssVarName = '--app-color-system';\n break;\n }\n return ThemeSupport.ThemeSupport.instance().getComputedValue(cssVarName);\n }\n\n static async buildDetailsTextForTraceEvent(event: TraceEngine.Legacy.Event|\n TraceEngine.Types.TraceEvents.TraceEventData): Promise {\n const recordType = TimelineModel.TimelineModel.RecordType;\n let detailsText;\n const eventData = event.args['data'];\n switch (event.name) {\n case recordType.GCEvent:\n case recordType.MajorGC:\n case recordType.MinorGC: {\n const delta = event.args['usedHeapSizeBefore'] - event.args['usedHeapSizeAfter'];\n detailsText = i18nString(UIStrings.sCollected, {PH1: Platform.NumberUtilities.bytesToString(delta)});\n break;\n }\n case recordType.FunctionCall:\n if (eventData && eventData['url'] && eventData['lineNumber'] !== undefined &&\n eventData['columnNumber'] !== undefined) {\n detailsText = eventData.url + ':' + (eventData.lineNumber + 1) + ':' + (eventData.columnNumber + 1);\n }\n break;\n case recordType.JSRoot:\n case recordType.JSFrame:\n case recordType.JSIdleFrame:\n case recordType.JSSystemFrame:\n detailsText = TimelineUIUtils.frameDisplayName(eventData);\n break;\n case recordType.EventDispatch:\n detailsText = eventData ? eventData['type'] : null;\n break;\n case recordType.Paint: {\n const width = TimelineUIUtils.quadWidth(eventData.clip);\n const height = TimelineUIUtils.quadHeight(eventData.clip);\n if (width && height) {\n detailsText = i18nString(UIStrings.sSDimensions, {PH1: width, PH2: height});\n }\n break;\n }\n case recordType.ParseHTML: {\n const startLine = event.args['beginData']['startLine'];\n const endLine = event.args['endData'] && event.args['endData']['endLine'];\n const url = Bindings.ResourceUtils.displayNameForURL(event.args['beginData']['url']);\n if (endLine >= 0) {\n detailsText = i18nString(UIStrings.sSs, {PH1: url, PH2: startLine + 1, PH3: endLine + 1});\n } else {\n detailsText = i18nString(UIStrings.sSSquareBrackets, {PH1: url, PH2: startLine + 1});\n }\n break;\n }\n case recordType.CompileModule:\n case recordType.CacheModule:\n detailsText = Bindings.ResourceUtils.displayNameForURL(event.args['fileName']);\n break;\n case recordType.CompileScript:\n case recordType.CacheScript:\n case recordType.EvaluateScript: {\n const url = eventData && eventData['url'];\n if (url) {\n detailsText = Bindings.ResourceUtils.displayNameForURL(url) + ':' + (eventData['lineNumber'] + 1);\n }\n break;\n }\n case recordType.WasmCompiledModule:\n case recordType.WasmModuleCacheHit: {\n const url = event.args['url'];\n if (url) {\n detailsText = Bindings.ResourceUtils.displayNameForURL(url);\n }\n break;\n }\n\n case recordType.StreamingCompileScript:\n case recordType.BackgroundDeserialize:\n case recordType.XHRReadyStateChange:\n case recordType.XHRLoad: {\n const url = eventData['url'];\n if (url) {\n detailsText = Bindings.ResourceUtils.displayNameForURL(url);\n }\n break;\n }\n case recordType.TimeStamp:\n detailsText = eventData['message'];\n break;\n\n case recordType.WebSocketCreate:\n case recordType.WebSocketSendHandshakeRequest:\n case recordType.WebSocketReceiveHandshakeResponse:\n case recordType.WebSocketDestroy:\n case recordType.ResourceWillSendRequest:\n case recordType.ResourceSendRequest:\n case recordType.ResourceReceivedData:\n case recordType.ResourceReceiveResponse:\n case recordType.ResourceFinish:\n case recordType.PaintImage:\n case recordType.DecodeImage:\n case recordType.ResizeImage:\n case recordType.DecodeLazyPixelRef: {\n const url = TimelineModel.TimelineModel.EventOnTimelineData.forEvent(event).url;\n if (url) {\n detailsText = Bindings.ResourceUtils.displayNameForURL(url);\n }\n break;\n }\n\n case recordType.EmbedderCallback:\n detailsText = eventData['callbackName'];\n break;\n\n case recordType.Animation:\n detailsText = eventData && eventData['name'];\n break;\n\n case recordType.AsyncTask:\n detailsText = eventData ? eventData['name'] : null;\n break;\n\n default:\n if (TraceEngine.Legacy.eventHasCategory(\n event, TimelineModel.TimelineModel.TimelineModelImpl.Category.Console)) {\n detailsText = null;\n } else {\n detailsText = await linkifyTopCallFrameAsText();\n }\n break;\n }\n\n return detailsText;\n\n async function linkifyTopCallFrameAsText(): Promise {\n const frame = TimelineModel.TimelineModel.EventOnTimelineData.forEvent(event).topFrame();\n if (!frame) {\n return null;\n }\n\n return frame.url + ':' + (frame.lineNumber + 1) + ':' + (frame.columnNumber + 1);\n }\n }\n\n static async buildDetailsNodeForTraceEvent(\n event: TraceEngine.Legacy.CompatibleTraceEvent, target: SDK.Target.Target|null,\n linkifier: LegacyComponents.Linkifier.Linkifier, isFreshRecording = false): Promise {\n const recordType = TimelineModel.TimelineModel.RecordType;\n let details: HTMLElement|HTMLSpanElement|(Element | null)|Text|null = null;\n let detailsText;\n const eventData = event.args['data'];\n switch (event.name) {\n case recordType.GCEvent:\n case recordType.MajorGC:\n case recordType.MinorGC:\n case recordType.EventDispatch:\n case recordType.Paint:\n case recordType.Animation:\n case recordType.EmbedderCallback:\n case recordType.ParseHTML:\n case recordType.WasmStreamFromResponseCallback:\n case recordType.WasmCompiledModule:\n case recordType.WasmModuleCacheHit:\n case recordType.WasmCachedModule:\n case recordType.WasmModuleCacheInvalid:\n case recordType.WebSocketCreate:\n case recordType.WebSocketSendHandshakeRequest:\n case recordType.WebSocketReceiveHandshakeResponse:\n case recordType.WebSocketDestroy: {\n detailsText = await TimelineUIUtils.buildDetailsTextForTraceEvent(event);\n break;\n }\n\n case recordType.PaintImage:\n case recordType.DecodeImage:\n case recordType.ResizeImage:\n case recordType.DecodeLazyPixelRef:\n case recordType.XHRReadyStateChange:\n case recordType.XHRLoad:\n case recordType.ResourceWillSendRequest:\n case recordType.ResourceSendRequest:\n case recordType.ResourceReceivedData:\n case recordType.ResourceReceiveResponse:\n case recordType.ResourceFinish: {\n const url = TimelineModel.TimelineModel.EventOnTimelineData.forEvent(event).url;\n if (url) {\n const options = {\n tabStop: true,\n showColumnNumber: false,\n inlineFrameIndex: 0,\n };\n details = LegacyComponents.Linkifier.Linkifier.linkifyURL(url, options);\n }\n break;\n }\n\n case recordType.JSRoot:\n case recordType.FunctionCall:\n case recordType.JSIdleFrame:\n case recordType.JSSystemFrame:\n case recordType.JSFrame: {\n details = document.createElement('span');\n UI.UIUtils.createTextChild(details, TimelineUIUtils.frameDisplayName(eventData));\n const location = this.linkifyLocation({\n scriptId: eventData['scriptId'],\n url: eventData['url'],\n lineNumber: eventData['lineNumber'],\n columnNumber: eventData['columnNumber'],\n target,\n isFreshRecording,\n linkifier,\n });\n if (location) {\n UI.UIUtils.createTextChild(details, ' @ ');\n details.appendChild(location);\n }\n break;\n }\n\n case recordType.CompileModule:\n case recordType.CacheModule: {\n details = this.linkifyLocation({\n scriptId: null,\n url: event.args['fileName'],\n lineNumber: 0,\n columnNumber: 0,\n target,\n isFreshRecording,\n linkifier,\n });\n break;\n }\n\n case recordType.CompileScript:\n case recordType.CacheScript:\n case recordType.EvaluateScript: {\n const url = eventData['url'];\n if (url) {\n details = this.linkifyLocation({\n scriptId: null,\n url,\n lineNumber: eventData['lineNumber'],\n columnNumber: 0,\n target,\n isFreshRecording,\n linkifier,\n });\n }\n break;\n }\n\n case recordType.BackgroundDeserialize:\n case recordType.StreamingCompileScript: {\n const url = eventData['url'];\n if (url) {\n details = this.linkifyLocation(\n {scriptId: null, url, lineNumber: 0, columnNumber: 0, target, isFreshRecording, linkifier});\n }\n break;\n }\n case TraceEngine.Types.TraceEvents.KnownEventName.ProfileCall: {\n details = document.createElement('span');\n // This check is only added for convenience with the type checker.\n if (!TraceEngine.Legacy.eventIsFromNewEngine(event) || !TraceEngine.Types.TraceEvents.isProfileCall(event)) {\n break;\n }\n const maybeResolvedName = SourceMapsResolver.resolvedNodeNameForEntry(event);\n const functionName = maybeResolvedName || TimelineUIUtils.frameDisplayName(event.callFrame);\n UI.UIUtils.createTextChild(details, functionName);\n const location = this.linkifyLocation({\n scriptId: event.callFrame['scriptId'],\n url: event.callFrame['url'],\n lineNumber: event.callFrame['lineNumber'],\n columnNumber: event.callFrame['columnNumber'],\n target,\n isFreshRecording,\n linkifier,\n });\n if (location) {\n UI.UIUtils.createTextChild(details, ' @ ');\n details.appendChild(location);\n }\n break;\n }\n\n default: {\n if (TraceEngine.Legacy.eventHasCategory(\n event, TimelineModel.TimelineModel.TimelineModelImpl.Category.Console)) {\n detailsText = null;\n } else {\n details = TraceEngine.Legacy.eventIsFromNewEngine(event) ?\n this.linkifyTopCallFrame(event, target, linkifier, isFreshRecording) :\n null;\n }\n break;\n }\n }\n\n if (!details && detailsText) {\n details = document.createTextNode(detailsText);\n }\n return details;\n }\n\n static linkifyLocation(linkifyOptions: LinkifyLocationOptions): Element|null {\n const {scriptId, url, lineNumber, columnNumber, isFreshRecording, linkifier, target} = linkifyOptions;\n const options = {\n lineNumber,\n columnNumber,\n showColumnNumber: true,\n inlineFrameIndex: 0,\n className: 'timeline-details',\n tabStop: true,\n };\n if (isFreshRecording) {\n return linkifier.linkifyScriptLocation(\n target, scriptId, url as Platform.DevToolsPath.UrlString, lineNumber, options);\n }\n return LegacyComponents.Linkifier.Linkifier.linkifyURL(url as Platform.DevToolsPath.UrlString, options);\n }\n\n static linkifyTopCallFrame(\n event: TraceEngine.Types.TraceEvents.TraceEventData, target: SDK.Target.Target|null,\n linkifier: LegacyComponents.Linkifier.Linkifier, isFreshRecording = false): Element|null {\n const frame = TimelineModel.TimelineProfileTree.eventStackFrame(event);\n if (!frame) {\n return null;\n }\n const options = {\n className: 'timeline-details',\n tabStop: true,\n inlineFrameIndex: 0,\n showColumnNumber: true,\n columnNumber: frame.columnNumber,\n lineNumber: frame.lineNumber,\n };\n if (isFreshRecording) {\n return linkifier.maybeLinkifyConsoleCallFrame(target, frame, {showColumnNumber: true, inlineFrameIndex: 0});\n }\n return LegacyComponents.Linkifier.Linkifier.linkifyURL(frame.url as Platform.DevToolsPath.UrlString, options);\n }\n\n static buildDetailsNodeForPerformanceEvent(event: TraceEngine.Legacy.Event|\n TraceEngine.Types.TraceEvents.TraceEventData): Element {\n let link = 'https://web.dev/user-centric-performance-metrics/';\n let name = 'page performance metrics';\n const recordType = TimelineModel.TimelineModel.RecordType;\n switch (event.name) {\n case recordType.MarkLCPCandidate:\n link = 'https://web.dev/lcp/';\n name = 'largest contentful paint';\n break;\n case recordType.MarkFCP:\n link = 'https://web.dev/first-contentful-paint/';\n name = 'first contentful paint';\n break;\n default:\n break;\n }\n\n return UI.Fragment.html`
${\n UI.XLink.XLink.create(\n link, i18nString(UIStrings.learnMore), undefined, undefined, 'learn-more')} about ${name}.
`;\n }\n\n static buildConsumeCacheDetails(\n eventData: {\n consumedCacheSize?: number,\n cacheRejected?: boolean,\n cacheKind?: string,\n },\n contentHelper: TimelineDetailsContentHelper): void {\n if (typeof eventData.consumedCacheSize === 'number') {\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheStatus), i18nString(UIStrings.scriptLoadedFromCache));\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheSize),\n Platform.NumberUtilities.bytesToString(eventData.consumedCacheSize));\n const cacheKind = eventData.cacheKind;\n if (cacheKind) {\n contentHelper.appendTextRow(i18nString(UIStrings.compilationCacheKind), cacheKind);\n }\n } else if ('cacheRejected' in eventData && eventData['cacheRejected']) {\n // Version mismatch or similar.\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheStatus), i18nString(UIStrings.failedToLoadScriptFromCache));\n } else {\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheStatus), i18nString(UIStrings.scriptNotEligible));\n }\n }\n\n static async buildTraceEventDetails(\n event: TraceEngine.Legacy.CompatibleTraceEvent,\n model: TimelineModel.TimelineModel.TimelineModelImpl,\n linkifier: LegacyComponents.Linkifier.Linkifier,\n detailed: boolean,\n // TODO(crbug.com/1430809): the order of these arguments is slightly\n // awkward because to change them is to cause a lot of layout tests to be\n // updated. We should rewrite those tests as unit tests in this codebase,\n // and then we can more easily change this method.\n traceParseData: TraceEngine.Handlers.Types.TraceParseData|null = null,\n ): Promise {\n const maybeTarget = model.targetByEvent(event);\n const {duration, selfTime} = TraceEngine.Legacy.timesForEventInMilliseconds(event);\n let relatedNodesMap: (Map|null)|null = null;\n if (maybeTarget) {\n const target = (maybeTarget as SDK.Target.Target);\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n if (typeof event[previewElementSymbol] === 'undefined') {\n let previewElement: (Element|null)|null = null;\n const url = TimelineModel.TimelineModel.EventOnTimelineData.forEvent(event).url;\n if (url) {\n previewElement = await LegacyComponents.ImagePreview.ImagePreview.build(target, url, false, {\n imageAltText: LegacyComponents.ImagePreview.ImagePreview.defaultAltTextForImageURL(url),\n precomputedFeatures: undefined,\n });\n } else if (\n traceParseData && TraceEngine.Legacy.eventIsFromNewEngine(event) &&\n TraceEngine.Types.TraceEvents.isTraceEventPaint(event)) {\n previewElement = await TimelineUIUtils.buildPicturePreviewContent(traceParseData, event, target);\n }\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n event[previewElementSymbol] = previewElement;\n }\n\n const nodeIdsToResolve = new Set();\n const timelineData = TimelineModel.TimelineModel.EventOnTimelineData.forEvent(event);\n if (timelineData.backendNodeIds) {\n for (let i = 0; i < timelineData.backendNodeIds.length; ++i) {\n nodeIdsToResolve.add(timelineData.backendNodeIds[i]);\n }\n }\n if (nodeIdsToResolve.size) {\n const domModel = target.model(SDK.DOMModel.DOMModel);\n if (domModel) {\n relatedNodesMap = await domModel.pushNodesByBackendIdsToFrontend(nodeIdsToResolve);\n }\n }\n if (traceParseData && TraceEngine.Legacy.eventIsFromNewEngine(event) &&\n TraceEngine.Types.TraceEvents.isSyntheticLayoutShift(event)) {\n relatedNodesMap = await TraceEngine.Extras.FetchNodes.extractRelatedDOMNodesFromEvent(traceParseData, event);\n }\n }\n\n const recordTypes = TimelineModel.TimelineModel.RecordType;\n\n if (event.name === recordTypes.LayoutShift) {\n // Ensure that there are no pie charts or extended info for layout shifts.\n detailed = false;\n }\n\n // This message may vary per event.name;\n let relatedNodeLabel;\n\n const contentHelper = new TimelineDetailsContentHelper(model.targetByEvent(event), linkifier);\n\n const defaultColorForEvent = TraceEngine.Legacy.eventIsFromNewEngine(event) ?\n getEventStyle(event.name as TraceEngine.Types.TraceEvents.KnownEventName)?.category.getComputedColorValue() :\n TimelineUIUtils.eventStyle(event).category.getComputedColorValue();\n const color = model.isMarkerEvent(event) ? TimelineUIUtils.markerStyleForEvent(event).color : defaultColorForEvent;\n\n contentHelper.addSection(TimelineUIUtils.eventTitle(event), color);\n\n const eventData = event.args['data'];\n const timelineData = TimelineModel.TimelineModel.EventOnTimelineData.forEvent(event);\n const initiator = TraceEngine.Legacy.eventIsFromNewEngine(event) ?\n traceParseData?.Initiators.eventToInitiator.get(event) ?? null :\n null;\n const initiatorFor = TraceEngine.Legacy.eventIsFromNewEngine(event) ?\n traceParseData?.Initiators.initiatorToEvents.get(event) ?? null :\n null;\n\n let url: Platform.DevToolsPath.UrlString|null = null;\n\n if (TraceEngine.Legacy.eventIsFromNewEngine(event) && traceParseData) {\n const warnings = TimelineComponents.DetailsView.buildWarningElementsForEvent(event, traceParseData);\n for (const warning of warnings) {\n contentHelper.appendElementRow(i18nString(UIStrings.warning), warning, true);\n }\n }\n if (detailed && !Number.isNaN(duration || 0)) {\n contentHelper.appendTextRow(\n i18nString(UIStrings.totalTime), i18n.TimeUtilities.millisToString(duration || 0, true));\n contentHelper.appendTextRow(i18nString(UIStrings.selfTime), i18n.TimeUtilities.millisToString(selfTime, true));\n }\n\n if (traceParseData?.Meta.traceIsGeneric) {\n for (const key in event.args) {\n try {\n contentHelper.appendTextRow(key, JSON.stringify(event.args[key]));\n } catch (e) {\n contentHelper.appendTextRow(key, `<${typeof event.args[key]}>`);\n }\n }\n return contentHelper.fragment;\n }\n\n if (TraceEngine.Legacy.eventIsFromNewEngine(event) && TraceEngine.Types.TraceEvents.isTraceEventV8Compile(event)) {\n url = event.args.data?.url as Platform.DevToolsPath.UrlString;\n if (url) {\n const lineNumber = event.args?.data?.lineNumber || 0;\n const columnNumber = event.args?.data?.columnNumber;\n contentHelper.appendLocationRow(i18nString(UIStrings.script), url, lineNumber, columnNumber);\n }\n const isEager = Boolean(event.args.data?.eager);\n if (isEager) {\n contentHelper.appendTextRow(i18nString(UIStrings.eagerCompile), true);\n }\n\n const isStreamed = Boolean(event.args.data?.streamed);\n contentHelper.appendTextRow(\n i18nString(UIStrings.streamed),\n isStreamed + (isStreamed ? '' : `: ${event.args.data?.notStreamedReason || ''}`));\n TimelineUIUtils.buildConsumeCacheDetails(eventData, contentHelper);\n }\n\n switch (event.name) {\n case recordTypes.GCEvent:\n case recordTypes.MajorGC:\n case recordTypes.MinorGC: {\n const delta = event.args['usedHeapSizeBefore'] - event.args['usedHeapSizeAfter'];\n contentHelper.appendTextRow(i18nString(UIStrings.collected), Platform.NumberUtilities.bytesToString(delta));\n break;\n }\n\n case recordTypes.JSRoot:\n case recordTypes.JSFrame:\n case TraceEngine.Types.TraceEvents.KnownEventName.ProfileCall:\n case recordTypes.JSIdleFrame:\n case recordTypes.JSSystemFrame:\n case recordTypes.FunctionCall: {\n const detailsNode = await TimelineUIUtils.buildDetailsNodeForTraceEvent(\n event, model.targetByEvent(event), linkifier, model.isFreshRecording());\n if (detailsNode) {\n contentHelper.appendElementRow(i18nString(UIStrings.function), detailsNode);\n }\n break;\n }\n\n case recordTypes.TimerFire:\n case recordTypes.TimerInstall:\n case recordTypes.TimerRemove: {\n contentHelper.appendTextRow(i18nString(UIStrings.timerId), eventData['timerId']);\n if (event.name === recordTypes.TimerInstall) {\n contentHelper.appendTextRow(\n i18nString(UIStrings.timeout), i18n.TimeUtilities.millisToString(eventData['timeout']));\n contentHelper.appendTextRow(i18nString(UIStrings.repeats), !eventData['singleShot']);\n }\n break;\n }\n\n case recordTypes.FireAnimationFrame: {\n contentHelper.appendTextRow(i18nString(UIStrings.callbackId), eventData['id']);\n break;\n }\n\n case recordTypes.CompileModule: {\n contentHelper.appendLocationRow(i18nString(UIStrings.module), event.args['fileName'], 0);\n break;\n }\n case recordTypes.CompileScript: {\n // This case is handled above\n break;\n }\n\n case recordTypes.CacheModule: {\n url = eventData && eventData['url'] as Platform.DevToolsPath.UrlString;\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheSize),\n Platform.NumberUtilities.bytesToString(eventData['producedCacheSize']));\n break;\n }\n\n case recordTypes.CacheScript: {\n url = eventData && eventData['url'] as Platform.DevToolsPath.UrlString;\n if (url) {\n contentHelper.appendLocationRow(\n i18nString(UIStrings.script), url, eventData['lineNumber'], eventData['columnNumber']);\n }\n contentHelper.appendTextRow(\n i18nString(UIStrings.compilationCacheSize),\n Platform.NumberUtilities.bytesToString(eventData['producedCacheSize']));\n break;\n }\n\n case recordTypes.EvaluateScript: {\n url = eventData && eventData['url'] as Platform.DevToolsPath.UrlString;\n if (url) {\n contentHelper.appendLocationRow(\n i18nString(UIStrings.script), url, eventData['lineNumber'], eventData['columnNumber']);\n }\n break;\n }\n\n case recordTypes.WasmStreamFromResponseCallback:\n case recordTypes.WasmCompiledModule:\n case recordTypes.WasmCachedModule:\n case recordTypes.WasmModuleCacheHit:\n case recordTypes.WasmModuleCacheInvalid: {\n if (eventData) {\n url = event.args['url'] as Platform.DevToolsPath.UrlString;\n if (url) {\n contentHelper.appendTextRow(i18nString(UIStrings.url), url);\n }\n const producedCachedSize = event.args['producedCachedSize'];\n if (producedCachedSize) {\n contentHelper.appendTextRow(i18nString(UIStrings.producedCacheSize), producedCachedSize);\n }\n const consumedCachedSize = event.args['consumedCachedSize'];\n if (consumedCachedSize) {\n contentHelper.appendTextRow(i18nString(UIStrings.consumedCacheSize), consumedCachedSize);\n }\n }\n break;\n }\n\n // @ts-ignore Fall-through intended.\n case recordTypes.Paint: {\n const clip = eventData['clip'];\n contentHelper.appendTextRow(\n i18nString(UIStrings.location), i18nString(UIStrings.sSCurlyBrackets, {PH1: clip[0], PH2: clip[1]}));\n const clipWidth = TimelineUIUtils.quadWidth(clip);\n const clipHeight = TimelineUIUtils.quadHeight(clip);\n contentHelper.appendTextRow(\n i18nString(UIStrings.dimensions), i18nString(UIStrings.sSDimensions, {PH1: clipWidth, PH2: clipHeight}));\n }\n\n case recordTypes.PaintSetup:\n case recordTypes.Rasterize:\n case recordTypes.ScrollLayer: {\n relatedNodeLabel = i18nString(UIStrings.layerRoot);\n break;\n }\n\n case recordTypes.PaintImage:\n case recordTypes.DecodeLazyPixelRef:\n case recordTypes.DecodeImage:\n case recordTypes.ResizeImage:\n case recordTypes.DrawLazyPixelRef: {\n relatedNodeLabel = i18nString(UIStrings.ownerElement);\n url = timelineData.url;\n if (url) {\n const options = {\n tabStop: true,\n showColumnNumber: false,\n inlineFrameIndex: 0,\n };\n contentHelper.appendElementRow(\n i18nString(UIStrings.imageUrl), LegacyComponents.Linkifier.Linkifier.linkifyURL(url, options));\n }\n break;\n }\n\n case recordTypes.ParseAuthorStyleSheet: {\n url = eventData['styleSheetUrl'] as Platform.DevToolsPath.UrlString;\n if (url) {\n const options = {\n tabStop: true,\n showColumnNumber: false,\n inlineFrameIndex: 0,\n };\n contentHelper.appendElementRow(\n i18nString(UIStrings.stylesheetUrl), LegacyComponents.Linkifier.Linkifier.linkifyURL(url, options));\n }\n break;\n }\n\n case recordTypes.UpdateLayoutTree: // We don't want to see default details.\n case recordTypes.RecalculateStyles: {\n contentHelper.appendTextRow(i18nString(UIStrings.elementsAffected), event.args['elementCount']);\n break;\n }\n\n case recordTypes.Layout: {\n const beginData = event.args['beginData'];\n contentHelper.appendTextRow(\n i18nString(UIStrings.nodesThatNeedLayout),\n i18nString(UIStrings.sOfS, {PH1: beginData['dirtyObjects'], PH2: beginData['totalObjects']}));\n relatedNodeLabel = i18nString(UIStrings.layoutRoot);\n break;\n }\n\n case recordTypes.ConsoleTime: {\n contentHelper.appendTextRow(i18nString(UIStrings.message), event.name);\n break;\n }\n\n case recordTypes.WebSocketCreate:\n case recordTypes.WebSocketSendHandshakeRequest:\n case recordTypes.WebSocketReceiveHandshakeResponse:\n case recordTypes.WebSocketDestroy: {\n // The events will be from tthe new engine; as we remove the old engine we can remove these checks.\n if (TraceEngine.Legacy.eventIsFromNewEngine(event) &&\n TraceEngine.Types.TraceEvents.isWebSocketTraceEvent(event) && traceParseData) {\n const rows = TimelineComponents.DetailsView.buildRowsForWebSocketEvent(event, traceParseData);\n for (const {key, value} of rows) {\n contentHelper.appendTextRow(key, value);\n }\n }\n break;\n }\n\n case recordTypes.EmbedderCallback: {\n contentHelper.appendTextRow(i18nString(UIStrings.callbackFunction), eventData['callbackName']);\n break;\n }\n\n case recordTypes.Animation: {\n if (TraceEngine.Legacy.phaseForEvent(event) === TraceEngine.Types.TraceEvents.Phase.ASYNC_NESTABLE_INSTANT) {\n contentHelper.appendTextRow(i18nString(UIStrings.state), eventData['state']);\n }\n break;\n }\n\n case recordTypes.ParseHTML: {\n const beginData = event.args['beginData'];\n const startLine = beginData['startLine'] - 1;\n const endLine = event.args['endData'] ? event.args['endData']['endLine'] - 1 : undefined;\n url = beginData['url'];\n if (url) {\n contentHelper.appendLocationRange(i18nString(UIStrings.range), url, startLine, endLine);\n }\n break;\n }\n\n // @ts-ignore Fall-through intended.\n case recordTypes.FireIdleCallback: {\n contentHelper.appendTextRow(\n i18nString(UIStrings.allottedTime), i18n.TimeUtilities.millisToString(eventData['allottedMilliseconds']));\n contentHelper.appendTextRow(i18nString(UIStrings.invokedByTimeout), eventData['timedOut']);\n }\n\n case recordTypes.RequestIdleCallback:\n case recordTypes.CancelIdleCallback: {\n contentHelper.appendTextRow(i18nString(UIStrings.callbackId), eventData['id']);\n break;\n }\n\n case recordTypes.EventDispatch: {\n contentHelper.appendTextRow(i18nString(UIStrings.type), eventData['type']);\n break;\n }\n\n // @ts-ignore Fall-through intended.\n case recordTypes.MarkLCPCandidate: {\n contentHelper.appendTextRow(i18nString(UIStrings.type), String(eventData['type']));\n contentHelper.appendTextRow(i18nString(UIStrings.size), String(eventData['size']));\n }\n\n case recordTypes.MarkFirstPaint:\n case recordTypes.MarkFCP:\n case recordTypes.MarkLoad:\n case recordTypes.MarkDOMContent: {\n // Because the TimingsTrack has been migrated to the new engine, we\n // know that this conditonal will be true, but it is here to satisfy\n // TypeScript. That is also why there is no else branch for this -\n // there is no way in which timings here can be the legacy\n // SDKTraceEvent class.\n if (traceParseData && TraceEngine.Legacy.eventIsFromNewEngine(event)) {\n const adjustedEventTimeStamp = timeStampForEventAdjustedForClosestNavigationIfPossible(\n event,\n traceParseData,\n );\n\n contentHelper.appendTextRow(\n i18nString(UIStrings.timestamp), i18n.TimeUtilities.preciseMillisToString(adjustedEventTimeStamp, 1));\n contentHelper.appendElementRow(\n i18nString(UIStrings.details), TimelineUIUtils.buildDetailsNodeForPerformanceEvent(event));\n }\n\n break;\n }\n\n case recordTypes.EventTiming: {\n const detailsNode = await TimelineUIUtils.buildDetailsNodeForTraceEvent(\n event, model.targetByEvent(event), linkifier, model.isFreshRecording());\n if (detailsNode) {\n contentHelper.appendElementRow(i18nString(UIStrings.details), detailsNode);\n }\n let payload: TraceEngine.Types.TraceEvents.TraceEventData|null = null;\n if (TraceEngine.Legacy.eventIsFromNewEngine(event)) {\n payload = event;\n } else if (TraceEngine.Legacy.eventHasPayload(event)) {\n payload = event.rawPayload();\n }\n\n if (payload && TraceEngine.Types.TraceEvents.isSyntheticInteractionEvent(payload)) {\n const inputDelay = TraceEngine.Helpers.Timing.formatMicrosecondsTime(payload.inputDelay);\n const mainThreadTime = TraceEngine.Helpers.Timing.formatMicrosecondsTime(payload.mainThreadHandling);\n const presentationDelay = TraceEngine.Helpers.Timing.formatMicrosecondsTime(payload.presentationDelay);\n contentHelper.appendTextRow(i18nString(UIStrings.interactionID), payload.interactionId);\n contentHelper.appendTextRow(i18nString(UIStrings.inputDelay), inputDelay);\n contentHelper.appendTextRow(i18nString(UIStrings.processingDuration), mainThreadTime);\n contentHelper.appendTextRow(i18nString(UIStrings.presentationDelay), presentationDelay);\n }\n break;\n }\n\n case recordTypes.LayoutShift: {\n if (!TraceEngine.Legacy.eventIsFromNewEngine(event) ||\n !TraceEngine.Types.TraceEvents.isSyntheticLayoutShift(event)) {\n console.error('Unexpected type for LayoutShift event');\n break;\n }\n const layoutShift = event as TraceEngine.Types.TraceEvents.SyntheticLayoutShift;\n const layoutShiftEventData = layoutShift.args.data;\n const warning = document.createElement('span');\n const clsLink = UI.XLink.XLink.create(\n 'https://web.dev/cls/', i18nString(UIStrings.cumulativeLayoutShifts), undefined, undefined,\n 'cumulative-layout-shifts');\n const evolvedClsLink = UI.XLink.XLink.create(\n 'https://web.dev/evolving-cls/', i18nString(UIStrings.evolvedClsLink), undefined, undefined, 'evolved-cls');\n\n warning.appendChild(\n i18n.i18n.getFormatLocalizedString(str_, UIStrings.sCLSInformation, {PH1: clsLink, PH2: evolvedClsLink}));\n contentHelper.appendElementRow(i18nString(UIStrings.warning), warning, true);\n if (!layoutShiftEventData) {\n break;\n }\n contentHelper.appendTextRow(i18nString(UIStrings.score), layoutShiftEventData['score'].toPrecision(4));\n contentHelper.appendTextRow(\n i18nString(UIStrings.cumulativeScore), layoutShiftEventData['cumulative_score'].toPrecision(4));\n contentHelper.appendTextRow(\n i18nString(UIStrings.currentClusterId), layoutShift.parsedData.sessionWindowData.id);\n contentHelper.appendTextRow(\n i18nString(UIStrings.currentClusterScore),\n layoutShift.parsedData.sessionWindowData.cumulativeWindowScore.toPrecision(4));\n contentHelper.appendTextRow(\n i18nString(UIStrings.hadRecentInput),\n eventData['had_recent_input'] ? i18nString(UIStrings.yes) : i18nString(UIStrings.no));\n\n for (const impactedNode of eventData['impacted_nodes']) {\n const oldRect = new CLSRect(impactedNode['old_rect']);\n const newRect = new CLSRect(impactedNode['new_rect']);\n\n const linkedOldRect = await Common.Linkifier.Linkifier.linkify(oldRect);\n const linkedNewRect = await Common.Linkifier.Linkifier.linkify(newRect);\n\n contentHelper.appendElementRow(i18nString(UIStrings.movedFrom), linkedOldRect);\n contentHelper.appendElementRow(i18nString(UIStrings.movedTo), linkedNewRect);\n }\n\n break;\n }\n\n default: {\n const detailsNode = await TimelineUIUtils.buildDetailsNodeForTraceEvent(\n event, model.targetByEvent(event), linkifier, model.isFreshRecording());\n if (detailsNode) {\n contentHelper.appendElementRow(i18nString(UIStrings.details), detailsNode);\n }\n break;\n }\n }\n const relatedNodes = relatedNodesMap?.values() || [];\n for (const relatedNode of relatedNodes) {\n if (relatedNode) {\n const nodeSpan = await Common.Linkifier.Linkifier.linkify(relatedNode);\n contentHelper.appendElementRow(relatedNodeLabel || i18nString(UIStrings.relatedNode), nodeSpan);\n }\n }\n\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n if (event[previewElementSymbol]) {\n contentHelper.addSection(i18nString(UIStrings.preview));\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n contentHelper.appendElementRow('', event[previewElementSymbol]);\n }\n\n if (TraceEngine.Legacy.eventIsFromNewEngine(event) && traceParseData) {\n const stackTrace = TraceEngine.Helpers.Trace.stackTraceForEvent(event);\n if (initiator || initiatorFor || stackTrace || traceParseData?.Invalidations.invalidationsForEvent.get(event)) {\n await TimelineUIUtils.generateCauses(event, contentHelper, traceParseData);\n }\n }\n\n const stats: {\n [x: string]: number,\n } = {};\n const showPieChart =\n detailed && traceParseData && TimelineUIUtils.aggregatedStatsForTraceEvent(stats, traceParseData, event);\n if (showPieChart) {\n contentHelper.addSection(i18nString(UIStrings.aggregatedTime));\n const pieChart = TimelineUIUtils.generatePieChart(stats, TimelineUIUtils.eventStyle(event).category, selfTime);\n contentHelper.appendElementRow('', pieChart);\n }\n\n return contentHelper.fragment;\n }\n\n static statsForTimeRange(events: TraceEngine.Legacy.CompatibleTraceEvent[], startTime: number, endTime: number): {\n [x: string]: number,\n } {\n if (!events.length) {\n return {'idle': endTime - startTime};\n }\n\n buildRangeStatsCacheIfNeeded(events);\n const aggregatedStats = subtractStats(aggregatedStatsAtTime(endTime), aggregatedStatsAtTime(startTime));\n const aggregatedTotal = Object.values(aggregatedStats).reduce((a, b) => a + b, 0);\n aggregatedStats['idle'] = Math.max(0, endTime - startTime - aggregatedTotal);\n return aggregatedStats;\n\n function aggregatedStatsAtTime(time: number): {\n [x: string]: number,\n } {\n const stats: {\n [x: string]: number,\n } = {};\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n const cache = events[categoryBreakdownCacheSymbol];\n for (const category in cache) {\n const categoryCache = cache[category];\n const index =\n Platform.ArrayUtilities.upperBound(categoryCache.time, time, Platform.ArrayUtilities.DEFAULT_COMPARATOR);\n let value;\n if (index === 0) {\n value = 0;\n } else if (index === categoryCache.time.length) {\n value = categoryCache.value[categoryCache.value.length - 1];\n } else {\n const t0 = categoryCache.time[index - 1];\n const t1 = categoryCache.time[index];\n const v0 = categoryCache.value[index - 1];\n const v1 = categoryCache.value[index];\n value = v0 + (v1 - v0) * (time - t0) / (t1 - t0);\n }\n stats[category] = value;\n }\n return stats;\n }\n\n function subtractStats(\n a: {\n [x: string]: number,\n },\n b: {\n [x: string]: number,\n }): {\n [x: string]: number,\n } {\n const result = Object.assign({}, a);\n for (const key in b) {\n result[key] -= b[key];\n }\n return result;\n }\n\n function buildRangeStatsCacheIfNeeded(events: TraceEngine.Legacy.CompatibleTraceEvent[]): void {\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n if (events[categoryBreakdownCacheSymbol]) {\n return;\n }\n\n // aggeregatedStats is a map by categories. For each category there's an array\n // containing sorted time points which records accumulated value of the category.\n const aggregatedStats: {\n [x: string]: {\n time: number[],\n value: number[],\n },\n } = {};\n const categoryStack: string[] = [];\n let lastTime = 0;\n TimelineModel.TimelineModel.TimelineModelImpl.forEachEvent(events, onStartEvent, onEndEvent);\n\n function updateCategory(category: string, time: number): void {\n let statsArrays: {\n time: number[],\n value: number[],\n } = aggregatedStats[category];\n if (!statsArrays) {\n statsArrays = {time: [], value: []};\n aggregatedStats[category] = statsArrays;\n }\n if (statsArrays.time.length && statsArrays.time[statsArrays.time.length - 1] === time || lastTime > time) {\n return;\n }\n const lastValue = statsArrays.value.length > 0 ? statsArrays.value[statsArrays.value.length - 1] : 0;\n statsArrays.value.push(lastValue + time - lastTime);\n statsArrays.time.push(time);\n }\n\n function categoryChange(from: string|null, to: string|null, time: number): void {\n if (from) {\n updateCategory(from, time);\n }\n lastTime = time;\n if (to) {\n updateCategory(to, time);\n }\n }\n\n function onStartEvent(e: TraceEngine.Legacy.CompatibleTraceEvent): void {\n const {startTime} = TraceEngine.Legacy.timesForEventInMilliseconds(e);\n const category = getEventStyle(e.name as TraceEngine.Types.TraceEvents.KnownEventName)?.category.name ||\n getCategoryStyles().other.name;\n const parentCategory = categoryStack.length ? categoryStack[categoryStack.length - 1] : null;\n if (category !== parentCategory) {\n categoryChange(parentCategory || null, category, startTime);\n }\n categoryStack.push(category);\n }\n\n function onEndEvent(e: TraceEngine.Legacy.CompatibleTraceEvent): void {\n const {endTime} = TraceEngine.Legacy.timesForEventInMilliseconds(e);\n const category = categoryStack.pop();\n const parentCategory = categoryStack.length ? categoryStack[categoryStack.length - 1] : null;\n if (category !== parentCategory) {\n categoryChange(category || null, parentCategory || null, endTime || 0);\n }\n }\n\n const obj = (events as Object);\n // @ts-ignore TODO(crbug.com/1011811): Remove symbol usage.\n obj[categoryBreakdownCacheSymbol] = aggregatedStats;\n }\n }\n\n static async buildSyntheticNetworkRequestDetails(\n event: TraceEngine.Types.TraceEvents.SyntheticNetworkRequest,\n model: TimelineModel.TimelineModel.TimelineModelImpl,\n linkifier: LegacyComponents.Linkifier.Linkifier): Promise {\n const maybeTarget = model.targetByEvent(event);\n const contentHelper = new TimelineDetailsContentHelper(maybeTarget, linkifier);\n\n const category = TimelineUIUtils.syntheticNetworkRequestCategory(event);\n const color = TimelineUIUtils.networkCategoryColor(category);\n contentHelper.addSection(i18nString(UIStrings.networkRequest), color);\n\n const options = {\n tabStop: true,\n showColumnNumber: false,\n inlineFrameIndex: 0,\n };\n contentHelper.appendElementRow(\n i18n.i18n.lockedString('URL'),\n LegacyComponents.Linkifier.Linkifier.linkifyURL(\n event.args.data.url as Platform.DevToolsPath.UrlString, options));\n\n // The time from queueing the request until resource processing is finished.\n const fullDuration = event.dur;\n if (isFinite(fullDuration)) {\n let textRow = TraceEngine.Helpers.Timing.formatMicrosecondsTime(fullDuration);\n // The time from queueing the request until the download is finished. This\n // corresponds to the total time reported for the request in the network tab.\n const networkDuration = event.args.data.syntheticData.finishTime - event.ts;\n // The time it takes to make the resource available to the renderer process.\n const processingDuration = event.ts + event.dur - event.args.data.syntheticData.finishTime;\n if (isFinite(networkDuration) && isFinite(processingDuration)) {\n const networkDurationStr =\n TraceEngine.Helpers.Timing.formatMicrosecondsTime(networkDuration as TraceEngine.Types.Timing.MicroSeconds);\n const processingDurationStr = TraceEngine.Helpers.Timing.formatMicrosecondsTime(\n processingDuration as TraceEngine.Types.Timing.MicroSeconds);\n const cached = event.args.data.syntheticData.isMemoryCached || event.args.data.syntheticData.isDiskCached;\n const cacheOrNetworkLabel =\n cached ? i18nString(UIStrings.loadFromCache) : i18nString(UIStrings.networkTransfer);\n textRow += i18nString(\n UIStrings.SSSResourceLoading,\n {PH1: networkDurationStr, PH2: cacheOrNetworkLabel, PH3: processingDurationStr});\n }\n contentHelper.appendTextRow(i18nString(UIStrings.duration), textRow);\n }\n\n if (event.args.data.requestMethod) {\n contentHelper.appendTextRow(i18nString(UIStrings.requestMethod), event.args.data.requestMethod);\n }\n\n if (event.args.data.initialPriority) {\n const initialPriority = PerfUI.NetworkPriorities.uiLabelForNetworkPriority(\n event.args.data.initialPriority as Protocol.Network.ResourcePriority);\n contentHelper.appendTextRow(i18nString(UIStrings.initialPriority), initialPriority);\n }\n\n const priority = PerfUI.NetworkPriorities.uiLabelForNetworkPriority(\n event.args.data.priority as Protocol.Network.ResourcePriority);\n\n contentHelper.appendTextRow(i18nString(UIStrings.priority), priority);\n\n if (event.args.data.mimeType) {\n contentHelper.appendTextRow(i18nString(UIStrings.mimeType), event.args.data.mimeType);\n }\n let lengthText = '';\n if (event.args.data.syntheticData.isMemoryCached) {\n lengthText += i18nString(UIStrings.FromMemoryCache);\n } else if (event.args.data.syntheticData.isDiskCached) {\n lengthText += i18nString(UIStrings.FromCache);\n } else if (event.args.data.timing?.pushStart) {\n lengthText += i18nString(UIStrings.FromPush);\n }\n if (event.args.data.fromServiceWorker) {\n lengthText += i18nString(UIStrings.FromServiceWorker);\n }\n if (event.args.data.encodedDataLength || !lengthText) {\n lengthText = `${Platform.NumberUtilities.bytesToString(event.args.data.encodedDataLength)}${lengthText}`;\n }\n contentHelper.appendTextRow(i18nString(UIStrings.encodedData), lengthText);\n if (event.args.data.decodedBodyLength) {\n contentHelper.appendTextRow(\n i18nString(UIStrings.decodedBody), Platform.NumberUtilities.bytesToString(event.args.data.decodedBodyLength));\n }\n const title = i18nString(UIStrings.initiatedBy);\n\n const topFrame = TimelineModel.TimelineModel.EventOnTimelineData.forEvent(event).topFrame();\n if (topFrame) {\n const link = linkifier.maybeLinkifyConsoleCallFrame(\n maybeTarget, topFrame, {tabStop: true, inlineFrameIndex: 0, showColumnNumber: true});\n if (link) {\n contentHelper.appendElementRow(title, link);\n }\n }\n\n if (!requestPreviewElements.get(event) && event.args.data.url && maybeTarget) {\n const previewElement =\n (await LegacyComponents.ImagePreview.ImagePreview.build(\n maybeTarget, event.args.data.url as Platform.DevToolsPath.UrlString, false, {\n imageAltText: LegacyComponents.ImagePreview.ImagePreview.defaultAltTextForImageURL(\n event.args.data.url as Platform.DevToolsPath.UrlString),\n precomputedFeatures: undefined,\n }) as HTMLImageElement);\n\n requestPreviewElements.set(event, previewElement);\n }\n\n const requestPreviewElement = requestPreviewElements.get(event);\n if (requestPreviewElement) {\n contentHelper.appendElementRow(i18nString(UIStrings.preview), requestPreviewElement);\n }\n return contentHelper.fragment;\n }\n\n static stackTraceFromCallFrames(callFrames: Protocol.Runtime.CallFrame[]|\n TraceEngine.Types.TraceEvents.TraceEventCallFrame[]): Protocol.Runtime.StackTrace {\n return {callFrames: callFrames} as Protocol.Runtime.StackTrace;\n }\n\n private static async generateCauses(\n event: TraceEngine.Types.TraceEvents.TraceEventData, contentHelper: TimelineDetailsContentHelper,\n traceParseData: TraceEngine.Handlers.Types.TraceParseData): Promise {\n const {startTime} = TraceEngine.Legacy.timesForEventInMilliseconds(event);\n let initiatorStackLabel = i18nString(UIStrings.initiatorStackTrace);\n let stackLabel = i18nString(UIStrings.stackTrace);\n\n switch (event.name) {\n case TraceEngine.Types.TraceEvents.KnownEventName.TimerFire:\n initiatorStackLabel = i18nString(UIStrings.timerInstalled);\n break;\n case TraceEngine.Types.TraceEvents.KnownEventName.FireAnimationFrame:\n initiatorStackLabel = i18nString(UIStrings.animationFrameRequested);\n break;\n case TraceEngine.Types.TraceEvents.KnownEventName.FireIdleCallback:\n initiatorStackLabel = i18nString(UIStrings.idleCallbackRequested);\n break;\n case TraceEngine.Types.TraceEvents.KnownEventName.UpdateLayoutTree:\n case TraceEngine.Types.TraceEvents.KnownEventName.RecalculateStyles:\n initiatorStackLabel = i18nString(UIStrings.firstInvalidated);\n stackLabel = i18nString(UIStrings.recalculationForced);\n break;\n case TraceEngine.Types.TraceEvents.KnownEventName.Layout:\n initiatorStackLabel = i18nString(UIStrings.firstLayoutInvalidation);\n stackLabel = i18nString(UIStrings.layoutForced);\n break;\n }\n\n const stackTrace = TraceEngine.Helpers.Trace.stackTraceForEvent(event);\n if (stackTrace && stackTrace.length) {\n contentHelper.addSection(stackLabel);\n contentHelper.createChildStackTraceElement(TimelineUIUtils.stackTraceFromCallFrames(stackTrace));\n }\n\n const initiator = traceParseData.Initiators.eventToInitiator.get(event);\n const initiatorFor = traceParseData.Initiators.initiatorToEvents.get(event);\n const invalidations = traceParseData.Invalidations.invalidationsForEvent.get(event);\n\n if (initiator) {\n // If we have an initiator for the event, we can show its stack trace, a link to reveal the initiator,\n // and the time since the initiator (Pending For).\n const stackTrace = TraceEngine.Helpers.Trace.stackTraceForEvent(initiator);\n if (stackTrace) {\n contentHelper.addSection(initiatorStackLabel);\n contentHelper.createChildStackTraceElement(TimelineUIUtils.stackTraceFromCallFrames(stackTrace.map(frame => {\n return {\n ...frame,\n scriptId: String(frame.scriptId) as Protocol.Runtime.ScriptId,\n };\n })));\n }\n\n const link = this.createEntryLink(initiator);\n contentHelper.appendElementRow(i18nString(UIStrings.initiatedBy), link);\n\n const {startTime: initiatorStartTime} = TraceEngine.Legacy.timesForEventInMilliseconds(initiator);\n const delay = startTime - initiatorStartTime;\n contentHelper.appendTextRow(i18nString(UIStrings.pendingFor), i18n.TimeUtilities.preciseMillisToString(delay, 1));\n }\n\n if (initiatorFor) {\n // If the event is an initiator for some entries, add links to reveal them.\n const links = document.createElement('div');\n initiatorFor.map((initiator, i) => {\n links.appendChild(this.createEntryLink(initiator));\n // Add space between each link if it's not last\n if (i < initiatorFor.length - 1) {\n links.append(' ');\n }\n });\n contentHelper.appendElementRow(UIStrings.initiatorFor, links);\n }\n\n if (invalidations && invalidations.length) {\n contentHelper.addSection(i18nString(UIStrings.invalidations));\n await TimelineUIUtils.generateInvalidationsList(invalidations, contentHelper);\n }\n }\n\n private static createEntryLink(entry: TraceEngine.Types.TraceEvents.TraceEventData): HTMLElement {\n const link = document.createElement('span');\n\n const traceBoundsState = TraceBounds.TraceBounds.BoundsManager.instance().state();\n if (!traceBoundsState) {\n return link;\n }\n\n // Check is the entry is outside of the current breadcrumb. If it is, don't create a link to navigate to it because there is no way to navigate outside breadcrumb without removing it. Instead, just display the name and \"outside breadcrumb\" text\n // Consider entry outside breadcrumb only if it is fully outside. If a part of it is visible, we can still select it.\n const isEntryOutsideBreadcrumb = traceBoundsState.micro.minimapTraceBounds.min > entry.ts + (entry.dur || 0) ||\n traceBoundsState.micro.minimapTraceBounds.max < entry.ts;\n\n // Check if it is in the hidden array\n const isEntryHidden =\n AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance()?.getEntriesFilter().inEntryInvisible(\n entry);\n\n if (!isEntryOutsideBreadcrumb) {\n link.classList.add('devtools-link');\n UI.ARIAUtils.markAsLink(link);\n link.tabIndex = 0;\n link.addEventListener('click', () => {\n TimelinePanel.instance().select(TimelineSelection.fromTraceEvent((entry)));\n });\n\n link.addEventListener('keydown', event => {\n if (event.key === 'Enter') {\n TimelinePanel.instance().select(TimelineSelection.fromTraceEvent((entry)));\n event.consume(true);\n }\n });\n }\n\n if (isEntryHidden) {\n link.textContent = this.eventTitle(entry) + ' ' + i18nString(UIStrings.entryIsHidden);\n } else if (isEntryOutsideBreadcrumb) {\n link.textContent = this.eventTitle(entry) + ' ' + i18nString(UIStrings.outsideBreadcrumbRange);\n } else {\n link.textContent = this.eventTitle(entry);\n }\n\n return link;\n }\n\n private static async generateInvalidationsList(\n invalidations: TraceEngine.Types.TraceEvents.SyntheticInvalidation[],\n contentHelper: TimelineDetailsContentHelper): Promise {\n const {groupedByReason, backendNodeIds} = TimelineComponents.DetailsView.generateInvalidationsList(invalidations);\n\n let relatedNodesMap: Map|null = null;\n const target = SDK.TargetManager.TargetManager.instance().primaryPageTarget();\n const domModel = target?.model(SDK.DOMModel.DOMModel);\n if (domModel) {\n relatedNodesMap = await domModel.pushNodesByBackendIdsToFrontend(backendNodeIds);\n }\n\n Object.keys(groupedByReason).forEach(reason => {\n TimelineUIUtils.generateInvalidationsForReason(reason, groupedByReason[reason], relatedNodesMap, contentHelper);\n });\n }\n\n private static generateInvalidationsForReason(\n reason: string, invalidations: TraceEngine.Types.TraceEvents.SyntheticInvalidation[],\n relatedNodesMap: Map|null, contentHelper: TimelineDetailsContentHelper): void {\n function createLinkForInvalidationNode(invalidation: TraceEngine.Types.TraceEvents.SyntheticInvalidation):\n HTMLSpanElement {\n const node = (invalidation.nodeId && relatedNodesMap) ? relatedNodesMap.get(invalidation.nodeId) : null;\n if (node) {\n const nodeSpan = document.createElement('span');\n void Common.Linkifier.Linkifier.linkify(node).then(link => nodeSpan.appendChild(link));\n return nodeSpan;\n }\n if (invalidation.nodeName) {\n const nodeSpan = document.createElement('span');\n nodeSpan.textContent = invalidation.nodeName;\n return nodeSpan;\n }\n const nodeSpan = document.createElement('span');\n UI.UIUtils.createTextChild(nodeSpan, i18nString(UIStrings.UnknownNode));\n return nodeSpan;\n }\n\n const generatedItems = new Set();\n\n for (const invalidation of invalidations) {\n const stackTrace = TraceEngine.Helpers.Trace.stackTraceForEvent(invalidation);\n let scriptLink: HTMLElement|null = null;\n const callFrame = stackTrace?.at(0);\n if (callFrame) {\n scriptLink = contentHelper.linkifier()?.maybeLinkifyScriptLocation(\n SDK.TargetManager.TargetManager.instance().rootTarget(),\n callFrame.scriptId as Protocol.Runtime.ScriptId,\n callFrame.url as Platform.DevToolsPath.UrlString,\n callFrame.lineNumber,\n ) ||\n null;\n }\n\n const niceNodeLink = createLinkForInvalidationNode(invalidation);\n\n const text = scriptLink ?\n i18n.i18n.getFormatLocalizedString(\n str_, UIStrings.invalidationWithCallFrame, {PH1: niceNodeLink, PH2: scriptLink}) as HTMLElement :\n niceNodeLink;\n\n // Sometimes we can get different Invalidation events which cause\n // the same text for the same element for the same reason to be\n // generated. Rather than show the user duplicates, if we have\n // generated text that looks identical to this before, we will\n // bail.\n const generatedText: string = (typeof text === 'string' ? text : text.innerText);\n if (generatedItems.has(generatedText)) {\n continue;\n }\n\n generatedItems.add(generatedText);\n contentHelper.appendElementRow(reason, text);\n }\n }\n\n private static aggregatedStatsForTraceEvent(\n total: {\n [x: string]: number,\n },\n traceParseData: TraceEngine.Handlers.Types.TraceParseData,\n event: TraceEngine.Legacy.CompatibleTraceEvent): boolean {\n const events = traceParseData.Renderer?.allTraceEntries || [];\n const {startTime, endTime} = TraceEngine.Legacy.timesForEventInMilliseconds(event);\n function eventComparator(startTime: number, e: TraceEngine.Types.TraceEvents.TraceEventData): number {\n const {startTime: eventStartTime} = TraceEngine.Legacy.timesForEventInMilliseconds(e);\n return startTime - eventStartTime;\n }\n\n const index = Platform.ArrayUtilities.binaryIndexOf(events, startTime, eventComparator);\n // Not a main thread event?\n if (index < 0) {\n return false;\n }\n let hasChildren = false;\n if (endTime) {\n for (let i = index; i < events.length; i++) {\n const nextEvent = events[i];\n const {startTime: nextEventStartTime, selfTime: nextEventSelfTime} =\n TraceEngine.Legacy.timesForEventInMilliseconds(nextEvent);\n if (nextEventStartTime >= endTime) {\n break;\n }\n if (!nextEvent.selfTime) {\n continue;\n }\n if (TraceEngine.Legacy.threadIDForEvent(nextEvent) !== TraceEngine.Legacy.threadIDForEvent(event)) {\n continue;\n }\n if (i > index) {\n hasChildren = true;\n }\n const categoryName = TimelineUIUtils.eventStyle(nextEvent).category.name;\n total[categoryName] = (total[categoryName] || 0) + nextEventSelfTime;\n }\n }\n if (TraceEngine.Types.TraceEvents.isAsyncPhase(TraceEngine.Legacy.phaseForEvent(event))) {\n if (endTime) {\n let aggregatedTotal = 0;\n for (const categoryName in total) {\n aggregatedTotal += total[categoryName];\n }\n total['idle'] = Math.max(0, endTime - startTime - aggregatedTotal);\n }\n return false;\n }\n return hasChildren;\n }\n\n static async buildPicturePreviewContent(\n traceData: TraceEngine.Handlers.Types.TraceParseData, event: TraceEngine.Types.TraceEvents.TraceEventPaint,\n target: SDK.Target.Target): Promise {\n const snapshotEvent = traceData.LayerTree.paintsToSnapshots.get(event);\n if (!snapshotEvent) {\n return null;\n }\n\n const paintProfilerModel = target.model(SDK.PaintProfiler.PaintProfilerModel);\n if (!paintProfilerModel) {\n return null;\n }\n const snapshot = await paintProfilerModel.loadSnapshot(snapshotEvent.args.snapshot.skp64);\n if (!snapshot) {\n return null;\n }\n\n const snapshotWithRect = {\n snapshot,\n rect: snapshotEvent.args.snapshot.params?.layer_rect,\n };\n\n if (!snapshotWithRect) {\n return null;\n }\n const imageURLPromise = snapshotWithRect.snapshot.replay();\n snapshotWithRect.snapshot.release();\n const imageURL = await imageURLPromise as Platform.DevToolsPath.UrlString;\n if (!imageURL) {\n return null;\n }\n const stylesContainer = document.createElement('div');\n const shadowRoot = stylesContainer.attachShadow({mode: 'open'});\n shadowRoot.adoptedStyleSheets = [imagePreviewStyles];\n const container = shadowRoot.createChild('div') as HTMLDivElement;\n container.classList.add('image-preview-container', 'vbox', 'link');\n const img = (container.createChild('img') as HTMLImageElement);\n img.src = imageURL;\n img.alt = LegacyComponents.ImagePreview.ImagePreview.defaultAltTextForImageURL(imageURL);\n const paintProfilerButton = container.createChild('a');\n paintProfilerButton.textContent = i18nString(UIStrings.paintProfiler);\n UI.ARIAUtils.markAsLink(container);\n container.tabIndex = 0;\n container.addEventListener(\n 'click', () => TimelinePanel.instance().select(TimelineSelection.fromTraceEvent(event)), false);\n container.addEventListener('keydown', keyEvent => {\n if (keyEvent.key === 'Enter') {\n TimelinePanel.instance().select(TimelineSelection.fromTraceEvent(event));\n keyEvent.consume(true);\n }\n });\n return stylesContainer;\n }\n\n static createEventDivider(event: TraceEngine.Legacy.CompatibleTraceEvent, zeroTime: number): Element {\n const eventDivider = document.createElement('div');\n eventDivider.classList.add('resources-event-divider');\n const {startTime: eventStartTime} = TraceEngine.Legacy.timesForEventInMilliseconds(event);\n\n const startTime = i18n.TimeUtilities.millisToString(eventStartTime - zeroTime);\n UI.Tooltip.Tooltip.install(\n eventDivider, i18nString(UIStrings.sAtS, {PH1: TimelineUIUtils.eventTitle(event), PH2: startTime}));\n const style = TimelineUIUtils.markerStyleForEvent(event);\n if (style.tall) {\n eventDivider.style.backgroundColor = style.color;\n }\n return eventDivider;\n }\n\n static visibleEventsFilter(): TimelineModel.TimelineModelFilter.TimelineModelFilter {\n return new TimelineModel.TimelineModelFilter.TimelineVisibleEventsFilter(visibleTypes());\n }\n\n // Included only for layout tests.\n // TODO(crbug.com/1386091): Fix/port layout tests and remove.\n static categories(): CategoryPalette {\n return getCategoryStyles();\n }\n\n static generatePieChart(\n aggregatedStats: {\n [x: string]: number,\n },\n selfCategory?: TimelineCategory, selfTime?: number): Element {\n let total = 0;\n for (const categoryName in aggregatedStats) {\n total += aggregatedStats[categoryName];\n }\n\n const element = document.createElement('div');\n element.classList.add('timeline-details-view-pie-chart-wrapper');\n element.classList.add('hbox');\n\n const pieChart = new PerfUI.PieChart.PieChart();\n const slices: {\n value: number,\n color: string,\n title: string,\n }[] = [];\n\n function appendLegendRow(name: string, title: string, value: number, color: string): void {\n if (!value) {\n return;\n }\n slices.push({value, color, title});\n }\n\n // In case of self time, first add self, then children of the same category.\n if (selfCategory) {\n if (selfTime) {\n appendLegendRow(\n selfCategory.name, i18nString(UIStrings.sSelf, {PH1: selfCategory.title}), selfTime,\n selfCategory.getCSSValue());\n }\n // Children of the same category.\n const categoryTime = aggregatedStats[selfCategory.name];\n const value = categoryTime - (selfTime || 0);\n if (value > 0) {\n appendLegendRow(\n selfCategory.name, i18nString(UIStrings.sChildren, {PH1: selfCategory.title}), value,\n selfCategory.getCSSValue());\n }\n }\n\n // Add other categories.\n for (const categoryName in getCategoryStyles()) {\n const category = getCategoryStyles()[categoryName as keyof CategoryPalette];\n if (categoryName === selfCategory?.name) {\n // Do not add an entry for this event's self category because 2\n // entries for it where added just before this for loop (for\n // self and children times).\n continue;\n }\n appendLegendRow(category.name, category.title, aggregatedStats[category.name], category.getCSSValue());\n }\n\n pieChart.data = {\n chartName: i18nString(UIStrings.timeSpentInRendering),\n size: 110,\n formatter: (value: number) => i18n.TimeUtilities.preciseMillisToString(value),\n showLegend: true,\n total,\n slices,\n };\n const pieChartContainer = element.createChild('div', 'vbox');\n pieChartContainer.appendChild(pieChart);\n\n return element;\n }\n\n static generateDetailsContentForFrame(\n frame: TraceEngine.Handlers.ModelHandlers.Frames.TimelineFrame, filmStrip: TraceEngine.Extras.FilmStrip.Data|null,\n filmStripFrame: TraceEngine.Extras.FilmStrip.Frame|null): DocumentFragment {\n const contentHelper = new TimelineDetailsContentHelper(null, null);\n contentHelper.addSection(i18nString(UIStrings.frame));\n\n const duration = TimelineUIUtils.frameDuration(frame);\n contentHelper.appendElementRow(i18nString(UIStrings.duration), duration);\n if (filmStrip && filmStripFrame) {\n const filmStripPreview = document.createElement('div');\n filmStripPreview.classList.add('timeline-filmstrip-preview');\n void UI.UIUtils.loadImage(filmStripFrame.screenshotEvent.args.dataUri)\n .then(image => image && filmStripPreview.appendChild(image));\n contentHelper.appendElementRow('', filmStripPreview);\n filmStripPreview.addEventListener('click', frameClicked.bind(null, filmStrip, filmStripFrame), false);\n }\n\n function frameClicked(\n filmStrip: TraceEngine.Extras.FilmStrip.Data, filmStripFrame: TraceEngine.Extras.FilmStrip.Frame): void {\n PerfUI.FilmStripView.Dialog.fromFilmStrip(filmStrip, filmStripFrame.index);\n }\n\n return contentHelper.fragment;\n }\n\n static frameDuration(frame: TraceEngine.Handlers.ModelHandlers.Frames.TimelineFrame): Element {\n const offsetMilli = TraceEngine.Helpers.Timing.microSecondsToMilliseconds(frame.startTimeOffset);\n const durationMilli = TraceEngine.Helpers.Timing.microSecondsToMilliseconds(\n TraceEngine.Types.Timing.MicroSeconds(frame.endTime - frame.startTime));\n\n const durationText = i18nString(UIStrings.sAtSParentheses, {\n PH1: i18n.TimeUtilities.millisToString(durationMilli, true),\n PH2: i18n.TimeUtilities.millisToString(offsetMilli, true),\n });\n return i18n.i18n.getFormatLocalizedString(str_, UIStrings.emptyPlaceholder, {PH1: durationText});\n }\n\n static quadWidth(quad: number[]): number {\n return Math.round(Math.sqrt(Math.pow(quad[0] - quad[2], 2) + Math.pow(quad[1] - quad[3], 2)));\n }\n\n static quadHeight(quad: number[]): number {\n return Math.round(Math.sqrt(Math.pow(quad[0] - quad[6], 2) + Math.pow(quad[1] - quad[7], 2)));\n }\n\n static eventDispatchDesciptors(): EventDispatchTypeDescriptor[] {\n if (eventDispatchDesciptors) {\n return eventDispatchDesciptors;\n }\n const lightOrange = 'hsl(40,100%,80%)';\n const orange = 'hsl(40,100%,50%)';\n const green = 'hsl(90,100%,40%)';\n const purple = 'hsl(256,100%,75%)';\n eventDispatchDesciptors = [\n new EventDispatchTypeDescriptor(\n 1, lightOrange, ['mousemove', 'mouseenter', 'mouseleave', 'mouseout', 'mouseover']),\n new EventDispatchTypeDescriptor(\n 1, lightOrange, ['pointerover', 'pointerout', 'pointerenter', 'pointerleave', 'pointermove']),\n new EventDispatchTypeDescriptor(2, green, ['wheel']),\n new EventDispatchTypeDescriptor(3, orange, ['click', 'mousedown', 'mouseup']),\n new EventDispatchTypeDescriptor(3, orange, ['touchstart', 'touchend', 'touchmove', 'touchcancel']),\n new EventDispatchTypeDescriptor(\n 3, orange, ['pointerdown', 'pointerup', 'pointercancel', 'gotpointercapture', 'lostpointercapture']),\n new EventDispatchTypeDescriptor(3, purple, ['keydown', 'keyup', 'keypress']),\n ];\n return eventDispatchDesciptors;\n }\n\n static markerShortTitle(event: TraceEngine.Legacy.Event): string|null {\n const recordTypes = TimelineModel.TimelineModel.RecordType;\n switch (event.name) {\n case recordTypes.MarkDOMContent:\n return i18n.i18n.lockedString('DCL');\n case recordTypes.MarkLoad:\n return i18n.i18n.lockedString('L');\n case recordTypes.MarkFirstPaint:\n return i18n.i18n.lockedString('FP');\n case recordTypes.MarkFCP:\n return i18n.i18n.lockedString('FCP');\n case recordTypes.MarkLCPCandidate:\n return i18n.i18n.lockedString('LCP');\n }\n return null;\n }\n\n static markerStyleForEvent(event: TraceEngine.Legacy.Event|\n TraceEngine.Types.TraceEvents.TraceEventData): TimelineMarkerStyle {\n const tallMarkerDashStyle = [6, 4];\n const title = TimelineUIUtils.eventTitle(event);\n const recordTypes = TimelineModel.TimelineModel.RecordType;\n\n if (event.name !== recordTypes.NavigationStart &&\n (TraceEngine.Legacy.eventHasCategory(event, TimelineModel.TimelineModel.TimelineModelImpl.Category.Console) ||\n TraceEngine.Legacy.eventHasCategory(\n event, TimelineModel.TimelineModel.TimelineModelImpl.Category.UserTiming))) {\n return {\n title: title,\n dashStyle: tallMarkerDashStyle,\n lineWidth: 0.5,\n color: TraceEngine.Legacy.eventHasCategory(\n event, TimelineModel.TimelineModel.TimelineModelImpl.Category.UserTiming) ?\n 'purple' :\n 'orange',\n tall: false,\n lowPriority: false,\n };\n }\n let tall = false;\n let color = 'grey';\n switch (event.name) {\n case recordTypes.NavigationStart:\n color = '#FF9800';\n tall = true;\n break;\n case recordTypes.FrameStartedLoading:\n color = 'green';\n tall = true;\n break;\n case recordTypes.MarkDOMContent:\n color = '#0867CB';\n tall = true;\n break;\n case recordTypes.MarkLoad:\n color = '#B31412';\n tall = true;\n break;\n case recordTypes.MarkFirstPaint:\n color = '#228847';\n tall = true;\n break;\n case recordTypes.MarkFCP:\n color = '#1A6937';\n tall = true;\n break;\n case recordTypes.MarkLCPCandidate:\n color = '#1A3422';\n tall = true;\n break;\n case recordTypes.TimeStamp:\n color = 'orange';\n break;\n }\n return {\n title: title,\n dashStyle: tallMarkerDashStyle,\n lineWidth: 0.5,\n color: color,\n tall: tall,\n lowPriority: false,\n };\n }\n\n static colorForId(id: string): string {\n if (!colorGenerator) {\n colorGenerator =\n new Common.Color.Generator({min: 30, max: 330, count: undefined}, {min: 50, max: 80, count: 3}, 85);\n colorGenerator.setColorForID('', '#f2ecdc');\n }\n return colorGenerator.colorForID(id);\n }\n\n static displayNameForFrame(frame: TimelineModel.TimelineModel.PageFrame, trimAt: number = 30): string {\n const url = frame.url;\n if (!trimAt) {\n trimAt = 30;\n }\n return Common.ParsedURL.schemeIs(url, 'about:') ? `\"${Platform.StringUtilities.trimMiddle(frame.name, trimAt)}\"` :\n frame.url.trimEnd(trimAt);\n }\n}\n\nexport const enum NetworkCategory {\n HTML = 'HTML',\n Script = 'Script',\n Style = 'Style',\n Media = 'Media',\n Other = 'Other',\n}\n\nexport const aggregatedStatsKey = Symbol('aggregatedStats');\n\nexport const previewElementSymbol = Symbol('previewElement');\n\nexport class EventDispatchTypeDescriptor {\n priority: number;\n color: string;\n eventTypes: string[];\n\n constructor(priority: number, color: string, eventTypes: string[]) {\n this.priority = priority;\n this.color = color;\n this.eventTypes = eventTypes;\n }\n}\n\nexport class TimelineDetailsContentHelper {\n fragment: DocumentFragment;\n private linkifierInternal: LegacyComponents.Linkifier.Linkifier|null;\n private target: SDK.Target.Target|null;\n element: HTMLDivElement;\n private tableElement: HTMLElement;\n\n constructor(target: SDK.Target.Target|null, linkifier: LegacyComponents.Linkifier.Linkifier|null) {\n this.fragment = document.createDocumentFragment();\n\n this.linkifierInternal = linkifier;\n this.target = target;\n\n this.element = document.createElement('div');\n this.element.classList.add('timeline-details-view-block');\n this.tableElement = this.element.createChild('div', 'vbox timeline-details-chip-body');\n this.fragment.appendChild(this.element);\n }\n\n addSection(title: string, swatchColor?: string): void {\n if (!this.tableElement.hasChildNodes()) {\n this.element.removeChildren();\n } else {\n this.element = document.createElement('div');\n this.element.classList.add('timeline-details-view-block');\n this.fragment.appendChild(this.element);\n }\n\n if (title) {\n const titleElement = this.element.createChild('div', 'timeline-details-chip-title');\n if (swatchColor) {\n titleElement.createChild('div').style.backgroundColor = swatchColor;\n }\n UI.UIUtils.createTextChild(titleElement, title);\n }\n\n this.tableElement = this.element.createChild('div', 'vbox timeline-details-chip-body');\n this.fragment.appendChild(this.element);\n }\n\n linkifier(): LegacyComponents.Linkifier.Linkifier|null {\n return this.linkifierInternal;\n }\n\n appendTextRow(title: string, value: string|number|boolean): void {\n const rowElement = this.tableElement.createChild('div', 'timeline-details-view-row');\n rowElement.createChild('div', 'timeline-details-view-row-title').textContent = title;\n rowElement.createChild('div', 'timeline-details-view-row-value').textContent = value.toString();\n }\n\n appendElementRow(title: string, content: string|Node, isWarning?: boolean, isStacked?: boolean): void {\n const rowElement = this.tableElement.createChild('div', 'timeline-details-view-row');\n rowElement.setAttribute('data-row-title', title);\n if (isWarning) {\n rowElement.classList.add('timeline-details-warning');\n }\n if (isStacked) {\n rowElement.classList.add('timeline-details-stack-values');\n }\n const titleElement = rowElement.createChild('div', 'timeline-details-view-row-title');\n titleElement.textContent = title;\n const valueElement = rowElement.createChild('div', 'timeline-details-view-row-value');\n if (content instanceof Node) {\n valueElement.appendChild(content);\n } else {\n UI.UIUtils.createTextChild(valueElement, content || '');\n }\n }\n\n appendLocationRow(title: string, url: string, startLine: number, startColumn?: number): void {\n if (!this.linkifierInternal) {\n return;\n }\n\n const options = {\n tabStop: true,\n columnNumber: startColumn,\n showColumnNumber: true,\n inlineFrameIndex: 0,\n };\n const link = this.linkifierInternal.maybeLinkifyScriptLocation(\n this.target, null, url as Platform.DevToolsPath.UrlString, startLine, options);\n if (!link) {\n return;\n }\n this.appendElementRow(title, link);\n }\n\n appendLocationRange(title: string, url: Platform.DevToolsPath.UrlString, startLine: number, endLine?: number): void {\n if (!this.linkifierInternal || !this.target) {\n return;\n }\n const locationContent = document.createElement('span');\n const link = this.linkifierInternal.maybeLinkifyScriptLocation(\n this.target, null, url, startLine, {tabStop: true, inlineFrameIndex: 0});\n if (!link) {\n return;\n }\n locationContent.appendChild(link);\n UI.UIUtils.createTextChild(\n locationContent, Platform.StringUtilities.sprintf(' [%s…%s]', startLine + 1, (endLine || 0) + 1 || ''));\n this.appendElementRow(title, locationContent);\n }\n\n createChildStackTraceElement(stackTrace: Protocol.Runtime.StackTrace): void {\n if (!this.linkifierInternal) {\n return;\n }\n\n const stackTraceElement =\n this.tableElement.createChild('div', 'timeline-details-view-row timeline-details-stack-values');\n const callFrameContents = LegacyComponents.JSPresentationUtils.buildStackTracePreviewContents(\n this.target, this.linkifierInternal, {stackTrace, tabStops: true});\n stackTraceElement.appendChild(callFrameContents.element);\n }\n}\n\nexport const categoryBreakdownCacheSymbol = Symbol('categoryBreakdownCache');\nexport interface TimelineMarkerStyle {\n title: string;\n color: string;\n lineWidth: number;\n dashStyle: number[];\n tall: boolean;\n lowPriority: boolean;\n}\n\n/**\n * Given a particular event, this method can adjust its timestamp by\n * substracting the timestamp of the previous navigation. This helps in cases\n * where the user has navigated multiple times in the trace, so that we can show\n * the LCP (for example) relative to the last navigation.\n **/\nexport function timeStampForEventAdjustedForClosestNavigationIfPossible(\n event: TraceEngine.Types.TraceEvents.TraceEventData,\n traceParsedData: TraceEngine.Handlers.Types.TraceParseData|null): TraceEngine.Types.Timing.MilliSeconds {\n if (!traceParsedData) {\n const {startTime} = TraceEngine.Legacy.timesForEventInMilliseconds(event);\n return startTime;\n }\n\n const time = TraceEngine.Helpers.Timing.timeStampForEventAdjustedByClosestNavigation(\n event,\n traceParsedData.Meta.traceBounds,\n traceParsedData.Meta.navigationsByNavigationId,\n traceParsedData.Meta.navigationsByFrameId,\n );\n return TraceEngine.Helpers.Timing.microSecondsToMilliseconds(time);\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/TimelineUIUtils.test.js b/public/panels/timeline/TimelineUIUtils.test.js index 36fd665e7..9c45eb063 100644 --- a/public/panels/timeline/TimelineUIUtils.test.js +++ b/public/panels/timeline/TimelineUIUtils.test.js @@ -389,7 +389,7 @@ describeWithMockConnection('TimelineUIUtils', function () { value: '1ms', }, { - title: 'Processing time', + title: 'Processing duration', value: '977ms', }, { diff --git a/public/panels/timeline/TimelineUIUtils.test.js.map b/public/panels/timeline/TimelineUIUtils.test.js.map index 6ad290b13..41a57468d 100644 --- a/public/panels/timeline/TimelineUIUtils.test.js.map +++ b/public/panels/timeline/TimelineUIUtils.test.js.map @@ -1 +1 @@ -{"version":3,"file":"TimelineUIUtils.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineUIUtils.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC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AK,CAAC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;YACrD,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,wBAAwB,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport type * as Platform from '../../core/platform/platform.js';\nimport {assertNotNullOrUndefined} from '../../core/platform/platform.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport type * as Protocol from '../../generated/protocol.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as TimelineModel from '../../models/timeline_model/timeline_model.js';\nimport * as TraceEngine from '../../models/trace/trace.js';\nimport * as Workspace from '../../models/workspace/workspace.js';\nimport * as Elements from '../../panels/elements/elements.js';\nimport {doubleRaf, renderElementIntoDOM} from '../../testing/DOMHelpers.js';\nimport {createTarget} from '../../testing/EnvironmentHelpers.js';\nimport {\n clearMockConnectionResponseHandler,\n describeWithMockConnection,\n setMockConnectionResponseHandler,\n} from '../../testing/MockConnection.js';\nimport {\n loadBasicSourceMapExample,\n setupPageResourceLoaderForSourceMap,\n} from '../../testing/SourceMapHelpers.js';\nimport {\n getMainThread,\n makeCompleteEvent,\n makeMockSamplesHandlerData,\n makeProfileCall,\n} from '../../testing/TraceHelpers.js';\nimport {TraceLoader} from '../../testing/TraceLoader.js';\nimport * as Components from '../../ui/legacy/components/utils/utils.js';\nimport * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js';\n\nimport * as Timeline from './timeline.js';\n\nconst {assert} = chai;\n\ndescribeWithMockConnection('TimelineUIUtils', function() {\n let tracingModel: TraceEngine.Legacy.TracingModel;\n let process: TraceEngine.Legacy.Process;\n let thread: TraceEngine.Legacy.Thread;\n let target: SDK.Target.Target;\n // Trace events contain script ids as strings. However, the linkifier\n // utilities assume it is a number because that's how it's defined at\n // the protocol level. For practicality, we declare these two\n // variables so that we can satisfy type checking throughout the tests.\n const SCRIPT_ID_NUMBER = 1;\n const SCRIPT_ID_STRING = String(SCRIPT_ID_NUMBER) as Protocol.Runtime.ScriptId;\n\n beforeEach(() => {\n target = createTarget();\n tracingModel = new TraceEngine.Legacy.TracingModel();\n process = new TraceEngine.Legacy.Process(tracingModel, 1);\n thread = new TraceEngine.Legacy.Thread(process, 1);\n\n const workspace = Workspace.Workspace.WorkspaceImpl.instance();\n const targetManager = SDK.TargetManager.TargetManager.instance();\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance({\n forceNew: true,\n resourceMapping,\n targetManager,\n });\n Bindings.IgnoreListManager.IgnoreListManager.instance({forceNew: true, debuggerWorkspaceBinding});\n });\n\n afterEach(() => {\n clearMockConnectionResponseHandler('DOM.pushNodesByBackendIdsToFrontend');\n });\n\n it('creates top frame location text for function calls', async function() {\n const event = new TraceEngine.Legacy.ConstructedEvent(\n 'devtools.timeline', 'FunctionCall', TraceEngine.Types.TraceEvents.Phase.COMPLETE, 10, thread);\n\n event.addArgs({\n data: {\n functionName: 'test',\n url: 'test.js',\n scriptId: SCRIPT_ID_STRING,\n lineNumber: 0,\n columnNumber: 0,\n },\n });\n assert.strictEqual(\n 'test.js:1:1', await Timeline.TimelineUIUtils.TimelineUIUtils.buildDetailsTextForTraceEvent(event));\n });\n\n it('creates top frame location text as a fallback', async function() {\n // 'TimerInstall' is chosen such that we run into the 'default' case.\n const event = new TraceEngine.Legacy.ConstructedEvent(\n 'devtools.timeline', 'TimerInstall', TraceEngine.Types.TraceEvents.Phase.COMPLETE, 10, thread);\n\n event.addArgs({\n data: {\n stackTrace: [\n {\n functionName: 'test',\n url: 'test.js',\n scriptId: SCRIPT_ID_STRING,\n lineNumber: 0,\n columnNumber: 0,\n },\n ],\n },\n });\n const data = TimelineModel.TimelineModel.EventOnTimelineData.forEvent(event);\n data.stackTrace = event.args.data.stackTrace;\n assert.strictEqual(\n 'test.js:1:1', await Timeline.TimelineUIUtils.TimelineUIUtils.buildDetailsTextForTraceEvent(event));\n });\n\n describe('script location as an URL', function() {\n let event: TraceEngine.Legacy.ConstructedEvent;\n beforeEach(() => {\n event = new TraceEngine.Legacy.ConstructedEvent(\n 'devtools.timeline', TimelineModel.TimelineModel.RecordType.FunctionCall,\n TraceEngine.Types.TraceEvents.Phase.COMPLETE, 10, thread);\n\n event.addArgs({\n data: {\n functionName: 'test',\n url: 'https://google.com/test.js',\n scriptId: SCRIPT_ID_STRING,\n lineNumber: 0,\n columnNumber: 0,\n },\n });\n });\n it('makes the script location of a call frame a full URL when the inspected target is not the same the call frame was taken from (e.g. a loaded file)',\n async function() {\n target.setInspectedURL('https://not-google.com' as Platform.DevToolsPath.UrlString);\n const node = await Timeline.TimelineUIUtils.TimelineUIUtils.buildDetailsNodeForTraceEvent(\n event, target, new Components.Linkifier.Linkifier());\n if (!node) {\n throw new Error('Node was unexpectedly null');\n }\n assert.strictEqual(node.textContent, 'test @ google.com/test.js:1:1');\n });\n\n it('makes the script location of a call frame a script name when the inspected target is the one the call frame was taken from',\n async function() {\n target.setInspectedURL('https://google.com' as Platform.DevToolsPath.UrlString);\n const node = await Timeline.TimelineUIUtils.TimelineUIUtils.buildDetailsNodeForTraceEvent(\n event, target, new Components.Linkifier.Linkifier());\n if (!node) {\n throw new Error('Node was unexpectedly null');\n }\n assert.strictEqual(node.textContent, 'test @ /test.js:1:1');\n });\n });\n\n describe('mapping to authored script when recording is fresh', function() {\n beforeEach(async () => {\n // Register mock script and source map.\n\n const sourceMapContent = JSON.stringify({\n 'version': 3,\n 'names': ['unminified', 'par1', 'par2', 'console', 'log'],\n 'sources': [\n '/original-script.ts',\n ],\n 'file': '/test.js',\n 'sourcesContent': ['function unminified(par1, par2) {\\n console.log(par1, par2);\\n}\\n'],\n 'mappings': 'AAAA,SAASA,EAAWC,EAAMC,GACxBC,QAAQC,IAAIH,EAAMC',\n });\n setupPageResourceLoaderForSourceMap(sourceMapContent);\n target.setInspectedURL('https://google.com' as Platform.DevToolsPath.UrlString);\n const scriptUrl = 'https://google.com/script.js' as Platform.DevToolsPath.UrlString;\n const sourceMapUrl = 'script.js.map' as Platform.DevToolsPath.UrlString;\n const debuggerModel = target.model(SDK.DebuggerModel.DebuggerModel);\n assert.isNotNull(debuggerModel);\n if (debuggerModel === null) {\n return;\n }\n const sourceMapManager = debuggerModel.sourceMapManager();\n const script = debuggerModel.parsedScriptSource(\n SCRIPT_ID_STRING, scriptUrl, 0, 0, 0, 0, 0, '', undefined, false, sourceMapUrl, true, false, length, false,\n null, null, null, null, null);\n await sourceMapManager.sourceMapForClientPromise(script);\n });\n it('maps to the authored script when a call frame is provided', async function() {\n const linkifier = new Components.Linkifier.Linkifier();\n const node = Timeline.TimelineUIUtils.TimelineUIUtils.linkifyLocation({\n scriptId: SCRIPT_ID_STRING,\n url: 'https://google.com/test.js',\n lineNumber: 0,\n columnNumber: 0,\n isFreshRecording: true,\n target,\n linkifier,\n });\n if (!node) {\n throw new Error('Node was unexpectedly null');\n }\n // Wait for the location to be resolved using the registered source map.\n await Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance().pendingLiveLocationChangesPromise();\n\n assert.strictEqual(node.textContent, 'original-script.ts:1:1');\n });\n\n it('maps to the authored script when a trace event from the new engine with a stack trace is provided',\n async function() {\n const functionCallEvent = makeCompleteEvent('FunctionCall', 10, 100);\n functionCallEvent.args = ({\n data: {\n stackTrace: [{\n functionName: 'test',\n url: 'https://google.com/test.js',\n scriptId: SCRIPT_ID_NUMBER,\n lineNumber: 0,\n columnNumber: 0,\n }],\n },\n });\n const linkifier = new Components.Linkifier.Linkifier();\n const node =\n Timeline.TimelineUIUtils.TimelineUIUtils.linkifyTopCallFrame(functionCallEvent, target, linkifier, true);\n if (!node) {\n throw new Error('Node was unexpectedly null');\n }\n // Wait for the location to be resolved using the registered source map.\n await Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance()\n .pendingLiveLocationChangesPromise();\n\n assert.strictEqual(node.textContent, 'original-script.ts:1:1');\n });\n });\n\n describe('mapping to authored function name when recording is fresh', function() {\n it('maps to the authored name and script of a profile call', async function() {\n const {script} = await loadBasicSourceMapExample(target);\n // Ideally we would get a column number we can use from the source\n // map however the current status of the source map helpers makes\n // it difficult to do so.\n const columnNumber = 51;\n const profileCall = makeProfileCall(\n 'function', 10, 100, TraceEngine.Types.TraceEvents.ProcessID(1), TraceEngine.Types.TraceEvents.ThreadID(1));\n\n profileCall.callFrame = {\n 'columnNumber': columnNumber,\n 'functionName': 'minified',\n 'lineNumber': 0,\n 'scriptId': script.scriptId,\n 'url': 'file://gen.js',\n };\n const workersData: TraceEngine.Handlers.ModelHandlers.Workers.WorkersData = {\n workerSessionIdEvents: [],\n workerIdByThread: new Map(),\n workerURLById: new Map(),\n };\n // This only includes data used in the SourceMapsResolver\n const traceParsedData = {\n Samples: makeMockSamplesHandlerData([profileCall]),\n Workers: workersData,\n } as TraceEngine.Handlers.Types.TraceParseData;\n\n const resolver = new Timeline.SourceMapsResolver.SourceMapsResolver(traceParsedData);\n await resolver.install();\n\n const linkifier = new Components.Linkifier.Linkifier();\n const node = await Timeline.TimelineUIUtils.TimelineUIUtils.buildDetailsNodeForTraceEvent(\n profileCall, target, linkifier, true);\n if (!node) {\n throw new Error('Node was unexpectedly null');\n }\n assert.isTrue(node.textContent?.startsWith('someFunction @'));\n });\n });\n describe('adjusting timestamps for events and navigations', function() {\n it('adjusts the time for a DCL event after a navigation', async function() {\n const traceParsedData = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n\n const mainFrameID = traceParsedData.Meta.mainFrameId;\n\n const dclEvent = traceParsedData.PageLoadMetrics.allMarkerEvents.find(event => {\n return TraceEngine.Types.TraceEvents.isTraceEventMarkDOMContent(event) &&\n event.args.data?.frame === mainFrameID;\n });\n if (!dclEvent) {\n throw new Error('Could not find DCL event');\n }\n\n const traceMinBound = traceParsedData.Meta.traceBounds.min;\n\n // Round the time to 2DP to avoid needlessly long expectation numbers!\n const unadjustedStartTimeMilliseconds =\n TraceEngine.Helpers.Timing\n .microSecondsToMilliseconds(\n TraceEngine.Types.Timing.MicroSeconds(dclEvent.ts - traceMinBound),\n )\n .toFixed(2);\n assert.strictEqual(unadjustedStartTimeMilliseconds, String(190.79));\n\n const adjustedTime =\n Timeline.TimelineUIUtils.timeStampForEventAdjustedForClosestNavigationIfPossible(dclEvent, traceParsedData);\n assert.strictEqual(adjustedTime.toFixed(2), String(178.92));\n });\n\n it('can adjust the times for events that are not PageLoad markers', async function() {\n const traceParsedData = await TraceLoader.traceEngine(this, 'user-timings.json.gz');\n // Use a performance.mark event. Exact event is unimportant except that\n // it should not be a Page Load event as those are covered by the tests\n // above.\n const userMark = traceParsedData.UserTimings.performanceMarks.find(event => event.name === 'mark1');\n if (!userMark) {\n throw new Error('Could not find user mark');\n }\n\n const adjustedMarkTime =\n Timeline.TimelineUIUtils.timeStampForEventAdjustedForClosestNavigationIfPossible(userMark, traceParsedData);\n assert.strictEqual(adjustedMarkTime.toFixed(2), String(79.88));\n });\n });\n\n function getRowDataForDetailsElement(details: DocumentFragment) {\n return Array.from(details.querySelectorAll('.timeline-details-view-row')).map(row => {\n const title = row.querySelector('.timeline-details-view-row-title')?.innerText;\n const value = row.querySelector('.timeline-details-view-row-value')?.innerText;\n return {title, value};\n });\n }\n\n function getPieChartDataForDetailsElement(details: DocumentFragment) {\n const pieChartComp = details.querySelector('devtools-perf-piechart');\n if (!pieChartComp?.shadowRoot) {\n return [];\n }\n return Array.from(pieChartComp.shadowRoot.querySelectorAll('.pie-chart-legend-row')).map(row => {\n const title = row.querySelector('.pie-chart-name')?.innerText;\n const value = row.querySelector('.pie-chart-size')?.innerText;\n return {title, value};\n });\n }\n\n describe('colors', function() {\n before(() => {\n // Rather than use the real colours here and burden the test with having to\n // inject loads of CSS, we fake out the colours. this is fine for our tests as\n // the exact value of the colours is not important; we just make sure that it\n // parses them out correctly. Each variable is given a different rgb() value to\n // ensure we know the code is working and using the right one.\n const styleElement = document.createElement('style');\n styleElement.id = 'fake-perf-panel-colors';\n styleElement.textContent = `\n:root {\n --app-color-loading: rgb(0 0 0);\n --app-color-loading-children: rgb(1 1 1);\n --app-color-scripting: rgb(2 2 2);\n --app-color-scripting-children: rgb(3 3 3);\n --app-color-rendering: rgb(4 4 4);\n --app-color-rendering-children: rgb(5 5 5);\n --app-color-painting: rgb(6 6 6);\n --app-color-painting-children: rgb(7 7 7);\n --app-color-task: rgb(8 8 8);\n --app-color-task-children: rgb(9 9 9);\n --app-color-system: rgb(10 10 10);\n --app-color-system-children: rgb(11 11 11);\n --app-color-idle: rgb(12 12 12);\n --app-color-idle-children: rgb(13 13 13);\n --app-color-async: rgb(14 14 14);\n --app-color-async-children: rgb(15 15 15);\n --app-color-other: rgb(16 16 16);\n}\n`;\n document.documentElement.appendChild(styleElement);\n ThemeSupport.ThemeSupport.clearThemeCache();\n });\n\n after(() => {\n const styleElementToRemove = document.documentElement.querySelector('#fake-perf-panel-colors');\n if (styleElementToRemove) {\n document.documentElement.removeChild(styleElementToRemove);\n }\n ThemeSupport.ThemeSupport.clearThemeCache();\n });\n\n it('should return the correct rgb value for a corresponding CSS variable', function() {\n const parsedColor = Timeline.EventUICategory.getCategoryStyles().scripting.getComputedColorValue();\n assert.strictEqual('rgb(2 2 2)', parsedColor);\n });\n\n it('should return the color as a CSS variable', function() {\n const cssVariable = Timeline.EventUICategory.getCategoryStyles().scripting.getCSSValue();\n assert.strictEqual('var(--app-color-scripting)', cssVariable);\n });\n\n it('treats the v8.parseOnBackgroundWaiting as scripting even though it would usually be idle', function() {\n const event = new TraceEngine.Legacy.ConstructedEvent(\n 'v8,devtools.timeline,disabled-by-default-v8.compile',\n TimelineModel.TimelineModel.RecordType.StreamingCompileScriptWaiting,\n TraceEngine.Types.TraceEvents.Phase.COMPLETE, 10, thread);\n\n assert.strictEqual('rgb(2 2 2)', Timeline.TimelineUIUtils.TimelineUIUtils.eventColor(event));\n });\n\n it('assigns the correct color to the swatch of an event\\'s title', async function() {\n const data = await TraceLoader.allModels(this, 'lcp-web-font.json.gz');\n const events = data.traceParsedData.Renderer.allTraceEntries;\n const task = events.find(event => {\n return event.name.includes('RunTask');\n });\n if (!task) {\n throw new Error('Could not find expected event.');\n }\n\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildTraceEventDetails(\n task,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n false,\n );\n const titleSwatch: HTMLElement|null = details.querySelector('.timeline-details-chip-title div');\n assert.strictEqual(titleSwatch?.style.backgroundColor, 'rgb(10, 10, 10)');\n });\n it('assigns the correct color to the swatch of a network request title', async function() {\n const data = await TraceLoader.allModels(this, 'lcp-web-font.json.gz');\n const networkRequests = data.traceParsedData.NetworkRequests.byTime;\n const cssRequest = networkRequests.find(request => {\n return request.args.data.url === 'https://chromedevtools.github.io/performance-stories/lcp-web-font/app.css';\n });\n if (!cssRequest) {\n throw new Error('Could not find expected network request.');\n }\n\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildSyntheticNetworkRequestDetails(\n cssRequest,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n );\n const titleSwatch: HTMLElement|null = details.querySelector('.timeline-details-chip-title div');\n assert.strictEqual(titleSwatch?.style.backgroundColor, 'rgb(4, 4, 4)');\n });\n });\n\n describe('testContentMatching', () => {\n it('matches call frame events based on a regular expression and the contents of the event', async function() {\n const data = await TraceLoader.allModels(this, 'react-hello-world.json.gz');\n // Find an event from the trace that represents some work that React did. This\n // event is not chosen for any particular reason other than it was the example\n // used in the bug report: crbug.com/1484504\n const mainThread = getMainThread(data.traceParsedData.Renderer);\n const performConcurrentWorkEvent = mainThread.entries.find(entry => {\n if (TraceEngine.Types.TraceEvents.isProfileCall(entry)) {\n return entry.callFrame.functionName === 'performConcurrentWorkOnRoot';\n }\n return false;\n });\n if (!performConcurrentWorkEvent) {\n throw new Error('Could not find expected event');\n }\n assert.isTrue(Timeline.TimelineUIUtils.TimelineUIUtils.testContentMatching(\n performConcurrentWorkEvent, /perfo/, data.traceParsedData));\n });\n });\n\n describe('traceEventDetails', function() {\n it('shows the interaction ID and INP breakdown metrics for a given interaction', async function() {\n const data = await TraceLoader.allModels(this, 'one-second-interaction.json.gz');\n const interactionEvent = data.traceParsedData.UserInteractions.interactionEventsWithNoNesting.find(entry => {\n return entry.dur === 979974 && entry.type === 'click';\n });\n if (!interactionEvent) {\n throw new Error('Could not find expected event');\n }\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildTraceEventDetails(\n interactionEvent,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n false,\n data.traceParsedData,\n );\n const rowData = getRowDataForDetailsElement(details);\n assert.deepEqual(rowData, [\n {\n title: 'Warning',\n value: 'Long interaction is indicating poor page responsiveness.',\n },\n {\n title: 'ID',\n value: '4122',\n },\n {\n title: 'Input delay',\n value: '1ms',\n },\n {\n title: 'Processing time',\n value: '977ms',\n },\n {\n title: 'Presentation delay',\n value: '1.974ms',\n },\n ]);\n });\n\n it('renders all event data for a generic trace', async function() {\n const data = await TraceLoader.allModels(this, 'generic-about-tracing.json.gz');\n const event = data.traceParsedData.Renderer.allTraceEntries.find(entry => {\n return entry.name === 'ThreadControllerImpl::RunTask';\n });\n if (!event) {\n throw new Error('Could not find event.');\n }\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildTraceEventDetails(\n event,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n false,\n data.traceParsedData,\n );\n const rowData = getRowDataForDetailsElement(details);\n assert.deepEqual(rowData, [\n {\n title: 'chrome_task_annotator',\n value: '{\"delay_policy\":\"PRECISE\",\"task_delay_us\":7159}',\n },\n {\n title: 'src_file',\n value: '\"cc/scheduler/scheduler.cc\"',\n },\n {\n title: 'src_func',\n value: '\"ScheduleBeginImplFrameDeadline\"',\n },\n ]);\n });\n\n it('renders invalidations correctly', async function() {\n const data = await TraceLoader.allModels(this, 'style-invalidation-change-attribute.json.gz');\n\n // Set up a fake DOM so that we can request nodes by backend Ids (even\n // though we return none, we need to mock these calls else the frontend\n // will not work.)\n const documentNode = {nodeId: 1 as Protocol.DOM.BackendNodeId};\n setMockConnectionResponseHandler('DOM.getDocument', () => ({root: documentNode}));\n setMockConnectionResponseHandler('DOM.pushNodesByBackendIdsToFrontend', () => {\n return {\n nodeIds: [],\n };\n });\n\n const updateLayoutTreeEvent = data.traceParsedData.Renderer.allTraceEntries.find(event => {\n return TraceEngine.Types.TraceEvents.isTraceEventUpdateLayoutTree(event) &&\n event.args.beginData?.stackTrace?.[0].functionName === 'testFuncs.changeAttributeAndDisplay';\n });\n if (!updateLayoutTreeEvent) {\n throw new Error('Could not find update layout tree event');\n }\n\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildTraceEventDetails(\n updateLayoutTreeEvent,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n false,\n data.traceParsedData,\n );\n const rowData = getRowDataForDetailsElement(details);\n assert.deepEqual(rowData, [\n {\n title: 'Elements Affected',\n value: '3',\n },\n {\n // The \"Recalculation forced\" Stack trace output would be here but the detailRow helper is\n // unable to parse it, hence why this returns undefined.\n title: undefined,\n value: undefined,\n },\n {\n title: 'Initiated by',\n value: 'Schedule Style Recalculation',\n },\n {\n title: 'Pending for',\n value: '7.1 ms',\n },\n {\n title: 'PseudoClass:active',\n value: 'BUTTON id=\\'changeAttributeAndDisplay\\'',\n },\n {\n title: 'Attribute (dir)',\n value:\n 'DIV id=\\'testElementFour\\' at chromedevtools.github.io/performance-stories/style-invalidations/app.js:46',\n },\n {\n title: 'Attribute (dir)',\n value:\n 'DIV id=\\'testElementFive\\' at chromedevtools.github.io/performance-stories/style-invalidations/app.js:47',\n },\n {\n title: 'Element has pending invalidation list',\n value: 'DIV id=\\'testElementFour\\'',\n },\n {\n title: 'Element has pending invalidation list',\n value: 'DIV id=\\'testElementFive\\'',\n },\n ]);\n });\n\n it('renders details for a v8.compile (\"Compile Script\") event', async function() {\n const data = await TraceLoader.allModels(this, 'user-timings.json.gz');\n const compileEvent =\n data.traceParsedData.Renderer.allTraceEntries.find(TraceEngine.Types.TraceEvents.isTraceEventV8Compile);\n if (!compileEvent) {\n throw new Error('Could not find expected event');\n }\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildTraceEventDetails(\n compileEvent,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n false,\n data.traceParsedData,\n );\n const rowData = getRowDataForDetailsElement(details);\n assert.deepEqual(rowData, [\n {\n title: 'Script',\n // URL plus line/col number\n value: 'chrome-extension://blijaeebfebmkmekmdnehcmmcjnblkeo/lib/utils.js:1:1',\n },\n {\n title: 'Streamed',\n value: 'false: inline script',\n },\n {title: 'Compilation cache status', value: 'script not eligible'},\n ]);\n });\n\n it('renders the details for a layout shift properly', async function() {\n // Set related CDP methods responses to return our mock document and node.\n const domModel = target.model(SDK.DOMModel.DOMModel);\n assertNotNullOrUndefined(domModel);\n const documentNode = {nodeId: 1 as Protocol.DOM.NodeId};\n const docc = new SDK.DOMModel.DOMNode(domModel) as SDK.DOMModel.DOMDocument;\n const domNode2 = new SDK.DOMModel.DOMNode(domModel);\n const domID = 58 as Protocol.DOM.NodeId;\n domNode2.id = domID;\n\n setMockConnectionResponseHandler('DOM.pushNodesByBackendIdsToFrontend', () => ({nodeIds: [domID]}));\n\n setMockConnectionResponseHandler('DOM.getDocument', () => ({root: documentNode}));\n await domModel.requestDocument();\n domModel.registerNode(domNode2);\n domNode2.init(docc, false, {nodeName: 'A test node name', nodeId: domID} as Protocol.DOM.Node);\n const data = await TraceLoader.allModels(this, 'cls-single-frame.json.gz');\n const layoutShift = data.traceParsedData.LayoutShifts.clusters[0].events[0];\n Common.Linkifier.registerLinkifier({\n contextTypes() {\n return [Timeline.CLSLinkifier.CLSRect];\n },\n async loadLinkifier() {\n return Timeline.CLSLinkifier.Linkifier.instance();\n },\n });\n Common.Linkifier.registerLinkifier({\n contextTypes() {\n return [\n SDK.DOMModel.DOMNode,\n ];\n },\n async loadLinkifier() {\n return Elements.DOMLinkifier.Linkifier.instance();\n },\n });\n\n if (!layoutShift) {\n throw new Error('Could not find LayoutShift event.');\n }\n\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildTraceEventDetails(\n layoutShift,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n false,\n data.traceParsedData,\n );\n const rowData = getRowDataForDetailsElement(details);\n assert.deepEqual(\n rowData,\n [\n {\n title: 'Warning',\n value: 'Cumulative Layout Shifts can result in poor user experiences. It has recently evolved.',\n },\n {title: 'Score', value: '0.04218'},\n {title: 'Cumulative Score', value: '0.04218'},\n {title: 'Current Cluster ID', value: '1'},\n {title: 'Current Cluster Score', value: '0.2952'},\n {title: 'Had recent input', value: 'No'},\n {title: 'Moved from', value: 'Location: [120,670], Size: [900x900]'},\n {title: 'Moved to', value: 'Location: [120,1270], Size: [900x478]'},\n // The related node link value is under shadow root so it\n // can't be accessed at this point.\n {title: 'Related Node', value: ''},\n ],\n );\n // Test the related node link.\n const relatedNodeRow =\n details.querySelector('.timeline-details-view-row:nth-of-type(9) .timeline-details-view-row-value span')\n ?.shadowRoot;\n relatedNodeRow?.querySelector('button')?.innerText;\n assert.strictEqual(relatedNodeRow?.querySelector('button')?.innerText, 'A test node name');\n });\n\n it('renders the details for a profile call properly', async function() {\n Common.Linkifier.registerLinkifier({\n contextTypes() {\n return [Timeline.CLSLinkifier.CLSRect];\n },\n async loadLinkifier() {\n return Timeline.CLSLinkifier.Linkifier.instance();\n },\n });\n\n const data = await TraceLoader.allModels(this, 'simple-js-program.json.gz');\n const rendererHandler = data.traceParsedData.Renderer;\n if (!rendererHandler) {\n throw new Error('RendererHandler is undefined');\n }\n const [process] = rendererHandler.processes.values();\n const [thread] = process.threads.values();\n const profileCalls = thread.entries.filter(entry => TraceEngine.Types.TraceEvents.isProfileCall(entry));\n\n if (!profileCalls) {\n throw new Error('Could not find renderer events');\n }\n\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildTraceEventDetails(\n profileCalls[0],\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n false,\n data.traceParsedData,\n );\n const rowData = getRowDataForDetailsElement(details);\n assert.deepEqual(\n rowData,\n [\n {\n title: 'Function',\n value: '(anonymous) @ www.google.com:21:17',\n },\n ],\n );\n });\n\n it('renders the warning for a trace event in its details', async function() {\n const data = await TraceLoader.allModels(this, 'simple-js-program.json.gz');\n\n const events = data.traceParsedData.Renderer?.allTraceEntries;\n if (!events) {\n throw new Error('Could not find renderer events');\n }\n\n const longTask = events.find(e => (e.dur || 0) > 1_000_000);\n if (!longTask) {\n throw new Error('Could not find Long Task event.');\n }\n\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildTraceEventDetails(\n longTask,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n false,\n data.traceParsedData,\n );\n const rowData = getRowDataForDetailsElement(details);\n assert.deepEqual(\n rowData,\n [\n {\n title: 'Warning',\n value: 'Long task took 1.30\\u00A0s.',\n },\n ],\n );\n });\n\n it('shows information for the WebSocketCreate initiator when viewing a WebSocketSendHandshakeRequest event',\n async function() {\n const data = await TraceLoader.allModels(this, 'web-sockets.json.gz');\n const events = data.traceParsedData.Renderer?.allTraceEntries;\n if (!events) {\n throw new Error('Could not find renderer events');\n }\n\n const sendHandshake = events.find(TraceEngine.Types.TraceEvents.isTraceEventWebSocketSendHandshakeRequest);\n if (!sendHandshake) {\n throw new Error('Could not find handshake event.');\n }\n\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildTraceEventDetails(\n sendHandshake,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n false,\n data.traceParsedData,\n );\n const rowData = getRowDataForDetailsElement(details);\n const expectedRowData = [\n {title: 'URL', value: 'wss://socketsbay.com/wss/v2/1/demo/'},\n {\n // The 'First Invalidated' Stack trace output would be here but the detailRow helper is\n // unable to parse it, hence why this returns undefined.\n title: undefined,\n value: undefined,\n },\n {title: 'Initiated by', 'value': 'Create WebSocket'},\n {title: 'Pending for', value: '72.0 ms'},\n ];\n assert.deepEqual(\n rowData,\n expectedRowData,\n );\n });\n\n it('shows information for the events initiated by WebSocketCreate when viewing a WebSocketCreate event',\n async function() {\n const data = await TraceLoader.allModels(this, 'web-sockets.json.gz');\n const events = data.traceParsedData.Renderer?.allTraceEntries;\n if (!events) {\n throw new Error('Could not find renderer events');\n }\n\n const sendHandshake = events.find(TraceEngine.Types.TraceEvents.isTraceEventWebSocketCreate);\n if (!sendHandshake) {\n throw new Error('Could not find handshake event.');\n }\n\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildTraceEventDetails(\n sendHandshake,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n false,\n data.traceParsedData,\n );\n const rowData = getRowDataForDetailsElement(details);\n const expectedRowData = [\n {title: 'URL', value: 'wss://socketsbay.com/wss/v2/1/demo/'},\n // This value looks odd, but it is because the initiator stack trace cannot be\n // easily represented as a string, so this is OK.\n {title: undefined, value: undefined},\n // The 2 entries under \"Initiator for\" are displayed as seperate links and in the UI it is obvious they are seperate\n {title: 'Initiator for', 'value': 'Send WebSocket Handshake Receive WebSocket Handshake'},\n ];\n assert.deepEqual(\n rowData,\n expectedRowData,\n );\n });\n\n it('shows the aggregated time information for an event', async function() {\n const data = await TraceLoader.allModels(this, 'web-dev.json.gz');\n const event =\n data.traceParsedData.Renderer?.allTraceEntries.find(e => e.ts === 1020034919877 && e.name === 'RunTask');\n if (!event) {\n throw new Error('Could not find renderer events');\n }\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildTraceEventDetails(\n event,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n true,\n data.traceParsedData,\n );\n const pieChartData = getPieChartDataForDetailsElement(details);\n\n const expectedPieChartData = [\n {title: 'System (self)', value: '2\\u00A0ms'},\n {title: 'System (children)', value: '2\\u00A0ms'},\n {title: 'Rendering', value: '28\\u00A0ms'},\n {title: 'Painting', value: '2\\u00A0ms'},\n {title: 'Total', value: '34\\u00A0ms'},\n ];\n assert.deepEqual(\n pieChartData,\n expectedPieChartData,\n );\n });\n });\n\n it('can generate details for a frame', async function() {\n const traceParsedData = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');\n const frame = traceParsedData.Frames.frames.at(0);\n if (!frame) {\n throw new Error('Could not find expected frame');\n }\n const filmStrip = TraceEngine.Extras.FilmStrip.fromTraceData(traceParsedData);\n const details =\n Timeline.TimelineUIUtils.TimelineUIUtils.generateDetailsContentForFrame(frame, filmStrip, filmStrip.frames[0]);\n const container = document.createElement('div');\n renderElementIntoDOM(container);\n container.appendChild(details);\n // Give the image element time to render and load.\n await doubleRaf();\n const img = container.querySelector('.timeline-filmstrip-preview img');\n assert.isTrue(img?.currentSrc.includes(filmStrip.frames[0].screenshotEvent.args.dataUri));\n\n const durationRow = container.querySelector('[data-row-title=\"Duration\"]');\n const durationValue = durationRow?.querySelector('.timeline-details-view-row-value span');\n if (!durationValue) {\n throw new Error('Could not find duration');\n }\n // Strip the unicode spaces out and replace with simple spaces for easy\n // assertions.\n const value = (durationValue.innerText.replaceAll(/\\s/g, ' '));\n assert.strictEqual(value, '37.85 ms (at 109.82 ms)');\n });\n\n describe('buildNetworkRequestDetails', function() {\n it('renders the right details for a network event from TraceEngine', async function() {\n const data = await TraceLoader.allModels(this, 'lcp-web-font.json.gz');\n const networkRequests = data.traceParsedData.NetworkRequests.byTime;\n const cssRequest = networkRequests.find(request => {\n return request.args.data.url === 'https://chromedevtools.github.io/performance-stories/lcp-web-font/app.css';\n });\n if (!cssRequest) {\n throw new Error('Could not find expected network request.');\n }\n\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildSyntheticNetworkRequestDetails(\n cssRequest,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n );\n\n const rowData = getRowDataForDetailsElement(details);\n\n assert.deepEqual(\n rowData,\n [\n {title: 'URL', value: 'chromedevtools.github.io/performance-stories/lcp-web-font/app.css'},\n {title: 'Duration', value: '12.582ms (8.291ms load from cache + 4.291ms resource loading)'},\n {title: 'Request Method', value: 'GET'},\n {title: 'Initial Priority', value: 'Highest'},\n {title: 'Priority', value: 'Highest'},\n {title: 'Mime Type', value: 'text/css'},\n {title: 'Encoded Data', value: ' (from cache)'},\n {title: 'Decoded Body', value: '96 B'},\n ],\n );\n });\n });\n\n describe('eventTitle', function() {\n it('renders the correct title for an EventTiming interaction event', async function() {\n const data = await TraceLoader.allModels(this, 'slow-interaction-button-click.json.gz');\n const interactionEvent = data.traceParsedData.UserInteractions.interactionEventsWithNoNesting[0];\n const details = Timeline.TimelineUIUtils.TimelineUIUtils.eventTitle(interactionEvent);\n assert.deepEqual(details, 'Pointer');\n });\n\n it('will use the resolved function name for a profile node that has a sourcemap', async function() {\n // Timeline.SourceMapsResolver.SourceMapsResolver.\n const traceParsedData = await TraceLoader.traceEngine(this, 'slow-interaction-button-click.json.gz');\n\n const mainThread = getMainThread(traceParsedData.Renderer);\n const profileEntry = mainThread.entries.find(entry => {\n return TraceEngine.Types.TraceEvents.isProfileCall(entry);\n });\n if (!profileEntry || !TraceEngine.Types.TraceEvents.isProfileCall(profileEntry)) {\n throw new Error('Could not find a profile entry');\n }\n\n // Fake that we resolved the entry's name from a sourcemap.\n Timeline.SourceMapsResolver.SourceMapsResolver.storeResolvedNodeNameForEntry(\n profileEntry.pid, profileEntry.tid, profileEntry.nodeId, 'resolved-function-test');\n\n const title = Timeline.TimelineUIUtils.TimelineUIUtils.eventTitle(profileEntry);\n assert.strictEqual(title, 'resolved-function-test');\n });\n });\n\n describe('eventStyle', function() {\n it('returns the correct style for profile calls', async function() {\n const data = await TraceLoader.allModels(this, 'simple-js-program.json.gz');\n const rendererHandler = data.traceParsedData.Renderer;\n if (!rendererHandler) {\n throw new Error('RendererHandler is undefined');\n }\n const [process] = rendererHandler.processes.values();\n const [thread] = process.threads.values();\n const profileCalls = thread.entries.filter(entry => TraceEngine.Types.TraceEvents.isProfileCall(entry));\n const style = Timeline.TimelineUIUtils.TimelineUIUtils.eventStyle(profileCalls[0]);\n assert.strictEqual(style.category.name, 'scripting');\n assert.strictEqual(style.category.color, 'rgb(250 204 21 / 100%)');\n });\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"TimelineUIUtils.test.js","sourceRoot":"","sources":["../../../../../../front_end/panels/timeline/TimelineUIUtils.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,MAAM,MAAM,6BAA6B,CAAC;AAEtD,OAAO,EAAC,wBAAwB,EAAC,MAAM,iCAAiC,CAAC;AACzE,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAE7C,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,aAAa,MAAM,+CAA+C,CAAC;AAC/E,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,SAAS,MAAM,qCAAqC,CAAC;AACjE,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAC,SAAS,EAAE,oBAAoB,EAAC,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAC,YAAY,EAAC,MAAM,qCAAqC,CAAC;AACjE,OAAO,EACL,kCAAkC,EAClC,0BAA0B,EAC1B,gCAAgC,GACjC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,yBAAyB,EACzB,mCAAmC,GACpC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,0BAA0B,EAC1B,eAAe,GAChB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AACzD,OAAO,KAAK,UAAU,MAAM,2CAA2C,CAAC;AACxE,OAAO,KAAK,YAAY,MAAM,gDAAgD,CAAC;AAE/E,OAAO,KAA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EAAE,CAAC;YACrD,MAAM,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YAC1C,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;YACxG,MAAM,KAAK,GAAG,QAAQ,CAAC,eAAe,CAAC,eAAe,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;YACnF,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;YACrD,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,wBAAwB,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as Common from '../../core/common/common.js';\nimport type * as Platform from '../../core/platform/platform.js';\nimport {assertNotNullOrUndefined} from '../../core/platform/platform.js';\nimport * as SDK from '../../core/sdk/sdk.js';\nimport type * as Protocol from '../../generated/protocol.js';\nimport * as Bindings from '../../models/bindings/bindings.js';\nimport * as TimelineModel from '../../models/timeline_model/timeline_model.js';\nimport * as TraceEngine from '../../models/trace/trace.js';\nimport * as Workspace from '../../models/workspace/workspace.js';\nimport * as Elements from '../../panels/elements/elements.js';\nimport {doubleRaf, renderElementIntoDOM} from '../../testing/DOMHelpers.js';\nimport {createTarget} from '../../testing/EnvironmentHelpers.js';\nimport {\n clearMockConnectionResponseHandler,\n describeWithMockConnection,\n setMockConnectionResponseHandler,\n} from '../../testing/MockConnection.js';\nimport {\n loadBasicSourceMapExample,\n setupPageResourceLoaderForSourceMap,\n} from '../../testing/SourceMapHelpers.js';\nimport {\n getMainThread,\n makeCompleteEvent,\n makeMockSamplesHandlerData,\n makeProfileCall,\n} from '../../testing/TraceHelpers.js';\nimport {TraceLoader} from '../../testing/TraceLoader.js';\nimport * as Components from '../../ui/legacy/components/utils/utils.js';\nimport * as ThemeSupport from '../../ui/legacy/theme_support/theme_support.js';\n\nimport * as Timeline from './timeline.js';\n\nconst {assert} = chai;\n\ndescribeWithMockConnection('TimelineUIUtils', function() {\n let tracingModel: TraceEngine.Legacy.TracingModel;\n let process: TraceEngine.Legacy.Process;\n let thread: TraceEngine.Legacy.Thread;\n let target: SDK.Target.Target;\n // Trace events contain script ids as strings. However, the linkifier\n // utilities assume it is a number because that's how it's defined at\n // the protocol level. For practicality, we declare these two\n // variables so that we can satisfy type checking throughout the tests.\n const SCRIPT_ID_NUMBER = 1;\n const SCRIPT_ID_STRING = String(SCRIPT_ID_NUMBER) as Protocol.Runtime.ScriptId;\n\n beforeEach(() => {\n target = createTarget();\n tracingModel = new TraceEngine.Legacy.TracingModel();\n process = new TraceEngine.Legacy.Process(tracingModel, 1);\n thread = new TraceEngine.Legacy.Thread(process, 1);\n\n const workspace = Workspace.Workspace.WorkspaceImpl.instance();\n const targetManager = SDK.TargetManager.TargetManager.instance();\n const resourceMapping = new Bindings.ResourceMapping.ResourceMapping(targetManager, workspace);\n const debuggerWorkspaceBinding = Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance({\n forceNew: true,\n resourceMapping,\n targetManager,\n });\n Bindings.IgnoreListManager.IgnoreListManager.instance({forceNew: true, debuggerWorkspaceBinding});\n });\n\n afterEach(() => {\n clearMockConnectionResponseHandler('DOM.pushNodesByBackendIdsToFrontend');\n });\n\n it('creates top frame location text for function calls', async function() {\n const event = new TraceEngine.Legacy.ConstructedEvent(\n 'devtools.timeline', 'FunctionCall', TraceEngine.Types.TraceEvents.Phase.COMPLETE, 10, thread);\n\n event.addArgs({\n data: {\n functionName: 'test',\n url: 'test.js',\n scriptId: SCRIPT_ID_STRING,\n lineNumber: 0,\n columnNumber: 0,\n },\n });\n assert.strictEqual(\n 'test.js:1:1', await Timeline.TimelineUIUtils.TimelineUIUtils.buildDetailsTextForTraceEvent(event));\n });\n\n it('creates top frame location text as a fallback', async function() {\n // 'TimerInstall' is chosen such that we run into the 'default' case.\n const event = new TraceEngine.Legacy.ConstructedEvent(\n 'devtools.timeline', 'TimerInstall', TraceEngine.Types.TraceEvents.Phase.COMPLETE, 10, thread);\n\n event.addArgs({\n data: {\n stackTrace: [\n {\n functionName: 'test',\n url: 'test.js',\n scriptId: SCRIPT_ID_STRING,\n lineNumber: 0,\n columnNumber: 0,\n },\n ],\n },\n });\n const data = TimelineModel.TimelineModel.EventOnTimelineData.forEvent(event);\n data.stackTrace = event.args.data.stackTrace;\n assert.strictEqual(\n 'test.js:1:1', await Timeline.TimelineUIUtils.TimelineUIUtils.buildDetailsTextForTraceEvent(event));\n });\n\n describe('script location as an URL', function() {\n let event: TraceEngine.Legacy.ConstructedEvent;\n beforeEach(() => {\n event = new TraceEngine.Legacy.ConstructedEvent(\n 'devtools.timeline', TimelineModel.TimelineModel.RecordType.FunctionCall,\n TraceEngine.Types.TraceEvents.Phase.COMPLETE, 10, thread);\n\n event.addArgs({\n data: {\n functionName: 'test',\n url: 'https://google.com/test.js',\n scriptId: SCRIPT_ID_STRING,\n lineNumber: 0,\n columnNumber: 0,\n },\n });\n });\n it('makes the script location of a call frame a full URL when the inspected target is not the same the call frame was taken from (e.g. a loaded file)',\n async function() {\n target.setInspectedURL('https://not-google.com' as Platform.DevToolsPath.UrlString);\n const node = await Timeline.TimelineUIUtils.TimelineUIUtils.buildDetailsNodeForTraceEvent(\n event, target, new Components.Linkifier.Linkifier());\n if (!node) {\n throw new Error('Node was unexpectedly null');\n }\n assert.strictEqual(node.textContent, 'test @ google.com/test.js:1:1');\n });\n\n it('makes the script location of a call frame a script name when the inspected target is the one the call frame was taken from',\n async function() {\n target.setInspectedURL('https://google.com' as Platform.DevToolsPath.UrlString);\n const node = await Timeline.TimelineUIUtils.TimelineUIUtils.buildDetailsNodeForTraceEvent(\n event, target, new Components.Linkifier.Linkifier());\n if (!node) {\n throw new Error('Node was unexpectedly null');\n }\n assert.strictEqual(node.textContent, 'test @ /test.js:1:1');\n });\n });\n\n describe('mapping to authored script when recording is fresh', function() {\n beforeEach(async () => {\n // Register mock script and source map.\n\n const sourceMapContent = JSON.stringify({\n 'version': 3,\n 'names': ['unminified', 'par1', 'par2', 'console', 'log'],\n 'sources': [\n '/original-script.ts',\n ],\n 'file': '/test.js',\n 'sourcesContent': ['function unminified(par1, par2) {\\n console.log(par1, par2);\\n}\\n'],\n 'mappings': 'AAAA,SAASA,EAAWC,EAAMC,GACxBC,QAAQC,IAAIH,EAAMC',\n });\n setupPageResourceLoaderForSourceMap(sourceMapContent);\n target.setInspectedURL('https://google.com' as Platform.DevToolsPath.UrlString);\n const scriptUrl = 'https://google.com/script.js' as Platform.DevToolsPath.UrlString;\n const sourceMapUrl = 'script.js.map' as Platform.DevToolsPath.UrlString;\n const debuggerModel = target.model(SDK.DebuggerModel.DebuggerModel);\n assert.isNotNull(debuggerModel);\n if (debuggerModel === null) {\n return;\n }\n const sourceMapManager = debuggerModel.sourceMapManager();\n const script = debuggerModel.parsedScriptSource(\n SCRIPT_ID_STRING, scriptUrl, 0, 0, 0, 0, 0, '', undefined, false, sourceMapUrl, true, false, length, false,\n null, null, null, null, null);\n await sourceMapManager.sourceMapForClientPromise(script);\n });\n it('maps to the authored script when a call frame is provided', async function() {\n const linkifier = new Components.Linkifier.Linkifier();\n const node = Timeline.TimelineUIUtils.TimelineUIUtils.linkifyLocation({\n scriptId: SCRIPT_ID_STRING,\n url: 'https://google.com/test.js',\n lineNumber: 0,\n columnNumber: 0,\n isFreshRecording: true,\n target,\n linkifier,\n });\n if (!node) {\n throw new Error('Node was unexpectedly null');\n }\n // Wait for the location to be resolved using the registered source map.\n await Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance().pendingLiveLocationChangesPromise();\n\n assert.strictEqual(node.textContent, 'original-script.ts:1:1');\n });\n\n it('maps to the authored script when a trace event from the new engine with a stack trace is provided',\n async function() {\n const functionCallEvent = makeCompleteEvent('FunctionCall', 10, 100);\n functionCallEvent.args = ({\n data: {\n stackTrace: [{\n functionName: 'test',\n url: 'https://google.com/test.js',\n scriptId: SCRIPT_ID_NUMBER,\n lineNumber: 0,\n columnNumber: 0,\n }],\n },\n });\n const linkifier = new Components.Linkifier.Linkifier();\n const node =\n Timeline.TimelineUIUtils.TimelineUIUtils.linkifyTopCallFrame(functionCallEvent, target, linkifier, true);\n if (!node) {\n throw new Error('Node was unexpectedly null');\n }\n // Wait for the location to be resolved using the registered source map.\n await Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance()\n .pendingLiveLocationChangesPromise();\n\n assert.strictEqual(node.textContent, 'original-script.ts:1:1');\n });\n });\n\n describe('mapping to authored function name when recording is fresh', function() {\n it('maps to the authored name and script of a profile call', async function() {\n const {script} = await loadBasicSourceMapExample(target);\n // Ideally we would get a column number we can use from the source\n // map however the current status of the source map helpers makes\n // it difficult to do so.\n const columnNumber = 51;\n const profileCall = makeProfileCall(\n 'function', 10, 100, TraceEngine.Types.TraceEvents.ProcessID(1), TraceEngine.Types.TraceEvents.ThreadID(1));\n\n profileCall.callFrame = {\n 'columnNumber': columnNumber,\n 'functionName': 'minified',\n 'lineNumber': 0,\n 'scriptId': script.scriptId,\n 'url': 'file://gen.js',\n };\n const workersData: TraceEngine.Handlers.ModelHandlers.Workers.WorkersData = {\n workerSessionIdEvents: [],\n workerIdByThread: new Map(),\n workerURLById: new Map(),\n };\n // This only includes data used in the SourceMapsResolver\n const traceParsedData = {\n Samples: makeMockSamplesHandlerData([profileCall]),\n Workers: workersData,\n } as TraceEngine.Handlers.Types.TraceParseData;\n\n const resolver = new Timeline.SourceMapsResolver.SourceMapsResolver(traceParsedData);\n await resolver.install();\n\n const linkifier = new Components.Linkifier.Linkifier();\n const node = await Timeline.TimelineUIUtils.TimelineUIUtils.buildDetailsNodeForTraceEvent(\n profileCall, target, linkifier, true);\n if (!node) {\n throw new Error('Node was unexpectedly null');\n }\n assert.isTrue(node.textContent?.startsWith('someFunction @'));\n });\n });\n describe('adjusting timestamps for events and navigations', function() {\n it('adjusts the time for a DCL event after a navigation', async function() {\n const traceParsedData = await TraceLoader.traceEngine(this, 'web-dev.json.gz');\n\n const mainFrameID = traceParsedData.Meta.mainFrameId;\n\n const dclEvent = traceParsedData.PageLoadMetrics.allMarkerEvents.find(event => {\n return TraceEngine.Types.TraceEvents.isTraceEventMarkDOMContent(event) &&\n event.args.data?.frame === mainFrameID;\n });\n if (!dclEvent) {\n throw new Error('Could not find DCL event');\n }\n\n const traceMinBound = traceParsedData.Meta.traceBounds.min;\n\n // Round the time to 2DP to avoid needlessly long expectation numbers!\n const unadjustedStartTimeMilliseconds =\n TraceEngine.Helpers.Timing\n .microSecondsToMilliseconds(\n TraceEngine.Types.Timing.MicroSeconds(dclEvent.ts - traceMinBound),\n )\n .toFixed(2);\n assert.strictEqual(unadjustedStartTimeMilliseconds, String(190.79));\n\n const adjustedTime =\n Timeline.TimelineUIUtils.timeStampForEventAdjustedForClosestNavigationIfPossible(dclEvent, traceParsedData);\n assert.strictEqual(adjustedTime.toFixed(2), String(178.92));\n });\n\n it('can adjust the times for events that are not PageLoad markers', async function() {\n const traceParsedData = await TraceLoader.traceEngine(this, 'user-timings.json.gz');\n // Use a performance.mark event. Exact event is unimportant except that\n // it should not be a Page Load event as those are covered by the tests\n // above.\n const userMark = traceParsedData.UserTimings.performanceMarks.find(event => event.name === 'mark1');\n if (!userMark) {\n throw new Error('Could not find user mark');\n }\n\n const adjustedMarkTime =\n Timeline.TimelineUIUtils.timeStampForEventAdjustedForClosestNavigationIfPossible(userMark, traceParsedData);\n assert.strictEqual(adjustedMarkTime.toFixed(2), String(79.88));\n });\n });\n\n function getRowDataForDetailsElement(details: DocumentFragment) {\n return Array.from(details.querySelectorAll('.timeline-details-view-row')).map(row => {\n const title = row.querySelector('.timeline-details-view-row-title')?.innerText;\n const value = row.querySelector('.timeline-details-view-row-value')?.innerText;\n return {title, value};\n });\n }\n\n function getPieChartDataForDetailsElement(details: DocumentFragment) {\n const pieChartComp = details.querySelector('devtools-perf-piechart');\n if (!pieChartComp?.shadowRoot) {\n return [];\n }\n return Array.from(pieChartComp.shadowRoot.querySelectorAll('.pie-chart-legend-row')).map(row => {\n const title = row.querySelector('.pie-chart-name')?.innerText;\n const value = row.querySelector('.pie-chart-size')?.innerText;\n return {title, value};\n });\n }\n\n describe('colors', function() {\n before(() => {\n // Rather than use the real colours here and burden the test with having to\n // inject loads of CSS, we fake out the colours. this is fine for our tests as\n // the exact value of the colours is not important; we just make sure that it\n // parses them out correctly. Each variable is given a different rgb() value to\n // ensure we know the code is working and using the right one.\n const styleElement = document.createElement('style');\n styleElement.id = 'fake-perf-panel-colors';\n styleElement.textContent = `\n:root {\n --app-color-loading: rgb(0 0 0);\n --app-color-loading-children: rgb(1 1 1);\n --app-color-scripting: rgb(2 2 2);\n --app-color-scripting-children: rgb(3 3 3);\n --app-color-rendering: rgb(4 4 4);\n --app-color-rendering-children: rgb(5 5 5);\n --app-color-painting: rgb(6 6 6);\n --app-color-painting-children: rgb(7 7 7);\n --app-color-task: rgb(8 8 8);\n --app-color-task-children: rgb(9 9 9);\n --app-color-system: rgb(10 10 10);\n --app-color-system-children: rgb(11 11 11);\n --app-color-idle: rgb(12 12 12);\n --app-color-idle-children: rgb(13 13 13);\n --app-color-async: rgb(14 14 14);\n --app-color-async-children: rgb(15 15 15);\n --app-color-other: rgb(16 16 16);\n}\n`;\n document.documentElement.appendChild(styleElement);\n ThemeSupport.ThemeSupport.clearThemeCache();\n });\n\n after(() => {\n const styleElementToRemove = document.documentElement.querySelector('#fake-perf-panel-colors');\n if (styleElementToRemove) {\n document.documentElement.removeChild(styleElementToRemove);\n }\n ThemeSupport.ThemeSupport.clearThemeCache();\n });\n\n it('should return the correct rgb value for a corresponding CSS variable', function() {\n const parsedColor = Timeline.EventUICategory.getCategoryStyles().scripting.getComputedColorValue();\n assert.strictEqual('rgb(2 2 2)', parsedColor);\n });\n\n it('should return the color as a CSS variable', function() {\n const cssVariable = Timeline.EventUICategory.getCategoryStyles().scripting.getCSSValue();\n assert.strictEqual('var(--app-color-scripting)', cssVariable);\n });\n\n it('treats the v8.parseOnBackgroundWaiting as scripting even though it would usually be idle', function() {\n const event = new TraceEngine.Legacy.ConstructedEvent(\n 'v8,devtools.timeline,disabled-by-default-v8.compile',\n TimelineModel.TimelineModel.RecordType.StreamingCompileScriptWaiting,\n TraceEngine.Types.TraceEvents.Phase.COMPLETE, 10, thread);\n\n assert.strictEqual('rgb(2 2 2)', Timeline.TimelineUIUtils.TimelineUIUtils.eventColor(event));\n });\n\n it('assigns the correct color to the swatch of an event\\'s title', async function() {\n const data = await TraceLoader.allModels(this, 'lcp-web-font.json.gz');\n const events = data.traceParsedData.Renderer.allTraceEntries;\n const task = events.find(event => {\n return event.name.includes('RunTask');\n });\n if (!task) {\n throw new Error('Could not find expected event.');\n }\n\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildTraceEventDetails(\n task,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n false,\n );\n const titleSwatch: HTMLElement|null = details.querySelector('.timeline-details-chip-title div');\n assert.strictEqual(titleSwatch?.style.backgroundColor, 'rgb(10, 10, 10)');\n });\n it('assigns the correct color to the swatch of a network request title', async function() {\n const data = await TraceLoader.allModels(this, 'lcp-web-font.json.gz');\n const networkRequests = data.traceParsedData.NetworkRequests.byTime;\n const cssRequest = networkRequests.find(request => {\n return request.args.data.url === 'https://chromedevtools.github.io/performance-stories/lcp-web-font/app.css';\n });\n if (!cssRequest) {\n throw new Error('Could not find expected network request.');\n }\n\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildSyntheticNetworkRequestDetails(\n cssRequest,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n );\n const titleSwatch: HTMLElement|null = details.querySelector('.timeline-details-chip-title div');\n assert.strictEqual(titleSwatch?.style.backgroundColor, 'rgb(4, 4, 4)');\n });\n });\n\n describe('testContentMatching', () => {\n it('matches call frame events based on a regular expression and the contents of the event', async function() {\n const data = await TraceLoader.allModels(this, 'react-hello-world.json.gz');\n // Find an event from the trace that represents some work that React did. This\n // event is not chosen for any particular reason other than it was the example\n // used in the bug report: crbug.com/1484504\n const mainThread = getMainThread(data.traceParsedData.Renderer);\n const performConcurrentWorkEvent = mainThread.entries.find(entry => {\n if (TraceEngine.Types.TraceEvents.isProfileCall(entry)) {\n return entry.callFrame.functionName === 'performConcurrentWorkOnRoot';\n }\n return false;\n });\n if (!performConcurrentWorkEvent) {\n throw new Error('Could not find expected event');\n }\n assert.isTrue(Timeline.TimelineUIUtils.TimelineUIUtils.testContentMatching(\n performConcurrentWorkEvent, /perfo/, data.traceParsedData));\n });\n });\n\n describe('traceEventDetails', function() {\n it('shows the interaction ID and INP breakdown metrics for a given interaction', async function() {\n const data = await TraceLoader.allModels(this, 'one-second-interaction.json.gz');\n const interactionEvent = data.traceParsedData.UserInteractions.interactionEventsWithNoNesting.find(entry => {\n return entry.dur === 979974 && entry.type === 'click';\n });\n if (!interactionEvent) {\n throw new Error('Could not find expected event');\n }\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildTraceEventDetails(\n interactionEvent,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n false,\n data.traceParsedData,\n );\n const rowData = getRowDataForDetailsElement(details);\n assert.deepEqual(rowData, [\n {\n title: 'Warning',\n value: 'Long interaction is indicating poor page responsiveness.',\n },\n {\n title: 'ID',\n value: '4122',\n },\n {\n title: 'Input delay',\n value: '1ms',\n },\n {\n title: 'Processing duration',\n value: '977ms',\n },\n {\n title: 'Presentation delay',\n value: '1.974ms',\n },\n ]);\n });\n\n it('renders all event data for a generic trace', async function() {\n const data = await TraceLoader.allModels(this, 'generic-about-tracing.json.gz');\n const event = data.traceParsedData.Renderer.allTraceEntries.find(entry => {\n return entry.name === 'ThreadControllerImpl::RunTask';\n });\n if (!event) {\n throw new Error('Could not find event.');\n }\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildTraceEventDetails(\n event,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n false,\n data.traceParsedData,\n );\n const rowData = getRowDataForDetailsElement(details);\n assert.deepEqual(rowData, [\n {\n title: 'chrome_task_annotator',\n value: '{\"delay_policy\":\"PRECISE\",\"task_delay_us\":7159}',\n },\n {\n title: 'src_file',\n value: '\"cc/scheduler/scheduler.cc\"',\n },\n {\n title: 'src_func',\n value: '\"ScheduleBeginImplFrameDeadline\"',\n },\n ]);\n });\n\n it('renders invalidations correctly', async function() {\n const data = await TraceLoader.allModels(this, 'style-invalidation-change-attribute.json.gz');\n\n // Set up a fake DOM so that we can request nodes by backend Ids (even\n // though we return none, we need to mock these calls else the frontend\n // will not work.)\n const documentNode = {nodeId: 1 as Protocol.DOM.BackendNodeId};\n setMockConnectionResponseHandler('DOM.getDocument', () => ({root: documentNode}));\n setMockConnectionResponseHandler('DOM.pushNodesByBackendIdsToFrontend', () => {\n return {\n nodeIds: [],\n };\n });\n\n const updateLayoutTreeEvent = data.traceParsedData.Renderer.allTraceEntries.find(event => {\n return TraceEngine.Types.TraceEvents.isTraceEventUpdateLayoutTree(event) &&\n event.args.beginData?.stackTrace?.[0].functionName === 'testFuncs.changeAttributeAndDisplay';\n });\n if (!updateLayoutTreeEvent) {\n throw new Error('Could not find update layout tree event');\n }\n\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildTraceEventDetails(\n updateLayoutTreeEvent,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n false,\n data.traceParsedData,\n );\n const rowData = getRowDataForDetailsElement(details);\n assert.deepEqual(rowData, [\n {\n title: 'Elements Affected',\n value: '3',\n },\n {\n // The \"Recalculation forced\" Stack trace output would be here but the detailRow helper is\n // unable to parse it, hence why this returns undefined.\n title: undefined,\n value: undefined,\n },\n {\n title: 'Initiated by',\n value: 'Schedule Style Recalculation',\n },\n {\n title: 'Pending for',\n value: '7.1 ms',\n },\n {\n title: 'PseudoClass:active',\n value: 'BUTTON id=\\'changeAttributeAndDisplay\\'',\n },\n {\n title: 'Attribute (dir)',\n value:\n 'DIV id=\\'testElementFour\\' at chromedevtools.github.io/performance-stories/style-invalidations/app.js:46',\n },\n {\n title: 'Attribute (dir)',\n value:\n 'DIV id=\\'testElementFive\\' at chromedevtools.github.io/performance-stories/style-invalidations/app.js:47',\n },\n {\n title: 'Element has pending invalidation list',\n value: 'DIV id=\\'testElementFour\\'',\n },\n {\n title: 'Element has pending invalidation list',\n value: 'DIV id=\\'testElementFive\\'',\n },\n ]);\n });\n\n it('renders details for a v8.compile (\"Compile Script\") event', async function() {\n const data = await TraceLoader.allModels(this, 'user-timings.json.gz');\n const compileEvent =\n data.traceParsedData.Renderer.allTraceEntries.find(TraceEngine.Types.TraceEvents.isTraceEventV8Compile);\n if (!compileEvent) {\n throw new Error('Could not find expected event');\n }\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildTraceEventDetails(\n compileEvent,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n false,\n data.traceParsedData,\n );\n const rowData = getRowDataForDetailsElement(details);\n assert.deepEqual(rowData, [\n {\n title: 'Script',\n // URL plus line/col number\n value: 'chrome-extension://blijaeebfebmkmekmdnehcmmcjnblkeo/lib/utils.js:1:1',\n },\n {\n title: 'Streamed',\n value: 'false: inline script',\n },\n {title: 'Compilation cache status', value: 'script not eligible'},\n ]);\n });\n\n it('renders the details for a layout shift properly', async function() {\n // Set related CDP methods responses to return our mock document and node.\n const domModel = target.model(SDK.DOMModel.DOMModel);\n assertNotNullOrUndefined(domModel);\n const documentNode = {nodeId: 1 as Protocol.DOM.NodeId};\n const docc = new SDK.DOMModel.DOMNode(domModel) as SDK.DOMModel.DOMDocument;\n const domNode2 = new SDK.DOMModel.DOMNode(domModel);\n const domID = 58 as Protocol.DOM.NodeId;\n domNode2.id = domID;\n\n setMockConnectionResponseHandler('DOM.pushNodesByBackendIdsToFrontend', () => ({nodeIds: [domID]}));\n\n setMockConnectionResponseHandler('DOM.getDocument', () => ({root: documentNode}));\n await domModel.requestDocument();\n domModel.registerNode(domNode2);\n domNode2.init(docc, false, {nodeName: 'A test node name', nodeId: domID} as Protocol.DOM.Node);\n const data = await TraceLoader.allModels(this, 'cls-single-frame.json.gz');\n const layoutShift = data.traceParsedData.LayoutShifts.clusters[0].events[0];\n Common.Linkifier.registerLinkifier({\n contextTypes() {\n return [Timeline.CLSLinkifier.CLSRect];\n },\n async loadLinkifier() {\n return Timeline.CLSLinkifier.Linkifier.instance();\n },\n });\n Common.Linkifier.registerLinkifier({\n contextTypes() {\n return [\n SDK.DOMModel.DOMNode,\n ];\n },\n async loadLinkifier() {\n return Elements.DOMLinkifier.Linkifier.instance();\n },\n });\n\n if (!layoutShift) {\n throw new Error('Could not find LayoutShift event.');\n }\n\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildTraceEventDetails(\n layoutShift,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n false,\n data.traceParsedData,\n );\n const rowData = getRowDataForDetailsElement(details);\n assert.deepEqual(\n rowData,\n [\n {\n title: 'Warning',\n value: 'Cumulative Layout Shifts can result in poor user experiences. It has recently evolved.',\n },\n {title: 'Score', value: '0.04218'},\n {title: 'Cumulative Score', value: '0.04218'},\n {title: 'Current Cluster ID', value: '1'},\n {title: 'Current Cluster Score', value: '0.2952'},\n {title: 'Had recent input', value: 'No'},\n {title: 'Moved from', value: 'Location: [120,670], Size: [900x900]'},\n {title: 'Moved to', value: 'Location: [120,1270], Size: [900x478]'},\n // The related node link value is under shadow root so it\n // can't be accessed at this point.\n {title: 'Related Node', value: ''},\n ],\n );\n // Test the related node link.\n const relatedNodeRow =\n details.querySelector('.timeline-details-view-row:nth-of-type(9) .timeline-details-view-row-value span')\n ?.shadowRoot;\n relatedNodeRow?.querySelector('button')?.innerText;\n assert.strictEqual(relatedNodeRow?.querySelector('button')?.innerText, 'A test node name');\n });\n\n it('renders the details for a profile call properly', async function() {\n Common.Linkifier.registerLinkifier({\n contextTypes() {\n return [Timeline.CLSLinkifier.CLSRect];\n },\n async loadLinkifier() {\n return Timeline.CLSLinkifier.Linkifier.instance();\n },\n });\n\n const data = await TraceLoader.allModels(this, 'simple-js-program.json.gz');\n const rendererHandler = data.traceParsedData.Renderer;\n if (!rendererHandler) {\n throw new Error('RendererHandler is undefined');\n }\n const [process] = rendererHandler.processes.values();\n const [thread] = process.threads.values();\n const profileCalls = thread.entries.filter(entry => TraceEngine.Types.TraceEvents.isProfileCall(entry));\n\n if (!profileCalls) {\n throw new Error('Could not find renderer events');\n }\n\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildTraceEventDetails(\n profileCalls[0],\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n false,\n data.traceParsedData,\n );\n const rowData = getRowDataForDetailsElement(details);\n assert.deepEqual(\n rowData,\n [\n {\n title: 'Function',\n value: '(anonymous) @ www.google.com:21:17',\n },\n ],\n );\n });\n\n it('renders the warning for a trace event in its details', async function() {\n const data = await TraceLoader.allModels(this, 'simple-js-program.json.gz');\n\n const events = data.traceParsedData.Renderer?.allTraceEntries;\n if (!events) {\n throw new Error('Could not find renderer events');\n }\n\n const longTask = events.find(e => (e.dur || 0) > 1_000_000);\n if (!longTask) {\n throw new Error('Could not find Long Task event.');\n }\n\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildTraceEventDetails(\n longTask,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n false,\n data.traceParsedData,\n );\n const rowData = getRowDataForDetailsElement(details);\n assert.deepEqual(\n rowData,\n [\n {\n title: 'Warning',\n value: 'Long task took 1.30\\u00A0s.',\n },\n ],\n );\n });\n\n it('shows information for the WebSocketCreate initiator when viewing a WebSocketSendHandshakeRequest event',\n async function() {\n const data = await TraceLoader.allModels(this, 'web-sockets.json.gz');\n const events = data.traceParsedData.Renderer?.allTraceEntries;\n if (!events) {\n throw new Error('Could not find renderer events');\n }\n\n const sendHandshake = events.find(TraceEngine.Types.TraceEvents.isTraceEventWebSocketSendHandshakeRequest);\n if (!sendHandshake) {\n throw new Error('Could not find handshake event.');\n }\n\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildTraceEventDetails(\n sendHandshake,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n false,\n data.traceParsedData,\n );\n const rowData = getRowDataForDetailsElement(details);\n const expectedRowData = [\n {title: 'URL', value: 'wss://socketsbay.com/wss/v2/1/demo/'},\n {\n // The 'First Invalidated' Stack trace output would be here but the detailRow helper is\n // unable to parse it, hence why this returns undefined.\n title: undefined,\n value: undefined,\n },\n {title: 'Initiated by', 'value': 'Create WebSocket'},\n {title: 'Pending for', value: '72.0 ms'},\n ];\n assert.deepEqual(\n rowData,\n expectedRowData,\n );\n });\n\n it('shows information for the events initiated by WebSocketCreate when viewing a WebSocketCreate event',\n async function() {\n const data = await TraceLoader.allModels(this, 'web-sockets.json.gz');\n const events = data.traceParsedData.Renderer?.allTraceEntries;\n if (!events) {\n throw new Error('Could not find renderer events');\n }\n\n const sendHandshake = events.find(TraceEngine.Types.TraceEvents.isTraceEventWebSocketCreate);\n if (!sendHandshake) {\n throw new Error('Could not find handshake event.');\n }\n\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildTraceEventDetails(\n sendHandshake,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n false,\n data.traceParsedData,\n );\n const rowData = getRowDataForDetailsElement(details);\n const expectedRowData = [\n {title: 'URL', value: 'wss://socketsbay.com/wss/v2/1/demo/'},\n // This value looks odd, but it is because the initiator stack trace cannot be\n // easily represented as a string, so this is OK.\n {title: undefined, value: undefined},\n // The 2 entries under \"Initiator for\" are displayed as seperate links and in the UI it is obvious they are seperate\n {title: 'Initiator for', 'value': 'Send WebSocket Handshake Receive WebSocket Handshake'},\n ];\n assert.deepEqual(\n rowData,\n expectedRowData,\n );\n });\n\n it('shows the aggregated time information for an event', async function() {\n const data = await TraceLoader.allModels(this, 'web-dev.json.gz');\n const event =\n data.traceParsedData.Renderer?.allTraceEntries.find(e => e.ts === 1020034919877 && e.name === 'RunTask');\n if (!event) {\n throw new Error('Could not find renderer events');\n }\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildTraceEventDetails(\n event,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n true,\n data.traceParsedData,\n );\n const pieChartData = getPieChartDataForDetailsElement(details);\n\n const expectedPieChartData = [\n {title: 'System (self)', value: '2\\u00A0ms'},\n {title: 'System (children)', value: '2\\u00A0ms'},\n {title: 'Rendering', value: '28\\u00A0ms'},\n {title: 'Painting', value: '2\\u00A0ms'},\n {title: 'Total', value: '34\\u00A0ms'},\n ];\n assert.deepEqual(\n pieChartData,\n expectedPieChartData,\n );\n });\n });\n\n it('can generate details for a frame', async function() {\n const traceParsedData = await TraceLoader.traceEngine(this, 'web-dev-with-commit.json.gz');\n const frame = traceParsedData.Frames.frames.at(0);\n if (!frame) {\n throw new Error('Could not find expected frame');\n }\n const filmStrip = TraceEngine.Extras.FilmStrip.fromTraceData(traceParsedData);\n const details =\n Timeline.TimelineUIUtils.TimelineUIUtils.generateDetailsContentForFrame(frame, filmStrip, filmStrip.frames[0]);\n const container = document.createElement('div');\n renderElementIntoDOM(container);\n container.appendChild(details);\n // Give the image element time to render and load.\n await doubleRaf();\n const img = container.querySelector('.timeline-filmstrip-preview img');\n assert.isTrue(img?.currentSrc.includes(filmStrip.frames[0].screenshotEvent.args.dataUri));\n\n const durationRow = container.querySelector('[data-row-title=\"Duration\"]');\n const durationValue = durationRow?.querySelector('.timeline-details-view-row-value span');\n if (!durationValue) {\n throw new Error('Could not find duration');\n }\n // Strip the unicode spaces out and replace with simple spaces for easy\n // assertions.\n const value = (durationValue.innerText.replaceAll(/\\s/g, ' '));\n assert.strictEqual(value, '37.85 ms (at 109.82 ms)');\n });\n\n describe('buildNetworkRequestDetails', function() {\n it('renders the right details for a network event from TraceEngine', async function() {\n const data = await TraceLoader.allModels(this, 'lcp-web-font.json.gz');\n const networkRequests = data.traceParsedData.NetworkRequests.byTime;\n const cssRequest = networkRequests.find(request => {\n return request.args.data.url === 'https://chromedevtools.github.io/performance-stories/lcp-web-font/app.css';\n });\n if (!cssRequest) {\n throw new Error('Could not find expected network request.');\n }\n\n const details = await Timeline.TimelineUIUtils.TimelineUIUtils.buildSyntheticNetworkRequestDetails(\n cssRequest,\n data.timelineModel,\n new Components.Linkifier.Linkifier(),\n );\n\n const rowData = getRowDataForDetailsElement(details);\n\n assert.deepEqual(\n rowData,\n [\n {title: 'URL', value: 'chromedevtools.github.io/performance-stories/lcp-web-font/app.css'},\n {title: 'Duration', value: '12.582ms (8.291ms load from cache + 4.291ms resource loading)'},\n {title: 'Request Method', value: 'GET'},\n {title: 'Initial Priority', value: 'Highest'},\n {title: 'Priority', value: 'Highest'},\n {title: 'Mime Type', value: 'text/css'},\n {title: 'Encoded Data', value: ' (from cache)'},\n {title: 'Decoded Body', value: '96 B'},\n ],\n );\n });\n });\n\n describe('eventTitle', function() {\n it('renders the correct title for an EventTiming interaction event', async function() {\n const data = await TraceLoader.allModels(this, 'slow-interaction-button-click.json.gz');\n const interactionEvent = data.traceParsedData.UserInteractions.interactionEventsWithNoNesting[0];\n const details = Timeline.TimelineUIUtils.TimelineUIUtils.eventTitle(interactionEvent);\n assert.deepEqual(details, 'Pointer');\n });\n\n it('will use the resolved function name for a profile node that has a sourcemap', async function() {\n // Timeline.SourceMapsResolver.SourceMapsResolver.\n const traceParsedData = await TraceLoader.traceEngine(this, 'slow-interaction-button-click.json.gz');\n\n const mainThread = getMainThread(traceParsedData.Renderer);\n const profileEntry = mainThread.entries.find(entry => {\n return TraceEngine.Types.TraceEvents.isProfileCall(entry);\n });\n if (!profileEntry || !TraceEngine.Types.TraceEvents.isProfileCall(profileEntry)) {\n throw new Error('Could not find a profile entry');\n }\n\n // Fake that we resolved the entry's name from a sourcemap.\n Timeline.SourceMapsResolver.SourceMapsResolver.storeResolvedNodeNameForEntry(\n profileEntry.pid, profileEntry.tid, profileEntry.nodeId, 'resolved-function-test');\n\n const title = Timeline.TimelineUIUtils.TimelineUIUtils.eventTitle(profileEntry);\n assert.strictEqual(title, 'resolved-function-test');\n });\n });\n\n describe('eventStyle', function() {\n it('returns the correct style for profile calls', async function() {\n const data = await TraceLoader.allModels(this, 'simple-js-program.json.gz');\n const rendererHandler = data.traceParsedData.Renderer;\n if (!rendererHandler) {\n throw new Error('RendererHandler is undefined');\n }\n const [process] = rendererHandler.processes.values();\n const [thread] = process.threads.values();\n const profileCalls = thread.entries.filter(entry => TraceEngine.Types.TraceEvents.isProfileCall(entry));\n const style = Timeline.TimelineUIUtils.TimelineUIUtils.eventStyle(profileCalls[0]);\n assert.strictEqual(style.category.name, 'scripting');\n assert.strictEqual(style.category.color, 'rgb(250 204 21 / 100%)');\n });\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/Breadcrumbs.d.ts b/public/panels/timeline/components/Breadcrumbs.d.ts index 1db5e125b..cd1fb564d 100644 --- a/public/panels/timeline/components/Breadcrumbs.d.ts +++ b/public/panels/timeline/components/Breadcrumbs.d.ts @@ -1,14 +1,11 @@ import type * as TraceEngine from '../../../models/trace/trace.js'; -export interface Breadcrumb { - window: TraceEngine.Types.Timing.TraceWindowMicroSeconds; - child: Breadcrumb | null; -} -export declare function flattenBreadcrumbs(initialBreadcrumb: Breadcrumb): Breadcrumb[]; +export declare function flattenBreadcrumbs(initialBreadcrumb: TraceEngine.Types.File.Breadcrumb): TraceEngine.Types.File.Breadcrumb[]; export declare class Breadcrumbs { - readonly initialBreadcrumb: Breadcrumb; - lastBreadcrumb: Breadcrumb; + initialBreadcrumb: TraceEngine.Types.File.Breadcrumb; + lastBreadcrumb: TraceEngine.Types.File.Breadcrumb; constructor(initialTraceWindow: TraceEngine.Types.Timing.TraceWindowMicroSeconds); add(newBreadcrumbTraceWindow: TraceEngine.Types.Timing.TraceWindowMicroSeconds): void; isTraceWindowWithinTraceWindow(child: TraceEngine.Types.Timing.TraceWindowMicroSeconds, parent: TraceEngine.Types.Timing.TraceWindowMicroSeconds): boolean; - makeBreadcrumbActive(newLastBreadcrumb: Breadcrumb): void; + setInitialBreadcrumbFromLoadedAnnotations(initialBreadcrumb: TraceEngine.Types.File.Breadcrumb): void; + setLastBreadcrumb(lastBreadcrumb: TraceEngine.Types.File.Breadcrumb): void; } diff --git a/public/panels/timeline/components/Breadcrumbs.js b/public/panels/timeline/components/Breadcrumbs.js index 1ad25078d..d78ccf574 100644 --- a/public/panels/timeline/components/Breadcrumbs.js +++ b/public/panels/timeline/components/Breadcrumbs.js @@ -1,6 +1,7 @@ // Copyright 2023 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import * as TraceBounds from '../../../services/trace_bounds/trace_bounds.js'; export function flattenBreadcrumbs(initialBreadcrumb) { const allBreadcrumbs = [initialBreadcrumb]; let breadcrumbsIter = initialBreadcrumb; @@ -32,7 +33,7 @@ export class Breadcrumbs { // To add a new Breadcrumb to the Breadcrumbs Linked List, set the child of last breadcrumb // to the new breadcrumb and update the last Breadcrumb this.lastBreadcrumb.child = newBreadcrumb; - this.lastBreadcrumb = this.lastBreadcrumb.child; + this.setLastBreadcrumb(newBreadcrumb); } else { throw new Error('Can not add a breadcrumb that is equal to or is outside of the parent breadcrumb TimeWindow'); @@ -43,10 +44,23 @@ export class Breadcrumbs { return (child.min >= parent.min && child.max <= parent.max) && !(child.min === parent.min && child.max === parent.max); } - // Make breadcrumb active by removing all of its children and making it the last breadcrumb - makeBreadcrumbActive(newLastBreadcrumb) { - this.lastBreadcrumb = newLastBreadcrumb; + // Used to set an initial breadcrumbs from annotations loaded from a file + setInitialBreadcrumbFromLoadedAnnotations(initialBreadcrumb) { + this.initialBreadcrumb = initialBreadcrumb; + // Make last breadcrumb active + let lastBreadcrumb = initialBreadcrumb; + while (lastBreadcrumb.child !== null) { + lastBreadcrumb = lastBreadcrumb.child; + } + this.setLastBreadcrumb(lastBreadcrumb); + } + setLastBreadcrumb(lastBreadcrumb) { + // When we assign a new active breadcrumb, both the minimap bounds and the visible + // window get set to that breadcrumb's window. + this.lastBreadcrumb = lastBreadcrumb; this.lastBreadcrumb.child = null; + TraceBounds.TraceBounds.BoundsManager.instance().setMiniMapBounds(lastBreadcrumb.window); + TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(lastBreadcrumb.window); } } //# sourceMappingURL=Breadcrumbs.js.map \ No newline at end of file diff --git a/public/panels/timeline/components/Breadcrumbs.js.map b/public/panels/timeline/components/Breadcrumbs.js.map index 753429e6e..b9db6bbb9 100644 --- a/public/panels/timeline/components/Breadcrumbs.js.map +++ b/public/panels/timeline/components/Breadcrumbs.js.map @@ -1 +1 @@ -{"version":3,"file":"Breadcrumbs.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/Breadcrumbs.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAS7B,MAAM,UAAU,kBAAkB,CAAC,iBAA6B;IAC9D,MAAM,cAAc,GAAiB,CAAC,iBAAiB,CAAC,CAAC;IACzD,IAAI,eAAe,GAAe,iBAAiB,CAAC;IAEpD,OAAO,eAAe,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;QACtC,MAAM,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC;QACxC,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;YACvB,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC/B,eAAe,GAAG,SAAS,CAAC;QAC9B,CAAC;IACH,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC;AAED,MAAM,OAAO,WAAW;IACb,iBAAiB,CAAa;IACvC,cAAc,CAAa;IAE3B,YAAY,kBAAoE;QAC9E,IAAI,CAAC,iBAAiB,GAAG;YACvB,MAAM,EAAE,kBAAkB;YAC1B,KAAK,EAAE,IAAI;SACZ,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,iBAAiB,CAAC;IAC/C,CAAC;IAED,GAAG,CAAC,wBAA0E;QAC5E,IAAI,IAAI,CAAC,8BAA8B,CAAC,wBAAwB,EAAE,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;YAC9F,MAAM,aAAa,GAAG;gBACpB,MAAM,EAAE,wBAAwB;gBAChC,KAAK,EAAE,IAAI;aACZ,CAAC;YACF,2FAA2F;YAC3F,uDAAuD;YACvD,IAAI,CAAC,cAAc,CAAC,KAAK,GAAG,aAAa,CAAC;YAC1C,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC;QAClD,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,6FAA6F,CAAC,CAAC;QACjH,CAAC;IACH,CAAC;IAED,iHAAiH;IACjH,8BAA8B,CAC1B,KAAuD,EACvD,MAAwD;QAC1D,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,MAAM,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC;YACvD,CAAC,CAAC,KAAK,CAAC,GAAG,KAAK,MAAM,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,KAAK,MAAM,CAAC,GAAG,CAAC,CAAC;IAC9D,CAAC;IAED,2FAA2F;IAC3F,oBAAoB,CAAC,iBAA6B;QAChD,IAAI,CAAC,cAAc,GAAG,iBAAiB,CAAC;QACxC,IAAI,CAAC,cAAc,CAAC,KAAK,GAAG,IAAI,CAAC;IACnC,CAAC;CACF","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as TraceEngine from '../../../models/trace/trace.js';\n\nexport interface Breadcrumb {\n window: TraceEngine.Types.Timing.TraceWindowMicroSeconds;\n child: Breadcrumb|null;\n}\n\nexport function flattenBreadcrumbs(initialBreadcrumb: Breadcrumb): Breadcrumb[] {\n const allBreadcrumbs: Breadcrumb[] = [initialBreadcrumb];\n let breadcrumbsIter: Breadcrumb = initialBreadcrumb;\n\n while (breadcrumbsIter.child !== null) {\n const iterChild = breadcrumbsIter.child;\n if (iterChild !== null) {\n allBreadcrumbs.push(iterChild);\n breadcrumbsIter = iterChild;\n }\n }\n\n return allBreadcrumbs;\n}\n\nexport class Breadcrumbs {\n readonly initialBreadcrumb: Breadcrumb;\n lastBreadcrumb: Breadcrumb;\n\n constructor(initialTraceWindow: TraceEngine.Types.Timing.TraceWindowMicroSeconds) {\n this.initialBreadcrumb = {\n window: initialTraceWindow,\n child: null,\n };\n this.lastBreadcrumb = this.initialBreadcrumb;\n }\n\n add(newBreadcrumbTraceWindow: TraceEngine.Types.Timing.TraceWindowMicroSeconds): void {\n if (this.isTraceWindowWithinTraceWindow(newBreadcrumbTraceWindow, this.lastBreadcrumb.window)) {\n const newBreadcrumb = {\n window: newBreadcrumbTraceWindow,\n child: null,\n };\n // To add a new Breadcrumb to the Breadcrumbs Linked List, set the child of last breadcrumb\n // to the new breadcrumb and update the last Breadcrumb\n this.lastBreadcrumb.child = newBreadcrumb;\n this.lastBreadcrumb = this.lastBreadcrumb.child;\n } else {\n throw new Error('Can not add a breadcrumb that is equal to or is outside of the parent breadcrumb TimeWindow');\n }\n }\n\n // Breadcumb should be within the bounds of the parent and can not have both start and end be equal to the parent\n isTraceWindowWithinTraceWindow(\n child: TraceEngine.Types.Timing.TraceWindowMicroSeconds,\n parent: TraceEngine.Types.Timing.TraceWindowMicroSeconds): boolean {\n return (child.min >= parent.min && child.max <= parent.max) &&\n !(child.min === parent.min && child.max === parent.max);\n }\n\n // Make breadcrumb active by removing all of its children and making it the last breadcrumb\n makeBreadcrumbActive(newLastBreadcrumb: Breadcrumb): void {\n this.lastBreadcrumb = newLastBreadcrumb;\n this.lastBreadcrumb.child = null;\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"Breadcrum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CAAC,6FAA6F,CAAC,CAAC;QACjH,CAAC;IACH,CAAC;IAED,iHAAiH;IACjH,8BAA8B,CAC1B,KAAuD,EACvD,MAAwD;QAC1D,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,MAAM,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC;YACvD,CAAC,CAAC,KAAK,CAAC,GAAG,KAAK,MAAM,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,KAAK,MAAM,CAAC,GAAG,CAAC,CAAC;IAC9D,CAAC;IAED,yEAAyE;IACzE,yCAAyC,CAAC,iBAAoD;QAC5F,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,8BAA8B;QAC9B,IAAI,cAAc,GAAG,iBAAiB,CAAC;QACvC,OAAO,cAAc,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACrC,cAAc,GAAG,cAAc,CAAC,KAAK,CAAC;QACxC,CAAC;QACD,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;IACzC,CAAC;IAED,iBAAiB,CAAC,cAAiD;QACjE,kFAAkF;QAClF,8CAA8C;QAC9C,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,cAAc,CAAC,KAAK,GAAG,IAAI,CAAC;QACjC,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,gBAAgB,CAC7D,cAAc,CAAC,MAAM,CACxB,CAAC;QACF,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,wBAAwB,CACrE,cAAc,CAAC,MAAM,CACxB,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as TraceEngine from '../../../models/trace/trace.js';\nimport * as TraceBounds from '../../../services/trace_bounds/trace_bounds.js';\n\nexport function flattenBreadcrumbs(initialBreadcrumb: TraceEngine.Types.File.Breadcrumb):\n TraceEngine.Types.File.Breadcrumb[] {\n const allBreadcrumbs: TraceEngine.Types.File.Breadcrumb[] = [initialBreadcrumb];\n let breadcrumbsIter: TraceEngine.Types.File.Breadcrumb = initialBreadcrumb;\n\n while (breadcrumbsIter.child !== null) {\n const iterChild = breadcrumbsIter.child;\n if (iterChild !== null) {\n allBreadcrumbs.push(iterChild);\n breadcrumbsIter = iterChild;\n }\n }\n\n return allBreadcrumbs;\n}\n\nexport class Breadcrumbs {\n initialBreadcrumb: TraceEngine.Types.File.Breadcrumb;\n lastBreadcrumb: TraceEngine.Types.File.Breadcrumb;\n\n constructor(initialTraceWindow: TraceEngine.Types.Timing.TraceWindowMicroSeconds) {\n this.initialBreadcrumb = {\n window: initialTraceWindow,\n child: null,\n };\n this.lastBreadcrumb = this.initialBreadcrumb;\n }\n\n add(newBreadcrumbTraceWindow: TraceEngine.Types.Timing.TraceWindowMicroSeconds): void {\n if (this.isTraceWindowWithinTraceWindow(newBreadcrumbTraceWindow, this.lastBreadcrumb.window)) {\n const newBreadcrumb = {\n window: newBreadcrumbTraceWindow,\n child: null,\n };\n // To add a new Breadcrumb to the Breadcrumbs Linked List, set the child of last breadcrumb\n // to the new breadcrumb and update the last Breadcrumb\n this.lastBreadcrumb.child = newBreadcrumb;\n this.setLastBreadcrumb(newBreadcrumb);\n } else {\n throw new Error('Can not add a breadcrumb that is equal to or is outside of the parent breadcrumb TimeWindow');\n }\n }\n\n // Breadcumb should be within the bounds of the parent and can not have both start and end be equal to the parent\n isTraceWindowWithinTraceWindow(\n child: TraceEngine.Types.Timing.TraceWindowMicroSeconds,\n parent: TraceEngine.Types.Timing.TraceWindowMicroSeconds): boolean {\n return (child.min >= parent.min && child.max <= parent.max) &&\n !(child.min === parent.min && child.max === parent.max);\n }\n\n // Used to set an initial breadcrumbs from annotations loaded from a file\n setInitialBreadcrumbFromLoadedAnnotations(initialBreadcrumb: TraceEngine.Types.File.Breadcrumb): void {\n this.initialBreadcrumb = initialBreadcrumb;\n // Make last breadcrumb active\n let lastBreadcrumb = initialBreadcrumb;\n while (lastBreadcrumb.child !== null) {\n lastBreadcrumb = lastBreadcrumb.child;\n }\n this.setLastBreadcrumb(lastBreadcrumb);\n }\n\n setLastBreadcrumb(lastBreadcrumb: TraceEngine.Types.File.Breadcrumb): void {\n // When we assign a new active breadcrumb, both the minimap bounds and the visible\n // window get set to that breadcrumb's window.\n this.lastBreadcrumb = lastBreadcrumb;\n this.lastBreadcrumb.child = null;\n TraceBounds.TraceBounds.BoundsManager.instance().setMiniMapBounds(\n lastBreadcrumb.window,\n );\n TraceBounds.TraceBounds.BoundsManager.instance().setTimelineVisibleWindow(\n lastBreadcrumb.window,\n );\n }\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/BreadcrumbsUI.d.ts b/public/panels/timeline/components/BreadcrumbsUI.d.ts index 5d44511c9..c1b2f1013 100644 --- a/public/panels/timeline/components/BreadcrumbsUI.d.ts +++ b/public/panels/timeline/components/BreadcrumbsUI.d.ts @@ -1,11 +1,11 @@ -import { type Breadcrumb } from './Breadcrumbs.js'; +import * as TraceEngine from '../../../models/trace/trace.js'; export interface BreadcrumbsUIData { - breadcrumb: Breadcrumb; + breadcrumb: TraceEngine.Types.File.Breadcrumb; } export declare class BreadcrumbRemovedEvent extends Event { - breadcrumb: Breadcrumb; + breadcrumb: TraceEngine.Types.File.Breadcrumb; static readonly eventName = "breadcrumbremoved"; - constructor(breadcrumb: Breadcrumb); + constructor(breadcrumb: TraceEngine.Types.File.Breadcrumb); } export declare class BreadcrumbsUI extends HTMLElement { #private; diff --git a/public/panels/timeline/components/BreadcrumbsUI.js.map b/public/panels/timeline/components/BreadcrumbsUI.js.map index 4998eb1ca..4c933b88d 100644 --- a/public/panels/timeline/components/BreadcrumbsUI.js.map +++ b/public/panels/timeline/components/BreadcrumbsUI.js.map @@ -1 +1 @@ -{"version":3,"file":"BreadcrumbsUI.js","sourceRoot":"","sources":["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AK,CAAC,CAAC;YAChD,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI;;;YAGnC,UAAU,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC;YAC3B,IAAI,CAAA;eACD,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,UAAU;gBAC1C,QAAQ,EAAE,eAAe;gBACzB,KAAK,EAAE,qBAAqB;gBAC5B,KAAK,EAAE,MAAM;gBACb,MAAM,EAAE,MAAM;aACa,GAAG;YAChC,CAAC,CAAC,EAAE;OACT,CAAC;QACJ,kBAAkB;IACpB,CAAC;IAED,OAAO;QACL,mBAAmB;QACnB,MAAM,MAAM,GAAG,IAAI,CAAA;QACf,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;UACvC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;aACpG;KACR,CAAC;QACF,kBAAkB;QAClB,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;QAC3C,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC;YAC5B,uGAAuG;YACvG,IAAI,CAAC,0CAA0C,EAAE,CAAC;QACpD,CAAC;IACH,CAAC;;AAGH,cAAc,CAAC,MAAM,CAAC,yBAAyB,EAAE,aAAa,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as TraceEngine from '../../../models/trace/trace.js';\nimport * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';\nimport * as IconButton from '../../../ui/components/icon_button/icon_button.js';\nimport * as LitHtml from '../../../ui/lit-html/lit-html.js';\n\nimport {type Breadcrumb, flattenBreadcrumbs} from './Breadcrumbs.js';\nimport breadcrumbsUIStyles from './breadcrumbsUI.css.js';\n\nconst {render, html} = LitHtml;\n\nexport interface BreadcrumbsUIData {\n breadcrumb: Breadcrumb;\n}\n\nexport class BreadcrumbRemovedEvent extends Event {\n static readonly eventName = 'breadcrumbremoved';\n\n constructor(public breadcrumb: Breadcrumb) {\n super(BreadcrumbRemovedEvent.eventName);\n }\n}\n\nexport class BreadcrumbsUI extends HTMLElement {\n static readonly litTagName = LitHtml.literal`devtools-breadcrumbs-ui`;\n readonly #shadow = this.attachShadow({mode: 'open'});\n readonly #boundRender = this.#render.bind(this);\n #breadcrumb: Breadcrumb|null = null;\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [breadcrumbsUIStyles];\n }\n\n set data(data: BreadcrumbsUIData) {\n this.#breadcrumb = data.breadcrumb;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);\n }\n\n #removeBreadcrumb(breadcrumb: Breadcrumb): void {\n this.dispatchEvent(new BreadcrumbRemovedEvent(breadcrumb));\n }\n\n #showBreadcrumbsAndScrollLastCrumbIntoView(): void {\n const container = this.#shadow.querySelector('.breadcrumbs');\n if (!container) {\n return;\n }\n // Display Breadcrumbs after at least one was created\n container.style.display = 'flex';\n requestAnimationFrame(() => {\n // If the width of all the elements is greater than the width of the\n // container, we need to scroll the last element into view.\n if (container.scrollWidth - container.clientWidth > 0) {\n requestAnimationFrame(() => {\n // For some unknown reason, if we scroll after one rAF, the values\n // are slightly off by a few pixels which means that the element does\n // not get properly scrolled fully into view. Therefore we wait for a\n // second rAF, at which point the values are correct and this will\n // scroll the container fully to ensure the last breadcrumb is fully\n // visible.\n container.scrollLeft = container.scrollWidth - container.clientWidth;\n });\n }\n });\n }\n\n #renderElement(breadcrumb: Breadcrumb, index: number): LitHtml.LitTemplate {\n const breadcrumbRange = TraceEngine.Helpers.Timing.microSecondsToMilliseconds(breadcrumb.window.range);\n // clang-format off\n return html`\n
this.#removeBreadcrumb(breadcrumb)}>\n \n ${(index === 0) ?\n `Full range (${breadcrumbRange.toFixed(2)}ms)` :\n `${breadcrumbRange.toFixed(2)}ms`}\n \n
\n ${breadcrumb.child !== null ?\n html`\n <${IconButton.Icon.Icon.litTagName} .data=${{\n iconName: 'chevron-right',\n color: 'var(--icon-default)',\n width: '16px',\n height: '16px',\n } as IconButton.Icon.IconData}>`\n : ''}\n `;\n // clang-format on\n }\n\n #render(): void {\n // clang-format off\n const output = html`\n ${this.#breadcrumb === null ? html`` : html`
\n ${flattenBreadcrumbs(this.#breadcrumb).map((breadcrumb, index) => this.#renderElement(breadcrumb, index))}\n
`}\n `;\n // clang-format on\n render(output, this.#shadow, {host: this});\n if (this.#breadcrumb?.child) {\n // If we have >1 crumbs show breadcrumbs and ensure the last one is visible by scrolling the container.\n this.#showBreadcrumbsAndScrollLastCrumbIntoView();\n }\n }\n}\n\ncustomElements.define('devtools-breadcrumbs-ui', BreadcrumbsUI);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-breadcrumbs-ui': BreadcrumbsUI;\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"BreadcrumbsUI.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/BreadcrumbsUI.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,WAAW,MAAM,gCAAgC,CAAC;AAC9D,OAAO,KAAK,gBAAgB,MAAM,2CAA2C,CAAC;AAC9E,OAAO,KAAK,UAAU,MAAM,mDAAmD,CAAC;AAChF,OAAO,KAAK,OAAO,MAAM,kCAAkC,CAAC;AAE5D,OAAO,EAAC,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AACpD,OAAO,mBAAmB,MAAM,wBAAwB,CAAC;AAEzD,MAAM,EAAC,MAAM,EAAE,IAAI,EAAC,GAAG,OAAO,CAAC;AAM/B,MAAM,OAAO,s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K,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;UACvC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;aACpG;KACR,CAAC;QACF,kBAAkB;QAClB,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;QAC3C,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC;YAC5B,uGAAuG;YACvG,IAAI,CAAC,0CAA0C,EAAE,CAAC;QACpD,CAAC;IACH,CAAC;;AAGH,cAAc,CAAC,MAAM,CAAC,yBAAyB,EAAE,aAAa,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as TraceEngine from '../../../models/trace/trace.js';\nimport * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';\nimport * as IconButton from '../../../ui/components/icon_button/icon_button.js';\nimport * as LitHtml from '../../../ui/lit-html/lit-html.js';\n\nimport {flattenBreadcrumbs} from './Breadcrumbs.js';\nimport breadcrumbsUIStyles from './breadcrumbsUI.css.js';\n\nconst {render, html} = LitHtml;\n\nexport interface BreadcrumbsUIData {\n breadcrumb: TraceEngine.Types.File.Breadcrumb;\n}\n\nexport class BreadcrumbRemovedEvent extends Event {\n static readonly eventName = 'breadcrumbremoved';\n\n constructor(public breadcrumb: TraceEngine.Types.File.Breadcrumb) {\n super(BreadcrumbRemovedEvent.eventName);\n }\n}\n\nexport class BreadcrumbsUI extends HTMLElement {\n static readonly litTagName = LitHtml.literal`devtools-breadcrumbs-ui`;\n readonly #shadow = this.attachShadow({mode: 'open'});\n readonly #boundRender = this.#render.bind(this);\n #breadcrumb: TraceEngine.Types.File.Breadcrumb|null = null;\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [breadcrumbsUIStyles];\n }\n\n set data(data: BreadcrumbsUIData) {\n this.#breadcrumb = data.breadcrumb;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);\n }\n\n #removeBreadcrumb(breadcrumb: TraceEngine.Types.File.Breadcrumb): void {\n this.dispatchEvent(new BreadcrumbRemovedEvent(breadcrumb));\n }\n\n #showBreadcrumbsAndScrollLastCrumbIntoView(): void {\n const container = this.#shadow.querySelector('.breadcrumbs');\n if (!container) {\n return;\n }\n // Display Breadcrumbs after at least one was created\n container.style.display = 'flex';\n requestAnimationFrame(() => {\n // If the width of all the elements is greater than the width of the\n // container, we need to scroll the last element into view.\n if (container.scrollWidth - container.clientWidth > 0) {\n requestAnimationFrame(() => {\n // For some unknown reason, if we scroll after one rAF, the values\n // are slightly off by a few pixels which means that the element does\n // not get properly scrolled fully into view. Therefore we wait for a\n // second rAF, at which point the values are correct and this will\n // scroll the container fully to ensure the last breadcrumb is fully\n // visible.\n container.scrollLeft = container.scrollWidth - container.clientWidth;\n });\n }\n });\n }\n\n #renderElement(breadcrumb: TraceEngine.Types.File.Breadcrumb, index: number): LitHtml.LitTemplate {\n const breadcrumbRange = TraceEngine.Helpers.Timing.microSecondsToMilliseconds(breadcrumb.window.range);\n // clang-format off\n return html`\n
this.#removeBreadcrumb(breadcrumb)}>\n \n ${(index === 0) ?\n `Full range (${breadcrumbRange.toFixed(2)}ms)` :\n `${breadcrumbRange.toFixed(2)}ms`}\n \n
\n ${breadcrumb.child !== null ?\n html`\n <${IconButton.Icon.Icon.litTagName} .data=${{\n iconName: 'chevron-right',\n color: 'var(--icon-default)',\n width: '16px',\n height: '16px',\n } as IconButton.Icon.IconData}>`\n : ''}\n `;\n // clang-format on\n }\n\n #render(): void {\n // clang-format off\n const output = html`\n ${this.#breadcrumb === null ? html`` : html`
\n ${flattenBreadcrumbs(this.#breadcrumb).map((breadcrumb, index) => this.#renderElement(breadcrumb, index))}\n
`}\n `;\n // clang-format on\n render(output, this.#shadow, {host: this});\n if (this.#breadcrumb?.child) {\n // If we have >1 crumbs show breadcrumbs and ensure the last one is visible by scrolling the container.\n this.#showBreadcrumbsAndScrollLastCrumbIntoView();\n }\n }\n}\n\ncustomElements.define('devtools-breadcrumbs-ui', BreadcrumbsUI);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-breadcrumbs-ui': BreadcrumbsUI;\n }\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/BreadcrumbsUI.test.js.map b/public/panels/timeline/components/BreadcrumbsUI.test.js.map index a5593e724..615dc2f7e 100644 --- a/public/panels/timeline/components/BreadcrumbsUI.test.js.map +++ b/public/panels/timeline/components/BreadcrumbsUI.test.js.map @@ -1 +1 @@ -{"version":3,"file":"BreadcrumbsUI.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/BreadcrumbsUI.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,WAAW,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAC,gBAAgB,EAAE,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACtF,OAAO,KAAK,WAAW,MAAM,iEAAiE,CAAC;AAE/F,OAAO,KAAK,kBAAkB,MAAM,iBAAiB,CAAC;AAEtD,SAAS,YAAY,CAAC,CAAS;IAC7B,OAAO,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,0BAA0B,CACxD,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAC3C,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,MAAM,EAAC,aAAa,EAAC,GAAG,kBAAkB,CAAC,aAAa,CAAC;IAEzD,SAAS,gBAAgB,CAAC,SAAsB;QAC9C,gBAAgB,CAAC,SAAS,CAAC,UAAU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/E,MAAM,SAAS,GAAG,IAAI,aAAa,EAAE,CAAC;QACtC,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAEhC,MAAM,YAAY,GAAqD;YACrE,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC;YACpB,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC;YACpB,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC;SACvB,CAAC;QAEF,MAAM,WAAW,GAAqD;YACpE,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC;YACpB,GAAG,EAAE,YAAY,CAAC,EAAE,CAAC;YACrB,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC;SACvB,CAAC;QAEF,MAAM,WAAW,GAA8C;YAC7D,MAAM,EAAE,YAAY;YACpB,KAAK,EAAE,IAAI;SACZ,CAAC;QAEF,MAAM,UAAU,GAA8C;YAC5D,MAAM,EAAE,WAAW;YACnB,KAAK,EAAE,WAAW;SACnB,CAAC;QAEF,SAAS,CAAC,IAAI,GAAG,EAAC,UAAU,EAAC,CAAC;QAE9B,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;QAEzB,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAEtD,MAAM,CAAC,eAAe,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACpD,MAAM,CAAC,eAAe,CAAC,iBAAiB,EAAE,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC/E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as TraceEngine from '../../../models/trace/trace.js';\nimport {assertShadowRoot, renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as TimelineComponents from './components.js';\n\nfunction milliToMicro(x: number): TraceEngine.Types.Timing.MicroSeconds {\n return TraceEngine.Helpers.Timing.millisecondsToMicroseconds(\n TraceEngine.Types.Timing.MilliSeconds(x),\n );\n}\n\ndescribe('BreadcrumbsUI', () => {\n const {BreadcrumbsUI} = TimelineComponents.BreadcrumbsUI;\n\n function queryBreadcrumbs(component: HTMLElement): (string)[] {\n assertShadowRoot(component.shadowRoot);\n const breadcrumbsRanges = component.shadowRoot.querySelectorAll('.range');\n return Array.from(breadcrumbsRanges).map(row => {\n return row.textContent?.trim() || '';\n });\n }\n\n it('renders one breadcrumb', async () => {\n const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n const component = new BreadcrumbsUI();\n renderElementIntoDOM(component);\n\n const traceWindow: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: milliToMicro(1),\n max: milliToMicro(10),\n range: milliToMicro(9),\n };\n\n const breadcrumb: TimelineComponents.Breadcrumbs.Breadcrumb = {\n window: traceWindow,\n child: null,\n };\n\n component.data = {breadcrumb};\n\n await coordinator.done();\n\n const breadcrumbsRanges = queryBreadcrumbs(component);\n\n assert.deepStrictEqual(breadcrumbsRanges.length, 1);\n assert.deepStrictEqual(breadcrumbsRanges, ['Full range (9.00ms)']);\n });\n\n it('renders all the breadcrumbs provided', async () => {\n const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n const component = new BreadcrumbsUI();\n renderElementIntoDOM(component);\n\n const traceWindow2: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: milliToMicro(2),\n max: milliToMicro(9),\n range: milliToMicro(7),\n };\n\n const traceWindow: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: milliToMicro(1),\n max: milliToMicro(10),\n range: milliToMicro(9),\n };\n\n const breadcrumb2: TimelineComponents.Breadcrumbs.Breadcrumb = {\n window: traceWindow2,\n child: null,\n };\n\n const breadcrumb: TimelineComponents.Breadcrumbs.Breadcrumb = {\n window: traceWindow,\n child: breadcrumb2,\n };\n\n component.data = {breadcrumb};\n\n await coordinator.done();\n\n const breadcrumbsRanges = queryBreadcrumbs(component);\n\n assert.deepStrictEqual(breadcrumbsRanges.length, 2);\n assert.deepStrictEqual(breadcrumbsRanges, ['Full range (9.00ms)', '7.00ms']);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"BreadcrumbsUI.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/BreadcrumbsUI.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,WAAW,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAC,gBAAgB,EAAE,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACtF,OAAO,KAAK,WAAW,MAAM,iEAAiE,CAAC;AAE/F,OAAO,KAAK,kBAAkB,MAAM,iBAAiB,CAAC;AAEtD,SAAS,YAAY,CAAC,CAAS;IAC7B,OAAO,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,0BAA0B,CACxD,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAC3C,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,MAAM,EAAC,aAAa,EAAC,GAAG,kBAAkB,CAAC,aAAa,CAAC;IAEzD,SAAS,gBAAgB,CAAC,SAAsB;QAC9C,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACvC,MAAM,iBAAiB,GAAG,SAAS,CAAC,UAAU,CAAC,gBAAgB,CAAc,QAAQ,CAAC,CAAC;QACvF,OAAO,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YAC7C,OAAO,GAAG,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,EAAE,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE;QACtC,MAAM,WAAW,GAAG,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rB,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC;SACvB,CAAC;QAEF,MAAM,WAAW,GAAsC;YACrD,MAAM,EAAE,YAAY;YACpB,KAAK,EAAE,IAAI;SACZ,CAAC;QAEF,MAAM,UAAU,GAAsC;YACpD,MAAM,EAAE,WAAW;YACnB,KAAK,EAAE,WAAW;SACnB,CAAC;QAEF,SAAS,CAAC,IAAI,GAAG,EAAC,UAAU,EAAC,CAAC;QAE9B,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;QAEzB,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAEtD,MAAM,CAAC,eAAe,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACpD,MAAM,CAAC,eAAe,CAAC,iBAAiB,EAAE,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC/E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as TraceEngine from '../../../models/trace/trace.js';\nimport {assertShadowRoot, renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as TimelineComponents from './components.js';\n\nfunction milliToMicro(x: number): TraceEngine.Types.Timing.MicroSeconds {\n return TraceEngine.Helpers.Timing.millisecondsToMicroseconds(\n TraceEngine.Types.Timing.MilliSeconds(x),\n );\n}\n\ndescribe('BreadcrumbsUI', () => {\n const {BreadcrumbsUI} = TimelineComponents.BreadcrumbsUI;\n\n function queryBreadcrumbs(component: HTMLElement): (string)[] {\n assertShadowRoot(component.shadowRoot);\n const breadcrumbsRanges = component.shadowRoot.querySelectorAll('.range');\n return Array.from(breadcrumbsRanges).map(row => {\n return row.textContent?.trim() || '';\n });\n }\n\n it('renders one breadcrumb', async () => {\n const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n const component = new BreadcrumbsUI();\n renderElementIntoDOM(component);\n\n const traceWindow: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: milliToMicro(1),\n max: milliToMicro(10),\n range: milliToMicro(9),\n };\n\n const breadcrumb: TraceEngine.Types.File.Breadcrumb = {\n window: traceWindow,\n child: null,\n };\n\n component.data = {breadcrumb};\n\n await coordinator.done();\n\n const breadcrumbsRanges = queryBreadcrumbs(component);\n\n assert.deepStrictEqual(breadcrumbsRanges.length, 1);\n assert.deepStrictEqual(breadcrumbsRanges, ['Full range (9.00ms)']);\n });\n\n it('renders all the breadcrumbs provided', async () => {\n const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n const component = new BreadcrumbsUI();\n renderElementIntoDOM(component);\n\n const traceWindow2: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: milliToMicro(2),\n max: milliToMicro(9),\n range: milliToMicro(7),\n };\n\n const traceWindow: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: milliToMicro(1),\n max: milliToMicro(10),\n range: milliToMicro(9),\n };\n\n const breadcrumb2: TraceEngine.Types.File.Breadcrumb = {\n window: traceWindow2,\n child: null,\n };\n\n const breadcrumb: TraceEngine.Types.File.Breadcrumb = {\n window: traceWindow,\n child: breadcrumb2,\n };\n\n component.data = {breadcrumb};\n\n await coordinator.done();\n\n const breadcrumbsRanges = queryBreadcrumbs(component);\n\n assert.deepStrictEqual(breadcrumbsRanges.length, 2);\n assert.deepStrictEqual(breadcrumbsRanges, ['Full range (9.00ms)', '7.00ms']);\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/InteractionBreakdown.js b/public/panels/timeline/components/InteractionBreakdown.js index 6a5301912..e4ddb23be 100644 --- a/public/panels/timeline/components/InteractionBreakdown.js +++ b/public/panels/timeline/components/InteractionBreakdown.js @@ -12,9 +12,9 @@ const UIStrings = { */ inputDelay: 'Input delay', /** - *@description Text shown next to the interaction event's thread processing time in the detail view. + *@description Text shown next to the interaction event's thread processing duration in the detail view. */ - processingTime: 'Processing time', + processingDuration: 'Processing duration', /** *@description Text shown next to the interaction event's presentation delay time in the detail view. */ @@ -46,7 +46,7 @@ export class InteractionBreakdown extends HTMLElement { const presentationDelay = TraceEngine.Helpers.Timing.formatMicrosecondsTime(this.#entry.presentationDelay); LitHtml.render(LitHtml.html `
  • ${i18nString(UIStrings.inputDelay)}${inputDelay}
  • -
  • ${i18nString(UIStrings.processingTime)}${mainThreadTime}
  • +
  • ${i18nString(UIStrings.processingDuration)}${mainThreadTime}
  • ${i18nString(UIStrings.presentationDelay)}${presentationDelay}
`, this.#shadow, { host: this }); diff --git a/public/panels/timeline/components/InteractionBreakdown.js.map b/public/panels/timeline/components/InteractionBreakdown.js.map index 04d0876cb..e0cb7966e 100644 --- a/public/panels/timeline/components/InteractionBreakdown.js.map +++ b/public/panels/timeline/components/InteractionBreakdown.js.map @@ -1 +1 @@ -{"version":3,"file":"InteractionBreakdown.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/InteractionBreakdown.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAC7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,WAAW,MAAM,gCAAgC,CAAC;AAC9D,OAAO,KAAK,gBAAgB,MAAM,2CAA2C,CAAC;AAC9E,OAAO,KAAK,OAAO,MAAM,kCAAkC,CAAC;AAE5D,OAAO,MAAM,MAAM,+BAA+B,CAAC;AAEnD,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,UAAU,EAAE,aAAa;IACzB;;OAEG;IACH,cAAc,EAAE,iBAAiB;IACjC;;OAEG;IACH,iBAAiB,EAAE,oBAAoB;CACxC,CAAC;AACF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,oDAAoD,EAAE,SAAS,CAAC,CAAC;AAC1G,MAAM,UAAU,GAAG,IAAI,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C,SAAS,CAAC,UAAU,CAAC,uBACxE,UAAU;wDACkC,UAAU,CAAC,SAAS,CAAC,cAAc,CAAC,uBAChF,cAAc;2DAEd,UAAU,CAAC,SAAS,CAAC,iBAAiB,CAAC,uBAAuB,iBAAiB;;oBAEvE,EACZ,IAAI,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;IAClC,CAAC;;AAGH,cAAc,CAAC,MAAM,CAAC,gCAAgC,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport * as TraceEngine from '../../../models/trace/trace.js';\nimport * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';\nimport * as LitHtml from '../../../ui/lit-html/lit-html.js';\n\nimport styles from './interactionBreakdown.css.js';\n\nconst UIStrings = {\n /**\n *@description Text shown next to the interaction event's input delay time in the detail view.\n */\n inputDelay: 'Input delay',\n /**\n *@description Text shown next to the interaction event's thread processing time in the detail view.\n */\n processingTime: 'Processing time',\n /**\n *@description Text shown next to the interaction event's presentation delay time in the detail view.\n */\n presentationDelay: 'Presentation delay',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/InteractionBreakdown.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class InteractionBreakdown extends HTMLElement {\n static readonly litTagName = LitHtml.literal`devtools-interaction-breakdown`;\n readonly #shadow = this.attachShadow({mode: 'open'});\n readonly #boundRender = this.#render.bind(this);\n #entry: TraceEngine.Types.TraceEvents.SyntheticInteractionPair|null = null;\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [styles];\n }\n\n set entry(entry: TraceEngine.Types.TraceEvents.SyntheticInteractionPair) {\n if (entry === this.#entry) {\n return;\n }\n this.#entry = entry;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);\n }\n\n #render(): void {\n if (!this.#entry) {\n return;\n }\n const inputDelay = TraceEngine.Helpers.Timing.formatMicrosecondsTime(this.#entry.inputDelay);\n const mainThreadTime = TraceEngine.Helpers.Timing.formatMicrosecondsTime(this.#entry.mainThreadHandling);\n const presentationDelay = TraceEngine.Helpers.Timing.formatMicrosecondsTime(this.#entry.presentationDelay);\n LitHtml.render(\n LitHtml.html`
    \n
  • ${i18nString(UIStrings.inputDelay)}${\n inputDelay}
  • \n
  • ${i18nString(UIStrings.processingTime)}${\n mainThreadTime}
  • \n
  • ${\n i18nString(UIStrings.presentationDelay)}${presentationDelay}
  • \n
\n `,\n this.#shadow, {host: this});\n }\n}\n\ncustomElements.define('devtools-interaction-breakdown', InteractionBreakdown);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-interaction-breakdown': InteractionBreakdown;\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"InteractionBreakdown.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/InteractionBreakdown.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAC7B,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AACnD,OAAO,KAAK,WAAW,MAAM,gCAAgC,CAAC;AAC9D,OAAO,KAAK,gBAAgB,MAAM,2CAA2C,CAAC;AAC9E,OAAO,KAAK,OAAO,MAAM,kCAAkC,CAAC;AAE5D,OAAO,MAAM,MAAM,+BAA+B,CAAC;AAEnD,MAAM,SAAS,GAAG;IAChB;;OAEG;IACH,UAAU,EAAE,aAAa;IACzB;;OAEG;IACH,kBAAkB,EAAE,qBAAqB;IACzC;;OAEG;IACH,iBAAiB,EAAE,oBAAoB;CACxC,CAAC;AACF,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,oDAAoD,EAAE,SAAS,CAAC,CAAC;AAC1G,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,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,UAAU;4DAEV,UAAU,CAAC,SAAS,CAAC,kBAAkB,CAAC,uBAAuB,cAAc;2DAE7E,UAAU,CAAC,SAAS,CAAC,iBAAiB,CAAC,uBAAuB,iBAAiB;;oBAEvE,EACZ,IAAI,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;IAClC,CAAC;;AAGH,cAAc,CAAC,MAAM,CAAC,gCAAgC,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\nimport * as i18n from '../../../core/i18n/i18n.js';\nimport * as TraceEngine from '../../../models/trace/trace.js';\nimport * as ComponentHelpers from '../../../ui/components/helpers/helpers.js';\nimport * as LitHtml from '../../../ui/lit-html/lit-html.js';\n\nimport styles from './interactionBreakdown.css.js';\n\nconst UIStrings = {\n /**\n *@description Text shown next to the interaction event's input delay time in the detail view.\n */\n inputDelay: 'Input delay',\n /**\n *@description Text shown next to the interaction event's thread processing duration in the detail view.\n */\n processingDuration: 'Processing duration',\n /**\n *@description Text shown next to the interaction event's presentation delay time in the detail view.\n */\n presentationDelay: 'Presentation delay',\n};\nconst str_ = i18n.i18n.registerUIStrings('panels/timeline/components/InteractionBreakdown.ts', UIStrings);\nconst i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);\n\nexport class InteractionBreakdown extends HTMLElement {\n static readonly litTagName = LitHtml.literal`devtools-interaction-breakdown`;\n readonly #shadow = this.attachShadow({mode: 'open'});\n readonly #boundRender = this.#render.bind(this);\n #entry: TraceEngine.Types.TraceEvents.SyntheticInteractionPair|null = null;\n\n connectedCallback(): void {\n this.#shadow.adoptedStyleSheets = [styles];\n }\n\n set entry(entry: TraceEngine.Types.TraceEvents.SyntheticInteractionPair) {\n if (entry === this.#entry) {\n return;\n }\n this.#entry = entry;\n void ComponentHelpers.ScheduledRender.scheduleRender(this, this.#boundRender);\n }\n\n #render(): void {\n if (!this.#entry) {\n return;\n }\n const inputDelay = TraceEngine.Helpers.Timing.formatMicrosecondsTime(this.#entry.inputDelay);\n const mainThreadTime = TraceEngine.Helpers.Timing.formatMicrosecondsTime(this.#entry.mainThreadHandling);\n const presentationDelay = TraceEngine.Helpers.Timing.formatMicrosecondsTime(this.#entry.presentationDelay);\n LitHtml.render(\n LitHtml.html`
    \n
  • ${i18nString(UIStrings.inputDelay)}${\n inputDelay}
  • \n
  • ${\n i18nString(UIStrings.processingDuration)}${mainThreadTime}
  • \n
  • ${\n i18nString(UIStrings.presentationDelay)}${presentationDelay}
  • \n
\n `,\n this.#shadow, {host: this});\n }\n}\n\ncustomElements.define('devtools-interaction-breakdown', InteractionBreakdown);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'devtools-interaction-breakdown': InteractionBreakdown;\n }\n}\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/InteractionBreakdown.test.js b/public/panels/timeline/components/InteractionBreakdown.test.js index aaf0554f1..1095c6c7f 100644 --- a/public/panels/timeline/components/InteractionBreakdown.test.js +++ b/public/panels/timeline/components/InteractionBreakdown.test.js @@ -22,8 +22,8 @@ describeWithEnvironment('InteractionBreakdown', () => { assertShadowRoot(breakdown.shadowRoot); const inputDelay = breakdown.shadowRoot.querySelector('[data-entry="input-delay"] .value')?.textContent; assert.strictEqual(inputDelay, '1ms'); - const processingTime = breakdown.shadowRoot.querySelector('[data-entry="processing-time"] .value')?.textContent; - assert.strictEqual(processingTime, '977ms'); + const processingDuration = breakdown.shadowRoot.querySelector('[data-entry="processing-duration"] .value')?.textContent; + assert.strictEqual(processingDuration, '977ms'); const presentationDelay = breakdown.shadowRoot.querySelector('[data-entry="presentation-delay"] .value')?.textContent; assert.strictEqual(presentationDelay, '1.974ms'); }); diff --git a/public/panels/timeline/components/InteractionBreakdown.test.js.map b/public/panels/timeline/components/InteractionBreakdown.test.js.map index 3e4fcc9ef..aac09af41 100644 --- a/public/panels/timeline/components/InteractionBreakdown.test.js.map +++ b/public/panels/timeline/components/InteractionBreakdown.test.js.map @@ -1 +1 @@ -{"version":3,"file":"InteractionBreakdown.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/InteractionBreakdown.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EAAC,gBAAgB,EAAE,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACtF,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,WAAW,MAAM,iEAAiE,CAAC;AAE/F,OAAO,KAAK,kBAAkB,MAAM,iBAAiB,CAAC;AAEtD,uBAAuB,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACnD,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;IAC/E,MAAM,EAAC,oBAAoB,EAAC,GAAG,kBAAkB,CAAC,oBAAoB,CAAC;IAEvE,EAAE,CAAC,oDAAoD,EAAE,KAAK;QAC5D,MAAM,SAAS,GAAG,MAAM,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE,gCAAgC,CAAC,CAAC;QACxF,MAAM,eAAe,GAAG,SAAS,CAAC,gBAAgB,CAAC,uBAAuB,CAAC;QAC3E,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACxD,CAAC;QAED,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAC7C,SAAS,CAAC,KAAK,GAAG,eAAe,CAAC;QAClC,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAChC,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;QACzB,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAEvC,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,mCAAmC,CAAC,EAAE,WAAW,CAAC;QACxG,MAAM,CAAC,WAAW,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QACtC,MAAM,cAAc,GAAG,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,uCAAuC,CAAC,EAAE,WAAW,CAAC;QAChH,MAAM,CAAC,WAAW,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QAC5C,MAAM,iBAAiB,GACnB,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,0CAA0C,CAAC,EAAE,WAAW,CAAC;QAChG,MAAM,CAAC,WAAW,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {assertShadowRoot, renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as TimelineComponents from './components.js';\n\ndescribeWithEnvironment('InteractionBreakdown', () => {\n const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n const {InteractionBreakdown} = TimelineComponents.InteractionBreakdown;\n\n it('renders the breakdowns for an InteractionBreakdown', async function() {\n const traceData = await TraceLoader.traceEngine(this, 'one-second-interaction.json.gz');\n const longInteraction = traceData.UserInteractions.longestInteractionEvent;\n if (!longInteraction) {\n throw new Error('Could not find longest interaction');\n }\n\n const breakdown = new InteractionBreakdown();\n breakdown.entry = longInteraction;\n renderElementIntoDOM(breakdown);\n await coordinator.done();\n assertShadowRoot(breakdown.shadowRoot);\n\n const inputDelay = breakdown.shadowRoot.querySelector('[data-entry=\"input-delay\"] .value')?.textContent;\n assert.strictEqual(inputDelay, '1ms');\n const processingTime = breakdown.shadowRoot.querySelector('[data-entry=\"processing-time\"] .value')?.textContent;\n assert.strictEqual(processingTime, '977ms');\n const presentationDelay =\n breakdown.shadowRoot.querySelector('[data-entry=\"presentation-delay\"] .value')?.textContent;\n assert.strictEqual(presentationDelay, '1.974ms');\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"InteractionBreakdown.test.js","sourceRoot":"","sources":["../../../../../../../front_end/panels/timeline/components/InteractionBreakdown.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,EAAC,gBAAgB,EAAE,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACtF,OAAO,EAAC,uBAAuB,EAAC,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,WAAW,MAAM,iEAAiE,CAAC;AAE/F,OAAO,KAAK,kBAAkB,MAAM,iBAAiB,CAAC;AAEtD,uBAAuB,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACnD,MAAM,WAAW,GAAG,WAAW,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;IAC/E,MAAM,EAAC,oBAAoB,EAAC,GAAG,kBAAkB,CAAC,oBAAoB,CAAC;IAEvE,EAAE,CAAC,oDAAoD,EAAE,KAAK;QAC5D,MAAM,SAAS,GAAG,MAAM,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE,gCAAgC,CAAC,CAAC;QACxF,MAAM,eAAe,GAAG,SAAS,CAAC,gBAAgB,CAAC,uBAAuB,CAAC;QAC3E,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACxD,CAAC;QAED,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAC7C,SAAS,CAAC,KAAK,GAAG,eAAe,CAAC;QAClC,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAChC,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;QACzB,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAEvC,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,mCAAmC,CAAC,EAAE,WAAW,CAAC;QACxG,MAAM,CAAC,WAAW,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QACtC,MAAM,kBAAkB,GACpB,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,2CAA2C,CAAC,EAAE,WAAW,CAAC;QACjG,MAAM,CAAC,WAAW,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;QAChD,MAAM,iBAAiB,GACnB,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,0CAA0C,CAAC,EAAE,WAAW,CAAC;QAChG,MAAM,CAAC,WAAW,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport {assertShadowRoot, renderElementIntoDOM} from '../../../testing/DOMHelpers.js';\nimport {describeWithEnvironment} from '../../../testing/EnvironmentHelpers.js';\nimport {TraceLoader} from '../../../testing/TraceLoader.js';\nimport * as Coordinator from '../../../ui/components/render_coordinator/render_coordinator.js';\n\nimport * as TimelineComponents from './components.js';\n\ndescribeWithEnvironment('InteractionBreakdown', () => {\n const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();\n const {InteractionBreakdown} = TimelineComponents.InteractionBreakdown;\n\n it('renders the breakdowns for an InteractionBreakdown', async function() {\n const traceData = await TraceLoader.traceEngine(this, 'one-second-interaction.json.gz');\n const longInteraction = traceData.UserInteractions.longestInteractionEvent;\n if (!longInteraction) {\n throw new Error('Could not find longest interaction');\n }\n\n const breakdown = new InteractionBreakdown();\n breakdown.entry = longInteraction;\n renderElementIntoDOM(breakdown);\n await coordinator.done();\n assertShadowRoot(breakdown.shadowRoot);\n\n const inputDelay = breakdown.shadowRoot.querySelector('[data-entry=\"input-delay\"] .value')?.textContent;\n assert.strictEqual(inputDelay, '1ms');\n const processingDuration =\n breakdown.shadowRoot.querySelector('[data-entry=\"processing-duration\"] .value')?.textContent;\n assert.strictEqual(processingDuration, '977ms');\n const presentationDelay =\n breakdown.shadowRoot.querySelector('[data-entry=\"presentation-delay\"] .value')?.textContent;\n assert.strictEqual(presentationDelay, '1.974ms');\n });\n});\n"]} \ No newline at end of file diff --git a/public/panels/timeline/components/components-tsconfig.json b/public/panels/timeline/components/components-tsconfig.json index d9e40eb53..cef04c273 100644 --- a/public/panels/timeline/components/components-tsconfig.json +++ b/public/panels/timeline/components/components-tsconfig.json @@ -48,6 +48,9 @@ { "path": "../../../models/trace/bundle-tsconfig.json" }, + { + "path": "../../../services/trace_bounds/bundle-tsconfig.json" + }, { "path": "../../../ui/components/helpers/bundle-tsconfig.json" }, diff --git a/public/services/annotations_manager/AnnotationsManager.d.ts b/public/services/annotations_manager/AnnotationsManager.d.ts index a434d7d4d..c462f7309 100644 --- a/public/services/annotations_manager/AnnotationsManager.d.ts +++ b/public/services/annotations_manager/AnnotationsManager.d.ts @@ -1,13 +1,27 @@ import * as TraceEngine from '../../models/trace/trace.js'; +import * as TimelineComponents from '../../panels/timeline/components/components.js'; +type EntryToNodeMap = Map; export declare class AnnotationsManager { - static instance(opts?: { - forceNew: boolean | null; - }): AnnotationsManager; + #private; + /** + * A new instance is create each time a trace is recorded or loaded from a file. + * Both entryToNodeMap and wholeTraceBounds are mandatory to support all annotations and if one of them + * is not present, something has gone wrong so let's load the trace without the annotations support. + **/ + static maybeInstance(opts?: { + entryToNodeMap: EntryToNodeMap | null; + wholeTraceBounds: TraceEngine.Types.Timing.TraceWindowMicroSeconds | null | undefined; + }): AnnotationsManager | null; static removeInstance(): void; private constructor(); + getEntriesFilter(): TraceEngine.EntriesFilter.EntriesFilter; + getTimelineBreadcrumbs(): TimelineComponents.Breadcrumbs.Breadcrumbs; + getEntryIndex(entry: TraceEngine.Types.TraceEvents.SyntheticTraceEntry): number; /** * Builds all annotations and returns the object written into the 'annotations' trace file metada field. */ getAnnotations(): TraceEngine.Types.File.Annotations; - generateTraceEntryHash(entry: TraceEngine.Types.TraceEvents.SyntheticTraceEntry): string; + applyAnnotations(annotations: TraceEngine.Types.File.Annotations): void; + applyEntriesFilterAnnotations(hiddenEntriesIndexes: number[], modifiedEntriesIndexes: number[]): void; } +export {}; diff --git a/public/services/annotations_manager/AnnotationsManager.js b/public/services/annotations_manager/AnnotationsManager.js index c665ee1fd..fe31b29ff 100644 --- a/public/services/annotations_manager/AnnotationsManager.js +++ b/public/services/annotations_manager/AnnotationsManager.js @@ -2,44 +2,91 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import * as TraceEngine from '../../models/trace/trace.js'; +import * as TimelineComponents from '../../panels/timeline/components/components.js'; let instance = null; export class AnnotationsManager { - static instance(opts = { forceNew: null }) { - const forceNew = Boolean(opts.forceNew); - if (!instance || forceNew) { - instance = new AnnotationsManager(); + /** + * An Array with all trace entries. + * We save annotations into the trace file by saving their id in the allEntries Array. + **/ + #allEntries; + #entriesFilter; + #timelineBreadcrumbs; + /** + * A new instance is create each time a trace is recorded or loaded from a file. + * Both entryToNodeMap and wholeTraceBounds are mandatory to support all annotations and if one of them + * is not present, something has gone wrong so let's load the trace without the annotations support. + **/ + static maybeInstance(opts = { entryToNodeMap: null, wholeTraceBounds: null }) { + if (opts.entryToNodeMap && opts.wholeTraceBounds) { + instance = new AnnotationsManager(opts.entryToNodeMap, opts.wholeTraceBounds); } return instance; } static removeInstance() { instance = null; } - constructor() { + constructor(entryToNodeMap, wholeTraceBounds) { + this.#entriesFilter = new TraceEngine.EntriesFilter.EntriesFilter(entryToNodeMap); + this.#timelineBreadcrumbs = new TimelineComponents.Breadcrumbs.Breadcrumbs(wholeTraceBounds); + this.#allEntries = Array.from(entryToNodeMap.keys()); + } + getEntriesFilter() { + return this.#entriesFilter; + } + getTimelineBreadcrumbs() { + return this.#timelineBreadcrumbs; + } + getEntryIndex(entry) { + return this.#allEntries.indexOf(entry); } /** * Builds all annotations and returns the object written into the 'annotations' trace file metada field. */ getAnnotations() { - const hashesOfSynteticEntries = []; - const hiddenEntries = TraceEngine.EntriesFilter.EntriesFilter.maybeInstance()?.invisibleEntries(); + const indexesOfSynteticEntries = []; + const hiddenEntries = this.#entriesFilter.invisibleEntries(); if (hiddenEntries) { for (const entry of hiddenEntries) { - if (!TraceEngine.Types.TraceEvents.isProfileCall(entry)) { - hashesOfSynteticEntries.push(this.generateTraceEntryHash(entry)); - } + indexesOfSynteticEntries.push(this.getEntryIndex(entry)); + } + } + const indexesOfModifiedEntries = []; + const modifiedEntries = this.#entriesFilter.modifiedEntries(); + if (modifiedEntries) { + for (const entry of modifiedEntries) { + indexesOfModifiedEntries.push(this.getEntryIndex(entry)); } } return { - hiddenRendererEventsHashes: hashesOfSynteticEntries, - hiddenProfileCallsSampleIndexes: [], - hiddenProfileCallsDepths: [], + entriesFilterAnnotations: { + hiddenEntriesIndexes: indexesOfSynteticEntries, + modifiedEntriesIndexes: indexesOfModifiedEntries, + }, + initialBreadcrumb: this.#timelineBreadcrumbs.initialBreadcrumb, }; } - generateTraceEntryHash(entry) { - if (!TraceEngine.Types.TraceEvents.isProfileCall(entry)) { - return `${entry.cat},${entry.name},${entry.ph},${entry.pid},${entry.tid},${entry.ts},${entry.tts}`; - } - return ''; + applyAnnotations(annotations) { + this.applyEntriesFilterAnnotations(annotations.entriesFilterAnnotations.hiddenEntriesIndexes, annotations.entriesFilterAnnotations.modifiedEntriesIndexes); + this.#timelineBreadcrumbs.setInitialBreadcrumbFromLoadedAnnotations(annotations.initialBreadcrumb); + } + applyEntriesFilterAnnotations(hiddenEntriesIndexes, modifiedEntriesIndexes) { + // Build the hidden events array by getting the entries by their index in the allEntries array. + const hiddenEntries = []; + hiddenEntriesIndexes.map(hiddenEntryHash => { + const hiddenEntry = this.#allEntries[hiddenEntryHash]; + if (hiddenEntry) { + hiddenEntries.push(hiddenEntry); + } + }); + const modifiedEntries = []; + modifiedEntriesIndexes.map(hiddenEntryHash => { + const modifiedEntry = this.#allEntries[hiddenEntryHash]; + if (modifiedEntry) { + modifiedEntries.push(modifiedEntry); + } + }); + this.#entriesFilter.setInvisibleAndModifiedEntries(hiddenEntries, modifiedEntries); } } //# sourceMappingURL=AnnotationsManager.js.map \ No newline at end of file diff --git a/public/services/annotations_manager/AnnotationsManager.js.map b/public/services/annotations_manager/AnnotationsManager.js.map index 791d75e6f..d550f14d8 100644 --- a/public/services/annotations_manager/AnnotationsManager.js.map +++ b/public/services/annotations_manager/AnnotationsManager.js.map @@ -1 +1 @@ -{"version":3,"file":"AnnotationsManager.js","sourceRoot":"","sources":["../../../../../../front_end/services/annotations_manager/AnnotationsManager.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAE3D,IAAI,QAAQ,GAA4B,IAAI,CAAC;AAE7C,MAAM,OAAO,kBAAkB;IAC7B,MAAM,CAAC,QAAQ,CAAC,OAEZ,EAAC,QAAQ,EAAE,IAAI,EAAC;QAClB,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACxC,IAAI,CAAC,QAAQ,IAAI,QAAQ,EAAE,CAAC;YAC1B,QAAQ,GAAG,IAAI,kBAAkB,EAAE,CAAC;QACtC,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,CAAC,cAAc;QACnB,QAAQ,GAAG,IAAI,CAAC;IAClB,CAAC;IACD;IACA,CAAC;IAED;;OAEG;IACH,cAAc;QACZ,MAAM,uBAAuB,GAAa,EAAE,CAAC;QAC7C,MAAM,aAAa,GAAG,WAAW,CAAC,aAAa,CAAC,aAAa,CAAC,aAAa,EAAE,EAAE,gBAAgB,EAAE,CAAC;QAClG,IAAI,aAAa,EAAE,CAAC;YAClB,KAAK,MAAM,KAAK,IAAI,aAAa,EAAE,CAAC;gBAClC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;oBACxD,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;gBACnE,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO;YACL,0BAA0B,EAAE,uBAAuB;YACnD,+BAA+B,EAAE,EAAE;YACnC,wBAAwB,EAAE,EAAE;SAC7B,CAAC;IACJ,CAAC;IAED,sBAAsB,CAAC,KAAwD;QAC7E,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;YACxD,OAAO,GAAG,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,EAAE,IAAI,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,EAAE,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC;QACrG,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;CACF","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as TraceEngine from '../../models/trace/trace.js';\n\nlet instance: AnnotationsManager|null = null;\n\nexport class AnnotationsManager {\n static instance(opts: {\n forceNew: boolean|null,\n } = {forceNew: null}): AnnotationsManager {\n const forceNew = Boolean(opts.forceNew);\n if (!instance || forceNew) {\n instance = new AnnotationsManager();\n }\n return instance;\n }\n\n static removeInstance(): void {\n instance = null;\n }\n private constructor() {\n }\n\n /**\n * Builds all annotations and returns the object written into the 'annotations' trace file metada field.\n */\n getAnnotations(): TraceEngine.Types.File.Annotations {\n const hashesOfSynteticEntries: string[] = [];\n const hiddenEntries = TraceEngine.EntriesFilter.EntriesFilter.maybeInstance()?.invisibleEntries();\n if (hiddenEntries) {\n for (const entry of hiddenEntries) {\n if (!TraceEngine.Types.TraceEvents.isProfileCall(entry)) {\n hashesOfSynteticEntries.push(this.generateTraceEntryHash(entry));\n }\n }\n }\n\n return {\n hiddenRendererEventsHashes: hashesOfSynteticEntries,\n hiddenProfileCallsSampleIndexes: [],\n hiddenProfileCallsDepths: [],\n };\n }\n\n generateTraceEntryHash(entry: TraceEngine.Types.TraceEvents.SyntheticTraceEntry): string {\n if (!TraceEngine.Types.TraceEvents.isProfileCall(entry)) {\n return `${entry.cat},${entry.name},${entry.ph},${entry.pid},${entry.tid},${entry.ts},${entry.tts}`;\n }\n return '';\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"AnnotationsManager.js","sourceRoot":"","sources":["../../../../../../front_end/services/annotations_manager/AnnotationsManager.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,kBAAkB,MAAM,gDAAgD,CAAC;AAErF,IAAI,QAAQ,GAA4B,IAAI,CAAC;AAI7C,MAAM,OAAO,kBAAkB;IAC7B;;;QAGI;IACJ,WAAW,CAAsD;IACjE,cAAc,CAA0C;IACxD,oBAAoB,CAA6C;IAEjE;;;;QAII;IACJ,MAAM,CAAC,aAAa,CAAC,OAGjB,EAAC,cAAc,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAC;QAChD,IAAI,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACjD,QAAQ,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAChF,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,CAAC,cAAc;QACnB,QAAQ,GAAG,IAAI,CAAC;IAClB,CAAC;I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EAAE,wBAAwB;aACjD;YACD,iBAAiB,EAAE,IAAI,CAAC,oBAAoB,CAAC,iBAAiB;SAC/D,CAAC;IACJ,CAAC;IAED,gBAAgB,CAAC,WAA+C;QAC9D,IAAI,CAAC,6BAA6B,CAC9B,WAAW,CAAC,wBAAwB,CAAC,oBAAoB,EACzD,WAAW,CAAC,wBAAwB,CAAC,sBAAsB,CAAC,CAAC;QACjE,IAAI,CAAC,oBAAoB,CAAC,yCAAyC,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IACrG,CAAC;IAED,6BAA6B,CAAC,oBAA8B,EAAE,sBAAgC;QAC5F,+FAA+F;QAC/F,MAAM,aAAa,GAAwD,EAAE,CAAC;QAC9E,oBAAoB,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE;YACzC,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;YACtD,IAAI,WAAW,EAAE,CAAC;gBAChB,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAClC,CAAC;QACH,CAAC,CAAC,CAAC;QACH,MAAM,eAAe,GAAwD,EAAE,CAAC;QAChF,sBAAsB,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE;YAC3C,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;YACxD,IAAI,aAAa,EAAE,CAAC;gBAClB,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YACtC,CAAC;QACH,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,cAAc,CAAC,8BAA8B,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;IACrF,CAAC;CACF","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as TraceEngine from '../../models/trace/trace.js';\nimport * as TimelineComponents from '../../panels/timeline/components/components.js';\n\nlet instance: AnnotationsManager|null = null;\ntype EntryToNodeMap =\n Map;\n\nexport class AnnotationsManager {\n /**\n * An Array with all trace entries.\n * We save annotations into the trace file by saving their id in the allEntries Array.\n **/\n #allEntries: TraceEngine.Types.TraceEvents.SyntheticTraceEntry[];\n #entriesFilter: TraceEngine.EntriesFilter.EntriesFilter;\n #timelineBreadcrumbs: TimelineComponents.Breadcrumbs.Breadcrumbs;\n\n /**\n * A new instance is create each time a trace is recorded or loaded from a file.\n * Both entryToNodeMap and wholeTraceBounds are mandatory to support all annotations and if one of them\n * is not present, something has gone wrong so let's load the trace without the annotations support.\n **/\n static maybeInstance(opts: {\n entryToNodeMap: EntryToNodeMap|null,\n wholeTraceBounds: TraceEngine.Types.Timing.TraceWindowMicroSeconds|null|undefined,\n } = {entryToNodeMap: null, wholeTraceBounds: null}): AnnotationsManager|null {\n if (opts.entryToNodeMap && opts.wholeTraceBounds) {\n instance = new AnnotationsManager(opts.entryToNodeMap, opts.wholeTraceBounds);\n }\n return instance;\n }\n\n static removeInstance(): void {\n instance = null;\n }\n\n private constructor(\n entryToNodeMap: EntryToNodeMap, wholeTraceBounds: TraceEngine.Types.Timing.TraceWindowMicroSeconds) {\n this.#entriesFilter = new TraceEngine.EntriesFilter.EntriesFilter(entryToNodeMap);\n this.#timelineBreadcrumbs = new TimelineComponents.Breadcrumbs.Breadcrumbs(wholeTraceBounds);\n this.#allEntries = Array.from(entryToNodeMap.keys());\n }\n\n getEntriesFilter(): TraceEngine.EntriesFilter.EntriesFilter {\n return this.#entriesFilter;\n }\n\n getTimelineBreadcrumbs(): TimelineComponents.Breadcrumbs.Breadcrumbs {\n return this.#timelineBreadcrumbs;\n }\n\n getEntryIndex(entry: TraceEngine.Types.TraceEvents.SyntheticTraceEntry): number {\n return this.#allEntries.indexOf(entry);\n }\n\n /**\n * Builds all annotations and returns the object written into the 'annotations' trace file metada field.\n */\n getAnnotations(): TraceEngine.Types.File.Annotations {\n const indexesOfSynteticEntries: number[] = [];\n const hiddenEntries = this.#entriesFilter.invisibleEntries();\n if (hiddenEntries) {\n for (const entry of hiddenEntries) {\n indexesOfSynteticEntries.push(this.getEntryIndex(entry));\n }\n }\n\n const indexesOfModifiedEntries: number[] = [];\n const modifiedEntries = this.#entriesFilter.modifiedEntries();\n if (modifiedEntries) {\n for (const entry of modifiedEntries) {\n indexesOfModifiedEntries.push(this.getEntryIndex(entry));\n }\n }\n\n return {\n entriesFilterAnnotations: {\n hiddenEntriesIndexes: indexesOfSynteticEntries,\n modifiedEntriesIndexes: indexesOfModifiedEntries,\n },\n initialBreadcrumb: this.#timelineBreadcrumbs.initialBreadcrumb,\n };\n }\n\n applyAnnotations(annotations: TraceEngine.Types.File.Annotations): void {\n this.applyEntriesFilterAnnotations(\n annotations.entriesFilterAnnotations.hiddenEntriesIndexes,\n annotations.entriesFilterAnnotations.modifiedEntriesIndexes);\n this.#timelineBreadcrumbs.setInitialBreadcrumbFromLoadedAnnotations(annotations.initialBreadcrumb);\n }\n\n applyEntriesFilterAnnotations(hiddenEntriesIndexes: number[], modifiedEntriesIndexes: number[]): void {\n // Build the hidden events array by getting the entries by their index in the allEntries array.\n const hiddenEntries: TraceEngine.Types.TraceEvents.SyntheticTraceEntry[] = [];\n hiddenEntriesIndexes.map(hiddenEntryHash => {\n const hiddenEntry = this.#allEntries[hiddenEntryHash];\n if (hiddenEntry) {\n hiddenEntries.push(hiddenEntry);\n }\n });\n const modifiedEntries: TraceEngine.Types.TraceEvents.SyntheticTraceEntry[] = [];\n modifiedEntriesIndexes.map(hiddenEntryHash => {\n const modifiedEntry = this.#allEntries[hiddenEntryHash];\n if (modifiedEntry) {\n modifiedEntries.push(modifiedEntry);\n }\n });\n this.#entriesFilter.setInvisibleAndModifiedEntries(hiddenEntries, modifiedEntries);\n }\n}\n"]} \ No newline at end of file diff --git a/public/services/annotations_manager/AnnotationsManager.test.js b/public/services/annotations_manager/AnnotationsManager.test.js index 1b3070ddd..ac2e5d8f1 100644 --- a/public/services/annotations_manager/AnnotationsManager.test.js +++ b/public/services/annotations_manager/AnnotationsManager.test.js @@ -1,6 +1,8 @@ // Copyright 2024 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import * as TraceEngine from '../../models/trace/trace.js'; +import * as TraceBounds from '../../services/trace_bounds/trace_bounds.js'; import { TraceLoader } from '../../testing/TraceLoader.js'; import * as AnnotationsManager from './annotations_manager.js'; function getMainThread(data) { @@ -25,18 +27,27 @@ function findFirstEntry(allEntries, predicate) { } return entry; } +const baseTraceWindow = { + min: TraceEngine.Types.Timing.MicroSeconds(0), + max: TraceEngine.Types.Timing.MicroSeconds(10_000), + range: TraceEngine.Types.Timing.MicroSeconds(10_000), +}; describe('AnnotationsManager', () => { it('correctly generates an entry hash', async function () { - const manager = AnnotationsManager.AnnotationsManager.AnnotationsManager.instance(); const data = await TraceLoader.traceEngine(null, 'basic-stack.json.gz'); + const boundsManager = TraceBounds.TraceBounds.BoundsManager.instance({ forceNew: true }).resetWithNewBounds(baseTraceWindow); + const annotationsManager = AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance({ entryToNodeMap: data.Renderer.entryToNode, wholeTraceBounds: boundsManager.state()?.micro.entireTraceBounds }); + if (!annotationsManager) { + throw new Error('Manager does not exist.'); + } const mainThread = getMainThread(data.Renderer); - assert.exists(manager); + assert.exists(annotationsManager); // Find first 'Timer Fired' entry in the trace const timerFireEntry = findFirstEntry(mainThread.entries, entry => { return entry.name === 'TimerFire'; }); - const entryHash = manager.generateTraceEntryHash(timerFireEntry); - assert.strictEqual('devtools.timeline,TimerFire,X,55385,259,164398376028,452669', entryHash); + const entryHash = annotationsManager.getEntryIndex(timerFireEntry); + assert.strictEqual(3649, entryHash); }); }); //# sourceMappingURL=AnnotationsManager.test.js.map \ No newline at end of file diff --git a/public/services/annotations_manager/AnnotationsManager.test.js.map b/public/services/annotations_manager/AnnotationsManager.test.js.map index 739e0e865..c0ee0a470 100644 --- a/public/services/annotations_manager/AnnotationsManager.test.js.map +++ b/public/services/annotations_manager/AnnotationsManager.test.js.map @@ -1 +1 @@ -{"version":3,"file":"AnnotationsManager.test.js","sourceRoot":"","sources":["../../../../../../front_end/services/annotations_manager/AnnotationsManager.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAG7B,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,kBAAkB,MAAM,0BAA0B,CAAC;AAE/D,SAAS,aAAa,CAAC,IAAqE;IAE1F,IAAI,UAAU,GAAoE,IAAI,CAAC;IACvF,KAAK,MAAM,CAAC,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;QACzC,KAAK,MAAM,CAAC,EAAE,MAAM,CAAC,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YACzC,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;gBACrC,UAAU,GAAG,MAAM,CAAC;gBACpB,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;IACD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,SAAS,cAAc,CACnB,UAAwE,EACxE,SACW;IACb,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IACzD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,mCAAmC,EAAE,KAAK;QAC3C,MAAM,OAAO,GAAG,kBAAkB,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CAAC;QACpF,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,WAAW,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;QACxE,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChD,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACvB,8CAA8C;QAC9C,MAAM,cAAc,GAAG,cAAc,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE;YAChE,OAAO,KAAK,CAAC,IAAI,KAAK,WAAW,CAAC;QACpC,CAAC,CAAC,CAAC;QAEH,MAAM,SAAS,GAAG,OAAO,CAAC,sBAAsB,CAAC,cAAc,CAAC,CAAC;QACjE,MAAM,CAAC,WAAW,CAAC,6DAA6D,EAAE,SAAS,CAAC,CAAC;IAC/F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as TraceEngine from '../../models/trace/trace.js';\nimport {TraceLoader} from '../../testing/TraceLoader.js';\n\nimport * as AnnotationsManager from './annotations_manager.js';\n\nfunction getMainThread(data: TraceEngine.Handlers.ModelHandlers.Renderer.RendererHandlerData):\n TraceEngine.Handlers.ModelHandlers.Renderer.RendererThread {\n let mainThread: TraceEngine.Handlers.ModelHandlers.Renderer.RendererThread|null = null;\n for (const [, process] of data.processes) {\n for (const [, thread] of process.threads) {\n if (thread.name === 'CrRendererMain') {\n mainThread = thread;\n break;\n }\n }\n }\n if (!mainThread) {\n throw new Error('Could not find main thread.');\n }\n return mainThread;\n}\n\nfunction findFirstEntry(\n allEntries: readonly TraceEngine.Types.TraceEvents.SyntheticTraceEntry[],\n predicate: (entry: TraceEngine.Types.TraceEvents.SyntheticTraceEntry) =>\n boolean): TraceEngine.Types.TraceEvents.SyntheticTraceEntry {\n const entry = allEntries.find(entry => predicate(entry));\n if (!entry) {\n throw new Error('Could not find expected entry.');\n }\n return entry;\n}\n\ndescribe('AnnotationsManager', () => {\n it('correctly generates an entry hash', async function() {\n const manager = AnnotationsManager.AnnotationsManager.AnnotationsManager.instance();\n const data = await TraceLoader.traceEngine(null, 'basic-stack.json.gz');\n const mainThread = getMainThread(data.Renderer);\n assert.exists(manager);\n // Find first 'Timer Fired' entry in the trace\n const timerFireEntry = findFirstEntry(mainThread.entries, entry => {\n return entry.name === 'TimerFire';\n });\n\n const entryHash = manager.generateTraceEntryHash(timerFireEntry);\n assert.strictEqual('devtools.timeline,TimerFire,X,55385,259,164398376028,452669', entryHash);\n });\n});\n"]} \ No newline at end of file +{"version":3,"file":"AnnotationsManager.test.js","sourceRoot":"","sources":["../../../../../../front_end/services/annotations_manager/AnnotationsManager.test.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,WAAW,MAAM,6CAA6C,CAAC;AAC3E,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,kBAAkB,MAAM,0BAA0B,CAAC;AAE/D,SAAS,aAAa,CAAC,IAAqE;IAE1F,IAAI,UAAU,GAAoE,IAAI,CAAC;IACvF,KAAK,MAAM,CAAC,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;QACzC,KAAK,MAAM,CAAC,EAAE,MAAM,CAAC,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YACzC,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;gBACrC,UAAU,GAAG,MAAM,CAAC;gBACpB,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;IACD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,SAAS,cAAc,CACnB,UAAwE,EACxE,S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AM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;QAClC,8CAA8C;QAC9C,MAAM,cAAc,GAAG,cAAc,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE;YAChE,OAAO,KAAK,CAAC,IAAI,KAAK,WAAW,CAAC;QACpC,CAAC,CAAC,CAAC;QAEH,MAAM,SAAS,GAAG,kBAAkB,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QACnE,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// Copyright 2024 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport * as TraceEngine from '../../models/trace/trace.js';\nimport * as TraceBounds from '../../services/trace_bounds/trace_bounds.js';\nimport {TraceLoader} from '../../testing/TraceLoader.js';\n\nimport * as AnnotationsManager from './annotations_manager.js';\n\nfunction getMainThread(data: TraceEngine.Handlers.ModelHandlers.Renderer.RendererHandlerData):\n TraceEngine.Handlers.ModelHandlers.Renderer.RendererThread {\n let mainThread: TraceEngine.Handlers.ModelHandlers.Renderer.RendererThread|null = null;\n for (const [, process] of data.processes) {\n for (const [, thread] of process.threads) {\n if (thread.name === 'CrRendererMain') {\n mainThread = thread;\n break;\n }\n }\n }\n if (!mainThread) {\n throw new Error('Could not find main thread.');\n }\n return mainThread;\n}\n\nfunction findFirstEntry(\n allEntries: readonly TraceEngine.Types.TraceEvents.SyntheticTraceEntry[],\n predicate: (entry: TraceEngine.Types.TraceEvents.SyntheticTraceEntry) =>\n boolean): TraceEngine.Types.TraceEvents.SyntheticTraceEntry {\n const entry = allEntries.find(entry => predicate(entry));\n if (!entry) {\n throw new Error('Could not find expected entry.');\n }\n return entry;\n}\n\nconst baseTraceWindow: TraceEngine.Types.Timing.TraceWindowMicroSeconds = {\n min: TraceEngine.Types.Timing.MicroSeconds(0),\n max: TraceEngine.Types.Timing.MicroSeconds(10_000),\n range: TraceEngine.Types.Timing.MicroSeconds(10_000),\n};\n\ndescribe('AnnotationsManager', () => {\n it('correctly generates an entry hash', async function() {\n const data = await TraceLoader.traceEngine(null, 'basic-stack.json.gz');\n const boundsManager =\n TraceBounds.TraceBounds.BoundsManager.instance({forceNew: true}).resetWithNewBounds(baseTraceWindow);\n const annotationsManager = AnnotationsManager.AnnotationsManager.AnnotationsManager.maybeInstance(\n {entryToNodeMap: data.Renderer.entryToNode, wholeTraceBounds: boundsManager.state()?.micro.entireTraceBounds});\n if (!annotationsManager) {\n throw new Error('Manager does not exist.');\n }\n const mainThread = getMainThread(data.Renderer);\n assert.exists(annotationsManager);\n // Find first 'Timer Fired' entry in the trace\n const timerFireEntry = findFirstEntry(mainThread.entries, entry => {\n return entry.name === 'TimerFire';\n });\n\n const entryHash = annotationsManager.getEntryIndex(timerFireEntry);\n assert.strictEqual(3649, entryHash);\n });\n});\n"]} \ No newline at end of file diff --git a/public/services/annotations_manager/annotations_manager-tsconfig.json b/public/services/annotations_manager/annotations_manager-tsconfig.json index f06dd9086..e7b6b0615 100644 --- a/public/services/annotations_manager/annotations_manager-tsconfig.json +++ b/public/services/annotations_manager/annotations_manager-tsconfig.json @@ -38,6 +38,9 @@ "references": [ { "path": "../../models/trace/bundle-tsconfig.json" + }, + { + "path": "../../panels/timeline/components/bundle-tsconfig.json" } ] } \ No newline at end of file diff --git a/public/third_party/codemirror.next/chunk/codemirror.js b/public/third_party/codemirror.next/chunk/codemirror.js index f613f9e4e..b1bd0d838 100644 --- a/public/third_party/codemirror.next/chunk/codemirror.js +++ b/public/third_party/codemirror.next/chunk/codemirror.js @@ -1,2 +1,2 @@ -const t=1024;let e=0;class i{constructor(t,e){this.from=t,this.to=e}}class n{constructor(t={}){this.id=e++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof t&&(t=o.match(t)),e=>{let i=t(e);return void 0===i?null:[this,i]}}}n.closedBy=new n({deserialize:t=>t.split(" ")}),n.openedBy=new n({deserialize:t=>t.split(" ")}),n.group=new n({deserialize:t=>t.split(" ")}),n.isolate=new n({deserialize:t=>{if(t&&"rtl"!=t&&"ltr"!=t&&"auto"!=t)throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}}),n.contextHash=new n({perNode:!0}),n.lookAhead=new n({perNode:!0}),n.mounted=new n({perNode:!0});class s{constructor(t,e,i){this.tree=t,this.overlay=e,this.parser=i}static get(t){return t&&t.props&&t.props[n.mounted.id]}}const r=Object.create(null);class o{constructor(t,e,i,n=0){this.name=t,this.props=e,this.id=i,this.flags=n}static define(t){let e=t.props&&t.props.length?Object.create(null):r,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0),n=new o(t.name||"",e,t.id,i);if(t.props)for(let i of t.props)if(Array.isArray(i)||(i=i(n)),i){if(i[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[i[0].id]=i[1]}return n}prop(t){return this.props[t.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(t){if("string"==typeof t){if(this.name==t)return!0;let e=this.prop(n.group);return!!e&&e.indexOf(t)>-1}return this.id==t}static match(t){let e=Object.create(null);for(let i in t)for(let n of i.split(" "))e[n]=t[i];return t=>{for(let i=t.prop(n.group),s=-1;s<(i?i.length:0);s++){let n=e[s<0?t.name:i[s]];if(n)return n}}}}o.none=new o("",Object.create(null),0,8);class a{constructor(t){this.types=t;for(let e=0;e=e){let s=new g(o.tree,o.overlay[0].from+t.from,-1,t);(r||(r=[n])).push(p(s,e,i,!1))}}return r?Q(r):n}(this,t,e)}iterate(t){let{enter:e,leave:i,from:n=0,to:s=this.length}=t,r=t.mode||0,o=(r&c.IncludeAnonymous)>0;for(let t=this.cursor(r|c.IncludeAnonymous);;){let r=!1;if(t.from<=s&&t.to>=n&&(!o&&t.type.isAnonymous||!1!==e(t))){if(t.firstChild())continue;r=!0}for(;r&&i&&(o||!t.type.isAnonymous)&&i(t),!t.nextSibling();){if(!t.parent())return;r=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:Z(o.none,this.children,this.positions,0,this.children.length,0,this.length,((t,e,i)=>new O(this.type,t,e,i,this.propValues)),t.makeTree||((t,e,i)=>new O(o.none,t,e,i)))}static build(e){return function(e){var i;let{buffer:s,nodeSet:r,maxBufferLength:o=t,reused:a=[],minRepeatType:l=r.types.length}=e,h=Array.isArray(s)?new u(s,s.length):s,c=r.types,d=0,p=0;function m(t,e,i,n,s,O){let{id:u,start:v,end:x,size:k}=h,$=p;for(;k<0;){if(h.next(),-1==k){let e=a[u];return i.push(e),void n.push(v-t)}if(-3==k)return void(d=u);if(-4==k)return void(p=u);throw new RangeError(`Unrecognized record size: ${k}`)}let P,T,X=c[u],C=v-t;if(x-v<=o&&(T=y(h.pos-e,s))){let e=new Uint16Array(T.size-T.skip),i=h.pos-T.size,n=e.length;for(;h.pos>i;)n=Q(T.start,e,n);P=new f(e,x-T.start,r),C=T.start-t}else{let t=h.pos-k;h.next();let e=[],i=[],n=u>=l?u:-1,s=0,r=x;for(;h.pos>t;)n>=0&&h.id==n&&h.size>=0?(h.end<=r-o&&(b(e,i,v,s,h.end,r,n,$),s=e.length,r=h.end),h.next()):O>2500?g(v,t,e,i):m(v,t,e,i,n,O+1);if(n>=0&&s>0&&s-1&&s>0){let t=w(X);P=Z(X,e,i,0,e.length,0,x-v,t,t)}else P=S(X,e,i,x-v,$-x)}i.push(P),n.push(C)}function g(t,e,i,n){let s=[],a=0,l=-1;for(;h.pos>e;){let{id:t,start:e,end:i,size:n}=h;if(n>4)h.next();else{if(l>-1&&e=0;t-=3)e[i++]=s[t],e[i++]=s[t+1]-o,e[i++]=s[t+2]-o,e[i++]=i;i.push(new f(e,s[2]-o,r)),n.push(o-t)}}function w(t){return(e,i,s)=>{let r,o,a=0,l=e.length-1;if(l>=0&&(r=e[l])instanceof O){if(!l&&r.type==t&&r.length==s)return r;(o=r.prop(n.lookAhead))&&(a=i[l]+r.length+o)}return S(t,e,i,s,a)}}function b(t,e,i,n,s,o,a,l){let h=[],c=[];for(;t.length>n;)h.push(t.pop()),c.push(e.pop()+i-s);t.push(S(r.types[a],h,c,o-s,l-o)),e.push(s-i)}function S(t,e,i,s,r=0,o){if(d){let t=[n.contextHash,d];o=o?[t].concat(o):[t]}if(r>25){let t=[n.lookAhead,r];o=o?[t].concat(o):[t]}return new O(t,e,i,s,o)}function y(t,e){let i=h.fork(),n=0,s=0,r=0,a=i.end-o,c={size:0,start:0,skip:0};t:for(let o=i.pos-t;i.pos>o;){let t=i.size;if(i.id==e&&t>=0){c.size=n,c.start=s,c.skip=r,r+=4,n+=4,i.next();continue}let h=i.pos-t;if(t<0||h=l?4:0,u=i.start;for(i.next();i.pos>h;){if(i.size<0){if(-3!=i.size)break t;O+=4}else i.id>=l&&(O+=4);i.next()}s=u,n+=t,r+=O}return(e<0||n==t)&&(c.size=n,c.start=s,c.skip=r),c.size>4?c:void 0}function Q(t,e,i){let{id:n,start:s,end:r,size:o}=h;if(h.next(),o>=0&&n4){let n=h.pos-(o-4);for(;h.pos>n;)i=Q(t,e,i)}e[--i]=a,e[--i]=r-t,e[--i]=s-t,e[--i]=n}else-3==o?d=n:-4==o&&(p=n);return i}let v=[],x=[];for(;h.pos>0;)m(e.start||0,e.bufferStart||0,v,x,-1,0);let k=null!==(i=e.length)&&void 0!==i?i:v.length?x[0]+v[0].length:0;return new O(c[e.topID],v.reverse(),x.reverse(),k)}(e)}}O.empty=new O(o.none,[],[],0);class u{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new u(this.buffer,this.index)}}class f{constructor(t,e,i){this.buffer=t,this.length=e,this.set=i}get type(){return o.none}toString(){let t=[];for(let e=0;e0));a=r[a+3]);return o}slice(t,e,i){let n=this.buffer,s=new Uint16Array(e-t),r=0;for(let o=t,a=0;o=e&&ie;case 1:return i<=e&&n>e;case 2:return n>e;case 4:return!0}}function p(t,e,i,n){for(var s;t.from==t.to||(i<1?t.from>=e:t.from>e)||(i>-1?t.to<=e:t.to0?a.length:-1;t!=h;t+=e){let h=a[t],O=l[t]+o.from;if(d(n,i,O,O+h.length))if(h instanceof f){if(r&c.ExcludeBuffers)continue;let s=h.findChild(0,h.buffer.length,e,i-O,n);if(s>-1)return new y(new S(o,h,t,O),null,s)}else if(r&c.IncludeAnonymous||!h.type.isAnonymous||k(h)){let a;if(!(r&c.IgnoreMounts)&&(a=s.get(h))&&!a.overlay)return new g(a.tree,O,t,o);let l=new g(h,O,t,o);return r&c.IncludeAnonymous||!l.type.isAnonymous?l:l.nextChild(e<0?h.children.length-1:0,e,i,n)}}if(r&c.IncludeAnonymous||!o.type.isAnonymous)return null;if(t=o.index>=0?o.index+e:e<0?-1:o._parent._tree.children.length,o=o._parent,!o)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}enter(t,e,i=0){let n;if(!(i&c.IgnoreOverlays)&&(n=s.get(this._tree))&&n.overlay){let i=t-this.from;for(let{from:t,to:s}of n.overlay)if((e>0?t<=i:t=i:s>i))return new g(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function w(t,e,i,n){let s=t.cursor(),r=[];if(!s.firstChild())return r;if(null!=i)for(let t=!1;!t;)if(t=s.type.is(i),!s.nextSibling())return r;for(;;){if(null!=n&&s.type.is(n))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return null==n?r:[]}}function b(t,e,i=e.length-1){for(let n=t.parent;i>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[i]&&e[i]!=n.name)return!1;i--}}return!0}class S{constructor(t,e,i,n){this.parent=t,this.buffer=e,this.index=i,this.start=n}}class y extends m{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,e,i){super(),this.context=t,this._parent=e,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,e,i){let{buffer:n}=this.context,s=n.findChild(this.index+4,n.buffer[this.index+3],t,e-this.context.start,i);return s<0?null:new y(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}enter(t,e,i=0){if(i&c.ExcludeBuffers)return null;let{buffer:n}=this.context,s=n.findChild(this.index+4,n.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return s<0?null:new y(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new y(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new y(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:i}=this.context,n=this.index+4,s=i.buffer[this.index+3];if(s>n){let r=i.buffer[this.index+1];t.push(i.slice(n,s,r)),e.push(0)}return new O(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Q(t){if(!t.length)return null;let e=0,i=t[0];for(let n=1;ni.from||s.to0){if(this.index-1)for(let n=e+t,s=t<0?-1:i._tree.children.length;n!=s;n+=t){let t=i._tree.children[n];if(this.mode&c.IncludeAnonymous||t instanceof f||!t.type.isAnonymous||k(t))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to=0;){for(let r=t;r;r=r._parent)if(r.index==n){if(n==this.index)return r;e=r,i=s+1;break t}n=this.stack[--s]}for(let t=i;t=0;s--){if(s<0)return b(this.node,t,n);let r=i[e.buffer[this.stack[s]]];if(!r.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}}function k(t){return t.children.some((t=>t instanceof f||!t.type.isAnonymous||k(t)))}const $=new WeakMap;function P(t,e){if(!t.isAnonymous||e instanceof f||e.type!=t)return 1;let i=$.get(e);if(null==i){i=1;for(let n of e.children){if(n.type!=t||!(n instanceof O)){i=1;break}i+=P(t,n)}$.set(e,i)}return i}function Z(t,e,i,n,s,r,o,a,l){let h=0;for(let i=n;i=c)break;d+=e}if(h==s+1){if(d>c){let t=i[s];e(t.children,t.positions,0,t.children.length,n[s]+a);continue}O.push(i[s])}else{let e=n[h-1]+i[h-1].length-f;O.push(Z(t,i,n,s,h,f,e,null,l))}u.push(f+a-r)}}(e,i,n,s,0),(a||l)(O,u,o)}class T{constructor(){this.map=new WeakMap}setBuffer(t,e,i){let n=this.map.get(t);n||this.map.set(t,n=new Map),n.set(e,i)}getBuffer(t,e){let i=this.map.get(t);return i&&i.get(e)}set(t,e){t instanceof y?this.setBuffer(t.context.buffer,t.index,e):t instanceof g&&this.map.set(t.tree,e)}get(t){return t instanceof y?this.getBuffer(t.context.buffer,t.index):t instanceof g?this.map.get(t.tree):void 0}cursorSet(t,e){t.buffer?this.setBuffer(t.buffer.buffer,t.index,e):this.map.set(t.tree,e)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class X{constructor(t,e,i,n,s=!1,r=!1){this.from=t,this.to=e,this.tree=i,this.offset=n,this.open=(s?1:0)|(r?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(t,e=[],i=!1){let n=[new X(0,t.length,t,0,!1,i)];for(let i of e)i.to>t.length&&n.push(i);return n}static applyChanges(t,e,i=128){if(!e.length)return t;let n=[],s=1,r=t.length?t[0]:null;for(let o=0,a=0,l=0;;o++){let h=o=i)for(;r&&r.from=e.from||c<=e.to||l){let t=Math.max(e.from,a)-l,i=Math.min(e.to,c)-l;e=t>=i?null:new X(t,i,e.tree,e.offset+l,o>0,!!h)}if(e&&n.push(e),r.to>c)break;r=snew i(t.from,t.to))):[new i(0,0)]:[new i(0,t.length)],this.createParse(t,e||[],n)}parse(t,e,i){let n=this.startParse(t,e,i);for(;;){let t=n.advance();if(t)return t}}}class Y{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}}function A(t){return(e,i,n,s)=>new q(e,t,i,n,s)}class R{constructor(t,e,i,n,s){this.parser=t,this.parse=e,this.overlay=i,this.target=n,this.from=s}}function W(t){if(!t.length||t.some((t=>t.from>=t.to)))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class V{constructor(t,e,i,n,s,r,o){this.parser=t,this.predicate=e,this.mounts=i,this.index=n,this.start=s,this.target=r,this.prev=o,this.depth=0,this.ranges=[]}}const j=new n({perNode:!0});class q{constructor(t,e,i,n,s){this.nest=e,this.input=i,this.fragments=n,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let t=this.baseParse.advance();if(!t)return null;if(this.baseParse=null,this.baseTree=t,this.startInner(),null!=this.stoppedAt)for(let t of this.inner)t.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let t=this.baseTree;return null!=this.stoppedAt&&(t=new O(t.type,t.children,t.positions,t.length,t.propValues.concat([[j,this.stoppedAt]]))),t}let t=this.inner[this.innerDone],e=t.parse.advance();if(e){this.innerDone++;let i=Object.assign(Object.create(null),t.target.props);i[n.mounted.id]=new s(e,t.overlay,t.parser),t.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let e=this.innerDone;e=this.stoppedAt)l=!1;else if(t.hasNode(s)){if(e){let t=e.mounts.find((t=>t.frag.from<=s.from&&t.frag.to>=s.to&&t.mount.overlay));if(t)for(let i of t.mount.overlay){let n=i.from+t.pos,r=i.to+t.pos;n>=s.from&&r<=s.to&&!e.ranges.some((t=>t.fromn))&&e.ranges.push({from:n,to:r})}}l=!1}else if(n&&(o=_(n.ranges,s.from,s.to)))l=2!=o;else if(!s.type.isAnonymous&&(r=this.nest(s,this.input))&&(s.fromnew i(t.from-s.from,t.to-s.from))):null,s.tree,t.length?t[0].from:s.from)),r.overlay?t.length&&(n={ranges:t,depth:0,prev:n}):l=!1}}else e&&(a=e.predicate(s))&&(!0===a&&(a=new i(s.from,s.to)),a.fromnew i(t.from-e.start,t.to-e.start))),e.target,t[0].from))),e=e.prev}n&&! --n.depth&&(n=n.prev)}}}}function _(t,e,i){for(let n of t){if(n.from>=i)break;if(n.to>e)return n.from<=e&&n.to>=i?2:1}return 0}function E(t,e,i,n,s,r){if(e=t&&e.enter(i,1,c.IgnoreOverlays|c.ExcludeBuffers)||e.next(!1)||(this.done=!0)}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let e=this.cursor.tree;;){if(e==t.tree)return!0;if(!(e.children.length&&0==e.positions[0]&&e.children[0]instanceof O))break;e=e.children[0]}return!1}}class z{constructor(t){var e;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let i=this.curFrag=t[0];this.curTo=null!==(e=i.tree.prop(j))&&void 0!==e?e:i.to,this.inner=new D(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=null!==(t=e.tree.prop(j))&&void 0!==t?t:e.to,this.inner=new D(e.tree,-e.offset)}}findMounts(t,e){var i;let s=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let t=this.inner.cursor.node;t;t=t.parent){let r=null===(i=t.tree)||void 0===i?void 0:i.prop(n.mounted);if(r&&r.parser==e)for(let e=this.fragI;e=t.to)break;i.tree==this.curFrag.tree&&s.push({frag:i,pos:t.from-i.offset,mount:r})}}}return s}}function G(t,e){let n=null,s=e;for(let r=1,o=0;r=l)break;t.to<=a||(n||(s=n=e.slice()),t.froml&&n.splice(o+1,0,new i(l,t.to))):t.to>l?n[o--]=new i(l,t.to):n.splice(o--,1))}}return s}function I(t,e,n,s){let r=0,o=0,a=!1,l=!1,h=-1e9,c=[];for(;;){let O=r==t.length?1e9:a?t[r].to:t[r].from,u=o==e.length?1e9:l?e[o].to:e[o].from;if(a!=l){let t=Math.max(h,n),e=Math.min(O,u,s);tnew i(t.from+s,t.to+s))),l,h);for(let e=0,i=l;;e++){let s=e==a.length,l=s?h:a[e].from;if(l>i&&n.push(new X(i,l,r.tree,-t,o.from>=i||o.openStart,o.to<=l||o.openEnd)),s)break;i=a[e].to}}else n.push(new X(l,h,r.tree,-t,o.from>=t||o.openStart,o.to<=a||o.openEnd))}return n}class N{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,i){[t,e]=it(this,t,e);let n=[];return this.decompose(0,t,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(e,this.length,n,1),L.from(n,this.length-(e-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=it(this,t,e);let i=[];return this.decompose(t,e,i,0),L.from(i,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),n=new J(this),s=new J(t);for(let t=e,r=e;;){if(n.next(t),s.next(t),t=0,n.lineBreak!=s.lineBreak||n.done!=s.done||n.value!=s.value)return!1;if(r+=n.value.length,n.done||r>=i)return!0}}iter(t=1){return new J(this,t)}iterRange(t,e=this.length){return new K(this,t,e)}iterLines(t,e){let i;if(null==t)i=this.iter();else{null==e&&(e=this.lines+1);let n=this.line(t).from;i=this.iterRange(n,Math.max(n,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new tt(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new U(t):L.from(U.split(t,[])):N.empty}}class U extends N{constructor(t,e=function(t){let e=-1;for(let i of t)e+=i.length+1;return e}(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,i,n){for(let s=0;;s++){let r=this.text[s],o=n+r.length;if((e?i:o)>=t)return new et(n,o,i,r);n=o+1,i++}}decompose(t,e,i,n){let s=t<=0&&e>=this.length?this:new U(H(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&n){let t=i.pop(),e=F(s.text,t.text.slice(),0,s.length);if(e.length<=32)i.push(new U(e,t.length+s.length));else{let t=e.length>>1;i.push(new U(e.slice(0,t)),new U(e.slice(t)))}}else i.push(s)}replace(t,e,i){if(!(i instanceof U))return super.replace(t,e,i);[t,e]=it(this,t,e);let n=F(this.text,F(i.text,H(this.text,0,t)),e),s=this.length+i.length-(e-t);return n.length<=32?new U(n,s):L.from(U.split(n,[]),s)}sliceString(t,e=this.length,i="\n"){[t,e]=it(this,t,e);let n="";for(let s=0,r=0;s<=e&&rt&&r&&(n+=i),ts&&(n+=o.slice(Math.max(0,t-s),e-s)),s=a+1}return n}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let i=[],n=-1;for(let s of t)i.push(s),n+=s.length+1,32==i.length&&(e.push(new U(i,n)),i=[],n=-1);return n>-1&&e.push(new U(i,n)),e}}class L extends N{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let e of t)this.lines+=e.lines}lineInner(t,e,i,n){for(let s=0;;s++){let r=this.children[s],o=n+r.length,a=i+r.lines-1;if((e?a:o)>=t)return r.lineInner(t,e,i,n);n=o+1,i=a+1}}decompose(t,e,i,n){for(let s=0,r=0;r<=e&&s=r){let s=n&((r<=t?1:0)|(a>=e?2:0));r>=t&&a<=e&&!s?i.push(o):o.decompose(t-r,e-r,i,s)}r=a+1}}replace(t,e,i){if([t,e]=it(this,t,e),i.lines=s&&e<=o){let a=r.replace(t-s,e-s,i),l=this.lines-r.lines+a.lines;if(a.lines>4&&a.lines>l>>6){let s=this.children.slice();return s[n]=a,new L(s,this.length-(e-t)+i.length)}return super.replace(s,o,a)}s=o+1}return super.replace(t,e,i)}sliceString(t,e=this.length,i="\n"){[t,e]=it(this,t,e);let n="";for(let s=0,r=0;st&&s&&(n+=i),tr&&(n+=o.sliceString(t-r,e-r,i)),r=a+1}return n}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof L))return 0;let i=0,[n,s,r,o]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;n+=e,s+=e){if(n==r||s==o)return i;let a=this.children[n],l=t.children[s];if(a!=l)return i+a.scanIdentical(l,e);i+=a.length+1}}static from(t,e=t.reduce(((t,e)=>t+e.length+1),-1)){let i=0;for(let e of t)i+=e.lines;if(i<32){let i=[];for(let e of t)e.flatten(i);return new U(i,e)}let n=Math.max(32,i>>5),s=n<<1,r=n>>1,o=[],a=0,l=-1,h=[];function c(t){let e;if(t.lines>s&&t instanceof L)for(let e of t.children)c(e);else t.lines>r&&(a>r||!a)?(O(),o.push(t)):t instanceof U&&a&&(e=h[h.length-1])instanceof U&&t.lines+e.lines<=32?(a+=t.lines,l+=t.length+1,h[h.length-1]=new U(e.text.concat(t.text),e.length+1+t.length)):(a+t.lines>n&&O(),a+=t.lines,l+=t.length+1,h.push(t))}function O(){0!=a&&(o.push(1==h.length?h[0]:L.from(h,l)),l=-1,a=h.length=0)}for(let e of t)c(e);return O(),1==o.length?o[0]:new L(o,e)}}function F(t,e,i=0,n=1e9){for(let s=0,r=0,o=!0;r=i&&(l>n&&(a=a.slice(0,n-s)),s0?1:(t instanceof U?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],s=this.offsets[i],r=s>>1,o=n instanceof U?n.text.length:n.children.length;if(r==(e>0?o:0)){if(0==i)return this.done=!0,this.value="",this;e>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&s)==(e>0?0:1)){if(this.offsets[i]+=e,0==t)return this.lineBreak=!0,this.value="\n",this;t--}else if(n instanceof U){let s=n.text[r+(e<0?-1:0)];if(this.offsets[i]+=e,s.length>Math.max(0,t))return this.value=0==t?s:e>0?s.slice(t):s.slice(0,s.length-t),this;t-=s.length}else{let s=n.children[r+(e<0?-1:0)];t>s.length?(t-=s.length,this.offsets[i]+=e):(e<0&&this.offsets[i]--,this.nodes.push(s),this.offsets.push(e>0?1:(s instanceof U?s.text.length:s.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class K{constructor(t,e,i){this.value="",this.done=!1,this.cursor=new J(t,e>i?-1:1),this.pos=e>i?t.length:0,this.from=Math.min(e,i),this.to=Math.max(e,i)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let i=e<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:n}=this.cursor.next(t);return this.pos+=(n.length+t)*e,this.value=n.length<=i?n:e<0?n.slice(n.length-i):n.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class tt{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:i,value:n}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(N.prototype[Symbol.iterator]=function(){return this.iter()},J.prototype[Symbol.iterator]=K.prototype[Symbol.iterator]=tt.prototype[Symbol.iterator]=function(){return this});class et{constructor(t,e,i,n){this.from=t,this.to=e,this.number=i,this.text=n}get length(){return this.to-this.from}}function it(t,e,i){return[e=Math.max(0,Math.min(t.length,e)),Math.max(e,Math.min(t.length,i))]}let nt="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2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2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((t=>t?parseInt(t,36):1));for(let t=1;tt)return nt[e-1]<=t;return!1}function rt(t){return t>=127462&&t<=127487}const ot=8205;function at(t,e,i=!0,n=!0){return(i?lt:ht)(t,e,n)}function lt(t,e,i){if(e==t.length)return e;e&&ct(t.charCodeAt(e))&&Ot(t.charCodeAt(e-1))&&e--;let n=ut(t,e);for(e+=dt(n);e=0&&rt(ut(t,n));)i++,n-=2;if(i%2==0)break;e+=2}}}return e}function ht(t,e,i){for(;e>0;){let n=lt(t,e-2,i);if(n=56320&&t<57344}function Ot(t){return t>=55296&&t<56320}function ut(t,e){let i=t.charCodeAt(e);if(!Ot(i)||e+1==t.length)return i;let n=t.charCodeAt(e+1);return ct(n)?n-56320+(i-55296<<10)+65536:i}function ft(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function dt(t){return t<65536?1:2}const pt=/\r\n?|\n/;var mt=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(mt||(mt={}));class gt{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;et)return s+(t-n);s+=o}else{if(i!=mt.Simple&&l>=t&&(i==mt.TrackDel&&nt||i==mt.TrackBefore&&nt))return null;if(l>t||l==t&&e<0&&!o)return t==n||e<0?s:s+a;s+=a}n=l}if(t>n)throw new RangeError(`Position ${t} is out of range for changeset of length ${n}`);return s}touchesRange(t,e=t){for(let i=0,n=0;i=0&&n<=e&&s>=t)return!(ne)||"cover";n=s}return!1}toString(){let t="";for(let e=0;e=0?":"+n:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some((t=>"number"!=typeof t)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new gt(t)}static create(t){return new gt(t)}}class wt extends gt{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return yt(this,((e,i,n,s,r)=>t=t.replace(n,n+(i-e),r)),!1),t}mapDesc(t,e=!1){return Qt(this,t,e,!0)}invert(t){let e=this.sections.slice(),i=[];for(let n=0,s=0;n=0){e[n]=o,e[n+1]=r;let a=n>>1;for(;i.length0&&St(i,e,s.text),s.forward(t),o+=t}let l=t[r++];for(;o>1].toJSON()))}return t}static of(t,e,i){let n=[],s=[],r=0,o=null;function a(t=!1){if(!t&&!n.length)return;ro||t<0||o>e)throw new RangeError(`Invalid change range ${t} to ${o} (in doc of length ${e})`);let c=h?"string"==typeof h?N.of(h.split(i||pt)):h:N.empty,O=c.length;if(t==o&&0==O)return;tr&&bt(n,t-r,-1),bt(n,o-t,O),St(s,n,c),r=o}}(t),a(!o),o}static empty(t){return new wt(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],i=[];for(let n=0;ne&&"string"!=typeof t)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==s.length)e.push(s[0],0);else{for(;i.length=0&&i<=0&&i==t[s+1]?t[s]+=e:0==e&&0==t[s]?t[s+1]+=i:n?(t[s]+=e,t[s+1]+=i):t.push(e,i)}function St(t,e,i){if(0==i.length)return;let n=e.length-2>>1;if(n>1])),!(i||o==t.sections.length||t.sections[o+1]<0);)a=t.sections[o++],l=t.sections[o++];e(s,h,r,c,O),s=h,r=c}}}function Qt(t,e,i,n=!1){let s=[],r=n?[]:null,o=new xt(t),a=new xt(e);for(let t=-1;;)if(-1==o.ins&&-1==a.ins){let t=Math.min(o.len,a.len);bt(s,t,-1),o.forward(t),a.forward(t)}else if(a.ins>=0&&(o.ins<0||t==o.i||0==o.off&&(a.len=0&&t=0)){if(o.done&&a.done)return r?wt.createSet(s,r):gt.create(s);throw new Error("Mismatched change set lengths")}{let e=0,i=o.len;for(;i;)if(-1==a.ins){let t=Math.min(i,a.len);e+=t,i-=t,a.forward(t)}else{if(!(0==a.ins&&a.lene||o.ins>=0&&o.len>e)&&(t||n.length>i),r.forward2(e),o.forward(e)}}else bt(n,0,o.ins,t),s&&St(s,n,o.text),o.next()}}class xt{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return e>=t.length?N.empty:t[e]}textBit(t){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length&&!t?N.empty:e[i].slice(this.off,null==t?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class kt{constructor(t,e,i){this.from=t,this.to=e,this.flags=i}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let t=7&this.flags;return 7==t?null:t}get goalColumn(){let t=this.flags>>6;return 16777215==t?void 0:t}map(t,e=-1){let i,n;return this.empty?i=n=t.mapPos(this.from,e):(i=t.mapPos(this.from,1),n=t.mapPos(this.to,-1)),i==this.from&&n==this.to?this:new kt(i,n,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return $t.range(t,e);let i=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return $t.range(this.anchor,i)}eq(t,e=!1){return!(this.anchor!=t.anchor||this.head!=t.head||e&&this.empty&&this.assoc!=t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return $t.range(t.anchor,t.head)}static create(t,e,i){return new kt(t,e,i)}}class $t{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:$t.create(this.ranges.map((i=>i.map(t,e))),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;it.toJSON())),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new $t(t.ranges.map((t=>kt.fromJSON(t))),t.main)}static single(t,e=t){return new $t([$t.range(t,e)],0)}static create(t,e=0){if(0==t.length)throw new RangeError("A selection needs at least one range");for(let i=0,n=0;nt?8:0)|s)}static normalized(t,e=0){let i=t[e];t.sort(((t,e)=>t.from-e.from)),e=t.indexOf(i);for(let i=1;in.head?$t.range(o,r):$t.range(r,o))}}return new $t(t,e)}}function Pt(t,e){for(let i of t.ranges)if(i.to>e)throw new RangeError("Selection points outside of document")}let Zt=0;class Tt{constructor(t,e,i,n,s){this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=n,this.id=Zt++,this.default=t([]),this.extensions="function"==typeof s?s(this):s}get reader(){return this}static define(t={}){return new Tt(t.combine||(t=>t),t.compareInput||((t,e)=>t===e),t.compare||(t.combine?(t,e)=>t===e:Xt),!!t.static,t.enables)}of(t){return new Ct([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ct(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ct(t,this,2,e)}from(t,e){return e||(e=t=>t),this.compute([t],(i=>e(i.field(t))))}}function Xt(t,e){return t==e||t.length==e.length&&t.every(((t,i)=>t===e[i]))}class Ct{constructor(t,e,i,n){this.dependencies=t,this.facet=e,this.type=i,this.value=n,this.id=Zt++}dynamicSlot(t){var e;let i=this.value,n=this.facet.compareInput,s=this.id,r=t[s]>>1,o=2==this.type,a=!1,l=!1,h=[];for(let i of this.dependencies)"doc"==i?a=!0:"selection"==i?l=!0:1&(null!==(e=t[i.id])&&void 0!==e?e:1)||h.push(t[i.id]);return{create:t=>(t.values[r]=i(t),1),update(t,e){if(a&&e.docChanged||l&&(e.docChanged||e.selection)||At(t,h)){let e=i(t);if(o?!Yt(e,t.values[r],n):!n(e,t.values[r]))return t.values[r]=e,1}return 0},reconfigure:(t,e)=>{let a,l=e.config.address[s];if(null!=l){let s=Ut(e,l);if(this.dependencies.every((i=>i instanceof Tt?e.facet(i)===t.facet(i):!(i instanceof Vt)||e.field(i,!1)==t.field(i,!1)))||(o?Yt(a=i(t),s,n):n(a=i(t),s)))return t.values[r]=s,0}else a=i(t);return t.values[r]=a,1}}}}function Yt(t,e,i){if(t.length!=e.length)return!1;for(let n=0;nt[e.id])),s=i.map((t=>t.type)),r=n.filter((t=>!(1&t))),o=t[e.id]>>1;function a(t){let i=[];for(let e=0;et===e),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(Wt).find((t=>t.field==this));return((null==e?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:t=>(t.values[e]=this.create(t),1),update:(t,i)=>{let n=t.values[e],s=this.updateF(n,i);return this.compareF(n,s)?0:(t.values[e]=s,1)},reconfigure:(t,i)=>null!=i.config.address[this.id]?(t.values[e]=i.field(this),0):(t.values[e]=this.create(t),1)}}init(t){return[this,Wt.of({field:this,create:t})]}get extension(){return this}}const jt=4,qt=3,_t=2,Et=1;function Mt(t){return e=>new zt(e,t)}const Dt={highest:Mt(0),high:Mt(Et),default:Mt(_t),low:Mt(qt),lowest:Mt(jt)};class zt{constructor(t,e){this.inner=t,this.prec=e}}class Gt{of(t){return new It(this,t)}reconfigure(t){return Gt.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class It{constructor(t,e){this.compartment=t,this.inner=e}}class Bt{constructor(t,e,i,n,s,r){for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=n,this.staticValues=s,this.facets=r,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,e,i){let n=[],s=Object.create(null),r=new Map;for(let i of function(t,e,i){let n=[[],[],[],[],[]],s=new Map;function r(t,o){let a=s.get(t);if(null!=a){if(a<=o)return;let e=n[a].indexOf(t);e>-1&&n[a].splice(e,1),t instanceof It&&i.delete(t.compartment)}if(s.set(t,o),Array.isArray(t))for(let e of t)r(e,o);else if(t instanceof It){if(i.has(t.compartment))throw new RangeError("Duplicate use of compartment in extensions");let n=e.get(t.compartment)||t.inner;i.set(t.compartment,n),r(n,o)}else if(t instanceof zt)r(t.inner,t.prec);else if(t instanceof Vt)n[o].push(t),t.provides&&r(t.provides,o);else if(t instanceof Ct)n[o].push(t),t.facet.extensions&&r(t.facet.extensions,_t);else{let e=t.extension;if(!e)throw new Error(`Unrecognized extension value in extension set (${t}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(e,o)}}return r(t,_t),n.reduce(((t,e)=>t.concat(e)))}(t,e,r))i instanceof Vt?n.push(i):(s[i.facet.id]||(s[i.facet.id]=[])).push(i);let o=Object.create(null),a=[],l=[];for(let t of n)o[t.id]=l.length<<1,l.push((e=>t.slot(e)));let h=null==i?void 0:i.config.facets;for(let t in s){let e=s[t],n=e[0].facet,r=h&&h[t]||[];if(e.every((t=>0==t.type)))if(o[n.id]=a.length<<1|1,Xt(r,e))a.push(i.facet(n));else{let t=n.combine(e.map((t=>t.value)));a.push(i&&n.compare(t,i.facet(n))?i.facet(n):t)}else{for(let t of e)0==t.type?(o[t.id]=a.length<<1|1,a.push(t.value)):(o[t.id]=l.length<<1,l.push((e=>t.dynamicSlot(e))));o[n.id]=l.length<<1,l.push((t=>Rt(t,n,e)))}}let c=l.map((t=>t(o)));return new Bt(t,r,c,o,a,s)}}function Nt(t,e){if(1&e)return 2;let i=e>>1,n=t.status[i];if(4==n)throw new Error("Cyclic dependency between fields and/or facets");if(2&n)return n;t.status[i]=4;let s=t.computeSlot(t,t.config.dynamicSlots[i]);return t.status[i]=2|s}function Ut(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1]}const Lt=Tt.define(),Ft=Tt.define({combine:t=>t.some((t=>t)),static:!0}),Ht=Tt.define({combine:t=>t.length?t[0]:void 0,static:!0}),Jt=Tt.define(),Kt=Tt.define(),te=Tt.define(),ee=Tt.define({combine:t=>!!t.length&&t[0]});class ie{constructor(t,e){this.type=t,this.value=e}static define(){return new ne}}class ne{of(t){return new ie(this,t)}}class se{constructor(t){this.map=t}of(t){return new re(this,t)}}class re{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return void 0===e?void 0:e==this.value?this:new re(this.type,e)}is(t){return this.type==t}static define(t={}){return new se(t.map||(t=>t))}static mapEffects(t,e){if(!t.length)return t;let i=[];for(let n of t){let t=n.map(e);t&&i.push(t)}return i}}re.reconfigure=re.define(),re.appendConfig=re.define();class oe{constructor(t,e,i,n,s,r){this.startState=t,this.changes=e,this.selection=i,this.effects=n,this.annotations=s,this.scrollIntoView=r,this._doc=null,this._state=null,i&&Pt(i,e.newLength),s.some((t=>t.type==oe.time))||(this.annotations=s.concat(oe.time.of(Date.now())))}static create(t,e,i,n,s,r){return new oe(t,e,i,n,s,r)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(oe.userEvent);return!(!e||!(e==t||e.length>t.length&&e.slice(0,t.length)==t&&"."==e[t.length]))}}function ae(t,e){let i=[];for(let n=0,s=0;;){let r,o;if(n=t[n]))r=t[n++],o=t[n++];else{if(!(s=0;s--){let r=i[s](t);r&&Object.keys(r).length&&(n=le(n,he(e,r,t.changes.newLength),!0))}return n==t?t:oe.create(e,t.changes,t.selection,n.effects,n.annotations,n.scrollIntoView)}(i?function(t){let e=t.startState,i=!0;for(let n of e.facet(Jt)){let e=n(t);if(!1===e){i=!1;break}Array.isArray(e)&&(i=!0===i?e:ae(i,e))}if(!0!==i){let n,s;if(!1===i)s=t.changes.invertedDesc,n=wt.empty(e.doc.length);else{let e=t.changes.filter(i);n=e.changes,s=e.filtered.mapDesc(e.changes).invertedDesc}t=oe.create(e,n,t.selection&&t.selection.map(s),re.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let n=e.facet(Kt);for(let i=n.length-1;i>=0;i--){let s=n[i](t);t=s instanceof oe?s:Array.isArray(s)&&1==s.length&&s[0]instanceof oe?s[0]:ce(e,ue(s),!1)}return t}(s):s)}oe.time=ie.define(),oe.userEvent=ie.define(),oe.addToHistory=ie.define(),oe.remote=ie.define();const Oe=[];function ue(t){return null==t?Oe:Array.isArray(t)?t:[t]}var fe=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(fe||(fe={}));const de=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let pe;try{pe=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(t){}function me(t){return e=>{if(!/\S/.test(e))return fe.Space;if(function(t){if(pe)return pe.test(t);for(let e=0;e"€"&&(i.toUpperCase()!=i.toLowerCase()||de.test(i)))return!0}return!1}(e))return fe.Word;for(let i=0;i-1)return fe.Word;return fe.Other}}class ge{constructor(t,e,i,n,s,r){this.config=t,this.doc=e,this.selection=i,this.values=n,this.status=t.statusTemplate.slice(),this.computeSlot=s,r&&(r._state=this);for(let t=0;ts.set(e,t))),i=null),s.set(e.value.compartment,e.value.extension)):e.is(re.reconfigure)?(i=null,n=e.value):e.is(re.appendConfig)&&(i=null,n=ue(n).concat(e.value));if(i)e=t.startState.values.slice();else{i=Bt.resolve(n,s,this),e=new ge(i,this.doc,this.selection,i.dynamicSlots.map((()=>null)),((t,e)=>e.reconfigure(t,this)),null).values}let r=t.startState.facet(Ft)?t.newSelection:t.newSelection.asSingle();new ge(i,t.newDoc,r,e,((e,i)=>i.update(e,t)),t)}replaceSelection(t){return"string"==typeof t&&(t=this.toText(t)),this.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:t},range:$t.cursor(e.from+t.length)})))}changeByRange(t){let e=this.selection,i=t(e.ranges[0]),n=this.changes(i.changes),s=[i.range],r=ue(i.effects);for(let i=1;is.spec.fromJSON(r,t))))}return ge.create({doc:t.doc,selection:$t.fromJSON(t.selection),extensions:e.extensions?n.concat([e.extensions]):n})}static create(t={}){let e=Bt.resolve(t.extensions||[],new Map),i=t.doc instanceof N?t.doc:N.of((t.doc||"").split(e.staticFacet(ge.lineSeparator)||pt)),n=t.selection?t.selection instanceof $t?t.selection:$t.single(t.selection.anchor,t.selection.head):$t.single(0);return Pt(n,i.length),e.staticFacet(Ft)||(n=n.asSingle()),new ge(e,i,n,e.dynamicSlots.map((()=>null)),((t,e)=>e.create(t)),null)}get tabSize(){return this.facet(ge.tabSize)}get lineBreak(){return this.facet(ge.lineSeparator)||"\n"}get readOnly(){return this.facet(ee)}phrase(t,...e){for(let e of this.facet(ge.phrases))if(Object.prototype.hasOwnProperty.call(e,t)){t=e[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,((t,i)=>{if("$"==i)return"$";let n=+(i||1);return!n||n>e.length?t:e[n-1]}))),t}languageDataAt(t,e,i=-1){let n=[];for(let s of this.facet(Lt))for(let r of s(this,e,i))Object.prototype.hasOwnProperty.call(r,t)&&n.push(r[t]);return n}charCategorizer(t){return me(this.languageDataAt("wordChars",t).join(""))}wordAt(t){let{text:e,from:i,length:n}=this.doc.lineAt(t),s=this.charCategorizer(t),r=t-i,o=t-i;for(;r>0;){let t=at(e,r,!1);if(s(e.slice(t,r))!=fe.Word)break;r=t}for(;ot.length?t[0]:4}),ge.lineSeparator=Ht,ge.readOnly=ee,ge.phrases=Tt.define({compare(t,e){let i=Object.keys(t),n=Object.keys(e);return i.length==n.length&&i.every((i=>t[i]==e[i]))}}),ge.languageData=Lt,ge.changeFilter=Jt,ge.transactionFilter=Kt,ge.transactionExtender=te,Gt.reconfigure=re.define();class be{eq(t){return this==t}range(t,e=t){return Se.create(t,e,this)}}be.prototype.startSide=be.prototype.endSide=0,be.prototype.point=!1,be.prototype.mapMode=mt.TrackDel;class Se{constructor(t,e,i){this.from=t,this.to=e,this.value=i}static create(t,e,i){return new Se(t,e,i)}}function ye(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Qe{constructor(t,e,i,n){this.from=t,this.to=e,this.value=i,this.maxPoint=n}get length(){return this.to[this.to.length-1]}findIndex(t,e,i,n=0){let s=i?this.to:this.from;for(let r=n,o=s.length;;){if(r==o)return r;let n=r+o>>1,a=s[n]-t||(i?this.value[n].endSide:this.value[n].startSide)-e;if(n==r)return a>=0?r:o;a>=0?o=n:r=n+1}}between(t,e,i,n){for(let s=this.findIndex(e,-1e9,!0),r=this.findIndex(i,1e9,!1,s);sh||l==h&&c.startSide>0&&c.endSide<=0)continue;(h-l||c.endSide-c.startSide)<0||(r<0&&(r=l),c.point&&(o=Math.max(o,h-l)),i.push(c),n.push(l-r),s.push(h-r))}return{mapped:i.length?new Qe(n,s,i,o):null,pos:r}}}class ve{constructor(t,e,i,n){this.chunkPos=t,this.chunk=e,this.nextLayer=i,this.maxPoint=n}static create(t,e,i,n){return new ve(t,e,i,n)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:i=!1,filterFrom:n=0,filterTo:s=this.length}=t,r=t.filter;if(0==e.length&&!r)return this;if(i&&(e=e.slice().sort(ye)),this.isEmpty)return e.length?ve.of(e):this;let o=new $e(this,null,-1).goto(0),a=0,l=[],h=new xe;for(;o.value||a=0){let t=e[a++];h.addInner(t.from,t.to,t.value)||l.push(t)}else 1==o.rangeIndex&&o.chunkIndexthis.chunkEnd(o.chunkIndex)||so.to||s=s&&t<=s+r.length&&!1===r.between(s,t-s,e-s,i))return}this.nextLayer.between(t,e,i)}}iter(t=0){return Pe.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return Pe.from(t).goto(e)}static compare(t,e,i,n,s=-1){let r=t.filter((t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=s)),o=e.filter((t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=s)),a=ke(r,o,i),l=new Te(r,a,s),h=new Te(o,a,s);i.iterGaps(((t,e,i)=>Xe(l,t,h,e,i,n))),i.empty&&0==i.length&&Xe(l,0,h,0,0,n)}static eq(t,e,i=0,n){null==n&&(n=999999999);let s=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0)),r=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0));if(s.length!=r.length)return!1;if(!s.length)return!0;let o=ke(s,r),a=new Te(s,o,0).goto(i),l=new Te(r,o,0).goto(i);for(;;){if(a.to!=l.to||!Ce(a.active,l.active)||a.point&&(!l.point||!a.point.eq(l.point)))return!1;if(a.to>n)return!0;a.next(),l.next()}}static spans(t,e,i,n,s=-1){let r=new Te(t,null,s).goto(e),o=e,a=r.openStart;for(;;){let t=Math.min(r.to,i);if(r.point){let i=r.activeForPoint(r.to),s=r.pointFromo&&(n.span(o,t,r.active,a),a=r.openEnd(t));if(r.to>i)return a+(r.point&&r.to>i?1:0);o=r.to,r.next()}}static of(t,e=!1){let i=new xe;for(let n of t instanceof Se?[t]:e?function(t){if(t.length>1)for(let e=t[0],i=1;i0)return t.slice().sort(ye);e=n}return t}(t):t)i.add(n.from,n.to,n.value);return i.finish()}static join(t){if(!t.length)return ve.empty;let e=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let n=t[i];n!=ve.empty;n=n.nextLayer)e=new ve(n.chunkPos,n.chunk,e,Math.max(n.maxPoint,e.maxPoint));return e}}ve.empty=new ve([],[],null,-1),ve.empty.nextLayer=ve.empty;class xe{finishChunk(t){this.chunks.push(new Qe(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,e,i){this.addInner(t,e,i)||(this.nextLayer||(this.nextLayer=new xe)).add(t,e,i)}addInner(t,e,i){let n=t-this.lastTo||i.startSide-this.last.endSide;if(n<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(n<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=e,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let i=e.value.length-1;return this.last=e.value[i],this.lastFrom=e.from[i]+t,this.lastTo=e.to[i]+t,!0}finish(){return this.finishInner(ve.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;let e=ve.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function ke(t,e,i){let n=new Map;for(let e of t)for(let t=0;t=this.minPoint)break}}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&n.push(new $e(r,e,i,s));return 1==n.length?n[0]:new Pe(n)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let i of this.heap)i.goto(t,e);for(let t=this.heap.length>>1;t>=0;t--)Ze(this.heap,t);return this.next(),this}forward(t,e){for(let i of this.heap)i.forward(t,e);for(let t=this.heap.length>>1;t>=0;t--)Ze(this.heap,t);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),Ze(this.heap,0)}}}function Ze(t,e){for(let i=t[e];;){let n=1+(e<<1);if(n>=t.length)break;let s=t[n];if(n+1=0&&(s=t[n+1],n++),i.compare(s)<0)break;t[n]=i,t[e]=s,e=n}}class Te{constructor(t,e,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Pe.from(t,e,i)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){Ye(this.active,t),Ye(this.activeTo,t),Ye(this.activeRank,t),this.minActive=Re(this.active,this.activeTo)}addActive(t){let e=0,{value:i,to:n,rank:s}=this.cursor;for(;e0;)e++;Ae(this.active,e,i),Ae(this.activeTo,e,n),Ae(this.activeRank,e,s),t&&Ae(t,e,this.cursor.from),this.minActive=Re(this.active,this.activeTo)}next(){let t=this.to,e=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let n=this.minActive;if(n>-1&&(this.activeTo[n]-this.cursor.from||this.active[n].endSide-this.cursor.startSide)<0){if(this.activeTo[n]>t){this.to=this.activeTo[n],this.endSide=this.active[n].endSide;break}this.removeActive(n),i&&Ye(i,n)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let t=this.cursor.value;if(t.point){if(!(e&&this.cursor.to==this.to&&this.cursor.from=0&&i[e]=0&&!(this.activeRank[i]t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&e.push(this.active[i]);return e.reverse()}openEnd(t){let e=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)e++;return e}}function Xe(t,e,i,n,s,r){t.goto(e),i.goto(n);let o=n+s,a=n,l=n-e;for(;;){let e=t.to+l-i.to||t.endSide-i.endSide,n=e<0?t.to+l:i.to,s=Math.min(n,o);if(t.point||i.point?t.point&&i.point&&(t.point==i.point||t.point.eq(i.point))&&Ce(t.activeForPoint(t.to),i.activeForPoint(i.to))||r.comparePoint(a,s,t.point,i.point):s>a&&!Ce(t.active,i.active)&&r.compareRange(a,s,t.active,i.active),n>o)break;a=n,e<=0&&t.next(),e>=0&&i.next()}}function Ce(t,e){if(t.length!=e.length)return!1;for(let i=0;i=e;i--)t[i+1]=t[i];t[e]=i}function Re(t,e){let i=-1,n=1e9;for(let s=0;st.map((t=>e.replace(/&/,t))))).reduce(((t,e)=>t.concat(e))),o,r);else if(o&&"object"==typeof o){if(!l)throw new RangeError("The value of a property ("+i+") should be a primitive value.");s(n(i),o,a,h)}else null!=o&&a.push(i.replace(/_.*/,"").replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))+": "+o+";")}(a.length||h)&&r.push((!i||l||o?t:t.map(i)).join(", ")+" {"+a.join(" ")+"}")}for(let e in t)s(n(e),t[e],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let t=qe[Ve]||1;return qe[Ve]=t+1,"ͼ"+t.toString(36)}static mount(t,e,i){let n=t[je],s=i&&i.nonce;n?s&&n.setNonce(s):n=new Me(t,s),n.mount(Array.isArray(e)?e:[e])}}let Ee=new Map;class Me{constructor(t,e){let i=t.ownerDocument||t,n=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&n.CSSStyleSheet){let e=Ee.get(i);if(e)return t.adoptedStyleSheets=[e.sheet,...t.adoptedStyleSheets],t[je]=e;this.sheet=new n.CSSStyleSheet,t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets],Ee.set(i,this)}else{this.styleTag=i.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);let n=t.head||t;n.insertBefore(this.styleTag,n.firstChild)}this.modules=[],t[je]=this}mount(t){let e=this.sheet,i=0,n=0;for(let s=0;s-1&&(this.modules.splice(o,1),n--,o=-1),-1==o){if(this.modules.splice(n++,0,r),e)for(let t=0;t",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Ge="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Ie="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Be=0;Be<10;Be++)De[48+Be]=De[96+Be]=String(Be);for(Be=1;Be<=24;Be++)De[Be+111]="F"+Be;for(Be=65;Be<=90;Be++)De[Be]=String.fromCharCode(Be+32),ze[Be]=String.fromCharCode(Be);for(var Ne in De)ze.hasOwnProperty(Ne)||(ze[Ne]=De[Ne]);function Ue(t){let e;return e=11==t.nodeType?t.getSelection?t:t.ownerDocument:t,e.getSelection()}function Le(t,e){return!!e&&(t==e||t.contains(1!=e.nodeType?e.parentNode:e))}function Fe(t,e){if(!e.anchorNode)return!1;try{return Le(t,e.anchorNode)}catch(t){return!1}}function He(t){return 3==t.nodeType?hi(t,0,t.nodeValue.length).getClientRects():1==t.nodeType?t.getClientRects():[]}function Je(t,e,i,n){return!!i&&(ti(t,e,i,n,-1)||ti(t,e,i,n,1))}function Ke(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e}function ti(t,e,i,n,s){for(;;){if(t==i&&e==n)return!0;if(e==(s<0?0:ei(t))){if("DIV"==t.nodeName)return!1;let i=t.parentNode;if(!i||1!=i.nodeType)return!1;e=Ke(t)+(s<0?0:1),t=i}else{if(1!=t.nodeType)return!1;if(1==(t=t.childNodes[e+(s<0?-1:0)]).nodeType&&"false"==t.contentEditable)return!1;e=s<0?ei(t):0}}}function ei(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function ii(t,e){let i=e?t.left:t.right;return{left:i,right:i,top:t.top,bottom:t.bottom}}function ni(t){return{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function si(t,e){let i=e.width/t.offsetWidth,n=e.height/t.offsetHeight;return(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.width-t.offsetWidth)<1)&&(i=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-t.offsetHeight)<1)&&(n=1),{scaleX:i,scaleY:n}}class ri{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:e,focusNode:i}=t;this.set(e,Math.min(t.anchorOffset,e?ei(e):0),i,Math.min(t.focusOffset,i?ei(i):0))}set(t,e,i,n){this.anchorNode=t,this.anchorOffset=e,this.focusNode=i,this.focusOffset=n}}let oi,ai=null;function li(t){if(t.setActive)return t.setActive();if(ai)return t.focus(ai);let e=[];for(let i=t;i&&(e.push(i,i.scrollTop,i.scrollLeft),i!=i.ownerDocument);i=i.parentNode);if(t.focus(null==ai?{get preventScroll(){return ai={preventScroll:!0},!0}}:void 0),!ai){ai=!1;for(let t=0;tMath.max(1,t.scrollHeight-t.clientHeight-4)}class fi{constructor(t,e,i=!0){this.node=t,this.offset=e,this.precise=i}static before(t,e){return new fi(t.parentNode,Ke(t),e)}static after(t,e){return new fi(t.parentNode,Ke(t)+1,e)}}const di=[];class pi{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t){let e=this.posAtStart;for(let i of this.children){if(i==t)return e;e+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}sync(t,e){if(2&this.flags){let i,n=this.dom,s=null;for(let r of this.children){if(7&r.flags){if(!r.dom&&(i=s?s.nextSibling:n.firstChild)){let t=pi.get(i);(!t||!t.parent&&t.canReuseDOM(r))&&r.reuseDOM(i)}r.sync(t,e),r.flags&=-8}if(i=s?s.nextSibling:n.firstChild,e&&!e.written&&e.node==n&&i!=r.dom&&(e.written=!0),r.dom.parentNode==n)for(;i&&i!=r.dom;)i=mi(i);else n.insertBefore(r.dom,i);s=r.dom}for(i=s?s.nextSibling:n.firstChild,i&&e&&e.node==n&&(e.written=!0);i;)i=mi(i)}else if(1&this.flags)for(let i of this.children)7&i.flags&&(i.sync(t,e),i.flags&=-8)}reuseDOM(t){}localPosFromDOM(t,e){let i;if(t==this.dom)i=this.dom.childNodes[e];else{let n=0==ei(t)?0:0==e?-1:1;for(;;){let e=t.parentNode;if(e==this.dom)break;0==n&&e.firstChild!=e.lastChild&&(n=t==e.firstChild?-1:1),t=e}i=n<0?t:t.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!pi.get(i);)i=i.nextSibling;if(!i)return this.length;for(let t=0,e=0;;t++){let n=this.children[t];if(n.dom==i)return e;e+=n.length+n.breakAfter}}domBoundsAround(t,e,i=0){let n=-1,s=-1,r=-1,o=-1;for(let a=0,l=i,h=i;ae)return i.domBoundsAround(t,e,l);if(c>=t&&-1==n&&(n=a,s=l),l>e&&i.dom.parentNode==this.dom){r=a,o=h;break}h=c,l=c+i.breakAfter}return{from:s,to:o<0?i+this.length:o,startDOM:(n?this.children[n-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:r=0?this.children[r].dom:null}}markDirty(t=!1){this.flags|=2,this.markParentsDirty(t)}markParentsDirty(t){for(let e=this.parent;e;e=e.parent){if(t&&(e.flags|=2),1&e.flags)return;e.flags|=1,t=!1}}setParent(t){this.parent!=t&&(this.parent=t,7&this.flags&&this.markParentsDirty(!0))}setDOM(t){this.dom!=t&&(this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this)}get rootView(){for(let t=this;;){let e=t.parent;if(!e)return t;t=e}}replaceChildren(t,e,i=di){this.markDirty();for(let n=t;nthis.pos||t==this.pos&&(e>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function wi(t,e,i,n,s,r,o,a,l){let{children:h}=t,c=h.length?h[e]:null,O=r.length?r[r.length-1]:null,u=O?O.breakAfter:o;if(!(e==n&&c&&!o&&!u&&r.length<2&&c.merge(i,s,r.length?O:null,0==i,a,l))){if(n0&&(!o&&r.length&&c.merge(i,c.length,r[0],!1,a,0)?c.breakAfter=r.shift().breakAfter:(i2);var Ci={mac:Xi||/Mac/.test(Si.platform),windows:/Win/.test(Si.platform),linux:/Linux|X11/.test(Si.platform),ie:ki,ie_version:vi?yi.documentMode||6:xi?+xi[1]:Qi?+Qi[1]:0,gecko:$i,gecko_version:$i?+(/Firefox\/(\d+)/.exec(Si.userAgent)||[0,0])[1]:0,chrome:!!Pi,chrome_version:Pi?+Pi[1]:0,ios:Xi,android:/Android\b/.test(Si.userAgent),webkit:Zi,safari:Ti,webkit_version:Zi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=yi.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class Yi extends pi{constructor(t){super(),this.text=t}get length(){return this.text.length}createDOM(t){this.setDOM(t||document.createTextNode(this.text))}sync(t,e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(t){3==t.nodeType&&this.createDOM(t)}merge(t,e,i){return!(8&this.flags||i&&(!(i instanceof Yi)||this.length-(e-t)+i.length>256||8&i.flags))&&(this.text=this.text.slice(0,t)+(i?i.text:"")+this.text.slice(e),this.markDirty(),!0)}split(t){let e=new Yi(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),e.flags|=8&this.flags,e}localPosFromDOM(t,e){return t==this.dom?e:e?this.text.length:0}domAtPos(t){return new fi(this.dom,t)}domBoundsAround(t,e,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(t,e){return function(t,e,i){let n=t.nodeValue.length;e>n&&(e=n);let s=e,r=e,o=0;0==e&&i<0||e==n&&i>=0?Ci.chrome||Ci.gecko||(e?(s--,o=1):r=0)?0:a.length-1];Ci.safari&&!o&&0==l.width&&(l=Array.prototype.find.call(a,(t=>t.width))||l);return o?ii(l,o<0):l||null}(this.dom,t,e)}}class Ai extends pi{constructor(t,e=[],i=0){super(),this.mark=t,this.children=e,this.length=i;for(let t of e)t.setParent(this)}setAttrs(t){if(Oi(t),this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(let e in this.mark.attrs)t.setAttribute(e,this.mark.attrs[e]);return t}canReuseDOM(t){return super.canReuseDOM(t)&&!(8&(this.flags|t.flags))}reuseDOM(t){t.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(t),this.flags|=6)}sync(t,e){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(t,e)}merge(t,e,i,n,s,r){return(!i||!(!(i instanceof Ai&&i.mark.eq(this.mark))||t&&s<=0||et&&e.push(i=t&&(n=s),i=o,s++}let r=this.length-t;return this.length=t,n>-1&&(this.children.length=n,this.markDirty()),new Ai(this.mark,e,r)}domAtPos(t){return Vi(this,t)}coordsAt(t,e){return qi(this,t,e)}}class Ri extends pi{static create(t,e,i){return new Ri(t,e,i)}constructor(t,e,i){super(),this.widget=t,this.length=e,this.side=i,this.prevWidget=null}split(t){let e=Ri.create(this.widget,this.length-t,this.side);return this.length-=t,e}sync(t){this.dom&&this.widget.updateDOM(this.dom,t)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(t,e,i,n,s,r){return!(i&&(!(i instanceof Ri&&this.widget.compare(i.widget))||t>0&&s<=0||e0)?fi.before(this.dom):fi.after(this.dom,t==this.length)}domBoundsAround(){return null}coordsAt(t,e){let i=this.widget.coordsAt(this.dom,t,e);if(i)return i;let n=this.dom.getClientRects(),s=null;if(!n.length)return null;let r=this.side?this.side<0:t>0;for(let e=r?n.length-1:0;s=n[e],!(t>0?0==e:e==n.length-1||s.top0?fi.before(this.dom):fi.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(t){return this.dom.getBoundingClientRect()}get overrideDOMText(){return N.empty}get isHidden(){return!0}}function Vi(t,e){let i=t.dom,{children:n}=t,s=0;for(let t=0;st&&e0;t--){let e=n[t-1];if(e.dom.parentNode==i)return e.domAtPos(e.length)}for(let t=s;t0&&e instanceof Ai&&s.length&&(n=s[s.length-1])instanceof Ai&&n.mark.eq(e.mark)?ji(n,e.children[0],i-1):(s.push(e),e.setParent(t)),t.length+=e.length}function qi(t,e,i){let n=null,s=-1,r=null,o=-1;!function t(e,a){for(let l=0,h=0;l=a&&(c.children.length?t(c,a-h):(!r||r.isHidden&&i>0)&&(O>a||h==O&&c.getSide()>0)?(r=c,o=a-h):(h-1?1:0)!=s.length-(i&&s.indexOf(i)>-1?1:0))return!1;for(let r of n)if(r!=i&&(-1==s.indexOf(r)||t[r]!==e[r]))return!1;return!0}function Di(t,e,i){let n=!1;if(e)for(let s in e)i&&s in i||(n=!0,"style"==s?t.style.cssText="":t.removeAttribute(s));if(i)for(let s in i)e&&e[s]==i[s]||(n=!0,"style"==s?t.style.cssText=i[s]:t.setAttribute(s,i[s]));return n}function zi(t){let e=Object.create(null);for(let i=0;i0&&0==this.children[i-1].length;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=t,e}transferDOM(t){this.dom&&(this.markDirty(),t.setDOM(this.dom),t.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(t){Mi(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}append(t,e){ji(this,t,e)}addLineDeco(t){let e=t.spec.attributes,i=t.spec.class;e&&(this.attrs=_i(e,this.attrs||{})),i&&(this.attrs=_i({class:i},this.attrs||{}))}domAtPos(t){return Vi(this,t)}reuseDOM(t){"DIV"==t.nodeName&&(this.setDOM(t),this.flags|=6)}sync(t,e){var i;this.dom?4&this.flags&&(Oi(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(Di(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(t,e);let n=this.dom.lastChild;for(;n&&pi.get(n)instanceof Ai;)n=n.lastChild;if(!(n&&this.length&&("BR"==n.nodeName||0!=(null===(i=pi.get(n))||void 0===i?void 0:i.isEditable)||Ci.ios&&this.children.some((t=>t instanceof Yi))))){let t=document.createElement("BR");t.cmIgnore=!0,this.dom.appendChild(t)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let t,e=0;for(let i of this.children){if(!(i instanceof Yi)||/[^ -~]/.test(i.text))return null;let n=He(i.dom);if(1!=n.length)return null;e+=n[0].width,t=n[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(t,e){let i=qi(this,t,e);if(!this.children.length&&i&&this.parent){let{heightOracle:t}=this.parent.view.viewState,e=i.bottom-i.top;if(Math.abs(e-t.lineHeight)<2&&t.textHeight=e){if(s instanceof Gi)return s;if(r>e)break}n=r+s.breakAfter}return null}}class Ii extends pi{constructor(t,e,i){super(),this.widget=t,this.length=e,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(t,e,i,n,s,r){return!(i&&(!(i instanceof Ii&&this.widget.compare(i.widget))||t>0&&s<=0||e0)}}class Bi{eq(t){return!1}updateDOM(t,e){return!1}compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(t){return!0}coordsAt(t,e,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(t){}}var Ni=function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t}(Ni||(Ni={}));class Ui extends be{constructor(t,e,i,n){super(),this.startSide=t,this.endSide=e,this.widget=i,this.spec=n}get heightRelevant(){return!1}static mark(t){return new Li(t)}static widget(t){let e=Math.max(-1e4,Math.min(1e4,t.side||0)),i=!!t.block;return e+=i&&!t.inlineOrder?e>0?3e8:-4e8:e>0?1e8:-1e8,new Hi(t,e,e,i,t.widget||null,!1)}static replace(t){let e,i,n=!!t.block;if(t.isBlockGap)e=-5e8,i=4e8;else{let{start:s,end:r}=Ji(t,n);e=(s?n?-3e8:-1:5e8)-1,i=1+(r?n?2e8:1:-6e8)}return new Hi(t,e,i,n,t.widget||null,!0)}static line(t){return new Fi(t)}static set(t,e=!1){return ve.of(t,e)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}Ui.none=ve.empty;class Li extends Ui{constructor(t){let{start:e,end:i}=Ji(t);super(e?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.class=t.class||"",this.attrs=t.attributes||null}eq(t){var e,i;return this==t||t instanceof Li&&this.tagName==t.tagName&&(this.class||(null===(e=this.attrs)||void 0===e?void 0:e.class))==(t.class||(null===(i=t.attrs)||void 0===i?void 0:i.class))&&Mi(this.attrs,t.attrs,"class")}range(t,e=t){if(t>=e)throw new RangeError("Mark decorations may not be empty");return super.range(t,e)}}Li.prototype.point=!1;class Fi extends Ui{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof Fi&&this.spec.class==t.spec.class&&Mi(this.spec.attributes,t.spec.attributes)}range(t,e=t){if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,e)}}Fi.prototype.mapMode=mt.TrackBefore,Fi.prototype.point=!0;class Hi extends Ui{constructor(t,e,i,n,s,r){super(e,i,s,t),this.block=n,this.isReplace=r,this.mapMode=n?e<=0?mt.TrackBefore:mt.TrackAfter:mt.TrackDel}get type(){return this.startSide!=this.endSide?Ni.WidgetRange:this.startSide<=0?Ni.WidgetBefore:Ni.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof Hi&&(e=this.widget,i=t.widget,e==i||!!(e&&i&&e.compare(i)))&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide;var e,i}range(t,e=t){if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,e)}}function Ji(t,e=!1){let{inclusiveStart:i,inclusiveEnd:n}=t;return null==i&&(i=t.inclusive),null==n&&(n=t.inclusive),{start:null!=i?i:e,end:null!=n?n:e}}function Ki(t,e,i,n=0){let s=i.length-1;s>=0&&i[s]+n>=t?i[s]=Math.max(i[s],e):i.push(t,e)}Hi.prototype.point=!0;class tn{constructor(t,e,i,n){this.doc=t,this.pos=e,this.end=i,this.disallowBlockEffectsFor=n,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=t.iter(),this.skip=e}posCovered(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let t=this.content[this.content.length-1];return!(t.breakAfter||t instanceof Ii&&t.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Gi),this.atCursorPos=!0),this.curLine}flushBuffer(t=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(en(new Wi(-1),t),t.length),this.pendingBuffer=0)}addBlockWidget(t){this.flushBuffer(),this.curLine=null,this.content.push(t)}finish(t){this.pendingBuffer&&t<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||t&&this.content.length&&this.content[this.content.length-1]instanceof Ii||this.getLine()}buildText(t,e,i){for(;t>0;){if(this.textOff==this.text.length){let{value:e,lineBreak:i,done:n}=this.cursor.next(this.skip);if(this.skip=0,n)throw new Error("Ran out of text content when drawing inline views");if(i){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,t--;continue}this.text=e,this.textOff=0}let n=Math.min(this.text.length-this.textOff,t,512);this.flushBuffer(e.slice(e.length-i)),this.getLine().append(en(new Yi(this.text.slice(this.textOff,this.textOff+n)),e),i),this.atCursorPos=!0,this.textOff+=n,t-=n,i=0}}span(t,e,i,n){this.buildText(e-t,i,n),this.pos=e,this.openStart<0&&(this.openStart=n)}point(t,e,i,n,s,r){if(this.disallowBlockEffectsFor[r]&&i instanceof Hi){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(e>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let o=e-t;if(i instanceof Hi)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Ii(i.widget||new nn("div"),o,i));else{let r=Ri.create(i.widget||new nn("span"),o,o?0:i.startSide),a=this.atCursorPos&&!r.isEditable&&s<=n.length&&(t0),l=!r.isEditable&&(tn.length||i.startSide<=0),h=this.getLine();2!=this.pendingBuffer||a||r.isEditable||(this.pendingBuffer=0),this.flushBuffer(n),a&&(h.append(en(new Wi(1),n),s),s=n.length+Math.max(0,s-n.length)),h.append(en(r,n),s),this.atCursorPos=l,this.pendingBuffer=l?tn.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=n.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);o&&(this.textOff+o<=this.text.length?this.textOff+=o:(this.skip+=o-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=e),this.openStart<0&&(this.openStart=s)}static build(t,e,i,n,s){let r=new tn(t,e,i,s);return r.openEnd=ve.spans(n,e,i,r),r.openStart<0&&(r.openStart=r.openEnd),r.finish(r.openEnd),r}}function en(t,e){for(let i of e)t=new Ai(i,[t],t.length);return t}class nn extends Bi{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}var sn=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(sn||(sn={}));const rn=sn.LTR,on=sn.RTL;function an(t){let e=[];for(let i=0;i=e){if(o.level==i)return r;(s<0||(0!=n?n<0?o.frome:t[s].level>o.level))&&(s=r)}}if(s<0)throw new RangeError("Index out of range");return s}}function pn(t,e){if(t.length!=e.length)return!1;for(let i=0;il&&o.push(new dn(l,d.from,u)),wn(t,d.direction==rn!=!(u%2)?n+1:n,s,d.inner,d.from,d.to,o),l=d.to}f=d.to}else{if(f==i||(e?mn[f]!=a:mn[f]==a))break;f++}O?gn(t,l,f,n+1,s,O,o):le;){let i=!0,c=!1;if(!h||l>r[h-1].to){let t=mn[l-1];t!=a&&(i=!1,c=16==t)}let O=i||1!=a?null:[],u=i?n:n+1,f=l;t:for(;;)if(h&&f==r[h-1].to){if(c)break t;let d=r[--h];if(!i)for(let t=d.from,i=h;;){if(t==e)break t;if(!i||r[i-1].to!=t){if(mn[t-1]==a)break t;break}t=r[--i].from}if(O)O.push(d);else{d.to=0;t-=3)if(On[t+1]==-i){let e=On[t+2],i=2&e?s:4&e?1&e?r:s:0;i&&(mn[o]=mn[On[t]]=i),a=t;break}}else{if(189==On.length)break;On[a++]=o,On[a++]=e,On[a++]=l}else if(2==(n=mn[o])||1==n){let t=n==s;l=t?0:1;for(let e=a-3;e>=0;e-=3){let i=On[e+2];if(2&i)break;if(t)On[e+2]|=2;else{if(4&i)break;On[e+2]|=4}}}}}(t,s,r,n,a),function(t,e,i,n){for(let s=0,r=n;s<=i.length;s++){let o=s?i[s-1].to:t,a=sl;)e==r&&(e=i[--n].from,r=n?i[n-1].to:t),mn[--e]=c;l=o}else r=o,l++}}}(s,r,n,a),gn(t,s,r,e,i,n,o)}function bn(t){return[new dn(0,t,0)]}let Sn="";function yn(t,e,i,n,s){var r;let o=n.head-t.from,a=dn.find(e,o,null!==(r=n.bidiLevel)&&void 0!==r?r:-1,n.assoc),l=e[a],h=l.side(s,i);if(o==h){let t=a+=s?1:-1;if(t<0||t>=e.length)return null;l=e[a=t],o=l.side(!s,i),h=l.side(s,i)}let c=at(t.text,o,l.forward(s,i));(cl.to)&&(c=h),Sn=t.text.slice(Math.min(o,c),Math.max(o,c));let O=a==(s?e.length-1:0)?null:e[a+(s?1:-1)];return O&&c==h&&O.level+(s?0:1)t.some((t=>t))}),Cn=Tt.define({combine:t=>t.some((t=>t))});class Yn{constructor(t,e="nearest",i="nearest",n=5,s=5,r=!1){this.range=t,this.y=e,this.x=i,this.yMargin=n,this.xMargin=s,this.isSnapshot=r}map(t){return t.empty?this:new Yn(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new Yn($t.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const An=re.define({map:(t,e)=>t.map(e)});function Rn(t,e,i){let n=t.facet($n);n.length?n[0](e):window.onerror?window.onerror(String(e),i,void 0,void 0,e):i?console.error(i+":",e):console.error(e)}const Wn=Tt.define({combine:t=>!t.length||t[0]});let Vn=0;const jn=Tt.define();class qn{constructor(t,e,i,n,s){this.id=t,this.create=e,this.domEventHandlers=i,this.domEventObservers=n,this.extension=s(this)}static define(t,e){const{eventHandlers:i,eventObservers:n,provide:s,decorations:r}=e||{};return new qn(Vn++,t,i,n,(t=>{let e=[jn.of(t)];return r&&e.push(Dn.of((e=>{let i=e.plugin(t);return i?r(i):Ui.none}))),s&&e.push(s(t)),e}))}static fromClass(t,e){return qn.define((e=>new t(e)),e)}}class _n{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}update(t){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(e){if(Rn(t.state,e,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(t){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(t)}catch(e){Rn(t.state,e,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var e;if(null===(e=this.value)||void 0===e?void 0:e.destroy)try{this.value.destroy()}catch(e){Rn(t.state,e,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const En=Tt.define(),Mn=Tt.define(),Dn=Tt.define(),zn=Tt.define(),Gn=Tt.define(),In=Tt.define();function Bn(t,e){let i=t.state.facet(In);if(!i.length)return i;let n=i.map((e=>e instanceof Function?e(t):e)),s=[];return ve.spans(n,e.from,e.to,{point(){},span(t,i,n,r){let o=t-e.from,a=i-e.from,l=s;for(let t=n.length-1;t>=0;t--,r--){let i,s=n[t].spec.bidiIsolate;if(null==s&&(s=Qn(e.text,o,a)),r>0&&l.length&&(i=l[l.length-1]).to==o&&i.direction==s)i.to=a,l=i.inner;else{let t={from:o,to:a,direction:s,inner:[]};l.push(t),l=t.inner}}}}),s}const Nn=Tt.define();function Un(t){let e=0,i=0,n=0,s=0;for(let r of t.state.facet(Nn)){let o=r(t);o&&(null!=o.left&&(e=Math.max(e,o.left)),null!=o.right&&(i=Math.max(i,o.right)),null!=o.top&&(n=Math.max(n,o.top)),null!=o.bottom&&(s=Math.max(s,o.bottom)))}return{left:e,right:i,top:n,bottom:s}}const Ln=Tt.define();class Fn{constructor(t,e,i,n){this.fromA=t,this.toA=e,this.fromB=i,this.toB=n}join(t){return new Fn(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,i=this;for(;e>0;e--){let n=t[e-1];if(!(n.fromA>i.toA)){if(n.toAh)break;s+=2}if(!a)return i;new Fn(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),r=a.toA,o=a.toB}}}class Hn{constructor(t,e,i){this.view=t,this.state=e,this.transactions=i,this.flags=0,this.startState=t.state,this.changes=wt.empty(this.startState.doc.length);for(let t of i)this.changes=this.changes.compose(t.changes);let n=[];this.changes.iterChangedRanges(((t,e,i,s)=>n.push(new Fn(t,e,i,s)))),this.changedRanges=n}static create(t,e,i){return new Hn(t,e,i)}get viewportChanged(){return(4&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(10&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some((t=>t.selection))}get empty(){return 0==this.flags&&0==this.transactions.length}}class Jn extends pi{get length(){return this.view.state.doc.length}constructor(t){super(),this.view=t,this.decorations=[],this.dynamicDecorationMap=[],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(t.contentDOM),this.children=[new Gi],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Fn(0,0,0,t.state.doc.length)],0,null)}update(t){var e;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every((({fromA:t,toA:e})=>ethis.minWidthTo))?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let n=-1;this.view.inputState.composing>=0&&((null===(e=this.domChanged)||void 0===e?void 0:e.newSel)?n=this.domChanged.newSel.head:function(t,e){let i=!1;e&&t.iterChangedRanges(((t,n)=>{te.from&&(i=!0)}));return i}(t.changes,this.hasComposition)||t.selectionSet||(n=t.state.selection.main.head));let s=n>-1?function(t,e,i){let n=ts(t,i);if(!n)return null;let{node:s,from:r,to:o}=n,a=s.nodeValue;if(/[\n\r]/.test(a))return null;if(t.state.doc.sliceString(n.from,n.to)!=a)return null;let l=e.invertedDesc,h=new Fn(l.mapPos(r),l.mapPos(o),r,o),c=[];for(let e=s.parentNode;;e=e.parentNode){let i=pi.get(e);if(i instanceof Ai)c.push({node:e,deco:i.mark});else{if(i instanceof Gi||"DIV"==e.nodeName&&e.parentNode==t.contentDOM)return{range:h,text:s,marks:c,line:e};if(e==t.contentDOM)return null;c.push({node:e,deco:new Li({inclusive:!0,attributes:zi(e),tagName:e.tagName.toLowerCase()})})}}}(this.view,t.changes,n):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:e,to:n}=this.hasComposition;i=new Fn(e,n,t.changes.mapPos(e,-1),t.changes.mapPos(n,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(Ci.ie||Ci.chrome)&&!s&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let r=function(t,e,i){let n=new is;return ve.compare(t,e,i,n),n.changes}(this.decorations,this.updateDeco(),t.changes);return i=Fn.extendWithRanges(i,r),!!(7&this.flags||0!=i.length)&&(this.updateInner(i,t.startState.doc.length,s),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,e,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(t,e,i);let{observer:n}=this.view;n.ignore((()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let t=Ci.chrome||Ci.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,t),this.flags&=-8,t&&(t.written||n.selectionRange.focusNode!=t.node)&&(this.forceSelection=!0),this.dom.style.height=""})),this.markedForComposition.forEach((t=>t.flags&=-9));let s=[];if(this.view.viewport.from||this.view.viewport.to=0?n[t]:null;if(!e)break;let r,o,a,l,{fromA:h,toA:c,fromB:O,toB:u}=e;if(i&&i.range.fromBO){let t=tn.build(this.view.state.doc,O,i.range.fromB,this.decorations,this.dynamicDecorationMap),e=tn.build(this.view.state.doc,i.range.toB,u,this.decorations,this.dynamicDecorationMap);o=t.breakAtStart,a=t.openStart,l=e.openEnd;let n=this.compositionView(i);e.breakAtStart?n.breakAfter=1:e.content.length&&n.merge(n.length,n.length,e.content[0],!1,e.openStart,0)&&(n.breakAfter=e.content[0].breakAfter,e.content.shift()),t.content.length&&n.merge(0,0,t.content[t.content.length-1],!0,0,t.openEnd)&&t.content.pop(),r=t.content.concat(n).concat(e.content)}else({content:r,breakAtStart:o,openStart:a,openEnd:l}=tn.build(this.view.state.doc,O,u,this.decorations,this.dynamicDecorationMap));let{i:f,off:d}=s.findPos(c,1),{i:p,off:m}=s.findPos(h,-1);wi(this,p,m,f,d,r,o,a,l)}i&&this.fixCompositionDOM(i)}compositionView(t){let e=new Yi(t.text.nodeValue);e.flags|=8;for(let{deco:i}of t.marks)e=new Ai(i,[e],e.length);let i=new Gi;return i.append(e,0),i}fixCompositionDOM(t){let e=(t,e)=>{e.flags|=8|(e.children.some((t=>7&t.flags))?1:0),this.markedForComposition.add(e);let i=pi.get(t);i&&i!=e&&(i.dom=null),e.setDOM(t)},i=this.childPos(t.range.fromB,1),n=this.children[i.i];e(t.line,n);for(let s=t.marks.length-1;s>=-1;s--)i=n.childPos(i.off,1),n=n.children[i.i],e(s>=0?t.marks[s].node:t.text,n)}updateSelection(t=!1,e=!1){!t&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let i=this.view.root.activeElement,n=i==this.dom,s=!n&&Fe(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(n||e||s))return;let r=this.forceSelection;this.forceSelection=!1;let o=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(o.anchor)),l=o.empty?a:this.moveToLine(this.domAtPos(o.head));if(Ci.gecko&&o.empty&&!this.hasComposition&&(1==(h=a).node.nodeType&&h.node.firstChild&&(0==h.offset||"false"==h.node.childNodes[h.offset-1].contentEditable)&&(h.offset==h.node.childNodes.length||"false"==h.node.childNodes[h.offset].contentEditable))){let t=document.createTextNode("");this.view.observer.ignore((()=>a.node.insertBefore(t,a.node.childNodes[a.offset]||null))),a=l=new fi(t,0),r=!0}var h;let c=this.view.observer.selectionRange;!r&&c.focusNode&&(Je(a.node,a.offset,c.anchorNode,c.anchorOffset)&&Je(l.node,l.offset,c.focusNode,c.focusOffset)||this.suppressWidgetCursorChange(c,o))||(this.view.observer.ignore((()=>{Ci.android&&Ci.chrome&&this.dom.contains(c.focusNode)&&function(t,e){for(let i=t;i&&i!=e;i=i.assignedSlot||i.parentNode)if(1==i.nodeType&&"false"==i.contentEditable)return!0;return!1}(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let t=Ue(this.view.root);if(t)if(o.empty){if(Ci.gecko){let t=(e=a.node,n=a.offset,1!=e.nodeType?0:(n&&"false"==e.childNodes[n-1].contentEditable?1:0)|(no.head&&([a,l]=[l,a]),e.setEnd(l.node,l.offset),e.setStart(a.node,a.offset),t.removeAllRanges(),t.addRange(e)}else;var e,n;s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())})),this.view.observer.setSelectionRange(a,l)),this.impreciseAnchor=a.precise?null:new fi(c.anchorNode,c.anchorOffset),this.impreciseHead=l.precise?null:new fi(c.focusNode,c.focusOffset)}suppressWidgetCursorChange(t,e){return this.hasComposition&&e.empty&&Je(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==e.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,e=t.state.selection.main,i=Ue(t.root),{anchorNode:n,anchorOffset:s}=t.observer.selectionRange;if(!(i&&e.empty&&e.assoc&&i.modify))return;let r=Gi.find(this,e.head);if(!r)return;let o=r.posAtStart;if(e.head==o||e.head==o+r.length)return;let a=this.coordsAt(e.head,-1),l=this.coordsAt(e.head,1);if(!a||!l||a.bottom>l.top)return;let h=this.domAtPos(e.head+e.assoc);i.collapse(h.node,h.offset),i.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let c=t.observer.selectionRange;t.docView.posFromDOM(c.anchorNode,c.anchorOffset)!=e.from&&i.collapse(n,s)}moveToLine(t){let e,i=this.dom;if(t.node!=i)return t;for(let n=t.offset;!e&&n=0;n--){let t=pi.get(i.childNodes[n]);t instanceof Gi&&(e=t.domAtPos(t.length))}return e?new fi(e.node,e.offset,!0):t}nearest(t){for(let e=t;e;){let t=pi.get(e);if(t&&t.rootView==this)return t;e=e.parentNode}return null}posFromDOM(t,e){let i=this.nearest(t);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(t,e)+i.posAtStart}domAtPos(t){let{i:e,off:i}=this.childCursor().findPos(t,-1);for(;e=0;r--){let o=this.children[r],a=s-o.breakAfter,l=a-o.length;if(at||o.covers(1))&&(!i||o instanceof Gi&&!(i instanceof Gi&&e>=0))&&(i=o,n=l),s=l}return i?i.coordsAt(t-n,e):null}coordsForChar(t){let{i:e,off:i}=this.childPos(t,1),n=this.children[e];if(!(n instanceof Gi))return null;for(;n.children.length;){let{i:t,off:e}=n.childPos(i,1);for(;;t++){if(t==n.children.length)return null;if((n=n.children[t]).length)break}i=e}if(!(n instanceof Yi))return null;let s=at(n.text,i);if(s==i)return null;let r=hi(n.dom,i,s).getClientRects();for(let t=0;tMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,a=this.view.textDirection==sn.LTR;for(let t=0,l=0;ln)break;if(t>=i){let i=h.dom.getBoundingClientRect();if(e.push(i.height),r){let e=h.dom.lastChild,n=e?He(e):[];if(n.length){let e=n[n.length-1],r=a?e.right-i.left:i.right-e.left;r>o&&(o=r,this.minWidth=s,this.minWidthFrom=t,this.minWidthTo=c)}}}t=c+h.breakAfter}return e}textDirectionAt(t){let{i:e}=this.childPos(t,1);return"rtl"==getComputedStyle(this.children[e].dom).direction?sn.RTL:sn.LTR}measureTextSize(){for(let t of this.children)if(t instanceof Gi){let e=t.measureTextSize();if(e)return e}let t,e,i,n=document.createElement("div");return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((()=>{this.dom.appendChild(n);let s=He(n.firstChild)[0];t=n.getBoundingClientRect().height,e=s?s.width/27:7,i=s?s.height:t,n.remove()})),{lineHeight:t,charWidth:e,textHeight:i}}childCursor(t=this.length){let e=this.children.length;return e&&(t-=this.children[--e].length),new gi(this.children,t,e)}computeBlockGapDeco(){let t=[],e=this.view.viewState;for(let i=0,n=0;;n++){let s=n==e.viewports.length?null:e.viewports[n],r=s?s.from-1:this.length;if(r>i){let n=(e.lineBlockAt(r).bottom-e.lineBlockAt(i).top)/this.view.scaleY;t.push(Ui.replace({widget:new Kn(n),block:!0,inclusive:!0,isBlockGap:!0}).range(i,r))}if(!s)break;i=s.to+1}return Ui.set(t)}updateDeco(){let t=this.view.state.facet(Dn).map(((t,e)=>(this.dynamicDecorationMap[e]="function"==typeof t)?t(this.view):t)),e=!1,i=this.view.state.facet(zn).map(((t,i)=>{let n="function"==typeof t;return n&&(e=!0),n?t(this.view):t}));i.length&&(this.dynamicDecorationMap[t.length]=e,t.push(ve.join(i)));for(let e=t.length;ei.anchor?-1:1);if(!n)return;!i.empty&&(e=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(n={left:Math.min(n.left,e.left),top:Math.min(n.top,e.top),right:Math.max(n.right,e.right),bottom:Math.max(n.bottom,e.bottom)});let s=Un(this.view),r={left:n.left-s.left,top:n.top-s.top,right:n.right+s.right,bottom:n.bottom+s.bottom},{offsetWidth:o,offsetHeight:a}=this.view.scrollDOM;!function(t,e,i,n,s,r,o,a){let l=t.ownerDocument,h=l.defaultView||window;for(let c=t,O=!1;c&&!O;)if(1==c.nodeType){let t,u=c==l.body,f=1,d=1;if(u)t=ni(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(O=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let e=c.getBoundingClientRect();({scaleX:f,scaleY:d}=si(c,e)),t={left:e.left,right:e.left+c.clientWidth*f,top:e.top,bottom:e.top+c.clientHeight*d}}let p=0,m=0;if("nearest"==s)e.top0&&e.bottom>t.bottom+m&&(m=e.bottom-t.bottom+m+o)):e.bottom>t.bottom&&(m=e.bottom-t.bottom+o,i<0&&e.top-m0&&e.right>t.right+p&&(p=e.right-t.right+p+r)):e.right>t.right&&(p=e.right-t.right+r,i<0&&e.left0))break;i=i.childNodes[n-1],n=ei(i)}if(i>=0)for(let n=t,s=e;;){if(3==n.nodeType)return{node:n,offset:s};if(!(1==n.nodeType&&s=0))break;n=n.childNodes[s],s=0}return null}let is=class{constructor(){this.changes=[]}compareRange(t,e){Ki(t,e,this.changes)}comparePoint(t,e){Ki(t,e,this.changes)}};function ns(t,e){return e.left>t?e.left-t:Math.max(0,t-e.right)}function ss(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function rs(t,e){return t.tope.top+1}function os(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function ls(t,e,i){let n,s,r,o,a,l,h,c,O=!1;for(let u=t.firstChild;u;u=u.nextSibling){let t=He(u);for(let f=0;fm||o==m&&r>p){n=u,s=d,r=p,o=m;let a=m?i0?f0)}0==p?i>d.bottom&&(!h||h.bottomd.top)&&(l=u,c=d):h&&rs(h,d)?h=as(h,d.bottom):c&&rs(c,d)&&(c=os(c,d.top))}}if(h&&h.bottom>=i?(n=a,s=h):c&&c.top<=i&&(n=l,s=c),!n)return{node:t,offset:0};let u=Math.max(s.left,Math.min(s.right,e));return 3==n.nodeType?hs(n,u,i):O&&"false"!=n.contentEditable?ls(n,u,i):{node:t,offset:Array.prototype.indexOf.call(t.childNodes,n)+(e>=(s.left+s.right)/2?1:0)}}function hs(t,e,i){let n=t.nodeValue.length,s=-1,r=1e9,o=0;for(let a=0;ai?h.top-i:i-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&c=(h.left+h.right)/2,n=i;if(Ci.chrome||Ci.gecko){hi(t,a).getBoundingClientRect().left==h.right&&(n=!i)}if(c<=0)return{node:t,offset:a+(n?1:0)};s=a+(n?1:0),r=c}}}return{node:t,offset:s>-1?s:o>0?t.nodeValue.length:0}}function cs(t,e,i,n=-1){var s,r;let o,a=t.contentDOM.getBoundingClientRect(),l=a.top+t.viewState.paddingTop,{docHeight:h}=t.viewState,{x:c,y:O}=e,u=O-l;if(u<0)return 0;if(u>h)return t.state.doc.length;for(let e=t.viewState.heightOracle.textHeight/2,s=!1;o=t.elementAtHeight(u),o.type!=Ni.Text;)for(;u=n>0?o.bottom+e:o.top-e,!(u>=0&&u<=h);){if(s)return i?null:0;s=!0,n=-n}O=l+u;let f=o.from;if(ft.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:i?null:Os(t,a,o,c,O);let d=t.dom.ownerDocument,p=t.root.elementFromPoint?t.root:d,m=p.elementFromPoint(c,O);m&&!t.contentDOM.contains(m)&&(m=null),m||(c=Math.max(a.left+1,Math.min(a.right-1,c)),m=p.elementFromPoint(c,O),m&&!t.contentDOM.contains(m)&&(m=null));let g,w=-1;if(m&&0!=(null===(s=t.docView.nearest(m))||void 0===s?void 0:s.isEditable))if(d.caretPositionFromPoint){let t=d.caretPositionFromPoint(c,O);t&&({offsetNode:g,offset:w}=t)}else if(d.caretRangeFromPoint){let e=d.caretRangeFromPoint(c,O);e&&(({startContainer:g,startOffset:w}=e),(!t.contentDOM.contains(g)||Ci.safari&&function(t,e,i){let n;if(3!=t.nodeType||e!=(n=t.nodeValue.length))return!1;for(let e=t.nextSibling;e;e=e.nextSibling)if(1!=e.nodeType||"BR"!=e.nodeName)return!1;return hi(t,n-1,n).getBoundingClientRect().left>i}(g,w,c)||Ci.chrome&&function(t,e,i){if(0!=e)return!1;for(let e=t;;){let t=e.parentNode;if(!t||1!=t.nodeType||t.firstChild!=e)return!1;if(t.classList.contains("cm-line"))break;e=t}let n=1==t.nodeType?t.getBoundingClientRect():hi(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return i-n.left>5}(g,w,c))&&(g=void 0))}if(!g||!t.docView.dom.contains(g)){let e=Gi.find(t.docView,f);if(!e)return u>o.top+o.height/2?o.to:o.from;({node:g,offset:w}=ls(e.dom,c,O))}let b=t.docView.nearest(g);if(!b)return null;if(b.isWidget&&1==(null===(r=b.dom)||void 0===r?void 0:r.nodeType)){let t=b.dom.getBoundingClientRect();return e.y1.5*t.defaultLineHeight){let e=t.viewState.heightOracle.textHeight;r+=Math.floor((s-i.top-.5*(t.defaultLineHeight-e))/e)*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(i.from,i.to);return i.from+function(t,e,i,n){for(let n=0,s=0;;){if(s>=e)return n;if(n==t.length)break;s+=9==t.charCodeAt(n)?i-s%i:1,n=at(t,n)}return!0===n?-1:t.length}(o,r,t.state.tabSize)}function us(t,e){let i=t.lineBlockAt(e);if(Array.isArray(i.type))for(let t of i.type)if(t.to>e||t.to==e&&(t.to==i.to||t.type==Ni.Text))return t;return i}function fs(t,e,i,n){let s=t.state.doc.lineAt(e.head),r=t.bidiSpans(s),o=t.textDirectionAt(s.from);for(let a=e,l=null;;){let e=yn(s,r,o,a,i),h=Sn;if(!e){if(s.number==(i?t.state.doc.lines:1))return a;h="\n",s=t.state.doc.line(s.number+(i?1:-1)),r=t.bidiSpans(s),e=t.visualLineSide(s,!i)}if(l){if(!l(h))return a}else{if(!n)return e;l=n(h)}a=e}}function ds(t,e,i){for(;;){let n=0;for(let s of t)s.between(e-1,e+1,((t,s,r)=>{if(e>t&&ee(t))),i.from,e.head>i.from?-1:1);return n==i.from?i:$t.cursor(n,nnull)),Ci.gecko&&function(t){zs.has(t)||(zs.add(t),t.addEventListener("copy",(()=>{})),t.addEventListener("cut",(()=>{})))}(t.contentDOM.ownerDocument)}handleEvent(t){(function(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let i,n=e.target;n!=t.contentDOM;n=n.parentNode)if(!n||11==n.nodeType||(i=pi.get(n))&&i.ignoreEvent(e))return!1;return!0})(this.view,t)&&!this.ignoreDuringComposition(t)&&("keydown"==t.type&&this.keydown(t)||this.runHandlers(t.type,t))}runHandlers(t,e){let i=this.handlers[t];if(i){for(let t of i.observers)t(this.view,e);for(let t of i.handlers){if(e.defaultPrevented)break;if(t(this.view,e)){e.preventDefault();break}}}}ensureHandlers(t){let e=ws(t),i=this.handlers,n=this.view.contentDOM;for(let t in e)if("scroll"!=t){let s=!e[t].handlers.length,r=i[t];r&&s!=!r.handlers.length&&(n.removeEventListener(t,this.handleEvent),r=null),r||n.addEventListener(t,this.handleEvent,{passive:s})}for(let t in i)"scroll"==t||e[t]||n.removeEventListener(t,this.handleEvent);this.handlers=e}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),9==t.keyCode&&Date.now()e.keyCode==t.keyCode)))&&!t.ctrlKey||Ss.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(229!=t.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=e||t,setTimeout((()=>this.flushIOSKey()),250),!0)}flushIOSKey(){let t=this.pendingIOSKey;return!!t&&(this.pendingIOSKey=void 0,ci(this.view.contentDOM,t.key,t.keyCode))}ignoreDuringComposition(t){return!!/^key/.test(t.type)&&(this.composing>0||!!(Ci.safari&&!Ci.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function gs(t,e){return(i,n)=>{try{return e.call(t,n,i)}catch(t){Rn(i.state,t)}}}function ws(t){let e=Object.create(null);function i(t){return e[t]||(e[t]={observers:[],handlers:[]})}for(let e of t){let t=e.spec;if(t&&t.domEventHandlers)for(let n in t.domEventHandlers){let s=t.domEventHandlers[n];s&&i(n).handlers.push(gs(e.value,s))}if(t&&t.domEventObservers)for(let n in t.domEventObservers){let s=t.domEventObservers[n];s&&i(n).observers.push(gs(e.value,s))}}for(let t in xs)i(t).handlers.push(xs[t]);for(let t in ks)i(t).observers.push(ks[t]);return e}const bs=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Ss="dthko",ys=[16,17,18,20,91,92,224,225];function Qs(t){return.7*Math.max(0,t)+8}class vs{constructor(t,e,i,n){this.view=t,this.startEvent=e,this.style=i,this.mustSelect=n,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=e,this.scrollParent=function(t){let e=t.ownerDocument;for(let i=t.parentNode;i&&i!=e.body;)if(1==i.nodeType){if(i.scrollHeight>i.clientHeight||i.scrollWidth>i.clientWidth)return i;i=i.assignedSlot||i.parentNode}else{if(11!=i.nodeType)break;i=i.host}return null}(t.contentDOM),this.atoms=t.state.facet(Gn).map((e=>e(t)));let s=t.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(ge.allowMultipleSelections)&&function(t,e){let i=t.state.facet(vn);return i.length?i[0](e):Ci.mac?e.metaKey:e.ctrlKey}(t,e),this.dragging=!(!function(t,e){let{main:i}=t.state.selection;if(i.empty)return!1;let n=Ue(t.root);if(!n||0==n.rangeCount)return!0;let s=n.getRangeAt(0).getClientRects();for(let t=0;t=e.clientX&&i.top<=e.clientY&&i.bottom>=e.clientY)return!0}return!1}(t,e)||1!=js(e))&&null}start(t){!1===this.dragging&&this.select(t)}move(t){var e,i,n;if(0==t.buttons)return this.destroy();if(this.dragging||null==this.dragging&&(i=this.startEvent,n=t,Math.max(Math.abs(i.clientX-n.clientX),Math.abs(i.clientY-n.clientY))<10))return;this.select(this.lastEvent=t);let s=0,r=0,o=(null===(e=this.scrollParent)||void 0===e?void 0:e.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},a=Un(this.view);t.clientX-a.left<=o.left+6?s=-Qs(o.left-t.clientX):t.clientX+a.right>=o.right-6&&(s=Qs(t.clientX-o.right)),t.clientY-a.top<=o.top+6?r=-Qs(o.top-t.clientY):t.clientY+a.bottom>=o.bottom-6&&(r=Qs(t.clientY-o.bottom)),this.setScrollSpeed(s,r)}up(t){null==this.dragging&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,e){this.scrollSpeed={x:t,y:e},t||e?this.scrolling<0&&(this.scrolling=setInterval((()=>this.scroll()),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),!1===this.dragging&&this.select(this.lastEvent)}skipAtoms(t){let e=null;for(let i=0;ithis.select(this.lastEvent)),20)}}const xs=Object.create(null),ks=Object.create(null),$s=Ci.ie&&Ci.ie_version<15||Ci.ios&&Ci.webkit_version<604;function Ps(t,e){let i,{state:n}=t,s=1,r=n.toText(e),o=r.lines==n.selection.ranges.length;if(null!=_s&&n.selection.ranges.every((t=>t.empty))&&_s==r.toString()){let t=-1;i=n.changeByRange((i=>{let a=n.doc.lineAt(i.from);if(a.from==t)return{range:i};t=a.from;let l=n.toText((o?r.line(s++).text:e)+n.lineBreak);return{changes:{from:a.from,insert:l},range:$t.cursor(i.from+l.length)}}))}else i=o?n.changeByRange((t=>{let e=r.line(s++);return{changes:{from:t.from,to:t.to,insert:e.text},range:$t.cursor(t.from+e.length)}})):n.replaceSelection(r);t.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}function Zs(t,e,i,n){if(1==n)return $t.cursor(e,i);if(2==n)return function(t,e,i=1){let n=t.charCategorizer(e),s=t.doc.lineAt(e),r=e-s.from;if(0==s.length)return $t.cursor(e);0==r?i=1:r==s.length&&(i=-1);let o=r,a=r;i<0?o=at(s.text,r,!1):a=at(s.text,r);let l=n(s.text.slice(o,a));for(;o>0;){let t=at(s.text,o,!1);if(n(s.text.slice(t,o))!=l)break;o=t}for(;a{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft},xs.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),27==e.keyCode&&(t.inputState.lastEscPress=Date.now()),!1),ks.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")},ks.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")},xs.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let i=null;for(let n of t.state.facet(kn))if(i=n(t,e),i)break;if(i||0!=e.button||(i=function(t,e){let i=Ys(t,e),n=js(e),s=t.state.selection;return{update(t){t.docChanged&&(i.pos=t.changes.mapPos(i.pos),s=s.map(t.changes))},get(e,r,o){let a,l=Ys(t,e),h=Zs(t,l.pos,l.bias,n);if(i.pos!=l.pos&&!r){let e=Zs(t,i.pos,i.bias,n),s=Math.min(e.from,h.from),r=Math.max(e.to,h.to);h=s1&&(a=function(t,e){for(let i=0;i=e)return $t.create(t.ranges.slice(0,i).concat(t.ranges.slice(i+1)),t.mainIndex==i?0:t.mainIndex-(t.mainIndex>i?1:0))}return null}(s,l.pos))?a:o?s.addRange(h):$t.create([h])}}}(t,e)),i){let n=!t.hasFocus;t.inputState.startMouseSelection(new vs(t,e,i,n)),n&&t.observer.ignore((()=>li(t.contentDOM)));let s=t.inputState.mouseSelection;if(s)return s.start(e),!1===s.dragging}return!1};let Ts=(t,e)=>t>=e.top&&t<=e.bottom,Xs=(t,e,i)=>Ts(e,i)&&t>=i.left&&t<=i.right;function Cs(t,e,i,n){let s=Gi.find(t.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(0==r)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&Xs(i,n,o))return-1;let a=s.coordsAt(r,1);return a&&Xs(i,n,a)?1:o&&Ts(n,o)?-1:1}function Ys(t,e){let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:i,bias:Cs(t,i,e.clientX,e.clientY)}}const As=Ci.ie&&Ci.ie_version<=11;let Rs=null,Ws=0,Vs=0;function js(t){if(!As)return t.detail;let e=Rs,i=Vs;return Rs=t,Vs=Date.now(),Ws=!e||i>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(Ws+1)%3:1}function qs(t,e,i,n){if(!i)return;let s=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=t.inputState,o=n&&r&&function(t,e){let i=t.state.facet(xn);return i.length?i[0](e):Ci.mac?!e.altKey:!e.ctrlKey}(t,e)?{from:r.from,to:r.to}:null,a={from:s,insert:i},l=t.state.changes(o?[o,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(s,-1),head:l.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}xs.dragstart=(t,e)=>{let{selection:{main:i}}=t.state;if(e.target.draggable){let n=t.docView.nearest(e.target);if(n&&n.isWidget){let t=n.posAtStart,e=t+n.length;(t>=i.to||e<=i.from)&&(i=$t.range(t,e))}}let{inputState:n}=t;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=i,e.dataTransfer&&(e.dataTransfer.setData("Text",t.state.sliceDoc(i.from,i.to)),e.dataTransfer.effectAllowed="copyMove"),!1},xs.dragend=t=>(t.inputState.draggedContent=null,!1),xs.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let i=e.dataTransfer.files;if(i&&i.length){let n=Array(i.length),s=0,r=()=>{++s==i.length&&qs(t,e,n.filter((t=>null!=t)).join(t.state.lineBreak),!1)};for(let t=0;t{/[\x00-\x08\x0e-\x1f]{2}/.test(e.result)||(n[t]=e.result),r()},e.readAsText(i[t])}return!0}{let i=e.dataTransfer.getData("Text");if(i)return qs(t,e,i,!0),!0}return!1},xs.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let i=$s?null:e.clipboardData;return i?(Ps(t,i.getData("text/plain")||i.getData("text/uri-text")),!0):(function(t){let e=t.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout((()=>{t.focus(),i.remove(),Ps(t,i.value)}),50)}(t),!1)};let _s=null;xs.copy=xs.cut=(t,e)=>{let{text:i,ranges:n,linewise:s}=function(t){let e=[],i=[],n=!1;for(let n of t.selection.ranges)n.empty||(e.push(t.sliceDoc(n.from,n.to)),i.push(n));if(!e.length){let s=-1;for(let{from:n}of t.selection.ranges){let r=t.doc.lineAt(n);r.number>s&&(e.push(r.text),i.push({from:r.from,to:Math.min(t.doc.length,r.to+1)})),s=r.number}n=!0}return{text:e.join(t.lineBreak),ranges:i,linewise:n}}(t.state);if(!i&&!s)return!1;_s=s?i:null,"cut"!=e.type||t.state.readOnly||t.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let r=$s?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",i),!0):(function(t,e){let i=t.dom.parentNode;if(!i)return;let n=i.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout((()=>{n.remove(),t.focus()}),50)}(t,i),!1)};const Es=ie.define();function Ms(t,e){let i=[];for(let n of t.facet(Tn)){let s=n(t,e);s&&i.push(s)}return i?t.update({effects:i,annotations:Es.of(!0)}):null}function Ds(t){setTimeout((()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let i=Ms(t.state,e);i?t.dispatch(i):t.update([])}}),10)}ks.focus=t=>{t.inputState.lastFocusTime=Date.now(),t.scrollDOM.scrollTop||!t.inputState.lastScrollTop&&!t.inputState.lastScrollLeft||(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),Ds(t)},ks.blur=t=>{t.observer.clearSelectionRange(),Ds(t)},ks.compositionstart=ks.compositionupdate=t=>{null==t.inputState.compositionFirstChange&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0)},ks.compositionend=t=>{t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Ci.chrome&&Ci.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then((()=>t.observer.flush())):setTimeout((()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])}),50)},ks.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()},xs.beforeinput=(t,e)=>{var i;let n;if(Ci.chrome&&Ci.android&&(n=bs.find((t=>t.inputType==e.inputType)))&&(t.observer.delayAndroidKey(n.key,n.keyCode),"Backspace"==n.key||"Delete"==n.key)){let e=(null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0;setTimeout((()=>{var i;((null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0)>e+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())}),100)}return!1};const zs=new Set;const Gs=["pre-wrap","normal","pre-line","break-spaces"];class Is{constructor(t){this.lineWrapping=t,this.doc=N.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(t,e){let i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){if(!this.lineWrapping)return this.lineHeight;return(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return Gs.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let e=!1;for(let i=0;i-1,a=Math.round(e)!=Math.round(this.lineHeight)||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=e,this.charWidth=i,this.textHeight=n,this.lineLength=s,a){this.heightSamples={};for(let t=0;t0}set outdated(t){this.flags=(t?2:0)|-3&this.flags}setHeight(t,e){this.height!=e&&(Math.abs(this.height-e)>Ls&&(t.heightChanged=!0),this.height=e)}replace(t,e,i){return Fs.of(i)}decomposeLeft(t,e){e.push(this)}decomposeRight(t,e){e.push(this)}applyChanges(t,e,i,n){let s=this,r=i.doc;for(let o=n.length-1;o>=0;o--){let{fromA:a,toA:l,fromB:h,toB:c}=n[o],O=s.lineAt(a,Us.ByPosNoHeight,i.setDoc(e),0,0),u=O.to>=l?O:s.lineAt(l,Us.ByPosNoHeight,i,0,0);for(c+=u.to-l,l=u.to;o>0&&O.from<=n[o-1].toA;)a=n[o-1].fromA,h=n[o-1].fromB,o--,a2*s){let s=t[e-1];s.break?t.splice(--e,1,s.left,null,s.right):t.splice(--e,1,s.left,s.right),i+=1+s.break,n-=s.size}else{if(!(s>2*n))break;{let e=t[i];e.break?t.splice(i,1,e.left,null,e.right):t.splice(i,1,e.left,e.right),i+=2+e.break,s-=e.size}}else if(n=s&&r(this.blockAt(0,i,n,s))}updateHeight(t,e=0,i=!1,n){return n&&n.from<=e&&n.more&&this.setHeight(t,n.heights[n.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Js extends Hs{constructor(t,e){super(t,e,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(t,e,i,n){return new Ns(n,this.length,i,this.height,this.breaks)}replace(t,e,i){let n=i[0];return 1==i.length&&(n instanceof Js||n instanceof Ks&&4&n.flags)&&Math.abs(this.length-n.length)<10?(n instanceof Ks?n=new Js(n.length,this.height):n.height=this.height,this.outdated||(n.outdated=!1),n):Fs.of(i)}updateHeight(t,e=0,i=!1,n){return n&&n.from<=e&&n.more?this.setHeight(t,n.heights[n.index++]):(i||this.outdated)&&this.setHeight(t,Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Ks extends Fs{constructor(t){super(t,0)}heightMetrics(t,e){let i,n=t.doc.lineAt(e).number,s=t.doc.lineAt(e+this.length).number,r=s-n+1,o=0;if(t.lineWrapping){let e=Math.min(this.height,t.lineHeight*r);i=e/r,this.length>r+1&&(o=(this.height-e)/(this.length-r-1))}else i=this.height/r;return{firstLine:n,lastLine:s,perLine:i,perChar:o}}blockAt(t,e,i,n){let{firstLine:s,lastLine:r,perLine:o,perChar:a}=this.heightMetrics(e,n);if(e.lineWrapping){let s=n+Math.round(Math.max(0,Math.min(1,(t-i)/this.height))*this.length),r=e.doc.lineAt(s),l=o+r.length*a,h=Math.max(i,t-l/2);return new Ns(r.from,r.length,h,l,0)}{let n=Math.max(0,Math.min(r-s,Math.floor((t-i)/o))),{from:a,length:l}=e.doc.line(s+n);return new Ns(a,l,i+o*n,o,0)}}lineAt(t,e,i,n,s){if(e==Us.ByHeight)return this.blockAt(t,i,n,s);if(e==Us.ByPosNoHeight){let{from:e,to:n}=i.doc.lineAt(t);return new Ns(e,n-e,0,0,0)}let{firstLine:r,perLine:o,perChar:a}=this.heightMetrics(i,s),l=i.doc.lineAt(t),h=o+l.length*a,c=l.number-r,O=n+o*c+a*(l.from-s-c);return new Ns(l.from,l.length,Math.max(n,Math.min(O,n+this.height-h)),h,0)}forEachLine(t,e,i,n,s,r){t=Math.max(t,s),e=Math.min(e,s+this.length);let{firstLine:o,perLine:a,perChar:l}=this.heightMetrics(i,s);for(let h=t,c=n;h<=e;){let e=i.doc.lineAt(h);if(h==t){let i=e.number-o;c+=a*i+l*(t-s-i)}let n=a+l*e.length;r(new Ns(e.from,e.length,c,n,0)),c+=n,h=e.to+1}}replace(t,e,i){let n=this.length-e;if(n>0){let t=i[i.length-1];t instanceof Ks?i[i.length-1]=new Ks(t.length+n):i.push(null,new Ks(n-1))}if(t>0){let e=i[0];e instanceof Ks?i[0]=new Ks(t+e.length):i.unshift(new Ks(t-1),null)}return Fs.of(i)}decomposeLeft(t,e){e.push(new Ks(t-1),null)}decomposeRight(t,e){e.push(null,new Ks(this.length-t-1))}updateHeight(t,e=0,i=!1,n){let s=e+this.length;if(n&&n.from<=e+this.length&&n.more){let i=[],r=Math.max(e,n.from),o=-1;for(n.from>e&&i.push(new Ks(n.from-e-1).updateHeight(t,e));r<=s&&n.more;){let e=t.doc.lineAt(r).length;i.length&&i.push(null);let s=n.heights[n.index++];-1==o?o=s:Math.abs(s-o)>=Ls&&(o=-2);let a=new Js(e,s);a.outdated=!1,i.push(a),r+=e+1}r<=s&&i.push(null,new Ks(s-r).updateHeight(t,r));let a=Fs.of(i);return(o<0||Math.abs(a.height-this.height)>=Ls||Math.abs(o-this.heightMetrics(t,e).perLine)>=Ls)&&(t.heightChanged=!0),a}return(i||this.outdated)&&(this.setHeight(t,t.heightForGap(e,e+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class tr extends Fs{constructor(t,e,i){super(t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return 1&this.flags}blockAt(t,e,i,n){let s=i+this.left.height;return to))return l;let h=e==Us.ByPosNoHeight?Us.ByPosNoHeight:Us.ByPos;return a?l.join(this.right.lineAt(o,h,i,r,o)):this.left.lineAt(o,h,i,n,s).join(l)}forEachLine(t,e,i,n,s,r){let o=n+this.left.height,a=s+this.left.length+this.break;if(this.break)t=a&&this.right.forEachLine(t,e,i,o,a,r);else{let l=this.lineAt(a,Us.ByPos,i,n,s);t=t&&l.from<=e&&r(l),e>l.to&&this.right.forEachLine(l.to+1,e,i,o,a,r)}}replace(t,e,i){let n=this.left.length+this.break;if(ethis.left.length)return this.balanced(this.left,this.right.replace(t-n,e-n,i));let s=[];t>0&&this.decomposeLeft(t,s);let r=s.length;for(let t of i)s.push(t);if(t>0&&er(s,r-1),e=i&&e.push(null)),t>i&&this.right.decomposeLeft(t-i,e)}decomposeRight(t,e){let i=this.left.length,n=i+this.break;if(t>=n)return this.right.decomposeRight(t-n,e);t2*e.size||e.size>2*t.size?Fs.of(this.break?[t,null,e]:[t,e]):(this.left=t,this.right=e,this.height=t.height+e.height,this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}updateHeight(t,e=0,i=!1,n){let{left:s,right:r}=this,o=e+s.length+this.break,a=null;return n&&n.from<=e+s.length&&n.more?a=s=s.updateHeight(t,e,i,n):s.updateHeight(t,e,i),n&&n.from<=o+r.length&&n.more?a=r=r.updateHeight(t,o,i,n):r.updateHeight(t,o,i),a?this.balanced(s,r):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function er(t,e){let i,n;null==t[e]&&(i=t[e-1])instanceof Ks&&(n=t[e+1])instanceof Ks&&t.splice(e-1,3,new Ks(i.length+1+n.length))}class ir{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,e){if(this.lineStart>-1){let t=Math.min(e,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Js?i.length+=t-this.pos:(t>this.pos||!this.isCovered)&&this.nodes.push(new Js(t-this.pos,-1)),this.writtenTo=t,e>t&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}point(t,e,i){if(t=5)&&this.addLineDeco(n,s,r)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:e}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=e,this.writtenTot&&this.nodes.push(new Js(this.pos-t,-1)),this.writtenTo=this.pos}blankContent(t,e){let i=new Ks(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof Js)return t;let e=new Js(0,-1);return this.nodes.push(e),e}addBlock(t){this.enterLine();let e=t.deco;e&&e.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,e&&e.endSide>0&&(this.covering=t)}addLineDeco(t,e,i){let n=this.ensureLine();n.length+=i,n.collapsed+=i,n.widgetHeight=Math.max(n.widgetHeight,t),n.breaks+=e,this.writtenTo=this.pos=this.pos+i}finish(t){let e=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||e instanceof Js||this.isCovered?(this.writtenToi.clientHeight||i.scrollWidth>i.clientWidth)&&"visible"!=n.overflow){let n=i.getBoundingClientRect();r=Math.max(r,n.left),o=Math.min(o,n.right),a=Math.max(a,n.top),l=e==t.parentNode?n.bottom:Math.min(l,n.bottom)}e="absolute"==n.position||"fixed"==n.position?i.offsetParent:i.parentNode}else{if(11!=e.nodeType)break;e=e.host}return{left:r-i.left,right:Math.max(r,o)-i.left,top:a-(i.top+e),bottom:Math.max(a,l)-(i.top+e)}}function rr(t,e){let i=t.getBoundingClientRect();return{left:0,right:i.right-i.left,top:e,bottom:i.bottom-(i.top+e)}}class or{constructor(t,e,i){this.from=t,this.to=e,this.size=i}static same(t,e){if(t.length!=e.length)return!1;for(let i=0;i"function"!=typeof t&&"cm-lineWrapping"==t.class));this.heightOracle=new Is(e),this.stateDeco=t.facet(Dn).filter((t=>"function"!=typeof t)),this.heightMap=Fs.empty().applyChanges(this.stateDeco,N.empty,this.heightOracle.setDoc(t.doc),[new Fn(0,0,0,t.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ui.set(this.lineGaps.map((t=>t.draw(this,!1)))),this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:e}=this.state.selection;for(let i=0;i<=1;i++){let n=i?e.head:e.anchor;if(!t.some((({from:t,to:e})=>n>=t&&n<=e))){let{from:e,to:i}=this.lineBlockAt(n);t.push(new hr(e,i))}}this.viewports=t.sort(((t,e)=>t.from-e.from)),this.scaler=this.heightMap.height<=7e6?fr:new dr(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,(t=>{this.viewportLines.push(1==this.scaler.scale?t:pr(t,this.scaler))}))}update(t,e=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=this.state.facet(Dn).filter((t=>"function"!=typeof t));let n=t.changedRanges,s=Fn.extendWithRanges(n,function(t,e,i){let n=new nr;return ve.compare(t,e,i,n,0),n.changes}(i,this.stateDeco,t?t.changes:wt.empty(this.state.doc.length))),r=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),s),this.heightMap.height!=r&&(t.flags|=2),o?(this.scrollAnchorPos=t.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=s.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,e));let l=!t.changes.empty||2&t.flags||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),l&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(Cn)&&(this.mustEnforceCursorAssoc=!0)}measure(t){let e=t.contentDOM,i=window.getComputedStyle(e),n=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection="rtl"==i.direction?sn.RTL:sn.LTR;let r=this.heightOracle.mustRefreshForWrapping(s),o=e.getBoundingClientRect(),a=r||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let l=0,h=0;if(o.width&&o.height){let{scaleX:t,scaleY:i}=si(e,o);this.scaleX==t&&this.scaleY==i||(this.scaleX=t,this.scaleY=i,l|=8,r=a=!0)}let c=(parseInt(i.paddingTop)||0)*this.scaleY,O=(parseInt(i.paddingBottom)||0)*this.scaleY;this.paddingTop==c&&this.paddingBottom==O||(this.paddingTop=c,this.paddingBottom=O,l|=10),this.editorWidth!=t.scrollDOM.clientWidth&&(n.lineWrapping&&(a=!0),this.editorWidth=t.scrollDOM.clientWidth,l|=8);let u=t.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=u&&(this.scrollAnchorHeight=-1,this.scrollTop=u),this.scrolledToBottom=ui(t.scrollDOM);let f=(this.printing?rr:sr)(e,this.paddingTop),d=f.top-this.pixelViewport.top,p=f.bottom-this.pixelViewport.bottom;this.pixelViewport=f;let m=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(m!=this.inView&&(this.inView=m,m&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let g=o.width;if(this.contentDOMWidth==g&&this.editorHeight==t.scrollDOM.clientHeight||(this.contentDOMWidth=o.width,this.editorHeight=t.scrollDOM.clientHeight,l|=8),a){let e=t.docView.measureVisibleLineHeights(this.viewport);if(n.mustRefreshForHeights(e)&&(r=!0),r||n.lineWrapping&&Math.abs(g-this.contentDOMWidth)>n.charWidth){let{lineHeight:i,charWidth:o,textHeight:a}=t.docView.measureTextSize();r=i>0&&n.refresh(s,i,o,a,g/o,e),r&&(t.docView.minWidth=0,l|=8)}d>0&&p>0?h=Math.max(d,p):d<0&&p<0&&(h=Math.min(d,p)),n.heightChanged=!1;for(let i of this.viewports){let s=i.from==this.viewport.from?e:t.docView.measureVisibleLineHeights(i);this.heightMap=(r?Fs.empty().applyChanges(this.stateDeco,N.empty,this.heightOracle,[new Fn(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(n,0,r,new Bs(i.from,s))}n.heightChanged&&(l|=2)}let w=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return w&&(this.viewport=this.getViewport(h,this.scrollTarget)),this.updateForViewport(),(2&l||w)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(r?[]:this.lineGaps,t)),l|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),l}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,e){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),n=this.heightMap,s=this.heightOracle,{visibleTop:r,visibleBottom:o}=this,a=new hr(n.lineAt(r-1e3*i,Us.ByHeight,s,0,0).from,n.lineAt(o+1e3*(1-i),Us.ByHeight,s,0,0).to);if(e){let{head:t}=e.range;if(ta.to){let i,r=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),o=n.lineAt(t,Us.ByPos,s,0,0);i="center"==e.y?(o.top+o.bottom)/2-r/2:"start"==e.y||"nearest"==e.y&&t=o+Math.max(10,Math.min(i,250)))&&n>r-2e3&&s>1,r=n<<1;if(this.defaultTextDirection!=sn.LTR&&!i)return[];let o=[],a=(n,r,l,h)=>{if(r-nn&&tt.from>=l.from&&t.to<=l.to&&Math.abs(t.from-n)t.frome))));if(!u){if(rt.from<=r&&t.to>=r))){let t=e.moveToLineBoundary($t.cursor(r),!1,!0).head;t>n&&(r=t)}u=new or(n,r,this.gapSize(l,n,r,h))}o.push(u)};for(let t of this.viewportLines){if(t.lengtht.from&&a(t.from,s,t,e),ot.draw(this,this.heightOracle.lineWrapping)))))}computeVisibleRanges(){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let e=[];ve.spans(t,this.viewport.from,this.viewport.to,{span(t,i){e.push({from:t,to:i})},point(){}},20);let i=e.length!=this.visibleRanges.length||this.visibleRanges.some(((t,i)=>t.from!=e[i].from||t.to!=e[i].to));return this.visibleRanges=e,i?4:0}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find((e=>e.from<=t&&e.to>=t))||pr(this.heightMap.lineAt(t,Us.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return pr(this.heightMap.lineAt(this.scaler.fromDOM(t),Us.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(t){let e=this.lineBlockAtHeight(t+8);return e.from>=this.viewport.from||this.viewportLines[0].top-t>200?e:this.viewportLines[0]}elementAtHeight(t){return pr(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class hr{constructor(t,e){this.from=t,this.to=e}}function cr(t,e,i){let n=[],s=t,r=0;return ve.spans(i,t,e,{span(){},point(t,e){t>s&&(n.push({from:s,to:t}),r+=t-s),s=e}},20),s=1)return e[e.length-1].to;let n=Math.floor(t*i);for(let t=0;;t++){let{from:i,to:s}=e[t],r=s-i;if(n<=r)return i+n;n-=r}}function ur(t,e){let i=0;for(let{from:n,to:s}of t.ranges){if(e<=s){i+=e-n;break}i+=s-n}return i/t.total}const fr={toDOM:t=>t,fromDOM:t=>t,scale:1};class dr{constructor(t,e,i){let n=0,s=0,r=0;this.viewports=i.map((({from:i,to:s})=>{let r=e.lineAt(i,Us.ByPos,t,0,0).top,o=e.lineAt(s,Us.ByPos,t,0,0).bottom;return n+=o-r,{from:i,to:s,top:r,bottom:o,domTop:0,domBottom:0}})),this.scale=(7e6-n)/(e.height-n);for(let t of this.viewports)t.domTop=r+(t.top-s)*this.scale,r=t.domBottom=t.domTop+(t.bottom-t.top),s=t.bottom}toDOM(t){for(let e=0,i=0,n=0;;e++){let s=epr(t,e))):t._content)}const mr=Tt.define({combine:t=>t.join(" ")}),gr=Tt.define({combine:t=>t.indexOf(!0)>-1}),wr=_e.newName(),br=_e.newName(),Sr=_e.newName(),yr={"&light":"."+br,"&dark":"."+Sr};function Qr(t,e,i){return new _e(e,{finish:e=>/&/.test(e)?e.replace(/&\w*/,(e=>{if("&"==e)return t;if(!i||!i[e])throw new RangeError(`Unsupported selector: ${e}`);return i[e]})):t+" "+e})}const vr=Qr("."+wr,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},yr),xr="￿";class kr{constructor(t,e){this.points=t,this.text="",this.lineSeparator=e.facet(ge.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=xr}readRange(t,e){if(!t)return this;let i=t.parentNode;for(let n=t;;){this.findPointBefore(i,n);let t=this.text.length;this.readNode(n);let s=n.nextSibling;if(s==e)break;let r=pi.get(n),o=pi.get(s);(r&&o?r.breakAfter:(r?r.breakAfter:Pr(n))||Pr(s)&&("BR"!=n.nodeName||n.cmIgnore)&&this.text.length>t)&&this.lineBreak(),n=s}return this.findPointBefore(i,e),this}readTextNode(t){let e=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e.length));for(let i=0,n=this.lineSeparator?null:/\r\n?|\n/g;;){let s,r=-1,o=1;if(this.lineSeparator?(r=e.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(s=n.exec(e))&&(r=s.index,o=s[0].length),this.append(e.slice(i,r<0?e.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let e of this.points)e.node==t&&e.pos>this.text.length&&(e.pos-=o-1);i=r+o}}readNode(t){if(t.cmIgnore)return;let e=pi.get(t),i=e&&e.overrideDOMText;if(null!=i){this.findPointInside(t,i.length);for(let t=i.iter();!t.next().done;)t.lineBreak?this.lineBreak():this.append(t.value)}else 3==t.nodeType?this.readTextNode(t):"BR"==t.nodeName?t.nextSibling&&this.lineBreak():1==t.nodeType&&this.readRange(t.firstChild,null)}findPointBefore(t,e){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}findPointInside(t,e){for(let i of this.points)(3==t.nodeType?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+($r(t,i.node,i.offset)?e:0))}}function $r(t,e,i){for(;;){if(!e||i-1)this.newSel=null;else if(e>-1&&(this.bounds=t.docView.domBoundsAround(e,i,0))){let e=s||r?[]:function(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:r}=t.observer.selectionRange;i&&(e.push(new Zr(i,n)),s==i&&r==n||e.push(new Zr(s,r)));return e}(t),i=new kr(e,t.state);i.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=i.text,this.newSel=function(t,e){if(0==t.length)return null;let i=t[0].pos,n=2==t.length?t[1].pos:i;return i>-1&&n>-1?$t.single(i+e,n+e):null}(e,this.bounds.from)}else{let e=t.observer.selectionRange,i=s&&s.node==e.focusNode&&s.offset==e.focusOffset||!Le(t.contentDOM,e.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(e.focusNode,e.focusOffset),n=r&&r.node==e.anchorNode&&r.offset==e.anchorOffset||!Le(t.contentDOM,e.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(e.anchorNode,e.anchorOffset),o=t.viewport;if(Ci.ios&&t.state.selection.main.empty&&i!=n&&(o.from>0||o.toDate.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:n,to:o}=e.bounds,a=s.from,l=null;(8===r||Ci.android&&e.text.length0&&a>0&&t.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if("end"==n){i-=o+Math.max(0,r-Math.min(o,a))-r}if(o=o?r-i:0,a=r+(a-o),o=r}else if(a=a?r-i:0,o=r+(o-a),a=r}return{from:r,toA:o,toB:a}}(t.state.doc.sliceString(n,o,xr),e.text,a-n,l);h&&(Ci.chrome&&13==r&&h.toB==h.from+2&&e.text.slice(h.from,h.toB)==xr+xr&&h.toB--,i={from:n+h.from,to:n+h.toA,insert:N.of(e.text.slice(h.from,h.toB).split(xr))})}else n&&(!t.hasFocus&&t.state.facet(Wn)||n.main.eq(s))&&(n=null);if(!i&&!n)return!1;if(!i&&e.typeOver&&!s.empty&&n&&n.main.empty?i={from:s.from,to:s.to,insert:t.state.doc.slice(s.from,s.to)}:i&&i.from>=s.from&&i.to<=s.to&&(i.from!=s.from||i.to!=s.to)&&s.to-s.from-(i.to-i.from)<=4?i={from:s.from,to:s.to,insert:t.state.doc.slice(s.from,i.from).append(i.insert).append(t.state.doc.slice(i.to,s.to))}:(Ci.mac||Ci.android)&&i&&i.from==i.to&&i.from==s.head-1&&/^\. ?$/.test(i.insert.toString())&&"off"==t.contentDOM.getAttribute("autocorrect")?(n&&2==i.insert.length&&(n=$t.single(n.main.anchor-1,n.main.head-1)),i={from:s.from,to:s.to,insert:N.of([" "])}):Ci.chrome&&i&&i.from==i.to&&i.from==s.head&&"\n "==i.insert.toString()&&t.lineWrapping&&(n&&(n=$t.single(n.main.anchor-1,n.main.head-1)),i={from:s.from,to:s.to,insert:N.of([" "])}),i){if(Ci.ios&&t.inputState.flushIOSKey())return!0;if(Ci.android&&(i.from==s.from&&i.to==s.to&&1==i.insert.length&&2==i.insert.lines&&ci(t.contentDOM,"Enter",13)||(i.from==s.from-1&&i.to==s.to&&0==i.insert.length||8==r&&i.insert.lengths.head)&&ci(t.contentDOM,"Backspace",8)||i.from==s.from&&i.to==s.to+1&&0==i.insert.length&&ci(t.contentDOM,"Delete",46)))return!0;let e,o=i.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a=()=>e||(e=function(t,e,i){let n,s=t.state,r=s.selection.main;if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!i||i.main.empty&&i.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let i=r.frome.to?s.sliceDoc(e.to,r.to):"";n=s.replaceSelection(t.state.toText(i+e.insert.sliceString(0,void 0,t.state.lineBreak)+o))}else{let o=s.changes(e),a=i&&i.main.to<=o.newLength?i.main:void 0;if(s.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=r.to&&e.to>=r.to-10){let l,h=t.state.sliceDoc(e.from,e.to),c=i&&ts(t,i.main.head);if(c){let t=e.insert.length-(e.to-e.from);l={from:c.from,to:c.to-t}}else l=t.state.doc.lineAt(r.head);let O=r.to-e.to,u=r.to-r.from;n=s.changeByRange((i=>{if(i.from==r.from&&i.to==r.to)return{changes:o,range:a||i.map(o)};let n=i.to-O,c=n-h.length;if(i.to-i.from!=u||t.state.sliceDoc(c,n)!=h||i.to>=l.from&&i.from<=l.to)return{range:i};let f=s.changes({from:c,to:n,insert:e.insert}),d=i.to-r.to;return{changes:f,range:a?$t.range(Math.max(0,a.anchor+d),Math.max(0,a.head+d)):i.map(f)}}))}else n={changes:o,selection:a&&s.selection.replaceRange(a)}}let o="input.type";(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,o+=".compose",t.inputState.compositionFirstChange&&(o+=".start",t.inputState.compositionFirstChange=!1));return s.update(n,{userEvent:o,scrollIntoView:!0})}(t,i,n));return t.state.facet(Zn).some((e=>e(t,i.from,i.to,o,a)))||t.dispatch(a()),!0}if(n&&!n.main.eq(s)){let e=!1,i="select";return t.inputState.lastSelectionTime>Date.now()-50&&("select"==t.inputState.lastSelectionOrigin&&(e=!0),i=t.inputState.lastSelectionOrigin),t.dispatch({selection:n,scrollIntoView:e,userEvent:i}),!0}return!1}const Cr={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Yr=Ci.ie&&Ci.ie_version<=11;class Ar{constructor(t){this.view=t,this.active=!1,this.selectionRange=new ri,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver((e=>{for(let t of e)this.queue.push(t);(Ci.ie&&Ci.ie_version<=11||Ci.ios&&t.composing)&&e.some((t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length))?this.flushSoon():this.flush()})),Yr&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver((()=>{var t;(null===(t=this.view.docView)||void 0===t?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))}),{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout((()=>{this.resizeTimeout=-1,this.view.requestMeasure()}),50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout((()=>{this.view.viewState.printing=!1,this.view.requestMeasure()}),500)}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some(((e,i)=>e!=t[i])))){this.gapIntersection.disconnect();for(let e of t)this.gapIntersection.observe(e);this.gaps=t}}onSelectionChange(t){let e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,n=this.selectionRange;if(i.state.facet(Wn)?i.root.activeElement!=this.dom:!Fe(i.dom,n))return;let s=n.anchorNode&&i.docView.nearest(n.anchorNode);s&&s.ignoreEvent(t)?e||(this.selectionChanged=!1):(Ci.ie&&Ci.ie_version<=11||Ci.android&&Ci.chrome)&&!i.state.selection.main.empty&&n.focusNode&&Je(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,e=Ci.safari&&11==t.root.nodeType&&function(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}(this.dom.ownerDocument)==this.dom&&function(t){let e=null;function i(t){t.preventDefault(),t.stopImmediatePropagation(),e=t.getTargetRanges()[0]}if(t.contentDOM.addEventListener("beforeinput",i,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",i,!0),!e)return null;let n=e.startContainer,s=e.startOffset,r=e.endContainer,o=e.endOffset,a=t.docView.domAtPos(t.state.selection.main.anchor);Je(a.node,a.offset,r,o)&&([n,s,r,o]=[r,o,n,s]);return{anchorNode:n,anchorOffset:s,focusNode:r,focusOffset:o}}(this.view)||Ue(t.root);if(!e||this.selectionRange.eq(e))return!1;let i=Fe(this.dom,e);return i&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let t=this.delayedAndroidKey;if(t){this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=t.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&t.force&&ci(this.dom,t.key,t.keyCode)}};this.flushingAndroidKey=this.view.win.requestAnimationFrame(t)}this.delayedAndroidKey&&"Enter"!=t||(this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange{this.delayedFlush=-1,this.flush()})))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let e=-1,i=-1,n=!1;for(let s of t){let t=this.readMutation(s);t&&(t.typeOver&&(n=!0),-1==e?({from:e,to:i}=t):(e=Math.min(t.from,e),i=Math.max(t.to,i)))}return{from:e,to:i,typeOver:n}}readChange(){let{from:t,to:e,typeOver:i}=this.processRecords(),n=this.selectionChanged&&Fe(this.dom,this.selectionRange);if(t<0&&!n)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new Tr(this.view,t,e,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let e=this.readChange();if(!e)return this.view.requestMeasure(),!1;let i=this.view.state,n=Xr(this.view,e);return this.view.state==i&&this.view.update([]),n}readMutation(t){let e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty("attributes"==t.type),"attributes"==t.type&&(e.flags|=4),"childList"==t.type){let i=Rr(e,t.previousSibling||t.target.previousSibling,-1),n=Rr(e,t.nextSibling||t.target.nextSibling,1);return{from:i?e.posAfter(i):e.posAtStart,to:n?e.posBefore(n):e.posAtEnd,typeOver:!1}}return"characterData"==t.type?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var t,e,i;this.stop(),null===(t=this.intersection)||void 0===t||t.disconnect(),null===(e=this.gapIntersection)||void 0===e||e.disconnect(),null===(i=this.resizeScroll)||void 0===i||i.disconnect();for(let t of this.scrollTargets)t.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function Rr(t,e,i){for(;e;){let n=pi.get(e);if(n&&n.parent==t)return n;let s=e.parentNode;e=s!=t.dom?s:i>0?e.nextSibling:e.previousSibling}return null}class Wr{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:e}=t;this.dispatchTransactions=t.dispatchTransactions||e&&(t=>t.forEach((t=>e(t,this))))||(t=>this.update(t)),this.dispatch=this.dispatch.bind(this),this._root=t.root||function(t){for(;t;){if(t&&(9==t.nodeType||11==t.nodeType&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}(t.parent)||document,this.viewState=new lr(t.state||ge.create(t)),t.scrollTo&&t.scrollTo.is(An)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(jn).map((t=>new _n(t)));for(let t of this.plugins)t.update(this);this.observer=new Ar(this),this.inputState=new ms(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Jn(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...t){let e=1==t.length&&t[0]instanceof oe?t:1==t.length&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(e,this)}update(t){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let e,i=!1,n=!1,s=this.state;for(let e of t){if(e.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=e.state}if(this.destroyed)return void(this.viewState.state=s);let r=this.hasFocus,o=0,a=null;t.some((t=>t.annotation(Es)))?(this.inputState.notifiedFocused=r,o=1):r!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=r,a=Ms(s,r),a||(o=1));let l=this.observer.delayedAndroidKey,h=null;if(l?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(h=null)):this.observer.clear(),s.facet(ge.phrases)!=this.state.facet(ge.phrases))return this.setState(s);e=Hn.create(this,s,t),e.flags|=o;let c=this.viewState.scrollTarget;try{this.updateState=2;for(let e of t){if(c&&(c=c.map(e.changes)),e.scrollIntoView){let{main:t}=e.state.selection;c=new Yn(t.empty?t:$t.cursor(t.head,t.head>t.anchor?-1:1))}for(let t of e.effects)t.is(An)&&(c=t.value.clip(this.state))}this.viewState.update(e,c),this.bidiCache=qr.update(this.bidiCache,e.changes),e.empty||(this.updatePlugins(e),this.inputState.update(e)),i=this.docView.update(e),this.state.facet(Ln)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(i,t.some((t=>t.isUserEvent("select.pointer"))))}finally{this.updateState=0}if(e.startState.facet(mr)!=e.state.facet(mr)&&(this.viewState.mustMeasureContent=!0),(i||n||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!e.empty)for(let t of this.state.facet(Pn))try{t(e)}catch(t){Rn(this.state,t,"update listener")}(a||h)&&Promise.resolve().then((()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!Xr(this,h)&&l.force&&ci(this.contentDOM,l.key,l.keyCode)}))}setState(t){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=t);this.updateState=2;let e=this.hasFocus;try{for(let t of this.plugins)t.destroy(this);this.viewState=new lr(t),this.plugins=t.facet(jn).map((t=>new _n(t))),this.pluginMap.clear();for(let t of this.plugins)t.update(this);this.docView.destroy(),this.docView=new Jn(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}e&&this.focus(),this.requestMeasure()}updatePlugins(t){let e=t.startState.facet(jn),i=t.state.facet(jn);if(e!=i){let n=[];for(let s of i){let i=e.indexOf(s);if(i<0)n.push(new _n(s));else{let e=this.plugins[i];e.mustUpdate=t,n.push(e)}}for(let e of this.plugins)e.mustUpdate!=t&&e.destroy(this);this.plugins=n,this.pluginMap.clear()}else for(let e of this.plugins)e.mustUpdate=t;for(let t=0;t-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,t&&this.observer.forceFlush();let e=null,i=this.scrollDOM,n=i.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:r}=this.viewState;Math.abs(n-this.viewState.scrollTop)>1&&(r=-1),this.viewState.scrollAnchorHeight=-1;try{for(let t=0;;t++){if(r<0)if(ui(i))s=-1,r=this.viewState.heightMap.height;else{let t=this.viewState.scrollAnchorAt(n);s=t.from,r=t.top}this.updateState=1;let o=this.viewState.measure(this);if(!o&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(t>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let a=[];4&o||([this.measureRequests,a]=[a,this.measureRequests]);let l=a.map((t=>{try{return t.read(this)}catch(t){return Rn(this.state,t),jr}})),h=Hn.create(this,this.state,[]),c=!1;h.flags|=o,e?e.flags|=o:e=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),c=this.docView.update(h));for(let t=0;t1||t<-1){n+=t,i.scrollTop=n/this.scaleY,r=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(e&&!e.empty)for(let t of this.state.facet(Pn))t(e)}get themeClasses(){return wr+" "+(this.state.facet(gr)?Sr:br)+" "+this.state.facet(mr)}updateAttrs(){let t=_r(this,En,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Wn)?"true":"false",class:"cm-content",style:`${Ci.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),_r(this,Mn,e);let i=this.observer.ignore((()=>{let i=Di(this.contentDOM,this.contentAttrs,e),n=Di(this.dom,this.editorAttrs,t);return i||n}));return this.editorAttrs=t,this.contentAttrs=e,i}showAnnouncements(t){let e=!0;for(let i of t)for(let t of i.effects)if(t.is(Wr.announce)){e&&(this.announceDOM.textContent=""),e=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(Ln);let t=this.state.facet(Wr.cspNonce);_e.mount(this.root,this.styleModules.concat(vr).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame((()=>this.measure()))),t){if(this.measureRequests.indexOf(t)>-1)return;if(null!=t.key)for(let e=0;ee.spec==t))||null),e&&e.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,e,i){return ps(this,t,fs(this,t,e,i))}moveByGroup(t,e){return ps(this,t,fs(this,t,e,(e=>function(t,e,i){let n=t.state.charCategorizer(e),s=n(i);return t=>{let e=n(t);return s==fe.Space&&(s=e),s==e}}(this,t.head,e))))}visualLineSide(t,e){let i=this.bidiSpans(t),n=this.textDirectionAt(t.from),s=i[e?i.length-1:0];return $t.cursor(s.side(e,n)+t.from,s.forward(!e,n)?1:-1)}moveToLineBoundary(t,e,i=!0){return function(t,e,i,n){let s=us(t,e.head),r=n&&s.type==Ni.Text&&(t.lineWrapping||s.widgetLineBreaks)?t.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head):null;if(r){let e=t.dom.getBoundingClientRect(),n=t.textDirectionAt(s.from),o=t.posAtCoords({x:i==(n==sn.LTR)?e.right-1:e.left+1,y:(r.top+r.bottom)/2});if(null!=o)return $t.cursor(o,i?-1:1)}return $t.cursor(i?s.to:s.from,i?-1:1)}(this,t,e,i)}moveVertically(t,e,i){return ps(this,t,function(t,e,i,n){let s=e.head,r=i?1:-1;if(s==(i?t.state.doc.length:0))return $t.cursor(s,e.assoc);let o,a=e.goalColumn,l=t.contentDOM.getBoundingClientRect(),h=t.coordsAtPos(s,e.assoc||-1),c=t.documentTop;if(h)null==a&&(a=h.left-l.left),o=r<0?h.top:h.bottom;else{let e=t.viewState.lineBlockAt(s);null==a&&(a=Math.min(l.right-l.left,t.defaultCharacterWidth*(s-e.from))),o=(r<0?e.top:e.bottom)+c}let O=l.left+a,u=null!=n?n:t.viewState.heightOracle.textHeight>>1;for(let e=0;;e+=10){let i=o+(u+e)*r,n=cs(t,{x:O,y:i},!1,r);if(il.bottom||(r<0?ns)){let e=t.docView.coordsForChar(n),s=!e||i0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(Xn)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>Vr)return bn(t.length);let e,i=this.textDirectionAt(t.from);for(let n of this.bidiCache)if(n.from==t.from&&n.dir==i&&(n.fresh||pn(n.isolates,e=Bn(this,t))))return n.order;e||(e=Bn(this,t));let n=function(t,e,i){if(!t)return[new dn(0,0,e==on?1:0)];if(e==rn&&!i.length&&!fn.test(t))return bn(t.length);if(i.length)for(;t.length>mn.length;)mn[mn.length]=256;let n=[],s=e==rn?0:1;return wn(t,s,s,i,0,t.length,n),n}(t.text,i,e);return this.bidiCache.push(new qr(t.from,t.to,i,e,!0,n)),n}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||Ci.safari&&(null===(t=this.inputState)||void 0===t?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore((()=>{li(this.contentDOM),this.docView.updateSelection()}))}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((9==t.nodeType?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,e={}){return An.of(new Yn("number"==typeof t?$t.cursor(t):t,e.y,e.x,e.yMargin,e.xMargin))}scrollSnapshot(){let{scrollTop:t,scrollLeft:e}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return An.of(new Yn($t.cursor(i.from),"start","start",i.top-t,e,!0))}static domEventHandlers(t){return qn.define((()=>({})),{eventHandlers:t})}static domEventObservers(t){return qn.define((()=>({})),{eventObservers:t})}static theme(t,e){let i=_e.newName(),n=[mr.of(i),Ln.of(Qr(`.${i}`,t))];return e&&e.dark&&n.push(gr.of(!0)),n}static baseTheme(t){return Dt.lowest(Ln.of(Qr("."+wr,t,yr)))}static findFromDOM(t){var e;let i=t.querySelector(".cm-content"),n=i&&pi.get(i)||pi.get(t);return(null===(e=null==n?void 0:n.rootView)||void 0===e?void 0:e.view)||null}}Wr.styleModule=Ln,Wr.inputHandler=Zn,Wr.focusChangeEffect=Tn,Wr.perLineTextDirection=Xn,Wr.exceptionSink=$n,Wr.updateListener=Pn,Wr.editable=Wn,Wr.mouseSelectionStyle=kn,Wr.dragMovesSelection=xn,Wr.clickAddsSelectionRange=vn,Wr.decorations=Dn,Wr.outerDecorations=zn,Wr.atomicRanges=Gn,Wr.bidiIsolatedRanges=In,Wr.scrollMargins=Nn,Wr.darkTheme=gr,Wr.cspNonce=Tt.define({combine:t=>t.length?t[0]:""}),Wr.contentAttributes=Mn,Wr.editorAttributes=En,Wr.lineWrapping=Wr.contentAttributes.of({class:"cm-lineWrapping"}),Wr.announce=re.define();const Vr=4096,jr={};class qr{constructor(t,e,i,n,s,r){this.from=t,this.to=e,this.dir=i,this.isolates=n,this.fresh=s,this.order=r}static update(t,e){if(e.empty&&!t.some((t=>t.fresh)))return t;let i=[],n=t.length?t[t.length-1].dir:sn.LTR;for(let s=Math.max(0,t.length-10);s=0;s--){let e=n[s],r="function"==typeof e?e(t):e;r&&_i(r,i)}return i}const Er=Ci.mac?"mac":Ci.windows?"win":Ci.linux?"linux":"key";function Mr(t,e,i){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==i&&e.shiftKey&&(t="Shift-"+t),t}const Dr=Dt.default(Wr.domEventHandlers({keydown:(t,e)=>function(t,e,i,n){let s=function(t){var e=!(Ge&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Ie&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?ze:De)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(e),r=ut(s,0),o=dt(r)==s.length&&" "!=s,a="",l=!1,h=!1,c=!1;Ir&&Ir.view==i&&Ir.scope==n&&(a=Ir.prefix+" ",ys.indexOf(e.keyCode)<0&&(h=!0,Ir=null));let O,u,f=new Set,d=t=>{if(t){for(let n of t.run)if(!f.has(n)&&(f.add(n),n(i,e)))return t.stopPropagation&&(c=!0),!0;t.preventDefault&&(t.stopPropagation&&(c=!0),h=!0)}return!1},p=t[n];p&&(d(p[a+Mr(s,e,!o)])?l=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Ci.windows&&e.ctrlKey&&e.altKey)&&(O=De[e.keyCode])&&O!=s?(d(p[a+Mr(O,e,!0)])||e.shiftKey&&(u=ze[e.keyCode])!=s&&u!=O&&d(p[a+Mr(u,e,!1)]))&&(l=!0):o&&e.shiftKey&&d(p[a+Mr(s,e,!0)])&&(l=!0),!l&&d(p._any)&&(l=!0));h&&(l=!0);l&&c&&e.stopPropagation();return l}(function(t){let e=t.facet(zr),i=Gr.get(e);i||Gr.set(e,i=function(t,e=Er){let i=Object.create(null),n=Object.create(null),s=(t,e)=>{let i=n[t];if(null==i)n[t]=e;else if(i!=e)throw new Error("Key binding "+t+" is used both as a regular binding and as a multi-stroke prefix")},r=(t,n,r,o,a)=>{var l,h;let c=i[t]||(i[t]=Object.create(null)),O=n.split(/ (?!$)/).map((t=>function(t,e){const i=t.split(/-(?!$)/);let n,s,r,o,a=i[i.length-1];"Space"==a&&(a=" ");for(let t=0;t{let n=Ir={view:e,prefix:i,scope:t};return setTimeout((()=>{Ir==n&&(Ir=null)}),Br),!0}]})}let u=O.join(" ");s(u,!1);let f=c[u]||(c[u]={preventDefault:!1,stopPropagation:!1,run:(null===(h=null===(l=c._any)||void 0===l?void 0:l.run)||void 0===h?void 0:h.slice())||[]});r&&f.run.push(r),o&&(f.preventDefault=!0),a&&(f.stopPropagation=!0)};for(let n of t){let t=n.scope?n.scope.split(" "):["editor"];if(n.any)for(let e of t){let t=i[e]||(i[e]=Object.create(null));t._any||(t._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let e in t)t[e].run.push(n.any)}let s=n[e]||n.key;if(s)for(let e of t)r(e,s,n.run,n.preventDefault,n.stopPropagation),n.shift&&r(e,"Shift-"+s,n.shift,n.preventDefault,n.stopPropagation)}return i}(e.reduce(((t,e)=>t.concat(e)),[])));return i}(e.state),t,e,"editor")})),zr=Tt.define({enables:Dr}),Gr=new WeakMap;let Ir=null;const Br=4e3;class Nr{constructor(t,e,i,n,s){this.className=t,this.left=e,this.top=i,this.width=n,this.height=s}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,e){return e.className==this.className&&(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",null!=this.width&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,e,i){if(i.empty){let n=t.coordsAtPos(i.head,i.assoc||1);if(!n)return[];let s=Ur(t);return[new Nr(e,n.left-s.left,n.top-s.top,null,n.bottom-n.top)]}return function(t,e,i){if(i.to<=t.viewport.from||i.from>=t.viewport.to)return[];let n=Math.max(i.from,t.viewport.from),s=Math.min(i.to,t.viewport.to),r=t.textDirection==sn.LTR,o=t.contentDOM,a=o.getBoundingClientRect(),l=Ur(t),h=o.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),O=a.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),u=a.right-(c?parseInt(c.paddingRight):0),f=us(t,n),d=us(t,s),p=f.type==Ni.Text?f:null,m=d.type==Ni.Text?d:null;p&&(t.lineWrapping||f.widgetLineBreaks)&&(p=Lr(t,n,p));m&&(t.lineWrapping||d.widgetLineBreaks)&&(m=Lr(t,s,m));if(p&&m&&p.from==m.from)return w(b(i.from,i.to,p));{let e=p?b(i.from,null,p):S(f,!1),n=m?b(null,i.to,m):S(d,!0),s=[];return(p||f).to<(m||d).from-(p&&m?1:0)||f.widgetLineBreaks>1&&e.bottom+t.defaultLineHeight/2h&&n.from=r)break;a>s&&l(Math.max(t,s),null==e&&t<=h,Math.min(a,r),null==i&&a>=c,o.dir)}if(s=n.to+1,s>=r)break}return 0==a.length&&l(h,null==e,c,null==i,t.textDirection),{top:s,bottom:o,horizontal:a}}function S(t,e){let i=a.top+(e?t.top:t.bottom);return{top:i,bottom:i,horizontal:[]}}}(t,e,i)}}function Ur(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==sn.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function Lr(t,e,i){let n=$t.cursor(e);return{from:Math.max(i.from,t.moveToLineBoundary(n,!1,!0).from),to:Math.min(i.to,t.moveToLineBoundary(n,!0,!0).from),type:Ni.Text}}class Fr{constructor(t,e){this.view=t,this.layer=e,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),e.above&&this.dom.classList.add("cm-layer-above"),e.class&&this.dom.classList.add(e.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),e.mount&&e.mount(this.dom,t)}update(t){t.startState.facet(Hr)!=t.state.facet(Hr)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}setOrder(t){let e=0,i=t.facet(Hr);for(;e{return i=t,n=this.drawn[e],!(i.constructor==n.constructor&&i.eq(n));var i,n}))){let e=this.dom.firstChild,i=0;for(let n of t)n.update&&e&&n.constructor&&this.drawn[i].constructor&&n.update(e,this.drawn[i])?(e=e.nextSibling,i++):this.dom.insertBefore(n.draw(),e);for(;e;){let t=e.nextSibling;e.remove(),e=t}this.drawn=t}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Hr=Tt.define();function Jr(t){return[qn.define((e=>new Fr(e,t))),Hr.of(t)]}const Kr=!Ci.ios,to=Tt.define({combine:t=>we(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(t,e)=>Math.min(t,e),drawRangeCursor:(t,e)=>t||e})});function eo(t={}){return[to.of(t),no,ro,ao,Cn.of(!0)]}function io(t){return t.startState.facet(to)!=t.state.facet(to)}const no=Jr({above:!0,markers(t){let{state:e}=t,i=e.facet(to),n=[];for(let s of e.selection.ranges){let r=s==e.selection.main;if(s.empty?!r||Kr:i.drawRangeCursor){let e=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",i=s.empty?s:$t.cursor(s.head,s.head>s.anchor?-1:1);for(let s of Nr.forRange(t,e,i))n.push(s)}}return n},update(t,e){t.transactions.some((t=>t.selection))&&(e.style.animationName="cm-blink"==e.style.animationName?"cm-blink2":"cm-blink");let i=io(t);return i&&so(t.state,e),t.docChanged||t.selectionSet||i},mount(t,e){so(e.state,t)},class:"cm-cursorLayer"});function so(t,e){e.style.animationDuration=t.facet(to).cursorBlinkRate+"ms"}const ro=Jr({above:!1,markers:t=>t.state.selection.ranges.map((e=>e.empty?[]:Nr.forRange(t,"cm-selectionBackground",e))).reduce(((t,e)=>t.concat(e))),update:(t,e)=>t.docChanged||t.selectionSet||t.viewportChanged||io(t),class:"cm-selectionLayer"}),oo={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};Kr&&(oo[".cm-line"].caretColor="transparent !important",oo[".cm-content"]={caretColor:"transparent !important"});const ao=Dt.highest(Wr.theme(oo));function lo(t,e,i,n,s){e.lastIndex=0;for(let r,o=t.iterRange(i,n),a=i;!o.next().done;a+=o.value.length)if(!o.lineBreak)for(;r=e.exec(o.value);)s(a+r.index,r)}class ho{constructor(t){const{regexp:e,decoration:i,decorate:n,boundary:s,maxLength:r=1e3}=t;if(!e.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=e,n)this.addMatch=(t,e,i,s)=>n(s,i,i+t[0].length,t,e);else if("function"==typeof i)this.addMatch=(t,e,n,s)=>{let r=i(t,e,n);r&&s(n,n+t[0].length,r)};else{if(!i)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=(t,e,n,s)=>s(n,n+t[0].length,i)}this.boundary=s,this.maxLength=r}createDeco(t){let e=new xe,i=e.add.bind(e);for(let{from:e,to:n}of function(t,e){let i=t.visibleRanges;if(1==i.length&&i[0].from==t.viewport.from&&i[0].to==t.viewport.to)return i;let n=[];for(let{from:s,to:r}of i)s=Math.max(t.state.doc.lineAt(s).from,s-e),r=Math.min(t.state.doc.lineAt(r).to,r+e),n.length&&n[n.length-1].to>=s?n[n.length-1].to=r:n.push({from:s,to:r});return n}(t,this.maxLength))lo(t.state.doc,this.regexp,e,n,((e,n)=>this.addMatch(n,t,e,i)));return e.finish()}updateDeco(t,e){let i=1e9,n=-1;return t.docChanged&&t.changes.iterChanges(((e,s,r,o)=>{o>t.view.viewport.from&&r1e3?this.createDeco(t.view):n>-1?this.updateRange(t.view,e.map(t.changes),i,n):e}updateRange(t,e,i,n){for(let s of t.visibleRanges){let r=Math.max(s.from,i),o=Math.min(s.to,n);if(o>r){let i=t.state.doc.lineAt(r),n=i.toi.from;r--)if(this.boundary.test(i.text[r-1-i.from])){a=r;break}for(;oc.push(i.range(t,e));if(i==n)for(this.regexp.lastIndex=a-i.from;(h=this.regexp.exec(i.text))&&h.indexthis.addMatch(i,t,e,O)));e=e.update({filterFrom:a,filterTo:l,filter:(t,e)=>tl,add:c})}}return e}}const co=null!=/x/.unicode?"gu":"g",Oo=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\ufeff-]",co),uo={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let fo=null;const po=Tt.define({combine(t){let e=we(t,{render:null,specialChars:Oo,addSpecialChars:null});return(e.replaceTabs=!function(){var t;if(null==fo&&"undefined"!=typeof document&&document.body){let e=document.body.style;fo=null!=(null!==(t=e.tabSize)&&void 0!==t?t:e.MozTabSize)}return fo||!1}())&&(e.specialChars=new RegExp("\t|"+e.specialChars.source,co)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,co)),e}});function mo(t={}){return[po.of(t),go||(go=qn.fromClass(class{constructor(t){this.view=t,this.decorations=Ui.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(po)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new ho({regexp:t.specialChars,decoration:(e,i,n)=>{let{doc:s}=i.state,r=ut(e[0],0);if(9==r){let t=s.lineAt(n),e=i.state.tabSize,r=We(t.text,e,n-t.from);return Ui.replace({widget:new bo((e-r%e)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=Ui.replace({widget:new wo(t,r)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(po);t.startState.facet(po)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))]}let go=null;class wo extends Bi{constructor(t,e){super(),this.options=t,this.code=e}eq(t){return t.code==this.code}toDOM(t){let e=function(t){return t>=32?"•":10==t?"␤":String.fromCharCode(9216+t)}(this.code),i=t.state.phrase("Control character")+" "+(uo[this.code]||"0x"+this.code.toString(16)),n=this.options.render&&this.options.render(this.code,i,e);if(n)return n;let s=document.createElement("span");return s.textContent=e,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class bo extends Bi{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent="\t",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}const So=qn.fromClass(class{constructor(){this.height=1e3,this.attrs={style:"padding-bottom: 1000px"}}update(t){let{view:e}=t,i=e.viewState.editorHeight*e.scaleY-e.defaultLineHeight-e.documentPadding.top-.5;i>=0&&i!=this.height&&(this.height=i,this.attrs={style:`padding-bottom: ${i}px`})}});function yo(){return[So,Mn.of((t=>{var e;return(null===(e=t.plugin(So))||void 0===e?void 0:e.attrs)||null}))]}class Qo extends Bi{constructor(t){super(),this.content=t}toDOM(){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild("string"==typeof this.content?document.createTextNode(this.content):this.content),"string"==typeof this.content?t.setAttribute("aria-label","placeholder "+this.content):t.setAttribute("aria-hidden","true"),t}coordsAt(t){let e=t.firstChild?He(t.firstChild):[];if(!e.length)return null;let i=window.getComputedStyle(t.parentNode),n=ii(e[0],"rtl"!=i.direction),s=parseInt(i.lineHeight);return n.bottom-n.top>1.5*s?{left:n.left,right:n.right,top:n.top,bottom:n.top+s}:n}ignoreEvent(){return!1}}function vo(t){return qn.fromClass(class{constructor(e){this.view=e,this.placeholder=t?Ui.set([Ui.widget({widget:new Qo(t),side:1}).range(0)]):Ui.none}get decorations(){return this.view.state.doc.length?Ui.none:this.placeholder}},{decorations:t=>t.decorations})}const xo="-10000px";class ko{constructor(t,e,i){this.facet=e,this.createTooltipView=i,this.input=t.state.facet(e),this.tooltips=this.input.filter((t=>t)),this.tooltipViews=this.tooltips.map(i)}update(t,e){var i;let n=t.state.facet(this.facet),s=n.filter((t=>t));if(n===this.input){for(let e of this.tooltipViews)e.update&&e.update(t);return!1}let r=[],o=e?[]:null;for(let i=0;ie[i]=t)),e.length=o.length),this.input=n,this.tooltips=s,this.tooltipViews=r,!0}}function $o(t={}){return Zo.of(t)}function Po(t){let{win:e}=t;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const Zo=Tt.define({combine:t=>{var e,i,n;return{position:Ci.ios?"absolute":(null===(e=t.find((t=>t.position)))||void 0===e?void 0:e.position)||"fixed",parent:(null===(i=t.find((t=>t.parent)))||void 0===i?void 0:i.parent)||null,tooltipSpace:(null===(n=t.find((t=>t.tooltipSpace)))||void 0===n?void 0:n.tooltipSpace)||Po}}}),To=new WeakMap,Xo=qn.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(Zo);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new ko(t,Ao,(t=>this.createTooltip(t))),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver((t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()}),{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout((()=>{this.measureTimeout=-1,this.maybeMeasure()}),50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let i=e||t.geometryChanged,n=t.state.facet(Zo);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let t of this.manager.tooltipViews)t.dom.style.position=this.position;i=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let t of this.manager.tooltipViews)this.container.appendChild(t.dom);i=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);i&&this.maybeMeasure()}createTooltip(t){let e=t.create(this.view);if(e.dom.classList.add("cm-tooltip"),t.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",e.dom.appendChild(t)}return e.dom.style.position=this.position,e.dom.style.top=xo,e.dom.style.left="0px",this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var t,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let e of this.manager.tooltipViews)e.dom.remove(),null===(t=e.destroy)||void 0===t||t.call(e);this.parent&&this.container.remove(),null===(e=this.intersectionObserver)||void 0===e||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=this.view.dom.getBoundingClientRect(),e=1,i=1,n=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:t}=this.manager.tooltipViews[0];if(Ci.gecko)n=t.offsetParent!=this.container.ownerDocument.body;else if(t.style.top==xo&&"0px"==t.style.left){let e=t.getBoundingClientRect();n=Math.abs(e.top+1e4)>1||Math.abs(e.left)>1}}if(n||"absolute"==this.position)if(this.parent){let t=this.parent.getBoundingClientRect();t.width&&t.height&&(e=t.width/this.parent.offsetWidth,i=t.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:i}=this.view.viewState);return{editor:t,parent:this.parent?this.container.getBoundingClientRect():t,pos:this.manager.tooltips.map(((t,e)=>{let i=this.manager.tooltipViews[e];return i.getCoords?i.getCoords(t.pos):this.view.coordsAtPos(t.pos)})),size:this.manager.tooltipViews.map((({dom:t})=>t.getBoundingClientRect())),space:this.view.state.facet(Zo).tooltipSpace(this.view),scaleX:e,scaleY:i,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let t of this.manager.tooltipViews)t.dom.style.position="absolute"}let{editor:i,space:n,scaleX:s,scaleY:r}=t,o=[];for(let a=0;a=Math.min(i.bottom,n.bottom)||O.rightMath.min(i.right,n.right)+.1){c.style.top=xo;continue}let f=l.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,d=f?7:0,p=u.right-u.left,m=null!==(e=To.get(h))&&void 0!==e?e:u.bottom-u.top,g=h.offset||Yo,w=this.view.textDirection==sn.LTR,b=u.width>n.right-n.left?w?n.left:n.right-u.width:w?Math.min(O.left-(f?14:0)+g.x,n.right-p):Math.max(n.left,O.left-p+(f?14:0)-g.x),S=this.above[a];!l.strictSide&&(S?O.top-(u.bottom-u.top)-g.yn.bottom)&&S==n.bottom-O.bottom>O.top-n.top&&(S=this.above[a]=!S);let y=(S?O.top-n.top:n.bottom-O.bottom)-d;if(yb&&t.topQ&&(Q=S?t.top-m-2-d:t.bottom+d+2);if("absolute"==this.position?(c.style.top=(Q-t.parent.top)/r+"px",c.style.left=(b-t.parent.left)/s+"px"):(c.style.top=Q/r+"px",c.style.left=b/s+"px"),f){let t=O.left+(w?g.x:-g.x)-(b+14-7);f.style.left=t/s+"px"}!0!==h.overlap&&o.push({left:b,top:Q,right:v,bottom:Q+m}),c.classList.toggle("cm-tooltip-above",S),c.classList.toggle("cm-tooltip-below",!S),h.positioned&&h.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=xo}},{eventObservers:{scroll(){this.maybeMeasure()}}}),Co=Wr.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),Yo={x:0,y:0},Ao=Tt.define({enables:[Xo,Co]});function Ro(t,e){let i=t.plugin(Xo);if(!i)return null;let n=i.manager.tooltips.indexOf(e);return n<0?null:i.manager.tooltipViews[n]}function Wo(t){let e=t.plugin(Xo);e&&e.maybeMeasure()}const Vo=Tt.define({combine(t){let e,i;for(let n of t)e=e||n.topContainer,i=i||n.bottomContainer;return{topContainer:e,bottomContainer:i}}}),jo=qn.fromClass(class{constructor(t){this.input=t.state.facet(Eo),this.specs=this.input.filter((t=>t)),this.panels=this.specs.map((e=>e(t)));let e=t.state.facet(Vo);this.top=new qo(t,!0,e.topContainer),this.bottom=new qo(t,!1,e.bottomContainer),this.top.sync(this.panels.filter((t=>t.top))),this.bottom.sync(this.panels.filter((t=>!t.top)));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(t){let e=t.state.facet(Vo);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new qo(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new qo(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let i=t.state.facet(Eo);if(i!=this.input){let e=i.filter((t=>t)),n=[],s=[],r=[],o=[];for(let i of e){let e,a=this.specs.indexOf(i);a<0?(e=i(t.view),o.push(e)):(e=this.panels[a],e.update&&e.update(t)),n.push(e),(e.top?s:r).push(e)}this.specs=e,this.panels=n,this.top.sync(s),this.bottom.sync(r);for(let t of o)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}else for(let e of this.panels)e.update&&e.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>Wr.scrollMargins.of((e=>{let i=e.plugin(t);return i&&{top:i.top.scrollMargin(),bottom:i.bottom.scrollMargin()}}))});class qo{constructor(t,e,i){this.view=t,this.top=e,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let e of this.panels)e.destroy&&t.indexOf(e)<0&&e.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let t=this.dom.firstChild;for(let e of this.panels)if(e.dom.parentNode==this.dom){for(;t!=e.dom;)t=_o(t);t=t.nextSibling}else this.dom.insertBefore(e.dom,t);for(;t;)t=_o(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function _o(t){let e=t.nextSibling;return t.remove(),e}const Eo=Tt.define({enables:jo});class Mo extends be{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}Mo.prototype.elementClass="",Mo.prototype.toDOM=void 0,Mo.prototype.mapMode=mt.TrackBefore,Mo.prototype.startSide=Mo.prototype.endSide=-1,Mo.prototype.point=!0;const Do=Tt.define(),zo={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>ve.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},Go=Tt.define();function Io(t){return[No(),Go.of(Object.assign(Object.assign({},zo),t))]}const Bo=Tt.define({combine:t=>t.some((t=>t))});function No(t){let e=[Uo];return t&&!1===t.fixed&&e.push(Bo.of(!0)),e}const Uo=qn.fromClass(class{constructor(t){this.view=t,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Go).map((e=>new Jo(t,e)));for(let t of this.gutters)this.dom.appendChild(t.dom);this.fixed=!t.state.facet(Bo),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}update(t){if(this.updateGutters(t)){let e=this.prevViewport,i=t.view.viewport,n=Math.min(e.to,i.to)-Math.max(e.from,i.from);this.syncGutters(n<.8*(i.to-i.from))}t.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(Bo)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&this.dom.remove();let i=ve.iter(this.view.state.facet(Do),this.view.viewport.from),n=[],s=this.gutters.map((t=>new Ho(t,this.view.viewport,-this.view.documentPadding.top)));for(let t of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(t.type)){let e=!0;for(let r of t.type)if(r.type==Ni.Text&&e){Fo(i,n,r.from);for(let t of s)t.line(this.view,r,n);e=!1}else if(r.widget)for(let t of s)t.widget(this.view,r)}else if(t.type==Ni.Text){Fo(i,n,t.from);for(let e of s)e.line(this.view,t,n)}else if(t.widget)for(let e of s)e.widget(this.view,t);for(let t of s)t.finish();t&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(t){let e=t.startState.facet(Go),i=t.state.facet(Go),n=t.docChanged||t.heightChanged||t.viewportChanged||!ve.eq(t.startState.facet(Do),t.state.facet(Do),t.view.viewport.from,t.view.viewport.to);if(e==i)for(let e of this.gutters)e.update(t)&&(n=!0);else{n=!0;let s=[];for(let n of i){let i=e.indexOf(n);i<0?s.push(new Jo(this.view,n)):(this.gutters[i].update(t),s.push(this.gutters[i]))}for(let t of this.gutters)t.dom.remove(),s.indexOf(t)<0&&t.destroy();for(let t of s)this.dom.appendChild(t.dom);this.gutters=s}return n}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove()}},{provide:t=>Wr.scrollMargins.of((e=>{let i=e.plugin(t);return i&&0!=i.gutters.length&&i.fixed?e.textDirection==sn.LTR?{left:i.dom.offsetWidth*e.scaleX}:{right:i.dom.offsetWidth*e.scaleX}:null}))});function Lo(t){return Array.isArray(t)?t:[t]}function Fo(t,e,i){for(;t.value&&t.from<=i;)t.from==i&&e.push(t.value),t.next()}class Ho{constructor(t,e,i){this.gutter=t,this.height=i,this.i=0,this.cursor=ve.iter(t.markers,e.from)}addElement(t,e,i){let{gutter:n}=this,s=(e.top-this.height)/t.scaleY,r=e.height/t.scaleY;if(this.i==n.elements.length){let e=new Ko(t,r,s,i);n.elements.push(e),n.dom.appendChild(e.dom)}else n.elements[this.i].update(t,r,s,i);this.height=e.bottom,this.i++}line(t,e,i){let n=[];Fo(this.cursor,n,e.from),i.length&&(n=n.concat(i));let s=this.gutter.config.lineMarker(t,e,n);s&&n.unshift(s);let r=this.gutter;(0!=n.length||r.config.renderEmptyElements)&&this.addElement(t,e,n)}widget(t,e){let i=this.gutter.config.widgetMarker(t,e.widget,e);i&&this.addElement(t,e,[i])}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let e=t.elements.pop();t.dom.removeChild(e.dom),e.destroy()}}}class Jo{constructor(t,e){this.view=t,this.config=e,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in e.domEventHandlers)this.dom.addEventListener(i,(n=>{let s,r=n.target;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let t=r.getBoundingClientRect();s=(t.top+t.bottom)/2}else s=n.clientY;let o=t.lineBlockAtHeight(s-t.documentTop);e.domEventHandlers[i](t,o,n)&&n.preventDefault()}));this.markers=Lo(e.markers(t)),e.initialSpacer&&(this.spacer=new Ko(t,0,0,[e.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let e=this.markers;if(this.markers=Lo(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let e=this.config.updateSpacer(this.spacer.markers[0],t);e!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[e])}let i=t.view.viewport;return!ve.eq(this.markers,e,i.from,i.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(t)}destroy(){for(let t of this.elements)t.destroy()}}class Ko{constructor(t,e,i,n){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,e,i,n)}update(t,e,i,n){this.height!=e&&(this.height=e,this.dom.style.height=e+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),function(t,e){if(t.length!=e.length)return!1;for(let i=0;iwe(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(t,e){let i=Object.assign({},t);for(let t in e){let n=i[t],s=e[t];i[t]=n?(t,e,i)=>n(t,e,i)||s(t,e,i):s}return i}})});class ia extends Mo{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function na(t,e){return t.state.facet(ea).formatNumber(e,t.state)}const sa=Go.compute([ea],(t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:t=>t.state.facet(ta),lineMarker:(t,e,i)=>i.some((t=>t.toDOM))?null:new ia(na(t,t.state.doc.lineAt(e.from).number)),widgetMarker:()=>null,lineMarkerChange:t=>t.startState.facet(ea)!=t.state.facet(ea),initialSpacer:t=>new ia(na(t,oa(t.state.doc.lines))),updateSpacer(t,e){let i=na(e.view,oa(e.view.state.doc.lines));return i==t.number?t:new ia(i)},domEventHandlers:t.facet(ea).domEventHandlers})));function ra(t={}){return[ea.of(t),No(),sa]}function oa(t){let e=9;for(;ee.modified.indexOf(t)>-1?e:ca.get(e.base||e,e.modified.concat(t).sort(((t,e)=>t.id-e.id)))}}let ha=0;class ca{constructor(){this.instances=[],this.id=ha++}static get(t,e){if(!e.length)return t;let i=e[0].instances.find((i=>{return i.base==t&&(n=e,s=i.modified,n.length==s.length&&n.every(((t,e)=>t==s[e])));var n,s}));if(i)return i;let n=[],s=new la(n,t,e);for(let t of e)t.instances.push(s);let r=function(t){let e=[[]];for(let i=0;ie.length-t.length))}(e);for(let e of t.set)if(!e.modified.length)for(let t of r)n.push(ca.get(e,t));return s}}function Oa(t){let e=Object.create(null);for(let i in t){let n=t[i];Array.isArray(n)||(n=[n]);for(let t of i.split(" "))if(t){let i=[],s=2,r=t;for(let e=0;;){if("..."==r&&e>0&&e+3==t.length){s=1;break}let n=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(r);if(!n)throw new RangeError("Invalid path: "+t);if(i.push("*"==n[0]?"":'"'==n[0][0]?JSON.parse(n[0]):n[0]),e+=n[0].length,e==t.length)break;let o=t[e++];if(e==t.length&&"!"==o){s=0;break}if("/"!=o)throw new RangeError("Invalid path: "+t);r=t.slice(e)}let o=i.length-1,a=i[o];if(!a)throw new RangeError("Invalid path: "+t);let l=new fa(n,s,o>0?i.slice(0,o):null);e[a]=l.sort(e[a])}}return ua.add(e)}const ua=new n;class fa{constructor(t,e,i,n){this.tags=t,this.mode=e,this.context=i,this.next=n}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(t){return!t||t.depth{let e=s;for(let n of t)for(let t of n.set){let n=i[t.id];if(n){e=e?e+" "+n:n;break}}return e},scope:n}}function pa(t,e,i,n=0,s=t.length){let r=new ma(n,Array.isArray(e)?e:[e],i);r.highlightRange(t.cursor(),n,s,"",r.highlighters),r.flush(s)}fa.empty=new fa([],2,null);class ma{constructor(t,e,i){this.at=t,this.highlighters=e,this.span=i,this.class=""}startSpan(t,e){e!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=e)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,e,i,s,r){let{type:o,from:a,to:l}=t;if(a>=i||l<=e)return;o.isTop&&(r=this.highlighters.filter((t=>!t.scope||t.scope(o))));let h=s,c=function(t){let e=t.type.prop(ua);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}(t)||fa.empty,O=function(t,e){let i=null;for(let n of t){let t=n.style(e);t&&(i=i?i+" "+t:t)}return i}(r,c.tags);if(O&&(h&&(h+=" "),h+=O,1==c.mode&&(s+=(s?" ":"")+O)),this.startSpan(Math.max(e,a),h),c.opaque)return;let u=t.tree&&t.tree.prop(n.mounted);if(u&&u.overlay){let n=t.node.enter(u.overlay[0].from+a,1),o=this.highlighters.filter((t=>!t.scope||t.scope(u.tree.type))),c=t.firstChild();for(let O=0,f=a;;O++){let d=O=p)&&t.nextSibling()););if(!d||p>i)break;f=d.to+a,f>e&&(this.highlightRange(n.cursor(),Math.max(e,d.from+a),Math.min(i,f),"",o),this.startSpan(Math.min(i,f),h))}c&&t.parent()}else if(t.firstChild()){u&&(s="");do{if(!(t.to<=e)){if(t.from>=i)break;this.highlightRange(t,e,i,s,r),this.startSpan(Math.min(i,t.to),h)}}while(t.nextSibling());t.parent()}}}const ga=la.define,wa=ga(),ba=ga(),Sa=ga(ba),ya=ga(ba),Qa=ga(),va=ga(Qa),xa=ga(Qa),ka=ga(),$a=ga(ka),Pa=ga(),Za=ga(),Ta=ga(),Xa=ga(Ta),Ca=ga(),Ya={comment:wa,lineComment:ga(wa),blockComment:ga(wa),docComment:ga(wa),name:ba,variableName:ga(ba),typeName:Sa,tagName:ga(Sa),propertyName:ya,attributeName:ga(ya),className:ga(ba),labelName:ga(ba),namespace:ga(ba),macroName:ga(ba),literal:Qa,string:va,docString:ga(va),character:ga(va),attributeValue:ga(va),number:xa,integer:ga(xa),float:ga(xa),bool:ga(Qa),regexp:ga(Qa),escape:ga(Qa),color:ga(Qa),url:ga(Qa),keyword:Pa,self:ga(Pa),null:ga(Pa),atom:ga(Pa),unit:ga(Pa),modifier:ga(Pa),operatorKeyword:ga(Pa),controlKeyword:ga(Pa),definitionKeyword:ga(Pa),moduleKeyword:ga(Pa),operator:Za,derefOperator:ga(Za),arithmeticOperator:ga(Za),logicOperator:ga(Za),bitwiseOperator:ga(Za),compareOperator:ga(Za),updateOperator:ga(Za),definitionOperator:ga(Za),typeOperator:ga(Za),controlOperator:ga(Za),punctuation:Ta,separator:ga(Ta),bracket:Xa,angleBracket:ga(Xa),squareBracket:ga(Xa),paren:ga(Xa),brace:ga(Xa),content:ka,heading:$a,heading1:ga($a),heading2:ga($a),heading3:ga($a),heading4:ga($a),heading5:ga($a),heading6:ga($a),contentSeparator:ga(ka),list:ga(ka),quote:ga(ka),emphasis:ga(ka),strong:ga(ka),link:ga(ka),monospace:ga(ka),strikethrough:ga(ka),inserted:ga(),deleted:ga(),changed:ga(),invalid:ga(),meta:Ca,documentMeta:ga(Ca),annotation:ga(Ca),processingInstruction:ga(Ca),definition:la.defineModifier(),constant:la.defineModifier(),function:la.defineModifier(),standard:la.defineModifier(),local:la.defineModifier(),special:la.defineModifier()};var Aa;da([{tag:Ya.link,class:"tok-link"},{tag:Ya.heading,class:"tok-heading"},{tag:Ya.emphasis,class:"tok-emphasis"},{tag:Ya.strong,class:"tok-strong"},{tag:Ya.keyword,class:"tok-keyword"},{tag:Ya.atom,class:"tok-atom"},{tag:Ya.bool,class:"tok-bool"},{tag:Ya.url,class:"tok-url"},{tag:Ya.labelName,class:"tok-labelName"},{tag:Ya.inserted,class:"tok-inserted"},{tag:Ya.deleted,class:"tok-deleted"},{tag:Ya.literal,class:"tok-literal"},{tag:Ya.string,class:"tok-string"},{tag:Ya.number,class:"tok-number"},{tag:[Ya.regexp,Ya.escape,Ya.special(Ya.string)],class:"tok-string2"},{tag:Ya.variableName,class:"tok-variableName"},{tag:Ya.local(Ya.variableName),class:"tok-variableName tok-local"},{tag:Ya.definition(Ya.variableName),class:"tok-variableName tok-definition"},{tag:Ya.special(Ya.variableName),class:"tok-variableName2"},{tag:Ya.definition(Ya.propertyName),class:"tok-propertyName tok-definition"},{tag:Ya.typeName,class:"tok-typeName"},{tag:Ya.namespace,class:"tok-namespace"},{tag:Ya.className,class:"tok-className"},{tag:Ya.macroName,class:"tok-macroName"},{tag:Ya.propertyName,class:"tok-propertyName"},{tag:Ya.operator,class:"tok-operator"},{tag:Ya.comment,class:"tok-comment"},{tag:Ya.meta,class:"tok-meta"},{tag:Ya.invalid,class:"tok-invalid"},{tag:Ya.punctuation,class:"tok-punctuation"}]);const Ra=new n;function Wa(t){return Tt.define({combine:t?e=>e.concat(t):void 0})}const Va=new n;class ja{constructor(t,e,i=[],n=""){this.data=t,this.name=n,ge.prototype.hasOwnProperty("tree")||Object.defineProperty(ge.prototype,"tree",{get(){return Ea(this)}}),this.parser=e,this.extension=[Fa.of(this),ge.languageData.of(((t,e,i)=>{let n=qa(t,e,i),s=n.type.prop(Ra);if(!s)return[];let r=t.facet(s),o=n.type.prop(Va);if(o){let s=n.resolve(e-n.from,i);for(let e of o)if(e.test(s,t)){let i=t.facet(e.facet);return"replace"==e.type?i:i.concat(r)}}return r}))].concat(i)}isActiveAt(t,e,i=-1){return qa(t,e,i).type.prop(Ra)==this.data}findRegions(t){let e=t.facet(Fa);if((null==e?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let i=[],s=(t,e)=>{if(t.prop(Ra)==this.data)return void i.push({from:e,to:e+t.length});let r=t.prop(n.mounted);if(r){if(r.tree.prop(Ra)==this.data){if(r.overlay)for(let t of r.overlay)i.push({from:t.from+e,to:t.to+e});else i.push({from:e,to:e+t.length});return}if(r.overlay){let t=i.length;if(s(r.tree,r.overlay[0].from+e),i.length>t)return}}for(let i=0;it.isTop?e:void 0))]}),t.name)}configure(t,e){return new _a(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Ea(t){let e=t.field(ja.state,!1);return e?e.tree:O.empty}function Ma(t,e,i=50){var n;let s=null===(n=t.field(ja.state,!1))||void 0===n?void 0:n.context;if(!s)return null;let r=s.viewport;s.updateViewport({from:0,to:e});let o=s.isDone(e)||s.work(i,e)?s.tree:null;return s.updateViewport(r),o}class Da{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let i=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-i,e-i)}}let za=null;class Ga{constructor(t,e,i=[],n,s,r,o,a){this.parser=t,this.state=e,this.fragments=i,this.tree=n,this.treeLen=s,this.viewport=r,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(t,e,i){return new Ga(t,e,[],O.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Da(this.state.doc),this.fragments)}work(t,e){return null!=e&&e>=this.state.doc.length&&(e=void 0),this.tree!=O.empty&&this.isDone(null!=e?e:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var i;if("number"==typeof t){let e=Date.now()+t;t=()=>Date.now()>e}for(this.parse||(this.parse=this.startParse()),null!=e&&(null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&e=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext((()=>{for(;!(e=this.parse.advance()););})),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(X.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=za;za=this;try{return t()}finally{za=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=Ia(t,e.from,e.to);return t}changes(t,e){let{fragments:i,tree:n,treeLen:s,viewport:r,skipped:o}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges(((t,i,n,s)=>e.push({fromA:t,toA:i,fromB:n,toB:s}))),i=X.applyChanges(i,e),n=O.empty,s=0,r={from:t.mapPos(r.from,-1),to:t.mapPos(r.to,1)},this.skipped.length){o=[];for(let e of this.skipped){let i=t.mapPos(e.from,1),n=t.mapPos(e.to,-1);it.from&&(this.fragments=Ia(this.fragments,i,n),this.skipped.splice(e--,1))}return!(this.skipped.length>=e)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends C{createParse(e,i,n){let s=n[0].from,r=n[n.length-1].to;return{parsedPos:s,advance(){let e=za;if(e){for(let t of n)e.tempSkipped.push(t);t&&(e.scheduleOn=e.scheduleOn?Promise.all([e.scheduleOn,t]):t)}return this.parsedPos=r,new O(o.none,[],[],r-s)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&0==e[0].from&&e[0].to>=t}static get(){return za}}function Ia(t,e,i){return X.applyChanges(t,[{fromA:e,toA:i,fromB:e,toB:i}])}class Ba{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,i)||e.takeTree(),new Ba(e)}static init(t){let e=Math.min(3e3,t.doc.length),i=Ga.create(t.facet(Fa).parser,t,{from:0,to:e});return i.work(20,e)||i.takeTree(),new Ba(i)}}ja.state=Vt.define({create:Ba.init,update(t,e){for(let t of e.effects)if(t.is(ja.setState))return t.value;return e.startState.facet(Fa)!=e.state.facet(Fa)?Ba.init(e.state):t.apply(e)}});let Na=t=>{let e=setTimeout((()=>t()),500);return()=>clearTimeout(e)};"undefined"!=typeof requestIdleCallback&&(Na=t=>{let e=-1,i=setTimeout((()=>{e=requestIdleCallback(t,{timeout:400})}),100);return()=>e<0?clearTimeout(i):cancelIdleCallback(e)});const Ua="undefined"!=typeof navigator&&(null===(Aa=navigator.scheduling)||void 0===Aa?void 0:Aa.isInputPending)?()=>navigator.scheduling.isInputPending():null,La=qn.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(ja.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(ja.state);e.tree==e.context.tree&&e.context.isDone(t.doc.length)||(this.working=Na(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEndn+1e3,a=s.context.work((()=>Ua&&Ua()||Date.now()>r),n+(o?0:1e5));this.chunkBudget-=Date.now()-e,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:ja.setState.of(new Ba(s.context))})),this.chunkBudget>0&&(!a||o)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then((()=>this.scheduleWork())).catch((t=>Rn(this.view.state,t))).then((()=>this.workScheduled--)),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Fa=Tt.define({combine:t=>t.length?t[0]:null,enables:t=>[ja.state,La,Wr.contentAttributes.compute([t],(e=>{let i=e.facet(t);return i&&i.name?{"data-language":i.name}:{}}))]});class Ha{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}class Ja{constructor(t,e,i,n,s,r=void 0){this.name=t,this.alias=e,this.extensions=i,this.filename=n,this.loadFunc=s,this.support=r,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then((t=>this.support=t),(t=>{throw this.loading=null,t})))}static of(t){let{load:e,support:i}=t;if(!e){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");e=()=>Promise.resolve(i)}return new Ja(t.name,(t.alias||[]).concat(t.name).map((t=>t.toLowerCase())),t.extensions||[],t.filename,e,i)}static matchFilename(t,e){for(let i of t)if(i.filename&&i.filename.test(e))return i;let i=/\.([^.]+)$/.exec(e);if(i)for(let e of t)if(e.extensions.indexOf(i[1])>-1)return e;return null}static matchLanguageName(t,e,i=!0){e=e.toLowerCase();for(let i of t)if(i.alias.some((t=>t==e)))return i;if(i)for(let i of t)for(let t of i.alias){let n=e.indexOf(t);if(n>-1&&(t.length>2||!/\w/.test(e[n-1])&&!/\w/.test(e[n+t.length])))return i}return null}}const Ka=Tt.define(),tl=Tt.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some((t=>t!=e[0])))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function el(t){let e=t.facet(tl);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function il(t,e){let i="",n=t.tabSize,s=t.facet(tl)[0];if("\t"==s){for(;e>=n;)i+="\t",e-=n;s=" "}for(let t=0;t=e?function(t,e,i){let n=e.resolveStack(i),s=n.node.enterUnfinishedNodesBefore(i);if(s!=n.node){let t=[];for(let e=s;e!=n.node;e=e.parent)t.push(e);for(let e=t.length-1;e>=0;e--)n={node:t[e],next:n}}return ol(n,t,i)}(t,i,e):null}class sl{constructor(t,e={}){this.state=t,this.options=e,this.unit=el(t)}lineAt(t,e=1){let i=this.state.doc.lineAt(t),{simulateBreak:n,simulateDoubleBreak:s}=this.options;return null!=n&&n>=i.from&&n<=i.to?s&&n==t?{text:"",from:t}:(e<0?n-1&&(s+=r-this.countColumn(i,i.search(/\S|$/))),s}countColumn(t,e=t.length){return We(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:i,from:n}=this.lineAt(t,e),s=this.options.overrideIndentation;if(s){let t=s(n);if(t>-1)return t}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const rl=new n;function ol(t,e,i){for(let n=t;n;n=n.next){let t=al(n.node);if(t)return t(hl.create(e,i,n))}return 0}function al(t){let e=t.type.prop(rl);if(e)return e;let i,s=t.firstChild;if(s&&(i=s.type.prop(n.closedBy))){let e=t.lastChild,n=e&&i.indexOf(e.name)>-1;return t=>ul(t,!0,1,void 0,n&&!function(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}(t)?e.from:void 0)}return null==t.parent?ll:null}function ll(){return 0}class hl extends sl{constructor(t,e,i){super(t.state,t.options),this.base=t,this.pos=e,this.context=i}get node(){return this.context.node}static create(t,e,i){return new hl(t,e,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(e.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(cl(i,t))break;e=this.state.doc.lineAt(i.from)}return this.lineIndent(e.from)}continue(){return ol(this.context.next,this.base,this.pos)}}function cl(t,e){for(let i=e;i;i=i.parent)if(t==i)return!0;return!1}function Ol({closing:t,align:e=!0,units:i=1}){return n=>ul(n,e,i,t)}function ul(t,e,i,n,s){let r=t.textAfter,o=r.match(/^\s*/)[0].length,a=n&&r.slice(o,o+n.length)==n||s==t.pos+o,l=e?function(t){let e=t.node,i=e.childAfter(e.from),n=e.lastChild;if(!i)return null;let s=t.options.simulateBreak,r=t.state.doc.lineAt(i.from),o=null==s||s<=r.from?r.to:Math.min(r.to,s);for(let t=i.to;;){let s=e.childAfter(t);if(!s||s==n)return null;if(!s.type.isSkipped)return s.fromt.baseIndent;function dl({except:t,units:e=1}={}){return i=>{let n=t&&t.test(i.textAfter);return i.baseIndent+(n?0:e*i.unit)}}function pl(){return ge.transactionFilter.of((t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let i=t.newDoc,{head:n}=t.newSelection.main,s=i.lineAt(n);if(n>s.from+200)return t;let r=i.sliceString(s.from,n);if(!e.some((t=>t.test(r))))return t;let{state:o}=t,a=-1,l=[];for(let{head:t}of o.selection.ranges){let e=o.doc.lineAt(t);if(e.from==a)continue;a=e.from;let i=nl(o,e.from);if(null==i)continue;let n=/^\s*/.exec(e.text)[0],s=il(o,i);n!=s&&l.push({from:e.from,to:e.from+n.length,insert:s})}return l.length?[t,{changes:l,sequential:!0}]:t}))}const ml=Tt.define(),gl=new n;function wl(t){let e=t.firstChild,i=t.lastChild;return e&&e.toi)continue;if(s&&o.from=e&&n.to>i&&(s=n)}}return s}(t,e,i)}function yl(t,e){let i=e.mapPos(t.from,1),n=e.mapPos(t.to,-1);return i>=n?void 0:{from:i,to:n}}const Ql=re.define({map:yl}),vl=re.define({map:yl});function xl(t){let e=[];for(let{head:i}of t.state.selection.ranges)e.some((t=>t.from<=i&&t.to>=i))||e.push(t.lineBlockAt(i));return e}const kl=Vt.define({create:()=>Ui.none,update(t,e){t=t.map(e.changes);for(let i of e.effects)if(i.is(Ql)&&!Pl(t,i.value.from,i.value.to)){let{preparePlaceholder:n}=e.state.facet(Yl),s=n?Ui.replace({widget:new Vl(n(e.state,i.value))}):Wl;t=t.update({add:[s.range(i.value.from,i.value.to)]})}else i.is(vl)&&(t=t.update({filter:(t,e)=>i.value.from!=t||i.value.to!=e,filterFrom:i.value.from,filterTo:i.value.to}));if(e.selection){let i=!1,{head:n}=e.selection.main;t.between(n,n,((t,e)=>{tn&&(i=!0)})),i&&(t=t.update({filterFrom:n,filterTo:n,filter:(t,e)=>e<=n||t>=n}))}return t},provide:t=>Wr.decorations.from(t),toJSON(t,e){let i=[];return t.between(0,e.doc.length,((t,e)=>{i.push(t,e)})),i},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let i=0;i{(!s||s.from>t)&&(s={from:t,to:e})})),s}function Pl(t,e,i){let n=!1;return t.between(e,e,((t,s)=>{t==e&&s==i&&(n=!0)})),n}function Zl(t,e){return t.field(kl,!1)?e:e.concat(re.appendConfig.of(Al()))}function Tl(t,e,i=!0){let n=t.state.doc.lineAt(e.from).number,s=t.state.doc.lineAt(e.to).number;return Wr.announce.of(`${t.state.phrase(i?"Folded lines":"Unfolded lines")} ${n} ${t.state.phrase("to")} ${s}.`)}const Xl=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:t=>{for(let e of xl(t)){let i=Sl(t.state,e.from,e.to);if(i)return t.dispatch({effects:Zl(t.state,[Ql.of(i),Tl(t,i)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:t=>{if(!t.state.field(kl,!1))return!1;let e=[];for(let i of xl(t)){let n=$l(t.state,i.from,i.to);n&&e.push(vl.of(n),Tl(t,n,!1))}return e.length&&t.dispatch({effects:e}),e.length>0}},{key:"Ctrl-Alt-[",run:t=>{let{state:e}=t,i=[];for(let n=0;n{let e=t.state.field(kl,!1);if(!e||!e.size)return!1;let i=[];return e.between(0,t.state.doc.length,((t,e)=>{i.push(vl.of({from:t,to:e}))})),t.dispatch({effects:i}),!0}}],Cl={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Yl=Tt.define({combine:t=>we(t,Cl)});function Al(t){let e=[kl,El];return t&&e.push(Yl.of(t)),e}function Rl(t,e){let{state:i}=t,n=i.facet(Yl),s=e=>{let i=t.lineBlockAt(t.posAtDOM(e.target)),n=$l(t.state,i.from,i.to);n&&t.dispatch({effects:vl.of(n)}),e.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(t,s,e);let r=document.createElement("span");return r.textContent=n.placeholderText,r.setAttribute("aria-label",i.phrase("folded code")),r.title=i.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=s,r}const Wl=Ui.replace({widget:new class extends Bi{toDOM(t){return Rl(t,null)}}});class Vl extends Bi{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return Rl(t,this.value)}}const jl={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class ql extends Mo{constructor(t,e){super(),this.config=t,this.open=e}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let e=document.createElement("span");return e.textContent=this.open?this.config.openText:this.config.closedText,e.title=t.state.phrase(this.open?"Fold line":"Unfold line"),e}}function _l(t={}){let e=Object.assign(Object.assign({},jl),t),i=new ql(e,!0),n=new ql(e,!1),s=qn.fromClass(class{constructor(t){this.from=t.viewport.from,this.markers=this.buildMarkers(t)}update(t){(t.docChanged||t.viewportChanged||t.startState.facet(Fa)!=t.state.facet(Fa)||t.startState.field(kl,!1)!=t.state.field(kl,!1)||Ea(t.startState)!=Ea(t.state)||e.foldingChanged(t))&&(this.markers=this.buildMarkers(t.view))}buildMarkers(t){let e=new xe;for(let s of t.viewportLineBlocks){let r=$l(t.state,s.from,s.to)?n:Sl(t.state,s.from,s.to)?i:null;r&&e.add(s.from,s.from,r)}return e.finish()}}),{domEventHandlers:r}=e;return[s,Io({class:"cm-foldGutter",markers(t){var e;return(null===(e=t.plugin(s))||void 0===e?void 0:e.markers)||ve.empty},initialSpacer:()=>new ql(e,!1),domEventHandlers:Object.assign(Object.assign({},r),{click:(t,e,i)=>{if(r.click&&r.click(t,e,i))return!0;let n=$l(t.state,e.from,e.to);if(n)return t.dispatch({effects:vl.of(n)}),!0;let s=Sl(t.state,e.from,e.to);return!!s&&(t.dispatch({effects:Ql.of(s)}),!0)}})}),Al()]}const El=Wr.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Ml{constructor(t,e){let i;function n(t){let e=_e.newName();return(i||(i=Object.create(null)))["."+e]=t,e}this.specs=t;const s="string"==typeof e.all?e.all:e.all?n(e.all):void 0,r=e.scope;this.scope=r instanceof ja?t=>t.prop(Ra)==r.data:r?t=>t==r:void 0,this.style=da(t.map((t=>({tag:t.tag,class:t.class||n(Object.assign({},t,{tag:null}))}))),{all:s}).style,this.module=i?new _e(i):null,this.themeType=e.themeType}static define(t,e){return new Ml(t,e||{})}}const Dl=Tt.define(),zl=Tt.define({combine:t=>t.length?[t[0]]:null});function Gl(t){let e=t.facet(Dl);return e.length?e:t.facet(zl)}function Il(t,e){let i,n=[Nl];return t instanceof Ml&&(t.module&&n.push(Wr.styleModule.of(t.module)),i=t.themeType),(null==e?void 0:e.fallback)?n.push(zl.of(t)):i?n.push(Dl.computeN([Wr.darkTheme],(e=>e.facet(Wr.darkTheme)==("dark"==i)?[t]:[]))):n.push(Dl.of(t)),n}class Bl{constructor(t){this.markCache=Object.create(null),this.tree=Ea(t.state),this.decorations=this.buildDeco(t,Gl(t.state))}update(t){let e=Ea(t.state),i=Gl(t.state),n=i!=Gl(t.startState);e.length{i.add(t,e,this.markCache[n]||(this.markCache[n]=Ui.mark({class:n})))}),n,s);return i.finish()}}const Nl=Dt.high(qn.fromClass(Bl,{decorations:t=>t.decorations}));Ya.meta,Ya.link,Ya.heading,Ya.emphasis,Ya.strong,Ya.strikethrough,Ya.keyword,Ya.atom,Ya.bool,Ya.url,Ya.contentSeparator,Ya.labelName,Ya.literal,Ya.inserted,Ya.string,Ya.deleted,Ya.regexp,Ya.escape,Ya.string,Ya.variableName,Ya.variableName,Ya.typeName,Ya.namespace,Ya.className,Ya.variableName,Ya.macroName,Ya.propertyName,Ya.comment,Ya.invalid;const Ul=Wr.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Ll=1e4,Fl="()[]{}",Hl=Tt.define({combine:t=>we(t,{afterCursor:!0,brackets:Fl,maxScanDistance:Ll,renderMatch:th})}),Jl=Ui.mark({class:"cm-matchingBracket"}),Kl=Ui.mark({class:"cm-nonmatchingBracket"});function th(t){let e=[],i=t.matched?Jl:Kl;return e.push(i.range(t.start.from,t.start.to)),t.end&&e.push(i.range(t.end.from,t.end.to)),e}const eh=Vt.define({create:()=>Ui.none,update(t,e){if(!e.docChanged&&!e.selection)return t;let i=[],n=e.state.facet(Hl);for(let t of e.state.selection.ranges){if(!t.empty)continue;let s=ah(e.state,t.head,-1,n)||t.head>0&&ah(e.state,t.head-1,1,n)||n.afterCursor&&(ah(e.state,t.head,1,n)||t.headWr.decorations.from(t)}),ih=[eh,Ul];function nh(t={}){return[Hl.of(t),ih]}const sh=new n;function rh(t,e,i){let s=t.prop(e<0?n.openedBy:n.closedBy);if(s)return s;if(1==t.name.length){let n=i.indexOf(t.name);if(n>-1&&n%2==(e<0?1:0))return[i[n+e]]}return null}function oh(t){let e=t.type.prop(sh);return e?e(t.node):t}function ah(t,e,i,n={}){let s=n.maxScanDistance||Ll,r=n.brackets||Fl,o=Ea(t),a=o.resolveInner(e,i);for(let n=a;n;n=n.parent){let s=rh(n.type,i,r);if(s&&n.from0?e>=o.from&&eo.from&&e<=o.to))return lh(t,e,i,n,o,s,r)}}return function(t,e,i,n,s,r,o){let a=i<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),l=o.indexOf(a);if(l<0||l%2==0!=i>0)return null;let h={from:i<0?e-1:e,to:i>0?e+1:e},c=t.doc.iterRange(e,i>0?t.doc.length:0),O=0;for(let t=0;!c.next().done&&t<=r;){let r=c.value;i<0&&(t+=r.length);let a=e+t*i;for(let t=i>0?0:r.length-1,e=i>0?r.length:-1;t!=e;t+=i){let e=o.indexOf(r[t]);if(!(e<0||n.resolveInner(a+t,1).type!=s))if(e%2==0==i>0)O++;else{if(1==O)return{start:h,end:{from:a+t,to:a+t+1},matched:e>>1==l>>1};O--}}i>0&&(t+=r.length)}return c.done?{start:h,matched:!1}:null}(t,e,i,o,a.type,s,r)}function lh(t,e,i,n,s,r,o){let a=n.parent,l={from:s.from,to:s.to},h=0,c=null==a?void 0:a.cursor();if(c&&(i<0?c.childBefore(n.from):c.childAfter(n.to)))do{if(i<0?c.to<=n.from:c.from>=n.to){if(0==h&&r.indexOf(c.type.name)>-1&&c.from=this.string.length}sol(){return 0==this.pos}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pose}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPosi?t.toLowerCase():t;return n(this.string.substr(this.pos,t.length))==n(t)?(!1!==e&&(this.pos+=t.length),!0):null}{let i=this.string.slice(this.pos).match(t);return i&&i.index>0?null:(i&&!1!==e&&(this.pos+=i[0].length),i)}}current(){return this.string.slice(this.start,this.pos)}}function Oh(t){if("object"!=typeof t)return t;let e={};for(let i in t){let n=t[i];e[i]=n instanceof Array?n.slice():n}return e}const uh=new WeakMap;class fh extends ja{constructor(t){let e,i=Wa(t.languageData),s={name:(r=t).name||"",token:r.token,blankLine:r.blankLine||(()=>{}),startState:r.startState||(()=>!0),copyState:r.copyState||Oh,indent:r.indent||(()=>null),languageData:r.languageData||{},tokenTable:r.tokenTable||wh};var r;super(i,new class extends C{createParse(t,i,n){return new mh(e,t,i,n)}},[Ka.of(((t,e)=>this.getIndent(t,e)))],t.name),this.topNode=function(t){let e=o.define({id:bh.length,name:"Document",props:[Ra.add((()=>t))],top:!0});return bh.push(e),e}(i),e=this,this.streamParser=s,this.stateAfter=new n({perNode:!0}),this.tokenTable=t.tokenTable?new xh(s.tokenTable):kh}static define(t){return new fh(t)}getIndent(t,e){let i,n=Ea(t.state),s=n.resolve(e);for(;s&&s.type!=this.topNode;)s=s.parent;if(!s)return null;let{overrideIndentation:r}=t.options;r&&(i=uh.get(t.state),null!=i&&i1e4)return null;for(;o=n&&i+e.length<=s&&e.prop(t.stateAfter);if(r)return{state:t.streamParser.copyState(r),pos:i+e.length};for(let r=e.children.length-1;r>=0;r--){let o=e.children[r],a=i+e.positions[r],l=o instanceof O&&a=e.length)return e;s||e.type!=t.topNode||(s=!0);for(let r=e.children.length-1;r>=0;r--){let o,a=e.positions[r],l=e.children[r];if(ai&&dh(t,n.tree,0-n.offset,i,r);if(o&&(e=ph(t,n.tree,i+n.offset,o.pos+n.offset,!1)))return{state:o.state,tree:e}}return{state:t.streamParser.startState(n?el(n):4),tree:O.empty}}(t,i,r,null==s?void 0:s.state);this.state=o,this.parsedPos=this.chunkStart=r+a.length;for(let t=0;t=e?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,e),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let e=this.input.chunk(t);if(this.input.lineChunks)"\n"==e&&(e="");else{let t=e.indexOf("\n");t>-1&&(e=e.slice(0,t))}return t+e.length<=this.to?e:e.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,e=this.lineAfter(t),i=t+e.length;for(let t=this.rangeIndex;;){let n=this.ranges[t].to;if(n>=i)break;if(e=e.slice(0,n-(i-e.length)),t++,t==this.ranges.length)break;let s=this.ranges[t].from,r=this.lineAfter(s);e+=r,i=s+r.length}return{line:e,end:i}}skipGapsTo(t,e,i){for(;;){let n=this.ranges[this.rangeIndex].to,s=t+e;if(i>0?n>s:n>=s)break;e+=this.ranges[++this.rangeIndex].from-n}return e}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){e+=s=this.skipGapsTo(e,s,1);let t=this.chunk.length;i+=s=this.skipGapsTo(i,s,-1),n+=this.chunk.length-t}return this.chunk.push(t,e,i,n),s}parseLine(t){let{line:e,end:i}=this.nextLine(),n=0,{streamParser:s}=this.lang,r=new ch(e,t?t.state.tabSize:4,t?el(t.state):2);if(r.eol())s.blankLine(this.state,r.indentUnit);else for(;!r.eol();){let t=gh(s.token,r,this.state);if(t&&(n=this.emitToken(this.lang.tokenTable.resolve(t),this.parsedPos+r.start,this.parsedPos+r.pos,4,n)),r.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPose.start)return n}throw new Error("Stream parser failed to advance stream.")}const wh=Object.create(null),bh=[o.none],Sh=new a(bh),yh=[],Qh=Object.create(null),vh=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])vh[t]=Ph(wh,e);class xh{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),vh)}resolve(t){return t?this.table[t]||(this.table[t]=Ph(this.extra,t)):0}}const kh=new xh(wh);function $h(t,e){yh.indexOf(t)>-1||(yh.push(t),console.warn(e))}function Ph(t,e){let i=[];for(let n of e.split(" ")){let e=[];for(let i of n.split(".")){let n=t[i]||Ya[i];n?"function"==typeof n?e.length?e=e.map(n):$h(i,`Modifier ${i} used at start of tag`):e.length?$h(i,`Tag ${i} used as modifier`):e=Array.isArray(n)?n:[n]:$h(i,`Unknown highlighting tag ${i}`)}for(let t of e)i.push(t)}if(!i.length)return 0;let n=e.replace(/ /g,"_"),s=n+" "+i.map((t=>t.id)),r=Qh[s];if(r)return r.id;let a=Qh[s]=o.define({id:bh.length,name:n,props:[Oa({[n]:i})]});return bh.push(a),a.id}function Zh(t){return t.length<=4096&&/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/.test(t)}function Th(t){for(let e=t.iter();!e.next().done;)if(Zh(e.value))return!0;return!1}const Xh=Tt.define({combine:t=>t.some((t=>t))});function Ch(t={}){let e=[Yh];return t.alwaysIsolate&&e.push(Xh.of(!0)),e}const Yh=qn.fromClass(class{constructor(t){this.always=t.state.facet(Xh)||t.textDirection!=sn.LTR||t.state.facet(Wr.perLineTextDirection),this.hasRTL=!this.always&&Th(t.state.doc),this.tree=Ea(t.state),this.decorations=Ah(t,this.tree,this.always)}update(t){let e=t.state.facet(Xh)||t.view.textDirection!=sn.LTR||t.state.facet(Wr.perLineTextDirection);if(e||this.hasRTL||!function(t){let e=!1;return t.iterChanges(((t,i,n,s,r)=>{!e&&Th(r)&&(e=!0)})),e}(t.changes)||(this.hasRTL=!0),!e&&!this.hasRTL)return;let i=Ea(t.state);(e!=this.always||i!=this.tree||t.docChanged||t.viewportChanged)&&(this.tree=i,this.always=e,this.decorations=Ah(t.view,i,e))}},{provide:t=>{function e(e){var i,n;return null!==(n=null===(i=e.plugin(t))||void 0===i?void 0:i.decorations)&&void 0!==n?n:Ui.none}return[Wr.outerDecorations.of(e),Dt.lowest(Wr.bidiIsolatedRanges.of(e))]}});function Ah(t,e,i){let s=new xe,r=t.visibleRanges;i||(r=function(t,e){let i=e.iter(),n=0,s=[],r=null;for(let{from:e,to:o}of t)for(e!=n&&(nt-10?r.to=Math.min(o,e):s.push(r={from:t,to:Math.min(o,e)})),n>=o)break;n=e,i.next()}return s}(r,t.state.doc));for(let{from:t,to:i}of r)e.iterate({enter:t=>{let e=t.type.prop(n.isolate);e&&s.add(t.from,t.to,Rh[e])},from:t,to:i});return s.finish()}const Rh={rtl:Ui.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:sn.RTL}),ltr:Ui.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:sn.LTR}),auto:Ui.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};class Wh{constructor(t,e,i,n,s,r,o,a,l,h=0,c){this.p=t,this.stack=e,this.state=i,this.reducePos=n,this.pos=s,this.score=r,this.buffer=o,this.bufferBase=a,this.curContext=l,this.lookAhead=h,this.parent=c}toString(){return`[${this.stack.filter(((t,e)=>e%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,e,i=0){let n=t.parser.context;return new Wh(t,[],e,i,i,0,[],0,n?new Vh(n,n.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var e;let i=t>>19,n=65535&t,{parser:s}=this.p,r=s.dynamicPrecedence(n);if(r&&(this.score+=r),0==i)return this.pushState(s.getGoto(this.state,n,!0),this.reducePos),n=2e3&&!(null===(e=this.p.parser.nodeSet.types[n])||void 0===e?void 0:e.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=l):this.p.lastBigReductionSizeo;)this.stack.pop();this.reduceContext(n,a)}storeNode(t,e,i,n=4,s=!1){if(0==t&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==t.buffer[n-4]&&t.buffer[n-1]>-1){if(e==i)return;if(t.buffer[n-2]>=e)return void(t.buffer[n-2]=i)}}if(s&&this.pos!=i){let s=this.buffer.length;if(s>0&&0!=this.buffer[s-4])for(;s>0&&this.buffer[s-2]>i;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,n>4&&(n-=4);this.buffer[s]=t,this.buffer[s+1]=e,this.buffer[s+2]=i,this.buffer[s+3]=n}else this.buffer.push(t,e,i,n)}shift(t,e,i,n){if(131072&t)this.pushState(65535&t,this.pos);else if(262144&t)this.pos=n,this.shiftContext(e,i),e<=this.p.parser.maxNode&&this.buffer.push(e,i,n,4);else{let s=t,{parser:r}=this.p;(n>this.pos||e<=r.maxNode)&&(this.pos=n,r.stateFlag(s,1)||(this.reducePos=n)),this.pushState(s,i),this.shiftContext(e,i),e<=r.maxNode&&this.buffer.push(e,i,n,4)}}apply(t,e,i,n){65536&t?this.reduce(t):this.shift(t,e,i,n)}useNode(t,e){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=t)&&(this.p.reused.push(t),i++);let n=this.pos;this.reducePos=this.pos=n+t.length,this.pushState(e,n),this.buffer.push(i,n,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,e=t.buffer.length;for(;e>0&&t.buffer[e-2]>t.reducePos;)e-=4;let i=t.buffer.slice(e),n=t.bufferBase+e;for(;t&&n==t.bufferBase;)t=t.parent;return new Wh(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,n,this.curContext,this.lookAhead,t)}recoverByDelete(t,e){let i=t<=this.p.parser.maxNode;i&&this.storeNode(t,this.pos,e,4),this.storeNode(0,this.pos,e,i?8:4),this.pos=this.reducePos=e,this.score-=190}canShift(t){for(let e=new jh(this);;){let i=this.p.parser.stateSlot(e.state,4)||this.p.parser.hasAction(e.state,t);if(0==i)return!1;if(!(65536&i))return!0;e.reduce(i)}}recoverByInsert(t){if(this.stack.length>=300)return[];let e=this.p.parser.nextStates(this.state);if(e.length>8||this.stack.length>=120){let i=[];for(let n,s=0;s1&e&&t==n))||i.push(e[t],n)}e=i}let i=[];for(let t=0;t>19,n=65535&e,s=this.stack.length-3*i;if(s<0||t.getGoto(this.stack[s],n,!1)<0){let t=this.findForcedReduction();if(null==t)return!1;e=t}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}findForcedReduction(){let{parser:t}=this.p,e=[],i=(n,s)=>{if(!e.includes(n))return e.push(n),t.allActions(n,(e=>{if(393216&e);else if(65536&e){let i=(e>>19)-s;if(i>1){let n=65535&e,s=this.stack.length-3*i;if(s>=0&&t.getGoto(this.stack[s],n,!1)>=0)return i<<19|65536|n}}else{let t=i(e,s+1);if(null!=t)return t}}))};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:t}=this.p;return 65535==t.data[t.stateSlot(this.state,1)]&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let e=0;ethis.lookAhead&&(this.emitLookAhead(),this.lookAhead=t)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Vh{constructor(t,e){this.tracker=t,this.context=e,this.hash=t.strict?t.hash(e):0}}class jh{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let e=65535&t,i=t>>19;0==i?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(i-1);let n=this.start.p.parser.getGoto(this.stack[this.base-3],e,!0);this.state=n}}class qh{constructor(t,e,i){this.stack=t,this.pos=e,this.index=i,this.buffer=t.buffer,0==this.index&&this.maybeNext()}static create(t,e=t.bufferBase+t.buffer.length){return new qh(t,e,e-t.bufferBase)}maybeNext(){let t=this.stack.parent;null!=t&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new qh(this.stack,this.pos,this.index)}}function _h(t,e=Uint16Array){if("string"!=typeof t)return t;let i=null;for(let n=0,s=0;n=92&&e--,e>=34&&e--;let s=e-32;if(s>=46&&(s-=46,i=!0),r+=s,i)break;r*=46}i?i[s++]=r:i=new e(r)}return i}class Eh{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Mh=new Eh;class Dh{constructor(t,e){this.input=t,this.ranges=e,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Mh,this.rangeIndex=0,this.pos=this.chunkPos=e[0].from,this.range=e[0],this.end=e[e.length-1].to,this.readNext()}resolveOffset(t,e){let i=this.range,n=this.rangeIndex,s=this.pos+t;for(;si.to:s>=i.to;){if(n==this.ranges.length-1)return null;let t=this.ranges[++n];s+=t.from-i.to,i=t}return s}clipPos(t){if(t>=this.range.from&&tt)return Math.max(t,e.from);return this.end}peek(t){let e,i,n=this.chunkOff+t;if(n>=0&&n=this.chunk2Pos&&en.to&&(this.chunk2=this.chunk2.slice(0,n.to-e)),i=this.chunk2.charCodeAt(0)}}return e>=this.token.lookAhead&&(this.token.lookAhead=e+1),i}acceptToken(t,e=0){let i=e?this.resolveOffset(e,-1):this.pos;if(null==i||i=this.chunk2Pos&&this.posthis.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,e){if(e?(this.token=e,e.start=t,e.lookAhead=t+1,e.value=e.extended=-1):this.token=Mh,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t=this.chunkPos&&e<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,e-this.chunkPos);if(t>=this.chunk2Pos&&e<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,e-this.chunk2Pos);if(t>=this.range.from&&e<=this.range.to)return this.input.read(t,e);let i="";for(let n of this.ranges){if(n.from>=e)break;n.to>t&&(i+=this.input.read(Math.max(n.from,t),Math.min(n.to,e)))}return i}}class zh{constructor(t,e){this.data=t,this.id=e}token(t,e){let{parser:i}=e.p;Bh(this.data,t,e,this.id,i.data,i.tokenPrecTable)}}zh.prototype.contextual=zh.prototype.fallback=zh.prototype.extend=!1;class Gh{constructor(t,e,i){this.precTable=e,this.elseToken=i,this.data="string"==typeof t?_h(t):t}token(t,e){let i=t.pos,n=0;for(;;){let i=t.next<0,s=t.resolveOffset(1,1);if(Bh(this.data,t,e,0,this.data,this.precTable),t.token.value>-1)break;if(null==this.elseToken)return;if(i||n++,null==s)break;t.reset(s,t.token)}n&&(t.reset(i,t.token),t.acceptToken(this.elseToken,n))}}Gh.prototype.contextual=zh.prototype.fallback=zh.prototype.extend=!1;class Ih{constructor(t,e={}){this.token=t,this.contextual=!!e.contextual,this.fallback=!!e.fallback,this.extend=!!e.extend}}function Bh(t,e,i,n,s,r){let o=0,a=1<0){let i=t[n];if(l.allows(i)&&(-1==e.token.value||e.token.value==i||Uh(i,e.token.value,s,r))){e.acceptToken(i);break}}let n=e.next,h=0,c=t[o+2];if(!(e.next<0&&c>h&&65535==t[i+3*c-3]&&65535==t[i+3*c-3])){for(;h>1,r=i+s+(s<<1),a=t[r],l=t[r+1]||65536;if(n=l)){o=t[r+2],e.advance();continue t}h=s+1}}break}o=t[i+3*c-1]}}function Nh(t,e,i){for(let n,s=e;65535!=(n=t[s]);s++)if(n==i)return s-e;return-1}function Uh(t,e,i,n){let s=Nh(i,n,e);return s<0||Nh(i,n,t)e)&&!n.type.isError)return i<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(t.length,Math.max(n.from+1,e+25));if(i<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return i<0?0:t.length}}class Jh{constructor(t,e){this.fragments=t,this.nodeSet=e,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?Hh(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?Hh(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(tt)return this.nextStart=o,null;if(r instanceof O){if(o==t){if(o=Math.max(this.safeFrom,t)&&(this.trees.push(r),this.start.push(o),this.index.push(0))}else this.index[e]++,this.nextStart=o+r.length}}}class Kh{constructor(t,e){this.stream=e,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map((t=>new Eh))}getActions(t){let e=0,i=null,{parser:n}=t.p,{tokenizers:s}=n,r=n.stateSlot(t.state,3),o=t.curContext?t.curContext.hash:0,a=0;for(let n=0;nh.end+25&&(a=Math.max(h.lookAhead,a)),0!=h.value)){let n=e;if(h.extended>-1&&(e=this.addActions(t,h.extended,h.end,e)),e=this.addActions(t,h.value,h.end,e),!l.extend&&(i=h,e>n))break}}for(;this.actions.length>e;)this.actions.pop();return a&&t.setLookAhead(a),i||t.pos!=this.stream.end||(i=new Eh,i.value=t.p.parser.eofTerm,i.start=i.end=t.pos,e=this.addActions(t,i.value,i.end,e)),this.mainToken=i,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let e=new Eh,{pos:i,p:n}=t;return e.start=i,e.end=Math.min(i+1,n.stream.end),e.value=i==n.stream.end?n.parser.eofTerm:0,e}updateCachedToken(t,e,i){let n=this.stream.clipPos(i.pos);if(e.token(this.stream.reset(n,t),i),t.value>-1){let{parser:e}=i.p;for(let n=0;n=0&&i.p.parser.dialect.allows(s>>1)){1&s?t.extended=s>>1:t.value=s>>1;break}}}else t.value=0,t.end=this.stream.clipPos(n+1)}putAction(t,e,i,n){for(let e=0;e4*t.bufferLength?new Jh(i,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t,e,i=this.stacks,n=this.minStackPos,s=this.stacks=[];if(this.bigReductionCount>300&&1==i.length){let[t]=i;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let r=0;rn)s.push(o);else{if(this.advanceStack(o,s,i))continue;{t||(t=[],e=[]),t.push(o);let i=this.tokens.getMainToken(o);e.push(i.value,i.end)}}break}}if(!s.length){let e=t&&function(t){let e=null;for(let i of t){let t=i.p.stoppedAt;(i.pos==i.p.stream.end||null!=t&&i.pos>t)&&i.p.parser.stateFlag(i.state,2)&&(!e||e.scorethis.stoppedAt?t[0]:this.runRecovery(t,e,s);if(i)return Lh&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let t=1==this.recovering?1:3*this.recovering;if(s.length>t)for(s.sort(((t,e)=>e.score-t.score));s.length>t;)s.pop();s.some((t=>t.reducePos>n))&&this.recovering--}else if(s.length>1){t:for(let t=0;t500&&n.buffer.length>500){if(!((e.score-n.score||e.buffer.length-n.buffer.length)>0)){s.splice(t--,1);continue t}s.splice(i--,1)}}}s.length>12&&s.splice(12,s.length-12)}this.minStackPos=s[0].pos;for(let t=1;t ":"";if(null!=this.stoppedAt&&s>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let e=t.curContext&&t.curContext.tracker.strict,i=e?t.curContext.hash:0;for(let a=this.fragments.nodeAt(s);a;){let s=this.parser.nodeSet.types[a.type.id]==a.type?r.getGoto(t.state,a.type.id):-1;if(s>-1&&a.length&&(!e||(a.prop(n.contextHash)||0)==i))return t.useNode(a,s),Lh&&console.log(o+this.stackID(t)+` (via reuse of ${r.getName(a.type.id)})`),!0;if(!(a instanceof O)||0==a.children.length||a.positions[0]>0)break;let l=a.children[0];if(!(l instanceof O&&0==a.positions[0]))break;a=l}}let a=r.stateSlot(t.state,4);if(a>0)return t.reduce(a),Lh&&console.log(o+this.stackID(t)+` (via always-reduce ${r.getName(65535&a)})`),!0;if(t.stack.length>=9e3)for(;t.stack.length>6e3&&t.forceReduce(););let l=this.tokens.getActions(t);for(let n=0;ns?e.push(u):i.push(u)}return!1}advanceFully(t,e){let i=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>i)return ec(t,e),!0}}runRecovery(t,e,i){let n=null,s=!1;for(let r=0;r ":"";if(o.deadEnd){if(s)continue;if(s=!0,o.restart(),Lh&&console.log(h+this.stackID(o)+" (restarted)"),this.advanceFully(o,i))continue}let c=o.split(),O=h;for(let t=0;c.forceReduce()&&t<10;t++){if(Lh&&console.log(O+this.stackID(c)+" (via force-reduce)"),this.advanceFully(c,i))break;Lh&&(O=this.stackID(c)+" -> ")}for(let t of o.recoverByInsert(a))Lh&&console.log(h+this.stackID(t)+" (via recover-insert)"),this.advanceFully(t,i);this.stream.end>o.pos?(l==o.pos&&(l++,a=0),o.recoverByDelete(a,l),Lh&&console.log(h+this.stackID(o)+` (via recover-delete ${this.parser.getName(a)})`),ec(o,i)):(!n||n.scoret;class sc{constructor(t){this.start=t.start,this.shift=t.shift||nc,this.reduce=t.reduce||nc,this.reuse=t.reuse||nc,this.hash=t.hash||(()=>0),this.strict=!1!==t.strict}}class rc extends C{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let i=e.nodeNames.split(" ");this.minRepeatTerm=i.length;for(let t=0;te.topRules[t][1])),r=[];for(let t=0;t=0)l(n,e,t[i++]);else{let s=t[i+-n];for(let r=-n;r>0;r--)l(t[i++],e,s);i++}}}this.nodeSet=new a(i.map(((t,i)=>o.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:s.indexOf(i)>-1,error:0==i,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1})))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=t;let h=_h(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let t=0;t"number"==typeof t?new zh(h,t):t)),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,e,i){let n=new tc(this,t,e,i);for(let s of this.wrappers)n=s(n,t,e,i);return n}getGoto(t,e,i=!1){let n=this.goto;if(e>=n[0])return-1;for(let s=n[e+1];;){let e=n[s++],r=1&e,o=n[s++];if(r&&i)return o;for(let i=s+(e>>1);s0}validAction(t,e){return!!this.allActions(t,(t=>t==e||null))}allActions(t,e){let i=this.stateSlot(t,4),n=i?e(i):void 0;for(let i=this.stateSlot(t,1);null==n;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])break;i=oc(this.data,i+2)}n=e(oc(this.data,i+1))}return n}nextStates(t){let e=[];for(let i=this.stateSlot(t,1);;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])break;i=oc(this.data,i+2)}if(!(1&this.data[i+2])){let t=this.data[i+1];e.some(((e,i)=>1&i&&e==t))||e.push(this.data[i],t)}}return e}configure(t){let e=Object.assign(Object.create(rc.prototype),this);if(t.props&&(e.nodeSet=this.nodeSet.extend(...t.props)),t.top){let i=this.topRules[t.top];if(!i)throw new RangeError(`Invalid top rule name ${t.top}`);e.top=i}return t.tokenizers&&(e.tokenizers=this.tokenizers.map((e=>{let i=t.tokenizers.find((t=>t.from==e));return i?i.to:e}))),t.specializers&&(e.specializers=this.specializers.slice(),e.specializerSpecs=this.specializerSpecs.map(((i,n)=>{let s=t.specializers.find((t=>t.from==i.external));if(!s)return i;let r=Object.assign(Object.assign({},i),{external:s.to});return e.specializers[n]=ac(r),r}))),t.contextTracker&&(e.context=t.contextTracker),t.dialect&&(e.dialect=this.parseDialect(t.dialect)),null!=t.strict&&(e.strict=t.strict),t.wrap&&(e.wrappers=e.wrappers.concat(t.wrap)),null!=t.bufferLength&&(e.bufferLength=t.bufferLength),e}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let e=this.dynamicPrecedences;return null==e?0:e[t]||0}parseDialect(t){let e=Object.keys(this.dialects),i=e.map((()=>!1));if(t)for(let n of t.split(" ")){let t=e.indexOf(n);t>=0&&(i[t]=!0)}let n=null;for(let t=0;tt.external(i,n)<<1|e}return t.get}const lc=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288];function hc(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function cc(t){return t>=48&&t<=57}const Oc=new Ih(((t,e)=>{for(let i=!1,n=0,s=0;;s++){let{next:r}=t;if(hc(r)||45==r||95==r||i&&cc(r))!i&&(45!=r||s>0)&&(i=!0),n===s&&45==r&&n++,t.advance();else{if(92!=r||10==t.peek(1)){i&&t.acceptToken(40==r?100:2==n&&e.canShift(2)?2:101);break}t.advance(),t.next>-1&&t.advance(),i=!0}}})),uc=new Ih((t=>{if(lc.includes(t.peek(-1))){let{next:e}=t;(hc(e)||95==e||35==e||46==e||91==e||58==e&&hc(t.peek(1))||45==e||38==e)&&t.acceptToken(99)}})),fc=new Ih((t=>{if(!lc.includes(t.peek(-1))){let{next:e}=t;if(37==e&&(t.advance(),t.acceptToken(1)),hc(e)){do{t.advance()}while(hc(t.next)||cc(t.next));t.acceptToken(1)}}})),dc=Oa({"AtKeyword import charset namespace keyframes media supports":Ya.definitionKeyword,"from to selector":Ya.keyword,NamespaceName:Ya.namespace,KeyframeName:Ya.labelName,KeyframeRangeName:Ya.operatorKeyword,TagName:Ya.tagName,ClassName:Ya.className,PseudoClassName:Ya.constant(Ya.className),IdName:Ya.labelName,"FeatureName PropertyName":Ya.propertyName,AttributeName:Ya.attributeName,NumberLiteral:Ya.number,KeywordQuery:Ya.keyword,UnaryQueryOp:Ya.operatorKeyword,"CallTag ValueName":Ya.atom,VariableName:Ya.variableName,Callee:Ya.operatorKeyword,Unit:Ya.unit,"UniversalSelector NestingSelector":Ya.definitionOperator,MatchOp:Ya.compareOperator,"ChildOp SiblingOp, LogicOp":Ya.logicOperator,BinOp:Ya.arithmeticOperator,Important:Ya.modifier,Comment:Ya.blockComment,ColorLiteral:Ya.color,"ParenthesizedContent StringLiteral":Ya.string,":":Ya.punctuation,"PseudoOp #":Ya.derefOperator,"; ,":Ya.separator,"( )":Ya.paren,"[ ]":Ya.squareBracket,"{ }":Ya.brace}),pc={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},mc={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168},gc={__proto__:null,not:132,only:132},wc=rc.deserialize({version:14,states:":^QYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OO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g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[uc,fc,Oc,1,2,3,4,new Gh("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:t=>pc[t]||-1},{term:58,get:t=>mc[t]||-1},{term:101,get:t=>gc[t]||-1}],tokenPrec:1200});let bc=null;function Sc(){if(!bc&&"object"==typeof document&&document.body){let{style:t}=document.body,e=[],i=new Set;for(let n in t)"cssText"!=n&&"cssFloat"!=n&&"string"==typeof t[n]&&(/[A-Z]/.test(n)&&(n=n.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))),i.has(n)||(e.push(n),i.add(n)));bc=e.sort().map((t=>({type:"property",label:t})))}return bc||[]}const yc=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map((t=>({type:"class",label:t}))),Qc=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map((t=>({type:"keyword",label:t}))).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map((t=>({type:"constant",label:t})))),vc=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map((t=>({type:"type",label:t}))),xc=/^(\w[\w-]*|-\w[\w-]*|)$/,kc=/^-(-[\w-]*)?$/;const $c=new T,Pc=["Declaration"];function Zc(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function Tc(t,e,i){if(e.to-e.from>4096){let n=$c.get(e);if(n)return n;let s=[],r=new Set,o=e.cursor(c.IncludeAnonymous);if(o.firstChild())do{for(let e of Tc(t,o.node,i))r.has(e.label)||(r.add(e.label),s.push(e))}while(o.nextSibling());return $c.set(e,s),s}{let n=[],s=new Set;return e.cursor().iterate((e=>{var r;if(i(e)&&e.matchContext(Pc)&&":"==(null===(r=e.node.nextSibling)||void 0===r?void 0:r.name)){let i=t.sliceString(e.from,e.to);s.has(i)||(s.add(i),n.push({label:i,type:"variable"}))}})),n}}const Xc=t=>e=>{let{state:i,pos:n}=e,s=Ea(i).resolveInner(n,-1),r=s.type.isError&&s.from==s.to-1&&"-"==i.doc.sliceString(s.from,s.to);if("PropertyName"==s.name||(r||"TagName"==s.name)&&/^(Block|Styles)$/.test(s.resolve(s.to).name))return{from:s.from,options:Sc(),validFor:xc};if("ValueName"==s.name)return{from:s.from,options:Qc,validFor:xc};if("PseudoClassName"==s.name)return{from:s.from,options:yc,validFor:xc};if(t(s)||(e.explicit||r)&&function(t,e){var i;if(("("==t.name||t.type.isError)&&(t=t.parent||t),"ArgList"!=t.name)return!1;let n=null===(i=t.parent)||void 0===i?void 0:i.firstChild;return"Callee"==(null==n?void 0:n.name)&&"var"==e.sliceString(n.from,n.to)}(s,i.doc))return{from:t(s)||r?s.from:n,options:Tc(i.doc,Zc(s),t),validFor:kc};if("TagName"==s.name){for(let{parent:t}=s;t;t=t.parent)if("Block"==t.name)return{from:s.from,options:Sc(),validFor:xc};return{from:s.from,options:vc,validFor:xc}}if(!e.explicit)return null;let o=s.resolve(n),a=o.childBefore(n);return a&&":"==a.name&&"PseudoClassSelector"==o.name?{from:n,options:yc,validFor:xc}:a&&":"==a.name&&"Declaration"==o.name||"ArgList"==o.name?{from:n,options:Qc,validFor:xc}:"Block"==o.name||"Styles"==o.name?{from:n,options:Sc(),validFor:xc}:null},Cc=Xc((t=>"VariableName"==t.name)),Yc=_a.define({name:"css",parser:wc.configure({props:[rl.add({Declaration:dl()}),gl.add({"Block KeyframeList":wl})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Ac(){return new Ha(Yc,Yc.data.of({autocomplete:Cc}))}class Rc{constructor(t,e,i){this.state=t,this.pos=e,this.explicit=i,this.abortListeners=[]}tokenBefore(t){let e=Ea(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),i=Math.max(e.from,this.pos-250),n=e.text.slice(i-e.from,this.pos-e.from),s=n.search(Ec(t,!1));return s<0?null:{from:i+s,to:this.pos,text:n.slice(s)}}get aborted(){return null==this.abortListeners}addEventListener(t,e){"abort"==t&&this.abortListeners&&this.abortListeners.push(e)}}function Wc(t){let e=Object.keys(t).join(""),i=/\w/.test(e);return i&&(e=e.replace(/\w/g,"")),`[${i?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Vc(t){let e=t.map((t=>"string"==typeof t?{label:t}:t)),[i,n]=e.every((t=>/^\w+$/.test(t.label)))?[/\w*$/,/\w+$/]:function(t){let e=Object.create(null),i=Object.create(null);for(let{label:n}of t){e[n[0]]=!0;for(let t=1;t{let s=t.matchBefore(n);return s||t.explicit?{from:s?s.from:t.pos,options:e,validFor:i}:null}}function jc(t,e){return i=>{for(let e=Ea(i.state).resolveInner(i.pos,-1);e;e=e.parent){if(t.indexOf(e.name)>-1)return null;if(e.type.isTop)break}return e(i)}}class qc{constructor(t,e,i,n){this.completion=t,this.source=e,this.match=i,this.score=n}}function _c(t){return t.selection.main.from}function Ec(t,e){var i;let{source:n}=t,s=e&&"^"!=n[0],r="$"!=n[n.length-1];return s||r?new RegExp(`${s?"^":""}(?:${n})${r?"$":""}`,null!==(i=t.flags)&&void 0!==i?i:t.ignoreCase?"i":""):t}const Mc=ie.define();const Dc=new WeakMap;function zc(t){if(!Array.isArray(t))return t;let e=Dc.get(t);return e||Dc.set(t,e=Vc(t)),e}const Gc=re.define(),Ic=re.define();class Bc{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let e=0;e=48&&l<=57||l>=97&&l<=122?2:l>=65&&l<=90?1:0:(w=ft(l))!=w.toLowerCase()?1:w!=w.toUpperCase()?2:0;(!n||1==b&&p||0==g&&0!=b)&&(e[c]==l||i[c]==l&&(O=!0)?r[c++]=n:r.length&&(m=!1)),g=b,n+=dt(l)}return c==a&&0==r[0]&&m?this.result((O?-200:0)-100,r,t):u==a&&0==f?this.ret(-200-t.length+(d==t.length?0:-100),[0,d]):o>-1?this.ret(-700-t.length,[o,o+this.pattern.length]):u==a?this.ret(-900-t.length,[f,d]):c==a?this.result((O?-200:0)-100-700+(m?0:-1100),r,t):2!=e.length&&this.result((n[0]?-700:0)-200-1100,n,t)}result(t,e,i){let n=[],s=0;for(let t of e){let e=t+(this.astral?dt(ut(i,t)):1);s&&n[s-1]==t?n[s-1]=e:(n[s++]=t,n[s++]=e)}return this.ret(t-i.length,n)}}const Nc=Tt.define({combine:t=>we(t,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Lc,compareCompletions:(t,e)=>t.label.localeCompare(e.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,e)=>t&&e,closeOnBlur:(t,e)=>t&&e,icons:(t,e)=>t&&e,tooltipClass:(t,e)=>i=>Uc(t(i),e(i)),optionClass:(t,e)=>i=>Uc(t(i),e(i)),addToOptions:(t,e)=>t.concat(e)})});function Uc(t,e){return t?e?t+" "+e:t:e}function Lc(t,e,i,n,s,r){let o,a,l=t.textDirection==sn.RTL,h=l,c=!1,O="top",u=e.left-s.left,f=s.right-e.right,d=n.right-n.left,p=n.bottom-n.top;if(h&&u=p||t>e.top?o=i.bottom-e.top:(O="bottom",o=e.bottom-i.top)}return{style:`${O}: ${o/((e.bottom-e.top)/r.offsetHeight)}px; max-width: ${a/((e.right-e.left)/r.offsetWidth)}px`,class:"cm-completionInfo-"+(c?l?"left-narrow":"right-narrow":h?"left":"right")}}function Fc(t,e,i){if(t<=i)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let t=Math.floor(e/i);return{from:t*i,to:(t+1)*i}}let n=Math.floor((t-e)/i);return{from:t-(n+1)*i,to:t-n*i}}class Hc{constructor(t,e,i){this.view=t,this.stateField=e,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:t=>this.placeInfo(t),key:this},this.space=null,this.currentClass="";let n=t.state.field(e),{options:s,selected:r}=n.open,o=t.state.facet(Nc);this.optionContent=function(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(t){let e=document.createElement("div");return e.classList.add("cm-completionIcon"),t.type&&e.classList.add(...t.type.split(/\s+/g).map((t=>"cm-completionIcon-"+t))),e.setAttribute("aria-hidden","true"),e},position:20}),e.push({render(t,e,i){let n=document.createElement("span");n.className="cm-completionLabel";let s=t.displayLabel||t.label,r=0;for(let t=0;tr&&n.appendChild(document.createTextNode(s.slice(r,e)));let a=n.appendChild(document.createElement("span"));a.appendChild(document.createTextNode(s.slice(e,o))),a.className="cm-completionMatchedText",r=o}return rt.position-e.position)).map((t=>t.render))}(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=Fc(s.length,r,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",(i=>{let{options:n}=t.state.field(e).open;for(let e,s=i.target;s&&s!=this.dom;s=s.parentNode)if("LI"==s.nodeName&&(e=/-(\d+)$/.exec(s.id))&&+e[1]{let i=t.state.field(this.stateField,!1);i&&i.tooltip&&t.state.facet(Nc).closeOnBlur&&e.relatedTarget!=t.contentDOM&&t.dispatch({effects:Ic.of(null)})})),this.showOptions(s,n.id)}mount(){this.updateSel()}showOptions(t,e){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,e,this.range)),this.list.addEventListener("scroll",(()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)}))}update(t){var e;let i=t.state.field(this.stateField),n=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=n){let{options:s,selected:r,disabled:o}=i.open;n.open&&n.open.options==s||(this.range=Fc(s.length,r,t.state.facet(Nc).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),o!=(null===(e=n.open)||void 0===e?void 0:e.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}updateTooltipClass(t){let e=this.tooltipClass(t);if(e!=this.currentClass){for(let t of this.currentClass.split(" "))t&&this.dom.classList.remove(t);for(let t of e.split(" "))t&&this.dom.classList.add(t);this.currentClass=e}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),e=t.open;if((e.selected>-1&&e.selected=this.range.to)&&(this.range=Fc(e.options.length,e.selected,this.view.state.facet(Nc).maxRenderedOptions),this.showOptions(e.options,t.id)),this.updateSelectedOption(e.selected)){this.destroyInfo();let{completion:i}=e.options[e.selected],{info:n}=i;if(!n)return;let s="string"==typeof n?document.createTextNode(n):n(i);if(!s)return;"then"in s?s.then((e=>{e&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(e,i)})).catch((t=>Rn(this.view.state,t,"completion info"))):this.addInfoPane(s,i)}}addInfoPane(t,e){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",null!=t.nodeType)i.appendChild(t),this.infoDestroy=null;else{let{dom:e,destroy:n}=t;i.appendChild(e),this.infoDestroy=n||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let e=null;for(let i=this.list.firstChild,n=this.range.from;i;i=i.nextSibling,n++)"LI"==i.nodeName&&i.id?n==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),e=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected"):n--;return e&&function(t,e){let i=t.getBoundingClientRect(),n=e.getBoundingClientRect(),s=i.height/t.offsetHeight;n.topi.bottom&&(t.scrollTop+=(n.bottom-i.bottom)/s)}(this.list,e),e}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let e=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),n=t.getBoundingClientRect(),s=this.space;if(!s){let t=this.dom.ownerDocument.defaultView||window;s={left:0,top:0,right:t.innerWidth,bottom:t.innerHeight}}return n.top>Math.min(s.bottom,e.bottom)-10||n.bottomi.from||0==i.from))if(s=t,"string"!=typeof l&&l.header)n.appendChild(l.header(l));else{n.appendChild(document.createElement("completion-section")).textContent=t}}const h=n.appendChild(document.createElement("li"));h.id=e+"-"+r,h.setAttribute("role","option");let c=this.optionClass(o);c&&(h.className=c);for(let t of this.optionContent){let e=t(o,this.view.state,a);e&&h.appendChild(e)}}return i.from&&n.classList.add("cm-completionListIncompleteTop"),i.tonew Hc(i,t,e)}function Kc(t){return 100*(t.boost||0)+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}class tO{constructor(t,e,i,n,s,r){this.options=t,this.attrs=e,this.tooltip=i,this.timestamp=n,this.selected=s,this.disabled=r}setSelected(t,e){return t==this.selected||t>=this.options.length?this:new tO(this.options,nO(e,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,e,i,n,s){let r=function(t,e){let i=[],n=null,s=t=>{i.push(t);let{section:e}=t.completion;if(e){n||(n=[]);let t="string"==typeof e?e:e.name;n.some((e=>e.name==t))||n.push("string"==typeof e?{name:t}:e)}};for(let n of t)if(n.hasResult()){let t=n.result.getMatch;if(!1===n.result.filter)for(let e of n.result.options)s(new qc(e,n.source,t?t(e):[],1e9-i.length));else{let i=new Bc(e.sliceDoc(n.from,n.to));for(let e of n.result.options)if(i.match(e.label)){let r=e.displayLabel?t?t(e,i.matched):[]:i.matched;s(new qc(e,n.source,r,i.score+(e.boost||0)))}}}if(n){let t=Object.create(null),e=0,s=(t,e)=>{var i,n;return(null!==(i=t.rank)&&void 0!==i?i:1e9)-(null!==(n=e.rank)&&void 0!==n?n:1e9)||(t.namee.score-t.score||a(t.completion,e.completion)))){let e=t.completion;!o||o.label!=e.label||o.detail!=e.detail||null!=o.type&&null!=e.type&&o.type!=e.type||o.apply!=e.apply||o.boost!=e.boost?r.push(t):Kc(t.completion)>Kc(o)&&(r[r.length-1]=t),o=t.completion}return r}(t,e);if(!r.length)return n&&t.some((t=>1==t.state))?new tO(n.options,n.attrs,n.tooltip,n.timestamp,n.selected,!0):null;let o=e.facet(Nc).selectOnOpen?0:-1;if(n&&n.selected!=o&&-1!=n.selected){let t=n.options[n.selected].completion;for(let e=0;ee.hasResult()?Math.min(t,e.from):t),1e8),create:uO,above:s.aboveCursor},n?n.timestamp:Date.now(),o,!1)}map(t){return new tO(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class eO{constructor(t,e,i){this.active=t,this.id=e,this.open=i}static start(){return new eO(sO,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(t){let{state:e}=t,i=e.facet(Nc),n=(i.override||e.languageDataAt("autocomplete",_c(e)).map(zc)).map((e=>(this.active.find((t=>t.source==e))||new oO(e,this.active.some((t=>0!=t.state))?1:0)).update(t,i)));n.length==this.active.length&&n.every(((t,e)=>t==this.active[e]))&&(n=this.active);let s=this.open;s&&t.docChanged&&(s=s.map(t.changes)),t.selection||n.some((e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to)))||!function(t,e){if(t==e)return!0;for(let i=0,n=0;;){for(;i1==t.state))&&(s=null),!s&&n.every((t=>1!=t.state))&&n.some((t=>t.hasResult()))&&(n=n.map((t=>t.hasResult()?new oO(t.source,0):t)));for(let e of t.effects)e.is(hO)&&(s=s&&s.setSelected(e.value,this.id));return n==this.active&&s==this.open?this:new eO(n,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:iO}}const iO={"aria-autocomplete":"list"};function nO(t,e){let i={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(i["aria-activedescendant"]=t+"-"+e),i}const sO=[];function rO(t){return t.isUserEvent("input.type")?"input":t.isUserEvent("delete.backward")?"delete":null}class oO{constructor(t,e,i=-1){this.source=t,this.state=e,this.explicitPos=i}hasResult(){return!1}update(t,e){let i=rO(t),n=this;i?n=n.handleUserEvent(t,i,e):t.docChanged?n=n.handleChange(t):t.selection&&0!=n.state&&(n=new oO(n.source,0));for(let e of t.effects)if(e.is(Gc))n=new oO(n.source,1,e.value?_c(t.state):-1);else if(e.is(Ic))n=new oO(n.source,0);else if(e.is(lO))for(let t of e.value)t.source==n.source&&(n=t);return n}handleUserEvent(t,e,i){return"delete"!=e&&i.activateOnTyping?new oO(this.source,1):this.map(t.changes)}handleChange(t){return t.changes.touchesRange(_c(t.startState))?new oO(this.source,0):this.map(t.changes)}map(t){return t.empty||this.explicitPos<0?this:new oO(this.source,this.state,t.mapPos(this.explicitPos))}}class aO extends oO{constructor(t,e,i,n,s){super(t,2,e),this.result=i,this.from=n,this.to=s}hasResult(){return!0}handleUserEvent(t,e,i){var n;let s=t.changes.mapPos(this.from),r=t.changes.mapPos(this.to,1),o=_c(t.state);if((this.explicitPos<0?o<=s:or||"delete"==e&&_c(t.startState)==this.from)return new oO(this.source,"input"==e&&i.activateOnTyping?1:0);let a,l=this.explicitPos<0?-1:t.changes.mapPos(this.explicitPos);return function(t,e,i,n){if(!t)return!1;let s=e.sliceDoc(i,n);return"function"==typeof t?t(s,i,n,e):Ec(t,!0).test(s)}(this.result.validFor,t.state,s,r)?new aO(this.source,l,this.result,s,r):this.result.update&&(a=this.result.update(this.result,s,r,new Rc(t.state,o,l>=0)))?new aO(this.source,l,a,a.from,null!==(n=a.to)&&void 0!==n?n:_c(t.state)):new oO(this.source,1,l)}handleChange(t){return t.changes.touchesRange(this.from,this.to)?new oO(this.source,0):this.map(t.changes)}map(t){return t.empty?this:new aO(this.source,this.explicitPos<0?-1:t.mapPos(this.explicitPos),this.result,t.mapPos(this.from),t.mapPos(this.to,1))}}const lO=re.define({map:(t,e)=>t.map((t=>t.map(e)))}),hO=re.define(),cO=Vt.define({create:()=>eO.start(),update:(t,e)=>t.update(e),provide:t=>[Ao.from(t,(t=>t.tooltip)),Wr.contentAttributes.from(t,(t=>t.attrs))]});function OO(t,e){const i=e.completion.apply||e.completion.label;let n=t.state.field(cO).active.find((t=>t.source==e.source));return n instanceof aO&&("string"==typeof i?t.dispatch(Object.assign(Object.assign({},function(t,e,i,n){let{main:s}=t.selection,r=i-s.from,o=n-s.from;return Object.assign(Object.assign({},t.changeByRange((a=>a!=s&&i!=n&&t.sliceDoc(a.from+r,a.from+o)!=t.sliceDoc(i,n)?{range:a}:{changes:{from:a.from+r,to:n==s.from?a.to:a.from+o,insert:e},range:$t.cursor(a.from+r+e.length)}))),{scrollIntoView:!0,userEvent:"input.complete"})}(t.state,i,n.from,n.to)),{annotations:Mc.of(e.completion)})):i(t,e.completion,n.from,n.to),!0)}const uO=Jc(cO,OO);function fO(t,e="option"){return i=>{let n=i.state.field(cO,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp-1?n.open.selected+r*(t?1:-1):t?0:o-1;return a<0?a="page"==e?0:o-1:a>=o&&(a="page"==e?o-1:0),i.dispatch({effects:hO.of(a)}),!0}}const dO=t=>{let e=t.state.field(cO,!1);return!(t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp!!t.state.field(cO,!1)&&(t.dispatch({effects:Gc.of(!0)}),!0),mO=t=>{let e=t.state.field(cO,!1);return!(!e||!e.active.some((t=>0!=t.state)))&&(t.dispatch({effects:Ic.of(null)}),!0)};class gO{constructor(t,e){this.active=t,this.context=e,this.time=Date.now(),this.updates=[],this.done=void 0}}const wO=qn.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of t.state.field(cO).active)1==e.state&&this.startQuery(e)}update(t){let e=t.state.field(cO);if(!t.selectionSet&&!t.docChanged&&t.startState.field(cO)==e)return;let i=t.transactions.some((t=>(t.selection||t.docChanged)&&!rO(t)));for(let e=0;e50&&Date.now()-n.time>1e3){for(let t of n.context.abortListeners)try{t()}catch(t){Rn(this.view.state,t)}n.context.abortListeners=null,this.running.splice(e--,1)}else n.updates.push(...t.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some((t=>1==t.state&&!this.running.some((e=>e.active.source==t.source))))?setTimeout((()=>this.startUpdate()),50):-1,0!=this.composing)for(let e of t.transactions)"input"==rO(e)?this.composing=2:2==this.composing&&e.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:t}=this.view,e=t.field(cO);for(let t of e.active)1!=t.state||this.running.some((e=>e.active.source==t.source))||this.startQuery(t)}startQuery(t){let{state:e}=this.view,i=_c(e),n=new Rc(e,i,t.explicitPos==i),s=new gO(t,n);this.running.push(s),Promise.resolve(t.source(n)).then((t=>{s.context.aborted||(s.done=t||null,this.scheduleAccept())}),(t=>{this.view.dispatch({effects:Ic.of(null)}),Rn(this.view.state,t)}))}scheduleAccept(){this.running.every((t=>void 0!==t.done))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((()=>this.accept()),this.view.state.facet(Nc).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],i=this.view.state.facet(Nc);for(let n=0;nt.source==s.active.source));if(r&&1==r.state)if(null==s.done){let t=new oO(s.active.source,0);for(let e of s.updates)t=t.update(e,i);1!=t.state&&e.push(t)}else this.startQuery(r)}e.length&&this.view.dispatch({effects:lO.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(cO,!1);if(e&&e.tooltip&&this.view.state.facet(Nc).closeOnBlur){let i=e.open&&Ro(this.view,e.open.tooltip);i&&i.dom.contains(t.relatedTarget)||this.view.dispatch({effects:Ic.of(null)})}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout((()=>this.view.dispatch({effects:Gc.of(!1)})),20),this.composing=0}}}),bO=Wr.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class SO{constructor(t,e,i,n){this.field=t,this.line=e,this.from=i,this.to=n}}class yO{constructor(t,e,i){this.field=t,this.from=e,this.to=i}map(t){let e=t.mapPos(this.from,-1,mt.TrackDel),i=t.mapPos(this.to,1,mt.TrackDel);return null==e||null==i?null:new yO(this.field,e,i)}}class QO{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(t,e){let i=[],n=[e],s=t.doc.lineAt(e),r=/^\s*/.exec(s.text)[0];for(let s of this.lines){if(i.length){let i=r,o=/^\t*/.exec(s)[0].length;for(let e=0;enew yO(t.field,n[t.line]+t.from,n[t.line]+t.to)));return{text:i,ranges:o}}static parse(t){let e,i=[],n=[],s=[];for(let r of t.split(/\r\n?|\n/)){for(;e=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(r);){let t=e[1]?+e[1]:null,o=e[2]||e[3]||"",a=-1;for(let e=0;e=a&&t.field++}s.push(new SO(a,n.length,e.index,e.index+o.length)),r=r.slice(0,e.index)+o+r.slice(e.index+e[0].length)}for(let t;t=/\\([{}])/.exec(r);){r=r.slice(0,t.index)+t[1]+r.slice(t.index+t[0].length);for(let e of s)e.line==n.length&&e.from>t.index&&(e.from--,e.to--)}n.push(r)}return new QO(n,s)}}let vO=Ui.widget({widget:new class extends Bi{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),xO=Ui.mark({class:"cm-snippetField"});class kO{constructor(t,e){this.ranges=t,this.active=e,this.deco=Ui.set(t.map((t=>(t.from==t.to?vO:xO).range(t.from,t.to))))}map(t){let e=[];for(let i of this.ranges){let n=i.map(t);if(!n)return null;e.push(n)}return new kO(e,this.active)}selectionInsideField(t){return t.ranges.every((t=>this.ranges.some((e=>e.field==this.active&&e.from<=t.from&&e.to>=t.to))))}}const $O=re.define({map:(t,e)=>t&&t.map(e)}),PO=re.define(),ZO=Vt.define({create:()=>null,update(t,e){for(let i of e.effects){if(i.is($O))return i.value;if(i.is(PO)&&t)return new kO(t.ranges,i.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>Wr.decorations.from(t,(t=>t?t.deco:Ui.none))});function TO(t,e){return $t.create(t.filter((t=>t.field==e)).map((t=>$t.range(t.from,t.to))))}function XO(t){let e=QO.parse(t);return(t,i,n,s)=>{let{text:r,ranges:o}=e.instantiate(t.state,n),a={changes:{from:n,to:s,insert:N.of(r)},scrollIntoView:!0,annotations:i?Mc.of(i):void 0};if(o.length&&(a.selection=TO(o,0)),o.length>1){let e=new kO(o,0),i=a.effects=[$O.of(e)];void 0===t.state.field(ZO,!1)&&i.push(re.appendConfig.of([ZO,RO,VO,bO]))}t.dispatch(t.state.update(a))}}function CO(t){return({state:e,dispatch:i})=>{let n=e.field(ZO,!1);if(!n||t<0&&0==n.active)return!1;let s=n.active+t,r=t>0&&!n.ranges.some((e=>e.field==s+t));return i(e.update({selection:TO(n.ranges,s),effects:$O.of(r?null:new kO(n.ranges,s)),scrollIntoView:!0})),!0}}const YO=[{key:"Tab",run:CO(1),shift:CO(-1)},{key:"Escape",run:({state:t,dispatch:e})=>!!t.field(ZO,!1)&&(e(t.update({effects:$O.of(null)})),!0)}],AO=Tt.define({combine:t=>t.length?t[0]:YO}),RO=Dt.highest(zr.compute([AO],(t=>t.facet(AO))));function WO(t,e){return Object.assign(Object.assign({},e),{apply:XO(t)})}const VO=Wr.domEventHandlers({mousedown(t,e){let i,n=e.state.field(ZO,!1);if(!n||null==(i=e.posAtCoords({x:t.clientX,y:t.clientY})))return!1;let s=n.ranges.find((t=>t.from<=i&&t.to>=i));return!(!s||s.field==n.active)&&(e.dispatch({selection:TO(n.ranges,s.field),effects:$O.of(n.ranges.some((t=>t.field>s.field))?new kO(n.ranges,s.field):null),scrollIntoView:!0}),!0)}});function jO(t,e){return new RegExp(e(t.source),t.unicode?"u":"")}const qO=Object.create(null);function _O(t,e,i,n,s){for(let r=t.iterLines(),o=0;!r.next().done;){let t,{value:a}=r;for(e.lastIndex=0;t=e.exec(a);)if(!n[t[0]]&&o+t.index!=s&&(i.push({type:"text",label:t[0]}),n[t[0]]=!0,i.length>=2e3))return;o+=a.length+1}}function EO(t,e,i,n,s){let r=t.length>=1e3,o=r&&e.get(t);if(o)return o;let a=[],l=Object.create(null);if(t.children){let r=0;for(let o of t.children){if(o.length>=1e3)for(let t of EO(o,e,i,n-r,s-r))l[t.label]||(l[t.label]=!0,a.push(t));else _O(o,i,a,l,s-r);r+=o.length+1}}else _O(t,i,a,l,s);return r&&a.length<2e3&&e.set(t,a),a}const MO=t=>{let e=t.state.languageDataAt("wordChars",t.pos).join(""),i=function(t){let e=t.replace(/[\]\-\\]/g,"\\$&");try{return new RegExp(`[\\p{Alphabetic}\\p{Number}_${e}]+`,"ug")}catch(t){return new RegExp(`[w${e}]`,"g")}}(e),n=t.matchBefore(jO(i,(t=>t+"$")));if(!n&&!t.explicit)return null;let s=n?n.from:t.pos,r=EO(t.state.doc,function(t){return qO[t]||(qO[t]=new WeakMap)}(e),i,5e4,s);return{from:s,options:r,validFor:jO(i,(t=>"^"+t))}},DO={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},zO=re.define({map(t,e){let i=e.mapPos(t,-1,mt.TrackAfter);return null==i?void 0:i}}),GO=new class extends be{};GO.startSide=1,GO.endSide=-1;const IO=Vt.define({create:()=>ve.empty,update(t,e){if(e.selection){let i=e.state.doc.lineAt(e.selection.main.head).from,n=e.startState.doc.lineAt(e.startState.selection.main.head).from;i!=e.changes.mapPos(n,-1)&&(t=ve.empty)}t=t.map(e.changes);for(let i of e.effects)i.is(zO)&&(t=t.update({add:[GO.range(i.value,i.value+1)]}));return t}});function BO(){return[HO,IO]}const NO="()[]{}<>";function UO(t){for(let e=0;e{if((FO?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let s=t.state.selection.main;if(n.length>2||2==n.length&&1==dt(ut(n,0))||e!=s.from||i!=s.to)return!1;let r=function(t,e){let i=LO(t,t.selection.main.head),n=i.brackets||DO.brackets;for(let s of n){let r=UO(ut(s,0));if(e==s)return r==s?nu(t,s,n.indexOf(s+s+s)>-1,i):eu(t,s,r,i.before||DO.before);if(e==r&&KO(t,t.selection.main.from))return iu(t,s,r)}return null}(t.state,n);return!!r&&(t.dispatch(r),!0)})),JO=[{key:"Backspace",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=LO(t,t.selection.main.head).brackets||DO.brackets,n=null,s=t.changeByRange((e=>{if(e.empty){let n=function(t,e){let i=t.sliceString(e-2,e);return dt(ut(i,0))==i.length?i:i.slice(1)}(t.doc,e.head);for(let s of i)if(s==n&&tu(t.doc,e.head)==UO(ut(s,0)))return{changes:{from:e.head-s.length,to:e.head+s.length},range:$t.cursor(e.head-s.length)}}return{range:n=e}}));return n||e(t.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!n}}];function KO(t,e){let i=!1;return t.field(IO).between(0,t.doc.length,(t=>{t==e&&(i=!0)})),i}function tu(t,e){let i=t.sliceString(e,e+2);return i.slice(0,dt(ut(i,0)))}function eu(t,e,i,n){let s=null,r=t.changeByRange((r=>{if(!r.empty)return{changes:[{insert:e,from:r.from},{insert:i,from:r.to}],effects:zO.of(r.to+e.length),range:$t.range(r.anchor+e.length,r.head+e.length)};let o=tu(t.doc,r.head);return!o||/\s/.test(o)||n.indexOf(o)>-1?{changes:{insert:e+i,from:r.head},effects:zO.of(r.head+e.length),range:$t.cursor(r.head+e.length)}:{range:s=r}}));return s?null:t.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function iu(t,e,i){let n=null,s=t.changeByRange((e=>e.empty&&tu(t.doc,e.head)==i?{changes:{from:e.head,to:e.head+i.length,insert:i},range:$t.cursor(e.head+i.length)}:n={range:e}));return n?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function nu(t,e,i,n){let s=n.stringPrefixes||DO.stringPrefixes,r=null,o=t.changeByRange((n=>{if(!n.empty)return{changes:[{insert:e,from:n.from},{insert:e,from:n.to}],effects:zO.of(n.to+e.length),range:$t.range(n.anchor+e.length,n.head+e.length)};let o,a=n.head,l=tu(t.doc,a);if(l==e){if(su(t,a))return{changes:{insert:e+e,from:a},effects:zO.of(a+e.length),range:$t.cursor(a+e.length)};if(KO(t,a)){let n=i&&t.sliceDoc(a,a+3*e.length)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+n.length,insert:n},range:$t.cursor(a+n.length)}}}else{if(i&&t.sliceDoc(a-2*e.length,a)==e+e&&(o=ru(t,a-2*e.length,s))>-1&&su(t,o))return{changes:{insert:e+e+e+e,from:a},effects:zO.of(a+e.length),range:$t.cursor(a+e.length)};if(t.charCategorizer(a)(l)!=fe.Word&&ru(t,a,s)>-1&&!function(t,e,i,n){let s=Ea(t).resolveInner(e,-1),r=n.reduce(((t,e)=>Math.max(t,e.length)),0);for(let o=0;o<5;o++){let o=t.sliceDoc(s.from,Math.min(s.to,s.from+i.length+r)),a=o.indexOf(i);if(!a||a>-1&&n.indexOf(o.slice(0,a))>-1){let e=s.firstChild;for(;e&&e.from==s.from&&e.to-e.from>i.length+a;){if(t.sliceDoc(e.to-i.length,e.to)==i)return!1;e=e.firstChild}return!0}let l=s.to==e&&s.parent;if(!l)break;s=l}return!1}(t,a,e,s))return{changes:{insert:e+e,from:a},effects:zO.of(a+e.length),range:$t.cursor(a+e.length)}}return{range:r=n}}));return r?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function su(t,e){let i=Ea(t).resolveInner(e+1);return i.parent&&i.from==e}function ru(t,e,i){let n=t.charCategorizer(e);if(n(t.sliceDoc(e-1,e))!=fe.Word)return e;for(let s of i){let i=e-s.length;if(t.sliceDoc(i,e)==s&&n(t.sliceDoc(i-1,i))!=fe.Word)return i}return-1}function ou(t={}){return[cO,Nc.of(t),wO,lu,bO]}const au=[{key:"Ctrl-Space",run:pO},{key:"Escape",run:mO},{key:"ArrowDown",run:fO(!0)},{key:"ArrowUp",run:fO(!1)},{key:"PageDown",run:fO(!0,"page")},{key:"PageUp",run:fO(!1,"page")},{key:"Enter",run:dO}],lu=Dt.highest(zr.computeN([Nc],(t=>t.facet(Nc).defaultKeymap?[au]:[])));function hu(t){let e=t.field(cO,!1);return e&&e.active.some((t=>1==t.state))?"pending":e&&e.active.some((t=>0!=t.state))?"active":null}const cu=new WeakMap;function Ou(t){var e;let i=null===(e=t.field(cO,!1))||void 0===e?void 0:e.open;if(!i||i.disabled)return[];let n=cu.get(i.options);return n||cu.set(i.options,n=i.options.map((t=>t.completion))),n}function uu(t){var e;let i=null===(e=t.field(cO,!1))||void 0===e?void 0:e.open;return i&&!i.disabled&&i.selected>=0?i.options[i.selected].completion:null}function fu(t){var e;let i=null===(e=t.field(cO,!1))||void 0===e?void 0:e.open;return i&&!i.disabled&&i.selected>=0?i.selected:null}const du=t=>{let{state:e}=t,i=e.doc.lineAt(e.selection.main.from),n=wu(t.state,i.from);return n.line?mu(t):!!n.block&&gu(t)};function pu(t,e){return({state:i,dispatch:n})=>{if(i.readOnly)return!1;let s=t(e,i);return!!s&&(n(i.update(s)),!0)}}const mu=pu(Su,0),gu=pu(((t,e)=>function(t,e,i=e.selection.ranges){let n=i.map((t=>wu(e,t.from).block));if(!n.every((t=>t)))return null;let s=i.map(((t,i)=>function(t,{open:e,close:i},n,s){let r,o,a=t.sliceDoc(n-bu,n),l=t.sliceDoc(s,s+bu),h=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(l)[0].length,O=a.length-h;if(a.slice(O-e.length,O)==e&&l.slice(c,c+i.length)==i)return{open:{pos:n-h,margin:h&&1},close:{pos:s+c,margin:c&&1}};s-n<=2*bu?r=o=t.sliceDoc(n,s):(r=t.sliceDoc(n,n+bu),o=t.sliceDoc(s-bu,s));let u=/^\s*/.exec(r)[0].length,f=/\s*$/.exec(o)[0].length,d=o.length-f-i.length;if(r.slice(u,u+e.length)==e&&o.slice(d,d+i.length)==i)return{open:{pos:n+u+e.length,margin:/\s/.test(r.charAt(u+e.length))?1:0},close:{pos:s-f-i.length,margin:/\s/.test(o.charAt(d-1))?1:0}};return null}(e,n[i],t.from,t.to)));if(2!=t&&!s.every((t=>t)))return{changes:e.changes(i.map(((t,e)=>s[e]?[]:[{from:t.from,insert:n[e].open+" "},{from:t.to,insert:" "+n[e].close}])))};if(1!=t&&s.some((t=>t))){let t=[];for(let e,i=0;i=0&&e[r].to>n.from?e[r].to=s.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:s.to})}return e}(e))),0);function wu(t,e){let i=t.languageDataAt("commentTokens",e);return i.length?i[0]:{}}const bu=50;function Su(t,e,i=e.selection.ranges){let n=[],s=-1;for(let{from:t,to:r}of i){let i=n.length,o=1e9,a=wu(e,t).line;if(a){for(let i=t;i<=r;){let l=e.doc.lineAt(i);if(l.from>s&&(t==r||r>l.from)){s=l.from;let t=/^\s*/.exec(l.text)[0].length,e=t==l.length,i=l.text.slice(t,t+a.length)==a?t:-1;tt.comment<0&&(!t.empty||t.single)))){let t=[];for(let{line:e,token:i,indent:s,empty:r,single:o}of n)!o&&r||t.push({from:e.from+s,insert:i+" "});let i=e.changes(t);return{changes:i,selection:e.selection.map(i,1)}}if(1!=t&&n.some((t=>t.comment>=0))){let t=[];for(let{line:e,comment:i,token:s}of n)if(i>=0){let n=e.from+i,r=n+s.length;" "==e.text[r-e.from]&&r++,t.push({from:n,to:r})}return{changes:t}}return null}const yu=ie.define(),Qu=ie.define(),vu=Tt.define(),xu=Tt.define({combine:t=>we(t,{minDepth:100,newGroupDelay:500,joinToEvent:(t,e)=>e},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,e)=>(i,n)=>t(i,n)||e(i,n)})});const ku=Vt.define({create:()=>Du.empty,update(t,e){let i=e.state.facet(xu),n=e.annotation(yu);if(n){let s=e.docChanged?$t.single(function(t){let e=0;return t.iterChangedRanges(((t,i)=>e=i)),e}(e.changes)):void 0,r=Yu.fromTransaction(e,s),o=n.side,a=0==o?t.undone:t.done;return a=r?Au(a,a.length,i.minDepth,r):ju(a,e.startState.selection),new Du(0==o?n.rest:a,0==o?a:n.rest)}let s=e.annotation(Qu);if("full"!=s&&"before"!=s||(t=t.isolate()),!1===e.annotation(oe.addToHistory))return e.changes.empty?t:t.addMapping(e.changes.desc);let r=Yu.fromTransaction(e),o=e.annotation(oe.time),a=e.annotation(oe.userEvent);return r?t=t.addChanges(r,o,a,i,e):e.selection&&(t=t.addSelection(e.startState.selection,o,a,i.newGroupDelay)),"full"!=s&&"after"!=s||(t=t.isolate()),t},toJSON:t=>({done:t.done.map((t=>t.toJSON())),undone:t.undone.map((t=>t.toJSON()))}),fromJSON:t=>new Du(t.done.map(Yu.fromJSON),t.undone.map(Yu.fromJSON))});function $u(t={}){return[ku,xu.of(t),Wr.domEventHandlers({beforeinput(t,e){let i="historyUndo"==t.inputType?Zu:"historyRedo"==t.inputType?Tu:null;return!!i&&(t.preventDefault(),i(e))}})]}function Pu(t,e){return function({state:i,dispatch:n}){if(!e&&i.readOnly)return!1;let s=i.field(ku,!1);if(!s)return!1;let r=s.pop(t,i,e);return!!r&&(n(r),!0)}}const Zu=Pu(0,!1),Tu=Pu(1,!1),Xu=Pu(0,!0),Cu=Pu(1,!0);class Yu{constructor(t,e,i,n,s){this.changes=t,this.effects=e,this.mapped=i,this.startSelection=n,this.selectionsAfter=s}setSelAfter(t){return new Yu(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,e,i;return{changes:null===(t=this.changes)||void 0===t?void 0:t.toJSON(),mapped:null===(e=this.mapped)||void 0===e?void 0:e.toJSON(),startSelection:null===(i=this.startSelection)||void 0===i?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map((t=>t.toJSON()))}}static fromJSON(t){return new Yu(t.changes&&wt.fromJSON(t.changes),[],t.mapped&>.fromJSON(t.mapped),t.startSelection&&$t.fromJSON(t.startSelection),t.selectionsAfter.map($t.fromJSON))}static fromTransaction(t,e){let i=Wu;for(let e of t.startState.facet(vu)){let n=e(t);n.length&&(i=i.concat(n))}return!i.length&&t.changes.empty?null:new Yu(t.changes.invert(t.startState.doc),i,void 0,e||t.startState.selection,Wu)}static selection(t){return new Yu(void 0,Wu,void 0,void 0,t)}}function Au(t,e,i,n){let s=e+1>i+20?e-i-1:0,r=t.slice(s,e);return r.push(n),r}function Ru(t,e){return t.length?e.length?t.concat(e):t:e}const Wu=[],Vu=200;function ju(t,e){if(t.length){let i=t[t.length-1],n=i.selectionsAfter.slice(Math.max(0,i.selectionsAfter.length-Vu));return n.length&&n[n.length-1].eq(e)?t:(n.push(e),Au(t,t.length-1,1e9,i.setSelAfter(n)))}return[Yu.selection([e])]}function qu(t){let e=t[t.length-1],i=t.slice();return i[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),i}function _u(t,e){if(!t.length)return t;let i=t.length,n=Wu;for(;i;){let s=Eu(t[i-1],e,n);if(s.changes&&!s.changes.empty||s.effects.length){let e=t.slice(0,i);return e[i-1]=s,e}e=s.mapped,i--,n=s.selectionsAfter}return n.length?[Yu.selection(n)]:Wu}function Eu(t,e,i){let n=Ru(t.selectionsAfter.length?t.selectionsAfter.map((t=>t.map(e))):Wu,i);if(!t.changes)return Yu.selection(n);let s=t.changes.map(e),r=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(r):r;return new Yu(s,re.mapEffects(t.effects,e),o,t.startSelection.map(r),n)}const Mu=/^(input\.type|delete)($|\.)/;class Du{constructor(t,e,i=0,n=void 0){this.done=t,this.undone=e,this.prevTime=i,this.prevUserEvent=n}isolate(){return this.prevTime?new Du(this.done,this.undone):this}addChanges(t,e,i,n,s){let r=this.done,o=r[r.length-1];return r=o&&o.changes&&!o.changes.empty&&t.changes&&(!i||Mu.test(i))&&(!o.selectionsAfter.length&&e-this.prevTimei.push(t,e))),e.iterChangedRanges(((t,e,s,r)=>{for(let t=0;t=e&&s<=o&&(n=!0)}})),n}(o.changes,t.changes))||"input.type.compose"==i)?Au(r,r.length-1,n.minDepth,new Yu(t.changes.compose(o.changes),Ru(t.effects,o.effects),o.mapped,o.startSelection,Wu)):Au(r,r.length,n.minDepth,t),new Du(r,Wu,e,i)}addSelection(t,e,i,n){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:Wu;return s.length>0&&e-this.prevTimet.empty!=o.ranges[e].empty)).length)?this:new Du(ju(this.done,t),this.undone,e,i);var r,o}addMapping(t){return new Du(_u(this.done,t),_u(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,e,i){let n=0==t?this.done:this.undone;if(0==n.length)return null;let s=n[n.length-1];if(i&&s.selectionsAfter.length)return e.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:yu.of({side:t,rest:qu(n)}),userEvent:0==t?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let i=1==n.length?Wu:n.slice(0,n.length-1);return s.mapped&&(i=_u(i,s.mapped)),e.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:yu.of({side:t,rest:i}),filter:!1,userEvent:0==t?"undo":"redo",scrollIntoView:!0})}return null}}Du.empty=new Du(Wu,Wu);const zu=[{key:"Mod-z",run:Zu,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Tu,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Tu,preventDefault:!0},{key:"Mod-u",run:Xu,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Cu,preventDefault:!0}];function Gu(t,e){return $t.create(t.ranges.map(e),t.mainIndex)}function Iu(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Bu({state:t,dispatch:e},i){let n=Gu(t.selection,i);return!n.eq(t.selection)&&(e(Iu(t,n)),!0)}function Nu(t,e){return $t.cursor(e?t.to:t.from)}function Uu(t,e){return Bu(t,(i=>i.empty?t.moveByChar(i,e):Nu(i,e)))}function Lu(t){return t.textDirectionAt(t.state.selection.main.head)==sn.LTR}const Fu=t=>Uu(t,!Lu(t)),Hu=t=>Uu(t,Lu(t));function Ju(t,e){return Bu(t,(i=>i.empty?t.moveByGroup(i,e):Nu(i,e)))}const Ku=t=>Ju(t,!Lu(t)),tf=t=>Ju(t,Lu(t));function ef(t,e,i){if(e.type.prop(i))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function nf(t,e,i){let s,r,o=Ea(t).resolveInner(e.head),a=i?n.closedBy:n.openedBy;for(let n=e.head;;){let e=i?o.childAfter(n):o.childBefore(n);if(!e)break;ef(t,e,a)?o=e:n=i?e.to:e.from}return r=o.type.prop(a)&&(s=i?ah(t,o.from,1):ah(t,o.to,-1))&&s.matched?i?s.end.to:s.end.from:i?o.to:o.from,$t.cursor(r,i?-1:1)}const sf=t=>Bu(t,(e=>nf(t.state,e,!Lu(t)))),rf=t=>Bu(t,(e=>nf(t.state,e,Lu(t))));function of(t,e){return Bu(t,(i=>{if(!i.empty)return Nu(i,e);let n=t.moveVertically(i,e);return n.head!=i.head?n:t.moveToLineBoundary(i,e)}))}const af=t=>of(t,!1),lf=t=>of(t,!0);function hf(t){let e,i=t.scrollDOM.clientHeighti.empty?t.moveVertically(i,e,n.height):Nu(i,e)));if(r.eq(s.selection))return!1;if(n.selfScroll){let e=t.coordsAtPos(s.selection.main.head),o=t.scrollDOM.getBoundingClientRect(),a=o.top+n.marginTop,l=o.bottom-n.marginBottom;e&&e.top>a&&e.bottomcf(t,!1),uf=t=>cf(t,!0);function ff(t,e,i){let n=t.lineBlockAt(e.head),s=t.moveToLineBoundary(e,i);if(s.head==e.head&&s.head!=(i?n.to:n.from)&&(s=t.moveToLineBoundary(e,i,!1)),!i&&s.head==n.from&&n.length){let i=/^\s*/.exec(t.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;i&&e.head!=n.from+i&&(s=$t.cursor(n.from+i))}return s}function df(t,e,i){let n=!1,s=Gu(t.selection,(e=>{let s=ah(t,e.head,-1)||ah(t,e.head,1)||e.head>0&&ah(t,e.head-1,1)||e.headdf(t,e,!1),mf=({state:t,dispatch:e})=>df(t,e,!0);function gf(t,e){let i=Gu(t.state.selection,(t=>{let i=e(t);return $t.range(t.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)}));return!i.eq(t.state.selection)&&(t.dispatch(Iu(t.state,i)),!0)}function wf(t,e){return gf(t,(i=>t.moveByChar(i,e)))}const bf=t=>wf(t,!Lu(t)),Sf=t=>wf(t,Lu(t));function yf(t,e){return gf(t,(i=>t.moveByGroup(i,e)))}const Qf=t=>yf(t,!Lu(t)),vf=t=>yf(t,Lu(t)),xf=t=>gf(t,(e=>nf(t.state,e,!Lu(t)))),kf=t=>gf(t,(e=>nf(t.state,e,Lu(t))));function $f(t,e){return gf(t,(i=>t.moveVertically(i,e)))}const Pf=t=>$f(t,!1),Zf=t=>$f(t,!0);function Tf(t,e){return gf(t,(i=>t.moveVertically(i,e,hf(t).height)))}const Xf=t=>Tf(t,!1),Cf=t=>Tf(t,!0),Yf=({state:t,dispatch:e})=>(e(Iu(t,{anchor:0})),!0),Af=({state:t,dispatch:e})=>(e(Iu(t,{anchor:t.doc.length})),!0),Rf=({state:t,dispatch:e})=>(e(Iu(t,{anchor:t.selection.main.anchor,head:0})),!0),Wf=({state:t,dispatch:e})=>(e(Iu(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0);function Vf(t,e){if(t.state.readOnly)return!1;let i="delete.selection",{state:n}=t,s=n.changeByRange((n=>{let{from:s,to:r}=n;if(s==r){let o=e(n);os&&(i="delete.forward",o=jf(t,o,!0)),s=Math.min(s,o),r=Math.max(r,o)}else s=jf(t,s,!1),r=jf(t,r,!0);return s==r?{range:n}:{changes:{from:s,to:r},range:$t.cursor(s,se(t))))n.between(e,e,((t,n)=>{te&&(e=i?n:t)}));return e}const qf=(t,e)=>Vf(t,(i=>{let n,s,r=i.from,{state:o}=t,a=o.doc.lineAt(r);if(!e&&r>a.from&&rqf(t,!1),Ef=t=>qf(t,!0),Mf=(t,e)=>Vf(t,(i=>{let n=i.head,{state:s}=t,r=s.doc.lineAt(n),o=s.charCategorizer(n);for(let t=null;;){if(n==(e?r.to:r.from)){n==i.head&&r.number!=(e?s.doc.lines:1)&&(n+=e?1:-1);break}let a=at(r.text,n-r.from,e)+r.from,l=r.text.slice(Math.min(n,a)-r.from,Math.max(n,a)-r.from),h=o(l);if(null!=t&&h!=t)break;" "==l&&n==i.head||(t=h),n=a}return n})),Df=t=>Mf(t,!1);const zf=Gf(!1);function Gf(t){return({state:e,dispatch:i})=>{if(e.readOnly)return!1;let s=e.changeByRange((i=>{let{from:s,to:r}=i,o=e.doc.lineAt(s),a=!t&&s==r&&function(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let i,s=Ea(t).resolveInner(e),r=s.childBefore(e),o=s.childAfter(e);return r&&o&&r.to<=e&&o.from>=e&&(i=r.type.prop(n.closedBy))&&i.indexOf(o.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(o.from).from&&!/\S/.test(t.sliceDoc(r.to,o.from))?{from:r.to,to:o.from}:null}(e,s);t&&(s=r=(r<=o.to?o:e.doc.lineAt(r)).to);let l=new sl(e,{simulateBreak:s,simulateDoubleBreak:!!a}),h=nl(l,s);for(null==h&&(h=We(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));ro.from&&s{let s=[];for(let r=n.from;r<=n.to;){let o=t.doc.lineAt(r);o.number>i&&(n.empty||n.to>o.from)&&(e(o,s,n),i=o.number),r=o.to+1}let r=t.changes(s);return{changes:s,range:$t.range(r.mapPos(n.anchor,1),r.mapPos(n.head,1))}}))}const Bf=({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(If(t,((e,i)=>{i.push({from:e.from,insert:t.facet(tl)})})),{userEvent:"input.indent"})),!0),Nf=({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(If(t,((e,i)=>{let n=/^\s*/.exec(e.text)[0];if(!n)return;let s=We(n,t.tabSize),r=0,o=il(t,Math.max(0,s-el(t)));for(;rBu(t,(e=>ff(t,e,!Lu(t)))),shift:t=>gf(t,(e=>ff(t,e,!Lu(t)))),preventDefault:!0},{key:"ArrowRight",run:Hu,shift:Sf,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:tf,shift:vf,preventDefault:!0},{mac:"Cmd-ArrowRight",run:t=>Bu(t,(e=>ff(t,e,Lu(t)))),shift:t=>gf(t,(e=>ff(t,e,Lu(t)))),preventDefault:!0},{key:"ArrowUp",run:af,shift:Pf,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Yf,shift:Rf},{mac:"Ctrl-ArrowUp",run:Of,shift:Xf},{key:"ArrowDown",run:lf,shift:Zf,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Af,shift:Wf},{mac:"Ctrl-ArrowDown",run:uf,shift:Cf},{key:"PageUp",run:Of,shift:Xf},{key:"PageDown",run:uf,shift:Cf},{key:"Home",run:t=>Bu(t,(e=>ff(t,e,!1))),shift:t=>gf(t,(e=>ff(t,e,!1))),preventDefault:!0},{key:"Mod-Home",run:Yf,shift:Rf},{key:"End",run:t=>Bu(t,(e=>ff(t,e,!0))),shift:t=>gf(t,(e=>ff(t,e,!0))),preventDefault:!0},{key:"Mod-End",run:Af,shift:Wf},{key:"Enter",run:zf},{key:"Mod-a",run:({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:_f,shift:_f},{key:"Delete",run:Ef},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Df},{key:"Mod-Delete",mac:"Alt-Delete",run:t=>Mf(t,!0)},{mac:"Mod-Backspace",run:t=>Vf(t,(e=>{let i=t.moveToLineBoundary(e,!1).head;return e.head>i?i:Math.max(0,e.head-1)}))},{mac:"Mod-Delete",run:t=>Vf(t,(e=>{let i=t.moveToLineBoundary(e,!0).head;return e.headBu(t,(e=>$t.cursor(t.lineBlockAt(e.head).from,1))),shift:t=>gf(t,(e=>$t.cursor(t.lineBlockAt(e.head).from)))},{key:"Ctrl-e",run:t=>Bu(t,(e=>$t.cursor(t.lineBlockAt(e.head).to,-1))),shift:t=>gf(t,(e=>$t.cursor(t.lineBlockAt(e.head).to)))},{key:"Ctrl-d",run:Ef},{key:"Ctrl-h",run:_f},{key:"Ctrl-k",run:t=>Vf(t,(e=>{let i=t.lineBlockAt(e.head).to;return e.head{if(t.readOnly)return!1;let i=t.changeByRange((t=>({changes:{from:t.from,to:t.to,insert:N.of(["",""])},range:$t.cursor(t.from)})));return e(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange((e=>{if(!e.empty||0==e.from||e.from==t.doc.length)return{range:e};let i=e.from,n=t.doc.lineAt(i),s=i==n.from?i-1:at(n.text,i-n.from,!1)+n.from,r=i==n.to?i+1:at(n.text,i-n.from,!0)+n.from;return{changes:{from:s,to:r,insert:t.doc.slice(i,r).append(t.doc.slice(s,i))},range:$t.cursor(r)}}));return!i.changes.empty&&(e(t.update(i,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:uf}].map((t=>({mac:t.key,run:t.run,shift:t.shift})))),Lf=20,Ff=22,Hf=23,Jf=24,Kf=26,td=27,ed=28,id=31,nd=34,sd=37,rd={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},od={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},ad={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function ld(t){return 9==t||10==t||13==t||32==t}let hd=null,cd=null,Od=0;function ud(t,e){let i=t.pos+e;if(Od==i&&cd==t)return hd;let n=t.peek(e);for(;ld(n);)n=t.peek(++e);let s="";for(;45==(r=n)||46==r||58==r||r>=65&&r<=90||95==r||r>=97&&r<=122||r>=161;)s+=String.fromCharCode(n),n=t.peek(++e);var r;return cd=t,Od=i,hd=s?s.toLowerCase():n==fd||n==dd?void 0:null}const fd=63,dd=33;function pd(t,e){this.name=t,this.parent=e,this.hash=e?e.hash:0;for(let e=0;emd.indexOf(e)>-1?new pd(ud(n,1)||"",t):t,reduce:(t,e)=>e==Lf&&t?t.parent:t,reuse(t,e,i,n){let s=e.type.id;return 6==s||36==s?new pd(ud(n,1)||"",t):t},hash:t=>t?t.hash:0,strict:!1}),wd=new Ih(((t,e)=>{if(60!=t.next)return void(t.next<0&&e.context&&t.acceptToken(57));t.advance();let i=47==t.next;i&&t.advance();let n=ud(t,0);if(void 0===n)return;if(!n)return t.acceptToken(i?14:6);let s=e.context?e.context.name:null;if(i){if(n==s)return t.acceptToken(11);if(s&&od[s])return t.acceptToken(57,-2);if(e.dialectEnabled(0))return t.acceptToken(12);for(let t=e.context;t;t=t.parent)if(t.name==n)return;t.acceptToken(13)}else{if("script"==n)return t.acceptToken(7);if("style"==n)return t.acceptToken(8);if("textarea"==n)return t.acceptToken(9);if(rd.hasOwnProperty(n))return t.acceptToken(10);s&&ad[s]&&ad[s][n]?t.acceptToken(57,-1):t.acceptToken(6)}}),{contextual:!0}),bd=new Ih((t=>{for(let e=0,i=0;;i++){if(t.next<0){i&&t.acceptToken(58);break}if(45==t.next)e++;else{if(62==t.next&&e>=2){i>=3&&t.acceptToken(58,-2);break}e=0}t.advance()}}));const Sd=new Ih(((t,e)=>{if(47==t.next&&62==t.peek(1)){let i=e.dialectEnabled(1)||function(t){for(;t;t=t.parent)if("svg"==t.name||"math"==t.name)return!0;return!1}(e.context);t.acceptToken(i?5:4,2)}else 62==t.next&&t.acceptToken(4,1)}));function yd(t,e,i){let n=2+t.length;return new Ih((s=>{for(let r=0,o=0,a=0;;a++){if(s.next<0){a&&s.acceptToken(e);break}if(0==r&&60==s.next||1==r&&47==s.next||r>=2&&ro?s.acceptToken(e,-o):s.acceptToken(i,-(o-2));break}if((10==s.next||13==s.next)&&a){s.acceptToken(e,1);break}r=o=0}else o++;s.advance()}}))}const Qd=yd("script",54,1),vd=yd("style",55,2),xd=yd("textarea",56,3),kd=Oa({"Text RawText":Ya.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":Ya.angleBracket,TagName:Ya.tagName,"MismatchedCloseTag/TagName":[Ya.tagName,Ya.invalid],AttributeName:Ya.attributeName,"AttributeValue UnquotedAttributeValue":Ya.attributeValue,Is:Ya.definitionOperator,"EntityReference CharacterReference":Ya.character,Comment:Ya.blockComment,ProcessingInst:Ya.processingInstruction,DoctypeDecl:Ya.documentMeta}),$d=rc.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%WQ&rO,59fO%`Q&rO,59iO%hQ&rO,59lO%sQ&rO,59nOOOa'#D^'#D^O%{OaO'#CxO&WOaO,59[OOOb'#D_'#D_O&`ObO'#C{O&kObO,59[OOOd'#D`'#D`O&sOdO'#DOO'OOdO,59[OOO`'#Da'#DaO'WO!rO,59[O'_Q#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'dO$fO,59oOOO`,59o,59oO'lQ#|O,59qO'qQ#|O,59rOOO`-E7W-E7WO'vQ&rO'#CsOOQW'#DZ'#DZO(UQ&rO1G.wOOOa1G.w1G.wO(^Q&rO1G/QOOOb1G/Q1G/QO(f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Oc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{}!P!R!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!UeZ!e{}!P!R!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:gd,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[kd],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?M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QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let a=t.type.id;if(a==ed)return Td(t,e,i);if(a==id)return Td(t,e,n);if(a==nd)return Td(t,e,s);if(a==Lf&&r.length){let i,n=t.node,s=n.firstChild,o=s&&Zd(s,e);if(o)for(let t of r)if(t.tag==o&&(!t.attrs||t.attrs(i||(i=Pd(n,e))))){let e=n.lastChild,i=e.type.id==sd?e.from:n.to;if(i>s.to)return{parser:t.parser,overlay:[{from:s.to,to:i}]}}}if(o&&a==Hf){let i,n=t.node;if(i=n.firstChild){let t=o[e.read(i.from,i.to)];if(t)for(let i of t){if(i.tagName&&i.tagName!=Zd(n.parent,e))continue;let t=n.lastChild;if(t.type.id==Kf){let e=t.from+1,n=t.lastChild,s=t.to-(n&&n.isError?0:1);if(s>e)return{parser:i.parser,overlay:[{from:e,to:s}]}}else if(t.type.id==td)return{parser:i.parser,overlay:[{from:t.from,to:t.to}]}}}}return null}))}const Cd=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Yd=new sc({start:!1,shift:(t,e)=>4==e||5==e||312==e?t:313==e,strict:!1}),Ad=new Ih(((t,e)=>{let{next:i}=t;(125==i||-1==i||e.context)&&t.acceptToken(310)}),{contextual:!0,fallback:!0}),Rd=new Ih(((t,e)=>{let i,{next:n}=t;Cd.indexOf(n)>-1||(47!=n||47!=(i=t.peek(1))&&42!=i)&&(125==n||59==n||-1==n||e.context||t.acceptToken(309))}),{contextual:!0}),Wd=new Ih(((t,e)=>{let{next:i}=t;if((43==i||45==i)&&(t.advance(),i==t.next)){t.advance();let i=!e.context&&e.canShift(1);t.acceptToken(i?1:2)}}),{contextual:!0});function Vd(t,e){return t>=65&&t<=90||t>=97&&t<=122||95==t||t>=192||!e&&t>=48&&t<=57}const jd=new Ih(((t,e)=>{if(60!=t.next||!e.dialectEnabled(0))return;if(t.advance(),47==t.next)return;let i=0;for(;Cd.indexOf(t.next)>-1;)t.advance(),i++;if(Vd(t.next,!0)){for(t.advance(),i++;Vd(t.next,!1);)t.advance(),i++;for(;Cd.indexOf(t.next)>-1;)t.advance(),i++;if(44==t.next)return;for(let e=0;;e++){if(7==e){if(!Vd(t.next,!0))return;break}if(t.next!="extends".charCodeAt(e))break;t.advance(),i++}}t.acceptToken(3,-i)})),qd=Oa({"get set async static":Ya.modifier,"for while do if else switch try catch finally return throw break continue default case":Ya.controlKeyword,"in of await yield void typeof delete instanceof":Ya.operatorKeyword,"let var const using function class extends":Ya.definitionKeyword,"import export from":Ya.moduleKeyword,"with debugger as new":Ya.keyword,TemplateString:Ya.special(Ya.string),super:Ya.atom,BooleanLiteral:Ya.bool,this:Ya.self,null:Ya.null,Star:Ya.modifier,VariableName:Ya.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":Ya.function(Ya.variableName),VariableDefinition:Ya.definition(Ya.variableName),Label:Ya.labelName,PropertyName:Ya.propertyName,PrivatePropertyName:Ya.special(Ya.propertyName),"CallExpression/MemberExpression/PropertyName":Ya.function(Ya.propertyName),"FunctionDeclaration/VariableDefinition":Ya.function(Ya.definition(Ya.variableName)),"ClassDeclaration/VariableDefinition":Ya.definition(Ya.className),PropertyDefinition:Ya.definition(Ya.propertyName),PrivatePropertyDefinition:Ya.definition(Ya.special(Ya.propertyName)),UpdateOp:Ya.updateOperator,"LineComment Hashbang":Ya.lineComment,BlockComment:Ya.blockComment,Number:Ya.number,String:Ya.string,Escape:Ya.escape,ArithOp:Ya.arithmeticOperator,LogicOp:Ya.logicOperator,BitOp:Ya.bitwiseOperator,CompareOp:Ya.compareOperator,RegExp:Ya.regexp,Equals:Ya.definitionOperator,Arrow:Ya.function(Ya.punctuation),": Spread":Ya.punctuation,"( )":Ya.paren,"[ ]":Ya.squareBracket,"{ }":Ya.brace,"InterpolationStart InterpolationEnd":Ya.special(Ya.brace),".":Ya.derefOperator,", ;":Ya.separator,"@":Ya.meta,TypeName:Ya.typeName,TypeDefinition:Ya.definition(Ya.typeName),"type enum interface implements namespace module declare":Ya.definitionKeyword,"abstract global Privacy readonly override":Ya.modifier,"is keyof unique infer":Ya.operatorKeyword,JSXAttributeValue:Ya.attributeValue,JSXText:Ya.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":Ya.angleBracket,"JSXIdentifier JSXNameSpacedName":Ya.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":Ya.attributeName,"JSXBuiltin/JSXIdentifier":Ya.standard(Ya.tagName)}),_d={__proto__:null,export:18,as:23,from:31,default:34,async:39,function:40,extends:52,this:56,true:64,false:64,null:76,void:80,typeof:84,super:102,new:136,delete:152,yield:161,await:165,class:170,public:227,private:227,protected:227,readonly:229,instanceof:248,satisfies:251,in:252,const:254,import:286,keyof:339,unique:343,infer:349,is:385,abstract:405,implements:407,type:409,let:412,var:414,using:417,interface:423,enum:427,namespace:433,module:435,declare:439,global:443,for:462,of:471,while:474,with:478,do:482,if:486,else:488,switch:492,case:498,try:504,catch:508,finally:512,return:516,throw:520,break:524,continue:528,debugger:532},Ed={__proto__:null,async:123,get:125,set:127,declare:187,public:189,private:189,protected:189,static:191,abstract:193,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v0rQ5k1gQ6i3PQ6u;RQ7h4wR8m6j&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%j%p%}&f&i&j&m&o&p&r&v'O'S']'m'}(P(V(^(r(v(z)n)y+O+S+^,e,h,m,y,|-^-f-t-z.[.l.s.{0[0a0q1_1o1p1r1t1w1z1|2]2m2s3P3Z3p5W5Y5d5t5u5x6S6]6j7w7|8]8g9W9i:c:f:g:j:k:l:m:n:o:p:q:r:s:t:u:v:w:{;Y;Z;[;^;e;f;o;p<]t!nQ!r!u!x!y'R'Y'Z'g'h'i-Q-W-Y-j1[5]5_$v$si#u#w$c$d$x${%O%Q%[%]%a)u){)}*P*R*Y*`*p*q+]+`+w+z.Z.i/Z/j/k/m0Q0S0^1R1U1^3O3x4S4[4f4n4p5c6g7T7^7y8j8w9[9n:O:W:y:z:|:};O;P;S;T;U;V;W;X;_;`;a;b;c;d;g;h;i;j;k;l;m;n;q;r < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:371,context:Yd,nodeProps:[["isolate",-8,4,5,13,33,35,48,50,52,""],["group",-26,8,16,18,65,201,205,209,210,212,215,218,228,230,236,238,240,242,245,251,257,259,261,263,265,267,268,"Statement",-32,12,13,28,31,32,38,48,51,52,54,59,67,75,79,81,83,84,106,107,116,117,134,137,139,140,141,142,144,145,164,165,167,"Expression",-23,27,29,33,37,39,41,168,170,172,173,175,176,177,179,180,181,183,184,185,195,197,199,200,"Type",-3,87,99,105,"ClassItem"],["openedBy",22,"<",34,"InterpolationStart",53,"[",57,"{",72,"(",157,"JSXStartCloseTag"],["closedBy",23,">",36,"InterpolationEnd",47,"]",58,"}",73,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#m'}#m#n!HS#n;'S'};'S;=`(f<%lO'}!f!IhX(R!bOY!IcZw!Icwx!Acx#O!Ic#O#P!A{#P#Q!GY#Q;'S!Ic;'S;=`!JT<%lO!Ic!f!JWP;=`<%l!Ic!f!J^P;=`<%l!GY(Q!Jh^$f&j(R!bOY!JaYZ&cZw!Jawx!Bwx!^!Ja!^!_!Ic!_#O!Ja#O#P!Cr#P#Q!Q#V#X%Z#X#Y!4|#Y#b%Z#b#c#Zd$f&j(Op(R!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#?tf$f&j(Op(R!bo$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#b%Z#b#c#_d[t]||-1},{term:334,get:t=>Ed[t]||-1},{term:70,get:t=>Md[t]||-1}],tokenPrec:14626}),zd=[WO("function ${name}(${params}) {\n\t${}\n}",{label:"function",detail:"definition",type:"keyword"}),WO("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}",{label:"for",detail:"loop",type:"keyword"}),WO("for (let ${name} of ${collection}) {\n\t${}\n}",{label:"for",detail:"of loop",type:"keyword"}),WO("do {\n\t${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),WO("while (${}) {\n\t${}\n}",{label:"while",detail:"loop",type:"keyword"}),WO("try {\n\t${}\n} catch (${error}) {\n\t${}\n}",{label:"try",detail:"/ catch block",type:"keyword"}),WO("if (${}) {\n\t${}\n}",{label:"if",detail:"block",type:"keyword"}),WO("if (${}) {\n\t${}\n} else {\n\t${}\n}",{label:"if",detail:"/ else block",type:"keyword"}),WO("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}",{label:"class",detail:"definition",type:"keyword"}),WO('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),WO('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Gd=zd.concat([WO("interface ${name} {\n\t${}\n}",{label:"interface",detail:"definition",type:"keyword"}),WO("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),WO("enum ${name} {\n\t${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Id=new T,Bd=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Nd(t){return(e,i)=>{let n=e.node.getChild("VariableDefinition");return n&&i(n,t),!0}}const Ud=["FunctionDeclaration"],Ld={FunctionDeclaration:Nd("function"),ClassDeclaration:Nd("class"),ClassExpression:()=>!0,EnumDeclaration:Nd("constant"),TypeAliasDeclaration:Nd("type"),NamespaceDeclaration:Nd("namespace"),VariableDefinition(t,e){t.matchContext(Ud)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function Fd(t,e){let i=Id.get(e);if(i)return i;let n=[],s=!0;function r(e,i){let s=t.sliceString(e.from,e.to);n.push({label:s,type:i})}return e.cursor(c.IncludeAnonymous).iterate((e=>{if(s)s=!1;else if(e.name){let t=Ld[e.name];if(t&&t(e,r)||Bd.has(e.name))return!1}else if(e.to-e.from>8192){for(let i of Fd(t,e.node))n.push(i);return!1}})),Id.set(e,n),n}const Hd=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Jd=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function Kd(t){let e=Ea(t.state).resolveInner(t.pos,-1);if(Jd.indexOf(e.name)>-1)return null;let i="VariableName"==e.name||e.to-e.from<20&&Hd.test(t.state.sliceDoc(e.from,e.to));if(!i&&!t.explicit)return null;let n=[];for(let i=e;i;i=i.parent)Bd.has(i.name)&&(n=n.concat(Fd(t.state.doc,i)));return{options:n,from:i?e.from:t.pos,validFor:Hd}}function tp(t,e,i){var n;let s=[];for(;;){let r,o=e.firstChild;if("VariableName"==(null==o?void 0:o.name))return s.push(t(o)),{path:s.reverse(),name:i};if("MemberExpression"!=(null==o?void 0:o.name)||"PropertyName"!=(null===(n=r=o.lastChild)||void 0===n?void 0:n.name))return null;s.push(t(r)),e=o}}function ep(t){let e=e=>t.state.doc.sliceString(e.from,e.to),i=Ea(t.state).resolveInner(t.pos,-1);return"PropertyName"==i.name?tp(e,i.parent,e(i)):"."!=i.name&&"?."!=i.name||"MemberExpression"!=i.parent.name?Jd.indexOf(i.name)>-1?null:"VariableName"==i.name||i.to-i.from<20&&Hd.test(e(i))?{path:[],name:e(i)}:"MemberExpression"==i.name?tp(e,i,""):t.explicit?{path:[],name:""}:null:tp(e,i.parent,"")}const ip=_a.define({name:"javascript",parser:Dd.configure({props:[rl.add({IfStatement:dl({except:/^\s*({|else\b)/}),TryStatement:dl({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:fl,SwitchBody:t=>{let e=t.textAfter,i=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return t.baseIndent+(i?0:n?1:2)*t.unit},Block:Ol({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":dl({except:/^{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag":t=>t.column(t.node.from)+t.unit}),gl.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":wl,BlockComment:t=>({from:t.from+2,to:t.to-2})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),np={test:t=>/^JSX/.test(t.name),facet:Wa({commentTokens:{block:{open:"{/*",close:"*/}"}}})},sp=ip.configure({dialect:"ts"},"typescript"),rp=ip.configure({dialect:"jsx",props:[Va.add((t=>t.isTop?[np]:void 0))]}),op=ip.configure({dialect:"jsx ts",props:[Va.add((t=>t.isTop?[np]:void 0))]},"typescript");let ap=t=>({label:t,type:"keyword"});const lp="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(ap),hp=lp.concat(["declare","implements","private","protected","public"].map(ap));function cp(t={}){let e=t.jsx?t.typescript?op:rp:t.typescript?sp:ip,i=t.typescript?Gd.concat(hp):zd.concat(lp);return new Ha(e,[ip.data.of({autocomplete:jc(Jd,Vc(i))}),ip.data.of({autocomplete:Kd}),t.jsx?fp:[]])}function Op(t,e,i=t.length){for(let n=null==e?void 0:e.firstChild;n;n=n.nextSibling)if("JSXIdentifier"==n.name||"JSXBuiltin"==n.name||"JSXNamespacedName"==n.name||"JSXMemberExpression"==n.name)return t.sliceString(n.from,Math.min(n.to,i));return""}const up="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),fp=Wr.inputHandler.of(((t,e,i,n,s)=>{if((up?t.composing:t.compositionStarted)||t.state.readOnly||e!=i||">"!=n&&"/"!=n||!ip.isActiveAt(t.state,e,-1))return!1;let r=s(),{state:o}=r,a=o.changeByRange((t=>{var e;let i,{head:s}=t,r=Ea(o).resolveInner(s-1,-1);if("JSXStartTag"==r.name&&(r=r.parent),o.doc.sliceString(s-1,s)!=n||"JSXAttributeValue"==r.name&&r.to>s);else{if(">"==n&&"JSXFragmentTag"==r.name)return{range:t,changes:{from:s,insert:""}};if("/"==n&&"JSXStartCloseTag"==r.name){let t=r.parent,n=t.parent;if(n&&t.from==s-2&&((i=Op(o.doc,n.firstChild,s))||"JSXFragmentTag"==(null===(e=n.firstChild)||void 0===e?void 0:e.name))){let t=`${i}>`;return{range:$t.cursor(s+t.length,-1),changes:{from:s,insert:t}}}}else if(">"==n){let e=function(t){for(;;){if("JSXOpenTag"==t.name||"JSXSelfClosingTag"==t.name||"JSXFragmentTag"==t.name)return t;if("JSXEscape"==t.name||!t.parent)return null;t=t.parent}}(r);if(e&&!/^\/?>|^<\//.test(o.doc.sliceString(s,s+2))&&(i=Op(o.doc,e,s)))return{range:t,changes:{from:s,insert:``}}}}return{range:t}}));return!a.changes.empty&&(t.dispatch([r,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}));function dp(t,e,i,n){return i.line(t+n.line).from+e+(1==t?n.col-1:-1)}function pp(t,e,i){let n=dp(t.line,t.column,e,i),s={from:n,to:null!=t.endLine&&1!=t.endColumn?dp(t.endLine,t.endColumn,e,i):n,message:t.message,source:t.ruleId?"eslint:"+t.ruleId:"eslint",severity:1==t.severity?"warning":"error"};if(t.fix){let{range:e,text:r}=t.fix,o=e[0]+i.pos-n,a=e[1]+i.pos-n;s.actions=[{name:"fix",apply(t,e){t.dispatch({changes:{from:e+o,to:e+a,insert:r},scrollIntoView:!0})}}]}return s}var mp=Object.freeze({__proto__:null,autoCloseTags:fp,completionPath:ep,esLint:function(t,e){return e||(e={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},t.getRules().forEach(((t,i)=>{t.meta.docs.recommended&&(e.rules[i]=2)}))),i=>{let{state:n}=i,s=[];for(let{from:i,to:r}of ip.findRegions(n)){let o=n.doc.lineAt(i),a={line:o.number-1,col:i-o.from,pos:i};for(let o of t.verify(n.sliceDoc(i,r),e))s.push(pp(o,n.doc,a))}return s}},javascript:cp,javascriptLanguage:ip,jsxLanguage:rp,localCompletionSource:Kd,scopeCompletionSource:function(t){let e=new Map;return i=>{let n=ep(i);if(!n)return null;let s=t;for(let t of n.path)if(s=s[t],!s)return null;let r=e.get(s);return r||e.set(s,r=function(t,e){let i=[],n=new Set;for(let s=0;;s++){for(let r of(Object.getOwnPropertyNames||Object.keys)(t)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(r)||n.has(r))continue;let o;n.add(r);try{o=t[r]}catch(t){continue}i.push({label:r,type:"function"==typeof o?/^[A-Z]/.test(r)?"class":e?"function":"method":e?"variable":"property",boost:-s})}let r=Object.getPrototypeOf(t);if(!r)return i;t=r}}(s,!n.path.length)),{from:i.pos-n.name.length,options:r,validFor:Hd}}},snippets:zd,tsxLanguage:op,typescriptLanguage:sp,typescriptSnippets:Gd});const gp=["_blank","_self","_top","_parent"],wp=["ascii","utf-8","utf-16","latin1","latin1"],bp=["get","post","put","delete"],Sp=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],yp=["true","false"],Qp={},vp={a:{attrs:{href:null,ping:null,type:null,media:null,target:gp,hreflang:null}},abbr:Qp,address:Qp,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Qp,aside:Qp,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Qp,base:{attrs:{href:null,target:gp}},bdi:Qp,bdo:Qp,blockquote:{attrs:{cite:null}},body:Qp,br:Qp,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Sp,formmethod:bp,formnovalidate:["novalidate"],formtarget:gp,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Qp,center:Qp,cite:Qp,code:Qp,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Qp,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Qp,div:Qp,dl:Qp,dt:Qp,em:Qp,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Qp,figure:Qp,footer:Qp,form:{attrs:{action:null,name:null,"accept-charset":wp,autocomplete:["on","off"],enctype:Sp,method:bp,novalidate:["novalidate"],target:gp}},h1:Qp,h2:Qp,h3:Qp,h4:Qp,h5:Qp,h6:Qp,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Qp,hgroup:Qp,hr:Qp,html:{attrs:{manifest:null}},i:Qp,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Sp,formmethod:bp,formnovalidate:["novalidate"],formtarget:gp,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Qp,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Qp,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Qp,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:wp,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Qp,noscript:Qp,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Qp,param:{attrs:{name:null,value:null}},pre:Qp,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Qp,rt:Qp,ruby:Qp,samp:Qp,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:wp}},section:Qp,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Qp,source:{attrs:{src:null,type:null,media:null}},span:Qp,strong:Qp,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Qp,summary:Qp,sup:Qp,table:Qp,tbody:Qp,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Qp,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Qp,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Qp,time:{attrs:{datetime:null}},title:Qp,tr:Qp,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Qp,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Qp},xp={accesskey:null,class:null,contenteditable:yp,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:yp,autocorrect:yp,autocapitalize:yp,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":yp,"aria-autocomplete":["inline","list","both","none"],"aria-busy":yp,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":yp,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":yp,"aria-hidden":yp,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":yp,"aria-multiselectable":yp,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":yp,"aria-relevant":null,"aria-required":yp,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},kp="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map((t=>"on"+t));for(let t of kp)xp[t]=null;class $p{constructor(t,e){this.tags=Object.assign(Object.assign({},vp),t),this.globalAttrs=Object.assign(Object.assign({},xp),e),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}function Pp(t,e,i=t.length){if(!e)return"";let n=e.firstChild,s=n&&n.getChild("TagName");return s?t.sliceString(s.from,Math.min(s.to,i)):""}function Zp(t,e=!1){for(;t;t=t.parent)if("Element"==t.name){if(!e)return t;e=!1}return null}function Tp(t,e,i){let n=i.tags[Pp(t,Zp(e))];return(null==n?void 0:n.children)||i.allTags}function Xp(t,e){let i=[];for(let n=Zp(e);n&&!n.type.isTop;n=Zp(n.parent)){let s=Pp(t,n);if(s&&"CloseTag"==n.lastChild.name)break;s&&i.indexOf(s)<0&&("EndTag"==e.name||e.from>=n.firstChild.to)&&i.push(s)}return i}$p.default=new $p;const Cp=/^[:\-\.\w\u00b7-\uffff]*$/;function Yp(t,e,i,n,s){let r=/\s*>/.test(t.sliceDoc(s,s+5))?"":">",o=Zp(i,!0);return{from:n,to:s,options:Tp(t.doc,o,e).map((t=>({label:t,type:"type"}))).concat(Xp(t.doc,i).map(((t,e)=>({label:"/"+t,apply:"/"+t+r,type:"type",boost:99-e})))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Ap(t,e,i,n){let s=/\s*>/.test(t.sliceDoc(n,n+5))?"":">";return{from:i,to:n,options:Xp(t.doc,e).map(((t,e)=>({label:t,apply:t+s,type:"type",boost:99-e}))),validFor:Cp}}function Rp(t,e){let{state:i,pos:n}=e,s=Ea(i).resolveInner(n,-1),r=s.resolve(n);for(let t,e=n;r==s&&(t=s.childBefore(e));){let i=t.lastChild;if(!i||!i.type.isError||i.from({label:t,type:"property"}))),validFor:Cp}}(i,t,s,"AttributeName"==s.name?s.from:n,n):"Is"==s.name||"AttributeValue"==s.name||"UnquotedAttributeValue"==s.name?function(t,e,i,n,s){var r;let o,a=null===(r=i.parent)||void 0===r?void 0:r.getChild("AttributeName"),l=[];if(a){let r=t.sliceDoc(a.from,a.to),h=e.globalAttrs[r];if(!h){let n=Zp(i),s=n?e.tags[Pp(t.doc,n)]:null;h=(null==s?void 0:s.attrs)&&s.attrs[r]}if(h){let e=t.sliceDoc(n,s).toLowerCase(),i='"',r='"';/^['"]/.test(e)?(o='"'==e[0]?/^[^"]*$/:/^[^']*$/,i="",r=t.sliceDoc(s,s+1)==e[0]?"":e[0],e=e.slice(1),n++):o=/^[^\s<>='"]*$/;for(let t of h)l.push({label:t,apply:i+t+r,type:"constant"})}}return{from:n,to:s,options:l,validFor:o}}(i,t,s,"Is"==s.name?n:s.from,n):!e.explicit||"Element"!=r.name&&"Text"!=r.name&&"Document"!=r.name?null:function(t,e,i,n){let s=[],r=0;for(let n of Tp(t.doc,i,e))s.push({label:"<"+n,type:"type"});for(let e of Xp(t.doc,i))s.push({label:"",type:"type",boost:99-r++});return{from:n,to:n,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}(i,t,s,n)}function Wp(t){return Rp($p.default,t)}function Vp(t){let{extraTags:e,extraGlobalAttributes:i}=t,n=i||e?new $p(e,i):$p.default;return t=>Rp(n,t)}const jp=ip.parser.configure({top:"SingleExpression"}),qp=[{tag:"script",attrs:t=>"text/typescript"==t.type||"ts"==t.lang,parser:sp.parser},{tag:"script",attrs:t=>"text/babel"==t.type||"text/jsx"==t.type,parser:rp.parser},{tag:"script",attrs:t=>"text/typescript-jsx"==t.type,parser:op.parser},{tag:"script",attrs:t=>/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type),parser:jp},{tag:"script",attrs:t=>!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type),parser:ip.parser},{tag:"style",attrs:t=>(!t.lang||"css"==t.lang)&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type)),parser:Yc.parser}],_p=[{name:"style",parser:Yc.parser.configure({top:"Styles"})}].concat(kp.map((t=>({name:t,parser:ip.parser})))),Ep=_a.define({name:"html",parser:$d.configure({props:[rl.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag":t=>t.column(t.node.from)+t.unit,Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].lengtht.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"\x3c!--",close:"--\x3e"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),Mp=Ep.configure({wrap:Xd(qp,_p)});function Dp(t={}){let e,i="";!1===t.matchClosingTags&&(i="noMatch"),!0===t.selfClosingTags&&(i=(i?i+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(e=Xd((t.nestedLanguages||[]).concat(qp),(t.nestedAttributes||[]).concat(_p)));let n=e?Ep.configure({wrap:e,dialect:i}):i?Mp.configure({dialect:i}):Mp;return new Ha(n,[Mp.data.of({autocomplete:Vp(t)}),!1!==t.autoCloseTags?Gp:[],cp().support,Ac().support])}const zp=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),Gp=Wr.inputHandler.of(((t,e,i,n,s)=>{if(t.composing||t.state.readOnly||e!=i||">"!=n&&"/"!=n||!Mp.isActiveAt(t.state,e,-1))return!1;let r=s(),{state:o}=r,a=o.changeByRange((t=>{var e,i,s;let r,a=o.doc.sliceString(t.from-1,t.to)==n,{head:l}=t,h=Ea(o).resolveInner(l-1,-1);if("TagName"!=h.name&&"StartTag"!=h.name||(h=h.parent),a&&">"==n&&"OpenTag"==h.name){if("CloseTag"!=(null===(i=null===(e=h.parent)||void 0===e?void 0:e.lastChild)||void 0===i?void 0:i.name)&&(r=Pp(o.doc,h.parent,l))&&!zp.has(r)){return{range:t,changes:{from:l,to:l+(">"===o.doc.sliceString(l,l+1)?1:0),insert:``}}}}else if(a&&"/"==n&&"IncompleteCloseTag"==h.name){let t=h.parent;if(h.from==l-2&&"CloseTag"!=(null===(s=t.lastChild)||void 0===s?void 0:s.name)&&(r=Pp(o.doc,t,l))&&!zp.has(r)){let t=l+(">"===o.doc.sliceString(l,l+1)?1:0),e=`${r}>`;return{range:$t.cursor(l+e.length,-1),changes:{from:l,to:t,insert:e}}}}return{range:t}}));return!a.changes.empty&&(t.dispatch([r,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}));var Ip=Object.freeze({__proto__:null,autoCloseTags:Gp,html:Dp,htmlCompletionSource:Wp,htmlCompletionSourceWith:Vp,htmlLanguage:Mp,htmlPlain:Ep});const Bp="function"==typeof String.prototype.normalize?t=>t.normalize("NFKD"):t=>t;class Np{constructor(t,e,i=0,n=t.length,s,r){this.test=r,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,n),this.bufferStart=i,this.normalize=s?t=>s(Bp(t)):Bp,this.query=this.normalize(e)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ut(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let e=ft(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=dt(t);let n=this.normalize(e);for(let t=0,s=i;;t++){let r=n.charCodeAt(t),o=this.match(r,s);if(t==n.length-1){if(o)return this.value=o,this;break}s==i&&tthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let e=this.matchPos<=this.to&&this.re.exec(this.curLine);if(e){let i=this.curLineStart+e.index,n=i+e[0].length;if(this.matchPos=tm(this.text,n+(i==n?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,n,e)))return this.value={from:i,to:n,match:e},this;t=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length=i||n.to<=e){let n=new Jp(e,t.sliceString(e,i));return Hp.set(t,n),n}if(n.from==e&&n.to==i)return n;let{text:s,from:r}=n;return r>e&&(s=t.sliceString(e,r)+s,r=e),n.to=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,e=this.re.exec(this.flat.text);if(e&&!e[0]&&e.index==t&&(this.re.lastIndex=t+1,e=this.re.exec(this.flat.text)),e){let t=this.flat.from+e.index,i=t+e[0].length;if((this.flat.to>=this.to||e.index+e[0].length<=this.flat.text.length-10)&&(!this.test||this.test(t,i,e)))return this.value={from:t,to:i,match:e},this.matchPos=tm(this.text,i+(t==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Jp.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function tm(t,e){if(e>=t.length)return e;let i,n=t.lineAt(e);for(;e=56320&&i<57344;)e++;return e}"undefined"!=typeof Symbol&&(Fp.prototype[Symbol.iterator]=Kp.prototype[Symbol.iterator]=function(){return this});const em={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},im=Tt.define({combine:t=>we(t,em,{highlightWordAroundCursor:(t,e)=>t||e,minSelectionLength:Math.min,maxMatches:Math.min})});function nm(t){let e=[lm,am];return t&&e.push(im.of(t)),e}const sm=Ui.mark({class:"cm-selectionMatch"}),rm=Ui.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function om(t,e,i,n){return!(0!=i&&t(e.sliceDoc(i-1,i))==fe.Word||n!=e.doc.length&&t(e.sliceDoc(n,n+1))==fe.Word)}const am=qn.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(im),{state:i}=t,n=i.selection;if(n.ranges.length>1)return Ui.none;let s,r=n.main,o=null;if(r.empty){if(!e.highlightWordAroundCursor)return Ui.none;let t=i.wordAt(r.head);if(!t)return Ui.none;o=i.charCategorizer(r.head),s=i.sliceDoc(t.from,t.to)}else{let t=r.to-r.from;if(t200)return Ui.none;if(e.wholeWords){if(s=i.sliceDoc(r.from,r.to),o=i.charCategorizer(r.head),!om(o,i,r.from,r.to)||!function(t,e,i,n){return t(e.sliceDoc(i,i+1))==fe.Word&&t(e.sliceDoc(n-1,n))==fe.Word}(o,i,r.from,r.to))return Ui.none}else if(s=i.sliceDoc(r.from,r.to).trim(),!s)return Ui.none}let a=[];for(let n of t.visibleRanges){let t=new Np(i.doc,s,n.from,n.to);for(;!t.next().done;){let{from:n,to:s}=t.value;if((!o||om(o,i,n,s))&&(r.empty&&n<=r.from&&s>=r.to?a.push(rm.range(n,s)):(n>=r.to||s<=r.from)&&a.push(sm.range(n,s)),a.length>e.maxMatches))return Ui.none}}return Ui.set(a)}},{decorations:t=>t.decorations}),lm=Wr.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}});const hm=({state:t,dispatch:e})=>{let{ranges:i}=t.selection;if(i.some((t=>t.from===t.to)))return(({state:t,dispatch:e})=>{let{selection:i}=t,n=$t.create(i.ranges.map((e=>t.wordAt(e.head)||$t.cursor(e.head))),i.mainIndex);return!n.eq(i)&&(e(t.update({selection:n})),!0)})({state:t,dispatch:e});let n=t.sliceDoc(i[0].from,i[0].to);if(t.selection.ranges.some((e=>t.sliceDoc(e.from,e.to)!=n)))return!1;let s=function(t,e){let{main:i,ranges:n}=t.selection,s=t.wordAt(i.head),r=s&&s.from==i.from&&s.to==i.to;for(let i=!1,s=new Np(t.doc,e,n[n.length-1].to);;){if(s.next(),!s.done){if(i&&n.some((t=>t.from==s.value.from)))continue;if(r){let e=t.wordAt(s.value.from);if(!e||e.from!=s.value.from||e.to!=s.value.to)continue}return s.value}if(i)return null;s=new Np(t.doc,e,0,Math.max(0,n[n.length-1].from-1)),i=!0}}(t,n);return!!s&&(e(t.update({selection:t.selection.addRange($t.range(s.from,s.to),!1),effects:Wr.scrollIntoView(s.to)})),!0)};function cm(t){const e=t.selection.main.head;return t.doc.lineAt(e)}function Om(t,e){let i=0;t:for(let n=0;nwe(t,{highlightActiveBlock:!0,hideFirstIndent:!1,markerType:"fullScope",thickness:1})});class fm{constructor(t,e,i,n){this.lines=t,this.state=e,this.map=new Map,this.unitWidth=i,this.markerType=n;for(const t of this.lines)this.add(t);this.state.facet(um).highlightActiveBlock&&this.findAndSetActiveLines()}has(t){return this.map.has("number"==typeof t?t:t.number)}get(t){const e=this.map.get("number"==typeof t?t:t.number);if(!e)throw new Error("Line not found in indentation map");return e}set(t,e,i){const n=!t.text.trim().length,s={line:t,col:e,level:i,empty:n};return this.map.set(s.line.number,s),s}add(t){if(this.has(t))return this.get(t);if(!t.length||!t.text.trim().length){if(1===t.number)return this.set(t,0,0);if(t.number===this.state.doc.lines){const e=this.closestNonEmpty(t,-1);return this.set(t,0,e.level)}const e=this.closestNonEmpty(t,-1),i=this.closestNonEmpty(t,1);return e.level>=i.level&&"codeOnly"!==this.markerType?this.set(t,0,e.level):e.empty&&0===e.level&&0!==i.level?this.set(t,0,0):i.level>e.level?this.set(t,0,e.level+1):this.set(t,0,i.level)}const e=Om(t.text,this.state.tabSize),i=Math.floor(e/this.unitWidth);return this.set(t,e,i)}closestNonEmpty(t,e){let i=t.number+e;for(;-1===e?i>=1:i<=this.state.doc.lines;){if(this.has(i)){const t=this.get(i);if(!t.empty)return t}const t=this.state.doc.line(i);if(t.text.trim().length){const e=Om(t.text,this.state.tabSize),i=Math.floor(e/this.unitWidth);return this.set(t,e,i)}i+=e}const n=this.state.doc.line(-1===e?1:this.state.doc.lines);return this.set(n,0,0)}findAndSetActiveLines(){const t=cm(this.state);if(!this.has(t))return;let e,i,n=this.get(t);if(this.has(n.line.number+1)){const t=this.get(n.line.number+1);t.level>n.level&&(n=t)}if(this.has(n.line.number-1)){const t=this.get(n.line.number-1);t.level>n.level&&(n=t)}if(0!==n.level){for(n.active=n.level,e=n.line.number;e>1;e--){if(!this.has(e-1))continue;const t=this.get(e-1);if(t.level0&&a.push(pm("--indent-marker-bg-color",n,e,o,t)),a.push(pm("--indent-marker-active-bg-color",n,e,r-1,1)),r!==s&&a.push(pm("--indent-marker-bg-color",n,e,r,s-r))}else a.push(pm("--indent-marker-bg-color",n,e,o,s-o));return a.join(",")}class gm{constructor(t){this.view=t,this.unitWidth=el(t.state),this.currentLineNumber=cm(t.state).number,this.generate(t.state)}update(t){const e=el(t.state),i=e!==this.unitWidth;i&&(this.unitWidth=e);const n=cm(t.state).number,s=n!==this.currentLineNumber;this.currentLineNumber=n;const r=t.state.facet(um).highlightActiveBlock&&s;(t.docChanged||t.viewportChanged||i||r)&&this.generate(t.state)}generate(t){const e=new xe,i=function(t,e=t.state){const i=new Set;for(const{from:n,to:s}of t.visibleRanges){let t=n;for(;t<=s;){const n=e.doc.lineAt(t);i.has(n)||i.add(n),t=n.to+1}}return i}(this.view,t),{hideFirstIndent:n,markerType:s,thickness:r}=t.facet(um),o=new fm(i,t,this.unitWidth,s);for(const t of i){const i=o.get(t.number);if(!(null==i?void 0:i.level))continue;const s=mm(i,this.unitWidth,n,r);e.add(t.from,t.from,Ui.line({class:"cm-indent-markers",attributes:{style:`--indent-markers: ${s}`}}))}this.decorations=e.finish()}}function wm(t={}){return[um.of(t),dm(t.colors),qn.fromClass(gm,{decorations:t=>t.decorations})]}function bm(){return import("./angular.js")}async function Sm(){return fh.define((await import("./legacy.js").then((function(t){return t.c}))).clojure)}async function ym(){return fh.define((await import("./legacy.js").then((function(t){return t.a}))).coffeeScript)}function Qm(){return import("./cpp.js")}const vm=_a.define({name:Yc.name,parser:Yc.parser,languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:""}}),xm={cssCompletionSource:Cc,cssLanguage:vm,css:()=>new Ha(vm,vm.data.of({autocomplete:Cc}))};async function km(){return fh.define((await import("./legacy.js").then((function(t){return t.b}))).dart)}async function $m(){return fh.define((await import("./legacy.js").then((function(t){return t.d}))).gss)}async function Pm(){return fh.define((await import("./legacy.js").then((function(t){return t.g}))).go)}function Zm(){return import("./java.js")}async function Tm(){return fh.define((await import("./legacy.js").then((function(t){return t.b}))).kotlin)}function Xm(){return import("./less.js")}function Cm(){return import("./markdown.js")}function Ym(){return import("./php.js")}function Am(){return import("./python.js")}function Rm(){return import("./sass.js")}async function Wm(){return fh.define((await import("./legacy.js").then((function(t){return t.b}))).scala)}async function Vm(){return fh.define((await import("./legacy.js").then((function(t){return t.s}))).shell)}async function jm(){return import("./svelte.js")}async function qm(){return(await import("./legacy.js").then((function(t){return t.d}))).css}function _m(){return import("./vue.js")}function Em(){return import("./wast.js")}function Mm(){return import("./xml.js")}export{ym as $,ml as A,tl as B,Rc as C,Ja as D,Ih as E,Ga as F,Ra as G,sc as H,jc as I,Vc as J,c as K,_a as L,T as M,o as N,WO as O,C as P,sp as Q,Yc as R,cp as S,la as T,Ac as U,Wr as V,Dd as W,Gh as X,sh as Y,bm as Z,Sm as _,Ha as a,ch as a$,Qm as a0,xm as a1,km as a2,$m as a3,Pm as a4,Zm as a5,Tm as a6,Xm as a7,Cm as a8,Ym as a9,$u as aA,zu as aB,Nf as aC,Bf as aD,zf as aE,Tu as aF,Cu as aG,mf as aH,Qf as aI,vf as aJ,xf as aK,kf as aL,Uf as aM,du as aN,Zu as aO,Xu as aP,Ip as aQ,mp as aR,nh as aS,Al as aT,Ch as aU,Ma as aV,_l as aW,Xl as aX,Ml as aY,pl as aZ,fh as a_,Am as aa,Rm as ab,Wm as ac,Vm as ad,jm as ae,qm as af,_m as ag,Em as ah,Mm as ai,dO as aj,ou as ak,BO as al,JO as am,mO as an,MO as ao,hu as ap,Ou as aq,fO as ar,uu as as,fu as at,pO as au,pf as av,Ku as aw,tf as ax,sf as ay,rf as az,rc as b,Il as b0,nm as b1,hm as b2,ie as b3,ne as b4,gt as b5,wt as b6,Gt as b7,Tt as b8,et as b9,Hn as bA,Bi as bB,x as bC,pa as bD,_e as bE,wm as bF,mt as ba,Se as bb,ve as bc,xe as bd,kt as be,re as bf,se as bg,Vt as bh,N as bi,oe as bj,Ui as bk,eo as bl,Io as bm,Mo as bn,No as bo,mo as bp,ta as bq,ra as br,ho as bs,vo as bt,Wo as bu,yo as bv,Eo as bw,Ao as bx,$o as by,qn as bz,dl as c,Ol as d,gl as e,fl as f,wl as g,Dp as h,rl as i,ip as j,Xc as k,n as l,a as m,O as n,ja as o,A as p,Ea as q,$t as r,Oa as s,Ya as t,We as u,Dt as v,zr as w,Wp as x,ge as y,Wa as z}; +const t=1024;let e=0;class i{constructor(t,e){this.from=t,this.to=e}}class n{constructor(t={}){this.id=e++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof t&&(t=o.match(t)),e=>{let i=t(e);return void 0===i?null:[this,i]}}}n.closedBy=new n({deserialize:t=>t.split(" ")}),n.openedBy=new n({deserialize:t=>t.split(" ")}),n.group=new n({deserialize:t=>t.split(" ")}),n.isolate=new n({deserialize:t=>{if(t&&"rtl"!=t&&"ltr"!=t&&"auto"!=t)throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}}),n.contextHash=new n({perNode:!0}),n.lookAhead=new n({perNode:!0}),n.mounted=new n({perNode:!0});class s{constructor(t,e,i){this.tree=t,this.overlay=e,this.parser=i}static get(t){return t&&t.props&&t.props[n.mounted.id]}}const r=Object.create(null);class o{constructor(t,e,i,n=0){this.name=t,this.props=e,this.id=i,this.flags=n}static define(t){let e=t.props&&t.props.length?Object.create(null):r,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0),n=new o(t.name||"",e,t.id,i);if(t.props)for(let i of t.props)if(Array.isArray(i)||(i=i(n)),i){if(i[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[i[0].id]=i[1]}return n}prop(t){return this.props[t.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(t){if("string"==typeof t){if(this.name==t)return!0;let e=this.prop(n.group);return!!e&&e.indexOf(t)>-1}return this.id==t}static match(t){let e=Object.create(null);for(let i in t)for(let n of i.split(" "))e[n]=t[i];return t=>{for(let i=t.prop(n.group),s=-1;s<(i?i.length:0);s++){let n=e[s<0?t.name:i[s]];if(n)return n}}}}o.none=new o("",Object.create(null),0,8);class a{constructor(t){this.types=t;for(let e=0;e=e){let s=new m(o.tree,o.overlay[0].from+t.from,-1,t);(r||(r=[n])).push(p(s,e,i,!1))}}return r?Q(r):n}(this,t,e)}iterate(t){let{enter:e,leave:i,from:n=0,to:s=this.length}=t,r=t.mode||0,o=(r&c.IncludeAnonymous)>0;for(let t=this.cursor(r|c.IncludeAnonymous);;){let r=!1;if(t.from<=s&&t.to>=n&&(!o&&t.type.isAnonymous||!1!==e(t))){if(t.firstChild())continue;r=!0}for(;r&&i&&(o||!t.type.isAnonymous)&&i(t),!t.nextSibling();){if(!t.parent())return;r=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:Z(o.none,this.children,this.positions,0,this.children.length,0,this.length,((t,e,i)=>new O(this.type,t,e,i,this.propValues)),t.makeTree||((t,e,i)=>new O(o.none,t,e,i)))}static build(e){return function(e){var i;let{buffer:s,nodeSet:r,maxBufferLength:o=t,reused:a=[],minRepeatType:l=r.types.length}=e,h=Array.isArray(s)?new u(s,s.length):s,c=r.types,d=0,p=0;function g(t,e,i,n,s,O){let{id:u,start:v,end:x,size:k}=h,$=p;for(;k<0;){if(h.next(),-1==k){let e=a[u];return i.push(e),void n.push(v-t)}if(-3==k)return void(d=u);if(-4==k)return void(p=u);throw new RangeError(`Unrecognized record size: ${k}`)}let P,T,X=c[u],C=v-t;if(x-v<=o&&(T=S(h.pos-e,s))){let e=new Uint16Array(T.size-T.skip),i=h.pos-T.size,n=e.length;for(;h.pos>i;)n=Q(T.start,e,n);P=new f(e,x-T.start,r),C=T.start-t}else{let t=h.pos-k;h.next();let e=[],i=[],n=u>=l?u:-1,s=0,r=x;for(;h.pos>t;)n>=0&&h.id==n&&h.size>=0?(h.end<=r-o&&(w(e,i,v,s,h.end,r,n,$),s=e.length,r=h.end),h.next()):O>2500?m(v,t,e,i):g(v,t,e,i,n,O+1);if(n>=0&&s>0&&s-1&&s>0){let t=b(X);P=Z(X,e,i,0,e.length,0,x-v,t,t)}else P=y(X,e,i,x-v,$-x)}i.push(P),n.push(C)}function m(t,e,i,n){let s=[],a=0,l=-1;for(;h.pos>e;){let{id:t,start:e,end:i,size:n}=h;if(n>4)h.next();else{if(l>-1&&e=0;t-=3)e[i++]=s[t],e[i++]=s[t+1]-o,e[i++]=s[t+2]-o,e[i++]=i;i.push(new f(e,s[2]-o,r)),n.push(o-t)}}function b(t){return(e,i,s)=>{let r,o,a=0,l=e.length-1;if(l>=0&&(r=e[l])instanceof O){if(!l&&r.type==t&&r.length==s)return r;(o=r.prop(n.lookAhead))&&(a=i[l]+r.length+o)}return y(t,e,i,s,a)}}function w(t,e,i,n,s,o,a,l){let h=[],c=[];for(;t.length>n;)h.push(t.pop()),c.push(e.pop()+i-s);t.push(y(r.types[a],h,c,o-s,l-o)),e.push(s-i)}function y(t,e,i,s,r=0,o){if(d){let t=[n.contextHash,d];o=o?[t].concat(o):[t]}if(r>25){let t=[n.lookAhead,r];o=o?[t].concat(o):[t]}return new O(t,e,i,s,o)}function S(t,e){let i=h.fork(),n=0,s=0,r=0,a=i.end-o,c={size:0,start:0,skip:0};t:for(let o=i.pos-t;i.pos>o;){let t=i.size;if(i.id==e&&t>=0){c.size=n,c.start=s,c.skip=r,r+=4,n+=4,i.next();continue}let h=i.pos-t;if(t<0||h=l?4:0,u=i.start;for(i.next();i.pos>h;){if(i.size<0){if(-3!=i.size)break t;O+=4}else i.id>=l&&(O+=4);i.next()}s=u,n+=t,r+=O}return(e<0||n==t)&&(c.size=n,c.start=s,c.skip=r),c.size>4?c:void 0}function Q(t,e,i){let{id:n,start:s,end:r,size:o}=h;if(h.next(),o>=0&&n4){let n=h.pos-(o-4);for(;h.pos>n;)i=Q(t,e,i)}e[--i]=a,e[--i]=r-t,e[--i]=s-t,e[--i]=n}else-3==o?d=n:-4==o&&(p=n);return i}let v=[],x=[];for(;h.pos>0;)g(e.start||0,e.bufferStart||0,v,x,-1,0);let k=null!==(i=e.length)&&void 0!==i?i:v.length?x[0]+v[0].length:0;return new O(c[e.topID],v.reverse(),x.reverse(),k)}(e)}}O.empty=new O(o.none,[],[],0);class u{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new u(this.buffer,this.index)}}class f{constructor(t,e,i){this.buffer=t,this.length=e,this.set=i}get type(){return o.none}toString(){let t=[];for(let e=0;e0));a=r[a+3]);return o}slice(t,e,i){let n=this.buffer,s=new Uint16Array(e-t),r=0;for(let o=t,a=0;o=e&&ie;case 1:return i<=e&&n>e;case 2:return n>e;case 4:return!0}}function p(t,e,i,n){for(var s;t.from==t.to||(i<1?t.from>=e:t.from>e)||(i>-1?t.to<=e:t.to0?a.length:-1;t!=h;t+=e){let h=a[t],O=l[t]+o.from;if(d(n,i,O,O+h.length))if(h instanceof f){if(r&c.ExcludeBuffers)continue;let s=h.findChild(0,h.buffer.length,e,i-O,n);if(s>-1)return new S(new y(o,h,t,O),null,s)}else if(r&c.IncludeAnonymous||!h.type.isAnonymous||k(h)){let a;if(!(r&c.IgnoreMounts)&&(a=s.get(h))&&!a.overlay)return new m(a.tree,O,t,o);let l=new m(h,O,t,o);return r&c.IncludeAnonymous||!l.type.isAnonymous?l:l.nextChild(e<0?h.children.length-1:0,e,i,n)}}if(r&c.IncludeAnonymous||!o.type.isAnonymous)return null;if(t=o.index>=0?o.index+e:e<0?-1:o._parent._tree.children.length,o=o._parent,!o)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}enter(t,e,i=0){let n;if(!(i&c.IgnoreOverlays)&&(n=s.get(this._tree))&&n.overlay){let i=t-this.from;for(let{from:t,to:s}of n.overlay)if((e>0?t<=i:t=i:s>i))return new m(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function b(t,e,i,n){let s=t.cursor(),r=[];if(!s.firstChild())return r;if(null!=i)for(let t=!1;!t;)if(t=s.type.is(i),!s.nextSibling())return r;for(;;){if(null!=n&&s.type.is(n))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return null==n?r:[]}}function w(t,e,i=e.length-1){for(let n=t.parent;i>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[i]&&e[i]!=n.name)return!1;i--}}return!0}class y{constructor(t,e,i,n){this.parent=t,this.buffer=e,this.index=i,this.start=n}}class S extends g{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(t,e,i){super(),this.context=t,this._parent=e,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,e,i){let{buffer:n}=this.context,s=n.findChild(this.index+4,n.buffer[this.index+3],t,e-this.context.start,i);return s<0?null:new S(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}enter(t,e,i=0){if(i&c.ExcludeBuffers)return null;let{buffer:n}=this.context,s=n.findChild(this.index+4,n.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return s<0?null:new S(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new S(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new S(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:i}=this.context,n=this.index+4,s=i.buffer[this.index+3];if(s>n){let r=i.buffer[this.index+1];t.push(i.slice(n,s,r)),e.push(0)}return new O(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Q(t){if(!t.length)return null;let e=0,i=t[0];for(let n=1;ni.from||s.to0){if(this.index-1)for(let n=e+t,s=t<0?-1:i._tree.children.length;n!=s;n+=t){let t=i._tree.children[n];if(this.mode&c.IncludeAnonymous||t instanceof f||!t.type.isAnonymous||k(t))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to=0;){for(let r=t;r;r=r._parent)if(r.index==n){if(n==this.index)return r;e=r,i=s+1;break t}n=this.stack[--s]}for(let t=i;t=0;s--){if(s<0)return w(this.node,t,n);let r=i[e.buffer[this.stack[s]]];if(!r.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}}function k(t){return t.children.some((t=>t instanceof f||!t.type.isAnonymous||k(t)))}const $=new WeakMap;function P(t,e){if(!t.isAnonymous||e instanceof f||e.type!=t)return 1;let i=$.get(e);if(null==i){i=1;for(let n of e.children){if(n.type!=t||!(n instanceof O)){i=1;break}i+=P(t,n)}$.set(e,i)}return i}function Z(t,e,i,n,s,r,o,a,l){let h=0;for(let i=n;i=c)break;d+=e}if(h==s+1){if(d>c){let t=i[s];e(t.children,t.positions,0,t.children.length,n[s]+a);continue}O.push(i[s])}else{let e=n[h-1]+i[h-1].length-f;O.push(Z(t,i,n,s,h,f,e,null,l))}u.push(f+a-r)}}(e,i,n,s,0),(a||l)(O,u,o)}class T{constructor(){this.map=new WeakMap}setBuffer(t,e,i){let n=this.map.get(t);n||this.map.set(t,n=new Map),n.set(e,i)}getBuffer(t,e){let i=this.map.get(t);return i&&i.get(e)}set(t,e){t instanceof S?this.setBuffer(t.context.buffer,t.index,e):t instanceof m&&this.map.set(t.tree,e)}get(t){return t instanceof S?this.getBuffer(t.context.buffer,t.index):t instanceof m?this.map.get(t.tree):void 0}cursorSet(t,e){t.buffer?this.setBuffer(t.buffer.buffer,t.index,e):this.map.set(t.tree,e)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class X{constructor(t,e,i,n,s=!1,r=!1){this.from=t,this.to=e,this.tree=i,this.offset=n,this.open=(s?1:0)|(r?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(t,e=[],i=!1){let n=[new X(0,t.length,t,0,!1,i)];for(let i of e)i.to>t.length&&n.push(i);return n}static applyChanges(t,e,i=128){if(!e.length)return t;let n=[],s=1,r=t.length?t[0]:null;for(let o=0,a=0,l=0;;o++){let h=o=i)for(;r&&r.from=e.from||c<=e.to||l){let t=Math.max(e.from,a)-l,i=Math.min(e.to,c)-l;e=t>=i?null:new X(t,i,e.tree,e.offset+l,o>0,!!h)}if(e&&n.push(e),r.to>c)break;r=snew i(t.from,t.to))):[new i(0,0)]:[new i(0,t.length)],this.createParse(t,e||[],n)}parse(t,e,i){let n=this.startParse(t,e,i);for(;;){let t=n.advance();if(t)return t}}}class A{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}}function R(t){return(e,i,n,s)=>new V(e,t,i,n,s)}class W{constructor(t,e,i,n,s){this.parser=t,this.parse=e,this.overlay=i,this.target=n,this.from=s}}function q(t){if(!t.length||t.some((t=>t.from>=t.to)))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class Y{constructor(t,e,i,n,s,r,o){this.parser=t,this.predicate=e,this.mounts=i,this.index=n,this.start=s,this.target=r,this.prev=o,this.depth=0,this.ranges=[]}}const _=new n({perNode:!0});class V{constructor(t,e,i,n,s){this.nest=e,this.input=i,this.fragments=n,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t}advance(){if(this.baseParse){let t=this.baseParse.advance();if(!t)return null;if(this.baseParse=null,this.baseTree=t,this.startInner(),null!=this.stoppedAt)for(let t of this.inner)t.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let t=this.baseTree;return null!=this.stoppedAt&&(t=new O(t.type,t.children,t.positions,t.length,t.propValues.concat([[_,this.stoppedAt]]))),t}let t=this.inner[this.innerDone],e=t.parse.advance();if(e){this.innerDone++;let i=Object.assign(Object.create(null),t.target.props);i[n.mounted.id]=new s(e,t.overlay,t.parser),t.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let t=this.input.length;for(let e=this.innerDone;e=this.stoppedAt)l=!1;else if(t.hasNode(s)){if(e){let t=e.mounts.find((t=>t.frag.from<=s.from&&t.frag.to>=s.to&&t.mount.overlay));if(t)for(let i of t.mount.overlay){let n=i.from+t.pos,r=i.to+t.pos;n>=s.from&&r<=s.to&&!e.ranges.some((t=>t.fromn))&&e.ranges.push({from:n,to:r})}}l=!1}else if(n&&(o=M(n.ranges,s.from,s.to)))l=2!=o;else if(!s.type.isAnonymous&&(r=this.nest(s,this.input))&&(s.fromnew i(t.from-s.from,t.to-s.from))):null,s.tree,t.length?t[0].from:s.from)),r.overlay?t.length&&(n={ranges:t,depth:0,prev:n}):l=!1}}else e&&(a=e.predicate(s))&&(!0===a&&(a=new i(s.from,s.to)),a.fromnew i(t.from-e.start,t.to-e.start))),e.target,t[0].from))),e=e.prev}n&&! --n.depth&&(n=n.prev)}}}}function M(t,e,i){for(let n of t){if(n.from>=i)break;if(n.to>e)return n.from<=e&&n.to>=i?2:1}return 0}function E(t,e,i,n,s,r){if(e=t&&e.enter(i,1,c.IgnoreOverlays|c.ExcludeBuffers)||e.next(!1)||(this.done=!0)}hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(let e=this.cursor.tree;;){if(e==t.tree)return!0;if(!(e.children.length&&0==e.positions[0]&&e.children[0]instanceof O))break;e=e.children[0]}return!1}}class z{constructor(t){var e;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){let i=this.curFrag=t[0];this.curTo=null!==(e=i.tree.prop(_))&&void 0!==e?e:i.to,this.inner=new D(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t)}nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=null!==(t=e.tree.prop(_))&&void 0!==t?t:e.to,this.inner=new D(e.tree,-e.offset)}}findMounts(t,e){var i;let s=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(let t=this.inner.cursor.node;t;t=t.parent){let r=null===(i=t.tree)||void 0===i?void 0:i.prop(n.mounted);if(r&&r.parser==e)for(let e=this.fragI;e=t.to)break;i.tree==this.curFrag.tree&&s.push({frag:i,pos:t.from-i.offset,mount:r})}}}return s}}function G(t,e){let n=null,s=e;for(let r=1,o=0;r=l)break;t.to<=a||(n||(s=n=e.slice()),t.froml&&n.splice(o+1,0,new i(l,t.to))):t.to>l?n[o--]=new i(l,t.to):n.splice(o--,1))}}return s}function I(t,e,n,s){let r=0,o=0,a=!1,l=!1,h=-1e9,c=[];for(;;){let O=r==t.length?1e9:a?t[r].to:t[r].from,u=o==e.length?1e9:l?e[o].to:e[o].from;if(a!=l){let t=Math.max(h,n),e=Math.min(O,u,s);tnew i(t.from+s,t.to+s))),l,h);for(let e=0,i=l;;e++){let s=e==a.length,l=s?h:a[e].from;if(l>i&&n.push(new X(i,l,r.tree,-t,o.from>=i||o.openStart,o.to<=l||o.openEnd)),s)break;i=a[e].to}}else n.push(new X(l,h,r.tree,-t,o.from>=t||o.openStart,o.to<=a||o.openEnd))}return n}class N{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,i){[t,e]=it(this,t,e);let n=[];return this.decompose(0,t,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(e,this.length,n,1),L.from(n,this.length-(e-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=it(this,t,e);let i=[];return this.decompose(t,e,i,0),L.from(i,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),n=new J(this),s=new J(t);for(let t=e,r=e;;){if(n.next(t),s.next(t),t=0,n.lineBreak!=s.lineBreak||n.done!=s.done||n.value!=s.value)return!1;if(r+=n.value.length,n.done||r>=i)return!0}}iter(t=1){return new J(this,t)}iterRange(t,e=this.length){return new K(this,t,e)}iterLines(t,e){let i;if(null==t)i=this.iter();else{null==e&&(e=this.lines+1);let n=this.line(t).from;i=this.iterRange(n,Math.max(n,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new tt(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new U(t):L.from(U.split(t,[])):N.empty}}class U extends N{constructor(t,e=function(t){let e=-1;for(let i of t)e+=i.length+1;return e}(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,i,n){for(let s=0;;s++){let r=this.text[s],o=n+r.length;if((e?i:o)>=t)return new et(n,o,i,r);n=o+1,i++}}decompose(t,e,i,n){let s=t<=0&&e>=this.length?this:new U(H(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&n){let t=i.pop(),e=F(s.text,t.text.slice(),0,s.length);if(e.length<=32)i.push(new U(e,t.length+s.length));else{let t=e.length>>1;i.push(new U(e.slice(0,t)),new U(e.slice(t)))}}else i.push(s)}replace(t,e,i){if(!(i instanceof U))return super.replace(t,e,i);[t,e]=it(this,t,e);let n=F(this.text,F(i.text,H(this.text,0,t)),e),s=this.length+i.length-(e-t);return n.length<=32?new U(n,s):L.from(U.split(n,[]),s)}sliceString(t,e=this.length,i="\n"){[t,e]=it(this,t,e);let n="";for(let s=0,r=0;s<=e&&rt&&r&&(n+=i),ts&&(n+=o.slice(Math.max(0,t-s),e-s)),s=a+1}return n}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let i=[],n=-1;for(let s of t)i.push(s),n+=s.length+1,32==i.length&&(e.push(new U(i,n)),i=[],n=-1);return n>-1&&e.push(new U(i,n)),e}}class L extends N{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let e of t)this.lines+=e.lines}lineInner(t,e,i,n){for(let s=0;;s++){let r=this.children[s],o=n+r.length,a=i+r.lines-1;if((e?a:o)>=t)return r.lineInner(t,e,i,n);n=o+1,i=a+1}}decompose(t,e,i,n){for(let s=0,r=0;r<=e&&s=r){let s=n&((r<=t?1:0)|(a>=e?2:0));r>=t&&a<=e&&!s?i.push(o):o.decompose(t-r,e-r,i,s)}r=a+1}}replace(t,e,i){if([t,e]=it(this,t,e),i.lines=s&&e<=o){let a=r.replace(t-s,e-s,i),l=this.lines-r.lines+a.lines;if(a.lines>4&&a.lines>l>>6){let s=this.children.slice();return s[n]=a,new L(s,this.length-(e-t)+i.length)}return super.replace(s,o,a)}s=o+1}return super.replace(t,e,i)}sliceString(t,e=this.length,i="\n"){[t,e]=it(this,t,e);let n="";for(let s=0,r=0;st&&s&&(n+=i),tr&&(n+=o.sliceString(t-r,e-r,i)),r=a+1}return n}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof L))return 0;let i=0,[n,s,r,o]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;n+=e,s+=e){if(n==r||s==o)return i;let a=this.children[n],l=t.children[s];if(a!=l)return i+a.scanIdentical(l,e);i+=a.length+1}}static from(t,e=t.reduce(((t,e)=>t+e.length+1),-1)){let i=0;for(let e of t)i+=e.lines;if(i<32){let i=[];for(let e of t)e.flatten(i);return new U(i,e)}let n=Math.max(32,i>>5),s=n<<1,r=n>>1,o=[],a=0,l=-1,h=[];function c(t){let e;if(t.lines>s&&t instanceof L)for(let e of t.children)c(e);else t.lines>r&&(a>r||!a)?(O(),o.push(t)):t instanceof U&&a&&(e=h[h.length-1])instanceof U&&t.lines+e.lines<=32?(a+=t.lines,l+=t.length+1,h[h.length-1]=new U(e.text.concat(t.text),e.length+1+t.length)):(a+t.lines>n&&O(),a+=t.lines,l+=t.length+1,h.push(t))}function O(){0!=a&&(o.push(1==h.length?h[0]:L.from(h,l)),l=-1,a=h.length=0)}for(let e of t)c(e);return O(),1==o.length?o[0]:new L(o,e)}}function F(t,e,i=0,n=1e9){for(let s=0,r=0,o=!0;r=i&&(l>n&&(a=a.slice(0,n-s)),s0?1:(t instanceof U?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],s=this.offsets[i],r=s>>1,o=n instanceof U?n.text.length:n.children.length;if(r==(e>0?o:0)){if(0==i)return this.done=!0,this.value="",this;e>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&s)==(e>0?0:1)){if(this.offsets[i]+=e,0==t)return this.lineBreak=!0,this.value="\n",this;t--}else if(n instanceof U){let s=n.text[r+(e<0?-1:0)];if(this.offsets[i]+=e,s.length>Math.max(0,t))return this.value=0==t?s:e>0?s.slice(t):s.slice(0,s.length-t),this;t-=s.length}else{let s=n.children[r+(e<0?-1:0)];t>s.length?(t-=s.length,this.offsets[i]+=e):(e<0&&this.offsets[i]--,this.nodes.push(s),this.offsets.push(e>0?1:(s instanceof U?s.text.length:s.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class K{constructor(t,e,i){this.value="",this.done=!1,this.cursor=new J(t,e>i?-1:1),this.pos=e>i?t.length:0,this.from=Math.min(e,i),this.to=Math.max(e,i)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let i=e<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:n}=this.cursor.next(t);return this.pos+=(n.length+t)*e,this.value=n.length<=i?n:e<0?n.slice(n.length-i):n.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class tt{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:i,value:n}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(N.prototype[Symbol.iterator]=function(){return this.iter()},J.prototype[Symbol.iterator]=K.prototype[Symbol.iterator]=tt.prototype[Symbol.iterator]=function(){return this});class et{constructor(t,e,i,n){this.from=t,this.to=e,this.number=i,this.text=n}get length(){return this.to-this.from}}function it(t,e,i){return[e=Math.max(0,Math.min(t.length,e)),Math.max(e,Math.min(t.length,i))]}let nt="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((t=>t?parseInt(t,36):1));for(let t=1;tt)return nt[e-1]<=t;return!1}function rt(t){return t>=127462&&t<=127487}const ot=8205;function at(t,e,i=!0,n=!0){return(i?lt:ht)(t,e,n)}function lt(t,e,i){if(e==t.length)return e;e&&ct(t.charCodeAt(e))&&Ot(t.charCodeAt(e-1))&&e--;let n=ut(t,e);for(e+=dt(n);e=0&&rt(ut(t,n));)i++,n-=2;if(i%2==0)break;e+=2}}}return e}function ht(t,e,i){for(;e>0;){let n=lt(t,e-2,i);if(n=56320&&t<57344}function Ot(t){return t>=55296&&t<56320}function ut(t,e){let i=t.charCodeAt(e);if(!Ot(i)||e+1==t.length)return i;let n=t.charCodeAt(e+1);return ct(n)?n-56320+(i-55296<<10)+65536:i}function ft(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}function dt(t){return t<65536?1:2}const pt=/\r\n?|\n/;var gt=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(gt||(gt={}));class mt{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;et)return s+(t-n);s+=o}else{if(i!=gt.Simple&&l>=t&&(i==gt.TrackDel&&nt||i==gt.TrackBefore&&nt))return null;if(l>t||l==t&&e<0&&!o)return t==n||e<0?s:s+a;s+=a}n=l}if(t>n)throw new RangeError(`Position ${t} is out of range for changeset of length ${n}`);return s}touchesRange(t,e=t){for(let i=0,n=0;i=0&&n<=e&&s>=t)return!(ne)||"cover";n=s}return!1}toString(){let t="";for(let e=0;e=0?":"+n:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some((t=>"number"!=typeof t)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new mt(t)}static create(t){return new mt(t)}}class bt extends mt{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return St(this,((e,i,n,s,r)=>t=t.replace(n,n+(i-e),r)),!1),t}mapDesc(t,e=!1){return Qt(this,t,e,!0)}invert(t){let e=this.sections.slice(),i=[];for(let n=0,s=0;n=0){e[n]=o,e[n+1]=r;let a=n>>1;for(;i.length0&&yt(i,e,s.text),s.forward(t),o+=t}let l=t[r++];for(;o>1].toJSON()))}return t}static of(t,e,i){let n=[],s=[],r=0,o=null;function a(t=!1){if(!t&&!n.length)return;ro||t<0||o>e)throw new RangeError(`Invalid change range ${t} to ${o} (in doc of length ${e})`);let c=h?"string"==typeof h?N.of(h.split(i||pt)):h:N.empty,O=c.length;if(t==o&&0==O)return;tr&&wt(n,t-r,-1),wt(n,o-t,O),yt(s,n,c),r=o}}(t),a(!o),o}static empty(t){return new bt(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],i=[];for(let n=0;ne&&"string"!=typeof t)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==s.length)e.push(s[0],0);else{for(;i.length=0&&i<=0&&i==t[s+1]?t[s]+=e:0==e&&0==t[s]?t[s+1]+=i:n?(t[s]+=e,t[s+1]+=i):t.push(e,i)}function yt(t,e,i){if(0==i.length)return;let n=e.length-2>>1;if(n>1])),!(i||o==t.sections.length||t.sections[o+1]<0);)a=t.sections[o++],l=t.sections[o++];e(s,h,r,c,O),s=h,r=c}}}function Qt(t,e,i,n=!1){let s=[],r=n?[]:null,o=new xt(t),a=new xt(e);for(let t=-1;;)if(-1==o.ins&&-1==a.ins){let t=Math.min(o.len,a.len);wt(s,t,-1),o.forward(t),a.forward(t)}else if(a.ins>=0&&(o.ins<0||t==o.i||0==o.off&&(a.len=0&&t=0)){if(o.done&&a.done)return r?bt.createSet(s,r):mt.create(s);throw new Error("Mismatched change set lengths")}{let e=0,i=o.len;for(;i;)if(-1==a.ins){let t=Math.min(i,a.len);e+=t,i-=t,a.forward(t)}else{if(!(0==a.ins&&a.lene||o.ins>=0&&o.len>e)&&(t||n.length>i),r.forward2(e),o.forward(e)}}else wt(n,0,o.ins,t),s&&yt(s,n,o.text),o.next()}}class xt{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return e>=t.length?N.empty:t[e]}textBit(t){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length&&!t?N.empty:e[i].slice(this.off,null==t?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class kt{constructor(t,e,i){this.from=t,this.to=e,this.flags=i}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let t=7&this.flags;return 7==t?null:t}get goalColumn(){let t=this.flags>>6;return 16777215==t?void 0:t}map(t,e=-1){let i,n;return this.empty?i=n=t.mapPos(this.from,e):(i=t.mapPos(this.from,1),n=t.mapPos(this.to,-1)),i==this.from&&n==this.to?this:new kt(i,n,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return $t.range(t,e);let i=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return $t.range(this.anchor,i)}eq(t,e=!1){return!(this.anchor!=t.anchor||this.head!=t.head||e&&this.empty&&this.assoc!=t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return $t.range(t.anchor,t.head)}static create(t,e,i){return new kt(t,e,i)}}class $t{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:$t.create(this.ranges.map((i=>i.map(t,e))),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;it.toJSON())),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new $t(t.ranges.map((t=>kt.fromJSON(t))),t.main)}static single(t,e=t){return new $t([$t.range(t,e)],0)}static create(t,e=0){if(0==t.length)throw new RangeError("A selection needs at least one range");for(let i=0,n=0;nt?8:0)|s)}static normalized(t,e=0){let i=t[e];t.sort(((t,e)=>t.from-e.from)),e=t.indexOf(i);for(let i=1;in.head?$t.range(o,r):$t.range(r,o))}}return new $t(t,e)}}function Pt(t,e){for(let i of t.ranges)if(i.to>e)throw new RangeError("Selection points outside of document")}let Zt=0;class Tt{constructor(t,e,i,n,s){this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=n,this.id=Zt++,this.default=t([]),this.extensions="function"==typeof s?s(this):s}get reader(){return this}static define(t={}){return new Tt(t.combine||(t=>t),t.compareInput||((t,e)=>t===e),t.compare||(t.combine?(t,e)=>t===e:Xt),!!t.static,t.enables)}of(t){return new Ct([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ct(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ct(t,this,2,e)}from(t,e){return e||(e=t=>t),this.compute([t],(i=>e(i.field(t))))}}function Xt(t,e){return t==e||t.length==e.length&&t.every(((t,i)=>t===e[i]))}class Ct{constructor(t,e,i,n){this.dependencies=t,this.facet=e,this.type=i,this.value=n,this.id=Zt++}dynamicSlot(t){var e;let i=this.value,n=this.facet.compareInput,s=this.id,r=t[s]>>1,o=2==this.type,a=!1,l=!1,h=[];for(let i of this.dependencies)"doc"==i?a=!0:"selection"==i?l=!0:1&(null!==(e=t[i.id])&&void 0!==e?e:1)||h.push(t[i.id]);return{create:t=>(t.values[r]=i(t),1),update(t,e){if(a&&e.docChanged||l&&(e.docChanged||e.selection)||Rt(t,h)){let e=i(t);if(o?!At(e,t.values[r],n):!n(e,t.values[r]))return t.values[r]=e,1}return 0},reconfigure:(t,e)=>{let a,l=e.config.address[s];if(null!=l){let s=Ut(e,l);if(this.dependencies.every((i=>i instanceof Tt?e.facet(i)===t.facet(i):!(i instanceof Yt)||e.field(i,!1)==t.field(i,!1)))||(o?At(a=i(t),s,n):n(a=i(t),s)))return t.values[r]=s,0}else a=i(t);return t.values[r]=a,1}}}}function At(t,e,i){if(t.length!=e.length)return!1;for(let n=0;nt[e.id])),s=i.map((t=>t.type)),r=n.filter((t=>!(1&t))),o=t[e.id]>>1;function a(t){let i=[];for(let e=0;et===e),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(qt).find((t=>t.field==this));return((null==e?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:t=>(t.values[e]=this.create(t),1),update:(t,i)=>{let n=t.values[e],s=this.updateF(n,i);return this.compareF(n,s)?0:(t.values[e]=s,1)},reconfigure:(t,i)=>null!=i.config.address[this.id]?(t.values[e]=i.field(this),0):(t.values[e]=this.create(t),1)}}init(t){return[this,qt.of({field:this,create:t})]}get extension(){return this}}const _t=4,Vt=3,Mt=2,Et=1;function jt(t){return e=>new zt(e,t)}const Dt={highest:jt(0),high:jt(Et),default:jt(Mt),low:jt(Vt),lowest:jt(_t)};class zt{constructor(t,e){this.inner=t,this.prec=e}}class Gt{of(t){return new It(this,t)}reconfigure(t){return Gt.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class It{constructor(t,e){this.compartment=t,this.inner=e}}class Bt{constructor(t,e,i,n,s,r){for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=n,this.staticValues=s,this.facets=r,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,e,i){let n=[],s=Object.create(null),r=new Map;for(let i of function(t,e,i){let n=[[],[],[],[],[]],s=new Map;function r(t,o){let a=s.get(t);if(null!=a){if(a<=o)return;let e=n[a].indexOf(t);e>-1&&n[a].splice(e,1),t instanceof It&&i.delete(t.compartment)}if(s.set(t,o),Array.isArray(t))for(let e of t)r(e,o);else if(t instanceof It){if(i.has(t.compartment))throw new RangeError("Duplicate use of compartment in extensions");let n=e.get(t.compartment)||t.inner;i.set(t.compartment,n),r(n,o)}else if(t instanceof zt)r(t.inner,t.prec);else if(t instanceof Yt)n[o].push(t),t.provides&&r(t.provides,o);else if(t instanceof Ct)n[o].push(t),t.facet.extensions&&r(t.facet.extensions,Mt);else{let e=t.extension;if(!e)throw new Error(`Unrecognized extension value in extension set (${t}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(e,o)}}return r(t,Mt),n.reduce(((t,e)=>t.concat(e)))}(t,e,r))i instanceof Yt?n.push(i):(s[i.facet.id]||(s[i.facet.id]=[])).push(i);let o=Object.create(null),a=[],l=[];for(let t of n)o[t.id]=l.length<<1,l.push((e=>t.slot(e)));let h=null==i?void 0:i.config.facets;for(let t in s){let e=s[t],n=e[0].facet,r=h&&h[t]||[];if(e.every((t=>0==t.type)))if(o[n.id]=a.length<<1|1,Xt(r,e))a.push(i.facet(n));else{let t=n.combine(e.map((t=>t.value)));a.push(i&&n.compare(t,i.facet(n))?i.facet(n):t)}else{for(let t of e)0==t.type?(o[t.id]=a.length<<1|1,a.push(t.value)):(o[t.id]=l.length<<1,l.push((e=>t.dynamicSlot(e))));o[n.id]=l.length<<1,l.push((t=>Wt(t,n,e)))}}let c=l.map((t=>t(o)));return new Bt(t,r,c,o,a,s)}}function Nt(t,e){if(1&e)return 2;let i=e>>1,n=t.status[i];if(4==n)throw new Error("Cyclic dependency between fields and/or facets");if(2&n)return n;t.status[i]=4;let s=t.computeSlot(t,t.config.dynamicSlots[i]);return t.status[i]=2|s}function Ut(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1]}const Lt=Tt.define(),Ft=Tt.define({combine:t=>t.some((t=>t)),static:!0}),Ht=Tt.define({combine:t=>t.length?t[0]:void 0,static:!0}),Jt=Tt.define(),Kt=Tt.define(),te=Tt.define(),ee=Tt.define({combine:t=>!!t.length&&t[0]});class ie{constructor(t,e){this.type=t,this.value=e}static define(){return new ne}}class ne{of(t){return new ie(this,t)}}class se{constructor(t){this.map=t}of(t){return new re(this,t)}}class re{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return void 0===e?void 0:e==this.value?this:new re(this.type,e)}is(t){return this.type==t}static define(t={}){return new se(t.map||(t=>t))}static mapEffects(t,e){if(!t.length)return t;let i=[];for(let n of t){let t=n.map(e);t&&i.push(t)}return i}}re.reconfigure=re.define(),re.appendConfig=re.define();class oe{constructor(t,e,i,n,s,r){this.startState=t,this.changes=e,this.selection=i,this.effects=n,this.annotations=s,this.scrollIntoView=r,this._doc=null,this._state=null,i&&Pt(i,e.newLength),s.some((t=>t.type==oe.time))||(this.annotations=s.concat(oe.time.of(Date.now())))}static create(t,e,i,n,s,r){return new oe(t,e,i,n,s,r)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(oe.userEvent);return!(!e||!(e==t||e.length>t.length&&e.slice(0,t.length)==t&&"."==e[t.length]))}}function ae(t,e){let i=[];for(let n=0,s=0;;){let r,o;if(n=t[n]))r=t[n++],o=t[n++];else{if(!(s=0;s--){let r=i[s](t);r&&Object.keys(r).length&&(n=le(n,he(e,r,t.changes.newLength),!0))}return n==t?t:oe.create(e,t.changes,t.selection,n.effects,n.annotations,n.scrollIntoView)}(i?function(t){let e=t.startState,i=!0;for(let n of e.facet(Jt)){let e=n(t);if(!1===e){i=!1;break}Array.isArray(e)&&(i=!0===i?e:ae(i,e))}if(!0!==i){let n,s;if(!1===i)s=t.changes.invertedDesc,n=bt.empty(e.doc.length);else{let e=t.changes.filter(i);n=e.changes,s=e.filtered.mapDesc(e.changes).invertedDesc}t=oe.create(e,n,t.selection&&t.selection.map(s),re.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let n=e.facet(Kt);for(let i=n.length-1;i>=0;i--){let s=n[i](t);t=s instanceof oe?s:Array.isArray(s)&&1==s.length&&s[0]instanceof oe?s[0]:ce(e,ue(s),!1)}return t}(s):s)}oe.time=ie.define(),oe.userEvent=ie.define(),oe.addToHistory=ie.define(),oe.remote=ie.define();const Oe=[];function ue(t){return null==t?Oe:Array.isArray(t)?t:[t]}var fe=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(fe||(fe={}));const de=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let pe;try{pe=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(t){}function ge(t){return e=>{if(!/\S/.test(e))return fe.Space;if(function(t){if(pe)return pe.test(t);for(let e=0;e"€"&&(i.toUpperCase()!=i.toLowerCase()||de.test(i)))return!0}return!1}(e))return fe.Word;for(let i=0;i-1)return fe.Word;return fe.Other}}class me{constructor(t,e,i,n,s,r){this.config=t,this.doc=e,this.selection=i,this.values=n,this.status=t.statusTemplate.slice(),this.computeSlot=s,r&&(r._state=this);for(let t=0;ts.set(e,t))),i=null),s.set(e.value.compartment,e.value.extension)):e.is(re.reconfigure)?(i=null,n=e.value):e.is(re.appendConfig)&&(i=null,n=ue(n).concat(e.value));if(i)e=t.startState.values.slice();else{i=Bt.resolve(n,s,this),e=new me(i,this.doc,this.selection,i.dynamicSlots.map((()=>null)),((t,e)=>e.reconfigure(t,this)),null).values}let r=t.startState.facet(Ft)?t.newSelection:t.newSelection.asSingle();new me(i,t.newDoc,r,e,((e,i)=>i.update(e,t)),t)}replaceSelection(t){return"string"==typeof t&&(t=this.toText(t)),this.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:t},range:$t.cursor(e.from+t.length)})))}changeByRange(t){let e=this.selection,i=t(e.ranges[0]),n=this.changes(i.changes),s=[i.range],r=ue(i.effects);for(let i=1;is.spec.fromJSON(r,t))))}return me.create({doc:t.doc,selection:$t.fromJSON(t.selection),extensions:e.extensions?n.concat([e.extensions]):n})}static create(t={}){let e=Bt.resolve(t.extensions||[],new Map),i=t.doc instanceof N?t.doc:N.of((t.doc||"").split(e.staticFacet(me.lineSeparator)||pt)),n=t.selection?t.selection instanceof $t?t.selection:$t.single(t.selection.anchor,t.selection.head):$t.single(0);return Pt(n,i.length),e.staticFacet(Ft)||(n=n.asSingle()),new me(e,i,n,e.dynamicSlots.map((()=>null)),((t,e)=>e.create(t)),null)}get tabSize(){return this.facet(me.tabSize)}get lineBreak(){return this.facet(me.lineSeparator)||"\n"}get readOnly(){return this.facet(ee)}phrase(t,...e){for(let e of this.facet(me.phrases))if(Object.prototype.hasOwnProperty.call(e,t)){t=e[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,((t,i)=>{if("$"==i)return"$";let n=+(i||1);return!n||n>e.length?t:e[n-1]}))),t}languageDataAt(t,e,i=-1){let n=[];for(let s of this.facet(Lt))for(let r of s(this,e,i))Object.prototype.hasOwnProperty.call(r,t)&&n.push(r[t]);return n}charCategorizer(t){return ge(this.languageDataAt("wordChars",t).join(""))}wordAt(t){let{text:e,from:i,length:n}=this.doc.lineAt(t),s=this.charCategorizer(t),r=t-i,o=t-i;for(;r>0;){let t=at(e,r,!1);if(s(e.slice(t,r))!=fe.Word)break;r=t}for(;ot.length?t[0]:4}),me.lineSeparator=Ht,me.readOnly=ee,me.phrases=Tt.define({compare(t,e){let i=Object.keys(t),n=Object.keys(e);return i.length==n.length&&i.every((i=>t[i]==e[i]))}}),me.languageData=Lt,me.changeFilter=Jt,me.transactionFilter=Kt,me.transactionExtender=te,Gt.reconfigure=re.define();class we{eq(t){return this==t}range(t,e=t){return ye.create(t,e,this)}}we.prototype.startSide=we.prototype.endSide=0,we.prototype.point=!1,we.prototype.mapMode=gt.TrackDel;class ye{constructor(t,e,i){this.from=t,this.to=e,this.value=i}static create(t,e,i){return new ye(t,e,i)}}function Se(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Qe{constructor(t,e,i,n){this.from=t,this.to=e,this.value=i,this.maxPoint=n}get length(){return this.to[this.to.length-1]}findIndex(t,e,i,n=0){let s=i?this.to:this.from;for(let r=n,o=s.length;;){if(r==o)return r;let n=r+o>>1,a=s[n]-t||(i?this.value[n].endSide:this.value[n].startSide)-e;if(n==r)return a>=0?r:o;a>=0?o=n:r=n+1}}between(t,e,i,n){for(let s=this.findIndex(e,-1e9,!0),r=this.findIndex(i,1e9,!1,s);sh||l==h&&c.startSide>0&&c.endSide<=0)continue;(h-l||c.endSide-c.startSide)<0||(r<0&&(r=l),c.point&&(o=Math.max(o,h-l)),i.push(c),n.push(l-r),s.push(h-r))}return{mapped:i.length?new Qe(n,s,i,o):null,pos:r}}}class ve{constructor(t,e,i,n){this.chunkPos=t,this.chunk=e,this.nextLayer=i,this.maxPoint=n}static create(t,e,i,n){return new ve(t,e,i,n)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:i=!1,filterFrom:n=0,filterTo:s=this.length}=t,r=t.filter;if(0==e.length&&!r)return this;if(i&&(e=e.slice().sort(Se)),this.isEmpty)return e.length?ve.of(e):this;let o=new $e(this,null,-1).goto(0),a=0,l=[],h=new xe;for(;o.value||a=0){let t=e[a++];h.addInner(t.from,t.to,t.value)||l.push(t)}else 1==o.rangeIndex&&o.chunkIndexthis.chunkEnd(o.chunkIndex)||so.to||s=s&&t<=s+r.length&&!1===r.between(s,t-s,e-s,i))return}this.nextLayer.between(t,e,i)}}iter(t=0){return Pe.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return Pe.from(t).goto(e)}static compare(t,e,i,n,s=-1){let r=t.filter((t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=s)),o=e.filter((t=>t.maxPoint>0||!t.isEmpty&&t.maxPoint>=s)),a=ke(r,o,i),l=new Te(r,a,s),h=new Te(o,a,s);i.iterGaps(((t,e,i)=>Xe(l,t,h,e,i,n))),i.empty&&0==i.length&&Xe(l,0,h,0,0,n)}static eq(t,e,i=0,n){null==n&&(n=999999999);let s=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0)),r=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0));if(s.length!=r.length)return!1;if(!s.length)return!0;let o=ke(s,r),a=new Te(s,o,0).goto(i),l=new Te(r,o,0).goto(i);for(;;){if(a.to!=l.to||!Ce(a.active,l.active)||a.point&&(!l.point||!a.point.eq(l.point)))return!1;if(a.to>n)return!0;a.next(),l.next()}}static spans(t,e,i,n,s=-1){let r=new Te(t,null,s).goto(e),o=e,a=r.openStart;for(;;){let t=Math.min(r.to,i);if(r.point){let i=r.activeForPoint(r.to),s=r.pointFromo&&(n.span(o,t,r.active,a),a=r.openEnd(t));if(r.to>i)return a+(r.point&&r.to>i?1:0);o=r.to,r.next()}}static of(t,e=!1){let i=new xe;for(let n of t instanceof ye?[t]:e?function(t){if(t.length>1)for(let e=t[0],i=1;i0)return t.slice().sort(Se);e=n}return t}(t):t)i.add(n.from,n.to,n.value);return i.finish()}static join(t){if(!t.length)return ve.empty;let e=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let n=t[i];n!=ve.empty;n=n.nextLayer)e=new ve(n.chunkPos,n.chunk,e,Math.max(n.maxPoint,e.maxPoint));return e}}ve.empty=new ve([],[],null,-1),ve.empty.nextLayer=ve.empty;class xe{finishChunk(t){this.chunks.push(new Qe(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(t,e,i){this.addInner(t,e,i)||(this.nextLayer||(this.nextLayer=new xe)).add(t,e,i)}addInner(t,e,i){let n=t-this.lastTo||i.startSide-this.last.endSide;if(n<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(n<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=e,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let i=e.value.length-1;return this.last=e.value[i],this.lastFrom=e.from[i]+t,this.lastTo=e.to[i]+t,!0}finish(){return this.finishInner(ve.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;let e=ve.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function ke(t,e,i){let n=new Map;for(let e of t)for(let t=0;t=this.minPoint)break}}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&n.push(new $e(r,e,i,s));return 1==n.length?n[0]:new Pe(n)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let i of this.heap)i.goto(t,e);for(let t=this.heap.length>>1;t>=0;t--)Ze(this.heap,t);return this.next(),this}forward(t,e){for(let i of this.heap)i.forward(t,e);for(let t=this.heap.length>>1;t>=0;t--)Ze(this.heap,t);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),Ze(this.heap,0)}}}function Ze(t,e){for(let i=t[e];;){let n=1+(e<<1);if(n>=t.length)break;let s=t[n];if(n+1=0&&(s=t[n+1],n++),i.compare(s)<0)break;t[n]=i,t[e]=s,e=n}}class Te{constructor(t,e,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Pe.from(t,e,i)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){Ae(this.active,t),Ae(this.activeTo,t),Ae(this.activeRank,t),this.minActive=We(this.active,this.activeTo)}addActive(t){let e=0,{value:i,to:n,rank:s}=this.cursor;for(;e0;)e++;Re(this.active,e,i),Re(this.activeTo,e,n),Re(this.activeRank,e,s),t&&Re(t,e,this.cursor.from),this.minActive=We(this.active,this.activeTo)}next(){let t=this.to,e=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let n=this.minActive;if(n>-1&&(this.activeTo[n]-this.cursor.from||this.active[n].endSide-this.cursor.startSide)<0){if(this.activeTo[n]>t){this.to=this.activeTo[n],this.endSide=this.active[n].endSide;break}this.removeActive(n),i&&Ae(i,n)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let t=this.cursor.value;if(t.point){if(!(e&&this.cursor.to==this.to&&this.cursor.from=0&&i[e]=0&&!(this.activeRank[i]t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&e.push(this.active[i]);return e.reverse()}openEnd(t){let e=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)e++;return e}}function Xe(t,e,i,n,s,r){t.goto(e),i.goto(n);let o=n+s,a=n,l=n-e;for(;;){let e=t.to+l-i.to||t.endSide-i.endSide,n=e<0?t.to+l:i.to,s=Math.min(n,o);if(t.point||i.point?t.point&&i.point&&(t.point==i.point||t.point.eq(i.point))&&Ce(t.activeForPoint(t.to),i.activeForPoint(i.to))||r.comparePoint(a,s,t.point,i.point):s>a&&!Ce(t.active,i.active)&&r.compareRange(a,s,t.active,i.active),n>o)break;a=n,e<=0&&t.next(),e>=0&&i.next()}}function Ce(t,e){if(t.length!=e.length)return!1;for(let i=0;i=e;i--)t[i+1]=t[i];t[e]=i}function We(t,e){let i=-1,n=1e9;for(let s=0;st.map((t=>e.replace(/&/,t))))).reduce(((t,e)=>t.concat(e))),o,r);else if(o&&"object"==typeof o){if(!l)throw new RangeError("The value of a property ("+i+") should be a primitive value.");s(n(i),o,a,h)}else null!=o&&a.push(i.replace(/_.*/,"").replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))+": "+o+";")}(a.length||h)&&r.push((!i||l||o?t:t.map(i)).join(", ")+" {"+a.join(" ")+"}")}for(let e in t)s(n(e),t[e],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let t=Ve[Ye]||1;return Ve[Ye]=t+1,"ͼ"+t.toString(36)}static mount(t,e,i){let n=t[_e],s=i&&i.nonce;n?s&&n.setNonce(s):n=new je(t,s),n.mount(Array.isArray(e)?e:[e])}}let Ee=new Map;class je{constructor(t,e){let i=t.ownerDocument||t,n=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&n.CSSStyleSheet){let e=Ee.get(i);if(e)return t.adoptedStyleSheets=[e.sheet,...t.adoptedStyleSheets],t[_e]=e;this.sheet=new n.CSSStyleSheet,t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets],Ee.set(i,this)}else{this.styleTag=i.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);let n=t.head||t;n.insertBefore(this.styleTag,n.firstChild)}this.modules=[],t[_e]=this}mount(t){let e=this.sheet,i=0,n=0;for(let s=0;s-1&&(this.modules.splice(o,1),n--,o=-1),-1==o){if(this.modules.splice(n++,0,r),e)for(let t=0;t",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Ge="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Ie="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Be=0;Be<10;Be++)De[48+Be]=De[96+Be]=String(Be);for(Be=1;Be<=24;Be++)De[Be+111]="F"+Be;for(Be=65;Be<=90;Be++)De[Be]=String.fromCharCode(Be+32),ze[Be]=String.fromCharCode(Be);for(var Ne in De)ze.hasOwnProperty(Ne)||(ze[Ne]=De[Ne]);function Ue(t){let e;return e=11==t.nodeType?t.getSelection?t:t.ownerDocument:t,e.getSelection()}function Le(t,e){return!!e&&(t==e||t.contains(1!=e.nodeType?e.parentNode:e))}function Fe(t,e){if(!e.anchorNode)return!1;try{return Le(t,e.anchorNode)}catch(t){return!1}}function He(t){return 3==t.nodeType?hi(t,0,t.nodeValue.length).getClientRects():1==t.nodeType?t.getClientRects():[]}function Je(t,e,i,n){return!!i&&(ti(t,e,i,n,-1)||ti(t,e,i,n,1))}function Ke(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e}function ti(t,e,i,n,s){for(;;){if(t==i&&e==n)return!0;if(e==(s<0?0:ei(t))){if("DIV"==t.nodeName)return!1;let i=t.parentNode;if(!i||1!=i.nodeType)return!1;e=Ke(t)+(s<0?0:1),t=i}else{if(1!=t.nodeType)return!1;if(1==(t=t.childNodes[e+(s<0?-1:0)]).nodeType&&"false"==t.contentEditable)return!1;e=s<0?ei(t):0}}}function ei(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function ii(t,e){let i=e?t.left:t.right;return{left:i,right:i,top:t.top,bottom:t.bottom}}function ni(t){return{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function si(t,e){let i=e.width/t.offsetWidth,n=e.height/t.offsetHeight;return(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.width-t.offsetWidth)<1)&&(i=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-t.offsetHeight)<1)&&(n=1),{scaleX:i,scaleY:n}}class ri{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:e,focusNode:i}=t;this.set(e,Math.min(t.anchorOffset,e?ei(e):0),i,Math.min(t.focusOffset,i?ei(i):0))}set(t,e,i,n){this.anchorNode=t,this.anchorOffset=e,this.focusNode=i,this.focusOffset=n}}let oi,ai=null;function li(t){if(t.setActive)return t.setActive();if(ai)return t.focus(ai);let e=[];for(let i=t;i&&(e.push(i,i.scrollTop,i.scrollLeft),i!=i.ownerDocument);i=i.parentNode);if(t.focus(null==ai?{get preventScroll(){return ai={preventScroll:!0},!0}}:void 0),!ai){ai=!1;for(let t=0;tMath.max(1,t.scrollHeight-t.clientHeight-4)}class fi{constructor(t,e,i=!0){this.node=t,this.offset=e,this.precise=i}static before(t,e){return new fi(t.parentNode,Ke(t),e)}static after(t,e){return new fi(t.parentNode,Ke(t)+1,e)}}const di=[];class pi{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t){let e=this.posAtStart;for(let i of this.children){if(i==t)return e;e+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}sync(t,e){if(2&this.flags){let i,n=this.dom,s=null;for(let r of this.children){if(7&r.flags){if(!r.dom&&(i=s?s.nextSibling:n.firstChild)){let t=pi.get(i);(!t||!t.parent&&t.canReuseDOM(r))&&r.reuseDOM(i)}r.sync(t,e),r.flags&=-8}if(i=s?s.nextSibling:n.firstChild,e&&!e.written&&e.node==n&&i!=r.dom&&(e.written=!0),r.dom.parentNode==n)for(;i&&i!=r.dom;)i=gi(i);else n.insertBefore(r.dom,i);s=r.dom}for(i=s?s.nextSibling:n.firstChild,i&&e&&e.node==n&&(e.written=!0);i;)i=gi(i)}else if(1&this.flags)for(let i of this.children)7&i.flags&&(i.sync(t,e),i.flags&=-8)}reuseDOM(t){}localPosFromDOM(t,e){let i;if(t==this.dom)i=this.dom.childNodes[e];else{let n=0==ei(t)?0:0==e?-1:1;for(;;){let e=t.parentNode;if(e==this.dom)break;0==n&&e.firstChild!=e.lastChild&&(n=t==e.firstChild?-1:1),t=e}i=n<0?t:t.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!pi.get(i);)i=i.nextSibling;if(!i)return this.length;for(let t=0,e=0;;t++){let n=this.children[t];if(n.dom==i)return e;e+=n.length+n.breakAfter}}domBoundsAround(t,e,i=0){let n=-1,s=-1,r=-1,o=-1;for(let a=0,l=i,h=i;ae)return i.domBoundsAround(t,e,l);if(c>=t&&-1==n&&(n=a,s=l),l>e&&i.dom.parentNode==this.dom){r=a,o=h;break}h=c,l=c+i.breakAfter}return{from:s,to:o<0?i+this.length:o,startDOM:(n?this.children[n-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:r=0?this.children[r].dom:null}}markDirty(t=!1){this.flags|=2,this.markParentsDirty(t)}markParentsDirty(t){for(let e=this.parent;e;e=e.parent){if(t&&(e.flags|=2),1&e.flags)return;e.flags|=1,t=!1}}setParent(t){this.parent!=t&&(this.parent=t,7&this.flags&&this.markParentsDirty(!0))}setDOM(t){this.dom!=t&&(this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this)}get rootView(){for(let t=this;;){let e=t.parent;if(!e)return t;t=e}}replaceChildren(t,e,i=di){this.markDirty();for(let n=t;nthis.pos||t==this.pos&&(e>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function bi(t,e,i,n,s,r,o,a,l){let{children:h}=t,c=h.length?h[e]:null,O=r.length?r[r.length-1]:null,u=O?O.breakAfter:o;if(!(e==n&&c&&!o&&!u&&r.length<2&&c.merge(i,s,r.length?O:null,0==i,a,l))){if(n0&&(!o&&r.length&&c.merge(i,c.length,r[0],!1,a,0)?c.breakAfter=r.shift().breakAfter:(i2);var Ci={mac:Xi||/Mac/.test(yi.platform),windows:/Win/.test(yi.platform),linux:/Linux|X11/.test(yi.platform),ie:ki,ie_version:vi?Si.documentMode||6:xi?+xi[1]:Qi?+Qi[1]:0,gecko:$i,gecko_version:$i?+(/Firefox\/(\d+)/.exec(yi.userAgent)||[0,0])[1]:0,chrome:!!Pi,chrome_version:Pi?+Pi[1]:0,ios:Xi,android:/Android\b/.test(yi.userAgent),webkit:Zi,safari:Ti,webkit_version:Zi?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=Si.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class Ai extends pi{constructor(t){super(),this.text=t}get length(){return this.text.length}createDOM(t){this.setDOM(t||document.createTextNode(this.text))}sync(t,e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(t){3==t.nodeType&&this.createDOM(t)}merge(t,e,i){return!(8&this.flags||i&&(!(i instanceof Ai)||this.length-(e-t)+i.length>256||8&i.flags))&&(this.text=this.text.slice(0,t)+(i?i.text:"")+this.text.slice(e),this.markDirty(),!0)}split(t){let e=new Ai(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),e.flags|=8&this.flags,e}localPosFromDOM(t,e){return t==this.dom?e:e?this.text.length:0}domAtPos(t){return new fi(this.dom,t)}domBoundsAround(t,e,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(t,e){return function(t,e,i){let n=t.nodeValue.length;e>n&&(e=n);let s=e,r=e,o=0;0==e&&i<0||e==n&&i>=0?Ci.chrome||Ci.gecko||(e?(s--,o=1):r=0)?0:a.length-1];Ci.safari&&!o&&0==l.width&&(l=Array.prototype.find.call(a,(t=>t.width))||l);return o?ii(l,o<0):l||null}(this.dom,t,e)}}class Ri extends pi{constructor(t,e=[],i=0){super(),this.mark=t,this.children=e,this.length=i;for(let t of e)t.setParent(this)}setAttrs(t){if(Oi(t),this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(let e in this.mark.attrs)t.setAttribute(e,this.mark.attrs[e]);return t}canReuseDOM(t){return super.canReuseDOM(t)&&!(8&(this.flags|t.flags))}reuseDOM(t){t.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(t),this.flags|=6)}sync(t,e){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(t,e)}merge(t,e,i,n,s,r){return(!i||!(!(i instanceof Ri&&i.mark.eq(this.mark))||t&&s<=0||et&&e.push(i=t&&(n=s),i=o,s++}let r=this.length-t;return this.length=t,n>-1&&(this.children.length=n,this.markDirty()),new Ri(this.mark,e,r)}domAtPos(t){return Yi(this,t)}coordsAt(t,e){return Vi(this,t,e)}}class Wi extends pi{static create(t,e,i){return new Wi(t,e,i)}constructor(t,e,i){super(),this.widget=t,this.length=e,this.side=i,this.prevWidget=null}split(t){let e=Wi.create(this.widget,this.length-t,this.side);return this.length-=t,e}sync(t){this.dom&&this.widget.updateDOM(this.dom,t)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(t,e,i,n,s,r){return!(i&&(!(i instanceof Wi&&this.widget.compare(i.widget))||t>0&&s<=0||e0)?fi.before(this.dom):fi.after(this.dom,t==this.length)}domBoundsAround(){return null}coordsAt(t,e){let i=this.widget.coordsAt(this.dom,t,e);if(i)return i;let n=this.dom.getClientRects(),s=null;if(!n.length)return null;let r=this.side?this.side<0:t>0;for(let e=r?n.length-1:0;s=n[e],!(t>0?0==e:e==n.length-1||s.top0?fi.before(this.dom):fi.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(t){return this.dom.getBoundingClientRect()}get overrideDOMText(){return N.empty}get isHidden(){return!0}}function Yi(t,e){let i=t.dom,{children:n}=t,s=0;for(let t=0;st&&e0;t--){let e=n[t-1];if(e.dom.parentNode==i)return e.domAtPos(e.length)}for(let t=s;t0&&e instanceof Ri&&s.length&&(n=s[s.length-1])instanceof Ri&&n.mark.eq(e.mark)?_i(n,e.children[0],i-1):(s.push(e),e.setParent(t)),t.length+=e.length}function Vi(t,e,i){let n=null,s=-1,r=null,o=-1;!function t(e,a){for(let l=0,h=0;l=a&&(c.children.length?t(c,a-h):(!r||r.isHidden&&i>0)&&(O>a||h==O&&c.getSide()>0)?(r=c,o=a-h):(h-1?1:0)!=s.length-(i&&s.indexOf(i)>-1?1:0))return!1;for(let r of n)if(r!=i&&(-1==s.indexOf(r)||t[r]!==e[r]))return!1;return!0}function Di(t,e,i){let n=!1;if(e)for(let s in e)i&&s in i||(n=!0,"style"==s?t.style.cssText="":t.removeAttribute(s));if(i)for(let s in i)e&&e[s]==i[s]||(n=!0,"style"==s?t.style.cssText=i[s]:t.setAttribute(s,i[s]));return n}function zi(t){let e=Object.create(null);for(let i=0;i0&&0==this.children[i-1].length;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=t,e}transferDOM(t){this.dom&&(this.markDirty(),t.setDOM(this.dom),t.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(t){ji(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}append(t,e){_i(this,t,e)}addLineDeco(t){let e=t.spec.attributes,i=t.spec.class;e&&(this.attrs=Mi(e,this.attrs||{})),i&&(this.attrs=Mi({class:i},this.attrs||{}))}domAtPos(t){return Yi(this,t)}reuseDOM(t){"DIV"==t.nodeName&&(this.setDOM(t),this.flags|=6)}sync(t,e){var i;this.dom?4&this.flags&&(Oi(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(Di(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(t,e);let n=this.dom.lastChild;for(;n&&pi.get(n)instanceof Ri;)n=n.lastChild;if(!(n&&this.length&&("BR"==n.nodeName||0!=(null===(i=pi.get(n))||void 0===i?void 0:i.isEditable)||Ci.ios&&this.children.some((t=>t instanceof Ai))))){let t=document.createElement("BR");t.cmIgnore=!0,this.dom.appendChild(t)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let t,e=0;for(let i of this.children){if(!(i instanceof Ai)||/[^ -~]/.test(i.text))return null;let n=He(i.dom);if(1!=n.length)return null;e+=n[0].width,t=n[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(t,e){let i=Vi(this,t,e);if(!this.children.length&&i&&this.parent){let{heightOracle:t}=this.parent.view.viewState,e=i.bottom-i.top;if(Math.abs(e-t.lineHeight)<2&&t.textHeight=e){if(s instanceof Gi)return s;if(r>e)break}n=r+s.breakAfter}return null}}class Ii extends pi{constructor(t,e,i){super(),this.widget=t,this.length=e,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(t,e,i,n,s,r){return!(i&&(!(i instanceof Ii&&this.widget.compare(i.widget))||t>0&&s<=0||e0)}}class Bi{eq(t){return!1}updateDOM(t,e){return!1}compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(t){return!0}coordsAt(t,e,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(t){}}var Ni=function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t}(Ni||(Ni={}));class Ui extends we{constructor(t,e,i,n){super(),this.startSide=t,this.endSide=e,this.widget=i,this.spec=n}get heightRelevant(){return!1}static mark(t){return new Li(t)}static widget(t){let e=Math.max(-1e4,Math.min(1e4,t.side||0)),i=!!t.block;return e+=i&&!t.inlineOrder?e>0?3e8:-4e8:e>0?1e8:-1e8,new Hi(t,e,e,i,t.widget||null,!1)}static replace(t){let e,i,n=!!t.block;if(t.isBlockGap)e=-5e8,i=4e8;else{let{start:s,end:r}=Ji(t,n);e=(s?n?-3e8:-1:5e8)-1,i=1+(r?n?2e8:1:-6e8)}return new Hi(t,e,i,n,t.widget||null,!0)}static line(t){return new Fi(t)}static set(t,e=!1){return ve.of(t,e)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}Ui.none=ve.empty;class Li extends Ui{constructor(t){let{start:e,end:i}=Ji(t);super(e?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.class=t.class||"",this.attrs=t.attributes||null}eq(t){var e,i;return this==t||t instanceof Li&&this.tagName==t.tagName&&(this.class||(null===(e=this.attrs)||void 0===e?void 0:e.class))==(t.class||(null===(i=t.attrs)||void 0===i?void 0:i.class))&&ji(this.attrs,t.attrs,"class")}range(t,e=t){if(t>=e)throw new RangeError("Mark decorations may not be empty");return super.range(t,e)}}Li.prototype.point=!1;class Fi extends Ui{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof Fi&&this.spec.class==t.spec.class&&ji(this.spec.attributes,t.spec.attributes)}range(t,e=t){if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,e)}}Fi.prototype.mapMode=gt.TrackBefore,Fi.prototype.point=!0;class Hi extends Ui{constructor(t,e,i,n,s,r){super(e,i,s,t),this.block=n,this.isReplace=r,this.mapMode=n?e<=0?gt.TrackBefore:gt.TrackAfter:gt.TrackDel}get type(){return this.startSide!=this.endSide?Ni.WidgetRange:this.startSide<=0?Ni.WidgetBefore:Ni.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof Hi&&(e=this.widget,i=t.widget,e==i||!!(e&&i&&e.compare(i)))&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide;var e,i}range(t,e=t){if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,e)}}function Ji(t,e=!1){let{inclusiveStart:i,inclusiveEnd:n}=t;return null==i&&(i=t.inclusive),null==n&&(n=t.inclusive),{start:null!=i?i:e,end:null!=n?n:e}}function Ki(t,e,i,n=0){let s=i.length-1;s>=0&&i[s]+n>=t?i[s]=Math.max(i[s],e):i.push(t,e)}Hi.prototype.point=!0;class tn{constructor(t,e,i,n){this.doc=t,this.pos=e,this.end=i,this.disallowBlockEffectsFor=n,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=t.iter(),this.skip=e}posCovered(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let t=this.content[this.content.length-1];return!(t.breakAfter||t instanceof Ii&&t.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Gi),this.atCursorPos=!0),this.curLine}flushBuffer(t=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(en(new qi(-1),t),t.length),this.pendingBuffer=0)}addBlockWidget(t){this.flushBuffer(),this.curLine=null,this.content.push(t)}finish(t){this.pendingBuffer&&t<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||t&&this.content.length&&this.content[this.content.length-1]instanceof Ii||this.getLine()}buildText(t,e,i){for(;t>0;){if(this.textOff==this.text.length){let{value:e,lineBreak:i,done:n}=this.cursor.next(this.skip);if(this.skip=0,n)throw new Error("Ran out of text content when drawing inline views");if(i){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,t--;continue}this.text=e,this.textOff=0}let n=Math.min(this.text.length-this.textOff,t,512);this.flushBuffer(e.slice(e.length-i)),this.getLine().append(en(new Ai(this.text.slice(this.textOff,this.textOff+n)),e),i),this.atCursorPos=!0,this.textOff+=n,t-=n,i=0}}span(t,e,i,n){this.buildText(e-t,i,n),this.pos=e,this.openStart<0&&(this.openStart=n)}point(t,e,i,n,s,r){if(this.disallowBlockEffectsFor[r]&&i instanceof Hi){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(e>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let o=e-t;if(i instanceof Hi)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Ii(i.widget||new nn("div"),o,i));else{let r=Wi.create(i.widget||new nn("span"),o,o?0:i.startSide),a=this.atCursorPos&&!r.isEditable&&s<=n.length&&(t0),l=!r.isEditable&&(tn.length||i.startSide<=0),h=this.getLine();2!=this.pendingBuffer||a||r.isEditable||(this.pendingBuffer=0),this.flushBuffer(n),a&&(h.append(en(new qi(1),n),s),s=n.length+Math.max(0,s-n.length)),h.append(en(r,n),s),this.atCursorPos=l,this.pendingBuffer=l?tn.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=n.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);o&&(this.textOff+o<=this.text.length?this.textOff+=o:(this.skip+=o-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=e),this.openStart<0&&(this.openStart=s)}static build(t,e,i,n,s){let r=new tn(t,e,i,s);return r.openEnd=ve.spans(n,e,i,r),r.openStart<0&&(r.openStart=r.openEnd),r.finish(r.openEnd),r}}function en(t,e){for(let i of e)t=new Ri(i,[t],t.length);return t}class nn extends Bi{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}var sn=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(sn||(sn={}));const rn=sn.LTR,on=sn.RTL;function an(t){let e=[];for(let i=0;i=e){if(o.level==i)return r;(s<0||(0!=n?n<0?o.frome:t[s].level>o.level))&&(s=r)}}if(s<0)throw new RangeError("Index out of range");return s}}function pn(t,e){if(t.length!=e.length)return!1;for(let i=0;il&&o.push(new dn(l,d.from,u)),bn(t,d.direction==rn!=!(u%2)?n+1:n,s,d.inner,d.from,d.to,o),l=d.to}f=d.to}else{if(f==i||(e?gn[f]!=a:gn[f]==a))break;f++}O?mn(t,l,f,n+1,s,O,o):le;){let i=!0,c=!1;if(!h||l>r[h-1].to){let t=gn[l-1];t!=a&&(i=!1,c=16==t)}let O=i||1!=a?null:[],u=i?n:n+1,f=l;t:for(;;)if(h&&f==r[h-1].to){if(c)break t;let d=r[--h];if(!i)for(let t=d.from,i=h;;){if(t==e)break t;if(!i||r[i-1].to!=t){if(gn[t-1]==a)break t;break}t=r[--i].from}if(O)O.push(d);else{d.to=0;t-=3)if(On[t+1]==-i){let e=On[t+2],i=2&e?s:4&e?1&e?r:s:0;i&&(gn[o]=gn[On[t]]=i),a=t;break}}else{if(189==On.length)break;On[a++]=o,On[a++]=e,On[a++]=l}else if(2==(n=gn[o])||1==n){let t=n==s;l=t?0:1;for(let e=a-3;e>=0;e-=3){let i=On[e+2];if(2&i)break;if(t)On[e+2]|=2;else{if(4&i)break;On[e+2]|=4}}}}}(t,s,r,n,a),function(t,e,i,n){for(let s=0,r=n;s<=i.length;s++){let o=s?i[s-1].to:t,a=sl;)e==r&&(e=i[--n].from,r=n?i[n-1].to:t),gn[--e]=c;l=o}else r=o,l++}}}(s,r,n,a),mn(t,s,r,e,i,n,o)}function wn(t){return[new dn(0,t,0)]}let yn="";function Sn(t,e,i,n,s){var r;let o=n.head-t.from,a=dn.find(e,o,null!==(r=n.bidiLevel)&&void 0!==r?r:-1,n.assoc),l=e[a],h=l.side(s,i);if(o==h){let t=a+=s?1:-1;if(t<0||t>=e.length)return null;l=e[a=t],o=l.side(!s,i),h=l.side(s,i)}let c=at(t.text,o,l.forward(s,i));(cl.to)&&(c=h),yn=t.text.slice(Math.min(o,c),Math.max(o,c));let O=a==(s?e.length-1:0)?null:e[a+(s?1:-1)];return O&&c==h&&O.level+(s?0:1)t.some((t=>t))}),Cn=Tt.define({combine:t=>t.some((t=>t))});class An{constructor(t,e="nearest",i="nearest",n=5,s=5,r=!1){this.range=t,this.y=e,this.x=i,this.yMargin=n,this.xMargin=s,this.isSnapshot=r}map(t){return t.empty?this:new An(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new An($t.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Rn=re.define({map:(t,e)=>t.map(e)});function Wn(t,e,i){let n=t.facet($n);n.length?n[0](e):window.onerror?window.onerror(String(e),i,void 0,void 0,e):i?console.error(i+":",e):console.error(e)}const qn=Tt.define({combine:t=>!t.length||t[0]});let Yn=0;const _n=Tt.define();class Vn{constructor(t,e,i,n,s){this.id=t,this.create=e,this.domEventHandlers=i,this.domEventObservers=n,this.extension=s(this)}static define(t,e){const{eventHandlers:i,eventObservers:n,provide:s,decorations:r}=e||{};return new Vn(Yn++,t,i,n,(t=>{let e=[_n.of(t)];return r&&e.push(Dn.of((e=>{let i=e.plugin(t);return i?r(i):Ui.none}))),s&&e.push(s(t)),e}))}static fromClass(t,e){return Vn.define((e=>new t(e)),e)}}class Mn{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}update(t){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(e){if(Wn(t.state,e,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(t){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(t)}catch(e){Wn(t.state,e,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var e;if(null===(e=this.value)||void 0===e?void 0:e.destroy)try{this.value.destroy()}catch(e){Wn(t.state,e,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const En=Tt.define(),jn=Tt.define(),Dn=Tt.define(),zn=Tt.define(),Gn=Tt.define(),In=Tt.define();function Bn(t,e){let i=t.state.facet(In);if(!i.length)return i;let n=i.map((e=>e instanceof Function?e(t):e)),s=[];return ve.spans(n,e.from,e.to,{point(){},span(t,i,n,r){let o=t-e.from,a=i-e.from,l=s;for(let t=n.length-1;t>=0;t--,r--){let i,s=n[t].spec.bidiIsolate;if(null==s&&(s=Qn(e.text,o,a)),r>0&&l.length&&(i=l[l.length-1]).to==o&&i.direction==s)i.to=a,l=i.inner;else{let t={from:o,to:a,direction:s,inner:[]};l.push(t),l=t.inner}}}}),s}const Nn=Tt.define();function Un(t){let e=0,i=0,n=0,s=0;for(let r of t.state.facet(Nn)){let o=r(t);o&&(null!=o.left&&(e=Math.max(e,o.left)),null!=o.right&&(i=Math.max(i,o.right)),null!=o.top&&(n=Math.max(n,o.top)),null!=o.bottom&&(s=Math.max(s,o.bottom)))}return{left:e,right:i,top:n,bottom:s}}const Ln=Tt.define();class Fn{constructor(t,e,i,n){this.fromA=t,this.toA=e,this.fromB=i,this.toB=n}join(t){return new Fn(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,i=this;for(;e>0;e--){let n=t[e-1];if(!(n.fromA>i.toA)){if(n.toAh)break;s+=2}if(!a)return i;new Fn(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),r=a.toA,o=a.toB}}}class Hn{constructor(t,e,i){this.view=t,this.state=e,this.transactions=i,this.flags=0,this.startState=t.state,this.changes=bt.empty(this.startState.doc.length);for(let t of i)this.changes=this.changes.compose(t.changes);let n=[];this.changes.iterChangedRanges(((t,e,i,s)=>n.push(new Fn(t,e,i,s)))),this.changedRanges=n}static create(t,e,i){return new Hn(t,e,i)}get viewportChanged(){return(4&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(10&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some((t=>t.selection))}get empty(){return 0==this.flags&&0==this.transactions.length}}class Jn extends pi{get length(){return this.view.state.doc.length}constructor(t){super(),this.view=t,this.decorations=[],this.dynamicDecorationMap=[],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(t.contentDOM),this.children=[new Gi],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Fn(0,0,0,t.state.doc.length)],0,null)}update(t){var e;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every((({fromA:t,toA:e})=>ethis.minWidthTo))?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let n=-1;this.view.inputState.composing>=0&&((null===(e=this.domChanged)||void 0===e?void 0:e.newSel)?n=this.domChanged.newSel.head:function(t,e){let i=!1;e&&t.iterChangedRanges(((t,n)=>{te.from&&(i=!0)}));return i}(t.changes,this.hasComposition)||t.selectionSet||(n=t.state.selection.main.head));let s=n>-1?function(t,e,i){let n=ts(t,i);if(!n)return null;let{node:s,from:r,to:o}=n,a=s.nodeValue;if(/[\n\r]/.test(a))return null;if(t.state.doc.sliceString(n.from,n.to)!=a)return null;let l=e.invertedDesc,h=new Fn(l.mapPos(r),l.mapPos(o),r,o),c=[];for(let e=s.parentNode;;e=e.parentNode){let i=pi.get(e);if(i instanceof Ri)c.push({node:e,deco:i.mark});else{if(i instanceof Gi||"DIV"==e.nodeName&&e.parentNode==t.contentDOM)return{range:h,text:s,marks:c,line:e};if(e==t.contentDOM)return null;c.push({node:e,deco:new Li({inclusive:!0,attributes:zi(e),tagName:e.tagName.toLowerCase()})})}}}(this.view,t.changes,n):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:e,to:n}=this.hasComposition;i=new Fn(e,n,t.changes.mapPos(e,-1),t.changes.mapPos(n,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(Ci.ie||Ci.chrome)&&!s&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let r=function(t,e,i){let n=new is;return ve.compare(t,e,i,n),n.changes}(this.decorations,this.updateDeco(),t.changes);return i=Fn.extendWithRanges(i,r),!!(7&this.flags||0!=i.length)&&(this.updateInner(i,t.startState.doc.length,s),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,e,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(t,e,i);let{observer:n}=this.view;n.ignore((()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let t=Ci.chrome||Ci.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,t),this.flags&=-8,t&&(t.written||n.selectionRange.focusNode!=t.node)&&(this.forceSelection=!0),this.dom.style.height=""})),this.markedForComposition.forEach((t=>t.flags&=-9));let s=[];if(this.view.viewport.from||this.view.viewport.to=0?n[t]:null;if(!e)break;let r,o,a,l,{fromA:h,toA:c,fromB:O,toB:u}=e;if(i&&i.range.fromBO){let t=tn.build(this.view.state.doc,O,i.range.fromB,this.decorations,this.dynamicDecorationMap),e=tn.build(this.view.state.doc,i.range.toB,u,this.decorations,this.dynamicDecorationMap);o=t.breakAtStart,a=t.openStart,l=e.openEnd;let n=this.compositionView(i);e.breakAtStart?n.breakAfter=1:e.content.length&&n.merge(n.length,n.length,e.content[0],!1,e.openStart,0)&&(n.breakAfter=e.content[0].breakAfter,e.content.shift()),t.content.length&&n.merge(0,0,t.content[t.content.length-1],!0,0,t.openEnd)&&t.content.pop(),r=t.content.concat(n).concat(e.content)}else({content:r,breakAtStart:o,openStart:a,openEnd:l}=tn.build(this.view.state.doc,O,u,this.decorations,this.dynamicDecorationMap));let{i:f,off:d}=s.findPos(c,1),{i:p,off:g}=s.findPos(h,-1);bi(this,p,g,f,d,r,o,a,l)}i&&this.fixCompositionDOM(i)}compositionView(t){let e=new Ai(t.text.nodeValue);e.flags|=8;for(let{deco:i}of t.marks)e=new Ri(i,[e],e.length);let i=new Gi;return i.append(e,0),i}fixCompositionDOM(t){let e=(t,e)=>{e.flags|=8|(e.children.some((t=>7&t.flags))?1:0),this.markedForComposition.add(e);let i=pi.get(t);i&&i!=e&&(i.dom=null),e.setDOM(t)},i=this.childPos(t.range.fromB,1),n=this.children[i.i];e(t.line,n);for(let s=t.marks.length-1;s>=-1;s--)i=n.childPos(i.off,1),n=n.children[i.i],e(s>=0?t.marks[s].node:t.text,n)}updateSelection(t=!1,e=!1){!t&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let i=this.view.root.activeElement,n=i==this.dom,s=!n&&Fe(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(n||e||s))return;let r=this.forceSelection;this.forceSelection=!1;let o=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(o.anchor)),l=o.empty?a:this.moveToLine(this.domAtPos(o.head));if(Ci.gecko&&o.empty&&!this.hasComposition&&(1==(h=a).node.nodeType&&h.node.firstChild&&(0==h.offset||"false"==h.node.childNodes[h.offset-1].contentEditable)&&(h.offset==h.node.childNodes.length||"false"==h.node.childNodes[h.offset].contentEditable))){let t=document.createTextNode("");this.view.observer.ignore((()=>a.node.insertBefore(t,a.node.childNodes[a.offset]||null))),a=l=new fi(t,0),r=!0}var h;let c=this.view.observer.selectionRange;!r&&c.focusNode&&(Je(a.node,a.offset,c.anchorNode,c.anchorOffset)&&Je(l.node,l.offset,c.focusNode,c.focusOffset)||this.suppressWidgetCursorChange(c,o))||(this.view.observer.ignore((()=>{Ci.android&&Ci.chrome&&this.dom.contains(c.focusNode)&&function(t,e){for(let i=t;i&&i!=e;i=i.assignedSlot||i.parentNode)if(1==i.nodeType&&"false"==i.contentEditable)return!0;return!1}(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let t=Ue(this.view.root);if(t)if(o.empty){if(Ci.gecko){let t=(e=a.node,n=a.offset,1!=e.nodeType?0:(n&&"false"==e.childNodes[n-1].contentEditable?1:0)|(no.head&&([a,l]=[l,a]),e.setEnd(l.node,l.offset),e.setStart(a.node,a.offset),t.removeAllRanges(),t.addRange(e)}else;var e,n;s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())})),this.view.observer.setSelectionRange(a,l)),this.impreciseAnchor=a.precise?null:new fi(c.anchorNode,c.anchorOffset),this.impreciseHead=l.precise?null:new fi(c.focusNode,c.focusOffset)}suppressWidgetCursorChange(t,e){return this.hasComposition&&e.empty&&Je(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==e.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,e=t.state.selection.main,i=Ue(t.root),{anchorNode:n,anchorOffset:s}=t.observer.selectionRange;if(!(i&&e.empty&&e.assoc&&i.modify))return;let r=Gi.find(this,e.head);if(!r)return;let o=r.posAtStart;if(e.head==o||e.head==o+r.length)return;let a=this.coordsAt(e.head,-1),l=this.coordsAt(e.head,1);if(!a||!l||a.bottom>l.top)return;let h=this.domAtPos(e.head+e.assoc);i.collapse(h.node,h.offset),i.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let c=t.observer.selectionRange;t.docView.posFromDOM(c.anchorNode,c.anchorOffset)!=e.from&&i.collapse(n,s)}moveToLine(t){let e,i=this.dom;if(t.node!=i)return t;for(let n=t.offset;!e&&n=0;n--){let t=pi.get(i.childNodes[n]);t instanceof Gi&&(e=t.domAtPos(t.length))}return e?new fi(e.node,e.offset,!0):t}nearest(t){for(let e=t;e;){let t=pi.get(e);if(t&&t.rootView==this)return t;e=e.parentNode}return null}posFromDOM(t,e){let i=this.nearest(t);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(t,e)+i.posAtStart}domAtPos(t){let{i:e,off:i}=this.childCursor().findPos(t,-1);for(;e=0;r--){let o=this.children[r],a=s-o.breakAfter,l=a-o.length;if(at||o.covers(1))&&(!i||o instanceof Gi&&!(i instanceof Gi&&e>=0))&&(i=o,n=l),s=l}return i?i.coordsAt(t-n,e):null}coordsForChar(t){let{i:e,off:i}=this.childPos(t,1),n=this.children[e];if(!(n instanceof Gi))return null;for(;n.children.length;){let{i:t,off:e}=n.childPos(i,1);for(;;t++){if(t==n.children.length)return null;if((n=n.children[t]).length)break}i=e}if(!(n instanceof Ai))return null;let s=at(n.text,i);if(s==i)return null;let r=hi(n.dom,i,s).getClientRects();for(let t=0;tMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,a=this.view.textDirection==sn.LTR;for(let t=0,l=0;ln)break;if(t>=i){let i=h.dom.getBoundingClientRect();if(e.push(i.height),r){let e=h.dom.lastChild,n=e?He(e):[];if(n.length){let e=n[n.length-1],r=a?e.right-i.left:i.right-e.left;r>o&&(o=r,this.minWidth=s,this.minWidthFrom=t,this.minWidthTo=c)}}}t=c+h.breakAfter}return e}textDirectionAt(t){let{i:e}=this.childPos(t,1);return"rtl"==getComputedStyle(this.children[e].dom).direction?sn.RTL:sn.LTR}measureTextSize(){for(let t of this.children)if(t instanceof Gi){let e=t.measureTextSize();if(e)return e}let t,e,i,n=document.createElement("div");return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((()=>{this.dom.appendChild(n);let s=He(n.firstChild)[0];t=n.getBoundingClientRect().height,e=s?s.width/27:7,i=s?s.height:t,n.remove()})),{lineHeight:t,charWidth:e,textHeight:i}}childCursor(t=this.length){let e=this.children.length;return e&&(t-=this.children[--e].length),new mi(this.children,t,e)}computeBlockGapDeco(){let t=[],e=this.view.viewState;for(let i=0,n=0;;n++){let s=n==e.viewports.length?null:e.viewports[n],r=s?s.from-1:this.length;if(r>i){let n=(e.lineBlockAt(r).bottom-e.lineBlockAt(i).top)/this.view.scaleY;t.push(Ui.replace({widget:new Kn(n),block:!0,inclusive:!0,isBlockGap:!0}).range(i,r))}if(!s)break;i=s.to+1}return Ui.set(t)}updateDeco(){let t=this.view.state.facet(Dn).map(((t,e)=>(this.dynamicDecorationMap[e]="function"==typeof t)?t(this.view):t)),e=!1,i=this.view.state.facet(zn).map(((t,i)=>{let n="function"==typeof t;return n&&(e=!0),n?t(this.view):t}));i.length&&(this.dynamicDecorationMap[t.length]=e,t.push(ve.join(i)));for(let e=t.length;ei.anchor?-1:1);if(!n)return;!i.empty&&(e=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(n={left:Math.min(n.left,e.left),top:Math.min(n.top,e.top),right:Math.max(n.right,e.right),bottom:Math.max(n.bottom,e.bottom)});let s=Un(this.view),r={left:n.left-s.left,top:n.top-s.top,right:n.right+s.right,bottom:n.bottom+s.bottom},{offsetWidth:o,offsetHeight:a}=this.view.scrollDOM;!function(t,e,i,n,s,r,o,a){let l=t.ownerDocument,h=l.defaultView||window;for(let c=t,O=!1;c&&!O;)if(1==c.nodeType){let t,u=c==l.body,f=1,d=1;if(u)t=ni(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(O=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let e=c.getBoundingClientRect();({scaleX:f,scaleY:d}=si(c,e)),t={left:e.left,right:e.left+c.clientWidth*f,top:e.top,bottom:e.top+c.clientHeight*d}}let p=0,g=0;if("nearest"==s)e.top0&&e.bottom>t.bottom+g&&(g=e.bottom-t.bottom+g+o)):e.bottom>t.bottom&&(g=e.bottom-t.bottom+o,i<0&&e.top-g0&&e.right>t.right+p&&(p=e.right-t.right+p+r)):e.right>t.right&&(p=e.right-t.right+r,i<0&&e.left0))break;i=i.childNodes[n-1],n=ei(i)}if(i>=0)for(let n=t,s=e;;){if(3==n.nodeType)return{node:n,offset:s};if(!(1==n.nodeType&&s=0))break;n=n.childNodes[s],s=0}return null}let is=class{constructor(){this.changes=[]}compareRange(t,e){Ki(t,e,this.changes)}comparePoint(t,e){Ki(t,e,this.changes)}};function ns(t,e){return e.left>t?e.left-t:Math.max(0,t-e.right)}function ss(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function rs(t,e){return t.tope.top+1}function os(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function ls(t,e,i){let n,s,r,o,a,l,h,c,O=!1;for(let u=t.firstChild;u;u=u.nextSibling){let t=He(u);for(let f=0;fg||o==g&&r>p){n=u,s=d,r=p,o=g;let a=g?i0?f0)}0==p?i>d.bottom&&(!h||h.bottomd.top)&&(l=u,c=d):h&&rs(h,d)?h=as(h,d.bottom):c&&rs(c,d)&&(c=os(c,d.top))}}if(h&&h.bottom>=i?(n=a,s=h):c&&c.top<=i&&(n=l,s=c),!n)return{node:t,offset:0};let u=Math.max(s.left,Math.min(s.right,e));return 3==n.nodeType?hs(n,u,i):O&&"false"!=n.contentEditable?ls(n,u,i):{node:t,offset:Array.prototype.indexOf.call(t.childNodes,n)+(e>=(s.left+s.right)/2?1:0)}}function hs(t,e,i){let n=t.nodeValue.length,s=-1,r=1e9,o=0;for(let a=0;ai?h.top-i:i-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&c=(h.left+h.right)/2,n=i;if(Ci.chrome||Ci.gecko){hi(t,a).getBoundingClientRect().left==h.right&&(n=!i)}if(c<=0)return{node:t,offset:a+(n?1:0)};s=a+(n?1:0),r=c}}}return{node:t,offset:s>-1?s:o>0?t.nodeValue.length:0}}function cs(t,e,i,n=-1){var s,r;let o,a=t.contentDOM.getBoundingClientRect(),l=a.top+t.viewState.paddingTop,{docHeight:h}=t.viewState,{x:c,y:O}=e,u=O-l;if(u<0)return 0;if(u>h)return t.state.doc.length;for(let e=t.viewState.heightOracle.textHeight/2,s=!1;o=t.elementAtHeight(u),o.type!=Ni.Text;)for(;u=n>0?o.bottom+e:o.top-e,!(u>=0&&u<=h);){if(s)return i?null:0;s=!0,n=-n}O=l+u;let f=o.from;if(ft.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:i?null:Os(t,a,o,c,O);let d=t.dom.ownerDocument,p=t.root.elementFromPoint?t.root:d,g=p.elementFromPoint(c,O);g&&!t.contentDOM.contains(g)&&(g=null),g||(c=Math.max(a.left+1,Math.min(a.right-1,c)),g=p.elementFromPoint(c,O),g&&!t.contentDOM.contains(g)&&(g=null));let m,b=-1;if(g&&0!=(null===(s=t.docView.nearest(g))||void 0===s?void 0:s.isEditable))if(d.caretPositionFromPoint){let t=d.caretPositionFromPoint(c,O);t&&({offsetNode:m,offset:b}=t)}else if(d.caretRangeFromPoint){let e=d.caretRangeFromPoint(c,O);e&&(({startContainer:m,startOffset:b}=e),(!t.contentDOM.contains(m)||Ci.safari&&function(t,e,i){let n;if(3!=t.nodeType||e!=(n=t.nodeValue.length))return!1;for(let e=t.nextSibling;e;e=e.nextSibling)if(1!=e.nodeType||"BR"!=e.nodeName)return!1;return hi(t,n-1,n).getBoundingClientRect().left>i}(m,b,c)||Ci.chrome&&function(t,e,i){if(0!=e)return!1;for(let e=t;;){let t=e.parentNode;if(!t||1!=t.nodeType||t.firstChild!=e)return!1;if(t.classList.contains("cm-line"))break;e=t}let n=1==t.nodeType?t.getBoundingClientRect():hi(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return i-n.left>5}(m,b,c))&&(m=void 0))}if(!m||!t.docView.dom.contains(m)){let e=Gi.find(t.docView,f);if(!e)return u>o.top+o.height/2?o.to:o.from;({node:m,offset:b}=ls(e.dom,c,O))}let w=t.docView.nearest(m);if(!w)return null;if(w.isWidget&&1==(null===(r=w.dom)||void 0===r?void 0:r.nodeType)){let t=w.dom.getBoundingClientRect();return e.y1.5*t.defaultLineHeight){let e=t.viewState.heightOracle.textHeight;r+=Math.floor((s-i.top-.5*(t.defaultLineHeight-e))/e)*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(i.from,i.to);return i.from+function(t,e,i,n){for(let n=0,s=0;;){if(s>=e)return n;if(n==t.length)break;s+=9==t.charCodeAt(n)?i-s%i:1,n=at(t,n)}return!0===n?-1:t.length}(o,r,t.state.tabSize)}function us(t,e){let i=t.lineBlockAt(e);if(Array.isArray(i.type))for(let t of i.type)if(t.to>e||t.to==e&&(t.to==i.to||t.type==Ni.Text))return t;return i}function fs(t,e,i,n){let s=t.state.doc.lineAt(e.head),r=t.bidiSpans(s),o=t.textDirectionAt(s.from);for(let a=e,l=null;;){let e=Sn(s,r,o,a,i),h=yn;if(!e){if(s.number==(i?t.state.doc.lines:1))return a;h="\n",s=t.state.doc.line(s.number+(i?1:-1)),r=t.bidiSpans(s),e=t.visualLineSide(s,!i)}if(l){if(!l(h))return a}else{if(!n)return e;l=n(h)}a=e}}function ds(t,e,i){for(;;){let n=0;for(let s of t)s.between(e-1,e+1,((t,s,r)=>{if(e>t&&ee(t))),i.from,e.head>i.from?-1:1);return n==i.from?i:$t.cursor(n,nnull)),Ci.gecko&&function(t){zs.has(t)||(zs.add(t),t.addEventListener("copy",(()=>{})),t.addEventListener("cut",(()=>{})))}(t.contentDOM.ownerDocument)}handleEvent(t){(function(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let i,n=e.target;n!=t.contentDOM;n=n.parentNode)if(!n||11==n.nodeType||(i=pi.get(n))&&i.ignoreEvent(e))return!1;return!0})(this.view,t)&&!this.ignoreDuringComposition(t)&&("keydown"==t.type&&this.keydown(t)||this.runHandlers(t.type,t))}runHandlers(t,e){let i=this.handlers[t];if(i){for(let t of i.observers)t(this.view,e);for(let t of i.handlers){if(e.defaultPrevented)break;if(t(this.view,e)){e.preventDefault();break}}}}ensureHandlers(t){let e=bs(t),i=this.handlers,n=this.view.contentDOM;for(let t in e)if("scroll"!=t){let s=!e[t].handlers.length,r=i[t];r&&s!=!r.handlers.length&&(n.removeEventListener(t,this.handleEvent),r=null),r||n.addEventListener(t,this.handleEvent,{passive:s})}for(let t in i)"scroll"==t||e[t]||n.removeEventListener(t,this.handleEvent);this.handlers=e}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),9==t.keyCode&&Date.now()e.keyCode==t.keyCode)))&&!t.ctrlKey||ys.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(229!=t.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=e||t,setTimeout((()=>this.flushIOSKey()),250),!0)}flushIOSKey(){let t=this.pendingIOSKey;return!!t&&(this.pendingIOSKey=void 0,ci(this.view.contentDOM,t.key,t.keyCode))}ignoreDuringComposition(t){return!!/^key/.test(t.type)&&(this.composing>0||!!(Ci.safari&&!Ci.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function ms(t,e){return(i,n)=>{try{return e.call(t,n,i)}catch(t){Wn(i.state,t)}}}function bs(t){let e=Object.create(null);function i(t){return e[t]||(e[t]={observers:[],handlers:[]})}for(let e of t){let t=e.spec;if(t&&t.domEventHandlers)for(let n in t.domEventHandlers){let s=t.domEventHandlers[n];s&&i(n).handlers.push(ms(e.value,s))}if(t&&t.domEventObservers)for(let n in t.domEventObservers){let s=t.domEventObservers[n];s&&i(n).observers.push(ms(e.value,s))}}for(let t in xs)i(t).handlers.push(xs[t]);for(let t in ks)i(t).observers.push(ks[t]);return e}const ws=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],ys="dthko",Ss=[16,17,18,20,91,92,224,225];function Qs(t){return.7*Math.max(0,t)+8}class vs{constructor(t,e,i,n){this.view=t,this.startEvent=e,this.style=i,this.mustSelect=n,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=e,this.scrollParent=function(t){let e=t.ownerDocument;for(let i=t.parentNode;i&&i!=e.body;)if(1==i.nodeType){if(i.scrollHeight>i.clientHeight||i.scrollWidth>i.clientWidth)return i;i=i.assignedSlot||i.parentNode}else{if(11!=i.nodeType)break;i=i.host}return null}(t.contentDOM),this.atoms=t.state.facet(Gn).map((e=>e(t)));let s=t.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(me.allowMultipleSelections)&&function(t,e){let i=t.state.facet(vn);return i.length?i[0](e):Ci.mac?e.metaKey:e.ctrlKey}(t,e),this.dragging=!(!function(t,e){let{main:i}=t.state.selection;if(i.empty)return!1;let n=Ue(t.root);if(!n||0==n.rangeCount)return!0;let s=n.getRangeAt(0).getClientRects();for(let t=0;t=e.clientX&&i.top<=e.clientY&&i.bottom>=e.clientY)return!0}return!1}(t,e)||1!=_s(e))&&null}start(t){!1===this.dragging&&this.select(t)}move(t){var e,i,n;if(0==t.buttons)return this.destroy();if(this.dragging||null==this.dragging&&(i=this.startEvent,n=t,Math.max(Math.abs(i.clientX-n.clientX),Math.abs(i.clientY-n.clientY))<10))return;this.select(this.lastEvent=t);let s=0,r=0,o=(null===(e=this.scrollParent)||void 0===e?void 0:e.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},a=Un(this.view);t.clientX-a.left<=o.left+6?s=-Qs(o.left-t.clientX):t.clientX+a.right>=o.right-6&&(s=Qs(t.clientX-o.right)),t.clientY-a.top<=o.top+6?r=-Qs(o.top-t.clientY):t.clientY+a.bottom>=o.bottom-6&&(r=Qs(t.clientY-o.bottom)),this.setScrollSpeed(s,r)}up(t){null==this.dragging&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,e){this.scrollSpeed={x:t,y:e},t||e?this.scrolling<0&&(this.scrolling=setInterval((()=>this.scroll()),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),!1===this.dragging&&this.select(this.lastEvent)}skipAtoms(t){let e=null;for(let i=0;ithis.select(this.lastEvent)),20)}}const xs=Object.create(null),ks=Object.create(null),$s=Ci.ie&&Ci.ie_version<15||Ci.ios&&Ci.webkit_version<604;function Ps(t,e){let i,{state:n}=t,s=1,r=n.toText(e),o=r.lines==n.selection.ranges.length;if(null!=Ms&&n.selection.ranges.every((t=>t.empty))&&Ms==r.toString()){let t=-1;i=n.changeByRange((i=>{let a=n.doc.lineAt(i.from);if(a.from==t)return{range:i};t=a.from;let l=n.toText((o?r.line(s++).text:e)+n.lineBreak);return{changes:{from:a.from,insert:l},range:$t.cursor(i.from+l.length)}}))}else i=o?n.changeByRange((t=>{let e=r.line(s++);return{changes:{from:t.from,to:t.to,insert:e.text},range:$t.cursor(t.from+e.length)}})):n.replaceSelection(r);t.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}function Zs(t,e,i,n){if(1==n)return $t.cursor(e,i);if(2==n)return function(t,e,i=1){let n=t.charCategorizer(e),s=t.doc.lineAt(e),r=e-s.from;if(0==s.length)return $t.cursor(e);0==r?i=1:r==s.length&&(i=-1);let o=r,a=r;i<0?o=at(s.text,r,!1):a=at(s.text,r);let l=n(s.text.slice(o,a));for(;o>0;){let t=at(s.text,o,!1);if(n(s.text.slice(t,o))!=l)break;o=t}for(;a{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft},xs.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),27==e.keyCode&&(t.inputState.lastEscPress=Date.now()),!1),ks.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")},ks.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")},xs.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let i=null;for(let n of t.state.facet(kn))if(i=n(t,e),i)break;if(i||0!=e.button||(i=function(t,e){let i=As(t,e),n=_s(e),s=t.state.selection;return{update(t){t.docChanged&&(i.pos=t.changes.mapPos(i.pos),s=s.map(t.changes))},get(e,r,o){let a,l=As(t,e),h=Zs(t,l.pos,l.bias,n);if(i.pos!=l.pos&&!r){let e=Zs(t,i.pos,i.bias,n),s=Math.min(e.from,h.from),r=Math.max(e.to,h.to);h=s1&&(a=function(t,e){for(let i=0;i=e)return $t.create(t.ranges.slice(0,i).concat(t.ranges.slice(i+1)),t.mainIndex==i?0:t.mainIndex-(t.mainIndex>i?1:0))}return null}(s,l.pos))?a:o?s.addRange(h):$t.create([h])}}}(t,e)),i){let n=!t.hasFocus;t.inputState.startMouseSelection(new vs(t,e,i,n)),n&&t.observer.ignore((()=>li(t.contentDOM)));let s=t.inputState.mouseSelection;if(s)return s.start(e),!1===s.dragging}return!1};let Ts=(t,e)=>t>=e.top&&t<=e.bottom,Xs=(t,e,i)=>Ts(e,i)&&t>=i.left&&t<=i.right;function Cs(t,e,i,n){let s=Gi.find(t.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(0==r)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&Xs(i,n,o))return-1;let a=s.coordsAt(r,1);return a&&Xs(i,n,a)?1:o&&Ts(n,o)?-1:1}function As(t,e){let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:i,bias:Cs(t,i,e.clientX,e.clientY)}}const Rs=Ci.ie&&Ci.ie_version<=11;let Ws=null,qs=0,Ys=0;function _s(t){if(!Rs)return t.detail;let e=Ws,i=Ys;return Ws=t,Ys=Date.now(),qs=!e||i>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(qs+1)%3:1}function Vs(t,e,i,n){if(!i)return;let s=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=t.inputState,o=n&&r&&function(t,e){let i=t.state.facet(xn);return i.length?i[0](e):Ci.mac?!e.altKey:!e.ctrlKey}(t,e)?{from:r.from,to:r.to}:null,a={from:s,insert:i},l=t.state.changes(o?[o,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(s,-1),head:l.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}xs.dragstart=(t,e)=>{let{selection:{main:i}}=t.state;if(e.target.draggable){let n=t.docView.nearest(e.target);if(n&&n.isWidget){let t=n.posAtStart,e=t+n.length;(t>=i.to||e<=i.from)&&(i=$t.range(t,e))}}let{inputState:n}=t;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=i,e.dataTransfer&&(e.dataTransfer.setData("Text",t.state.sliceDoc(i.from,i.to)),e.dataTransfer.effectAllowed="copyMove"),!1},xs.dragend=t=>(t.inputState.draggedContent=null,!1),xs.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let i=e.dataTransfer.files;if(i&&i.length){let n=Array(i.length),s=0,r=()=>{++s==i.length&&Vs(t,e,n.filter((t=>null!=t)).join(t.state.lineBreak),!1)};for(let t=0;t{/[\x00-\x08\x0e-\x1f]{2}/.test(e.result)||(n[t]=e.result),r()},e.readAsText(i[t])}return!0}{let i=e.dataTransfer.getData("Text");if(i)return Vs(t,e,i,!0),!0}return!1},xs.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let i=$s?null:e.clipboardData;return i?(Ps(t,i.getData("text/plain")||i.getData("text/uri-text")),!0):(function(t){let e=t.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout((()=>{t.focus(),i.remove(),Ps(t,i.value)}),50)}(t),!1)};let Ms=null;xs.copy=xs.cut=(t,e)=>{let{text:i,ranges:n,linewise:s}=function(t){let e=[],i=[],n=!1;for(let n of t.selection.ranges)n.empty||(e.push(t.sliceDoc(n.from,n.to)),i.push(n));if(!e.length){let s=-1;for(let{from:n}of t.selection.ranges){let r=t.doc.lineAt(n);r.number>s&&(e.push(r.text),i.push({from:r.from,to:Math.min(t.doc.length,r.to+1)})),s=r.number}n=!0}return{text:e.join(t.lineBreak),ranges:i,linewise:n}}(t.state);if(!i&&!s)return!1;Ms=s?i:null,"cut"!=e.type||t.state.readOnly||t.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let r=$s?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",i),!0):(function(t,e){let i=t.dom.parentNode;if(!i)return;let n=i.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout((()=>{n.remove(),t.focus()}),50)}(t,i),!1)};const Es=ie.define();function js(t,e){let i=[];for(let n of t.facet(Tn)){let s=n(t,e);s&&i.push(s)}return i?t.update({effects:i,annotations:Es.of(!0)}):null}function Ds(t){setTimeout((()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let i=js(t.state,e);i?t.dispatch(i):t.update([])}}),10)}ks.focus=t=>{t.inputState.lastFocusTime=Date.now(),t.scrollDOM.scrollTop||!t.inputState.lastScrollTop&&!t.inputState.lastScrollLeft||(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),Ds(t)},ks.blur=t=>{t.observer.clearSelectionRange(),Ds(t)},ks.compositionstart=ks.compositionupdate=t=>{null==t.inputState.compositionFirstChange&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0)},ks.compositionend=t=>{t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,Ci.chrome&&Ci.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then((()=>t.observer.flush())):setTimeout((()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])}),50)},ks.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()},xs.beforeinput=(t,e)=>{var i;let n;if(Ci.chrome&&Ci.android&&(n=ws.find((t=>t.inputType==e.inputType)))&&(t.observer.delayAndroidKey(n.key,n.keyCode),"Backspace"==n.key||"Delete"==n.key)){let e=(null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0;setTimeout((()=>{var i;((null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0)>e+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())}),100)}return!1};const zs=new Set;const Gs=["pre-wrap","normal","pre-line","break-spaces"];class Is{constructor(t){this.lineWrapping=t,this.doc=N.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(t,e){let i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){if(!this.lineWrapping)return this.lineHeight;return(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return Gs.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let e=!1;for(let i=0;i-1,a=Math.round(e)!=Math.round(this.lineHeight)||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=e,this.charWidth=i,this.textHeight=n,this.lineLength=s,a){this.heightSamples={};for(let t=0;t0}set outdated(t){this.flags=(t?2:0)|-3&this.flags}setHeight(t,e){this.height!=e&&(Math.abs(this.height-e)>Ls&&(t.heightChanged=!0),this.height=e)}replace(t,e,i){return Fs.of(i)}decomposeLeft(t,e){e.push(this)}decomposeRight(t,e){e.push(this)}applyChanges(t,e,i,n){let s=this,r=i.doc;for(let o=n.length-1;o>=0;o--){let{fromA:a,toA:l,fromB:h,toB:c}=n[o],O=s.lineAt(a,Us.ByPosNoHeight,i.setDoc(e),0,0),u=O.to>=l?O:s.lineAt(l,Us.ByPosNoHeight,i,0,0);for(c+=u.to-l,l=u.to;o>0&&O.from<=n[o-1].toA;)a=n[o-1].fromA,h=n[o-1].fromB,o--,a2*s){let s=t[e-1];s.break?t.splice(--e,1,s.left,null,s.right):t.splice(--e,1,s.left,s.right),i+=1+s.break,n-=s.size}else{if(!(s>2*n))break;{let e=t[i];e.break?t.splice(i,1,e.left,null,e.right):t.splice(i,1,e.left,e.right),i+=2+e.break,s-=e.size}}else if(n=s&&r(this.blockAt(0,i,n,s))}updateHeight(t,e=0,i=!1,n){return n&&n.from<=e&&n.more&&this.setHeight(t,n.heights[n.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Js extends Hs{constructor(t,e){super(t,e,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(t,e,i,n){return new Ns(n,this.length,i,this.height,this.breaks)}replace(t,e,i){let n=i[0];return 1==i.length&&(n instanceof Js||n instanceof Ks&&4&n.flags)&&Math.abs(this.length-n.length)<10?(n instanceof Ks?n=new Js(n.length,this.height):n.height=this.height,this.outdated||(n.outdated=!1),n):Fs.of(i)}updateHeight(t,e=0,i=!1,n){return n&&n.from<=e&&n.more?this.setHeight(t,n.heights[n.index++]):(i||this.outdated)&&this.setHeight(t,Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Ks extends Fs{constructor(t){super(t,0)}heightMetrics(t,e){let i,n=t.doc.lineAt(e).number,s=t.doc.lineAt(e+this.length).number,r=s-n+1,o=0;if(t.lineWrapping){let e=Math.min(this.height,t.lineHeight*r);i=e/r,this.length>r+1&&(o=(this.height-e)/(this.length-r-1))}else i=this.height/r;return{firstLine:n,lastLine:s,perLine:i,perChar:o}}blockAt(t,e,i,n){let{firstLine:s,lastLine:r,perLine:o,perChar:a}=this.heightMetrics(e,n);if(e.lineWrapping){let s=n+Math.round(Math.max(0,Math.min(1,(t-i)/this.height))*this.length),r=e.doc.lineAt(s),l=o+r.length*a,h=Math.max(i,t-l/2);return new Ns(r.from,r.length,h,l,0)}{let n=Math.max(0,Math.min(r-s,Math.floor((t-i)/o))),{from:a,length:l}=e.doc.line(s+n);return new Ns(a,l,i+o*n,o,0)}}lineAt(t,e,i,n,s){if(e==Us.ByHeight)return this.blockAt(t,i,n,s);if(e==Us.ByPosNoHeight){let{from:e,to:n}=i.doc.lineAt(t);return new Ns(e,n-e,0,0,0)}let{firstLine:r,perLine:o,perChar:a}=this.heightMetrics(i,s),l=i.doc.lineAt(t),h=o+l.length*a,c=l.number-r,O=n+o*c+a*(l.from-s-c);return new Ns(l.from,l.length,Math.max(n,Math.min(O,n+this.height-h)),h,0)}forEachLine(t,e,i,n,s,r){t=Math.max(t,s),e=Math.min(e,s+this.length);let{firstLine:o,perLine:a,perChar:l}=this.heightMetrics(i,s);for(let h=t,c=n;h<=e;){let e=i.doc.lineAt(h);if(h==t){let i=e.number-o;c+=a*i+l*(t-s-i)}let n=a+l*e.length;r(new Ns(e.from,e.length,c,n,0)),c+=n,h=e.to+1}}replace(t,e,i){let n=this.length-e;if(n>0){let t=i[i.length-1];t instanceof Ks?i[i.length-1]=new Ks(t.length+n):i.push(null,new Ks(n-1))}if(t>0){let e=i[0];e instanceof Ks?i[0]=new Ks(t+e.length):i.unshift(new Ks(t-1),null)}return Fs.of(i)}decomposeLeft(t,e){e.push(new Ks(t-1),null)}decomposeRight(t,e){e.push(null,new Ks(this.length-t-1))}updateHeight(t,e=0,i=!1,n){let s=e+this.length;if(n&&n.from<=e+this.length&&n.more){let i=[],r=Math.max(e,n.from),o=-1;for(n.from>e&&i.push(new Ks(n.from-e-1).updateHeight(t,e));r<=s&&n.more;){let e=t.doc.lineAt(r).length;i.length&&i.push(null);let s=n.heights[n.index++];-1==o?o=s:Math.abs(s-o)>=Ls&&(o=-2);let a=new Js(e,s);a.outdated=!1,i.push(a),r+=e+1}r<=s&&i.push(null,new Ks(s-r).updateHeight(t,r));let a=Fs.of(i);return(o<0||Math.abs(a.height-this.height)>=Ls||Math.abs(o-this.heightMetrics(t,e).perLine)>=Ls)&&(t.heightChanged=!0),a}return(i||this.outdated)&&(this.setHeight(t,t.heightForGap(e,e+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class tr extends Fs{constructor(t,e,i){super(t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return 1&this.flags}blockAt(t,e,i,n){let s=i+this.left.height;return to))return l;let h=e==Us.ByPosNoHeight?Us.ByPosNoHeight:Us.ByPos;return a?l.join(this.right.lineAt(o,h,i,r,o)):this.left.lineAt(o,h,i,n,s).join(l)}forEachLine(t,e,i,n,s,r){let o=n+this.left.height,a=s+this.left.length+this.break;if(this.break)t=a&&this.right.forEachLine(t,e,i,o,a,r);else{let l=this.lineAt(a,Us.ByPos,i,n,s);t=t&&l.from<=e&&r(l),e>l.to&&this.right.forEachLine(l.to+1,e,i,o,a,r)}}replace(t,e,i){let n=this.left.length+this.break;if(ethis.left.length)return this.balanced(this.left,this.right.replace(t-n,e-n,i));let s=[];t>0&&this.decomposeLeft(t,s);let r=s.length;for(let t of i)s.push(t);if(t>0&&er(s,r-1),e=i&&e.push(null)),t>i&&this.right.decomposeLeft(t-i,e)}decomposeRight(t,e){let i=this.left.length,n=i+this.break;if(t>=n)return this.right.decomposeRight(t-n,e);t2*e.size||e.size>2*t.size?Fs.of(this.break?[t,null,e]:[t,e]):(this.left=t,this.right=e,this.height=t.height+e.height,this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}updateHeight(t,e=0,i=!1,n){let{left:s,right:r}=this,o=e+s.length+this.break,a=null;return n&&n.from<=e+s.length&&n.more?a=s=s.updateHeight(t,e,i,n):s.updateHeight(t,e,i),n&&n.from<=o+r.length&&n.more?a=r=r.updateHeight(t,o,i,n):r.updateHeight(t,o,i),a?this.balanced(s,r):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function er(t,e){let i,n;null==t[e]&&(i=t[e-1])instanceof Ks&&(n=t[e+1])instanceof Ks&&t.splice(e-1,3,new Ks(i.length+1+n.length))}class ir{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,e){if(this.lineStart>-1){let t=Math.min(e,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Js?i.length+=t-this.pos:(t>this.pos||!this.isCovered)&&this.nodes.push(new Js(t-this.pos,-1)),this.writtenTo=t,e>t&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}point(t,e,i){if(t=5)&&this.addLineDeco(n,s,r)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:e}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=e,this.writtenTot&&this.nodes.push(new Js(this.pos-t,-1)),this.writtenTo=this.pos}blankContent(t,e){let i=new Ks(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof Js)return t;let e=new Js(0,-1);return this.nodes.push(e),e}addBlock(t){this.enterLine();let e=t.deco;e&&e.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,e&&e.endSide>0&&(this.covering=t)}addLineDeco(t,e,i){let n=this.ensureLine();n.length+=i,n.collapsed+=i,n.widgetHeight=Math.max(n.widgetHeight,t),n.breaks+=e,this.writtenTo=this.pos=this.pos+i}finish(t){let e=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||e instanceof Js||this.isCovered?(this.writtenToi.clientHeight||i.scrollWidth>i.clientWidth)&&"visible"!=n.overflow){let n=i.getBoundingClientRect();r=Math.max(r,n.left),o=Math.min(o,n.right),a=Math.max(a,n.top),l=e==t.parentNode?n.bottom:Math.min(l,n.bottom)}e="absolute"==n.position||"fixed"==n.position?i.offsetParent:i.parentNode}else{if(11!=e.nodeType)break;e=e.host}return{left:r-i.left,right:Math.max(r,o)-i.left,top:a-(i.top+e),bottom:Math.max(a,l)-(i.top+e)}}function rr(t,e){let i=t.getBoundingClientRect();return{left:0,right:i.right-i.left,top:e,bottom:i.bottom-(i.top+e)}}class or{constructor(t,e,i){this.from=t,this.to=e,this.size=i}static same(t,e){if(t.length!=e.length)return!1;for(let i=0;i"function"!=typeof t&&"cm-lineWrapping"==t.class));this.heightOracle=new Is(e),this.stateDeco=t.facet(Dn).filter((t=>"function"!=typeof t)),this.heightMap=Fs.empty().applyChanges(this.stateDeco,N.empty,this.heightOracle.setDoc(t.doc),[new Fn(0,0,0,t.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ui.set(this.lineGaps.map((t=>t.draw(this,!1)))),this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:e}=this.state.selection;for(let i=0;i<=1;i++){let n=i?e.head:e.anchor;if(!t.some((({from:t,to:e})=>n>=t&&n<=e))){let{from:e,to:i}=this.lineBlockAt(n);t.push(new hr(e,i))}}this.viewports=t.sort(((t,e)=>t.from-e.from)),this.scaler=this.heightMap.height<=7e6?fr:new dr(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,(t=>{this.viewportLines.push(1==this.scaler.scale?t:pr(t,this.scaler))}))}update(t,e=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=this.state.facet(Dn).filter((t=>"function"!=typeof t));let n=t.changedRanges,s=Fn.extendWithRanges(n,function(t,e,i){let n=new nr;return ve.compare(t,e,i,n,0),n.changes}(i,this.stateDeco,t?t.changes:bt.empty(this.state.doc.length))),r=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),s),this.heightMap.height!=r&&(t.flags|=2),o?(this.scrollAnchorPos=t.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=s.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,e));let l=!t.changes.empty||2&t.flags||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),l&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(Cn)&&(this.mustEnforceCursorAssoc=!0)}measure(t){let e=t.contentDOM,i=window.getComputedStyle(e),n=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection="rtl"==i.direction?sn.RTL:sn.LTR;let r=this.heightOracle.mustRefreshForWrapping(s),o=e.getBoundingClientRect(),a=r||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let l=0,h=0;if(o.width&&o.height){let{scaleX:t,scaleY:i}=si(e,o);this.scaleX==t&&this.scaleY==i||(this.scaleX=t,this.scaleY=i,l|=8,r=a=!0)}let c=(parseInt(i.paddingTop)||0)*this.scaleY,O=(parseInt(i.paddingBottom)||0)*this.scaleY;this.paddingTop==c&&this.paddingBottom==O||(this.paddingTop=c,this.paddingBottom=O,l|=10),this.editorWidth!=t.scrollDOM.clientWidth&&(n.lineWrapping&&(a=!0),this.editorWidth=t.scrollDOM.clientWidth,l|=8);let u=t.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=u&&(this.scrollAnchorHeight=-1,this.scrollTop=u),this.scrolledToBottom=ui(t.scrollDOM);let f=(this.printing?rr:sr)(e,this.paddingTop),d=f.top-this.pixelViewport.top,p=f.bottom-this.pixelViewport.bottom;this.pixelViewport=f;let g=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(g!=this.inView&&(this.inView=g,g&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let m=o.width;if(this.contentDOMWidth==m&&this.editorHeight==t.scrollDOM.clientHeight||(this.contentDOMWidth=o.width,this.editorHeight=t.scrollDOM.clientHeight,l|=8),a){let e=t.docView.measureVisibleLineHeights(this.viewport);if(n.mustRefreshForHeights(e)&&(r=!0),r||n.lineWrapping&&Math.abs(m-this.contentDOMWidth)>n.charWidth){let{lineHeight:i,charWidth:o,textHeight:a}=t.docView.measureTextSize();r=i>0&&n.refresh(s,i,o,a,m/o,e),r&&(t.docView.minWidth=0,l|=8)}d>0&&p>0?h=Math.max(d,p):d<0&&p<0&&(h=Math.min(d,p)),n.heightChanged=!1;for(let i of this.viewports){let s=i.from==this.viewport.from?e:t.docView.measureVisibleLineHeights(i);this.heightMap=(r?Fs.empty().applyChanges(this.stateDeco,N.empty,this.heightOracle,[new Fn(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(n,0,r,new Bs(i.from,s))}n.heightChanged&&(l|=2)}let b=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return b&&(this.viewport=this.getViewport(h,this.scrollTarget)),this.updateForViewport(),(2&l||b)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(r?[]:this.lineGaps,t)),l|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),l}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,e){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),n=this.heightMap,s=this.heightOracle,{visibleTop:r,visibleBottom:o}=this,a=new hr(n.lineAt(r-1e3*i,Us.ByHeight,s,0,0).from,n.lineAt(o+1e3*(1-i),Us.ByHeight,s,0,0).to);if(e){let{head:t}=e.range;if(ta.to){let i,r=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),o=n.lineAt(t,Us.ByPos,s,0,0);i="center"==e.y?(o.top+o.bottom)/2-r/2:"start"==e.y||"nearest"==e.y&&t=o+Math.max(10,Math.min(i,250)))&&n>r-2e3&&s>1,r=n<<1;if(this.defaultTextDirection!=sn.LTR&&!i)return[];let o=[],a=(n,r,l,h)=>{if(r-nn&&tt.from>=l.from&&t.to<=l.to&&Math.abs(t.from-n)t.frome))));if(!u){if(rt.from<=r&&t.to>=r))){let t=e.moveToLineBoundary($t.cursor(r),!1,!0).head;t>n&&(r=t)}u=new or(n,r,this.gapSize(l,n,r,h))}o.push(u)};for(let t of this.viewportLines){if(t.lengtht.from&&a(t.from,s,t,e),ot.draw(this,this.heightOracle.lineWrapping)))))}computeVisibleRanges(){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let e=[];ve.spans(t,this.viewport.from,this.viewport.to,{span(t,i){e.push({from:t,to:i})},point(){}},20);let i=e.length!=this.visibleRanges.length||this.visibleRanges.some(((t,i)=>t.from!=e[i].from||t.to!=e[i].to));return this.visibleRanges=e,i?4:0}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find((e=>e.from<=t&&e.to>=t))||pr(this.heightMap.lineAt(t,Us.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return pr(this.heightMap.lineAt(this.scaler.fromDOM(t),Us.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(t){let e=this.lineBlockAtHeight(t+8);return e.from>=this.viewport.from||this.viewportLines[0].top-t>200?e:this.viewportLines[0]}elementAtHeight(t){return pr(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class hr{constructor(t,e){this.from=t,this.to=e}}function cr(t,e,i){let n=[],s=t,r=0;return ve.spans(i,t,e,{span(){},point(t,e){t>s&&(n.push({from:s,to:t}),r+=t-s),s=e}},20),s=1)return e[e.length-1].to;let n=Math.floor(t*i);for(let t=0;;t++){let{from:i,to:s}=e[t],r=s-i;if(n<=r)return i+n;n-=r}}function ur(t,e){let i=0;for(let{from:n,to:s}of t.ranges){if(e<=s){i+=e-n;break}i+=s-n}return i/t.total}const fr={toDOM:t=>t,fromDOM:t=>t,scale:1};class dr{constructor(t,e,i){let n=0,s=0,r=0;this.viewports=i.map((({from:i,to:s})=>{let r=e.lineAt(i,Us.ByPos,t,0,0).top,o=e.lineAt(s,Us.ByPos,t,0,0).bottom;return n+=o-r,{from:i,to:s,top:r,bottom:o,domTop:0,domBottom:0}})),this.scale=(7e6-n)/(e.height-n);for(let t of this.viewports)t.domTop=r+(t.top-s)*this.scale,r=t.domBottom=t.domTop+(t.bottom-t.top),s=t.bottom}toDOM(t){for(let e=0,i=0,n=0;;e++){let s=epr(t,e))):t._content)}const gr=Tt.define({combine:t=>t.join(" ")}),mr=Tt.define({combine:t=>t.indexOf(!0)>-1}),br=Me.newName(),wr=Me.newName(),yr=Me.newName(),Sr={"&light":"."+wr,"&dark":"."+yr};function Qr(t,e,i){return new Me(e,{finish:e=>/&/.test(e)?e.replace(/&\w*/,(e=>{if("&"==e)return t;if(!i||!i[e])throw new RangeError(`Unsupported selector: ${e}`);return i[e]})):t+" "+e})}const vr=Qr("."+br,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Sr),xr="￿";class kr{constructor(t,e){this.points=t,this.text="",this.lineSeparator=e.facet(me.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=xr}readRange(t,e){if(!t)return this;let i=t.parentNode;for(let n=t;;){this.findPointBefore(i,n);let t=this.text.length;this.readNode(n);let s=n.nextSibling;if(s==e)break;let r=pi.get(n),o=pi.get(s);(r&&o?r.breakAfter:(r?r.breakAfter:Pr(n))||Pr(s)&&("BR"!=n.nodeName||n.cmIgnore)&&this.text.length>t)&&this.lineBreak(),n=s}return this.findPointBefore(i,e),this}readTextNode(t){let e=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e.length));for(let i=0,n=this.lineSeparator?null:/\r\n?|\n/g;;){let s,r=-1,o=1;if(this.lineSeparator?(r=e.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(s=n.exec(e))&&(r=s.index,o=s[0].length),this.append(e.slice(i,r<0?e.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let e of this.points)e.node==t&&e.pos>this.text.length&&(e.pos-=o-1);i=r+o}}readNode(t){if(t.cmIgnore)return;let e=pi.get(t),i=e&&e.overrideDOMText;if(null!=i){this.findPointInside(t,i.length);for(let t=i.iter();!t.next().done;)t.lineBreak?this.lineBreak():this.append(t.value)}else 3==t.nodeType?this.readTextNode(t):"BR"==t.nodeName?t.nextSibling&&this.lineBreak():1==t.nodeType&&this.readRange(t.firstChild,null)}findPointBefore(t,e){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}findPointInside(t,e){for(let i of this.points)(3==t.nodeType?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+($r(t,i.node,i.offset)?e:0))}}function $r(t,e,i){for(;;){if(!e||i-1)this.newSel=null;else if(e>-1&&(this.bounds=t.docView.domBoundsAround(e,i,0))){let e=s||r?[]:function(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:r}=t.observer.selectionRange;i&&(e.push(new Zr(i,n)),s==i&&r==n||e.push(new Zr(s,r)));return e}(t),i=new kr(e,t.state);i.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=i.text,this.newSel=function(t,e){if(0==t.length)return null;let i=t[0].pos,n=2==t.length?t[1].pos:i;return i>-1&&n>-1?$t.single(i+e,n+e):null}(e,this.bounds.from)}else{let e=t.observer.selectionRange,i=s&&s.node==e.focusNode&&s.offset==e.focusOffset||!Le(t.contentDOM,e.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(e.focusNode,e.focusOffset),n=r&&r.node==e.anchorNode&&r.offset==e.anchorOffset||!Le(t.contentDOM,e.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(e.anchorNode,e.anchorOffset),o=t.viewport;if(Ci.ios&&t.state.selection.main.empty&&i!=n&&(o.from>0||o.toDate.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:n,to:o}=e.bounds,a=s.from,l=null;(8===r||Ci.android&&e.text.length0&&a>0&&t.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if("end"==n){i-=o+Math.max(0,r-Math.min(o,a))-r}if(o=o?r-i:0,a=r+(a-o),o=r}else if(a=a?r-i:0,o=r+(o-a),a=r}return{from:r,toA:o,toB:a}}(t.state.doc.sliceString(n,o,xr),e.text,a-n,l);h&&(Ci.chrome&&13==r&&h.toB==h.from+2&&e.text.slice(h.from,h.toB)==xr+xr&&h.toB--,i={from:n+h.from,to:n+h.toA,insert:N.of(e.text.slice(h.from,h.toB).split(xr))})}else n&&(!t.hasFocus&&t.state.facet(qn)||n.main.eq(s))&&(n=null);if(!i&&!n)return!1;if(!i&&e.typeOver&&!s.empty&&n&&n.main.empty?i={from:s.from,to:s.to,insert:t.state.doc.slice(s.from,s.to)}:i&&i.from>=s.from&&i.to<=s.to&&(i.from!=s.from||i.to!=s.to)&&s.to-s.from-(i.to-i.from)<=4?i={from:s.from,to:s.to,insert:t.state.doc.slice(s.from,i.from).append(i.insert).append(t.state.doc.slice(i.to,s.to))}:(Ci.mac||Ci.android)&&i&&i.from==i.to&&i.from==s.head-1&&/^\. ?$/.test(i.insert.toString())&&"off"==t.contentDOM.getAttribute("autocorrect")?(n&&2==i.insert.length&&(n=$t.single(n.main.anchor-1,n.main.head-1)),i={from:s.from,to:s.to,insert:N.of([" "])}):Ci.chrome&&i&&i.from==i.to&&i.from==s.head&&"\n "==i.insert.toString()&&t.lineWrapping&&(n&&(n=$t.single(n.main.anchor-1,n.main.head-1)),i={from:s.from,to:s.to,insert:N.of([" "])}),i){if(Ci.ios&&t.inputState.flushIOSKey())return!0;if(Ci.android&&(i.from==s.from&&i.to==s.to&&1==i.insert.length&&2==i.insert.lines&&ci(t.contentDOM,"Enter",13)||(i.from==s.from-1&&i.to==s.to&&0==i.insert.length||8==r&&i.insert.lengths.head)&&ci(t.contentDOM,"Backspace",8)||i.from==s.from&&i.to==s.to+1&&0==i.insert.length&&ci(t.contentDOM,"Delete",46)))return!0;let e,o=i.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let a=()=>e||(e=function(t,e,i){let n,s=t.state,r=s.selection.main;if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!i||i.main.empty&&i.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let i=r.frome.to?s.sliceDoc(e.to,r.to):"";n=s.replaceSelection(t.state.toText(i+e.insert.sliceString(0,void 0,t.state.lineBreak)+o))}else{let o=s.changes(e),a=i&&i.main.to<=o.newLength?i.main:void 0;if(s.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=r.to&&e.to>=r.to-10){let l,h=t.state.sliceDoc(e.from,e.to),c=i&&ts(t,i.main.head);if(c){let t=e.insert.length-(e.to-e.from);l={from:c.from,to:c.to-t}}else l=t.state.doc.lineAt(r.head);let O=r.to-e.to,u=r.to-r.from;n=s.changeByRange((i=>{if(i.from==r.from&&i.to==r.to)return{changes:o,range:a||i.map(o)};let n=i.to-O,c=n-h.length;if(i.to-i.from!=u||t.state.sliceDoc(c,n)!=h||i.to>=l.from&&i.from<=l.to)return{range:i};let f=s.changes({from:c,to:n,insert:e.insert}),d=i.to-r.to;return{changes:f,range:a?$t.range(Math.max(0,a.anchor+d),Math.max(0,a.head+d)):i.map(f)}}))}else n={changes:o,selection:a&&s.selection.replaceRange(a)}}let o="input.type";(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,o+=".compose",t.inputState.compositionFirstChange&&(o+=".start",t.inputState.compositionFirstChange=!1));return s.update(n,{userEvent:o,scrollIntoView:!0})}(t,i,n));return t.state.facet(Zn).some((e=>e(t,i.from,i.to,o,a)))||t.dispatch(a()),!0}if(n&&!n.main.eq(s)){let e=!1,i="select";return t.inputState.lastSelectionTime>Date.now()-50&&("select"==t.inputState.lastSelectionOrigin&&(e=!0),i=t.inputState.lastSelectionOrigin),t.dispatch({selection:n,scrollIntoView:e,userEvent:i}),!0}return!1}const Cr={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Ar=Ci.ie&&Ci.ie_version<=11;class Rr{constructor(t){this.view=t,this.active=!1,this.selectionRange=new ri,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver((e=>{for(let t of e)this.queue.push(t);(Ci.ie&&Ci.ie_version<=11||Ci.ios&&t.composing)&&e.some((t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length))?this.flushSoon():this.flush()})),Ar&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver((()=>{var t;(null===(t=this.view.docView)||void 0===t?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))}),{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout((()=>{this.resizeTimeout=-1,this.view.requestMeasure()}),50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout((()=>{this.view.viewState.printing=!1,this.view.requestMeasure()}),500)}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some(((e,i)=>e!=t[i])))){this.gapIntersection.disconnect();for(let e of t)this.gapIntersection.observe(e);this.gaps=t}}onSelectionChange(t){let e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,n=this.selectionRange;if(i.state.facet(qn)?i.root.activeElement!=this.dom:!Fe(i.dom,n))return;let s=n.anchorNode&&i.docView.nearest(n.anchorNode);s&&s.ignoreEvent(t)?e||(this.selectionChanged=!1):(Ci.ie&&Ci.ie_version<=11||Ci.android&&Ci.chrome)&&!i.state.selection.main.empty&&n.focusNode&&Je(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,e=Ci.safari&&11==t.root.nodeType&&function(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}(this.dom.ownerDocument)==this.dom&&function(t){let e=null;function i(t){t.preventDefault(),t.stopImmediatePropagation(),e=t.getTargetRanges()[0]}if(t.contentDOM.addEventListener("beforeinput",i,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",i,!0),!e)return null;let n=e.startContainer,s=e.startOffset,r=e.endContainer,o=e.endOffset,a=t.docView.domAtPos(t.state.selection.main.anchor);Je(a.node,a.offset,r,o)&&([n,s,r,o]=[r,o,n,s]);return{anchorNode:n,anchorOffset:s,focusNode:r,focusOffset:o}}(this.view)||Ue(t.root);if(!e||this.selectionRange.eq(e))return!1;let i=Fe(this.dom,e);return i&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let t=this.delayedAndroidKey;if(t){this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=t.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&t.force&&ci(this.dom,t.key,t.keyCode)}};this.flushingAndroidKey=this.view.win.requestAnimationFrame(t)}this.delayedAndroidKey&&"Enter"!=t||(this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange{this.delayedFlush=-1,this.flush()})))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let e=-1,i=-1,n=!1;for(let s of t){let t=this.readMutation(s);t&&(t.typeOver&&(n=!0),-1==e?({from:e,to:i}=t):(e=Math.min(t.from,e),i=Math.max(t.to,i)))}return{from:e,to:i,typeOver:n}}readChange(){let{from:t,to:e,typeOver:i}=this.processRecords(),n=this.selectionChanged&&Fe(this.dom,this.selectionRange);if(t<0&&!n)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new Tr(this.view,t,e,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let e=this.readChange();if(!e)return this.view.requestMeasure(),!1;let i=this.view.state,n=Xr(this.view,e);return this.view.state==i&&this.view.update([]),n}readMutation(t){let e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty("attributes"==t.type),"attributes"==t.type&&(e.flags|=4),"childList"==t.type){let i=Wr(e,t.previousSibling||t.target.previousSibling,-1),n=Wr(e,t.nextSibling||t.target.nextSibling,1);return{from:i?e.posAfter(i):e.posAtStart,to:n?e.posBefore(n):e.posAtEnd,typeOver:!1}}return"characterData"==t.type?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var t,e,i;this.stop(),null===(t=this.intersection)||void 0===t||t.disconnect(),null===(e=this.gapIntersection)||void 0===e||e.disconnect(),null===(i=this.resizeScroll)||void 0===i||i.disconnect();for(let t of this.scrollTargets)t.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function Wr(t,e,i){for(;e;){let n=pi.get(e);if(n&&n.parent==t)return n;let s=e.parentNode;e=s!=t.dom?s:i>0?e.nextSibling:e.previousSibling}return null}class qr{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);let{dispatch:e}=t;this.dispatchTransactions=t.dispatchTransactions||e&&(t=>t.forEach((t=>e(t,this))))||(t=>this.update(t)),this.dispatch=this.dispatch.bind(this),this._root=t.root||function(t){for(;t;){if(t&&(9==t.nodeType||11==t.nodeType&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}(t.parent)||document,this.viewState=new lr(t.state||me.create(t)),t.scrollTo&&t.scrollTo.is(Rn)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(_n).map((t=>new Mn(t)));for(let t of this.plugins)t.update(this);this.observer=new Rr(this),this.inputState=new gs(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Jn(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...t){let e=1==t.length&&t[0]instanceof oe?t:1==t.length&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(e,this)}update(t){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let e,i=!1,n=!1,s=this.state;for(let e of t){if(e.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=e.state}if(this.destroyed)return void(this.viewState.state=s);let r=this.hasFocus,o=0,a=null;t.some((t=>t.annotation(Es)))?(this.inputState.notifiedFocused=r,o=1):r!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=r,a=js(s,r),a||(o=1));let l=this.observer.delayedAndroidKey,h=null;if(l?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(h=null)):this.observer.clear(),s.facet(me.phrases)!=this.state.facet(me.phrases))return this.setState(s);e=Hn.create(this,s,t),e.flags|=o;let c=this.viewState.scrollTarget;try{this.updateState=2;for(let e of t){if(c&&(c=c.map(e.changes)),e.scrollIntoView){let{main:t}=e.state.selection;c=new An(t.empty?t:$t.cursor(t.head,t.head>t.anchor?-1:1))}for(let t of e.effects)t.is(Rn)&&(c=t.value.clip(this.state))}this.viewState.update(e,c),this.bidiCache=Vr.update(this.bidiCache,e.changes),e.empty||(this.updatePlugins(e),this.inputState.update(e)),i=this.docView.update(e),this.state.facet(Ln)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(i,t.some((t=>t.isUserEvent("select.pointer"))))}finally{this.updateState=0}if(e.startState.facet(gr)!=e.state.facet(gr)&&(this.viewState.mustMeasureContent=!0),(i||n||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!e.empty)for(let t of this.state.facet(Pn))try{t(e)}catch(t){Wn(this.state,t,"update listener")}(a||h)&&Promise.resolve().then((()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!Xr(this,h)&&l.force&&ci(this.contentDOM,l.key,l.keyCode)}))}setState(t){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=t);this.updateState=2;let e=this.hasFocus;try{for(let t of this.plugins)t.destroy(this);this.viewState=new lr(t),this.plugins=t.facet(_n).map((t=>new Mn(t))),this.pluginMap.clear();for(let t of this.plugins)t.update(this);this.docView.destroy(),this.docView=new Jn(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}e&&this.focus(),this.requestMeasure()}updatePlugins(t){let e=t.startState.facet(_n),i=t.state.facet(_n);if(e!=i){let n=[];for(let s of i){let i=e.indexOf(s);if(i<0)n.push(new Mn(s));else{let e=this.plugins[i];e.mustUpdate=t,n.push(e)}}for(let e of this.plugins)e.mustUpdate!=t&&e.destroy(this);this.plugins=n,this.pluginMap.clear()}else for(let e of this.plugins)e.mustUpdate=t;for(let t=0;t-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,t&&this.observer.forceFlush();let e=null,i=this.scrollDOM,n=i.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:r}=this.viewState;Math.abs(n-this.viewState.scrollTop)>1&&(r=-1),this.viewState.scrollAnchorHeight=-1;try{for(let t=0;;t++){if(r<0)if(ui(i))s=-1,r=this.viewState.heightMap.height;else{let t=this.viewState.scrollAnchorAt(n);s=t.from,r=t.top}this.updateState=1;let o=this.viewState.measure(this);if(!o&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(t>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let a=[];4&o||([this.measureRequests,a]=[a,this.measureRequests]);let l=a.map((t=>{try{return t.read(this)}catch(t){return Wn(this.state,t),_r}})),h=Hn.create(this,this.state,[]),c=!1;h.flags|=o,e?e.flags|=o:e=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),c=this.docView.update(h));for(let t=0;t1||t<-1){n+=t,i.scrollTop=n/this.scaleY,r=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(e&&!e.empty)for(let t of this.state.facet(Pn))t(e)}get themeClasses(){return br+" "+(this.state.facet(mr)?yr:wr)+" "+this.state.facet(gr)}updateAttrs(){let t=Mr(this,En,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(qn)?"true":"false",class:"cm-content",style:`${Ci.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),Mr(this,jn,e);let i=this.observer.ignore((()=>{let i=Di(this.contentDOM,this.contentAttrs,e),n=Di(this.dom,this.editorAttrs,t);return i||n}));return this.editorAttrs=t,this.contentAttrs=e,i}showAnnouncements(t){let e=!0;for(let i of t)for(let t of i.effects)if(t.is(qr.announce)){e&&(this.announceDOM.textContent=""),e=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(Ln);let t=this.state.facet(qr.cspNonce);Me.mount(this.root,this.styleModules.concat(vr).reverse(),t?{nonce:t}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame((()=>this.measure()))),t){if(this.measureRequests.indexOf(t)>-1)return;if(null!=t.key)for(let e=0;ee.spec==t))||null),e&&e.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,e,i){return ps(this,t,fs(this,t,e,i))}moveByGroup(t,e){return ps(this,t,fs(this,t,e,(e=>function(t,e,i){let n=t.state.charCategorizer(e),s=n(i);return t=>{let e=n(t);return s==fe.Space&&(s=e),s==e}}(this,t.head,e))))}visualLineSide(t,e){let i=this.bidiSpans(t),n=this.textDirectionAt(t.from),s=i[e?i.length-1:0];return $t.cursor(s.side(e,n)+t.from,s.forward(!e,n)?1:-1)}moveToLineBoundary(t,e,i=!0){return function(t,e,i,n){let s=us(t,e.head),r=n&&s.type==Ni.Text&&(t.lineWrapping||s.widgetLineBreaks)?t.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head):null;if(r){let e=t.dom.getBoundingClientRect(),n=t.textDirectionAt(s.from),o=t.posAtCoords({x:i==(n==sn.LTR)?e.right-1:e.left+1,y:(r.top+r.bottom)/2});if(null!=o)return $t.cursor(o,i?-1:1)}return $t.cursor(i?s.to:s.from,i?-1:1)}(this,t,e,i)}moveVertically(t,e,i){return ps(this,t,function(t,e,i,n){let s=e.head,r=i?1:-1;if(s==(i?t.state.doc.length:0))return $t.cursor(s,e.assoc);let o,a=e.goalColumn,l=t.contentDOM.getBoundingClientRect(),h=t.coordsAtPos(s,e.assoc||-1),c=t.documentTop;if(h)null==a&&(a=h.left-l.left),o=r<0?h.top:h.bottom;else{let e=t.viewState.lineBlockAt(s);null==a&&(a=Math.min(l.right-l.left,t.defaultCharacterWidth*(s-e.from))),o=(r<0?e.top:e.bottom)+c}let O=l.left+a,u=null!=n?n:t.viewState.heightOracle.textHeight>>1;for(let e=0;;e+=10){let i=o+(u+e)*r,n=cs(t,{x:O,y:i},!1,r);if(il.bottom||(r<0?ns)){let e=t.docView.coordsForChar(n),s=!e||i0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(Xn)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>Yr)return wn(t.length);let e,i=this.textDirectionAt(t.from);for(let n of this.bidiCache)if(n.from==t.from&&n.dir==i&&(n.fresh||pn(n.isolates,e=Bn(this,t))))return n.order;e||(e=Bn(this,t));let n=function(t,e,i){if(!t)return[new dn(0,0,e==on?1:0)];if(e==rn&&!i.length&&!fn.test(t))return wn(t.length);if(i.length)for(;t.length>gn.length;)gn[gn.length]=256;let n=[],s=e==rn?0:1;return bn(t,s,s,i,0,t.length,n),n}(t.text,i,e);return this.bidiCache.push(new Vr(t.from,t.to,i,e,!0,n)),n}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||Ci.safari&&(null===(t=this.inputState)||void 0===t?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore((()=>{li(this.contentDOM),this.docView.updateSelection()}))}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((9==t.nodeType?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let t of this.plugins)t.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(t,e={}){return Rn.of(new An("number"==typeof t?$t.cursor(t):t,e.y,e.x,e.yMargin,e.xMargin))}scrollSnapshot(){let{scrollTop:t,scrollLeft:e}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return Rn.of(new An($t.cursor(i.from),"start","start",i.top-t,e,!0))}static domEventHandlers(t){return Vn.define((()=>({})),{eventHandlers:t})}static domEventObservers(t){return Vn.define((()=>({})),{eventObservers:t})}static theme(t,e){let i=Me.newName(),n=[gr.of(i),Ln.of(Qr(`.${i}`,t))];return e&&e.dark&&n.push(mr.of(!0)),n}static baseTheme(t){return Dt.lowest(Ln.of(Qr("."+br,t,Sr)))}static findFromDOM(t){var e;let i=t.querySelector(".cm-content"),n=i&&pi.get(i)||pi.get(t);return(null===(e=null==n?void 0:n.rootView)||void 0===e?void 0:e.view)||null}}qr.styleModule=Ln,qr.inputHandler=Zn,qr.focusChangeEffect=Tn,qr.perLineTextDirection=Xn,qr.exceptionSink=$n,qr.updateListener=Pn,qr.editable=qn,qr.mouseSelectionStyle=kn,qr.dragMovesSelection=xn,qr.clickAddsSelectionRange=vn,qr.decorations=Dn,qr.outerDecorations=zn,qr.atomicRanges=Gn,qr.bidiIsolatedRanges=In,qr.scrollMargins=Nn,qr.darkTheme=mr,qr.cspNonce=Tt.define({combine:t=>t.length?t[0]:""}),qr.contentAttributes=jn,qr.editorAttributes=En,qr.lineWrapping=qr.contentAttributes.of({class:"cm-lineWrapping"}),qr.announce=re.define();const Yr=4096,_r={};class Vr{constructor(t,e,i,n,s,r){this.from=t,this.to=e,this.dir=i,this.isolates=n,this.fresh=s,this.order=r}static update(t,e){if(e.empty&&!t.some((t=>t.fresh)))return t;let i=[],n=t.length?t[t.length-1].dir:sn.LTR;for(let s=Math.max(0,t.length-10);s=0;s--){let e=n[s],r="function"==typeof e?e(t):e;r&&Mi(r,i)}return i}const Er=Ci.mac?"mac":Ci.windows?"win":Ci.linux?"linux":"key";function jr(t,e,i){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==i&&e.shiftKey&&(t="Shift-"+t),t}const Dr=Dt.default(qr.domEventHandlers({keydown:(t,e)=>function(t,e,i,n){let s=function(t){var e=!(Ge&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Ie&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?ze:De)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(e),r=ut(s,0),o=dt(r)==s.length&&" "!=s,a="",l=!1,h=!1,c=!1;Ir&&Ir.view==i&&Ir.scope==n&&(a=Ir.prefix+" ",Ss.indexOf(e.keyCode)<0&&(h=!0,Ir=null));let O,u,f=new Set,d=t=>{if(t){for(let n of t.run)if(!f.has(n)&&(f.add(n),n(i,e)))return t.stopPropagation&&(c=!0),!0;t.preventDefault&&(t.stopPropagation&&(c=!0),h=!0)}return!1},p=t[n];p&&(d(p[a+jr(s,e,!o)])?l=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Ci.windows&&e.ctrlKey&&e.altKey)&&(O=De[e.keyCode])&&O!=s?(d(p[a+jr(O,e,!0)])||e.shiftKey&&(u=ze[e.keyCode])!=s&&u!=O&&d(p[a+jr(u,e,!1)]))&&(l=!0):o&&e.shiftKey&&d(p[a+jr(s,e,!0)])&&(l=!0),!l&&d(p._any)&&(l=!0));h&&(l=!0);l&&c&&e.stopPropagation();return l}(function(t){let e=t.facet(zr),i=Gr.get(e);i||Gr.set(e,i=function(t,e=Er){let i=Object.create(null),n=Object.create(null),s=(t,e)=>{let i=n[t];if(null==i)n[t]=e;else if(i!=e)throw new Error("Key binding "+t+" is used both as a regular binding and as a multi-stroke prefix")},r=(t,n,r,o,a)=>{var l,h;let c=i[t]||(i[t]=Object.create(null)),O=n.split(/ (?!$)/).map((t=>function(t,e){const i=t.split(/-(?!$)/);let n,s,r,o,a=i[i.length-1];"Space"==a&&(a=" ");for(let t=0;t{let n=Ir={view:e,prefix:i,scope:t};return setTimeout((()=>{Ir==n&&(Ir=null)}),Br),!0}]})}let u=O.join(" ");s(u,!1);let f=c[u]||(c[u]={preventDefault:!1,stopPropagation:!1,run:(null===(h=null===(l=c._any)||void 0===l?void 0:l.run)||void 0===h?void 0:h.slice())||[]});r&&f.run.push(r),o&&(f.preventDefault=!0),a&&(f.stopPropagation=!0)};for(let n of t){let t=n.scope?n.scope.split(" "):["editor"];if(n.any)for(let e of t){let t=i[e]||(i[e]=Object.create(null));t._any||(t._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let e in t)t[e].run.push(n.any)}let s=n[e]||n.key;if(s)for(let e of t)r(e,s,n.run,n.preventDefault,n.stopPropagation),n.shift&&r(e,"Shift-"+s,n.shift,n.preventDefault,n.stopPropagation)}return i}(e.reduce(((t,e)=>t.concat(e)),[])));return i}(e.state),t,e,"editor")})),zr=Tt.define({enables:Dr}),Gr=new WeakMap;let Ir=null;const Br=4e3;class Nr{constructor(t,e,i,n,s){this.className=t,this.left=e,this.top=i,this.width=n,this.height=s}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,e){return e.className==this.className&&(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",null!=this.width&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,e,i){if(i.empty){let n=t.coordsAtPos(i.head,i.assoc||1);if(!n)return[];let s=Ur(t);return[new Nr(e,n.left-s.left,n.top-s.top,null,n.bottom-n.top)]}return function(t,e,i){if(i.to<=t.viewport.from||i.from>=t.viewport.to)return[];let n=Math.max(i.from,t.viewport.from),s=Math.min(i.to,t.viewport.to),r=t.textDirection==sn.LTR,o=t.contentDOM,a=o.getBoundingClientRect(),l=Ur(t),h=o.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),O=a.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),u=a.right-(c?parseInt(c.paddingRight):0),f=us(t,n),d=us(t,s),p=f.type==Ni.Text?f:null,g=d.type==Ni.Text?d:null;p&&(t.lineWrapping||f.widgetLineBreaks)&&(p=Lr(t,n,p));g&&(t.lineWrapping||d.widgetLineBreaks)&&(g=Lr(t,s,g));if(p&&g&&p.from==g.from)return b(w(i.from,i.to,p));{let e=p?w(i.from,null,p):y(f,!1),n=g?w(null,i.to,g):y(d,!0),s=[];return(p||f).to<(g||d).from-(p&&g?1:0)||f.widgetLineBreaks>1&&e.bottom+t.defaultLineHeight/2h&&n.from=r)break;a>s&&l(Math.max(t,s),null==e&&t<=h,Math.min(a,r),null==i&&a>=c,o.dir)}if(s=n.to+1,s>=r)break}return 0==a.length&&l(h,null==e,c,null==i,t.textDirection),{top:s,bottom:o,horizontal:a}}function y(t,e){let i=a.top+(e?t.top:t.bottom);return{top:i,bottom:i,horizontal:[]}}}(t,e,i)}}function Ur(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==sn.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function Lr(t,e,i){let n=$t.cursor(e);return{from:Math.max(i.from,t.moveToLineBoundary(n,!1,!0).from),to:Math.min(i.to,t.moveToLineBoundary(n,!0,!0).from),type:Ni.Text}}class Fr{constructor(t,e){this.view=t,this.layer=e,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),e.above&&this.dom.classList.add("cm-layer-above"),e.class&&this.dom.classList.add(e.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),e.mount&&e.mount(this.dom,t)}update(t){t.startState.facet(Hr)!=t.state.facet(Hr)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}setOrder(t){let e=0,i=t.facet(Hr);for(;e{return i=t,n=this.drawn[e],!(i.constructor==n.constructor&&i.eq(n));var i,n}))){let e=this.dom.firstChild,i=0;for(let n of t)n.update&&e&&n.constructor&&this.drawn[i].constructor&&n.update(e,this.drawn[i])?(e=e.nextSibling,i++):this.dom.insertBefore(n.draw(),e);for(;e;){let t=e.nextSibling;e.remove(),e=t}this.drawn=t}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Hr=Tt.define();function Jr(t){return[Vn.define((e=>new Fr(e,t))),Hr.of(t)]}const Kr=!Ci.ios,to=Tt.define({combine:t=>be(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(t,e)=>Math.min(t,e),drawRangeCursor:(t,e)=>t||e})});function eo(t={}){return[to.of(t),no,ro,ao,Cn.of(!0)]}function io(t){return t.startState.facet(to)!=t.state.facet(to)}const no=Jr({above:!0,markers(t){let{state:e}=t,i=e.facet(to),n=[];for(let s of e.selection.ranges){let r=s==e.selection.main;if(s.empty?!r||Kr:i.drawRangeCursor){let e=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",i=s.empty?s:$t.cursor(s.head,s.head>s.anchor?-1:1);for(let s of Nr.forRange(t,e,i))n.push(s)}}return n},update(t,e){t.transactions.some((t=>t.selection))&&(e.style.animationName="cm-blink"==e.style.animationName?"cm-blink2":"cm-blink");let i=io(t);return i&&so(t.state,e),t.docChanged||t.selectionSet||i},mount(t,e){so(e.state,t)},class:"cm-cursorLayer"});function so(t,e){e.style.animationDuration=t.facet(to).cursorBlinkRate+"ms"}const ro=Jr({above:!1,markers:t=>t.state.selection.ranges.map((e=>e.empty?[]:Nr.forRange(t,"cm-selectionBackground",e))).reduce(((t,e)=>t.concat(e))),update:(t,e)=>t.docChanged||t.selectionSet||t.viewportChanged||io(t),class:"cm-selectionLayer"}),oo={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};Kr&&(oo[".cm-line"].caretColor="transparent !important",oo[".cm-content"]={caretColor:"transparent !important"});const ao=Dt.highest(qr.theme(oo));function lo(t,e,i,n,s){e.lastIndex=0;for(let r,o=t.iterRange(i,n),a=i;!o.next().done;a+=o.value.length)if(!o.lineBreak)for(;r=e.exec(o.value);)s(a+r.index,r)}class ho{constructor(t){const{regexp:e,decoration:i,decorate:n,boundary:s,maxLength:r=1e3}=t;if(!e.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=e,n)this.addMatch=(t,e,i,s)=>n(s,i,i+t[0].length,t,e);else if("function"==typeof i)this.addMatch=(t,e,n,s)=>{let r=i(t,e,n);r&&s(n,n+t[0].length,r)};else{if(!i)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=(t,e,n,s)=>s(n,n+t[0].length,i)}this.boundary=s,this.maxLength=r}createDeco(t){let e=new xe,i=e.add.bind(e);for(let{from:e,to:n}of function(t,e){let i=t.visibleRanges;if(1==i.length&&i[0].from==t.viewport.from&&i[0].to==t.viewport.to)return i;let n=[];for(let{from:s,to:r}of i)s=Math.max(t.state.doc.lineAt(s).from,s-e),r=Math.min(t.state.doc.lineAt(r).to,r+e),n.length&&n[n.length-1].to>=s?n[n.length-1].to=r:n.push({from:s,to:r});return n}(t,this.maxLength))lo(t.state.doc,this.regexp,e,n,((e,n)=>this.addMatch(n,t,e,i)));return e.finish()}updateDeco(t,e){let i=1e9,n=-1;return t.docChanged&&t.changes.iterChanges(((e,s,r,o)=>{o>t.view.viewport.from&&r1e3?this.createDeco(t.view):n>-1?this.updateRange(t.view,e.map(t.changes),i,n):e}updateRange(t,e,i,n){for(let s of t.visibleRanges){let r=Math.max(s.from,i),o=Math.min(s.to,n);if(o>r){let i=t.state.doc.lineAt(r),n=i.toi.from;r--)if(this.boundary.test(i.text[r-1-i.from])){a=r;break}for(;oc.push(i.range(t,e));if(i==n)for(this.regexp.lastIndex=a-i.from;(h=this.regexp.exec(i.text))&&h.indexthis.addMatch(i,t,e,O)));e=e.update({filterFrom:a,filterTo:l,filter:(t,e)=>tl,add:c})}}return e}}const co=null!=/x/.unicode?"gu":"g",Oo=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\ufeff-]",co),uo={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let fo=null;const po=Tt.define({combine(t){let e=be(t,{render:null,specialChars:Oo,addSpecialChars:null});return(e.replaceTabs=!function(){var t;if(null==fo&&"undefined"!=typeof document&&document.body){let e=document.body.style;fo=null!=(null!==(t=e.tabSize)&&void 0!==t?t:e.MozTabSize)}return fo||!1}())&&(e.specialChars=new RegExp("\t|"+e.specialChars.source,co)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,co)),e}});function go(t={}){return[po.of(t),mo||(mo=Vn.fromClass(class{constructor(t){this.view=t,this.decorations=Ui.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(po)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new ho({regexp:t.specialChars,decoration:(e,i,n)=>{let{doc:s}=i.state,r=ut(e[0],0);if(9==r){let t=s.lineAt(n),e=i.state.tabSize,r=qe(t.text,e,n-t.from);return Ui.replace({widget:new wo((e-r%e)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=Ui.replace({widget:new bo(t,r)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(po);t.startState.facet(po)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))]}let mo=null;class bo extends Bi{constructor(t,e){super(),this.options=t,this.code=e}eq(t){return t.code==this.code}toDOM(t){let e=function(t){return t>=32?"•":10==t?"␤":String.fromCharCode(9216+t)}(this.code),i=t.state.phrase("Control character")+" "+(uo[this.code]||"0x"+this.code.toString(16)),n=this.options.render&&this.options.render(this.code,i,e);if(n)return n;let s=document.createElement("span");return s.textContent=e,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class wo extends Bi{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent="\t",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}const yo=Vn.fromClass(class{constructor(){this.height=1e3,this.attrs={style:"padding-bottom: 1000px"}}update(t){let{view:e}=t,i=e.viewState.editorHeight*e.scaleY-e.defaultLineHeight-e.documentPadding.top-.5;i>=0&&i!=this.height&&(this.height=i,this.attrs={style:`padding-bottom: ${i}px`})}});function So(){return[yo,jn.of((t=>{var e;return(null===(e=t.plugin(yo))||void 0===e?void 0:e.attrs)||null}))]}class Qo extends Bi{constructor(t){super(),this.content=t}toDOM(){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild("string"==typeof this.content?document.createTextNode(this.content):this.content),"string"==typeof this.content?t.setAttribute("aria-label","placeholder "+this.content):t.setAttribute("aria-hidden","true"),t}coordsAt(t){let e=t.firstChild?He(t.firstChild):[];if(!e.length)return null;let i=window.getComputedStyle(t.parentNode),n=ii(e[0],"rtl"!=i.direction),s=parseInt(i.lineHeight);return n.bottom-n.top>1.5*s?{left:n.left,right:n.right,top:n.top,bottom:n.top+s}:n}ignoreEvent(){return!1}}function vo(t){return Vn.fromClass(class{constructor(e){this.view=e,this.placeholder=t?Ui.set([Ui.widget({widget:new Qo(t),side:1}).range(0)]):Ui.none}get decorations(){return this.view.state.doc.length?Ui.none:this.placeholder}},{decorations:t=>t.decorations})}const xo="-10000px";class ko{constructor(t,e,i){this.facet=e,this.createTooltipView=i,this.input=t.state.facet(e),this.tooltips=this.input.filter((t=>t)),this.tooltipViews=this.tooltips.map(i)}update(t,e){var i;let n=t.state.facet(this.facet),s=n.filter((t=>t));if(n===this.input){for(let e of this.tooltipViews)e.update&&e.update(t);return!1}let r=[],o=e?[]:null;for(let i=0;ie[i]=t)),e.length=o.length),this.input=n,this.tooltips=s,this.tooltipViews=r,!0}}function $o(t={}){return Zo.of(t)}function Po(t){let{win:e}=t;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const Zo=Tt.define({combine:t=>{var e,i,n;return{position:Ci.ios?"absolute":(null===(e=t.find((t=>t.position)))||void 0===e?void 0:e.position)||"fixed",parent:(null===(i=t.find((t=>t.parent)))||void 0===i?void 0:i.parent)||null,tooltipSpace:(null===(n=t.find((t=>t.tooltipSpace)))||void 0===n?void 0:n.tooltipSpace)||Po}}}),To=new WeakMap,Xo=Vn.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(Zo);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new ko(t,Ro,(t=>this.createTooltip(t))),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver((t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()}),{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout((()=>{this.measureTimeout=-1,this.maybeMeasure()}),50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let i=e||t.geometryChanged,n=t.state.facet(Zo);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let t of this.manager.tooltipViews)t.dom.style.position=this.position;i=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let t of this.manager.tooltipViews)this.container.appendChild(t.dom);i=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);i&&this.maybeMeasure()}createTooltip(t){let e=t.create(this.view);if(e.dom.classList.add("cm-tooltip"),t.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",e.dom.appendChild(t)}return e.dom.style.position=this.position,e.dom.style.top=xo,e.dom.style.left="0px",this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var t,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let e of this.manager.tooltipViews)e.dom.remove(),null===(t=e.destroy)||void 0===t||t.call(e);this.parent&&this.container.remove(),null===(e=this.intersectionObserver)||void 0===e||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=this.view.dom.getBoundingClientRect(),e=1,i=1,n=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:t}=this.manager.tooltipViews[0];if(Ci.gecko)n=t.offsetParent!=this.container.ownerDocument.body;else if(t.style.top==xo&&"0px"==t.style.left){let e=t.getBoundingClientRect();n=Math.abs(e.top+1e4)>1||Math.abs(e.left)>1}}if(n||"absolute"==this.position)if(this.parent){let t=this.parent.getBoundingClientRect();t.width&&t.height&&(e=t.width/this.parent.offsetWidth,i=t.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:i}=this.view.viewState);return{editor:t,parent:this.parent?this.container.getBoundingClientRect():t,pos:this.manager.tooltips.map(((t,e)=>{let i=this.manager.tooltipViews[e];return i.getCoords?i.getCoords(t.pos):this.view.coordsAtPos(t.pos)})),size:this.manager.tooltipViews.map((({dom:t})=>t.getBoundingClientRect())),space:this.view.state.facet(Zo).tooltipSpace(this.view),scaleX:e,scaleY:i,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let t of this.manager.tooltipViews)t.dom.style.position="absolute"}let{editor:i,space:n,scaleX:s,scaleY:r}=t,o=[];for(let a=0;a=Math.min(i.bottom,n.bottom)||O.rightMath.min(i.right,n.right)+.1){c.style.top=xo;continue}let f=l.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,d=f?7:0,p=u.right-u.left,g=null!==(e=To.get(h))&&void 0!==e?e:u.bottom-u.top,m=h.offset||Ao,b=this.view.textDirection==sn.LTR,w=u.width>n.right-n.left?b?n.left:n.right-u.width:b?Math.min(O.left-(f?14:0)+m.x,n.right-p):Math.max(n.left,O.left-p+(f?14:0)-m.x),y=this.above[a];!l.strictSide&&(y?O.top-(u.bottom-u.top)-m.yn.bottom)&&y==n.bottom-O.bottom>O.top-n.top&&(y=this.above[a]=!y);let S=(y?O.top-n.top:n.bottom-O.bottom)-d;if(Sw&&t.topQ&&(Q=y?t.top-g-2-d:t.bottom+d+2);if("absolute"==this.position?(c.style.top=(Q-t.parent.top)/r+"px",c.style.left=(w-t.parent.left)/s+"px"):(c.style.top=Q/r+"px",c.style.left=w/s+"px"),f){let t=O.left+(b?m.x:-m.x)-(w+14-7);f.style.left=t/s+"px"}!0!==h.overlap&&o.push({left:w,top:Q,right:v,bottom:Q+g}),c.classList.toggle("cm-tooltip-above",y),c.classList.toggle("cm-tooltip-below",!y),h.positioned&&h.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=xo}},{eventObservers:{scroll(){this.maybeMeasure()}}}),Co=qr.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),Ao={x:0,y:0},Ro=Tt.define({enables:[Xo,Co]});function Wo(t,e){let i=t.plugin(Xo);if(!i)return null;let n=i.manager.tooltips.indexOf(e);return n<0?null:i.manager.tooltipViews[n]}function qo(t){let e=t.plugin(Xo);e&&e.maybeMeasure()}const Yo=Tt.define({combine(t){let e,i;for(let n of t)e=e||n.topContainer,i=i||n.bottomContainer;return{topContainer:e,bottomContainer:i}}}),_o=Vn.fromClass(class{constructor(t){this.input=t.state.facet(Eo),this.specs=this.input.filter((t=>t)),this.panels=this.specs.map((e=>e(t)));let e=t.state.facet(Yo);this.top=new Vo(t,!0,e.topContainer),this.bottom=new Vo(t,!1,e.bottomContainer),this.top.sync(this.panels.filter((t=>t.top))),this.bottom.sync(this.panels.filter((t=>!t.top)));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(t){let e=t.state.facet(Yo);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Vo(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Vo(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let i=t.state.facet(Eo);if(i!=this.input){let e=i.filter((t=>t)),n=[],s=[],r=[],o=[];for(let i of e){let e,a=this.specs.indexOf(i);a<0?(e=i(t.view),o.push(e)):(e=this.panels[a],e.update&&e.update(t)),n.push(e),(e.top?s:r).push(e)}this.specs=e,this.panels=n,this.top.sync(s),this.bottom.sync(r);for(let t of o)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}else for(let e of this.panels)e.update&&e.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>qr.scrollMargins.of((e=>{let i=e.plugin(t);return i&&{top:i.top.scrollMargin(),bottom:i.bottom.scrollMargin()}}))});class Vo{constructor(t,e,i){this.view=t,this.top=e,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let e of this.panels)e.destroy&&t.indexOf(e)<0&&e.destroy();this.panels=t,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let t=this.dom.firstChild;for(let e of this.panels)if(e.dom.parentNode==this.dom){for(;t!=e.dom;)t=Mo(t);t=t.nextSibling}else this.dom.insertBefore(e.dom,t);for(;t;)t=Mo(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function Mo(t){let e=t.nextSibling;return t.remove(),e}const Eo=Tt.define({enables:_o});class jo extends we{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}jo.prototype.elementClass="",jo.prototype.toDOM=void 0,jo.prototype.mapMode=gt.TrackBefore,jo.prototype.startSide=jo.prototype.endSide=-1,jo.prototype.point=!0;const Do=Tt.define(),zo={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>ve.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},Go=Tt.define();function Io(t){return[No(),Go.of(Object.assign(Object.assign({},zo),t))]}const Bo=Tt.define({combine:t=>t.some((t=>t))});function No(t){let e=[Uo];return t&&!1===t.fixed&&e.push(Bo.of(!0)),e}const Uo=Vn.fromClass(class{constructor(t){this.view=t,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Go).map((e=>new Jo(t,e)));for(let t of this.gutters)this.dom.appendChild(t.dom);this.fixed=!t.state.facet(Bo),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}update(t){if(this.updateGutters(t)){let e=this.prevViewport,i=t.view.viewport,n=Math.min(e.to,i.to)-Math.max(e.from,i.from);this.syncGutters(n<.8*(i.to-i.from))}t.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(Bo)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&this.dom.remove();let i=ve.iter(this.view.state.facet(Do),this.view.viewport.from),n=[],s=this.gutters.map((t=>new Ho(t,this.view.viewport,-this.view.documentPadding.top)));for(let t of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(t.type)){let e=!0;for(let r of t.type)if(r.type==Ni.Text&&e){Fo(i,n,r.from);for(let t of s)t.line(this.view,r,n);e=!1}else if(r.widget)for(let t of s)t.widget(this.view,r)}else if(t.type==Ni.Text){Fo(i,n,t.from);for(let e of s)e.line(this.view,t,n)}else if(t.widget)for(let e of s)e.widget(this.view,t);for(let t of s)t.finish();t&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(t){let e=t.startState.facet(Go),i=t.state.facet(Go),n=t.docChanged||t.heightChanged||t.viewportChanged||!ve.eq(t.startState.facet(Do),t.state.facet(Do),t.view.viewport.from,t.view.viewport.to);if(e==i)for(let e of this.gutters)e.update(t)&&(n=!0);else{n=!0;let s=[];for(let n of i){let i=e.indexOf(n);i<0?s.push(new Jo(this.view,n)):(this.gutters[i].update(t),s.push(this.gutters[i]))}for(let t of this.gutters)t.dom.remove(),s.indexOf(t)<0&&t.destroy();for(let t of s)this.dom.appendChild(t.dom);this.gutters=s}return n}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove()}},{provide:t=>qr.scrollMargins.of((e=>{let i=e.plugin(t);return i&&0!=i.gutters.length&&i.fixed?e.textDirection==sn.LTR?{left:i.dom.offsetWidth*e.scaleX}:{right:i.dom.offsetWidth*e.scaleX}:null}))});function Lo(t){return Array.isArray(t)?t:[t]}function Fo(t,e,i){for(;t.value&&t.from<=i;)t.from==i&&e.push(t.value),t.next()}class Ho{constructor(t,e,i){this.gutter=t,this.height=i,this.i=0,this.cursor=ve.iter(t.markers,e.from)}addElement(t,e,i){let{gutter:n}=this,s=(e.top-this.height)/t.scaleY,r=e.height/t.scaleY;if(this.i==n.elements.length){let e=new Ko(t,r,s,i);n.elements.push(e),n.dom.appendChild(e.dom)}else n.elements[this.i].update(t,r,s,i);this.height=e.bottom,this.i++}line(t,e,i){let n=[];Fo(this.cursor,n,e.from),i.length&&(n=n.concat(i));let s=this.gutter.config.lineMarker(t,e,n);s&&n.unshift(s);let r=this.gutter;(0!=n.length||r.config.renderEmptyElements)&&this.addElement(t,e,n)}widget(t,e){let i=this.gutter.config.widgetMarker(t,e.widget,e);i&&this.addElement(t,e,[i])}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let e=t.elements.pop();t.dom.removeChild(e.dom),e.destroy()}}}class Jo{constructor(t,e){this.view=t,this.config=e,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in e.domEventHandlers)this.dom.addEventListener(i,(n=>{let s,r=n.target;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let t=r.getBoundingClientRect();s=(t.top+t.bottom)/2}else s=n.clientY;let o=t.lineBlockAtHeight(s-t.documentTop);e.domEventHandlers[i](t,o,n)&&n.preventDefault()}));this.markers=Lo(e.markers(t)),e.initialSpacer&&(this.spacer=new Ko(t,0,0,[e.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let e=this.markers;if(this.markers=Lo(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let e=this.config.updateSpacer(this.spacer.markers[0],t);e!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[e])}let i=t.view.viewport;return!ve.eq(this.markers,e,i.from,i.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(t)}destroy(){for(let t of this.elements)t.destroy()}}class Ko{constructor(t,e,i,n){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,e,i,n)}update(t,e,i,n){this.height!=e&&(this.height=e,this.dom.style.height=e+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),function(t,e){if(t.length!=e.length)return!1;for(let i=0;ibe(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(t,e){let i=Object.assign({},t);for(let t in e){let n=i[t],s=e[t];i[t]=n?(t,e,i)=>n(t,e,i)||s(t,e,i):s}return i}})});class ia extends jo{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function na(t,e){return t.state.facet(ea).formatNumber(e,t.state)}const sa=Go.compute([ea],(t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:t=>t.state.facet(ta),lineMarker:(t,e,i)=>i.some((t=>t.toDOM))?null:new ia(na(t,t.state.doc.lineAt(e.from).number)),widgetMarker:()=>null,lineMarkerChange:t=>t.startState.facet(ea)!=t.state.facet(ea),initialSpacer:t=>new ia(na(t,oa(t.state.doc.lines))),updateSpacer(t,e){let i=na(e.view,oa(e.view.state.doc.lines));return i==t.number?t:new ia(i)},domEventHandlers:t.facet(ea).domEventHandlers})));function ra(t={}){return[ea.of(t),No(),sa]}function oa(t){let e=9;for(;ee.modified.indexOf(t)>-1?e:ca.get(e.base||e,e.modified.concat(t).sort(((t,e)=>t.id-e.id)))}}let ha=0;class ca{constructor(){this.instances=[],this.id=ha++}static get(t,e){if(!e.length)return t;let i=e[0].instances.find((i=>{return i.base==t&&(n=e,s=i.modified,n.length==s.length&&n.every(((t,e)=>t==s[e])));var n,s}));if(i)return i;let n=[],s=new la(n,t,e);for(let t of e)t.instances.push(s);let r=function(t){let e=[[]];for(let i=0;ie.length-t.length))}(e);for(let e of t.set)if(!e.modified.length)for(let t of r)n.push(ca.get(e,t));return s}}function Oa(t){let e=Object.create(null);for(let i in t){let n=t[i];Array.isArray(n)||(n=[n]);for(let t of i.split(" "))if(t){let i=[],s=2,r=t;for(let e=0;;){if("..."==r&&e>0&&e+3==t.length){s=1;break}let n=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(r);if(!n)throw new RangeError("Invalid path: "+t);if(i.push("*"==n[0]?"":'"'==n[0][0]?JSON.parse(n[0]):n[0]),e+=n[0].length,e==t.length)break;let o=t[e++];if(e==t.length&&"!"==o){s=0;break}if("/"!=o)throw new RangeError("Invalid path: "+t);r=t.slice(e)}let o=i.length-1,a=i[o];if(!a)throw new RangeError("Invalid path: "+t);let l=new fa(n,s,o>0?i.slice(0,o):null);e[a]=l.sort(e[a])}}return ua.add(e)}const ua=new n;class fa{constructor(t,e,i,n){this.tags=t,this.mode=e,this.context=i,this.next=n}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(t){return!t||t.depth{let e=s;for(let n of t)for(let t of n.set){let n=i[t.id];if(n){e=e?e+" "+n:n;break}}return e},scope:n}}function pa(t,e,i,n=0,s=t.length){let r=new ga(n,Array.isArray(e)?e:[e],i);r.highlightRange(t.cursor(),n,s,"",r.highlighters),r.flush(s)}fa.empty=new fa([],2,null);class ga{constructor(t,e,i){this.at=t,this.highlighters=e,this.span=i,this.class=""}startSpan(t,e){e!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=e)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,e,i,s,r){let{type:o,from:a,to:l}=t;if(a>=i||l<=e)return;o.isTop&&(r=this.highlighters.filter((t=>!t.scope||t.scope(o))));let h=s,c=function(t){let e=t.type.prop(ua);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}(t)||fa.empty,O=function(t,e){let i=null;for(let n of t){let t=n.style(e);t&&(i=i?i+" "+t:t)}return i}(r,c.tags);if(O&&(h&&(h+=" "),h+=O,1==c.mode&&(s+=(s?" ":"")+O)),this.startSpan(Math.max(e,a),h),c.opaque)return;let u=t.tree&&t.tree.prop(n.mounted);if(u&&u.overlay){let n=t.node.enter(u.overlay[0].from+a,1),o=this.highlighters.filter((t=>!t.scope||t.scope(u.tree.type))),c=t.firstChild();for(let O=0,f=a;;O++){let d=O=p)&&t.nextSibling()););if(!d||p>i)break;f=d.to+a,f>e&&(this.highlightRange(n.cursor(),Math.max(e,d.from+a),Math.min(i,f),"",o),this.startSpan(Math.min(i,f),h))}c&&t.parent()}else if(t.firstChild()){u&&(s="");do{if(!(t.to<=e)){if(t.from>=i)break;this.highlightRange(t,e,i,s,r),this.startSpan(Math.min(i,t.to),h)}}while(t.nextSibling());t.parent()}}}const ma=la.define,ba=ma(),wa=ma(),ya=ma(wa),Sa=ma(wa),Qa=ma(),va=ma(Qa),xa=ma(Qa),ka=ma(),$a=ma(ka),Pa=ma(),Za=ma(),Ta=ma(),Xa=ma(Ta),Ca=ma(),Aa={comment:ba,lineComment:ma(ba),blockComment:ma(ba),docComment:ma(ba),name:wa,variableName:ma(wa),typeName:ya,tagName:ma(ya),propertyName:Sa,attributeName:ma(Sa),className:ma(wa),labelName:ma(wa),namespace:ma(wa),macroName:ma(wa),literal:Qa,string:va,docString:ma(va),character:ma(va),attributeValue:ma(va),number:xa,integer:ma(xa),float:ma(xa),bool:ma(Qa),regexp:ma(Qa),escape:ma(Qa),color:ma(Qa),url:ma(Qa),keyword:Pa,self:ma(Pa),null:ma(Pa),atom:ma(Pa),unit:ma(Pa),modifier:ma(Pa),operatorKeyword:ma(Pa),controlKeyword:ma(Pa),definitionKeyword:ma(Pa),moduleKeyword:ma(Pa),operator:Za,derefOperator:ma(Za),arithmeticOperator:ma(Za),logicOperator:ma(Za),bitwiseOperator:ma(Za),compareOperator:ma(Za),updateOperator:ma(Za),definitionOperator:ma(Za),typeOperator:ma(Za),controlOperator:ma(Za),punctuation:Ta,separator:ma(Ta),bracket:Xa,angleBracket:ma(Xa),squareBracket:ma(Xa),paren:ma(Xa),brace:ma(Xa),content:ka,heading:$a,heading1:ma($a),heading2:ma($a),heading3:ma($a),heading4:ma($a),heading5:ma($a),heading6:ma($a),contentSeparator:ma(ka),list:ma(ka),quote:ma(ka),emphasis:ma(ka),strong:ma(ka),link:ma(ka),monospace:ma(ka),strikethrough:ma(ka),inserted:ma(),deleted:ma(),changed:ma(),invalid:ma(),meta:Ca,documentMeta:ma(Ca),annotation:ma(Ca),processingInstruction:ma(Ca),definition:la.defineModifier(),constant:la.defineModifier(),function:la.defineModifier(),standard:la.defineModifier(),local:la.defineModifier(),special:la.defineModifier()};var Ra;da([{tag:Aa.link,class:"tok-link"},{tag:Aa.heading,class:"tok-heading"},{tag:Aa.emphasis,class:"tok-emphasis"},{tag:Aa.strong,class:"tok-strong"},{tag:Aa.keyword,class:"tok-keyword"},{tag:Aa.atom,class:"tok-atom"},{tag:Aa.bool,class:"tok-bool"},{tag:Aa.url,class:"tok-url"},{tag:Aa.labelName,class:"tok-labelName"},{tag:Aa.inserted,class:"tok-inserted"},{tag:Aa.deleted,class:"tok-deleted"},{tag:Aa.literal,class:"tok-literal"},{tag:Aa.string,class:"tok-string"},{tag:Aa.number,class:"tok-number"},{tag:[Aa.regexp,Aa.escape,Aa.special(Aa.string)],class:"tok-string2"},{tag:Aa.variableName,class:"tok-variableName"},{tag:Aa.local(Aa.variableName),class:"tok-variableName tok-local"},{tag:Aa.definition(Aa.variableName),class:"tok-variableName tok-definition"},{tag:Aa.special(Aa.variableName),class:"tok-variableName2"},{tag:Aa.definition(Aa.propertyName),class:"tok-propertyName tok-definition"},{tag:Aa.typeName,class:"tok-typeName"},{tag:Aa.namespace,class:"tok-namespace"},{tag:Aa.className,class:"tok-className"},{tag:Aa.macroName,class:"tok-macroName"},{tag:Aa.propertyName,class:"tok-propertyName"},{tag:Aa.operator,class:"tok-operator"},{tag:Aa.comment,class:"tok-comment"},{tag:Aa.meta,class:"tok-meta"},{tag:Aa.invalid,class:"tok-invalid"},{tag:Aa.punctuation,class:"tok-punctuation"}]);const Wa=new n;function qa(t){return Tt.define({combine:t?e=>e.concat(t):void 0})}const Ya=new n;class _a{constructor(t,e,i=[],n=""){this.data=t,this.name=n,me.prototype.hasOwnProperty("tree")||Object.defineProperty(me.prototype,"tree",{get(){return Ea(this)}}),this.parser=e,this.extension=[Fa.of(this),me.languageData.of(((t,e,i)=>{let n=Va(t,e,i),s=n.type.prop(Wa);if(!s)return[];let r=t.facet(s),o=n.type.prop(Ya);if(o){let s=n.resolve(e-n.from,i);for(let e of o)if(e.test(s,t)){let i=t.facet(e.facet);return"replace"==e.type?i:i.concat(r)}}return r}))].concat(i)}isActiveAt(t,e,i=-1){return Va(t,e,i).type.prop(Wa)==this.data}findRegions(t){let e=t.facet(Fa);if((null==e?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let i=[],s=(t,e)=>{if(t.prop(Wa)==this.data)return void i.push({from:e,to:e+t.length});let r=t.prop(n.mounted);if(r){if(r.tree.prop(Wa)==this.data){if(r.overlay)for(let t of r.overlay)i.push({from:t.from+e,to:t.to+e});else i.push({from:e,to:e+t.length});return}if(r.overlay){let t=i.length;if(s(r.tree,r.overlay[0].from+e),i.length>t)return}}for(let i=0;it.isTop?e:void 0))]}),t.name)}configure(t,e){return new Ma(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Ea(t){let e=t.field(_a.state,!1);return e?e.tree:O.empty}function ja(t,e,i=50){var n;let s=null===(n=t.field(_a.state,!1))||void 0===n?void 0:n.context;if(!s)return null;let r=s.viewport;s.updateViewport({from:0,to:e});let o=s.isDone(e)||s.work(i,e)?s.tree:null;return s.updateViewport(r),o}class Da{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let i=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-i,e-i)}}let za=null;class Ga{constructor(t,e,i=[],n,s,r,o,a){this.parser=t,this.state=e,this.fragments=i,this.tree=n,this.treeLen=s,this.viewport=r,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(t,e,i){return new Ga(t,e,[],O.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Da(this.state.doc),this.fragments)}work(t,e){return null!=e&&e>=this.state.doc.length&&(e=void 0),this.tree!=O.empty&&this.isDone(null!=e?e:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var i;if("number"==typeof t){let e=Date.now()+t;t=()=>Date.now()>e}for(this.parse||(this.parse=this.startParse()),null!=e&&(null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&e=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext((()=>{for(;!(e=this.parse.advance()););})),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(X.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=za;za=this;try{return t()}finally{za=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=Ia(t,e.from,e.to);return t}changes(t,e){let{fragments:i,tree:n,treeLen:s,viewport:r,skipped:o}=this;if(this.takeTree(),!t.empty){let e=[];if(t.iterChangedRanges(((t,i,n,s)=>e.push({fromA:t,toA:i,fromB:n,toB:s}))),i=X.applyChanges(i,e),n=O.empty,s=0,r={from:t.mapPos(r.from,-1),to:t.mapPos(r.to,1)},this.skipped.length){o=[];for(let e of this.skipped){let i=t.mapPos(e.from,1),n=t.mapPos(e.to,-1);it.from&&(this.fragments=Ia(this.fragments,i,n),this.skipped.splice(e--,1))}return!(this.skipped.length>=e)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends C{createParse(e,i,n){let s=n[0].from,r=n[n.length-1].to;return{parsedPos:s,advance(){let e=za;if(e){for(let t of n)e.tempSkipped.push(t);t&&(e.scheduleOn=e.scheduleOn?Promise.all([e.scheduleOn,t]):t)}return this.parsedPos=r,new O(o.none,[],[],r-s)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&0==e[0].from&&e[0].to>=t}static get(){return za}}function Ia(t,e,i){return X.applyChanges(t,[{fromA:e,toA:i,fromB:e,toB:i}])}class Ba{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,i)||e.takeTree(),new Ba(e)}static init(t){let e=Math.min(3e3,t.doc.length),i=Ga.create(t.facet(Fa).parser,t,{from:0,to:e});return i.work(20,e)||i.takeTree(),new Ba(i)}}_a.state=Yt.define({create:Ba.init,update(t,e){for(let t of e.effects)if(t.is(_a.setState))return t.value;return e.startState.facet(Fa)!=e.state.facet(Fa)?Ba.init(e.state):t.apply(e)}});let Na=t=>{let e=setTimeout((()=>t()),500);return()=>clearTimeout(e)};"undefined"!=typeof requestIdleCallback&&(Na=t=>{let e=-1,i=setTimeout((()=>{e=requestIdleCallback(t,{timeout:400})}),100);return()=>e<0?clearTimeout(i):cancelIdleCallback(e)});const Ua="undefined"!=typeof navigator&&(null===(Ra=navigator.scheduling)||void 0===Ra?void 0:Ra.isInputPending)?()=>navigator.scheduling.isInputPending():null,La=Vn.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(_a.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(_a.state);e.tree==e.context.tree&&e.context.isDone(t.doc.length)||(this.working=Na(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEndn+1e3,a=s.context.work((()=>Ua&&Ua()||Date.now()>r),n+(o?0:1e5));this.chunkBudget-=Date.now()-e,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:_a.setState.of(new Ba(s.context))})),this.chunkBudget>0&&(!a||o)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then((()=>this.scheduleWork())).catch((t=>Wn(this.view.state,t))).then((()=>this.workScheduled--)),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Fa=Tt.define({combine:t=>t.length?t[0]:null,enables:t=>[_a.state,La,qr.contentAttributes.compute([t],(e=>{let i=e.facet(t);return i&&i.name?{"data-language":i.name}:{}}))]});class Ha{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}class Ja{constructor(t,e,i,n,s,r=void 0){this.name=t,this.alias=e,this.extensions=i,this.filename=n,this.loadFunc=s,this.support=r,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then((t=>this.support=t),(t=>{throw this.loading=null,t})))}static of(t){let{load:e,support:i}=t;if(!e){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");e=()=>Promise.resolve(i)}return new Ja(t.name,(t.alias||[]).concat(t.name).map((t=>t.toLowerCase())),t.extensions||[],t.filename,e,i)}static matchFilename(t,e){for(let i of t)if(i.filename&&i.filename.test(e))return i;let i=/\.([^.]+)$/.exec(e);if(i)for(let e of t)if(e.extensions.indexOf(i[1])>-1)return e;return null}static matchLanguageName(t,e,i=!0){e=e.toLowerCase();for(let i of t)if(i.alias.some((t=>t==e)))return i;if(i)for(let i of t)for(let t of i.alias){let n=e.indexOf(t);if(n>-1&&(t.length>2||!/\w/.test(e[n-1])&&!/\w/.test(e[n+t.length])))return i}return null}}const Ka=Tt.define(),tl=Tt.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some((t=>t!=e[0])))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function el(t){let e=t.facet(tl);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function il(t,e){let i="",n=t.tabSize,s=t.facet(tl)[0];if("\t"==s){for(;e>=n;)i+="\t",e-=n;s=" "}for(let t=0;t=e?function(t,e,i){let n=e.resolveStack(i),s=n.node.enterUnfinishedNodesBefore(i);if(s!=n.node){let t=[];for(let e=s;e!=n.node;e=e.parent)t.push(e);for(let e=t.length-1;e>=0;e--)n={node:t[e],next:n}}return ol(n,t,i)}(t,i,e):null}class sl{constructor(t,e={}){this.state=t,this.options=e,this.unit=el(t)}lineAt(t,e=1){let i=this.state.doc.lineAt(t),{simulateBreak:n,simulateDoubleBreak:s}=this.options;return null!=n&&n>=i.from&&n<=i.to?s&&n==t?{text:"",from:t}:(e<0?n-1&&(s+=r-this.countColumn(i,i.search(/\S|$/))),s}countColumn(t,e=t.length){return qe(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:i,from:n}=this.lineAt(t,e),s=this.options.overrideIndentation;if(s){let t=s(n);if(t>-1)return t}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const rl=new n;function ol(t,e,i){for(let n=t;n;n=n.next){let t=al(n.node);if(t)return t(hl.create(e,i,n))}return 0}function al(t){let e=t.type.prop(rl);if(e)return e;let i,s=t.firstChild;if(s&&(i=s.type.prop(n.closedBy))){let e=t.lastChild,n=e&&i.indexOf(e.name)>-1;return t=>ul(t,!0,1,void 0,n&&!function(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}(t)?e.from:void 0)}return null==t.parent?ll:null}function ll(){return 0}class hl extends sl{constructor(t,e,i){super(t.state,t.options),this.base=t,this.pos=e,this.context=i}get node(){return this.context.node}static create(t,e,i){return new hl(t,e,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(e.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(cl(i,t))break;e=this.state.doc.lineAt(i.from)}return this.lineIndent(e.from)}continue(){return ol(this.context.next,this.base,this.pos)}}function cl(t,e){for(let i=e;i;i=i.parent)if(t==i)return!0;return!1}function Ol({closing:t,align:e=!0,units:i=1}){return n=>ul(n,e,i,t)}function ul(t,e,i,n,s){let r=t.textAfter,o=r.match(/^\s*/)[0].length,a=n&&r.slice(o,o+n.length)==n||s==t.pos+o,l=e?function(t){let e=t.node,i=e.childAfter(e.from),n=e.lastChild;if(!i)return null;let s=t.options.simulateBreak,r=t.state.doc.lineAt(i.from),o=null==s||s<=r.from?r.to:Math.min(r.to,s);for(let t=i.to;;){let s=e.childAfter(t);if(!s||s==n)return null;if(!s.type.isSkipped)return s.fromt.baseIndent;function dl({except:t,units:e=1}={}){return i=>{let n=t&&t.test(i.textAfter);return i.baseIndent+(n?0:e*i.unit)}}function pl(){return me.transactionFilter.of((t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let i=t.newDoc,{head:n}=t.newSelection.main,s=i.lineAt(n);if(n>s.from+200)return t;let r=i.sliceString(s.from,n);if(!e.some((t=>t.test(r))))return t;let{state:o}=t,a=-1,l=[];for(let{head:t}of o.selection.ranges){let e=o.doc.lineAt(t);if(e.from==a)continue;a=e.from;let i=nl(o,e.from);if(null==i)continue;let n=/^\s*/.exec(e.text)[0],s=il(o,i);n!=s&&l.push({from:e.from,to:e.from+n.length,insert:s})}return l.length?[t,{changes:l,sequential:!0}]:t}))}const gl=Tt.define(),ml=new n;function bl(t){let e=t.firstChild,i=t.lastChild;return e&&e.toi)continue;if(s&&o.from=e&&n.to>i&&(s=n)}}return s}(t,e,i)}function Sl(t,e){let i=e.mapPos(t.from,1),n=e.mapPos(t.to,-1);return i>=n?void 0:{from:i,to:n}}const Ql=re.define({map:Sl}),vl=re.define({map:Sl});function xl(t){let e=[];for(let{head:i}of t.state.selection.ranges)e.some((t=>t.from<=i&&t.to>=i))||e.push(t.lineBlockAt(i));return e}const kl=Yt.define({create:()=>Ui.none,update(t,e){t=t.map(e.changes);for(let i of e.effects)if(i.is(Ql)&&!Pl(t,i.value.from,i.value.to)){let{preparePlaceholder:n}=e.state.facet(Al),s=n?Ui.replace({widget:new Yl(n(e.state,i.value))}):ql;t=t.update({add:[s.range(i.value.from,i.value.to)]})}else i.is(vl)&&(t=t.update({filter:(t,e)=>i.value.from!=t||i.value.to!=e,filterFrom:i.value.from,filterTo:i.value.to}));if(e.selection){let i=!1,{head:n}=e.selection.main;t.between(n,n,((t,e)=>{tn&&(i=!0)})),i&&(t=t.update({filterFrom:n,filterTo:n,filter:(t,e)=>e<=n||t>=n}))}return t},provide:t=>qr.decorations.from(t),toJSON(t,e){let i=[];return t.between(0,e.doc.length,((t,e)=>{i.push(t,e)})),i},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let i=0;i{(!s||s.from>t)&&(s={from:t,to:e})})),s}function Pl(t,e,i){let n=!1;return t.between(e,e,((t,s)=>{t==e&&s==i&&(n=!0)})),n}function Zl(t,e){return t.field(kl,!1)?e:e.concat(re.appendConfig.of(Rl()))}function Tl(t,e,i=!0){let n=t.state.doc.lineAt(e.from).number,s=t.state.doc.lineAt(e.to).number;return qr.announce.of(`${t.state.phrase(i?"Folded lines":"Unfolded lines")} ${n} ${t.state.phrase("to")} ${s}.`)}const Xl=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:t=>{for(let e of xl(t)){let i=yl(t.state,e.from,e.to);if(i)return t.dispatch({effects:Zl(t.state,[Ql.of(i),Tl(t,i)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:t=>{if(!t.state.field(kl,!1))return!1;let e=[];for(let i of xl(t)){let n=$l(t.state,i.from,i.to);n&&e.push(vl.of(n),Tl(t,n,!1))}return e.length&&t.dispatch({effects:e}),e.length>0}},{key:"Ctrl-Alt-[",run:t=>{let{state:e}=t,i=[];for(let n=0;n{let e=t.state.field(kl,!1);if(!e||!e.size)return!1;let i=[];return e.between(0,t.state.doc.length,((t,e)=>{i.push(vl.of({from:t,to:e}))})),t.dispatch({effects:i}),!0}}],Cl={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Al=Tt.define({combine:t=>be(t,Cl)});function Rl(t){let e=[kl,El];return t&&e.push(Al.of(t)),e}function Wl(t,e){let{state:i}=t,n=i.facet(Al),s=e=>{let i=t.lineBlockAt(t.posAtDOM(e.target)),n=$l(t.state,i.from,i.to);n&&t.dispatch({effects:vl.of(n)}),e.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(t,s,e);let r=document.createElement("span");return r.textContent=n.placeholderText,r.setAttribute("aria-label",i.phrase("folded code")),r.title=i.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=s,r}const ql=Ui.replace({widget:new class extends Bi{toDOM(t){return Wl(t,null)}}});class Yl extends Bi{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return Wl(t,this.value)}}const _l={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Vl extends jo{constructor(t,e){super(),this.config=t,this.open=e}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let e=document.createElement("span");return e.textContent=this.open?this.config.openText:this.config.closedText,e.title=t.state.phrase(this.open?"Fold line":"Unfold line"),e}}function Ml(t={}){let e=Object.assign(Object.assign({},_l),t),i=new Vl(e,!0),n=new Vl(e,!1),s=Vn.fromClass(class{constructor(t){this.from=t.viewport.from,this.markers=this.buildMarkers(t)}update(t){(t.docChanged||t.viewportChanged||t.startState.facet(Fa)!=t.state.facet(Fa)||t.startState.field(kl,!1)!=t.state.field(kl,!1)||Ea(t.startState)!=Ea(t.state)||e.foldingChanged(t))&&(this.markers=this.buildMarkers(t.view))}buildMarkers(t){let e=new xe;for(let s of t.viewportLineBlocks){let r=$l(t.state,s.from,s.to)?n:yl(t.state,s.from,s.to)?i:null;r&&e.add(s.from,s.from,r)}return e.finish()}}),{domEventHandlers:r}=e;return[s,Io({class:"cm-foldGutter",markers(t){var e;return(null===(e=t.plugin(s))||void 0===e?void 0:e.markers)||ve.empty},initialSpacer:()=>new Vl(e,!1),domEventHandlers:Object.assign(Object.assign({},r),{click:(t,e,i)=>{if(r.click&&r.click(t,e,i))return!0;let n=$l(t.state,e.from,e.to);if(n)return t.dispatch({effects:vl.of(n)}),!0;let s=yl(t.state,e.from,e.to);return!!s&&(t.dispatch({effects:Ql.of(s)}),!0)}})}),Rl()]}const El=qr.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class jl{constructor(t,e){let i;function n(t){let e=Me.newName();return(i||(i=Object.create(null)))["."+e]=t,e}this.specs=t;const s="string"==typeof e.all?e.all:e.all?n(e.all):void 0,r=e.scope;this.scope=r instanceof _a?t=>t.prop(Wa)==r.data:r?t=>t==r:void 0,this.style=da(t.map((t=>({tag:t.tag,class:t.class||n(Object.assign({},t,{tag:null}))}))),{all:s}).style,this.module=i?new Me(i):null,this.themeType=e.themeType}static define(t,e){return new jl(t,e||{})}}const Dl=Tt.define(),zl=Tt.define({combine:t=>t.length?[t[0]]:null});function Gl(t){let e=t.facet(Dl);return e.length?e:t.facet(zl)}function Il(t,e){let i,n=[Nl];return t instanceof jl&&(t.module&&n.push(qr.styleModule.of(t.module)),i=t.themeType),(null==e?void 0:e.fallback)?n.push(zl.of(t)):i?n.push(Dl.computeN([qr.darkTheme],(e=>e.facet(qr.darkTheme)==("dark"==i)?[t]:[]))):n.push(Dl.of(t)),n}class Bl{constructor(t){this.markCache=Object.create(null),this.tree=Ea(t.state),this.decorations=this.buildDeco(t,Gl(t.state))}update(t){let e=Ea(t.state),i=Gl(t.state),n=i!=Gl(t.startState);e.length{i.add(t,e,this.markCache[n]||(this.markCache[n]=Ui.mark({class:n})))}),n,s);return i.finish()}}const Nl=Dt.high(Vn.fromClass(Bl,{decorations:t=>t.decorations}));Aa.meta,Aa.link,Aa.heading,Aa.emphasis,Aa.strong,Aa.strikethrough,Aa.keyword,Aa.atom,Aa.bool,Aa.url,Aa.contentSeparator,Aa.labelName,Aa.literal,Aa.inserted,Aa.string,Aa.deleted,Aa.regexp,Aa.escape,Aa.string,Aa.variableName,Aa.variableName,Aa.typeName,Aa.namespace,Aa.className,Aa.variableName,Aa.macroName,Aa.propertyName,Aa.comment,Aa.invalid;const Ul=qr.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Ll=1e4,Fl="()[]{}",Hl=Tt.define({combine:t=>be(t,{afterCursor:!0,brackets:Fl,maxScanDistance:Ll,renderMatch:th})}),Jl=Ui.mark({class:"cm-matchingBracket"}),Kl=Ui.mark({class:"cm-nonmatchingBracket"});function th(t){let e=[],i=t.matched?Jl:Kl;return e.push(i.range(t.start.from,t.start.to)),t.end&&e.push(i.range(t.end.from,t.end.to)),e}const eh=Yt.define({create:()=>Ui.none,update(t,e){if(!e.docChanged&&!e.selection)return t;let i=[],n=e.state.facet(Hl);for(let t of e.state.selection.ranges){if(!t.empty)continue;let s=ah(e.state,t.head,-1,n)||t.head>0&&ah(e.state,t.head-1,1,n)||n.afterCursor&&(ah(e.state,t.head,1,n)||t.headqr.decorations.from(t)}),ih=[eh,Ul];function nh(t={}){return[Hl.of(t),ih]}const sh=new n;function rh(t,e,i){let s=t.prop(e<0?n.openedBy:n.closedBy);if(s)return s;if(1==t.name.length){let n=i.indexOf(t.name);if(n>-1&&n%2==(e<0?1:0))return[i[n+e]]}return null}function oh(t){let e=t.type.prop(sh);return e?e(t.node):t}function ah(t,e,i,n={}){let s=n.maxScanDistance||Ll,r=n.brackets||Fl,o=Ea(t),a=o.resolveInner(e,i);for(let n=a;n;n=n.parent){let s=rh(n.type,i,r);if(s&&n.from0?e>=o.from&&eo.from&&e<=o.to))return lh(t,e,i,n,o,s,r)}}return function(t,e,i,n,s,r,o){let a=i<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),l=o.indexOf(a);if(l<0||l%2==0!=i>0)return null;let h={from:i<0?e-1:e,to:i>0?e+1:e},c=t.doc.iterRange(e,i>0?t.doc.length:0),O=0;for(let t=0;!c.next().done&&t<=r;){let r=c.value;i<0&&(t+=r.length);let a=e+t*i;for(let t=i>0?0:r.length-1,e=i>0?r.length:-1;t!=e;t+=i){let e=o.indexOf(r[t]);if(!(e<0||n.resolveInner(a+t,1).type!=s))if(e%2==0==i>0)O++;else{if(1==O)return{start:h,end:{from:a+t,to:a+t+1},matched:e>>1==l>>1};O--}}i>0&&(t+=r.length)}return c.done?{start:h,matched:!1}:null}(t,e,i,o,a.type,s,r)}function lh(t,e,i,n,s,r,o){let a=n.parent,l={from:s.from,to:s.to},h=0,c=null==a?void 0:a.cursor();if(c&&(i<0?c.childBefore(n.from):c.childAfter(n.to)))do{if(i<0?c.to<=n.from:c.from>=n.to){if(0==h&&r.indexOf(c.type.name)>-1&&c.from=this.string.length}sol(){return 0==this.pos}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pose}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPosi?t.toLowerCase():t;return n(this.string.substr(this.pos,t.length))==n(t)?(!1!==e&&(this.pos+=t.length),!0):null}{let i=this.string.slice(this.pos).match(t);return i&&i.index>0?null:(i&&!1!==e&&(this.pos+=i[0].length),i)}}current(){return this.string.slice(this.start,this.pos)}}function Oh(t){if("object"!=typeof t)return t;let e={};for(let i in t){let n=t[i];e[i]=n instanceof Array?n.slice():n}return e}const uh=new WeakMap;class fh extends _a{constructor(t){let e,i=qa(t.languageData),s={name:(r=t).name||"",token:r.token,blankLine:r.blankLine||(()=>{}),startState:r.startState||(()=>!0),copyState:r.copyState||Oh,indent:r.indent||(()=>null),languageData:r.languageData||{},tokenTable:r.tokenTable||bh};var r;super(i,new class extends C{createParse(t,i,n){return new gh(e,t,i,n)}},[Ka.of(((t,e)=>this.getIndent(t,e)))],t.name),this.topNode=function(t){let e=o.define({id:wh.length,name:"Document",props:[Wa.add((()=>t))],top:!0});return wh.push(e),e}(i),e=this,this.streamParser=s,this.stateAfter=new n({perNode:!0}),this.tokenTable=t.tokenTable?new xh(s.tokenTable):kh}static define(t){return new fh(t)}getIndent(t,e){let i,n=Ea(t.state),s=n.resolve(e);for(;s&&s.type!=this.topNode;)s=s.parent;if(!s)return null;let{overrideIndentation:r}=t.options;r&&(i=uh.get(t.state),null!=i&&i1e4)return null;for(;o=n&&i+e.length<=s&&e.prop(t.stateAfter);if(r)return{state:t.streamParser.copyState(r),pos:i+e.length};for(let r=e.children.length-1;r>=0;r--){let o=e.children[r],a=i+e.positions[r],l=o instanceof O&&a=e.length)return e;s||e.type!=t.topNode||(s=!0);for(let r=e.children.length-1;r>=0;r--){let o,a=e.positions[r],l=e.children[r];if(ai&&dh(t,n.tree,0-n.offset,i,r);if(o&&(e=ph(t,n.tree,i+n.offset,o.pos+n.offset,!1)))return{state:o.state,tree:e}}return{state:t.streamParser.startState(n?el(n):4),tree:O.empty}}(t,i,r,null==s?void 0:s.state);this.state=o,this.parsedPos=this.chunkStart=r+a.length;for(let t=0;t=e?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,e),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let e=this.input.chunk(t);if(this.input.lineChunks)"\n"==e&&(e="");else{let t=e.indexOf("\n");t>-1&&(e=e.slice(0,t))}return t+e.length<=this.to?e:e.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,e=this.lineAfter(t),i=t+e.length;for(let t=this.rangeIndex;;){let n=this.ranges[t].to;if(n>=i)break;if(e=e.slice(0,n-(i-e.length)),t++,t==this.ranges.length)break;let s=this.ranges[t].from,r=this.lineAfter(s);e+=r,i=s+r.length}return{line:e,end:i}}skipGapsTo(t,e,i){for(;;){let n=this.ranges[this.rangeIndex].to,s=t+e;if(i>0?n>s:n>=s)break;e+=this.ranges[++this.rangeIndex].from-n}return e}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){e+=s=this.skipGapsTo(e,s,1);let t=this.chunk.length;i+=s=this.skipGapsTo(i,s,-1),n+=this.chunk.length-t}return this.chunk.push(t,e,i,n),s}parseLine(t){let{line:e,end:i}=this.nextLine(),n=0,{streamParser:s}=this.lang,r=new ch(e,t?t.state.tabSize:4,t?el(t.state):2);if(r.eol())s.blankLine(this.state,r.indentUnit);else for(;!r.eol();){let t=mh(s.token,r,this.state);if(t&&(n=this.emitToken(this.lang.tokenTable.resolve(t),this.parsedPos+r.start,this.parsedPos+r.pos,4,n)),r.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPose.start)return n}throw new Error("Stream parser failed to advance stream.")}const bh=Object.create(null),wh=[o.none],yh=new a(wh),Sh=[],Qh=Object.create(null),vh=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])vh[t]=Ph(bh,e);class xh{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),vh)}resolve(t){return t?this.table[t]||(this.table[t]=Ph(this.extra,t)):0}}const kh=new xh(bh);function $h(t,e){Sh.indexOf(t)>-1||(Sh.push(t),console.warn(e))}function Ph(t,e){let i=[];for(let n of e.split(" ")){let e=[];for(let i of n.split(".")){let n=t[i]||Aa[i];n?"function"==typeof n?e.length?e=e.map(n):$h(i,`Modifier ${i} used at start of tag`):e.length?$h(i,`Tag ${i} used as modifier`):e=Array.isArray(n)?n:[n]:$h(i,`Unknown highlighting tag ${i}`)}for(let t of e)i.push(t)}if(!i.length)return 0;let n=e.replace(/ /g,"_"),s=n+" "+i.map((t=>t.id)),r=Qh[s];if(r)return r.id;let a=Qh[s]=o.define({id:wh.length,name:n,props:[Oa({[n]:i})]});return wh.push(a),a.id}function Zh(t){return t.length<=4096&&/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/.test(t)}function Th(t){for(let e=t.iter();!e.next().done;)if(Zh(e.value))return!0;return!1}const Xh=Tt.define({combine:t=>t.some((t=>t))});function Ch(t={}){let e=[Ah];return t.alwaysIsolate&&e.push(Xh.of(!0)),e}const Ah=Vn.fromClass(class{constructor(t){this.always=t.state.facet(Xh)||t.textDirection!=sn.LTR||t.state.facet(qr.perLineTextDirection),this.hasRTL=!this.always&&Th(t.state.doc),this.tree=Ea(t.state),this.decorations=Rh(t,this.tree,this.always)}update(t){let e=t.state.facet(Xh)||t.view.textDirection!=sn.LTR||t.state.facet(qr.perLineTextDirection);if(e||this.hasRTL||!function(t){let e=!1;return t.iterChanges(((t,i,n,s,r)=>{!e&&Th(r)&&(e=!0)})),e}(t.changes)||(this.hasRTL=!0),!e&&!this.hasRTL)return;let i=Ea(t.state);(e!=this.always||i!=this.tree||t.docChanged||t.viewportChanged)&&(this.tree=i,this.always=e,this.decorations=Rh(t.view,i,e))}},{provide:t=>{function e(e){var i,n;return null!==(n=null===(i=e.plugin(t))||void 0===i?void 0:i.decorations)&&void 0!==n?n:Ui.none}return[qr.outerDecorations.of(e),Dt.lowest(qr.bidiIsolatedRanges.of(e))]}});function Rh(t,e,i){let s=new xe,r=t.visibleRanges;i||(r=function(t,e){let i=e.iter(),n=0,s=[],r=null;for(let{from:e,to:o}of t)for(e!=n&&(nt-10?r.to=Math.min(o,e):s.push(r={from:t,to:Math.min(o,e)})),n>=o)break;n=e,i.next()}return s}(r,t.state.doc));for(let{from:t,to:i}of r)e.iterate({enter:t=>{let e=t.type.prop(n.isolate);e&&s.add(t.from,t.to,Wh[e])},from:t,to:i});return s.finish()}const Wh={rtl:Ui.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:sn.RTL}),ltr:Ui.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:sn.LTR}),auto:Ui.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};class qh{constructor(t,e,i,n,s,r,o,a,l,h=0,c){this.p=t,this.stack=e,this.state=i,this.reducePos=n,this.pos=s,this.score=r,this.buffer=o,this.bufferBase=a,this.curContext=l,this.lookAhead=h,this.parent=c}toString(){return`[${this.stack.filter(((t,e)=>e%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,e,i=0){let n=t.parser.context;return new qh(t,[],e,i,i,0,[],0,n?new Yh(n,n.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var e;let i=t>>19,n=65535&t,{parser:s}=this.p,r=s.dynamicPrecedence(n);if(r&&(this.score+=r),0==i)return this.pushState(s.getGoto(this.state,n,!0),this.reducePos),n=2e3&&!(null===(e=this.p.parser.nodeSet.types[n])||void 0===e?void 0:e.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=l):this.p.lastBigReductionSizeo;)this.stack.pop();this.reduceContext(n,a)}storeNode(t,e,i,n=4,s=!1){if(0==t&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==t.buffer[n-4]&&t.buffer[n-1]>-1){if(e==i)return;if(t.buffer[n-2]>=e)return void(t.buffer[n-2]=i)}}if(s&&this.pos!=i){let s=this.buffer.length;if(s>0&&0!=this.buffer[s-4])for(;s>0&&this.buffer[s-2]>i;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,n>4&&(n-=4);this.buffer[s]=t,this.buffer[s+1]=e,this.buffer[s+2]=i,this.buffer[s+3]=n}else this.buffer.push(t,e,i,n)}shift(t,e,i,n){if(131072&t)this.pushState(65535&t,this.pos);else if(262144&t)this.pos=n,this.shiftContext(e,i),e<=this.p.parser.maxNode&&this.buffer.push(e,i,n,4);else{let s=t,{parser:r}=this.p;(n>this.pos||e<=r.maxNode)&&(this.pos=n,r.stateFlag(s,1)||(this.reducePos=n)),this.pushState(s,i),this.shiftContext(e,i),e<=r.maxNode&&this.buffer.push(e,i,n,4)}}apply(t,e,i,n){65536&t?this.reduce(t):this.shift(t,e,i,n)}useNode(t,e){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=t)&&(this.p.reused.push(t),i++);let n=this.pos;this.reducePos=this.pos=n+t.length,this.pushState(e,n),this.buffer.push(i,n,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,e=t.buffer.length;for(;e>0&&t.buffer[e-2]>t.reducePos;)e-=4;let i=t.buffer.slice(e),n=t.bufferBase+e;for(;t&&n==t.bufferBase;)t=t.parent;return new qh(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,n,this.curContext,this.lookAhead,t)}recoverByDelete(t,e){let i=t<=this.p.parser.maxNode;i&&this.storeNode(t,this.pos,e,4),this.storeNode(0,this.pos,e,i?8:4),this.pos=this.reducePos=e,this.score-=190}canShift(t){for(let e=new _h(this);;){let i=this.p.parser.stateSlot(e.state,4)||this.p.parser.hasAction(e.state,t);if(0==i)return!1;if(!(65536&i))return!0;e.reduce(i)}}recoverByInsert(t){if(this.stack.length>=300)return[];let e=this.p.parser.nextStates(this.state);if(e.length>8||this.stack.length>=120){let i=[];for(let n,s=0;s1&e&&t==n))||i.push(e[t],n)}e=i}let i=[];for(let t=0;t>19,n=65535&e,s=this.stack.length-3*i;if(s<0||t.getGoto(this.stack[s],n,!1)<0){let t=this.findForcedReduction();if(null==t)return!1;e=t}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}findForcedReduction(){let{parser:t}=this.p,e=[],i=(n,s)=>{if(!e.includes(n))return e.push(n),t.allActions(n,(e=>{if(393216&e);else if(65536&e){let i=(e>>19)-s;if(i>1){let n=65535&e,s=this.stack.length-3*i;if(s>=0&&t.getGoto(this.stack[s],n,!1)>=0)return i<<19|65536|n}}else{let t=i(e,s+1);if(null!=t)return t}}))};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:t}=this.p;return 65535==t.data[t.stateSlot(this.state,1)]&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let e=0;ethis.lookAhead&&(this.emitLookAhead(),this.lookAhead=t)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Yh{constructor(t,e){this.tracker=t,this.context=e,this.hash=t.strict?t.hash(e):0}}class _h{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let e=65535&t,i=t>>19;0==i?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(i-1);let n=this.start.p.parser.getGoto(this.stack[this.base-3],e,!0);this.state=n}}class Vh{constructor(t,e,i){this.stack=t,this.pos=e,this.index=i,this.buffer=t.buffer,0==this.index&&this.maybeNext()}static create(t,e=t.bufferBase+t.buffer.length){return new Vh(t,e,e-t.bufferBase)}maybeNext(){let t=this.stack.parent;null!=t&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new Vh(this.stack,this.pos,this.index)}}function Mh(t,e=Uint16Array){if("string"!=typeof t)return t;let i=null;for(let n=0,s=0;n=92&&e--,e>=34&&e--;let s=e-32;if(s>=46&&(s-=46,i=!0),r+=s,i)break;r*=46}i?i[s++]=r:i=new e(r)}return i}class Eh{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const jh=new Eh;class Dh{constructor(t,e){this.input=t,this.ranges=e,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=jh,this.rangeIndex=0,this.pos=this.chunkPos=e[0].from,this.range=e[0],this.end=e[e.length-1].to,this.readNext()}resolveOffset(t,e){let i=this.range,n=this.rangeIndex,s=this.pos+t;for(;si.to:s>=i.to;){if(n==this.ranges.length-1)return null;let t=this.ranges[++n];s+=t.from-i.to,i=t}return s}clipPos(t){if(t>=this.range.from&&tt)return Math.max(t,e.from);return this.end}peek(t){let e,i,n=this.chunkOff+t;if(n>=0&&n=this.chunk2Pos&&en.to&&(this.chunk2=this.chunk2.slice(0,n.to-e)),i=this.chunk2.charCodeAt(0)}}return e>=this.token.lookAhead&&(this.token.lookAhead=e+1),i}acceptToken(t,e=0){let i=e?this.resolveOffset(e,-1):this.pos;if(null==i||i=this.chunk2Pos&&this.posthis.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,e){if(e?(this.token=e,e.start=t,e.lookAhead=t+1,e.value=e.extended=-1):this.token=jh,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t=this.chunkPos&&e<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,e-this.chunkPos);if(t>=this.chunk2Pos&&e<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,e-this.chunk2Pos);if(t>=this.range.from&&e<=this.range.to)return this.input.read(t,e);let i="";for(let n of this.ranges){if(n.from>=e)break;n.to>t&&(i+=this.input.read(Math.max(n.from,t),Math.min(n.to,e)))}return i}}class zh{constructor(t,e){this.data=t,this.id=e}token(t,e){let{parser:i}=e.p;Bh(this.data,t,e,this.id,i.data,i.tokenPrecTable)}}zh.prototype.contextual=zh.prototype.fallback=zh.prototype.extend=!1;class Gh{constructor(t,e,i){this.precTable=e,this.elseToken=i,this.data="string"==typeof t?Mh(t):t}token(t,e){let i=t.pos,n=0;for(;;){let i=t.next<0,s=t.resolveOffset(1,1);if(Bh(this.data,t,e,0,this.data,this.precTable),t.token.value>-1)break;if(null==this.elseToken)return;if(i||n++,null==s)break;t.reset(s,t.token)}n&&(t.reset(i,t.token),t.acceptToken(this.elseToken,n))}}Gh.prototype.contextual=zh.prototype.fallback=zh.prototype.extend=!1;class Ih{constructor(t,e={}){this.token=t,this.contextual=!!e.contextual,this.fallback=!!e.fallback,this.extend=!!e.extend}}function Bh(t,e,i,n,s,r){let o=0,a=1<0){let i=t[n];if(l.allows(i)&&(-1==e.token.value||e.token.value==i||Uh(i,e.token.value,s,r))){e.acceptToken(i);break}}let n=e.next,h=0,c=t[o+2];if(!(e.next<0&&c>h&&65535==t[i+3*c-3]&&65535==t[i+3*c-3])){for(;h>1,r=i+s+(s<<1),a=t[r],l=t[r+1]||65536;if(n=l)){o=t[r+2],e.advance();continue t}h=s+1}}break}o=t[i+3*c-1]}}function Nh(t,e,i){for(let n,s=e;65535!=(n=t[s]);s++)if(n==i)return s-e;return-1}function Uh(t,e,i,n){let s=Nh(i,n,e);return s<0||Nh(i,n,t)e)&&!n.type.isError)return i<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(t.length,Math.max(n.from+1,e+25));if(i<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return i<0?0:t.length}}class Jh{constructor(t,e){this.fragments=t,this.nodeSet=e,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?Hh(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?Hh(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(tt)return this.nextStart=o,null;if(r instanceof O){if(o==t){if(o=Math.max(this.safeFrom,t)&&(this.trees.push(r),this.start.push(o),this.index.push(0))}else this.index[e]++,this.nextStart=o+r.length}}}class Kh{constructor(t,e){this.stream=e,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map((t=>new Eh))}getActions(t){let e=0,i=null,{parser:n}=t.p,{tokenizers:s}=n,r=n.stateSlot(t.state,3),o=t.curContext?t.curContext.hash:0,a=0;for(let n=0;nh.end+25&&(a=Math.max(h.lookAhead,a)),0!=h.value)){let n=e;if(h.extended>-1&&(e=this.addActions(t,h.extended,h.end,e)),e=this.addActions(t,h.value,h.end,e),!l.extend&&(i=h,e>n))break}}for(;this.actions.length>e;)this.actions.pop();return a&&t.setLookAhead(a),i||t.pos!=this.stream.end||(i=new Eh,i.value=t.p.parser.eofTerm,i.start=i.end=t.pos,e=this.addActions(t,i.value,i.end,e)),this.mainToken=i,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let e=new Eh,{pos:i,p:n}=t;return e.start=i,e.end=Math.min(i+1,n.stream.end),e.value=i==n.stream.end?n.parser.eofTerm:0,e}updateCachedToken(t,e,i){let n=this.stream.clipPos(i.pos);if(e.token(this.stream.reset(n,t),i),t.value>-1){let{parser:e}=i.p;for(let n=0;n=0&&i.p.parser.dialect.allows(s>>1)){1&s?t.extended=s>>1:t.value=s>>1;break}}}else t.value=0,t.end=this.stream.clipPos(n+1)}putAction(t,e,i,n){for(let e=0;e4*t.bufferLength?new Jh(i,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t,e,i=this.stacks,n=this.minStackPos,s=this.stacks=[];if(this.bigReductionCount>300&&1==i.length){let[t]=i;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let r=0;rn)s.push(o);else{if(this.advanceStack(o,s,i))continue;{t||(t=[],e=[]),t.push(o);let i=this.tokens.getMainToken(o);e.push(i.value,i.end)}}break}}if(!s.length){let e=t&&function(t){let e=null;for(let i of t){let t=i.p.stoppedAt;(i.pos==i.p.stream.end||null!=t&&i.pos>t)&&i.p.parser.stateFlag(i.state,2)&&(!e||e.scorethis.stoppedAt?t[0]:this.runRecovery(t,e,s);if(i)return Lh&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let t=1==this.recovering?1:3*this.recovering;if(s.length>t)for(s.sort(((t,e)=>e.score-t.score));s.length>t;)s.pop();s.some((t=>t.reducePos>n))&&this.recovering--}else if(s.length>1){t:for(let t=0;t500&&n.buffer.length>500){if(!((e.score-n.score||e.buffer.length-n.buffer.length)>0)){s.splice(t--,1);continue t}s.splice(i--,1)}}}s.length>12&&s.splice(12,s.length-12)}this.minStackPos=s[0].pos;for(let t=1;t ":"";if(null!=this.stoppedAt&&s>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let e=t.curContext&&t.curContext.tracker.strict,i=e?t.curContext.hash:0;for(let a=this.fragments.nodeAt(s);a;){let s=this.parser.nodeSet.types[a.type.id]==a.type?r.getGoto(t.state,a.type.id):-1;if(s>-1&&a.length&&(!e||(a.prop(n.contextHash)||0)==i))return t.useNode(a,s),Lh&&console.log(o+this.stackID(t)+` (via reuse of ${r.getName(a.type.id)})`),!0;if(!(a instanceof O)||0==a.children.length||a.positions[0]>0)break;let l=a.children[0];if(!(l instanceof O&&0==a.positions[0]))break;a=l}}let a=r.stateSlot(t.state,4);if(a>0)return t.reduce(a),Lh&&console.log(o+this.stackID(t)+` (via always-reduce ${r.getName(65535&a)})`),!0;if(t.stack.length>=9e3)for(;t.stack.length>6e3&&t.forceReduce(););let l=this.tokens.getActions(t);for(let n=0;ns?e.push(u):i.push(u)}return!1}advanceFully(t,e){let i=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>i)return ec(t,e),!0}}runRecovery(t,e,i){let n=null,s=!1;for(let r=0;r ":"";if(o.deadEnd){if(s)continue;if(s=!0,o.restart(),Lh&&console.log(h+this.stackID(o)+" (restarted)"),this.advanceFully(o,i))continue}let c=o.split(),O=h;for(let t=0;c.forceReduce()&&t<10;t++){if(Lh&&console.log(O+this.stackID(c)+" (via force-reduce)"),this.advanceFully(c,i))break;Lh&&(O=this.stackID(c)+" -> ")}for(let t of o.recoverByInsert(a))Lh&&console.log(h+this.stackID(t)+" (via recover-insert)"),this.advanceFully(t,i);this.stream.end>o.pos?(l==o.pos&&(l++,a=0),o.recoverByDelete(a,l),Lh&&console.log(h+this.stackID(o)+` (via recover-delete ${this.parser.getName(a)})`),ec(o,i)):(!n||n.scoret;class sc{constructor(t){this.start=t.start,this.shift=t.shift||nc,this.reduce=t.reduce||nc,this.reuse=t.reuse||nc,this.hash=t.hash||(()=>0),this.strict=!1!==t.strict}}class rc extends C{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let i=e.nodeNames.split(" ");this.minRepeatTerm=i.length;for(let t=0;te.topRules[t][1])),r=[];for(let t=0;t=0)l(n,e,t[i++]);else{let s=t[i+-n];for(let r=-n;r>0;r--)l(t[i++],e,s);i++}}}this.nodeSet=new a(i.map(((t,i)=>o.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:s.indexOf(i)>-1,error:0==i,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1})))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=t;let h=Mh(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let t=0;t"number"==typeof t?new zh(h,t):t)),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,e,i){let n=new tc(this,t,e,i);for(let s of this.wrappers)n=s(n,t,e,i);return n}getGoto(t,e,i=!1){let n=this.goto;if(e>=n[0])return-1;for(let s=n[e+1];;){let e=n[s++],r=1&e,o=n[s++];if(r&&i)return o;for(let i=s+(e>>1);s0}validAction(t,e){return!!this.allActions(t,(t=>t==e||null))}allActions(t,e){let i=this.stateSlot(t,4),n=i?e(i):void 0;for(let i=this.stateSlot(t,1);null==n;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])break;i=oc(this.data,i+2)}n=e(oc(this.data,i+1))}return n}nextStates(t){let e=[];for(let i=this.stateSlot(t,1);;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])break;i=oc(this.data,i+2)}if(!(1&this.data[i+2])){let t=this.data[i+1];e.some(((e,i)=>1&i&&e==t))||e.push(this.data[i],t)}}return e}configure(t){let e=Object.assign(Object.create(rc.prototype),this);if(t.props&&(e.nodeSet=this.nodeSet.extend(...t.props)),t.top){let i=this.topRules[t.top];if(!i)throw new RangeError(`Invalid top rule name ${t.top}`);e.top=i}return t.tokenizers&&(e.tokenizers=this.tokenizers.map((e=>{let i=t.tokenizers.find((t=>t.from==e));return i?i.to:e}))),t.specializers&&(e.specializers=this.specializers.slice(),e.specializerSpecs=this.specializerSpecs.map(((i,n)=>{let s=t.specializers.find((t=>t.from==i.external));if(!s)return i;let r=Object.assign(Object.assign({},i),{external:s.to});return e.specializers[n]=ac(r),r}))),t.contextTracker&&(e.context=t.contextTracker),t.dialect&&(e.dialect=this.parseDialect(t.dialect)),null!=t.strict&&(e.strict=t.strict),t.wrap&&(e.wrappers=e.wrappers.concat(t.wrap)),null!=t.bufferLength&&(e.bufferLength=t.bufferLength),e}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let e=this.dynamicPrecedences;return null==e?0:e[t]||0}parseDialect(t){let e=Object.keys(this.dialects),i=e.map((()=>!1));if(t)for(let n of t.split(" ")){let t=e.indexOf(n);t>=0&&(i[t]=!0)}let n=null;for(let t=0;tt.external(i,n)<<1|e}return t.get}const lc=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288];function hc(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function cc(t){return t>=48&&t<=57}const Oc=new Ih(((t,e)=>{for(let i=!1,n=0,s=0;;s++){let{next:r}=t;if(hc(r)||45==r||95==r||i&&cc(r))!i&&(45!=r||s>0)&&(i=!0),n===s&&45==r&&n++,t.advance();else{if(92!=r||10==t.peek(1)){i&&t.acceptToken(40==r?100:2==n&&e.canShift(2)?2:101);break}t.advance(),t.next>-1&&t.advance(),i=!0}}})),uc=new Ih((t=>{if(lc.includes(t.peek(-1))){let{next:e}=t;(hc(e)||95==e||35==e||46==e||91==e||58==e&&hc(t.peek(1))||45==e||38==e)&&t.acceptToken(99)}})),fc=new Ih((t=>{if(!lc.includes(t.peek(-1))){let{next:e}=t;if(37==e&&(t.advance(),t.acceptToken(1)),hc(e)){do{t.advance()}while(hc(t.next)||cc(t.next));t.acceptToken(1)}}})),dc=Oa({"AtKeyword import charset namespace keyframes media supports":Aa.definitionKeyword,"from to selector":Aa.keyword,NamespaceName:Aa.namespace,KeyframeName:Aa.labelName,KeyframeRangeName:Aa.operatorKeyword,TagName:Aa.tagName,ClassName:Aa.className,PseudoClassName:Aa.constant(Aa.className),IdName:Aa.labelName,"FeatureName PropertyName":Aa.propertyName,AttributeName:Aa.attributeName,NumberLiteral:Aa.number,KeywordQuery:Aa.keyword,UnaryQueryOp:Aa.operatorKeyword,"CallTag ValueName":Aa.atom,VariableName:Aa.variableName,Callee:Aa.operatorKeyword,Unit:Aa.unit,"UniversalSelector NestingSelector":Aa.definitionOperator,MatchOp:Aa.compareOperator,"ChildOp SiblingOp, LogicOp":Aa.logicOperator,BinOp:Aa.arithmeticOperator,Important:Aa.modifier,Comment:Aa.blockComment,ColorLiteral:Aa.color,"ParenthesizedContent StringLiteral":Aa.string,":":Aa.punctuation,"PseudoOp #":Aa.derefOperator,"; ,":Aa.separator,"( )":Aa.paren,"[ ]":Aa.squareBracket,"{ }":Aa.brace}),pc={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138},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%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[uc,fc,Oc,1,2,3,4,new Gh("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:t=>pc[t]||-1},{term:58,get:t=>gc[t]||-1},{term:101,get:t=>mc[t]||-1}],tokenPrec:1200});let wc=null;function yc(){if(!wc&&"object"==typeof document&&document.body){let{style:t}=document.body,e=[],i=new Set;for(let n in t)"cssText"!=n&&"cssFloat"!=n&&"string"==typeof t[n]&&(/[A-Z]/.test(n)&&(n=n.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))),i.has(n)||(e.push(n),i.add(n)));wc=e.sort().map((t=>({type:"property",label:t})))}return wc||[]}const Sc=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map((t=>({type:"class",label:t}))),Qc=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map((t=>({type:"keyword",label:t}))).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map((t=>({type:"constant",label:t})))),vc=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map((t=>({type:"type",label:t}))),xc=/^(\w[\w-]*|-\w[\w-]*|)$/,kc=/^-(-[\w-]*)?$/;const $c=new T,Pc=["Declaration"];function Zc(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function Tc(t,e,i){if(e.to-e.from>4096){let n=$c.get(e);if(n)return n;let s=[],r=new Set,o=e.cursor(c.IncludeAnonymous);if(o.firstChild())do{for(let e of Tc(t,o.node,i))r.has(e.label)||(r.add(e.label),s.push(e))}while(o.nextSibling());return $c.set(e,s),s}{let n=[],s=new Set;return e.cursor().iterate((e=>{var r;if(i(e)&&e.matchContext(Pc)&&":"==(null===(r=e.node.nextSibling)||void 0===r?void 0:r.name)){let i=t.sliceString(e.from,e.to);s.has(i)||(s.add(i),n.push({label:i,type:"variable"}))}})),n}}const Xc=t=>e=>{let{state:i,pos:n}=e,s=Ea(i).resolveInner(n,-1),r=s.type.isError&&s.from==s.to-1&&"-"==i.doc.sliceString(s.from,s.to);if("PropertyName"==s.name||(r||"TagName"==s.name)&&/^(Block|Styles)$/.test(s.resolve(s.to).name))return{from:s.from,options:yc(),validFor:xc};if("ValueName"==s.name)return{from:s.from,options:Qc,validFor:xc};if("PseudoClassName"==s.name)return{from:s.from,options:Sc,validFor:xc};if(t(s)||(e.explicit||r)&&function(t,e){var i;if(("("==t.name||t.type.isError)&&(t=t.parent||t),"ArgList"!=t.name)return!1;let n=null===(i=t.parent)||void 0===i?void 0:i.firstChild;return"Callee"==(null==n?void 0:n.name)&&"var"==e.sliceString(n.from,n.to)}(s,i.doc))return{from:t(s)||r?s.from:n,options:Tc(i.doc,Zc(s),t),validFor:kc};if("TagName"==s.name){for(let{parent:t}=s;t;t=t.parent)if("Block"==t.name)return{from:s.from,options:yc(),validFor:xc};return{from:s.from,options:vc,validFor:xc}}if(!e.explicit)return null;let o=s.resolve(n),a=o.childBefore(n);return a&&":"==a.name&&"PseudoClassSelector"==o.name?{from:n,options:Sc,validFor:xc}:a&&":"==a.name&&"Declaration"==o.name||"ArgList"==o.name?{from:n,options:Qc,validFor:xc}:"Block"==o.name||"Styles"==o.name?{from:n,options:yc(),validFor:xc}:null},Cc=Xc((t=>"VariableName"==t.name)),Ac=Ma.define({name:"css",parser:bc.configure({props:[rl.add({Declaration:dl()}),ml.add({"Block KeyframeList":bl})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Rc(){return new Ha(Ac,Ac.data.of({autocomplete:Cc}))}class Wc{constructor(t,e,i){this.state=t,this.pos=e,this.explicit=i,this.abortListeners=[]}tokenBefore(t){let e=Ea(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),i=Math.max(e.from,this.pos-250),n=e.text.slice(i-e.from,this.pos-e.from),s=n.search(Ec(t,!1));return s<0?null:{from:i+s,to:this.pos,text:n.slice(s)}}get aborted(){return null==this.abortListeners}addEventListener(t,e){"abort"==t&&this.abortListeners&&this.abortListeners.push(e)}}function qc(t){let e=Object.keys(t).join(""),i=/\w/.test(e);return i&&(e=e.replace(/\w/g,"")),`[${i?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Yc(t){let e=t.map((t=>"string"==typeof t?{label:t}:t)),[i,n]=e.every((t=>/^\w+$/.test(t.label)))?[/\w*$/,/\w+$/]:function(t){let e=Object.create(null),i=Object.create(null);for(let{label:n}of t){e[n[0]]=!0;for(let t=1;t{let s=t.matchBefore(n);return s||t.explicit?{from:s?s.from:t.pos,options:e,validFor:i}:null}}function _c(t,e){return i=>{for(let e=Ea(i.state).resolveInner(i.pos,-1);e;e=e.parent){if(t.indexOf(e.name)>-1)return null;if(e.type.isTop)break}return e(i)}}class Vc{constructor(t,e,i,n){this.completion=t,this.source=e,this.match=i,this.score=n}}function Mc(t){return t.selection.main.from}function Ec(t,e){var i;let{source:n}=t,s=e&&"^"!=n[0],r="$"!=n[n.length-1];return s||r?new RegExp(`${s?"^":""}(?:${n})${r?"$":""}`,null!==(i=t.flags)&&void 0!==i?i:t.ignoreCase?"i":""):t}const jc=ie.define();const Dc=new WeakMap;function zc(t){if(!Array.isArray(t))return t;let e=Dc.get(t);return e||Dc.set(t,e=Yc(t)),e}const Gc=re.define(),Ic=re.define();class Bc{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let e=0;e=48&&l<=57||l>=97&&l<=122?2:l>=65&&l<=90?1:0:(b=ft(l))!=b.toLowerCase()?1:b!=b.toUpperCase()?2:0;(!n||1==w&&p||0==m&&0!=w)&&(e[c]==l||i[c]==l&&(O=!0)?r[c++]=n:r.length&&(g=!1)),m=w,n+=dt(l)}return c==a&&0==r[0]&&g?this.result((O?-200:0)-100,r,t):u==a&&0==f?this.ret(-200-t.length+(d==t.length?0:-100),[0,d]):o>-1?this.ret(-700-t.length,[o,o+this.pattern.length]):u==a?this.ret(-900-t.length,[f,d]):c==a?this.result((O?-200:0)-100-700+(g?0:-1100),r,t):2!=e.length&&this.result((n[0]?-700:0)-200-1100,n,t)}result(t,e,i){let n=[],s=0;for(let t of e){let e=t+(this.astral?dt(ut(i,t)):1);s&&n[s-1]==t?n[s-1]=e:(n[s++]=t,n[s++]=e)}return this.ret(t-i.length,n)}}const Nc=Tt.define({combine:t=>be(t,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Lc,compareCompletions:(t,e)=>t.label.localeCompare(e.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,e)=>t&&e,closeOnBlur:(t,e)=>t&&e,icons:(t,e)=>t&&e,tooltipClass:(t,e)=>i=>Uc(t(i),e(i)),optionClass:(t,e)=>i=>Uc(t(i),e(i)),addToOptions:(t,e)=>t.concat(e)})});function Uc(t,e){return t?e?t+" "+e:t:e}function Lc(t,e,i,n,s,r){let o,a,l=t.textDirection==sn.RTL,h=l,c=!1,O="top",u=e.left-s.left,f=s.right-e.right,d=n.right-n.left,p=n.bottom-n.top;if(h&&u=p||t>e.top?o=i.bottom-e.top:(O="bottom",o=e.bottom-i.top)}return{style:`${O}: ${o/((e.bottom-e.top)/r.offsetHeight)}px; max-width: ${a/((e.right-e.left)/r.offsetWidth)}px`,class:"cm-completionInfo-"+(c?l?"left-narrow":"right-narrow":h?"left":"right")}}function Fc(t,e,i){if(t<=i)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let t=Math.floor(e/i);return{from:t*i,to:(t+1)*i}}let n=Math.floor((t-e)/i);return{from:t-(n+1)*i,to:t-n*i}}class Hc{constructor(t,e,i){this.view=t,this.stateField=e,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:t=>this.placeInfo(t),key:this},this.space=null,this.currentClass="";let n=t.state.field(e),{options:s,selected:r}=n.open,o=t.state.facet(Nc);this.optionContent=function(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(t){let e=document.createElement("div");return e.classList.add("cm-completionIcon"),t.type&&e.classList.add(...t.type.split(/\s+/g).map((t=>"cm-completionIcon-"+t))),e.setAttribute("aria-hidden","true"),e},position:20}),e.push({render(t,e,i){let n=document.createElement("span");n.className="cm-completionLabel";let s=t.displayLabel||t.label,r=0;for(let t=0;tr&&n.appendChild(document.createTextNode(s.slice(r,e)));let a=n.appendChild(document.createElement("span"));a.appendChild(document.createTextNode(s.slice(e,o))),a.className="cm-completionMatchedText",r=o}return rt.position-e.position)).map((t=>t.render))}(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=Fc(s.length,r,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",(i=>{let{options:n}=t.state.field(e).open;for(let e,s=i.target;s&&s!=this.dom;s=s.parentNode)if("LI"==s.nodeName&&(e=/-(\d+)$/.exec(s.id))&&+e[1]{let i=t.state.field(this.stateField,!1);i&&i.tooltip&&t.state.facet(Nc).closeOnBlur&&e.relatedTarget!=t.contentDOM&&t.dispatch({effects:Ic.of(null)})})),this.showOptions(s,n.id)}mount(){this.updateSel()}showOptions(t,e){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,e,this.range)),this.list.addEventListener("scroll",(()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)}))}update(t){var e;let i=t.state.field(this.stateField),n=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=n){let{options:s,selected:r,disabled:o}=i.open;n.open&&n.open.options==s||(this.range=Fc(s.length,r,t.state.facet(Nc).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),o!=(null===(e=n.open)||void 0===e?void 0:e.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}updateTooltipClass(t){let e=this.tooltipClass(t);if(e!=this.currentClass){for(let t of this.currentClass.split(" "))t&&this.dom.classList.remove(t);for(let t of e.split(" "))t&&this.dom.classList.add(t);this.currentClass=e}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),e=t.open;if((e.selected>-1&&e.selected=this.range.to)&&(this.range=Fc(e.options.length,e.selected,this.view.state.facet(Nc).maxRenderedOptions),this.showOptions(e.options,t.id)),this.updateSelectedOption(e.selected)){this.destroyInfo();let{completion:i}=e.options[e.selected],{info:n}=i;if(!n)return;let s="string"==typeof n?document.createTextNode(n):n(i);if(!s)return;"then"in s?s.then((e=>{e&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(e,i)})).catch((t=>Wn(this.view.state,t,"completion info"))):this.addInfoPane(s,i)}}addInfoPane(t,e){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",null!=t.nodeType)i.appendChild(t),this.infoDestroy=null;else{let{dom:e,destroy:n}=t;i.appendChild(e),this.infoDestroy=n||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let e=null;for(let i=this.list.firstChild,n=this.range.from;i;i=i.nextSibling,n++)"LI"==i.nodeName&&i.id?n==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),e=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected"):n--;return e&&function(t,e){let i=t.getBoundingClientRect(),n=e.getBoundingClientRect(),s=i.height/t.offsetHeight;n.topi.bottom&&(t.scrollTop+=(n.bottom-i.bottom)/s)}(this.list,e),e}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let e=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),n=t.getBoundingClientRect(),s=this.space;if(!s){let t=this.dom.ownerDocument.defaultView||window;s={left:0,top:0,right:t.innerWidth,bottom:t.innerHeight}}return n.top>Math.min(s.bottom,e.bottom)-10||n.bottomi.from||0==i.from))if(s=t,"string"!=typeof l&&l.header)n.appendChild(l.header(l));else{n.appendChild(document.createElement("completion-section")).textContent=t}}const h=n.appendChild(document.createElement("li"));h.id=e+"-"+r,h.setAttribute("role","option");let c=this.optionClass(o);c&&(h.className=c);for(let t of this.optionContent){let e=t(o,this.view.state,a);e&&h.appendChild(e)}}return i.from&&n.classList.add("cm-completionListIncompleteTop"),i.tonew Hc(i,t,e)}function Kc(t){return 100*(t.boost||0)+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}class tO{constructor(t,e,i,n,s,r){this.options=t,this.attrs=e,this.tooltip=i,this.timestamp=n,this.selected=s,this.disabled=r}setSelected(t,e){return t==this.selected||t>=this.options.length?this:new tO(this.options,nO(e,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,e,i,n,s){let r=function(t,e){let i=[],n=null,s=t=>{i.push(t);let{section:e}=t.completion;if(e){n||(n=[]);let t="string"==typeof e?e:e.name;n.some((e=>e.name==t))||n.push("string"==typeof e?{name:t}:e)}};for(let n of t)if(n.hasResult()){let t=n.result.getMatch;if(!1===n.result.filter)for(let e of n.result.options)s(new Vc(e,n.source,t?t(e):[],1e9-i.length));else{let i=new Bc(e.sliceDoc(n.from,n.to));for(let e of n.result.options)if(i.match(e.label)){let r=e.displayLabel?t?t(e,i.matched):[]:i.matched;s(new Vc(e,n.source,r,i.score+(e.boost||0)))}}}if(n){let t=Object.create(null),e=0,s=(t,e)=>{var i,n;return(null!==(i=t.rank)&&void 0!==i?i:1e9)-(null!==(n=e.rank)&&void 0!==n?n:1e9)||(t.namee.score-t.score||a(t.completion,e.completion)))){let e=t.completion;!o||o.label!=e.label||o.detail!=e.detail||null!=o.type&&null!=e.type&&o.type!=e.type||o.apply!=e.apply||o.boost!=e.boost?r.push(t):Kc(t.completion)>Kc(o)&&(r[r.length-1]=t),o=t.completion}return r}(t,e);if(!r.length)return n&&t.some((t=>1==t.state))?new tO(n.options,n.attrs,n.tooltip,n.timestamp,n.selected,!0):null;let o=e.facet(Nc).selectOnOpen?0:-1;if(n&&n.selected!=o&&-1!=n.selected){let t=n.options[n.selected].completion;for(let e=0;ee.hasResult()?Math.min(t,e.from):t),1e8),create:uO,above:s.aboveCursor},n?n.timestamp:Date.now(),o,!1)}map(t){return new tO(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class eO{constructor(t,e,i){this.active=t,this.id=e,this.open=i}static start(){return new eO(sO,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(t){let{state:e}=t,i=e.facet(Nc),n=(i.override||e.languageDataAt("autocomplete",Mc(e)).map(zc)).map((e=>(this.active.find((t=>t.source==e))||new oO(e,this.active.some((t=>0!=t.state))?1:0)).update(t,i)));n.length==this.active.length&&n.every(((t,e)=>t==this.active[e]))&&(n=this.active);let s=this.open;s&&t.docChanged&&(s=s.map(t.changes)),t.selection||n.some((e=>e.hasResult()&&t.changes.touchesRange(e.from,e.to)))||!function(t,e){if(t==e)return!0;for(let i=0,n=0;;){for(;i1==t.state))&&(s=null),!s&&n.every((t=>1!=t.state))&&n.some((t=>t.hasResult()))&&(n=n.map((t=>t.hasResult()?new oO(t.source,0):t)));for(let e of t.effects)e.is(hO)&&(s=s&&s.setSelected(e.value,this.id));return n==this.active&&s==this.open?this:new eO(n,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:iO}}const iO={"aria-autocomplete":"list"};function nO(t,e){let i={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(i["aria-activedescendant"]=t+"-"+e),i}const sO=[];function rO(t){return t.isUserEvent("input.type")?"input":t.isUserEvent("delete.backward")?"delete":null}class oO{constructor(t,e,i=-1){this.source=t,this.state=e,this.explicitPos=i}hasResult(){return!1}update(t,e){let i=rO(t),n=this;i?n=n.handleUserEvent(t,i,e):t.docChanged?n=n.handleChange(t):t.selection&&0!=n.state&&(n=new oO(n.source,0));for(let e of t.effects)if(e.is(Gc))n=new oO(n.source,1,e.value?Mc(t.state):-1);else if(e.is(Ic))n=new oO(n.source,0);else if(e.is(lO))for(let t of e.value)t.source==n.source&&(n=t);return n}handleUserEvent(t,e,i){return"delete"!=e&&i.activateOnTyping?new oO(this.source,1):this.map(t.changes)}handleChange(t){return t.changes.touchesRange(Mc(t.startState))?new oO(this.source,0):this.map(t.changes)}map(t){return t.empty||this.explicitPos<0?this:new oO(this.source,this.state,t.mapPos(this.explicitPos))}}class aO extends oO{constructor(t,e,i,n,s){super(t,2,e),this.result=i,this.from=n,this.to=s}hasResult(){return!0}handleUserEvent(t,e,i){var n;let s=t.changes.mapPos(this.from),r=t.changes.mapPos(this.to,1),o=Mc(t.state);if((this.explicitPos<0?o<=s:or||"delete"==e&&Mc(t.startState)==this.from)return new oO(this.source,"input"==e&&i.activateOnTyping?1:0);let a,l=this.explicitPos<0?-1:t.changes.mapPos(this.explicitPos);return function(t,e,i,n){if(!t)return!1;let s=e.sliceDoc(i,n);return"function"==typeof t?t(s,i,n,e):Ec(t,!0).test(s)}(this.result.validFor,t.state,s,r)?new aO(this.source,l,this.result,s,r):this.result.update&&(a=this.result.update(this.result,s,r,new Wc(t.state,o,l>=0)))?new aO(this.source,l,a,a.from,null!==(n=a.to)&&void 0!==n?n:Mc(t.state)):new oO(this.source,1,l)}handleChange(t){return t.changes.touchesRange(this.from,this.to)?new oO(this.source,0):this.map(t.changes)}map(t){return t.empty?this:new aO(this.source,this.explicitPos<0?-1:t.mapPos(this.explicitPos),this.result,t.mapPos(this.from),t.mapPos(this.to,1))}}const lO=re.define({map:(t,e)=>t.map((t=>t.map(e)))}),hO=re.define(),cO=Yt.define({create:()=>eO.start(),update:(t,e)=>t.update(e),provide:t=>[Ro.from(t,(t=>t.tooltip)),qr.contentAttributes.from(t,(t=>t.attrs))]});function OO(t,e){const i=e.completion.apply||e.completion.label;let n=t.state.field(cO).active.find((t=>t.source==e.source));return n instanceof aO&&("string"==typeof i?t.dispatch(Object.assign(Object.assign({},function(t,e,i,n){let{main:s}=t.selection,r=i-s.from,o=n-s.from;return Object.assign(Object.assign({},t.changeByRange((a=>a!=s&&i!=n&&t.sliceDoc(a.from+r,a.from+o)!=t.sliceDoc(i,n)?{range:a}:{changes:{from:a.from+r,to:n==s.from?a.to:a.from+o,insert:e},range:$t.cursor(a.from+r+e.length)}))),{scrollIntoView:!0,userEvent:"input.complete"})}(t.state,i,n.from,n.to)),{annotations:jc.of(e.completion)})):i(t,e.completion,n.from,n.to),!0)}const uO=Jc(cO,OO);function fO(t,e="option"){return i=>{let n=i.state.field(cO,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp-1?n.open.selected+r*(t?1:-1):t?0:o-1;return a<0?a="page"==e?0:o-1:a>=o&&(a="page"==e?o-1:0),i.dispatch({effects:hO.of(a)}),!0}}const dO=t=>{let e=t.state.field(cO,!1);return!(t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp!!t.state.field(cO,!1)&&(t.dispatch({effects:Gc.of(!0)}),!0),gO=t=>{let e=t.state.field(cO,!1);return!(!e||!e.active.some((t=>0!=t.state)))&&(t.dispatch({effects:Ic.of(null)}),!0)};class mO{constructor(t,e){this.active=t,this.context=e,this.time=Date.now(),this.updates=[],this.done=void 0}}const bO=Vn.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of t.state.field(cO).active)1==e.state&&this.startQuery(e)}update(t){let e=t.state.field(cO);if(!t.selectionSet&&!t.docChanged&&t.startState.field(cO)==e)return;let i=t.transactions.some((t=>(t.selection||t.docChanged)&&!rO(t)));for(let e=0;e50&&Date.now()-n.time>1e3){for(let t of n.context.abortListeners)try{t()}catch(t){Wn(this.view.state,t)}n.context.abortListeners=null,this.running.splice(e--,1)}else n.updates.push(...t.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some((t=>1==t.state&&!this.running.some((e=>e.active.source==t.source))))?setTimeout((()=>this.startUpdate()),50):-1,0!=this.composing)for(let e of t.transactions)"input"==rO(e)?this.composing=2:2==this.composing&&e.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:t}=this.view,e=t.field(cO);for(let t of e.active)1!=t.state||this.running.some((e=>e.active.source==t.source))||this.startQuery(t)}startQuery(t){let{state:e}=this.view,i=Mc(e),n=new Wc(e,i,t.explicitPos==i),s=new mO(t,n);this.running.push(s),Promise.resolve(t.source(n)).then((t=>{s.context.aborted||(s.done=t||null,this.scheduleAccept())}),(t=>{this.view.dispatch({effects:Ic.of(null)}),Wn(this.view.state,t)}))}scheduleAccept(){this.running.every((t=>void 0!==t.done))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((()=>this.accept()),this.view.state.facet(Nc).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],i=this.view.state.facet(Nc);for(let n=0;nt.source==s.active.source));if(r&&1==r.state)if(null==s.done){let t=new oO(s.active.source,0);for(let e of s.updates)t=t.update(e,i);1!=t.state&&e.push(t)}else this.startQuery(r)}e.length&&this.view.dispatch({effects:lO.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(cO,!1);if(e&&e.tooltip&&this.view.state.facet(Nc).closeOnBlur){let i=e.open&&Wo(this.view,e.open.tooltip);i&&i.dom.contains(t.relatedTarget)||this.view.dispatch({effects:Ic.of(null)})}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout((()=>this.view.dispatch({effects:Gc.of(!1)})),20),this.composing=0}}}),wO=qr.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class yO{constructor(t,e,i,n){this.field=t,this.line=e,this.from=i,this.to=n}}class SO{constructor(t,e,i){this.field=t,this.from=e,this.to=i}map(t){let e=t.mapPos(this.from,-1,gt.TrackDel),i=t.mapPos(this.to,1,gt.TrackDel);return null==e||null==i?null:new SO(this.field,e,i)}}class QO{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(t,e){let i=[],n=[e],s=t.doc.lineAt(e),r=/^\s*/.exec(s.text)[0];for(let s of this.lines){if(i.length){let i=r,o=/^\t*/.exec(s)[0].length;for(let e=0;enew SO(t.field,n[t.line]+t.from,n[t.line]+t.to)));return{text:i,ranges:o}}static parse(t){let e,i=[],n=[],s=[];for(let r of t.split(/\r\n?|\n/)){for(;e=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(r);){let t=e[1]?+e[1]:null,o=e[2]||e[3]||"",a=-1;for(let e=0;e=a&&t.field++}s.push(new yO(a,n.length,e.index,e.index+o.length)),r=r.slice(0,e.index)+o+r.slice(e.index+e[0].length)}for(let t;t=/\\([{}])/.exec(r);){r=r.slice(0,t.index)+t[1]+r.slice(t.index+t[0].length);for(let e of s)e.line==n.length&&e.from>t.index&&(e.from--,e.to--)}n.push(r)}return new QO(n,s)}}let vO=Ui.widget({widget:new class extends Bi{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),xO=Ui.mark({class:"cm-snippetField"});class kO{constructor(t,e){this.ranges=t,this.active=e,this.deco=Ui.set(t.map((t=>(t.from==t.to?vO:xO).range(t.from,t.to))))}map(t){let e=[];for(let i of this.ranges){let n=i.map(t);if(!n)return null;e.push(n)}return new kO(e,this.active)}selectionInsideField(t){return t.ranges.every((t=>this.ranges.some((e=>e.field==this.active&&e.from<=t.from&&e.to>=t.to))))}}const $O=re.define({map:(t,e)=>t&&t.map(e)}),PO=re.define(),ZO=Yt.define({create:()=>null,update(t,e){for(let i of e.effects){if(i.is($O))return i.value;if(i.is(PO)&&t)return new kO(t.ranges,i.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>qr.decorations.from(t,(t=>t?t.deco:Ui.none))});function TO(t,e){return $t.create(t.filter((t=>t.field==e)).map((t=>$t.range(t.from,t.to))))}function XO(t){let e=QO.parse(t);return(t,i,n,s)=>{let{text:r,ranges:o}=e.instantiate(t.state,n),a={changes:{from:n,to:s,insert:N.of(r)},scrollIntoView:!0,annotations:i?jc.of(i):void 0};if(o.length&&(a.selection=TO(o,0)),o.length>1){let e=new kO(o,0),i=a.effects=[$O.of(e)];void 0===t.state.field(ZO,!1)&&i.push(re.appendConfig.of([ZO,WO,YO,wO]))}t.dispatch(t.state.update(a))}}function CO(t){return({state:e,dispatch:i})=>{let n=e.field(ZO,!1);if(!n||t<0&&0==n.active)return!1;let s=n.active+t,r=t>0&&!n.ranges.some((e=>e.field==s+t));return i(e.update({selection:TO(n.ranges,s),effects:$O.of(r?null:new kO(n.ranges,s)),scrollIntoView:!0})),!0}}const AO=[{key:"Tab",run:CO(1),shift:CO(-1)},{key:"Escape",run:({state:t,dispatch:e})=>!!t.field(ZO,!1)&&(e(t.update({effects:$O.of(null)})),!0)}],RO=Tt.define({combine:t=>t.length?t[0]:AO}),WO=Dt.highest(zr.compute([RO],(t=>t.facet(RO))));function qO(t,e){return Object.assign(Object.assign({},e),{apply:XO(t)})}const YO=qr.domEventHandlers({mousedown(t,e){let i,n=e.state.field(ZO,!1);if(!n||null==(i=e.posAtCoords({x:t.clientX,y:t.clientY})))return!1;let s=n.ranges.find((t=>t.from<=i&&t.to>=i));return!(!s||s.field==n.active)&&(e.dispatch({selection:TO(n.ranges,s.field),effects:$O.of(n.ranges.some((t=>t.field>s.field))?new kO(n.ranges,s.field):null),scrollIntoView:!0}),!0)}});function _O(t,e){return new RegExp(e(t.source),t.unicode?"u":"")}const VO=Object.create(null);function MO(t,e,i,n,s){for(let r=t.iterLines(),o=0;!r.next().done;){let t,{value:a}=r;for(e.lastIndex=0;t=e.exec(a);)if(!n[t[0]]&&o+t.index!=s&&(i.push({type:"text",label:t[0]}),n[t[0]]=!0,i.length>=2e3))return;o+=a.length+1}}function EO(t,e,i,n,s){let r=t.length>=1e3,o=r&&e.get(t);if(o)return o;let a=[],l=Object.create(null);if(t.children){let r=0;for(let o of t.children){if(o.length>=1e3)for(let t of EO(o,e,i,n-r,s-r))l[t.label]||(l[t.label]=!0,a.push(t));else MO(o,i,a,l,s-r);r+=o.length+1}}else MO(t,i,a,l,s);return r&&a.length<2e3&&e.set(t,a),a}const jO=t=>{let e=t.state.languageDataAt("wordChars",t.pos).join(""),i=function(t){let e=t.replace(/[\]\-\\]/g,"\\$&");try{return new RegExp(`[\\p{Alphabetic}\\p{Number}_${e}]+`,"ug")}catch(t){return new RegExp(`[w${e}]`,"g")}}(e),n=t.matchBefore(_O(i,(t=>t+"$")));if(!n&&!t.explicit)return null;let s=n?n.from:t.pos,r=EO(t.state.doc,function(t){return VO[t]||(VO[t]=new WeakMap)}(e),i,5e4,s);return{from:s,options:r,validFor:_O(i,(t=>"^"+t))}},DO={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},zO=re.define({map(t,e){let i=e.mapPos(t,-1,gt.TrackAfter);return null==i?void 0:i}}),GO=new class extends we{};GO.startSide=1,GO.endSide=-1;const IO=Yt.define({create:()=>ve.empty,update(t,e){if(e.selection){let i=e.state.doc.lineAt(e.selection.main.head).from,n=e.startState.doc.lineAt(e.startState.selection.main.head).from;i!=e.changes.mapPos(n,-1)&&(t=ve.empty)}t=t.map(e.changes);for(let i of e.effects)i.is(zO)&&(t=t.update({add:[GO.range(i.value,i.value+1)]}));return t}});function BO(){return[HO,IO]}const NO="()[]{}<>";function UO(t){for(let e=0;e{if((FO?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let s=t.state.selection.main;if(n.length>2||2==n.length&&1==dt(ut(n,0))||e!=s.from||i!=s.to)return!1;let r=function(t,e){let i=LO(t,t.selection.main.head),n=i.brackets||DO.brackets;for(let s of n){let r=UO(ut(s,0));if(e==s)return r==s?nu(t,s,n.indexOf(s+s+s)>-1,i):eu(t,s,r,i.before||DO.before);if(e==r&&KO(t,t.selection.main.from))return iu(t,s,r)}return null}(t.state,n);return!!r&&(t.dispatch(r),!0)})),JO=[{key:"Backspace",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=LO(t,t.selection.main.head).brackets||DO.brackets,n=null,s=t.changeByRange((e=>{if(e.empty){let n=function(t,e){let i=t.sliceString(e-2,e);return dt(ut(i,0))==i.length?i:i.slice(1)}(t.doc,e.head);for(let s of i)if(s==n&&tu(t.doc,e.head)==UO(ut(s,0)))return{changes:{from:e.head-s.length,to:e.head+s.length},range:$t.cursor(e.head-s.length)}}return{range:n=e}}));return n||e(t.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!n}}];function KO(t,e){let i=!1;return t.field(IO).between(0,t.doc.length,(t=>{t==e&&(i=!0)})),i}function tu(t,e){let i=t.sliceString(e,e+2);return i.slice(0,dt(ut(i,0)))}function eu(t,e,i,n){let s=null,r=t.changeByRange((r=>{if(!r.empty)return{changes:[{insert:e,from:r.from},{insert:i,from:r.to}],effects:zO.of(r.to+e.length),range:$t.range(r.anchor+e.length,r.head+e.length)};let o=tu(t.doc,r.head);return!o||/\s/.test(o)||n.indexOf(o)>-1?{changes:{insert:e+i,from:r.head},effects:zO.of(r.head+e.length),range:$t.cursor(r.head+e.length)}:{range:s=r}}));return s?null:t.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function iu(t,e,i){let n=null,s=t.changeByRange((e=>e.empty&&tu(t.doc,e.head)==i?{changes:{from:e.head,to:e.head+i.length,insert:i},range:$t.cursor(e.head+i.length)}:n={range:e}));return n?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function nu(t,e,i,n){let s=n.stringPrefixes||DO.stringPrefixes,r=null,o=t.changeByRange((n=>{if(!n.empty)return{changes:[{insert:e,from:n.from},{insert:e,from:n.to}],effects:zO.of(n.to+e.length),range:$t.range(n.anchor+e.length,n.head+e.length)};let o,a=n.head,l=tu(t.doc,a);if(l==e){if(su(t,a))return{changes:{insert:e+e,from:a},effects:zO.of(a+e.length),range:$t.cursor(a+e.length)};if(KO(t,a)){let n=i&&t.sliceDoc(a,a+3*e.length)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+n.length,insert:n},range:$t.cursor(a+n.length)}}}else{if(i&&t.sliceDoc(a-2*e.length,a)==e+e&&(o=ru(t,a-2*e.length,s))>-1&&su(t,o))return{changes:{insert:e+e+e+e,from:a},effects:zO.of(a+e.length),range:$t.cursor(a+e.length)};if(t.charCategorizer(a)(l)!=fe.Word&&ru(t,a,s)>-1&&!function(t,e,i,n){let s=Ea(t).resolveInner(e,-1),r=n.reduce(((t,e)=>Math.max(t,e.length)),0);for(let o=0;o<5;o++){let o=t.sliceDoc(s.from,Math.min(s.to,s.from+i.length+r)),a=o.indexOf(i);if(!a||a>-1&&n.indexOf(o.slice(0,a))>-1){let e=s.firstChild;for(;e&&e.from==s.from&&e.to-e.from>i.length+a;){if(t.sliceDoc(e.to-i.length,e.to)==i)return!1;e=e.firstChild}return!0}let l=s.to==e&&s.parent;if(!l)break;s=l}return!1}(t,a,e,s))return{changes:{insert:e+e,from:a},effects:zO.of(a+e.length),range:$t.cursor(a+e.length)}}return{range:r=n}}));return r?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function su(t,e){let i=Ea(t).resolveInner(e+1);return i.parent&&i.from==e}function ru(t,e,i){let n=t.charCategorizer(e);if(n(t.sliceDoc(e-1,e))!=fe.Word)return e;for(let s of i){let i=e-s.length;if(t.sliceDoc(i,e)==s&&n(t.sliceDoc(i-1,i))!=fe.Word)return i}return-1}function ou(t={}){return[cO,Nc.of(t),bO,lu,wO]}const au=[{key:"Ctrl-Space",run:pO},{key:"Escape",run:gO},{key:"ArrowDown",run:fO(!0)},{key:"ArrowUp",run:fO(!1)},{key:"PageDown",run:fO(!0,"page")},{key:"PageUp",run:fO(!1,"page")},{key:"Enter",run:dO}],lu=Dt.highest(zr.computeN([Nc],(t=>t.facet(Nc).defaultKeymap?[au]:[])));function hu(t){let e=t.field(cO,!1);return e&&e.active.some((t=>1==t.state))?"pending":e&&e.active.some((t=>0!=t.state))?"active":null}const cu=new WeakMap;function Ou(t){var e;let i=null===(e=t.field(cO,!1))||void 0===e?void 0:e.open;if(!i||i.disabled)return[];let n=cu.get(i.options);return n||cu.set(i.options,n=i.options.map((t=>t.completion))),n}function uu(t){var e;let i=null===(e=t.field(cO,!1))||void 0===e?void 0:e.open;return i&&!i.disabled&&i.selected>=0?i.options[i.selected].completion:null}function fu(t){var e;let i=null===(e=t.field(cO,!1))||void 0===e?void 0:e.open;return i&&!i.disabled&&i.selected>=0?i.selected:null}const du=t=>{let{state:e}=t,i=e.doc.lineAt(e.selection.main.from),n=bu(t.state,i.from);return n.line?gu(t):!!n.block&&mu(t)};function pu(t,e){return({state:i,dispatch:n})=>{if(i.readOnly)return!1;let s=t(e,i);return!!s&&(n(i.update(s)),!0)}}const gu=pu(yu,0),mu=pu(((t,e)=>function(t,e,i=e.selection.ranges){let n=i.map((t=>bu(e,t.from).block));if(!n.every((t=>t)))return null;let s=i.map(((t,i)=>function(t,{open:e,close:i},n,s){let r,o,a=t.sliceDoc(n-wu,n),l=t.sliceDoc(s,s+wu),h=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(l)[0].length,O=a.length-h;if(a.slice(O-e.length,O)==e&&l.slice(c,c+i.length)==i)return{open:{pos:n-h,margin:h&&1},close:{pos:s+c,margin:c&&1}};s-n<=2*wu?r=o=t.sliceDoc(n,s):(r=t.sliceDoc(n,n+wu),o=t.sliceDoc(s-wu,s));let u=/^\s*/.exec(r)[0].length,f=/\s*$/.exec(o)[0].length,d=o.length-f-i.length;if(r.slice(u,u+e.length)==e&&o.slice(d,d+i.length)==i)return{open:{pos:n+u+e.length,margin:/\s/.test(r.charAt(u+e.length))?1:0},close:{pos:s-f-i.length,margin:/\s/.test(o.charAt(d-1))?1:0}};return null}(e,n[i],t.from,t.to)));if(2!=t&&!s.every((t=>t)))return{changes:e.changes(i.map(((t,e)=>s[e]?[]:[{from:t.from,insert:n[e].open+" "},{from:t.to,insert:" "+n[e].close}])))};if(1!=t&&s.some((t=>t))){let t=[];for(let e,i=0;i=0&&e[r].to>n.from?e[r].to=s.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:s.to})}return e}(e))),0);function bu(t,e){let i=t.languageDataAt("commentTokens",e);return i.length?i[0]:{}}const wu=50;function yu(t,e,i=e.selection.ranges){let n=[],s=-1;for(let{from:t,to:r}of i){let i=n.length,o=1e9,a=bu(e,t).line;if(a){for(let i=t;i<=r;){let l=e.doc.lineAt(i);if(l.from>s&&(t==r||r>l.from)){s=l.from;let t=/^\s*/.exec(l.text)[0].length,e=t==l.length,i=l.text.slice(t,t+a.length)==a?t:-1;tt.comment<0&&(!t.empty||t.single)))){let t=[];for(let{line:e,token:i,indent:s,empty:r,single:o}of n)!o&&r||t.push({from:e.from+s,insert:i+" "});let i=e.changes(t);return{changes:i,selection:e.selection.map(i,1)}}if(1!=t&&n.some((t=>t.comment>=0))){let t=[];for(let{line:e,comment:i,token:s}of n)if(i>=0){let n=e.from+i,r=n+s.length;" "==e.text[r-e.from]&&r++,t.push({from:n,to:r})}return{changes:t}}return null}const Su=ie.define(),Qu=ie.define(),vu=Tt.define(),xu=Tt.define({combine:t=>be(t,{minDepth:100,newGroupDelay:500,joinToEvent:(t,e)=>e},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,e)=>(i,n)=>t(i,n)||e(i,n)})});const ku=Yt.define({create:()=>Du.empty,update(t,e){let i=e.state.facet(xu),n=e.annotation(Su);if(n){let s=e.docChanged?$t.single(function(t){let e=0;return t.iterChangedRanges(((t,i)=>e=i)),e}(e.changes)):void 0,r=Au.fromTransaction(e,s),o=n.side,a=0==o?t.undone:t.done;return a=r?Ru(a,a.length,i.minDepth,r):_u(a,e.startState.selection),new Du(0==o?n.rest:a,0==o?a:n.rest)}let s=e.annotation(Qu);if("full"!=s&&"before"!=s||(t=t.isolate()),!1===e.annotation(oe.addToHistory))return e.changes.empty?t:t.addMapping(e.changes.desc);let r=Au.fromTransaction(e),o=e.annotation(oe.time),a=e.annotation(oe.userEvent);return r?t=t.addChanges(r,o,a,i,e):e.selection&&(t=t.addSelection(e.startState.selection,o,a,i.newGroupDelay)),"full"!=s&&"after"!=s||(t=t.isolate()),t},toJSON:t=>({done:t.done.map((t=>t.toJSON())),undone:t.undone.map((t=>t.toJSON()))}),fromJSON:t=>new Du(t.done.map(Au.fromJSON),t.undone.map(Au.fromJSON))});function $u(t={}){return[ku,xu.of(t),qr.domEventHandlers({beforeinput(t,e){let i="historyUndo"==t.inputType?Zu:"historyRedo"==t.inputType?Tu:null;return!!i&&(t.preventDefault(),i(e))}})]}function Pu(t,e){return function({state:i,dispatch:n}){if(!e&&i.readOnly)return!1;let s=i.field(ku,!1);if(!s)return!1;let r=s.pop(t,i,e);return!!r&&(n(r),!0)}}const Zu=Pu(0,!1),Tu=Pu(1,!1),Xu=Pu(0,!0),Cu=Pu(1,!0);class Au{constructor(t,e,i,n,s){this.changes=t,this.effects=e,this.mapped=i,this.startSelection=n,this.selectionsAfter=s}setSelAfter(t){return new Au(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,e,i;return{changes:null===(t=this.changes)||void 0===t?void 0:t.toJSON(),mapped:null===(e=this.mapped)||void 0===e?void 0:e.toJSON(),startSelection:null===(i=this.startSelection)||void 0===i?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map((t=>t.toJSON()))}}static fromJSON(t){return new Au(t.changes&&bt.fromJSON(t.changes),[],t.mapped&&mt.fromJSON(t.mapped),t.startSelection&&$t.fromJSON(t.startSelection),t.selectionsAfter.map($t.fromJSON))}static fromTransaction(t,e){let i=qu;for(let e of t.startState.facet(vu)){let n=e(t);n.length&&(i=i.concat(n))}return!i.length&&t.changes.empty?null:new Au(t.changes.invert(t.startState.doc),i,void 0,e||t.startState.selection,qu)}static selection(t){return new Au(void 0,qu,void 0,void 0,t)}}function Ru(t,e,i,n){let s=e+1>i+20?e-i-1:0,r=t.slice(s,e);return r.push(n),r}function Wu(t,e){return t.length?e.length?t.concat(e):t:e}const qu=[],Yu=200;function _u(t,e){if(t.length){let i=t[t.length-1],n=i.selectionsAfter.slice(Math.max(0,i.selectionsAfter.length-Yu));return n.length&&n[n.length-1].eq(e)?t:(n.push(e),Ru(t,t.length-1,1e9,i.setSelAfter(n)))}return[Au.selection([e])]}function Vu(t){let e=t[t.length-1],i=t.slice();return i[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),i}function Mu(t,e){if(!t.length)return t;let i=t.length,n=qu;for(;i;){let s=Eu(t[i-1],e,n);if(s.changes&&!s.changes.empty||s.effects.length){let e=t.slice(0,i);return e[i-1]=s,e}e=s.mapped,i--,n=s.selectionsAfter}return n.length?[Au.selection(n)]:qu}function Eu(t,e,i){let n=Wu(t.selectionsAfter.length?t.selectionsAfter.map((t=>t.map(e))):qu,i);if(!t.changes)return Au.selection(n);let s=t.changes.map(e),r=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(r):r;return new Au(s,re.mapEffects(t.effects,e),o,t.startSelection.map(r),n)}const ju=/^(input\.type|delete)($|\.)/;class Du{constructor(t,e,i=0,n=void 0){this.done=t,this.undone=e,this.prevTime=i,this.prevUserEvent=n}isolate(){return this.prevTime?new Du(this.done,this.undone):this}addChanges(t,e,i,n,s){let r=this.done,o=r[r.length-1];return r=o&&o.changes&&!o.changes.empty&&t.changes&&(!i||ju.test(i))&&(!o.selectionsAfter.length&&e-this.prevTimei.push(t,e))),e.iterChangedRanges(((t,e,s,r)=>{for(let t=0;t=e&&s<=o&&(n=!0)}})),n}(o.changes,t.changes))||"input.type.compose"==i)?Ru(r,r.length-1,n.minDepth,new Au(t.changes.compose(o.changes),Wu(t.effects,o.effects),o.mapped,o.startSelection,qu)):Ru(r,r.length,n.minDepth,t),new Du(r,qu,e,i)}addSelection(t,e,i,n){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:qu;return s.length>0&&e-this.prevTimet.empty!=o.ranges[e].empty)).length)?this:new Du(_u(this.done,t),this.undone,e,i);var r,o}addMapping(t){return new Du(Mu(this.done,t),Mu(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,e,i){let n=0==t?this.done:this.undone;if(0==n.length)return null;let s=n[n.length-1];if(i&&s.selectionsAfter.length)return e.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:Su.of({side:t,rest:Vu(n)}),userEvent:0==t?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let i=1==n.length?qu:n.slice(0,n.length-1);return s.mapped&&(i=Mu(i,s.mapped)),e.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:Su.of({side:t,rest:i}),filter:!1,userEvent:0==t?"undo":"redo",scrollIntoView:!0})}return null}}Du.empty=new Du(qu,qu);const zu=[{key:"Mod-z",run:Zu,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Tu,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Tu,preventDefault:!0},{key:"Mod-u",run:Xu,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Cu,preventDefault:!0}];function Gu(t,e){return $t.create(t.ranges.map(e),t.mainIndex)}function Iu(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Bu({state:t,dispatch:e},i){let n=Gu(t.selection,i);return!n.eq(t.selection)&&(e(Iu(t,n)),!0)}function Nu(t,e){return $t.cursor(e?t.to:t.from)}function Uu(t,e){return Bu(t,(i=>i.empty?t.moveByChar(i,e):Nu(i,e)))}function Lu(t){return t.textDirectionAt(t.state.selection.main.head)==sn.LTR}const Fu=t=>Uu(t,!Lu(t)),Hu=t=>Uu(t,Lu(t));function Ju(t,e){return Bu(t,(i=>i.empty?t.moveByGroup(i,e):Nu(i,e)))}const Ku=t=>Ju(t,!Lu(t)),tf=t=>Ju(t,Lu(t));function ef(t,e,i){if(e.type.prop(i))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function nf(t,e,i){let s,r,o=Ea(t).resolveInner(e.head),a=i?n.closedBy:n.openedBy;for(let n=e.head;;){let e=i?o.childAfter(n):o.childBefore(n);if(!e)break;ef(t,e,a)?o=e:n=i?e.to:e.from}return r=o.type.prop(a)&&(s=i?ah(t,o.from,1):ah(t,o.to,-1))&&s.matched?i?s.end.to:s.end.from:i?o.to:o.from,$t.cursor(r,i?-1:1)}const sf=t=>Bu(t,(e=>nf(t.state,e,!Lu(t)))),rf=t=>Bu(t,(e=>nf(t.state,e,Lu(t))));function of(t,e){return Bu(t,(i=>{if(!i.empty)return Nu(i,e);let n=t.moveVertically(i,e);return n.head!=i.head?n:t.moveToLineBoundary(i,e)}))}const af=t=>of(t,!1),lf=t=>of(t,!0);function hf(t){let e,i=t.scrollDOM.clientHeighti.empty?t.moveVertically(i,e,n.height):Nu(i,e)));if(r.eq(s.selection))return!1;if(n.selfScroll){let e=t.coordsAtPos(s.selection.main.head),o=t.scrollDOM.getBoundingClientRect(),a=o.top+n.marginTop,l=o.bottom-n.marginBottom;e&&e.top>a&&e.bottomcf(t,!1),uf=t=>cf(t,!0);function ff(t,e,i){let n=t.lineBlockAt(e.head),s=t.moveToLineBoundary(e,i);if(s.head==e.head&&s.head!=(i?n.to:n.from)&&(s=t.moveToLineBoundary(e,i,!1)),!i&&s.head==n.from&&n.length){let i=/^\s*/.exec(t.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;i&&e.head!=n.from+i&&(s=$t.cursor(n.from+i))}return s}function df(t,e,i){let n=!1,s=Gu(t.selection,(e=>{let s=ah(t,e.head,-1)||ah(t,e.head,1)||e.head>0&&ah(t,e.head-1,1)||e.headdf(t,e,!1),gf=({state:t,dispatch:e})=>df(t,e,!0);function mf(t,e){let i=Gu(t.state.selection,(t=>{let i=e(t);return $t.range(t.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)}));return!i.eq(t.state.selection)&&(t.dispatch(Iu(t.state,i)),!0)}function bf(t,e){return mf(t,(i=>t.moveByChar(i,e)))}const wf=t=>bf(t,!Lu(t)),yf=t=>bf(t,Lu(t));function Sf(t,e){return mf(t,(i=>t.moveByGroup(i,e)))}const Qf=t=>Sf(t,!Lu(t)),vf=t=>Sf(t,Lu(t)),xf=t=>mf(t,(e=>nf(t.state,e,!Lu(t)))),kf=t=>mf(t,(e=>nf(t.state,e,Lu(t))));function $f(t,e){return mf(t,(i=>t.moveVertically(i,e)))}const Pf=t=>$f(t,!1),Zf=t=>$f(t,!0);function Tf(t,e){return mf(t,(i=>t.moveVertically(i,e,hf(t).height)))}const Xf=t=>Tf(t,!1),Cf=t=>Tf(t,!0),Af=({state:t,dispatch:e})=>(e(Iu(t,{anchor:0})),!0),Rf=({state:t,dispatch:e})=>(e(Iu(t,{anchor:t.doc.length})),!0),Wf=({state:t,dispatch:e})=>(e(Iu(t,{anchor:t.selection.main.anchor,head:0})),!0),qf=({state:t,dispatch:e})=>(e(Iu(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0);function Yf(t,e){if(t.state.readOnly)return!1;let i="delete.selection",{state:n}=t,s=n.changeByRange((n=>{let{from:s,to:r}=n;if(s==r){let o=e(n);os&&(i="delete.forward",o=_f(t,o,!0)),s=Math.min(s,o),r=Math.max(r,o)}else s=_f(t,s,!1),r=_f(t,r,!0);return s==r?{range:n}:{changes:{from:s,to:r},range:$t.cursor(s,se(t))))n.between(e,e,((t,n)=>{te&&(e=i?n:t)}));return e}const Vf=(t,e)=>Yf(t,(i=>{let n,s,r=i.from,{state:o}=t,a=o.doc.lineAt(r);if(!e&&r>a.from&&rVf(t,!1),Ef=t=>Vf(t,!0),jf=(t,e)=>Yf(t,(i=>{let n=i.head,{state:s}=t,r=s.doc.lineAt(n),o=s.charCategorizer(n);for(let t=null;;){if(n==(e?r.to:r.from)){n==i.head&&r.number!=(e?s.doc.lines:1)&&(n+=e?1:-1);break}let a=at(r.text,n-r.from,e)+r.from,l=r.text.slice(Math.min(n,a)-r.from,Math.max(n,a)-r.from),h=o(l);if(null!=t&&h!=t)break;" "==l&&n==i.head||(t=h),n=a}return n})),Df=t=>jf(t,!1);const zf=Gf(!1);function Gf(t){return({state:e,dispatch:i})=>{if(e.readOnly)return!1;let s=e.changeByRange((i=>{let{from:s,to:r}=i,o=e.doc.lineAt(s),a=!t&&s==r&&function(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let i,s=Ea(t).resolveInner(e),r=s.childBefore(e),o=s.childAfter(e);return r&&o&&r.to<=e&&o.from>=e&&(i=r.type.prop(n.closedBy))&&i.indexOf(o.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(o.from).from&&!/\S/.test(t.sliceDoc(r.to,o.from))?{from:r.to,to:o.from}:null}(e,s);t&&(s=r=(r<=o.to?o:e.doc.lineAt(r)).to);let l=new sl(e,{simulateBreak:s,simulateDoubleBreak:!!a}),h=nl(l,s);for(null==h&&(h=qe(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));ro.from&&s{let s=[];for(let r=n.from;r<=n.to;){let o=t.doc.lineAt(r);o.number>i&&(n.empty||n.to>o.from)&&(e(o,s,n),i=o.number),r=o.to+1}let r=t.changes(s);return{changes:s,range:$t.range(r.mapPos(n.anchor,1),r.mapPos(n.head,1))}}))}const Bf=({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(If(t,((e,i)=>{i.push({from:e.from,insert:t.facet(tl)})})),{userEvent:"input.indent"})),!0),Nf=({state:t,dispatch:e})=>!t.readOnly&&(e(t.update(If(t,((e,i)=>{let n=/^\s*/.exec(e.text)[0];if(!n)return;let s=qe(n,t.tabSize),r=0,o=il(t,Math.max(0,s-el(t)));for(;rBu(t,(e=>ff(t,e,!Lu(t)))),shift:t=>mf(t,(e=>ff(t,e,!Lu(t)))),preventDefault:!0},{key:"ArrowRight",run:Hu,shift:yf,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:tf,shift:vf,preventDefault:!0},{mac:"Cmd-ArrowRight",run:t=>Bu(t,(e=>ff(t,e,Lu(t)))),shift:t=>mf(t,(e=>ff(t,e,Lu(t)))),preventDefault:!0},{key:"ArrowUp",run:af,shift:Pf,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Af,shift:Wf},{mac:"Ctrl-ArrowUp",run:Of,shift:Xf},{key:"ArrowDown",run:lf,shift:Zf,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Rf,shift:qf},{mac:"Ctrl-ArrowDown",run:uf,shift:Cf},{key:"PageUp",run:Of,shift:Xf},{key:"PageDown",run:uf,shift:Cf},{key:"Home",run:t=>Bu(t,(e=>ff(t,e,!1))),shift:t=>mf(t,(e=>ff(t,e,!1))),preventDefault:!0},{key:"Mod-Home",run:Af,shift:Wf},{key:"End",run:t=>Bu(t,(e=>ff(t,e,!0))),shift:t=>mf(t,(e=>ff(t,e,!0))),preventDefault:!0},{key:"Mod-End",run:Rf,shift:qf},{key:"Enter",run:zf},{key:"Mod-a",run:({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:Mf,shift:Mf},{key:"Delete",run:Ef},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Df},{key:"Mod-Delete",mac:"Alt-Delete",run:t=>jf(t,!0)},{mac:"Mod-Backspace",run:t=>Yf(t,(e=>{let i=t.moveToLineBoundary(e,!1).head;return e.head>i?i:Math.max(0,e.head-1)}))},{mac:"Mod-Delete",run:t=>Yf(t,(e=>{let i=t.moveToLineBoundary(e,!0).head;return e.headBu(t,(e=>$t.cursor(t.lineBlockAt(e.head).from,1))),shift:t=>mf(t,(e=>$t.cursor(t.lineBlockAt(e.head).from)))},{key:"Ctrl-e",run:t=>Bu(t,(e=>$t.cursor(t.lineBlockAt(e.head).to,-1))),shift:t=>mf(t,(e=>$t.cursor(t.lineBlockAt(e.head).to)))},{key:"Ctrl-d",run:Ef},{key:"Ctrl-h",run:Mf},{key:"Ctrl-k",run:t=>Yf(t,(e=>{let i=t.lineBlockAt(e.head).to;return e.head{if(t.readOnly)return!1;let i=t.changeByRange((t=>({changes:{from:t.from,to:t.to,insert:N.of(["",""])},range:$t.cursor(t.from)})));return e(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange((e=>{if(!e.empty||0==e.from||e.from==t.doc.length)return{range:e};let i=e.from,n=t.doc.lineAt(i),s=i==n.from?i-1:at(n.text,i-n.from,!1)+n.from,r=i==n.to?i+1:at(n.text,i-n.from,!0)+n.from;return{changes:{from:s,to:r,insert:t.doc.slice(i,r).append(t.doc.slice(s,i))},range:$t.cursor(r)}}));return!i.changes.empty&&(e(t.update(i,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:uf}].map((t=>({mac:t.key,run:t.run,shift:t.shift})))),Lf=20,Ff=22,Hf=23,Jf=24,Kf=26,td=27,ed=28,id=31,nd=34,sd=37,rd={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},od={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},ad={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function ld(t){return 9==t||10==t||13==t||32==t}let hd=null,cd=null,Od=0;function ud(t,e){let i=t.pos+e;if(Od==i&&cd==t)return hd;let n=t.peek(e);for(;ld(n);)n=t.peek(++e);let s="";for(;45==(r=n)||46==r||58==r||r>=65&&r<=90||95==r||r>=97&&r<=122||r>=161;)s+=String.fromCharCode(n),n=t.peek(++e);var r;return cd=t,Od=i,hd=s?s.toLowerCase():n==fd||n==dd?void 0:null}const fd=63,dd=33;function pd(t,e){this.name=t,this.parent=e,this.hash=e?e.hash:0;for(let e=0;egd.indexOf(e)>-1?new pd(ud(n,1)||"",t):t,reduce:(t,e)=>e==Lf&&t?t.parent:t,reuse(t,e,i,n){let s=e.type.id;return 6==s||36==s?new pd(ud(n,1)||"",t):t},hash:t=>t?t.hash:0,strict:!1}),bd=new Ih(((t,e)=>{if(60!=t.next)return void(t.next<0&&e.context&&t.acceptToken(57));t.advance();let i=47==t.next;i&&t.advance();let n=ud(t,0);if(void 0===n)return;if(!n)return t.acceptToken(i?14:6);let s=e.context?e.context.name:null;if(i){if(n==s)return t.acceptToken(11);if(s&&od[s])return t.acceptToken(57,-2);if(e.dialectEnabled(0))return t.acceptToken(12);for(let t=e.context;t;t=t.parent)if(t.name==n)return;t.acceptToken(13)}else{if("script"==n)return t.acceptToken(7);if("style"==n)return t.acceptToken(8);if("textarea"==n)return t.acceptToken(9);if(rd.hasOwnProperty(n))return t.acceptToken(10);s&&ad[s]&&ad[s][n]?t.acceptToken(57,-1):t.acceptToken(6)}}),{contextual:!0}),wd=new Ih((t=>{for(let e=0,i=0;;i++){if(t.next<0){i&&t.acceptToken(58);break}if(45==t.next)e++;else{if(62==t.next&&e>=2){i>=3&&t.acceptToken(58,-2);break}e=0}t.advance()}}));const yd=new Ih(((t,e)=>{if(47==t.next&&62==t.peek(1)){let i=e.dialectEnabled(1)||function(t){for(;t;t=t.parent)if("svg"==t.name||"math"==t.name)return!0;return!1}(e.context);t.acceptToken(i?5:4,2)}else 62==t.next&&t.acceptToken(4,1)}));function Sd(t,e,i){let n=2+t.length;return new Ih((s=>{for(let r=0,o=0,a=0;;a++){if(s.next<0){a&&s.acceptToken(e);break}if(0==r&&60==s.next||1==r&&47==s.next||r>=2&&ro?s.acceptToken(e,-o):s.acceptToken(i,-(o-2));break}if((10==s.next||13==s.next)&&a){s.acceptToken(e,1);break}r=o=0}else o++;s.advance()}}))}const Qd=Sd("script",54,1),vd=Sd("style",55,2),xd=Sd("textarea",56,3),kd=Oa({"Text RawText":Aa.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":Aa.angleBracket,TagName:Aa.tagName,"MismatchedCloseTag/TagName":[Aa.tagName,Aa.invalid],AttributeName:Aa.attributeName,"AttributeValue UnquotedAttributeValue":Aa.attributeValue,Is:Aa.definitionOperator,"EntityReference CharacterReference":Aa.character,Comment:Aa.blockComment,ProcessingInst:Aa.processingInstruction,DoctypeDecl:Aa.documentMeta}),$d=rc.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%WQ&rO,59fO%`Q&rO,59iO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OS|OhyO~OS!OOhyO~OS!QOhyO~OS!SOT!TOhyO~OS!TOhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXhgXTgX~OS!fOhyO~OS!gOhyO~OS!hOhyO~OS!iOT!jOhyO~OS!jOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{}!P!R!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!UeZ!e{}!P!R!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:md,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"Clo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S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let a=t.type.id;if(a==ed)return Td(t,e,i);if(a==id)return Td(t,e,n);if(a==nd)return Td(t,e,s);if(a==Lf&&r.length){let i,n=t.node,s=n.firstChild,o=s&&Zd(s,e);if(o)for(let t of r)if(t.tag==o&&(!t.attrs||t.attrs(i||(i=Pd(n,e))))){let e=n.lastChild,i=e.type.id==sd?e.from:n.to;if(i>s.to)return{parser:t.parser,overlay:[{from:s.to,to:i}]}}}if(o&&a==Hf){let i,n=t.node;if(i=n.firstChild){let t=o[e.read(i.from,i.to)];if(t)for(let i of t){if(i.tagName&&i.tagName!=Zd(n.parent,e))continue;let t=n.lastChild;if(t.type.id==Kf){let e=t.from+1,n=t.lastChild,s=t.to-(n&&n.isError?0:1);if(s>e)return{parser:i.parser,overlay:[{from:e,to:s}]}}else if(t.type.id==td)return{parser:i.parser,overlay:[{from:t.from,to:t.to}]}}}}return null}))}const Cd=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Ad=new sc({start:!1,shift:(t,e)=>4==e||5==e||312==e?t:313==e,strict:!1}),Rd=new Ih(((t,e)=>{let{next:i}=t;(125==i||-1==i||e.context)&&t.acceptToken(310)}),{contextual:!0,fallback:!0}),Wd=new Ih(((t,e)=>{let i,{next:n}=t;Cd.indexOf(n)>-1||(47!=n||47!=(i=t.peek(1))&&42!=i)&&(125==n||59==n||-1==n||e.context||t.acceptToken(309))}),{contextual:!0}),qd=new Ih(((t,e)=>{let{next:i}=t;if((43==i||45==i)&&(t.advance(),i==t.next)){t.advance();let i=!e.context&&e.canShift(1);t.acceptToken(i?1:2)}}),{contextual:!0});function Yd(t,e){return t>=65&&t<=90||t>=97&&t<=122||95==t||t>=192||!e&&t>=48&&t<=57}const _d=new Ih(((t,e)=>{if(60!=t.next||!e.dialectEnabled(0))return;if(t.advance(),47==t.next)return;let i=0;for(;Cd.indexOf(t.next)>-1;)t.advance(),i++;if(Yd(t.next,!0)){for(t.advance(),i++;Yd(t.next,!1);)t.advance(),i++;for(;Cd.indexOf(t.next)>-1;)t.advance(),i++;if(44==t.next)return;for(let e=0;;e++){if(7==e){if(!Yd(t.next,!0))return;break}if(t.next!="extends".charCodeAt(e))break;t.advance(),i++}}t.acceptToken(3,-i)})),Vd=Oa({"get set async static":Aa.modifier,"for while do if else switch try catch finally return throw break continue default case":Aa.controlKeyword,"in of await yield void typeof delete instanceof":Aa.operatorKeyword,"let var const using function class extends":Aa.definitionKeyword,"import export from":Aa.moduleKeyword,"with debugger as new":Aa.keyword,TemplateString:Aa.special(Aa.string),super:Aa.atom,BooleanLiteral:Aa.bool,this:Aa.self,null:Aa.null,Star:Aa.modifier,VariableName:Aa.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":Aa.function(Aa.variableName),VariableDefinition:Aa.definition(Aa.variableName),Label:Aa.labelName,PropertyName:Aa.propertyName,PrivatePropertyName:Aa.special(Aa.propertyName),"CallExpression/MemberExpression/PropertyName":Aa.function(Aa.propertyName),"FunctionDeclaration/VariableDefinition":Aa.function(Aa.definition(Aa.variableName)),"ClassDeclaration/VariableDefinition":Aa.definition(Aa.className),PropertyDefinition:Aa.definition(Aa.propertyName),PrivatePropertyDefinition:Aa.definition(Aa.special(Aa.propertyName)),UpdateOp:Aa.updateOperator,"LineComment Hashbang":Aa.lineComment,BlockComment:Aa.blockComment,Number:Aa.number,String:Aa.string,Escape:Aa.escape,ArithOp:Aa.arithmeticOperator,LogicOp:Aa.logicOperator,BitOp:Aa.bitwiseOperator,CompareOp:Aa.compareOperator,RegExp:Aa.regexp,Equals:Aa.definitionOperator,Arrow:Aa.function(Aa.punctuation),": Spread":Aa.punctuation,"( )":Aa.paren,"[ ]":Aa.squareBracket,"{ }":Aa.brace,"InterpolationStart InterpolationEnd":Aa.special(Aa.brace),".":Aa.derefOperator,", ;":Aa.separator,"@":Aa.meta,TypeName:Aa.typeName,TypeDefinition:Aa.definition(Aa.typeName),"type enum interface implements namespace module declare":Aa.definitionKeyword,"abstract global Privacy readonly override":Aa.modifier,"is keyof unique infer":Aa.operatorKeyword,JSXAttributeValue:Aa.attributeValue,JSXText:Aa.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":Aa.angleBracket,"JSXIdentifier JSXNameSpacedName":Aa.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":Aa.attributeName,"JSXBuiltin/JSXIdentifier":Aa.standard(Aa.tagName)}),Md={__proto__:null,export:18,as:23,from:31,default:34,async:39,function:40,extends:52,this:56,true:64,false:64,null:76,void:80,typeof:84,super:102,new:136,delete:152,yield:161,await:165,class:170,public:227,private:227,protected:227,readonly:229,instanceof:248,satisfies:251,in:252,const:254,import:286,keyof:339,unique:343,infer:349,is:385,abstract:405,implements:407,type:409,let:412,var:414,using:417,interface:423,enum:427,namespace:433,module:435,declare:439,global:443,for:462,of:471,while:474,with:478,do:482,if:486,else:488,switch:492,case:498,try:504,catch:508,finally:512,return:516,throw:520,break:524,continue:528,debugger:532},Ed={__proto__:null,async:123,get:125,set:127,declare:187,public:189,private:189,protected:189,static:191,abstract:193,override:195,readonly:201,accessor:203,new:389},jd={__proto__:null,"<":143},Dd=rc.deserialize({version:14,states:"$<[O%TQ^OOO%[Q^OOO'_Q`OOP(lOWOOO*zQ08SO'#ChO+RO!bO'#CiO+aO#tO'#CiO+oO?MpO'#D^O.QQ^O'#DdO.bQ^O'#DoO%[Q^O'#DyO0fQ^O'#EROOQ07b'#EZ'#EZO1PQWO'#EWOOQO'#El'#ElOOQO'#Ie'#IeO1XQWO'#GmO1dQWO'#EkO1iQWO'#EkO3kQ08SO'#JiO6[Q08SO'#JjO6xQWO'#FZO6}Q&jO'#FqOOQ07b'#Fc'#FcO7YO,YO'#FcO7hQ7[O'#FxO9UQWO'#FwOOQ07b'#Jj'#JjOOQ07`'#Ji'#JiO9ZQWO'#GqOOQU'#KV'#KVO9fQWO'#IRO9kQ07hO'#ISOOQU'#JW'#JWOOQU'#IW'#IWQ`Q^OOO`Q^OOO%[Q^O'#DqO9sQ^O'#D}O9zQ^O'#EPO9aQWO'#GmO:RQ7[O'#CnO:aQWO'#EjO:lQWO'#EuO:qQ7[O'#FbO;`QWO'#GmOOQO'#KW'#KWO;eQWO'#KWO;sQWO'#GuO;sQWO'#GvO;sQWO'#GxO9aQWO'#G{ORQWO'#CdO>cQWO'#H[O>kQWO'#HbO>kQWO'#HdO`Q^O'#HfO>kQWO'#HhO>kQWO'#HkO>pQWO'#HqO>uQ07iO'#HwO%[Q^O'#HyO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&w'P'T'^'n(O(Q(W(_(s(w({)o)z+P+T+_,f,i,n,z,}-_-g-u-{.].m.t.|0]0b0r1`1p1q1s1u1x1{1}2^2n2t3Q3[3q5X5Z5e5u5v5y6T6^6k7x7}8^8h9X9j:d:g:h:k:l:m:n:o:p:q:r:s:t:u:v:w:x:|;Z;[;];_;f;g;p;q<^t!nQ!r!v!y!z'S'Z'['h'i'j-R-X-Z-k1]5^5`$v$ti#v#x$d$e$y$|%P%R%]%^%b)v)|*O*Q*S*Z*a*q*r+^+a+x+{.[.j/[/k/l/n0R0T0_1S1V1_3P3y4T4]4g4o4q5d6h7U7_7z8k8x9]9o:P:X:z:{:};O;P;Q;T;U;V;W;X;Y;`;a;b;c;d;e;h;i;j;k;l;m;n;o;r;s < TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:372,context:Ad,nodeProps:[["isolate",-8,4,5,13,33,35,48,50,52,""],["group",-26,8,16,18,65,201,205,209,210,212,215,218,228,230,236,238,240,242,245,251,257,259,261,263,265,267,268,"Statement",-32,12,13,28,31,32,38,48,51,52,54,59,67,75,79,81,83,84,106,107,116,117,134,137,139,140,141,142,144,145,164,165,167,"Expression",-23,27,29,33,37,39,41,168,170,172,173,175,176,177,179,180,181,183,184,185,195,197,199,200,"Type",-3,87,99,105,"ClassItem"],["openedBy",22,"<",34,"InterpolationStart",53,"[",57,"{",72,"(",157,"JSXStartCloseTag"],["closedBy",23,">",36,"InterpolationEnd",47,"]",58,"}",73,")",162,"JSXEndTag"]],propSources:[Vd],skippedNodes:[0,4,5,271],repeatNodeCount:37,tokenData:"$HR(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkw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$KV$KW$Bp$KW&FUEr&FU&FV$Bp&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$Bp?HUOEr(CS$F^k$f&j(Op(R!b'u(;d$Y#t'{&;d([!LYOY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[Wd,qd,_d,2,3,4,5,6,7,8,9,10,11,12,13,Rd,new Gh("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOt~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!R~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(Z~~",141,332),new Gh("j~RQYZXz{^~^O'x~~aP!P!Qd~iO'y~~",25,315)],topRules:{Script:[0,6],SingleExpression:[1,269],SingleClassItem:[2,270]},dialects:{jsx:0,ts:14614},dynamicPrecedences:{69:1,79:1,81:1,165:1,193:1},specialized:[{term:319,get:t=>Md[t]||-1},{term:334,get:t=>Ed[t]||-1},{term:70,get:t=>jd[t]||-1}],tokenPrec:14638}),zd=[qO("function ${name}(${params}) {\n\t${}\n}",{label:"function",detail:"definition",type:"keyword"}),qO("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}",{label:"for",detail:"loop",type:"keyword"}),qO("for (let ${name} of ${collection}) {\n\t${}\n}",{label:"for",detail:"of loop",type:"keyword"}),qO("do {\n\t${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),qO("while (${}) {\n\t${}\n}",{label:"while",detail:"loop",type:"keyword"}),qO("try {\n\t${}\n} catch (${error}) {\n\t${}\n}",{label:"try",detail:"/ catch block",type:"keyword"}),qO("if (${}) {\n\t${}\n}",{label:"if",detail:"block",type:"keyword"}),qO("if (${}) {\n\t${}\n} else {\n\t${}\n}",{label:"if",detail:"/ else block",type:"keyword"}),qO("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}",{label:"class",detail:"definition",type:"keyword"}),qO('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),qO('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Gd=zd.concat([qO("interface ${name} {\n\t${}\n}",{label:"interface",detail:"definition",type:"keyword"}),qO("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),qO("enum ${name} {\n\t${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Id=new T,Bd=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Nd(t){return(e,i)=>{let n=e.node.getChild("VariableDefinition");return n&&i(n,t),!0}}const Ud=["FunctionDeclaration"],Ld={FunctionDeclaration:Nd("function"),ClassDeclaration:Nd("class"),ClassExpression:()=>!0,EnumDeclaration:Nd("constant"),TypeAliasDeclaration:Nd("type"),NamespaceDeclaration:Nd("namespace"),VariableDefinition(t,e){t.matchContext(Ud)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function Fd(t,e){let i=Id.get(e);if(i)return i;let n=[],s=!0;function r(e,i){let s=t.sliceString(e.from,e.to);n.push({label:s,type:i})}return e.cursor(c.IncludeAnonymous).iterate((e=>{if(s)s=!1;else if(e.name){let t=Ld[e.name];if(t&&t(e,r)||Bd.has(e.name))return!1}else if(e.to-e.from>8192){for(let i of Fd(t,e.node))n.push(i);return!1}})),Id.set(e,n),n}const Hd=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Jd=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function Kd(t){let e=Ea(t.state).resolveInner(t.pos,-1);if(Jd.indexOf(e.name)>-1)return null;let i="VariableName"==e.name||e.to-e.from<20&&Hd.test(t.state.sliceDoc(e.from,e.to));if(!i&&!t.explicit)return null;let n=[];for(let i=e;i;i=i.parent)Bd.has(i.name)&&(n=n.concat(Fd(t.state.doc,i)));return{options:n,from:i?e.from:t.pos,validFor:Hd}}function tp(t,e,i){var n;let s=[];for(;;){let r,o=e.firstChild;if("VariableName"==(null==o?void 0:o.name))return s.push(t(o)),{path:s.reverse(),name:i};if("MemberExpression"!=(null==o?void 0:o.name)||"PropertyName"!=(null===(n=r=o.lastChild)||void 0===n?void 0:n.name))return null;s.push(t(r)),e=o}}function ep(t){let e=e=>t.state.doc.sliceString(e.from,e.to),i=Ea(t.state).resolveInner(t.pos,-1);return"PropertyName"==i.name?tp(e,i.parent,e(i)):"."!=i.name&&"?."!=i.name||"MemberExpression"!=i.parent.name?Jd.indexOf(i.name)>-1?null:"VariableName"==i.name||i.to-i.from<20&&Hd.test(e(i))?{path:[],name:e(i)}:"MemberExpression"==i.name?tp(e,i,""):t.explicit?{path:[],name:""}:null:tp(e,i.parent,"")}const ip=Ma.define({name:"javascript",parser:Dd.configure({props:[rl.add({IfStatement:dl({except:/^\s*({|else\b)/}),TryStatement:dl({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:fl,SwitchBody:t=>{let e=t.textAfter,i=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return t.baseIndent+(i?0:n?1:2)*t.unit},Block:Ol({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":dl({except:/^{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag":t=>t.column(t.node.from)+t.unit}),ml.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":bl,BlockComment:t=>({from:t.from+2,to:t.to-2})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),np={test:t=>/^JSX/.test(t.name),facet:qa({commentTokens:{block:{open:"{/*",close:"*/}"}}})},sp=ip.configure({dialect:"ts"},"typescript"),rp=ip.configure({dialect:"jsx",props:[Ya.add((t=>t.isTop?[np]:void 0))]}),op=ip.configure({dialect:"jsx ts",props:[Ya.add((t=>t.isTop?[np]:void 0))]},"typescript");let ap=t=>({label:t,type:"keyword"});const lp="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(ap),hp=lp.concat(["declare","implements","private","protected","public"].map(ap));function cp(t={}){let e=t.jsx?t.typescript?op:rp:t.typescript?sp:ip,i=t.typescript?Gd.concat(hp):zd.concat(lp);return new Ha(e,[ip.data.of({autocomplete:_c(Jd,Yc(i))}),ip.data.of({autocomplete:Kd}),t.jsx?fp:[]])}function Op(t,e,i=t.length){for(let n=null==e?void 0:e.firstChild;n;n=n.nextSibling)if("JSXIdentifier"==n.name||"JSXBuiltin"==n.name||"JSXNamespacedName"==n.name||"JSXMemberExpression"==n.name)return t.sliceString(n.from,Math.min(n.to,i));return""}const up="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),fp=qr.inputHandler.of(((t,e,i,n,s)=>{if((up?t.composing:t.compositionStarted)||t.state.readOnly||e!=i||">"!=n&&"/"!=n||!ip.isActiveAt(t.state,e,-1))return!1;let r=s(),{state:o}=r,a=o.changeByRange((t=>{var e;let i,{head:s}=t,r=Ea(o).resolveInner(s-1,-1);if("JSXStartTag"==r.name&&(r=r.parent),o.doc.sliceString(s-1,s)!=n||"JSXAttributeValue"==r.name&&r.to>s);else{if(">"==n&&"JSXFragmentTag"==r.name)return{range:t,changes:{from:s,insert:""}};if("/"==n&&"JSXStartCloseTag"==r.name){let t=r.parent,n=t.parent;if(n&&t.from==s-2&&((i=Op(o.doc,n.firstChild,s))||"JSXFragmentTag"==(null===(e=n.firstChild)||void 0===e?void 0:e.name))){let t=`${i}>`;return{range:$t.cursor(s+t.length,-1),changes:{from:s,insert:t}}}}else if(">"==n){let e=function(t){for(;;){if("JSXOpenTag"==t.name||"JSXSelfClosingTag"==t.name||"JSXFragmentTag"==t.name)return t;if("JSXEscape"==t.name||!t.parent)return null;t=t.parent}}(r);if(e&&!/^\/?>|^<\//.test(o.doc.sliceString(s,s+2))&&(i=Op(o.doc,e,s)))return{range:t,changes:{from:s,insert:``}}}}return{range:t}}));return!a.changes.empty&&(t.dispatch([r,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}));function dp(t,e,i,n){return i.line(t+n.line).from+e+(1==t?n.col-1:-1)}function pp(t,e,i){let n=dp(t.line,t.column,e,i),s={from:n,to:null!=t.endLine&&1!=t.endColumn?dp(t.endLine,t.endColumn,e,i):n,message:t.message,source:t.ruleId?"eslint:"+t.ruleId:"eslint",severity:1==t.severity?"warning":"error"};if(t.fix){let{range:e,text:r}=t.fix,o=e[0]+i.pos-n,a=e[1]+i.pos-n;s.actions=[{name:"fix",apply(t,e){t.dispatch({changes:{from:e+o,to:e+a,insert:r},scrollIntoView:!0})}}]}return s}var gp=Object.freeze({__proto__:null,autoCloseTags:fp,completionPath:ep,esLint:function(t,e){return e||(e={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},t.getRules().forEach(((t,i)=>{t.meta.docs.recommended&&(e.rules[i]=2)}))),i=>{let{state:n}=i,s=[];for(let{from:i,to:r}of ip.findRegions(n)){let o=n.doc.lineAt(i),a={line:o.number-1,col:i-o.from,pos:i};for(let o of t.verify(n.sliceDoc(i,r),e))s.push(pp(o,n.doc,a))}return s}},javascript:cp,javascriptLanguage:ip,jsxLanguage:rp,localCompletionSource:Kd,scopeCompletionSource:function(t){let e=new Map;return i=>{let n=ep(i);if(!n)return null;let s=t;for(let t of n.path)if(s=s[t],!s)return null;let r=e.get(s);return r||e.set(s,r=function(t,e){let i=[],n=new Set;for(let s=0;;s++){for(let r of(Object.getOwnPropertyNames||Object.keys)(t)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(r)||n.has(r))continue;let o;n.add(r);try{o=t[r]}catch(t){continue}i.push({label:r,type:"function"==typeof o?/^[A-Z]/.test(r)?"class":e?"function":"method":e?"variable":"property",boost:-s})}let r=Object.getPrototypeOf(t);if(!r)return i;t=r}}(s,!n.path.length)),{from:i.pos-n.name.length,options:r,validFor:Hd}}},snippets:zd,tsxLanguage:op,typescriptLanguage:sp,typescriptSnippets:Gd});const mp=["_blank","_self","_top","_parent"],bp=["ascii","utf-8","utf-16","latin1","latin1"],wp=["get","post","put","delete"],yp=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Sp=["true","false"],Qp={},vp={a:{attrs:{href:null,ping:null,type:null,media:null,target:mp,hreflang:null}},abbr:Qp,address:Qp,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Qp,aside:Qp,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Qp,base:{attrs:{href:null,target:mp}},bdi:Qp,bdo:Qp,blockquote:{attrs:{cite:null}},body:Qp,br:Qp,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:yp,formmethod:wp,formnovalidate:["novalidate"],formtarget:mp,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Qp,center:Qp,cite:Qp,code:Qp,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Qp,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Qp,div:Qp,dl:Qp,dt:Qp,em:Qp,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Qp,figure:Qp,footer:Qp,form:{attrs:{action:null,name:null,"accept-charset":bp,autocomplete:["on","off"],enctype:yp,method:wp,novalidate:["novalidate"],target:mp}},h1:Qp,h2:Qp,h3:Qp,h4:Qp,h5:Qp,h6:Qp,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Qp,hgroup:Qp,hr:Qp,html:{attrs:{manifest:null}},i:Qp,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:yp,formmethod:wp,formnovalidate:["novalidate"],formtarget:mp,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Qp,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Qp,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Qp,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:bp,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Qp,noscript:Qp,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Qp,param:{attrs:{name:null,value:null}},pre:Qp,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Qp,rt:Qp,ruby:Qp,samp:Qp,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:bp}},section:Qp,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Qp,source:{attrs:{src:null,type:null,media:null}},span:Qp,strong:Qp,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Qp,summary:Qp,sup:Qp,table:Qp,tbody:Qp,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Qp,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Qp,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Qp,time:{attrs:{datetime:null}},title:Qp,tr:Qp,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Qp,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Qp},xp={accesskey:null,class:null,contenteditable:Sp,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Sp,autocorrect:Sp,autocapitalize:Sp,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Sp,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Sp,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Sp,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Sp,"aria-hidden":Sp,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Sp,"aria-multiselectable":Sp,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Sp,"aria-relevant":null,"aria-required":Sp,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},kp="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map((t=>"on"+t));for(let t of kp)xp[t]=null;class $p{constructor(t,e){this.tags=Object.assign(Object.assign({},vp),t),this.globalAttrs=Object.assign(Object.assign({},xp),e),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}function Pp(t,e,i=t.length){if(!e)return"";let n=e.firstChild,s=n&&n.getChild("TagName");return s?t.sliceString(s.from,Math.min(s.to,i)):""}function Zp(t,e=!1){for(;t;t=t.parent)if("Element"==t.name){if(!e)return t;e=!1}return null}function Tp(t,e,i){let n=i.tags[Pp(t,Zp(e))];return(null==n?void 0:n.children)||i.allTags}function Xp(t,e){let i=[];for(let n=Zp(e);n&&!n.type.isTop;n=Zp(n.parent)){let s=Pp(t,n);if(s&&"CloseTag"==n.lastChild.name)break;s&&i.indexOf(s)<0&&("EndTag"==e.name||e.from>=n.firstChild.to)&&i.push(s)}return i}$p.default=new $p;const Cp=/^[:\-\.\w\u00b7-\uffff]*$/;function Ap(t,e,i,n,s){let r=/\s*>/.test(t.sliceDoc(s,s+5))?"":">",o=Zp(i,!0);return{from:n,to:s,options:Tp(t.doc,o,e).map((t=>({label:t,type:"type"}))).concat(Xp(t.doc,i).map(((t,e)=>({label:"/"+t,apply:"/"+t+r,type:"type",boost:99-e})))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Rp(t,e,i,n){let s=/\s*>/.test(t.sliceDoc(n,n+5))?"":">";return{from:i,to:n,options:Xp(t.doc,e).map(((t,e)=>({label:t,apply:t+s,type:"type",boost:99-e}))),validFor:Cp}}function Wp(t,e){let{state:i,pos:n}=e,s=Ea(i).resolveInner(n,-1),r=s.resolve(n);for(let t,e=n;r==s&&(t=s.childBefore(e));){let i=t.lastChild;if(!i||!i.type.isError||i.from({label:t,type:"property"}))),validFor:Cp}}(i,t,s,"AttributeName"==s.name?s.from:n,n):"Is"==s.name||"AttributeValue"==s.name||"UnquotedAttributeValue"==s.name?function(t,e,i,n,s){var r;let o,a=null===(r=i.parent)||void 0===r?void 0:r.getChild("AttributeName"),l=[];if(a){let r=t.sliceDoc(a.from,a.to),h=e.globalAttrs[r];if(!h){let n=Zp(i),s=n?e.tags[Pp(t.doc,n)]:null;h=(null==s?void 0:s.attrs)&&s.attrs[r]}if(h){let e=t.sliceDoc(n,s).toLowerCase(),i='"',r='"';/^['"]/.test(e)?(o='"'==e[0]?/^[^"]*$/:/^[^']*$/,i="",r=t.sliceDoc(s,s+1)==e[0]?"":e[0],e=e.slice(1),n++):o=/^[^\s<>='"]*$/;for(let t of h)l.push({label:t,apply:i+t+r,type:"constant"})}}return{from:n,to:s,options:l,validFor:o}}(i,t,s,"Is"==s.name?n:s.from,n):!e.explicit||"Element"!=r.name&&"Text"!=r.name&&"Document"!=r.name?null:function(t,e,i,n){let s=[],r=0;for(let n of Tp(t.doc,i,e))s.push({label:"<"+n,type:"type"});for(let e of Xp(t.doc,i))s.push({label:"",type:"type",boost:99-r++});return{from:n,to:n,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}(i,t,s,n)}function qp(t){return Wp($p.default,t)}function Yp(t){let{extraTags:e,extraGlobalAttributes:i}=t,n=i||e?new $p(e,i):$p.default;return t=>Wp(n,t)}const _p=ip.parser.configure({top:"SingleExpression"}),Vp=[{tag:"script",attrs:t=>"text/typescript"==t.type||"ts"==t.lang,parser:sp.parser},{tag:"script",attrs:t=>"text/babel"==t.type||"text/jsx"==t.type,parser:rp.parser},{tag:"script",attrs:t=>"text/typescript-jsx"==t.type,parser:op.parser},{tag:"script",attrs:t=>/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type),parser:_p},{tag:"script",attrs:t=>!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type),parser:ip.parser},{tag:"style",attrs:t=>(!t.lang||"css"==t.lang)&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type)),parser:Ac.parser}],Mp=[{name:"style",parser:Ac.parser.configure({top:"Styles"})}].concat(kp.map((t=>({name:t,parser:ip.parser})))),Ep=Ma.define({name:"html",parser:$d.configure({props:[rl.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag":t=>t.column(t.node.from)+t.unit,Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].lengtht.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"\x3c!--",close:"--\x3e"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),jp=Ep.configure({wrap:Xd(Vp,Mp)});function Dp(t={}){let e,i="";!1===t.matchClosingTags&&(i="noMatch"),!0===t.selfClosingTags&&(i=(i?i+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(e=Xd((t.nestedLanguages||[]).concat(Vp),(t.nestedAttributes||[]).concat(Mp)));let n=e?Ep.configure({wrap:e,dialect:i}):i?jp.configure({dialect:i}):jp;return new Ha(n,[jp.data.of({autocomplete:Yp(t)}),!1!==t.autoCloseTags?Gp:[],cp().support,Rc().support])}const zp=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),Gp=qr.inputHandler.of(((t,e,i,n,s)=>{if(t.composing||t.state.readOnly||e!=i||">"!=n&&"/"!=n||!jp.isActiveAt(t.state,e,-1))return!1;let r=s(),{state:o}=r,a=o.changeByRange((t=>{var e,i,s;let r,a=o.doc.sliceString(t.from-1,t.to)==n,{head:l}=t,h=Ea(o).resolveInner(l-1,-1);if("TagName"!=h.name&&"StartTag"!=h.name||(h=h.parent),a&&">"==n&&"OpenTag"==h.name){if("CloseTag"!=(null===(i=null===(e=h.parent)||void 0===e?void 0:e.lastChild)||void 0===i?void 0:i.name)&&(r=Pp(o.doc,h.parent,l))&&!zp.has(r)){return{range:t,changes:{from:l,to:l+(">"===o.doc.sliceString(l,l+1)?1:0),insert:``}}}}else if(a&&"/"==n&&"IncompleteCloseTag"==h.name){let t=h.parent;if(h.from==l-2&&"CloseTag"!=(null===(s=t.lastChild)||void 0===s?void 0:s.name)&&(r=Pp(o.doc,t,l))&&!zp.has(r)){let t=l+(">"===o.doc.sliceString(l,l+1)?1:0),e=`${r}>`;return{range:$t.cursor(l+e.length,-1),changes:{from:l,to:t,insert:e}}}}return{range:t}}));return!a.changes.empty&&(t.dispatch([r,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}));var Ip=Object.freeze({__proto__:null,autoCloseTags:Gp,html:Dp,htmlCompletionSource:qp,htmlCompletionSourceWith:Yp,htmlLanguage:jp,htmlPlain:Ep});const Bp="function"==typeof String.prototype.normalize?t=>t.normalize("NFKD"):t=>t;class Np{constructor(t,e,i=0,n=t.length,s,r){this.test=r,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,n),this.bufferStart=i,this.normalize=s?t=>s(Bp(t)):Bp,this.query=this.normalize(e)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ut(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let e=ft(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=dt(t);let n=this.normalize(e);for(let t=0,s=i;;t++){let r=n.charCodeAt(t),o=this.match(r,s);if(t==n.length-1){if(o)return this.value=o,this;break}s==i&&tthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let e=this.matchPos<=this.to&&this.re.exec(this.curLine);if(e){let i=this.curLineStart+e.index,n=i+e[0].length;if(this.matchPos=tg(this.text,n+(i==n?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,n,e)))return this.value={from:i,to:n,match:e},this;t=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length=i||n.to<=e){let n=new Jp(e,t.sliceString(e,i));return Hp.set(t,n),n}if(n.from==e&&n.to==i)return n;let{text:s,from:r}=n;return r>e&&(s=t.sliceString(e,r)+s,r=e),n.to=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,e=this.re.exec(this.flat.text);if(e&&!e[0]&&e.index==t&&(this.re.lastIndex=t+1,e=this.re.exec(this.flat.text)),e){let t=this.flat.from+e.index,i=t+e[0].length;if((this.flat.to>=this.to||e.index+e[0].length<=this.flat.text.length-10)&&(!this.test||this.test(t,i,e)))return this.value={from:t,to:i,match:e},this.matchPos=tg(this.text,i+(t==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Jp.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function tg(t,e){if(e>=t.length)return e;let i,n=t.lineAt(e);for(;e=56320&&i<57344;)e++;return e}"undefined"!=typeof Symbol&&(Fp.prototype[Symbol.iterator]=Kp.prototype[Symbol.iterator]=function(){return this});const eg={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},ig=Tt.define({combine:t=>be(t,eg,{highlightWordAroundCursor:(t,e)=>t||e,minSelectionLength:Math.min,maxMatches:Math.min})});function ng(t){let e=[lg,ag];return t&&e.push(ig.of(t)),e}const sg=Ui.mark({class:"cm-selectionMatch"}),rg=Ui.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function og(t,e,i,n){return!(0!=i&&t(e.sliceDoc(i-1,i))==fe.Word||n!=e.doc.length&&t(e.sliceDoc(n,n+1))==fe.Word)}const ag=Vn.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(ig),{state:i}=t,n=i.selection;if(n.ranges.length>1)return Ui.none;let s,r=n.main,o=null;if(r.empty){if(!e.highlightWordAroundCursor)return Ui.none;let t=i.wordAt(r.head);if(!t)return Ui.none;o=i.charCategorizer(r.head),s=i.sliceDoc(t.from,t.to)}else{let t=r.to-r.from;if(t200)return Ui.none;if(e.wholeWords){if(s=i.sliceDoc(r.from,r.to),o=i.charCategorizer(r.head),!og(o,i,r.from,r.to)||!function(t,e,i,n){return t(e.sliceDoc(i,i+1))==fe.Word&&t(e.sliceDoc(n-1,n))==fe.Word}(o,i,r.from,r.to))return Ui.none}else if(s=i.sliceDoc(r.from,r.to).trim(),!s)return Ui.none}let a=[];for(let n of t.visibleRanges){let t=new Np(i.doc,s,n.from,n.to);for(;!t.next().done;){let{from:n,to:s}=t.value;if((!o||og(o,i,n,s))&&(r.empty&&n<=r.from&&s>=r.to?a.push(rg.range(n,s)):(n>=r.to||s<=r.from)&&a.push(sg.range(n,s)),a.length>e.maxMatches))return Ui.none}}return Ui.set(a)}},{decorations:t=>t.decorations}),lg=qr.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}});const hg=({state:t,dispatch:e})=>{let{ranges:i}=t.selection;if(i.some((t=>t.from===t.to)))return(({state:t,dispatch:e})=>{let{selection:i}=t,n=$t.create(i.ranges.map((e=>t.wordAt(e.head)||$t.cursor(e.head))),i.mainIndex);return!n.eq(i)&&(e(t.update({selection:n})),!0)})({state:t,dispatch:e});let n=t.sliceDoc(i[0].from,i[0].to);if(t.selection.ranges.some((e=>t.sliceDoc(e.from,e.to)!=n)))return!1;let s=function(t,e){let{main:i,ranges:n}=t.selection,s=t.wordAt(i.head),r=s&&s.from==i.from&&s.to==i.to;for(let i=!1,s=new Np(t.doc,e,n[n.length-1].to);;){if(s.next(),!s.done){if(i&&n.some((t=>t.from==s.value.from)))continue;if(r){let e=t.wordAt(s.value.from);if(!e||e.from!=s.value.from||e.to!=s.value.to)continue}return s.value}if(i)return null;s=new Np(t.doc,e,0,Math.max(0,n[n.length-1].from-1)),i=!0}}(t,n);return!!s&&(e(t.update({selection:t.selection.addRange($t.range(s.from,s.to),!1),effects:qr.scrollIntoView(s.to)})),!0)};function cg(t){const e=t.selection.main.head;return t.doc.lineAt(e)}function Og(t,e){let i=0;t:for(let n=0;nbe(t,{highlightActiveBlock:!0,hideFirstIndent:!1,markerType:"fullScope",thickness:1})});class fg{constructor(t,e,i,n){this.lines=t,this.state=e,this.map=new Map,this.unitWidth=i,this.markerType=n;for(const t of this.lines)this.add(t);this.state.facet(ug).highlightActiveBlock&&this.findAndSetActiveLines()}has(t){return this.map.has("number"==typeof t?t:t.number)}get(t){const e=this.map.get("number"==typeof t?t:t.number);if(!e)throw new Error("Line not found in indentation map");return e}set(t,e,i){const n=!t.text.trim().length,s={line:t,col:e,level:i,empty:n};return this.map.set(s.line.number,s),s}add(t){if(this.has(t))return this.get(t);if(!t.length||!t.text.trim().length){if(1===t.number)return this.set(t,0,0);if(t.number===this.state.doc.lines){const e=this.closestNonEmpty(t,-1);return this.set(t,0,e.level)}const e=this.closestNonEmpty(t,-1),i=this.closestNonEmpty(t,1);return e.level>=i.level&&"codeOnly"!==this.markerType?this.set(t,0,e.level):e.empty&&0===e.level&&0!==i.level?this.set(t,0,0):i.level>e.level?this.set(t,0,e.level+1):this.set(t,0,i.level)}const e=Og(t.text,this.state.tabSize),i=Math.floor(e/this.unitWidth);return this.set(t,e,i)}closestNonEmpty(t,e){let i=t.number+e;for(;-1===e?i>=1:i<=this.state.doc.lines;){if(this.has(i)){const t=this.get(i);if(!t.empty)return t}const t=this.state.doc.line(i);if(t.text.trim().length){const e=Og(t.text,this.state.tabSize),i=Math.floor(e/this.unitWidth);return this.set(t,e,i)}i+=e}const n=this.state.doc.line(-1===e?1:this.state.doc.lines);return this.set(n,0,0)}findAndSetActiveLines(){const t=cg(this.state);if(!this.has(t))return;let e,i,n=this.get(t);if(this.has(n.line.number+1)){const t=this.get(n.line.number+1);t.level>n.level&&(n=t)}if(this.has(n.line.number-1)){const t=this.get(n.line.number-1);t.level>n.level&&(n=t)}if(0!==n.level){for(n.active=n.level,e=n.line.number;e>1;e--){if(!this.has(e-1))continue;const t=this.get(e-1);if(t.level0&&a.push(pg("--indent-marker-bg-color",n,e,o,t)),a.push(pg("--indent-marker-active-bg-color",n,e,r-1,1)),r!==s&&a.push(pg("--indent-marker-bg-color",n,e,r,s-r))}else a.push(pg("--indent-marker-bg-color",n,e,o,s-o));return a.join(",")}class mg{constructor(t){this.view=t,this.unitWidth=el(t.state),this.currentLineNumber=cg(t.state).number,this.generate(t.state)}update(t){const e=el(t.state),i=e!==this.unitWidth;i&&(this.unitWidth=e);const n=cg(t.state).number,s=n!==this.currentLineNumber;this.currentLineNumber=n;const r=t.state.facet(ug).highlightActiveBlock&&s;(t.docChanged||t.viewportChanged||i||r)&&this.generate(t.state)}generate(t){const e=new xe,i=function(t,e=t.state){const i=new Set;for(const{from:n,to:s}of t.visibleRanges){let t=n;for(;t<=s;){const n=e.doc.lineAt(t);i.has(n)||i.add(n),t=n.to+1}}return i}(this.view,t),{hideFirstIndent:n,markerType:s,thickness:r}=t.facet(ug),o=new fg(i,t,this.unitWidth,s);for(const t of i){const i=o.get(t.number);if(!(null==i?void 0:i.level))continue;const s=gg(i,this.unitWidth,n,r);e.add(t.from,t.from,Ui.line({class:"cm-indent-markers",attributes:{style:`--indent-markers: ${s}`}}))}this.decorations=e.finish()}}function bg(t={}){return[ug.of(t),dg(t.colors),Vn.fromClass(mg,{decorations:t=>t.decorations})]}function wg(){return import("./angular.js")}async function yg(){return fh.define((await import("./legacy.js").then((function(t){return t.c}))).clojure)}async function Sg(){return fh.define((await import("./legacy.js").then((function(t){return t.a}))).coffeeScript)}function Qg(){return import("./cpp.js")}const vg=Ma.define({name:Ac.name,parser:Ac.parser,languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:""}}),xg={cssCompletionSource:Cc,cssLanguage:vg,css:()=>new Ha(vg,vg.data.of({autocomplete:Cc}))};async function kg(){return fh.define((await import("./legacy.js").then((function(t){return t.b}))).dart)}async function $g(){return fh.define((await import("./legacy.js").then((function(t){return t.d}))).gss)}async function Pg(){return fh.define((await import("./legacy.js").then((function(t){return t.g}))).go)}function Zg(){return import("./java.js")}async function Tg(){return fh.define((await import("./legacy.js").then((function(t){return t.b}))).kotlin)}function Xg(){return import("./less.js")}function Cg(){return import("./markdown.js")}function Ag(){return import("./php.js")}function Rg(){return import("./python.js")}function Wg(){return import("./sass.js")}async function qg(){return fh.define((await import("./legacy.js").then((function(t){return t.b}))).scala)}async function Yg(){return fh.define((await import("./legacy.js").then((function(t){return t.s}))).shell)}async function _g(){return import("./svelte.js")}async function Vg(){return(await import("./legacy.js").then((function(t){return t.d}))).css}function Mg(){return import("./vue.js")}function Eg(){return import("./wast.js")}function jg(){return import("./xml.js")}export{Sg as $,gl as A,tl as B,Wc as C,Ja as D,Ih as E,Ga as F,Wa as G,sc as H,_c as I,Yc as J,c as K,Ma as L,T as M,o as N,qO as O,C as P,sp as Q,Ac as R,cp as S,la as T,Rc as U,qr as V,Dd as W,Gh as X,sh as Y,wg as Z,yg as _,Ha as a,ch as a$,Qg as a0,xg as a1,kg as a2,$g as a3,Pg as a4,Zg as a5,Tg as a6,Xg as a7,Cg as a8,Ag as a9,$u as aA,zu as aB,Nf as aC,Bf as aD,zf as aE,Tu as aF,Cu as aG,gf as aH,Qf as aI,vf as aJ,xf as aK,kf as aL,Uf as aM,du as aN,Zu as aO,Xu as aP,Ip as aQ,gp as aR,nh as aS,Rl as aT,Ch as aU,ja as aV,Ml as aW,Xl as aX,jl as aY,pl as aZ,fh as a_,Rg as aa,Wg as ab,qg as ac,Yg as ad,_g as ae,Vg as af,Mg as ag,Eg as ah,jg as ai,dO as aj,ou as ak,BO as al,JO as am,gO as an,jO as ao,hu as ap,Ou as aq,fO as ar,uu as as,fu as at,pO as au,pf as av,Ku as aw,tf as ax,sf as ay,rf as az,rc as b,Il as b0,ng as b1,hg as b2,ie as b3,ne as b4,mt as b5,bt as b6,Gt as b7,Tt as b8,et as b9,Hn as bA,Bi as bB,x as bC,pa as bD,Me as bE,bg as bF,gt as ba,ye as bb,ve as bc,xe as bd,kt as be,re as bf,se as bg,Yt as bh,N as bi,oe as bj,Ui as bk,eo as bl,Io as bm,jo as bn,No as bo,go as bp,ta as bq,ra as br,ho as bs,vo as bt,qo as bu,So as bv,Eo as bw,Ro as bx,$o as by,Vn as bz,dl as c,Ol as d,ml as e,fl as f,bl as g,Dp as h,rl as i,ip as j,Xc as k,n as l,a as m,O as n,_a as o,R as p,Ea as q,$t as r,Oa as s,Aa as t,qe as u,Dt as v,zr as w,qp as x,me as y,qa as z}; //# sourceMappingURL=codemirror.js.map diff --git a/public/third_party/codemirror.next/chunk/codemirror.js.map b/public/third_party/codemirror.next/chunk/codemirror.js.map index c81f47e28..bafcd61c5 100644 --- a/public/third_party/codemirror.next/chunk/codemirror.js.map +++ b/public/third_party/codemirror.next/chunk/codemirror.js.map @@ -1 +1 @@ -{"version":3,"file":"codemirror.js","sources":["../node_modules/@lezer/common/dist/index.js","../node_modules/@codemirror/state/dist/index.js","../node_modules/style-mod/src/style-mod.js","../node_modules/@codemirror/view/node_modules/w3c-keyname/index.js","../node_modules/@codemirror/view/dist/index.js","../node_modules/@lezer/highlight/dist/index.js","../node_modules/@codemirror/language/dist/index.js","../node_modules/@lezer/lr/dist/index.js","../node_modules/@lezer/css/dist/index.js","../node_modules/@codemirror/lang-css/dist/index.js","../node_modules/@codemirror/autocomplete/dist/index.js","../node_modules/@codemirror/commands/dist/index.js","../node_modules/@lezer/html/dist/index.js","../node_modules/@lezer/javascript/dist/index.js","../node_modules/@codemirror/lang-javascript/dist/index.js","../node_modules/@codemirror/lang-html/dist/index.js","../node_modules/@codemirror/search/dist/index.js","../node_modules/@replit/codemirror-indentation-markers/dist/index.js","../bundle.js"],"sourcesContent":["/**\nThe default maximum length of a `TreeBuffer` node.\n*/\nconst DefaultBufferLength = 1024;\nlet nextPropID = 0;\nclass Range {\n constructor(from, to) {\n this.from = from;\n this.to = to;\n }\n}\n/**\nEach [node type](#common.NodeType) or [individual tree](#common.Tree)\ncan have metadata associated with it in props. Instances of this\nclass represent prop names.\n*/\nclass NodeProp {\n /**\n Create a new node prop type.\n */\n constructor(config = {}) {\n this.id = nextPropID++;\n this.perNode = !!config.perNode;\n this.deserialize = config.deserialize || (() => {\n throw new Error(\"This node type doesn't define a deserialize function\");\n });\n }\n /**\n This is meant to be used with\n [`NodeSet.extend`](#common.NodeSet.extend) or\n [`LRParser.configure`](#lr.ParserConfig.props) to compute\n prop values for each node type in the set. Takes a [match\n object](#common.NodeType^match) or function that returns undefined\n if the node type doesn't get this prop, and the prop's value if\n it does.\n */\n add(match) {\n if (this.perNode)\n throw new RangeError(\"Can't add per-node props to node types\");\n if (typeof match != \"function\")\n match = NodeType.match(match);\n return (type) => {\n let result = match(type);\n return result === undefined ? null : [this, result];\n };\n }\n}\n/**\nProp that is used to describe matching delimiters. For opening\ndelimiters, this holds an array of node names (written as a\nspace-separated string when declaring this prop in a grammar)\nfor the node types of closing delimiters that match it.\n*/\nNodeProp.closedBy = new NodeProp({ deserialize: str => str.split(\" \") });\n/**\nThe inverse of [`closedBy`](#common.NodeProp^closedBy). This is\nattached to closing delimiters, holding an array of node names\nof types of matching opening delimiters.\n*/\nNodeProp.openedBy = new NodeProp({ deserialize: str => str.split(\" \") });\n/**\nUsed to assign node types to groups (for example, all node\ntypes that represent an expression could be tagged with an\n`\"Expression\"` group).\n*/\nNodeProp.group = new NodeProp({ deserialize: str => str.split(\" \") });\n/**\nAttached to nodes to indicate these should be\n[displayed](https://codemirror.net/docs/ref/#language.syntaxTree)\nin a bidirectional text isolate, so that direction-neutral\ncharacters on their sides don't incorrectly get associated with\nsurrounding text. You'll generally want to set this for nodes\nthat contain arbitrary text, like strings and comments, and for\nnodes that appear _inside_ arbitrary text, like HTML tags. When\nnot given a value, in a grammar declaration, defaults to\n`\"auto\"`.\n*/\nNodeProp.isolate = new NodeProp({ deserialize: value => {\n if (value && value != \"rtl\" && value != \"ltr\" && value != \"auto\")\n throw new RangeError(\"Invalid value for isolate: \" + value);\n return value || \"auto\";\n } });\n/**\nThe hash of the [context](#lr.ContextTracker.constructor)\nthat the node was parsed in, if any. Used to limit reuse of\ncontextual nodes.\n*/\nNodeProp.contextHash = new NodeProp({ perNode: true });\n/**\nThe distance beyond the end of the node that the tokenizer\nlooked ahead for any of the tokens inside the node. (The LR\nparser only stores this when it is larger than 25, for\nefficiency reasons.)\n*/\nNodeProp.lookAhead = new NodeProp({ perNode: true });\n/**\nThis per-node prop is used to replace a given node, or part of a\nnode, with another tree. This is useful to include trees from\ndifferent languages in mixed-language parsers.\n*/\nNodeProp.mounted = new NodeProp({ perNode: true });\n/**\nA mounted tree, which can be [stored](#common.NodeProp^mounted) on\na tree node to indicate that parts of its content are\nrepresented by another tree.\n*/\nclass MountedTree {\n constructor(\n /**\n The inner tree.\n */\n tree, \n /**\n If this is null, this tree replaces the entire node (it will\n be included in the regular iteration instead of its host\n node). If not, only the given ranges are considered to be\n covered by this tree. This is used for trees that are mixed in\n a way that isn't strictly hierarchical. Such mounted trees are\n only entered by [`resolveInner`](#common.Tree.resolveInner)\n and [`enter`](#common.SyntaxNode.enter).\n */\n overlay, \n /**\n The parser used to create this subtree.\n */\n parser) {\n this.tree = tree;\n this.overlay = overlay;\n this.parser = parser;\n }\n /**\n @internal\n */\n static get(tree) {\n return tree && tree.props && tree.props[NodeProp.mounted.id];\n }\n}\nconst noProps = Object.create(null);\n/**\nEach node in a syntax tree has a node type associated with it.\n*/\nclass NodeType {\n /**\n @internal\n */\n constructor(\n /**\n The name of the node type. Not necessarily unique, but if the\n grammar was written properly, different node types with the\n same name within a node set should play the same semantic\n role.\n */\n name, \n /**\n @internal\n */\n props, \n /**\n The id of this node in its set. Corresponds to the term ids\n used in the parser.\n */\n id, \n /**\n @internal\n */\n flags = 0) {\n this.name = name;\n this.props = props;\n this.id = id;\n this.flags = flags;\n }\n /**\n Define a node type.\n */\n static define(spec) {\n let props = spec.props && spec.props.length ? Object.create(null) : noProps;\n let flags = (spec.top ? 1 /* NodeFlag.Top */ : 0) | (spec.skipped ? 2 /* NodeFlag.Skipped */ : 0) |\n (spec.error ? 4 /* NodeFlag.Error */ : 0) | (spec.name == null ? 8 /* NodeFlag.Anonymous */ : 0);\n let type = new NodeType(spec.name || \"\", props, spec.id, flags);\n if (spec.props)\n for (let src of spec.props) {\n if (!Array.isArray(src))\n src = src(type);\n if (src) {\n if (src[0].perNode)\n throw new RangeError(\"Can't store a per-node prop on a node type\");\n props[src[0].id] = src[1];\n }\n }\n return type;\n }\n /**\n Retrieves a node prop for this type. Will return `undefined` if\n the prop isn't present on this node.\n */\n prop(prop) { return this.props[prop.id]; }\n /**\n True when this is the top node of a grammar.\n */\n get isTop() { return (this.flags & 1 /* NodeFlag.Top */) > 0; }\n /**\n True when this node is produced by a skip rule.\n */\n get isSkipped() { return (this.flags & 2 /* NodeFlag.Skipped */) > 0; }\n /**\n Indicates whether this is an error node.\n */\n get isError() { return (this.flags & 4 /* NodeFlag.Error */) > 0; }\n /**\n When true, this node type doesn't correspond to a user-declared\n named node, for example because it is used to cache repetition.\n */\n get isAnonymous() { return (this.flags & 8 /* NodeFlag.Anonymous */) > 0; }\n /**\n Returns true when this node's name or one of its\n [groups](#common.NodeProp^group) matches the given string.\n */\n is(name) {\n if (typeof name == 'string') {\n if (this.name == name)\n return true;\n let group = this.prop(NodeProp.group);\n return group ? group.indexOf(name) > -1 : false;\n }\n return this.id == name;\n }\n /**\n Create a function from node types to arbitrary values by\n specifying an object whose property names are node or\n [group](#common.NodeProp^group) names. Often useful with\n [`NodeProp.add`](#common.NodeProp.add). You can put multiple\n names, separated by spaces, in a single property name to map\n multiple node names to a single value.\n */\n static match(map) {\n let direct = Object.create(null);\n for (let prop in map)\n for (let name of prop.split(\" \"))\n direct[name] = map[prop];\n return (node) => {\n for (let groups = node.prop(NodeProp.group), i = -1; i < (groups ? groups.length : 0); i++) {\n let found = direct[i < 0 ? node.name : groups[i]];\n if (found)\n return found;\n }\n };\n }\n}\n/**\nAn empty dummy node type to use when no actual type is available.\n*/\nNodeType.none = new NodeType(\"\", Object.create(null), 0, 8 /* NodeFlag.Anonymous */);\n/**\nA node set holds a collection of node types. It is used to\ncompactly represent trees by storing their type ids, rather than a\nfull pointer to the type object, in a numeric array. Each parser\n[has](#lr.LRParser.nodeSet) a node set, and [tree\nbuffers](#common.TreeBuffer) can only store collections of nodes\nfrom the same set. A set can have a maximum of 2**16 (65536) node\ntypes in it, so that the ids fit into 16-bit typed array slots.\n*/\nclass NodeSet {\n /**\n Create a set with the given types. The `id` property of each\n type should correspond to its position within the array.\n */\n constructor(\n /**\n The node types in this set, by id.\n */\n types) {\n this.types = types;\n for (let i = 0; i < types.length; i++)\n if (types[i].id != i)\n throw new RangeError(\"Node type ids should correspond to array positions when creating a node set\");\n }\n /**\n Create a copy of this set with some node properties added. The\n arguments to this method can be created with\n [`NodeProp.add`](#common.NodeProp.add).\n */\n extend(...props) {\n let newTypes = [];\n for (let type of this.types) {\n let newProps = null;\n for (let source of props) {\n let add = source(type);\n if (add) {\n if (!newProps)\n newProps = Object.assign({}, type.props);\n newProps[add[0].id] = add[1];\n }\n }\n newTypes.push(newProps ? new NodeType(type.name, newProps, type.id, type.flags) : type);\n }\n return new NodeSet(newTypes);\n }\n}\nconst CachedNode = new WeakMap(), CachedInnerNode = new WeakMap();\n/**\nOptions that control iteration. Can be combined with the `|`\noperator to enable multiple ones.\n*/\nvar IterMode;\n(function (IterMode) {\n /**\n When enabled, iteration will only visit [`Tree`](#common.Tree)\n objects, not nodes packed into\n [`TreeBuffer`](#common.TreeBuffer)s.\n */\n IterMode[IterMode[\"ExcludeBuffers\"] = 1] = \"ExcludeBuffers\";\n /**\n Enable this to make iteration include anonymous nodes (such as\n the nodes that wrap repeated grammar constructs into a balanced\n tree).\n */\n IterMode[IterMode[\"IncludeAnonymous\"] = 2] = \"IncludeAnonymous\";\n /**\n By default, regular [mounted](#common.NodeProp^mounted) nodes\n replace their base node in iteration. Enable this to ignore them\n instead.\n */\n IterMode[IterMode[\"IgnoreMounts\"] = 4] = \"IgnoreMounts\";\n /**\n This option only applies in\n [`enter`](#common.SyntaxNode.enter)-style methods. It tells the\n library to not enter mounted overlays if one covers the given\n position.\n */\n IterMode[IterMode[\"IgnoreOverlays\"] = 8] = \"IgnoreOverlays\";\n})(IterMode || (IterMode = {}));\n/**\nA piece of syntax tree. There are two ways to approach these\ntrees: the way they are actually stored in memory, and the\nconvenient way.\n\nSyntax trees are stored as a tree of `Tree` and `TreeBuffer`\nobjects. By packing detail information into `TreeBuffer` leaf\nnodes, the representation is made a lot more memory-efficient.\n\nHowever, when you want to actually work with tree nodes, this\nrepresentation is very awkward, so most client code will want to\nuse the [`TreeCursor`](#common.TreeCursor) or\n[`SyntaxNode`](#common.SyntaxNode) interface instead, which provides\na view on some part of this data structure, and can be used to\nmove around to adjacent nodes.\n*/\nclass Tree {\n /**\n Construct a new tree. See also [`Tree.build`](#common.Tree^build).\n */\n constructor(\n /**\n The type of the top node.\n */\n type, \n /**\n This node's child nodes.\n */\n children, \n /**\n The positions (offsets relative to the start of this tree) of\n the children.\n */\n positions, \n /**\n The total length of this tree\n */\n length, \n /**\n Per-node [node props](#common.NodeProp) to associate with this node.\n */\n props) {\n this.type = type;\n this.children = children;\n this.positions = positions;\n this.length = length;\n /**\n @internal\n */\n this.props = null;\n if (props && props.length) {\n this.props = Object.create(null);\n for (let [prop, value] of props)\n this.props[typeof prop == \"number\" ? prop : prop.id] = value;\n }\n }\n /**\n @internal\n */\n toString() {\n let mounted = MountedTree.get(this);\n if (mounted && !mounted.overlay)\n return mounted.tree.toString();\n let children = \"\";\n for (let ch of this.children) {\n let str = ch.toString();\n if (str) {\n if (children)\n children += \",\";\n children += str;\n }\n }\n return !this.type.name ? children :\n (/\\W/.test(this.type.name) && !this.type.isError ? JSON.stringify(this.type.name) : this.type.name) +\n (children.length ? \"(\" + children + \")\" : \"\");\n }\n /**\n Get a [tree cursor](#common.TreeCursor) positioned at the top of\n the tree. Mode can be used to [control](#common.IterMode) which\n nodes the cursor visits.\n */\n cursor(mode = 0) {\n return new TreeCursor(this.topNode, mode);\n }\n /**\n Get a [tree cursor](#common.TreeCursor) pointing into this tree\n at the given position and side (see\n [`moveTo`](#common.TreeCursor.moveTo).\n */\n cursorAt(pos, side = 0, mode = 0) {\n let scope = CachedNode.get(this) || this.topNode;\n let cursor = new TreeCursor(scope);\n cursor.moveTo(pos, side);\n CachedNode.set(this, cursor._tree);\n return cursor;\n }\n /**\n Get a [syntax node](#common.SyntaxNode) object for the top of the\n tree.\n */\n get topNode() {\n return new TreeNode(this, 0, 0, null);\n }\n /**\n Get the [syntax node](#common.SyntaxNode) at the given position.\n If `side` is -1, this will move into nodes that end at the\n position. If 1, it'll move into nodes that start at the\n position. With 0, it'll only enter nodes that cover the position\n from both sides.\n \n Note that this will not enter\n [overlays](#common.MountedTree.overlay), and you often want\n [`resolveInner`](#common.Tree.resolveInner) instead.\n */\n resolve(pos, side = 0) {\n let node = resolveNode(CachedNode.get(this) || this.topNode, pos, side, false);\n CachedNode.set(this, node);\n return node;\n }\n /**\n Like [`resolve`](#common.Tree.resolve), but will enter\n [overlaid](#common.MountedTree.overlay) nodes, producing a syntax node\n pointing into the innermost overlaid tree at the given position\n (with parent links going through all parent structure, including\n the host trees).\n */\n resolveInner(pos, side = 0) {\n let node = resolveNode(CachedInnerNode.get(this) || this.topNode, pos, side, true);\n CachedInnerNode.set(this, node);\n return node;\n }\n /**\n In some situations, it can be useful to iterate through all\n nodes around a position, including those in overlays that don't\n directly cover the position. This method gives you an iterator\n that will produce all nodes, from small to big, around the given\n position.\n */\n resolveStack(pos, side = 0) {\n return stackIterator(this, pos, side);\n }\n /**\n Iterate over the tree and its children, calling `enter` for any\n node that touches the `from`/`to` region (if given) before\n running over such a node's children, and `leave` (if given) when\n leaving the node. When `enter` returns `false`, that node will\n not have its children iterated over (or `leave` called).\n */\n iterate(spec) {\n let { enter, leave, from = 0, to = this.length } = spec;\n let mode = spec.mode || 0, anon = (mode & IterMode.IncludeAnonymous) > 0;\n for (let c = this.cursor(mode | IterMode.IncludeAnonymous);;) {\n let entered = false;\n if (c.from <= to && c.to >= from && (!anon && c.type.isAnonymous || enter(c) !== false)) {\n if (c.firstChild())\n continue;\n entered = true;\n }\n for (;;) {\n if (entered && leave && (anon || !c.type.isAnonymous))\n leave(c);\n if (c.nextSibling())\n break;\n if (!c.parent())\n return;\n entered = true;\n }\n }\n }\n /**\n Get the value of the given [node prop](#common.NodeProp) for this\n node. Works with both per-node and per-type props.\n */\n prop(prop) {\n return !prop.perNode ? this.type.prop(prop) : this.props ? this.props[prop.id] : undefined;\n }\n /**\n Returns the node's [per-node props](#common.NodeProp.perNode) in a\n format that can be passed to the [`Tree`](#common.Tree)\n constructor.\n */\n get propValues() {\n let result = [];\n if (this.props)\n for (let id in this.props)\n result.push([+id, this.props[id]]);\n return result;\n }\n /**\n Balance the direct children of this tree, producing a copy of\n which may have children grouped into subtrees with type\n [`NodeType.none`](#common.NodeType^none).\n */\n balance(config = {}) {\n return this.children.length <= 8 /* Balance.BranchFactor */ ? this :\n balanceRange(NodeType.none, this.children, this.positions, 0, this.children.length, 0, this.length, (children, positions, length) => new Tree(this.type, children, positions, length, this.propValues), config.makeTree || ((children, positions, length) => new Tree(NodeType.none, children, positions, length)));\n }\n /**\n Build a tree from a postfix-ordered buffer of node information,\n or a cursor over such a buffer.\n */\n static build(data) { return buildTree(data); }\n}\n/**\nThe empty tree\n*/\nTree.empty = new Tree(NodeType.none, [], [], 0);\nclass FlatBufferCursor {\n constructor(buffer, index) {\n this.buffer = buffer;\n this.index = index;\n }\n get id() { return this.buffer[this.index - 4]; }\n get start() { return this.buffer[this.index - 3]; }\n get end() { return this.buffer[this.index - 2]; }\n get size() { return this.buffer[this.index - 1]; }\n get pos() { return this.index; }\n next() { this.index -= 4; }\n fork() { return new FlatBufferCursor(this.buffer, this.index); }\n}\n/**\nTree buffers contain (type, start, end, endIndex) quads for each\nnode. In such a buffer, nodes are stored in prefix order (parents\nbefore children, with the endIndex of the parent indicating which\nchildren belong to it).\n*/\nclass TreeBuffer {\n /**\n Create a tree buffer.\n */\n constructor(\n /**\n The buffer's content.\n */\n buffer, \n /**\n The total length of the group of nodes in the buffer.\n */\n length, \n /**\n The node set used in this buffer.\n */\n set) {\n this.buffer = buffer;\n this.length = length;\n this.set = set;\n }\n /**\n @internal\n */\n get type() { return NodeType.none; }\n /**\n @internal\n */\n toString() {\n let result = [];\n for (let index = 0; index < this.buffer.length;) {\n result.push(this.childString(index));\n index = this.buffer[index + 3];\n }\n return result.join(\",\");\n }\n /**\n @internal\n */\n childString(index) {\n let id = this.buffer[index], endIndex = this.buffer[index + 3];\n let type = this.set.types[id], result = type.name;\n if (/\\W/.test(result) && !type.isError)\n result = JSON.stringify(result);\n index += 4;\n if (endIndex == index)\n return result;\n let children = [];\n while (index < endIndex) {\n children.push(this.childString(index));\n index = this.buffer[index + 3];\n }\n return result + \"(\" + children.join(\",\") + \")\";\n }\n /**\n @internal\n */\n findChild(startIndex, endIndex, dir, pos, side) {\n let { buffer } = this, pick = -1;\n for (let i = startIndex; i != endIndex; i = buffer[i + 3]) {\n if (checkSide(side, pos, buffer[i + 1], buffer[i + 2])) {\n pick = i;\n if (dir > 0)\n break;\n }\n }\n return pick;\n }\n /**\n @internal\n */\n slice(startI, endI, from) {\n let b = this.buffer;\n let copy = new Uint16Array(endI - startI), len = 0;\n for (let i = startI, j = 0; i < endI;) {\n copy[j++] = b[i++];\n copy[j++] = b[i++] - from;\n let to = copy[j++] = b[i++] - from;\n copy[j++] = b[i++] - startI;\n len = Math.max(len, to);\n }\n return new TreeBuffer(copy, len, this.set);\n }\n}\nfunction checkSide(side, pos, from, to) {\n switch (side) {\n case -2 /* Side.Before */: return from < pos;\n case -1 /* Side.AtOrBefore */: return to >= pos && from < pos;\n case 0 /* Side.Around */: return from < pos && to > pos;\n case 1 /* Side.AtOrAfter */: return from <= pos && to > pos;\n case 2 /* Side.After */: return to > pos;\n case 4 /* Side.DontCare */: return true;\n }\n}\nfunction resolveNode(node, pos, side, overlays) {\n var _a;\n // Move up to a node that actually holds the position, if possible\n while (node.from == node.to ||\n (side < 1 ? node.from >= pos : node.from > pos) ||\n (side > -1 ? node.to <= pos : node.to < pos)) {\n let parent = !overlays && node instanceof TreeNode && node.index < 0 ? null : node.parent;\n if (!parent)\n return node;\n node = parent;\n }\n let mode = overlays ? 0 : IterMode.IgnoreOverlays;\n // Must go up out of overlays when those do not overlap with pos\n if (overlays)\n for (let scan = node, parent = scan.parent; parent; scan = parent, parent = scan.parent) {\n if (scan instanceof TreeNode && scan.index < 0 && ((_a = parent.enter(pos, side, mode)) === null || _a === void 0 ? void 0 : _a.from) != scan.from)\n node = parent;\n }\n for (;;) {\n let inner = node.enter(pos, side, mode);\n if (!inner)\n return node;\n node = inner;\n }\n}\nclass BaseNode {\n cursor(mode = 0) { return new TreeCursor(this, mode); }\n getChild(type, before = null, after = null) {\n let r = getChildren(this, type, before, after);\n return r.length ? r[0] : null;\n }\n getChildren(type, before = null, after = null) {\n return getChildren(this, type, before, after);\n }\n resolve(pos, side = 0) {\n return resolveNode(this, pos, side, false);\n }\n resolveInner(pos, side = 0) {\n return resolveNode(this, pos, side, true);\n }\n matchContext(context) {\n return matchNodeContext(this, context);\n }\n enterUnfinishedNodesBefore(pos) {\n let scan = this.childBefore(pos), node = this;\n while (scan) {\n let last = scan.lastChild;\n if (!last || last.to != scan.to)\n break;\n if (last.type.isError && last.from == last.to) {\n node = scan;\n scan = last.prevSibling;\n }\n else {\n scan = last;\n }\n }\n return node;\n }\n get node() { return this; }\n get next() { return this.parent; }\n}\nclass TreeNode extends BaseNode {\n constructor(_tree, from, \n // Index in parent node, set to -1 if the node is not a direct child of _parent.node (overlay)\n index, _parent) {\n super();\n this._tree = _tree;\n this.from = from;\n this.index = index;\n this._parent = _parent;\n }\n get type() { return this._tree.type; }\n get name() { return this._tree.type.name; }\n get to() { return this.from + this._tree.length; }\n nextChild(i, dir, pos, side, mode = 0) {\n for (let parent = this;;) {\n for (let { children, positions } = parent._tree, e = dir > 0 ? children.length : -1; i != e; i += dir) {\n let next = children[i], start = positions[i] + parent.from;\n if (!checkSide(side, pos, start, start + next.length))\n continue;\n if (next instanceof TreeBuffer) {\n if (mode & IterMode.ExcludeBuffers)\n continue;\n let index = next.findChild(0, next.buffer.length, dir, pos - start, side);\n if (index > -1)\n return new BufferNode(new BufferContext(parent, next, i, start), null, index);\n }\n else if ((mode & IterMode.IncludeAnonymous) || (!next.type.isAnonymous || hasChild(next))) {\n let mounted;\n if (!(mode & IterMode.IgnoreMounts) && (mounted = MountedTree.get(next)) && !mounted.overlay)\n return new TreeNode(mounted.tree, start, i, parent);\n let inner = new TreeNode(next, start, i, parent);\n return (mode & IterMode.IncludeAnonymous) || !inner.type.isAnonymous ? inner\n : inner.nextChild(dir < 0 ? next.children.length - 1 : 0, dir, pos, side);\n }\n }\n if ((mode & IterMode.IncludeAnonymous) || !parent.type.isAnonymous)\n return null;\n if (parent.index >= 0)\n i = parent.index + dir;\n else\n i = dir < 0 ? -1 : parent._parent._tree.children.length;\n parent = parent._parent;\n if (!parent)\n return null;\n }\n }\n get firstChild() { return this.nextChild(0, 1, 0, 4 /* Side.DontCare */); }\n get lastChild() { return this.nextChild(this._tree.children.length - 1, -1, 0, 4 /* Side.DontCare */); }\n childAfter(pos) { return this.nextChild(0, 1, pos, 2 /* Side.After */); }\n childBefore(pos) { return this.nextChild(this._tree.children.length - 1, -1, pos, -2 /* Side.Before */); }\n enter(pos, side, mode = 0) {\n let mounted;\n if (!(mode & IterMode.IgnoreOverlays) && (mounted = MountedTree.get(this._tree)) && mounted.overlay) {\n let rPos = pos - this.from;\n for (let { from, to } of mounted.overlay) {\n if ((side > 0 ? from <= rPos : from < rPos) &&\n (side < 0 ? to >= rPos : to > rPos))\n return new TreeNode(mounted.tree, mounted.overlay[0].from + this.from, -1, this);\n }\n }\n return this.nextChild(0, 1, pos, side, mode);\n }\n nextSignificantParent() {\n let val = this;\n while (val.type.isAnonymous && val._parent)\n val = val._parent;\n return val;\n }\n get parent() {\n return this._parent ? this._parent.nextSignificantParent() : null;\n }\n get nextSibling() {\n return this._parent && this.index >= 0 ? this._parent.nextChild(this.index + 1, 1, 0, 4 /* Side.DontCare */) : null;\n }\n get prevSibling() {\n return this._parent && this.index >= 0 ? this._parent.nextChild(this.index - 1, -1, 0, 4 /* Side.DontCare */) : null;\n }\n get tree() { return this._tree; }\n toTree() { return this._tree; }\n /**\n @internal\n */\n toString() { return this._tree.toString(); }\n}\nfunction getChildren(node, type, before, after) {\n let cur = node.cursor(), result = [];\n if (!cur.firstChild())\n return result;\n if (before != null)\n for (let found = false; !found;) {\n found = cur.type.is(before);\n if (!cur.nextSibling())\n return result;\n }\n for (;;) {\n if (after != null && cur.type.is(after))\n return result;\n if (cur.type.is(type))\n result.push(cur.node);\n if (!cur.nextSibling())\n return after == null ? result : [];\n }\n}\nfunction matchNodeContext(node, context, i = context.length - 1) {\n for (let p = node.parent; i >= 0; p = p.parent) {\n if (!p)\n return false;\n if (!p.type.isAnonymous) {\n if (context[i] && context[i] != p.name)\n return false;\n i--;\n }\n }\n return true;\n}\nclass BufferContext {\n constructor(parent, buffer, index, start) {\n this.parent = parent;\n this.buffer = buffer;\n this.index = index;\n this.start = start;\n }\n}\nclass BufferNode extends BaseNode {\n get name() { return this.type.name; }\n get from() { return this.context.start + this.context.buffer.buffer[this.index + 1]; }\n get to() { return this.context.start + this.context.buffer.buffer[this.index + 2]; }\n constructor(context, _parent, index) {\n super();\n this.context = context;\n this._parent = _parent;\n this.index = index;\n this.type = context.buffer.set.types[context.buffer.buffer[index]];\n }\n child(dir, pos, side) {\n let { buffer } = this.context;\n let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], dir, pos - this.context.start, side);\n return index < 0 ? null : new BufferNode(this.context, this, index);\n }\n get firstChild() { return this.child(1, 0, 4 /* Side.DontCare */); }\n get lastChild() { return this.child(-1, 0, 4 /* Side.DontCare */); }\n childAfter(pos) { return this.child(1, pos, 2 /* Side.After */); }\n childBefore(pos) { return this.child(-1, pos, -2 /* Side.Before */); }\n enter(pos, side, mode = 0) {\n if (mode & IterMode.ExcludeBuffers)\n return null;\n let { buffer } = this.context;\n let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], side > 0 ? 1 : -1, pos - this.context.start, side);\n return index < 0 ? null : new BufferNode(this.context, this, index);\n }\n get parent() {\n return this._parent || this.context.parent.nextSignificantParent();\n }\n externalSibling(dir) {\n return this._parent ? null : this.context.parent.nextChild(this.context.index + dir, dir, 0, 4 /* Side.DontCare */);\n }\n get nextSibling() {\n let { buffer } = this.context;\n let after = buffer.buffer[this.index + 3];\n if (after < (this._parent ? buffer.buffer[this._parent.index + 3] : buffer.buffer.length))\n return new BufferNode(this.context, this._parent, after);\n return this.externalSibling(1);\n }\n get prevSibling() {\n let { buffer } = this.context;\n let parentStart = this._parent ? this._parent.index + 4 : 0;\n if (this.index == parentStart)\n return this.externalSibling(-1);\n return new BufferNode(this.context, this._parent, buffer.findChild(parentStart, this.index, -1, 0, 4 /* Side.DontCare */));\n }\n get tree() { return null; }\n toTree() {\n let children = [], positions = [];\n let { buffer } = this.context;\n let startI = this.index + 4, endI = buffer.buffer[this.index + 3];\n if (endI > startI) {\n let from = buffer.buffer[this.index + 1];\n children.push(buffer.slice(startI, endI, from));\n positions.push(0);\n }\n return new Tree(this.type, children, positions, this.to - this.from);\n }\n /**\n @internal\n */\n toString() { return this.context.buffer.childString(this.index); }\n}\nfunction iterStack(heads) {\n if (!heads.length)\n return null;\n let pick = 0, picked = heads[0];\n for (let i = 1; i < heads.length; i++) {\n let node = heads[i];\n if (node.from > picked.from || node.to < picked.to) {\n picked = node;\n pick = i;\n }\n }\n let next = picked instanceof TreeNode && picked.index < 0 ? null : picked.parent;\n let newHeads = heads.slice();\n if (next)\n newHeads[pick] = next;\n else\n newHeads.splice(pick, 1);\n return new StackIterator(newHeads, picked);\n}\nclass StackIterator {\n constructor(heads, node) {\n this.heads = heads;\n this.node = node;\n }\n get next() { return iterStack(this.heads); }\n}\nfunction stackIterator(tree, pos, side) {\n let inner = tree.resolveInner(pos, side), layers = null;\n for (let scan = inner instanceof TreeNode ? inner : inner.context.parent; scan; scan = scan.parent) {\n if (scan.index < 0) { // This is an overlay root\n let parent = scan.parent;\n (layers || (layers = [inner])).push(parent.resolve(pos, side));\n scan = parent;\n }\n else {\n let mount = MountedTree.get(scan.tree);\n // Relevant overlay branching off\n if (mount && mount.overlay && mount.overlay[0].from <= pos && mount.overlay[mount.overlay.length - 1].to >= pos) {\n let root = new TreeNode(mount.tree, mount.overlay[0].from + scan.from, -1, scan);\n (layers || (layers = [inner])).push(resolveNode(root, pos, side, false));\n }\n }\n }\n return layers ? iterStack(layers) : inner;\n}\n/**\nA tree cursor object focuses on a given node in a syntax tree, and\nallows you to move to adjacent nodes.\n*/\nclass TreeCursor {\n /**\n Shorthand for `.type.name`.\n */\n get name() { return this.type.name; }\n /**\n @internal\n */\n constructor(node, \n /**\n @internal\n */\n mode = 0) {\n this.mode = mode;\n /**\n @internal\n */\n this.buffer = null;\n this.stack = [];\n /**\n @internal\n */\n this.index = 0;\n this.bufferNode = null;\n if (node instanceof TreeNode) {\n this.yieldNode(node);\n }\n else {\n this._tree = node.context.parent;\n this.buffer = node.context;\n for (let n = node._parent; n; n = n._parent)\n this.stack.unshift(n.index);\n this.bufferNode = node;\n this.yieldBuf(node.index);\n }\n }\n yieldNode(node) {\n if (!node)\n return false;\n this._tree = node;\n this.type = node.type;\n this.from = node.from;\n this.to = node.to;\n return true;\n }\n yieldBuf(index, type) {\n this.index = index;\n let { start, buffer } = this.buffer;\n this.type = type || buffer.set.types[buffer.buffer[index]];\n this.from = start + buffer.buffer[index + 1];\n this.to = start + buffer.buffer[index + 2];\n return true;\n }\n /**\n @internal\n */\n yield(node) {\n if (!node)\n return false;\n if (node instanceof TreeNode) {\n this.buffer = null;\n return this.yieldNode(node);\n }\n this.buffer = node.context;\n return this.yieldBuf(node.index, node.type);\n }\n /**\n @internal\n */\n toString() {\n return this.buffer ? this.buffer.buffer.childString(this.index) : this._tree.toString();\n }\n /**\n @internal\n */\n enterChild(dir, pos, side) {\n if (!this.buffer)\n return this.yield(this._tree.nextChild(dir < 0 ? this._tree._tree.children.length - 1 : 0, dir, pos, side, this.mode));\n let { buffer } = this.buffer;\n let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], dir, pos - this.buffer.start, side);\n if (index < 0)\n return false;\n this.stack.push(this.index);\n return this.yieldBuf(index);\n }\n /**\n Move the cursor to this node's first child. When this returns\n false, the node has no child, and the cursor has not been moved.\n */\n firstChild() { return this.enterChild(1, 0, 4 /* Side.DontCare */); }\n /**\n Move the cursor to this node's last child.\n */\n lastChild() { return this.enterChild(-1, 0, 4 /* Side.DontCare */); }\n /**\n Move the cursor to the first child that ends after `pos`.\n */\n childAfter(pos) { return this.enterChild(1, pos, 2 /* Side.After */); }\n /**\n Move to the last child that starts before `pos`.\n */\n childBefore(pos) { return this.enterChild(-1, pos, -2 /* Side.Before */); }\n /**\n Move the cursor to the child around `pos`. If side is -1 the\n child may end at that position, when 1 it may start there. This\n will also enter [overlaid](#common.MountedTree.overlay)\n [mounted](#common.NodeProp^mounted) trees unless `overlays` is\n set to false.\n */\n enter(pos, side, mode = this.mode) {\n if (!this.buffer)\n return this.yield(this._tree.enter(pos, side, mode));\n return mode & IterMode.ExcludeBuffers ? false : this.enterChild(1, pos, side);\n }\n /**\n Move to the node's parent node, if this isn't the top node.\n */\n parent() {\n if (!this.buffer)\n return this.yieldNode((this.mode & IterMode.IncludeAnonymous) ? this._tree._parent : this._tree.parent);\n if (this.stack.length)\n return this.yieldBuf(this.stack.pop());\n let parent = (this.mode & IterMode.IncludeAnonymous) ? this.buffer.parent : this.buffer.parent.nextSignificantParent();\n this.buffer = null;\n return this.yieldNode(parent);\n }\n /**\n @internal\n */\n sibling(dir) {\n if (!this.buffer)\n return !this._tree._parent ? false\n : this.yield(this._tree.index < 0 ? null\n : this._tree._parent.nextChild(this._tree.index + dir, dir, 0, 4 /* Side.DontCare */, this.mode));\n let { buffer } = this.buffer, d = this.stack.length - 1;\n if (dir < 0) {\n let parentStart = d < 0 ? 0 : this.stack[d] + 4;\n if (this.index != parentStart)\n return this.yieldBuf(buffer.findChild(parentStart, this.index, -1, 0, 4 /* Side.DontCare */));\n }\n else {\n let after = buffer.buffer[this.index + 3];\n if (after < (d < 0 ? buffer.buffer.length : buffer.buffer[this.stack[d] + 3]))\n return this.yieldBuf(after);\n }\n return d < 0 ? this.yield(this.buffer.parent.nextChild(this.buffer.index + dir, dir, 0, 4 /* Side.DontCare */, this.mode)) : false;\n }\n /**\n Move to this node's next sibling, if any.\n */\n nextSibling() { return this.sibling(1); }\n /**\n Move to this node's previous sibling, if any.\n */\n prevSibling() { return this.sibling(-1); }\n atLastNode(dir) {\n let index, parent, { buffer } = this;\n if (buffer) {\n if (dir > 0) {\n if (this.index < buffer.buffer.buffer.length)\n return false;\n }\n else {\n for (let i = 0; i < this.index; i++)\n if (buffer.buffer.buffer[i + 3] < this.index)\n return false;\n }\n ({ index, parent } = buffer);\n }\n else {\n ({ index, _parent: parent } = this._tree);\n }\n for (; parent; { index, _parent: parent } = parent) {\n if (index > -1)\n for (let i = index + dir, e = dir < 0 ? -1 : parent._tree.children.length; i != e; i += dir) {\n let child = parent._tree.children[i];\n if ((this.mode & IterMode.IncludeAnonymous) ||\n child instanceof TreeBuffer ||\n !child.type.isAnonymous ||\n hasChild(child))\n return false;\n }\n }\n return true;\n }\n move(dir, enter) {\n if (enter && this.enterChild(dir, 0, 4 /* Side.DontCare */))\n return true;\n for (;;) {\n if (this.sibling(dir))\n return true;\n if (this.atLastNode(dir) || !this.parent())\n return false;\n }\n }\n /**\n Move to the next node in a\n [pre-order](https://en.wikipedia.org/wiki/Tree_traversal#Pre-order,_NLR)\n traversal, going from a node to its first child or, if the\n current node is empty or `enter` is false, its next sibling or\n the next sibling of the first parent node that has one.\n */\n next(enter = true) { return this.move(1, enter); }\n /**\n Move to the next node in a last-to-first pre-order traveral. A\n node is followed by its last child or, if it has none, its\n previous sibling or the previous sibling of the first parent\n node that has one.\n */\n prev(enter = true) { return this.move(-1, enter); }\n /**\n Move the cursor to the innermost node that covers `pos`. If\n `side` is -1, it will enter nodes that end at `pos`. If it is 1,\n it will enter nodes that start at `pos`.\n */\n moveTo(pos, side = 0) {\n // Move up to a node that actually holds the position, if possible\n while (this.from == this.to ||\n (side < 1 ? this.from >= pos : this.from > pos) ||\n (side > -1 ? this.to <= pos : this.to < pos))\n if (!this.parent())\n break;\n // Then scan down into child nodes as far as possible\n while (this.enterChild(1, pos, side)) { }\n return this;\n }\n /**\n Get a [syntax node](#common.SyntaxNode) at the cursor's current\n position.\n */\n get node() {\n if (!this.buffer)\n return this._tree;\n let cache = this.bufferNode, result = null, depth = 0;\n if (cache && cache.context == this.buffer) {\n scan: for (let index = this.index, d = this.stack.length; d >= 0;) {\n for (let c = cache; c; c = c._parent)\n if (c.index == index) {\n if (index == this.index)\n return c;\n result = c;\n depth = d + 1;\n break scan;\n }\n index = this.stack[--d];\n }\n }\n for (let i = depth; i < this.stack.length; i++)\n result = new BufferNode(this.buffer, result, this.stack[i]);\n return this.bufferNode = new BufferNode(this.buffer, result, this.index);\n }\n /**\n Get the [tree](#common.Tree) that represents the current node, if\n any. Will return null when the node is in a [tree\n buffer](#common.TreeBuffer).\n */\n get tree() {\n return this.buffer ? null : this._tree._tree;\n }\n /**\n Iterate over the current node and all its descendants, calling\n `enter` when entering a node and `leave`, if given, when leaving\n one. When `enter` returns `false`, any children of that node are\n skipped, and `leave` isn't called for it.\n */\n iterate(enter, leave) {\n for (let depth = 0;;) {\n let mustLeave = false;\n if (this.type.isAnonymous || enter(this) !== false) {\n if (this.firstChild()) {\n depth++;\n continue;\n }\n if (!this.type.isAnonymous)\n mustLeave = true;\n }\n for (;;) {\n if (mustLeave && leave)\n leave(this);\n mustLeave = this.type.isAnonymous;\n if (this.nextSibling())\n break;\n if (!depth)\n return;\n this.parent();\n depth--;\n mustLeave = true;\n }\n }\n }\n /**\n Test whether the current node matches a given context—a sequence\n of direct parent node names. Empty strings in the context array\n are treated as wildcards.\n */\n matchContext(context) {\n if (!this.buffer)\n return matchNodeContext(this.node, context);\n let { buffer } = this.buffer, { types } = buffer.set;\n for (let i = context.length - 1, d = this.stack.length - 1; i >= 0; d--) {\n if (d < 0)\n return matchNodeContext(this.node, context, i);\n let type = types[buffer.buffer[this.stack[d]]];\n if (!type.isAnonymous) {\n if (context[i] && context[i] != type.name)\n return false;\n i--;\n }\n }\n return true;\n }\n}\nfunction hasChild(tree) {\n return tree.children.some(ch => ch instanceof TreeBuffer || !ch.type.isAnonymous || hasChild(ch));\n}\nfunction buildTree(data) {\n var _a;\n let { buffer, nodeSet, maxBufferLength = DefaultBufferLength, reused = [], minRepeatType = nodeSet.types.length } = data;\n let cursor = Array.isArray(buffer) ? new FlatBufferCursor(buffer, buffer.length) : buffer;\n let types = nodeSet.types;\n let contextHash = 0, lookAhead = 0;\n function takeNode(parentStart, minPos, children, positions, inRepeat, depth) {\n let { id, start, end, size } = cursor;\n let lookAheadAtStart = lookAhead;\n while (size < 0) {\n cursor.next();\n if (size == -1 /* SpecialRecord.Reuse */) {\n let node = reused[id];\n children.push(node);\n positions.push(start - parentStart);\n return;\n }\n else if (size == -3 /* SpecialRecord.ContextChange */) { // Context change\n contextHash = id;\n return;\n }\n else if (size == -4 /* SpecialRecord.LookAhead */) {\n lookAhead = id;\n return;\n }\n else {\n throw new RangeError(`Unrecognized record size: ${size}`);\n }\n }\n let type = types[id], node, buffer;\n let startPos = start - parentStart;\n if (end - start <= maxBufferLength && (buffer = findBufferSize(cursor.pos - minPos, inRepeat))) {\n // Small enough for a buffer, and no reused nodes inside\n let data = new Uint16Array(buffer.size - buffer.skip);\n let endPos = cursor.pos - buffer.size, index = data.length;\n while (cursor.pos > endPos)\n index = copyToBuffer(buffer.start, data, index);\n node = new TreeBuffer(data, end - buffer.start, nodeSet);\n startPos = buffer.start - parentStart;\n }\n else { // Make it a node\n let endPos = cursor.pos - size;\n cursor.next();\n let localChildren = [], localPositions = [];\n let localInRepeat = id >= minRepeatType ? id : -1;\n let lastGroup = 0, lastEnd = end;\n while (cursor.pos > endPos) {\n if (localInRepeat >= 0 && cursor.id == localInRepeat && cursor.size >= 0) {\n if (cursor.end <= lastEnd - maxBufferLength) {\n makeRepeatLeaf(localChildren, localPositions, start, lastGroup, cursor.end, lastEnd, localInRepeat, lookAheadAtStart);\n lastGroup = localChildren.length;\n lastEnd = cursor.end;\n }\n cursor.next();\n }\n else if (depth > 2500 /* CutOff.Depth */) {\n takeFlatNode(start, endPos, localChildren, localPositions);\n }\n else {\n takeNode(start, endPos, localChildren, localPositions, localInRepeat, depth + 1);\n }\n }\n if (localInRepeat >= 0 && lastGroup > 0 && lastGroup < localChildren.length)\n makeRepeatLeaf(localChildren, localPositions, start, lastGroup, start, lastEnd, localInRepeat, lookAheadAtStart);\n localChildren.reverse();\n localPositions.reverse();\n if (localInRepeat > -1 && lastGroup > 0) {\n let make = makeBalanced(type);\n node = balanceRange(type, localChildren, localPositions, 0, localChildren.length, 0, end - start, make, make);\n }\n else {\n node = makeTree(type, localChildren, localPositions, end - start, lookAheadAtStart - end);\n }\n }\n children.push(node);\n positions.push(startPos);\n }\n function takeFlatNode(parentStart, minPos, children, positions) {\n let nodes = []; // Temporary, inverted array of leaf nodes found, with absolute positions\n let nodeCount = 0, stopAt = -1;\n while (cursor.pos > minPos) {\n let { id, start, end, size } = cursor;\n if (size > 4) { // Not a leaf\n cursor.next();\n }\n else if (stopAt > -1 && start < stopAt) {\n break;\n }\n else {\n if (stopAt < 0)\n stopAt = end - maxBufferLength;\n nodes.push(id, start, end);\n nodeCount++;\n cursor.next();\n }\n }\n if (nodeCount) {\n let buffer = new Uint16Array(nodeCount * 4);\n let start = nodes[nodes.length - 2];\n for (let i = nodes.length - 3, j = 0; i >= 0; i -= 3) {\n buffer[j++] = nodes[i];\n buffer[j++] = nodes[i + 1] - start;\n buffer[j++] = nodes[i + 2] - start;\n buffer[j++] = j;\n }\n children.push(new TreeBuffer(buffer, nodes[2] - start, nodeSet));\n positions.push(start - parentStart);\n }\n }\n function makeBalanced(type) {\n return (children, positions, length) => {\n let lookAhead = 0, lastI = children.length - 1, last, lookAheadProp;\n if (lastI >= 0 && (last = children[lastI]) instanceof Tree) {\n if (!lastI && last.type == type && last.length == length)\n return last;\n if (lookAheadProp = last.prop(NodeProp.lookAhead))\n lookAhead = positions[lastI] + last.length + lookAheadProp;\n }\n return makeTree(type, children, positions, length, lookAhead);\n };\n }\n function makeRepeatLeaf(children, positions, base, i, from, to, type, lookAhead) {\n let localChildren = [], localPositions = [];\n while (children.length > i) {\n localChildren.push(children.pop());\n localPositions.push(positions.pop() + base - from);\n }\n children.push(makeTree(nodeSet.types[type], localChildren, localPositions, to - from, lookAhead - to));\n positions.push(from - base);\n }\n function makeTree(type, children, positions, length, lookAhead = 0, props) {\n if (contextHash) {\n let pair = [NodeProp.contextHash, contextHash];\n props = props ? [pair].concat(props) : [pair];\n }\n if (lookAhead > 25) {\n let pair = [NodeProp.lookAhead, lookAhead];\n props = props ? [pair].concat(props) : [pair];\n }\n return new Tree(type, children, positions, length, props);\n }\n function findBufferSize(maxSize, inRepeat) {\n // Scan through the buffer to find previous siblings that fit\n // together in a TreeBuffer, and don't contain any reused nodes\n // (which can't be stored in a buffer).\n // If `inRepeat` is > -1, ignore node boundaries of that type for\n // nesting, but make sure the end falls either at the start\n // (`maxSize`) or before such a node.\n let fork = cursor.fork();\n let size = 0, start = 0, skip = 0, minStart = fork.end - maxBufferLength;\n let result = { size: 0, start: 0, skip: 0 };\n scan: for (let minPos = fork.pos - maxSize; fork.pos > minPos;) {\n let nodeSize = fork.size;\n // Pretend nested repeat nodes of the same type don't exist\n if (fork.id == inRepeat && nodeSize >= 0) {\n // Except that we store the current state as a valid return\n // value.\n result.size = size;\n result.start = start;\n result.skip = skip;\n skip += 4;\n size += 4;\n fork.next();\n continue;\n }\n let startPos = fork.pos - nodeSize;\n if (nodeSize < 0 || startPos < minPos || fork.start < minStart)\n break;\n let localSkipped = fork.id >= minRepeatType ? 4 : 0;\n let nodeStart = fork.start;\n fork.next();\n while (fork.pos > startPos) {\n if (fork.size < 0) {\n if (fork.size == -3 /* SpecialRecord.ContextChange */)\n localSkipped += 4;\n else\n break scan;\n }\n else if (fork.id >= minRepeatType) {\n localSkipped += 4;\n }\n fork.next();\n }\n start = nodeStart;\n size += nodeSize;\n skip += localSkipped;\n }\n if (inRepeat < 0 || size == maxSize) {\n result.size = size;\n result.start = start;\n result.skip = skip;\n }\n return result.size > 4 ? result : undefined;\n }\n function copyToBuffer(bufferStart, buffer, index) {\n let { id, start, end, size } = cursor;\n cursor.next();\n if (size >= 0 && id < minRepeatType) {\n let startIndex = index;\n if (size > 4) {\n let endPos = cursor.pos - (size - 4);\n while (cursor.pos > endPos)\n index = copyToBuffer(bufferStart, buffer, index);\n }\n buffer[--index] = startIndex;\n buffer[--index] = end - bufferStart;\n buffer[--index] = start - bufferStart;\n buffer[--index] = id;\n }\n else if (size == -3 /* SpecialRecord.ContextChange */) {\n contextHash = id;\n }\n else if (size == -4 /* SpecialRecord.LookAhead */) {\n lookAhead = id;\n }\n return index;\n }\n let children = [], positions = [];\n while (cursor.pos > 0)\n takeNode(data.start || 0, data.bufferStart || 0, children, positions, -1, 0);\n let length = (_a = data.length) !== null && _a !== void 0 ? _a : (children.length ? positions[0] + children[0].length : 0);\n return new Tree(types[data.topID], children.reverse(), positions.reverse(), length);\n}\nconst nodeSizeCache = new WeakMap;\nfunction nodeSize(balanceType, node) {\n if (!balanceType.isAnonymous || node instanceof TreeBuffer || node.type != balanceType)\n return 1;\n let size = nodeSizeCache.get(node);\n if (size == null) {\n size = 1;\n for (let child of node.children) {\n if (child.type != balanceType || !(child instanceof Tree)) {\n size = 1;\n break;\n }\n size += nodeSize(balanceType, child);\n }\n nodeSizeCache.set(node, size);\n }\n return size;\n}\nfunction balanceRange(\n// The type the balanced tree's inner nodes.\nbalanceType, \n// The direct children and their positions\nchildren, positions, \n// The index range in children/positions to use\nfrom, to, \n// The start position of the nodes, relative to their parent.\nstart, \n// Length of the outer node\nlength, \n// Function to build the top node of the balanced tree\nmkTop, \n// Function to build internal nodes for the balanced tree\nmkTree) {\n let total = 0;\n for (let i = from; i < to; i++)\n total += nodeSize(balanceType, children[i]);\n let maxChild = Math.ceil((total * 1.5) / 8 /* Balance.BranchFactor */);\n let localChildren = [], localPositions = [];\n function divide(children, positions, from, to, offset) {\n for (let i = from; i < to;) {\n let groupFrom = i, groupStart = positions[i], groupSize = nodeSize(balanceType, children[i]);\n i++;\n for (; i < to; i++) {\n let nextSize = nodeSize(balanceType, children[i]);\n if (groupSize + nextSize >= maxChild)\n break;\n groupSize += nextSize;\n }\n if (i == groupFrom + 1) {\n if (groupSize > maxChild) {\n let only = children[groupFrom]; // Only trees can have a size > 1\n divide(only.children, only.positions, 0, only.children.length, positions[groupFrom] + offset);\n continue;\n }\n localChildren.push(children[groupFrom]);\n }\n else {\n let length = positions[i - 1] + children[i - 1].length - groupStart;\n localChildren.push(balanceRange(balanceType, children, positions, groupFrom, i, groupStart, length, null, mkTree));\n }\n localPositions.push(groupStart + offset - start);\n }\n }\n divide(children, positions, from, to, 0);\n return (mkTop || mkTree)(localChildren, localPositions, length);\n}\n/**\nProvides a way to associate values with pieces of trees. As long\nas that part of the tree is reused, the associated values can be\nretrieved from an updated tree.\n*/\nclass NodeWeakMap {\n constructor() {\n this.map = new WeakMap();\n }\n setBuffer(buffer, index, value) {\n let inner = this.map.get(buffer);\n if (!inner)\n this.map.set(buffer, inner = new Map);\n inner.set(index, value);\n }\n getBuffer(buffer, index) {\n let inner = this.map.get(buffer);\n return inner && inner.get(index);\n }\n /**\n Set the value for this syntax node.\n */\n set(node, value) {\n if (node instanceof BufferNode)\n this.setBuffer(node.context.buffer, node.index, value);\n else if (node instanceof TreeNode)\n this.map.set(node.tree, value);\n }\n /**\n Retrieve value for this syntax node, if it exists in the map.\n */\n get(node) {\n return node instanceof BufferNode ? this.getBuffer(node.context.buffer, node.index)\n : node instanceof TreeNode ? this.map.get(node.tree) : undefined;\n }\n /**\n Set the value for the node that a cursor currently points to.\n */\n cursorSet(cursor, value) {\n if (cursor.buffer)\n this.setBuffer(cursor.buffer.buffer, cursor.index, value);\n else\n this.map.set(cursor.tree, value);\n }\n /**\n Retrieve the value for the node that a cursor currently points\n to.\n */\n cursorGet(cursor) {\n return cursor.buffer ? this.getBuffer(cursor.buffer.buffer, cursor.index) : this.map.get(cursor.tree);\n }\n}\n\n/**\nTree fragments are used during [incremental\nparsing](#common.Parser.startParse) to track parts of old trees\nthat can be reused in a new parse. An array of fragments is used\nto track regions of an old tree whose nodes might be reused in new\nparses. Use the static\n[`applyChanges`](#common.TreeFragment^applyChanges) method to\nupdate fragments for document changes.\n*/\nclass TreeFragment {\n /**\n Construct a tree fragment. You'll usually want to use\n [`addTree`](#common.TreeFragment^addTree) and\n [`applyChanges`](#common.TreeFragment^applyChanges) instead of\n calling this directly.\n */\n constructor(\n /**\n The start of the unchanged range pointed to by this fragment.\n This refers to an offset in the _updated_ document (as opposed\n to the original tree).\n */\n from, \n /**\n The end of the unchanged range.\n */\n to, \n /**\n The tree that this fragment is based on.\n */\n tree, \n /**\n The offset between the fragment's tree and the document that\n this fragment can be used against. Add this when going from\n document to tree positions, subtract it to go from tree to\n document positions.\n */\n offset, openStart = false, openEnd = false) {\n this.from = from;\n this.to = to;\n this.tree = tree;\n this.offset = offset;\n this.open = (openStart ? 1 /* Open.Start */ : 0) | (openEnd ? 2 /* Open.End */ : 0);\n }\n /**\n Whether the start of the fragment represents the start of a\n parse, or the end of a change. (In the second case, it may not\n be safe to reuse some nodes at the start, depending on the\n parsing algorithm.)\n */\n get openStart() { return (this.open & 1 /* Open.Start */) > 0; }\n /**\n Whether the end of the fragment represents the end of a\n full-document parse, or the start of a change.\n */\n get openEnd() { return (this.open & 2 /* Open.End */) > 0; }\n /**\n Create a set of fragments from a freshly parsed tree, or update\n an existing set of fragments by replacing the ones that overlap\n with a tree with content from the new tree. When `partial` is\n true, the parse is treated as incomplete, and the resulting\n fragment has [`openEnd`](#common.TreeFragment.openEnd) set to\n true.\n */\n static addTree(tree, fragments = [], partial = false) {\n let result = [new TreeFragment(0, tree.length, tree, 0, false, partial)];\n for (let f of fragments)\n if (f.to > tree.length)\n result.push(f);\n return result;\n }\n /**\n Apply a set of edits to an array of fragments, removing or\n splitting fragments as necessary to remove edited ranges, and\n adjusting offsets for fragments that moved.\n */\n static applyChanges(fragments, changes, minGap = 128) {\n if (!changes.length)\n return fragments;\n let result = [];\n let fI = 1, nextF = fragments.length ? fragments[0] : null;\n for (let cI = 0, pos = 0, off = 0;; cI++) {\n let nextC = cI < changes.length ? changes[cI] : null;\n let nextPos = nextC ? nextC.fromA : 1e9;\n if (nextPos - pos >= minGap)\n while (nextF && nextF.from < nextPos) {\n let cut = nextF;\n if (pos >= cut.from || nextPos <= cut.to || off) {\n let fFrom = Math.max(cut.from, pos) - off, fTo = Math.min(cut.to, nextPos) - off;\n cut = fFrom >= fTo ? null : new TreeFragment(fFrom, fTo, cut.tree, cut.offset + off, cI > 0, !!nextC);\n }\n if (cut)\n result.push(cut);\n if (nextF.to > nextPos)\n break;\n nextF = fI < fragments.length ? fragments[fI++] : null;\n }\n if (!nextC)\n break;\n pos = nextC.toA;\n off = nextC.toA - nextC.toB;\n }\n return result;\n }\n}\n/**\nA superclass that parsers should extend.\n*/\nclass Parser {\n /**\n Start a parse, returning a [partial parse](#common.PartialParse)\n object. [`fragments`](#common.TreeFragment) can be passed in to\n make the parse incremental.\n \n By default, the entire input is parsed. You can pass `ranges`,\n which should be a sorted array of non-empty, non-overlapping\n ranges, to parse only those ranges. The tree returned in that\n case will start at `ranges[0].from`.\n */\n startParse(input, fragments, ranges) {\n if (typeof input == \"string\")\n input = new StringInput(input);\n ranges = !ranges ? [new Range(0, input.length)] : ranges.length ? ranges.map(r => new Range(r.from, r.to)) : [new Range(0, 0)];\n return this.createParse(input, fragments || [], ranges);\n }\n /**\n Run a full parse, returning the resulting tree.\n */\n parse(input, fragments, ranges) {\n let parse = this.startParse(input, fragments, ranges);\n for (;;) {\n let done = parse.advance();\n if (done)\n return done;\n }\n }\n}\nclass StringInput {\n constructor(string) {\n this.string = string;\n }\n get length() { return this.string.length; }\n chunk(from) { return this.string.slice(from); }\n get lineChunks() { return false; }\n read(from, to) { return this.string.slice(from, to); }\n}\n\n/**\nCreate a parse wrapper that, after the inner parse completes,\nscans its tree for mixed language regions with the `nest`\nfunction, runs the resulting [inner parses](#common.NestedParse),\nand then [mounts](#common.NodeProp^mounted) their results onto the\ntree.\n*/\nfunction parseMixed(nest) {\n return (parse, input, fragments, ranges) => new MixedParse(parse, nest, input, fragments, ranges);\n}\nclass InnerParse {\n constructor(parser, parse, overlay, target, from) {\n this.parser = parser;\n this.parse = parse;\n this.overlay = overlay;\n this.target = target;\n this.from = from;\n }\n}\nfunction checkRanges(ranges) {\n if (!ranges.length || ranges.some(r => r.from >= r.to))\n throw new RangeError(\"Invalid inner parse ranges given: \" + JSON.stringify(ranges));\n}\nclass ActiveOverlay {\n constructor(parser, predicate, mounts, index, start, target, prev) {\n this.parser = parser;\n this.predicate = predicate;\n this.mounts = mounts;\n this.index = index;\n this.start = start;\n this.target = target;\n this.prev = prev;\n this.depth = 0;\n this.ranges = [];\n }\n}\nconst stoppedInner = new NodeProp({ perNode: true });\nclass MixedParse {\n constructor(base, nest, input, fragments, ranges) {\n this.nest = nest;\n this.input = input;\n this.fragments = fragments;\n this.ranges = ranges;\n this.inner = [];\n this.innerDone = 0;\n this.baseTree = null;\n this.stoppedAt = null;\n this.baseParse = base;\n }\n advance() {\n if (this.baseParse) {\n let done = this.baseParse.advance();\n if (!done)\n return null;\n this.baseParse = null;\n this.baseTree = done;\n this.startInner();\n if (this.stoppedAt != null)\n for (let inner of this.inner)\n inner.parse.stopAt(this.stoppedAt);\n }\n if (this.innerDone == this.inner.length) {\n let result = this.baseTree;\n if (this.stoppedAt != null)\n result = new Tree(result.type, result.children, result.positions, result.length, result.propValues.concat([[stoppedInner, this.stoppedAt]]));\n return result;\n }\n let inner = this.inner[this.innerDone], done = inner.parse.advance();\n if (done) {\n this.innerDone++;\n // This is a somewhat dodgy but super helpful hack where we\n // patch up nodes created by the inner parse (and thus\n // presumably not aliased anywhere else) to hold the information\n // about the inner parse.\n let props = Object.assign(Object.create(null), inner.target.props);\n props[NodeProp.mounted.id] = new MountedTree(done, inner.overlay, inner.parser);\n inner.target.props = props;\n }\n return null;\n }\n get parsedPos() {\n if (this.baseParse)\n return 0;\n let pos = this.input.length;\n for (let i = this.innerDone; i < this.inner.length; i++) {\n if (this.inner[i].from < pos)\n pos = Math.min(pos, this.inner[i].parse.parsedPos);\n }\n return pos;\n }\n stopAt(pos) {\n this.stoppedAt = pos;\n if (this.baseParse)\n this.baseParse.stopAt(pos);\n else\n for (let i = this.innerDone; i < this.inner.length; i++)\n this.inner[i].parse.stopAt(pos);\n }\n startInner() {\n let fragmentCursor = new FragmentCursor(this.fragments);\n let overlay = null;\n let covered = null;\n let cursor = new TreeCursor(new TreeNode(this.baseTree, this.ranges[0].from, 0, null), IterMode.IncludeAnonymous | IterMode.IgnoreMounts);\n scan: for (let nest, isCovered;;) {\n let enter = true, range;\n if (this.stoppedAt != null && cursor.from >= this.stoppedAt) {\n enter = false;\n }\n else if (fragmentCursor.hasNode(cursor)) {\n if (overlay) {\n let match = overlay.mounts.find(m => m.frag.from <= cursor.from && m.frag.to >= cursor.to && m.mount.overlay);\n if (match)\n for (let r of match.mount.overlay) {\n let from = r.from + match.pos, to = r.to + match.pos;\n if (from >= cursor.from && to <= cursor.to && !overlay.ranges.some(r => r.from < to && r.to > from))\n overlay.ranges.push({ from, to });\n }\n }\n enter = false;\n }\n else if (covered && (isCovered = checkCover(covered.ranges, cursor.from, cursor.to))) {\n enter = isCovered != 2 /* Cover.Full */;\n }\n else if (!cursor.type.isAnonymous && (nest = this.nest(cursor, this.input)) &&\n (cursor.from < cursor.to || !nest.overlay)) {\n if (!cursor.tree)\n materialize(cursor);\n let oldMounts = fragmentCursor.findMounts(cursor.from, nest.parser);\n if (typeof nest.overlay == \"function\") {\n overlay = new ActiveOverlay(nest.parser, nest.overlay, oldMounts, this.inner.length, cursor.from, cursor.tree, overlay);\n }\n else {\n let ranges = punchRanges(this.ranges, nest.overlay ||\n (cursor.from < cursor.to ? [new Range(cursor.from, cursor.to)] : []));\n if (ranges.length)\n checkRanges(ranges);\n if (ranges.length || !nest.overlay)\n this.inner.push(new InnerParse(nest.parser, ranges.length ? nest.parser.startParse(this.input, enterFragments(oldMounts, ranges), ranges)\n : nest.parser.startParse(\"\"), nest.overlay ? nest.overlay.map(r => new Range(r.from - cursor.from, r.to - cursor.from)) : null, cursor.tree, ranges.length ? ranges[0].from : cursor.from));\n if (!nest.overlay)\n enter = false;\n else if (ranges.length)\n covered = { ranges, depth: 0, prev: covered };\n }\n }\n else if (overlay && (range = overlay.predicate(cursor))) {\n if (range === true)\n range = new Range(cursor.from, cursor.to);\n if (range.from < range.to)\n overlay.ranges.push(range);\n }\n if (enter && cursor.firstChild()) {\n if (overlay)\n overlay.depth++;\n if (covered)\n covered.depth++;\n }\n else {\n for (;;) {\n if (cursor.nextSibling())\n break;\n if (!cursor.parent())\n break scan;\n if (overlay && !--overlay.depth) {\n let ranges = punchRanges(this.ranges, overlay.ranges);\n if (ranges.length) {\n checkRanges(ranges);\n this.inner.splice(overlay.index, 0, new InnerParse(overlay.parser, overlay.parser.startParse(this.input, enterFragments(overlay.mounts, ranges), ranges), overlay.ranges.map(r => new Range(r.from - overlay.start, r.to - overlay.start)), overlay.target, ranges[0].from));\n }\n overlay = overlay.prev;\n }\n if (covered && !--covered.depth)\n covered = covered.prev;\n }\n }\n }\n }\n}\nfunction checkCover(covered, from, to) {\n for (let range of covered) {\n if (range.from >= to)\n break;\n if (range.to > from)\n return range.from <= from && range.to >= to ? 2 /* Cover.Full */ : 1 /* Cover.Partial */;\n }\n return 0 /* Cover.None */;\n}\n// Take a piece of buffer and convert it into a stand-alone\n// TreeBuffer.\nfunction sliceBuf(buf, startI, endI, nodes, positions, off) {\n if (startI < endI) {\n let from = buf.buffer[startI + 1];\n nodes.push(buf.slice(startI, endI, from));\n positions.push(from - off);\n }\n}\n// This function takes a node that's in a buffer, and converts it, and\n// its parent buffer nodes, into a Tree. This is again acting on the\n// assumption that the trees and buffers have been constructed by the\n// parse that was ran via the mix parser, and thus aren't shared with\n// any other code, making violations of the immutability safe.\nfunction materialize(cursor) {\n let { node } = cursor, stack = [];\n let buffer = node.context.buffer;\n // Scan up to the nearest tree\n do {\n stack.push(cursor.index);\n cursor.parent();\n } while (!cursor.tree);\n // Find the index of the buffer in that tree\n let base = cursor.tree, i = base.children.indexOf(buffer);\n let buf = base.children[i], b = buf.buffer, newStack = [i];\n // Split a level in the buffer, putting the nodes before and after\n // the child that contains `node` into new buffers.\n function split(startI, endI, type, innerOffset, length, stackPos) {\n let targetI = stack[stackPos];\n let children = [], positions = [];\n sliceBuf(buf, startI, targetI, children, positions, innerOffset);\n let from = b[targetI + 1], to = b[targetI + 2];\n newStack.push(children.length);\n let child = stackPos\n ? split(targetI + 4, b[targetI + 3], buf.set.types[b[targetI]], from, to - from, stackPos - 1)\n : node.toTree();\n children.push(child);\n positions.push(from - innerOffset);\n sliceBuf(buf, b[targetI + 3], endI, children, positions, innerOffset);\n return new Tree(type, children, positions, length);\n }\n base.children[i] = split(0, b.length, NodeType.none, 0, buf.length, stack.length - 1);\n // Move the cursor back to the target node\n for (let index of newStack) {\n let tree = cursor.tree.children[index], pos = cursor.tree.positions[index];\n cursor.yield(new TreeNode(tree, pos + cursor.from, index, cursor._tree));\n }\n}\nclass StructureCursor {\n constructor(root, offset) {\n this.offset = offset;\n this.done = false;\n this.cursor = root.cursor(IterMode.IncludeAnonymous | IterMode.IgnoreMounts);\n }\n // Move to the first node (in pre-order) that starts at or after `pos`.\n moveTo(pos) {\n let { cursor } = this, p = pos - this.offset;\n while (!this.done && cursor.from < p) {\n if (cursor.to >= pos && cursor.enter(p, 1, IterMode.IgnoreOverlays | IterMode.ExcludeBuffers)) ;\n else if (!cursor.next(false))\n this.done = true;\n }\n }\n hasNode(cursor) {\n this.moveTo(cursor.from);\n if (!this.done && this.cursor.from + this.offset == cursor.from && this.cursor.tree) {\n for (let tree = this.cursor.tree;;) {\n if (tree == cursor.tree)\n return true;\n if (tree.children.length && tree.positions[0] == 0 && tree.children[0] instanceof Tree)\n tree = tree.children[0];\n else\n break;\n }\n }\n return false;\n }\n}\nclass FragmentCursor {\n constructor(fragments) {\n var _a;\n this.fragments = fragments;\n this.curTo = 0;\n this.fragI = 0;\n if (fragments.length) {\n let first = this.curFrag = fragments[0];\n this.curTo = (_a = first.tree.prop(stoppedInner)) !== null && _a !== void 0 ? _a : first.to;\n this.inner = new StructureCursor(first.tree, -first.offset);\n }\n else {\n this.curFrag = this.inner = null;\n }\n }\n hasNode(node) {\n while (this.curFrag && node.from >= this.curTo)\n this.nextFrag();\n return this.curFrag && this.curFrag.from <= node.from && this.curTo >= node.to && this.inner.hasNode(node);\n }\n nextFrag() {\n var _a;\n this.fragI++;\n if (this.fragI == this.fragments.length) {\n this.curFrag = this.inner = null;\n }\n else {\n let frag = this.curFrag = this.fragments[this.fragI];\n this.curTo = (_a = frag.tree.prop(stoppedInner)) !== null && _a !== void 0 ? _a : frag.to;\n this.inner = new StructureCursor(frag.tree, -frag.offset);\n }\n }\n findMounts(pos, parser) {\n var _a;\n let result = [];\n if (this.inner) {\n this.inner.cursor.moveTo(pos, 1);\n for (let pos = this.inner.cursor.node; pos; pos = pos.parent) {\n let mount = (_a = pos.tree) === null || _a === void 0 ? void 0 : _a.prop(NodeProp.mounted);\n if (mount && mount.parser == parser) {\n for (let i = this.fragI; i < this.fragments.length; i++) {\n let frag = this.fragments[i];\n if (frag.from >= pos.to)\n break;\n if (frag.tree == this.curFrag.tree)\n result.push({\n frag,\n pos: pos.from - frag.offset,\n mount\n });\n }\n }\n }\n }\n return result;\n }\n}\nfunction punchRanges(outer, ranges) {\n let copy = null, current = ranges;\n for (let i = 1, j = 0; i < outer.length; i++) {\n let gapFrom = outer[i - 1].to, gapTo = outer[i].from;\n for (; j < current.length; j++) {\n let r = current[j];\n if (r.from >= gapTo)\n break;\n if (r.to <= gapFrom)\n continue;\n if (!copy)\n current = copy = ranges.slice();\n if (r.from < gapFrom) {\n copy[j] = new Range(r.from, gapFrom);\n if (r.to > gapTo)\n copy.splice(j + 1, 0, new Range(gapTo, r.to));\n }\n else if (r.to > gapTo) {\n copy[j--] = new Range(gapTo, r.to);\n }\n else {\n copy.splice(j--, 1);\n }\n }\n }\n return current;\n}\nfunction findCoverChanges(a, b, from, to) {\n let iA = 0, iB = 0, inA = false, inB = false, pos = -1e9;\n let result = [];\n for (;;) {\n let nextA = iA == a.length ? 1e9 : inA ? a[iA].to : a[iA].from;\n let nextB = iB == b.length ? 1e9 : inB ? b[iB].to : b[iB].from;\n if (inA != inB) {\n let start = Math.max(pos, from), end = Math.min(nextA, nextB, to);\n if (start < end)\n result.push(new Range(start, end));\n }\n pos = Math.min(nextA, nextB);\n if (pos == 1e9)\n break;\n if (nextA == pos) {\n if (!inA)\n inA = true;\n else {\n inA = false;\n iA++;\n }\n }\n if (nextB == pos) {\n if (!inB)\n inB = true;\n else {\n inB = false;\n iB++;\n }\n }\n }\n return result;\n}\n// Given a number of fragments for the outer tree, and a set of ranges\n// to parse, find fragments for inner trees mounted around those\n// ranges, if any.\nfunction enterFragments(mounts, ranges) {\n let result = [];\n for (let { pos, mount, frag } of mounts) {\n let startPos = pos + (mount.overlay ? mount.overlay[0].from : 0), endPos = startPos + mount.tree.length;\n let from = Math.max(frag.from, startPos), to = Math.min(frag.to, endPos);\n if (mount.overlay) {\n let overlay = mount.overlay.map(r => new Range(r.from + pos, r.to + pos));\n let changes = findCoverChanges(ranges, overlay, from, to);\n for (let i = 0, pos = from;; i++) {\n let last = i == changes.length, end = last ? to : changes[i].from;\n if (end > pos)\n result.push(new TreeFragment(pos, end, mount.tree, -startPos, frag.from >= pos || frag.openStart, frag.to <= end || frag.openEnd));\n if (last)\n break;\n pos = changes[i].to;\n }\n }\n else {\n result.push(new TreeFragment(from, to, mount.tree, -startPos, frag.from >= startPos || frag.openStart, frag.to <= endPos || frag.openEnd));\n }\n }\n return result;\n}\n\nexport { DefaultBufferLength, IterMode, MountedTree, NodeProp, NodeSet, NodeType, NodeWeakMap, Parser, Tree, TreeBuffer, TreeCursor, TreeFragment, parseMixed };\n","/**\nThe data structure for documents. @nonabstract\n*/\nclass Text {\n /**\n Get the line description around the given position.\n */\n lineAt(pos) {\n if (pos < 0 || pos > this.length)\n throw new RangeError(`Invalid position ${pos} in document of length ${this.length}`);\n return this.lineInner(pos, false, 1, 0);\n }\n /**\n Get the description for the given (1-based) line number.\n */\n line(n) {\n if (n < 1 || n > this.lines)\n throw new RangeError(`Invalid line number ${n} in ${this.lines}-line document`);\n return this.lineInner(n, true, 1, 0);\n }\n /**\n Replace a range of the text with the given content.\n */\n replace(from, to, text) {\n [from, to] = clip(this, from, to);\n let parts = [];\n this.decompose(0, from, parts, 2 /* Open.To */);\n if (text.length)\n text.decompose(0, text.length, parts, 1 /* Open.From */ | 2 /* Open.To */);\n this.decompose(to, this.length, parts, 1 /* Open.From */);\n return TextNode.from(parts, this.length - (to - from) + text.length);\n }\n /**\n Append another document to this one.\n */\n append(other) {\n return this.replace(this.length, this.length, other);\n }\n /**\n Retrieve the text between the given points.\n */\n slice(from, to = this.length) {\n [from, to] = clip(this, from, to);\n let parts = [];\n this.decompose(from, to, parts, 0);\n return TextNode.from(parts, to - from);\n }\n /**\n Test whether this text is equal to another instance.\n */\n eq(other) {\n if (other == this)\n return true;\n if (other.length != this.length || other.lines != this.lines)\n return false;\n let start = this.scanIdentical(other, 1), end = this.length - this.scanIdentical(other, -1);\n let a = new RawTextCursor(this), b = new RawTextCursor(other);\n for (let skip = start, pos = start;;) {\n a.next(skip);\n b.next(skip);\n skip = 0;\n if (a.lineBreak != b.lineBreak || a.done != b.done || a.value != b.value)\n return false;\n pos += a.value.length;\n if (a.done || pos >= end)\n return true;\n }\n }\n /**\n Iterate over the text. When `dir` is `-1`, iteration happens\n from end to start. This will return lines and the breaks between\n them as separate strings.\n */\n iter(dir = 1) { return new RawTextCursor(this, dir); }\n /**\n Iterate over a range of the text. When `from` > `to`, the\n iterator will run in reverse.\n */\n iterRange(from, to = this.length) { return new PartialTextCursor(this, from, to); }\n /**\n Return a cursor that iterates over the given range of lines,\n _without_ returning the line breaks between, and yielding empty\n strings for empty lines.\n \n When `from` and `to` are given, they should be 1-based line numbers.\n */\n iterLines(from, to) {\n let inner;\n if (from == null) {\n inner = this.iter();\n }\n else {\n if (to == null)\n to = this.lines + 1;\n let start = this.line(from).from;\n inner = this.iterRange(start, Math.max(start, to == this.lines + 1 ? this.length : to <= 1 ? 0 : this.line(to - 1).to));\n }\n return new LineCursor(inner);\n }\n /**\n Return the document as a string, using newline characters to\n separate lines.\n */\n toString() { return this.sliceString(0); }\n /**\n Convert the document to an array of lines (which can be\n deserialized again via [`Text.of`](https://codemirror.net/6/docs/ref/#state.Text^of)).\n */\n toJSON() {\n let lines = [];\n this.flatten(lines);\n return lines;\n }\n /**\n @internal\n */\n constructor() { }\n /**\n Create a `Text` instance for the given array of lines.\n */\n static of(text) {\n if (text.length == 0)\n throw new RangeError(\"A document must have at least one line\");\n if (text.length == 1 && !text[0])\n return Text.empty;\n return text.length <= 32 /* Tree.Branch */ ? new TextLeaf(text) : TextNode.from(TextLeaf.split(text, []));\n }\n}\n// Leaves store an array of line strings. There are always line breaks\n// between these strings. Leaves are limited in size and have to be\n// contained in TextNode instances for bigger documents.\nclass TextLeaf extends Text {\n constructor(text, length = textLength(text)) {\n super();\n this.text = text;\n this.length = length;\n }\n get lines() { return this.text.length; }\n get children() { return null; }\n lineInner(target, isLine, line, offset) {\n for (let i = 0;; i++) {\n let string = this.text[i], end = offset + string.length;\n if ((isLine ? line : end) >= target)\n return new Line(offset, end, line, string);\n offset = end + 1;\n line++;\n }\n }\n decompose(from, to, target, open) {\n let text = from <= 0 && to >= this.length ? this\n : new TextLeaf(sliceText(this.text, from, to), Math.min(to, this.length) - Math.max(0, from));\n if (open & 1 /* Open.From */) {\n let prev = target.pop();\n let joined = appendText(text.text, prev.text.slice(), 0, text.length);\n if (joined.length <= 32 /* Tree.Branch */) {\n target.push(new TextLeaf(joined, prev.length + text.length));\n }\n else {\n let mid = joined.length >> 1;\n target.push(new TextLeaf(joined.slice(0, mid)), new TextLeaf(joined.slice(mid)));\n }\n }\n else {\n target.push(text);\n }\n }\n replace(from, to, text) {\n if (!(text instanceof TextLeaf))\n return super.replace(from, to, text);\n [from, to] = clip(this, from, to);\n let lines = appendText(this.text, appendText(text.text, sliceText(this.text, 0, from)), to);\n let newLen = this.length + text.length - (to - from);\n if (lines.length <= 32 /* Tree.Branch */)\n return new TextLeaf(lines, newLen);\n return TextNode.from(TextLeaf.split(lines, []), newLen);\n }\n sliceString(from, to = this.length, lineSep = \"\\n\") {\n [from, to] = clip(this, from, to);\n let result = \"\";\n for (let pos = 0, i = 0; pos <= to && i < this.text.length; i++) {\n let line = this.text[i], end = pos + line.length;\n if (pos > from && i)\n result += lineSep;\n if (from < end && to > pos)\n result += line.slice(Math.max(0, from - pos), to - pos);\n pos = end + 1;\n }\n return result;\n }\n flatten(target) {\n for (let line of this.text)\n target.push(line);\n }\n scanIdentical() { return 0; }\n static split(text, target) {\n let part = [], len = -1;\n for (let line of text) {\n part.push(line);\n len += line.length + 1;\n if (part.length == 32 /* Tree.Branch */) {\n target.push(new TextLeaf(part, len));\n part = [];\n len = -1;\n }\n }\n if (len > -1)\n target.push(new TextLeaf(part, len));\n return target;\n }\n}\n// Nodes provide the tree structure of the `Text` type. They store a\n// number of other nodes or leaves, taking care to balance themselves\n// on changes. There are implied line breaks _between_ the children of\n// a node (but not before the first or after the last child).\nclass TextNode extends Text {\n constructor(children, length) {\n super();\n this.children = children;\n this.length = length;\n this.lines = 0;\n for (let child of children)\n this.lines += child.lines;\n }\n lineInner(target, isLine, line, offset) {\n for (let i = 0;; i++) {\n let child = this.children[i], end = offset + child.length, endLine = line + child.lines - 1;\n if ((isLine ? endLine : end) >= target)\n return child.lineInner(target, isLine, line, offset);\n offset = end + 1;\n line = endLine + 1;\n }\n }\n decompose(from, to, target, open) {\n for (let i = 0, pos = 0; pos <= to && i < this.children.length; i++) {\n let child = this.children[i], end = pos + child.length;\n if (from <= end && to >= pos) {\n let childOpen = open & ((pos <= from ? 1 /* Open.From */ : 0) | (end >= to ? 2 /* Open.To */ : 0));\n if (pos >= from && end <= to && !childOpen)\n target.push(child);\n else\n child.decompose(from - pos, to - pos, target, childOpen);\n }\n pos = end + 1;\n }\n }\n replace(from, to, text) {\n [from, to] = clip(this, from, to);\n if (text.lines < this.lines)\n for (let i = 0, pos = 0; i < this.children.length; i++) {\n let child = this.children[i], end = pos + child.length;\n // Fast path: if the change only affects one child and the\n // child's size remains in the acceptable range, only update\n // that child\n if (from >= pos && to <= end) {\n let updated = child.replace(from - pos, to - pos, text);\n let totalLines = this.lines - child.lines + updated.lines;\n if (updated.lines < (totalLines >> (5 /* Tree.BranchShift */ - 1)) &&\n updated.lines > (totalLines >> (5 /* Tree.BranchShift */ + 1))) {\n let copy = this.children.slice();\n copy[i] = updated;\n return new TextNode(copy, this.length - (to - from) + text.length);\n }\n return super.replace(pos, end, updated);\n }\n pos = end + 1;\n }\n return super.replace(from, to, text);\n }\n sliceString(from, to = this.length, lineSep = \"\\n\") {\n [from, to] = clip(this, from, to);\n let result = \"\";\n for (let i = 0, pos = 0; i < this.children.length && pos <= to; i++) {\n let child = this.children[i], end = pos + child.length;\n if (pos > from && i)\n result += lineSep;\n if (from < end && to > pos)\n result += child.sliceString(from - pos, to - pos, lineSep);\n pos = end + 1;\n }\n return result;\n }\n flatten(target) {\n for (let child of this.children)\n child.flatten(target);\n }\n scanIdentical(other, dir) {\n if (!(other instanceof TextNode))\n return 0;\n let length = 0;\n let [iA, iB, eA, eB] = dir > 0 ? [0, 0, this.children.length, other.children.length]\n : [this.children.length - 1, other.children.length - 1, -1, -1];\n for (;; iA += dir, iB += dir) {\n if (iA == eA || iB == eB)\n return length;\n let chA = this.children[iA], chB = other.children[iB];\n if (chA != chB)\n return length + chA.scanIdentical(chB, dir);\n length += chA.length + 1;\n }\n }\n static from(children, length = children.reduce((l, ch) => l + ch.length + 1, -1)) {\n let lines = 0;\n for (let ch of children)\n lines += ch.lines;\n if (lines < 32 /* Tree.Branch */) {\n let flat = [];\n for (let ch of children)\n ch.flatten(flat);\n return new TextLeaf(flat, length);\n }\n let chunk = Math.max(32 /* Tree.Branch */, lines >> 5 /* Tree.BranchShift */), maxChunk = chunk << 1, minChunk = chunk >> 1;\n let chunked = [], currentLines = 0, currentLen = -1, currentChunk = [];\n function add(child) {\n let last;\n if (child.lines > maxChunk && child instanceof TextNode) {\n for (let node of child.children)\n add(node);\n }\n else if (child.lines > minChunk && (currentLines > minChunk || !currentLines)) {\n flush();\n chunked.push(child);\n }\n else if (child instanceof TextLeaf && currentLines &&\n (last = currentChunk[currentChunk.length - 1]) instanceof TextLeaf &&\n child.lines + last.lines <= 32 /* Tree.Branch */) {\n currentLines += child.lines;\n currentLen += child.length + 1;\n currentChunk[currentChunk.length - 1] = new TextLeaf(last.text.concat(child.text), last.length + 1 + child.length);\n }\n else {\n if (currentLines + child.lines > chunk)\n flush();\n currentLines += child.lines;\n currentLen += child.length + 1;\n currentChunk.push(child);\n }\n }\n function flush() {\n if (currentLines == 0)\n return;\n chunked.push(currentChunk.length == 1 ? currentChunk[0] : TextNode.from(currentChunk, currentLen));\n currentLen = -1;\n currentLines = currentChunk.length = 0;\n }\n for (let child of children)\n add(child);\n flush();\n return chunked.length == 1 ? chunked[0] : new TextNode(chunked, length);\n }\n}\nText.empty = /*@__PURE__*/new TextLeaf([\"\"], 0);\nfunction textLength(text) {\n let length = -1;\n for (let line of text)\n length += line.length + 1;\n return length;\n}\nfunction appendText(text, target, from = 0, to = 1e9) {\n for (let pos = 0, i = 0, first = true; i < text.length && pos <= to; i++) {\n let line = text[i], end = pos + line.length;\n if (end >= from) {\n if (end > to)\n line = line.slice(0, to - pos);\n if (pos < from)\n line = line.slice(from - pos);\n if (first) {\n target[target.length - 1] += line;\n first = false;\n }\n else\n target.push(line);\n }\n pos = end + 1;\n }\n return target;\n}\nfunction sliceText(text, from, to) {\n return appendText(text, [\"\"], from, to);\n}\nclass RawTextCursor {\n constructor(text, dir = 1) {\n this.dir = dir;\n this.done = false;\n this.lineBreak = false;\n this.value = \"\";\n this.nodes = [text];\n this.offsets = [dir > 0 ? 1 : (text instanceof TextLeaf ? text.text.length : text.children.length) << 1];\n }\n nextInner(skip, dir) {\n this.done = this.lineBreak = false;\n for (;;) {\n let last = this.nodes.length - 1;\n let top = this.nodes[last], offsetValue = this.offsets[last], offset = offsetValue >> 1;\n let size = top instanceof TextLeaf ? top.text.length : top.children.length;\n if (offset == (dir > 0 ? size : 0)) {\n if (last == 0) {\n this.done = true;\n this.value = \"\";\n return this;\n }\n if (dir > 0)\n this.offsets[last - 1]++;\n this.nodes.pop();\n this.offsets.pop();\n }\n else if ((offsetValue & 1) == (dir > 0 ? 0 : 1)) {\n this.offsets[last] += dir;\n if (skip == 0) {\n this.lineBreak = true;\n this.value = \"\\n\";\n return this;\n }\n skip--;\n }\n else if (top instanceof TextLeaf) {\n // Move to the next string\n let next = top.text[offset + (dir < 0 ? -1 : 0)];\n this.offsets[last] += dir;\n if (next.length > Math.max(0, skip)) {\n this.value = skip == 0 ? next : dir > 0 ? next.slice(skip) : next.slice(0, next.length - skip);\n return this;\n }\n skip -= next.length;\n }\n else {\n let next = top.children[offset + (dir < 0 ? -1 : 0)];\n if (skip > next.length) {\n skip -= next.length;\n this.offsets[last] += dir;\n }\n else {\n if (dir < 0)\n this.offsets[last]--;\n this.nodes.push(next);\n this.offsets.push(dir > 0 ? 1 : (next instanceof TextLeaf ? next.text.length : next.children.length) << 1);\n }\n }\n }\n }\n next(skip = 0) {\n if (skip < 0) {\n this.nextInner(-skip, (-this.dir));\n skip = this.value.length;\n }\n return this.nextInner(skip, this.dir);\n }\n}\nclass PartialTextCursor {\n constructor(text, start, end) {\n this.value = \"\";\n this.done = false;\n this.cursor = new RawTextCursor(text, start > end ? -1 : 1);\n this.pos = start > end ? text.length : 0;\n this.from = Math.min(start, end);\n this.to = Math.max(start, end);\n }\n nextInner(skip, dir) {\n if (dir < 0 ? this.pos <= this.from : this.pos >= this.to) {\n this.value = \"\";\n this.done = true;\n return this;\n }\n skip += Math.max(0, dir < 0 ? this.pos - this.to : this.from - this.pos);\n let limit = dir < 0 ? this.pos - this.from : this.to - this.pos;\n if (skip > limit)\n skip = limit;\n limit -= skip;\n let { value } = this.cursor.next(skip);\n this.pos += (value.length + skip) * dir;\n this.value = value.length <= limit ? value : dir < 0 ? value.slice(value.length - limit) : value.slice(0, limit);\n this.done = !this.value;\n return this;\n }\n next(skip = 0) {\n if (skip < 0)\n skip = Math.max(skip, this.from - this.pos);\n else if (skip > 0)\n skip = Math.min(skip, this.to - this.pos);\n return this.nextInner(skip, this.cursor.dir);\n }\n get lineBreak() { return this.cursor.lineBreak && this.value != \"\"; }\n}\nclass LineCursor {\n constructor(inner) {\n this.inner = inner;\n this.afterBreak = true;\n this.value = \"\";\n this.done = false;\n }\n next(skip = 0) {\n let { done, lineBreak, value } = this.inner.next(skip);\n if (done && this.afterBreak) {\n this.value = \"\";\n this.afterBreak = false;\n }\n else if (done) {\n this.done = true;\n this.value = \"\";\n }\n else if (lineBreak) {\n if (this.afterBreak) {\n this.value = \"\";\n }\n else {\n this.afterBreak = true;\n this.next();\n }\n }\n else {\n this.value = value;\n this.afterBreak = false;\n }\n return this;\n }\n get lineBreak() { return false; }\n}\nif (typeof Symbol != \"undefined\") {\n Text.prototype[Symbol.iterator] = function () { return this.iter(); };\n RawTextCursor.prototype[Symbol.iterator] = PartialTextCursor.prototype[Symbol.iterator] =\n LineCursor.prototype[Symbol.iterator] = function () { return this; };\n}\n/**\nThis type describes a line in the document. It is created\non-demand when lines are [queried](https://codemirror.net/6/docs/ref/#state.Text.lineAt).\n*/\nclass Line {\n /**\n @internal\n */\n constructor(\n /**\n The position of the start of the line.\n */\n from, \n /**\n The position at the end of the line (_before_ the line break,\n or at the end of document for the last line).\n */\n to, \n /**\n This line's line number (1-based).\n */\n number, \n /**\n The line's content.\n */\n text) {\n this.from = from;\n this.to = to;\n this.number = number;\n this.text = text;\n }\n /**\n The length of the line (not including any line break after it).\n */\n get length() { return this.to - this.from; }\n}\nfunction clip(text, from, to) {\n from = Math.max(0, Math.min(text.length, from));\n return [from, Math.max(from, Math.min(text.length, to))];\n}\n\n// Compressed representation of the Grapheme_Cluster_Break=Extend\n// information from\n// http://www.unicode.org/Public/13.0.0/ucd/auxiliary/GraphemeBreakProperty.txt.\n// Each pair of elements represents a range, as an offet from the\n// previous range and a length. Numbers are in base-36, with the empty\n// string being a shorthand for 1.\nlet extend = /*@__PURE__*/\"lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,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i++)\n extend[i] += extend[i - 1];\nfunction isExtendingChar(code) {\n for (let i = 1; i < extend.length; i += 2)\n if (extend[i] > code)\n return extend[i - 1] <= code;\n return false;\n}\nfunction isRegionalIndicator(code) {\n return code >= 0x1F1E6 && code <= 0x1F1FF;\n}\nconst ZWJ = 0x200d;\n/**\nReturns a next grapheme cluster break _after_ (not equal to)\n`pos`, if `forward` is true, or before otherwise. Returns `pos`\nitself if no further cluster break is available in the string.\nMoves across surrogate pairs, extending characters (when\n`includeExtending` is true), characters joined with zero-width\njoiners, and flag emoji.\n*/\nfunction findClusterBreak(str, pos, forward = true, includeExtending = true) {\n return (forward ? nextClusterBreak : prevClusterBreak)(str, pos, includeExtending);\n}\nfunction nextClusterBreak(str, pos, includeExtending) {\n if (pos == str.length)\n return pos;\n // If pos is in the middle of a surrogate pair, move to its start\n if (pos && surrogateLow(str.charCodeAt(pos)) && surrogateHigh(str.charCodeAt(pos - 1)))\n pos--;\n let prev = codePointAt(str, pos);\n pos += codePointSize(prev);\n while (pos < str.length) {\n let next = codePointAt(str, pos);\n if (prev == ZWJ || next == ZWJ || includeExtending && isExtendingChar(next)) {\n pos += codePointSize(next);\n prev = next;\n }\n else if (isRegionalIndicator(next)) {\n let countBefore = 0, i = pos - 2;\n while (i >= 0 && isRegionalIndicator(codePointAt(str, i))) {\n countBefore++;\n i -= 2;\n }\n if (countBefore % 2 == 0)\n break;\n else\n pos += 2;\n }\n else {\n break;\n }\n }\n return pos;\n}\nfunction prevClusterBreak(str, pos, includeExtending) {\n while (pos > 0) {\n let found = nextClusterBreak(str, pos - 2, includeExtending);\n if (found < pos)\n return found;\n pos--;\n }\n return 0;\n}\nfunction surrogateLow(ch) { return ch >= 0xDC00 && ch < 0xE000; }\nfunction surrogateHigh(ch) { return ch >= 0xD800 && ch < 0xDC00; }\n/**\nFind the code point at the given position in a string (like the\n[`codePointAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt)\nstring method).\n*/\nfunction codePointAt(str, pos) {\n let code0 = str.charCodeAt(pos);\n if (!surrogateHigh(code0) || pos + 1 == str.length)\n return code0;\n let code1 = str.charCodeAt(pos + 1);\n if (!surrogateLow(code1))\n return code0;\n return ((code0 - 0xd800) << 10) + (code1 - 0xdc00) + 0x10000;\n}\n/**\nGiven a Unicode codepoint, return the JavaScript string that\nrespresents it (like\n[`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)).\n*/\nfunction fromCodePoint(code) {\n if (code <= 0xffff)\n return String.fromCharCode(code);\n code -= 0x10000;\n return String.fromCharCode((code >> 10) + 0xd800, (code & 1023) + 0xdc00);\n}\n/**\nThe amount of positions a character takes up a JavaScript string.\n*/\nfunction codePointSize(code) { return code < 0x10000 ? 1 : 2; }\n\nconst DefaultSplit = /\\r\\n?|\\n/;\n/**\nDistinguishes different ways in which positions can be mapped.\n*/\nvar MapMode = /*@__PURE__*/(function (MapMode) {\n /**\n Map a position to a valid new position, even when its context\n was deleted.\n */\n MapMode[MapMode[\"Simple\"] = 0] = \"Simple\";\n /**\n Return null if deletion happens across the position.\n */\n MapMode[MapMode[\"TrackDel\"] = 1] = \"TrackDel\";\n /**\n Return null if the character _before_ the position is deleted.\n */\n MapMode[MapMode[\"TrackBefore\"] = 2] = \"TrackBefore\";\n /**\n Return null if the character _after_ the position is deleted.\n */\n MapMode[MapMode[\"TrackAfter\"] = 3] = \"TrackAfter\";\nreturn MapMode})(MapMode || (MapMode = {}));\n/**\nA change description is a variant of [change set](https://codemirror.net/6/docs/ref/#state.ChangeSet)\nthat doesn't store the inserted text. As such, it can't be\napplied, but is cheaper to store and manipulate.\n*/\nclass ChangeDesc {\n // Sections are encoded as pairs of integers. The first is the\n // length in the current document, and the second is -1 for\n // unaffected sections, and the length of the replacement content\n // otherwise. So an insertion would be (0, n>0), a deletion (n>0,\n // 0), and a replacement two positive numbers.\n /**\n @internal\n */\n constructor(\n /**\n @internal\n */\n sections) {\n this.sections = sections;\n }\n /**\n The length of the document before the change.\n */\n get length() {\n let result = 0;\n for (let i = 0; i < this.sections.length; i += 2)\n result += this.sections[i];\n return result;\n }\n /**\n The length of the document after the change.\n */\n get newLength() {\n let result = 0;\n for (let i = 0; i < this.sections.length; i += 2) {\n let ins = this.sections[i + 1];\n result += ins < 0 ? this.sections[i] : ins;\n }\n return result;\n }\n /**\n False when there are actual changes in this set.\n */\n get empty() { return this.sections.length == 0 || this.sections.length == 2 && this.sections[1] < 0; }\n /**\n Iterate over the unchanged parts left by these changes. `posA`\n provides the position of the range in the old document, `posB`\n the new position in the changed document.\n */\n iterGaps(f) {\n for (let i = 0, posA = 0, posB = 0; i < this.sections.length;) {\n let len = this.sections[i++], ins = this.sections[i++];\n if (ins < 0) {\n f(posA, posB, len);\n posB += len;\n }\n else {\n posB += ins;\n }\n posA += len;\n }\n }\n /**\n Iterate over the ranges changed by these changes. (See\n [`ChangeSet.iterChanges`](https://codemirror.net/6/docs/ref/#state.ChangeSet.iterChanges) for a\n variant that also provides you with the inserted text.)\n `fromA`/`toA` provides the extent of the change in the starting\n document, `fromB`/`toB` the extent of the replacement in the\n changed document.\n \n When `individual` is true, adjacent changes (which are kept\n separate for [position mapping](https://codemirror.net/6/docs/ref/#state.ChangeDesc.mapPos)) are\n reported separately.\n */\n iterChangedRanges(f, individual = false) {\n iterChanges(this, f, individual);\n }\n /**\n Get a description of the inverted form of these changes.\n */\n get invertedDesc() {\n let sections = [];\n for (let i = 0; i < this.sections.length;) {\n let len = this.sections[i++], ins = this.sections[i++];\n if (ins < 0)\n sections.push(len, ins);\n else\n sections.push(ins, len);\n }\n return new ChangeDesc(sections);\n }\n /**\n Compute the combined effect of applying another set of changes\n after this one. The length of the document after this set should\n match the length before `other`.\n */\n composeDesc(other) { return this.empty ? other : other.empty ? this : composeSets(this, other); }\n /**\n Map this description, which should start with the same document\n as `other`, over another set of changes, so that it can be\n applied after it. When `before` is true, map as if the changes\n in `other` happened before the ones in `this`.\n */\n mapDesc(other, before = false) { return other.empty ? this : mapSet(this, other, before); }\n mapPos(pos, assoc = -1, mode = MapMode.Simple) {\n let posA = 0, posB = 0;\n for (let i = 0; i < this.sections.length;) {\n let len = this.sections[i++], ins = this.sections[i++], endA = posA + len;\n if (ins < 0) {\n if (endA > pos)\n return posB + (pos - posA);\n posB += len;\n }\n else {\n if (mode != MapMode.Simple && endA >= pos &&\n (mode == MapMode.TrackDel && posA < pos && endA > pos ||\n mode == MapMode.TrackBefore && posA < pos ||\n mode == MapMode.TrackAfter && endA > pos))\n return null;\n if (endA > pos || endA == pos && assoc < 0 && !len)\n return pos == posA || assoc < 0 ? posB : posB + ins;\n posB += ins;\n }\n posA = endA;\n }\n if (pos > posA)\n throw new RangeError(`Position ${pos} is out of range for changeset of length ${posA}`);\n return posB;\n }\n /**\n Check whether these changes touch a given range. When one of the\n changes entirely covers the range, the string `\"cover\"` is\n returned.\n */\n touchesRange(from, to = from) {\n for (let i = 0, pos = 0; i < this.sections.length && pos <= to;) {\n let len = this.sections[i++], ins = this.sections[i++], end = pos + len;\n if (ins >= 0 && pos <= to && end >= from)\n return pos < from && end > to ? \"cover\" : true;\n pos = end;\n }\n return false;\n }\n /**\n @internal\n */\n toString() {\n let result = \"\";\n for (let i = 0; i < this.sections.length;) {\n let len = this.sections[i++], ins = this.sections[i++];\n result += (result ? \" \" : \"\") + len + (ins >= 0 ? \":\" + ins : \"\");\n }\n return result;\n }\n /**\n Serialize this change desc to a JSON-representable value.\n */\n toJSON() { return this.sections; }\n /**\n Create a change desc from its JSON representation (as produced\n by [`toJSON`](https://codemirror.net/6/docs/ref/#state.ChangeDesc.toJSON).\n */\n static fromJSON(json) {\n if (!Array.isArray(json) || json.length % 2 || json.some(a => typeof a != \"number\"))\n throw new RangeError(\"Invalid JSON representation of ChangeDesc\");\n return new ChangeDesc(json);\n }\n /**\n @internal\n */\n static create(sections) { return new ChangeDesc(sections); }\n}\n/**\nA change set represents a group of modifications to a document. It\nstores the document length, and can only be applied to documents\nwith exactly that length.\n*/\nclass ChangeSet extends ChangeDesc {\n constructor(sections, \n /**\n @internal\n */\n inserted) {\n super(sections);\n this.inserted = inserted;\n }\n /**\n Apply the changes to a document, returning the modified\n document.\n */\n apply(doc) {\n if (this.length != doc.length)\n throw new RangeError(\"Applying change set to a document with the wrong length\");\n iterChanges(this, (fromA, toA, fromB, _toB, text) => doc = doc.replace(fromB, fromB + (toA - fromA), text), false);\n return doc;\n }\n mapDesc(other, before = false) { return mapSet(this, other, before, true); }\n /**\n Given the document as it existed _before_ the changes, return a\n change set that represents the inverse of this set, which could\n be used to go from the document created by the changes back to\n the document as it existed before the changes.\n */\n invert(doc) {\n let sections = this.sections.slice(), inserted = [];\n for (let i = 0, pos = 0; i < sections.length; i += 2) {\n let len = sections[i], ins = sections[i + 1];\n if (ins >= 0) {\n sections[i] = ins;\n sections[i + 1] = len;\n let index = i >> 1;\n while (inserted.length < index)\n inserted.push(Text.empty);\n inserted.push(len ? doc.slice(pos, pos + len) : Text.empty);\n }\n pos += len;\n }\n return new ChangeSet(sections, inserted);\n }\n /**\n Combine two subsequent change sets into a single set. `other`\n must start in the document produced by `this`. If `this` goes\n `docA` → `docB` and `other` represents `docB` → `docC`, the\n returned value will represent the change `docA` → `docC`.\n */\n compose(other) { return this.empty ? other : other.empty ? this : composeSets(this, other, true); }\n /**\n Given another change set starting in the same document, maps this\n change set over the other, producing a new change set that can be\n applied to the document produced by applying `other`. When\n `before` is `true`, order changes as if `this` comes before\n `other`, otherwise (the default) treat `other` as coming first.\n \n Given two changes `A` and `B`, `A.compose(B.map(A))` and\n `B.compose(A.map(B, true))` will produce the same document. This\n provides a basic form of [operational\n transformation](https://en.wikipedia.org/wiki/Operational_transformation),\n and can be used for collaborative editing.\n */\n map(other, before = false) { return other.empty ? this : mapSet(this, other, before, true); }\n /**\n Iterate over the changed ranges in the document, calling `f` for\n each, with the range in the original document (`fromA`-`toA`)\n and the range that replaces it in the new document\n (`fromB`-`toB`).\n \n When `individual` is true, adjacent changes are reported\n separately.\n */\n iterChanges(f, individual = false) {\n iterChanges(this, f, individual);\n }\n /**\n Get a [change description](https://codemirror.net/6/docs/ref/#state.ChangeDesc) for this change\n set.\n */\n get desc() { return ChangeDesc.create(this.sections); }\n /**\n @internal\n */\n filter(ranges) {\n let resultSections = [], resultInserted = [], filteredSections = [];\n let iter = new SectionIter(this);\n done: for (let i = 0, pos = 0;;) {\n let next = i == ranges.length ? 1e9 : ranges[i++];\n while (pos < next || pos == next && iter.len == 0) {\n if (iter.done)\n break done;\n let len = Math.min(iter.len, next - pos);\n addSection(filteredSections, len, -1);\n let ins = iter.ins == -1 ? -1 : iter.off == 0 ? iter.ins : 0;\n addSection(resultSections, len, ins);\n if (ins > 0)\n addInsert(resultInserted, resultSections, iter.text);\n iter.forward(len);\n pos += len;\n }\n let end = ranges[i++];\n while (pos < end) {\n if (iter.done)\n break done;\n let len = Math.min(iter.len, end - pos);\n addSection(resultSections, len, -1);\n addSection(filteredSections, len, iter.ins == -1 ? -1 : iter.off == 0 ? iter.ins : 0);\n iter.forward(len);\n pos += len;\n }\n }\n return { changes: new ChangeSet(resultSections, resultInserted),\n filtered: ChangeDesc.create(filteredSections) };\n }\n /**\n Serialize this change set to a JSON-representable value.\n */\n toJSON() {\n let parts = [];\n for (let i = 0; i < this.sections.length; i += 2) {\n let len = this.sections[i], ins = this.sections[i + 1];\n if (ins < 0)\n parts.push(len);\n else if (ins == 0)\n parts.push([len]);\n else\n parts.push([len].concat(this.inserted[i >> 1].toJSON()));\n }\n return parts;\n }\n /**\n Create a change set for the given changes, for a document of the\n given length, using `lineSep` as line separator.\n */\n static of(changes, length, lineSep) {\n let sections = [], inserted = [], pos = 0;\n let total = null;\n function flush(force = false) {\n if (!force && !sections.length)\n return;\n if (pos < length)\n addSection(sections, length - pos, -1);\n let set = new ChangeSet(sections, inserted);\n total = total ? total.compose(set.map(total)) : set;\n sections = [];\n inserted = [];\n pos = 0;\n }\n function process(spec) {\n if (Array.isArray(spec)) {\n for (let sub of spec)\n process(sub);\n }\n else if (spec instanceof ChangeSet) {\n if (spec.length != length)\n throw new RangeError(`Mismatched change set length (got ${spec.length}, expected ${length})`);\n flush();\n total = total ? total.compose(spec.map(total)) : spec;\n }\n else {\n let { from, to = from, insert } = spec;\n if (from > to || from < 0 || to > length)\n throw new RangeError(`Invalid change range ${from} to ${to} (in doc of length ${length})`);\n let insText = !insert ? Text.empty : typeof insert == \"string\" ? Text.of(insert.split(lineSep || DefaultSplit)) : insert;\n let insLen = insText.length;\n if (from == to && insLen == 0)\n return;\n if (from < pos)\n flush();\n if (from > pos)\n addSection(sections, from - pos, -1);\n addSection(sections, to - from, insLen);\n addInsert(inserted, sections, insText);\n pos = to;\n }\n }\n process(changes);\n flush(!total);\n return total;\n }\n /**\n Create an empty changeset of the given length.\n */\n static empty(length) {\n return new ChangeSet(length ? [length, -1] : [], []);\n }\n /**\n Create a changeset from its JSON representation (as produced by\n [`toJSON`](https://codemirror.net/6/docs/ref/#state.ChangeSet.toJSON).\n */\n static fromJSON(json) {\n if (!Array.isArray(json))\n throw new RangeError(\"Invalid JSON representation of ChangeSet\");\n let sections = [], inserted = [];\n for (let i = 0; i < json.length; i++) {\n let part = json[i];\n if (typeof part == \"number\") {\n sections.push(part, -1);\n }\n else if (!Array.isArray(part) || typeof part[0] != \"number\" || part.some((e, i) => i && typeof e != \"string\")) {\n throw new RangeError(\"Invalid JSON representation of ChangeSet\");\n }\n else if (part.length == 1) {\n sections.push(part[0], 0);\n }\n else {\n while (inserted.length < i)\n inserted.push(Text.empty);\n inserted[i] = Text.of(part.slice(1));\n sections.push(part[0], inserted[i].length);\n }\n }\n return new ChangeSet(sections, inserted);\n }\n /**\n @internal\n */\n static createSet(sections, inserted) {\n return new ChangeSet(sections, inserted);\n }\n}\nfunction addSection(sections, len, ins, forceJoin = false) {\n if (len == 0 && ins <= 0)\n return;\n let last = sections.length - 2;\n if (last >= 0 && ins <= 0 && ins == sections[last + 1])\n sections[last] += len;\n else if (len == 0 && sections[last] == 0)\n sections[last + 1] += ins;\n else if (forceJoin) {\n sections[last] += len;\n sections[last + 1] += ins;\n }\n else\n sections.push(len, ins);\n}\nfunction addInsert(values, sections, value) {\n if (value.length == 0)\n return;\n let index = (sections.length - 2) >> 1;\n if (index < values.length) {\n values[values.length - 1] = values[values.length - 1].append(value);\n }\n else {\n while (values.length < index)\n values.push(Text.empty);\n values.push(value);\n }\n}\nfunction iterChanges(desc, f, individual) {\n let inserted = desc.inserted;\n for (let posA = 0, posB = 0, i = 0; i < desc.sections.length;) {\n let len = desc.sections[i++], ins = desc.sections[i++];\n if (ins < 0) {\n posA += len;\n posB += len;\n }\n else {\n let endA = posA, endB = posB, text = Text.empty;\n for (;;) {\n endA += len;\n endB += ins;\n if (ins && inserted)\n text = text.append(inserted[(i - 2) >> 1]);\n if (individual || i == desc.sections.length || desc.sections[i + 1] < 0)\n break;\n len = desc.sections[i++];\n ins = desc.sections[i++];\n }\n f(posA, endA, posB, endB, text);\n posA = endA;\n posB = endB;\n }\n }\n}\nfunction mapSet(setA, setB, before, mkSet = false) {\n // Produce a copy of setA that applies to the document after setB\n // has been applied (assuming both start at the same document).\n let sections = [], insert = mkSet ? [] : null;\n let a = new SectionIter(setA), b = new SectionIter(setB);\n // Iterate over both sets in parallel. inserted tracks, for changes\n // in A that have to be processed piece-by-piece, whether their\n // content has been inserted already, and refers to the section\n // index.\n for (let inserted = -1;;) {\n if (a.ins == -1 && b.ins == -1) {\n // Move across ranges skipped by both sets.\n let len = Math.min(a.len, b.len);\n addSection(sections, len, -1);\n a.forward(len);\n b.forward(len);\n }\n else if (b.ins >= 0 && (a.ins < 0 || inserted == a.i || a.off == 0 && (b.len < a.len || b.len == a.len && !before))) {\n // If there's a change in B that comes before the next change in\n // A (ordered by start pos, then len, then before flag), skip\n // that (and process any changes in A it covers).\n let len = b.len;\n addSection(sections, b.ins, -1);\n while (len) {\n let piece = Math.min(a.len, len);\n if (a.ins >= 0 && inserted < a.i && a.len <= piece) {\n addSection(sections, 0, a.ins);\n if (insert)\n addInsert(insert, sections, a.text);\n inserted = a.i;\n }\n a.forward(piece);\n len -= piece;\n }\n b.next();\n }\n else if (a.ins >= 0) {\n // Process the part of a change in A up to the start of the next\n // non-deletion change in B (if overlapping).\n let len = 0, left = a.len;\n while (left) {\n if (b.ins == -1) {\n let piece = Math.min(left, b.len);\n len += piece;\n left -= piece;\n b.forward(piece);\n }\n else if (b.ins == 0 && b.len < left) {\n left -= b.len;\n b.next();\n }\n else {\n break;\n }\n }\n addSection(sections, len, inserted < a.i ? a.ins : 0);\n if (insert && inserted < a.i)\n addInsert(insert, sections, a.text);\n inserted = a.i;\n a.forward(a.len - left);\n }\n else if (a.done && b.done) {\n return insert ? ChangeSet.createSet(sections, insert) : ChangeDesc.create(sections);\n }\n else {\n throw new Error(\"Mismatched change set lengths\");\n }\n }\n}\nfunction composeSets(setA, setB, mkSet = false) {\n let sections = [];\n let insert = mkSet ? [] : null;\n let a = new SectionIter(setA), b = new SectionIter(setB);\n for (let open = false;;) {\n if (a.done && b.done) {\n return insert ? ChangeSet.createSet(sections, insert) : ChangeDesc.create(sections);\n }\n else if (a.ins == 0) { // Deletion in A\n addSection(sections, a.len, 0, open);\n a.next();\n }\n else if (b.len == 0 && !b.done) { // Insertion in B\n addSection(sections, 0, b.ins, open);\n if (insert)\n addInsert(insert, sections, b.text);\n b.next();\n }\n else if (a.done || b.done) {\n throw new Error(\"Mismatched change set lengths\");\n }\n else {\n let len = Math.min(a.len2, b.len), sectionLen = sections.length;\n if (a.ins == -1) {\n let insB = b.ins == -1 ? -1 : b.off ? 0 : b.ins;\n addSection(sections, len, insB, open);\n if (insert && insB)\n addInsert(insert, sections, b.text);\n }\n else if (b.ins == -1) {\n addSection(sections, a.off ? 0 : a.len, len, open);\n if (insert)\n addInsert(insert, sections, a.textBit(len));\n }\n else {\n addSection(sections, a.off ? 0 : a.len, b.off ? 0 : b.ins, open);\n if (insert && !b.off)\n addInsert(insert, sections, b.text);\n }\n open = (a.ins > len || b.ins >= 0 && b.len > len) && (open || sections.length > sectionLen);\n a.forward2(len);\n b.forward(len);\n }\n }\n}\nclass SectionIter {\n constructor(set) {\n this.set = set;\n this.i = 0;\n this.next();\n }\n next() {\n let { sections } = this.set;\n if (this.i < sections.length) {\n this.len = sections[this.i++];\n this.ins = sections[this.i++];\n }\n else {\n this.len = 0;\n this.ins = -2;\n }\n this.off = 0;\n }\n get done() { return this.ins == -2; }\n get len2() { return this.ins < 0 ? this.len : this.ins; }\n get text() {\n let { inserted } = this.set, index = (this.i - 2) >> 1;\n return index >= inserted.length ? Text.empty : inserted[index];\n }\n textBit(len) {\n let { inserted } = this.set, index = (this.i - 2) >> 1;\n return index >= inserted.length && !len ? Text.empty\n : inserted[index].slice(this.off, len == null ? undefined : this.off + len);\n }\n forward(len) {\n if (len == this.len)\n this.next();\n else {\n this.len -= len;\n this.off += len;\n }\n }\n forward2(len) {\n if (this.ins == -1)\n this.forward(len);\n else if (len == this.ins)\n this.next();\n else {\n this.ins -= len;\n this.off += len;\n }\n }\n}\n\n/**\nA single selection range. When\n[`allowMultipleSelections`](https://codemirror.net/6/docs/ref/#state.EditorState^allowMultipleSelections)\nis enabled, a [selection](https://codemirror.net/6/docs/ref/#state.EditorSelection) may hold\nmultiple ranges. By default, selections hold exactly one range.\n*/\nclass SelectionRange {\n constructor(\n /**\n The lower boundary of the range.\n */\n from, \n /**\n The upper boundary of the range.\n */\n to, flags) {\n this.from = from;\n this.to = to;\n this.flags = flags;\n }\n /**\n The anchor of the range—the side that doesn't move when you\n extend it.\n */\n get anchor() { return this.flags & 32 /* RangeFlag.Inverted */ ? this.to : this.from; }\n /**\n The head of the range, which is moved when the range is\n [extended](https://codemirror.net/6/docs/ref/#state.SelectionRange.extend).\n */\n get head() { return this.flags & 32 /* RangeFlag.Inverted */ ? this.from : this.to; }\n /**\n True when `anchor` and `head` are at the same position.\n */\n get empty() { return this.from == this.to; }\n /**\n If this is a cursor that is explicitly associated with the\n character on one of its sides, this returns the side. -1 means\n the character before its position, 1 the character after, and 0\n means no association.\n */\n get assoc() { return this.flags & 8 /* RangeFlag.AssocBefore */ ? -1 : this.flags & 16 /* RangeFlag.AssocAfter */ ? 1 : 0; }\n /**\n The bidirectional text level associated with this cursor, if\n any.\n */\n get bidiLevel() {\n let level = this.flags & 7 /* RangeFlag.BidiLevelMask */;\n return level == 7 ? null : level;\n }\n /**\n The goal column (stored vertical offset) associated with a\n cursor. This is used to preserve the vertical position when\n [moving](https://codemirror.net/6/docs/ref/#view.EditorView.moveVertically) across\n lines of different length.\n */\n get goalColumn() {\n let value = this.flags >> 6 /* RangeFlag.GoalColumnOffset */;\n return value == 16777215 /* RangeFlag.NoGoalColumn */ ? undefined : value;\n }\n /**\n Map this range through a change, producing a valid range in the\n updated document.\n */\n map(change, assoc = -1) {\n let from, to;\n if (this.empty) {\n from = to = change.mapPos(this.from, assoc);\n }\n else {\n from = change.mapPos(this.from, 1);\n to = change.mapPos(this.to, -1);\n }\n return from == this.from && to == this.to ? this : new SelectionRange(from, to, this.flags);\n }\n /**\n Extend this range to cover at least `from` to `to`.\n */\n extend(from, to = from) {\n if (from <= this.anchor && to >= this.anchor)\n return EditorSelection.range(from, to);\n let head = Math.abs(from - this.anchor) > Math.abs(to - this.anchor) ? from : to;\n return EditorSelection.range(this.anchor, head);\n }\n /**\n Compare this range to another range.\n */\n eq(other, includeAssoc = false) {\n return this.anchor == other.anchor && this.head == other.head &&\n (!includeAssoc || !this.empty || this.assoc == other.assoc);\n }\n /**\n Return a JSON-serializable object representing the range.\n */\n toJSON() { return { anchor: this.anchor, head: this.head }; }\n /**\n Convert a JSON representation of a range to a `SelectionRange`\n instance.\n */\n static fromJSON(json) {\n if (!json || typeof json.anchor != \"number\" || typeof json.head != \"number\")\n throw new RangeError(\"Invalid JSON representation for SelectionRange\");\n return EditorSelection.range(json.anchor, json.head);\n }\n /**\n @internal\n */\n static create(from, to, flags) {\n return new SelectionRange(from, to, flags);\n }\n}\n/**\nAn editor selection holds one or more selection ranges.\n*/\nclass EditorSelection {\n constructor(\n /**\n The ranges in the selection, sorted by position. Ranges cannot\n overlap (but they may touch, if they aren't empty).\n */\n ranges, \n /**\n The index of the _main_ range in the selection (which is\n usually the range that was added last).\n */\n mainIndex) {\n this.ranges = ranges;\n this.mainIndex = mainIndex;\n }\n /**\n Map a selection through a change. Used to adjust the selection\n position for changes.\n */\n map(change, assoc = -1) {\n if (change.empty)\n return this;\n return EditorSelection.create(this.ranges.map(r => r.map(change, assoc)), this.mainIndex);\n }\n /**\n Compare this selection to another selection. By default, ranges\n are compared only by position. When `includeAssoc` is true,\n cursor ranges must also have the same\n [`assoc`](https://codemirror.net/6/docs/ref/#state.SelectionRange.assoc) value.\n */\n eq(other, includeAssoc = false) {\n if (this.ranges.length != other.ranges.length ||\n this.mainIndex != other.mainIndex)\n return false;\n for (let i = 0; i < this.ranges.length; i++)\n if (!this.ranges[i].eq(other.ranges[i], includeAssoc))\n return false;\n return true;\n }\n /**\n Get the primary selection range. Usually, you should make sure\n your code applies to _all_ ranges, by using methods like\n [`changeByRange`](https://codemirror.net/6/docs/ref/#state.EditorState.changeByRange).\n */\n get main() { return this.ranges[this.mainIndex]; }\n /**\n Make sure the selection only has one range. Returns a selection\n holding only the main range from this selection.\n */\n asSingle() {\n return this.ranges.length == 1 ? this : new EditorSelection([this.main], 0);\n }\n /**\n Extend this selection with an extra range.\n */\n addRange(range, main = true) {\n return EditorSelection.create([range].concat(this.ranges), main ? 0 : this.mainIndex + 1);\n }\n /**\n Replace a given range with another range, and then normalize the\n selection to merge and sort ranges if necessary.\n */\n replaceRange(range, which = this.mainIndex) {\n let ranges = this.ranges.slice();\n ranges[which] = range;\n return EditorSelection.create(ranges, this.mainIndex);\n }\n /**\n Convert this selection to an object that can be serialized to\n JSON.\n */\n toJSON() {\n return { ranges: this.ranges.map(r => r.toJSON()), main: this.mainIndex };\n }\n /**\n Create a selection from a JSON representation.\n */\n static fromJSON(json) {\n if (!json || !Array.isArray(json.ranges) || typeof json.main != \"number\" || json.main >= json.ranges.length)\n throw new RangeError(\"Invalid JSON representation for EditorSelection\");\n return new EditorSelection(json.ranges.map((r) => SelectionRange.fromJSON(r)), json.main);\n }\n /**\n Create a selection holding a single range.\n */\n static single(anchor, head = anchor) {\n return new EditorSelection([EditorSelection.range(anchor, head)], 0);\n }\n /**\n Sort and merge the given set of ranges, creating a valid\n selection.\n */\n static create(ranges, mainIndex = 0) {\n if (ranges.length == 0)\n throw new RangeError(\"A selection needs at least one range\");\n for (let pos = 0, i = 0; i < ranges.length; i++) {\n let range = ranges[i];\n if (range.empty ? range.from <= pos : range.from < pos)\n return EditorSelection.normalized(ranges.slice(), mainIndex);\n pos = range.to;\n }\n return new EditorSelection(ranges, mainIndex);\n }\n /**\n Create a cursor selection range at the given position. You can\n safely ignore the optional arguments in most situations.\n */\n static cursor(pos, assoc = 0, bidiLevel, goalColumn) {\n return SelectionRange.create(pos, pos, (assoc == 0 ? 0 : assoc < 0 ? 8 /* RangeFlag.AssocBefore */ : 16 /* RangeFlag.AssocAfter */) |\n (bidiLevel == null ? 7 : Math.min(6, bidiLevel)) |\n ((goalColumn !== null && goalColumn !== void 0 ? goalColumn : 16777215 /* RangeFlag.NoGoalColumn */) << 6 /* RangeFlag.GoalColumnOffset */));\n }\n /**\n Create a selection range.\n */\n static range(anchor, head, goalColumn, bidiLevel) {\n let flags = ((goalColumn !== null && goalColumn !== void 0 ? goalColumn : 16777215 /* RangeFlag.NoGoalColumn */) << 6 /* RangeFlag.GoalColumnOffset */) |\n (bidiLevel == null ? 7 : Math.min(6, bidiLevel));\n return head < anchor ? SelectionRange.create(head, anchor, 32 /* RangeFlag.Inverted */ | 16 /* RangeFlag.AssocAfter */ | flags)\n : SelectionRange.create(anchor, head, (head > anchor ? 8 /* RangeFlag.AssocBefore */ : 0) | flags);\n }\n /**\n @internal\n */\n static normalized(ranges, mainIndex = 0) {\n let main = ranges[mainIndex];\n ranges.sort((a, b) => a.from - b.from);\n mainIndex = ranges.indexOf(main);\n for (let i = 1; i < ranges.length; i++) {\n let range = ranges[i], prev = ranges[i - 1];\n if (range.empty ? range.from <= prev.to : range.from < prev.to) {\n let from = prev.from, to = Math.max(range.to, prev.to);\n if (i <= mainIndex)\n mainIndex--;\n ranges.splice(--i, 2, range.anchor > range.head ? EditorSelection.range(to, from) : EditorSelection.range(from, to));\n }\n }\n return new EditorSelection(ranges, mainIndex);\n }\n}\nfunction checkSelection(selection, docLength) {\n for (let range of selection.ranges)\n if (range.to > docLength)\n throw new RangeError(\"Selection points outside of document\");\n}\n\nlet nextID = 0;\n/**\nA facet is a labeled value that is associated with an editor\nstate. It takes inputs from any number of extensions, and combines\nthose into a single output value.\n\nExamples of uses of facets are the [tab\nsize](https://codemirror.net/6/docs/ref/#state.EditorState^tabSize), [editor\nattributes](https://codemirror.net/6/docs/ref/#view.EditorView^editorAttributes), and [update\nlisteners](https://codemirror.net/6/docs/ref/#view.EditorView^updateListener).\n\nNote that `Facet` instances can be used anywhere where\n[`FacetReader`](https://codemirror.net/6/docs/ref/#state.FacetReader) is expected.\n*/\nclass Facet {\n constructor(\n /**\n @internal\n */\n combine, \n /**\n @internal\n */\n compareInput, \n /**\n @internal\n */\n compare, isStatic, enables) {\n this.combine = combine;\n this.compareInput = compareInput;\n this.compare = compare;\n this.isStatic = isStatic;\n /**\n @internal\n */\n this.id = nextID++;\n this.default = combine([]);\n this.extensions = typeof enables == \"function\" ? enables(this) : enables;\n }\n /**\n Returns a facet reader for this facet, which can be used to\n [read](https://codemirror.net/6/docs/ref/#state.EditorState.facet) it but not to define values for it.\n */\n get reader() { return this; }\n /**\n Define a new facet.\n */\n static define(config = {}) {\n return new Facet(config.combine || ((a) => a), config.compareInput || ((a, b) => a === b), config.compare || (!config.combine ? sameArray : (a, b) => a === b), !!config.static, config.enables);\n }\n /**\n Returns an extension that adds the given value to this facet.\n */\n of(value) {\n return new FacetProvider([], this, 0 /* Provider.Static */, value);\n }\n /**\n Create an extension that computes a value for the facet from a\n state. You must take care to declare the parts of the state that\n this value depends on, since your function is only called again\n for a new state when one of those parts changed.\n \n In cases where your value depends only on a single field, you'll\n want to use the [`from`](https://codemirror.net/6/docs/ref/#state.Facet.from) method instead.\n */\n compute(deps, get) {\n if (this.isStatic)\n throw new Error(\"Can't compute a static facet\");\n return new FacetProvider(deps, this, 1 /* Provider.Single */, get);\n }\n /**\n Create an extension that computes zero or more values for this\n facet from a state.\n */\n computeN(deps, get) {\n if (this.isStatic)\n throw new Error(\"Can't compute a static facet\");\n return new FacetProvider(deps, this, 2 /* Provider.Multi */, get);\n }\n from(field, get) {\n if (!get)\n get = x => x;\n return this.compute([field], state => get(state.field(field)));\n }\n}\nfunction sameArray(a, b) {\n return a == b || a.length == b.length && a.every((e, i) => e === b[i]);\n}\nclass FacetProvider {\n constructor(dependencies, facet, type, value) {\n this.dependencies = dependencies;\n this.facet = facet;\n this.type = type;\n this.value = value;\n this.id = nextID++;\n }\n dynamicSlot(addresses) {\n var _a;\n let getter = this.value;\n let compare = this.facet.compareInput;\n let id = this.id, idx = addresses[id] >> 1, multi = this.type == 2 /* Provider.Multi */;\n let depDoc = false, depSel = false, depAddrs = [];\n for (let dep of this.dependencies) {\n if (dep == \"doc\")\n depDoc = true;\n else if (dep == \"selection\")\n depSel = true;\n else if ((((_a = addresses[dep.id]) !== null && _a !== void 0 ? _a : 1) & 1) == 0)\n depAddrs.push(addresses[dep.id]);\n }\n return {\n create(state) {\n state.values[idx] = getter(state);\n return 1 /* SlotStatus.Changed */;\n },\n update(state, tr) {\n if ((depDoc && tr.docChanged) || (depSel && (tr.docChanged || tr.selection)) || ensureAll(state, depAddrs)) {\n let newVal = getter(state);\n if (multi ? !compareArray(newVal, state.values[idx], compare) : !compare(newVal, state.values[idx])) {\n state.values[idx] = newVal;\n return 1 /* SlotStatus.Changed */;\n }\n }\n return 0;\n },\n reconfigure: (state, oldState) => {\n let newVal, oldAddr = oldState.config.address[id];\n if (oldAddr != null) {\n let oldVal = getAddr(oldState, oldAddr);\n if (this.dependencies.every(dep => {\n return dep instanceof Facet ? oldState.facet(dep) === state.facet(dep) :\n dep instanceof StateField ? oldState.field(dep, false) == state.field(dep, false) : true;\n }) || (multi ? compareArray(newVal = getter(state), oldVal, compare) : compare(newVal = getter(state), oldVal))) {\n state.values[idx] = oldVal;\n return 0;\n }\n }\n else {\n newVal = getter(state);\n }\n state.values[idx] = newVal;\n return 1 /* SlotStatus.Changed */;\n }\n };\n }\n}\nfunction compareArray(a, b, compare) {\n if (a.length != b.length)\n return false;\n for (let i = 0; i < a.length; i++)\n if (!compare(a[i], b[i]))\n return false;\n return true;\n}\nfunction ensureAll(state, addrs) {\n let changed = false;\n for (let addr of addrs)\n if (ensureAddr(state, addr) & 1 /* SlotStatus.Changed */)\n changed = true;\n return changed;\n}\nfunction dynamicFacetSlot(addresses, facet, providers) {\n let providerAddrs = providers.map(p => addresses[p.id]);\n let providerTypes = providers.map(p => p.type);\n let dynamic = providerAddrs.filter(p => !(p & 1));\n let idx = addresses[facet.id] >> 1;\n function get(state) {\n let values = [];\n for (let i = 0; i < providerAddrs.length; i++) {\n let value = getAddr(state, providerAddrs[i]);\n if (providerTypes[i] == 2 /* Provider.Multi */)\n for (let val of value)\n values.push(val);\n else\n values.push(value);\n }\n return facet.combine(values);\n }\n return {\n create(state) {\n for (let addr of providerAddrs)\n ensureAddr(state, addr);\n state.values[idx] = get(state);\n return 1 /* SlotStatus.Changed */;\n },\n update(state, tr) {\n if (!ensureAll(state, dynamic))\n return 0;\n let value = get(state);\n if (facet.compare(value, state.values[idx]))\n return 0;\n state.values[idx] = value;\n return 1 /* SlotStatus.Changed */;\n },\n reconfigure(state, oldState) {\n let depChanged = ensureAll(state, providerAddrs);\n let oldProviders = oldState.config.facets[facet.id], oldValue = oldState.facet(facet);\n if (oldProviders && !depChanged && sameArray(providers, oldProviders)) {\n state.values[idx] = oldValue;\n return 0;\n }\n let value = get(state);\n if (facet.compare(value, oldValue)) {\n state.values[idx] = oldValue;\n return 0;\n }\n state.values[idx] = value;\n return 1 /* SlotStatus.Changed */;\n }\n };\n}\nconst initField = /*@__PURE__*/Facet.define({ static: true });\n/**\nFields can store additional information in an editor state, and\nkeep it in sync with the rest of the state.\n*/\nclass StateField {\n constructor(\n /**\n @internal\n */\n id, createF, updateF, compareF, \n /**\n @internal\n */\n spec) {\n this.id = id;\n this.createF = createF;\n this.updateF = updateF;\n this.compareF = compareF;\n this.spec = spec;\n /**\n @internal\n */\n this.provides = undefined;\n }\n /**\n Define a state field.\n */\n static define(config) {\n let field = new StateField(nextID++, config.create, config.update, config.compare || ((a, b) => a === b), config);\n if (config.provide)\n field.provides = config.provide(field);\n return field;\n }\n create(state) {\n let init = state.facet(initField).find(i => i.field == this);\n return ((init === null || init === void 0 ? void 0 : init.create) || this.createF)(state);\n }\n /**\n @internal\n */\n slot(addresses) {\n let idx = addresses[this.id] >> 1;\n return {\n create: (state) => {\n state.values[idx] = this.create(state);\n return 1 /* SlotStatus.Changed */;\n },\n update: (state, tr) => {\n let oldVal = state.values[idx];\n let value = this.updateF(oldVal, tr);\n if (this.compareF(oldVal, value))\n return 0;\n state.values[idx] = value;\n return 1 /* SlotStatus.Changed */;\n },\n reconfigure: (state, oldState) => {\n if (oldState.config.address[this.id] != null) {\n state.values[idx] = oldState.field(this);\n return 0;\n }\n state.values[idx] = this.create(state);\n return 1 /* SlotStatus.Changed */;\n }\n };\n }\n /**\n Returns an extension that enables this field and overrides the\n way it is initialized. Can be useful when you need to provide a\n non-default starting value for the field.\n */\n init(create) {\n return [this, initField.of({ field: this, create })];\n }\n /**\n State field instances can be used as\n [`Extension`](https://codemirror.net/6/docs/ref/#state.Extension) values to enable the field in a\n given state.\n */\n get extension() { return this; }\n}\nconst Prec_ = { lowest: 4, low: 3, default: 2, high: 1, highest: 0 };\nfunction prec(value) {\n return (ext) => new PrecExtension(ext, value);\n}\n/**\nBy default extensions are registered in the order they are found\nin the flattened form of nested array that was provided.\nIndividual extension values can be assigned a precedence to\noverride this. Extensions that do not have a precedence set get\nthe precedence of the nearest parent with a precedence, or\n[`default`](https://codemirror.net/6/docs/ref/#state.Prec.default) if there is no such parent. The\nfinal ordering of extensions is determined by first sorting by\nprecedence and then by order within each precedence.\n*/\nconst Prec = {\n /**\n The highest precedence level, for extensions that should end up\n near the start of the precedence ordering.\n */\n highest: /*@__PURE__*/prec(Prec_.highest),\n /**\n A higher-than-default precedence, for extensions that should\n come before those with default precedence.\n */\n high: /*@__PURE__*/prec(Prec_.high),\n /**\n The default precedence, which is also used for extensions\n without an explicit precedence.\n */\n default: /*@__PURE__*/prec(Prec_.default),\n /**\n A lower-than-default precedence.\n */\n low: /*@__PURE__*/prec(Prec_.low),\n /**\n The lowest precedence level. Meant for things that should end up\n near the end of the extension order.\n */\n lowest: /*@__PURE__*/prec(Prec_.lowest)\n};\nclass PrecExtension {\n constructor(inner, prec) {\n this.inner = inner;\n this.prec = prec;\n }\n}\n/**\nExtension compartments can be used to make a configuration\ndynamic. By [wrapping](https://codemirror.net/6/docs/ref/#state.Compartment.of) part of your\nconfiguration in a compartment, you can later\n[replace](https://codemirror.net/6/docs/ref/#state.Compartment.reconfigure) that part through a\ntransaction.\n*/\nclass Compartment {\n /**\n Create an instance of this compartment to add to your [state\n configuration](https://codemirror.net/6/docs/ref/#state.EditorStateConfig.extensions).\n */\n of(ext) { return new CompartmentInstance(this, ext); }\n /**\n Create an [effect](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) that\n reconfigures this compartment.\n */\n reconfigure(content) {\n return Compartment.reconfigure.of({ compartment: this, extension: content });\n }\n /**\n Get the current content of the compartment in the state, or\n `undefined` if it isn't present.\n */\n get(state) {\n return state.config.compartments.get(this);\n }\n}\nclass CompartmentInstance {\n constructor(compartment, inner) {\n this.compartment = compartment;\n this.inner = inner;\n }\n}\nclass Configuration {\n constructor(base, compartments, dynamicSlots, address, staticValues, facets) {\n this.base = base;\n this.compartments = compartments;\n this.dynamicSlots = dynamicSlots;\n this.address = address;\n this.staticValues = staticValues;\n this.facets = facets;\n this.statusTemplate = [];\n while (this.statusTemplate.length < dynamicSlots.length)\n this.statusTemplate.push(0 /* SlotStatus.Unresolved */);\n }\n staticFacet(facet) {\n let addr = this.address[facet.id];\n return addr == null ? facet.default : this.staticValues[addr >> 1];\n }\n static resolve(base, compartments, oldState) {\n let fields = [];\n let facets = Object.create(null);\n let newCompartments = new Map();\n for (let ext of flatten(base, compartments, newCompartments)) {\n if (ext instanceof StateField)\n fields.push(ext);\n else\n (facets[ext.facet.id] || (facets[ext.facet.id] = [])).push(ext);\n }\n let address = Object.create(null);\n let staticValues = [];\n let dynamicSlots = [];\n for (let field of fields) {\n address[field.id] = dynamicSlots.length << 1;\n dynamicSlots.push(a => field.slot(a));\n }\n let oldFacets = oldState === null || oldState === void 0 ? void 0 : oldState.config.facets;\n for (let id in facets) {\n let providers = facets[id], facet = providers[0].facet;\n let oldProviders = oldFacets && oldFacets[id] || [];\n if (providers.every(p => p.type == 0 /* Provider.Static */)) {\n address[facet.id] = (staticValues.length << 1) | 1;\n if (sameArray(oldProviders, providers)) {\n staticValues.push(oldState.facet(facet));\n }\n else {\n let value = facet.combine(providers.map(p => p.value));\n staticValues.push(oldState && facet.compare(value, oldState.facet(facet)) ? oldState.facet(facet) : value);\n }\n }\n else {\n for (let p of providers) {\n if (p.type == 0 /* Provider.Static */) {\n address[p.id] = (staticValues.length << 1) | 1;\n staticValues.push(p.value);\n }\n else {\n address[p.id] = dynamicSlots.length << 1;\n dynamicSlots.push(a => p.dynamicSlot(a));\n }\n }\n address[facet.id] = dynamicSlots.length << 1;\n dynamicSlots.push(a => dynamicFacetSlot(a, facet, providers));\n }\n }\n let dynamic = dynamicSlots.map(f => f(address));\n return new Configuration(base, newCompartments, dynamic, address, staticValues, facets);\n }\n}\nfunction flatten(extension, compartments, newCompartments) {\n let result = [[], [], [], [], []];\n let seen = new Map();\n function inner(ext, prec) {\n let known = seen.get(ext);\n if (known != null) {\n if (known <= prec)\n return;\n let found = result[known].indexOf(ext);\n if (found > -1)\n result[known].splice(found, 1);\n if (ext instanceof CompartmentInstance)\n newCompartments.delete(ext.compartment);\n }\n seen.set(ext, prec);\n if (Array.isArray(ext)) {\n for (let e of ext)\n inner(e, prec);\n }\n else if (ext instanceof CompartmentInstance) {\n if (newCompartments.has(ext.compartment))\n throw new RangeError(`Duplicate use of compartment in extensions`);\n let content = compartments.get(ext.compartment) || ext.inner;\n newCompartments.set(ext.compartment, content);\n inner(content, prec);\n }\n else if (ext instanceof PrecExtension) {\n inner(ext.inner, ext.prec);\n }\n else if (ext instanceof StateField) {\n result[prec].push(ext);\n if (ext.provides)\n inner(ext.provides, prec);\n }\n else if (ext instanceof FacetProvider) {\n result[prec].push(ext);\n if (ext.facet.extensions)\n inner(ext.facet.extensions, Prec_.default);\n }\n else {\n let content = ext.extension;\n if (!content)\n throw new Error(`Unrecognized extension value in extension set (${ext}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);\n inner(content, prec);\n }\n }\n inner(extension, Prec_.default);\n return result.reduce((a, b) => a.concat(b));\n}\nfunction ensureAddr(state, addr) {\n if (addr & 1)\n return 2 /* SlotStatus.Computed */;\n let idx = addr >> 1;\n let status = state.status[idx];\n if (status == 4 /* SlotStatus.Computing */)\n throw new Error(\"Cyclic dependency between fields and/or facets\");\n if (status & 2 /* SlotStatus.Computed */)\n return status;\n state.status[idx] = 4 /* SlotStatus.Computing */;\n let changed = state.computeSlot(state, state.config.dynamicSlots[idx]);\n return state.status[idx] = 2 /* SlotStatus.Computed */ | changed;\n}\nfunction getAddr(state, addr) {\n return addr & 1 ? state.config.staticValues[addr >> 1] : state.values[addr >> 1];\n}\n\nconst languageData = /*@__PURE__*/Facet.define();\nconst allowMultipleSelections = /*@__PURE__*/Facet.define({\n combine: values => values.some(v => v),\n static: true\n});\nconst lineSeparator = /*@__PURE__*/Facet.define({\n combine: values => values.length ? values[0] : undefined,\n static: true\n});\nconst changeFilter = /*@__PURE__*/Facet.define();\nconst transactionFilter = /*@__PURE__*/Facet.define();\nconst transactionExtender = /*@__PURE__*/Facet.define();\nconst readOnly = /*@__PURE__*/Facet.define({\n combine: values => values.length ? values[0] : false\n});\n\n/**\nAnnotations are tagged values that are used to add metadata to\ntransactions in an extensible way. They should be used to model\nthings that effect the entire transaction (such as its [time\nstamp](https://codemirror.net/6/docs/ref/#state.Transaction^time) or information about its\n[origin](https://codemirror.net/6/docs/ref/#state.Transaction^userEvent)). For effects that happen\n_alongside_ the other changes made by the transaction, [state\neffects](https://codemirror.net/6/docs/ref/#state.StateEffect) are more appropriate.\n*/\nclass Annotation {\n /**\n @internal\n */\n constructor(\n /**\n The annotation type.\n */\n type, \n /**\n The value of this annotation.\n */\n value) {\n this.type = type;\n this.value = value;\n }\n /**\n Define a new type of annotation.\n */\n static define() { return new AnnotationType(); }\n}\n/**\nMarker that identifies a type of [annotation](https://codemirror.net/6/docs/ref/#state.Annotation).\n*/\nclass AnnotationType {\n /**\n Create an instance of this annotation.\n */\n of(value) { return new Annotation(this, value); }\n}\n/**\nRepresentation of a type of state effect. Defined with\n[`StateEffect.define`](https://codemirror.net/6/docs/ref/#state.StateEffect^define).\n*/\nclass StateEffectType {\n /**\n @internal\n */\n constructor(\n // The `any` types in these function types are there to work\n // around TypeScript issue #37631, where the type guard on\n // `StateEffect.is` mysteriously stops working when these properly\n // have type `Value`.\n /**\n @internal\n */\n map) {\n this.map = map;\n }\n /**\n Create a [state effect](https://codemirror.net/6/docs/ref/#state.StateEffect) instance of this\n type.\n */\n of(value) { return new StateEffect(this, value); }\n}\n/**\nState effects can be used to represent additional effects\nassociated with a [transaction](https://codemirror.net/6/docs/ref/#state.Transaction.effects). They\nare often useful to model changes to custom [state\nfields](https://codemirror.net/6/docs/ref/#state.StateField), when those changes aren't implicit in\ndocument or selection changes.\n*/\nclass StateEffect {\n /**\n @internal\n */\n constructor(\n /**\n @internal\n */\n type, \n /**\n The value of this effect.\n */\n value) {\n this.type = type;\n this.value = value;\n }\n /**\n Map this effect through a position mapping. Will return\n `undefined` when that ends up deleting the effect.\n */\n map(mapping) {\n let mapped = this.type.map(this.value, mapping);\n return mapped === undefined ? undefined : mapped == this.value ? this : new StateEffect(this.type, mapped);\n }\n /**\n Tells you whether this effect object is of a given\n [type](https://codemirror.net/6/docs/ref/#state.StateEffectType).\n */\n is(type) { return this.type == type; }\n /**\n Define a new effect type. The type parameter indicates the type\n of values that his effect holds. It should be a type that\n doesn't include `undefined`, since that is used in\n [mapping](https://codemirror.net/6/docs/ref/#state.StateEffect.map) to indicate that an effect is\n removed.\n */\n static define(spec = {}) {\n return new StateEffectType(spec.map || (v => v));\n }\n /**\n Map an array of effects through a change set.\n */\n static mapEffects(effects, mapping) {\n if (!effects.length)\n return effects;\n let result = [];\n for (let effect of effects) {\n let mapped = effect.map(mapping);\n if (mapped)\n result.push(mapped);\n }\n return result;\n }\n}\n/**\nThis effect can be used to reconfigure the root extensions of\nthe editor. Doing this will discard any extensions\n[appended](https://codemirror.net/6/docs/ref/#state.StateEffect^appendConfig), but does not reset\nthe content of [reconfigured](https://codemirror.net/6/docs/ref/#state.Compartment.reconfigure)\ncompartments.\n*/\nStateEffect.reconfigure = /*@__PURE__*/StateEffect.define();\n/**\nAppend extensions to the top-level configuration of the editor.\n*/\nStateEffect.appendConfig = /*@__PURE__*/StateEffect.define();\n/**\nChanges to the editor state are grouped into transactions.\nTypically, a user action creates a single transaction, which may\ncontain any number of document changes, may change the selection,\nor have other effects. Create a transaction by calling\n[`EditorState.update`](https://codemirror.net/6/docs/ref/#state.EditorState.update), or immediately\ndispatch one by calling\n[`EditorView.dispatch`](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch).\n*/\nclass Transaction {\n constructor(\n /**\n The state from which the transaction starts.\n */\n startState, \n /**\n The document changes made by this transaction.\n */\n changes, \n /**\n The selection set by this transaction, or undefined if it\n doesn't explicitly set a selection.\n */\n selection, \n /**\n The effects added to the transaction.\n */\n effects, \n /**\n @internal\n */\n annotations, \n /**\n Whether the selection should be scrolled into view after this\n transaction is dispatched.\n */\n scrollIntoView) {\n this.startState = startState;\n this.changes = changes;\n this.selection = selection;\n this.effects = effects;\n this.annotations = annotations;\n this.scrollIntoView = scrollIntoView;\n /**\n @internal\n */\n this._doc = null;\n /**\n @internal\n */\n this._state = null;\n if (selection)\n checkSelection(selection, changes.newLength);\n if (!annotations.some((a) => a.type == Transaction.time))\n this.annotations = annotations.concat(Transaction.time.of(Date.now()));\n }\n /**\n @internal\n */\n static create(startState, changes, selection, effects, annotations, scrollIntoView) {\n return new Transaction(startState, changes, selection, effects, annotations, scrollIntoView);\n }\n /**\n The new document produced by the transaction. Contrary to\n [`.state`](https://codemirror.net/6/docs/ref/#state.Transaction.state)`.doc`, accessing this won't\n force the entire new state to be computed right away, so it is\n recommended that [transaction\n filters](https://codemirror.net/6/docs/ref/#state.EditorState^transactionFilter) use this getter\n when they need to look at the new document.\n */\n get newDoc() {\n return this._doc || (this._doc = this.changes.apply(this.startState.doc));\n }\n /**\n The new selection produced by the transaction. If\n [`this.selection`](https://codemirror.net/6/docs/ref/#state.Transaction.selection) is undefined,\n this will [map](https://codemirror.net/6/docs/ref/#state.EditorSelection.map) the start state's\n current selection through the changes made by the transaction.\n */\n get newSelection() {\n return this.selection || this.startState.selection.map(this.changes);\n }\n /**\n The new state created by the transaction. Computed on demand\n (but retained for subsequent access), so it is recommended not to\n access it in [transaction\n filters](https://codemirror.net/6/docs/ref/#state.EditorState^transactionFilter) when possible.\n */\n get state() {\n if (!this._state)\n this.startState.applyTransaction(this);\n return this._state;\n }\n /**\n Get the value of the given annotation type, if any.\n */\n annotation(type) {\n for (let ann of this.annotations)\n if (ann.type == type)\n return ann.value;\n return undefined;\n }\n /**\n Indicates whether the transaction changed the document.\n */\n get docChanged() { return !this.changes.empty; }\n /**\n Indicates whether this transaction reconfigures the state\n (through a [configuration compartment](https://codemirror.net/6/docs/ref/#state.Compartment) or\n with a top-level configuration\n [effect](https://codemirror.net/6/docs/ref/#state.StateEffect^reconfigure).\n */\n get reconfigured() { return this.startState.config != this.state.config; }\n /**\n Returns true if the transaction has a [user\n event](https://codemirror.net/6/docs/ref/#state.Transaction^userEvent) annotation that is equal to\n or more specific than `event`. For example, if the transaction\n has `\"select.pointer\"` as user event, `\"select\"` and\n `\"select.pointer\"` will match it.\n */\n isUserEvent(event) {\n let e = this.annotation(Transaction.userEvent);\n return !!(e && (e == event || e.length > event.length && e.slice(0, event.length) == event && e[event.length] == \".\"));\n }\n}\n/**\nAnnotation used to store transaction timestamps. Automatically\nadded to every transaction, holding `Date.now()`.\n*/\nTransaction.time = /*@__PURE__*/Annotation.define();\n/**\nAnnotation used to associate a transaction with a user interface\nevent. Holds a string identifying the event, using a\ndot-separated format to support attaching more specific\ninformation. The events used by the core libraries are:\n\n - `\"input\"` when content is entered\n - `\"input.type\"` for typed input\n - `\"input.type.compose\"` for composition\n - `\"input.paste\"` for pasted input\n - `\"input.drop\"` when adding content with drag-and-drop\n - `\"input.complete\"` when autocompleting\n - `\"delete\"` when the user deletes content\n - `\"delete.selection\"` when deleting the selection\n - `\"delete.forward\"` when deleting forward from the selection\n - `\"delete.backward\"` when deleting backward from the selection\n - `\"delete.cut\"` when cutting to the clipboard\n - `\"move\"` when content is moved\n - `\"move.drop\"` when content is moved within the editor through drag-and-drop\n - `\"select\"` when explicitly changing the selection\n - `\"select.pointer\"` when selecting with a mouse or other pointing device\n - `\"undo\"` and `\"redo\"` for history actions\n\nUse [`isUserEvent`](https://codemirror.net/6/docs/ref/#state.Transaction.isUserEvent) to check\nwhether the annotation matches a given event.\n*/\nTransaction.userEvent = /*@__PURE__*/Annotation.define();\n/**\nAnnotation indicating whether a transaction should be added to\nthe undo history or not.\n*/\nTransaction.addToHistory = /*@__PURE__*/Annotation.define();\n/**\nAnnotation indicating (when present and true) that a transaction\nrepresents a change made by some other actor, not the user. This\nis used, for example, to tag other people's changes in\ncollaborative editing.\n*/\nTransaction.remote = /*@__PURE__*/Annotation.define();\nfunction joinRanges(a, b) {\n let result = [];\n for (let iA = 0, iB = 0;;) {\n let from, to;\n if (iA < a.length && (iB == b.length || b[iB] >= a[iA])) {\n from = a[iA++];\n to = a[iA++];\n }\n else if (iB < b.length) {\n from = b[iB++];\n to = b[iB++];\n }\n else\n return result;\n if (!result.length || result[result.length - 1] < from)\n result.push(from, to);\n else if (result[result.length - 1] < to)\n result[result.length - 1] = to;\n }\n}\nfunction mergeTransaction(a, b, sequential) {\n var _a;\n let mapForA, mapForB, changes;\n if (sequential) {\n mapForA = b.changes;\n mapForB = ChangeSet.empty(b.changes.length);\n changes = a.changes.compose(b.changes);\n }\n else {\n mapForA = b.changes.map(a.changes);\n mapForB = a.changes.mapDesc(b.changes, true);\n changes = a.changes.compose(mapForA);\n }\n return {\n changes,\n selection: b.selection ? b.selection.map(mapForB) : (_a = a.selection) === null || _a === void 0 ? void 0 : _a.map(mapForA),\n effects: StateEffect.mapEffects(a.effects, mapForA).concat(StateEffect.mapEffects(b.effects, mapForB)),\n annotations: a.annotations.length ? a.annotations.concat(b.annotations) : b.annotations,\n scrollIntoView: a.scrollIntoView || b.scrollIntoView\n };\n}\nfunction resolveTransactionInner(state, spec, docSize) {\n let sel = spec.selection, annotations = asArray(spec.annotations);\n if (spec.userEvent)\n annotations = annotations.concat(Transaction.userEvent.of(spec.userEvent));\n return {\n changes: spec.changes instanceof ChangeSet ? spec.changes\n : ChangeSet.of(spec.changes || [], docSize, state.facet(lineSeparator)),\n selection: sel && (sel instanceof EditorSelection ? sel : EditorSelection.single(sel.anchor, sel.head)),\n effects: asArray(spec.effects),\n annotations,\n scrollIntoView: !!spec.scrollIntoView\n };\n}\nfunction resolveTransaction(state, specs, filter) {\n let s = resolveTransactionInner(state, specs.length ? specs[0] : {}, state.doc.length);\n if (specs.length && specs[0].filter === false)\n filter = false;\n for (let i = 1; i < specs.length; i++) {\n if (specs[i].filter === false)\n filter = false;\n let seq = !!specs[i].sequential;\n s = mergeTransaction(s, resolveTransactionInner(state, specs[i], seq ? s.changes.newLength : state.doc.length), seq);\n }\n let tr = Transaction.create(state, s.changes, s.selection, s.effects, s.annotations, s.scrollIntoView);\n return extendTransaction(filter ? filterTransaction(tr) : tr);\n}\n// Finish a transaction by applying filters if necessary.\nfunction filterTransaction(tr) {\n let state = tr.startState;\n // Change filters\n let result = true;\n for (let filter of state.facet(changeFilter)) {\n let value = filter(tr);\n if (value === false) {\n result = false;\n break;\n }\n if (Array.isArray(value))\n result = result === true ? value : joinRanges(result, value);\n }\n if (result !== true) {\n let changes, back;\n if (result === false) {\n back = tr.changes.invertedDesc;\n changes = ChangeSet.empty(state.doc.length);\n }\n else {\n let filtered = tr.changes.filter(result);\n changes = filtered.changes;\n back = filtered.filtered.mapDesc(filtered.changes).invertedDesc;\n }\n tr = Transaction.create(state, changes, tr.selection && tr.selection.map(back), StateEffect.mapEffects(tr.effects, back), tr.annotations, tr.scrollIntoView);\n }\n // Transaction filters\n let filters = state.facet(transactionFilter);\n for (let i = filters.length - 1; i >= 0; i--) {\n let filtered = filters[i](tr);\n if (filtered instanceof Transaction)\n tr = filtered;\n else if (Array.isArray(filtered) && filtered.length == 1 && filtered[0] instanceof Transaction)\n tr = filtered[0];\n else\n tr = resolveTransaction(state, asArray(filtered), false);\n }\n return tr;\n}\nfunction extendTransaction(tr) {\n let state = tr.startState, extenders = state.facet(transactionExtender), spec = tr;\n for (let i = extenders.length - 1; i >= 0; i--) {\n let extension = extenders[i](tr);\n if (extension && Object.keys(extension).length)\n spec = mergeTransaction(spec, resolveTransactionInner(state, extension, tr.changes.newLength), true);\n }\n return spec == tr ? tr : Transaction.create(state, tr.changes, tr.selection, spec.effects, spec.annotations, spec.scrollIntoView);\n}\nconst none = [];\nfunction asArray(value) {\n return value == null ? none : Array.isArray(value) ? value : [value];\n}\n\n/**\nThe categories produced by a [character\ncategorizer](https://codemirror.net/6/docs/ref/#state.EditorState.charCategorizer). These are used\ndo things like selecting by word.\n*/\nvar CharCategory = /*@__PURE__*/(function (CharCategory) {\n /**\n Word characters.\n */\n CharCategory[CharCategory[\"Word\"] = 0] = \"Word\";\n /**\n Whitespace.\n */\n CharCategory[CharCategory[\"Space\"] = 1] = \"Space\";\n /**\n Anything else.\n */\n CharCategory[CharCategory[\"Other\"] = 2] = \"Other\";\nreturn CharCategory})(CharCategory || (CharCategory = {}));\nconst nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\nlet wordChar;\ntry {\n wordChar = /*@__PURE__*/new RegExp(\"[\\\\p{Alphabetic}\\\\p{Number}_]\", \"u\");\n}\ncatch (_) { }\nfunction hasWordChar(str) {\n if (wordChar)\n return wordChar.test(str);\n for (let i = 0; i < str.length; i++) {\n let ch = str[i];\n if (/\\w/.test(ch) || ch > \"\\x80\" && (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)))\n return true;\n }\n return false;\n}\nfunction makeCategorizer(wordChars) {\n return (char) => {\n if (!/\\S/.test(char))\n return CharCategory.Space;\n if (hasWordChar(char))\n return CharCategory.Word;\n for (let i = 0; i < wordChars.length; i++)\n if (char.indexOf(wordChars[i]) > -1)\n return CharCategory.Word;\n return CharCategory.Other;\n };\n}\n\n/**\nThe editor state class is a persistent (immutable) data structure.\nTo update a state, you [create](https://codemirror.net/6/docs/ref/#state.EditorState.update) a\n[transaction](https://codemirror.net/6/docs/ref/#state.Transaction), which produces a _new_ state\ninstance, without modifying the original object.\n\nAs such, _never_ mutate properties of a state directly. That'll\njust break things.\n*/\nclass EditorState {\n constructor(\n /**\n @internal\n */\n config, \n /**\n The current document.\n */\n doc, \n /**\n The current selection.\n */\n selection, \n /**\n @internal\n */\n values, computeSlot, tr) {\n this.config = config;\n this.doc = doc;\n this.selection = selection;\n this.values = values;\n this.status = config.statusTemplate.slice();\n this.computeSlot = computeSlot;\n // Fill in the computed state immediately, so that further queries\n // for it made during the update return this state\n if (tr)\n tr._state = this;\n for (let i = 0; i < this.config.dynamicSlots.length; i++)\n ensureAddr(this, i << 1);\n this.computeSlot = null;\n }\n field(field, require = true) {\n let addr = this.config.address[field.id];\n if (addr == null) {\n if (require)\n throw new RangeError(\"Field is not present in this state\");\n return undefined;\n }\n ensureAddr(this, addr);\n return getAddr(this, addr);\n }\n /**\n Create a [transaction](https://codemirror.net/6/docs/ref/#state.Transaction) that updates this\n state. Any number of [transaction specs](https://codemirror.net/6/docs/ref/#state.TransactionSpec)\n can be passed. Unless\n [`sequential`](https://codemirror.net/6/docs/ref/#state.TransactionSpec.sequential) is set, the\n [changes](https://codemirror.net/6/docs/ref/#state.TransactionSpec.changes) (if any) of each spec\n are assumed to start in the _current_ document (not the document\n produced by previous specs), and its\n [selection](https://codemirror.net/6/docs/ref/#state.TransactionSpec.selection) and\n [effects](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) are assumed to refer\n to the document created by its _own_ changes. The resulting\n transaction contains the combined effect of all the different\n specs. For [selection](https://codemirror.net/6/docs/ref/#state.TransactionSpec.selection), later\n specs take precedence over earlier ones.\n */\n update(...specs) {\n return resolveTransaction(this, specs, true);\n }\n /**\n @internal\n */\n applyTransaction(tr) {\n let conf = this.config, { base, compartments } = conf;\n for (let effect of tr.effects) {\n if (effect.is(Compartment.reconfigure)) {\n if (conf) {\n compartments = new Map;\n conf.compartments.forEach((val, key) => compartments.set(key, val));\n conf = null;\n }\n compartments.set(effect.value.compartment, effect.value.extension);\n }\n else if (effect.is(StateEffect.reconfigure)) {\n conf = null;\n base = effect.value;\n }\n else if (effect.is(StateEffect.appendConfig)) {\n conf = null;\n base = asArray(base).concat(effect.value);\n }\n }\n let startValues;\n if (!conf) {\n conf = Configuration.resolve(base, compartments, this);\n let intermediateState = new EditorState(conf, this.doc, this.selection, conf.dynamicSlots.map(() => null), (state, slot) => slot.reconfigure(state, this), null);\n startValues = intermediateState.values;\n }\n else {\n startValues = tr.startState.values.slice();\n }\n let selection = tr.startState.facet(allowMultipleSelections) ? tr.newSelection : tr.newSelection.asSingle();\n new EditorState(conf, tr.newDoc, selection, startValues, (state, slot) => slot.update(state, tr), tr);\n }\n /**\n Create a [transaction spec](https://codemirror.net/6/docs/ref/#state.TransactionSpec) that\n replaces every selection range with the given content.\n */\n replaceSelection(text) {\n if (typeof text == \"string\")\n text = this.toText(text);\n return this.changeByRange(range => ({ changes: { from: range.from, to: range.to, insert: text },\n range: EditorSelection.cursor(range.from + text.length) }));\n }\n /**\n Create a set of changes and a new selection by running the given\n function for each range in the active selection. The function\n can return an optional set of changes (in the coordinate space\n of the start document), plus an updated range (in the coordinate\n space of the document produced by the call's own changes). This\n method will merge all the changes and ranges into a single\n changeset and selection, and return it as a [transaction\n spec](https://codemirror.net/6/docs/ref/#state.TransactionSpec), which can be passed to\n [`update`](https://codemirror.net/6/docs/ref/#state.EditorState.update).\n */\n changeByRange(f) {\n let sel = this.selection;\n let result1 = f(sel.ranges[0]);\n let changes = this.changes(result1.changes), ranges = [result1.range];\n let effects = asArray(result1.effects);\n for (let i = 1; i < sel.ranges.length; i++) {\n let result = f(sel.ranges[i]);\n let newChanges = this.changes(result.changes), newMapped = newChanges.map(changes);\n for (let j = 0; j < i; j++)\n ranges[j] = ranges[j].map(newMapped);\n let mapBy = changes.mapDesc(newChanges, true);\n ranges.push(result.range.map(mapBy));\n changes = changes.compose(newMapped);\n effects = StateEffect.mapEffects(effects, newMapped).concat(StateEffect.mapEffects(asArray(result.effects), mapBy));\n }\n return {\n changes,\n selection: EditorSelection.create(ranges, sel.mainIndex),\n effects\n };\n }\n /**\n Create a [change set](https://codemirror.net/6/docs/ref/#state.ChangeSet) from the given change\n description, taking the state's document length and line\n separator into account.\n */\n changes(spec = []) {\n if (spec instanceof ChangeSet)\n return spec;\n return ChangeSet.of(spec, this.doc.length, this.facet(EditorState.lineSeparator));\n }\n /**\n Using the state's [line\n separator](https://codemirror.net/6/docs/ref/#state.EditorState^lineSeparator), create a\n [`Text`](https://codemirror.net/6/docs/ref/#state.Text) instance from the given string.\n */\n toText(string) {\n return Text.of(string.split(this.facet(EditorState.lineSeparator) || DefaultSplit));\n }\n /**\n Return the given range of the document as a string.\n */\n sliceDoc(from = 0, to = this.doc.length) {\n return this.doc.sliceString(from, to, this.lineBreak);\n }\n /**\n Get the value of a state [facet](https://codemirror.net/6/docs/ref/#state.Facet).\n */\n facet(facet) {\n let addr = this.config.address[facet.id];\n if (addr == null)\n return facet.default;\n ensureAddr(this, addr);\n return getAddr(this, addr);\n }\n /**\n Convert this state to a JSON-serializable object. When custom\n fields should be serialized, you can pass them in as an object\n mapping property names (in the resulting object, which should\n not use `doc` or `selection`) to fields.\n */\n toJSON(fields) {\n let result = {\n doc: this.sliceDoc(),\n selection: this.selection.toJSON()\n };\n if (fields)\n for (let prop in fields) {\n let value = fields[prop];\n if (value instanceof StateField && this.config.address[value.id] != null)\n result[prop] = value.spec.toJSON(this.field(fields[prop]), this);\n }\n return result;\n }\n /**\n Deserialize a state from its JSON representation. When custom\n fields should be deserialized, pass the same object you passed\n to [`toJSON`](https://codemirror.net/6/docs/ref/#state.EditorState.toJSON) when serializing as\n third argument.\n */\n static fromJSON(json, config = {}, fields) {\n if (!json || typeof json.doc != \"string\")\n throw new RangeError(\"Invalid JSON representation for EditorState\");\n let fieldInit = [];\n if (fields)\n for (let prop in fields) {\n if (Object.prototype.hasOwnProperty.call(json, prop)) {\n let field = fields[prop], value = json[prop];\n fieldInit.push(field.init(state => field.spec.fromJSON(value, state)));\n }\n }\n return EditorState.create({\n doc: json.doc,\n selection: EditorSelection.fromJSON(json.selection),\n extensions: config.extensions ? fieldInit.concat([config.extensions]) : fieldInit\n });\n }\n /**\n Create a new state. You'll usually only need this when\n initializing an editor—updated states are created by applying\n transactions.\n */\n static create(config = {}) {\n let configuration = Configuration.resolve(config.extensions || [], new Map);\n let doc = config.doc instanceof Text ? config.doc\n : Text.of((config.doc || \"\").split(configuration.staticFacet(EditorState.lineSeparator) || DefaultSplit));\n let selection = !config.selection ? EditorSelection.single(0)\n : config.selection instanceof EditorSelection ? config.selection\n : EditorSelection.single(config.selection.anchor, config.selection.head);\n checkSelection(selection, doc.length);\n if (!configuration.staticFacet(allowMultipleSelections))\n selection = selection.asSingle();\n return new EditorState(configuration, doc, selection, configuration.dynamicSlots.map(() => null), (state, slot) => slot.create(state), null);\n }\n /**\n The size (in columns) of a tab in the document, determined by\n the [`tabSize`](https://codemirror.net/6/docs/ref/#state.EditorState^tabSize) facet.\n */\n get tabSize() { return this.facet(EditorState.tabSize); }\n /**\n Get the proper [line-break](https://codemirror.net/6/docs/ref/#state.EditorState^lineSeparator)\n string for this state.\n */\n get lineBreak() { return this.facet(EditorState.lineSeparator) || \"\\n\"; }\n /**\n Returns true when the editor is\n [configured](https://codemirror.net/6/docs/ref/#state.EditorState^readOnly) to be read-only.\n */\n get readOnly() { return this.facet(readOnly); }\n /**\n Look up a translation for the given phrase (via the\n [`phrases`](https://codemirror.net/6/docs/ref/#state.EditorState^phrases) facet), or return the\n original string if no translation is found.\n \n If additional arguments are passed, they will be inserted in\n place of markers like `$1` (for the first value) and `$2`, etc.\n A single `$` is equivalent to `$1`, and `$$` will produce a\n literal dollar sign.\n */\n phrase(phrase, ...insert) {\n for (let map of this.facet(EditorState.phrases))\n if (Object.prototype.hasOwnProperty.call(map, phrase)) {\n phrase = map[phrase];\n break;\n }\n if (insert.length)\n phrase = phrase.replace(/\\$(\\$|\\d*)/g, (m, i) => {\n if (i == \"$\")\n return \"$\";\n let n = +(i || 1);\n return !n || n > insert.length ? m : insert[n - 1];\n });\n return phrase;\n }\n /**\n Find the values for a given language data field, provided by the\n the [`languageData`](https://codemirror.net/6/docs/ref/#state.EditorState^languageData) facet.\n \n Examples of language data fields are...\n \n - [`\"commentTokens\"`](https://codemirror.net/6/docs/ref/#commands.CommentTokens) for specifying\n comment syntax.\n - [`\"autocomplete\"`](https://codemirror.net/6/docs/ref/#autocomplete.autocompletion^config.override)\n for providing language-specific completion sources.\n - [`\"wordChars\"`](https://codemirror.net/6/docs/ref/#state.EditorState.charCategorizer) for adding\n characters that should be considered part of words in this\n language.\n - [`\"closeBrackets\"`](https://codemirror.net/6/docs/ref/#autocomplete.CloseBracketConfig) controls\n bracket closing behavior.\n */\n languageDataAt(name, pos, side = -1) {\n let values = [];\n for (let provider of this.facet(languageData)) {\n for (let result of provider(this, pos, side)) {\n if (Object.prototype.hasOwnProperty.call(result, name))\n values.push(result[name]);\n }\n }\n return values;\n }\n /**\n Return a function that can categorize strings (expected to\n represent a single [grapheme cluster](https://codemirror.net/6/docs/ref/#state.findClusterBreak))\n into one of:\n \n - Word (contains an alphanumeric character or a character\n explicitly listed in the local language's `\"wordChars\"`\n language data, which should be a string)\n - Space (contains only whitespace)\n - Other (anything else)\n */\n charCategorizer(at) {\n return makeCategorizer(this.languageDataAt(\"wordChars\", at).join(\"\"));\n }\n /**\n Find the word at the given position, meaning the range\n containing all [word](https://codemirror.net/6/docs/ref/#state.CharCategory.Word) characters\n around it. If no word characters are adjacent to the position,\n this returns null.\n */\n wordAt(pos) {\n let { text, from, length } = this.doc.lineAt(pos);\n let cat = this.charCategorizer(pos);\n let start = pos - from, end = pos - from;\n while (start > 0) {\n let prev = findClusterBreak(text, start, false);\n if (cat(text.slice(prev, start)) != CharCategory.Word)\n break;\n start = prev;\n }\n while (end < length) {\n let next = findClusterBreak(text, end);\n if (cat(text.slice(end, next)) != CharCategory.Word)\n break;\n end = next;\n }\n return start == end ? null : EditorSelection.range(start + from, end + from);\n }\n}\n/**\nA facet that, when enabled, causes the editor to allow multiple\nranges to be selected. Be careful though, because by default the\neditor relies on the native DOM selection, which cannot handle\nmultiple selections. An extension like\n[`drawSelection`](https://codemirror.net/6/docs/ref/#view.drawSelection) can be used to make\nsecondary selections visible to the user.\n*/\nEditorState.allowMultipleSelections = allowMultipleSelections;\n/**\nConfigures the tab size to use in this state. The first\n(highest-precedence) value of the facet is used. If no value is\ngiven, this defaults to 4.\n*/\nEditorState.tabSize = /*@__PURE__*/Facet.define({\n combine: values => values.length ? values[0] : 4\n});\n/**\nThe line separator to use. By default, any of `\"\\n\"`, `\"\\r\\n\"`\nand `\"\\r\"` is treated as a separator when splitting lines, and\nlines are joined with `\"\\n\"`.\n\nWhen you configure a value here, only that precise separator\nwill be used, allowing you to round-trip documents through the\neditor without normalizing line separators.\n*/\nEditorState.lineSeparator = lineSeparator;\n/**\nThis facet controls the value of the\n[`readOnly`](https://codemirror.net/6/docs/ref/#state.EditorState.readOnly) getter, which is\nconsulted by commands and extensions that implement editing\nfunctionality to determine whether they should apply. It\ndefaults to false, but when its highest-precedence value is\n`true`, such functionality disables itself.\n\nNot to be confused with\n[`EditorView.editable`](https://codemirror.net/6/docs/ref/#view.EditorView^editable), which\ncontrols whether the editor's DOM is set to be editable (and\nthus focusable).\n*/\nEditorState.readOnly = readOnly;\n/**\nRegisters translation phrases. The\n[`phrase`](https://codemirror.net/6/docs/ref/#state.EditorState.phrase) method will look through\nall objects registered with this facet to find translations for\nits argument.\n*/\nEditorState.phrases = /*@__PURE__*/Facet.define({\n compare(a, b) {\n let kA = Object.keys(a), kB = Object.keys(b);\n return kA.length == kB.length && kA.every(k => a[k] == b[k]);\n }\n});\n/**\nA facet used to register [language\ndata](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt) providers.\n*/\nEditorState.languageData = languageData;\n/**\nFacet used to register change filters, which are called for each\ntransaction (unless explicitly\n[disabled](https://codemirror.net/6/docs/ref/#state.TransactionSpec.filter)), and can suppress\npart of the transaction's changes.\n\nSuch a function can return `true` to indicate that it doesn't\nwant to do anything, `false` to completely stop the changes in\nthe transaction, or a set of ranges in which changes should be\nsuppressed. Such ranges are represented as an array of numbers,\nwith each pair of two numbers indicating the start and end of a\nrange. So for example `[10, 20, 100, 110]` suppresses changes\nbetween 10 and 20, and between 100 and 110.\n*/\nEditorState.changeFilter = changeFilter;\n/**\nFacet used to register a hook that gets a chance to update or\nreplace transaction specs before they are applied. This will\nonly be applied for transactions that don't have\n[`filter`](https://codemirror.net/6/docs/ref/#state.TransactionSpec.filter) set to `false`. You\ncan either return a single transaction spec (possibly the input\ntransaction), or an array of specs (which will be combined in\nthe same way as the arguments to\n[`EditorState.update`](https://codemirror.net/6/docs/ref/#state.EditorState.update)).\n\nWhen possible, it is recommended to avoid accessing\n[`Transaction.state`](https://codemirror.net/6/docs/ref/#state.Transaction.state) in a filter,\nsince it will force creation of a state that will then be\ndiscarded again, if the transaction is actually filtered.\n\n(This functionality should be used with care. Indiscriminately\nmodifying transaction is likely to break something or degrade\nthe user experience.)\n*/\nEditorState.transactionFilter = transactionFilter;\n/**\nThis is a more limited form of\n[`transactionFilter`](https://codemirror.net/6/docs/ref/#state.EditorState^transactionFilter),\nwhich can only add\n[annotations](https://codemirror.net/6/docs/ref/#state.TransactionSpec.annotations) and\n[effects](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects). _But_, this type\nof filter runs even if the transaction has disabled regular\n[filtering](https://codemirror.net/6/docs/ref/#state.TransactionSpec.filter), making it suitable\nfor effects that don't need to touch the changes or selection,\nbut do want to process every transaction.\n\nExtenders run _after_ filters, when both are present.\n*/\nEditorState.transactionExtender = transactionExtender;\nCompartment.reconfigure = /*@__PURE__*/StateEffect.define();\n\n/**\nUtility function for combining behaviors to fill in a config\nobject from an array of provided configs. `defaults` should hold\ndefault values for all optional fields in `Config`.\n\nThe function will, by default, error\nwhen a field gets two values that aren't `===`-equal, but you can\nprovide combine functions per field to do something else.\n*/\nfunction combineConfig(configs, defaults, // Should hold only the optional properties of Config, but I haven't managed to express that\ncombine = {}) {\n let result = {};\n for (let config of configs)\n for (let key of Object.keys(config)) {\n let value = config[key], current = result[key];\n if (current === undefined)\n result[key] = value;\n else if (current === value || value === undefined) ; // No conflict\n else if (Object.hasOwnProperty.call(combine, key))\n result[key] = combine[key](current, value);\n else\n throw new Error(\"Config merge conflict for field \" + key);\n }\n for (let key in defaults)\n if (result[key] === undefined)\n result[key] = defaults[key];\n return result;\n}\n\n/**\nEach range is associated with a value, which must inherit from\nthis class.\n*/\nclass RangeValue {\n /**\n Compare this value with another value. Used when comparing\n rangesets. The default implementation compares by identity.\n Unless you are only creating a fixed number of unique instances\n of your value type, it is a good idea to implement this\n properly.\n */\n eq(other) { return this == other; }\n /**\n Create a [range](https://codemirror.net/6/docs/ref/#state.Range) with this value.\n */\n range(from, to = from) { return Range.create(from, to, this); }\n}\nRangeValue.prototype.startSide = RangeValue.prototype.endSide = 0;\nRangeValue.prototype.point = false;\nRangeValue.prototype.mapMode = MapMode.TrackDel;\n/**\nA range associates a value with a range of positions.\n*/\nclass Range {\n constructor(\n /**\n The range's start position.\n */\n from, \n /**\n Its end position.\n */\n to, \n /**\n The value associated with this range.\n */\n value) {\n this.from = from;\n this.to = to;\n this.value = value;\n }\n /**\n @internal\n */\n static create(from, to, value) {\n return new Range(from, to, value);\n }\n}\nfunction cmpRange(a, b) {\n return a.from - b.from || a.value.startSide - b.value.startSide;\n}\nclass Chunk {\n constructor(from, to, value, \n // Chunks are marked with the largest point that occurs\n // in them (or -1 for no points), so that scans that are\n // only interested in points (such as the\n // heightmap-related logic) can skip range-only chunks.\n maxPoint) {\n this.from = from;\n this.to = to;\n this.value = value;\n this.maxPoint = maxPoint;\n }\n get length() { return this.to[this.to.length - 1]; }\n // Find the index of the given position and side. Use the ranges'\n // `from` pos when `end == false`, `to` when `end == true`.\n findIndex(pos, side, end, startAt = 0) {\n let arr = end ? this.to : this.from;\n for (let lo = startAt, hi = arr.length;;) {\n if (lo == hi)\n return lo;\n let mid = (lo + hi) >> 1;\n let diff = arr[mid] - pos || (end ? this.value[mid].endSide : this.value[mid].startSide) - side;\n if (mid == lo)\n return diff >= 0 ? lo : hi;\n if (diff >= 0)\n hi = mid;\n else\n lo = mid + 1;\n }\n }\n between(offset, from, to, f) {\n for (let i = this.findIndex(from, -1000000000 /* C.Far */, true), e = this.findIndex(to, 1000000000 /* C.Far */, false, i); i < e; i++)\n if (f(this.from[i] + offset, this.to[i] + offset, this.value[i]) === false)\n return false;\n }\n map(offset, changes) {\n let value = [], from = [], to = [], newPos = -1, maxPoint = -1;\n for (let i = 0; i < this.value.length; i++) {\n let val = this.value[i], curFrom = this.from[i] + offset, curTo = this.to[i] + offset, newFrom, newTo;\n if (curFrom == curTo) {\n let mapped = changes.mapPos(curFrom, val.startSide, val.mapMode);\n if (mapped == null)\n continue;\n newFrom = newTo = mapped;\n if (val.startSide != val.endSide) {\n newTo = changes.mapPos(curFrom, val.endSide);\n if (newTo < newFrom)\n continue;\n }\n }\n else {\n newFrom = changes.mapPos(curFrom, val.startSide);\n newTo = changes.mapPos(curTo, val.endSide);\n if (newFrom > newTo || newFrom == newTo && val.startSide > 0 && val.endSide <= 0)\n continue;\n }\n if ((newTo - newFrom || val.endSide - val.startSide) < 0)\n continue;\n if (newPos < 0)\n newPos = newFrom;\n if (val.point)\n maxPoint = Math.max(maxPoint, newTo - newFrom);\n value.push(val);\n from.push(newFrom - newPos);\n to.push(newTo - newPos);\n }\n return { mapped: value.length ? new Chunk(from, to, value, maxPoint) : null, pos: newPos };\n }\n}\n/**\nA range set stores a collection of [ranges](https://codemirror.net/6/docs/ref/#state.Range) in a\nway that makes them efficient to [map](https://codemirror.net/6/docs/ref/#state.RangeSet.map) and\n[update](https://codemirror.net/6/docs/ref/#state.RangeSet.update). This is an immutable data\nstructure.\n*/\nclass RangeSet {\n constructor(\n /**\n @internal\n */\n chunkPos, \n /**\n @internal\n */\n chunk, \n /**\n @internal\n */\n nextLayer, \n /**\n @internal\n */\n maxPoint) {\n this.chunkPos = chunkPos;\n this.chunk = chunk;\n this.nextLayer = nextLayer;\n this.maxPoint = maxPoint;\n }\n /**\n @internal\n */\n static create(chunkPos, chunk, nextLayer, maxPoint) {\n return new RangeSet(chunkPos, chunk, nextLayer, maxPoint);\n }\n /**\n @internal\n */\n get length() {\n let last = this.chunk.length - 1;\n return last < 0 ? 0 : Math.max(this.chunkEnd(last), this.nextLayer.length);\n }\n /**\n The number of ranges in the set.\n */\n get size() {\n if (this.isEmpty)\n return 0;\n let size = this.nextLayer.size;\n for (let chunk of this.chunk)\n size += chunk.value.length;\n return size;\n }\n /**\n @internal\n */\n chunkEnd(index) {\n return this.chunkPos[index] + this.chunk[index].length;\n }\n /**\n Update the range set, optionally adding new ranges or filtering\n out existing ones.\n \n (Note: The type parameter is just there as a kludge to work\n around TypeScript variance issues that prevented `RangeSet`\n from being a subtype of `RangeSet` when `X` is a subtype of\n `Y`.)\n */\n update(updateSpec) {\n let { add = [], sort = false, filterFrom = 0, filterTo = this.length } = updateSpec;\n let filter = updateSpec.filter;\n if (add.length == 0 && !filter)\n return this;\n if (sort)\n add = add.slice().sort(cmpRange);\n if (this.isEmpty)\n return add.length ? RangeSet.of(add) : this;\n let cur = new LayerCursor(this, null, -1).goto(0), i = 0, spill = [];\n let builder = new RangeSetBuilder();\n while (cur.value || i < add.length) {\n if (i < add.length && (cur.from - add[i].from || cur.startSide - add[i].value.startSide) >= 0) {\n let range = add[i++];\n if (!builder.addInner(range.from, range.to, range.value))\n spill.push(range);\n }\n else if (cur.rangeIndex == 1 && cur.chunkIndex < this.chunk.length &&\n (i == add.length || this.chunkEnd(cur.chunkIndex) < add[i].from) &&\n (!filter || filterFrom > this.chunkEnd(cur.chunkIndex) || filterTo < this.chunkPos[cur.chunkIndex]) &&\n builder.addChunk(this.chunkPos[cur.chunkIndex], this.chunk[cur.chunkIndex])) {\n cur.nextChunk();\n }\n else {\n if (!filter || filterFrom > cur.to || filterTo < cur.from || filter(cur.from, cur.to, cur.value)) {\n if (!builder.addInner(cur.from, cur.to, cur.value))\n spill.push(Range.create(cur.from, cur.to, cur.value));\n }\n cur.next();\n }\n }\n return builder.finishInner(this.nextLayer.isEmpty && !spill.length ? RangeSet.empty\n : this.nextLayer.update({ add: spill, filter, filterFrom, filterTo }));\n }\n /**\n Map this range set through a set of changes, return the new set.\n */\n map(changes) {\n if (changes.empty || this.isEmpty)\n return this;\n let chunks = [], chunkPos = [], maxPoint = -1;\n for (let i = 0; i < this.chunk.length; i++) {\n let start = this.chunkPos[i], chunk = this.chunk[i];\n let touch = changes.touchesRange(start, start + chunk.length);\n if (touch === false) {\n maxPoint = Math.max(maxPoint, chunk.maxPoint);\n chunks.push(chunk);\n chunkPos.push(changes.mapPos(start));\n }\n else if (touch === true) {\n let { mapped, pos } = chunk.map(start, changes);\n if (mapped) {\n maxPoint = Math.max(maxPoint, mapped.maxPoint);\n chunks.push(mapped);\n chunkPos.push(pos);\n }\n }\n }\n let next = this.nextLayer.map(changes);\n return chunks.length == 0 ? next : new RangeSet(chunkPos, chunks, next || RangeSet.empty, maxPoint);\n }\n /**\n Iterate over the ranges that touch the region `from` to `to`,\n calling `f` for each. There is no guarantee that the ranges will\n be reported in any specific order. When the callback returns\n `false`, iteration stops.\n */\n between(from, to, f) {\n if (this.isEmpty)\n return;\n for (let i = 0; i < this.chunk.length; i++) {\n let start = this.chunkPos[i], chunk = this.chunk[i];\n if (to >= start && from <= start + chunk.length &&\n chunk.between(start, from - start, to - start, f) === false)\n return;\n }\n this.nextLayer.between(from, to, f);\n }\n /**\n Iterate over the ranges in this set, in order, including all\n ranges that end at or after `from`.\n */\n iter(from = 0) {\n return HeapCursor.from([this]).goto(from);\n }\n /**\n @internal\n */\n get isEmpty() { return this.nextLayer == this; }\n /**\n Iterate over the ranges in a collection of sets, in order,\n starting from `from`.\n */\n static iter(sets, from = 0) {\n return HeapCursor.from(sets).goto(from);\n }\n /**\n Iterate over two groups of sets, calling methods on `comparator`\n to notify it of possible differences.\n */\n static compare(oldSets, newSets, \n /**\n This indicates how the underlying data changed between these\n ranges, and is needed to synchronize the iteration.\n */\n textDiff, comparator, \n /**\n Can be used to ignore all non-point ranges, and points below\n the given size. When -1, all ranges are compared.\n */\n minPointSize = -1) {\n let a = oldSets.filter(set => set.maxPoint > 0 || !set.isEmpty && set.maxPoint >= minPointSize);\n let b = newSets.filter(set => set.maxPoint > 0 || !set.isEmpty && set.maxPoint >= minPointSize);\n let sharedChunks = findSharedChunks(a, b, textDiff);\n let sideA = new SpanCursor(a, sharedChunks, minPointSize);\n let sideB = new SpanCursor(b, sharedChunks, minPointSize);\n textDiff.iterGaps((fromA, fromB, length) => compare(sideA, fromA, sideB, fromB, length, comparator));\n if (textDiff.empty && textDiff.length == 0)\n compare(sideA, 0, sideB, 0, 0, comparator);\n }\n /**\n Compare the contents of two groups of range sets, returning true\n if they are equivalent in the given range.\n */\n static eq(oldSets, newSets, from = 0, to) {\n if (to == null)\n to = 1000000000 /* C.Far */ - 1;\n let a = oldSets.filter(set => !set.isEmpty && newSets.indexOf(set) < 0);\n let b = newSets.filter(set => !set.isEmpty && oldSets.indexOf(set) < 0);\n if (a.length != b.length)\n return false;\n if (!a.length)\n return true;\n let sharedChunks = findSharedChunks(a, b);\n let sideA = new SpanCursor(a, sharedChunks, 0).goto(from), sideB = new SpanCursor(b, sharedChunks, 0).goto(from);\n for (;;) {\n if (sideA.to != sideB.to ||\n !sameValues(sideA.active, sideB.active) ||\n sideA.point && (!sideB.point || !sideA.point.eq(sideB.point)))\n return false;\n if (sideA.to > to)\n return true;\n sideA.next();\n sideB.next();\n }\n }\n /**\n Iterate over a group of range sets at the same time, notifying\n the iterator about the ranges covering every given piece of\n content. Returns the open count (see\n [`SpanIterator.span`](https://codemirror.net/6/docs/ref/#state.SpanIterator.span)) at the end\n of the iteration.\n */\n static spans(sets, from, to, iterator, \n /**\n When given and greater than -1, only points of at least this\n size are taken into account.\n */\n minPointSize = -1) {\n let cursor = new SpanCursor(sets, null, minPointSize).goto(from), pos = from;\n let openRanges = cursor.openStart;\n for (;;) {\n let curTo = Math.min(cursor.to, to);\n if (cursor.point) {\n let active = cursor.activeForPoint(cursor.to);\n let openCount = cursor.pointFrom < from ? active.length + 1\n : cursor.point.startSide < 0 ? active.length\n : Math.min(active.length, openRanges);\n iterator.point(pos, curTo, cursor.point, active, openCount, cursor.pointRank);\n openRanges = Math.min(cursor.openEnd(curTo), active.length);\n }\n else if (curTo > pos) {\n iterator.span(pos, curTo, cursor.active, openRanges);\n openRanges = cursor.openEnd(curTo);\n }\n if (cursor.to > to)\n return openRanges + (cursor.point && cursor.to > to ? 1 : 0);\n pos = cursor.to;\n cursor.next();\n }\n }\n /**\n Create a range set for the given range or array of ranges. By\n default, this expects the ranges to be _sorted_ (by start\n position and, if two start at the same position,\n `value.startSide`). You can pass `true` as second argument to\n cause the method to sort them.\n */\n static of(ranges, sort = false) {\n let build = new RangeSetBuilder();\n for (let range of ranges instanceof Range ? [ranges] : sort ? lazySort(ranges) : ranges)\n build.add(range.from, range.to, range.value);\n return build.finish();\n }\n /**\n Join an array of range sets into a single set.\n */\n static join(sets) {\n if (!sets.length)\n return RangeSet.empty;\n let result = sets[sets.length - 1];\n for (let i = sets.length - 2; i >= 0; i--) {\n for (let layer = sets[i]; layer != RangeSet.empty; layer = layer.nextLayer)\n result = new RangeSet(layer.chunkPos, layer.chunk, result, Math.max(layer.maxPoint, result.maxPoint));\n }\n return result;\n }\n}\n/**\nThe empty set of ranges.\n*/\nRangeSet.empty = /*@__PURE__*/new RangeSet([], [], null, -1);\nfunction lazySort(ranges) {\n if (ranges.length > 1)\n for (let prev = ranges[0], i = 1; i < ranges.length; i++) {\n let cur = ranges[i];\n if (cmpRange(prev, cur) > 0)\n return ranges.slice().sort(cmpRange);\n prev = cur;\n }\n return ranges;\n}\nRangeSet.empty.nextLayer = RangeSet.empty;\n/**\nA range set builder is a data structure that helps build up a\n[range set](https://codemirror.net/6/docs/ref/#state.RangeSet) directly, without first allocating\nan array of [`Range`](https://codemirror.net/6/docs/ref/#state.Range) objects.\n*/\nclass RangeSetBuilder {\n finishChunk(newArrays) {\n this.chunks.push(new Chunk(this.from, this.to, this.value, this.maxPoint));\n this.chunkPos.push(this.chunkStart);\n this.chunkStart = -1;\n this.setMaxPoint = Math.max(this.setMaxPoint, this.maxPoint);\n this.maxPoint = -1;\n if (newArrays) {\n this.from = [];\n this.to = [];\n this.value = [];\n }\n }\n /**\n Create an empty builder.\n */\n constructor() {\n this.chunks = [];\n this.chunkPos = [];\n this.chunkStart = -1;\n this.last = null;\n this.lastFrom = -1000000000 /* C.Far */;\n this.lastTo = -1000000000 /* C.Far */;\n this.from = [];\n this.to = [];\n this.value = [];\n this.maxPoint = -1;\n this.setMaxPoint = -1;\n this.nextLayer = null;\n }\n /**\n Add a range. Ranges should be added in sorted (by `from` and\n `value.startSide`) order.\n */\n add(from, to, value) {\n if (!this.addInner(from, to, value))\n (this.nextLayer || (this.nextLayer = new RangeSetBuilder)).add(from, to, value);\n }\n /**\n @internal\n */\n addInner(from, to, value) {\n let diff = from - this.lastTo || value.startSide - this.last.endSide;\n if (diff <= 0 && (from - this.lastFrom || value.startSide - this.last.startSide) < 0)\n throw new Error(\"Ranges must be added sorted by `from` position and `startSide`\");\n if (diff < 0)\n return false;\n if (this.from.length == 250 /* C.ChunkSize */)\n this.finishChunk(true);\n if (this.chunkStart < 0)\n this.chunkStart = from;\n this.from.push(from - this.chunkStart);\n this.to.push(to - this.chunkStart);\n this.last = value;\n this.lastFrom = from;\n this.lastTo = to;\n this.value.push(value);\n if (value.point)\n this.maxPoint = Math.max(this.maxPoint, to - from);\n return true;\n }\n /**\n @internal\n */\n addChunk(from, chunk) {\n if ((from - this.lastTo || chunk.value[0].startSide - this.last.endSide) < 0)\n return false;\n if (this.from.length)\n this.finishChunk(true);\n this.setMaxPoint = Math.max(this.setMaxPoint, chunk.maxPoint);\n this.chunks.push(chunk);\n this.chunkPos.push(from);\n let last = chunk.value.length - 1;\n this.last = chunk.value[last];\n this.lastFrom = chunk.from[last] + from;\n this.lastTo = chunk.to[last] + from;\n return true;\n }\n /**\n Finish the range set. Returns the new set. The builder can't be\n used anymore after this has been called.\n */\n finish() { return this.finishInner(RangeSet.empty); }\n /**\n @internal\n */\n finishInner(next) {\n if (this.from.length)\n this.finishChunk(false);\n if (this.chunks.length == 0)\n return next;\n let result = RangeSet.create(this.chunkPos, this.chunks, this.nextLayer ? this.nextLayer.finishInner(next) : next, this.setMaxPoint);\n this.from = null; // Make sure further `add` calls produce errors\n return result;\n }\n}\nfunction findSharedChunks(a, b, textDiff) {\n let inA = new Map();\n for (let set of a)\n for (let i = 0; i < set.chunk.length; i++)\n if (set.chunk[i].maxPoint <= 0)\n inA.set(set.chunk[i], set.chunkPos[i]);\n let shared = new Set();\n for (let set of b)\n for (let i = 0; i < set.chunk.length; i++) {\n let known = inA.get(set.chunk[i]);\n if (known != null && (textDiff ? textDiff.mapPos(known) : known) == set.chunkPos[i] &&\n !(textDiff === null || textDiff === void 0 ? void 0 : textDiff.touchesRange(known, known + set.chunk[i].length)))\n shared.add(set.chunk[i]);\n }\n return shared;\n}\nclass LayerCursor {\n constructor(layer, skip, minPoint, rank = 0) {\n this.layer = layer;\n this.skip = skip;\n this.minPoint = minPoint;\n this.rank = rank;\n }\n get startSide() { return this.value ? this.value.startSide : 0; }\n get endSide() { return this.value ? this.value.endSide : 0; }\n goto(pos, side = -1000000000 /* C.Far */) {\n this.chunkIndex = this.rangeIndex = 0;\n this.gotoInner(pos, side, false);\n return this;\n }\n gotoInner(pos, side, forward) {\n while (this.chunkIndex < this.layer.chunk.length) {\n let next = this.layer.chunk[this.chunkIndex];\n if (!(this.skip && this.skip.has(next) ||\n this.layer.chunkEnd(this.chunkIndex) < pos ||\n next.maxPoint < this.minPoint))\n break;\n this.chunkIndex++;\n forward = false;\n }\n if (this.chunkIndex < this.layer.chunk.length) {\n let rangeIndex = this.layer.chunk[this.chunkIndex].findIndex(pos - this.layer.chunkPos[this.chunkIndex], side, true);\n if (!forward || this.rangeIndex < rangeIndex)\n this.setRangeIndex(rangeIndex);\n }\n this.next();\n }\n forward(pos, side) {\n if ((this.to - pos || this.endSide - side) < 0)\n this.gotoInner(pos, side, true);\n }\n next() {\n for (;;) {\n if (this.chunkIndex == this.layer.chunk.length) {\n this.from = this.to = 1000000000 /* C.Far */;\n this.value = null;\n break;\n }\n else {\n let chunkPos = this.layer.chunkPos[this.chunkIndex], chunk = this.layer.chunk[this.chunkIndex];\n let from = chunkPos + chunk.from[this.rangeIndex];\n this.from = from;\n this.to = chunkPos + chunk.to[this.rangeIndex];\n this.value = chunk.value[this.rangeIndex];\n this.setRangeIndex(this.rangeIndex + 1);\n if (this.minPoint < 0 || this.value.point && this.to - this.from >= this.minPoint)\n break;\n }\n }\n }\n setRangeIndex(index) {\n if (index == this.layer.chunk[this.chunkIndex].value.length) {\n this.chunkIndex++;\n if (this.skip) {\n while (this.chunkIndex < this.layer.chunk.length && this.skip.has(this.layer.chunk[this.chunkIndex]))\n this.chunkIndex++;\n }\n this.rangeIndex = 0;\n }\n else {\n this.rangeIndex = index;\n }\n }\n nextChunk() {\n this.chunkIndex++;\n this.rangeIndex = 0;\n this.next();\n }\n compare(other) {\n return this.from - other.from || this.startSide - other.startSide || this.rank - other.rank ||\n this.to - other.to || this.endSide - other.endSide;\n }\n}\nclass HeapCursor {\n constructor(heap) {\n this.heap = heap;\n }\n static from(sets, skip = null, minPoint = -1) {\n let heap = [];\n for (let i = 0; i < sets.length; i++) {\n for (let cur = sets[i]; !cur.isEmpty; cur = cur.nextLayer) {\n if (cur.maxPoint >= minPoint)\n heap.push(new LayerCursor(cur, skip, minPoint, i));\n }\n }\n return heap.length == 1 ? heap[0] : new HeapCursor(heap);\n }\n get startSide() { return this.value ? this.value.startSide : 0; }\n goto(pos, side = -1000000000 /* C.Far */) {\n for (let cur of this.heap)\n cur.goto(pos, side);\n for (let i = this.heap.length >> 1; i >= 0; i--)\n heapBubble(this.heap, i);\n this.next();\n return this;\n }\n forward(pos, side) {\n for (let cur of this.heap)\n cur.forward(pos, side);\n for (let i = this.heap.length >> 1; i >= 0; i--)\n heapBubble(this.heap, i);\n if ((this.to - pos || this.value.endSide - side) < 0)\n this.next();\n }\n next() {\n if (this.heap.length == 0) {\n this.from = this.to = 1000000000 /* C.Far */;\n this.value = null;\n this.rank = -1;\n }\n else {\n let top = this.heap[0];\n this.from = top.from;\n this.to = top.to;\n this.value = top.value;\n this.rank = top.rank;\n if (top.value)\n top.next();\n heapBubble(this.heap, 0);\n }\n }\n}\nfunction heapBubble(heap, index) {\n for (let cur = heap[index];;) {\n let childIndex = (index << 1) + 1;\n if (childIndex >= heap.length)\n break;\n let child = heap[childIndex];\n if (childIndex + 1 < heap.length && child.compare(heap[childIndex + 1]) >= 0) {\n child = heap[childIndex + 1];\n childIndex++;\n }\n if (cur.compare(child) < 0)\n break;\n heap[childIndex] = cur;\n heap[index] = child;\n index = childIndex;\n }\n}\nclass SpanCursor {\n constructor(sets, skip, minPoint) {\n this.minPoint = minPoint;\n this.active = [];\n this.activeTo = [];\n this.activeRank = [];\n this.minActive = -1;\n // A currently active point range, if any\n this.point = null;\n this.pointFrom = 0;\n this.pointRank = 0;\n this.to = -1000000000 /* C.Far */;\n this.endSide = 0;\n // The amount of open active ranges at the start of the iterator.\n // Not including points.\n this.openStart = -1;\n this.cursor = HeapCursor.from(sets, skip, minPoint);\n }\n goto(pos, side = -1000000000 /* C.Far */) {\n this.cursor.goto(pos, side);\n this.active.length = this.activeTo.length = this.activeRank.length = 0;\n this.minActive = -1;\n this.to = pos;\n this.endSide = side;\n this.openStart = -1;\n this.next();\n return this;\n }\n forward(pos, side) {\n while (this.minActive > -1 && (this.activeTo[this.minActive] - pos || this.active[this.minActive].endSide - side) < 0)\n this.removeActive(this.minActive);\n this.cursor.forward(pos, side);\n }\n removeActive(index) {\n remove(this.active, index);\n remove(this.activeTo, index);\n remove(this.activeRank, index);\n this.minActive = findMinIndex(this.active, this.activeTo);\n }\n addActive(trackOpen) {\n let i = 0, { value, to, rank } = this.cursor;\n // Organize active marks by rank first, then by size\n while (i < this.activeRank.length && (rank - this.activeRank[i] || to - this.activeTo[i]) > 0)\n i++;\n insert(this.active, i, value);\n insert(this.activeTo, i, to);\n insert(this.activeRank, i, rank);\n if (trackOpen)\n insert(trackOpen, i, this.cursor.from);\n this.minActive = findMinIndex(this.active, this.activeTo);\n }\n // After calling this, if `this.point` != null, the next range is a\n // point. Otherwise, it's a regular range, covered by `this.active`.\n next() {\n let from = this.to, wasPoint = this.point;\n this.point = null;\n let trackOpen = this.openStart < 0 ? [] : null;\n for (;;) {\n let a = this.minActive;\n if (a > -1 && (this.activeTo[a] - this.cursor.from || this.active[a].endSide - this.cursor.startSide) < 0) {\n if (this.activeTo[a] > from) {\n this.to = this.activeTo[a];\n this.endSide = this.active[a].endSide;\n break;\n }\n this.removeActive(a);\n if (trackOpen)\n remove(trackOpen, a);\n }\n else if (!this.cursor.value) {\n this.to = this.endSide = 1000000000 /* C.Far */;\n break;\n }\n else if (this.cursor.from > from) {\n this.to = this.cursor.from;\n this.endSide = this.cursor.startSide;\n break;\n }\n else {\n let nextVal = this.cursor.value;\n if (!nextVal.point) { // Opening a range\n this.addActive(trackOpen);\n this.cursor.next();\n }\n else if (wasPoint && this.cursor.to == this.to && this.cursor.from < this.cursor.to) {\n // Ignore any non-empty points that end precisely at the end of the prev point\n this.cursor.next();\n }\n else { // New point\n this.point = nextVal;\n this.pointFrom = this.cursor.from;\n this.pointRank = this.cursor.rank;\n this.to = this.cursor.to;\n this.endSide = nextVal.endSide;\n this.cursor.next();\n this.forward(this.to, this.endSide);\n break;\n }\n }\n }\n if (trackOpen) {\n this.openStart = 0;\n for (let i = trackOpen.length - 1; i >= 0 && trackOpen[i] < from; i--)\n this.openStart++;\n }\n }\n activeForPoint(to) {\n if (!this.active.length)\n return this.active;\n let active = [];\n for (let i = this.active.length - 1; i >= 0; i--) {\n if (this.activeRank[i] < this.pointRank)\n break;\n if (this.activeTo[i] > to || this.activeTo[i] == to && this.active[i].endSide >= this.point.endSide)\n active.push(this.active[i]);\n }\n return active.reverse();\n }\n openEnd(to) {\n let open = 0;\n for (let i = this.activeTo.length - 1; i >= 0 && this.activeTo[i] > to; i--)\n open++;\n return open;\n }\n}\nfunction compare(a, startA, b, startB, length, comparator) {\n a.goto(startA);\n b.goto(startB);\n let endB = startB + length;\n let pos = startB, dPos = startB - startA;\n for (;;) {\n let diff = (a.to + dPos) - b.to || a.endSide - b.endSide;\n let end = diff < 0 ? a.to + dPos : b.to, clipEnd = Math.min(end, endB);\n if (a.point || b.point) {\n if (!(a.point && b.point && (a.point == b.point || a.point.eq(b.point)) &&\n sameValues(a.activeForPoint(a.to), b.activeForPoint(b.to))))\n comparator.comparePoint(pos, clipEnd, a.point, b.point);\n }\n else {\n if (clipEnd > pos && !sameValues(a.active, b.active))\n comparator.compareRange(pos, clipEnd, a.active, b.active);\n }\n if (end > endB)\n break;\n pos = end;\n if (diff <= 0)\n a.next();\n if (diff >= 0)\n b.next();\n }\n}\nfunction sameValues(a, b) {\n if (a.length != b.length)\n return false;\n for (let i = 0; i < a.length; i++)\n if (a[i] != b[i] && !a[i].eq(b[i]))\n return false;\n return true;\n}\nfunction remove(array, index) {\n for (let i = index, e = array.length - 1; i < e; i++)\n array[i] = array[i + 1];\n array.pop();\n}\nfunction insert(array, index, value) {\n for (let i = array.length - 1; i >= index; i--)\n array[i + 1] = array[i];\n array[index] = value;\n}\nfunction findMinIndex(value, array) {\n let found = -1, foundPos = 1000000000 /* C.Far */;\n for (let i = 0; i < array.length; i++)\n if ((array[i] - foundPos || value[i].endSide - value[found].endSide) < 0) {\n found = i;\n foundPos = array[i];\n }\n return found;\n}\n\n/**\nCount the column position at the given offset into the string,\ntaking extending characters and tab size into account.\n*/\nfunction countColumn(string, tabSize, to = string.length) {\n let n = 0;\n for (let i = 0; i < to;) {\n if (string.charCodeAt(i) == 9) {\n n += tabSize - (n % tabSize);\n i++;\n }\n else {\n n++;\n i = findClusterBreak(string, i);\n }\n }\n return n;\n}\n/**\nFind the offset that corresponds to the given column position in a\nstring, taking extending characters and tab size into account. By\ndefault, the string length is returned when it is too short to\nreach the column. Pass `strict` true to make it return -1 in that\nsituation.\n*/\nfunction findColumn(string, col, tabSize, strict) {\n for (let i = 0, n = 0;;) {\n if (n >= col)\n return i;\n if (i == string.length)\n break;\n n += string.charCodeAt(i) == 9 ? tabSize - (n % tabSize) : 1;\n i = findClusterBreak(string, i);\n }\n return strict === true ? -1 : string.length;\n}\n\nexport { Annotation, AnnotationType, ChangeDesc, ChangeSet, CharCategory, Compartment, EditorSelection, EditorState, Facet, Line, MapMode, Prec, Range, RangeSet, RangeSetBuilder, RangeValue, SelectionRange, StateEffect, StateEffectType, StateField, Text, Transaction, codePointAt, codePointSize, combineConfig, countColumn, findClusterBreak, findColumn, fromCodePoint };\n","const C = \"\\u037c\"\nconst COUNT = typeof Symbol == \"undefined\" ? \"__\" + C : Symbol.for(C)\nconst SET = typeof Symbol == \"undefined\" ? \"__styleSet\" + Math.floor(Math.random() * 1e8) : Symbol(\"styleSet\")\nconst top = typeof globalThis != \"undefined\" ? globalThis : typeof window != \"undefined\" ? window : {}\n\n// :: - Style modules encapsulate a set of CSS rules defined from\n// JavaScript. Their definitions are only available in a given DOM\n// root after it has been _mounted_ there with `StyleModule.mount`.\n//\n// Style modules should be created once and stored somewhere, as\n// opposed to re-creating them every time you need them. The amount of\n// CSS rules generated for a given DOM root is bounded by the amount\n// of style modules that were used. So to avoid leaking rules, don't\n// create these dynamically, but treat them as one-time allocations.\nexport class StyleModule {\n // :: (Object