@react-native/debugger-frontend 0.73.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (656) hide show
  1. package/BUILD_INFO +10 -0
  2. package/README.md +22 -0
  3. package/dist/third-party/LICENSE +28 -0
  4. package/dist/third-party/front_end/Images/3d-center.svg +1 -0
  5. package/dist/third-party/front_end/Images/3d-pan.svg +1 -0
  6. package/dist/third-party/front_end/Images/3d-rotate.svg +1 -0
  7. package/dist/third-party/front_end/Images/Images.js +223 -0
  8. package/dist/third-party/front_end/Images/accelerometer-back.svg +1 -0
  9. package/dist/third-party/front_end/Images/accelerometer-bottom.png +0 -0
  10. package/dist/third-party/front_end/Images/accelerometer-front.svg +1 -0
  11. package/dist/third-party/front_end/Images/accelerometer-left.png +0 -0
  12. package/dist/third-party/front_end/Images/accelerometer-right.png +0 -0
  13. package/dist/third-party/front_end/Images/accelerometer-top.png +0 -0
  14. package/dist/third-party/front_end/Images/align-content-center.svg +1 -0
  15. package/dist/third-party/front_end/Images/align-content-end.svg +1 -0
  16. package/dist/third-party/front_end/Images/align-content-space-around.svg +1 -0
  17. package/dist/third-party/front_end/Images/align-content-space-between.svg +1 -0
  18. package/dist/third-party/front_end/Images/align-content-space-evenly.svg +1 -0
  19. package/dist/third-party/front_end/Images/align-content-start.svg +1 -0
  20. package/dist/third-party/front_end/Images/align-content-stretch.svg +1 -0
  21. package/dist/third-party/front_end/Images/align-items-baseline.svg +1 -0
  22. package/dist/third-party/front_end/Images/align-items-center.svg +1 -0
  23. package/dist/third-party/front_end/Images/align-items-end.svg +1 -0
  24. package/dist/third-party/front_end/Images/align-items-start.svg +1 -0
  25. package/dist/third-party/front_end/Images/align-items-stretch.svg +1 -0
  26. package/dist/third-party/front_end/Images/align-self-center.svg +1 -0
  27. package/dist/third-party/front_end/Images/align-self-end.svg +1 -0
  28. package/dist/third-party/front_end/Images/align-self-start.svg +1 -0
  29. package/dist/third-party/front_end/Images/align-self-stretch.svg +1 -0
  30. package/dist/third-party/front_end/Images/arrow-down.svg +1 -0
  31. package/dist/third-party/front_end/Images/arrow-drop-down-dark.svg +1 -0
  32. package/dist/third-party/front_end/Images/arrow-drop-down-light.svg +1 -0
  33. package/dist/third-party/front_end/Images/arrow-up-down-circle.svg +1 -0
  34. package/dist/third-party/front_end/Images/arrow-up-down.svg +1 -0
  35. package/dist/third-party/front_end/Images/arrow-up.svg +1 -0
  36. package/dist/third-party/front_end/Images/bell.svg +1 -0
  37. package/dist/third-party/front_end/Images/bezier-curve-filled.svg +1 -0
  38. package/dist/third-party/front_end/Images/bin.svg +1 -0
  39. package/dist/third-party/front_end/Images/bottom-panel-close.svg +1 -0
  40. package/dist/third-party/front_end/Images/bottom-panel-open.svg +1 -0
  41. package/dist/third-party/front_end/Images/brackets.svg +1 -0
  42. package/dist/third-party/front_end/Images/breakpoint-circle.svg +1 -0
  43. package/dist/third-party/front_end/Images/breakpoint-crossed-filled.svg +1 -0
  44. package/dist/third-party/front_end/Images/breakpoint-crossed.svg +1 -0
  45. package/dist/third-party/front_end/Images/brush-filled.svg +1 -0
  46. package/dist/third-party/front_end/Images/brush.svg +1 -0
  47. package/dist/third-party/front_end/Images/bug.svg +1 -0
  48. package/dist/third-party/front_end/Images/bundle.svg +1 -0
  49. package/dist/third-party/front_end/Images/check-circle.svg +1 -0
  50. package/dist/third-party/front_end/Images/check-double.svg +1 -0
  51. package/dist/third-party/front_end/Images/checker.svg +1 -0
  52. package/dist/third-party/front_end/Images/checkmark.svg +1 -0
  53. package/dist/third-party/front_end/Images/chevron-double-right.svg +1 -0
  54. package/dist/third-party/front_end/Images/chevron-down.svg +1 -0
  55. package/dist/third-party/front_end/Images/chevron-left-dot.svg +1 -0
  56. package/dist/third-party/front_end/Images/chevron-left.svg +1 -0
  57. package/dist/third-party/front_end/Images/chevron-right.svg +1 -0
  58. package/dist/third-party/front_end/Images/chevron-up.svg +1 -0
  59. package/dist/third-party/front_end/Images/chromeLeft.avif +0 -0
  60. package/dist/third-party/front_end/Images/chromeMiddle.avif +0 -0
  61. package/dist/third-party/front_end/Images/chromeRight.avif +0 -0
  62. package/dist/third-party/front_end/Images/clear-list.svg +1 -0
  63. package/dist/third-party/front_end/Images/clear.svg +1 -0
  64. package/dist/third-party/front_end/Images/cloud.svg +1 -0
  65. package/dist/third-party/front_end/Images/code-circle.svg +1 -0
  66. package/dist/third-party/front_end/Images/code.svg +1 -0
  67. package/dist/third-party/front_end/Images/colon.svg +1 -0
  68. package/dist/third-party/front_end/Images/color-picker-filled.svg +1 -0
  69. package/dist/third-party/front_end/Images/color-picker.svg +1 -0
  70. package/dist/third-party/front_end/Images/console-conditional-breakpoint.svg +1 -0
  71. package/dist/third-party/front_end/Images/console-logpoint.svg +1 -0
  72. package/dist/third-party/front_end/Images/cookie.svg +1 -0
  73. package/dist/third-party/front_end/Images/copy.svg +1 -0
  74. package/dist/third-party/front_end/Images/credit-card.svg +1 -0
  75. package/dist/third-party/front_end/Images/cross-circle-filled.svg +1 -0
  76. package/dist/third-party/front_end/Images/cross-circle.svg +1 -0
  77. package/dist/third-party/front_end/Images/cross.svg +1 -0
  78. package/dist/third-party/front_end/Images/cssoverview_icons_2x.avif +0 -0
  79. package/dist/third-party/front_end/Images/custom-typography.svg +1 -0
  80. package/dist/third-party/front_end/Images/database.svg +1 -0
  81. package/dist/third-party/front_end/Images/deployed.svg +1 -0
  82. package/dist/third-party/front_end/Images/device-fold.svg +1 -0
  83. package/dist/third-party/front_end/Images/devices.svg +1 -0
  84. package/dist/third-party/front_end/Images/dock-bottom.svg +1 -0
  85. package/dist/third-party/front_end/Images/dock-left.svg +1 -0
  86. package/dist/third-party/front_end/Images/dock-right.svg +1 -0
  87. package/dist/third-party/front_end/Images/dock-window.svg +1 -0
  88. package/dist/third-party/front_end/Images/document.svg +1 -0
  89. package/dist/third-party/front_end/Images/dots-horizontal.svg +1 -0
  90. package/dist/third-party/front_end/Images/dots-vertical.svg +1 -0
  91. package/dist/third-party/front_end/Images/download.svg +1 -0
  92. package/dist/third-party/front_end/Images/edit.svg +1 -0
  93. package/dist/third-party/front_end/Images/empty.svg +1 -0
  94. package/dist/third-party/front_end/Images/errorWave.svg +1 -0
  95. package/dist/third-party/front_end/Images/exclamation.svg +1 -0
  96. package/dist/third-party/front_end/Images/experiment-check.svg +1 -0
  97. package/dist/third-party/front_end/Images/experiment.svg +1 -0
  98. package/dist/third-party/front_end/Images/eye.svg +1 -0
  99. package/dist/third-party/front_end/Images/file-document.svg +1 -0
  100. package/dist/third-party/front_end/Images/file-font.svg +1 -0
  101. package/dist/third-party/front_end/Images/file-generic.svg +1 -0
  102. package/dist/third-party/front_end/Images/file-image.svg +1 -0
  103. package/dist/third-party/front_end/Images/file-script.svg +1 -0
  104. package/dist/third-party/front_end/Images/file-snippet.svg +1 -0
  105. package/dist/third-party/front_end/Images/file-stylesheet.svg +1 -0
  106. package/dist/third-party/front_end/Images/filter-clear.svg +1 -0
  107. package/dist/third-party/front_end/Images/filter-filled.svg +1 -0
  108. package/dist/third-party/front_end/Images/filter.svg +1 -0
  109. package/dist/third-party/front_end/Images/flex-direction.svg +1 -0
  110. package/dist/third-party/front_end/Images/flex-no-wrap.svg +1 -0
  111. package/dist/third-party/front_end/Images/flex-wrap.svg +1 -0
  112. package/dist/third-party/front_end/Images/flow.svg +1 -0
  113. package/dist/third-party/front_end/Images/fold-more.svg +1 -0
  114. package/dist/third-party/front_end/Images/folder.svg +1 -0
  115. package/dist/third-party/front_end/Images/frame-crossed.svg +1 -0
  116. package/dist/third-party/front_end/Images/frame-icon.svg +1 -0
  117. package/dist/third-party/front_end/Images/frame.svg +1 -0
  118. package/dist/third-party/front_end/Images/gear-filled.svg +1 -0
  119. package/dist/third-party/front_end/Images/gear.svg +1 -0
  120. package/dist/third-party/front_end/Images/gears.svg +1 -0
  121. package/dist/third-party/front_end/Images/heap-snapshot.svg +1 -0
  122. package/dist/third-party/front_end/Images/heap-snapshots.svg +1 -0
  123. package/dist/third-party/front_end/Images/help.svg +1 -0
  124. package/dist/third-party/front_end/Images/iframe-crossed.svg +1 -0
  125. package/dist/third-party/front_end/Images/iframe.svg +1 -0
  126. package/dist/third-party/front_end/Images/import.svg +1 -0
  127. package/dist/third-party/front_end/Images/info-filled.svg +1 -0
  128. package/dist/third-party/front_end/Images/info.svg +1 -0
  129. package/dist/third-party/front_end/Images/issue-cross-filled.svg +1 -0
  130. package/dist/third-party/front_end/Images/issue-exclamation-filled.svg +1 -0
  131. package/dist/third-party/front_end/Images/issue-questionmark-filled.svg +1 -0
  132. package/dist/third-party/front_end/Images/issue-text-filled.svg +1 -0
  133. package/dist/third-party/front_end/Images/justify-content-center.svg +1 -0
  134. package/dist/third-party/front_end/Images/justify-content-end.svg +1 -0
  135. package/dist/third-party/front_end/Images/justify-content-space-around.svg +1 -0
  136. package/dist/third-party/front_end/Images/justify-content-space-between.svg +1 -0
  137. package/dist/third-party/front_end/Images/justify-content-space-evenly.svg +1 -0
  138. package/dist/third-party/front_end/Images/justify-content-start.svg +1 -0
  139. package/dist/third-party/front_end/Images/justify-items-center.svg +1 -0
  140. package/dist/third-party/front_end/Images/justify-items-end.svg +1 -0
  141. package/dist/third-party/front_end/Images/justify-items-start.svg +1 -0
  142. package/dist/third-party/front_end/Images/justify-items-stretch.svg +1 -0
  143. package/dist/third-party/front_end/Images/keyboard-pen.svg +1 -0
  144. package/dist/third-party/front_end/Images/large-arrow-right-filled.svg +1 -0
  145. package/dist/third-party/front_end/Images/largeIcons.svg +2 -0
  146. package/dist/third-party/front_end/Images/layers-filled.svg +1 -0
  147. package/dist/third-party/front_end/Images/layers.svg +1 -0
  148. package/dist/third-party/front_end/Images/left-panel-close.svg +1 -0
  149. package/dist/third-party/front_end/Images/left-panel-open.svg +1 -0
  150. package/dist/third-party/front_end/Images/lighthouse_logo.svg +1 -0
  151. package/dist/third-party/front_end/Images/list.svg +1 -0
  152. package/dist/third-party/front_end/Images/mediumIcons.svg +1 -0
  153. package/dist/third-party/front_end/Images/memory.svg +1 -0
  154. package/dist/third-party/front_end/Images/minus.svg +1 -0
  155. package/dist/third-party/front_end/Images/minus_icon.svg +1 -0
  156. package/dist/third-party/front_end/Images/navigationControls.png +0 -0
  157. package/dist/third-party/front_end/Images/navigationControls_2x.png +0 -0
  158. package/dist/third-party/front_end/Images/network-settings.svg +1 -0
  159. package/dist/third-party/front_end/Images/nodeIcon.avif +0 -0
  160. package/dist/third-party/front_end/Images/node_search_icon.svg +1 -0
  161. package/dist/third-party/front_end/Images/open-externally.svg +1 -0
  162. package/dist/third-party/front_end/Images/pause.svg +1 -0
  163. package/dist/third-party/front_end/Images/performance.svg +1 -0
  164. package/dist/third-party/front_end/Images/person.svg +1 -0
  165. package/dist/third-party/front_end/Images/play.svg +1 -0
  166. package/dist/third-party/front_end/Images/plus.svg +1 -0
  167. package/dist/third-party/front_end/Images/popoverArrows.png +0 -0
  168. package/dist/third-party/front_end/Images/popup.svg +1 -0
  169. package/dist/third-party/front_end/Images/preview_feature_video_thumbnail.svg +1 -0
  170. package/dist/third-party/front_end/Images/profile.svg +1 -0
  171. package/dist/third-party/front_end/Images/react_native/welcomeIcon.png +0 -0
  172. package/dist/third-party/front_end/Images/record-start.svg +1 -0
  173. package/dist/third-party/front_end/Images/record-stop.svg +1 -0
  174. package/dist/third-party/front_end/Images/redo.svg +1 -0
  175. package/dist/third-party/front_end/Images/refresh.svg +1 -0
  176. package/dist/third-party/front_end/Images/replace.svg +1 -0
  177. package/dist/third-party/front_end/Images/replay.svg +1 -0
  178. package/dist/third-party/front_end/Images/resizeDiagonal.svg +1 -0
  179. package/dist/third-party/front_end/Images/resizeHorizontal.svg +1 -0
  180. package/dist/third-party/front_end/Images/resizeVertical.svg +1 -0
  181. package/dist/third-party/front_end/Images/resume.svg +1 -0
  182. package/dist/third-party/front_end/Images/review.svg +1 -0
  183. package/dist/third-party/front_end/Images/right-panel-close.svg +1 -0
  184. package/dist/third-party/front_end/Images/right-panel-open.svg +1 -0
  185. package/dist/third-party/front_end/Images/screen-rotation.svg +1 -0
  186. package/dist/third-party/front_end/Images/search.svg +1 -0
  187. package/dist/third-party/front_end/Images/securityIcons.svg +1 -0
  188. package/dist/third-party/front_end/Images/select-element.svg +1 -0
  189. package/dist/third-party/front_end/Images/settings_14x14_icon.svg +1 -0
  190. package/dist/third-party/front_end/Images/shadow.svg +1 -0
  191. package/dist/third-party/front_end/Images/smallIcons.svg +1 -0
  192. package/dist/third-party/front_end/Images/snippet.svg +1 -0
  193. package/dist/third-party/front_end/Images/star.svg +1 -0
  194. package/dist/third-party/front_end/Images/step-into.svg +1 -0
  195. package/dist/third-party/front_end/Images/step-out.svg +1 -0
  196. package/dist/third-party/front_end/Images/step-over.svg +1 -0
  197. package/dist/third-party/front_end/Images/step.svg +1 -0
  198. package/dist/third-party/front_end/Images/stop.svg +1 -0
  199. package/dist/third-party/front_end/Images/symbol.svg +1 -0
  200. package/dist/third-party/front_end/Images/sync.svg +1 -0
  201. package/dist/third-party/front_end/Images/table.svg +1 -0
  202. package/dist/third-party/front_end/Images/toolbarResizerVertical.png +0 -0
  203. package/dist/third-party/front_end/Images/top-panel-close.svg +1 -0
  204. package/dist/third-party/front_end/Images/top-panel-open.svg +1 -0
  205. package/dist/third-party/front_end/Images/touchCursor.png +0 -0
  206. package/dist/third-party/front_end/Images/touchCursor_2x.png +0 -0
  207. package/dist/third-party/front_end/Images/triangle-bottom-right.svg +1 -0
  208. package/dist/third-party/front_end/Images/triangle-down.svg +1 -0
  209. package/dist/third-party/front_end/Images/triangle-left.svg +1 -0
  210. package/dist/third-party/front_end/Images/triangle-right.svg +1 -0
  211. package/dist/third-party/front_end/Images/triangle-up.svg +1 -0
  212. package/dist/third-party/front_end/Images/undo.svg +1 -0
  213. package/dist/third-party/front_end/Images/warning-filled.svg +1 -0
  214. package/dist/third-party/front_end/Images/warning.svg +1 -0
  215. package/dist/third-party/front_end/Images/warning_icon.svg +1 -0
  216. package/dist/third-party/front_end/Images/watch.svg +1 -0
  217. package/dist/third-party/front_end/Images/whatsnew.avif +0 -0
  218. package/dist/third-party/front_end/Images/width.svg +1 -0
  219. package/dist/third-party/front_end/Tests.js +1662 -0
  220. package/dist/third-party/front_end/core/common/common-legacy.js +1 -0
  221. package/dist/third-party/front_end/core/common/common.js +1 -0
  222. package/dist/third-party/front_end/core/dom_extension/dom_extension.js +1 -0
  223. package/dist/third-party/front_end/core/host/host-legacy.js +1 -0
  224. package/dist/third-party/front_end/core/host/host.js +1 -0
  225. package/dist/third-party/front_end/core/i18n/i18n.js +1 -0
  226. package/dist/third-party/front_end/core/i18n/locales/en-US.json +1 -0
  227. package/dist/third-party/front_end/core/i18n/locales/zh.json +1 -0
  228. package/dist/third-party/front_end/core/platform/platform.js +1 -0
  229. package/dist/third-party/front_end/core/protocol_client/protocol_client-legacy.js +1 -0
  230. package/dist/third-party/front_end/core/protocol_client/protocol_client.js +1 -0
  231. package/dist/third-party/front_end/core/root/root-legacy.js +1 -0
  232. package/dist/third-party/front_end/core/root/root.js +1 -0
  233. package/dist/third-party/front_end/core/sdk/sdk-legacy.js +1 -0
  234. package/dist/third-party/front_end/core/sdk/sdk-meta.js +1 -0
  235. package/dist/third-party/front_end/core/sdk/sdk.js +1 -0
  236. package/dist/third-party/front_end/device_mode_emulation_frame.html +20 -0
  237. package/dist/third-party/front_end/devtools_app.html +20 -0
  238. package/dist/third-party/front_end/devtools_compatibility.js +1595 -0
  239. package/dist/third-party/front_end/emulated_devices/optimized/MotoG4-landscape.avif +0 -0
  240. package/dist/third-party/front_end/emulated_devices/optimized/MotoG4-portrait.avif +0 -0
  241. package/dist/third-party/front_end/emulated_devices/optimized/Nexus5X-landscape.avif +0 -0
  242. package/dist/third-party/front_end/emulated_devices/optimized/Nexus5X-portrait.avif +0 -0
  243. package/dist/third-party/front_end/emulated_devices/optimized/Nexus6P-landscape.avif +0 -0
  244. package/dist/third-party/front_end/emulated_devices/optimized/Nexus6P-portrait.avif +0 -0
  245. package/dist/third-party/front_end/emulated_devices/optimized/google-nest-hub-horizontal.avif +0 -0
  246. package/dist/third-party/front_end/emulated_devices/optimized/google-nest-hub-max-horizontal.avif +0 -0
  247. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5-horizontal-default-1x.avif +0 -0
  248. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5-horizontal-default-2x.avif +0 -0
  249. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-1x.avif +0 -0
  250. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-2x.avif +0 -0
  251. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5-horizontal-navigation-1x.avif +0 -0
  252. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5-horizontal-navigation-2x.avif +0 -0
  253. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5-vertical-default-1x.avif +0 -0
  254. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5-vertical-default-2x.avif +0 -0
  255. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5-vertical-keyboard-1x.avif +0 -0
  256. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5-vertical-keyboard-2x.avif +0 -0
  257. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5-vertical-navigation-1x.avif +0 -0
  258. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5-vertical-navigation-2x.avif +0 -0
  259. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-default-1x.avif +0 -0
  260. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-default-2x.avif +0 -0
  261. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-1x.avif +0 -0
  262. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-2x.avif +0 -0
  263. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-1x.avif +0 -0
  264. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-2x.avif +0 -0
  265. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5x-vertical-default-1x.avif +0 -0
  266. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5x-vertical-default-2x.avif +0 -0
  267. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-1x.avif +0 -0
  268. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-2x.avif +0 -0
  269. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5x-vertical-navigation-1x.avif +0 -0
  270. package/dist/third-party/front_end/emulated_devices/optimized/google-nexus-5x-vertical-navigation-2x.avif +0 -0
  271. package/dist/third-party/front_end/emulated_devices/optimized/iPad-landscape.avif +0 -0
  272. package/dist/third-party/front_end/emulated_devices/optimized/iPad-portrait.avif +0 -0
  273. package/dist/third-party/front_end/emulated_devices/optimized/iPhone5-landscape.avif +0 -0
  274. package/dist/third-party/front_end/emulated_devices/optimized/iPhone5-portrait.avif +0 -0
  275. package/dist/third-party/front_end/emulated_devices/optimized/iPhone6-landscape.avif +0 -0
  276. package/dist/third-party/front_end/emulated_devices/optimized/iPhone6-portrait.avif +0 -0
  277. package/dist/third-party/front_end/emulated_devices/optimized/iPhone6Plus-landscape.avif +0 -0
  278. package/dist/third-party/front_end/emulated_devices/optimized/iPhone6Plus-portrait.avif +0 -0
  279. package/dist/third-party/front_end/entrypoints/device_mode_emulation_frame/device_mode_emulation_frame.js +1 -0
  280. package/dist/third-party/front_end/entrypoints/devtools_app/devtools_app.js +1 -0
  281. package/dist/third-party/front_end/entrypoints/formatter_worker/FormatterActions.js +1 -0
  282. package/dist/third-party/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.js +1 -0
  283. package/dist/third-party/front_end/entrypoints/formatter_worker/formatter_worker.js +1 -0
  284. package/dist/third-party/front_end/entrypoints/heap_snapshot_worker/heap_snapshot_worker-entrypoint.js +1 -0
  285. package/dist/third-party/front_end/entrypoints/heap_snapshot_worker/heap_snapshot_worker-legacy.js +1 -0
  286. package/dist/third-party/front_end/entrypoints/heap_snapshot_worker/heap_snapshot_worker.js +1 -0
  287. package/dist/third-party/front_end/entrypoints/inspector/inspector.js +1 -0
  288. package/dist/third-party/front_end/entrypoints/inspector_main/inspector_main-meta.js +1 -0
  289. package/dist/third-party/front_end/entrypoints/inspector_main/inspector_main.js +1 -0
  290. package/dist/third-party/front_end/entrypoints/js_app/js_app.js +1 -0
  291. package/dist/third-party/front_end/entrypoints/lighthouse_worker/lighthouse_worker.js +1 -0
  292. package/dist/third-party/front_end/entrypoints/main/main-legacy.js +1 -0
  293. package/dist/third-party/front_end/entrypoints/main/main-meta.js +1 -0
  294. package/dist/third-party/front_end/entrypoints/main/main.js +1 -0
  295. package/dist/third-party/front_end/entrypoints/ndb_app/ndb_app.js +1 -0
  296. package/dist/third-party/front_end/entrypoints/node_app/node_app.js +1 -0
  297. package/dist/third-party/front_end/entrypoints/rn_inspector/rn_inspector.js +1 -0
  298. package/dist/third-party/front_end/entrypoints/shell/shell.js +1 -0
  299. package/dist/third-party/front_end/entrypoints/wasmparser_worker/wasmparser_worker-entrypoint.js +1 -0
  300. package/dist/third-party/front_end/entrypoints/wasmparser_worker/wasmparser_worker.js +1 -0
  301. package/dist/third-party/front_end/entrypoints/worker_app/worker_app.js +1 -0
  302. package/dist/third-party/front_end/inspector.html +20 -0
  303. package/dist/third-party/front_end/integration_test_runner.html +40 -0
  304. package/dist/third-party/front_end/js_app.html +20 -0
  305. package/dist/third-party/front_end/legacy_test_runner/legacy_test_runner.js +36 -0
  306. package/dist/third-party/front_end/legacy_test_runner/test_runner/test_runner.js +1 -0
  307. package/dist/third-party/front_end/models/bindings/bindings-legacy.js +1 -0
  308. package/dist/third-party/front_end/models/bindings/bindings.js +1 -0
  309. package/dist/third-party/front_end/models/breakpoints/breakpoints-legacy.js +1 -0
  310. package/dist/third-party/front_end/models/breakpoints/breakpoints.js +1 -0
  311. package/dist/third-party/front_end/models/emulation/emulation.js +1 -0
  312. package/dist/third-party/front_end/models/extensions/extensions-legacy.js +1 -0
  313. package/dist/third-party/front_end/models/extensions/extensions.js +1 -0
  314. package/dist/third-party/front_end/models/formatter/formatter-legacy.js +1 -0
  315. package/dist/third-party/front_end/models/formatter/formatter.js +1 -0
  316. package/dist/third-party/front_end/models/har/har.js +1 -0
  317. package/dist/third-party/front_end/models/heap_snapshot_model/heap_snapshot_model-legacy.js +1 -0
  318. package/dist/third-party/front_end/models/heap_snapshot_model/heap_snapshot_model.js +1 -0
  319. package/dist/third-party/front_end/models/issues_manager/descriptions/CoepCoopSandboxedIframeCannotNavigateToCoopPage.md +4 -0
  320. package/dist/third-party/front_end/models/issues_manager/descriptions/CoepCorpNotSameOrigin.md +8 -0
  321. package/dist/third-party/front_end/models/issues_manager/descriptions/CoepCorpNotSameOriginAfterDefaultedToSameOriginByCoep.md +18 -0
  322. package/dist/third-party/front_end/models/issues_manager/descriptions/CoepCorpNotSameSite.md +7 -0
  323. package/dist/third-party/front_end/models/issues_manager/descriptions/CoepFrameResourceNeedsCoepHeader.md +10 -0
  324. package/dist/third-party/front_end/models/issues_manager/descriptions/CompatibilityModeQuirks.md +5 -0
  325. package/dist/third-party/front_end/models/issues_manager/descriptions/CookieAttributeValueExceedsMaxSize.md +5 -0
  326. package/dist/third-party/front_end/models/issues_manager/descriptions/LowTextContrast.md +5 -0
  327. package/dist/third-party/front_end/models/issues_manager/descriptions/SameSiteExcludeContextDowngradeRead.md +8 -0
  328. package/dist/third-party/front_end/models/issues_manager/descriptions/SameSiteExcludeContextDowngradeSet.md +8 -0
  329. package/dist/third-party/front_end/models/issues_manager/descriptions/SameSiteExcludeNavigationContextDowngrade.md +8 -0
  330. package/dist/third-party/front_end/models/issues_manager/descriptions/SameSiteInvalidSameParty.md +8 -0
  331. package/dist/third-party/front_end/models/issues_manager/descriptions/SameSiteNoneInsecureErrorRead.md +8 -0
  332. package/dist/third-party/front_end/models/issues_manager/descriptions/SameSiteNoneInsecureErrorSet.md +8 -0
  333. package/dist/third-party/front_end/models/issues_manager/descriptions/SameSiteNoneInsecureWarnRead.md +8 -0
  334. package/dist/third-party/front_end/models/issues_manager/descriptions/SameSiteNoneInsecureWarnSet.md +8 -0
  335. package/dist/third-party/front_end/models/issues_manager/descriptions/SameSiteUnspecifiedLaxAllowUnsafeRead.md +9 -0
  336. package/dist/third-party/front_end/models/issues_manager/descriptions/SameSiteUnspecifiedLaxAllowUnsafeSet.md +9 -0
  337. package/dist/third-party/front_end/models/issues_manager/descriptions/SameSiteUnspecifiedTreatedAsLaxRead.md +9 -0
  338. package/dist/third-party/front_end/models/issues_manager/descriptions/SameSiteUnspecifiedTreatedAsLaxSet.md +9 -0
  339. package/dist/third-party/front_end/models/issues_manager/descriptions/SameSiteWarnCrossDowngradeRead.md +8 -0
  340. package/dist/third-party/front_end/models/issues_manager/descriptions/SameSiteWarnCrossDowngradeSet.md +8 -0
  341. package/dist/third-party/front_end/models/issues_manager/descriptions/SameSiteWarnStrictLaxDowngradeStrict.md +8 -0
  342. package/dist/third-party/front_end/models/issues_manager/descriptions/arInsecureContext.md +7 -0
  343. package/dist/third-party/front_end/models/issues_manager/descriptions/arInvalidRegisterOsSourceHeader.md +5 -0
  344. package/dist/third-party/front_end/models/issues_manager/descriptions/arInvalidRegisterOsTriggerHeader.md +5 -0
  345. package/dist/third-party/front_end/models/issues_manager/descriptions/arInvalidRegisterSourceHeader.md +5 -0
  346. package/dist/third-party/front_end/models/issues_manager/descriptions/arInvalidRegisterTriggerHeader.md +5 -0
  347. package/dist/third-party/front_end/models/issues_manager/descriptions/arOsSourceIgnored.md +18 -0
  348. package/dist/third-party/front_end/models/issues_manager/descriptions/arOsTriggerIgnored.md +19 -0
  349. package/dist/third-party/front_end/models/issues_manager/descriptions/arPermissionPolicyDisabled.md +8 -0
  350. package/dist/third-party/front_end/models/issues_manager/descriptions/arSourceAndTriggerHeaders.md +9 -0
  351. package/dist/third-party/front_end/models/issues_manager/descriptions/arSourceIgnored.md +13 -0
  352. package/dist/third-party/front_end/models/issues_manager/descriptions/arTriggerIgnored.md +12 -0
  353. package/dist/third-party/front_end/models/issues_manager/descriptions/arUntrustworthyReportingOrigin.md +10 -0
  354. package/dist/third-party/front_end/models/issues_manager/descriptions/arWebAndOsHeaders.md +11 -0
  355. package/dist/third-party/front_end/models/issues_manager/descriptions/bounceTrackingMitigations.md +3 -0
  356. package/dist/third-party/front_end/models/issues_manager/descriptions/clientHintMetaTagAllowListInvalidOrigin.md +4 -0
  357. package/dist/third-party/front_end/models/issues_manager/descriptions/clientHintMetaTagModifiedHTML.md +4 -0
  358. package/dist/third-party/front_end/models/issues_manager/descriptions/cookieExcludeBlockedWithinFirstPartySet.md +4 -0
  359. package/dist/third-party/front_end/models/issues_manager/descriptions/cookieExcludeDomainNonAscii.md +11 -0
  360. package/dist/third-party/front_end/models/issues_manager/descriptions/cookieWarnDomainNonAscii.md +11 -0
  361. package/dist/third-party/front_end/models/issues_manager/descriptions/corsAllowCredentialsRequired.md +6 -0
  362. package/dist/third-party/front_end/models/issues_manager/descriptions/corsDisabledScheme.md +7 -0
  363. package/dist/third-party/front_end/models/issues_manager/descriptions/corsDisallowedByMode.md +7 -0
  364. package/dist/third-party/front_end/models/issues_manager/descriptions/corsHeaderDisallowedByPreflightResponse.md +5 -0
  365. package/dist/third-party/front_end/models/issues_manager/descriptions/corsInsecurePrivateNetwork.md +10 -0
  366. package/dist/third-party/front_end/models/issues_manager/descriptions/corsInvalidHeaderValues.md +7 -0
  367. package/dist/third-party/front_end/models/issues_manager/descriptions/corsMethodDisallowedByPreflightResponse.md +5 -0
  368. package/dist/third-party/front_end/models/issues_manager/descriptions/corsNoCorsRedirectModeNotFollow.md +5 -0
  369. package/dist/third-party/front_end/models/issues_manager/descriptions/corsOriginMismatch.md +6 -0
  370. package/dist/third-party/front_end/models/issues_manager/descriptions/corsPreflightAllowPrivateNetworkError.md +10 -0
  371. package/dist/third-party/front_end/models/issues_manager/descriptions/corsPreflightResponseInvalid.md +5 -0
  372. package/dist/third-party/front_end/models/issues_manager/descriptions/corsRedirectContainsCredentials.md +5 -0
  373. package/dist/third-party/front_end/models/issues_manager/descriptions/corsWildcardOriginNotAllowed.md +8 -0
  374. package/dist/third-party/front_end/models/issues_manager/descriptions/cspEvalViolation.md +9 -0
  375. package/dist/third-party/front_end/models/issues_manager/descriptions/cspInlineViolation.md +10 -0
  376. package/dist/third-party/front_end/models/issues_manager/descriptions/cspTrustedTypesPolicyViolation.md +5 -0
  377. package/dist/third-party/front_end/models/issues_manager/descriptions/cspTrustedTypesSinkViolation.md +8 -0
  378. package/dist/third-party/front_end/models/issues_manager/descriptions/cspURLViolation.md +10 -0
  379. package/dist/third-party/front_end/models/issues_manager/descriptions/deprecation.md +3 -0
  380. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthRequestAccountsHttpNotFound.md +1 -0
  381. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthRequestAccountsInvalidResponse.md +1 -0
  382. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthRequestAccountsNoResponse.md +1 -0
  383. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthRequestApprovalDeclined.md +1 -0
  384. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthRequestCanceled.md +1 -0
  385. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthRequestClientMetadataHttpNotFound.md +1 -0
  386. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthRequestClientMetadataInvalidResponse.md +1 -0
  387. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthRequestClientMetadataNoResponse.md +1 -0
  388. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthRequestErrorFetchingSignin.md +1 -0
  389. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthRequestErrorIdToken.md +1 -0
  390. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenHttpNotFound.md +1 -0
  391. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenInvalidRequest.md +1 -0
  392. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenInvalidResponse.md +1 -0
  393. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthRequestIdTokenNoResponse.md +1 -0
  394. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthRequestInvalidSigninResponse.md +1 -0
  395. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthRequestManifestHttpNotFound.md +1 -0
  396. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthRequestManifestInvalidResponse.md +1 -0
  397. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthRequestManifestNoResponse.md +1 -0
  398. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthRequestTooManyRequests.md +1 -0
  399. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthUserInfoRequestInvalidAccountsResponse.md +1 -0
  400. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthUserInfoRequestInvalidConfigOrWellKnown.md +1 -0
  401. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthUserInfoRequestNoAccountSharingPermission.md +1 -0
  402. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthUserInfoRequestNoApiPermission.md +1 -0
  403. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthUserInfoRequestNoReturningUserFromFetchedAccounts.md +1 -0
  404. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthUserInfoRequestNotIframe.md +1 -0
  405. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthUserInfoRequestNotPotentiallyTrustworthy.md +1 -0
  406. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthUserInfoRequestNotSameOrigin.md +1 -0
  407. package/dist/third-party/front_end/models/issues_manager/descriptions/federatedAuthUserInfoRequestNotSignedInWithIdp.md +1 -0
  408. package/dist/third-party/front_end/models/issues_manager/descriptions/genericCrossOriginPortalPostMessageError.md +3 -0
  409. package/dist/third-party/front_end/models/issues_manager/descriptions/genericFormAriaLabelledByToNonExistingId.md +8 -0
  410. package/dist/third-party/front_end/models/issues_manager/descriptions/genericFormAutocompleteAttributeEmptyError.md +5 -0
  411. package/dist/third-party/front_end/models/issues_manager/descriptions/genericFormDuplicateIdForInputError.md +5 -0
  412. package/dist/third-party/front_end/models/issues_manager/descriptions/genericFormEmptyIdAndNameAttributesForInputError.md +5 -0
  413. package/dist/third-party/front_end/models/issues_manager/descriptions/genericFormInputAssignedAutocompleteValueToIdOrNameAttributeError.md +5 -0
  414. package/dist/third-party/front_end/models/issues_manager/descriptions/genericFormInputHasWrongButWellIntendedAutocompleteValueError.md +5 -0
  415. package/dist/third-party/front_end/models/issues_manager/descriptions/genericFormInputWithNoLabelError.md +5 -0
  416. package/dist/third-party/front_end/models/issues_manager/descriptions/genericFormLabelForMatchesNonExistingIdError.md +5 -0
  417. package/dist/third-party/front_end/models/issues_manager/descriptions/genericFormLabelForNameError.md +5 -0
  418. package/dist/third-party/front_end/models/issues_manager/descriptions/genericFormLabelHasNeitherForNorNestedInput.md +5 -0
  419. package/dist/third-party/front_end/models/issues_manager/descriptions/heavyAd.md +10 -0
  420. package/dist/third-party/front_end/models/issues_manager/descriptions/mixedContent.md +5 -0
  421. package/dist/third-party/front_end/models/issues_manager/descriptions/sharedArrayBuffer.md +7 -0
  422. package/dist/third-party/front_end/models/issues_manager/descriptions/stylesheetLateImport.md +4 -0
  423. package/dist/third-party/front_end/models/issues_manager/descriptions/stylesheetRequestFailed.md +3 -0
  424. package/dist/third-party/front_end/models/issues_manager/issues_manager.js +1 -0
  425. package/dist/third-party/front_end/models/javascript_metadata/javascript_metadata.js +1 -0
  426. package/dist/third-party/front_end/models/logs/logs-meta.js +1 -0
  427. package/dist/third-party/front_end/models/logs/logs.js +1 -0
  428. package/dist/third-party/front_end/models/persistence/persistence-legacy.js +1 -0
  429. package/dist/third-party/front_end/models/persistence/persistence-meta.js +1 -0
  430. package/dist/third-party/front_end/models/persistence/persistence.js +1 -0
  431. package/dist/third-party/front_end/models/source_map_scopes/source_map_scopes.js +1 -0
  432. package/dist/third-party/front_end/models/text_utils/text_utils-legacy.js +1 -0
  433. package/dist/third-party/front_end/models/text_utils/text_utils.js +1 -0
  434. package/dist/third-party/front_end/models/timeline_model/timeline_model-legacy.js +1 -0
  435. package/dist/third-party/front_end/models/timeline_model/timeline_model.js +1 -0
  436. package/dist/third-party/front_end/models/trace/extras/extras.js +1 -0
  437. package/dist/third-party/front_end/models/trace/handlers/handlers.js +1 -0
  438. package/dist/third-party/front_end/models/trace/helpers/helpers.js +1 -0
  439. package/dist/third-party/front_end/models/trace/trace.js +1 -0
  440. package/dist/third-party/front_end/models/trace/types/types.js +1 -0
  441. package/dist/third-party/front_end/models/workspace/workspace-legacy.js +1 -0
  442. package/dist/third-party/front_end/models/workspace/workspace.js +1 -0
  443. package/dist/third-party/front_end/models/workspace_diff/workspace_diff-legacy.js +1 -0
  444. package/dist/third-party/front_end/models/workspace_diff/workspace_diff.js +1 -0
  445. package/dist/third-party/front_end/ndb_app.html +20 -0
  446. package/dist/third-party/front_end/node_app.html +20 -0
  447. package/dist/third-party/front_end/panels/accessibility/accessibility-legacy.js +1 -0
  448. package/dist/third-party/front_end/panels/accessibility/accessibility-meta.js +1 -0
  449. package/dist/third-party/front_end/panels/accessibility/accessibility.js +1 -0
  450. package/dist/third-party/front_end/panels/animation/animation-legacy.js +1 -0
  451. package/dist/third-party/front_end/panels/animation/animation-meta.js +1 -0
  452. package/dist/third-party/front_end/panels/animation/animation.js +1 -0
  453. package/dist/third-party/front_end/panels/application/application-legacy.js +1 -0
  454. package/dist/third-party/front_end/panels/application/application-meta.js +1 -0
  455. package/dist/third-party/front_end/panels/application/application.js +1 -0
  456. package/dist/third-party/front_end/panels/application/components/components.js +1 -0
  457. package/dist/third-party/front_end/panels/application/preloading/components/components.js +1 -0
  458. package/dist/third-party/front_end/panels/browser_debugger/browser_debugger-legacy.js +1 -0
  459. package/dist/third-party/front_end/panels/browser_debugger/browser_debugger-meta.js +1 -0
  460. package/dist/third-party/front_end/panels/browser_debugger/browser_debugger.js +1 -0
  461. package/dist/third-party/front_end/panels/changes/changes-legacy.js +1 -0
  462. package/dist/third-party/front_end/panels/changes/changes-meta.js +1 -0
  463. package/dist/third-party/front_end/panels/changes/changes.js +1 -0
  464. package/dist/third-party/front_end/panels/console/console-legacy.js +1 -0
  465. package/dist/third-party/front_end/panels/console/console-meta.js +1 -0
  466. package/dist/third-party/front_end/panels/console/console.js +6 -0
  467. package/dist/third-party/front_end/panels/console_counters/console_counters-meta.js +1 -0
  468. package/dist/third-party/front_end/panels/console_counters/console_counters.js +1 -0
  469. package/dist/third-party/front_end/panels/coverage/coverage-legacy.js +1 -0
  470. package/dist/third-party/front_end/panels/coverage/coverage-meta.js +1 -0
  471. package/dist/third-party/front_end/panels/coverage/coverage.js +1 -0
  472. package/dist/third-party/front_end/panels/css_overview/components/components.js +1 -0
  473. package/dist/third-party/front_end/panels/css_overview/css_overview-meta.js +1 -0
  474. package/dist/third-party/front_end/panels/css_overview/css_overview.js +144 -0
  475. package/dist/third-party/front_end/panels/developer_resources/developer_resources-meta.js +1 -0
  476. package/dist/third-party/front_end/panels/developer_resources/developer_resources.js +1 -0
  477. package/dist/third-party/front_end/panels/elements/components/components.js +1 -0
  478. package/dist/third-party/front_end/panels/elements/elements-legacy.js +1 -0
  479. package/dist/third-party/front_end/panels/elements/elements-meta.js +1 -0
  480. package/dist/third-party/front_end/panels/elements/elements.js +1 -0
  481. package/dist/third-party/front_end/panels/emulation/components/components.js +22 -0
  482. package/dist/third-party/front_end/panels/emulation/emulation-legacy.js +1 -0
  483. package/dist/third-party/front_end/panels/emulation/emulation-meta.js +1 -0
  484. package/dist/third-party/front_end/panels/emulation/emulation.js +1 -0
  485. package/dist/third-party/front_end/panels/event_listeners/event_listeners.js +1 -0
  486. package/dist/third-party/front_end/panels/issues/components/components.js +1 -0
  487. package/dist/third-party/front_end/panels/issues/issues-meta.js +1 -0
  488. package/dist/third-party/front_end/panels/issues/issues.js +1 -0
  489. package/dist/third-party/front_end/panels/js_profiler/js_profiler-meta.js +1 -0
  490. package/dist/third-party/front_end/panels/js_profiler/js_profiler.js +1 -0
  491. package/dist/third-party/front_end/panels/layer_viewer/layer_viewer-legacy.js +1 -0
  492. package/dist/third-party/front_end/panels/layer_viewer/layer_viewer-meta.js +1 -0
  493. package/dist/third-party/front_end/panels/layer_viewer/layer_viewer.js +1 -0
  494. package/dist/third-party/front_end/panels/layers/layers-meta.js +1 -0
  495. package/dist/third-party/front_end/panels/layers/layers.js +1 -0
  496. package/dist/third-party/front_end/panels/lighthouse/lighthouse-legacy.js +1 -0
  497. package/dist/third-party/front_end/panels/lighthouse/lighthouse-meta.js +1 -0
  498. package/dist/third-party/front_end/panels/lighthouse/lighthouse.js +66 -0
  499. package/dist/third-party/front_end/panels/media/media-meta.js +1 -0
  500. package/dist/third-party/front_end/panels/media/media.js +25 -0
  501. package/dist/third-party/front_end/panels/mobile_throttling/mobile_throttling-legacy.js +1 -0
  502. package/dist/third-party/front_end/panels/mobile_throttling/mobile_throttling-meta.js +1 -0
  503. package/dist/third-party/front_end/panels/mobile_throttling/mobile_throttling.js +1 -0
  504. package/dist/third-party/front_end/panels/network/components/components.js +1 -0
  505. package/dist/third-party/front_end/panels/network/forward/forward.js +1 -0
  506. package/dist/third-party/front_end/panels/network/network-legacy.js +1 -0
  507. package/dist/third-party/front_end/panels/network/network-meta.js +1 -0
  508. package/dist/third-party/front_end/panels/network/network.js +1 -0
  509. package/dist/third-party/front_end/panels/performance_monitor/performance_monitor-meta.js +1 -0
  510. package/dist/third-party/front_end/panels/performance_monitor/performance_monitor.js +1 -0
  511. package/dist/third-party/front_end/panels/profiler/profiler-legacy.js +1 -0
  512. package/dist/third-party/front_end/panels/profiler/profiler-meta.js +1 -0
  513. package/dist/third-party/front_end/panels/profiler/profiler.js +7 -0
  514. package/dist/third-party/front_end/panels/protocol_monitor/components/components.js +1 -0
  515. package/dist/third-party/front_end/panels/protocol_monitor/protocol_monitor-meta.js +1 -0
  516. package/dist/third-party/front_end/panels/protocol_monitor/protocol_monitor.js +1 -0
  517. package/dist/third-party/front_end/panels/recorder/components/components.js +1 -0
  518. package/dist/third-party/front_end/panels/recorder/controllers/controllers.js +1 -0
  519. package/dist/third-party/front_end/panels/recorder/converters/converters.js +1 -0
  520. package/dist/third-party/front_end/panels/recorder/extensions/extensions.js +1 -0
  521. package/dist/third-party/front_end/panels/recorder/injected/injected.generated.js +1 -0
  522. package/dist/third-party/front_end/panels/recorder/injected/injected.js +1 -0
  523. package/dist/third-party/front_end/panels/recorder/models/models.js +1 -0
  524. package/dist/third-party/front_end/panels/recorder/recorder-actions.js +1 -0
  525. package/dist/third-party/front_end/panels/recorder/recorder-meta.js +1 -0
  526. package/dist/third-party/front_end/panels/recorder/recorder.js +1 -0
  527. package/dist/third-party/front_end/panels/recorder/util/util.js +1 -0
  528. package/dist/third-party/front_end/panels/rn_welcome/rn_welcome-meta.js +1 -0
  529. package/dist/third-party/front_end/panels/rn_welcome/rn_welcome.js +1 -0
  530. package/dist/third-party/front_end/panels/screencast/screencast-meta.js +1 -0
  531. package/dist/third-party/front_end/panels/screencast/screencast.js +1 -0
  532. package/dist/third-party/front_end/panels/search/search-legacy.js +1 -0
  533. package/dist/third-party/front_end/panels/search/search.js +1 -0
  534. package/dist/third-party/front_end/panels/security/security-legacy.js +1 -0
  535. package/dist/third-party/front_end/panels/security/security-meta.js +1 -0
  536. package/dist/third-party/front_end/panels/security/security.js +1 -0
  537. package/dist/third-party/front_end/panels/sensors/sensors-meta.js +1 -0
  538. package/dist/third-party/front_end/panels/sensors/sensors.js +1 -0
  539. package/dist/third-party/front_end/panels/settings/components/components.js +1 -0
  540. package/dist/third-party/front_end/panels/settings/emulation/components/components.js +1 -0
  541. package/dist/third-party/front_end/panels/settings/emulation/emulation-meta.js +1 -0
  542. package/dist/third-party/front_end/panels/settings/emulation/emulation.js +1 -0
  543. package/dist/third-party/front_end/panels/settings/emulation/utils/utils.js +1 -0
  544. package/dist/third-party/front_end/panels/settings/settings-legacy.js +1 -0
  545. package/dist/third-party/front_end/panels/settings/settings-meta.js +1 -0
  546. package/dist/third-party/front_end/panels/settings/settings.js +1 -0
  547. package/dist/third-party/front_end/panels/snippets/snippets-legacy.js +1 -0
  548. package/dist/third-party/front_end/panels/snippets/snippets.js +1 -0
  549. package/dist/third-party/front_end/panels/sources/components/components.js +1 -0
  550. package/dist/third-party/front_end/panels/sources/sources-legacy.js +1 -0
  551. package/dist/third-party/front_end/panels/sources/sources-meta.js +1 -0
  552. package/dist/third-party/front_end/panels/sources/sources.js +1 -0
  553. package/dist/third-party/front_end/panels/timeline/timeline-legacy.js +1 -0
  554. package/dist/third-party/front_end/panels/timeline/timeline-meta.js +1 -0
  555. package/dist/third-party/front_end/panels/timeline/timeline.js +1 -0
  556. package/dist/third-party/front_end/panels/utils/utils.js +1 -0
  557. package/dist/third-party/front_end/panels/web_audio/graph_visualizer/graph_visualizer.js +1 -0
  558. package/dist/third-party/front_end/panels/web_audio/web_audio-legacy.js +1 -0
  559. package/dist/third-party/front_end/panels/web_audio/web_audio-meta.js +1 -0
  560. package/dist/third-party/front_end/panels/web_audio/web_audio.js +1 -0
  561. package/dist/third-party/front_end/panels/webauthn/webauthn-meta.js +1 -0
  562. package/dist/third-party/front_end/panels/webauthn/webauthn.js +1 -0
  563. package/dist/third-party/front_end/rn_inspector.html +20 -0
  564. package/dist/third-party/front_end/services/puppeteer/puppeteer.js +1 -0
  565. package/dist/third-party/front_end/services/tracing/tracing.js +1 -0
  566. package/dist/third-party/front_end/services/window_bounds/window_bounds.js +1 -0
  567. package/dist/third-party/front_end/third_party/acorn/acorn.js +1 -0
  568. package/dist/third-party/front_end/third_party/chromium/client-variations/client-variations.js +1 -0
  569. package/dist/third-party/front_end/third_party/codemirror.next/chunk/angular.js +2 -0
  570. package/dist/third-party/front_end/third_party/codemirror.next/chunk/codemirror.js +2 -0
  571. package/dist/third-party/front_end/third_party/codemirror.next/chunk/cpp.js +2 -0
  572. package/dist/third-party/front_end/third_party/codemirror.next/chunk/java.js +2 -0
  573. package/dist/third-party/front_end/third_party/codemirror.next/chunk/json.js +2 -0
  574. package/dist/third-party/front_end/third_party/codemirror.next/chunk/legacy.js +2 -0
  575. package/dist/third-party/front_end/third_party/codemirror.next/chunk/less.js +2 -0
  576. package/dist/third-party/front_end/third_party/codemirror.next/chunk/markdown.js +2 -0
  577. package/dist/third-party/front_end/third_party/codemirror.next/chunk/php.js +2 -0
  578. package/dist/third-party/front_end/third_party/codemirror.next/chunk/python.js +2 -0
  579. package/dist/third-party/front_end/third_party/codemirror.next/chunk/sass.js +2 -0
  580. package/dist/third-party/front_end/third_party/codemirror.next/chunk/svelte.js +2 -0
  581. package/dist/third-party/front_end/third_party/codemirror.next/chunk/vue.js +2 -0
  582. package/dist/third-party/front_end/third_party/codemirror.next/chunk/wast.js +2 -0
  583. package/dist/third-party/front_end/third_party/codemirror.next/chunk/xml.js +2 -0
  584. package/dist/third-party/front_end/third_party/codemirror.next/codemirror.next.js +2 -0
  585. package/dist/third-party/front_end/third_party/diff/diff-legacy.js +1 -0
  586. package/dist/third-party/front_end/third_party/diff/diff.js +1 -0
  587. package/dist/third-party/front_end/third_party/i18n/i18n.js +1 -0
  588. package/dist/third-party/front_end/third_party/intl-messageformat/intl-messageformat.js +15 -0
  589. package/dist/third-party/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1297 -0
  590. package/dist/third-party/front_end/third_party/lighthouse/report/report.js +222 -0
  591. package/dist/third-party/front_end/third_party/lit/lit.js +98 -0
  592. package/dist/third-party/front_end/third_party/marked/marked.js +1 -0
  593. package/dist/third-party/front_end/third_party/puppeteer/puppeteer.js +1 -0
  594. package/dist/third-party/front_end/third_party/puppeteer-replay/puppeteer-replay.js +1 -0
  595. package/dist/third-party/front_end/third_party/wasmparser/wasmparser.js +1 -0
  596. package/dist/third-party/front_end/ui/components/adorners/adorners.js +1 -0
  597. package/dist/third-party/front_end/ui/components/buttons/buttons.js +1 -0
  598. package/dist/third-party/front_end/ui/components/chrome_link/chrome_link.js +1 -0
  599. package/dist/third-party/front_end/ui/components/code_highlighter/code_highlighter.js +1 -0
  600. package/dist/third-party/front_end/ui/components/data_grid/data_grid.js +1 -0
  601. package/dist/third-party/front_end/ui/components/dialogs/dialogs.js +1 -0
  602. package/dist/third-party/front_end/ui/components/diff_view/diff_view.js +1 -0
  603. package/dist/third-party/front_end/ui/components/expandable_list/expandable_list.js +1 -0
  604. package/dist/third-party/front_end/ui/components/helpers/helpers.js +1 -0
  605. package/dist/third-party/front_end/ui/components/icon_button/icon_button.js +1 -0
  606. package/dist/third-party/front_end/ui/components/input/input.js +1 -0
  607. package/dist/third-party/front_end/ui/components/issue_counter/issue_counter.js +1 -0
  608. package/dist/third-party/front_end/ui/components/legacy_wrapper/legacy_wrapper.js +1 -0
  609. package/dist/third-party/front_end/ui/components/linear_memory_inspector/linear_memory_inspector-meta.js +1 -0
  610. package/dist/third-party/front_end/ui/components/linear_memory_inspector/linear_memory_inspector.js +1 -0
  611. package/dist/third-party/front_end/ui/components/linkifier/linkifier.js +1 -0
  612. package/dist/third-party/front_end/ui/components/markdown_view/markdown_view.js +1 -0
  613. package/dist/third-party/front_end/ui/components/menus/menus.js +1 -0
  614. package/dist/third-party/front_end/ui/components/node_text/node_text.js +1 -0
  615. package/dist/third-party/front_end/ui/components/panel_feedback/panel_feedback.js +1 -0
  616. package/dist/third-party/front_end/ui/components/panel_introduction_steps/panel_introduction_steps.js +1 -0
  617. package/dist/third-party/front_end/ui/components/render_coordinator/render_coordinator.js +1 -0
  618. package/dist/third-party/front_end/ui/components/report_view/report_view.js +1 -0
  619. package/dist/third-party/front_end/ui/components/request_link_icon/request_link_icon.js +1 -0
  620. package/dist/third-party/front_end/ui/components/settings/settings.js +1 -0
  621. package/dist/third-party/front_end/ui/components/srgb_overlay/srgb_overlay.js +1 -0
  622. package/dist/third-party/front_end/ui/components/survey_link/survey_link.js +1 -0
  623. package/dist/third-party/front_end/ui/components/text_editor/text_editor.js +1 -0
  624. package/dist/third-party/front_end/ui/components/text_prompt/text_prompt.js +1 -0
  625. package/dist/third-party/front_end/ui/components/tree_outline/tree_outline.js +1 -0
  626. package/dist/third-party/front_end/ui/components/two_states_counter/two_states_counter.js +1 -0
  627. package/dist/third-party/front_end/ui/legacy/components/color_picker/color_picker-legacy.js +1 -0
  628. package/dist/third-party/front_end/ui/legacy/components/color_picker/color_picker.js +1 -0
  629. package/dist/third-party/front_end/ui/legacy/components/cookie_table/cookie_table-legacy.js +1 -0
  630. package/dist/third-party/front_end/ui/legacy/components/cookie_table/cookie_table.js +1 -0
  631. package/dist/third-party/front_end/ui/legacy/components/data_grid/data_grid-legacy.js +1 -0
  632. package/dist/third-party/front_end/ui/legacy/components/data_grid/data_grid.js +1 -0
  633. package/dist/third-party/front_end/ui/legacy/components/inline_editor/inline_editor-legacy.js +1 -0
  634. package/dist/third-party/front_end/ui/legacy/components/inline_editor/inline_editor.js +1 -0
  635. package/dist/third-party/front_end/ui/legacy/components/object_ui/object_ui-legacy.js +1 -0
  636. package/dist/third-party/front_end/ui/legacy/components/object_ui/object_ui-meta.js +1 -0
  637. package/dist/third-party/front_end/ui/legacy/components/object_ui/object_ui.js +1 -0
  638. package/dist/third-party/front_end/ui/legacy/components/perf_ui/perf_ui-legacy.js +1 -0
  639. package/dist/third-party/front_end/ui/legacy/components/perf_ui/perf_ui-meta.js +1 -0
  640. package/dist/third-party/front_end/ui/legacy/components/perf_ui/perf_ui.js +12 -0
  641. package/dist/third-party/front_end/ui/legacy/components/quick_open/quick_open-legacy.js +1 -0
  642. package/dist/third-party/front_end/ui/legacy/components/quick_open/quick_open-meta.js +1 -0
  643. package/dist/third-party/front_end/ui/legacy/components/quick_open/quick_open.js +1 -0
  644. package/dist/third-party/front_end/ui/legacy/components/source_frame/source_frame-legacy.js +1 -0
  645. package/dist/third-party/front_end/ui/legacy/components/source_frame/source_frame-meta.js +1 -0
  646. package/dist/third-party/front_end/ui/legacy/components/source_frame/source_frame.js +1 -0
  647. package/dist/third-party/front_end/ui/legacy/components/utils/utils-legacy.js +1 -0
  648. package/dist/third-party/front_end/ui/legacy/components/utils/utils.js +1 -0
  649. package/dist/third-party/front_end/ui/legacy/legacy-legacy.js +1 -0
  650. package/dist/third-party/front_end/ui/legacy/legacy.js +1 -0
  651. package/dist/third-party/front_end/ui/legacy/theme_support/theme_support.js +1 -0
  652. package/dist/third-party/front_end/ui/legacy/utils/utils.js +1 -0
  653. package/dist/third-party/front_end/ui/lit-html/lit-html.js +1 -0
  654. package/dist/third-party/front_end/worker_app.html +20 -0
  655. package/index.js +15 -0
  656. package/package.json +25 -0
