UNPKG

@react-native/debugger-frontend

Version:
1 lines 282 kB
import*as e from"../../ui/legacy/legacy.js";import*as t from"../../core/common/common.js";import*as i from"../../core/host/host.js";import*as r from"../../core/i18n/i18n.js";import*as o from"../../ui/legacy/components/source_frame/source_frame.js";import*as s from"../../core/platform/platform.js";import*as n from"../../core/sdk/sdk.js";import*as a from"../../models/logs/logs.js";import*as l from"../../ui/components/buttons/buttons.js";import*as d from"../../ui/visual_logging/visual_logging.js";import*as c from"../../ui/legacy/components/data_grid/data_grid.js";import*as h from"../mobile_throttling/mobile_throttling.js";import*as u from"../settings/emulation/components/components.js";import*as p from"../../models/bindings/bindings.js";import*as g from"../../models/workspace/workspace.js";import*as m from"./forward/forward.js";import*as w from"../../ui/components/floating_button/floating_button.js";import*as k from"../../ui/components/icon_button/icon_button.js";import*as v from"../../ui/legacy/components/perf_ui/perf_ui.js";import*as b from"../../ui/legacy/components/utils/utils.js";import{PanelUtils as f}from"../utils/utils.js";import*as C from"../../core/root/root.js";import*as S from"../../ui/components/legacy_wrapper/legacy_wrapper.js";import*as y from"./components/components.js";import*as T from"../../ui/legacy/components/cookie_table/cookie_table.js";import*as x from"../../ui/legacy/components/object_ui/object_ui.js";import*as R from"../../models/text_utils/text_utils.js";import*as I from"../../models/har/har.js";import*as q from"../../models/persistence/persistence.js";import*as L from"../sources/sources.js";import*as F from"../../ui/components/adorners/adorners.js";import*as E from"../../ui/components/render_coordinator/render_coordinator.js";import*as H from"../../ui/legacy/theme_support/theme_support.js";import*as P from"../../models/trace/trace.js";import*as M from"../search/search.js";var A={cssText:`.panel.network devtools-toolbar.binary-view-toolbar{border-top:1px solid var(--sys-color-divider);border-bottom:0;padding-left:5px}.binary-view-copied-text{opacity:100%}.binary-view-copied-text.fadeout{opacity:0%;transition:opacity 1s}\n/*# sourceURL=${import.meta.resolve("./binaryResourceView.css")} */\n`};const N={copiedAsBase:"Copied as `Base64`",hexViewer:"`Hex` Viewer",copiedAsHex:"Copied as `Hex`",copiedAsUtf:"Copied as `UTF-8`",binaryViewType:"Binary view type",copyToClipboard:"Copy to clipboard",copyAsBase:"Copy as `Base64`",copyAsHex:"Copy as `Hex`",copyAsUtf:"Copy as `UTF-8`"},U=r.i18n.registerUIStrings("panels/network/BinaryResourceView.ts",N),B=r.i18n.getLocalizedString.bind(void 0,U);class V extends e.Widget.VBox{binaryResourceViewFactory;toolbar;binaryViewObjects;binaryViewTypeSetting;binaryViewTypeCombobox;copiedText;addFadeoutSettimeoutId;lastView;constructor(i,s,n){super(),this.registerRequiredCSS(A),this.binaryResourceViewFactory=new o.BinaryResourceViewFactory.BinaryResourceViewFactory(i,s,n),this.toolbar=this.element.createChild("devtools-toolbar","binary-view-toolbar"),this.binaryViewObjects=[new W("base64",r.i18n.lockedString("Base64"),B(N.copiedAsBase),this.binaryResourceViewFactory.createBase64View.bind(this.binaryResourceViewFactory),this.binaryResourceViewFactory.base64.bind(this.binaryResourceViewFactory)),new W("hex",B(N.hexViewer),B(N.copiedAsHex),this.binaryResourceViewFactory.createHexView.bind(this.binaryResourceViewFactory),this.binaryResourceViewFactory.hex.bind(this.binaryResourceViewFactory)),new W("utf8",r.i18n.lockedString("UTF-8"),B(N.copiedAsUtf),this.binaryResourceViewFactory.createUtf8View.bind(this.binaryResourceViewFactory),this.binaryResourceViewFactory.utf8.bind(this.binaryResourceViewFactory))],this.binaryViewTypeSetting=t.Settings.Settings.instance().createSetting("binary-view-type","hex"),this.binaryViewTypeCombobox=new e.Toolbar.ToolbarComboBox(this.binaryViewTypeChanged.bind(this),B(N.binaryViewType));for(const e of this.binaryViewObjects)this.binaryViewTypeCombobox.addOption(this.binaryViewTypeCombobox.createOption(e.label,e.type));this.toolbar.appendToolbarItem(this.binaryViewTypeCombobox);const a=new e.Toolbar.ToolbarButton(B(N.copyToClipboard),"copy");a.addEventListener("Click",(e=>{this.copySelectedViewToClipboard()}),this),this.toolbar.appendToolbarItem(a),this.copiedText=new e.Toolbar.ToolbarText,this.copiedText.element.classList.add("binary-view-copied-text"),this.toolbar.appendChild(this.copiedText.element),this.addFadeoutSettimeoutId=null,this.lastView=null,this.updateView()}getCurrentViewObject(){const e=this.binaryViewObjects.find((e=>e.type===this.binaryViewTypeSetting.get()));return console.assert(Boolean(e),`No binary view found for binary view type found in setting 'binary-view-type': ${this.binaryViewTypeSetting.get()}`),e||null}copySelectedViewToClipboard(){const e=this.getCurrentViewObject();e&&(i.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(e.content()),this.copiedText.setText(e.copiedMessage),this.copiedText.element.classList.remove("fadeout"),this.addFadeoutSettimeoutId&&(clearTimeout(this.addFadeoutSettimeoutId),this.addFadeoutSettimeoutId=null),this.addFadeoutSettimeoutId=window.setTimeout(function(){this.copiedText.element.classList.add("fadeout")}.bind(this),2e3))}updateView(){const e=this.getCurrentViewObject();if(!e)return;const t=e.getView();t!==this.lastView&&(this.lastView&&this.lastView.detach(),this.lastView=t,t.show(this.element,this.toolbar),this.binaryViewTypeCombobox.element.value=this.binaryViewTypeSetting.get())}binaryViewTypeChanged(){const e=this.binaryViewTypeCombobox.selectedOption();if(!e)return;const t=e.value;this.binaryViewTypeSetting.get()!==t&&(this.binaryViewTypeSetting.set(t),this.updateView())}addCopyToContextMenu(e,t){const r=e.clipboardSection().appendSubMenuItem(t,!1,"copy").footerSection();r.appendItem(B(N.copyAsBase),(async()=>{const e=this.binaryResourceViewFactory.base64();i.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(e)}),{jslogContext:"copy-as-base"}),r.appendItem(B(N.copyAsHex),(async()=>{const e=await this.binaryResourceViewFactory.hex();i.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(e)}),{jslogContext:"copy-as-hex"}),r.appendItem(B(N.copyAsUtf),(async()=>{const e=await this.binaryResourceViewFactory.utf8();i.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(e)}),{jslogContext:"copy-as-utf"})}}class W{type;label;copiedMessage;content;createViewFn;view;constructor(e,t,i,r,o){this.type=e,this.label=t,this.copiedMessage=i,this.content=o,this.createViewFn=r,this.view=null}getView(){return this.view||(this.view=this.createViewFn()),this.view}}var O=Object.freeze({__proto__:null,BinaryResourceView:V,BinaryViewObject:W}),D={cssText:`.list{border:none!important;border-top:1px solid var(--sys-color-divider)!important;display:flex;height:100%}.blocking-disabled{opacity:80%}.editor-container{padding:0 4px}.blocked-urls{overflow:hidden auto}.no-blocked-urls > span{white-space:pre}.blocked-url{display:flex;flex-direction:row;align-items:center;flex:auto}.blocked-url-count{flex:none;padding-right:9px}.blocked-url-checkbox{margin-left:8px;flex:none}.blocked-url-checkbox:focus{outline:auto 5px -webkit-focus-ring-color}.blocked-url-label{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex:auto;padding:0 3px}.blocked-url-edit-row{flex:none;display:flex;flex-direction:row;margin:7px 5px 0;align-items:center}.blocked-url-edit-value{user-select:none;flex:1 1 0}.blocked-url-edit-row input{width:100%;text-align:inherit;height:22px}\n/*# sourceURL=${import.meta.resolve("./blockedURLsPane.css")} */\n`};const G={enableNetworkRequestBlocking:"Enable network request blocking",addPattern:"Add pattern",addNetworkRequestBlockingPattern:"Add network request blocking pattern",noNetworkRequestsBlocked:"No blocked network requests",addPatternToBlock:'Add a pattern to block network requests by clicking on the "{PH1}" button.',dBlocked:"{PH1} blocked",textPatternToBlockMatching:"Text pattern to block matching requests; use * for wildcard",patternInputCannotBeEmpty:"Pattern input cannot be empty.",patternAlreadyExists:"Pattern already exists.",itemDeleted:"Item successfully deleted",learnMore:"Learn more"},j=r.i18n.registerUIStrings("panels/network/BlockedURLsPane.ts",G),z=r.i18n.getLocalizedString.bind(void 0,j);class _ extends e.Widget.VBox{manager;toolbar;enabledCheckbox;list;editor;blockedCountForUrl;constructor(){super(!0),this.registerRequiredCSS(D),this.element.setAttribute("jslog",`${d.panel("network.blocked-urls").track({resize:!0})}`),this.manager=n.NetworkManager.MultitargetNetworkManager.instance(),this.manager.addEventListener("BlockedPatternsChanged",this.update,this),this.toolbar=this.contentElement.createChild("devtools-toolbar"),this.enabledCheckbox=new e.Toolbar.ToolbarCheckbox(z(G.enableNetworkRequestBlocking),void 0,this.toggleEnabled.bind(this),"network.enable-request-blocking"),this.toolbar.appendToolbarItem(this.enabledCheckbox),this.toolbar.appendSeparator(),this.toolbar.appendToolbarItem(e.Toolbar.Toolbar.createActionButton("network.add-network-request-blocking-pattern")),this.toolbar.appendToolbarItem(e.Toolbar.Toolbar.createActionButton("network.remove-all-network-request-blocking-patterns")),this.toolbar.setAttribute("jslog",`${d.toolbar()}`),this.list=new e.ListWidget.ListWidget(this),this.list.registerRequiredCSS(D),this.list.element.classList.add("blocked-urls"),this.list.setEmptyPlaceholder(this.createEmptyPlaceholder()),this.list.show(this.contentElement),this.editor=null,this.blockedCountForUrl=new Map,n.TargetManager.TargetManager.instance().addModelListener(n.NetworkManager.NetworkManager,n.NetworkManager.Events.RequestFinished,this.onRequestFinished,this,{scoped:!0}),this.update(),a.NetworkLog.NetworkLog.instance().addEventListener(a.NetworkLog.Events.Reset,this.onNetworkLogReset,this)}createEmptyPlaceholder(){const t=this.contentElement.createChild("div","empty-state");t.createChild("span","empty-state-header").textContent=z(G.noNetworkRequestsBlocked);const i=t.createChild("div","empty-state-description");i.createChild("span").textContent=z(G.addPatternToBlock,{PH1:z(G.addPattern)});const r=e.XLink.XLink.create("https://developer.chrome.com/docs/devtools/network-request-blocking",z(G.learnMore),void 0,void 0,"learn-more");i.appendChild(r);const o=e.UIUtils.createTextButton(z(G.addPattern),this.addPattern.bind(this),{className:"add-button",jslogContext:"network.add-network-request-blocking-pattern",variant:"tonal"});return e.ARIAUtils.setLabel(o,z(G.addNetworkRequestBlockingPattern)),t.appendChild(o),t}addPattern(){this.manager.setBlockingEnabled(!0),this.list.addNewItem(0,{url:s.DevToolsPath.EmptyUrlString,enabled:!0})}removeAllPatterns(){this.manager.setBlockedPatterns([])}renderItem(e,t){const i=this.blockedRequestsCount(e.url),r=document.createElement("div");r.classList.add("blocked-url");const o=r.createChild("input","blocked-url-checkbox");return o.type="checkbox",o.checked=e.enabled,o.disabled=!t,o.setAttribute("jslog",`${d.toggle().track({change:!0})}`),r.createChild("div","blocked-url-label").textContent=e.url,r.createChild("div","blocked-url-count").textContent=z(G.dBlocked,{PH1:i}),t&&(r.addEventListener("click",(t=>this.togglePattern(e,t))),o.addEventListener("click",(t=>this.togglePattern(e,t)))),r}togglePattern(e,t){t.consume(!0);const i=this.manager.blockedPatterns();i.splice(i.indexOf(e),1,{enabled:!e.enabled,url:e.url}),this.manager.setBlockedPatterns(i)}toggleEnabled(){this.manager.setBlockingEnabled(!this.manager.blockingEnabled()),this.update()}removeItemRequested(t,i){const r=this.manager.blockedPatterns();r.splice(i,1),this.manager.setBlockedPatterns(r),e.ARIAUtils.alert(G.itemDeleted)}beginEdit(e){return this.editor=this.createEditor(),this.editor.control("url").value=e.url,this.editor}commitEdit(e,t,i){const r=t.control("url").value,o=this.manager.blockedPatterns();i?o.push({enabled:!0,url:r}):o.splice(o.indexOf(e),1,{enabled:!0,url:r}),this.manager.setBlockedPatterns(o)}createEditor(){if(this.editor)return this.editor;const t=new e.ListWidget.Editor,i=t.contentElement();i.createChild("div","blocked-url-edit-row").createChild("div").textContent=z(G.textPatternToBlockMatching);const r=i.createChild("div","blocked-url-edit-row"),o=t.createInput("url","text","",((e,t,i)=>{let r,o=!0;return i.value?this.manager.blockedPatterns().find((e=>e.url===i.value))&&(r=z(G.patternAlreadyExists),o=!1):(r=z(G.patternInputCannotBeEmpty),o=!1),{valid:o,errorMessage:r}}));return r.createChild("div","blocked-url-edit-value").appendChild(o),t}update(){const e=this.manager.blockingEnabled();this.list.element.classList.toggle("blocking-disabled",!e&&Boolean(this.manager.blockedPatterns().length)),this.enabledCheckbox.setChecked(e),this.list.clear();for(const t of this.manager.blockedPatterns())this.list.appendItem(t,e)}blockedRequestsCount(e){if(!e)return 0;let t=0;for(const i of this.blockedCountForUrl.keys())this.matches(e,i)&&(t+=this.blockedCountForUrl.get(i));return t}matches(e,t){let i=0;const r=e.split("*");for(let e=0;e<r.length;e++){const o=r[e];if(o.length){if(i=t.indexOf(o,i),-1===i)return!1;i+=o.length}}return!0}onNetworkLogReset(e){this.blockedCountForUrl.clear(),this.update()}onRequestFinished(e){const t=e.data;if(t.wasBlocked()){const e=this.blockedCountForUrl.get(t.url())||0;this.blockedCountForUrl.set(t.url(),e+1),this.update()}}wasShown(){e.Context.Context.instance().setFlavor(_,this),super.wasShown()}willHide(){super.willHide(),e.Context.Context.instance().setFlavor(_,null)}}var K=Object.freeze({__proto__:null,ActionDelegate:class{handleAction(e,t){const i=e.flavor(_);if(null===i)return!1;switch(t){case"network.add-network-request-blocking-pattern":return i.addPattern(),!0;case"network.remove-all-network-request-blocking-patterns":return i.removeAllPatterns(),!0}return!1}},BlockedURLsPane:_}),$={cssText:`.event-source-messages-view .data-grid{flex:auto;border:none}\n/*# sourceURL=${import.meta.resolve("./eventSourceMessagesView.css")} */\n`};const X={id:"Id",type:"Type",data:"Data",time:"Time",eventSource:"Event Source",copyMessage:"Copy message",clearAll:"Clear all",filterByRegex:"Filter using regex (example: https?)"},J=r.i18n.registerUIStrings("panels/network/EventSourceMessagesView.ts",X),Y=r.i18n.getLocalizedString.bind(void 0,J);class Q extends e.Widget.VBox{request;dataGrid;mainToolbar;clearAllButton;filterTextInput;filterRegex;messageFilterSetting=t.Settings.Settings.instance().createSetting("network-event-source-message-filter","");constructor(t){super(),this.registerRequiredCSS($),this.element.classList.add("event-source-messages-view"),this.element.setAttribute("jslog",`${d.pane("event-stream").track({resize:!0})}`),this.request=t,this.mainToolbar=this.element.createChild("devtools-toolbar"),this.clearAllButton=new e.Toolbar.ToolbarButton(Y(X.clearAll),"clear"),this.clearAllButton.addEventListener("Click",this.clearMessages,this),this.mainToolbar.appendToolbarItem(this.clearAllButton);const i=Y(X.filterByRegex);this.filterTextInput=new e.Toolbar.ToolbarFilter(i,.4),this.filterTextInput.addEventListener("TextChanged",this.updateFilterSetting,this);const r=this.messageFilterSetting.get();this.filterRegex=null,this.setFilter(r),r&&this.filterTextInput.setValue(r),this.mainToolbar.appendToolbarItem(this.filterTextInput);const o=[{id:"id",title:Y(X.id),sortable:!0,weight:8},{id:"type",title:Y(X.type),sortable:!0,weight:8},{id:"data",title:Y(X.data),sortable:!1,weight:88},{id:"time",title:Y(X.time),sortable:!0,weight:8}];this.dataGrid=new c.SortableDataGrid.SortableDataGrid({displayName:Y(X.eventSource),columns:o,deleteCallback:void 0,refreshCallback:void 0}),this.dataGrid.setStriped(!0),this.dataGrid.setEnableAutoScrollToBottom(!0),this.dataGrid.setRowContextMenuCallback(this.onRowContextMenu.bind(this)),this.dataGrid.markColumnAsSortedBy("time",c.DataGrid.Order.Ascending),this.sortItems(),this.dataGrid.addEventListener("SortingChanged",this.sortItems,this),this.dataGrid.setName("event-source-messages-view"),this.dataGrid.asWidget().show(this.element)}wasShown(){super.wasShown(),this.refresh(),this.request.addEventListener(n.NetworkRequest.Events.EVENT_SOURCE_MESSAGE_ADDED,this.messageAdded,this)}willHide(){this.request.removeEventListener(n.NetworkRequest.Events.EVENT_SOURCE_MESSAGE_ADDED,this.messageAdded,this)}messageAdded(e){const t=e.data;this.messageFilter(t)&&this.dataGrid.insertChild(new Z(t))}messageFilter(e){return!this.filterRegex||this.filterRegex.test(e.eventName)||this.filterRegex.test(e.eventId)||this.filterRegex.test(e.data)}clearMessages(){ie.set(this.request,this.request.eventSourceMessages().length),this.refresh()}updateFilterSetting(){const e=this.filterTextInput.value();this.messageFilterSetting.set(e),this.setFilter(e),this.refresh()}setFilter(e){if(this.filterRegex=null,e)try{this.filterRegex=new RegExp(e,"i")}catch{this.filterRegex=new RegExp("(?!)","i")}}sortItems(){const e=this.dataGrid.sortColumnId();if(!e)return;const t=te[e];t&&this.dataGrid.sortNodes(t,!this.dataGrid.isSortOrderAscending())}onRowContextMenu(e,t){e.clipboardSection().appendItem(Y(X.copyMessage),i.InspectorFrontendHost.InspectorFrontendHostInstance.copyText.bind(i.InspectorFrontendHost.InspectorFrontendHostInstance,t.data.data),{jslogContext:"copy"})}refresh(){this.dataGrid.rootNode().removeChildren();let e=this.request.eventSourceMessages();const t=ie.get(this.request)||0;e=e.slice(t),e=e.filter(this.messageFilter.bind(this)),e.forEach((e=>this.dataGrid.insertChild(new Z(e))))}}class Z extends c.SortableDataGrid.SortableDataGridNode{message;constructor(t){const i=new Date(1e3*t.time),r=("0"+i.getHours()).substr(-2)+":"+("0"+i.getMinutes()).substr(-2)+":"+("0"+i.getSeconds()).substr(-2)+"."+("00"+i.getMilliseconds()).substr(-3),o=document.createElement("div");e.UIUtils.createTextChild(o,r),e.Tooltip.Tooltip.install(o,i.toLocaleString()),super({id:t.eventId,type:t.eventName,data:t.data,time:o}),this.message=t}}function ee(e,t,i){const r=e(t.message),o=e(i.message);return r<o?-1:r>o?1:0}const te={id:ee.bind(null,(e=>e.eventId)),type:ee.bind(null,(e=>e.eventName)),time:ee.bind(null,(e=>e.time))},ie=new WeakMap;var re=Object.freeze({__proto__:null,Comparators:te,EventSourceMessageNode:Z,EventSourceMessagesView:Q}),oe={cssText:`.network-config{padding:12px;display:block}.network-config-group{display:flex;padding-bottom:10px;flex-wrap:wrap;flex:0 0 auto;min-height:30px}.network-config-title{margin-right:16px;width:130px}.network-config-fields{flex:2 0 200px}.network-config-fields span:first-of-type,\n.network-config-fields .network-config-accepted-encoding-custom{padding:3px 0}.panel-section-separator{height:1px;margin-bottom:10px;background:var(--sys-color-divider)}.network-config-disable-cache{line-height:28px;border-top:none;padding-top:0}.network-config-input-validation-error{color:var(--sys-color-error);margin:5px 0}.network-config-input-validation-error:empty{display:none}.network-config-throttling select{width:100%;max-width:250px}.network-config-throttling > .network-config-title{line-height:24px}.network-config-ua > .network-config-title{line-height:20px}.network-config-ua input{display:block;width:calc(100% - 20px)}.network-config-ua input[type="text"],\n.network-config-ua select{margin-top:8px}.network-config-ua select{width:calc(100% - 20px);max-width:250px}.network-config-ua-custom{padding-bottom:8px;input,\n devtools-user-agent-client-hints-form{opacity:38%;pointer-events:none}&.checked input,\n &.checked devtools-user-agent-client-hints-form{opacity:revert;pointer-events:revert}}devtools-user-agent-client-hints-form{display:block;margin-top:14px;width:min(100%,400px)}.status-text{padding:10px;color:var(--sys-color-tertiary)}\n/*# sourceURL=${import.meta.resolve("./networkConfigView.css")} */\n`};const se={custom:"Custom...",enterACustomUserAgent:"Enter a custom user agent",customUserAgentFieldIsRequired:"Custom user agent field is required",caching:"Caching",disableCache:"Disable cache",networkThrottling:"Network throttling",userAgent:"User agent",selectAutomatically:"Use browser default",acceptedEncoding:"Accepted `Content-Encoding`s",clientHintsStatusText:"User agent updated.",networkConditionsPanelShown:"Network conditions shown"},ne=r.i18n.registerUIStrings("panels/network/NetworkConfigView.ts",se),ae=r.i18n.getLocalizedString.bind(void 0,ne);let le;class de extends e.Widget.VBox{constructor(){super(!0),this.registerRequiredCSS(oe),this.element.setAttribute("jslog",`${d.panel("network-conditions").track({resize:!0})}`),this.contentElement.classList.add("network-config"),this.createCacheSection(),this.contentElement.createChild("div").classList.add("panel-section-separator"),this.createNetworkThrottlingSection(),this.contentElement.createChild("div").classList.add("panel-section-separator"),this.createUserAgentSection(),this.contentElement.createChild("div").classList.add("panel-section-separator"),this.createAcceptedEncodingSection()}static instance(e={forceNew:null}){const{forceNew:t}=e;return le&&!t||(le=new de),le}static createUserAgentSelectAndInput(i){const r=t.Settings.Settings.instance().createSetting("custom-user-agent",""),o=t.Settings.Settings.instance().createSetting("custom-user-agent-metadata",null),a=document.createElement("select");a.setAttribute("jslog",`${d.dropDown().track({change:!0}).context(r.name)}`),e.ARIAUtils.setLabel(a,i);const l={title:ae(se.custom),value:"custom"};a.appendChild(e.UIUtils.createOption(l.title,l.value,"custom"));for(const t of he){const i=a.createChild("optgroup");i.label=t.title;for(const r of t.values){const t=n.NetworkManager.MultitargetNetworkManager.patchUserAgentWithChromeVersion(r.value);i.appendChild(e.UIUtils.createOption(r.title,t,s.StringUtilities.toKebabCase(r.title)))}}a.selectedIndex=0;const c=e.UIUtils.createInput("","text");c.setAttribute("jslog",`${d.textField().track({change:!0}).context(r.name)}`),c.value=r.get(),e.Tooltip.Tooltip.install(c,r.get()),c.placeholder=ae(se.enterACustomUserAgent),c.required=!0,e.ARIAUtils.setLabel(c,c.placeholder);const h=document.createElement("div");function u(){const e=r.get(),t=a.options;let i=!1;for(let r=0;r<t.length;++r)if(t[r].value===e){a.selectedIndex=r,i=!0;break}i||(a.selectedIndex=0)}return h.classList.add("network-config-input-validation-error"),e.ARIAUtils.markAsAlert(h),c.value||(h.textContent=ae(se.customUserAgentFieldIsRequired)),u(),a.addEventListener("change",(function(){const t=a.options[a.selectedIndex].value;if(t!==l.value){r.set(t),c.value=t,e.Tooltip.Tooltip.install(c,t);const i=ce(t);o.set(i),n.NetworkManager.MultitargetNetworkManager.instance().setCustomUserAgentOverride(t,i)}else o.set(null),c.select();h.textContent="";const i=new CustomEvent("user-agent-change",{detail:{value:t}});a.dispatchEvent(i)}),!1),c.addEventListener("input",(function(){r.get()!==c.value&&(c.value?h.textContent="":h.textContent=ae(se.customUserAgentFieldIsRequired),r.set(c.value),e.Tooltip.Tooltip.install(c,c.value),u())}),!1),{select:a,input:c,error:h}}createSection(e,t){const i=this.contentElement.createChild("section","network-config-group");return t&&i.classList.add(t),i.createChild("div","network-config-title").textContent=e,i.createChild("div","network-config-fields")}createCacheSection(){this.createSection(ae(se.caching),"network-config-disable-cache").appendChild(e.SettingsUI.createSettingCheckbox(ae(se.disableCache),t.Settings.Settings.instance().moduleSetting("cache-disabled")))}createNetworkThrottlingSection(){const t=ae(se.networkThrottling),i=this.createSection(t,"network-config-throttling").createChild("select");h.ThrottlingManager.throttlingManager().createNetworkThrottlingSelector(i),e.ARIAUtils.setLabel(i,t)}createUserAgentSection(){const i=t.Settings.Settings.instance().createSetting("custom-user-agent-metadata",null),r=t.Settings.Settings.instance().createSetting("custom-user-agent",""),o=ae(se.userAgent),s=this.createSection(o,"network-config-ua"),a=e.UIUtils.CheckboxLabel.create(ae(se.selectAutomatically),!0,void 0,r.name);s.appendChild(a);const l=a.checkboxElement;r.addChangeListener((()=>{if(l.checked)return;const e=r.get(),t=ce(e);n.NetworkManager.MultitargetNetworkManager.instance().setCustomUserAgentOverride(e,t)}));const d=s.createChild("div","network-config-ua-custom");l.addEventListener("change",w);const c=de.createUserAgentSelectAndInput(o);d.appendChild(c.select),d.appendChild(c.input),d.appendChild(c.error);const h=new u.UserAgentClientHintsForm.UserAgentClientHintsForm,p=i.get(),g=ce(c.select.value);h.value={showMobileCheckbox:!0,showSubmitButton:!0,metaData:p||g||void 0},d.appendChild(h),c.select.addEventListener("user-agent-change",(e=>{const t=e.detail.value,i=t?ce(t):null;h.value={metaData:i||void 0,showMobileCheckbox:!0,showSubmitButton:!0},m.textContent=""})),h.addEventListener("clienthintschange",(()=>{c.select.value="custom",m.textContent=""})),h.addEventListener("clienthintssubmit",(e=>{const t=e.detail.value,o=r.get();i.set(t),n.NetworkManager.MultitargetNetworkManager.instance().setCustomUserAgentOverride(o,t),m.textContent=ae(se.clientHintsStatusText)}));const m=s.createChild("span","status-text");function w(){const e=!l.checked;d.classList.toggle("checked",e),c.select.disabled=!e,c.input.disabled=!e,c.error.hidden=!e,h.disabled=!e;const t=e?r.get():"",i=e?ce(t):null;n.NetworkManager.MultitargetNetworkManager.instance().setCustomUserAgentOverride(t,i)}m.textContent="",w()}createAcceptedEncodingSection(){const i=t.Settings.Settings.instance().createSetting("use-custom-accepted-encodings",!1),r=t.Settings.Settings.instance().createSetting("custom-accepted-encodings","gzip,br,deflate"),o=ae(se.acceptedEncoding),s=this.createSection(o,"network-config-accepted-encoding"),a=e.UIUtils.CheckboxLabel.create(ae(se.selectAutomatically),!0,void 0,i.name);s.appendChild(a);const l=a.checkboxElement;function c(){i.get()?n.NetworkManager.MultitargetNetworkManager.instance().setCustomAcceptedEncodingsOverride(""===r.get()?[]:r.get().split(",")):n.NetworkManager.MultitargetNetworkManager.instance().clearCustomAcceptedEncodingsOverride()}r.addChangeListener(c),i.addChangeListener(c);const h=s.createChild("div","network-config-accepted-encoding-custom");h.setAttribute("jslog",`${d.section().context(r.name)}`),l.checked=!i.get(),l.addEventListener("change",g);const u=new Map,p={Deflate:"deflate",Gzip:"gzip",Br:"br",Zstd:"zstd"};for(const t of Object.values(p)){const i=e.UIUtils.CheckboxLabel.createWithStringLiteral(t,!0,void 0,t);h.appendChild(i),u.set(t,i.checkboxElement)}for(const[e,t]of u)t.checked=r.get().includes(e),t.addEventListener("change",g);function g(){i.set(!l.checked);const e=[];for(const[t,i]of u)i.disabled=l.checked,i.checked&&e.push(t);r.set(e.join(","))}g()}wasShown(){super.wasShown(),e.ARIAUtils.alert(ae(se.networkConditionsPanelShown))}}function ce(e){for(const t of he)for(const i of t.values)if(e===n.NetworkManager.MultitargetNetworkManager.patchUserAgentWithChromeVersion(i.value))return i.metadata?(n.NetworkManager.MultitargetNetworkManager.patchUserAgentMetadataWithChromeVersion(i.metadata),i.metadata):null;return null}const he=[{title:"Android",values:[{title:"Android (4.0.2) Browser — Galaxy Nexus",value:"Mozilla/5.0 (Linux; U; Android 4.0.2; en-us; Galaxy Nexus Build/ICL53F) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Google Chrome",version:"%s"}],fullVersion:"%s",platform:"Android",platformVersion:"4.0.2",architecture:"",model:"Galaxy Nexus",mobile:!0}},{title:"Android (2.3) Browser — Nexus S",value:"Mozilla/5.0 (Linux; U; Android 2.3.6; en-us; Nexus S Build/GRK39F) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Google Chrome",version:"%s"}],fullVersion:"%s",platform:"Android",platformVersion:"2.3.6",architecture:"",model:"Nexus S",mobile:!0}}]},{title:"BlackBerry",values:[{title:"BlackBerry — BB10",value:"Mozilla/5.0 (BB10; Touch) AppleWebKit/537.1+ (KHTML, like Gecko) Version/10.0.0.1337 Mobile Safari/537.1+",metadata:null},{title:"BlackBerry — PlayBook 2.1",value:"Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML, like Gecko) Version/7.2.1.0 Safari/536.2+",metadata:null},{title:"BlackBerry — 9900",value:"Mozilla/5.0 (BlackBerry; U; BlackBerry 9900; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.0.0.187 Mobile Safari/534.11+",metadata:null}]},{title:"Chrome",values:[{title:"Chrome — Android Mobile",value:"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Mobile Safari/537.36",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Google Chrome",version:"%s"}],fullVersion:"%s",platform:"Android",platformVersion:"6.0",architecture:"",model:"Nexus 5",mobile:!0}},{title:"Chrome — Android Mobile (high-end)",value:"Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Mobile Safari/537.36",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Google Chrome",version:"%s"}],fullVersion:"%s",platform:"Android",platformVersion:"10",architecture:"",model:"Pixel 4",mobile:!0}},{title:"Chrome — Android Tablet",value:"Mozilla/5.0 (Linux; Android 4.3; Nexus 7 Build/JSS15Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Google Chrome",version:"%s"}],fullVersion:"%s",platform:"Android",platformVersion:"4.3",architecture:"",model:"Nexus 7",mobile:!0}},{title:"Chrome — iPhone",value:"Mozilla/5.0 (iPhone; CPU iPhone OS 13_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/%s Mobile/15E148 Safari/604.1",metadata:null},{title:"Chrome — iPad",value:"Mozilla/5.0 (iPad; CPU OS 13_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/%s Mobile/15E148 Safari/604.1",metadata:null},{title:"Chrome — Chrome OS",value:"Mozilla/5.0 (X11; CrOS x86_64 10066.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Google Chrome",version:"%s"}],fullVersion:"%s",platform:"Chrome OS",platformVersion:"10066.0.0",architecture:"x86",model:"",mobile:!1}},{title:"Chrome — Mac",value:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Google Chrome",version:"%s"}],fullVersion:"%s",platform:"macOS",platformVersion:"10_14_6",architecture:"x86",model:"",mobile:!1}},{title:"Chrome — Windows",value:"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Google Chrome",version:"%s"}],fullVersion:"%s",platform:"Windows",platformVersion:"10.0",architecture:"x86",model:"",mobile:!1}}]},{title:"Firefox",values:[{title:"Firefox — Android Mobile",value:"Mozilla/5.0 (Android 4.4; Mobile; rv:70.0) Gecko/70.0 Firefox/70.0",metadata:null},{title:"Firefox — Android Tablet",value:"Mozilla/5.0 (Android 4.4; Tablet; rv:70.0) Gecko/70.0 Firefox/70.0",metadata:null},{title:"Firefox — iPhone",value:"Mozilla/5.0 (iPhone; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) FxiOS/1.0 Mobile/12F69 Safari/600.1.4",metadata:null},{title:"Firefox — iPad",value:"Mozilla/5.0 (iPad; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) FxiOS/1.0 Mobile/12F69 Safari/600.1.4",metadata:null},{title:"Firefox — Mac",value:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:70.0) Gecko/20100101 Firefox/70.0",metadata:null},{title:"Firefox — Windows",value:"Mozilla/5.0 (Windows NT 10.0; WOW64; rv:70.0) Gecko/20100101 Firefox/70.0",metadata:null}]},{title:"Googlebot",values:[{title:"Googlebot",value:"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",metadata:null},{title:"Googlebot Desktop",value:"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +http://www.google.com/bot.html) Chrome/%s Safari/537.36",metadata:null},{title:"Googlebot Smartphone",value:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",metadata:null}]},{title:"Internet Explorer",values:[{title:"Internet Explorer 11",value:"Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko",metadata:null},{title:"Internet Explorer 10",value:"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)",metadata:null},{title:"Internet Explorer 9",value:"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)",metadata:null},{title:"Internet Explorer 8",value:"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)",metadata:null},{title:"Internet Explorer 7",value:"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)",metadata:null}]},{title:"Microsoft Edge",values:[{title:"Microsoft Edge (Chromium) — Windows",value:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36 Edg/%s",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Microsoft Edge",version:"%s"}],fullVersion:"%s",platform:"Windows",platformVersion:"10.0",architecture:"x86",model:"",mobile:!1}},{title:"Microsoft Edge (Chromium) — Mac",value:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Chrome/%s Safari/604.1 Edg/%s",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Microsoft Edge",version:"%s"}],fullVersion:"%s",platform:"macOS",platformVersion:"10_14_6",architecture:"x86",model:"",mobile:!1}},{title:"Microsoft Edge — iPhone",value:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 EdgiOS/44.5.0.10 Mobile/15E148 Safari/604.1",metadata:null},{title:"Microsoft Edge — iPad",value:"Mozilla/5.0 (iPad; CPU OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 EdgiOS/44.5.2 Mobile/15E148 Safari/605.1.15",metadata:null},{title:"Microsoft Edge — Android Mobile",value:"Mozilla/5.0 (Linux; Android 8.1.0; Pixel Build/OPM4.171019.021.D1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Mobile Safari/537.36 EdgA/42.0.0.2057",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Microsoft Edge",version:"%s"}],fullVersion:"%s",platform:"Android",platformVersion:"8.1.0",architecture:"",model:"Pixel",mobile:!0}},{title:"Microsoft Edge — Android Tablet",value:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 7 Build/MOB30X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36 EdgA/42.0.0.2057",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Microsoft Edge",version:"%s"}],fullVersion:"%s",platform:"Android",platformVersion:"6.0.1",architecture:"",model:"Nexus 7",mobile:!0}},{title:"Microsoft Edge (EdgeHTML) — Windows",value:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36 Edge/18.19042",metadata:null},{title:"Microsoft Edge (EdgeHTML) — XBox",value:"Mozilla/5.0 (Windows NT 10.0; Win64; x64; Xbox; Xbox One) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36 Edge/18.19041",metadata:null}]},{title:"Opera",values:[{title:"Opera — Mac",value:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36 OPR/65.0.3467.48",metadata:null},{title:"Opera — Windows",value:"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36 OPR/65.0.3467.48",metadata:null},{title:"Opera (Presto) — Mac",value:"Opera/9.80 (Macintosh; Intel Mac OS X 10.9.1) Presto/2.12.388 Version/12.16",metadata:null},{title:"Opera (Presto) — Windows",value:"Opera/9.80 (Windows NT 6.1) Presto/2.12.388 Version/12.16",metadata:null},{title:"Opera Mobile — Android Mobile",value:"Opera/12.02 (Android 4.1; Linux; Opera Mobi/ADR-1111101157; U; en-US) Presto/2.9.201 Version/12.02",metadata:null},{title:"Opera Mini — iOS",value:"Opera/9.80 (iPhone; Opera Mini/8.0.0/34.2336; U; en) Presto/2.8.119 Version/11.10",metadata:null}]},{title:"Safari",values:[{title:"Safari — iPad iOS 13.2",value:"Mozilla/5.0 (iPad; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1",metadata:null},{title:"Safari — iPhone iOS 13.2",value:"Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1",metadata:null},{title:"Safari — Mac",value:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Safari/605.1.15",metadata:null}]},{title:"UC Browser",values:[{title:"UC Browser — Android Mobile",value:"Mozilla/5.0 (Linux; U; Android 8.1.0; en-US; Nexus 6P Build/OPM7.181205.001) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/%s UCBrowser/12.11.1.1197 Mobile Safari/537.36",metadata:null},{title:"UC Browser — iOS",value:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_1 like Mac OS X; zh-CN) AppleWebKit/537.51.1 (KHTML, like Gecko) Mobile/16B92 UCBrowser/12.1.7.1109 Mobile AliApp(TUnionSDK/0.1.20.3)",metadata:null},{title:"UC Browser — Windows Phone",value:"Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 920) UCBrowser/10.1.0.563 Mobile",metadata:null}]}];var ue=Object.freeze({__proto__:null,NetworkConfigView:de,userAgentGroups:he});const pe={redirect:"Redirect",sPreflight:"{PH1} + Preflight",preflight:"Preflight",selectPreflightRequest:"Select preflight request",failed:"(failed)",data:"(data)",canceled:"(canceled)",other:"other",csp:"csp",origin:"origin",integrity:"integrity",devtools:"devtools",blockeds:"(blocked:{PH1})",blockedTooltip:"This request was blocked due to misconfigured response headers, click to view the headers",corsError:"CORS error",crossoriginResourceSharingErrorS:"Cross-Origin Resource Sharing error: {PH1}",finished:"Finished",pendingq:"(pending)",unknown:"(unknown)",unknownExplanation:"The request status cannot be shown here because the page that issued it unloaded while the request was in flight. You can use chrome://net-export to capture a network log and see all request details.",push:"Push / ",parser:"Parser",script:"Script",preload:"Preload",earlyHints:"early-hints",signedexchange:"signed-exchange",selectTheRequestThatTriggered:"Select the request that triggered this preflight",otherC:"Other",memoryCache:"(memory cache)",servedFromMemoryCacheResource:"Served from memory cache, resource size: {PH1}",serviceWorker:"(`ServiceWorker`)",servedFromServiceWorkerResource:"Served from `ServiceWorker`, resource size: {PH1}",servedFromSignedHttpExchange:"Served from Signed HTTP Exchange, resource size: {PH1}",servedFromWebBundle:"Served from Web Bundle, resource size: {PH1}",prefetchCache:"(prefetch cache)",servedFromPrefetchCacheResource:"Served from prefetch cache, resource size: {PH1}",diskCache:"(disk cache)",servedFromDiskCacheResourceSizeS:"Served from disk cache, resource size: {PH1}",matchedToServiceWorkerRouter:"Matched to `ServiceWorker router`#{PH1}, resource size: {PH2}",matchedToServiceWorkerRouterWithNetworkSource:"Matched to `ServiceWorker router`#{PH1}, {PH2} transferred over network, resource size: {PH3}",pending:"Pending",level:"level 1",webBundleError:"Web Bundle error",webBundleInnerRequest:"Served from Web Bundle",webBundle:"(Web Bundle)",timeSubtitleTooltipText:"Latency (response received time - start time)",alternativeJobWonWithoutRace:"`Chrome` used a `HTTP/3` connection induced by an '`Alt-Svc`' header without racing against establishing a connection using a different `HTTP` version.",alternativeJobWonRace:"`Chrome` used a `HTTP/3` connection induced by an '`Alt-Svc`' header because it won a race against establishing a connection using a different `HTTP` version.",mainJobWonRace:"`Chrome` used this protocol because it won a race against establishing a `HTTP/3` connection.",mappingMissing:"`Chrome` did not use an alternative `HTTP` version because no alternative protocol information was available when the request was issued, but an '`Alt-Svc`' header was present in the response.",broken:"`Chrome` did not try to establish a `HTTP/3` connection because it was marked as broken.",dnsAlpnH3JobWonWithoutRace:"`Chrome` used a `HTTP/3` connection due to the `DNS record` indicating `HTTP/3` support. There was no race against establishing a connection using a different `HTTP` version.",dnsAlpnH3JobWonRace:"`Chrome` used a `HTTP/3` connection due to the `DNS record` indicating `HTTP/3` support, which won a race against establishing a connection using a different `HTTP` version.",initialPriorityToolTip:"{PH1}, Initial priority: {PH2}"},ge=r.i18n.registerUIStrings("panels/network/NetworkDataGridNode.ts",pe),me=r.i18n.getLocalizedString.bind(void 0,ge);class we extends c.SortableDataGrid.SortableDataGridNode{parentViewInternal;isHovered;showingInitiatorChainInternal;requestOrFirstKnownChildRequestInternal;constructor(e){super({}),this.parentViewInternal=e,this.isHovered=!1,this.showingInitiatorChainInternal=!1,this.requestOrFirstKnownChildRequestInternal=null}displayName(){return""}displayType(){return""}createCell(e){const t=this.createTD(e);return this.renderCell(t,e),t}renderCell(e,t){}isError(){return!1}isWarning(){return!1}backgroundColor(){const e=ke,t=document.hasFocus(),i=this.dataGrid&&this.dataGrid.element===document.activeElement,r=this.isWarning(),o=this.isError();return this.selected&&t&&i&&o?e.FocusSelectedHasError:this.selected&&t&&i&&r?e.FocusSelectedHasWarning:this.selected&&t&&i?e.FocusSelected:this.selected?e.Selected:this.hovered()?e.Hovered:this.isOnInitiatorPath()?e.InitiatorPath:this.isOnInitiatedPath()?e.InitiatedPath:this.isStriped()?e.Stripe:e.Default}updateBackgroundColor(){const e=this.existingElement();e&&(e.style.backgroundColor=`var(${this.backgroundColor()})`,this.parentViewInternal.stylesChanged())}setStriped(e){super.setStriped(e),this.updateBackgroundColor()}select(e){super.select(e),this.updateBackgroundColor(),this.parentViewInternal.updateNodeSelectedClass(!0)}deselect(e){super.deselect(e),this.updateBackgroundColor(),this.parentViewInternal.updateNodeSelectedClass(!1)}parentView(){return this.parentViewInternal}hovered(){return this.isHovered}showingInitiatorChain(){return this.showingInitiatorChainInternal}nodeSelfHeight(){return this.parentViewInternal.rowHeight()}setHovered(e,t){this.isHovered===e&&this.showingInitiatorChainInternal===t||(this.isHovered!==e&&(this.isHovered=e,this.attached()&&this.element().classList.toggle("hover",e)),this.showingInitiatorChainInternal!==t&&(this.showingInitiatorChainInternal=t,this.showingInitiatorChainChanged()),this.parentViewInternal.stylesChanged(),this.updateBackgroundColor())}showingInitiatorChainChanged(){}isOnInitiatorPath(){return!1}isOnInitiatedPath(){return!1}request(){return null}isNavigationRequest(){return!1}clearFlatNodes(){super.clearFlatNodes(),this.requestOrFirstKnownChildRequestInternal=null}requestOrFirstKnownChildRequest(){if(this.requestOrFirstKnownChildRequestInternal)return this.requestOrFirstKnownChildRequestInternal;let e=this.request();if(e||!this.hasChildren())return this.requestOrFirstKnownChildRequestInternal=e,this.requestOrFirstKnownChildRequestInternal;let t=null;const i=this.flatChildren();for(let r=0;r<i.length;r++)e=i[r].request(),(!t||e&&e.issueTime()<t.issueTime())&&(t=e);return this.requestOrFirstKnownChildRequestInternal=t,this.requestOrFirstKnownChildRequestInternal}}const ke={Default:"--color-grid-default",Stripe:"--color-grid-stripe",Navigation:"--network-grid-navigation-color",Hovered:"--color-grid-hovered",InitiatorPath:"--network-grid-initiator-path-color",InitiatedPath:"--network-grid-initiated-path-color",Selected:"--color-grid-selected",FocusSelected:"--color-grid-focus-selected",FocusSelectedHasError:"--network-grid-focus-selected-color-has-error",FocusSelectedHasWarning:"--network-grid-focus-selected-color-has-warning",FromFrame:"--network-grid-from-frame-color"};class ve extends we{nameCell;initiatorCell;requestInternal;isNavigationRequestInternal;selectable;isOnInitiatorPathInternal;isOnInitiatedPathInternal;linkifiedInitiatorAnchor;constructor(e,t){super(e),this.nameCell=null,this.initiatorCell=null,this.requestInternal=t,this.isNavigationRequestInternal=!1,this.selectable=!0,this.isOnInitiatorPathInternal=!1,this.isOnInitiatedPathInternal=!1}static NameComparator(e,t){const i=e.displayName().toLowerCase(),r=t.displayName().toLowerCase();if(i===r){const i=e.requestOrFirstKnownChildRequest(),r=t.requestOrFirstKnownChildRequest();return i&&r?i.identityCompare(r):i?-1:1}return i<r?-1:1}static RemoteAddressComparator(e,t){const i=e.requestOrFirstKnownChildRequest(),r=t.requestOrFirstKnownChildRequest();if(!i||!r)return i?1:-1;const o=i.remoteAddress(),s=r.remoteAddress();return o>s?1:s>o?-1:i.identityCompare(r)}static SizeComparator(e,t){const i=e.requestOrFirstKnownChildRequest(),r=t.requestOrFirstKnownChildRequest();return i&&r?r.cached()&&!i.cached()?1:i.cached()&&!r.cached()?-1:i.transferSize-r.transferSize||i.resourceSize-r.resourceSize||i.identityCompare(r):i?1:-1}static TypeComparator(e,t){const i=e.requestOrFirstKnownChildRequest(),r=t.requestOrFirstKnownChildRequest();if(!i||!r)return i?1:-1;const o=e.displayType(),s=t.displayType();return o>s?1:s>o?-1:i.identityCompare(r)}static InitiatorComparator(e,t){const i=e.requestOrFirstKnownChildRequest(),r=t.requestOrFirstKnownChildRequest();if(!i||!r)return i?1:-1;const o=e instanceof ve&&e.initiatorCell,s=t instanceof ve&&t.initiatorCell;if(!o||!s)return o?1:-1;const n=e,a=t,l=n.linkifiedInitiatorAnchor?n.linkifiedInitiatorAnchor.textContent||"":n.initiatorCell.title,d=a.linkifiedInitiatorAnchor?a.linkifiedInitiatorAnchor.textContent||"":a.initiatorCell.title;return l.localeCompare(d)}static InitiatorAddressSpaceComparator(e,t){const i=e.requestOrFirstKnownChildRequest(),r=t.requestOrFirstKnownChildRequest();if(!i||!r)return i?1:-1;const o=i.clientSecurityState(),s=r.clientSecurityState();return o&&s?o.initiatorIPAddressSpace.localeCompare(s.initiatorIPAddressSpace):o?1:-1}static RemoteAddressSpaceComparator(e,t){const i=e.requestOrFirstKnownChildRequest(),r=t.requestOrFirstKnownChildRequest();return i&&r?i.remoteAddressSpace().localeCompare(r.remoteAddressSpace()):i?1:-1}static RequestCookiesCountComparator(e,t){const i=e.requestOrFirstKnownChildRequest(),r=t.requestOrFirstKnownChildRequest();if(!i||!r)return i?1:-1;return i.includedRequestCookies().length-r.includedRequestCookies().length||i.identityCompare(r)}static ResponseCookiesCountComparator(e,t){const i=e.requestOrFirstKnownChildRequest(),r=t.requestOrFirstKnownChildRequest();if(!i||!r)return i?1:-1;return(i.responseCookies?i.responseCookies.length:0)-(r.responseCookies?r.responseCookies.length:0)||i.identityCompare(r)}static PriorityComparator(e,t){const i=e.requestOrFirstKnownChildRequest(),r=t.requestOrFirstKnownChildRequest();if(!i||!r)return i?1:-1;const o=i.priority();let s=o?v.NetworkPriorities.networkPriorityWeight(o):0;s=s||0;const n=r.priority();let a=n?v.NetworkPriorities.networkPriorityWeight(n):0;return a=a||0,s-a||i.identityCompare(r)}static RequestPropertyComparator(e,t,i){const r=t.requestOrFirstKnownChildRequest(),o=i.requestOrFirstKnownChildRequest();if(!r||!o)return r?1:-1;const s=r[e],n=o[e];return s===n?r.identityCompare(o):s>n?1:-1}static RequestURLComparator(e,t){const i=e.requestOrFirstKnownChildRequest(),r=t.requestOrFirstKnownChildRequest();if(!i||!r)return i?1:-1;const o=i.url(),s=r.url();return o===s?i.identityCompare(r):o>s?1:-1}static ResponseHeaderStringComparator(e,t,i){const r=t.requestOrFirstKnownChildRequest(),o=i.requestOrFirstKnownChildRequest();if(!r||!o)return r?1:-1;const s=String(r.responseHeaderValue(e)||""),n=String(o.responseHeaderValue(e)||"");return s.localeCompare(n)||r.identityCompare(o)}static ResponseHeaderNumberComparator(e,t,i){const r=t.requestOrFirstKnownChildRequest(),o=i.requestOrFirstKnownChildRequest();if(!r||!o)return r?1:-1;const s=r.responseHeaderValue(e),n=void 0!==s?parseFloat(s):-1/0,a=o.responseHeaderValue(e),l=void 0!==a?parseFloat(a):-1/0;return n===l?r.identityCompare(o):n>l?1:-1}static ResponseHeaderDateComparator(e,t,i){const r=t.requestOrFirstKnownChildRequest(),o=i.requestOrFirstKnownChildRequest();if(!r||!o)return r?1:-1;const s=r.responseHeaderValue(e),n=o.responseHeaderValue(e),a=s?new Date(s).getTime():-1/0,l=n?new Date(n).getTime():-1/0;return a===l?r.identityCompare(o):a>l?1:-1}showingInitiatorChainChanged(){const e=this.showingInitiatorChain(),t=a.NetworkLog.NetworkLog.instance().initiatorGraphForRequest(this.requestInternal);for(const i of t.initiators){if(i===this.requestInternal)continue;const t=this.parentView().nodeForRequest(i);t&&t.setIsOnInitiatorPath(e)}for(const i of t.initiated.keys()){if(i===this.requestInternal)continue;const t=this.parentView().nodeForRequest(i);t&&t.setIsOnInitiatedPath(e)}}setIsOnInitiatorPath(e){this.isOnInitiatorPathInternal!==e&&this.attached()&&(this.isOnInitiatorPathInternal=e,this.updateBackgroundColor())}isOnInitiatorPath(){return this.isOnInitiatorPathInternal}setIsOnInitiatedPath(e){this.isOnInitiatedPathInternal!==e&&this.attached()&&(this.isOnInitiatedPathInternal=e,this.updateBackgroundColor())}isOnInitiatedPath(){return this.isOnInitiatedPathInternal}displayType(){const e=this.requestInternal.mimeType||this.requestInternal.requestContentType()||"",i=this.requestI