@@ -0,0 +1 @@
1
+ import*as t from"../../../../core/common/common.js";import*as e from"../../../../core/platform/platform.js";import*as o from"../../../../core/host/host.js";import*as s from"../../../../core/i18n/i18n.js";import*as r from"../../../../core/root/root.js";import*as n from"../../../components/icon_button/icon_button.js";import*as a from"../../legacy.js";import*as i from"../../../../core/sdk/sdk.js";import*as l from"../../../components/srgb_overlay/srgb_overlay.js";const c=t=>t.map((t=>e.StringUtilities.stringifyWithPrecision(t,2))),h=t=>`${t[0]} ${t[1]} ${t[2]} / ${t[3]}`,d={rgb:{label:"RGBA",toValues:function(t){return c(t.as("rgba").canonicalRGBA())},fromValues:function(e){return t.Color.parse(`rgb(${h(e)})`)}},hsl:{label:"HSLA",toValues:function(t){const e=c(t.as("hsla").canonicalHSLA());return e[1]=e[1]+"%",e[2]=e[2]+"%",e},fromValues:function(e){return t.Color.parse(`hsl(${h(e)})`)}},hwb:{label:"HWBA",toValues:function(t){const e=c(t.as("hwba").canonicalHWBA());return e[1]=e[1]+"%",e[2]=e[2]+"%",e},fromValues:function(e){return t.Color.parse(`hwb(${h(e)})`)}},lch:{label:"lchA",toValues:function(t){const e=t.as("lch");return c([e.l,e.c,e.h,e.alpha??1])},fromValues:function(e){return t.Color.parse(`lch(${h(e)})`)}},oklch:{label:"lchA",toValues:function(t){const e=t.as("oklch");return c([e.l,e.c,e.h,e.alpha??1])},fromValues:function(e){return t.Color.parse(`oklch(${h(e)})`)}},lab:{label:"labA",toValues:function(t){const e=t.as("lab");return c([e.l,e.a,e.b,e.alpha??1])},fromValues:function(e){return t.Color.parse(`lab(${h(e)})`)}},oklab:{label:"labA",toValues:function(t){const e=t.as("oklab");return c([e.l,e.a,e.b,e.alpha??1])},fromValues:function(e){return t.Color.parse(`oklab(${h(e)})`)}},srgb:{label:"RGBA",toValues:function(t){const e=t.as("srgb");return c([e.p0,e.p1,e.p2,e.alpha??1])},fromValues:function(e){return t.Color.parse(`color(srgb ${h(e)})`)}},"srgb-linear":{label:"RGBA",toValues:function(t){const e=t.as("srgb-linear");return c([e.p0,e.p1,e.p2,e.alpha??1])},fromValues:function(e){return t.Color.parse(`color(srgb-linear ${h(e)})`)}},"display-p3":{label:"RGBA",toValues(t){const e=t.as("display-p3");return c([e.p0,e.p1,e.p2,1])},fromValues:e=>t.Color.parse(`color(display-p3 ${h(e)})`)},"a98-rgb":{label:"RGBA",toValues:function(t){const e=t.as("a98-rgb");return c([e.p0,e.p1,e.p2,e.alpha??1])},fromValues:function(e){return t.Color.parse(`color(a98-rgb ${h(e)})`)}},"prophoto-rgb":{label:"RGBA",toValues:function(t){const e=t.as("prophoto-rgb");return c([e.p0,e.p1,e.p2,e.alpha??1])},fromValues:function(e){return t.Color.parse(`color(prophoto-rgb ${h(e)})`)}},rec2020:{label:"RGBA",toValues:function(t){const e=t.as("rec2020");return c([e.p0,e.p1,e.p2,e.alpha??1])},fromValues:function(e){return t.Color.parse(`color(rec2020 ${h(e)})`)}},xyz:{label:"xyzA",toValues:function(t){const e=t.as("xyz");return c([e.p0,e.p1,e.p2,e.alpha??1])},fromValues:function(e){return t.Color.parse(`color(xyz ${h(e)})`)}},"xyz-d50":{label:"xyzA",toValues:function(t){const e=t.as("xyz-d50");return c([e.p0,e.p1,e.p2,e.alpha??1])},fromValues:function(e){return t.Color.parse(`color(xyz-d50 ${h(e)})`)}},"xyz-d65":{label:"xyzA",toValues:function(t){const e=t.as("xyz-d65");return c([e.p0,e.p1,e.p2,e.alpha??1])},fromValues:function(e){return t.Color.parse(`color(xyz-d65 ${h(e)})`)}}};var p=Object.freeze({__proto__:null,colorFormatSpec:d});const u={noContrastInformationAvailable:"No contrast information available",contrastRatio:"Contrast ratio",showMore:"Show more",pickBackgroundColor:"Pick background color",toggleBackgroundColorPicker:"Toggle background color picker",useSuggestedColorStoFixLow:"Use suggested color {PH1}to fix low contrast",apca:"APCA",aa:"AA",placeholderWithColon:": {PH1}",aaa:"AAA",showLess:"Show less"},g=s.i18n.registerUIStrings("ui/legacy/components/color_picker/ContrastDetails.ts",u),m=s.i18n.getLocalizedString.bind(void 0,g);class C extends t.ObjectWrapper.ObjectWrapper{contrastInfo;elementInternal;toggleMainColorPicker;expandedChangedCallback;colorSelectedCallback;expandedInternal;passesAA;contrastUnknown;visibleInternal;noContrastInfoAvailable;contrastValueBubble;contrastValue;contrastValueBubbleIcons;expandButton;expandedDetails;contrastThresholds;contrastAA;contrastPassFailAA;contrastAAA;contrastPassFailAAA;contrastAPCA;contrastPassFailAPCA;chooseBgColor;bgColorPickerButton;bgColorPickedBound;bgColorSwatch;constructor(t,e,o,s,r){super(),this.contrastInfo=t,this.elementInternal=e.createChild("div","spectrum-contrast-details collapsed"),this.toggleMainColorPicker=o,this.expandedChangedCallback=s,this.colorSelectedCallback=r,this.expandedInternal=!1,this.passesAA=!0,this.contrastUnknown=!1,this.visibleInternal=!1,this.noContrastInfoAvailable=e.createChild("div","no-contrast-info-available"),this.noContrastInfoAvailable.textContent=m(u.noContrastInformationAvailable),this.noContrastInfoAvailable.classList.add("hidden");const n=this.elementInternal.createChild("div");n.addEventListener("click",this.topRowClicked.bind(this));const i=n.createChild("div","container");a.UIUtils.createTextChild(i,m(u.contrastRatio)),this.contrastValueBubble=i.createChild("span","contrast-details-value"),this.contrastValue=this.contrastValueBubble.createChild("span"),this.contrastValueBubbleIcons=[],this.contrastValueBubbleIcons.push(this.contrastValueBubble.appendChild(a.Icon.Icon.create("checkmark"))),this.contrastValueBubbleIcons.push(this.contrastValueBubble.appendChild(a.Icon.Icon.create("check-double"))),this.contrastValueBubbleIcons.push(this.contrastValueBubble.appendChild(a.Icon.Icon.create("clear"))),this.contrastValueBubbleIcons.forEach((t=>t.addEventListener("click",(t=>{C.showHelp(),t.consume(!1)}))));const l=new a.Toolbar.Toolbar("expand",i);this.expandButton=new a.Toolbar.ToolbarButton(m(u.showMore),"chevron-down"),this.expandButton.addEventListener(a.Toolbar.ToolbarButton.Events.Click,this.expandButtonClicked.bind(this)),a.ARIAUtils.setExpanded(this.expandButton.element,!1),l.appendToolbarItem(this.expandButton),this.expandedDetails=this.elementInternal.createChild("div","expanded-details"),a.ARIAUtils.setControls(this.expandButton.element,this.expandedDetails),this.contrastThresholds=this.expandedDetails.createChild("div","contrast-thresholds"),this.contrastAA=this.contrastThresholds.createChild("div","contrast-threshold"),this.contrastPassFailAA=this.contrastAA.createChild("div","contrast-pass-fail"),this.contrastAAA=this.contrastThresholds.createChild("div","contrast-threshold"),this.contrastPassFailAAA=this.contrastAAA.createChild("div","contrast-pass-fail"),this.contrastAPCA=this.contrastThresholds.createChild("div","contrast-threshold"),this.contrastPassFailAPCA=this.contrastAPCA.createChild("div","contrast-pass-fail"),this.chooseBgColor=this.expandedDetails.createChild("div","contrast-choose-bg-color"),this.chooseBgColor.textContent=m(u.pickBackgroundColor);const c=this.expandedDetails.createChild("div","background-color"),h=new a.Toolbar.Toolbar("spectrum-eye-dropper",c);this.bgColorPickerButton=new a.Toolbar.ToolbarToggle(m(u.toggleBackgroundColorPicker),"color-picker","color-picker-filled"),this.bgColorPickerButton.addEventListener(a.Toolbar.ToolbarButton.Events.Click,this.toggleBackgroundColorPickerInternal.bind(this,void 0,!0)),h.appendToolbarItem(this.bgColorPickerButton),this.bgColorPickedBound=this.bgColorPicked.bind(this),this.bgColorSwatch=new b(c),this.contrastInfo.addEventListener("ContrastInfoUpdated",this.update.bind(this))}showNoContrastInfoAvailableMessage(){this.noContrastInfoAvailable.classList.remove("hidden")}hideNoContrastInfoAvailableMessage(){this.noContrastInfoAvailable.classList.add("hidden")}computeSuggestedColor(e){const o=this.contrastInfo.color(),s=this.contrastInfo.bgColor();if(!o||!s)return;if("APCA"===e){const e=this.contrastInfo.contrastRatioAPCAThreshold();if(null===e)return;return t.Color.findFgColorForContrastAPCA(o,s,e+1)}const r=this.contrastInfo.contrastRatioThreshold(e);return r?t.Color.findFgColorForContrast(o,s,r+.1):void 0}onSuggestColor(t){const e=this.computeSuggestedColor(t);e&&this.colorSelectedCallback(e)}createFixColorButton(t,e){const o=t.createChild("button","contrast-fix-button"),s=this.contrastInfo.colorFormat(),r=s&&"nickname"!==s?s:"hexa",n=e.asString(r),i=n?n+" ":"",l=m(u.useSuggestedColorStoFixLow,{PH1:i});return a.ARIAUtils.setLabel(o,l),a.Tooltip.Tooltip.install(o,l),o.tabIndex=0,o.style.backgroundColor=i,o}update(){if(this.contrastInfo.isNull())return this.showNoContrastInfoAvailableMessage(),void this.setVisible(!1);this.setVisible(!0),this.hideNoContrastInfoAvailableMessage();const t=r.Runtime.experiments.isEnabled("APCA"),o=this.contrastInfo.color(),s=this.contrastInfo.bgColor();if(t){const t=this.contrastInfo.contrastRatioAPCA();if(null===t||!s||!o)return this.contrastUnknown=!0,this.contrastValue.textContent="",this.contrastValueBubble.classList.add("contrast-unknown"),this.chooseBgColor.classList.remove("hidden"),this.contrastThresholds.classList.add("hidden"),void this.showNoContrastInfoAvailableMessage();this.contrastUnknown=!1,this.chooseBgColor.classList.add("hidden"),this.contrastThresholds.classList.remove("hidden"),this.contrastValueBubble.classList.remove("contrast-unknown"),this.contrastValue.textContent=`${e.NumberUtilities.floor(t,2)}%`;const r=this.contrastInfo.contrastRatioAPCAThreshold(),a=!(!t||!r)&&Math.abs(t)>=r;this.contrastPassFailAPCA.removeChildren();const i=this.contrastPassFailAPCA.createChild("span","contrast-link-label");if(i.textContent=m(u.apca),null!==r&&(this.contrastPassFailAPCA.createChild("span").textContent=`: ${r.toFixed(2)}%`),a){const t=new n.Icon.Icon;t.data={iconName:"checkmark",color:"var(--icon-checkmark-green)",width:"20px",height:"14px"},this.contrastPassFailAPCA.appendChild(t)}else{const t=new n.Icon.Icon;t.data={iconName:"clear",color:"var(--icon-error)",width:"14px",height:"14px"},this.contrastPassFailAPCA.appendChild(t);const e=this.computeSuggestedColor("APCA");if(e){this.createFixColorButton(this.contrastPassFailAPCA,e).addEventListener("click",(()=>this.onSuggestColor("APCA")))}}return i.addEventListener("click",(t=>C.showHelp())),this.elementInternal.classList.toggle("contrast-fail",!a),this.contrastValueBubble.classList.toggle("contrast-aa",a),void this.bgColorSwatch.setColors(o,s)}const a=this.contrastInfo.contrastRatio();if(!a||!s||!o)return this.contrastUnknown=!0,this.contrastValue.textContent="",this.contrastValueBubble.classList.add("contrast-unknown"),this.chooseBgColor.classList.remove("hidden"),this.contrastThresholds.classList.add("hidden"),void this.showNoContrastInfoAvailableMessage();this.contrastUnknown=!1,this.chooseBgColor.classList.add("hidden"),this.contrastThresholds.classList.remove("hidden"),this.contrastValueBubble.classList.remove("contrast-unknown"),this.contrastValue.textContent=String(e.NumberUtilities.floor(a,2)),this.bgColorSwatch.setColors(o,s);const i=this.contrastInfo.contrastRatioThreshold("aa")||0;this.passesAA=(this.contrastInfo.contrastRatio()||0)>=i,this.contrastPassFailAA.removeChildren();const l=this.contrastPassFailAA.createChild("span","contrast-link-label");if(l.textContent=m(u.aa),this.contrastPassFailAA.createChild("span").textContent=m(u.placeholderWithColon,{PH1:i.toFixed(1)}),this.passesAA){const t=new n.Icon.Icon;t.data={iconName:"checkmark",color:"var(--icon-checkmark-green)",width:"20px",height:"14px"},this.contrastPassFailAA.appendChild(t)}else{const t=new n.Icon.Icon;t.data={iconName:"clear",color:"var(--icon-error)",width:"14px",height:"14px"},this.contrastPassFailAA.appendChild(t);const e=this.computeSuggestedColor("aa");if(e){this.createFixColorButton(this.contrastPassFailAA,e).addEventListener("click",(()=>this.onSuggestColor("aa")))}}const c=this.contrastInfo.contrastRatioThreshold("aaa")||0,h=(this.contrastInfo.contrastRatio()||0)>=c;this.contrastPassFailAAA.removeChildren();const d=this.contrastPassFailAAA.createChild("span","contrast-link-label");if(d.textContent=m(u.aaa),this.contrastPassFailAAA.createChild("span").textContent=m(u.placeholderWithColon,{PH1:c.toFixed(1)}),h){const t=new n.Icon.Icon;t.data={iconName:"checkmark",color:"var(--icon-checkmark-green)",width:"20px",height:"14px"},this.contrastPassFailAAA.appendChild(t)}else{const t=new n.Icon.Icon;t.data={iconName:"clear",color:"var(--icon-error)",width:"14px",height:"14px"},this.contrastPassFailAAA.appendChild(t);const e=this.computeSuggestedColor("aaa");if(e){this.createFixColorButton(this.contrastPassFailAAA,e).addEventListener("click",(()=>this.onSuggestColor("aaa")))}}[l,d].forEach((t=>t.addEventListener("click",(()=>C.showHelp())))),this.elementInternal.classList.toggle("contrast-fail",!this.passesAA),this.contrastValueBubble.classList.toggle("contrast-aa",this.passesAA&&!h),this.contrastValueBubble.classList.toggle("contrast-aaa",h)}static showHelp(){o.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(a.UIUtils.addReferrerToURL("https://web.dev/color-and-contrast-accessibility/"))}setVisible(t){this.visibleInternal=t,this.elementInternal.classList.toggle("hidden",!t)}visible(){return this.visibleInternal}element(){return this.elementInternal}expandButtonClicked(){const t=this.contrastValueBubble.getComponentSelection();t&&t.empty(),this.toggleExpanded()}topRowClicked(t){const e=this.contrastValueBubble.getComponentSelection();e&&e.empty(),this.toggleExpanded(),t.consume(!0)}toggleExpanded(){this.expandedInternal=!this.expandedInternal,a.ARIAUtils.setExpanded(this.expandButton.element,this.expandedInternal),this.elementInternal.classList.toggle("collapsed",!this.expandedInternal),this.expandedInternal?(this.toggleMainColorPicker(!1),this.expandButton.setGlyph("chevron-up"),this.expandButton.setTitle(m(u.showLess)),this.contrastUnknown&&this.toggleBackgroundColorPickerInternal(!0)):(this.toggleBackgroundColorPickerInternal(!1),this.expandButton.setGlyph("chevron-down"),this.expandButton.setTitle(m(u.showMore))),this.expandedChangedCallback()}collapse(){this.elementInternal.classList.remove("expanded"),this.toggleBackgroundColorPickerInternal(!1),this.toggleMainColorPicker(!1)}expanded(){return this.expandedInternal}backgroundColorPickerEnabled(){return this.bgColorPickerButton.toggled()}toggleBackgroundColorPicker(t){this.toggleBackgroundColorPickerInternal(t,!1)}toggleBackgroundColorPickerInternal(t,e=!0){void 0===t&&(t=!this.bgColorPickerButton.toggled()),this.bgColorPickerButton.setToggled(t),e&&this.dispatchEventToListeners("BackgroundColorPickerWillBeToggled",t),o.InspectorFrontendHost.InspectorFrontendHostInstance.setEyeDropperActive(t),t?o.InspectorFrontendHost.InspectorFrontendHostInstance.events.addEventListener(o.InspectorFrontendHostAPI.Events.EyeDropperPickedColor,this.bgColorPickedBound):o.InspectorFrontendHost.InspectorFrontendHostInstance.events.removeEventListener(o.InspectorFrontendHostAPI.Events.EyeDropperPickedColor,this.bgColorPickedBound)}bgColorPicked({data:e}){const s=[e.r,e.g,e.b,(e.a/2.55|0)/100],r=t.Color.Legacy.fromRGBA(s);this.contrastInfo.setBgColor(r),this.toggleBackgroundColorPickerInternal(!1),o.InspectorFrontendHost.InspectorFrontendHostInstance.bringToFront()}}class b{parentElement;swatchElement;swatchInnerElement;textPreview;constructor(t){this.parentElement=t,this.swatchElement=t.createChild("span","swatch contrast swatch-inner-white"),this.swatchInnerElement=this.swatchElement.createChild("span","swatch-inner"),this.textPreview=this.swatchElement.createChild("div","text-preview"),this.textPreview.textContent="Aa"}setColors(t,e){this.textPreview.style.color=t.asString("rgba"),this.swatchInnerElement.style.backgroundColor=e.asString("rgba"),this.swatchElement.classList.toggle("swatch-inner-white",e.as("hsl").l>.9)}}var v=Object.freeze({__proto__:null,ContrastDetails:C,Swatch:b});class f extends t.ObjectWrapper.ObjectWrapper{isNullInternal;contrastRatioInternal;contrastRatioAPCAInternal;contrastRatioThresholds;contrastRationAPCAThreshold;fgColor;bgColorInternal;colorFormatInternal;constructor(e){if(super(),this.isNullInternal=!0,this.contrastRatioInternal=null,this.contrastRatioAPCAInternal=null,this.contrastRatioThresholds=null,this.contrastRationAPCAThreshold=0,this.fgColor=null,this.bgColorInternal=null,!e)return;if(!e.computedFontSize||!e.computedFontWeight||!e.backgroundColors||1!==e.backgroundColors.length)return;this.isNullInternal=!1,this.contrastRatioThresholds=t.ColorUtils.getContrastThreshold(e.computedFontSize,e.computedFontWeight),this.contrastRationAPCAThreshold=t.ColorUtils.getAPCAThreshold(e.computedFontSize,e.computedFontWeight);const o=e.backgroundColors[0],s=t.Color.parse(o)?.asLegacyColor();s&&this.setBgColorInternal(s)}isNull(){return this.isNullInternal}setColor(t,e){this.fgColor=t,this.colorFormatInternal=e,this.updateContrastRatio(),this.dispatchEventToListeners("ContrastInfoUpdated")}colorFormat(){return this.colorFormatInternal}color(){return this.fgColor}contrastRatio(){return this.contrastRatioInternal}contrastRatioAPCA(){return this.contrastRatioAPCAInternal}contrastRatioAPCAThreshold(){return this.contrastRationAPCAThreshold}setBgColor(t){this.setBgColorInternal(t),this.dispatchEventToListeners("ContrastInfoUpdated")}setBgColorInternal(e){if(this.bgColorInternal=e,!this.fgColor)return;const o=this.fgColor.rgba();if(e.hasAlpha()){const s=t.ColorUtils.blendColors(e.rgba(),o);this.bgColorInternal=new t.Color.Legacy(s,"rgba")}this.contrastRatioInternal=t.ColorUtils.contrastRatio(o,this.bgColorInternal.rgba()),this.contrastRatioAPCAInternal=t.ColorUtils.contrastRatioAPCA(this.fgColor.rgba(),this.bgColorInternal.rgba())}bgColor(){return this.bgColorInternal}updateContrastRatio(){this.bgColorInternal&&this.fgColor&&(this.contrastRatioInternal=t.ColorUtils.contrastRatio(this.fgColor.rgba(),this.bgColorInternal.rgba()),this.contrastRatioAPCAInternal=t.ColorUtils.contrastRatioAPCA(this.fgColor.rgba(),this.bgColorInternal.rgba()))}contrastRatioThreshold(t){return this.contrastRatioThresholds?this.contrastRatioThresholds[t]:null}}var x=Object.freeze({__proto__:null,ContrastInfo:f});class w{contrastInfo;visible;contrastRatioSVG;contrastRatioLines;width;height;contrastRatioLineBuilder;contrastRatioLinesThrottler;drawContrastRatioLinesBound;constructor(e,o){this.contrastInfo=e,this.visible=!1,this.contrastRatioSVG=a.UIUtils.createSVGChild(o,"svg","spectrum-contrast-container fill"),this.contrastRatioLines=new Map,r.Runtime.experiments.isEnabled("APCA")?this.contrastRatioLines.set("APCA",a.UIUtils.createSVGChild(this.contrastRatioSVG,"path","spectrum-contrast-line")):(this.contrastRatioLines.set("aa",a.UIUtils.createSVGChild(this.contrastRatioSVG,"path","spectrum-contrast-line")),this.contrastRatioLines.set("aaa",a.UIUtils.createSVGChild(this.contrastRatioSVG,"path","spectrum-contrast-line"))),this.width=0,this.height=0,this.contrastRatioLineBuilder=new A(this.contrastInfo),this.contrastRatioLinesThrottler=new t.Throttler.Throttler(0),this.drawContrastRatioLinesBound=this.drawContrastRatioLines.bind(this),this.contrastInfo.addEventListener("ContrastInfoUpdated",this.update.bind(this))}update(){this.visible&&!this.contrastInfo.isNull()&&(r.Runtime.experiments.isEnabled("APCA")&&null===this.contrastInfo.contrastRatioAPCA()||this.contrastInfo.contrastRatio()&&this.contrastRatioLinesThrottler.schedule(this.drawContrastRatioLinesBound))}setDimensions(t,e){this.width=t,this.height=e,this.update()}setVisible(t){this.visible=t,this.contrastRatioSVG.classList.toggle("hidden",!t),this.update()}async drawContrastRatioLines(){for(const[t,e]of this.contrastRatioLines){const o=this.contrastRatioLineBuilder.drawContrastRatioLine(this.width,this.height,t);o?e.setAttribute("d",o):e.removeAttribute("d")}}}class A{contrastInfo;constructor(t){this.contrastInfo=t}drawContrastRatioLine(e,o,s){const n=r.Runtime.experiments.isEnabled("APCA"),a=n?this.contrastInfo.contrastRatioAPCAThreshold():this.contrastInfo.contrastRatioThreshold(s);if(!e||!o||null===a)return null;const i=.02,l=this.contrastInfo.color(),c=this.contrastInfo.bgColor();if(!l||!c)return null;const h=l.rgba(),d=l.as("hsl").hsva(),p=c.rgba(),u=t.ColorUtils.luminance(p);let g=t.ColorUtils.blendColors(h,p);const m=t.ColorUtils.luminance(g)>u,C=n?t.ColorUtils.desiredLuminanceAPCA(u,a,m):t.Color.desiredLuminance(u,a,m);if(n&&Math.abs(Math.round(t.ColorUtils.contrastRatioByLuminanceAPCA(C,u)))<a)return null;let b=d[2],v=0;const f=[d[0],0,0,d[3]];let x=[];const w=[0,0,0,0];t.Color.hsva2rgba(f,w),g=t.ColorUtils.blendColors(w,p);let A,k=e=>t.ColorUtils.luminance(t.ColorUtils.blendColors(t.Color.Legacy.fromHSVA(e).rgba(),p));for(r.Runtime.experiments.isEnabled("APCA")&&(k=e=>t.ColorUtils.luminanceAPCA(t.ColorUtils.blendColors(t.Color.Legacy.fromHSVA(e).rgba(),p))),A=0;A<1.02;A+=i){A=Math.min(1,A),f[1]=A,f[2]=b+v*i;const s=t.Color.approachColorValue(f,p,2,C,k);if(null===s)break;v=0===A?0:(s-b)/i,b=s,x.push(x.length?"L":"M"),x.push((A*e).toFixed(2)),x.push(((1-s)*o).toFixed(2))}return A<1.02&&(A-=i,f[2]=1,A=t.Color.approachColorValue(f,p,1,C,k),null!==A&&(x=x.concat(["L",(A*e).toFixed(2),"-0.1"]))),0===x.length?null:x.join(" ")}}var k=Object.freeze({__proto__:null,ContrastOverlay:w,ContrastRatioLineBuilder:A});const E={colorClippedTooltipText:"This color was clipped to match the format's gamut. The actual result was {PH1}"},y=s.i18n.registerUIStrings("ui/legacy/components/color_picker/FormatPickerContextMenu.ts",E),I=s.i18n.getLocalizedString.bind(void 0,y);class F{#t;#e;constructor(t,e){this.#t=t,this.#e=e}async show(e,o){let s;const r=new Promise((t=>{s=t})),i=["nickname","hex","shorthex","hexa","shorthexa","rgb","rgba","hsl","hwb"],l=["lch","oklch","lab","oklab","srgb","srgb-linear","display-p3","a98-rgb","prophoto-rgb","rec2020","xyz","xyz-d50","xyz-d65"],c=new a.ContextMenu.ContextMenu(e,{useSoftMenu:!0,onSoftMenuClosed:()=>s?.()}),h=c.section("legacy"),d=c.section("wide"),p=c.section("color-function").appendSubMenuItem("color()").section();for(const e of[...i,...l]){if(e===this.#e)continue;const s=this.#t.as(e);if(s instanceof t.Color.Legacy){const t=1!==(this.#t.alpha??1);if(null!==s.alpha!==t)continue}const r=s.asString();if(!r)continue;let a;s.isGamutClipped()&&(a=new n.Icon.Icon,a.data={iconName:"warning",color:"var(--icon-default)",width:"16px",height:"16px"},a.style.marginLeft="1px",a.style.marginTop="-1px",a.style.minWidth="16px",a.style.minHeight="16px");const l=a?I(E.colorClippedTooltipText,{PH1:s.getAsRawString()??"none"}):void 0,c=()=>o(e);(i.includes(e)?h:s instanceof t.Color.ColorFunction?p:d).appendItem(r,c,!1,a,l)}await c.show(),await r}}var P=Object.freeze({__proto__:null,FormatPickerContextMenu:F});const B=new CSSStyleSheet;B.replaceSync(':host{width:232px;height:319px;user-select:none;overflow:hidden}:selection{background-color:var(--color-primary-old);color:var(--color-background)}.spectrum-color{position:relative;width:232px;height:127px;border-radius:2px 2px 0 0;overflow:hidden;flex:none;touch-action:none}.spectrum-dragger,\n.spectrum-slider{user-select:none}.spectrum-dragger{border-radius:12px;height:12px;width:12px;border:1px solid var(--color-background);cursor:move;z-index:1;position:absolute;top:0;left:0;background:var(--color-background-inverted);box-shadow:var(--drop-shadow)}.spectrum-slider{position:absolute;top:-1px;cursor:ew-resize;width:13px;height:13px;border-radius:13px;background-color:var(--color-background-elevation-1);box-shadow:var(--drop-shadow)}.spectrum-color:focus .spectrum-dragger{border:1px solid var(--legacy-accent-color-hover)}.spectrum-tools{position:relative;height:110px;width:100%;flex:none}.spectrum-hue{top:16px;background:linear-gradient(to left,#f00 0%,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,#f00 100%)}.spectrum-hue.display-p3{background:linear-gradient(to left,color(display-p3 1 0 0) 0%,color(display-p3 1 1 0) 17%,color(display-p3 0 1 0) 33%,color(display-p3 0 1 1) 50%,color(display-p3 0 0 1) 67%,color(display-p3 1 0 1) 83%,color(display-p3 1 0 0) 100%)}.spectrum-alpha{top:35px;background-image:var(--image-file-checker);background-size:12px 11px}.spectrum-alpha-background{height:100%;border-radius:2px}.spectrum-hue,\n.spectrum-alpha{position:absolute;left:86px;width:130px;height:11px;border-radius:2px;touch-action:none}.spectrum-hue:focus-visible .spectrum-slider,\n.spectrum-alpha:focus-visible .spectrum-slider{border:1px solid var(--legacy-accent-color-hover);width:14px;height:14px;border-radius:14px}.spectrum-sat,\n.-theme-preserve{background-image:linear-gradient(to right,#fff,rgb(204 154 129/0%))}.spectrum-val,\n.-theme-preserve{background-image:linear-gradient(to top,#000,rgb(204 154 129/0%))}.spectrum-contrast-details{position:relative;background-color:var(--color-background);width:100%;height:83px;top:0;font-size:13px;color:var(--color-text-primary);border-top:var(--legacy-divider-border);line-height:initial;overflow:hidden;flex:none}.spectrum-contrast-details.collapsed{height:36px;flex:none}.spectrum-contrast-details div.toolbar.expand{position:absolute;right:6px;top:6px;margin:0}.spectrum-contrast-details.visible{display:initial}.spectrum-contrast-details div.container{margin:10px}.spectrum-contrast-details .expanded-details{display:flex;margin:12px 12px 0 4px}.spectrum-contrast-details.collapsed .expanded-details{display:none}.contrast-pass-fail{margin-left:0.5em;display:flex;align-items:center}.contrast-choose-bg-color{margin:8px 0 0 5px;font-style:italic}.spectrum-contrast-details .contrast-choose-bg-color,\n.spectrum-contrast-details .contrast-thresholds{width:150px}.contrast-threshold:first-child{margin-bottom:5px}.contrast-fix-button{cursor:pointer;font-size:13px;padding:0;margin:0 0 0 10px;background:0;width:12px;height:12px;border:1px solid rgb(0 0 0/10%);display:inline-block;position:relative}.contrast-fix-button::after{content:" ";width:13px;height:13px;background-image:var(--image-file-refresh);background-size:contain;position:absolute;left:5.5px;top:3.5px;background-color:var(--color-background);border-radius:50%}.contrast-fix-button:hover,\n.contrast-fix-button:focus{border:1px solid var(--legacy-accent-color-hover);transform:scale(1.2)}.contrast-link-label{cursor:pointer}.contrast-link-label:hover{text-decoration:underline}.spectrum-contrast-details .background-color{position:absolute;flex:none;right:12px}.spectrum-eye-dropper{width:32px;height:24px;position:relative;left:8px;top:17px;cursor:pointer}.spectrum-contrast-details .spectrum-eye-dropper{top:2px;right:34px;position:absolute;left:auto}.contrast-details-value{color:var(--color-text-primary);margin:1px 5px;user-select:text}.contrast-pass-fail devtools-icon{margin-left:5px}.contrast-details-value [is="ui-icon"]{display:none;margin-left:5px;background-color:var(--color-text-primary)}.spectrum-contrast-details .toolbar-state-on [is="ui-icon"]{background-color:var(--color-text-secondary)}[is="ui-icon"].clear{transform:scale(0.7);background-color:var(--icon-error)}.contrast-pass-fail span[is="ui-icon"]{margin-left:5px}[is="ui-icon"].checkmark,\n[is="ui-icon"].check-double{background-color:var(--icon-checkmark-green)}.spectrum-contrast-details .contrast-details-value.contrast-unknown{background-color:var(--color-background);color:var(--color-text-primary);width:3em;text-align:center}.contrast-details-value .clear,\n.contrast-details-value .checkmark,\n.contrast-details-value .check-double{cursor:pointer;vertical-align:-5px}.spectrum-contrast-details.contrast-fail .contrast-details-value .clear,\n.contrast-details-value.contrast-aa .checkmark,\n.contrast-details-value.contrast-aaa .check-double{display:inline-block}.swatch{width:32px;height:32px;margin:0;position:absolute;top:15px;left:44px;background-image:var(--image-file-checker);border-radius:16px}.swatch-inner,\n.swatch-overlay{position:absolute;width:100%;height:100%;display:inline-block;border-radius:16px}.swatch-inner-white{border:1px solid var(--color-background-elevation-2)}.swatch-overlay{cursor:pointer;opacity:0%;padding:4px}.swatch-overlay:hover,\n.swatch-overlay:focus-visible{background-color:var(--color-background-inverted-opacity-30);opacity:100%}.swatch-overlay:active{background-color:var(--color-background-inverted-opacity-50)}[is="ui-icon"].icon-mask.copy-color-icon{background-color:var(--color-background);margin-top:2px;margin-left:2px}.spectrum-text{position:absolute;top:60px;left:16px}.spectrum-text-value{display:inline-block;width:40px;overflow:hidden;text-align:center;margin-right:6px;line-height:20px;padding:0;color:var(--color-text-primary);white-space:nowrap;box-shadow:var(--legacy-focus-ring-inactive-shadow)}.spectrum-text-label{letter-spacing:39.5px;margin-top:8px;display:block;color:var(--color-text-disabled);margin-left:16px;width:174px}.spectrum-text-hex > .spectrum-text-value{width:178px}.spectrum-text-hex > .spectrum-text-label{letter-spacing:normal;margin-left:0;text-align:center}.spectrum-switcher{border-radius:2px;height:20px;width:20px;padding:2px;border:none;background:none;margin:0}.spectrum-display-switcher{top:72px;position:absolute;right:10px}.spectrum-switcher:hover{background-color:var(--color-background-elevation-2)}.spectrum-switcher:focus-visible{background-color:var(--legacy-focus-bg-color)}.spectrum-palette-container{border-top:var(--legacy-divider-border);position:relative;width:100%;padding:6px 24px 6px 6px;display:flex;flex-wrap:wrap}.spectrum-palette{display:flex;flex-wrap:wrap;width:198px}.spectrum-palette-color{width:12px;height:12px;flex:0 0 12px;border-radius:2px;margin:6px;cursor:pointer;position:relative;border:1px solid var(--color-details-hairline);background-position:-1px!important;z-index:14}.spectrum-palette-color-shadow{position:absolute;opacity:0%;margin:0;top:-5px;left:3px;border:0;border-radius:1px;width:11px;height:11px}.spectrum-palette-color:hover:not(.spectrum-shades-shown) > .spectrum-palette-color-shadow,\n.spectrum-palette-color:focus:not(.spectrum-shades-shown) > .spectrum-palette-color-shadow{opacity:20%}.spectrum-palette-color:hover:not(.spectrum-shades-shown) > .spectrum-palette-color-shadow:first-child,\n.spectrum-palette-color:focus:not(.spectrum-shades-shown) > .spectrum-palette-color-shadow:first-child{opacity:60%;top:-3px;left:1px}.palette-color-shades{position:absolute;background-color:var(--color-background);height:228px;width:28px;box-shadow:var(--drop-shadow);z-index:14;border-radius:2px;transform-origin:0 228px;margin-top:16px;margin-left:-8px}.spectrum-palette > .spectrum-palette-color.spectrum-shades-shown{z-index:15}.palette-color-shades > .spectrum-palette-color{margin:8px 0 0;margin-left:8px;width:12px}.spectrum-palette > .spectrum-palette-color{transition:transform 100ms cubic-bezier(0,0,0.2,1);will-change:transform;z-index:13}.palette-preview > .spectrum-palette-color{margin-top:1px}.spectrum-palette > .spectrum-palette-color.empty-color{border-color:transparent}.spectrum-palette-color:not(.has-material-shades):focus{border:1px solid var(--legacy-accent-color-hover);transform:scale(1.4)}.palette-color-shades > .spectrum-palette-color:not(.empty-color):hover,\n.spectrum-palette > .spectrum-palette-color:not(.empty-color):not(.has-material-shades):hover{transform:scale(1.15)}.add-color-toolbar{margin-left:-3px;margin-top:-1px}.spectrum-palette-switcher{right:10px;top:0;margin-top:9px;position:absolute}.palette-panel{width:100%;position:absolute;top:100%;display:flex;flex-direction:column;background-color:var(--color-background);z-index:14;transition:transform 200ms cubic-bezier(0,0,0.2,1),visibility 0s 200ms;border-top:var(--legacy-divider-border);visibility:hidden}.palette-panel-showing > .palette-panel{transform:translateY(-100%);transition-delay:0s;visibility:visible}.palette-panel > div.toolbar{position:absolute;right:6px;top:6px}.palette-panel > div:not(.toolbar){flex:0 0 38px;border-bottom:var(--legacy-divider-border);padding:12px;line-height:14px;color:var(--color-text-primary)}.palette-panel > div.palette-title{font-size:14px;line-height:16px;color:var(--color-text-primary);flex-basis:40px}div.palette-preview{display:flex;cursor:pointer}.palette-preview-title{flex:0 0 84px}.palette-preview:focus-visible,\n.palette-preview:hover{background-color:var(--color-background-elevation-1)}.spectrum-overlay{z-index:13;visibility:hidden;background-color:hsl(0deg 0% 0%/50%);opacity:0%;transition:opacity 100ms cubic-bezier(0,0,0.2,1),visibility 0s 100ms}.palette-panel-showing > .spectrum-overlay{transition-delay:0s;visibility:visible;opacity:100%}.spectrum-contrast-container{width:100%;height:100%}.spectrum-contrast-line,\n:host-context(.-theme-with-dark-background) .spectrum-contrast-line{fill:none;stroke:#fff;opacity:70%;stroke-width:1.5px}.delete-color-toolbar{position:absolute;right:0;top:0;background-color:var(--color-background-elevation-1);visibility:hidden;z-index:3;width:36px;display:flex;align-items:center;padding-left:4px;bottom:2px;border-bottom-right-radius:2px}@keyframes showDeleteToolbar{from{opacity:0%}to{opacity:100%}}.delete-color-toolbar.dragging{visibility:visible;animation:showDeleteToolbar 100ms 150ms cubic-bezier(0,0,0.2,1) backwards}.delete-color-toolbar-active{background-color:var(--color-background-elevation-2);color:var(--color-background)}.swatch.contrast{width:30px;height:30px;position:absolute;top:0;right:0;left:auto;background-image:var(--image-file-checker);border-radius:15px;display:flex;align-items:center;justify-content:center}.swatch.contrast .swatch-overlay{padding:0}.background-color .text-preview{color:var(--color-background-inverted);font-size:16px;position:relative;padding-bottom:2px}.swatch.contrast [is="ui-icon"]{margin:-2px}.no-contrast-info-available{border-top:var(--legacy-divider-border);position:relative;width:100%;padding:10px;justify-content:center;display:flex;flex-wrap:wrap}@media (forced-colors: active){:host{border:1px solid canvastext!important}.spectrum-color{forced-color-adjust:none}.spectrum-switcher:hover,\n .spectrum-switcher:focus-visible{forced-color-adjust:none;background-color:Highlight!important}:host-context(.-theme-with-dark-background) .spectrum-switcher{filter:unset}.spectrum-switcher:hover svg,\n .spectrum-switcher:focus-visible svg{fill:HighlightText}.swatch{forced-color-adjust:none}.swatch-inner,\n .swatch-overlay,\n .swatch-inner-white{border:1px solid ButtonText}.swatch-overlay:hover,\n .swatch-overlay:focus-visible{background-color:canvas!important}.spectrum-slider{forced-color-adjust:none;background-color:ButtonText!important;box-shadow:0 1px 4px 0 ButtonFace!important}}\n/*# sourceURL=spectrum.css */\n');const S={toggleColorPicker:"Eye dropper [{PH1}]",changeHue:"Change hue",changeAlpha:"Change alpha",hex:"HEX",changeColorFormat:"Change color format",previewPalettes:"Preview palettes",addToPalette:"Add to palette",colorPalettes:"Color Palettes",returnToColorPicker:"Return to color picker",colorS:"Color {PH1}",longclickOrLongpressSpaceToShow:"Long-click or long-press space to show alternate shades of {PH1}",removeColor:"Remove color",removeAllToTheRight:"Remove all to the right",clearPalette:"Clear palette",sInS:"{PH1} in {PH2}",copyColorToClipboard:"Copy color to clipboard",pressArrowKeysMessage:"Press arrow keys with or without modifiers to move swatch position. Arrow key with Shift key moves position largely, with Ctrl key it is less and with Alt key it is even less"},L=s.i18n.registerUIStrings("ui/legacy/components/color_picker/Spectrum.ts",S),T=s.i18n.getLocalizedString.bind(void 0,L),R=new WeakMap,D=new WeakMap,U=["srgb","nickname","rgb","hex","hsl","hwb","shorthex"];function H(t){return!U.includes(t)}function V(e,o){const s=t.Color.Legacy.fromHSVA(o);switch(e){case"display-p3":{const e=[0,0,0,0];return t.Color.hsva2rgba(o,e),new t.Color.ColorFunction("display-p3",e[0],e[1],e[2],e[3],void 0)}case"srgb":return s}}class M extends(t.ObjectWrapper.eventMixin(a.Widget.VBox)){colorInternal;gamut="srgb";colorElement;colorDragElement;dragX;dragY;colorPickerButton;swatch;hueElement;hueSlider;alphaElement;alphaElementBackground;alphaSlider;displayContainer;textValues;textLabels;hexContainer;hexValue;contrastInfo;srgbOverlay;contrastOverlay;contrastDetails;contrastDetailsBackgroundColorPickedToggledBound;palettes;palettePanel;palettePanelShowing;paletteSectionContainer;paletteContainer;shadesContainer;deleteIconToolbar;deleteButton;addColorToolbar;colorPickedBound;hsv;hueAlphaWidth;dragWidth;dragHeight;colorDragElementHeight;slideHelperWidth;numPaletteRowsShown;selectedColorPalette;customPaletteSetting;colorOffset;closeButton;paletteContainerMutable;eyeDropperExperimentEnabled;shadesCloseHandler;dragElement;dragHotSpotX;dragHotSpotY;colorNameInternal;colorFormat="rgb";eyeDropperAbortController=null;isFormatPickerShown=!1;colorStringInternal;constructor(t){super(!0),this.contentElement.tabIndex=0,this.colorElement=this.contentElement.createChild("div","spectrum-color"),this.colorElement.tabIndex=0,this.setDefaultFocusedElement(this.colorElement),this.colorElement.addEventListener("keydown",this.onSliderKeydown.bind(this,b.bind(this)));const o=T(S.pressArrowKeysMessage);a.ARIAUtils.setLabel(this.colorElement,o),a.ARIAUtils.markAsApplication(this.colorElement),this.colorDragElement=this.colorElement.createChild("div","spectrum-sat fill").createChild("div","spectrum-val fill").createChild("div","spectrum-dragger"),this.dragX=0,this.dragY=0;const s=this.contentElement.createChild("div","spectrum-tools"),r=new a.Toolbar.Toolbar("spectrum-eye-dropper",s),i=a.ShortcutRegistry.ShortcutRegistry.instance().shortcutsForAction("elements.toggle-eye-dropper")[0]?.descriptors.flatMap((t=>t.name.split(" + ")))[0];this.colorPickerButton=new a.Toolbar.ToolbarToggle(T(S.toggleColorPicker,{PH1:i||""}),"color-picker","color-picker-filled"),this.colorPickerButton.setToggled(!0),this.colorPickerButton.addEventListener(a.Toolbar.ToolbarButton.Events.Click,this.toggleColorPicker.bind(this,void 0)),r.appendToolbarItem(this.colorPickerButton),this.swatch=new $(s),this.hueElement=s.createChild("div","spectrum-hue"),this.hueElement.tabIndex=0,this.hueElement.addEventListener("keydown",this.onSliderKeydown.bind(this,g.bind(this))),a.ARIAUtils.setLabel(this.hueElement,T(S.changeHue)),a.ARIAUtils.markAsSlider(this.hueElement,0,360),this.hueSlider=this.hueElement.createChild("div","spectrum-slider"),this.alphaElement=s.createChild("div","spectrum-alpha"),this.alphaElement.tabIndex=0,this.alphaElement.addEventListener("keydown",this.onSliderKeydown.bind(this,m.bind(this))),a.ARIAUtils.setLabel(this.alphaElement,T(S.changeAlpha)),a.ARIAUtils.markAsSlider(this.alphaElement,0,1),this.alphaElementBackground=this.alphaElement.createChild("div","spectrum-alpha-background"),this.alphaSlider=this.alphaElement.createChild("div","spectrum-slider"),this.displayContainer=s.createChild("div","spectrum-text source-code"),a.ARIAUtils.markAsPoliteLiveRegion(this.displayContainer,!0),this.textValues=[];for(let t=0;t<4;++t){const t=a.UIUtils.createInput("spectrum-text-value");this.displayContainer.appendChild(t),t.maxLength=4,this.textValues.push(t),t.addEventListener("keydown",this.inputChanged.bind(this),!1),t.addEventListener("input",this.inputChanged.bind(this),!1),t.addEventListener("wheel",this.inputChanged.bind(this),!1),t.addEventListener("paste",this.pasted.bind(this),!1)}this.textLabels=this.displayContainer.createChild("div","spectrum-text-label"),this.hexContainer=s.createChild("div","spectrum-text spectrum-text-hex source-code"),a.ARIAUtils.markAsPoliteLiveRegion(this.hexContainer,!0),this.hexValue=a.UIUtils.createInput("spectrum-text-value"),this.hexContainer.appendChild(this.hexValue),this.hexValue.maxLength=9,this.hexValue.addEventListener("keydown",this.inputChanged.bind(this),!1),this.hexValue.addEventListener("input",this.inputChanged.bind(this),!1),this.hexValue.addEventListener("wheel",this.inputChanged.bind(this),!1),this.hexValue.addEventListener("paste",this.pasted.bind(this),!1);const c=this.hexContainer.createChild("div","spectrum-text-label");c.textContent=T(S.hex),a.ARIAUtils.setLabel(this.hexValue,c.textContent);const h=s.createChild("button","spectrum-display-switcher spectrum-switcher");v(h),a.UIUtils.setTitle(h,T(S.changeColorFormat)),h.tabIndex=0,h.addEventListener("click",(t=>{this.showFormatPicker(t)})),a.UIUtils.installDragHandle(this.hueElement,this.dragStart.bind(this,g.bind(this)),g.bind(this),null,"ew-resize","crosshair"),a.UIUtils.installDragHandle(this.alphaElement,this.dragStart.bind(this,m.bind(this)),m.bind(this),null,"ew-resize","crosshair"),a.UIUtils.installDragHandle(this.colorElement,this.dragStart.bind(this,b.bind(this)),b.bind(this),null,"move","crosshair"),t&&(this.contrastInfo=t,this.contrastOverlay=new w(this.contrastInfo,this.colorElement),this.contrastDetails=new C(this.contrastInfo,this.contentElement,this.toggleColorPicker.bind(this),this.contrastPanelExpandedChanged.bind(this),this.colorSelected.bind(this)),this.contrastDetailsBackgroundColorPickedToggledBound=this.contrastDetailsBackgroundColorPickedToggled.bind(this)),this.element.classList.add("flex-none"),this.palettes=new Map,this.palettePanel=this.contentElement.createChild("div","palette-panel"),this.palettePanelShowing=!1,this.paletteSectionContainer=this.contentElement.createChild("div","spectrum-palette-container"),this.paletteContainer=this.paletteSectionContainer.createChild("div","spectrum-palette"),this.paletteContainer.addEventListener("contextmenu",this.showPaletteColorContextMenu.bind(this,-1)),this.shadesContainer=this.contentElement.createChild("div","palette-color-shades hidden"),a.UIUtils.installDragHandle(this.paletteContainer,this.paletteDragStart.bind(this),this.paletteDrag.bind(this),this.paletteDragEnd.bind(this),"default");const d=this.paletteSectionContainer.createChild("div","spectrum-palette-switcher spectrum-switcher");v(d),a.UIUtils.setTitle(d,T(S.previewPalettes)),a.ARIAUtils.markAsButton(d),d.tabIndex=0,self.onInvokeElement(d,(t=>{this.togglePalettePanel(!0),t.consume(!0)})),this.deleteIconToolbar=new a.Toolbar.Toolbar("delete-color-toolbar"),this.deleteButton=new a.Toolbar.ToolbarButton("","bin"),this.deleteIconToolbar.appendToolbarItem(this.deleteButton);this.contentElement.createChild("div","spectrum-overlay fill").addEventListener("click",this.togglePalettePanel.bind(this,!1)),this.addColorToolbar=new a.Toolbar.Toolbar("add-color-toolbar");const p=new a.Toolbar.ToolbarButton(T(S.addToPalette),"plus");function u(t,e){const o=e,s=t.getBoundingClientRect();switch(o.key){case"ArrowLeft":case"ArrowDown":return s.left-1;case"ArrowRight":case"ArrowUp":return s.right+1;default:return e.x}}function g(t){const o=this.hsv.slice(),s=1-(u(this.hueSlider,t)-this.hueElement.getBoundingClientRect().left)/this.hueAlphaWidth;o[0]=e.NumberUtilities.clamp(s,0,1),this.innerSetColor(o,"",void 0,void 0,O.Other);const r=V(this.gamut,o).as("hsl").canonicalHSLA();a.ARIAUtils.setValueNow(this.hueElement,r[0])}function m(t){const o=this.hsv.slice(),s=(u(this.alphaSlider,t)-this.hueElement.getBoundingClientRect().left)/this.hueAlphaWidth,r=Math.round(100*s)/100;o[3]=e.NumberUtilities.clamp(r,0,1),this.innerSetColor(o,"",void 0,void 0,O.Other);const n=V(this.gamut,o).as("hsl").canonicalHSLA();a.ARIAUtils.setValueText(this.alphaElement,n[3])}function b(t){const o=this.hsv.slice(),s=function(t,e){const o=t.getBoundingClientRect(),s=o.x+o.width/2,r=o.y+o.width/2,n=function(t,e){const o=e;o.altKey?t=1:o.ctrlKey?t=10:o.shiftKey&&(t=20);return t}(o.width/4,e);switch(e.key){case"ArrowLeft":return{x:o.left-n,y:r};case"ArrowRight":return{x:o.right+n,y:r};case"ArrowDown":return{x:s,y:o.bottom+n};case"ArrowUp":return{x:s,y:o.top-n};default:return{x:e.x,y:e.y}}}(this.colorDragElement,t);this.colorOffset=this.colorElement.getBoundingClientRect(),o[1]=e.NumberUtilities.clamp((s.x-this.colorOffset.left)/this.dragWidth,0,1),o[2]=e.NumberUtilities.clamp(1-(s.y-this.colorOffset.top)/this.dragHeight,0,1),this.innerSetColor(o,"",void 0,void 0,O.Other)}function v(t){const e=new n.Icon.Icon;e.data={iconName:"fold-more",color:"var(--icon-default)",width:"16px",height:"16px"},t.appendChild(e)}p.addEventListener(a.Toolbar.ToolbarButton.Events.Click,this.onAddColorMousedown.bind(this)),p.element.addEventListener("keydown",this.onAddColorKeydown.bind(this)),this.addColorToolbar.appendToolbarItem(p),this.colorPickedBound=this.colorPicked.bind(this),this.numPaletteRowsShown=-1,this.contentElement.addEventListener("focusout",(t=>{this.isFormatPickerShown&&t.stopImmediatePropagation()})),this.srgbOverlay=new l.SrgbOverlay.SrgbOverlay,this.loadPalettes(),new j((t=>{t.colors.length?this.addPalette(t):this.selectedColorPalette.get()===t.title&&this.paletteSelected(G)}))}dragStart(t,e){return this.colorOffset=this.colorElement.getBoundingClientRect(),t(e),!0}contrastDetailsBackgroundColorPickedToggled(t){t.data&&this.toggleColorPicker(!1)}contrastPanelExpandedChanged(){this.contrastOverlay&&this.contrastDetails&&(this.contrastOverlay.setVisible(this.contrastDetails.expanded()),this.resizeForSelectedPalette(!0),this.contrastDetails.expanded()?this.hideSrgbOverlay():this.showSrgbOverlay())}updatePalettePanel(){this.palettePanel.removeChildren();this.palettePanel.createChild("div","palette-title").textContent=T(S.colorPalettes);const t=new a.Toolbar.Toolbar("",this.palettePanel);this.closeButton=new a.Toolbar.ToolbarButton(T(S.returnToColorPicker),"cross"),this.closeButton.addEventListener(a.Toolbar.ToolbarButton.Events.Click,this.togglePalettePanel.bind(this,!1)),this.closeButton.element.addEventListener("keydown",this.onCloseBtnKeydown.bind(this)),t.appendToolbarItem(this.closeButton);for(const t of this.palettes.values())this.palettePanel.appendChild(this.createPreviewPaletteElement(t));this.contentElement.scrollIntoView({block:"end"})}togglePalettePanel(t){this.palettePanelShowing!==t&&(t&&this.updatePalettePanel(),this.palettePanelShowing=t,this.contentElement.classList.toggle("palette-panel-showing",t),this.focusInternal())}onCloseBtnKeydown(t){(e.KeyboardUtilities.isEscKey(t)||e.KeyboardUtilities.isEnterOrSpaceKey(t))&&(this.togglePalettePanel(!1),t.consume(!0))}onSliderKeydown(t,e){switch(e.key){case"ArrowLeft":case"ArrowRight":case"ArrowDown":case"ArrowUp":t(e),e.consume(!0)}}focusInternal(){this.isShowing()&&(this.palettePanelShowing&&this.closeButton?this.closeButton.element.focus({preventScroll:!0}):this.contentElement.focus())}createPaletteColor(t,o,s){const r=document.createElement("div");return r.classList.add("spectrum-palette-color"),r.style.background=e.StringUtilities.sprintf("linear-gradient(%s, %s), var(--image-file-checker)",t,t),s&&r.animate([{opacity:0},{opacity:1}],{duration:100,delay:s,fill:"backwards"}),a.Tooltip.Tooltip.install(r,o||t),r}showPalette(t,e,o){this.resizeForSelectedPalette(),this.paletteContainer.removeChildren();for(let o=0;o<t.colors.length;o++){const s=e?100*o/t.colors.length:0,r=this.createPaletteColor(t.colors[o],t.colorNames[o],s);if(a.ARIAUtils.markAsButton(r),a.ARIAUtils.setLabel(r,T(S.colorS,{PH1:t.colors[o]})),r.tabIndex=-1,r.addEventListener("mousedown",this.paletteColorSelected.bind(this,t.colors[o],t.colorNames[o],Boolean(t.matchUserFormat))),r.addEventListener("focus",this.paletteColorSelected.bind(this,t.colors[o],t.colorNames[o],Boolean(t.matchUserFormat))),r.addEventListener("keydown",this.onPaletteColorKeydown.bind(this,o)),t.mutable)R.set(r,!0),D.set(r,t.colors[o]),r.addEventListener("contextmenu",this.showPaletteColorContextMenu.bind(this,o));else if(t===G){r.classList.add("has-material-shades");let e=r.createChild("div","spectrum-palette-color spectrum-palette-color-shadow");e.style.background=t.colors[o],e=r.createChild("div","spectrum-palette-color spectrum-palette-color-shadow"),e.style.background=t.colors[o];const s=T(S.longclickOrLongpressSpaceToShow,{PH1:t.colors[o]});a.Tooltip.Tooltip.install(r,s),a.ARIAUtils.setLabel(r,s),new a.UIUtils.LongClickController(r,this.showLightnessShades.bind(this,r,t.colors[o]))}this.paletteContainer.appendChild(r)}this.paletteContainer.childNodes.length>0&&(this.paletteContainer.childNodes[0].tabIndex=0),this.paletteContainerMutable=t.mutable,t.mutable?(this.paletteContainer.appendChild(this.addColorToolbar.element),this.paletteContainer.appendChild(this.deleteIconToolbar.element)):(this.addColorToolbar.element.remove(),this.deleteIconToolbar.element.remove()),this.togglePalettePanel(!1),this.focusInternal()}showLightnessShades(t,e,o){this.shadesCloseHandler&&this.shadesCloseHandler(),this.shadesContainer.classList.remove("hidden"),this.shadesContainer.removeChildren(),this.shadesContainer.animate([{transform:"scaleY(0)",opacity:"0"},{transform:"scaleY(1)",opacity:"1"}],{duration:200,easing:"cubic-bezier(0.4, 0, 0.2, 1)"});let s=this.paletteContainer.offsetTop+t.offsetTop+(t.parentElement?t.parentElement.offsetTop:0);this.contrastDetails&&(s+=this.contrastDetails.element().offsetHeight),this.shadesContainer.style.top=s+"px",this.shadesContainer.style.left=t.offsetLeft+"px",t.classList.add("spectrum-shades-shown");const r=K.get(e);if(void 0!==r)for(let e=r.length-1;e>=0;e--){const o=this.createPaletteColor(r[e],void 0,200*e/r.length+100);a.ARIAUtils.markAsButton(o),a.ARIAUtils.setLabel(o,T(S.colorS,{PH1:r[e]})),o.tabIndex=-1,o.addEventListener("mousedown",this.paletteColorSelected.bind(this,r[e],r[e],!1)),o.addEventListener("focus",this.paletteColorSelected.bind(this,r[e],r[e],!1)),o.addEventListener("keydown",this.onShadeColorKeydown.bind(this,t)),this.shadesContainer.appendChild(o)}this.shadesContainer.childNodes.length>0&&this.shadesContainer.childNodes[this.shadesContainer.childNodes.length-1].focus(),this.shadesCloseHandler=function(t){this.shadesContainer.classList.add("hidden"),t.classList.remove("spectrum-shades-shown"),this.shadesCloseHandler&&this.shadesContainer.ownerDocument.removeEventListener("mousedown",this.shadesCloseHandler,!0),delete this.shadesCloseHandler}.bind(this,t),this.shadesContainer.ownerDocument.addEventListener("mousedown",this.shadesCloseHandler,!0)}slotIndexForEvent(t){const e=t,o=e.pageX-this.paletteContainer.getBoundingClientRect().left,s=e.pageY-this.paletteContainer.getBoundingClientRect().top,r=Math.min(o/N|0,W-1),n=s/N|0;return Math.min(n*W+r,this.customPaletteSetting.get().colors.length-1)}isDraggingToBin(t){return t.pageX>this.deleteIconToolbar.element.getBoundingClientRect().left}paletteDragStart(t){const e=a.UIUtils.deepElementFromEvent(t);if(!e||!R.get(e))return!1;const o=this.slotIndexForEvent(t);this.dragElement=e;const s=t;return this.dragHotSpotX=s.pageX-o%W*N,this.dragHotSpotY=s.pageY-(o/W|0)*N,!0}paletteDrag(t){const e=t;if(e.pageX<this.paletteContainer.getBoundingClientRect().left||e.pageY<this.paletteContainer.getBoundingClientRect().top)return;if(!this.dragElement||void 0===this.dragHotSpotX||void 0===this.dragHotSpotY)return;const o=this.slotIndexForEvent(t),s=e.pageX-o%W*N,r=e.pageY-(o/W|0)*N,n=this.isDraggingToBin(t);this.deleteIconToolbar.element.classList.add("dragging"),this.deleteIconToolbar.element.classList.toggle("delete-color-toolbar-active",n);const a="translateX("+(s-this.dragHotSpotX)+"px) translateY("+(r-this.dragHotSpotY)+"px)";this.dragElement.style.transform=n?a+" scale(0.8)":a;const i=[...this.paletteContainer.children],l=i.indexOf(this.dragElement),c=new Map;for(const t of i)c.set(t,t.getBoundingClientRect());l!==o&&this.paletteContainer.insertBefore(this.dragElement,i[o>l?o+1:o]);for(const t of i){if(t===this.dragElement)continue;const e=c.get(t),o=t.getBoundingClientRect();!e||e.left===o.left&&e.top===o.top||t.animate([{transform:"translateX("+(e.left-o.left)+"px) translateY("+(e.top-o.top)+"px)"},{transform:"none"}],{duration:100,easing:"cubic-bezier(0, 0, 0.2, 1)"})}}paletteDragEnd(t){if(!this.dragElement)return;this.isDraggingToBin(t)&&this.dragElement.remove(),this.dragElement.style.removeProperty("transform");const e=this.paletteContainer.children,o=[];for(let t=0;t<e.length;++t){const s=D.get(e[t]);s&&o.push(s)}const s=this.customPaletteSetting.get();s.colors=o,this.customPaletteSetting.set(s),this.showPalette(s,!1),this.deleteIconToolbar.element.classList.remove("dragging"),this.deleteIconToolbar.element.classList.remove("delete-color-toolbar-active")}loadPalettes(){this.palettes.set(G.title,G);const e={title:"Custom",colors:[],colorNames:[],mutable:!0,matchUserFormat:void 0};this.customPaletteSetting=t.Settings.Settings.instance().createSetting("customColorPalette",e);const o=this.customPaletteSetting.get();o.colorNames=o.colorNames||[],this.palettes.set(o.title,o),this.selectedColorPalette=t.Settings.Settings.instance().createSetting("selectedColorPalette",_);const s=this.palettes.get(this.selectedColorPalette.get());s&&this.showPalette(s,!0)}addPalette(t){this.palettes.set(t.title,t),this.selectedColorPalette.get()===t.title&&this.showPalette(t,!0)}createPreviewPaletteElement(t){const e=document.createElement("div");e.classList.add("palette-preview"),a.ARIAUtils.markAsButton(e),e.tabIndex=0;let o;for(e.createChild("div","palette-preview-title").textContent=t.title,o=0;o<5&&o<t.colors.length;o++)e.appendChild(this.createPaletteColor(t.colors[o],t.colorNames[o]));for(;o<5;o++)e.createChild("div","spectrum-palette-color empty-color");return self.onInvokeElement(e,(e=>{this.paletteSelected(t),e.consume(!0)})),e}paletteSelected(t){this.selectedColorPalette.set(t.title),this.showPalette(t,!0)}resizeForSelectedPalette(t){const e=this.palettes.get(this.selectedColorPalette.get());if(!e)return;let o=e.colors.length;e===this.customPaletteSetting.get()&&o++;const s=Math.max(1,Math.ceil(o/W));if(this.numPaletteRowsShown===s&&!t)return;this.numPaletteRowsShown=s;let r=236;this.contrastDetails&&(this.contrastDetails.expanded()?r+=78:r+=36),this.element.style.height=r+12+24*s+"px",this.dispatchEventToListeners(z.SizeChanged)}paletteColorSelected(e,o,s){const r=t.Color.parse(e);r&&this.innerSetColor(r,e,o,s?this.colorFormat:r.format(),O.Other)}onPaletteColorKeydown(t,e){let o;switch(e.key){case"ArrowLeft":o=t-1;break;case"ArrowRight":o=t+1;break;case"ArrowUp":o=t-W;break;case"ArrowDown":o=t+W}void 0!==o&&o>-1&&o<this.paletteContainer.childNodes.length&&this.paletteContainer.childNodes[o].focus()}onShadeColorKeydown(t,o){const s=o.target;e.KeyboardUtilities.isEscKey(o)||"Tab"===o.key?(t.focus(),this.shadesCloseHandler&&this.shadesCloseHandler(),o.consume(!0)):"ArrowUp"===o.key&&s.previousElementSibling?(s.previousElementSibling.focus(),o.consume(!0)):"ArrowDown"===o.key&&s.nextElementSibling&&(s.nextElementSibling.focus(),o.consume(!0))}onAddColorMousedown(){this.addColorToCustomPalette()}onAddColorKeydown(t){e.KeyboardUtilities.isEnterOrSpaceKey(t)&&(this.addColorToCustomPalette(),t.consume(!0))}addColorToCustomPalette(){const t=this.customPaletteSetting.get();t.colors.push(this.colorString()),this.customPaletteSetting.set(t),this.showPalette(t,!1);const e=this.paletteContainer.querySelectorAll(".spectrum-palette-color");e[e.length-1].focus()}showPaletteColorContextMenu(t,e){if(!this.paletteContainerMutable)return;const o=new a.ContextMenu.ContextMenu(e);-1!==t&&(o.defaultSection().appendItem(T(S.removeColor),this.deletePaletteColors.bind(this,t,!1)),o.defaultSection().appendItem(T(S.removeAllToTheRight),this.deletePaletteColors.bind(this,t,!0))),o.defaultSection().appendItem(T(S.clearPalette),this.deletePaletteColors.bind(this,-1,!0)),o.show()}deletePaletteColors(t,e){const o=this.customPaletteSetting.get();e?o.colors.splice(t+1,o.colors.length-t-1):o.colors.splice(t,1),this.customPaletteSetting.set(o),this.showPalette(o,!1)}setColor(t,e){this.innerSetColor(t,"",void 0,e,O.Model);const o=t.as("hsl").canonicalHSLA();a.ARIAUtils.setValueNow(this.hueElement,o[0]),a.ARIAUtils.setValueText(this.alphaElement,o[3])}colorSelected(t){this.innerSetColor(t,"",void 0,void 0,O.Other)}get color(){return this.colorInternal?this.colorInternal:V(this.gamut,this.hsv)}innerSetColor(e,o,s,r,n){if(void 0!==o&&(this.colorStringInternal=o),void 0!==r&&(this.colorFormat=function(t){return"rgba"===t?"rgb":"hsla"===t?"hsl":"hwba"===t?"hwb":"hexa"===t?"hex":"shorthexa"===t?"shorthex":t}(r),this.gamut=H(this.colorFormat)?"display-p3":"srgb"),Array.isArray(e))this.colorInternal=void 0,this.hsv=e;else if(void 0!==e){this.colorInternal=e;const o=this.hsv?this.hsv[0]:null;this.hsv=function(e,o){switch(e){case"display-p3":{const e=o.as("display-p3");return[...t.Color.rgb2hsv([e.p0,e.p1,e.p2]),e.alpha||1]}case"srgb":return o.as("hsl").hsva()}}(this.gamut,e),null!==o&&e.as("lch").isHuePowerless()&&(this.hsv[0]=o)}this.colorNameInternal=s,this.contrastInfo&&this.contrastInfo.setColor(t.Color.Legacy.fromHSVA(this.hsv),this.colorFormat),this.updateHelperLocations(),this.updateUI(),n!==O.Input&&this.updateInput(),n!==O.Model&&this.dispatchEventToListeners(z.ColorChanged,this.colorString())}colorName(){return this.colorNameInternal}colorString(){if(this.colorStringInternal)return this.colorStringInternal;const t=this.color;let e=this.colorFormat&&this.colorFormat!==t.format()?t.asString(this.colorFormat):t.getAuthoredText()??t.asString();return e||(e="nickname"===this.colorFormat?t.asString(t.asLegacyColor().hasAlpha()?"hexa":"hex"):"shorthex"===this.colorFormat?t.asString(t.asLegacyColor().detectHEXFormat()):"hex"===this.colorFormat?t.asString("hexa"):"hsl"===this.colorFormat?t.asString("hsla"):"hwb"===this.colorFormat?t.asString("hwba"):t.asString("rgba"),console.assert(Boolean(e)),e||"")}updateHelperLocations(){const t=this.hsv[0],e=this.hsv[1],o=this.hsv[2],s=this.hsv[3];this.dragX=e*this.dragWidth,this.dragY=this.dragHeight-o*this.dragHeight;const r=Math.max(-this.colorDragElementHeight,Math.min(this.dragWidth-this.colorDragElementHeight,this.dragX-this.colorDragElementHeight)),n=Math.max(-this.colorDragElementHeight,Math.min(this.dragHeight-this.colorDragElementHeight,this.dragY-this.colorDragElementHeight));this.colorDragElement.positionAt(r,n);const a=(1-t)*this.hueAlphaWidth-this.slideHelperWidth;this.hueSlider.style.left=a+"px";const i=s*this.hueAlphaWidth-this.slideHelperWidth;this.alphaSlider.style.left=i+"px"}updateInput(){if("hex"===this.colorFormat||"shorthex"===this.colorFormat||"nickname"===this.colorFormat)this.hexContainer.hidden=!1,this.displayContainer.hidden=!0,"shorthex"===this.colorFormat?this.hexValue.value=String(this.color.asString(this.color.asLegacyColor().detectHEXFormat())):this.hexValue.value=String(this.color.asString(this.color.asLegacyColor().hasAlpha()?"hexa":"hex"));else{this.hexContainer.hidden=!0,this.displayContainer.hidden=!1;const t=d[this.colorFormat],e=t.toValues(this.color);this.textLabels.textContent=t.label;for(let t=0;t<this.textValues.length;++t)a.ARIAUtils.setLabel(this.textValues[t],T(S.sInS,{PH1:this.textLabels.textContent.charAt(t),PH2:this.textLabels.textContent})),this.textValues[t].value=String(e[t])}}hideSrgbOverlay(){this.colorElement.contains(this.srgbOverlay)&&this.colorElement.removeChild(this.srgbOverlay)}showSrgbOverlay(){this.contrastDetails&&this.contrastDetails.expanded()||"display-p3"!==this.gamut||(this.srgbOverlay.render({hue:this.hsv[0],width:this.dragWidth,height:this.dragHeight}),this.colorElement.contains(this.srgbOverlay)||this.colorElement.appendChild(this.srgbOverlay))}updateSrgbOverlay(){"display-p3"===this.gamut?this.showSrgbOverlay():this.hideSrgbOverlay()}updateUI(){this.colorElement.style.backgroundColor=V(this.gamut,[this.hsv[0],1,1,1]).asString(),this.contrastOverlay&&this.contrastOverlay.setDimensions(this.dragWidth,this.dragHeight),this.updateSrgbOverlay(),this.swatch.setColor(this.color,this.colorString()),this.colorDragElement.style.backgroundColor=this.color.asString("lch");const o=t.Color.Legacy.fromHSVA(this.hsv.slice(0,3).concat(1));this.alphaElementBackground.style.backgroundImage=e.StringUtilities.sprintf("linear-gradient(to right, rgba(0,0,0,0), %s)",o.asString("lch")),this.hueElement.classList.toggle("display-p3",H(this.colorFormat))}async showFormatPicker(t){const e=new F(this.color,this.colorFormat);this.isFormatPickerShown=!0,await e.show(t,(t=>{const e=this.color.as(t);this.innerSetColor(e,void 0,void 0,t,O.Other),o.userMetrics.colorConvertedFrom(1)})),this.isFormatPickerShown=!1}pasted(e){if(!e.clipboardData)return;const o=e.clipboardData.getData("text"),s=t.Color.parse(o);s&&(this.innerSetColor(s,o,void 0,void 0,O.Other),e.preventDefault())}inputChanged(e){const o=e.currentTarget,s=a.UIUtils.createReplacementString(o.value,e);s&&(o.value=s,o.selectionStart=0,o.selectionEnd=s.length,e.consume(!0));let r=null;if("hex"===this.colorFormat||"shorthex"===this.colorFormat||"nickname"===this.colorFormat)r=t.Color.parse(this.hexValue.value);else{const t=d[this.colorFormat],e=this.textValues.map((t=>t.value));if(4!==e.length)return;r=t.fromValues(e)}r&&this.innerSetColor(r,void 0,void 0,undefined,O.Input)}wasShown(){this.registerCSSFiles([B]),this.hueAlphaWidth=this.hueElement.offsetWidth,this.slideHelperWidth=this.hueSlider.offsetWidth/2,this.dragWidth=this.colorElement.offsetWidth,this.dragHeight=this.colorElement.offsetHeight,this.colorDragElementHeight=this.colorDragElement.offsetHeight/2,this.innerSetColor(void 0,void 0,void 0,void 0,O.Model),this.eyeDropperExperimentEnabled=r.Runtime.experiments.isEnabled(r.Runtime.ExperimentName.EYEDROPPER_COLOR_PICKER),this.eyeDropperExperimentEnabled?this.colorPickerButton.setToggled(!1):this.toggleColorPicker(!0),this.contrastDetails&&this.contrastDetailsBackgroundColorPickedToggledBound&&this.contrastDetails.addEventListener("BackgroundColorPickerWillBeToggled",this.contrastDetailsBackgroundColorPickedToggledBound)}willHide(){this.toggleColorPicker(!1),this.contrastDetails&&this.contrastDetailsBackgroundColorPickedToggledBound&&this.contrastDetails.removeEventListener("BackgroundColorPickerWillBeToggled",this.contrastDetailsBackgroundColorPickedToggledBound)}async toggleColorPicker(e){const s=this.eyeDropperExperimentEnabled;if(void 0===e&&(e=!this.colorPickerButton.toggled()),this.colorPickerButton.setToggled(e),this.contrastDetails&&e&&this.contrastDetails.backgroundColorPickerEnabled()&&this.contrastDetails.toggleBackgroundColorPicker(!1),s)if(s&&e){const e=new window.EyeDropper;this.eyeDropperAbortController=new AbortController;try{const o=await e.open({signal:this.eyeDropperAbortController.signal}),s=t.Color.parse(o.sRGBHex);this.innerSetColor(s??void 0,"",void 0,void 0,O.Other)}catch(t){"AbortError"!==t.name&&console.error(t)}this.colorPickerButton.setToggled(!1)}else s&&!e&&(this.eyeDropperAbortController?.abort(),this.eyeDropperAbortController=null);else o.InspectorFrontendHost.InspectorFrontendHostInstance.setEyeDropperActive(e),e?o.InspectorFrontendHost.InspectorFrontendHostInstance.events.addEventListener(o.InspectorFrontendHostAPI.Events.EyeDropperPickedColor,this.colorPickedBound):o.InspectorFrontendHost.InspectorFrontendHostInstance.events.removeEventListener(o.InspectorFrontendHostAPI.Events.EyeDropperPickedColor,this.colorPickedBound)}colorPicked({data:e}){const s=[e.r,e.g,e.b,(e.a/2.55|0)/100],r=t.Color.Legacy.fromRGBA(s);this.innerSetColor(r,"",void 0,void 0,O.Other),o.InspectorFrontendHost.InspectorFrontendHostInstance.bringToFront()}}const O={Input:"Input",Model:"Model",Other:"Other"};var z;!function(t){t.ColorChanged="ColorChanged",t.SizeChanged="SizeChanged"}(z||(z={}));const N=24,W=8,_="Page colors";class j{callback;frequencyMap;constructor(t){this.callback=t,this.frequencyMap=new Map;const e=[];for(const t of i.TargetManager.TargetManager.instance().models(i.CSSModel.CSSModel))for(const o of t.allStyleSheets())e.push(this.processStylesheet(o));Promise.all(e).catch((t=>{console.error(t)})).then(this.finish.bind(this))}frequencyComparator(t,e){return this.frequencyMap.get(e)-this.frequencyMap.get(t)}finish(){let e=[...this.frequencyMap.keys()];e=e.sort(this.frequencyComparator.bind(this));const o=new Map;for(;o.size<24&&e.length;){const s=e.shift(),r=t.Color.parse(s);r&&o.set(s,r)}this.callback({title:_,colors:[...o.keys()].sort((function(t,e){const s=o.get(t).as("hsl").hsva(),r=o.get(e).as("hsl").hsva();return r[1]<.12&&s[1]<.12?r[2]*r[3]-s[2]*s[3]:r[1]<.12?-1:s[1]<.12?1:r[0]===s[0]?r[1]*r[3]-s[1]*s[3]:(r[0]+.94)%1-(s[0]+.94)%1})),colorNames:[],mutable:!1,matchUserFormat:void 0})}async processStylesheet(t){let e=(await t.requestContent()).content||"";e=e.toLowerCase();const o=e.match(/((?:rgb|hsl|hwb)a?\([^)]+\)|#[0-9a-f]{6}|#[0-9a-f]{3})/g)||[];for(const t of o){let e=this.frequencyMap.get(t)||0;this.frequencyMap.set(t,++e)}}}const K=new Map([["#F44336",["#FFEBEE","#FFCDD2","#EF9A9A","#E57373","#EF5350","#F44336","#E53935","#D32F2F","#C62828","#B71C1C"]],["#E91E63",["#FCE4EC","#F8BBD0","#F48FB1","#F06292","#EC407A","#E91E63","#D81B60","#C2185B","#AD1457","#880E4F"]],["#9C27B0",["#F3E5F5","#E1BEE7","#CE93D8","#BA68C8","#AB47BC","#9C27B0","#8E24AA","#7B1FA2","#6A1B9A","#4A148C"]],["#673AB7",["#EDE7F6","#D1C4E9","#B39DDB","#9575CD","#7E57C2","#673AB7","#5E35B1","#512DA8","#4527A0","#311B92"]],["#3F51B5",["#E8EAF6","#C5CAE9","#9FA8DA","#7986CB","#5C6BC0","#3F51B5","#3949AB","#303F9F","#283593","#1A237E"]],["#2196F3",["#E3F2FD","#BBDEFB","#90CAF9","#64B5F6","#42A5F5","#2196F3","#1E88E5","#1976D2","#1565C0","#0D47A1"]],["#03A9F4",["#E1F5FE","#B3E5FC","#81D4FA","#4FC3F7","#29B6F6","#03A9F4","#039BE5","#0288D1","#0277BD","#01579B"]],["#00BCD4",["#E0F7FA","#B2EBF2","#80DEEA","#4DD0E1","#26C6DA","#00BCD4","#00ACC1","#0097A7","#00838F","#006064"]],["#009688",["#E0F2F1","#B2DFDB","#80CBC4","#4DB6AC","#26A69A","#009688","#00897B","#00796B","#00695C","#004D40"]],["#4CAF50",["#E8F5E9","#C8E6C9","#A5D6A7","#81C784","#66BB6A","#4CAF50","#43A047","#388E3C","#2E7D32","#1B5E20"]],["#8BC34A",["#F1F8E9","#DCEDC8","#C5E1A5","#AED581","#9CCC65","#8BC34A","#7CB342","#689F38","#558B2F","#33691E"]],["#CDDC39",["#F9FBE7","#F0F4C3","#E6EE9C","#DCE775","#D4E157","#CDDC39","#C0CA33","#AFB42B","#9E9D24","#827717"]],["#FFEB3B",["#FFFDE7","#FFF9C4","#FFF59D","#FFF176","#FFEE58","#FFEB3B","#FDD835","#FBC02D","#F9A825","#F57F17"]],["#FFC107",["#FFF8E1","#FFECB3","#FFE082","#FFD54F","#FFCA28","#FFC107","#FFB300","#FFA000","#FF8F00","#FF6F00"]],["#FF9800",["#FFF3E0","#FFE0B2","#FFCC80","#FFB74D","#FFA726","#FF9800","#FB8C00","#F57C00","#EF6C00","#E65100"]],["#FF5722",["#FBE9E7","#FFCCBC","#FFAB91","#FF8A65","#FF7043","#FF5722","#F4511E","#E64A19","#D84315","#BF360C"]],["#795548",["#EFEBE9","#D7CCC8","#BCAAA4","#A1887F","#8D6E63","#795548","#6D4C41","#5D4037","#4E342E","#3E2723"]],["#9E9E9E",["#FAFAFA","#F5F5F5","#EEEEEE","#E0E0E0","#BDBDBD","#9E9E9E","#757575","#616161","#424242","#212121"]],["#607D8B",["#ECEFF1","#CFD8DC","#B0BEC5","#90A4AE","#78909C","#607D8B","#546E7A","#455A64","#37474F","#263238"]]]),G={title:"Material",mutable:!1,matchUserFormat:!0,colors:[...K.keys()],colorNames:[]};class ${colorString;swatchInnerElement;swatchOverlayElement;swatchCopyIcon;constructor(t){const e=t.createChild("span","swatch");this.swatchInnerElement=e.createChild("span","swatch-inner"),this.swatchOverlayElement=e.createChild("span","swatch-overlay"),a.ARIAUtils.markAsButton(this.swatchOverlayElement),a.ARIAUtils.setPressed(this.swatchOverlayElement,!1),this.swatchOverlayElement.tabIndex=0,self.onInvokeElement(this.swatchOverlayElement,this.onCopyText.bind(this)),this.swatchOverlayElement.addEventListener("mouseout",this.onCopyIconMouseout.bind(this)),this.swatchOverlayElement.addEventListener("blur",this.onCopyIconMouseout.bind(this)),this.swatchCopyIcon=a.Icon.Icon.create("copy","copy-color-icon"),a.Tooltip.Tooltip.install(this.swatchCopyIcon,T(S.copyColorToClipboard)),this.swatchOverlayElement.appendChild(this.swatchCopyIcon),a.ARIAUtils.setLabel(this.swatchOverlayElement,this.swatchCopyIcon.title)}setColor(t,e){const o=t.as("lch");this.swatchInnerElement.style.backgroundColor=o.asString(),this.swatchInnerElement.classList.toggle("swatch-inner-white",o.l>90),this.colorString=e||null,this.swatchOverlayElement.hidden=!e}onCopyText(t){this.swatchCopyIcon.setIconType("checkmark"),o.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(this.colorString),a.ARIAUtils.setPressed(this.swatchOverlayElement,!0),t.consume()}onCopyIconMouseout(){this.swatchCopyIcon.setIconType("copy"),a.ARIAUtils.setPressed(this.swatchOverlayElement,!1)}}var X=Object.freeze({__proto__:null,Spectrum:M,ChangeSource:O,get Events(){return z},PaletteGenerator:j,MaterialPalette:G,Swatch:$});export{p as ColorFormatSpec,v as ContrastDetails,x as ContrastInfo,k as ContrastOverlay,P as FormatPickerContextMenu,X as Spectrum};
@@ -0,0 +1 @@
1
+ import*as e from"./cookie_table.js";self.CookieTable=self.CookieTable||{},CookieTable=CookieTable||{},CookieTable.CookiesTable=e.CookiesTable.CookiesTable,CookieTable.DataGridNode=e.CookiesTable.DataGridNode;
@@ -0,0 +1 @@
1
+ import*as e from"../../../../core/common/common.js";import*as t from"../../../../core/i18n/i18n.js";import*as i from"../../../../core/platform/platform.js";import*as o from"../../../../core/root/root.js";import*as r from"../../../../core/sdk/sdk.js";import*as s from"../../../../models/issues_manager/issues_manager.js";import*as a from"../../../../panels/network/forward/forward.js";import*as l from"../../../components/icon_button/icon_button.js";import*as n from"../../legacy.js";import*as d from"../data_grid/data_grid.js";const u=new CSSStyleSheet;u.replaceSync(".cookies-table{--override-flagged-row-background-color-odd:rgb(247 234 161);--override-flagged-row-background-color-even:rgb(255 240 155)}.-theme-with-dark-background .cookies-table,\n:host-context(.-theme-with-dark-background) .cookies-table{--override-flagged-row-background-color-odd:rgb(94 81 8);--override-flagged-row-background-color-even:rgb(121 103 0)}.cookies-table devtools-icon{margin-right:4px;margin-bottom:-2px}.cookies-table td.flagged-cookie-attribute-cell devtools-icon{filter:grayscale()}.cookies-table:focus-within tr.flagged-cookie-attribute-row.selected devtools-icon{filter:brightness(0) invert(1)}.cookies-table tr.revealed.data-grid-data-grid-node.flagged-cookie-attribute-row:not(.selected):nth-child(odd){background-color:var(--override-flagged-row-background-color-odd)}.cookies-table tr.revealed.data-grid-data-grid-node.flagged-cookie-attribute-row:not(.selected):nth-child(even){background-color:var(--override-flagged-row-background-color-even)}\n/*# sourceURL=cookiesTable.css */\n");const c={session:"Session",name:"Name",value:"Value",size:"Size",editableCookies:"Editable Cookies",cookies:"Cookies",na:"N/A",showRequestsWithThisCookie:"Show Requests With This Cookie",showIssueAssociatedWithThis:"Show issue associated with this cookie",sourcePortTooltip:"Shows the source port (range 1-65535) the cookie was set on. If the port is unknown, this shows -1.",sourceSchemeTooltip:"Shows the source scheme (`Secure`, `NonSecure`) the cookie was set on. If the scheme is unknown, this shows `Unset`.",timeAfter:"after {date}",timeAfterTooltip:"The expiration timestamp is {seconds}, which corresponds to a date after {date}",opaquePartitionKey:"(opaque)"},k=t.i18n.registerUIStrings("ui/legacy/components/cookie_table/CookiesTable.ts",c),b=t.i18n.getLocalizedString.bind(void 0,k),h=t.i18n.getLazilyComputedLocalizedString.bind(void 0,k)(c.session);class C extends n.Widget.VBox{saveCallback;refreshCallback;deleteCallback;dataGrid;lastEditedColumnId;data;cookieDomain;cookieToBlockedReasons;constructor(e,t,i,s,a){super(),this.element.classList.add("cookies-table"),this.saveCallback=t,this.refreshCallback=i,this.deleteCallback=a;const l=Boolean(t),n=[{id:r.Cookie.Attributes.Name,title:b(c.name),sortable:!0,disclosure:l,sort:d.DataGrid.Order.Ascending,longText:!0,weight:24,editable:l},{id:r.Cookie.Attributes.Value,title:b(c.value),sortable:!0,longText:!0,weight:34,editable:l},{id:r.Cookie.Attributes.Domain,title:"Domain",sortable:!0,weight:7,editable:l},{id:r.Cookie.Attributes.Path,title:"Path",sortable:!0,weight:7,editable:l},{id:r.Cookie.Attributes.Expires,title:"Expires / Max-Age",sortable:!0,weight:7,editable:l},{id:r.Cookie.Attributes.Size,title:b(c.size),sortable:!0,align:d.DataGrid.Align.Right,weight:7},{id:r.Cookie.Attributes.HttpOnly,title:"HttpOnly",sortable:!0,align:d.DataGrid.Align.Center,weight:7,dataType:d.DataGrid.DataType.Boolean,editable:l},{id:r.Cookie.Attributes.Secure,title:"Secure",sortable:!0,align:d.DataGrid.Align.Center,weight:7,dataType:d.DataGrid.DataType.Boolean,editable:l},{id:r.Cookie.Attributes.SameSite,title:"SameSite",sortable:!0,weight:7,editable:l},{id:r.Cookie.Attributes.PartitionKey,title:"Partition Key",sortable:!0,weight:7,editable:l},{id:r.Cookie.Attributes.Priority,title:"Priority",sortable:!0,sort:d.DataGrid.Order.Descending,weight:7,editable:l}];if(o.Runtime.experiments.isEnabled("experimentalCookieFeatures")){const e=[{id:r.Cookie.Attributes.SourceScheme,title:"SourceScheme",sortable:!0,align:d.DataGrid.Align.Center,weight:7,editable:l},{id:r.Cookie.Attributes.SourcePort,title:"SourcePort",sortable:!0,align:d.DataGrid.Align.Center,weight:7,editable:l}];n.push(...e)}this.dataGrid=l?new d.DataGrid.DataGridImpl({displayName:b(c.editableCookies),columns:n,editCallback:this.onUpdateCookie.bind(this),deleteCallback:this.onDeleteCookie.bind(this),refreshCallback:i}):new d.DataGrid.DataGridImpl({displayName:b(c.cookies),columns:n,editCallback:void 0,deleteCallback:void 0,refreshCallback:void 0}),this.dataGrid.setStriped(!0),this.dataGrid.setName("cookiesTable"),this.dataGrid.addEventListener(d.DataGrid.Events.SortingChanged,this.rebuildTable,this),this.dataGrid.setRowContextMenuCallback(this.populateContextMenu.bind(this)),e&&this.dataGrid.renderInline(),s&&this.dataGrid.addEventListener(d.DataGrid.Events.SelectedNode,s,this),this.lastEditedColumnId=null,this.dataGrid.asWidget().show(this.element),this.data=[],this.cookieDomain="",this.cookieToBlockedReasons=null}wasShown(){this.registerCSSFiles([u])}setCookies(e,t){this.setCookieFolders([{cookies:e,folderName:null}],t)}setCookieFolders(e,t){this.data=e,this.cookieToBlockedReasons=t||null,this.rebuildTable()}setCookieDomain(e){this.cookieDomain=e}selectedCookie(){const e=this.dataGrid.selectedNode;return e?e.cookie:null}getSelectionCookies(){const e=this.dataGrid.selectedNode,t=e&&e.traverseNextNode(!0),i=e&&e.traversePreviousNode(!0);return{current:e&&e.cookie,neighbor:t&&t.cookie||i&&i.cookie}}willHide(){this.lastEditedColumnId=null}findSelectedCookie(e,t){if(!t)return null;const i=e.current,o=t.find((e=>this.isSameCookie(e,i)));if(o)return o;const r=e.neighbor,s=t.find((e=>this.isSameCookie(e,r)));return s||null}isSameCookie(e,t){return null!=t&&t.name()===e.name()&&t.domain()===e.domain()&&t.path()===e.path()}rebuildTable(){const e=this.getSelectionCookies(),t=this.lastEditedColumnId;this.lastEditedColumnId=null,this.dataGrid.rootNode().removeChildren();for(let i=0;i<this.data.length;++i){const o=this.data[i],s=this.findSelectedCookie(e,o.cookies);if(o.folderName){const e={};e[r.Cookie.Attributes.Name]=o.folderName,e[r.Cookie.Attributes.Value]="",e[r.Cookie.Attributes.Size]=this.totalSize(o.cookies),e[r.Cookie.Attributes.Domain]="",e[r.Cookie.Attributes.Path]="",e[r.Cookie.Attributes.Expires]="",e[r.Cookie.Attributes.HttpOnly]="",e[r.Cookie.Attributes.Secure]="",e[r.Cookie.Attributes.SameSite]="",e[r.Cookie.Attributes.SourcePort]="",e[r.Cookie.Attributes.SourceScheme]="",e[r.Cookie.Attributes.Priority]="";const i=new d.DataGrid.DataGridNode(e);i.selectable=!0,this.dataGrid.rootNode().appendChild(i),i.element().classList.add("row-group"),this.populateNode(i,o.cookies,s,t),i.expand()}else this.populateNode(this.dataGrid.rootNode(),o.cookies,s,t)}e.current&&t&&!this.dataGrid.selectedNode&&this.addInactiveNode(this.dataGrid.rootNode(),e.current,t),this.saveCallback&&this.dataGrid.addCreationNode(!1)}populateNode(e,t,i,o){if(e.removeChildren(),t){this.sortCookies(t);for(let r=0;r<t.length;++r){const s=t[r],a=this.createGridNode(s);e.appendChild(a),this.isSameCookie(s,i)&&(a.select(),null!==o&&this.dataGrid.startEditingNextEditableColumnOfDataGridNode(a,o))}}}addInactiveNode(e,t,i){const o=this.createGridNode(t);e.appendChild(o),o.select(),o.setInactive(!0),null!==i&&this.dataGrid.startEditingNextEditableColumnOfDataGridNode(o,i)}totalSize(e){let t=0;for(let i=0;e&&i<e.length;++i)t+=e[i].size();return t}sortCookies(e){const t=this.dataGrid.isSortOrderAscending()?1:-1;function o(e,t){switch(t){case r.Cookie.Attributes.Name:return String(e.name());case r.Cookie.Attributes.Value:return String(e.value());case r.Cookie.Attributes.Domain:return String(e.domain());case r.Cookie.Attributes.Path:return String(e.path());case r.Cookie.Attributes.HttpOnly:return String(e.httpOnly());case r.Cookie.Attributes.Secure:return String(e.secure());case r.Cookie.Attributes.SameSite:return String(e.sameSite());case r.Cookie.Attributes.PartitionKey:return e.partitionKeyOpaque()?b(c.opaquePartitionKey):String(e.partitionKey());case r.Cookie.Attributes.SourceScheme:return String(e.sourceScheme());default:return String(e.name())}}function s(e,i,o){return t*(e(i)-e(o))}let a;const l=this.dataGrid.sortColumnId()||r.Cookie.Attributes.Name;a=l===r.Cookie.Attributes.Expires?function(e,i){return e.session()!==i.session()?t*(e.session()?1:-1):e.session()?0:e.maxAge()&&i.maxAge()?t*(e.maxAge()-i.maxAge()):e.expires()&&i.expires()?t*(e.expires()-i.expires()):t*(e.expires()?1:-1)}:l===r.Cookie.Attributes.Size?s.bind(null,(e=>e.size())):l===r.Cookie.Attributes.SourcePort?s.bind(null,(e=>e.sourcePort())):l===r.Cookie.Attributes.Priority?function(e,i){const o=["Low","Medium","High"],r=o.indexOf(e.priority()),s=o.indexOf(i.priority());return t*(r-s)}:function(e,r,s){return t*i.StringUtilities.compare(o(r,e),o(s,e))}.bind(null,l),e.sort(a)}createGridNode(e){const i={};let o;if(i[r.Cookie.Attributes.Name]=e.name(),i[r.Cookie.Attributes.Value]=e.value(),e.type()===r.Cookie.Type.Request?(i[r.Cookie.Attributes.Domain]=e.domain()?e.domain():b(c.na),i[r.Cookie.Attributes.Path]=e.path()?e.path():b(c.na)):(i[r.Cookie.Attributes.Domain]=e.domain()||"",i[r.Cookie.Attributes.Path]=e.path()||""),e.maxAge())i[r.Cookie.Attributes.Expires]=t.TimeUtilities.secondsToString(Math.floor(e.maxAge()));else if(e.expires()){const t=e.expires();if(t<0)i[r.Cookie.Attributes.Expires]=h();else{const e=864e13;if(t>e){const s=new Date(e).toISOString();i[r.Cookie.Attributes.Expires]=b(c.timeAfter,{date:s}),o=b(c.timeAfterTooltip,{seconds:t,date:s})}else i[r.Cookie.Attributes.Expires]=new Date(t).toISOString()}}else i[r.Cookie.Attributes.Expires]=e.type()===r.Cookie.Type.Request?b(c.na):h();i[r.Cookie.Attributes.Size]=e.size(),i[r.Cookie.Attributes.HttpOnly]=e.httpOnly(),i[r.Cookie.Attributes.Secure]=e.secure(),i[r.Cookie.Attributes.SameSite]=e.sameSite()||"",i[r.Cookie.Attributes.SourcePort]=e.sourcePort(),i[r.Cookie.Attributes.SourceScheme]=e.sourceScheme(),i[r.Cookie.Attributes.Priority]=e.priority()||"",i[r.Cookie.Attributes.PartitionKey]=e.partitionKey()||"";const s=this.cookieToBlockedReasons?.get(e),a=new m(i,e,s||null);return o&&a.setExpiresTooltip(o),a.selectable=!0,a}onDeleteCookie(e){e.cookie&&this.deleteCallback&&this.deleteCallback(e.cookie,(()=>this.refresh()))}onUpdateCookie(e,t,i,o){this.lastEditedColumnId=t,this.setDefaults(e),this.isValidCookieData(e.data)?this.saveNode(e):e.setDirty(!0)}setDefaults(e){null===e.data[r.Cookie.Attributes.Name]&&(e.data[r.Cookie.Attributes.Name]=""),null===e.data[r.Cookie.Attributes.Value]&&(e.data[r.Cookie.Attributes.Value]=""),null===e.data[r.Cookie.Attributes.Domain]&&(e.data[r.Cookie.Attributes.Domain]=this.cookieDomain),null===e.data[r.Cookie.Attributes.Path]&&(e.data[r.Cookie.Attributes.Path]="/"),null===e.data[r.Cookie.Attributes.Expires]&&(e.data[r.Cookie.Attributes.Expires]=h()),null===e.data[r.Cookie.Attributes.PartitionKey]&&(e.data[r.Cookie.Attributes.PartitionKey]="")}saveNode(e){const t=e.cookie,i=this.createCookieFromData(e.data);e.cookie=i,this.saveCallback&&this.saveCallback(i,t).then((t=>{t?this.refresh():e.setDirty(!0)}))}createCookieFromData(e){const t=new r.Cookie.Cookie(e[r.Cookie.Attributes.Name],e[r.Cookie.Attributes.Value],null,e[r.Cookie.Attributes.Priority]);return t.addAttribute(r.Cookie.Attributes.Domain,e[r.Cookie.Attributes.Domain]),t.addAttribute(r.Cookie.Attributes.Path,e[r.Cookie.Attributes.Path]),e.expires&&e.expires!==h()&&t.addAttribute(r.Cookie.Attributes.Expires,new Date(e[r.Cookie.Attributes.Expires]).toUTCString()),e[r.Cookie.Attributes.HttpOnly]&&t.addAttribute(r.Cookie.Attributes.HttpOnly),e[r.Cookie.Attributes.Secure]&&t.addAttribute(r.Cookie.Attributes.Secure),e[r.Cookie.Attributes.SameSite]&&t.addAttribute(r.Cookie.Attributes.SameSite,e[r.Cookie.Attributes.SameSite]),r.Cookie.Attributes.SourceScheme in e&&t.addAttribute(r.Cookie.Attributes.SourceScheme,e[r.Cookie.Attributes.SourceScheme]),r.Cookie.Attributes.SourcePort in e&&t.addAttribute(r.Cookie.Attributes.SourcePort,Number.parseInt(e[r.Cookie.Attributes.SourcePort],10)||void 0),e[r.Cookie.Attributes.PartitionKey]&&t.addAttribute(r.Cookie.Attributes.PartitionKey,e[r.Cookie.Attributes.PartitionKey]),t.setSize(e[r.Cookie.Attributes.Name].length+e[r.Cookie.Attributes.Value].length),t}isValidCookieData(e){return(Boolean(e.name)||Boolean(e.value))&&this.isValidDomain(e.domain)&&this.isValidPath(e.path)&&this.isValidDate(e.expires)}isValidDomain(t){if(!t)return!0;const i=e.ParsedURL.ParsedURL.fromString("http://"+t);return null!==i&&i.domain()===t}isValidPath(t){const i=e.ParsedURL.ParsedURL.fromString("http://example.com"+t);return null!==i&&i.path===t}isValidDate(e){return""===e||e===h()||!isNaN(Date.parse(e))}refresh(){this.refreshCallback&&this.refreshCallback()}populateContextMenu(t,i){const o=i.cookie;if(!o)return;const r=o;t.revealSection().appendItem(b(c.showRequestsWithThisCookie),(()=>{const t=a.UIFilter.UIRequestFilter.filters([{filterType:a.UIFilter.FilterType.CookieDomain,filterValue:r.domain()},{filterType:a.UIFilter.FilterType.CookieName,filterValue:r.name()}]);e.Revealer.reveal(t)})),s.RelatedIssue.hasIssues(r)&&t.revealSection().appendItem(b(c.showIssueAssociatedWithThis),(()=>{s.RelatedIssue.reveal(r)}))}}class m extends d.DataGrid.DataGridNode{cookie;blockedReasons;expiresTooltip;constructor(e,t,i){super(e),this.cookie=t,this.blockedReasons=i}createCells(e){super.createCells(e),this.blockedReasons&&this.blockedReasons.length&&e.classList.add("flagged-cookie-attribute-row")}setExpiresTooltip(e){this.expiresTooltip=e}createCell(e){const t=super.createCell(e);e===r.Cookie.Attributes.SourcePort?n.Tooltip.Tooltip.install(t,b(c.sourcePortTooltip)):e===r.Cookie.Attributes.SourceScheme?n.Tooltip.Tooltip.install(t,b(c.sourceSchemeTooltip)):e===r.Cookie.Attributes.Expires&&this.expiresTooltip?n.Tooltip.Tooltip.install(t,this.expiresTooltip):n.Tooltip.Tooltip.install(t,t.textContent||"");let i="";if(this.blockedReasons)for(const t of this.blockedReasons){const o=t.attribute===e,s=!t.attribute&&e===r.Cookie.Attributes.Name;(o||s)&&(i&&(i+="\n"),i+=t.uiString)}if(i){const e=new l.Icon.Icon;e.data={iconName:"info",color:"var(--icon-info)",width:"14px",height:"14px"},n.Tooltip.Tooltip.install(e,i),t.insertBefore(e,t.firstChild),t.classList.add("flagged-cookie-attribute-cell")}return t}}var p=Object.freeze({__proto__:null,CookiesTable:C,DataGridNode:m});export{p as CookiesTable};
@@ -0,0 +1 @@
1
+ import*as a from"./data_grid.js";self.DataGrid=self.DataGrid||{},DataGrid=DataGrid||{},DataGrid._preferredWidthSymbol=Symbol("preferredWidth"),DataGrid._columnIdSymbol=Symbol("columnId"),DataGrid._sortIconSymbol=Symbol("sortIcon"),DataGrid._longTextSymbol=Symbol("longText"),DataGrid.DataGrid=a.DataGrid.DataGridImpl,DataGrid.CreationDataGridNode=a.DataGrid.CreationDataGridNode,DataGrid.DataGridNode=a.DataGrid.DataGridNode,DataGrid.DataGridWidget=a.DataGrid.DataGridWidget,DataGrid.DataGrid.Events=a.DataGrid.Events,DataGrid.DataGrid.Order=a.DataGrid.Order,DataGrid.DataGrid.Align=a.DataGrid.Align,DataGrid.DataGrid.DataType=a.DataGrid.DataType,DataGrid.DataGrid.ResizeMethod=a.DataGrid.ResizeMethod,DataGrid.ShowMoreDataGridNode=a.ShowMoreDataGridNode.ShowMoreDataGridNode,DataGrid.SortableDataGrid=a.SortableDataGrid.SortableDataGrid,DataGrid.SortableDataGridNode=a.SortableDataGrid.SortableDataGridNode,DataGrid.ViewportDataGrid=a.ViewportDataGrid.ViewportDataGrid,DataGrid.ViewportDataGrid.Events=a.ViewportDataGrid.Events,DataGrid.ViewportDataGridNode=a.ViewportDataGrid.ViewportDataGridNode;
@@ -0,0 +1 @@
1
+ import*as e from"../../../../core/common/common.js";import*as t from"../../../../core/i18n/i18n.js";import*as i from"../../../../core/platform/platform.js";import*as s from"../../legacy.js";import*as n from"../../../components/render_coordinator/render_coordinator.js";const r=new CSSStyleSheet;r.replaceSync('.data-grid{position:relative;border:1px solid var(--color-details-hairline-light)!important;line-height:120%}.data-grid table{table-layout:fixed;border-spacing:0;border-collapse:separate;height:100%;width:100%}.data-grid .data-container{position:absolute;top:0;bottom:0;left:0;right:0;overflow-x:hidden;overflow-y:overlay;transform:translateZ(0);background-color:var(--color-background)}.data-grid thead{position:sticky;top:0;height:21px;z-index:1}.data-grid .aria-live-label{width:1px;height:1px;overflow:hidden}.data-grid.inline .data-container{position:static}.data-grid .corner{width:14px;padding-right:0;padding-left:0;border-left:0 none transparent!important}.data-grid.inline .corner{display:none}.data-grid.data-grid-fits-viewport .corner{display:none}.data-grid .top-filler-td,\n.data-grid .bottom-filler-td{height:auto!important;padding:0!important}.data-grid table.data{position:absolute;left:0;top:0;right:0;bottom:0;border-top:0 none transparent;table-layout:fixed}.data-grid.inline table.data{position:static}.data-grid tbody tr{display:none;height:20px}.data-grid tbody tr.revealed{display:table-row}.striped-data-grid .revealed.data-grid-data-grid-node:nth-child(odd):not(.dirty):not(.selected),\n.striped-data-grid-starts-with-odd .revealed.data-grid-data-grid-node:nth-child(even):not(.dirty):not(.selected){background-color:var(--color-background-elevation-1)}.data-grid td,\n.data-grid th{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;line-height:18px;height:18px;border-left:1px solid var(--color-details-hairline);padding:1px 4px}.data-grid td{vertical-align:top;user-select:text}.data-grid th{text-align:left;background-color:var(--color-background-elevation-1);border-bottom:1px solid var(--color-details-hairline);font-weight:normal;vertical-align:middle}.data-grid th:first-child,\n.data-grid td:first-child{border-left:none!important}.data-grid td > div,\n.data-grid th > div{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;min-width:8px}.data-grid td.editing > div{text-overflow:clip}.data-grid .center{text-align:center}.data-grid .right{text-align:right}.data-grid th.sortable{position:relative}.data-grid th .sort-order-icon-container{background-color:var(--color-background-elevation-1);min-width:0;position:absolute;top:1px;right:0;bottom:1px;display:flex;align-items:center}.data-grid th:hover .sort-order-icon-container{background-color:var(--color-background-highlight)}.data-grid th .sort-order-icon{margin-right:4px;margin-bottom:-2px;display:none}.data-grid th.sort-ascending .sort-order-icon,\n.data-grid th.sort-descending .sort-order-icon{display:block}.data-grid th.sort-ascending,\n.data-grid th.sort-descending{padding-right:14px}.data-grid th.sortable:hover{background-color:var(--color-background-highlight)}.data-grid .top-filler-td{border-bottom:0 none transparent;line-height:0}.data-grid button{line-height:18px;color:inherit}.data-grid td.disclosure::before{user-select:none;-webkit-mask-image:var(--image-file-triangle-right);float:left;width:14px;height:14px;margin-right:2px;content:"";position:relative;top:3px;background-color:var(--icon-default);transition:transform 200ms}.data-grid tr:not(.parent) td.disclosure::before{background-color:transparent}.data-grid tr.expanded td.disclosure::before{transform:rotate(90deg)}.data-grid tbody tr.revealed.selected{background-color:var(--color-background-highlight);color:inherit}.data-grid tbody tr.revealed.selected.dirty{color:var(--color-selected-option)}.data-grid.no-selection:focus-visible{border:1px solid var(--color-primary-old)!important}.data-grid:focus tbody tr.selected{background-color:var(--color-selected-option-background);color:var(--color-selected-option)}.data-grid tbody tr.selected.dirty{--override-data-grid-dirty-background-color:hsl(0deg 100% 30%);background-color:var(--override-data-grid-dirty-background-color)}.data-grid:focus tr.selected.dirty{--override-data-grid-dirty-background-color:hsl(0deg 100% 70%)}.data-grid:focus tr.selected .devtools-link{color:var(--color-selected-option)}.data-grid:focus tr.parent.selected td.disclosure::before{background-color:var(--icon-force-white)}.data-grid tr.inactive{color:var(--color-text-disabled);font-style:italic}.data-grid tr.dirty{--override-data-grid-dirty-background-color:hsl(0deg 100% 92%);background-color:var(--override-data-grid-dirty-background-color);color:var(--color-red);font-style:normal}.data-grid td.show-more{white-space:normal}.data-grid td.show-more::before{display:none}.data-grid-resizer{position:absolute;top:0;bottom:0;width:5px;z-index:500}@media (forced-colors: active){.sort-order-icon-container [is="ui-icon"].icon-mask,\n .data-grid td.disclosure::before{forced-color-adjust:none;background-color:ButtonText}.data-grid.no-selection:focus-visible *{color:ButtonText}.data-grid th.sortable:hover *,\n .data-grid th.sortable:hover .sort-order-icon-container [is="ui-icon"].icon-mask,\n .data-grid tr.parent.selected td.disclosure::before,\n .data-grid:focus tr.parent.selected td.disclosure::before,\n .data-grid tbody tr.parent.revealed:hover td.disclosure::before{background-color:HighlightText}.striped-data-grid .revealed.data-grid-data-grid-node:nth-child(odd):not(.dirty):not(.selected),\n .striped-data-grid-starts-with-odd .revealed.data-grid-data-grid-node:nth-child(even):not(.dirty):not(.selected),\n .request-cookies-view tr.revealed.data-grid-data-grid-node.flagged-cookie-attribute-row:not(.selected):nth-child(2n),\n .cookies-table tr.revealed.data-grid-data-grid-node.flagged-cookie-attribute-row:not(.selected):nth-child(odd){background-color:canvas}.data-grid.no-selection:focus-visible{forced-color-adjust:none;border-color:Highlight}.data-grid th.sortable:hover,\n .data-grid tbody tr.revealed:hover,\n .data-grid tbody tr.revealed.selected,\n .striped-data-grid .revealed:hover.data-grid-data-grid-node:nth-child(odd):not(.dirty):not(.selected),\n .striped-data-grid-starts-with-odd .revealed:hover.data-grid-data-grid-node:nth-child(even):not(.dirty):not(.selected),\n .request-cookies-view tr.revealed:hover.data-grid-data-grid-node.flagged-cookie-attribute-row:not(.selected):nth-child(2n),\n .cookies-table tr.revealed:hover.data-grid-data-grid-node.flagged-cookie-attribute-row:not(.selected):nth-child(odd){forced-color-adjust:none;background-color:Highlight}.data-grid tbody tr.revealed:hover *,\n .data-grid tbody tr.revealed.selected *,\n .data-grid tbody tr.revealed:focus *,\n .data-grid tbody tr.revealed:hover .heap-object-tag{color:HighlightText}.data-grid th{background-color:canvas;border-color:Highlight}}\n/*# sourceURL=dataGrid.css */\n');const l={expanded:"expanded",collapsed:"collapsed",sRowS:"{PH1} Row {PH2}",rowsS:"Rows: {PH1}",sSUseTheUpAndDownArrowKeysTo:"{PH1} {PH2}, use the up and down arrow keys to navigate and interact with the rows of the table; Use browse mode to read cell by cell.",sortByString:"Sort By",resetColumns:"Reset Columns",headerOptions:"Header Options",refresh:"Refresh",addNew:"Add new",editS:'Edit "{PH1}"',delete:"Delete",levelS:"level {PH1}",checked:"checked",emptyRowCreated:"An empty table row has been created. You may double click or use context menu to edit."},d=t.i18n.registerUIStrings("ui/legacy/components/data_grid/DataGrid.ts",l),a=t.i18n.getLocalizedString.bind(void 0,d),o=new WeakMap,h=new WeakMap,c=new WeakMap,u=new WeakMap,g=new WeakMap,p=new WeakMap;class m extends e.ObjectWrapper.ObjectWrapper{element;displayName;editCallback;deleteCallback;refreshCallback;dataTableHeaders;scrollContainerInternal;dataContainerInternal;dataTable;inline;columnsArray;columns;visibleColumnsArray;cellClass;dataTableHeadInternal;headerRow;dataTableColumnGroup;dataTableBody;topFillerRow;bottomFillerRow;editing;selectedNode;expandNodesWhenArrowing;indentWidth;resizers;columnWidthsInitialized;cornerWidth;resizeMethod;headerContextMenuCallback;rowContextMenuCallback;elementToDataGridNode;disclosureColumnId;sortColumnCell;rootNodeInternal;editingNode;columnWeightsSetting;creationNode;currentResizer;dataGridWidget;constructor(e){super();const{displayName:t,columns:i,editCallback:n,deleteCallback:r,refreshCallback:l}=e;this.element=document.createElement("div"),this.element.classList.add("data-grid"),this.element.tabIndex=0,this.element.addEventListener("keydown",this.keyDown.bind(this),!1),this.element.addEventListener("contextmenu",this.contextMenu.bind(this),!0),this.element.addEventListener("focusin",(e=>{this.updateGridAccessibleNameOnFocus(),e.consume(!0)})),this.element.addEventListener("focusout",(e=>{this.updateGridAccessibleName(""),e.consume(!0)})),s.ARIAUtils.markAsApplication(this.element),this.displayName=t,this.editCallback=n,this.deleteCallback=r,this.refreshCallback=l,this.dataTableHeaders={},this.dataContainerInternal=this.element.createChild("div","data-container"),this.dataTable=this.dataContainerInternal.createChild("table","data"),this.scrollContainerInternal=this.dataContainerInternal,n&&this.dataTable.addEventListener("dblclick",this.ondblclick.bind(this),!1),this.dataTable.addEventListener("mousedown",this.mouseDownInDataTable.bind(this)),this.dataTable.addEventListener("click",this.clickInDataTable.bind(this),!0),this.inline=!1,this.columnsArray=[],this.columns={},this.visibleColumnsArray=i,i.forEach((e=>this.innerAddColumn(e))),this.cellClass=null,this.dataTableColumnGroup=this.dataTable.createChild("colgroup"),this.dataTableHeadInternal=this.dataTable.createChild("thead"),this.headerRow=this.dataTableHeadInternal.createChild("tr"),this.dataTableBody=this.dataTable.createChild("tbody"),this.topFillerRow=this.dataTableBody.createChild("tr","data-grid-filler-row revealed"),s.ARIAUtils.setHidden(this.topFillerRow,!0),this.bottomFillerRow=this.dataTableBody.createChild("tr","data-grid-filler-row revealed"),s.ARIAUtils.setHidden(this.bottomFillerRow,!0),this.setVerticalPadding(0,0,!0),this.refreshHeader(),this.editing=!1,this.selectedNode=null,this.expandNodesWhenArrowing=!1,this.setRootNode(new S),this.setHasSelection(!1),this.indentWidth=15,this.resizers=[],this.columnWidthsInitialized=!1,this.cornerWidth=f,this.resizeMethod=w.Nearest,this.headerContextMenuCallback=null,this.rowContextMenuCallback=null,this.elementToDataGridNode=new WeakMap}firstSelectableNode(){let e=this.rootNodeInternal;for(;e&&!e.selectable;)e=e.traverseNextNode(!0)||void 0;return e}lastSelectableNode(){let e=this.rootNodeInternal,t=this.rootNodeInternal;for(;t;)t.selectable&&(e=t),t=t.traverseNextNode(!0)||void 0;return e}setElementContent(e,t){const i=this.columnIdFromNode(e);if(!i)return;const s=this.columns[i],n=e.parentElement;let r;n&&(r=this.elementToDataGridNode.get(n)),s.dataType===N.Boolean?m.setElementBoolean(e,Boolean(t),r):null!==t&&m.setElementText(e,t,Boolean(s.longText),r)}static setElementText(e,t,n,r){n&&t.length>1e3?(e.textContent=i.StringUtilities.trimEndWithMaxLength(t,1e3),s.Tooltip.Tooltip.install(e,t),o.set(e,t)):(e.textContent=t,s.Tooltip.Tooltip.install(e,""),o.delete(e)),r&&m.updateNodeAccessibleText(r)}static setElementBoolean(e,t,i){e.textContent=t?"✓":"",s.Tooltip.Tooltip.install(e,""),i&&m.updateNodeAccessibleText(i)}static updateNodeAccessibleText(e){let t="",i=e.elementInternal?.children[0]||null;if(i){for(;i&&!i.classList.contains("corner");){let s=null;for(const e of i.classList)if(e.includes("-column")){s=e.substring(0,e.indexOf("-column"));break}if(s&&e.dataGrid){const n=e.dataGrid.columns[s];n&&(t+=`${n.title}: ${i.textContent}, `)}i=i.nextElementSibling}t.length>0&&(t=t.substring(0,t.length-2)),e.nodeAccessibleText=t}}setStriped(e){this.element.classList.toggle("striped-data-grid",e)}setFocusable(e){this.element.tabIndex=e?0:-1,!1===e&&s.ARIAUtils.removeRole(this.element)}setHasSelection(e){this.element.classList.toggle("no-selection",!e)}updateGridAccessibleName(e){const t=this.selectedNode&&this.selectedNode.existingElement()?this.selectedNode.nodeAccessibleText:"";this.element===i.DOMUtilities.deepActiveElement(this.element.ownerDocument)&&s.ARIAUtils.alert(e||t)}updateGridAccessibleNameOnFocus(){let e;if(this.selectedNode&&this.selectedNode.existingElement()){let t="";this.selectedNode.hasChildren()&&(t=this.selectedNode.expanded?a(l.expanded):a(l.collapsed));e=`${a(l.sRowS,{PH1:this.displayName,PH2:t})} ${this.selectedNode.nodeAccessibleText}`}else{if(!this.rootNodeInternal)return;const t=this.enumerateChildren(this.rootNodeInternal,[],1),i=a(l.rowsS,{PH1:t.length});e=a(l.sSUseTheUpAndDownArrowKeysTo,{PH1:this.displayName,PH2:i})}s.ARIAUtils.alert(e)}innerAddColumn(e,t){e.defaultWeight=e.weight;const i=e.id;i in this.columns&&this.innerRemoveColumn(i),void 0===t&&(t=this.columnsArray.length),this.columnsArray.splice(t,0,e),this.columns[i]=e,e.disclosure&&(this.disclosureColumnId=i);const n=document.createElement("th");n.className=i+"-column",h.set(n,i),this.dataTableHeaders[i]=n;const r=document.createElement("div");if(e.titleDOMFragment?r.appendChild(e.titleDOMFragment):r.textContent=e.title||null,n.appendChild(r),e.sort&&(n.classList.add(e.sort),this.sortColumnCell=n),e.sortable){n.addEventListener("click",this.clickInHeaderCell.bind(this),!1),n.classList.add("sortable");const e=s.Icon.Icon.create("","sort-order-icon");n.createChild("div","sort-order-icon-container").appendChild(e),c.set(n,e)}}addColumn(e,t){this.innerAddColumn(e,t)}innerRemoveColumn(e){if(!this.columns[e])return;delete this.columns[e];const t=this.columnsArray.findIndex((t=>t.id===e));this.columnsArray.splice(t,1);const i=this.dataTableHeaders[e];i.parentElement&&i.parentElement.removeChild(i),delete this.dataTableHeaders[e]}removeColumn(e){this.innerRemoveColumn(e)}setCellClass(e){this.cellClass=e}refreshHeader(){this.dataTableColumnGroup.removeChildren(),this.headerRow.removeChildren(),this.topFillerRow.removeChildren(),this.bottomFillerRow.removeChildren();for(let e=0;e<this.visibleColumnsArray.length;++e){const t=this.visibleColumnsArray[e],i=t.id,s=this.dataTableColumnGroup.createChild("col");t.width&&(s.style.width=t.width),this.headerRow.appendChild(this.dataTableHeaders[i]);const n=this.topFillerRow.createChild("th","top-filler-td");n.textContent=t.title||null,n.scope="col";const r=this.bottomFillerRow.createChild("td","bottom-filler-td");h.set(r,i)}const e=this.headerRow.createChild("th","corner");s.ARIAUtils.setHidden(e,!0);const t=this.topFillerRow.createChild("th","corner");t.classList.add("top-filler-td"),t.scope="col",this.bottomFillerRow.createChild("td","corner").classList.add("bottom-filler-td"),this.dataTableColumnGroup.createChild("col","corner")}setVerticalPadding(e,t,i=!1){const s=e+"px",n=e||t?t+"px":"auto";this.topFillerRow.style.height===s&&this.bottomFillerRow.style.height===n||(this.topFillerRow.style.height=s,this.bottomFillerRow.style.height=n,i||this.dispatchEventToListeners(b.PaddingChanged))}setRootNode(e){this.rootNodeInternal&&(this.rootNodeInternal.removeChildren(),this.rootNodeInternal.dataGrid=null,this.rootNodeInternal.isRoot=!1),this.rootNodeInternal=e,e.isRoot=!0,e.setHasChildren(!1),e.expandedInternal=!0,e.revealedInternal=!0,e.selectable=!1,e.dataGrid=this}rootNode(){let e=this.rootNodeInternal;return e||(e=new S,this.setRootNode(e)),e}ondblclick(e){if(this.editing||this.editingNode)return;const t=this.columnIdFromNode(e.target);t&&this.columns[t].editable&&this.startEditing(e.target)}startEditingColumnOfDataGridNode(e,t){this.editing=!0,this.editingNode=e,this.editingNode.select();const i=this.editingNode.element();if(!i)return;const n=i.children[t],r=o.get(n);r&&(n.textContent=r);const l=this.visibleColumnsArray[t];if(l.dataType===N.Boolean){const t=s.UIUtils.CheckboxLabel.create(void 0,e.data[l.id]);s.ARIAUtils.setLabel(t,l.title||"");let i=!1;t.style.height="100%";const r=t.checkboxElement;r.classList.add("inside-datagrid");const d=r.checked;r.addEventListener("change",(()=>{i=!0,this.editingCommitted(n,r.checked,d,void 0,"forward")}),!1),r.addEventListener("keydown",(e=>{if("Tab"===e.key)return e.consume(!0),i=!0,this.editingCommitted(n,r.checked,d,void 0,e.shiftKey?"backward":"forward");" "===e.key?(e.consume(!0),r.checked=!r.checked):"Enter"===e.key&&(e.consume(!0),i=!0,this.editingCommitted(n,r.checked,d,void 0,"forward"))}),!1),r.addEventListener("blur",(()=>{i||this.editingCommitted(n,r.checked,r.checked,void 0,"next")}),!1),n.innerHTML="",n.appendChild(t),r.focus()}else{s.InplaceEditor.InplaceEditor.startEditing(n,this.startEditingConfig(n));const e=n.getComponentSelection();e&&e.selectAllChildren(n)}}startEditingNextEditableColumnOfDataGridNode(e,t,i){const s=this.columns[t],n=this.visibleColumnsArray.indexOf(s),r=this.nextEditableColumn(n,!1,i);-1!==r&&this.startEditingColumnOfDataGridNode(e,r)}startEditing(e){if(!s.UIUtils.enclosingNodeOrSelfWithNodeName(e,"td"))return;if(this.editingNode=this.dataGridNodeFromNode(e),!this.editingNode){if(!this.creationNode)return;this.editingNode=this.creationNode}if(this.editingNode instanceof y&&this.editingNode.isCreationNode)return void this.startEditingColumnOfDataGridNode(this.editingNode,this.nextEditableColumn(-1));const t=this.columnIdFromNode(e);if(!t)return;const i=this.columns[t],n=this.visibleColumnsArray.indexOf(i);this.editingNode&&this.startEditingColumnOfDataGridNode(this.editingNode,n)}renderInline(){this.element.classList.add("inline"),this.cornerWidth=0,this.inline=!0,this.updateWidths()}startEditingConfig(e){return new s.InplaceEditor.Config(this.editingCommitted.bind(this),this.editingCancelled.bind(this))}editingCommitted(e,t,i,s,n){const r=this.columnIdFromNode(e);if(!r)return void this.editingCancelled(e);const l=this.columns[r],d=this.visibleColumnsArray.indexOf(l);if(!this.editingNode)return;const a=null===this.editingNode.data[r]?"":this.editingNode.data[r],o=this.editingNode;function h(e){if(n){if("forward"===n){const t=this.nextEditableColumn(-1),i=o instanceof y&&o.isCreationNode;if(i&&d===t&&!e)return;const s=this.nextEditableColumn(d);if(-1!==s)return void this.startEditingColumnOfDataGridNode(o,s);const n=o.traverseNextNode(!0,null,!0);return n?void this.startEditingColumnOfDataGridNode(n,t):i&&e&&this.creationNode?(this.addCreationNode(!1),void this.startEditingColumnOfDataGridNode(this.creationNode,t)):void 0}if("backward"!==n);else{const e=this.nextEditableColumn(d,!0);if(-1!==e)return void this.startEditingColumnOfDataGridNode(o,e);const t=this.nextEditableColumn(this.visibleColumnsArray.length,!0),i=o.traversePreviousNode(!0,!0);i&&this.startEditingColumnOfDataGridNode(i,t)}}}if(this.setElementContent(e,t),a===t)return this.editingCancelled(e),void h.call(this,!1);this.editingNode.data[r]=t,this.editCallback&&(this.editCallback(this.editingNode,r,a,t),this.editingNode instanceof y&&this.editingNode.isCreationNode&&this.addCreationNode(!1),this.editingCancelled(e),h.call(this,!0))}editingCancelled(e){this.editing=!1,this.editingNode=null}nextEditableColumn(e,t,i){const s=t?-1:1,n=i?e:e+s,r=this.visibleColumnsArray;for(let e=n;e>=0&&e<r.length;e+=s)if(r[e].editable)return e;return-1}sortColumnId(){return this.sortColumnCell&&h.get(this.sortColumnCell)||null}sortOrder(){return!this.sortColumnCell||this.sortColumnCell.classList.contains(C.Ascending)?C.Ascending:this.sortColumnCell.classList.contains(C.Descending)?C.Descending:null}isSortOrderAscending(){return!this.sortColumnCell||this.sortColumnCell.classList.contains(C.Ascending)}autoSizeWidths(e,t,i){t&&(t=Math.min(t,Math.floor(100/e.length)));let s=0;for(let t=0;t<e.length;++t)s+=e[t];let n=0;for(let r=0;r<e.length;++r){let l=Math.round(100*e[r]/s);t&&l<t?l=t:i&&l>i&&(l=i),n+=l,e[r]=l}let r=n-100;for(;t&&r>0;)for(let i=0;i<e.length&&(!(e[i]>t)||(--e[i],--r,r));++i);for(;i&&r<0;)for(let t=0;t<e.length&&(!(e[t]<i)||(++e[t],++r,r));++t);return e}autoSizeColumns(e,t,i){let s=[];for(let e=0;e<this.columnsArray.length;++e)s.push((this.columnsArray[e].title||"").length);if(i=i||0,!this.rootNodeInternal)return;const n=this.enumerateChildren(this.rootNodeInternal,[],i+1);for(let e=0;e<n.length;++e){const t=n[e];for(let e=0;e<this.columnsArray.length;++e){const i=String(t.data[this.columnsArray[e].id]);i.length>s[e]&&(s[e]=i.length)}}s=this.autoSizeWidths(s,e,t);for(let e=0;e<this.columnsArray.length;++e)this.columnsArray[e].weight=s[e];this.columnWidthsInitialized=!1,this.updateWidths()}enumerateChildren(e,t,i){if(e.isRoot||t.push(e),!i)return[];for(let s=0;s<e.children.length;++s)this.enumerateChildren(e.children[s],t,i-1);return t}onResize(){this.updateWidths()}updateWidths(){if(!this.columnWidthsInitialized&&this.element.offsetWidth){const e=this.element.offsetWidth-this.cornerWidth,t=this.dataTableHeadInternal.rows[0].cells.length-1;for(let i=0;i<t;i++){const t=this.visibleColumnsArray[i];t.weight||(t.weight=100*this.getPreferredWidth(i)/e||10)}this.columnWidthsInitialized=!0}this.applyColumnWeights()}indexOfVisibleColumn(e){return this.visibleColumnsArray.findIndex((t=>t.id===e))}setName(t){this.columnWeightsSetting=e.Settings.Settings.instance().createSetting("dataGrid-"+t+"-columnWeights",{}),this.loadColumnWeights()}resetColumnWeights(){for(const e of this.columnsArray)e.defaultWeight&&(e.weight=e.defaultWeight);this.applyColumnWeights(),this.saveColumnWeights()}loadColumnWeights(){if(!this.columnWeightsSetting)return;const e=this.columnWeightsSetting.get();for(let t=0;t<this.columnsArray.length;++t){const i=this.columnsArray[t],s=e[i.id];s&&(i.weight=s)}this.applyColumnWeights()}saveColumnWeights(){if(!this.columnWeightsSetting)return;const e={};for(let t=0;t<this.columnsArray.length;++t){const i=this.columnsArray[t];e[i.id]=i.weight}this.columnWeightsSetting.set(e)}wasShown(){this.loadColumnWeights()}willHide(){}getPreferredWidth(e){return u.get(this.dataTableColumnGroup.children[e])||this.dataTableHeadInternal.rows[0].cells[e].offsetWidth}applyColumnWeights(){let e=this.element.offsetWidth-this.cornerWidth;if(e<=0)return;let t=0;const i=[];for(let s=0;s<this.visibleColumnsArray.length;++s){if(this.visibleColumnsArray[s].fixedWidth){const t=this.getPreferredWidth(s);i[s]=t,e-=t}else t+=this.visibleColumnsArray[s].weight||0}let s=0,n=0;for(let r=0;r<this.visibleColumnsArray.length;++r){const l=this.visibleColumnsArray[r];let d;if(l.fixedWidth)d=i[r];else{s+=l.weight||0;const i=s*e/t|0;d=Math.max(i-n,14),n=i}this.setPreferredWidth(r,d)}this.positionResizers()}setColumnsVisiblity(e){this.visibleColumnsArray=[];for(const t of this.columnsArray)e.has(t.id)&&this.visibleColumnsArray.push(t);this.refreshHeader(),this.applyColumnWeights();const t=this.enumerateChildren(this.rootNode(),[],-1);for(const e of t)e.refresh()}get scrollContainer(){return this.scrollContainerInternal}positionResizers(){const e=this.dataTableColumnGroup.children.length-1,t=[],i=this.resizers;for(;i.length>e-1;){const e=i.pop();e&&e.remove()}for(let i=0;i<e-1;i++)t[i]=(t[i-1]||0)+this.dataTableHeadInternal.rows[0].cells[i].offsetWidth;for(let n=0;n<e-1;n++){let e=i[n];e||(e=document.createElement("div"),p.set(e,n),e.classList.add("data-grid-resizer"),s.UIUtils.installDragHandle(e,this.startResizerDragging.bind(this),this.resizerDragging.bind(this),this.endResizerDragging.bind(this),"col-resize"),this.element.appendChild(e),i.push(e)),g.get(e)!==t[n]&&(g.set(e,t[n]),e.style.left=t[n]+"px")}}addCreationNode(e){this.creationNode&&this.creationNode.makeNormal();const t={};for(const e in this.columns)t[e]=null;this.creationNode=new y(t,e),s.ARIAUtils.alert(a(l.emptyRowCreated)),this.rootNode().appendChild(this.creationNode)}keyDown(e){if(!(e instanceof KeyboardEvent))return;if(e.shiftKey||e.metaKey||e.ctrlKey||this.editing||s.UIUtils.isEditing())return;let t,i=!1;if(this.selectedNode)if("ArrowUp"!==e.key||e.altKey)if("ArrowDown"!==e.key||e.altKey){if("ArrowLeft"===e.key)this.selectedNode.expanded?(e.altKey?this.selectedNode.collapseRecursively():this.selectedNode.collapse(),i=!0):this.selectedNode.parent&&!this.selectedNode.parent.isRoot&&(i=!0,this.selectedNode.parent.selectable?(t=this.selectedNode.parent,i=!!t):this.selectedNode.parent&&this.selectedNode.parent.collapse());else if("ArrowRight"===e.key)this.selectedNode.revealed?this.selectedNode.hasChildren()&&(i=!0,this.selectedNode.expanded?(t=this.selectedNode.children[0],i=!!t):e.altKey?this.selectedNode.expandRecursively():this.selectedNode.expand()):(this.selectedNode.reveal(),i=!0);else if(8===e.keyCode||46===e.keyCode)this.deleteCallback&&(i=!0,this.deleteCallback(this.selectedNode));else if("Enter"===e.key)if(this.editCallback){i=!0;const e=this.selectedNode.element();if(!e)return;this.startEditing(e.children[this.nextEditableColumn(-1)])}else this.dispatchEventToListeners(b.OpenedNode,this.selectedNode)}else{for(t=this.selectedNode.traverseNextNode(!0);t&&!t.selectable;)t=t.traverseNextNode(!0);i=!!t}else{for(t=this.selectedNode.traversePreviousNode(!0);t&&!t.selectable;)t=t.traversePreviousNode(!0);i=!!t}else"ArrowUp"!==e.key||e.altKey?"ArrowDown"!==e.key||e.altKey||(t=this.firstSelectableNode()):t=this.lastSelectableNode(),i=!!t;t&&(t.reveal(),t.select()),i&&this.element!==document.activeElement&&!this.element.contains(document.activeElement)&&this.element.focus(),i&&e.consume(!0)}updateSelectionBeforeRemoval(e,t){let i,s=this.selectedNode;for(;s&&s!==e;)s=s.parent;if(!s)return;for(s=e;s&&!s.nextSibling;s=s.parent);for(s&&(i=s.nextSibling);i&&!i.selectable;)i=i.traverseNextNode(!0);const n=i instanceof y&&i.isCreationNode;if(!i||n){if(!e)return;for(i=e.traversePreviousNode(!0);i&&!i.selectable;)i=i.traversePreviousNode(!0)}i?(i.reveal(),i.select()):this.selectedNode&&this.selectedNode.deselect()}dataGridNodeFromNode(e){const t=s.UIUtils.enclosingNodeOrSelfWithNodeName(e,"tr");return t&&this.elementToDataGridNode.get(t)||null}columnIdFromNode(e){const t=s.UIUtils.enclosingNodeOrSelfWithNodeName(e,"td");return t&&h.get(t)||null}clickInHeaderCell(e){const t=s.UIUtils.enclosingNodeOrSelfWithNodeName(e.target,"th");t&&this.sortByColumnHeaderCell(t)}sortByColumnHeaderCell(e){if(!h.has(e)||!e.classList.contains("sortable"))return;let t=C.Ascending;e===this.sortColumnCell&&this.isSortOrderAscending()&&(t=C.Descending),this.sortColumnCell&&this.sortColumnCell.classList.remove(C.Ascending,C.Descending),this.sortColumnCell=e,e.classList.add(t);const i=c.get(e);i&&(i.setIconType(t===C.Ascending?"triangle-up":"triangle-down"),this.dispatchEventToListeners(b.SortingChanged))}markColumnAsSortedBy(e,t){this.sortColumnCell&&this.sortColumnCell.classList.remove(C.Ascending,C.Descending),this.sortColumnCell=this.dataTableHeaders[e],this.sortColumnCell.classList.add(t)}headerTableHeader(e){return this.dataTableHeaders[e]}mouseDownInDataTable(e){const t=e.target,i=this.dataGridNodeFromNode(t);if(!i||!i.selectable||i.isEventWithinDisclosureTriangle(e))return;const s=this.columnIdFromNode(t);s&&this.columns[s].nonSelectable||(e.metaKey?i.selected?i.deselect():i.select():(i.select(),this.dispatchEventToListeners(b.OpenedNode,i)))}setHeaderContextMenuCallback(e){this.headerContextMenuCallback=e}setRowContextMenuCallback(e){this.rowContextMenuCallback=e}contextMenu(e){if(!(e instanceof MouseEvent))return;const t=new s.ContextMenu.ContextMenu(e),i=e.target,n=this.visibleColumnsArray.filter((e=>e.sortable&&e.title)),r=this.columnsArray.filter((e=>-1===n.indexOf(e)&&e.allowInSortByEvenWhenHidden)),d=[...n,...r];if(d.length>0){const e=t.defaultSection().appendSubMenuItem(a(l.sortByString));for(const t of d){const i=this.dataTableHeaders[t.id];e.defaultSection().appendItem(t.title,this.sortByColumnHeaderCell.bind(this,i))}}if(i.isSelfOrDescendant(this.dataTableHeadInternal))return this.headerContextMenuCallback&&this.headerContextMenuCallback(t),t.defaultSection().appendItem(a(l.resetColumns),this.resetColumnWeights.bind(this)),void t.show();const o=t.defaultSection().appendSubMenuItem(a(l.headerOptions));this.headerContextMenuCallback&&this.headerContextMenuCallback(o),o.defaultSection().appendItem(a(l.resetColumns),this.resetColumnWeights.bind(this));const h=0===e.button,c=h?this.selectedNode:this.dataGridNodeFromNode(i),u=this.selectedNode&&this.selectedNode.existingElement();if(h&&u){const e=u.getBoundingClientRect();if(e){const i=(e.right+e.left)/2,s=(e.bottom+e.top)/2;t.setX(i),t.setY(s)}}if(!this.refreshCallback||c&&c===this.creationNode||t.defaultSection().appendItem(a(l.refresh),this.refreshCallback.bind(this)),c&&c.selectable&&!c.isEventWithinDisclosureTriangle(e)){if(this.editCallback)if(c===this.creationNode){const e=this.nextEditableColumn(-1),i=c.element().children[e];t.defaultSection().appendItem(a(l.addNew),this.startEditing.bind(this,i))}else if(h){const e=this.nextEditableColumn(-1);if(e>-1){const i=this.visibleColumnsArray[e];i&&i.editable&&t.defaultSection().appendItem(a(l.editS,{PH1:String(i.title)}),this.startEditingColumnOfDataGridNode.bind(this,c,e))}}else{const e=this.columnIdFromNode(i);e&&this.columns[e].editable&&t.defaultSection().appendItem(a(l.editS,{PH1:String(this.columns[e].title)}),this.startEditing.bind(this,i))}this.deleteCallback&&c!==this.creationNode&&t.defaultSection().appendItem(a(l.delete),this.deleteCallback.bind(this,c)),this.rowContextMenuCallback&&this.rowContextMenuCallback(t,c)}t.show()}clickInDataTable(e){const t=this.dataGridNodeFromNode(e.target);t&&t.hasChildren()&&t.isEventWithinDisclosureTriangle(e)&&(t.expanded?e.altKey?t.collapseRecursively():t.collapse():e.altKey?t.expandRecursively():t.expand())}setResizeMethod(e){this.resizeMethod=e}startResizerDragging(e){return this.currentResizer=e.target,!0}endResizerDragging(){this.currentResizer=null,this.saveColumnWeights()}resizerDragging(e){const t=this.currentResizer;if(!t)return;let s=e.clientX-this.element.getBoundingClientRect().left,n=0,r=p.get(t);if(void 0===r)return;let l=r+1;for(let e=0;e<r;e++)n+=this.getPreferredWidth(e);this.resizeMethod===w.Last?l=this.resizers.length:this.resizeMethod===w.First&&(n+=this.getPreferredWidth(r)-this.getPreferredWidth(0),r=0);const d=n+this.getPreferredWidth(r)+this.getPreferredWidth(l),a=n+x,o=d-x;if(a>o)return;s=i.NumberUtilities.clamp(s,a,o);const h=s-I;g.set(t,h),t.style.left=h+"px",this.setPreferredWidth(r,s-n),this.setPreferredWidth(l,d-s);const c=this.visibleColumnsArray[r],u=this.visibleColumnsArray[l];if(c.weight&&u.weight){const e=c.weight+u.weight,t=d-n;c.weight=(s-n)*e/t,u.weight=(d-s)*e/t}this.positionResizers(),this.updateWidths(),e.preventDefault()}setPreferredWidth(e,t){const i=this.dataTableColumnGroup.children[e];u.set(i,t),i.style.width=t+"px"}columnOffset(e){if(!this.element.offsetWidth)return 0;for(let t=1;t<this.visibleColumnsArray.length;++t)if(e===this.visibleColumnsArray[t].id&&this.resizers[t-1])return g.get(this.resizers[t-1])||0;return 0}asWidget(){return this.dataGridWidget||(this.dataGridWidget=new k(this)),this.dataGridWidget}topFillerRowElement(){return this.topFillerRow}headerHeightInScroller(){return this.scrollContainer===this.dataContainerInternal?this.headerHeight():0}headerHeight(){return this.dataTableHeadInternal.offsetHeight}revealNode(e){e.scrollIntoViewIfNeeded(!1),e.offsetTop-this.scrollContainer.scrollTop<this.headerHeight()&&(this.scrollContainer.scrollTop=e.offsetTop-this.headerHeight())}}const f=14;var b,C,v,N;!function(e){e.SelectedNode="SelectedNode",e.DeselectedNode="DeselectedNode",e.OpenedNode="OpenedNode",e.SortingChanged="SortingChanged",e.PaddingChanged="PaddingChanged"}(b||(b={})),function(e){e.Ascending="sort-ascending",e.Descending="sort-descending"}(C||(C={})),function(e){e.Center="center",e.Right="right"}(v||(v={})),function(e){e.String="String",e.Boolean="Boolean"}(N||(N={}));const x=24,I=3;var w;!function(e){e.Nearest="nearest",e.First="first",e.Last="last"}(w||(w={}));class S{elementInternal;expandedInternal;selectedInternal;dirty;inactive;key;depthInternal;revealedInternal;attachedInternal;savedPosition;shouldRefreshChildrenInternal;dataInternal;hasChildrenInternal;children;dataGrid;parent;previousSibling;nextSibling;#e=15;selectable;isRoot;nodeAccessibleText;cellAccessibleTextMap;isCreationNode;constructor(e,t){this.elementInternal=null,this.expandedInternal=!1,this.selectedInternal=!1,this.dirty=!1,this.inactive=!1,this.attachedInternal=!1,this.savedPosition=null,this.shouldRefreshChildrenInternal=!0,this.dataInternal=e||{},this.hasChildrenInternal=t||!1,this.children=[],this.dataGrid=null,this.parent=null,this.previousSibling=null,this.nextSibling=null,this.selectable=!0,this.isRoot=!1,this.nodeAccessibleText="",this.cellAccessibleTextMap=new Map,this.isCreationNode=!1}element(){if(!this.elementInternal){const e=this.createElement();this.createCells(e)}return this.elementInternal}createElement(){return this.elementInternal=document.createElement("tr"),this.elementInternal.classList.add("data-grid-data-grid-node"),this.dataGrid&&this.dataGrid.elementToDataGridNode.set(this.elementInternal,this),this.hasChildrenInternal&&this.elementInternal.classList.add("parent"),this.expanded&&this.elementInternal.classList.add("expanded"),this.selected&&this.elementInternal.classList.add("selected"),this.revealed&&this.elementInternal.classList.add("revealed"),this.dirty&&this.elementInternal.classList.add("dirty"),this.inactive&&this.elementInternal.classList.add("inactive"),this.isCreationNode&&this.elementInternal.classList.add("creation-node"),this.elementInternal}existingElement(){return this.elementInternal||null}resetElement(){this.elementInternal=null}createCells(e){if(e.removeChildren(),!this.dataGrid||!this.parent)return;const t=this.dataGrid.visibleColumnsArray,i=[];!this.hasChildrenInternal&&this.parent.isRoot||i.push(a(l.levelS,{PH1:this.depth+1}));for(let s=0;s<t.length;++s){const n=t[s],r=e.appendChild(this.createCell(n.id));n.dataType===N.Boolean&&!0===this.data[n.id]&&this.setCellAccessibleName(a(l.checked),r,n.id),i.push(`${n.title}: ${this.cellAccessibleTextMap.get(n.id)||r.textContent}`)}this.nodeAccessibleText=i.join(", ");const n=this.createTDWithClass("corner");s.ARIAUtils.setHidden(n,!0),e.appendChild(n)}get data(){return this.dataInternal}set data(e){this.dataInternal=e||{},this.refresh()}get revealed(){if(void 0!==this.revealedInternal)return this.revealedInternal;let e=this.parent;for(;e&&!e.isRoot;){if(!e.expanded)return this.revealedInternal=!1,!1;e=e.parent}return this.revealed=!0,!0}set revealed(e){if(this.revealedInternal!==e){this.revealedInternal=e,this.elementInternal&&this.elementInternal.classList.toggle("revealed",this.revealedInternal);for(let t=0;t<this.children.length;++t)this.children[t].revealed=e&&this.expanded}}isDirty(){return this.dirty}setDirty(e){this.dirty!==e&&(this.dirty=e,this.elementInternal&&(e?this.elementInternal.classList.add("dirty"):this.elementInternal.classList.remove("dirty")))}isInactive(){return this.inactive}setInactive(e){this.inactive!==e&&(this.inactive=e,this.elementInternal&&(e?this.elementInternal.classList.add("inactive"):this.elementInternal.classList.remove("inactive")))}hasChildren(){return this.hasChildrenInternal}setHasChildren(e){this.hasChildrenInternal!==e&&(this.hasChildrenInternal=e,this.elementInternal&&(this.elementInternal.classList.toggle("parent",this.hasChildrenInternal),this.elementInternal.classList.toggle("expanded",this.hasChildrenInternal&&this.expanded)))}get depth(){return void 0!==this.depthInternal||(this.parent&&!this.parent.isRoot?this.depthInternal=this.parent.depth+1:this.depthInternal=0),this.depthInternal}get leftPadding(){return this.depth*(this.dataGrid?this.dataGrid.indentWidth:1)}get shouldRefreshChildren(){return this.shouldRefreshChildrenInternal}set shouldRefreshChildren(e){this.shouldRefreshChildrenInternal=e,e&&this.expanded&&this.expand()}get selected(){return this.selectedInternal}set selected(e){e?this.select():this.deselect()}get expanded(){return this.expandedInternal}set expanded(e){e?this.expand():this.collapse()}refresh(){this.dataGrid||(this.elementInternal=null),this.elementInternal&&this.createCells(this.elementInternal)}createTDWithClass(e){const t=document.createElement("td");e&&(t.className=e);const i=this.dataGrid?this.dataGrid.cellClass:null;return i&&t.classList.add(i),t}createTD(e){const t=this.createTDWithClass(e+"-column");if(h.set(t,e),this.dataGrid){const i=this.dataGrid.columns[e].align;i&&t.classList.add(i),e===this.dataGrid.disclosureColumnId&&(t.classList.add("disclosure"),this.leftPadding&&t.style.setProperty("padding-left",this.leftPadding+"px"));this.dataGrid.columns[e].editable&&(t.tabIndex=0,t.ariaHasPopup="true")}return t}createCell(e){const t=this.createTD(e),i=this.data[e];return i instanceof Node?t.appendChild(i):null!==i&&this.dataGrid&&this.dataGrid.setElementContent(t,i),t}setCellAccessibleName(e,t,i){this.cellAccessibleTextMap.set(i,e);for(let e=0;e<t.children.length;e++)s.ARIAUtils.markAsHidden(t.children[e]);s.ARIAUtils.setLabel(t,e)}nodeSelfHeight(){return 20}appendChild(e){this.insertChild(e,this.children.length)}resetNode(e){delete this.depthInternal,delete this.revealedInternal,e||(this.previousSibling&&(this.previousSibling.nextSibling=this.nextSibling),this.nextSibling&&(this.nextSibling.previousSibling=this.previousSibling),this.dataGrid=null,this.parent=null,this.nextSibling=null,this.previousSibling=null,this.attachedInternal=!1)}insertChild(e,t){if(!e)throw"insertChild: Node can't be undefined or null.";if(e.parent===this){const i=this.children.indexOf(e);if(i<0&&console.assert(!1,"Inconsistent DataGrid state"),i===t)return;i<t&&--t}e.remove(),this.children.splice(t,0,e),this.setHasChildren(!0),e.parent=this,e.dataGrid=this.dataGrid,e.recalculateSiblings(t),e.shouldRefreshChildrenInternal=!0;let i=e.children[0];for(;i;)i.resetNode(!0),i.dataGrid=this.dataGrid,i.attachedInternal=!1,i.shouldRefreshChildrenInternal=!0,i=i.traverseNextNode(!1,e,!0);this.expanded&&e.attach(),this.revealed||(e.revealed=!1)}remove(){this.parent&&this.parent.removeChild(this)}removeChild(e){if(!e)throw"removeChild: Node can't be undefined or null.";if(e.parent!==this)throw"removeChild: Node is not a child of this node.";this.dataGrid&&this.dataGrid.updateSelectionBeforeRemoval(e,!1),e.detach(),e.resetNode(),i.ArrayUtilities.removeElement(this.children,e,!0),this.children.length<=0&&this.setHasChildren(!1)}removeChildren(){this.dataGrid&&this.dataGrid.updateSelectionBeforeRemoval(this,!0);for(let e=0;e<this.children.length;++e){const t=this.children[e];t.detach(),t.resetNode()}this.children=[],this.setHasChildren(!1)}recalculateSiblings(e){if(!this.parent)return;const t=this.parent.children[e-1]||null;t&&(t.nextSibling=this),this.previousSibling=t;const i=this.parent.children[e+1]||null;i&&(i.previousSibling=this),this.nextSibling=i}collapse(){if(!this.isRoot){this.elementInternal&&this.elementInternal.classList.remove("expanded"),this.expandedInternal=!1,this.selected&&this.dataGrid&&this.dataGrid.updateGridAccessibleName(a(l.collapsed));for(let e=0;e<this.children.length;++e)this.children[e].revealed=!1}}collapseRecursively(){let e=this;for(;e;)e.expanded&&e.collapse(),e=e.traverseNextNode(!1,this,!0)}populate(){}expand(){if(this.hasChildrenInternal&&!this.expandedInternal&&!this.isRoot){if(this.revealed&&!this.shouldRefreshChildrenInternal)for(let e=0;e<this.children.length;++e)this.children[e].revealed=!0;if(this.shouldRefreshChildrenInternal){for(let e=0;e<this.children.length;++e)this.children[e].detach();if(this.populate(),this.attachedInternal)for(let e=0;e<this.children.length;++e){const t=this.children[e];this.revealed&&(t.revealed=!0),t.attach()}this.shouldRefreshChildrenInternal=!1}this.elementInternal&&this.elementInternal.classList.add("expanded"),this.selected&&this.dataGrid&&this.dataGrid.updateGridAccessibleName(a(l.expanded)),this.expandedInternal=!0}}expandRecursively(){let e=this;for(;e;)e.expand(),e=e.traverseNextNode(!1,this)}reveal(){if(this.isRoot||!this.dataGrid)return;let e=this.parent;for(;e&&!e.isRoot;)e.expanded||e.expand(),e=e.parent;this.dataGrid.revealNode(this.element())}select(e){this.dataGrid&&this.selectable&&!this.selected&&(this.dataGrid.selectedNode&&this.dataGrid.selectedNode.deselect(),this.selectedInternal=!0,this.dataGrid.selectedNode=this,this.elementInternal&&(this.elementInternal.classList.add("selected"),this.dataGrid.setHasSelection(!0),this.dataGrid.updateGridAccessibleName()),e||this.dataGrid.dispatchEventToListeners(b.SelectedNode,this))}revealAndSelect(){this.isRoot||(this.reveal(),this.select())}deselect(e){this.dataGrid&&this.dataGrid.selectedNode===this&&this.selected&&(this.selectedInternal=!1,this.dataGrid.selectedNode=null,this.elementInternal&&(this.elementInternal.classList.remove("selected"),this.dataGrid.setHasSelection(!1),this.dataGrid.updateGridAccessibleName("")),e||this.dataGrid.dispatchEventToListeners(b.DeselectedNode))}traverseNextNode(e,t,i,s){!i&&this.hasChildrenInternal&&this.populate(),s&&(s.depthChange=0);let n=!e||this.revealed?this.children[0]:null;if(n&&(!e||this.expanded))return s&&(s.depthChange=1),n;if(this===t)return null;if(n=!e||this.revealed?this.nextSibling:null,n)return n;for(n=this;n&&!n.isRoot&&(e&&!n.revealed||!n.nextSibling)&&n.parent!==t;)s&&(s.depthChange-=1),n=n.parent;return n&&(!e||n.revealed)?n.nextSibling:null}traversePreviousNode(e,t){let i=!e||this.revealed?this.previousSibling:null;for(!t&&i&&i.hasChildrenInternal&&i.populate();i&&(!e||i.revealed&&i.expanded)&&i.children[i.children.length-1];)!t&&i.hasChildrenInternal&&i.populate(),i=!e||i.revealed&&i.expanded?i.children[i.children.length-1]:null;return i||(!this.parent||this.parent.isRoot?null:this.parent)}isEventWithinDisclosureTriangle(e){if(!this.hasChildrenInternal)return!1;const t=s.UIUtils.enclosingNodeOrSelfWithNodeName(e.target,"td");if(!(t&&t instanceof HTMLElement&&t.classList.contains("disclosure")))return!1;const i=t.getBoundingClientRect().left+this.leftPadding;return e.pageX>=i&&e.pageX<=i+this.#e}attach(){if(!this.dataGrid||this.attachedInternal)return;this.attachedInternal=!0;const e=this.traversePreviousNode(!0,!0),t=e?e.element():this.dataGrid.topFillerRow;if(this.dataGrid.dataTableBody.insertBefore(this.element(),t.nextSibling),this.expandedInternal)for(let e=0;e<this.children.length;++e)this.children[e].attach()}detach(){if(this.attachedInternal){this.attachedInternal=!1,this.elementInternal&&this.elementInternal.remove();for(let e=0;e<this.children.length;++e)this.children[e].detach()}}savePosition(){if(!this.savedPosition){if(!this.parent)throw"savePosition: Node must have a parent.";this.savedPosition={parent:this.parent,index:this.parent.children.indexOf(this)}}}restorePosition(){this.savedPosition&&(this.parent!==this.savedPosition.parent&&this.savedPosition.parent.insertChild(this,this.savedPosition.index),this.savedPosition=null)}}class y extends S{isCreationNode;constructor(e,t){super(e,t),this.isCreationNode=!0}makeNormal(){this.isCreationNode=!1}}class k extends s.Widget.VBox{dataGrid;constructor(e){super(),this.dataGrid=e,this.element.appendChild(e.element),this.setDefaultFocusedElement(e.element)}wasShown(){this.registerCSSFiles([r]),this.dataGrid.wasShown()}willHide(){this.dataGrid.willHide()}onResize(){this.dataGrid.onResize()}elementsToRestoreScrollPositionsFor(){return[this.dataGrid.scrollContainer]}}var A=Object.freeze({__proto__:null,DataGridImpl:m,CornerWidth:f,get Events(){return b},get Order(){return C},get Align(){return v},get DataType(){return N},ColumnResizePadding:x,CenterResizerOverBorderAdjustment:I,get ResizeMethod(){return w},DataGridNode:S,CreationDataGridNode:y,DataGridWidget:k});const G={collapsed:"collapsed"},T=t.i18n.registerUIStrings("ui/legacy/components/data_grid/ViewportDataGrid.ts",G),R=t.i18n.getLocalizedString.bind(void 0,T),E=n.RenderCoordinator.RenderCoordinator.instance();class L extends(e.ObjectWrapper.eventMixin(m)){onScrollBound;visibleNodes;stickToBottom;updateIsFromUser;lastScrollTop;firstVisibleIsStriped;isStriped;constructor(e){super(e),this.onScrollBound=this.onScroll.bind(this),this.scrollContainer.addEventListener("scroll",this.onScrollBound,!0),this.visibleNodes=[],this.inline=!1,this.stickToBottom=!1,this.updateIsFromUser=!1,this.lastScrollTop=0,this.firstVisibleIsStriped=!1,this.isStriped=!1,this.setRootNode(new W)}setStriped(e){this.isStriped=e;let t=!0;if(this.visibleNodes.length){const e=this.rootNode().flatChildren();t=Boolean(e.indexOf(this.visibleNodes[0]))}this.updateStripesClass(t)}updateStripesClass(e){this.element.classList.toggle("striped-data-grid",!e&&this.isStriped),this.element.classList.toggle("striped-data-grid-starts-with-odd",e&&this.isStriped)}setScrollContainer(e){this.scrollContainer.removeEventListener("scroll",this.onScrollBound,!0),this.scrollContainerInternal=e,this.scrollContainer.addEventListener("scroll",this.onScrollBound,!0)}onResize(){this.stickToBottom&&(this.scrollContainer.scrollTop=this.scrollContainer.scrollHeight-this.scrollContainer.clientHeight),this.scheduleUpdate(),super.onResize()}setStickToBottom(e){this.stickToBottom=e}onScroll(e){this.stickToBottom=s.UIUtils.isScrolledToBottom(this.scrollContainer),this.lastScrollTop!==this.scrollContainer.scrollTop&&this.scheduleUpdate(!0)}scheduleUpdateStructure(){this.scheduleUpdate()}scheduleUpdate(e){this.stickToBottom&&e&&(this.stickToBottom=s.UIUtils.isScrolledToBottom(this.scrollContainer)),this.updateIsFromUser=this.updateIsFromUser||Boolean(e),E.write("ViewportDataGrid.render",this.update.bind(this))}updateInstantly(){this.update()}renderInline(){this.inline=!0,super.renderInline(),this.update()}calculateVisibleNodes(e,t){const i=this.rootNode().flatChildren();if(this.inline)return{topPadding:0,bottomPadding:0,contentHeight:0,visibleNodes:i,offset:0};const s=i.length;let n=0,r=0;for(;n<s&&r+i[n].nodeSelfHeight()<t;++n)r+=i[n].nodeSelfHeight();const l=n,d=r;for(;n<s&&r<t+e;++n)r+=i[n].nodeSelfHeight();const a=n;let o=0;for(;n<s;++n)o+=i[n].nodeSelfHeight();return{topPadding:d,bottomPadding:o,contentHeight:r-d,visibleNodes:i.slice(l,a),offset:l}}contentHeight(){const e=this.rootNode().flatChildren();let t=0;for(let i=0,s=e.length;i<s;++i)t+=e[i].nodeSelfHeight();return t}update(){const e=this.scrollContainer.clientHeight-this.headerHeightInScroller();let t=this.scrollContainer.scrollTop;const i=t,s=Math.max(0,this.contentHeight()-e);!this.updateIsFromUser&&this.stickToBottom&&(t=s),this.updateIsFromUser=!1,t=Math.min(s,t);const n=this.calculateVisibleNodes(e,t),r=n.visibleNodes,l=new Set(r);for(let e=0;e<this.visibleNodes.length;++e){const t=this.visibleNodes[e];if(!l.has(t)&&t.attached()){const e=t.existingElement();e&&e.remove()}}let d=this.topFillerRowElement();const a=this.dataTableBody;let o=n.offset;if(r.length){const e=this.rootNode().flatChildren().indexOf(r[0]);this.updateStripesClass(Boolean(e%2)),this.stickToBottom&&-1!==e&&Boolean(e%2)!==this.firstVisibleIsStriped&&(o+=1)}this.firstVisibleIsStriped=Boolean(o%2);for(let e=0;e<r.length;++e){const t=r[e],i=t.element();t.setStriped((o+e)%2==0),i!==d.nextSibling&&a.insertBefore(i,d.nextSibling),t.revealed=!0,d=i}this.setVerticalPadding(n.topPadding,n.bottomPadding),this.lastScrollTop=t,t!==i&&(this.scrollContainer.scrollTop=t);const h=n.contentHeight<=e&&n.topPadding+n.bottomPadding===0;h!==this.element.classList.contains("data-grid-fits-viewport")&&(this.element.classList.toggle("data-grid-fits-viewport",h),this.updateWidths()),this.visibleNodes=r,this.dispatchEventToListeners(H.ViewportCalculated)}revealViewportNode(e){const t=this.rootNode().flatChildren(),i=t.indexOf(e);if(-1===i)return;let s=0;for(let e=0;e<i;++e)s+=t[e].nodeSelfHeight();const n=s+e.nodeSelfHeight();let r=this.scrollContainer.scrollTop;const l=this.scrollContainer.offsetHeight-this.headerHeightInScroller();r>s?(r=s,this.stickToBottom=!1):r+l<n&&(r=n-l),this.scrollContainer.scrollTop=r}}var H;!function(e){e.ViewportCalculated="ViewportCalculated"}(H||(H={}));class W extends S{stale;flatNodes;isStripedInternal;constructor(e,t){super(e,t),this.stale=!1,this.flatNodes=null,this.isStripedInternal=!1}element(){const e=this.existingElement(),t=e||this.createElement();return e&&!this.stale||(this.createCells(t),this.stale=!1),t}setStriped(e){this.isStripedInternal=e,this.element().classList.toggle("odd",e)}isStriped(){return this.isStripedInternal}clearFlatNodes(){this.flatNodes=null;const e=this.parent;e&&e.clearFlatNodes()}flatChildren(){if(this.flatNodes)return this.flatNodes;const e=[],t=[this.children],i=[0];let s=0;for(;s>=0;){if(t[s].length<=i[s]){s--;continue}const n=t[s][i[s]++];e.push(n),n.expanded&&n.children.length&&(s++,t[s]=n.children,i[s]=0)}return this.flatNodes=e,e}insertChild(e,t){if(this.clearFlatNodes(),e.parent===this){const i=this.children.indexOf(e);if(i<0&&console.assert(!1,"Inconsistent DataGrid state"),i===t)return;i<t&&--t}e.remove(),e.parent=this,e.dataGrid=this.dataGrid,this.children.length||this.setHasChildren(!0),this.children.splice(t,0,e),e.recalculateSiblings(t),this.expanded&&this.dataGrid&&this.dataGrid.scheduleUpdateStructure()}removeChild(e){if(this.clearFlatNodes(),this.dataGrid&&this.dataGrid.updateSelectionBeforeRemoval(e,!1),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),e.nextSibling&&(e.nextSibling.previousSibling=e.previousSibling),e.parent!==this)throw"removeChild: Node is not a child of this node.";i.ArrayUtilities.removeElement(this.children,e,!0),e.unlink(),this.children.length||this.setHasChildren(!1),this.expanded&&this.dataGrid&&this.dataGrid.scheduleUpdateStructure()}removeChildren(){this.clearFlatNodes(),this.dataGrid&&this.dataGrid.updateSelectionBeforeRemoval(this,!0);for(let e=0;e<this.children.length;++e)this.children[e].unlink();this.children=[],this.expanded&&this.dataGrid&&this.dataGrid.scheduleUpdateStructure()}unlink(){const e=this.existingElement();this.attached()&&e&&e.remove(),this.resetNode()}collapse(){if(!this.expanded)return;this.clearFlatNodes(),this.expandedInternal=!1;const e=this.existingElement();e&&e.classList.remove("expanded"),this.selected&&this.dataGrid.updateGridAccessibleName(R(G.collapsed)),this.dataGrid.scheduleUpdateStructure()}expand(){this.expanded||(this.dataGrid.stickToBottom=!1,this.clearFlatNodes(),super.expand(),this.dataGrid.scheduleUpdateStructure())}attached(){const e=this.existingElement();return Boolean(this.dataGrid&&e&&e.parentElement)}refresh(){this.attached()?(this.stale=!0,this.dataGrid.scheduleUpdate()):this.resetElement()}reveal(){this.dataGrid.revealViewportNode(this)}recalculateSiblings(e){this.clearFlatNodes(),super.recalculateSiblings(e)}}var P=Object.freeze({__proto__:null,ViewportDataGrid:L,get Events(){return H},ViewportDataGridNode:W});class D extends L{sortingFunction;constructor(e){super(e),this.sortingFunction=D.TrivialComparator,this.setRootNode(new U)}static TrivialComparator(e,t){return 0}static NumericComparator(e,t,i){const s=t.data[e],n=i.data[e],r=Number(s instanceof Node?s.textContent:s),l=Number(n instanceof Node?n.textContent:n);return r<l?-1:r>l?1:0}static StringComparator(e,t,i){const s=t.data[e],n=i.data[e],r=s instanceof Node?s.textContent:String(s),l=n instanceof Node?n.textContent:String(n);return r&&l?r<l?-1:r>l?1:0:0}static Comparator(e,t,i,s){return t?e(s,i):e(i,s)}static create(e,t,i){const s=e.length;if(!s)return null;const n=[];for(let t=0;t<e.length;++t){const i=String(t);n.push({id:i,title:e[t],sortable:!0})}const r=[];for(let i=0;i<t.length/s;++i){const n={};for(let r=0;r<e.length;++r)n[r]=t[s*i+r];const l=new U(n);l.selectable=!1,r.push(l)}const l=new D({displayName:i,columns:n}),d=r.length,a=l.rootNode();for(let e=0;e<d;++e)a.appendChild(r[e]);return l.addEventListener(b.SortingChanged,(function(){const e=l.rootNode().children,t=l.sortColumnId();if(!t)return;let i=!0;for(let s=0;s<e.length;s++){const n=e[s].data[t];if(isNaN(n instanceof Node?n.textContent:n)){i=!1;break}}const s=i?D.NumericComparator:D.StringComparator;l.sortNodes(s.bind(null,t),!l.isSortOrderAscending())})),l}insertChild(e){this.rootNode().insertChildOrdered(e)}sortNodes(e,t){this.sortingFunction=D.Comparator.bind(null,e,t),this.rootNode().recalculateSiblings(0),this.rootNode().sortChildren(),this.scheduleUpdateStructure()}}class U extends W{constructor(e,t){super(e,t)}insertChildOrdered(e){const t=this.dataGrid;t&&this.insertChild(e,i.ArrayUtilities.upperBound(this.children,e,t.sortingFunction))}sortChildren(){const e=this.dataGrid;if(e){this.children.sort(e.sortingFunction);for(let e=0;e<this.children.length;++e){this.children[e].recalculateSiblings(e)}for(let e=0;e<this.children.length;++e){this.children[e].sortChildren()}}}}var B=Object.freeze({__proto__:null,SortableDataGrid:D,SortableDataGridNode:U});const F={showDBefore:"Show {PH1} before",showDAfter:"Show {PH1} after",showAllD:"Show all {PH1}"},z=t.i18n.registerUIStrings("ui/legacy/components/data_grid/ShowMoreDataGridNode.ts",F),O=t.i18n.getLocalizedString.bind(void 0,z);var M=Object.freeze({__proto__:null,ShowMoreDataGridNode:class extends S{callback;startPosition;endPosition;chunkSize;showNext;showAll;showLast;selectable;hasCells;constructor(e,t,i,s){super({summaryRow:!0},!1),this.callback=e,this.startPosition=t,this.endPosition=i,this.chunkSize=s,this.showNext=document.createElement("button"),this.showNext.classList.add("text-button"),this.showNext.type="button",this.showNext.addEventListener("click",this.showNextChunk.bind(this),!1),this.showNext.textContent=O(F.showDBefore,{PH1:this.chunkSize}),this.showAll=document.createElement("button"),this.showAll.classList.add("text-button"),this.showAll.type="button",this.showAll.addEventListener("click",this.showAllInternal.bind(this),!1),this.showLast=document.createElement("button"),this.showLast.classList.add("text-button"),this.showLast.type="button",this.showLast.addEventListener("click",this.showLastChunk.bind(this),!1),this.showLast.textContent=O(F.showDAfter,{PH1:this.chunkSize}),this.updateLabels(),this.selectable=!1}showNextChunk(){this.callback(this.startPosition,this.startPosition+this.chunkSize)}showAllInternal(){this.callback(this.startPosition,this.endPosition)}showLastChunk(){this.callback(this.endPosition-this.chunkSize,this.endPosition)}updateLabels(){const e=this.endPosition-this.startPosition;e>this.chunkSize?(this.showNext.classList.remove("hidden"),this.showLast.classList.remove("hidden")):(this.showNext.classList.add("hidden"),this.showLast.classList.add("hidden")),this.showAll.textContent=O(F.showAllD,{PH1:e})}createCells(e){this.hasCells=!1,super.createCells(e)}createCell(e){const t=this.createTD(e);return t.classList.add("show-more"),this.hasCells||(this.hasCells=!0,this.depth&&this.dataGrid&&t.style.setProperty("padding-left",this.depth*this.dataGrid.indentWidth+"px"),t.appendChild(this.showNext),t.appendChild(this.showAll),t.appendChild(this.showLast)),t}setStartPosition(e){this.startPosition=e,this.updateLabels()}setEndPosition(e){this.endPosition=e,this.updateLabels()}nodeSelfHeight(){return 40}dispose(){}}});export{A as DataGrid,M as ShowMoreDataGridNode,B as SortableDataGrid,P as ViewportDataGrid};
@@ -0,0 +1 @@
1
+ import*as e from"./inline_editor.js";self.InlineEditor=self.InlineEditor||{},InlineEditor=InlineEditor||{},InlineEditor.BezierEditor=e.BezierEditor.BezierEditor,InlineEditor.BezierEditor.Events=e.BezierEditor.Events,InlineEditor.BezierEditor.Presets=e.BezierEditor.Presets,InlineEditor.BezierUI=e.BezierUI.BezierUI,InlineEditor.BezierUI.Height=e.BezierUI.Height,InlineEditor.CSSShadowEditor=e.CSSShadowEditor.CSSShadowEditor,InlineEditor.CSSShadowEditor.Events=e.CSSShadowEditor.Events,InlineEditor.CSSShadowModel=e.CSSShadowModel.CSSShadowModel,InlineEditor.CSSLength=e.CSSShadowModel.CSSLength,InlineEditor.BezierSwatch=e.Swatches.BezierSwatch,InlineEditor.FontEditor=e.FontEditor.FontEditor,InlineEditor.FontEditor.Events=e.FontEditor.Events,InlineEditor.CSSShadowSwatch=e.Swatches.CSSShadowSwatch,InlineEditor.SwatchPopoverHelper=e.SwatchPopoverHelper.SwatchPopoverHelper;